From 77eff60dc3e10668a1e184b15274d2e94fcbb5b8 Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:07:45 +0000 Subject: [PATCH 01/15] feat(Spanner): Add BatchWrite feature * Add API skeleton in the ConnectionInterface --- Spanner/src/Connection/ConnectionInterface.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Spanner/src/Connection/ConnectionInterface.php b/Spanner/src/Connection/ConnectionInterface.php index ebf70141b424..24f417672720 100644 --- a/Spanner/src/Connection/ConnectionInterface.php +++ b/Spanner/src/Connection/ConnectionInterface.php @@ -283,4 +283,9 @@ public function partitionQuery(array $args); * @param array $args */ public function partitionRead(array $args); + + /** + * @param array $args + */ + public function batchWrite(array $args); } From 874fb1dc57b9b7831921fd6b4b7281171386bb44 Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:17:39 +0000 Subject: [PATCH 02/15] Extract mutation parsing logic for reuse --- Spanner/src/Connection/Grpc.php | 94 +++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 41 deletions(-) diff --git a/Spanner/src/Connection/Grpc.php b/Spanner/src/Connection/Grpc.php index ef357964b1b3..3a08d490ecf9 100644 --- a/Spanner/src/Connection/Grpc.php +++ b/Spanner/src/Connection/Grpc.php @@ -1090,47 +1090,7 @@ public function commit(array $args) { $inputMutations = $this->pluck('mutations', $args); - $mutations = []; - if (is_array($inputMutations)) { - foreach ($inputMutations as $mutation) { - $type = array_keys($mutation)[0]; - $data = $mutation[$type]; - - switch ($type) { - case Operation::OP_DELETE: - if (isset($data['keySet'])) { - $data['keySet'] = $this->formatKeySet($data['keySet']); - } - - $operation = $this->serializer->decodeMessage( - new Delete, - $data - ); - break; - default: - $operation = new Write; - $operation->setTable($data['table']); - $operation->setColumns($data['columns']); - - $modifiedData = []; - foreach ($data['values'] as $key => $param) { - $modifiedData[$key] = $this->fieldValue($param); - } - - $list = new ListValue; - $list->setValues($modifiedData); - $values = [$list]; - $operation->setValues($values); - - break; - } - - $setterName = $this->mutationSetters[$type]; - $mutation = new Mutation; - $mutation->$setterName($operation); - $mutations[] = $mutation; - } - } + $mutations = $this->parseMutations($inputMutations); if (isset($args['singleUseTransaction'])) { $readWrite = $this->serializer->decodeMessage( @@ -1160,6 +1120,10 @@ public function commit(array $args) ]); } + public function batchWrite(array $args) { + + } + /** * @param array $args */ @@ -1620,4 +1584,52 @@ private function setDirectedReadOptions(array &$args) ); } } + + private function parseMutations($rawMutations) + { + if (!is_array($rawMutations)) { + return []; + } + + $mutations = []; + foreach ($rawMutations as $mutation) { + $type = array_keys($mutation)[0]; + $data = $mutation[$type]; + + switch ($type) { + case Operation::OP_DELETE: + if (isset($data['keySet'])) { + $data['keySet'] = $this->formatKeySet($data['keySet']); + } + + $operation = $this->serializer->decodeMessage( + new Delete, + $data + ); + break; + default: + $operation = new Write; + $operation->setTable($data['table']); + $operation->setColumns($data['columns']); + + $modifiedData = []; + foreach ($data['values'] as $key => $param) { + $modifiedData[$key] = $this->fieldValue($param); + } + + $list = new ListValue; + $list->setValues($modifiedData); + $values = [$list]; + $operation->setValues($values); + + break; + } + + $setterName = $this->mutationSetters[$type]; + $mutation = new Mutation; + $mutation->$setterName($operation); + $mutations[] = $mutation; + } + return $mutations; + } } From 8f556cbe40449782e8d3221fa684643e7c0d88bb Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:45:49 +0000 Subject: [PATCH 03/15] Add BatchWrite API to Grpc --- Spanner/src/Connection/Grpc.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Spanner/src/Connection/Grpc.php b/Spanner/src/Connection/Grpc.php index 3a08d490ecf9..b7d5ac0b6d03 100644 --- a/Spanner/src/Connection/Grpc.php +++ b/Spanner/src/Connection/Grpc.php @@ -1120,8 +1120,27 @@ public function commit(array $args) ]); } - public function batchWrite(array $args) { + /** + * @param array $args + * @return \Generator + */ + public function batchWrite(array $args) + { + $databaseName = $this->pluck('database', $args); + $mutationGroups = $this->parseMutations($this->pluck('mutationGroups', $args)); + $requestOptions = $this->pluck('requestOptions', $args, false) ?: []; + if ($requestOptions) { + $args['requestOptions'] = $this->serializer->decodeMessage( + new RequestOptions, + $requestOptions + ); + } + return $this->send([$this->spannerClient, 'batchWrite'], [ + $this->pluck('session', $args), + $mutationGroups, + $this->addResourcePrefixHeader($args, $databaseName) + ]); } /** From d56db7ae5c24f99b34067368d5e9569561eb74bb Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:09:24 +0000 Subject: [PATCH 04/15] Create MutationGroup and MutationTrait --- Spanner/src/MutationGroup.php | 266 ++++++++++++++++++++++++++++++++++ Spanner/src/MutationTrait.php | 99 +++++++++++++ Spanner/src/Operation.php | 38 +---- 3 files changed, 366 insertions(+), 37 deletions(-) create mode 100644 Spanner/src/MutationGroup.php create mode 100644 Spanner/src/MutationTrait.php diff --git a/Spanner/src/MutationGroup.php b/Spanner/src/MutationGroup.php new file mode 100644 index 000000000000..66421ca0fffb --- /dev/null +++ b/Spanner/src/MutationGroup.php @@ -0,0 +1,266 @@ +mapper = new ValueMapper($returnInt64AsObject); + $this->mutationGroup = []; + } + + /** + * Add an insert mutation. + * + * Example: + * ``` + * $mutationGroup->insert('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ]); + * ``` + * + * @param string $table The table to insert into. + * @param array $data The data to insert. + * @return MutationGroup Current mutation group data object. + */ + public function insert($table, array $data) + { + return $this->insertBatch($table, [$data]); + } + + /** + * Add one or more insert mutations. + * + * Example: + * ``` + * $mutationGroup->insertBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ] + * ]); + * ``` + * + * @param string $table The table to insert into. + * @param array $dataSet The data to insert. + * @return MutationGroup Current mutation group, to enable object chaining. + */ + public function insertBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_INSERT, $table, $dataSet); + + return $this; + } + + /** + * Add an update mutation. + * + * Example: + * ``` + * $mutationGroup->update('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post [Updated!]', + * 'content' => 'Modified Content' + * ]); + * ``` + * + * @param string $table The table to update. + * @param array $data The data to update. + * @return MutationGroup Current mutation group, to enable object chaining. + */ + public function update($table, array $data) + { + return $this->updateBatch($table, [$data]); + } + + /** + * Add one or more update mutations. + * + * Example: + * ``` + * $mutationGroup->updateBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post [Updated!]', + * 'content' => 'Modified Content' + * ] + * ]); + * ``` + * + * @param string $table The table to update. + * @param array $dataSet The data to update. + * @return MutationGroup Current mutation group, to enable object chaining. + */ + public function updateBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_UPDATE, $table, $dataSet); + + return $this; + } + + /** + * Add an insert or update mutation. + * + * Example: + * ``` + * $mutationGroup->insertOrUpdate('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ]); + * ``` + * + * @param string $table The table to insert into or update. + * @param array $data The data to insert or update. + * @return MutationGroup Current mutation group, to enable object chaining. + */ + public function insertOrUpdate($table, array $data) + { + return $this->insertOrUpdateBatch($table, [$data]); + } + + /** + * Add one or more insert or update mutations. + * + * Example: + * ``` + * $mutationGroup->insertOrUpdateBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ] + * ]); + * ``` + * + * @param string $table The table to insert into or update. + * @param array $dataSet The data to insert or update. + * @return MutationGroup Current mutation group, to enable object chaining. + */ + public function insertOrUpdateBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_INSERT_OR_UPDATE, $table, $dataSet); + + return $this; + } + + /** + * Add an replace mutation. + * + * Example: + * ``` + * $mutationGroup->replace('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post [Replaced]', + * 'content' => 'Hello Moon' + * ]); + * ``` + * + * @param string $table The table to replace into. + * @param array $data The data to replace. + * @return MutationGroup Current mutation group, to enable object chaining. + */ + public function replace($table, array $data) + { + return $this->replaceBatch($table, [$data]); + } + + /** + * Add one or more replace mutations. + * + * Example: + * ``` + * $mutationGroup->replaceBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post [Replaced]', + * 'content' => 'Hello Moon' + * ] + * ]); + * ``` + * + * @param string $table The table to replace into. + * @param array $dataSet The data to replace. + * @return MutationGroup Current mutation group, to enable object chaining. + */ + public function replaceBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_REPLACE, $table, $dataSet); + + return $this; + } + + /** + * Add an delete mutation. + * + * Example: + * ``` + * $keySet = new KeySet([ + * 'keys' => [10] + * ]); + * + * $mutationGroup->delete('Posts', $keySet); + * ``` + * + * @param string $table The table to mutate. + * @param KeySet $keySet The KeySet to identify rows to delete. + * @return MutationGroup Current mutation group, to enable object chaining. + */ + public function delete($table, KeySet $keySet) + { + $this->enqueue(Operation::OP_DELETE, $table, [$keySet]); + + return $this; + } + + /** + * Format, validate and enqueue mutations in the transaction. + * + * @param string $op The operation type. + * @param string $table The table name + * @param array $dataSet the mutations to enqueue + * @return void + */ + private function enqueue($op, $table, array $dataSet) + { + foreach ($dataSet as $data) { + if ($op === Operation::OP_DELETE) { + $this->mutationGroup[] = $this->deleteMutation($table, $data); + } else { + $this->mutationGroup[] = $this->mutation($op, $table, $data); + } + } + } +} diff --git a/Spanner/src/MutationTrait.php b/Spanner/src/MutationTrait.php new file mode 100644 index 000000000000..1a0bb4cce7db --- /dev/null +++ b/Spanner/src/MutationTrait.php @@ -0,0 +1,99 @@ + [ + 'table' => $table, + 'columns' => array_keys($mutation), + 'values' => $this->getValueMapper()->encodeValuesAsSimpleType(array_values($mutation)) + ] + ]; + } + + /** + * Create a formatted delete mutation. + * + * @param string $table The table name. + * @param KeySet $keySet The keys to delete. + * @return array + */ + public function deleteMutation($table, KeySet $keySet) + { + return [ + 'delete' => [ + 'table' => $table, + 'keySet' => $this->flattenKeySet($keySet), + ] + ]; + } + + private function getValueMapper() + { + if (!isset($this->mapper)) { + throw ValidationException( + 'MutationTrait usage requires `ValueMapper` to be ' . + 'present in the user class in the `$this->mapper` property.' + ); + } + + return $this->mapper; + } + + private function flattenKeySet(KeySet $keySet) + { + $keys = $keySet->keySetObject(); + + if (!empty($keys['ranges'])) { + foreach ($keys['ranges'] as $index => $range) { + foreach ($range as $type => $rangeKeys) { + $range[$type] = $this->getValueMapper()->encodeValuesAsSimpleType($rangeKeys); + } + + $keys['ranges'][$index] = $range; + } + } + + if (!empty($keys['keys'])) { + $keys['keys'] = $this->getValueMapper()->encodeValuesAsSimpleType($keys['keys'], true); + } + + return $this->arrayFilterRemoveNull($keys); + } +} diff --git a/Spanner/src/Operation.php b/Spanner/src/Operation.php index 3706d2b1ba65..f8b6bfd6790e 100644 --- a/Spanner/src/Operation.php +++ b/Spanner/src/Operation.php @@ -41,6 +41,7 @@ class Operation { use ArrayTrait; + use MutationTrait; use TimeTrait; use ValidateTrait; @@ -75,43 +76,6 @@ public function __construct(ConnectionInterface $connection, $returnInt64AsObjec $this->mapper = new ValueMapper($returnInt64AsObject); } - /** - * Create a formatted mutation. - * - * @param string $operation The operation type. - * @param string $table The table name. - * @param array $mutation The mutation data, represented as a set of - * key/value pairs. - * @return array - */ - public function mutation($operation, $table, $mutation) - { - return [ - $operation => [ - 'table' => $table, - 'columns' => array_keys($mutation), - 'values' => $this->mapper->encodeValuesAsSimpleType(array_values($mutation)) - ] - ]; - } - - /** - * Create a formatted delete mutation. - * - * @param string $table The table name. - * @param KeySet $keySet The keys to delete. - * @return array - */ - public function deleteMutation($table, KeySet $keySet) - { - return [ - self::OP_DELETE => [ - 'table' => $table, - 'keySet' => $this->flattenKeySet($keySet), - ] - ]; - } - /** * Commit all enqueued mutations. * From 81d4a8e413f499172aeefc76c6746d2e96a38fb8 Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:33:42 +0000 Subject: [PATCH 05/15] Implement BatchWrite in Database. --- Spanner/src/Connection/Grpc.php | 1 + Spanner/src/Database.php | 87 +++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/Spanner/src/Connection/Grpc.php b/Spanner/src/Connection/Grpc.php index b7d5ac0b6d03..efb448e9b196 100644 --- a/Spanner/src/Connection/Grpc.php +++ b/Spanner/src/Connection/Grpc.php @@ -43,6 +43,7 @@ use Google\Cloud\Spanner\Admin\Instance\V1\InstanceConfig; use Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstanceConfigMetadata; use Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstanceMetadata; +use Google\Cloud\Spanner\MutationGroup; use Google\Cloud\Spanner\Operation; use Google\Cloud\Spanner\SpannerClient as ManualSpannerClient; use Google\Cloud\Spanner\RequestHeaderTrait; diff --git a/Spanner/src/Database.php b/Spanner/src/Database.php index 57c035cfc9e3..0a0f14c0af11 100644 --- a/Spanner/src/Database.php +++ b/Spanner/src/Database.php @@ -17,6 +17,7 @@ namespace Google\Cloud\Spanner; +use Google\ApiCore\ApiException; use Google\ApiCore\ValidationException; use Google\Cloud\Core\Exception\AbortedException; use Google\Cloud\Core\Exception\NotFoundException; @@ -36,6 +37,7 @@ use Google\Cloud\Spanner\Session\Session; use Google\Cloud\Spanner\Session\SessionPoolInterface; use Google\Cloud\Spanner\Transaction; +use Google\Cloud\Spanner\V1\BatchWriteResponse; use Google\Cloud\Spanner\V1\SpannerClient as GapicSpannerClient; use Google\Cloud\Spanner\V1\TypeCode; use Google\Rpc\Code; @@ -184,6 +186,11 @@ class Database */ private $directedReadOptions; + /** + * @var bool + */ + private $returnInt64AsObject; + /** * Create an object representing a Database. * @@ -230,6 +237,7 @@ public function __construct( $this->setLroProperties($lroConnection, $lroCallables, $this->name); $this->databaseRole = $databaseRole; $this->directedReadOptions = $instance->directedReadOptions(); + $this->returnInt64AsObject = $returnInt64AsObject; } /** @@ -1686,6 +1694,85 @@ public function execute($sql, array $options = []) } } + /** + * Create a new {@see \Google\Cloud\Spanner\MutationGroup} object. + * + * @return MutationGroup + */ + public function mutationGroup() + { + return new MutationGroup($this->returnInt64AsObject); + } + + /** + * Batches the supplied mutation groups in a collection of efficient + * transactions. All mutations in a group are committed atomically. However, + * mutations across groups can be committed non-atomically in an unspecified + * order and thus, they must be independent of each other. Partial failure is + * possible, i.e., some groups may have been committed successfully, while + * some may have failed. The results of individual batches are streamed into + * the response as the batches are applied. + * + * BatchWrite requests are not replay protected, meaning that each mutation + * group may be applied more than once. Replays of non-idempotent mutations + * may have undesirable effects. For example, replays of an insert mutation + * may produce an already exists error or if you use generated or commit + * timestamp-based keys, it may result in additional rows being added to the + * mutation's table. We recommend structuring your mutation groups to be + * idempotent to avoid this issue. + * + * Sample code: + * ``` + * ``` + * + * @param MutationGroup[] $mutationGroups Required. The groups of mutations to be applied. + * @param array $options { + * Optional. + * + * @type array $requestOptions + * Common options for this request. + * @type bool $excludeTxnFromChangeStreams + * Optional. When `exclude_txn_from_change_streams` is set to `true`: + * * Mutations from all transactions in this batch write operation will not + * be recorded in change streams with DDL option `allow_txn_exclusion=true` + * that are tracking columns modified by these transactions. + * * Mutations from all transactions in this batch write operation will be + * recorded in change streams with DDL option `allow_txn_exclusion=false or + * not set` that are tracking columns modified by these transactions. + * + * When `exclude_txn_from_change_streams` is set to `false` or not set, + * mutations from all transactions in this batch write operation will be + * recorded in all change streams that are tracking columns modified by these + * transactions. + * } + * + * @return \Google\ApiCore\ServerStream A stream of BatchWriteResponse + * {@see \Google\Cloud\Spanner\V1\BatchWriteResponse} + * + * @throws ApiException if the remote call fails + */ + public function batchWrite(array $mutationGroups, array $options) { + if ($this->isRunningTransaction) { + throw new \BadMethodCallException('Nested transactions are not supported by this client.'); + } + // Prevent nested transactions. + $this->isRunningTransaction = true; + $session = $this->selectSession( + SessionPoolInterface::CONTEXT_READWRITE, + $this->pluck('sessionOptions', $options, false) ?: [] + ); + try { + return $this->connection->batchWrite([ + 'database' => $this->name(), + 'session' => $session->name(), + 'mutationGroups' => $mutationGroups + ] + $options); + } finally { + $this->isRunningTransaction = false; + $session->setExpiration(); + } + } + /** * Execute a partitioned DML update. * From 7816c83e15e462cbe5bbd7a52c5251d6d4026ab7 Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Tue, 30 Apr 2024 06:36:17 +0000 Subject: [PATCH 06/15] Implement API compliant data conversion --- Spanner/src/Connection/Grpc.php | 14 +++++++++++++- Spanner/src/Database.php | 7 +++++-- Spanner/src/MutationGroup.php | 5 +++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Spanner/src/Connection/Grpc.php b/Spanner/src/Connection/Grpc.php index efb448e9b196..e9ed95f569eb 100644 --- a/Spanner/src/Connection/Grpc.php +++ b/Spanner/src/Connection/Grpc.php @@ -47,6 +47,7 @@ use Google\Cloud\Spanner\Operation; use Google\Cloud\Spanner\SpannerClient as ManualSpannerClient; use Google\Cloud\Spanner\RequestHeaderTrait; +use Google\Cloud\Spanner\V1\BatchWriteRequest\MutationGroup as BatchWriteRequestMutationGroup; use Google\Cloud\Spanner\V1\CreateSessionRequest; use Google\Cloud\Spanner\V1\DeleteSessionRequest; use Google\Cloud\Spanner\V1\DirectedReadOptions; @@ -1128,8 +1129,19 @@ public function commit(array $args) public function batchWrite(array $args) { $databaseName = $this->pluck('database', $args); - $mutationGroups = $this->parseMutations($this->pluck('mutationGroups', $args)); + $mutationGroups = $this->pluck('mutationGroups', $args); $requestOptions = $this->pluck('requestOptions', $args, false) ?: []; + + array_walk( + $mutationGroups, + fn(&$x) => $x['mutations'] = $this->parseMutations($x['mutations']) + ); + + array_walk($mutationGroups, fn(&$x) => $x = $this->serializer->decodeMessage( + new BatchWriteRequestMutationGroup, + $x + )); + if ($requestOptions) { $args['requestOptions'] = $this->serializer->decodeMessage( new RequestOptions, diff --git a/Spanner/src/Database.php b/Spanner/src/Database.php index 0a0f14c0af11..d44029c9762a 100644 --- a/Spanner/src/Database.php +++ b/Spanner/src/Database.php @@ -1725,7 +1725,7 @@ public function mutationGroup() * ``` * ``` * - * @param MutationGroup[] $mutationGroups Required. The groups of mutations to be applied. + * @param array $mutationGroups Required. The groups of mutations to be applied. * @param array $options { * Optional. * @@ -1751,7 +1751,7 @@ public function mutationGroup() * * @throws ApiException if the remote call fails */ - public function batchWrite(array $mutationGroups, array $options) { + public function batchWrite(array $mutationGroups, array $options = []) { if ($this->isRunningTransaction) { throw new \BadMethodCallException('Nested transactions are not supported by this client.'); } @@ -1761,6 +1761,9 @@ public function batchWrite(array $mutationGroups, array $options) { SessionPoolInterface::CONTEXT_READWRITE, $this->pluck('sessionOptions', $options, false) ?: [] ); + + array_walk($mutationGroups, fn (&$x) => $x = $x->toArray()); + try { return $this->connection->batchWrite([ 'database' => $this->name(), diff --git a/Spanner/src/MutationGroup.php b/Spanner/src/MutationGroup.php index 66421ca0fffb..0c451abd2264 100644 --- a/Spanner/src/MutationGroup.php +++ b/Spanner/src/MutationGroup.php @@ -245,6 +245,11 @@ public function delete($table, KeySet $keySet) return $this; } + public function toArray(): array + { + return ['mutations' => $this->mutationGroup]; + } + /** * Format, validate and enqueue mutations in the transaction. * From 2a4af128b745b9136c017f5e9909b025c9a69d12 Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Fri, 3 May 2024 09:26:50 +0000 Subject: [PATCH 07/15] Improve Logic reuse. --- Spanner/src/MutationGroup.php | 230 +------------------------------- Spanner/src/MutationTrait.php | 243 ++++++++++++++++++++++++++++++++++ Spanner/src/Transaction.php | 229 +------------------------------- 3 files changed, 246 insertions(+), 456 deletions(-) diff --git a/Spanner/src/MutationGroup.php b/Spanner/src/MutationGroup.php index 0c451abd2264..e0a6e5d2bee6 100644 --- a/Spanner/src/MutationGroup.php +++ b/Spanner/src/MutationGroup.php @@ -24,7 +24,6 @@ class MutationGroup { use MutationTrait; - private array $mutationGroup; private ValueMapper $mapper; /** @@ -35,237 +34,10 @@ class MutationGroup public function __construct($returnInt64AsObject) { $this->mapper = new ValueMapper($returnInt64AsObject); - $this->mutationGroup = []; - } - - /** - * Add an insert mutation. - * - * Example: - * ``` - * $mutationGroup->insert('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ]); - * ``` - * - * @param string $table The table to insert into. - * @param array $data The data to insert. - * @return MutationGroup Current mutation group data object. - */ - public function insert($table, array $data) - { - return $this->insertBatch($table, [$data]); - } - - /** - * Add one or more insert mutations. - * - * Example: - * ``` - * $mutationGroup->insertBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ] - * ]); - * ``` - * - * @param string $table The table to insert into. - * @param array $dataSet The data to insert. - * @return MutationGroup Current mutation group, to enable object chaining. - */ - public function insertBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_INSERT, $table, $dataSet); - - return $this; - } - - /** - * Add an update mutation. - * - * Example: - * ``` - * $mutationGroup->update('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post [Updated!]', - * 'content' => 'Modified Content' - * ]); - * ``` - * - * @param string $table The table to update. - * @param array $data The data to update. - * @return MutationGroup Current mutation group, to enable object chaining. - */ - public function update($table, array $data) - { - return $this->updateBatch($table, [$data]); - } - - /** - * Add one or more update mutations. - * - * Example: - * ``` - * $mutationGroup->updateBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post [Updated!]', - * 'content' => 'Modified Content' - * ] - * ]); - * ``` - * - * @param string $table The table to update. - * @param array $dataSet The data to update. - * @return MutationGroup Current mutation group, to enable object chaining. - */ - public function updateBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_UPDATE, $table, $dataSet); - - return $this; - } - - /** - * Add an insert or update mutation. - * - * Example: - * ``` - * $mutationGroup->insertOrUpdate('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ]); - * ``` - * - * @param string $table The table to insert into or update. - * @param array $data The data to insert or update. - * @return MutationGroup Current mutation group, to enable object chaining. - */ - public function insertOrUpdate($table, array $data) - { - return $this->insertOrUpdateBatch($table, [$data]); - } - - /** - * Add one or more insert or update mutations. - * - * Example: - * ``` - * $mutationGroup->insertOrUpdateBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ] - * ]); - * ``` - * - * @param string $table The table to insert into or update. - * @param array $dataSet The data to insert or update. - * @return MutationGroup Current mutation group, to enable object chaining. - */ - public function insertOrUpdateBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_INSERT_OR_UPDATE, $table, $dataSet); - - return $this; - } - - /** - * Add an replace mutation. - * - * Example: - * ``` - * $mutationGroup->replace('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post [Replaced]', - * 'content' => 'Hello Moon' - * ]); - * ``` - * - * @param string $table The table to replace into. - * @param array $data The data to replace. - * @return MutationGroup Current mutation group, to enable object chaining. - */ - public function replace($table, array $data) - { - return $this->replaceBatch($table, [$data]); - } - - /** - * Add one or more replace mutations. - * - * Example: - * ``` - * $mutationGroup->replaceBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post [Replaced]', - * 'content' => 'Hello Moon' - * ] - * ]); - * ``` - * - * @param string $table The table to replace into. - * @param array $dataSet The data to replace. - * @return MutationGroup Current mutation group, to enable object chaining. - */ - public function replaceBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_REPLACE, $table, $dataSet); - - return $this; - } - - /** - * Add an delete mutation. - * - * Example: - * ``` - * $keySet = new KeySet([ - * 'keys' => [10] - * ]); - * - * $mutationGroup->delete('Posts', $keySet); - * ``` - * - * @param string $table The table to mutate. - * @param KeySet $keySet The KeySet to identify rows to delete. - * @return MutationGroup Current mutation group, to enable object chaining. - */ - public function delete($table, KeySet $keySet) - { - $this->enqueue(Operation::OP_DELETE, $table, [$keySet]); - - return $this; } public function toArray(): array { - return ['mutations' => $this->mutationGroup]; - } - - /** - * Format, validate and enqueue mutations in the transaction. - * - * @param string $op The operation type. - * @param string $table The table name - * @param array $dataSet the mutations to enqueue - * @return void - */ - private function enqueue($op, $table, array $dataSet) - { - foreach ($dataSet as $data) { - if ($op === Operation::OP_DELETE) { - $this->mutationGroup[] = $this->deleteMutation($table, $data); - } else { - $this->mutationGroup[] = $this->mutation($op, $table, $data); - } - } + return ['mutations' => $this->mutationData]; } } diff --git a/Spanner/src/MutationTrait.php b/Spanner/src/MutationTrait.php index 1a0bb4cce7db..442fa3a6ef85 100644 --- a/Spanner/src/MutationTrait.php +++ b/Spanner/src/MutationTrait.php @@ -23,10 +23,244 @@ /** * Common helper methods used for creating array representation of * {@see \Google\Cloud\Spanner\V1\Mutation} + * + * @internal */ trait MutationTrait { use ArrayTrait; + + /** + * @var array + */ + private array $mutationData = []; + + /** + * Add an insert mutation. + * + * Example: + * ``` + * $mutationGroup->insert('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ]); + * ``` + * + * @param string $table The table to insert into. + * @param array $data The data to insert. + * @return MutationGroup Current mutation group data object. + */ + public function insert($table, array $data) + { + return $this->insertBatch($table, [$data]); + } + + /** + * Add one or more insert mutations. + * + * Example: + * ``` + * $mutationGroup->insertBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ] + * ]); + * ``` + * + * @param string $table The table to insert into. + * @param array $dataSet The data to insert. + * @return $this Current object instance, to enable object chaining. + */ + public function insertBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_INSERT, $table, $dataSet); + + return $this; + } + + /** + * Add an update mutation. + * + * Example: + * ``` + * $mutationGroup->update('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post [Updated!]', + * 'content' => 'Modified Content' + * ]); + * ``` + * + * @param string $table The table to update. + * @param array $data The data to update. + * @return $this Current object instance, to enable object chaining. + */ + public function update($table, array $data) + { + return $this->updateBatch($table, [$data]); + } + + /** + * Add one or more update mutations. + * + * Example: + * ``` + * $mutationGroup->updateBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post [Updated!]', + * 'content' => 'Modified Content' + * ] + * ]); + * ``` + * + * @param string $table The table to update. + * @param array $dataSet The data to update. + * @return $this Current object instance, to enable object chaining. + */ + public function updateBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_UPDATE, $table, $dataSet); + + return $this; + } + + /** + * Add an insert or update mutation. + * + * Example: + * ``` + * $mutationGroup->insertOrUpdate('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ]); + * ``` + * + * @param string $table The table to insert into or update. + * @param array $data The data to insert or update. + * @return $this Current mutation group, to enable object chaining. + */ + public function insertOrUpdate($table, array $data) + { + return $this->insertOrUpdateBatch($table, [$data]); + } + + /** + * Add one or more insert or update mutations. + * + * Example: + * ``` + * $mutationGroup->insertOrUpdateBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ] + * ]); + * ``` + * + * @param string $table The table to insert into or update. + * @param array $dataSet The data to insert or update. + * @return $this Current object instance, to enable object chaining. + */ + public function insertOrUpdateBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_INSERT_OR_UPDATE, $table, $dataSet); + + return $this; + } + + /** + * Add an replace mutation. + * + * Example: + * ``` + * $mutationGroup->replace('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post [Replaced]', + * 'content' => 'Hello Moon' + * ]); + * ``` + * + * @param string $table The table to replace into. + * @param array $data The data to replace. + * @return $this Current object instance, to enable object chaining. + */ + public function replace($table, array $data) + { + return $this->replaceBatch($table, [$data]); + } + + /** + * Add one or more replace mutations. + * + * Example: + * ``` + * $mutationGroup->replaceBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post [Replaced]', + * 'content' => 'Hello Moon' + * ] + * ]); + * ``` + * + * @param string $table The table to replace into. + * @param array $dataSet The data to replace. + * @return $this Current object instance, to enable object chaining. + */ + public function replaceBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_REPLACE, $table, $dataSet); + + return $this; + } + + /** + * Add an delete mutation. + * + * Example: + * ``` + * $keySet = new KeySet([ + * 'keys' => [10] + * ]); + * + * $mutationGroup->delete('Posts', $keySet); + * ``` + * + * @param string $table The table to mutate. + * @param KeySet $keySet The KeySet to identify rows to delete. + * @return $this Current object instance, to enable object chaining. + */ + public function delete($table, KeySet $keySet) + { + $this->enqueue(Operation::OP_DELETE, $table, [$keySet]); + + return $this; + } + + /** + * Format, validate and enqueue mutations in the transaction. + * + * @param string $op The operation type. + * @param string $table The table name + * @param array $dataSet the mutations to enqueue + * @return void + */ + private function enqueue($op, $table, array $dataSet) + { + foreach ($dataSet as $data) { + if ($op === Operation::OP_DELETE) { + $this->mutationData[] = $this->deleteMutation($table, $data); + } else { + $this->mutationData[] = $this->mutation($op, $table, $data); + } + } + } + /** * Create a formatted mutation. * @@ -64,6 +298,15 @@ public function deleteMutation($table, KeySet $keySet) ]; } + /** + * Returns the mutation data as associative array. + * @return array + */ + private function getMutations() + { + return $this->mutationData; + } + private function getValueMapper() { if (!isset($this->mapper)) { diff --git a/Spanner/src/Transaction.php b/Spanner/src/Transaction.php index 05592b70bad8..62cbddef5573 100644 --- a/Spanner/src/Transaction.php +++ b/Spanner/src/Transaction.php @@ -64,6 +64,7 @@ */ class Transaction implements TransactionalReadInterface { + use MutationTrait; use TransactionalReadTrait; /** @@ -143,213 +144,6 @@ public function getCommitStats() return $this->commitStats; } - /** - * Enqueue an insert mutation. - * - * Example: - * ``` - * $transaction->insert('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ]); - * ``` - * - * @param string $table The table to insert into. - * @param array $data The data to insert. - * @return Transaction The transaction, to enable method chaining. - */ - public function insert($table, array $data) - { - return $this->insertBatch($table, [$data]); - } - - /** - * Enqueue one or more insert mutations. - * - * Example: - * ``` - * $transaction->insertBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ] - * ]); - * ``` - * - * @param string $table The table to insert into. - * @param array $dataSet The data to insert. - * @return Transaction The transaction, to enable method chaining. - */ - public function insertBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_INSERT, $table, $dataSet); - - return $this; - } - - /** - * Enqueue an update mutation. - * - * Example: - * ``` - * $transaction->update('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post [Updated!]', - * 'content' => 'Modified Content' - * ]); - * ``` - * - * @param string $table The table to update. - * @param array $data The data to update. - * @return Transaction The transaction, to enable method chaining. - */ - public function update($table, array $data) - { - return $this->updateBatch($table, [$data]); - } - - /** - * Enqueue one or more update mutations. - * - * Example: - * ``` - * $transaction->updateBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post [Updated!]', - * 'content' => 'Modified Content' - * ] - * ]); - * ``` - * - * @param string $table The table to update. - * @param array $dataSet The data to update. - * @return Transaction The transaction, to enable method chaining. - */ - public function updateBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_UPDATE, $table, $dataSet); - - return $this; - } - - /** - * Enqueue an insert or update mutation. - * - * Example: - * ``` - * $transaction->insertOrUpdate('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ]); - * ``` - * - * @param string $table The table to insert into or update. - * @param array $data The data to insert or update. - * @return Transaction The transaction, to enable method chaining. - */ - public function insertOrUpdate($table, array $data) - { - return $this->insertOrUpdateBatch($table, [$data]); - } - - /** - * Enqueue one or more insert or update mutations. - * - * Example: - * ``` - * $transaction->insertOrUpdateBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ] - * ]); - * ``` - * - * @param string $table The table to insert into or update. - * @param array $dataSet The data to insert or update. - * @return Transaction The transaction, to enable method chaining. - */ - public function insertOrUpdateBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_INSERT_OR_UPDATE, $table, $dataSet); - - return $this; - } - - /** - * Enqueue an replace mutation. - * - * Example: - * ``` - * $transaction->replace('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post [Replaced]', - * 'content' => 'Hello Moon' - * ]); - * ``` - * - * @param string $table The table to replace into. - * @param array $data The data to replace. - * @return Transaction The transaction, to enable method chaining. - */ - public function replace($table, array $data) - { - return $this->replaceBatch($table, [$data]); - } - - /** - * Enqueue one or more replace mutations. - * - * Example: - * ``` - * $transaction->replaceBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post [Replaced]', - * 'content' => 'Hello Moon' - * ] - * ]); - * ``` - * - * @param string $table The table to replace into. - * @param array $dataSet The data to replace. - * @return Transaction The transaction, to enable method chaining. - */ - public function replaceBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_REPLACE, $table, $dataSet); - - return $this; - } - - /** - * Enqueue an delete mutation. - * - * Example: - * ``` - * $keySet = new KeySet([ - * 'keys' => [10] - * ]); - * - * $transaction->delete('Posts', $keySet); - * ``` - * - * @param string $table The table to mutate. - * @param KeySet $keySet The KeySet to identify rows to delete. - * @return Transaction The transaction, to enable method chaining. - */ - public function delete($table, KeySet $keySet) - { - $this->enqueue(Operation::OP_DELETE, $table, [$keySet]); - - return $this; - } - /** * Execute a Cloud Spanner DML statement. * @@ -637,7 +431,7 @@ public function commit(array $options = []) 'requestOptions' => [] ]; - $options['mutations'] += $this->mutations; + $options['mutations'] += $this->getMutations(); $options['transactionId'] = $this->transactionId; @@ -699,25 +493,6 @@ public function isRetry() return $this->isRetry; } - /** - * Format, validate and enqueue mutations in the transaction. - * - * @param string $op The operation type. - * @param string $table The table name - * @param array $dataSet the mutations to enqueue - * @return void - */ - private function enqueue($op, $table, array $dataSet) - { - foreach ($dataSet as $data) { - if ($op === Operation::OP_DELETE) { - $this->mutations[] = $this->operation->deleteMutation($table, $data); - } else { - $this->mutations[] = $this->operation->mutation($op, $table, $data); - } - } - } - /** * Build the update options. * From db0d576229728bdd35467dbdc405397155e50851 Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Fri, 3 May 2024 13:48:47 +0000 Subject: [PATCH 08/15] feat(Spanner): BatchWrite: Add unit tests. --- Spanner/src/MutationTrait.php | 7 +- Spanner/src/Operation.php | 3 +- Spanner/src/Transaction.php | 9 +- Spanner/tests/Snippet/TransactionTest.php | 18 +-- Spanner/tests/Unit/MutationGroupTest.php | 63 ++++++++++ Spanner/tests/Unit/MutationTraitTest.php | 145 ++++++++++++++++++++++ Spanner/tests/Unit/TransactionTest.php | 24 ++-- 7 files changed, 241 insertions(+), 28 deletions(-) create mode 100644 Spanner/tests/Unit/MutationGroupTest.php create mode 100644 Spanner/tests/Unit/MutationTraitTest.php diff --git a/Spanner/src/MutationTrait.php b/Spanner/src/MutationTrait.php index 74725f93d926..51ca50c20789 100644 --- a/Spanner/src/MutationTrait.php +++ b/Spanner/src/MutationTrait.php @@ -301,7 +301,7 @@ public function deleteMutation($table, KeySet $keySet) /** * Returns the mutation data as associative array. * @return array - */ + */ private function getMutations() { return $this->mutationData; @@ -310,10 +310,7 @@ private function getMutations() private function getValueMapper() { if (!isset($this->mapper)) { - throw new ValidationException( - 'MutationTrait usage requires `ValueMapper` to be ' . - 'present in the user class in the `$this->mapper` property.' - ); + $this->mapper = new ValueMapper(false); } return $this->mapper; diff --git a/Spanner/src/Operation.php b/Spanner/src/Operation.php index f8b6bfd6790e..6c8aeecace91 100644 --- a/Spanner/src/Operation.php +++ b/Spanner/src/Operation.php @@ -517,7 +517,8 @@ public function createTransaction(Session $session, array $res = [], array $opti $res['id'], $options['isRetry'], $options['tag'], - $options['transactionOptions'] + $options['transactionOptions'], + $this->mapper ); } diff --git a/Spanner/src/Transaction.php b/Spanner/src/Transaction.php index 62cbddef5573..c88e8972d47e 100644 --- a/Spanner/src/Transaction.php +++ b/Spanner/src/Transaction.php @@ -82,6 +82,8 @@ class Transaction implements TransactionalReadInterface */ private $isRetry = false; + private ValueMapper $mapper; + /** * @param Operation $operation The Operation instance. * @param Session $session The session to use for spanner interactions. @@ -96,6 +98,7 @@ class Transaction implements TransactionalReadInterface * @type array $begin The begin Transaction options. * [Refer](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#transactionoptions) * } + * @param ValueMapper $mapper Consumed internally for properly map mutation data. * @throws \InvalidArgumentException if a tag is specified on a single-use transaction. */ public function __construct( @@ -104,7 +107,8 @@ public function __construct( $transactionId = null, $isRetry = false, $tag = null, - $options = [] + $options = [], + $mapper = null ) { $this->operation = $operation; $this->session = $session; @@ -124,6 +128,9 @@ public function __construct( $this->context = SessionPoolInterface::CONTEXT_READWRITE; $this->options = $options; + if (!is_null($mapper)) { + $this->mapper = $mapper; + } } /** diff --git a/Spanner/tests/Snippet/TransactionTest.php b/Spanner/tests/Snippet/TransactionTest.php index 17b25b8daf20..b99e6e6f010a 100644 --- a/Spanner/tests/Snippet/TransactionTest.php +++ b/Spanner/tests/Snippet/TransactionTest.php @@ -260,7 +260,7 @@ public function testInsert() $res = $snippet->invoke(); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertArrayHasKey('insert', $mutations[0]); } @@ -274,7 +274,7 @@ public function testInsertBatch() $res = $snippet->invoke(); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertArrayHasKey('insert', $mutations[0]); } @@ -287,7 +287,7 @@ public function testUpdate() $res = $snippet->invoke(); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertArrayHasKey('update', $mutations[0]); } @@ -301,7 +301,7 @@ public function testUpdateBatch() $res = $snippet->invoke(); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertArrayHasKey('update', $mutations[0]); } @@ -314,7 +314,7 @@ public function testInsertOrUpdate() $res = $snippet->invoke(); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertArrayHasKey('insertOrUpdate', $mutations[0]); } @@ -330,7 +330,7 @@ public function testInsertOrUpdateBatch() $res = $snippet->invoke(); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertArrayHasKey('insertOrUpdate', $mutations[0]); } @@ -343,7 +343,7 @@ public function testReplace() $res = $snippet->invoke(); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertArrayHasKey('replace', $mutations[0]); } @@ -357,7 +357,7 @@ public function testReplaceBatch() $res = $snippet->invoke(); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertArrayHasKey('replace', $mutations[0]); } @@ -371,7 +371,7 @@ public function testDelete() $res = $snippet->invoke(); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertArrayHasKey('delete', $mutations[0]); } diff --git a/Spanner/tests/Unit/MutationGroupTest.php b/Spanner/tests/Unit/MutationGroupTest.php new file mode 100644 index 000000000000..98c6f1432772 --- /dev/null +++ b/Spanner/tests/Unit/MutationGroupTest.php @@ -0,0 +1,63 @@ +mutationGroup = new MutationGroup(false); + } + + public function testMutationGroup() + { + $this->mutationGroup->insert('Posts', ['foo' => 'bar']) + ->insertOrUpdateBatch('Posts', [['foo' => 'bar']]) + ->replaceBatch('Posts', [['foo' => 'bar']]) + ->delete('Posts', new KeySet(['keys' => ['foo']])); + + $data = $this->mutationGroup->toArray(); + $this->assertEquals($data, ['mutations' => [ + ['insert' => [ + 'table' => 'Posts', + 'columns' => ['foo'], + 'values' => ['bar'] + ]], + ['insertOrUpdate' => [ + 'table' => 'Posts', + 'columns' => ['foo'], + 'values' => ['bar'] + ]], + ['replace' => [ + 'table' => 'Posts', + 'columns' => ['foo'], + 'values' => ['bar'] + ]], + ['delete' => [ + 'table' => 'Posts', + 'keySet' => ['keys' => ['foo']], + ]], + ]]); + } +} diff --git a/Spanner/tests/Unit/MutationTraitTest.php b/Spanner/tests/Unit/MutationTraitTest.php new file mode 100644 index 000000000000..9a1bc84f6ae2 --- /dev/null +++ b/Spanner/tests/Unit/MutationTraitTest.php @@ -0,0 +1,145 @@ +impl = new MutationTraitImpl(); + } + + public function testInsert() + { + $this->impl->insert('Posts', ['foo' => 'bar']); + + $mutations = $this->impl->getMutations(); + + $this->assertEquals('Posts', $mutations[0]['insert']['table']); + $this->assertEquals('foo', $mutations[0]['insert']['columns'][0]); + $this->assertEquals('bar', $mutations[0]['insert']['values'][0]); + } + + public function testInsertBatch() + { + $this->impl->insertBatch('Posts', [['foo' => 'bar']]); + + $mutations = $this->impl->getMutations(); + + $this->assertEquals('Posts', $mutations[0]['insert']['table']); + $this->assertEquals('foo', $mutations[0]['insert']['columns'][0]); + $this->assertEquals('bar', $mutations[0]['insert']['values'][0]); + } + + public function testUpdate() + { + $this->impl->update('Posts', ['foo' => 'bar']); + + $mutations = $this->impl->getMutations(); + + $this->assertEquals('Posts', $mutations[0]['update']['table']); + $this->assertEquals('foo', $mutations[0]['update']['columns'][0]); + $this->assertEquals('bar', $mutations[0]['update']['values'][0]); + } + + public function testUpdateBatch() + { + $this->impl->updateBatch('Posts', [['foo' => 'bar']]); + + $mutations = $this->impl->getMutations(); + + $this->assertEquals('Posts', $mutations[0]['update']['table']); + $this->assertEquals('foo', $mutations[0]['update']['columns'][0]); + $this->assertEquals('bar', $mutations[0]['update']['values'][0]); + } + + public function testInsertOrUpdate() + { + $this->impl->insertOrUpdate('Posts', ['foo' => 'bar']); + + $mutations = $this->impl->getMutations(); + + $this->assertEquals('Posts', $mutations[0]['insertOrUpdate']['table']); + $this->assertEquals('foo', $mutations[0]['insertOrUpdate']['columns'][0]); + $this->assertEquals('bar', $mutations[0]['insertOrUpdate']['values'][0]); + } + + public function testInsertOrUpdateBatch() + { + $this->impl->insertOrUpdateBatch('Posts', [['foo' => 'bar']]); + + $mutations = $this->impl->getMutations(); + + $this->assertEquals('Posts', $mutations[0]['insertOrUpdate']['table']); + $this->assertEquals('foo', $mutations[0]['insertOrUpdate']['columns'][0]); + $this->assertEquals('bar', $mutations[0]['insertOrUpdate']['values'][0]); + } + + public function testReplace() + { + $this->impl->replace('Posts', ['foo' => 'bar']); + + $mutations = $this->impl->getMutations(); + + $this->assertEquals('Posts', $mutations[0]['replace']['table']); + $this->assertEquals('foo', $mutations[0]['replace']['columns'][0]); + $this->assertEquals('bar', $mutations[0]['replace']['values'][0]); + } + + public function testReplaceBatch() + { + $this->impl->replaceBatch('Posts', [['foo' => 'bar']]); + + $mutations = $this->impl->getMutations(); + + $this->assertEquals('Posts', $mutations[0]['replace']['table']); + $this->assertEquals('foo', $mutations[0]['replace']['columns'][0]); + $this->assertEquals('bar', $mutations[0]['replace']['values'][0]); + } + + public function testDelete() + { + $this->impl->delete('Posts', new KeySet(['keys' => ['foo']])); + + $mutations = $this->impl->getMutations(); + $this->assertEquals('Posts', $mutations[0]['delete']['table']); + $this->assertEquals('foo', $mutations[0]['delete']['keySet']['keys'][0]); + $this->assertArrayNotHasKey('all', $mutations[0]['delete']['keySet']); + } +} + +class MutationTraitImpl +{ + use MutationTrait { + getMutations as public; + } + + private ValueMapper $mapper; + + public function __construct() + { + $this->mapper = new ValueMapper(false); + } +} diff --git a/Spanner/tests/Unit/TransactionTest.php b/Spanner/tests/Unit/TransactionTest.php index f22a24d2f8af..71bc8a02475a 100644 --- a/Spanner/tests/Unit/TransactionTest.php +++ b/Spanner/tests/Unit/TransactionTest.php @@ -121,7 +121,7 @@ public function testInsert() { $this->transaction->insert('Posts', ['foo' => 'bar']); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertEquals('Posts', $mutations[0]['insert']['table']); $this->assertEquals('foo', $mutations[0]['insert']['columns'][0]); @@ -132,7 +132,7 @@ public function testInsertBatch() { $this->transaction->insertBatch('Posts', [['foo' => 'bar']]); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertEquals('Posts', $mutations[0]['insert']['table']); $this->assertEquals('foo', $mutations[0]['insert']['columns'][0]); @@ -143,7 +143,7 @@ public function testUpdate() { $this->transaction->update('Posts', ['foo' => 'bar']); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertEquals('Posts', $mutations[0]['update']['table']); $this->assertEquals('foo', $mutations[0]['update']['columns'][0]); @@ -154,7 +154,7 @@ public function testUpdateBatch() { $this->transaction->updateBatch('Posts', [['foo' => 'bar']]); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertEquals('Posts', $mutations[0]['update']['table']); $this->assertEquals('foo', $mutations[0]['update']['columns'][0]); @@ -165,7 +165,7 @@ public function testInsertOrUpdate() { $this->transaction->insertOrUpdate('Posts', ['foo' => 'bar']); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertEquals('Posts', $mutations[0]['insertOrUpdate']['table']); $this->assertEquals('foo', $mutations[0]['insertOrUpdate']['columns'][0]); @@ -176,7 +176,7 @@ public function testInsertOrUpdateBatch() { $this->transaction->insertOrUpdateBatch('Posts', [['foo' => 'bar']]); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertEquals('Posts', $mutations[0]['insertOrUpdate']['table']); $this->assertEquals('foo', $mutations[0]['insertOrUpdate']['columns'][0]); @@ -187,7 +187,7 @@ public function testReplace() { $this->transaction->replace('Posts', ['foo' => 'bar']); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertEquals('Posts', $mutations[0]['replace']['table']); $this->assertEquals('foo', $mutations[0]['replace']['columns'][0]); @@ -198,7 +198,7 @@ public function testReplaceBatch() { $this->transaction->replaceBatch('Posts', [['foo' => 'bar']]); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertEquals('Posts', $mutations[0]['replace']['table']); $this->assertEquals('foo', $mutations[0]['replace']['columns'][0]); @@ -209,7 +209,7 @@ public function testDelete() { $this->transaction->delete('Posts', new KeySet(['keys' => ['foo']])); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $this->assertEquals('Posts', $mutations[0]['delete']['table']); $this->assertEquals('foo', $mutations[0]['delete']['keySet']['keys'][0]); $this->assertArrayNotHasKey('all', $mutations[0]['delete']['keySet']); @@ -487,7 +487,7 @@ public function testCommit() { $this->transaction->insert('Posts', ['foo' => 'bar']); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $operation = $this->prophesize(Operation::class); $operation->commitWithResponse( @@ -510,7 +510,7 @@ public function testCommitWithReturnCommitStats() { $this->transaction->insert('Posts', ['foo' => 'bar']); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $operation = $this->prophesize(Operation::class); $operation->commitWithResponse( @@ -537,7 +537,7 @@ public function testCommitWithMaxCommitDelay() $duration = new Duration(0, 100000000); $this->transaction->insert('Posts', ['foo' => 'bar']); - $mutations = $this->transaction->___getProperty('mutations'); + $mutations = $this->transaction->___getProperty('mutationData'); $operation = $this->prophesize(Operation::class); $operation->commitWithResponse( From 4c8f30c70f17032d52e4b2a0895ea33f74adec1c Mon Sep 17 00:00:00 2001 From: Yash Sahu <54198301+yash30201@users.noreply.github.com> Date: Fri, 14 Jun 2024 23:41:01 +0530 Subject: [PATCH 09/15] feat(Spanner): Implement BatchWrite functionality. (#7283) --- .github/run-package-tests.sh | 4 +- .github/workflows/docs.yaml | 2 +- .../spanner-emulator-system-tests.yaml | 2 +- .kokoro/docs/docker/Dockerfile | 2 +- .kokoro/docs/docker/requirements.txt | 6 +- .repo-metadata-full.json | 1555 +++ AccessApproval/.repo-metadata.json | 8 - AccessApproval/VERSION | 2 +- AccessApproval/composer.json | 2 +- AccessContextManager/.repo-metadata.json | 8 - AccessContextManager/VERSION | 2 +- AccessContextManager/composer.json | 2 +- AdvisoryNotifications/.repo-metadata.json | 8 - AdvisoryNotifications/VERSION | 2 +- AdvisoryNotifications/composer.json | 2 +- AiPlatform/.OwlBot.yaml | 4 +- AiPlatform/.repo-metadata.json | 8 - AiPlatform/README.md | 5 +- AiPlatform/VERSION | 2 +- AiPlatform/composer.json | 2 +- AiPlatform/metadata/V1/AcceleratorType.php | Bin 1154 -> 1174 bytes AiPlatform/metadata/V1/Content.php | Bin 4935 -> 4869 bytes AiPlatform/metadata/V1/Dataset.php | Bin 3309 -> 3339 bytes AiPlatform/metadata/V1/DatasetService.php | Bin 11151 -> 11573 bytes AiPlatform/metadata/V1/DatasetVersion.php | 7 +- .../metadata/V1/DeploymentResourcePool.php | 10 +- AiPlatform/metadata/V1/Endpoint.php | Bin 3680 -> 3914 bytes AiPlatform/metadata/V1/Feature.php | Bin 2494 -> 2506 bytes AiPlatform/metadata/V1/FeatureOnlineStore.php | Bin 2269 -> 2469 bytes .../metadata/V1/FeaturestoreOnlineService.php | Bin 4597 -> 4831 bytes AiPlatform/metadata/V1/Index.php | Bin 3125 -> 3316 bytes AiPlatform/metadata/V1/IndexService.php | Bin 5644 -> 5825 bytes AiPlatform/metadata/V1/MatchService.php | Bin 2830 -> 2973 bytes AiPlatform/metadata/V1/MetadataStore.php | 11 +- AiPlatform/metadata/V1/NotebookRuntime.php | Bin 4250 -> 4661 bytes AiPlatform/metadata/V1/NotebookService.php | 12 +- AiPlatform/metadata/V1/PersistentResource.php | Bin 3339 -> 3813 bytes AiPlatform/metadata/V1/PredictionService.php | Bin 8957 -> 9590 bytes AiPlatform/metadata/V1/PublisherModel.php | Bin 5434 -> 5491 bytes AiPlatform/metadata/V1/Tool.php | Bin 1931 -> 2197 bytes AiPlatform/owlbot.py | 38 +- .../update_dataset_version.php | 65 + .../create_feature_group.php | 2 +- .../update_notebook_runtime_template.php | 77 + AiPlatform/src/V1/AcceleratorType.php | 7 + AiPlatform/src/V1/ActiveLearningConfig.php | 4 +- ...ddContextArtifactsAndExecutionsRequest.php | 2 +- .../src/V1/AddContextChildrenRequest.php | 2 +- .../src/V1/AddExecutionEventsRequest.php | 2 +- .../src/V1/AddTrialMeasurementRequest.php | 4 +- AiPlatform/src/V1/Annotation.php | 14 +- AiPlatform/src/V1/AnnotationSpec.php | 10 +- AiPlatform/src/V1/Artifact.php | 22 +- ...AssignNotebookRuntimeOperationMetadata.php | 4 +- .../src/V1/AssignNotebookRuntimeRequest.php | 8 +- AiPlatform/src/V1/Attribution.php | 20 +- AiPlatform/src/V1/AutomaticResources.php | 4 +- AiPlatform/src/V1/AutoscalingMetricSpec.php | 4 +- AiPlatform/src/V1/AvroSource.php | 2 +- ...tchCancelPipelineJobsOperationMetadata.php | 2 +- .../src/V1/BatchCancelPipelineJobsRequest.php | 2 +- .../BatchCreateFeaturesOperationMetadata.php | 2 +- .../src/V1/BatchCreateFeaturesRequest.php | 2 +- .../V1/BatchCreateTensorboardRunsRequest.php | 2 +- ...atchCreateTensorboardTimeSeriesRequest.php | 2 +- AiPlatform/src/V1/BatchDedicatedResources.php | 6 +- .../src/V1/BatchDeletePipelineJobsRequest.php | 2 +- ...BatchImportEvaluatedAnnotationsRequest.php | 2 +- ...atchImportEvaluatedAnnotationsResponse.php | 2 +- ...atchImportModelEvaluationSlicesRequest.php | 2 +- ...BatchMigrateResourcesOperationMetadata.php | 2 +- .../PartialResult.php | 2 +- .../src/V1/BatchMigrateResourcesRequest.php | 2 +- AiPlatform/src/V1/BatchPredictionJob.php | 50 +- .../src/V1/BatchPredictionJob/InputConfig.php | 2 +- .../V1/BatchPredictionJob/InstanceConfig.php | 4 +- .../V1/BatchPredictionJob/OutputConfig.php | 2 +- .../src/V1/BatchPredictionJob/OutputInfo.php | 2 +- ...atchReadFeatureValuesOperationMetadata.php | 2 +- .../src/V1/BatchReadFeatureValuesRequest.php | 6 +- .../EntityTypeSpec.php | 4 +- .../PassThroughField.php | 2 +- ...chReadTensorboardTimeSeriesDataRequest.php | 2 +- AiPlatform/src/V1/BigQueryDestination.php | 2 +- AiPlatform/src/V1/BigQuerySource.php | 2 +- AiPlatform/src/V1/Blob.php | 4 +- AiPlatform/src/V1/BlurBaselineConfig.php | 2 +- .../V1/CancelBatchPredictionJobRequest.php | 2 +- AiPlatform/src/V1/CancelCustomJobRequest.php | 2 +- .../src/V1/CancelDataLabelingJobRequest.php | 2 +- .../CancelHyperparameterTuningJobRequest.php | 2 +- AiPlatform/src/V1/CancelNasJobRequest.php | 2 +- .../src/V1/CancelPipelineJobRequest.php | 2 +- .../src/V1/CancelTrainingPipelineRequest.php | 2 +- AiPlatform/src/V1/CancelTuningJobRequest.php | 2 +- AiPlatform/src/V1/Candidate.php | 12 +- .../CheckTrialEarlyStoppingStateMetatdata.php | 6 +- .../CheckTrialEarlyStoppingStateRequest.php | 2 +- .../CheckTrialEarlyStoppingStateResponse.php | 2 +- AiPlatform/src/V1/Citation.php | 12 +- .../src/V1/Client/DatasetServiceClient.php | 107 +- .../DeploymentResourcePoolServiceClient.php | 71 +- .../src/V1/Client/EndpointServiceClient.php | 59 +- .../FeatureOnlineStoreAdminServiceClient.php | 95 +- .../FeatureOnlineStoreServiceClient.php | 35 +- .../Client/FeatureRegistryServiceClient.php | 71 +- ...FeaturestoreOnlineServingServiceClient.php | 44 +- .../V1/Client/FeaturestoreServiceClient.php | 77 +- .../V1/Client/GenAiTuningServiceClient.php | 26 +- .../V1/Client/IndexEndpointServiceClient.php | 37 +- .../src/V1/Client/IndexServiceClient.php | 49 +- AiPlatform/src/V1/Client/JobServiceClient.php | 191 +- .../src/V1/Client/LlmUtilityServiceClient.php | 20 +- .../src/V1/Client/MatchServiceClient.php | 18 +- .../src/V1/Client/MetadataServiceClient.php | 111 +- .../src/V1/Client/MigrationServiceClient.php | 49 +- .../V1/Client/ModelGardenServiceClient.php | 12 +- .../src/V1/Client/ModelServiceClient.php | 104 +- .../src/V1/Client/NotebookServiceClient.php | 127 +- .../PersistentResourceServiceClient.php | 74 +- .../src/V1/Client/PipelineServiceClient.php | 99 +- .../src/V1/Client/PredictionServiceClient.php | 23 +- .../src/V1/Client/ScheduleServiceClient.php | 61 +- .../V1/Client/SpecialistPoolServiceClient.php | 55 +- .../V1/Client/TensorboardServiceClient.php | 186 +- .../src/V1/Client/VizierServiceClient.php | 49 +- AiPlatform/src/V1/CompleteTrialRequest.php | 8 +- AiPlatform/src/V1/CompletionStats.php | 8 +- AiPlatform/src/V1/ComputeTokensRequest.php | 2 +- .../src/V1/ContainerRegistryDestination.php | 2 +- AiPlatform/src/V1/ContainerSpec.php | 2 +- AiPlatform/src/V1/Content.php | 2 +- AiPlatform/src/V1/Context.php | 18 +- .../src/V1/CopyModelOperationMetadata.php | 2 +- AiPlatform/src/V1/CopyModelRequest.php | 6 +- AiPlatform/src/V1/CopyModelResponse.php | 4 +- AiPlatform/src/V1/CountTokensRequest.php | 4 +- AiPlatform/src/V1/CountTokensResponse.php | 4 +- AiPlatform/src/V1/CreateArtifactRequest.php | 6 +- .../V1/CreateBatchPredictionJobRequest.php | 4 +- AiPlatform/src/V1/CreateContextRequest.php | 6 +- AiPlatform/src/V1/CreateCustomJobRequest.php | 4 +- .../src/V1/CreateDataLabelingJobRequest.php | 4 +- .../src/V1/CreateDatasetOperationMetadata.php | 2 +- AiPlatform/src/V1/CreateDatasetRequest.php | 4 +- .../CreateDatasetVersionOperationMetadata.php | 2 +- .../src/V1/CreateDatasetVersionRequest.php | 4 +- ...eploymentResourcePoolOperationMetadata.php | 2 +- .../CreateDeploymentResourcePoolRequest.php | 6 +- .../V1/CreateEndpointOperationMetadata.php | 2 +- AiPlatform/src/V1/CreateEndpointRequest.php | 6 +- .../V1/CreateEntityTypeOperationMetadata.php | 2 +- AiPlatform/src/V1/CreateEntityTypeRequest.php | 6 +- AiPlatform/src/V1/CreateExecutionRequest.php | 6 +- .../CreateFeatureGroupOperationMetadata.php | 2 +- .../src/V1/CreateFeatureGroupRequest.php | 16 +- ...ateFeatureOnlineStoreOperationMetadata.php | 2 +- .../V1/CreateFeatureOnlineStoreRequest.php | 6 +- .../src/V1/CreateFeatureOperationMetadata.php | 2 +- AiPlatform/src/V1/CreateFeatureRequest.php | 6 +- .../V1/CreateFeatureViewOperationMetadata.php | 2 +- .../src/V1/CreateFeatureViewRequest.php | 8 +- .../CreateFeaturestoreOperationMetadata.php | 2 +- .../src/V1/CreateFeaturestoreRequest.php | 6 +- .../CreateHyperparameterTuningJobRequest.php | 4 +- .../CreateIndexEndpointOperationMetadata.php | 2 +- .../src/V1/CreateIndexEndpointRequest.php | 4 +- .../src/V1/CreateIndexOperationMetadata.php | 4 +- AiPlatform/src/V1/CreateIndexRequest.php | 4 +- .../src/V1/CreateMetadataSchemaRequest.php | 6 +- .../CreateMetadataStoreOperationMetadata.php | 2 +- .../src/V1/CreateMetadataStoreRequest.php | 6 +- ...ateModelDeploymentMonitoringJobRequest.php | 4 +- AiPlatform/src/V1/CreateNasJobRequest.php | 4 +- ...tebookRuntimeTemplateOperationMetadata.php | 2 +- .../CreateNotebookRuntimeTemplateRequest.php | 6 +- ...atePersistentResourceOperationMetadata.php | 4 +- .../V1/CreatePersistentResourceRequest.php | 6 +- .../src/V1/CreatePipelineJobRequest.php | 6 +- ...CreateRegistryFeatureOperationMetadata.php | 2 +- AiPlatform/src/V1/CreateScheduleRequest.php | 4 +- .../CreateSpecialistPoolOperationMetadata.php | 2 +- .../src/V1/CreateSpecialistPoolRequest.php | 4 +- AiPlatform/src/V1/CreateStudyRequest.php | 4 +- .../V1/CreateTensorboardExperimentRequest.php | 6 +- .../V1/CreateTensorboardOperationMetadata.php | 2 +- .../src/V1/CreateTensorboardRequest.php | 4 +- .../src/V1/CreateTensorboardRunRequest.php | 6 +- .../V1/CreateTensorboardTimeSeriesRequest.php | 6 +- .../src/V1/CreateTrainingPipelineRequest.php | 4 +- AiPlatform/src/V1/CreateTrialRequest.php | 4 +- AiPlatform/src/V1/CreateTuningJobRequest.php | 4 +- AiPlatform/src/V1/CsvDestination.php | 2 +- AiPlatform/src/V1/CsvSource.php | 2 +- AiPlatform/src/V1/CustomJob.php | 20 +- AiPlatform/src/V1/CustomJobSpec.php | 38 +- AiPlatform/src/V1/DataItem.php | 10 +- AiPlatform/src/V1/DataItemView.php | 4 +- AiPlatform/src/V1/DataLabelingJob.php | 28 +- AiPlatform/src/V1/Dataset.php | 60 +- AiPlatform/src/V1/DatasetServiceClient.php | 34 - .../src/V1/DatasetServiceGrpcClient.php | 216 - AiPlatform/src/V1/DatasetVersion.php | 52 +- AiPlatform/src/V1/DedicatedResources.php | 6 +- AiPlatform/src/V1/DeleteArtifactRequest.php | 4 +- .../V1/DeleteBatchPredictionJobRequest.php | 2 +- AiPlatform/src/V1/DeleteContextRequest.php | 6 +- AiPlatform/src/V1/DeleteCustomJobRequest.php | 2 +- .../src/V1/DeleteDataLabelingJobRequest.php | 2 +- AiPlatform/src/V1/DeleteDatasetRequest.php | 2 +- .../src/V1/DeleteDatasetVersionRequest.php | 2 +- .../DeleteDeploymentResourcePoolRequest.php | 2 +- AiPlatform/src/V1/DeleteEndpointRequest.php | 2 +- AiPlatform/src/V1/DeleteEntityTypeRequest.php | 4 +- AiPlatform/src/V1/DeleteExecutionRequest.php | 4 +- .../src/V1/DeleteFeatureGroupRequest.php | 4 +- .../V1/DeleteFeatureOnlineStoreRequest.php | 4 +- AiPlatform/src/V1/DeleteFeatureRequest.php | 2 +- .../DeleteFeatureValuesOperationMetadata.php | 2 +- .../src/V1/DeleteFeatureValuesRequest.php | 2 +- .../SelectEntity.php | 2 +- .../SelectTimeRangeAndFeature.php | 6 +- .../SelectEntity.php | 4 +- .../SelectTimeRangeAndFeature.php | 6 +- .../src/V1/DeleteFeatureViewRequest.php | 2 +- .../src/V1/DeleteFeaturestoreRequest.php | 4 +- .../DeleteHyperparameterTuningJobRequest.php | 2 +- .../src/V1/DeleteIndexEndpointRequest.php | 2 +- AiPlatform/src/V1/DeleteIndexRequest.php | 2 +- .../DeleteMetadataStoreOperationMetadata.php | 2 +- .../src/V1/DeleteMetadataStoreRequest.php | 2 +- ...eteModelDeploymentMonitoringJobRequest.php | 2 +- AiPlatform/src/V1/DeleteModelRequest.php | 2 +- .../src/V1/DeleteModelVersionRequest.php | 2 +- AiPlatform/src/V1/DeleteNasJobRequest.php | 2 +- .../src/V1/DeleteNotebookRuntimeRequest.php | 2 +- .../DeleteNotebookRuntimeTemplateRequest.php | 2 +- AiPlatform/src/V1/DeleteOperationMetadata.php | 2 +- .../V1/DeletePersistentResourceRequest.php | 2 +- .../src/V1/DeletePipelineJobRequest.php | 2 +- AiPlatform/src/V1/DeleteSavedQueryRequest.php | 2 +- AiPlatform/src/V1/DeleteScheduleRequest.php | 2 +- .../src/V1/DeleteSpecialistPoolRequest.php | 4 +- AiPlatform/src/V1/DeleteStudyRequest.php | 2 +- .../V1/DeleteTensorboardExperimentRequest.php | 2 +- .../src/V1/DeleteTensorboardRequest.php | 2 +- .../src/V1/DeleteTensorboardRunRequest.php | 2 +- .../V1/DeleteTensorboardTimeSeriesRequest.php | 2 +- .../src/V1/DeleteTrainingPipelineRequest.php | 2 +- AiPlatform/src/V1/DeleteTrialRequest.php | 2 +- .../src/V1/DeployIndexOperationMetadata.php | 4 +- AiPlatform/src/V1/DeployIndexRequest.php | 4 +- AiPlatform/src/V1/DeployIndexResponse.php | 2 +- .../src/V1/DeployModelOperationMetadata.php | 2 +- AiPlatform/src/V1/DeployModelRequest.php | 4 +- AiPlatform/src/V1/DeployModelResponse.php | 2 +- AiPlatform/src/V1/DeployedIndex.php | 22 +- AiPlatform/src/V1/DeployedIndexAuthConfig.php | 2 +- AiPlatform/src/V1/DeployedIndexRef.php | 6 +- AiPlatform/src/V1/DeployedModel.php | 22 +- AiPlatform/src/V1/DeployedModelRef.php | 4 +- AiPlatform/src/V1/DeploymentResourcePool.php | 166 +- .../DeploymentResourcePoolServiceClient.php | 34 - .../src/V1/DestinationFeatureSetting.php | 4 +- AiPlatform/src/V1/DirectPredictRequest.php | 4 +- AiPlatform/src/V1/DirectPredictResponse.php | 2 +- AiPlatform/src/V1/DirectRawPredictRequest.php | 6 +- .../src/V1/DirectRawPredictResponse.php | 2 +- AiPlatform/src/V1/DiskSpec.php | 4 +- AiPlatform/src/V1/EncryptionSpec.php | 2 +- AiPlatform/src/V1/Endpoint.php | 76 +- AiPlatform/src/V1/EndpointServiceClient.php | 34 - .../src/V1/EndpointServiceGrpcClient.php | 159 - AiPlatform/src/V1/EntityIdSelector.php | 2 +- AiPlatform/src/V1/EntityType.php | 14 +- AiPlatform/src/V1/EnvVar.php | 4 +- AiPlatform/src/V1/ErrorAnalysisAnnotation.php | 6 +- .../AttributedItem.php | 4 +- AiPlatform/src/V1/EvaluatedAnnotation.php | 6 +- .../src/V1/EvaluatedAnnotationExplanation.php | 4 +- AiPlatform/src/V1/Event.php | 8 +- AiPlatform/src/V1/Examples.php | 2 +- .../src/V1/Examples/ExampleGcsSource.php | 4 +- AiPlatform/src/V1/ExamplesOverride.php | 8 +- .../src/V1/ExamplesRestrictionsNamespace.php | 2 +- AiPlatform/src/V1/Execution.php | 20 +- AiPlatform/src/V1/ExplainRequest.php | 8 +- AiPlatform/src/V1/ExplainResponse.php | 2 +- AiPlatform/src/V1/ExplanationMetadata.php | 4 +- .../V1/ExplanationMetadata/InputMetadata.php | 18 +- .../InputMetadata/FeatureValueDomain.php | 8 +- .../InputMetadata/Visualization.php | 12 +- .../V1/ExplanationMetadata/OutputMetadata.php | 2 +- AiPlatform/src/V1/ExplanationParameters.php | 4 +- AiPlatform/src/V1/ExplanationSpec.php | 4 +- AiPlatform/src/V1/ExplanationSpecOverride.php | 6 +- AiPlatform/src/V1/ExportDataConfig.php | 8 +- .../src/V1/ExportDataOperationMetadata.php | 4 +- AiPlatform/src/V1/ExportDataRequest.php | 4 +- AiPlatform/src/V1/ExportDataResponse.php | 2 +- .../ExportFeatureValuesOperationMetadata.php | 2 +- .../src/V1/ExportFeatureValuesRequest.php | 6 +- .../ExportFeatureValuesRequest/FullExport.php | 4 +- .../SnapshotExport.php | 4 +- AiPlatform/src/V1/ExportFilterSplit.php | 6 +- AiPlatform/src/V1/ExportFractionSplit.php | 6 +- .../src/V1/ExportModelOperationMetadata.php | 4 +- .../OutputInfo.php | 4 +- AiPlatform/src/V1/ExportModelRequest.php | 4 +- .../V1/ExportModelRequest/OutputConfig.php | 6 +- ...ExportTensorboardTimeSeriesDataRequest.php | 10 +- ...xportTensorboardTimeSeriesDataResponse.php | 2 +- AiPlatform/src/V1/Feature.php | 18 +- .../src/V1/Feature/MonitoringStatsAnomaly.php | 4 +- AiPlatform/src/V1/Feature/ValueType.php | 7 + AiPlatform/src/V1/FeatureGroup.php | 28 +- AiPlatform/src/V1/FeatureGroup/BigQuery.php | 2 +- .../NoiseSigmaForFeature.php | 4 +- AiPlatform/src/V1/FeatureOnlineStore.php | 60 +- .../src/V1/FeatureOnlineStore/Bigtable.php | 2 +- .../Bigtable/AutoScaling.php | 6 +- .../DedicatedServingEndpoint.php | 2 +- .../FeatureOnlineStoreAdminServiceClient.php | 34 - .../V1/FeatureOnlineStoreServiceClient.php | 34 - .../src/V1/FeatureRegistryServiceClient.php | 34 - AiPlatform/src/V1/FeatureSelector.php | 2 +- AiPlatform/src/V1/FeatureStatsAnomaly.php | 14 +- AiPlatform/src/V1/FeatureValue.php | 35 +- AiPlatform/src/V1/FeatureValue/Metadata.php | 2 +- AiPlatform/src/V1/FeatureView.php | 12 +- .../src/V1/FeatureView/BigQuerySource.php | 2 +- .../V1/FeatureView/FeatureRegistrySource.php | 2 +- .../FeatureRegistrySource/FeatureGroup.php | 2 +- AiPlatform/src/V1/FeatureView/IndexConfig.php | 8 +- .../FeatureView/IndexConfig/TreeAHConfig.php | 2 +- AiPlatform/src/V1/FeatureView/SyncConfig.php | 2 +- AiPlatform/src/V1/FeatureViewSync.php | 10 +- .../src/V1/FeatureViewSync/SyncSummary.php | 4 +- AiPlatform/src/V1/Featurestore.php | 16 +- .../V1/Featurestore/OnlineServingConfig.php | 4 +- .../OnlineServingConfig/Scaling.php | 6 +- .../src/V1/FeaturestoreMonitoringConfig.php | 8 +- .../ImportFeaturesAnalysis.php | 4 +- .../SnapshotAnalysis.php | 6 +- ...FeaturestoreOnlineServingServiceClient.php | 34 - ...urestoreOnlineServingServiceGrpcClient.php | 88 - .../src/V1/FeaturestoreServiceClient.php | 34 - .../src/V1/FeaturestoreServiceGrpcClient.php | 385 - .../src/V1/FetchFeatureValuesRequest.php | 6 +- .../src/V1/FetchFeatureValuesResponse.php | 2 +- .../FeatureNameValuePair.php | 2 +- AiPlatform/src/V1/FileData.php | 4 +- AiPlatform/src/V1/FilterSplit.php | 6 +- AiPlatform/src/V1/FindNeighborsRequest.php | 6 +- .../src/V1/FindNeighborsRequest/Query.php | 52 +- .../src/V1/FindNeighborsRequest/Query/RRF.php | 76 + .../NearestNeighbors.php | 2 +- .../src/V1/FindNeighborsResponse/Neighbor.php | 46 +- AiPlatform/src/V1/FractionSplit.php | 6 +- AiPlatform/src/V1/FunctionCall.php | 4 +- AiPlatform/src/V1/FunctionCallingConfig.php | 109 + .../src/V1/FunctionCallingConfig/Mode.php | 74 + AiPlatform/src/V1/FunctionDeclaration.php | 6 +- AiPlatform/src/V1/FunctionResponse.php | 4 +- .../V1/Gapic/DatasetServiceGapicClient.php | 2411 ---- ...ploymentResourcePoolServiceGapicClient.php | 1129 -- .../V1/Gapic/EndpointServiceGapicClient.php | 1631 --- ...tureOnlineStoreAdminServiceGapicClient.php | 1884 --- .../FeatureOnlineStoreServiceGapicClient.php | 756 -- .../FeatureRegistryServiceGapicClient.php | 1775 --- ...restoreOnlineServingServiceGapicClient.php | 829 -- .../Gapic/FeaturestoreServiceGapicClient.php | 2990 ----- .../Gapic/GenAiTuningServiceGapicClient.php | 1084 -- .../Gapic/IndexEndpointServiceGapicClient.php | 1374 -- .../src/V1/Gapic/IndexServiceGapicClient.php | 1256 -- .../src/V1/Gapic/JobServiceGapicClient.php | 3852 ------ .../V1/Gapic/LlmUtilityServiceGapicClient.php | 820 -- .../src/V1/Gapic/MatchServiceGapicClient.php | 762 -- .../V1/Gapic/MetadataServiceGapicClient.php | 3302 ----- .../V1/Gapic/MigrationServiceGapicClient.php | 1002 -- .../Gapic/ModelGardenServiceGapicClient.php | 676 - .../src/V1/Gapic/ModelServiceGapicClient.php | 2396 ---- .../V1/Gapic/NotebookServiceGapicClient.php | 1678 --- .../PersistentResourceServiceGapicClient.php | 1206 -- .../V1/Gapic/PipelineServiceGapicClient.php | 2053 --- .../V1/Gapic/PredictionServiceGapicClient.php | 1683 --- .../V1/Gapic/ScheduleServiceGapicClient.php | 1445 --- .../SpecialistPoolServiceGapicClient.php | 1102 -- .../Gapic/TensorboardServiceGapicClient.php | 2943 ----- .../src/V1/Gapic/VizierServiceGapicClient.php | 1735 --- AiPlatform/src/V1/GcsDestination.php | 2 +- .../src/V1/GenAiTuningServiceClient.php | 34 - AiPlatform/src/V1/GenerateContentRequest.php | 54 +- AiPlatform/src/V1/GenerateContentResponse.php | 4 +- .../PromptFeedback.php | 4 +- .../GenerateContentResponse/UsageMetadata.php | 6 +- AiPlatform/src/V1/GenerationConfig.php | 84 +- .../src/V1/GenericOperationMetadata.php | 4 +- AiPlatform/src/V1/GenieSource.php | 2 +- .../src/V1/GetAnnotationSpecRequest.php | 4 +- AiPlatform/src/V1/GetArtifactRequest.php | 2 +- .../src/V1/GetBatchPredictionJobRequest.php | 2 +- AiPlatform/src/V1/GetContextRequest.php | 2 +- AiPlatform/src/V1/GetCustomJobRequest.php | 2 +- .../src/V1/GetDataLabelingJobRequest.php | 2 +- AiPlatform/src/V1/GetDatasetRequest.php | 4 +- .../src/V1/GetDatasetVersionRequest.php | 4 +- .../V1/GetDeploymentResourcePoolRequest.php | 2 +- AiPlatform/src/V1/GetEndpointRequest.php | 2 +- AiPlatform/src/V1/GetEntityTypeRequest.php | 2 +- AiPlatform/src/V1/GetExecutionRequest.php | 2 +- AiPlatform/src/V1/GetFeatureGroupRequest.php | 2 +- .../src/V1/GetFeatureOnlineStoreRequest.php | 2 +- AiPlatform/src/V1/GetFeatureRequest.php | 2 +- AiPlatform/src/V1/GetFeatureViewRequest.php | 2 +- .../src/V1/GetFeatureViewSyncRequest.php | 2 +- AiPlatform/src/V1/GetFeaturestoreRequest.php | 2 +- .../V1/GetHyperparameterTuningJobRequest.php | 2 +- AiPlatform/src/V1/GetIndexEndpointRequest.php | 2 +- AiPlatform/src/V1/GetIndexRequest.php | 2 +- .../src/V1/GetMetadataSchemaRequest.php | 2 +- AiPlatform/src/V1/GetMetadataStoreRequest.php | 2 +- ...GetModelDeploymentMonitoringJobRequest.php | 2 +- .../src/V1/GetModelEvaluationRequest.php | 2 +- .../src/V1/GetModelEvaluationSliceRequest.php | 2 +- AiPlatform/src/V1/GetModelRequest.php | 2 +- AiPlatform/src/V1/GetNasJobRequest.php | 2 +- .../src/V1/GetNasTrialDetailRequest.php | 2 +- .../src/V1/GetNotebookRuntimeRequest.php | 2 +- .../V1/GetNotebookRuntimeTemplateRequest.php | 2 +- .../src/V1/GetPersistentResourceRequest.php | 2 +- AiPlatform/src/V1/GetPipelineJobRequest.php | 2 +- .../src/V1/GetPublisherModelRequest.php | 6 +- AiPlatform/src/V1/GetScheduleRequest.php | 2 +- .../src/V1/GetSpecialistPoolRequest.php | 2 +- AiPlatform/src/V1/GetStudyRequest.php | 2 +- .../V1/GetTensorboardExperimentRequest.php | 2 +- AiPlatform/src/V1/GetTensorboardRequest.php | 2 +- .../src/V1/GetTensorboardRunRequest.php | 2 +- .../V1/GetTensorboardTimeSeriesRequest.php | 2 +- .../src/V1/GetTrainingPipelineRequest.php | 2 +- AiPlatform/src/V1/GetTrialRequest.php | 2 +- AiPlatform/src/V1/GetTuningJobRequest.php | 2 +- AiPlatform/src/V1/GoogleSearchRetrieval.php | 42 - AiPlatform/src/V1/GroundingAttribution.php | 167 - .../src/V1/GroundingAttribution/Web.php | 102 - AiPlatform/src/V1/GroundingMetadata.php | 42 +- AiPlatform/src/V1/HyperparameterTuningJob.php | 28 +- AiPlatform/src/V1/ImportDataConfig.php | 2 +- .../src/V1/ImportDataOperationMetadata.php | 2 +- AiPlatform/src/V1/ImportDataRequest.php | 2 +- .../ImportFeatureValuesOperationMetadata.php | 10 +- .../src/V1/ImportFeatureValuesRequest.php | 10 +- .../FeatureSpec.php | 4 +- .../src/V1/ImportFeatureValuesResponse.php | 8 +- .../src/V1/ImportModelEvaluationRequest.php | 4 +- AiPlatform/src/V1/Index.php | 22 +- AiPlatform/src/V1/IndexDatapoint.php | 64 +- .../src/V1/IndexDatapoint/CrowdingTag.php | 2 +- .../V1/IndexDatapoint/NumericRestriction.php | 4 +- .../src/V1/IndexDatapoint/Restriction.php | 2 +- .../src/V1/IndexDatapoint/SparseEmbedding.php | 107 + AiPlatform/src/V1/IndexEndpoint.php | 22 +- .../src/V1/IndexEndpointServiceClient.php | 34 - .../src/V1/IndexEndpointServiceGrpcClient.php | 158 - AiPlatform/src/V1/IndexPrivateEndpoints.php | 4 +- AiPlatform/src/V1/IndexServiceClient.php | 34 - AiPlatform/src/V1/IndexServiceGrpcClient.php | 143 - AiPlatform/src/V1/IndexStats.php | 46 +- AiPlatform/src/V1/InputDataConfig.php | 10 +- .../src/V1/IntegratedGradientsAttribution.php | 6 +- AiPlatform/src/V1/JobServiceClient.php | 34 - AiPlatform/src/V1/JobServiceGrpcClient.php | 617 - AiPlatform/src/V1/LargeModelReference.php | 2 +- AiPlatform/src/V1/ListAnnotationsRequest.php | 12 +- AiPlatform/src/V1/ListAnnotationsResponse.php | 2 +- AiPlatform/src/V1/ListArtifactsRequest.php | 10 +- AiPlatform/src/V1/ListArtifactsResponse.php | 2 +- .../src/V1/ListBatchPredictionJobsRequest.php | 10 +- .../V1/ListBatchPredictionJobsResponse.php | 2 +- AiPlatform/src/V1/ListContextsRequest.php | 10 +- AiPlatform/src/V1/ListContextsResponse.php | 2 +- AiPlatform/src/V1/ListCustomJobsRequest.php | 10 +- AiPlatform/src/V1/ListCustomJobsResponse.php | 2 +- AiPlatform/src/V1/ListDataItemsRequest.php | 12 +- AiPlatform/src/V1/ListDataItemsResponse.php | 2 +- .../src/V1/ListDataLabelingJobsRequest.php | 12 +- .../src/V1/ListDataLabelingJobsResponse.php | 2 +- .../src/V1/ListDatasetVersionsRequest.php | 12 +- .../src/V1/ListDatasetVersionsResponse.php | 2 +- AiPlatform/src/V1/ListDatasetsRequest.php | 12 +- AiPlatform/src/V1/ListDatasetsResponse.php | 2 +- .../V1/ListDeploymentResourcePoolsRequest.php | 6 +- .../ListDeploymentResourcePoolsResponse.php | 2 +- AiPlatform/src/V1/ListEndpointsRequest.php | 12 +- AiPlatform/src/V1/ListEndpointsResponse.php | 2 +- AiPlatform/src/V1/ListEntityTypesRequest.php | 12 +- AiPlatform/src/V1/ListEntityTypesResponse.php | 2 +- AiPlatform/src/V1/ListExecutionsRequest.php | 10 +- AiPlatform/src/V1/ListExecutionsResponse.php | 2 +- .../src/V1/ListFeatureGroupsRequest.php | 10 +- .../src/V1/ListFeatureGroupsResponse.php | 2 +- .../src/V1/ListFeatureOnlineStoresRequest.php | 10 +- .../V1/ListFeatureOnlineStoresResponse.php | 2 +- .../src/V1/ListFeatureViewSyncsRequest.php | 10 +- .../src/V1/ListFeatureViewSyncsResponse.php | 2 +- AiPlatform/src/V1/ListFeatureViewsRequest.php | 10 +- .../src/V1/ListFeatureViewsResponse.php | 2 +- AiPlatform/src/V1/ListFeaturesRequest.php | 14 +- AiPlatform/src/V1/ListFeaturesResponse.php | 2 +- .../src/V1/ListFeaturestoresRequest.php | 12 +- .../src/V1/ListFeaturestoresResponse.php | 2 +- .../ListHyperparameterTuningJobsRequest.php | 10 +- .../ListHyperparameterTuningJobsResponse.php | 2 +- .../src/V1/ListIndexEndpointsRequest.php | 10 +- .../src/V1/ListIndexEndpointsResponse.php | 2 +- AiPlatform/src/V1/ListIndexesRequest.php | 10 +- AiPlatform/src/V1/ListIndexesResponse.php | 2 +- .../src/V1/ListMetadataSchemasRequest.php | 8 +- .../src/V1/ListMetadataSchemasResponse.php | 2 +- .../src/V1/ListMetadataStoresRequest.php | 6 +- .../src/V1/ListMetadataStoresResponse.php | 2 +- ...stModelDeploymentMonitoringJobsRequest.php | 10 +- ...tModelDeploymentMonitoringJobsResponse.php | 2 +- .../V1/ListModelEvaluationSlicesRequest.php | 10 +- .../V1/ListModelEvaluationSlicesResponse.php | 2 +- .../src/V1/ListModelEvaluationsRequest.php | 10 +- .../src/V1/ListModelEvaluationsResponse.php | 2 +- .../src/V1/ListModelVersionsRequest.php | 12 +- .../src/V1/ListModelVersionsResponse.php | 2 +- AiPlatform/src/V1/ListModelsRequest.php | 12 +- AiPlatform/src/V1/ListModelsResponse.php | 2 +- AiPlatform/src/V1/ListNasJobsRequest.php | 10 +- AiPlatform/src/V1/ListNasJobsResponse.php | 2 +- .../src/V1/ListNasTrialDetailsRequest.php | 6 +- .../src/V1/ListNasTrialDetailsResponse.php | 2 +- .../ListNotebookRuntimeTemplatesRequest.php | 12 +- .../ListNotebookRuntimeTemplatesResponse.php | 2 +- .../src/V1/ListNotebookRuntimesRequest.php | 12 +- .../src/V1/ListNotebookRuntimesResponse.php | 2 +- .../src/V1/ListOptimalTrialsRequest.php | 2 +- .../src/V1/ListPersistentResourcesRequest.php | 6 +- .../V1/ListPersistentResourcesResponse.php | 2 +- AiPlatform/src/V1/ListPipelineJobsRequest.php | 12 +- .../src/V1/ListPipelineJobsResponse.php | 2 +- AiPlatform/src/V1/ListSavedQueriesRequest.php | 12 +- .../src/V1/ListSavedQueriesResponse.php | 2 +- AiPlatform/src/V1/ListSchedulesRequest.php | 10 +- AiPlatform/src/V1/ListSchedulesResponse.php | 2 +- .../src/V1/ListSpecialistPoolsRequest.php | 8 +- .../src/V1/ListSpecialistPoolsResponse.php | 2 +- AiPlatform/src/V1/ListStudiesRequest.php | 6 +- AiPlatform/src/V1/ListStudiesResponse.php | 2 +- .../V1/ListTensorboardExperimentsRequest.php | 12 +- .../V1/ListTensorboardExperimentsResponse.php | 2 +- .../src/V1/ListTensorboardRunsRequest.php | 12 +- .../src/V1/ListTensorboardRunsResponse.php | 2 +- .../V1/ListTensorboardTimeSeriesRequest.php | 12 +- .../V1/ListTensorboardTimeSeriesResponse.php | 2 +- AiPlatform/src/V1/ListTensorboardsRequest.php | 12 +- .../src/V1/ListTensorboardsResponse.php | 2 +- .../src/V1/ListTrainingPipelinesRequest.php | 10 +- .../src/V1/ListTrainingPipelinesResponse.php | 2 +- AiPlatform/src/V1/ListTrialsRequest.php | 6 +- AiPlatform/src/V1/ListTrialsResponse.php | 2 +- AiPlatform/src/V1/ListTuningJobsRequest.php | 8 +- AiPlatform/src/V1/ListTuningJobsResponse.php | 2 +- AiPlatform/src/V1/LlmUtilityServiceClient.php | 34 - AiPlatform/src/V1/LookupStudyRequest.php | 4 +- AiPlatform/src/V1/MachineSpec.php | 8 +- .../src/V1/ManualBatchTuningParameters.php | 2 +- AiPlatform/src/V1/MatchServiceClient.php | 34 - AiPlatform/src/V1/MatchServiceGrpcClient.php | 67 - AiPlatform/src/V1/Measurement.php | 4 +- AiPlatform/src/V1/Measurement/Metric.php | 4 +- .../src/V1/MergeVersionAliasesRequest.php | 2 +- AiPlatform/src/V1/MetadataSchema.php | 12 +- AiPlatform/src/V1/MetadataServiceClient.php | 34 - .../src/V1/MetadataServiceGrpcClient.php | 531 - AiPlatform/src/V1/MetadataStore.php | 56 +- .../src/V1/MetadataStore/DataplexConfig.php | 72 + .../V1/MetadataStore/MetadataStoreState.php | 2 +- AiPlatform/src/V1/MigratableResource.php | 4 +- .../V1/MigratableResource/AutomlDataset.php | 4 +- .../src/V1/MigratableResource/AutomlModel.php | 4 +- .../DataLabelingDataset.php | 4 +- .../DataLabelingAnnotatedDataset.php | 4 +- .../MlEngineModelVersion.php | 4 +- .../MigrateAutomlDatasetConfig.php | 4 +- .../MigrateAutomlModelConfig.php | 4 +- .../MigrateDataLabelingDatasetConfig.php | 4 +- ...rateDataLabelingAnnotatedDatasetConfig.php | 2 +- .../MigrateMlEngineModelVersionConfig.php | 6 +- AiPlatform/src/V1/MigrateResourceResponse.php | 2 +- AiPlatform/src/V1/MigrationServiceClient.php | 34 - .../src/V1/MigrationServiceGrpcClient.php | 69 - AiPlatform/src/V1/Model.php | 48 +- AiPlatform/src/V1/Model/DataStats.php | 12 +- AiPlatform/src/V1/Model/ExportFormat.php | 2 +- AiPlatform/src/V1/Model/OriginalModelInfo.php | 2 +- AiPlatform/src/V1/ModelContainerSpec.php | 14 +- ...ModelDeploymentMonitoringBigQueryTable.php | 8 +- .../src/V1/ModelDeploymentMonitoringJob.php | 40 +- .../LatestMonitoringPipelineMetadata.php | 4 +- ...delDeploymentMonitoringObjectiveConfig.php | 4 +- ...odelDeploymentMonitoringScheduleConfig.php | 4 +- AiPlatform/src/V1/ModelEvaluation.php | 18 +- .../ModelEvaluationExplanationSpec.php | 4 +- AiPlatform/src/V1/ModelEvaluationSlice.php | 12 +- .../src/V1/ModelEvaluationSlice/Slice.php | 6 +- .../Slice/SliceSpec/Range.php | 4 +- .../Slice/SliceSpec/SliceConfig.php | 4 +- .../src/V1/ModelGardenServiceClient.php | 34 - AiPlatform/src/V1/ModelGardenSource.php | 2 +- .../src/V1/ModelMonitoringAlertConfig.php | 2 +- .../src/V1/ModelMonitoringObjectiveConfig.php | 8 +- .../ExplanationConfig.php | 4 +- .../ExplanationConfig/ExplanationBaseline.php | 2 +- .../PredictionDriftDetectionConfig.php | 2 +- .../TrainingDataset.php | 6 +- .../TrainingPredictionSkewDetectionConfig.php | 2 +- .../src/V1/ModelMonitoringStatsAnomalies.php | 6 +- .../FeatureHistoricStatsAnomalies.php | 6 +- AiPlatform/src/V1/ModelServiceClient.php | 34 - AiPlatform/src/V1/ModelServiceGrpcClient.php | 311 - AiPlatform/src/V1/ModelSourceInfo.php | 4 +- .../MutateDeployedIndexOperationMetadata.php | 4 +- .../src/V1/MutateDeployedIndexRequest.php | 4 +- .../src/V1/MutateDeployedIndexResponse.php | 2 +- .../MutateDeployedModelOperationMetadata.php | 2 +- .../src/V1/MutateDeployedModelRequest.php | 6 +- .../src/V1/MutateDeployedModelResponse.php | 2 +- AiPlatform/src/V1/NasJob.php | 22 +- AiPlatform/src/V1/NasJobSpec.php | 4 +- .../V1/NasJobSpec/MultiTrialAlgorithmSpec.php | 8 +- .../MultiTrialAlgorithmSpec/MetricSpec.php | 4 +- .../SearchTrialSpec.php | 8 +- .../TrainTrialSpec.php | 6 +- AiPlatform/src/V1/NasTrial.php | 10 +- AiPlatform/src/V1/NasTrialDetail.php | 8 +- AiPlatform/src/V1/NearestNeighborQuery.php | 6 +- .../V1/NearestNeighborQuery/Parameters.php | 4 +- .../V1/NearestNeighborQuery/StringFilter.php | 2 +- ...NearestNeighborSearchOperationMetadata.php | 2 +- .../ContentValidationStats.php | 74 +- .../RecordError.php | 10 +- .../RecordError/RecordErrorType.php | 32 +- .../src/V1/NearestNeighbors/Neighbor.php | 6 +- AiPlatform/src/V1/Neighbor.php | 4 +- AiPlatform/src/V1/NetworkSpec.php | 6 +- AiPlatform/src/V1/NfsMount.php | 6 +- AiPlatform/src/V1/NotebookEucConfig.php | 4 +- .../src/V1/NotebookIdleShutdownConfig.php | 4 +- AiPlatform/src/V1/NotebookRuntime.php | 186 +- AiPlatform/src/V1/NotebookRuntimeTemplate.php | 88 +- .../src/V1/NotebookRuntimeTemplateRef.php | 2 +- AiPlatform/src/V1/NotebookServiceClient.php | 34 - ...useModelDeploymentMonitoringJobRequest.php | 2 +- AiPlatform/src/V1/PauseScheduleRequest.php | 2 +- AiPlatform/src/V1/PersistentDiskSpec.php | 4 +- AiPlatform/src/V1/PersistentResource.php | 38 +- .../V1/PersistentResourceServiceClient.php | 34 - AiPlatform/src/V1/PipelineJob.php | 50 +- .../src/V1/PipelineJob/RuntimeConfig.php | 4 +- AiPlatform/src/V1/PipelineJobDetail.php | 4 +- AiPlatform/src/V1/PipelineServiceClient.php | 34 - .../src/V1/PipelineServiceGrpcClient.php | 213 - AiPlatform/src/V1/PipelineTaskDetail.php | 20 +- .../PipelineTaskDetail/PipelineTaskStatus.php | 6 +- .../ContainerDetail.php | 4 +- .../CustomJobDetail.php | 2 +- .../src/V1/PipelineTemplateMetadata.php | 2 +- AiPlatform/src/V1/Port.php | 2 +- AiPlatform/src/V1/PredefinedSplit.php | 2 +- AiPlatform/src/V1/PredictRequest.php | 4 +- .../PredictRequestResponseLoggingConfig.php | 6 +- AiPlatform/src/V1/PredictResponse.php | 10 +- AiPlatform/src/V1/PredictSchemata.php | 6 +- AiPlatform/src/V1/PredictionServiceClient.php | 34 - .../src/V1/PredictionServiceGrpcClient.php | 101 - AiPlatform/src/V1/Presets.php | 4 +- AiPlatform/src/V1/PrivateEndpoints.php | 8 +- .../src/V1/PrivateServiceConnectConfig.php | 2 +- AiPlatform/src/V1/Probe.php | 10 +- AiPlatform/src/V1/PscAutomatedEndpoints.php | 6 +- AiPlatform/src/V1/PublisherModel.php | 16 +- .../src/V1/PublisherModel/CallToAction.php | 26 +- .../V1/PublisherModel/CallToAction/Deploy.php | 60 +- .../RegionalResourceReferences.php | 8 +- .../CallToAction/ViewRestApi.php | 2 +- .../src/V1/PublisherModel/Documentation.php | 4 +- AiPlatform/src/V1/PurgeArtifactsMetadata.php | 2 +- AiPlatform/src/V1/PurgeArtifactsRequest.php | 6 +- AiPlatform/src/V1/PurgeArtifactsResponse.php | 2 +- AiPlatform/src/V1/PurgeContextsMetadata.php | 2 +- AiPlatform/src/V1/PurgeContextsRequest.php | 6 +- AiPlatform/src/V1/PurgeContextsResponse.php | 2 +- AiPlatform/src/V1/PurgeExecutionsMetadata.php | 2 +- AiPlatform/src/V1/PurgeExecutionsRequest.php | 6 +- AiPlatform/src/V1/PurgeExecutionsResponse.php | 2 +- AiPlatform/src/V1/PythonPackageSpec.php | 4 +- .../QueryArtifactLineageSubgraphRequest.php | 6 +- .../V1/QueryContextLineageSubgraphRequest.php | 2 +- .../src/V1/QueryDeployedModelsRequest.php | 6 +- .../src/V1/QueryDeployedModelsResponse.php | 6 +- .../QueryExecutionInputsAndOutputsRequest.php | 2 +- AiPlatform/src/V1/RawPredictRequest.php | 4 +- AiPlatform/src/V1/RayMetricSpec.php | 67 + AiPlatform/src/V1/RaySpec.php | 210 + .../src/V1/ReadFeatureValuesRequest.php | 6 +- .../src/V1/ReadFeatureValuesResponse.php | 4 +- .../ReadFeatureValuesResponse/EntityView.php | 2 +- .../FeatureDescriptor.php | 2 +- .../V1/ReadFeatureValuesResponse/Header.php | 2 +- .../src/V1/ReadIndexDatapointsRequest.php | 4 +- .../src/V1/ReadTensorboardBlobDataRequest.php | 2 +- .../src/V1/ReadTensorboardSizeRequest.php | 2 +- .../src/V1/ReadTensorboardSizeResponse.php | 2 +- .../ReadTensorboardTimeSeriesDataRequest.php | 6 +- .../ReadTensorboardTimeSeriesDataResponse.php | 2 +- .../src/V1/ReadTensorboardUsageRequest.php | 2 +- .../PerUserUsageData.php | 4 +- ...ootPersistentResourceOperationMetadata.php | 4 +- .../V1/RebootPersistentResourceRequest.php | 2 +- .../src/V1/RemoveContextChildrenRequest.php | 2 +- AiPlatform/src/V1/RemoveDatapointsRequest.php | 2 +- AiPlatform/src/V1/ResourcePool.php | 12 +- .../src/V1/ResourcePool/AutoscalingSpec.php | 4 +- AiPlatform/src/V1/ResourceRuntime.php | 54 + AiPlatform/src/V1/ResourceRuntimeSpec.php | 4 +- AiPlatform/src/V1/ResourcesConsumed.php | 2 +- ...RestoreDatasetVersionOperationMetadata.php | 2 +- .../src/V1/RestoreDatasetVersionRequest.php | 2 +- ...umeModelDeploymentMonitoringJobRequest.php | 2 +- AiPlatform/src/V1/ResumeScheduleRequest.php | 4 +- AiPlatform/src/V1/Retrieval.php | 2 +- AiPlatform/src/V1/SafetyRating.php | 12 +- AiPlatform/src/V1/SafetySetting.php | 6 +- AiPlatform/src/V1/SampleConfig.php | 2 +- .../src/V1/SampledShapleyAttribution.php | 2 +- AiPlatform/src/V1/SamplingStrategy.php | 2 +- .../SamplingStrategy/RandomSampleConfig.php | 2 +- AiPlatform/src/V1/SavedQuery.php | 20 +- AiPlatform/src/V1/Scalar.php | 2 +- AiPlatform/src/V1/Schedule.php | 32 +- AiPlatform/src/V1/Schedule/RunResponse.php | 4 +- AiPlatform/src/V1/ScheduleServiceClient.php | 34 - AiPlatform/src/V1/Scheduling.php | 6 +- AiPlatform/src/V1/Schema.php | 34 +- AiPlatform/src/V1/SearchDataItemsRequest.php | 14 +- .../OrderByAnnotation.php | 4 +- AiPlatform/src/V1/SearchDataItemsResponse.php | 2 +- AiPlatform/src/V1/SearchEntryPoint.php | 109 + AiPlatform/src/V1/SearchFeaturesRequest.php | 8 +- AiPlatform/src/V1/SearchFeaturesResponse.php | 2 +- .../V1/SearchMigratableResourcesRequest.php | 8 +- .../V1/SearchMigratableResourcesResponse.php | 2 +- ...loymentMonitoringStatsAnomaliesRequest.php | 14 +- .../StatsAnomaliesObjective.php | 4 +- ...oymentMonitoringStatsAnomaliesResponse.php | 2 +- .../src/V1/SearchNearestEntitiesRequest.php | 6 +- .../src/V1/SearchNearestEntitiesResponse.php | 2 +- AiPlatform/src/V1/Segment.php | 143 - AiPlatform/src/V1/ServiceAccountSpec.php | 4 +- AiPlatform/src/V1/ShieldedVmConfig.php | 2 +- AiPlatform/src/V1/SmoothGradConfig.php | 2 +- AiPlatform/src/V1/SpecialistPool.php | 6 +- .../src/V1/SpecialistPoolServiceClient.php | 34 - .../V1/SpecialistPoolServiceGrpcClient.php | 115 - .../StartNotebookRuntimeOperationMetadata.php | 4 +- .../src/V1/StartNotebookRuntimeRequest.php | 2 +- AiPlatform/src/V1/StopTrialRequest.php | 2 +- AiPlatform/src/V1/StratifiedSplit.php | 8 +- .../src/V1/StreamDirectPredictRequest.php | 4 +- .../src/V1/StreamDirectPredictResponse.php | 2 +- .../src/V1/StreamDirectRawPredictRequest.php | 6 +- .../src/V1/StreamDirectRawPredictResponse.php | 2 +- AiPlatform/src/V1/StreamRawPredictRequest.php | 4 +- AiPlatform/src/V1/StreamingPredictRequest.php | 4 +- .../src/V1/StreamingPredictResponse.php | 2 +- .../src/V1/StreamingRawPredictRequest.php | 6 +- .../src/V1/StreamingRawPredictResponse.php | 2 +- .../V1/StreamingReadFeatureValuesRequest.php | 4 +- AiPlatform/src/V1/StructFieldValue.php | 111 + AiPlatform/src/V1/StructValue.php | 67 + AiPlatform/src/V1/Study.php | 12 +- AiPlatform/src/V1/StudySpec.php | 8 +- .../StudySpec/ConvexAutomatedStoppingSpec.php | 12 +- .../DecayCurveAutomatedStoppingSpec.php | 2 +- .../StudySpec/MedianAutomatedStoppingSpec.php | 2 +- AiPlatform/src/V1/StudySpec/MetricSpec.php | 6 +- .../MetricSpec/SafetyMetricConfig.php | 4 +- AiPlatform/src/V1/StudySpec/ParameterSpec.php | 4 +- .../ParameterSpec/CategoricalValueSpec.php | 2 +- .../ConditionalParameterSpec.php | 2 +- .../ParameterSpec/DiscreteValueSpec.php | 2 +- .../ParameterSpec/DoubleValueSpec.php | 6 +- .../ParameterSpec/IntegerValueSpec.php | 6 +- .../src/V1/StudySpec/StudyStoppingConfig.php | 30 +- AiPlatform/src/V1/SuggestTrialsMetadata.php | 4 +- AiPlatform/src/V1/SuggestTrialsRequest.php | 6 +- AiPlatform/src/V1/SuggestTrialsResponse.php | 6 +- .../src/V1/SupervisedHyperParameters.php | 26 +- .../src/V1/SupervisedTuningDataStats.php | 14 +- .../SupervisedTuningDatasetDistribution.php | 14 +- .../DatasetBucket.php | 6 +- AiPlatform/src/V1/SupervisedTuningSpec.php | 22 +- AiPlatform/src/V1/SyncFeatureViewRequest.php | 2 +- AiPlatform/src/V1/SyncFeatureViewResponse.php | 2 +- AiPlatform/src/V1/TFRecordDestination.php | 2 +- AiPlatform/src/V1/Tensor.php | 4 +- AiPlatform/src/V1/Tensorboard.php | 20 +- AiPlatform/src/V1/TensorboardBlob.php | 4 +- AiPlatform/src/V1/TensorboardExperiment.php | 14 +- AiPlatform/src/V1/TensorboardRun.php | 12 +- .../src/V1/TensorboardServiceClient.php | 34 - .../src/V1/TensorboardServiceGrpcClient.php | 484 - AiPlatform/src/V1/TensorboardTensor.php | 4 +- AiPlatform/src/V1/TensorboardTimeSeries.php | 20 +- .../src/V1/TensorboardTimeSeries/Metadata.php | 6 +- AiPlatform/src/V1/TimeSeriesData.php | 4 +- AiPlatform/src/V1/TimeSeriesDataPoint.php | 4 +- AiPlatform/src/V1/TimestampSplit.php | 8 +- AiPlatform/src/V1/Tool.php | 4 +- AiPlatform/src/V1/ToolConfig.php | 77 + AiPlatform/src/V1/TrainingConfig.php | 2 +- AiPlatform/src/V1/TrainingPipeline.php | 32 +- AiPlatform/src/V1/Trial.php | 18 +- AiPlatform/src/V1/Trial/Parameter.php | 4 +- AiPlatform/src/V1/TrialContext.php | 2 +- AiPlatform/src/V1/TunedModel.php | 4 +- AiPlatform/src/V1/TuningJob.php | 46 +- .../src/V1/UndeployIndexOperationMetadata.php | 2 +- AiPlatform/src/V1/UndeployIndexRequest.php | 4 +- .../src/V1/UndeployModelOperationMetadata.php | 2 +- AiPlatform/src/V1/UndeployModelRequest.php | 4 +- AiPlatform/src/V1/UnmanagedContainerModel.php | 6 +- AiPlatform/src/V1/UpdateArtifactRequest.php | 6 +- AiPlatform/src/V1/UpdateContextRequest.php | 6 +- AiPlatform/src/V1/UpdateDatasetRequest.php | 4 +- .../src/V1/UpdateDatasetVersionRequest.php | 153 + ...eploymentResourcePoolOperationMetadata.php | 2 +- AiPlatform/src/V1/UpdateEndpointRequest.php | 4 +- AiPlatform/src/V1/UpdateEntityTypeRequest.php | 4 +- AiPlatform/src/V1/UpdateExecutionRequest.php | 6 +- ...ateExplanationDatasetOperationMetadata.php | 2 +- .../V1/UpdateExplanationDatasetRequest.php | 4 +- .../UpdateFeatureGroupOperationMetadata.php | 2 +- .../src/V1/UpdateFeatureGroupRequest.php | 4 +- ...ateFeatureOnlineStoreOperationMetadata.php | 2 +- .../V1/UpdateFeatureOnlineStoreRequest.php | 4 +- .../src/V1/UpdateFeatureOperationMetadata.php | 2 +- AiPlatform/src/V1/UpdateFeatureRequest.php | 4 +- .../V1/UpdateFeatureViewOperationMetadata.php | 2 +- .../src/V1/UpdateFeatureViewRequest.php | 4 +- .../UpdateFeaturestoreOperationMetadata.php | 2 +- .../src/V1/UpdateFeaturestoreRequest.php | 4 +- .../src/V1/UpdateIndexEndpointRequest.php | 4 +- .../src/V1/UpdateIndexOperationMetadata.php | 4 +- AiPlatform/src/V1/UpdateIndexRequest.php | 4 +- ...ploymentMonitoringJobOperationMetadata.php | 2 +- ...ateModelDeploymentMonitoringJobRequest.php | 4 +- AiPlatform/src/V1/UpdateModelRequest.php | 4 +- .../UpdateNotebookRuntimeTemplateRequest.php | 158 + ...atePersistentResourceOperationMetadata.php | 4 +- .../V1/UpdatePersistentResourceRequest.php | 4 +- AiPlatform/src/V1/UpdateScheduleRequest.php | 4 +- .../UpdateSpecialistPoolOperationMetadata.php | 4 +- .../src/V1/UpdateSpecialistPoolRequest.php | 4 +- .../V1/UpdateTensorboardExperimentRequest.php | 4 +- .../V1/UpdateTensorboardOperationMetadata.php | 2 +- .../src/V1/UpdateTensorboardRequest.php | 4 +- .../src/V1/UpdateTensorboardRunRequest.php | 4 +- .../V1/UpdateTensorboardTimeSeriesRequest.php | 4 +- ...pgradeNotebookRuntimeOperationMetadata.php | 4 +- .../src/V1/UpgradeNotebookRuntimeRequest.php | 2 +- .../src/V1/UploadModelOperationMetadata.php | 2 +- AiPlatform/src/V1/UploadModelRequest.php | 10 +- AiPlatform/src/V1/UploadModelResponse.php | 4 +- AiPlatform/src/V1/UpsertDatapointsRequest.php | 4 +- AiPlatform/src/V1/UserActionReference.php | 2 +- AiPlatform/src/V1/VertexAISearch.php | 2 +- AiPlatform/src/V1/VideoMetadata.php | 4 +- AiPlatform/src/V1/VizierServiceClient.php | 34 - AiPlatform/src/V1/VizierServiceGrpcClient.php | 277 - AiPlatform/src/V1/WorkerPoolSpec.php | 6 +- .../src/V1/WriteFeatureValuesPayload.php | 2 +- .../src/V1/WriteFeatureValuesRequest.php | 2 +- .../WriteTensorboardExperimentDataRequest.php | 2 +- .../src/V1/WriteTensorboardRunDataRequest.php | 2 +- AiPlatform/src/V1/XraiAttribution.php | 6 +- AiPlatform/src/V1/gapic_metadata.json | 88 +- .../dataset_service_client_config.json | 5 + .../dataset_service_descriptor_config.php | 13 + .../dataset_service_rest_client_config.php | 56 + ...source_pool_service_rest_client_config.php | 40 + .../endpoint_service_rest_client_config.php | 40 + ...store_admin_service_rest_client_config.php | 40 + ...nline_store_service_rest_client_config.php | 40 + ...re_registry_service_rest_client_config.php | 40 + ...ine_serving_service_rest_client_config.php | 40 + ...eaturestore_service_rest_client_config.php | 40 + ...n_ai_tuning_service_rest_client_config.php | 40 + ...ex_endpoint_service_rest_client_config.php | 40 + .../index_service_rest_client_config.php | 40 + .../job_service_rest_client_config.php | 40 + ...llm_utility_service_rest_client_config.php | 40 + .../match_service_rest_client_config.php | 40 + .../metadata_service_rest_client_config.php | 40 + .../migration_service_rest_client_config.php | 40 + ...odel_garden_service_rest_client_config.php | 40 + .../model_service_rest_client_config.php | 40 + .../notebook_service_client_config.json | 5 + .../notebook_service_descriptor_config.php | 13 + .../notebook_service_rest_client_config.php | 56 + ...nt_resource_service_rest_client_config.php | 40 + .../pipeline_service_rest_client_config.php | 40 + .../prediction_service_descriptor_config.php | 16 + .../prediction_service_rest_client_config.php | 54 + .../schedule_service_rest_client_config.php | 40 + ...ialist_pool_service_rest_client_config.php | 40 + ...tensorboard_service_rest_client_config.php | 40 + .../vizier_service_rest_client_config.php | 40 + .../V1/Client/DatasetServiceClientTest.php | 621 +- ...eploymentResourcePoolServiceClientTest.php | 282 +- .../V1/Client/EndpointServiceClientTest.php | 287 +- ...atureOnlineStoreAdminServiceClientTest.php | 517 +- .../FeatureOnlineStoreServiceClientTest.php | 194 +- .../FeatureRegistryServiceClientTest.php | 347 +- ...urestoreOnlineServingServiceClientTest.php | 229 +- .../Client/FeaturestoreServiceClientTest.php | 618 +- .../Client/GenAiTuningServiceClientTest.php | 198 +- .../Client/IndexEndpointServiceClientTest.php | 271 +- .../Unit/V1/Client/IndexServiceClientTest.php | 266 +- .../Unit/V1/Client/JobServiceClientTest.php | 1014 +- .../V1/Client/LlmUtilityServiceClientTest.php | 149 +- .../Unit/V1/Client/MatchServiceClientTest.php | 152 +- .../V1/Client/MetadataServiceClientTest.php | 849 +- .../V1/Client/MigrationServiceClientTest.php | 149 +- .../Client/ModelGardenServiceClientTest.php | 131 +- .../Unit/V1/Client/ModelServiceClientTest.php | 535 +- .../V1/Client/NotebookServiceClientTest.php | 466 +- .../PersistentResourceServiceClientTest.php | 260 +- .../V1/Client/PipelineServiceClientTest.php | 393 +- .../V1/Client/PredictionServiceClientTest.php | 387 +- .../V1/Client/ScheduleServiceClientTest.php | 268 +- .../SpecialistPoolServiceClientTest.php | 226 +- .../Client/TensorboardServiceClientTest.php | 1099 +- .../V1/Client/VizierServiceClientTest.php | 438 +- .../Unit/V1/DatasetServiceClientTest.php | 2093 --- ...eploymentResourcePoolServiceClientTest.php | 841 -- .../Unit/V1/EndpointServiceClientTest.php | 1237 -- ...atureOnlineStoreAdminServiceClientTest.php | 1568 --- .../FeatureOnlineStoreServiceClientTest.php | 497 - .../V1/FeatureRegistryServiceClientTest.php | 1407 -- ...urestoreOnlineServingServiceClientTest.php | 601 - .../Unit/V1/FeaturestoreServiceClientTest.php | 2498 ---- .../Unit/V1/GenAiTuningServiceClientTest.php | 642 - .../V1/IndexEndpointServiceClientTest.php | 1247 -- .../tests/Unit/V1/IndexServiceClientTest.php | 1018 -- .../tests/Unit/V1/JobServiceClientTest.php | 3237 ----- .../Unit/V1/LlmUtilityServiceClientTest.php | 512 - .../tests/Unit/V1/MatchServiceClientTest.php | 492 - .../Unit/V1/MetadataServiceClientTest.php | 2955 ----- .../Unit/V1/MigrationServiceClientTest.php | 570 - .../Unit/V1/ModelGardenServiceClientTest.php | 439 - .../tests/Unit/V1/ModelServiceClientTest.php | 1972 --- .../Unit/V1/NotebookServiceClientTest.php | 1419 --- .../PersistentResourceServiceClientTest.php | 1020 -- .../Unit/V1/PipelineServiceClientTest.php | 1416 --- .../Unit/V1/PredictionServiceClientTest.php | 1380 -- .../Unit/V1/ScheduleServiceClientTest.php | 927 -- .../V1/SpecialistPoolServiceClientTest.php | 901 -- .../Unit/V1/TensorboardServiceClientTest.php | 2783 ---- .../tests/Unit/V1/VizierServiceClientTest.php | 1504 --- AlloyDb/.repo-metadata.json | 8 - AlloyDb/VERSION | 2 +- AlloyDb/composer.json | 2 +- AnalyticsAdmin/.repo-metadata.json | 8 - AnalyticsAdmin/VERSION | 2 +- AnalyticsAdmin/composer.json | 2 +- AnalyticsData/.repo-metadata.json | 8 - AnalyticsData/VERSION | 2 +- AnalyticsData/composer.json | 2 +- .../metadata/V1Alpha/AnalyticsDataApi.php | Bin 8530 -> 11945 bytes AnalyticsData/metadata/V1Alpha/Data.php | Bin 13305 -> 15349 bytes .../create_report_task.php | 89 + .../get_report_task.php | 74 + .../list_report_tasks.php | 77 + .../query_report_task.php | 75 + .../Client/AlphaAnalyticsDataClient.php | 151 + AnalyticsData/src/V1alpha/Cohort.php | 16 +- AnalyticsData/src/V1alpha/CohortSpec.php | 24 +- AnalyticsData/src/V1alpha/CohortsRange.php | 32 +- .../src/V1alpha/CreateReportTaskRequest.php | 132 + .../Gapic/AlphaAnalyticsDataGapicClient.php | 348 + .../src/V1alpha/GetReportTaskRequest.php | 86 + .../src/V1alpha/ListReportTasksRequest.php | 158 + .../src/V1alpha/ListReportTasksResponse.php | 115 + AnalyticsData/src/V1alpha/Metric.php | 76 +- AnalyticsData/src/V1alpha/OrderBy.php | 37 +- .../src/V1alpha/QueryReportTaskRequest.php | 225 + .../src/V1alpha/QueryReportTaskResponse.php | 323 + AnalyticsData/src/V1alpha/ReportTask.php | 183 + .../V1alpha/ReportTask/ReportDefinition.php | 612 + .../src/V1alpha/ReportTask/ReportMetadata.php | 372 + .../ReportTask/ReportMetadata/State.php | 70 + .../src/V1alpha/ReportTaskMetadata.php | 34 + .../src/V1alpha/ResponseMetaData.php | 336 + .../SchemaRestrictionResponse.php | 82 + .../ActiveMetricRestriction.php | 112 + .../src/V1alpha/RestrictedMetricType.php | 62 + AnalyticsData/src/V1alpha/gapic_metadata.json | 20 + .../alpha_analytics_data_client_config.json | 20 + ...alpha_analytics_data_descriptor_config.php | 64 + ...lpha_analytics_data_rest_client_config.php | 46 + .../V1alpha/AlphaAnalyticsDataClientTest.php | 314 + .../Client/AlphaAnalyticsDataClientTest.php | 336 + ApiGateway/.repo-metadata.json | 8 - ApiGateway/VERSION | 2 +- ApiGateway/composer.json | 2 +- ApiKeys/.repo-metadata.json | 10 - ApiKeys/VERSION | 2 +- ApiKeys/composer.json | 2 +- ApigeeConnect/.repo-metadata.json | 8 - ApigeeConnect/VERSION | 2 +- ApigeeConnect/composer.json | 2 +- ApigeeRegistry/.repo-metadata.json | 8 - ApigeeRegistry/VERSION | 2 +- ApigeeRegistry/composer.json | 2 +- AppEngineAdmin/.repo-metadata.json | 8 - AppEngineAdmin/VERSION | 2 +- AppEngineAdmin/composer.json | 2 +- AppHub/.repo-metadata.json | 8 - AppHub/VERSION | 2 +- AppHub/composer.json | 2 +- AppHub/src/V1/Client/AppHubClient.php | 21 +- .../tests/Unit/V1/Client/AppHubClientTest.php | 2 +- AppsChat/.repo-metadata.json | 8 - AppsChat/VERSION | 2 +- AppsChat/composer.json | 2 +- AppsChat/metadata/Chat/V1/ActionStatus.php | 6 +- AppsChat/metadata/Chat/V1/Annotation.php | Bin 2038 -> 2139 bytes AppsChat/metadata/Chat/V1/Attachment.php | Bin 1779 -> 1793 bytes AppsChat/metadata/Chat/V1/ChatService.php | Bin 6433 -> 6447 bytes AppsChat/metadata/Chat/V1/ContextualAddon.php | Bin 1479 -> 1493 bytes .../metadata/Chat/V1/DeletionMetadata.php | Bin 1023 -> 1037 bytes AppsChat/metadata/Chat/V1/Group.php | 6 +- AppsChat/metadata/Chat/V1/HistoryState.php | Bin 837 -> 851 bytes AppsChat/metadata/Chat/V1/MatchedUrl.php | 6 +- AppsChat/metadata/Chat/V1/Membership.php | Bin 2640 -> 2654 bytes AppsChat/metadata/Chat/V1/Message.php | Bin 5774 -> 5788 bytes AppsChat/metadata/Chat/V1/Reaction.php | Bin 1842 -> 1861 bytes AppsChat/metadata/Chat/V1/SlashCommand.php | 6 +- AppsChat/metadata/Chat/V1/Space.php | Bin 2793 -> 2807 bytes AppsChat/metadata/Chat/V1/SpaceReadState.php | 6 +- AppsChat/metadata/Chat/V1/SpaceSetup.php | 6 +- AppsChat/metadata/Chat/V1/ThreadReadState.php | 6 +- AppsChat/metadata/Chat/V1/User.php | Bin 1051 -> 1065 bytes AppsChat/metadata/Chat/V1/Widgets.php | Bin 2649 -> 2663 bytes .../ChatServiceClient/create_membership.php | 4 +- .../V1/ChatServiceClient/create_message.php | 3 +- .../V1/ChatServiceClient/get_membership.php | 5 +- .../get_space_read_state.php | 4 +- .../get_thread_read_state.php | 4 +- .../V1/ChatServiceClient/list_spaces.php | 1 + .../V1/ChatServiceClient/set_up_space.php | 20 +- .../ChatServiceClient/update_membership.php | 7 +- .../update_space_read_state.php | 3 +- .../src/Chat/V1/Client/ChatServiceClient.php | 48 +- AppsChat/src/Chat/V1/CustomEmoji.php | 14 +- AppsChat/src/Chat/V1/GetMembershipRequest.php | 25 +- AppsChat/src/Chat/V1/Membership.php | 12 +- AppsChat/src/Chat/V1/SetUpSpaceRequest.php | 64 +- AppsChat/src/Chat/V1/Space.php | 44 +- AppsEventsSubscriptions/.repo-metadata.json | 8 - AppsEventsSubscriptions/VERSION | 2 +- AppsEventsSubscriptions/composer.json | 2 +- .../V1/Client/SubscriptionsServiceClient.php | 21 +- .../Client/SubscriptionsServiceClientTest.php | 2 +- AppsMeet/.repo-metadata.json | 8 - AppsMeet/VERSION | 2 +- AppsMeet/composer.json | 2 +- ArtifactRegistry/.OwlBot.yaml | 2 +- ArtifactRegistry/.repo-metadata.json | 8 - ArtifactRegistry/README.md | 5 +- ArtifactRegistry/VERSION | 2 +- ArtifactRegistry/composer.json | 2 +- .../metadata/V1Beta2/AptArtifact.php | Bin 2259 -> 0 bytes ArtifactRegistry/metadata/V1Beta2/File.php | Bin 1825 -> 0 bytes ArtifactRegistry/metadata/V1Beta2/Package.php | 45 - .../metadata/V1Beta2/Repository.php | Bin 3046 -> 0 bytes ArtifactRegistry/metadata/V1Beta2/Service.php | 78 - .../metadata/V1Beta2/Settings.php | Bin 1869 -> 0 bytes ArtifactRegistry/metadata/V1Beta2/Tag.php | 53 - ArtifactRegistry/metadata/V1Beta2/Version.php | Bin 2339 -> 0 bytes .../metadata/V1Beta2/YumArtifact.php | Bin 2208 -> 0 bytes ArtifactRegistry/owlbot.py | 55 +- ArtifactRegistry/src/V1/AptArtifact.php | 12 +- .../src/V1/AptArtifact/PackageType.php | 2 - .../src/V1/ArtifactRegistryGrpcClient.php | 583 - .../src/V1/BatchDeleteVersionsRequest.php | 4 +- ArtifactRegistry/src/V1/CleanupPolicy.php | 4 +- .../src/V1/CleanupPolicy/Action.php | 2 - .../src/V1/CleanupPolicyCondition.php | 6 +- .../V1/CleanupPolicyCondition/TagState.php | 2 - .../V1/CleanupPolicyMostRecentVersions.php | 2 +- .../src/V1/Client/ArtifactRegistryClient.php | 89 +- .../src/V1/CreateRepositoryRequest.php | 6 +- ArtifactRegistry/src/V1/CreateTagRequest.php | 6 +- .../src/V1/DeletePackageRequest.php | 2 +- .../src/V1/DeleteRepositoryRequest.php | 2 +- ArtifactRegistry/src/V1/DeleteTagRequest.php | 2 +- .../src/V1/DeleteVersionRequest.php | 4 +- ArtifactRegistry/src/V1/DockerImage.php | 14 +- ArtifactRegistry/src/V1/File.php | 12 +- .../src/V1/GetDockerImageRequest.php | 2 +- ArtifactRegistry/src/V1/GetFileRequest.php | 2 +- .../src/V1/GetMavenArtifactRequest.php | 2 +- .../src/V1/GetNpmPackageRequest.php | 2 +- ArtifactRegistry/src/V1/GetPackageRequest.php | 2 +- .../src/V1/GetProjectSettingsRequest.php | 2 +- .../src/V1/GetPythonPackageRequest.php | 2 +- .../src/V1/GetRepositoryRequest.php | 2 +- ArtifactRegistry/src/V1/GetTagRequest.php | 2 +- .../src/V1/GetVPCSCConfigRequest.php | 2 +- ArtifactRegistry/src/V1/GetVersionRequest.php | 4 +- ArtifactRegistry/src/V1/Hash.php | 4 +- ArtifactRegistry/src/V1/Hash/HashType.php | 2 - .../src/V1/ImportAptArtifactsErrorInfo.php | 2 +- .../src/V1/ImportAptArtifactsGcsSource.php | 2 +- .../src/V1/ImportAptArtifactsRequest.php | 2 +- .../src/V1/ImportYumArtifactsErrorInfo.php | 2 +- .../src/V1/ImportYumArtifactsGcsSource.php | 2 +- .../src/V1/ImportYumArtifactsRequest.php | 2 +- .../src/V1/ListDockerImagesRequest.php | 8 +- .../src/V1/ListDockerImagesResponse.php | 2 +- ArtifactRegistry/src/V1/ListFilesRequest.php | 10 +- ArtifactRegistry/src/V1/ListFilesResponse.php | 2 +- .../src/V1/ListMavenArtifactsRequest.php | 6 +- .../src/V1/ListMavenArtifactsResponse.php | 2 +- .../src/V1/ListNpmPackagesRequest.php | 6 +- .../src/V1/ListNpmPackagesResponse.php | 2 +- .../src/V1/ListPackagesRequest.php | 6 +- .../src/V1/ListPackagesResponse.php | 2 +- .../src/V1/ListPythonPackagesRequest.php | 6 +- .../src/V1/ListPythonPackagesResponse.php | 2 +- .../src/V1/ListRepositoriesRequest.php | 6 +- .../src/V1/ListRepositoriesResponse.php | 2 +- ArtifactRegistry/src/V1/ListTagsRequest.php | 8 +- ArtifactRegistry/src/V1/ListTagsResponse.php | 2 +- .../src/V1/ListVersionsRequest.php | 10 +- .../src/V1/ListVersionsResponse.php | 2 +- ArtifactRegistry/src/V1/MavenArtifact.php | 14 +- ArtifactRegistry/src/V1/NpmPackage.php | 10 +- ArtifactRegistry/src/V1/Package.php | 8 +- ArtifactRegistry/src/V1/ProjectSettings.php | 4 +- .../V1/ProjectSettings/RedirectionState.php | 2 - ArtifactRegistry/src/V1/PythonPackage.php | 12 +- .../src/V1/RemoteRepositoryConfig.php | 4 +- .../RemoteRepositoryConfig/AptRepository.php | 2 - .../AptRepository/PublicRepository.php | 6 +- .../PublicRepository/RepositoryBase.php | 2 - .../DockerRepository.php | 2 - .../DockerRepository/PublicRepository.php | 2 - .../MavenRepository.php | 2 - .../MavenRepository/PublicRepository.php | 2 - .../RemoteRepositoryConfig/NpmRepository.php | 2 - .../NpmRepository/PublicRepository.php | 2 - .../PythonRepository.php | 2 - .../PythonRepository/PublicRepository.php | 2 - .../UpstreamCredentials.php | 2 - .../UsernamePasswordCredentials.php | 6 +- .../RemoteRepositoryConfig/YumRepository.php | 2 - .../YumRepository/PublicRepository.php | 6 +- .../PublicRepository/RepositoryBase.php | 2 - ArtifactRegistry/src/V1/Repository.php | 20 +- .../V1/Repository/DockerRepositoryConfig.php | 4 +- ArtifactRegistry/src/V1/Repository/Format.php | 2 - .../V1/Repository/MavenRepositoryConfig.php | 6 +- .../MavenRepositoryConfig/VersionPolicy.php | 2 - ArtifactRegistry/src/V1/Repository/Mode.php | 2 - ArtifactRegistry/src/V1/Tag.php | 4 +- .../src/V1/UpdateProjectSettingsRequest.php | 4 +- .../src/V1/UpdateRepositoryRequest.php | 4 +- ArtifactRegistry/src/V1/UpdateTagRequest.php | 4 +- .../src/V1/UpdateVPCSCConfigRequest.php | 4 +- ArtifactRegistry/src/V1/UpstreamPolicy.php | 6 +- ArtifactRegistry/src/V1/VPCSCConfig.php | 4 +- .../src/V1/VPCSCConfig/VPCSCPolicy.php | 2 - ArtifactRegistry/src/V1/Version.php | 10 +- ArtifactRegistry/src/V1/YumArtifact.php | 8 +- .../src/V1/YumArtifact/PackageType.php | 2 - ArtifactRegistry/src/V1beta2/AptArtifact.php | 239 - .../src/V1beta2/AptArtifact/PackageType.php | 64 - .../src/V1beta2/AptArtifact_PackageType.php | 16 - .../src/V1beta2/ArtifactRegistryClient.php | 36 - .../V1beta2/ArtifactRegistryGrpcClient.php | 433 - .../src/V1beta2/CreateRepositoryRequest.php | 145 - .../src/V1beta2/CreateTagRequest.php | 145 - .../src/V1beta2/DeletePackageRequest.php | 67 - .../src/V1beta2/DeleteRepositoryRequest.php | 67 - .../src/V1beta2/DeleteTagRequest.php | 67 - .../src/V1beta2/DeleteVersionRequest.php | 105 - ArtifactRegistry/src/V1beta2/File.php | 265 - .../Gapic/ArtifactRegistryGapicClient.php | 2128 ---- .../src/V1beta2/GetFileRequest.php | 67 - .../src/V1beta2/GetPackageRequest.php | 67 - .../src/V1beta2/GetProjectSettingsRequest.php | 67 - .../src/V1beta2/GetRepositoryRequest.php | 67 - .../src/V1beta2/GetTagRequest.php | 67 - .../src/V1beta2/GetVersionRequest.php | 101 - ArtifactRegistry/src/V1beta2/Hash.php | 101 - .../src/V1beta2/Hash/HashType.php | 64 - .../src/V1beta2/Hash_HashType.php | 16 - .../V1beta2/ImportAptArtifactsErrorInfo.php | 119 - .../V1beta2/ImportAptArtifactsGcsSource.php | 101 - .../V1beta2/ImportAptArtifactsMetadata.php | 33 - .../src/V1beta2/ImportAptArtifactsRequest.php | 109 - .../V1beta2/ImportAptArtifactsResponse.php | 101 - .../V1beta2/ImportYumArtifactsErrorInfo.php | 119 - .../V1beta2/ImportYumArtifactsGcsSource.php | 101 - .../V1beta2/ImportYumArtifactsMetadata.php | 33 - .../src/V1beta2/ImportYumArtifactsRequest.php | 109 - .../V1beta2/ImportYumArtifactsResponse.php | 101 - .../src/V1beta2/ListFilesRequest.php | 205 - .../src/V1beta2/ListFilesResponse.php | 105 - .../src/V1beta2/ListPackagesRequest.php | 139 - .../src/V1beta2/ListPackagesResponse.php | 105 - .../src/V1beta2/ListRepositoriesRequest.php | 135 - .../src/V1beta2/ListRepositoriesResponse.php | 105 - .../src/V1beta2/ListTagsRequest.php | 189 - .../src/V1beta2/ListTagsResponse.php | 105 - .../src/V1beta2/ListVersionsRequest.php | 203 - .../src/V1beta2/ListVersionsResponse.php | 105 - .../src/V1beta2/OperationMetadata.php | 33 - ArtifactRegistry/src/V1beta2/Package.php | 197 - .../src/V1beta2/ProjectSettings.php | 117 - .../ProjectSettings/RedirectionState.php | 71 - .../ProjectSettings_RedirectionState.php | 16 - ArtifactRegistry/src/V1beta2/Repository.php | 368 - .../src/V1beta2/Repository/Format.php | 92 - .../Repository/MavenRepositoryConfig.php | 110 - .../MavenRepositoryConfig/VersionPolicy.php | 66 - .../src/V1beta2/Repository_Format.php | 16 - .../Repository_MavenRepositoryConfig.php | 16 - ...ry_MavenRepositoryConfig_VersionPolicy.php | 16 - ArtifactRegistry/src/V1beta2/Tag.php | 130 - .../V1beta2/UpdateProjectSettingsRequest.php | 121 - .../src/V1beta2/UpdateRepositoryRequest.php | 129 - .../src/V1beta2/UpdateTagRequest.php | 129 - ArtifactRegistry/src/V1beta2/Version.php | 297 - ArtifactRegistry/src/V1beta2/VersionView.php | 63 - ArtifactRegistry/src/V1beta2/YumArtifact.php | 169 - .../src/V1beta2/YumArtifact/PackageType.php | 64 - .../src/V1beta2/YumArtifact_PackageType.php | 16 - .../src/V1beta2/gapic_metadata.json | 153 - .../artifact_registry_client_config.json | 179 - .../artifact_registry_descriptor_config.php | 152 - .../artifact_registry_rest_client_config.php | 353 - .../V1/Client/ArtifactRegistryClientTest.php | 788 +- .../V1beta2/ArtifactRegistryClientTest.php | 2017 --- Asset/.repo-metadata.json | 8 - Asset/VERSION | 2 +- Asset/composer.json | 2 +- AssuredWorkloads/.OwlBot.yaml | 2 +- AssuredWorkloads/.repo-metadata.json | 8 - AssuredWorkloads/README.md | 5 +- AssuredWorkloads/VERSION | 2 +- AssuredWorkloads/composer.json | 2 +- .../metadata/V1Beta1/Assuredworkloads.php | Bin 6659 -> 0 bytes .../V1Beta1/AssuredworkloadsService.php | 41 - .../V1Beta1/AssuredworkloadsV1Beta1.php | Bin 6586 -> 0 bytes AssuredWorkloads/owlbot.py | 55 +- .../src/V1/AcknowledgeViolationRequest.php | 4 +- .../V1/AssuredWorkloadsServiceGrpcClient.php | 187 - .../Client/AssuredWorkloadsServiceClient.php | 54 +- .../V1/CreateWorkloadOperationMetadata.php | 8 +- .../src/V1/CreateWorkloadRequest.php | 6 +- .../src/V1/DeleteWorkloadRequest.php | 4 +- .../src/V1/GetViolationRequest.php | 2 +- .../src/V1/GetWorkloadRequest.php | 2 +- .../src/V1/ListViolationsRequest.php | 10 +- .../src/V1/ListViolationsResponse.php | 2 +- .../src/V1/ListWorkloadsRequest.php | 8 +- .../src/V1/ListWorkloadsResponse.php | 2 +- .../V1/RestrictAllowedResourcesRequest.php | 4 +- .../RestrictionType.php | 2 - AssuredWorkloads/src/V1/TimeWindow.php | 4 +- .../src/V1/UpdateWorkloadRequest.php | 4 +- AssuredWorkloads/src/V1/Violation.php | 28 +- .../src/V1/Violation/Remediation.php | 6 +- .../V1/Violation/Remediation/Instructions.php | 6 +- .../Remediation/Instructions/Console.php | 2 - .../Remediation/Instructions/Gcloud.php | 2 - .../Violation/Remediation/RemediationType.php | 2 - AssuredWorkloads/src/V1/Violation/State.php | 2 - AssuredWorkloads/src/V1/Workload.php | 22 +- .../src/V1/Workload/ComplianceRegime.php | 2 - .../src/V1/Workload/KMSSettings.php | 6 +- .../src/V1/Workload/KajEnrollmentState.php | 2 - AssuredWorkloads/src/V1/Workload/Partner.php | 2 - .../src/V1/Workload/ResourceInfo.php | 6 +- .../V1/Workload/ResourceInfo/ResourceType.php | 2 - .../src/V1/Workload/ResourceSettings.php | 8 +- .../src/V1/Workload/SaaEnrollmentResponse.php | 4 +- .../SaaEnrollmentResponse/SetupError.php | 2 - .../SaaEnrollmentResponse/SetupState.php | 2 - .../V1beta1/AnalyzeWorkloadMoveRequest.php | 190 - .../V1beta1/AnalyzeWorkloadMoveResponse.php | 71 - .../V1beta1/AssuredWorkloadsServiceClient.php | 36 - .../AssuredWorkloadsServiceGrpcClient.php | 154 - .../CreateWorkloadOperationMetadata.php | 221 - .../src/V1beta1/CreateWorkloadRequest.php | 161 - .../src/V1beta1/DeleteWorkloadRequest.php | 113 - .../AssuredWorkloadsServiceGapicClient.php | 756 -- .../src/V1beta1/GetWorkloadRequest.php | 83 - .../src/V1beta1/ListWorkloadsRequest.php | 185 - .../src/V1beta1/ListWorkloadsResponse.php | 101 - AssuredWorkloads/src/V1beta1/README.md | 19 - .../RestrictAllowedResourcesRequest.php | 117 - .../RestrictionType.php | 68 - ...llowedResourcesRequest_RestrictionType.php | 16 - .../RestrictAllowedResourcesResponse.php | 33 - .../src/V1beta1/UpdateWorkloadRequest.php | 133 - AssuredWorkloads/src/V1beta1/Workload.php | 882 -- .../src/V1beta1/Workload/CJISSettings.php | 81 - .../src/V1beta1/Workload/ComplianceRegime.php | 127 - .../V1beta1/Workload/FedrampHighSettings.php | 81 - .../Workload/FedrampModerateSettings.php | 81 - .../src/V1beta1/Workload/IL4Settings.php | 81 - .../src/V1beta1/Workload/KMSSettings.php | 137 - .../V1beta1/Workload/KajEnrollmentState.php | 64 - .../src/V1beta1/Workload/ResourceInfo.php | 108 - .../Workload/ResourceInfo/ResourceType.php | 79 - .../src/V1beta1/Workload/ResourceSettings.php | 170 - .../Workload/SaaEnrollmentResponse.php | 114 - .../SaaEnrollmentResponse/SetupError.php | 81 - .../SaaEnrollmentResponse/SetupState.php | 64 - .../src/V1beta1/Workload_CJISSettings.php | 16 - .../src/V1beta1/Workload_ComplianceRegime.php | 16 - .../V1beta1/Workload_FedrampHighSettings.php | 16 - .../Workload_FedrampModerateSettings.php | 16 - .../src/V1beta1/Workload_IL4Settings.php | 16 - .../src/V1beta1/Workload_KMSSettings.php | 16 - .../V1beta1/Workload_KajEnrollmentState.php | 16 - .../src/V1beta1/Workload_ResourceInfo.php | 16 - .../Workload_ResourceInfo_ResourceType.php | 16 - .../src/V1beta1/Workload_ResourceSettings.php | 16 - .../Workload_SaaEnrollmentResponse.php | 16 - ...kload_SaaEnrollmentResponse_SetupError.php | 16 - ...kload_SaaEnrollmentResponse_SetupState.php | 16 - .../src/V1beta1/gapic_metadata.json | 53 - ...sured_workloads_service_client_config.json | 79 - ...ed_workloads_service_descriptor_config.php | 48 - ...d_workloads_service_rest_client_config.php | 88 - .../AssuredWorkloadsServiceClientTest.php | 237 +- .../AssuredWorkloadsServiceClientTest.php | 610 - AutoMl/.repo-metadata.json | 8 - AutoMl/VERSION | 2 +- AutoMl/composer.json | 2 +- BackupDr/.OwlBot.yaml | 4 + BackupDr/.gitattributes | 7 + BackupDr/.github/pull_request_template.md | 24 + BackupDr/CONTRIBUTING.md | 10 + BackupDr/LICENSE | 202 + BackupDr/README.md | 45 + BackupDr/VERSION | 1 + BackupDr/composer.json | 30 + BackupDr/metadata/V1/Backupdr.php | Bin 0 -> 5436 bytes BackupDr/owlbot.py | 62 + BackupDr/phpunit.xml.dist | 16 + .../create_management_server.php | 96 + .../delete_management_server.php | 84 + .../V1/BackupDRClient/get_iam_policy.php | 72 + .../V1/BackupDRClient/get_location.php | 57 + .../BackupDRClient/get_management_server.php | 76 + .../V1/BackupDRClient/list_locations.php | 62 + .../list_management_servers.php | 80 + .../V1/BackupDRClient/set_iam_policy.php | 77 + .../BackupDRClient/test_iam_permissions.php | 84 + BackupDr/src/V1/Client/BackupDRClient.php | 558 + .../src/V1/CreateManagementServerRequest.php | 257 + .../src/V1/DeleteManagementServerRequest.php | 155 + .../src/V1/GetManagementServerRequest.php | 86 + .../src/V1/ListManagementServersRequest.php | 261 + .../src/V1/ListManagementServersResponse.php | 159 + BackupDr/src/V1/ManagementServer.php | 611 + .../src/V1/ManagementServer/InstanceState.php | 100 + .../src/V1/ManagementServer/InstanceType.php | 55 + BackupDr/src/V1/ManagementURI.php | 101 + BackupDr/src/V1/NetworkConfig.php | 109 + BackupDr/src/V1/NetworkConfig/PeeringMode.php | 57 + BackupDr/src/V1/OperationMetadata.php | 345 + .../WorkforceIdentityBasedManagementURI.php | 101 + .../WorkforceIdentityBasedOAuth2ClientID.php | 101 + BackupDr/src/V1/gapic_metadata.json | 63 + .../V1/resources/backup_dr_client_config.json | 89 + .../resources/backup_dr_descriptor_config.php | 175 + .../backup_dr_rest_client_config.php | 192 + .../Unit/V1/Client/BackupDRClientTest.php | 909 ++ BareMetalSolution/.repo-metadata.json | 8 - BareMetalSolution/VERSION | 2 +- BareMetalSolution/composer.json | 2 +- Batch/.repo-metadata.json | 10 - Batch/VERSION | 2 +- Batch/composer.json | 2 +- .../InstancePolicyOrTemplate.php | 24 +- Batch/src/V1/TaskExecution.php | 44 +- Batch/src/V1/TaskSpec.php | 52 +- BeyondCorpAppConnections/.repo-metadata.json | 10 - BeyondCorpAppConnections/VERSION | 2 +- BeyondCorpAppConnections/composer.json | 2 +- BeyondCorpAppConnectors/.repo-metadata.json | 8 - BeyondCorpAppConnectors/VERSION | 2 +- BeyondCorpAppConnectors/composer.json | 2 +- BeyondCorpAppGateways/.repo-metadata.json | 8 - BeyondCorpAppGateways/VERSION | 2 +- BeyondCorpAppGateways/composer.json | 2 +- .../.repo-metadata.json | 8 - BeyondCorpClientConnectorServices/VERSION | 2 +- .../composer.json | 2 +- BeyondCorpClientGateways/.repo-metadata.json | 8 - BeyondCorpClientGateways/VERSION | 2 +- BeyondCorpClientGateways/composer.json | 2 +- BigQuery/.repo-metadata.json | 8 - BigQuery/VERSION | 2 +- BigQuery/src/BigQueryClient.php | 2 +- BigQuery/src/JobWaitTrait.php | 9 +- BigQuery/tests/Unit/JobWaitTraitTest.php | 22 + BigQueryAnalyticsHub/.repo-metadata.json | 10 - BigQueryAnalyticsHub/VERSION | 2 +- BigQueryAnalyticsHub/composer.json | 2 +- BigQueryConnection/.repo-metadata.json | 8 - BigQueryConnection/VERSION | 2 +- BigQueryConnection/composer.json | 2 +- BigQueryDataExchange/.repo-metadata.json | 8 - BigQueryDataExchange/VERSION | 2 +- BigQueryDataExchange/composer.json | 2 +- BigQueryDataPolicies/.repo-metadata.json | 10 - BigQueryDataPolicies/VERSION | 2 +- BigQueryDataPolicies/composer.json | 2 +- BigQueryDataTransfer/.repo-metadata.json | 8 - BigQueryDataTransfer/VERSION | 2 +- BigQueryDataTransfer/composer.json | 2 +- .../src/V1/CreateTransferConfigRequest.php | 16 +- .../Gapic/DataTransferServiceGapicClient.php | 8 +- .../src/V1/UpdateTransferConfigRequest.php | 16 +- BigQueryMigration/.repo-metadata.json | 10 - BigQueryMigration/VERSION | 2 +- BigQueryMigration/composer.json | 2 +- BigQueryReservation/.repo-metadata.json | 8 - BigQueryReservation/VERSION | 2 +- BigQueryReservation/composer.json | 2 +- BigQueryStorage/.repo-metadata.json | 8 - BigQueryStorage/VERSION | 2 +- BigQueryStorage/composer.json | 2 +- Bigtable/.repo-metadata.json | 8 - Bigtable/MIGRATING.md | 91 + Bigtable/README.md | 2 + Bigtable/VERSION | 2 +- Bigtable/composer.json | 7 +- Bigtable/metadata/Admin/V2/Types.php | Bin 1736 -> 1986 bytes Bigtable/owlbot.py | 80 +- Bigtable/phpunit-snippets.xml.dist | 2 +- Bigtable/phpunit.xml.dist | 2 +- Bigtable/src/Admin/V2/AppProfile.php | 6 +- .../AppProfile/DataBoostIsolationReadOnly.php | 2 +- .../V2/AppProfile/SingleClusterRouting.php | 4 +- .../Admin/V2/AppProfile/StandardIsolation.php | 2 +- .../AppProfile_MultiClusterRoutingUseAny.php | 16 - .../V2/AppProfile_SingleClusterRouting.php | 16 - Bigtable/src/Admin/V2/AuthorizedView.php | 6 +- Bigtable/src/Admin/V2/AutoscalingLimits.php | 4 +- Bigtable/src/Admin/V2/AutoscalingTargets.php | 4 +- Bigtable/src/Admin/V2/Backup.php | 18 +- Bigtable/src/Admin/V2/BackupInfo.php | 10 +- Bigtable/src/Admin/V2/Backup_State.php | 16 - .../Admin/V2/BigtableInstanceAdminClient.php | 45 - .../V2/BigtableInstanceAdminGrpcClient.php | 385 - .../src/Admin/V2/BigtableTableAdminClient.php | 45 - .../Admin/V2/BigtableTableAdminGrpcClient.php | 461 - Bigtable/src/Admin/V2/ChangeStreamConfig.php | 2 +- .../src/Admin/V2/CheckConsistencyRequest.php | 4 +- .../src/Admin/V2/CheckConsistencyResponse.php | 2 +- .../V2/Client/BigtableInstanceAdminClient.php | 45 +- .../V2/Client/BigtableTableAdminClient.php | 45 +- Bigtable/src/Admin/V2/Cluster.php | 12 +- .../V2/Cluster/ClusterAutoscalingConfig.php | 4 +- .../src/Admin/V2/Cluster/ClusterConfig.php | 2 +- .../src/Admin/V2/Cluster/EncryptionConfig.php | 2 +- .../V2/Cluster_ClusterAutoscalingConfig.php | 16 - .../src/Admin/V2/Cluster_ClusterConfig.php | 16 - .../src/Admin/V2/Cluster_EncryptionConfig.php | 16 - Bigtable/src/Admin/V2/Cluster_State.php | 16 - Bigtable/src/Admin/V2/ColumnFamily.php | 4 +- Bigtable/src/Admin/V2/CopyBackupMetadata.php | 6 +- Bigtable/src/Admin/V2/CopyBackupRequest.php | 8 +- .../src/Admin/V2/CreateAppProfileRequest.php | 8 +- .../Admin/V2/CreateAuthorizedViewMetadata.php | 6 +- .../Admin/V2/CreateAuthorizedViewRequest.php | 6 +- .../src/Admin/V2/CreateBackupMetadata.php | 8 +- Bigtable/src/Admin/V2/CreateBackupRequest.php | 6 +- .../src/Admin/V2/CreateClusterMetadata.php | 6 +- .../CreateClusterMetadata/TableProgress.php | 6 +- .../CreateClusterMetadata_TableProgress.php | 16 - ...ateClusterMetadata_TableProgress_State.php | 16 - .../src/Admin/V2/CreateClusterRequest.php | 6 +- .../src/Admin/V2/CreateInstanceMetadata.php | 6 +- .../src/Admin/V2/CreateInstanceRequest.php | 6 +- .../V2/CreateTableFromSnapshotMetadata.php | 6 +- .../V2/CreateTableFromSnapshotRequest.php | 6 +- Bigtable/src/Admin/V2/CreateTableRequest.php | 6 +- .../src/Admin/V2/CreateTableRequest/Split.php | 2 +- .../src/Admin/V2/CreateTableRequest_Split.php | 16 - .../src/Admin/V2/DeleteAppProfileRequest.php | 4 +- .../Admin/V2/DeleteAuthorizedViewRequest.php | 4 +- Bigtable/src/Admin/V2/DeleteBackupRequest.php | 2 +- .../src/Admin/V2/DeleteClusterRequest.php | 2 +- .../src/Admin/V2/DeleteInstanceRequest.php | 2 +- .../src/Admin/V2/DeleteSnapshotRequest.php | 2 +- Bigtable/src/Admin/V2/DeleteTableRequest.php | 2 +- Bigtable/src/Admin/V2/DropRowRangeRequest.php | 2 +- Bigtable/src/Admin/V2/EncryptionInfo.php | 6 +- .../V2/EncryptionInfo_EncryptionType.php | 16 - .../BigtableInstanceAdminGapicClient.php | 1768 --- .../Gapic/BigtableTableAdminGapicClient.php | 2512 ---- Bigtable/src/Admin/V2/GcRule_Intersection.php | 16 - Bigtable/src/Admin/V2/GcRule_Union.php | 16 - .../V2/GenerateConsistencyTokenRequest.php | 2 +- .../V2/GenerateConsistencyTokenResponse.php | 2 +- .../src/Admin/V2/GetAppProfileRequest.php | 2 +- .../src/Admin/V2/GetAuthorizedViewRequest.php | 4 +- Bigtable/src/Admin/V2/GetBackupRequest.php | 2 +- Bigtable/src/Admin/V2/GetClusterRequest.php | 2 +- Bigtable/src/Admin/V2/GetInstanceRequest.php | 2 +- Bigtable/src/Admin/V2/GetSnapshotRequest.php | 2 +- Bigtable/src/Admin/V2/GetTableRequest.php | 4 +- Bigtable/src/Admin/V2/HotTablet.php | 14 +- Bigtable/src/Admin/V2/Instance.php | 12 +- Bigtable/src/Admin/V2/Instance_State.php | 16 - Bigtable/src/Admin/V2/Instance_Type.php | 16 - .../src/Admin/V2/ListAppProfilesRequest.php | 6 +- .../src/Admin/V2/ListAppProfilesResponse.php | 2 +- .../Admin/V2/ListAuthorizedViewsRequest.php | 8 +- .../Admin/V2/ListAuthorizedViewsResponse.php | 2 +- Bigtable/src/Admin/V2/ListBackupsRequest.php | 10 +- Bigtable/src/Admin/V2/ListBackupsResponse.php | 2 +- Bigtable/src/Admin/V2/ListClustersRequest.php | 4 +- .../src/Admin/V2/ListClustersResponse.php | 2 +- .../src/Admin/V2/ListHotTabletsRequest.php | 10 +- .../src/Admin/V2/ListHotTabletsResponse.php | 2 +- .../src/Admin/V2/ListInstancesRequest.php | 4 +- .../src/Admin/V2/ListInstancesResponse.php | 2 +- .../src/Admin/V2/ListSnapshotsRequest.php | 6 +- .../src/Admin/V2/ListSnapshotsResponse.php | 2 +- Bigtable/src/Admin/V2/ListTablesRequest.php | 8 +- Bigtable/src/Admin/V2/ListTablesResponse.php | 2 +- .../Admin/V2/ModifyColumnFamiliesRequest.php | 4 +- .../Modification.php | 4 +- ...difyColumnFamiliesRequest_Modification.php | 16 - Bigtable/src/Admin/V2/OperationProgress.php | 6 +- .../V2/OptimizeRestoredTableMetadata.php | 4 +- .../Admin/V2/PartialUpdateClusterMetadata.php | 6 +- .../Admin/V2/PartialUpdateClusterRequest.php | 4 +- .../Admin/V2/PartialUpdateInstanceRequest.php | 4 +- Bigtable/src/Admin/V2/RestoreInfo.php | 2 +- .../src/Admin/V2/RestoreTableMetadata.php | 8 +- Bigtable/src/Admin/V2/RestoreTableRequest.php | 4 +- Bigtable/src/Admin/V2/Snapshot.php | 14 +- .../src/Admin/V2/SnapshotTableMetadata.php | 6 +- .../src/Admin/V2/SnapshotTableRequest.php | 10 +- Bigtable/src/Admin/V2/Snapshot_State.php | 16 - Bigtable/src/Admin/V2/Table.php | 10 +- .../Admin/V2/Table/AutomatedBackupPolicy.php | 4 +- Bigtable/src/Admin/V2/Table/ClusterState.php | 2 +- Bigtable/src/Admin/V2/Table_ClusterState.php | 16 - .../Table_ClusterState_ReplicationState.php | 16 - .../Admin/V2/Table_TimestampGranularity.php | 16 - Bigtable/src/Admin/V2/Table_View.php | 16 - Bigtable/src/Admin/V2/Type.php | 39 +- Bigtable/src/Admin/V2/Type/Aggregate.php | 4 +- Bigtable/src/Admin/V2/Type/Bytes.php | 2 +- Bigtable/src/Admin/V2/Type/Int64.php | 2 +- .../V2/Type/Int64/Encoding/BigEndianBytes.php | 2 +- Bigtable/src/Admin/V2/Type/PBString.php | 81 + .../src/Admin/V2/Type/PBString/Encoding.php | 78 + .../V2/Type/PBString/Encoding/Utf8Raw.php | 42 + .../src/Admin/V2/UndeleteTableMetadata.php | 6 +- .../src/Admin/V2/UndeleteTableRequest.php | 2 +- .../src/Admin/V2/UpdateAppProfileRequest.php | 6 +- .../Admin/V2/UpdateAuthorizedViewMetadata.php | 6 +- .../Admin/V2/UpdateAuthorizedViewRequest.php | 6 +- Bigtable/src/Admin/V2/UpdateBackupRequest.php | 4 +- .../src/Admin/V2/UpdateClusterMetadata.php | 6 +- .../src/Admin/V2/UpdateInstanceMetadata.php | 6 +- Bigtable/src/Admin/V2/UpdateTableMetadata.php | 6 +- Bigtable/src/Admin/V2/UpdateTableRequest.php | 4 +- Bigtable/src/Admin/V2/gapic_metadata.json | 282 + Bigtable/src/BigtableClient.php | 52 +- Bigtable/src/ChunkFormatter.php | 95 +- Bigtable/src/ResumableStream.php | 86 +- Bigtable/src/Table.php | 142 +- Bigtable/src/V2/AllReadStats.php | 137 - Bigtable/src/V2/BigtableClient.php | 45 - Bigtable/src/V2/BigtableGrpcClient.php | 191 - Bigtable/src/V2/Cell.php | 4 +- Bigtable/src/V2/CheckAndMutateRowRequest.php | 10 +- Bigtable/src/V2/CheckAndMutateRowResponse.php | 2 +- Bigtable/src/V2/Client/BigtableClient.php | 24 +- Bigtable/src/V2/Column.php | 2 +- Bigtable/src/V2/ColumnRange.php | 2 +- Bigtable/src/V2/Family.php | 2 +- Bigtable/src/V2/FeatureFlags.php | 14 +- Bigtable/src/V2/FullReadStatsView.php | 4 +- Bigtable/src/V2/Gapic/BigtableGapicClient.php | 1090 -- ...teInitialChangeStreamPartitionsRequest.php | 4 +- ...eInitialChangeStreamPartitionsResponse.php | 2 +- Bigtable/src/V2/MutateRowRequest.php | 8 +- Bigtable/src/V2/MutateRowsRequest.php | 6 +- Bigtable/src/V2/MutateRowsRequest/Entry.php | 2 +- Bigtable/src/V2/MutateRowsRequest_Entry.php | 16 - Bigtable/src/V2/MutateRowsResponse.php | 2 +- Bigtable/src/V2/MutateRowsResponse/Entry.php | 4 +- Bigtable/src/V2/MutateRowsResponse_Entry.php | 16 - Bigtable/src/V2/Mutation/AddToCell.php | 8 +- Bigtable/src/V2/Mutation/DeleteFromColumn.php | 6 +- Bigtable/src/V2/Mutation/DeleteFromFamily.php | 2 +- Bigtable/src/V2/Mutation/SetCell.php | 8 +- Bigtable/src/V2/Mutation_DeleteFromColumn.php | 16 - Bigtable/src/V2/Mutation_DeleteFromFamily.php | 16 - Bigtable/src/V2/Mutation_DeleteFromRow.php | 16 - Bigtable/src/V2/Mutation_SetCell.php | 16 - Bigtable/src/V2/PingAndWarmRequest.php | 4 +- Bigtable/src/V2/RateLimitInfo.php | 4 +- Bigtable/src/V2/ReadChangeStreamRequest.php | 10 +- .../ReadChangeStreamResponse/CloseStream.php | 2 +- .../ReadChangeStreamResponse/DataChange.php | 16 +- .../V2/ReadChangeStreamResponse/Heartbeat.php | 4 +- .../MutationChunk.php | 4 +- .../MutationChunk/ChunkInfo.php | 6 +- .../ReadChangeStreamResponse_CloseStream.php | 16 - .../ReadChangeStreamResponse_DataChange.php | 16 - ...adChangeStreamResponse_DataChange_Type.php | 16 - .../V2/ReadChangeStreamResponse_Heartbeat.php | 16 - ...ReadChangeStreamResponse_MutationChunk.php | 16 - ...StreamResponse_MutationChunk_ChunkInfo.php | 16 - Bigtable/src/V2/ReadEfficiencyStats.php | 137 - Bigtable/src/V2/ReadIterationStats.php | 8 +- Bigtable/src/V2/ReadIteratorStats.php | 213 - Bigtable/src/V2/ReadModifyWriteRowRequest.php | 8 +- .../src/V2/ReadModifyWriteRowResponse.php | 2 +- Bigtable/src/V2/ReadModifyWriteRule.php | 4 +- Bigtable/src/V2/ReadRowsRequest.php | 16 +- .../V2/ReadRowsRequest_RequestStatsView.php | 16 - Bigtable/src/V2/ReadRowsResponse.php | 4 +- .../src/V2/ReadRowsResponse/CellChunk.php | 20 +- .../src/V2/ReadRowsResponse_CellChunk.php | 16 - Bigtable/src/V2/RequestLatencyStats.php | 2 +- Bigtable/src/V2/ResponseParams.php | 4 +- Bigtable/src/V2/Row.php | 2 +- Bigtable/src/V2/RowFilter/Condition.php | 6 +- Bigtable/src/V2/RowFilter_Chain.php | 16 - Bigtable/src/V2/RowFilter_Condition.php | 16 - Bigtable/src/V2/RowFilter_Interleave.php | 16 - Bigtable/src/V2/SampleRowKeysRequest.php | 6 +- Bigtable/src/V2/SampleRowKeysResponse.php | 4 +- Bigtable/src/V2/StreamContinuationToken.php | 4 +- Bigtable/src/V2/StreamPartition.php | 2 +- Bigtable/src/V2/TimestampRange.php | 4 +- Bigtable/tests/Snippet/ChunkFormatterTest.php | 18 +- Bigtable/tests/Snippet/TableTest.php | 138 +- Bigtable/tests/System/BackupTests.php | 116 +- .../BigtableInstanceAdminClientTest.php | 9 +- Bigtable/tests/System/BigtableTestCase.php | 49 +- .../V2/BigtableInstanceAdminClientTest.php | 1893 --- .../Admin/V2/BigtableTableAdminClientTest.php | 2584 ---- .../BigtableInstanceAdminClientTest.php | 5 +- .../Client/BigtableTableAdminClientTest.php | 5 +- Bigtable/tests/Unit/ChunkFormatterTest.php | 267 +- Bigtable/tests/Unit/SmartRetriesTest.php | 441 +- Bigtable/tests/Unit/TableTest.php | 357 +- Bigtable/tests/Unit/V2/BigtableClientTest.php | 696 - Bigtable/tests/Unit/bootstrap.php | 10 + Billing/.repo-metadata.json | 8 - Billing/VERSION | 2 +- Billing/composer.json | 2 +- BillingBudgets/.repo-metadata.json | 8 - BillingBudgets/VERSION | 2 +- BillingBudgets/composer.json | 2 +- BinaryAuthorization/.OwlBot.yaml | 2 +- BinaryAuthorization/.repo-metadata.json | 8 - BinaryAuthorization/README.md | 5 +- BinaryAuthorization/VERSION | 2 +- BinaryAuthorization/composer.json | 2 +- BinaryAuthorization/owlbot.py | 53 +- BinaryAuthorization/src/V1/AdmissionRule.php | 4 +- .../src/V1/AdmissionRule/EnforcementMode.php | 2 - .../src/V1/AdmissionRule/EvaluationMode.php | 2 - .../src/V1/AdmissionWhitelistPattern.php | 2 +- BinaryAuthorization/src/V1/Attestor.php | 6 +- .../src/V1/AttestorPublicKey.php | 4 +- .../BinauthzManagementServiceV1GrpcClient.php | 165 - .../BinauthzManagementServiceV1Client.php | 9 +- .../src/V1/Client/SystemPolicyV1Client.php | 6 +- .../V1/Client/ValidationHelperV1Client.php | 12 +- .../src/V1/CreateAttestorRequest.php | 6 +- .../src/V1/DeleteAttestorRequest.php | 2 +- .../src/V1/GetAttestorRequest.php | 2 +- .../src/V1/GetPolicyRequest.php | 2 +- .../src/V1/GetSystemPolicyRequest.php | 2 +- .../src/V1/ListAttestorsRequest.php | 6 +- .../src/V1/ListAttestorsResponse.php | 2 +- BinaryAuthorization/src/V1/PkixPublicKey.php | 4 +- .../V1/PkixPublicKey/SignatureAlgorithm.php | 2 - BinaryAuthorization/src/V1/Policy.php | 10 +- .../V1/Policy/GlobalPolicyEvaluationMode.php | 2 - .../src/V1/SystemPolicyV1GrpcClient.php | 50 - .../src/V1/UpdateAttestorRequest.php | 2 +- .../src/V1/UpdatePolicyRequest.php | 2 +- .../src/V1/UserOwnedGrafeasNote.php | 4 +- .../ValidateAttestationOccurrenceRequest.php | 8 +- .../ValidateAttestationOccurrenceResponse.php | 4 +- .../Result.php | 2 - .../src/V1/ValidationHelperV1GrpcClient.php | 51 - .../src/V1beta1/AdmissionRule.php | 164 - .../V1beta1/AdmissionRule/EnforcementMode.php | 66 - .../V1beta1/AdmissionRule/EvaluationMode.php | 71 - .../V1beta1/AdmissionRule_EnforcementMode.php | 16 - .../V1beta1/AdmissionRule_EvaluationMode.php | 16 - .../src/V1beta1/AdmissionWhitelistPattern.php | 92 - BinaryAuthorization/src/V1beta1/Attestor.php | 197 - .../src/V1beta1/AttestorPublicKey.php | 234 - ...BinauthzManagementServiceV1Beta1Client.php | 36 - ...uthzManagementServiceV1Beta1GrpcClient.php | 165 - .../src/V1beta1/ContinuousValidationEvent.php | 108 - .../ConfigErrorEvent.php | 71 - .../ContinuousValidationPodEvent.php | 294 - .../ImageDetails.php | 240 - .../ImageDetails/AuditResult.php | 64 - .../ImageDetails/CheckResult.php | 316 - .../CheckResult/CheckSetScope.php | 126 - .../ImageDetails/CheckResult/CheckVerdict.php | 58 - .../ImageDetails/ContainerType.php | 73 - .../PolicyConformanceVerdict.php | 57 - .../UnsupportedPolicyEvent.php | 70 - ...tionEvent_ContinuousValidationPodEvent.php | 16 - ...tinuousValidationPodEvent_ImageDetails.php | 16 - ...ationPodEvent_ImageDetails_AuditResult.php | 16 - ...ationPodEvent_PolicyConformanceVerdict.php | 16 - ...ValidationEvent_UnsupportedPolicyEvent.php | 16 - .../src/V1beta1/CreateAttestorRequest.php | 153 - .../src/V1beta1/DeleteAttestorRequest.php | 71 - ...thzManagementServiceV1Beta1GapicClient.php | 744 -- .../Gapic/SystemPolicyV1Beta1GapicClient.php | 360 - .../src/V1beta1/GetAttestorRequest.php | 71 - .../src/V1beta1/GetPolicyRequest.php | 71 - .../src/V1beta1/GetSystemPolicyRequest.php | 71 - .../src/V1beta1/ListAttestorsRequest.php | 151 - .../src/V1beta1/ListAttestorsResponse.php | 109 - .../src/V1beta1/PkixPublicKey.php | 124 - .../PkixPublicKey/SignatureAlgorithm.php | 153 - .../PkixPublicKey_SignatureAlgorithm.php | 16 - BinaryAuthorization/src/V1beta1/Policy.php | 469 - .../Policy/GlobalPolicyEvaluationMode.php | 62 - .../Policy_GlobalPolicyEvaluationMode.php | 16 - .../src/V1beta1/SystemPolicyV1Beta1Client.php | 36 - .../V1beta1/SystemPolicyV1Beta1GrpcClient.php | 50 - .../src/V1beta1/UpdateAttestorRequest.php | 85 - .../src/V1beta1/UpdatePolicyRequest.php | 85 - .../src/V1beta1/UserOwnedDrydockNote.php | 208 - .../src/V1beta1/gapic_metadata.json | 67 - ...gement_service_v1_beta1_client_config.json | 80 - ...ent_service_v1_beta1_descriptor_config.php | 38 - ...nt_service_v1_beta1_rest_client_config.php | 171 - .../system_policy_v1_beta1_client_config.json | 27 - ...stem_policy_v1_beta1_descriptor_config.php | 27 - ...tem_policy_v1_beta1_rest_client_config.php | 97 - .../BinauthzManagementServiceV1ClientTest.php | 191 +- .../V1/Client/SystemPolicyV1ClientTest.php | 30 +- .../Client/ValidationHelperV1ClientTest.php | 31 +- ...uthzManagementServiceV1Beta1ClientTest.php | 530 - .../V1beta1/SystemPolicyV1Beta1ClientTest.php | 123 - Build/.OwlBot.yaml | 2 +- Build/.repo-metadata.json | 8 - Build/README.md | 5 +- Build/VERSION | 2 +- Build/composer.json | 2 +- Build/metadata/V1/Cloudbuild.php | Bin 27111 -> 0 bytes Build/owlbot.py | 49 +- Build/src/V1/ApprovalConfig.php | 75 - Build/src/V1/ApprovalResult.php | 230 - Build/src/V1/ApprovalResult/Decision.php | 63 - Build/src/V1/ApproveBuildRequest.php | 115 - Build/src/V1/ArtifactResult.php | 110 - Build/src/V1/Artifacts.php | 314 - Build/src/V1/Artifacts/ArtifactObjects.php | 163 - Build/src/V1/Artifacts/MavenArtifact.php | 249 - Build/src/V1/Artifacts/NpmPackage.php | 119 - Build/src/V1/Artifacts/PythonPackage.php | 124 - Build/src/V1/Build.php | 1316 -- Build/src/V1/Build/FailureInfo.php | 102 - .../src/V1/Build/FailureInfo/FailureType.php | 91 - Build/src/V1/Build/Status.php | 112 - Build/src/V1/Build/Warning.php | 102 - Build/src/V1/Build/Warning/Priority.php | 69 - Build/src/V1/BuildApproval.php | 156 - Build/src/V1/BuildApproval/State.php | 76 - Build/src/V1/BuildOperationMetadata.php | 77 - Build/src/V1/BuildOptions.php | 678 - .../DefaultLogsBucketBehavior.php | 57 - .../V1/BuildOptions/LogStreamingOption.php | 63 - Build/src/V1/BuildOptions/LoggingMode.php | 86 - Build/src/V1/BuildOptions/MachineType.php | 85 - Build/src/V1/BuildOptions/PoolOption.php | 83 - .../V1/BuildOptions/SubstitutionOption.php | 56 - Build/src/V1/BuildOptions/VerifyOption.php | 61 - Build/src/V1/BuildStep.php | 893 -- Build/src/V1/BuildTrigger.php | 1026 -- Build/src/V1/BuiltImage.php | 149 - Build/src/V1/CancelBuildRequest.php | 139 - Build/src/V1/CloudBuildClient.php | 34 - Build/src/V1/CreateBuildRequest.php | 149 - Build/src/V1/CreateBuildTriggerRequest.php | 149 - .../V1/CreateWorkerPoolOperationMetadata.php | 163 - Build/src/V1/CreateWorkerPoolRequest.php | 199 - Build/src/V1/DeleteBuildTriggerRequest.php | 139 - .../V1/DeleteWorkerPoolOperationMetadata.php | 163 - Build/src/V1/DeleteWorkerPoolRequest.php | 189 - Build/src/V1/FileHashes.php | 68 - Build/src/V1/Gapic/CloudBuildGapicClient.php | 2136 ---- Build/src/V1/GetBuildRequest.php | 139 - Build/src/V1/GetBuildTriggerRequest.php | 139 - Build/src/V1/GetWorkerPoolRequest.php | 71 - Build/src/V1/GitFileSource.php | 303 - Build/src/V1/GitFileSource/RepoType.php | 79 - Build/src/V1/GitHubEnterpriseConfig.php | 409 - Build/src/V1/GitHubEnterpriseSecrets.php | 171 - Build/src/V1/GitHubEventsConfig.php | 228 - Build/src/V1/GitRepoSource.php | 238 - Build/src/V1/GitSource.php | 179 - Build/src/V1/Hash.php | 101 - Build/src/V1/Hash/HashType.php | 69 - Build/src/V1/InlineSecret.php | 122 - Build/src/V1/ListBuildTriggersRequest.php | 173 - Build/src/V1/ListBuildTriggersResponse.php | 101 - Build/src/V1/ListBuildsRequest.php | 227 - Build/src/V1/ListBuildsResponse.php | 105 - Build/src/V1/ListWorkerPoolsRequest.php | 147 - Build/src/V1/ListWorkerPoolsResponse.php | 109 - Build/src/V1/PrivatePoolV1Config.php | 121 - .../V1/PrivatePoolV1Config/NetworkConfig.php | 192 - .../NetworkConfig/EgressOption.php | 64 - .../V1/PrivatePoolV1Config/WorkerConfig.php | 131 - Build/src/V1/PubsubConfig.php | 182 - Build/src/V1/PubsubConfig/State.php | 77 - Build/src/V1/PullRequestFilter.php | 154 - .../V1/PullRequestFilter/CommentControl.php | 64 - Build/src/V1/PushFilter.php | 158 - Build/src/V1/ReceiveTriggerWebhookRequest.php | 218 - .../src/V1/ReceiveTriggerWebhookResponse.php | 34 - Build/src/V1/RepoSource.php | 343 - Build/src/V1/RepositoryEventConfig.php | 177 - .../RepositoryEventConfig/RepositoryType.php | 69 - Build/src/V1/Results.php | 377 - Build/src/V1/RetryBuildRequest.php | 139 - Build/src/V1/RunBuildTriggerRequest.php | 187 - Build/src/V1/Secret.php | 121 - Build/src/V1/SecretManagerSecret.php | 113 - Build/src/V1/Secrets.php | 105 - Build/src/V1/Source.php | 183 - Build/src/V1/SourceProvenance.php | 244 - Build/src/V1/StorageSource.php | 189 - Build/src/V1/StorageSource/SourceFetcher.php | 62 - Build/src/V1/StorageSourceManifest.php | 153 - Build/src/V1/TimeSpan.php | 121 - Build/src/V1/UpdateBuildTriggerRequest.php | 197 - .../V1/UpdateWorkerPoolOperationMetadata.php | 163 - Build/src/V1/UpdateWorkerPoolRequest.php | 167 - Build/src/V1/UploadedMavenArtifact.php | 155 - Build/src/V1/UploadedNpmPackage.php | 156 - Build/src/V1/UploadedPythonPackage.php | 155 - Build/src/V1/Volume.php | 118 - Build/src/V1/WebhookConfig.php | 114 - Build/src/V1/WebhookConfig/State.php | 63 - Build/src/V1/WorkerPool.php | 465 - Build/src/V1/WorkerPool/State.php | 83 - Build/src/V1/gapic_metadata.json | 108 - .../resources/cloud_build_client_config.json | 135 - .../cloud_build_descriptor_config.php | 128 - .../cloud_build_rest_client_config.php | 465 - .../src/V2/BatchCreateRepositoriesRequest.php | 2 +- Build/src/V2/BitbucketCloudConfig.php | 8 +- Build/src/V2/BitbucketDataCenterConfig.php | 14 +- .../src/V2/Client/RepositoryManagerClient.php | 63 +- Build/src/V2/Connection.php | 14 +- Build/src/V2/CreateConnectionRequest.php | 6 +- Build/src/V2/CreateRepositoryRequest.php | 6 +- Build/src/V2/DeleteConnectionRequest.php | 6 +- Build/src/V2/DeleteRepositoryRequest.php | 6 +- Build/src/V2/FetchGitRefsRequest.php | 4 +- .../V2/FetchLinkableRepositoriesRequest.php | 6 +- .../V2/FetchLinkableRepositoriesResponse.php | 2 +- Build/src/V2/FetchReadTokenRequest.php | 2 +- Build/src/V2/FetchReadTokenResponse.php | 4 +- Build/src/V2/FetchReadWriteTokenRequest.php | 2 +- Build/src/V2/FetchReadWriteTokenResponse.php | 4 +- .../V2/Gapic/RepositoryManagerGapicClient.php | 1516 --- Build/src/V2/GetConnectionRequest.php | 2 +- Build/src/V2/GetRepositoryRequest.php | 2 +- Build/src/V2/GitHubConfig.php | 4 +- Build/src/V2/GitHubEnterpriseConfig.php | 20 +- Build/src/V2/GitLabConfig.php | 14 +- Build/src/V2/InstallationState.php | 6 +- Build/src/V2/ListConnectionsRequest.php | 6 +- Build/src/V2/ListConnectionsResponse.php | 2 +- Build/src/V2/ListRepositoriesRequest.php | 8 +- Build/src/V2/ListRepositoriesResponse.php | 2 +- Build/src/V2/OAuthCredential.php | 4 +- Build/src/V2/OperationMetadata.php | 14 +- Build/src/V2/ProcessWebhookRequest.php | 6 +- Build/src/V2/Repository.php | 12 +- Build/src/V2/RepositoryManagerClient.php | 34 - .../V2/RunWorkflowCustomOperationMetadata.php | 14 +- Build/src/V2/ServiceDirectoryConfig.php | 2 +- Build/src/V2/UpdateConnectionRequest.php | 8 +- Build/src/V2/UserCredential.php | 4 +- Build/tests/Unit/V1/CloudBuildClientTest.php | 1768 --- .../V2/Client/RepositoryManagerClientTest.php | 390 +- .../Unit/V2/RepositoryManagerClientTest.php | 1530 --- CHANGELOG.md | 3018 +++++ CertificateManager/.repo-metadata.json | 8 - CertificateManager/VERSION | 2 +- CertificateManager/composer.json | 2 +- Channel/.repo-metadata.json | 8 - Channel/VERSION | 2 +- Channel/composer.json | 2 +- .../.repo-metadata.json | 8 - CommerceConsumerProcurement/VERSION | 2 +- CommerceConsumerProcurement/composer.json | 2 +- .../ConsumerProcurementServiceClient.php | 21 +- .../ConsumerProcurementServiceClientTest.php | 2 +- CommonProtos/.repo-metadata.json | 7 - CommonProtos/VERSION | 2 +- Compute/.repo-metadata.json | 8 - Compute/VERSION | 2 +- Compute/composer.json | 2 +- Compute/metadata/V1/Compute.php | Bin 666201 -> 666288 bytes Compute/src/V1/AccessConfig.php | 8 +- Compute/src/V1/Client/AddressesClient.php | 3 + Compute/src/V1/Client/AutoscalersClient.php | 3 + .../src/V1/Client/BackendBucketsClient.php | 3 + .../src/V1/Client/BackendServicesClient.php | 3 + Compute/src/V1/Client/DisksClient.php | 3 + .../V1/Client/ExternalVpnGatewaysClient.php | 3 + .../src/V1/Client/FirewallPoliciesClient.php | 3 + Compute/src/V1/Client/FirewallsClient.php | 3 + .../src/V1/Client/ForwardingRulesClient.php | 3 + .../src/V1/Client/GlobalAddressesClient.php | 3 + .../V1/Client/GlobalForwardingRulesClient.php | 3 + .../GlobalNetworkEndpointGroupsClient.php | 3 + .../GlobalPublicDelegatedPrefixesClient.php | 3 + Compute/src/V1/Client/HealthChecksClient.php | 3 + Compute/src/V1/Client/ImagesClient.php | 3 + ...stanceGroupManagerResizeRequestsClient.php | 3 + .../V1/Client/InstanceGroupManagersClient.php | 3 + .../src/V1/Client/InstanceGroupsClient.php | 3 + .../Client/InstanceSettingsServiceClient.php | 3 + .../src/V1/Client/InstanceTemplatesClient.php | 3 + Compute/src/V1/Client/InstancesClient.php | 3 + .../src/V1/Client/InstantSnapshotsClient.php | 3 + .../Client/InterconnectAttachmentsClient.php | 3 + Compute/src/V1/Client/InterconnectsClient.php | 3 + Compute/src/V1/Client/LicensesClient.php | 3 + Compute/src/V1/Client/MachineImagesClient.php | 3 + .../V1/Client/NetworkAttachmentsClient.php | 3 + .../NetworkEdgeSecurityServicesClient.php | 3 + .../V1/Client/NetworkEndpointGroupsClient.php | 3 + .../Client/NetworkFirewallPoliciesClient.php | 3 + Compute/src/V1/Client/NetworksClient.php | 3 + Compute/src/V1/Client/NodeGroupsClient.php | 3 + Compute/src/V1/Client/NodeTemplatesClient.php | 3 + .../src/V1/Client/PacketMirroringsClient.php | 3 + Compute/src/V1/Client/ProjectsClient.php | 3 + .../Client/PublicAdvertisedPrefixesClient.php | 3 + .../Client/PublicDelegatedPrefixesClient.php | 3 + .../src/V1/Client/RegionAutoscalersClient.php | 3 + .../V1/Client/RegionBackendServicesClient.php | 3 + .../src/V1/Client/RegionCommitmentsClient.php | 3 + Compute/src/V1/Client/RegionDisksClient.php | 3 + .../RegionHealthCheckServicesClient.php | 3 + .../V1/Client/RegionHealthChecksClient.php | 3 + .../RegionInstanceGroupManagersClient.php | 3 + .../V1/Client/RegionInstanceGroupsClient.php | 3 + .../Client/RegionInstanceTemplatesClient.php | 3 + .../src/V1/Client/RegionInstancesClient.php | 3 + .../Client/RegionInstantSnapshotsClient.php | 3 + .../RegionNetworkEndpointGroupsClient.php | 3 + .../RegionNetworkFirewallPoliciesClient.php | 3 + .../RegionNotificationEndpointsClient.php | 3 + .../Client/RegionSecurityPoliciesClient.php | 3 + .../V1/Client/RegionSslCertificatesClient.php | 3 + .../src/V1/Client/RegionSslPoliciesClient.php | 3 + .../Client/RegionTargetHttpProxiesClient.php | 3 + .../Client/RegionTargetHttpsProxiesClient.php | 3 + .../Client/RegionTargetTcpProxiesClient.php | 3 + Compute/src/V1/Client/RegionUrlMapsClient.php | 3 + Compute/src/V1/Client/ReservationsClient.php | 3 + .../src/V1/Client/ResourcePoliciesClient.php | 3 + Compute/src/V1/Client/RoutersClient.php | 3 + Compute/src/V1/Client/RoutesClient.php | 3 + .../src/V1/Client/SecurityPoliciesClient.php | 3 + .../V1/Client/ServiceAttachmentsClient.php | 3 + .../Client/SnapshotSettingsServiceClient.php | 3 + Compute/src/V1/Client/SnapshotsClient.php | 3 + .../src/V1/Client/SslCertificatesClient.php | 3 + Compute/src/V1/Client/SslPoliciesClient.php | 3 + Compute/src/V1/Client/StoragePoolsClient.php | 3 + Compute/src/V1/Client/SubnetworksClient.php | 3 + .../src/V1/Client/TargetGrpcProxiesClient.php | 3 + .../src/V1/Client/TargetHttpProxiesClient.php | 3 + .../V1/Client/TargetHttpsProxiesClient.php | 3 + .../src/V1/Client/TargetInstancesClient.php | 3 + Compute/src/V1/Client/TargetPoolsClient.php | 3 + .../src/V1/Client/TargetSslProxiesClient.php | 3 + .../src/V1/Client/TargetTcpProxiesClient.php | 3 + .../src/V1/Client/TargetVpnGatewaysClient.php | 3 + Compute/src/V1/Client/UrlMapsClient.php | 3 + Compute/src/V1/Client/VpnGatewaysClient.php | 3 + Compute/src/V1/Client/VpnTunnelsClient.php | 3 + Compute/src/V1/Commitment/Type.php | 5 + Compute/src/V1/Enums/Commitment/Type.php | 2 + Compute/src/V1/Enums/Quota/Metric.php | 2 + Compute/src/V1/Gapic/AddressesGapicClient.php | 3 + .../src/V1/Gapic/AutoscalersGapicClient.php | 3 + .../V1/Gapic/BackendBucketsGapicClient.php | 3 + .../V1/Gapic/BackendServicesGapicClient.php | 3 + Compute/src/V1/Gapic/DisksGapicClient.php | 3 + .../Gapic/ExternalVpnGatewaysGapicClient.php | 3 + .../V1/Gapic/FirewallPoliciesGapicClient.php | 3 + Compute/src/V1/Gapic/FirewallsGapicClient.php | 3 + .../V1/Gapic/ForwardingRulesGapicClient.php | 3 + .../V1/Gapic/GlobalAddressesGapicClient.php | 3 + .../GlobalForwardingRulesGapicClient.php | 3 + ...GlobalNetworkEndpointGroupsGapicClient.php | 3 + ...obalPublicDelegatedPrefixesGapicClient.php | 3 + .../src/V1/Gapic/HealthChecksGapicClient.php | 3 + Compute/src/V1/Gapic/ImagesGapicClient.php | 3 + ...eGroupManagerResizeRequestsGapicClient.php | 3 + .../InstanceGroupManagersGapicClient.php | 3 + .../V1/Gapic/InstanceGroupsGapicClient.php | 3 + .../InstanceSettingsServiceGapicClient.php | 3 + .../V1/Gapic/InstanceTemplatesGapicClient.php | 3 + Compute/src/V1/Gapic/InstancesGapicClient.php | 3 + .../V1/Gapic/InstantSnapshotsGapicClient.php | 3 + .../InterconnectAttachmentsGapicClient.php | 3 + .../src/V1/Gapic/InterconnectsGapicClient.php | 3 + Compute/src/V1/Gapic/LicensesGapicClient.php | 3 + .../src/V1/Gapic/MachineImagesGapicClient.php | 3 + .../Gapic/NetworkAttachmentsGapicClient.php | 3 + ...NetworkEdgeSecurityServicesGapicClient.php | 3 + .../NetworkEndpointGroupsGapicClient.php | 3 + .../NetworkFirewallPoliciesGapicClient.php | 3 + Compute/src/V1/Gapic/NetworksGapicClient.php | 3 + .../src/V1/Gapic/NodeGroupsGapicClient.php | 3 + .../src/V1/Gapic/NodeTemplatesGapicClient.php | 3 + .../V1/Gapic/PacketMirroringsGapicClient.php | 3 + Compute/src/V1/Gapic/ProjectsGapicClient.php | 3 + .../PublicAdvertisedPrefixesGapicClient.php | 3 + .../PublicDelegatedPrefixesGapicClient.php | 3 + .../V1/Gapic/RegionAutoscalersGapicClient.php | 3 + .../RegionBackendServicesGapicClient.php | 3 + .../V1/Gapic/RegionCommitmentsGapicClient.php | 3 + .../src/V1/Gapic/RegionDisksGapicClient.php | 3 + .../RegionHealthCheckServicesGapicClient.php | 3 + .../Gapic/RegionHealthChecksGapicClient.php | 3 + ...RegionInstanceGroupManagersGapicClient.php | 3 + .../Gapic/RegionInstanceGroupsGapicClient.php | 3 + .../RegionInstanceTemplatesGapicClient.php | 3 + .../V1/Gapic/RegionInstancesGapicClient.php | 3 + .../RegionInstantSnapshotsGapicClient.php | 3 + ...RegionNetworkEndpointGroupsGapicClient.php | 3 + ...gionNetworkFirewallPoliciesGapicClient.php | 3 + ...RegionNotificationEndpointsGapicClient.php | 3 + .../RegionSecurityPoliciesGapicClient.php | 3 + .../RegionSslCertificatesGapicClient.php | 3 + .../V1/Gapic/RegionSslPoliciesGapicClient.php | 3 + .../RegionTargetHttpProxiesGapicClient.php | 3 + .../RegionTargetHttpsProxiesGapicClient.php | 3 + .../RegionTargetTcpProxiesGapicClient.php | 3 + .../src/V1/Gapic/RegionUrlMapsGapicClient.php | 3 + .../src/V1/Gapic/ReservationsGapicClient.php | 3 + .../V1/Gapic/ResourcePoliciesGapicClient.php | 3 + Compute/src/V1/Gapic/RoutersGapicClient.php | 3 + Compute/src/V1/Gapic/RoutesGapicClient.php | 3 + .../V1/Gapic/SecurityPoliciesGapicClient.php | 3 + .../Gapic/ServiceAttachmentsGapicClient.php | 3 + .../SnapshotSettingsServiceGapicClient.php | 3 + Compute/src/V1/Gapic/SnapshotsGapicClient.php | 3 + .../V1/Gapic/SslCertificatesGapicClient.php | 3 + .../src/V1/Gapic/SslPoliciesGapicClient.php | 3 + .../src/V1/Gapic/StoragePoolsGapicClient.php | 3 + .../src/V1/Gapic/SubnetworksGapicClient.php | 3 + .../V1/Gapic/TargetGrpcProxiesGapicClient.php | 3 + .../V1/Gapic/TargetHttpProxiesGapicClient.php | 3 + .../Gapic/TargetHttpsProxiesGapicClient.php | 3 + .../V1/Gapic/TargetInstancesGapicClient.php | 3 + .../src/V1/Gapic/TargetPoolsGapicClient.php | 3 + .../V1/Gapic/TargetSslProxiesGapicClient.php | 3 + .../V1/Gapic/TargetTcpProxiesGapicClient.php | 3 + .../V1/Gapic/TargetVpnGatewaysGapicClient.php | 3 + Compute/src/V1/Gapic/UrlMapsGapicClient.php | 3 + .../src/V1/Gapic/VpnGatewaysGapicClient.php | 3 + .../src/V1/Gapic/VpnTunnelsGapicClient.php | 3 + Compute/src/V1/HTTP2HealthCheck.php | 8 +- Compute/src/V1/HTTPHealthCheck.php | 8 +- Compute/src/V1/HTTPSHealthCheck.php | 8 +- Compute/src/V1/Quota/Metric.php | 5 + ...napshotSettingsStorageLocationSettings.php | 8 +- .../Policy.php | 2 +- ...ationSettingsStorageLocationPreference.php | 8 +- .../resources/addresses_descriptor_config.php | 12 + .../autoscalers_descriptor_config.php | 12 + .../backend_buckets_descriptor_config.php | 21 + .../backend_services_descriptor_config.php | 24 + .../V1/resources/disks_descriptor_config.php | 36 + ...xternal_vpn_gateways_descriptor_config.php | 9 + .../firewall_policies_descriptor_config.php | 30 + .../resources/firewalls_descriptor_config.php | 12 + .../forwarding_rules_descriptor_config.php | 15 + .../global_addresses_descriptor_config.php | 12 + ...bal_forwarding_rules_descriptor_config.php | 15 + ...work_endpoint_groups_descriptor_config.php | 12 + ...c_delegated_prefixes_descriptor_config.php | 9 + .../health_checks_descriptor_config.php | 12 + .../V1/resources/images_descriptor_config.php | 15 + ...ager_resize_requests_descriptor_config.php | 9 + ...tance_group_managers_descriptor_config.php | 42 + .../instance_groups_descriptor_config.php | 15 + ...nce_settings_service_descriptor_config.php | 3 + .../instance_templates_descriptor_config.php | 6 + .../resources/instances_descriptor_config.php | 105 + .../instant_snapshots_descriptor_config.php | 9 + ...rconnect_attachments_descriptor_config.php | 12 + .../interconnects_descriptor_config.php | 12 + .../resources/licenses_descriptor_config.php | 6 + .../machine_images_descriptor_config.php | 6 + .../network_attachments_descriptor_config.php | 9 + ...ge_security_services_descriptor_config.php | 9 + ...work_endpoint_groups_descriptor_config.php | 12 + ...rk_firewall_policies_descriptor_config.php | 27 + .../resources/networks_descriptor_config.php | 21 + .../node_groups_descriptor_config.php | 24 + .../node_templates_descriptor_config.php | 6 + .../packet_mirrorings_descriptor_config.php | 9 + .../resources/projects_descriptor_config.php | 30 + ..._advertised_prefixes_descriptor_config.php | 15 + ...c_delegated_prefixes_descriptor_config.php | 15 + .../region_autoscalers_descriptor_config.php | 12 + ...ion_backend_services_descriptor_config.php | 15 + .../region_commitments_descriptor_config.php | 6 + .../region_disks_descriptor_config.php | 36 + ...ealth_check_services_descriptor_config.php | 9 + ...region_health_checks_descriptor_config.php | 12 + ...tance_group_managers_descriptor_config.php | 42 + ...gion_instance_groups_descriptor_config.php | 3 + ...n_instance_templates_descriptor_config.php | 6 + .../region_instances_descriptor_config.php | 3 + ...on_instant_snapshots_descriptor_config.php | 9 + ...work_endpoint_groups_descriptor_config.php | 12 + ...rk_firewall_policies_descriptor_config.php | 27 + ...tification_endpoints_descriptor_config.php | 6 + ...on_security_policies_descriptor_config.php | 18 + ...ion_ssl_certificates_descriptor_config.php | 6 + .../region_ssl_policies_descriptor_config.php | 9 + ..._target_http_proxies_descriptor_config.php | 9 + ...target_https_proxies_descriptor_config.php | 15 + ...n_target_tcp_proxies_descriptor_config.php | 6 + .../region_url_maps_descriptor_config.php | 12 + .../reservations_descriptor_config.php | 12 + .../resource_policies_descriptor_config.php | 9 + .../resources/routers_descriptor_config.php | 12 + .../V1/resources/routes_descriptor_config.php | 6 + .../security_policies_descriptor_config.php | 21 + .../service_attachments_descriptor_config.php | 9 + ...hot_settings_service_descriptor_config.php | 3 + .../resources/snapshots_descriptor_config.php | 9 + .../ssl_certificates_descriptor_config.php | 6 + .../ssl_policies_descriptor_config.php | 9 + .../storage_pools_descriptor_config.php | 9 + .../subnetworks_descriptor_config.php | 15 + .../target_grpc_proxies_descriptor_config.php | 9 + .../target_http_proxies_descriptor_config.php | 12 + ...target_https_proxies_descriptor_config.php | 24 + .../target_instances_descriptor_config.php | 9 + .../target_pools_descriptor_config.php | 24 + .../target_ssl_proxies_descriptor_config.php | 21 + .../target_tcp_proxies_descriptor_config.php | 12 + .../target_vpn_gateways_descriptor_config.php | 9 + .../resources/url_maps_descriptor_config.php | 15 + .../vpn_gateways_descriptor_config.php | 9 + .../vpn_tunnels_descriptor_config.php | 9 + ConfidentialComputing/.repo-metadata.json | 8 - ConfidentialComputing/VERSION | 2 +- ConfidentialComputing/composer.json | 2 +- Config/.repo-metadata.json | 8 - Config/VERSION | 2 +- Config/composer.json | 2 +- Config/src/V1/Client/ConfigClient.php | 21 +- .../tests/Unit/V1/Client/ConfigClientTest.php | 2 +- ContactCenterInsights/.repo-metadata.json | 8 - ContactCenterInsights/VERSION | 2 +- ContactCenterInsights/composer.json | 2 +- Container/.repo-metadata.json | 9 - Container/VERSION | 2 +- Container/composer.json | 2 +- Container/metadata/V1/ClusterService.php | Bin 52725 -> 54523 bytes Container/src/V1/AdvancedMachineFeatures.php | 44 + Container/src/V1/Cluster.php | 88 + Container/src/V1/ClusterUpdate.php | 164 +- Container/src/V1/ContainerdConfig.php | 81 + .../PrivateRegistryAccessConfig.php | 105 + .../CertificateAuthorityDomainConfig.php | 133 + .../GCPSecretManagerCertificateConfig.php | 79 + Container/src/V1/DNSConfig.php | 34 + .../GPUSharingConfig/GPUSharingStrategy.php | 7 + .../V1/Gapic/ClusterManagerGapicClient.php | 18 + Container/src/V1/LinuxNodeConfig.php | 44 + .../V1/LinuxNodeConfig/HugepagesConfig.php | 124 + Container/src/V1/ListOperationsRequest.php | 15 + .../MonitoringComponentConfig/Component.php | 14 + Container/src/V1/NetworkConfig.php | 4 + Container/src/V1/NodeConfig.php | 44 + Container/src/V1/NodeConfigDefaults.php | 92 + Container/src/V1/NodePoolAutoConfig.php | 48 + .../src/V1/SecurityPostureConfig/Mode.php | 7 + Container/src/V1/UpdateNodePoolRequest.php | 94 + .../V1/Client/ClusterManagerClientTest.php | 4 + .../Unit/V1/ClusterManagerClientTest.php | 4 + ContainerAnalysis/.repo-metadata.json | 8 - ContainerAnalysis/VERSION | 2 +- ContainerAnalysis/composer.json | 2 +- ControlsPartner/.repo-metadata.json | 8 - ControlsPartner/VERSION | 2 +- ControlsPartner/composer.json | 2 +- Core/.repo-metadata.json | 8 - Core/VERSION | 2 +- Core/composer.json | 2 +- Core/snippet-bootstrap.php | 7 + Core/unit-bootstrap.php | 7 + DataCatalog/.repo-metadata.json | 8 - DataCatalog/VERSION | 2 +- DataCatalog/composer.json | 2 +- DataCatalogLineage/.repo-metadata.json | 8 - DataCatalogLineage/VERSION | 2 +- DataCatalogLineage/composer.json | 2 +- DataFusion/.repo-metadata.json | 8 - DataFusion/README.md | 5 +- DataFusion/VERSION | 2 +- DataFusion/composer.json | 2 +- DataFusion/owlbot.py | 40 +- DataFusion/src/V1/Accelerator.php | 4 +- DataFusion/src/V1/Client/DataFusionClient.php | 37 +- DataFusion/src/V1/CreateInstanceRequest.php | 6 +- DataFusion/src/V1/CryptoKeyConfig.php | 2 +- DataFusion/src/V1/DataFusionClient.php | 34 - DataFusion/src/V1/DataFusionGrpcClient.php | 144 - DataFusion/src/V1/DeleteInstanceRequest.php | 2 +- .../src/V1/Gapic/DataFusionGapicClient.php | 961 -- DataFusion/src/V1/GetInstanceRequest.php | 2 +- DataFusion/src/V1/Instance.php | 44 +- .../src/V1/ListAvailableVersionsRequest.php | 8 +- .../src/V1/ListAvailableVersionsResponse.php | 2 +- DataFusion/src/V1/ListInstancesRequest.php | 10 +- DataFusion/src/V1/ListInstancesResponse.php | 2 +- DataFusion/src/V1/NetworkConfig.php | 4 +- DataFusion/src/V1/OperationMetadata.php | 14 +- DataFusion/src/V1/RestartInstanceRequest.php | 2 +- DataFusion/src/V1/UpdateInstanceRequest.php | 4 +- DataFusion/src/V1/Version.php | 6 +- .../Unit/V1/Client/DataFusionClientTest.php | 169 +- .../tests/Unit/V1/DataFusionClientTest.php | 876 -- DataLabeling/.repo-metadata.json | 8 - DataLabeling/VERSION | 2 +- DataLabeling/composer.json | 2 +- Dataflow/.repo-metadata.json | 8 - Dataflow/VERSION | 2 +- Dataflow/composer.json | 2 +- Dataform/.repo-metadata.json | 10 - Dataform/VERSION | 2 +- Dataform/composer.json | 2 +- Dataplex/.repo-metadata.json | 8 - Dataplex/README.md | 5 +- Dataplex/VERSION | 2 +- Dataplex/composer.json | 2 +- Dataplex/metadata/V1/Catalog.php | 14 +- Dataplex/metadata/V1/DataQuality.php | Bin 5177 -> 5337 bytes Dataplex/metadata/V1/Logs.php | Bin 7895 -> 7943 bytes Dataplex/owlbot.py | 40 +- Dataplex/src/V1/Action.php | 14 +- .../V1/Action/FailedSecurityPolicyApply.php | 2 +- .../src/V1/Action/IncompatibleDataSchema.php | 8 +- Dataplex/src/V1/Action/InvalidDataFormat.php | 4 +- .../src/V1/Action/InvalidDataPartition.php | 2 +- Dataplex/src/V1/Aspect.php | 12 +- Dataplex/src/V1/AspectSource.php | 4 +- Dataplex/src/V1/AspectType.php | 20 +- Dataplex/src/V1/AspectType/Authorization.php | 2 +- .../src/V1/AspectType/MetadataTemplate.php | 18 +- .../MetadataTemplate/Annotations.php | 10 +- .../MetadataTemplate/Constraints.php | 2 +- .../AspectType/MetadataTemplate/EnumValue.php | 6 +- Dataplex/src/V1/Asset.php | 24 +- Dataplex/src/V1/Asset/DiscoverySpec.php | 6 +- .../src/V1/Asset/DiscoverySpec/CsvOptions.php | 8 +- .../V1/Asset/DiscoverySpec/JsonOptions.php | 4 +- Dataplex/src/V1/Asset/DiscoveryStatus.php | 12 +- .../src/V1/Asset/DiscoveryStatus/Stats.php | 8 +- Dataplex/src/V1/Asset/ResourceSpec.php | 6 +- Dataplex/src/V1/Asset/ResourceStatus.php | 8 +- Dataplex/src/V1/Asset/SecurityStatus.php | 6 +- Dataplex/src/V1/AssetStatus.php | 6 +- Dataplex/src/V1/CancelJobRequest.php | 2 +- Dataplex/src/V1/CatalogServiceClient.php | 34 - .../src/V1/Client/CatalogServiceClient.php | 35 +- .../src/V1/Client/ContentServiceClient.php | 12 +- .../src/V1/Client/DataScanServiceClient.php | 52 +- .../V1/Client/DataTaxonomyServiceClient.php | 82 +- .../src/V1/Client/DataplexServiceClient.php | 46 +- .../src/V1/Client/MetadataServiceClient.php | 31 +- Dataplex/src/V1/Content.php | 12 +- Dataplex/src/V1/Content/Notebook.php | 2 +- Dataplex/src/V1/Content/SqlScript.php | 2 +- Dataplex/src/V1/ContentServiceClient.php | 34 - Dataplex/src/V1/ContentServiceGrpcClient.php | 173 - Dataplex/src/V1/CreateAspectTypeRequest.php | 8 +- Dataplex/src/V1/CreateAssetRequest.php | 8 +- Dataplex/src/V1/CreateContentRequest.php | 6 +- .../V1/CreateDataAttributeBindingRequest.php | 8 +- .../src/V1/CreateDataAttributeRequest.php | 8 +- Dataplex/src/V1/CreateDataScanRequest.php | 8 +- Dataplex/src/V1/CreateDataTaxonomyRequest.php | 8 +- Dataplex/src/V1/CreateEntityRequest.php | 6 +- Dataplex/src/V1/CreateEntryGroupRequest.php | 8 +- Dataplex/src/V1/CreateEntryRequest.php | 6 +- Dataplex/src/V1/CreateEntryTypeRequest.php | 8 +- Dataplex/src/V1/CreateEnvironmentRequest.php | 8 +- Dataplex/src/V1/CreateLakeRequest.php | 8 +- Dataplex/src/V1/CreatePartitionRequest.php | 6 +- Dataplex/src/V1/CreateTaskRequest.php | 8 +- Dataplex/src/V1/CreateZoneRequest.php | 8 +- Dataplex/src/V1/DataAttribute.php | 22 +- Dataplex/src/V1/DataAttributeBinding.php | 14 +- Dataplex/src/V1/DataAttributeBinding/Path.php | 2 +- Dataplex/src/V1/DataProfileResult.php | 8 +- .../PostScanActionsResult.php | 2 +- .../BigQueryExportResult.php | 4 +- .../V1/DataProfileResult/Profile/Field.php | 8 +- .../Profile/Field/ProfileInfo.php | 4 +- .../Field/ProfileInfo/DoubleFieldInfo.php | 8 +- .../Field/ProfileInfo/IntegerFieldInfo.php | 8 +- .../Field/ProfileInfo/StringFieldInfo.php | 6 +- .../Profile/Field/ProfileInfo/TopNValue.php | 6 +- Dataplex/src/V1/DataProfileSpec.php | 10 +- .../V1/DataProfileSpec/PostScanActions.php | 2 +- .../PostScanActions/BigQueryExport.php | 2 +- Dataplex/src/V1/DataQualityColumnResult.php | 4 +- Dataplex/src/V1/DataQualityDimension.php | 2 +- .../src/V1/DataQualityDimensionResult.php | 6 +- Dataplex/src/V1/DataQualityResult.php | 10 +- .../PostScanActionsResult.php | 2 +- .../BigQueryExportResult.php | 4 +- Dataplex/src/V1/DataQualityRule.php | 48 +- .../V1/DataQualityRule/RangeExpectation.php | 8 +- .../V1/DataQualityRule/RegexExpectation.php | 2 +- .../RowConditionExpectation.php | 2 +- .../src/V1/DataQualityRule/SqlAssertion.php | 75 + .../StatisticRangeExpectation.php | 10 +- .../TableConditionExpectation.php | 2 +- Dataplex/src/V1/DataQualityRuleResult.php | 56 +- Dataplex/src/V1/DataQualityScanRuleResult.php | 62 +- .../V1/DataQualityScanRuleResult/RuleType.php | 8 + Dataplex/src/V1/DataQualitySpec.php | 6 +- .../V1/DataQualitySpec/PostScanActions.php | 4 +- .../PostScanActions/BigQueryExport.php | 2 +- .../PostScanActions/NotificationReport.php | 8 +- .../PostScanActions/ScoreThresholdTrigger.php | 2 +- Dataplex/src/V1/DataScan.php | 22 +- Dataplex/src/V1/DataScan/ExecutionSpec.php | 2 +- Dataplex/src/V1/DataScan/ExecutionStatus.php | 4 +- Dataplex/src/V1/DataScanEvent.php | 24 +- .../DataProfileAppliedConfigs.php | 6 +- .../V1/DataScanEvent/DataProfileResult.php | 2 +- .../DataQualityAppliedConfigs.php | 4 +- .../V1/DataScanEvent/DataQualityResult.php | 6 +- .../DataScanEvent/PostScanActionsResult.php | 2 +- .../BigQueryExportResult.php | 4 +- Dataplex/src/V1/DataScanJob.php | 14 +- Dataplex/src/V1/DataScanServiceClient.php | 34 - Dataplex/src/V1/DataScanServiceGrpcClient.php | 157 - Dataplex/src/V1/DataTaxonomy.php | 18 +- Dataplex/src/V1/DataTaxonomyServiceClient.php | 34 - Dataplex/src/V1/DataplexServiceClient.php | 34 - Dataplex/src/V1/DataplexServiceGrpcClient.php | 538 - Dataplex/src/V1/DeleteAspectTypeRequest.php | 4 +- Dataplex/src/V1/DeleteAssetRequest.php | 2 +- Dataplex/src/V1/DeleteContentRequest.php | 2 +- .../V1/DeleteDataAttributeBindingRequest.php | 4 +- .../src/V1/DeleteDataAttributeRequest.php | 4 +- Dataplex/src/V1/DeleteDataScanRequest.php | 2 +- Dataplex/src/V1/DeleteDataTaxonomyRequest.php | 4 +- Dataplex/src/V1/DeleteEntityRequest.php | 4 +- Dataplex/src/V1/DeleteEntryGroupRequest.php | 4 +- Dataplex/src/V1/DeleteEntryRequest.php | 2 +- Dataplex/src/V1/DeleteEntryTypeRequest.php | 4 +- Dataplex/src/V1/DeleteEnvironmentRequest.php | 2 +- Dataplex/src/V1/DeleteLakeRequest.php | 2 +- Dataplex/src/V1/DeletePartitionRequest.php | 2 +- Dataplex/src/V1/DeleteTaskRequest.php | 2 +- Dataplex/src/V1/DeleteZoneRequest.php | 2 +- Dataplex/src/V1/DiscoveryEvent.php | 12 +- .../src/V1/DiscoveryEvent/ActionDetails.php | 2 +- .../src/V1/DiscoveryEvent/EntityDetails.php | 4 +- .../V1/DiscoveryEvent/PartitionDetails.php | 6 +- Dataplex/src/V1/Entity.php | 36 +- .../src/V1/Entity/CompatibilityStatus.php | 4 +- .../CompatibilityStatus/Compatibility.php | 4 +- Dataplex/src/V1/Entry.php | 50 +- Dataplex/src/V1/EntryGroup.php | 16 +- Dataplex/src/V1/EntrySource.php | 14 +- Dataplex/src/V1/EntrySource/Ancestor.php | 4 +- Dataplex/src/V1/EntryType.php | 20 +- Dataplex/src/V1/EntryType/AspectInfo.php | 2 +- Dataplex/src/V1/EntryType/Authorization.php | 2 +- Dataplex/src/V1/Environment.php | 22 +- Dataplex/src/V1/Environment/Endpoints.php | 4 +- .../InfrastructureSpec/ComputeResources.php | 6 +- .../InfrastructureSpec/OsImageRuntime.php | 2 +- Dataplex/src/V1/Environment/SessionSpec.php | 4 +- Dataplex/src/V1/Environment/SessionStatus.php | 2 +- .../V1/Gapic/CatalogServiceGapicClient.php | 2607 ---- .../V1/Gapic/ContentServiceGapicClient.php | 972 -- .../V1/Gapic/DataScanServiceGapicClient.php | 1483 --- .../Gapic/DataTaxonomyServiceGapicClient.php | 2028 --- .../V1/Gapic/DataplexServiceGapicClient.php | 3463 ----- .../V1/Gapic/MetadataServiceGapicClient.php | 1307 -- .../V1/GenerateDataQualityRulesRequest.php | 2 +- Dataplex/src/V1/GetAspectTypeRequest.php | 2 +- Dataplex/src/V1/GetAssetRequest.php | 2 +- Dataplex/src/V1/GetContentRequest.php | 4 +- .../src/V1/GetDataAttributeBindingRequest.php | 2 +- Dataplex/src/V1/GetDataAttributeRequest.php | 2 +- Dataplex/src/V1/GetDataScanJobRequest.php | 4 +- Dataplex/src/V1/GetDataScanRequest.php | 4 +- Dataplex/src/V1/GetDataTaxonomyRequest.php | 2 +- Dataplex/src/V1/GetEntityRequest.php | 4 +- Dataplex/src/V1/GetEntryGroupRequest.php | 2 +- Dataplex/src/V1/GetEntryRequest.php | 4 +- Dataplex/src/V1/GetEntryTypeRequest.php | 2 +- Dataplex/src/V1/GetEnvironmentRequest.php | 2 +- Dataplex/src/V1/GetJobRequest.php | 2 +- Dataplex/src/V1/GetLakeRequest.php | 2 +- Dataplex/src/V1/GetPartitionRequest.php | 2 +- Dataplex/src/V1/GetTaskRequest.php | 2 +- Dataplex/src/V1/GetZoneRequest.php | 2 +- Dataplex/src/V1/GovernanceEvent.php | 6 +- Dataplex/src/V1/GovernanceEvent/Entity.php | 4 +- Dataplex/src/V1/Job.php | 22 +- Dataplex/src/V1/JobEvent.php | 20 +- Dataplex/src/V1/Lake.php | 22 +- Dataplex/src/V1/Lake/Metastore.php | 2 +- Dataplex/src/V1/Lake/MetastoreStatus.php | 8 +- Dataplex/src/V1/ListActionsResponse.php | 2 +- Dataplex/src/V1/ListAspectTypesRequest.php | 10 +- Dataplex/src/V1/ListAspectTypesResponse.php | 2 +- Dataplex/src/V1/ListAssetActionsRequest.php | 6 +- Dataplex/src/V1/ListAssetsRequest.php | 10 +- Dataplex/src/V1/ListAssetsResponse.php | 2 +- Dataplex/src/V1/ListContentRequest.php | 8 +- Dataplex/src/V1/ListContentResponse.php | 2 +- .../V1/ListDataAttributeBindingsRequest.php | 10 +- .../V1/ListDataAttributeBindingsResponse.php | 2 +- Dataplex/src/V1/ListDataAttributesRequest.php | 10 +- .../src/V1/ListDataAttributesResponse.php | 2 +- Dataplex/src/V1/ListDataScanJobsRequest.php | 8 +- Dataplex/src/V1/ListDataScanJobsResponse.php | 2 +- Dataplex/src/V1/ListDataScansRequest.php | 10 +- Dataplex/src/V1/ListDataScansResponse.php | 2 +- Dataplex/src/V1/ListDataTaxonomiesRequest.php | 10 +- .../src/V1/ListDataTaxonomiesResponse.php | 2 +- Dataplex/src/V1/ListEntitiesRequest.php | 10 +- Dataplex/src/V1/ListEntitiesResponse.php | 2 +- Dataplex/src/V1/ListEntriesRequest.php | 56 +- Dataplex/src/V1/ListEntriesResponse.php | 2 +- Dataplex/src/V1/ListEntryGroupsRequest.php | 10 +- Dataplex/src/V1/ListEntryGroupsResponse.php | 2 +- Dataplex/src/V1/ListEntryTypesRequest.php | 10 +- Dataplex/src/V1/ListEntryTypesResponse.php | 2 +- Dataplex/src/V1/ListEnvironmentsRequest.php | 10 +- Dataplex/src/V1/ListEnvironmentsResponse.php | 2 +- Dataplex/src/V1/ListJobsRequest.php | 6 +- Dataplex/src/V1/ListJobsResponse.php | 2 +- Dataplex/src/V1/ListLakeActionsRequest.php | 6 +- Dataplex/src/V1/ListLakesRequest.php | 10 +- Dataplex/src/V1/ListLakesResponse.php | 2 +- Dataplex/src/V1/ListPartitionsRequest.php | 8 +- Dataplex/src/V1/ListPartitionsResponse.php | 2 +- Dataplex/src/V1/ListSessionsRequest.php | 8 +- Dataplex/src/V1/ListSessionsResponse.php | 2 +- Dataplex/src/V1/ListTasksRequest.php | 10 +- Dataplex/src/V1/ListTasksResponse.php | 2 +- Dataplex/src/V1/ListZoneActionsRequest.php | 6 +- Dataplex/src/V1/ListZonesRequest.php | 10 +- Dataplex/src/V1/ListZonesResponse.php | 2 +- Dataplex/src/V1/LookupEntryRequest.php | 6 +- Dataplex/src/V1/MetadataServiceClient.php | 34 - Dataplex/src/V1/MetadataServiceGrpcClient.php | 171 - Dataplex/src/V1/OperationMetadata.php | 14 +- Dataplex/src/V1/Partition.php | 4 +- Dataplex/src/V1/RunDataScanRequest.php | 2 +- Dataplex/src/V1/RunDataScanResponse.php | 2 +- Dataplex/src/V1/RunTaskRequest.php | 2 +- Dataplex/src/V1/RunTaskResponse.php | 2 +- .../src/V1/ScannedData/IncrementalField.php | 6 +- Dataplex/src/V1/Schema.php | 4 +- Dataplex/src/V1/Schema/PartitionField.php | 4 +- Dataplex/src/V1/Schema/SchemaField.php | 8 +- Dataplex/src/V1/SearchEntriesRequest.php | 12 +- Dataplex/src/V1/SearchEntriesResponse.php | 4 +- Dataplex/src/V1/SearchEntriesResult.php | 291 +- .../src/V1/SearchEntriesResult/Snippets.php | 2 +- Dataplex/src/V1/Session.php | 8 +- Dataplex/src/V1/SessionEvent.php | 14 +- Dataplex/src/V1/SessionEvent/QueryDetail.php | 12 +- Dataplex/src/V1/StorageAccess.php | 2 +- Dataplex/src/V1/StorageFormat.php | 6 +- Dataplex/src/V1/StorageFormat/CsvOptions.php | 8 +- .../src/V1/StorageFormat/IcebergOptions.php | 2 +- Dataplex/src/V1/StorageFormat/JsonOptions.php | 2 +- Dataplex/src/V1/Task.php | 20 +- Dataplex/src/V1/Task/ExecutionSpec.php | 8 +- Dataplex/src/V1/Task/ExecutionStatus.php | 4 +- .../BatchComputeResources.php | 4 +- .../ContainerImageRuntime.php | 2 +- Dataplex/src/V1/Task/NotebookTaskConfig.php | 4 +- Dataplex/src/V1/Task/SparkTaskConfig.php | 2 +- Dataplex/src/V1/Task/TriggerSpec.php | 8 +- Dataplex/src/V1/Trigger/Schedule.php | 2 +- Dataplex/src/V1/UpdateAspectTypeRequest.php | 6 +- Dataplex/src/V1/UpdateAssetRequest.php | 6 +- Dataplex/src/V1/UpdateContentRequest.php | 6 +- .../V1/UpdateDataAttributeBindingRequest.php | 6 +- .../src/V1/UpdateDataAttributeRequest.php | 6 +- Dataplex/src/V1/UpdateDataScanRequest.php | 6 +- Dataplex/src/V1/UpdateDataTaxonomyRequest.php | 6 +- Dataplex/src/V1/UpdateEntityRequest.php | 4 +- Dataplex/src/V1/UpdateEntryGroupRequest.php | 6 +- Dataplex/src/V1/UpdateEntryRequest.php | 8 +- Dataplex/src/V1/UpdateEntryTypeRequest.php | 6 +- Dataplex/src/V1/UpdateEnvironmentRequest.php | 6 +- Dataplex/src/V1/UpdateLakeRequest.php | 6 +- Dataplex/src/V1/UpdateTaskRequest.php | 6 +- Dataplex/src/V1/UpdateZoneRequest.php | 6 +- Dataplex/src/V1/Zone.php | 22 +- Dataplex/src/V1/Zone/DiscoverySpec.php | 6 +- .../src/V1/Zone/DiscoverySpec/CsvOptions.php | 8 +- .../src/V1/Zone/DiscoverySpec/JsonOptions.php | 4 +- Dataplex/src/V1/Zone/ResourceSpec.php | 2 +- .../Unit/V1/CatalogServiceClientTest.php | 2476 ---- .../V1/Client/CatalogServiceClientTest.php | 575 +- .../V1/Client/ContentServiceClientTest.php | 224 +- .../V1/Client/DataScanServiceClientTest.php | 302 +- .../Client/DataTaxonomyServiceClientTest.php | 485 +- .../V1/Client/DataplexServiceClientTest.php | 825 +- .../V1/Client/MetadataServiceClientTest.php | 352 +- .../Unit/V1/ContentServiceClientTest.php | 731 -- .../Unit/V1/DataScanServiceClientTest.php | 1156 -- .../Unit/V1/DataTaxonomyServiceClientTest.php | 1977 --- .../Unit/V1/DataplexServiceClientTest.php | 3594 ------ .../Unit/V1/MetadataServiceClientTest.php | 1092 -- Dataproc/.repo-metadata.json | 8 - Dataproc/VERSION | 2 +- Dataproc/composer.json | 2 +- DataprocMetastore/.OwlBot.yaml | 2 +- DataprocMetastore/.repo-metadata.json | 8 - DataprocMetastore/README.md | 5 +- DataprocMetastore/VERSION | 2 +- DataprocMetastore/composer.json | 2 +- .../metadata/V1Alpha/Metastore.php | Bin 17839 -> 0 bytes .../metadata/V1Alpha/MetastoreFederation.php | Bin 4900 -> 0 bytes .../metadata/V1Beta/Metastore.php | Bin 17717 -> 0 bytes .../metadata/V1Beta/MetastoreFederation.php | Bin 4870 -> 0 bytes DataprocMetastore/owlbot.py | 53 +- .../AlterMetadataResourceLocationRequest.php | 6 +- .../src/V1/AuxiliaryVersionConfig.php | 4 +- DataprocMetastore/src/V1/BackendMetastore.php | 4 +- .../src/V1/BackendMetastore/MetastoreType.php | 2 - .../src/V1/BackendMetastore_MetastoreType.php | 16 - DataprocMetastore/src/V1/Backup.php | 12 +- DataprocMetastore/src/V1/Backup/State.php | 2 - DataprocMetastore/src/V1/Backup_State.php | 16 - .../src/V1/Client/DataprocMetastoreClient.php | 63 +- .../DataprocMetastoreFederationClient.php | 40 +- .../src/V1/CreateBackupRequest.php | 8 +- .../src/V1/CreateFederationRequest.php | 8 +- .../src/V1/CreateMetadataImportRequest.php | 8 +- .../src/V1/CreateServiceRequest.php | 8 +- .../src/V1/DatabaseDumpSpec/Type.php | 2 - .../src/V1/DatabaseDumpSpec_Type.php | 16 - .../src/V1/DataprocMetastoreClient.php | 34 - .../V1/DataprocMetastoreFederationClient.php | 34 - .../DataprocMetastoreFederationGrpcClient.php | 122 - .../src/V1/DataprocMetastoreGrpcClient.php | 277 - .../src/V1/DeleteBackupRequest.php | 4 +- .../src/V1/DeleteFederationRequest.php | 4 +- .../src/V1/DeleteServiceRequest.php | 4 +- DataprocMetastore/src/V1/EncryptionConfig.php | 2 +- .../src/V1/ExportMetadataRequest.php | 6 +- DataprocMetastore/src/V1/Federation.php | 16 +- DataprocMetastore/src/V1/Federation/State.php | 2 - DataprocMetastore/src/V1/Federation_State.php | 16 - ...DataprocMetastoreFederationGapicClient.php | 1048 -- .../V1/Gapic/DataprocMetastoreGapicClient.php | 2249 ---- DataprocMetastore/src/V1/GetBackupRequest.php | 2 +- .../src/V1/GetFederationRequest.php | 2 +- .../src/V1/GetMetadataImportRequest.php | 2 +- .../src/V1/GetServiceRequest.php | 2 +- .../src/V1/HiveMetastoreConfig.php | 6 +- .../HiveMetastoreConfig/EndpointProtocol.php | 2 - DataprocMetastore/src/V1/KerberosConfig.php | 6 +- .../src/V1/ListBackupsRequest.php | 10 +- .../src/V1/ListBackupsResponse.php | 2 +- .../src/V1/ListFederationsRequest.php | 10 +- .../src/V1/ListFederationsResponse.php | 2 +- .../src/V1/ListMetadataImportsRequest.php | 10 +- .../src/V1/ListMetadataImportsResponse.php | 2 +- .../src/V1/ListServicesRequest.php | 10 +- .../src/V1/ListServicesResponse.php | 2 +- .../LocationMetadata/HiveMetastoreVersion.php | 6 +- .../LocationMetadata_HiveMetastoreVersion.php | 16 - .../src/V1/MaintenanceWindow.php | 8 +- DataprocMetastore/src/V1/MetadataExport.php | 8 +- .../src/V1/MetadataExport/State.php | 2 - .../src/V1/MetadataExport_State.php | 16 - DataprocMetastore/src/V1/MetadataImport.php | 12 +- .../src/V1/MetadataImport/DatabaseDump.php | 6 +- .../DatabaseDump/DatabaseType.php | 2 - .../src/V1/MetadataImport/State.php | 2 - .../src/V1/MetadataImport_DatabaseDump.php | 16 - ...tadataImport_DatabaseDump_DatabaseType.php | 16 - .../src/V1/MetadataImport_State.php | 16 - .../src/V1/MoveTableToDatabaseRequest.php | 8 +- .../src/V1/NetworkConfig/Consumer.php | 6 +- .../src/V1/NetworkConfig_Consumer.php | 16 - .../src/V1/OperationMetadata.php | 14 +- .../src/V1/QueryMetadataRequest.php | 4 +- .../src/V1/QueryMetadataResponse.php | 2 +- DataprocMetastore/src/V1/Restore.php | 12 +- .../src/V1/Restore/RestoreType.php | 2 - DataprocMetastore/src/V1/Restore/State.php | 2 - .../src/V1/RestoreServiceRequest.php | 8 +- .../src/V1/Restore_RestoreType.php | 16 - DataprocMetastore/src/V1/Restore_State.php | 16 - .../src/V1/ScalingConfig/InstanceSize.php | 2 - .../src/V1/ScalingConfig_InstanceSize.php | 16 - DataprocMetastore/src/V1/Service.php | 38 +- .../src/V1/Service/DatabaseType.php | 2 - .../src/V1/Service/ReleaseChannel.php | 2 - DataprocMetastore/src/V1/Service/State.php | 2 - DataprocMetastore/src/V1/Service/Tier.php | 2 - .../src/V1/Service_DatabaseType.php | 16 - .../src/V1/Service_ReleaseChannel.php | 16 - DataprocMetastore/src/V1/Service_State.php | 16 - DataprocMetastore/src/V1/Service_Tier.php | 16 - DataprocMetastore/src/V1/TelemetryConfig.php | 2 +- .../src/V1/TelemetryConfig/LogFormat.php | 2 - .../src/V1/TelemetryConfig_LogFormat.php | 16 - .../src/V1/UpdateFederationRequest.php | 6 +- .../src/V1/UpdateMetadataImportRequest.php | 6 +- .../src/V1/UpdateServiceRequest.php | 6 +- .../AlterMetadataResourceLocationRequest.php | 164 - .../AlterMetadataResourceLocationResponse.php | 34 - .../src/V1alpha/AuxiliaryVersionConfig.php | 169 - .../src/V1alpha/BackendMetastore.php | 125 - .../BackendMetastore/MetastoreType.php | 71 - .../BackendMetastore_MetastoreType.php | 16 - DataprocMetastore/src/V1alpha/Backup.php | 305 - .../src/V1alpha/Backup/State.php | 85 - .../src/V1alpha/Backup_State.php | 16 - .../src/V1alpha/CreateBackupRequest.php | 244 - .../src/V1alpha/CreateFederationRequest.php | 247 - .../V1alpha/CreateMetadataImportRequest.php | 248 - .../src/V1alpha/CreateServiceRequest.php | 248 - .../src/V1alpha/DataCatalogConfig.php | 72 - .../src/V1alpha/DatabaseDumpSpec.php | 33 - .../src/V1alpha/DatabaseDumpSpec/Type.php | 64 - .../src/V1alpha/DatabaseDumpSpec_Type.php | 16 - .../src/V1alpha/DataplexConfig.php | 76 - .../src/V1alpha/DataprocMetastoreClient.php | 36 - .../DataprocMetastoreFederationClient.php | 36 - .../DataprocMetastoreFederationGrpcClient.php | 122 - .../V1alpha/DataprocMetastoreGrpcClient.php | 340 - .../src/V1alpha/DeleteBackupRequest.php | 146 - .../src/V1alpha/DeleteFederationRequest.php | 145 - .../src/V1alpha/DeleteServiceRequest.php | 146 - .../src/V1alpha/EncryptionConfig.php | 75 - .../src/V1alpha/ErrorDetails.php | 76 - .../src/V1alpha/ExportMetadataRequest.php | 232 - DataprocMetastore/src/V1alpha/Federation.php | 433 - .../src/V1alpha/Federation/State.php | 87 - .../src/V1alpha/Federation_State.php | 16 - ...DataprocMetastoreFederationGapicClient.php | 1084 -- .../Gapic/DataprocMetastoreGapicClient.php | 2408 ---- .../src/V1alpha/GetBackupRequest.php | 76 - .../src/V1alpha/GetFederationRequest.php | 75 - .../src/V1alpha/GetMetadataImportRequest.php | 76 - .../src/V1alpha/GetServiceRequest.php | 76 - .../src/V1alpha/HiveMetastoreConfig.php | 278 - .../HiveMetastoreConfig/EndpointProtocol.php | 64 - .../HiveMetastoreConfig_EndpointProtocol.php | 16 - .../src/V1alpha/KerberosConfig.php | 165 - DataprocMetastore/src/V1alpha/Lake.php | 75 - .../src/V1alpha/ListBackupsRequest.php | 252 - .../src/V1alpha/ListBackupsResponse.php | 140 - .../src/V1alpha/ListFederationsRequest.php | 251 - .../src/V1alpha/ListFederationsResponse.php | 139 - .../V1alpha/ListMetadataImportsRequest.php | 252 - .../V1alpha/ListMetadataImportsResponse.php | 140 - .../src/V1alpha/ListServicesRequest.php | 256 - .../src/V1alpha/ListServicesResponse.php | 140 - .../src/V1alpha/LocationMetadata.php | 75 - .../LocationMetadata/HiveMetastoreVersion.php | 108 - .../LocationMetadata_HiveMetastoreVersion.php | 16 - .../src/V1alpha/MaintenanceWindow.php | 139 - .../src/V1alpha/MetadataExport.php | 240 - .../src/V1alpha/MetadataExport/State.php | 78 - .../src/V1alpha/MetadataExport_State.php | 16 - .../src/V1alpha/MetadataImport.php | 313 - .../V1alpha/MetadataImport/DatabaseDump.php | 191 - .../DatabaseDump/DatabaseType.php | 57 - .../src/V1alpha/MetadataImport/State.php | 79 - .../V1alpha/MetadataImport_DatabaseDump.php | 16 - ...tadataImport_DatabaseDump_DatabaseType.php | 16 - .../src/V1alpha/MetadataImport_State.php | 16 - .../src/V1alpha/MetadataIntegration.php | 121 - .../V1alpha/MetadataManagementActivity.php | 101 - .../V1alpha/MoveTableToDatabaseRequest.php | 178 - .../V1alpha/MoveTableToDatabaseResponse.php | 34 - .../src/V1alpha/NetworkConfig.php | 110 - .../src/V1alpha/NetworkConfig/Consumer.php | 173 - .../src/V1alpha/NetworkConfig_Consumer.php | 16 - .../src/V1alpha/OperationMetadata.php | 307 - .../src/V1alpha/QueryMetadataRequest.php | 114 - .../src/V1alpha/QueryMetadataResponse.php | 80 - .../src/V1alpha/RemoveIamPolicyRequest.php | 122 - .../src/V1alpha/RemoveIamPolicyResponse.php | 68 - DataprocMetastore/src/V1alpha/Restore.php | 269 - .../src/V1alpha/Restore/RestoreType.php | 64 - .../src/V1alpha/Restore/State.php | 78 - .../src/V1alpha/RestoreServiceRequest.php | 221 - .../src/V1alpha/Restore_RestoreType.php | 16 - .../src/V1alpha/Restore_State.php | 16 - .../src/V1alpha/ScalingConfig.php | 114 - .../V1alpha/ScalingConfig/InstanceSize.php | 85 - .../V1alpha/ScalingConfig_InstanceSize.php | 16 - DataprocMetastore/src/V1alpha/Secret.php | 81 - DataprocMetastore/src/V1alpha/Service.php | 942 -- .../src/V1alpha/Service/DatabaseType.php | 64 - .../src/V1alpha/Service/ReleaseChannel.php | 69 - .../src/V1alpha/Service/State.php | 102 - .../src/V1alpha/Service/Tier.php | 66 - .../src/V1alpha/Service_DatabaseType.php | 16 - .../src/V1alpha/Service_ReleaseChannel.php | 16 - .../src/V1alpha/Service_State.php | 16 - .../src/V1alpha/Service_Tier.php | 16 - .../src/V1alpha/TelemetryConfig.php | 67 - .../src/V1alpha/TelemetryConfig/LogFormat.php | 62 - .../src/V1alpha/TelemetryConfig_LogFormat.php | 16 - .../src/V1alpha/UpdateFederationRequest.php | 215 - .../V1alpha/UpdateMetadataImportRequest.php | 216 - .../src/V1alpha/UpdateServiceRequest.php | 216 - .../src/V1alpha/gapic_metadata.json | 197 - .../dataproc_metastore_client_config.json | 164 - .../dataproc_metastore_descriptor_config.php | 201 - ...oc_metastore_federation_client_config.json | 72 - ...metastore_federation_descriptor_config.php | 91 - ...etastore_federation_rest_client_config.php | 263 - .../dataproc_metastore_rest_client_config.php | 436 - .../AlterMetadataResourceLocationRequest.php | 164 - .../AlterMetadataResourceLocationResponse.php | 34 - .../src/V1beta/AuxiliaryVersionConfig.php | 169 - .../src/V1beta/BackendMetastore.php | 125 - .../V1beta/BackendMetastore/MetastoreType.php | 71 - .../V1beta/BackendMetastore_MetastoreType.php | 16 - DataprocMetastore/src/V1beta/Backup.php | 305 - DataprocMetastore/src/V1beta/Backup/State.php | 85 - DataprocMetastore/src/V1beta/Backup_State.php | 16 - .../src/V1beta/CreateBackupRequest.php | 244 - .../src/V1beta/CreateFederationRequest.php | 247 - .../V1beta/CreateMetadataImportRequest.php | 248 - .../src/V1beta/CreateServiceRequest.php | 248 - .../src/V1beta/DataCatalogConfig.php | 72 - .../src/V1beta/DatabaseDumpSpec.php | 33 - .../src/V1beta/DatabaseDumpSpec/Type.php | 64 - .../src/V1beta/DatabaseDumpSpec_Type.php | 16 - .../src/V1beta/DataplexConfig.php | 76 - .../src/V1beta/DataprocMetastoreClient.php | 36 - .../DataprocMetastoreFederationClient.php | 36 - .../DataprocMetastoreFederationGrpcClient.php | 122 - .../V1beta/DataprocMetastoreGrpcClient.php | 340 - .../src/V1beta/DeleteBackupRequest.php | 146 - .../src/V1beta/DeleteFederationRequest.php | 145 - .../src/V1beta/DeleteServiceRequest.php | 146 - .../src/V1beta/EncryptionConfig.php | 75 - DataprocMetastore/src/V1beta/ErrorDetails.php | 76 - .../src/V1beta/ExportMetadataRequest.php | 232 - DataprocMetastore/src/V1beta/Federation.php | 433 - .../src/V1beta/Federation/State.php | 87 - .../src/V1beta/Federation_State.php | 16 - ...DataprocMetastoreFederationGapicClient.php | 1084 -- .../Gapic/DataprocMetastoreGapicClient.php | 2408 ---- .../src/V1beta/GetBackupRequest.php | 76 - .../src/V1beta/GetFederationRequest.php | 75 - .../src/V1beta/GetMetadataImportRequest.php | 76 - .../src/V1beta/GetServiceRequest.php | 76 - .../src/V1beta/HiveMetastoreConfig.php | 278 - .../HiveMetastoreConfig/EndpointProtocol.php | 64 - .../HiveMetastoreConfig_EndpointProtocol.php | 16 - .../src/V1beta/KerberosConfig.php | 165 - DataprocMetastore/src/V1beta/Lake.php | 75 - .../src/V1beta/ListBackupsRequest.php | 252 - .../src/V1beta/ListBackupsResponse.php | 140 - .../src/V1beta/ListFederationsRequest.php | 251 - .../src/V1beta/ListFederationsResponse.php | 139 - .../src/V1beta/ListMetadataImportsRequest.php | 252 - .../V1beta/ListMetadataImportsResponse.php | 140 - .../src/V1beta/ListServicesRequest.php | 256 - .../src/V1beta/ListServicesResponse.php | 140 - .../src/V1beta/LocationMetadata.php | 75 - .../LocationMetadata/HiveMetastoreVersion.php | 108 - .../LocationMetadata_HiveMetastoreVersion.php | 16 - .../src/V1beta/MaintenanceWindow.php | 139 - .../src/V1beta/MetadataExport.php | 240 - .../src/V1beta/MetadataExport/State.php | 78 - .../src/V1beta/MetadataExport_State.php | 16 - .../src/V1beta/MetadataImport.php | 313 - .../V1beta/MetadataImport/DatabaseDump.php | 191 - .../DatabaseDump/DatabaseType.php | 57 - .../src/V1beta/MetadataImport/State.php | 79 - .../V1beta/MetadataImport_DatabaseDump.php | 16 - ...tadataImport_DatabaseDump_DatabaseType.php | 16 - .../src/V1beta/MetadataImport_State.php | 16 - .../src/V1beta/MetadataIntegration.php | 121 - .../src/V1beta/MetadataManagementActivity.php | 101 - .../src/V1beta/MoveTableToDatabaseRequest.php | 178 - .../V1beta/MoveTableToDatabaseResponse.php | 34 - .../src/V1beta/NetworkConfig.php | 110 - .../src/V1beta/NetworkConfig/Consumer.php | 173 - .../src/V1beta/NetworkConfig_Consumer.php | 16 - .../src/V1beta/OperationMetadata.php | 307 - .../src/V1beta/QueryMetadataRequest.php | 114 - .../src/V1beta/QueryMetadataResponse.php | 80 - .../src/V1beta/RemoveIamPolicyRequest.php | 122 - .../src/V1beta/RemoveIamPolicyResponse.php | 68 - DataprocMetastore/src/V1beta/Restore.php | 269 - .../src/V1beta/Restore/RestoreType.php | 64 - .../src/V1beta/Restore/State.php | 78 - .../src/V1beta/RestoreServiceRequest.php | 221 - .../src/V1beta/Restore_RestoreType.php | 16 - .../src/V1beta/Restore_State.php | 16 - .../src/V1beta/ScalingConfig.php | 114 - .../src/V1beta/ScalingConfig/InstanceSize.php | 85 - .../src/V1beta/ScalingConfig_InstanceSize.php | 16 - DataprocMetastore/src/V1beta/Secret.php | 81 - DataprocMetastore/src/V1beta/Service.php | 942 -- .../src/V1beta/Service/DatabaseType.php | 64 - .../src/V1beta/Service/ReleaseChannel.php | 69 - .../src/V1beta/Service/State.php | 102 - DataprocMetastore/src/V1beta/Service/Tier.php | 66 - .../src/V1beta/Service_DatabaseType.php | 16 - .../src/V1beta/Service_ReleaseChannel.php | 16 - .../src/V1beta/Service_State.php | 16 - DataprocMetastore/src/V1beta/Service_Tier.php | 16 - .../src/V1beta/TelemetryConfig.php | 67 - .../src/V1beta/TelemetryConfig/LogFormat.php | 62 - .../src/V1beta/TelemetryConfig_LogFormat.php | 16 - .../src/V1beta/UpdateFederationRequest.php | 215 - .../V1beta/UpdateMetadataImportRequest.php | 216 - .../src/V1beta/UpdateServiceRequest.php | 216 - .../src/V1beta/gapic_metadata.json | 197 - .../dataproc_metastore_client_config.json | 164 - .../dataproc_metastore_descriptor_config.php | 201 - ...oc_metastore_federation_client_config.json | 72 - ...metastore_federation_descriptor_config.php | 91 - ...etastore_federation_rest_client_config.php | 263 - .../dataproc_metastore_rest_client_config.php | 436 - .../V1/Client/DataprocMetastoreClientTest.php | 487 +- .../DataprocMetastoreFederationClientTest.php | 234 +- .../Unit/V1/DataprocMetastoreClientTest.php | 2303 ---- .../DataprocMetastoreFederationClientTest.php | 901 -- .../V1alpha/DataprocMetastoreClientTest.php | 2364 ---- .../DataprocMetastoreFederationClientTest.php | 901 -- .../V1beta/DataprocMetastoreClientTest.php | 2364 ---- .../DataprocMetastoreFederationClientTest.php | 901 -- Datastore/.repo-metadata.json | 8 - Datastore/VERSION | 2 +- Datastore/composer.json | 2 +- Datastore/metadata/V1/Datastore.php | Bin 7219 -> 7424 bytes Datastore/src/DatastoreClient.php | 2 +- .../src/V1/Gapic/DatastoreGapicClient.php | 22 + Datastore/src/V1/LookupRequest.php | 56 + Datastore/src/V1/Mutation.php | 68 + Datastore/src/V1/PropertyMask.php | 96 + Datastore/src/V1/RunQueryRequest.php | 56 + DatastoreAdmin/.repo-metadata.json | 8 - DatastoreAdmin/VERSION | 2 +- DatastoreAdmin/composer.json | 2 +- Datastream/.repo-metadata.json | 8 - Datastream/VERSION | 2 +- Datastream/composer.json | 2 +- Debugger/.repo-metadata.json | 8 - Debugger/VERSION | 2 +- Debugger/composer.json | 2 +- Debugger/src/DebuggerClient.php | 2 +- Deploy/.repo-metadata.json | 8 - Deploy/README.md | 5 +- Deploy/VERSION | 2 +- Deploy/composer.json | 2 +- Deploy/metadata/V1/CloudDeploy.php | Bin 43782 -> 43810 bytes Deploy/owlbot.py | 34 +- Deploy/src/V1/AbandonReleaseRequest.php | 2 +- Deploy/src/V1/AdvanceChildRolloutJobRun.php | 12 +- Deploy/src/V1/AdvanceRolloutOperation.php | 8 +- Deploy/src/V1/AdvanceRolloutRequest.php | 4 +- Deploy/src/V1/AdvanceRolloutRule.php | 18 +- Deploy/src/V1/AnthosCluster.php | 24 +- Deploy/src/V1/ApproveRolloutRequest.php | 4 +- Deploy/src/V1/Automation.php | 18 +- Deploy/src/V1/AutomationEvent.php | 8 +- Deploy/src/V1/AutomationRolloutMetadata.php | 2 +- Deploy/src/V1/AutomationRuleCondition.php | 2 +- Deploy/src/V1/AutomationRun.php | 26 +- Deploy/src/V1/AutomationRunEvent.php | 14 +- Deploy/src/V1/BuildArtifact.php | 4 +- Deploy/src/V1/Canary.php | 2 +- Deploy/src/V1/CanaryDeployment.php | 6 +- Deploy/src/V1/CancelAutomationRunRequest.php | 2 +- Deploy/src/V1/CancelRolloutRequest.php | 2 +- Deploy/src/V1/Client/CloudDeployClient.php | 142 +- Deploy/src/V1/CloudDeployClient.php | 34 - Deploy/src/V1/CloudDeployGrpcClient.php | 426 - Deploy/src/V1/CloudRunConfig.php | 2 +- Deploy/src/V1/CloudRunLocation.php | 2 +- Deploy/src/V1/CloudRunMetadata.php | 6 +- Deploy/src/V1/CloudRunRenderMetadata.php | 2 +- Deploy/src/V1/Config.php | 4 +- Deploy/src/V1/CreateAutomationRequest.php | 10 +- Deploy/src/V1/CreateChildRolloutJobRun.php | 12 +- .../src/V1/CreateCustomTargetTypeRequest.php | 10 +- .../src/V1/CreateDeliveryPipelineRequest.php | 10 +- Deploy/src/V1/CreateReleaseRequest.php | 10 +- Deploy/src/V1/CreateRolloutRequest.php | 12 +- Deploy/src/V1/CreateTargetRequest.php | 10 +- .../V1/CustomCanaryDeployment/PhaseConfig.php | 10 +- Deploy/src/V1/CustomTarget.php | 2 +- Deploy/src/V1/CustomTargetDeployMetadata.php | 2 +- Deploy/src/V1/CustomTargetSkaffoldActions.php | 4 +- Deploy/src/V1/CustomTargetType.php | 30 +- Deploy/src/V1/DefaultPool.php | 4 +- Deploy/src/V1/DeleteAutomationRequest.php | 10 +- .../src/V1/DeleteCustomTargetTypeRequest.php | 10 +- .../src/V1/DeleteDeliveryPipelineRequest.php | 12 +- Deploy/src/V1/DeleteTargetRequest.php | 10 +- Deploy/src/V1/DeliveryPipeline.php | 32 +- .../V1/DeliveryPipelineNotificationEvent.php | 8 +- Deploy/src/V1/DeployArtifact.php | 2 +- Deploy/src/V1/DeployJobRun.php | 10 +- Deploy/src/V1/DeployJobRunMetadata.php | 6 +- Deploy/src/V1/DeploymentJobs.php | 8 +- Deploy/src/V1/ExecutionConfig.php | 46 +- .../src/V1/Gapic/CloudDeployGapicClient.php | 4577 ------- Deploy/src/V1/GetAutomationRequest.php | 2 +- Deploy/src/V1/GetAutomationRunRequest.php | 2 +- Deploy/src/V1/GetConfigRequest.php | 2 +- Deploy/src/V1/GetCustomTargetTypeRequest.php | 2 +- Deploy/src/V1/GetDeliveryPipelineRequest.php | 2 +- Deploy/src/V1/GetJobRunRequest.php | 2 +- Deploy/src/V1/GetReleaseRequest.php | 2 +- Deploy/src/V1/GetRolloutRequest.php | 2 +- Deploy/src/V1/GetTargetRequest.php | 2 +- Deploy/src/V1/GkeCluster.php | 18 +- Deploy/src/V1/IgnoreJobRequest.php | 6 +- Deploy/src/V1/Job.php | 8 +- Deploy/src/V1/JobRun.php | 18 +- Deploy/src/V1/JobRunNotificationEvent.php | 18 +- .../KubernetesConfig/GatewayServiceMesh.php | 10 +- .../V1/KubernetesConfig/ServiceNetworking.php | 6 +- Deploy/src/V1/ListAutomationRunsRequest.php | 10 +- Deploy/src/V1/ListAutomationRunsResponse.php | 2 +- Deploy/src/V1/ListAutomationsRequest.php | 10 +- Deploy/src/V1/ListAutomationsResponse.php | 2 +- .../src/V1/ListCustomTargetTypesRequest.php | 10 +- .../src/V1/ListCustomTargetTypesResponse.php | 2 +- .../src/V1/ListDeliveryPipelinesRequest.php | 10 +- .../src/V1/ListDeliveryPipelinesResponse.php | 2 +- Deploy/src/V1/ListJobRunsRequest.php | 10 +- Deploy/src/V1/ListJobRunsResponse.php | 2 +- Deploy/src/V1/ListReleasesRequest.php | 10 +- Deploy/src/V1/ListReleasesResponse.php | 2 +- Deploy/src/V1/ListRolloutsRequest.php | 10 +- Deploy/src/V1/ListRolloutsResponse.php | 2 +- Deploy/src/V1/ListTargetsRequest.php | 10 +- Deploy/src/V1/ListTargetsResponse.php | 2 +- Deploy/src/V1/Metadata.php | 6 +- Deploy/src/V1/OperationMetadata.php | 14 +- Deploy/src/V1/Phase.php | 6 +- Deploy/src/V1/PipelineCondition.php | 6 +- Deploy/src/V1/PipelineReadyCondition.php | 4 +- Deploy/src/V1/PostdeployJobRun.php | 6 +- Deploy/src/V1/PredeployJobRun.php | 6 +- Deploy/src/V1/PrivatePool.php | 6 +- Deploy/src/V1/PromoteReleaseOperation.php | 8 +- Deploy/src/V1/PromoteReleaseRule.php | 22 +- Deploy/src/V1/Release.php | 40 +- Deploy/src/V1/Release/ReleaseCondition.php | 4 +- .../src/V1/Release/ReleaseReadyCondition.php | 2 +- .../V1/Release/SkaffoldSupportedCondition.php | 8 +- Deploy/src/V1/Release/TargetRender.php | 10 +- Deploy/src/V1/ReleaseNotificationEvent.php | 10 +- Deploy/src/V1/ReleaseRenderEvent.php | 10 +- Deploy/src/V1/RenderMetadata.php | 4 +- Deploy/src/V1/RepairRolloutOperation.php | 4 +- Deploy/src/V1/RepairRolloutRule.php | 16 +- Deploy/src/V1/Retry.php | 6 +- Deploy/src/V1/RetryAttempt.php | 8 +- Deploy/src/V1/RetryJobRequest.php | 6 +- Deploy/src/V1/RetryPhase.php | 8 +- Deploy/src/V1/Rollback.php | 2 +- Deploy/src/V1/RollbackAttempt.php | 8 +- Deploy/src/V1/RollbackTargetConfig.php | 4 +- Deploy/src/V1/RollbackTargetRequest.php | 14 +- Deploy/src/V1/RollbackTargetResponse.php | 2 +- Deploy/src/V1/Rollout.php | 56 +- Deploy/src/V1/RolloutNotificationEvent.php | 16 +- Deploy/src/V1/RolloutUpdateEvent.php | 16 +- .../SkaffoldModules/SkaffoldGCBRepoSource.php | 6 +- .../V1/SkaffoldModules/SkaffoldGCSSource.php | 4 +- .../V1/SkaffoldModules/SkaffoldGitSource.php | 6 +- Deploy/src/V1/SkaffoldVersion.php | 8 +- Deploy/src/V1/Stage.php | 4 +- Deploy/src/V1/Standard.php | 6 +- Deploy/src/V1/Target.php | 28 +- Deploy/src/V1/TargetArtifact.php | 4 +- .../src/V1/TargetArtifact/PhaseArtifact.php | 6 +- Deploy/src/V1/TargetAttribute.php | 2 +- Deploy/src/V1/TargetNotificationEvent.php | 6 +- Deploy/src/V1/TargetsPresentCondition.php | 4 +- Deploy/src/V1/TargetsTypeCondition.php | 4 +- Deploy/src/V1/TerminateJobRunRequest.php | 2 +- Deploy/src/V1/UpdateAutomationRequest.php | 10 +- .../src/V1/UpdateCustomTargetTypeRequest.php | 10 +- .../src/V1/UpdateDeliveryPipelineRequest.php | 10 +- Deploy/src/V1/UpdateTargetRequest.php | 10 +- Deploy/src/V1/VerifyJobRun.php | 10 +- .../Unit/V1/Client/CloudDeployClientTest.php | 1102 +- .../tests/Unit/V1/CloudDeployClientTest.php | 3985 ------ DeveloperConnect/.OwlBot.yaml | 4 + DeveloperConnect/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + DeveloperConnect/CONTRIBUTING.md | 10 + DeveloperConnect/LICENSE | 202 + DeveloperConnect/README.md | 45 + DeveloperConnect/VERSION | 1 + DeveloperConnect/composer.json | 30 + .../metadata/V1/DeveloperConnect.php | Bin 0 -> 11671 bytes DeveloperConnect/owlbot.py | 62 + DeveloperConnect/phpunit.xml.dist | 16 + .../create_connection.php | 90 + .../create_git_repository_link.php | 109 + .../delete_connection.php | 80 + .../delete_git_repository_link.php | 85 + .../fetch_git_hub_installations.php | 79 + .../DeveloperConnectClient/fetch_git_refs.php | 85 + .../fetch_linkable_git_repositories.php | 82 + .../fetch_read_token.php | 77 + .../fetch_read_write_token.php | 77 + .../DeveloperConnectClient/get_connection.php | 71 + .../get_git_repository_link.php | 76 + .../DeveloperConnectClient/get_location.php | 57 + .../list_connections.php | 76 + .../list_git_repository_links.php | 80 + .../DeveloperConnectClient/list_locations.php | 62 + .../update_connection.php | 74 + .../src/V1/Client/DeveloperConnectClient.php | 811 ++ DeveloperConnect/src/V1/Connection.php | 517 + .../src/V1/CreateConnectionRequest.php | 281 + .../src/V1/CreateGitRepositoryLinkRequest.php | 286 + .../src/V1/DeleteConnectionRequest.php | 231 + .../src/V1/DeleteGitRepositoryLinkRequest.php | 231 + .../V1/FetchGitHubInstallationsRequest.php | 86 + .../V1/FetchGitHubInstallationsResponse.php | 71 + .../Installation.php | 136 + .../src/V1/FetchGitRefsRequest.php | 191 + .../src/V1/FetchGitRefsRequest/RefType.php | 62 + .../src/V1/FetchGitRefsResponse.php | 101 + .../FetchLinkableGitRepositoriesRequest.php | 154 + .../FetchLinkableGitRepositoriesResponse.php | 101 + .../src/V1/FetchReadTokenRequest.php | 86 + .../src/V1/FetchReadTokenResponse.php | 153 + .../src/V1/FetchReadWriteTokenRequest.php | 86 + .../src/V1/FetchReadWriteTokenResponse.php | 153 + .../src/V1/GetConnectionRequest.php | 81 + .../src/V1/GetGitRepositoryLinkRequest.php | 81 + DeveloperConnect/src/V1/GitHubConfig.php | 195 + .../src/V1/GitHubConfig/GitHubApp.php | 63 + DeveloperConnect/src/V1/GitRepositoryLink.php | 423 + DeveloperConnect/src/V1/InstallationState.php | 145 + .../src/V1/InstallationState/Stage.php | 77 + .../src/V1/LinkableGitRepository.php | 68 + .../src/V1/ListConnectionsRequest.php | 221 + .../src/V1/ListConnectionsResponse.php | 135 + .../src/V1/ListGitRepositoryLinksRequest.php | 221 + .../src/V1/ListGitRepositoryLinksResponse.php | 135 + DeveloperConnect/src/V1/OAuthCredential.php | 106 + DeveloperConnect/src/V1/OperationMetadata.php | 307 + .../src/V1/UpdateConnectionRequest.php | 314 + DeveloperConnect/src/V1/gapic_metadata.json | 98 + .../developer_connect_client_config.json | 114 + .../developer_connect_descriptor_config.php | 304 + .../developer_connect_rest_client_config.php | 269 + .../V1/Client/DeveloperConnectClientTest.php | 1676 +++ Dialogflow/.repo-metadata.json | 8 - Dialogflow/VERSION | 2 +- Dialogflow/composer.json | 2 +- DialogflowCx/.repo-metadata.json | 8 - DialogflowCx/VERSION | 2 +- DialogflowCx/composer.json | 2 +- DialogflowCx/src/V3/Client/AgentsClient.php | 21 +- .../src/V3/Client/EntityTypesClient.php | 21 +- .../src/V3/Client/EnvironmentsClient.php | 21 +- DialogflowCx/src/V3/Client/FlowsClient.php | 21 +- DialogflowCx/src/V3/Client/IntentsClient.php | 21 +- .../src/V3/Client/TestCasesClient.php | 21 +- DialogflowCx/src/V3/Client/VersionsClient.php | 21 +- .../tests/Unit/V3/Client/AgentsClientTest.php | 2 +- .../Unit/V3/Client/EntityTypesClientTest.php | 2 +- .../Unit/V3/Client/EnvironmentsClientTest.php | 2 +- .../tests/Unit/V3/Client/FlowsClientTest.php | 2 +- .../Unit/V3/Client/IntentsClientTest.php | 2 +- .../Unit/V3/Client/TestCasesClientTest.php | 2 +- .../Unit/V3/Client/VersionsClientTest.php | 2 +- DiscoveryEngine/.repo-metadata.json | 8 - DiscoveryEngine/VERSION | 2 +- DiscoveryEngine/composer.json | 2 +- DiscoveryEngine/metadata/V1/Answer.php | Bin 0 -> 5112 bytes DiscoveryEngine/metadata/V1/Common.php | Bin 2465 -> 3214 bytes DiscoveryEngine/metadata/V1/Control.php | Bin 0 -> 2887 bytes .../metadata/V1/ControlService.php | 64 + .../V1/ConversationalSearchService.php | Bin 5993 -> 13510 bytes DiscoveryEngine/metadata/V1/DataStore.php | Bin 2153 -> 2405 bytes .../metadata/V1/DocumentProcessingConfig.php | Bin 0 -> 2195 bytes DiscoveryEngine/metadata/V1/Engine.php | Bin 2642 -> 2637 bytes .../metadata/V1/GroundedGenerationService.php | Bin 0 -> 2654 bytes DiscoveryEngine/metadata/V1/Grounding.php | 45 + DiscoveryEngine/metadata/V1/Project.php | Bin 0 -> 1876 bytes .../metadata/V1/ProjectService.php | 42 + DiscoveryEngine/metadata/V1/RankService.php | 53 + DiscoveryEngine/metadata/V1/Session.php | Bin 0 -> 1993 bytes .../metadata/V1/SiteSearchEngine.php | Bin 2902 -> 2932 bytes DiscoveryEngine/metadata/V1/UserEvent.php | Bin 3259 -> 3387 bytes .../metadata/V1/UserEventService.php | Bin 3116 -> 3205 bytes DiscoveryEngine/metadata/V1Beta/Answer.php | Bin 5051 -> 5230 bytes DiscoveryEngine/metadata/V1Beta/Common.php | Bin 2830 -> 2936 bytes DiscoveryEngine/metadata/V1Beta/Control.php | Bin 0 -> 2968 bytes .../metadata/V1Beta/ControlService.php | 64 + .../V1Beta/ConversationalSearchService.php | Bin 13836 -> 14030 bytes .../metadata/V1Beta/CustomTuningModel.php | Bin 0 -> 1995 bytes DiscoveryEngine/metadata/V1Beta/Engine.php | Bin 2723 -> 2718 bytes .../V1Beta/GroundedGenerationService.php | Bin 2514 -> 2731 bytes DiscoveryEngine/metadata/V1Beta/Grounding.php | 7 +- DiscoveryEngine/metadata/V1Beta/Project.php | Bin 0 -> 1925 bytes .../metadata/V1Beta/ProjectService.php | 42 + .../metadata/V1Beta/RankService.php | 11 +- .../metadata/V1Beta/SearchTuningService.php | Bin 3047 -> 3672 bytes .../metadata/V1Beta/SiteSearchEngine.php | Bin 2964 -> 2994 bytes DiscoveryEngine/metadata/V1Beta/UserEvent.php | Bin 3344 -> 3472 bytes .../metadata/V1Beta/UserEventService.php | Bin 3221 -> 3314 bytes .../ControlServiceClient/create_control.php | 105 + .../ControlServiceClient/delete_control.php | 78 + .../V1/ControlServiceClient/get_control.php | 77 + .../V1/ControlServiceClient/list_controls.php | 80 + .../ControlServiceClient/update_control.php | 86 + .../answer_query.php | 84 + .../create_session.php | 81 + .../delete_session.php | 78 + .../get_answer.php | 78 + .../get_session.php | 77 + .../list_sessions.php | 82 + .../update_session.php | 63 + .../DocumentServiceClient/create_document.php | 2 +- .../import_documents.php | 2 +- .../check_grounding.php | 76 + .../provision_project.php | 105 + .../samples/V1/RankServiceClient/rank.php | 79 + .../RecommendationServiceClient/recommend.php | 2 +- .../V1/SchemaServiceClient/create_schema.php | 4 +- .../import_user_events.php | 2 +- .../write_user_event.php | 12 +- .../ControlServiceClient/create_control.php | 105 + .../ControlServiceClient/delete_control.php | 78 + .../ControlServiceClient/get_control.php | 77 + .../ControlServiceClient/list_controls.php | 80 + .../ControlServiceClient/update_control.php | 86 + .../DocumentServiceClient/create_document.php | 4 +- .../import_documents.php | 2 +- .../provision_project.php | 105 + .../RecommendationServiceClient/recommend.php | 2 +- .../SchemaServiceClient/create_schema.php | 2 +- .../list_custom_models.php | 78 + .../import_user_events.php | 2 +- .../write_user_event.php | 12 +- DiscoveryEngine/src/V1/Answer.php | 445 + .../src/V1/Answer/AnswerSkippedReason.php | 79 + DiscoveryEngine/src/V1/Answer/Citation.php | 140 + .../src/V1/Answer/CitationSource.php | 68 + .../src/V1/Answer/QueryUnderstandingInfo.php | 68 + .../QueryClassificationInfo.php | 102 + .../QueryClassificationInfo/Type.php | 62 + DiscoveryEngine/src/V1/Answer/Reference.php | 109 + .../src/V1/Answer/Reference/ChunkInfo.php | 190 + .../Reference/ChunkInfo/DocumentMetadata.php | 218 + .../Reference/UnstructuredDocumentInfo.php | 218 + .../UnstructuredDocumentInfo/ChunkContent.php | 102 + DiscoveryEngine/src/V1/Answer/State.php | 69 + DiscoveryEngine/src/V1/Answer/Step.php | 170 + DiscoveryEngine/src/V1/Answer/Step/Action.php | 120 + .../src/V1/Answer/Step/Action/Observation.php | 72 + .../Step/Action/Observation/SearchResult.php | 210 + .../Observation/SearchResult/ChunkInfo.php | 146 + .../Observation/SearchResult/SnippetInfo.php | 102 + .../V1/Answer/Step/Action/SearchAction.php | 68 + DiscoveryEngine/src/V1/Answer/Step/State.php | 69 + DiscoveryEngine/src/V1/AnswerQueryRequest.php | 519 + .../AnswerGenerationSpec.php | 382 + .../AnswerGenerationSpec/ModelSpec.php | 72 + .../AnswerGenerationSpec/PromptSpec.php | 68 + .../QueryUnderstandingSpec.php | 122 + .../QueryClassificationSpec.php | 68 + .../QueryClassificationSpec/Type.php | 62 + .../QueryRephraserSpec.php | 68 + .../RelatedQuestionsSpec.php | 68 + .../src/V1/AnswerQueryRequest/SafetySpec.php | 72 + .../src/V1/AnswerQueryRequest/SearchSpec.php | 109 + .../SearchSpec/SearchParams.php | 310 + .../SearchSpec/SearchResultList.php | 68 + .../SearchResultList/SearchResult.php | 109 + .../SearchResult/ChunkInfo.php | 102 + .../SearchResult/UnstructuredDocumentInfo.php | 238 + .../DocumentContext.php | 102 + .../ExtractiveAnswer.php | 103 + .../ExtractiveSegment.php | 103 + .../src/V1/AnswerQueryResponse.php | 189 + .../src/V1/CheckGroundingRequest.php | 279 + .../src/V1/CheckGroundingResponse.php | 159 + .../src/V1/CheckGroundingResponse/Claim.php | 290 + DiscoveryEngine/src/V1/CheckGroundingSpec.php | 93 + .../src/V1/Client/CompletionServiceClient.php | 21 +- .../src/V1/Client/ControlServiceClient.php | 538 + .../ConversationalSearchServiceClient.php | 542 + .../src/V1/Client/DataStoreServiceClient.php | 90 +- .../src/V1/Client/DocumentServiceClient.php | 23 +- .../src/V1/Client/EngineServiceClient.php | 21 +- .../GroundedGenerationServiceClient.php | 239 + .../src/V1/Client/ProjectServiceClient.php | 295 + .../src/V1/Client/RankServiceClient.php | 237 + .../V1/Client/RecommendationServiceClient.php | 88 + .../src/V1/Client/SchemaServiceClient.php | 21 +- .../Client/SiteSearchEngineServiceClient.php | 21 +- .../src/V1/Client/UserEventServiceClient.php | 45 +- DiscoveryEngine/src/V1/Condition.php | 113 + .../src/V1/Condition/QueryTerm.php | 118 + .../src/V1/Condition/TimeRange.php | 134 + DiscoveryEngine/src/V1/Control.php | 443 + .../src/V1/Control/BoostAction.php | 168 + .../src/V1/Control/FilterAction.php | 131 + .../src/V1/Control/RedirectAction.php | 80 + .../src/V1/Control/SynonymsAction.php | 82 + DiscoveryEngine/src/V1/Conversation.php | 16 +- .../src/V1/CreateControlRequest.php | 194 + .../src/V1/CreateDocumentRequest.php | 10 +- .../src/V1/CreateSchemaRequest.php | 20 +- .../src/V1/CreateSessionRequest.php | 132 + DiscoveryEngine/src/V1/DataStore.php | 44 + .../src/V1/DeleteControlRequest.php | 86 + .../src/V1/DeleteSessionRequest.php | 86 + DiscoveryEngine/src/V1/DocumentInfo.php | 8 +- .../src/V1/DocumentProcessingConfig.php | 198 + .../ParsingConfig.php | 112 + .../ParsingConfig/DigitalParsingConfig.php | 34 + .../ParsingConfig/OcrParsingConfig.php | 115 + DiscoveryEngine/src/V1/Engine.php | 8 +- .../src/V1/Engine/CommonConfig.php | 22 +- DiscoveryEngine/src/V1/FactChunk.php | 181 + DiscoveryEngine/src/V1/FirestoreSource.php | 16 +- DiscoveryEngine/src/V1/GcsSource.php | 16 +- DiscoveryEngine/src/V1/GetAnswerRequest.php | 86 + DiscoveryEngine/src/V1/GetControlRequest.php | 86 + DiscoveryEngine/src/V1/GetSessionRequest.php | 86 + DiscoveryEngine/src/V1/GroundingFact.php | 109 + .../src/V1/ListControlsRequest.php | 218 + .../src/V1/ListControlsResponse.php | 101 + .../src/V1/ListDataStoresRequest.php | 16 +- .../src/V1/ListDocumentsRequest.php | 8 +- DiscoveryEngine/src/V1/ListSchemasRequest.php | 16 +- .../src/V1/ListSessionsRequest.php | 274 + .../src/V1/ListSessionsResponse.php | 101 + DiscoveryEngine/src/V1/Project.php | 213 + .../src/V1/Project/ServiceTerms.php | 264 + .../src/V1/Project/ServiceTerms/State.php | 69 + .../src/V1/ProvisionProjectMetadata.php | 33 + .../src/V1/ProvisionProjectRequest.php | 181 + DiscoveryEngine/src/V1/Query.php | 109 + DiscoveryEngine/src/V1/RankRequest.php | 352 + DiscoveryEngine/src/V1/RankResponse.php | 68 + DiscoveryEngine/src/V1/RankingRecord.php | 202 + DiscoveryEngine/src/V1/RecommendRequest.php | 148 +- .../RecommendationResult.php | 8 +- DiscoveryEngine/src/V1/SearchRequest.php | 64 +- .../src/V1/SearchRequest/DataStoreSpec.php | 4 +- .../src/V1/SearchRequest/FacetSpec.php | 8 +- .../V1/SearchRequest/FacetSpec/FacetKey.php | 8 +- .../V1/SearchRequest/SpellCorrectionSpec.php | 16 +- .../SpellCorrectionSpec/Mode.php | 6 +- .../src/V1/SearchResponse/Facet.php | 8 +- .../src/V1/SearchResponse/SearchResult.php | 8 +- .../src/V1/SearchResponse/Summary.php | 2 +- DiscoveryEngine/src/V1/SearchUseCase.php | 65 + DiscoveryEngine/src/V1/Session.php | 261 + DiscoveryEngine/src/V1/Session/State.php | 55 + DiscoveryEngine/src/V1/Session/Turn.php | 121 + DiscoveryEngine/src/V1/TargetSite.php | 34 + .../src/V1/UpdateControlRequest.php | 163 + .../src/V1/UpdateDocumentRequest.php | 26 +- .../src/V1/UpdateSchemaRequest.php | 8 +- .../src/V1/UpdateSessionRequest.php | 158 + DiscoveryEngine/src/V1/UserEvent.php | 130 +- .../src/V1/WriteUserEventRequest.php | 78 +- DiscoveryEngine/src/V1/gapic_metadata.json | 111 + .../completion_service_rest_client_config.php | 24 + .../control_service_client_config.json | 59 + .../control_service_descriptor_config.php | 107 + .../control_service_rest_client_config.php | 314 + ...sational_search_service_client_config.json | 35 + ...ional_search_service_descriptor_config.php | 104 + ...onal_search_service_rest_client_config.php | 181 + .../data_store_service_descriptor_config.php | 3 + .../data_store_service_rest_client_config.php | 24 + .../document_service_rest_client_config.php | 24 + .../engine_service_rest_client_config.php | 24 + ...nded_generation_service_client_config.json | 39 + ...d_generation_service_descriptor_config.php | 43 + ..._generation_service_rest_client_config.php | 205 + .../project_service_client_config.json | 39 + .../project_service_descriptor_config.php | 50 + .../project_service_rest_client_config.php | 205 + .../resources/rank_service_client_config.json | 39 + .../rank_service_descriptor_config.php | 43 + .../rank_service_rest_client_config.php | 205 + ...commendation_service_descriptor_config.php | 4 + ...ommendation_service_rest_client_config.php | 24 + .../schema_service_rest_client_config.php | 24 + .../search_service_rest_client_config.php | 24 + ...arch_engine_service_rest_client_config.php | 24 + .../user_event_service_descriptor_config.php | 1 + .../user_event_service_rest_client_config.php | 29 + DiscoveryEngine/src/V1beta/Answer.php | 8 +- .../Reference/ChunkInfo/DocumentMetadata.php | 48 + .../Reference/UnstructuredDocumentInfo.php | 48 + .../src/V1beta/AnswerQueryRequest.php | 16 +- .../AnswerGenerationSpec.php | 56 + .../QueryRephraserSpec.php | 8 +- .../SearchSpec/SearchParams.php | 46 + .../src/V1beta/AnswerQueryResponse.php | 34 + .../src/V1beta/CheckGroundingRequest.php | 98 +- .../V1beta/CheckGroundingResponse/Claim.php | 72 + .../V1beta/Client/CompletionServiceClient.php | 21 +- .../V1beta/Client/ControlServiceClient.php | 572 + .../V1beta/Client/DataStoreServiceClient.php | 21 +- .../V1beta/Client/DocumentServiceClient.php | 23 +- .../src/V1beta/Client/EngineServiceClient.php | 21 +- .../V1beta/Client/ProjectServiceClient.php | 311 + .../Client/RecommendationServiceClient.php | 96 + .../src/V1beta/Client/SchemaServiceClient.php | 21 +- .../Client/SearchTuningServiceClient.php | 54 +- .../Client/SiteSearchEngineServiceClient.php | 21 +- .../V1beta/Client/UserEventServiceClient.php | 47 +- DiscoveryEngine/src/V1beta/Condition.php | 113 + .../src/V1beta/Condition/QueryTerm.php | 118 + .../src/V1beta/Condition/TimeRange.php | 134 + DiscoveryEngine/src/V1beta/Control.php | 448 + .../src/V1beta/Control/BoostAction.php | 168 + .../src/V1beta/Control/FilterAction.php | 131 + .../src/V1beta/Control/RedirectAction.php | 80 + .../src/V1beta/Control/SynonymsAction.php | 82 + DiscoveryEngine/src/V1beta/Conversation.php | 16 +- .../src/V1beta/CreateControlRequest.php | 194 + .../src/V1beta/CreateDocumentRequest.php | 20 +- .../src/V1beta/CreateSchemaRequest.php | 10 +- .../src/V1beta/CustomTuningModel.php | 269 + .../V1beta/CustomTuningModel/ModelState.php | 83 + .../src/V1beta/DeleteControlRequest.php | 86 + DiscoveryEngine/src/V1beta/DocumentInfo.php | 8 +- DiscoveryEngine/src/V1beta/Engine.php | 8 +- .../src/V1beta/Engine/CommonConfig.php | 22 +- DiscoveryEngine/src/V1beta/FactChunk.php | 34 + .../src/V1beta/FirestoreSource.php | 16 +- DiscoveryEngine/src/V1beta/GcsSource.php | 16 +- .../src/V1beta/GetControlRequest.php | 86 + .../src/V1beta/ListControlsRequest.php | 218 + .../src/V1beta/ListControlsResponse.php | 101 + .../src/V1beta/ListCustomModelsRequest.php | 81 + .../src/V1beta/ListCustomModelsResponse.php | 69 + .../src/V1beta/ListDataStoresRequest.php | 16 +- .../src/V1beta/ListDocumentsRequest.php | 8 +- .../src/V1beta/ListSchemasRequest.php | 16 +- DiscoveryEngine/src/V1beta/Project.php | 213 + .../src/V1beta/Project/ServiceTerms.php | 264 + .../src/V1beta/Project/ServiceTerms/State.php | 69 + .../src/V1beta/ProvisionProjectMetadata.php | 33 + .../src/V1beta/ProvisionProjectRequest.php | 181 + DiscoveryEngine/src/V1beta/RankRequest.php | 90 + .../src/V1beta/RecommendRequest.php | 148 +- .../RecommendationResult.php | 8 +- DiscoveryEngine/src/V1beta/SearchRequest.php | 64 +- .../BoostControlSpec/AttributeType.php | 2 +- .../ContentSearchSpec/SummarySpec.php | 20 +- .../V1beta/SearchRequest/DataStoreSpec.php | 4 +- .../src/V1beta/SearchRequest/FacetSpec.php | 8 +- .../SearchRequest/FacetSpec/FacetKey.php | 8 +- .../SearchRequest/SpellCorrectionSpec.php | 16 +- .../SpellCorrectionSpec/Mode.php | 6 +- DiscoveryEngine/src/V1beta/SearchResponse.php | 11 - .../src/V1beta/SearchResponse/Facet.php | 8 +- .../RefinementAttribute.php | 16 +- .../V1beta/SearchResponse/SearchResult.php | 8 +- .../src/V1beta/SearchResponse/Summary.php | 2 +- DiscoveryEngine/src/V1beta/SearchUseCase.php | 65 + DiscoveryEngine/src/V1beta/Session.php | 8 +- DiscoveryEngine/src/V1beta/Session/Turn.php | 8 + DiscoveryEngine/src/V1beta/TargetSite.php | 34 + .../src/V1beta/TrainCustomModelRequest.php | 34 + .../src/V1beta/TrainCustomModelResponse.php | 34 + .../src/V1beta/UpdateControlRequest.php | 163 + .../src/V1beta/UpdateDocumentRequest.php | 30 +- .../src/V1beta/UpdateSchemaRequest.php | 16 +- DiscoveryEngine/src/V1beta/UserEvent.php | 130 +- .../src/V1beta/WriteUserEventRequest.php | 78 +- .../src/V1beta/gapic_metadata.json | 53 + .../completion_service_rest_client_config.php | 19 + .../control_service_client_config.json | 59 + .../control_service_descriptor_config.php | 107 + .../control_service_rest_client_config.php | 301 + ...onal_search_service_rest_client_config.php | 19 + .../data_store_service_rest_client_config.php | 19 + .../document_service_rest_client_config.php | 19 + .../engine_service_rest_client_config.php | 19 + ..._generation_service_rest_client_config.php | 19 + .../project_service_client_config.json | 39 + .../project_service_descriptor_config.php | 50 + .../project_service_rest_client_config.php | 192 + .../rank_service_rest_client_config.php | 19 + ...commendation_service_descriptor_config.php | 4 + ...ommendation_service_rest_client_config.php | 19 + .../schema_service_rest_client_config.php | 19 + .../search_service_rest_client_config.php | 19 + .../search_tuning_service_client_config.json | 5 + ...earch_tuning_service_descriptor_config.php | 12 + ...arch_tuning_service_rest_client_config.php | 30 + ...ving_config_service_rest_client_config.php | 19 + ...arch_engine_service_rest_client_config.php | 19 + .../user_event_service_descriptor_config.php | 1 + .../user_event_service_rest_client_config.php | 24 + .../V1/Client/CompletionServiceClientTest.php | 2 +- .../V1/Client/ControlServiceClientTest.php | 478 + .../ConversationalSearchServiceClientTest.php | 527 +- .../V1/Client/DataStoreServiceClientTest.php | 2 +- .../V1/Client/DocumentServiceClientTest.php | 2 +- .../V1/Client/EngineServiceClientTest.php | 2 +- .../GroundedGenerationServiceClientTest.php | 157 + .../V1/Client/ProjectServiceClientTest.php | 280 + .../Unit/V1/Client/RankServiceClientTest.php | 160 + .../V1/Client/SchemaServiceClientTest.php | 2 +- .../SiteSearchEngineServiceClientTest.php | 8 +- .../V1/Client/UserEventServiceClientTest.php | 6 +- .../Client/CompletionServiceClientTest.php | 2 +- .../Client/ControlServiceClientTest.php | 478 + .../ConversationalSearchServiceClientTest.php | 4 + .../Client/DataStoreServiceClientTest.php | 2 +- .../Client/DocumentServiceClientTest.php | 2 +- .../V1beta/Client/EngineServiceClientTest.php | 2 +- .../Client/ProjectServiceClientTest.php | 280 + .../V1beta/Client/SchemaServiceClientTest.php | 2 +- .../Client/SearchTuningServiceClientTest.php | 135 +- .../SiteSearchEngineServiceClientTest.php | 8 +- .../Client/UserEventServiceClientTest.php | 6 +- Dlp/.repo-metadata.json | 8 - Dlp/VERSION | 2 +- Dlp/composer.json | 2 +- Dlp/metadata/V2/Dlp.php | Bin 66458 -> 72515 bytes Dlp/metadata/V2/Storage.php | Bin 6216 -> 6272 bytes .../V2/DlpServiceClient/create_connection.php | 78 + .../V2/DlpServiceClient/delete_connection.php | 70 + .../delete_table_data_profile.php | 74 + .../V2/DlpServiceClient/get_connection.php | 72 + .../list_column_data_profiles.php | 2 +- .../V2/DlpServiceClient/list_connections.php | 77 + .../list_project_data_profiles.php | 2 +- .../list_table_data_profiles.php | 2 +- .../DlpServiceClient/search_connections.php | 77 + .../V2/DlpServiceClient/update_connection.php | 78 + Dlp/src/V2/AllOtherDatabaseResources.php | 33 + Dlp/src/V2/Client/DlpServiceClient.php | 220 +- Dlp/src/V2/CloudSqlDiscoveryTarget.php | 210 + Dlp/src/V2/CloudSqlIamCredential.php | 36 + Dlp/src/V2/CloudSqlProperties.php | 250 + .../V2/CloudSqlProperties/DatabaseEngine.php | 65 + .../V2/ColumnDataProfile/ColumnDataType.php | 28 + Dlp/src/V2/Connection.php | 186 + Dlp/src/V2/ConnectionState.php | 75 + Dlp/src/V2/CreateConnectionRequest.php | 132 + Dlp/src/V2/DataProfileAction/EventType.php | 10 +- Dlp/src/V2/DataProfileAction/Export.php | 40 +- .../PubSubNotification/DetailLevel.php | 2 +- Dlp/src/V2/DatabaseResourceCollection.php | 76 + Dlp/src/V2/DatabaseResourceReference.php | 181 + Dlp/src/V2/DatabaseResourceRegex.php | 188 + Dlp/src/V2/DatabaseResourceRegexes.php | 80 + Dlp/src/V2/DeleteConnectionRequest.php | 86 + Dlp/src/V2/DeleteTableDataProfileRequest.php | 81 + Dlp/src/V2/DiscoveryBigQueryFilter.php | 39 + Dlp/src/V2/DiscoveryCloudSqlConditions.php | 114 + .../DatabaseEngine.php | 71 + .../DatabaseResourceType.php | 64 + Dlp/src/V2/DiscoveryCloudSqlFilter.php | 155 + .../V2/DiscoveryCloudSqlGenerationCadence.php | 125 + .../SchemaModifiedCadence.php | 112 + .../CloudSqlSchemaModification.php | 64 + Dlp/src/V2/DiscoveryTarget.php | 75 + Dlp/src/V2/Gapic/DlpServiceGapicClient.php | 483 +- Dlp/src/V2/GetConnectionRequest.php | 86 + .../V2/InfoTypeCategory/LocationCategory.php | 35 + .../V2/InspectDataSourceDetails/Result.php | 38 + Dlp/src/V2/JobTrigger.php | 2 +- Dlp/src/V2/ListConnectionsRequest.php | 192 + Dlp/src/V2/ListConnectionsResponse.php | 105 + Dlp/src/V2/ListProjectDataProfilesRequest.php | 8 +- Dlp/src/V2/ListTableDataProfilesRequest.php | 16 +- Dlp/src/V2/ResourceVisibility.php | 9 + Dlp/src/V2/SearchConnectionsRequest.php | 192 + Dlp/src/V2/SearchConnectionsResponse.php | 113 + Dlp/src/V2/SecretManagerCredential.php | 108 + Dlp/src/V2/SecretsDiscoveryTarget.php | 41 + Dlp/src/V2/StorageConfig/TimespanConfig.php | 32 + Dlp/src/V2/TableReference.php | 102 + Dlp/src/V2/UpdateConnectionRequest.php | 174 + Dlp/src/V2/gapic_metadata.json | 35 + .../resources/dlp_service_client_config.json | 35 + .../dlp_service_descriptor_config.php | 101 + .../dlp_service_rest_client_config.php | 91 + .../Unit/V2/Client/DlpServiceClientTest.php | 489 + Dlp/tests/Unit/V2/DlpServiceClientTest.php | 450 + Dms/.repo-metadata.json | 8 - Dms/VERSION | 2 +- Dms/composer.json | 2 +- DocumentAi/.repo-metadata.json | 8 - DocumentAi/VERSION | 2 +- DocumentAi/composer.json | 2 +- DocumentAi/metadata/V1/Document.php | Bin 10542 -> 13032 bytes .../metadata/V1/DocumentProcessorService.php | Bin 16766 -> 17053 bytes DocumentAi/metadata/V1/Processor.php | Bin 3214 -> 3336 bytes .../batch_process_documents.php | 3 +- .../create_processor.php | 9 +- .../evaluate_processor_version.php | 4 +- .../fetch_processor_types.php | 3 +- .../get_evaluation.php | 3 +- .../list_evaluations.php | 4 +- .../list_processor_versions.php | 5 +- .../list_processors.php | 4 +- .../process_document.php | 12 +- .../review_document.php | 5 +- .../set_default_processor_version.php | 15 +- .../train_processor_version.php | 5 +- .../IndividualProcessStatus.php | 36 +- DocumentAi/src/V1/BatchProcessRequest.php | 15 +- .../Client/DocumentProcessorServiceClient.php | 14 +- DocumentAi/src/V1/CreateProcessorRequest.php | 62 +- DocumentAi/src/V1/DeleteProcessorMetadata.php | 3 +- DocumentAi/src/V1/DeleteProcessorRequest.php | 3 +- .../src/V1/DisableProcessorMetadata.php | 3 +- DocumentAi/src/V1/DisableProcessorRequest.php | 3 +- .../src/V1/DisableProcessorResponse.php | 4 +- DocumentAi/src/V1/Document.php | 148 +- .../src/V1/Document/ChunkedDocument.php | 68 + .../src/V1/Document/ChunkedDocument/Chunk.php | 248 + .../ChunkedDocument/Chunk/ChunkPageFooter.php | 112 + .../ChunkedDocument/Chunk/ChunkPageHeader.php | 112 + .../ChunkedDocument/Chunk/ChunkPageSpan.php | 102 + DocumentAi/src/V1/Document/DocumentLayout.php | 69 + .../DocumentLayout/DocumentLayoutBlock.php | 221 + .../DocumentLayoutBlock/LayoutListBlock.php | 106 + .../DocumentLayoutBlock/LayoutListEntry.php | 72 + .../DocumentLayoutBlock/LayoutPageSpan.php | 102 + .../DocumentLayoutBlock/LayoutTableBlock.php | 136 + .../DocumentLayoutBlock/LayoutTableCell.php | 140 + .../DocumentLayoutBlock/LayoutTableRow.php | 68 + .../DocumentLayoutBlock/LayoutTextBlock.php | 148 + DocumentAi/src/V1/Document/Entity.php | 72 +- DocumentAi/src/V1/Document/EntityRelation.php | 3 +- DocumentAi/src/V1/Document/Page.php | 32 +- DocumentAi/src/V1/Document/Page/Block.php | 12 +- .../src/V1/Document/Page/DetectedBarcode.php | 24 +- DocumentAi/src/V1/Document/Page/FormField.php | 32 +- DocumentAi/src/V1/Document/Page/Layout.php | 68 +- DocumentAi/src/V1/Document/Page/Line.php | 12 +- DocumentAi/src/V1/Document/Page/Paragraph.php | 12 +- DocumentAi/src/V1/Document/Page/Symbol.php | 12 +- DocumentAi/src/V1/Document/Page/Table.php | 12 +- .../src/V1/Document/Page/Table/TableCell.php | 12 +- DocumentAi/src/V1/Document/Page/Token.php | 24 +- .../V1/Document/Page/Token/DetectedBreak.php | 3 +- .../src/V1/Document/Page/Token/StyleInfo.php | 72 +- .../src/V1/Document/Page/VisualElement.php | 24 +- DocumentAi/src/V1/Document/PageAnchor.php | 7 +- .../src/V1/Document/PageAnchor/PageRef.php | 80 +- .../PageAnchor/PageRef/LayoutType.php | 27 +- DocumentAi/src/V1/Document/ShardInfo.php | 12 +- DocumentAi/src/V1/Document/Style.php | 12 +- DocumentAi/src/V1/Document/TextAnchor.php | 15 +- .../V1/Document/TextAnchor/TextSegment.php | 36 +- DocumentAi/src/V1/Document/TextChange.php | 20 +- DocumentAi/src/V1/EnableProcessorMetadata.php | 3 +- DocumentAi/src/V1/EnableProcessorRequest.php | 3 +- DocumentAi/src/V1/EnableProcessorResponse.php | 4 +- .../V1/EvaluateProcessorVersionRequest.php | 40 +- .../src/V1/FetchProcessorTypesRequest.php | 5 +- .../src/V1/FetchProcessorTypesResponse.php | 3 +- .../DocumentProcessorServiceGapicClient.php | 93 +- DocumentAi/src/V1/GetEvaluationRequest.php | 15 +- DocumentAi/src/V1/GetProcessorRequest.php | 3 +- DocumentAi/src/V1/GetProcessorTypeRequest.php | 3 +- .../src/V1/GetProcessorVersionRequest.php | 3 +- DocumentAi/src/V1/HumanReviewStatus.php | 32 +- DocumentAi/src/V1/HumanReviewStatus/State.php | 3 +- DocumentAi/src/V1/ListEvaluationsRequest.php | 23 +- .../src/V1/ListProcessorTypesRequest.php | 5 +- .../src/V1/ListProcessorTypesResponse.php | 3 +- .../src/V1/ListProcessorVersionsRequest.php | 25 +- DocumentAi/src/V1/ListProcessorsRequest.php | 20 +- DocumentAi/src/V1/ListProcessorsResponse.php | 3 +- DocumentAi/src/V1/OcrConfig.php | 16 +- DocumentAi/src/V1/ProcessOptions.php | 80 +- .../src/V1/ProcessOptions/LayoutConfig.php | 78 + .../LayoutConfig/ChunkingConfig.php | 106 + DocumentAi/src/V1/ProcessRequest.php | 75 +- DocumentAi/src/V1/ProcessResponse.php | 3 +- DocumentAi/src/V1/Processor.php | 80 +- DocumentAi/src/V1/ProcessorVersion.php | 96 +- .../V1/ReviewDocumentOperationMetadata.php | 3 +- DocumentAi/src/V1/ReviewDocumentRequest.php | 28 +- DocumentAi/src/V1/ReviewDocumentResponse.php | 3 +- .../V1/SetDefaultProcessorVersionRequest.php | 36 +- .../src/V1/TrainProcessorVersionRequest.php | 53 +- .../FoundationModelTuningOptions.php | 40 +- .../InputData.php | 3 +- .../DocumentProcessorServiceClientTest.php | 12 + .../V1/DocumentProcessorServiceClientTest.php | 12 + Domains/.repo-metadata.json | 8 - Domains/VERSION | 2 +- Domains/composer.json | 2 +- Domains/src/V1/Client/DomainsClient.php | 21 +- .../Unit/V1/Client/DomainsClientTest.php | 2 +- EdgeNetwork/.repo-metadata.json | 8 - EdgeNetwork/VERSION | 2 +- EdgeNetwork/composer.json | 2 +- .../src/V1/Client/EdgeNetworkClient.php | 21 +- .../Unit/V1/Client/EdgeNetworkClientTest.php | 2 +- ErrorReporting/.repo-metadata.json | 8 - ErrorReporting/VERSION | 2 +- ErrorReporting/composer.json | 2 +- EssentialContacts/.repo-metadata.json | 8 - EssentialContacts/README.md | 5 +- EssentialContacts/VERSION | 2 +- EssentialContacts/composer.json | 2 +- EssentialContacts/owlbot.py | 53 +- .../Client/EssentialContactsServiceClient.php | 9 +- .../src/V1/ComputeContactsRequest.php | 6 +- .../src/V1/ComputeContactsResponse.php | 2 +- EssentialContacts/src/V1/Contact.php | 10 +- .../src/V1/CreateContactRequest.php | 4 +- .../src/V1/DeleteContactRequest.php | 2 +- .../src/V1/EssentialContactsServiceClient.php | 34 - .../V1/EssentialContactsServiceGrpcClient.php | 144 - .../EssentialContactsServiceGapicClient.php | 829 -- .../src/V1/GetContactRequest.php | 2 +- .../src/V1/ListContactsRequest.php | 6 +- .../src/V1/ListContactsResponse.php | 2 +- .../src/V1/SendTestMessageRequest.php | 4 +- .../src/V1/UpdateContactRequest.php | 4 +- .../EssentialContactsServiceClientTest.php | 187 +- .../V1/EssentialContactsServiceClientTest.php | 547 - Eventarc/.repo-metadata.json | 8 - Eventarc/VERSION | 2 +- Eventarc/composer.json | 2 +- EventarcPublishing/.repo-metadata.json | 8 - EventarcPublishing/VERSION | 2 +- EventarcPublishing/composer.json | 2 +- Filestore/.repo-metadata.json | 8 - Filestore/VERSION | 2 +- Filestore/composer.json | 2 +- Firestore/.repo-metadata.json | 8 - Firestore/VERSION | 2 +- Firestore/composer.json | 2 +- .../metadata/Admin/V1/FirestoreAdmin.php | 21 +- Firestore/metadata/Admin/V1/Operation.php | Bin 3825 -> 4243 bytes .../Admin/V1/BulkDeleteDocumentsMetadata.php | 373 + .../Admin/V1/BulkDeleteDocumentsRequest.php | 193 + .../Admin/V1/BulkDeleteDocumentsResponse.php | 34 + .../Admin/V1/Client/FirestoreAdminClient.php | 37 +- .../src/Admin/V1/ExportDocumentsRequest.php | 12 +- Firestore/src/Admin/V1/Field.php | 88 +- Firestore/src/Admin/V1/Field/IndexConfig.php | 16 +- Firestore/src/Admin/V1/Field/TtlConfig.php | 6 +- .../V1/Gapic/FirestoreAdminGapicClient.php | 143 +- .../src/Admin/V1/ImportDocumentsRequest.php | 8 +- Firestore/src/Admin/V1/Index/IndexField.php | 6 +- .../src/Admin/V1/ListDatabasesRequest.php | 34 + Firestore/src/Admin/V1/ListFieldsRequest.php | 12 +- Firestore/src/Admin/V1/gapic_metadata.json | 5 + .../firestore_admin_client_config.json | 5 + .../firestore_admin_descriptor_config.php | 19 + .../firestore_admin_rest_client_config.php | 12 + Firestore/src/FirestoreClient.php | 2 +- .../V1/Client/FirestoreAdminClientTest.php | 196 +- .../Admin/V1/FirestoreAdminClientTest.php | 118 + Functions/.repo-metadata.json | 8 - Functions/VERSION | 2 +- Functions/composer.json | 2 +- GSuiteAddOns/.repo-metadata.json | 10 - GSuiteAddOns/VERSION | 2 +- GSuiteAddOns/composer.json | 2 +- Gaming/.repo-metadata.json | 8 - Gaming/VERSION | 2 +- Gaming/composer.json | 2 +- GeoCommonProtos/.OwlBot.yaml | 4 + GeoCommonProtos/.gitattributes | 7 + GeoCommonProtos/CONTRIBUTING.md | 10 + GeoCommonProtos/LICENSE | 202 + GeoCommonProtos/README.md | 43 + GeoCommonProtos/VERSION | 1 + GeoCommonProtos/composer.json | 30 + GeoCommonProtos/metadata/Type/Viewport.php | 31 + GeoCommonProtos/owlbot.py | 63 + GeoCommonProtos/phpunit.xml.dist | 16 + GeoCommonProtos/pull_request_template.md | 24 + GeoCommonProtos/src/Type/Viewport.php | 147 + .../tests/Unit/InstantiateClassesTest.php | 61 + GkeBackup/.repo-metadata.json | 8 - GkeBackup/VERSION | 2 +- GkeBackup/composer.json | 2 +- GkeBackup/metadata/V1/Backup.php | Bin 2931 -> 2961 bytes GkeBackup/metadata/V1/BackupPlan.php | Bin 3709 -> 3739 bytes GkeBackup/metadata/V1/Common.php | Bin 1244 -> 1330 bytes GkeBackup/metadata/V1/Restore.php | Bin 4813 -> 6445 bytes GkeBackup/src/V1/Backup.php | 54 + GkeBackup/src/V1/BackupPlan/BackupConfig.php | 46 + GkeBackup/src/V1/ExclusionWindow.php | 24 +- GkeBackup/src/V1/ResourceSelector.php | 232 + GkeBackup/src/V1/Restore.php | 110 + GkeBackup/src/V1/Restore/Filter.php | 126 + GkeBackup/src/V1/RestoreConfig.php | 86 + .../NamespacedResourceRestoreMode.php | 45 + .../src/V1/RestoreConfig/RestoreOrder.php | 77 + .../RestoreOrder/GroupKindDependency.php | 130 + .../VolumeDataRestorePolicyBinding.php | 117 + .../V1/VolumeDataRestorePolicyOverride.php | 113 + GkeBackup/src/V1/VolumeTypeEnum.php | 33 + .../src/V1/VolumeTypeEnum/VolumeType.php | 55 + .../tests/Unit/V1/BackupForGKEClientTest.php | 6 + .../Unit/V1/Client/BackupForGKEClientTest.php | 8 + GkeConnectGateway/.repo-metadata.json | 8 - GkeConnectGateway/VERSION | 2 +- GkeConnectGateway/composer.json | 2 +- GkeHub/.repo-metadata.json | 8 - GkeHub/VERSION | 2 +- GkeHub/composer.json | 2 +- GkeHub/src/V1/Client/GkeHubClient.php | 21 +- .../tests/Unit/V1/Client/GkeHubClientTest.php | 2 +- GkeMultiCloud/.repo-metadata.json | 8 - GkeMultiCloud/VERSION | 2 +- GkeMultiCloud/composer.json | 2 +- GkeMultiCloud/metadata/V1/AzureService.php | 12 +- .../create_aws_node_pool.php | 4 +- .../update_aws_node_pool.php | 4 +- .../get_azure_json_web_keys.php | 2 +- GkeMultiCloud/src/V1/AwsNodeConfig.php | 16 +- .../src/V1/DeleteAzureClusterRequest.php | 46 + .../src/V1/DeleteAzureNodePoolRequest.php | 46 + .../src/V1/Gapic/AzureClustersGapicClient.php | 20 +- .../src/V1/GetAzureJsonWebKeysRequest.php | 10 +- Grafeas/.repo-metadata.json | 8 - Grafeas/VERSION | 2 +- Grafeas/composer.json | 2 +- Iam/.repo-metadata.json | 10 - Iam/VERSION | 2 +- Iam/composer.json | 2 +- IamCredentials/.repo-metadata.json | 8 - IamCredentials/VERSION | 2 +- IamCredentials/composer.json | 2 +- Iap/.repo-metadata.json | 8 - Iap/VERSION | 2 +- Iap/composer.json | 2 +- Ids/.repo-metadata.json | 8 - Ids/README.md | 5 +- Ids/VERSION | 2 +- Ids/composer.json | 2 +- Ids/owlbot.py | 40 +- Ids/src/V1/Client/IDSClient.php | 31 +- Ids/src/V1/CreateEndpointRequest.php | 8 +- Ids/src/V1/DeleteEndpointRequest.php | 4 +- Ids/src/V1/Endpoint.php | 20 +- Ids/src/V1/Gapic/IDSGapicClient.php | 701 - Ids/src/V1/GetEndpointRequest.php | 2 +- Ids/src/V1/IDSClient.php | 34 - Ids/src/V1/IDSGrpcClient.php | 95 - Ids/src/V1/ListEndpointsRequest.php | 10 +- Ids/src/V1/ListEndpointsResponse.php | 2 +- Ids/src/V1/OperationMetadata.php | 14 +- Ids/tests/Unit/V1/Client/IDSClientTest.php | 90 +- Ids/tests/Unit/V1/IDSClientTest.php | 468 - Iot/.repo-metadata.json | 8 - Iot/VERSION | 2 +- Iot/composer.json | 2 +- Kms/.repo-metadata.json | 8 - Kms/VERSION | 2 +- Kms/composer.json | 2 +- Kms/metadata/V1/Autokey.php | 61 + Kms/metadata/V1/AutokeyAdmin.php | 51 + Kms/metadata/V1/Resources.php | Bin 7052 -> 7073 bytes .../AutokeyAdminClient/get_autokey_config.php | 73 + .../V1/AutokeyAdminClient/get_iam_policy.php | 72 + .../V1/AutokeyAdminClient/get_location.php | 57 + .../V1/AutokeyAdminClient/list_locations.php | 62 + .../V1/AutokeyAdminClient/set_iam_policy.php | 77 + .../show_effective_autokey_config.php | 73 + .../test_iam_permissions.php | 84 + .../update_autokey_config.php | 68 + .../V1/AutokeyClient/create_key_handle.php | 101 + .../V1/AutokeyClient/get_iam_policy.php | 72 + .../V1/AutokeyClient/get_key_handle.php | 73 + Kms/samples/V1/AutokeyClient/get_location.php | 57 + .../V1/AutokeyClient/list_key_handles.php | 73 + .../V1/AutokeyClient/list_locations.php | 62 + .../V1/AutokeyClient/set_iam_policy.php | 77 + .../V1/AutokeyClient/test_iam_permissions.php | 84 + Kms/src/V1/AutokeyAdminClient.php | 34 + Kms/src/V1/AutokeyClient.php | 34 + Kms/src/V1/AutokeyConfig.php | 145 + Kms/src/V1/Client/AutokeyAdminClient.php | 478 + Kms/src/V1/Client/AutokeyClient.php | 549 + Kms/src/V1/CreateKeyHandleMetadata.php | 35 + Kms/src/V1/CreateKeyHandleRequest.php | 184 + .../CryptoKeyVersionAlgorithm.php | 7 + Kms/src/V1/Gapic/AutokeyAdminGapicClient.php | 710 ++ Kms/src/V1/Gapic/AutokeyGapicClient.php | 861 ++ Kms/src/V1/GetAutokeyConfigRequest.php | 87 + Kms/src/V1/GetKeyHandleRequest.php | 91 + Kms/src/V1/KeyHandle.php | 196 + Kms/src/V1/ListKeyHandlesRequest.php | 134 + Kms/src/V1/ListKeyHandlesResponse.php | 68 + .../V1/ShowEffectiveAutokeyConfigRequest.php | 92 + .../V1/ShowEffectiveAutokeyConfigResponse.php | 72 + Kms/src/V1/UpdateAutokeyConfigRequest.php | 152 + Kms/src/V1/gapic_metadata.json | 98 + .../autokey_admin_client_config.json | 75 + .../autokey_admin_descriptor_config.php | 142 + .../autokey_admin_rest_client_config.php | 203 + .../V1/resources/autokey_client_config.json | 85 + .../resources/autokey_descriptor_config.php | 149 + .../resources/autokey_rest_client_config.php | 199 + .../resources/ekm_service_client_config.json | 75 +- .../ekm_service_rest_client_config.php | 13 + .../key_management_service_client_config.json | 169 +- ..._management_service_rest_client_config.php | 13 + Kms/tests/Unit/V1/AutokeyAdminClientTest.php | 565 + Kms/tests/Unit/V1/AutokeyClientTest.php | 633 + .../Unit/V1/Client/AutokeyAdminClientTest.php | 638 + .../Unit/V1/Client/AutokeyClientTest.php | 751 ++ KmsInventory/.repo-metadata.json | 8 - KmsInventory/VERSION | 2 +- KmsInventory/composer.json | 2 +- Language/.repo-metadata.json | 8 - Language/VERSION | 2 +- Language/composer.json | 2 +- Language/src/LanguageClient.php | 2 +- LifeSciences/.repo-metadata.json | 8 - LifeSciences/VERSION | 2 +- LifeSciences/composer.json | 2 +- Logging/.repo-metadata.json | 8 - Logging/VERSION | 2 +- Logging/composer.json | 2 +- Logging/src/LoggingClient.php | 2 +- LongRunning/.repo-metadata.json | 8 - LongRunning/VERSION | 2 +- LongRunning/composer.json | 4 +- ManagedIdentities/.repo-metadata.json | 8 - ManagedIdentities/VERSION | 2 +- ManagedIdentities/composer.json | 2 +- ManagedKafka/.OwlBot.yaml | 4 + ManagedKafka/.gitattributes | 7 + ManagedKafka/.github/pull_request_template.md | 24 + ManagedKafka/CONTRIBUTING.md | 10 + ManagedKafka/LICENSE | 202 + ManagedKafka/README.md | 45 + ManagedKafka/VERSION | 1 + ManagedKafka/composer.json | 30 + ManagedKafka/metadata/V1/ManagedKafka.php | 125 + ManagedKafka/metadata/V1/Resources.php | Bin 0 -> 3792 bytes ManagedKafka/owlbot.py | 56 + ManagedKafka/phpunit.xml.dist | 16 + .../V1/ManagedKafkaClient/create_cluster.php | 138 + .../V1/ManagedKafkaClient/create_topic.php | 95 + .../V1/ManagedKafkaClient/delete_cluster.php | 80 + .../delete_consumer_group.php | 75 + .../V1/ManagedKafkaClient/delete_topic.php | 70 + .../V1/ManagedKafkaClient/get_cluster.php | 71 + .../ManagedKafkaClient/get_consumer_group.php | 77 + .../V1/ManagedKafkaClient/get_location.php | 57 + .../V1/ManagedKafkaClient/get_topic.php | 73 + .../V1/ManagedKafkaClient/list_clusters.php | 77 + .../list_consumer_groups.php | 78 + .../V1/ManagedKafkaClient/list_locations.php | 62 + .../V1/ManagedKafkaClient/list_topics.php | 77 + .../V1/ManagedKafkaClient/update_cluster.php | 124 + .../update_consumer_group.php | 62 + .../V1/ManagedKafkaClient/update_topic.php | 82 + ManagedKafka/src/V1/AccessConfig.php | 75 + ManagedKafka/src/V1/CapacityConfig.php | 109 + .../src/V1/Client/ManagedKafkaClient.php | 802 ++ ManagedKafka/src/V1/Cluster.php | 360 + ManagedKafka/src/V1/Cluster/State.php | 69 + ManagedKafka/src/V1/ConsumerGroup.php | 117 + .../src/V1/ConsumerPartitionMetadata.php | 109 + ManagedKafka/src/V1/ConsumerTopicMetadata.php | 71 + ManagedKafka/src/V1/CreateClusterRequest.php | 272 + ManagedKafka/src/V1/CreateTopicRequest.php | 189 + ManagedKafka/src/V1/DeleteClusterRequest.php | 159 + .../src/V1/DeleteConsumerGroupRequest.php | 86 + ManagedKafka/src/V1/DeleteTopicRequest.php | 86 + ManagedKafka/src/V1/GcpConfig.php | 132 + ManagedKafka/src/V1/GetClusterRequest.php | 81 + .../src/V1/GetConsumerGroupRequest.php | 86 + ManagedKafka/src/V1/GetTopicRequest.php | 91 + ManagedKafka/src/V1/ListClustersRequest.php | 242 + ManagedKafka/src/V1/ListClustersResponse.php | 139 + .../src/V1/ListConsumerGroupsRequest.php | 179 + .../src/V1/ListConsumerGroupsResponse.php | 109 + ManagedKafka/src/V1/ListTopicsRequest.php | 174 + ManagedKafka/src/V1/ListTopicsResponse.php | 109 + ManagedKafka/src/V1/NetworkConfig.php | 96 + ManagedKafka/src/V1/OperationMetadata.php | 307 + ManagedKafka/src/V1/RebalanceConfig.php | 71 + ManagedKafka/src/V1/RebalanceConfig/Mode.php | 63 + ManagedKafka/src/V1/Topic.php | 201 + ManagedKafka/src/V1/UpdateClusterRequest.php | 234 + .../src/V1/UpdateConsumerGroupRequest.php | 156 + ManagedKafka/src/V1/UpdateTopicRequest.php | 156 + ManagedKafka/src/V1/gapic_metadata.json | 98 + .../managed_kafka_client_config.json | 124 + .../managed_kafka_descriptor_config.php | 285 + .../managed_kafka_rest_client_config.php | 277 + .../Unit/V1/Client/ManagedKafkaClientTest.php | 1522 +++ MapsFleetEngine/.OwlBot.yaml | 4 + MapsFleetEngine/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + MapsFleetEngine/CONTRIBUTING.md | 10 + MapsFleetEngine/LICENSE | 202 + MapsFleetEngine/README.md | 45 + MapsFleetEngine/VERSION | 1 + MapsFleetEngine/composer.json | 31 + MapsFleetEngine/metadata/V1/Fleetengine.php | Bin 0 -> 4553 bytes MapsFleetEngine/metadata/V1/Header.php | Bin 0 -> 1410 bytes MapsFleetEngine/metadata/V1/Traffic.php | Bin 0 -> 1206 bytes MapsFleetEngine/metadata/V1/TripApi.php | Bin 0 -> 4476 bytes MapsFleetEngine/metadata/V1/Trips.php | Bin 0 -> 4249 bytes MapsFleetEngine/metadata/V1/VehicleApi.php | Bin 0 -> 7420 bytes MapsFleetEngine/metadata/V1/Vehicles.php | Bin 0 -> 4387 bytes MapsFleetEngine/owlbot.py | 62 + MapsFleetEngine/phpunit.xml.dist | 16 + .../V1/TripServiceClient/create_trip.php | 87 + .../samples/V1/TripServiceClient/get_trip.php | 74 + .../report_billable_trip.php | 76 + .../V1/TripServiceClient/search_trips.php | 78 + .../V1/TripServiceClient/update_trip.php | 78 + .../VehicleServiceClient/create_vehicle.php | 116 + .../V1/VehicleServiceClient/get_vehicle.php | 75 + .../V1/VehicleServiceClient/list_vehicles.php | 85 + .../VehicleServiceClient/search_vehicles.php | 120 + .../VehicleServiceClient/update_vehicle.php | 98 + .../update_vehicle_attributes.php | 80 + MapsFleetEngine/src/V1/BatteryInfo.php | 135 + MapsFleetEngine/src/V1/BatteryStatus.php | 82 + .../src/V1/BillingPlatformIdentifier.php | 82 + .../src/V1/Client/TripServiceClient.php | 346 + .../src/V1/Client/VehicleServiceClient.php | 430 + .../src/V1/ConsumableTrafficPolyline.php | 117 + MapsFleetEngine/src/V1/CreateTripRequest.php | 329 + .../src/V1/CreateVehicleRequest.php | 313 + MapsFleetEngine/src/V1/DeviceSettings.php | 183 + MapsFleetEngine/src/V1/GetTripRequest.php | 439 + MapsFleetEngine/src/V1/GetVehicleRequest.php | 243 + MapsFleetEngine/src/V1/LicensePlate.php | 123 + .../src/V1/ListVehiclesRequest.php | 926 ++ .../src/V1/ListVehiclesResponse.php | 151 + .../src/V1/LocationPowerSaveMode.php | 89 + MapsFleetEngine/src/V1/LocationSensor.php | 110 + MapsFleetEngine/src/V1/NavigationStatus.php | 76 + MapsFleetEngine/src/V1/PolylineFormatType.php | 62 + MapsFleetEngine/src/V1/PowerSource.php | 75 + .../src/V1/ReportBillableTripRequest.php | 239 + .../SolutionType.php | 57 + MapsFleetEngine/src/V1/RequestHeader.php | 493 + .../src/V1/RequestHeader/Platform.php | 69 + .../src/V1/RequestHeader/SdkType.php | 69 + MapsFleetEngine/src/V1/SearchTripsRequest.php | 335 + .../src/V1/SearchTripsResponse.php | 109 + .../src/V1/SearchVehiclesRequest.php | 1029 ++ .../CurrentTripsPresent.php | 66 + .../VehicleMatchOrder.php | 88 + .../src/V1/SearchVehiclesResponse.php | 71 + .../src/V1/SpeedReadingInterval.php | 145 + .../src/V1/SpeedReadingInterval/Speed.php | 69 + MapsFleetEngine/src/V1/StopLocation.php | 172 + MapsFleetEngine/src/V1/TerminalLocation.php | 245 + MapsFleetEngine/src/V1/TerminalPointId.php | 159 + .../src/V1/TrafficPolylineData.php | 81 + MapsFleetEngine/src/V1/Trip.php | 1614 +++ MapsFleetEngine/src/V1/TripStatus.php | 111 + MapsFleetEngine/src/V1/TripType.php | 61 + MapsFleetEngine/src/V1/TripView.php | 67 + MapsFleetEngine/src/V1/TripWaypoint.php | 451 + MapsFleetEngine/src/V1/UpdateTripRequest.php | 355 + .../src/V1/UpdateVehicleAttributesRequest.php | 161 + .../V1/UpdateVehicleAttributesResponse.php | 71 + .../src/V1/UpdateVehicleRequest.php | 267 + MapsFleetEngine/src/V1/Vehicle.php | 1108 ++ .../src/V1/Vehicle/VehicleType.php | 68 + .../src/V1/Vehicle/VehicleType/Category.php | 91 + MapsFleetEngine/src/V1/VehicleAttribute.php | 225 + .../src/V1/VehicleAttributeList.php | 67 + MapsFleetEngine/src/V1/VehicleLocation.php | 1789 +++ MapsFleetEngine/src/V1/VehicleMatch.php | 697 + .../src/V1/VehicleMatch/VehicleMatchType.php | 81 + MapsFleetEngine/src/V1/VehicleState.php | 62 + .../VisualTrafficReportPolylineRendering.php | 84 + .../RoadStretch.php | 140 + .../RoadStretch/Style.php | 62 + MapsFleetEngine/src/V1/Waypoint.php | 123 + MapsFleetEngine/src/V1/WaypointType.php | 68 + MapsFleetEngine/src/V1/gapic_metadata.json | 82 + .../resources/trip_service_client_config.json | 59 + .../trip_service_descriptor_config.php | 114 + .../trip_service_rest_client_config.php | 94 + .../vehicle_service_client_config.json | 64 + .../vehicle_service_descriptor_config.php | 129 + .../vehicle_service_rest_client_config.php | 108 + .../Unit/V1/Client/TripServiceClientTest.php | 508 + .../V1/Client/VehicleServiceClientTest.php | 626 + MapsFleetEngineDelivery/.OwlBot.yaml | 4 + MapsFleetEngineDelivery/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + MapsFleetEngineDelivery/CONTRIBUTING.md | 10 + MapsFleetEngineDelivery/LICENSE | 202 + MapsFleetEngineDelivery/README.md | 45 + MapsFleetEngineDelivery/VERSION | 1 + MapsFleetEngineDelivery/composer.json | 31 + .../metadata/V1/Common.php | Bin 0 -> 3677 bytes .../metadata/V1/DeliveryApi.php | 123 + .../metadata/V1/DeliveryVehicles.php | Bin 0 -> 3110 bytes .../metadata/V1/Header.php | Bin 0 -> 1530 bytes .../metadata/V1/TaskTrackingInfo.php | 53 + MapsFleetEngineDelivery/metadata/V1/Tasks.php | Bin 0 -> 4071 bytes MapsFleetEngineDelivery/owlbot.py | 62 + MapsFleetEngineDelivery/phpunit.xml.dist | 16 + .../batch_create_tasks.php | 122 + .../create_delivery_vehicle.php | 84 + .../V1/DeliveryServiceClient/create_task.php | 98 + .../get_delivery_vehicle.php | 74 + .../V1/DeliveryServiceClient/get_task.php | 73 + .../get_task_tracking_info.php | 75 + .../list_delivery_vehicles.php | 78 + .../V1/DeliveryServiceClient/list_tasks.php | 78 + .../update_delivery_vehicle.php | 68 + .../V1/DeliveryServiceClient/update_task.php | 84 + .../src/V1/BatchCreateTasksRequest.php | 177 + .../src/V1/BatchCreateTasksResponse.php | 67 + .../src/V1/Client/DeliveryServiceClient.php | 559 + .../src/V1/CreateDeliveryVehicleRequest.php | 274 + .../src/V1/CreateTaskRequest.php | 304 + .../src/V1/DeliveryRequestHeader.php | 493 + .../src/V1/DeliveryRequestHeader/Platform.php | 69 + .../src/V1/DeliveryRequestHeader/SdkType.php | 69 + .../src/V1/DeliveryVehicle.php | 671 + .../DeliveryVehicle/DeliveryVehicleType.php | 77 + .../src/V1/DeliveryVehicleAttribute.php | 225 + .../src/V1/DeliveryVehicleLocation.php | 1789 +++ .../src/V1/DeliveryVehicleLocationSensor.php | 110 + .../V1/DeliveryVehicleNavigationStatus.php | 76 + .../src/V1/GetDeliveryVehicleRequest.php | 140 + .../src/V1/GetTaskRequest.php | 135 + .../src/V1/GetTaskTrackingInfoRequest.php | 145 + .../src/V1/ListDeliveryVehiclesRequest.php | 365 + .../src/V1/ListDeliveryVehiclesResponse.php | 159 + .../src/V1/ListTasksRequest.php | 273 + .../src/V1/ListTasksResponse.php | 160 + .../src/V1/LocationInfo.php | 77 + MapsFleetEngineDelivery/src/V1/Task.php | 720 ++ .../src/V1/Task/JourneySharingInfo.php | 214 + MapsFleetEngineDelivery/src/V1/Task/State.php | 63 + .../src/V1/Task/TaskOutcome.php | 63 + .../src/V1/Task/TaskOutcomeLocationSource.php | 63 + MapsFleetEngineDelivery/src/V1/Task/Type.php | 85 + .../src/V1/TaskAttribute.php | 176 + .../src/V1/TaskTrackingInfo.php | 698 + .../src/V1/TaskTrackingViewConfig.php | 346 + .../VisibilityOption.php | 227 + MapsFleetEngineDelivery/src/V1/TimeWindow.php | 121 + .../src/V1/UpdateDeliveryVehicleRequest.php | 201 + .../src/V1/UpdateTaskRequest.php | 259 + .../src/V1/VehicleJourneySegment.php | 352 + .../src/V1/VehicleStop.php | 161 + .../src/V1/VehicleStop/State.php | 74 + .../src/V1/VehicleStop/TaskInfo.php | 188 + .../src/V1/gapic_metadata.json | 68 + .../delivery_service_client_config.json | 84 + .../delivery_service_descriptor_config.php | 202 + .../delivery_service_rest_client_config.php | 158 + .../V1/Client/DeliveryServiceClientTest.php | 863 ++ MapsRouteOptimization/.OwlBot.yaml | 4 + MapsRouteOptimization/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + MapsRouteOptimization/CONTRIBUTING.md | 10 + MapsRouteOptimization/LICENSE | 202 + MapsRouteOptimization/README.md | 45 + MapsRouteOptimization/VERSION | 1 + MapsRouteOptimization/composer.json | 30 + .../metadata/V1/RouteOptimizationService.php | Bin 0 -> 17092 bytes MapsRouteOptimization/owlbot.py | 62 + MapsRouteOptimization/phpunit.xml.dist | 16 + .../batch_optimize_tours.php | 121 + .../optimize_tours.php | 89 + .../src/V1/AggregatedMetrics.php | 454 + .../src/V1/BatchOptimizeToursMetadata.php | 33 + .../src/V1/BatchOptimizeToursRequest.php | 125 + .../AsyncModelConfig.php | 160 + .../src/V1/BatchOptimizeToursResponse.php | 34 + MapsRouteOptimization/src/V1/BreakRule.php | 113 + .../src/V1/BreakRule/BreakRequest.php | 170 + .../src/V1/BreakRule/FrequencyConstraint.php | 164 + .../src/V1/Client/RouteOptimizationClient.php | 311 + MapsRouteOptimization/src/V1/DataFormat.php | 62 + .../src/V1/DistanceLimit.php | 216 + .../src/V1/GcsDestination.php | 68 + MapsRouteOptimization/src/V1/GcsSource.php | 71 + .../src/V1/InjectedSolutionConstraint.php | 156 + .../ConstraintRelaxation.php | 149 + .../ConstraintRelaxation/Relaxation.php | 202 + .../ConstraintRelaxation/Relaxation/Level.php | 80 + MapsRouteOptimization/src/V1/InputConfig.php | 110 + MapsRouteOptimization/src/V1/Location.php | 133 + .../src/V1/OptimizeToursRequest.php | 1178 ++ .../V1/OptimizeToursRequest/SearchMode.php | 63 + .../V1/OptimizeToursRequest/SolvingMode.php | 81 + .../src/V1/OptimizeToursResponse.php | 239 + .../src/V1/OptimizeToursResponse/Metrics.php | 370 + .../src/V1/OptimizeToursValidationError.php | 1179 ++ .../FieldReference.php | 195 + MapsRouteOptimization/src/V1/OutputConfig.php | 111 + MapsRouteOptimization/src/V1/Shipment.php | 841 ++ .../src/V1/Shipment/Load.php | 79 + .../src/V1/Shipment/VisitRequest.php | 613 + .../src/V1/ShipmentModel.php | 1010 ++ .../ShipmentModel/DurationDistanceMatrix.php | 135 + .../DurationDistanceMatrix/Row.php | 114 + .../src/V1/ShipmentModel/PrecedenceRule.php | 241 + .../src/V1/ShipmentRoute.php | 706 + .../src/V1/ShipmentRoute/EncodedPolyline.php | 71 + .../src/V1/ShipmentRoute/PBBreak.php | 122 + .../src/V1/ShipmentRoute/Transition.php | 571 + .../src/V1/ShipmentRoute/VehicleLoad.php | 78 + .../src/V1/ShipmentRoute/Visit.php | 431 + .../src/V1/ShipmentTypeIncompatibility.php | 107 + .../IncompatibilityMode.php | 70 + .../src/V1/ShipmentTypeRequirement.php | 156 + .../RequirementMode.php | 78 + .../src/V1/SkippedShipment.php | 153 + .../src/V1/SkippedShipment/Reason.php | 179 + .../src/V1/SkippedShipment/Reason/Code.php | 114 + MapsRouteOptimization/src/V1/TimeWindow.php | 388 + .../src/V1/TransitionAttributes.php | 412 + MapsRouteOptimization/src/V1/Vehicle.php | 1375 ++ .../src/V1/Vehicle/DurationLimit.php | 357 + .../src/V1/Vehicle/LoadLimit.php | 268 + .../src/V1/Vehicle/LoadLimit/Interval.php | 148 + .../src/V1/Vehicle/TravelMode.php | 65 + .../src/V1/Vehicle/UnloadingPolicy.php | 66 + MapsRouteOptimization/src/V1/Waypoint.php | 166 + .../src/V1/gapic_metadata.json | 28 + .../route_optimization_client_config.json | 44 + .../route_optimization_descriptor_config.php | 59 + .../route_optimization_rest_client_config.php | 80 + .../V1/Client/RouteOptimizationClientTest.php | 327 + MediaTranslation/.repo-metadata.json | 8 - MediaTranslation/VERSION | 2 +- MediaTranslation/composer.json | 2 +- Memcache/.repo-metadata.json | 8 - Memcache/VERSION | 2 +- Memcache/composer.json | 2 +- MigrationCenter/.repo-metadata.json | 8 - MigrationCenter/VERSION | 2 +- MigrationCenter/composer.json | 2 +- .../src/V1/Client/MigrationCenterClient.php | 21 +- .../V1/Client/MigrationCenterClientTest.php | 2 +- Monitoring/.repo-metadata.json | 8 - Monitoring/VERSION | 2 +- Monitoring/composer.json | 2 +- NetApp/.repo-metadata.json | 8 - NetApp/VERSION | 2 +- NetApp/composer.json | 2 +- NetApp/metadata/V1/Common.php | Bin 960 -> 1126 bytes NetApp/metadata/V1/Volume.php | Bin 6550 -> 6950 bytes NetApp/src/V1/BackupConfig.php | 48 + NetApp/src/V1/Client/NetAppClient.php | 21 +- NetApp/src/V1/LocationMetadata.php | 68 + NetApp/src/V1/ServiceLevel.php | 7 + NetApp/src/V1/TieringPolicy.php | 129 + NetApp/src/V1/TieringPolicy/TierAction.php | 63 + NetApp/src/V1/Volume.php | 44 + .../tests/Unit/V1/Client/NetAppClientTest.php | 2 +- NetworkConnectivity/.repo-metadata.json | 8 - NetworkConnectivity/VERSION | 2 +- NetworkConnectivity/composer.json | 2 +- NetworkManagement/.repo-metadata.json | 8 - NetworkManagement/VERSION | 2 +- NetworkManagement/composer.json | 2 +- NetworkSecurity/.repo-metadata.json | 8 - NetworkSecurity/VERSION | 2 +- NetworkSecurity/composer.json | 2 +- .../src/V1/Client/NetworkSecurityClient.php | 21 +- .../V1/Client/NetworkSecurityClientTest.php | 2 +- NetworkServices/.OwlBot.yaml | 4 + NetworkServices/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + NetworkServices/CONTRIBUTING.md | 10 + NetworkServices/LICENSE | 202 + NetworkServices/README.md | 45 + NetworkServices/VERSION | 1 + NetworkServices/composer.json | 30 + NetworkServices/metadata/V1/Common.php | Bin 0 -> 1930 bytes NetworkServices/metadata/V1/Dep.php | Bin 0 -> 9040 bytes .../metadata/V1/EndpointPolicy.php | Bin 0 -> 3659 bytes NetworkServices/metadata/V1/Gateway.php | Bin 0 -> 2567 bytes NetworkServices/metadata/V1/GrpcRoute.php | Bin 0 -> 4529 bytes NetworkServices/metadata/V1/HttpRoute.php | Bin 0 -> 6027 bytes NetworkServices/metadata/V1/Mesh.php | 64 + .../metadata/V1/NetworkServices.php | 110 + .../metadata/V1/ServiceBinding.php | 59 + NetworkServices/metadata/V1/TcpRoute.php | 85 + NetworkServices/metadata/V1/TlsRoute.php | 78 + NetworkServices/owlbot.py | 62 + NetworkServices/phpunit.xml.dist | 16 + .../create_lb_route_extension.php | 175 + .../create_lb_traffic_extension.php | 176 + .../delete_lb_route_extension.php | 81 + .../delete_lb_traffic_extension.php | 81 + .../V1/DepServiceClient/get_iam_policy.php | 67 + .../get_lb_route_extension.php | 72 + .../get_lb_traffic_extension.php | 72 + .../V1/DepServiceClient/get_location.php | 53 + .../list_lb_route_extensions.php | 73 + .../list_lb_traffic_extensions.php | 73 + .../V1/DepServiceClient/list_locations.php | 58 + .../V1/DepServiceClient/set_iam_policy.php | 73 + .../DepServiceClient/test_iam_permissions.php | 80 + .../update_lb_route_extension.php | 160 + .../update_lb_traffic_extension.php | 160 + .../create_endpoint_policy.php | 110 + .../NetworkServicesClient/create_gateway.php | 115 + .../create_grpc_route.php | 138 + .../create_http_route.php | 127 + .../V1/NetworkServicesClient/create_mesh.php | 88 + .../create_service_binding.php | 105 + .../create_tcp_route.php | 98 + .../create_tls_route.php | 119 + .../delete_endpoint_policy.php | 80 + .../NetworkServicesClient/delete_gateway.php | 76 + .../delete_grpc_route.php | 76 + .../delete_http_route.php | 76 + .../V1/NetworkServicesClient/delete_mesh.php | 76 + .../delete_service_binding.php | 80 + .../delete_tcp_route.php | 76 + .../delete_tls_route.php | 76 + .../get_endpoint_policy.php | 71 + .../V1/NetworkServicesClient/get_gateway.php | 67 + .../NetworkServicesClient/get_grpc_route.php | 67 + .../NetworkServicesClient/get_http_route.php | 67 + .../NetworkServicesClient/get_iam_policy.php | 67 + .../V1/NetworkServicesClient/get_location.php | 53 + .../V1/NetworkServicesClient/get_mesh.php | 67 + .../get_service_binding.php | 71 + .../NetworkServicesClient/get_tcp_route.php | 67 + .../NetworkServicesClient/get_tls_route.php | 67 + .../list_endpoint_policies.php | 72 + .../NetworkServicesClient/list_gateways.php | 72 + .../list_grpc_routes.php | 72 + .../list_http_routes.php | 72 + .../NetworkServicesClient/list_locations.php | 58 + .../V1/NetworkServicesClient/list_meshes.php | 72 + .../list_service_bindings.php | 72 + .../NetworkServicesClient/list_tcp_routes.php | 72 + .../NetworkServicesClient/list_tls_routes.php | 72 + .../NetworkServicesClient/set_iam_policy.php | 73 + .../test_iam_permissions.php | 80 + .../update_endpoint_policy.php | 90 + .../NetworkServicesClient/update_gateway.php | 101 + .../update_grpc_route.php | 123 + .../update_http_route.php | 112 + .../V1/NetworkServicesClient/update_mesh.php | 82 + .../update_tcp_route.php | 89 + .../update_tls_route.php | 106 + .../src/V1/CreateEndpointPolicyRequest.php | 153 + .../src/V1/CreateGatewayRequest.php | 149 + .../src/V1/CreateGrpcRouteRequest.php | 149 + .../src/V1/CreateHttpRouteRequest.php | 149 + .../src/V1/CreateLbRouteExtensionRequest.php | 227 + .../V1/CreateLbTrafficExtensionRequest.php | 227 + NetworkServices/src/V1/CreateMeshRequest.php | 149 + .../src/V1/CreateServiceBindingRequest.php | 149 + .../src/V1/CreateTcpRouteRequest.php | 149 + .../src/V1/CreateTlsRouteRequest.php | 149 + .../src/V1/DeleteEndpointPolicyRequest.php | 71 + .../src/V1/DeleteGatewayRequest.php | 71 + .../src/V1/DeleteGrpcRouteRequest.php | 71 + .../src/V1/DeleteHttpRouteRequest.php | 71 + .../src/V1/DeleteLbRouteExtensionRequest.php | 149 + .../V1/DeleteLbTrafficExtensionRequest.php | 149 + NetworkServices/src/V1/DeleteMeshRequest.php | 71 + .../src/V1/DeleteServiceBindingRequest.php | 71 + .../src/V1/DeleteTcpRouteRequest.php | 71 + .../src/V1/DeleteTlsRouteRequest.php | 71 + NetworkServices/src/V1/DepServiceClient.php | 34 + NetworkServices/src/V1/EndpointMatcher.php | 76 + .../EndpointMatcher/MetadataLabelMatcher.php | 194 + .../MetadataLabelMatchCriteria.php | 64 + .../MetadataLabelMatcher/MetadataLabels.php | 106 + NetworkServices/src/V1/EndpointPolicy.php | 526 + .../V1/EndpointPolicy/EndpointPolicyType.php | 62 + NetworkServices/src/V1/EventType.php | 95 + NetworkServices/src/V1/ExtensionChain.php | 182 + .../src/V1/ExtensionChain/Extension.php | 414 + .../src/V1/ExtensionChain/MatchCondition.php | 80 + .../src/V1/Gapic/DepServiceGapicClient.php | 1454 +++ .../V1/Gapic/NetworkServicesGapicClient.php | 3503 +++++ NetworkServices/src/V1/Gateway.php | 444 + NetworkServices/src/V1/Gateway/Type.php | 66 + .../src/V1/GetEndpointPolicyRequest.php | 71 + NetworkServices/src/V1/GetGatewayRequest.php | 71 + .../src/V1/GetGrpcRouteRequest.php | 71 + .../src/V1/GetHttpRouteRequest.php | 71 + .../src/V1/GetLbRouteExtensionRequest.php | 75 + .../src/V1/GetLbTrafficExtensionRequest.php | 75 + NetworkServices/src/V1/GetMeshRequest.php | 71 + .../src/V1/GetServiceBindingRequest.php | 71 + NetworkServices/src/V1/GetTcpRouteRequest.php | 71 + NetworkServices/src/V1/GetTlsRouteRequest.php | 71 + NetworkServices/src/V1/GrpcRoute.php | 534 + .../src/V1/GrpcRoute/Destination.php | 163 + .../src/V1/GrpcRoute/FaultInjectionPolicy.php | 127 + .../GrpcRoute/FaultInjectionPolicy/Abort.php | 131 + .../GrpcRoute/FaultInjectionPolicy/Delay.php | 127 + .../src/V1/GrpcRoute/HeaderMatch.php | 140 + .../src/V1/GrpcRoute/HeaderMatch/Type.php | 63 + .../src/V1/GrpcRoute/MethodMatch.php | 200 + .../src/V1/GrpcRoute/MethodMatch/Type.php | 63 + .../src/V1/GrpcRoute/RetryPolicy.php | 166 + .../src/V1/GrpcRoute/RouteAction.php | 248 + .../src/V1/GrpcRoute/RouteMatch.php | 117 + .../src/V1/GrpcRoute/RouteRule.php | 128 + NetworkServices/src/V1/HttpRoute.php | 518 + .../src/V1/HttpRoute/CorsPolicy.php | 342 + .../src/V1/HttpRoute/Destination.php | 142 + .../src/V1/HttpRoute/FaultInjectionPolicy.php | 127 + .../HttpRoute/FaultInjectionPolicy/Abort.php | 111 + .../HttpRoute/FaultInjectionPolicy/Delay.php | 117 + .../src/V1/HttpRoute/HeaderMatch.php | 328 + .../V1/HttpRoute/HeaderMatch/IntegerRange.php | 102 + .../src/V1/HttpRoute/HeaderModifier.php | 145 + .../src/V1/HttpRoute/QueryParameterMatch.php | 200 + NetworkServices/src/V1/HttpRoute/Redirect.php | 328 + .../V1/HttpRoute/Redirect/ResponseCode.php | 83 + .../src/V1/HttpRoute/RequestMirrorPolicy.php | 85 + .../src/V1/HttpRoute/RetryPolicy.php | 214 + .../src/V1/HttpRoute/RouteAction.php | 544 + .../src/V1/HttpRoute/RouteMatch.php | 288 + .../src/V1/HttpRoute/RouteRule.php | 137 + .../src/V1/HttpRoute/URLRewrite.php | 111 + NetworkServices/src/V1/LbRouteExtension.php | 462 + NetworkServices/src/V1/LbTrafficExtension.php | 460 + .../src/V1/ListEndpointPoliciesRequest.php | 151 + .../src/V1/ListEndpointPoliciesResponse.php | 109 + .../src/V1/ListGatewaysRequest.php | 147 + .../src/V1/ListGatewaysResponse.php | 109 + .../src/V1/ListGrpcRoutesRequest.php | 147 + .../src/V1/ListGrpcRoutesResponse.php | 109 + .../src/V1/ListHttpRoutesRequest.php | 147 + .../src/V1/ListHttpRoutesResponse.php | 109 + .../src/V1/ListLbRouteExtensionsRequest.php | 215 + .../src/V1/ListLbRouteExtensionsResponse.php | 135 + .../src/V1/ListLbTrafficExtensionsRequest.php | 215 + .../V1/ListLbTrafficExtensionsResponse.php | 135 + NetworkServices/src/V1/ListMeshesRequest.php | 147 + NetworkServices/src/V1/ListMeshesResponse.php | 109 + .../src/V1/ListServiceBindingsRequest.php | 147 + .../src/V1/ListServiceBindingsResponse.php | 109 + .../src/V1/ListTcpRoutesRequest.php | 147 + .../src/V1/ListTcpRoutesResponse.php | 109 + .../src/V1/ListTlsRoutesRequest.php | 147 + .../src/V1/ListTlsRoutesResponse.php | 109 + .../src/V1/LoadBalancingScheme.php | 65 + NetworkServices/src/V1/Mesh.php | 321 + .../src/V1/NetworkServicesClient.php | 34 + NetworkServices/src/V1/OperationMetadata.php | 307 + NetworkServices/src/V1/ServiceBinding.php | 270 + NetworkServices/src/V1/TcpRoute.php | 404 + .../src/V1/TcpRoute/RouteAction.php | 118 + .../src/V1/TcpRoute/RouteDestination.php | 142 + .../src/V1/TcpRoute/RouteMatch.php | 137 + NetworkServices/src/V1/TcpRoute/RouteRule.php | 125 + NetworkServices/src/V1/TlsRoute.php | 370 + .../src/V1/TlsRoute/RouteAction.php | 72 + .../src/V1/TlsRoute/RouteDestination.php | 114 + .../src/V1/TlsRoute/RouteMatch.php | 145 + NetworkServices/src/V1/TlsRoute/RouteRule.php | 117 + .../src/V1/TrafficPortSelector.php | 79 + .../src/V1/UpdateEndpointPolicyRequest.php | 137 + .../src/V1/UpdateGatewayRequest.php | 137 + .../src/V1/UpdateGrpcRouteRequest.php | 137 + .../src/V1/UpdateHttpRouteRequest.php | 137 + .../src/V1/UpdateLbRouteExtensionRequest.php | 211 + .../V1/UpdateLbTrafficExtensionRequest.php | 211 + NetworkServices/src/V1/UpdateMeshRequest.php | 137 + .../src/V1/UpdateTcpRouteRequest.php | 137 + .../src/V1/UpdateTlsRouteRequest.php | 137 + NetworkServices/src/V1/gapic_metadata.json | 322 + .../resources/dep_service_client_config.json | 107 + .../dep_service_descriptor_config.php | 131 + .../dep_service_rest_client_config.php | 349 + .../network_services_client_config.json | 252 + .../network_services_descriptor_config.php | 361 + .../network_services_rest_client_config.php | 702 + .../tests/Unit/V1/DepServiceClientTest.php | 1442 +++ .../Unit/V1/NetworkServicesClientTest.php | 4472 +++++++ Notebooks/.OwlBot.yaml | 2 +- Notebooks/.repo-metadata.json | 8 - Notebooks/README.md | 5 +- Notebooks/VERSION | 2 +- Notebooks/composer.json | 2 +- Notebooks/metadata/V1Beta1/Environment.php | Bin 1663 -> 0 bytes Notebooks/metadata/V1Beta1/Instance.php | Bin 3887 -> 0 bytes Notebooks/metadata/V1Beta1/Service.php | 153 - Notebooks/owlbot.py | 53 +- .../Client/ManagedNotebookServiceClient.php | 43 +- .../src/V1/Client/NotebookServiceClient.php | 85 +- Notebooks/src/V1/ContainerImage.php | 4 +- Notebooks/src/V1/CreateEnvironmentRequest.php | 6 +- Notebooks/src/V1/CreateExecutionRequest.php | 6 +- Notebooks/src/V1/CreateInstanceRequest.php | 6 +- Notebooks/src/V1/CreateRuntimeRequest.php | 8 +- Notebooks/src/V1/CreateScheduleRequest.php | 6 +- Notebooks/src/V1/DeleteEnvironmentRequest.php | 2 +- Notebooks/src/V1/DeleteExecutionRequest.php | 2 +- Notebooks/src/V1/DeleteInstanceRequest.php | 2 +- Notebooks/src/V1/DeleteRuntimeRequest.php | 4 +- Notebooks/src/V1/DeleteScheduleRequest.php | 2 +- Notebooks/src/V1/DiagnoseInstanceRequest.php | 4 +- Notebooks/src/V1/DiagnoseRuntimeRequest.php | 4 +- Notebooks/src/V1/DiagnosticConfig.php | 10 +- Notebooks/src/V1/EncryptionConfig.php | 2 +- Notebooks/src/V1/Environment.php | 10 +- Notebooks/src/V1/Event.php | 4 +- Notebooks/src/V1/Event/EventType.php | 2 - Notebooks/src/V1/Execution.php | 18 +- Notebooks/src/V1/Execution/State.php | 2 - Notebooks/src/V1/ExecutionTemplate.php | 22 +- .../ExecutionTemplate/DataprocParameters.php | 4 +- .../src/V1/ExecutionTemplate/JobType.php | 2 - .../src/V1/ExecutionTemplate/ScaleTier.php | 2 - .../SchedulerAcceleratorConfig.php | 6 +- .../SchedulerAcceleratorType.php | 2 - .../ExecutionTemplate/VertexAIParameters.php | 4 +- Notebooks/src/V1/GetEnvironmentRequest.php | 2 +- Notebooks/src/V1/GetExecutionRequest.php | 2 +- Notebooks/src/V1/GetInstanceHealthRequest.php | 2 +- .../src/V1/GetInstanceHealthResponse.php | 2 +- .../GetInstanceHealthResponse/HealthState.php | 2 - Notebooks/src/V1/GetInstanceRequest.php | 2 +- Notebooks/src/V1/GetRuntimeRequest.php | 2 +- Notebooks/src/V1/GetScheduleRequest.php | 2 +- Notebooks/src/V1/Instance.php | 62 +- .../src/V1/Instance/AcceleratorConfig.php | 6 +- Notebooks/src/V1/Instance/AcceleratorType.php | 2 - Notebooks/src/V1/Instance/Disk.php | 22 +- .../src/V1/Instance/Disk/GuestOsFeature.php | 4 +- Notebooks/src/V1/Instance/DiskEncryption.php | 2 - Notebooks/src/V1/Instance/DiskType.php | 2 - Notebooks/src/V1/Instance/NicType.php | 2 - .../V1/Instance/ShieldedInstanceConfig.php | 8 +- Notebooks/src/V1/Instance/State.php | 2 - .../src/V1/Instance/UpgradeHistoryEntry.php | 20 +- .../Instance/UpgradeHistoryEntry/Action.php | 2 - .../V1/Instance/UpgradeHistoryEntry/State.php | 2 - Notebooks/src/V1/InstanceConfig.php | 4 +- .../src/V1/IsInstanceUpgradeableRequest.php | 4 +- .../src/V1/IsInstanceUpgradeableResponse.php | 8 +- Notebooks/src/V1/ListEnvironmentsRequest.php | 6 +- Notebooks/src/V1/ListEnvironmentsResponse.php | 2 +- Notebooks/src/V1/ListExecutionsRequest.php | 10 +- Notebooks/src/V1/ListExecutionsResponse.php | 2 +- Notebooks/src/V1/ListInstancesRequest.php | 6 +- Notebooks/src/V1/ListInstancesResponse.php | 2 +- Notebooks/src/V1/ListRuntimesRequest.php | 6 +- Notebooks/src/V1/ListRuntimesResponse.php | 2 +- Notebooks/src/V1/ListSchedulesRequest.php | 10 +- Notebooks/src/V1/ListSchedulesResponse.php | 2 +- Notebooks/src/V1/LocalDisk.php | 20 +- .../V1/LocalDisk/RuntimeGuestOsFeature.php | 4 +- .../src/V1/LocalDiskInitializeParams.php | 8 +- .../V1/LocalDiskInitializeParams/DiskType.php | 2 - .../V1/ManagedNotebookServiceGrpcClient.php | 240 - .../src/V1/NotebookServiceGrpcClient.php | 552 - Notebooks/src/V1/OperationMetadata.php | 16 +- .../V1/RefreshRuntimeTokenInternalRequest.php | 4 +- .../RefreshRuntimeTokenInternalResponse.php | 4 +- Notebooks/src/V1/RegisterInstanceRequest.php | 4 +- .../src/V1/ReportInstanceInfoRequest.php | 4 +- .../src/V1/ReportRuntimeEventRequest.php | 6 +- Notebooks/src/V1/ReservationAffinity.php | 4 +- Notebooks/src/V1/ReservationAffinity/Type.php | 2 - Notebooks/src/V1/ResetInstanceRequest.php | 2 +- Notebooks/src/V1/ResetRuntimeRequest.php | 4 +- Notebooks/src/V1/RollbackInstanceRequest.php | 4 +- Notebooks/src/V1/Runtime.php | 16 +- Notebooks/src/V1/Runtime/HealthState.php | 2 - Notebooks/src/V1/Runtime/State.php | 2 - Notebooks/src/V1/RuntimeAcceleratorConfig.php | 4 +- .../AcceleratorType.php | 2 - Notebooks/src/V1/RuntimeAccessConfig.php | 6 +- .../RuntimeAccessConfig/RuntimeAccessType.php | 2 - .../src/V1/RuntimeShieldedInstanceConfig.php | 6 +- Notebooks/src/V1/RuntimeSoftwareConfig.php | 22 +- .../PostStartupScriptBehavior.php | 2 - Notebooks/src/V1/Schedule.php | 18 +- Notebooks/src/V1/Schedule/State.php | 2 - .../src/V1/SetInstanceAcceleratorRequest.php | 6 +- Notebooks/src/V1/SetInstanceLabelsRequest.php | 2 +- .../src/V1/SetInstanceMachineTypeRequest.php | 4 +- Notebooks/src/V1/StartInstanceRequest.php | 2 +- Notebooks/src/V1/StartRuntimeRequest.php | 4 +- Notebooks/src/V1/StopInstanceRequest.php | 2 +- Notebooks/src/V1/StopRuntimeRequest.php | 4 +- Notebooks/src/V1/SwitchRuntimeRequest.php | 8 +- Notebooks/src/V1/TriggerScheduleRequest.php | 2 +- .../src/V1/UpdateInstanceConfigRequest.php | 4 +- .../V1/UpdateInstanceMetadataItemsRequest.php | 2 +- Notebooks/src/V1/UpdateRuntimeRequest.php | 6 +- .../UpdateShieldedInstanceConfigRequest.php | 4 +- .../src/V1/UpgradeInstanceInternalRequest.php | 6 +- Notebooks/src/V1/UpgradeInstanceRequest.php | 4 +- Notebooks/src/V1/UpgradeRuntimeRequest.php | 4 +- Notebooks/src/V1/VirtualMachine.php | 6 +- Notebooks/src/V1/VirtualMachineConfig.php | 24 +- .../src/V1/VirtualMachineConfig/BootImage.php | 2 - .../src/V1/VirtualMachineConfig/NicType.php | 2 - Notebooks/src/V1/VmImage.php | 2 +- Notebooks/src/V1beta1/ContainerImage.php | 110 - .../src/V1beta1/CreateEnvironmentRequest.php | 157 - .../src/V1beta1/CreateInstanceRequest.php | 149 - .../src/V1beta1/DeleteEnvironmentRequest.php | 71 - .../src/V1beta1/DeleteInstanceRequest.php | 71 - Notebooks/src/V1beta1/Environment.php | 305 - .../Gapic/NotebookServiceGapicClient.php | 1955 --- .../src/V1beta1/GetEnvironmentRequest.php | 71 - Notebooks/src/V1beta1/GetInstanceRequest.php | 71 - Notebooks/src/V1beta1/Instance.php | 1268 -- .../V1beta1/Instance/AcceleratorConfig.php | 107 - .../src/V1beta1/Instance/AcceleratorType.php | 121 - .../src/V1beta1/Instance/DiskEncryption.php | 64 - Notebooks/src/V1beta1/Instance/DiskType.php | 71 - Notebooks/src/V1beta1/Instance/NicType.php | 65 - Notebooks/src/V1beta1/Instance/State.php | 128 - .../V1beta1/Instance_AcceleratorConfig.php | 16 - .../src/V1beta1/Instance_AcceleratorType.php | 16 - .../src/V1beta1/Instance_DiskEncryption.php | 16 - Notebooks/src/V1beta1/Instance_DiskType.php | 16 - Notebooks/src/V1beta1/Instance_NicType.php | 16 - Notebooks/src/V1beta1/Instance_State.php | 16 - .../V1beta1/IsInstanceUpgradeableRequest.php | 71 - .../V1beta1/IsInstanceUpgradeableResponse.php | 181 - .../src/V1beta1/ListEnvironmentsRequest.php | 139 - .../src/V1beta1/ListEnvironmentsResponse.php | 139 - .../src/V1beta1/ListInstancesRequest.php | 143 - .../src/V1beta1/ListInstancesResponse.php | 147 - .../src/V1beta1/NotebookServiceClient.php | 36 - .../src/V1beta1/NotebookServiceGrpcClient.php | 330 - Notebooks/src/V1beta1/OperationMetadata.php | 337 - .../src/V1beta1/RegisterInstanceRequest.php | 117 - .../src/V1beta1/ReportInstanceInfoRequest.php | 147 - Notebooks/src/V1beta1/ReservationAffinity.php | 135 - .../src/V1beta1/ReservationAffinity/Type.php | 72 - .../src/V1beta1/ReservationAffinity_Type.php | 16 - .../src/V1beta1/ResetInstanceRequest.php | 71 - .../V1beta1/SetInstanceAcceleratorRequest.php | 151 - .../src/V1beta1/SetInstanceLabelsRequest.php | 109 - .../V1beta1/SetInstanceMachineTypeRequest.php | 109 - .../src/V1beta1/StartInstanceRequest.php | 71 - Notebooks/src/V1beta1/StopInstanceRequest.php | 71 - .../UpgradeInstanceInternalRequest.php | 109 - .../src/V1beta1/UpgradeInstanceRequest.php | 71 - Notebooks/src/V1beta1/VmImage.php | 150 - Notebooks/src/V1beta1/gapic_metadata.json | 138 - .../notebook_service_client_config.json | 164 - .../notebook_service_descriptor_config.php | 211 - .../notebook_service_rest_client_config.php | 364 - Notebooks/src/V2/AcceleratorConfig.php | 4 +- .../V2/AcceleratorConfig/AcceleratorType.php | 2 - Notebooks/src/V2/BootDisk.php | 8 +- .../V2/CheckInstanceUpgradabilityRequest.php | 2 +- .../V2/CheckInstanceUpgradabilityResponse.php | 8 +- .../src/V2/Client/NotebookServiceClient.php | 43 +- Notebooks/src/V2/ContainerImage.php | 4 +- Notebooks/src/V2/CreateInstanceRequest.php | 8 +- Notebooks/src/V2/DataDisk.php | 8 +- Notebooks/src/V2/DeleteInstanceRequest.php | 4 +- Notebooks/src/V2/DiagnoseInstanceRequest.php | 6 +- Notebooks/src/V2/DiagnosticConfig.php | 10 +- Notebooks/src/V2/Event.php | 4 +- Notebooks/src/V2/Event/EventType.php | 2 - Notebooks/src/V2/GPUDriverConfig.php | 4 +- Notebooks/src/V2/GceSetup.php | 12 +- Notebooks/src/V2/GetInstanceRequest.php | 2 +- Notebooks/src/V2/Instance.php | 18 +- Notebooks/src/V2/ListInstancesRequest.php | 10 +- Notebooks/src/V2/ListInstancesResponse.php | 2 +- Notebooks/src/V2/NetworkInterface.php | 6 +- Notebooks/src/V2/NetworkInterface/NicType.php | 2 - Notebooks/src/V2/OperationMetadata.php | 16 +- Notebooks/src/V2/ResetInstanceRequest.php | 2 +- Notebooks/src/V2/RollbackInstanceRequest.php | 6 +- Notebooks/src/V2/ServiceAccount.php | 2 +- Notebooks/src/V2/ShieldedInstanceConfig.php | 6 +- Notebooks/src/V2/StartInstanceRequest.php | 2 +- Notebooks/src/V2/StopInstanceRequest.php | 2 +- Notebooks/src/V2/UpdateInstanceRequest.php | 6 +- Notebooks/src/V2/UpgradeHistoryEntry.php | 18 +- .../src/V2/UpgradeHistoryEntry/Action.php | 2 - .../src/V2/UpgradeHistoryEntry/State.php | 2 - Notebooks/src/V2/UpgradeInstanceRequest.php | 2 +- Notebooks/src/V2/VmImage.php | 2 +- .../ManagedNotebookServiceClientTest.php | 385 +- .../V1/Client/NotebookServiceClientTest.php | 826 +- .../V1beta1/NotebookServiceClientTest.php | 2785 ---- .../V2/Client/NotebookServiceClientTest.php | 360 +- Optimization/.repo-metadata.json | 8 - Optimization/README.md | 5 +- Optimization/VERSION | 2 +- Optimization/composer.json | 2 +- Optimization/owlbot.py | 40 +- Optimization/src/V1/AggregatedMetrics.php | 16 +- Optimization/src/V1/AsyncModelMetadata.php | 8 +- .../src/V1/BatchOptimizeToursRequest.php | 2 +- .../AsyncModelConfig.php | 8 +- .../src/V1/BreakRule/BreakRequest.php | 6 +- .../src/V1/BreakRule/FrequencyConstraint.php | 4 +- Optimization/src/V1/CapacityQuantity.php | 4 +- .../src/V1/CapacityQuantityInterval.php | 6 +- .../src/V1/Client/FleetRoutingClient.php | 31 +- Optimization/src/V1/DistanceLimit.php | 8 +- Optimization/src/V1/FleetRoutingClient.php | 34 - .../src/V1/FleetRoutingGrpcClient.php | 103 - .../src/V1/Gapic/FleetRoutingGapicClient.php | 690 - Optimization/src/V1/GcsDestination.php | 2 +- Optimization/src/V1/GcsSource.php | 2 +- .../ConstraintRelaxation/Relaxation.php | 6 +- Optimization/src/V1/InputConfig.php | 2 +- Optimization/src/V1/Location.php | 4 +- Optimization/src/V1/OptimizeToursRequest.php | 30 +- Optimization/src/V1/OptimizeToursResponse.php | 4 +- .../src/V1/OptimizeToursResponse/Metrics.php | 12 +- .../src/V1/OptimizeToursValidationError.php | 8 +- .../FieldReference.php | 4 +- Optimization/src/V1/OutputConfig.php | 2 +- Optimization/src/V1/RouteModifiers.php | 8 +- Optimization/src/V1/Shipment.php | 14 +- Optimization/src/V1/Shipment/Load.php | 2 +- Optimization/src/V1/Shipment/VisitRequest.php | 14 +- Optimization/src/V1/ShipmentModel.php | 8 +- .../ShipmentModel/BreakRule/BreakRequest.php | 6 +- .../BreakRule/FrequencyConstraint.php | 4 +- .../ShipmentModel/DurationDistanceMatrix.php | 2 +- .../src/V1/ShipmentModel/PrecedenceRule.php | 10 +- Optimization/src/V1/ShipmentRoute.php | 16 +- Optimization/src/V1/ShipmentRoute/Delay.php | 4 +- .../src/V1/ShipmentRoute/EncodedPolyline.php | 2 +- Optimization/src/V1/ShipmentRoute/PBBreak.php | 4 +- .../src/V1/ShipmentRoute/Transition.php | 18 +- .../src/V1/ShipmentRoute/TravelStep.php | 8 +- .../src/V1/ShipmentRoute/VehicleLoad.php | 2 +- Optimization/src/V1/ShipmentRoute/Visit.php | 14 +- .../src/V1/ShipmentTypeIncompatibility.php | 2 +- .../src/V1/ShipmentTypeRequirement.php | 2 +- Optimization/src/V1/SkippedShipment.php | 4 +- .../src/V1/SkippedShipment/Reason.php | 6 +- Optimization/src/V1/TimeWindow.php | 12 +- Optimization/src/V1/TransitionAttributes.php | 16 +- Optimization/src/V1/Vehicle.php | 38 +- Optimization/src/V1/Vehicle/DurationLimit.php | 10 +- Optimization/src/V1/Vehicle/LoadLimit.php | 10 +- .../src/V1/Vehicle/LoadLimit/Interval.php | 4 +- Optimization/src/V1/Waypoint.php | 2 +- .../Unit/V1/Client/FleetRoutingClientTest.php | 58 +- .../tests/Unit/V1/FleetRoutingClientTest.php | 249 - OrchestrationAirflow/.repo-metadata.json | 8 - OrchestrationAirflow/VERSION | 2 +- OrchestrationAirflow/composer.json | 2 +- OrgPolicy/.repo-metadata.json | 8 - OrgPolicy/README.md | 5 +- OrgPolicy/VERSION | 2 +- OrgPolicy/composer.json | 2 +- OrgPolicy/owlbot.py | 53 +- OrgPolicy/src/V2/AlternatePolicySpec.php | 4 +- OrgPolicy/src/V2/Client/OrgPolicyClient.php | 24 +- OrgPolicy/src/V2/Constraint.php | 10 +- .../src/V2/Constraint/BooleanConstraint.php | 2 - .../src/V2/Constraint/ConstraintDefault.php | 2 - .../src/V2/Constraint/ListConstraint.php | 6 +- .../src/V2/Constraint_BooleanConstraint.php | 16 - .../src/V2/Constraint_ConstraintDefault.php | 16 - .../src/V2/Constraint_ListConstraint.php | 16 - .../src/V2/CreateCustomConstraintRequest.php | 4 +- OrgPolicy/src/V2/CreatePolicyRequest.php | 4 +- OrgPolicy/src/V2/CustomConstraint.php | 12 +- .../src/V2/CustomConstraint/ActionType.php | 2 - .../src/V2/CustomConstraint/MethodType.php | 2 - .../src/V2/DeleteCustomConstraintRequest.php | 2 +- OrgPolicy/src/V2/DeletePolicyRequest.php | 4 +- .../src/V2/Gapic/OrgPolicyGapicClient.php | 1137 -- .../src/V2/GetCustomConstraintRequest.php | 2 +- .../src/V2/GetEffectivePolicyRequest.php | 2 +- OrgPolicy/src/V2/GetPolicyRequest.php | 2 +- OrgPolicy/src/V2/ListConstraintsRequest.php | 6 +- OrgPolicy/src/V2/ListConstraintsResponse.php | 2 +- .../src/V2/ListCustomConstraintsRequest.php | 6 +- .../src/V2/ListCustomConstraintsResponse.php | 2 +- OrgPolicy/src/V2/ListPoliciesRequest.php | 6 +- OrgPolicy/src/V2/ListPoliciesResponse.php | 2 +- OrgPolicy/src/V2/OrgPolicyClient.php | 34 - OrgPolicy/src/V2/OrgPolicyGrpcClient.php | 184 - OrgPolicy/src/V2/Policy.php | 8 +- OrgPolicy/src/V2/PolicySpec.php | 8 +- OrgPolicy/src/V2/PolicySpec/PolicyRule.php | 4 +- .../V2/PolicySpec/PolicyRule/StringValues.php | 2 - OrgPolicy/src/V2/PolicySpec_PolicyRule.php | 16 - .../V2/PolicySpec_PolicyRule_StringValues.php | 16 - .../src/V2/UpdateCustomConstraintRequest.php | 2 +- OrgPolicy/src/V2/UpdatePolicyRequest.php | 4 +- .../Unit/V2/Client/OrgPolicyClientTest.php | 266 +- .../tests/Unit/V2/OrgPolicyClientTest.php | 839 -- OsConfig/.repo-metadata.json | 8 - OsConfig/VERSION | 2 +- OsConfig/composer.json | 2 +- OsLogin/.repo-metadata.json | 8 - OsLogin/VERSION | 2 +- OsLogin/composer.json | 2 +- Parallelstore/.repo-metadata.json | 8 - Parallelstore/VERSION | 2 +- Parallelstore/composer.json | 2 +- .../metadata/V1Beta/Parallelstore.php | Bin 6731 -> 7876 bytes .../src/V1beta/Client/ParallelstoreClient.php | 21 +- .../src/V1beta/DestinationGcsBucket.php | 71 + .../src/V1beta/DestinationParallelstore.php | 71 + .../src/V1beta/ExportDataMetadata.php | 274 + .../src/V1beta/ExportDataRequest.php | 54 +- .../src/V1beta/ImportDataMetadata.php | 274 + .../src/V1beta/ImportDataRequest.php | 54 +- Parallelstore/src/V1beta/SourceGcsBucket.php | 71 + .../src/V1beta/SourceParallelstore.php | 71 + .../src/V1beta/TransferOperationMetadata.php | 234 +- .../V1beta/Client/ParallelstoreClientTest.php | 2 +- PolicySimulator/.repo-metadata.json | 8 - PolicySimulator/VERSION | 2 +- PolicySimulator/composer.json | 2 +- .../src/V1/Client/SimulatorClient.php | 21 +- .../Unit/V1/Client/SimulatorClientTest.php | 2 +- PolicyTroubleshooter/.repo-metadata.json | 8 - PolicyTroubleshooter/VERSION | 2 +- PolicyTroubleshooter/composer.json | 2 +- PolicyTroubleshooterIam/.repo-metadata.json | 8 - PolicyTroubleshooterIam/VERSION | 2 +- PolicyTroubleshooterIam/composer.json | 2 +- PrivateCatalog/.repo-metadata.json | 8 - PrivateCatalog/VERSION | 2 +- PrivateCatalog/composer.json | 2 +- Profiler/.repo-metadata.json | 8 - Profiler/VERSION | 2 +- Profiler/composer.json | 2 +- PubSub/.repo-metadata.json | 8 - PubSub/VERSION | 2 +- PubSub/composer.json | 2 +- PubSub/metadata/V1/Pubsub.php | Bin 15596 -> 15668 bytes PubSub/src/PubSubClient.php | 2 +- PubSub/src/V1/BigQueryConfig.php | 54 + PubSub/src/V1/CloudStorageConfig.php | 54 + Quotas/.repo-metadata.json | 8 - Quotas/VERSION | 2 +- Quotas/composer.json | 2 +- RapidMigrationAssessment/.repo-metadata.json | 8 - RapidMigrationAssessment/VERSION | 2 +- RapidMigrationAssessment/composer.json | 2 +- .../Client/RapidMigrationAssessmentClient.php | 21 +- .../RapidMigrationAssessmentClientTest.php | 2 +- RecaptchaEnterprise/.repo-metadata.json | 8 - RecaptchaEnterprise/VERSION | 2 +- RecaptchaEnterprise/composer.json | 2 +- RecommendationEngine/.repo-metadata.json | 8 - RecommendationEngine/VERSION | 2 +- RecommendationEngine/composer.json | 2 +- Recommender/.repo-metadata.json | 8 - Recommender/VERSION | 2 +- Recommender/composer.json | 2 +- Redis/.repo-metadata.json | 8 - Redis/VERSION | 2 +- Redis/composer.json | 2 +- RedisCluster/.repo-metadata.json | 8 - RedisCluster/VERSION | 2 +- RedisCluster/composer.json | 2 +- .../metadata/V1/CloudRedisCluster.php | Bin 5500 -> 8132 bytes .../get_cluster_certificate_authority.php | 77 + RedisCluster/src/V1/CertificateAuthority.php | 112 + .../ManagedCertificateAuthority.php | 70 + .../ManagedCertificateAuthority/CertChain.php | 66 + .../src/V1/Client/CloudRedisClusterClient.php | 73 +- RedisCluster/src/V1/Cluster.php | 268 +- .../src/V1/ClusterPersistenceConfig.php | 155 + .../V1/ClusterPersistenceConfig/AOFConfig.php | 68 + .../AOFConfig/AppendFsync.php | 72 + .../PersistenceMode.php | 69 + .../V1/ClusterPersistenceConfig/RDBConfig.php | 120 + .../RDBConfig/SnapshotPeriod.php | 76 + .../GetClusterCertificateAuthorityRequest.php | 92 + RedisCluster/src/V1/NodeType.php | 73 + .../src/V1/ZoneDistributionConfig.php | 113 + .../ZoneDistributionMode.php | 67 + RedisCluster/src/V1/gapic_metadata.json | 5 + .../cloud_redis_cluster_client_config.json | 5 + .../cloud_redis_cluster_descriptor_config.php | 13 + ...cloud_redis_cluster_rest_client_config.php | 11 + .../V1/Client/CloudRedisClusterClientTest.php | 88 +- ResourceManager/.repo-metadata.json | 8 - ResourceManager/VERSION | 2 +- ResourceManager/composer.json | 2 +- ResourceSettings/.repo-metadata.json | 8 - ResourceSettings/VERSION | 2 +- ResourceSettings/composer.json | 2 +- .../metadata/V1/ResourceSettings.php | Bin 3816 -> 3819 bytes .../get_setting.php | 3 +- .../list_settings.php | 4 +- .../Client/ResourceSettingsServiceClient.php | 5 + .../ResourceSettingsServiceGapicClient.php | 13 +- ResourceSettings/src/V1/GetSettingRequest.php | 15 +- .../src/V1/ListSettingsRequest.php | 20 +- ResourceSettings/src/V1/Setting.php | 112 +- ResourceSettings/src/V1/SettingMetadata.php | 20 +- .../src/V1/SettingMetadata/DataType.php | 5 +- ResourceSettings/src/V1/SettingView.php | 14 +- .../src/V1/UpdateSettingRequest.php | 12 +- Retail/.repo-metadata.json | 8 - Retail/VERSION | 2 +- Retail/composer.json | 2 +- Retail/metadata/V2/Catalog.php | Bin 3817 -> 4735 bytes Retail/metadata/V2/Common.php | Bin 4296 -> 4745 bytes Retail/metadata/V2/CompletionService.php | 17 +- Retail/metadata/V2/Model.php | Bin 2443 -> 2944 bytes Retail/metadata/V2/ProductService.php | 11 +- Retail/metadata/V2/PurgeConfig.php | 21 +- Retail/metadata/V2/ServingConfig.php | Bin 2201 -> 2231 bytes .../V2/PredictionServiceClient/predict.php | 1 + .../add_fulfillment_places.php | 7 +- .../ProductServiceClient/purge_products.php | 147 + .../remove_fulfillment_places.php | 7 +- .../samples/V2/SearchServiceClient/search.php | 2 +- .../import_user_events.php | 1 + .../write_user_event.php | 1 + Retail/src/V2/CatalogAttribute.php | 76 +- .../src/V2/CatalogAttribute/FacetConfig.php | 313 + .../FacetConfig/IgnoredFacetValues.php | 200 + .../FacetConfig/MergedFacet.php | 92 + .../FacetConfig/MergedFacetValue.php | 121 + .../FacetConfig/RerankConfig.php | 121 + Retail/src/V2/Client/ProductServiceClient.php | 58 +- Retail/src/V2/CompleteQueryRequest.php | 62 +- Retail/src/V2/CompleteQueryResponse.php | 35 +- .../RecentSearchResult.php | 3 +- Retail/src/V2/CompletionConfig.php | 16 +- Retail/src/V2/Condition.php | 46 + Retail/src/V2/ExperimentInfo.php | 2 +- .../ServingConfigExperiment.php | 16 +- .../V2/Gapic/CompletionServiceGapicClient.php | 16 +- .../V2/Gapic/ProductServiceGapicClient.php | 169 +- .../src/V2/Gapic/SearchServiceGapicClient.php | 44 +- Retail/src/V2/ImportProductsRequest.php | 52 +- Retail/src/V2/Model.php | 44 + Retail/src/V2/Model/ContextProductsType.php | 66 + ...FrequentlyBoughtTogetherFeaturesConfig.php | 80 + Retail/src/V2/Model/ModelFeaturesConfig.php | 76 + Retail/src/V2/Product.php | 143 +- Retail/src/V2/Promotion.php | 16 +- Retail/src/V2/PurgeProductsMetadata.php | 194 + Retail/src/V2/PurgeProductsRequest.php | 263 + Retail/src/V2/PurgeProductsResponse.php | 111 + Retail/src/V2/Rule.php | 66 + Retail/src/V2/Rule/FilterAction.php | 32 +- Retail/src/V2/Rule/ForceReturnFacetAction.php | 93 + .../FacetPositionAdjustment.php | 115 + Retail/src/V2/Rule/RedirectAction.php | 2 +- Retail/src/V2/Rule/RemoveFacetAction.php | 93 + Retail/src/V2/SearchRequest.php | 168 +- Retail/src/V2/SearchRequest/FacetSpec.php | 64 +- .../V2/SearchRequest/FacetSpec/FacetKey.php | 80 +- Retail/src/V2/ServingConfig.php | 38 + Retail/src/V2/UserEvent.php | 20 +- Retail/src/V2/gapic_metadata.json | 5 + .../analytics_service_client_config.json | 8 +- .../model_service_client_config.json | 36 +- .../product_service_client_config.json | 57 +- .../product_service_descriptor_config.php | 19 + .../product_service_rest_client_config.php | 12 + .../user_event_service_client_config.json | 44 +- .../V2/Client/ProductServiceClientTest.php | 131 + .../Client/ServingConfigServiceClientTest.php | 12 + .../Unit/V2/ProductServiceClientTest.php | 124 + .../V2/ServingConfigServiceClientTest.php | 10 + Run/.repo-metadata.json | 8 - Run/VERSION | 2 +- Run/composer.json | 2 +- Scheduler/.repo-metadata.json | 8 - Scheduler/VERSION | 2 +- Scheduler/composer.json | 2 +- SecretManager/.repo-metadata.json | 8 - SecretManager/VERSION | 2 +- SecretManager/composer.json | 2 +- SecureSourceManager/.repo-metadata.json | 8 - SecureSourceManager/VERSION | 2 +- SecureSourceManager/composer.json | 2 +- .../V1/Client/SecureSourceManagerClient.php | 21 +- .../Client/SecureSourceManagerClientTest.php | 2 +- SecurityCenter/.repo-metadata.json | 8 - SecurityCenter/VERSION | 2 +- SecurityCenter/composer.json | 2 +- .../src/V2/Client/SecurityCenterClient.php | 21 +- .../V2/Client/SecurityCenterClientTest.php | 2 +- SecurityCenterManagement/.repo-metadata.json | 8 - SecurityCenterManagement/VERSION | 2 +- SecurityCenterManagement/composer.json | 2 +- .../metadata/V1/SecurityCenterManagement.php | Bin 24162 -> 27496 bytes ...e_event_threat_detection_custom_module.php | 6 +- ...ecurity_health_analytics_custom_module.php | 11 +- ...e_event_threat_detection_custom_module.php | 6 +- ...ecurity_health_analytics_custom_module.php | 6 +- ...e_event_threat_detection_custom_module.php | 6 +- ...ecurity_health_analytics_custom_module.php | 13 +- ...t_event_threat_detection_custom_module.php | 6 +- .../get_security_center_service.php | 89 + ..._event_threat_detection_custom_modules.php | 6 +- ...curity_health_analytics_custom_modules.php | 11 +- ..._event_threat_detection_custom_modules.php | 6 +- ...curity_health_analytics_custom_modules.php | 9 +- ..._event_threat_detection_custom_modules.php | 6 +- .../list_security_center_services.php | 86 + ...curity_health_analytics_custom_modules.php | 11 +- .../update_security_center_service.php | 62 + ...e_event_threat_detection_custom_module.php | 2 +- .../Client/SecurityCenterManagementClient.php | 178 + ...ventThreatDetectionCustomModuleRequest.php | 30 +- ...rityHealthAnalyticsCustomModuleRequest.php | 51 +- ...ventThreatDetectionCustomModuleRequest.php | 30 +- ...rityHealthAnalyticsCustomModuleRequest.php | 30 +- ...ectiveEventThreatDetectionCustomModule.php | 24 +- ...iveSecurityHealthAnalyticsCustomModule.php | 48 +- .../V1/EventThreatDetectionCustomModule.php | 24 +- ...ventThreatDetectionCustomModuleRequest.php | 30 +- ...rityHealthAnalyticsCustomModuleRequest.php | 53 +- ...ventThreatDetectionCustomModuleRequest.php | 30 +- .../V1/GetSecurityCenterServiceRequest.php | 135 + ...entThreatDetectionCustomModulesRequest.php | 30 +- ...ityHealthAnalyticsCustomModulesRequest.php | 51 +- ...entThreatDetectionCustomModulesRequest.php | 30 +- ...ityHealthAnalyticsCustomModulesRequest.php | 45 +- ...entThreatDetectionCustomModulesRequest.php | 30 +- .../V1/ListSecurityCenterServicesRequest.php | 175 + .../V1/ListSecurityCenterServicesResponse.php | 101 + ...ityHealthAnalyticsCustomModulesRequest.php | 51 +- .../src/V1/SecurityCenterService.php | 345 + .../SecurityCenterService/EnablementState.php | 71 + .../SecurityCenterService/ModuleSettings.php | 126 + .../SecurityHealthAnalyticsCustomModule.php | 56 +- .../src/V1/SimulatedFinding.php | 32 +- .../V1/UpdateSecurityCenterServiceRequest.php | 205 + ...ventThreatDetectionCustomModuleRequest.php | 8 +- .../src/V1/gapic_metadata.json | 15 + ...urity_center_management_client_config.json | 15 + ...ty_center_management_descriptor_config.php | 49 + ...y_center_management_rest_client_config.php | 76 + .../SecurityCenterManagementClientTest.php | 223 + SecurityPrivateCa/.repo-metadata.json | 8 - SecurityPrivateCa/VERSION | 2 +- SecurityPrivateCa/composer.json | 2 +- SecurityPublicCA/.OwlBot.yaml | 4 +- SecurityPublicCA/.repo-metadata.json | 10 - SecurityPublicCA/VERSION | 2 +- SecurityPublicCA/composer.json | 2 +- SecurityPublicCA/metadata/V1/Resources.php | 34 + SecurityPublicCA/metadata/V1/Service.php | 37 + .../create_external_account_key.php | 77 + ...ublicCertificateAuthorityServiceClient.php | 263 + .../V1/CreateExternalAccountKeyRequest.php | 154 + .../src/V1/ExternalAccountKey.php | 156 + SecurityPublicCA/src/V1/gapic_metadata.json | 23 + ...icate_authority_service_client_config.json | 39 + ...te_authority_service_descriptor_config.php | 44 + ...e_authority_service_rest_client_config.php | 41 + ...cCertificateAuthorityServiceClientTest.php | 173 + ServiceControl/.repo-metadata.json | 8 - ServiceControl/VERSION | 2 +- ServiceControl/composer.json | 2 +- ServiceDirectory/.repo-metadata.json | 8 - ServiceDirectory/VERSION | 2 +- ServiceDirectory/composer.json | 2 +- .../src/V1beta1/ListEndpointsRequest.php | 8 +- .../src/V1beta1/ListNamespacesRequest.php | 8 +- .../src/V1beta1/ListServicesRequest.php | 8 +- ServiceHealth/.repo-metadata.json | 8 - ServiceHealth/VERSION | 2 +- ServiceHealth/composer.json | 2 +- ServiceManagement/.repo-metadata.json | 8 - ServiceManagement/VERSION | 2 +- ServiceManagement/composer.json | 2 +- ServiceUsage/.repo-metadata.json | 8 - ServiceUsage/VERSION | 2 +- ServiceUsage/composer.json | 2 +- Shell/.repo-metadata.json | 8 - Shell/VERSION | 2 +- Shell/composer.json | 2 +- ShoppingCommonProtos/.repo-metadata.json | 6 - ShoppingCommonProtos/VERSION | 2 +- ShoppingCss/.repo-metadata.json | 8 - ShoppingCss/VERSION | 2 +- ShoppingCss/composer.json | 4 +- ShoppingMerchantAccounts/.OwlBot.yaml | 4 + ShoppingMerchantAccounts/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + ShoppingMerchantAccounts/CONTRIBUTING.md | 10 + ShoppingMerchantAccounts/LICENSE | 202 + ShoppingMerchantAccounts/README.md | 45 + ShoppingMerchantAccounts/VERSION | 1 + ShoppingMerchantAccounts/composer.json | 31 + .../metadata/V1Beta/Accessright.php | Bin 0 -> 940 bytes .../metadata/V1Beta/AccountTax.php | 58 + .../metadata/V1Beta/Accountissue.php | Bin 0 -> 2826 bytes .../metadata/V1Beta/Accounts.php | Bin 0 -> 4619 bytes .../metadata/V1Beta/Businessidentity.php | Bin 0 -> 3348 bytes .../metadata/V1Beta/Businessinfo.php | Bin 0 -> 3108 bytes .../metadata/V1Beta/Customerservice.php | Bin 0 -> 1155 bytes .../metadata/V1Beta/Emailpreferences.php | Bin 0 -> 2540 bytes .../metadata/V1Beta/Homepage.php | Bin 0 -> 2726 bytes .../metadata/V1Beta/OnlineReturnPolicy.php | Bin 0 -> 3952 bytes .../V1Beta/Phoneverificationstate.php | Bin 0 -> 1037 bytes .../metadata/V1Beta/Programs.php | Bin 0 -> 3086 bytes .../metadata/V1Beta/Regions.php | Bin 0 -> 3981 bytes .../metadata/V1Beta/Shippingsettings.php | Bin 0 -> 9275 bytes .../metadata/V1Beta/TaxRule.php | Bin 0 -> 1359 bytes .../metadata/V1Beta/Termsofservice.php | Bin 0 -> 2849 bytes .../V1Beta/Termsofserviceagreementstate.php | Bin 0 -> 3290 bytes .../metadata/V1Beta/Termsofservicekind.php | Bin 0 -> 953 bytes .../metadata/V1Beta/User.php | Bin 0 -> 3507 bytes ShoppingMerchantAccounts/owlbot.py | 62 + ShoppingMerchantAccounts/phpunit.xml.dist | 16 + .../list_account_issues.php | 77 + .../get_account_tax.php | 71 + .../list_account_tax.php | 80 + .../update_account_tax.php | 59 + .../create_and_configure_account.php | 85 + .../AccountsServiceClient/delete_account.php | 72 + .../AccountsServiceClient/get_account.php | 74 + .../AccountsServiceClient/list_accounts.php | 66 + .../list_sub_accounts.php | 81 + .../AccountsServiceClient/update_account.php | 86 + .../get_business_identity.php | 72 + .../update_business_identity.php | 63 + .../get_business_info.php | 72 + .../update_business_info.php | 63 + .../get_email_preferences.php | 75 + .../update_email_preferences.php | 72 + .../HomepageServiceClient/claim_homepage.php | 85 + .../HomepageServiceClient/get_homepage.php | 72 + .../unclaim_homepage.php | 72 + .../HomepageServiceClient/update_homepage.php | 75 + .../get_online_return_policy.php | 75 + .../list_online_return_policies.php | 77 + .../ProgramsServiceClient/disable_program.php | 73 + .../ProgramsServiceClient/enable_program.php | 73 + .../ProgramsServiceClient/get_program.php | 72 + .../ProgramsServiceClient/list_programs.php | 77 + .../RegionsServiceClient/create_region.php | 79 + .../RegionsServiceClient/delete_region.php | 71 + .../RegionsServiceClient/get_region.php | 72 + .../RegionsServiceClient/list_regions.php | 77 + .../RegionsServiceClient/update_region.php | 60 + .../get_shipping_settings.php | 72 + .../insert_shipping_settings.php | 94 + .../get_terms_of_service_agreement_state.php | 75 + ...ation_terms_of_service_agreement_state.php | 75 + .../accept_terms_of_service.php | 82 + .../get_terms_of_service.php | 72 + .../retrieve_latest_terms_of_service.php | 58 + .../V1beta/UserServiceClient/create_user.php | 79 + .../V1beta/UserServiceClient/delete_user.php | 74 + .../V1beta/UserServiceClient/get_user.php | 76 + .../V1beta/UserServiceClient/list_users.php | 77 + .../V1beta/UserServiceClient/update_user.php | 63 + .../V1beta/AcceptTermsOfServiceRequest.php | 162 + .../src/V1beta/Accepted.php | 173 + .../src/V1beta/AccessRight.php | 68 + .../src/V1beta/Account.php | 317 + .../src/V1beta/AccountIssue.php | 246 + .../AccountIssue/ImpactedDestination.php | 112 + .../ImpactedDestination/Impact.php | 106 + .../src/V1beta/AccountIssue/Severity.php | 70 + .../src/V1beta/AccountTax.php | 151 + .../src/V1beta/Address.php | 269 + .../src/V1beta/BusinessDayConfig.php | 71 + .../src/V1beta/BusinessDayConfig/Weekday.php | 79 + .../src/V1beta/BusinessIdentity.php | 382 + .../BusinessIdentity/IdentityAttribute.php | 68 + .../IdentityAttribute/IdentityDeclaration.php | 62 + .../BusinessIdentity/PromotionsConsent.php | 65 + .../src/V1beta/BusinessInfo.php | 247 + .../src/V1beta/CarrierRate.php | 318 + .../src/V1beta/ClaimHomepageRequest.php | 71 + .../Client/AccountIssueServiceClient.php | 246 + .../V1beta/Client/AccountTaxServiceClient.php | 333 + .../V1beta/Client/AccountsServiceClient.php | 449 + .../Client/BusinessIdentityServiceClient.php | 282 + .../Client/BusinessInfoServiceClient.php | 277 + .../Client/EmailPreferencesServiceClient.php | 298 + .../V1beta/Client/HomepageServiceClient.php | 348 + .../OnlineReturnPolicyServiceClient.php | 307 + .../V1beta/Client/ProgramsServiceClient.php | 368 + .../V1beta/Client/RegionsServiceClient.php | 391 + .../Client/ShippingSettingsServiceClient.php | 282 + ...msOfServiceAgreementStateServiceClient.php | 309 + .../Client/TermsOfServiceServiceClient.php | 327 + .../src/V1beta/Client/UserServiceClient.php | 387 + .../CreateAndConfigureAccountRequest.php | 201 + .../AcceptTermsOfService.php | 110 + .../AddAccountService.php | 125 + .../src/V1beta/CreateRegionRequest.php | 173 + .../src/V1beta/CreateUserRequest.php | 170 + .../src/V1beta/CustomerService.php | 165 + .../src/V1beta/CutoffTime.php | 181 + .../src/V1beta/DeleteAccountRequest.php | 86 + .../src/V1beta/DeleteRegionRequest.php | 86 + .../src/V1beta/DeleteUserRequest.php | 97 + .../src/V1beta/DeliveryTime.php | 487 + .../src/V1beta/DisableProgramRequest.php | 86 + .../src/V1beta/Distance.php | 126 + .../src/V1beta/Distance/Unit.php | 63 + .../src/V1beta/EmailPreferences.php | 107 + .../V1beta/EmailPreferences/OptInState.php | 71 + .../src/V1beta/EnableProgramRequest.php | 86 + .../src/V1beta/GetAccountRequest.php | 86 + .../src/V1beta/GetAccountTaxRequest.php | 81 + .../src/V1beta/GetBusinessIdentityRequest.php | 86 + .../src/V1beta/GetBusinessInfoRequest.php | 86 + .../src/V1beta/GetEmailPreferencesRequest.php | 86 + .../src/V1beta/GetHomepageRequest.php | 86 + .../V1beta/GetOnlineReturnPolicyRequest.php | 86 + .../src/V1beta/GetProgramRequest.php | 86 + .../src/V1beta/GetRegionRequest.php | 86 + .../src/V1beta/GetShippingSettingsRequest.php | 86 + ...GetTermsOfServiceAgreementStateRequest.php | 86 + .../src/V1beta/GetTermsOfServiceRequest.php | 86 + .../src/V1beta/GetUserRequest.php | 102 + .../src/V1beta/Headers.php | 302 + .../src/V1beta/Homepage.php | 153 + .../V1beta/InsertShippingSettingsRequest.php | 115 + .../src/V1beta/ListAccountIssuesRequest.php | 272 + .../src/V1beta/ListAccountIssuesResponse.php | 105 + .../src/V1beta/ListAccountTaxRequest.php | 160 + .../src/V1beta/ListAccountTaxResponse.php | 103 + .../src/V1beta/ListAccountsRequest.php | 167 + .../src/V1beta/ListAccountsResponse.php | 105 + .../ListOnlineReturnPoliciesRequest.php | 194 + .../ListOnlineReturnPoliciesResponse.php | 105 + .../src/V1beta/ListProgramsRequest.php | 166 + .../src/V1beta/ListProgramsResponse.php | 105 + .../src/V1beta/ListRegionsRequest.php | 178 + .../src/V1beta/ListRegionsResponse.php | 105 + .../src/V1beta/ListSubAccountsRequest.php | 174 + .../src/V1beta/ListSubAccountsResponse.php | 105 + .../src/V1beta/ListUsersRequest.php | 174 + .../src/V1beta/ListUsersResponse.php | 105 + .../src/V1beta/LocationIdSet.php | 84 + .../src/V1beta/MinimumOrderValueTable.php | 83 + .../StoreCodeSetWithMov.php | 116 + .../src/V1beta/OnlineReturnPolicy.php | 605 + .../OnlineReturnPolicy/ItemCondition.php | 66 + .../src/V1beta/OnlineReturnPolicy/Policy.php | 110 + .../V1beta/OnlineReturnPolicy/Policy/Type.php | 69 + .../OnlineReturnPolicy/RestockingFee.php | 112 + .../OnlineReturnPolicy/ReturnMethod.php | 69 + .../OnlineReturnPolicy/ReturnShippingFee.php | 121 + .../ReturnShippingFee/Type.php | 62 + .../src/V1beta/PhoneVerificationState.php | 61 + .../src/V1beta/Program.php | 236 + .../src/V1beta/Program/Requirement.php | 152 + .../src/V1beta/Program/State.php | 69 + .../src/V1beta/RateGroup.php | 310 + .../src/V1beta/Region.php | 362 + .../src/V1beta/Region/GeoTargetArea.php | 76 + .../src/V1beta/Region/PostalCodeArea.php | 112 + .../Region/PostalCodeArea/PostalCodeRange.php | 138 + .../src/V1beta/Required.php | 117 + ...ionTermsOfServiceAgreementStateRequest.php | 87 + .../RetrieveLatestTermsOfServiceRequest.php | 109 + ShoppingMerchantAccounts/src/V1beta/Row.php | 75 + .../src/V1beta/Service.php | 531 + .../src/V1beta/Service/LoyaltyProgram.php | 121 + .../LoyaltyProgram/LoyaltyProgramTiers.php | 90 + .../src/V1beta/Service/ShipmentType.php | 71 + .../src/V1beta/Service/StoreConfig.php | 213 + .../Service/StoreConfig/CutoffConfig.php | 198 + .../CutoffConfig/LocalCutoffTime.php | 130 + .../Service/StoreConfig/StoreServiceType.php | 65 + .../src/V1beta/ShippingSettings.php | 222 + ShoppingMerchantAccounts/src/V1beta/Table.php | 208 + .../src/V1beta/TaxRule.php | 332 + .../src/V1beta/TaxRule/TaxPostalCodeRange.php | 110 + .../src/V1beta/TermsOfService.php | 245 + .../V1beta/TermsOfServiceAgreementState.php | 254 + .../src/V1beta/TermsOfServiceKind.php | 54 + .../src/V1beta/TransitTable.php | 181 + .../V1beta/TransitTable/TransitTimeRow.php | 72 + .../TransitTimeRow/TransitTimeValue.php | 126 + .../src/V1beta/UnclaimHomepageRequest.php | 71 + .../src/V1beta/UpdateAccountRequest.php | 136 + .../src/V1beta/UpdateAccountTaxRequest.php | 149 + .../V1beta/UpdateBusinessIdentityRequest.php | 136 + .../src/V1beta/UpdateBusinessInfoRequest.php | 136 + .../V1beta/UpdateEmailPreferencesRequest.php | 136 + .../src/V1beta/UpdateHomepageRequest.php | 136 + .../src/V1beta/UpdateRegionRequest.php | 146 + .../src/V1beta/UpdateUserRequest.php | 147 + ShoppingMerchantAccounts/src/V1beta/User.php | 155 + .../src/V1beta/User/State.php | 63 + ShoppingMerchantAccounts/src/V1beta/Value.php | 276 + .../src/V1beta/Warehouse.php | 274 + .../src/V1beta/WarehouseBasedDeliveryTime.php | 176 + .../src/V1beta/WarehouseCutoffTime.php | 139 + .../src/V1beta/gapic_metadata.json | 350 + .../account_issue_service_client_config.json | 27 + ...ccount_issue_service_descriptor_config.php | 51 + ...count_issue_service_rest_client_config.php | 40 + .../account_tax_service_client_config.json | 37 + .../account_tax_service_descriptor_config.php | 77 + ...account_tax_service_rest_client_config.php | 64 + .../accounts_service_client_config.json | 64 + .../accounts_service_descriptor_config.php | 106 + .../accounts_service_rest_client_config.php | 87 + ...siness_identity_service_client_config.json | 32 + ...ess_identity_service_descriptor_config.php | 56 + ...ss_identity_service_rest_client_config.php | 56 + .../business_info_service_client_config.json | 32 + ...usiness_info_service_descriptor_config.php | 56 + ...siness_info_service_rest_client_config.php | 56 + ...ail_preferences_service_client_config.json | 32 + ..._preferences_service_descriptor_config.php | 56 + ...preferences_service_rest_client_config.php | 56 + .../homepage_service_client_config.json | 42 + .../homepage_service_descriptor_config.php | 80 + .../homepage_service_rest_client_config.php | 80 + ...e_return_policy_service_client_config.json | 44 + ...eturn_policy_service_descriptor_config.php | 64 + ...turn_policy_service_rest_client_config.php | 51 + .../programs_service_client_config.json | 42 + .../programs_service_descriptor_config.php | 88 + .../programs_service_rest_client_config.php | 75 + .../regions_service_client_config.json | 47 + .../regions_service_descriptor_config.php | 101 + .../regions_service_rest_client_config.php | 90 + ...ipping_settings_service_client_config.json | 32 + ...ing_settings_service_descriptor_config.php | 55 + ...ng_settings_service_rest_client_config.php | 52 + ...agreement_state_service_client_config.json | 32 + ...eement_state_service_descriptor_config.php | 56 + ...ement_state_service_rest_client_config.php | 51 + ...erms_of_service_service_client_config.json | 49 + ...s_of_service_service_descriptor_config.php | 60 + ..._of_service_service_rest_client_config.php | 55 + .../resources/user_service_client_config.json | 47 + .../user_service_descriptor_config.php | 101 + .../user_service_rest_client_config.php | 93 + .../Client/AccountIssueServiceClientTest.php | 176 + .../Client/AccountTaxServiceClientTest.php | 308 + .../Client/AccountsServiceClientTest.php | 575 + .../BusinessIdentityServiceClientTest.php | 241 + .../Client/BusinessInfoServiceClientTest.php | 237 + .../EmailPreferencesServiceClientTest.php | 241 + .../Client/HomepageServiceClientTest.php | 384 + .../OnlineReturnPolicyServiceClientTest.php | 263 + .../Client/ProgramsServiceClientTest.php | 370 + .../Client/RegionsServiceClientTest.php | 457 + .../ShippingSettingsServiceClientTest.php | 246 + ...ServiceAgreementStateServiceClientTest.php | 238 + .../TermsOfServiceServiceClientTest.php | 325 + .../V1beta/Client/UserServiceClientTest.php | 454 + .../.repo-metadata.json | 8 - ShoppingMerchantConversions/VERSION | 2 +- ShoppingMerchantConversions/composer.json | 2 +- .../src/V1beta/MerchantCenterDestination.php | 2 +- ShoppingMerchantDatasources/.OwlBot.yaml | 4 + ShoppingMerchantDatasources/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + ShoppingMerchantDatasources/CONTRIBUTING.md | 10 + ShoppingMerchantDatasources/LICENSE | 202 + ShoppingMerchantDatasources/README.md | 45 + ShoppingMerchantDatasources/VERSION | 1 + ShoppingMerchantDatasources/composer.json | 30 + .../metadata/V1Beta/Datasources.php | Bin 0 -> 5123 bytes .../metadata/V1Beta/Datasourcetypes.php | Bin 0 -> 1712 bytes .../metadata/V1Beta/Fileinputs.php | Bin 0 -> 1892 bytes ShoppingMerchantDatasources/owlbot.py | 62 + ShoppingMerchantDatasources/phpunit.xml.dist | 16 + .../create_data_source.php | 91 + .../delete_data_source.php | 70 + .../fetch_data_source.php | 74 + .../get_data_source.php | 72 + .../list_data_sources.php | 77 + .../update_data_source.php | 85 + .../Client/DataSourcesServiceClient.php | 419 + .../src/V1beta/CreateDataSourceRequest.php | 132 + .../src/V1beta/DataSource.php | 434 + .../src/V1beta/DataSource/Input.php | 85 + .../src/V1beta/DeleteDataSourceRequest.php | 86 + .../src/V1beta/FetchDataSourceRequest.php | 71 + .../src/V1beta/FileInput.php | 158 + .../src/V1beta/FileInput/FetchSettings.php | 402 + .../FileInput/FetchSettings/Frequency.php | 84 + .../src/V1beta/FileInput/FileInputType.php | 72 + .../src/V1beta/GetDataSourceRequest.php | 86 + .../src/V1beta/ListDataSourcesRequest.php | 178 + .../src/V1beta/ListDataSourcesResponse.php | 105 + .../src/V1beta/LocalInventoryDataSource.php | 125 + .../src/V1beta/PrimaryProductDataSource.php | 265 + .../PrimaryProductDataSource/Channel.php | 71 + .../src/V1beta/PromotionDataSource.php | 121 + .../V1beta/RegionalInventoryDataSource.php | 125 + .../V1beta/SupplementalProductDataSource.php | 189 + .../src/V1beta/UpdateDataSourceRequest.php | 158 + .../src/V1beta/gapic_metadata.json | 48 + .../data_sources_service_client_config.json | 64 + ...data_sources_service_descriptor_config.php | 113 + ...ata_sources_service_rest_client_config.php | 102 + .../Client/DataSourcesServiceClientTest.php | 570 + .../.repo-metadata.json | 7 - ShoppingMerchantInventories/VERSION | 2 +- ShoppingMerchantInventories/composer.json | 4 +- .../insert_local_inventory.php | 2 +- .../LocalInventoryServiceGapicClient.php | 477 - .../RegionalInventoryServiceGapicClient.php | 477 - .../src/V1beta/LocalInventory.php | 42 +- .../V1beta/LocalInventoryServiceClient.php | 36 - .../src/V1beta/RegionalInventory.php | 18 +- .../V1beta/RegionalInventoryServiceClient.php | 36 - .../LocalInventoryServiceClientTest.php | 270 - .../RegionalInventoryServiceClientTest.php | 262 - ShoppingMerchantLfp/.OwlBot.yaml | 4 + ShoppingMerchantLfp/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + ShoppingMerchantLfp/CONTRIBUTING.md | 10 + ShoppingMerchantLfp/LICENSE | 202 + ShoppingMerchantLfp/README.md | 45 + ShoppingMerchantLfp/VERSION | 1 + ShoppingMerchantLfp/composer.json | 31 + .../metadata/V1Beta/Lfpinventory.php | Bin 0 -> 2529 bytes .../metadata/V1Beta/Lfpsale.php | Bin 0 -> 2254 bytes .../metadata/V1Beta/Lfpstore.php | Bin 0 -> 3379 bytes ShoppingMerchantLfp/owlbot.py | 62 + ShoppingMerchantLfp/phpunit.xml.dist | 16 + .../insert_lfp_inventory.php | 121 + .../LfpSaleServiceClient/insert_lfp_sale.php | 126 + .../delete_lfp_store.php | 74 + .../LfpStoreServiceClient/get_lfp_store.php | 76 + .../insert_lfp_store.php | 95 + .../LfpStoreServiceClient/list_lfp_stores.php | 81 + .../Client/LfpInventoryServiceClient.php | 278 + .../V1beta/Client/LfpSaleServiceClient.php | 249 + .../V1beta/Client/LfpStoreServiceClient.php | 360 + .../src/V1beta/DeleteLfpStoreRequest.php | 86 + .../src/V1beta/GetLfpStoreRequest.php | 86 + .../src/V1beta/InsertLfpInventoryRequest.php | 115 + .../src/V1beta/InsertLfpSaleRequest.php | 115 + .../src/V1beta/InsertLfpStoreRequest.php | 132 + .../src/V1beta/LfpInventory.php | 671 + ShoppingMerchantLfp/src/V1beta/LfpSale.php | 529 + ShoppingMerchantLfp/src/V1beta/LfpStore.php | 564 + .../V1beta/LfpStore/StoreMatchingState.php | 63 + .../src/V1beta/ListLfpStoresRequest.php | 224 + .../src/V1beta/ListLfpStoresResponse.php | 105 + .../src/V1beta/gapic_metadata.json | 66 + .../lfp_inventory_service_client_config.json | 39 + ...fp_inventory_service_descriptor_config.php | 44 + ...p_inventory_service_rest_client_config.php | 41 + .../lfp_sale_service_client_config.json | 39 + .../lfp_sale_service_descriptor_config.php | 43 + .../lfp_sale_service_rest_client_config.php | 41 + .../lfp_store_service_client_config.json | 54 + .../lfp_store_service_descriptor_config.php | 88 + .../lfp_store_service_rest_client_config.php | 77 + .../Client/LfpInventoryServiceClientTest.php | 250 + .../Client/LfpSaleServiceClientTest.php | 256 + .../Client/LfpStoreServiceClientTest.php | 409 + ShoppingMerchantNotifications/.OwlBot.yaml | 4 + ShoppingMerchantNotifications/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + ShoppingMerchantNotifications/CONTRIBUTING.md | 10 + ShoppingMerchantNotifications/LICENSE | 202 + ShoppingMerchantNotifications/README.md | 45 + ShoppingMerchantNotifications/VERSION | 1 + ShoppingMerchantNotifications/composer.json | 31 + .../metadata/V1Beta/Notificationsapi.php | Bin 0 -> 5458 bytes ShoppingMerchantNotifications/owlbot.py | 62 + .../phpunit.xml.dist | 16 + .../create_notification_subscription.php | 85 + .../delete_notification_subscription.php | 72 + .../get_notification_subscription.php | 74 + .../list_notification_subscriptions.php | 77 + .../update_notification_subscription.php | 59 + .../src/V1beta/Attribute.php | 55 + .../Client/NotificationsApiServiceClient.php | 411 + .../CreateNotificationSubscriptionRequest.php | 132 + .../DeleteNotificationSubscriptionRequest.php | 81 + .../GetNotificationSubscriptionRequest.php | 81 + .../ListNotificationSubscriptionsRequest.php | 166 + .../ListNotificationSubscriptionsResponse.php | 105 + .../src/V1beta/NotificationSubscription.php | 235 + .../NotificationEventType.php | 57 + .../src/V1beta/ProductChange.php | 210 + .../src/V1beta/ProductStatusChangeMessage.php | 352 + .../src/V1beta/Resource.php | 55 + .../UpdateNotificationSubscriptionRequest.php | 141 + .../src/V1beta/gapic_metadata.json | 43 + ...tifications_api_service_client_config.json | 59 + ...ications_api_service_descriptor_config.php | 101 + ...cations_api_service_rest_client_config.php | 87 + .../NotificationsApiServiceClientTest.php | 477 + ShoppingMerchantProducts/.OwlBot.yaml | 4 + ShoppingMerchantProducts/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + ShoppingMerchantProducts/CONTRIBUTING.md | 10 + ShoppingMerchantProducts/LICENSE | 202 + ShoppingMerchantProducts/README.md | 45 + ShoppingMerchantProducts/VERSION | 1 + ShoppingMerchantProducts/composer.json | 31 + .../metadata/V1Beta/Productinputs.php | Bin 0 -> 2868 bytes .../metadata/V1Beta/Products.php | Bin 0 -> 2821 bytes .../metadata/V1Beta/ProductsCommon.php | Bin 0 -> 9898 bytes ShoppingMerchantProducts/owlbot.py | 62 + ShoppingMerchantProducts/phpunit.xml.dist | 16 + .../delete_product_input.php | 78 + .../insert_product_input.php | 122 + .../ProductsServiceClient/get_product.php | 75 + .../ProductsServiceClient/list_products.php | 82 + .../src/V1beta/Attributes.php | 4169 ++++++ .../src/V1beta/Certification.php | 232 + .../Client/ProductInputsServiceClient.php | 304 + .../V1beta/Client/ProductsServiceClient.php | 305 + .../CloudExportAdditionalProperties.php | 409 + .../src/V1beta/DeleteProductInputRequest.php | 128 + .../src/V1beta/FreeShippingThreshold.php | 133 + .../src/V1beta/GetProductRequest.php | 86 + .../src/V1beta/InsertProductInputRequest.php | 161 + .../src/V1beta/Installment.php | 211 + .../src/V1beta/ListProductsRequest.php | 178 + .../src/V1beta/ListProductsResponse.php | 109 + .../src/V1beta/LoyaltyPoints.php | 147 + .../src/V1beta/LoyaltyProgram.php | 277 + .../src/V1beta/Product.php | 518 + .../src/V1beta/ProductDetail.php | 135 + .../src/V1beta/ProductDimension.php | 117 + .../src/V1beta/ProductInput.php | 511 + .../src/V1beta/ProductStatus.php | 246 + .../ProductStatus/DestinationStatus.php | 178 + .../V1beta/ProductStatus/ItemLevelIssue.php | 344 + .../ProductStatus/ItemLevelIssue/Severity.php | 71 + .../V1beta/ProductStructuredDescription.php | 133 + .../src/V1beta/ProductStructuredTitle.php | 133 + .../src/V1beta/ProductWeight.php | 125 + .../src/V1beta/Shipping.php | 637 + .../src/V1beta/ShippingDimension.php | 105 + .../src/V1beta/ShippingWeight.php | 105 + .../src/V1beta/SubscriptionCost.php | 157 + .../src/V1beta/SubscriptionPeriod.php | 61 + ShoppingMerchantProducts/src/V1beta/Tax.php | 265 + .../src/V1beta/UnitPricingBaseMeasure.php | 101 + .../src/V1beta/UnitPricingMeasure.php | 101 + .../src/V1beta/gapic_metadata.json | 47 + .../product_inputs_service_client_config.json | 44 + ...oduct_inputs_service_descriptor_config.php | 56 + ...duct_inputs_service_rest_client_config.php | 55 + .../products_service_client_config.json | 44 + .../products_service_descriptor_config.php | 64 + .../products_service_rest_client_config.php | 51 + .../Client/ProductInputsServiceClientTest.php | 275 + .../Client/ProductsServiceClientTest.php | 250 + ShoppingMerchantPromotions/.OwlBot.yaml | 4 + ShoppingMerchantPromotions/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + ShoppingMerchantPromotions/CONTRIBUTING.md | 10 + ShoppingMerchantPromotions/LICENSE | 202 + ShoppingMerchantPromotions/README.md | 45 + ShoppingMerchantPromotions/VERSION | 1 + ShoppingMerchantPromotions/composer.json | 31 + .../metadata/V1Beta/Promotions.php | Bin 0 -> 3316 bytes .../metadata/V1Beta/PromotionsCommon.php | Bin 0 -> 4582 bytes ShoppingMerchantPromotions/owlbot.py | 62 + ShoppingMerchantPromotions/phpunit.xml.dist | 16 + .../PromotionsServiceClient/get_promotion.php | 75 + .../insert_promotion.php | 124 + .../list_promotions.php | 81 + .../src/V1beta/Attributes.php | 1533 +++ .../V1beta/Client/PromotionsServiceClient.php | 317 + .../src/V1beta/CouponValueType.php | 139 + .../src/V1beta/GetPromotionRequest.php | 86 + .../src/V1beta/InsertPromotionRequest.php | 161 + .../src/V1beta/ListPromotionsRequest.php | 177 + .../src/V1beta/ListPromotionsResponse.php | 105 + .../src/V1beta/OfferType.php | 62 + .../src/V1beta/ProductApplicability.php | 61 + .../src/V1beta/Promotion.php | 539 + .../src/V1beta/PromotionStatus.php | 213 + .../PromotionStatus/DestinationStatus.php | 102 + .../DestinationStatus/State.php | 91 + .../V1beta/PromotionStatus/ItemLevelIssue.php | 348 + .../ItemLevelIssue/Severity.php | 71 + .../src/V1beta/RedemptionChannel.php | 62 + .../src/V1beta/StoreApplicability.php | 62 + .../src/V1beta/gapic_metadata.json | 33 + .../promotions_service_client_config.json | 49 + .../promotions_service_descriptor_config.php | 75 + .../promotions_service_rest_client_config.php | 63 + .../Client/PromotionsServiceClientTest.php | 368 + ShoppingMerchantQuota/.repo-metadata.json | 8 - ShoppingMerchantQuota/VERSION | 2 +- ShoppingMerchantQuota/composer.json | 2 +- ShoppingMerchantReports/.repo-metadata.json | 8 - ShoppingMerchantReports/VERSION | 2 +- ShoppingMerchantReports/composer.json | 4 +- .../metadata/V1Beta/Reports.php | Bin 13613 -> 14128 bytes .../V1beta/BestSellersProductClusterView.php | 40 +- .../src/V1beta/NonProductPerformanceView.php | 52 +- .../src/V1beta/PriceInsightsProductView.php | 34 + .../Effectiveness.php | 74 + .../src/V1beta/ProductView.php | 8 +- .../AggregatedReportingContextStatus.php | 2 +- .../src/V1beta/ReportRow.php | 44 + Spanner/.repo-metadata.json | 8 - Spanner/VERSION | 2 +- Spanner/composer.json | 2 +- Spanner/metadata/Admin/Database/V1/Backup.php | Bin 5112 -> 5331 bytes Spanner/metadata/Admin/Database/V1/Common.php | Bin 2156 -> 2220 bytes .../Database/V1/SpannerDatabaseAdmin.php | Bin 11879 -> 11945 bytes Spanner/metadata/V1/Spanner.php | Bin 11400 -> 11701 bytes Spanner/src/Admin/Database/V1/Backup.php | 138 +- Spanner/src/Admin/Database/V1/BackupInfo.php | 44 +- .../V1/Client/DatabaseAdminClient.php | 37 +- .../V1/CopyBackupEncryptionConfig.php | 106 +- .../EncryptionType.php | 15 +- .../Admin/Database/V1/CopyBackupMetadata.php | 14 +- .../Admin/Database/V1/CopyBackupRequest.php | 63 +- .../V1/CreateBackupEncryptionConfig.php | 102 +- .../EncryptionType.php | 7 +- .../Database/V1/CreateBackupMetadata.php | 12 +- .../Admin/Database/V1/CreateBackupRequest.php | 43 +- .../Database/V1/CreateDatabaseRequest.php | 19 +- Spanner/src/Admin/Database/V1/Database.php | 44 +- .../src/Admin/Database/V1/DatabaseDialect.php | 2 +- .../src/Admin/Database/V1/DatabaseRole.php | 24 +- .../Admin/Database/V1/DeleteBackupRequest.php | 3 +- .../Admin/Database/V1/DropDatabaseRequest.php | 3 +- .../Admin/Database/V1/EncryptionConfig.php | 86 + .../src/Admin/Database/V1/EncryptionInfo.php | 40 +- .../V1/Gapic/DatabaseAdminGapicClient.php | 134 +- .../Admin/Database/V1/GetBackupRequest.php | 3 +- .../Database/V1/GetDatabaseDdlRequest.php | 3 +- .../Database/V1/GetDatabaseDdlResponse.php | 3 +- .../Admin/Database/V1/GetDatabaseRequest.php | 3 +- .../V1/ListBackupOperationsRequest.php | 140 +- .../Admin/Database/V1/ListBackupsRequest.php | 47 +- .../Admin/Database/V1/ListBackupsResponse.php | 19 +- .../V1/ListDatabaseOperationsRequest.php | 48 +- .../Database/V1/ListDatabaseRolesRequest.php | 33 +- .../Database/V1/ListDatabaseRolesResponse.php | 3 +- .../Database/V1/ListDatabasesRequest.php | 23 +- .../Database/V1/ListDatabasesResponse.php | 19 +- .../V1/RestoreDatabaseEncryptionConfig.php | 118 +- .../EncryptionType.php | 3 +- .../Database/V1/RestoreDatabaseMetadata.php | 44 +- .../Database/V1/RestoreDatabaseRequest.php | 48 +- .../Admin/Database/V1/UpdateBackupRequest.php | 3 +- .../Database/V1/UpdateDatabaseDdlRequest.php | 60 +- .../src/Connection/ConnectionInterface.php | 5 + Spanner/src/Connection/Grpc.php | 156 +- Spanner/src/Database.php | 92 + Spanner/src/MutationGroup.php | 43 + Spanner/src/MutationTrait.php | 342 + Spanner/src/Operation.php | 38 +- Spanner/src/PgOid.php | 102 + Spanner/src/SpannerClient.php | 17 +- Spanner/src/Transaction.php | 229 +- Spanner/src/V1/Gapic/SpannerGapicClient.php | 42 + Spanner/src/V1/ReadRequest.php | 92 + Spanner/src/V1/ReadRequest/LockHint.php | 95 + Spanner/src/V1/ReadRequest/OrderBy.php | 67 + Spanner/src/ValueMapper.php | 15 +- Spanner/tests/Snippet/PgOidTest.php | 37 + Spanner/tests/Snippet/SpannerClientTest.php | 2 + Spanner/tests/System/PgQueryTest.php | 36 +- Spanner/tests/Unit/ArrayTypeTest.php | 1 + Spanner/tests/Unit/SpannerClientTest.php | 7 + Spanner/tests/Unit/ValueMapperTest.php | 27 + Speech/.repo-metadata.json | 8 - Speech/VERSION | 2 +- Speech/composer.json | 2 +- Speech/src/SpeechClient.php | 2 +- SqlAdmin/.repo-metadata.json | 8 - SqlAdmin/VERSION | 2 +- SqlAdmin/composer.json | 2 +- SqlAdmin/metadata/V1/CloudSqlInstances.php | Bin 19939 -> 22017 bytes SqlAdmin/metadata/V1/CloudSqlResources.php | Bin 14057 -> 15203 bytes SqlAdmin/metadata/V1Beta4/CloudSql.php | Bin 17746 -> 18990 bytes .../metadata/V1Beta4/CloudSqlResources.php | Bin 25414 -> 27463 bytes .../acquire_ssrs_lease.php | 80 + .../promote_replica.php | 3 +- .../release_ssrs_lease.php | 76 + .../SqlInstancesServiceClient/switchover.php | 3 +- .../acquire_ssrs_lease.php | 71 + .../promote_replica.php | 3 +- .../release_ssrs_lease.php | 71 + .../SqlInstancesServiceClient/switchover.php | 3 +- SqlAdmin/src/V1/AcquireSsrsLeaseContext.php | 217 + SqlAdmin/src/V1/BackupConfiguration.php | 48 + .../TransactionalLogStorageState.php | 83 + .../V1/Client/SqlInstancesServiceClient.php | 64 +- SqlAdmin/src/V1/DatabaseInstance.php | 100 + SqlAdmin/src/V1/GeminiInstanceConfig.php | 297 + SqlAdmin/src/V1/ImportContext.php | 44 + .../src/V1/ImportContext/SqlImportOptions.php | 174 + .../V1/InstancesAcquireSsrsLeaseRequest.php | 77 + SqlAdmin/src/V1/IpConfiguration.php | 108 +- SqlAdmin/src/V1/IpConfiguration/SslMode.php | 12 +- SqlAdmin/src/V1/Operation.php | 44 + .../src/V1/Operation/SqlOperationType.php | 45 + SqlAdmin/src/V1/ReplicationCluster.php | 128 + SqlAdmin/src/V1/Settings.php | 89 + SqlAdmin/src/V1/SqlDatabaseVersion.php | 35 + .../SqlExternalSyncSettingErrorType.php | 32 + .../SqlInstancesAcquireSsrsLeaseRequest.php | 161 + .../SqlInstancesAcquireSsrsLeaseResponse.php | 67 + .../V1/SqlInstancesPromoteReplicaRequest.php | 40 +- .../SqlInstancesReleaseSsrsLeaseRequest.php | 113 + .../SqlInstancesReleaseSsrsLeaseResponse.php | 67 + .../SqlInstancesStartExternalSyncRequest.php | 42 + ...ancesVerifyExternalSyncSettingsRequest.php | 80 + .../MigrationType.php | 63 + SqlAdmin/src/V1/gapic_metadata.json | 10 + .../sql_instances_service_client_config.json | 10 + ...ql_instances_service_descriptor_config.php | 36 + ...l_instances_service_rest_client_config.php | 33 + .../src/V1beta4/AcquireSsrsLeaseContext.php | 217 + SqlAdmin/src/V1beta4/BackupConfiguration.php | 48 + .../TransactionalLogStorageState.php | 83 + SqlAdmin/src/V1beta4/DatabaseInstance.php | 100 + .../Gapic/SqlInstancesServiceGapicClient.php | 180 +- SqlAdmin/src/V1beta4/GeminiInstanceConfig.php | 297 + SqlAdmin/src/V1beta4/ImportContext.php | 44 + .../ImportContext/SqlImportOptions.php | 174 + .../InstancesAcquireSsrsLeaseRequest.php | 77 + SqlAdmin/src/V1beta4/IpConfiguration.php | 108 +- .../src/V1beta4/IpConfiguration/SslMode.php | 12 +- SqlAdmin/src/V1beta4/Operation.php | 44 + .../V1beta4/Operation/SqlOperationType.php | 45 + SqlAdmin/src/V1beta4/ReplicationCluster.php | 148 + SqlAdmin/src/V1beta4/Settings.php | 89 + SqlAdmin/src/V1beta4/SqlDatabaseVersion.php | 35 + .../SqlInstancesAcquireSsrsLeaseRequest.php | 161 + .../SqlInstancesAcquireSsrsLeaseResponse.php | 77 + .../SqlInstancesPromoteReplicaRequest.php | 40 +- .../SqlInstancesReleaseSsrsLeaseRequest.php | 117 + .../SqlInstancesReleaseSsrsLeaseResponse.php | 67 + .../SqlInstancesStartExternalSyncRequest.php | 42 + ...ancesVerifyExternalSyncSettingsRequest.php | 80 + .../MigrationType.php | 63 + SqlAdmin/src/V1beta4/gapic_metadata.json | 10 + .../sql_instances_service_client_config.json | 10 + ...l_instances_service_rest_client_config.php | 33 + .../Client/SqlInstancesServiceClientTest.php | 190 +- .../V1beta4/SqlInstancesServiceClientTest.php | 130 + Storage/.repo-metadata.json | 8 - Storage/VERSION | 2 +- .../ServiceDefinition/storage-v1.json | 10614 ++++++++-------- Storage/src/StorageClient.php | 4 +- Storage/tests/System/ManageBucketsTest.php | 27 + StorageControl/.repo-metadata.json | 8 - StorageControl/VERSION | 2 +- StorageControl/composer.json | 2 +- StorageControl/metadata/V2/StorageControl.php | Bin 7875 -> 7876 bytes .../delete_managed_folder.php | 2 +- .../get_managed_folder.php | 2 +- .../src/V2/Client/StorageControlClient.php | 25 +- .../storage_control_descriptor_config.php | 2 +- .../V2/Client/StorageControlClientTest.php | 10 +- StorageInsights/.repo-metadata.json | 8 - StorageInsights/VERSION | 2 +- StorageInsights/composer.json | 2 +- StorageTransfer/.repo-metadata.json | 8 - StorageTransfer/VERSION | 2 +- StorageTransfer/composer.json | 2 +- Support/.repo-metadata.json | 8 - Support/VERSION | 2 +- Support/composer.json | 2 +- Talent/.repo-metadata.json | 8 - Talent/VERSION | 2 +- Talent/composer.json | 2 +- Tasks/.repo-metadata.json | 8 - Tasks/VERSION | 2 +- Tasks/composer.json | 2 +- TelcoAutomation/.repo-metadata.json | 8 - TelcoAutomation/VERSION | 2 +- TelcoAutomation/composer.json | 2 +- .../src/V1/Client/TelcoAutomationClient.php | 21 +- .../V1/Client/TelcoAutomationClientTest.php | 2 +- TextToSpeech/.repo-metadata.json | 8 - TextToSpeech/VERSION | 2 +- TextToSpeech/composer.json | 2 +- Tpu/.repo-metadata.json | 8 - Tpu/VERSION | 2 +- Tpu/composer.json | 2 +- Tpu/src/V2/Client/TpuClient.php | 21 +- Tpu/tests/Unit/V2/Client/TpuClientTest.php | 2 +- Trace/.repo-metadata.json | 8 - Trace/VERSION | 2 +- Trace/composer.json | 2 +- Trace/src/TraceClient.php | 2 +- Translate/.repo-metadata.json | 8 - Translate/VERSION | 2 +- Translate/composer.json | 2 +- VideoIntelligence/.repo-metadata.json | 8 - VideoIntelligence/VERSION | 2 +- VideoIntelligence/composer.json | 2 +- VideoLiveStream/.repo-metadata.json | 8 - VideoLiveStream/VERSION | 2 +- VideoLiveStream/composer.json | 2 +- VideoStitcher/.repo-metadata.json | 8 - VideoStitcher/VERSION | 2 +- VideoStitcher/composer.json | 2 +- VideoStitcher/metadata/V1/CdnKeys.php | Bin 1437 -> 1567 bytes VideoStitcher/metadata/V1/FetchOptions.php | 32 + VideoStitcher/metadata/V1/LiveConfigs.php | Bin 2066 -> 2272 bytes VideoStitcher/metadata/V1/Sessions.php | Bin 3688 -> 3981 bytes .../metadata/V1/VideoStitcherService.php | 54 +- VideoStitcher/metadata/V1/VodConfigs.php | Bin 0 -> 1571 bytes .../create_live_config.php | 4 +- .../create_vod_config.php | 100 + .../create_vod_session.php | 21 +- .../delete_vod_config.php | 85 + .../get_vod_config.php | 77 + .../list_vod_configs.php | 78 + .../update_live_config.php | 92 + .../update_vod_config.php | 91 + .../V1/Client/VideoStitcherServiceClient.php | 195 + .../src/V1/CreateVodConfigRequest.php | 242 + .../src/V1/DeleteVodConfigRequest.php | 86 + VideoStitcher/src/V1/FetchOptions.php | 79 + VideoStitcher/src/V1/GamVodConfig.php | 48 +- .../Gapic/VideoStitcherServiceGapicClient.php | 527 + VideoStitcher/src/V1/GetVodConfigRequest.php | 86 + .../src/V1/ListVodConfigsRequest.php | 238 + .../src/V1/ListVodConfigsResponse.php | 135 + VideoStitcher/src/V1/LiveAdTagDetail.php | 4 +- VideoStitcher/src/V1/LiveConfig.php | 60 +- VideoStitcher/src/V1/LiveSession.php | 78 +- .../src/V1/LiveSession/GamSettings.php | 61 +- VideoStitcher/src/V1/MediaCdnKey.php | 48 + .../src/V1/MediaCdnKey/TokenConfig.php | 88 + .../src/V1/UpdateLiveConfigRequest.php | 151 + .../src/V1/UpdateVodConfigRequest.php | 151 + VideoStitcher/src/V1/VodConfig.php | 261 + VideoStitcher/src/V1/VodConfig/State.php | 69 + VideoStitcher/src/V1/VodSession.php | 130 +- VideoStitcher/src/V1/VodStitchDetail.php | 6 +- VideoStitcher/src/V1/gapic_metadata.json | 30 + .../video_stitcher_service_client_config.json | 30 + ...deo_stitcher_service_descriptor_config.php | 111 + ...eo_stitcher_service_rest_client_config.php | 80 + .../Client/VideoStitcherServiceClientTest.php | 754 +- .../V1/VideoStitcherServiceClientTest.php | 718 +- VideoTranscoder/.OwlBot.yaml | 2 +- VideoTranscoder/.repo-metadata.json | 8 - VideoTranscoder/README.md | 5 +- VideoTranscoder/VERSION | 2 +- VideoTranscoder/composer.json | 2 +- .../metadata/V1Beta1/Resources.php | Bin 8793 -> 0 bytes VideoTranscoder/metadata/V1Beta1/Services.php | 82 - VideoTranscoder/owlbot.py | 49 +- VideoTranscoder/src/V1/AdBreak.php | 2 +- VideoTranscoder/src/V1/AudioStream.php | 12 +- .../src/V1/AudioStream/AudioMapping.php | 12 +- .../src/V1/Client/TranscoderServiceClient.php | 6 +- VideoTranscoder/src/V1/CreateJobRequest.php | 4 +- .../src/V1/CreateJobTemplateRequest.php | 6 +- VideoTranscoder/src/V1/DeleteJobRequest.php | 4 +- .../src/V1/DeleteJobTemplateRequest.php | 4 +- VideoTranscoder/src/V1/EditAtom.php | 6 +- VideoTranscoder/src/V1/ElementaryStream.php | 2 +- VideoTranscoder/src/V1/Encryption.php | 4 +- .../src/V1/Encryption/DrmSystems.php | 8 +- .../V1/Encryption/MpegCommonEncryption.php | 2 +- .../src/V1/Encryption/SecretManagerSource.php | 2 +- .../V1/Gapic/TranscoderServiceGapicClient.php | 760 -- VideoTranscoder/src/V1/GetJobRequest.php | 2 +- .../src/V1/GetJobTemplateRequest.php | 2 +- VideoTranscoder/src/V1/Input.php | 6 +- VideoTranscoder/src/V1/Job.php | 24 +- VideoTranscoder/src/V1/JobConfig.php | 4 +- VideoTranscoder/src/V1/JobTemplate.php | 4 +- .../src/V1/ListJobTemplatesRequest.php | 10 +- .../src/V1/ListJobTemplatesResponse.php | 2 +- VideoTranscoder/src/V1/ListJobsRequest.php | 10 +- VideoTranscoder/src/V1/ListJobsResponse.php | 2 +- VideoTranscoder/src/V1/Manifest.php | 4 +- .../src/V1/Manifest/DashConfig.php | 2 +- VideoTranscoder/src/V1/MuxStream.php | 10 +- VideoTranscoder/src/V1/Output.php | 2 +- VideoTranscoder/src/V1/Overlay.php | 2 +- .../src/V1/Overlay/AnimationEnd.php | 2 +- .../src/V1/Overlay/AnimationFade.php | 8 +- .../src/V1/Overlay/AnimationStatic.php | 4 +- VideoTranscoder/src/V1/Overlay/Image.php | 6 +- .../src/V1/Overlay/NormalizedCoordinate.php | 4 +- .../src/V1/PreprocessingConfig.php | 14 +- .../src/V1/PreprocessingConfig/Audio.php | 6 +- .../src/V1/PreprocessingConfig/Color.php | 6 +- .../src/V1/PreprocessingConfig/Crop.php | 8 +- .../src/V1/PreprocessingConfig/Deblock.php | 4 +- .../Deinterlace/BwdifConfig.php | 6 +- .../Deinterlace/YadifConfig.php | 8 +- .../src/V1/PreprocessingConfig/Denoise.php | 4 +- .../src/V1/PreprocessingConfig/Pad.php | 8 +- VideoTranscoder/src/V1/PubsubDestination.php | 2 +- VideoTranscoder/src/V1/SegmentSettings.php | 4 +- VideoTranscoder/src/V1/SpriteSheet.php | 18 +- VideoTranscoder/src/V1/TextStream.php | 6 +- .../src/V1/TextStream/TextMapping.php | 6 +- .../src/V1/TranscoderServiceClient.php | 34 - .../src/V1/TranscoderServiceGrpcClient.php | 160 - .../src/V1/VideoStream/H264CodecSettings.php | 36 +- .../src/V1/VideoStream/H265CodecSettings.php | 34 +- .../src/V1/VideoStream/Vp9CodecSettings.php | 16 +- VideoTranscoder/src/V1beta1/AdBreak.php | 81 - VideoTranscoder/src/V1beta1/AudioStream.php | 301 - .../src/V1beta1/AudioStream/AudioAtom.php | 110 - .../AudioStream/AudioAtom/AudioChannel.php | 68 - .../AudioChannel/AudioChannelInput.php | 174 - .../src/V1beta1/CreateJobRequest.php | 115 - .../src/V1beta1/CreateJobTemplateRequest.php | 161 - .../src/V1beta1/DeleteJobRequest.php | 71 - .../src/V1beta1/DeleteJobTemplateRequest.php | 71 - VideoTranscoder/src/V1beta1/EditAtom.php | 209 - .../src/V1beta1/ElementaryStream.php | 177 - VideoTranscoder/src/V1beta1/Encryption.php | 213 - .../V1beta1/Encryption/Aes128Encryption.php | 72 - .../Encryption/MpegCommonEncryption.php | 118 - .../Encryption/SampleAesEncryption.php | 72 - VideoTranscoder/src/V1beta1/FailureDetail.php | 67 - .../Gapic/TranscoderServiceGapicClient.php | 763 -- VideoTranscoder/src/V1beta1/GetJobRequest.php | 71 - .../src/V1beta1/GetJobTemplateRequest.php | 75 - VideoTranscoder/src/V1beta1/Input.php | 157 - VideoTranscoder/src/V1beta1/Job.php | 675 - VideoTranscoder/src/V1beta1/Job/OriginUri.php | 110 - .../src/V1beta1/Job/ProcessingState.php | 77 - VideoTranscoder/src/V1beta1/JobConfig.php | 401 - VideoTranscoder/src/V1beta1/JobTemplate.php | 119 - .../src/V1beta1/ListJobTemplatesRequest.php | 143 - .../src/V1beta1/ListJobTemplatesResponse.php | 101 - .../src/V1beta1/ListJobsRequest.php | 140 - .../src/V1beta1/ListJobsResponse.php | 101 - VideoTranscoder/src/V1beta1/Manifest.php | 151 - .../src/V1beta1/Manifest/ManifestType.php | 62 - VideoTranscoder/src/V1beta1/MuxStream.php | 293 - VideoTranscoder/src/V1beta1/Output.php | 71 - VideoTranscoder/src/V1beta1/Overlay.php | 115 - .../src/V1beta1/Overlay/Animation.php | 142 - .../src/V1beta1/Overlay/AnimationEnd.php | 80 - .../src/V1beta1/Overlay/AnimationFade.php | 220 - .../src/V1beta1/Overlay/AnimationStatic.php | 138 - .../src/V1beta1/Overlay/FadeType.php | 62 - VideoTranscoder/src/V1beta1/Overlay/Image.php | 166 - .../V1beta1/Overlay/NormalizedCoordinate.php | 102 - .../src/V1beta1/PreprocessingConfig.php | 297 - .../src/V1beta1/PreprocessingConfig/Audio.php | 172 - .../src/V1beta1/PreprocessingConfig/Color.php | 160 - .../src/V1beta1/PreprocessingConfig/Crop.php | 171 - .../V1beta1/PreprocessingConfig/Deblock.php | 110 - .../V1beta1/PreprocessingConfig/Denoise.php | 118 - .../src/V1beta1/PreprocessingConfig/Pad.php | 171 - VideoTranscoder/src/V1beta1/Progress.php | 169 - .../src/V1beta1/PubsubDestination.php | 71 - .../src/V1beta1/SegmentSettings.php | 123 - VideoTranscoder/src/V1beta1/SpriteSheet.php | 519 - VideoTranscoder/src/V1beta1/TextStream.php | 167 - .../src/V1beta1/TextStream/TextAtom.php | 110 - .../V1beta1/TextStream/TextAtom/TextInput.php | 102 - .../src/V1beta1/TranscoderServiceClient.php | 36 - .../V1beta1/TranscoderServiceGrpcClient.php | 160 - VideoTranscoder/src/V1beta1/VideoStream.php | 998 -- .../src/V1beta1/gapic_metadata.json | 58 - .../transcoder_service_client_config.json | 84 - .../transcoder_service_descriptor_config.php | 28 - .../transcoder_service_rest_client_config.php | 101 - .../V1/Client/TranscoderServiceClientTest.php | 182 +- .../Unit/V1/TranscoderServiceClientTest.php | 587 - .../V1beta1/TranscoderServiceClientTest.php | 631 - Vision/.repo-metadata.json | 8 - Vision/VERSION | 2 +- Vision/composer.json | 2 +- Vision/src/VisionClient.php | 2 +- VmMigration/.repo-metadata.json | 8 - VmMigration/README.md | 5 +- VmMigration/VERSION | 2 +- VmMigration/composer.json | 2 +- VmMigration/owlbot.py | 40 +- .../src/V1/AddGroupMigrationRequest.php | 4 +- VmMigration/src/V1/ApplianceVersion.php | 8 +- VmMigration/src/V1/AppliedLicense.php | 4 +- VmMigration/src/V1/AvailableUpdates.php | 4 +- VmMigration/src/V1/AwsSecurityGroup.php | 4 +- VmMigration/src/V1/AwsSourceDetails.php | 8 +- .../AwsSourceDetails/AccessKeyCredentials.php | 4 +- VmMigration/src/V1/AwsSourceDetails/Tag.php | 4 +- VmMigration/src/V1/AwsSourceVmDetails.php | 4 +- VmMigration/src/V1/AwsVmDetails.php | 32 +- VmMigration/src/V1/CancelCloneJobRequest.php | 2 +- .../src/V1/CancelCutoverJobRequest.php | 2 +- .../src/V1/Client/VmMigrationClient.php | 142 +- VmMigration/src/V1/CloneJob.php | 12 +- VmMigration/src/V1/CloneStep.php | 4 +- .../src/V1/ComputeEngineTargetDefaults.php | 26 +- .../src/V1/ComputeEngineTargetDetails.php | 26 +- VmMigration/src/V1/ComputeScheduling.php | 6 +- VmMigration/src/V1/CreateCloneJobRequest.php | 8 +- .../src/V1/CreateCutoverJobRequest.php | 8 +- .../V1/CreateDatacenterConnectorRequest.php | 8 +- VmMigration/src/V1/CreateGroupRequest.php | 8 +- .../src/V1/CreateMigratingVmRequest.php | 8 +- VmMigration/src/V1/CreateSourceRequest.php | 8 +- .../src/V1/CreateTargetProjectRequest.php | 8 +- .../src/V1/CreateUtilizationReportRequest.php | 8 +- VmMigration/src/V1/CutoverJob.php | 16 +- VmMigration/src/V1/CutoverStep.php | 4 +- VmMigration/src/V1/CycleStep.php | 4 +- VmMigration/src/V1/DatacenterConnector.php | 28 +- .../V1/DeleteDatacenterConnectorRequest.php | 4 +- VmMigration/src/V1/DeleteGroupRequest.php | 4 +- .../src/V1/DeleteMigratingVmRequest.php | 2 +- VmMigration/src/V1/DeleteSourceRequest.php | 4 +- .../src/V1/DeleteTargetProjectRequest.php | 4 +- .../src/V1/DeleteUtilizationReportRequest.php | 4 +- VmMigration/src/V1/FetchInventoryRequest.php | 4 +- VmMigration/src/V1/FetchInventoryResponse.php | 2 +- .../src/V1/FinalizeMigrationRequest.php | 2 +- .../src/V1/Gapic/VmMigrationGapicClient.php | 4656 ------- VmMigration/src/V1/GetCloneJobRequest.php | 2 +- VmMigration/src/V1/GetCutoverJobRequest.php | 2 +- .../src/V1/GetDatacenterConnectorRequest.php | 2 +- VmMigration/src/V1/GetGroupRequest.php | 2 +- VmMigration/src/V1/GetMigratingVmRequest.php | 4 +- .../src/V1/GetReplicationCycleRequest.php | 2 +- VmMigration/src/V1/GetSourceRequest.php | 2 +- .../src/V1/GetTargetProjectRequest.php | 2 +- .../src/V1/GetUtilizationReportRequest.php | 4 +- VmMigration/src/V1/Group.php | 10 +- VmMigration/src/V1/ListCloneJobsRequest.php | 10 +- VmMigration/src/V1/ListCloneJobsResponse.php | 2 +- VmMigration/src/V1/ListCutoverJobsRequest.php | 10 +- .../src/V1/ListCutoverJobsResponse.php | 2 +- .../V1/ListDatacenterConnectorsRequest.php | 10 +- .../V1/ListDatacenterConnectorsResponse.php | 2 +- VmMigration/src/V1/ListGroupsRequest.php | 10 +- VmMigration/src/V1/ListGroupsResponse.php | 2 +- .../src/V1/ListMigratingVmsRequest.php | 12 +- .../src/V1/ListMigratingVmsResponse.php | 2 +- .../src/V1/ListReplicationCyclesRequest.php | 10 +- .../src/V1/ListReplicationCyclesResponse.php | 2 +- VmMigration/src/V1/ListSourcesRequest.php | 10 +- VmMigration/src/V1/ListSourcesResponse.php | 2 +- .../src/V1/ListTargetProjectsRequest.php | 10 +- .../src/V1/ListTargetProjectsResponse.php | 2 +- .../src/V1/ListUtilizationReportsRequest.php | 12 +- .../src/V1/ListUtilizationReportsResponse.php | 2 +- VmMigration/src/V1/MigratingVm.php | 26 +- VmMigration/src/V1/MigrationError.php | 8 +- VmMigration/src/V1/NetworkInterface.php | 8 +- VmMigration/src/V1/OperationMetadata.php | 14 +- VmMigration/src/V1/PauseMigrationRequest.php | 2 +- .../src/V1/RemoveGroupMigrationRequest.php | 4 +- VmMigration/src/V1/ReplicatingStep.php | 8 +- VmMigration/src/V1/ReplicationCycle.php | 14 +- VmMigration/src/V1/ReplicationSync.php | 2 +- VmMigration/src/V1/ResumeMigrationRequest.php | 2 +- VmMigration/src/V1/SchedulePolicy.php | 4 +- VmMigration/src/V1/SchedulingNodeAffinity.php | 4 +- VmMigration/src/V1/Source.php | 8 +- VmMigration/src/V1/StartMigrationRequest.php | 2 +- VmMigration/src/V1/TargetProject.php | 10 +- VmMigration/src/V1/UpdateGroupRequest.php | 6 +- .../src/V1/UpdateMigratingVmRequest.php | 6 +- VmMigration/src/V1/UpdateSourceRequest.php | 6 +- .../src/V1/UpdateTargetProjectRequest.php | 6 +- .../src/V1/UpgradeApplianceRequest.php | 4 +- VmMigration/src/V1/UpgradeStatus.php | 10 +- VmMigration/src/V1/UtilizationReport.php | 18 +- VmMigration/src/V1/VmMigrationClient.php | 34 - VmMigration/src/V1/VmMigrationGrpcClient.php | 754 -- VmMigration/src/V1/VmUtilizationInfo.php | 4 +- VmMigration/src/V1/VmUtilizationMetrics.php | 16 +- VmMigration/src/V1/VmwareSourceDetails.php | 8 +- VmMigration/src/V1/VmwareVmDetails.php | 24 +- .../Unit/V1/Client/VmMigrationClientTest.php | 1167 +- .../tests/Unit/V1/VmMigrationClientTest.php | 4806 ------- VmwareEngine/.repo-metadata.json | 10 - VmwareEngine/VERSION | 2 +- VmwareEngine/composer.json | 2 +- VpcAccess/.repo-metadata.json | 8 - VpcAccess/VERSION | 2 +- VpcAccess/composer.json | 2 +- WebRisk/.repo-metadata.json | 8 - WebRisk/VERSION | 2 +- WebRisk/composer.json | 2 +- WebSecurityScanner/.OwlBot.yaml | 2 +- WebSecurityScanner/.repo-metadata.json | 8 - WebSecurityScanner/README.md | 5 +- WebSecurityScanner/VERSION | 2 +- WebSecurityScanner/composer.json | 2 +- .../metadata/V1Beta/CrawledUrl.php | 32 - .../metadata/V1Beta/Finding.php | 49 - .../metadata/V1Beta/FindingAddon.php | 49 - .../metadata/V1Beta/FindingTypeStats.php | 30 - .../metadata/V1Beta/ScanConfig.php | Bin 3047 -> 0 bytes .../metadata/V1Beta/ScanConfigError.php | Bin 2516 -> 0 bytes .../metadata/V1Beta/ScanRun.php | Bin 2280 -> 0 bytes .../metadata/V1Beta/ScanRunErrorTrace.php | Bin 1501 -> 0 bytes .../metadata/V1Beta/ScanRunWarningTrace.php | Bin 1252 -> 0 bytes .../metadata/V1Beta/WebSecurityScanner.php | 121 - WebSecurityScanner/owlbot.py | 49 +- .../V1/Client/WebSecurityScannerClient.php | 12 +- WebSecurityScanner/src/V1/CrawledUrl.php | 6 +- .../src/V1/CreateScanConfigRequest.php | 4 +- .../src/V1/DeleteScanConfigRequest.php | 2 +- WebSecurityScanner/src/V1/Finding.php | 36 +- .../src/V1/FindingTypeStats.php | 4 +- WebSecurityScanner/src/V1/Form.php | 2 +- .../src/V1/GetFindingRequest.php | 2 +- .../src/V1/GetScanConfigRequest.php | 2 +- .../src/V1/GetScanRunRequest.php | 2 +- .../src/V1/ListCrawledUrlsRequest.php | 6 +- .../src/V1/ListCrawledUrlsResponse.php | 2 +- .../src/V1/ListFindingTypeStatsRequest.php | 2 +- .../src/V1/ListFindingsRequest.php | 8 +- .../src/V1/ListFindingsResponse.php | 2 +- .../src/V1/ListScanConfigsRequest.php | 6 +- .../src/V1/ListScanConfigsResponse.php | 2 +- .../src/V1/ListScanRunsRequest.php | 6 +- .../src/V1/ListScanRunsResponse.php | 2 +- WebSecurityScanner/src/V1/OutdatedLibrary.php | 4 +- WebSecurityScanner/src/V1/ScanConfig.php | 22 +- .../Authentication/CustomAccount.php | 6 +- .../Authentication/GoogleAccount.php | 4 +- .../IapTestServiceAccountInfo.php | 2 +- .../src/V1/ScanConfig/Schedule.php | 4 +- WebSecurityScanner/src/V1/ScanConfigError.php | 4 +- WebSecurityScanner/src/V1/ScanRun.php | 20 +- .../src/V1/ScanRunErrorTrace.php | 6 +- WebSecurityScanner/src/V1/ScanRunLog.php | 16 +- .../src/V1/ScanRunWarningTrace.php | 2 +- .../src/V1/StartScanRunRequest.php | 2 +- .../src/V1/StopScanRunRequest.php | 2 +- .../src/V1/UpdateScanConfigRequest.php | 4 +- .../src/V1/ViolatingResource.php | 4 +- .../src/V1/VulnerableHeaders/Header.php | 4 +- .../src/V1/WebSecurityScannerGrpcClient.php | 233 - WebSecurityScanner/src/V1/Xss.php | 6 +- WebSecurityScanner/src/V1/Xxe.php | 4 +- WebSecurityScanner/src/V1beta/CrawledUrl.php | 141 - .../src/V1beta/CreateScanConfigRequest.php | 115 - .../src/V1beta/DeleteScanConfigRequest.php | 71 - WebSecurityScanner/src/V1beta/Finding.php | 686 - .../src/V1beta/FindingTypeStats.php | 102 - WebSecurityScanner/src/V1beta/Form.php | 101 - .../Gapic/WebSecurityScannerGapicClient.php | 1066 -- .../src/V1beta/GetFindingRequest.php | 75 - .../src/V1beta/GetScanConfigRequest.php | 71 - .../src/V1beta/GetScanRunRequest.php | 75 - .../src/V1beta/ListCrawledUrlsRequest.php | 159 - .../src/V1beta/ListCrawledUrlsResponse.php | 105 - .../V1beta/ListFindingTypeStatsRequest.php | 75 - .../V1beta/ListFindingTypeStatsResponse.php | 67 - .../src/V1beta/ListFindingsRequest.php | 205 - .../src/V1beta/ListFindingsResponse.php | 105 - .../src/V1beta/ListScanConfigsRequest.php | 155 - .../src/V1beta/ListScanConfigsResponse.php | 105 - .../src/V1beta/ListScanRunsRequest.php | 155 - .../src/V1beta/ListScanRunsResponse.php | 105 - .../src/V1beta/OutdatedLibrary.php | 135 - WebSecurityScanner/src/V1beta/README.md | 25 - WebSecurityScanner/src/V1beta/ScanConfig.php | 507 - .../src/V1beta/ScanConfig/Authentication.php | 109 - .../Authentication/CustomAccount.php | 140 - .../Authentication/GoogleAccount.php | 106 - .../ExportToSecurityCommandCenter.php | 63 - .../src/V1beta/ScanConfig/RiskLevel.php | 64 - .../src/V1beta/ScanConfig/Schedule.php | 124 - .../src/V1beta/ScanConfig/TargetPlatform.php | 63 - .../src/V1beta/ScanConfig/UserAgent.php | 69 - .../src/V1beta/ScanConfigError.php | 116 - .../src/V1beta/ScanConfigError/Code.php | 353 - WebSecurityScanner/src/V1beta/ScanRun.php | 486 - .../src/V1beta/ScanRun/ExecutionState.php | 70 - .../src/V1beta/ScanRun/ResultState.php | 70 - .../src/V1beta/ScanRunErrorTrace.php | 162 - .../src/V1beta/ScanRunErrorTrace/Code.php | 97 - .../src/V1beta/ScanRunWarningTrace.php | 69 - .../src/V1beta/ScanRunWarningTrace/Code.php | 83 - .../src/V1beta/StartScanRunRequest.php | 71 - .../src/V1beta/StopScanRunRequest.php | 75 - .../src/V1beta/UpdateScanConfigRequest.php | 137 - .../src/V1beta/ViolatingResource.php | 102 - .../src/V1beta/VulnerableHeaders.php | 101 - .../src/V1beta/VulnerableHeaders/Header.php | 102 - .../src/V1beta/VulnerableParameters.php | 67 - .../src/V1beta/WebSecurityScannerClient.php | 36 - .../V1beta/WebSecurityScannerGrpcClient.php | 234 - WebSecurityScanner/src/V1beta/Xss.php | 101 - .../src/V1beta/gapic_metadata.json | 83 - .../web_security_scanner_client_config.json | 110 - ...web_security_scanner_descriptor_config.php | 68 - ...eb_security_scanner_rest_client_config.php | 183 - .../Client/WebSecurityScannerClientTest.php | 222 +- .../V1beta/WebSecurityScannerClientTest.php | 960 -- Workflows/.repo-metadata.json | 8 - Workflows/VERSION | 2 +- Workflows/composer.json | 2 +- Workflows/src/V1/Client/WorkflowsClient.php | 21 +- .../Unit/V1/Client/WorkflowsClientTest.php | 2 +- composer.json | 403 +- dev/src/Command/AddComponentCommand.php | 12 +- dev/src/Command/ComponentInfoCommand.php | 91 +- dev/src/Command/DocFxCommand.php | 67 +- dev/src/Component.php | 20 +- dev/src/ComponentPackage.php | 8 +- dev/src/DocFx/Node/ClassNode.php | 8 + dev/src/DocFx/XrefValidationTrait.php | 114 + dev/templates/.repo_metadata.json.twig | 7 - dev/templates/owlbot.py.twig | 8 +- .../Unit/Command/AddComponentCommandTest.php | 4 +- .../Unit/Command/ComponentInfoCommandTest.php | 19 +- dev/tests/Unit/DocFx/NodeTest.php | 72 +- .../component/CustomInput/.repo-metadata.json | 8 - .../fixtures/component/CustomInput/owlbot.py | 8 +- .../SecretManager/.repo-metadata.json | 8 - .../component/SecretManager/owlbot.py | 8 +- .../component/Vision/.repo-metadata.json | 8 - 6211 files changed, 296878 insertions(+), 313480 deletions(-) create mode 100644 .repo-metadata-full.json delete mode 100644 AccessApproval/.repo-metadata.json delete mode 100644 AccessContextManager/.repo-metadata.json delete mode 100644 AdvisoryNotifications/.repo-metadata.json delete mode 100644 AiPlatform/.repo-metadata.json create mode 100644 AiPlatform/samples/V1/DatasetServiceClient/update_dataset_version.php create mode 100644 AiPlatform/samples/V1/NotebookServiceClient/update_notebook_runtime_template.php delete mode 100644 AiPlatform/src/V1/DatasetServiceClient.php delete mode 100644 AiPlatform/src/V1/DatasetServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/DeploymentResourcePoolServiceClient.php delete mode 100644 AiPlatform/src/V1/EndpointServiceClient.php delete mode 100644 AiPlatform/src/V1/EndpointServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/FeatureOnlineStoreAdminServiceClient.php delete mode 100644 AiPlatform/src/V1/FeatureOnlineStoreServiceClient.php delete mode 100644 AiPlatform/src/V1/FeatureRegistryServiceClient.php delete mode 100644 AiPlatform/src/V1/FeaturestoreOnlineServingServiceClient.php delete mode 100644 AiPlatform/src/V1/FeaturestoreOnlineServingServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/FeaturestoreServiceClient.php delete mode 100644 AiPlatform/src/V1/FeaturestoreServiceGrpcClient.php create mode 100644 AiPlatform/src/V1/FindNeighborsRequest/Query/RRF.php create mode 100644 AiPlatform/src/V1/FunctionCallingConfig.php create mode 100644 AiPlatform/src/V1/FunctionCallingConfig/Mode.php delete mode 100644 AiPlatform/src/V1/Gapic/DatasetServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/DeploymentResourcePoolServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/EndpointServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/FeatureOnlineStoreAdminServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/FeatureOnlineStoreServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/FeatureRegistryServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/FeaturestoreOnlineServingServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/FeaturestoreServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/GenAiTuningServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/IndexEndpointServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/IndexServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/JobServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/LlmUtilityServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/MatchServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/MetadataServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/MigrationServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/ModelGardenServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/ModelServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/NotebookServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/PersistentResourceServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/PipelineServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/PredictionServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/ScheduleServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/SpecialistPoolServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/TensorboardServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/Gapic/VizierServiceGapicClient.php delete mode 100644 AiPlatform/src/V1/GenAiTuningServiceClient.php delete mode 100644 AiPlatform/src/V1/GroundingAttribution.php delete mode 100644 AiPlatform/src/V1/GroundingAttribution/Web.php create mode 100644 AiPlatform/src/V1/IndexDatapoint/SparseEmbedding.php delete mode 100644 AiPlatform/src/V1/IndexEndpointServiceClient.php delete mode 100644 AiPlatform/src/V1/IndexEndpointServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/IndexServiceClient.php delete mode 100644 AiPlatform/src/V1/IndexServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/JobServiceClient.php delete mode 100644 AiPlatform/src/V1/JobServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/LlmUtilityServiceClient.php delete mode 100644 AiPlatform/src/V1/MatchServiceClient.php delete mode 100644 AiPlatform/src/V1/MatchServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/MetadataServiceClient.php delete mode 100644 AiPlatform/src/V1/MetadataServiceGrpcClient.php create mode 100644 AiPlatform/src/V1/MetadataStore/DataplexConfig.php delete mode 100644 AiPlatform/src/V1/MigrationServiceClient.php delete mode 100644 AiPlatform/src/V1/MigrationServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/ModelGardenServiceClient.php delete mode 100644 AiPlatform/src/V1/ModelServiceClient.php delete mode 100644 AiPlatform/src/V1/ModelServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/NotebookServiceClient.php delete mode 100644 AiPlatform/src/V1/PersistentResourceServiceClient.php delete mode 100644 AiPlatform/src/V1/PipelineServiceClient.php delete mode 100644 AiPlatform/src/V1/PipelineServiceGrpcClient.php delete mode 100644 AiPlatform/src/V1/PredictionServiceClient.php delete mode 100644 AiPlatform/src/V1/PredictionServiceGrpcClient.php create mode 100644 AiPlatform/src/V1/RayMetricSpec.php delete mode 100644 AiPlatform/src/V1/ScheduleServiceClient.php create mode 100644 AiPlatform/src/V1/SearchEntryPoint.php delete mode 100644 AiPlatform/src/V1/Segment.php delete mode 100644 AiPlatform/src/V1/SpecialistPoolServiceClient.php delete mode 100644 AiPlatform/src/V1/SpecialistPoolServiceGrpcClient.php create mode 100644 AiPlatform/src/V1/StructFieldValue.php create mode 100644 AiPlatform/src/V1/StructValue.php delete mode 100644 AiPlatform/src/V1/TensorboardServiceClient.php delete mode 100644 AiPlatform/src/V1/TensorboardServiceGrpcClient.php create mode 100644 AiPlatform/src/V1/ToolConfig.php create mode 100644 AiPlatform/src/V1/UpdateDatasetVersionRequest.php create mode 100644 AiPlatform/src/V1/UpdateNotebookRuntimeTemplateRequest.php delete mode 100644 AiPlatform/src/V1/VizierServiceClient.php delete mode 100644 AiPlatform/src/V1/VizierServiceGrpcClient.php delete mode 100644 AiPlatform/tests/Unit/V1/DatasetServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/DeploymentResourcePoolServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/EndpointServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/FeatureOnlineStoreAdminServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/FeatureOnlineStoreServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/FeatureRegistryServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/FeaturestoreOnlineServingServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/FeaturestoreServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/GenAiTuningServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/IndexEndpointServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/IndexServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/JobServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/LlmUtilityServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/MatchServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/MetadataServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/MigrationServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/ModelGardenServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/ModelServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/NotebookServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/PersistentResourceServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/PipelineServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/PredictionServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/ScheduleServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/SpecialistPoolServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/TensorboardServiceClientTest.php delete mode 100644 AiPlatform/tests/Unit/V1/VizierServiceClientTest.php delete mode 100644 AlloyDb/.repo-metadata.json delete mode 100644 AnalyticsAdmin/.repo-metadata.json delete mode 100644 AnalyticsData/.repo-metadata.json create mode 100644 AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/create_report_task.php create mode 100644 AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/get_report_task.php create mode 100644 AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/list_report_tasks.php create mode 100644 AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/query_report_task.php create mode 100644 AnalyticsData/src/V1alpha/CreateReportTaskRequest.php create mode 100644 AnalyticsData/src/V1alpha/GetReportTaskRequest.php create mode 100644 AnalyticsData/src/V1alpha/ListReportTasksRequest.php create mode 100644 AnalyticsData/src/V1alpha/ListReportTasksResponse.php create mode 100644 AnalyticsData/src/V1alpha/QueryReportTaskRequest.php create mode 100644 AnalyticsData/src/V1alpha/QueryReportTaskResponse.php create mode 100644 AnalyticsData/src/V1alpha/ReportTask.php create mode 100644 AnalyticsData/src/V1alpha/ReportTask/ReportDefinition.php create mode 100644 AnalyticsData/src/V1alpha/ReportTask/ReportMetadata.php create mode 100644 AnalyticsData/src/V1alpha/ReportTask/ReportMetadata/State.php create mode 100644 AnalyticsData/src/V1alpha/ReportTaskMetadata.php create mode 100644 AnalyticsData/src/V1alpha/ResponseMetaData/SchemaRestrictionResponse.php create mode 100644 AnalyticsData/src/V1alpha/ResponseMetaData/SchemaRestrictionResponse/ActiveMetricRestriction.php create mode 100644 AnalyticsData/src/V1alpha/RestrictedMetricType.php delete mode 100644 ApiGateway/.repo-metadata.json delete mode 100644 ApiKeys/.repo-metadata.json delete mode 100644 ApigeeConnect/.repo-metadata.json delete mode 100644 ApigeeRegistry/.repo-metadata.json delete mode 100644 AppEngineAdmin/.repo-metadata.json delete mode 100644 AppHub/.repo-metadata.json delete mode 100644 AppsChat/.repo-metadata.json delete mode 100644 AppsEventsSubscriptions/.repo-metadata.json delete mode 100644 AppsMeet/.repo-metadata.json delete mode 100644 ArtifactRegistry/.repo-metadata.json delete mode 100644 ArtifactRegistry/metadata/V1Beta2/AptArtifact.php delete mode 100644 ArtifactRegistry/metadata/V1Beta2/File.php delete mode 100644 ArtifactRegistry/metadata/V1Beta2/Package.php delete mode 100644 ArtifactRegistry/metadata/V1Beta2/Repository.php delete mode 100644 ArtifactRegistry/metadata/V1Beta2/Service.php delete mode 100644 ArtifactRegistry/metadata/V1Beta2/Settings.php delete mode 100644 ArtifactRegistry/metadata/V1Beta2/Tag.php delete mode 100644 ArtifactRegistry/metadata/V1Beta2/Version.php delete mode 100644 ArtifactRegistry/metadata/V1Beta2/YumArtifact.php delete mode 100644 ArtifactRegistry/src/V1/ArtifactRegistryGrpcClient.php delete mode 100644 ArtifactRegistry/src/V1beta2/AptArtifact.php delete mode 100644 ArtifactRegistry/src/V1beta2/AptArtifact/PackageType.php delete mode 100644 ArtifactRegistry/src/V1beta2/AptArtifact_PackageType.php delete mode 100644 ArtifactRegistry/src/V1beta2/ArtifactRegistryClient.php delete mode 100644 ArtifactRegistry/src/V1beta2/ArtifactRegistryGrpcClient.php delete mode 100644 ArtifactRegistry/src/V1beta2/CreateRepositoryRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/CreateTagRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/DeletePackageRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/DeleteRepositoryRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/DeleteTagRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/DeleteVersionRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/File.php delete mode 100644 ArtifactRegistry/src/V1beta2/Gapic/ArtifactRegistryGapicClient.php delete mode 100644 ArtifactRegistry/src/V1beta2/GetFileRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/GetPackageRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/GetProjectSettingsRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/GetRepositoryRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/GetTagRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/GetVersionRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/Hash.php delete mode 100644 ArtifactRegistry/src/V1beta2/Hash/HashType.php delete mode 100644 ArtifactRegistry/src/V1beta2/Hash_HashType.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportAptArtifactsErrorInfo.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportAptArtifactsGcsSource.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportAptArtifactsMetadata.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportAptArtifactsRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportAptArtifactsResponse.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportYumArtifactsErrorInfo.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportYumArtifactsGcsSource.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportYumArtifactsMetadata.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportYumArtifactsRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/ImportYumArtifactsResponse.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListFilesRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListFilesResponse.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListPackagesRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListPackagesResponse.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListRepositoriesRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListRepositoriesResponse.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListTagsRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListTagsResponse.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListVersionsRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/ListVersionsResponse.php delete mode 100644 ArtifactRegistry/src/V1beta2/OperationMetadata.php delete mode 100644 ArtifactRegistry/src/V1beta2/Package.php delete mode 100644 ArtifactRegistry/src/V1beta2/ProjectSettings.php delete mode 100644 ArtifactRegistry/src/V1beta2/ProjectSettings/RedirectionState.php delete mode 100644 ArtifactRegistry/src/V1beta2/ProjectSettings_RedirectionState.php delete mode 100644 ArtifactRegistry/src/V1beta2/Repository.php delete mode 100644 ArtifactRegistry/src/V1beta2/Repository/Format.php delete mode 100644 ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig.php delete mode 100644 ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig/VersionPolicy.php delete mode 100644 ArtifactRegistry/src/V1beta2/Repository_Format.php delete mode 100644 ArtifactRegistry/src/V1beta2/Repository_MavenRepositoryConfig.php delete mode 100644 ArtifactRegistry/src/V1beta2/Repository_MavenRepositoryConfig_VersionPolicy.php delete mode 100644 ArtifactRegistry/src/V1beta2/Tag.php delete mode 100644 ArtifactRegistry/src/V1beta2/UpdateProjectSettingsRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/UpdateRepositoryRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/UpdateTagRequest.php delete mode 100644 ArtifactRegistry/src/V1beta2/Version.php delete mode 100644 ArtifactRegistry/src/V1beta2/VersionView.php delete mode 100644 ArtifactRegistry/src/V1beta2/YumArtifact.php delete mode 100644 ArtifactRegistry/src/V1beta2/YumArtifact/PackageType.php delete mode 100644 ArtifactRegistry/src/V1beta2/YumArtifact_PackageType.php delete mode 100644 ArtifactRegistry/src/V1beta2/gapic_metadata.json delete mode 100644 ArtifactRegistry/src/V1beta2/resources/artifact_registry_client_config.json delete mode 100644 ArtifactRegistry/src/V1beta2/resources/artifact_registry_descriptor_config.php delete mode 100644 ArtifactRegistry/src/V1beta2/resources/artifact_registry_rest_client_config.php delete mode 100644 ArtifactRegistry/tests/Unit/V1beta2/ArtifactRegistryClientTest.php delete mode 100644 Asset/.repo-metadata.json delete mode 100644 AssuredWorkloads/.repo-metadata.json delete mode 100644 AssuredWorkloads/metadata/V1Beta1/Assuredworkloads.php delete mode 100644 AssuredWorkloads/metadata/V1Beta1/AssuredworkloadsService.php delete mode 100644 AssuredWorkloads/metadata/V1Beta1/AssuredworkloadsV1Beta1.php delete mode 100644 AssuredWorkloads/src/V1/AssuredWorkloadsServiceGrpcClient.php delete mode 100644 AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveRequest.php delete mode 100644 AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveResponse.php delete mode 100644 AssuredWorkloads/src/V1beta1/AssuredWorkloadsServiceClient.php delete mode 100644 AssuredWorkloads/src/V1beta1/AssuredWorkloadsServiceGrpcClient.php delete mode 100644 AssuredWorkloads/src/V1beta1/CreateWorkloadOperationMetadata.php delete mode 100644 AssuredWorkloads/src/V1beta1/CreateWorkloadRequest.php delete mode 100644 AssuredWorkloads/src/V1beta1/DeleteWorkloadRequest.php delete mode 100644 AssuredWorkloads/src/V1beta1/Gapic/AssuredWorkloadsServiceGapicClient.php delete mode 100644 AssuredWorkloads/src/V1beta1/GetWorkloadRequest.php delete mode 100644 AssuredWorkloads/src/V1beta1/ListWorkloadsRequest.php delete mode 100644 AssuredWorkloads/src/V1beta1/ListWorkloadsResponse.php delete mode 100644 AssuredWorkloads/src/V1beta1/README.md delete mode 100644 AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest.php delete mode 100644 AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php delete mode 100644 AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest_RestrictionType.php delete mode 100644 AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesResponse.php delete mode 100644 AssuredWorkloads/src/V1beta1/UpdateWorkloadRequest.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/CJISSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/ComplianceRegime.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/FedrampHighSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/FedrampModerateSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/IL4Settings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/KMSSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/KajEnrollmentState.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/ResourceInfo.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/ResourceInfo/ResourceType.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/ResourceSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_CJISSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_ComplianceRegime.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_FedrampHighSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_FedrampModerateSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_IL4Settings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_KMSSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_KajEnrollmentState.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_ResourceInfo.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_ResourceInfo_ResourceType.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_ResourceSettings.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_SaaEnrollmentResponse.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_SaaEnrollmentResponse_SetupError.php delete mode 100644 AssuredWorkloads/src/V1beta1/Workload_SaaEnrollmentResponse_SetupState.php delete mode 100644 AssuredWorkloads/src/V1beta1/gapic_metadata.json delete mode 100644 AssuredWorkloads/src/V1beta1/resources/assured_workloads_service_client_config.json delete mode 100644 AssuredWorkloads/src/V1beta1/resources/assured_workloads_service_descriptor_config.php delete mode 100644 AssuredWorkloads/src/V1beta1/resources/assured_workloads_service_rest_client_config.php delete mode 100644 AssuredWorkloads/tests/Unit/V1beta1/AssuredWorkloadsServiceClientTest.php delete mode 100644 AutoMl/.repo-metadata.json create mode 100644 BackupDr/.OwlBot.yaml create mode 100644 BackupDr/.gitattributes create mode 100644 BackupDr/.github/pull_request_template.md create mode 100644 BackupDr/CONTRIBUTING.md create mode 100644 BackupDr/LICENSE create mode 100644 BackupDr/README.md create mode 100644 BackupDr/VERSION create mode 100644 BackupDr/composer.json create mode 100644 BackupDr/metadata/V1/Backupdr.php create mode 100644 BackupDr/owlbot.py create mode 100644 BackupDr/phpunit.xml.dist create mode 100644 BackupDr/samples/V1/BackupDRClient/create_management_server.php create mode 100644 BackupDr/samples/V1/BackupDRClient/delete_management_server.php create mode 100644 BackupDr/samples/V1/BackupDRClient/get_iam_policy.php create mode 100644 BackupDr/samples/V1/BackupDRClient/get_location.php create mode 100644 BackupDr/samples/V1/BackupDRClient/get_management_server.php create mode 100644 BackupDr/samples/V1/BackupDRClient/list_locations.php create mode 100644 BackupDr/samples/V1/BackupDRClient/list_management_servers.php create mode 100644 BackupDr/samples/V1/BackupDRClient/set_iam_policy.php create mode 100644 BackupDr/samples/V1/BackupDRClient/test_iam_permissions.php create mode 100644 BackupDr/src/V1/Client/BackupDRClient.php create mode 100644 BackupDr/src/V1/CreateManagementServerRequest.php create mode 100644 BackupDr/src/V1/DeleteManagementServerRequest.php create mode 100644 BackupDr/src/V1/GetManagementServerRequest.php create mode 100644 BackupDr/src/V1/ListManagementServersRequest.php create mode 100644 BackupDr/src/V1/ListManagementServersResponse.php create mode 100644 BackupDr/src/V1/ManagementServer.php create mode 100644 BackupDr/src/V1/ManagementServer/InstanceState.php create mode 100644 BackupDr/src/V1/ManagementServer/InstanceType.php create mode 100644 BackupDr/src/V1/ManagementURI.php create mode 100644 BackupDr/src/V1/NetworkConfig.php create mode 100644 BackupDr/src/V1/NetworkConfig/PeeringMode.php create mode 100644 BackupDr/src/V1/OperationMetadata.php create mode 100644 BackupDr/src/V1/WorkforceIdentityBasedManagementURI.php create mode 100644 BackupDr/src/V1/WorkforceIdentityBasedOAuth2ClientID.php create mode 100644 BackupDr/src/V1/gapic_metadata.json create mode 100644 BackupDr/src/V1/resources/backup_dr_client_config.json create mode 100644 BackupDr/src/V1/resources/backup_dr_descriptor_config.php create mode 100644 BackupDr/src/V1/resources/backup_dr_rest_client_config.php create mode 100644 BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php delete mode 100644 BareMetalSolution/.repo-metadata.json delete mode 100644 Batch/.repo-metadata.json delete mode 100644 BeyondCorpAppConnections/.repo-metadata.json delete mode 100644 BeyondCorpAppConnectors/.repo-metadata.json delete mode 100644 BeyondCorpAppGateways/.repo-metadata.json delete mode 100644 BeyondCorpClientConnectorServices/.repo-metadata.json delete mode 100644 BeyondCorpClientGateways/.repo-metadata.json delete mode 100644 BigQuery/.repo-metadata.json delete mode 100644 BigQueryAnalyticsHub/.repo-metadata.json delete mode 100644 BigQueryConnection/.repo-metadata.json delete mode 100644 BigQueryDataExchange/.repo-metadata.json delete mode 100644 BigQueryDataPolicies/.repo-metadata.json delete mode 100644 BigQueryDataTransfer/.repo-metadata.json delete mode 100644 BigQueryMigration/.repo-metadata.json delete mode 100644 BigQueryReservation/.repo-metadata.json delete mode 100644 BigQueryStorage/.repo-metadata.json delete mode 100644 Bigtable/.repo-metadata.json create mode 100644 Bigtable/MIGRATING.md delete mode 100644 Bigtable/src/Admin/V2/AppProfile_MultiClusterRoutingUseAny.php delete mode 100644 Bigtable/src/Admin/V2/AppProfile_SingleClusterRouting.php delete mode 100644 Bigtable/src/Admin/V2/Backup_State.php delete mode 100644 Bigtable/src/Admin/V2/BigtableInstanceAdminClient.php delete mode 100644 Bigtable/src/Admin/V2/BigtableInstanceAdminGrpcClient.php delete mode 100644 Bigtable/src/Admin/V2/BigtableTableAdminClient.php delete mode 100644 Bigtable/src/Admin/V2/BigtableTableAdminGrpcClient.php delete mode 100644 Bigtable/src/Admin/V2/Cluster_ClusterAutoscalingConfig.php delete mode 100644 Bigtable/src/Admin/V2/Cluster_ClusterConfig.php delete mode 100644 Bigtable/src/Admin/V2/Cluster_EncryptionConfig.php delete mode 100644 Bigtable/src/Admin/V2/Cluster_State.php delete mode 100644 Bigtable/src/Admin/V2/CreateClusterMetadata_TableProgress.php delete mode 100644 Bigtable/src/Admin/V2/CreateClusterMetadata_TableProgress_State.php delete mode 100644 Bigtable/src/Admin/V2/CreateTableRequest_Split.php delete mode 100644 Bigtable/src/Admin/V2/EncryptionInfo_EncryptionType.php delete mode 100644 Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php delete mode 100644 Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php delete mode 100644 Bigtable/src/Admin/V2/GcRule_Intersection.php delete mode 100644 Bigtable/src/Admin/V2/GcRule_Union.php delete mode 100644 Bigtable/src/Admin/V2/Instance_State.php delete mode 100644 Bigtable/src/Admin/V2/Instance_Type.php delete mode 100644 Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest_Modification.php delete mode 100644 Bigtable/src/Admin/V2/Snapshot_State.php delete mode 100644 Bigtable/src/Admin/V2/Table_ClusterState.php delete mode 100644 Bigtable/src/Admin/V2/Table_ClusterState_ReplicationState.php delete mode 100644 Bigtable/src/Admin/V2/Table_TimestampGranularity.php delete mode 100644 Bigtable/src/Admin/V2/Table_View.php create mode 100644 Bigtable/src/Admin/V2/Type/PBString.php create mode 100644 Bigtable/src/Admin/V2/Type/PBString/Encoding.php create mode 100644 Bigtable/src/Admin/V2/Type/PBString/Encoding/Utf8Raw.php create mode 100644 Bigtable/src/Admin/V2/gapic_metadata.json delete mode 100644 Bigtable/src/V2/AllReadStats.php delete mode 100644 Bigtable/src/V2/BigtableClient.php delete mode 100644 Bigtable/src/V2/BigtableGrpcClient.php delete mode 100644 Bigtable/src/V2/Gapic/BigtableGapicClient.php delete mode 100644 Bigtable/src/V2/MutateRowsRequest_Entry.php delete mode 100644 Bigtable/src/V2/MutateRowsResponse_Entry.php delete mode 100644 Bigtable/src/V2/Mutation_DeleteFromColumn.php delete mode 100644 Bigtable/src/V2/Mutation_DeleteFromFamily.php delete mode 100644 Bigtable/src/V2/Mutation_DeleteFromRow.php delete mode 100644 Bigtable/src/V2/Mutation_SetCell.php delete mode 100644 Bigtable/src/V2/ReadChangeStreamResponse_CloseStream.php delete mode 100644 Bigtable/src/V2/ReadChangeStreamResponse_DataChange.php delete mode 100644 Bigtable/src/V2/ReadChangeStreamResponse_DataChange_Type.php delete mode 100644 Bigtable/src/V2/ReadChangeStreamResponse_Heartbeat.php delete mode 100644 Bigtable/src/V2/ReadChangeStreamResponse_MutationChunk.php delete mode 100644 Bigtable/src/V2/ReadChangeStreamResponse_MutationChunk_ChunkInfo.php delete mode 100644 Bigtable/src/V2/ReadEfficiencyStats.php delete mode 100644 Bigtable/src/V2/ReadIteratorStats.php delete mode 100644 Bigtable/src/V2/ReadRowsRequest_RequestStatsView.php delete mode 100644 Bigtable/src/V2/ReadRowsResponse_CellChunk.php delete mode 100644 Bigtable/src/V2/RowFilter_Chain.php delete mode 100644 Bigtable/src/V2/RowFilter_Condition.php delete mode 100644 Bigtable/src/V2/RowFilter_Interleave.php delete mode 100644 Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php delete mode 100644 Bigtable/tests/Unit/Admin/V2/BigtableTableAdminClientTest.php delete mode 100644 Bigtable/tests/Unit/V2/BigtableClientTest.php create mode 100644 Bigtable/tests/Unit/bootstrap.php delete mode 100644 Billing/.repo-metadata.json delete mode 100644 BillingBudgets/.repo-metadata.json delete mode 100644 BinaryAuthorization/.repo-metadata.json delete mode 100644 BinaryAuthorization/src/V1/BinauthzManagementServiceV1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1/SystemPolicyV1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1/ValidationHelperV1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule/EnforcementMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule/EvaluationMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule_EnforcementMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule_EvaluationMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionWhitelistPattern.php delete mode 100644 BinaryAuthorization/src/V1beta1/Attestor.php delete mode 100644 BinaryAuthorization/src/V1beta1/AttestorPublicKey.php delete mode 100644 BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1Client.php delete mode 100644 BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ConfigErrorEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/AuditResult.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckSetScope.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckVerdict.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/ContainerType.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/PolicyConformanceVerdict.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/UnsupportedPolicyEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_AuditResult.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent_PolicyConformanceVerdict.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_UnsupportedPolicyEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/CreateAttestorRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/DeleteAttestorRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/Gapic/BinauthzManagementServiceV1Beta1GapicClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/Gapic/SystemPolicyV1Beta1GapicClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/GetAttestorRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/GetPolicyRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/GetSystemPolicyRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/ListAttestorsRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/ListAttestorsResponse.php delete mode 100644 BinaryAuthorization/src/V1beta1/PkixPublicKey.php delete mode 100644 BinaryAuthorization/src/V1beta1/PkixPublicKey/SignatureAlgorithm.php delete mode 100644 BinaryAuthorization/src/V1beta1/PkixPublicKey_SignatureAlgorithm.php delete mode 100644 BinaryAuthorization/src/V1beta1/Policy.php delete mode 100644 BinaryAuthorization/src/V1beta1/Policy/GlobalPolicyEvaluationMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/Policy_GlobalPolicyEvaluationMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/SystemPolicyV1Beta1Client.php delete mode 100644 BinaryAuthorization/src/V1beta1/SystemPolicyV1Beta1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/UpdateAttestorRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/UpdatePolicyRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/UserOwnedDrydockNote.php delete mode 100644 BinaryAuthorization/src/V1beta1/gapic_metadata.json delete mode 100644 BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_client_config.json delete mode 100644 BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_descriptor_config.php delete mode 100644 BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_rest_client_config.php delete mode 100644 BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_client_config.json delete mode 100644 BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_descriptor_config.php delete mode 100644 BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_rest_client_config.php delete mode 100644 BinaryAuthorization/tests/Unit/V1beta1/BinauthzManagementServiceV1Beta1ClientTest.php delete mode 100644 BinaryAuthorization/tests/Unit/V1beta1/SystemPolicyV1Beta1ClientTest.php delete mode 100644 Build/.repo-metadata.json delete mode 100644 Build/metadata/V1/Cloudbuild.php delete mode 100644 Build/src/V1/ApprovalConfig.php delete mode 100644 Build/src/V1/ApprovalResult.php delete mode 100644 Build/src/V1/ApprovalResult/Decision.php delete mode 100644 Build/src/V1/ApproveBuildRequest.php delete mode 100644 Build/src/V1/ArtifactResult.php delete mode 100644 Build/src/V1/Artifacts.php delete mode 100644 Build/src/V1/Artifacts/ArtifactObjects.php delete mode 100644 Build/src/V1/Artifacts/MavenArtifact.php delete mode 100644 Build/src/V1/Artifacts/NpmPackage.php delete mode 100644 Build/src/V1/Artifacts/PythonPackage.php delete mode 100644 Build/src/V1/Build.php delete mode 100644 Build/src/V1/Build/FailureInfo.php delete mode 100644 Build/src/V1/Build/FailureInfo/FailureType.php delete mode 100644 Build/src/V1/Build/Status.php delete mode 100644 Build/src/V1/Build/Warning.php delete mode 100644 Build/src/V1/Build/Warning/Priority.php delete mode 100644 Build/src/V1/BuildApproval.php delete mode 100644 Build/src/V1/BuildApproval/State.php delete mode 100644 Build/src/V1/BuildOperationMetadata.php delete mode 100644 Build/src/V1/BuildOptions.php delete mode 100644 Build/src/V1/BuildOptions/DefaultLogsBucketBehavior.php delete mode 100644 Build/src/V1/BuildOptions/LogStreamingOption.php delete mode 100644 Build/src/V1/BuildOptions/LoggingMode.php delete mode 100644 Build/src/V1/BuildOptions/MachineType.php delete mode 100644 Build/src/V1/BuildOptions/PoolOption.php delete mode 100644 Build/src/V1/BuildOptions/SubstitutionOption.php delete mode 100644 Build/src/V1/BuildOptions/VerifyOption.php delete mode 100644 Build/src/V1/BuildStep.php delete mode 100644 Build/src/V1/BuildTrigger.php delete mode 100644 Build/src/V1/BuiltImage.php delete mode 100644 Build/src/V1/CancelBuildRequest.php delete mode 100644 Build/src/V1/CloudBuildClient.php delete mode 100644 Build/src/V1/CreateBuildRequest.php delete mode 100644 Build/src/V1/CreateBuildTriggerRequest.php delete mode 100644 Build/src/V1/CreateWorkerPoolOperationMetadata.php delete mode 100644 Build/src/V1/CreateWorkerPoolRequest.php delete mode 100644 Build/src/V1/DeleteBuildTriggerRequest.php delete mode 100644 Build/src/V1/DeleteWorkerPoolOperationMetadata.php delete mode 100644 Build/src/V1/DeleteWorkerPoolRequest.php delete mode 100644 Build/src/V1/FileHashes.php delete mode 100644 Build/src/V1/Gapic/CloudBuildGapicClient.php delete mode 100644 Build/src/V1/GetBuildRequest.php delete mode 100644 Build/src/V1/GetBuildTriggerRequest.php delete mode 100644 Build/src/V1/GetWorkerPoolRequest.php delete mode 100644 Build/src/V1/GitFileSource.php delete mode 100644 Build/src/V1/GitFileSource/RepoType.php delete mode 100644 Build/src/V1/GitHubEnterpriseConfig.php delete mode 100644 Build/src/V1/GitHubEnterpriseSecrets.php delete mode 100644 Build/src/V1/GitHubEventsConfig.php delete mode 100644 Build/src/V1/GitRepoSource.php delete mode 100644 Build/src/V1/GitSource.php delete mode 100644 Build/src/V1/Hash.php delete mode 100644 Build/src/V1/Hash/HashType.php delete mode 100644 Build/src/V1/InlineSecret.php delete mode 100644 Build/src/V1/ListBuildTriggersRequest.php delete mode 100644 Build/src/V1/ListBuildTriggersResponse.php delete mode 100644 Build/src/V1/ListBuildsRequest.php delete mode 100644 Build/src/V1/ListBuildsResponse.php delete mode 100644 Build/src/V1/ListWorkerPoolsRequest.php delete mode 100644 Build/src/V1/ListWorkerPoolsResponse.php delete mode 100644 Build/src/V1/PrivatePoolV1Config.php delete mode 100644 Build/src/V1/PrivatePoolV1Config/NetworkConfig.php delete mode 100644 Build/src/V1/PrivatePoolV1Config/NetworkConfig/EgressOption.php delete mode 100644 Build/src/V1/PrivatePoolV1Config/WorkerConfig.php delete mode 100644 Build/src/V1/PubsubConfig.php delete mode 100644 Build/src/V1/PubsubConfig/State.php delete mode 100644 Build/src/V1/PullRequestFilter.php delete mode 100644 Build/src/V1/PullRequestFilter/CommentControl.php delete mode 100644 Build/src/V1/PushFilter.php delete mode 100644 Build/src/V1/ReceiveTriggerWebhookRequest.php delete mode 100644 Build/src/V1/ReceiveTriggerWebhookResponse.php delete mode 100644 Build/src/V1/RepoSource.php delete mode 100644 Build/src/V1/RepositoryEventConfig.php delete mode 100644 Build/src/V1/RepositoryEventConfig/RepositoryType.php delete mode 100644 Build/src/V1/Results.php delete mode 100644 Build/src/V1/RetryBuildRequest.php delete mode 100644 Build/src/V1/RunBuildTriggerRequest.php delete mode 100644 Build/src/V1/Secret.php delete mode 100644 Build/src/V1/SecretManagerSecret.php delete mode 100644 Build/src/V1/Secrets.php delete mode 100644 Build/src/V1/Source.php delete mode 100644 Build/src/V1/SourceProvenance.php delete mode 100644 Build/src/V1/StorageSource.php delete mode 100644 Build/src/V1/StorageSource/SourceFetcher.php delete mode 100644 Build/src/V1/StorageSourceManifest.php delete mode 100644 Build/src/V1/TimeSpan.php delete mode 100644 Build/src/V1/UpdateBuildTriggerRequest.php delete mode 100644 Build/src/V1/UpdateWorkerPoolOperationMetadata.php delete mode 100644 Build/src/V1/UpdateWorkerPoolRequest.php delete mode 100644 Build/src/V1/UploadedMavenArtifact.php delete mode 100644 Build/src/V1/UploadedNpmPackage.php delete mode 100644 Build/src/V1/UploadedPythonPackage.php delete mode 100644 Build/src/V1/Volume.php delete mode 100644 Build/src/V1/WebhookConfig.php delete mode 100644 Build/src/V1/WebhookConfig/State.php delete mode 100644 Build/src/V1/WorkerPool.php delete mode 100644 Build/src/V1/WorkerPool/State.php delete mode 100644 Build/src/V1/gapic_metadata.json delete mode 100644 Build/src/V1/resources/cloud_build_client_config.json delete mode 100644 Build/src/V1/resources/cloud_build_descriptor_config.php delete mode 100644 Build/src/V1/resources/cloud_build_rest_client_config.php delete mode 100644 Build/src/V2/Gapic/RepositoryManagerGapicClient.php delete mode 100644 Build/src/V2/RepositoryManagerClient.php delete mode 100644 Build/tests/Unit/V1/CloudBuildClientTest.php delete mode 100644 Build/tests/Unit/V2/RepositoryManagerClientTest.php delete mode 100644 CertificateManager/.repo-metadata.json delete mode 100644 Channel/.repo-metadata.json delete mode 100644 CommerceConsumerProcurement/.repo-metadata.json delete mode 100644 CommonProtos/.repo-metadata.json delete mode 100644 Compute/.repo-metadata.json delete mode 100644 ConfidentialComputing/.repo-metadata.json delete mode 100644 Config/.repo-metadata.json delete mode 100644 ContactCenterInsights/.repo-metadata.json delete mode 100644 Container/.repo-metadata.json create mode 100644 Container/src/V1/ContainerdConfig.php create mode 100644 Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig.php create mode 100644 Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig/CertificateAuthorityDomainConfig.php create mode 100644 Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig/CertificateAuthorityDomainConfig/GCPSecretManagerCertificateConfig.php create mode 100644 Container/src/V1/LinuxNodeConfig/HugepagesConfig.php delete mode 100644 ContainerAnalysis/.repo-metadata.json delete mode 100644 ControlsPartner/.repo-metadata.json delete mode 100644 Core/.repo-metadata.json delete mode 100644 DataCatalog/.repo-metadata.json delete mode 100644 DataCatalogLineage/.repo-metadata.json delete mode 100644 DataFusion/.repo-metadata.json delete mode 100644 DataFusion/src/V1/DataFusionClient.php delete mode 100644 DataFusion/src/V1/DataFusionGrpcClient.php delete mode 100644 DataFusion/src/V1/Gapic/DataFusionGapicClient.php delete mode 100644 DataFusion/tests/Unit/V1/DataFusionClientTest.php delete mode 100644 DataLabeling/.repo-metadata.json delete mode 100644 Dataflow/.repo-metadata.json delete mode 100644 Dataform/.repo-metadata.json delete mode 100644 Dataplex/.repo-metadata.json delete mode 100644 Dataplex/src/V1/CatalogServiceClient.php delete mode 100644 Dataplex/src/V1/ContentServiceClient.php delete mode 100644 Dataplex/src/V1/ContentServiceGrpcClient.php create mode 100644 Dataplex/src/V1/DataQualityRule/SqlAssertion.php delete mode 100644 Dataplex/src/V1/DataScanServiceClient.php delete mode 100644 Dataplex/src/V1/DataScanServiceGrpcClient.php delete mode 100644 Dataplex/src/V1/DataTaxonomyServiceClient.php delete mode 100644 Dataplex/src/V1/DataplexServiceClient.php delete mode 100644 Dataplex/src/V1/DataplexServiceGrpcClient.php delete mode 100644 Dataplex/src/V1/Gapic/CatalogServiceGapicClient.php delete mode 100644 Dataplex/src/V1/Gapic/ContentServiceGapicClient.php delete mode 100644 Dataplex/src/V1/Gapic/DataScanServiceGapicClient.php delete mode 100644 Dataplex/src/V1/Gapic/DataTaxonomyServiceGapicClient.php delete mode 100644 Dataplex/src/V1/Gapic/DataplexServiceGapicClient.php delete mode 100644 Dataplex/src/V1/Gapic/MetadataServiceGapicClient.php delete mode 100644 Dataplex/src/V1/MetadataServiceClient.php delete mode 100644 Dataplex/src/V1/MetadataServiceGrpcClient.php delete mode 100644 Dataplex/tests/Unit/V1/CatalogServiceClientTest.php delete mode 100644 Dataplex/tests/Unit/V1/ContentServiceClientTest.php delete mode 100644 Dataplex/tests/Unit/V1/DataScanServiceClientTest.php delete mode 100644 Dataplex/tests/Unit/V1/DataTaxonomyServiceClientTest.php delete mode 100644 Dataplex/tests/Unit/V1/DataplexServiceClientTest.php delete mode 100644 Dataplex/tests/Unit/V1/MetadataServiceClientTest.php delete mode 100644 Dataproc/.repo-metadata.json delete mode 100644 DataprocMetastore/.repo-metadata.json delete mode 100644 DataprocMetastore/metadata/V1Alpha/Metastore.php delete mode 100644 DataprocMetastore/metadata/V1Alpha/MetastoreFederation.php delete mode 100644 DataprocMetastore/metadata/V1Beta/Metastore.php delete mode 100644 DataprocMetastore/metadata/V1Beta/MetastoreFederation.php delete mode 100644 DataprocMetastore/src/V1/BackendMetastore_MetastoreType.php delete mode 100644 DataprocMetastore/src/V1/Backup_State.php delete mode 100644 DataprocMetastore/src/V1/DatabaseDumpSpec_Type.php delete mode 100644 DataprocMetastore/src/V1/DataprocMetastoreClient.php delete mode 100644 DataprocMetastore/src/V1/DataprocMetastoreFederationClient.php delete mode 100644 DataprocMetastore/src/V1/DataprocMetastoreFederationGrpcClient.php delete mode 100644 DataprocMetastore/src/V1/DataprocMetastoreGrpcClient.php delete mode 100644 DataprocMetastore/src/V1/Federation_State.php delete mode 100644 DataprocMetastore/src/V1/Gapic/DataprocMetastoreFederationGapicClient.php delete mode 100644 DataprocMetastore/src/V1/Gapic/DataprocMetastoreGapicClient.php delete mode 100644 DataprocMetastore/src/V1/LocationMetadata_HiveMetastoreVersion.php delete mode 100644 DataprocMetastore/src/V1/MetadataExport_State.php delete mode 100644 DataprocMetastore/src/V1/MetadataImport_DatabaseDump.php delete mode 100644 DataprocMetastore/src/V1/MetadataImport_DatabaseDump_DatabaseType.php delete mode 100644 DataprocMetastore/src/V1/MetadataImport_State.php delete mode 100644 DataprocMetastore/src/V1/NetworkConfig_Consumer.php delete mode 100644 DataprocMetastore/src/V1/Restore_RestoreType.php delete mode 100644 DataprocMetastore/src/V1/Restore_State.php delete mode 100644 DataprocMetastore/src/V1/ScalingConfig_InstanceSize.php delete mode 100644 DataprocMetastore/src/V1/Service_DatabaseType.php delete mode 100644 DataprocMetastore/src/V1/Service_ReleaseChannel.php delete mode 100644 DataprocMetastore/src/V1/Service_State.php delete mode 100644 DataprocMetastore/src/V1/Service_Tier.php delete mode 100644 DataprocMetastore/src/V1/TelemetryConfig_LogFormat.php delete mode 100644 DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationResponse.php delete mode 100644 DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php delete mode 100644 DataprocMetastore/src/V1alpha/BackendMetastore.php delete mode 100644 DataprocMetastore/src/V1alpha/BackendMetastore/MetastoreType.php delete mode 100644 DataprocMetastore/src/V1alpha/BackendMetastore_MetastoreType.php delete mode 100644 DataprocMetastore/src/V1alpha/Backup.php delete mode 100644 DataprocMetastore/src/V1alpha/Backup/State.php delete mode 100644 DataprocMetastore/src/V1alpha/Backup_State.php delete mode 100644 DataprocMetastore/src/V1alpha/CreateBackupRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/CreateFederationRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/CreateServiceRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/DataCatalogConfig.php delete mode 100644 DataprocMetastore/src/V1alpha/DatabaseDumpSpec.php delete mode 100644 DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php delete mode 100644 DataprocMetastore/src/V1alpha/DatabaseDumpSpec_Type.php delete mode 100644 DataprocMetastore/src/V1alpha/DataplexConfig.php delete mode 100644 DataprocMetastore/src/V1alpha/DataprocMetastoreClient.php delete mode 100644 DataprocMetastore/src/V1alpha/DataprocMetastoreFederationClient.php delete mode 100644 DataprocMetastore/src/V1alpha/DataprocMetastoreFederationGrpcClient.php delete mode 100644 DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php delete mode 100644 DataprocMetastore/src/V1alpha/DeleteBackupRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/DeleteFederationRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/DeleteServiceRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/EncryptionConfig.php delete mode 100644 DataprocMetastore/src/V1alpha/ErrorDetails.php delete mode 100644 DataprocMetastore/src/V1alpha/ExportMetadataRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/Federation.php delete mode 100644 DataprocMetastore/src/V1alpha/Federation/State.php delete mode 100644 DataprocMetastore/src/V1alpha/Federation_State.php delete mode 100644 DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreFederationGapicClient.php delete mode 100644 DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php delete mode 100644 DataprocMetastore/src/V1alpha/GetBackupRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/GetFederationRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/GetMetadataImportRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/GetServiceRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php delete mode 100644 DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php delete mode 100644 DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php delete mode 100644 DataprocMetastore/src/V1alpha/KerberosConfig.php delete mode 100644 DataprocMetastore/src/V1alpha/Lake.php delete mode 100644 DataprocMetastore/src/V1alpha/ListBackupsRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/ListBackupsResponse.php delete mode 100644 DataprocMetastore/src/V1alpha/ListFederationsRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/ListFederationsResponse.php delete mode 100644 DataprocMetastore/src/V1alpha/ListMetadataImportsRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/ListMetadataImportsResponse.php delete mode 100644 DataprocMetastore/src/V1alpha/ListServicesRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/ListServicesResponse.php delete mode 100644 DataprocMetastore/src/V1alpha/LocationMetadata.php delete mode 100644 DataprocMetastore/src/V1alpha/LocationMetadata/HiveMetastoreVersion.php delete mode 100644 DataprocMetastore/src/V1alpha/LocationMetadata_HiveMetastoreVersion.php delete mode 100644 DataprocMetastore/src/V1alpha/MaintenanceWindow.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataExport.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataExport/State.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataExport_State.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataImport.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump/DatabaseType.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataImport/State.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataImport_DatabaseDump.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataImport_DatabaseDump_DatabaseType.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataImport_State.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataIntegration.php delete mode 100644 DataprocMetastore/src/V1alpha/MetadataManagementActivity.php delete mode 100644 DataprocMetastore/src/V1alpha/MoveTableToDatabaseRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/MoveTableToDatabaseResponse.php delete mode 100644 DataprocMetastore/src/V1alpha/NetworkConfig.php delete mode 100644 DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php delete mode 100644 DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php delete mode 100644 DataprocMetastore/src/V1alpha/OperationMetadata.php delete mode 100644 DataprocMetastore/src/V1alpha/QueryMetadataRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/QueryMetadataResponse.php delete mode 100644 DataprocMetastore/src/V1alpha/RemoveIamPolicyRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/RemoveIamPolicyResponse.php delete mode 100644 DataprocMetastore/src/V1alpha/Restore.php delete mode 100644 DataprocMetastore/src/V1alpha/Restore/RestoreType.php delete mode 100644 DataprocMetastore/src/V1alpha/Restore/State.php delete mode 100644 DataprocMetastore/src/V1alpha/RestoreServiceRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/Restore_RestoreType.php delete mode 100644 DataprocMetastore/src/V1alpha/Restore_State.php delete mode 100644 DataprocMetastore/src/V1alpha/ScalingConfig.php delete mode 100644 DataprocMetastore/src/V1alpha/ScalingConfig/InstanceSize.php delete mode 100644 DataprocMetastore/src/V1alpha/ScalingConfig_InstanceSize.php delete mode 100644 DataprocMetastore/src/V1alpha/Secret.php delete mode 100644 DataprocMetastore/src/V1alpha/Service.php delete mode 100644 DataprocMetastore/src/V1alpha/Service/DatabaseType.php delete mode 100644 DataprocMetastore/src/V1alpha/Service/ReleaseChannel.php delete mode 100644 DataprocMetastore/src/V1alpha/Service/State.php delete mode 100644 DataprocMetastore/src/V1alpha/Service/Tier.php delete mode 100644 DataprocMetastore/src/V1alpha/Service_DatabaseType.php delete mode 100644 DataprocMetastore/src/V1alpha/Service_ReleaseChannel.php delete mode 100644 DataprocMetastore/src/V1alpha/Service_State.php delete mode 100644 DataprocMetastore/src/V1alpha/Service_Tier.php delete mode 100644 DataprocMetastore/src/V1alpha/TelemetryConfig.php delete mode 100644 DataprocMetastore/src/V1alpha/TelemetryConfig/LogFormat.php delete mode 100644 DataprocMetastore/src/V1alpha/TelemetryConfig_LogFormat.php delete mode 100644 DataprocMetastore/src/V1alpha/UpdateFederationRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/UpdateMetadataImportRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/UpdateServiceRequest.php delete mode 100644 DataprocMetastore/src/V1alpha/gapic_metadata.json delete mode 100644 DataprocMetastore/src/V1alpha/resources/dataproc_metastore_client_config.json delete mode 100644 DataprocMetastore/src/V1alpha/resources/dataproc_metastore_descriptor_config.php delete mode 100644 DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_client_config.json delete mode 100644 DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_descriptor_config.php delete mode 100644 DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_rest_client_config.php delete mode 100644 DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php delete mode 100644 DataprocMetastore/src/V1beta/AlterMetadataResourceLocationRequest.php delete mode 100644 DataprocMetastore/src/V1beta/AlterMetadataResourceLocationResponse.php delete mode 100644 DataprocMetastore/src/V1beta/AuxiliaryVersionConfig.php delete mode 100644 DataprocMetastore/src/V1beta/BackendMetastore.php delete mode 100644 DataprocMetastore/src/V1beta/BackendMetastore/MetastoreType.php delete mode 100644 DataprocMetastore/src/V1beta/BackendMetastore_MetastoreType.php delete mode 100644 DataprocMetastore/src/V1beta/Backup.php delete mode 100644 DataprocMetastore/src/V1beta/Backup/State.php delete mode 100644 DataprocMetastore/src/V1beta/Backup_State.php delete mode 100644 DataprocMetastore/src/V1beta/CreateBackupRequest.php delete mode 100644 DataprocMetastore/src/V1beta/CreateFederationRequest.php delete mode 100644 DataprocMetastore/src/V1beta/CreateMetadataImportRequest.php delete mode 100644 DataprocMetastore/src/V1beta/CreateServiceRequest.php delete mode 100644 DataprocMetastore/src/V1beta/DataCatalogConfig.php delete mode 100644 DataprocMetastore/src/V1beta/DatabaseDumpSpec.php delete mode 100644 DataprocMetastore/src/V1beta/DatabaseDumpSpec/Type.php delete mode 100644 DataprocMetastore/src/V1beta/DatabaseDumpSpec_Type.php delete mode 100644 DataprocMetastore/src/V1beta/DataplexConfig.php delete mode 100644 DataprocMetastore/src/V1beta/DataprocMetastoreClient.php delete mode 100644 DataprocMetastore/src/V1beta/DataprocMetastoreFederationClient.php delete mode 100644 DataprocMetastore/src/V1beta/DataprocMetastoreFederationGrpcClient.php delete mode 100644 DataprocMetastore/src/V1beta/DataprocMetastoreGrpcClient.php delete mode 100644 DataprocMetastore/src/V1beta/DeleteBackupRequest.php delete mode 100644 DataprocMetastore/src/V1beta/DeleteFederationRequest.php delete mode 100644 DataprocMetastore/src/V1beta/DeleteServiceRequest.php delete mode 100644 DataprocMetastore/src/V1beta/EncryptionConfig.php delete mode 100644 DataprocMetastore/src/V1beta/ErrorDetails.php delete mode 100644 DataprocMetastore/src/V1beta/ExportMetadataRequest.php delete mode 100644 DataprocMetastore/src/V1beta/Federation.php delete mode 100644 DataprocMetastore/src/V1beta/Federation/State.php delete mode 100644 DataprocMetastore/src/V1beta/Federation_State.php delete mode 100644 DataprocMetastore/src/V1beta/Gapic/DataprocMetastoreFederationGapicClient.php delete mode 100644 DataprocMetastore/src/V1beta/Gapic/DataprocMetastoreGapicClient.php delete mode 100644 DataprocMetastore/src/V1beta/GetBackupRequest.php delete mode 100644 DataprocMetastore/src/V1beta/GetFederationRequest.php delete mode 100644 DataprocMetastore/src/V1beta/GetMetadataImportRequest.php delete mode 100644 DataprocMetastore/src/V1beta/GetServiceRequest.php delete mode 100644 DataprocMetastore/src/V1beta/HiveMetastoreConfig.php delete mode 100644 DataprocMetastore/src/V1beta/HiveMetastoreConfig/EndpointProtocol.php delete mode 100644 DataprocMetastore/src/V1beta/HiveMetastoreConfig_EndpointProtocol.php delete mode 100644 DataprocMetastore/src/V1beta/KerberosConfig.php delete mode 100644 DataprocMetastore/src/V1beta/Lake.php delete mode 100644 DataprocMetastore/src/V1beta/ListBackupsRequest.php delete mode 100644 DataprocMetastore/src/V1beta/ListBackupsResponse.php delete mode 100644 DataprocMetastore/src/V1beta/ListFederationsRequest.php delete mode 100644 DataprocMetastore/src/V1beta/ListFederationsResponse.php delete mode 100644 DataprocMetastore/src/V1beta/ListMetadataImportsRequest.php delete mode 100644 DataprocMetastore/src/V1beta/ListMetadataImportsResponse.php delete mode 100644 DataprocMetastore/src/V1beta/ListServicesRequest.php delete mode 100644 DataprocMetastore/src/V1beta/ListServicesResponse.php delete mode 100644 DataprocMetastore/src/V1beta/LocationMetadata.php delete mode 100644 DataprocMetastore/src/V1beta/LocationMetadata/HiveMetastoreVersion.php delete mode 100644 DataprocMetastore/src/V1beta/LocationMetadata_HiveMetastoreVersion.php delete mode 100644 DataprocMetastore/src/V1beta/MaintenanceWindow.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataExport.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataExport/State.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataExport_State.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataImport.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump/DatabaseType.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataImport/State.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataImport_DatabaseDump.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataImport_DatabaseDump_DatabaseType.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataImport_State.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataIntegration.php delete mode 100644 DataprocMetastore/src/V1beta/MetadataManagementActivity.php delete mode 100644 DataprocMetastore/src/V1beta/MoveTableToDatabaseRequest.php delete mode 100644 DataprocMetastore/src/V1beta/MoveTableToDatabaseResponse.php delete mode 100644 DataprocMetastore/src/V1beta/NetworkConfig.php delete mode 100644 DataprocMetastore/src/V1beta/NetworkConfig/Consumer.php delete mode 100644 DataprocMetastore/src/V1beta/NetworkConfig_Consumer.php delete mode 100644 DataprocMetastore/src/V1beta/OperationMetadata.php delete mode 100644 DataprocMetastore/src/V1beta/QueryMetadataRequest.php delete mode 100644 DataprocMetastore/src/V1beta/QueryMetadataResponse.php delete mode 100644 DataprocMetastore/src/V1beta/RemoveIamPolicyRequest.php delete mode 100644 DataprocMetastore/src/V1beta/RemoveIamPolicyResponse.php delete mode 100644 DataprocMetastore/src/V1beta/Restore.php delete mode 100644 DataprocMetastore/src/V1beta/Restore/RestoreType.php delete mode 100644 DataprocMetastore/src/V1beta/Restore/State.php delete mode 100644 DataprocMetastore/src/V1beta/RestoreServiceRequest.php delete mode 100644 DataprocMetastore/src/V1beta/Restore_RestoreType.php delete mode 100644 DataprocMetastore/src/V1beta/Restore_State.php delete mode 100644 DataprocMetastore/src/V1beta/ScalingConfig.php delete mode 100644 DataprocMetastore/src/V1beta/ScalingConfig/InstanceSize.php delete mode 100644 DataprocMetastore/src/V1beta/ScalingConfig_InstanceSize.php delete mode 100644 DataprocMetastore/src/V1beta/Secret.php delete mode 100644 DataprocMetastore/src/V1beta/Service.php delete mode 100644 DataprocMetastore/src/V1beta/Service/DatabaseType.php delete mode 100644 DataprocMetastore/src/V1beta/Service/ReleaseChannel.php delete mode 100644 DataprocMetastore/src/V1beta/Service/State.php delete mode 100644 DataprocMetastore/src/V1beta/Service/Tier.php delete mode 100644 DataprocMetastore/src/V1beta/Service_DatabaseType.php delete mode 100644 DataprocMetastore/src/V1beta/Service_ReleaseChannel.php delete mode 100644 DataprocMetastore/src/V1beta/Service_State.php delete mode 100644 DataprocMetastore/src/V1beta/Service_Tier.php delete mode 100644 DataprocMetastore/src/V1beta/TelemetryConfig.php delete mode 100644 DataprocMetastore/src/V1beta/TelemetryConfig/LogFormat.php delete mode 100644 DataprocMetastore/src/V1beta/TelemetryConfig_LogFormat.php delete mode 100644 DataprocMetastore/src/V1beta/UpdateFederationRequest.php delete mode 100644 DataprocMetastore/src/V1beta/UpdateMetadataImportRequest.php delete mode 100644 DataprocMetastore/src/V1beta/UpdateServiceRequest.php delete mode 100644 DataprocMetastore/src/V1beta/gapic_metadata.json delete mode 100644 DataprocMetastore/src/V1beta/resources/dataproc_metastore_client_config.json delete mode 100644 DataprocMetastore/src/V1beta/resources/dataproc_metastore_descriptor_config.php delete mode 100644 DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_client_config.json delete mode 100644 DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_descriptor_config.php delete mode 100644 DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_rest_client_config.php delete mode 100644 DataprocMetastore/src/V1beta/resources/dataproc_metastore_rest_client_config.php delete mode 100644 DataprocMetastore/tests/Unit/V1/DataprocMetastoreClientTest.php delete mode 100644 DataprocMetastore/tests/Unit/V1/DataprocMetastoreFederationClientTest.php delete mode 100644 DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreClientTest.php delete mode 100644 DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreFederationClientTest.php delete mode 100644 DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreClientTest.php delete mode 100644 DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreFederationClientTest.php delete mode 100644 Datastore/.repo-metadata.json create mode 100644 Datastore/src/V1/PropertyMask.php delete mode 100644 DatastoreAdmin/.repo-metadata.json delete mode 100644 Datastream/.repo-metadata.json delete mode 100644 Debugger/.repo-metadata.json delete mode 100644 Deploy/.repo-metadata.json delete mode 100644 Deploy/src/V1/CloudDeployClient.php delete mode 100644 Deploy/src/V1/CloudDeployGrpcClient.php delete mode 100644 Deploy/src/V1/Gapic/CloudDeployGapicClient.php delete mode 100644 Deploy/tests/Unit/V1/CloudDeployClientTest.php create mode 100644 DeveloperConnect/.OwlBot.yaml create mode 100644 DeveloperConnect/.gitattributes create mode 100644 DeveloperConnect/.github/pull_request_template.md create mode 100644 DeveloperConnect/CONTRIBUTING.md create mode 100644 DeveloperConnect/LICENSE create mode 100644 DeveloperConnect/README.md create mode 100644 DeveloperConnect/VERSION create mode 100644 DeveloperConnect/composer.json create mode 100644 DeveloperConnect/metadata/V1/DeveloperConnect.php create mode 100644 DeveloperConnect/owlbot.py create mode 100644 DeveloperConnect/phpunit.xml.dist create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/create_connection.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/create_git_repository_link.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/delete_connection.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/delete_git_repository_link.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_git_refs.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_read_token.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_read_write_token.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/get_connection.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/get_git_repository_link.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/get_location.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/list_connections.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/list_git_repository_links.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/list_locations.php create mode 100644 DeveloperConnect/samples/V1/DeveloperConnectClient/update_connection.php create mode 100644 DeveloperConnect/src/V1/Client/DeveloperConnectClient.php create mode 100644 DeveloperConnect/src/V1/Connection.php create mode 100644 DeveloperConnect/src/V1/CreateConnectionRequest.php create mode 100644 DeveloperConnect/src/V1/CreateGitRepositoryLinkRequest.php create mode 100644 DeveloperConnect/src/V1/DeleteConnectionRequest.php create mode 100644 DeveloperConnect/src/V1/DeleteGitRepositoryLinkRequest.php create mode 100644 DeveloperConnect/src/V1/FetchGitHubInstallationsRequest.php create mode 100644 DeveloperConnect/src/V1/FetchGitHubInstallationsResponse.php create mode 100644 DeveloperConnect/src/V1/FetchGitHubInstallationsResponse/Installation.php create mode 100644 DeveloperConnect/src/V1/FetchGitRefsRequest.php create mode 100644 DeveloperConnect/src/V1/FetchGitRefsRequest/RefType.php create mode 100644 DeveloperConnect/src/V1/FetchGitRefsResponse.php create mode 100644 DeveloperConnect/src/V1/FetchLinkableGitRepositoriesRequest.php create mode 100644 DeveloperConnect/src/V1/FetchLinkableGitRepositoriesResponse.php create mode 100644 DeveloperConnect/src/V1/FetchReadTokenRequest.php create mode 100644 DeveloperConnect/src/V1/FetchReadTokenResponse.php create mode 100644 DeveloperConnect/src/V1/FetchReadWriteTokenRequest.php create mode 100644 DeveloperConnect/src/V1/FetchReadWriteTokenResponse.php create mode 100644 DeveloperConnect/src/V1/GetConnectionRequest.php create mode 100644 DeveloperConnect/src/V1/GetGitRepositoryLinkRequest.php create mode 100644 DeveloperConnect/src/V1/GitHubConfig.php create mode 100644 DeveloperConnect/src/V1/GitHubConfig/GitHubApp.php create mode 100644 DeveloperConnect/src/V1/GitRepositoryLink.php create mode 100644 DeveloperConnect/src/V1/InstallationState.php create mode 100644 DeveloperConnect/src/V1/InstallationState/Stage.php create mode 100644 DeveloperConnect/src/V1/LinkableGitRepository.php create mode 100644 DeveloperConnect/src/V1/ListConnectionsRequest.php create mode 100644 DeveloperConnect/src/V1/ListConnectionsResponse.php create mode 100644 DeveloperConnect/src/V1/ListGitRepositoryLinksRequest.php create mode 100644 DeveloperConnect/src/V1/ListGitRepositoryLinksResponse.php create mode 100644 DeveloperConnect/src/V1/OAuthCredential.php create mode 100644 DeveloperConnect/src/V1/OperationMetadata.php create mode 100644 DeveloperConnect/src/V1/UpdateConnectionRequest.php create mode 100644 DeveloperConnect/src/V1/gapic_metadata.json create mode 100644 DeveloperConnect/src/V1/resources/developer_connect_client_config.json create mode 100644 DeveloperConnect/src/V1/resources/developer_connect_descriptor_config.php create mode 100644 DeveloperConnect/src/V1/resources/developer_connect_rest_client_config.php create mode 100644 DeveloperConnect/tests/Unit/V1/Client/DeveloperConnectClientTest.php delete mode 100644 Dialogflow/.repo-metadata.json delete mode 100644 DialogflowCx/.repo-metadata.json delete mode 100644 DiscoveryEngine/.repo-metadata.json create mode 100644 DiscoveryEngine/metadata/V1/Answer.php create mode 100644 DiscoveryEngine/metadata/V1/Control.php create mode 100644 DiscoveryEngine/metadata/V1/ControlService.php create mode 100644 DiscoveryEngine/metadata/V1/DocumentProcessingConfig.php create mode 100644 DiscoveryEngine/metadata/V1/GroundedGenerationService.php create mode 100644 DiscoveryEngine/metadata/V1/Grounding.php create mode 100644 DiscoveryEngine/metadata/V1/Project.php create mode 100644 DiscoveryEngine/metadata/V1/ProjectService.php create mode 100644 DiscoveryEngine/metadata/V1/RankService.php create mode 100644 DiscoveryEngine/metadata/V1/Session.php create mode 100644 DiscoveryEngine/metadata/V1Beta/Control.php create mode 100644 DiscoveryEngine/metadata/V1Beta/ControlService.php create mode 100644 DiscoveryEngine/metadata/V1Beta/CustomTuningModel.php create mode 100644 DiscoveryEngine/metadata/V1Beta/Project.php create mode 100644 DiscoveryEngine/metadata/V1Beta/ProjectService.php create mode 100644 DiscoveryEngine/samples/V1/ControlServiceClient/create_control.php create mode 100644 DiscoveryEngine/samples/V1/ControlServiceClient/delete_control.php create mode 100644 DiscoveryEngine/samples/V1/ControlServiceClient/get_control.php create mode 100644 DiscoveryEngine/samples/V1/ControlServiceClient/list_controls.php create mode 100644 DiscoveryEngine/samples/V1/ControlServiceClient/update_control.php create mode 100644 DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/answer_query.php create mode 100644 DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/create_session.php create mode 100644 DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/delete_session.php create mode 100644 DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/get_answer.php create mode 100644 DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/get_session.php create mode 100644 DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/list_sessions.php create mode 100644 DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/update_session.php create mode 100644 DiscoveryEngine/samples/V1/GroundedGenerationServiceClient/check_grounding.php create mode 100644 DiscoveryEngine/samples/V1/ProjectServiceClient/provision_project.php create mode 100644 DiscoveryEngine/samples/V1/RankServiceClient/rank.php create mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/create_control.php create mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/delete_control.php create mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/get_control.php create mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/list_controls.php create mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/update_control.php create mode 100644 DiscoveryEngine/samples/V1beta/ProjectServiceClient/provision_project.php create mode 100644 DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/list_custom_models.php create mode 100644 DiscoveryEngine/src/V1/Answer.php create mode 100644 DiscoveryEngine/src/V1/Answer/AnswerSkippedReason.php create mode 100644 DiscoveryEngine/src/V1/Answer/Citation.php create mode 100644 DiscoveryEngine/src/V1/Answer/CitationSource.php create mode 100644 DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo.php create mode 100644 DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo.php create mode 100644 DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo/Type.php create mode 100644 DiscoveryEngine/src/V1/Answer/Reference.php create mode 100644 DiscoveryEngine/src/V1/Answer/Reference/ChunkInfo.php create mode 100644 DiscoveryEngine/src/V1/Answer/Reference/ChunkInfo/DocumentMetadata.php create mode 100644 DiscoveryEngine/src/V1/Answer/Reference/UnstructuredDocumentInfo.php create mode 100644 DiscoveryEngine/src/V1/Answer/Reference/UnstructuredDocumentInfo/ChunkContent.php create mode 100644 DiscoveryEngine/src/V1/Answer/State.php create mode 100644 DiscoveryEngine/src/V1/Answer/Step.php create mode 100644 DiscoveryEngine/src/V1/Answer/Step/Action.php create mode 100644 DiscoveryEngine/src/V1/Answer/Step/Action/Observation.php create mode 100644 DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult.php create mode 100644 DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult/ChunkInfo.php create mode 100644 DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult/SnippetInfo.php create mode 100644 DiscoveryEngine/src/V1/Answer/Step/Action/SearchAction.php create mode 100644 DiscoveryEngine/src/V1/Answer/Step/State.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec/ModelSpec.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec/PromptSpec.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec/Type.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryRephraserSpec.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/RelatedQuestionsSpec.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SafetySpec.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchParams.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/DocumentContext.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveAnswer.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveSegment.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryResponse.php create mode 100644 DiscoveryEngine/src/V1/CheckGroundingRequest.php create mode 100644 DiscoveryEngine/src/V1/CheckGroundingResponse.php create mode 100644 DiscoveryEngine/src/V1/CheckGroundingResponse/Claim.php create mode 100644 DiscoveryEngine/src/V1/CheckGroundingSpec.php create mode 100644 DiscoveryEngine/src/V1/Client/ControlServiceClient.php create mode 100644 DiscoveryEngine/src/V1/Client/GroundedGenerationServiceClient.php create mode 100644 DiscoveryEngine/src/V1/Client/ProjectServiceClient.php create mode 100644 DiscoveryEngine/src/V1/Client/RankServiceClient.php create mode 100644 DiscoveryEngine/src/V1/Condition.php create mode 100644 DiscoveryEngine/src/V1/Condition/QueryTerm.php create mode 100644 DiscoveryEngine/src/V1/Condition/TimeRange.php create mode 100644 DiscoveryEngine/src/V1/Control.php create mode 100644 DiscoveryEngine/src/V1/Control/BoostAction.php create mode 100644 DiscoveryEngine/src/V1/Control/FilterAction.php create mode 100644 DiscoveryEngine/src/V1/Control/RedirectAction.php create mode 100644 DiscoveryEngine/src/V1/Control/SynonymsAction.php create mode 100644 DiscoveryEngine/src/V1/CreateControlRequest.php create mode 100644 DiscoveryEngine/src/V1/CreateSessionRequest.php create mode 100644 DiscoveryEngine/src/V1/DeleteControlRequest.php create mode 100644 DiscoveryEngine/src/V1/DeleteSessionRequest.php create mode 100644 DiscoveryEngine/src/V1/DocumentProcessingConfig.php create mode 100644 DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig.php create mode 100644 DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig/DigitalParsingConfig.php create mode 100644 DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig/OcrParsingConfig.php create mode 100644 DiscoveryEngine/src/V1/FactChunk.php create mode 100644 DiscoveryEngine/src/V1/GetAnswerRequest.php create mode 100644 DiscoveryEngine/src/V1/GetControlRequest.php create mode 100644 DiscoveryEngine/src/V1/GetSessionRequest.php create mode 100644 DiscoveryEngine/src/V1/GroundingFact.php create mode 100644 DiscoveryEngine/src/V1/ListControlsRequest.php create mode 100644 DiscoveryEngine/src/V1/ListControlsResponse.php create mode 100644 DiscoveryEngine/src/V1/ListSessionsRequest.php create mode 100644 DiscoveryEngine/src/V1/ListSessionsResponse.php create mode 100644 DiscoveryEngine/src/V1/Project.php create mode 100644 DiscoveryEngine/src/V1/Project/ServiceTerms.php create mode 100644 DiscoveryEngine/src/V1/Project/ServiceTerms/State.php create mode 100644 DiscoveryEngine/src/V1/ProvisionProjectMetadata.php create mode 100644 DiscoveryEngine/src/V1/ProvisionProjectRequest.php create mode 100644 DiscoveryEngine/src/V1/Query.php create mode 100644 DiscoveryEngine/src/V1/RankRequest.php create mode 100644 DiscoveryEngine/src/V1/RankResponse.php create mode 100644 DiscoveryEngine/src/V1/RankingRecord.php create mode 100644 DiscoveryEngine/src/V1/SearchUseCase.php create mode 100644 DiscoveryEngine/src/V1/Session.php create mode 100644 DiscoveryEngine/src/V1/Session/State.php create mode 100644 DiscoveryEngine/src/V1/Session/Turn.php create mode 100644 DiscoveryEngine/src/V1/UpdateControlRequest.php create mode 100644 DiscoveryEngine/src/V1/UpdateSessionRequest.php create mode 100644 DiscoveryEngine/src/V1/resources/control_service_client_config.json create mode 100644 DiscoveryEngine/src/V1/resources/control_service_descriptor_config.php create mode 100644 DiscoveryEngine/src/V1/resources/control_service_rest_client_config.php create mode 100644 DiscoveryEngine/src/V1/resources/grounded_generation_service_client_config.json create mode 100644 DiscoveryEngine/src/V1/resources/grounded_generation_service_descriptor_config.php create mode 100644 DiscoveryEngine/src/V1/resources/grounded_generation_service_rest_client_config.php create mode 100644 DiscoveryEngine/src/V1/resources/project_service_client_config.json create mode 100644 DiscoveryEngine/src/V1/resources/project_service_descriptor_config.php create mode 100644 DiscoveryEngine/src/V1/resources/project_service_rest_client_config.php create mode 100644 DiscoveryEngine/src/V1/resources/rank_service_client_config.json create mode 100644 DiscoveryEngine/src/V1/resources/rank_service_descriptor_config.php create mode 100644 DiscoveryEngine/src/V1/resources/rank_service_rest_client_config.php create mode 100644 DiscoveryEngine/src/V1beta/Client/ControlServiceClient.php create mode 100644 DiscoveryEngine/src/V1beta/Client/ProjectServiceClient.php create mode 100644 DiscoveryEngine/src/V1beta/Condition.php create mode 100644 DiscoveryEngine/src/V1beta/Condition/QueryTerm.php create mode 100644 DiscoveryEngine/src/V1beta/Condition/TimeRange.php create mode 100644 DiscoveryEngine/src/V1beta/Control.php create mode 100644 DiscoveryEngine/src/V1beta/Control/BoostAction.php create mode 100644 DiscoveryEngine/src/V1beta/Control/FilterAction.php create mode 100644 DiscoveryEngine/src/V1beta/Control/RedirectAction.php create mode 100644 DiscoveryEngine/src/V1beta/Control/SynonymsAction.php create mode 100644 DiscoveryEngine/src/V1beta/CreateControlRequest.php create mode 100644 DiscoveryEngine/src/V1beta/CustomTuningModel.php create mode 100644 DiscoveryEngine/src/V1beta/CustomTuningModel/ModelState.php create mode 100644 DiscoveryEngine/src/V1beta/DeleteControlRequest.php create mode 100644 DiscoveryEngine/src/V1beta/GetControlRequest.php create mode 100644 DiscoveryEngine/src/V1beta/ListControlsRequest.php create mode 100644 DiscoveryEngine/src/V1beta/ListControlsResponse.php create mode 100644 DiscoveryEngine/src/V1beta/ListCustomModelsRequest.php create mode 100644 DiscoveryEngine/src/V1beta/ListCustomModelsResponse.php create mode 100644 DiscoveryEngine/src/V1beta/Project.php create mode 100644 DiscoveryEngine/src/V1beta/Project/ServiceTerms.php create mode 100644 DiscoveryEngine/src/V1beta/Project/ServiceTerms/State.php create mode 100644 DiscoveryEngine/src/V1beta/ProvisionProjectMetadata.php create mode 100644 DiscoveryEngine/src/V1beta/ProvisionProjectRequest.php create mode 100644 DiscoveryEngine/src/V1beta/SearchUseCase.php create mode 100644 DiscoveryEngine/src/V1beta/UpdateControlRequest.php create mode 100644 DiscoveryEngine/src/V1beta/resources/control_service_client_config.json create mode 100644 DiscoveryEngine/src/V1beta/resources/control_service_descriptor_config.php create mode 100644 DiscoveryEngine/src/V1beta/resources/control_service_rest_client_config.php create mode 100644 DiscoveryEngine/src/V1beta/resources/project_service_client_config.json create mode 100644 DiscoveryEngine/src/V1beta/resources/project_service_descriptor_config.php create mode 100644 DiscoveryEngine/src/V1beta/resources/project_service_rest_client_config.php create mode 100644 DiscoveryEngine/tests/Unit/V1/Client/ControlServiceClientTest.php create mode 100644 DiscoveryEngine/tests/Unit/V1/Client/GroundedGenerationServiceClientTest.php create mode 100644 DiscoveryEngine/tests/Unit/V1/Client/ProjectServiceClientTest.php create mode 100644 DiscoveryEngine/tests/Unit/V1/Client/RankServiceClientTest.php create mode 100644 DiscoveryEngine/tests/Unit/V1beta/Client/ControlServiceClientTest.php create mode 100644 DiscoveryEngine/tests/Unit/V1beta/Client/ProjectServiceClientTest.php delete mode 100644 Dlp/.repo-metadata.json create mode 100644 Dlp/samples/V2/DlpServiceClient/create_connection.php create mode 100644 Dlp/samples/V2/DlpServiceClient/delete_connection.php create mode 100644 Dlp/samples/V2/DlpServiceClient/delete_table_data_profile.php create mode 100644 Dlp/samples/V2/DlpServiceClient/get_connection.php create mode 100644 Dlp/samples/V2/DlpServiceClient/list_connections.php create mode 100644 Dlp/samples/V2/DlpServiceClient/search_connections.php create mode 100644 Dlp/samples/V2/DlpServiceClient/update_connection.php create mode 100644 Dlp/src/V2/AllOtherDatabaseResources.php create mode 100644 Dlp/src/V2/CloudSqlDiscoveryTarget.php create mode 100644 Dlp/src/V2/CloudSqlIamCredential.php create mode 100644 Dlp/src/V2/CloudSqlProperties.php create mode 100644 Dlp/src/V2/CloudSqlProperties/DatabaseEngine.php create mode 100644 Dlp/src/V2/Connection.php create mode 100644 Dlp/src/V2/ConnectionState.php create mode 100644 Dlp/src/V2/CreateConnectionRequest.php create mode 100644 Dlp/src/V2/DatabaseResourceCollection.php create mode 100644 Dlp/src/V2/DatabaseResourceReference.php create mode 100644 Dlp/src/V2/DatabaseResourceRegex.php create mode 100644 Dlp/src/V2/DatabaseResourceRegexes.php create mode 100644 Dlp/src/V2/DeleteConnectionRequest.php create mode 100644 Dlp/src/V2/DeleteTableDataProfileRequest.php create mode 100644 Dlp/src/V2/DiscoveryCloudSqlConditions.php create mode 100644 Dlp/src/V2/DiscoveryCloudSqlConditions/DatabaseEngine.php create mode 100644 Dlp/src/V2/DiscoveryCloudSqlConditions/DatabaseResourceType.php create mode 100644 Dlp/src/V2/DiscoveryCloudSqlFilter.php create mode 100644 Dlp/src/V2/DiscoveryCloudSqlGenerationCadence.php create mode 100644 Dlp/src/V2/DiscoveryCloudSqlGenerationCadence/SchemaModifiedCadence.php create mode 100644 Dlp/src/V2/DiscoveryCloudSqlGenerationCadence/SchemaModifiedCadence/CloudSqlSchemaModification.php create mode 100644 Dlp/src/V2/GetConnectionRequest.php create mode 100644 Dlp/src/V2/ListConnectionsRequest.php create mode 100644 Dlp/src/V2/ListConnectionsResponse.php create mode 100644 Dlp/src/V2/SearchConnectionsRequest.php create mode 100644 Dlp/src/V2/SearchConnectionsResponse.php create mode 100644 Dlp/src/V2/SecretManagerCredential.php create mode 100644 Dlp/src/V2/SecretsDiscoveryTarget.php create mode 100644 Dlp/src/V2/TableReference.php create mode 100644 Dlp/src/V2/UpdateConnectionRequest.php delete mode 100644 Dms/.repo-metadata.json delete mode 100644 DocumentAi/.repo-metadata.json create mode 100644 DocumentAi/src/V1/Document/ChunkedDocument.php create mode 100644 DocumentAi/src/V1/Document/ChunkedDocument/Chunk.php create mode 100644 DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php create mode 100644 DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php create mode 100644 DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php create mode 100644 DocumentAi/src/V1/Document/DocumentLayout.php create mode 100644 DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock.php create mode 100644 DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php create mode 100644 DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php create mode 100644 DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php create mode 100644 DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php create mode 100644 DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php create mode 100644 DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php create mode 100644 DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php create mode 100644 DocumentAi/src/V1/ProcessOptions/LayoutConfig.php create mode 100644 DocumentAi/src/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php delete mode 100644 Domains/.repo-metadata.json delete mode 100644 EdgeNetwork/.repo-metadata.json delete mode 100644 ErrorReporting/.repo-metadata.json delete mode 100644 EssentialContacts/.repo-metadata.json delete mode 100644 EssentialContacts/src/V1/EssentialContactsServiceClient.php delete mode 100644 EssentialContacts/src/V1/EssentialContactsServiceGrpcClient.php delete mode 100644 EssentialContacts/src/V1/Gapic/EssentialContactsServiceGapicClient.php delete mode 100644 EssentialContacts/tests/Unit/V1/EssentialContactsServiceClientTest.php delete mode 100644 Eventarc/.repo-metadata.json delete mode 100644 EventarcPublishing/.repo-metadata.json delete mode 100644 Filestore/.repo-metadata.json delete mode 100644 Firestore/.repo-metadata.json create mode 100644 Firestore/src/Admin/V1/BulkDeleteDocumentsMetadata.php create mode 100644 Firestore/src/Admin/V1/BulkDeleteDocumentsRequest.php create mode 100644 Firestore/src/Admin/V1/BulkDeleteDocumentsResponse.php delete mode 100644 Functions/.repo-metadata.json delete mode 100644 GSuiteAddOns/.repo-metadata.json delete mode 100644 Gaming/.repo-metadata.json create mode 100644 GeoCommonProtos/.OwlBot.yaml create mode 100644 GeoCommonProtos/.gitattributes create mode 100644 GeoCommonProtos/CONTRIBUTING.md create mode 100644 GeoCommonProtos/LICENSE create mode 100644 GeoCommonProtos/README.md create mode 100644 GeoCommonProtos/VERSION create mode 100644 GeoCommonProtos/composer.json create mode 100644 GeoCommonProtos/metadata/Type/Viewport.php create mode 100644 GeoCommonProtos/owlbot.py create mode 100644 GeoCommonProtos/phpunit.xml.dist create mode 100644 GeoCommonProtos/pull_request_template.md create mode 100644 GeoCommonProtos/src/Type/Viewport.php create mode 100644 GeoCommonProtos/tests/Unit/InstantiateClassesTest.php delete mode 100644 GkeBackup/.repo-metadata.json create mode 100644 GkeBackup/src/V1/ResourceSelector.php create mode 100644 GkeBackup/src/V1/Restore/Filter.php create mode 100644 GkeBackup/src/V1/RestoreConfig/RestoreOrder.php create mode 100644 GkeBackup/src/V1/RestoreConfig/RestoreOrder/GroupKindDependency.php create mode 100644 GkeBackup/src/V1/RestoreConfig/VolumeDataRestorePolicyBinding.php create mode 100644 GkeBackup/src/V1/VolumeDataRestorePolicyOverride.php create mode 100644 GkeBackup/src/V1/VolumeTypeEnum.php create mode 100644 GkeBackup/src/V1/VolumeTypeEnum/VolumeType.php delete mode 100644 GkeConnectGateway/.repo-metadata.json delete mode 100644 GkeHub/.repo-metadata.json delete mode 100644 GkeMultiCloud/.repo-metadata.json delete mode 100644 Grafeas/.repo-metadata.json delete mode 100644 Iam/.repo-metadata.json delete mode 100644 IamCredentials/.repo-metadata.json delete mode 100644 Iap/.repo-metadata.json delete mode 100644 Ids/.repo-metadata.json delete mode 100644 Ids/src/V1/Gapic/IDSGapicClient.php delete mode 100644 Ids/src/V1/IDSClient.php delete mode 100644 Ids/src/V1/IDSGrpcClient.php delete mode 100644 Ids/tests/Unit/V1/IDSClientTest.php delete mode 100644 Iot/.repo-metadata.json delete mode 100644 Kms/.repo-metadata.json create mode 100644 Kms/metadata/V1/Autokey.php create mode 100644 Kms/metadata/V1/AutokeyAdmin.php create mode 100644 Kms/samples/V1/AutokeyAdminClient/get_autokey_config.php create mode 100644 Kms/samples/V1/AutokeyAdminClient/get_iam_policy.php create mode 100644 Kms/samples/V1/AutokeyAdminClient/get_location.php create mode 100644 Kms/samples/V1/AutokeyAdminClient/list_locations.php create mode 100644 Kms/samples/V1/AutokeyAdminClient/set_iam_policy.php create mode 100644 Kms/samples/V1/AutokeyAdminClient/show_effective_autokey_config.php create mode 100644 Kms/samples/V1/AutokeyAdminClient/test_iam_permissions.php create mode 100644 Kms/samples/V1/AutokeyAdminClient/update_autokey_config.php create mode 100644 Kms/samples/V1/AutokeyClient/create_key_handle.php create mode 100644 Kms/samples/V1/AutokeyClient/get_iam_policy.php create mode 100644 Kms/samples/V1/AutokeyClient/get_key_handle.php create mode 100644 Kms/samples/V1/AutokeyClient/get_location.php create mode 100644 Kms/samples/V1/AutokeyClient/list_key_handles.php create mode 100644 Kms/samples/V1/AutokeyClient/list_locations.php create mode 100644 Kms/samples/V1/AutokeyClient/set_iam_policy.php create mode 100644 Kms/samples/V1/AutokeyClient/test_iam_permissions.php create mode 100644 Kms/src/V1/AutokeyAdminClient.php create mode 100644 Kms/src/V1/AutokeyClient.php create mode 100644 Kms/src/V1/AutokeyConfig.php create mode 100644 Kms/src/V1/Client/AutokeyAdminClient.php create mode 100644 Kms/src/V1/Client/AutokeyClient.php create mode 100644 Kms/src/V1/CreateKeyHandleMetadata.php create mode 100644 Kms/src/V1/CreateKeyHandleRequest.php create mode 100644 Kms/src/V1/Gapic/AutokeyAdminGapicClient.php create mode 100644 Kms/src/V1/Gapic/AutokeyGapicClient.php create mode 100644 Kms/src/V1/GetAutokeyConfigRequest.php create mode 100644 Kms/src/V1/GetKeyHandleRequest.php create mode 100644 Kms/src/V1/KeyHandle.php create mode 100644 Kms/src/V1/ListKeyHandlesRequest.php create mode 100644 Kms/src/V1/ListKeyHandlesResponse.php create mode 100644 Kms/src/V1/ShowEffectiveAutokeyConfigRequest.php create mode 100644 Kms/src/V1/ShowEffectiveAutokeyConfigResponse.php create mode 100644 Kms/src/V1/UpdateAutokeyConfigRequest.php create mode 100644 Kms/src/V1/resources/autokey_admin_client_config.json create mode 100644 Kms/src/V1/resources/autokey_admin_descriptor_config.php create mode 100644 Kms/src/V1/resources/autokey_admin_rest_client_config.php create mode 100644 Kms/src/V1/resources/autokey_client_config.json create mode 100644 Kms/src/V1/resources/autokey_descriptor_config.php create mode 100644 Kms/src/V1/resources/autokey_rest_client_config.php create mode 100644 Kms/tests/Unit/V1/AutokeyAdminClientTest.php create mode 100644 Kms/tests/Unit/V1/AutokeyClientTest.php create mode 100644 Kms/tests/Unit/V1/Client/AutokeyAdminClientTest.php create mode 100644 Kms/tests/Unit/V1/Client/AutokeyClientTest.php delete mode 100644 KmsInventory/.repo-metadata.json delete mode 100644 Language/.repo-metadata.json delete mode 100644 LifeSciences/.repo-metadata.json delete mode 100644 Logging/.repo-metadata.json delete mode 100644 LongRunning/.repo-metadata.json delete mode 100644 ManagedIdentities/.repo-metadata.json create mode 100644 ManagedKafka/.OwlBot.yaml create mode 100644 ManagedKafka/.gitattributes create mode 100644 ManagedKafka/.github/pull_request_template.md create mode 100644 ManagedKafka/CONTRIBUTING.md create mode 100644 ManagedKafka/LICENSE create mode 100644 ManagedKafka/README.md create mode 100644 ManagedKafka/VERSION create mode 100644 ManagedKafka/composer.json create mode 100644 ManagedKafka/metadata/V1/ManagedKafka.php create mode 100644 ManagedKafka/metadata/V1/Resources.php create mode 100644 ManagedKafka/owlbot.py create mode 100644 ManagedKafka/phpunit.xml.dist create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/create_cluster.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/create_topic.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/delete_cluster.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/delete_consumer_group.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/delete_topic.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/get_cluster.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/get_consumer_group.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/get_location.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/get_topic.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/list_clusters.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/list_consumer_groups.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/list_locations.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/list_topics.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/update_cluster.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/update_consumer_group.php create mode 100644 ManagedKafka/samples/V1/ManagedKafkaClient/update_topic.php create mode 100644 ManagedKafka/src/V1/AccessConfig.php create mode 100644 ManagedKafka/src/V1/CapacityConfig.php create mode 100644 ManagedKafka/src/V1/Client/ManagedKafkaClient.php create mode 100644 ManagedKafka/src/V1/Cluster.php create mode 100644 ManagedKafka/src/V1/Cluster/State.php create mode 100644 ManagedKafka/src/V1/ConsumerGroup.php create mode 100644 ManagedKafka/src/V1/ConsumerPartitionMetadata.php create mode 100644 ManagedKafka/src/V1/ConsumerTopicMetadata.php create mode 100644 ManagedKafka/src/V1/CreateClusterRequest.php create mode 100644 ManagedKafka/src/V1/CreateTopicRequest.php create mode 100644 ManagedKafka/src/V1/DeleteClusterRequest.php create mode 100644 ManagedKafka/src/V1/DeleteConsumerGroupRequest.php create mode 100644 ManagedKafka/src/V1/DeleteTopicRequest.php create mode 100644 ManagedKafka/src/V1/GcpConfig.php create mode 100644 ManagedKafka/src/V1/GetClusterRequest.php create mode 100644 ManagedKafka/src/V1/GetConsumerGroupRequest.php create mode 100644 ManagedKafka/src/V1/GetTopicRequest.php create mode 100644 ManagedKafka/src/V1/ListClustersRequest.php create mode 100644 ManagedKafka/src/V1/ListClustersResponse.php create mode 100644 ManagedKafka/src/V1/ListConsumerGroupsRequest.php create mode 100644 ManagedKafka/src/V1/ListConsumerGroupsResponse.php create mode 100644 ManagedKafka/src/V1/ListTopicsRequest.php create mode 100644 ManagedKafka/src/V1/ListTopicsResponse.php create mode 100644 ManagedKafka/src/V1/NetworkConfig.php create mode 100644 ManagedKafka/src/V1/OperationMetadata.php create mode 100644 ManagedKafka/src/V1/RebalanceConfig.php create mode 100644 ManagedKafka/src/V1/RebalanceConfig/Mode.php create mode 100644 ManagedKafka/src/V1/Topic.php create mode 100644 ManagedKafka/src/V1/UpdateClusterRequest.php create mode 100644 ManagedKafka/src/V1/UpdateConsumerGroupRequest.php create mode 100644 ManagedKafka/src/V1/UpdateTopicRequest.php create mode 100644 ManagedKafka/src/V1/gapic_metadata.json create mode 100644 ManagedKafka/src/V1/resources/managed_kafka_client_config.json create mode 100644 ManagedKafka/src/V1/resources/managed_kafka_descriptor_config.php create mode 100644 ManagedKafka/src/V1/resources/managed_kafka_rest_client_config.php create mode 100644 ManagedKafka/tests/Unit/V1/Client/ManagedKafkaClientTest.php create mode 100644 MapsFleetEngine/.OwlBot.yaml create mode 100644 MapsFleetEngine/.gitattributes create mode 100644 MapsFleetEngine/.github/pull_request_template.md create mode 100644 MapsFleetEngine/CONTRIBUTING.md create mode 100644 MapsFleetEngine/LICENSE create mode 100644 MapsFleetEngine/README.md create mode 100644 MapsFleetEngine/VERSION create mode 100644 MapsFleetEngine/composer.json create mode 100644 MapsFleetEngine/metadata/V1/Fleetengine.php create mode 100644 MapsFleetEngine/metadata/V1/Header.php create mode 100644 MapsFleetEngine/metadata/V1/Traffic.php create mode 100644 MapsFleetEngine/metadata/V1/TripApi.php create mode 100644 MapsFleetEngine/metadata/V1/Trips.php create mode 100644 MapsFleetEngine/metadata/V1/VehicleApi.php create mode 100644 MapsFleetEngine/metadata/V1/Vehicles.php create mode 100644 MapsFleetEngine/owlbot.py create mode 100644 MapsFleetEngine/phpunit.xml.dist create mode 100644 MapsFleetEngine/samples/V1/TripServiceClient/create_trip.php create mode 100644 MapsFleetEngine/samples/V1/TripServiceClient/get_trip.php create mode 100644 MapsFleetEngine/samples/V1/TripServiceClient/report_billable_trip.php create mode 100644 MapsFleetEngine/samples/V1/TripServiceClient/search_trips.php create mode 100644 MapsFleetEngine/samples/V1/TripServiceClient/update_trip.php create mode 100644 MapsFleetEngine/samples/V1/VehicleServiceClient/create_vehicle.php create mode 100644 MapsFleetEngine/samples/V1/VehicleServiceClient/get_vehicle.php create mode 100644 MapsFleetEngine/samples/V1/VehicleServiceClient/list_vehicles.php create mode 100644 MapsFleetEngine/samples/V1/VehicleServiceClient/search_vehicles.php create mode 100644 MapsFleetEngine/samples/V1/VehicleServiceClient/update_vehicle.php create mode 100644 MapsFleetEngine/samples/V1/VehicleServiceClient/update_vehicle_attributes.php create mode 100644 MapsFleetEngine/src/V1/BatteryInfo.php create mode 100644 MapsFleetEngine/src/V1/BatteryStatus.php create mode 100644 MapsFleetEngine/src/V1/BillingPlatformIdentifier.php create mode 100644 MapsFleetEngine/src/V1/Client/TripServiceClient.php create mode 100644 MapsFleetEngine/src/V1/Client/VehicleServiceClient.php create mode 100644 MapsFleetEngine/src/V1/ConsumableTrafficPolyline.php create mode 100644 MapsFleetEngine/src/V1/CreateTripRequest.php create mode 100644 MapsFleetEngine/src/V1/CreateVehicleRequest.php create mode 100644 MapsFleetEngine/src/V1/DeviceSettings.php create mode 100644 MapsFleetEngine/src/V1/GetTripRequest.php create mode 100644 MapsFleetEngine/src/V1/GetVehicleRequest.php create mode 100644 MapsFleetEngine/src/V1/LicensePlate.php create mode 100644 MapsFleetEngine/src/V1/ListVehiclesRequest.php create mode 100644 MapsFleetEngine/src/V1/ListVehiclesResponse.php create mode 100644 MapsFleetEngine/src/V1/LocationPowerSaveMode.php create mode 100644 MapsFleetEngine/src/V1/LocationSensor.php create mode 100644 MapsFleetEngine/src/V1/NavigationStatus.php create mode 100644 MapsFleetEngine/src/V1/PolylineFormatType.php create mode 100644 MapsFleetEngine/src/V1/PowerSource.php create mode 100644 MapsFleetEngine/src/V1/ReportBillableTripRequest.php create mode 100644 MapsFleetEngine/src/V1/ReportBillableTripRequest/SolutionType.php create mode 100644 MapsFleetEngine/src/V1/RequestHeader.php create mode 100644 MapsFleetEngine/src/V1/RequestHeader/Platform.php create mode 100644 MapsFleetEngine/src/V1/RequestHeader/SdkType.php create mode 100644 MapsFleetEngine/src/V1/SearchTripsRequest.php create mode 100644 MapsFleetEngine/src/V1/SearchTripsResponse.php create mode 100644 MapsFleetEngine/src/V1/SearchVehiclesRequest.php create mode 100644 MapsFleetEngine/src/V1/SearchVehiclesRequest/CurrentTripsPresent.php create mode 100644 MapsFleetEngine/src/V1/SearchVehiclesRequest/VehicleMatchOrder.php create mode 100644 MapsFleetEngine/src/V1/SearchVehiclesResponse.php create mode 100644 MapsFleetEngine/src/V1/SpeedReadingInterval.php create mode 100644 MapsFleetEngine/src/V1/SpeedReadingInterval/Speed.php create mode 100644 MapsFleetEngine/src/V1/StopLocation.php create mode 100644 MapsFleetEngine/src/V1/TerminalLocation.php create mode 100644 MapsFleetEngine/src/V1/TerminalPointId.php create mode 100644 MapsFleetEngine/src/V1/TrafficPolylineData.php create mode 100644 MapsFleetEngine/src/V1/Trip.php create mode 100644 MapsFleetEngine/src/V1/TripStatus.php create mode 100644 MapsFleetEngine/src/V1/TripType.php create mode 100644 MapsFleetEngine/src/V1/TripView.php create mode 100644 MapsFleetEngine/src/V1/TripWaypoint.php create mode 100644 MapsFleetEngine/src/V1/UpdateTripRequest.php create mode 100644 MapsFleetEngine/src/V1/UpdateVehicleAttributesRequest.php create mode 100644 MapsFleetEngine/src/V1/UpdateVehicleAttributesResponse.php create mode 100644 MapsFleetEngine/src/V1/UpdateVehicleRequest.php create mode 100644 MapsFleetEngine/src/V1/Vehicle.php create mode 100644 MapsFleetEngine/src/V1/Vehicle/VehicleType.php create mode 100644 MapsFleetEngine/src/V1/Vehicle/VehicleType/Category.php create mode 100644 MapsFleetEngine/src/V1/VehicleAttribute.php create mode 100644 MapsFleetEngine/src/V1/VehicleAttributeList.php create mode 100644 MapsFleetEngine/src/V1/VehicleLocation.php create mode 100644 MapsFleetEngine/src/V1/VehicleMatch.php create mode 100644 MapsFleetEngine/src/V1/VehicleMatch/VehicleMatchType.php create mode 100644 MapsFleetEngine/src/V1/VehicleState.php create mode 100644 MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering.php create mode 100644 MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering/RoadStretch.php create mode 100644 MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering/RoadStretch/Style.php create mode 100644 MapsFleetEngine/src/V1/Waypoint.php create mode 100644 MapsFleetEngine/src/V1/WaypointType.php create mode 100644 MapsFleetEngine/src/V1/gapic_metadata.json create mode 100644 MapsFleetEngine/src/V1/resources/trip_service_client_config.json create mode 100644 MapsFleetEngine/src/V1/resources/trip_service_descriptor_config.php create mode 100644 MapsFleetEngine/src/V1/resources/trip_service_rest_client_config.php create mode 100644 MapsFleetEngine/src/V1/resources/vehicle_service_client_config.json create mode 100644 MapsFleetEngine/src/V1/resources/vehicle_service_descriptor_config.php create mode 100644 MapsFleetEngine/src/V1/resources/vehicle_service_rest_client_config.php create mode 100644 MapsFleetEngine/tests/Unit/V1/Client/TripServiceClientTest.php create mode 100644 MapsFleetEngine/tests/Unit/V1/Client/VehicleServiceClientTest.php create mode 100644 MapsFleetEngineDelivery/.OwlBot.yaml create mode 100644 MapsFleetEngineDelivery/.gitattributes create mode 100644 MapsFleetEngineDelivery/.github/pull_request_template.md create mode 100644 MapsFleetEngineDelivery/CONTRIBUTING.md create mode 100644 MapsFleetEngineDelivery/LICENSE create mode 100644 MapsFleetEngineDelivery/README.md create mode 100644 MapsFleetEngineDelivery/VERSION create mode 100644 MapsFleetEngineDelivery/composer.json create mode 100644 MapsFleetEngineDelivery/metadata/V1/Common.php create mode 100644 MapsFleetEngineDelivery/metadata/V1/DeliveryApi.php create mode 100644 MapsFleetEngineDelivery/metadata/V1/DeliveryVehicles.php create mode 100644 MapsFleetEngineDelivery/metadata/V1/Header.php create mode 100644 MapsFleetEngineDelivery/metadata/V1/TaskTrackingInfo.php create mode 100644 MapsFleetEngineDelivery/metadata/V1/Tasks.php create mode 100644 MapsFleetEngineDelivery/owlbot.py create mode 100644 MapsFleetEngineDelivery/phpunit.xml.dist create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/batch_create_tasks.php create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/create_delivery_vehicle.php create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/create_task.php create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_delivery_vehicle.php create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_task.php create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_task_tracking_info.php create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/list_delivery_vehicles.php create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/list_tasks.php create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/update_delivery_vehicle.php create mode 100644 MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/update_task.php create mode 100644 MapsFleetEngineDelivery/src/V1/BatchCreateTasksRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/BatchCreateTasksResponse.php create mode 100644 MapsFleetEngineDelivery/src/V1/Client/DeliveryServiceClient.php create mode 100644 MapsFleetEngineDelivery/src/V1/CreateDeliveryVehicleRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/CreateTaskRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader.php create mode 100644 MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader/Platform.php create mode 100644 MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader/SdkType.php create mode 100644 MapsFleetEngineDelivery/src/V1/DeliveryVehicle.php create mode 100644 MapsFleetEngineDelivery/src/V1/DeliveryVehicle/DeliveryVehicleType.php create mode 100644 MapsFleetEngineDelivery/src/V1/DeliveryVehicleAttribute.php create mode 100644 MapsFleetEngineDelivery/src/V1/DeliveryVehicleLocation.php create mode 100644 MapsFleetEngineDelivery/src/V1/DeliveryVehicleLocationSensor.php create mode 100644 MapsFleetEngineDelivery/src/V1/DeliveryVehicleNavigationStatus.php create mode 100644 MapsFleetEngineDelivery/src/V1/GetDeliveryVehicleRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/GetTaskRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/GetTaskTrackingInfoRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/ListDeliveryVehiclesRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/ListDeliveryVehiclesResponse.php create mode 100644 MapsFleetEngineDelivery/src/V1/ListTasksRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/ListTasksResponse.php create mode 100644 MapsFleetEngineDelivery/src/V1/LocationInfo.php create mode 100644 MapsFleetEngineDelivery/src/V1/Task.php create mode 100644 MapsFleetEngineDelivery/src/V1/Task/JourneySharingInfo.php create mode 100644 MapsFleetEngineDelivery/src/V1/Task/State.php create mode 100644 MapsFleetEngineDelivery/src/V1/Task/TaskOutcome.php create mode 100644 MapsFleetEngineDelivery/src/V1/Task/TaskOutcomeLocationSource.php create mode 100644 MapsFleetEngineDelivery/src/V1/Task/Type.php create mode 100644 MapsFleetEngineDelivery/src/V1/TaskAttribute.php create mode 100644 MapsFleetEngineDelivery/src/V1/TaskTrackingInfo.php create mode 100644 MapsFleetEngineDelivery/src/V1/TaskTrackingViewConfig.php create mode 100644 MapsFleetEngineDelivery/src/V1/TaskTrackingViewConfig/VisibilityOption.php create mode 100644 MapsFleetEngineDelivery/src/V1/TimeWindow.php create mode 100644 MapsFleetEngineDelivery/src/V1/UpdateDeliveryVehicleRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/UpdateTaskRequest.php create mode 100644 MapsFleetEngineDelivery/src/V1/VehicleJourneySegment.php create mode 100644 MapsFleetEngineDelivery/src/V1/VehicleStop.php create mode 100644 MapsFleetEngineDelivery/src/V1/VehicleStop/State.php create mode 100644 MapsFleetEngineDelivery/src/V1/VehicleStop/TaskInfo.php create mode 100644 MapsFleetEngineDelivery/src/V1/gapic_metadata.json create mode 100644 MapsFleetEngineDelivery/src/V1/resources/delivery_service_client_config.json create mode 100644 MapsFleetEngineDelivery/src/V1/resources/delivery_service_descriptor_config.php create mode 100644 MapsFleetEngineDelivery/src/V1/resources/delivery_service_rest_client_config.php create mode 100644 MapsFleetEngineDelivery/tests/Unit/V1/Client/DeliveryServiceClientTest.php create mode 100644 MapsRouteOptimization/.OwlBot.yaml create mode 100644 MapsRouteOptimization/.gitattributes create mode 100644 MapsRouteOptimization/.github/pull_request_template.md create mode 100644 MapsRouteOptimization/CONTRIBUTING.md create mode 100644 MapsRouteOptimization/LICENSE create mode 100644 MapsRouteOptimization/README.md create mode 100644 MapsRouteOptimization/VERSION create mode 100644 MapsRouteOptimization/composer.json create mode 100644 MapsRouteOptimization/metadata/V1/RouteOptimizationService.php create mode 100644 MapsRouteOptimization/owlbot.py create mode 100644 MapsRouteOptimization/phpunit.xml.dist create mode 100644 MapsRouteOptimization/samples/V1/RouteOptimizationClient/batch_optimize_tours.php create mode 100644 MapsRouteOptimization/samples/V1/RouteOptimizationClient/optimize_tours.php create mode 100644 MapsRouteOptimization/src/V1/AggregatedMetrics.php create mode 100644 MapsRouteOptimization/src/V1/BatchOptimizeToursMetadata.php create mode 100644 MapsRouteOptimization/src/V1/BatchOptimizeToursRequest.php create mode 100644 MapsRouteOptimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php create mode 100644 MapsRouteOptimization/src/V1/BatchOptimizeToursResponse.php create mode 100644 MapsRouteOptimization/src/V1/BreakRule.php create mode 100644 MapsRouteOptimization/src/V1/BreakRule/BreakRequest.php create mode 100644 MapsRouteOptimization/src/V1/BreakRule/FrequencyConstraint.php create mode 100644 MapsRouteOptimization/src/V1/Client/RouteOptimizationClient.php create mode 100644 MapsRouteOptimization/src/V1/DataFormat.php create mode 100644 MapsRouteOptimization/src/V1/DistanceLimit.php create mode 100644 MapsRouteOptimization/src/V1/GcsDestination.php create mode 100644 MapsRouteOptimization/src/V1/GcsSource.php create mode 100644 MapsRouteOptimization/src/V1/InjectedSolutionConstraint.php create mode 100644 MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation.php create mode 100644 MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php create mode 100644 MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation/Level.php create mode 100644 MapsRouteOptimization/src/V1/InputConfig.php create mode 100644 MapsRouteOptimization/src/V1/Location.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursRequest.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursRequest/SearchMode.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursRequest/SolvingMode.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursResponse.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursResponse/Metrics.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursValidationError.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursValidationError/FieldReference.php create mode 100644 MapsRouteOptimization/src/V1/OutputConfig.php create mode 100644 MapsRouteOptimization/src/V1/Shipment.php create mode 100644 MapsRouteOptimization/src/V1/Shipment/Load.php create mode 100644 MapsRouteOptimization/src/V1/Shipment/VisitRequest.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentModel.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix/Row.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentModel/PrecedenceRule.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/EncodedPolyline.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/PBBreak.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/Transition.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/VehicleLoad.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/Visit.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility/IncompatibilityMode.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentTypeRequirement.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentTypeRequirement/RequirementMode.php create mode 100644 MapsRouteOptimization/src/V1/SkippedShipment.php create mode 100644 MapsRouteOptimization/src/V1/SkippedShipment/Reason.php create mode 100644 MapsRouteOptimization/src/V1/SkippedShipment/Reason/Code.php create mode 100644 MapsRouteOptimization/src/V1/TimeWindow.php create mode 100644 MapsRouteOptimization/src/V1/TransitionAttributes.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/DurationLimit.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/LoadLimit.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/LoadLimit/Interval.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/TravelMode.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/UnloadingPolicy.php create mode 100644 MapsRouteOptimization/src/V1/Waypoint.php create mode 100644 MapsRouteOptimization/src/V1/gapic_metadata.json create mode 100644 MapsRouteOptimization/src/V1/resources/route_optimization_client_config.json create mode 100644 MapsRouteOptimization/src/V1/resources/route_optimization_descriptor_config.php create mode 100644 MapsRouteOptimization/src/V1/resources/route_optimization_rest_client_config.php create mode 100644 MapsRouteOptimization/tests/Unit/V1/Client/RouteOptimizationClientTest.php delete mode 100644 MediaTranslation/.repo-metadata.json delete mode 100644 Memcache/.repo-metadata.json delete mode 100644 MigrationCenter/.repo-metadata.json delete mode 100644 Monitoring/.repo-metadata.json delete mode 100644 NetApp/.repo-metadata.json create mode 100644 NetApp/src/V1/LocationMetadata.php create mode 100644 NetApp/src/V1/TieringPolicy.php create mode 100644 NetApp/src/V1/TieringPolicy/TierAction.php delete mode 100644 NetworkConnectivity/.repo-metadata.json delete mode 100644 NetworkManagement/.repo-metadata.json delete mode 100644 NetworkSecurity/.repo-metadata.json create mode 100644 NetworkServices/.OwlBot.yaml create mode 100644 NetworkServices/.gitattributes create mode 100644 NetworkServices/.github/pull_request_template.md create mode 100644 NetworkServices/CONTRIBUTING.md create mode 100644 NetworkServices/LICENSE create mode 100644 NetworkServices/README.md create mode 100644 NetworkServices/VERSION create mode 100644 NetworkServices/composer.json create mode 100644 NetworkServices/metadata/V1/Common.php create mode 100644 NetworkServices/metadata/V1/Dep.php create mode 100644 NetworkServices/metadata/V1/EndpointPolicy.php create mode 100644 NetworkServices/metadata/V1/Gateway.php create mode 100644 NetworkServices/metadata/V1/GrpcRoute.php create mode 100644 NetworkServices/metadata/V1/HttpRoute.php create mode 100644 NetworkServices/metadata/V1/Mesh.php create mode 100644 NetworkServices/metadata/V1/NetworkServices.php create mode 100644 NetworkServices/metadata/V1/ServiceBinding.php create mode 100644 NetworkServices/metadata/V1/TcpRoute.php create mode 100644 NetworkServices/metadata/V1/TlsRoute.php create mode 100644 NetworkServices/owlbot.py create mode 100644 NetworkServices/phpunit.xml.dist create mode 100644 NetworkServices/samples/V1/DepServiceClient/create_lb_route_extension.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/create_lb_traffic_extension.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/delete_lb_route_extension.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/delete_lb_traffic_extension.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/get_iam_policy.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/get_lb_route_extension.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/get_lb_traffic_extension.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/get_location.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/list_lb_route_extensions.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/list_lb_traffic_extensions.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/list_locations.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/set_iam_policy.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/test_iam_permissions.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/update_lb_route_extension.php create mode 100644 NetworkServices/samples/V1/DepServiceClient/update_lb_traffic_extension.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/create_endpoint_policy.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/create_gateway.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/create_grpc_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/create_http_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/create_mesh.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/create_service_binding.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/create_tcp_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/create_tls_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/delete_endpoint_policy.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/delete_gateway.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/delete_grpc_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/delete_http_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/delete_mesh.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/delete_service_binding.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/delete_tcp_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/delete_tls_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_endpoint_policy.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_gateway.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_grpc_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_http_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_iam_policy.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_location.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_mesh.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_service_binding.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_tcp_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/get_tls_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/list_endpoint_policies.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/list_gateways.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/list_grpc_routes.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/list_http_routes.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/list_locations.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/list_meshes.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/list_service_bindings.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/list_tcp_routes.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/list_tls_routes.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/set_iam_policy.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/test_iam_permissions.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/update_endpoint_policy.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/update_gateway.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/update_grpc_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/update_http_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/update_mesh.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/update_tcp_route.php create mode 100644 NetworkServices/samples/V1/NetworkServicesClient/update_tls_route.php create mode 100644 NetworkServices/src/V1/CreateEndpointPolicyRequest.php create mode 100644 NetworkServices/src/V1/CreateGatewayRequest.php create mode 100644 NetworkServices/src/V1/CreateGrpcRouteRequest.php create mode 100644 NetworkServices/src/V1/CreateHttpRouteRequest.php create mode 100644 NetworkServices/src/V1/CreateLbRouteExtensionRequest.php create mode 100644 NetworkServices/src/V1/CreateLbTrafficExtensionRequest.php create mode 100644 NetworkServices/src/V1/CreateMeshRequest.php create mode 100644 NetworkServices/src/V1/CreateServiceBindingRequest.php create mode 100644 NetworkServices/src/V1/CreateTcpRouteRequest.php create mode 100644 NetworkServices/src/V1/CreateTlsRouteRequest.php create mode 100644 NetworkServices/src/V1/DeleteEndpointPolicyRequest.php create mode 100644 NetworkServices/src/V1/DeleteGatewayRequest.php create mode 100644 NetworkServices/src/V1/DeleteGrpcRouteRequest.php create mode 100644 NetworkServices/src/V1/DeleteHttpRouteRequest.php create mode 100644 NetworkServices/src/V1/DeleteLbRouteExtensionRequest.php create mode 100644 NetworkServices/src/V1/DeleteLbTrafficExtensionRequest.php create mode 100644 NetworkServices/src/V1/DeleteMeshRequest.php create mode 100644 NetworkServices/src/V1/DeleteServiceBindingRequest.php create mode 100644 NetworkServices/src/V1/DeleteTcpRouteRequest.php create mode 100644 NetworkServices/src/V1/DeleteTlsRouteRequest.php create mode 100644 NetworkServices/src/V1/DepServiceClient.php create mode 100644 NetworkServices/src/V1/EndpointMatcher.php create mode 100644 NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher.php create mode 100644 NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher/MetadataLabelMatchCriteria.php create mode 100644 NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher/MetadataLabels.php create mode 100644 NetworkServices/src/V1/EndpointPolicy.php create mode 100644 NetworkServices/src/V1/EndpointPolicy/EndpointPolicyType.php create mode 100644 NetworkServices/src/V1/EventType.php create mode 100644 NetworkServices/src/V1/ExtensionChain.php create mode 100644 NetworkServices/src/V1/ExtensionChain/Extension.php create mode 100644 NetworkServices/src/V1/ExtensionChain/MatchCondition.php create mode 100644 NetworkServices/src/V1/Gapic/DepServiceGapicClient.php create mode 100644 NetworkServices/src/V1/Gapic/NetworkServicesGapicClient.php create mode 100644 NetworkServices/src/V1/Gateway.php create mode 100644 NetworkServices/src/V1/Gateway/Type.php create mode 100644 NetworkServices/src/V1/GetEndpointPolicyRequest.php create mode 100644 NetworkServices/src/V1/GetGatewayRequest.php create mode 100644 NetworkServices/src/V1/GetGrpcRouteRequest.php create mode 100644 NetworkServices/src/V1/GetHttpRouteRequest.php create mode 100644 NetworkServices/src/V1/GetLbRouteExtensionRequest.php create mode 100644 NetworkServices/src/V1/GetLbTrafficExtensionRequest.php create mode 100644 NetworkServices/src/V1/GetMeshRequest.php create mode 100644 NetworkServices/src/V1/GetServiceBindingRequest.php create mode 100644 NetworkServices/src/V1/GetTcpRouteRequest.php create mode 100644 NetworkServices/src/V1/GetTlsRouteRequest.php create mode 100644 NetworkServices/src/V1/GrpcRoute.php create mode 100644 NetworkServices/src/V1/GrpcRoute/Destination.php create mode 100644 NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy.php create mode 100644 NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy/Abort.php create mode 100644 NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy/Delay.php create mode 100644 NetworkServices/src/V1/GrpcRoute/HeaderMatch.php create mode 100644 NetworkServices/src/V1/GrpcRoute/HeaderMatch/Type.php create mode 100644 NetworkServices/src/V1/GrpcRoute/MethodMatch.php create mode 100644 NetworkServices/src/V1/GrpcRoute/MethodMatch/Type.php create mode 100644 NetworkServices/src/V1/GrpcRoute/RetryPolicy.php create mode 100644 NetworkServices/src/V1/GrpcRoute/RouteAction.php create mode 100644 NetworkServices/src/V1/GrpcRoute/RouteMatch.php create mode 100644 NetworkServices/src/V1/GrpcRoute/RouteRule.php create mode 100644 NetworkServices/src/V1/HttpRoute.php create mode 100644 NetworkServices/src/V1/HttpRoute/CorsPolicy.php create mode 100644 NetworkServices/src/V1/HttpRoute/Destination.php create mode 100644 NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy.php create mode 100644 NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy/Abort.php create mode 100644 NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy/Delay.php create mode 100644 NetworkServices/src/V1/HttpRoute/HeaderMatch.php create mode 100644 NetworkServices/src/V1/HttpRoute/HeaderMatch/IntegerRange.php create mode 100644 NetworkServices/src/V1/HttpRoute/HeaderModifier.php create mode 100644 NetworkServices/src/V1/HttpRoute/QueryParameterMatch.php create mode 100644 NetworkServices/src/V1/HttpRoute/Redirect.php create mode 100644 NetworkServices/src/V1/HttpRoute/Redirect/ResponseCode.php create mode 100644 NetworkServices/src/V1/HttpRoute/RequestMirrorPolicy.php create mode 100644 NetworkServices/src/V1/HttpRoute/RetryPolicy.php create mode 100644 NetworkServices/src/V1/HttpRoute/RouteAction.php create mode 100644 NetworkServices/src/V1/HttpRoute/RouteMatch.php create mode 100644 NetworkServices/src/V1/HttpRoute/RouteRule.php create mode 100644 NetworkServices/src/V1/HttpRoute/URLRewrite.php create mode 100644 NetworkServices/src/V1/LbRouteExtension.php create mode 100644 NetworkServices/src/V1/LbTrafficExtension.php create mode 100644 NetworkServices/src/V1/ListEndpointPoliciesRequest.php create mode 100644 NetworkServices/src/V1/ListEndpointPoliciesResponse.php create mode 100644 NetworkServices/src/V1/ListGatewaysRequest.php create mode 100644 NetworkServices/src/V1/ListGatewaysResponse.php create mode 100644 NetworkServices/src/V1/ListGrpcRoutesRequest.php create mode 100644 NetworkServices/src/V1/ListGrpcRoutesResponse.php create mode 100644 NetworkServices/src/V1/ListHttpRoutesRequest.php create mode 100644 NetworkServices/src/V1/ListHttpRoutesResponse.php create mode 100644 NetworkServices/src/V1/ListLbRouteExtensionsRequest.php create mode 100644 NetworkServices/src/V1/ListLbRouteExtensionsResponse.php create mode 100644 NetworkServices/src/V1/ListLbTrafficExtensionsRequest.php create mode 100644 NetworkServices/src/V1/ListLbTrafficExtensionsResponse.php create mode 100644 NetworkServices/src/V1/ListMeshesRequest.php create mode 100644 NetworkServices/src/V1/ListMeshesResponse.php create mode 100644 NetworkServices/src/V1/ListServiceBindingsRequest.php create mode 100644 NetworkServices/src/V1/ListServiceBindingsResponse.php create mode 100644 NetworkServices/src/V1/ListTcpRoutesRequest.php create mode 100644 NetworkServices/src/V1/ListTcpRoutesResponse.php create mode 100644 NetworkServices/src/V1/ListTlsRoutesRequest.php create mode 100644 NetworkServices/src/V1/ListTlsRoutesResponse.php create mode 100644 NetworkServices/src/V1/LoadBalancingScheme.php create mode 100644 NetworkServices/src/V1/Mesh.php create mode 100644 NetworkServices/src/V1/NetworkServicesClient.php create mode 100644 NetworkServices/src/V1/OperationMetadata.php create mode 100644 NetworkServices/src/V1/ServiceBinding.php create mode 100644 NetworkServices/src/V1/TcpRoute.php create mode 100644 NetworkServices/src/V1/TcpRoute/RouteAction.php create mode 100644 NetworkServices/src/V1/TcpRoute/RouteDestination.php create mode 100644 NetworkServices/src/V1/TcpRoute/RouteMatch.php create mode 100644 NetworkServices/src/V1/TcpRoute/RouteRule.php create mode 100644 NetworkServices/src/V1/TlsRoute.php create mode 100644 NetworkServices/src/V1/TlsRoute/RouteAction.php create mode 100644 NetworkServices/src/V1/TlsRoute/RouteDestination.php create mode 100644 NetworkServices/src/V1/TlsRoute/RouteMatch.php create mode 100644 NetworkServices/src/V1/TlsRoute/RouteRule.php create mode 100644 NetworkServices/src/V1/TrafficPortSelector.php create mode 100644 NetworkServices/src/V1/UpdateEndpointPolicyRequest.php create mode 100644 NetworkServices/src/V1/UpdateGatewayRequest.php create mode 100644 NetworkServices/src/V1/UpdateGrpcRouteRequest.php create mode 100644 NetworkServices/src/V1/UpdateHttpRouteRequest.php create mode 100644 NetworkServices/src/V1/UpdateLbRouteExtensionRequest.php create mode 100644 NetworkServices/src/V1/UpdateLbTrafficExtensionRequest.php create mode 100644 NetworkServices/src/V1/UpdateMeshRequest.php create mode 100644 NetworkServices/src/V1/UpdateTcpRouteRequest.php create mode 100644 NetworkServices/src/V1/UpdateTlsRouteRequest.php create mode 100644 NetworkServices/src/V1/gapic_metadata.json create mode 100644 NetworkServices/src/V1/resources/dep_service_client_config.json create mode 100644 NetworkServices/src/V1/resources/dep_service_descriptor_config.php create mode 100644 NetworkServices/src/V1/resources/dep_service_rest_client_config.php create mode 100644 NetworkServices/src/V1/resources/network_services_client_config.json create mode 100644 NetworkServices/src/V1/resources/network_services_descriptor_config.php create mode 100644 NetworkServices/src/V1/resources/network_services_rest_client_config.php create mode 100644 NetworkServices/tests/Unit/V1/DepServiceClientTest.php create mode 100644 NetworkServices/tests/Unit/V1/NetworkServicesClientTest.php delete mode 100644 Notebooks/.repo-metadata.json delete mode 100644 Notebooks/metadata/V1Beta1/Environment.php delete mode 100644 Notebooks/metadata/V1Beta1/Instance.php delete mode 100644 Notebooks/metadata/V1Beta1/Service.php delete mode 100644 Notebooks/src/V1/ManagedNotebookServiceGrpcClient.php delete mode 100644 Notebooks/src/V1/NotebookServiceGrpcClient.php delete mode 100644 Notebooks/src/V1beta1/ContainerImage.php delete mode 100644 Notebooks/src/V1beta1/CreateEnvironmentRequest.php delete mode 100644 Notebooks/src/V1beta1/CreateInstanceRequest.php delete mode 100644 Notebooks/src/V1beta1/DeleteEnvironmentRequest.php delete mode 100644 Notebooks/src/V1beta1/DeleteInstanceRequest.php delete mode 100644 Notebooks/src/V1beta1/Environment.php delete mode 100644 Notebooks/src/V1beta1/Gapic/NotebookServiceGapicClient.php delete mode 100644 Notebooks/src/V1beta1/GetEnvironmentRequest.php delete mode 100644 Notebooks/src/V1beta1/GetInstanceRequest.php delete mode 100644 Notebooks/src/V1beta1/Instance.php delete mode 100644 Notebooks/src/V1beta1/Instance/AcceleratorConfig.php delete mode 100644 Notebooks/src/V1beta1/Instance/AcceleratorType.php delete mode 100644 Notebooks/src/V1beta1/Instance/DiskEncryption.php delete mode 100644 Notebooks/src/V1beta1/Instance/DiskType.php delete mode 100644 Notebooks/src/V1beta1/Instance/NicType.php delete mode 100644 Notebooks/src/V1beta1/Instance/State.php delete mode 100644 Notebooks/src/V1beta1/Instance_AcceleratorConfig.php delete mode 100644 Notebooks/src/V1beta1/Instance_AcceleratorType.php delete mode 100644 Notebooks/src/V1beta1/Instance_DiskEncryption.php delete mode 100644 Notebooks/src/V1beta1/Instance_DiskType.php delete mode 100644 Notebooks/src/V1beta1/Instance_NicType.php delete mode 100644 Notebooks/src/V1beta1/Instance_State.php delete mode 100644 Notebooks/src/V1beta1/IsInstanceUpgradeableRequest.php delete mode 100644 Notebooks/src/V1beta1/IsInstanceUpgradeableResponse.php delete mode 100644 Notebooks/src/V1beta1/ListEnvironmentsRequest.php delete mode 100644 Notebooks/src/V1beta1/ListEnvironmentsResponse.php delete mode 100644 Notebooks/src/V1beta1/ListInstancesRequest.php delete mode 100644 Notebooks/src/V1beta1/ListInstancesResponse.php delete mode 100644 Notebooks/src/V1beta1/NotebookServiceClient.php delete mode 100644 Notebooks/src/V1beta1/NotebookServiceGrpcClient.php delete mode 100644 Notebooks/src/V1beta1/OperationMetadata.php delete mode 100644 Notebooks/src/V1beta1/RegisterInstanceRequest.php delete mode 100644 Notebooks/src/V1beta1/ReportInstanceInfoRequest.php delete mode 100644 Notebooks/src/V1beta1/ReservationAffinity.php delete mode 100644 Notebooks/src/V1beta1/ReservationAffinity/Type.php delete mode 100644 Notebooks/src/V1beta1/ReservationAffinity_Type.php delete mode 100644 Notebooks/src/V1beta1/ResetInstanceRequest.php delete mode 100644 Notebooks/src/V1beta1/SetInstanceAcceleratorRequest.php delete mode 100644 Notebooks/src/V1beta1/SetInstanceLabelsRequest.php delete mode 100644 Notebooks/src/V1beta1/SetInstanceMachineTypeRequest.php delete mode 100644 Notebooks/src/V1beta1/StartInstanceRequest.php delete mode 100644 Notebooks/src/V1beta1/StopInstanceRequest.php delete mode 100644 Notebooks/src/V1beta1/UpgradeInstanceInternalRequest.php delete mode 100644 Notebooks/src/V1beta1/UpgradeInstanceRequest.php delete mode 100644 Notebooks/src/V1beta1/VmImage.php delete mode 100644 Notebooks/src/V1beta1/gapic_metadata.json delete mode 100644 Notebooks/src/V1beta1/resources/notebook_service_client_config.json delete mode 100644 Notebooks/src/V1beta1/resources/notebook_service_descriptor_config.php delete mode 100644 Notebooks/src/V1beta1/resources/notebook_service_rest_client_config.php delete mode 100644 Notebooks/tests/Unit/V1beta1/NotebookServiceClientTest.php delete mode 100644 Optimization/.repo-metadata.json delete mode 100644 Optimization/src/V1/FleetRoutingClient.php delete mode 100644 Optimization/src/V1/FleetRoutingGrpcClient.php delete mode 100644 Optimization/src/V1/Gapic/FleetRoutingGapicClient.php delete mode 100644 Optimization/tests/Unit/V1/FleetRoutingClientTest.php delete mode 100644 OrchestrationAirflow/.repo-metadata.json delete mode 100644 OrgPolicy/.repo-metadata.json delete mode 100644 OrgPolicy/src/V2/Constraint_BooleanConstraint.php delete mode 100644 OrgPolicy/src/V2/Constraint_ConstraintDefault.php delete mode 100644 OrgPolicy/src/V2/Constraint_ListConstraint.php delete mode 100644 OrgPolicy/src/V2/Gapic/OrgPolicyGapicClient.php delete mode 100644 OrgPolicy/src/V2/OrgPolicyClient.php delete mode 100644 OrgPolicy/src/V2/OrgPolicyGrpcClient.php delete mode 100644 OrgPolicy/src/V2/PolicySpec_PolicyRule.php delete mode 100644 OrgPolicy/src/V2/PolicySpec_PolicyRule_StringValues.php delete mode 100644 OrgPolicy/tests/Unit/V2/OrgPolicyClientTest.php delete mode 100644 OsConfig/.repo-metadata.json delete mode 100644 OsLogin/.repo-metadata.json delete mode 100644 Parallelstore/.repo-metadata.json create mode 100644 Parallelstore/src/V1beta/DestinationGcsBucket.php create mode 100644 Parallelstore/src/V1beta/DestinationParallelstore.php create mode 100644 Parallelstore/src/V1beta/SourceGcsBucket.php create mode 100644 Parallelstore/src/V1beta/SourceParallelstore.php delete mode 100644 PolicySimulator/.repo-metadata.json delete mode 100644 PolicyTroubleshooter/.repo-metadata.json delete mode 100644 PolicyTroubleshooterIam/.repo-metadata.json delete mode 100644 PrivateCatalog/.repo-metadata.json delete mode 100644 Profiler/.repo-metadata.json delete mode 100644 PubSub/.repo-metadata.json delete mode 100644 Quotas/.repo-metadata.json delete mode 100644 RapidMigrationAssessment/.repo-metadata.json delete mode 100644 RecaptchaEnterprise/.repo-metadata.json delete mode 100644 RecommendationEngine/.repo-metadata.json delete mode 100644 Recommender/.repo-metadata.json delete mode 100644 Redis/.repo-metadata.json delete mode 100644 RedisCluster/.repo-metadata.json create mode 100644 RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php create mode 100644 RedisCluster/src/V1/CertificateAuthority.php create mode 100644 RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority.php create mode 100644 RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php create mode 100644 RedisCluster/src/V1/ClusterPersistenceConfig.php create mode 100644 RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig.php create mode 100644 RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php create mode 100644 RedisCluster/src/V1/ClusterPersistenceConfig/PersistenceMode.php create mode 100644 RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig.php create mode 100644 RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php create mode 100644 RedisCluster/src/V1/GetClusterCertificateAuthorityRequest.php create mode 100644 RedisCluster/src/V1/NodeType.php create mode 100644 RedisCluster/src/V1/ZoneDistributionConfig.php create mode 100644 RedisCluster/src/V1/ZoneDistributionConfig/ZoneDistributionMode.php delete mode 100644 ResourceManager/.repo-metadata.json delete mode 100644 ResourceSettings/.repo-metadata.json delete mode 100644 Retail/.repo-metadata.json create mode 100644 Retail/samples/V2/ProductServiceClient/purge_products.php create mode 100644 Retail/src/V2/CatalogAttribute/FacetConfig.php create mode 100644 Retail/src/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php create mode 100644 Retail/src/V2/CatalogAttribute/FacetConfig/MergedFacet.php create mode 100644 Retail/src/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php create mode 100644 Retail/src/V2/CatalogAttribute/FacetConfig/RerankConfig.php create mode 100644 Retail/src/V2/Model/ContextProductsType.php create mode 100644 Retail/src/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php create mode 100644 Retail/src/V2/Model/ModelFeaturesConfig.php create mode 100644 Retail/src/V2/PurgeProductsMetadata.php create mode 100644 Retail/src/V2/PurgeProductsRequest.php create mode 100644 Retail/src/V2/PurgeProductsResponse.php create mode 100644 Retail/src/V2/Rule/ForceReturnFacetAction.php create mode 100644 Retail/src/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php create mode 100644 Retail/src/V2/Rule/RemoveFacetAction.php delete mode 100644 Run/.repo-metadata.json delete mode 100644 Scheduler/.repo-metadata.json delete mode 100644 SecretManager/.repo-metadata.json delete mode 100644 SecureSourceManager/.repo-metadata.json delete mode 100644 SecurityCenter/.repo-metadata.json delete mode 100644 SecurityCenterManagement/.repo-metadata.json create mode 100644 SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/get_security_center_service.php create mode 100644 SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_security_center_services.php create mode 100644 SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/update_security_center_service.php create mode 100644 SecurityCenterManagement/src/V1/GetSecurityCenterServiceRequest.php create mode 100644 SecurityCenterManagement/src/V1/ListSecurityCenterServicesRequest.php create mode 100644 SecurityCenterManagement/src/V1/ListSecurityCenterServicesResponse.php create mode 100644 SecurityCenterManagement/src/V1/SecurityCenterService.php create mode 100644 SecurityCenterManagement/src/V1/SecurityCenterService/EnablementState.php create mode 100644 SecurityCenterManagement/src/V1/SecurityCenterService/ModuleSettings.php create mode 100644 SecurityCenterManagement/src/V1/UpdateSecurityCenterServiceRequest.php delete mode 100644 SecurityPrivateCa/.repo-metadata.json delete mode 100644 SecurityPublicCA/.repo-metadata.json create mode 100644 SecurityPublicCA/metadata/V1/Resources.php create mode 100644 SecurityPublicCA/metadata/V1/Service.php create mode 100644 SecurityPublicCA/samples/V1/PublicCertificateAuthorityServiceClient/create_external_account_key.php create mode 100644 SecurityPublicCA/src/V1/Client/PublicCertificateAuthorityServiceClient.php create mode 100644 SecurityPublicCA/src/V1/CreateExternalAccountKeyRequest.php create mode 100644 SecurityPublicCA/src/V1/ExternalAccountKey.php create mode 100644 SecurityPublicCA/src/V1/gapic_metadata.json create mode 100644 SecurityPublicCA/src/V1/resources/public_certificate_authority_service_client_config.json create mode 100644 SecurityPublicCA/src/V1/resources/public_certificate_authority_service_descriptor_config.php create mode 100644 SecurityPublicCA/src/V1/resources/public_certificate_authority_service_rest_client_config.php create mode 100644 SecurityPublicCA/tests/Unit/V1/Client/PublicCertificateAuthorityServiceClientTest.php delete mode 100644 ServiceControl/.repo-metadata.json delete mode 100644 ServiceDirectory/.repo-metadata.json delete mode 100644 ServiceHealth/.repo-metadata.json delete mode 100644 ServiceManagement/.repo-metadata.json delete mode 100644 ServiceUsage/.repo-metadata.json delete mode 100644 Shell/.repo-metadata.json delete mode 100644 ShoppingCommonProtos/.repo-metadata.json delete mode 100644 ShoppingCss/.repo-metadata.json create mode 100644 ShoppingMerchantAccounts/.OwlBot.yaml create mode 100644 ShoppingMerchantAccounts/.gitattributes create mode 100644 ShoppingMerchantAccounts/.github/pull_request_template.md create mode 100644 ShoppingMerchantAccounts/CONTRIBUTING.md create mode 100644 ShoppingMerchantAccounts/LICENSE create mode 100644 ShoppingMerchantAccounts/README.md create mode 100644 ShoppingMerchantAccounts/VERSION create mode 100644 ShoppingMerchantAccounts/composer.json create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Accessright.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/AccountTax.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Accountissue.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Accounts.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Businessidentity.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Businessinfo.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Customerservice.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Emailpreferences.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Homepage.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/OnlineReturnPolicy.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Phoneverificationstate.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Programs.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Regions.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Shippingsettings.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/TaxRule.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Termsofservice.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Termsofserviceagreementstate.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/Termsofservicekind.php create mode 100644 ShoppingMerchantAccounts/metadata/V1Beta/User.php create mode 100644 ShoppingMerchantAccounts/owlbot.py create mode 100644 ShoppingMerchantAccounts/phpunit.xml.dist create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountIssueServiceClient/list_account_issues.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/get_account_tax.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/list_account_tax.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/update_account_tax.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/create_and_configure_account.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/delete_account.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/get_account.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/list_accounts.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/list_sub_accounts.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/update_account.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/BusinessIdentityServiceClient/get_business_identity.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/BusinessIdentityServiceClient/update_business_identity.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/BusinessInfoServiceClient/get_business_info.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/BusinessInfoServiceClient/update_business_info.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/EmailPreferencesServiceClient/get_email_preferences.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/EmailPreferencesServiceClient/update_email_preferences.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/claim_homepage.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/get_homepage.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/unclaim_homepage.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/update_homepage.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/OnlineReturnPolicyServiceClient/get_online_return_policy.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/OnlineReturnPolicyServiceClient/list_online_return_policies.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/disable_program.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/enable_program.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/get_program.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/list_programs.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/create_region.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/delete_region.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/get_region.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/list_regions.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/update_region.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/ShippingSettingsServiceClient/get_shipping_settings.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/ShippingSettingsServiceClient/insert_shipping_settings.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceAgreementStateServiceClient/get_terms_of_service_agreement_state.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceAgreementStateServiceClient/retrieve_for_application_terms_of_service_agreement_state.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/accept_terms_of_service.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/get_terms_of_service.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/retrieve_latest_terms_of_service.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/create_user.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/delete_user.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/get_user.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/list_users.php create mode 100644 ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/update_user.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/AcceptTermsOfServiceRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Accepted.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/AccessRight.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Account.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/AccountIssue.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/AccountIssue/ImpactedDestination.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/AccountIssue/ImpactedDestination/Impact.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/AccountIssue/Severity.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/AccountTax.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Address.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/BusinessDayConfig.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/BusinessDayConfig/Weekday.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/BusinessIdentity.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/IdentityAttribute.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/IdentityAttribute/IdentityDeclaration.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/PromotionsConsent.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/BusinessInfo.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/CarrierRate.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ClaimHomepageRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/AccountIssueServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/AccountTaxServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/AccountsServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/BusinessIdentityServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/BusinessInfoServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/EmailPreferencesServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/HomepageServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/OnlineReturnPolicyServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/ProgramsServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/RegionsServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/ShippingSettingsServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/TermsOfServiceAgreementStateServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/TermsOfServiceServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Client/UserServiceClient.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest/AcceptTermsOfService.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest/AddAccountService.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/CreateRegionRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/CreateUserRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/CustomerService.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/CutoffTime.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/DeleteAccountRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/DeleteRegionRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/DeleteUserRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/DeliveryTime.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/DisableProgramRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Distance.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Distance/Unit.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/EmailPreferences.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/EmailPreferences/OptInState.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/EnableProgramRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetAccountRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetAccountTaxRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetBusinessIdentityRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetBusinessInfoRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetEmailPreferencesRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetHomepageRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetOnlineReturnPolicyRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetProgramRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetRegionRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetShippingSettingsRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetTermsOfServiceAgreementStateRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetTermsOfServiceRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/GetUserRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Headers.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Homepage.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/InsertShippingSettingsRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListAccountIssuesRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListAccountIssuesResponse.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListAccountTaxRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListAccountTaxResponse.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListAccountsRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListAccountsResponse.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListOnlineReturnPoliciesRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListOnlineReturnPoliciesResponse.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListProgramsRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListProgramsResponse.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListRegionsRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListRegionsResponse.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListSubAccountsRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListSubAccountsResponse.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListUsersRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ListUsersResponse.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/LocationIdSet.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/MinimumOrderValueTable.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/MinimumOrderValueTable/StoreCodeSetWithMov.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ItemCondition.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/Policy.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/Policy/Type.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/RestockingFee.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnMethod.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnShippingFee.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnShippingFee/Type.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/PhoneVerificationState.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Program.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Program/Requirement.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Program/State.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/RateGroup.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Region.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Region/GeoTargetArea.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Region/PostalCodeArea.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Region/PostalCodeArea/PostalCodeRange.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Required.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/RetrieveForApplicationTermsOfServiceAgreementStateRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/RetrieveLatestTermsOfServiceRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Row.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Service.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Service/LoyaltyProgram.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Service/LoyaltyProgram/LoyaltyProgramTiers.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Service/ShipmentType.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/CutoffConfig.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/CutoffConfig/LocalCutoffTime.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/StoreServiceType.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/ShippingSettings.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Table.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/TaxRule.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/TaxRule/TaxPostalCodeRange.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/TermsOfService.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/TermsOfServiceAgreementState.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/TermsOfServiceKind.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/TransitTable.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/TransitTable/TransitTimeRow.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/TransitTable/TransitTimeRow/TransitTimeValue.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/UnclaimHomepageRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/UpdateAccountRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/UpdateAccountTaxRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/UpdateBusinessIdentityRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/UpdateBusinessInfoRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/UpdateEmailPreferencesRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/UpdateHomepageRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/UpdateRegionRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/UpdateUserRequest.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/User.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/User/State.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Value.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/Warehouse.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/WarehouseBasedDeliveryTime.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/WarehouseCutoffTime.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/gapic_metadata.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/programs_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/programs_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/programs_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/regions_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/regions_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/regions_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/user_service_client_config.json create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/user_service_descriptor_config.php create mode 100644 ShoppingMerchantAccounts/src/V1beta/resources/user_service_rest_client_config.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountIssueServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountTaxServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountsServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/BusinessIdentityServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/BusinessInfoServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/EmailPreferencesServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/HomepageServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/OnlineReturnPolicyServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/ProgramsServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/RegionsServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/ShippingSettingsServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/TermsOfServiceAgreementStateServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/TermsOfServiceServiceClientTest.php create mode 100644 ShoppingMerchantAccounts/tests/Unit/V1beta/Client/UserServiceClientTest.php delete mode 100644 ShoppingMerchantConversions/.repo-metadata.json create mode 100644 ShoppingMerchantDatasources/.OwlBot.yaml create mode 100644 ShoppingMerchantDatasources/.gitattributes create mode 100644 ShoppingMerchantDatasources/.github/pull_request_template.md create mode 100644 ShoppingMerchantDatasources/CONTRIBUTING.md create mode 100644 ShoppingMerchantDatasources/LICENSE create mode 100644 ShoppingMerchantDatasources/README.md create mode 100644 ShoppingMerchantDatasources/VERSION create mode 100644 ShoppingMerchantDatasources/composer.json create mode 100644 ShoppingMerchantDatasources/metadata/V1Beta/Datasources.php create mode 100644 ShoppingMerchantDatasources/metadata/V1Beta/Datasourcetypes.php create mode 100644 ShoppingMerchantDatasources/metadata/V1Beta/Fileinputs.php create mode 100644 ShoppingMerchantDatasources/owlbot.py create mode 100644 ShoppingMerchantDatasources/phpunit.xml.dist create mode 100644 ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/create_data_source.php create mode 100644 ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/delete_data_source.php create mode 100644 ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/fetch_data_source.php create mode 100644 ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/get_data_source.php create mode 100644 ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/list_data_sources.php create mode 100644 ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/update_data_source.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/Client/DataSourcesServiceClient.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/CreateDataSourceRequest.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/DataSource.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/DataSource/Input.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/DeleteDataSourceRequest.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/FetchDataSourceRequest.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/FileInput.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/FileInput/FetchSettings.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/FileInput/FetchSettings/Frequency.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/FileInput/FileInputType.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/GetDataSourceRequest.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/ListDataSourcesRequest.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/ListDataSourcesResponse.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/LocalInventoryDataSource.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/PrimaryProductDataSource.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/PrimaryProductDataSource/Channel.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/PromotionDataSource.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/RegionalInventoryDataSource.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/SupplementalProductDataSource.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/UpdateDataSourceRequest.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/gapic_metadata.json create mode 100644 ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_client_config.json create mode 100644 ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_descriptor_config.php create mode 100644 ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_rest_client_config.php create mode 100644 ShoppingMerchantDatasources/tests/Unit/V1beta/Client/DataSourcesServiceClientTest.php delete mode 100644 ShoppingMerchantInventories/.repo-metadata.json delete mode 100644 ShoppingMerchantInventories/src/V1beta/Gapic/LocalInventoryServiceGapicClient.php delete mode 100644 ShoppingMerchantInventories/src/V1beta/Gapic/RegionalInventoryServiceGapicClient.php delete mode 100644 ShoppingMerchantInventories/src/V1beta/LocalInventoryServiceClient.php delete mode 100644 ShoppingMerchantInventories/src/V1beta/RegionalInventoryServiceClient.php delete mode 100644 ShoppingMerchantInventories/tests/Unit/V1beta/LocalInventoryServiceClientTest.php delete mode 100644 ShoppingMerchantInventories/tests/Unit/V1beta/RegionalInventoryServiceClientTest.php create mode 100644 ShoppingMerchantLfp/.OwlBot.yaml create mode 100644 ShoppingMerchantLfp/.gitattributes create mode 100644 ShoppingMerchantLfp/.github/pull_request_template.md create mode 100644 ShoppingMerchantLfp/CONTRIBUTING.md create mode 100644 ShoppingMerchantLfp/LICENSE create mode 100644 ShoppingMerchantLfp/README.md create mode 100644 ShoppingMerchantLfp/VERSION create mode 100644 ShoppingMerchantLfp/composer.json create mode 100644 ShoppingMerchantLfp/metadata/V1Beta/Lfpinventory.php create mode 100644 ShoppingMerchantLfp/metadata/V1Beta/Lfpsale.php create mode 100644 ShoppingMerchantLfp/metadata/V1Beta/Lfpstore.php create mode 100644 ShoppingMerchantLfp/owlbot.py create mode 100644 ShoppingMerchantLfp/phpunit.xml.dist create mode 100644 ShoppingMerchantLfp/samples/V1beta/LfpInventoryServiceClient/insert_lfp_inventory.php create mode 100644 ShoppingMerchantLfp/samples/V1beta/LfpSaleServiceClient/insert_lfp_sale.php create mode 100644 ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/delete_lfp_store.php create mode 100644 ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/get_lfp_store.php create mode 100644 ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/insert_lfp_store.php create mode 100644 ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/list_lfp_stores.php create mode 100644 ShoppingMerchantLfp/src/V1beta/Client/LfpInventoryServiceClient.php create mode 100644 ShoppingMerchantLfp/src/V1beta/Client/LfpSaleServiceClient.php create mode 100644 ShoppingMerchantLfp/src/V1beta/Client/LfpStoreServiceClient.php create mode 100644 ShoppingMerchantLfp/src/V1beta/DeleteLfpStoreRequest.php create mode 100644 ShoppingMerchantLfp/src/V1beta/GetLfpStoreRequest.php create mode 100644 ShoppingMerchantLfp/src/V1beta/InsertLfpInventoryRequest.php create mode 100644 ShoppingMerchantLfp/src/V1beta/InsertLfpSaleRequest.php create mode 100644 ShoppingMerchantLfp/src/V1beta/InsertLfpStoreRequest.php create mode 100644 ShoppingMerchantLfp/src/V1beta/LfpInventory.php create mode 100644 ShoppingMerchantLfp/src/V1beta/LfpSale.php create mode 100644 ShoppingMerchantLfp/src/V1beta/LfpStore.php create mode 100644 ShoppingMerchantLfp/src/V1beta/LfpStore/StoreMatchingState.php create mode 100644 ShoppingMerchantLfp/src/V1beta/ListLfpStoresRequest.php create mode 100644 ShoppingMerchantLfp/src/V1beta/ListLfpStoresResponse.php create mode 100644 ShoppingMerchantLfp/src/V1beta/gapic_metadata.json create mode 100644 ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_client_config.json create mode 100644 ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_descriptor_config.php create mode 100644 ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_rest_client_config.php create mode 100644 ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_client_config.json create mode 100644 ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_descriptor_config.php create mode 100644 ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_rest_client_config.php create mode 100644 ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_client_config.json create mode 100644 ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_descriptor_config.php create mode 100644 ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_rest_client_config.php create mode 100644 ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpInventoryServiceClientTest.php create mode 100644 ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpSaleServiceClientTest.php create mode 100644 ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpStoreServiceClientTest.php create mode 100644 ShoppingMerchantNotifications/.OwlBot.yaml create mode 100644 ShoppingMerchantNotifications/.gitattributes create mode 100644 ShoppingMerchantNotifications/.github/pull_request_template.md create mode 100644 ShoppingMerchantNotifications/CONTRIBUTING.md create mode 100644 ShoppingMerchantNotifications/LICENSE create mode 100644 ShoppingMerchantNotifications/README.md create mode 100644 ShoppingMerchantNotifications/VERSION create mode 100644 ShoppingMerchantNotifications/composer.json create mode 100644 ShoppingMerchantNotifications/metadata/V1Beta/Notificationsapi.php create mode 100644 ShoppingMerchantNotifications/owlbot.py create mode 100644 ShoppingMerchantNotifications/phpunit.xml.dist create mode 100644 ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/create_notification_subscription.php create mode 100644 ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/delete_notification_subscription.php create mode 100644 ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/get_notification_subscription.php create mode 100644 ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/list_notification_subscriptions.php create mode 100644 ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/update_notification_subscription.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/Attribute.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/Client/NotificationsApiServiceClient.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/CreateNotificationSubscriptionRequest.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/DeleteNotificationSubscriptionRequest.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/GetNotificationSubscriptionRequest.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/ListNotificationSubscriptionsRequest.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/ListNotificationSubscriptionsResponse.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/NotificationSubscription.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/NotificationSubscription/NotificationEventType.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/ProductChange.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/ProductStatusChangeMessage.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/Resource.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/UpdateNotificationSubscriptionRequest.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/gapic_metadata.json create mode 100644 ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_client_config.json create mode 100644 ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_descriptor_config.php create mode 100644 ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_rest_client_config.php create mode 100644 ShoppingMerchantNotifications/tests/Unit/V1beta/Client/NotificationsApiServiceClientTest.php create mode 100644 ShoppingMerchantProducts/.OwlBot.yaml create mode 100644 ShoppingMerchantProducts/.gitattributes create mode 100644 ShoppingMerchantProducts/.github/pull_request_template.md create mode 100644 ShoppingMerchantProducts/CONTRIBUTING.md create mode 100644 ShoppingMerchantProducts/LICENSE create mode 100644 ShoppingMerchantProducts/README.md create mode 100644 ShoppingMerchantProducts/VERSION create mode 100644 ShoppingMerchantProducts/composer.json create mode 100644 ShoppingMerchantProducts/metadata/V1Beta/Productinputs.php create mode 100644 ShoppingMerchantProducts/metadata/V1Beta/Products.php create mode 100644 ShoppingMerchantProducts/metadata/V1Beta/ProductsCommon.php create mode 100644 ShoppingMerchantProducts/owlbot.py create mode 100644 ShoppingMerchantProducts/phpunit.xml.dist create mode 100644 ShoppingMerchantProducts/samples/V1beta/ProductInputsServiceClient/delete_product_input.php create mode 100644 ShoppingMerchantProducts/samples/V1beta/ProductInputsServiceClient/insert_product_input.php create mode 100644 ShoppingMerchantProducts/samples/V1beta/ProductsServiceClient/get_product.php create mode 100644 ShoppingMerchantProducts/samples/V1beta/ProductsServiceClient/list_products.php create mode 100644 ShoppingMerchantProducts/src/V1beta/Attributes.php create mode 100644 ShoppingMerchantProducts/src/V1beta/Certification.php create mode 100644 ShoppingMerchantProducts/src/V1beta/Client/ProductInputsServiceClient.php create mode 100644 ShoppingMerchantProducts/src/V1beta/Client/ProductsServiceClient.php create mode 100644 ShoppingMerchantProducts/src/V1beta/CloudExportAdditionalProperties.php create mode 100644 ShoppingMerchantProducts/src/V1beta/DeleteProductInputRequest.php create mode 100644 ShoppingMerchantProducts/src/V1beta/FreeShippingThreshold.php create mode 100644 ShoppingMerchantProducts/src/V1beta/GetProductRequest.php create mode 100644 ShoppingMerchantProducts/src/V1beta/InsertProductInputRequest.php create mode 100644 ShoppingMerchantProducts/src/V1beta/Installment.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ListProductsRequest.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ListProductsResponse.php create mode 100644 ShoppingMerchantProducts/src/V1beta/LoyaltyPoints.php create mode 100644 ShoppingMerchantProducts/src/V1beta/LoyaltyProgram.php create mode 100644 ShoppingMerchantProducts/src/V1beta/Product.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductDetail.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductDimension.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductInput.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductStatus.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductStatus/DestinationStatus.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductStatus/ItemLevelIssue.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductStatus/ItemLevelIssue/Severity.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductStructuredDescription.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductStructuredTitle.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ProductWeight.php create mode 100644 ShoppingMerchantProducts/src/V1beta/Shipping.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ShippingDimension.php create mode 100644 ShoppingMerchantProducts/src/V1beta/ShippingWeight.php create mode 100644 ShoppingMerchantProducts/src/V1beta/SubscriptionCost.php create mode 100644 ShoppingMerchantProducts/src/V1beta/SubscriptionPeriod.php create mode 100644 ShoppingMerchantProducts/src/V1beta/Tax.php create mode 100644 ShoppingMerchantProducts/src/V1beta/UnitPricingBaseMeasure.php create mode 100644 ShoppingMerchantProducts/src/V1beta/UnitPricingMeasure.php create mode 100644 ShoppingMerchantProducts/src/V1beta/gapic_metadata.json create mode 100644 ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_client_config.json create mode 100644 ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_descriptor_config.php create mode 100644 ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_rest_client_config.php create mode 100644 ShoppingMerchantProducts/src/V1beta/resources/products_service_client_config.json create mode 100644 ShoppingMerchantProducts/src/V1beta/resources/products_service_descriptor_config.php create mode 100644 ShoppingMerchantProducts/src/V1beta/resources/products_service_rest_client_config.php create mode 100644 ShoppingMerchantProducts/tests/Unit/V1beta/Client/ProductInputsServiceClientTest.php create mode 100644 ShoppingMerchantProducts/tests/Unit/V1beta/Client/ProductsServiceClientTest.php create mode 100644 ShoppingMerchantPromotions/.OwlBot.yaml create mode 100644 ShoppingMerchantPromotions/.gitattributes create mode 100644 ShoppingMerchantPromotions/.github/pull_request_template.md create mode 100644 ShoppingMerchantPromotions/CONTRIBUTING.md create mode 100644 ShoppingMerchantPromotions/LICENSE create mode 100644 ShoppingMerchantPromotions/README.md create mode 100644 ShoppingMerchantPromotions/VERSION create mode 100644 ShoppingMerchantPromotions/composer.json create mode 100644 ShoppingMerchantPromotions/metadata/V1Beta/Promotions.php create mode 100644 ShoppingMerchantPromotions/metadata/V1Beta/PromotionsCommon.php create mode 100644 ShoppingMerchantPromotions/owlbot.py create mode 100644 ShoppingMerchantPromotions/phpunit.xml.dist create mode 100644 ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/get_promotion.php create mode 100644 ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/insert_promotion.php create mode 100644 ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/list_promotions.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/Attributes.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/Client/PromotionsServiceClient.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/CouponValueType.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/GetPromotionRequest.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/InsertPromotionRequest.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/ListPromotionsRequest.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/ListPromotionsResponse.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/OfferType.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/ProductApplicability.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/Promotion.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/PromotionStatus.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/PromotionStatus/DestinationStatus.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/PromotionStatus/DestinationStatus/State.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/PromotionStatus/ItemLevelIssue.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/PromotionStatus/ItemLevelIssue/Severity.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/RedemptionChannel.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/StoreApplicability.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/gapic_metadata.json create mode 100644 ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_client_config.json create mode 100644 ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_descriptor_config.php create mode 100644 ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_rest_client_config.php create mode 100644 ShoppingMerchantPromotions/tests/Unit/V1beta/Client/PromotionsServiceClientTest.php delete mode 100644 ShoppingMerchantQuota/.repo-metadata.json delete mode 100644 ShoppingMerchantReports/.repo-metadata.json create mode 100644 ShoppingMerchantReports/src/V1beta/PriceInsightsProductView/Effectiveness.php delete mode 100644 Spanner/.repo-metadata.json create mode 100644 Spanner/src/MutationGroup.php create mode 100644 Spanner/src/MutationTrait.php create mode 100644 Spanner/src/PgOid.php create mode 100644 Spanner/src/V1/ReadRequest/LockHint.php create mode 100644 Spanner/src/V1/ReadRequest/OrderBy.php create mode 100644 Spanner/tests/Snippet/PgOidTest.php delete mode 100644 Speech/.repo-metadata.json delete mode 100644 SqlAdmin/.repo-metadata.json create mode 100644 SqlAdmin/samples/V1/SqlInstancesServiceClient/acquire_ssrs_lease.php create mode 100644 SqlAdmin/samples/V1/SqlInstancesServiceClient/release_ssrs_lease.php create mode 100644 SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/acquire_ssrs_lease.php create mode 100644 SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/release_ssrs_lease.php create mode 100644 SqlAdmin/src/V1/AcquireSsrsLeaseContext.php create mode 100644 SqlAdmin/src/V1/BackupConfiguration/TransactionalLogStorageState.php create mode 100644 SqlAdmin/src/V1/GeminiInstanceConfig.php create mode 100644 SqlAdmin/src/V1/ImportContext/SqlImportOptions.php create mode 100644 SqlAdmin/src/V1/InstancesAcquireSsrsLeaseRequest.php create mode 100644 SqlAdmin/src/V1/ReplicationCluster.php create mode 100644 SqlAdmin/src/V1/SqlInstancesAcquireSsrsLeaseRequest.php create mode 100644 SqlAdmin/src/V1/SqlInstancesAcquireSsrsLeaseResponse.php create mode 100644 SqlAdmin/src/V1/SqlInstancesReleaseSsrsLeaseRequest.php create mode 100644 SqlAdmin/src/V1/SqlInstancesReleaseSsrsLeaseResponse.php create mode 100644 SqlAdmin/src/V1/SqlInstancesVerifyExternalSyncSettingsRequest/MigrationType.php create mode 100644 SqlAdmin/src/V1beta4/AcquireSsrsLeaseContext.php create mode 100644 SqlAdmin/src/V1beta4/BackupConfiguration/TransactionalLogStorageState.php create mode 100644 SqlAdmin/src/V1beta4/GeminiInstanceConfig.php create mode 100644 SqlAdmin/src/V1beta4/ImportContext/SqlImportOptions.php create mode 100644 SqlAdmin/src/V1beta4/InstancesAcquireSsrsLeaseRequest.php create mode 100644 SqlAdmin/src/V1beta4/ReplicationCluster.php create mode 100644 SqlAdmin/src/V1beta4/SqlInstancesAcquireSsrsLeaseRequest.php create mode 100644 SqlAdmin/src/V1beta4/SqlInstancesAcquireSsrsLeaseResponse.php create mode 100644 SqlAdmin/src/V1beta4/SqlInstancesReleaseSsrsLeaseRequest.php create mode 100644 SqlAdmin/src/V1beta4/SqlInstancesReleaseSsrsLeaseResponse.php create mode 100644 SqlAdmin/src/V1beta4/SqlInstancesVerifyExternalSyncSettingsRequest/MigrationType.php delete mode 100644 Storage/.repo-metadata.json delete mode 100644 StorageControl/.repo-metadata.json delete mode 100644 StorageInsights/.repo-metadata.json delete mode 100644 StorageTransfer/.repo-metadata.json delete mode 100644 Support/.repo-metadata.json delete mode 100644 Talent/.repo-metadata.json delete mode 100644 Tasks/.repo-metadata.json delete mode 100644 TelcoAutomation/.repo-metadata.json delete mode 100644 TextToSpeech/.repo-metadata.json delete mode 100644 Tpu/.repo-metadata.json delete mode 100644 Trace/.repo-metadata.json delete mode 100644 Translate/.repo-metadata.json delete mode 100644 VideoIntelligence/.repo-metadata.json delete mode 100644 VideoLiveStream/.repo-metadata.json delete mode 100644 VideoStitcher/.repo-metadata.json create mode 100644 VideoStitcher/metadata/V1/FetchOptions.php create mode 100644 VideoStitcher/metadata/V1/VodConfigs.php create mode 100644 VideoStitcher/samples/V1/VideoStitcherServiceClient/create_vod_config.php create mode 100644 VideoStitcher/samples/V1/VideoStitcherServiceClient/delete_vod_config.php create mode 100644 VideoStitcher/samples/V1/VideoStitcherServiceClient/get_vod_config.php create mode 100644 VideoStitcher/samples/V1/VideoStitcherServiceClient/list_vod_configs.php create mode 100644 VideoStitcher/samples/V1/VideoStitcherServiceClient/update_live_config.php create mode 100644 VideoStitcher/samples/V1/VideoStitcherServiceClient/update_vod_config.php create mode 100644 VideoStitcher/src/V1/CreateVodConfigRequest.php create mode 100644 VideoStitcher/src/V1/DeleteVodConfigRequest.php create mode 100644 VideoStitcher/src/V1/FetchOptions.php create mode 100644 VideoStitcher/src/V1/GetVodConfigRequest.php create mode 100644 VideoStitcher/src/V1/ListVodConfigsRequest.php create mode 100644 VideoStitcher/src/V1/ListVodConfigsResponse.php create mode 100644 VideoStitcher/src/V1/MediaCdnKey/TokenConfig.php create mode 100644 VideoStitcher/src/V1/UpdateLiveConfigRequest.php create mode 100644 VideoStitcher/src/V1/UpdateVodConfigRequest.php create mode 100644 VideoStitcher/src/V1/VodConfig.php create mode 100644 VideoStitcher/src/V1/VodConfig/State.php delete mode 100644 VideoTranscoder/.repo-metadata.json delete mode 100644 VideoTranscoder/metadata/V1Beta1/Resources.php delete mode 100644 VideoTranscoder/metadata/V1Beta1/Services.php delete mode 100644 VideoTranscoder/src/V1/Gapic/TranscoderServiceGapicClient.php delete mode 100644 VideoTranscoder/src/V1/TranscoderServiceClient.php delete mode 100644 VideoTranscoder/src/V1/TranscoderServiceGrpcClient.php delete mode 100644 VideoTranscoder/src/V1beta1/AdBreak.php delete mode 100644 VideoTranscoder/src/V1beta1/AudioStream.php delete mode 100644 VideoTranscoder/src/V1beta1/AudioStream/AudioAtom.php delete mode 100644 VideoTranscoder/src/V1beta1/AudioStream/AudioAtom/AudioChannel.php delete mode 100644 VideoTranscoder/src/V1beta1/AudioStream/AudioAtom/AudioChannel/AudioChannelInput.php delete mode 100644 VideoTranscoder/src/V1beta1/CreateJobRequest.php delete mode 100644 VideoTranscoder/src/V1beta1/CreateJobTemplateRequest.php delete mode 100644 VideoTranscoder/src/V1beta1/DeleteJobRequest.php delete mode 100644 VideoTranscoder/src/V1beta1/DeleteJobTemplateRequest.php delete mode 100644 VideoTranscoder/src/V1beta1/EditAtom.php delete mode 100644 VideoTranscoder/src/V1beta1/ElementaryStream.php delete mode 100644 VideoTranscoder/src/V1beta1/Encryption.php delete mode 100644 VideoTranscoder/src/V1beta1/Encryption/Aes128Encryption.php delete mode 100644 VideoTranscoder/src/V1beta1/Encryption/MpegCommonEncryption.php delete mode 100644 VideoTranscoder/src/V1beta1/Encryption/SampleAesEncryption.php delete mode 100644 VideoTranscoder/src/V1beta1/FailureDetail.php delete mode 100644 VideoTranscoder/src/V1beta1/Gapic/TranscoderServiceGapicClient.php delete mode 100644 VideoTranscoder/src/V1beta1/GetJobRequest.php delete mode 100644 VideoTranscoder/src/V1beta1/GetJobTemplateRequest.php delete mode 100644 VideoTranscoder/src/V1beta1/Input.php delete mode 100644 VideoTranscoder/src/V1beta1/Job.php delete mode 100644 VideoTranscoder/src/V1beta1/Job/OriginUri.php delete mode 100644 VideoTranscoder/src/V1beta1/Job/ProcessingState.php delete mode 100644 VideoTranscoder/src/V1beta1/JobConfig.php delete mode 100644 VideoTranscoder/src/V1beta1/JobTemplate.php delete mode 100644 VideoTranscoder/src/V1beta1/ListJobTemplatesRequest.php delete mode 100644 VideoTranscoder/src/V1beta1/ListJobTemplatesResponse.php delete mode 100644 VideoTranscoder/src/V1beta1/ListJobsRequest.php delete mode 100644 VideoTranscoder/src/V1beta1/ListJobsResponse.php delete mode 100644 VideoTranscoder/src/V1beta1/Manifest.php delete mode 100644 VideoTranscoder/src/V1beta1/Manifest/ManifestType.php delete mode 100644 VideoTranscoder/src/V1beta1/MuxStream.php delete mode 100644 VideoTranscoder/src/V1beta1/Output.php delete mode 100644 VideoTranscoder/src/V1beta1/Overlay.php delete mode 100644 VideoTranscoder/src/V1beta1/Overlay/Animation.php delete mode 100644 VideoTranscoder/src/V1beta1/Overlay/AnimationEnd.php delete mode 100644 VideoTranscoder/src/V1beta1/Overlay/AnimationFade.php delete mode 100644 VideoTranscoder/src/V1beta1/Overlay/AnimationStatic.php delete mode 100644 VideoTranscoder/src/V1beta1/Overlay/FadeType.php delete mode 100644 VideoTranscoder/src/V1beta1/Overlay/Image.php delete mode 100644 VideoTranscoder/src/V1beta1/Overlay/NormalizedCoordinate.php delete mode 100644 VideoTranscoder/src/V1beta1/PreprocessingConfig.php delete mode 100644 VideoTranscoder/src/V1beta1/PreprocessingConfig/Audio.php delete mode 100644 VideoTranscoder/src/V1beta1/PreprocessingConfig/Color.php delete mode 100644 VideoTranscoder/src/V1beta1/PreprocessingConfig/Crop.php delete mode 100644 VideoTranscoder/src/V1beta1/PreprocessingConfig/Deblock.php delete mode 100644 VideoTranscoder/src/V1beta1/PreprocessingConfig/Denoise.php delete mode 100644 VideoTranscoder/src/V1beta1/PreprocessingConfig/Pad.php delete mode 100644 VideoTranscoder/src/V1beta1/Progress.php delete mode 100644 VideoTranscoder/src/V1beta1/PubsubDestination.php delete mode 100644 VideoTranscoder/src/V1beta1/SegmentSettings.php delete mode 100644 VideoTranscoder/src/V1beta1/SpriteSheet.php delete mode 100644 VideoTranscoder/src/V1beta1/TextStream.php delete mode 100644 VideoTranscoder/src/V1beta1/TextStream/TextAtom.php delete mode 100644 VideoTranscoder/src/V1beta1/TextStream/TextAtom/TextInput.php delete mode 100644 VideoTranscoder/src/V1beta1/TranscoderServiceClient.php delete mode 100644 VideoTranscoder/src/V1beta1/TranscoderServiceGrpcClient.php delete mode 100644 VideoTranscoder/src/V1beta1/VideoStream.php delete mode 100644 VideoTranscoder/src/V1beta1/gapic_metadata.json delete mode 100644 VideoTranscoder/src/V1beta1/resources/transcoder_service_client_config.json delete mode 100644 VideoTranscoder/src/V1beta1/resources/transcoder_service_descriptor_config.php delete mode 100644 VideoTranscoder/src/V1beta1/resources/transcoder_service_rest_client_config.php delete mode 100644 VideoTranscoder/tests/Unit/V1/TranscoderServiceClientTest.php delete mode 100644 VideoTranscoder/tests/Unit/V1beta1/TranscoderServiceClientTest.php delete mode 100644 Vision/.repo-metadata.json delete mode 100644 VmMigration/.repo-metadata.json delete mode 100644 VmMigration/src/V1/Gapic/VmMigrationGapicClient.php delete mode 100644 VmMigration/src/V1/VmMigrationClient.php delete mode 100644 VmMigration/src/V1/VmMigrationGrpcClient.php delete mode 100644 VmMigration/tests/Unit/V1/VmMigrationClientTest.php delete mode 100644 VmwareEngine/.repo-metadata.json delete mode 100644 VpcAccess/.repo-metadata.json delete mode 100644 WebRisk/.repo-metadata.json delete mode 100644 WebSecurityScanner/.repo-metadata.json delete mode 100644 WebSecurityScanner/metadata/V1Beta/CrawledUrl.php delete mode 100644 WebSecurityScanner/metadata/V1Beta/Finding.php delete mode 100644 WebSecurityScanner/metadata/V1Beta/FindingAddon.php delete mode 100644 WebSecurityScanner/metadata/V1Beta/FindingTypeStats.php delete mode 100644 WebSecurityScanner/metadata/V1Beta/ScanConfig.php delete mode 100644 WebSecurityScanner/metadata/V1Beta/ScanConfigError.php delete mode 100644 WebSecurityScanner/metadata/V1Beta/ScanRun.php delete mode 100644 WebSecurityScanner/metadata/V1Beta/ScanRunErrorTrace.php delete mode 100644 WebSecurityScanner/metadata/V1Beta/ScanRunWarningTrace.php delete mode 100644 WebSecurityScanner/metadata/V1Beta/WebSecurityScanner.php delete mode 100644 WebSecurityScanner/src/V1/WebSecurityScannerGrpcClient.php delete mode 100644 WebSecurityScanner/src/V1beta/CrawledUrl.php delete mode 100644 WebSecurityScanner/src/V1beta/CreateScanConfigRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/DeleteScanConfigRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/Finding.php delete mode 100644 WebSecurityScanner/src/V1beta/FindingTypeStats.php delete mode 100644 WebSecurityScanner/src/V1beta/Form.php delete mode 100644 WebSecurityScanner/src/V1beta/Gapic/WebSecurityScannerGapicClient.php delete mode 100644 WebSecurityScanner/src/V1beta/GetFindingRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/GetScanConfigRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/GetScanRunRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/ListCrawledUrlsRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/ListCrawledUrlsResponse.php delete mode 100644 WebSecurityScanner/src/V1beta/ListFindingTypeStatsRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/ListFindingTypeStatsResponse.php delete mode 100644 WebSecurityScanner/src/V1beta/ListFindingsRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/ListFindingsResponse.php delete mode 100644 WebSecurityScanner/src/V1beta/ListScanConfigsRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/ListScanConfigsResponse.php delete mode 100644 WebSecurityScanner/src/V1beta/ListScanRunsRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/ListScanRunsResponse.php delete mode 100644 WebSecurityScanner/src/V1beta/OutdatedLibrary.php delete mode 100644 WebSecurityScanner/src/V1beta/README.md delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfig.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfig/Authentication.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfig/Authentication/CustomAccount.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfig/Authentication/GoogleAccount.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfig/ExportToSecurityCommandCenter.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfig/RiskLevel.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfig/Schedule.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfig/TargetPlatform.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfig/UserAgent.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfigError.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanConfigError/Code.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanRun.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanRun/ExecutionState.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanRun/ResultState.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanRunErrorTrace.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanRunErrorTrace/Code.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanRunWarningTrace.php delete mode 100644 WebSecurityScanner/src/V1beta/ScanRunWarningTrace/Code.php delete mode 100644 WebSecurityScanner/src/V1beta/StartScanRunRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/StopScanRunRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/UpdateScanConfigRequest.php delete mode 100644 WebSecurityScanner/src/V1beta/ViolatingResource.php delete mode 100644 WebSecurityScanner/src/V1beta/VulnerableHeaders.php delete mode 100644 WebSecurityScanner/src/V1beta/VulnerableHeaders/Header.php delete mode 100644 WebSecurityScanner/src/V1beta/VulnerableParameters.php delete mode 100644 WebSecurityScanner/src/V1beta/WebSecurityScannerClient.php delete mode 100644 WebSecurityScanner/src/V1beta/WebSecurityScannerGrpcClient.php delete mode 100644 WebSecurityScanner/src/V1beta/Xss.php delete mode 100644 WebSecurityScanner/src/V1beta/gapic_metadata.json delete mode 100644 WebSecurityScanner/src/V1beta/resources/web_security_scanner_client_config.json delete mode 100644 WebSecurityScanner/src/V1beta/resources/web_security_scanner_descriptor_config.php delete mode 100644 WebSecurityScanner/src/V1beta/resources/web_security_scanner_rest_client_config.php delete mode 100644 WebSecurityScanner/tests/Unit/V1beta/WebSecurityScannerClientTest.php delete mode 100644 Workflows/.repo-metadata.json create mode 100644 dev/src/DocFx/XrefValidationTrait.php delete mode 100644 dev/templates/.repo_metadata.json.twig delete mode 100644 dev/tests/fixtures/component/CustomInput/.repo-metadata.json delete mode 100644 dev/tests/fixtures/component/SecretManager/.repo-metadata.json delete mode 100644 dev/tests/fixtures/component/Vision/.repo-metadata.json diff --git a/.github/run-package-tests.sh b/.github/run-package-tests.sh index 8590cde22f96..fda6fdc8d77e 100644 --- a/.github/run-package-tests.sh +++ b/.github/run-package-tests.sh @@ -45,11 +45,11 @@ FAILED_FILE=$(mktemp -d)/failed for DIR in ${DIRS}; do { cp ${DIR}/composer.json ${DIR}/composer-local.json # Update composer to use local packages - for i in BigQuery,cloud-bigquery Core,cloud-core Logging,cloud-logging PubSub,cloud-pubsub Storage,cloud-storage ShoppingCommonProtos,shopping-common-protos; do + for i in BigQuery,cloud-bigquery Core,cloud-core Logging,cloud-logging PubSub,cloud-pubsub Storage,cloud-storage ShoppingCommonProtos,shopping-common-protos GeoCommonProtos,geo-common-protos,0.1; do IFS=","; set -- $i; if grep -q "\"google/$2\":" ${DIR}/composer.json; then # determine local package version - if [ "$STRICT" = "true" ]; then VERSION=$(cat $1/VERSION); else VERSION="1.100"; fi + if [ "$STRICT" = "true" ]; then VERSION=$(cat $1/VERSION); elif [ -z "$3" ]; then VERSION="1.100"; else VERSION=$3; fi echo "Use local package $1 as google/$2:$VERSION in $DIR" # "canonical: false" ensures composer will try to install from packagist when the "--prefer-lowest" flag is set. composer config repositories.$2 -d ${DIR} "{\"type\": \"path\", \"url\": \"../$1\", \"options\":{\"versions\":{\"google/$2\":\"$VERSION\"}},\"canonical\":false}" diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 1fae6ba569b4..4bff62481b25 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -26,7 +26,7 @@ jobs: id: extract uses: shrink/actions-docker-extract@v2 with: - image: "phpdoc/phpdoc:20230522201300af6fb5" + image: "phpdoc/phpdoc:3.4.1" path: "/opt/phpdoc/." - name: Symlink phpDocumentor run: ln -s $(pwd)/${{ steps.extract.outputs.destination }}/bin/phpdoc /usr/local/bin/phpdoc diff --git a/.github/workflows/spanner-emulator-system-tests.yaml b/.github/workflows/spanner-emulator-system-tests.yaml index 3d14706a5450..a3aef7f875b1 100644 --- a/.github/workflows/spanner-emulator-system-tests.yaml +++ b/.github/workflows/spanner-emulator-system-tests.yaml @@ -18,7 +18,7 @@ jobs: services: emulator: - image: gcr.io/cloud-spanner-emulator/emulator:1.5.17 + image: gcr.io/cloud-spanner-emulator/emulator:1.5.19 ports: - 9010:9010 - 9020:9020 diff --git a/.kokoro/docs/docker/Dockerfile b/.kokoro/docs/docker/Dockerfile index 71229ad44422..fac5a7dba040 100644 --- a/.kokoro/docs/docker/Dockerfile +++ b/.kokoro/docs/docker/Dockerfile @@ -94,7 +94,7 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && # Use phpDocumentor from HEAD until they create a new release # TODO: Remove once phpDocumentor tags a new release # @see https://github.com/phpDocumentor/phpDocumentor/issues/3434 -COPY --from=phpdoc/phpdoc:20230522201300af6fb5 /opt/phpdoc /opt/phpdoc +COPY --from=phpdoc/phpdoc:3.5.0 /opt/phpdoc /opt/phpdoc RUN ln -s /opt/phpdoc/bin/phpdoc /usr/local/bin/phpdoc ENV PHPDOC_ENV=prod diff --git a/.kokoro/docs/docker/requirements.txt b/.kokoro/docs/docker/requirements.txt index 18b5be46f10c..8217a72e2728 100644 --- a/.kokoro/docs/docker/requirements.txt +++ b/.kokoro/docs/docker/requirements.txt @@ -159,9 +159,9 @@ pyasn1-modules==0.3.0 \ --hash=sha256:5bd01446b736eb9d31512a30d46c1ac3395d676c6f3cafa4c03eb54b9925631c \ --hash=sha256:d3ccd6ed470d9ffbc716be08bd90efbd44d0734bc9303818f7336070984a162d # via google-auth -requests==2.31.0 \ - --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ - --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 +requests==2.32.0 \ + --hash=sha256:f2c3881dddb70d056c5bd7600a4fae312b2a300e39be6a118d30b90bd27262b5 \ + --hash=sha256:fa5490319474c82ef1d2c9bc459d3652e3ae4ef4c4ebdd18a21145a47ca4b6b8 # via # google-api-core # google-cloud-storage diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json new file mode 100644 index 000000000000..40202a1b1149 --- /dev/null +++ b/.repo-metadata-full.json @@ -0,0 +1,1555 @@ +{ + "AccessApproval": { + "language": "php", + "distribution_name": "google/cloud-access-approval", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-access-approval/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "accessapproval" + }, + "AccessContextManager": { + "language": "php", + "distribution_name": "google/access-context-manager", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/access-context-manager/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "accesscontextmanager" + }, + "AdvisoryNotifications": { + "language": "php", + "distribution_name": "google/cloud-advisorynotifications", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-advisorynotifications/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "advisorynotifications" + }, + "AiPlatform": { + "language": "php", + "distribution_name": "google/cloud-ai-platform", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-ai-platform/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "aiplatform" + }, + "AlloyDb": { + "language": "php", + "distribution_name": "google/cloud-alloydb", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-alloydb/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "alloydb" + }, + "AnalyticsAdmin": { + "language": "php", + "distribution_name": "google/analytics-admin", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/analytics-admin/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "analyticsadmin" + }, + "AnalyticsData": { + "language": "php", + "distribution_name": "google/analytics-data", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/analytics-data/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "analyticsdata" + }, + "ApiGateway": { + "language": "php", + "distribution_name": "google/cloud-api-gateway", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-api-gateway/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "apigateway" + }, + "ApiKeys": { + "language": "php", + "distribution_name": "google/cloud-api-keys", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-api-keys/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/api-keys/docs", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "apikeys" + }, + "ApigeeConnect": { + "language": "php", + "distribution_name": "google/cloud-apigee-connect", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-apigee-connect/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "apigeeconnect" + }, + "ApigeeRegistry": { + "language": "php", + "distribution_name": "google/cloud-apigee-registry", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-apigee-registry/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "apigeeregistry" + }, + "AppEngineAdmin": { + "language": "php", + "distribution_name": "google/cloud-appengine-admin", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-appengine-admin/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "appengine" + }, + "AppHub": { + "language": "php", + "distribution_name": "google/cloud-apphub", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-apphub/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "apphub" + }, + "AppsChat": { + "language": "php", + "distribution_name": "google/apps-chat", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/apps-chat/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "chat" + }, + "AppsEventsSubscriptions": { + "language": "php", + "distribution_name": "google/apps-events-subscriptions", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/apps-events-subscriptions/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "workspaceevents" + }, + "AppsMeet": { + "language": "php", + "distribution_name": "google/apps-meet", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/apps-meet/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "meet" + }, + "ArtifactRegistry": { + "language": "php", + "distribution_name": "google/cloud-artifact-registry", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-artifact-registry/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "artifactregistry" + }, + "Asset": { + "language": "php", + "distribution_name": "google/cloud-asset", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-asset/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudasset" + }, + "AssuredWorkloads": { + "language": "php", + "distribution_name": "google/cloud-assured-workloads", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-assured-workloads/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "assuredworkloads" + }, + "AutoMl": { + "language": "php", + "distribution_name": "google/cloud-automl", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-automl/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "automl" + }, + "BackupDr": { + "language": "php", + "distribution_name": "google/cloud-backupdr", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-backupdr/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "backupdr" + }, + "BareMetalSolution": { + "language": "php", + "distribution_name": "google/cloud-bare-metal-solution", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bare-metal-solution/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "baremetalsolution" + }, + "Batch": { + "language": "php", + "distribution_name": "google/cloud-batch", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-batch/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/batch/docs", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "batch" + }, + "BeyondCorpAppConnections": { + "language": "php", + "distribution_name": "google/cloud-beyondcorp-appconnections", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-appconnections/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/beyondcorp-enterprise/docs", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "beyondcorp" + }, + "BeyondCorpAppConnectors": { + "language": "php", + "distribution_name": "google/cloud-beyondcorp-appconnectors", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-appconnectors/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "beyondcorp" + }, + "BeyondCorpAppGateways": { + "language": "php", + "distribution_name": "google/cloud-beyondcorp-appgateways", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-appgateways/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "beyondcorp" + }, + "BeyondCorpClientConnectorServices": { + "language": "php", + "distribution_name": "google/cloud-beyondcorp-clientconnectorservices", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-clientconnectorservices/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "beyondcorp" + }, + "BeyondCorpClientGateways": { + "language": "php", + "distribution_name": "google/cloud-beyondcorp-clientgateways", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-clientgateways/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "beyondcorp" + }, + "BigQuery": { + "language": "php", + "distribution_name": "google/cloud-bigquery", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery/latest", + "library_type": "GAPIC_MANUAL", + "api_shortname": "bigquery" + }, + "BigQueryAnalyticsHub": { + "language": "php", + "distribution_name": "google/cloud-bigquery-analyticshub", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/analytics-hub", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "analyticshub" + }, + "BigQueryConnection": { + "language": "php", + "distribution_name": "google/cloud-bigquery-connection", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-connection/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "bigqueryconnection" + }, + "BigQueryDataExchange": { + "language": "php", + "distribution_name": "google/cloud-bigquery-data-exchange", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-data-exchange/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "analyticshub" + }, + "BigQueryDataPolicies": { + "language": "php", + "distribution_name": "google/cloud-bigquery-datapolicies", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/bigquery/docs/reference/bigquerydatapolicy/rest", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "bigquerydatapolicy" + }, + "BigQueryDataTransfer": { + "language": "php", + "distribution_name": "google/cloud-bigquerydatatransfer", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquerydatatransfer/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "bigquerydatatransfer" + }, + "BigQueryMigration": { + "language": "php", + "distribution_name": "google/cloud-bigquery-migration", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/bigquery/docs/migration-intro/docs", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "bigquerymigration" + }, + "BigQueryReservation": { + "language": "php", + "distribution_name": "google/cloud-bigquery-reservation", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "bigqueryreservation" + }, + "BigQueryStorage": { + "language": "php", + "distribution_name": "google/cloud-bigquery-storage", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-storage/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "bigquerystorage" + }, + "Bigtable": { + "language": "php", + "distribution_name": "google/cloud-bigtable", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigtable/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "bigtable" + }, + "Billing": { + "language": "php", + "distribution_name": "google/cloud-billing", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-billing/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudbilling" + }, + "BillingBudgets": { + "language": "php", + "distribution_name": "google/cloud-billing-budgets", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-billing-budgets/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "billingbudgets" + }, + "BinaryAuthorization": { + "language": "php", + "distribution_name": "google/cloud-binary-authorization", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-binary-authorization/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "binaryauthorization" + }, + "Build": { + "language": "php", + "distribution_name": "google/cloud-build", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-build/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudbuild" + }, + "CertificateManager": { + "language": "php", + "distribution_name": "google/cloud-certificate-manager", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-certificate-manager/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "certificatemanager" + }, + "Channel": { + "language": "php", + "distribution_name": "google/cloud-channel", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-channel/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudchannel" + }, + "CommerceConsumerProcurement": { + "language": "php", + "distribution_name": "google/cloud-commerce-consumer-procurement", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-commerce-consumer-procurement/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudcommerceconsumerprocurement" + }, + "CommonProtos": { + "language": "php", + "distribution_name": "google/cloud-common-protos", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-common-protos/latest", + "library_type": "CORE" + }, + "Compute": { + "language": "php", + "distribution_name": "google/cloud-compute", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-compute/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "compute" + }, + "ConfidentialComputing": { + "language": "php", + "distribution_name": "google/cloud-confidentialcomputing", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-confidentialcomputing/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "confidentialcomputing" + }, + "Config": { + "language": "php", + "distribution_name": "google/cloud-config", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-config/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "config" + }, + "ContactCenterInsights": { + "language": "php", + "distribution_name": "google/cloud-contact-center-insights", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "contactcenterinsights" + }, + "Container": { + "language": "php", + "distribution_name": "google/cloud-container", + "release_level": "stable", + "codeowner_team": "@googleapis/cicd", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-container/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "container" + }, + "ContainerAnalysis": { + "language": "php", + "distribution_name": "google/cloud-container-analysis", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-container-analysis/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "containeranalysis" + }, + "ControlsPartner": { + "language": "php", + "distribution_name": "google/cloud-cloudcontrolspartner", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-cloudcontrolspartner/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudcontrolspartner" + }, + "Core": { + "language": "php", + "distribution_name": "google/cloud-core", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-core/latest", + "library_type": "CORE", + "api_shortname": "" + }, + "DataCatalog": { + "language": "php", + "distribution_name": "google/cloud-data-catalog", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-data-catalog/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "datacatalog" + }, + "DataCatalogLineage": { + "language": "php", + "distribution_name": "google/cloud-datacatalog-lineage", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datacatalog-lineage/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "datalineage" + }, + "DataFusion": { + "language": "php", + "distribution_name": "google/cloud-data-fusion", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-data-fusion/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "datafusion" + }, + "DataLabeling": { + "language": "php", + "distribution_name": "google/cloud-datalabeling", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datalabeling/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "datalabeling" + }, + "Dataflow": { + "language": "php", + "distribution_name": "google/cloud-dataflow", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataflow/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "dataflow" + }, + "Dataform": { + "language": "php", + "distribution_name": "google/cloud-dataform", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataform/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/dataform/docs", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "dataform" + }, + "Dataplex": { + "language": "php", + "distribution_name": "google/cloud-dataplex", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataplex/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "dataplex" + }, + "Dataproc": { + "language": "php", + "distribution_name": "google/cloud-dataproc", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataproc/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "dataproc" + }, + "DataprocMetastore": { + "language": "php", + "distribution_name": "google/cloud-dataproc-metastore", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataproc-metastore/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "metastore" + }, + "Datastore": { + "language": "php", + "distribution_name": "google/cloud-datastore", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datastore/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "datastore" + }, + "DatastoreAdmin": { + "language": "php", + "distribution_name": "google/cloud-datastore-admin", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datastore-admin/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "datastore" + }, + "Datastream": { + "language": "php", + "distribution_name": "google/cloud-datastream", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datastream/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "datastream" + }, + "Debugger": { + "language": "php", + "distribution_name": "google/cloud-debugger", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-debugger/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "clouddebugger" + }, + "Deploy": { + "language": "php", + "distribution_name": "google/cloud-deploy", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-deploy/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "clouddeploy" + }, + "DeveloperConnect": { + "language": "php", + "distribution_name": "google/cloud-developerconnect", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-developerconnect/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "developerconnect" + }, + "Dialogflow": { + "language": "php", + "distribution_name": "google/cloud-dialogflow", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dialogflow/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "dialogflow" + }, + "DialogflowCx": { + "language": "php", + "distribution_name": "google/cloud-dialogflow-cx", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "dialogflow" + }, + "DiscoveryEngine": { + "language": "php", + "distribution_name": "google/cloud-discoveryengine", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-discoveryengine/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "discoveryengine" + }, + "Dlp": { + "language": "php", + "distribution_name": "google/cloud-dlp", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dlp/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "dlp" + }, + "Dms": { + "language": "php", + "distribution_name": "google/cloud-dms", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dms/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "datamigration" + }, + "DocumentAi": { + "language": "php", + "distribution_name": "google/cloud-document-ai", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-document-ai/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "documentai" + }, + "Domains": { + "language": "php", + "distribution_name": "google/cloud-domains", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-domains/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "domains" + }, + "EdgeNetwork": { + "language": "php", + "distribution_name": "google/cloud-edgenetwork", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-edgenetwork/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "edgenetwork" + }, + "ErrorReporting": { + "language": "php", + "distribution_name": "google/cloud-error-reporting", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-error-reporting/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "clouderrorreporting" + }, + "EssentialContacts": { + "language": "php", + "distribution_name": "google/cloud-essential-contacts", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-essential-contacts/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "essentialcontacts" + }, + "Eventarc": { + "language": "php", + "distribution_name": "google/cloud-eventarc", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-eventarc/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "eventarc" + }, + "EventarcPublishing": { + "language": "php", + "distribution_name": "google/cloud-eventarc-publishing", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-eventarc-publishing/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "eventarcpublishing" + }, + "Filestore": { + "language": "php", + "distribution_name": "google/cloud-filestore", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-filestore/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "file" + }, + "Firestore": { + "language": "php", + "distribution_name": "google/cloud-firestore", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-firestore/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "firestore" + }, + "Functions": { + "language": "php", + "distribution_name": "google/cloud-functions", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-functions/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudfunctions" + }, + "GSuiteAddOns": { + "language": "php", + "distribution_name": "google/cloud-gsuite-addons", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gsuite-addons/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://developers.google.com/workspace/add-ons/overview", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "gsuiteaddons" + }, + "Gaming": { + "language": "php", + "distribution_name": "google/cloud-game-servers", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-game-servers/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "gameservices" + }, + "GeoCommonProtos": { + "distribution_name": "google/geo-common-protos", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/geo-common-protos/latest", + "library_type": "CORE" + }, + "GkeBackup": { + "language": "php", + "distribution_name": "google/cloud-gke-backup", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gke-backup/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "gkebackup" + }, + "GkeConnectGateway": { + "language": "php", + "distribution_name": "google/cloud-gke-connect-gateway", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gke-connect-gateway/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "connectgateway" + }, + "GkeHub": { + "language": "php", + "distribution_name": "google/cloud-gke-hub", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gke-hub/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "gkehub" + }, + "GkeMultiCloud": { + "language": "php", + "distribution_name": "google/cloud-gke-multi-cloud", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gke-multi-cloud/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "gkemulticloud" + }, + "Grafeas": { + "language": "php", + "distribution_name": "google/grafeas", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/grafeas/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "containeranalysis" + }, + "Iam": { + "language": "php", + "distribution_name": "google/cloud-iam", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-iam/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/iam/docs", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "iam" + }, + "IamCredentials": { + "language": "php", + "distribution_name": "google/cloud-iam-credentials", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-iam-credentials/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "iamcredentials" + }, + "Iap": { + "language": "php", + "distribution_name": "google/cloud-iap", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-iap/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "iap" + }, + "Ids": { + "language": "php", + "distribution_name": "google/cloud-ids", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-ids/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "ids" + }, + "Iot": { + "language": "php", + "distribution_name": "google/cloud-iot", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-iot/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudiot" + }, + "Kms": { + "language": "php", + "distribution_name": "google/cloud-kms", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-kms/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudkms" + }, + "KmsInventory": { + "language": "php", + "distribution_name": "google/cloud-kms-inventory", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-kms-inventory/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "kmsinventory" + }, + "Language": { + "language": "php", + "distribution_name": "google/cloud-language", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-language/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "language" + }, + "LifeSciences": { + "language": "php", + "distribution_name": "google/cloud-life-sciences", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-life-sciences/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "lifesciences" + }, + "Logging": { + "language": "php", + "distribution_name": "google/cloud-logging", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-logging/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "logging" + }, + "LongRunning": { + "language": "php", + "distribution_name": "google/longrunning", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/longrunning/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "longrunning" + }, + "ManagedIdentities": { + "language": "php", + "distribution_name": "google/cloud-managed-identities", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-managed-identities/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "managedidentities" + }, + "ManagedKafka": { + "language": "php", + "distribution_name": "google/cloud-managedkafka", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-managedkafka/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "managedkafka" + }, + "MapsFleetEngine": { + "language": "php", + "distribution_name": "google/maps-fleetengine", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/maps-fleetengine/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "fleetengine" + }, + "MapsFleetEngineDelivery": { + "language": "php", + "distribution_name": "google/maps-fleetengine-delivery", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "fleetengine" + }, + "MapsRouteOptimization": { + "language": "php", + "distribution_name": "google/maps-routeoptimization", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/maps-routeoptimization/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "routeoptimization" + }, + "MediaTranslation": { + "language": "php", + "distribution_name": "google/cloud-media-translation", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-media-translation/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "mediatranslation" + }, + "Memcache": { + "language": "php", + "distribution_name": "google/cloud-memcache", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-memcache/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "memcache" + }, + "MigrationCenter": { + "language": "php", + "distribution_name": "google/cloud-migrationcenter", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-migrationcenter/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "migrationcenter" + }, + "Monitoring": { + "language": "php", + "distribution_name": "google/cloud-monitoring", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-monitoring/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "monitoring" + }, + "NetApp": { + "language": "php", + "distribution_name": "google/cloud-netapp", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-netapp/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "netapp" + }, + "NetworkConnectivity": { + "language": "php", + "distribution_name": "google/cloud-network-connectivity", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-network-connectivity/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "networkconnectivity" + }, + "NetworkManagement": { + "language": "php", + "distribution_name": "google/cloud-network-management", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-network-management/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "networkmanagement" + }, + "NetworkSecurity": { + "language": "php", + "distribution_name": "google/cloud-network-security", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-network-security/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "networksecurity" + }, + "NetworkServices": { + "language": "php", + "distribution_name": "google/cloud-networkservices", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-networkservices/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "networkservices" + }, + "Notebooks": { + "language": "php", + "distribution_name": "google/cloud-notebooks", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-notebooks/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "notebooks" + }, + "Optimization": { + "language": "php", + "distribution_name": "google/cloud-optimization", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-optimization/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudoptimization" + }, + "OrchestrationAirflow": { + "language": "php", + "distribution_name": "google/cloud-orchestration-airflow", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-orchestration-airflow/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "composer" + }, + "OrgPolicy": { + "language": "php", + "distribution_name": "google/cloud-org-policy", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-org-policy/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "orgpolicy" + }, + "OsConfig": { + "language": "php", + "distribution_name": "google/cloud-osconfig", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-osconfig/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "osconfig" + }, + "OsLogin": { + "language": "php", + "distribution_name": "google/cloud-oslogin", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-oslogin/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "oslogin" + }, + "Parallelstore": { + "language": "php", + "distribution_name": "google/cloud-parallelstore", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-parallelstore/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "parallelstore" + }, + "PolicySimulator": { + "language": "php", + "distribution_name": "google/cloud-policysimulator", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-policysimulator/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "policysimulator" + }, + "PolicyTroubleshooter": { + "language": "php", + "distribution_name": "google/cloud-policy-troubleshooter", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-policy-troubleshooter/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "policytroubleshooter" + }, + "PolicyTroubleshooterIam": { + "language": "php", + "distribution_name": "google/cloud-policytroubleshooter-iam", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-policytroubleshooter-iam/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "policytroubleshooter" + }, + "PrivateCatalog": { + "language": "php", + "distribution_name": "google/cloud-private-catalog", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-private-catalog/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudprivatecatalog" + }, + "Profiler": { + "language": "php", + "distribution_name": "google/cloud-profiler", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-profiler/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudprofiler" + }, + "PubSub": { + "language": "php", + "distribution_name": "google/cloud-pubsub", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-pubsub/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "pubsub" + }, + "Quotas": { + "language": "php", + "distribution_name": "google/cloud-quotas", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-quotas/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudquotas" + }, + "RapidMigrationAssessment": { + "language": "php", + "distribution_name": "google/cloud-rapidmigrationassessment", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-rapidmigrationassessment/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "rapidmigrationassessment" + }, + "RecaptchaEnterprise": { + "language": "php", + "distribution_name": "google/cloud-recaptcha-enterprise", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-recaptcha-enterprise/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "recaptchaenterprise" + }, + "RecommendationEngine": { + "language": "php", + "distribution_name": "google/cloud-recommendations-ai", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-recommendations-ai/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "recommendationengine" + }, + "Recommender": { + "language": "php", + "distribution_name": "google/cloud-recommender", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-recommender/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "recommender" + }, + "Redis": { + "language": "php", + "distribution_name": "google/cloud-redis", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-redis/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "redis" + }, + "RedisCluster": { + "language": "php", + "distribution_name": "google/cloud-redis-cluster", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-redis-cluster/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "redis" + }, + "ResourceManager": { + "language": "php", + "distribution_name": "google/cloud-resource-manager", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-resource-manager/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudresourcemanager" + }, + "ResourceSettings": { + "language": "php", + "distribution_name": "google/cloud-resource-settings", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-resource-settings/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "resourcesettings" + }, + "Retail": { + "language": "php", + "distribution_name": "google/cloud-retail", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-retail/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "retail" + }, + "Run": { + "language": "php", + "distribution_name": "google/cloud-run", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-run/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "run" + }, + "Scheduler": { + "language": "php", + "distribution_name": "google/cloud-scheduler", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-scheduler/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudscheduler" + }, + "SecretManager": { + "language": "php", + "distribution_name": "google/cloud-secret-manager", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-secret-manager/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "secretmanager" + }, + "SecureSourceManager": { + "language": "php", + "distribution_name": "google/cloud-securesourcemanager", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-securesourcemanager/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "securesourcemanager" + }, + "SecurityCenter": { + "language": "php", + "distribution_name": "google/cloud-security-center", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-security-center/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "securitycenter" + }, + "SecurityCenterManagement": { + "language": "php", + "distribution_name": "google/cloud-securitycentermanagement", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-securitycentermanagement/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "securitycentermanagement" + }, + "SecurityPrivateCa": { + "language": "php", + "distribution_name": "google/cloud-security-private-ca", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-security-private-ca/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "privateca" + }, + "SecurityPublicCA": { + "language": "php", + "distribution_name": "google/cloud-security-public-ca", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-security-public-ca/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/certificate-manager/docs/public-ca", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "publicca" + }, + "ServiceControl": { + "language": "php", + "distribution_name": "google/cloud-service-control", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-service-control/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "servicecontrol" + }, + "ServiceDirectory": { + "language": "php", + "distribution_name": "google/cloud-service-directory", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-service-directory/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "servicedirectory" + }, + "ServiceHealth": { + "language": "php", + "distribution_name": "google/cloud-servicehealth", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-servicehealth/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "servicehealth" + }, + "ServiceManagement": { + "language": "php", + "distribution_name": "google/cloud-service-management", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-service-management/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "servicemanagement" + }, + "ServiceUsage": { + "language": "php", + "distribution_name": "google/cloud-service-usage", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-service-usage/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "serviceusage" + }, + "Shell": { + "language": "php", + "distribution_name": "google/cloud-shell", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-shell/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudshell" + }, + "ShoppingCommonProtos": { + "distribution_name": "google/shopping-common-protos", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-common-protos/latest", + "library_type": "CORE" + }, + "ShoppingCss": { + "language": "php", + "distribution_name": "google/shopping-css", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-css/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "css" + }, + "ShoppingMerchantAccounts": { + "language": "php", + "distribution_name": "google/shopping-merchant-accounts", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "ShoppingMerchantConversions": { + "language": "php", + "distribution_name": "google/shopping-merchant-conversions", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-conversions/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "ShoppingMerchantDatasources": { + "language": "php", + "distribution_name": "google/shopping-merchant-datasources", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "ShoppingMerchantInventories": { + "distribution_name": "google/shopping-merchant-inventories", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-inventories/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "ShoppingMerchantLfp": { + "language": "php", + "distribution_name": "google/shopping-merchant-lfp", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-lfp/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "ShoppingMerchantNotifications": { + "language": "php", + "distribution_name": "google/shopping-merchant-notifications", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-notifications/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "ShoppingMerchantProducts": { + "language": "php", + "distribution_name": "google/shopping-merchant-products", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-products/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "ShoppingMerchantPromotions": { + "language": "php", + "distribution_name": "google/shopping-merchant-promotions", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-promotions/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "ShoppingMerchantQuota": { + "language": "php", + "distribution_name": "google/shopping-merchant-quota", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-quota/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "ShoppingMerchantReports": { + "language": "php", + "distribution_name": "google/shopping-merchant-reports", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-reports/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi" + }, + "Spanner": { + "language": "php", + "distribution_name": "google/cloud-spanner", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-spanner/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "spanner" + }, + "Speech": { + "language": "php", + "distribution_name": "google/cloud-speech", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-speech/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "speech" + }, + "SqlAdmin": { + "language": "php", + "distribution_name": "google/cloud-sql-admin", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-sql-admin/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "sqladmin" + }, + "Storage": { + "language": "php", + "distribution_name": "google/cloud-storage", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-storage/latest", + "library_type": "GAPIC_MANUAL", + "api_shortname": "storage" + }, + "StorageControl": { + "language": "php", + "distribution_name": "google/cloud-storage-control", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-storage-control/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "storage" + }, + "StorageInsights": { + "language": "php", + "distribution_name": "google/cloud-storageinsights", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-storageinsights/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "storageinsights" + }, + "StorageTransfer": { + "language": "php", + "distribution_name": "google/cloud-storage-transfer", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-storage-transfer/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "storagetransfer" + }, + "Support": { + "language": "php", + "distribution_name": "google/cloud-support", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-support/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudsupport" + }, + "Talent": { + "language": "php", + "distribution_name": "google/cloud-talent", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-talent/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "jobs" + }, + "Tasks": { + "language": "php", + "distribution_name": "google/cloud-tasks", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-tasks/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudtasks" + }, + "TelcoAutomation": { + "language": "php", + "distribution_name": "google/cloud-telcoautomation", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-telcoautomation/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "telcoautomation" + }, + "TextToSpeech": { + "language": "php", + "distribution_name": "google/cloud-text-to-speech", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-text-to-speech/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "texttospeech" + }, + "Tpu": { + "language": "php", + "distribution_name": "google/cloud-tpu", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-tpu/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "tpu" + }, + "Trace": { + "language": "php", + "distribution_name": "google/cloud-trace", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-trace/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "cloudtrace" + }, + "Translate": { + "language": "php", + "distribution_name": "google/cloud-translate", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-translate/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "translate" + }, + "VideoIntelligence": { + "language": "php", + "distribution_name": "google/cloud-videointelligence", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-videointelligence/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "videointelligence" + }, + "VideoLiveStream": { + "language": "php", + "distribution_name": "google/cloud-video-live-stream", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-video-live-stream/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "livestream" + }, + "VideoStitcher": { + "language": "php", + "distribution_name": "google/cloud-video-stitcher", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-video-stitcher/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "videostitcher" + }, + "VideoTranscoder": { + "language": "php", + "distribution_name": "google/cloud-video-transcoder", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-video-transcoder/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "transcoder" + }, + "Vision": { + "language": "php", + "distribution_name": "google/cloud-vision", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-vision/latest", + "library_type": "GAPIC_COMBO", + "api_shortname": "vision" + }, + "VmMigration": { + "language": "php", + "distribution_name": "google/cloud-vm-migration", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-vm-migration/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "vmmigration" + }, + "VmwareEngine": { + "language": "php", + "distribution_name": "google/cloud-vmware-engine", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-vmware-engine/latest", + "library_type": "GAPIC_AUTO", + "product_documentation": "https://cloud.google.com/vmware-engine/docs", + "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", + "api_shortname": "vmwareengine" + }, + "VpcAccess": { + "language": "php", + "distribution_name": "google/cloud-vpc-access", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-vpc-access/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "vpcaccess" + }, + "WebRisk": { + "language": "php", + "distribution_name": "google/cloud-web-risk", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-web-risk/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "webrisk" + }, + "WebSecurityScanner": { + "language": "php", + "distribution_name": "google/cloud-web-security-scanner", + "release_level": "stable", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "websecurityscanner" + }, + "Workflows": { + "language": "php", + "distribution_name": "google/cloud-workflows", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-workflows/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "workflows" + } +} \ No newline at end of file diff --git a/AccessApproval/.repo-metadata.json b/AccessApproval/.repo-metadata.json deleted file mode 100644 index 3c8f871db972..000000000000 --- a/AccessApproval/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-access-approval", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-access-approval/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "accessapproval" -} diff --git a/AccessApproval/VERSION b/AccessApproval/VERSION index 0495c4a88cae..c813fe116c9f 100644 --- a/AccessApproval/VERSION +++ b/AccessApproval/VERSION @@ -1 +1 @@ -1.2.3 +1.2.5 diff --git a/AccessApproval/composer.json b/AccessApproval/composer.json index 93c12446ff89..aea16d2813fd 100644 --- a/AccessApproval/composer.json +++ b/AccessApproval/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AccessContextManager/.repo-metadata.json b/AccessContextManager/.repo-metadata.json deleted file mode 100644 index b35a2d9c1a61..000000000000 --- a/AccessContextManager/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/access-context-manager", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/access-context-manager/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "accesscontextmanager" -} diff --git a/AccessContextManager/VERSION b/AccessContextManager/VERSION index be14282b7fff..d1d899fa33a0 100644 --- a/AccessContextManager/VERSION +++ b/AccessContextManager/VERSION @@ -1 +1 @@ -0.5.3 +0.5.5 diff --git a/AccessContextManager/composer.json b/AccessContextManager/composer.json index ddbd26bcb255..ba2084e45748 100644 --- a/AccessContextManager/composer.json +++ b/AccessContextManager/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AdvisoryNotifications/.repo-metadata.json b/AdvisoryNotifications/.repo-metadata.json deleted file mode 100644 index a245fd9ec7bb..000000000000 --- a/AdvisoryNotifications/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-advisorynotifications", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-advisorynotifications/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "advisorynotifications" -} diff --git a/AdvisoryNotifications/VERSION b/AdvisoryNotifications/VERSION index 6f4eebdf6f68..ee94dd834b53 100644 --- a/AdvisoryNotifications/VERSION +++ b/AdvisoryNotifications/VERSION @@ -1 +1 @@ -0.8.1 +0.8.3 diff --git a/AdvisoryNotifications/composer.json b/AdvisoryNotifications/composer.json index d005159b24a2..9b29e919c1aa 100644 --- a/AdvisoryNotifications/composer.json +++ b/AdvisoryNotifications/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AiPlatform/.OwlBot.yaml b/AiPlatform/.OwlBot.yaml index 744bf4a83821..9acdd46ecbed 100644 --- a/AiPlatform/.OwlBot.yaml +++ b/AiPlatform/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/aiplatform/v1/.*-php/(.*) - dest: /owl-bot-staging/AiPlatform/v1/$1 + - source: /google/cloud/aiplatform/(v1)/.*-php/(.*) + dest: /owl-bot-staging/AiPlatform/$1/$2 api-name: AiPlatform diff --git a/AiPlatform/.repo-metadata.json b/AiPlatform/.repo-metadata.json deleted file mode 100644 index 60df41065a87..000000000000 --- a/AiPlatform/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-ai-platform", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-ai-platform/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "aiplatform" -} diff --git a/AiPlatform/README.md b/AiPlatform/README.md index 7dc1b2e628f7..42d54798d22e 100644 --- a/AiPlatform/README.md +++ b/AiPlatform/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/AiPlatform/VERSION b/AiPlatform/VERSION index 9b1bb8512396..4ef2eb086f50 100644 --- a/AiPlatform/VERSION +++ b/AiPlatform/VERSION @@ -1 +1 @@ -0.37.1 +0.39.0 diff --git a/AiPlatform/composer.json b/AiPlatform/composer.json index e08b28ae2c39..f69ab5f15e19 100644 --- a/AiPlatform/composer.json +++ b/AiPlatform/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AiPlatform/metadata/V1/AcceleratorType.php b/AiPlatform/metadata/V1/AcceleratorType.php index faf2f31df7d53580594bf81064dd5b81babbcc6b..6e95f49265a9ae05fe64b6161cb096bbe13f4bdd 100644 GIT binary patch delta 46 zcmZqToW{A~9V6qt$?q8h8P{)iWRhVN5fb9!3ke8~4>OJT@eFYd@OKg5*&NHP$_M~n CK@B(n delta 25 hcmbQn*~Gcw9V6qZ$?q8h8E0>HWRhXrT*$1-2mpL*2xR~O diff --git a/AiPlatform/metadata/V1/Content.php b/AiPlatform/metadata/V1/Content.php index 9a92f19e33a259e9b0d3db07f2a4ea7320602820..13a554505dfa65df98e088d4645890de50da0cd7 100644 GIT binary patch delta 306 zcmX@E)~dEakcr*DAT=+sAaim6lh)+FjHj8_$xlAToGH}X5PGk&4_WbCP(GwZ5$KWO+vWXgHzLU zQ}arM#JRW%5{pXWGxJhXD)PY3rTQs7ndMpm?r!3iW@P*<&`Efaf!GW z<(KBAWagzimXs7_CY6?C=I04{a50ysCP{#lavPaUF65Lk!lq6yJT(bq6Qc)%kR=y; zF~mJ!7jPRX1GUN4LxdpCQRNay&d*EBOi9g4PK_^4&M!)pU;A^L^5SW7ZXav+)@Vouy#oJFZ=sYM_oorJjr<56v3DN0r9 mp6o7QrWnd4mJai3d?LcH#Xu)81AS=#@+H>L*sLRXlMw)Vz;@yQ diff --git a/AiPlatform/metadata/V1/Dataset.php b/AiPlatform/metadata/V1/Dataset.php index 3cfe10af1e270af7cb05371191d6b7f812f36da7..c1be592bb6977121db811831bb81807a04c0cf4a 100644 GIT binary patch delta 72 zcmV-O0Js0`8H*aQmjeW<5(+4jE(9C1wgU+P0n4+%1RDY(5*!K-ZEs{{Y+rI^W@U0^ eZewK_5+DI62|@$lK>->q3Ja6q2rIJ+2jc}0=M=X9 delta 42 ycmeB{dMmkMIx|a;5SPYeJr?QB+n6~S8P{$;z#`4WBBjg4J^3Gp_GS(C$E*Mn84OSW diff --git a/AiPlatform/metadata/V1/DatasetService.php b/AiPlatform/metadata/V1/DatasetService.php index 3f7f7b97fde035b7ea25f3c99a8e3d67114feb14..3dc6a784fee1dac73eb3e29c92b730e066d77a60 100644 GIT binary patch delta 162 zcmeAV-x{@HA1l*Zzs(0&D_J<^GIB|W7NjIjeyAueD&)b%pORRTSe#lCUzS=_oSB~| z!8rLLpXp{Mu3G|3lNC4LlRC-9-ps@$0@O2kf`b0!xiY+yUn%lWey*fr+sb&$Q5sFZ pPASmvlGOOz#NzCx%TFdVB^vqZml^6;qp8!IoTy~Ed8*XqMICw-D_v#;_CP5|wc4OjpG diff --git a/AiPlatform/metadata/V1/DatasetVersion.php b/AiPlatform/metadata/V1/DatasetVersion.php index 9da060dd239a..97db6c03605b 100644 --- a/AiPlatform/metadata/V1/DatasetVersion.php +++ b/AiPlatform/metadata/V1/DatasetVersion.php @@ -20,8 +20,8 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -  -0google/cloud/aiplatform/v1/dataset_version.protogoogle.cloud.aiplatform.v1google/api/resource.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"™ +¾ +0google/cloud/aiplatform/v1/dataset_version.protogoogle.cloud.aiplatform.v1google/api/resource.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"· DatasetVersion name ( BàA4 create_time ( 2.google.protobuf.TimestampBàA4 @@ -29,7 +29,8 @@ public static function initOnce() { etag ( # big_query_dataset_name ( BàA display_name ( 0 -metadata ( 2.google.protobuf.ValueBàAàA:ŒêAˆ +metadata ( 2.google.protobuf.ValueBàAàA +model_reference ( BàA:ŒêAˆ (aiplatform.googleapis.com/DatasetVersion\\projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}BÑ com.google.cloud.aiplatform.v1BDatasetVersionProtoPZ>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpbªGoogle.Cloud.AIPlatform.V1ÊGoogle\\Cloud\\AIPlatform\\V1êGoogle::Cloud::AIPlatform::V1bproto3' , true); diff --git a/AiPlatform/metadata/V1/DeploymentResourcePool.php b/AiPlatform/metadata/V1/DeploymentResourcePool.php index 87afb02e5439..8fb9b23359c4 100644 --- a/AiPlatform/metadata/V1/DeploymentResourcePool.php +++ b/AiPlatform/metadata/V1/DeploymentResourcePool.php @@ -16,15 +16,19 @@ public static function initOnce() { } \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); + \GPBMetadata\Google\Cloud\Aiplatform\V1\EncryptionSpec::initOnce(); \GPBMetadata\Google\Cloud\Aiplatform\V1\MachineResources::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -ö -9google/cloud/aiplatform/v1/deployment_resource_pool.protogoogle.cloud.aiplatform.v1google/api/resource.proto2google/cloud/aiplatform/v1/machine_resources.protogoogle/protobuf/timestamp.proto"È +© +9google/cloud/aiplatform/v1/deployment_resource_pool.protogoogle.cloud.aiplatform.v1google/api/resource.proto0google/cloud/aiplatform/v1/encryption_spec.proto2google/cloud/aiplatform/v1/machine_resources.protogoogle/protobuf/timestamp.proto"É DeploymentResourcePool name ( BàAP -dedicated_resources ( 2..google.cloud.aiplatform.v1.DedicatedResourcesBàA4 +dedicated_resources ( 2..google.cloud.aiplatform.v1.DedicatedResourcesBàAC +encryption_spec ( 2*.google.cloud.aiplatform.v1.EncryptionSpec +service_account ( ! +disable_container_logging (4 create_time ( 2.google.protobuf.TimestampBàA:’êAŽ 0aiplatform.googleapis.com/DeploymentResourcePoolZprojects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}BÙ com.google.cloud.aiplatform.v1BDeploymentResourcePoolProtoPZ>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpbªGoogle.Cloud.AIPlatform.V1ÊGoogle\\Cloud\\AIPlatform\\V1êGoogle::Cloud::AIPlatform::V1bproto3' diff --git a/AiPlatform/metadata/V1/Endpoint.php b/AiPlatform/metadata/V1/Endpoint.php index 9a807e5658a18279416caf445e5925e9061f68c2..087c1ed2e17891e5a5250f0f49918391109460e9 100644 GIT binary patch delta 164 zcmaDLb4qSQ1oPxmOd^88sYPX($*F#+CFS`=*_nCilNT^)O^#p=XKE1JypdUkkGn?JDlFlnZ6$rTi3mL-;?#=}%5=jY|6CYQtm>9ovr2~h<` i4Q?az$@5ud; delta 35 rcmX>l_dsSt1oPzO%;8K=MK-a>Fis9+Rb)EEvAKlRhiS7KhYC9Y-fIf3 diff --git a/AiPlatform/metadata/V1/Feature.php b/AiPlatform/metadata/V1/Feature.php index 9b43f26c30e8da5f90d7c7335d371223833700f6..652dc61067938838a564660c4144be11e77a28f6 100644 GIT binary patch delta 44 zcmV+{0Mq}z6Uq~?-U0!klivcr0gSVs15yJ4u#@rzr3?}Z3I)vj)>i&dp}b{!G$B9$e`161)nG8r()&ljE3W_)yK?+`t;k3;@f2DZc;! delta 35 rcmZ1~d{=OTH`CM%AY)uS&`{K$L1}}{!E*F*&>($^0W+w diff --git a/AiPlatform/metadata/V1/FeaturestoreOnlineService.php b/AiPlatform/metadata/V1/FeaturestoreOnlineService.php index a543a6120be7b2692343babae1e9ded9fb30ebcd..f625104095d981b1bfa142d6fb54f2dc91c72a86 100644 GIT binary patch delta 158 zcmeyWd|!3LT4tuFvYXd4E3h*@+kAm*4x@xU7f*3XQE75Xd|6^nX{rRj0;2}EQH=WJ zgM2dF!C;v%ki_Ino(T%xT*yK~He76AO~n$73d}%VIv`Ct5KV5GsW~ZNol22h0_b8w VJX|b!iMgqho!RU+|KRz{0sxv7H0J;S delta 31 pcmV+)0O0@MCG{h)tpfu58?&ziAO``Zv(O5h0h6u_jkDto`~=va4Q~Jd diff --git a/AiPlatform/metadata/V1/Index.php b/AiPlatform/metadata/V1/Index.php index 237f7b8026c723287bb781f48d3438497793792f..063476c6d99662974c4491686b1c7fb9f173df4c 100644 GIT binary patch delta 193 zcmdlg@kMe&Bs0rJAuhGaADN{$S1?DgFwJM5e2LvtI+9DExFE5pI5j>sHz_qGB{MHw zf?a`8gWJez@2A!2_~QfGgxA?4CgLJ#vRsm$ zeqoM2o-Xmh0ggezuJJCOzOH`3p8kHp0(?T^T*5Hv5Pxr1zj&b1P*(wdAsH?Sm;_Xx ztFM!*i;Jh9yMTa@D3>5i79lJsHH(Q$%sD@=BsH%jEHNiDC2?{d-(e3SMJ~xQ5I4TK sAhD=8HNGe{Ilm|+J~_WMuS9}Xfl-55NSRAIGY_{SHjtvthWxkL0N@cxE&u=k delta 61 zcmV-D0K)&lEsQL%2LuGSBML5)tOOvlD+DwL0?-GOVGFz{f=HQ<^frXn_FDS^(iTQyeqX&bK(_}3++sVwV3pAu8xtM_x zLPA`ui8%!si4u%JtxO_v%r*_nCiO1CF3WvyT=nJmW^Eh;3=#a~>ISX7)E UpORTzl9-pAD#5(Dlx-#p08CddWB>pF delta 71 zcmV-N0J#617mgON2?GSV4+<`mt^*sBC`y$77YLZ diff --git a/AiPlatform/metadata/V1/MetadataStore.php b/AiPlatform/metadata/V1/MetadataStore.php index 06d652b2be40..bfb232d4833b 100644 --- a/AiPlatform/metadata/V1/MetadataStore.php +++ b/AiPlatform/metadata/V1/MetadataStore.php @@ -20,17 +20,20 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -û -/google/cloud/aiplatform/v1/metadata_store.protogoogle.cloud.aiplatform.v1google/api/resource.proto0google/cloud/aiplatform/v1/encryption_spec.protogoogle/protobuf/timestamp.proto"ç + +/google/cloud/aiplatform/v1/metadata_store.protogoogle.cloud.aiplatform.v1google/api/resource.proto0google/cloud/aiplatform/v1/encryption_spec.protogoogle/protobuf/timestamp.proto"ù MetadataStore name ( BàA4 create_time ( 2.google.protobuf.TimestampBàA4 update_time ( 2.google.protobuf.TimestampBàAC encryption_spec ( 2*.google.cloud.aiplatform.v1.EncryptionSpec description ( P -state ( 2<.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreStateBàA4 +state ( 2<.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreStateBàAV +dataplex_config ( 28.google.cloud.aiplatform.v1.MetadataStore.DataplexConfigBàA4 MetadataStoreState -disk_utilization_bytes (:uêAr +disk_utilization_bytes (8 +DataplexConfig& +enabled_pipelines_lineage (BàA:uêAr \'aiplatform.googleapis.com/MetadataStoreGprojects/{project}/locations/{location}/metadataStores/{metadata_store}BË com.google.cloud.aiplatform.v1B MetadataProtoPZ>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpbªGoogle.Cloud.AIPlatform.V1ÊGoogle\\Cloud\\AIPlatform\\V1êGoogle::Cloud::AIPlatform::V1bproto3' , true); diff --git a/AiPlatform/metadata/V1/NotebookRuntime.php b/AiPlatform/metadata/V1/NotebookRuntime.php index 1eb999bcdfe8f6d3f090cc8e9e36e6bca4a85d9a..e7d1ec027f508dbe41004b3bd074022fbe661f10 100644 GIT binary patch delta 295 zcmbQGxK(9C1QVBQUUE@oK}lwQ-sH7RPMaf`ZZfjGmf|v;JfB5+asZ1TqXCG;p9)tN zUtExyym>l{BO}v7&dIk}rFeO`Sn?8cQzaM`7&SOIv#}L0OA9%3p=*&42TF4rX-#h6 zmf=I#8VodTavA4IrcKPU1)MDuY$CY2d1Gi2t&P5 w4RvCE;K(c_#l>5kSdv+smYG@{Ur<#nAq&*NfmJS3LJlqmbdmn%ExgZ|0LejFqW}N^ delta 91 zcmV-h0Hpu5B$^?xSOT-80@(oqoEVdT1Zx2@lYs;qvp5AF0UF^53KvdqbY)_1Z);L@ xZggpFWmIKtaBN|8lMf3Rvx5d~1Ct;RFOy>mngZ1cv;PVz1CxXf8nYk|6$5@(9h(3E diff --git a/AiPlatform/metadata/V1/NotebookService.php b/AiPlatform/metadata/V1/NotebookService.php index 6f3328303bee..047f3cc8275a 100644 --- a/AiPlatform/metadata/V1/NotebookService.php +++ b/AiPlatform/metadata/V1/NotebookService.php @@ -25,7 +25,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); $pool->internalAddGeneratedFile( ' -º- +³1 1google/cloud/aiplatform/v1/notebook_service.protogoogle.cloud.aiplatform.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto1google/cloud/aiplatform/v1/notebook_runtime.proto*google/cloud/aiplatform/v1/operation.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"é $CreateNotebookRuntimeTemplateRequest9 parent ( B)àAúA# @@ -51,7 +51,10 @@ public static function initOnce() { next_page_token ( "o $DeleteNotebookRuntimeTemplateRequestG name ( B9àAúA3 -1aiplatform.googleapis.com/NotebookRuntimeTemplate"¥ +1aiplatform.googleapis.com/NotebookRuntimeTemplate"¹ +$UpdateNotebookRuntimeTemplateRequest[ +notebook_runtime_template ( 23.google.cloud.aiplatform.v1.NotebookRuntimeTemplateBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"¥ AssignNotebookRuntimeRequest9 parent ( B)àAúA# !locations.googleapis.com/Location\\ @@ -93,14 +96,15 @@ public static function initOnce() { %StartNotebookRuntimeOperationMetadataN generic_metadata ( 24.google.cloud.aiplatform.v1.GenericOperationMetadata progress_message ( " -StartNotebookRuntimeResponse2ÿ +StartNotebookRuntimeResponse2¼ NotebookServiceî CreateNotebookRuntimeTemplate@.google.cloud.aiplatform.v1.CreateNotebookRuntimeTemplateRequest.google.longrunning.Operation"ëÊAI NotebookRuntimeTemplate.CreateNotebookRuntimeTemplateOperationMetadataÚA=parent,notebook_runtime_template,notebook_runtime_template_id‚Óä“Y"**+mxHvO&6Vp@UON%lk7!?>bIGvau zI5G;wafuYA7U!21C8x$0ed4R7PrIN_<{^N@_fsnJE(N2rJ#W_=^%N<8xC>iZYYqi-E3_-~h^U8)<@U zQwQ4S3zh=88*H|eC6_pc-IMpQt82|>rExCMTyB7lXW74D>79 zBa`*m`IYn>!IGgsIk@YYr3|_F;o=~ZC%16ND=VpS@uIj!NR*2sC9^m&DJL}r9Ecp7 J?{Vug0sw)2by@%b delta 54 zcmaDV+by*rpPA{R(B?wsuk5m%TGG4wOj8&q@0N67 ziSkqOoV-_3b+Uk@xO7TpQEGBYKv8N+W^#!Yqn6M@CN2RNu;64J3606~B-tkCO7Toy zC(Sn5K}HtJ7iL<>IC-Xo_2l01)MVi04363dZH+QKyXqEtKga){*%7?oTn^U4}a zmK3EX=0a>hD2@tI@`t)fRvcYYgVBId=rGgd1nCKrnPlzwkW2vDIN49uTLM)GVeaOS z($iU4+ZazdN=`n=A<2BnF@5q1MLk9x5GkYwbV`bDeqK(c(-lT8x#av@U}#Ej{;9~q F2mpS4g@gbA delta 137 zcmV;40CxZOO8rH!QUnCuJPI?DK?NI;W*D=H1osR9my>}J>$9#Bhyw!P7qd7PM*{-D z0h56lbq7j<)8vx^M3es+L<17c0h5**ehE#2)8vx^M155|sgy@f?r=0JAV2mjwh(%0U^E!3Y@x(m^hh=p!z(Pb4P+ZIdr1 diff --git a/AiPlatform/metadata/V1/PublisherModel.php b/AiPlatform/metadata/V1/PublisherModel.php index 67b9684ff3b613709cd89be605ceae03000fb3d3..7043709d996ab2b7bafb3faa00a8ae6772c2ea9c 100644 GIT binary patch delta 103 zcmdm`^;v7fJ0`|mlixEPXPTzCc?a_=CZ>hro0qUjaWXAu*?fS1A)}HKmq1EtK~8>U vd`V()c6?r9ZmI;A0;2|}6Y~Q{Mi0gg#>w%5{-RF8T!QiF3OBD4>|q7~ibW$v delta 46 zcmV+}0MY;RD!MAL?g9aUlkWn@0^K09xC80}0_YaAqy`!Z0`3E|zz?ATlZ6pYv*!_v E1KV&D4*&oF diff --git a/AiPlatform/metadata/V1/Tool.php b/AiPlatform/metadata/V1/Tool.php index 59b442d74ea665a6a176c9b929b07dfe6b1eed45..67bc3c3363d242ef3f1bf089d1901fd3534376c3 100644 GIT binary patch delta 304 zcmeC?pDMWF7!yk?H<#)}Z`IB3nLL<1#koY?^YhblQiD?yi;^>fQcH?5Q_B)_lv264 zLh|!-ob&V2GSh{^xx~{-^O8$4^Yh}96LWGh^U~v!!BP^83XB@uMuw9gGRwHQLDe`z zlt45)F+Xr*R64}SC5lyA$dijDH$Np6Y!IK38OWe|tSa?%TNr72|6Jn($7Yj&-kO-H6ufL0He5hY=fUC2oo2RRb0D}+*7mH(Ph`#`% a5IYyMqhF)|6G+I<-_KQmd2=C~6e9pPm0NrO delta 65 zcmbO#*v-G;7!%8H4ldP+-m075GkGveSaONF=jW&Aqz0!Z7A0o{rIr+Brj{ksetMetadata($datasetVersionMetadata); + $updateMask = new FieldMask(); + $request = (new UpdateDatasetVersionRequest()) + ->setDatasetVersion($datasetVersion) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var DatasetVersion $response */ + $response = $datasetServiceClient->updateDatasetVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END aiplatform_v1_generated_DatasetService_UpdateDatasetVersion_sync] diff --git a/AiPlatform/samples/V1/FeatureRegistryServiceClient/create_feature_group.php b/AiPlatform/samples/V1/FeatureRegistryServiceClient/create_feature_group.php index 8090303c9000..5a8f53f07ef9 100644 --- a/AiPlatform/samples/V1/FeatureRegistryServiceClient/create_feature_group.php +++ b/AiPlatform/samples/V1/FeatureRegistryServiceClient/create_feature_group.php @@ -35,7 +35,7 @@ * * @param string $formattedParent The resource name of the Location to create FeatureGroups. * Format: - * `projects/{project}/locations/{location}'` + * `projects/{project}/locations/{location}` * Please see {@see FeatureRegistryServiceClient::locationName()} for help formatting this field. * @param string $featureGroupId The ID to use for this FeatureGroup, which will become the final * component of the FeatureGroup's resource name. diff --git a/AiPlatform/samples/V1/NotebookServiceClient/update_notebook_runtime_template.php b/AiPlatform/samples/V1/NotebookServiceClient/update_notebook_runtime_template.php new file mode 100644 index 000000000000..ffabd5a93b9f --- /dev/null +++ b/AiPlatform/samples/V1/NotebookServiceClient/update_notebook_runtime_template.php @@ -0,0 +1,77 @@ +setDisplayName($notebookRuntimeTemplateDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateNotebookRuntimeTemplateRequest()) + ->setNotebookRuntimeTemplate($notebookRuntimeTemplate) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var NotebookRuntimeTemplate $response */ + $response = $notebookServiceClient->updateNotebookRuntimeTemplate($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 +{ + $notebookRuntimeTemplateDisplayName = '[DISPLAY_NAME]'; + + update_notebook_runtime_template_sample($notebookRuntimeTemplateDisplayName); +} +// [END aiplatform_v1_generated_NotebookService_UpdateNotebookRuntimeTemplate_sync] diff --git a/AiPlatform/src/V1/AcceleratorType.php b/AiPlatform/src/V1/AcceleratorType.php index 795510275c25..f5472bd1f42b 100644 --- a/AiPlatform/src/V1/AcceleratorType.php +++ b/AiPlatform/src/V1/AcceleratorType.php @@ -91,6 +91,12 @@ class AcceleratorType * Generated from protobuf enum TPU_V4_POD = 10; */ const TPU_V4_POD = 10; + /** + * TPU v5. + * + * Generated from protobuf enum TPU_V5_LITEPOD = 12; + */ + const TPU_V5_LITEPOD = 12; private static $valueToName = [ self::ACCELERATOR_TYPE_UNSPECIFIED => 'ACCELERATOR_TYPE_UNSPECIFIED', @@ -106,6 +112,7 @@ class AcceleratorType self::TPU_V2 => 'TPU_V2', self::TPU_V3 => 'TPU_V3', self::TPU_V4_POD => 'TPU_V4_POD', + self::TPU_V5_LITEPOD => 'TPU_V5_LITEPOD', ]; public static function name($value) diff --git a/AiPlatform/src/V1/ActiveLearningConfig.php b/AiPlatform/src/V1/ActiveLearningConfig.php index 450eeab21754..f9887ff8d0c8 100644 --- a/AiPlatform/src/V1/ActiveLearningConfig.php +++ b/AiPlatform/src/V1/ActiveLearningConfig.php @@ -23,7 +23,7 @@ class ActiveLearningConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.SampleConfig sample_config = 3; */ - private $sample_config = null; + protected $sample_config = null; /** * CMLE training config. For every active learning labeling iteration, system * will train a machine learning model on CMLE. The trained model will be used @@ -31,7 +31,7 @@ class ActiveLearningConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.TrainingConfig training_config = 4; */ - private $training_config = null; + protected $training_config = null; protected $human_labeling_budget; /** diff --git a/AiPlatform/src/V1/AddContextArtifactsAndExecutionsRequest.php b/AiPlatform/src/V1/AddContextArtifactsAndExecutionsRequest.php index 74a8c88f21b6..f48abf80c3d5 100644 --- a/AiPlatform/src/V1/AddContextArtifactsAndExecutionsRequest.php +++ b/AiPlatform/src/V1/AddContextArtifactsAndExecutionsRequest.php @@ -23,7 +23,7 @@ class AddContextArtifactsAndExecutionsRequest extends \Google\Protobuf\Internal\ * * Generated from protobuf field string context = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $context = ''; + protected $context = ''; /** * The resource names of the Artifacts to attribute to the Context. * Format: diff --git a/AiPlatform/src/V1/AddContextChildrenRequest.php b/AiPlatform/src/V1/AddContextChildrenRequest.php index 07b00a1a0a65..ced1c8790978 100644 --- a/AiPlatform/src/V1/AddContextChildrenRequest.php +++ b/AiPlatform/src/V1/AddContextChildrenRequest.php @@ -23,7 +23,7 @@ class AddContextChildrenRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string context = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $context = ''; + protected $context = ''; /** * The resource names of the child Contexts. * diff --git a/AiPlatform/src/V1/AddExecutionEventsRequest.php b/AiPlatform/src/V1/AddExecutionEventsRequest.php index a5056d2aadc6..91504a57c913 100644 --- a/AiPlatform/src/V1/AddExecutionEventsRequest.php +++ b/AiPlatform/src/V1/AddExecutionEventsRequest.php @@ -24,7 +24,7 @@ class AddExecutionEventsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string execution = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $execution = ''; + protected $execution = ''; /** * The Events to create and add. * diff --git a/AiPlatform/src/V1/AddTrialMeasurementRequest.php b/AiPlatform/src/V1/AddTrialMeasurementRequest.php index 65ee3de9b43c..f2655af971ed 100644 --- a/AiPlatform/src/V1/AddTrialMeasurementRequest.php +++ b/AiPlatform/src/V1/AddTrialMeasurementRequest.php @@ -23,13 +23,13 @@ class AddTrialMeasurementRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string trial_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $trial_name = ''; + protected $trial_name = ''; /** * Required. The measurement to be added to a Trial. * * Generated from protobuf field .google.cloud.aiplatform.v1.Measurement measurement = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $measurement = null; + protected $measurement = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Annotation.php b/AiPlatform/src/V1/Annotation.php index e7c5cd6362c2..e571d303444a 100644 --- a/AiPlatform/src/V1/Annotation.php +++ b/AiPlatform/src/V1/Annotation.php @@ -21,7 +21,7 @@ class Annotation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. Google Cloud Storage URI points to a YAML file describing * [payload][google.cloud.aiplatform.v1.Annotation.payload]. The schema is @@ -34,39 +34,39 @@ class Annotation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string payload_schema_uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $payload_schema_uri = ''; + protected $payload_schema_uri = ''; /** * Required. The schema of the payload can be found in * [payload_schema][google.cloud.aiplatform.v1.Annotation.payload_schema_uri]. * * Generated from protobuf field .google.protobuf.Value payload = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $payload = null; + protected $payload = null; /** * Output only. Timestamp when this Annotation was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Annotation was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Used to perform consistent read-modify-write updates. If not set, * a blind "overwrite" update happens. * * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Output only. The source of the Annotation. * * Generated from protobuf field .google.cloud.aiplatform.v1.UserActionReference annotation_source = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $annotation_source = null; + protected $annotation_source = null; /** * Optional. The labels with user-defined metadata to organize your * Annotations. diff --git a/AiPlatform/src/V1/AnnotationSpec.php b/AiPlatform/src/V1/AnnotationSpec.php index 14a6a3e20511..07c36621fab8 100644 --- a/AiPlatform/src/V1/AnnotationSpec.php +++ b/AiPlatform/src/V1/AnnotationSpec.php @@ -20,7 +20,7 @@ class AnnotationSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-defined name of the AnnotationSpec. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -28,26 +28,26 @@ class AnnotationSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. Timestamp when this AnnotationSpec was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when AnnotationSpec was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Used to perform consistent read-modify-write updates. If not set, * a blind "overwrite" update happens. * * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/Artifact.php b/AiPlatform/src/V1/Artifact.php index 6db04b11cd63..726926e474ca 100644 --- a/AiPlatform/src/V1/Artifact.php +++ b/AiPlatform/src/V1/Artifact.php @@ -20,28 +20,28 @@ class Artifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * User provided display name of the Artifact. * May be up to 128 Unicode characters. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * The uniform resource identifier of the artifact file. * May be empty if there is no actual artifact file. * * Generated from protobuf field string uri = 6; */ - private $uri = ''; + protected $uri = ''; /** * An eTag used to perform consistent read-modify-write updates. If not set, a * blind "overwrite" update happens. * * Generated from protobuf field string etag = 9; */ - private $etag = ''; + protected $etag = ''; /** * The labels with user-defined metadata to organize your Artifacts. * Label keys and values can be no longer than 64 characters @@ -58,13 +58,13 @@ class Artifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Artifact was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The state of this Artifact. This is a property of the Artifact, and does * not imply or capture any ongoing process. This property is managed by @@ -73,7 +73,7 @@ class Artifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Artifact.State state = 13; */ - private $state = 0; + protected $state = 0; /** * The title of the schema describing the metadata. * Schema title and version is expected to be registered in earlier Create @@ -82,7 +82,7 @@ class Artifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema_title = 14; */ - private $schema_title = ''; + protected $schema_title = ''; /** * The version of the schema in schema_name to use. * Schema title and version is expected to be registered in earlier Create @@ -91,7 +91,7 @@ class Artifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema_version = 15; */ - private $schema_version = ''; + protected $schema_version = ''; /** * Properties of the Artifact. * Top level metadata keys' heading and trailing spaces will be trimmed. @@ -99,13 +99,13 @@ class Artifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Struct metadata = 16; */ - private $metadata = null; + protected $metadata = null; /** * Description of the Artifact * * Generated from protobuf field string description = 17; */ - private $description = ''; + protected $description = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/AssignNotebookRuntimeOperationMetadata.php b/AiPlatform/src/V1/AssignNotebookRuntimeOperationMetadata.php index 77318886a842..72e3b6bf3dc6 100644 --- a/AiPlatform/src/V1/AssignNotebookRuntimeOperationMetadata.php +++ b/AiPlatform/src/V1/AssignNotebookRuntimeOperationMetadata.php @@ -21,14 +21,14 @@ class AssignNotebookRuntimeOperationMetadata extends \Google\Protobuf\Internal\M * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * A human-readable message that shows the intermediate progress details of * NotebookRuntime. * * Generated from protobuf field string progress_message = 2; */ - private $progress_message = ''; + protected $progress_message = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/AssignNotebookRuntimeRequest.php b/AiPlatform/src/V1/AssignNotebookRuntimeRequest.php index 85624f69347d..c8ea820e441c 100644 --- a/AiPlatform/src/V1/AssignNotebookRuntimeRequest.php +++ b/AiPlatform/src/V1/AssignNotebookRuntimeRequest.php @@ -22,27 +22,27 @@ class AssignNotebookRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The resource name of the NotebookRuntimeTemplate based on which a * NotebookRuntime will be assigned (reuse or create a new one). * * Generated from protobuf field string notebook_runtime_template = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $notebook_runtime_template = ''; + protected $notebook_runtime_template = ''; /** * Required. Provide runtime specific information (e.g. runtime owner, * notebook id) used for NotebookRuntime assignment. * * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntime notebook_runtime = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $notebook_runtime = null; + protected $notebook_runtime = null; /** * Optional. User specified ID for the notebook runtime. * * Generated from protobuf field string notebook_runtime_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $notebook_runtime_id = ''; + protected $notebook_runtime_id = ''; /** * @param string $parent Required. The resource name of the Location to get the NotebookRuntime diff --git a/AiPlatform/src/V1/Attribution.php b/AiPlatform/src/V1/Attribution.php index 841878f65e30..457be211bfdd 100644 --- a/AiPlatform/src/V1/Attribution.php +++ b/AiPlatform/src/V1/Attribution.php @@ -28,7 +28,7 @@ class Attribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double baseline_output_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $baseline_output_value = 0.0; + protected $baseline_output_value = 0.0; /** * Output only. Model predicted output on the corresponding [explanation * instance][ExplainRequest.instances]. The field name of the output is @@ -40,7 +40,7 @@ class Attribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double instance_output_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $instance_output_value = 0.0; + protected $instance_output_value = 0.0; /** * Output only. Attributions of each explained feature. Features are extracted * from the [prediction @@ -71,7 +71,7 @@ class Attribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $feature_attributions = null; + protected $feature_attributions = null; /** * Output only. The index that locates the explained prediction output. * If the prediction output is a scalar value, output_index is not populated. @@ -94,7 +94,7 @@ class Attribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $output_display_name = ''; + protected $output_display_name = ''; /** * Output only. Error of * [feature_attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions] @@ -115,19 +115,19 @@ class Attribution extends \Google\Protobuf\Internal\Message * increasing * [step_count][google.cloud.aiplatform.v1.XraiAttribution.step_count] might * reduce the error. - * See [this introduction](https://cloud.google.com/vertex-ai/docs/explainable-ai/overview) + * See [this introduction](/vertex-ai/docs/explainable-ai/overview) * for more information. * * Generated from protobuf field double approximation_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $approximation_error = 0.0; + protected $approximation_error = 0.0; /** * Output only. Name of the explain output. Specified as the key in * [ExplanationMetadata.outputs][google.cloud.aiplatform.v1.ExplanationMetadata.outputs]. * * Generated from protobuf field string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $output_name = ''; + protected $output_name = ''; /** * Constructor. @@ -215,7 +215,7 @@ class Attribution extends \Google\Protobuf\Internal\Message * increasing * [step_count][google.cloud.aiplatform.v1.XraiAttribution.step_count] might * reduce the error. - * See [this introduction](https://cloud.google.com/vertex-ai/docs/explainable-ai/overview) + * See [this introduction](/vertex-ai/docs/explainable-ai/overview) * for more information. * @type string $output_name * Output only. Name of the explain output. Specified as the key in @@ -487,7 +487,7 @@ public function setOutputDisplayName($var) * increasing * [step_count][google.cloud.aiplatform.v1.XraiAttribution.step_count] might * reduce the error. - * See [this introduction](https://cloud.google.com/vertex-ai/docs/explainable-ai/overview) + * See [this introduction](/vertex-ai/docs/explainable-ai/overview) * for more information. * * Generated from protobuf field double approximation_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -518,7 +518,7 @@ public function getApproximationError() * increasing * [step_count][google.cloud.aiplatform.v1.XraiAttribution.step_count] might * reduce the error. - * See [this introduction](https://cloud.google.com/vertex-ai/docs/explainable-ai/overview) + * See [this introduction](/vertex-ai/docs/explainable-ai/overview) * for more information. * * Generated from protobuf field double approximation_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/AiPlatform/src/V1/AutomaticResources.php b/AiPlatform/src/V1/AutomaticResources.php index e67e3d9844f8..19a15f9d5eb8 100644 --- a/AiPlatform/src/V1/AutomaticResources.php +++ b/AiPlatform/src/V1/AutomaticResources.php @@ -27,7 +27,7 @@ class AutomaticResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 min_replica_count = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $min_replica_count = 0; + protected $min_replica_count = 0; /** * Immutable. The maximum number of replicas this DeployedModel may be * deployed on when the traffic against it increases. If the requested value @@ -41,7 +41,7 @@ class AutomaticResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 max_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $max_replica_count = 0; + protected $max_replica_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/AutoscalingMetricSpec.php b/AiPlatform/src/V1/AutoscalingMetricSpec.php index 0d42cb702e6a..68f5244c7a41 100644 --- a/AiPlatform/src/V1/AutoscalingMetricSpec.php +++ b/AiPlatform/src/V1/AutoscalingMetricSpec.php @@ -26,7 +26,7 @@ class AutoscalingMetricSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $metric_name = ''; + protected $metric_name = ''; /** * The target resource utilization in percentage (1% - 100%) for the given * metric; once the real usage deviates from the target by a certain @@ -35,7 +35,7 @@ class AutoscalingMetricSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 target = 2; */ - private $target = 0; + protected $target = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/AvroSource.php b/AiPlatform/src/V1/AvroSource.php index cde30965be5b..b0558cc5b603 100644 --- a/AiPlatform/src/V1/AvroSource.php +++ b/AiPlatform/src/V1/AvroSource.php @@ -20,7 +20,7 @@ class AvroSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $gcs_source = null; + protected $gcs_source = null; /** * Constructor. diff --git a/AiPlatform/src/V1/BatchCancelPipelineJobsOperationMetadata.php b/AiPlatform/src/V1/BatchCancelPipelineJobsOperationMetadata.php index 2ec27e5e0f56..6311dfc7eb40 100644 --- a/AiPlatform/src/V1/BatchCancelPipelineJobsOperationMetadata.php +++ b/AiPlatform/src/V1/BatchCancelPipelineJobsOperationMetadata.php @@ -21,7 +21,7 @@ class BatchCancelPipelineJobsOperationMetadata extends \Google\Protobuf\Internal * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/BatchCancelPipelineJobsRequest.php b/AiPlatform/src/V1/BatchCancelPipelineJobsRequest.php index 9d016518eaec..ace5b89bb75f 100644 --- a/AiPlatform/src/V1/BatchCancelPipelineJobsRequest.php +++ b/AiPlatform/src/V1/BatchCancelPipelineJobsRequest.php @@ -22,7 +22,7 @@ class BatchCancelPipelineJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The names of the PipelineJobs to cancel. * A maximum of 32 PipelineJobs can be cancelled in a batch. diff --git a/AiPlatform/src/V1/BatchCreateFeaturesOperationMetadata.php b/AiPlatform/src/V1/BatchCreateFeaturesOperationMetadata.php index 18a0c4a6ebbb..6dabff519c11 100644 --- a/AiPlatform/src/V1/BatchCreateFeaturesOperationMetadata.php +++ b/AiPlatform/src/V1/BatchCreateFeaturesOperationMetadata.php @@ -20,7 +20,7 @@ class BatchCreateFeaturesOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/BatchCreateFeaturesRequest.php b/AiPlatform/src/V1/BatchCreateFeaturesRequest.php index 5ff9f33b43f9..f2115669730b 100644 --- a/AiPlatform/src/V1/BatchCreateFeaturesRequest.php +++ b/AiPlatform/src/V1/BatchCreateFeaturesRequest.php @@ -23,7 +23,7 @@ class BatchCreateFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The request message specifying the Features to create. All * Features must be created under the same parent EntityType. The `parent` diff --git a/AiPlatform/src/V1/BatchCreateTensorboardRunsRequest.php b/AiPlatform/src/V1/BatchCreateTensorboardRunsRequest.php index 745382d56184..ea8f9e456276 100644 --- a/AiPlatform/src/V1/BatchCreateTensorboardRunsRequest.php +++ b/AiPlatform/src/V1/BatchCreateTensorboardRunsRequest.php @@ -25,7 +25,7 @@ class BatchCreateTensorboardRunsRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The request message specifying the TensorboardRuns to create. * A maximum of 1000 TensorboardRuns can be created in a batch. diff --git a/AiPlatform/src/V1/BatchCreateTensorboardTimeSeriesRequest.php b/AiPlatform/src/V1/BatchCreateTensorboardTimeSeriesRequest.php index 221f90e0db8a..4a4baef7fbe0 100644 --- a/AiPlatform/src/V1/BatchCreateTensorboardTimeSeriesRequest.php +++ b/AiPlatform/src/V1/BatchCreateTensorboardTimeSeriesRequest.php @@ -27,7 +27,7 @@ class BatchCreateTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\ * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The request message specifying the TensorboardTimeSeries to * create. A maximum of 1000 TensorboardTimeSeries can be created in a batch. diff --git a/AiPlatform/src/V1/BatchDedicatedResources.php b/AiPlatform/src/V1/BatchDedicatedResources.php index 866516f86726..ba3d80f6f880 100644 --- a/AiPlatform/src/V1/BatchDedicatedResources.php +++ b/AiPlatform/src/V1/BatchDedicatedResources.php @@ -21,7 +21,7 @@ class BatchDedicatedResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $machine_spec = null; + protected $machine_spec = null; /** * Immutable. The number of machine replicas used at the start of the batch * operation. If not set, Vertex AI decides starting number, not greater than @@ -29,14 +29,14 @@ class BatchDedicatedResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 starting_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $starting_replica_count = 0; + protected $starting_replica_count = 0; /** * Immutable. The maximum number of machine replicas the batch operation may * be scaled to. The default value is 10. * * Generated from protobuf field int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $max_replica_count = 0; + protected $max_replica_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/BatchDeletePipelineJobsRequest.php b/AiPlatform/src/V1/BatchDeletePipelineJobsRequest.php index 8d1030a333cb..d3e697f9a6b3 100644 --- a/AiPlatform/src/V1/BatchDeletePipelineJobsRequest.php +++ b/AiPlatform/src/V1/BatchDeletePipelineJobsRequest.php @@ -22,7 +22,7 @@ class BatchDeletePipelineJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The names of the PipelineJobs to delete. * A maximum of 32 PipelineJobs can be deleted in a batch. diff --git a/AiPlatform/src/V1/BatchImportEvaluatedAnnotationsRequest.php b/AiPlatform/src/V1/BatchImportEvaluatedAnnotationsRequest.php index e9b8a358859f..e300b7710e16 100644 --- a/AiPlatform/src/V1/BatchImportEvaluatedAnnotationsRequest.php +++ b/AiPlatform/src/V1/BatchImportEvaluatedAnnotationsRequest.php @@ -23,7 +23,7 @@ class BatchImportEvaluatedAnnotationsRequest extends \Google\Protobuf\Internal\M * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Evaluated annotations resource to be imported. * diff --git a/AiPlatform/src/V1/BatchImportEvaluatedAnnotationsResponse.php b/AiPlatform/src/V1/BatchImportEvaluatedAnnotationsResponse.php index b7e21ae9d604..b38ba54de607 100644 --- a/AiPlatform/src/V1/BatchImportEvaluatedAnnotationsResponse.php +++ b/AiPlatform/src/V1/BatchImportEvaluatedAnnotationsResponse.php @@ -21,7 +21,7 @@ class BatchImportEvaluatedAnnotationsResponse extends \Google\Protobuf\Internal\ * * Generated from protobuf field int32 imported_evaluated_annotations_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $imported_evaluated_annotations_count = 0; + protected $imported_evaluated_annotations_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/BatchImportModelEvaluationSlicesRequest.php b/AiPlatform/src/V1/BatchImportModelEvaluationSlicesRequest.php index 9f075ba6d72e..a9498d04017e 100644 --- a/AiPlatform/src/V1/BatchImportModelEvaluationSlicesRequest.php +++ b/AiPlatform/src/V1/BatchImportModelEvaluationSlicesRequest.php @@ -23,7 +23,7 @@ class BatchImportModelEvaluationSlicesRequest extends \Google\Protobuf\Internal\ * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Model evaluation slice resource to be imported. * diff --git a/AiPlatform/src/V1/BatchMigrateResourcesOperationMetadata.php b/AiPlatform/src/V1/BatchMigrateResourcesOperationMetadata.php index 8d5445bea22c..c0566f257330 100644 --- a/AiPlatform/src/V1/BatchMigrateResourcesOperationMetadata.php +++ b/AiPlatform/src/V1/BatchMigrateResourcesOperationMetadata.php @@ -21,7 +21,7 @@ class BatchMigrateResourcesOperationMetadata extends \Google\Protobuf\Internal\M * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Partial results that reflect the latest migration operation progress. * diff --git a/AiPlatform/src/V1/BatchMigrateResourcesOperationMetadata/PartialResult.php b/AiPlatform/src/V1/BatchMigrateResourcesOperationMetadata/PartialResult.php index b7f919a85ffa..92b74b262b78 100644 --- a/AiPlatform/src/V1/BatchMigrateResourcesOperationMetadata/PartialResult.php +++ b/AiPlatform/src/V1/BatchMigrateResourcesOperationMetadata/PartialResult.php @@ -22,7 +22,7 @@ class PartialResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.MigrateResourceRequest request = 1; */ - private $request = null; + protected $request = null; protected $result; /** diff --git a/AiPlatform/src/V1/BatchMigrateResourcesRequest.php b/AiPlatform/src/V1/BatchMigrateResourcesRequest.php index e0097199bc6c..c58534bdd59d 100644 --- a/AiPlatform/src/V1/BatchMigrateResourcesRequest.php +++ b/AiPlatform/src/V1/BatchMigrateResourcesRequest.php @@ -22,7 +22,7 @@ class BatchMigrateResourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The request messages specifying the resources to migrate. * They must be in the same location as the destination. diff --git a/AiPlatform/src/V1/BatchPredictionJob.php b/AiPlatform/src/V1/BatchPredictionJob.php index d7febb009361..3c43ceb23356 100644 --- a/AiPlatform/src/V1/BatchPredictionJob.php +++ b/AiPlatform/src/V1/BatchPredictionJob.php @@ -25,13 +25,13 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-defined name of this BatchPredictionJob. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * The name of the Model resource that produces the predictions via this job, * must share the same ancestor Location. @@ -51,14 +51,14 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 3 [(.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * Output only. The version ID of the Model that produces the predictions via * this job. * * Generated from protobuf field string model_version_id = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $model_version_id = ''; + protected $model_version_id = ''; /** * Contains model information necessary to perform batch prediction without * requiring uploading to model registry. @@ -66,7 +66,7 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.UnmanagedContainerModel unmanaged_container_model = 28; */ - private $unmanaged_container_model = null; + protected $unmanaged_container_model = null; /** * Required. Input configuration of the instances on which predictions are * performed. The schema of any single instance may be specified via the @@ -76,14 +76,14 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig input_config = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $input_config = null; + protected $input_config = null; /** * Configuration for how to convert batch prediction input instances to the * prediction instances that are sent to the Model. * * Generated from protobuf field .google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig instance_config = 27; */ - private $instance_config = null; + protected $instance_config = null; /** * The parameters that govern the predictions. The schema of the parameters * may be specified via the @@ -93,7 +93,7 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value model_parameters = 5; */ - private $model_parameters = null; + protected $model_parameters = null; /** * Required. The Configuration specifying where output predictions should * be written. @@ -106,7 +106,7 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig output_config = 6 [(.google.api.field_behavior) = REQUIRED]; */ - private $output_config = null; + protected $output_config = null; /** * The config of resources used by the Model during the batch prediction. If * the Model @@ -117,7 +117,7 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.BatchDedicatedResources dedicated_resources = 7; */ - private $dedicated_resources = null; + protected $dedicated_resources = null; /** * The service account that the DeployedModel's container runs as. If not * specified, a system generated one will be used, which @@ -128,7 +128,7 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 29; */ - private $service_account = ''; + protected $service_account = ''; /** * Immutable. Parameters configuring the batch behavior. Currently only * applicable when @@ -137,7 +137,7 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ManualBatchTuningParameters manual_batch_tuning_parameters = 8 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $manual_batch_tuning_parameters = null; + protected $manual_batch_tuning_parameters = null; /** * Generate explanation with the batch prediction results. * When set to `true`, the batch prediction output changes based on the @@ -160,7 +160,7 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool generate_explanation = 23; */ - private $generate_explanation = false; + protected $generate_explanation = false; /** * Explanation configuration for this BatchPredictionJob. Can be * specified only if @@ -178,26 +178,26 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationSpec explanation_spec = 25; */ - private $explanation_spec = null; + protected $explanation_spec = null; /** * Output only. Information further describing the output of this job. * * Generated from protobuf field .google.cloud.aiplatform.v1.BatchPredictionJob.OutputInfo output_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $output_info = null; + protected $output_info = null; /** * Output only. The detailed state of the job. * * Generated from protobuf field .google.cloud.aiplatform.v1.JobState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Only populated when the job's state is JOB_STATE_FAILED or * JOB_STATE_CANCELLED. * * Generated from protobuf field .google.rpc.Status error = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Output only. Partial failures encountered. * For example, single files that can't be read. @@ -216,39 +216,39 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ResourcesConsumed resources_consumed = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $resources_consumed = null; + protected $resources_consumed = null; /** * Output only. Statistics on completed and failed prediction instances. * * Generated from protobuf field .google.cloud.aiplatform.v1.CompletionStats completion_stats = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $completion_stats = null; + protected $completion_stats = null; /** * Output only. Time when the BatchPredictionJob was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time when the BatchPredictionJob for the first time entered * the `JOB_STATE_RUNNING` state. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time when the BatchPredictionJob entered any of the following * states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Time when the BatchPredictionJob was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The labels with user-defined metadata to organize BatchPredictionJobs. * Label keys and values can be no longer than 64 characters @@ -266,7 +266,7 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 24; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * For custom-trained Models and AutoML Tabular Models, the container of the * DeployedModel instances will send `stderr` and `stdout` streams to @@ -277,7 +277,7 @@ class BatchPredictionJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_container_logging = 34; */ - private $disable_container_logging = false; + protected $disable_container_logging = false; /** * Constructor. diff --git a/AiPlatform/src/V1/BatchPredictionJob/InputConfig.php b/AiPlatform/src/V1/BatchPredictionJob/InputConfig.php index f210bdd1910e..4885036c77ec 100644 --- a/AiPlatform/src/V1/BatchPredictionJob/InputConfig.php +++ b/AiPlatform/src/V1/BatchPredictionJob/InputConfig.php @@ -26,7 +26,7 @@ class InputConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string instances_format = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $instances_format = ''; + protected $instances_format = ''; protected $source; /** diff --git a/AiPlatform/src/V1/BatchPredictionJob/InstanceConfig.php b/AiPlatform/src/V1/BatchPredictionJob/InstanceConfig.php index f2411be6b90f..1710f6b9fd3e 100644 --- a/AiPlatform/src/V1/BatchPredictionJob/InstanceConfig.php +++ b/AiPlatform/src/V1/BatchPredictionJob/InstanceConfig.php @@ -57,7 +57,7 @@ class InstanceConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string instance_type = 1; */ - private $instance_type = ''; + protected $instance_type = ''; /** * The name of the field that is considered as a key. * The values identified by the key field is not included in the transformed @@ -76,7 +76,7 @@ class InstanceConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key_field = 2; */ - private $key_field = ''; + protected $key_field = ''; /** * Fields that will be included in the prediction instance that is * sent to the Model. diff --git a/AiPlatform/src/V1/BatchPredictionJob/OutputConfig.php b/AiPlatform/src/V1/BatchPredictionJob/OutputConfig.php index 550659bf09fb..dcbebfa074d9 100644 --- a/AiPlatform/src/V1/BatchPredictionJob/OutputConfig.php +++ b/AiPlatform/src/V1/BatchPredictionJob/OutputConfig.php @@ -26,7 +26,7 @@ class OutputConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string predictions_format = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $predictions_format = ''; + protected $predictions_format = ''; protected $destination; /** diff --git a/AiPlatform/src/V1/BatchPredictionJob/OutputInfo.php b/AiPlatform/src/V1/BatchPredictionJob/OutputInfo.php index b62dcd6102e4..387910e4004c 100644 --- a/AiPlatform/src/V1/BatchPredictionJob/OutputInfo.php +++ b/AiPlatform/src/V1/BatchPredictionJob/OutputInfo.php @@ -25,7 +25,7 @@ class OutputInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string bigquery_output_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $bigquery_output_table = ''; + protected $bigquery_output_table = ''; protected $output_location; /** diff --git a/AiPlatform/src/V1/BatchReadFeatureValuesOperationMetadata.php b/AiPlatform/src/V1/BatchReadFeatureValuesOperationMetadata.php index 957f2ec81474..1514117ac054 100644 --- a/AiPlatform/src/V1/BatchReadFeatureValuesOperationMetadata.php +++ b/AiPlatform/src/V1/BatchReadFeatureValuesOperationMetadata.php @@ -20,7 +20,7 @@ class BatchReadFeatureValuesOperationMetadata extends \Google\Protobuf\Internal\ * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/BatchReadFeatureValuesRequest.php b/AiPlatform/src/V1/BatchReadFeatureValuesRequest.php index 19076f9e6365..ab375753fdc3 100644 --- a/AiPlatform/src/V1/BatchReadFeatureValuesRequest.php +++ b/AiPlatform/src/V1/BatchReadFeatureValuesRequest.php @@ -23,13 +23,13 @@ class BatchReadFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string featurestore = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $featurestore = ''; + protected $featurestore = ''; /** * Required. Specifies output location and format. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureValueDestination destination = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $destination = null; + protected $destination = null; /** * When not empty, the specified fields in the *_read_instances source will be * joined as-is in the output, in addition to those fields from the @@ -55,7 +55,7 @@ class BatchReadFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 11 [(.google.api.field_behavior) = OPTIONAL]; */ - private $start_time = null; + protected $start_time = null; protected $read_option; /** diff --git a/AiPlatform/src/V1/BatchReadFeatureValuesRequest/EntityTypeSpec.php b/AiPlatform/src/V1/BatchReadFeatureValuesRequest/EntityTypeSpec.php index dca55c266df8..a23c66b53fed 100644 --- a/AiPlatform/src/V1/BatchReadFeatureValuesRequest/EntityTypeSpec.php +++ b/AiPlatform/src/V1/BatchReadFeatureValuesRequest/EntityTypeSpec.php @@ -24,14 +24,14 @@ class EntityTypeSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_type_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $entity_type_id = ''; + protected $entity_type_id = ''; /** * Required. Selectors choosing which Feature values to read from the * EntityType. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureSelector feature_selector = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_selector = null; + protected $feature_selector = null; /** * Per-Feature settings for the batch read. * diff --git a/AiPlatform/src/V1/BatchReadFeatureValuesRequest/PassThroughField.php b/AiPlatform/src/V1/BatchReadFeatureValuesRequest/PassThroughField.php index 83e57998799f..068c02aeaa5a 100644 --- a/AiPlatform/src/V1/BatchReadFeatureValuesRequest/PassThroughField.php +++ b/AiPlatform/src/V1/BatchReadFeatureValuesRequest/PassThroughField.php @@ -22,7 +22,7 @@ class PassThroughField extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string field_name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $field_name = ''; + protected $field_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/BatchReadTensorboardTimeSeriesDataRequest.php b/AiPlatform/src/V1/BatchReadTensorboardTimeSeriesDataRequest.php index 4f4e4e3a2d4c..e2d1d43e92d3 100644 --- a/AiPlatform/src/V1/BatchReadTensorboardTimeSeriesDataRequest.php +++ b/AiPlatform/src/V1/BatchReadTensorboardTimeSeriesDataRequest.php @@ -26,7 +26,7 @@ class BatchReadTensorboardTimeSeriesDataRequest extends \Google\Protobuf\Interna * * Generated from protobuf field string tensorboard = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $tensorboard = ''; + protected $tensorboard = ''; /** * Required. The resource names of the TensorboardTimeSeries to read data * from. Format: diff --git a/AiPlatform/src/V1/BigQueryDestination.php b/AiPlatform/src/V1/BigQueryDestination.php index e86f4abb37a9..54f26730bb7a 100644 --- a/AiPlatform/src/V1/BigQueryDestination.php +++ b/AiPlatform/src/V1/BigQueryDestination.php @@ -27,7 +27,7 @@ class BigQueryDestination extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $output_uri = ''; + protected $output_uri = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/BigQuerySource.php b/AiPlatform/src/V1/BigQuerySource.php index c88341002a1a..21cde2f1e7fc 100644 --- a/AiPlatform/src/V1/BigQuerySource.php +++ b/AiPlatform/src/V1/BigQuerySource.php @@ -22,7 +22,7 @@ class BigQuerySource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $input_uri = ''; + protected $input_uri = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/Blob.php b/AiPlatform/src/V1/Blob.php index 13e490bfab4c..e930d980dc15 100644 --- a/AiPlatform/src/V1/Blob.php +++ b/AiPlatform/src/V1/Blob.php @@ -22,13 +22,13 @@ class Blob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $mime_type = ''; + protected $mime_type = ''; /** * Required. Raw bytes. * * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $data = ''; + protected $data = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/BlurBaselineConfig.php b/AiPlatform/src/V1/BlurBaselineConfig.php index f92a00632594..511227fc1dbd 100644 --- a/AiPlatform/src/V1/BlurBaselineConfig.php +++ b/AiPlatform/src/V1/BlurBaselineConfig.php @@ -27,7 +27,7 @@ class BlurBaselineConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float max_blur_sigma = 1; */ - private $max_blur_sigma = 0.0; + protected $max_blur_sigma = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/CancelBatchPredictionJobRequest.php b/AiPlatform/src/V1/CancelBatchPredictionJobRequest.php index e29615360207..5b0d4263f1ee 100644 --- a/AiPlatform/src/V1/CancelBatchPredictionJobRequest.php +++ b/AiPlatform/src/V1/CancelBatchPredictionJobRequest.php @@ -23,7 +23,7 @@ class CancelBatchPredictionJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the BatchPredictionJob to cancel. diff --git a/AiPlatform/src/V1/CancelCustomJobRequest.php b/AiPlatform/src/V1/CancelCustomJobRequest.php index d3d192402e96..25ee68df6bf6 100644 --- a/AiPlatform/src/V1/CancelCustomJobRequest.php +++ b/AiPlatform/src/V1/CancelCustomJobRequest.php @@ -23,7 +23,7 @@ class CancelCustomJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the CustomJob to cancel. diff --git a/AiPlatform/src/V1/CancelDataLabelingJobRequest.php b/AiPlatform/src/V1/CancelDataLabelingJobRequest.php index 79f5eaf19606..e8c568532703 100644 --- a/AiPlatform/src/V1/CancelDataLabelingJobRequest.php +++ b/AiPlatform/src/V1/CancelDataLabelingJobRequest.php @@ -23,7 +23,7 @@ class CancelDataLabelingJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the DataLabelingJob. diff --git a/AiPlatform/src/V1/CancelHyperparameterTuningJobRequest.php b/AiPlatform/src/V1/CancelHyperparameterTuningJobRequest.php index f642062ebf0e..4705d020add8 100644 --- a/AiPlatform/src/V1/CancelHyperparameterTuningJobRequest.php +++ b/AiPlatform/src/V1/CancelHyperparameterTuningJobRequest.php @@ -23,7 +23,7 @@ class CancelHyperparameterTuningJobRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the HyperparameterTuningJob to cancel. diff --git a/AiPlatform/src/V1/CancelNasJobRequest.php b/AiPlatform/src/V1/CancelNasJobRequest.php index aa809c3b32ab..f594cf23a0eb 100644 --- a/AiPlatform/src/V1/CancelNasJobRequest.php +++ b/AiPlatform/src/V1/CancelNasJobRequest.php @@ -23,7 +23,7 @@ class CancelNasJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NasJob to cancel. diff --git a/AiPlatform/src/V1/CancelPipelineJobRequest.php b/AiPlatform/src/V1/CancelPipelineJobRequest.php index 464e7ca3caf3..22cd0124a111 100644 --- a/AiPlatform/src/V1/CancelPipelineJobRequest.php +++ b/AiPlatform/src/V1/CancelPipelineJobRequest.php @@ -23,7 +23,7 @@ class CancelPipelineJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the PipelineJob to cancel. diff --git a/AiPlatform/src/V1/CancelTrainingPipelineRequest.php b/AiPlatform/src/V1/CancelTrainingPipelineRequest.php index 65d23ef5503c..2566bb7d2ba5 100644 --- a/AiPlatform/src/V1/CancelTrainingPipelineRequest.php +++ b/AiPlatform/src/V1/CancelTrainingPipelineRequest.php @@ -23,7 +23,7 @@ class CancelTrainingPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TrainingPipeline to cancel. diff --git a/AiPlatform/src/V1/CancelTuningJobRequest.php b/AiPlatform/src/V1/CancelTuningJobRequest.php index ef70fd619cf4..446445bd9371 100644 --- a/AiPlatform/src/V1/CancelTuningJobRequest.php +++ b/AiPlatform/src/V1/CancelTuningJobRequest.php @@ -22,7 +22,7 @@ class CancelTuningJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TuningJob to cancel. Format: diff --git a/AiPlatform/src/V1/Candidate.php b/AiPlatform/src/V1/Candidate.php index 6c5da00e5d90..65c4e00b517a 100644 --- a/AiPlatform/src/V1/Candidate.php +++ b/AiPlatform/src/V1/Candidate.php @@ -20,20 +20,20 @@ class Candidate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $index = 0; + protected $index = 0; /** * Output only. Content parts of the candidate. * * Generated from protobuf field .google.cloud.aiplatform.v1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $content = null; + protected $content = null; /** * Output only. The reason why the model stopped generating tokens. * If empty, the model has not stopped generating the tokens. * * Generated from protobuf field .google.cloud.aiplatform.v1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $finish_reason = 0; + protected $finish_reason = 0; /** * Output only. List of ratings for the safety of a response candidate. * There is at most one rating per category. @@ -47,19 +47,19 @@ class Candidate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $finish_message = null; + protected $finish_message = null; /** * Output only. Source attribution of the generated content. * * Generated from protobuf field .google.cloud.aiplatform.v1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $citation_metadata = null; + protected $citation_metadata = null; /** * Output only. Metadata specifies sources used to ground generated content. * * Generated from protobuf field .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $grounding_metadata = null; + protected $grounding_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CheckTrialEarlyStoppingStateMetatdata.php b/AiPlatform/src/V1/CheckTrialEarlyStoppingStateMetatdata.php index 293db41980f5..9a84e406a556 100644 --- a/AiPlatform/src/V1/CheckTrialEarlyStoppingStateMetatdata.php +++ b/AiPlatform/src/V1/CheckTrialEarlyStoppingStateMetatdata.php @@ -22,19 +22,19 @@ class CheckTrialEarlyStoppingStateMetatdata extends \Google\Protobuf\Internal\Me * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * The name of the Study that the Trial belongs to. * * Generated from protobuf field string study = 2; */ - private $study = ''; + protected $study = ''; /** * The Trial name. * * Generated from protobuf field string trial = 3; */ - private $trial = ''; + protected $trial = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/CheckTrialEarlyStoppingStateRequest.php b/AiPlatform/src/V1/CheckTrialEarlyStoppingStateRequest.php index 6ba2069913a4..c27050cd570c 100644 --- a/AiPlatform/src/V1/CheckTrialEarlyStoppingStateRequest.php +++ b/AiPlatform/src/V1/CheckTrialEarlyStoppingStateRequest.php @@ -23,7 +23,7 @@ class CheckTrialEarlyStoppingStateRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string trial_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $trial_name = ''; + protected $trial_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/CheckTrialEarlyStoppingStateResponse.php b/AiPlatform/src/V1/CheckTrialEarlyStoppingStateResponse.php index 032ebb333431..480a948c3d90 100644 --- a/AiPlatform/src/V1/CheckTrialEarlyStoppingStateResponse.php +++ b/AiPlatform/src/V1/CheckTrialEarlyStoppingStateResponse.php @@ -21,7 +21,7 @@ class CheckTrialEarlyStoppingStateResponse extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field bool should_stop = 1; */ - private $should_stop = false; + protected $should_stop = false; /** * Constructor. diff --git a/AiPlatform/src/V1/Citation.php b/AiPlatform/src/V1/Citation.php index 0ffa2191513d..7fc4c4f8df49 100644 --- a/AiPlatform/src/V1/Citation.php +++ b/AiPlatform/src/V1/Citation.php @@ -20,37 +20,37 @@ class Citation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_index = 0; + protected $start_index = 0; /** * Output only. End index into the content. * * Generated from protobuf field int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_index = 0; + protected $end_index = 0; /** * Output only. Url reference of the attribution. * * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uri = ''; + protected $uri = ''; /** * Output only. Title of the attribution. * * Generated from protobuf field string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $title = ''; + protected $title = ''; /** * Output only. License of the attribution. * * Generated from protobuf field string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $license = ''; + protected $license = ''; /** * Output only. Publication date of the attribution. * * Generated from protobuf field .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $publication_date = null; + protected $publication_date = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Client/DatasetServiceClient.php b/AiPlatform/src/V1/Client/DatasetServiceClient.php index 31acace44de4..77f9b2213f5b 100644 --- a/AiPlatform/src/V1/Client/DatasetServiceClient.php +++ b/AiPlatform/src/V1/Client/DatasetServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * annotation_spec resource. @@ -192,8 +213,12 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted annotation_spec resource. */ - public static function annotationSpecName(string $project, string $location, string $dataset, string $annotationSpec): string - { + public static function annotationSpecName( + string $project, + string $location, + string $dataset, + string $annotationSpec + ): string { return self::getPathTemplate('annotationSpec')->render([ 'project' => $project, 'location' => $location, @@ -253,8 +278,12 @@ public static function datasetName(string $project, string $location, string $da * * @return string The formatted dataset_version resource. */ - public static function datasetVersionName(string $project, string $location, string $dataset, string $datasetVersion): string - { + public static function datasetVersionName( + string $project, + string $location, + string $dataset, + string $datasetVersion + ): string { return self::getPathTemplate('datasetVersion')->render([ 'project' => $project, 'location' => $location, @@ -291,8 +320,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted saved_query resource. */ - public static function savedQueryName(string $project, string $location, string $dataset, string $savedQuery): string - { + public static function savedQueryName( + string $project, + string $location, + string $dataset, + string $savedQuery + ): string { return self::getPathTemplate('savedQuery')->render([ 'project' => $project, 'location' => $location, @@ -449,8 +482,10 @@ public function createDataset(CreateDatasetRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function createDatasetVersion(CreateDatasetVersionRequest $request, array $callOptions = []): OperationResponse - { + public function createDatasetVersion( + CreateDatasetVersionRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateDatasetVersion', $request, $callOptions)->wait(); } @@ -501,8 +536,10 @@ public function deleteDataset(DeleteDatasetRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function deleteDatasetVersion(DeleteDatasetVersionRequest $request, array $callOptions = []): OperationResponse - { + public function deleteDatasetVersion( + DeleteDatasetVersionRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteDatasetVersion', $request, $callOptions)->wait(); } @@ -813,8 +850,10 @@ public function listSavedQueries(ListSavedQueriesRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function restoreDatasetVersion(RestoreDatasetVersionRequest $request, array $callOptions = []): OperationResponse - { + public function restoreDatasetVersion( + RestoreDatasetVersionRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('RestoreDatasetVersion', $request, $callOptions)->wait(); } @@ -870,6 +909,32 @@ public function updateDataset(UpdateDatasetRequest $request, array $callOptions return $this->startApiCall('UpdateDataset', $request, $callOptions)->wait(); } + /** + * Updates a DatasetVersion. + * + * The async variant is {@see DatasetServiceClient::updateDatasetVersionAsync()} . + * + * @example samples/V1/DatasetServiceClient/update_dataset_version.php + * + * @param UpdateDatasetVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DatasetVersion + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDatasetVersion(UpdateDatasetVersionRequest $request, array $callOptions = []): DatasetVersion + { + return $this->startApiCall('UpdateDatasetVersion', $request, $callOptions)->wait(); + } + /** * Gets information about a location. * @@ -1006,8 +1071,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/DeploymentResourcePoolServiceClient.php b/AiPlatform/src/V1/Client/DeploymentResourcePoolServiceClient.php index 336ae5d76cf5..c63faeb2801d 100644 --- a/AiPlatform/src/V1/Client/DeploymentResourcePoolServiceClient.php +++ b/AiPlatform/src/V1/Client/DeploymentResourcePoolServiceClient.php @@ -1,6 +1,6 @@ [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/deployment_resource_pool_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/deployment_resource_pool_service_rest_client_config.php', ], ], ]; @@ -147,12 +146,33 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * deployment_resource_pool resource. @@ -163,8 +183,11 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted deployment_resource_pool resource. */ - public static function deploymentResourcePoolName(string $project, string $location, string $deploymentResourcePool): string - { + public static function deploymentResourcePoolName( + string $project, + string $location, + string $deploymentResourcePool + ): string { return self::getPathTemplate('deploymentResourcePool')->render([ 'project' => $project, 'location' => $location, @@ -325,8 +348,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function createDeploymentResourcePool(CreateDeploymentResourcePoolRequest $request, array $callOptions = []): OperationResponse - { + public function createDeploymentResourcePool( + CreateDeploymentResourcePoolRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateDeploymentResourcePool', $request, $callOptions)->wait(); } @@ -353,8 +378,10 @@ public function createDeploymentResourcePool(CreateDeploymentResourcePoolRequest * * @throws ApiException Thrown if the API call fails. */ - public function deleteDeploymentResourcePool(DeleteDeploymentResourcePoolRequest $request, array $callOptions = []): OperationResponse - { + public function deleteDeploymentResourcePool( + DeleteDeploymentResourcePoolRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteDeploymentResourcePool', $request, $callOptions)->wait(); } @@ -380,8 +407,10 @@ public function deleteDeploymentResourcePool(DeleteDeploymentResourcePoolRequest * * @throws ApiException Thrown if the API call fails. */ - public function getDeploymentResourcePool(GetDeploymentResourcePoolRequest $request, array $callOptions = []): DeploymentResourcePool - { + public function getDeploymentResourcePool( + GetDeploymentResourcePoolRequest $request, + array $callOptions = [] + ): DeploymentResourcePool { return $this->startApiCall('GetDeploymentResourcePool', $request, $callOptions)->wait(); } @@ -407,8 +436,10 @@ public function getDeploymentResourcePool(GetDeploymentResourcePoolRequest $requ * * @throws ApiException Thrown if the API call fails. */ - public function listDeploymentResourcePools(ListDeploymentResourcePoolsRequest $request, array $callOptions = []): PagedListResponse - { + public function listDeploymentResourcePools( + ListDeploymentResourcePoolsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListDeploymentResourcePools', $request, $callOptions); } @@ -580,8 +611,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/EndpointServiceClient.php b/AiPlatform/src/V1/Client/EndpointServiceClient.php index ddf837f81fa7..3745f6f09496 100644 --- a/AiPlatform/src/V1/Client/EndpointServiceClient.php +++ b/AiPlatform/src/V1/Client/EndpointServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * deployment_resource_pool resource. @@ -169,8 +188,11 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted deployment_resource_pool resource. */ - public static function deploymentResourcePoolName(string $project, string $location, string $deploymentResourcePool): string - { + public static function deploymentResourcePoolName( + string $project, + string $location, + string $deploymentResourcePool + ): string { return self::getPathTemplate('deploymentResourcePool')->render([ 'project' => $project, 'location' => $location, @@ -243,8 +265,11 @@ public static function modelName(string $project, string $location, string $mode * * @return string The formatted model_deployment_monitoring_job resource. */ - public static function modelDeploymentMonitoringJobName(string $project, string $location, string $modelDeploymentMonitoringJob): string - { + public static function modelDeploymentMonitoringJobName( + string $project, + string $location, + string $modelDeploymentMonitoringJob + ): string { return self::getPathTemplate('modelDeploymentMonitoringJob')->render([ 'project' => $project, 'location' => $location, @@ -299,8 +324,12 @@ public static function projectLocationEndpointName(string $project, string $loca * * @return string The formatted project_location_publisher_model resource. */ - public static function projectLocationPublisherModelName(string $project, string $location, string $publisher, string $model): string - { + public static function projectLocationPublisherModelName( + string $project, + string $location, + string $publisher, + string $model + ): string { return self::getPathTemplate('projectLocationPublisherModel')->render([ 'project' => $project, 'location' => $location, @@ -760,8 +789,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/FeatureOnlineStoreAdminServiceClient.php b/AiPlatform/src/V1/Client/FeatureOnlineStoreAdminServiceClient.php index c265b4ee04d9..229d9b445503 100644 --- a/AiPlatform/src/V1/Client/FeatureOnlineStoreAdminServiceClient.php +++ b/AiPlatform/src/V1/Client/FeatureOnlineStoreAdminServiceClient.php @@ -1,6 +1,6 @@ self::SERVICE_NAME, 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, 'clientConfig' => __DIR__ . '/../resources/feature_online_store_admin_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/feature_online_store_admin_service_descriptor_config.php', + 'descriptorsConfigPath' => + __DIR__ . '/../resources/feature_online_store_admin_service_descriptor_config.php', 'gcpApiConfigPath' => __DIR__ . '/../resources/feature_online_store_admin_service_grpc_config.json', 'credentialsConfig' => [ 'defaultScopes' => self::$serviceScopes, ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/feature_online_store_admin_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/feature_online_store_admin_service_rest_client_config.php', ], ], ]; @@ -167,12 +167,33 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * feature_online_store resource. @@ -203,8 +224,12 @@ public static function featureOnlineStoreName(string $project, string $location, * * @return string The formatted feature_view resource. */ - public static function featureViewName(string $project, string $location, string $featureOnlineStore, string $featureView): string - { + public static function featureViewName( + string $project, + string $location, + string $featureOnlineStore, + string $featureView + ): string { return self::getPathTemplate('featureView')->render([ 'project' => $project, 'location' => $location, @@ -224,8 +249,12 @@ public static function featureViewName(string $project, string $location, string * * @return string The formatted feature_view_sync resource. */ - public static function featureViewSyncName(string $project, string $location, string $featureOnlineStore, string $featureView): string - { + public static function featureViewSyncName( + string $project, + string $location, + string $featureOnlineStore, + string $featureView + ): string { return self::getPathTemplate('featureViewSync')->render([ 'project' => $project, 'location' => $location, @@ -372,8 +401,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function createFeatureOnlineStore(CreateFeatureOnlineStoreRequest $request, array $callOptions = []): OperationResponse - { + public function createFeatureOnlineStore( + CreateFeatureOnlineStoreRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateFeatureOnlineStore', $request, $callOptions)->wait(); } @@ -427,8 +458,10 @@ public function createFeatureView(CreateFeatureViewRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function deleteFeatureOnlineStore(DeleteFeatureOnlineStoreRequest $request, array $callOptions = []): OperationResponse - { + public function deleteFeatureOnlineStore( + DeleteFeatureOnlineStoreRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteFeatureOnlineStore', $request, $callOptions)->wait(); } @@ -481,8 +514,10 @@ public function deleteFeatureView(DeleteFeatureViewRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function getFeatureOnlineStore(GetFeatureOnlineStoreRequest $request, array $callOptions = []): FeatureOnlineStore - { + public function getFeatureOnlineStore( + GetFeatureOnlineStoreRequest $request, + array $callOptions = [] + ): FeatureOnlineStore { return $this->startApiCall('GetFeatureOnlineStore', $request, $callOptions)->wait(); } @@ -562,8 +597,10 @@ public function getFeatureViewSync(GetFeatureViewSyncRequest $request, array $ca * * @throws ApiException Thrown if the API call fails. */ - public function listFeatureOnlineStores(ListFeatureOnlineStoresRequest $request, array $callOptions = []): PagedListResponse - { + public function listFeatureOnlineStores( + ListFeatureOnlineStoresRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListFeatureOnlineStores', $request, $callOptions); } @@ -589,8 +626,10 @@ public function listFeatureOnlineStores(ListFeatureOnlineStoresRequest $request, * * @throws ApiException Thrown if the API call fails. */ - public function listFeatureViewSyncs(ListFeatureViewSyncsRequest $request, array $callOptions = []): PagedListResponse - { + public function listFeatureViewSyncs( + ListFeatureViewSyncsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListFeatureViewSyncs', $request, $callOptions); } @@ -670,8 +709,10 @@ public function syncFeatureView(SyncFeatureViewRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function updateFeatureOnlineStore(UpdateFeatureOnlineStoreRequest $request, array $callOptions = []): OperationResponse - { + public function updateFeatureOnlineStore( + UpdateFeatureOnlineStoreRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateFeatureOnlineStore', $request, $callOptions)->wait(); } @@ -843,8 +884,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/FeatureOnlineStoreServiceClient.php b/AiPlatform/src/V1/Client/FeatureOnlineStoreServiceClient.php index fc1eeba27c46..500d0fddeeb6 100644 --- a/AiPlatform/src/V1/Client/FeatureOnlineStoreServiceClient.php +++ b/AiPlatform/src/V1/Client/FeatureOnlineStoreServiceClient.php @@ -1,6 +1,6 @@ [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/feature_online_store_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/feature_online_store_service_rest_client_config.php', ], ], ]; @@ -125,8 +124,12 @@ private static function getClientDefaults() * * @return string The formatted feature_view resource. */ - public static function featureViewName(string $project, string $location, string $featureOnlineStore, string $featureView): string - { + public static function featureViewName( + string $project, + string $location, + string $featureOnlineStore, + string $featureView + ): string { return self::getPathTemplate('featureView')->render([ 'project' => $project, 'location' => $location, @@ -252,8 +255,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function fetchFeatureValues(FetchFeatureValuesRequest $request, array $callOptions = []): FetchFeatureValuesResponse - { + public function fetchFeatureValues( + FetchFeatureValuesRequest $request, + array $callOptions = [] + ): FetchFeatureValuesResponse { return $this->startApiCall('FetchFeatureValues', $request, $callOptions)->wait(); } @@ -281,8 +286,10 @@ public function fetchFeatureValues(FetchFeatureValuesRequest $request, array $ca * * @throws ApiException Thrown if the API call fails. */ - public function searchNearestEntities(SearchNearestEntitiesRequest $request, array $callOptions = []): SearchNearestEntitiesResponse - { + public function searchNearestEntities( + SearchNearestEntitiesRequest $request, + array $callOptions = [] + ): SearchNearestEntitiesResponse { return $this->startApiCall('SearchNearestEntities', $request, $callOptions)->wait(); } @@ -427,8 +434,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/FeatureRegistryServiceClient.php b/AiPlatform/src/V1/Client/FeatureRegistryServiceClient.php index 091f0b57e812..3fce584de365 100644 --- a/AiPlatform/src/V1/Client/FeatureRegistryServiceClient.php +++ b/AiPlatform/src/V1/Client/FeatureRegistryServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a entity_type * resource. @@ -176,8 +195,12 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted entity_type resource. */ - public static function entityTypeName(string $project, string $location, string $featurestore, string $entityType): string - { + public static function entityTypeName( + string $project, + string $location, + string $featurestore, + string $entityType + ): string { return self::getPathTemplate('entityType')->render([ 'project' => $project, 'location' => $location, @@ -198,8 +221,13 @@ public static function entityTypeName(string $project, string $location, string * * @return string The formatted feature resource. */ - public static function featureName(string $project, string $location, string $featurestore, string $entityType, string $feature): string - { + public static function featureName( + string $project, + string $location, + string $featurestore, + string $entityType, + string $feature + ): string { return self::getPathTemplate('feature')->render([ 'project' => $project, 'location' => $location, @@ -256,8 +284,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted project_location_feature_group_feature resource. */ - public static function projectLocationFeatureGroupFeatureName(string $project, string $location, string $featureGroup, string $feature): string - { + public static function projectLocationFeatureGroupFeatureName( + string $project, + string $location, + string $featureGroup, + string $feature + ): string { return self::getPathTemplate('projectLocationFeatureGroupFeature')->render([ 'project' => $project, 'location' => $location, @@ -278,8 +310,13 @@ public static function projectLocationFeatureGroupFeatureName(string $project, s * * @return string The formatted project_location_featurestore_entity_type_feature resource. */ - public static function projectLocationFeaturestoreEntityTypeFeatureName(string $project, string $location, string $featurestore, string $entityType, string $feature): string - { + public static function projectLocationFeaturestoreEntityTypeFeatureName( + string $project, + string $location, + string $featurestore, + string $entityType, + string $feature + ): string { return self::getPathTemplate('projectLocationFeaturestoreEntityTypeFeature')->render([ 'project' => $project, 'location' => $location, @@ -792,8 +829,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/FeaturestoreOnlineServingServiceClient.php b/AiPlatform/src/V1/Client/FeaturestoreOnlineServingServiceClient.php index 9441f86dae93..9093868c0b76 100644 --- a/AiPlatform/src/V1/Client/FeaturestoreOnlineServingServiceClient.php +++ b/AiPlatform/src/V1/Client/FeaturestoreOnlineServingServiceClient.php @@ -1,6 +1,6 @@ self::SERVICE_NAME, 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, 'clientConfig' => __DIR__ . '/../resources/featurestore_online_serving_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/featurestore_online_serving_service_descriptor_config.php', + 'descriptorsConfigPath' => + __DIR__ . '/../resources/featurestore_online_serving_service_descriptor_config.php', 'gcpApiConfigPath' => __DIR__ . '/../resources/featurestore_online_serving_service_grpc_config.json', 'credentialsConfig' => [ 'defaultScopes' => self::$serviceScopes, ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/featurestore_online_serving_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/featurestore_online_serving_service_rest_client_config.php', ], ], ]; @@ -127,8 +127,12 @@ private static function getClientDefaults() * * @return string The formatted entity_type resource. */ - public static function entityTypeName(string $project, string $location, string $featurestore, string $entityType): string - { + public static function entityTypeName( + string $project, + string $location, + string $featurestore, + string $entityType + ): string { return self::getPathTemplate('entityType')->render([ 'project' => $project, 'location' => $location, @@ -256,8 +260,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function readFeatureValues(ReadFeatureValuesRequest $request, array $callOptions = []): ReadFeatureValuesResponse - { + public function readFeatureValues( + ReadFeatureValuesRequest $request, + array $callOptions = [] + ): ReadFeatureValuesResponse { return $this->startApiCall('ReadFeatureValues', $request, $callOptions)->wait(); } @@ -280,8 +286,10 @@ public function readFeatureValues(ReadFeatureValuesRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function streamingReadFeatureValues(StreamingReadFeatureValuesRequest $request, array $callOptions = []): ServerStream - { + public function streamingReadFeatureValues( + StreamingReadFeatureValuesRequest $request, + array $callOptions = [] + ): ServerStream { return $this->startApiCall('StreamingReadFeatureValues', $request, $callOptions); } @@ -311,8 +319,10 @@ public function streamingReadFeatureValues(StreamingReadFeatureValuesRequest $re * * @throws ApiException Thrown if the API call fails. */ - public function writeFeatureValues(WriteFeatureValuesRequest $request, array $callOptions = []): WriteFeatureValuesResponse - { + public function writeFeatureValues( + WriteFeatureValuesRequest $request, + array $callOptions = [] + ): WriteFeatureValuesResponse { return $this->startApiCall('WriteFeatureValues', $request, $callOptions)->wait(); } @@ -457,8 +467,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/FeaturestoreServiceClient.php b/AiPlatform/src/V1/Client/FeaturestoreServiceClient.php index c623bbb3673b..e09cb7bd6c86 100644 --- a/AiPlatform/src/V1/Client/FeaturestoreServiceClient.php +++ b/AiPlatform/src/V1/Client/FeaturestoreServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a entity_type * resource. @@ -198,8 +217,12 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted entity_type resource. */ - public static function entityTypeName(string $project, string $location, string $featurestore, string $entityType): string - { + public static function entityTypeName( + string $project, + string $location, + string $featurestore, + string $entityType + ): string { return self::getPathTemplate('entityType')->render([ 'project' => $project, 'location' => $location, @@ -220,8 +243,13 @@ public static function entityTypeName(string $project, string $location, string * * @return string The formatted feature resource. */ - public static function featureName(string $project, string $location, string $featurestore, string $entityType, string $feature): string - { + public static function featureName( + string $project, + string $location, + string $featurestore, + string $entityType, + string $feature + ): string { return self::getPathTemplate('feature')->render([ 'project' => $project, 'location' => $location, @@ -297,8 +325,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted project_location_feature_group_feature resource. */ - public static function projectLocationFeatureGroupFeatureName(string $project, string $location, string $featureGroup, string $feature): string - { + public static function projectLocationFeatureGroupFeatureName( + string $project, + string $location, + string $featureGroup, + string $feature + ): string { return self::getPathTemplate('projectLocationFeatureGroupFeature')->render([ 'project' => $project, 'location' => $location, @@ -319,8 +351,13 @@ public static function projectLocationFeatureGroupFeatureName(string $project, s * * @return string The formatted project_location_featurestore_entity_type_feature resource. */ - public static function projectLocationFeaturestoreEntityTypeFeatureName(string $project, string $location, string $featurestore, string $entityType, string $feature): string - { + public static function projectLocationFeaturestoreEntityTypeFeatureName( + string $project, + string $location, + string $featurestore, + string $entityType, + string $feature + ): string { return self::getPathTemplate('projectLocationFeaturestoreEntityTypeFeature')->render([ 'project' => $project, 'location' => $location, @@ -486,8 +523,10 @@ public function batchCreateFeatures(BatchCreateFeaturesRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function batchReadFeatureValues(BatchReadFeatureValuesRequest $request, array $callOptions = []): OperationResponse - { + public function batchReadFeatureValues( + BatchReadFeatureValuesRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('BatchReadFeatureValues', $request, $callOptions)->wait(); } @@ -1159,8 +1198,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/GenAiTuningServiceClient.php b/AiPlatform/src/V1/Client/GenAiTuningServiceClient.php index 0e81920e7181..7386de0b23ee 100644 --- a/AiPlatform/src/V1/Client/GenAiTuningServiceClient.php +++ b/AiPlatform/src/V1/Client/GenAiTuningServiceClient.php @@ -94,9 +94,7 @@ final class GenAiTuningServiceClient private const CODEGEN_NAME = 'gapic'; /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; private static function getClientDefaults() { @@ -128,8 +126,12 @@ private static function getClientDefaults() * * @return string The formatted context resource. */ - public static function contextName(string $project, string $location, string $metadataStore, string $context): string - { + public static function contextName( + string $project, + string $location, + string $metadataStore, + string $context + ): string { return self::getPathTemplate('context')->render([ 'project' => $project, 'location' => $location, @@ -223,8 +225,12 @@ public static function projectLocationEndpointName(string $project, string $loca * * @return string The formatted project_location_publisher_model resource. */ - public static function projectLocationPublisherModelName(string $project, string $location, string $publisher, string $model): string - { + public static function projectLocationPublisherModelName( + string $project, + string $location, + string $publisher, + string $model + ): string { return self::getPathTemplate('projectLocationPublisherModel')->render([ 'project' => $project, 'location' => $location, @@ -604,8 +610,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/IndexEndpointServiceClient.php b/AiPlatform/src/V1/Client/IndexEndpointServiceClient.php index 18b9145bf5a9..6d9980bde7cc 100644 --- a/AiPlatform/src/V1/Client/IndexEndpointServiceClient.php +++ b/AiPlatform/src/V1/Client/IndexEndpointServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a index * resource. @@ -666,8 +685,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/IndexServiceClient.php b/AiPlatform/src/V1/Client/IndexServiceClient.php index 91583261f3bb..b5069701c87f 100644 --- a/AiPlatform/src/V1/Client/IndexServiceClient.php +++ b/AiPlatform/src/V1/Client/IndexServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a index * resource. @@ -440,8 +459,10 @@ public function listIndexes(ListIndexesRequest $request, array $callOptions = [] * * @throws ApiException Thrown if the API call fails. */ - public function removeDatapoints(RemoveDatapointsRequest $request, array $callOptions = []): RemoveDatapointsResponse - { + public function removeDatapoints( + RemoveDatapointsRequest $request, + array $callOptions = [] + ): RemoveDatapointsResponse { return $this->startApiCall('RemoveDatapoints', $request, $callOptions)->wait(); } @@ -492,8 +513,10 @@ public function updateIndex(UpdateIndexRequest $request, array $callOptions = [] * * @throws ApiException Thrown if the API call fails. */ - public function upsertDatapoints(UpsertDatapointsRequest $request, array $callOptions = []): UpsertDatapointsResponse - { + public function upsertDatapoints( + UpsertDatapointsRequest $request, + array $callOptions = [] + ): UpsertDatapointsResponse { return $this->startApiCall('UpsertDatapoints', $request, $callOptions)->wait(); } @@ -633,8 +656,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/JobServiceClient.php b/AiPlatform/src/V1/Client/JobServiceClient.php index 7a68185a9bee..0f36dc668d52 100644 --- a/AiPlatform/src/V1/Client/JobServiceClient.php +++ b/AiPlatform/src/V1/Client/JobServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * batch_prediction_job resource. @@ -250,8 +271,12 @@ public static function batchPredictionJobName(string $project, string $location, * * @return string The formatted context resource. */ - public static function contextName(string $project, string $location, string $metadataStore, string $context): string - { + public static function contextName( + string $project, + string $location, + string $metadataStore, + string $context + ): string { return self::getPathTemplate('context')->render([ 'project' => $project, 'location' => $location, @@ -346,8 +371,11 @@ public static function endpointName(string $project, string $location, string $e * * @return string The formatted hyperparameter_tuning_job resource. */ - public static function hyperparameterTuningJobName(string $project, string $location, string $hyperparameterTuningJob): string - { + public static function hyperparameterTuningJobName( + string $project, + string $location, + string $hyperparameterTuningJob + ): string { return self::getPathTemplate('hyperparameterTuningJob')->render([ 'project' => $project, 'location' => $location, @@ -401,8 +429,11 @@ public static function modelName(string $project, string $location, string $mode * * @return string The formatted model_deployment_monitoring_job resource. */ - public static function modelDeploymentMonitoringJobName(string $project, string $location, string $modelDeploymentMonitoringJob): string - { + public static function modelDeploymentMonitoringJobName( + string $project, + string $location, + string $modelDeploymentMonitoringJob + ): string { return self::getPathTemplate('modelDeploymentMonitoringJob')->render([ 'project' => $project, 'location' => $location, @@ -440,8 +471,12 @@ public static function nasJobName(string $project, string $location, string $nas * * @return string The formatted nas_trial_detail resource. */ - public static function nasTrialDetailName(string $project, string $location, string $nasJob, string $nasTrialDetail): string - { + public static function nasTrialDetailName( + string $project, + string $location, + string $nasJob, + string $nasTrialDetail + ): string { return self::getPathTemplate('nasTrialDetail')->render([ 'project' => $project, 'location' => $location, @@ -533,8 +568,12 @@ public static function projectLocationEndpointName(string $project, string $loca * * @return string The formatted project_location_publisher_model resource. */ - public static function projectLocationPublisherModelName(string $project, string $location, string $publisher, string $model): string - { + public static function projectLocationPublisherModelName( + string $project, + string $location, + string $publisher, + string $model + ): string { return self::getPathTemplate('projectLocationPublisherModel')->render([ 'project' => $project, 'location' => $location, @@ -825,8 +864,10 @@ public function cancelDataLabelingJob(CancelDataLabelingJobRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function cancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest $request, array $callOptions = []): void - { + public function cancelHyperparameterTuningJob( + CancelHyperparameterTuningJobRequest $request, + array $callOptions = [] + ): void { $this->startApiCall('CancelHyperparameterTuningJob', $request, $callOptions)->wait(); } @@ -888,8 +929,10 @@ public function cancelNasJob(CancelNasJobRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function createBatchPredictionJob(CreateBatchPredictionJobRequest $request, array $callOptions = []): BatchPredictionJob - { + public function createBatchPredictionJob( + CreateBatchPredictionJobRequest $request, + array $callOptions = [] + ): BatchPredictionJob { return $this->startApiCall('CreateBatchPredictionJob', $request, $callOptions)->wait(); } @@ -941,8 +984,10 @@ public function createCustomJob(CreateCustomJobRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function createDataLabelingJob(CreateDataLabelingJobRequest $request, array $callOptions = []): DataLabelingJob - { + public function createDataLabelingJob( + CreateDataLabelingJobRequest $request, + array $callOptions = [] + ): DataLabelingJob { return $this->startApiCall('CreateDataLabelingJob', $request, $callOptions)->wait(); } @@ -968,8 +1013,10 @@ public function createDataLabelingJob(CreateDataLabelingJobRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function createHyperparameterTuningJob(CreateHyperparameterTuningJobRequest $request, array $callOptions = []): HyperparameterTuningJob - { + public function createHyperparameterTuningJob( + CreateHyperparameterTuningJobRequest $request, + array $callOptions = [] + ): HyperparameterTuningJob { return $this->startApiCall('CreateHyperparameterTuningJob', $request, $callOptions)->wait(); } @@ -996,8 +1043,10 @@ public function createHyperparameterTuningJob(CreateHyperparameterTuningJobReque * * @throws ApiException Thrown if the API call fails. */ - public function createModelDeploymentMonitoringJob(CreateModelDeploymentMonitoringJobRequest $request, array $callOptions = []): ModelDeploymentMonitoringJob - { + public function createModelDeploymentMonitoringJob( + CreateModelDeploymentMonitoringJobRequest $request, + array $callOptions = [] + ): ModelDeploymentMonitoringJob { return $this->startApiCall('CreateModelDeploymentMonitoringJob', $request, $callOptions)->wait(); } @@ -1049,8 +1098,10 @@ public function createNasJob(CreateNasJobRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function deleteBatchPredictionJob(DeleteBatchPredictionJobRequest $request, array $callOptions = []): OperationResponse - { + public function deleteBatchPredictionJob( + DeleteBatchPredictionJobRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteBatchPredictionJob', $request, $callOptions)->wait(); } @@ -1101,8 +1152,10 @@ public function deleteCustomJob(DeleteCustomJobRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function deleteDataLabelingJob(DeleteDataLabelingJobRequest $request, array $callOptions = []): OperationResponse - { + public function deleteDataLabelingJob( + DeleteDataLabelingJobRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteDataLabelingJob', $request, $callOptions)->wait(); } @@ -1128,8 +1181,10 @@ public function deleteDataLabelingJob(DeleteDataLabelingJobRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function deleteHyperparameterTuningJob(DeleteHyperparameterTuningJobRequest $request, array $callOptions = []): OperationResponse - { + public function deleteHyperparameterTuningJob( + DeleteHyperparameterTuningJobRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteHyperparameterTuningJob', $request, $callOptions)->wait(); } @@ -1155,8 +1210,10 @@ public function deleteHyperparameterTuningJob(DeleteHyperparameterTuningJobReque * * @throws ApiException Thrown if the API call fails. */ - public function deleteModelDeploymentMonitoringJob(DeleteModelDeploymentMonitoringJobRequest $request, array $callOptions = []): OperationResponse - { + public function deleteModelDeploymentMonitoringJob( + DeleteModelDeploymentMonitoringJobRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteModelDeploymentMonitoringJob', $request, $callOptions)->wait(); } @@ -1207,8 +1264,10 @@ public function deleteNasJob(DeleteNasJobRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function getBatchPredictionJob(GetBatchPredictionJobRequest $request, array $callOptions = []): BatchPredictionJob - { + public function getBatchPredictionJob( + GetBatchPredictionJobRequest $request, + array $callOptions = [] + ): BatchPredictionJob { return $this->startApiCall('GetBatchPredictionJob', $request, $callOptions)->wait(); } @@ -1286,8 +1345,10 @@ public function getDataLabelingJob(GetDataLabelingJobRequest $request, array $ca * * @throws ApiException Thrown if the API call fails. */ - public function getHyperparameterTuningJob(GetHyperparameterTuningJobRequest $request, array $callOptions = []): HyperparameterTuningJob - { + public function getHyperparameterTuningJob( + GetHyperparameterTuningJobRequest $request, + array $callOptions = [] + ): HyperparameterTuningJob { return $this->startApiCall('GetHyperparameterTuningJob', $request, $callOptions)->wait(); } @@ -1313,8 +1374,10 @@ public function getHyperparameterTuningJob(GetHyperparameterTuningJobRequest $re * * @throws ApiException Thrown if the API call fails. */ - public function getModelDeploymentMonitoringJob(GetModelDeploymentMonitoringJobRequest $request, array $callOptions = []): ModelDeploymentMonitoringJob - { + public function getModelDeploymentMonitoringJob( + GetModelDeploymentMonitoringJobRequest $request, + array $callOptions = [] + ): ModelDeploymentMonitoringJob { return $this->startApiCall('GetModelDeploymentMonitoringJob', $request, $callOptions)->wait(); } @@ -1391,8 +1454,10 @@ public function getNasTrialDetail(GetNasTrialDetailRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function listBatchPredictionJobs(ListBatchPredictionJobsRequest $request, array $callOptions = []): PagedListResponse - { + public function listBatchPredictionJobs( + ListBatchPredictionJobsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListBatchPredictionJobs', $request, $callOptions); } @@ -1443,8 +1508,10 @@ public function listCustomJobs(ListCustomJobsRequest $request, array $callOption * * @throws ApiException Thrown if the API call fails. */ - public function listDataLabelingJobs(ListDataLabelingJobsRequest $request, array $callOptions = []): PagedListResponse - { + public function listDataLabelingJobs( + ListDataLabelingJobsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListDataLabelingJobs', $request, $callOptions); } @@ -1470,8 +1537,10 @@ public function listDataLabelingJobs(ListDataLabelingJobsRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function listHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest $request, array $callOptions = []): PagedListResponse - { + public function listHyperparameterTuningJobs( + ListHyperparameterTuningJobsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListHyperparameterTuningJobs', $request, $callOptions); } @@ -1497,8 +1566,10 @@ public function listHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest * * @throws ApiException Thrown if the API call fails. */ - public function listModelDeploymentMonitoringJobs(ListModelDeploymentMonitoringJobsRequest $request, array $callOptions = []): PagedListResponse - { + public function listModelDeploymentMonitoringJobs( + ListModelDeploymentMonitoringJobsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListModelDeploymentMonitoringJobs', $request, $callOptions); } @@ -1577,8 +1648,10 @@ public function listNasTrialDetails(ListNasTrialDetailsRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function pauseModelDeploymentMonitoringJob(PauseModelDeploymentMonitoringJobRequest $request, array $callOptions = []): void - { + public function pauseModelDeploymentMonitoringJob( + PauseModelDeploymentMonitoringJobRequest $request, + array $callOptions = [] + ): void { $this->startApiCall('PauseModelDeploymentMonitoringJob', $request, $callOptions)->wait(); } @@ -1604,8 +1677,10 @@ public function pauseModelDeploymentMonitoringJob(PauseModelDeploymentMonitoring * * @throws ApiException Thrown if the API call fails. */ - public function resumeModelDeploymentMonitoringJob(ResumeModelDeploymentMonitoringJobRequest $request, array $callOptions = []): void - { + public function resumeModelDeploymentMonitoringJob( + ResumeModelDeploymentMonitoringJobRequest $request, + array $callOptions = [] + ): void { $this->startApiCall('ResumeModelDeploymentMonitoringJob', $request, $callOptions)->wait(); } @@ -1631,8 +1706,10 @@ public function resumeModelDeploymentMonitoringJob(ResumeModelDeploymentMonitori * * @throws ApiException Thrown if the API call fails. */ - public function searchModelDeploymentMonitoringStatsAnomalies(SearchModelDeploymentMonitoringStatsAnomaliesRequest $request, array $callOptions = []): PagedListResponse - { + public function searchModelDeploymentMonitoringStatsAnomalies( + SearchModelDeploymentMonitoringStatsAnomaliesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('SearchModelDeploymentMonitoringStatsAnomalies', $request, $callOptions); } @@ -1658,8 +1735,10 @@ public function searchModelDeploymentMonitoringStatsAnomalies(SearchModelDeploym * * @throws ApiException Thrown if the API call fails. */ - public function updateModelDeploymentMonitoringJob(UpdateModelDeploymentMonitoringJobRequest $request, array $callOptions = []): OperationResponse - { + public function updateModelDeploymentMonitoringJob( + UpdateModelDeploymentMonitoringJobRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateModelDeploymentMonitoringJob', $request, $callOptions)->wait(); } @@ -1799,8 +1878,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/LlmUtilityServiceClient.php b/AiPlatform/src/V1/Client/LlmUtilityServiceClient.php index b3298d3340cd..8091d6feb51d 100644 --- a/AiPlatform/src/V1/Client/LlmUtilityServiceClient.php +++ b/AiPlatform/src/V1/Client/LlmUtilityServiceClient.php @@ -1,6 +1,6 @@ render([ 'project' => $project, 'location' => $location, @@ -458,8 +460,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/MatchServiceClient.php b/AiPlatform/src/V1/Client/MatchServiceClient.php index 32c1c03a0ebb..54271fc6b982 100644 --- a/AiPlatform/src/V1/Client/MatchServiceClient.php +++ b/AiPlatform/src/V1/Client/MatchServiceClient.php @@ -1,6 +1,6 @@ startApiCall('ReadIndexDatapoints', $request, $callOptions)->wait(); } @@ -418,8 +418,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/MetadataServiceClient.php b/AiPlatform/src/V1/Client/MetadataServiceClient.php index 3beaea425703..3217207f6bfe 100644 --- a/AiPlatform/src/V1/Client/MetadataServiceClient.php +++ b/AiPlatform/src/V1/Client/MetadataServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a artifact * resource. @@ -228,8 +247,12 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted artifact resource. */ - public static function artifactName(string $project, string $location, string $metadataStore, string $artifact): string - { + public static function artifactName( + string $project, + string $location, + string $metadataStore, + string $artifact + ): string { return self::getPathTemplate('artifact')->render([ 'project' => $project, 'location' => $location, @@ -249,8 +272,12 @@ public static function artifactName(string $project, string $location, string $m * * @return string The formatted context resource. */ - public static function contextName(string $project, string $location, string $metadataStore, string $context): string - { + public static function contextName( + string $project, + string $location, + string $metadataStore, + string $context + ): string { return self::getPathTemplate('context')->render([ 'project' => $project, 'location' => $location, @@ -270,8 +297,12 @@ public static function contextName(string $project, string $location, string $me * * @return string The formatted execution resource. */ - public static function executionName(string $project, string $location, string $metadataStore, string $execution): string - { + public static function executionName( + string $project, + string $location, + string $metadataStore, + string $execution + ): string { return self::getPathTemplate('execution')->render([ 'project' => $project, 'location' => $location, @@ -308,8 +339,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted metadata_schema resource. */ - public static function metadataSchemaName(string $project, string $location, string $metadataStore, string $metadataSchema): string - { + public static function metadataSchemaName( + string $project, + string $location, + string $metadataStore, + string $metadataSchema + ): string { return self::getPathTemplate('metadataSchema')->render([ 'project' => $project, 'location' => $location, @@ -462,8 +497,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function addContextArtifactsAndExecutions(AddContextArtifactsAndExecutionsRequest $request, array $callOptions = []): AddContextArtifactsAndExecutionsResponse - { + public function addContextArtifactsAndExecutions( + AddContextArtifactsAndExecutionsRequest $request, + array $callOptions = [] + ): AddContextArtifactsAndExecutionsResponse { return $this->startApiCall('AddContextArtifactsAndExecutions', $request, $callOptions)->wait(); } @@ -492,8 +529,10 @@ public function addContextArtifactsAndExecutions(AddContextArtifactsAndExecution * * @throws ApiException Thrown if the API call fails. */ - public function addContextChildren(AddContextChildrenRequest $request, array $callOptions = []): AddContextChildrenResponse - { + public function addContextChildren( + AddContextChildrenRequest $request, + array $callOptions = [] + ): AddContextChildrenResponse { return $this->startApiCall('AddContextChildren', $request, $callOptions)->wait(); } @@ -521,8 +560,10 @@ public function addContextChildren(AddContextChildrenRequest $request, array $ca * * @throws ApiException Thrown if the API call fails. */ - public function addExecutionEvents(AddExecutionEventsRequest $request, array $callOptions = []): AddExecutionEventsResponse - { + public function addExecutionEvents( + AddExecutionEventsRequest $request, + array $callOptions = [] + ): AddExecutionEventsResponse { return $this->startApiCall('AddExecutionEvents', $request, $callOptions)->wait(); } @@ -1122,8 +1163,10 @@ public function purgeExecutions(PurgeExecutionsRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function queryArtifactLineageSubgraph(QueryArtifactLineageSubgraphRequest $request, array $callOptions = []): LineageSubgraph - { + public function queryArtifactLineageSubgraph( + QueryArtifactLineageSubgraphRequest $request, + array $callOptions = [] + ): LineageSubgraph { return $this->startApiCall('QueryArtifactLineageSubgraph', $request, $callOptions)->wait(); } @@ -1150,8 +1193,10 @@ public function queryArtifactLineageSubgraph(QueryArtifactLineageSubgraphRequest * * @throws ApiException Thrown if the API call fails. */ - public function queryContextLineageSubgraph(QueryContextLineageSubgraphRequest $request, array $callOptions = []): LineageSubgraph - { + public function queryContextLineageSubgraph( + QueryContextLineageSubgraphRequest $request, + array $callOptions = [] + ): LineageSubgraph { return $this->startApiCall('QueryContextLineageSubgraph', $request, $callOptions)->wait(); } @@ -1179,8 +1224,10 @@ public function queryContextLineageSubgraph(QueryContextLineageSubgraphRequest $ * * @throws ApiException Thrown if the API call fails. */ - public function queryExecutionInputsAndOutputs(QueryExecutionInputsAndOutputsRequest $request, array $callOptions = []): LineageSubgraph - { + public function queryExecutionInputsAndOutputs( + QueryExecutionInputsAndOutputsRequest $request, + array $callOptions = [] + ): LineageSubgraph { return $this->startApiCall('QueryExecutionInputsAndOutputs', $request, $callOptions)->wait(); } @@ -1208,8 +1255,10 @@ public function queryExecutionInputsAndOutputs(QueryExecutionInputsAndOutputsReq * * @throws ApiException Thrown if the API call fails. */ - public function removeContextChildren(RemoveContextChildrenRequest $request, array $callOptions = []): RemoveContextChildrenResponse - { + public function removeContextChildren( + RemoveContextChildrenRequest $request, + array $callOptions = [] + ): RemoveContextChildrenResponse { return $this->startApiCall('RemoveContextChildren', $request, $callOptions)->wait(); } @@ -1427,8 +1476,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/MigrationServiceClient.php b/AiPlatform/src/V1/Client/MigrationServiceClient.php index 7936c09ed444..3cc077ea428d 100644 --- a/AiPlatform/src/V1/Client/MigrationServiceClient.php +++ b/AiPlatform/src/V1/Client/MigrationServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * annotated_dataset resource. @@ -363,8 +382,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function batchMigrateResources(BatchMigrateResourcesRequest $request, array $callOptions = []): OperationResponse - { + public function batchMigrateResources( + BatchMigrateResourcesRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('BatchMigrateResources', $request, $callOptions)->wait(); } @@ -392,8 +413,10 @@ public function batchMigrateResources(BatchMigrateResourcesRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function searchMigratableResources(SearchMigratableResourcesRequest $request, array $callOptions = []): PagedListResponse - { + public function searchMigratableResources( + SearchMigratableResourcesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('SearchMigratableResources', $request, $callOptions); } @@ -533,8 +556,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/ModelGardenServiceClient.php b/AiPlatform/src/V1/Client/ModelGardenServiceClient.php index ebe6be378941..67e757a1faca 100644 --- a/AiPlatform/src/V1/Client/ModelGardenServiceClient.php +++ b/AiPlatform/src/V1/Client/ModelGardenServiceClient.php @@ -1,6 +1,6 @@ startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/ModelServiceClient.php b/AiPlatform/src/V1/Client/ModelServiceClient.php index ee8a73d00bda..93678b94d53a 100644 --- a/AiPlatform/src/V1/Client/ModelServiceClient.php +++ b/AiPlatform/src/V1/Client/ModelServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a endpoint * resource. @@ -249,8 +268,12 @@ public static function modelName(string $project, string $location, string $mode * * @return string The formatted model_evaluation resource. */ - public static function modelEvaluationName(string $project, string $location, string $model, string $evaluation): string - { + public static function modelEvaluationName( + string $project, + string $location, + string $model, + string $evaluation + ): string { return self::getPathTemplate('modelEvaluation')->render([ 'project' => $project, 'location' => $location, @@ -271,8 +294,13 @@ public static function modelEvaluationName(string $project, string $location, st * * @return string The formatted model_evaluation_slice resource. */ - public static function modelEvaluationSliceName(string $project, string $location, string $model, string $evaluation, string $slice): string - { + public static function modelEvaluationSliceName( + string $project, + string $location, + string $model, + string $evaluation, + string $slice + ): string { return self::getPathTemplate('modelEvaluationSlice')->render([ 'project' => $project, 'location' => $location, @@ -331,8 +359,12 @@ public static function projectLocationEndpointName(string $project, string $loca * * @return string The formatted project_location_publisher_model resource. */ - public static function projectLocationPublisherModelName(string $project, string $location, string $publisher, string $model): string - { + public static function projectLocationPublisherModelName( + string $project, + string $location, + string $publisher, + string $model + ): string { return self::getPathTemplate('projectLocationPublisherModel')->render([ 'project' => $project, 'location' => $location, @@ -486,8 +518,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function batchImportEvaluatedAnnotations(BatchImportEvaluatedAnnotationsRequest $request, array $callOptions = []): BatchImportEvaluatedAnnotationsResponse - { + public function batchImportEvaluatedAnnotations( + BatchImportEvaluatedAnnotationsRequest $request, + array $callOptions = [] + ): BatchImportEvaluatedAnnotationsResponse { return $this->startApiCall('BatchImportEvaluatedAnnotations', $request, $callOptions)->wait(); } @@ -513,8 +547,10 @@ public function batchImportEvaluatedAnnotations(BatchImportEvaluatedAnnotationsR * * @throws ApiException Thrown if the API call fails. */ - public function batchImportModelEvaluationSlices(BatchImportModelEvaluationSlicesRequest $request, array $callOptions = []): BatchImportModelEvaluationSlicesResponse - { + public function batchImportModelEvaluationSlices( + BatchImportModelEvaluationSlicesRequest $request, + array $callOptions = [] + ): BatchImportModelEvaluationSlicesResponse { return $this->startApiCall('BatchImportModelEvaluationSlices', $request, $callOptions)->wait(); } @@ -716,8 +752,10 @@ public function getModelEvaluation(GetModelEvaluationRequest $request, array $ca * * @throws ApiException Thrown if the API call fails. */ - public function getModelEvaluationSlice(GetModelEvaluationSliceRequest $request, array $callOptions = []): ModelEvaluationSlice - { + public function getModelEvaluationSlice( + GetModelEvaluationSliceRequest $request, + array $callOptions = [] + ): ModelEvaluationSlice { return $this->startApiCall('GetModelEvaluationSlice', $request, $callOptions)->wait(); } @@ -742,8 +780,10 @@ public function getModelEvaluationSlice(GetModelEvaluationSliceRequest $request, * * @throws ApiException Thrown if the API call fails. */ - public function importModelEvaluation(ImportModelEvaluationRequest $request, array $callOptions = []): ModelEvaluation - { + public function importModelEvaluation( + ImportModelEvaluationRequest $request, + array $callOptions = [] + ): ModelEvaluation { return $this->startApiCall('ImportModelEvaluation', $request, $callOptions)->wait(); } @@ -769,8 +809,10 @@ public function importModelEvaluation(ImportModelEvaluationRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function listModelEvaluationSlices(ListModelEvaluationSlicesRequest $request, array $callOptions = []): PagedListResponse - { + public function listModelEvaluationSlices( + ListModelEvaluationSlicesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListModelEvaluationSlices', $request, $callOptions); } @@ -795,8 +837,10 @@ public function listModelEvaluationSlices(ListModelEvaluationSlicesRequest $requ * * @throws ApiException Thrown if the API call fails. */ - public function listModelEvaluations(ListModelEvaluationsRequest $request, array $callOptions = []): PagedListResponse - { + public function listModelEvaluations( + ListModelEvaluationsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListModelEvaluations', $request, $callOptions); } @@ -900,8 +944,10 @@ public function mergeVersionAliases(MergeVersionAliasesRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function updateExplanationDataset(UpdateExplanationDatasetRequest $request, array $callOptions = []): OperationResponse - { + public function updateExplanationDataset( + UpdateExplanationDatasetRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateExplanationDataset', $request, $callOptions)->wait(); } @@ -1093,8 +1139,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/NotebookServiceClient.php b/AiPlatform/src/V1/Client/NotebookServiceClient.php index 9599634fdce0..910b3fd32c68 100644 --- a/AiPlatform/src/V1/Client/NotebookServiceClient.php +++ b/AiPlatform/src/V1/Client/NotebookServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -46,6 +45,7 @@ use Google\Cloud\AIPlatform\V1\NotebookRuntime; use Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate; use Google\Cloud\AIPlatform\V1\StartNotebookRuntimeRequest; +use Google\Cloud\AIPlatform\V1\UpdateNotebookRuntimeTemplateRequest; use Google\Cloud\AIPlatform\V1\UpgradeNotebookRuntimeRequest; use Google\Cloud\Iam\V1\GetIamPolicyRequest; use Google\Cloud\Iam\V1\Policy; @@ -55,6 +55,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -78,6 +79,7 @@ * @method PromiseInterface listNotebookRuntimeTemplatesAsync(ListNotebookRuntimeTemplatesRequest $request, array $optionalArgs = []) * @method PromiseInterface listNotebookRuntimesAsync(ListNotebookRuntimesRequest $request, array $optionalArgs = []) * @method PromiseInterface startNotebookRuntimeAsync(StartNotebookRuntimeRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateNotebookRuntimeTemplateAsync(UpdateNotebookRuntimeTemplateRequest $request, array $optionalArgs = []) * @method PromiseInterface upgradeNotebookRuntimeAsync(UpgradeNotebookRuntimeRequest $request, array $optionalArgs = []) * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) @@ -110,9 +112,7 @@ final class NotebookServiceClient private const CODEGEN_NAME = 'gapic'; /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; private $operationsClient; @@ -158,12 +158,33 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -227,8 +248,11 @@ public static function notebookRuntimeName(string $project, string $location, st * * @return string The formatted notebook_runtime_template resource. */ - public static function notebookRuntimeTemplateName(string $project, string $location, string $notebookRuntimeTemplate): string - { + public static function notebookRuntimeTemplateName( + string $project, + string $location, + string $notebookRuntimeTemplate + ): string { return self::getPathTemplate('notebookRuntimeTemplate')->render([ 'project' => $project, 'location' => $location, @@ -378,8 +402,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function assignNotebookRuntime(AssignNotebookRuntimeRequest $request, array $callOptions = []): OperationResponse - { + public function assignNotebookRuntime( + AssignNotebookRuntimeRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('AssignNotebookRuntime', $request, $callOptions)->wait(); } @@ -405,8 +431,10 @@ public function assignNotebookRuntime(AssignNotebookRuntimeRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function createNotebookRuntimeTemplate(CreateNotebookRuntimeTemplateRequest $request, array $callOptions = []): OperationResponse - { + public function createNotebookRuntimeTemplate( + CreateNotebookRuntimeTemplateRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateNotebookRuntimeTemplate', $request, $callOptions)->wait(); } @@ -432,8 +460,10 @@ public function createNotebookRuntimeTemplate(CreateNotebookRuntimeTemplateReque * * @throws ApiException Thrown if the API call fails. */ - public function deleteNotebookRuntime(DeleteNotebookRuntimeRequest $request, array $callOptions = []): OperationResponse - { + public function deleteNotebookRuntime( + DeleteNotebookRuntimeRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteNotebookRuntime', $request, $callOptions)->wait(); } @@ -459,8 +489,10 @@ public function deleteNotebookRuntime(DeleteNotebookRuntimeRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function deleteNotebookRuntimeTemplate(DeleteNotebookRuntimeTemplateRequest $request, array $callOptions = []): OperationResponse - { + public function deleteNotebookRuntimeTemplate( + DeleteNotebookRuntimeTemplateRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteNotebookRuntimeTemplate', $request, $callOptions)->wait(); } @@ -512,8 +544,10 @@ public function getNotebookRuntime(GetNotebookRuntimeRequest $request, array $ca * * @throws ApiException Thrown if the API call fails. */ - public function getNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest $request, array $callOptions = []): NotebookRuntimeTemplate - { + public function getNotebookRuntimeTemplate( + GetNotebookRuntimeTemplateRequest $request, + array $callOptions = [] + ): NotebookRuntimeTemplate { return $this->startApiCall('GetNotebookRuntimeTemplate', $request, $callOptions)->wait(); } @@ -539,8 +573,10 @@ public function getNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest $re * * @throws ApiException Thrown if the API call fails. */ - public function listNotebookRuntimeTemplates(ListNotebookRuntimeTemplatesRequest $request, array $callOptions = []): PagedListResponse - { + public function listNotebookRuntimeTemplates( + ListNotebookRuntimeTemplatesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListNotebookRuntimeTemplates', $request, $callOptions); } @@ -565,8 +601,10 @@ public function listNotebookRuntimeTemplates(ListNotebookRuntimeTemplatesRequest * * @throws ApiException Thrown if the API call fails. */ - public function listNotebookRuntimes(ListNotebookRuntimesRequest $request, array $callOptions = []): PagedListResponse - { + public function listNotebookRuntimes( + ListNotebookRuntimesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListNotebookRuntimes', $request, $callOptions); } @@ -591,11 +629,42 @@ public function listNotebookRuntimes(ListNotebookRuntimesRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function startNotebookRuntime(StartNotebookRuntimeRequest $request, array $callOptions = []): OperationResponse - { + public function startNotebookRuntime( + StartNotebookRuntimeRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('StartNotebookRuntime', $request, $callOptions)->wait(); } + /** + * Updates a NotebookRuntimeTemplate. + * + * The async variant is + * {@see NotebookServiceClient::updateNotebookRuntimeTemplateAsync()} . + * + * @example samples/V1/NotebookServiceClient/update_notebook_runtime_template.php + * + * @param UpdateNotebookRuntimeTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotebookRuntimeTemplate + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateNotebookRuntimeTemplate( + UpdateNotebookRuntimeTemplateRequest $request, + array $callOptions = [] + ): NotebookRuntimeTemplate { + return $this->startApiCall('UpdateNotebookRuntimeTemplate', $request, $callOptions)->wait(); + } + /** * Upgrades a NotebookRuntime. * @@ -618,8 +687,10 @@ public function startNotebookRuntime(StartNotebookRuntimeRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function upgradeNotebookRuntime(UpgradeNotebookRuntimeRequest $request, array $callOptions = []): OperationResponse - { + public function upgradeNotebookRuntime( + UpgradeNotebookRuntimeRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpgradeNotebookRuntime', $request, $callOptions)->wait(); } @@ -759,8 +830,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/PersistentResourceServiceClient.php b/AiPlatform/src/V1/Client/PersistentResourceServiceClient.php index a259b0d88c2c..95176a9fa93b 100644 --- a/AiPlatform/src/V1/Client/PersistentResourceServiceClient.php +++ b/AiPlatform/src/V1/Client/PersistentResourceServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -50,6 +49,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -101,9 +101,7 @@ final class PersistentResourceServiceClient private const CODEGEN_NAME = 'gapic'; /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; private $operationsClient; @@ -120,7 +118,8 @@ private static function getClientDefaults() ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/persistent_resource_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/persistent_resource_service_rest_client_config.php', ], ], ]; @@ -149,12 +148,33 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -328,8 +348,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function createPersistentResource(CreatePersistentResourceRequest $request, array $callOptions = []): OperationResponse - { + public function createPersistentResource( + CreatePersistentResourceRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreatePersistentResource', $request, $callOptions)->wait(); } @@ -355,8 +377,10 @@ public function createPersistentResource(CreatePersistentResourceRequest $reques * * @throws ApiException Thrown if the API call fails. */ - public function deletePersistentResource(DeletePersistentResourceRequest $request, array $callOptions = []): OperationResponse - { + public function deletePersistentResource( + DeletePersistentResourceRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeletePersistentResource', $request, $callOptions)->wait(); } @@ -382,8 +406,10 @@ public function deletePersistentResource(DeletePersistentResourceRequest $reques * * @throws ApiException Thrown if the API call fails. */ - public function getPersistentResource(GetPersistentResourceRequest $request, array $callOptions = []): PersistentResource - { + public function getPersistentResource( + GetPersistentResourceRequest $request, + array $callOptions = [] + ): PersistentResource { return $this->startApiCall('GetPersistentResource', $request, $callOptions)->wait(); } @@ -409,8 +435,10 @@ public function getPersistentResource(GetPersistentResourceRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function listPersistentResources(ListPersistentResourcesRequest $request, array $callOptions = []): PagedListResponse - { + public function listPersistentResources( + ListPersistentResourcesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListPersistentResources', $request, $callOptions); } @@ -436,8 +464,10 @@ public function listPersistentResources(ListPersistentResourcesRequest $request, * * @throws ApiException Thrown if the API call fails. */ - public function rebootPersistentResource(RebootPersistentResourceRequest $request, array $callOptions = []): OperationResponse - { + public function rebootPersistentResource( + RebootPersistentResourceRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('RebootPersistentResource', $request, $callOptions)->wait(); } @@ -463,8 +493,10 @@ public function rebootPersistentResource(RebootPersistentResourceRequest $reques * * @throws ApiException Thrown if the API call fails. */ - public function updatePersistentResource(UpdatePersistentResourceRequest $request, array $callOptions = []): OperationResponse - { + public function updatePersistentResource( + UpdatePersistentResourceRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdatePersistentResource', $request, $callOptions)->wait(); } @@ -609,8 +641,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/PipelineServiceClient.php b/AiPlatform/src/V1/Client/PipelineServiceClient.php index e36aa9ecb153..c28e22b2305a 100644 --- a/AiPlatform/src/V1/Client/PipelineServiceClient.php +++ b/AiPlatform/src/V1/Client/PipelineServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a artifact * resource. @@ -181,8 +200,12 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted artifact resource. */ - public static function artifactName(string $project, string $location, string $metadataStore, string $artifact): string - { + public static function artifactName( + string $project, + string $location, + string $metadataStore, + string $artifact + ): string { return self::getPathTemplate('artifact')->render([ 'project' => $project, 'location' => $location, @@ -202,8 +225,12 @@ public static function artifactName(string $project, string $location, string $m * * @return string The formatted context resource. */ - public static function contextName(string $project, string $location, string $metadataStore, string $context): string - { + public static function contextName( + string $project, + string $location, + string $metadataStore, + string $context + ): string { return self::getPathTemplate('context')->render([ 'project' => $project, 'location' => $location, @@ -261,8 +288,12 @@ public static function endpointName(string $project, string $location, string $e * * @return string The formatted execution resource. */ - public static function executionName(string $project, string $location, string $metadataStore, string $execution): string - { + public static function executionName( + string $project, + string $location, + string $metadataStore, + string $execution + ): string { return self::getPathTemplate('execution')->render([ 'project' => $project, 'location' => $location, @@ -392,8 +423,12 @@ public static function projectLocationEndpointName(string $project, string $loca * * @return string The formatted project_location_publisher_model resource. */ - public static function projectLocationPublisherModelName(string $project, string $location, string $publisher, string $model): string - { + public static function projectLocationPublisherModelName( + string $project, + string $location, + string $publisher, + string $model + ): string { return self::getPathTemplate('projectLocationPublisherModel')->render([ 'project' => $project, 'location' => $location, @@ -557,8 +592,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function batchCancelPipelineJobs(BatchCancelPipelineJobsRequest $request, array $callOptions = []): OperationResponse - { + public function batchCancelPipelineJobs( + BatchCancelPipelineJobsRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('BatchCancelPipelineJobs', $request, $callOptions)->wait(); } @@ -586,8 +623,10 @@ public function batchCancelPipelineJobs(BatchCancelPipelineJobsRequest $request, * * @throws ApiException Thrown if the API call fails. */ - public function batchDeletePipelineJobs(BatchDeletePipelineJobsRequest $request, array $callOptions = []): OperationResponse - { + public function batchDeletePipelineJobs( + BatchDeletePipelineJobsRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('BatchDeletePipelineJobs', $request, $callOptions)->wait(); } @@ -714,8 +753,10 @@ public function createPipelineJob(CreatePipelineJobRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function createTrainingPipeline(CreateTrainingPipelineRequest $request, array $callOptions = []): TrainingPipeline - { + public function createTrainingPipeline( + CreateTrainingPipelineRequest $request, + array $callOptions = [] + ): TrainingPipeline { return $this->startApiCall('CreateTrainingPipeline', $request, $callOptions)->wait(); } @@ -767,8 +808,10 @@ public function deletePipelineJob(DeletePipelineJobRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function deleteTrainingPipeline(DeleteTrainingPipelineRequest $request, array $callOptions = []): OperationResponse - { + public function deleteTrainingPipeline( + DeleteTrainingPipelineRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteTrainingPipeline', $request, $callOptions)->wait(); } @@ -872,8 +915,10 @@ public function listPipelineJobs(ListPipelineJobsRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function listTrainingPipelines(ListTrainingPipelinesRequest $request, array $callOptions = []): PagedListResponse - { + public function listTrainingPipelines( + ListTrainingPipelinesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListTrainingPipelines', $request, $callOptions); } @@ -1013,8 +1058,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/PredictionServiceClient.php b/AiPlatform/src/V1/Client/PredictionServiceClient.php index ea77bbf02476..4d2425cdeda3 100644 --- a/AiPlatform/src/V1/Client/PredictionServiceClient.php +++ b/AiPlatform/src/V1/Client/PredictionServiceClient.php @@ -1,6 +1,6 @@ render([ 'project' => $project, 'location' => $location, @@ -336,8 +341,10 @@ public function directPredict(DirectPredictRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function directRawPredict(DirectRawPredictRequest $request, array $callOptions = []): DirectRawPredictResponse - { + public function directRawPredict( + DirectRawPredictRequest $request, + array $callOptions = [] + ): DirectRawPredictResponse { return $this->startApiCall('DirectRawPredict', $request, $callOptions)->wait(); } @@ -755,8 +762,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/ScheduleServiceClient.php b/AiPlatform/src/V1/Client/ScheduleServiceClient.php index fbdabbf5342f..4eb20511dc6e 100644 --- a/AiPlatform/src/V1/Client/ScheduleServiceClient.php +++ b/AiPlatform/src/V1/Client/ScheduleServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a artifact * resource. @@ -169,8 +188,12 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted artifact resource. */ - public static function artifactName(string $project, string $location, string $metadataStore, string $artifact): string - { + public static function artifactName( + string $project, + string $location, + string $metadataStore, + string $artifact + ): string { return self::getPathTemplate('artifact')->render([ 'project' => $project, 'location' => $location, @@ -190,8 +213,12 @@ public static function artifactName(string $project, string $location, string $m * * @return string The formatted context resource. */ - public static function contextName(string $project, string $location, string $metadataStore, string $context): string - { + public static function contextName( + string $project, + string $location, + string $metadataStore, + string $context + ): string { return self::getPathTemplate('context')->render([ 'project' => $project, 'location' => $location, @@ -230,8 +257,12 @@ public static function customJobName(string $project, string $location, string $ * * @return string The formatted execution resource. */ - public static function executionName(string $project, string $location, string $metadataStore, string $execution): string - { + public static function executionName( + string $project, + string $location, + string $metadataStore, + string $execution + ): string { return self::getPathTemplate('execution')->render([ 'project' => $project, 'location' => $location, @@ -765,8 +796,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/SpecialistPoolServiceClient.php b/AiPlatform/src/V1/Client/SpecialistPoolServiceClient.php index e2a970b299ff..5c49591a6a63 100644 --- a/AiPlatform/src/V1/Client/SpecialistPoolServiceClient.php +++ b/AiPlatform/src/V1/Client/SpecialistPoolServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -313,8 +332,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function createSpecialistPool(CreateSpecialistPoolRequest $request, array $callOptions = []): OperationResponse - { + public function createSpecialistPool( + CreateSpecialistPoolRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateSpecialistPool', $request, $callOptions)->wait(); } @@ -340,8 +361,10 @@ public function createSpecialistPool(CreateSpecialistPoolRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function deleteSpecialistPool(DeleteSpecialistPoolRequest $request, array $callOptions = []): OperationResponse - { + public function deleteSpecialistPool( + DeleteSpecialistPoolRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteSpecialistPool', $request, $callOptions)->wait(); } @@ -421,8 +444,10 @@ public function listSpecialistPools(ListSpecialistPoolsRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function updateSpecialistPool(UpdateSpecialistPoolRequest $request, array $callOptions = []): OperationResponse - { + public function updateSpecialistPool( + UpdateSpecialistPoolRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateSpecialistPool', $request, $callOptions)->wait(); } @@ -563,8 +588,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/TensorboardServiceClient.php b/AiPlatform/src/V1/Client/TensorboardServiceClient.php index ac0308d2bd44..5b50c06fd7b0 100644 --- a/AiPlatform/src/V1/Client/TensorboardServiceClient.php +++ b/AiPlatform/src/V1/Client/TensorboardServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -262,8 +283,12 @@ public static function tensorboardName(string $project, string $location, string * * @return string The formatted tensorboard_experiment resource. */ - public static function tensorboardExperimentName(string $project, string $location, string $tensorboard, string $experiment): string - { + public static function tensorboardExperimentName( + string $project, + string $location, + string $tensorboard, + string $experiment + ): string { return self::getPathTemplate('tensorboardExperiment')->render([ 'project' => $project, 'location' => $location, @@ -284,8 +309,13 @@ public static function tensorboardExperimentName(string $project, string $locati * * @return string The formatted tensorboard_run resource. */ - public static function tensorboardRunName(string $project, string $location, string $tensorboard, string $experiment, string $run): string - { + public static function tensorboardRunName( + string $project, + string $location, + string $tensorboard, + string $experiment, + string $run + ): string { return self::getPathTemplate('tensorboardRun')->render([ 'project' => $project, 'location' => $location, @@ -308,8 +338,14 @@ public static function tensorboardRunName(string $project, string $location, str * * @return string The formatted tensorboard_time_series resource. */ - public static function tensorboardTimeSeriesName(string $project, string $location, string $tensorboard, string $experiment, string $run, string $timeSeries): string - { + public static function tensorboardTimeSeriesName( + string $project, + string $location, + string $tensorboard, + string $experiment, + string $run, + string $timeSeries + ): string { return self::getPathTemplate('tensorboardTimeSeries')->render([ 'project' => $project, 'location' => $location, @@ -442,8 +478,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function batchCreateTensorboardRuns(BatchCreateTensorboardRunsRequest $request, array $callOptions = []): BatchCreateTensorboardRunsResponse - { + public function batchCreateTensorboardRuns( + BatchCreateTensorboardRunsRequest $request, + array $callOptions = [] + ): BatchCreateTensorboardRunsResponse { return $this->startApiCall('BatchCreateTensorboardRuns', $request, $callOptions)->wait(); } @@ -469,8 +507,10 @@ public function batchCreateTensorboardRuns(BatchCreateTensorboardRunsRequest $re * * @throws ApiException Thrown if the API call fails. */ - public function batchCreateTensorboardTimeSeries(BatchCreateTensorboardTimeSeriesRequest $request, array $callOptions = []): BatchCreateTensorboardTimeSeriesResponse - { + public function batchCreateTensorboardTimeSeries( + BatchCreateTensorboardTimeSeriesRequest $request, + array $callOptions = [] + ): BatchCreateTensorboardTimeSeriesResponse { return $this->startApiCall('BatchCreateTensorboardTimeSeries', $request, $callOptions)->wait(); } @@ -500,8 +540,10 @@ public function batchCreateTensorboardTimeSeries(BatchCreateTensorboardTimeSerie * * @throws ApiException Thrown if the API call fails. */ - public function batchReadTensorboardTimeSeriesData(BatchReadTensorboardTimeSeriesDataRequest $request, array $callOptions = []): BatchReadTensorboardTimeSeriesDataResponse - { + public function batchReadTensorboardTimeSeriesData( + BatchReadTensorboardTimeSeriesDataRequest $request, + array $callOptions = [] + ): BatchReadTensorboardTimeSeriesDataResponse { return $this->startApiCall('BatchReadTensorboardTimeSeriesData', $request, $callOptions)->wait(); } @@ -553,8 +595,10 @@ public function createTensorboard(CreateTensorboardRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function createTensorboardExperiment(CreateTensorboardExperimentRequest $request, array $callOptions = []): TensorboardExperiment - { + public function createTensorboardExperiment( + CreateTensorboardExperimentRequest $request, + array $callOptions = [] + ): TensorboardExperiment { return $this->startApiCall('CreateTensorboardExperiment', $request, $callOptions)->wait(); } @@ -607,8 +651,10 @@ public function createTensorboardRun(CreateTensorboardRunRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function createTensorboardTimeSeries(CreateTensorboardTimeSeriesRequest $request, array $callOptions = []): TensorboardTimeSeries - { + public function createTensorboardTimeSeries( + CreateTensorboardTimeSeriesRequest $request, + array $callOptions = [] + ): TensorboardTimeSeries { return $this->startApiCall('CreateTensorboardTimeSeries', $request, $callOptions)->wait(); } @@ -660,8 +706,10 @@ public function deleteTensorboard(DeleteTensorboardRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function deleteTensorboardExperiment(DeleteTensorboardExperimentRequest $request, array $callOptions = []): OperationResponse - { + public function deleteTensorboardExperiment( + DeleteTensorboardExperimentRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteTensorboardExperiment', $request, $callOptions)->wait(); } @@ -687,8 +735,10 @@ public function deleteTensorboardExperiment(DeleteTensorboardExperimentRequest $ * * @throws ApiException Thrown if the API call fails. */ - public function deleteTensorboardRun(DeleteTensorboardRunRequest $request, array $callOptions = []): OperationResponse - { + public function deleteTensorboardRun( + DeleteTensorboardRunRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteTensorboardRun', $request, $callOptions)->wait(); } @@ -714,8 +764,10 @@ public function deleteTensorboardRun(DeleteTensorboardRunRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function deleteTensorboardTimeSeries(DeleteTensorboardTimeSeriesRequest $request, array $callOptions = []): OperationResponse - { + public function deleteTensorboardTimeSeries( + DeleteTensorboardTimeSeriesRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteTensorboardTimeSeries', $request, $callOptions)->wait(); } @@ -742,8 +794,10 @@ public function deleteTensorboardTimeSeries(DeleteTensorboardTimeSeriesRequest $ * * @throws ApiException Thrown if the API call fails. */ - public function exportTensorboardTimeSeriesData(ExportTensorboardTimeSeriesDataRequest $request, array $callOptions = []): PagedListResponse - { + public function exportTensorboardTimeSeriesData( + ExportTensorboardTimeSeriesDataRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ExportTensorboardTimeSeriesData', $request, $callOptions); } @@ -795,8 +849,10 @@ public function getTensorboard(GetTensorboardRequest $request, array $callOption * * @throws ApiException Thrown if the API call fails. */ - public function getTensorboardExperiment(GetTensorboardExperimentRequest $request, array $callOptions = []): TensorboardExperiment - { + public function getTensorboardExperiment( + GetTensorboardExperimentRequest $request, + array $callOptions = [] + ): TensorboardExperiment { return $this->startApiCall('GetTensorboardExperiment', $request, $callOptions)->wait(); } @@ -848,8 +904,10 @@ public function getTensorboardRun(GetTensorboardRunRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function getTensorboardTimeSeries(GetTensorboardTimeSeriesRequest $request, array $callOptions = []): TensorboardTimeSeries - { + public function getTensorboardTimeSeries( + GetTensorboardTimeSeriesRequest $request, + array $callOptions = [] + ): TensorboardTimeSeries { return $this->startApiCall('GetTensorboardTimeSeries', $request, $callOptions)->wait(); } @@ -875,8 +933,10 @@ public function getTensorboardTimeSeries(GetTensorboardTimeSeriesRequest $reques * * @throws ApiException Thrown if the API call fails. */ - public function listTensorboardExperiments(ListTensorboardExperimentsRequest $request, array $callOptions = []): PagedListResponse - { + public function listTensorboardExperiments( + ListTensorboardExperimentsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListTensorboardExperiments', $request, $callOptions); } @@ -929,8 +989,10 @@ public function listTensorboardRuns(ListTensorboardRunsRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function listTensorboardTimeSeries(ListTensorboardTimeSeriesRequest $request, array $callOptions = []): PagedListResponse - { + public function listTensorboardTimeSeries( + ListTensorboardTimeSeriesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListTensorboardTimeSeries', $request, $callOptions); } @@ -980,8 +1042,10 @@ public function listTensorboards(ListTensorboardsRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function readTensorboardBlobData(ReadTensorboardBlobDataRequest $request, array $callOptions = []): ServerStream - { + public function readTensorboardBlobData( + ReadTensorboardBlobDataRequest $request, + array $callOptions = [] + ): ServerStream { return $this->startApiCall('ReadTensorboardBlobData', $request, $callOptions); } @@ -1007,8 +1071,10 @@ public function readTensorboardBlobData(ReadTensorboardBlobDataRequest $request, * * @throws ApiException Thrown if the API call fails. */ - public function readTensorboardSize(ReadTensorboardSizeRequest $request, array $callOptions = []): ReadTensorboardSizeResponse - { + public function readTensorboardSize( + ReadTensorboardSizeRequest $request, + array $callOptions = [] + ): ReadTensorboardSizeResponse { return $this->startApiCall('ReadTensorboardSize', $request, $callOptions)->wait(); } @@ -1038,8 +1104,10 @@ public function readTensorboardSize(ReadTensorboardSizeRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function readTensorboardTimeSeriesData(ReadTensorboardTimeSeriesDataRequest $request, array $callOptions = []): ReadTensorboardTimeSeriesDataResponse - { + public function readTensorboardTimeSeriesData( + ReadTensorboardTimeSeriesDataRequest $request, + array $callOptions = [] + ): ReadTensorboardTimeSeriesDataResponse { return $this->startApiCall('ReadTensorboardTimeSeriesData', $request, $callOptions)->wait(); } @@ -1065,8 +1133,10 @@ public function readTensorboardTimeSeriesData(ReadTensorboardTimeSeriesDataReque * * @throws ApiException Thrown if the API call fails. */ - public function readTensorboardUsage(ReadTensorboardUsageRequest $request, array $callOptions = []): ReadTensorboardUsageResponse - { + public function readTensorboardUsage( + ReadTensorboardUsageRequest $request, + array $callOptions = [] + ): ReadTensorboardUsageResponse { return $this->startApiCall('ReadTensorboardUsage', $request, $callOptions)->wait(); } @@ -1118,8 +1188,10 @@ public function updateTensorboard(UpdateTensorboardRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function updateTensorboardExperiment(UpdateTensorboardExperimentRequest $request, array $callOptions = []): TensorboardExperiment - { + public function updateTensorboardExperiment( + UpdateTensorboardExperimentRequest $request, + array $callOptions = [] + ): TensorboardExperiment { return $this->startApiCall('UpdateTensorboardExperiment', $request, $callOptions)->wait(); } @@ -1172,8 +1244,10 @@ public function updateTensorboardRun(UpdateTensorboardRunRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function updateTensorboardTimeSeries(UpdateTensorboardTimeSeriesRequest $request, array $callOptions = []): TensorboardTimeSeries - { + public function updateTensorboardTimeSeries( + UpdateTensorboardTimeSeriesRequest $request, + array $callOptions = [] + ): TensorboardTimeSeries { return $this->startApiCall('UpdateTensorboardTimeSeries', $request, $callOptions)->wait(); } @@ -1200,8 +1274,10 @@ public function updateTensorboardTimeSeries(UpdateTensorboardTimeSeriesRequest $ * * @throws ApiException Thrown if the API call fails. */ - public function writeTensorboardExperimentData(WriteTensorboardExperimentDataRequest $request, array $callOptions = []): WriteTensorboardExperimentDataResponse - { + public function writeTensorboardExperimentData( + WriteTensorboardExperimentDataRequest $request, + array $callOptions = [] + ): WriteTensorboardExperimentDataResponse { return $this->startApiCall('WriteTensorboardExperimentData', $request, $callOptions)->wait(); } @@ -1228,8 +1304,10 @@ public function writeTensorboardExperimentData(WriteTensorboardExperimentDataReq * * @throws ApiException Thrown if the API call fails. */ - public function writeTensorboardRunData(WriteTensorboardRunDataRequest $request, array $callOptions = []): WriteTensorboardRunDataResponse - { + public function writeTensorboardRunData( + WriteTensorboardRunDataRequest $request, + array $callOptions = [] + ): WriteTensorboardRunDataResponse { return $this->startApiCall('WriteTensorboardRunData', $request, $callOptions)->wait(); } @@ -1370,8 +1448,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/Client/VizierServiceClient.php b/AiPlatform/src/V1/Client/VizierServiceClient.php index 44176b14a54f..a252778d3fd1 100644 --- a/AiPlatform/src/V1/Client/VizierServiceClient.php +++ b/AiPlatform/src/V1/Client/VizierServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a custom_job * resource. @@ -408,8 +427,10 @@ public function addTrialMeasurement(AddTrialMeasurementRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function checkTrialEarlyStoppingState(CheckTrialEarlyStoppingStateRequest $request, array $callOptions = []): OperationResponse - { + public function checkTrialEarlyStoppingState( + CheckTrialEarlyStoppingStateRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CheckTrialEarlyStoppingState', $request, $callOptions)->wait(); } @@ -616,8 +637,10 @@ public function getTrial(GetTrialRequest $request, array $callOptions = []): Tri * * @throws ApiException Thrown if the API call fails. */ - public function listOptimalTrials(ListOptimalTrialsRequest $request, array $callOptions = []): ListOptimalTrialsResponse - { + public function listOptimalTrials( + ListOptimalTrialsRequest $request, + array $callOptions = [] + ): ListOptimalTrialsResponse { return $this->startApiCall('ListOptimalTrials', $request, $callOptions)->wait(); } @@ -893,8 +916,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/AiPlatform/src/V1/CompleteTrialRequest.php b/AiPlatform/src/V1/CompleteTrialRequest.php index d47f9f07da29..4690f368b311 100644 --- a/AiPlatform/src/V1/CompleteTrialRequest.php +++ b/AiPlatform/src/V1/CompleteTrialRequest.php @@ -23,7 +23,7 @@ class CompleteTrialRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. If provided, it will be used as the completed Trial's * final_measurement; Otherwise, the service will auto-select a @@ -31,21 +31,21 @@ class CompleteTrialRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Measurement final_measurement = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $final_measurement = null; + protected $final_measurement = null; /** * Optional. True if the Trial cannot be run with the given Parameter, and * final_measurement will be ignored. * * Generated from protobuf field bool trial_infeasible = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $trial_infeasible = false; + protected $trial_infeasible = false; /** * Optional. A human readable reason why the trial was infeasible. This should * only be provided if `trial_infeasible` is true. * * Generated from protobuf field string infeasible_reason = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $infeasible_reason = ''; + protected $infeasible_reason = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/CompletionStats.php b/AiPlatform/src/V1/CompletionStats.php index b130f6ba0eaf..a48d0f14ba2b 100644 --- a/AiPlatform/src/V1/CompletionStats.php +++ b/AiPlatform/src/V1/CompletionStats.php @@ -21,13 +21,13 @@ class CompletionStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 successful_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $successful_count = 0; + protected $successful_count = 0; /** * Output only. The number of entities for which any error was encountered. * * Generated from protobuf field int64 failed_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failed_count = 0; + protected $failed_count = 0; /** * Output only. In cases when enough errors are encountered a job, pipeline, * or operation may be failed as a whole. Below is the number of entities for @@ -37,7 +37,7 @@ class CompletionStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 incomplete_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $incomplete_count = 0; + protected $incomplete_count = 0; /** * Output only. The number of the successful forecast points that are * generated by the forecasting model. This is ONLY used by the forecasting @@ -45,7 +45,7 @@ class CompletionStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 successful_forecast_point_count = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $successful_forecast_point_count = 0; + protected $successful_forecast_point_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/ComputeTokensRequest.php b/AiPlatform/src/V1/ComputeTokensRequest.php index 5f3ff77f5ccb..2c791dfaac28 100644 --- a/AiPlatform/src/V1/ComputeTokensRequest.php +++ b/AiPlatform/src/V1/ComputeTokensRequest.php @@ -21,7 +21,7 @@ class ComputeTokensRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Required. The instances that are the input to token computing API call. * Schema is identical to the prediction schema of the text model, even for diff --git a/AiPlatform/src/V1/ContainerRegistryDestination.php b/AiPlatform/src/V1/ContainerRegistryDestination.php index 3c6afefd6418..58fbb4c19983 100644 --- a/AiPlatform/src/V1/ContainerRegistryDestination.php +++ b/AiPlatform/src/V1/ContainerRegistryDestination.php @@ -27,7 +27,7 @@ class ContainerRegistryDestination extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $output_uri = ''; + protected $output_uri = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ContainerSpec.php b/AiPlatform/src/V1/ContainerSpec.php index 432a29a38c2b..52f22956c176 100644 --- a/AiPlatform/src/V1/ContainerSpec.php +++ b/AiPlatform/src/V1/ContainerSpec.php @@ -21,7 +21,7 @@ class ContainerSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $image_uri = ''; + protected $image_uri = ''; /** * The command to be invoked when the container is started. * It overrides the entrypoint instruction in Dockerfile when provided. diff --git a/AiPlatform/src/V1/Content.php b/AiPlatform/src/V1/Content.php index 4fa8104dbe4b..cac84e11bbd1 100644 --- a/AiPlatform/src/V1/Content.php +++ b/AiPlatform/src/V1/Content.php @@ -25,7 +25,7 @@ class Content extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string role = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $role = ''; + protected $role = ''; /** * Required. Ordered `Parts` that constitute a single message. Parts may have * different IANA MIME types. diff --git a/AiPlatform/src/V1/Context.php b/AiPlatform/src/V1/Context.php index 08bfb5954f63..5350832124f1 100644 --- a/AiPlatform/src/V1/Context.php +++ b/AiPlatform/src/V1/Context.php @@ -20,21 +20,21 @@ class Context extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * User provided display name of the Context. * May be up to 128 Unicode characters. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * An eTag used to perform consistent read-modify-write updates. If not set, a * blind "overwrite" update happens. * * Generated from protobuf field string etag = 8; */ - private $etag = ''; + protected $etag = ''; /** * The labels with user-defined metadata to organize your Contexts. * Label keys and values can be no longer than 64 characters @@ -51,13 +51,13 @@ class Context extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Context was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. A list of resource names of Contexts that are parents of this * Context. A Context may have at most 10 parent_contexts. @@ -73,7 +73,7 @@ class Context extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema_title = 13; */ - private $schema_title = ''; + protected $schema_title = ''; /** * The version of the schema in schema_name to use. * Schema title and version is expected to be registered in earlier Create @@ -82,7 +82,7 @@ class Context extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema_version = 14; */ - private $schema_version = ''; + protected $schema_version = ''; /** * Properties of the Context. * Top level metadata keys' heading and trailing spaces will be trimmed. @@ -90,13 +90,13 @@ class Context extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Struct metadata = 15; */ - private $metadata = null; + protected $metadata = null; /** * Description of the Context * * Generated from protobuf field string description = 16; */ - private $description = ''; + protected $description = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/CopyModelOperationMetadata.php b/AiPlatform/src/V1/CopyModelOperationMetadata.php index 8ea99dfbeb2b..96560fa2b4a5 100644 --- a/AiPlatform/src/V1/CopyModelOperationMetadata.php +++ b/AiPlatform/src/V1/CopyModelOperationMetadata.php @@ -22,7 +22,7 @@ class CopyModelOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CopyModelRequest.php b/AiPlatform/src/V1/CopyModelRequest.php index 8df450ef2b00..c194bc851e77 100644 --- a/AiPlatform/src/V1/CopyModelRequest.php +++ b/AiPlatform/src/V1/CopyModelRequest.php @@ -22,7 +22,7 @@ class CopyModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The resource name of the Model to copy. That Model must be in the * same Project. Format: @@ -30,14 +30,14 @@ class CopyModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source_model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $source_model = ''; + protected $source_model = ''; /** * Customer-managed encryption key options. If this is set, * then the Model copy will be encrypted with the provided encryption key. * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 3; */ - private $encryption_spec = null; + protected $encryption_spec = null; protected $destination_model; /** diff --git a/AiPlatform/src/V1/CopyModelResponse.php b/AiPlatform/src/V1/CopyModelResponse.php index 08068028c89d..b7009c3497ea 100644 --- a/AiPlatform/src/V1/CopyModelResponse.php +++ b/AiPlatform/src/V1/CopyModelResponse.php @@ -23,13 +23,13 @@ class CopyModelResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 1 [(.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * Output only. The version ID of the model that is copied. * * Generated from protobuf field string model_version_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $model_version_id = ''; + protected $model_version_id = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/CountTokensRequest.php b/AiPlatform/src/V1/CountTokensRequest.php index 5259380af986..6a602f612b16 100644 --- a/AiPlatform/src/V1/CountTokensRequest.php +++ b/AiPlatform/src/V1/CountTokensRequest.php @@ -22,7 +22,7 @@ class CountTokensRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Required. The name of the publisher model requested to serve the * prediction. Format: @@ -30,7 +30,7 @@ class CountTokensRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $model = ''; + protected $model = ''; /** * Required. The instances that are the input to token counting call. * Schema is identical to the prediction schema of the underlying model. diff --git a/AiPlatform/src/V1/CountTokensResponse.php b/AiPlatform/src/V1/CountTokensResponse.php index e98664712b04..b2b0f04d3679 100644 --- a/AiPlatform/src/V1/CountTokensResponse.php +++ b/AiPlatform/src/V1/CountTokensResponse.php @@ -20,14 +20,14 @@ class CountTokensResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 total_tokens = 1; */ - private $total_tokens = 0; + protected $total_tokens = 0; /** * The total number of billable characters counted across all instances from * the request. * * Generated from protobuf field int32 total_billable_characters = 2; */ - private $total_billable_characters = 0; + protected $total_billable_characters = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateArtifactRequest.php b/AiPlatform/src/V1/CreateArtifactRequest.php index 9a63b32035fe..101d30793506 100644 --- a/AiPlatform/src/V1/CreateArtifactRequest.php +++ b/AiPlatform/src/V1/CreateArtifactRequest.php @@ -24,13 +24,13 @@ class CreateArtifactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Artifact to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Artifact artifact = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $artifact = null; + protected $artifact = null; /** * The {artifact} portion of the resource name with the format: * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` @@ -42,7 +42,7 @@ class CreateArtifactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string artifact_id = 3; */ - private $artifact_id = ''; + protected $artifact_id = ''; /** * @param string $parent Required. The resource name of the MetadataStore where the Artifact should diff --git a/AiPlatform/src/V1/CreateBatchPredictionJobRequest.php b/AiPlatform/src/V1/CreateBatchPredictionJobRequest.php index f548ae5ca89e..5d648b95312a 100644 --- a/AiPlatform/src/V1/CreateBatchPredictionJobRequest.php +++ b/AiPlatform/src/V1/CreateBatchPredictionJobRequest.php @@ -22,13 +22,13 @@ class CreateBatchPredictionJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The BatchPredictionJob to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.BatchPredictionJob batch_prediction_job = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $batch_prediction_job = null; + protected $batch_prediction_job = null; /** * @param string $parent Required. The resource name of the Location to create the diff --git a/AiPlatform/src/V1/CreateContextRequest.php b/AiPlatform/src/V1/CreateContextRequest.php index ce85b97e63e8..136459c0e04e 100644 --- a/AiPlatform/src/V1/CreateContextRequest.php +++ b/AiPlatform/src/V1/CreateContextRequest.php @@ -23,13 +23,13 @@ class CreateContextRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Context to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Context context = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $context = null; + protected $context = null; /** * The {context} portion of the resource name with the format: * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. @@ -41,7 +41,7 @@ class CreateContextRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string context_id = 3; */ - private $context_id = ''; + protected $context_id = ''; /** * @param string $parent Required. The resource name of the MetadataStore where the Context should diff --git a/AiPlatform/src/V1/CreateCustomJobRequest.php b/AiPlatform/src/V1/CreateCustomJobRequest.php index 7071ebb47479..b277cb82d0c0 100644 --- a/AiPlatform/src/V1/CreateCustomJobRequest.php +++ b/AiPlatform/src/V1/CreateCustomJobRequest.php @@ -22,13 +22,13 @@ class CreateCustomJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The CustomJob to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.CustomJob custom_job = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $custom_job = null; + protected $custom_job = null; /** * @param string $parent Required. The resource name of the Location to create the CustomJob in. diff --git a/AiPlatform/src/V1/CreateDataLabelingJobRequest.php b/AiPlatform/src/V1/CreateDataLabelingJobRequest.php index 250577a6634f..606b44afff62 100644 --- a/AiPlatform/src/V1/CreateDataLabelingJobRequest.php +++ b/AiPlatform/src/V1/CreateDataLabelingJobRequest.php @@ -22,13 +22,13 @@ class CreateDataLabelingJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The DataLabelingJob to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.DataLabelingJob data_labeling_job = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_labeling_job = null; + protected $data_labeling_job = null; /** * @param string $parent Required. The parent of the DataLabelingJob. diff --git a/AiPlatform/src/V1/CreateDatasetOperationMetadata.php b/AiPlatform/src/V1/CreateDatasetOperationMetadata.php index 9bc9cc07a5bf..a4f1442b8b58 100644 --- a/AiPlatform/src/V1/CreateDatasetOperationMetadata.php +++ b/AiPlatform/src/V1/CreateDatasetOperationMetadata.php @@ -21,7 +21,7 @@ class CreateDatasetOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateDatasetRequest.php b/AiPlatform/src/V1/CreateDatasetRequest.php index 6efd0d33f276..56909d8b33e7 100644 --- a/AiPlatform/src/V1/CreateDatasetRequest.php +++ b/AiPlatform/src/V1/CreateDatasetRequest.php @@ -22,13 +22,13 @@ class CreateDatasetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Dataset to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $dataset = null; + protected $dataset = null; /** * @param string $parent Required. The resource name of the Location to create the Dataset in. diff --git a/AiPlatform/src/V1/CreateDatasetVersionOperationMetadata.php b/AiPlatform/src/V1/CreateDatasetVersionOperationMetadata.php index 26f53577a250..42a9dfce633b 100644 --- a/AiPlatform/src/V1/CreateDatasetVersionOperationMetadata.php +++ b/AiPlatform/src/V1/CreateDatasetVersionOperationMetadata.php @@ -21,7 +21,7 @@ class CreateDatasetVersionOperationMetadata extends \Google\Protobuf\Internal\Me * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateDatasetVersionRequest.php b/AiPlatform/src/V1/CreateDatasetVersionRequest.php index a8cdb399abc5..d52bc548f697 100644 --- a/AiPlatform/src/V1/CreateDatasetVersionRequest.php +++ b/AiPlatform/src/V1/CreateDatasetVersionRequest.php @@ -23,7 +23,7 @@ class CreateDatasetVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The version to be created. The same CMEK policies with the * original Dataset will be applied the dataset version. So here we don't need @@ -31,7 +31,7 @@ class CreateDatasetVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DatasetVersion dataset_version = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $dataset_version = null; + protected $dataset_version = null; /** * @param string $parent Required. The name of the Dataset resource. diff --git a/AiPlatform/src/V1/CreateDeploymentResourcePoolOperationMetadata.php b/AiPlatform/src/V1/CreateDeploymentResourcePoolOperationMetadata.php index 07c992a074c1..b3a73f8363b7 100644 --- a/AiPlatform/src/V1/CreateDeploymentResourcePoolOperationMetadata.php +++ b/AiPlatform/src/V1/CreateDeploymentResourcePoolOperationMetadata.php @@ -20,7 +20,7 @@ class CreateDeploymentResourcePoolOperationMetadata extends \Google\Protobuf\Int * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateDeploymentResourcePoolRequest.php b/AiPlatform/src/V1/CreateDeploymentResourcePoolRequest.php index 22ecd50d0853..b2159a3fb47d 100644 --- a/AiPlatform/src/V1/CreateDeploymentResourcePoolRequest.php +++ b/AiPlatform/src/V1/CreateDeploymentResourcePoolRequest.php @@ -21,13 +21,13 @@ class CreateDeploymentResourcePoolRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The DeploymentResourcePool to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.DeploymentResourcePool deployment_resource_pool = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployment_resource_pool = null; + protected $deployment_resource_pool = null; /** * Required. The ID to use for the DeploymentResourcePool, which * will become the final component of the DeploymentResourcePool's resource @@ -37,7 +37,7 @@ class CreateDeploymentResourcePoolRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string deployment_resource_pool_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployment_resource_pool_id = ''; + protected $deployment_resource_pool_id = ''; /** * @param string $parent Required. The parent location resource where this DeploymentResourcePool diff --git a/AiPlatform/src/V1/CreateEndpointOperationMetadata.php b/AiPlatform/src/V1/CreateEndpointOperationMetadata.php index 19f0de9900e0..2541cb6f4554 100644 --- a/AiPlatform/src/V1/CreateEndpointOperationMetadata.php +++ b/AiPlatform/src/V1/CreateEndpointOperationMetadata.php @@ -21,7 +21,7 @@ class CreateEndpointOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateEndpointRequest.php b/AiPlatform/src/V1/CreateEndpointRequest.php index 6951d70cca0e..7b06487c5ec6 100644 --- a/AiPlatform/src/V1/CreateEndpointRequest.php +++ b/AiPlatform/src/V1/CreateEndpointRequest.php @@ -22,13 +22,13 @@ class CreateEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Endpoint to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $endpoint = null; + protected $endpoint = null; /** * Immutable. The ID to use for endpoint, which will become the final * component of the endpoint resource name. @@ -44,7 +44,7 @@ class CreateEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $endpoint_id = ''; + protected $endpoint_id = ''; /** * @param string $parent Required. The resource name of the Location to create the Endpoint in. diff --git a/AiPlatform/src/V1/CreateEntityTypeOperationMetadata.php b/AiPlatform/src/V1/CreateEntityTypeOperationMetadata.php index 2b6efae59a28..cdd88cbab3d7 100644 --- a/AiPlatform/src/V1/CreateEntityTypeOperationMetadata.php +++ b/AiPlatform/src/V1/CreateEntityTypeOperationMetadata.php @@ -20,7 +20,7 @@ class CreateEntityTypeOperationMetadata extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateEntityTypeRequest.php b/AiPlatform/src/V1/CreateEntityTypeRequest.php index 697677bdebf0..33de6a198416 100644 --- a/AiPlatform/src/V1/CreateEntityTypeRequest.php +++ b/AiPlatform/src/V1/CreateEntityTypeRequest.php @@ -23,13 +23,13 @@ class CreateEntityTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The EntityType to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.EntityType entity_type = 2; */ - private $entity_type = null; + protected $entity_type = null; /** * Required. The ID to use for the EntityType, which will become the final * component of the EntityType's resource name. @@ -39,7 +39,7 @@ class CreateEntityTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_type_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $entity_type_id = ''; + protected $entity_type_id = ''; /** * @param string $parent Required. The resource name of the Featurestore to create EntityTypes. diff --git a/AiPlatform/src/V1/CreateExecutionRequest.php b/AiPlatform/src/V1/CreateExecutionRequest.php index 91ac38f25ce4..d1cdc202c321 100644 --- a/AiPlatform/src/V1/CreateExecutionRequest.php +++ b/AiPlatform/src/V1/CreateExecutionRequest.php @@ -24,13 +24,13 @@ class CreateExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Execution to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $execution = null; + protected $execution = null; /** * The {execution} portion of the resource name with the format: * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` @@ -43,7 +43,7 @@ class CreateExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string execution_id = 3; */ - private $execution_id = ''; + protected $execution_id = ''; /** * @param string $parent Required. The resource name of the MetadataStore where the Execution should diff --git a/AiPlatform/src/V1/CreateFeatureGroupOperationMetadata.php b/AiPlatform/src/V1/CreateFeatureGroupOperationMetadata.php index ba561350a538..4f2674eccbec 100644 --- a/AiPlatform/src/V1/CreateFeatureGroupOperationMetadata.php +++ b/AiPlatform/src/V1/CreateFeatureGroupOperationMetadata.php @@ -20,7 +20,7 @@ class CreateFeatureGroupOperationMetadata extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateFeatureGroupRequest.php b/AiPlatform/src/V1/CreateFeatureGroupRequest.php index e935a34493bd..499466d08850 100644 --- a/AiPlatform/src/V1/CreateFeatureGroupRequest.php +++ b/AiPlatform/src/V1/CreateFeatureGroupRequest.php @@ -19,17 +19,17 @@ class CreateFeatureGroupRequest extends \Google\Protobuf\Internal\Message /** * Required. The resource name of the Location to create FeatureGroups. * Format: - * `projects/{project}/locations/{location}'` + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The FeatureGroup to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureGroup feature_group = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_group = null; + protected $feature_group = null; /** * Required. The ID to use for this FeatureGroup, which will become the final * component of the FeatureGroup's resource name. @@ -39,12 +39,12 @@ class CreateFeatureGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_group_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_group_id = ''; + protected $feature_group_id = ''; /** * @param string $parent Required. The resource name of the Location to create FeatureGroups. * Format: - * `projects/{project}/locations/{location}'` + * `projects/{project}/locations/{location}` * Please see {@see FeatureRegistryServiceClient::locationName()} for help formatting this field. * @param \Google\Cloud\AIPlatform\V1\FeatureGroup $featureGroup Required. The FeatureGroup to create. * @param string $featureGroupId Required. The ID to use for this FeatureGroup, which will become the final @@ -76,7 +76,7 @@ public static function build(string $parent, \Google\Cloud\AIPlatform\V1\Feature * @type string $parent * Required. The resource name of the Location to create FeatureGroups. * Format: - * `projects/{project}/locations/{location}'` + * `projects/{project}/locations/{location}` * @type \Google\Cloud\AIPlatform\V1\FeatureGroup $feature_group * Required. The FeatureGroup to create. * @type string $feature_group_id @@ -95,7 +95,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the Location to create FeatureGroups. * Format: - * `projects/{project}/locations/{location}'` + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -108,7 +108,7 @@ public function getParent() /** * Required. The resource name of the Location to create FeatureGroups. * Format: - * `projects/{project}/locations/{location}'` + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/AiPlatform/src/V1/CreateFeatureOnlineStoreOperationMetadata.php b/AiPlatform/src/V1/CreateFeatureOnlineStoreOperationMetadata.php index ad71a018d8c7..3b46d3c6c144 100644 --- a/AiPlatform/src/V1/CreateFeatureOnlineStoreOperationMetadata.php +++ b/AiPlatform/src/V1/CreateFeatureOnlineStoreOperationMetadata.php @@ -20,7 +20,7 @@ class CreateFeatureOnlineStoreOperationMetadata extends \Google\Protobuf\Interna * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateFeatureOnlineStoreRequest.php b/AiPlatform/src/V1/CreateFeatureOnlineStoreRequest.php index 5a11795e7297..2e8f2f2c7493 100644 --- a/AiPlatform/src/V1/CreateFeatureOnlineStoreRequest.php +++ b/AiPlatform/src/V1/CreateFeatureOnlineStoreRequest.php @@ -23,13 +23,13 @@ class CreateFeatureOnlineStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The FeatureOnlineStore to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureOnlineStore feature_online_store = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_online_store = null; + protected $feature_online_store = null; /** * Required. The ID to use for this FeatureOnlineStore, which will become the * final component of the FeatureOnlineStore's resource name. @@ -39,7 +39,7 @@ class CreateFeatureOnlineStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_online_store_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_online_store_id = ''; + protected $feature_online_store_id = ''; /** * @param string $parent Required. The resource name of the Location to create FeatureOnlineStores. diff --git a/AiPlatform/src/V1/CreateFeatureOperationMetadata.php b/AiPlatform/src/V1/CreateFeatureOperationMetadata.php index 78c1535a8d88..6f4fb7c00ee0 100644 --- a/AiPlatform/src/V1/CreateFeatureOperationMetadata.php +++ b/AiPlatform/src/V1/CreateFeatureOperationMetadata.php @@ -20,7 +20,7 @@ class CreateFeatureOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateFeatureRequest.php b/AiPlatform/src/V1/CreateFeatureRequest.php index 7f1bef81f3af..3088d4e892ec 100644 --- a/AiPlatform/src/V1/CreateFeatureRequest.php +++ b/AiPlatform/src/V1/CreateFeatureRequest.php @@ -27,13 +27,13 @@ class CreateFeatureRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Feature to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Feature feature = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature = null; + protected $feature = null; /** * Required. The ID to use for the Feature, which will become the final * component of the Feature's resource name. @@ -43,7 +43,7 @@ class CreateFeatureRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_id = ''; + protected $feature_id = ''; /** * @param string $parent Required. The resource name of the EntityType or FeatureGroup to create a diff --git a/AiPlatform/src/V1/CreateFeatureViewOperationMetadata.php b/AiPlatform/src/V1/CreateFeatureViewOperationMetadata.php index 7174e458fce5..9afadfee20b9 100644 --- a/AiPlatform/src/V1/CreateFeatureViewOperationMetadata.php +++ b/AiPlatform/src/V1/CreateFeatureViewOperationMetadata.php @@ -20,7 +20,7 @@ class CreateFeatureViewOperationMetadata extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateFeatureViewRequest.php b/AiPlatform/src/V1/CreateFeatureViewRequest.php index cfd003e0d168..d7c4f8746c39 100644 --- a/AiPlatform/src/V1/CreateFeatureViewRequest.php +++ b/AiPlatform/src/V1/CreateFeatureViewRequest.php @@ -23,13 +23,13 @@ class CreateFeatureViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The FeatureView to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureView feature_view = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_view = null; + protected $feature_view = null; /** * Required. The ID to use for the FeatureView, which will become the final * component of the FeatureView's resource name. @@ -39,7 +39,7 @@ class CreateFeatureViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_view_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_view_id = ''; + protected $feature_view_id = ''; /** * Immutable. If set to true, one on demand sync will be run immediately, * regardless whether the @@ -48,7 +48,7 @@ class CreateFeatureViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool run_sync_immediately = 4 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $run_sync_immediately = false; + protected $run_sync_immediately = false; /** * @param string $parent Required. The resource name of the FeatureOnlineStore to create diff --git a/AiPlatform/src/V1/CreateFeaturestoreOperationMetadata.php b/AiPlatform/src/V1/CreateFeaturestoreOperationMetadata.php index c0661eeb5c32..cfbfb6e717be 100644 --- a/AiPlatform/src/V1/CreateFeaturestoreOperationMetadata.php +++ b/AiPlatform/src/V1/CreateFeaturestoreOperationMetadata.php @@ -20,7 +20,7 @@ class CreateFeaturestoreOperationMetadata extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateFeaturestoreRequest.php b/AiPlatform/src/V1/CreateFeaturestoreRequest.php index 4db5693dc86e..65a3c26fa649 100644 --- a/AiPlatform/src/V1/CreateFeaturestoreRequest.php +++ b/AiPlatform/src/V1/CreateFeaturestoreRequest.php @@ -23,13 +23,13 @@ class CreateFeaturestoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Featurestore to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Featurestore featurestore = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $featurestore = null; + protected $featurestore = null; /** * Required. The ID to use for this Featurestore, which will become the final * component of the Featurestore's resource name. @@ -39,7 +39,7 @@ class CreateFeaturestoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string featurestore_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $featurestore_id = ''; + protected $featurestore_id = ''; /** * @param string $parent Required. The resource name of the Location to create Featurestores. diff --git a/AiPlatform/src/V1/CreateHyperparameterTuningJobRequest.php b/AiPlatform/src/V1/CreateHyperparameterTuningJobRequest.php index c80b9d782b4c..bbc29fe3a679 100644 --- a/AiPlatform/src/V1/CreateHyperparameterTuningJobRequest.php +++ b/AiPlatform/src/V1/CreateHyperparameterTuningJobRequest.php @@ -23,13 +23,13 @@ class CreateHyperparameterTuningJobRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The HyperparameterTuningJob to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.HyperparameterTuningJob hyperparameter_tuning_job = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $hyperparameter_tuning_job = null; + protected $hyperparameter_tuning_job = null; /** * @param string $parent Required. The resource name of the Location to create the diff --git a/AiPlatform/src/V1/CreateIndexEndpointOperationMetadata.php b/AiPlatform/src/V1/CreateIndexEndpointOperationMetadata.php index 4241a1e50ae2..c87e3c1abf76 100644 --- a/AiPlatform/src/V1/CreateIndexEndpointOperationMetadata.php +++ b/AiPlatform/src/V1/CreateIndexEndpointOperationMetadata.php @@ -21,7 +21,7 @@ class CreateIndexEndpointOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateIndexEndpointRequest.php b/AiPlatform/src/V1/CreateIndexEndpointRequest.php index 7529d1a09cfa..6649ba6db0a6 100644 --- a/AiPlatform/src/V1/CreateIndexEndpointRequest.php +++ b/AiPlatform/src/V1/CreateIndexEndpointRequest.php @@ -22,13 +22,13 @@ class CreateIndexEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The IndexEndpoint to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.IndexEndpoint index_endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $index_endpoint = null; + protected $index_endpoint = null; /** * @param string $parent Required. The resource name of the Location to create the IndexEndpoint in. diff --git a/AiPlatform/src/V1/CreateIndexOperationMetadata.php b/AiPlatform/src/V1/CreateIndexOperationMetadata.php index a7fc3000b237..a7d66dd9462f 100644 --- a/AiPlatform/src/V1/CreateIndexOperationMetadata.php +++ b/AiPlatform/src/V1/CreateIndexOperationMetadata.php @@ -21,13 +21,13 @@ class CreateIndexOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * The operation metadata with regard to Matching Engine Index operation. * * Generated from protobuf field .google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; */ - private $nearest_neighbor_search_operation_metadata = null; + protected $nearest_neighbor_search_operation_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateIndexRequest.php b/AiPlatform/src/V1/CreateIndexRequest.php index 70b4a7f579e4..eb6fa1d4e365 100644 --- a/AiPlatform/src/V1/CreateIndexRequest.php +++ b/AiPlatform/src/V1/CreateIndexRequest.php @@ -22,13 +22,13 @@ class CreateIndexRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Index to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Index index = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $index = null; + protected $index = null; /** * @param string $parent Required. The resource name of the Location to create the Index in. diff --git a/AiPlatform/src/V1/CreateMetadataSchemaRequest.php b/AiPlatform/src/V1/CreateMetadataSchemaRequest.php index cdadababb269..f0730dff1318 100644 --- a/AiPlatform/src/V1/CreateMetadataSchemaRequest.php +++ b/AiPlatform/src/V1/CreateMetadataSchemaRequest.php @@ -23,13 +23,13 @@ class CreateMetadataSchemaRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The MetadataSchema to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.MetadataSchema metadata_schema = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_schema = null; + protected $metadata_schema = null; /** * The {metadata_schema} portion of the resource name with the format: * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` @@ -42,7 +42,7 @@ class CreateMetadataSchemaRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_schema_id = 3; */ - private $metadata_schema_id = ''; + protected $metadata_schema_id = ''; /** * @param string $parent Required. The resource name of the MetadataStore where the MetadataSchema diff --git a/AiPlatform/src/V1/CreateMetadataStoreOperationMetadata.php b/AiPlatform/src/V1/CreateMetadataStoreOperationMetadata.php index 0c39b85b8c78..8a2e4b516b29 100644 --- a/AiPlatform/src/V1/CreateMetadataStoreOperationMetadata.php +++ b/AiPlatform/src/V1/CreateMetadataStoreOperationMetadata.php @@ -21,7 +21,7 @@ class CreateMetadataStoreOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateMetadataStoreRequest.php b/AiPlatform/src/V1/CreateMetadataStoreRequest.php index 1b3f676ae7d7..e6296df82838 100644 --- a/AiPlatform/src/V1/CreateMetadataStoreRequest.php +++ b/AiPlatform/src/V1/CreateMetadataStoreRequest.php @@ -23,13 +23,13 @@ class CreateMetadataStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The MetadataStore to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.MetadataStore metadata_store = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_store = null; + protected $metadata_store = null; /** * The {metadatastore} portion of the resource name with the format: * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` @@ -42,7 +42,7 @@ class CreateMetadataStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_store_id = 3; */ - private $metadata_store_id = ''; + protected $metadata_store_id = ''; /** * @param string $parent Required. The resource name of the Location where the MetadataStore should diff --git a/AiPlatform/src/V1/CreateModelDeploymentMonitoringJobRequest.php b/AiPlatform/src/V1/CreateModelDeploymentMonitoringJobRequest.php index e28913d4eaf3..42753eba208e 100644 --- a/AiPlatform/src/V1/CreateModelDeploymentMonitoringJobRequest.php +++ b/AiPlatform/src/V1/CreateModelDeploymentMonitoringJobRequest.php @@ -22,13 +22,13 @@ class CreateModelDeploymentMonitoringJobRequest extends \Google\Protobuf\Interna * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The ModelDeploymentMonitoringJob to create * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob model_deployment_monitoring_job = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $model_deployment_monitoring_job = null; + protected $model_deployment_monitoring_job = null; /** * @param string $parent Required. The parent of the ModelDeploymentMonitoringJob. diff --git a/AiPlatform/src/V1/CreateNasJobRequest.php b/AiPlatform/src/V1/CreateNasJobRequest.php index 9d25d3c7b909..12c1010b4376 100644 --- a/AiPlatform/src/V1/CreateNasJobRequest.php +++ b/AiPlatform/src/V1/CreateNasJobRequest.php @@ -22,13 +22,13 @@ class CreateNasJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The NasJob to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.NasJob nas_job = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $nas_job = null; + protected $nas_job = null; /** * @param string $parent Required. The resource name of the Location to create the NasJob in. diff --git a/AiPlatform/src/V1/CreateNotebookRuntimeTemplateOperationMetadata.php b/AiPlatform/src/V1/CreateNotebookRuntimeTemplateOperationMetadata.php index ebe3d31c4744..37373db16dbe 100644 --- a/AiPlatform/src/V1/CreateNotebookRuntimeTemplateOperationMetadata.php +++ b/AiPlatform/src/V1/CreateNotebookRuntimeTemplateOperationMetadata.php @@ -21,7 +21,7 @@ class CreateNotebookRuntimeTemplateOperationMetadata extends \Google\Protobuf\In * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateNotebookRuntimeTemplateRequest.php b/AiPlatform/src/V1/CreateNotebookRuntimeTemplateRequest.php index 3f98a973d495..3ca52baacf6f 100644 --- a/AiPlatform/src/V1/CreateNotebookRuntimeTemplateRequest.php +++ b/AiPlatform/src/V1/CreateNotebookRuntimeTemplateRequest.php @@ -22,19 +22,19 @@ class CreateNotebookRuntimeTemplateRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The NotebookRuntimeTemplate to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntimeTemplate notebook_runtime_template = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $notebook_runtime_template = null; + protected $notebook_runtime_template = null; /** * Optional. User specified ID for the notebook runtime template. * * Generated from protobuf field string notebook_runtime_template_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $notebook_runtime_template_id = ''; + protected $notebook_runtime_template_id = ''; /** * @param string $parent Required. The resource name of the Location to create the diff --git a/AiPlatform/src/V1/CreatePersistentResourceOperationMetadata.php b/AiPlatform/src/V1/CreatePersistentResourceOperationMetadata.php index 77f013958a4d..b963a2703371 100644 --- a/AiPlatform/src/V1/CreatePersistentResourceOperationMetadata.php +++ b/AiPlatform/src/V1/CreatePersistentResourceOperationMetadata.php @@ -20,13 +20,13 @@ class CreatePersistentResourceOperationMetadata extends \Google\Protobuf\Interna * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Progress Message for Create LRO * * Generated from protobuf field string progress_message = 2; */ - private $progress_message = ''; + protected $progress_message = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/CreatePersistentResourceRequest.php b/AiPlatform/src/V1/CreatePersistentResourceRequest.php index 394dde330e1d..4010dc35ad9a 100644 --- a/AiPlatform/src/V1/CreatePersistentResourceRequest.php +++ b/AiPlatform/src/V1/CreatePersistentResourceRequest.php @@ -22,13 +22,13 @@ class CreatePersistentResourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The PersistentResource to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.PersistentResource persistent_resource = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $persistent_resource = null; + protected $persistent_resource = null; /** * Required. The ID to use for the PersistentResource, which become the final * component of the PersistentResource's resource name. @@ -37,7 +37,7 @@ class CreatePersistentResourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string persistent_resource_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $persistent_resource_id = ''; + protected $persistent_resource_id = ''; /** * @param string $parent Required. The resource name of the Location to create the diff --git a/AiPlatform/src/V1/CreatePipelineJobRequest.php b/AiPlatform/src/V1/CreatePipelineJobRequest.php index a200921e44d6..3f82ca54660f 100644 --- a/AiPlatform/src/V1/CreatePipelineJobRequest.php +++ b/AiPlatform/src/V1/CreatePipelineJobRequest.php @@ -22,13 +22,13 @@ class CreatePipelineJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The PipelineJob to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineJob pipeline_job = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $pipeline_job = null; + protected $pipeline_job = null; /** * The ID to use for the PipelineJob, which will become the final component of * the PipelineJob name. If not provided, an ID will be automatically @@ -38,7 +38,7 @@ class CreatePipelineJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string pipeline_job_id = 3; */ - private $pipeline_job_id = ''; + protected $pipeline_job_id = ''; /** * @param string $parent Required. The resource name of the Location to create the PipelineJob in. diff --git a/AiPlatform/src/V1/CreateRegistryFeatureOperationMetadata.php b/AiPlatform/src/V1/CreateRegistryFeatureOperationMetadata.php index 8f9bd4e0e2ed..bd41c4b8e253 100644 --- a/AiPlatform/src/V1/CreateRegistryFeatureOperationMetadata.php +++ b/AiPlatform/src/V1/CreateRegistryFeatureOperationMetadata.php @@ -20,7 +20,7 @@ class CreateRegistryFeatureOperationMetadata extends \Google\Protobuf\Internal\M * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateScheduleRequest.php b/AiPlatform/src/V1/CreateScheduleRequest.php index 30eabe624afc..1eedb9122b64 100644 --- a/AiPlatform/src/V1/CreateScheduleRequest.php +++ b/AiPlatform/src/V1/CreateScheduleRequest.php @@ -22,13 +22,13 @@ class CreateScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Schedule to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Schedule schedule = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $schedule = null; + protected $schedule = null; /** * @param string $parent Required. The resource name of the Location to create the Schedule in. diff --git a/AiPlatform/src/V1/CreateSpecialistPoolOperationMetadata.php b/AiPlatform/src/V1/CreateSpecialistPoolOperationMetadata.php index 73fc051fbce3..09d7fb3f3f32 100644 --- a/AiPlatform/src/V1/CreateSpecialistPoolOperationMetadata.php +++ b/AiPlatform/src/V1/CreateSpecialistPoolOperationMetadata.php @@ -21,7 +21,7 @@ class CreateSpecialistPoolOperationMetadata extends \Google\Protobuf\Internal\Me * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateSpecialistPoolRequest.php b/AiPlatform/src/V1/CreateSpecialistPoolRequest.php index b62126b820b4..99819c0e077d 100644 --- a/AiPlatform/src/V1/CreateSpecialistPoolRequest.php +++ b/AiPlatform/src/V1/CreateSpecialistPoolRequest.php @@ -22,13 +22,13 @@ class CreateSpecialistPoolRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The SpecialistPool to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.SpecialistPool specialist_pool = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $specialist_pool = null; + protected $specialist_pool = null; /** * @param string $parent Required. The parent Project name for the new SpecialistPool. diff --git a/AiPlatform/src/V1/CreateStudyRequest.php b/AiPlatform/src/V1/CreateStudyRequest.php index e5a2a16b5865..44171412c6f6 100644 --- a/AiPlatform/src/V1/CreateStudyRequest.php +++ b/AiPlatform/src/V1/CreateStudyRequest.php @@ -22,13 +22,13 @@ class CreateStudyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Study configuration used to create the Study. * * Generated from protobuf field .google.cloud.aiplatform.v1.Study study = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $study = null; + protected $study = null; /** * @param string $parent Required. The resource name of the Location to create the CustomJob in. diff --git a/AiPlatform/src/V1/CreateTensorboardExperimentRequest.php b/AiPlatform/src/V1/CreateTensorboardExperimentRequest.php index 8ffe522a768b..26fcd906e9ec 100644 --- a/AiPlatform/src/V1/CreateTensorboardExperimentRequest.php +++ b/AiPlatform/src/V1/CreateTensorboardExperimentRequest.php @@ -23,13 +23,13 @@ class CreateTensorboardExperimentRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The TensorboardExperiment to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.TensorboardExperiment tensorboard_experiment = 2; */ - private $tensorboard_experiment = null; + protected $tensorboard_experiment = null; /** * Required. The ID to use for the Tensorboard experiment, which becomes the * final component of the Tensorboard experiment's resource name. @@ -38,7 +38,7 @@ class CreateTensorboardExperimentRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string tensorboard_experiment_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard_experiment_id = ''; + protected $tensorboard_experiment_id = ''; /** * @param string $parent Required. The resource name of the Tensorboard to create the diff --git a/AiPlatform/src/V1/CreateTensorboardOperationMetadata.php b/AiPlatform/src/V1/CreateTensorboardOperationMetadata.php index 4032025394dd..d616c1223d86 100644 --- a/AiPlatform/src/V1/CreateTensorboardOperationMetadata.php +++ b/AiPlatform/src/V1/CreateTensorboardOperationMetadata.php @@ -20,7 +20,7 @@ class CreateTensorboardOperationMetadata extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CreateTensorboardRequest.php b/AiPlatform/src/V1/CreateTensorboardRequest.php index 2883cad8443a..c90005dce05d 100644 --- a/AiPlatform/src/V1/CreateTensorboardRequest.php +++ b/AiPlatform/src/V1/CreateTensorboardRequest.php @@ -22,13 +22,13 @@ class CreateTensorboardRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Tensorboard to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Tensorboard tensorboard = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard = null; + protected $tensorboard = null; /** * @param string $parent Required. The resource name of the Location to create the Tensorboard in. diff --git a/AiPlatform/src/V1/CreateTensorboardRunRequest.php b/AiPlatform/src/V1/CreateTensorboardRunRequest.php index f8e8e906fed0..4e6f6e0f97ac 100644 --- a/AiPlatform/src/V1/CreateTensorboardRunRequest.php +++ b/AiPlatform/src/V1/CreateTensorboardRunRequest.php @@ -23,13 +23,13 @@ class CreateTensorboardRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The TensorboardRun to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.TensorboardRun tensorboard_run = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard_run = null; + protected $tensorboard_run = null; /** * Required. The ID to use for the Tensorboard run, which becomes the final * component of the Tensorboard run's resource name. @@ -38,7 +38,7 @@ class CreateTensorboardRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tensorboard_run_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard_run_id = ''; + protected $tensorboard_run_id = ''; /** * @param string $parent Required. The resource name of the TensorboardExperiment to create the diff --git a/AiPlatform/src/V1/CreateTensorboardTimeSeriesRequest.php b/AiPlatform/src/V1/CreateTensorboardTimeSeriesRequest.php index ea596b317977..083318647e35 100644 --- a/AiPlatform/src/V1/CreateTensorboardTimeSeriesRequest.php +++ b/AiPlatform/src/V1/CreateTensorboardTimeSeriesRequest.php @@ -24,7 +24,7 @@ class CreateTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The user specified unique ID to use for the * TensorboardTimeSeries, which becomes the final component of the @@ -33,13 +33,13 @@ class CreateTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string tensorboard_time_series_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $tensorboard_time_series_id = ''; + protected $tensorboard_time_series_id = ''; /** * Required. The TensorboardTimeSeries to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.TensorboardTimeSeries tensorboard_time_series = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard_time_series = null; + protected $tensorboard_time_series = null; /** * @param string $parent Required. The resource name of the TensorboardRun to create the diff --git a/AiPlatform/src/V1/CreateTrainingPipelineRequest.php b/AiPlatform/src/V1/CreateTrainingPipelineRequest.php index 6062188d7cec..e7ee7ee5ed66 100644 --- a/AiPlatform/src/V1/CreateTrainingPipelineRequest.php +++ b/AiPlatform/src/V1/CreateTrainingPipelineRequest.php @@ -22,13 +22,13 @@ class CreateTrainingPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The TrainingPipeline to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.TrainingPipeline training_pipeline = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $training_pipeline = null; + protected $training_pipeline = null; /** * @param string $parent Required. The resource name of the Location to create the TrainingPipeline diff --git a/AiPlatform/src/V1/CreateTrialRequest.php b/AiPlatform/src/V1/CreateTrialRequest.php index d14fc9105ba4..d2551167761d 100644 --- a/AiPlatform/src/V1/CreateTrialRequest.php +++ b/AiPlatform/src/V1/CreateTrialRequest.php @@ -22,13 +22,13 @@ class CreateTrialRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Trial to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Trial trial = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $trial = null; + protected $trial = null; /** * @param string $parent Required. The resource name of the Study to create the Trial in. diff --git a/AiPlatform/src/V1/CreateTuningJobRequest.php b/AiPlatform/src/V1/CreateTuningJobRequest.php index 2b013f8c374e..345c2afa06f0 100644 --- a/AiPlatform/src/V1/CreateTuningJobRequest.php +++ b/AiPlatform/src/V1/CreateTuningJobRequest.php @@ -22,13 +22,13 @@ class CreateTuningJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The TuningJob to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.TuningJob tuning_job = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $tuning_job = null; + protected $tuning_job = null; /** * @param string $parent Required. The resource name of the Location to create the TuningJob in. diff --git a/AiPlatform/src/V1/CsvDestination.php b/AiPlatform/src/V1/CsvDestination.php index bcdfe510d0d5..70c7a3eafe6e 100644 --- a/AiPlatform/src/V1/CsvDestination.php +++ b/AiPlatform/src/V1/CsvDestination.php @@ -20,7 +20,7 @@ class CsvDestination extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $gcs_destination = null; + protected $gcs_destination = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CsvSource.php b/AiPlatform/src/V1/CsvSource.php index ec93fefa9877..9831670ed928 100644 --- a/AiPlatform/src/V1/CsvSource.php +++ b/AiPlatform/src/V1/CsvSource.php @@ -20,7 +20,7 @@ class CsvSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $gcs_source = null; + protected $gcs_source = null; /** * Constructor. diff --git a/AiPlatform/src/V1/CustomJob.php b/AiPlatform/src/V1/CustomJob.php index 5b32c0a03113..116820996d64 100644 --- a/AiPlatform/src/V1/CustomJob.php +++ b/AiPlatform/src/V1/CustomJob.php @@ -23,7 +23,7 @@ class CustomJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The display name of the CustomJob. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -31,52 +31,52 @@ class CustomJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Required. Job spec. * * Generated from protobuf field .google.cloud.aiplatform.v1.CustomJobSpec job_spec = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $job_spec = null; + protected $job_spec = null; /** * Output only. The detailed state of the job. * * Generated from protobuf field .google.cloud.aiplatform.v1.JobState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Time when the CustomJob was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time when the CustomJob for the first time entered the * `JOB_STATE_RUNNING` state. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time when the CustomJob entered any of the following states: * `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Time when the CustomJob was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Only populated when job's state is `JOB_STATE_FAILED` or * `JOB_STATE_CANCELLED`. * * Generated from protobuf field .google.rpc.Status error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * The labels with user-defined metadata to organize CustomJobs. * Label keys and values can be no longer than 64 characters @@ -94,7 +94,7 @@ class CustomJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 12; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Output only. URIs for accessing [interactive * shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) diff --git a/AiPlatform/src/V1/CustomJobSpec.php b/AiPlatform/src/V1/CustomJobSpec.php index d4226496f917..5cb74488ed68 100644 --- a/AiPlatform/src/V1/CustomJobSpec.php +++ b/AiPlatform/src/V1/CustomJobSpec.php @@ -25,7 +25,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string persistent_resource_id = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $persistent_resource_id = ''; + protected $persistent_resource_id = ''; /** * Required. The spec of the worker pools including machine type and Docker * image. All worker pools except the first one are optional and can be @@ -39,7 +39,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Scheduling scheduling = 3; */ - private $scheduling = null; + protected $scheduling = null; /** * Specifies the service account for workload run-as account. * Users submitting jobs must have act-as permission on this run-as account. @@ -49,12 +49,12 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 4; */ - private $service_account = ''; + protected $service_account = ''; /** * Optional. The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the Job + * [network](/compute/docs/networks-and-firewalls#networks) to which the Job * should be peered. For example, `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. @@ -65,7 +65,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $network = ''; + protected $network = ''; /** * Optional. A list of names for the reserved ip ranges under the VPC network * that can be used for this job. @@ -97,7 +97,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GcsDestination base_output_directory = 6; */ - private $base_output_directory = null; + protected $base_output_directory = null; /** * The ID of the location to store protected artifacts. e.g. us-central1. * Populate only when the location is different than CustomJob location. @@ -106,7 +106,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string protected_artifact_location_id = 19; */ - private $protected_artifact_location_id = ''; + protected $protected_artifact_location_id = ''; /** * Optional. The name of a Vertex AI * [Tensorboard][google.cloud.aiplatform.v1.Tensorboard] resource to which @@ -115,7 +115,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tensorboard = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $tensorboard = ''; + protected $tensorboard = ''; /** * Optional. Whether you want Vertex AI to enable [interactive shell * access](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) @@ -130,7 +130,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_web_access = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_web_access = false; + protected $enable_web_access = false; /** * Optional. Whether you want Vertex AI to enable access to the customized * dashboard in training chief container. @@ -144,7 +144,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_dashboard_access = 16 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_dashboard_access = false; + protected $enable_dashboard_access = false; /** * Optional. The Experiment associated with this job. * Format: @@ -152,7 +152,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string experiment = 17 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $experiment = ''; + protected $experiment = ''; /** * Optional. The Experiment Run associated with this job. * Format: @@ -160,7 +160,7 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string experiment_run = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $experiment_run = ''; + protected $experiment_run = ''; /** * Optional. The name of the Model resources for which to generate a mapping * to artifact URIs. Applicable only to some of the Google-provided custom @@ -206,9 +206,9 @@ class CustomJobSpec extends \Google\Protobuf\Internal\Message * for the CustomJob's project is used. * @type string $network * Optional. The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the Job + * [network](/compute/docs/networks-and-firewalls#networks) to which the Job * should be peered. For example, `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. @@ -437,9 +437,9 @@ public function setServiceAccount($var) /** * Optional. The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the Job + * [network](/compute/docs/networks-and-firewalls#networks) to which the Job * should be peered. For example, `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. @@ -458,9 +458,9 @@ public function getNetwork() /** * Optional. The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the Job + * [network](/compute/docs/networks-and-firewalls#networks) to which the Job * should be peered. For example, `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. diff --git a/AiPlatform/src/V1/DataItem.php b/AiPlatform/src/V1/DataItem.php index 86e3d6f4d46f..91a3e21374be 100644 --- a/AiPlatform/src/V1/DataItem.php +++ b/AiPlatform/src/V1/DataItem.php @@ -21,19 +21,19 @@ class DataItem extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Timestamp when this DataItem was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this DataItem was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. The labels with user-defined metadata to organize your DataItems. * Label keys and values can be no longer than 64 characters @@ -56,14 +56,14 @@ class DataItem extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value payload = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $payload = null; + protected $payload = null; /** * Optional. Used to perform consistent read-modify-write updates. If not set, * a blind "overwrite" update happens. * * Generated from protobuf field string etag = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/DataItemView.php b/AiPlatform/src/V1/DataItemView.php index bd744a29067b..fa12a0e7d8ad 100644 --- a/AiPlatform/src/V1/DataItemView.php +++ b/AiPlatform/src/V1/DataItemView.php @@ -20,7 +20,7 @@ class DataItemView extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DataItem data_item = 1; */ - private $data_item = null; + protected $data_item = null; /** * The Annotations on the DataItem. If too many Annotations should be returned * for the DataItem, this field will be truncated per annotations_limit in @@ -39,7 +39,7 @@ class DataItemView extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool has_truncated_annotations = 3; */ - private $has_truncated_annotations = false; + protected $has_truncated_annotations = false; /** * Constructor. diff --git a/AiPlatform/src/V1/DataLabelingJob.php b/AiPlatform/src/V1/DataLabelingJob.php index a8758ee78a71..c416d3c5caa9 100644 --- a/AiPlatform/src/V1/DataLabelingJob.php +++ b/AiPlatform/src/V1/DataLabelingJob.php @@ -21,7 +21,7 @@ class DataLabelingJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-defined name of the DataLabelingJob. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -30,7 +30,7 @@ class DataLabelingJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Required. Dataset resource names. Right now we only support labeling from a * single Dataset. Format: @@ -56,7 +56,7 @@ class DataLabelingJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 labeler_count = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $labeler_count = 0; + protected $labeler_count = 0; /** * Required. The Google Cloud Storage location of the instruction pdf. This * pdf is shared with labelers, and provides detailed description on how to @@ -64,7 +64,7 @@ class DataLabelingJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string instruction_uri = 5 [(.google.api.field_behavior) = REQUIRED]; */ - private $instruction_uri = ''; + protected $instruction_uri = ''; /** * Required. Points to a YAML file stored on Google Cloud Storage describing * the config for a specific type of DataLabelingJob. The schema files that @@ -74,52 +74,52 @@ class DataLabelingJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string inputs_schema_uri = 6 [(.google.api.field_behavior) = REQUIRED]; */ - private $inputs_schema_uri = ''; + protected $inputs_schema_uri = ''; /** * Required. Input config parameters for the DataLabelingJob. * * Generated from protobuf field .google.protobuf.Value inputs = 7 [(.google.api.field_behavior) = REQUIRED]; */ - private $inputs = null; + protected $inputs = null; /** * Output only. The detailed state of the job. * * Generated from protobuf field .google.cloud.aiplatform.v1.JobState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Current labeling job progress percentage scaled in interval * [0, 100], indicating the percentage of DataItems that has been finished. * * Generated from protobuf field int32 labeling_progress = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $labeling_progress = 0; + protected $labeling_progress = 0; /** * Output only. Estimated cost(in US dollars) that the DataLabelingJob has * incurred to date. * * Generated from protobuf field .google.type.Money current_spend = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $current_spend = null; + protected $current_spend = null; /** * Output only. Timestamp when this DataLabelingJob was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this DataLabelingJob was updated most recently. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. DataLabelingJob errors. It is only populated when job's state * is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. * * Generated from protobuf field .google.rpc.Status error = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * The labels with user-defined metadata to organize your DataLabelingJobs. * Label keys and values can be no longer than 64 characters @@ -149,7 +149,7 @@ class DataLabelingJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 20; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Parameters that configure the active learning pipeline. Active learning * will label the data incrementally via several iterations. For every @@ -157,7 +157,7 @@ class DataLabelingJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ActiveLearningConfig active_learning_config = 21; */ - private $active_learning_config = null; + protected $active_learning_config = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Dataset.php b/AiPlatform/src/V1/Dataset.php index da38705f70fd..2167b87a67bd 100644 --- a/AiPlatform/src/V1/Dataset.php +++ b/AiPlatform/src/V1/Dataset.php @@ -20,7 +20,7 @@ class Dataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-defined name of the Dataset. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -28,13 +28,13 @@ class Dataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * The description of the Dataset. * * Generated from protobuf field string description = 16; */ - private $description = ''; + protected $description = ''; /** * Required. Points to a YAML file stored on Google Cloud Storage describing * additional information about the Dataset. The schema is defined as an @@ -43,39 +43,39 @@ class Dataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_schema_uri = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_schema_uri = ''; + protected $metadata_schema_uri = ''; /** * Required. Additional information about the Dataset. * * Generated from protobuf field .google.protobuf.Value metadata = 8 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata = null; + protected $metadata = null; /** * Output only. The number of DataItems in this Dataset. Only apply for * non-structured Dataset. * * Generated from protobuf field int64 data_item_count = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $data_item_count = 0; + protected $data_item_count = 0; /** * Output only. Timestamp when this Dataset was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Dataset was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Used to perform consistent read-modify-write updates. If not set, a blind * "overwrite" update happens. * * Generated from protobuf field string etag = 6; */ - private $etag = ''; + protected $etag = ''; /** * The labels with user-defined metadata to organize your Datasets. * Label keys and values can be no longer than 64 characters @@ -112,7 +112,7 @@ class Dataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 11; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Output only. The resource name of the Artifact that was created in * MetadataStore when creating the Dataset. The Artifact resource name pattern @@ -121,7 +121,14 @@ class Dataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_artifact = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata_artifact = ''; + protected $metadata_artifact = ''; + /** + * Optional. Reference to the public base model last used by the dataset. Only + * set for prompt datasets. + * + * Generated from protobuf field string model_reference = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model_reference = ''; /** * Constructor. @@ -184,6 +191,9 @@ class Dataset extends \Google\Protobuf\Internal\Message * MetadataStore when creating the Dataset. The Artifact resource name pattern * is * `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. + * @type string $model_reference + * Optional. Reference to the public base model last used by the dataset. Only + * set for prompt datasets. * } */ public function __construct($data = NULL) { @@ -627,5 +637,33 @@ public function setMetadataArtifact($var) return $this; } + /** + * Optional. Reference to the public base model last used by the dataset. Only + * set for prompt datasets. + * + * Generated from protobuf field string model_reference = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getModelReference() + { + return $this->model_reference; + } + + /** + * Optional. Reference to the public base model last used by the dataset. Only + * set for prompt datasets. + * + * Generated from protobuf field string model_reference = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setModelReference($var) + { + GPBUtil::checkString($var, True); + $this->model_reference = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/DatasetServiceClient.php b/AiPlatform/src/V1/DatasetServiceClient.php deleted file mode 100644 index b8f0e177540c..000000000000 --- a/AiPlatform/src/V1/DatasetServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/CreateDataset', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets a Dataset. - * @param \Google\Cloud\AIPlatform\V1\GetDatasetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetDataset(\Google\Cloud\AIPlatform\V1\GetDatasetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/GetDataset', - $argument, - ['\Google\Cloud\AIPlatform\V1\Dataset', 'decode'], - $metadata, $options); - } - - /** - * Updates a Dataset. - * @param \Google\Cloud\AIPlatform\V1\UpdateDatasetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateDataset(\Google\Cloud\AIPlatform\V1\UpdateDatasetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/UpdateDataset', - $argument, - ['\Google\Cloud\AIPlatform\V1\Dataset', 'decode'], - $metadata, $options); - } - - /** - * Lists Datasets in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListDatasetsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListDatasets(\Google\Cloud\AIPlatform\V1\ListDatasetsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/ListDatasets', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListDatasetsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a Dataset. - * @param \Google\Cloud\AIPlatform\V1\DeleteDatasetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteDataset(\Google\Cloud\AIPlatform\V1\DeleteDatasetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/DeleteDataset', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Imports data into a Dataset. - * @param \Google\Cloud\AIPlatform\V1\ImportDataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportData(\Google\Cloud\AIPlatform\V1\ImportDataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/ImportData', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Exports data from a Dataset. - * @param \Google\Cloud\AIPlatform\V1\ExportDataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportData(\Google\Cloud\AIPlatform\V1\ExportDataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/ExportData', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists DataItems in a Dataset. - * @param \Google\Cloud\AIPlatform\V1\ListDataItemsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListDataItems(\Google\Cloud\AIPlatform\V1\ListDataItemsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/ListDataItems', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListDataItemsResponse', 'decode'], - $metadata, $options); - } - - /** - * Searches DataItems in a Dataset. - * @param \Google\Cloud\AIPlatform\V1\SearchDataItemsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SearchDataItems(\Google\Cloud\AIPlatform\V1\SearchDataItemsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/SearchDataItems', - $argument, - ['\Google\Cloud\AIPlatform\V1\SearchDataItemsResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists SavedQueries in a Dataset. - * @param \Google\Cloud\AIPlatform\V1\ListSavedQueriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListSavedQueries(\Google\Cloud\AIPlatform\V1\ListSavedQueriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/ListSavedQueries', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListSavedQueriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets an AnnotationSpec. - * @param \Google\Cloud\AIPlatform\V1\GetAnnotationSpecRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetAnnotationSpec(\Google\Cloud\AIPlatform\V1\GetAnnotationSpecRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/GetAnnotationSpec', - $argument, - ['\Google\Cloud\AIPlatform\V1\AnnotationSpec', 'decode'], - $metadata, $options); - } - - /** - * Lists Annotations belongs to a dataitem - * @param \Google\Cloud\AIPlatform\V1\ListAnnotationsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListAnnotations(\Google\Cloud\AIPlatform\V1\ListAnnotationsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.DatasetService/ListAnnotations', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListAnnotationsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/DatasetVersion.php b/AiPlatform/src/V1/DatasetVersion.php index 87f29abc0bcc..ef3f8046726b 100644 --- a/AiPlatform/src/V1/DatasetVersion.php +++ b/AiPlatform/src/V1/DatasetVersion.php @@ -20,32 +20,32 @@ class DatasetVersion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Timestamp when this DatasetVersion was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this DatasetVersion was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Used to perform consistent read-modify-write updates. If not set, a blind * "overwrite" update happens. * * Generated from protobuf field string etag = 3; */ - private $etag = ''; + protected $etag = ''; /** * Output only. Name of the associated BigQuery dataset. * * Generated from protobuf field string big_query_dataset_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $big_query_dataset_name = ''; + protected $big_query_dataset_name = ''; /** * The user-defined name of the DatasetVersion. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -53,13 +53,20 @@ class DatasetVersion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 7; */ - private $display_name = ''; + protected $display_name = ''; /** * Required. Output only. Additional information about the DatasetVersion. * * Generated from protobuf field .google.protobuf.Value metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = REQUIRED]; */ - private $metadata = null; + protected $metadata = null; + /** + * Output only. Reference to the public base model last used by the dataset + * version. Only set for prompt dataset versions. + * + * Generated from protobuf field string model_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $model_reference = ''; /** * Constructor. @@ -84,6 +91,9 @@ class DatasetVersion extends \Google\Protobuf\Internal\Message * characters. * @type \Google\Protobuf\Value $metadata * Required. Output only. Additional information about the DatasetVersion. + * @type string $model_reference + * Output only. Reference to the public base model last used by the dataset + * version. Only set for prompt dataset versions. * } */ public function __construct($data = NULL) { @@ -309,5 +319,33 @@ public function setMetadata($var) return $this; } + /** + * Output only. Reference to the public base model last used by the dataset + * version. Only set for prompt dataset versions. + * + * Generated from protobuf field string model_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getModelReference() + { + return $this->model_reference; + } + + /** + * Output only. Reference to the public base model last used by the dataset + * version. Only set for prompt dataset versions. + * + * Generated from protobuf field string model_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setModelReference($var) + { + GPBUtil::checkString($var, True); + $this->model_reference = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/DedicatedResources.php b/AiPlatform/src/V1/DedicatedResources.php index 688d97ceac5d..fb3935c5e29e 100644 --- a/AiPlatform/src/V1/DedicatedResources.php +++ b/AiPlatform/src/V1/DedicatedResources.php @@ -22,7 +22,7 @@ class DedicatedResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $machine_spec = null; + protected $machine_spec = null; /** * Required. Immutable. The minimum number of machine replicas this * DeployedModel will be always deployed on. This value must be greater than @@ -33,7 +33,7 @@ class DedicatedResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 min_replica_count = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $min_replica_count = 0; + protected $min_replica_count = 0; /** * Immutable. The maximum number of replicas this DeployedModel may be * deployed on when the traffic against it increases. If the requested value @@ -51,7 +51,7 @@ class DedicatedResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $max_replica_count = 0; + protected $max_replica_count = 0; /** * Immutable. The metric specifications that overrides a resource * utilization metric (CPU utilization, accelerator's duty cycle, and so on) diff --git a/AiPlatform/src/V1/DeleteArtifactRequest.php b/AiPlatform/src/V1/DeleteArtifactRequest.php index d857b6bc21ca..69049a86d5d5 100644 --- a/AiPlatform/src/V1/DeleteArtifactRequest.php +++ b/AiPlatform/src/V1/DeleteArtifactRequest.php @@ -23,7 +23,7 @@ class DeleteArtifactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The etag of the Artifact to delete. * If this is provided, it must match the server's etag. Otherwise, the @@ -31,7 +31,7 @@ class DeleteArtifactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the Artifact to delete. diff --git a/AiPlatform/src/V1/DeleteBatchPredictionJobRequest.php b/AiPlatform/src/V1/DeleteBatchPredictionJobRequest.php index 0e175e40b871..93c65b3bac11 100644 --- a/AiPlatform/src/V1/DeleteBatchPredictionJobRequest.php +++ b/AiPlatform/src/V1/DeleteBatchPredictionJobRequest.php @@ -23,7 +23,7 @@ class DeleteBatchPredictionJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the BatchPredictionJob resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteContextRequest.php b/AiPlatform/src/V1/DeleteContextRequest.php index 5d0e4ed05656..8f9511ceaaea 100644 --- a/AiPlatform/src/V1/DeleteContextRequest.php +++ b/AiPlatform/src/V1/DeleteContextRequest.php @@ -23,14 +23,14 @@ class DeleteContextRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * The force deletion semantics is still undefined. * Users should not use this field. * * Generated from protobuf field bool force = 2; */ - private $force = false; + protected $force = false; /** * Optional. The etag of the Context to delete. * If this is provided, it must match the server's etag. Otherwise, the @@ -38,7 +38,7 @@ class DeleteContextRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the Context to delete. diff --git a/AiPlatform/src/V1/DeleteCustomJobRequest.php b/AiPlatform/src/V1/DeleteCustomJobRequest.php index 48f65b9a342a..dfed82fefc6c 100644 --- a/AiPlatform/src/V1/DeleteCustomJobRequest.php +++ b/AiPlatform/src/V1/DeleteCustomJobRequest.php @@ -23,7 +23,7 @@ class DeleteCustomJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the CustomJob resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteDataLabelingJobRequest.php b/AiPlatform/src/V1/DeleteDataLabelingJobRequest.php index eff40bb0df88..9dd7c2d0b6de 100644 --- a/AiPlatform/src/V1/DeleteDataLabelingJobRequest.php +++ b/AiPlatform/src/V1/DeleteDataLabelingJobRequest.php @@ -23,7 +23,7 @@ class DeleteDataLabelingJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the DataLabelingJob to be deleted. diff --git a/AiPlatform/src/V1/DeleteDatasetRequest.php b/AiPlatform/src/V1/DeleteDatasetRequest.php index 63310eff6146..7741c711a0ed 100644 --- a/AiPlatform/src/V1/DeleteDatasetRequest.php +++ b/AiPlatform/src/V1/DeleteDatasetRequest.php @@ -23,7 +23,7 @@ class DeleteDatasetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Dataset to delete. diff --git a/AiPlatform/src/V1/DeleteDatasetVersionRequest.php b/AiPlatform/src/V1/DeleteDatasetVersionRequest.php index 3e5c365e96a9..d4018dd2848e 100644 --- a/AiPlatform/src/V1/DeleteDatasetVersionRequest.php +++ b/AiPlatform/src/V1/DeleteDatasetVersionRequest.php @@ -23,7 +23,7 @@ class DeleteDatasetVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Dataset version to delete. diff --git a/AiPlatform/src/V1/DeleteDeploymentResourcePoolRequest.php b/AiPlatform/src/V1/DeleteDeploymentResourcePoolRequest.php index 9090687d97c9..486d65c04286 100644 --- a/AiPlatform/src/V1/DeleteDeploymentResourcePoolRequest.php +++ b/AiPlatform/src/V1/DeleteDeploymentResourcePoolRequest.php @@ -22,7 +22,7 @@ class DeleteDeploymentResourcePoolRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the DeploymentResourcePool to delete. diff --git a/AiPlatform/src/V1/DeleteEndpointRequest.php b/AiPlatform/src/V1/DeleteEndpointRequest.php index 84b554a9a7f2..598ba0620f61 100644 --- a/AiPlatform/src/V1/DeleteEndpointRequest.php +++ b/AiPlatform/src/V1/DeleteEndpointRequest.php @@ -23,7 +23,7 @@ class DeleteEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Endpoint resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteEntityTypeRequest.php b/AiPlatform/src/V1/DeleteEntityTypeRequest.php index 8d2916a61b58..092391e1e127 100644 --- a/AiPlatform/src/V1/DeleteEntityTypeRequest.php +++ b/AiPlatform/src/V1/DeleteEntityTypeRequest.php @@ -22,14 +22,14 @@ class DeleteEntityTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * If set to true, any Features for this EntityType will also be deleted. * (Otherwise, the request will only work if the EntityType has no Features.) * * Generated from protobuf field bool force = 2; */ - private $force = false; + protected $force = false; /** * @param string $name Required. The name of the EntityType to be deleted. diff --git a/AiPlatform/src/V1/DeleteExecutionRequest.php b/AiPlatform/src/V1/DeleteExecutionRequest.php index f82ab6f07078..cbd51947ca28 100644 --- a/AiPlatform/src/V1/DeleteExecutionRequest.php +++ b/AiPlatform/src/V1/DeleteExecutionRequest.php @@ -23,7 +23,7 @@ class DeleteExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The etag of the Execution to delete. * If this is provided, it must match the server's etag. Otherwise, the @@ -31,7 +31,7 @@ class DeleteExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the Execution to delete. diff --git a/AiPlatform/src/V1/DeleteFeatureGroupRequest.php b/AiPlatform/src/V1/DeleteFeatureGroupRequest.php index ca5dc0851a28..0cb4f265ddfa 100644 --- a/AiPlatform/src/V1/DeleteFeatureGroupRequest.php +++ b/AiPlatform/src/V1/DeleteFeatureGroupRequest.php @@ -23,7 +23,7 @@ class DeleteFeatureGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * If set to true, any Features under this FeatureGroup * will also be deleted. (Otherwise, the request will only work if the @@ -31,7 +31,7 @@ class DeleteFeatureGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool force = 2; */ - private $force = false; + protected $force = false; /** * @param string $name Required. The name of the FeatureGroup to be deleted. diff --git a/AiPlatform/src/V1/DeleteFeatureOnlineStoreRequest.php b/AiPlatform/src/V1/DeleteFeatureOnlineStoreRequest.php index 34c4f5474622..5fdd65765b87 100644 --- a/AiPlatform/src/V1/DeleteFeatureOnlineStoreRequest.php +++ b/AiPlatform/src/V1/DeleteFeatureOnlineStoreRequest.php @@ -23,7 +23,7 @@ class DeleteFeatureOnlineStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * If set to true, any FeatureViews and Features for this FeatureOnlineStore * will also be deleted. (Otherwise, the request will only work if the @@ -31,7 +31,7 @@ class DeleteFeatureOnlineStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool force = 2; */ - private $force = false; + protected $force = false; /** * @param string $name Required. The name of the FeatureOnlineStore to be deleted. diff --git a/AiPlatform/src/V1/DeleteFeatureRequest.php b/AiPlatform/src/V1/DeleteFeatureRequest.php index 4c0dd9c61b5b..e9e03c983ee1 100644 --- a/AiPlatform/src/V1/DeleteFeatureRequest.php +++ b/AiPlatform/src/V1/DeleteFeatureRequest.php @@ -26,7 +26,7 @@ class DeleteFeatureRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Features to be deleted. diff --git a/AiPlatform/src/V1/DeleteFeatureValuesOperationMetadata.php b/AiPlatform/src/V1/DeleteFeatureValuesOperationMetadata.php index 5ddb4bbccc35..63ba9f807d6c 100644 --- a/AiPlatform/src/V1/DeleteFeatureValuesOperationMetadata.php +++ b/AiPlatform/src/V1/DeleteFeatureValuesOperationMetadata.php @@ -20,7 +20,7 @@ class DeleteFeatureValuesOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DeleteFeatureValuesRequest.php b/AiPlatform/src/V1/DeleteFeatureValuesRequest.php index e27ce15977e5..19b97fb35222 100644 --- a/AiPlatform/src/V1/DeleteFeatureValuesRequest.php +++ b/AiPlatform/src/V1/DeleteFeatureValuesRequest.php @@ -23,7 +23,7 @@ class DeleteFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $entity_type = ''; + protected $entity_type = ''; protected $DeleteOption; /** diff --git a/AiPlatform/src/V1/DeleteFeatureValuesRequest/SelectEntity.php b/AiPlatform/src/V1/DeleteFeatureValuesRequest/SelectEntity.php index 7803ac465b7f..b218906c71d4 100644 --- a/AiPlatform/src/V1/DeleteFeatureValuesRequest/SelectEntity.php +++ b/AiPlatform/src/V1/DeleteFeatureValuesRequest/SelectEntity.php @@ -23,7 +23,7 @@ class SelectEntity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EntityIdSelector entity_id_selector = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $entity_id_selector = null; + protected $entity_id_selector = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DeleteFeatureValuesRequest/SelectTimeRangeAndFeature.php b/AiPlatform/src/V1/DeleteFeatureValuesRequest/SelectTimeRangeAndFeature.php index bb55bd270154..cc2a81a50fe1 100644 --- a/AiPlatform/src/V1/DeleteFeatureValuesRequest/SelectTimeRangeAndFeature.php +++ b/AiPlatform/src/V1/DeleteFeatureValuesRequest/SelectTimeRangeAndFeature.php @@ -26,14 +26,14 @@ class SelectTimeRangeAndFeature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.type.Interval time_range = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $time_range = null; + protected $time_range = null; /** * Required. Selectors choosing which feature values to be deleted from the * EntityType. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureSelector feature_selector = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_selector = null; + protected $feature_selector = null; /** * If set, data will not be deleted from online storage. * When time range is older than the data in online storage, setting this to @@ -41,7 +41,7 @@ class SelectTimeRangeAndFeature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool skip_online_storage_delete = 3; */ - private $skip_online_storage_delete = false; + protected $skip_online_storage_delete = false; /** * Constructor. diff --git a/AiPlatform/src/V1/DeleteFeatureValuesResponse/SelectEntity.php b/AiPlatform/src/V1/DeleteFeatureValuesResponse/SelectEntity.php index 92bfa3d129ca..399caacdff1a 100644 --- a/AiPlatform/src/V1/DeleteFeatureValuesResponse/SelectEntity.php +++ b/AiPlatform/src/V1/DeleteFeatureValuesResponse/SelectEntity.php @@ -22,14 +22,14 @@ class SelectEntity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 offline_storage_deleted_entity_row_count = 1; */ - private $offline_storage_deleted_entity_row_count = 0; + protected $offline_storage_deleted_entity_row_count = 0; /** * The count of deleted entities in the online storage. * Each entity ID corresponds to one entity. * * Generated from protobuf field int64 online_storage_deleted_entity_count = 2; */ - private $online_storage_deleted_entity_count = 0; + protected $online_storage_deleted_entity_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/DeleteFeatureValuesResponse/SelectTimeRangeAndFeature.php b/AiPlatform/src/V1/DeleteFeatureValuesResponse/SelectTimeRangeAndFeature.php index 0dc5452a0345..faa02a70a00c 100644 --- a/AiPlatform/src/V1/DeleteFeatureValuesResponse/SelectTimeRangeAndFeature.php +++ b/AiPlatform/src/V1/DeleteFeatureValuesResponse/SelectTimeRangeAndFeature.php @@ -21,7 +21,7 @@ class SelectTimeRangeAndFeature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 impacted_feature_count = 1; */ - private $impacted_feature_count = 0; + protected $impacted_feature_count = 0; /** * The count of modified entity rows in the offline storage. * Each row corresponds to the combination of an entity ID and a timestamp. @@ -31,7 +31,7 @@ class SelectTimeRangeAndFeature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 offline_storage_modified_entity_row_count = 2; */ - private $offline_storage_modified_entity_row_count = 0; + protected $offline_storage_modified_entity_row_count = 0; /** * The count of modified entities in the online storage. * Each entity ID corresponds to one entity. @@ -40,7 +40,7 @@ class SelectTimeRangeAndFeature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 online_storage_modified_entity_count = 3; */ - private $online_storage_modified_entity_count = 0; + protected $online_storage_modified_entity_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/DeleteFeatureViewRequest.php b/AiPlatform/src/V1/DeleteFeatureViewRequest.php index fc8fdac76994..11a935f82552 100644 --- a/AiPlatform/src/V1/DeleteFeatureViewRequest.php +++ b/AiPlatform/src/V1/DeleteFeatureViewRequest.php @@ -22,7 +22,7 @@ class DeleteFeatureViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the FeatureView to be deleted. diff --git a/AiPlatform/src/V1/DeleteFeaturestoreRequest.php b/AiPlatform/src/V1/DeleteFeaturestoreRequest.php index d69834106c16..8a70176fcb87 100644 --- a/AiPlatform/src/V1/DeleteFeaturestoreRequest.php +++ b/AiPlatform/src/V1/DeleteFeaturestoreRequest.php @@ -23,7 +23,7 @@ class DeleteFeaturestoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * If set to true, any EntityTypes and Features for this Featurestore will * also be deleted. (Otherwise, the request will only work if the Featurestore @@ -31,7 +31,7 @@ class DeleteFeaturestoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool force = 2; */ - private $force = false; + protected $force = false; /** * @param string $name Required. The name of the Featurestore to be deleted. diff --git a/AiPlatform/src/V1/DeleteHyperparameterTuningJobRequest.php b/AiPlatform/src/V1/DeleteHyperparameterTuningJobRequest.php index dbd254a1a85f..284f7482f6fb 100644 --- a/AiPlatform/src/V1/DeleteHyperparameterTuningJobRequest.php +++ b/AiPlatform/src/V1/DeleteHyperparameterTuningJobRequest.php @@ -23,7 +23,7 @@ class DeleteHyperparameterTuningJobRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the HyperparameterTuningJob resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteIndexEndpointRequest.php b/AiPlatform/src/V1/DeleteIndexEndpointRequest.php index 94407adef835..fb6aeef6104d 100644 --- a/AiPlatform/src/V1/DeleteIndexEndpointRequest.php +++ b/AiPlatform/src/V1/DeleteIndexEndpointRequest.php @@ -23,7 +23,7 @@ class DeleteIndexEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the IndexEndpoint resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteIndexRequest.php b/AiPlatform/src/V1/DeleteIndexRequest.php index 230927104fe3..418d40a7f0e9 100644 --- a/AiPlatform/src/V1/DeleteIndexRequest.php +++ b/AiPlatform/src/V1/DeleteIndexRequest.php @@ -23,7 +23,7 @@ class DeleteIndexRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Index resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteMetadataStoreOperationMetadata.php b/AiPlatform/src/V1/DeleteMetadataStoreOperationMetadata.php index 38acca76eee8..c8b6e4005039 100644 --- a/AiPlatform/src/V1/DeleteMetadataStoreOperationMetadata.php +++ b/AiPlatform/src/V1/DeleteMetadataStoreOperationMetadata.php @@ -21,7 +21,7 @@ class DeleteMetadataStoreOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DeleteMetadataStoreRequest.php b/AiPlatform/src/V1/DeleteMetadataStoreRequest.php index 2b2918ac9371..1ff107a40ef7 100644 --- a/AiPlatform/src/V1/DeleteMetadataStoreRequest.php +++ b/AiPlatform/src/V1/DeleteMetadataStoreRequest.php @@ -23,7 +23,7 @@ class DeleteMetadataStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Deprecated: Field is no longer supported. * diff --git a/AiPlatform/src/V1/DeleteModelDeploymentMonitoringJobRequest.php b/AiPlatform/src/V1/DeleteModelDeploymentMonitoringJobRequest.php index 9e52b0710897..3497dadbb97e 100644 --- a/AiPlatform/src/V1/DeleteModelDeploymentMonitoringJobRequest.php +++ b/AiPlatform/src/V1/DeleteModelDeploymentMonitoringJobRequest.php @@ -23,7 +23,7 @@ class DeleteModelDeploymentMonitoringJobRequest extends \Google\Protobuf\Interna * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the model monitoring job to delete. diff --git a/AiPlatform/src/V1/DeleteModelRequest.php b/AiPlatform/src/V1/DeleteModelRequest.php index f7092269cd3d..1faeb4d0ff54 100644 --- a/AiPlatform/src/V1/DeleteModelRequest.php +++ b/AiPlatform/src/V1/DeleteModelRequest.php @@ -22,7 +22,7 @@ class DeleteModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Model resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteModelVersionRequest.php b/AiPlatform/src/V1/DeleteModelVersionRequest.php index e14050649e00..594e38fefb09 100644 --- a/AiPlatform/src/V1/DeleteModelVersionRequest.php +++ b/AiPlatform/src/V1/DeleteModelVersionRequest.php @@ -23,7 +23,7 @@ class DeleteModelVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the model version to be deleted, with a version ID diff --git a/AiPlatform/src/V1/DeleteNasJobRequest.php b/AiPlatform/src/V1/DeleteNasJobRequest.php index d5a8900afe0f..3fc52e5916c0 100644 --- a/AiPlatform/src/V1/DeleteNasJobRequest.php +++ b/AiPlatform/src/V1/DeleteNasJobRequest.php @@ -23,7 +23,7 @@ class DeleteNasJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NasJob resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteNotebookRuntimeRequest.php b/AiPlatform/src/V1/DeleteNotebookRuntimeRequest.php index a0c67218a3d0..82e4d93ff2a7 100644 --- a/AiPlatform/src/V1/DeleteNotebookRuntimeRequest.php +++ b/AiPlatform/src/V1/DeleteNotebookRuntimeRequest.php @@ -24,7 +24,7 @@ class DeleteNotebookRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NotebookRuntime resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteNotebookRuntimeTemplateRequest.php b/AiPlatform/src/V1/DeleteNotebookRuntimeTemplateRequest.php index 27c1e29a1fe3..72f20a0d917d 100644 --- a/AiPlatform/src/V1/DeleteNotebookRuntimeTemplateRequest.php +++ b/AiPlatform/src/V1/DeleteNotebookRuntimeTemplateRequest.php @@ -23,7 +23,7 @@ class DeleteNotebookRuntimeTemplateRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NotebookRuntimeTemplate resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteOperationMetadata.php b/AiPlatform/src/V1/DeleteOperationMetadata.php index 9e860917c5d7..550d06373645 100644 --- a/AiPlatform/src/V1/DeleteOperationMetadata.php +++ b/AiPlatform/src/V1/DeleteOperationMetadata.php @@ -20,7 +20,7 @@ class DeleteOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DeletePersistentResourceRequest.php b/AiPlatform/src/V1/DeletePersistentResourceRequest.php index 07814ad2f199..0ff38cba1d08 100644 --- a/AiPlatform/src/V1/DeletePersistentResourceRequest.php +++ b/AiPlatform/src/V1/DeletePersistentResourceRequest.php @@ -23,7 +23,7 @@ class DeletePersistentResourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the PersistentResource to be deleted. diff --git a/AiPlatform/src/V1/DeletePipelineJobRequest.php b/AiPlatform/src/V1/DeletePipelineJobRequest.php index 0d2aa8653a21..b20e5935e894 100644 --- a/AiPlatform/src/V1/DeletePipelineJobRequest.php +++ b/AiPlatform/src/V1/DeletePipelineJobRequest.php @@ -23,7 +23,7 @@ class DeletePipelineJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the PipelineJob resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteSavedQueryRequest.php b/AiPlatform/src/V1/DeleteSavedQueryRequest.php index fcf11f962a97..c11454383354 100644 --- a/AiPlatform/src/V1/DeleteSavedQueryRequest.php +++ b/AiPlatform/src/V1/DeleteSavedQueryRequest.php @@ -23,7 +23,7 @@ class DeleteSavedQueryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the SavedQuery to delete. diff --git a/AiPlatform/src/V1/DeleteScheduleRequest.php b/AiPlatform/src/V1/DeleteScheduleRequest.php index c527b2d1dfc8..ea69f30d7497 100644 --- a/AiPlatform/src/V1/DeleteScheduleRequest.php +++ b/AiPlatform/src/V1/DeleteScheduleRequest.php @@ -23,7 +23,7 @@ class DeleteScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Schedule resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteSpecialistPoolRequest.php b/AiPlatform/src/V1/DeleteSpecialistPoolRequest.php index 03d4d29cb2b4..4f480e345c69 100644 --- a/AiPlatform/src/V1/DeleteSpecialistPoolRequest.php +++ b/AiPlatform/src/V1/DeleteSpecialistPoolRequest.php @@ -22,7 +22,7 @@ class DeleteSpecialistPoolRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * If set to true, any specialist managers in this SpecialistPool will also be * deleted. (Otherwise, the request will only work if the SpecialistPool has @@ -30,7 +30,7 @@ class DeleteSpecialistPoolRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool force = 2; */ - private $force = false; + protected $force = false; /** * @param string $name Required. The resource name of the SpecialistPool to delete. Format: diff --git a/AiPlatform/src/V1/DeleteStudyRequest.php b/AiPlatform/src/V1/DeleteStudyRequest.php index 7a1c8d45729d..64b41f042682 100644 --- a/AiPlatform/src/V1/DeleteStudyRequest.php +++ b/AiPlatform/src/V1/DeleteStudyRequest.php @@ -22,7 +22,7 @@ class DeleteStudyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Study resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteTensorboardExperimentRequest.php b/AiPlatform/src/V1/DeleteTensorboardExperimentRequest.php index 74d93933146e..f35a73540e67 100644 --- a/AiPlatform/src/V1/DeleteTensorboardExperimentRequest.php +++ b/AiPlatform/src/V1/DeleteTensorboardExperimentRequest.php @@ -23,7 +23,7 @@ class DeleteTensorboardExperimentRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TensorboardExperiment to be deleted. diff --git a/AiPlatform/src/V1/DeleteTensorboardRequest.php b/AiPlatform/src/V1/DeleteTensorboardRequest.php index 929acfb4813f..a7230c9e783a 100644 --- a/AiPlatform/src/V1/DeleteTensorboardRequest.php +++ b/AiPlatform/src/V1/DeleteTensorboardRequest.php @@ -23,7 +23,7 @@ class DeleteTensorboardRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Tensorboard to be deleted. diff --git a/AiPlatform/src/V1/DeleteTensorboardRunRequest.php b/AiPlatform/src/V1/DeleteTensorboardRunRequest.php index e1a6162b3673..f63d3f04fde3 100644 --- a/AiPlatform/src/V1/DeleteTensorboardRunRequest.php +++ b/AiPlatform/src/V1/DeleteTensorboardRunRequest.php @@ -23,7 +23,7 @@ class DeleteTensorboardRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TensorboardRun to be deleted. diff --git a/AiPlatform/src/V1/DeleteTensorboardTimeSeriesRequest.php b/AiPlatform/src/V1/DeleteTensorboardTimeSeriesRequest.php index 1e87b470b1fe..489585d7153b 100644 --- a/AiPlatform/src/V1/DeleteTensorboardTimeSeriesRequest.php +++ b/AiPlatform/src/V1/DeleteTensorboardTimeSeriesRequest.php @@ -23,7 +23,7 @@ class DeleteTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TensorboardTimeSeries to be deleted. diff --git a/AiPlatform/src/V1/DeleteTrainingPipelineRequest.php b/AiPlatform/src/V1/DeleteTrainingPipelineRequest.php index 325eb62c8069..544aa735599d 100644 --- a/AiPlatform/src/V1/DeleteTrainingPipelineRequest.php +++ b/AiPlatform/src/V1/DeleteTrainingPipelineRequest.php @@ -23,7 +23,7 @@ class DeleteTrainingPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TrainingPipeline resource to be deleted. diff --git a/AiPlatform/src/V1/DeleteTrialRequest.php b/AiPlatform/src/V1/DeleteTrialRequest.php index ead0e8325dce..a392aa91f814 100644 --- a/AiPlatform/src/V1/DeleteTrialRequest.php +++ b/AiPlatform/src/V1/DeleteTrialRequest.php @@ -23,7 +23,7 @@ class DeleteTrialRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The Trial's name. diff --git a/AiPlatform/src/V1/DeployIndexOperationMetadata.php b/AiPlatform/src/V1/DeployIndexOperationMetadata.php index ba34ad66e859..359d23294621 100644 --- a/AiPlatform/src/V1/DeployIndexOperationMetadata.php +++ b/AiPlatform/src/V1/DeployIndexOperationMetadata.php @@ -21,13 +21,13 @@ class DeployIndexOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * The unique index id specified by user * * Generated from protobuf field string deployed_index_id = 2; */ - private $deployed_index_id = ''; + protected $deployed_index_id = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/DeployIndexRequest.php b/AiPlatform/src/V1/DeployIndexRequest.php index f4bc5c752263..d47467ec9876 100644 --- a/AiPlatform/src/V1/DeployIndexRequest.php +++ b/AiPlatform/src/V1/DeployIndexRequest.php @@ -23,13 +23,13 @@ class DeployIndexRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $index_endpoint = ''; + protected $index_endpoint = ''; /** * Required. The DeployedIndex to be created within the IndexEndpoint. * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedIndex deployed_index = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployed_index = null; + protected $deployed_index = null; /** * @param string $indexEndpoint Required. The name of the IndexEndpoint resource into which to deploy an diff --git a/AiPlatform/src/V1/DeployIndexResponse.php b/AiPlatform/src/V1/DeployIndexResponse.php index f2daf055334c..fc3b10e89fb9 100644 --- a/AiPlatform/src/V1/DeployIndexResponse.php +++ b/AiPlatform/src/V1/DeployIndexResponse.php @@ -21,7 +21,7 @@ class DeployIndexResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedIndex deployed_index = 1; */ - private $deployed_index = null; + protected $deployed_index = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DeployModelOperationMetadata.php b/AiPlatform/src/V1/DeployModelOperationMetadata.php index 26b8fa2d3fe7..96c212eb21e1 100644 --- a/AiPlatform/src/V1/DeployModelOperationMetadata.php +++ b/AiPlatform/src/V1/DeployModelOperationMetadata.php @@ -21,7 +21,7 @@ class DeployModelOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DeployModelRequest.php b/AiPlatform/src/V1/DeployModelRequest.php index e4b3ecbc9ab0..e044c3fef64d 100644 --- a/AiPlatform/src/V1/DeployModelRequest.php +++ b/AiPlatform/src/V1/DeployModelRequest.php @@ -23,7 +23,7 @@ class DeployModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Required. The DeployedModel to be created within the Endpoint. Note that * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] @@ -33,7 +33,7 @@ class DeployModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployed_model = null; + protected $deployed_model = null; /** * A map from a DeployedModel's ID to the percentage of this Endpoint's * traffic that should be forwarded to that DeployedModel. diff --git a/AiPlatform/src/V1/DeployModelResponse.php b/AiPlatform/src/V1/DeployModelResponse.php index 1080f654257d..affc801ec33e 100644 --- a/AiPlatform/src/V1/DeployModelResponse.php +++ b/AiPlatform/src/V1/DeployModelResponse.php @@ -21,7 +21,7 @@ class DeployModelResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedModel deployed_model = 1; */ - private $deployed_model = null; + protected $deployed_model = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DeployedIndex.php b/AiPlatform/src/V1/DeployedIndex.php index bf99aebf90a4..ea468ed0facc 100644 --- a/AiPlatform/src/V1/DeployedIndex.php +++ b/AiPlatform/src/V1/DeployedIndex.php @@ -23,27 +23,27 @@ class DeployedIndex extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $id = ''; + protected $id = ''; /** * Required. The name of the Index this is the deployment of. * We may refer to this Index as the DeployedIndex's "original" Index. * * Generated from protobuf field string index = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $index = ''; + protected $index = ''; /** * The display name of the DeployedIndex. If not provided upon creation, * the Index's display_name is used. * * Generated from protobuf field string display_name = 3; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. Timestamp when the DeployedIndex was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Provides paths for users to send requests directly to the * deployed index services running on Cloud via private services access. This @@ -52,7 +52,7 @@ class DeployedIndex extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.IndexPrivateEndpoints private_endpoints = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $private_endpoints = null; + protected $private_endpoints = null; /** * Output only. The DeployedIndex may depend on various data on its original * Index. Additionally when certain changes to the original Index are being @@ -71,7 +71,7 @@ class DeployedIndex extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp index_sync_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $index_sync_time = null; + protected $index_sync_time = null; /** * Optional. A description of resources that the DeployedIndex uses, which to * large degree are decided by Vertex AI, and optionally allows only a modest @@ -83,7 +83,7 @@ class DeployedIndex extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.AutomaticResources automatic_resources = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $automatic_resources = null; + protected $automatic_resources = null; /** * Optional. A description of resources that are dedicated to the * DeployedIndex, and that need a higher degree of manual configuration. The @@ -102,7 +102,7 @@ class DeployedIndex extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DedicatedResources dedicated_resources = 16 [(.google.api.field_behavior) = OPTIONAL]; */ - private $dedicated_resources = null; + protected $dedicated_resources = null; /** * Optional. If true, private endpoint's access logs are sent to Cloud * Logging. @@ -114,13 +114,13 @@ class DeployedIndex extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_access_logging = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_access_logging = false; + protected $enable_access_logging = false; /** * Optional. If set, the authentication is enabled for the private endpoint. * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedIndexAuthConfig deployed_index_auth_config = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $deployed_index_auth_config = null; + protected $deployed_index_auth_config = null; /** * Optional. A list of reserved ip ranges under the VPC network that can be * used for this DeployedIndex. @@ -150,7 +150,7 @@ class DeployedIndex extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string deployment_group = 11 [(.google.api.field_behavior) = OPTIONAL]; */ - private $deployment_group = ''; + protected $deployment_group = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/DeployedIndexAuthConfig.php b/AiPlatform/src/V1/DeployedIndexAuthConfig.php index 13adc2527f8c..fb9017e62156 100644 --- a/AiPlatform/src/V1/DeployedIndexAuthConfig.php +++ b/AiPlatform/src/V1/DeployedIndexAuthConfig.php @@ -20,7 +20,7 @@ class DeployedIndexAuthConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedIndexAuthConfig.AuthProvider auth_provider = 1; */ - private $auth_provider = null; + protected $auth_provider = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DeployedIndexRef.php b/AiPlatform/src/V1/DeployedIndexRef.php index 34125e3e6e9c..a27c56b931f1 100644 --- a/AiPlatform/src/V1/DeployedIndexRef.php +++ b/AiPlatform/src/V1/DeployedIndexRef.php @@ -20,19 +20,19 @@ class DeployedIndexRef extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string index_endpoint = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $index_endpoint = ''; + protected $index_endpoint = ''; /** * Immutable. The ID of the DeployedIndex in the above IndexEndpoint. * * Generated from protobuf field string deployed_index_id = 2 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $deployed_index_id = ''; + protected $deployed_index_id = ''; /** * Output only. The display name of the DeployedIndex. * * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $display_name = ''; + protected $display_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/DeployedModel.php b/AiPlatform/src/V1/DeployedModel.php index 69f82c77f246..13ddf1690b1d 100644 --- a/AiPlatform/src/V1/DeployedModel.php +++ b/AiPlatform/src/V1/DeployedModel.php @@ -22,7 +22,7 @@ class DeployedModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $id = ''; + protected $id = ''; /** * Required. The resource name of the Model that this is the deployment of. * Note that the Model may be in a different location than the DeployedModel's @@ -36,26 +36,26 @@ class DeployedModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * Output only. The version ID of the model that is deployed. * * Generated from protobuf field string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $model_version_id = ''; + protected $model_version_id = ''; /** * The display name of the DeployedModel. If not provided upon creation, * the Model's display_name is used. * * Generated from protobuf field string display_name = 3; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. Timestamp when the DeployedModel was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Explanation configuration for this DeployedModel. * When deploying a Model using @@ -76,7 +76,7 @@ class DeployedModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationSpec explanation_spec = 9; */ - private $explanation_spec = null; + protected $explanation_spec = null; /** * If true, deploy the model without explainable feature, regardless the * existence of @@ -86,7 +86,7 @@ class DeployedModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_explanations = 19; */ - private $disable_explanations = false; + protected $disable_explanations = false; /** * The service account that the DeployedModel's container runs as. Specify the * email address of the service account. If this service account is not @@ -97,7 +97,7 @@ class DeployedModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 11; */ - private $service_account = ''; + protected $service_account = ''; /** * For custom-trained Models and AutoML Tabular Models, the container of the * DeployedModel instances will send `stderr` and `stdout` streams to @@ -108,7 +108,7 @@ class DeployedModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_container_logging = 15; */ - private $disable_container_logging = false; + protected $disable_container_logging = false; /** * If true, online prediction access logs are sent to Cloud * Logging. @@ -120,7 +120,7 @@ class DeployedModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_access_logging = 13; */ - private $enable_access_logging = false; + protected $enable_access_logging = false; /** * Output only. Provide paths for users to send predict/explain/health * requests directly to the deployed model services running on Cloud via @@ -129,7 +129,7 @@ class DeployedModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $private_endpoints = null; + protected $private_endpoints = null; protected $prediction_resources; /** diff --git a/AiPlatform/src/V1/DeployedModelRef.php b/AiPlatform/src/V1/DeployedModelRef.php index 66a57224b63c..1f270de80921 100644 --- a/AiPlatform/src/V1/DeployedModelRef.php +++ b/AiPlatform/src/V1/DeployedModelRef.php @@ -20,13 +20,13 @@ class DeployedModelRef extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Immutable. An ID of a DeployedModel in the above Endpoint. * * Generated from protobuf field string deployed_model_id = 2 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $deployed_model_id = ''; + protected $deployed_model_id = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/DeploymentResourcePool.php b/AiPlatform/src/V1/DeploymentResourcePool.php index 4ac39da30a47..5eda0269b80f 100644 --- a/AiPlatform/src/V1/DeploymentResourcePool.php +++ b/AiPlatform/src/V1/DeploymentResourcePool.php @@ -23,20 +23,50 @@ class DeploymentResourcePool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Required. The underlying DedicatedResources that the DeploymentResourcePool * uses. * * Generated from protobuf field .google.cloud.aiplatform.v1.DedicatedResources dedicated_resources = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $dedicated_resources = null; + protected $dedicated_resources = null; + /** + * Customer-managed encryption key spec for a DeploymentResourcePool. If set, + * this DeploymentResourcePool will be secured by this key. Endpoints and the + * DeploymentResourcePool they deploy in need to have the same EncryptionSpec. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 5; + */ + protected $encryption_spec = null; + /** + * The service account that the DeploymentResourcePool's container(s) run as. + * Specify the email address of the service account. If this service account + * is not specified, the container(s) run as a service account that doesn't + * have access to the resource project. + * Users deploying the Models to this DeploymentResourcePool must have the + * `iam.serviceAccounts.actAs` permission on this service account. + * + * Generated from protobuf field string service_account = 6; + */ + protected $service_account = ''; + /** + * If the DeploymentResourcePool is deployed with custom-trained Models or + * AutoML Tabular Models, the container(s) of the DeploymentResourcePool will + * send `stderr` and `stdout` streams to Cloud Logging by default. + * Please note that the logs incur cost, which are subject to [Cloud Logging + * pricing](https://cloud.google.com/logging/pricing). + * User can disable container logging by setting this flag to true. + * + * Generated from protobuf field bool disable_container_logging = 7; + */ + protected $disable_container_logging = false; /** * Output only. Timestamp when this DeploymentResourcePool was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Constructor. @@ -51,6 +81,24 @@ class DeploymentResourcePool extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\AIPlatform\V1\DedicatedResources $dedicated_resources * Required. The underlying DedicatedResources that the DeploymentResourcePool * uses. + * @type \Google\Cloud\AIPlatform\V1\EncryptionSpec $encryption_spec + * Customer-managed encryption key spec for a DeploymentResourcePool. If set, + * this DeploymentResourcePool will be secured by this key. Endpoints and the + * DeploymentResourcePool they deploy in need to have the same EncryptionSpec. + * @type string $service_account + * The service account that the DeploymentResourcePool's container(s) run as. + * Specify the email address of the service account. If this service account + * is not specified, the container(s) run as a service account that doesn't + * have access to the resource project. + * Users deploying the Models to this DeploymentResourcePool must have the + * `iam.serviceAccounts.actAs` permission on this service account. + * @type bool $disable_container_logging + * If the DeploymentResourcePool is deployed with custom-trained Models or + * AutoML Tabular Models, the container(s) of the DeploymentResourcePool will + * send `stderr` and `stdout` streams to Cloud Logging by default. + * Please note that the logs incur cost, which are subject to [Cloud Logging + * pricing](https://cloud.google.com/logging/pricing). + * User can disable container logging by setting this flag to true. * @type \Google\Protobuf\Timestamp $create_time * Output only. Timestamp when this DeploymentResourcePool was created. * } @@ -128,6 +176,118 @@ public function setDedicatedResources($var) return $this; } + /** + * Customer-managed encryption key spec for a DeploymentResourcePool. If set, + * this DeploymentResourcePool will be secured by this key. Endpoints and the + * DeploymentResourcePool they deploy in need to have the same EncryptionSpec. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 5; + * @return \Google\Cloud\AIPlatform\V1\EncryptionSpec|null + */ + public function getEncryptionSpec() + { + return $this->encryption_spec; + } + + public function hasEncryptionSpec() + { + return isset($this->encryption_spec); + } + + public function clearEncryptionSpec() + { + unset($this->encryption_spec); + } + + /** + * Customer-managed encryption key spec for a DeploymentResourcePool. If set, + * this DeploymentResourcePool will be secured by this key. Endpoints and the + * DeploymentResourcePool they deploy in need to have the same EncryptionSpec. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 5; + * @param \Google\Cloud\AIPlatform\V1\EncryptionSpec $var + * @return $this + */ + public function setEncryptionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\EncryptionSpec::class); + $this->encryption_spec = $var; + + return $this; + } + + /** + * The service account that the DeploymentResourcePool's container(s) run as. + * Specify the email address of the service account. If this service account + * is not specified, the container(s) run as a service account that doesn't + * have access to the resource project. + * Users deploying the Models to this DeploymentResourcePool must have the + * `iam.serviceAccounts.actAs` permission on this service account. + * + * Generated from protobuf field string service_account = 6; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * The service account that the DeploymentResourcePool's container(s) run as. + * Specify the email address of the service account. If this service account + * is not specified, the container(s) run as a service account that doesn't + * have access to the resource project. + * Users deploying the Models to this DeploymentResourcePool must have the + * `iam.serviceAccounts.actAs` permission on this service account. + * + * Generated from protobuf field string service_account = 6; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * If the DeploymentResourcePool is deployed with custom-trained Models or + * AutoML Tabular Models, the container(s) of the DeploymentResourcePool will + * send `stderr` and `stdout` streams to Cloud Logging by default. + * Please note that the logs incur cost, which are subject to [Cloud Logging + * pricing](https://cloud.google.com/logging/pricing). + * User can disable container logging by setting this flag to true. + * + * Generated from protobuf field bool disable_container_logging = 7; + * @return bool + */ + public function getDisableContainerLogging() + { + return $this->disable_container_logging; + } + + /** + * If the DeploymentResourcePool is deployed with custom-trained Models or + * AutoML Tabular Models, the container(s) of the DeploymentResourcePool will + * send `stderr` and `stdout` streams to Cloud Logging by default. + * Please note that the logs incur cost, which are subject to [Cloud Logging + * pricing](https://cloud.google.com/logging/pricing). + * User can disable container logging by setting this flag to true. + * + * Generated from protobuf field bool disable_container_logging = 7; + * @param bool $var + * @return $this + */ + public function setDisableContainerLogging($var) + { + GPBUtil::checkBool($var); + $this->disable_container_logging = $var; + + return $this; + } + /** * Output only. Timestamp when this DeploymentResourcePool was created. * diff --git a/AiPlatform/src/V1/DeploymentResourcePoolServiceClient.php b/AiPlatform/src/V1/DeploymentResourcePoolServiceClient.php deleted file mode 100644 index ff5614e88ff9..000000000000 --- a/AiPlatform/src/V1/DeploymentResourcePoolServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -string feature_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_id = ''; + protected $feature_id = ''; /** * Specify the field name in the export destination. If not specified, * Feature ID is used. * * Generated from protobuf field string destination_field = 2; */ - private $destination_field = ''; + protected $destination_field = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/DirectPredictRequest.php b/AiPlatform/src/V1/DirectPredictRequest.php index 6bde21b5e0d7..7bbbeb3d74e1 100644 --- a/AiPlatform/src/V1/DirectPredictRequest.php +++ b/AiPlatform/src/V1/DirectPredictRequest.php @@ -23,7 +23,7 @@ class DirectPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * The prediction input. * @@ -35,7 +35,7 @@ class DirectPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Tensor parameters = 3; */ - private $parameters = null; + protected $parameters = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DirectPredictResponse.php b/AiPlatform/src/V1/DirectPredictResponse.php index 35a747ce3736..fc07726eb0db 100644 --- a/AiPlatform/src/V1/DirectPredictResponse.php +++ b/AiPlatform/src/V1/DirectPredictResponse.php @@ -27,7 +27,7 @@ class DirectPredictResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Tensor parameters = 2; */ - private $parameters = null; + protected $parameters = null; /** * Constructor. diff --git a/AiPlatform/src/V1/DirectRawPredictRequest.php b/AiPlatform/src/V1/DirectRawPredictRequest.php index d4737fd0641a..742455145cb6 100644 --- a/AiPlatform/src/V1/DirectRawPredictRequest.php +++ b/AiPlatform/src/V1/DirectRawPredictRequest.php @@ -23,7 +23,7 @@ class DirectRawPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Fully qualified name of the API method being invoked to perform * predictions. @@ -34,13 +34,13 @@ class DirectRawPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string method_name = 2; */ - private $method_name = ''; + protected $method_name = ''; /** * The prediction input. * * Generated from protobuf field bytes input = 3; */ - private $input = ''; + protected $input = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/DirectRawPredictResponse.php b/AiPlatform/src/V1/DirectRawPredictResponse.php index 4c32343e0a84..7c10eea0fc0f 100644 --- a/AiPlatform/src/V1/DirectRawPredictResponse.php +++ b/AiPlatform/src/V1/DirectRawPredictResponse.php @@ -21,7 +21,7 @@ class DirectRawPredictResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes output = 1; */ - private $output = ''; + protected $output = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/DiskSpec.php b/AiPlatform/src/V1/DiskSpec.php index 344bd8321c66..8d4b509db5ee 100644 --- a/AiPlatform/src/V1/DiskSpec.php +++ b/AiPlatform/src/V1/DiskSpec.php @@ -22,13 +22,13 @@ class DiskSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string boot_disk_type = 1; */ - private $boot_disk_type = ''; + protected $boot_disk_type = ''; /** * Size in GB of the boot disk (default is 100GB). * * Generated from protobuf field int32 boot_disk_size_gb = 2; */ - private $boot_disk_size_gb = 0; + protected $boot_disk_size_gb = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/EncryptionSpec.php b/AiPlatform/src/V1/EncryptionSpec.php index f1f011da3b0a..61554ec16fe9 100644 --- a/AiPlatform/src/V1/EncryptionSpec.php +++ b/AiPlatform/src/V1/EncryptionSpec.php @@ -25,7 +25,7 @@ class EncryptionSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $kms_key_name = ''; + protected $kms_key_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/Endpoint.php b/AiPlatform/src/V1/Endpoint.php index 2add109629b1..a56e116cba33 100644 --- a/AiPlatform/src/V1/Endpoint.php +++ b/AiPlatform/src/V1/Endpoint.php @@ -21,7 +21,7 @@ class Endpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The display name of the Endpoint. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -29,13 +29,13 @@ class Endpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * The description of the Endpoint. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Output only. The models deployed in this Endpoint. * To add or remove DeployedModels use @@ -64,7 +64,7 @@ class Endpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 6; */ - private $etag = ''; + protected $etag = ''; /** * The labels with user-defined metadata to organize your Endpoints. * Label keys and values can be no longer than 64 characters @@ -80,13 +80,13 @@ class Endpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Endpoint was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Customer-managed encryption key spec for an Endpoint. If set, this * Endpoint and all sub-resources of this Endpoint will be secured by @@ -94,7 +94,7 @@ class Endpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 10; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Optional. The full name of the Google Compute Engine * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) @@ -112,7 +112,7 @@ class Endpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $network = ''; + protected $network = ''; /** * Deprecated: If true, expose the Endpoint via private service connect. * Only one of the fields, @@ -124,6 +124,15 @@ class Endpoint extends \Google\Protobuf\Internal\Message * @deprecated */ protected $enable_private_service_connect = false; + /** + * Optional. Configuration for private service connect. + * [network][google.cloud.aiplatform.v1.Endpoint.network] and + * [private_service_connect_config][google.cloud.aiplatform.v1.Endpoint.private_service_connect_config] + * are mutually exclusive. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.PrivateServiceConnectConfig private_service_connect_config = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $private_service_connect_config = null; /** * Output only. Resource name of the Model Monitoring job associated with this * Endpoint if monitoring is enabled by @@ -133,13 +142,13 @@ class Endpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $model_deployment_monitoring_job = ''; + protected $model_deployment_monitoring_job = ''; /** * Configures the request-response logging for online prediction. * * Generated from protobuf field .google.cloud.aiplatform.v1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; */ - private $predict_request_response_logging_config = null; + protected $predict_request_response_logging_config = null; /** * Constructor. @@ -206,6 +215,11 @@ class Endpoint extends \Google\Protobuf\Internal\Message * [network][google.cloud.aiplatform.v1.Endpoint.network] or * [enable_private_service_connect][google.cloud.aiplatform.v1.Endpoint.enable_private_service_connect], * can be set. + * @type \Google\Cloud\AIPlatform\V1\PrivateServiceConnectConfig $private_service_connect_config + * Optional. Configuration for private service connect. + * [network][google.cloud.aiplatform.v1.Endpoint.network] and + * [private_service_connect_config][google.cloud.aiplatform.v1.Endpoint.private_service_connect_config] + * are mutually exclusive. * @type string $model_deployment_monitoring_job * Output only. Resource name of the Model Monitoring job associated with this * Endpoint if monitoring is enabled by @@ -637,6 +651,48 @@ public function setEnablePrivateServiceConnect($var) return $this; } + /** + * Optional. Configuration for private service connect. + * [network][google.cloud.aiplatform.v1.Endpoint.network] and + * [private_service_connect_config][google.cloud.aiplatform.v1.Endpoint.private_service_connect_config] + * are mutually exclusive. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.PrivateServiceConnectConfig private_service_connect_config = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\PrivateServiceConnectConfig|null + */ + public function getPrivateServiceConnectConfig() + { + return $this->private_service_connect_config; + } + + public function hasPrivateServiceConnectConfig() + { + return isset($this->private_service_connect_config); + } + + public function clearPrivateServiceConnectConfig() + { + unset($this->private_service_connect_config); + } + + /** + * Optional. Configuration for private service connect. + * [network][google.cloud.aiplatform.v1.Endpoint.network] and + * [private_service_connect_config][google.cloud.aiplatform.v1.Endpoint.private_service_connect_config] + * are mutually exclusive. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.PrivateServiceConnectConfig private_service_connect_config = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\PrivateServiceConnectConfig $var + * @return $this + */ + public function setPrivateServiceConnectConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\PrivateServiceConnectConfig::class); + $this->private_service_connect_config = $var; + + return $this; + } + /** * Output only. Resource name of the Model Monitoring job associated with this * Endpoint if monitoring is enabled by diff --git a/AiPlatform/src/V1/EndpointServiceClient.php b/AiPlatform/src/V1/EndpointServiceClient.php deleted file mode 100644 index 3b6cad40ef2f..000000000000 --- a/AiPlatform/src/V1/EndpointServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.EndpointService/CreateEndpoint', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets an Endpoint. - * @param \Google\Cloud\AIPlatform\V1\GetEndpointRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetEndpoint(\Google\Cloud\AIPlatform\V1\GetEndpointRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.EndpointService/GetEndpoint', - $argument, - ['\Google\Cloud\AIPlatform\V1\Endpoint', 'decode'], - $metadata, $options); - } - - /** - * Lists Endpoints in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListEndpointsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListEndpoints(\Google\Cloud\AIPlatform\V1\ListEndpointsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.EndpointService/ListEndpoints', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListEndpointsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates an Endpoint. - * @param \Google\Cloud\AIPlatform\V1\UpdateEndpointRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateEndpoint(\Google\Cloud\AIPlatform\V1\UpdateEndpointRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.EndpointService/UpdateEndpoint', - $argument, - ['\Google\Cloud\AIPlatform\V1\Endpoint', 'decode'], - $metadata, $options); - } - - /** - * Deletes an Endpoint. - * @param \Google\Cloud\AIPlatform\V1\DeleteEndpointRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteEndpoint(\Google\Cloud\AIPlatform\V1\DeleteEndpointRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.EndpointService/DeleteEndpoint', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deploys a Model into this Endpoint, creating a DeployedModel within it. - * @param \Google\Cloud\AIPlatform\V1\DeployModelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeployModel(\Google\Cloud\AIPlatform\V1\DeployModelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.EndpointService/DeployModel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and - * freeing all resources it's using. - * @param \Google\Cloud\AIPlatform\V1\UndeployModelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UndeployModel(\Google\Cloud\AIPlatform\V1\UndeployModelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.EndpointService/UndeployModel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates an existing deployed model. Updatable fields include - * `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, - * `disable_container_logging` (v1 only), and `enable_container_logging` - * (v1beta1 only). - * @param \Google\Cloud\AIPlatform\V1\MutateDeployedModelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MutateDeployedModel(\Google\Cloud\AIPlatform\V1\MutateDeployedModelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.EndpointService/MutateDeployedModel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/EntityIdSelector.php b/AiPlatform/src/V1/EntityIdSelector.php index 2556a98cec80..46e3c929417c 100644 --- a/AiPlatform/src/V1/EntityIdSelector.php +++ b/AiPlatform/src/V1/EntityIdSelector.php @@ -21,7 +21,7 @@ class EntityIdSelector extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_id_field = 5; */ - private $entity_id_field = ''; + protected $entity_id_field = ''; protected $EntityIdsSource; /** diff --git a/AiPlatform/src/V1/EntityType.php b/AiPlatform/src/V1/EntityType.php index af5f1786c456..128f28a9b487 100644 --- a/AiPlatform/src/V1/EntityType.php +++ b/AiPlatform/src/V1/EntityType.php @@ -28,25 +28,25 @@ class EntityType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Optional. Description of the EntityType. * * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. Timestamp when this EntityType was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this EntityType was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. The labels with user-defined metadata to organize your * EntityTypes. @@ -68,7 +68,7 @@ class EntityType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Optional. The default monitoring configuration for all Features with value * type @@ -81,7 +81,7 @@ class EntityType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig monitoring_config = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $monitoring_config = null; + protected $monitoring_config = null; /** * Optional. Config for data retention policy in offline storage. * TTL in days for feature values that will be stored in offline storage. @@ -91,7 +91,7 @@ class EntityType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 offline_storage_ttl_days = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $offline_storage_ttl_days = 0; + protected $offline_storage_ttl_days = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/EnvVar.php b/AiPlatform/src/V1/EnvVar.php index b07361667fa8..a189248f6cfc 100644 --- a/AiPlatform/src/V1/EnvVar.php +++ b/AiPlatform/src/V1/EnvVar.php @@ -20,7 +20,7 @@ class EnvVar extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. Variables that reference a $(VAR_NAME) are expanded * using the previous defined environment variables in the container and @@ -32,7 +32,7 @@ class EnvVar extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $value = ''; + protected $value = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ErrorAnalysisAnnotation.php b/AiPlatform/src/V1/ErrorAnalysisAnnotation.php index 2f28522fb84b..e063ef9eb60a 100644 --- a/AiPlatform/src/V1/ErrorAnalysisAnnotation.php +++ b/AiPlatform/src/V1/ErrorAnalysisAnnotation.php @@ -27,20 +27,20 @@ class ErrorAnalysisAnnotation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ErrorAnalysisAnnotation.QueryType query_type = 2; */ - private $query_type = 0; + protected $query_type = 0; /** * The outlier score of this annotated item. Usually defined as the min of all * distances from attributed items. * * Generated from protobuf field double outlier_score = 3; */ - private $outlier_score = 0.0; + protected $outlier_score = 0.0; /** * The threshold used to determine if this annotation is an outlier or not. * * Generated from protobuf field double outlier_threshold = 4; */ - private $outlier_threshold = 0.0; + protected $outlier_threshold = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/ErrorAnalysisAnnotation/AttributedItem.php b/AiPlatform/src/V1/ErrorAnalysisAnnotation/AttributedItem.php index 7fc6ce7bd84f..fe1824a00b2e 100644 --- a/AiPlatform/src/V1/ErrorAnalysisAnnotation/AttributedItem.php +++ b/AiPlatform/src/V1/ErrorAnalysisAnnotation/AttributedItem.php @@ -22,13 +22,13 @@ class AttributedItem extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string annotation_resource_name = 1; */ - private $annotation_resource_name = ''; + protected $annotation_resource_name = ''; /** * The distance of this item to the annotation. * * Generated from protobuf field double distance = 2; */ - private $distance = 0.0; + protected $distance = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/EvaluatedAnnotation.php b/AiPlatform/src/V1/EvaluatedAnnotation.php index d39208896f28..ecc61359bd46 100644 --- a/AiPlatform/src/V1/EvaluatedAnnotation.php +++ b/AiPlatform/src/V1/EvaluatedAnnotation.php @@ -22,7 +22,7 @@ class EvaluatedAnnotation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EvaluatedAnnotation.EvaluatedAnnotationType type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $type = 0; + protected $type = 0; /** * Output only. The model predicted annotations. * For true positive, there is one and only one prediction, which matches the @@ -65,7 +65,7 @@ class EvaluatedAnnotation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value data_item_payload = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $data_item_payload = null; + protected $data_item_payload = null; /** * Output only. ID of the EvaluatedDataItemView under the same ancestor * ModelEvaluation. The EvaluatedDataItemView consists of all ground truths @@ -74,7 +74,7 @@ class EvaluatedAnnotation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string evaluated_data_item_view_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $evaluated_data_item_view_id = ''; + protected $evaluated_data_item_view_id = ''; /** * Explanations of * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions]. diff --git a/AiPlatform/src/V1/EvaluatedAnnotationExplanation.php b/AiPlatform/src/V1/EvaluatedAnnotationExplanation.php index 08c2793d276f..4752df122154 100644 --- a/AiPlatform/src/V1/EvaluatedAnnotationExplanation.php +++ b/AiPlatform/src/V1/EvaluatedAnnotationExplanation.php @@ -23,13 +23,13 @@ class EvaluatedAnnotationExplanation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string explanation_type = 1; */ - private $explanation_type = ''; + protected $explanation_type = ''; /** * Explanation attribution response details. * * Generated from protobuf field .google.cloud.aiplatform.v1.Explanation explanation = 2; */ - private $explanation = null; + protected $explanation = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Event.php b/AiPlatform/src/V1/Event.php index 386b1a8d9670..665c415849ca 100644 --- a/AiPlatform/src/V1/Event.php +++ b/AiPlatform/src/V1/Event.php @@ -21,25 +21,25 @@ class Event extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string artifact = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $artifact = ''; + protected $artifact = ''; /** * Output only. The relative resource name of the Execution in the Event. * * Generated from protobuf field string execution = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $execution = ''; + protected $execution = ''; /** * Output only. Time the Event occurred. * * Generated from protobuf field .google.protobuf.Timestamp event_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $event_time = null; + protected $event_time = null; /** * Required. The type of the Event. * * Generated from protobuf field .google.cloud.aiplatform.v1.Event.Type type = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $type = 0; + protected $type = 0; /** * The labels with user-defined metadata to annotate Events. * Label keys and values can be no longer than 64 characters diff --git a/AiPlatform/src/V1/Examples.php b/AiPlatform/src/V1/Examples.php index 3874ab498a9b..107491c628eb 100644 --- a/AiPlatform/src/V1/Examples.php +++ b/AiPlatform/src/V1/Examples.php @@ -21,7 +21,7 @@ class Examples extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 neighbor_count = 3; */ - private $neighbor_count = 0; + protected $neighbor_count = 0; protected $source; protected $config; diff --git a/AiPlatform/src/V1/Examples/ExampleGcsSource.php b/AiPlatform/src/V1/Examples/ExampleGcsSource.php index fa4f8eeb39fb..5fb53c8020e8 100644 --- a/AiPlatform/src/V1/Examples/ExampleGcsSource.php +++ b/AiPlatform/src/V1/Examples/ExampleGcsSource.php @@ -21,13 +21,13 @@ class ExampleGcsSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat data_format = 1; */ - private $data_format = 0; + protected $data_format = 0; /** * The Cloud Storage location for the input instances. * * Generated from protobuf field .google.cloud.aiplatform.v1.GcsSource gcs_source = 2; */ - private $gcs_source = null; + protected $gcs_source = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ExamplesOverride.php b/AiPlatform/src/V1/ExamplesOverride.php index f7c79400f012..b08bb3b5152b 100644 --- a/AiPlatform/src/V1/ExamplesOverride.php +++ b/AiPlatform/src/V1/ExamplesOverride.php @@ -20,13 +20,13 @@ class ExamplesOverride extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 neighbor_count = 1; */ - private $neighbor_count = 0; + protected $neighbor_count = 0; /** * The number of neighbors to return that have the same crowding tag. * * Generated from protobuf field int32 crowding_count = 2; */ - private $crowding_count = 0; + protected $crowding_count = 0; /** * Restrict the resulting nearest neighbors to respect these constraints. * @@ -38,13 +38,13 @@ class ExamplesOverride extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool return_embeddings = 4; */ - private $return_embeddings = false; + protected $return_embeddings = false; /** * The format of the data being provided with each call. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExamplesOverride.DataFormat data_format = 5; */ - private $data_format = 0; + protected $data_format = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/ExamplesRestrictionsNamespace.php b/AiPlatform/src/V1/ExamplesRestrictionsNamespace.php index cda1f00a8663..07d719058697 100644 --- a/AiPlatform/src/V1/ExamplesRestrictionsNamespace.php +++ b/AiPlatform/src/V1/ExamplesRestrictionsNamespace.php @@ -20,7 +20,7 @@ class ExamplesRestrictionsNamespace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string namespace_name = 1; */ - private $namespace_name = ''; + protected $namespace_name = ''; /** * The list of allowed tags. * diff --git a/AiPlatform/src/V1/Execution.php b/AiPlatform/src/V1/Execution.php index 6d083979bb81..42bf6f6e07ca 100644 --- a/AiPlatform/src/V1/Execution.php +++ b/AiPlatform/src/V1/Execution.php @@ -20,14 +20,14 @@ class Execution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * User provided display name of the Execution. * May be up to 128 Unicode characters. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * The state of this Execution. This is a property of the Execution, and does * not imply or capture any ongoing process. This property is managed by @@ -36,14 +36,14 @@ class Execution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Execution.State state = 6; */ - private $state = 0; + protected $state = 0; /** * An eTag used to perform consistent read-modify-write updates. If not set, a * blind "overwrite" update happens. * * Generated from protobuf field string etag = 9; */ - private $etag = ''; + protected $etag = ''; /** * The labels with user-defined metadata to organize your Executions. * Label keys and values can be no longer than 64 characters @@ -60,13 +60,13 @@ class Execution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Execution was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The title of the schema describing the metadata. * Schema title and version is expected to be registered in earlier Create @@ -75,7 +75,7 @@ class Execution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema_title = 13; */ - private $schema_title = ''; + protected $schema_title = ''; /** * The version of the schema in `schema_title` to use. * Schema title and version is expected to be registered in earlier Create @@ -84,7 +84,7 @@ class Execution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema_version = 14; */ - private $schema_version = ''; + protected $schema_version = ''; /** * Properties of the Execution. * Top level metadata keys' heading and trailing spaces will be trimmed. @@ -92,13 +92,13 @@ class Execution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Struct metadata = 15; */ - private $metadata = null; + protected $metadata = null; /** * Description of the Execution * * Generated from protobuf field string description = 16; */ - private $description = ''; + protected $description = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ExplainRequest.php b/AiPlatform/src/V1/ExplainRequest.php index 1a11bef372ed..d953774b600f 100644 --- a/AiPlatform/src/V1/ExplainRequest.php +++ b/AiPlatform/src/V1/ExplainRequest.php @@ -23,7 +23,7 @@ class ExplainRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Required. The instances that are the input to the explanation call. * A DeployedModel may have an upper limit on the number of instances it @@ -47,7 +47,7 @@ class ExplainRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value parameters = 4; */ - private $parameters = null; + protected $parameters = null; /** * If specified, overrides the * [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] @@ -60,7 +60,7 @@ class ExplainRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationSpecOverride explanation_spec_override = 5; */ - private $explanation_spec_override = null; + protected $explanation_spec_override = null; /** * If specified, this ExplainRequest will be served by the chosen * DeployedModel, overriding @@ -68,7 +68,7 @@ class ExplainRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string deployed_model_id = 3; */ - private $deployed_model_id = ''; + protected $deployed_model_id = ''; /** * @param string $endpoint Required. The name of the Endpoint requested to serve the explanation. diff --git a/AiPlatform/src/V1/ExplainResponse.php b/AiPlatform/src/V1/ExplainResponse.php index e0e06a928fa2..41d2fa09856e 100644 --- a/AiPlatform/src/V1/ExplainResponse.php +++ b/AiPlatform/src/V1/ExplainResponse.php @@ -31,7 +31,7 @@ class ExplainResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string deployed_model_id = 2; */ - private $deployed_model_id = ''; + protected $deployed_model_id = ''; /** * The predictions that are the output of the predictions call. * Same as diff --git a/AiPlatform/src/V1/ExplanationMetadata.php b/AiPlatform/src/V1/ExplanationMetadata.php index de90597f1d5f..4fe06824724e 100644 --- a/AiPlatform/src/V1/ExplanationMetadata.php +++ b/AiPlatform/src/V1/ExplanationMetadata.php @@ -56,13 +56,13 @@ class ExplanationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_attributions_schema_uri = 3; */ - private $feature_attributions_schema_uri = ''; + protected $feature_attributions_schema_uri = ''; /** * Name of the source to generate embeddings for example based explanations. * * Generated from protobuf field string latent_space_source = 5; */ - private $latent_space_source = ''; + protected $latent_space_source = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ExplanationMetadata/InputMetadata.php b/AiPlatform/src/V1/ExplanationMetadata/InputMetadata.php index 13dfeb16c415..90182f8ba0da 100644 --- a/AiPlatform/src/V1/ExplanationMetadata/InputMetadata.php +++ b/AiPlatform/src/V1/ExplanationMetadata/InputMetadata.php @@ -45,28 +45,28 @@ class InputMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string input_tensor_name = 2; */ - private $input_tensor_name = ''; + protected $input_tensor_name = ''; /** * Defines how the feature is encoded into the input tensor. Defaults to * IDENTITY. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; */ - private $encoding = 0; + protected $encoding = 0; /** * Modality of the feature. Valid values are: numeric, image. Defaults to * numeric. * * Generated from protobuf field string modality = 4; */ - private $modality = ''; + protected $modality = ''; /** * The domain details of the input feature value. Like min/max, original * mean or standard deviation if normalized. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; */ - private $feature_value_domain = null; + protected $feature_value_domain = null; /** * Specifies the index of the values of the input tensor. * Required when the input tensor is a sparse representation. Refer to @@ -75,7 +75,7 @@ class InputMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string indices_tensor_name = 6; */ - private $indices_tensor_name = ''; + protected $indices_tensor_name = ''; /** * Specifies the shape of the values of the input if the input is a sparse * representation. Refer to Tensorflow documentation for more details: @@ -83,7 +83,7 @@ class InputMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dense_shape_tensor_name = 7; */ - private $dense_shape_tensor_name = ''; + protected $dense_shape_tensor_name = ''; /** * A list of feature names for each index in the input tensor. * Required when the input @@ -106,7 +106,7 @@ class InputMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string encoded_tensor_name = 9; */ - private $encoded_tensor_name = ''; + protected $encoded_tensor_name = ''; /** * A list of baselines for the encoded tensor. * The shape of each baseline should match the shape of the encoded tensor. @@ -121,7 +121,7 @@ class InputMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; */ - private $visualization = null; + protected $visualization = null; /** * Name of the group that the input belongs to. Features with the same group * name will be treated as one feature when computing attributions. Features @@ -132,7 +132,7 @@ class InputMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string group_name = 12; */ - private $group_name = ''; + protected $group_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ExplanationMetadata/InputMetadata/FeatureValueDomain.php b/AiPlatform/src/V1/ExplanationMetadata/InputMetadata/FeatureValueDomain.php index 64bcf2df5b2b..2c0fb77ab1e7 100644 --- a/AiPlatform/src/V1/ExplanationMetadata/InputMetadata/FeatureValueDomain.php +++ b/AiPlatform/src/V1/ExplanationMetadata/InputMetadata/FeatureValueDomain.php @@ -27,13 +27,13 @@ class FeatureValueDomain extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float min_value = 1; */ - private $min_value = 0.0; + protected $min_value = 0.0; /** * The maximum permissible value for this feature. * * Generated from protobuf field float max_value = 2; */ - private $max_value = 0.0; + protected $max_value = 0.0; /** * If this input feature has been normalized to a mean value of 0, * the original_mean specifies the mean value of the domain prior to @@ -41,7 +41,7 @@ class FeatureValueDomain extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float original_mean = 3; */ - private $original_mean = 0.0; + protected $original_mean = 0.0; /** * If this input feature has been normalized to a standard deviation of * 1.0, the original_stddev specifies the standard deviation of the domain @@ -49,7 +49,7 @@ class FeatureValueDomain extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float original_stddev = 4; */ - private $original_stddev = 0.0; + protected $original_stddev = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/ExplanationMetadata/InputMetadata/Visualization.php b/AiPlatform/src/V1/ExplanationMetadata/InputMetadata/Visualization.php index ac56b044a505..6effc8906fe8 100644 --- a/AiPlatform/src/V1/ExplanationMetadata/InputMetadata/Visualization.php +++ b/AiPlatform/src/V1/ExplanationMetadata/InputMetadata/Visualization.php @@ -24,14 +24,14 @@ class Visualization extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; */ - private $type = 0; + protected $type = 0; /** * Whether to only highlight pixels with positive contributions, negative * or both. Defaults to POSITIVE. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; */ - private $polarity = 0; + protected $polarity = 0; /** * The color scheme used for the highlighted areas. * Defaults to PINK_GREEN for @@ -46,7 +46,7 @@ class Visualization extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; */ - private $color_map = 0; + protected $color_map = 0; /** * Excludes attributions above the specified percentile from the * highlighted areas. Using the clip_percent_upperbound and @@ -56,14 +56,14 @@ class Visualization extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float clip_percent_upperbound = 4; */ - private $clip_percent_upperbound = 0.0; + protected $clip_percent_upperbound = 0.0; /** * Excludes attributions below the specified percentile, from the * highlighted areas. Defaults to 62. * * Generated from protobuf field float clip_percent_lowerbound = 5; */ - private $clip_percent_lowerbound = 0.0; + protected $clip_percent_lowerbound = 0.0; /** * How the original image is displayed in the visualization. * Adjusting the overlay can help increase visual clarity if the original @@ -71,7 +71,7 @@ class Visualization extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; */ - private $overlay_type = 0; + protected $overlay_type = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/ExplanationMetadata/OutputMetadata.php b/AiPlatform/src/V1/ExplanationMetadata/OutputMetadata.php index 7bf366efba49..3cc195ee31ea 100644 --- a/AiPlatform/src/V1/ExplanationMetadata/OutputMetadata.php +++ b/AiPlatform/src/V1/ExplanationMetadata/OutputMetadata.php @@ -21,7 +21,7 @@ class OutputMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string output_tensor_name = 3; */ - private $output_tensor_name = ''; + protected $output_tensor_name = ''; protected $display_name_mapping; /** diff --git a/AiPlatform/src/V1/ExplanationParameters.php b/AiPlatform/src/V1/ExplanationParameters.php index 431aaaabb421..c134d7f06b87 100644 --- a/AiPlatform/src/V1/ExplanationParameters.php +++ b/AiPlatform/src/V1/ExplanationParameters.php @@ -23,7 +23,7 @@ class ExplanationParameters extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 top_k = 4; */ - private $top_k = 0; + protected $top_k = 0; /** * If populated, only returns attributions that have * [output_index][google.cloud.aiplatform.v1.Attribution.output_index] @@ -38,7 +38,7 @@ class ExplanationParameters extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.ListValue output_indices = 5; */ - private $output_indices = null; + protected $output_indices = null; protected $method; /** diff --git a/AiPlatform/src/V1/ExplanationSpec.php b/AiPlatform/src/V1/ExplanationSpec.php index 4623da981b99..d3a7c34016a6 100644 --- a/AiPlatform/src/V1/ExplanationSpec.php +++ b/AiPlatform/src/V1/ExplanationSpec.php @@ -20,13 +20,13 @@ class ExplanationSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parameters = null; + protected $parameters = null; /** * Optional. Metadata describing the Model's input and output for explanation. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $metadata = null; + protected $metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ExplanationSpecOverride.php b/AiPlatform/src/V1/ExplanationSpecOverride.php index 5b991c0cfdf3..92a3b9487912 100644 --- a/AiPlatform/src/V1/ExplanationSpecOverride.php +++ b/AiPlatform/src/V1/ExplanationSpecOverride.php @@ -24,19 +24,19 @@ class ExplanationSpecOverride extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationParameters parameters = 1; */ - private $parameters = null; + protected $parameters = null; /** * The metadata to be overridden. If not specified, no metadata is overridden. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationMetadataOverride metadata = 2; */ - private $metadata = null; + protected $metadata = null; /** * The example-based explanations parameter overrides. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExamplesOverride examples_override = 3; */ - private $examples_override = null; + protected $examples_override = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportDataConfig.php b/AiPlatform/src/V1/ExportDataConfig.php index 214910aba590..77a162111eb5 100644 --- a/AiPlatform/src/V1/ExportDataConfig.php +++ b/AiPlatform/src/V1/ExportDataConfig.php @@ -24,7 +24,7 @@ class ExportDataConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string annotations_filter = 2; */ - private $annotations_filter = ''; + protected $annotations_filter = ''; /** * The ID of a SavedQuery (annotation set) under the Dataset specified by * [dataset_id][] used for filtering Annotations for training. @@ -45,7 +45,7 @@ class ExportDataConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string saved_query_id = 11; */ - private $saved_query_id = ''; + protected $saved_query_id = ''; /** * The Cloud Storage URI that points to a YAML file describing the annotation * schema. The schema is defined as an OpenAPI 3.0.2 [Schema @@ -69,13 +69,13 @@ class ExportDataConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string annotation_schema_uri = 12; */ - private $annotation_schema_uri = ''; + protected $annotation_schema_uri = ''; /** * Indicates the usage of the exported files. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExportDataConfig.ExportUse export_use = 4; */ - private $export_use = 0; + protected $export_use = 0; protected $destination; protected $split; diff --git a/AiPlatform/src/V1/ExportDataOperationMetadata.php b/AiPlatform/src/V1/ExportDataOperationMetadata.php index 70bdcdfb4d2d..42cce5b8a65d 100644 --- a/AiPlatform/src/V1/ExportDataOperationMetadata.php +++ b/AiPlatform/src/V1/ExportDataOperationMetadata.php @@ -21,14 +21,14 @@ class ExportDataOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * A Google Cloud Storage directory which path ends with '/'. The exported * data is stored in the directory. * * Generated from protobuf field string gcs_output_directory = 2; */ - private $gcs_output_directory = ''; + protected $gcs_output_directory = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportDataRequest.php b/AiPlatform/src/V1/ExportDataRequest.php index 99a0f9bd9028..f228564f8a9d 100644 --- a/AiPlatform/src/V1/ExportDataRequest.php +++ b/AiPlatform/src/V1/ExportDataRequest.php @@ -23,13 +23,13 @@ class ExportDataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The desired output location. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExportDataConfig export_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $export_config = null; + protected $export_config = null; /** * @param string $name Required. The name of the Dataset resource. diff --git a/AiPlatform/src/V1/ExportDataResponse.php b/AiPlatform/src/V1/ExportDataResponse.php index 646804a54c7b..5d6d6fa42680 100644 --- a/AiPlatform/src/V1/ExportDataResponse.php +++ b/AiPlatform/src/V1/ExportDataResponse.php @@ -32,7 +32,7 @@ class ExportDataResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Model.DataStats data_stats = 2; */ - private $data_stats = null; + protected $data_stats = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportFeatureValuesOperationMetadata.php b/AiPlatform/src/V1/ExportFeatureValuesOperationMetadata.php index f70da2a0c64c..5899b28bf347 100644 --- a/AiPlatform/src/V1/ExportFeatureValuesOperationMetadata.php +++ b/AiPlatform/src/V1/ExportFeatureValuesOperationMetadata.php @@ -20,7 +20,7 @@ class ExportFeatureValuesOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportFeatureValuesRequest.php b/AiPlatform/src/V1/ExportFeatureValuesRequest.php index 6ae63cffce46..d9dca89595c7 100644 --- a/AiPlatform/src/V1/ExportFeatureValuesRequest.php +++ b/AiPlatform/src/V1/ExportFeatureValuesRequest.php @@ -23,19 +23,19 @@ class ExportFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $entity_type = ''; + protected $entity_type = ''; /** * Required. Specifies destination location and format. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureValueDestination destination = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $destination = null; + protected $destination = null; /** * Required. Selects Features to export values of. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureSelector feature_selector = 5 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_selector = null; + protected $feature_selector = null; /** * Per-Feature export settings. * diff --git a/AiPlatform/src/V1/ExportFeatureValuesRequest/FullExport.php b/AiPlatform/src/V1/ExportFeatureValuesRequest/FullExport.php index 9eb14c73b26d..15df7e9a7934 100644 --- a/AiPlatform/src/V1/ExportFeatureValuesRequest/FullExport.php +++ b/AiPlatform/src/V1/ExportFeatureValuesRequest/FullExport.php @@ -23,7 +23,7 @@ class FullExport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; */ - private $start_time = null; + protected $start_time = null; /** * Exports Feature values as of this timestamp. If not set, * retrieve values as of now. Timestamp, if present, must not have higher @@ -31,7 +31,7 @@ class FullExport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp end_time = 1; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportFeatureValuesRequest/SnapshotExport.php b/AiPlatform/src/V1/ExportFeatureValuesRequest/SnapshotExport.php index 26aca9356ff7..0e20cfd9cdaf 100644 --- a/AiPlatform/src/V1/ExportFeatureValuesRequest/SnapshotExport.php +++ b/AiPlatform/src/V1/ExportFeatureValuesRequest/SnapshotExport.php @@ -23,7 +23,7 @@ class SnapshotExport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 1; */ - private $snapshot_time = null; + protected $snapshot_time = null; /** * Excludes Feature values with feature generation timestamp before this * timestamp. If not set, retrieve oldest values kept in Feature Store. @@ -31,7 +31,7 @@ class SnapshotExport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; */ - private $start_time = null; + protected $start_time = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportFilterSplit.php b/AiPlatform/src/V1/ExportFilterSplit.php index 88e63843d2c7..99367b1b0952 100644 --- a/AiPlatform/src/V1/ExportFilterSplit.php +++ b/AiPlatform/src/V1/ExportFilterSplit.php @@ -31,7 +31,7 @@ class ExportFilterSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string training_filter = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $training_filter = ''; + protected $training_filter = ''; /** * Required. A filter on DataItems of the Dataset. DataItems that match * this filter are used to validate the Model. A filter with same syntax @@ -43,7 +43,7 @@ class ExportFilterSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string validation_filter = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $validation_filter = ''; + protected $validation_filter = ''; /** * Required. A filter on DataItems of the Dataset. DataItems that match * this filter are used to test the Model. A filter with same syntax @@ -55,7 +55,7 @@ class ExportFilterSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string test_filter = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $test_filter = ''; + protected $test_filter = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportFractionSplit.php b/AiPlatform/src/V1/ExportFractionSplit.php index aab42d88c35e..5d54b7f05e07 100644 --- a/AiPlatform/src/V1/ExportFractionSplit.php +++ b/AiPlatform/src/V1/ExportFractionSplit.php @@ -25,19 +25,19 @@ class ExportFractionSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double training_fraction = 1; */ - private $training_fraction = 0.0; + protected $training_fraction = 0.0; /** * The fraction of the input data that is to be used to validate the Model. * * Generated from protobuf field double validation_fraction = 2; */ - private $validation_fraction = 0.0; + protected $validation_fraction = 0.0; /** * The fraction of the input data that is to be used to evaluate the Model. * * Generated from protobuf field double test_fraction = 3; */ - private $test_fraction = 0.0; + protected $test_fraction = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportModelOperationMetadata.php b/AiPlatform/src/V1/ExportModelOperationMetadata.php index 08adc3cc0486..20ea6285c14d 100644 --- a/AiPlatform/src/V1/ExportModelOperationMetadata.php +++ b/AiPlatform/src/V1/ExportModelOperationMetadata.php @@ -22,14 +22,14 @@ class ExportModelOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Output only. Information further describing the output of this Model * export. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExportModelOperationMetadata.OutputInfo output_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $output_info = null; + protected $output_info = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportModelOperationMetadata/OutputInfo.php b/AiPlatform/src/V1/ExportModelOperationMetadata/OutputInfo.php index 7d6d493f1ace..fb13107cb638 100644 --- a/AiPlatform/src/V1/ExportModelOperationMetadata/OutputInfo.php +++ b/AiPlatform/src/V1/ExportModelOperationMetadata/OutputInfo.php @@ -23,14 +23,14 @@ class OutputInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string artifact_output_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $artifact_output_uri = ''; + protected $artifact_output_uri = ''; /** * Output only. If the Model image is being exported to Google Container * Registry or Artifact Registry this is the full path of the image created. * * Generated from protobuf field string image_output_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $image_output_uri = ''; + protected $image_output_uri = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportModelRequest.php b/AiPlatform/src/V1/ExportModelRequest.php index 98d9952456cd..a5b3b13d0766 100644 --- a/AiPlatform/src/V1/ExportModelRequest.php +++ b/AiPlatform/src/V1/ExportModelRequest.php @@ -23,13 +23,13 @@ class ExportModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The desired output location and configuration. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExportModelRequest.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $output_config = null; + protected $output_config = null; /** * @param string $name Required. The resource name of the Model to export. diff --git a/AiPlatform/src/V1/ExportModelRequest/OutputConfig.php b/AiPlatform/src/V1/ExportModelRequest/OutputConfig.php index 951f2d84906f..18349b43dc89 100644 --- a/AiPlatform/src/V1/ExportModelRequest/OutputConfig.php +++ b/AiPlatform/src/V1/ExportModelRequest/OutputConfig.php @@ -24,7 +24,7 @@ class OutputConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string export_format_id = 1; */ - private $export_format_id = ''; + protected $export_format_id = ''; /** * The Cloud Storage location where the Model artifact is to be * written to. Under the directory given as the destination a new one with @@ -37,7 +37,7 @@ class OutputConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GcsDestination artifact_destination = 3; */ - private $artifact_destination = null; + protected $artifact_destination = null; /** * The Google Container Registry or Artifact Registry uri where the * Model container image will be copied to. @@ -46,7 +46,7 @@ class OutputConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ContainerRegistryDestination image_destination = 4; */ - private $image_destination = null; + protected $image_destination = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ExportTensorboardTimeSeriesDataRequest.php b/AiPlatform/src/V1/ExportTensorboardTimeSeriesDataRequest.php index f2a42dfacb3c..7951fd4cd072 100644 --- a/AiPlatform/src/V1/ExportTensorboardTimeSeriesDataRequest.php +++ b/AiPlatform/src/V1/ExportTensorboardTimeSeriesDataRequest.php @@ -23,13 +23,13 @@ class ExportTensorboardTimeSeriesDataRequest extends \Google\Protobuf\Internal\M * * Generated from protobuf field string tensorboard_time_series = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $tensorboard_time_series = ''; + protected $tensorboard_time_series = ''; /** * Exports the TensorboardTimeSeries' data that match the filter expression. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of data points to return per page. * The default page_size is 1000. Values must be between 1 and 10000. @@ -37,7 +37,7 @@ class ExportTensorboardTimeSeriesDataRequest extends \Google\Protobuf\Internal\M * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData] @@ -48,7 +48,7 @@ class ExportTensorboardTimeSeriesDataRequest extends \Google\Protobuf\Internal\M * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Field to use to sort the TensorboardTimeSeries' data. * By default, TensorboardTimeSeries' data is returned in a pseudo random @@ -56,7 +56,7 @@ class ExportTensorboardTimeSeriesDataRequest extends \Google\Protobuf\Internal\M * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $tensorboardTimeSeries Required. The resource name of the TensorboardTimeSeries to export data diff --git a/AiPlatform/src/V1/ExportTensorboardTimeSeriesDataResponse.php b/AiPlatform/src/V1/ExportTensorboardTimeSeriesDataResponse.php index dbd569ce08a6..664be2910658 100644 --- a/AiPlatform/src/V1/ExportTensorboardTimeSeriesDataResponse.php +++ b/AiPlatform/src/V1/ExportTensorboardTimeSeriesDataResponse.php @@ -30,7 +30,7 @@ class ExportTensorboardTimeSeriesDataResponse extends \Google\Protobuf\Internal\ * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/Feature.php b/AiPlatform/src/V1/Feature.php index f31b37de32cc..99e03e3bd4f5 100644 --- a/AiPlatform/src/V1/Feature.php +++ b/AiPlatform/src/V1/Feature.php @@ -28,34 +28,34 @@ class Feature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Description of the Feature. * * Generated from protobuf field string description = 2; */ - private $description = ''; + protected $description = ''; /** * Immutable. Only applicable for Vertex AI Feature Store (Legacy). * Type of Feature value. * * Generated from protobuf field .google.cloud.aiplatform.v1.Feature.ValueType value_type = 3 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $value_type = 0; + protected $value_type = 0; /** * Output only. Only applicable for Vertex AI Feature Store (Legacy). * Timestamp when this EntityType was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Only applicable for Vertex AI Feature Store (Legacy). * Timestamp when this EntityType was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. The labels with user-defined metadata to organize your Features. * Label keys and values can be no longer than 64 characters @@ -76,7 +76,7 @@ class Feature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 7; */ - private $etag = ''; + protected $etag = ''; /** * Optional. Only applicable for Vertex AI Feature Store (Legacy). * If not set, use the monitoring_config defined for the EntityType this @@ -89,7 +89,7 @@ class Feature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_monitoring = 12 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_monitoring = false; + protected $disable_monitoring = false; /** * Output only. Only applicable for Vertex AI Feature Store (Legacy). * The list of historical stats and anomalies with specified objectives. @@ -104,14 +104,14 @@ class Feature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version_column_name = 106; */ - private $version_column_name = ''; + protected $version_column_name = ''; /** * Entity responsible for maintaining this feature. Can be comma separated * list of email addresses or URIs. * * Generated from protobuf field string point_of_contact = 107; */ - private $point_of_contact = ''; + protected $point_of_contact = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/Feature/MonitoringStatsAnomaly.php b/AiPlatform/src/V1/Feature/MonitoringStatsAnomaly.php index 43a546d8dcfa..d25ac717bb9b 100644 --- a/AiPlatform/src/V1/Feature/MonitoringStatsAnomaly.php +++ b/AiPlatform/src/V1/Feature/MonitoringStatsAnomaly.php @@ -26,13 +26,13 @@ class MonitoringStatsAnomaly extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Feature.MonitoringStatsAnomaly.Objective objective = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $objective = 0; + protected $objective = 0; /** * Output only. The stats and anomalies generated at specific timestamp. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureStatsAnomaly feature_stats_anomaly = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $feature_stats_anomaly = null; + protected $feature_stats_anomaly = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Feature/ValueType.php b/AiPlatform/src/V1/Feature/ValueType.php index bdf839d57f13..2bccc4fba097 100644 --- a/AiPlatform/src/V1/Feature/ValueType.php +++ b/AiPlatform/src/V1/Feature/ValueType.php @@ -74,6 +74,12 @@ class ValueType * Generated from protobuf enum BYTES = 13; */ const BYTES = 13; + /** + * Used for Feature that is struct. + * + * Generated from protobuf enum STRUCT = 14; + */ + const STRUCT = 14; private static $valueToName = [ self::VALUE_TYPE_UNSPECIFIED => 'VALUE_TYPE_UNSPECIFIED', @@ -86,6 +92,7 @@ class ValueType self::STRING => 'STRING', self::STRING_ARRAY => 'STRING_ARRAY', self::BYTES => 'BYTES', + self::STRUCT => 'STRUCT', ]; public static function name($value) diff --git a/AiPlatform/src/V1/FeatureGroup.php b/AiPlatform/src/V1/FeatureGroup.php index da5f95e314e1..0893a31fd515 100644 --- a/AiPlatform/src/V1/FeatureGroup.php +++ b/AiPlatform/src/V1/FeatureGroup.php @@ -21,26 +21,26 @@ class FeatureGroup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ - private $name = ''; + protected $name = ''; /** * Output only. Timestamp when this FeatureGroup was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this FeatureGroup was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Used to perform consistent read-modify-write updates. If not set, * a blind "overwrite" update happens. * * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Optional. The labels with user-defined metadata to organize your * FeatureGroup. @@ -60,7 +60,7 @@ class FeatureGroup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; protected $source; /** @@ -71,9 +71,9 @@ class FeatureGroup extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\AIPlatform\V1\FeatureGroup\BigQuery $big_query * Indicates that features for this group come from BigQuery Table/View. - * By default treats the source as a sparse time series source, which is - * required to have an entity_id and a feature_timestamp column in the - * source. + * By default treats the source as a sparse time series source. The BigQuery + * source table or view must have at least one entity ID column and a column + * named `feature_timestamp`. * @type string $name * Identifier. Name of the FeatureGroup. Format: * `projects/{project}/locations/{location}/featureGroups/{featureGroup}` @@ -105,9 +105,9 @@ public function __construct($data = NULL) { /** * Indicates that features for this group come from BigQuery Table/View. - * By default treats the source as a sparse time series source, which is - * required to have an entity_id and a feature_timestamp column in the - * source. + * By default treats the source as a sparse time series source. The BigQuery + * source table or view must have at least one entity ID column and a column + * named `feature_timestamp`. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureGroup.BigQuery big_query = 7; * @return \Google\Cloud\AIPlatform\V1\FeatureGroup\BigQuery|null @@ -124,9 +124,9 @@ public function hasBigQuery() /** * Indicates that features for this group come from BigQuery Table/View. - * By default treats the source as a sparse time series source, which is - * required to have an entity_id and a feature_timestamp column in the - * source. + * By default treats the source as a sparse time series source. The BigQuery + * source table or view must have at least one entity ID column and a column + * named `feature_timestamp`. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureGroup.BigQuery big_query = 7; * @param \Google\Cloud\AIPlatform\V1\FeatureGroup\BigQuery $var diff --git a/AiPlatform/src/V1/FeatureGroup/BigQuery.php b/AiPlatform/src/V1/FeatureGroup/BigQuery.php index 2c9d2b90c12b..b2ef7c002990 100644 --- a/AiPlatform/src/V1/FeatureGroup/BigQuery.php +++ b/AiPlatform/src/V1/FeatureGroup/BigQuery.php @@ -21,7 +21,7 @@ class BigQuery extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; */ - private $big_query_source = null; + protected $big_query_source = null; /** * Optional. Columns to construct entity_id / row keys. * If not provided defaults to `entity_id`. diff --git a/AiPlatform/src/V1/FeatureNoiseSigma/NoiseSigmaForFeature.php b/AiPlatform/src/V1/FeatureNoiseSigma/NoiseSigmaForFeature.php index c53536f53d47..cca2ad2d7b50 100644 --- a/AiPlatform/src/V1/FeatureNoiseSigma/NoiseSigmaForFeature.php +++ b/AiPlatform/src/V1/FeatureNoiseSigma/NoiseSigmaForFeature.php @@ -23,7 +23,7 @@ class NoiseSigmaForFeature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * This represents the standard deviation of the Gaussian kernel that will * be used to add noise to the feature prior to computing gradients. Similar @@ -32,7 +32,7 @@ class NoiseSigmaForFeature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float sigma = 2; */ - private $sigma = 0.0; + protected $sigma = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureOnlineStore.php b/AiPlatform/src/V1/FeatureOnlineStore.php index a4742b610d4b..562b38e6599e 100644 --- a/AiPlatform/src/V1/FeatureOnlineStore.php +++ b/AiPlatform/src/V1/FeatureOnlineStore.php @@ -23,26 +23,26 @@ class FeatureOnlineStore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ - private $name = ''; + protected $name = ''; /** * Output only. Timestamp when this FeatureOnlineStore was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this FeatureOnlineStore was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Used to perform consistent read-modify-write updates. If not set, * a blind "overwrite" update happens. * * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Optional. The labels with user-defined metadata to organize your * FeatureOnlineStore. @@ -62,14 +62,21 @@ class FeatureOnlineStore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureOnlineStore.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Optional. The dedicated serving endpoint for this FeatureOnlineStore, which * is different from common Vertex service endpoint. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureOnlineStore.DedicatedServingEndpoint dedicated_serving_endpoint = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $dedicated_serving_endpoint = null; + protected $dedicated_serving_endpoint = null; + /** + * Optional. Customer-managed encryption key spec for data storage. If set, + * online store will be secured by this key. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_spec = null; protected $storage_type; /** @@ -113,6 +120,9 @@ class FeatureOnlineStore extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\AIPlatform\V1\FeatureOnlineStore\DedicatedServingEndpoint $dedicated_serving_endpoint * Optional. The dedicated serving endpoint for this FeatureOnlineStore, which * is different from common Vertex service endpoint. + * @type \Google\Cloud\AIPlatform\V1\EncryptionSpec $encryption_spec + * Optional. Customer-managed encryption key spec for data storage. If set, + * online store will be secured by this key. * } */ public function __construct($data = NULL) { @@ -428,6 +438,44 @@ public function setDedicatedServingEndpoint($var) return $this; } + /** + * Optional. Customer-managed encryption key spec for data storage. If set, + * online store will be secured by this key. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\EncryptionSpec|null + */ + public function getEncryptionSpec() + { + return $this->encryption_spec; + } + + public function hasEncryptionSpec() + { + return isset($this->encryption_spec); + } + + public function clearEncryptionSpec() + { + unset($this->encryption_spec); + } + + /** + * Optional. Customer-managed encryption key spec for data storage. If set, + * online store will be secured by this key. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\EncryptionSpec $var + * @return $this + */ + public function setEncryptionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\EncryptionSpec::class); + $this->encryption_spec = $var; + + return $this; + } + /** * @return string */ diff --git a/AiPlatform/src/V1/FeatureOnlineStore/Bigtable.php b/AiPlatform/src/V1/FeatureOnlineStore/Bigtable.php index fdb115794a7d..a686db9a523e 100644 --- a/AiPlatform/src/V1/FeatureOnlineStore/Bigtable.php +++ b/AiPlatform/src/V1/FeatureOnlineStore/Bigtable.php @@ -18,7 +18,7 @@ class Bigtable extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureOnlineStore.Bigtable.AutoScaling auto_scaling = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $auto_scaling = null; + protected $auto_scaling = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureOnlineStore/Bigtable/AutoScaling.php b/AiPlatform/src/V1/FeatureOnlineStore/Bigtable/AutoScaling.php index 641364326c10..c08c05d21a7e 100644 --- a/AiPlatform/src/V1/FeatureOnlineStore/Bigtable/AutoScaling.php +++ b/AiPlatform/src/V1/FeatureOnlineStore/Bigtable/AutoScaling.php @@ -19,7 +19,7 @@ class AutoScaling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 min_node_count = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $min_node_count = 0; + protected $min_node_count = 0; /** * Required. The maximum number of nodes to scale up to. Must be greater * than or equal to min_node_count, and less than or equal to 10 times of @@ -27,7 +27,7 @@ class AutoScaling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 max_node_count = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_node_count = 0; + protected $max_node_count = 0; /** * Optional. A percentage of the cluster's CPU capacity. Can be from 10% * to 80%. When a cluster's CPU utilization exceeds the target that you @@ -37,7 +37,7 @@ class AutoScaling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 cpu_utilization_target = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $cpu_utilization_target = 0; + protected $cpu_utilization_target = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureOnlineStore/DedicatedServingEndpoint.php b/AiPlatform/src/V1/FeatureOnlineStore/DedicatedServingEndpoint.php index 340d2561ea36..08e52360b936 100644 --- a/AiPlatform/src/V1/FeatureOnlineStore/DedicatedServingEndpoint.php +++ b/AiPlatform/src/V1/FeatureOnlineStore/DedicatedServingEndpoint.php @@ -23,7 +23,7 @@ class DedicatedServingEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string public_endpoint_domain_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $public_endpoint_domain_name = ''; + protected $public_endpoint_domain_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureOnlineStoreAdminServiceClient.php b/AiPlatform/src/V1/FeatureOnlineStoreAdminServiceClient.php deleted file mode 100644 index 25cf712fc925..000000000000 --- a/AiPlatform/src/V1/FeatureOnlineStoreAdminServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -.google.cloud.aiplatform.v1.IdMatcher id_matcher = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $id_matcher = null; + protected $id_matcher = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureStatsAnomaly.php b/AiPlatform/src/V1/FeatureStatsAnomaly.php index 57f94a90d5cf..5ccd30b5a112 100644 --- a/AiPlatform/src/V1/FeatureStatsAnomaly.php +++ b/AiPlatform/src/V1/FeatureStatsAnomaly.php @@ -33,7 +33,7 @@ class FeatureStatsAnomaly extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double score = 1; */ - private $score = 0.0; + protected $score = 0.0; /** * Path of the stats file for current feature values in Cloud Storage bucket. * Format: gs:////stats. @@ -43,7 +43,7 @@ class FeatureStatsAnomaly extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string stats_uri = 3; */ - private $stats_uri = ''; + protected $stats_uri = ''; /** * Path of the anomaly file for current feature values in Cloud Storage * bucket. @@ -56,7 +56,7 @@ class FeatureStatsAnomaly extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string anomaly_uri = 4; */ - private $anomaly_uri = ''; + protected $anomaly_uri = ''; /** * Deviation from the current stats to baseline stats. * 1. For categorical feature, the distribution distance is calculated by @@ -66,7 +66,7 @@ class FeatureStatsAnomaly extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double distribution_deviation = 5; */ - private $distribution_deviation = 0.0; + protected $distribution_deviation = 0.0; /** * This is the threshold used when detecting anomalies. * The threshold can be changed by user, so this one might be different from @@ -74,7 +74,7 @@ class FeatureStatsAnomaly extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double anomaly_detection_threshold = 9; */ - private $anomaly_detection_threshold = 0.0; + protected $anomaly_detection_threshold = 0.0; /** * The start timestamp of window where stats were generated. * For objectives where time window doesn't make sense (e.g. Featurestore @@ -83,7 +83,7 @@ class FeatureStatsAnomaly extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 7; */ - private $start_time = null; + protected $start_time = null; /** * The end timestamp of window where stats were generated. * For objectives where time window doesn't make sense (e.g. Featurestore @@ -92,7 +92,7 @@ class FeatureStatsAnomaly extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp end_time = 8; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureValue.php b/AiPlatform/src/V1/FeatureValue.php index eef9d6554633..12671a6e42df 100644 --- a/AiPlatform/src/V1/FeatureValue.php +++ b/AiPlatform/src/V1/FeatureValue.php @@ -20,7 +20,7 @@ class FeatureValue extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureValue.Metadata metadata = 14; */ - private $metadata = null; + protected $metadata = null; protected $value; /** @@ -47,6 +47,8 @@ class FeatureValue extends \Google\Protobuf\Internal\Message * A list of string type feature value. * @type string $bytes_value * Bytes feature value. + * @type \Google\Cloud\AIPlatform\V1\StructValue $struct_value + * A struct type feature value. * @type \Google\Cloud\AIPlatform\V1\FeatureValue\Metadata $metadata * Metadata of feature value. * } @@ -335,6 +337,37 @@ public function setBytesValue($var) return $this; } + /** + * A struct type feature value. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.StructValue struct_value = 15; + * @return \Google\Cloud\AIPlatform\V1\StructValue|null + */ + public function getStructValue() + { + return $this->readOneof(15); + } + + public function hasStructValue() + { + return $this->hasOneof(15); + } + + /** + * A struct type feature value. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.StructValue struct_value = 15; + * @param \Google\Cloud\AIPlatform\V1\StructValue $var + * @return $this + */ + public function setStructValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\StructValue::class); + $this->writeOneof(15, $var); + + return $this; + } + /** * Metadata of feature value. * diff --git a/AiPlatform/src/V1/FeatureValue/Metadata.php b/AiPlatform/src/V1/FeatureValue/Metadata.php index e9e2ef8b64ce..5285f91093fa 100644 --- a/AiPlatform/src/V1/FeatureValue/Metadata.php +++ b/AiPlatform/src/V1/FeatureValue/Metadata.php @@ -25,7 +25,7 @@ class Metadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp generate_time = 1; */ - private $generate_time = null; + protected $generate_time = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureView.php b/AiPlatform/src/V1/FeatureView.php index 348482a93b49..bd02c1721b84 100644 --- a/AiPlatform/src/V1/FeatureView.php +++ b/AiPlatform/src/V1/FeatureView.php @@ -22,26 +22,26 @@ class FeatureView extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ - private $name = ''; + protected $name = ''; /** * Output only. Timestamp when this FeatureView was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this FeatureView was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Used to perform consistent read-modify-write updates. If not set, * a blind "overwrite" update happens. * * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Optional. The labels with user-defined metadata to organize your * FeatureViews. @@ -63,7 +63,7 @@ class FeatureView extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureView.SyncConfig sync_config = 7; */ - private $sync_config = null; + protected $sync_config = null; /** * Optional. Configuration for index preparation for vector search. It * contains the required configurations to create an index from source data, @@ -72,7 +72,7 @@ class FeatureView extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureView.IndexConfig index_config = 15 [(.google.api.field_behavior) = OPTIONAL]; */ - private $index_config = null; + protected $index_config = null; protected $source; /** diff --git a/AiPlatform/src/V1/FeatureView/BigQuerySource.php b/AiPlatform/src/V1/FeatureView/BigQuerySource.php index 071ed5f4fa30..2bc1794e1fa1 100644 --- a/AiPlatform/src/V1/FeatureView/BigQuerySource.php +++ b/AiPlatform/src/V1/FeatureView/BigQuerySource.php @@ -19,7 +19,7 @@ class BigQuerySource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $uri = ''; + protected $uri = ''; /** * Required. Columns to construct entity_id / row keys. * diff --git a/AiPlatform/src/V1/FeatureView/FeatureRegistrySource.php b/AiPlatform/src/V1/FeatureView/FeatureRegistrySource.php index eeb3516d7b00..bc9e6147dc18 100644 --- a/AiPlatform/src/V1/FeatureView/FeatureRegistrySource.php +++ b/AiPlatform/src/V1/FeatureView/FeatureRegistrySource.php @@ -27,7 +27,7 @@ class FeatureRegistrySource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int64 project_number = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $project_number = null; + protected $project_number = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureView/FeatureRegistrySource/FeatureGroup.php b/AiPlatform/src/V1/FeatureView/FeatureRegistrySource/FeatureGroup.php index d4f7da0ef505..c57bf60856e8 100644 --- a/AiPlatform/src/V1/FeatureView/FeatureRegistrySource/FeatureGroup.php +++ b/AiPlatform/src/V1/FeatureView/FeatureRegistrySource/FeatureGroup.php @@ -21,7 +21,7 @@ class FeatureGroup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_group_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_group_id = ''; + protected $feature_group_id = ''; /** * Required. Identifiers of features under the feature group. * diff --git a/AiPlatform/src/V1/FeatureView/IndexConfig.php b/AiPlatform/src/V1/FeatureView/IndexConfig.php index 5f60331d319d..5d267a5fdcf4 100644 --- a/AiPlatform/src/V1/FeatureView/IndexConfig.php +++ b/AiPlatform/src/V1/FeatureView/IndexConfig.php @@ -22,7 +22,7 @@ class IndexConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string embedding_column = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $embedding_column = ''; + protected $embedding_column = ''; /** * Optional. Columns of features that're used to filter vector search * results. @@ -43,19 +43,19 @@ class IndexConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string crowding_column = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $crowding_column = ''; + protected $crowding_column = ''; /** * Optional. The number of dimensions of the input embedding. * * Generated from protobuf field optional int32 embedding_dimension = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $embedding_dimension = null; + protected $embedding_dimension = null; /** * Optional. The distance measure used in nearest neighbor search. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureView.IndexConfig.DistanceMeasureType distance_measure_type = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $distance_measure_type = 0; + protected $distance_measure_type = 0; protected $algorithm_config; /** diff --git a/AiPlatform/src/V1/FeatureView/IndexConfig/TreeAHConfig.php b/AiPlatform/src/V1/FeatureView/IndexConfig/TreeAHConfig.php index 0d56662cbc72..5f40d88a5874 100644 --- a/AiPlatform/src/V1/FeatureView/IndexConfig/TreeAHConfig.php +++ b/AiPlatform/src/V1/FeatureView/IndexConfig/TreeAHConfig.php @@ -21,7 +21,7 @@ class TreeAHConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int64 leaf_node_embedding_count = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $leaf_node_embedding_count = null; + protected $leaf_node_embedding_count = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureView/SyncConfig.php b/AiPlatform/src/V1/FeatureView/SyncConfig.php index ec79c353e6b4..2d3ea23f9625 100644 --- a/AiPlatform/src/V1/FeatureView/SyncConfig.php +++ b/AiPlatform/src/V1/FeatureView/SyncConfig.php @@ -25,7 +25,7 @@ class SyncConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string cron = 1; */ - private $cron = ''; + protected $cron = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureViewSync.php b/AiPlatform/src/V1/FeatureViewSync.php index 033b43a622a3..6a4897b4ac72 100644 --- a/AiPlatform/src/V1/FeatureViewSync.php +++ b/AiPlatform/src/V1/FeatureViewSync.php @@ -22,7 +22,7 @@ class FeatureViewSync extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ - private $name = ''; + protected $name = ''; /** * Output only. Time when this FeatureViewSync is created. Creation of a * FeatureViewSync means that the job is pending / waiting for sufficient @@ -30,25 +30,25 @@ class FeatureViewSync extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time when this FeatureViewSync is finished. * * Generated from protobuf field .google.type.Interval run_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $run_time = null; + protected $run_time = null; /** * Output only. Final status of the FeatureViewSync. * * Generated from protobuf field .google.rpc.Status final_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $final_status = null; + protected $final_status = null; /** * Output only. Summary of the sync job. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureViewSync.SyncSummary sync_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $sync_summary = null; + protected $sync_summary = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FeatureViewSync/SyncSummary.php b/AiPlatform/src/V1/FeatureViewSync/SyncSummary.php index e50d0335284a..f382023697b7 100644 --- a/AiPlatform/src/V1/FeatureViewSync/SyncSummary.php +++ b/AiPlatform/src/V1/FeatureViewSync/SyncSummary.php @@ -21,13 +21,13 @@ class SyncSummary extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 row_synced = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $row_synced = 0; + protected $row_synced = 0; /** * Output only. BigQuery slot milliseconds consumed for the sync job. * * Generated from protobuf field int64 total_slot = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $total_slot = 0; + protected $total_slot = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/Featurestore.php b/AiPlatform/src/V1/Featurestore.php index e7767af4928c..d538cfed35fc 100644 --- a/AiPlatform/src/V1/Featurestore.php +++ b/AiPlatform/src/V1/Featurestore.php @@ -23,26 +23,26 @@ class Featurestore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Timestamp when this Featurestore was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Featurestore was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Used to perform consistent read-modify-write updates. If not set, * a blind "overwrite" update happens. * * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Optional. The labels with user-defined metadata to organize your * Featurestore. @@ -66,13 +66,13 @@ class Featurestore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Featurestore.OnlineServingConfig online_serving_config = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $online_serving_config = null; + protected $online_serving_config = null; /** * Output only. State of the featurestore. * * Generated from protobuf field .google.cloud.aiplatform.v1.Featurestore.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Optional. TTL in days for feature values that will be stored in online * serving storage. The Feature Store online storage periodically removes @@ -83,14 +83,14 @@ class Featurestore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 online_storage_ttl_days = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $online_storage_ttl_days = 0; + protected $online_storage_ttl_days = 0; /** * Optional. Customer-managed encryption key spec for data storage. If set, * both of the online and offline data storage will be secured by this key. * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Featurestore/OnlineServingConfig.php b/AiPlatform/src/V1/Featurestore/OnlineServingConfig.php index 6f4fbebbf450..a4a859ded590 100644 --- a/AiPlatform/src/V1/Featurestore/OnlineServingConfig.php +++ b/AiPlatform/src/V1/Featurestore/OnlineServingConfig.php @@ -24,7 +24,7 @@ class OnlineServingConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 fixed_node_count = 2; */ - private $fixed_node_count = 0; + protected $fixed_node_count = 0; /** * Online serving scaling configuration. * Only one of `fixed_node_count` and `scaling` can be set. Setting one will @@ -32,7 +32,7 @@ class OnlineServingConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Featurestore.OnlineServingConfig.Scaling scaling = 4; */ - private $scaling = null; + protected $scaling = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Featurestore/OnlineServingConfig/Scaling.php b/AiPlatform/src/V1/Featurestore/OnlineServingConfig/Scaling.php index 7f722ed97436..14543f8613dc 100644 --- a/AiPlatform/src/V1/Featurestore/OnlineServingConfig/Scaling.php +++ b/AiPlatform/src/V1/Featurestore/OnlineServingConfig/Scaling.php @@ -23,14 +23,14 @@ class Scaling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 min_node_count = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $min_node_count = 0; + protected $min_node_count = 0; /** * The maximum number of nodes to scale up to. Must be greater than * min_node_count, and less than or equal to 10 times of 'min_node_count'. * * Generated from protobuf field int32 max_node_count = 2; */ - private $max_node_count = 0; + protected $max_node_count = 0; /** * Optional. The cpu utilization that the Autoscaler should be trying to * achieve. This number is on a scale from 0 (no utilization) to 100 @@ -42,7 +42,7 @@ class Scaling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 cpu_utilization_target = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $cpu_utilization_target = 0; + protected $cpu_utilization_target = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/FeaturestoreMonitoringConfig.php b/AiPlatform/src/V1/FeaturestoreMonitoringConfig.php index 88650539f76a..9d13f9c4ff78 100644 --- a/AiPlatform/src/V1/FeaturestoreMonitoringConfig.php +++ b/AiPlatform/src/V1/FeaturestoreMonitoringConfig.php @@ -20,13 +20,13 @@ class FeaturestoreMonitoringConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis snapshot_analysis = 1; */ - private $snapshot_analysis = null; + protected $snapshot_analysis = null; /** * The config for ImportFeatures Analysis Based Feature Monitoring. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis import_features_analysis = 2; */ - private $import_features_analysis = null; + protected $import_features_analysis = null; /** * Threshold for numerical features of anomaly detection. * This is shared by all objectives of Featurestore Monitoring for numerical @@ -36,7 +36,7 @@ class FeaturestoreMonitoringConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ThresholdConfig numerical_threshold_config = 3; */ - private $numerical_threshold_config = null; + protected $numerical_threshold_config = null; /** * Threshold for categorical features of anomaly detection. * This is shared by all types of Featurestore Monitoring for categorical @@ -46,7 +46,7 @@ class FeaturestoreMonitoringConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ThresholdConfig categorical_threshold_config = 4; */ - private $categorical_threshold_config = null; + protected $categorical_threshold_config = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FeaturestoreMonitoringConfig/ImportFeaturesAnalysis.php b/AiPlatform/src/V1/FeaturestoreMonitoringConfig/ImportFeaturesAnalysis.php index 9e36fd08e698..195aa9dfc58f 100644 --- a/AiPlatform/src/V1/FeaturestoreMonitoringConfig/ImportFeaturesAnalysis.php +++ b/AiPlatform/src/V1/FeaturestoreMonitoringConfig/ImportFeaturesAnalysis.php @@ -25,14 +25,14 @@ class ImportFeaturesAnalysis extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis.State state = 1; */ - private $state = 0; + protected $state = 0; /** * The baseline used to do anomaly detection for the statistics generated by * import features analysis. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis.Baseline anomaly_detection_baseline = 2; */ - private $anomaly_detection_baseline = 0; + protected $anomaly_detection_baseline = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/FeaturestoreMonitoringConfig/SnapshotAnalysis.php b/AiPlatform/src/V1/FeaturestoreMonitoringConfig/SnapshotAnalysis.php index 42230a0fc2d3..67f2b677d9a4 100644 --- a/AiPlatform/src/V1/FeaturestoreMonitoringConfig/SnapshotAnalysis.php +++ b/AiPlatform/src/V1/FeaturestoreMonitoringConfig/SnapshotAnalysis.php @@ -33,14 +33,14 @@ class SnapshotAnalysis extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disabled = 1; */ - private $disabled = false; + protected $disabled = false; /** * Configuration of the snapshot analysis based monitoring pipeline * running interval. The value indicates number of days. * * Generated from protobuf field int32 monitoring_interval_days = 3; */ - private $monitoring_interval_days = 0; + protected $monitoring_interval_days = 0; /** * Customized export features time window for snapshot analysis. Unit is one * day. Default value is 3 weeks. Minimum value is 1 day. Maximum value is @@ -48,7 +48,7 @@ class SnapshotAnalysis extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 staleness_days = 4; */ - private $staleness_days = 0; + protected $staleness_days = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/FeaturestoreOnlineServingServiceClient.php b/AiPlatform/src/V1/FeaturestoreOnlineServingServiceClient.php deleted file mode 100644 index 4942dc5a654b..000000000000 --- a/AiPlatform/src/V1/FeaturestoreOnlineServingServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/ReadFeatureValues', - $argument, - ['\Google\Cloud\AIPlatform\V1\ReadFeatureValuesResponse', 'decode'], - $metadata, $options); - } - - /** - * Reads Feature values for multiple entities. Depending on their size, data - * for different entities may be broken - * up across multiple responses. - * @param \Google\Cloud\AIPlatform\V1\StreamingReadFeatureValuesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\ServerStreamingCall - */ - public function StreamingReadFeatureValues(\Google\Cloud\AIPlatform\V1\StreamingReadFeatureValuesRequest $argument, - $metadata = [], $options = []) { - return $this->_serverStreamRequest('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/StreamingReadFeatureValues', - $argument, - ['\Google\Cloud\AIPlatform\V1\ReadFeatureValuesResponse', 'decode'], - $metadata, $options); - } - - /** - * Writes Feature values of one or more entities of an EntityType. - * - * The Feature values are merged into existing entities if any. The Feature - * values to be written must have timestamp within the online storage - * retention. - * @param \Google\Cloud\AIPlatform\V1\WriteFeatureValuesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function WriteFeatureValues(\Google\Cloud\AIPlatform\V1\WriteFeatureValuesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/WriteFeatureValues', - $argument, - ['\Google\Cloud\AIPlatform\V1\WriteFeatureValuesResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/FeaturestoreServiceClient.php b/AiPlatform/src/V1/FeaturestoreServiceClient.php deleted file mode 100644 index c98456bc2b9c..000000000000 --- a/AiPlatform/src/V1/FeaturestoreServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/CreateFeaturestore', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Featurestore. - * @param \Google\Cloud\AIPlatform\V1\GetFeaturestoreRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFeaturestore(\Google\Cloud\AIPlatform\V1\GetFeaturestoreRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/GetFeaturestore', - $argument, - ['\Google\Cloud\AIPlatform\V1\Featurestore', 'decode'], - $metadata, $options); - } - - /** - * Lists Featurestores in a given project and location. - * @param \Google\Cloud\AIPlatform\V1\ListFeaturestoresRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFeaturestores(\Google\Cloud\AIPlatform\V1\ListFeaturestoresRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/ListFeaturestores', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListFeaturestoresResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single Featurestore. - * @param \Google\Cloud\AIPlatform\V1\UpdateFeaturestoreRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateFeaturestore(\Google\Cloud\AIPlatform\V1\UpdateFeaturestoreRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/UpdateFeaturestore', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Featurestore. The Featurestore must not contain any - * EntityTypes or `force` must be set to true for the request to succeed. - * @param \Google\Cloud\AIPlatform\V1\DeleteFeaturestoreRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFeaturestore(\Google\Cloud\AIPlatform\V1\DeleteFeaturestoreRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/DeleteFeaturestore', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a new EntityType in a given Featurestore. - * @param \Google\Cloud\AIPlatform\V1\CreateEntityTypeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateEntityType(\Google\Cloud\AIPlatform\V1\CreateEntityTypeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/CreateEntityType', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single EntityType. - * @param \Google\Cloud\AIPlatform\V1\GetEntityTypeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetEntityType(\Google\Cloud\AIPlatform\V1\GetEntityTypeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/GetEntityType', - $argument, - ['\Google\Cloud\AIPlatform\V1\EntityType', 'decode'], - $metadata, $options); - } - - /** - * Lists EntityTypes in a given Featurestore. - * @param \Google\Cloud\AIPlatform\V1\ListEntityTypesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListEntityTypes(\Google\Cloud\AIPlatform\V1\ListEntityTypesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/ListEntityTypes', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListEntityTypesResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single EntityType. - * @param \Google\Cloud\AIPlatform\V1\UpdateEntityTypeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateEntityType(\Google\Cloud\AIPlatform\V1\UpdateEntityTypeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/UpdateEntityType', - $argument, - ['\Google\Cloud\AIPlatform\V1\EntityType', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single EntityType. The EntityType must not have any Features - * or `force` must be set to true for the request to succeed. - * @param \Google\Cloud\AIPlatform\V1\DeleteEntityTypeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteEntityType(\Google\Cloud\AIPlatform\V1\DeleteEntityTypeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/DeleteEntityType', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Feature in a given EntityType. - * @param \Google\Cloud\AIPlatform\V1\CreateFeatureRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateFeature(\Google\Cloud\AIPlatform\V1\CreateFeatureRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/CreateFeature', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a batch of Features in a given EntityType. - * @param \Google\Cloud\AIPlatform\V1\BatchCreateFeaturesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function BatchCreateFeatures(\Google\Cloud\AIPlatform\V1\BatchCreateFeaturesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/BatchCreateFeatures', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Feature. - * @param \Google\Cloud\AIPlatform\V1\GetFeatureRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFeature(\Google\Cloud\AIPlatform\V1\GetFeatureRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/GetFeature', - $argument, - ['\Google\Cloud\AIPlatform\V1\Feature', 'decode'], - $metadata, $options); - } - - /** - * Lists Features in a given EntityType. - * @param \Google\Cloud\AIPlatform\V1\ListFeaturesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFeatures(\Google\Cloud\AIPlatform\V1\ListFeaturesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/ListFeatures', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListFeaturesResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single Feature. - * @param \Google\Cloud\AIPlatform\V1\UpdateFeatureRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateFeature(\Google\Cloud\AIPlatform\V1\UpdateFeatureRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/UpdateFeature', - $argument, - ['\Google\Cloud\AIPlatform\V1\Feature', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Feature. - * @param \Google\Cloud\AIPlatform\V1\DeleteFeatureRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFeature(\Google\Cloud\AIPlatform\V1\DeleteFeatureRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/DeleteFeature', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Imports Feature values into the Featurestore from a source storage. - * - * The progress of the import is tracked by the returned operation. The - * imported features are guaranteed to be visible to subsequent read - * operations after the operation is marked as successfully done. - * - * If an import operation fails, the Feature values returned from - * reads and exports may be inconsistent. If consistency is - * required, the caller must retry the same import request again and wait till - * the new operation returned is marked as successfully done. - * - * There are also scenarios where the caller can cause inconsistency. - * - * - Source data for import contains multiple distinct Feature values for - * the same entity ID and timestamp. - * - Source is modified during an import. This includes adding, updating, or - * removing source data and/or metadata. Examples of updating metadata - * include but are not limited to changing storage location, storage class, - * or retention policy. - * - Online serving cluster is under-provisioned. - * @param \Google\Cloud\AIPlatform\V1\ImportFeatureValuesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportFeatureValues(\Google\Cloud\AIPlatform\V1\ImportFeatureValuesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/ImportFeatureValues', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Batch reads Feature values from a Featurestore. - * - * This API enables batch reading Feature values, where each read - * instance in the batch may read Feature values of entities from one or - * more EntityTypes. Point-in-time correctness is guaranteed for Feature - * values of each read instance as of each instance's read timestamp. - * @param \Google\Cloud\AIPlatform\V1\BatchReadFeatureValuesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function BatchReadFeatureValues(\Google\Cloud\AIPlatform\V1\BatchReadFeatureValuesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/BatchReadFeatureValues', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Exports Feature values from all the entities of a target EntityType. - * @param \Google\Cloud\AIPlatform\V1\ExportFeatureValuesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportFeatureValues(\Google\Cloud\AIPlatform\V1\ExportFeatureValuesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/ExportFeatureValues', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Delete Feature values from Featurestore. - * - * The progress of the deletion is tracked by the returned operation. The - * deleted feature values are guaranteed to be invisible to subsequent read - * operations after the operation is marked as successfully done. - * - * If a delete feature values operation fails, the feature values - * returned from reads and exports may be inconsistent. If consistency is - * required, the caller must retry the same delete request again and wait till - * the new operation returned is marked as successfully done. - * @param \Google\Cloud\AIPlatform\V1\DeleteFeatureValuesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFeatureValues(\Google\Cloud\AIPlatform\V1\DeleteFeatureValuesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/DeleteFeatureValues', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Searches Features matching a query in a given project. - * @param \Google\Cloud\AIPlatform\V1\SearchFeaturesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SearchFeatures(\Google\Cloud\AIPlatform\V1\SearchFeaturesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.FeaturestoreService/SearchFeatures', - $argument, - ['\Google\Cloud\AIPlatform\V1\SearchFeaturesResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/FetchFeatureValuesRequest.php b/AiPlatform/src/V1/FetchFeatureValuesRequest.php index 26a729292741..85ef6d02996e 100644 --- a/AiPlatform/src/V1/FetchFeatureValuesRequest.php +++ b/AiPlatform/src/V1/FetchFeatureValuesRequest.php @@ -23,13 +23,13 @@ class FetchFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_view = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $feature_view = ''; + protected $feature_view = ''; /** * Optional. The request key to fetch feature values for. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureViewDataKey data_key = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $data_key = null; + protected $data_key = null; /** * Optional. Response data format. If not set, * [FeatureViewDataFormat.KEY_VALUE][google.cloud.aiplatform.v1.FeatureViewDataFormat.KEY_VALUE] @@ -37,7 +37,7 @@ class FetchFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureViewDataFormat data_format = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $data_format = 0; + protected $data_format = 0; /** * @param string $featureView Required. FeatureView resource format diff --git a/AiPlatform/src/V1/FetchFeatureValuesResponse.php b/AiPlatform/src/V1/FetchFeatureValuesResponse.php index 0cc4c4debf3d..ae7cc87c31b7 100644 --- a/AiPlatform/src/V1/FetchFeatureValuesResponse.php +++ b/AiPlatform/src/V1/FetchFeatureValuesResponse.php @@ -23,7 +23,7 @@ class FetchFeatureValuesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureViewDataKey data_key = 4; */ - private $data_key = null; + protected $data_key = null; protected $format; /** diff --git a/AiPlatform/src/V1/FetchFeatureValuesResponse/FeatureNameValuePairList/FeatureNameValuePair.php b/AiPlatform/src/V1/FetchFeatureValuesResponse/FeatureNameValuePairList/FeatureNameValuePair.php index 57053a6b5189..88fdf0726b05 100644 --- a/AiPlatform/src/V1/FetchFeatureValuesResponse/FeatureNameValuePairList/FeatureNameValuePair.php +++ b/AiPlatform/src/V1/FetchFeatureValuesResponse/FeatureNameValuePairList/FeatureNameValuePair.php @@ -20,7 +20,7 @@ class FeatureNameValuePair extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; protected $data; /** diff --git a/AiPlatform/src/V1/FileData.php b/AiPlatform/src/V1/FileData.php index 09153cc5942e..acd920e86eb8 100644 --- a/AiPlatform/src/V1/FileData.php +++ b/AiPlatform/src/V1/FileData.php @@ -20,13 +20,13 @@ class FileData extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $mime_type = ''; + protected $mime_type = ''; /** * Required. URI. * * Generated from protobuf field string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $file_uri = ''; + protected $file_uri = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/FilterSplit.php b/AiPlatform/src/V1/FilterSplit.php index b325cab9250f..3c23a46820ed 100644 --- a/AiPlatform/src/V1/FilterSplit.php +++ b/AiPlatform/src/V1/FilterSplit.php @@ -31,7 +31,7 @@ class FilterSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string training_filter = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $training_filter = ''; + protected $training_filter = ''; /** * Required. A filter on DataItems of the Dataset. DataItems that match * this filter are used to validate the Model. A filter with same syntax @@ -43,7 +43,7 @@ class FilterSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string validation_filter = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $validation_filter = ''; + protected $validation_filter = ''; /** * Required. A filter on DataItems of the Dataset. DataItems that match * this filter are used to test the Model. A filter with same syntax @@ -55,7 +55,7 @@ class FilterSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string test_filter = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $test_filter = ''; + protected $test_filter = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/FindNeighborsRequest.php b/AiPlatform/src/V1/FindNeighborsRequest.php index 4a931c568701..0a3b79c5bbaa 100644 --- a/AiPlatform/src/V1/FindNeighborsRequest.php +++ b/AiPlatform/src/V1/FindNeighborsRequest.php @@ -23,7 +23,7 @@ class FindNeighborsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $index_endpoint = ''; + protected $index_endpoint = ''; /** * The ID of the DeployedIndex that will serve the request. This request is * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That @@ -34,7 +34,7 @@ class FindNeighborsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string deployed_index_id = 2; */ - private $deployed_index_id = ''; + protected $deployed_index_id = ''; /** * The list of queries. * @@ -49,7 +49,7 @@ class FindNeighborsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool return_full_datapoint = 4; */ - private $return_full_datapoint = false; + protected $return_full_datapoint = false; /** * Constructor. diff --git a/AiPlatform/src/V1/FindNeighborsRequest/Query.php b/AiPlatform/src/V1/FindNeighborsRequest/Query.php index d7b0f7e0a173..24b4c2d43bb2 100644 --- a/AiPlatform/src/V1/FindNeighborsRequest/Query.php +++ b/AiPlatform/src/V1/FindNeighborsRequest/Query.php @@ -22,7 +22,7 @@ class Query extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $datapoint = null; + protected $datapoint = null; /** * The number of nearest neighbors to be retrieved from database for each * query. If not set, will use the default from the service configuration @@ -30,7 +30,7 @@ class Query extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 neighbor_count = 2; */ - private $neighbor_count = 0; + protected $neighbor_count = 0; /** * Crowding is a constraint on a neighbor list produced by nearest neighbor * search requiring that no more than some value k' of the k neighbors @@ -40,7 +40,7 @@ class Query extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 per_crowding_attribute_neighbor_count = 3; */ - private $per_crowding_attribute_neighbor_count = 0; + protected $per_crowding_attribute_neighbor_count = 0; /** * The number of neighbors to find via approximate search before * exact reordering is performed. If not set, the default value from scam @@ -48,7 +48,7 @@ class Query extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 approximate_neighbor_count = 4; */ - private $approximate_neighbor_count = 0; + protected $approximate_neighbor_count = 0; /** * The fraction of the number of leaves to search, set at query time allows * user to tune search performance. This value increase result in both @@ -59,7 +59,8 @@ class Query extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double fraction_leaf_nodes_to_search_override = 5; */ - private $fraction_leaf_nodes_to_search_override = 0.0; + protected $fraction_leaf_nodes_to_search_override = 0.0; + protected $ranking; /** * Constructor. @@ -67,6 +68,8 @@ class Query extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * + * @type \Google\Cloud\AIPlatform\V1\FindNeighborsRequest\Query\RRF $rrf + * Optional. Represents RRF algorithm that combines search results. * @type \Google\Cloud\AIPlatform\V1\IndexDatapoint $datapoint * Required. The datapoint/vector whose nearest neighbors should be searched * for. @@ -98,6 +101,37 @@ public function __construct($data = NULL) { parent::__construct($data); } + /** + * Optional. Represents RRF algorithm that combines search results. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\FindNeighborsRequest\Query\RRF|null + */ + public function getRrf() + { + return $this->readOneof(6); + } + + public function hasRrf() + { + return $this->hasOneof(6); + } + + /** + * Optional. Represents RRF algorithm that combines search results. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\FindNeighborsRequest\Query\RRF $var + * @return $this + */ + public function setRrf($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\FindNeighborsRequest\Query\RRF::class); + $this->writeOneof(6, $var); + + return $this; + } + /** * Required. The datapoint/vector whose nearest neighbors should be searched * for. @@ -266,6 +300,14 @@ public function setFractionLeafNodesToSearchOverride($var) return $this; } + /** + * @return string + */ + public function getRanking() + { + return $this->whichOneof("ranking"); + } + } diff --git a/AiPlatform/src/V1/FindNeighborsRequest/Query/RRF.php b/AiPlatform/src/V1/FindNeighborsRequest/Query/RRF.php new file mode 100644 index 000000000000..3531fd2dc088 --- /dev/null +++ b/AiPlatform/src/V1/FindNeighborsRequest/Query/RRF.php @@ -0,0 +1,76 @@ +google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF + */ +class RRF extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Users can provide an alpha value to give more weight to dense + * vs sparse results. For example, if the alpha is 0, we only return + * sparse and if the alpha is 1, we only return dense. + * + * Generated from protobuf field float alpha = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $alpha = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $alpha + * Required. Users can provide an alpha value to give more weight to dense + * vs sparse results. For example, if the alpha is 0, we only return + * sparse and if the alpha is 1, we only return dense. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\MatchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Users can provide an alpha value to give more weight to dense + * vs sparse results. For example, if the alpha is 0, we only return + * sparse and if the alpha is 1, we only return dense. + * + * Generated from protobuf field float alpha = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getAlpha() + { + return $this->alpha; + } + + /** + * Required. Users can provide an alpha value to give more weight to dense + * vs sparse results. For example, if the alpha is 0, we only return + * sparse and if the alpha is 1, we only return dense. + * + * Generated from protobuf field float alpha = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setAlpha($var) + { + GPBUtil::checkFloat($var); + $this->alpha = $var; + + return $this; + } + +} + + diff --git a/AiPlatform/src/V1/FindNeighborsResponse/NearestNeighbors.php b/AiPlatform/src/V1/FindNeighborsResponse/NearestNeighbors.php index 903936daafbd..04e1279c5b5f 100644 --- a/AiPlatform/src/V1/FindNeighborsResponse/NearestNeighbors.php +++ b/AiPlatform/src/V1/FindNeighborsResponse/NearestNeighbors.php @@ -20,7 +20,7 @@ class NearestNeighbors extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * All its neighbors. * diff --git a/AiPlatform/src/V1/FindNeighborsResponse/Neighbor.php b/AiPlatform/src/V1/FindNeighborsResponse/Neighbor.php index dda0f4f8b8fc..72b18d042922 100644 --- a/AiPlatform/src/V1/FindNeighborsResponse/Neighbor.php +++ b/AiPlatform/src/V1/FindNeighborsResponse/Neighbor.php @@ -23,13 +23,19 @@ class Neighbor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; */ - private $datapoint = null; + protected $datapoint = null; /** - * The distance between the neighbor and the query vector. + * The distance between the neighbor and the dense embedding query. * * Generated from protobuf field double distance = 2; */ - private $distance = 0.0; + protected $distance = 0.0; + /** + * The distance between the neighbor and the query sparse_embedding. + * + * Generated from protobuf field double sparse_distance = 3; + */ + protected $sparse_distance = 0.0; /** * Constructor. @@ -43,7 +49,9 @@ class Neighbor extends \Google\Protobuf\Internal\Message * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag" * fields are populated. * @type float $distance - * The distance between the neighbor and the query vector. + * The distance between the neighbor and the dense embedding query. + * @type float $sparse_distance + * The distance between the neighbor and the query sparse_embedding. * } */ public function __construct($data = NULL) { @@ -94,7 +102,7 @@ public function setDatapoint($var) } /** - * The distance between the neighbor and the query vector. + * The distance between the neighbor and the dense embedding query. * * Generated from protobuf field double distance = 2; * @return float @@ -105,7 +113,7 @@ public function getDistance() } /** - * The distance between the neighbor and the query vector. + * The distance between the neighbor and the dense embedding query. * * Generated from protobuf field double distance = 2; * @param float $var @@ -119,6 +127,32 @@ public function setDistance($var) return $this; } + /** + * The distance between the neighbor and the query sparse_embedding. + * + * Generated from protobuf field double sparse_distance = 3; + * @return float + */ + public function getSparseDistance() + { + return $this->sparse_distance; + } + + /** + * The distance between the neighbor and the query sparse_embedding. + * + * Generated from protobuf field double sparse_distance = 3; + * @param float $var + * @return $this + */ + public function setSparseDistance($var) + { + GPBUtil::checkDouble($var); + $this->sparse_distance = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/FractionSplit.php b/AiPlatform/src/V1/FractionSplit.php index 5124b20be183..c122220bf0c8 100644 --- a/AiPlatform/src/V1/FractionSplit.php +++ b/AiPlatform/src/V1/FractionSplit.php @@ -25,19 +25,19 @@ class FractionSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double training_fraction = 1; */ - private $training_fraction = 0.0; + protected $training_fraction = 0.0; /** * The fraction of the input data that is to be used to validate the Model. * * Generated from protobuf field double validation_fraction = 2; */ - private $validation_fraction = 0.0; + protected $validation_fraction = 0.0; /** * The fraction of the input data that is to be used to evaluate the Model. * * Generated from protobuf field double test_fraction = 3; */ - private $test_fraction = 0.0; + protected $test_fraction = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/FunctionCall.php b/AiPlatform/src/V1/FunctionCall.php index ca73d3cf160b..601dafb65711 100644 --- a/AiPlatform/src/V1/FunctionCall.php +++ b/AiPlatform/src/V1/FunctionCall.php @@ -23,14 +23,14 @@ class FunctionCall extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. Required. The function parameters and values in JSON object * format. See [FunctionDeclaration.parameters] for parameter details. * * Generated from protobuf field .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $args = null; + protected $args = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FunctionCallingConfig.php b/AiPlatform/src/V1/FunctionCallingConfig.php new file mode 100644 index 000000000000..b65c4e1231cc --- /dev/null +++ b/AiPlatform/src/V1/FunctionCallingConfig.php @@ -0,0 +1,109 @@ +google.cloud.aiplatform.v1.FunctionCallingConfig + */ +class FunctionCallingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Function calling mode. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FunctionCallingConfig.Mode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = 0; + /** + * Optional. Function names to call. Only set when the Mode is ANY. Function + * names should match [FunctionDeclaration.name]. With mode set to ANY, model + * will predict a function call from the set of function names provided. + * + * Generated from protobuf field repeated string allowed_function_names = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allowed_function_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Optional. Function calling mode. + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_function_names + * Optional. Function names to call. Only set when the Mode is ANY. Function + * names should match [FunctionDeclaration.name]. With mode set to ANY, model + * will predict a function call from the set of function names provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Function calling mode. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FunctionCallingConfig.Mode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. Function calling mode. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FunctionCallingConfig.Mode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\FunctionCallingConfig\Mode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. Function names to call. Only set when the Mode is ANY. Function + * names should match [FunctionDeclaration.name]. With mode set to ANY, model + * will predict a function call from the set of function names provided. + * + * Generated from protobuf field repeated string allowed_function_names = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedFunctionNames() + { + return $this->allowed_function_names; + } + + /** + * Optional. Function names to call. Only set when the Mode is ANY. Function + * names should match [FunctionDeclaration.name]. With mode set to ANY, model + * will predict a function call from the set of function names provided. + * + * Generated from protobuf field repeated string allowed_function_names = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedFunctionNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_function_names = $arr; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/FunctionCallingConfig/Mode.php b/AiPlatform/src/V1/FunctionCallingConfig/Mode.php new file mode 100644 index 000000000000..55e591a91cf5 --- /dev/null +++ b/AiPlatform/src/V1/FunctionCallingConfig/Mode.php @@ -0,0 +1,74 @@ +google.cloud.aiplatform.v1.FunctionCallingConfig.Mode + */ +class Mode +{ + /** + * Unspecified function calling mode. This value should not be used. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Default model behavior, model decides to predict either a function call + * or a natural language repspose. + * + * Generated from protobuf enum AUTO = 1; + */ + const AUTO = 1; + /** + * Model is constrained to always predicting a function call only. + * If "allowed_function_names" are set, the predicted function call will be + * limited to any one of "allowed_function_names", else the predicted + * function call will be any one of the provided "function_declarations". + * + * Generated from protobuf enum ANY = 2; + */ + const ANY = 2; + /** + * Model will not predict any function call. Model behavior is same as when + * not passing any function declarations. + * + * Generated from protobuf enum NONE = 3; + */ + const NONE = 3; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::AUTO => 'AUTO', + self::ANY => 'ANY', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/AiPlatform/src/V1/FunctionDeclaration.php b/AiPlatform/src/V1/FunctionDeclaration.php index 5130f027d0df..8499695959db 100644 --- a/AiPlatform/src/V1/FunctionDeclaration.php +++ b/AiPlatform/src/V1/FunctionDeclaration.php @@ -27,14 +27,14 @@ class FunctionDeclaration extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. Description and purpose of the function. * Model uses it to decide how and whether to call the function. * * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. Describes the parameters to this function in JSON Schema Object * format. Reflects the Open API 3.03 Parameter Object. string Key: the name @@ -53,7 +53,7 @@ class FunctionDeclaration extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $parameters = null; + protected $parameters = null; /** * Constructor. diff --git a/AiPlatform/src/V1/FunctionResponse.php b/AiPlatform/src/V1/FunctionResponse.php index 0396c980a23f..0d62db7ae42d 100644 --- a/AiPlatform/src/V1/FunctionResponse.php +++ b/AiPlatform/src/V1/FunctionResponse.php @@ -24,13 +24,13 @@ class FunctionResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The function response in JSON object format. * * Generated from protobuf field .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $response = null; + protected $response = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Gapic/DatasetServiceGapicClient.php b/AiPlatform/src/V1/Gapic/DatasetServiceGapicClient.php deleted file mode 100644 index 39b7f2270f77..000000000000 --- a/AiPlatform/src/V1/Gapic/DatasetServiceGapicClient.php +++ /dev/null @@ -1,2411 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $dataset = new Dataset(); - * $operationResponse = $datasetServiceClient->createDataset($formattedParent, $dataset); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datasetServiceClient->createDataset($formattedParent, $dataset); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datasetServiceClient->resumeOperation($operationName, 'createDataset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\DatasetServiceClient}. - */ -class DatasetServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.DatasetService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $annotationSpecNameTemplate; - - private static $dataItemNameTemplate; - - private static $datasetNameTemplate; - - private static $datasetVersionNameTemplate; - - private static $locationNameTemplate; - - private static $savedQueryNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/dataset_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/dataset_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/dataset_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/dataset_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getAnnotationSpecNameTemplate() - { - if (self::$annotationSpecNameTemplate == null) { - self::$annotationSpecNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ); - } - - return self::$annotationSpecNameTemplate; - } - - private static function getDataItemNameTemplate() - { - if (self::$dataItemNameTemplate == null) { - self::$dataItemNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ); - } - - return self::$dataItemNameTemplate; - } - - private static function getDatasetNameTemplate() - { - if (self::$datasetNameTemplate == null) { - self::$datasetNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ); - } - - return self::$datasetNameTemplate; - } - - private static function getDatasetVersionNameTemplate() - { - if (self::$datasetVersionNameTemplate == null) { - self::$datasetVersionNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}' - ); - } - - return self::$datasetVersionNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getSavedQueryNameTemplate() - { - if (self::$savedQueryNameTemplate == null) { - self::$savedQueryNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ); - } - - return self::$savedQueryNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'annotationSpec' => self::getAnnotationSpecNameTemplate(), - 'dataItem' => self::getDataItemNameTemplate(), - 'dataset' => self::getDatasetNameTemplate(), - 'datasetVersion' => self::getDatasetVersionNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'savedQuery' => self::getSavedQueryNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * annotation_spec resource. - * - * @param string $project - * @param string $location - * @param string $dataset - * @param string $annotationSpec - * - * @return string The formatted annotation_spec resource. - */ - public static function annotationSpecName( - $project, - $location, - $dataset, - $annotationSpec - ) { - return self::getAnnotationSpecNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataset' => $dataset, - 'annotation_spec' => $annotationSpec, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a data_item - * resource. - * - * @param string $project - * @param string $location - * @param string $dataset - * @param string $dataItem - * - * @return string The formatted data_item resource. - */ - public static function dataItemName( - $project, - $location, - $dataset, - $dataItem - ) { - return self::getDataItemNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataset' => $dataset, - 'data_item' => $dataItem, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a dataset - * resource. - * - * @param string $project - * @param string $location - * @param string $dataset - * - * @return string The formatted dataset resource. - */ - public static function datasetName($project, $location, $dataset) - { - return self::getDatasetNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataset' => $dataset, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * dataset_version resource. - * - * @param string $project - * @param string $location - * @param string $dataset - * @param string $datasetVersion - * - * @return string The formatted dataset_version resource. - */ - public static function datasetVersionName( - $project, - $location, - $dataset, - $datasetVersion - ) { - return self::getDatasetVersionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataset' => $dataset, - 'dataset_version' => $datasetVersion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a saved_query - * resource. - * - * @param string $project - * @param string $location - * @param string $dataset - * @param string $savedQuery - * - * @return string The formatted saved_query resource. - */ - public static function savedQueryName( - $project, - $location, - $dataset, - $savedQuery - ) { - return self::getSavedQueryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataset' => $dataset, - 'saved_query' => $savedQuery, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - annotationSpec: projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec} - * - dataItem: projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item} - * - dataset: projects/{project}/locations/{location}/datasets/{dataset} - * - datasetVersion: projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version} - * - location: projects/{project}/locations/{location} - * - savedQuery: projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedParent = $datasetServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $dataset = new Dataset(); - * $operationResponse = $datasetServiceClient->createDataset($formattedParent, $dataset); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datasetServiceClient->createDataset($formattedParent, $dataset); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datasetServiceClient->resumeOperation($operationName, 'createDataset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the Dataset in. - * Format: `projects/{project}/locations/{location}` - * @param Dataset $dataset Required. The Dataset to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDataset($parent, $dataset, array $optionalArgs = []) - { - $request = new CreateDatasetRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDataset($dataset); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateDataset', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Create a version from a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedParent = $datasetServiceClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - * $datasetVersion = new DatasetVersion(); - * $operationResponse = $datasetServiceClient->createDatasetVersion($formattedParent, $datasetVersion); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datasetServiceClient->createDatasetVersion($formattedParent, $datasetVersion); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datasetServiceClient->resumeOperation($operationName, 'createDatasetVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the Dataset resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param DatasetVersion $datasetVersion Required. The version to be created. The same CMEK policies with the - * original Dataset will be applied the dataset version. So here we don't need - * to specify the EncryptionSpecType here. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDatasetVersion( - $parent, - $datasetVersion, - array $optionalArgs = [] - ) { - $request = new CreateDatasetVersionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDatasetVersion($datasetVersion); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateDatasetVersion', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedName = $datasetServiceClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - * $operationResponse = $datasetServiceClient->deleteDataset($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datasetServiceClient->deleteDataset($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datasetServiceClient->resumeOperation($operationName, 'deleteDataset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Dataset to delete. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDataset($name, array $optionalArgs = []) - { - $request = new DeleteDatasetRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDataset', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a Dataset version. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedName = $datasetServiceClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - * $operationResponse = $datasetServiceClient->deleteDatasetVersion($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datasetServiceClient->deleteDatasetVersion($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datasetServiceClient->resumeOperation($operationName, 'deleteDatasetVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Dataset version to delete. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDatasetVersion($name, array $optionalArgs = []) - { - $request = new DeleteDatasetVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDatasetVersion', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a SavedQuery. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedName = $datasetServiceClient->savedQueryName('[PROJECT]', '[LOCATION]', '[DATASET]', '[SAVED_QUERY]'); - * $operationResponse = $datasetServiceClient->deleteSavedQuery($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datasetServiceClient->deleteSavedQuery($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datasetServiceClient->resumeOperation($operationName, 'deleteSavedQuery'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the SavedQuery to delete. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteSavedQuery($name, array $optionalArgs = []) - { - $request = new DeleteSavedQueryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteSavedQuery', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Exports data from a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedName = $datasetServiceClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - * $exportConfig = new ExportDataConfig(); - * $operationResponse = $datasetServiceClient->exportData($formattedName, $exportConfig); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datasetServiceClient->exportData($formattedName, $exportConfig); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datasetServiceClient->resumeOperation($operationName, 'exportData'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Dataset resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param ExportDataConfig $exportConfig Required. The desired output location. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function exportData($name, $exportConfig, array $optionalArgs = []) - { - $request = new ExportDataRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setExportConfig($exportConfig); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'ExportData', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets an AnnotationSpec. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedName = $datasetServiceClient->annotationSpecName('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); - * $response = $datasetServiceClient->getAnnotationSpec($formattedName); - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the AnnotationSpec resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\AnnotationSpec - * - * @throws ApiException if the remote call fails - */ - public function getAnnotationSpec($name, array $optionalArgs = []) - { - $request = new GetAnnotationSpecRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetAnnotationSpec', - AnnotationSpec::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedName = $datasetServiceClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - * $response = $datasetServiceClient->getDataset($formattedName); - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Dataset resource. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Dataset - * - * @throws ApiException if the remote call fails - */ - public function getDataset($name, array $optionalArgs = []) - { - $request = new GetDatasetRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDataset', - Dataset::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a Dataset version. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedName = $datasetServiceClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - * $response = $datasetServiceClient->getDatasetVersion($formattedName); - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Dataset version to delete. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\DatasetVersion - * - * @throws ApiException if the remote call fails - */ - public function getDatasetVersion($name, array $optionalArgs = []) - { - $request = new GetDatasetVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDatasetVersion', - DatasetVersion::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Imports data into a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedName = $datasetServiceClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - * $importConfigs = []; - * $operationResponse = $datasetServiceClient->importData($formattedName, $importConfigs); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datasetServiceClient->importData($formattedName, $importConfigs); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datasetServiceClient->resumeOperation($operationName, 'importData'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Dataset resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param ImportDataConfig[] $importConfigs Required. The desired input locations. The contents of all input locations - * will be imported in one batch. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function importData($name, $importConfigs, array $optionalArgs = []) - { - $request = new ImportDataRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setImportConfigs($importConfigs); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'ImportData', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Lists Annotations belongs to a dataitem - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedParent = $datasetServiceClient->dataItemName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATA_ITEM]'); - * // Iterate over pages of elements - * $pagedResponse = $datasetServiceClient->listAnnotations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $datasetServiceClient->listAnnotations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the DataItem to list Annotations from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAnnotations($parent, array $optionalArgs = []) - { - $request = new ListAnnotationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListAnnotations', - $optionalArgs, - ListAnnotationsResponse::class, - $request - ); - } - - /** - * Lists DataItems in a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedParent = $datasetServiceClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - * // Iterate over pages of elements - * $pagedResponse = $datasetServiceClient->listDataItems($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $datasetServiceClient->listDataItems($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Dataset to list DataItems from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDataItems($parent, array $optionalArgs = []) - { - $request = new ListDataItemsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDataItems', - $optionalArgs, - ListDataItemsResponse::class, - $request - ); - } - - /** - * Lists DatasetVersions in a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedParent = $datasetServiceClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - * // Iterate over pages of elements - * $pagedResponse = $datasetServiceClient->listDatasetVersions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $datasetServiceClient->listDatasetVersions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Dataset to list DatasetVersions from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Optional. Mask specifying which fields to read. - * @type string $orderBy - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDatasetVersions($parent, array $optionalArgs = []) - { - $request = new ListDatasetVersionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDatasetVersions', - $optionalArgs, - ListDatasetVersionsResponse::class, - $request - ); - } - - /** - * Lists Datasets in a Location. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedParent = $datasetServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $datasetServiceClient->listDatasets($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $datasetServiceClient->listDatasets($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the Dataset's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `display_name`: supports = and != - * * `metadata_schema_uri`: supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `display_name` - * * `create_time` - * * `update_time` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDatasets($parent, array $optionalArgs = []) - { - $request = new ListDatasetsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDatasets', - $optionalArgs, - ListDatasetsResponse::class, - $request - ); - } - - /** - * Lists SavedQueries in a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedParent = $datasetServiceClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - * // Iterate over pages of elements - * $pagedResponse = $datasetServiceClient->listSavedQueries($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $datasetServiceClient->listSavedQueries($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Dataset to list SavedQueries from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSavedQueries($parent, array $optionalArgs = []) - { - $request = new ListSavedQueriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListSavedQueries', - $optionalArgs, - ListSavedQueriesResponse::class, - $request - ); - } - - /** - * Restores a dataset version. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedName = $datasetServiceClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - * $operationResponse = $datasetServiceClient->restoreDatasetVersion($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datasetServiceClient->restoreDatasetVersion($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datasetServiceClient->resumeOperation($operationName, 'restoreDatasetVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the DatasetVersion resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function restoreDatasetVersion($name, array $optionalArgs = []) - { - $request = new RestoreDatasetVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'RestoreDatasetVersion', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Searches DataItems in a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $formattedDataset = $datasetServiceClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - * // Iterate over pages of elements - * $pagedResponse = $datasetServiceClient->searchDataItems($formattedDataset); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $datasetServiceClient->searchDataItems($formattedDataset); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $dataset Required. The resource name of the Dataset from which to search DataItems. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param array $optionalArgs { - * Optional. - * - * @type string $orderByDataItem - * A comma-separated list of data item fields to order by, sorted in - * ascending order. Use "desc" after a field name for descending. - * @type OrderByAnnotation $orderByAnnotation - * Expression that allows ranking results based on annotation's property. - * @type string $savedQuery - * The resource name of a SavedQuery(annotation set in UI). - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - * All of the search will be done in the context of this SavedQuery. - * @type string $dataLabelingJob - * The resource name of a DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * If this field is set, all of the search will be done in the context of - * this DataLabelingJob. - * @type string $dataItemFilter - * An expression for filtering the DataItem that will be returned. - * - * * `data_item_id` - for = or !=. - * * `labeled` - for = or !=. - * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that - * have at least one annotation with annotation_spec_id = - * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. - * - * For example: - * - * * `data_item=1` - * * `has_annotation(5)` - * @type string $annotationsFilter - * An expression for filtering the Annotations that will be returned per - * DataItem. - * * `annotation_spec_id` - for = or !=. - * @type string[] $annotationFilters - * An expression that specifies what Annotations will be returned per - * DataItem. Annotations satisfied either of the conditions will be returned. - * * `annotation_spec_id` - for = or !=. - * Must specify `saved_query_id=` - saved query id that annotations should - * belong to. - * @type FieldMask $fieldMask - * Mask specifying which fields of - * [DataItemView][google.cloud.aiplatform.v1.DataItemView] to read. - * @type int $annotationsLimit - * If set, only up to this many of Annotations will be returned per - * DataItemView. The maximum value is 1000. If not set, the maximum value will - * be used. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function searchDataItems($dataset, array $optionalArgs = []) - { - $request = new SearchDataItemsRequest(); - $requestParamHeaders = []; - $request->setDataset($dataset); - $requestParamHeaders['dataset'] = $dataset; - if (isset($optionalArgs['orderByDataItem'])) { - $request->setOrderByDataItem($optionalArgs['orderByDataItem']); - } - - if (isset($optionalArgs['orderByAnnotation'])) { - $request->setOrderByAnnotation($optionalArgs['orderByAnnotation']); - } - - if (isset($optionalArgs['savedQuery'])) { - $request->setSavedQuery($optionalArgs['savedQuery']); - } - - if (isset($optionalArgs['dataLabelingJob'])) { - $request->setDataLabelingJob($optionalArgs['dataLabelingJob']); - } - - if (isset($optionalArgs['dataItemFilter'])) { - $request->setDataItemFilter($optionalArgs['dataItemFilter']); - } - - if (isset($optionalArgs['annotationsFilter'])) { - $request->setAnnotationsFilter($optionalArgs['annotationsFilter']); - } - - if (isset($optionalArgs['annotationFilters'])) { - $request->setAnnotationFilters($optionalArgs['annotationFilters']); - } - - if (isset($optionalArgs['fieldMask'])) { - $request->setFieldMask($optionalArgs['fieldMask']); - } - - if (isset($optionalArgs['annotationsLimit'])) { - $request->setAnnotationsLimit($optionalArgs['annotationsLimit']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'SearchDataItems', - $optionalArgs, - SearchDataItemsResponse::class, - $request - ); - } - - /** - * Updates a Dataset. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $dataset = new Dataset(); - * $updateMask = new FieldMask(); - * $response = $datasetServiceClient->updateDataset($dataset, $updateMask); - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param Dataset $dataset Required. The Dataset which replaces the resource on the server. - * @param FieldMask $updateMask Required. The update mask applies to the resource. - * For the `FieldMask` definition, see - * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Updatable fields: - * - * * `display_name` - * * `description` - * * `labels` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Dataset - * - * @throws ApiException if the remote call fails - */ - public function updateDataset( - $dataset, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateDatasetRequest(); - $requestParamHeaders = []; - $request->setDataset($dataset); - $request->setUpdateMask($updateMask); - $requestParamHeaders['dataset.name'] = $dataset->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateDataset', - Dataset::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $response = $datasetServiceClient->getLocation(); - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $datasetServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $datasetServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $resource = 'resource'; - * $response = $datasetServiceClient->getIamPolicy($resource); - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $datasetServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $datasetServiceClient = new DatasetServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $datasetServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $datasetServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/DeploymentResourcePoolServiceGapicClient.php b/AiPlatform/src/V1/Gapic/DeploymentResourcePoolServiceGapicClient.php deleted file mode 100644 index 3f32b0e06653..000000000000 --- a/AiPlatform/src/V1/Gapic/DeploymentResourcePoolServiceGapicClient.php +++ /dev/null @@ -1,1129 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $deploymentResourcePool = new DeploymentResourcePool(); - * $deploymentResourcePoolId = 'deployment_resource_pool_id'; - * $operationResponse = $deploymentResourcePoolServiceClient->createDeploymentResourcePool($formattedParent, $deploymentResourcePool, $deploymentResourcePoolId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $deploymentResourcePoolServiceClient->createDeploymentResourcePool($formattedParent, $deploymentResourcePool, $deploymentResourcePoolId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $deploymentResourcePoolServiceClient->resumeOperation($operationName, 'createDeploymentResourcePool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\DeploymentResourcePoolServiceClient}. - */ -class DeploymentResourcePoolServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.DeploymentResourcePoolService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $deploymentResourcePoolNameTemplate; - - private static $locationNameTemplate; - - private static $projectNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/deployment_resource_pool_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/deployment_resource_pool_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/deployment_resource_pool_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/deployment_resource_pool_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getDeploymentResourcePoolNameTemplate() - { - if (self::$deploymentResourcePoolNameTemplate == null) { - self::$deploymentResourcePoolNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ); - } - - return self::$deploymentResourcePoolNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'deploymentResourcePool' => self::getDeploymentResourcePoolNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'project' => self::getProjectNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * deployment_resource_pool resource. - * - * @param string $project - * @param string $location - * @param string $deploymentResourcePool - * - * @return string The formatted deployment_resource_pool resource. - */ - public static function deploymentResourcePoolName( - $project, - $location, - $deploymentResourcePool - ) { - return self::getDeploymentResourcePoolNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'deployment_resource_pool' => $deploymentResourcePool, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - deploymentResourcePool: projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - * - location: projects/{project}/locations/{location} - * - project: projects/{project} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Create a DeploymentResourcePool. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * $formattedParent = $deploymentResourcePoolServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $deploymentResourcePool = new DeploymentResourcePool(); - * $deploymentResourcePoolId = 'deployment_resource_pool_id'; - * $operationResponse = $deploymentResourcePoolServiceClient->createDeploymentResourcePool($formattedParent, $deploymentResourcePool, $deploymentResourcePoolId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $deploymentResourcePoolServiceClient->createDeploymentResourcePool($formattedParent, $deploymentResourcePool, $deploymentResourcePoolId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $deploymentResourcePoolServiceClient->resumeOperation($operationName, 'createDeploymentResourcePool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent location resource where this DeploymentResourcePool - * will be created. Format: `projects/{project}/locations/{location}` - * @param DeploymentResourcePool $deploymentResourcePool Required. The DeploymentResourcePool to create. - * @param string $deploymentResourcePoolId Required. The ID to use for the DeploymentResourcePool, which - * will become the final component of the DeploymentResourcePool's resource - * name. - * - * The maximum length is 63 characters, and valid characters - * are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDeploymentResourcePool( - $parent, - $deploymentResourcePool, - $deploymentResourcePoolId, - array $optionalArgs = [] - ) { - $request = new CreateDeploymentResourcePoolRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDeploymentResourcePool($deploymentResourcePool); - $request->setDeploymentResourcePoolId($deploymentResourcePoolId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateDeploymentResourcePool', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Delete a DeploymentResourcePool. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * $formattedName = $deploymentResourcePoolServiceClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - * $operationResponse = $deploymentResourcePoolServiceClient->deleteDeploymentResourcePool($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $deploymentResourcePoolServiceClient->deleteDeploymentResourcePool($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $deploymentResourcePoolServiceClient->resumeOperation($operationName, 'deleteDeploymentResourcePool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the DeploymentResourcePool to delete. - * Format: - * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDeploymentResourcePool( - $name, - array $optionalArgs = [] - ) { - $request = new DeleteDeploymentResourcePoolRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDeploymentResourcePool', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Get a DeploymentResourcePool. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * $formattedName = $deploymentResourcePoolServiceClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - * $response = $deploymentResourcePoolServiceClient->getDeploymentResourcePool($formattedName); - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the DeploymentResourcePool to retrieve. - * Format: - * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\DeploymentResourcePool - * - * @throws ApiException if the remote call fails - */ - public function getDeploymentResourcePool($name, array $optionalArgs = []) - { - $request = new GetDeploymentResourcePoolRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDeploymentResourcePool', - DeploymentResourcePool::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * List DeploymentResourcePools in a location. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * $formattedParent = $deploymentResourcePoolServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $deploymentResourcePoolServiceClient->listDeploymentResourcePools($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $deploymentResourcePoolServiceClient->listDeploymentResourcePools($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent Location which owns this collection of - * DeploymentResourcePools. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDeploymentResourcePools( - $parent, - array $optionalArgs = [] - ) { - $request = new ListDeploymentResourcePoolsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDeploymentResourcePools', - $optionalArgs, - ListDeploymentResourcePoolsResponse::class, - $request - ); - } - - /** - * List DeployedModels that have been deployed on this DeploymentResourcePool. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * $deploymentResourcePool = 'deployment_resource_pool'; - * // Iterate over pages of elements - * $pagedResponse = $deploymentResourcePoolServiceClient->queryDeployedModels($deploymentResourcePool); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $deploymentResourcePoolServiceClient->queryDeployedModels($deploymentResourcePool); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param string $deploymentResourcePool Required. The name of the target DeploymentResourcePool to query. - * Format: - * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function queryDeployedModels( - $deploymentResourcePool, - array $optionalArgs = [] - ) { - $request = new QueryDeployedModelsRequest(); - $requestParamHeaders = []; - $request->setDeploymentResourcePool($deploymentResourcePool); - $requestParamHeaders[ - 'deployment_resource_pool' - ] = $deploymentResourcePool; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'QueryDeployedModels', - $optionalArgs, - QueryDeployedModelsResponse::class, - $request - ); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * $response = $deploymentResourcePoolServiceClient->getLocation(); - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $deploymentResourcePoolServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $deploymentResourcePoolServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * $resource = 'resource'; - * $response = $deploymentResourcePoolServiceClient->getIamPolicy($resource); - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $deploymentResourcePoolServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $deploymentResourcePoolServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $deploymentResourcePoolServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/EndpointServiceGapicClient.php b/AiPlatform/src/V1/Gapic/EndpointServiceGapicClient.php deleted file mode 100644 index 969ccd96c01f..000000000000 --- a/AiPlatform/src/V1/Gapic/EndpointServiceGapicClient.php +++ /dev/null @@ -1,1631 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $endpoint = new Endpoint(); - * $operationResponse = $endpointServiceClient->createEndpoint($formattedParent, $endpoint); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $endpointServiceClient->createEndpoint($formattedParent, $endpoint); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $endpointServiceClient->resumeOperation($operationName, 'createEndpoint'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\EndpointServiceClient}. - */ -class EndpointServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.EndpointService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $deploymentResourcePoolNameTemplate; - - private static $endpointNameTemplate; - - private static $locationNameTemplate; - - private static $modelNameTemplate; - - private static $modelDeploymentMonitoringJobNameTemplate; - - private static $networkNameTemplate; - - private static $projectLocationEndpointNameTemplate; - - private static $projectLocationPublisherModelNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/endpoint_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/endpoint_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/endpoint_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/endpoint_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getDeploymentResourcePoolNameTemplate() - { - if (self::$deploymentResourcePoolNameTemplate == null) { - self::$deploymentResourcePoolNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ); - } - - return self::$deploymentResourcePoolNameTemplate; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$endpointNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getModelNameTemplate() - { - if (self::$modelNameTemplate == null) { - self::$modelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ); - } - - return self::$modelNameTemplate; - } - - private static function getModelDeploymentMonitoringJobNameTemplate() - { - if (self::$modelDeploymentMonitoringJobNameTemplate == null) { - self::$modelDeploymentMonitoringJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ); - } - - return self::$modelDeploymentMonitoringJobNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate( - 'projects/{project}/global/networks/{network}' - ); - } - - return self::$networkNameTemplate; - } - - private static function getProjectLocationEndpointNameTemplate() - { - if (self::$projectLocationEndpointNameTemplate == null) { - self::$projectLocationEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$projectLocationEndpointNameTemplate; - } - - private static function getProjectLocationPublisherModelNameTemplate() - { - if (self::$projectLocationPublisherModelNameTemplate == null) { - self::$projectLocationPublisherModelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ); - } - - return self::$projectLocationPublisherModelNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'deploymentResourcePool' => self::getDeploymentResourcePoolNameTemplate(), - 'endpoint' => self::getEndpointNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'model' => self::getModelNameTemplate(), - 'modelDeploymentMonitoringJob' => self::getModelDeploymentMonitoringJobNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'projectLocationEndpoint' => self::getProjectLocationEndpointNameTemplate(), - 'projectLocationPublisherModel' => self::getProjectLocationPublisherModelNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * deployment_resource_pool resource. - * - * @param string $project - * @param string $location - * @param string $deploymentResourcePool - * - * @return string The formatted deployment_resource_pool resource. - */ - public static function deploymentResourcePoolName( - $project, - $location, - $deploymentResourcePool - ) { - return self::getDeploymentResourcePoolNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'deployment_resource_pool' => $deploymentResourcePool, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName($project, $location, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName($project, $location, $model) - { - return self::getModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * model_deployment_monitoring_job resource. - * - * @param string $project - * @param string $location - * @param string $modelDeploymentMonitoringJob - * - * @return string The formatted model_deployment_monitoring_job resource. - */ - public static function modelDeploymentMonitoringJobName( - $project, - $location, - $modelDeploymentMonitoringJob - ) { - return self::getModelDeploymentMonitoringJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model_deployment_monitoring_job' => $modelDeploymentMonitoringJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted project_location_endpoint resource. - */ - public static function projectLocationEndpointName( - $project, - $location, - $endpoint - ) { - return self::getProjectLocationEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_publisher_model resource. - * - * @param string $project - * @param string $location - * @param string $publisher - * @param string $model - * - * @return string The formatted project_location_publisher_model resource. - */ - public static function projectLocationPublisherModelName( - $project, - $location, - $publisher, - $model - ) { - return self::getProjectLocationPublisherModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'publisher' => $publisher, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - deploymentResourcePool: projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - * - endpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - location: projects/{project}/locations/{location} - * - model: projects/{project}/locations/{location}/models/{model} - * - modelDeploymentMonitoringJob: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job} - * - network: projects/{project}/global/networks/{network} - * - projectLocationEndpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - projectLocationPublisherModel: projects/{project}/locations/{location}/publishers/{publisher}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates an Endpoint. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $formattedParent = $endpointServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $endpoint = new Endpoint(); - * $operationResponse = $endpointServiceClient->createEndpoint($formattedParent, $endpoint); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $endpointServiceClient->createEndpoint($formattedParent, $endpoint); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $endpointServiceClient->resumeOperation($operationName, 'createEndpoint'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the Endpoint in. - * Format: `projects/{project}/locations/{location}` - * @param Endpoint $endpoint Required. The Endpoint to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $endpointId - * Immutable. The ID to use for endpoint, which will become the final - * component of the endpoint resource name. - * If not provided, Vertex AI will generate a value for this ID. - * - * If the first character is a letter, this value may be up to 63 characters, - * and valid characters are `[a-z0-9-]`. The last character must be a letter - * or number. - * - * If the first character is a number, this value may be up to 9 characters, - * and valid characters are `[0-9]` with no leading zeros. - * - * When using HTTP/JSON, this field is populated - * based on a query string argument, such as `?endpoint_id=12345`. This is the - * fallback for fields that are not included in either the URI or the body. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createEndpoint($parent, $endpoint, array $optionalArgs = []) - { - $request = new CreateEndpointRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEndpoint($endpoint); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['endpointId'])) { - $request->setEndpointId($optionalArgs['endpointId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateEndpoint', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes an Endpoint. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $formattedName = $endpointServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $operationResponse = $endpointServiceClient->deleteEndpoint($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $endpointServiceClient->deleteEndpoint($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $endpointServiceClient->resumeOperation($operationName, 'deleteEndpoint'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Endpoint resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteEndpoint($name, array $optionalArgs = []) - { - $request = new DeleteEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteEndpoint', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deploys a Model into this Endpoint, creating a DeployedModel within it. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $formattedEndpoint = $endpointServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $deployedModel = new DeployedModel(); - * $operationResponse = $endpointServiceClient->deployModel($formattedEndpoint, $deployedModel); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $endpointServiceClient->deployModel($formattedEndpoint, $deployedModel); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $endpointServiceClient->resumeOperation($operationName, 'deployModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint resource into which to deploy a Model. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param DeployedModel $deployedModel Required. The DeployedModel to be created within the Endpoint. Note that - * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] - * must be updated for the DeployedModel to start receiving traffic, either as - * part of this call, or via - * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint]. - * @param array $optionalArgs { - * Optional. - * - * @type array $trafficSplit - * A map from a DeployedModel's ID to the percentage of this Endpoint's - * traffic that should be forwarded to that DeployedModel. - * - * If this field is non-empty, then the Endpoint's - * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be - * overwritten with it. To refer to the ID of the just being deployed Model, a - * "0" should be used, and the actual ID of the new DeployedModel will be - * filled in its place by this method. The traffic percentage values must add - * up to 100. - * - * If this field is empty, then the Endpoint's - * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not - * updated. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deployModel( - $endpoint, - $deployedModel, - array $optionalArgs = [] - ) { - $request = new DeployModelRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setDeployedModel($deployedModel); - $requestParamHeaders['endpoint'] = $endpoint; - if (isset($optionalArgs['trafficSplit'])) { - $request->setTrafficSplit($optionalArgs['trafficSplit']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeployModel', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets an Endpoint. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $formattedName = $endpointServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $response = $endpointServiceClient->getEndpoint($formattedName); - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Endpoint resource. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Endpoint - * - * @throws ApiException if the remote call fails - */ - public function getEndpoint($name, array $optionalArgs = []) - { - $request = new GetEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetEndpoint', - Endpoint::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists Endpoints in a Location. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $formattedParent = $endpointServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $endpointServiceClient->listEndpoints($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $endpointServiceClient->listEndpoints($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location from which to list the - * Endpoints. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. An expression for filtering the results of the request. For field - * names both snake_case and camelCase are supported. - * - * * `endpoint` supports `=` and `!=`. `endpoint` represents the Endpoint - * ID, i.e. the last segment of the Endpoint's - * [resource name][google.cloud.aiplatform.v1.Endpoint.name]. - * * `display_name` supports `=` and `!=`. - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:*` or `labels:key` - key existence - * * A key including a space must be quoted. `labels."a key"`. - * * `base_model_name` only supports `=`. - * - * Some examples: - * - * * `endpoint=1` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * * `baseModelName="text-bison"` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Optional. Mask specifying which fields to read. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEndpoints($parent, array $optionalArgs = []) - { - $request = new ListEndpointsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListEndpoints', - $optionalArgs, - ListEndpointsResponse::class, - $request - ); - } - - /** - * Updates an existing deployed model. Updatable fields include - * `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, - * `disable_container_logging` (v1 only), and `enable_container_logging` - * (v1beta1 only). - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $formattedEndpoint = $endpointServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $deployedModel = new DeployedModel(); - * $updateMask = new FieldMask(); - * $operationResponse = $endpointServiceClient->mutateDeployedModel($formattedEndpoint, $deployedModel, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $endpointServiceClient->mutateDeployedModel($formattedEndpoint, $deployedModel, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $endpointServiceClient->resumeOperation($operationName, 'mutateDeployedModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint resource into which to mutate a - * DeployedModel. Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param DeployedModel $deployedModel Required. The DeployedModel to be mutated within the Endpoint. Only the - * following fields can be mutated: - * - * * `min_replica_count` in either - * [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or - * [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] - * * `max_replica_count` in either - * [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or - * [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] - * * [autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs] - * * `disable_container_logging` (v1 only) - * * `enable_container_logging` (v1beta1 only) - * @param FieldMask $updateMask Required. The update mask applies to the resource. See - * [google.protobuf.FieldMask][google.protobuf.FieldMask]. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function mutateDeployedModel( - $endpoint, - $deployedModel, - $updateMask, - array $optionalArgs = [] - ) { - $request = new MutateDeployedModelRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setDeployedModel($deployedModel); - $request->setUpdateMask($updateMask); - $requestParamHeaders['endpoint'] = $endpoint; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'MutateDeployedModel', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and - * freeing all resources it's using. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $formattedEndpoint = $endpointServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $deployedModelId = 'deployed_model_id'; - * $operationResponse = $endpointServiceClient->undeployModel($formattedEndpoint, $deployedModelId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $endpointServiceClient->undeployModel($formattedEndpoint, $deployedModelId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $endpointServiceClient->resumeOperation($operationName, 'undeployModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint resource from which to undeploy a Model. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param string $deployedModelId Required. The ID of the DeployedModel to be undeployed from the Endpoint. - * @param array $optionalArgs { - * Optional. - * - * @type array $trafficSplit - * If this field is provided, then the Endpoint's - * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be - * overwritten with it. If last DeployedModel is being undeployed from the - * Endpoint, the [Endpoint.traffic_split] will always end up empty when this - * call returns. A DeployedModel will be successfully undeployed only if it - * doesn't have any traffic assigned to it when this method executes, or if - * this field unassigns any traffic to it. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function undeployModel( - $endpoint, - $deployedModelId, - array $optionalArgs = [] - ) { - $request = new UndeployModelRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setDeployedModelId($deployedModelId); - $requestParamHeaders['endpoint'] = $endpoint; - if (isset($optionalArgs['trafficSplit'])) { - $request->setTrafficSplit($optionalArgs['trafficSplit']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UndeployModel', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates an Endpoint. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $endpoint = new Endpoint(); - * $updateMask = new FieldMask(); - * $response = $endpointServiceClient->updateEndpoint($endpoint, $updateMask); - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param Endpoint $endpoint Required. The Endpoint which replaces the resource on the server. - * @param FieldMask $updateMask Required. The update mask applies to the resource. See - * [google.protobuf.FieldMask][google.protobuf.FieldMask]. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Endpoint - * - * @throws ApiException if the remote call fails - */ - public function updateEndpoint( - $endpoint, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateEndpointRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setUpdateMask($updateMask); - $requestParamHeaders['endpoint.name'] = $endpoint->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateEndpoint', - Endpoint::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $response = $endpointServiceClient->getLocation(); - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $endpointServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $endpointServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $resource = 'resource'; - * $response = $endpointServiceClient->getIamPolicy($resource); - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $endpointServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $endpointServiceClient = new EndpointServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $endpointServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $endpointServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/FeatureOnlineStoreAdminServiceGapicClient.php b/AiPlatform/src/V1/Gapic/FeatureOnlineStoreAdminServiceGapicClient.php deleted file mode 100644 index 82b4e2a57e97..000000000000 --- a/AiPlatform/src/V1/Gapic/FeatureOnlineStoreAdminServiceGapicClient.php +++ /dev/null @@ -1,1884 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $featureOnlineStore = new FeatureOnlineStore(); - * $featureOnlineStoreId = 'feature_online_store_id'; - * $operationResponse = $featureOnlineStoreAdminServiceClient->createFeatureOnlineStore($formattedParent, $featureOnlineStore, $featureOnlineStoreId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureOnlineStoreAdminServiceClient->createFeatureOnlineStore($formattedParent, $featureOnlineStore, $featureOnlineStoreId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureOnlineStoreAdminServiceClient->resumeOperation($operationName, 'createFeatureOnlineStore'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\FeatureOnlineStoreAdminServiceClient}. - */ -class FeatureOnlineStoreAdminServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $featureOnlineStoreNameTemplate; - - private static $featureViewNameTemplate; - - private static $featureViewSyncNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/feature_online_store_admin_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/feature_online_store_admin_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/feature_online_store_admin_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/feature_online_store_admin_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getFeatureOnlineStoreNameTemplate() - { - if (self::$featureOnlineStoreNameTemplate == null) { - self::$featureOnlineStoreNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}' - ); - } - - return self::$featureOnlineStoreNameTemplate; - } - - private static function getFeatureViewNameTemplate() - { - if (self::$featureViewNameTemplate == null) { - self::$featureViewNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}' - ); - } - - return self::$featureViewNameTemplate; - } - - private static function getFeatureViewSyncNameTemplate() - { - if (self::$featureViewSyncNameTemplate == null) { - self::$featureViewSyncNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_sync' - ); - } - - return self::$featureViewSyncNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'featureOnlineStore' => self::getFeatureOnlineStoreNameTemplate(), - 'featureView' => self::getFeatureViewNameTemplate(), - 'featureViewSync' => self::getFeatureViewSyncNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * feature_online_store resource. - * - * @param string $project - * @param string $location - * @param string $featureOnlineStore - * - * @return string The formatted feature_online_store resource. - */ - public static function featureOnlineStoreName( - $project, - $location, - $featureOnlineStore - ) { - return self::getFeatureOnlineStoreNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'feature_online_store' => $featureOnlineStore, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a feature_view - * resource. - * - * @param string $project - * @param string $location - * @param string $featureOnlineStore - * @param string $featureView - * - * @return string The formatted feature_view resource. - */ - public static function featureViewName( - $project, - $location, - $featureOnlineStore, - $featureView - ) { - return self::getFeatureViewNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'feature_online_store' => $featureOnlineStore, - 'feature_view' => $featureView, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * feature_view_sync resource. - * - * @param string $project - * @param string $location - * @param string $featureOnlineStore - * @param string $featureView - * - * @return string The formatted feature_view_sync resource. - */ - public static function featureViewSyncName( - $project, - $location, - $featureOnlineStore, - $featureView - ) { - return self::getFeatureViewSyncNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'feature_online_store' => $featureOnlineStore, - 'feature_view' => $featureView, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - featureOnlineStore: projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store} - * - featureView: projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view} - * - featureViewSync: projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_sync - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a new FeatureOnlineStore in a given project and location. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedParent = $featureOnlineStoreAdminServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $featureOnlineStore = new FeatureOnlineStore(); - * $featureOnlineStoreId = 'feature_online_store_id'; - * $operationResponse = $featureOnlineStoreAdminServiceClient->createFeatureOnlineStore($formattedParent, $featureOnlineStore, $featureOnlineStoreId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureOnlineStoreAdminServiceClient->createFeatureOnlineStore($formattedParent, $featureOnlineStore, $featureOnlineStoreId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureOnlineStoreAdminServiceClient->resumeOperation($operationName, 'createFeatureOnlineStore'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create FeatureOnlineStores. - * Format: - * `projects/{project}/locations/{location}` - * @param FeatureOnlineStore $featureOnlineStore Required. The FeatureOnlineStore to create. - * @param string $featureOnlineStoreId Required. The ID to use for this FeatureOnlineStore, which will become the - * final component of the FeatureOnlineStore's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within the project and location. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createFeatureOnlineStore( - $parent, - $featureOnlineStore, - $featureOnlineStoreId, - array $optionalArgs = [] - ) { - $request = new CreateFeatureOnlineStoreRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFeatureOnlineStore($featureOnlineStore); - $request->setFeatureOnlineStoreId($featureOnlineStoreId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateFeatureOnlineStore', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new FeatureView in a given FeatureOnlineStore. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedParent = $featureOnlineStoreAdminServiceClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - * $featureView = new FeatureView(); - * $featureViewId = 'feature_view_id'; - * $operationResponse = $featureOnlineStoreAdminServiceClient->createFeatureView($formattedParent, $featureView, $featureViewId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureOnlineStoreAdminServiceClient->createFeatureView($formattedParent, $featureView, $featureViewId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureOnlineStoreAdminServiceClient->resumeOperation($operationName, 'createFeatureView'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the FeatureOnlineStore to create - * FeatureViews. Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` - * @param FeatureView $featureView Required. The FeatureView to create. - * @param string $featureViewId Required. The ID to use for the FeatureView, which will become the final - * component of the FeatureView's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within a FeatureOnlineStore. - * @param array $optionalArgs { - * Optional. - * - * @type bool $runSyncImmediately - * Immutable. If set to true, one on demand sync will be run immediately, - * regardless whether the - * [FeatureView.sync_config][google.cloud.aiplatform.v1.FeatureView.sync_config] - * is configured or not. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createFeatureView( - $parent, - $featureView, - $featureViewId, - array $optionalArgs = [] - ) { - $request = new CreateFeatureViewRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFeatureView($featureView); - $request->setFeatureViewId($featureViewId); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['runSyncImmediately'])) { - $request->setRunSyncImmediately( - $optionalArgs['runSyncImmediately'] - ); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateFeatureView', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single FeatureOnlineStore. The FeatureOnlineStore must not - * contain any FeatureViews. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedName = $featureOnlineStoreAdminServiceClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - * $operationResponse = $featureOnlineStoreAdminServiceClient->deleteFeatureOnlineStore($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureOnlineStoreAdminServiceClient->deleteFeatureOnlineStore($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureOnlineStoreAdminServiceClient->resumeOperation($operationName, 'deleteFeatureOnlineStore'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the FeatureOnlineStore to be deleted. - * Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * If set to true, any FeatureViews and Features for this FeatureOnlineStore - * will also be deleted. (Otherwise, the request will only work if the - * FeatureOnlineStore has no FeatureViews.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFeatureOnlineStore($name, array $optionalArgs = []) - { - $request = new DeleteFeatureOnlineStoreRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteFeatureOnlineStore', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single FeatureView. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedName = $featureOnlineStoreAdminServiceClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - * $operationResponse = $featureOnlineStoreAdminServiceClient->deleteFeatureView($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureOnlineStoreAdminServiceClient->deleteFeatureView($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureOnlineStoreAdminServiceClient->resumeOperation($operationName, 'deleteFeatureView'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the FeatureView to be deleted. - * Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFeatureView($name, array $optionalArgs = []) - { - $request = new DeleteFeatureViewRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteFeatureView', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets details of a single FeatureOnlineStore. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedName = $featureOnlineStoreAdminServiceClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - * $response = $featureOnlineStoreAdminServiceClient->getFeatureOnlineStore($formattedName); - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the FeatureOnlineStore resource. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\FeatureOnlineStore - * - * @throws ApiException if the remote call fails - */ - public function getFeatureOnlineStore($name, array $optionalArgs = []) - { - $request = new GetFeatureOnlineStoreRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetFeatureOnlineStore', - FeatureOnlineStore::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single FeatureView. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedName = $featureOnlineStoreAdminServiceClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - * $response = $featureOnlineStoreAdminServiceClient->getFeatureView($formattedName); - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the FeatureView resource. - * Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\FeatureView - * - * @throws ApiException if the remote call fails - */ - public function getFeatureView($name, array $optionalArgs = []) - { - $request = new GetFeatureViewRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetFeatureView', - FeatureView::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single FeatureViewSync. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedName = $featureOnlineStoreAdminServiceClient->featureViewSyncName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - * $response = $featureOnlineStoreAdminServiceClient->getFeatureViewSync($formattedName); - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the FeatureViewSync resource. - * Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/{feature_view_sync}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\FeatureViewSync - * - * @throws ApiException if the remote call fails - */ - public function getFeatureViewSync($name, array $optionalArgs = []) - { - $request = new GetFeatureViewSyncRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetFeatureViewSync', - FeatureViewSync::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists FeatureOnlineStores in a given project and location. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedParent = $featureOnlineStoreAdminServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $featureOnlineStoreAdminServiceClient->listFeatureOnlineStores($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featureOnlineStoreAdminServiceClient->listFeatureOnlineStores($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list FeatureOnlineStores. - * Format: - * `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the FeatureOnlineStores that match the filter expression. The - * following fields are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `labels`: Supports key-value equality and key presence. - * - * Examples: - * - * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - * FeatureOnlineStores created or updated after 2020-01-01. - * * `labels.env = "prod"` - * FeatureOnlineStores with label "env" set to "prod". - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported Fields: - * - * * `create_time` - * * `update_time` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listFeatureOnlineStores($parent, array $optionalArgs = []) - { - $request = new ListFeatureOnlineStoresRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListFeatureOnlineStores', - $optionalArgs, - ListFeatureOnlineStoresResponse::class, - $request - ); - } - - /** - * Lists FeatureViewSyncs in a given FeatureView. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedParent = $featureOnlineStoreAdminServiceClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - * // Iterate over pages of elements - * $pagedResponse = $featureOnlineStoreAdminServiceClient->listFeatureViewSyncs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featureOnlineStoreAdminServiceClient->listFeatureViewSyncs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the FeatureView to list FeatureViewSyncs. - * Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the FeatureViewSyncs that match the filter expression. The following - * filters are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * - * Examples: - * - * * `create_time > \"2020-01-31T15:30:00.000000Z\"` --> FeatureViewSyncs - * created after 2020-01-31T15:30:00.000000Z. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * - * Supported fields: - * - * * `create_time` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listFeatureViewSyncs($parent, array $optionalArgs = []) - { - $request = new ListFeatureViewSyncsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListFeatureViewSyncs', - $optionalArgs, - ListFeatureViewSyncsResponse::class, - $request - ); - } - - /** - * Lists FeatureViews in a given FeatureOnlineStore. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedParent = $featureOnlineStoreAdminServiceClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - * // Iterate over pages of elements - * $pagedResponse = $featureOnlineStoreAdminServiceClient->listFeatureViews($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featureOnlineStoreAdminServiceClient->listFeatureViews($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the FeatureOnlineStore to list FeatureViews. - * Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the FeatureViews that match the filter expression. The following - * filters are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> FeatureViews - * created or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> FeatureViews having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any FeatureView which has a label with 'env' as the - * key. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * - * Supported fields: - * - * * `feature_view_id` - * * `create_time` - * * `update_time` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listFeatureViews($parent, array $optionalArgs = []) - { - $request = new ListFeatureViewsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListFeatureViews', - $optionalArgs, - ListFeatureViewsResponse::class, - $request - ); - } - - /** - * Triggers on-demand sync for the FeatureView. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $formattedFeatureView = $featureOnlineStoreAdminServiceClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - * $response = $featureOnlineStoreAdminServiceClient->syncFeatureView($formattedFeatureView); - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $featureView Required. Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\SyncFeatureViewResponse - * - * @throws ApiException if the remote call fails - */ - public function syncFeatureView($featureView, array $optionalArgs = []) - { - $request = new SyncFeatureViewRequest(); - $requestParamHeaders = []; - $request->setFeatureView($featureView); - $requestParamHeaders['feature_view'] = $featureView; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SyncFeatureView', - SyncFeatureViewResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates the parameters of a single FeatureOnlineStore. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $featureOnlineStore = new FeatureOnlineStore(); - * $operationResponse = $featureOnlineStoreAdminServiceClient->updateFeatureOnlineStore($featureOnlineStore); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureOnlineStoreAdminServiceClient->updateFeatureOnlineStore($featureOnlineStore); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureOnlineStoreAdminServiceClient->resumeOperation($operationName, 'updateFeatureOnlineStore'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param FeatureOnlineStore $featureOnlineStore Required. The FeatureOnlineStore's `name` field is used to identify the - * FeatureOnlineStore to be updated. Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * FeatureOnlineStore resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `big_query_source` - * * `bigtable` - * * `labels` - * * `sync_config` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateFeatureOnlineStore( - $featureOnlineStore, - array $optionalArgs = [] - ) { - $request = new UpdateFeatureOnlineStoreRequest(); - $requestParamHeaders = []; - $request->setFeatureOnlineStore($featureOnlineStore); - $requestParamHeaders[ - 'feature_online_store.name' - ] = $featureOnlineStore->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateFeatureOnlineStore', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates the parameters of a single FeatureView. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $featureView = new FeatureView(); - * $operationResponse = $featureOnlineStoreAdminServiceClient->updateFeatureView($featureView); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureOnlineStoreAdminServiceClient->updateFeatureView($featureView); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureOnlineStoreAdminServiceClient->resumeOperation($operationName, 'updateFeatureView'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param FeatureView $featureView Required. The FeatureView's `name` field is used to identify the - * FeatureView to be updated. Format: - * `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * FeatureView resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `labels` - * * `serviceAgentType` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateFeatureView($featureView, array $optionalArgs = []) - { - $request = new UpdateFeatureViewRequest(); - $requestParamHeaders = []; - $request->setFeatureView($featureView); - $requestParamHeaders['feature_view.name'] = $featureView->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateFeatureView', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $response = $featureOnlineStoreAdminServiceClient->getLocation(); - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $featureOnlineStoreAdminServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featureOnlineStoreAdminServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $resource = 'resource'; - * $response = $featureOnlineStoreAdminServiceClient->getIamPolicy($resource); - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $featureOnlineStoreAdminServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $featureOnlineStoreAdminServiceClient = new FeatureOnlineStoreAdminServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $featureOnlineStoreAdminServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $featureOnlineStoreAdminServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/FeatureOnlineStoreServiceGapicClient.php b/AiPlatform/src/V1/Gapic/FeatureOnlineStoreServiceGapicClient.php deleted file mode 100644 index 3829ec5a3fdd..000000000000 --- a/AiPlatform/src/V1/Gapic/FeatureOnlineStoreServiceGapicClient.php +++ /dev/null @@ -1,756 +0,0 @@ -featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - * $response = $featureOnlineStoreServiceClient->fetchFeatureValues($formattedFeatureView); - * } finally { - * $featureOnlineStoreServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\FeatureOnlineStoreServiceClient}. - */ -class FeatureOnlineStoreServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.FeatureOnlineStoreService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $featureViewNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/feature_online_store_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/feature_online_store_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/feature_online_store_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/feature_online_store_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getFeatureViewNameTemplate() - { - if (self::$featureViewNameTemplate == null) { - self::$featureViewNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}' - ); - } - - return self::$featureViewNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'featureView' => self::getFeatureViewNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a feature_view - * resource. - * - * @param string $project - * @param string $location - * @param string $featureOnlineStore - * @param string $featureView - * - * @return string The formatted feature_view resource. - */ - public static function featureViewName( - $project, - $location, - $featureOnlineStore, - $featureView - ) { - return self::getFeatureViewNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'feature_online_store' => $featureOnlineStore, - 'feature_view' => $featureView, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - featureView: projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Fetch feature values under a FeatureView. - * - * Sample code: - * ``` - * $featureOnlineStoreServiceClient = new FeatureOnlineStoreServiceClient(); - * try { - * $formattedFeatureView = $featureOnlineStoreServiceClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - * $response = $featureOnlineStoreServiceClient->fetchFeatureValues($formattedFeatureView); - * } finally { - * $featureOnlineStoreServiceClient->close(); - * } - * ``` - * - * @param string $featureView Required. FeatureView resource format - * `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}` - * @param array $optionalArgs { - * Optional. - * - * @type FeatureViewDataKey $dataKey - * Optional. The request key to fetch feature values for. - * @type int $dataFormat - * Optional. Response data format. If not set, - * [FeatureViewDataFormat.KEY_VALUE][google.cloud.aiplatform.v1.FeatureViewDataFormat.KEY_VALUE] - * will be used. - * For allowed values, use constants defined on {@see \Google\Cloud\AIPlatform\V1\FeatureViewDataFormat} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchFeatureValues($featureView, array $optionalArgs = []) - { - $request = new FetchFeatureValuesRequest(); - $requestParamHeaders = []; - $request->setFeatureView($featureView); - $requestParamHeaders['feature_view'] = $featureView; - if (isset($optionalArgs['dataKey'])) { - $request->setDataKey($optionalArgs['dataKey']); - } - - if (isset($optionalArgs['dataFormat'])) { - $request->setDataFormat($optionalArgs['dataFormat']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'FetchFeatureValues', - FetchFeatureValuesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Search the nearest entities under a FeatureView. - * Search only works for indexable feature view; if a feature view isn't - * indexable, returns Invalid argument response. - * - * Sample code: - * ``` - * $featureOnlineStoreServiceClient = new FeatureOnlineStoreServiceClient(); - * try { - * $formattedFeatureView = $featureOnlineStoreServiceClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - * $query = new NearestNeighborQuery(); - * $response = $featureOnlineStoreServiceClient->searchNearestEntities($formattedFeatureView, $query); - * } finally { - * $featureOnlineStoreServiceClient->close(); - * } - * ``` - * - * @param string $featureView Required. FeatureView resource format - * `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}` - * @param NearestNeighborQuery $query Required. The query. - * @param array $optionalArgs { - * Optional. - * - * @type bool $returnFullEntity - * Optional. If set to true, the full entities (including all vector values - * and metadata) of the nearest neighbors are returned; otherwise only entity - * id of the nearest neighbors will be returned. Note that returning full - * entities will significantly increase the latency and cost of the query. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\SearchNearestEntitiesResponse - * - * @throws ApiException if the remote call fails - */ - public function searchNearestEntities( - $featureView, - $query, - array $optionalArgs = [] - ) { - $request = new SearchNearestEntitiesRequest(); - $requestParamHeaders = []; - $request->setFeatureView($featureView); - $request->setQuery($query); - $requestParamHeaders['feature_view'] = $featureView; - if (isset($optionalArgs['returnFullEntity'])) { - $request->setReturnFullEntity($optionalArgs['returnFullEntity']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SearchNearestEntities', - SearchNearestEntitiesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $featureOnlineStoreServiceClient = new FeatureOnlineStoreServiceClient(); - * try { - * $response = $featureOnlineStoreServiceClient->getLocation(); - * } finally { - * $featureOnlineStoreServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $featureOnlineStoreServiceClient = new FeatureOnlineStoreServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $featureOnlineStoreServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featureOnlineStoreServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featureOnlineStoreServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $featureOnlineStoreServiceClient = new FeatureOnlineStoreServiceClient(); - * try { - * $resource = 'resource'; - * $response = $featureOnlineStoreServiceClient->getIamPolicy($resource); - * } finally { - * $featureOnlineStoreServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $featureOnlineStoreServiceClient = new FeatureOnlineStoreServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $featureOnlineStoreServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $featureOnlineStoreServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $featureOnlineStoreServiceClient = new FeatureOnlineStoreServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $featureOnlineStoreServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $featureOnlineStoreServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/FeatureRegistryServiceGapicClient.php b/AiPlatform/src/V1/Gapic/FeatureRegistryServiceGapicClient.php deleted file mode 100644 index 52b1cd3fd74f..000000000000 --- a/AiPlatform/src/V1/Gapic/FeatureRegistryServiceGapicClient.php +++ /dev/null @@ -1,1775 +0,0 @@ -entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $feature = new Feature(); - * $featureId = 'feature_id'; - * $operationResponse = $featureRegistryServiceClient->createFeature($formattedParent, $feature, $featureId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureRegistryServiceClient->createFeature($formattedParent, $feature, $featureId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureRegistryServiceClient->resumeOperation($operationName, 'createFeature'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\FeatureRegistryServiceClient}. - */ -class FeatureRegistryServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.FeatureRegistryService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $entityTypeNameTemplate; - - private static $featureNameTemplate; - - private static $featureGroupNameTemplate; - - private static $locationNameTemplate; - - private static $projectLocationFeatureGroupFeatureNameTemplate; - - private static $projectLocationFeaturestoreEntityTypeFeatureNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/feature_registry_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/feature_registry_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/feature_registry_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/feature_registry_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEntityTypeNameTemplate() - { - if (self::$entityTypeNameTemplate == null) { - self::$entityTypeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ); - } - - return self::$entityTypeNameTemplate; - } - - private static function getFeatureNameTemplate() - { - if (self::$featureNameTemplate == null) { - self::$featureNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ); - } - - return self::$featureNameTemplate; - } - - private static function getFeatureGroupNameTemplate() - { - if (self::$featureGroupNameTemplate == null) { - self::$featureGroupNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featureGroups/{feature_group}' - ); - } - - return self::$featureGroupNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getProjectLocationFeatureGroupFeatureNameTemplate() - { - if (self::$projectLocationFeatureGroupFeatureNameTemplate == null) { - self::$projectLocationFeatureGroupFeatureNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}' - ); - } - - return self::$projectLocationFeatureGroupFeatureNameTemplate; - } - - private static function getProjectLocationFeaturestoreEntityTypeFeatureNameTemplate() - { - if ( - self::$projectLocationFeaturestoreEntityTypeFeatureNameTemplate == - null - ) { - self::$projectLocationFeaturestoreEntityTypeFeatureNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ); - } - - return self::$projectLocationFeaturestoreEntityTypeFeatureNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'entityType' => self::getEntityTypeNameTemplate(), - 'feature' => self::getFeatureNameTemplate(), - 'featureGroup' => self::getFeatureGroupNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'projectLocationFeatureGroupFeature' => self::getProjectLocationFeatureGroupFeatureNameTemplate(), - 'projectLocationFeaturestoreEntityTypeFeature' => self::getProjectLocationFeaturestoreEntityTypeFeatureNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a entity_type - * resource. - * - * @param string $project - * @param string $location - * @param string $featurestore - * @param string $entityType - * - * @return string The formatted entity_type resource. - */ - public static function entityTypeName( - $project, - $location, - $featurestore, - $entityType - ) { - return self::getEntityTypeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'featurestore' => $featurestore, - 'entity_type' => $entityType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a feature - * resource. - * - * @param string $project - * @param string $location - * @param string $featurestore - * @param string $entityType - * @param string $feature - * - * @return string The formatted feature resource. - */ - public static function featureName( - $project, - $location, - $featurestore, - $entityType, - $feature - ) { - return self::getFeatureNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'featurestore' => $featurestore, - 'entity_type' => $entityType, - 'feature' => $feature, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * feature_group resource. - * - * @param string $project - * @param string $location - * @param string $featureGroup - * - * @return string The formatted feature_group resource. - */ - public static function featureGroupName($project, $location, $featureGroup) - { - return self::getFeatureGroupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'feature_group' => $featureGroup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_feature_group_feature resource. - * - * @param string $project - * @param string $location - * @param string $featureGroup - * @param string $feature - * - * @return string The formatted project_location_feature_group_feature resource. - */ - public static function projectLocationFeatureGroupFeatureName( - $project, - $location, - $featureGroup, - $feature - ) { - return self::getProjectLocationFeatureGroupFeatureNameTemplate()->render( - [ - 'project' => $project, - 'location' => $location, - 'feature_group' => $featureGroup, - 'feature' => $feature, - ] - ); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_featurestore_entity_type_feature resource. - * - * @param string $project - * @param string $location - * @param string $featurestore - * @param string $entityType - * @param string $feature - * - * @return string The formatted project_location_featurestore_entity_type_feature resource. - */ - public static function projectLocationFeaturestoreEntityTypeFeatureName( - $project, - $location, - $featurestore, - $entityType, - $feature - ) { - return self::getProjectLocationFeaturestoreEntityTypeFeatureNameTemplate()->render( - [ - 'project' => $project, - 'location' => $location, - 'featurestore' => $featurestore, - 'entity_type' => $entityType, - 'feature' => $feature, - ] - ); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - entityType: projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type} - * - feature: projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature} - * - featureGroup: projects/{project}/locations/{location}/featureGroups/{feature_group} - * - location: projects/{project}/locations/{location} - * - projectLocationFeatureGroupFeature: projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature} - * - projectLocationFeaturestoreEntityTypeFeature: projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a new Feature in a given FeatureGroup. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $formattedParent = $featureRegistryServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $feature = new Feature(); - * $featureId = 'feature_id'; - * $operationResponse = $featureRegistryServiceClient->createFeature($formattedParent, $feature, $featureId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureRegistryServiceClient->createFeature($formattedParent, $feature, $featureId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureRegistryServiceClient->resumeOperation($operationName, 'createFeature'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the EntityType or FeatureGroup to create a - * Feature. Format for entity_type as parent: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * Format for feature_group as parent: - * `projects/{project}/locations/{location}/featureGroups/{feature_group}` - * @param Feature $feature Required. The Feature to create. - * @param string $featureId Required. The ID to use for the Feature, which will become the final - * component of the Feature's resource name. - * - * This value may be up to 128 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within an EntityType/FeatureGroup. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createFeature( - $parent, - $feature, - $featureId, - array $optionalArgs = [] - ) { - $request = new CreateFeatureRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFeature($feature); - $request->setFeatureId($featureId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateFeature', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new FeatureGroup in a given project and location. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $formattedParent = $featureRegistryServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $featureGroup = new FeatureGroup(); - * $featureGroupId = 'feature_group_id'; - * $operationResponse = $featureRegistryServiceClient->createFeatureGroup($formattedParent, $featureGroup, $featureGroupId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureRegistryServiceClient->createFeatureGroup($formattedParent, $featureGroup, $featureGroupId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureRegistryServiceClient->resumeOperation($operationName, 'createFeatureGroup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create FeatureGroups. - * Format: - * `projects/{project}/locations/{location}'` - * @param FeatureGroup $featureGroup Required. The FeatureGroup to create. - * @param string $featureGroupId Required. The ID to use for this FeatureGroup, which will become the final - * component of the FeatureGroup's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within the project and location. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createFeatureGroup( - $parent, - $featureGroup, - $featureGroupId, - array $optionalArgs = [] - ) { - $request = new CreateFeatureGroupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFeatureGroup($featureGroup); - $request->setFeatureGroupId($featureGroupId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateFeatureGroup', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Feature. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $formattedName = $featureRegistryServiceClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - * $operationResponse = $featureRegistryServiceClient->deleteFeature($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureRegistryServiceClient->deleteFeature($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureRegistryServiceClient->resumeOperation($operationName, 'deleteFeature'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Features to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - * `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFeature($name, array $optionalArgs = []) - { - $request = new DeleteFeatureRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteFeature', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single FeatureGroup. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $formattedName = $featureRegistryServiceClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - * $operationResponse = $featureRegistryServiceClient->deleteFeatureGroup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureRegistryServiceClient->deleteFeatureGroup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureRegistryServiceClient->resumeOperation($operationName, 'deleteFeatureGroup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the FeatureGroup to be deleted. - * Format: - * `projects/{project}/locations/{location}/featureGroups/{feature_group}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * If set to true, any Features under this FeatureGroup - * will also be deleted. (Otherwise, the request will only work if the - * FeatureGroup has no Features.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFeatureGroup($name, array $optionalArgs = []) - { - $request = new DeleteFeatureGroupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteFeatureGroup', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets details of a single Feature. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $formattedName = $featureRegistryServiceClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - * $response = $featureRegistryServiceClient->getFeature($formattedName); - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Feature resource. - * Format for entity_type as parent: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * Format for feature_group as parent: - * `projects/{project}/locations/{location}/featureGroups/{feature_group}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Feature - * - * @throws ApiException if the remote call fails - */ - public function getFeature($name, array $optionalArgs = []) - { - $request = new GetFeatureRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetFeature', - Feature::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single FeatureGroup. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $formattedName = $featureRegistryServiceClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - * $response = $featureRegistryServiceClient->getFeatureGroup($formattedName); - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the FeatureGroup resource. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\FeatureGroup - * - * @throws ApiException if the remote call fails - */ - public function getFeatureGroup($name, array $optionalArgs = []) - { - $request = new GetFeatureGroupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetFeatureGroup', - FeatureGroup::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists FeatureGroups in a given project and location. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $formattedParent = $featureRegistryServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $featureRegistryServiceClient->listFeatureGroups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featureRegistryServiceClient->listFeatureGroups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list FeatureGroups. - * Format: - * `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the FeatureGroups that match the filter expression. The - * following fields are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `labels`: Supports key-value equality and key presence. - * - * Examples: - * - * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - * FeatureGroups created or updated after 2020-01-01. - * * `labels.env = "prod"` - * FeatureGroups with label "env" set to "prod". - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported Fields: - * - * * `create_time` - * * `update_time` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listFeatureGroups($parent, array $optionalArgs = []) - { - $request = new ListFeatureGroupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListFeatureGroups', - $optionalArgs, - ListFeatureGroupsResponse::class, - $request - ); - } - - /** - * Lists Features in a given FeatureGroup. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $formattedParent = $featureRegistryServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * // Iterate over pages of elements - * $pagedResponse = $featureRegistryServiceClient->listFeatures($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featureRegistryServiceClient->listFeatures($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list Features. - * Format for entity_type as parent: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * Format for feature_group as parent: - * `projects/{project}/locations/{location}/featureGroups/{feature_group}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the Features that match the filter expression. The following - * filters are supported: - * - * * `value_type`: Supports = and != comparisons. - * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with 'env' as the - * key. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `feature_id` - * * `value_type` (Not supported for FeatureRegistry Feature) - * * `create_time` - * * `update_time` - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type int $latestStatsCount - * Only applicable for Vertex AI Feature Store (Legacy). - * If set, return the most recent - * [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count] - * of stats for each Feature in response. Valid value is [0, 10]. If number of - * stats exists < - * [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count], - * return all existing stats. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listFeatures($parent, array $optionalArgs = []) - { - $request = new ListFeaturesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['latestStatsCount'])) { - $request->setLatestStatsCount($optionalArgs['latestStatsCount']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListFeatures', - $optionalArgs, - ListFeaturesResponse::class, - $request - ); - } - - /** - * Updates the parameters of a single Feature. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $feature = new Feature(); - * $operationResponse = $featureRegistryServiceClient->updateFeature($feature); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureRegistryServiceClient->updateFeature($feature); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureRegistryServiceClient->resumeOperation($operationName, 'updateFeature'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param Feature $feature Required. The Feature's `name` field is used to identify the Feature to be - * updated. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - * `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * Features resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `description` - * * `labels` - * * `disable_monitoring` (Not supported for FeatureRegistry Feature) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateFeature($feature, array $optionalArgs = []) - { - $request = new UpdateFeatureRequest(); - $requestParamHeaders = []; - $request->setFeature($feature); - $requestParamHeaders['feature.name'] = $feature->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateFeature', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates the parameters of a single FeatureGroup. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $featureGroup = new FeatureGroup(); - * $operationResponse = $featureRegistryServiceClient->updateFeatureGroup($featureGroup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featureRegistryServiceClient->updateFeatureGroup($featureGroup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featureRegistryServiceClient->resumeOperation($operationName, 'updateFeatureGroup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param FeatureGroup $featureGroup Required. The FeatureGroup's `name` field is used to identify the - * FeatureGroup to be updated. Format: - * `projects/{project}/locations/{location}/featureGroups/{feature_group}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * FeatureGroup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `labels` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateFeatureGroup($featureGroup, array $optionalArgs = []) - { - $request = new UpdateFeatureGroupRequest(); - $requestParamHeaders = []; - $request->setFeatureGroup($featureGroup); - $requestParamHeaders['feature_group.name'] = $featureGroup->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateFeatureGroup', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $response = $featureRegistryServiceClient->getLocation(); - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $featureRegistryServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featureRegistryServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $resource = 'resource'; - * $response = $featureRegistryServiceClient->getIamPolicy($resource); - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $featureRegistryServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $featureRegistryServiceClient = new FeatureRegistryServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $featureRegistryServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $featureRegistryServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/FeaturestoreOnlineServingServiceGapicClient.php b/AiPlatform/src/V1/Gapic/FeaturestoreOnlineServingServiceGapicClient.php deleted file mode 100644 index 32d62778a0d9..000000000000 --- a/AiPlatform/src/V1/Gapic/FeaturestoreOnlineServingServiceGapicClient.php +++ /dev/null @@ -1,829 +0,0 @@ -entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $entityId = 'entity_id'; - * $featureSelector = new FeatureSelector(); - * $response = $featurestoreOnlineServingServiceClient->readFeatureValues($formattedEntityType, $entityId, $featureSelector); - * } finally { - * $featurestoreOnlineServingServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\FeaturestoreOnlineServingServiceClient}. - */ -class FeaturestoreOnlineServingServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.FeaturestoreOnlineServingService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $entityTypeNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/featurestore_online_serving_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/featurestore_online_serving_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/featurestore_online_serving_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/featurestore_online_serving_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEntityTypeNameTemplate() - { - if (self::$entityTypeNameTemplate == null) { - self::$entityTypeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ); - } - - return self::$entityTypeNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'entityType' => self::getEntityTypeNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a entity_type - * resource. - * - * @param string $project - * @param string $location - * @param string $featurestore - * @param string $entityType - * - * @return string The formatted entity_type resource. - */ - public static function entityTypeName( - $project, - $location, - $featurestore, - $entityType - ) { - return self::getEntityTypeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'featurestore' => $featurestore, - 'entity_type' => $entityType, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - entityType: projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Reads Feature values of a specific entity of an EntityType. For reading - * feature values of multiple entities of an EntityType, please use - * StreamingReadFeatureValues. - * - * Sample code: - * ``` - * $featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - * try { - * $formattedEntityType = $featurestoreOnlineServingServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $entityId = 'entity_id'; - * $featureSelector = new FeatureSelector(); - * $response = $featurestoreOnlineServingServiceClient->readFeatureValues($formattedEntityType, $entityId, $featureSelector); - * } finally { - * $featurestoreOnlineServingServiceClient->close(); - * } - * ``` - * - * @param string $entityType Required. The resource name of the EntityType for the entity being read. - * Value format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. - * For example, for a machine learning model predicting user clicks on a - * website, an EntityType ID could be `user`. - * @param string $entityId Required. ID for a specific entity. For example, - * for a machine learning model predicting user clicks on a website, an entity - * ID could be `user_123`. - * @param FeatureSelector $featureSelector Required. Selector choosing Features of the target EntityType. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ReadFeatureValuesResponse - * - * @throws ApiException if the remote call fails - */ - public function readFeatureValues( - $entityType, - $entityId, - $featureSelector, - array $optionalArgs = [] - ) { - $request = new ReadFeatureValuesRequest(); - $requestParamHeaders = []; - $request->setEntityType($entityType); - $request->setEntityId($entityId); - $request->setFeatureSelector($featureSelector); - $requestParamHeaders['entity_type'] = $entityType; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ReadFeatureValues', - ReadFeatureValuesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Reads Feature values for multiple entities. Depending on their size, data - * for different entities may be broken - * up across multiple responses. - * - * Sample code: - * ``` - * $featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - * try { - * $formattedEntityType = $featurestoreOnlineServingServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $entityIds = []; - * $featureSelector = new FeatureSelector(); - * // Read all responses until the stream is complete - * $stream = $featurestoreOnlineServingServiceClient->streamingReadFeatureValues($formattedEntityType, $entityIds, $featureSelector); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featurestoreOnlineServingServiceClient->close(); - * } - * ``` - * - * @param string $entityType Required. The resource name of the entities' type. - * Value format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. - * For example, - * for a machine learning model predicting user clicks on a website, an - * EntityType ID could be `user`. - * @param string[] $entityIds Required. IDs of entities to read Feature values of. The maximum number of - * IDs is 100. For example, for a machine learning model predicting user - * clicks on a website, an entity ID could be `user_123`. - * @param FeatureSelector $featureSelector Required. Selector choosing Features of the target EntityType. Feature IDs - * will be deduplicated. - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function streamingReadFeatureValues( - $entityType, - $entityIds, - $featureSelector, - array $optionalArgs = [] - ) { - $request = new StreamingReadFeatureValuesRequest(); - $requestParamHeaders = []; - $request->setEntityType($entityType); - $request->setEntityIds($entityIds); - $request->setFeatureSelector($featureSelector); - $requestParamHeaders['entity_type'] = $entityType; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'StreamingReadFeatureValues', - ReadFeatureValuesResponse::class, - $optionalArgs, - $request, - Call::SERVER_STREAMING_CALL - ); - } - - /** - * Writes Feature values of one or more entities of an EntityType. - * - * The Feature values are merged into existing entities if any. The Feature - * values to be written must have timestamp within the online storage - * retention. - * - * Sample code: - * ``` - * $featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - * try { - * $formattedEntityType = $featurestoreOnlineServingServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $payloads = []; - * $response = $featurestoreOnlineServingServiceClient->writeFeatureValues($formattedEntityType, $payloads); - * } finally { - * $featurestoreOnlineServingServiceClient->close(); - * } - * ``` - * - * @param string $entityType Required. The resource name of the EntityType for the entities being - * written. Value format: - * `projects/{project}/locations/{location}/featurestores/ - * {featurestore}/entityTypes/{entityType}`. For example, - * for a machine learning model predicting user clicks on a website, an - * EntityType ID could be `user`. - * @param WriteFeatureValuesPayload[] $payloads Required. The entities to be written. Up to 100,000 feature values can be - * written across all `payloads`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\WriteFeatureValuesResponse - * - * @throws ApiException if the remote call fails - */ - public function writeFeatureValues( - $entityType, - $payloads, - array $optionalArgs = [] - ) { - $request = new WriteFeatureValuesRequest(); - $requestParamHeaders = []; - $request->setEntityType($entityType); - $request->setPayloads($payloads); - $requestParamHeaders['entity_type'] = $entityType; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'WriteFeatureValues', - WriteFeatureValuesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - * try { - * $response = $featurestoreOnlineServingServiceClient->getLocation(); - * } finally { - * $featurestoreOnlineServingServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $featurestoreOnlineServingServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featurestoreOnlineServingServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featurestoreOnlineServingServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - * try { - * $resource = 'resource'; - * $response = $featurestoreOnlineServingServiceClient->getIamPolicy($resource); - * } finally { - * $featurestoreOnlineServingServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $featurestoreOnlineServingServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $featurestoreOnlineServingServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $featurestoreOnlineServingServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $featurestoreOnlineServingServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/FeaturestoreServiceGapicClient.php b/AiPlatform/src/V1/Gapic/FeaturestoreServiceGapicClient.php deleted file mode 100644 index f8a12aff9131..000000000000 --- a/AiPlatform/src/V1/Gapic/FeaturestoreServiceGapicClient.php +++ /dev/null @@ -1,2990 +0,0 @@ -entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $requests = []; - * $operationResponse = $featurestoreServiceClient->batchCreateFeatures($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->batchCreateFeatures($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'batchCreateFeatures'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\FeaturestoreServiceClient}. - */ -class FeaturestoreServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.FeaturestoreService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $entityTypeNameTemplate; - - private static $featureNameTemplate; - - private static $featureGroupNameTemplate; - - private static $featurestoreNameTemplate; - - private static $locationNameTemplate; - - private static $projectLocationFeatureGroupFeatureNameTemplate; - - private static $projectLocationFeaturestoreEntityTypeFeatureNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/featurestore_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/featurestore_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/featurestore_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/featurestore_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEntityTypeNameTemplate() - { - if (self::$entityTypeNameTemplate == null) { - self::$entityTypeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ); - } - - return self::$entityTypeNameTemplate; - } - - private static function getFeatureNameTemplate() - { - if (self::$featureNameTemplate == null) { - self::$featureNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ); - } - - return self::$featureNameTemplate; - } - - private static function getFeatureGroupNameTemplate() - { - if (self::$featureGroupNameTemplate == null) { - self::$featureGroupNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featureGroups/{feature_group}' - ); - } - - return self::$featureGroupNameTemplate; - } - - private static function getFeaturestoreNameTemplate() - { - if (self::$featurestoreNameTemplate == null) { - self::$featurestoreNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ); - } - - return self::$featurestoreNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getProjectLocationFeatureGroupFeatureNameTemplate() - { - if (self::$projectLocationFeatureGroupFeatureNameTemplate == null) { - self::$projectLocationFeatureGroupFeatureNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}' - ); - } - - return self::$projectLocationFeatureGroupFeatureNameTemplate; - } - - private static function getProjectLocationFeaturestoreEntityTypeFeatureNameTemplate() - { - if ( - self::$projectLocationFeaturestoreEntityTypeFeatureNameTemplate == - null - ) { - self::$projectLocationFeaturestoreEntityTypeFeatureNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ); - } - - return self::$projectLocationFeaturestoreEntityTypeFeatureNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'entityType' => self::getEntityTypeNameTemplate(), - 'feature' => self::getFeatureNameTemplate(), - 'featureGroup' => self::getFeatureGroupNameTemplate(), - 'featurestore' => self::getFeaturestoreNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'projectLocationFeatureGroupFeature' => self::getProjectLocationFeatureGroupFeatureNameTemplate(), - 'projectLocationFeaturestoreEntityTypeFeature' => self::getProjectLocationFeaturestoreEntityTypeFeatureNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a entity_type - * resource. - * - * @param string $project - * @param string $location - * @param string $featurestore - * @param string $entityType - * - * @return string The formatted entity_type resource. - */ - public static function entityTypeName( - $project, - $location, - $featurestore, - $entityType - ) { - return self::getEntityTypeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'featurestore' => $featurestore, - 'entity_type' => $entityType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a feature - * resource. - * - * @param string $project - * @param string $location - * @param string $featurestore - * @param string $entityType - * @param string $feature - * - * @return string The formatted feature resource. - */ - public static function featureName( - $project, - $location, - $featurestore, - $entityType, - $feature - ) { - return self::getFeatureNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'featurestore' => $featurestore, - 'entity_type' => $entityType, - 'feature' => $feature, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * feature_group resource. - * - * @param string $project - * @param string $location - * @param string $featureGroup - * - * @return string The formatted feature_group resource. - */ - public static function featureGroupName($project, $location, $featureGroup) - { - return self::getFeatureGroupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'feature_group' => $featureGroup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a featurestore - * resource. - * - * @param string $project - * @param string $location - * @param string $featurestore - * - * @return string The formatted featurestore resource. - */ - public static function featurestoreName($project, $location, $featurestore) - { - return self::getFeaturestoreNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'featurestore' => $featurestore, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_feature_group_feature resource. - * - * @param string $project - * @param string $location - * @param string $featureGroup - * @param string $feature - * - * @return string The formatted project_location_feature_group_feature resource. - */ - public static function projectLocationFeatureGroupFeatureName( - $project, - $location, - $featureGroup, - $feature - ) { - return self::getProjectLocationFeatureGroupFeatureNameTemplate()->render( - [ - 'project' => $project, - 'location' => $location, - 'feature_group' => $featureGroup, - 'feature' => $feature, - ] - ); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_featurestore_entity_type_feature resource. - * - * @param string $project - * @param string $location - * @param string $featurestore - * @param string $entityType - * @param string $feature - * - * @return string The formatted project_location_featurestore_entity_type_feature resource. - */ - public static function projectLocationFeaturestoreEntityTypeFeatureName( - $project, - $location, - $featurestore, - $entityType, - $feature - ) { - return self::getProjectLocationFeaturestoreEntityTypeFeatureNameTemplate()->render( - [ - 'project' => $project, - 'location' => $location, - 'featurestore' => $featurestore, - 'entity_type' => $entityType, - 'feature' => $feature, - ] - ); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - entityType: projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type} - * - feature: projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature} - * - featureGroup: projects/{project}/locations/{location}/featureGroups/{feature_group} - * - featurestore: projects/{project}/locations/{location}/featurestores/{featurestore} - * - location: projects/{project}/locations/{location} - * - projectLocationFeatureGroupFeature: projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature} - * - projectLocationFeaturestoreEntityTypeFeature: projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a batch of Features in a given EntityType. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedParent = $featurestoreServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $requests = []; - * $operationResponse = $featurestoreServiceClient->batchCreateFeatures($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->batchCreateFeatures($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'batchCreateFeatures'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the EntityType to create the batch of - * Features under. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param CreateFeatureRequest[] $requests Required. The request message specifying the Features to create. All - * Features must be created under the same parent EntityType. The `parent` - * field in each child request message can be omitted. If `parent` is set in a - * child request, then the value must match the `parent` value in this request - * message. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchCreateFeatures( - $parent, - $requests, - array $optionalArgs = [] - ) { - $request = new BatchCreateFeaturesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRequests($requests); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'BatchCreateFeatures', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Batch reads Feature values from a Featurestore. - * - * This API enables batch reading Feature values, where each read - * instance in the batch may read Feature values of entities from one or - * more EntityTypes. Point-in-time correctness is guaranteed for Feature - * values of each read instance as of each instance's read timestamp. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedFeaturestore = $featurestoreServiceClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - * $destination = new FeatureValueDestination(); - * $entityTypeSpecs = []; - * $operationResponse = $featurestoreServiceClient->batchReadFeatureValues($formattedFeaturestore, $destination, $entityTypeSpecs); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->batchReadFeatureValues($formattedFeaturestore, $destination, $entityTypeSpecs); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'batchReadFeatureValues'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $featurestore Required. The resource name of the Featurestore from which to query Feature - * values. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param FeatureValueDestination $destination Required. Specifies output location and format. - * @param EntityTypeSpec[] $entityTypeSpecs Required. Specifies EntityType grouping Features to read values of and - * settings. - * @param array $optionalArgs { - * Optional. - * - * @type CsvSource $csvReadInstances - * Each read instance consists of exactly one read timestamp and one or more - * entity IDs identifying entities of the corresponding EntityTypes whose - * Features are requested. - * - * Each output instance contains Feature values of requested entities - * concatenated together as of the read time. - * - * An example read instance may be `foo_entity_id, bar_entity_id, - * 2020-01-01T10:00:00.123Z`. - * - * An example output instance may be `foo_entity_id, bar_entity_id, - * 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, - * bar_entity_feature2_value`. - * - * Timestamp in each read instance must be millisecond-aligned. - * - * `csv_read_instances` are read instances stored in a plain-text CSV file. - * The header should be: - * [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp - * - * The columns can be in any order. - * - * Values in the timestamp column must use the RFC 3339 format, e.g. - * `2012-07-30T10:43:17.123Z`. - * @type BigQuerySource $bigqueryReadInstances - * Similar to csv_read_instances, but from BigQuery source. - * @type PassThroughField[] $passThroughFields - * When not empty, the specified fields in the *_read_instances source will be - * joined as-is in the output, in addition to those fields from the - * Featurestore Entity. - * - * For BigQuery source, the type of the pass-through values will be - * automatically inferred. For CSV source, the pass-through values will be - * passed as opaque bytes. - * @type Timestamp $startTime - * Optional. Excludes Feature values with feature generation timestamp before - * this timestamp. If not set, retrieve oldest values kept in Feature Store. - * Timestamp, if present, must not have higher than millisecond precision. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchReadFeatureValues( - $featurestore, - $destination, - $entityTypeSpecs, - array $optionalArgs = [] - ) { - $request = new BatchReadFeatureValuesRequest(); - $requestParamHeaders = []; - $request->setFeaturestore($featurestore); - $request->setDestination($destination); - $request->setEntityTypeSpecs($entityTypeSpecs); - $requestParamHeaders['featurestore'] = $featurestore; - if (isset($optionalArgs['csvReadInstances'])) { - $request->setCsvReadInstances($optionalArgs['csvReadInstances']); - } - - if (isset($optionalArgs['bigqueryReadInstances'])) { - $request->setBigqueryReadInstances( - $optionalArgs['bigqueryReadInstances'] - ); - } - - if (isset($optionalArgs['passThroughFields'])) { - $request->setPassThroughFields($optionalArgs['passThroughFields']); - } - - if (isset($optionalArgs['startTime'])) { - $request->setStartTime($optionalArgs['startTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'BatchReadFeatureValues', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new EntityType in a given Featurestore. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedParent = $featurestoreServiceClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - * $entityTypeId = 'entity_type_id'; - * $operationResponse = $featurestoreServiceClient->createEntityType($formattedParent, $entityTypeId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->createEntityType($formattedParent, $entityTypeId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'createEntityType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Featurestore to create EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param string $entityTypeId Required. The ID to use for the EntityType, which will become the final - * component of the EntityType's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within a featurestore. - * @param array $optionalArgs { - * Optional. - * - * @type EntityType $entityType - * The EntityType to create. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createEntityType( - $parent, - $entityTypeId, - array $optionalArgs = [] - ) { - $request = new CreateEntityTypeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntityTypeId($entityTypeId); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['entityType'])) { - $request->setEntityType($optionalArgs['entityType']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateEntityType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new Feature in a given EntityType. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedParent = $featurestoreServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $feature = new Feature(); - * $featureId = 'feature_id'; - * $operationResponse = $featurestoreServiceClient->createFeature($formattedParent, $feature, $featureId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->createFeature($formattedParent, $feature, $featureId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'createFeature'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the EntityType or FeatureGroup to create a - * Feature. Format for entity_type as parent: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * Format for feature_group as parent: - * `projects/{project}/locations/{location}/featureGroups/{feature_group}` - * @param Feature $feature Required. The Feature to create. - * @param string $featureId Required. The ID to use for the Feature, which will become the final - * component of the Feature's resource name. - * - * This value may be up to 128 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within an EntityType/FeatureGroup. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createFeature( - $parent, - $feature, - $featureId, - array $optionalArgs = [] - ) { - $request = new CreateFeatureRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFeature($feature); - $request->setFeatureId($featureId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateFeature', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new Featurestore in a given project and location. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedParent = $featurestoreServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $featurestore = new Featurestore(); - * $featurestoreId = 'featurestore_id'; - * $operationResponse = $featurestoreServiceClient->createFeaturestore($formattedParent, $featurestore, $featurestoreId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->createFeaturestore($formattedParent, $featurestore, $featurestoreId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'createFeaturestore'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create Featurestores. - * Format: - * `projects/{project}/locations/{location}` - * @param Featurestore $featurestore Required. The Featurestore to create. - * @param string $featurestoreId Required. The ID to use for this Featurestore, which will become the final - * component of the Featurestore's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within the project and location. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createFeaturestore( - $parent, - $featurestore, - $featurestoreId, - array $optionalArgs = [] - ) { - $request = new CreateFeaturestoreRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFeaturestore($featurestore); - $request->setFeaturestoreId($featurestoreId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateFeaturestore', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single EntityType. The EntityType must not have any Features - * or `force` must be set to true for the request to succeed. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedName = $featurestoreServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $operationResponse = $featurestoreServiceClient->deleteEntityType($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->deleteEntityType($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'deleteEntityType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the EntityType to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * If set to true, any Features for this EntityType will also be deleted. - * (Otherwise, the request will only work if the EntityType has no Features.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteEntityType($name, array $optionalArgs = []) - { - $request = new DeleteEntityTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteEntityType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Feature. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedName = $featurestoreServiceClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - * $operationResponse = $featurestoreServiceClient->deleteFeature($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->deleteFeature($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'deleteFeature'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Features to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - * `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFeature($name, array $optionalArgs = []) - { - $request = new DeleteFeatureRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteFeature', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Delete Feature values from Featurestore. - * - * The progress of the deletion is tracked by the returned operation. The - * deleted feature values are guaranteed to be invisible to subsequent read - * operations after the operation is marked as successfully done. - * - * If a delete feature values operation fails, the feature values - * returned from reads and exports may be inconsistent. If consistency is - * required, the caller must retry the same delete request again and wait till - * the new operation returned is marked as successfully done. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedEntityType = $featurestoreServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $operationResponse = $featurestoreServiceClient->deleteFeatureValues($formattedEntityType); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->deleteFeatureValues($formattedEntityType); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'deleteFeatureValues'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $entityType Required. The resource name of the EntityType grouping the Features for - * which values are being deleted from. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` - * @param array $optionalArgs { - * Optional. - * - * @type SelectEntity $selectEntity - * Select feature values to be deleted by specifying entities. - * @type SelectTimeRangeAndFeature $selectTimeRangeAndFeature - * Select feature values to be deleted by specifying time range and - * features. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFeatureValues($entityType, array $optionalArgs = []) - { - $request = new DeleteFeatureValuesRequest(); - $requestParamHeaders = []; - $request->setEntityType($entityType); - $requestParamHeaders['entity_type'] = $entityType; - if (isset($optionalArgs['selectEntity'])) { - $request->setSelectEntity($optionalArgs['selectEntity']); - } - - if (isset($optionalArgs['selectTimeRangeAndFeature'])) { - $request->setSelectTimeRangeAndFeature( - $optionalArgs['selectTimeRangeAndFeature'] - ); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteFeatureValues', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Featurestore. The Featurestore must not contain any - * EntityTypes or `force` must be set to true for the request to succeed. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedName = $featurestoreServiceClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - * $operationResponse = $featurestoreServiceClient->deleteFeaturestore($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->deleteFeaturestore($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'deleteFeaturestore'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Featurestore to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * If set to true, any EntityTypes and Features for this Featurestore will - * also be deleted. (Otherwise, the request will only work if the Featurestore - * has no EntityTypes.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFeaturestore($name, array $optionalArgs = []) - { - $request = new DeleteFeaturestoreRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteFeaturestore', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Exports Feature values from all the entities of a target EntityType. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedEntityType = $featurestoreServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $destination = new FeatureValueDestination(); - * $featureSelector = new FeatureSelector(); - * $operationResponse = $featurestoreServiceClient->exportFeatureValues($formattedEntityType, $destination, $featureSelector); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->exportFeatureValues($formattedEntityType, $destination, $featureSelector); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'exportFeatureValues'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $entityType Required. The resource name of the EntityType from which to export Feature - * values. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param FeatureValueDestination $destination Required. Specifies destination location and format. - * @param FeatureSelector $featureSelector Required. Selects Features to export values of. - * @param array $optionalArgs { - * Optional. - * - * @type SnapshotExport $snapshotExport - * Exports the latest Feature values of all entities of the EntityType - * within a time range. - * @type FullExport $fullExport - * Exports all historical values of all entities of the EntityType within a - * time range - * @type DestinationFeatureSetting[] $settings - * Per-Feature export settings. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function exportFeatureValues( - $entityType, - $destination, - $featureSelector, - array $optionalArgs = [] - ) { - $request = new ExportFeatureValuesRequest(); - $requestParamHeaders = []; - $request->setEntityType($entityType); - $request->setDestination($destination); - $request->setFeatureSelector($featureSelector); - $requestParamHeaders['entity_type'] = $entityType; - if (isset($optionalArgs['snapshotExport'])) { - $request->setSnapshotExport($optionalArgs['snapshotExport']); - } - - if (isset($optionalArgs['fullExport'])) { - $request->setFullExport($optionalArgs['fullExport']); - } - - if (isset($optionalArgs['settings'])) { - $request->setSettings($optionalArgs['settings']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'ExportFeatureValues', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets details of a single EntityType. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedName = $featurestoreServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $response = $featurestoreServiceClient->getEntityType($formattedName); - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the EntityType resource. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\EntityType - * - * @throws ApiException if the remote call fails - */ - public function getEntityType($name, array $optionalArgs = []) - { - $request = new GetEntityTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetEntityType', - EntityType::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single Feature. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedName = $featurestoreServiceClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - * $response = $featurestoreServiceClient->getFeature($formattedName); - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Feature resource. - * Format for entity_type as parent: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * Format for feature_group as parent: - * `projects/{project}/locations/{location}/featureGroups/{feature_group}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Feature - * - * @throws ApiException if the remote call fails - */ - public function getFeature($name, array $optionalArgs = []) - { - $request = new GetFeatureRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetFeature', - Feature::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single Featurestore. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedName = $featurestoreServiceClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - * $response = $featurestoreServiceClient->getFeaturestore($formattedName); - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Featurestore resource. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Featurestore - * - * @throws ApiException if the remote call fails - */ - public function getFeaturestore($name, array $optionalArgs = []) - { - $request = new GetFeaturestoreRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetFeaturestore', - Featurestore::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Imports Feature values into the Featurestore from a source storage. - * - * The progress of the import is tracked by the returned operation. The - * imported features are guaranteed to be visible to subsequent read - * operations after the operation is marked as successfully done. - * - * If an import operation fails, the Feature values returned from - * reads and exports may be inconsistent. If consistency is - * required, the caller must retry the same import request again and wait till - * the new operation returned is marked as successfully done. - * - * There are also scenarios where the caller can cause inconsistency. - * - * - Source data for import contains multiple distinct Feature values for - * the same entity ID and timestamp. - * - Source is modified during an import. This includes adding, updating, or - * removing source data and/or metadata. Examples of updating metadata - * include but are not limited to changing storage location, storage class, - * or retention policy. - * - Online serving cluster is under-provisioned. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedEntityType = $featurestoreServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * $featureSpecs = []; - * $operationResponse = $featurestoreServiceClient->importFeatureValues($formattedEntityType, $featureSpecs); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->importFeatureValues($formattedEntityType, $featureSpecs); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'importFeatureValues'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $entityType Required. The resource name of the EntityType grouping the Features for - * which values are being imported. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` - * @param FeatureSpec[] $featureSpecs Required. Specifications defining which Feature values to import from the - * entity. The request fails if no feature_specs are provided, and having - * multiple feature_specs for one Feature is not allowed. - * @param array $optionalArgs { - * Optional. - * - * @type AvroSource $avroSource - * @type BigQuerySource $bigquerySource - * @type CsvSource $csvSource - * @type string $featureTimeField - * Source column that holds the Feature timestamp for all Feature - * values in each entity. - * @type Timestamp $featureTime - * Single Feature timestamp for all entities being imported. The - * timestamp must not have higher than millisecond precision. - * @type string $entityIdField - * Source column that holds entity IDs. If not provided, entity IDs are - * extracted from the column named entity_id. - * @type bool $disableOnlineServing - * If set, data will not be imported for online serving. This - * is typically used for backfilling, where Feature generation timestamps are - * not in the timestamp range needed for online serving. - * @type int $workerCount - * Specifies the number of workers that are used to write data to the - * Featurestore. Consider the online serving capacity that you require to - * achieve the desired import throughput without interfering with online - * serving. The value must be positive, and less than or equal to 100. - * If not set, defaults to using 1 worker. The low count ensures minimal - * impact on online serving performance. - * @type bool $disableIngestionAnalysis - * If true, API doesn't start ingestion analysis pipeline. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function importFeatureValues( - $entityType, - $featureSpecs, - array $optionalArgs = [] - ) { - $request = new ImportFeatureValuesRequest(); - $requestParamHeaders = []; - $request->setEntityType($entityType); - $request->setFeatureSpecs($featureSpecs); - $requestParamHeaders['entity_type'] = $entityType; - if (isset($optionalArgs['avroSource'])) { - $request->setAvroSource($optionalArgs['avroSource']); - } - - if (isset($optionalArgs['bigquerySource'])) { - $request->setBigquerySource($optionalArgs['bigquerySource']); - } - - if (isset($optionalArgs['csvSource'])) { - $request->setCsvSource($optionalArgs['csvSource']); - } - - if (isset($optionalArgs['featureTimeField'])) { - $request->setFeatureTimeField($optionalArgs['featureTimeField']); - } - - if (isset($optionalArgs['featureTime'])) { - $request->setFeatureTime($optionalArgs['featureTime']); - } - - if (isset($optionalArgs['entityIdField'])) { - $request->setEntityIdField($optionalArgs['entityIdField']); - } - - if (isset($optionalArgs['disableOnlineServing'])) { - $request->setDisableOnlineServing( - $optionalArgs['disableOnlineServing'] - ); - } - - if (isset($optionalArgs['workerCount'])) { - $request->setWorkerCount($optionalArgs['workerCount']); - } - - if (isset($optionalArgs['disableIngestionAnalysis'])) { - $request->setDisableIngestionAnalysis( - $optionalArgs['disableIngestionAnalysis'] - ); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'ImportFeatureValues', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Lists EntityTypes in a given Featurestore. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedParent = $featurestoreServiceClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - * // Iterate over pages of elements - * $pagedResponse = $featurestoreServiceClient->listEntityTypes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featurestoreServiceClient->listEntityTypes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Featurestore to list EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the EntityTypes that match the filter expression. The following - * filters are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any EntityType which has a label with 'env' as the - * key. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * - * Supported fields: - * - * * `entity_type_id` - * * `create_time` - * * `update_time` - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEntityTypes($parent, array $optionalArgs = []) - { - $request = new ListEntityTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListEntityTypes', - $optionalArgs, - ListEntityTypesResponse::class, - $request - ); - } - - /** - * Lists Features in a given EntityType. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedParent = $featurestoreServiceClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - * // Iterate over pages of elements - * $pagedResponse = $featurestoreServiceClient->listFeatures($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featurestoreServiceClient->listFeatures($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list Features. - * Format for entity_type as parent: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * Format for feature_group as parent: - * `projects/{project}/locations/{location}/featureGroups/{feature_group}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the Features that match the filter expression. The following - * filters are supported: - * - * * `value_type`: Supports = and != comparisons. - * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with 'env' as the - * key. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `feature_id` - * * `value_type` (Not supported for FeatureRegistry Feature) - * * `create_time` - * * `update_time` - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type int $latestStatsCount - * Only applicable for Vertex AI Feature Store (Legacy). - * If set, return the most recent - * [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count] - * of stats for each Feature in response. Valid value is [0, 10]. If number of - * stats exists < - * [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count], - * return all existing stats. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listFeatures($parent, array $optionalArgs = []) - { - $request = new ListFeaturesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['latestStatsCount'])) { - $request->setLatestStatsCount($optionalArgs['latestStatsCount']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListFeatures', - $optionalArgs, - ListFeaturesResponse::class, - $request - ); - } - - /** - * Lists Featurestores in a given project and location. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedParent = $featurestoreServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $featurestoreServiceClient->listFeaturestores($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featurestoreServiceClient->listFeaturestores($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list Featurestores. - * Format: - * `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the featurestores that match the filter expression. The following - * fields are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, - * `<=`, and `>=` comparisons. - * * `labels`: Supports key-value equality and key presence. - * - * Examples: - * - * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - * Featurestores created or updated after 2020-01-01. - * * `labels.env = "prod"` - * Featurestores with label "env" set to "prod". - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported Fields: - * - * * `create_time` - * * `update_time` - * * `online_serving_config.fixed_node_count` - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listFeaturestores($parent, array $optionalArgs = []) - { - $request = new ListFeaturestoresRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListFeaturestores', - $optionalArgs, - ListFeaturestoresResponse::class, - $request - ); - } - - /** - * Searches Features matching a query in a given project. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $formattedLocation = $featurestoreServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $featurestoreServiceClient->searchFeatures($formattedLocation); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featurestoreServiceClient->searchFeatures($formattedLocation); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $location Required. The resource name of the Location to search Features. - * Format: - * `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $query - * Query string that is a conjunction of field-restricted queries and/or - * field-restricted filters. Field-restricted queries and filters can be - * combined using `AND` to form a conjunction. - * - * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY - * exists as a substring within Feature's FIELD. The QUERY - * and the FIELD are converted to a sequence of words (i.e. tokens) for - * comparison. This is done by: - * - * * Removing leading/trailing whitespace and tokenizing the search value. - * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore - * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated - * as a wildcard that matches characters within a token. - * * Ignoring case. - * * Prepending an asterisk to the first and appending an asterisk to the - * last token in QUERY. - * - * A QUERY must be either a singular token or a phrase. A phrase is one or - * multiple words enclosed in double quotation marks ("). With phrases, the - * order of the words is important. Words in the phrase must be matching in - * order and consecutively. - * - * Supported FIELDs for field-restricted queries: - * - * * `feature_id` - * * `description` - * * `entity_type_id` - * - * Examples: - * - * * `feature_id: foo` --> Matches a Feature with ID containing the substring - * `foo` (eg. `foo`, `foofeature`, `barfoo`). - * * `feature_id: foo*feature` --> Matches a Feature with ID containing the - * substring `foo*feature` (eg. `foobarfeature`). - * * `feature_id: foo AND description: bar` --> Matches a Feature with ID - * containing the substring `foo` and description containing the substring - * `bar`. - * - * - * Besides field queries, the following exact-match filters are - * supported. The exact-match filters do not support wildcards. Unlike - * field-restricted queries, exact-match filters are case-sensitive. - * - * * `feature_id`: Supports = comparisons. - * * `description`: Supports = comparisons. Multi-token filters should be - * enclosed in quotes. - * * `entity_type_id`: Supports = comparisons. - * * `value_type`: Supports = and != comparisons. - * * `labels`: Supports key-value equality as well as key presence. - * * `featurestore_id`: Supports = comparisons. - * - * Examples: - * - * * `description = "foo bar"` --> Any Feature with description exactly equal - * to `foo bar` - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with `env` as the - * key. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function searchFeatures($location, array $optionalArgs = []) - { - $request = new SearchFeaturesRequest(); - $requestParamHeaders = []; - $request->setLocation($location); - $requestParamHeaders['location'] = $location; - if (isset($optionalArgs['query'])) { - $request->setQuery($optionalArgs['query']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'SearchFeatures', - $optionalArgs, - SearchFeaturesResponse::class, - $request - ); - } - - /** - * Updates the parameters of a single EntityType. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $entityType = new EntityType(); - * $response = $featurestoreServiceClient->updateEntityType($entityType); - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param EntityType $entityType Required. The EntityType's `name` field is used to identify the EntityType - * to be updated. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * EntityType resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `description` - * * `labels` - * * `monitoring_config.snapshot_analysis.disabled` - * * `monitoring_config.snapshot_analysis.monitoring_interval_days` - * * `monitoring_config.snapshot_analysis.staleness_days` - * * `monitoring_config.import_features_analysis.state` - * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` - * * `monitoring_config.numerical_threshold_config.value` - * * `monitoring_config.categorical_threshold_config.value` - * * `offline_storage_ttl_days` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\EntityType - * - * @throws ApiException if the remote call fails - */ - public function updateEntityType($entityType, array $optionalArgs = []) - { - $request = new UpdateEntityTypeRequest(); - $requestParamHeaders = []; - $request->setEntityType($entityType); - $requestParamHeaders['entity_type.name'] = $entityType->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateEntityType', - EntityType::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates the parameters of a single Feature. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $feature = new Feature(); - * $response = $featurestoreServiceClient->updateFeature($feature); - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param Feature $feature Required. The Feature's `name` field is used to identify the Feature to be - * updated. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - * `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * Features resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `description` - * * `labels` - * * `disable_monitoring` (Not supported for FeatureRegistry Feature) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Feature - * - * @throws ApiException if the remote call fails - */ - public function updateFeature($feature, array $optionalArgs = []) - { - $request = new UpdateFeatureRequest(); - $requestParamHeaders = []; - $request->setFeature($feature); - $requestParamHeaders['feature.name'] = $feature->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateFeature', - Feature::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates the parameters of a single Featurestore. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $featurestore = new Featurestore(); - * $operationResponse = $featurestoreServiceClient->updateFeaturestore($featurestore); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $featurestoreServiceClient->updateFeaturestore($featurestore); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $featurestoreServiceClient->resumeOperation($operationName, 'updateFeaturestore'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param Featurestore $featurestore Required. The Featurestore's `name` field is used to identify the - * Featurestore to be updated. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * Featurestore resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `labels` - * * `online_serving_config.fixed_node_count` - * * `online_serving_config.scaling` - * * `online_storage_ttl_days` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateFeaturestore($featurestore, array $optionalArgs = []) - { - $request = new UpdateFeaturestoreRequest(); - $requestParamHeaders = []; - $request->setFeaturestore($featurestore); - $requestParamHeaders['featurestore.name'] = $featurestore->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateFeaturestore', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $response = $featurestoreServiceClient->getLocation(); - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $featurestoreServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $featurestoreServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $resource = 'resource'; - * $response = $featurestoreServiceClient->getIamPolicy($resource); - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $featurestoreServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $featurestoreServiceClient = new FeaturestoreServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $featurestoreServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $featurestoreServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/GenAiTuningServiceGapicClient.php b/AiPlatform/src/V1/Gapic/GenAiTuningServiceGapicClient.php deleted file mode 100644 index e2cd1cb21b89..000000000000 --- a/AiPlatform/src/V1/Gapic/GenAiTuningServiceGapicClient.php +++ /dev/null @@ -1,1084 +0,0 @@ -tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - * $genAiTuningServiceClient->cancelTuningJob($formattedName); - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\GenAiTuningServiceClient}. - */ -class GenAiTuningServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.GenAiTuningService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $contextNameTemplate; - - private static $endpointNameTemplate; - - private static $locationNameTemplate; - - private static $modelNameTemplate; - - private static $projectLocationEndpointNameTemplate; - - private static $projectLocationPublisherModelNameTemplate; - - private static $tuningJobNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/gen_ai_tuning_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/gen_ai_tuning_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/gen_ai_tuning_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/gen_ai_tuning_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getContextNameTemplate() - { - if (self::$contextNameTemplate == null) { - self::$contextNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ); - } - - return self::$contextNameTemplate; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$endpointNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getModelNameTemplate() - { - if (self::$modelNameTemplate == null) { - self::$modelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ); - } - - return self::$modelNameTemplate; - } - - private static function getProjectLocationEndpointNameTemplate() - { - if (self::$projectLocationEndpointNameTemplate == null) { - self::$projectLocationEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$projectLocationEndpointNameTemplate; - } - - private static function getProjectLocationPublisherModelNameTemplate() - { - if (self::$projectLocationPublisherModelNameTemplate == null) { - self::$projectLocationPublisherModelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ); - } - - return self::$projectLocationPublisherModelNameTemplate; - } - - private static function getTuningJobNameTemplate() - { - if (self::$tuningJobNameTemplate == null) { - self::$tuningJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' - ); - } - - return self::$tuningJobNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'context' => self::getContextNameTemplate(), - 'endpoint' => self::getEndpointNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'model' => self::getModelNameTemplate(), - 'projectLocationEndpoint' => self::getProjectLocationEndpointNameTemplate(), - 'projectLocationPublisherModel' => self::getProjectLocationPublisherModelNameTemplate(), - 'tuningJob' => self::getTuningJobNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a context - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $context - * - * @return string The formatted context resource. - */ - public static function contextName( - $project, - $location, - $metadataStore, - $context - ) { - return self::getContextNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName($project, $location, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName($project, $location, $model) - { - return self::getModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted project_location_endpoint resource. - */ - public static function projectLocationEndpointName( - $project, - $location, - $endpoint - ) { - return self::getProjectLocationEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_publisher_model resource. - * - * @param string $project - * @param string $location - * @param string $publisher - * @param string $model - * - * @return string The formatted project_location_publisher_model resource. - */ - public static function projectLocationPublisherModelName( - $project, - $location, - $publisher, - $model - ) { - return self::getProjectLocationPublisherModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'publisher' => $publisher, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a tuning_job - * resource. - * - * @param string $project - * @param string $location - * @param string $tuningJob - * - * @return string The formatted tuning_job resource. - */ - public static function tuningJobName($project, $location, $tuningJob) - { - return self::getTuningJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'tuning_job' => $tuningJob, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - context: projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context} - * - endpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - location: projects/{project}/locations/{location} - * - model: projects/{project}/locations/{location}/models/{model} - * - projectLocationEndpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - projectLocationPublisherModel: projects/{project}/locations/{location}/publishers/{publisher}/models/{model} - * - tuningJob: projects/{project}/locations/{location}/tuningJobs/{tuning_job} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Cancels a TuningJob. - * Starts asynchronous cancellation on the TuningJob. The server makes a best - * effort to cancel the job, but success is not guaranteed. Clients can use - * [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob] - * or other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, the - * TuningJob is not deleted; instead it becomes a job with a - * [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`, and - * [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to - * `CANCELLED`. - * - * Sample code: - * ``` - * $genAiTuningServiceClient = new GenAiTuningServiceClient(); - * try { - * $formattedName = $genAiTuningServiceClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - * $genAiTuningServiceClient->cancelTuningJob($formattedName); - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TuningJob to cancel. Format: - * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function cancelTuningJob($name, array $optionalArgs = []) - { - $request = new CancelTuningJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelTuningJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a TuningJob. A created TuningJob right away will be attempted to - * be run. - * - * Sample code: - * ``` - * $genAiTuningServiceClient = new GenAiTuningServiceClient(); - * try { - * $formattedParent = $genAiTuningServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $tuningJob = new TuningJob(); - * $response = $genAiTuningServiceClient->createTuningJob($formattedParent, $tuningJob); - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the TuningJob in. - * Format: `projects/{project}/locations/{location}` - * @param TuningJob $tuningJob Required. The TuningJob to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TuningJob - * - * @throws ApiException if the remote call fails - */ - public function createTuningJob( - $parent, - $tuningJob, - array $optionalArgs = [] - ) { - $request = new CreateTuningJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTuningJob($tuningJob); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateTuningJob', - TuningJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a TuningJob. - * - * Sample code: - * ``` - * $genAiTuningServiceClient = new GenAiTuningServiceClient(); - * try { - * $formattedName = $genAiTuningServiceClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - * $response = $genAiTuningServiceClient->getTuningJob($formattedName); - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TuningJob resource. Format: - * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TuningJob - * - * @throws ApiException if the remote call fails - */ - public function getTuningJob($name, array $optionalArgs = []) - { - $request = new GetTuningJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTuningJob', - TuningJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists TuningJobs in a Location. - * - * Sample code: - * ``` - * $genAiTuningServiceClient = new GenAiTuningServiceClient(); - * try { - * $formattedParent = $genAiTuningServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $genAiTuningServiceClient->listTuningJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $genAiTuningServiceClient->listTuningJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the TuningJobs from. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTuningJobs($parent, array $optionalArgs = []) - { - $request = new ListTuningJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTuningJobs', - $optionalArgs, - ListTuningJobsResponse::class, - $request - ); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $genAiTuningServiceClient = new GenAiTuningServiceClient(); - * try { - * $response = $genAiTuningServiceClient->getLocation(); - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $genAiTuningServiceClient = new GenAiTuningServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $genAiTuningServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $genAiTuningServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $genAiTuningServiceClient = new GenAiTuningServiceClient(); - * try { - * $resource = 'resource'; - * $response = $genAiTuningServiceClient->getIamPolicy($resource); - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $genAiTuningServiceClient = new GenAiTuningServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $genAiTuningServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $genAiTuningServiceClient = new GenAiTuningServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $genAiTuningServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $genAiTuningServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/IndexEndpointServiceGapicClient.php b/AiPlatform/src/V1/Gapic/IndexEndpointServiceGapicClient.php deleted file mode 100644 index 61c43d7399f4..000000000000 --- a/AiPlatform/src/V1/Gapic/IndexEndpointServiceGapicClient.php +++ /dev/null @@ -1,1374 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $indexEndpoint = new IndexEndpoint(); - * $operationResponse = $indexEndpointServiceClient->createIndexEndpoint($formattedParent, $indexEndpoint); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexEndpointServiceClient->createIndexEndpoint($formattedParent, $indexEndpoint); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexEndpointServiceClient->resumeOperation($operationName, 'createIndexEndpoint'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\IndexEndpointServiceClient}. - */ -class IndexEndpointServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.IndexEndpointService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $indexNameTemplate; - - private static $indexEndpointNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/index_endpoint_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/index_endpoint_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/index_endpoint_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/index_endpoint_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getIndexNameTemplate() - { - if (self::$indexNameTemplate == null) { - self::$indexNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ); - } - - return self::$indexNameTemplate; - } - - private static function getIndexEndpointNameTemplate() - { - if (self::$indexEndpointNameTemplate == null) { - self::$indexEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ); - } - - return self::$indexEndpointNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'index' => self::getIndexNameTemplate(), - 'indexEndpoint' => self::getIndexEndpointNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a index - * resource. - * - * @param string $project - * @param string $location - * @param string $index - * - * @return string The formatted index resource. - */ - public static function indexName($project, $location, $index) - { - return self::getIndexNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'index' => $index, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * index_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $indexEndpoint - * - * @return string The formatted index_endpoint resource. - */ - public static function indexEndpointName( - $project, - $location, - $indexEndpoint - ) { - return self::getIndexEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'index_endpoint' => $indexEndpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - index: projects/{project}/locations/{location}/indexes/{index} - * - indexEndpoint: projects/{project}/locations/{location}/indexEndpoints/{index_endpoint} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates an IndexEndpoint. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $formattedParent = $indexEndpointServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $indexEndpoint = new IndexEndpoint(); - * $operationResponse = $indexEndpointServiceClient->createIndexEndpoint($formattedParent, $indexEndpoint); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexEndpointServiceClient->createIndexEndpoint($formattedParent, $indexEndpoint); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexEndpointServiceClient->resumeOperation($operationName, 'createIndexEndpoint'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the IndexEndpoint in. - * Format: `projects/{project}/locations/{location}` - * @param IndexEndpoint $indexEndpoint Required. The IndexEndpoint to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createIndexEndpoint( - $parent, - $indexEndpoint, - array $optionalArgs = [] - ) { - $request = new CreateIndexEndpointRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setIndexEndpoint($indexEndpoint); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateIndexEndpoint', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes an IndexEndpoint. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $formattedName = $indexEndpointServiceClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - * $operationResponse = $indexEndpointServiceClient->deleteIndexEndpoint($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexEndpointServiceClient->deleteIndexEndpoint($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexEndpointServiceClient->resumeOperation($operationName, 'deleteIndexEndpoint'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the IndexEndpoint resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteIndexEndpoint($name, array $optionalArgs = []) - { - $request = new DeleteIndexEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteIndexEndpoint', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deploys an Index into this IndexEndpoint, creating a DeployedIndex within - * it. - * Only non-empty Indexes can be deployed. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $formattedIndexEndpoint = $indexEndpointServiceClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - * $deployedIndex = new DeployedIndex(); - * $operationResponse = $indexEndpointServiceClient->deployIndex($formattedIndexEndpoint, $deployedIndex); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexEndpointServiceClient->deployIndex($formattedIndexEndpoint, $deployedIndex); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexEndpointServiceClient->resumeOperation($operationName, 'deployIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $indexEndpoint Required. The name of the IndexEndpoint resource into which to deploy an - * Index. Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param DeployedIndex $deployedIndex Required. The DeployedIndex to be created within the IndexEndpoint. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deployIndex( - $indexEndpoint, - $deployedIndex, - array $optionalArgs = [] - ) { - $request = new DeployIndexRequest(); - $requestParamHeaders = []; - $request->setIndexEndpoint($indexEndpoint); - $request->setDeployedIndex($deployedIndex); - $requestParamHeaders['index_endpoint'] = $indexEndpoint; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeployIndex', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets an IndexEndpoint. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $formattedName = $indexEndpointServiceClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - * $response = $indexEndpointServiceClient->getIndexEndpoint($formattedName); - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the IndexEndpoint resource. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\IndexEndpoint - * - * @throws ApiException if the remote call fails - */ - public function getIndexEndpoint($name, array $optionalArgs = []) - { - $request = new GetIndexEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIndexEndpoint', - IndexEndpoint::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists IndexEndpoints in a Location. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $formattedParent = $indexEndpointServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $indexEndpointServiceClient->listIndexEndpoints($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $indexEndpointServiceClient->listIndexEndpoints($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location from which to list the - * IndexEndpoints. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. An expression for filtering the results of the request. For field - * names both snake_case and camelCase are supported. - * - * * `index_endpoint` supports = and !=. `index_endpoint` represents the - * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's - * [resourcename][google.cloud.aiplatform.v1.IndexEndpoint.name]. - * * `display_name` supports =, != and regex() - * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* or labels:key - key existence - * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `index_endpoint="1"` - * * `display_name="myDisplayName"` - * * `regex(display_name, "^A") -> The display name starts with an A. - * * `labels.myKey="myValue"` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Optional. Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listIndexEndpoints($parent, array $optionalArgs = []) - { - $request = new ListIndexEndpointsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListIndexEndpoints', - $optionalArgs, - ListIndexEndpointsResponse::class, - $request - ); - } - - /** - * Update an existing DeployedIndex under an IndexEndpoint. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $formattedIndexEndpoint = $indexEndpointServiceClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - * $deployedIndex = new DeployedIndex(); - * $operationResponse = $indexEndpointServiceClient->mutateDeployedIndex($formattedIndexEndpoint, $deployedIndex); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexEndpointServiceClient->mutateDeployedIndex($formattedIndexEndpoint, $deployedIndex); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexEndpointServiceClient->resumeOperation($operationName, 'mutateDeployedIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $indexEndpoint Required. The name of the IndexEndpoint resource into which to deploy an - * Index. Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param DeployedIndex $deployedIndex Required. The DeployedIndex to be updated within the IndexEndpoint. - * Currently, the updatable fields are [DeployedIndex][automatic_resources] - * and [DeployedIndex][dedicated_resources] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function mutateDeployedIndex( - $indexEndpoint, - $deployedIndex, - array $optionalArgs = [] - ) { - $request = new MutateDeployedIndexRequest(); - $requestParamHeaders = []; - $request->setIndexEndpoint($indexEndpoint); - $request->setDeployedIndex($deployedIndex); - $requestParamHeaders['index_endpoint'] = $indexEndpoint; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'MutateDeployedIndex', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, - * and freeing all resources it's using. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $formattedIndexEndpoint = $indexEndpointServiceClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - * $deployedIndexId = 'deployed_index_id'; - * $operationResponse = $indexEndpointServiceClient->undeployIndex($formattedIndexEndpoint, $deployedIndexId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexEndpointServiceClient->undeployIndex($formattedIndexEndpoint, $deployedIndexId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexEndpointServiceClient->resumeOperation($operationName, 'undeployIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $indexEndpoint Required. The name of the IndexEndpoint resource from which to undeploy an - * Index. Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param string $deployedIndexId Required. The ID of the DeployedIndex to be undeployed from the - * IndexEndpoint. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function undeployIndex( - $indexEndpoint, - $deployedIndexId, - array $optionalArgs = [] - ) { - $request = new UndeployIndexRequest(); - $requestParamHeaders = []; - $request->setIndexEndpoint($indexEndpoint); - $request->setDeployedIndexId($deployedIndexId); - $requestParamHeaders['index_endpoint'] = $indexEndpoint; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UndeployIndex', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates an IndexEndpoint. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $indexEndpoint = new IndexEndpoint(); - * $updateMask = new FieldMask(); - * $response = $indexEndpointServiceClient->updateIndexEndpoint($indexEndpoint, $updateMask); - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param IndexEndpoint $indexEndpoint Required. The IndexEndpoint which replaces the resource on the server. - * @param FieldMask $updateMask Required. The update mask applies to the resource. See - * [google.protobuf.FieldMask][google.protobuf.FieldMask]. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\IndexEndpoint - * - * @throws ApiException if the remote call fails - */ - public function updateIndexEndpoint( - $indexEndpoint, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateIndexEndpointRequest(); - $requestParamHeaders = []; - $request->setIndexEndpoint($indexEndpoint); - $request->setUpdateMask($updateMask); - $requestParamHeaders['index_endpoint.name'] = $indexEndpoint->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateIndexEndpoint', - IndexEndpoint::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $response = $indexEndpointServiceClient->getLocation(); - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $indexEndpointServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $indexEndpointServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $resource = 'resource'; - * $response = $indexEndpointServiceClient->getIamPolicy($resource); - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $indexEndpointServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $indexEndpointServiceClient = new IndexEndpointServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $indexEndpointServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $indexEndpointServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/IndexServiceGapicClient.php b/AiPlatform/src/V1/Gapic/IndexServiceGapicClient.php deleted file mode 100644 index 4baf2652b975..000000000000 --- a/AiPlatform/src/V1/Gapic/IndexServiceGapicClient.php +++ /dev/null @@ -1,1256 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $index = new Index(); - * $operationResponse = $indexServiceClient->createIndex($formattedParent, $index); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexServiceClient->createIndex($formattedParent, $index); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexServiceClient->resumeOperation($operationName, 'createIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\IndexServiceClient}. - */ -class IndexServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.IndexService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $indexNameTemplate; - - private static $indexEndpointNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/index_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/index_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/index_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/index_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getIndexNameTemplate() - { - if (self::$indexNameTemplate == null) { - self::$indexNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ); - } - - return self::$indexNameTemplate; - } - - private static function getIndexEndpointNameTemplate() - { - if (self::$indexEndpointNameTemplate == null) { - self::$indexEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ); - } - - return self::$indexEndpointNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'index' => self::getIndexNameTemplate(), - 'indexEndpoint' => self::getIndexEndpointNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a index - * resource. - * - * @param string $project - * @param string $location - * @param string $index - * - * @return string The formatted index resource. - */ - public static function indexName($project, $location, $index) - { - return self::getIndexNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'index' => $index, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * index_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $indexEndpoint - * - * @return string The formatted index_endpoint resource. - */ - public static function indexEndpointName( - $project, - $location, - $indexEndpoint - ) { - return self::getIndexEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'index_endpoint' => $indexEndpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - index: projects/{project}/locations/{location}/indexes/{index} - * - indexEndpoint: projects/{project}/locations/{location}/indexEndpoints/{index_endpoint} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates an Index. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $formattedParent = $indexServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $index = new Index(); - * $operationResponse = $indexServiceClient->createIndex($formattedParent, $index); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexServiceClient->createIndex($formattedParent, $index); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexServiceClient->resumeOperation($operationName, 'createIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the Index in. - * Format: `projects/{project}/locations/{location}` - * @param Index $index Required. The Index to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createIndex($parent, $index, array $optionalArgs = []) - { - $request = new CreateIndexRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setIndex($index); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateIndex', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes an Index. - * An Index can only be deleted when all its - * [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had - * been undeployed. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $formattedName = $indexServiceClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - * $operationResponse = $indexServiceClient->deleteIndex($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexServiceClient->deleteIndex($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexServiceClient->resumeOperation($operationName, 'deleteIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Index resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteIndex($name, array $optionalArgs = []) - { - $request = new DeleteIndexRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteIndex', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets an Index. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $formattedName = $indexServiceClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - * $response = $indexServiceClient->getIndex($formattedName); - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Index resource. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Index - * - * @throws ApiException if the remote call fails - */ - public function getIndex($name, array $optionalArgs = []) - { - $request = new GetIndexRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIndex', - Index::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists Indexes in a Location. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $formattedParent = $indexServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $indexServiceClient->listIndexes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $indexServiceClient->listIndexes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location from which to list the Indexes. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listIndexes($parent, array $optionalArgs = []) - { - $request = new ListIndexesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListIndexes', - $optionalArgs, - ListIndexesResponse::class, - $request - ); - } - - /** - * Remove Datapoints from an Index. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $formattedIndex = $indexServiceClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - * $response = $indexServiceClient->removeDatapoints($formattedIndex); - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param string $index Required. The name of the Index resource to be updated. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param array $optionalArgs { - * Optional. - * - * @type string[] $datapointIds - * A list of datapoint ids to be deleted. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\RemoveDatapointsResponse - * - * @throws ApiException if the remote call fails - */ - public function removeDatapoints($index, array $optionalArgs = []) - { - $request = new RemoveDatapointsRequest(); - $requestParamHeaders = []; - $request->setIndex($index); - $requestParamHeaders['index'] = $index; - if (isset($optionalArgs['datapointIds'])) { - $request->setDatapointIds($optionalArgs['datapointIds']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'RemoveDatapoints', - RemoveDatapointsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates an Index. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $index = new Index(); - * $operationResponse = $indexServiceClient->updateIndex($index); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $indexServiceClient->updateIndex($index); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $indexServiceClient->resumeOperation($operationName, 'updateIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param Index $index Required. The Index which updates the resource on the server. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * The update mask applies to the resource. - * For the `FieldMask` definition, see - * [google.protobuf.FieldMask][google.protobuf.FieldMask]. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateIndex($index, array $optionalArgs = []) - { - $request = new UpdateIndexRequest(); - $requestParamHeaders = []; - $request->setIndex($index); - $requestParamHeaders['index.name'] = $index->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateIndex', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Add/update Datapoints into an Index. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $formattedIndex = $indexServiceClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - * $response = $indexServiceClient->upsertDatapoints($formattedIndex); - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param string $index Required. The name of the Index resource to be updated. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param array $optionalArgs { - * Optional. - * - * @type IndexDatapoint[] $datapoints - * A list of datapoints to be created/updated. - * @type FieldMask $updateMask - * Optional. Update mask is used to specify the fields to be overwritten in - * the datapoints by the update. The fields specified in the update_mask are - * relative to each IndexDatapoint inside datapoints, not the full request. - * - * Updatable fields: - * - * * Use `all_restricts` to update both restricts and numeric_restricts. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\UpsertDatapointsResponse - * - * @throws ApiException if the remote call fails - */ - public function upsertDatapoints($index, array $optionalArgs = []) - { - $request = new UpsertDatapointsRequest(); - $requestParamHeaders = []; - $request->setIndex($index); - $requestParamHeaders['index'] = $index; - if (isset($optionalArgs['datapoints'])) { - $request->setDatapoints($optionalArgs['datapoints']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpsertDatapoints', - UpsertDatapointsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $response = $indexServiceClient->getLocation(); - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $indexServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $indexServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $resource = 'resource'; - * $response = $indexServiceClient->getIamPolicy($resource); - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $indexServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $indexServiceClient = new IndexServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $indexServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $indexServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/JobServiceGapicClient.php b/AiPlatform/src/V1/Gapic/JobServiceGapicClient.php deleted file mode 100644 index 7b9aa5313d05..000000000000 --- a/AiPlatform/src/V1/Gapic/JobServiceGapicClient.php +++ /dev/null @@ -1,3852 +0,0 @@ -batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - * $jobServiceClient->cancelBatchPredictionJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\JobServiceClient}. - */ -class JobServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.JobService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $batchPredictionJobNameTemplate; - - private static $contextNameTemplate; - - private static $customJobNameTemplate; - - private static $dataLabelingJobNameTemplate; - - private static $datasetNameTemplate; - - private static $endpointNameTemplate; - - private static $hyperparameterTuningJobNameTemplate; - - private static $locationNameTemplate; - - private static $modelNameTemplate; - - private static $modelDeploymentMonitoringJobNameTemplate; - - private static $nasJobNameTemplate; - - private static $nasTrialDetailNameTemplate; - - private static $networkNameTemplate; - - private static $notificationChannelNameTemplate; - - private static $persistentResourceNameTemplate; - - private static $projectLocationEndpointNameTemplate; - - private static $projectLocationPublisherModelNameTemplate; - - private static $tensorboardNameTemplate; - - private static $trialNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/job_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/job_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/job_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/job_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getBatchPredictionJobNameTemplate() - { - if (self::$batchPredictionJobNameTemplate == null) { - self::$batchPredictionJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ); - } - - return self::$batchPredictionJobNameTemplate; - } - - private static function getContextNameTemplate() - { - if (self::$contextNameTemplate == null) { - self::$contextNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ); - } - - return self::$contextNameTemplate; - } - - private static function getCustomJobNameTemplate() - { - if (self::$customJobNameTemplate == null) { - self::$customJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ); - } - - return self::$customJobNameTemplate; - } - - private static function getDataLabelingJobNameTemplate() - { - if (self::$dataLabelingJobNameTemplate == null) { - self::$dataLabelingJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ); - } - - return self::$dataLabelingJobNameTemplate; - } - - private static function getDatasetNameTemplate() - { - if (self::$datasetNameTemplate == null) { - self::$datasetNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ); - } - - return self::$datasetNameTemplate; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$endpointNameTemplate; - } - - private static function getHyperparameterTuningJobNameTemplate() - { - if (self::$hyperparameterTuningJobNameTemplate == null) { - self::$hyperparameterTuningJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ); - } - - return self::$hyperparameterTuningJobNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getModelNameTemplate() - { - if (self::$modelNameTemplate == null) { - self::$modelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ); - } - - return self::$modelNameTemplate; - } - - private static function getModelDeploymentMonitoringJobNameTemplate() - { - if (self::$modelDeploymentMonitoringJobNameTemplate == null) { - self::$modelDeploymentMonitoringJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ); - } - - return self::$modelDeploymentMonitoringJobNameTemplate; - } - - private static function getNasJobNameTemplate() - { - if (self::$nasJobNameTemplate == null) { - self::$nasJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ); - } - - return self::$nasJobNameTemplate; - } - - private static function getNasTrialDetailNameTemplate() - { - if (self::$nasTrialDetailNameTemplate == null) { - self::$nasTrialDetailNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ); - } - - return self::$nasTrialDetailNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate( - 'projects/{project}/global/networks/{network}' - ); - } - - return self::$networkNameTemplate; - } - - private static function getNotificationChannelNameTemplate() - { - if (self::$notificationChannelNameTemplate == null) { - self::$notificationChannelNameTemplate = new PathTemplate( - 'projects/{project}/notificationChannels/{notification_channel}' - ); - } - - return self::$notificationChannelNameTemplate; - } - - private static function getPersistentResourceNameTemplate() - { - if (self::$persistentResourceNameTemplate == null) { - self::$persistentResourceNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/persistentResources/{persistent_resource}' - ); - } - - return self::$persistentResourceNameTemplate; - } - - private static function getProjectLocationEndpointNameTemplate() - { - if (self::$projectLocationEndpointNameTemplate == null) { - self::$projectLocationEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$projectLocationEndpointNameTemplate; - } - - private static function getProjectLocationPublisherModelNameTemplate() - { - if (self::$projectLocationPublisherModelNameTemplate == null) { - self::$projectLocationPublisherModelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ); - } - - return self::$projectLocationPublisherModelNameTemplate; - } - - private static function getTensorboardNameTemplate() - { - if (self::$tensorboardNameTemplate == null) { - self::$tensorboardNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ); - } - - return self::$tensorboardNameTemplate; - } - - private static function getTrialNameTemplate() - { - if (self::$trialNameTemplate == null) { - self::$trialNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ); - } - - return self::$trialNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'batchPredictionJob' => self::getBatchPredictionJobNameTemplate(), - 'context' => self::getContextNameTemplate(), - 'customJob' => self::getCustomJobNameTemplate(), - 'dataLabelingJob' => self::getDataLabelingJobNameTemplate(), - 'dataset' => self::getDatasetNameTemplate(), - 'endpoint' => self::getEndpointNameTemplate(), - 'hyperparameterTuningJob' => self::getHyperparameterTuningJobNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'model' => self::getModelNameTemplate(), - 'modelDeploymentMonitoringJob' => self::getModelDeploymentMonitoringJobNameTemplate(), - 'nasJob' => self::getNasJobNameTemplate(), - 'nasTrialDetail' => self::getNasTrialDetailNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'notificationChannel' => self::getNotificationChannelNameTemplate(), - 'persistentResource' => self::getPersistentResourceNameTemplate(), - 'projectLocationEndpoint' => self::getProjectLocationEndpointNameTemplate(), - 'projectLocationPublisherModel' => self::getProjectLocationPublisherModelNameTemplate(), - 'tensorboard' => self::getTensorboardNameTemplate(), - 'trial' => self::getTrialNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * batch_prediction_job resource. - * - * @param string $project - * @param string $location - * @param string $batchPredictionJob - * - * @return string The formatted batch_prediction_job resource. - */ - public static function batchPredictionJobName( - $project, - $location, - $batchPredictionJob - ) { - return self::getBatchPredictionJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'batch_prediction_job' => $batchPredictionJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a context - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $context - * - * @return string The formatted context resource. - */ - public static function contextName( - $project, - $location, - $metadataStore, - $context - ) { - return self::getContextNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a custom_job - * resource. - * - * @param string $project - * @param string $location - * @param string $customJob - * - * @return string The formatted custom_job resource. - */ - public static function customJobName($project, $location, $customJob) - { - return self::getCustomJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'custom_job' => $customJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * data_labeling_job resource. - * - * @param string $project - * @param string $location - * @param string $dataLabelingJob - * - * @return string The formatted data_labeling_job resource. - */ - public static function dataLabelingJobName( - $project, - $location, - $dataLabelingJob - ) { - return self::getDataLabelingJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'data_labeling_job' => $dataLabelingJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a dataset - * resource. - * - * @param string $project - * @param string $location - * @param string $dataset - * - * @return string The formatted dataset resource. - */ - public static function datasetName($project, $location, $dataset) - { - return self::getDatasetNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataset' => $dataset, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName($project, $location, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * hyperparameter_tuning_job resource. - * - * @param string $project - * @param string $location - * @param string $hyperparameterTuningJob - * - * @return string The formatted hyperparameter_tuning_job resource. - */ - public static function hyperparameterTuningJobName( - $project, - $location, - $hyperparameterTuningJob - ) { - return self::getHyperparameterTuningJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'hyperparameter_tuning_job' => $hyperparameterTuningJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName($project, $location, $model) - { - return self::getModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * model_deployment_monitoring_job resource. - * - * @param string $project - * @param string $location - * @param string $modelDeploymentMonitoringJob - * - * @return string The formatted model_deployment_monitoring_job resource. - */ - public static function modelDeploymentMonitoringJobName( - $project, - $location, - $modelDeploymentMonitoringJob - ) { - return self::getModelDeploymentMonitoringJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model_deployment_monitoring_job' => $modelDeploymentMonitoringJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a nas_job - * resource. - * - * @param string $project - * @param string $location - * @param string $nasJob - * - * @return string The formatted nas_job resource. - */ - public static function nasJobName($project, $location, $nasJob) - { - return self::getNasJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'nas_job' => $nasJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * nas_trial_detail resource. - * - * @param string $project - * @param string $location - * @param string $nasJob - * @param string $nasTrialDetail - * - * @return string The formatted nas_trial_detail resource. - */ - public static function nasTrialDetailName( - $project, - $location, - $nasJob, - $nasTrialDetail - ) { - return self::getNasTrialDetailNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'nas_job' => $nasJob, - 'nas_trial_detail' => $nasTrialDetail, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * notification_channel resource. - * - * @param string $project - * @param string $notificationChannel - * - * @return string The formatted notification_channel resource. - */ - public static function notificationChannelName( - $project, - $notificationChannel - ) { - return self::getNotificationChannelNameTemplate()->render([ - 'project' => $project, - 'notification_channel' => $notificationChannel, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * persistent_resource resource. - * - * @param string $project - * @param string $location - * @param string $persistentResource - * - * @return string The formatted persistent_resource resource. - */ - public static function persistentResourceName( - $project, - $location, - $persistentResource - ) { - return self::getPersistentResourceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'persistent_resource' => $persistentResource, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted project_location_endpoint resource. - */ - public static function projectLocationEndpointName( - $project, - $location, - $endpoint - ) { - return self::getProjectLocationEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_publisher_model resource. - * - * @param string $project - * @param string $location - * @param string $publisher - * @param string $model - * - * @return string The formatted project_location_publisher_model resource. - */ - public static function projectLocationPublisherModelName( - $project, - $location, - $publisher, - $model - ) { - return self::getProjectLocationPublisherModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'publisher' => $publisher, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a tensorboard - * resource. - * - * @param string $project - * @param string $location - * @param string $tensorboard - * - * @return string The formatted tensorboard resource. - */ - public static function tensorboardName($project, $location, $tensorboard) - { - return self::getTensorboardNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'tensorboard' => $tensorboard, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a trial - * resource. - * - * @param string $project - * @param string $location - * @param string $study - * @param string $trial - * - * @return string The formatted trial resource. - */ - public static function trialName($project, $location, $study, $trial) - { - return self::getTrialNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'study' => $study, - 'trial' => $trial, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - batchPredictionJob: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job} - * - context: projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context} - * - customJob: projects/{project}/locations/{location}/customJobs/{custom_job} - * - dataLabelingJob: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job} - * - dataset: projects/{project}/locations/{location}/datasets/{dataset} - * - endpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - hyperparameterTuningJob: projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job} - * - location: projects/{project}/locations/{location} - * - model: projects/{project}/locations/{location}/models/{model} - * - modelDeploymentMonitoringJob: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job} - * - nasJob: projects/{project}/locations/{location}/nasJobs/{nas_job} - * - nasTrialDetail: projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail} - * - network: projects/{project}/global/networks/{network} - * - notificationChannel: projects/{project}/notificationChannels/{notification_channel} - * - persistentResource: projects/{project}/locations/{location}/persistentResources/{persistent_resource} - * - projectLocationEndpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - projectLocationPublisherModel: projects/{project}/locations/{location}/publishers/{publisher}/models/{model} - * - tensorboard: projects/{project}/locations/{location}/tensorboards/{tensorboard} - * - trial: projects/{project}/locations/{location}/studies/{study}/trials/{trial} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Cancels a BatchPredictionJob. - * - * Starts asynchronous cancellation on the BatchPredictionJob. The server - * makes the best effort to cancel the job, but success is not - * guaranteed. Clients can use - * [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob] - * or other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On a successful cancellation, - * the BatchPredictionJob is not deleted;instead its - * [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] - * is set to `CANCELLED`. Any files already outputted by the job are not - * deleted. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - * $jobServiceClient->cancelBatchPredictionJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the BatchPredictionJob to cancel. - * Format: - * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function cancelBatchPredictionJob($name, array $optionalArgs = []) - { - $request = new CancelBatchPredictionJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelBatchPredictionJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Cancels a CustomJob. - * Starts asynchronous cancellation on the CustomJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use - * [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob] - * or other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the CustomJob is not deleted; instead it becomes a job with - * a [CustomJob.error][google.cloud.aiplatform.v1.CustomJob.error] value with - * a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`, and - * [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to - * `CANCELLED`. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - * $jobServiceClient->cancelCustomJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the CustomJob to cancel. - * Format: - * `projects/{project}/locations/{location}/customJobs/{custom_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function cancelCustomJob($name, array $optionalArgs = []) - { - $request = new CancelCustomJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelCustomJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - * $jobServiceClient->cancelDataLabelingJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function cancelDataLabelingJob($name, array $optionalArgs = []) - { - $request = new CancelDataLabelingJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelDataLabelingJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Cancels a HyperparameterTuningJob. - * Starts asynchronous cancellation on the HyperparameterTuningJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use - * [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob] - * or other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the HyperparameterTuningJob is not deleted; instead it becomes a job with - * a - * [HyperparameterTuningJob.error][google.cloud.aiplatform.v1.HyperparameterTuningJob.error] - * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`, and - * [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state] - * is set to `CANCELLED`. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - * $jobServiceClient->cancelHyperparameterTuningJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the HyperparameterTuningJob to cancel. - * Format: - * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function cancelHyperparameterTuningJob( - $name, - array $optionalArgs = [] - ) { - $request = new CancelHyperparameterTuningJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelHyperparameterTuningJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Cancels a NasJob. - * Starts asynchronous cancellation on the NasJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use - * [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or - * other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the NasJob is not deleted; instead it becomes a job with - * a [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`, and - * [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to - * `CANCELLED`. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - * $jobServiceClient->cancelNasJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NasJob to cancel. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function cancelNasJob($name, array $optionalArgs = []) - { - $request = new CancelNasJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelNasJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a BatchPredictionJob. A BatchPredictionJob once created will - * right away be attempted to start. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $batchPredictionJob = new BatchPredictionJob(); - * $response = $jobServiceClient->createBatchPredictionJob($formattedParent, $batchPredictionJob); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the - * BatchPredictionJob in. Format: `projects/{project}/locations/{location}` - * @param BatchPredictionJob $batchPredictionJob Required. The BatchPredictionJob to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\BatchPredictionJob - * - * @throws ApiException if the remote call fails - */ - public function createBatchPredictionJob( - $parent, - $batchPredictionJob, - array $optionalArgs = [] - ) { - $request = new CreateBatchPredictionJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBatchPredictionJob($batchPredictionJob); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateBatchPredictionJob', - BatchPredictionJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a CustomJob. A created CustomJob right away - * will be attempted to be run. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $customJob = new CustomJob(); - * $response = $jobServiceClient->createCustomJob($formattedParent, $customJob); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the CustomJob in. - * Format: `projects/{project}/locations/{location}` - * @param CustomJob $customJob Required. The CustomJob to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\CustomJob - * - * @throws ApiException if the remote call fails - */ - public function createCustomJob( - $parent, - $customJob, - array $optionalArgs = [] - ) { - $request = new CreateCustomJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCustomJob($customJob); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateCustomJob', - CustomJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a DataLabelingJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $dataLabelingJob = new DataLabelingJob(); - * $response = $jobServiceClient->createDataLabelingJob($formattedParent, $dataLabelingJob); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param DataLabelingJob $dataLabelingJob Required. The DataLabelingJob to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\DataLabelingJob - * - * @throws ApiException if the remote call fails - */ - public function createDataLabelingJob( - $parent, - $dataLabelingJob, - array $optionalArgs = [] - ) { - $request = new CreateDataLabelingJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDataLabelingJob($dataLabelingJob); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateDataLabelingJob', - DataLabelingJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a HyperparameterTuningJob - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $hyperparameterTuningJob = new HyperparameterTuningJob(); - * $response = $jobServiceClient->createHyperparameterTuningJob($formattedParent, $hyperparameterTuningJob); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the - * HyperparameterTuningJob in. Format: - * `projects/{project}/locations/{location}` - * @param HyperparameterTuningJob $hyperparameterTuningJob Required. The HyperparameterTuningJob to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\HyperparameterTuningJob - * - * @throws ApiException if the remote call fails - */ - public function createHyperparameterTuningJob( - $parent, - $hyperparameterTuningJob, - array $optionalArgs = [] - ) { - $request = new CreateHyperparameterTuningJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setHyperparameterTuningJob($hyperparameterTuningJob); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateHyperparameterTuningJob', - HyperparameterTuningJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a ModelDeploymentMonitoringJob. It will run periodically on a - * configured interval. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $modelDeploymentMonitoringJob = new ModelDeploymentMonitoringJob(); - * $response = $jobServiceClient->createModelDeploymentMonitoringJob($formattedParent, $modelDeploymentMonitoringJob); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param ModelDeploymentMonitoringJob $modelDeploymentMonitoringJob Required. The ModelDeploymentMonitoringJob to create - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob - * - * @throws ApiException if the remote call fails - */ - public function createModelDeploymentMonitoringJob( - $parent, - $modelDeploymentMonitoringJob, - array $optionalArgs = [] - ) { - $request = new CreateModelDeploymentMonitoringJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setModelDeploymentMonitoringJob( - $modelDeploymentMonitoringJob - ); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateModelDeploymentMonitoringJob', - ModelDeploymentMonitoringJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a NasJob - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $nasJob = new NasJob(); - * $response = $jobServiceClient->createNasJob($formattedParent, $nasJob); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the NasJob in. - * Format: `projects/{project}/locations/{location}` - * @param NasJob $nasJob Required. The NasJob to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\NasJob - * - * @throws ApiException if the remote call fails - */ - public function createNasJob($parent, $nasJob, array $optionalArgs = []) - { - $request = new CreateNasJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setNasJob($nasJob); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateNasJob', - NasJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a BatchPredictionJob. Can only be called on jobs that already - * finished. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - * $operationResponse = $jobServiceClient->deleteBatchPredictionJob($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $jobServiceClient->deleteBatchPredictionJob($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $jobServiceClient->resumeOperation($operationName, 'deleteBatchPredictionJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the BatchPredictionJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteBatchPredictionJob($name, array $optionalArgs = []) - { - $request = new DeleteBatchPredictionJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteBatchPredictionJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a CustomJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - * $operationResponse = $jobServiceClient->deleteCustomJob($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $jobServiceClient->deleteCustomJob($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $jobServiceClient->resumeOperation($operationName, 'deleteCustomJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the CustomJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/customJobs/{custom_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteCustomJob($name, array $optionalArgs = []) - { - $request = new DeleteCustomJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteCustomJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a DataLabelingJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - * $operationResponse = $jobServiceClient->deleteDataLabelingJob($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $jobServiceClient->deleteDataLabelingJob($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $jobServiceClient->resumeOperation($operationName, 'deleteDataLabelingJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the DataLabelingJob to be deleted. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDataLabelingJob($name, array $optionalArgs = []) - { - $request = new DeleteDataLabelingJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDataLabelingJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a HyperparameterTuningJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - * $operationResponse = $jobServiceClient->deleteHyperparameterTuningJob($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $jobServiceClient->deleteHyperparameterTuningJob($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $jobServiceClient->resumeOperation($operationName, 'deleteHyperparameterTuningJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the HyperparameterTuningJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteHyperparameterTuningJob( - $name, - array $optionalArgs = [] - ) { - $request = new DeleteHyperparameterTuningJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteHyperparameterTuningJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a ModelDeploymentMonitoringJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - * $operationResponse = $jobServiceClient->deleteModelDeploymentMonitoringJob($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $jobServiceClient->deleteModelDeploymentMonitoringJob($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $jobServiceClient->resumeOperation($operationName, 'deleteModelDeploymentMonitoringJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the model monitoring job to delete. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteModelDeploymentMonitoringJob( - $name, - array $optionalArgs = [] - ) { - $request = new DeleteModelDeploymentMonitoringJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteModelDeploymentMonitoringJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a NasJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - * $operationResponse = $jobServiceClient->deleteNasJob($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $jobServiceClient->deleteNasJob($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $jobServiceClient->resumeOperation($operationName, 'deleteNasJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NasJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteNasJob($name, array $optionalArgs = []) - { - $request = new DeleteNasJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteNasJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets a BatchPredictionJob - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - * $response = $jobServiceClient->getBatchPredictionJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the BatchPredictionJob resource. - * Format: - * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\BatchPredictionJob - * - * @throws ApiException if the remote call fails - */ - public function getBatchPredictionJob($name, array $optionalArgs = []) - { - $request = new GetBatchPredictionJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetBatchPredictionJob', - BatchPredictionJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a CustomJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - * $response = $jobServiceClient->getCustomJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the CustomJob resource. - * Format: - * `projects/{project}/locations/{location}/customJobs/{custom_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\CustomJob - * - * @throws ApiException if the remote call fails - */ - public function getCustomJob($name, array $optionalArgs = []) - { - $request = new GetCustomJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetCustomJob', - CustomJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a DataLabelingJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - * $response = $jobServiceClient->getDataLabelingJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\DataLabelingJob - * - * @throws ApiException if the remote call fails - */ - public function getDataLabelingJob($name, array $optionalArgs = []) - { - $request = new GetDataLabelingJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDataLabelingJob', - DataLabelingJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a HyperparameterTuningJob - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - * $response = $jobServiceClient->getHyperparameterTuningJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the HyperparameterTuningJob resource. - * Format: - * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\HyperparameterTuningJob - * - * @throws ApiException if the remote call fails - */ - public function getHyperparameterTuningJob($name, array $optionalArgs = []) - { - $request = new GetHyperparameterTuningJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetHyperparameterTuningJob', - HyperparameterTuningJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a ModelDeploymentMonitoringJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - * $response = $jobServiceClient->getModelDeploymentMonitoringJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ModelDeploymentMonitoringJob. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob - * - * @throws ApiException if the remote call fails - */ - public function getModelDeploymentMonitoringJob( - $name, - array $optionalArgs = [] - ) { - $request = new GetModelDeploymentMonitoringJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetModelDeploymentMonitoringJob', - ModelDeploymentMonitoringJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a NasJob - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - * $response = $jobServiceClient->getNasJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\NasJob - * - * @throws ApiException if the remote call fails - */ - public function getNasJob($name, array $optionalArgs = []) - { - $request = new GetNasJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetNasJob', - NasJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a NasTrialDetail. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->nasTrialDetailName('[PROJECT]', '[LOCATION]', '[NAS_JOB]', '[NAS_TRIAL_DETAIL]'); - * $response = $jobServiceClient->getNasTrialDetail($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NasTrialDetail resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\NasTrialDetail - * - * @throws ApiException if the remote call fails - */ - public function getNasTrialDetail($name, array $optionalArgs = []) - { - $request = new GetNasTrialDetailRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetNasTrialDetail', - NasTrialDetail::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists BatchPredictionJobs in a Location. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $jobServiceClient->listBatchPredictionJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobServiceClient->listBatchPredictionJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the BatchPredictionJobs - * from. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `model_display_name` supports `=`, `!=` comparisons. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listBatchPredictionJobs($parent, array $optionalArgs = []) - { - $request = new ListBatchPredictionJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListBatchPredictionJobs', - $optionalArgs, - ListBatchPredictionJobsResponse::class, - $request - ); - } - - /** - * Lists CustomJobs in a Location. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $jobServiceClient->listCustomJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobServiceClient->listCustomJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the CustomJobs from. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listCustomJobs($parent, array $optionalArgs = []) - { - $request = new ListCustomJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListCustomJobs', - $optionalArgs, - ListCustomJobsResponse::class, - $request - ); - } - - /** - * Lists DataLabelingJobs in a Location. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $jobServiceClient->listDataLabelingJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobServiceClient->listDataLabelingJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. FieldMask represents a set of - * symbolic field paths. For example, the mask can be `paths: "name"`. The - * "name" here is a field in DataLabelingJob. - * If this field is not set, all fields of the DataLabelingJob are returned. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order by - * default. - * Use `desc` after a field name for descending. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDataLabelingJobs($parent, array $optionalArgs = []) - { - $request = new ListDataLabelingJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDataLabelingJobs', - $optionalArgs, - ListDataLabelingJobsResponse::class, - $request - ); - } - - /** - * Lists HyperparameterTuningJobs in a Location. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $jobServiceClient->listHyperparameterTuningJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobServiceClient->listHyperparameterTuningJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the - * HyperparameterTuningJobs from. Format: - * `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listHyperparameterTuningJobs( - $parent, - array $optionalArgs = [] - ) { - $request = new ListHyperparameterTuningJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListHyperparameterTuningJobs', - $optionalArgs, - ListHyperparameterTuningJobsResponse::class, - $request - ); - } - - /** - * Lists ModelDeploymentMonitoringJobs in a Location. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $jobServiceClient->listModelDeploymentMonitoringJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobServiceClient->listModelDeploymentMonitoringJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listModelDeploymentMonitoringJobs( - $parent, - array $optionalArgs = [] - ) { - $request = new ListModelDeploymentMonitoringJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListModelDeploymentMonitoringJobs', - $optionalArgs, - ListModelDeploymentMonitoringJobsResponse::class, - $request - ); - } - - /** - * Lists NasJobs in a Location. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $jobServiceClient->listNasJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobServiceClient->listNasJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the NasJobs - * from. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listNasJobs($parent, array $optionalArgs = []) - { - $request = new ListNasJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListNasJobs', - $optionalArgs, - ListNasJobsResponse::class, - $request - ); - } - - /** - * List top NasTrialDetails of a NasJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedParent = $jobServiceClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - * // Iterate over pages of elements - * $pagedResponse = $jobServiceClient->listNasTrialDetails($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobServiceClient->listNasTrialDetails($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listNasTrialDetails($parent, array $optionalArgs = []) - { - $request = new ListNasTrialDetailsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListNasTrialDetails', - $optionalArgs, - ListNasTrialDetailsResponse::class, - $request - ); - } - - /** - * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server - * makes a best effort to cancel the job. Will mark - * [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state] - * to 'PAUSED'. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - * $jobServiceClient->pauseModelDeploymentMonitoringJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ModelDeploymentMonitoringJob to pause. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function pauseModelDeploymentMonitoringJob( - $name, - array $optionalArgs = [] - ) { - $request = new PauseModelDeploymentMonitoringJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'PauseModelDeploymentMonitoringJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from - * next scheduled time. A deleted ModelDeploymentMonitoringJob can't be - * resumed. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedName = $jobServiceClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - * $jobServiceClient->resumeModelDeploymentMonitoringJob($formattedName); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ModelDeploymentMonitoringJob to resume. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function resumeModelDeploymentMonitoringJob( - $name, - array $optionalArgs = [] - ) { - $request = new ResumeModelDeploymentMonitoringJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ResumeModelDeploymentMonitoringJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Searches Model Monitoring Statistics generated within a given time window. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $formattedModelDeploymentMonitoringJob = $jobServiceClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - * $deployedModelId = 'deployed_model_id'; - * $objectives = []; - * // Iterate over pages of elements - * $pagedResponse = $jobServiceClient->searchModelDeploymentMonitoringStatsAnomalies($formattedModelDeploymentMonitoringJob, $deployedModelId, $objectives); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobServiceClient->searchModelDeploymentMonitoringStatsAnomalies($formattedModelDeploymentMonitoringJob, $deployedModelId, $objectives); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $modelDeploymentMonitoringJob Required. ModelDeploymentMonitoring Job resource name. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param string $deployedModelId Required. The DeployedModel ID of the - * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. - * @param StatsAnomaliesObjective[] $objectives Required. Objectives of the stats to retrieve. - * @param array $optionalArgs { - * Optional. - * - * @type string $featureDisplayName - * The feature display name. If specified, only return the stats belonging to - * this feature. Format: - * [ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name][google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name], - * example: "user_destination". - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type Timestamp $startTime - * The earliest timestamp of stats being generated. - * If not set, indicates fetching stats till the earliest possible one. - * @type Timestamp $endTime - * The latest timestamp of stats being generated. - * If not set, indicates feching stats till the latest possible one. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function searchModelDeploymentMonitoringStatsAnomalies( - $modelDeploymentMonitoringJob, - $deployedModelId, - $objectives, - array $optionalArgs = [] - ) { - $request = new SearchModelDeploymentMonitoringStatsAnomaliesRequest(); - $requestParamHeaders = []; - $request->setModelDeploymentMonitoringJob( - $modelDeploymentMonitoringJob - ); - $request->setDeployedModelId($deployedModelId); - $request->setObjectives($objectives); - $requestParamHeaders[ - 'model_deployment_monitoring_job' - ] = $modelDeploymentMonitoringJob; - if (isset($optionalArgs['featureDisplayName'])) { - $request->setFeatureDisplayName( - $optionalArgs['featureDisplayName'] - ); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['startTime'])) { - $request->setStartTime($optionalArgs['startTime']); - } - - if (isset($optionalArgs['endTime'])) { - $request->setEndTime($optionalArgs['endTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'SearchModelDeploymentMonitoringStatsAnomalies', - $optionalArgs, - SearchModelDeploymentMonitoringStatsAnomaliesResponse::class, - $request - ); - } - - /** - * Updates a ModelDeploymentMonitoringJob. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $modelDeploymentMonitoringJob = new ModelDeploymentMonitoringJob(); - * $updateMask = new FieldMask(); - * $operationResponse = $jobServiceClient->updateModelDeploymentMonitoringJob($modelDeploymentMonitoringJob, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $jobServiceClient->updateModelDeploymentMonitoringJob($modelDeploymentMonitoringJob, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $jobServiceClient->resumeOperation($operationName, 'updateModelDeploymentMonitoringJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param ModelDeploymentMonitoringJob $modelDeploymentMonitoringJob Required. The model monitoring configuration which replaces the resource on - * the server. - * @param FieldMask $updateMask Required. The update mask is used to specify the fields to be overwritten - * in the ModelDeploymentMonitoringJob resource by the update. The fields - * specified in the update_mask are relative to the resource, not the full - * request. A field will be overwritten if it is in the mask. If the user does - * not provide a mask then only the non-empty fields present in the request - * will be overwritten. Set the update_mask to `*` to override all fields. For - * the objective config, the user can either provide the update mask for - * model_deployment_monitoring_objective_configs or any combination of its - * nested fields, such as: - * model_deployment_monitoring_objective_configs.objective_config.training_dataset. - * - * Updatable fields: - * - * * `display_name` - * * `model_deployment_monitoring_schedule_config` - * * `model_monitoring_alert_config` - * * `logging_sampling_strategy` - * * `labels` - * * `log_ttl` - * * `enable_monitoring_pipeline_logs` - * . and - * * `model_deployment_monitoring_objective_configs` - * . or - * * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` - * * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` - * * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateModelDeploymentMonitoringJob( - $modelDeploymentMonitoringJob, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateModelDeploymentMonitoringJobRequest(); - $requestParamHeaders = []; - $request->setModelDeploymentMonitoringJob( - $modelDeploymentMonitoringJob - ); - $request->setUpdateMask($updateMask); - $requestParamHeaders[ - 'model_deployment_monitoring_job.name' - ] = $modelDeploymentMonitoringJob->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateModelDeploymentMonitoringJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $response = $jobServiceClient->getLocation(); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $jobServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $resource = 'resource'; - * $response = $jobServiceClient->getIamPolicy($resource); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $jobServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $jobServiceClient = new JobServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $jobServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $jobServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/LlmUtilityServiceGapicClient.php b/AiPlatform/src/V1/Gapic/LlmUtilityServiceGapicClient.php deleted file mode 100644 index 7226acea6a35..000000000000 --- a/AiPlatform/src/V1/Gapic/LlmUtilityServiceGapicClient.php +++ /dev/null @@ -1,820 +0,0 @@ -endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $instances = []; - * $response = $llmUtilityServiceClient->computeTokens($formattedEndpoint, $instances); - * } finally { - * $llmUtilityServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\LlmUtilityServiceClient}. - */ -class LlmUtilityServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.LlmUtilityService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $endpointNameTemplate; - - private static $projectLocationEndpointNameTemplate; - - private static $projectLocationPublisherModelNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/llm_utility_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/llm_utility_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/llm_utility_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/llm_utility_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$endpointNameTemplate; - } - - private static function getProjectLocationEndpointNameTemplate() - { - if (self::$projectLocationEndpointNameTemplate == null) { - self::$projectLocationEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$projectLocationEndpointNameTemplate; - } - - private static function getProjectLocationPublisherModelNameTemplate() - { - if (self::$projectLocationPublisherModelNameTemplate == null) { - self::$projectLocationPublisherModelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ); - } - - return self::$projectLocationPublisherModelNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'endpoint' => self::getEndpointNameTemplate(), - 'projectLocationEndpoint' => self::getProjectLocationEndpointNameTemplate(), - 'projectLocationPublisherModel' => self::getProjectLocationPublisherModelNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName($project, $location, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted project_location_endpoint resource. - */ - public static function projectLocationEndpointName( - $project, - $location, - $endpoint - ) { - return self::getProjectLocationEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_publisher_model resource. - * - * @param string $project - * @param string $location - * @param string $publisher - * @param string $model - * - * @return string The formatted project_location_publisher_model resource. - */ - public static function projectLocationPublisherModelName( - $project, - $location, - $publisher, - $model - ) { - return self::getProjectLocationPublisherModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'publisher' => $publisher, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - endpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - projectLocationEndpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - projectLocationPublisherModel: projects/{project}/locations/{location}/publishers/{publisher}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Return a list of tokens based on the input text. - * - * Sample code: - * ``` - * $llmUtilityServiceClient = new LlmUtilityServiceClient(); - * try { - * $formattedEndpoint = $llmUtilityServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $instances = []; - * $response = $llmUtilityServiceClient->computeTokens($formattedEndpoint, $instances); - * } finally { - * $llmUtilityServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint requested to get lists of tokens and - * token ids. - * @param Value[] $instances Required. The instances that are the input to token computing API call. - * Schema is identical to the prediction schema of the text model, even for - * the non-text models, like chat models, or Codey models. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ComputeTokensResponse - * - * @throws ApiException if the remote call fails - */ - public function computeTokens( - $endpoint, - $instances, - array $optionalArgs = [] - ) { - $request = new ComputeTokensRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setInstances($instances); - $requestParamHeaders['endpoint'] = $endpoint; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ComputeTokens', - ComputeTokensResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Perform a token counting. - * - * Sample code: - * ``` - * $llmUtilityServiceClient = new LlmUtilityServiceClient(); - * try { - * $formattedEndpoint = $llmUtilityServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $model = 'model'; - * $instances = []; - * $contents = []; - * $response = $llmUtilityServiceClient->countTokens($formattedEndpoint, $model, $instances, $contents); - * } finally { - * $llmUtilityServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint requested to perform token counting. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param string $model Required. The name of the publisher model requested to serve the - * prediction. Format: - * `projects/{project}/locations/{location}/publishers/*/models/*` - * @param Value[] $instances Required. The instances that are the input to token counting call. - * Schema is identical to the prediction schema of the underlying model. - * @param Content[] $contents Required. Input content. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\CountTokensResponse - * - * @throws ApiException if the remote call fails - */ - public function countTokens( - $endpoint, - $model, - $instances, - $contents, - array $optionalArgs = [] - ) { - $request = new CountTokensRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setModel($model); - $request->setInstances($instances); - $request->setContents($contents); - $requestParamHeaders['endpoint'] = $endpoint; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CountTokens', - CountTokensResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $llmUtilityServiceClient = new LlmUtilityServiceClient(); - * try { - * $response = $llmUtilityServiceClient->getLocation(); - * } finally { - * $llmUtilityServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $llmUtilityServiceClient = new LlmUtilityServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $llmUtilityServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $llmUtilityServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $llmUtilityServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $llmUtilityServiceClient = new LlmUtilityServiceClient(); - * try { - * $resource = 'resource'; - * $response = $llmUtilityServiceClient->getIamPolicy($resource); - * } finally { - * $llmUtilityServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $llmUtilityServiceClient = new LlmUtilityServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $llmUtilityServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $llmUtilityServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $llmUtilityServiceClient = new LlmUtilityServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $llmUtilityServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $llmUtilityServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/MatchServiceGapicClient.php b/AiPlatform/src/V1/Gapic/MatchServiceGapicClient.php deleted file mode 100644 index f70e2a320d41..000000000000 --- a/AiPlatform/src/V1/Gapic/MatchServiceGapicClient.php +++ /dev/null @@ -1,762 +0,0 @@ -indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - * $response = $matchServiceClient->findNeighbors($formattedIndexEndpoint); - * } finally { - * $matchServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\MatchServiceClient}. - */ -class MatchServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.MatchService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $indexEndpointNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/match_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/match_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/match_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/match_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getIndexEndpointNameTemplate() - { - if (self::$indexEndpointNameTemplate == null) { - self::$indexEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ); - } - - return self::$indexEndpointNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'indexEndpoint' => self::getIndexEndpointNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * index_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $indexEndpoint - * - * @return string The formatted index_endpoint resource. - */ - public static function indexEndpointName( - $project, - $location, - $indexEndpoint - ) { - return self::getIndexEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'index_endpoint' => $indexEndpoint, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - indexEndpoint: projects/{project}/locations/{location}/indexEndpoints/{index_endpoint} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Finds the nearest neighbors of each vector within the request. - * - * Sample code: - * ``` - * $matchServiceClient = new MatchServiceClient(); - * try { - * $formattedIndexEndpoint = $matchServiceClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - * $response = $matchServiceClient->findNeighbors($formattedIndexEndpoint); - * } finally { - * $matchServiceClient->close(); - * } - * ``` - * - * @param string $indexEndpoint Required. The name of the index endpoint. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type string $deployedIndexId - * The ID of the DeployedIndex that will serve the request. This request is - * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That - * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index - * has a DeployedIndex.id field. - * The value of the field below must equal one of the DeployedIndex.id - * fields of the IndexEndpoint that is being called for this request. - * @type Query[] $queries - * The list of queries. - * @type bool $returnFullDatapoint - * If set to true, the full datapoints (including all vector values and - * restricts) of the nearest neighbors are returned. - * Note that returning full datapoint will significantly increase the - * latency and cost of the query. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\FindNeighborsResponse - * - * @throws ApiException if the remote call fails - */ - public function findNeighbors($indexEndpoint, array $optionalArgs = []) - { - $request = new FindNeighborsRequest(); - $requestParamHeaders = []; - $request->setIndexEndpoint($indexEndpoint); - $requestParamHeaders['index_endpoint'] = $indexEndpoint; - if (isset($optionalArgs['deployedIndexId'])) { - $request->setDeployedIndexId($optionalArgs['deployedIndexId']); - } - - if (isset($optionalArgs['queries'])) { - $request->setQueries($optionalArgs['queries']); - } - - if (isset($optionalArgs['returnFullDatapoint'])) { - $request->setReturnFullDatapoint( - $optionalArgs['returnFullDatapoint'] - ); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'FindNeighbors', - FindNeighborsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Reads the datapoints/vectors of the given IDs. - * A maximum of 1000 datapoints can be retrieved in a batch. - * - * Sample code: - * ``` - * $matchServiceClient = new MatchServiceClient(); - * try { - * $formattedIndexEndpoint = $matchServiceClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - * $response = $matchServiceClient->readIndexDatapoints($formattedIndexEndpoint); - * } finally { - * $matchServiceClient->close(); - * } - * ``` - * - * @param string $indexEndpoint Required. The name of the index endpoint. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type string $deployedIndexId - * The ID of the DeployedIndex that will serve the request. - * @type string[] $ids - * IDs of the datapoints to be searched for. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ReadIndexDatapointsResponse - * - * @throws ApiException if the remote call fails - */ - public function readIndexDatapoints( - $indexEndpoint, - array $optionalArgs = [] - ) { - $request = new ReadIndexDatapointsRequest(); - $requestParamHeaders = []; - $request->setIndexEndpoint($indexEndpoint); - $requestParamHeaders['index_endpoint'] = $indexEndpoint; - if (isset($optionalArgs['deployedIndexId'])) { - $request->setDeployedIndexId($optionalArgs['deployedIndexId']); - } - - if (isset($optionalArgs['ids'])) { - $request->setIds($optionalArgs['ids']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ReadIndexDatapoints', - ReadIndexDatapointsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $matchServiceClient = new MatchServiceClient(); - * try { - * $response = $matchServiceClient->getLocation(); - * } finally { - * $matchServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $matchServiceClient = new MatchServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $matchServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $matchServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $matchServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $matchServiceClient = new MatchServiceClient(); - * try { - * $resource = 'resource'; - * $response = $matchServiceClient->getIamPolicy($resource); - * } finally { - * $matchServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $matchServiceClient = new MatchServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $matchServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $matchServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $matchServiceClient = new MatchServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $matchServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $matchServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/MetadataServiceGapicClient.php b/AiPlatform/src/V1/Gapic/MetadataServiceGapicClient.php deleted file mode 100644 index 6c1617c8240d..000000000000 --- a/AiPlatform/src/V1/Gapic/MetadataServiceGapicClient.php +++ /dev/null @@ -1,3302 +0,0 @@ -contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - * $response = $metadataServiceClient->addContextArtifactsAndExecutions($formattedContext); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient}. - */ -class MetadataServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.MetadataService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $artifactNameTemplate; - - private static $contextNameTemplate; - - private static $executionNameTemplate; - - private static $locationNameTemplate; - - private static $metadataSchemaNameTemplate; - - private static $metadataStoreNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/metadata_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/metadata_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/metadata_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/metadata_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getArtifactNameTemplate() - { - if (self::$artifactNameTemplate == null) { - self::$artifactNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ); - } - - return self::$artifactNameTemplate; - } - - private static function getContextNameTemplate() - { - if (self::$contextNameTemplate == null) { - self::$contextNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ); - } - - return self::$contextNameTemplate; - } - - private static function getExecutionNameTemplate() - { - if (self::$executionNameTemplate == null) { - self::$executionNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ); - } - - return self::$executionNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getMetadataSchemaNameTemplate() - { - if (self::$metadataSchemaNameTemplate == null) { - self::$metadataSchemaNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ); - } - - return self::$metadataSchemaNameTemplate; - } - - private static function getMetadataStoreNameTemplate() - { - if (self::$metadataStoreNameTemplate == null) { - self::$metadataStoreNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ); - } - - return self::$metadataStoreNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'artifact' => self::getArtifactNameTemplate(), - 'context' => self::getContextNameTemplate(), - 'execution' => self::getExecutionNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'metadataSchema' => self::getMetadataSchemaNameTemplate(), - 'metadataStore' => self::getMetadataStoreNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a artifact - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $artifact - * - * @return string The formatted artifact resource. - */ - public static function artifactName( - $project, - $location, - $metadataStore, - $artifact - ) { - return self::getArtifactNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'artifact' => $artifact, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a context - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $context - * - * @return string The formatted context resource. - */ - public static function contextName( - $project, - $location, - $metadataStore, - $context - ) { - return self::getContextNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a execution - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $execution - * - * @return string The formatted execution resource. - */ - public static function executionName( - $project, - $location, - $metadataStore, - $execution - ) { - return self::getExecutionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'execution' => $execution, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * metadata_schema resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $metadataSchema - * - * @return string The formatted metadata_schema resource. - */ - public static function metadataSchemaName( - $project, - $location, - $metadataStore, - $metadataSchema - ) { - return self::getMetadataSchemaNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'metadata_schema' => $metadataSchema, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * metadata_store resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * - * @return string The formatted metadata_store resource. - */ - public static function metadataStoreName( - $project, - $location, - $metadataStore - ) { - return self::getMetadataStoreNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - artifact: projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact} - * - context: projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context} - * - execution: projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution} - * - location: projects/{project}/locations/{location} - * - metadataSchema: projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema} - * - metadataStore: projects/{project}/locations/{location}/metadataStores/{metadata_store} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Adds a set of Artifacts and Executions to a Context. If any of the - * Artifacts or Executions have already been added to a Context, they are - * simply skipped. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedContext = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - * $response = $metadataServiceClient->addContextArtifactsAndExecutions($formattedContext); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $context Required. The resource name of the Context that the Artifacts and - * Executions belong to. Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param array $optionalArgs { - * Optional. - * - * @type string[] $artifacts - * The resource names of the Artifacts to attribute to the Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @type string[] $executions - * The resource names of the Executions to associate with the - * Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsResponse - * - * @throws ApiException if the remote call fails - */ - public function addContextArtifactsAndExecutions( - $context, - array $optionalArgs = [] - ) { - $request = new AddContextArtifactsAndExecutionsRequest(); - $requestParamHeaders = []; - $request->setContext($context); - $requestParamHeaders['context'] = $context; - if (isset($optionalArgs['artifacts'])) { - $request->setArtifacts($optionalArgs['artifacts']); - } - - if (isset($optionalArgs['executions'])) { - $request->setExecutions($optionalArgs['executions']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'AddContextArtifactsAndExecutions', - AddContextArtifactsAndExecutionsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Adds a set of Contexts as children to a parent Context. If any of the - * child Contexts have already been added to the parent Context, they are - * simply skipped. If this call would create a cycle or cause any Context to - * have more than 10 parents, the request will fail with an INVALID_ARGUMENT - * error. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedContext = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - * $response = $metadataServiceClient->addContextChildren($formattedContext); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $context Required. The resource name of the parent Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param array $optionalArgs { - * Optional. - * - * @type string[] $childContexts - * The resource names of the child Contexts. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\AddContextChildrenResponse - * - * @throws ApiException if the remote call fails - */ - public function addContextChildren($context, array $optionalArgs = []) - { - $request = new AddContextChildrenRequest(); - $requestParamHeaders = []; - $request->setContext($context); - $requestParamHeaders['context'] = $context; - if (isset($optionalArgs['childContexts'])) { - $request->setChildContexts($optionalArgs['childContexts']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'AddContextChildren', - AddContextChildrenResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Adds Events to the specified Execution. An Event indicates whether an - * Artifact was used as an input or output for an Execution. If an Event - * already exists between the Execution and the Artifact, the Event is - * skipped. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedExecution = $metadataServiceClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - * $response = $metadataServiceClient->addExecutionEvents($formattedExecution); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $execution Required. The resource name of the Execution that the Events connect - * Artifacts with. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param array $optionalArgs { - * Optional. - * - * @type Event[] $events - * The Events to create and add. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\AddExecutionEventsResponse - * - * @throws ApiException if the remote call fails - */ - public function addExecutionEvents($execution, array $optionalArgs = []) - { - $request = new AddExecutionEventsRequest(); - $requestParamHeaders = []; - $request->setExecution($execution); - $requestParamHeaders['execution'] = $execution; - if (isset($optionalArgs['events'])) { - $request->setEvents($optionalArgs['events']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'AddExecutionEvents', - AddExecutionEventsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates an Artifact associated with a MetadataStore. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * $artifact = new Artifact(); - * $response = $metadataServiceClient->createArtifact($formattedParent, $artifact); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the MetadataStore where the Artifact should - * be created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param Artifact $artifact Required. The Artifact to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $artifactId - * The {artifact} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * If not provided, the Artifact's ID will be a UUID generated by the service. - * Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - * Must be unique across all Artifacts in the parent MetadataStore. (Otherwise - * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - * caller can't view the preexisting Artifact.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Artifact - * - * @throws ApiException if the remote call fails - */ - public function createArtifact($parent, $artifact, array $optionalArgs = []) - { - $request = new CreateArtifactRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setArtifact($artifact); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['artifactId'])) { - $request->setArtifactId($optionalArgs['artifactId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateArtifact', - Artifact::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a Context associated with a MetadataStore. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * $context = new Context(); - * $response = $metadataServiceClient->createContext($formattedParent, $context); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the MetadataStore where the Context should - * be created. Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param Context $context Required. The Context to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $contextId - * The {context} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. - * If not provided, the Context's ID will be a UUID generated by the service. - * Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - * Must be unique across all Contexts in the parent MetadataStore. (Otherwise - * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - * caller can't view the preexisting Context.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Context - * - * @throws ApiException if the remote call fails - */ - public function createContext($parent, $context, array $optionalArgs = []) - { - $request = new CreateContextRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setContext($context); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['contextId'])) { - $request->setContextId($optionalArgs['contextId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateContext', - Context::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates an Execution associated with a MetadataStore. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * $execution = new Execution(); - * $response = $metadataServiceClient->createExecution($formattedParent, $execution); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the MetadataStore where the Execution should - * be created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param Execution $execution Required. The Execution to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $executionId - * The {execution} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * If not provided, the Execution's ID will be a UUID generated by the - * service. - * Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - * Must be unique across all Executions in the parent MetadataStore. - * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - * if the caller can't view the preexisting Execution.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Execution - * - * @throws ApiException if the remote call fails - */ - public function createExecution( - $parent, - $execution, - array $optionalArgs = [] - ) { - $request = new CreateExecutionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setExecution($execution); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['executionId'])) { - $request->setExecutionId($optionalArgs['executionId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateExecution', - Execution::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a MetadataSchema. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * $metadataSchema = new MetadataSchema(); - * $response = $metadataServiceClient->createMetadataSchema($formattedParent, $metadataSchema); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the MetadataStore where the MetadataSchema - * should be created. Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param MetadataSchema $metadataSchema Required. The MetadataSchema to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $metadataSchemaId - * The {metadata_schema} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - * If not provided, the MetadataStore's ID will be a UUID generated by the - * service. - * Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - * Must be unique across all MetadataSchemas in the parent Location. - * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - * if the caller can't view the preexisting MetadataSchema.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\MetadataSchema - * - * @throws ApiException if the remote call fails - */ - public function createMetadataSchema( - $parent, - $metadataSchema, - array $optionalArgs = [] - ) { - $request = new CreateMetadataSchemaRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMetadataSchema($metadataSchema); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['metadataSchemaId'])) { - $request->setMetadataSchemaId($optionalArgs['metadataSchemaId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateMetadataSchema', - MetadataSchema::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Initializes a MetadataStore, including allocation of resources. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $metadataStore = new MetadataStore(); - * $operationResponse = $metadataServiceClient->createMetadataStore($formattedParent, $metadataStore); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $metadataServiceClient->createMetadataStore($formattedParent, $metadataStore); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'createMetadataStore'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location where the MetadataStore should - * be created. - * Format: `projects/{project}/locations/{location}/` - * @param MetadataStore $metadataStore Required. The MetadataStore to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $metadataStoreId - * The {metadatastore} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * If not provided, the MetadataStore's ID will be a UUID generated by the - * service. - * Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - * Must be unique across all MetadataStores in the parent Location. - * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - * if the caller can't view the preexisting MetadataStore.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createMetadataStore( - $parent, - $metadataStore, - array $optionalArgs = [] - ) { - $request = new CreateMetadataStoreRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMetadataStore($metadataStore); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['metadataStoreId'])) { - $request->setMetadataStoreId($optionalArgs['metadataStoreId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateMetadataStore', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes an Artifact. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - * $operationResponse = $metadataServiceClient->deleteArtifact($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $metadataServiceClient->deleteArtifact($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'deleteArtifact'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Artifact to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. The etag of the Artifact to delete. - * If this is provided, it must match the server's etag. Otherwise, the - * request will fail with a FAILED_PRECONDITION. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteArtifact($name, array $optionalArgs = []) - { - $request = new DeleteArtifactRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteArtifact', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a stored Context. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - * $operationResponse = $metadataServiceClient->deleteContext($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $metadataServiceClient->deleteContext($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'deleteContext'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Context to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * The force deletion semantics is still undefined. - * Users should not use this field. - * @type string $etag - * Optional. The etag of the Context to delete. - * If this is provided, it must match the server's etag. Otherwise, the - * request will fail with a FAILED_PRECONDITION. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteContext($name, array $optionalArgs = []) - { - $request = new DeleteContextRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteContext', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes an Execution. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - * $operationResponse = $metadataServiceClient->deleteExecution($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $metadataServiceClient->deleteExecution($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'deleteExecution'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. The etag of the Execution to delete. - * If this is provided, it must match the server's etag. Otherwise, the - * request will fail with a FAILED_PRECONDITION. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteExecution($name, array $optionalArgs = []) - { - $request = new DeleteExecutionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteExecution', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single MetadataStore and all its child resources (Artifacts, - * Executions, and Contexts). - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * $operationResponse = $metadataServiceClient->deleteMetadataStore($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $metadataServiceClient->deleteMetadataStore($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'deleteMetadataStore'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the MetadataStore to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * Deprecated: Field is no longer supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteMetadataStore($name, array $optionalArgs = []) - { - $request = new DeleteMetadataStoreRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteMetadataStore', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Retrieves a specific Artifact. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - * $response = $metadataServiceClient->getArtifact($formattedName); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Artifact to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Artifact - * - * @throws ApiException if the remote call fails - */ - public function getArtifact($name, array $optionalArgs = []) - { - $request = new GetArtifactRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetArtifact', - Artifact::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a specific Context. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - * $response = $metadataServiceClient->getContext($formattedName); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Context to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Context - * - * @throws ApiException if the remote call fails - */ - public function getContext($name, array $optionalArgs = []) - { - $request = new GetContextRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetContext', - Context::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a specific Execution. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - * $response = $metadataServiceClient->getExecution($formattedName); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Execution to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Execution - * - * @throws ApiException if the remote call fails - */ - public function getExecution($name, array $optionalArgs = []) - { - $request = new GetExecutionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetExecution', - Execution::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a specific MetadataSchema. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->metadataSchemaName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[METADATA_SCHEMA]'); - * $response = $metadataServiceClient->getMetadataSchema($formattedName); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the MetadataSchema to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\MetadataSchema - * - * @throws ApiException if the remote call fails - */ - public function getMetadataSchema($name, array $optionalArgs = []) - { - $request = new GetMetadataSchemaRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetMetadataSchema', - MetadataSchema::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a specific MetadataStore. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * $response = $metadataServiceClient->getMetadataStore($formattedName); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the MetadataStore to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\MetadataStore - * - * @throws ApiException if the remote call fails - */ - public function getMetadataStore($name, array $optionalArgs = []) - { - $request = new GetMetadataStoreRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetMetadataStore', - MetadataStore::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists Artifacts in the MetadataStore. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * // Iterate over pages of elements - * $pagedResponse = $metadataServiceClient->listArtifacts($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metadataServiceClient->listArtifacts($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The MetadataStore whose Artifacts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * In case the field name contains special characters (such as colon), one - * can embed it inside double quote. - * For example: `metadata."field:1".number_value = 10.0` - * * **Context based filtering**: - * To filter Artifacts based on the contexts to which they belong, use the - * function operator with the full resource name - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @type string $orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listArtifacts($parent, array $optionalArgs = []) - { - $request = new ListArtifactsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListArtifacts', - $optionalArgs, - ListArtifactsResponse::class, - $request - ); - } - - /** - * Lists Contexts on the MetadataStore. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * // Iterate over pages of elements - * $pagedResponse = $metadataServiceClient->listContexts($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metadataServiceClient->listContexts($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The MetadataStore whose Contexts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Filter specifying the boolean condition for the Contexts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `schema_title`, - * `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0`. - * In case the field name contains special characters (such as colon), one - * can embed it inside double quote. - * For example: `metadata."field:1".number_value = 10.0` - * * **Parent Child filtering**: - * To filter Contexts based on parent-child relationship use the HAS - * operator as follows: - * - * ``` - * parent_contexts: - * "projects//locations//metadataStores//contexts/" - * child_contexts: - * "projects//locations//metadataStores//contexts/" - * ``` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @type string $orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listContexts($parent, array $optionalArgs = []) - { - $request = new ListContextsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListContexts', - $optionalArgs, - ListContextsResponse::class, - $request - ); - } - - /** - * Lists Executions in the MetadataStore. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * // Iterate over pages of elements - * $pagedResponse = $metadataServiceClient->listExecutions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metadataServiceClient->listExecutions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The MetadataStore whose Executions should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Filter specifying the boolean condition for the Executions to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..` - * For example: `metadata.field_1.number_value = 10.0` - * In case the field name contains special characters (such as colon), one - * can embed it inside double quote. - * For example: `metadata."field:1".number_value = 10.0` - * * **Context based filtering**: - * To filter Executions based on the contexts to which they belong use - * the function operator with the full resource name: - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @type string $orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listExecutions($parent, array $optionalArgs = []) - { - $request = new ListExecutionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListExecutions', - $optionalArgs, - ListExecutionsResponse::class, - $request - ); - } - - /** - * Lists MetadataSchemas. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * // Iterate over pages of elements - * $pagedResponse = $metadataServiceClient->listMetadataSchemas($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metadataServiceClient->listMetadataSchemas($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The MetadataStore whose MetadataSchemas should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * A query to filter available MetadataSchemas for matching results. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listMetadataSchemas($parent, array $optionalArgs = []) - { - $request = new ListMetadataSchemasRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListMetadataSchemas', - $optionalArgs, - ListMetadataSchemasResponse::class, - $request - ); - } - - /** - * Lists MetadataStores for a Location. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $metadataServiceClient->listMetadataStores($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metadataServiceClient->listMetadataStores($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The Location whose MetadataStores should be listed. - * Format: - * `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listMetadataStores($parent, array $optionalArgs = []) - { - $request = new ListMetadataStoresRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListMetadataStores', - $optionalArgs, - ListMetadataStoresResponse::class, - $request - ); - } - - /** - * Purges Artifacts. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * $filter = 'filter'; - * $operationResponse = $metadataServiceClient->purgeArtifacts($formattedParent, $filter); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $metadataServiceClient->purgeArtifacts($formattedParent, $filter); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'purgeArtifacts'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The metadata store to purge Artifacts from. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param string $filter Required. A required filter matching the Artifacts to be purged. - * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * Optional. Flag to indicate to actually perform the purge. - * If `force` is set to false, the method will return a sample of - * Artifact names that would be deleted. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function purgeArtifacts($parent, $filter, array $optionalArgs = []) - { - $request = new PurgeArtifactsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFilter($filter); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'PurgeArtifacts', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Purges Contexts. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * $filter = 'filter'; - * $operationResponse = $metadataServiceClient->purgeContexts($formattedParent, $filter); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $metadataServiceClient->purgeContexts($formattedParent, $filter); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'purgeContexts'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The metadata store to purge Contexts from. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param string $filter Required. A required filter matching the Contexts to be purged. - * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * Optional. Flag to indicate to actually perform the purge. - * If `force` is set to false, the method will return a sample of - * Context names that would be deleted. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function purgeContexts($parent, $filter, array $optionalArgs = []) - { - $request = new PurgeContextsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFilter($filter); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'PurgeContexts', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Purges Executions. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - * $filter = 'filter'; - * $operationResponse = $metadataServiceClient->purgeExecutions($formattedParent, $filter); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $metadataServiceClient->purgeExecutions($formattedParent, $filter); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'purgeExecutions'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The metadata store to purge Executions from. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param string $filter Required. A required filter matching the Executions to be purged. - * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * Optional. Flag to indicate to actually perform the purge. - * If `force` is set to false, the method will return a sample of - * Execution names that would be deleted. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function purgeExecutions($parent, $filter, array $optionalArgs = []) - { - $request = new PurgeExecutionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFilter($filter); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'PurgeExecutions', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Retrieves lineage of an Artifact represented through Artifacts and - * Executions connected by Event edges and returned as a LineageSubgraph. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedArtifact = $metadataServiceClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - * $response = $metadataServiceClient->queryArtifactLineageSubgraph($formattedArtifact); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $artifact Required. The resource name of the Artifact whose Lineage needs to be - * retrieved as a LineageSubgraph. Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * - * The request may error with FAILED_PRECONDITION if the number of Artifacts, - * the number of Executions, or the number of Events that would be returned - * for the Context exceeds 1000. - * @param array $optionalArgs { - * Optional. - * - * @type int $maxHops - * Specifies the size of the lineage graph in terms of number of hops from the - * specified artifact. - * Negative Value: INVALID_ARGUMENT error is returned - * 0: Only input artifact is returned. - * No value: Transitive closure is performed to return the complete graph. - * @type string $filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the Lineage Subgraph. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"` - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * In case the field name contains special characters (such as colon), one - * can embed it inside double quote. - * For example: `metadata."field:1".number_value = 10.0` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\LineageSubgraph - * - * @throws ApiException if the remote call fails - */ - public function queryArtifactLineageSubgraph( - $artifact, - array $optionalArgs = [] - ) { - $request = new QueryArtifactLineageSubgraphRequest(); - $requestParamHeaders = []; - $request->setArtifact($artifact); - $requestParamHeaders['artifact'] = $artifact; - if (isset($optionalArgs['maxHops'])) { - $request->setMaxHops($optionalArgs['maxHops']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'QueryArtifactLineageSubgraph', - LineageSubgraph::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves Artifacts and Executions within the specified Context, connected - * by Event edges and returned as a LineageSubgraph. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedContext = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - * $response = $metadataServiceClient->queryContextLineageSubgraph($formattedContext); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $context Required. The resource name of the Context whose Artifacts and Executions - * should be retrieved as a LineageSubgraph. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * - * The request may error with FAILED_PRECONDITION if the number of Artifacts, - * the number of Executions, or the number of Events that would be returned - * for the Context exceeds 1000. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\LineageSubgraph - * - * @throws ApiException if the remote call fails - */ - public function queryContextLineageSubgraph( - $context, - array $optionalArgs = [] - ) { - $request = new QueryContextLineageSubgraphRequest(); - $requestParamHeaders = []; - $request->setContext($context); - $requestParamHeaders['context'] = $context; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'QueryContextLineageSubgraph', - LineageSubgraph::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Obtains the set of input and output Artifacts for this Execution, in the - * form of LineageSubgraph that also contains the Execution and connecting - * Events. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedExecution = $metadataServiceClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - * $response = $metadataServiceClient->queryExecutionInputsAndOutputs($formattedExecution); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $execution Required. The resource name of the Execution whose input and output - * Artifacts should be retrieved as a LineageSubgraph. Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\LineageSubgraph - * - * @throws ApiException if the remote call fails - */ - public function queryExecutionInputsAndOutputs( - $execution, - array $optionalArgs = [] - ) { - $request = new QueryExecutionInputsAndOutputsRequest(); - $requestParamHeaders = []; - $request->setExecution($execution); - $requestParamHeaders['execution'] = $execution; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'QueryExecutionInputsAndOutputs', - LineageSubgraph::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Remove a set of children contexts from a parent Context. If any of the - * child Contexts were NOT added to the parent Context, they are - * simply skipped. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedContext = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - * $response = $metadataServiceClient->removeContextChildren($formattedContext); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $context Required. The resource name of the parent Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param array $optionalArgs { - * Optional. - * - * @type string[] $childContexts - * The resource names of the child Contexts. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\RemoveContextChildrenResponse - * - * @throws ApiException if the remote call fails - */ - public function removeContextChildren($context, array $optionalArgs = []) - { - $request = new RemoveContextChildrenRequest(); - $requestParamHeaders = []; - $request->setContext($context); - $requestParamHeaders['context'] = $context; - if (isset($optionalArgs['childContexts'])) { - $request->setChildContexts($optionalArgs['childContexts']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'RemoveContextChildren', - RemoveContextChildrenResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a stored Artifact. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $artifact = new Artifact(); - * $response = $metadataServiceClient->updateArtifact($artifact); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param Artifact $artifact Required. The Artifact containing updates. - * The Artifact's [Artifact.name][google.cloud.aiplatform.v1.Artifact.name] - * field is used to identify the Artifact to be updated. Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. A FieldMask indicating which fields should be updated. - * @type bool $allowMissing - * If set to true, and the [Artifact][google.cloud.aiplatform.v1.Artifact] is - * not found, a new [Artifact][google.cloud.aiplatform.v1.Artifact] is - * created. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Artifact - * - * @throws ApiException if the remote call fails - */ - public function updateArtifact($artifact, array $optionalArgs = []) - { - $request = new UpdateArtifactRequest(); - $requestParamHeaders = []; - $request->setArtifact($artifact); - $requestParamHeaders['artifact.name'] = $artifact->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateArtifact', - Artifact::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a stored Context. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $context = new Context(); - * $response = $metadataServiceClient->updateContext($context); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param Context $context Required. The Context containing updates. - * The Context's [Context.name][google.cloud.aiplatform.v1.Context.name] field - * is used to identify the Context to be updated. Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. A FieldMask indicating which fields should be updated. - * @type bool $allowMissing - * If set to true, and the [Context][google.cloud.aiplatform.v1.Context] is - * not found, a new [Context][google.cloud.aiplatform.v1.Context] is created. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Context - * - * @throws ApiException if the remote call fails - */ - public function updateContext($context, array $optionalArgs = []) - { - $request = new UpdateContextRequest(); - $requestParamHeaders = []; - $request->setContext($context); - $requestParamHeaders['context.name'] = $context->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateContext', - Context::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a stored Execution. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $execution = new Execution(); - * $response = $metadataServiceClient->updateExecution($execution); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param Execution $execution Required. The Execution containing updates. - * The Execution's [Execution.name][google.cloud.aiplatform.v1.Execution.name] - * field is used to identify the Execution to be updated. Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. A FieldMask indicating which fields should be updated. - * @type bool $allowMissing - * If set to true, and the [Execution][google.cloud.aiplatform.v1.Execution] - * is not found, a new [Execution][google.cloud.aiplatform.v1.Execution] is - * created. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Execution - * - * @throws ApiException if the remote call fails - */ - public function updateExecution($execution, array $optionalArgs = []) - { - $request = new UpdateExecutionRequest(); - $requestParamHeaders = []; - $request->setExecution($execution); - $requestParamHeaders['execution.name'] = $execution->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateExecution', - Execution::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $response = $metadataServiceClient->getLocation(); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $metadataServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metadataServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $resource = 'resource'; - * $response = $metadataServiceClient->getIamPolicy($resource); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $metadataServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $metadataServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/MigrationServiceGapicClient.php b/AiPlatform/src/V1/Gapic/MigrationServiceGapicClient.php deleted file mode 100644 index 456549e003ad..000000000000 --- a/AiPlatform/src/V1/Gapic/MigrationServiceGapicClient.php +++ /dev/null @@ -1,1002 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $migrateResourceRequests = []; - * $operationResponse = $migrationServiceClient->batchMigrateResources($formattedParent, $migrateResourceRequests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $migrationServiceClient->batchMigrateResources($formattedParent, $migrateResourceRequests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $migrationServiceClient->resumeOperation($operationName, 'batchMigrateResources'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $migrationServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\MigrationServiceClient}. - */ -class MigrationServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.MigrationService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $annotatedDatasetNameTemplate; - - private static $datasetNameTemplate; - - private static $locationNameTemplate; - - private static $modelNameTemplate; - - private static $versionNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/migration_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/migration_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/migration_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/migration_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getAnnotatedDatasetNameTemplate() - { - if (self::$annotatedDatasetNameTemplate == null) { - self::$annotatedDatasetNameTemplate = new PathTemplate( - 'projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}' - ); - } - - return self::$annotatedDatasetNameTemplate; - } - - private static function getDatasetNameTemplate() - { - if (self::$datasetNameTemplate == null) { - self::$datasetNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ); - } - - return self::$datasetNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getModelNameTemplate() - { - if (self::$modelNameTemplate == null) { - self::$modelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ); - } - - return self::$modelNameTemplate; - } - - private static function getVersionNameTemplate() - { - if (self::$versionNameTemplate == null) { - self::$versionNameTemplate = new PathTemplate( - 'projects/{project}/models/{model}/versions/{version}' - ); - } - - return self::$versionNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'annotatedDataset' => self::getAnnotatedDatasetNameTemplate(), - 'dataset' => self::getDatasetNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'model' => self::getModelNameTemplate(), - 'version' => self::getVersionNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * annotated_dataset resource. - * - * @param string $project - * @param string $dataset - * @param string $annotatedDataset - * - * @return string The formatted annotated_dataset resource. - */ - public static function annotatedDatasetName( - $project, - $dataset, - $annotatedDataset - ) { - return self::getAnnotatedDatasetNameTemplate()->render([ - 'project' => $project, - 'dataset' => $dataset, - 'annotated_dataset' => $annotatedDataset, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a dataset - * resource. - * - * @param string $project - * @param string $location - * @param string $dataset - * - * @return string The formatted dataset resource. - */ - public static function datasetName($project, $location, $dataset) - { - return self::getDatasetNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataset' => $dataset, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName($project, $location, $model) - { - return self::getModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a version - * resource. - * - * @param string $project - * @param string $model - * @param string $version - * - * @return string The formatted version resource. - */ - public static function versionName($project, $model, $version) - { - return self::getVersionNameTemplate()->render([ - 'project' => $project, - 'model' => $model, - 'version' => $version, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - annotatedDataset: projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset} - * - dataset: projects/{project}/locations/{location}/datasets/{dataset} - * - location: projects/{project}/locations/{location} - * - model: projects/{project}/locations/{location}/models/{model} - * - version: projects/{project}/models/{model}/versions/{version} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Batch migrates resources from ml.googleapis.com, automl.googleapis.com, - * and datalabeling.googleapis.com to Vertex AI. - * - * Sample code: - * ``` - * $migrationServiceClient = new MigrationServiceClient(); - * try { - * $formattedParent = $migrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $migrateResourceRequests = []; - * $operationResponse = $migrationServiceClient->batchMigrateResources($formattedParent, $migrateResourceRequests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $migrationServiceClient->batchMigrateResources($formattedParent, $migrateResourceRequests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $migrationServiceClient->resumeOperation($operationName, 'batchMigrateResources'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $migrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The location of the migrated resource will live in. - * Format: `projects/{project}/locations/{location}` - * @param MigrateResourceRequest[] $migrateResourceRequests Required. The request messages specifying the resources to migrate. - * They must be in the same location as the destination. - * Up to 50 resources can be migrated in one batch. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchMigrateResources( - $parent, - $migrateResourceRequests, - array $optionalArgs = [] - ) { - $request = new BatchMigrateResourcesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMigrateResourceRequests($migrateResourceRequests); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'BatchMigrateResources', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Searches all of the resources in automl.googleapis.com, - * datalabeling.googleapis.com and ml.googleapis.com that can be migrated to - * Vertex AI's given location. - * - * Sample code: - * ``` - * $migrationServiceClient = new MigrationServiceClient(); - * try { - * $formattedParent = $migrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $migrationServiceClient->searchMigratableResources($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $migrationServiceClient->searchMigratableResources($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $migrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The location that the migratable resources should be searched - * from. It's the Vertex AI location that the resources can be migrated to, - * not the resources' original location. Format: - * `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * A filter for your search. You can use the following types of filters: - * - * * Resource type filters. The following strings filter for a specific type - * of [MigratableResource][google.cloud.aiplatform.v1.MigratableResource]: - * * `ml_engine_model_version:*` - * * `automl_model:*` - * * `automl_dataset:*` - * * `data_labeling_dataset:*` - * * "Migrated or not" filters. The following strings filter for resources - * that either have or have not already been migrated: - * * `last_migrate_time:*` filters for migrated resources. - * * `NOT last_migrate_time:*` filters for not yet migrated resources. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function searchMigratableResources($parent, array $optionalArgs = []) - { - $request = new SearchMigratableResourcesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'SearchMigratableResources', - $optionalArgs, - SearchMigratableResourcesResponse::class, - $request - ); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $migrationServiceClient = new MigrationServiceClient(); - * try { - * $response = $migrationServiceClient->getLocation(); - * } finally { - * $migrationServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $migrationServiceClient = new MigrationServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $migrationServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $migrationServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $migrationServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $migrationServiceClient = new MigrationServiceClient(); - * try { - * $resource = 'resource'; - * $response = $migrationServiceClient->getIamPolicy($resource); - * } finally { - * $migrationServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $migrationServiceClient = new MigrationServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $migrationServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $migrationServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $migrationServiceClient = new MigrationServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $migrationServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $migrationServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/ModelGardenServiceGapicClient.php b/AiPlatform/src/V1/Gapic/ModelGardenServiceGapicClient.php deleted file mode 100644 index ece06875fd36..000000000000 --- a/AiPlatform/src/V1/Gapic/ModelGardenServiceGapicClient.php +++ /dev/null @@ -1,676 +0,0 @@ -publisherModelName('[PUBLISHER]', '[MODEL]'); - * $response = $modelGardenServiceClient->getPublisherModel($formattedName); - * } finally { - * $modelGardenServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\ModelGardenServiceClient}. - */ -class ModelGardenServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.ModelGardenService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $publisherModelNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/model_garden_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/model_garden_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/model_garden_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/model_garden_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getPublisherModelNameTemplate() - { - if (self::$publisherModelNameTemplate == null) { - self::$publisherModelNameTemplate = new PathTemplate( - 'publishers/{publisher}/models/{model}' - ); - } - - return self::$publisherModelNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'publisherModel' => self::getPublisherModelNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * publisher_model resource. - * - * @param string $publisher - * @param string $model - * - * @return string The formatted publisher_model resource. - */ - public static function publisherModelName($publisher, $model) - { - return self::getPublisherModelNameTemplate()->render([ - 'publisher' => $publisher, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - publisherModel: publishers/{publisher}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Gets a Model Garden publisher model. - * - * Sample code: - * ``` - * $modelGardenServiceClient = new ModelGardenServiceClient(); - * try { - * $formattedName = $modelGardenServiceClient->publisherModelName('[PUBLISHER]', '[MODEL]'); - * $response = $modelGardenServiceClient->getPublisherModel($formattedName); - * } finally { - * $modelGardenServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the PublisherModel resource. - * Format: - * `publishers/{publisher}/models/{publisher_model}` - * @param array $optionalArgs { - * Optional. - * - * @type string $languageCode - * Optional. The IETF BCP-47 language code representing the language in which - * the publisher model's text information should be written in (see go/bcp47). - * @type int $view - * Optional. PublisherModel view specifying which fields to read. - * For allowed values, use constants defined on {@see \Google\Cloud\AIPlatform\V1\PublisherModelView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\PublisherModel - * - * @throws ApiException if the remote call fails - */ - public function getPublisherModel($name, array $optionalArgs = []) - { - $request = new GetPublisherModelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetPublisherModel', - PublisherModel::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $modelGardenServiceClient = new ModelGardenServiceClient(); - * try { - * $response = $modelGardenServiceClient->getLocation(); - * } finally { - * $modelGardenServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $modelGardenServiceClient = new ModelGardenServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $modelGardenServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $modelGardenServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $modelGardenServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $modelGardenServiceClient = new ModelGardenServiceClient(); - * try { - * $resource = 'resource'; - * $response = $modelGardenServiceClient->getIamPolicy($resource); - * } finally { - * $modelGardenServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $modelGardenServiceClient = new ModelGardenServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $modelGardenServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $modelGardenServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $modelGardenServiceClient = new ModelGardenServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $modelGardenServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $modelGardenServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/ModelServiceGapicClient.php b/AiPlatform/src/V1/Gapic/ModelServiceGapicClient.php deleted file mode 100644 index 121596499e2b..000000000000 --- a/AiPlatform/src/V1/Gapic/ModelServiceGapicClient.php +++ /dev/null @@ -1,2396 +0,0 @@ -modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); - * $evaluatedAnnotations = []; - * $response = $modelServiceClient->batchImportEvaluatedAnnotations($formattedParent, $evaluatedAnnotations); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\ModelServiceClient}. - */ -class ModelServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.ModelService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $endpointNameTemplate; - - private static $locationNameTemplate; - - private static $modelNameTemplate; - - private static $modelEvaluationNameTemplate; - - private static $modelEvaluationSliceNameTemplate; - - private static $pipelineJobNameTemplate; - - private static $projectLocationEndpointNameTemplate; - - private static $projectLocationPublisherModelNameTemplate; - - private static $trainingPipelineNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/model_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/model_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/model_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/model_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$endpointNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getModelNameTemplate() - { - if (self::$modelNameTemplate == null) { - self::$modelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ); - } - - return self::$modelNameTemplate; - } - - private static function getModelEvaluationNameTemplate() - { - if (self::$modelEvaluationNameTemplate == null) { - self::$modelEvaluationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ); - } - - return self::$modelEvaluationNameTemplate; - } - - private static function getModelEvaluationSliceNameTemplate() - { - if (self::$modelEvaluationSliceNameTemplate == null) { - self::$modelEvaluationSliceNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ); - } - - return self::$modelEvaluationSliceNameTemplate; - } - - private static function getPipelineJobNameTemplate() - { - if (self::$pipelineJobNameTemplate == null) { - self::$pipelineJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ); - } - - return self::$pipelineJobNameTemplate; - } - - private static function getProjectLocationEndpointNameTemplate() - { - if (self::$projectLocationEndpointNameTemplate == null) { - self::$projectLocationEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$projectLocationEndpointNameTemplate; - } - - private static function getProjectLocationPublisherModelNameTemplate() - { - if (self::$projectLocationPublisherModelNameTemplate == null) { - self::$projectLocationPublisherModelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ); - } - - return self::$projectLocationPublisherModelNameTemplate; - } - - private static function getTrainingPipelineNameTemplate() - { - if (self::$trainingPipelineNameTemplate == null) { - self::$trainingPipelineNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ); - } - - return self::$trainingPipelineNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'endpoint' => self::getEndpointNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'model' => self::getModelNameTemplate(), - 'modelEvaluation' => self::getModelEvaluationNameTemplate(), - 'modelEvaluationSlice' => self::getModelEvaluationSliceNameTemplate(), - 'pipelineJob' => self::getPipelineJobNameTemplate(), - 'projectLocationEndpoint' => self::getProjectLocationEndpointNameTemplate(), - 'projectLocationPublisherModel' => self::getProjectLocationPublisherModelNameTemplate(), - 'trainingPipeline' => self::getTrainingPipelineNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName($project, $location, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName($project, $location, $model) - { - return self::getModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * model_evaluation resource. - * - * @param string $project - * @param string $location - * @param string $model - * @param string $evaluation - * - * @return string The formatted model_evaluation resource. - */ - public static function modelEvaluationName( - $project, - $location, - $model, - $evaluation - ) { - return self::getModelEvaluationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - 'evaluation' => $evaluation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * model_evaluation_slice resource. - * - * @param string $project - * @param string $location - * @param string $model - * @param string $evaluation - * @param string $slice - * - * @return string The formatted model_evaluation_slice resource. - */ - public static function modelEvaluationSliceName( - $project, - $location, - $model, - $evaluation, - $slice - ) { - return self::getModelEvaluationSliceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - 'evaluation' => $evaluation, - 'slice' => $slice, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a pipeline_job - * resource. - * - * @param string $project - * @param string $location - * @param string $pipelineJob - * - * @return string The formatted pipeline_job resource. - */ - public static function pipelineJobName($project, $location, $pipelineJob) - { - return self::getPipelineJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'pipeline_job' => $pipelineJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted project_location_endpoint resource. - */ - public static function projectLocationEndpointName( - $project, - $location, - $endpoint - ) { - return self::getProjectLocationEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_publisher_model resource. - * - * @param string $project - * @param string $location - * @param string $publisher - * @param string $model - * - * @return string The formatted project_location_publisher_model resource. - */ - public static function projectLocationPublisherModelName( - $project, - $location, - $publisher, - $model - ) { - return self::getProjectLocationPublisherModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'publisher' => $publisher, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * training_pipeline resource. - * - * @param string $project - * @param string $location - * @param string $trainingPipeline - * - * @return string The formatted training_pipeline resource. - */ - public static function trainingPipelineName( - $project, - $location, - $trainingPipeline - ) { - return self::getTrainingPipelineNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'training_pipeline' => $trainingPipeline, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - endpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - location: projects/{project}/locations/{location} - * - model: projects/{project}/locations/{location}/models/{model} - * - modelEvaluation: projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation} - * - modelEvaluationSlice: projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice} - * - pipelineJob: projects/{project}/locations/{location}/pipelineJobs/{pipeline_job} - * - projectLocationEndpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - projectLocationPublisherModel: projects/{project}/locations/{location}/publishers/{publisher}/models/{model} - * - trainingPipeline: projects/{project}/locations/{location}/trainingPipelines/{training_pipeline} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Imports a list of externally generated EvaluatedAnnotations. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedParent = $modelServiceClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); - * $evaluatedAnnotations = []; - * $response = $modelServiceClient->batchImportEvaluatedAnnotations($formattedParent, $evaluatedAnnotations); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent ModelEvaluationSlice resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - * @param EvaluatedAnnotation[] $evaluatedAnnotations Required. Evaluated annotations resource to be imported. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\BatchImportEvaluatedAnnotationsResponse - * - * @throws ApiException if the remote call fails - */ - public function batchImportEvaluatedAnnotations( - $parent, - $evaluatedAnnotations, - array $optionalArgs = [] - ) { - $request = new BatchImportEvaluatedAnnotationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEvaluatedAnnotations($evaluatedAnnotations); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'BatchImportEvaluatedAnnotations', - BatchImportEvaluatedAnnotationsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Imports a list of externally generated ModelEvaluationSlice. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedParent = $modelServiceClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - * $modelEvaluationSlices = []; - * $response = $modelServiceClient->batchImportModelEvaluationSlices($formattedParent, $modelEvaluationSlices); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent ModelEvaluation resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param ModelEvaluationSlice[] $modelEvaluationSlices Required. Model evaluation slice resource to be imported. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\BatchImportModelEvaluationSlicesResponse - * - * @throws ApiException if the remote call fails - */ - public function batchImportModelEvaluationSlices( - $parent, - $modelEvaluationSlices, - array $optionalArgs = [] - ) { - $request = new BatchImportModelEvaluationSlicesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setModelEvaluationSlices($modelEvaluationSlices); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'BatchImportModelEvaluationSlices', - BatchImportModelEvaluationSlicesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Copies an already existing Vertex AI Model into the specified Location. - * The source Model must exist in the same Project. - * When copying custom Models, the users themselves are responsible for - * [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be - * region-agnostic, as well as making sure that any resources (e.g. files) it - * depends on remain accessible. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedParent = $modelServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $formattedSourceModel = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * $operationResponse = $modelServiceClient->copyModel($formattedParent, $formattedSourceModel); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $modelServiceClient->copyModel($formattedParent, $formattedSourceModel); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $modelServiceClient->resumeOperation($operationName, 'copyModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location into which to copy the Model. - * Format: `projects/{project}/locations/{location}` - * @param string $sourceModel Required. The resource name of the Model to copy. That Model must be in the - * same Project. Format: - * `projects/{project}/locations/{location}/models/{model}` - * @param array $optionalArgs { - * Optional. - * - * @type string $modelId - * Optional. Copy source_model into a new Model with this ID. The ID will - * become the final component of the model resource name. - * - * This value may be up to 63 characters, and valid characters are - * `[a-z0-9_-]`. The first character cannot be a number or hyphen. - * @type string $parentModel - * Optional. Specify this field to copy source_model into this existing - * Model as a new version. Format: - * `projects/{project}/locations/{location}/models/{model}` - * @type EncryptionSpec $encryptionSpec - * Customer-managed encryption key options. If this is set, - * then the Model copy will be encrypted with the provided encryption key. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function copyModel($parent, $sourceModel, array $optionalArgs = []) - { - $request = new CopyModelRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setSourceModel($sourceModel); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['modelId'])) { - $request->setModelId($optionalArgs['modelId']); - } - - if (isset($optionalArgs['parentModel'])) { - $request->setParentModel($optionalArgs['parentModel']); - } - - if (isset($optionalArgs['encryptionSpec'])) { - $request->setEncryptionSpec($optionalArgs['encryptionSpec']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CopyModel', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a Model. - * - * A model cannot be deleted if any - * [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a - * [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the - * model in its - * [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] - * field. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedName = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * $operationResponse = $modelServiceClient->deleteModel($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $modelServiceClient->deleteModel($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $modelServiceClient->resumeOperation($operationName, 'deleteModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Model resource to be deleted. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteModel($name, array $optionalArgs = []) - { - $request = new DeleteModelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteModel', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a Model version. - * - * Model version can only be deleted if there are no - * [DeployedModels][google.cloud.aiplatform.v1.DeployedModel] created from it. - * Deleting the only version in the Model is not allowed. Use - * [DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel] for - * deleting the Model instead. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedName = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * $operationResponse = $modelServiceClient->deleteModelVersion($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $modelServiceClient->deleteModelVersion($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $modelServiceClient->resumeOperation($operationName, 'deleteModelVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the model version to be deleted, with a version ID - * explicitly included. - * - * Example: `projects/{project}/locations/{location}/models/{model}@1234` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteModelVersion($name, array $optionalArgs = []) - { - $request = new DeleteModelVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteModelVersion', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Exports a trained, exportable Model to a location specified by the - * user. A Model is considered to be exportable if it has at least one - * [supported export - * format][google.cloud.aiplatform.v1.Model.supported_export_formats]. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedName = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * $outputConfig = new OutputConfig(); - * $operationResponse = $modelServiceClient->exportModel($formattedName, $outputConfig); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $modelServiceClient->exportModel($formattedName, $outputConfig); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $modelServiceClient->resumeOperation($operationName, 'exportModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Model to export. - * The resource name may contain version id or version alias to specify the - * version, if no version is specified, the default version will be exported. - * @param OutputConfig $outputConfig Required. The desired output location and configuration. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function exportModel($name, $outputConfig, array $optionalArgs = []) - { - $request = new ExportModelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setOutputConfig($outputConfig); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'ExportModel', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets a Model. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedName = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * $response = $modelServiceClient->getModel($formattedName); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Model resource. - * Format: `projects/{project}/locations/{location}/models/{model}` - * - * In order to retrieve a specific version of the model, also provide - * the version ID or version alias. - * Example: `projects/{project}/locations/{location}/models/{model}@2` - * or - * `projects/{project}/locations/{location}/models/{model}@golden` - * If no version ID or alias is specified, the "default" version will be - * returned. The "default" version alias is created for the first version of - * the model, and can be moved to other versions later on. There will be - * exactly one default version. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Model - * - * @throws ApiException if the remote call fails - */ - public function getModel($name, array $optionalArgs = []) - { - $request = new GetModelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetModel', - Model::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a ModelEvaluation. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedName = $modelServiceClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - * $response = $modelServiceClient->getModelEvaluation($formattedName); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the ModelEvaluation resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ModelEvaluation - * - * @throws ApiException if the remote call fails - */ - public function getModelEvaluation($name, array $optionalArgs = []) - { - $request = new GetModelEvaluationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetModelEvaluation', - ModelEvaluation::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a ModelEvaluationSlice. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedName = $modelServiceClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); - * $response = $modelServiceClient->getModelEvaluationSlice($formattedName); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the ModelEvaluationSlice resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice - * - * @throws ApiException if the remote call fails - */ - public function getModelEvaluationSlice($name, array $optionalArgs = []) - { - $request = new GetModelEvaluationSliceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetModelEvaluationSlice', - ModelEvaluationSlice::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Imports an externally generated ModelEvaluation. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedParent = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * $modelEvaluation = new ModelEvaluation(); - * $response = $modelServiceClient->importModelEvaluation($formattedParent, $modelEvaluation); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent model resource. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param ModelEvaluation $modelEvaluation Required. Model evaluation resource to be imported. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ModelEvaluation - * - * @throws ApiException if the remote call fails - */ - public function importModelEvaluation( - $parent, - $modelEvaluation, - array $optionalArgs = [] - ) { - $request = new ImportModelEvaluationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setModelEvaluation($modelEvaluation); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ImportModelEvaluation', - ModelEvaluation::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists ModelEvaluationSlices in a ModelEvaluation. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedParent = $modelServiceClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - * // Iterate over pages of elements - * $pagedResponse = $modelServiceClient->listModelEvaluationSlices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $modelServiceClient->listModelEvaluationSlices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the ModelEvaluation to list the - * ModelEvaluationSlices from. Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * - * * `slice.dimension` - for =. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listModelEvaluationSlices($parent, array $optionalArgs = []) - { - $request = new ListModelEvaluationSlicesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListModelEvaluationSlices', - $optionalArgs, - ListModelEvaluationSlicesResponse::class, - $request - ); - } - - /** - * Lists ModelEvaluations in a Model. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedParent = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * // Iterate over pages of elements - * $pagedResponse = $modelServiceClient->listModelEvaluations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $modelServiceClient->listModelEvaluations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Model to list the ModelEvaluations from. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listModelEvaluations($parent, array $optionalArgs = []) - { - $request = new ListModelEvaluationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListModelEvaluations', - $optionalArgs, - ListModelEvaluationsResponse::class, - $request - ); - } - - /** - * Lists versions of the specified model. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedName = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * // Iterate over pages of elements - * $pagedResponse = $modelServiceClient->listModelVersions($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $modelServiceClient->listModelVersions($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the model to list versions for. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * - * * `labels.myKey="myValue"` - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `create_time` - * * `update_time` - * - * Example: `update_time asc, create_time desc`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listModelVersions($name, array $optionalArgs = []) - { - $request = new ListModelVersionsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListModelVersions', - $optionalArgs, - ListModelVersionsResponse::class, - $request - ); - } - - /** - * Lists Models in a Location. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedParent = $modelServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $modelServiceClient->listModels($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $modelServiceClient->listModels($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the Models from. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `model` supports = and !=. `model` represents the Model ID, - * i.e. the last segment of the Model's [resource - * name][google.cloud.aiplatform.v1.Model.name]. - * * `display_name` supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * * `base_model_name` only supports = - * - * Some examples: - * - * * `model=1234` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * * `baseModelName="text-bison"` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type string $orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listModels($parent, array $optionalArgs = []) - { - $request = new ListModelsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListModels', - $optionalArgs, - ListModelsResponse::class, - $request - ); - } - - /** - * Merges a set of aliases for a Model version. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedName = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * $versionAliases = []; - * $response = $modelServiceClient->mergeVersionAliases($formattedName, $versionAliases); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the model version to merge aliases, with a version ID - * explicitly included. - * - * Example: `projects/{project}/locations/{location}/models/{model}@1234` - * @param string[] $versionAliases Required. The set of version aliases to merge. - * The alias should be at most 128 characters, and match - * `[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]`. - * Add the `-` prefix to an alias means removing that alias from the version. - * `-` is NOT counted in the 128 characters. Example: `-golden` means removing - * the `golden` alias from the version. - * - * There is NO ordering in aliases, which means - * 1) The aliases returned from GetModel API might not have the exactly same - * order from this MergeVersionAliases API. 2) Adding and deleting the same - * alias in the request is not recommended, and the 2 operations will be - * cancelled out. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Model - * - * @throws ApiException if the remote call fails - */ - public function mergeVersionAliases( - $name, - $versionAliases, - array $optionalArgs = [] - ) { - $request = new MergeVersionAliasesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setVersionAliases($versionAliases); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'MergeVersionAliases', - Model::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Incrementally update the dataset used for an examples model. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedModel = $modelServiceClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - * $operationResponse = $modelServiceClient->updateExplanationDataset($formattedModel); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $modelServiceClient->updateExplanationDataset($formattedModel); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $modelServiceClient->resumeOperation($operationName, 'updateExplanationDataset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $model Required. The resource name of the Model to update. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param array $optionalArgs { - * Optional. - * - * @type Examples $examples - * The example config containing the location of the dataset. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateExplanationDataset($model, array $optionalArgs = []) - { - $request = new UpdateExplanationDatasetRequest(); - $requestParamHeaders = []; - $request->setModel($model); - $requestParamHeaders['model'] = $model; - if (isset($optionalArgs['examples'])) { - $request->setExamples($optionalArgs['examples']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateExplanationDataset', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a Model. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $model = new Model(); - * $updateMask = new FieldMask(); - * $response = $modelServiceClient->updateModel($model, $updateMask); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param Model $model Required. The Model which replaces the resource on the server. - * When Model Versioning is enabled, the model.name will be used to determine - * whether to update the model or model version. - * 1. model.name with the @ value, e.g. models/123@1, refers to a version - * specific update. - * 2. model.name without the @ value, e.g. models/123, refers to a model - * update. - * 3. model.name with @-, e.g. models/123@-, refers to a model update. - * 4. Supported model fields: display_name, description; supported - * version-specific fields: version_description. Labels are supported in both - * scenarios. Both the model labels and the version labels are merged when a - * model is returned. When updating labels, if the request is for - * model-specific update, model label gets updated. Otherwise, version labels - * get updated. - * 5. A model name or model version name fields update mismatch will cause a - * precondition error. - * 6. One request cannot update both the model and the version fields. You - * must update them separately. - * @param FieldMask $updateMask Required. The update mask applies to the resource. - * For the `FieldMask` definition, see - * [google.protobuf.FieldMask][google.protobuf.FieldMask]. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Model - * - * @throws ApiException if the remote call fails - */ - public function updateModel($model, $updateMask, array $optionalArgs = []) - { - $request = new UpdateModelRequest(); - $requestParamHeaders = []; - $request->setModel($model); - $request->setUpdateMask($updateMask); - $requestParamHeaders['model.name'] = $model->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateModel', - Model::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Uploads a Model artifact into Vertex AI. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $formattedParent = $modelServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $model = new Model(); - * $operationResponse = $modelServiceClient->uploadModel($formattedParent, $model); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $modelServiceClient->uploadModel($formattedParent, $model); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $modelServiceClient->resumeOperation($operationName, 'uploadModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location into which to upload the Model. - * Format: `projects/{project}/locations/{location}` - * @param Model $model Required. The Model to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $parentModel - * Optional. The resource name of the model into which to upload the version. - * Only specify this field when uploading a new version. - * @type string $modelId - * Optional. The ID to use for the uploaded Model, which will become the final - * component of the model resource name. - * - * This value may be up to 63 characters, and valid characters are - * `[a-z0-9_-]`. The first character cannot be a number or hyphen. - * @type string $serviceAccount - * Optional. The user-provided custom service account to use to do the model - * upload. If empty, [Vertex AI Service - * Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) - * will be used to access resources needed to upload the model. This account - * must belong to the target project where the model is uploaded to, i.e., the - * project specified in the `parent` field of this request and have necessary - * read permissions (to Google Cloud Storage, Artifact Registry, etc.). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function uploadModel($parent, $model, array $optionalArgs = []) - { - $request = new UploadModelRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setModel($model); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['parentModel'])) { - $request->setParentModel($optionalArgs['parentModel']); - } - - if (isset($optionalArgs['modelId'])) { - $request->setModelId($optionalArgs['modelId']); - } - - if (isset($optionalArgs['serviceAccount'])) { - $request->setServiceAccount($optionalArgs['serviceAccount']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UploadModel', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $response = $modelServiceClient->getLocation(); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $modelServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $modelServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $resource = 'resource'; - * $response = $modelServiceClient->getIamPolicy($resource); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $modelServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $modelServiceClient = new ModelServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $modelServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $modelServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/NotebookServiceGapicClient.php b/AiPlatform/src/V1/Gapic/NotebookServiceGapicClient.php deleted file mode 100644 index bcdf15d765eb..000000000000 --- a/AiPlatform/src/V1/Gapic/NotebookServiceGapicClient.php +++ /dev/null @@ -1,1678 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $formattedNotebookRuntimeTemplate = $notebookServiceClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - * $notebookRuntime = new NotebookRuntime(); - * $operationResponse = $notebookServiceClient->assignNotebookRuntime($formattedParent, $formattedNotebookRuntimeTemplate, $notebookRuntime); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->assignNotebookRuntime($formattedParent, $formattedNotebookRuntimeTemplate, $notebookRuntime); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'assignNotebookRuntime'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\NotebookServiceClient}. - */ -class NotebookServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.NotebookService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationNameTemplate; - - private static $networkNameTemplate; - - private static $notebookRuntimeNameTemplate; - - private static $notebookRuntimeTemplateNameTemplate; - - private static $subnetworkNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/notebook_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/notebook_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/notebook_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/notebook_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate( - 'projects/{project}/global/networks/{network}' - ); - } - - return self::$networkNameTemplate; - } - - private static function getNotebookRuntimeNameTemplate() - { - if (self::$notebookRuntimeNameTemplate == null) { - self::$notebookRuntimeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}' - ); - } - - return self::$notebookRuntimeNameTemplate; - } - - private static function getNotebookRuntimeTemplateNameTemplate() - { - if (self::$notebookRuntimeTemplateNameTemplate == null) { - self::$notebookRuntimeTemplateNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}' - ); - } - - return self::$notebookRuntimeTemplateNameTemplate; - } - - private static function getSubnetworkNameTemplate() - { - if (self::$subnetworkNameTemplate == null) { - self::$subnetworkNameTemplate = new PathTemplate( - 'projects/{project}/regions/{region}/subnetworks/{subnetwork}' - ); - } - - return self::$subnetworkNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'notebookRuntime' => self::getNotebookRuntimeNameTemplate(), - 'notebookRuntimeTemplate' => self::getNotebookRuntimeTemplateNameTemplate(), - 'subnetwork' => self::getSubnetworkNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * notebook_runtime resource. - * - * @param string $project - * @param string $location - * @param string $notebookRuntime - * - * @return string The formatted notebook_runtime resource. - */ - public static function notebookRuntimeName( - $project, - $location, - $notebookRuntime - ) { - return self::getNotebookRuntimeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'notebook_runtime' => $notebookRuntime, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * notebook_runtime_template resource. - * - * @param string $project - * @param string $location - * @param string $notebookRuntimeTemplate - * - * @return string The formatted notebook_runtime_template resource. - */ - public static function notebookRuntimeTemplateName( - $project, - $location, - $notebookRuntimeTemplate - ) { - return self::getNotebookRuntimeTemplateNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'notebook_runtime_template' => $notebookRuntimeTemplate, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subnetwork - * resource. - * - * @param string $project - * @param string $region - * @param string $subnetwork - * - * @return string The formatted subnetwork resource. - */ - public static function subnetworkName($project, $region, $subnetwork) - { - return self::getSubnetworkNameTemplate()->render([ - 'project' => $project, - 'region' => $region, - 'subnetwork' => $subnetwork, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - notebookRuntime: projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime} - * - notebookRuntimeTemplate: projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template} - * - subnetwork: projects/{project}/regions/{region}/subnetworks/{subnetwork} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Assigns a NotebookRuntime to a user for a particular Notebook file. This - * method will either returns an existing assignment or generates a new one. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedParent = $notebookServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $formattedNotebookRuntimeTemplate = $notebookServiceClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - * $notebookRuntime = new NotebookRuntime(); - * $operationResponse = $notebookServiceClient->assignNotebookRuntime($formattedParent, $formattedNotebookRuntimeTemplate, $notebookRuntime); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->assignNotebookRuntime($formattedParent, $formattedNotebookRuntimeTemplate, $notebookRuntime); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'assignNotebookRuntime'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to get the NotebookRuntime - * assignment. Format: `projects/{project}/locations/{location}` - * @param string $notebookRuntimeTemplate Required. The resource name of the NotebookRuntimeTemplate based on which a - * NotebookRuntime will be assigned (reuse or create a new one). - * @param NotebookRuntime $notebookRuntime Required. Provide runtime specific information (e.g. runtime owner, - * notebook id) used for NotebookRuntime assignment. - * @param array $optionalArgs { - * Optional. - * - * @type string $notebookRuntimeId - * Optional. User specified ID for the notebook runtime. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function assignNotebookRuntime( - $parent, - $notebookRuntimeTemplate, - $notebookRuntime, - array $optionalArgs = [] - ) { - $request = new AssignNotebookRuntimeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setNotebookRuntimeTemplate($notebookRuntimeTemplate); - $request->setNotebookRuntime($notebookRuntime); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['notebookRuntimeId'])) { - $request->setNotebookRuntimeId($optionalArgs['notebookRuntimeId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'AssignNotebookRuntime', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a NotebookRuntimeTemplate. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedParent = $notebookServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $notebookRuntimeTemplate = new NotebookRuntimeTemplate(); - * $operationResponse = $notebookServiceClient->createNotebookRuntimeTemplate($formattedParent, $notebookRuntimeTemplate); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->createNotebookRuntimeTemplate($formattedParent, $notebookRuntimeTemplate); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'createNotebookRuntimeTemplate'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the - * NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}` - * @param NotebookRuntimeTemplate $notebookRuntimeTemplate Required. The NotebookRuntimeTemplate to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $notebookRuntimeTemplateId - * Optional. User specified ID for the notebook runtime template. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createNotebookRuntimeTemplate( - $parent, - $notebookRuntimeTemplate, - array $optionalArgs = [] - ) { - $request = new CreateNotebookRuntimeTemplateRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setNotebookRuntimeTemplate($notebookRuntimeTemplate); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['notebookRuntimeTemplateId'])) { - $request->setNotebookRuntimeTemplateId( - $optionalArgs['notebookRuntimeTemplateId'] - ); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateNotebookRuntimeTemplate', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a NotebookRuntime. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedName = $notebookServiceClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - * $operationResponse = $notebookServiceClient->deleteNotebookRuntime($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->deleteNotebookRuntime($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'deleteNotebookRuntime'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NotebookRuntime resource to be deleted. - * Instead of checking whether the name is in valid NotebookRuntime resource - * name format, directly throw NotFound exception if there is no such - * NotebookRuntime in spanner. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteNotebookRuntime($name, array $optionalArgs = []) - { - $request = new DeleteNotebookRuntimeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteNotebookRuntime', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a NotebookRuntimeTemplate. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedName = $notebookServiceClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - * $operationResponse = $notebookServiceClient->deleteNotebookRuntimeTemplate($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->deleteNotebookRuntimeTemplate($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'deleteNotebookRuntimeTemplate'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NotebookRuntimeTemplate resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteNotebookRuntimeTemplate( - $name, - array $optionalArgs = [] - ) { - $request = new DeleteNotebookRuntimeTemplateRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteNotebookRuntimeTemplate', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets a NotebookRuntime. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedName = $notebookServiceClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - * $response = $notebookServiceClient->getNotebookRuntime($formattedName); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NotebookRuntime resource. - * Instead of checking whether the name is in valid NotebookRuntime resource - * name format, directly throw NotFound exception if there is no such - * NotebookRuntime in spanner. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\NotebookRuntime - * - * @throws ApiException if the remote call fails - */ - public function getNotebookRuntime($name, array $optionalArgs = []) - { - $request = new GetNotebookRuntimeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetNotebookRuntime', - NotebookRuntime::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a NotebookRuntimeTemplate. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedName = $notebookServiceClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - * $response = $notebookServiceClient->getNotebookRuntimeTemplate($formattedName); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NotebookRuntimeTemplate resource. - * Format: - * `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate - * - * @throws ApiException if the remote call fails - */ - public function getNotebookRuntimeTemplate($name, array $optionalArgs = []) - { - $request = new GetNotebookRuntimeTemplateRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetNotebookRuntimeTemplate', - NotebookRuntimeTemplate::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists NotebookRuntimeTemplates in a Location. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedParent = $notebookServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $notebookServiceClient->listNotebookRuntimeTemplates($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $notebookServiceClient->listNotebookRuntimeTemplates($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location from which to list the - * NotebookRuntimeTemplates. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. An expression for filtering the results of the request. For field - * names both snake_case and camelCase are supported. - * - * * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` - * represents the NotebookRuntimeTemplate ID, - * i.e. the last segment of the NotebookRuntimeTemplate's [resource name] - * [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. - * * `display_name` supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: - * [USER_DEFINED, ONE_CLICK]. - * - * Some examples: - * - * * `notebookRuntimeTemplate=notebookRuntimeTemplate123` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * * `notebookRuntimeType=USER_DEFINED` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Optional. Mask specifying which fields to read. - * @type string $orderBy - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. Supported fields: - * - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listNotebookRuntimeTemplates( - $parent, - array $optionalArgs = [] - ) { - $request = new ListNotebookRuntimeTemplatesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListNotebookRuntimeTemplates', - $optionalArgs, - ListNotebookRuntimeTemplatesResponse::class, - $request - ); - } - - /** - * Lists NotebookRuntimes in a Location. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedParent = $notebookServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $notebookServiceClient->listNotebookRuntimes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $notebookServiceClient->listNotebookRuntimes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location from which to list the - * NotebookRuntimes. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. An expression for filtering the results of the request. For field - * names both snake_case and camelCase are supported. - * - * * `notebookRuntime` supports = and !=. `notebookRuntime` represents the - * NotebookRuntime ID, - * i.e. the last segment of the NotebookRuntime's [resource name] - * [google.cloud.aiplatform.v1.NotebookRuntime.name]. - * * `displayName` supports = and != and regex. - * * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` - * represents the NotebookRuntimeTemplate ID, - * i.e. the last segment of the NotebookRuntimeTemplate's [resource name] - * [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. - * * `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, - * HEALTH_STATE_UNSPECIFIED]. - * * `runtimeState` supports = and !=. runtimeState enum: - * [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, - * STOPPED, BEING_UPGRADED, ERROR, INVALID]. - * * `runtimeUser` supports = and !=. - * * API version is UI only: `uiState` supports = and !=. uiState enum: - * [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, - * UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, - * UI_RESOURCE_STATE_CREATION_FAILED]. - * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: - * [USER_DEFINED, ONE_CLICK]. - * - * Some examples: - * - * * `notebookRuntime="notebookRuntime123"` - * * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` - * * `notebookRuntimeTemplate="notebookRuntimeTemplate321"` - * * `healthState=HEALTHY` - * * `runtimeState=RUNNING` - * * `runtimeUser="test@google.com"` - * * `uiState=UI_RESOURCE_STATE_BEING_DELETED` - * * `notebookRuntimeType=USER_DEFINED` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Optional. Mask specifying which fields to read. - * @type string $orderBy - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. Supported fields: - * - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listNotebookRuntimes($parent, array $optionalArgs = []) - { - $request = new ListNotebookRuntimesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListNotebookRuntimes', - $optionalArgs, - ListNotebookRuntimesResponse::class, - $request - ); - } - - /** - * Starts a NotebookRuntime. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedName = $notebookServiceClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - * $operationResponse = $notebookServiceClient->startNotebookRuntime($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->startNotebookRuntime($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'startNotebookRuntime'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NotebookRuntime resource to be started. - * Instead of checking whether the name is in valid NotebookRuntime resource - * name format, directly throw NotFound exception if there is no such - * NotebookRuntime in spanner. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function startNotebookRuntime($name, array $optionalArgs = []) - { - $request = new StartNotebookRuntimeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'StartNotebookRuntime', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Upgrades a NotebookRuntime. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $formattedName = $notebookServiceClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - * $operationResponse = $notebookServiceClient->upgradeNotebookRuntime($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->upgradeNotebookRuntime($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'upgradeNotebookRuntime'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the NotebookRuntime resource to be upgrade. - * Instead of checking whether the name is in valid NotebookRuntime resource - * name format, directly throw NotFound exception if there is no such - * NotebookRuntime in spanner. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function upgradeNotebookRuntime($name, array $optionalArgs = []) - { - $request = new UpgradeNotebookRuntimeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpgradeNotebookRuntime', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $response = $notebookServiceClient->getLocation(); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $notebookServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $notebookServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $resource = 'resource'; - * $response = $notebookServiceClient->getIamPolicy($resource); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $notebookServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $notebookServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/PersistentResourceServiceGapicClient.php b/AiPlatform/src/V1/Gapic/PersistentResourceServiceGapicClient.php deleted file mode 100644 index fc35629dfebf..000000000000 --- a/AiPlatform/src/V1/Gapic/PersistentResourceServiceGapicClient.php +++ /dev/null @@ -1,1206 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $persistentResource = new PersistentResource(); - * $persistentResourceId = 'persistent_resource_id'; - * $operationResponse = $persistentResourceServiceClient->createPersistentResource($formattedParent, $persistentResource, $persistentResourceId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $persistentResourceServiceClient->createPersistentResource($formattedParent, $persistentResource, $persistentResourceId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $persistentResourceServiceClient->resumeOperation($operationName, 'createPersistentResource'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\PersistentResourceServiceClient}. - */ -class PersistentResourceServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.PersistentResourceService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationNameTemplate; - - private static $networkNameTemplate; - - private static $persistentResourceNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/persistent_resource_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/persistent_resource_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/persistent_resource_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/persistent_resource_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate( - 'projects/{project}/global/networks/{network}' - ); - } - - return self::$networkNameTemplate; - } - - private static function getPersistentResourceNameTemplate() - { - if (self::$persistentResourceNameTemplate == null) { - self::$persistentResourceNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/persistentResources/{persistent_resource}' - ); - } - - return self::$persistentResourceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'persistentResource' => self::getPersistentResourceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * persistent_resource resource. - * - * @param string $project - * @param string $location - * @param string $persistentResource - * - * @return string The formatted persistent_resource resource. - */ - public static function persistentResourceName( - $project, - $location, - $persistentResource - ) { - return self::getPersistentResourceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'persistent_resource' => $persistentResource, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - persistentResource: projects/{project}/locations/{location}/persistentResources/{persistent_resource} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a PersistentResource. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $formattedParent = $persistentResourceServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $persistentResource = new PersistentResource(); - * $persistentResourceId = 'persistent_resource_id'; - * $operationResponse = $persistentResourceServiceClient->createPersistentResource($formattedParent, $persistentResource, $persistentResourceId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $persistentResourceServiceClient->createPersistentResource($formattedParent, $persistentResource, $persistentResourceId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $persistentResourceServiceClient->resumeOperation($operationName, 'createPersistentResource'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the - * PersistentResource in. Format: `projects/{project}/locations/{location}` - * @param PersistentResource $persistentResource Required. The PersistentResource to create. - * @param string $persistentResourceId Required. The ID to use for the PersistentResource, which become the final - * component of the PersistentResource's resource name. - * - * The maximum length is 63 characters, and valid characters - * are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createPersistentResource( - $parent, - $persistentResource, - $persistentResourceId, - array $optionalArgs = [] - ) { - $request = new CreatePersistentResourceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPersistentResource($persistentResource); - $request->setPersistentResourceId($persistentResourceId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreatePersistentResource', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a PersistentResource. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $formattedName = $persistentResourceServiceClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - * $operationResponse = $persistentResourceServiceClient->deletePersistentResource($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $persistentResourceServiceClient->deletePersistentResource($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $persistentResourceServiceClient->resumeOperation($operationName, 'deletePersistentResource'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the PersistentResource to be deleted. - * Format: - * `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deletePersistentResource($name, array $optionalArgs = []) - { - $request = new DeletePersistentResourceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeletePersistentResource', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets a PersistentResource. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $formattedName = $persistentResourceServiceClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - * $response = $persistentResourceServiceClient->getPersistentResource($formattedName); - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the PersistentResource resource. - * Format: - * `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\PersistentResource - * - * @throws ApiException if the remote call fails - */ - public function getPersistentResource($name, array $optionalArgs = []) - { - $request = new GetPersistentResourceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetPersistentResource', - PersistentResource::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists PersistentResources in a Location. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $formattedParent = $persistentResourceServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $persistentResourceServiceClient->listPersistentResources($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $persistentResourceServiceClient->listPersistentResources($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the PersistentResources - * from. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listPersistentResources($parent, array $optionalArgs = []) - { - $request = new ListPersistentResourcesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListPersistentResources', - $optionalArgs, - ListPersistentResourcesResponse::class, - $request - ); - } - - /** - * Reboots a PersistentResource. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $formattedName = $persistentResourceServiceClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - * $operationResponse = $persistentResourceServiceClient->rebootPersistentResource($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $persistentResourceServiceClient->rebootPersistentResource($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $persistentResourceServiceClient->resumeOperation($operationName, 'rebootPersistentResource'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the PersistentResource resource. - * Format: - * `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function rebootPersistentResource($name, array $optionalArgs = []) - { - $request = new RebootPersistentResourceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'RebootPersistentResource', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a PersistentResource. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $persistentResource = new PersistentResource(); - * $updateMask = new FieldMask(); - * $operationResponse = $persistentResourceServiceClient->updatePersistentResource($persistentResource, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $persistentResourceServiceClient->updatePersistentResource($persistentResource, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $persistentResourceServiceClient->resumeOperation($operationName, 'updatePersistentResource'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param PersistentResource $persistentResource Required. The PersistentResource to update. - * - * The PersistentResource's `name` field is used to identify the - * PersistentResource to update. Format: - * `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` - * @param FieldMask $updateMask Required. Specify the fields to be overwritten in the PersistentResource by - * the update method. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updatePersistentResource( - $persistentResource, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdatePersistentResourceRequest(); - $requestParamHeaders = []; - $request->setPersistentResource($persistentResource); - $request->setUpdateMask($updateMask); - $requestParamHeaders[ - 'persistent_resource.name' - ] = $persistentResource->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdatePersistentResource', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $response = $persistentResourceServiceClient->getLocation(); - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $persistentResourceServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $persistentResourceServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $resource = 'resource'; - * $response = $persistentResourceServiceClient->getIamPolicy($resource); - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $persistentResourceServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $persistentResourceServiceClient = new PersistentResourceServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $persistentResourceServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $persistentResourceServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/PipelineServiceGapicClient.php b/AiPlatform/src/V1/Gapic/PipelineServiceGapicClient.php deleted file mode 100644 index 55131849e3b5..000000000000 --- a/AiPlatform/src/V1/Gapic/PipelineServiceGapicClient.php +++ /dev/null @@ -1,2053 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $formattedNames = [ - * $pipelineServiceClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - * ]; - * $operationResponse = $pipelineServiceClient->batchCancelPipelineJobs($formattedParent, $formattedNames); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $pipelineServiceClient->batchCancelPipelineJobs($formattedParent, $formattedNames); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $pipelineServiceClient->resumeOperation($operationName, 'batchCancelPipelineJobs'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\PipelineServiceClient}. - */ -class PipelineServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.PipelineService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $artifactNameTemplate; - - private static $contextNameTemplate; - - private static $customJobNameTemplate; - - private static $endpointNameTemplate; - - private static $executionNameTemplate; - - private static $locationNameTemplate; - - private static $metadataStoreNameTemplate; - - private static $modelNameTemplate; - - private static $networkNameTemplate; - - private static $pipelineJobNameTemplate; - - private static $projectLocationEndpointNameTemplate; - - private static $projectLocationPublisherModelNameTemplate; - - private static $trainingPipelineNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/pipeline_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/pipeline_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/pipeline_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/pipeline_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getArtifactNameTemplate() - { - if (self::$artifactNameTemplate == null) { - self::$artifactNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ); - } - - return self::$artifactNameTemplate; - } - - private static function getContextNameTemplate() - { - if (self::$contextNameTemplate == null) { - self::$contextNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ); - } - - return self::$contextNameTemplate; - } - - private static function getCustomJobNameTemplate() - { - if (self::$customJobNameTemplate == null) { - self::$customJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ); - } - - return self::$customJobNameTemplate; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$endpointNameTemplate; - } - - private static function getExecutionNameTemplate() - { - if (self::$executionNameTemplate == null) { - self::$executionNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ); - } - - return self::$executionNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getMetadataStoreNameTemplate() - { - if (self::$metadataStoreNameTemplate == null) { - self::$metadataStoreNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ); - } - - return self::$metadataStoreNameTemplate; - } - - private static function getModelNameTemplate() - { - if (self::$modelNameTemplate == null) { - self::$modelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ); - } - - return self::$modelNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate( - 'projects/{project}/global/networks/{network}' - ); - } - - return self::$networkNameTemplate; - } - - private static function getPipelineJobNameTemplate() - { - if (self::$pipelineJobNameTemplate == null) { - self::$pipelineJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ); - } - - return self::$pipelineJobNameTemplate; - } - - private static function getProjectLocationEndpointNameTemplate() - { - if (self::$projectLocationEndpointNameTemplate == null) { - self::$projectLocationEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$projectLocationEndpointNameTemplate; - } - - private static function getProjectLocationPublisherModelNameTemplate() - { - if (self::$projectLocationPublisherModelNameTemplate == null) { - self::$projectLocationPublisherModelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ); - } - - return self::$projectLocationPublisherModelNameTemplate; - } - - private static function getTrainingPipelineNameTemplate() - { - if (self::$trainingPipelineNameTemplate == null) { - self::$trainingPipelineNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ); - } - - return self::$trainingPipelineNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'artifact' => self::getArtifactNameTemplate(), - 'context' => self::getContextNameTemplate(), - 'customJob' => self::getCustomJobNameTemplate(), - 'endpoint' => self::getEndpointNameTemplate(), - 'execution' => self::getExecutionNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'metadataStore' => self::getMetadataStoreNameTemplate(), - 'model' => self::getModelNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'pipelineJob' => self::getPipelineJobNameTemplate(), - 'projectLocationEndpoint' => self::getProjectLocationEndpointNameTemplate(), - 'projectLocationPublisherModel' => self::getProjectLocationPublisherModelNameTemplate(), - 'trainingPipeline' => self::getTrainingPipelineNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a artifact - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $artifact - * - * @return string The formatted artifact resource. - */ - public static function artifactName( - $project, - $location, - $metadataStore, - $artifact - ) { - return self::getArtifactNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'artifact' => $artifact, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a context - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $context - * - * @return string The formatted context resource. - */ - public static function contextName( - $project, - $location, - $metadataStore, - $context - ) { - return self::getContextNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a custom_job - * resource. - * - * @param string $project - * @param string $location - * @param string $customJob - * - * @return string The formatted custom_job resource. - */ - public static function customJobName($project, $location, $customJob) - { - return self::getCustomJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'custom_job' => $customJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName($project, $location, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a execution - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $execution - * - * @return string The formatted execution resource. - */ - public static function executionName( - $project, - $location, - $metadataStore, - $execution - ) { - return self::getExecutionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'execution' => $execution, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * metadata_store resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * - * @return string The formatted metadata_store resource. - */ - public static function metadataStoreName( - $project, - $location, - $metadataStore - ) { - return self::getMetadataStoreNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a model - * resource. - * - * @param string $project - * @param string $location - * @param string $model - * - * @return string The formatted model resource. - */ - public static function modelName($project, $location, $model) - { - return self::getModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a pipeline_job - * resource. - * - * @param string $project - * @param string $location - * @param string $pipelineJob - * - * @return string The formatted pipeline_job resource. - */ - public static function pipelineJobName($project, $location, $pipelineJob) - { - return self::getPipelineJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'pipeline_job' => $pipelineJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted project_location_endpoint resource. - */ - public static function projectLocationEndpointName( - $project, - $location, - $endpoint - ) { - return self::getProjectLocationEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_publisher_model resource. - * - * @param string $project - * @param string $location - * @param string $publisher - * @param string $model - * - * @return string The formatted project_location_publisher_model resource. - */ - public static function projectLocationPublisherModelName( - $project, - $location, - $publisher, - $model - ) { - return self::getProjectLocationPublisherModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'publisher' => $publisher, - 'model' => $model, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * training_pipeline resource. - * - * @param string $project - * @param string $location - * @param string $trainingPipeline - * - * @return string The formatted training_pipeline resource. - */ - public static function trainingPipelineName( - $project, - $location, - $trainingPipeline - ) { - return self::getTrainingPipelineNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'training_pipeline' => $trainingPipeline, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - artifact: projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact} - * - context: projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context} - * - customJob: projects/{project}/locations/{location}/customJobs/{custom_job} - * - endpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - execution: projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution} - * - location: projects/{project}/locations/{location} - * - metadataStore: projects/{project}/locations/{location}/metadataStores/{metadata_store} - * - model: projects/{project}/locations/{location}/models/{model} - * - network: projects/{project}/global/networks/{network} - * - pipelineJob: projects/{project}/locations/{location}/pipelineJobs/{pipeline_job} - * - projectLocationEndpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - projectLocationPublisherModel: projects/{project}/locations/{location}/publishers/{publisher}/models/{model} - * - trainingPipeline: projects/{project}/locations/{location}/trainingPipelines/{training_pipeline} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Batch cancel PipelineJobs. - * Firstly the server will check if all the jobs are in non-terminal states, - * and skip the jobs that are already terminated. - * If the operation failed, none of the pipeline jobs are cancelled. - * The server will poll the states of all the pipeline jobs periodically - * to check the cancellation status. - * This operation will return an LRO. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedParent = $pipelineServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $formattedNames = [ - * $pipelineServiceClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - * ]; - * $operationResponse = $pipelineServiceClient->batchCancelPipelineJobs($formattedParent, $formattedNames); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $pipelineServiceClient->batchCancelPipelineJobs($formattedParent, $formattedNames); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $pipelineServiceClient->resumeOperation($operationName, 'batchCancelPipelineJobs'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the PipelineJobs' parent resource. - * Format: `projects/{project}/locations/{location}` - * @param string[] $names Required. The names of the PipelineJobs to cancel. - * A maximum of 32 PipelineJobs can be cancelled in a batch. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipelineJob}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchCancelPipelineJobs( - $parent, - $names, - array $optionalArgs = [] - ) { - $request = new BatchCancelPipelineJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setNames($names); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'BatchCancelPipelineJobs', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Batch deletes PipelineJobs - * The Operation is atomic. If it fails, none of the PipelineJobs are deleted. - * If it succeeds, all of the PipelineJobs are deleted. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedParent = $pipelineServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $formattedNames = [ - * $pipelineServiceClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - * ]; - * $operationResponse = $pipelineServiceClient->batchDeletePipelineJobs($formattedParent, $formattedNames); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $pipelineServiceClient->batchDeletePipelineJobs($formattedParent, $formattedNames); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $pipelineServiceClient->resumeOperation($operationName, 'batchDeletePipelineJobs'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the PipelineJobs' parent resource. - * Format: `projects/{project}/locations/{location}` - * @param string[] $names Required. The names of the PipelineJobs to delete. - * A maximum of 32 PipelineJobs can be deleted in a batch. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipelineJob}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchDeletePipelineJobs( - $parent, - $names, - array $optionalArgs = [] - ) { - $request = new BatchDeletePipelineJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setNames($names); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'BatchDeletePipelineJobs', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Cancels a PipelineJob. - * Starts asynchronous cancellation on the PipelineJob. The server - * makes a best effort to cancel the pipeline, but success is not - * guaranteed. Clients can use - * [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob] - * or other methods to check whether the cancellation succeeded or whether the - * pipeline completed despite cancellation. On successful cancellation, - * the PipelineJob is not deleted; instead it becomes a pipeline with - * a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error] value - * with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding - * to `Code.CANCELLED`, and - * [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set to - * `CANCELLED`. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedName = $pipelineServiceClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - * $pipelineServiceClient->cancelPipelineJob($formattedName); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the PipelineJob to cancel. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function cancelPipelineJob($name, array $optionalArgs = []) - { - $request = new CancelPipelineJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelPipelineJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Cancels a TrainingPipeline. - * Starts asynchronous cancellation on the TrainingPipeline. The server - * makes a best effort to cancel the pipeline, but success is not - * guaranteed. Clients can use - * [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline] - * or other methods to check whether the cancellation succeeded or whether the - * pipeline completed despite cancellation. On successful cancellation, - * the TrainingPipeline is not deleted; instead it becomes a pipeline with - * a - * [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error] - * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`, and - * [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] - * is set to `CANCELLED`. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedName = $pipelineServiceClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - * $pipelineServiceClient->cancelTrainingPipeline($formattedName); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TrainingPipeline to cancel. - * Format: - * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function cancelTrainingPipeline($name, array $optionalArgs = []) - { - $request = new CancelTrainingPipelineRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelTrainingPipeline', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a PipelineJob. A PipelineJob will run immediately when created. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedParent = $pipelineServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $pipelineJob = new PipelineJob(); - * $response = $pipelineServiceClient->createPipelineJob($formattedParent, $pipelineJob); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the PipelineJob in. - * Format: `projects/{project}/locations/{location}` - * @param PipelineJob $pipelineJob Required. The PipelineJob to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $pipelineJobId - * The ID to use for the PipelineJob, which will become the final component of - * the PipelineJob name. If not provided, an ID will be automatically - * generated. - * - * This value should be less than 128 characters, and valid characters - * are `/[a-z][0-9]-/`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\PipelineJob - * - * @throws ApiException if the remote call fails - */ - public function createPipelineJob( - $parent, - $pipelineJob, - array $optionalArgs = [] - ) { - $request = new CreatePipelineJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPipelineJob($pipelineJob); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pipelineJobId'])) { - $request->setPipelineJobId($optionalArgs['pipelineJobId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreatePipelineJob', - PipelineJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a TrainingPipeline. A created TrainingPipeline right away will be - * attempted to be run. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedParent = $pipelineServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $trainingPipeline = new TrainingPipeline(); - * $response = $pipelineServiceClient->createTrainingPipeline($formattedParent, $trainingPipeline); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the TrainingPipeline - * in. Format: `projects/{project}/locations/{location}` - * @param TrainingPipeline $trainingPipeline Required. The TrainingPipeline to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TrainingPipeline - * - * @throws ApiException if the remote call fails - */ - public function createTrainingPipeline( - $parent, - $trainingPipeline, - array $optionalArgs = [] - ) { - $request = new CreateTrainingPipelineRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTrainingPipeline($trainingPipeline); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateTrainingPipeline', - TrainingPipeline::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a PipelineJob. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedName = $pipelineServiceClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - * $operationResponse = $pipelineServiceClient->deletePipelineJob($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $pipelineServiceClient->deletePipelineJob($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $pipelineServiceClient->resumeOperation($operationName, 'deletePipelineJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the PipelineJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deletePipelineJob($name, array $optionalArgs = []) - { - $request = new DeletePipelineJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeletePipelineJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a TrainingPipeline. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedName = $pipelineServiceClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - * $operationResponse = $pipelineServiceClient->deleteTrainingPipeline($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $pipelineServiceClient->deleteTrainingPipeline($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $pipelineServiceClient->resumeOperation($operationName, 'deleteTrainingPipeline'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TrainingPipeline resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTrainingPipeline($name, array $optionalArgs = []) - { - $request = new DeleteTrainingPipelineRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteTrainingPipeline', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets a PipelineJob. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedName = $pipelineServiceClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - * $response = $pipelineServiceClient->getPipelineJob($formattedName); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the PipelineJob resource. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\PipelineJob - * - * @throws ApiException if the remote call fails - */ - public function getPipelineJob($name, array $optionalArgs = []) - { - $request = new GetPipelineJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetPipelineJob', - PipelineJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a TrainingPipeline. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedName = $pipelineServiceClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - * $response = $pipelineServiceClient->getTrainingPipeline($formattedName); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TrainingPipeline resource. - * Format: - * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TrainingPipeline - * - * @throws ApiException if the remote call fails - */ - public function getTrainingPipeline($name, array $optionalArgs = []) - { - $request = new GetTrainingPipelineRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTrainingPipeline', - TrainingPipeline::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists PipelineJobs in a Location. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedParent = $pipelineServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $pipelineServiceClient->listPipelineJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $pipelineServiceClient->listPipelineJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the PipelineJobs from. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the PipelineJobs that match the filter expression. The following - * fields are supported: - * - * * `pipeline_name`: Supports `=` and `!=` comparisons. - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. - * for example, can check if pipeline's display_name contains *step* by - * doing display_name:\"*step*\" - * * `state`: Supports `=` and `!=` comparisons. - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality and key presence. - * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `template_metadata.version`: Supports `=`, `!=` comparisons, and `:` - * wildcard. - * - * Filter expressions can be combined together using logical operators - * (`AND` & `OR`). - * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. - * - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `create_time>"2021-05-18T00:00:00Z" OR - * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated - * after 2020-05-18 00:00:00 UTC. - * * `labels.env = "prod"` - * PipelineJobs with label "env" set to "prod". - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by. The default sort order is in - * ascending order. Use "desc" after a field name for descending. You can have - * multiple order_by fields provided e.g. "create_time desc, end_time", - * "end_time, start_time, update_time" For example, using "create_time desc, - * end_time" will order results by create time in descending order, and if - * there are multiple jobs having the same create time, order them by the end - * time in ascending order. if order_by is not specified, it will order by - * default order is create time in descending order. Supported fields: - * - * * `create_time` - * * `update_time` - * * `end_time` - * * `start_time` - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listPipelineJobs($parent, array $optionalArgs = []) - { - $request = new ListPipelineJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListPipelineJobs', - $optionalArgs, - ListPipelineJobsResponse::class, - $request - ); - } - - /** - * Lists TrainingPipelines in a Location. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $formattedParent = $pipelineServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $pipelineServiceClient->listTrainingPipelines($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $pipelineServiceClient->listTrainingPipelines($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the TrainingPipelines - * from. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` - * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` - * * `NOT display_name="my_pipeline"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `training_task_definition:"*automl_text_classification*"` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTrainingPipelines($parent, array $optionalArgs = []) - { - $request = new ListTrainingPipelinesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTrainingPipelines', - $optionalArgs, - ListTrainingPipelinesResponse::class, - $request - ); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $response = $pipelineServiceClient->getLocation(); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $pipelineServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $pipelineServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $resource = 'resource'; - * $response = $pipelineServiceClient->getIamPolicy($resource); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $pipelineServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $pipelineServiceClient = new PipelineServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $pipelineServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $pipelineServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/PredictionServiceGapicClient.php b/AiPlatform/src/V1/Gapic/PredictionServiceGapicClient.php deleted file mode 100644 index cd3d350f41be..000000000000 --- a/AiPlatform/src/V1/Gapic/PredictionServiceGapicClient.php +++ /dev/null @@ -1,1683 +0,0 @@ -endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $response = $predictionServiceClient->directPredict($formattedEndpoint); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\PredictionServiceClient}. - */ -class PredictionServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.PredictionService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $endpointNameTemplate; - - private static $projectLocationEndpointNameTemplate; - - private static $projectLocationPublisherModelNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/prediction_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/prediction_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/prediction_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/prediction_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$endpointNameTemplate; - } - - private static function getProjectLocationEndpointNameTemplate() - { - if (self::$projectLocationEndpointNameTemplate == null) { - self::$projectLocationEndpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$projectLocationEndpointNameTemplate; - } - - private static function getProjectLocationPublisherModelNameTemplate() - { - if (self::$projectLocationPublisherModelNameTemplate == null) { - self::$projectLocationPublisherModelNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ); - } - - return self::$projectLocationPublisherModelNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'endpoint' => self::getEndpointNameTemplate(), - 'projectLocationEndpoint' => self::getProjectLocationEndpointNameTemplate(), - 'projectLocationPublisherModel' => self::getProjectLocationPublisherModelNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName($project, $location, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_endpoint resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted project_location_endpoint resource. - */ - public static function projectLocationEndpointName( - $project, - $location, - $endpoint - ) { - return self::getProjectLocationEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_publisher_model resource. - * - * @param string $project - * @param string $location - * @param string $publisher - * @param string $model - * - * @return string The formatted project_location_publisher_model resource. - */ - public static function projectLocationPublisherModelName( - $project, - $location, - $publisher, - $model - ) { - return self::getProjectLocationPublisherModelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'publisher' => $publisher, - 'model' => $model, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - endpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - projectLocationEndpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - projectLocationPublisherModel: projects/{project}/locations/{location}/publishers/{publisher}/models/{model} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Perform an unary online prediction request to a gRPC model server for - * Vertex first-party products and frameworks. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $formattedEndpoint = $predictionServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $response = $predictionServiceClient->directPredict($formattedEndpoint); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type Tensor[] $inputs - * The prediction input. - * @type Tensor $parameters - * The parameters that govern the prediction. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\DirectPredictResponse - * - * @throws ApiException if the remote call fails - */ - public function directPredict($endpoint, array $optionalArgs = []) - { - $request = new DirectPredictRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $requestParamHeaders['endpoint'] = $endpoint; - if (isset($optionalArgs['inputs'])) { - $request->setInputs($optionalArgs['inputs']); - } - - if (isset($optionalArgs['parameters'])) { - $request->setParameters($optionalArgs['parameters']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DirectPredict', - DirectPredictResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Perform an unary online prediction request to a gRPC model server for - * custom containers. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $formattedEndpoint = $predictionServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $response = $predictionServiceClient->directRawPredict($formattedEndpoint); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type string $methodName - * Fully qualified name of the API method being invoked to perform - * predictions. - * - * Format: - * `/namespace.Service/Method/` - * Example: - * `/tensorflow.serving.PredictionService/Predict` - * @type string $input - * The prediction input. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\DirectRawPredictResponse - * - * @throws ApiException if the remote call fails - */ - public function directRawPredict($endpoint, array $optionalArgs = []) - { - $request = new DirectRawPredictRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $requestParamHeaders['endpoint'] = $endpoint; - if (isset($optionalArgs['methodName'])) { - $request->setMethodName($optionalArgs['methodName']); - } - - if (isset($optionalArgs['input'])) { - $request->setInput($optionalArgs['input']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DirectRawPredict', - DirectRawPredictResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Perform an online explanation. - * - * If - * [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] - * is specified, the corresponding DeployModel must have - * [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] - * populated. If - * [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] - * is not specified, all DeployedModels must have - * [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] - * populated. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $formattedEndpoint = $predictionServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $instances = []; - * $response = $predictionServiceClient->explain($formattedEndpoint, $instances); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint requested to serve the explanation. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param Value[] $instances Required. The instances that are the input to the explanation call. - * A DeployedModel may have an upper limit on the number of instances it - * supports per request, and when it is exceeded the explanation call errors - * in case of AutoML Models, or, in case of customer created Models, the - * behaviour is as documented by that Model. - * The schema of any single instance may be specified via Endpoint's - * DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] - * [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - * [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. - * @param array $optionalArgs { - * Optional. - * - * @type Value $parameters - * The parameters that govern the prediction. The schema of the parameters may - * be specified via Endpoint's DeployedModels' [Model's - * ][google.cloud.aiplatform.v1.DeployedModel.model] - * [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - * [parameters_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri]. - * @type ExplanationSpecOverride $explanationSpecOverride - * If specified, overrides the - * [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] - * of the DeployedModel. Can be used for explaining prediction results with - * different configurations, such as: - * - Explaining top-5 predictions results as opposed to top-1; - * - Increasing path count or step count of the attribution methods to reduce - * approximate errors; - * - Using different baselines for explaining the prediction results. - * @type string $deployedModelId - * If specified, this ExplainRequest will be served by the chosen - * DeployedModel, overriding - * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ExplainResponse - * - * @throws ApiException if the remote call fails - */ - public function explain($endpoint, $instances, array $optionalArgs = []) - { - $request = new ExplainRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setInstances($instances); - $requestParamHeaders['endpoint'] = $endpoint; - if (isset($optionalArgs['parameters'])) { - $request->setParameters($optionalArgs['parameters']); - } - - if (isset($optionalArgs['explanationSpecOverride'])) { - $request->setExplanationSpecOverride( - $optionalArgs['explanationSpecOverride'] - ); - } - - if (isset($optionalArgs['deployedModelId'])) { - $request->setDeployedModelId($optionalArgs['deployedModelId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'Explain', - ExplainResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Generate content with multimodal inputs. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $model = 'model'; - * $contents = []; - * $response = $predictionServiceClient->generateContent($model, $contents); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $model Required. The name of the publisher model requested to serve the - * prediction. Format: - * `projects/{project}/locations/{location}/publishers/*/models/*` - * @param Content[] $contents Required. The content of the current conversation with the model. - * - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. - * @param array $optionalArgs { - * Optional. - * - * @type Content $systemInstruction - * Optional. The user provided system instructions for the model. - * Note: only text should be used in parts and content in each part will be in - * a separate paragraph. - * @type Tool[] $tools - * Optional. A list of `Tools` the model may use to generate the next - * response. - * - * A `Tool` is a piece of code that enables the system to interact with - * external systems to perform an action, or set of actions, outside of - * knowledge and scope of the model. - * @type SafetySetting[] $safetySettings - * Optional. Per request settings for blocking unsafe content. - * Enforced on GenerateContentResponse.candidates. - * @type GenerationConfig $generationConfig - * Optional. Generation config. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\GenerateContentResponse - * - * @throws ApiException if the remote call fails - */ - public function generateContent($model, $contents, array $optionalArgs = []) - { - $request = new GenerateContentRequest(); - $requestParamHeaders = []; - $request->setModel($model); - $request->setContents($contents); - $requestParamHeaders['model'] = $model; - if (isset($optionalArgs['systemInstruction'])) { - $request->setSystemInstruction($optionalArgs['systemInstruction']); - } - - if (isset($optionalArgs['tools'])) { - $request->setTools($optionalArgs['tools']); - } - - if (isset($optionalArgs['safetySettings'])) { - $request->setSafetySettings($optionalArgs['safetySettings']); - } - - if (isset($optionalArgs['generationConfig'])) { - $request->setGenerationConfig($optionalArgs['generationConfig']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GenerateContent', - GenerateContentResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Perform an online prediction. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $formattedEndpoint = $predictionServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $instances = []; - * $response = $predictionServiceClient->predict($formattedEndpoint, $instances); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param Value[] $instances Required. The instances that are the input to the prediction call. - * A DeployedModel may have an upper limit on the number of instances it - * supports per request, and when it is exceeded the prediction call errors - * in case of AutoML Models, or, in case of customer created Models, the - * behaviour is as documented by that Model. - * The schema of any single instance may be specified via Endpoint's - * DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] - * [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - * [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. - * @param array $optionalArgs { - * Optional. - * - * @type Value $parameters - * The parameters that govern the prediction. The schema of the parameters may - * be specified via Endpoint's DeployedModels' [Model's - * ][google.cloud.aiplatform.v1.DeployedModel.model] - * [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - * [parameters_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri]. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\PredictResponse - * - * @throws ApiException if the remote call fails - */ - public function predict($endpoint, $instances, array $optionalArgs = []) - { - $request = new PredictRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setInstances($instances); - $requestParamHeaders['endpoint'] = $endpoint; - if (isset($optionalArgs['parameters'])) { - $request->setParameters($optionalArgs['parameters']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'Predict', - PredictResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Perform an online prediction with an arbitrary HTTP payload. - * - * The response includes the following HTTP headers: - * - * * `X-Vertex-AI-Endpoint-Id`: ID of the - * [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this - * prediction. - * - * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's - * [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] that served this - * prediction. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $formattedEndpoint = $predictionServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $response = $predictionServiceClient->rawPredict($formattedEndpoint); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type HttpBody $httpBody - * The prediction input. Supports HTTP headers and arbitrary data payload. - * - * A [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] may have an - * upper limit on the number of instances it supports per request. When this - * limit it is exceeded for an AutoML model, the - * [RawPredict][google.cloud.aiplatform.v1.PredictionService.RawPredict] - * method returns an error. When this limit is exceeded for a custom-trained - * model, the behavior varies depending on the model. - * - * You can specify the schema for each instance in the - * [predict_schemata.instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] - * field when you create a [Model][google.cloud.aiplatform.v1.Model]. This - * schema applies when you deploy the `Model` as a `DeployedModel` to an - * [Endpoint][google.cloud.aiplatform.v1.Endpoint] and use the `RawPredict` - * method. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Api\HttpBody - * - * @throws ApiException if the remote call fails - */ - public function rawPredict($endpoint, array $optionalArgs = []) - { - $request = new RawPredictRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $requestParamHeaders['endpoint'] = $endpoint; - if (isset($optionalArgs['httpBody'])) { - $request->setHttpBody($optionalArgs['httpBody']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'RawPredict', - HttpBody::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Perform a server-side streaming online prediction request for Vertex - * LLM streaming. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $formattedEndpoint = $predictionServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * // Read all responses until the stream is complete - * $stream = $predictionServiceClient->serverStreamingPredict($formattedEndpoint); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type Tensor[] $inputs - * The prediction input. - * @type Tensor $parameters - * The parameters that govern the prediction. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function serverStreamingPredict($endpoint, array $optionalArgs = []) - { - $request = new StreamingPredictRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $requestParamHeaders['endpoint'] = $endpoint; - if (isset($optionalArgs['inputs'])) { - $request->setInputs($optionalArgs['inputs']); - } - - if (isset($optionalArgs['parameters'])) { - $request->setParameters($optionalArgs['parameters']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ServerStreamingPredict', - StreamingPredictResponse::class, - $optionalArgs, - $request, - Call::SERVER_STREAMING_CALL - ); - } - - /** - * Perform a streaming online prediction request to a gRPC model server for - * Vertex first-party products and frameworks. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $endpoint = 'endpoint'; - * $request = new StreamDirectPredictRequest(); - * $request->setEndpoint($endpoint); - * // Write all requests to the server, then read all responses until the - * // stream is complete - * $requests = [ - * $request, - * ]; - * $stream = $predictionServiceClient->streamDirectPredict(); - * $stream->writeAll($requests); - * foreach ($stream->closeWriteAndReadAll() as $element) { - * // doSomethingWith($element); - * } - * // Alternatively: - * // Write requests individually, making read() calls if - * // required. Call closeWrite() once writes are complete, and read the - * // remaining responses from the server. - * $requests = [ - * $request, - * ]; - * $stream = $predictionServiceClient->streamDirectPredict(); - * foreach ($requests as $request) { - * $stream->write($request); - * // if required, read a single response from the stream - * $element = $stream->read(); - * // doSomethingWith($element) - * } - * $stream->closeWrite(); - * $element = $stream->read(); - * while (!is_null($element)) { - * // doSomethingWith($element) - * $element = $stream->read(); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\BidiStream - * - * @throws ApiException if the remote call fails - */ - public function streamDirectPredict(array $optionalArgs = []) - { - return $this->startCall( - 'StreamDirectPredict', - StreamDirectPredictResponse::class, - $optionalArgs, - null, - Call::BIDI_STREAMING_CALL - ); - } - - /** - * Perform a streaming online prediction request to a gRPC model server for - * custom containers. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $endpoint = 'endpoint'; - * $request = new StreamDirectRawPredictRequest(); - * $request->setEndpoint($endpoint); - * // Write all requests to the server, then read all responses until the - * // stream is complete - * $requests = [ - * $request, - * ]; - * $stream = $predictionServiceClient->streamDirectRawPredict(); - * $stream->writeAll($requests); - * foreach ($stream->closeWriteAndReadAll() as $element) { - * // doSomethingWith($element); - * } - * // Alternatively: - * // Write requests individually, making read() calls if - * // required. Call closeWrite() once writes are complete, and read the - * // remaining responses from the server. - * $requests = [ - * $request, - * ]; - * $stream = $predictionServiceClient->streamDirectRawPredict(); - * foreach ($requests as $request) { - * $stream->write($request); - * // if required, read a single response from the stream - * $element = $stream->read(); - * // doSomethingWith($element) - * } - * $stream->closeWrite(); - * $element = $stream->read(); - * while (!is_null($element)) { - * // doSomethingWith($element) - * $element = $stream->read(); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\BidiStream - * - * @throws ApiException if the remote call fails - */ - public function streamDirectRawPredict(array $optionalArgs = []) - { - return $this->startCall( - 'StreamDirectRawPredict', - StreamDirectRawPredictResponse::class, - $optionalArgs, - null, - Call::BIDI_STREAMING_CALL - ); - } - - /** - * Generate content with multimodal inputs with streaming support. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $model = 'model'; - * $contents = []; - * // Read all responses until the stream is complete - * $stream = $predictionServiceClient->streamGenerateContent($model, $contents); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $model Required. The name of the publisher model requested to serve the - * prediction. Format: - * `projects/{project}/locations/{location}/publishers/*/models/*` - * @param Content[] $contents Required. The content of the current conversation with the model. - * - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. - * @param array $optionalArgs { - * Optional. - * - * @type Content $systemInstruction - * Optional. The user provided system instructions for the model. - * Note: only text should be used in parts and content in each part will be in - * a separate paragraph. - * @type Tool[] $tools - * Optional. A list of `Tools` the model may use to generate the next - * response. - * - * A `Tool` is a piece of code that enables the system to interact with - * external systems to perform an action, or set of actions, outside of - * knowledge and scope of the model. - * @type SafetySetting[] $safetySettings - * Optional. Per request settings for blocking unsafe content. - * Enforced on GenerateContentResponse.candidates. - * @type GenerationConfig $generationConfig - * Optional. Generation config. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function streamGenerateContent( - $model, - $contents, - array $optionalArgs = [] - ) { - $request = new GenerateContentRequest(); - $requestParamHeaders = []; - $request->setModel($model); - $request->setContents($contents); - $requestParamHeaders['model'] = $model; - if (isset($optionalArgs['systemInstruction'])) { - $request->setSystemInstruction($optionalArgs['systemInstruction']); - } - - if (isset($optionalArgs['tools'])) { - $request->setTools($optionalArgs['tools']); - } - - if (isset($optionalArgs['safetySettings'])) { - $request->setSafetySettings($optionalArgs['safetySettings']); - } - - if (isset($optionalArgs['generationConfig'])) { - $request->setGenerationConfig($optionalArgs['generationConfig']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'StreamGenerateContent', - GenerateContentResponse::class, - $optionalArgs, - $request, - Call::SERVER_STREAMING_CALL - ); - } - - /** - * Perform a streaming online prediction with an arbitrary HTTP payload. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $formattedEndpoint = $predictionServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * // Read all responses until the stream is complete - * $stream = $predictionServiceClient->streamRawPredict($formattedEndpoint); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $endpoint Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type HttpBody $httpBody - * The prediction input. Supports HTTP headers and arbitrary data payload. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function streamRawPredict($endpoint, array $optionalArgs = []) - { - $request = new StreamRawPredictRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $requestParamHeaders['endpoint'] = $endpoint; - if (isset($optionalArgs['httpBody'])) { - $request->setHttpBody($optionalArgs['httpBody']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'StreamRawPredict', - HttpBody::class, - $optionalArgs, - $request, - Call::SERVER_STREAMING_CALL - ); - } - - /** - * Perform a streaming online prediction request for Vertex first-party - * products and frameworks. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $endpoint = 'endpoint'; - * $request = new StreamingPredictRequest(); - * $request->setEndpoint($endpoint); - * // Write all requests to the server, then read all responses until the - * // stream is complete - * $requests = [ - * $request, - * ]; - * $stream = $predictionServiceClient->streamingPredict(); - * $stream->writeAll($requests); - * foreach ($stream->closeWriteAndReadAll() as $element) { - * // doSomethingWith($element); - * } - * // Alternatively: - * // Write requests individually, making read() calls if - * // required. Call closeWrite() once writes are complete, and read the - * // remaining responses from the server. - * $requests = [ - * $request, - * ]; - * $stream = $predictionServiceClient->streamingPredict(); - * foreach ($requests as $request) { - * $stream->write($request); - * // if required, read a single response from the stream - * $element = $stream->read(); - * // doSomethingWith($element) - * } - * $stream->closeWrite(); - * $element = $stream->read(); - * while (!is_null($element)) { - * // doSomethingWith($element) - * $element = $stream->read(); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\BidiStream - * - * @throws ApiException if the remote call fails - */ - public function streamingPredict(array $optionalArgs = []) - { - return $this->startCall( - 'StreamingPredict', - StreamingPredictResponse::class, - $optionalArgs, - null, - Call::BIDI_STREAMING_CALL - ); - } - - /** - * Perform a streaming online prediction request through gRPC. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $endpoint = 'endpoint'; - * $request = new StreamingRawPredictRequest(); - * $request->setEndpoint($endpoint); - * // Write all requests to the server, then read all responses until the - * // stream is complete - * $requests = [ - * $request, - * ]; - * $stream = $predictionServiceClient->streamingRawPredict(); - * $stream->writeAll($requests); - * foreach ($stream->closeWriteAndReadAll() as $element) { - * // doSomethingWith($element); - * } - * // Alternatively: - * // Write requests individually, making read() calls if - * // required. Call closeWrite() once writes are complete, and read the - * // remaining responses from the server. - * $requests = [ - * $request, - * ]; - * $stream = $predictionServiceClient->streamingRawPredict(); - * foreach ($requests as $request) { - * $stream->write($request); - * // if required, read a single response from the stream - * $element = $stream->read(); - * // doSomethingWith($element) - * } - * $stream->closeWrite(); - * $element = $stream->read(); - * while (!is_null($element)) { - * // doSomethingWith($element) - * $element = $stream->read(); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\BidiStream - * - * @throws ApiException if the remote call fails - */ - public function streamingRawPredict(array $optionalArgs = []) - { - return $this->startCall( - 'StreamingRawPredict', - StreamingRawPredictResponse::class, - $optionalArgs, - null, - Call::BIDI_STREAMING_CALL - ); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $response = $predictionServiceClient->getLocation(); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $predictionServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $predictionServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $resource = 'resource'; - * $response = $predictionServiceClient->getIamPolicy($resource); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $predictionServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $predictionServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/ScheduleServiceGapicClient.php b/AiPlatform/src/V1/Gapic/ScheduleServiceGapicClient.php deleted file mode 100644 index d71a12bf6817..000000000000 --- a/AiPlatform/src/V1/Gapic/ScheduleServiceGapicClient.php +++ /dev/null @@ -1,1445 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $schedule = new Schedule(); - * $response = $scheduleServiceClient->createSchedule($formattedParent, $schedule); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\ScheduleServiceClient}. - */ -class ScheduleServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.ScheduleService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $artifactNameTemplate; - - private static $contextNameTemplate; - - private static $customJobNameTemplate; - - private static $executionNameTemplate; - - private static $locationNameTemplate; - - private static $metadataStoreNameTemplate; - - private static $networkNameTemplate; - - private static $pipelineJobNameTemplate; - - private static $scheduleNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/schedule_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/schedule_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/schedule_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/schedule_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getArtifactNameTemplate() - { - if (self::$artifactNameTemplate == null) { - self::$artifactNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ); - } - - return self::$artifactNameTemplate; - } - - private static function getContextNameTemplate() - { - if (self::$contextNameTemplate == null) { - self::$contextNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ); - } - - return self::$contextNameTemplate; - } - - private static function getCustomJobNameTemplate() - { - if (self::$customJobNameTemplate == null) { - self::$customJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ); - } - - return self::$customJobNameTemplate; - } - - private static function getExecutionNameTemplate() - { - if (self::$executionNameTemplate == null) { - self::$executionNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ); - } - - return self::$executionNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getMetadataStoreNameTemplate() - { - if (self::$metadataStoreNameTemplate == null) { - self::$metadataStoreNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ); - } - - return self::$metadataStoreNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate( - 'projects/{project}/global/networks/{network}' - ); - } - - return self::$networkNameTemplate; - } - - private static function getPipelineJobNameTemplate() - { - if (self::$pipelineJobNameTemplate == null) { - self::$pipelineJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ); - } - - return self::$pipelineJobNameTemplate; - } - - private static function getScheduleNameTemplate() - { - if (self::$scheduleNameTemplate == null) { - self::$scheduleNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ); - } - - return self::$scheduleNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'artifact' => self::getArtifactNameTemplate(), - 'context' => self::getContextNameTemplate(), - 'customJob' => self::getCustomJobNameTemplate(), - 'execution' => self::getExecutionNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'metadataStore' => self::getMetadataStoreNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'pipelineJob' => self::getPipelineJobNameTemplate(), - 'schedule' => self::getScheduleNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a artifact - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $artifact - * - * @return string The formatted artifact resource. - */ - public static function artifactName( - $project, - $location, - $metadataStore, - $artifact - ) { - return self::getArtifactNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'artifact' => $artifact, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a context - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $context - * - * @return string The formatted context resource. - */ - public static function contextName( - $project, - $location, - $metadataStore, - $context - ) { - return self::getContextNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a custom_job - * resource. - * - * @param string $project - * @param string $location - * @param string $customJob - * - * @return string The formatted custom_job resource. - */ - public static function customJobName($project, $location, $customJob) - { - return self::getCustomJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'custom_job' => $customJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a execution - * resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * @param string $execution - * - * @return string The formatted execution resource. - */ - public static function executionName( - $project, - $location, - $metadataStore, - $execution - ) { - return self::getExecutionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - 'execution' => $execution, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * metadata_store resource. - * - * @param string $project - * @param string $location - * @param string $metadataStore - * - * @return string The formatted metadata_store resource. - */ - public static function metadataStoreName( - $project, - $location, - $metadataStore - ) { - return self::getMetadataStoreNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'metadata_store' => $metadataStore, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a pipeline_job - * resource. - * - * @param string $project - * @param string $location - * @param string $pipelineJob - * - * @return string The formatted pipeline_job resource. - */ - public static function pipelineJobName($project, $location, $pipelineJob) - { - return self::getPipelineJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'pipeline_job' => $pipelineJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a schedule - * resource. - * - * @param string $project - * @param string $location - * @param string $schedule - * - * @return string The formatted schedule resource. - */ - public static function scheduleName($project, $location, $schedule) - { - return self::getScheduleNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'schedule' => $schedule, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - artifact: projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact} - * - context: projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context} - * - customJob: projects/{project}/locations/{location}/customJobs/{custom_job} - * - execution: projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution} - * - location: projects/{project}/locations/{location} - * - metadataStore: projects/{project}/locations/{location}/metadataStores/{metadata_store} - * - network: projects/{project}/global/networks/{network} - * - pipelineJob: projects/{project}/locations/{location}/pipelineJobs/{pipeline_job} - * - schedule: projects/{project}/locations/{location}/schedules/{schedule} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a Schedule. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $formattedParent = $scheduleServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $schedule = new Schedule(); - * $response = $scheduleServiceClient->createSchedule($formattedParent, $schedule); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the Schedule in. - * Format: `projects/{project}/locations/{location}` - * @param Schedule $schedule Required. The Schedule to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Schedule - * - * @throws ApiException if the remote call fails - */ - public function createSchedule($parent, $schedule, array $optionalArgs = []) - { - $request = new CreateScheduleRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setSchedule($schedule); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateSchedule', - Schedule::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a Schedule. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $formattedName = $scheduleServiceClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - * $operationResponse = $scheduleServiceClient->deleteSchedule($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $scheduleServiceClient->deleteSchedule($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $scheduleServiceClient->resumeOperation($operationName, 'deleteSchedule'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Schedule resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/schedules/{schedule}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteSchedule($name, array $optionalArgs = []) - { - $request = new DeleteScheduleRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteSchedule', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets a Schedule. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $formattedName = $scheduleServiceClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - * $response = $scheduleServiceClient->getSchedule($formattedName); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Schedule resource. - * Format: - * `projects/{project}/locations/{location}/schedules/{schedule}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Schedule - * - * @throws ApiException if the remote call fails - */ - public function getSchedule($name, array $optionalArgs = []) - { - $request = new GetScheduleRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetSchedule', - Schedule::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists Schedules in a Location. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $formattedParent = $scheduleServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $scheduleServiceClient->listSchedules($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $scheduleServiceClient->listSchedules($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the Schedules from. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the Schedules that match the filter expression. The following - * fields are supported: - * - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `state`: Supports `=` and `!=` comparisons. - * * `request`: Supports existence of the check. - * (e.g. `create_pipeline_job_request:*` --> Schedule has - * create_pipeline_job_request). - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` - * existence check. Values must be in RFC 3339 format. - * * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` - * comparisons. Values must be in RFC 3339 format. - * - * - * Filter expressions can be combined together using logical operators - * (`NOT`, `AND` & `OR`). - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `state="ACTIVE" AND display_name:"my_schedule_*"` - * * `NOT display_name="my_schedule"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` - * * `create_pipeline_job_request:*` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * A comma-separated list of fields to order by. The default sort order is in - * ascending order. Use "desc" after a field name for descending. You can have - * multiple order_by fields provided. - * - * For example, using "create_time desc, end_time" will order results by - * create time in descending order, and if there are multiple schedules having - * the same create time, order them by the end time in ascending order. - * - * If order_by is not specified, it will order by default with create_time in - * descending order. - * - * Supported fields: - * - * * `create_time` - * * `start_time` - * * `end_time` - * * `next_run_time` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSchedules($parent, array $optionalArgs = []) - { - $request = new ListSchedulesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListSchedules', - $optionalArgs, - ListSchedulesResponse::class, - $request - ); - } - - /** - * Pauses a Schedule. Will mark - * [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'PAUSED'. If - * the schedule is paused, no new runs will be created. Already created runs - * will NOT be paused or canceled. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $formattedName = $scheduleServiceClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - * $scheduleServiceClient->pauseSchedule($formattedName); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Schedule resource to be paused. - * Format: - * `projects/{project}/locations/{location}/schedules/{schedule}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function pauseSchedule($name, array $optionalArgs = []) - { - $request = new PauseScheduleRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'PauseSchedule', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Resumes a paused Schedule to start scheduling new runs. Will mark - * [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'ACTIVE'. - * Only paused Schedule can be resumed. - * - * When the Schedule is resumed, new runs will be scheduled starting from the - * next execution time after the current time based on the time_specification - * in the Schedule. If [Schedule.catchUp][] is set up true, all - * missed runs will be scheduled for backfill first. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $formattedName = $scheduleServiceClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - * $scheduleServiceClient->resumeSchedule($formattedName); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Schedule resource to be resumed. - * Format: - * `projects/{project}/locations/{location}/schedules/{schedule}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $catchUp - * Optional. Whether to backfill missed runs when the schedule is resumed from - * PAUSED state. If set to true, all missed runs will be scheduled. New runs - * will be scheduled after the backfill is complete. This will also update - * [Schedule.catch_up][google.cloud.aiplatform.v1.Schedule.catch_up] field. - * Default to false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function resumeSchedule($name, array $optionalArgs = []) - { - $request = new ResumeScheduleRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['catchUp'])) { - $request->setCatchUp($optionalArgs['catchUp']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ResumeSchedule', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates an active or paused Schedule. - * - * When the Schedule is updated, new runs will be scheduled starting from the - * updated next execution time after the update time based on the - * time_specification in the updated Schedule. All unstarted runs before the - * update time will be skipped while already created runs will NOT be paused - * or canceled. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $schedule = new Schedule(); - * $updateMask = new FieldMask(); - * $response = $scheduleServiceClient->updateSchedule($schedule, $updateMask); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param Schedule $schedule Required. The Schedule which replaces the resource on the server. - * The following restrictions will be applied: - * - * * The scheduled request type cannot be changed. - * * The non-empty fields cannot be unset. - * * The output_only fields will be ignored if specified. - * @param FieldMask $updateMask Required. The update mask applies to the resource. See - * [google.protobuf.FieldMask][google.protobuf.FieldMask]. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Schedule - * - * @throws ApiException if the remote call fails - */ - public function updateSchedule( - $schedule, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateScheduleRequest(); - $requestParamHeaders = []; - $request->setSchedule($schedule); - $request->setUpdateMask($updateMask); - $requestParamHeaders['schedule.name'] = $schedule->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateSchedule', - Schedule::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $response = $scheduleServiceClient->getLocation(); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $scheduleServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $scheduleServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $resource = 'resource'; - * $response = $scheduleServiceClient->getIamPolicy($resource); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $scheduleServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $scheduleServiceClient = new ScheduleServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $scheduleServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $scheduleServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/SpecialistPoolServiceGapicClient.php b/AiPlatform/src/V1/Gapic/SpecialistPoolServiceGapicClient.php deleted file mode 100644 index b484a3a3880c..000000000000 --- a/AiPlatform/src/V1/Gapic/SpecialistPoolServiceGapicClient.php +++ /dev/null @@ -1,1102 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $specialistPool = new SpecialistPool(); - * $operationResponse = $specialistPoolServiceClient->createSpecialistPool($formattedParent, $specialistPool); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $specialistPoolServiceClient->createSpecialistPool($formattedParent, $specialistPool); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $specialistPoolServiceClient->resumeOperation($operationName, 'createSpecialistPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\SpecialistPoolServiceClient}. - */ -class SpecialistPoolServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.SpecialistPoolService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationNameTemplate; - - private static $specialistPoolNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/specialist_pool_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/specialist_pool_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/specialist_pool_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/specialist_pool_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getSpecialistPoolNameTemplate() - { - if (self::$specialistPoolNameTemplate == null) { - self::$specialistPoolNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ); - } - - return self::$specialistPoolNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'specialistPool' => self::getSpecialistPoolNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * specialist_pool resource. - * - * @param string $project - * @param string $location - * @param string $specialistPool - * - * @return string The formatted specialist_pool resource. - */ - public static function specialistPoolName( - $project, - $location, - $specialistPool - ) { - return self::getSpecialistPoolNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'specialist_pool' => $specialistPool, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - specialistPool: projects/{project}/locations/{location}/specialistPools/{specialist_pool} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a SpecialistPool. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * $formattedParent = $specialistPoolServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $specialistPool = new SpecialistPool(); - * $operationResponse = $specialistPoolServiceClient->createSpecialistPool($formattedParent, $specialistPool); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $specialistPoolServiceClient->createSpecialistPool($formattedParent, $specialistPool); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $specialistPoolServiceClient->resumeOperation($operationName, 'createSpecialistPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent Project name for the new SpecialistPool. - * The form is `projects/{project}/locations/{location}`. - * @param SpecialistPool $specialistPool Required. The SpecialistPool to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createSpecialistPool( - $parent, - $specialistPool, - array $optionalArgs = [] - ) { - $request = new CreateSpecialistPoolRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setSpecialistPool($specialistPool); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateSpecialistPool', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a SpecialistPool as well as all Specialists in the pool. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * $formattedName = $specialistPoolServiceClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - * $operationResponse = $specialistPoolServiceClient->deleteSpecialistPool($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $specialistPoolServiceClient->deleteSpecialistPool($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $specialistPoolServiceClient->resumeOperation($operationName, 'deleteSpecialistPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the SpecialistPool to delete. Format: - * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * If set to true, any specialist managers in this SpecialistPool will also be - * deleted. (Otherwise, the request will only work if the SpecialistPool has - * no specialist managers.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteSpecialistPool($name, array $optionalArgs = []) - { - $request = new DeleteSpecialistPoolRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteSpecialistPool', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets a SpecialistPool. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * $formattedName = $specialistPoolServiceClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - * $response = $specialistPoolServiceClient->getSpecialistPool($formattedName); - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the SpecialistPool resource. - * The form is - * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\SpecialistPool - * - * @throws ApiException if the remote call fails - */ - public function getSpecialistPool($name, array $optionalArgs = []) - { - $request = new GetSpecialistPoolRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetSpecialistPool', - SpecialistPool::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists SpecialistPools in a Location. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * $formattedParent = $specialistPoolServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $specialistPoolServiceClient->listSpecialistPools($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $specialistPoolServiceClient->listSpecialistPools($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the SpecialistPool's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Mask specifying which fields to read. FieldMask represents a set of - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSpecialistPools($parent, array $optionalArgs = []) - { - $request = new ListSpecialistPoolsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListSpecialistPools', - $optionalArgs, - ListSpecialistPoolsResponse::class, - $request - ); - } - - /** - * Updates a SpecialistPool. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * $specialistPool = new SpecialistPool(); - * $updateMask = new FieldMask(); - * $operationResponse = $specialistPoolServiceClient->updateSpecialistPool($specialistPool, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $specialistPoolServiceClient->updateSpecialistPool($specialistPool, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $specialistPoolServiceClient->resumeOperation($operationName, 'updateSpecialistPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param SpecialistPool $specialistPool Required. The SpecialistPool which replaces the resource on the server. - * @param FieldMask $updateMask Required. The update mask applies to the resource. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateSpecialistPool( - $specialistPool, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateSpecialistPoolRequest(); - $requestParamHeaders = []; - $request->setSpecialistPool($specialistPool); - $request->setUpdateMask($updateMask); - $requestParamHeaders[ - 'specialist_pool.name' - ] = $specialistPool->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateSpecialistPool', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * $response = $specialistPoolServiceClient->getLocation(); - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $specialistPoolServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $specialistPoolServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * $resource = 'resource'; - * $response = $specialistPoolServiceClient->getIamPolicy($resource); - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $specialistPoolServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $specialistPoolServiceClient = new SpecialistPoolServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $specialistPoolServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $specialistPoolServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/TensorboardServiceGapicClient.php b/AiPlatform/src/V1/Gapic/TensorboardServiceGapicClient.php deleted file mode 100644 index ad2229b7ff37..000000000000 --- a/AiPlatform/src/V1/Gapic/TensorboardServiceGapicClient.php +++ /dev/null @@ -1,2943 +0,0 @@ -tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - * $requests = []; - * $response = $tensorboardServiceClient->batchCreateTensorboardRuns($formattedParent, $requests); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\TensorboardServiceClient}. - */ -class TensorboardServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.TensorboardService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $locationNameTemplate; - - private static $tensorboardNameTemplate; - - private static $tensorboardExperimentNameTemplate; - - private static $tensorboardRunNameTemplate; - - private static $tensorboardTimeSeriesNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/tensorboard_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/tensorboard_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/tensorboard_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/tensorboard_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getTensorboardNameTemplate() - { - if (self::$tensorboardNameTemplate == null) { - self::$tensorboardNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ); - } - - return self::$tensorboardNameTemplate; - } - - private static function getTensorboardExperimentNameTemplate() - { - if (self::$tensorboardExperimentNameTemplate == null) { - self::$tensorboardExperimentNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ); - } - - return self::$tensorboardExperimentNameTemplate; - } - - private static function getTensorboardRunNameTemplate() - { - if (self::$tensorboardRunNameTemplate == null) { - self::$tensorboardRunNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ); - } - - return self::$tensorboardRunNameTemplate; - } - - private static function getTensorboardTimeSeriesNameTemplate() - { - if (self::$tensorboardTimeSeriesNameTemplate == null) { - self::$tensorboardTimeSeriesNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ); - } - - return self::$tensorboardTimeSeriesNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'tensorboard' => self::getTensorboardNameTemplate(), - 'tensorboardExperiment' => self::getTensorboardExperimentNameTemplate(), - 'tensorboardRun' => self::getTensorboardRunNameTemplate(), - 'tensorboardTimeSeries' => self::getTensorboardTimeSeriesNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a tensorboard - * resource. - * - * @param string $project - * @param string $location - * @param string $tensorboard - * - * @return string The formatted tensorboard resource. - */ - public static function tensorboardName($project, $location, $tensorboard) - { - return self::getTensorboardNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'tensorboard' => $tensorboard, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * tensorboard_experiment resource. - * - * @param string $project - * @param string $location - * @param string $tensorboard - * @param string $experiment - * - * @return string The formatted tensorboard_experiment resource. - */ - public static function tensorboardExperimentName( - $project, - $location, - $tensorboard, - $experiment - ) { - return self::getTensorboardExperimentNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'tensorboard' => $tensorboard, - 'experiment' => $experiment, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * tensorboard_run resource. - * - * @param string $project - * @param string $location - * @param string $tensorboard - * @param string $experiment - * @param string $run - * - * @return string The formatted tensorboard_run resource. - */ - public static function tensorboardRunName( - $project, - $location, - $tensorboard, - $experiment, - $run - ) { - return self::getTensorboardRunNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'tensorboard' => $tensorboard, - 'experiment' => $experiment, - 'run' => $run, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * tensorboard_time_series resource. - * - * @param string $project - * @param string $location - * @param string $tensorboard - * @param string $experiment - * @param string $run - * @param string $timeSeries - * - * @return string The formatted tensorboard_time_series resource. - */ - public static function tensorboardTimeSeriesName( - $project, - $location, - $tensorboard, - $experiment, - $run, - $timeSeries - ) { - return self::getTensorboardTimeSeriesNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'tensorboard' => $tensorboard, - 'experiment' => $experiment, - 'run' => $run, - 'time_series' => $timeSeries, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - tensorboard: projects/{project}/locations/{location}/tensorboards/{tensorboard} - * - tensorboardExperiment: projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment} - * - tensorboardRun: projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run} - * - tensorboardTimeSeries: projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Batch create TensorboardRuns. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - * $requests = []; - * $response = $tensorboardServiceClient->batchCreateTensorboardRuns($formattedParent, $requests); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the TensorboardExperiment to create the - * TensorboardRuns in. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * The parent field in the CreateTensorboardRunRequest messages must match - * this field. - * @param CreateTensorboardRunRequest[] $requests Required. The request message specifying the TensorboardRuns to create. - * A maximum of 1000 TensorboardRuns can be created in a batch. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\BatchCreateTensorboardRunsResponse - * - * @throws ApiException if the remote call fails - */ - public function batchCreateTensorboardRuns( - $parent, - $requests, - array $optionalArgs = [] - ) { - $request = new BatchCreateTensorboardRunsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRequests($requests); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'BatchCreateTensorboardRuns', - BatchCreateTensorboardRunsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - * $requests = []; - * $response = $tensorboardServiceClient->batchCreateTensorboardTimeSeries($formattedParent, $requests); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the TensorboardExperiment to create the - * TensorboardTimeSeries in. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * The TensorboardRuns referenced by the parent fields in the - * CreateTensorboardTimeSeriesRequest messages must be sub resources of this - * TensorboardExperiment. - * @param CreateTensorboardTimeSeriesRequest[] $requests Required. The request message specifying the TensorboardTimeSeries to - * create. A maximum of 1000 TensorboardTimeSeries can be created in a batch. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\BatchCreateTensorboardTimeSeriesResponse - * - * @throws ApiException if the remote call fails - */ - public function batchCreateTensorboardTimeSeries( - $parent, - $requests, - array $optionalArgs = [] - ) { - $request = new BatchCreateTensorboardTimeSeriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRequests($requests); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'BatchCreateTensorboardTimeSeries', - BatchCreateTensorboardTimeSeriesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Reads multiple TensorboardTimeSeries' data. The data point number limit is - * 1000 for scalars, 100 for tensors and blob references. If the number of - * data points stored is less than the limit, all data is returned. - * Otherwise, the number limit of data points is randomly selected from - * this time series and returned. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedTensorboard = $tensorboardServiceClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - * $formattedTimeSeries = [ - * $tensorboardServiceClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'), - * ]; - * $response = $tensorboardServiceClient->batchReadTensorboardTimeSeriesData($formattedTensorboard, $formattedTimeSeries); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $tensorboard Required. The resource name of the Tensorboard containing - * TensorboardTimeSeries to read data from. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. - * The TensorboardTimeSeries referenced by - * [time_series][google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.time_series] - * must be sub resources of this Tensorboard. - * @param string[] $timeSeries Required. The resource names of the TensorboardTimeSeries to read data - * from. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\BatchReadTensorboardTimeSeriesDataResponse - * - * @throws ApiException if the remote call fails - */ - public function batchReadTensorboardTimeSeriesData( - $tensorboard, - $timeSeries, - array $optionalArgs = [] - ) { - $request = new BatchReadTensorboardTimeSeriesDataRequest(); - $requestParamHeaders = []; - $request->setTensorboard($tensorboard); - $request->setTimeSeries($timeSeries); - $requestParamHeaders['tensorboard'] = $tensorboard; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'BatchReadTensorboardTimeSeriesData', - BatchReadTensorboardTimeSeriesDataResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a Tensorboard. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - * $tensorboard = new Tensorboard(); - * $operationResponse = $tensorboardServiceClient->createTensorboard($formattedParent, $tensorboard); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tensorboardServiceClient->createTensorboard($formattedParent, $tensorboard); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tensorboardServiceClient->resumeOperation($operationName, 'createTensorboard'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the Tensorboard in. - * Format: `projects/{project}/locations/{location}` - * @param Tensorboard $tensorboard Required. The Tensorboard to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTensorboard( - $parent, - $tensorboard, - array $optionalArgs = [] - ) { - $request = new CreateTensorboardRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTensorboard($tensorboard); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateTensorboard', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a TensorboardExperiment. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - * $tensorboardExperimentId = 'tensorboard_experiment_id'; - * $response = $tensorboardServiceClient->createTensorboardExperiment($formattedParent, $tensorboardExperimentId); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Tensorboard to create the - * TensorboardExperiment in. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param string $tensorboardExperimentId Required. The ID to use for the Tensorboard experiment, which becomes the - * final component of the Tensorboard experiment's resource name. - * - * This value should be 1-128 characters, and valid characters - * are `/[a-z][0-9]-/`. - * @param array $optionalArgs { - * Optional. - * - * @type TensorboardExperiment $tensorboardExperiment - * The TensorboardExperiment to create. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TensorboardExperiment - * - * @throws ApiException if the remote call fails - */ - public function createTensorboardExperiment( - $parent, - $tensorboardExperimentId, - array $optionalArgs = [] - ) { - $request = new CreateTensorboardExperimentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTensorboardExperimentId($tensorboardExperimentId); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['tensorboardExperiment'])) { - $request->setTensorboardExperiment( - $optionalArgs['tensorboardExperiment'] - ); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateTensorboardExperiment', - TensorboardExperiment::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a TensorboardRun. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - * $tensorboardRun = new TensorboardRun(); - * $tensorboardRunId = 'tensorboard_run_id'; - * $response = $tensorboardServiceClient->createTensorboardRun($formattedParent, $tensorboardRun, $tensorboardRunId); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the TensorboardExperiment to create the - * TensorboardRun in. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param TensorboardRun $tensorboardRun Required. The TensorboardRun to create. - * @param string $tensorboardRunId Required. The ID to use for the Tensorboard run, which becomes the final - * component of the Tensorboard run's resource name. - * - * This value should be 1-128 characters, and valid characters - * are `/[a-z][0-9]-/`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TensorboardRun - * - * @throws ApiException if the remote call fails - */ - public function createTensorboardRun( - $parent, - $tensorboardRun, - $tensorboardRunId, - array $optionalArgs = [] - ) { - $request = new CreateTensorboardRunRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTensorboardRun($tensorboardRun); - $request->setTensorboardRunId($tensorboardRunId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateTensorboardRun', - TensorboardRun::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a TensorboardTimeSeries. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - * $tensorboardTimeSeries = new TensorboardTimeSeries(); - * $response = $tensorboardServiceClient->createTensorboardTimeSeries($formattedParent, $tensorboardTimeSeries); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the TensorboardRun to create the - * TensorboardTimeSeries in. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param TensorboardTimeSeries $tensorboardTimeSeries Required. The TensorboardTimeSeries to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $tensorboardTimeSeriesId - * Optional. The user specified unique ID to use for the - * TensorboardTimeSeries, which becomes the final component of the - * TensorboardTimeSeries's resource name. This value should match - * "[a-z0-9][a-z0-9-]{0, 127}" - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TensorboardTimeSeries - * - * @throws ApiException if the remote call fails - */ - public function createTensorboardTimeSeries( - $parent, - $tensorboardTimeSeries, - array $optionalArgs = [] - ) { - $request = new CreateTensorboardTimeSeriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTensorboardTimeSeries($tensorboardTimeSeries); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['tensorboardTimeSeriesId'])) { - $request->setTensorboardTimeSeriesId( - $optionalArgs['tensorboardTimeSeriesId'] - ); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateTensorboardTimeSeries', - TensorboardTimeSeries::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a Tensorboard. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedName = $tensorboardServiceClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - * $operationResponse = $tensorboardServiceClient->deleteTensorboard($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tensorboardServiceClient->deleteTensorboard($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tensorboardServiceClient->resumeOperation($operationName, 'deleteTensorboard'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Tensorboard to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTensorboard($name, array $optionalArgs = []) - { - $request = new DeleteTensorboardRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteTensorboard', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a TensorboardExperiment. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedName = $tensorboardServiceClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - * $operationResponse = $tensorboardServiceClient->deleteTensorboardExperiment($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tensorboardServiceClient->deleteTensorboardExperiment($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tensorboardServiceClient->resumeOperation($operationName, 'deleteTensorboardExperiment'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TensorboardExperiment to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTensorboardExperiment($name, array $optionalArgs = []) - { - $request = new DeleteTensorboardExperimentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteTensorboardExperiment', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a TensorboardRun. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedName = $tensorboardServiceClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - * $operationResponse = $tensorboardServiceClient->deleteTensorboardRun($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tensorboardServiceClient->deleteTensorboardRun($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tensorboardServiceClient->resumeOperation($operationName, 'deleteTensorboardRun'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TensorboardRun to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTensorboardRun($name, array $optionalArgs = []) - { - $request = new DeleteTensorboardRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteTensorboardRun', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a TensorboardTimeSeries. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedName = $tensorboardServiceClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - * $operationResponse = $tensorboardServiceClient->deleteTensorboardTimeSeries($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tensorboardServiceClient->deleteTensorboardTimeSeries($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tensorboardServiceClient->resumeOperation($operationName, 'deleteTensorboardTimeSeries'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TensorboardTimeSeries to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTensorboardTimeSeries($name, array $optionalArgs = []) - { - $request = new DeleteTensorboardTimeSeriesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteTensorboardTimeSeries', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Exports a TensorboardTimeSeries' data. Data is returned in paginated - * responses. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedTensorboardTimeSeries = $tensorboardServiceClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - * // Iterate over pages of elements - * $pagedResponse = $tensorboardServiceClient->exportTensorboardTimeSeriesData($formattedTensorboardTimeSeries); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tensorboardServiceClient->exportTensorboardTimeSeriesData($formattedTensorboardTimeSeries); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $tensorboardTimeSeries Required. The resource name of the TensorboardTimeSeries to export data - * from. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Exports the TensorboardTimeSeries' data that match the filter expression. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * Field to use to sort the TensorboardTimeSeries' data. - * By default, TensorboardTimeSeries' data is returned in a pseudo random - * order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function exportTensorboardTimeSeriesData( - $tensorboardTimeSeries, - array $optionalArgs = [] - ) { - $request = new ExportTensorboardTimeSeriesDataRequest(); - $requestParamHeaders = []; - $request->setTensorboardTimeSeries($tensorboardTimeSeries); - $requestParamHeaders[ - 'tensorboard_time_series' - ] = $tensorboardTimeSeries; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ExportTensorboardTimeSeriesData', - $optionalArgs, - ExportTensorboardTimeSeriesDataResponse::class, - $request - ); - } - - /** - * Gets a Tensorboard. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedName = $tensorboardServiceClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - * $response = $tensorboardServiceClient->getTensorboard($formattedName); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Tensorboard resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Tensorboard - * - * @throws ApiException if the remote call fails - */ - public function getTensorboard($name, array $optionalArgs = []) - { - $request = new GetTensorboardRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTensorboard', - Tensorboard::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a TensorboardExperiment. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedName = $tensorboardServiceClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - * $response = $tensorboardServiceClient->getTensorboardExperiment($formattedName); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TensorboardExperiment resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TensorboardExperiment - * - * @throws ApiException if the remote call fails - */ - public function getTensorboardExperiment($name, array $optionalArgs = []) - { - $request = new GetTensorboardExperimentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTensorboardExperiment', - TensorboardExperiment::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a TensorboardRun. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedName = $tensorboardServiceClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - * $response = $tensorboardServiceClient->getTensorboardRun($formattedName); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TensorboardRun resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TensorboardRun - * - * @throws ApiException if the remote call fails - */ - public function getTensorboardRun($name, array $optionalArgs = []) - { - $request = new GetTensorboardRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTensorboardRun', - TensorboardRun::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a TensorboardTimeSeries. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedName = $tensorboardServiceClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - * $response = $tensorboardServiceClient->getTensorboardTimeSeries($formattedName); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TensorboardTimeSeries resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TensorboardTimeSeries - * - * @throws ApiException if the remote call fails - */ - public function getTensorboardTimeSeries($name, array $optionalArgs = []) - { - $request = new GetTensorboardTimeSeriesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTensorboardTimeSeries', - TensorboardTimeSeries::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists TensorboardExperiments in a Location. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - * // Iterate over pages of elements - * $pagedResponse = $tensorboardServiceClient->listTensorboardExperiments($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tensorboardServiceClient->listTensorboardExperiments($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Tensorboard to list - * TensorboardExperiments. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the TensorboardExperiments that match the filter expression. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * Field to use to sort the list. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTensorboardExperiments( - $parent, - array $optionalArgs = [] - ) { - $request = new ListTensorboardExperimentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTensorboardExperiments', - $optionalArgs, - ListTensorboardExperimentsResponse::class, - $request - ); - } - - /** - * Lists TensorboardRuns in a Location. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - * // Iterate over pages of elements - * $pagedResponse = $tensorboardServiceClient->listTensorboardRuns($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tensorboardServiceClient->listTensorboardRuns($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the TensorboardExperiment to list - * TensorboardRuns. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the TensorboardRuns that match the filter expression. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * Field to use to sort the list. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTensorboardRuns($parent, array $optionalArgs = []) - { - $request = new ListTensorboardRunsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTensorboardRuns', - $optionalArgs, - ListTensorboardRunsResponse::class, - $request - ); - } - - /** - * Lists TensorboardTimeSeries in a Location. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - * // Iterate over pages of elements - * $pagedResponse = $tensorboardServiceClient->listTensorboardTimeSeries($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tensorboardServiceClient->listTensorboardTimeSeries($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the TensorboardRun to list - * TensorboardTimeSeries. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the TensorboardTimeSeries that match the filter expression. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * Field to use to sort the list. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTensorboardTimeSeries($parent, array $optionalArgs = []) - { - $request = new ListTensorboardTimeSeriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTensorboardTimeSeries', - $optionalArgs, - ListTensorboardTimeSeriesResponse::class, - $request - ); - } - - /** - * Lists Tensorboards in a Location. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedParent = $tensorboardServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $tensorboardServiceClient->listTensorboards($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tensorboardServiceClient->listTensorboards($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list Tensorboards. - * Format: - * `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Lists the Tensorboards that match the filter expression. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * Field to use to sort the list. - * @type FieldMask $readMask - * Mask specifying which fields to read. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTensorboards($parent, array $optionalArgs = []) - { - $request = new ListTensorboardsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTensorboards', - $optionalArgs, - ListTensorboardsResponse::class, - $request - ); - } - - /** - * Gets bytes of TensorboardBlobs. - * This is to allow reading blob data stored in consumer project's Cloud - * Storage bucket without users having to obtain Cloud Storage access - * permission. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedTimeSeries = $tensorboardServiceClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - * // Read all responses until the stream is complete - * $stream = $tensorboardServiceClient->readTensorboardBlobData($formattedTimeSeries); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $timeSeries Required. The resource name of the TensorboardTimeSeries to list Blobs. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param array $optionalArgs { - * Optional. - * - * @type string[] $blobIds - * IDs of the blobs to read. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function readTensorboardBlobData( - $timeSeries, - array $optionalArgs = [] - ) { - $request = new ReadTensorboardBlobDataRequest(); - $requestParamHeaders = []; - $request->setTimeSeries($timeSeries); - $requestParamHeaders['time_series'] = $timeSeries; - if (isset($optionalArgs['blobIds'])) { - $request->setBlobIds($optionalArgs['blobIds']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ReadTensorboardBlobData', - ReadTensorboardBlobDataResponse::class, - $optionalArgs, - $request, - Call::SERVER_STREAMING_CALL - ); - } - - /** - * Returns the storage size for a given TensorBoard instance. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedTensorboard = $tensorboardServiceClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - * $response = $tensorboardServiceClient->readTensorboardSize($formattedTensorboard); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $tensorboard Required. The name of the Tensorboard resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ReadTensorboardSizeResponse - * - * @throws ApiException if the remote call fails - */ - public function readTensorboardSize($tensorboard, array $optionalArgs = []) - { - $request = new ReadTensorboardSizeRequest(); - $requestParamHeaders = []; - $request->setTensorboard($tensorboard); - $requestParamHeaders['tensorboard'] = $tensorboard; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ReadTensorboardSize', - ReadTensorboardSizeResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Reads a TensorboardTimeSeries' data. By default, if the number of data - * points stored is less than 1000, all data is returned. Otherwise, 1000 - * data points is randomly selected from this time series and returned. - * This value can be changed by changing max_data_points, which can't be - * greater than 10k. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedTensorboardTimeSeries = $tensorboardServiceClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - * $response = $tensorboardServiceClient->readTensorboardTimeSeriesData($formattedTensorboardTimeSeries); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $tensorboardTimeSeries Required. The resource name of the TensorboardTimeSeries to read data from. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param array $optionalArgs { - * Optional. - * - * @type int $maxDataPoints - * The maximum number of TensorboardTimeSeries' data to return. - * - * This value should be a positive integer. - * This value can be set to -1 to return all data. - * @type string $filter - * Reads the TensorboardTimeSeries' data that match the filter expression. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ReadTensorboardTimeSeriesDataResponse - * - * @throws ApiException if the remote call fails - */ - public function readTensorboardTimeSeriesData( - $tensorboardTimeSeries, - array $optionalArgs = [] - ) { - $request = new ReadTensorboardTimeSeriesDataRequest(); - $requestParamHeaders = []; - $request->setTensorboardTimeSeries($tensorboardTimeSeries); - $requestParamHeaders[ - 'tensorboard_time_series' - ] = $tensorboardTimeSeries; - if (isset($optionalArgs['maxDataPoints'])) { - $request->setMaxDataPoints($optionalArgs['maxDataPoints']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ReadTensorboardTimeSeriesData', - ReadTensorboardTimeSeriesDataResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Returns a list of monthly active users for a given TensorBoard instance. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedTensorboard = $tensorboardServiceClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - * $response = $tensorboardServiceClient->readTensorboardUsage($formattedTensorboard); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $tensorboard Required. The name of the Tensorboard resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ReadTensorboardUsageResponse - * - * @throws ApiException if the remote call fails - */ - public function readTensorboardUsage($tensorboard, array $optionalArgs = []) - { - $request = new ReadTensorboardUsageRequest(); - $requestParamHeaders = []; - $request->setTensorboard($tensorboard); - $requestParamHeaders['tensorboard'] = $tensorboard; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ReadTensorboardUsage', - ReadTensorboardUsageResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a Tensorboard. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $tensorboard = new Tensorboard(); - * $operationResponse = $tensorboardServiceClient->updateTensorboard($updateMask, $tensorboard); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tensorboardServiceClient->updateTensorboard($updateMask, $tensorboard); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tensorboardServiceClient->resumeOperation($operationName, 'updateTensorboard'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the - * Tensorboard resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are overwritten if new - * values are specified. - * @param Tensorboard $tensorboard Required. The Tensorboard's `name` field is used to identify the - * Tensorboard to be updated. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateTensorboard( - $updateMask, - $tensorboard, - array $optionalArgs = [] - ) { - $request = new UpdateTensorboardRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setTensorboard($tensorboard); - $requestParamHeaders['tensorboard.name'] = $tensorboard->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateTensorboard', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a TensorboardExperiment. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $tensorboardExperiment = new TensorboardExperiment(); - * $response = $tensorboardServiceClient->updateTensorboardExperiment($updateMask, $tensorboardExperiment); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the - * TensorboardExperiment resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are overwritten if new - * values are specified. - * @param TensorboardExperiment $tensorboardExperiment Required. The TensorboardExperiment's `name` field is used to identify the - * TensorboardExperiment to be updated. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TensorboardExperiment - * - * @throws ApiException if the remote call fails - */ - public function updateTensorboardExperiment( - $updateMask, - $tensorboardExperiment, - array $optionalArgs = [] - ) { - $request = new UpdateTensorboardExperimentRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setTensorboardExperiment($tensorboardExperiment); - $requestParamHeaders[ - 'tensorboard_experiment.name' - ] = $tensorboardExperiment->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateTensorboardExperiment', - TensorboardExperiment::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a TensorboardRun. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $tensorboardRun = new TensorboardRun(); - * $response = $tensorboardServiceClient->updateTensorboardRun($updateMask, $tensorboardRun); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the - * TensorboardRun resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are overwritten if new - * values are specified. - * @param TensorboardRun $tensorboardRun Required. The TensorboardRun's `name` field is used to identify the - * TensorboardRun to be updated. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TensorboardRun - * - * @throws ApiException if the remote call fails - */ - public function updateTensorboardRun( - $updateMask, - $tensorboardRun, - array $optionalArgs = [] - ) { - $request = new UpdateTensorboardRunRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setTensorboardRun($tensorboardRun); - $requestParamHeaders[ - 'tensorboard_run.name' - ] = $tensorboardRun->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateTensorboardRun', - TensorboardRun::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a TensorboardTimeSeries. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $tensorboardTimeSeries = new TensorboardTimeSeries(); - * $response = $tensorboardServiceClient->updateTensorboardTimeSeries($updateMask, $tensorboardTimeSeries); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the - * TensorboardTimeSeries resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are overwritten if new - * values are specified. - * @param TensorboardTimeSeries $tensorboardTimeSeries Required. The TensorboardTimeSeries' `name` field is used to identify the - * TensorboardTimeSeries to be updated. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\TensorboardTimeSeries - * - * @throws ApiException if the remote call fails - */ - public function updateTensorboardTimeSeries( - $updateMask, - $tensorboardTimeSeries, - array $optionalArgs = [] - ) { - $request = new UpdateTensorboardTimeSeriesRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setTensorboardTimeSeries($tensorboardTimeSeries); - $requestParamHeaders[ - 'tensorboard_time_series.name' - ] = $tensorboardTimeSeries->getName(); - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateTensorboardTimeSeries', - TensorboardTimeSeries::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Write time series data points of multiple TensorboardTimeSeries in multiple - * TensorboardRun's. If any data fail to be ingested, an error is returned. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedTensorboardExperiment = $tensorboardServiceClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - * $writeRunDataRequests = []; - * $response = $tensorboardServiceClient->writeTensorboardExperimentData($formattedTensorboardExperiment, $writeRunDataRequests); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $tensorboardExperiment Required. The resource name of the TensorboardExperiment to write data to. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param WriteTensorboardRunDataRequest[] $writeRunDataRequests Required. Requests containing per-run TensorboardTimeSeries data to write. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\WriteTensorboardExperimentDataResponse - * - * @throws ApiException if the remote call fails - */ - public function writeTensorboardExperimentData( - $tensorboardExperiment, - $writeRunDataRequests, - array $optionalArgs = [] - ) { - $request = new WriteTensorboardExperimentDataRequest(); - $requestParamHeaders = []; - $request->setTensorboardExperiment($tensorboardExperiment); - $request->setWriteRunDataRequests($writeRunDataRequests); - $requestParamHeaders['tensorboard_experiment'] = $tensorboardExperiment; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'WriteTensorboardExperimentData', - WriteTensorboardExperimentDataResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Write time series data points into multiple TensorboardTimeSeries under - * a TensorboardRun. If any data fail to be ingested, an error is returned. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $formattedTensorboardRun = $tensorboardServiceClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - * $timeSeriesData = []; - * $response = $tensorboardServiceClient->writeTensorboardRunData($formattedTensorboardRun, $timeSeriesData); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $tensorboardRun Required. The resource name of the TensorboardRun to write data to. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param TimeSeriesData[] $timeSeriesData Required. The TensorboardTimeSeries data to write. - * Values with in a time series are indexed by their step value. - * Repeated writes to the same step will overwrite the existing value for that - * step. - * The upper limit of data points per write request is 5000. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\WriteTensorboardRunDataResponse - * - * @throws ApiException if the remote call fails - */ - public function writeTensorboardRunData( - $tensorboardRun, - $timeSeriesData, - array $optionalArgs = [] - ) { - $request = new WriteTensorboardRunDataRequest(); - $requestParamHeaders = []; - $request->setTensorboardRun($tensorboardRun); - $request->setTimeSeriesData($timeSeriesData); - $requestParamHeaders['tensorboard_run'] = $tensorboardRun; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'WriteTensorboardRunData', - WriteTensorboardRunDataResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $response = $tensorboardServiceClient->getLocation(); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $tensorboardServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tensorboardServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $resource = 'resource'; - * $response = $tensorboardServiceClient->getIamPolicy($resource); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $tensorboardServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $tensorboardServiceClient = new TensorboardServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $tensorboardServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $tensorboardServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/Gapic/VizierServiceGapicClient.php b/AiPlatform/src/V1/Gapic/VizierServiceGapicClient.php deleted file mode 100644 index 18ed903e34d1..000000000000 --- a/AiPlatform/src/V1/Gapic/VizierServiceGapicClient.php +++ /dev/null @@ -1,1735 +0,0 @@ -trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - * $measurement = new Measurement(); - * $response = $vizierServiceClient->addTrialMeasurement($formattedTrialName, $measurement); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\AIPlatform\V1\Client\VizierServiceClient}. - */ -class VizierServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.aiplatform.v1.VizierService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'aiplatform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'aiplatform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $customJobNameTemplate; - - private static $locationNameTemplate; - - private static $studyNameTemplate; - - private static $trialNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/vizier_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/vizier_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/vizier_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/vizier_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getCustomJobNameTemplate() - { - if (self::$customJobNameTemplate == null) { - self::$customJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ); - } - - return self::$customJobNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getStudyNameTemplate() - { - if (self::$studyNameTemplate == null) { - self::$studyNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ); - } - - return self::$studyNameTemplate; - } - - private static function getTrialNameTemplate() - { - if (self::$trialNameTemplate == null) { - self::$trialNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ); - } - - return self::$trialNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'customJob' => self::getCustomJobNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'study' => self::getStudyNameTemplate(), - 'trial' => self::getTrialNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a custom_job - * resource. - * - * @param string $project - * @param string $location - * @param string $customJob - * - * @return string The formatted custom_job resource. - */ - public static function customJobName($project, $location, $customJob) - { - return self::getCustomJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'custom_job' => $customJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a study - * resource. - * - * @param string $project - * @param string $location - * @param string $study - * - * @return string The formatted study resource. - */ - public static function studyName($project, $location, $study) - { - return self::getStudyNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'study' => $study, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a trial - * resource. - * - * @param string $project - * @param string $location - * @param string $study - * @param string $trial - * - * @return string The formatted trial resource. - */ - public static function trialName($project, $location, $study, $trial) - { - return self::getTrialNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'study' => $study, - 'trial' => $trial, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - customJob: projects/{project}/locations/{location}/customJobs/{custom_job} - * - location: projects/{project}/locations/{location} - * - study: projects/{project}/locations/{location}/studies/{study} - * - trial: projects/{project}/locations/{location}/studies/{study}/trials/{trial} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'aiplatform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Adds a measurement of the objective metrics to a Trial. This measurement - * is assumed to have been taken before the Trial is complete. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedTrialName = $vizierServiceClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - * $measurement = new Measurement(); - * $response = $vizierServiceClient->addTrialMeasurement($formattedTrialName, $measurement); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $trialName Required. The name of the trial to add measurement. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param Measurement $measurement Required. The measurement to be added to a Trial. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Trial - * - * @throws ApiException if the remote call fails - */ - public function addTrialMeasurement( - $trialName, - $measurement, - array $optionalArgs = [] - ) { - $request = new AddTrialMeasurementRequest(); - $requestParamHeaders = []; - $request->setTrialName($trialName); - $request->setMeasurement($measurement); - $requestParamHeaders['trial_name'] = $trialName; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'AddTrialMeasurement', - Trial::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Checks whether a Trial should stop or not. Returns a - * long-running operation. When the operation is successful, - * it will contain a - * [CheckTrialEarlyStoppingStateResponse][google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse]. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedTrialName = $vizierServiceClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - * $operationResponse = $vizierServiceClient->checkTrialEarlyStoppingState($formattedTrialName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vizierServiceClient->checkTrialEarlyStoppingState($formattedTrialName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vizierServiceClient->resumeOperation($operationName, 'checkTrialEarlyStoppingState'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $trialName Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function checkTrialEarlyStoppingState( - $trialName, - array $optionalArgs = [] - ) { - $request = new CheckTrialEarlyStoppingStateRequest(); - $requestParamHeaders = []; - $request->setTrialName($trialName); - $requestParamHeaders['trial_name'] = $trialName; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CheckTrialEarlyStoppingState', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Marks a Trial as complete. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedName = $vizierServiceClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - * $response = $vizierServiceClient->completeTrial($formattedName); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param array $optionalArgs { - * Optional. - * - * @type Measurement $finalMeasurement - * Optional. If provided, it will be used as the completed Trial's - * final_measurement; Otherwise, the service will auto-select a - * previously reported measurement as the final-measurement - * @type bool $trialInfeasible - * Optional. True if the Trial cannot be run with the given Parameter, and - * final_measurement will be ignored. - * @type string $infeasibleReason - * Optional. A human readable reason why the trial was infeasible. This should - * only be provided if `trial_infeasible` is true. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Trial - * - * @throws ApiException if the remote call fails - */ - public function completeTrial($name, array $optionalArgs = []) - { - $request = new CompleteTrialRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['finalMeasurement'])) { - $request->setFinalMeasurement($optionalArgs['finalMeasurement']); - } - - if (isset($optionalArgs['trialInfeasible'])) { - $request->setTrialInfeasible($optionalArgs['trialInfeasible']); - } - - if (isset($optionalArgs['infeasibleReason'])) { - $request->setInfeasibleReason($optionalArgs['infeasibleReason']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CompleteTrial', - Trial::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a Study. A resource name will be generated after creation of the - * Study. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedParent = $vizierServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $study = new Study(); - * $response = $vizierServiceClient->createStudy($formattedParent, $study); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to create the CustomJob in. - * Format: `projects/{project}/locations/{location}` - * @param Study $study Required. The Study configuration used to create the Study. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Study - * - * @throws ApiException if the remote call fails - */ - public function createStudy($parent, $study, array $optionalArgs = []) - { - $request = new CreateStudyRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setStudy($study); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateStudy', - Study::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Adds a user provided Trial to a Study. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedParent = $vizierServiceClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - * $trial = new Trial(); - * $response = $vizierServiceClient->createTrial($formattedParent, $trial); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Study to create the Trial in. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param Trial $trial Required. The Trial to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Trial - * - * @throws ApiException if the remote call fails - */ - public function createTrial($parent, $trial, array $optionalArgs = []) - { - $request = new CreateTrialRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTrial($trial); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateTrial', - Trial::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a Study. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedName = $vizierServiceClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - * $vizierServiceClient->deleteStudy($formattedName); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Study resource to be deleted. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteStudy($name, array $optionalArgs = []) - { - $request = new DeleteStudyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteStudy', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a Trial. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedName = $vizierServiceClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - * $vizierServiceClient->deleteTrial($formattedName); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteTrial($name, array $optionalArgs = []) - { - $request = new DeleteTrialRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteTrial', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a Study by name. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedName = $vizierServiceClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - * $response = $vizierServiceClient->getStudy($formattedName); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Study resource. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Study - * - * @throws ApiException if the remote call fails - */ - public function getStudy($name, array $optionalArgs = []) - { - $request = new GetStudyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetStudy', - Study::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a Trial. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedName = $vizierServiceClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - * $response = $vizierServiceClient->getTrial($formattedName); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Trial resource. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Trial - * - * @throws ApiException if the remote call fails - */ - public function getTrial($name, array $optionalArgs = []) - { - $request = new GetTrialRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTrial', - Trial::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists the pareto-optimal Trials for multi-objective Study or the - * optimal Trials for single-objective Study. The definition of - * pareto-optimal can be checked in wiki page. - * https://en.wikipedia.org/wiki/Pareto_efficiency - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedParent = $vizierServiceClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - * $response = $vizierServiceClient->listOptimalTrials($formattedParent); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the Study that the optimal Trial belongs to. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\ListOptimalTrialsResponse - * - * @throws ApiException if the remote call fails - */ - public function listOptimalTrials($parent, array $optionalArgs = []) - { - $request = new ListOptimalTrialsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ListOptimalTrials', - ListOptimalTrialsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists all the studies in a region for an associated project. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedParent = $vizierServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $vizierServiceClient->listStudies($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vizierServiceClient->listStudies($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to list the Study from. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listStudies($parent, array $optionalArgs = []) - { - $request = new ListStudiesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListStudies', - $optionalArgs, - ListStudiesResponse::class, - $request - ); - } - - /** - * Lists the Trials associated with a Study. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedParent = $vizierServiceClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - * // Iterate over pages of elements - * $pagedResponse = $vizierServiceClient->listTrials($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vizierServiceClient->listTrials($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Study to list the Trial from. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTrials($parent, array $optionalArgs = []) - { - $request = new ListTrialsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTrials', - $optionalArgs, - ListTrialsResponse::class, - $request - ); - } - - /** - * Looks a study up using the user-defined display_name field instead of the - * fully qualified resource name. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedParent = $vizierServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $displayName = 'display_name'; - * $response = $vizierServiceClient->lookupStudy($formattedParent, $displayName); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location to get the Study from. - * Format: `projects/{project}/locations/{location}` - * @param string $displayName Required. The user-defined display name of the Study - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Study - * - * @throws ApiException if the remote call fails - */ - public function lookupStudy($parent, $displayName, array $optionalArgs = []) - { - $request = new LookupStudyRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDisplayName($displayName); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'LookupStudy', - Study::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Stops a Trial. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedName = $vizierServiceClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - * $response = $vizierServiceClient->stopTrial($formattedName); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AIPlatform\V1\Trial - * - * @throws ApiException if the remote call fails - */ - public function stopTrial($name, array $optionalArgs = []) - { - $request = new StopTrialRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'StopTrial', - Trial::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Adds one or more Trials to a Study, with parameter values - * suggested by Vertex AI Vizier. Returns a long-running - * operation associated with the generation of Trial suggestions. - * When this long-running operation succeeds, it will contain - * a - * [SuggestTrialsResponse][google.cloud.aiplatform.v1.SuggestTrialsResponse]. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $formattedParent = $vizierServiceClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - * $suggestionCount = 0; - * $clientId = 'client_id'; - * $operationResponse = $vizierServiceClient->suggestTrials($formattedParent, $suggestionCount, $clientId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vizierServiceClient->suggestTrials($formattedParent, $suggestionCount, $clientId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vizierServiceClient->resumeOperation($operationName, 'suggestTrials'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The project and location that the Study belongs to. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param int $suggestionCount Required. The number of suggestions requested. It must be positive. - * @param string $clientId Required. The identifier of the client that is requesting the suggestion. - * - * If multiple SuggestTrialsRequests have the same `client_id`, - * the service will return the identical suggested Trial if the Trial is - * pending, and provide a new Trial if the last suggested Trial was completed. - * @param array $optionalArgs { - * Optional. - * - * @type TrialContext[] $contexts - * Optional. This allows you to specify the "context" for a Trial; a context - * is a slice (a subspace) of the search space. - * - * Typical uses for contexts: - * 1) You are using Vizier to tune a server for best performance, but there's - * a strong weekly cycle. The context specifies the day-of-week. - * This allows Tuesday to generalize from Wednesday without assuming that - * everything is identical. - * 2) Imagine you're optimizing some medical treatment for people. - * As they walk in the door, you know certain facts about them - * (e.g. sex, weight, height, blood-pressure). Put that information in the - * context, and Vizier will adapt its suggestions to the patient. - * 3) You want to do a fair A/B test efficiently. Specify the "A" and "B" - * conditions as contexts, and Vizier will generalize between "A" and "B" - * conditions. If they are similar, this will allow Vizier to converge - * to the optimum faster than if "A" and "B" were separate Studies. - * NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the - * CreateTrial() RPC; that's the asynchronous option where you don't need a - * close association between contexts and suggestions. - * - * NOTE: All the Parameters you set in a context MUST be defined in the - * Study. - * NOTE: You must supply 0 or $suggestion_count contexts. - * If you don't supply any contexts, Vizier will make suggestions - * from the full search space specified in the StudySpec; if you supply - * a full set of context, each suggestion will match the corresponding - * context. - * NOTE: A Context with no features set matches anything, and allows - * suggestions from the full search space. - * NOTE: Contexts MUST lie within the search space specified in the - * StudySpec. It's an error if they don't. - * NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before - * new suggestions are generated. - * NOTE: Generation of suggestions involves a match between a Context and - * (optionally) a REQUESTED trial; if that match is not fully specified, a - * suggestion will be geneated in the merged subspace. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function suggestTrials( - $parent, - $suggestionCount, - $clientId, - array $optionalArgs = [] - ) { - $request = new SuggestTrialsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setSuggestionCount($suggestionCount); - $request->setClientId($clientId); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['contexts'])) { - $request->setContexts($optionalArgs['contexts']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'SuggestTrials', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $response = $vizierServiceClient->getLocation(); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $vizierServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vizierServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $resource = 'resource'; - * $response = $vizierServiceClient->getIamPolicy($resource); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $vizierServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $vizierServiceClient = new VizierServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $vizierServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $vizierServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/AiPlatform/src/V1/GcsDestination.php b/AiPlatform/src/V1/GcsDestination.php index 7b144ab618ad..0ea937dbe464 100644 --- a/AiPlatform/src/V1/GcsDestination.php +++ b/AiPlatform/src/V1/GcsDestination.php @@ -23,7 +23,7 @@ class GcsDestination extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $output_uri_prefix = ''; + protected $output_uri_prefix = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/GenAiTuningServiceClient.php b/AiPlatform/src/V1/GenAiTuningServiceClient.php deleted file mode 100644 index 61f6b49d12aa..000000000000 --- a/AiPlatform/src/V1/GenAiTuningServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -string model = 5 [(.google.api.field_behavior) = REQUIRED]; */ - private $model = ''; + protected $model = ''; /** * Required. The content of the current conversation with the model. * For single-turn queries, this is a single instance. For multi-turn queries, @@ -39,7 +39,7 @@ class GenerateContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional .google.cloud.aiplatform.v1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $system_instruction = null; + protected $system_instruction = null; /** * Optional. A list of `Tools` the model may use to generate the next * response. @@ -50,6 +50,13 @@ class GenerateContentRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; */ private $tools; + /** + * Optional. Tool config. This config is shared for all tools provided in the + * request. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tool_config = null; /** * Optional. Per request settings for blocking unsafe content. * Enforced on GenerateContentResponse.candidates. @@ -62,7 +69,7 @@ class GenerateContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $generation_config = null; + protected $generation_config = null; /** * @param string $model Required. The name of the publisher model requested to serve the @@ -110,6 +117,9 @@ public static function build(string $model, array $contents): self * A `Tool` is a piece of code that enables the system to interact with * external systems to perform an action, or set of actions, outside of * knowledge and scope of the model. + * @type \Google\Cloud\AIPlatform\V1\ToolConfig $tool_config + * Optional. Tool config. This config is shared for all tools provided in the + * request. * @type array<\Google\Cloud\AIPlatform\V1\SafetySetting>|\Google\Protobuf\Internal\RepeatedField $safety_settings * Optional. Per request settings for blocking unsafe content. * Enforced on GenerateContentResponse.candidates. @@ -258,6 +268,44 @@ public function setTools($var) return $this; } + /** + * Optional. Tool config. This config is shared for all tools provided in the + * request. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\ToolConfig|null + */ + public function getToolConfig() + { + return $this->tool_config; + } + + public function hasToolConfig() + { + return isset($this->tool_config); + } + + public function clearToolConfig() + { + unset($this->tool_config); + } + + /** + * Optional. Tool config. This config is shared for all tools provided in the + * request. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\ToolConfig $var + * @return $this + */ + public function setToolConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\ToolConfig::class); + $this->tool_config = $var; + + return $this; + } + /** * Optional. Per request settings for blocking unsafe content. * Enforced on GenerateContentResponse.candidates. diff --git a/AiPlatform/src/V1/GenerateContentResponse.php b/AiPlatform/src/V1/GenerateContentResponse.php index 72c4dc99f688..b694b187304a 100644 --- a/AiPlatform/src/V1/GenerateContentResponse.php +++ b/AiPlatform/src/V1/GenerateContentResponse.php @@ -28,13 +28,13 @@ class GenerateContentResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $prompt_feedback = null; + protected $prompt_feedback = null; /** * Usage metadata about the response(s). * * Generated from protobuf field .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4; */ - private $usage_metadata = null; + protected $usage_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/GenerateContentResponse/PromptFeedback.php b/AiPlatform/src/V1/GenerateContentResponse/PromptFeedback.php index da1aaa7a6722..e10d71a657be 100644 --- a/AiPlatform/src/V1/GenerateContentResponse/PromptFeedback.php +++ b/AiPlatform/src/V1/GenerateContentResponse/PromptFeedback.php @@ -20,7 +20,7 @@ class PromptFeedback extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $block_reason = 0; + protected $block_reason = 0; /** * Output only. Safety ratings. * @@ -32,7 +32,7 @@ class PromptFeedback extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $block_reason_message = ''; + protected $block_reason_message = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php b/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php index 9b9de428a9dd..e7029f72cd4e 100644 --- a/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php +++ b/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php @@ -20,17 +20,17 @@ class UsageMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 prompt_token_count = 1; */ - private $prompt_token_count = 0; + protected $prompt_token_count = 0; /** * Number of tokens in the response(s). * * Generated from protobuf field int32 candidates_token_count = 2; */ - private $candidates_token_count = 0; + protected $candidates_token_count = 0; /** * Generated from protobuf field int32 total_token_count = 3; */ - private $total_token_count = 0; + protected $total_token_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/GenerationConfig.php b/AiPlatform/src/V1/GenerationConfig.php index 29e63f8ec211..be034798850c 100644 --- a/AiPlatform/src/V1/GenerationConfig.php +++ b/AiPlatform/src/V1/GenerationConfig.php @@ -20,31 +20,31 @@ class GenerationConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional float temperature = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $temperature = null; + protected $temperature = null; /** * Optional. If specified, nucleus sampling will be used. * * Generated from protobuf field optional float top_p = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $top_p = null; + protected $top_p = null; /** * Optional. If specified, top-k sampling will be used. * * Generated from protobuf field optional float top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $top_k = null; + protected $top_k = null; /** * Optional. Number of candidates to generate. * * Generated from protobuf field optional int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $candidate_count = null; + protected $candidate_count = null; /** * Optional. The maximum number of output tokens to generate per message. * * Generated from protobuf field optional int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_output_tokens = null; + protected $max_output_tokens = null; /** * Optional. Stop sequences. * @@ -56,13 +56,13 @@ class GenerationConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional float presence_penalty = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $presence_penalty = null; + protected $presence_penalty = null; /** * Optional. Frequency penalties. * * Generated from protobuf field optional float frequency_penalty = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $frequency_penalty = null; + protected $frequency_penalty = null; /** * Optional. Output response mimetype of the generated candidate text. * Supported mimetype: @@ -74,7 +74,19 @@ class GenerationConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string response_mime_type = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $response_mime_type = ''; + protected $response_mime_type = ''; + /** + * Optional. The `Schema` object allows the definition of input and output + * data types. These types can be objects, but also primitives and arrays. + * Represents a select subset of an [OpenAPI 3.0 schema + * object](https://spec.openapis.org/oas/v3.0.3#schema). + * If set, a compatible response_mime_type must also be set. + * Compatible mimetypes: + * `application/json`: Schema for JSON response. + * + * Generated from protobuf field optional .google.cloud.aiplatform.v1.Schema response_schema = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $response_schema = null; /** * Constructor. @@ -106,6 +118,14 @@ class GenerationConfig extends \Google\Protobuf\Internal\Message * The model needs to be prompted to output the appropriate response type, * otherwise the behavior is undefined. * This is a preview feature. + * @type \Google\Cloud\AIPlatform\V1\Schema $response_schema + * Optional. The `Schema` object allows the definition of input and output + * data types. These types can be objects, but also primitives and arrays. + * Represents a select subset of an [OpenAPI 3.0 schema + * object](https://spec.openapis.org/oas/v3.0.3#schema). + * If set, a compatible response_mime_type must also be set. + * Compatible mimetypes: + * `application/json`: Schema for JSON response. * } */ public function __construct($data = NULL) { @@ -429,5 +449,53 @@ public function setResponseMimeType($var) return $this; } + /** + * Optional. The `Schema` object allows the definition of input and output + * data types. These types can be objects, but also primitives and arrays. + * Represents a select subset of an [OpenAPI 3.0 schema + * object](https://spec.openapis.org/oas/v3.0.3#schema). + * If set, a compatible response_mime_type must also be set. + * Compatible mimetypes: + * `application/json`: Schema for JSON response. + * + * Generated from protobuf field optional .google.cloud.aiplatform.v1.Schema response_schema = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\Schema|null + */ + public function getResponseSchema() + { + return $this->response_schema; + } + + public function hasResponseSchema() + { + return isset($this->response_schema); + } + + public function clearResponseSchema() + { + unset($this->response_schema); + } + + /** + * Optional. The `Schema` object allows the definition of input and output + * data types. These types can be objects, but also primitives and arrays. + * Represents a select subset of an [OpenAPI 3.0 schema + * object](https://spec.openapis.org/oas/v3.0.3#schema). + * If set, a compatible response_mime_type must also be set. + * Compatible mimetypes: + * `application/json`: Schema for JSON response. + * + * Generated from protobuf field optional .google.cloud.aiplatform.v1.Schema response_schema = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\Schema $var + * @return $this + */ + public function setResponseSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\Schema::class); + $this->response_schema = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/GenericOperationMetadata.php b/AiPlatform/src/V1/GenericOperationMetadata.php index 4ac554298120..274590cdf475 100644 --- a/AiPlatform/src/V1/GenericOperationMetadata.php +++ b/AiPlatform/src/V1/GenericOperationMetadata.php @@ -29,7 +29,7 @@ class GenericOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time when the operation was updated for the last time. * If the operation has finished (successfully or not), this is the finish @@ -37,7 +37,7 @@ class GenericOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/AiPlatform/src/V1/GenieSource.php b/AiPlatform/src/V1/GenieSource.php index 5ea8ccdf2472..1bd25d3059f5 100644 --- a/AiPlatform/src/V1/GenieSource.php +++ b/AiPlatform/src/V1/GenieSource.php @@ -21,7 +21,7 @@ class GenieSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string base_model_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $base_model_uri = ''; + protected $base_model_uri = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/GetAnnotationSpecRequest.php b/AiPlatform/src/V1/GetAnnotationSpecRequest.php index 69b4e9085666..43f3a3d1e4d6 100644 --- a/AiPlatform/src/V1/GetAnnotationSpecRequest.php +++ b/AiPlatform/src/V1/GetAnnotationSpecRequest.php @@ -23,13 +23,13 @@ class GetAnnotationSpecRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $name Required. The name of the AnnotationSpec resource. diff --git a/AiPlatform/src/V1/GetArtifactRequest.php b/AiPlatform/src/V1/GetArtifactRequest.php index 5d7621807130..ec1059ebb820 100644 --- a/AiPlatform/src/V1/GetArtifactRequest.php +++ b/AiPlatform/src/V1/GetArtifactRequest.php @@ -23,7 +23,7 @@ class GetArtifactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Artifact to retrieve. diff --git a/AiPlatform/src/V1/GetBatchPredictionJobRequest.php b/AiPlatform/src/V1/GetBatchPredictionJobRequest.php index b7ba382b8fda..ee1cd6355e1f 100644 --- a/AiPlatform/src/V1/GetBatchPredictionJobRequest.php +++ b/AiPlatform/src/V1/GetBatchPredictionJobRequest.php @@ -23,7 +23,7 @@ class GetBatchPredictionJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the BatchPredictionJob resource. diff --git a/AiPlatform/src/V1/GetContextRequest.php b/AiPlatform/src/V1/GetContextRequest.php index 4aab12214863..b58000a8325d 100644 --- a/AiPlatform/src/V1/GetContextRequest.php +++ b/AiPlatform/src/V1/GetContextRequest.php @@ -23,7 +23,7 @@ class GetContextRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Context to retrieve. diff --git a/AiPlatform/src/V1/GetCustomJobRequest.php b/AiPlatform/src/V1/GetCustomJobRequest.php index 34274696b1e5..200ddf55023c 100644 --- a/AiPlatform/src/V1/GetCustomJobRequest.php +++ b/AiPlatform/src/V1/GetCustomJobRequest.php @@ -23,7 +23,7 @@ class GetCustomJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the CustomJob resource. diff --git a/AiPlatform/src/V1/GetDataLabelingJobRequest.php b/AiPlatform/src/V1/GetDataLabelingJobRequest.php index edbcd579a826..b6c5203977a1 100644 --- a/AiPlatform/src/V1/GetDataLabelingJobRequest.php +++ b/AiPlatform/src/V1/GetDataLabelingJobRequest.php @@ -23,7 +23,7 @@ class GetDataLabelingJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the DataLabelingJob. diff --git a/AiPlatform/src/V1/GetDatasetRequest.php b/AiPlatform/src/V1/GetDatasetRequest.php index 59dc265da306..c566c1947c2d 100644 --- a/AiPlatform/src/V1/GetDatasetRequest.php +++ b/AiPlatform/src/V1/GetDatasetRequest.php @@ -21,13 +21,13 @@ class GetDatasetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $name Required. The name of the Dataset resource. Please see diff --git a/AiPlatform/src/V1/GetDatasetVersionRequest.php b/AiPlatform/src/V1/GetDatasetVersionRequest.php index 1a0682831fb8..98c340f55dc6 100644 --- a/AiPlatform/src/V1/GetDatasetVersionRequest.php +++ b/AiPlatform/src/V1/GetDatasetVersionRequest.php @@ -23,13 +23,13 @@ class GetDatasetVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $name Required. The resource name of the Dataset version to delete. diff --git a/AiPlatform/src/V1/GetDeploymentResourcePoolRequest.php b/AiPlatform/src/V1/GetDeploymentResourcePoolRequest.php index fadeb18058c2..e4f7285ca00b 100644 --- a/AiPlatform/src/V1/GetDeploymentResourcePoolRequest.php +++ b/AiPlatform/src/V1/GetDeploymentResourcePoolRequest.php @@ -22,7 +22,7 @@ class GetDeploymentResourcePoolRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the DeploymentResourcePool to retrieve. diff --git a/AiPlatform/src/V1/GetEndpointRequest.php b/AiPlatform/src/V1/GetEndpointRequest.php index 4188b9e5c30b..f71b8c0f6c30 100644 --- a/AiPlatform/src/V1/GetEndpointRequest.php +++ b/AiPlatform/src/V1/GetEndpointRequest.php @@ -23,7 +23,7 @@ class GetEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Endpoint resource. diff --git a/AiPlatform/src/V1/GetEntityTypeRequest.php b/AiPlatform/src/V1/GetEntityTypeRequest.php index 4ccb2434bf42..d398ddd247d3 100644 --- a/AiPlatform/src/V1/GetEntityTypeRequest.php +++ b/AiPlatform/src/V1/GetEntityTypeRequest.php @@ -23,7 +23,7 @@ class GetEntityTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the EntityType resource. diff --git a/AiPlatform/src/V1/GetExecutionRequest.php b/AiPlatform/src/V1/GetExecutionRequest.php index 364ef899a4c1..3dfe973d79f7 100644 --- a/AiPlatform/src/V1/GetExecutionRequest.php +++ b/AiPlatform/src/V1/GetExecutionRequest.php @@ -23,7 +23,7 @@ class GetExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Execution to retrieve. diff --git a/AiPlatform/src/V1/GetFeatureGroupRequest.php b/AiPlatform/src/V1/GetFeatureGroupRequest.php index ab9a0576384e..5cb13f154e77 100644 --- a/AiPlatform/src/V1/GetFeatureGroupRequest.php +++ b/AiPlatform/src/V1/GetFeatureGroupRequest.php @@ -21,7 +21,7 @@ class GetFeatureGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the FeatureGroup resource. Please see diff --git a/AiPlatform/src/V1/GetFeatureOnlineStoreRequest.php b/AiPlatform/src/V1/GetFeatureOnlineStoreRequest.php index 187636b3c4c2..721787c95c91 100644 --- a/AiPlatform/src/V1/GetFeatureOnlineStoreRequest.php +++ b/AiPlatform/src/V1/GetFeatureOnlineStoreRequest.php @@ -21,7 +21,7 @@ class GetFeatureOnlineStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the FeatureOnlineStore resource. Please see diff --git a/AiPlatform/src/V1/GetFeatureRequest.php b/AiPlatform/src/V1/GetFeatureRequest.php index 7eaf6aaad49f..402b8ea33576 100644 --- a/AiPlatform/src/V1/GetFeatureRequest.php +++ b/AiPlatform/src/V1/GetFeatureRequest.php @@ -27,7 +27,7 @@ class GetFeatureRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Feature resource. diff --git a/AiPlatform/src/V1/GetFeatureViewRequest.php b/AiPlatform/src/V1/GetFeatureViewRequest.php index 4b15a7aea8b7..0c977674e079 100644 --- a/AiPlatform/src/V1/GetFeatureViewRequest.php +++ b/AiPlatform/src/V1/GetFeatureViewRequest.php @@ -23,7 +23,7 @@ class GetFeatureViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the FeatureView resource. diff --git a/AiPlatform/src/V1/GetFeatureViewSyncRequest.php b/AiPlatform/src/V1/GetFeatureViewSyncRequest.php index 72b7dd1940e1..57cea7ce033c 100644 --- a/AiPlatform/src/V1/GetFeatureViewSyncRequest.php +++ b/AiPlatform/src/V1/GetFeatureViewSyncRequest.php @@ -23,7 +23,7 @@ class GetFeatureViewSyncRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the FeatureViewSync resource. diff --git a/AiPlatform/src/V1/GetFeaturestoreRequest.php b/AiPlatform/src/V1/GetFeaturestoreRequest.php index 0903f9643ebe..7e170fba6f55 100644 --- a/AiPlatform/src/V1/GetFeaturestoreRequest.php +++ b/AiPlatform/src/V1/GetFeaturestoreRequest.php @@ -21,7 +21,7 @@ class GetFeaturestoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Featurestore resource. Please see diff --git a/AiPlatform/src/V1/GetHyperparameterTuningJobRequest.php b/AiPlatform/src/V1/GetHyperparameterTuningJobRequest.php index 261464035432..1628b8cd9fa0 100644 --- a/AiPlatform/src/V1/GetHyperparameterTuningJobRequest.php +++ b/AiPlatform/src/V1/GetHyperparameterTuningJobRequest.php @@ -23,7 +23,7 @@ class GetHyperparameterTuningJobRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the HyperparameterTuningJob resource. diff --git a/AiPlatform/src/V1/GetIndexEndpointRequest.php b/AiPlatform/src/V1/GetIndexEndpointRequest.php index aba866069867..75de3b6fa86a 100644 --- a/AiPlatform/src/V1/GetIndexEndpointRequest.php +++ b/AiPlatform/src/V1/GetIndexEndpointRequest.php @@ -23,7 +23,7 @@ class GetIndexEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the IndexEndpoint resource. diff --git a/AiPlatform/src/V1/GetIndexRequest.php b/AiPlatform/src/V1/GetIndexRequest.php index 6f8738aee3bd..d5907d58b5a6 100644 --- a/AiPlatform/src/V1/GetIndexRequest.php +++ b/AiPlatform/src/V1/GetIndexRequest.php @@ -23,7 +23,7 @@ class GetIndexRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Index resource. diff --git a/AiPlatform/src/V1/GetMetadataSchemaRequest.php b/AiPlatform/src/V1/GetMetadataSchemaRequest.php index 1c9e09a9f0e8..1a0bb95c0b44 100644 --- a/AiPlatform/src/V1/GetMetadataSchemaRequest.php +++ b/AiPlatform/src/V1/GetMetadataSchemaRequest.php @@ -23,7 +23,7 @@ class GetMetadataSchemaRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the MetadataSchema to retrieve. diff --git a/AiPlatform/src/V1/GetMetadataStoreRequest.php b/AiPlatform/src/V1/GetMetadataStoreRequest.php index 1c3fd15b3239..5e671ba44f5a 100644 --- a/AiPlatform/src/V1/GetMetadataStoreRequest.php +++ b/AiPlatform/src/V1/GetMetadataStoreRequest.php @@ -23,7 +23,7 @@ class GetMetadataStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the MetadataStore to retrieve. diff --git a/AiPlatform/src/V1/GetModelDeploymentMonitoringJobRequest.php b/AiPlatform/src/V1/GetModelDeploymentMonitoringJobRequest.php index 2708127013c4..ba7626620ad8 100644 --- a/AiPlatform/src/V1/GetModelDeploymentMonitoringJobRequest.php +++ b/AiPlatform/src/V1/GetModelDeploymentMonitoringJobRequest.php @@ -23,7 +23,7 @@ class GetModelDeploymentMonitoringJobRequest extends \Google\Protobuf\Internal\M * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the ModelDeploymentMonitoringJob. diff --git a/AiPlatform/src/V1/GetModelEvaluationRequest.php b/AiPlatform/src/V1/GetModelEvaluationRequest.php index 6d79d00a9d23..2f965443ec4e 100644 --- a/AiPlatform/src/V1/GetModelEvaluationRequest.php +++ b/AiPlatform/src/V1/GetModelEvaluationRequest.php @@ -23,7 +23,7 @@ class GetModelEvaluationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the ModelEvaluation resource. diff --git a/AiPlatform/src/V1/GetModelEvaluationSliceRequest.php b/AiPlatform/src/V1/GetModelEvaluationSliceRequest.php index fc31486ae7e6..d18eb9dbd8fc 100644 --- a/AiPlatform/src/V1/GetModelEvaluationSliceRequest.php +++ b/AiPlatform/src/V1/GetModelEvaluationSliceRequest.php @@ -23,7 +23,7 @@ class GetModelEvaluationSliceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the ModelEvaluationSlice resource. diff --git a/AiPlatform/src/V1/GetModelRequest.php b/AiPlatform/src/V1/GetModelRequest.php index 0d34849fc16d..c5e1e32b8c6b 100644 --- a/AiPlatform/src/V1/GetModelRequest.php +++ b/AiPlatform/src/V1/GetModelRequest.php @@ -31,7 +31,7 @@ class GetModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Model resource. diff --git a/AiPlatform/src/V1/GetNasJobRequest.php b/AiPlatform/src/V1/GetNasJobRequest.php index 431ba608f32e..9d1d2e617620 100644 --- a/AiPlatform/src/V1/GetNasJobRequest.php +++ b/AiPlatform/src/V1/GetNasJobRequest.php @@ -23,7 +23,7 @@ class GetNasJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NasJob resource. diff --git a/AiPlatform/src/V1/GetNasTrialDetailRequest.php b/AiPlatform/src/V1/GetNasTrialDetailRequest.php index ee569886e3a0..773a9f4aac1c 100644 --- a/AiPlatform/src/V1/GetNasTrialDetailRequest.php +++ b/AiPlatform/src/V1/GetNasTrialDetailRequest.php @@ -23,7 +23,7 @@ class GetNasTrialDetailRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NasTrialDetail resource. diff --git a/AiPlatform/src/V1/GetNotebookRuntimeRequest.php b/AiPlatform/src/V1/GetNotebookRuntimeRequest.php index aa59a5be5820..7325674a1053 100644 --- a/AiPlatform/src/V1/GetNotebookRuntimeRequest.php +++ b/AiPlatform/src/V1/GetNotebookRuntimeRequest.php @@ -24,7 +24,7 @@ class GetNotebookRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NotebookRuntime resource. diff --git a/AiPlatform/src/V1/GetNotebookRuntimeTemplateRequest.php b/AiPlatform/src/V1/GetNotebookRuntimeTemplateRequest.php index 995c8af8339e..bfa39aba7da9 100644 --- a/AiPlatform/src/V1/GetNotebookRuntimeTemplateRequest.php +++ b/AiPlatform/src/V1/GetNotebookRuntimeTemplateRequest.php @@ -23,7 +23,7 @@ class GetNotebookRuntimeTemplateRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NotebookRuntimeTemplate resource. diff --git a/AiPlatform/src/V1/GetPersistentResourceRequest.php b/AiPlatform/src/V1/GetPersistentResourceRequest.php index b4a22c3a4b96..d9d335443ff4 100644 --- a/AiPlatform/src/V1/GetPersistentResourceRequest.php +++ b/AiPlatform/src/V1/GetPersistentResourceRequest.php @@ -23,7 +23,7 @@ class GetPersistentResourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the PersistentResource resource. diff --git a/AiPlatform/src/V1/GetPipelineJobRequest.php b/AiPlatform/src/V1/GetPipelineJobRequest.php index 89cbc0189a52..7c328bd57067 100644 --- a/AiPlatform/src/V1/GetPipelineJobRequest.php +++ b/AiPlatform/src/V1/GetPipelineJobRequest.php @@ -23,7 +23,7 @@ class GetPipelineJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the PipelineJob resource. diff --git a/AiPlatform/src/V1/GetPublisherModelRequest.php b/AiPlatform/src/V1/GetPublisherModelRequest.php index 06373ef71464..8ad78476d64d 100644 --- a/AiPlatform/src/V1/GetPublisherModelRequest.php +++ b/AiPlatform/src/V1/GetPublisherModelRequest.php @@ -23,20 +23,20 @@ class GetPublisherModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The IETF BCP-47 language code representing the language in which * the publisher model's text information should be written in (see go/bcp47). * * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $language_code = ''; + protected $language_code = ''; /** * Optional. PublisherModel view specifying which fields to read. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModelView view = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $name Required. The name of the PublisherModel resource. diff --git a/AiPlatform/src/V1/GetScheduleRequest.php b/AiPlatform/src/V1/GetScheduleRequest.php index bf42e38b7695..e8f6202849fc 100644 --- a/AiPlatform/src/V1/GetScheduleRequest.php +++ b/AiPlatform/src/V1/GetScheduleRequest.php @@ -23,7 +23,7 @@ class GetScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Schedule resource. diff --git a/AiPlatform/src/V1/GetSpecialistPoolRequest.php b/AiPlatform/src/V1/GetSpecialistPoolRequest.php index d79c89758872..4533f8d4d5dd 100644 --- a/AiPlatform/src/V1/GetSpecialistPoolRequest.php +++ b/AiPlatform/src/V1/GetSpecialistPoolRequest.php @@ -23,7 +23,7 @@ class GetSpecialistPoolRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the SpecialistPool resource. diff --git a/AiPlatform/src/V1/GetStudyRequest.php b/AiPlatform/src/V1/GetStudyRequest.php index 7586794609ef..607cd9a4be35 100644 --- a/AiPlatform/src/V1/GetStudyRequest.php +++ b/AiPlatform/src/V1/GetStudyRequest.php @@ -22,7 +22,7 @@ class GetStudyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Study resource. diff --git a/AiPlatform/src/V1/GetTensorboardExperimentRequest.php b/AiPlatform/src/V1/GetTensorboardExperimentRequest.php index 7cfce1061381..00114cdbde74 100644 --- a/AiPlatform/src/V1/GetTensorboardExperimentRequest.php +++ b/AiPlatform/src/V1/GetTensorboardExperimentRequest.php @@ -23,7 +23,7 @@ class GetTensorboardExperimentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TensorboardExperiment resource. diff --git a/AiPlatform/src/V1/GetTensorboardRequest.php b/AiPlatform/src/V1/GetTensorboardRequest.php index 9cb71aa197f4..5d5bede56773 100644 --- a/AiPlatform/src/V1/GetTensorboardRequest.php +++ b/AiPlatform/src/V1/GetTensorboardRequest.php @@ -23,7 +23,7 @@ class GetTensorboardRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Tensorboard resource. diff --git a/AiPlatform/src/V1/GetTensorboardRunRequest.php b/AiPlatform/src/V1/GetTensorboardRunRequest.php index cb319b62b6b2..7ee1d379ed5f 100644 --- a/AiPlatform/src/V1/GetTensorboardRunRequest.php +++ b/AiPlatform/src/V1/GetTensorboardRunRequest.php @@ -23,7 +23,7 @@ class GetTensorboardRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TensorboardRun resource. diff --git a/AiPlatform/src/V1/GetTensorboardTimeSeriesRequest.php b/AiPlatform/src/V1/GetTensorboardTimeSeriesRequest.php index 3ecc12a1aea6..0a11b588be2f 100644 --- a/AiPlatform/src/V1/GetTensorboardTimeSeriesRequest.php +++ b/AiPlatform/src/V1/GetTensorboardTimeSeriesRequest.php @@ -23,7 +23,7 @@ class GetTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TensorboardTimeSeries resource. diff --git a/AiPlatform/src/V1/GetTrainingPipelineRequest.php b/AiPlatform/src/V1/GetTrainingPipelineRequest.php index fb70ce6fb001..f1acd31b04fa 100644 --- a/AiPlatform/src/V1/GetTrainingPipelineRequest.php +++ b/AiPlatform/src/V1/GetTrainingPipelineRequest.php @@ -23,7 +23,7 @@ class GetTrainingPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TrainingPipeline resource. diff --git a/AiPlatform/src/V1/GetTrialRequest.php b/AiPlatform/src/V1/GetTrialRequest.php index 50b143761c06..be443baeba8c 100644 --- a/AiPlatform/src/V1/GetTrialRequest.php +++ b/AiPlatform/src/V1/GetTrialRequest.php @@ -23,7 +23,7 @@ class GetTrialRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Trial resource. diff --git a/AiPlatform/src/V1/GetTuningJobRequest.php b/AiPlatform/src/V1/GetTuningJobRequest.php index ea148ff60949..4a0333cdf321 100644 --- a/AiPlatform/src/V1/GetTuningJobRequest.php +++ b/AiPlatform/src/V1/GetTuningJobRequest.php @@ -22,7 +22,7 @@ class GetTuningJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the TuningJob resource. Format: diff --git a/AiPlatform/src/V1/GoogleSearchRetrieval.php b/AiPlatform/src/V1/GoogleSearchRetrieval.php index 1b9818021d4c..cc36184fedd3 100644 --- a/AiPlatform/src/V1/GoogleSearchRetrieval.php +++ b/AiPlatform/src/V1/GoogleSearchRetrieval.php @@ -15,14 +15,6 @@ */ class GoogleSearchRetrieval extends \Google\Protobuf\Internal\Message { - /** - * Optional. Disable using the result from this tool in detecting grounding - * attribution. This does not affect how the result is given to the model for - * generation. - * - * Generated from protobuf field bool disable_attribution = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $disable_attribution = false; /** * Constructor. @@ -30,10 +22,6 @@ class GoogleSearchRetrieval extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type bool $disable_attribution - * Optional. Disable using the result from this tool in detecting grounding - * attribution. This does not affect how the result is given to the model for - * generation. * } */ public function __construct($data = NULL) { @@ -41,35 +29,5 @@ public function __construct($data = NULL) { parent::__construct($data); } - /** - * Optional. Disable using the result from this tool in detecting grounding - * attribution. This does not affect how the result is given to the model for - * generation. - * - * Generated from protobuf field bool disable_attribution = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDisableAttribution() - { - return $this->disable_attribution; - } - - /** - * Optional. Disable using the result from this tool in detecting grounding - * attribution. This does not affect how the result is given to the model for - * generation. - * - * Generated from protobuf field bool disable_attribution = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDisableAttribution($var) - { - GPBUtil::checkBool($var); - $this->disable_attribution = $var; - - return $this; - } - } diff --git a/AiPlatform/src/V1/GroundingAttribution.php b/AiPlatform/src/V1/GroundingAttribution.php deleted file mode 100644 index 22eca5428966..000000000000 --- a/AiPlatform/src/V1/GroundingAttribution.php +++ /dev/null @@ -1,167 +0,0 @@ -google.cloud.aiplatform.v1.GroundingAttribution - */ -class GroundingAttribution extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Segment of the content this attribution belongs to. - * - * Generated from protobuf field .google.cloud.aiplatform.v1.Segment segment = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $segment = null; - /** - * Optional. Output only. Confidence score of the attribution. Ranges from 0 - * to 1. 1 is the most confident. - * - * Generated from protobuf field optional float confidence_score = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $confidence_score = null; - protected $reference; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AIPlatform\V1\GroundingAttribution\Web $web - * Optional. Attribution from the web. - * @type \Google\Cloud\AIPlatform\V1\Segment $segment - * Output only. Segment of the content this attribution belongs to. - * @type float $confidence_score - * Optional. Output only. Confidence score of the attribution. Ranges from 0 - * to 1. 1 is the most confident. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Aiplatform\V1\Content::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Attribution from the web. - * - * Generated from protobuf field .google.cloud.aiplatform.v1.GroundingAttribution.Web web = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AIPlatform\V1\GroundingAttribution\Web|null - */ - public function getWeb() - { - return $this->readOneof(3); - } - - public function hasWeb() - { - return $this->hasOneof(3); - } - - /** - * Optional. Attribution from the web. - * - * Generated from protobuf field .google.cloud.aiplatform.v1.GroundingAttribution.Web web = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AIPlatform\V1\GroundingAttribution\Web $var - * @return $this - */ - public function setWeb($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\GroundingAttribution\Web::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Output only. Segment of the content this attribution belongs to. - * - * Generated from protobuf field .google.cloud.aiplatform.v1.Segment segment = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AIPlatform\V1\Segment|null - */ - public function getSegment() - { - return $this->segment; - } - - public function hasSegment() - { - return isset($this->segment); - } - - public function clearSegment() - { - unset($this->segment); - } - - /** - * Output only. Segment of the content this attribution belongs to. - * - * Generated from protobuf field .google.cloud.aiplatform.v1.Segment segment = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AIPlatform\V1\Segment $var - * @return $this - */ - public function setSegment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\Segment::class); - $this->segment = $var; - - return $this; - } - - /** - * Optional. Output only. Confidence score of the attribution. Ranges from 0 - * to 1. 1 is the most confident. - * - * Generated from protobuf field optional float confidence_score = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getConfidenceScore() - { - return isset($this->confidence_score) ? $this->confidence_score : 0.0; - } - - public function hasConfidenceScore() - { - return isset($this->confidence_score); - } - - public function clearConfidenceScore() - { - unset($this->confidence_score); - } - - /** - * Optional. Output only. Confidence score of the attribution. Ranges from 0 - * to 1. 1 is the most confident. - * - * Generated from protobuf field optional float confidence_score = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setConfidenceScore($var) - { - GPBUtil::checkFloat($var); - $this->confidence_score = $var; - - return $this; - } - - /** - * @return string - */ - public function getReference() - { - return $this->whichOneof("reference"); - } - -} - diff --git a/AiPlatform/src/V1/GroundingAttribution/Web.php b/AiPlatform/src/V1/GroundingAttribution/Web.php deleted file mode 100644 index a8a28e2d73c3..000000000000 --- a/AiPlatform/src/V1/GroundingAttribution/Web.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.aiplatform.v1.GroundingAttribution.Web - */ -class Web extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. URI reference of the attribution. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uri = ''; - /** - * Output only. Title of the attribution. - * - * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $title = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Output only. URI reference of the attribution. - * @type string $title - * Output only. Title of the attribution. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Aiplatform\V1\Content::initOnce(); - parent::__construct($data); - } - - /** - * Output only. URI reference of the attribution. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Output only. URI reference of the attribution. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Output only. Title of the attribution. - * - * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Output only. Title of the attribution. - * - * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTitle($var) - { - GPBUtil::checkString($var, True); - $this->title = $var; - - return $this; - } - -} - - diff --git a/AiPlatform/src/V1/GroundingMetadata.php b/AiPlatform/src/V1/GroundingMetadata.php index 4ab8973cb5aa..55381cf6539d 100644 --- a/AiPlatform/src/V1/GroundingMetadata.php +++ b/AiPlatform/src/V1/GroundingMetadata.php @@ -22,11 +22,11 @@ class GroundingMetadata extends \Google\Protobuf\Internal\Message */ private $web_search_queries; /** - * Optional. List of grounding attributions. + * Optional. Google search entry for the following-up web searches. * - * Generated from protobuf field repeated .google.cloud.aiplatform.v1.GroundingAttribution grounding_attributions = 2 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field optional .google.cloud.aiplatform.v1.SearchEntryPoint search_entry_point = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $grounding_attributions; + protected $search_entry_point = null; /** * Constructor. @@ -36,8 +36,8 @@ class GroundingMetadata extends \Google\Protobuf\Internal\Message * * @type array|\Google\Protobuf\Internal\RepeatedField $web_search_queries * Optional. Web search queries for the following-up web search. - * @type array<\Google\Cloud\AIPlatform\V1\GroundingAttribution>|\Google\Protobuf\Internal\RepeatedField $grounding_attributions - * Optional. List of grounding attributions. + * @type \Google\Cloud\AIPlatform\V1\SearchEntryPoint $search_entry_point + * Optional. Google search entry for the following-up web searches. * } */ public function __construct($data = NULL) { @@ -72,27 +72,37 @@ public function setWebSearchQueries($var) } /** - * Optional. List of grounding attributions. + * Optional. Google search entry for the following-up web searches. * - * Generated from protobuf field repeated .google.cloud.aiplatform.v1.GroundingAttribution grounding_attributions = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField + * Generated from protobuf field optional .google.cloud.aiplatform.v1.SearchEntryPoint search_entry_point = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\SearchEntryPoint|null */ - public function getGroundingAttributions() + public function getSearchEntryPoint() + { + return $this->search_entry_point; + } + + public function hasSearchEntryPoint() + { + return isset($this->search_entry_point); + } + + public function clearSearchEntryPoint() { - return $this->grounding_attributions; + unset($this->search_entry_point); } /** - * Optional. List of grounding attributions. + * Optional. Google search entry for the following-up web searches. * - * Generated from protobuf field repeated .google.cloud.aiplatform.v1.GroundingAttribution grounding_attributions = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\AIPlatform\V1\GroundingAttribution>|\Google\Protobuf\Internal\RepeatedField $var + * Generated from protobuf field optional .google.cloud.aiplatform.v1.SearchEntryPoint search_entry_point = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\SearchEntryPoint $var * @return $this */ - public function setGroundingAttributions($var) + public function setSearchEntryPoint($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\GroundingAttribution::class); - $this->grounding_attributions = $arr; + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\SearchEntryPoint::class); + $this->search_entry_point = $var; return $this; } diff --git a/AiPlatform/src/V1/HyperparameterTuningJob.php b/AiPlatform/src/V1/HyperparameterTuningJob.php index 6bc8172cbafd..2b4338d63c70 100644 --- a/AiPlatform/src/V1/HyperparameterTuningJob.php +++ b/AiPlatform/src/V1/HyperparameterTuningJob.php @@ -22,7 +22,7 @@ class HyperparameterTuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The display name of the HyperparameterTuningJob. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -30,25 +30,25 @@ class HyperparameterTuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Required. Study configuration of the HyperparameterTuningJob. * * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec study_spec = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $study_spec = null; + protected $study_spec = null; /** * Required. The desired total number of Trials. * * Generated from protobuf field int32 max_trial_count = 5 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_trial_count = 0; + protected $max_trial_count = 0; /** * Required. The desired number of Trials to run in parallel. * * Generated from protobuf field int32 parallel_trial_count = 6 [(.google.api.field_behavior) = REQUIRED]; */ - private $parallel_trial_count = 0; + protected $parallel_trial_count = 0; /** * The number of failed Trials that need to be seen before failing * the HyperparameterTuningJob. @@ -57,14 +57,14 @@ class HyperparameterTuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 max_failed_trial_count = 7; */ - private $max_failed_trial_count = 0; + protected $max_failed_trial_count = 0; /** * Required. The spec of a trial job. The same spec applies to the CustomJobs * created in all the trials. * * Generated from protobuf field .google.cloud.aiplatform.v1.CustomJobSpec trial_job_spec = 8 [(.google.api.field_behavior) = REQUIRED]; */ - private $trial_job_spec = null; + protected $trial_job_spec = null; /** * Output only. Trials of the HyperparameterTuningJob. * @@ -76,20 +76,20 @@ class HyperparameterTuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.JobState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Time when the HyperparameterTuningJob was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time when the HyperparameterTuningJob for the first time * entered the `JOB_STATE_RUNNING` state. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time when the HyperparameterTuningJob entered any of the * following states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, @@ -97,21 +97,21 @@ class HyperparameterTuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Time when the HyperparameterTuningJob was most recently * updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Only populated when job's state is JOB_STATE_FAILED or * JOB_STATE_CANCELLED. * * Generated from protobuf field .google.rpc.Status error = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * The labels with user-defined metadata to organize HyperparameterTuningJobs. * Label keys and values can be no longer than 64 characters @@ -129,7 +129,7 @@ class HyperparameterTuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 17; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ImportDataConfig.php b/AiPlatform/src/V1/ImportDataConfig.php index bc78d198166f..df1309b1d648 100644 --- a/AiPlatform/src/V1/ImportDataConfig.php +++ b/AiPlatform/src/V1/ImportDataConfig.php @@ -57,7 +57,7 @@ class ImportDataConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string import_schema_uri = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $import_schema_uri = ''; + protected $import_schema_uri = ''; protected $source; /** diff --git a/AiPlatform/src/V1/ImportDataOperationMetadata.php b/AiPlatform/src/V1/ImportDataOperationMetadata.php index 892b1e89430d..1a48b997790c 100644 --- a/AiPlatform/src/V1/ImportDataOperationMetadata.php +++ b/AiPlatform/src/V1/ImportDataOperationMetadata.php @@ -21,7 +21,7 @@ class ImportDataOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ImportDataRequest.php b/AiPlatform/src/V1/ImportDataRequest.php index 19b4757f8487..ace093762889 100644 --- a/AiPlatform/src/V1/ImportDataRequest.php +++ b/AiPlatform/src/V1/ImportDataRequest.php @@ -23,7 +23,7 @@ class ImportDataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The desired input locations. The contents of all input locations * will be imported in one batch. diff --git a/AiPlatform/src/V1/ImportFeatureValuesOperationMetadata.php b/AiPlatform/src/V1/ImportFeatureValuesOperationMetadata.php index 2e693832817a..76962935d539 100644 --- a/AiPlatform/src/V1/ImportFeatureValuesOperationMetadata.php +++ b/AiPlatform/src/V1/ImportFeatureValuesOperationMetadata.php @@ -20,19 +20,19 @@ class ImportFeatureValuesOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Number of entities that have been imported by the operation. * * Generated from protobuf field int64 imported_entity_count = 2; */ - private $imported_entity_count = 0; + protected $imported_entity_count = 0; /** * Number of Feature values that have been imported by the operation. * * Generated from protobuf field int64 imported_feature_value_count = 3; */ - private $imported_feature_value_count = 0; + protected $imported_feature_value_count = 0; /** * The source URI from where Feature values are imported. * @@ -48,14 +48,14 @@ class ImportFeatureValuesOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field int64 invalid_row_count = 6; */ - private $invalid_row_count = 0; + protected $invalid_row_count = 0; /** * The number rows that weren't ingested due to having timestamps outside the * retention boundary. * * Generated from protobuf field int64 timestamp_outside_retention_rows_count = 7; */ - private $timestamp_outside_retention_rows_count = 0; + protected $timestamp_outside_retention_rows_count = 0; /** * List of ImportFeatureValues operations running under a single EntityType * that are blocking this operation. diff --git a/AiPlatform/src/V1/ImportFeatureValuesRequest.php b/AiPlatform/src/V1/ImportFeatureValuesRequest.php index fd2ad8429e96..fc918281d7f3 100644 --- a/AiPlatform/src/V1/ImportFeatureValuesRequest.php +++ b/AiPlatform/src/V1/ImportFeatureValuesRequest.php @@ -23,14 +23,14 @@ class ImportFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $entity_type = ''; + protected $entity_type = ''; /** * Source column that holds entity IDs. If not provided, entity IDs are * extracted from the column named entity_id. * * Generated from protobuf field string entity_id_field = 5; */ - private $entity_id_field = ''; + protected $entity_id_field = ''; /** * Required. Specifications defining which Feature values to import from the * entity. The request fails if no feature_specs are provided, and having @@ -46,7 +46,7 @@ class ImportFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_online_serving = 9; */ - private $disable_online_serving = false; + protected $disable_online_serving = false; /** * Specifies the number of workers that are used to write data to the * Featurestore. Consider the online serving capacity that you require to @@ -57,13 +57,13 @@ class ImportFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 worker_count = 11; */ - private $worker_count = 0; + protected $worker_count = 0; /** * If true, API doesn't start ingestion analysis pipeline. * * Generated from protobuf field bool disable_ingestion_analysis = 12; */ - private $disable_ingestion_analysis = false; + protected $disable_ingestion_analysis = false; protected $source; protected $feature_time_source; diff --git a/AiPlatform/src/V1/ImportFeatureValuesRequest/FeatureSpec.php b/AiPlatform/src/V1/ImportFeatureValuesRequest/FeatureSpec.php index b414b4227d96..4febb13bcf4a 100644 --- a/AiPlatform/src/V1/ImportFeatureValuesRequest/FeatureSpec.php +++ b/AiPlatform/src/V1/ImportFeatureValuesRequest/FeatureSpec.php @@ -21,14 +21,14 @@ class FeatureSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $id = ''; + protected $id = ''; /** * Source column to get the Feature values from. If not set, uses the column * with the same name as the Feature ID. * * Generated from protobuf field string source_field = 2; */ - private $source_field = ''; + protected $source_field = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ImportFeatureValuesResponse.php b/AiPlatform/src/V1/ImportFeatureValuesResponse.php index 3c9295aca217..58c16ef19321 100644 --- a/AiPlatform/src/V1/ImportFeatureValuesResponse.php +++ b/AiPlatform/src/V1/ImportFeatureValuesResponse.php @@ -21,13 +21,13 @@ class ImportFeatureValuesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 imported_entity_count = 1; */ - private $imported_entity_count = 0; + protected $imported_entity_count = 0; /** * Number of Feature values that have been imported by the operation. * * Generated from protobuf field int64 imported_feature_value_count = 2; */ - private $imported_feature_value_count = 0; + protected $imported_feature_value_count = 0; /** * The number of rows in input source that weren't imported due to either * * Not having any featureValues. @@ -37,14 +37,14 @@ class ImportFeatureValuesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 invalid_row_count = 6; */ - private $invalid_row_count = 0; + protected $invalid_row_count = 0; /** * The number rows that weren't ingested due to having feature timestamps * outside the retention boundary. * * Generated from protobuf field int64 timestamp_outside_retention_rows_count = 4; */ - private $timestamp_outside_retention_rows_count = 0; + protected $timestamp_outside_retention_rows_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/ImportModelEvaluationRequest.php b/AiPlatform/src/V1/ImportModelEvaluationRequest.php index ebe9a73b6f93..ff11a54b2eed 100644 --- a/AiPlatform/src/V1/ImportModelEvaluationRequest.php +++ b/AiPlatform/src/V1/ImportModelEvaluationRequest.php @@ -22,13 +22,13 @@ class ImportModelEvaluationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Model evaluation resource to be imported. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelEvaluation model_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $model_evaluation = null; + protected $model_evaluation = null; /** * @param string $parent Required. The name of the parent model resource. diff --git a/AiPlatform/src/V1/Index.php b/AiPlatform/src/V1/Index.php index 4f9309683d70..0a0de2535d09 100644 --- a/AiPlatform/src/V1/Index.php +++ b/AiPlatform/src/V1/Index.php @@ -21,7 +21,7 @@ class Index extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The display name of the Index. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -29,13 +29,13 @@ class Index extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * The description of the Index. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Immutable. Points to a YAML file stored on Google Cloud Storage describing * additional information about the Index, that is specific to it. Unset if @@ -48,7 +48,7 @@ class Index extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_schema_uri = 4 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $metadata_schema_uri = ''; + protected $metadata_schema_uri = ''; /** * An additional information about the Index; the schema of the metadata can * be found in @@ -56,7 +56,7 @@ class Index extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value metadata = 6; */ - private $metadata = null; + protected $metadata = null; /** * Output only. The pointers to DeployedIndexes created from this Index. * An Index can be only deleted if all its DeployedIndexes had been undeployed @@ -71,7 +71,7 @@ class Index extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 8; */ - private $etag = ''; + protected $etag = ''; /** * The labels with user-defined metadata to organize your Indexes. * Label keys and values can be no longer than 64 characters @@ -87,7 +87,7 @@ class Index extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Index was most recently updated. * This also includes any update to the contents of the Index. @@ -100,27 +100,27 @@ class Index extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Stats of the index resource. * * Generated from protobuf field .google.cloud.aiplatform.v1.IndexStats index_stats = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $index_stats = null; + protected $index_stats = null; /** * Immutable. The update method to use with this Index. If not set, * BATCH_UPDATE will be used by default. * * Generated from protobuf field .google.cloud.aiplatform.v1.Index.IndexUpdateMethod index_update_method = 16 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $index_update_method = 0; + protected $index_update_method = 0; /** * Immutable. Customer-managed encryption key spec for an Index. If set, this * Index and all sub-resources of this Index will be secured by this key. * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 17 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/IndexDatapoint.php b/AiPlatform/src/V1/IndexDatapoint.php index 70b68e012263..c9f76dc559b3 100644 --- a/AiPlatform/src/V1/IndexDatapoint.php +++ b/AiPlatform/src/V1/IndexDatapoint.php @@ -20,14 +20,20 @@ class IndexDatapoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string datapoint_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $datapoint_id = ''; + protected $datapoint_id = ''; /** - * Required. Feature embedding vector. An array of numbers with the length of - * [NearestNeighborSearchConfig.dimensions]. + * Required. Feature embedding vector for dense index. An array of numbers + * with the length of [NearestNeighborSearchConfig.dimensions]. * * Generated from protobuf field repeated float feature_vector = 2 [(.google.api.field_behavior) = REQUIRED]; */ private $feature_vector; + /** + * Optional. Feature embedding vector for sparse index. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.IndexDatapoint.SparseEmbedding sparse_embedding = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sparse_embedding = null; /** * Optional. List of Restrict of the datapoint, used to perform "restricted * searches" where boolean rule are used to filter the subset of the database @@ -51,7 +57,7 @@ class IndexDatapoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.IndexDatapoint.CrowdingTag crowding_tag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $crowding_tag = null; + protected $crowding_tag = null; /** * Constructor. @@ -62,8 +68,10 @@ class IndexDatapoint extends \Google\Protobuf\Internal\Message * @type string $datapoint_id * Required. Unique identifier of the datapoint. * @type array|\Google\Protobuf\Internal\RepeatedField $feature_vector - * Required. Feature embedding vector. An array of numbers with the length of - * [NearestNeighborSearchConfig.dimensions]. + * Required. Feature embedding vector for dense index. An array of numbers + * with the length of [NearestNeighborSearchConfig.dimensions]. + * @type \Google\Cloud\AIPlatform\V1\IndexDatapoint\SparseEmbedding $sparse_embedding + * Optional. Feature embedding vector for sparse index. * @type array<\Google\Cloud\AIPlatform\V1\IndexDatapoint\Restriction>|\Google\Protobuf\Internal\RepeatedField $restricts * Optional. List of Restrict of the datapoint, used to perform "restricted * searches" where boolean rule are used to filter the subset of the database @@ -110,8 +118,8 @@ public function setDatapointId($var) } /** - * Required. Feature embedding vector. An array of numbers with the length of - * [NearestNeighborSearchConfig.dimensions]. + * Required. Feature embedding vector for dense index. An array of numbers + * with the length of [NearestNeighborSearchConfig.dimensions]. * * Generated from protobuf field repeated float feature_vector = 2 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\Internal\RepeatedField @@ -122,8 +130,8 @@ public function getFeatureVector() } /** - * Required. Feature embedding vector. An array of numbers with the length of - * [NearestNeighborSearchConfig.dimensions]. + * Required. Feature embedding vector for dense index. An array of numbers + * with the length of [NearestNeighborSearchConfig.dimensions]. * * Generated from protobuf field repeated float feature_vector = 2 [(.google.api.field_behavior) = REQUIRED]; * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -137,6 +145,42 @@ public function setFeatureVector($var) return $this; } + /** + * Optional. Feature embedding vector for sparse index. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.IndexDatapoint.SparseEmbedding sparse_embedding = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\IndexDatapoint\SparseEmbedding|null + */ + public function getSparseEmbedding() + { + return $this->sparse_embedding; + } + + public function hasSparseEmbedding() + { + return isset($this->sparse_embedding); + } + + public function clearSparseEmbedding() + { + unset($this->sparse_embedding); + } + + /** + * Optional. Feature embedding vector for sparse index. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.IndexDatapoint.SparseEmbedding sparse_embedding = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\IndexDatapoint\SparseEmbedding $var + * @return $this + */ + public function setSparseEmbedding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\IndexDatapoint\SparseEmbedding::class); + $this->sparse_embedding = $var; + + return $this; + } + /** * Optional. List of Restrict of the datapoint, used to perform "restricted * searches" where boolean rule are used to filter the subset of the database diff --git a/AiPlatform/src/V1/IndexDatapoint/CrowdingTag.php b/AiPlatform/src/V1/IndexDatapoint/CrowdingTag.php index 5642d0a823fd..ea128677b462 100644 --- a/AiPlatform/src/V1/IndexDatapoint/CrowdingTag.php +++ b/AiPlatform/src/V1/IndexDatapoint/CrowdingTag.php @@ -26,7 +26,7 @@ class CrowdingTag extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string crowding_attribute = 1; */ - private $crowding_attribute = ''; + protected $crowding_attribute = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/IndexDatapoint/NumericRestriction.php b/AiPlatform/src/V1/IndexDatapoint/NumericRestriction.php index d2977f87663c..45ef5f001212 100644 --- a/AiPlatform/src/V1/IndexDatapoint/NumericRestriction.php +++ b/AiPlatform/src/V1/IndexDatapoint/NumericRestriction.php @@ -21,14 +21,14 @@ class NumericRestriction extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string namespace = 1; */ - private $namespace = ''; + protected $namespace = ''; /** * This MUST be specified for queries and must NOT be specified for * datapoints. * * Generated from protobuf field .google.cloud.aiplatform.v1.IndexDatapoint.NumericRestriction.Operator op = 5; */ - private $op = 0; + protected $op = 0; protected $Value; /** diff --git a/AiPlatform/src/V1/IndexDatapoint/Restriction.php b/AiPlatform/src/V1/IndexDatapoint/Restriction.php index 72effa875d21..e7b03799b38b 100644 --- a/AiPlatform/src/V1/IndexDatapoint/Restriction.php +++ b/AiPlatform/src/V1/IndexDatapoint/Restriction.php @@ -21,7 +21,7 @@ class Restriction extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string namespace = 1; */ - private $namespace = ''; + protected $namespace = ''; /** * The attributes to allow in this namespace. e.g.: 'red' * diff --git a/AiPlatform/src/V1/IndexDatapoint/SparseEmbedding.php b/AiPlatform/src/V1/IndexDatapoint/SparseEmbedding.php new file mode 100644 index 000000000000..2bce5106ac46 --- /dev/null +++ b/AiPlatform/src/V1/IndexDatapoint/SparseEmbedding.php @@ -0,0 +1,107 @@ +google.cloud.aiplatform.v1.IndexDatapoint.SparseEmbedding + */ +class SparseEmbedding extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The list of embedding values of the sparse vector. + * + * Generated from protobuf field repeated float values = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $values; + /** + * Required. The list of indexes for the embedding values of the sparse + * vector. + * + * Generated from protobuf field repeated int64 dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $dimensions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * Required. The list of embedding values of the sparse vector. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $dimensions + * Required. The list of indexes for the embedding values of the sparse + * vector. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\Index::initOnce(); + parent::__construct($data); + } + + /** + * Required. The list of embedding values of the sparse vector. + * + * Generated from protobuf field repeated float values = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Required. The list of embedding values of the sparse vector. + * + * Generated from protobuf field repeated float values = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FLOAT); + $this->values = $arr; + + return $this; + } + + /** + * Required. The list of indexes for the embedding values of the sparse + * vector. + * + * Generated from protobuf field repeated int64 dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDimensions() + { + return $this->dimensions; + } + + /** + * Required. The list of indexes for the embedding values of the sparse + * vector. + * + * Generated from protobuf field repeated int64 dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDimensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->dimensions = $arr; + + return $this; + } + +} + + diff --git a/AiPlatform/src/V1/IndexEndpoint.php b/AiPlatform/src/V1/IndexEndpoint.php index b904c9d31ba3..4bdef3fded1e 100644 --- a/AiPlatform/src/V1/IndexEndpoint.php +++ b/AiPlatform/src/V1/IndexEndpoint.php @@ -21,7 +21,7 @@ class IndexEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The display name of the IndexEndpoint. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -29,13 +29,13 @@ class IndexEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * The description of the IndexEndpoint. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Output only. The indexes deployed in this endpoint. * @@ -48,7 +48,7 @@ class IndexEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 5; */ - private $etag = ''; + protected $etag = ''; /** * The labels with user-defined metadata to organize your IndexEndpoints. * Label keys and values can be no longer than 64 characters @@ -64,7 +64,7 @@ class IndexEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this IndexEndpoint was last updated. * This timestamp is not updated when the endpoint's DeployedIndexes are @@ -73,7 +73,7 @@ class IndexEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. The full name of the Google Compute Engine * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) @@ -90,7 +90,7 @@ class IndexEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $network = ''; + protected $network = ''; /** * Optional. Deprecated: If true, expose the IndexEndpoint via private service * connect. @@ -111,14 +111,14 @@ class IndexEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PrivateServiceConnectConfig private_service_connect_config = 12 [(.google.api.field_behavior) = OPTIONAL]; */ - private $private_service_connect_config = null; + protected $private_service_connect_config = null; /** * Optional. If true, the deployed index will be accessible through public * endpoint. * * Generated from protobuf field bool public_endpoint_enabled = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $public_endpoint_enabled = false; + protected $public_endpoint_enabled = false; /** * Output only. If * [public_endpoint_enabled][google.cloud.aiplatform.v1.IndexEndpoint.public_endpoint_enabled] @@ -127,7 +127,7 @@ class IndexEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string public_endpoint_domain_name = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $public_endpoint_domain_name = ''; + protected $public_endpoint_domain_name = ''; /** * Immutable. Customer-managed encryption key spec for an IndexEndpoint. If * set, this IndexEndpoint and all sub-resources of this IndexEndpoint will be @@ -135,7 +135,7 @@ class IndexEndpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 15 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/IndexEndpointServiceClient.php b/AiPlatform/src/V1/IndexEndpointServiceClient.php deleted file mode 100644 index 175b0f0ce889..000000000000 --- a/AiPlatform/src/V1/IndexEndpointServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.IndexEndpointService/CreateIndexEndpoint', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets an IndexEndpoint. - * @param \Google\Cloud\AIPlatform\V1\GetIndexEndpointRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIndexEndpoint(\Google\Cloud\AIPlatform\V1\GetIndexEndpointRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexEndpointService/GetIndexEndpoint', - $argument, - ['\Google\Cloud\AIPlatform\V1\IndexEndpoint', 'decode'], - $metadata, $options); - } - - /** - * Lists IndexEndpoints in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListIndexEndpointsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListIndexEndpoints(\Google\Cloud\AIPlatform\V1\ListIndexEndpointsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexEndpointService/ListIndexEndpoints', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListIndexEndpointsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates an IndexEndpoint. - * @param \Google\Cloud\AIPlatform\V1\UpdateIndexEndpointRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateIndexEndpoint(\Google\Cloud\AIPlatform\V1\UpdateIndexEndpointRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexEndpointService/UpdateIndexEndpoint', - $argument, - ['\Google\Cloud\AIPlatform\V1\IndexEndpoint', 'decode'], - $metadata, $options); - } - - /** - * Deletes an IndexEndpoint. - * @param \Google\Cloud\AIPlatform\V1\DeleteIndexEndpointRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteIndexEndpoint(\Google\Cloud\AIPlatform\V1\DeleteIndexEndpointRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexEndpointService/DeleteIndexEndpoint', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deploys an Index into this IndexEndpoint, creating a DeployedIndex within - * it. - * Only non-empty Indexes can be deployed. - * @param \Google\Cloud\AIPlatform\V1\DeployIndexRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeployIndex(\Google\Cloud\AIPlatform\V1\DeployIndexRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexEndpointService/DeployIndex', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, - * and freeing all resources it's using. - * @param \Google\Cloud\AIPlatform\V1\UndeployIndexRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UndeployIndex(\Google\Cloud\AIPlatform\V1\UndeployIndexRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexEndpointService/UndeployIndex', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Update an existing DeployedIndex under an IndexEndpoint. - * @param \Google\Cloud\AIPlatform\V1\MutateDeployedIndexRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MutateDeployedIndex(\Google\Cloud\AIPlatform\V1\MutateDeployedIndexRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexEndpointService/MutateDeployedIndex', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/IndexPrivateEndpoints.php b/AiPlatform/src/V1/IndexPrivateEndpoints.php index 2dac805f5bc9..131e84feb92f 100644 --- a/AiPlatform/src/V1/IndexPrivateEndpoints.php +++ b/AiPlatform/src/V1/IndexPrivateEndpoints.php @@ -24,14 +24,14 @@ class IndexPrivateEndpoints extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string match_grpc_address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $match_grpc_address = ''; + protected $match_grpc_address = ''; /** * Output only. The name of the service attachment resource. Populated if * private service connect is enabled. * * Generated from protobuf field string service_attachment = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service_attachment = ''; + protected $service_attachment = ''; /** * Output only. PscAutomatedEndpoints is populated if private service connect * is enabled if PscAutomatedConfig is set. diff --git a/AiPlatform/src/V1/IndexServiceClient.php b/AiPlatform/src/V1/IndexServiceClient.php deleted file mode 100644 index 92cab9947cd0..000000000000 --- a/AiPlatform/src/V1/IndexServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.IndexService/CreateIndex', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets an Index. - * @param \Google\Cloud\AIPlatform\V1\GetIndexRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIndex(\Google\Cloud\AIPlatform\V1\GetIndexRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexService/GetIndex', - $argument, - ['\Google\Cloud\AIPlatform\V1\Index', 'decode'], - $metadata, $options); - } - - /** - * Lists Indexes in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListIndexesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListIndexes(\Google\Cloud\AIPlatform\V1\ListIndexesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexService/ListIndexes', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListIndexesResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates an Index. - * @param \Google\Cloud\AIPlatform\V1\UpdateIndexRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateIndex(\Google\Cloud\AIPlatform\V1\UpdateIndexRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexService/UpdateIndex', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes an Index. - * An Index can only be deleted when all its - * [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had - * been undeployed. - * @param \Google\Cloud\AIPlatform\V1\DeleteIndexRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteIndex(\Google\Cloud\AIPlatform\V1\DeleteIndexRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexService/DeleteIndex', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Add/update Datapoints into an Index. - * @param \Google\Cloud\AIPlatform\V1\UpsertDatapointsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpsertDatapoints(\Google\Cloud\AIPlatform\V1\UpsertDatapointsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexService/UpsertDatapoints', - $argument, - ['\Google\Cloud\AIPlatform\V1\UpsertDatapointsResponse', 'decode'], - $metadata, $options); - } - - /** - * Remove Datapoints from an Index. - * @param \Google\Cloud\AIPlatform\V1\RemoveDatapointsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RemoveDatapoints(\Google\Cloud\AIPlatform\V1\RemoveDatapointsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.IndexService/RemoveDatapoints', - $argument, - ['\Google\Cloud\AIPlatform\V1\RemoveDatapointsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/IndexStats.php b/AiPlatform/src/V1/IndexStats.php index 86a1fefcacca..c2a31be9f80a 100644 --- a/AiPlatform/src/V1/IndexStats.php +++ b/AiPlatform/src/V1/IndexStats.php @@ -16,17 +16,23 @@ class IndexStats extends \Google\Protobuf\Internal\Message { /** - * Output only. The number of vectors in the Index. + * Output only. The number of dense vectors in the Index. * * Generated from protobuf field int64 vectors_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $vectors_count = 0; + protected $vectors_count = 0; + /** + * Output only. The number of sparse vectors in the Index. + * + * Generated from protobuf field int64 sparse_vectors_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $sparse_vectors_count = 0; /** * Output only. The number of shards in the Index. * * Generated from protobuf field int32 shards_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $shards_count = 0; + protected $shards_count = 0; /** * Constructor. @@ -35,7 +41,9 @@ class IndexStats extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $vectors_count - * Output only. The number of vectors in the Index. + * Output only. The number of dense vectors in the Index. + * @type int|string $sparse_vectors_count + * Output only. The number of sparse vectors in the Index. * @type int $shards_count * Output only. The number of shards in the Index. * } @@ -46,7 +54,7 @@ public function __construct($data = NULL) { } /** - * Output only. The number of vectors in the Index. + * Output only. The number of dense vectors in the Index. * * Generated from protobuf field int64 vectors_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int|string @@ -57,7 +65,7 @@ public function getVectorsCount() } /** - * Output only. The number of vectors in the Index. + * Output only. The number of dense vectors in the Index. * * Generated from protobuf field int64 vectors_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int|string $var @@ -71,6 +79,32 @@ public function setVectorsCount($var) return $this; } + /** + * Output only. The number of sparse vectors in the Index. + * + * Generated from protobuf field int64 sparse_vectors_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSparseVectorsCount() + { + return $this->sparse_vectors_count; + } + + /** + * Output only. The number of sparse vectors in the Index. + * + * Generated from protobuf field int64 sparse_vectors_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSparseVectorsCount($var) + { + GPBUtil::checkInt64($var); + $this->sparse_vectors_count = $var; + + return $this; + } + /** * Output only. The number of shards in the Index. * diff --git a/AiPlatform/src/V1/InputDataConfig.php b/AiPlatform/src/V1/InputDataConfig.php index 810c5fec96ea..d29879a01bb4 100644 --- a/AiPlatform/src/V1/InputDataConfig.php +++ b/AiPlatform/src/V1/InputDataConfig.php @@ -27,7 +27,7 @@ class InputDataConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $dataset_id = ''; + protected $dataset_id = ''; /** * Applicable only to Datasets that have DataItems and Annotations. * A filter on Annotations of the Dataset. Only Annotations that both @@ -41,7 +41,7 @@ class InputDataConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string annotations_filter = 6; */ - private $annotations_filter = ''; + protected $annotations_filter = ''; /** * Applicable only to custom training with Datasets that have DataItems and * Annotations. @@ -66,7 +66,7 @@ class InputDataConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string annotation_schema_uri = 9; */ - private $annotation_schema_uri = ''; + protected $annotation_schema_uri = ''; /** * Only applicable to Datasets that have SavedQueries. * The ID of a SavedQuery (annotation set) under the Dataset specified by @@ -87,13 +87,13 @@ class InputDataConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string saved_query_id = 7; */ - private $saved_query_id = ''; + protected $saved_query_id = ''; /** * Whether to persist the ML use assignment to data item system labels. * * Generated from protobuf field bool persist_ml_use_assignment = 11; */ - private $persist_ml_use_assignment = false; + protected $persist_ml_use_assignment = false; protected $split; protected $destination; diff --git a/AiPlatform/src/V1/IntegratedGradientsAttribution.php b/AiPlatform/src/V1/IntegratedGradientsAttribution.php index 3dc9d064bfe4..c8c0c0d44ea1 100644 --- a/AiPlatform/src/V1/IntegratedGradientsAttribution.php +++ b/AiPlatform/src/V1/IntegratedGradientsAttribution.php @@ -25,7 +25,7 @@ class IntegratedGradientsAttribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $step_count = 0; + protected $step_count = 0; /** * Config for SmoothGrad approximation of gradients. * When enabled, the gradients are approximated by averaging the gradients @@ -35,7 +35,7 @@ class IntegratedGradientsAttribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.SmoothGradConfig smooth_grad_config = 2; */ - private $smooth_grad_config = null; + protected $smooth_grad_config = null; /** * Config for IG with blur baseline. * When enabled, a linear path from the maximally blurred image to the input @@ -45,7 +45,7 @@ class IntegratedGradientsAttribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.BlurBaselineConfig blur_baseline_config = 3; */ - private $blur_baseline_config = null; + protected $blur_baseline_config = null; /** * Constructor. diff --git a/AiPlatform/src/V1/JobServiceClient.php b/AiPlatform/src/V1/JobServiceClient.php deleted file mode 100644 index 08ff2eea05a6..000000000000 --- a/AiPlatform/src/V1/JobServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.JobService/CreateCustomJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\CustomJob', 'decode'], - $metadata, $options); - } - - /** - * Gets a CustomJob. - * @param \Google\Cloud\AIPlatform\V1\GetCustomJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetCustomJob(\Google\Cloud\AIPlatform\V1\GetCustomJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/GetCustomJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\CustomJob', 'decode'], - $metadata, $options); - } - - /** - * Lists CustomJobs in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListCustomJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListCustomJobs(\Google\Cloud\AIPlatform\V1\ListCustomJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/ListCustomJobs', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListCustomJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a CustomJob. - * @param \Google\Cloud\AIPlatform\V1\DeleteCustomJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteCustomJob(\Google\Cloud\AIPlatform\V1\DeleteCustomJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/DeleteCustomJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Cancels a CustomJob. - * Starts asynchronous cancellation on the CustomJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use - * [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob] - * or other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the CustomJob is not deleted; instead it becomes a job with - * a [CustomJob.error][google.cloud.aiplatform.v1.CustomJob.error] value with - * a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`, and - * [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to - * `CANCELLED`. - * @param \Google\Cloud\AIPlatform\V1\CancelCustomJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelCustomJob(\Google\Cloud\AIPlatform\V1\CancelCustomJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CancelCustomJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates a DataLabelingJob. - * @param \Google\Cloud\AIPlatform\V1\CreateDataLabelingJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateDataLabelingJob(\Google\Cloud\AIPlatform\V1\CreateDataLabelingJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CreateDataLabelingJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\DataLabelingJob', 'decode'], - $metadata, $options); - } - - /** - * Gets a DataLabelingJob. - * @param \Google\Cloud\AIPlatform\V1\GetDataLabelingJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetDataLabelingJob(\Google\Cloud\AIPlatform\V1\GetDataLabelingJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/GetDataLabelingJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\DataLabelingJob', 'decode'], - $metadata, $options); - } - - /** - * Lists DataLabelingJobs in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListDataLabelingJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListDataLabelingJobs(\Google\Cloud\AIPlatform\V1\ListDataLabelingJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/ListDataLabelingJobs', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListDataLabelingJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a DataLabelingJob. - * @param \Google\Cloud\AIPlatform\V1\DeleteDataLabelingJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteDataLabelingJob(\Google\Cloud\AIPlatform\V1\DeleteDataLabelingJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/DeleteDataLabelingJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. - * @param \Google\Cloud\AIPlatform\V1\CancelDataLabelingJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelDataLabelingJob(\Google\Cloud\AIPlatform\V1\CancelDataLabelingJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CancelDataLabelingJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates a HyperparameterTuningJob - * @param \Google\Cloud\AIPlatform\V1\CreateHyperparameterTuningJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateHyperparameterTuningJob(\Google\Cloud\AIPlatform\V1\CreateHyperparameterTuningJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CreateHyperparameterTuningJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\HyperparameterTuningJob', 'decode'], - $metadata, $options); - } - - /** - * Gets a HyperparameterTuningJob - * @param \Google\Cloud\AIPlatform\V1\GetHyperparameterTuningJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetHyperparameterTuningJob(\Google\Cloud\AIPlatform\V1\GetHyperparameterTuningJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/GetHyperparameterTuningJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\HyperparameterTuningJob', 'decode'], - $metadata, $options); - } - - /** - * Lists HyperparameterTuningJobs in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListHyperparameterTuningJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListHyperparameterTuningJobs(\Google\Cloud\AIPlatform\V1\ListHyperparameterTuningJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/ListHyperparameterTuningJobs', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListHyperparameterTuningJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a HyperparameterTuningJob. - * @param \Google\Cloud\AIPlatform\V1\DeleteHyperparameterTuningJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteHyperparameterTuningJob(\Google\Cloud\AIPlatform\V1\DeleteHyperparameterTuningJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/DeleteHyperparameterTuningJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Cancels a HyperparameterTuningJob. - * Starts asynchronous cancellation on the HyperparameterTuningJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use - * [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob] - * or other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the HyperparameterTuningJob is not deleted; instead it becomes a job with - * a - * [HyperparameterTuningJob.error][google.cloud.aiplatform.v1.HyperparameterTuningJob.error] - * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`, and - * [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state] - * is set to `CANCELLED`. - * @param \Google\Cloud\AIPlatform\V1\CancelHyperparameterTuningJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelHyperparameterTuningJob(\Google\Cloud\AIPlatform\V1\CancelHyperparameterTuningJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CancelHyperparameterTuningJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates a NasJob - * @param \Google\Cloud\AIPlatform\V1\CreateNasJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateNasJob(\Google\Cloud\AIPlatform\V1\CreateNasJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CreateNasJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\NasJob', 'decode'], - $metadata, $options); - } - - /** - * Gets a NasJob - * @param \Google\Cloud\AIPlatform\V1\GetNasJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetNasJob(\Google\Cloud\AIPlatform\V1\GetNasJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/GetNasJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\NasJob', 'decode'], - $metadata, $options); - } - - /** - * Lists NasJobs in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListNasJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListNasJobs(\Google\Cloud\AIPlatform\V1\ListNasJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/ListNasJobs', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListNasJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a NasJob. - * @param \Google\Cloud\AIPlatform\V1\DeleteNasJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteNasJob(\Google\Cloud\AIPlatform\V1\DeleteNasJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/DeleteNasJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Cancels a NasJob. - * Starts asynchronous cancellation on the NasJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use - * [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or - * other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the NasJob is not deleted; instead it becomes a job with - * a [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`, and - * [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to - * `CANCELLED`. - * @param \Google\Cloud\AIPlatform\V1\CancelNasJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelNasJob(\Google\Cloud\AIPlatform\V1\CancelNasJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CancelNasJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets a NasTrialDetail. - * @param \Google\Cloud\AIPlatform\V1\GetNasTrialDetailRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetNasTrialDetail(\Google\Cloud\AIPlatform\V1\GetNasTrialDetailRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/GetNasTrialDetail', - $argument, - ['\Google\Cloud\AIPlatform\V1\NasTrialDetail', 'decode'], - $metadata, $options); - } - - /** - * List top NasTrialDetails of a NasJob. - * @param \Google\Cloud\AIPlatform\V1\ListNasTrialDetailsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListNasTrialDetails(\Google\Cloud\AIPlatform\V1\ListNasTrialDetailsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/ListNasTrialDetails', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListNasTrialDetailsResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates a BatchPredictionJob. A BatchPredictionJob once created will - * right away be attempted to start. - * @param \Google\Cloud\AIPlatform\V1\CreateBatchPredictionJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBatchPredictionJob(\Google\Cloud\AIPlatform\V1\CreateBatchPredictionJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CreateBatchPredictionJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\BatchPredictionJob', 'decode'], - $metadata, $options); - } - - /** - * Gets a BatchPredictionJob - * @param \Google\Cloud\AIPlatform\V1\GetBatchPredictionJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetBatchPredictionJob(\Google\Cloud\AIPlatform\V1\GetBatchPredictionJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/GetBatchPredictionJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\BatchPredictionJob', 'decode'], - $metadata, $options); - } - - /** - * Lists BatchPredictionJobs in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListBatchPredictionJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListBatchPredictionJobs(\Google\Cloud\AIPlatform\V1\ListBatchPredictionJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/ListBatchPredictionJobs', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListBatchPredictionJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a BatchPredictionJob. Can only be called on jobs that already - * finished. - * @param \Google\Cloud\AIPlatform\V1\DeleteBatchPredictionJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteBatchPredictionJob(\Google\Cloud\AIPlatform\V1\DeleteBatchPredictionJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/DeleteBatchPredictionJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Cancels a BatchPredictionJob. - * - * Starts asynchronous cancellation on the BatchPredictionJob. The server - * makes the best effort to cancel the job, but success is not - * guaranteed. Clients can use - * [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob] - * or other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On a successful cancellation, - * the BatchPredictionJob is not deleted;instead its - * [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] - * is set to `CANCELLED`. Any files already outputted by the job are not - * deleted. - * @param \Google\Cloud\AIPlatform\V1\CancelBatchPredictionJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelBatchPredictionJob(\Google\Cloud\AIPlatform\V1\CancelBatchPredictionJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CancelBatchPredictionJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates a ModelDeploymentMonitoringJob. It will run periodically on a - * configured interval. - * @param \Google\Cloud\AIPlatform\V1\CreateModelDeploymentMonitoringJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateModelDeploymentMonitoringJob(\Google\Cloud\AIPlatform\V1\CreateModelDeploymentMonitoringJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/CreateModelDeploymentMonitoringJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob', 'decode'], - $metadata, $options); - } - - /** - * Searches Model Monitoring Statistics generated within a given time window. - * @param \Google\Cloud\AIPlatform\V1\SearchModelDeploymentMonitoringStatsAnomaliesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SearchModelDeploymentMonitoringStatsAnomalies(\Google\Cloud\AIPlatform\V1\SearchModelDeploymentMonitoringStatsAnomaliesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/SearchModelDeploymentMonitoringStatsAnomalies', - $argument, - ['\Google\Cloud\AIPlatform\V1\SearchModelDeploymentMonitoringStatsAnomaliesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a ModelDeploymentMonitoringJob. - * @param \Google\Cloud\AIPlatform\V1\GetModelDeploymentMonitoringJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetModelDeploymentMonitoringJob(\Google\Cloud\AIPlatform\V1\GetModelDeploymentMonitoringJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/GetModelDeploymentMonitoringJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob', 'decode'], - $metadata, $options); - } - - /** - * Lists ModelDeploymentMonitoringJobs in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListModelDeploymentMonitoringJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListModelDeploymentMonitoringJobs(\Google\Cloud\AIPlatform\V1\ListModelDeploymentMonitoringJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/ListModelDeploymentMonitoringJobs', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListModelDeploymentMonitoringJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a ModelDeploymentMonitoringJob. - * @param \Google\Cloud\AIPlatform\V1\UpdateModelDeploymentMonitoringJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateModelDeploymentMonitoringJob(\Google\Cloud\AIPlatform\V1\UpdateModelDeploymentMonitoringJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/UpdateModelDeploymentMonitoringJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a ModelDeploymentMonitoringJob. - * @param \Google\Cloud\AIPlatform\V1\DeleteModelDeploymentMonitoringJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteModelDeploymentMonitoringJob(\Google\Cloud\AIPlatform\V1\DeleteModelDeploymentMonitoringJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/DeleteModelDeploymentMonitoringJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server - * makes a best effort to cancel the job. Will mark - * [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state] - * to 'PAUSED'. - * @param \Google\Cloud\AIPlatform\V1\PauseModelDeploymentMonitoringJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PauseModelDeploymentMonitoringJob(\Google\Cloud\AIPlatform\V1\PauseModelDeploymentMonitoringJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/PauseModelDeploymentMonitoringJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from - * next scheduled time. A deleted ModelDeploymentMonitoringJob can't be - * resumed. - * @param \Google\Cloud\AIPlatform\V1\ResumeModelDeploymentMonitoringJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ResumeModelDeploymentMonitoringJob(\Google\Cloud\AIPlatform\V1\ResumeModelDeploymentMonitoringJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.JobService/ResumeModelDeploymentMonitoringJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/LargeModelReference.php b/AiPlatform/src/V1/LargeModelReference.php index c7ed2e13e5b2..bb7c3e5cdfc2 100644 --- a/AiPlatform/src/V1/LargeModelReference.php +++ b/AiPlatform/src/V1/LargeModelReference.php @@ -22,7 +22,7 @@ class LargeModelReference extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListAnnotationsRequest.php b/AiPlatform/src/V1/ListAnnotationsRequest.php index f3054b0d2f61..c3ff7ea1d4da 100644 --- a/AiPlatform/src/V1/ListAnnotationsRequest.php +++ b/AiPlatform/src/V1/ListAnnotationsRequest.php @@ -23,38 +23,38 @@ class ListAnnotationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. * * Generated from protobuf field string order_by = 6; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the DataItem to list Annotations from. diff --git a/AiPlatform/src/V1/ListAnnotationsResponse.php b/AiPlatform/src/V1/ListAnnotationsResponse.php index f511ab3d1a96..9abd1cb010bc 100644 --- a/AiPlatform/src/V1/ListAnnotationsResponse.php +++ b/AiPlatform/src/V1/ListAnnotationsResponse.php @@ -27,7 +27,7 @@ class ListAnnotationsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListArtifactsRequest.php b/AiPlatform/src/V1/ListArtifactsRequest.php index 621d851b4c88..b1c90a5a6e5e 100644 --- a/AiPlatform/src/V1/ListArtifactsRequest.php +++ b/AiPlatform/src/V1/ListArtifactsRequest.php @@ -23,14 +23,14 @@ class ListArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of Artifacts to return. The service may return fewer. * Must be in range 1-1000, inclusive. Defaults to 100. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [MetadataService.ListArtifacts][google.cloud.aiplatform.v1.MetadataService.ListArtifacts] @@ -41,7 +41,7 @@ class ListArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Filter specifying the boolean condition for the Artifacts to satisfy in * order to be part of the result set. @@ -74,7 +74,7 @@ class ListArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * How the list of messages is ordered. Specify the values to order by and an * ordering operation. The default sorting order is ascending. To specify @@ -85,7 +85,7 @@ class ListArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The MetadataStore whose Artifacts should be listed. diff --git a/AiPlatform/src/V1/ListArtifactsResponse.php b/AiPlatform/src/V1/ListArtifactsResponse.php index d12b8604cfde..0b4d5e33d9fe 100644 --- a/AiPlatform/src/V1/ListArtifactsResponse.php +++ b/AiPlatform/src/V1/ListArtifactsResponse.php @@ -30,7 +30,7 @@ class ListArtifactsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListBatchPredictionJobsRequest.php b/AiPlatform/src/V1/ListBatchPredictionJobsRequest.php index 9e9d70ac6fd8..6710f7b15a96 100644 --- a/AiPlatform/src/V1/ListBatchPredictionJobsRequest.php +++ b/AiPlatform/src/V1/ListBatchPredictionJobsRequest.php @@ -22,7 +22,7 @@ class ListBatchPredictionJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * Supported fields: @@ -44,13 +44,13 @@ class ListBatchPredictionJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -61,13 +61,13 @@ class ListBatchPredictionJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location to list the BatchPredictionJobs diff --git a/AiPlatform/src/V1/ListBatchPredictionJobsResponse.php b/AiPlatform/src/V1/ListBatchPredictionJobsResponse.php index 174625b3f376..1e489f66d63c 100644 --- a/AiPlatform/src/V1/ListBatchPredictionJobsResponse.php +++ b/AiPlatform/src/V1/ListBatchPredictionJobsResponse.php @@ -30,7 +30,7 @@ class ListBatchPredictionJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListContextsRequest.php b/AiPlatform/src/V1/ListContextsRequest.php index ba3be8907d03..25bb6027069d 100644 --- a/AiPlatform/src/V1/ListContextsRequest.php +++ b/AiPlatform/src/V1/ListContextsRequest.php @@ -23,14 +23,14 @@ class ListContextsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of Contexts to return. The service may return fewer. * Must be in range 1-1000, inclusive. Defaults to 100. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [MetadataService.ListContexts][google.cloud.aiplatform.v1.MetadataService.ListContexts] @@ -41,7 +41,7 @@ class ListContextsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Filter specifying the boolean condition for the Contexts to satisfy in * order to be part of the result set. @@ -77,7 +77,7 @@ class ListContextsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * How the list of messages is ordered. Specify the values to order by and an * ordering operation. The default sorting order is ascending. To specify @@ -88,7 +88,7 @@ class ListContextsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The MetadataStore whose Contexts should be listed. diff --git a/AiPlatform/src/V1/ListContextsResponse.php b/AiPlatform/src/V1/ListContextsResponse.php index 30093458143c..eccc6f3c9a82 100644 --- a/AiPlatform/src/V1/ListContextsResponse.php +++ b/AiPlatform/src/V1/ListContextsResponse.php @@ -30,7 +30,7 @@ class ListContextsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListCustomJobsRequest.php b/AiPlatform/src/V1/ListCustomJobsRequest.php index 1269f5f4bd60..696cc01e4734 100644 --- a/AiPlatform/src/V1/ListCustomJobsRequest.php +++ b/AiPlatform/src/V1/ListCustomJobsRequest.php @@ -22,7 +22,7 @@ class ListCustomJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * Supported fields: @@ -43,13 +43,13 @@ class ListCustomJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -60,13 +60,13 @@ class ListCustomJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location to list the CustomJobs from. diff --git a/AiPlatform/src/V1/ListCustomJobsResponse.php b/AiPlatform/src/V1/ListCustomJobsResponse.php index 5b72a74c3575..c3ad64faafd1 100644 --- a/AiPlatform/src/V1/ListCustomJobsResponse.php +++ b/AiPlatform/src/V1/ListCustomJobsResponse.php @@ -30,7 +30,7 @@ class ListCustomJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListDataItemsRequest.php b/AiPlatform/src/V1/ListDataItemsRequest.php index 31e3536db8c6..ede1f6fd4e1b 100644 --- a/AiPlatform/src/V1/ListDataItemsRequest.php +++ b/AiPlatform/src/V1/ListDataItemsRequest.php @@ -23,38 +23,38 @@ class ListDataItemsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. * * Generated from protobuf field string order_by = 6; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Dataset to list DataItems from. diff --git a/AiPlatform/src/V1/ListDataItemsResponse.php b/AiPlatform/src/V1/ListDataItemsResponse.php index 13960f8d33ff..95763e24473b 100644 --- a/AiPlatform/src/V1/ListDataItemsResponse.php +++ b/AiPlatform/src/V1/ListDataItemsResponse.php @@ -27,7 +27,7 @@ class ListDataItemsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListDataLabelingJobsRequest.php b/AiPlatform/src/V1/ListDataLabelingJobsRequest.php index 93b59f536c2d..9d4cdf335e1d 100644 --- a/AiPlatform/src/V1/ListDataLabelingJobsRequest.php +++ b/AiPlatform/src/V1/ListDataLabelingJobsRequest.php @@ -22,7 +22,7 @@ class ListDataLabelingJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * Supported fields: @@ -43,19 +43,19 @@ class ListDataLabelingJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. FieldMask represents a set of * symbolic field paths. For example, the mask can be `paths: "name"`. The @@ -64,7 +64,7 @@ class ListDataLabelingJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * A comma-separated list of fields to order by, sorted in ascending order by * default. @@ -72,7 +72,7 @@ class ListDataLabelingJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 6; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent of the DataLabelingJob. diff --git a/AiPlatform/src/V1/ListDataLabelingJobsResponse.php b/AiPlatform/src/V1/ListDataLabelingJobsResponse.php index f1dbef7abbe9..59c261630081 100644 --- a/AiPlatform/src/V1/ListDataLabelingJobsResponse.php +++ b/AiPlatform/src/V1/ListDataLabelingJobsResponse.php @@ -28,7 +28,7 @@ class ListDataLabelingJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListDatasetVersionsRequest.php b/AiPlatform/src/V1/ListDatasetVersionsRequest.php index 57a7f519d8cd..3247913749f1 100644 --- a/AiPlatform/src/V1/ListDatasetVersionsRequest.php +++ b/AiPlatform/src/V1/ListDatasetVersionsRequest.php @@ -23,38 +23,38 @@ class ListDatasetVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The standard list filter. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. The standard list page size. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. The standard list page token. * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $read_mask = null; + protected $read_mask = null; /** * Optional. A comma-separated list of fields to order by, sorted in ascending * order. Use "desc" after a field name for descending. * * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Dataset to list DatasetVersions from. diff --git a/AiPlatform/src/V1/ListDatasetVersionsResponse.php b/AiPlatform/src/V1/ListDatasetVersionsResponse.php index 86eadf42f22c..c4d05c89e077 100644 --- a/AiPlatform/src/V1/ListDatasetVersionsResponse.php +++ b/AiPlatform/src/V1/ListDatasetVersionsResponse.php @@ -27,7 +27,7 @@ class ListDatasetVersionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListDatasetsRequest.php b/AiPlatform/src/V1/ListDatasetsRequest.php index ba642e9e8ed9..3b608ae945da 100644 --- a/AiPlatform/src/V1/ListDatasetsRequest.php +++ b/AiPlatform/src/V1/ListDatasetsRequest.php @@ -22,7 +22,7 @@ class ListDatasetsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * An expression for filtering the results of the request. For field names * both snake_case and camelCase are supported. @@ -38,25 +38,25 @@ class ListDatasetsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -67,7 +67,7 @@ class ListDatasetsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 6; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The name of the Dataset's parent resource. diff --git a/AiPlatform/src/V1/ListDatasetsResponse.php b/AiPlatform/src/V1/ListDatasetsResponse.php index eff204a65a2b..828c20173ecb 100644 --- a/AiPlatform/src/V1/ListDatasetsResponse.php +++ b/AiPlatform/src/V1/ListDatasetsResponse.php @@ -27,7 +27,7 @@ class ListDatasetsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListDeploymentResourcePoolsRequest.php b/AiPlatform/src/V1/ListDeploymentResourcePoolsRequest.php index ea69a84e533c..fe7f797512d2 100644 --- a/AiPlatform/src/V1/ListDeploymentResourcePoolsRequest.php +++ b/AiPlatform/src/V1/ListDeploymentResourcePoolsRequest.php @@ -21,14 +21,14 @@ class ListDeploymentResourcePoolsRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of DeploymentResourcePools to return. The service may * return fewer than this value. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous `ListDeploymentResourcePools` call. * Provide this to retrieve the subsequent page. @@ -38,7 +38,7 @@ class ListDeploymentResourcePoolsRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The parent Location which owns this collection of diff --git a/AiPlatform/src/V1/ListDeploymentResourcePoolsResponse.php b/AiPlatform/src/V1/ListDeploymentResourcePoolsResponse.php index fc7800f5bf0b..539a9052302c 100644 --- a/AiPlatform/src/V1/ListDeploymentResourcePoolsResponse.php +++ b/AiPlatform/src/V1/ListDeploymentResourcePoolsResponse.php @@ -27,7 +27,7 @@ class ListDeploymentResourcePoolsResponse extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListEndpointsRequest.php b/AiPlatform/src/V1/ListEndpointsRequest.php index 4fb300c50544..271a49eec2b7 100644 --- a/AiPlatform/src/V1/ListEndpointsRequest.php +++ b/AiPlatform/src/V1/ListEndpointsRequest.php @@ -22,7 +22,7 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. An expression for filtering the results of the request. For field * names both snake_case and camelCase are supported. @@ -43,13 +43,13 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. The standard list page size. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. The standard list page token. * Typically obtained via @@ -60,13 +60,13 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $read_mask = null; + protected $read_mask = null; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -78,7 +78,7 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 6; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Location from which to list the diff --git a/AiPlatform/src/V1/ListEndpointsResponse.php b/AiPlatform/src/V1/ListEndpointsResponse.php index 87d9beaa378e..a3e8abecd75a 100644 --- a/AiPlatform/src/V1/ListEndpointsResponse.php +++ b/AiPlatform/src/V1/ListEndpointsResponse.php @@ -30,7 +30,7 @@ class ListEndpointsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListEntityTypesRequest.php b/AiPlatform/src/V1/ListEntityTypesRequest.php index c66ae1a06e9d..baaa3458556d 100644 --- a/AiPlatform/src/V1/ListEntityTypesRequest.php +++ b/AiPlatform/src/V1/ListEntityTypesRequest.php @@ -23,7 +23,7 @@ class ListEntityTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the EntityTypes that match the filter expression. The following * filters are supported: @@ -43,7 +43,7 @@ class ListEntityTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of EntityTypes to return. The service may return fewer * than this value. If unspecified, at most 1000 EntityTypes will be returned. @@ -52,7 +52,7 @@ class ListEntityTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes] @@ -63,7 +63,7 @@ class ListEntityTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -74,13 +74,13 @@ class ListEntityTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 6; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Featurestore to list EntityTypes. diff --git a/AiPlatform/src/V1/ListEntityTypesResponse.php b/AiPlatform/src/V1/ListEntityTypesResponse.php index ac79064faa3c..220fc1f64254 100644 --- a/AiPlatform/src/V1/ListEntityTypesResponse.php +++ b/AiPlatform/src/V1/ListEntityTypesResponse.php @@ -30,7 +30,7 @@ class ListEntityTypesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListExecutionsRequest.php b/AiPlatform/src/V1/ListExecutionsRequest.php index 87f74efb6c5b..6f9f810f8c2c 100644 --- a/AiPlatform/src/V1/ListExecutionsRequest.php +++ b/AiPlatform/src/V1/ListExecutionsRequest.php @@ -23,14 +23,14 @@ class ListExecutionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of Executions to return. The service may return fewer. * Must be in range 1-1000, inclusive. Defaults to 100. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [MetadataService.ListExecutions][google.cloud.aiplatform.v1.MetadataService.ListExecutions] @@ -41,7 +41,7 @@ class ListExecutionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Filter specifying the boolean condition for the Executions to satisfy in * order to be part of the result set. @@ -74,7 +74,7 @@ class ListExecutionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * How the list of messages is ordered. Specify the values to order by and an * ordering operation. The default sorting order is ascending. To specify @@ -85,7 +85,7 @@ class ListExecutionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The MetadataStore whose Executions should be listed. diff --git a/AiPlatform/src/V1/ListExecutionsResponse.php b/AiPlatform/src/V1/ListExecutionsResponse.php index 59a0f328c0cd..fb295ee5f854 100644 --- a/AiPlatform/src/V1/ListExecutionsResponse.php +++ b/AiPlatform/src/V1/ListExecutionsResponse.php @@ -30,7 +30,7 @@ class ListExecutionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListFeatureGroupsRequest.php b/AiPlatform/src/V1/ListFeatureGroupsRequest.php index a0e8d3ca4475..6c8f374c84b4 100644 --- a/AiPlatform/src/V1/ListFeatureGroupsRequest.php +++ b/AiPlatform/src/V1/ListFeatureGroupsRequest.php @@ -23,7 +23,7 @@ class ListFeatureGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the FeatureGroups that match the filter expression. The * following fields are supported: @@ -42,7 +42,7 @@ class ListFeatureGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of FeatureGroups to return. The service may return * fewer than this value. If unspecified, at most 100 FeatureGroups will @@ -51,7 +51,7 @@ class ListFeatureGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [FeatureGroupAdminService.ListFeatureGroups][] call. @@ -62,7 +62,7 @@ class ListFeatureGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -72,7 +72,7 @@ class ListFeatureGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Location to list FeatureGroups. diff --git a/AiPlatform/src/V1/ListFeatureGroupsResponse.php b/AiPlatform/src/V1/ListFeatureGroupsResponse.php index 70cd21500da7..140860207117 100644 --- a/AiPlatform/src/V1/ListFeatureGroupsResponse.php +++ b/AiPlatform/src/V1/ListFeatureGroupsResponse.php @@ -30,7 +30,7 @@ class ListFeatureGroupsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListFeatureOnlineStoresRequest.php b/AiPlatform/src/V1/ListFeatureOnlineStoresRequest.php index 95119cc96d73..2559bd91a4a9 100644 --- a/AiPlatform/src/V1/ListFeatureOnlineStoresRequest.php +++ b/AiPlatform/src/V1/ListFeatureOnlineStoresRequest.php @@ -23,7 +23,7 @@ class ListFeatureOnlineStoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the FeatureOnlineStores that match the filter expression. The * following fields are supported: @@ -42,7 +42,7 @@ class ListFeatureOnlineStoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of FeatureOnlineStores to return. The service may return * fewer than this value. If unspecified, at most 100 FeatureOnlineStores will @@ -51,7 +51,7 @@ class ListFeatureOnlineStoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [FeatureOnlineStoreAdminService.ListFeatureOnlineStores][google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService.ListFeatureOnlineStores] @@ -62,7 +62,7 @@ class ListFeatureOnlineStoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -72,7 +72,7 @@ class ListFeatureOnlineStoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Location to list FeatureOnlineStores. diff --git a/AiPlatform/src/V1/ListFeatureOnlineStoresResponse.php b/AiPlatform/src/V1/ListFeatureOnlineStoresResponse.php index 16ff0903194d..95ce4983ad15 100644 --- a/AiPlatform/src/V1/ListFeatureOnlineStoresResponse.php +++ b/AiPlatform/src/V1/ListFeatureOnlineStoresResponse.php @@ -30,7 +30,7 @@ class ListFeatureOnlineStoresResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListFeatureViewSyncsRequest.php b/AiPlatform/src/V1/ListFeatureViewSyncsRequest.php index ba0f765d69b6..7e4345321d72 100644 --- a/AiPlatform/src/V1/ListFeatureViewSyncsRequest.php +++ b/AiPlatform/src/V1/ListFeatureViewSyncsRequest.php @@ -23,7 +23,7 @@ class ListFeatureViewSyncsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the FeatureViewSyncs that match the filter expression. The following * filters are supported: @@ -35,7 +35,7 @@ class ListFeatureViewSyncsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of FeatureViewSyncs to return. The service may return * fewer than this value. If unspecified, at most 1000 FeatureViewSyncs will @@ -44,7 +44,7 @@ class ListFeatureViewSyncsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [FeatureOnlineStoreAdminService.ListFeatureViewSyncs][google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService.ListFeatureViewSyncs] @@ -55,7 +55,7 @@ class ListFeatureViewSyncsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -64,7 +64,7 @@ class ListFeatureViewSyncsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the FeatureView to list FeatureViewSyncs. diff --git a/AiPlatform/src/V1/ListFeatureViewSyncsResponse.php b/AiPlatform/src/V1/ListFeatureViewSyncsResponse.php index 23ac5c02a9dc..7ba5b6764b79 100644 --- a/AiPlatform/src/V1/ListFeatureViewSyncsResponse.php +++ b/AiPlatform/src/V1/ListFeatureViewSyncsResponse.php @@ -30,7 +30,7 @@ class ListFeatureViewSyncsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListFeatureViewsRequest.php b/AiPlatform/src/V1/ListFeatureViewsRequest.php index 43c458596b8a..33afbac89980 100644 --- a/AiPlatform/src/V1/ListFeatureViewsRequest.php +++ b/AiPlatform/src/V1/ListFeatureViewsRequest.php @@ -23,7 +23,7 @@ class ListFeatureViewsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the FeatureViews that match the filter expression. The following * filters are supported: @@ -43,7 +43,7 @@ class ListFeatureViewsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of FeatureViews to return. The service may return fewer * than this value. If unspecified, at most 1000 FeatureViews will be @@ -52,7 +52,7 @@ class ListFeatureViewsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [FeatureOnlineStoreAdminService.ListFeatureViews][google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService.ListFeatureViews] @@ -63,7 +63,7 @@ class ListFeatureViewsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -74,7 +74,7 @@ class ListFeatureViewsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the FeatureOnlineStore to list FeatureViews. diff --git a/AiPlatform/src/V1/ListFeatureViewsResponse.php b/AiPlatform/src/V1/ListFeatureViewsResponse.php index de303847ecf2..f5ebd5abf6d2 100644 --- a/AiPlatform/src/V1/ListFeatureViewsResponse.php +++ b/AiPlatform/src/V1/ListFeatureViewsResponse.php @@ -30,7 +30,7 @@ class ListFeatureViewsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListFeaturesRequest.php b/AiPlatform/src/V1/ListFeaturesRequest.php index 4d8bc2018b1b..490a50d7b340 100644 --- a/AiPlatform/src/V1/ListFeaturesRequest.php +++ b/AiPlatform/src/V1/ListFeaturesRequest.php @@ -27,7 +27,7 @@ class ListFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the Features that match the filter expression. The following * filters are supported: @@ -49,7 +49,7 @@ class ListFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of Features to return. The service may return fewer * than this value. If unspecified, at most 1000 Features will be returned. @@ -58,7 +58,7 @@ class ListFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures] @@ -73,7 +73,7 @@ class ListFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -85,13 +85,13 @@ class ListFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 6; */ - private $read_mask = null; + protected $read_mask = null; /** * Only applicable for Vertex AI Feature Store (Legacy). * If set, return the most recent @@ -103,7 +103,7 @@ class ListFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 latest_stats_count = 7; */ - private $latest_stats_count = 0; + protected $latest_stats_count = 0; /** * @param string $parent Required. The resource name of the Location to list Features. diff --git a/AiPlatform/src/V1/ListFeaturesResponse.php b/AiPlatform/src/V1/ListFeaturesResponse.php index ec4bb57e561e..9d96f5a79cb2 100644 --- a/AiPlatform/src/V1/ListFeaturesResponse.php +++ b/AiPlatform/src/V1/ListFeaturesResponse.php @@ -32,7 +32,7 @@ class ListFeaturesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListFeaturestoresRequest.php b/AiPlatform/src/V1/ListFeaturestoresRequest.php index a06a49fb2d66..0ebc6cb3fca8 100644 --- a/AiPlatform/src/V1/ListFeaturestoresRequest.php +++ b/AiPlatform/src/V1/ListFeaturestoresRequest.php @@ -23,7 +23,7 @@ class ListFeaturestoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the featurestores that match the filter expression. The following * fields are supported: @@ -44,7 +44,7 @@ class ListFeaturestoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of Featurestores to return. The service may return fewer * than this value. If unspecified, at most 100 Featurestores will be @@ -53,7 +53,7 @@ class ListFeaturestoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores] @@ -64,7 +64,7 @@ class ListFeaturestoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -75,13 +75,13 @@ class ListFeaturestoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 6; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location to list Featurestores. diff --git a/AiPlatform/src/V1/ListFeaturestoresResponse.php b/AiPlatform/src/V1/ListFeaturestoresResponse.php index 9a5a44e2ba10..6155e85bf8e6 100644 --- a/AiPlatform/src/V1/ListFeaturestoresResponse.php +++ b/AiPlatform/src/V1/ListFeaturestoresResponse.php @@ -30,7 +30,7 @@ class ListFeaturestoresResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListHyperparameterTuningJobsRequest.php b/AiPlatform/src/V1/ListHyperparameterTuningJobsRequest.php index 8c26d71968aa..ca20c21b3f03 100644 --- a/AiPlatform/src/V1/ListHyperparameterTuningJobsRequest.php +++ b/AiPlatform/src/V1/ListHyperparameterTuningJobsRequest.php @@ -23,7 +23,7 @@ class ListHyperparameterTuningJobsRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * Supported fields: @@ -44,13 +44,13 @@ class ListHyperparameterTuningJobsRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -61,13 +61,13 @@ class ListHyperparameterTuningJobsRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location to list the diff --git a/AiPlatform/src/V1/ListHyperparameterTuningJobsResponse.php b/AiPlatform/src/V1/ListHyperparameterTuningJobsResponse.php index cfb6557de66a..6b92b4ba1304 100644 --- a/AiPlatform/src/V1/ListHyperparameterTuningJobsResponse.php +++ b/AiPlatform/src/V1/ListHyperparameterTuningJobsResponse.php @@ -32,7 +32,7 @@ class ListHyperparameterTuningJobsResponse extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListIndexEndpointsRequest.php b/AiPlatform/src/V1/ListIndexEndpointsRequest.php index cf1eba455f5d..996c71ecd40b 100644 --- a/AiPlatform/src/V1/ListIndexEndpointsRequest.php +++ b/AiPlatform/src/V1/ListIndexEndpointsRequest.php @@ -22,7 +22,7 @@ class ListIndexEndpointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. An expression for filtering the results of the request. For field * names both snake_case and camelCase are supported. @@ -43,13 +43,13 @@ class ListIndexEndpointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. The standard list page size. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. The standard list page token. * Typically obtained via @@ -60,13 +60,13 @@ class ListIndexEndpointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location from which to list the diff --git a/AiPlatform/src/V1/ListIndexEndpointsResponse.php b/AiPlatform/src/V1/ListIndexEndpointsResponse.php index 53f952a9278b..e768008ab1eb 100644 --- a/AiPlatform/src/V1/ListIndexEndpointsResponse.php +++ b/AiPlatform/src/V1/ListIndexEndpointsResponse.php @@ -30,7 +30,7 @@ class ListIndexEndpointsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListIndexesRequest.php b/AiPlatform/src/V1/ListIndexesRequest.php index 502ab973281e..cacf96ea07dc 100644 --- a/AiPlatform/src/V1/ListIndexesRequest.php +++ b/AiPlatform/src/V1/ListIndexesRequest.php @@ -22,19 +22,19 @@ class ListIndexesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -45,13 +45,13 @@ class ListIndexesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location from which to list the Indexes. diff --git a/AiPlatform/src/V1/ListIndexesResponse.php b/AiPlatform/src/V1/ListIndexesResponse.php index a50d32d58503..1df79240c8bd 100644 --- a/AiPlatform/src/V1/ListIndexesResponse.php +++ b/AiPlatform/src/V1/ListIndexesResponse.php @@ -30,7 +30,7 @@ class ListIndexesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListMetadataSchemasRequest.php b/AiPlatform/src/V1/ListMetadataSchemasRequest.php index b52a142d097d..f17a07957711 100644 --- a/AiPlatform/src/V1/ListMetadataSchemasRequest.php +++ b/AiPlatform/src/V1/ListMetadataSchemasRequest.php @@ -23,7 +23,7 @@ class ListMetadataSchemasRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of MetadataSchemas to return. The service may return * fewer. @@ -31,7 +31,7 @@ class ListMetadataSchemasRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas] @@ -42,13 +42,13 @@ class ListMetadataSchemasRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * A query to filter available MetadataSchemas for matching results. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The MetadataStore whose MetadataSchemas should be listed. diff --git a/AiPlatform/src/V1/ListMetadataSchemasResponse.php b/AiPlatform/src/V1/ListMetadataSchemasResponse.php index 3b5f9fd4898d..73ab44293ac0 100644 --- a/AiPlatform/src/V1/ListMetadataSchemasResponse.php +++ b/AiPlatform/src/V1/ListMetadataSchemasResponse.php @@ -30,7 +30,7 @@ class ListMetadataSchemasResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListMetadataStoresRequest.php b/AiPlatform/src/V1/ListMetadataStoresRequest.php index 6a234e584cfa..68fe668ba489 100644 --- a/AiPlatform/src/V1/ListMetadataStoresRequest.php +++ b/AiPlatform/src/V1/ListMetadataStoresRequest.php @@ -23,7 +23,7 @@ class ListMetadataStoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of Metadata Stores to return. The service may return * fewer. @@ -31,7 +31,7 @@ class ListMetadataStoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1.MetadataService.ListMetadataStores] @@ -42,7 +42,7 @@ class ListMetadataStoresRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The Location whose MetadataStores should be listed. diff --git a/AiPlatform/src/V1/ListMetadataStoresResponse.php b/AiPlatform/src/V1/ListMetadataStoresResponse.php index 4c5970bb11b6..b09999c6dfef 100644 --- a/AiPlatform/src/V1/ListMetadataStoresResponse.php +++ b/AiPlatform/src/V1/ListMetadataStoresResponse.php @@ -30,7 +30,7 @@ class ListMetadataStoresResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListModelDeploymentMonitoringJobsRequest.php b/AiPlatform/src/V1/ListModelDeploymentMonitoringJobsRequest.php index 45a984d9f7cc..dde5106d5eb3 100644 --- a/AiPlatform/src/V1/ListModelDeploymentMonitoringJobsRequest.php +++ b/AiPlatform/src/V1/ListModelDeploymentMonitoringJobsRequest.php @@ -22,7 +22,7 @@ class ListModelDeploymentMonitoringJobsRequest extends \Google\Protobuf\Internal * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * Supported fields: @@ -43,25 +43,25 @@ class ListModelDeploymentMonitoringJobsRequest extends \Google\Protobuf\Internal * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The parent of the ModelDeploymentMonitoringJob. diff --git a/AiPlatform/src/V1/ListModelDeploymentMonitoringJobsResponse.php b/AiPlatform/src/V1/ListModelDeploymentMonitoringJobsResponse.php index a6d29db4ae39..ebafb6d833cb 100644 --- a/AiPlatform/src/V1/ListModelDeploymentMonitoringJobsResponse.php +++ b/AiPlatform/src/V1/ListModelDeploymentMonitoringJobsResponse.php @@ -28,7 +28,7 @@ class ListModelDeploymentMonitoringJobsResponse extends \Google\Protobuf\Interna * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListModelEvaluationSlicesRequest.php b/AiPlatform/src/V1/ListModelEvaluationSlicesRequest.php index 9132e16f26b7..9d4076a63722 100644 --- a/AiPlatform/src/V1/ListModelEvaluationSlicesRequest.php +++ b/AiPlatform/src/V1/ListModelEvaluationSlicesRequest.php @@ -23,20 +23,20 @@ class ListModelEvaluationSlicesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * * `slice.dimension` - for =. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -47,13 +47,13 @@ class ListModelEvaluationSlicesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the ModelEvaluation to list the diff --git a/AiPlatform/src/V1/ListModelEvaluationSlicesResponse.php b/AiPlatform/src/V1/ListModelEvaluationSlicesResponse.php index 648d860ed1d0..8c6b0e67d4ce 100644 --- a/AiPlatform/src/V1/ListModelEvaluationSlicesResponse.php +++ b/AiPlatform/src/V1/ListModelEvaluationSlicesResponse.php @@ -30,7 +30,7 @@ class ListModelEvaluationSlicesResponse extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListModelEvaluationsRequest.php b/AiPlatform/src/V1/ListModelEvaluationsRequest.php index 487e56396ecc..03c93bbc4880 100644 --- a/AiPlatform/src/V1/ListModelEvaluationsRequest.php +++ b/AiPlatform/src/V1/ListModelEvaluationsRequest.php @@ -22,19 +22,19 @@ class ListModelEvaluationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -45,13 +45,13 @@ class ListModelEvaluationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Model to list the ModelEvaluations from. diff --git a/AiPlatform/src/V1/ListModelEvaluationsResponse.php b/AiPlatform/src/V1/ListModelEvaluationsResponse.php index f6ebe4ed5abf..f56b070f94aa 100644 --- a/AiPlatform/src/V1/ListModelEvaluationsResponse.php +++ b/AiPlatform/src/V1/ListModelEvaluationsResponse.php @@ -30,7 +30,7 @@ class ListModelEvaluationsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListModelVersionsRequest.php b/AiPlatform/src/V1/ListModelVersionsRequest.php index 995dfdfd8f6f..f771c48fb9b8 100644 --- a/AiPlatform/src/V1/ListModelVersionsRequest.php +++ b/AiPlatform/src/V1/ListModelVersionsRequest.php @@ -21,13 +21,13 @@ class ListModelVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -38,7 +38,7 @@ class ListModelVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * An expression for filtering the results of the request. For field names * both snake_case and camelCase are supported. @@ -51,13 +51,13 @@ class ListModelVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -68,7 +68,7 @@ class ListModelVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 6; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $name Required. The name of the model to list versions for. Please see diff --git a/AiPlatform/src/V1/ListModelVersionsResponse.php b/AiPlatform/src/V1/ListModelVersionsResponse.php index ac0f260796eb..d6b44c564956 100644 --- a/AiPlatform/src/V1/ListModelVersionsResponse.php +++ b/AiPlatform/src/V1/ListModelVersionsResponse.php @@ -32,7 +32,7 @@ class ListModelVersionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListModelsRequest.php b/AiPlatform/src/V1/ListModelsRequest.php index eda98cea6f37..7e344117f587 100644 --- a/AiPlatform/src/V1/ListModelsRequest.php +++ b/AiPlatform/src/V1/ListModelsRequest.php @@ -22,7 +22,7 @@ class ListModelsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * An expression for filtering the results of the request. For field names * both snake_case and camelCase are supported. @@ -43,13 +43,13 @@ class ListModelsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -60,13 +60,13 @@ class ListModelsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -78,7 +78,7 @@ class ListModelsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 6; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Location to list the Models from. diff --git a/AiPlatform/src/V1/ListModelsResponse.php b/AiPlatform/src/V1/ListModelsResponse.php index b9d9eb21a4d3..720b6b2f9626 100644 --- a/AiPlatform/src/V1/ListModelsResponse.php +++ b/AiPlatform/src/V1/ListModelsResponse.php @@ -30,7 +30,7 @@ class ListModelsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListNasJobsRequest.php b/AiPlatform/src/V1/ListNasJobsRequest.php index 0d57730bd7c3..fdd689688f57 100644 --- a/AiPlatform/src/V1/ListNasJobsRequest.php +++ b/AiPlatform/src/V1/ListNasJobsRequest.php @@ -22,7 +22,7 @@ class ListNasJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * Supported fields: @@ -43,13 +43,13 @@ class ListNasJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -60,13 +60,13 @@ class ListNasJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location to list the NasJobs diff --git a/AiPlatform/src/V1/ListNasJobsResponse.php b/AiPlatform/src/V1/ListNasJobsResponse.php index c6316c1a0e1e..ab265d630589 100644 --- a/AiPlatform/src/V1/ListNasJobsResponse.php +++ b/AiPlatform/src/V1/ListNasJobsResponse.php @@ -32,7 +32,7 @@ class ListNasJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListNasTrialDetailsRequest.php b/AiPlatform/src/V1/ListNasTrialDetailsRequest.php index e9842485c457..9c359b2da77a 100644 --- a/AiPlatform/src/V1/ListNasTrialDetailsRequest.php +++ b/AiPlatform/src/V1/ListNasTrialDetailsRequest.php @@ -23,13 +23,13 @@ class ListNasTrialDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -40,7 +40,7 @@ class ListNasTrialDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the NasJob resource. diff --git a/AiPlatform/src/V1/ListNasTrialDetailsResponse.php b/AiPlatform/src/V1/ListNasTrialDetailsResponse.php index 2d68f0675cf4..294a226ce5b4 100644 --- a/AiPlatform/src/V1/ListNasTrialDetailsResponse.php +++ b/AiPlatform/src/V1/ListNasTrialDetailsResponse.php @@ -30,7 +30,7 @@ class ListNasTrialDetailsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListNotebookRuntimeTemplatesRequest.php b/AiPlatform/src/V1/ListNotebookRuntimeTemplatesRequest.php index 7dda8027159c..f5275941d411 100644 --- a/AiPlatform/src/V1/ListNotebookRuntimeTemplatesRequest.php +++ b/AiPlatform/src/V1/ListNotebookRuntimeTemplatesRequest.php @@ -23,7 +23,7 @@ class ListNotebookRuntimeTemplatesRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. An expression for filtering the results of the request. For field * names both snake_case and camelCase are supported. @@ -46,13 +46,13 @@ class ListNotebookRuntimeTemplatesRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. The standard list page size. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. The standard list page token. * Typically obtained via @@ -63,13 +63,13 @@ class ListNotebookRuntimeTemplatesRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $read_mask = null; + protected $read_mask = null; /** * Optional. A comma-separated list of fields to order by, sorted in ascending * order. Use "desc" after a field name for descending. Supported fields: @@ -80,7 +80,7 @@ class ListNotebookRuntimeTemplatesRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Location from which to list the diff --git a/AiPlatform/src/V1/ListNotebookRuntimeTemplatesResponse.php b/AiPlatform/src/V1/ListNotebookRuntimeTemplatesResponse.php index f690b85986d4..f30439af2e68 100644 --- a/AiPlatform/src/V1/ListNotebookRuntimeTemplatesResponse.php +++ b/AiPlatform/src/V1/ListNotebookRuntimeTemplatesResponse.php @@ -30,7 +30,7 @@ class ListNotebookRuntimeTemplatesResponse extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListNotebookRuntimesRequest.php b/AiPlatform/src/V1/ListNotebookRuntimesRequest.php index 29adfbe0d756..cec4e1b4e2f4 100644 --- a/AiPlatform/src/V1/ListNotebookRuntimesRequest.php +++ b/AiPlatform/src/V1/ListNotebookRuntimesRequest.php @@ -23,7 +23,7 @@ class ListNotebookRuntimesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. An expression for filtering the results of the request. For field * names both snake_case and camelCase are supported. @@ -60,13 +60,13 @@ class ListNotebookRuntimesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. The standard list page size. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. The standard list page token. * Typically obtained via @@ -77,13 +77,13 @@ class ListNotebookRuntimesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $read_mask = null; + protected $read_mask = null; /** * Optional. A comma-separated list of fields to order by, sorted in ascending * order. Use "desc" after a field name for descending. Supported fields: @@ -94,7 +94,7 @@ class ListNotebookRuntimesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Location from which to list the diff --git a/AiPlatform/src/V1/ListNotebookRuntimesResponse.php b/AiPlatform/src/V1/ListNotebookRuntimesResponse.php index d7440957ada5..13758707a766 100644 --- a/AiPlatform/src/V1/ListNotebookRuntimesResponse.php +++ b/AiPlatform/src/V1/ListNotebookRuntimesResponse.php @@ -30,7 +30,7 @@ class ListNotebookRuntimesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListOptimalTrialsRequest.php b/AiPlatform/src/V1/ListOptimalTrialsRequest.php index 8b1d1e002357..683501228c3c 100644 --- a/AiPlatform/src/V1/ListOptimalTrialsRequest.php +++ b/AiPlatform/src/V1/ListOptimalTrialsRequest.php @@ -21,7 +21,7 @@ class ListOptimalTrialsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * @param string $parent Required. The name of the Study that the optimal Trial belongs to. Please see diff --git a/AiPlatform/src/V1/ListPersistentResourcesRequest.php b/AiPlatform/src/V1/ListPersistentResourcesRequest.php index 90207195fb28..81721df1e016 100644 --- a/AiPlatform/src/V1/ListPersistentResourcesRequest.php +++ b/AiPlatform/src/V1/ListPersistentResourcesRequest.php @@ -21,13 +21,13 @@ class ListPersistentResourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The standard list page size. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. The standard list page token. * Typically obtained via @@ -36,7 +36,7 @@ class ListPersistentResourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The resource name of the Location to list the PersistentResources diff --git a/AiPlatform/src/V1/ListPersistentResourcesResponse.php b/AiPlatform/src/V1/ListPersistentResourcesResponse.php index 35b1dab685ff..c508d30e47ea 100644 --- a/AiPlatform/src/V1/ListPersistentResourcesResponse.php +++ b/AiPlatform/src/V1/ListPersistentResourcesResponse.php @@ -28,7 +28,7 @@ class ListPersistentResourcesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListPipelineJobsRequest.php b/AiPlatform/src/V1/ListPipelineJobsRequest.php index 39b8dd70bc2c..3e89144669e2 100644 --- a/AiPlatform/src/V1/ListPipelineJobsRequest.php +++ b/AiPlatform/src/V1/ListPipelineJobsRequest.php @@ -22,7 +22,7 @@ class ListPipelineJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the PipelineJobs that match the filter expression. The following * fields are supported: @@ -56,13 +56,13 @@ class ListPipelineJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -73,7 +73,7 @@ class ListPipelineJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * A comma-separated list of fields to order by. The default sort order is in * ascending order. Use "desc" after a field name for descending. You can have @@ -90,13 +90,13 @@ class ListPipelineJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 6; */ - private $order_by = ''; + protected $order_by = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 7; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location to list the PipelineJobs from. diff --git a/AiPlatform/src/V1/ListPipelineJobsResponse.php b/AiPlatform/src/V1/ListPipelineJobsResponse.php index 5e70b733b505..dd913a53fe77 100644 --- a/AiPlatform/src/V1/ListPipelineJobsResponse.php +++ b/AiPlatform/src/V1/ListPipelineJobsResponse.php @@ -30,7 +30,7 @@ class ListPipelineJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListSavedQueriesRequest.php b/AiPlatform/src/V1/ListSavedQueriesRequest.php index 93e387355e56..2466bccc9070 100644 --- a/AiPlatform/src/V1/ListSavedQueriesRequest.php +++ b/AiPlatform/src/V1/ListSavedQueriesRequest.php @@ -23,38 +23,38 @@ class ListSavedQueriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. * * Generated from protobuf field string order_by = 6; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Dataset to list SavedQueries from. diff --git a/AiPlatform/src/V1/ListSavedQueriesResponse.php b/AiPlatform/src/V1/ListSavedQueriesResponse.php index a36af19de02a..9b393cf9a39f 100644 --- a/AiPlatform/src/V1/ListSavedQueriesResponse.php +++ b/AiPlatform/src/V1/ListSavedQueriesResponse.php @@ -27,7 +27,7 @@ class ListSavedQueriesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListSchedulesRequest.php b/AiPlatform/src/V1/ListSchedulesRequest.php index 66fd32e24491..513918f86a85 100644 --- a/AiPlatform/src/V1/ListSchedulesRequest.php +++ b/AiPlatform/src/V1/ListSchedulesRequest.php @@ -22,7 +22,7 @@ class ListSchedulesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the Schedules that match the filter expression. The following * fields are supported: @@ -52,14 +52,14 @@ class ListSchedulesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * Default to 100 if not specified. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -70,7 +70,7 @@ class ListSchedulesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * A comma-separated list of fields to order by. The default sort order is in * ascending order. Use "desc" after a field name for descending. You can have @@ -88,7 +88,7 @@ class ListSchedulesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Location to list the Schedules from. diff --git a/AiPlatform/src/V1/ListSchedulesResponse.php b/AiPlatform/src/V1/ListSchedulesResponse.php index d47a02d34a17..92f4aa408413 100644 --- a/AiPlatform/src/V1/ListSchedulesResponse.php +++ b/AiPlatform/src/V1/ListSchedulesResponse.php @@ -30,7 +30,7 @@ class ListSchedulesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListSpecialistPoolsRequest.php b/AiPlatform/src/V1/ListSpecialistPoolsRequest.php index 788216ed3fda..b9a7dbc4dd59 100644 --- a/AiPlatform/src/V1/ListSpecialistPoolsRequest.php +++ b/AiPlatform/src/V1/ListSpecialistPoolsRequest.php @@ -22,13 +22,13 @@ class ListSpecialistPoolsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained by @@ -39,13 +39,13 @@ class ListSpecialistPoolsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. FieldMask represents a set of * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 4; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The name of the SpecialistPool's parent resource. diff --git a/AiPlatform/src/V1/ListSpecialistPoolsResponse.php b/AiPlatform/src/V1/ListSpecialistPoolsResponse.php index 683aa7a69cbc..760707850d16 100644 --- a/AiPlatform/src/V1/ListSpecialistPoolsResponse.php +++ b/AiPlatform/src/V1/ListSpecialistPoolsResponse.php @@ -27,7 +27,7 @@ class ListSpecialistPoolsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListStudiesRequest.php b/AiPlatform/src/V1/ListStudiesRequest.php index e43ca560c6b7..9fb3f5c87f7b 100644 --- a/AiPlatform/src/V1/ListStudiesRequest.php +++ b/AiPlatform/src/V1/ListStudiesRequest.php @@ -22,21 +22,21 @@ class ListStudiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. A page token to request the next page of results. * If unspecified, there are no subsequent pages. * * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The maximum number of studies to return per "page" of results. * If unspecified, service will pick an appropriate default. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * @param string $parent Required. The resource name of the Location to list the Study from. diff --git a/AiPlatform/src/V1/ListStudiesResponse.php b/AiPlatform/src/V1/ListStudiesResponse.php index c9762fbdf211..69ab58d22e25 100644 --- a/AiPlatform/src/V1/ListStudiesResponse.php +++ b/AiPlatform/src/V1/ListStudiesResponse.php @@ -29,7 +29,7 @@ class ListStudiesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListTensorboardExperimentsRequest.php b/AiPlatform/src/V1/ListTensorboardExperimentsRequest.php index e92ef63d0e6c..362b3155ce78 100644 --- a/AiPlatform/src/V1/ListTensorboardExperimentsRequest.php +++ b/AiPlatform/src/V1/ListTensorboardExperimentsRequest.php @@ -23,13 +23,13 @@ class ListTensorboardExperimentsRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the TensorboardExperiments that match the filter expression. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of TensorboardExperiments to return. The service may * return fewer than this value. If unspecified, at most 50 @@ -38,7 +38,7 @@ class ListTensorboardExperimentsRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments] @@ -49,19 +49,19 @@ class ListTensorboardExperimentsRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Field to use to sort the list. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 6; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Tensorboard to list diff --git a/AiPlatform/src/V1/ListTensorboardExperimentsResponse.php b/AiPlatform/src/V1/ListTensorboardExperimentsResponse.php index 6033b60bf2cb..8b8efb44e061 100644 --- a/AiPlatform/src/V1/ListTensorboardExperimentsResponse.php +++ b/AiPlatform/src/V1/ListTensorboardExperimentsResponse.php @@ -30,7 +30,7 @@ class ListTensorboardExperimentsResponse extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListTensorboardRunsRequest.php b/AiPlatform/src/V1/ListTensorboardRunsRequest.php index 181d89d0d589..1b7286246405 100644 --- a/AiPlatform/src/V1/ListTensorboardRunsRequest.php +++ b/AiPlatform/src/V1/ListTensorboardRunsRequest.php @@ -23,13 +23,13 @@ class ListTensorboardRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the TensorboardRuns that match the filter expression. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of TensorboardRuns to return. The service may return * fewer than this value. If unspecified, at most 50 TensorboardRuns are @@ -38,7 +38,7 @@ class ListTensorboardRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns] @@ -49,19 +49,19 @@ class ListTensorboardRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Field to use to sort the list. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 6; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the TensorboardExperiment to list diff --git a/AiPlatform/src/V1/ListTensorboardRunsResponse.php b/AiPlatform/src/V1/ListTensorboardRunsResponse.php index 7ab5a36d3cff..4632baab236f 100644 --- a/AiPlatform/src/V1/ListTensorboardRunsResponse.php +++ b/AiPlatform/src/V1/ListTensorboardRunsResponse.php @@ -30,7 +30,7 @@ class ListTensorboardRunsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListTensorboardTimeSeriesRequest.php b/AiPlatform/src/V1/ListTensorboardTimeSeriesRequest.php index 79e9273686f1..583acad13957 100644 --- a/AiPlatform/src/V1/ListTensorboardTimeSeriesRequest.php +++ b/AiPlatform/src/V1/ListTensorboardTimeSeriesRequest.php @@ -23,13 +23,13 @@ class ListTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the TensorboardTimeSeries that match the filter expression. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of TensorboardTimeSeries to return. The service may * return fewer than this value. If unspecified, at most 50 @@ -38,7 +38,7 @@ class ListTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries] @@ -49,19 +49,19 @@ class ListTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Field to use to sort the list. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 6; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the TensorboardRun to list diff --git a/AiPlatform/src/V1/ListTensorboardTimeSeriesResponse.php b/AiPlatform/src/V1/ListTensorboardTimeSeriesResponse.php index b21be2e9d927..bdd00e2e1f1f 100644 --- a/AiPlatform/src/V1/ListTensorboardTimeSeriesResponse.php +++ b/AiPlatform/src/V1/ListTensorboardTimeSeriesResponse.php @@ -30,7 +30,7 @@ class ListTensorboardTimeSeriesResponse extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListTensorboardsRequest.php b/AiPlatform/src/V1/ListTensorboardsRequest.php index 8c06eaffe85f..4fc3b36ddff0 100644 --- a/AiPlatform/src/V1/ListTensorboardsRequest.php +++ b/AiPlatform/src/V1/ListTensorboardsRequest.php @@ -23,13 +23,13 @@ class ListTensorboardsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Lists the Tensorboards that match the filter expression. * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of Tensorboards to return. The service may return * fewer than this value. If unspecified, at most 100 Tensorboards are @@ -38,7 +38,7 @@ class ListTensorboardsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1.TensorboardService.ListTensorboards] @@ -49,19 +49,19 @@ class ListTensorboardsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Field to use to sort the list. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 6; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location to list Tensorboards. diff --git a/AiPlatform/src/V1/ListTensorboardsResponse.php b/AiPlatform/src/V1/ListTensorboardsResponse.php index 0ccdc9b2517f..f60548d491aa 100644 --- a/AiPlatform/src/V1/ListTensorboardsResponse.php +++ b/AiPlatform/src/V1/ListTensorboardsResponse.php @@ -30,7 +30,7 @@ class ListTensorboardsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListTrainingPipelinesRequest.php b/AiPlatform/src/V1/ListTrainingPipelinesRequest.php index 6210554f9b8a..3ab5fd706618 100644 --- a/AiPlatform/src/V1/ListTrainingPipelinesRequest.php +++ b/AiPlatform/src/V1/ListTrainingPipelinesRequest.php @@ -22,7 +22,7 @@ class ListTrainingPipelinesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard list filter. * Supported fields: @@ -43,13 +43,13 @@ class ListTrainingPipelinesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * Typically obtained via @@ -60,13 +60,13 @@ class ListTrainingPipelinesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * Mask specifying which fields to read. * * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5; */ - private $read_mask = null; + protected $read_mask = null; /** * @param string $parent Required. The resource name of the Location to list the TrainingPipelines diff --git a/AiPlatform/src/V1/ListTrainingPipelinesResponse.php b/AiPlatform/src/V1/ListTrainingPipelinesResponse.php index 78942cd92d36..8839755a808e 100644 --- a/AiPlatform/src/V1/ListTrainingPipelinesResponse.php +++ b/AiPlatform/src/V1/ListTrainingPipelinesResponse.php @@ -30,7 +30,7 @@ class ListTrainingPipelinesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListTrialsRequest.php b/AiPlatform/src/V1/ListTrialsRequest.php index a9e6580bea97..991d2b46e8b7 100644 --- a/AiPlatform/src/V1/ListTrialsRequest.php +++ b/AiPlatform/src/V1/ListTrialsRequest.php @@ -22,21 +22,21 @@ class ListTrialsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. A page token to request the next page of results. * If unspecified, there are no subsequent pages. * * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The number of Trials to retrieve per "page" of results. * If unspecified, the service will pick an appropriate default. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * @param string $parent Required. The resource name of the Study to list the Trial from. diff --git a/AiPlatform/src/V1/ListTrialsResponse.php b/AiPlatform/src/V1/ListTrialsResponse.php index 0670f300aeb8..b76287203d6e 100644 --- a/AiPlatform/src/V1/ListTrialsResponse.php +++ b/AiPlatform/src/V1/ListTrialsResponse.php @@ -29,7 +29,7 @@ class ListTrialsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ListTuningJobsRequest.php b/AiPlatform/src/V1/ListTuningJobsRequest.php index b1ae009ec515..b7be67692e82 100644 --- a/AiPlatform/src/V1/ListTuningJobsRequest.php +++ b/AiPlatform/src/V1/ListTuningJobsRequest.php @@ -22,19 +22,19 @@ class ListTuningJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The standard list filter. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. The standard list page size. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. The standard list page token. * Typically obtained via [ListTuningJob.next_page_token][] of the @@ -42,7 +42,7 @@ class ListTuningJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The resource name of the Location to list the TuningJobs from. diff --git a/AiPlatform/src/V1/ListTuningJobsResponse.php b/AiPlatform/src/V1/ListTuningJobsResponse.php index 2b72e8152c82..16c563e41ff9 100644 --- a/AiPlatform/src/V1/ListTuningJobsResponse.php +++ b/AiPlatform/src/V1/ListTuningJobsResponse.php @@ -30,7 +30,7 @@ class ListTuningJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/LlmUtilityServiceClient.php b/AiPlatform/src/V1/LlmUtilityServiceClient.php deleted file mode 100644 index 74e1a76a7384..000000000000 --- a/AiPlatform/src/V1/LlmUtilityServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The user-defined display name of the Study * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * @param string $parent Required. The resource name of the Location to get the Study from. diff --git a/AiPlatform/src/V1/MachineSpec.php b/AiPlatform/src/V1/MachineSpec.php index 33dfcf5267e6..f6b9d1df94ae 100644 --- a/AiPlatform/src/V1/MachineSpec.php +++ b/AiPlatform/src/V1/MachineSpec.php @@ -29,7 +29,7 @@ class MachineSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $machine_type = ''; + protected $machine_type = ''; /** * Immutable. The type of accelerator(s) that may be attached to the machine * as per @@ -37,20 +37,20 @@ class MachineSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $accelerator_type = 0; + protected $accelerator_type = 0; /** * The number of accelerators to attach to the machine. * * Generated from protobuf field int32 accelerator_count = 3; */ - private $accelerator_count = 0; + protected $accelerator_count = 0; /** * Immutable. The topology of the TPUs. Corresponds to the TPU topologies * available from GKE. (Example: tpu_topology: "2x2x1"). * * Generated from protobuf field string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $tpu_topology = ''; + protected $tpu_topology = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ManualBatchTuningParameters.php b/AiPlatform/src/V1/ManualBatchTuningParameters.php index 6e2a93062025..ff19c6170d1e 100644 --- a/AiPlatform/src/V1/ManualBatchTuningParameters.php +++ b/AiPlatform/src/V1/ManualBatchTuningParameters.php @@ -26,7 +26,7 @@ class ManualBatchTuningParameters extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 batch_size = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $batch_size = 0; + protected $batch_size = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/MatchServiceClient.php b/AiPlatform/src/V1/MatchServiceClient.php deleted file mode 100644 index 4992569bddf6..000000000000 --- a/AiPlatform/src/V1/MatchServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.MatchService/FindNeighbors', - $argument, - ['\Google\Cloud\AIPlatform\V1\FindNeighborsResponse', 'decode'], - $metadata, $options); - } - - /** - * Reads the datapoints/vectors of the given IDs. - * A maximum of 1000 datapoints can be retrieved in a batch. - * @param \Google\Cloud\AIPlatform\V1\ReadIndexDatapointsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ReadIndexDatapoints(\Google\Cloud\AIPlatform\V1\ReadIndexDatapointsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MatchService/ReadIndexDatapoints', - $argument, - ['\Google\Cloud\AIPlatform\V1\ReadIndexDatapointsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/Measurement.php b/AiPlatform/src/V1/Measurement.php index 9f4ba27eeb49..93c78064b37e 100644 --- a/AiPlatform/src/V1/Measurement.php +++ b/AiPlatform/src/V1/Measurement.php @@ -23,14 +23,14 @@ class Measurement extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration elapsed_duration = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $elapsed_duration = null; + protected $elapsed_duration = null; /** * Output only. The number of steps the machine learning model has been * trained for. Must be non-negative. * * Generated from protobuf field int64 step_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $step_count = 0; + protected $step_count = 0; /** * Output only. A list of metrics got by evaluating the objective functions * using suggested Parameter values. diff --git a/AiPlatform/src/V1/Measurement/Metric.php b/AiPlatform/src/V1/Measurement/Metric.php index 0f2ed00b08f0..1c84661e385d 100644 --- a/AiPlatform/src/V1/Measurement/Metric.php +++ b/AiPlatform/src/V1/Measurement/Metric.php @@ -21,13 +21,13 @@ class Metric extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metric_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metric_id = ''; + protected $metric_id = ''; /** * Output only. The value for this metric. * * Generated from protobuf field double value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $value = 0.0; + protected $value = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/MergeVersionAliasesRequest.php b/AiPlatform/src/V1/MergeVersionAliasesRequest.php index 2648cd15baaf..958d603a1200 100644 --- a/AiPlatform/src/V1/MergeVersionAliasesRequest.php +++ b/AiPlatform/src/V1/MergeVersionAliasesRequest.php @@ -23,7 +23,7 @@ class MergeVersionAliasesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The set of version aliases to merge. * The alias should be at most 128 characters, and match diff --git a/AiPlatform/src/V1/MetadataSchema.php b/AiPlatform/src/V1/MetadataSchema.php index 1b7f49004273..41c39f06ce23 100644 --- a/AiPlatform/src/V1/MetadataSchema.php +++ b/AiPlatform/src/V1/MetadataSchema.php @@ -20,7 +20,7 @@ class MetadataSchema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * The version of the MetadataSchema. The version's format must match * the following regular expression: `^[0-9]+[.][0-9]+[.][0-9]+$`, which would @@ -28,7 +28,7 @@ class MetadataSchema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema_version = 2; */ - private $schema_version = ''; + protected $schema_version = ''; /** * Required. The raw YAML string representation of the MetadataSchema. The * combination of [MetadataSchema.version] and the schema name given by @@ -39,26 +39,26 @@ class MetadataSchema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $schema = ''; + protected $schema = ''; /** * The type of the MetadataSchema. This is a property that identifies which * metadata types will use the MetadataSchema. * * Generated from protobuf field .google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType schema_type = 4; */ - private $schema_type = 0; + protected $schema_type = 0; /** * Output only. Timestamp when this MetadataSchema was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Description of the Metadata Schema * * Generated from protobuf field string description = 6; */ - private $description = ''; + protected $description = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MetadataServiceClient.php b/AiPlatform/src/V1/MetadataServiceClient.php deleted file mode 100644 index 8d324f0f5ca3..000000000000 --- a/AiPlatform/src/V1/MetadataServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/CreateMetadataStore', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a specific MetadataStore. - * @param \Google\Cloud\AIPlatform\V1\GetMetadataStoreRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMetadataStore(\Google\Cloud\AIPlatform\V1\GetMetadataStoreRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/GetMetadataStore', - $argument, - ['\Google\Cloud\AIPlatform\V1\MetadataStore', 'decode'], - $metadata, $options); - } - - /** - * Lists MetadataStores for a Location. - * @param \Google\Cloud\AIPlatform\V1\ListMetadataStoresRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMetadataStores(\Google\Cloud\AIPlatform\V1\ListMetadataStoresRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/ListMetadataStores', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListMetadataStoresResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single MetadataStore and all its child resources (Artifacts, - * Executions, and Contexts). - * @param \Google\Cloud\AIPlatform\V1\DeleteMetadataStoreRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteMetadataStore(\Google\Cloud\AIPlatform\V1\DeleteMetadataStoreRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/DeleteMetadataStore', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates an Artifact associated with a MetadataStore. - * @param \Google\Cloud\AIPlatform\V1\CreateArtifactRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateArtifact(\Google\Cloud\AIPlatform\V1\CreateArtifactRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/CreateArtifact', - $argument, - ['\Google\Cloud\AIPlatform\V1\Artifact', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a specific Artifact. - * @param \Google\Cloud\AIPlatform\V1\GetArtifactRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetArtifact(\Google\Cloud\AIPlatform\V1\GetArtifactRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/GetArtifact', - $argument, - ['\Google\Cloud\AIPlatform\V1\Artifact', 'decode'], - $metadata, $options); - } - - /** - * Lists Artifacts in the MetadataStore. - * @param \Google\Cloud\AIPlatform\V1\ListArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListArtifacts(\Google\Cloud\AIPlatform\V1\ListArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/ListArtifacts', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListArtifactsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a stored Artifact. - * @param \Google\Cloud\AIPlatform\V1\UpdateArtifactRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateArtifact(\Google\Cloud\AIPlatform\V1\UpdateArtifactRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/UpdateArtifact', - $argument, - ['\Google\Cloud\AIPlatform\V1\Artifact', 'decode'], - $metadata, $options); - } - - /** - * Deletes an Artifact. - * @param \Google\Cloud\AIPlatform\V1\DeleteArtifactRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteArtifact(\Google\Cloud\AIPlatform\V1\DeleteArtifactRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/DeleteArtifact', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Purges Artifacts. - * @param \Google\Cloud\AIPlatform\V1\PurgeArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PurgeArtifacts(\Google\Cloud\AIPlatform\V1\PurgeArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/PurgeArtifacts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a Context associated with a MetadataStore. - * @param \Google\Cloud\AIPlatform\V1\CreateContextRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateContext(\Google\Cloud\AIPlatform\V1\CreateContextRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/CreateContext', - $argument, - ['\Google\Cloud\AIPlatform\V1\Context', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a specific Context. - * @param \Google\Cloud\AIPlatform\V1\GetContextRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetContext(\Google\Cloud\AIPlatform\V1\GetContextRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/GetContext', - $argument, - ['\Google\Cloud\AIPlatform\V1\Context', 'decode'], - $metadata, $options); - } - - /** - * Lists Contexts on the MetadataStore. - * @param \Google\Cloud\AIPlatform\V1\ListContextsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListContexts(\Google\Cloud\AIPlatform\V1\ListContextsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/ListContexts', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListContextsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a stored Context. - * @param \Google\Cloud\AIPlatform\V1\UpdateContextRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateContext(\Google\Cloud\AIPlatform\V1\UpdateContextRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/UpdateContext', - $argument, - ['\Google\Cloud\AIPlatform\V1\Context', 'decode'], - $metadata, $options); - } - - /** - * Deletes a stored Context. - * @param \Google\Cloud\AIPlatform\V1\DeleteContextRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteContext(\Google\Cloud\AIPlatform\V1\DeleteContextRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/DeleteContext', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Purges Contexts. - * @param \Google\Cloud\AIPlatform\V1\PurgeContextsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PurgeContexts(\Google\Cloud\AIPlatform\V1\PurgeContextsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/PurgeContexts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Adds a set of Artifacts and Executions to a Context. If any of the - * Artifacts or Executions have already been added to a Context, they are - * simply skipped. - * @param \Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AddContextArtifactsAndExecutions(\Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/AddContextArtifactsAndExecutions', - $argument, - ['\Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Adds a set of Contexts as children to a parent Context. If any of the - * child Contexts have already been added to the parent Context, they are - * simply skipped. If this call would create a cycle or cause any Context to - * have more than 10 parents, the request will fail with an INVALID_ARGUMENT - * error. - * @param \Google\Cloud\AIPlatform\V1\AddContextChildrenRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AddContextChildren(\Google\Cloud\AIPlatform\V1\AddContextChildrenRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/AddContextChildren', - $argument, - ['\Google\Cloud\AIPlatform\V1\AddContextChildrenResponse', 'decode'], - $metadata, $options); - } - - /** - * Remove a set of children contexts from a parent Context. If any of the - * child Contexts were NOT added to the parent Context, they are - * simply skipped. - * @param \Google\Cloud\AIPlatform\V1\RemoveContextChildrenRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RemoveContextChildren(\Google\Cloud\AIPlatform\V1\RemoveContextChildrenRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/RemoveContextChildren', - $argument, - ['\Google\Cloud\AIPlatform\V1\RemoveContextChildrenResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves Artifacts and Executions within the specified Context, connected - * by Event edges and returned as a LineageSubgraph. - * @param \Google\Cloud\AIPlatform\V1\QueryContextLineageSubgraphRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function QueryContextLineageSubgraph(\Google\Cloud\AIPlatform\V1\QueryContextLineageSubgraphRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/QueryContextLineageSubgraph', - $argument, - ['\Google\Cloud\AIPlatform\V1\LineageSubgraph', 'decode'], - $metadata, $options); - } - - /** - * Creates an Execution associated with a MetadataStore. - * @param \Google\Cloud\AIPlatform\V1\CreateExecutionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateExecution(\Google\Cloud\AIPlatform\V1\CreateExecutionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/CreateExecution', - $argument, - ['\Google\Cloud\AIPlatform\V1\Execution', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a specific Execution. - * @param \Google\Cloud\AIPlatform\V1\GetExecutionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetExecution(\Google\Cloud\AIPlatform\V1\GetExecutionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/GetExecution', - $argument, - ['\Google\Cloud\AIPlatform\V1\Execution', 'decode'], - $metadata, $options); - } - - /** - * Lists Executions in the MetadataStore. - * @param \Google\Cloud\AIPlatform\V1\ListExecutionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListExecutions(\Google\Cloud\AIPlatform\V1\ListExecutionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/ListExecutions', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListExecutionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a stored Execution. - * @param \Google\Cloud\AIPlatform\V1\UpdateExecutionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateExecution(\Google\Cloud\AIPlatform\V1\UpdateExecutionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/UpdateExecution', - $argument, - ['\Google\Cloud\AIPlatform\V1\Execution', 'decode'], - $metadata, $options); - } - - /** - * Deletes an Execution. - * @param \Google\Cloud\AIPlatform\V1\DeleteExecutionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteExecution(\Google\Cloud\AIPlatform\V1\DeleteExecutionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/DeleteExecution', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Purges Executions. - * @param \Google\Cloud\AIPlatform\V1\PurgeExecutionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PurgeExecutions(\Google\Cloud\AIPlatform\V1\PurgeExecutionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/PurgeExecutions', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Adds Events to the specified Execution. An Event indicates whether an - * Artifact was used as an input or output for an Execution. If an Event - * already exists between the Execution and the Artifact, the Event is - * skipped. - * @param \Google\Cloud\AIPlatform\V1\AddExecutionEventsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AddExecutionEvents(\Google\Cloud\AIPlatform\V1\AddExecutionEventsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/AddExecutionEvents', - $argument, - ['\Google\Cloud\AIPlatform\V1\AddExecutionEventsResponse', 'decode'], - $metadata, $options); - } - - /** - * Obtains the set of input and output Artifacts for this Execution, in the - * form of LineageSubgraph that also contains the Execution and connecting - * Events. - * @param \Google\Cloud\AIPlatform\V1\QueryExecutionInputsAndOutputsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function QueryExecutionInputsAndOutputs(\Google\Cloud\AIPlatform\V1\QueryExecutionInputsAndOutputsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/QueryExecutionInputsAndOutputs', - $argument, - ['\Google\Cloud\AIPlatform\V1\LineageSubgraph', 'decode'], - $metadata, $options); - } - - /** - * Creates a MetadataSchema. - * @param \Google\Cloud\AIPlatform\V1\CreateMetadataSchemaRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateMetadataSchema(\Google\Cloud\AIPlatform\V1\CreateMetadataSchemaRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/CreateMetadataSchema', - $argument, - ['\Google\Cloud\AIPlatform\V1\MetadataSchema', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a specific MetadataSchema. - * @param \Google\Cloud\AIPlatform\V1\GetMetadataSchemaRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMetadataSchema(\Google\Cloud\AIPlatform\V1\GetMetadataSchemaRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/GetMetadataSchema', - $argument, - ['\Google\Cloud\AIPlatform\V1\MetadataSchema', 'decode'], - $metadata, $options); - } - - /** - * Lists MetadataSchemas. - * @param \Google\Cloud\AIPlatform\V1\ListMetadataSchemasRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMetadataSchemas(\Google\Cloud\AIPlatform\V1\ListMetadataSchemasRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/ListMetadataSchemas', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListMetadataSchemasResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves lineage of an Artifact represented through Artifacts and - * Executions connected by Event edges and returned as a LineageSubgraph. - * @param \Google\Cloud\AIPlatform\V1\QueryArtifactLineageSubgraphRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function QueryArtifactLineageSubgraph(\Google\Cloud\AIPlatform\V1\QueryArtifactLineageSubgraphRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MetadataService/QueryArtifactLineageSubgraph', - $argument, - ['\Google\Cloud\AIPlatform\V1\LineageSubgraph', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/MetadataStore.php b/AiPlatform/src/V1/MetadataStore.php index 41abfee51175..ce8202984911 100644 --- a/AiPlatform/src/V1/MetadataStore.php +++ b/AiPlatform/src/V1/MetadataStore.php @@ -21,19 +21,19 @@ class MetadataStore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Timestamp when this MetadataStore was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this MetadataStore was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Customer-managed encryption key spec for a Metadata Store. If set, this * Metadata Store and all sub-resources of this Metadata Store are secured @@ -41,19 +41,25 @@ class MetadataStore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 5; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Description of the MetadataStore. * * Generated from protobuf field string description = 6; */ - private $description = ''; + protected $description = ''; /** * Output only. State information of the MetadataStore. * * Generated from protobuf field .google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = null; + protected $state = null; + /** + * Optional. Dataplex integration settings. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.MetadataStore.DataplexConfig dataplex_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $dataplex_config = null; /** * Constructor. @@ -75,6 +81,8 @@ class MetadataStore extends \Google\Protobuf\Internal\Message * Description of the MetadataStore. * @type \Google\Cloud\AIPlatform\V1\MetadataStore\MetadataStoreState $state * Output only. State information of the MetadataStore. + * @type \Google\Cloud\AIPlatform\V1\MetadataStore\DataplexConfig $dataplex_config + * Optional. Dataplex integration settings. * } */ public function __construct($data = NULL) { @@ -282,5 +290,41 @@ public function setState($var) return $this; } + /** + * Optional. Dataplex integration settings. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.MetadataStore.DataplexConfig dataplex_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\MetadataStore\DataplexConfig|null + */ + public function getDataplexConfig() + { + return $this->dataplex_config; + } + + public function hasDataplexConfig() + { + return isset($this->dataplex_config); + } + + public function clearDataplexConfig() + { + unset($this->dataplex_config); + } + + /** + * Optional. Dataplex integration settings. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.MetadataStore.DataplexConfig dataplex_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\MetadataStore\DataplexConfig $var + * @return $this + */ + public function setDataplexConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\MetadataStore\DataplexConfig::class); + $this->dataplex_config = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/MetadataStore/DataplexConfig.php b/AiPlatform/src/V1/MetadataStore/DataplexConfig.php new file mode 100644 index 000000000000..06f0186041b3 --- /dev/null +++ b/AiPlatform/src/V1/MetadataStore/DataplexConfig.php @@ -0,0 +1,72 @@ +google.cloud.aiplatform.v1.MetadataStore.DataplexConfig + */ +class DataplexConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether or not Data Lineage synchronization is enabled for + * Vertex Pipelines. + * + * Generated from protobuf field bool enabled_pipelines_lineage = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enabled_pipelines_lineage = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled_pipelines_lineage + * Optional. Whether or not Data Lineage synchronization is enabled for + * Vertex Pipelines. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\MetadataStore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether or not Data Lineage synchronization is enabled for + * Vertex Pipelines. + * + * Generated from protobuf field bool enabled_pipelines_lineage = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnabledPipelinesLineage() + { + return $this->enabled_pipelines_lineage; + } + + /** + * Optional. Whether or not Data Lineage synchronization is enabled for + * Vertex Pipelines. + * + * Generated from protobuf field bool enabled_pipelines_lineage = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnabledPipelinesLineage($var) + { + GPBUtil::checkBool($var); + $this->enabled_pipelines_lineage = $var; + + return $this; + } + +} + + diff --git a/AiPlatform/src/V1/MetadataStore/MetadataStoreState.php b/AiPlatform/src/V1/MetadataStore/MetadataStoreState.php index 1ababdc75686..a2072f38541f 100644 --- a/AiPlatform/src/V1/MetadataStore/MetadataStoreState.php +++ b/AiPlatform/src/V1/MetadataStore/MetadataStoreState.php @@ -20,7 +20,7 @@ class MetadataStoreState extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 disk_utilization_bytes = 1; */ - private $disk_utilization_bytes = 0; + protected $disk_utilization_bytes = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/MigratableResource.php b/AiPlatform/src/V1/MigratableResource.php index bd52fdeadd97..7b8508066ca1 100644 --- a/AiPlatform/src/V1/MigratableResource.php +++ b/AiPlatform/src/V1/MigratableResource.php @@ -23,13 +23,13 @@ class MigratableResource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp last_migrate_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $last_migrate_time = null; + protected $last_migrate_time = null; /** * Output only. Timestamp when this MigratableResource was last updated. * * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $last_update_time = null; + protected $last_update_time = null; protected $resource; /** diff --git a/AiPlatform/src/V1/MigratableResource/AutomlDataset.php b/AiPlatform/src/V1/MigratableResource/AutomlDataset.php index 25201375cfb2..36475a0fd84d 100644 --- a/AiPlatform/src/V1/MigratableResource/AutomlDataset.php +++ b/AiPlatform/src/V1/MigratableResource/AutomlDataset.php @@ -22,13 +22,13 @@ class AutomlDataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dataset = 1 [(.google.api.resource_reference) = { */ - private $dataset = ''; + protected $dataset = ''; /** * The Dataset's display name in automl.googleapis.com. * * Generated from protobuf field string dataset_display_name = 4; */ - private $dataset_display_name = ''; + protected $dataset_display_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MigratableResource/AutomlModel.php b/AiPlatform/src/V1/MigratableResource/AutomlModel.php index bcd3825adb4e..d3b9b2a5fb01 100644 --- a/AiPlatform/src/V1/MigratableResource/AutomlModel.php +++ b/AiPlatform/src/V1/MigratableResource/AutomlModel.php @@ -22,13 +22,13 @@ class AutomlModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 1 [(.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * The Model's display name in automl.googleapis.com. * * Generated from protobuf field string model_display_name = 3; */ - private $model_display_name = ''; + protected $model_display_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MigratableResource/DataLabelingDataset.php b/AiPlatform/src/V1/MigratableResource/DataLabelingDataset.php index ad441ebcfb45..ae3850d2ea9c 100644 --- a/AiPlatform/src/V1/MigratableResource/DataLabelingDataset.php +++ b/AiPlatform/src/V1/MigratableResource/DataLabelingDataset.php @@ -22,13 +22,13 @@ class DataLabelingDataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dataset = 1 [(.google.api.resource_reference) = { */ - private $dataset = ''; + protected $dataset = ''; /** * The Dataset's display name in datalabeling.googleapis.com. * * Generated from protobuf field string dataset_display_name = 4; */ - private $dataset_display_name = ''; + protected $dataset_display_name = ''; /** * The migratable AnnotatedDataset in datalabeling.googleapis.com belongs to * the data labeling Dataset. diff --git a/AiPlatform/src/V1/MigratableResource/DataLabelingDataset/DataLabelingAnnotatedDataset.php b/AiPlatform/src/V1/MigratableResource/DataLabelingDataset/DataLabelingAnnotatedDataset.php index c90cd5e798c8..d02e01052dc4 100644 --- a/AiPlatform/src/V1/MigratableResource/DataLabelingDataset/DataLabelingAnnotatedDataset.php +++ b/AiPlatform/src/V1/MigratableResource/DataLabelingDataset/DataLabelingAnnotatedDataset.php @@ -22,13 +22,13 @@ class DataLabelingAnnotatedDataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string annotated_dataset = 1 [(.google.api.resource_reference) = { */ - private $annotated_dataset = ''; + protected $annotated_dataset = ''; /** * The AnnotatedDataset's display name in datalabeling.googleapis.com. * * Generated from protobuf field string annotated_dataset_display_name = 3; */ - private $annotated_dataset_display_name = ''; + protected $annotated_dataset_display_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MigratableResource/MlEngineModelVersion.php b/AiPlatform/src/V1/MigratableResource/MlEngineModelVersion.php index 31ba9c1c5d03..297e60465ee8 100644 --- a/AiPlatform/src/V1/MigratableResource/MlEngineModelVersion.php +++ b/AiPlatform/src/V1/MigratableResource/MlEngineModelVersion.php @@ -26,14 +26,14 @@ class MlEngineModelVersion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1; */ - private $endpoint = ''; + protected $endpoint = ''; /** * Full resource name of ml engine model Version. * Format: `projects/{project}/models/{model}/versions/{version}`. * * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { */ - private $version = ''; + protected $version = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MigrateResourceRequest/MigrateAutomlDatasetConfig.php b/AiPlatform/src/V1/MigrateResourceRequest/MigrateAutomlDatasetConfig.php index a51df0ea6846..0ce35057fdb5 100644 --- a/AiPlatform/src/V1/MigrateResourceRequest/MigrateAutomlDatasetConfig.php +++ b/AiPlatform/src/V1/MigrateResourceRequest/MigrateAutomlDatasetConfig.php @@ -23,14 +23,14 @@ class MigrateAutomlDatasetConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $dataset = ''; + protected $dataset = ''; /** * Required. Display name of the Dataset in Vertex AI. * System will pick a display name if unspecified. * * Generated from protobuf field string dataset_display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $dataset_display_name = ''; + protected $dataset_display_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MigrateResourceRequest/MigrateAutomlModelConfig.php b/AiPlatform/src/V1/MigrateResourceRequest/MigrateAutomlModelConfig.php index 8be897a0ac23..3c8f77706805 100644 --- a/AiPlatform/src/V1/MigrateResourceRequest/MigrateAutomlModelConfig.php +++ b/AiPlatform/src/V1/MigrateResourceRequest/MigrateAutomlModelConfig.php @@ -22,14 +22,14 @@ class MigrateAutomlModelConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * Optional. Display name of the model in Vertex AI. * System will pick a display name if unspecified. * * Generated from protobuf field string model_display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $model_display_name = ''; + protected $model_display_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MigrateResourceRequest/MigrateDataLabelingDatasetConfig.php b/AiPlatform/src/V1/MigrateResourceRequest/MigrateDataLabelingDatasetConfig.php index bdf4efd87d80..bb8dded07960 100644 --- a/AiPlatform/src/V1/MigrateResourceRequest/MigrateDataLabelingDatasetConfig.php +++ b/AiPlatform/src/V1/MigrateResourceRequest/MigrateDataLabelingDatasetConfig.php @@ -23,14 +23,14 @@ class MigrateDataLabelingDatasetConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $dataset = ''; + protected $dataset = ''; /** * Optional. Display name of the Dataset in Vertex AI. * System will pick a display name if unspecified. * * Generated from protobuf field string dataset_display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $dataset_display_name = ''; + protected $dataset_display_name = ''; /** * Optional. Configs for migrating AnnotatedDataset in * datalabeling.googleapis.com to Vertex AI's SavedQuery. The specified diff --git a/AiPlatform/src/V1/MigrateResourceRequest/MigrateDataLabelingDatasetConfig/MigrateDataLabelingAnnotatedDatasetConfig.php b/AiPlatform/src/V1/MigrateResourceRequest/MigrateDataLabelingDatasetConfig/MigrateDataLabelingAnnotatedDatasetConfig.php index a8d9e922183c..65c0ab94ba3f 100644 --- a/AiPlatform/src/V1/MigrateResourceRequest/MigrateDataLabelingDatasetConfig/MigrateDataLabelingAnnotatedDatasetConfig.php +++ b/AiPlatform/src/V1/MigrateResourceRequest/MigrateDataLabelingDatasetConfig/MigrateDataLabelingAnnotatedDatasetConfig.php @@ -23,7 +23,7 @@ class MigrateDataLabelingAnnotatedDatasetConfig extends \Google\Protobuf\Interna * * Generated from protobuf field string annotated_dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $annotated_dataset = ''; + protected $annotated_dataset = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MigrateResourceRequest/MigrateMlEngineModelVersionConfig.php b/AiPlatform/src/V1/MigrateResourceRequest/MigrateMlEngineModelVersionConfig.php index e2bc6bf34a33..6fa2c88ffce9 100644 --- a/AiPlatform/src/V1/MigrateResourceRequest/MigrateMlEngineModelVersionConfig.php +++ b/AiPlatform/src/V1/MigrateResourceRequest/MigrateMlEngineModelVersionConfig.php @@ -25,21 +25,21 @@ class MigrateMlEngineModelVersionConfig extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $endpoint = ''; + protected $endpoint = ''; /** * Required. Full resource name of ml engine model version. * Format: `projects/{project}/models/{model}/versions/{version}`. * * Generated from protobuf field string model_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $model_version = ''; + protected $model_version = ''; /** * Required. Display name of the model in Vertex AI. * System will pick a display name if unspecified. * * Generated from protobuf field string model_display_name = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $model_display_name = ''; + protected $model_display_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MigrateResourceResponse.php b/AiPlatform/src/V1/MigrateResourceResponse.php index 7687a7f3f575..97f7d57c49f5 100644 --- a/AiPlatform/src/V1/MigrateResourceResponse.php +++ b/AiPlatform/src/V1/MigrateResourceResponse.php @@ -21,7 +21,7 @@ class MigrateResourceResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.MigratableResource migratable_resource = 3; */ - private $migratable_resource = null; + protected $migratable_resource = null; protected $migrated_resource; /** diff --git a/AiPlatform/src/V1/MigrationServiceClient.php b/AiPlatform/src/V1/MigrationServiceClient.php deleted file mode 100644 index 7751ec698e0b..000000000000 --- a/AiPlatform/src/V1/MigrationServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.MigrationService/SearchMigratableResources', - $argument, - ['\Google\Cloud\AIPlatform\V1\SearchMigratableResourcesResponse', 'decode'], - $metadata, $options); - } - - /** - * Batch migrates resources from ml.googleapis.com, automl.googleapis.com, - * and datalabeling.googleapis.com to Vertex AI. - * @param \Google\Cloud\AIPlatform\V1\BatchMigrateResourcesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function BatchMigrateResources(\Google\Cloud\AIPlatform\V1\BatchMigrateResourcesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.MigrationService/BatchMigrateResources', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/Model.php b/AiPlatform/src/V1/Model.php index cfce86f98294..84ea1501b636 100644 --- a/AiPlatform/src/V1/Model.php +++ b/AiPlatform/src/V1/Model.php @@ -20,7 +20,7 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Output only. Immutable. The version ID of the model. * A new version is committed when a new model version is uploaded or @@ -29,7 +29,7 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version_id = 28 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $version_id = ''; + protected $version_id = ''; /** * User provided version aliases so that a model version can be referenced via * alias (i.e. @@ -49,13 +49,13 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp version_create_time = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $version_create_time = null; + protected $version_create_time = null; /** * Output only. Timestamp when this version was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp version_update_time = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $version_update_time = null; + protected $version_update_time = null; /** * Required. The display name of the Model. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -63,19 +63,19 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * The description of the Model. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * The description of this version. * * Generated from protobuf field string version_description = 30; */ - private $version_description = ''; + protected $version_description = ''; /** * The schemata that describe formats of the Model's predictions and * explanations as given and returned via @@ -85,7 +85,7 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PredictSchemata predict_schemata = 4; */ - private $predict_schemata = null; + protected $predict_schemata = null; /** * Immutable. Points to a YAML file stored on Google Cloud Storage describing * additional information about the Model, that is specific to it. Unset if @@ -100,7 +100,7 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_schema_uri = 5 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $metadata_schema_uri = ''; + protected $metadata_schema_uri = ''; /** * Immutable. An additional information about the Model; the schema of the * metadata can be found in @@ -109,7 +109,7 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $metadata = null; + protected $metadata = null; /** * Output only. The formats in which this Model may be exported. If empty, * this Model is not available for export. @@ -123,14 +123,14 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string training_pipeline = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $training_pipeline = ''; + protected $training_pipeline = ''; /** * Optional. This field is populated if the model is produced by a pipeline * job. * * Generated from protobuf field string pipeline_job = 47 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $pipeline_job = ''; + protected $pipeline_job = ''; /** * Input only. The specification of the container that is to be used when * deploying this Model. The specification is ingested upon @@ -140,14 +140,14 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelContainerSpec container_spec = 9 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $container_spec = null; + protected $container_spec = null; /** * Immutable. The path to the directory containing the Model artifact and any * of its supporting files. Not required for AutoML Models. * * Generated from protobuf field string artifact_uri = 26 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $artifact_uri = ''; + protected $artifact_uri = ''; /** * Output only. When this Model is deployed, its prediction resources are * described by the `prediction_resources` field of the @@ -254,13 +254,13 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Model was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. The pointers to DeployedModels created from this Model. Note * that Model could have been deployed to Endpoints in different Locations. @@ -300,14 +300,14 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationSpec explanation_spec = 23; */ - private $explanation_spec = null; + protected $explanation_spec = null; /** * Used to perform consistent read-modify-write updates. If not set, a blind * "overwrite" update happens. * * Generated from protobuf field string etag = 16; */ - private $etag = ''; + protected $etag = ''; /** * The labels with user-defined metadata to organize your Models. * Label keys and values can be no longer than 64 characters @@ -325,14 +325,14 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Model.DataStats data_stats = 21; */ - private $data_stats = null; + protected $data_stats = null; /** * Customer-managed encryption key spec for a Model. If set, this * Model and all sub-resources of this Model will be secured by this key. * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 24; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Output only. Source of a model. It can either be automl training pipeline, * custom training pipeline, BigQuery ML, or saved and tuned from Genie or @@ -340,14 +340,14 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelSourceInfo model_source_info = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $model_source_info = null; + protected $model_source_info = null; /** * Output only. If this Model is a copy of another Model, this contains info * about the original. * * Generated from protobuf field .google.cloud.aiplatform.v1.Model.OriginalModelInfo original_model_info = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $original_model_info = null; + protected $original_model_info = null; /** * Output only. The resource name of the Artifact that was created in * MetadataStore when creating the Model. The Artifact resource name pattern @@ -356,14 +356,14 @@ class Model extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_artifact = 44 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata_artifact = ''; + protected $metadata_artifact = ''; /** * Optional. User input field to specify the base model source. Currently it * only supports specifing the Model Garden models and Genie models. * * Generated from protobuf field .google.cloud.aiplatform.v1.Model.BaseModelSource base_model_source = 50 [(.google.api.field_behavior) = OPTIONAL]; */ - private $base_model_source = null; + protected $base_model_source = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Model/DataStats.php b/AiPlatform/src/V1/Model/DataStats.php index 64f3d41dd832..bd58d337083e 100644 --- a/AiPlatform/src/V1/Model/DataStats.php +++ b/AiPlatform/src/V1/Model/DataStats.php @@ -20,14 +20,14 @@ class DataStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 training_data_items_count = 1; */ - private $training_data_items_count = 0; + protected $training_data_items_count = 0; /** * Number of DataItems that were used for validating this Model during * training. * * Generated from protobuf field int64 validation_data_items_count = 2; */ - private $validation_data_items_count = 0; + protected $validation_data_items_count = 0; /** * Number of DataItems that were used for evaluating this Model. If the * Model is evaluated multiple times, this will be the number of test @@ -36,20 +36,20 @@ class DataStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 test_data_items_count = 3; */ - private $test_data_items_count = 0; + protected $test_data_items_count = 0; /** * Number of Annotations that are used for training this Model. * * Generated from protobuf field int64 training_annotations_count = 4; */ - private $training_annotations_count = 0; + protected $training_annotations_count = 0; /** * Number of Annotations that are used for validating this Model during * training. * * Generated from protobuf field int64 validation_annotations_count = 5; */ - private $validation_annotations_count = 0; + protected $validation_annotations_count = 0; /** * Number of Annotations that are used for evaluating this Model. If the * Model is evaluated multiple times, this will be the number of test @@ -58,7 +58,7 @@ class DataStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 test_annotations_count = 6; */ - private $test_annotations_count = 0; + protected $test_annotations_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/Model/ExportFormat.php b/AiPlatform/src/V1/Model/ExportFormat.php index ae1fec72a34f..cf148bf7fb6d 100644 --- a/AiPlatform/src/V1/Model/ExportFormat.php +++ b/AiPlatform/src/V1/Model/ExportFormat.php @@ -35,7 +35,7 @@ class ExportFormat extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $id = ''; + protected $id = ''; /** * Output only. The content of this Model that may be exported. * diff --git a/AiPlatform/src/V1/Model/OriginalModelInfo.php b/AiPlatform/src/V1/Model/OriginalModelInfo.php index 33acdc896e1d..c8b7f4049818 100644 --- a/AiPlatform/src/V1/Model/OriginalModelInfo.php +++ b/AiPlatform/src/V1/Model/OriginalModelInfo.php @@ -22,7 +22,7 @@ class OriginalModelInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelContainerSpec.php b/AiPlatform/src/V1/ModelContainerSpec.php index 1ed2155a6eff..a588d2607da4 100644 --- a/AiPlatform/src/V1/ModelContainerSpec.php +++ b/AiPlatform/src/V1/ModelContainerSpec.php @@ -36,7 +36,7 @@ class ModelContainerSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $image_uri = ''; + protected $image_uri = ''; /** * Immutable. Specifies the command that runs when the container starts. This * overrides the container's @@ -194,7 +194,7 @@ class ModelContainerSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string predict_route = 6 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $predict_route = ''; + protected $predict_route = ''; /** * Immutable. HTTP path on the container to send health checks to. Vertex AI * intermittently sends GET requests to this path on the container's IP @@ -224,7 +224,7 @@ class ModelContainerSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string health_route = 7 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $health_route = ''; + protected $health_route = ''; /** * Immutable. List of ports to expose from the container. Vertex AI sends gRPC * prediction requests that it receives to the first port on this list. Vertex @@ -243,26 +243,26 @@ class ModelContainerSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration deployment_timeout = 10 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $deployment_timeout = null; + protected $deployment_timeout = null; /** * Immutable. The amount of the VM memory to reserve as the shared memory for * the model in megabytes. * * Generated from protobuf field int64 shared_memory_size_mb = 11 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $shared_memory_size_mb = 0; + protected $shared_memory_size_mb = 0; /** * Immutable. Specification for Kubernetes startup probe. * * Generated from protobuf field .google.cloud.aiplatform.v1.Probe startup_probe = 12 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $startup_probe = null; + protected $startup_probe = null; /** * Immutable. Specification for Kubernetes readiness probe. * * Generated from protobuf field .google.cloud.aiplatform.v1.Probe health_probe = 13 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $health_probe = null; + protected $health_probe = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelDeploymentMonitoringBigQueryTable.php b/AiPlatform/src/V1/ModelDeploymentMonitoringBigQueryTable.php index dc71f6b7bc76..18eb60eef093 100644 --- a/AiPlatform/src/V1/ModelDeploymentMonitoringBigQueryTable.php +++ b/AiPlatform/src/V1/ModelDeploymentMonitoringBigQueryTable.php @@ -21,13 +21,13 @@ class ModelDeploymentMonitoringBigQueryTable extends \Google\Protobuf\Internal\M * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelDeploymentMonitoringBigQueryTable.LogSource log_source = 1; */ - private $log_source = 0; + protected $log_source = 0; /** * The type of log. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelDeploymentMonitoringBigQueryTable.LogType log_type = 2; */ - private $log_type = 0; + protected $log_type = 0; /** * The created BigQuery table to store logs. Customer could do their own query * & analysis. Format: @@ -35,14 +35,14 @@ class ModelDeploymentMonitoringBigQueryTable extends \Google\Protobuf\Internal\M * * Generated from protobuf field string bigquery_table_path = 3; */ - private $bigquery_table_path = ''; + protected $bigquery_table_path = ''; /** * Output only. The schema version of the request/response logging BigQuery * table. Default to v1 if unset. * * Generated from protobuf field string request_response_logging_schema_version = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $request_response_logging_schema_version = ''; + protected $request_response_logging_schema_version = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelDeploymentMonitoringJob.php b/AiPlatform/src/V1/ModelDeploymentMonitoringJob.php index fd51b218aca6..1e74fba8d552 100644 --- a/AiPlatform/src/V1/ModelDeploymentMonitoringJob.php +++ b/AiPlatform/src/V1/ModelDeploymentMonitoringJob.php @@ -22,7 +22,7 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-defined name of the ModelDeploymentMonitoringJob. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -31,14 +31,14 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Required. Endpoint resource name. * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` * * Generated from protobuf field string endpoint = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Output only. The detailed state of the monitoring job. * When the job is still creating, the state will be 'PENDING'. @@ -48,19 +48,19 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.JobState state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Schedule state when the monitoring job is in Running state. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.MonitoringScheduleState schedule_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $schedule_state = 0; + protected $schedule_state = 0; /** * Output only. Latest triggered monitoring pipeline metadata. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.LatestMonitoringPipelineMetadata latest_monitoring_pipeline_metadata = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $latest_monitoring_pipeline_metadata = null; + protected $latest_monitoring_pipeline_metadata = null; /** * Required. The config for monitoring objectives. This is a per DeployedModel * config. Each DeployedModel needs to be configured separately. @@ -73,19 +73,19 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelDeploymentMonitoringScheduleConfig model_deployment_monitoring_schedule_config = 7 [(.google.api.field_behavior) = REQUIRED]; */ - private $model_deployment_monitoring_schedule_config = null; + protected $model_deployment_monitoring_schedule_config = null; /** * Required. Sample Strategy for logging. * * Generated from protobuf field .google.cloud.aiplatform.v1.SamplingStrategy logging_sampling_strategy = 8 [(.google.api.field_behavior) = REQUIRED]; */ - private $logging_sampling_strategy = null; + protected $logging_sampling_strategy = null; /** * Alert config for model monitoring. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelMonitoringAlertConfig model_monitoring_alert_config = 15; */ - private $model_monitoring_alert_config = null; + protected $model_monitoring_alert_config = null; /** * YAML schema file uri describing the format of a single instance, * which are given to format this Endpoint's prediction (and explanation). @@ -94,7 +94,7 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string predict_instance_schema_uri = 9; */ - private $predict_instance_schema_uri = ''; + protected $predict_instance_schema_uri = ''; /** * Sample Predict instance, same format as * [PredictRequest.instances][google.cloud.aiplatform.v1.PredictRequest.instances], @@ -105,7 +105,7 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value sample_predict_instance = 19; */ - private $sample_predict_instance = null; + protected $sample_predict_instance = null; /** * YAML schema file uri describing the format of a single instance that you * want Tensorflow Data Validation (TFDV) to analyze. @@ -120,7 +120,7 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string analysis_instance_schema_uri = 16; */ - private $analysis_instance_schema_uri = ''; + protected $analysis_instance_schema_uri = ''; /** * Output only. The created bigquery tables for the job under customer * project. Customer could do their own query & analysis. There could be 4 log @@ -138,7 +138,7 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration log_ttl = 17; */ - private $log_ttl = null; + protected $log_ttl = null; /** * The labels with user-defined metadata to organize your * ModelDeploymentMonitoringJob. @@ -155,27 +155,27 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this ModelDeploymentMonitoringJob was updated * most recently. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Timestamp when this monitoring pipeline will be scheduled to * run for the next round. * * Generated from protobuf field .google.protobuf.Timestamp next_schedule_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_schedule_time = null; + protected $next_schedule_time = null; /** * Stats anomalies base folder path. * * Generated from protobuf field .google.cloud.aiplatform.v1.GcsDestination stats_anomalies_base_directory = 20; */ - private $stats_anomalies_base_directory = null; + protected $stats_anomalies_base_directory = null; /** * Customer-managed encryption key spec for a ModelDeploymentMonitoringJob. If * set, this ModelDeploymentMonitoringJob and all sub-resources of this @@ -183,7 +183,7 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 21; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * If true, the scheduled monitoring pipeline logs are sent to * Google Cloud Logging, including pipeline status and anomalies detected. @@ -192,14 +192,14 @@ class ModelDeploymentMonitoringJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_monitoring_pipeline_logs = 22; */ - private $enable_monitoring_pipeline_logs = false; + protected $enable_monitoring_pipeline_logs = false; /** * Output only. Only populated when the job's state is `JOB_STATE_FAILED` or * `JOB_STATE_CANCELLED`. * * Generated from protobuf field .google.rpc.Status error = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelDeploymentMonitoringJob/LatestMonitoringPipelineMetadata.php b/AiPlatform/src/V1/ModelDeploymentMonitoringJob/LatestMonitoringPipelineMetadata.php index 73879ccbf61c..dc0013fe6fb2 100644 --- a/AiPlatform/src/V1/ModelDeploymentMonitoringJob/LatestMonitoringPipelineMetadata.php +++ b/AiPlatform/src/V1/ModelDeploymentMonitoringJob/LatestMonitoringPipelineMetadata.php @@ -21,13 +21,13 @@ class LatestMonitoringPipelineMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp run_time = 1; */ - private $run_time = null; + protected $run_time = null; /** * The status of the most recent monitoring pipeline. * * Generated from protobuf field .google.rpc.Status status = 2; */ - private $status = null; + protected $status = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelDeploymentMonitoringObjectiveConfig.php b/AiPlatform/src/V1/ModelDeploymentMonitoringObjectiveConfig.php index a9150a24ab2d..b7a45633e0c1 100644 --- a/AiPlatform/src/V1/ModelDeploymentMonitoringObjectiveConfig.php +++ b/AiPlatform/src/V1/ModelDeploymentMonitoringObjectiveConfig.php @@ -21,13 +21,13 @@ class ModelDeploymentMonitoringObjectiveConfig extends \Google\Protobuf\Internal * * Generated from protobuf field string deployed_model_id = 1; */ - private $deployed_model_id = ''; + protected $deployed_model_id = ''; /** * The objective config of for the modelmonitoring job of this deployed model. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig objective_config = 2; */ - private $objective_config = null; + protected $objective_config = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelDeploymentMonitoringScheduleConfig.php b/AiPlatform/src/V1/ModelDeploymentMonitoringScheduleConfig.php index c5caa03cc95f..6d211b7d9260 100644 --- a/AiPlatform/src/V1/ModelDeploymentMonitoringScheduleConfig.php +++ b/AiPlatform/src/V1/ModelDeploymentMonitoringScheduleConfig.php @@ -22,7 +22,7 @@ class ModelDeploymentMonitoringScheduleConfig extends \Google\Protobuf\Internal\ * * Generated from protobuf field .google.protobuf.Duration monitor_interval = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $monitor_interval = null; + protected $monitor_interval = null; /** * The time window of the prediction data being included in each prediction * dataset. This window specifies how long the data should be collected from @@ -35,7 +35,7 @@ class ModelDeploymentMonitoringScheduleConfig extends \Google\Protobuf\Internal\ * * Generated from protobuf field .google.protobuf.Duration monitor_window = 2; */ - private $monitor_window = null; + protected $monitor_window = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelEvaluation.php b/AiPlatform/src/V1/ModelEvaluation.php index 4b77948de81e..75535dee1223 100644 --- a/AiPlatform/src/V1/ModelEvaluation.php +++ b/AiPlatform/src/V1/ModelEvaluation.php @@ -21,13 +21,13 @@ class ModelEvaluation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * The display name of the ModelEvaluation. * * Generated from protobuf field string display_name = 10; */ - private $display_name = ''; + protected $display_name = ''; /** * Points to a YAML file stored on Google Cloud Storage describing the * [metrics][google.cloud.aiplatform.v1.ModelEvaluation.metrics] of this @@ -36,20 +36,20 @@ class ModelEvaluation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metrics_schema_uri = 2; */ - private $metrics_schema_uri = ''; + protected $metrics_schema_uri = ''; /** * Evaluation metrics of the Model. The schema of the metrics is stored in * [metrics_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.metrics_schema_uri] * * Generated from protobuf field .google.protobuf.Value metrics = 3; */ - private $metrics = null; + protected $metrics = null; /** * Output only. Timestamp when this ModelEvaluation was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * All possible * [dimensions][google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.dimension] @@ -71,7 +71,7 @@ class ModelEvaluation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_item_schema_uri = 6; */ - private $data_item_schema_uri = ''; + protected $data_item_schema_uri = ''; /** * Points to a YAML file stored on Google Cloud Storage describing * [EvaluatedDataItemView.predictions][], @@ -86,7 +86,7 @@ class ModelEvaluation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string annotation_schema_uri = 7; */ - private $annotation_schema_uri = ''; + protected $annotation_schema_uri = ''; /** * Aggregated explanation metrics for the Model's prediction output over the * data this ModelEvaluation uses. This field is populated only if the Model @@ -94,7 +94,7 @@ class ModelEvaluation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelExplanation model_explanation = 8; */ - private $model_explanation = null; + protected $model_explanation = null; /** * Describes the values of * [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] that are used @@ -111,7 +111,7 @@ class ModelEvaluation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value metadata = 11; */ - private $metadata = null; + protected $metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelEvaluation/ModelEvaluationExplanationSpec.php b/AiPlatform/src/V1/ModelEvaluation/ModelEvaluationExplanationSpec.php index a5df2982ed0f..0a0c01d92107 100644 --- a/AiPlatform/src/V1/ModelEvaluation/ModelEvaluationExplanationSpec.php +++ b/AiPlatform/src/V1/ModelEvaluation/ModelEvaluationExplanationSpec.php @@ -21,13 +21,13 @@ class ModelEvaluationExplanationSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string explanation_type = 1; */ - private $explanation_type = ''; + protected $explanation_type = ''; /** * Explanation spec details. * * Generated from protobuf field .google.cloud.aiplatform.v1.ExplanationSpec explanation_spec = 2; */ - private $explanation_spec = null; + protected $explanation_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelEvaluationSlice.php b/AiPlatform/src/V1/ModelEvaluationSlice.php index 83bc3de76270..b17aaa83713d 100644 --- a/AiPlatform/src/V1/ModelEvaluationSlice.php +++ b/AiPlatform/src/V1/ModelEvaluationSlice.php @@ -21,13 +21,13 @@ class ModelEvaluationSlice extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The slice of the test data that is used to evaluate the Model. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice slice = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $slice = null; + protected $slice = null; /** * Output only. Points to a YAML file stored on Google Cloud Storage * describing the @@ -37,7 +37,7 @@ class ModelEvaluationSlice extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metrics_schema_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metrics_schema_uri = ''; + protected $metrics_schema_uri = ''; /** * Output only. Sliced evaluation metrics of the Model. The schema of the * metrics is stored in @@ -45,13 +45,13 @@ class ModelEvaluationSlice extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value metrics = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metrics = null; + protected $metrics = null; /** * Output only. Timestamp when this ModelEvaluationSlice was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Aggregated explanation metrics for the Model's prediction * output over the data this ModelEvaluation uses. This field is populated @@ -60,7 +60,7 @@ class ModelEvaluationSlice extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelExplanation model_explanation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $model_explanation = null; + protected $model_explanation = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelEvaluationSlice/Slice.php b/AiPlatform/src/V1/ModelEvaluationSlice/Slice.php index de9c85443908..8577348d06ca 100644 --- a/AiPlatform/src/V1/ModelEvaluationSlice/Slice.php +++ b/AiPlatform/src/V1/ModelEvaluationSlice/Slice.php @@ -28,19 +28,19 @@ class Slice extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dimension = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $dimension = ''; + protected $dimension = ''; /** * Output only. The value of the dimension in this slice. * * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $value = ''; + protected $value = ''; /** * Output only. Specification for how the data was sliced. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec slice_spec = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $slice_spec = null; + protected $slice_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelEvaluationSlice/Slice/SliceSpec/Range.php b/AiPlatform/src/V1/ModelEvaluationSlice/Slice/SliceSpec/Range.php index 4bffbb63bb7a..46c579ccf49b 100644 --- a/AiPlatform/src/V1/ModelEvaluationSlice/Slice/SliceSpec/Range.php +++ b/AiPlatform/src/V1/ModelEvaluationSlice/Slice/SliceSpec/Range.php @@ -21,13 +21,13 @@ class Range extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float low = 1; */ - private $low = 0.0; + protected $low = 0.0; /** * Exclusive high value for the range. * * Generated from protobuf field float high = 2; */ - private $high = 0.0; + protected $high = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelEvaluationSlice/Slice/SliceSpec/SliceConfig.php b/AiPlatform/src/V1/ModelEvaluationSlice/Slice/SliceSpec/SliceConfig.php index 378208b5648f..015cc27e13b6 100644 --- a/AiPlatform/src/V1/ModelEvaluationSlice/Slice/SliceSpec/SliceConfig.php +++ b/AiPlatform/src/V1/ModelEvaluationSlice/Slice/SliceSpec/SliceConfig.php @@ -176,7 +176,7 @@ public function hasAllValues() * Generated from protobuf field .google.protobuf.BoolValue all_values = 3; * @return bool|null */ - public function getAllValuesValue() + public function getAllValuesUnwrapped() { return $this->readWrapperValue("all_values"); } @@ -209,7 +209,7 @@ public function setAllValues($var) * @param bool|null $var * @return $this */ - public function setAllValuesValue($var) + public function setAllValuesUnwrapped($var) { $this->writeWrapperValue("all_values", $var); return $this;} diff --git a/AiPlatform/src/V1/ModelGardenServiceClient.php b/AiPlatform/src/V1/ModelGardenServiceClient.php deleted file mode 100644 index 9980f24b5bb6..000000000000 --- a/AiPlatform/src/V1/ModelGardenServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -string public_model_name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $public_model_name = ''; + protected $public_model_name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelMonitoringAlertConfig.php b/AiPlatform/src/V1/ModelMonitoringAlertConfig.php index eaf5432936a2..e4f7302e6c6e 100644 --- a/AiPlatform/src/V1/ModelMonitoringAlertConfig.php +++ b/AiPlatform/src/V1/ModelMonitoringAlertConfig.php @@ -24,7 +24,7 @@ class ModelMonitoringAlertConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_logging = 2; */ - private $enable_logging = false; + protected $enable_logging = false; /** * Resource names of the NotificationChannels to send alert. * Must be of the format diff --git a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig.php b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig.php index f23da4853be6..f1a3811fc390 100644 --- a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig.php +++ b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig.php @@ -22,25 +22,25 @@ class ModelMonitoringObjectiveConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.TrainingDataset training_dataset = 1; */ - private $training_dataset = null; + protected $training_dataset = null; /** * The config for skew between training data and prediction data. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.TrainingPredictionSkewDetectionConfig training_prediction_skew_detection_config = 2; */ - private $training_prediction_skew_detection_config = null; + protected $training_prediction_skew_detection_config = null; /** * The config for drift of prediction data. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.PredictionDriftDetectionConfig prediction_drift_detection_config = 3; */ - private $prediction_drift_detection_config = null; + protected $prediction_drift_detection_config = null; /** * The config for integrating with Vertex Explainable AI. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.ExplanationConfig explanation_config = 5; */ - private $explanation_config = null; + protected $explanation_config = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/ExplanationConfig.php b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/ExplanationConfig.php index 630da357f600..b211fa281fe4 100644 --- a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/ExplanationConfig.php +++ b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/ExplanationConfig.php @@ -23,13 +23,13 @@ class ExplanationConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_feature_attributes = 1; */ - private $enable_feature_attributes = false; + protected $enable_feature_attributes = false; /** * Predictions generated by the BatchPredictionJob using baseline dataset. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.ExplanationConfig.ExplanationBaseline explanation_baseline = 2; */ - private $explanation_baseline = null; + protected $explanation_baseline = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/ExplanationConfig/ExplanationBaseline.php b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/ExplanationConfig/ExplanationBaseline.php index 648c3723dcdd..3d355902f76c 100644 --- a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/ExplanationConfig/ExplanationBaseline.php +++ b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/ExplanationConfig/ExplanationBaseline.php @@ -23,7 +23,7 @@ class ExplanationBaseline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.ExplanationConfig.ExplanationBaseline.PredictionFormat prediction_format = 1; */ - private $prediction_format = 0; + protected $prediction_format = 0; protected $destination; /** diff --git a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/PredictionDriftDetectionConfig.php b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/PredictionDriftDetectionConfig.php index faddad6fd4f0..4ff6b59338ba 100644 --- a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/PredictionDriftDetectionConfig.php +++ b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/PredictionDriftDetectionConfig.php @@ -38,7 +38,7 @@ class PredictionDriftDetectionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ThresholdConfig default_drift_threshold = 5; */ - private $default_drift_threshold = null; + protected $default_drift_threshold = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/TrainingDataset.php b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/TrainingDataset.php index 1ee4a17880e8..9d87aae2f919 100644 --- a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/TrainingDataset.php +++ b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/TrainingDataset.php @@ -28,7 +28,7 @@ class TrainingDataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_format = 2; */ - private $data_format = ''; + protected $data_format = ''; /** * The target field name the model is to predict. * This field will be excluded when doing Predict and (or) Explain for the @@ -36,14 +36,14 @@ class TrainingDataset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string target_field = 6; */ - private $target_field = ''; + protected $target_field = ''; /** * Strategy to sample data from Training Dataset. * If not set, we process the whole dataset. * * Generated from protobuf field .google.cloud.aiplatform.v1.SamplingStrategy logging_sampling_strategy = 7; */ - private $logging_sampling_strategy = null; + protected $logging_sampling_strategy = null; protected $data_source; /** diff --git a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/TrainingPredictionSkewDetectionConfig.php b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/TrainingPredictionSkewDetectionConfig.php index f622fba72daf..01cddd750ccf 100644 --- a/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/TrainingPredictionSkewDetectionConfig.php +++ b/AiPlatform/src/V1/ModelMonitoringObjectiveConfig/TrainingPredictionSkewDetectionConfig.php @@ -40,7 +40,7 @@ class TrainingPredictionSkewDetectionConfig extends \Google\Protobuf\Internal\Me * * Generated from protobuf field .google.cloud.aiplatform.v1.ThresholdConfig default_skew_threshold = 6; */ - private $default_skew_threshold = null; + protected $default_skew_threshold = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ModelMonitoringStatsAnomalies.php b/AiPlatform/src/V1/ModelMonitoringStatsAnomalies.php index ec7ab2681915..f96bd2e25161 100644 --- a/AiPlatform/src/V1/ModelMonitoringStatsAnomalies.php +++ b/AiPlatform/src/V1/ModelMonitoringStatsAnomalies.php @@ -20,19 +20,19 @@ class ModelMonitoringStatsAnomalies extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveType objective = 1; */ - private $objective = 0; + protected $objective = 0; /** * Deployed Model ID. * * Generated from protobuf field string deployed_model_id = 2; */ - private $deployed_model_id = ''; + protected $deployed_model_id = ''; /** * Number of anomalies within all stats. * * Generated from protobuf field int32 anomaly_count = 3; */ - private $anomaly_count = 0; + protected $anomaly_count = 0; /** * A list of historical Stats and Anomalies generated for all Features. * diff --git a/AiPlatform/src/V1/ModelMonitoringStatsAnomalies/FeatureHistoricStatsAnomalies.php b/AiPlatform/src/V1/ModelMonitoringStatsAnomalies/FeatureHistoricStatsAnomalies.php index 56a04a2be9b3..010cfdcbc913 100644 --- a/AiPlatform/src/V1/ModelMonitoringStatsAnomalies/FeatureHistoricStatsAnomalies.php +++ b/AiPlatform/src/V1/ModelMonitoringStatsAnomalies/FeatureHistoricStatsAnomalies.php @@ -20,19 +20,19 @@ class FeatureHistoricStatsAnomalies extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_display_name = 1; */ - private $feature_display_name = ''; + protected $feature_display_name = ''; /** * Threshold for anomaly detection. * * Generated from protobuf field .google.cloud.aiplatform.v1.ThresholdConfig threshold = 3; */ - private $threshold = null; + protected $threshold = null; /** * Stats calculated for the Training Dataset. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureStatsAnomaly training_stats = 4; */ - private $training_stats = null; + protected $training_stats = null; /** * A list of historical stats generated by different time window's * Prediction Dataset. diff --git a/AiPlatform/src/V1/ModelServiceClient.php b/AiPlatform/src/V1/ModelServiceClient.php deleted file mode 100644 index 4415a352ea74..000000000000 --- a/AiPlatform/src/V1/ModelServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.ModelService/UploadModel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets a Model. - * @param \Google\Cloud\AIPlatform\V1\GetModelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetModel(\Google\Cloud\AIPlatform\V1\GetModelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/GetModel', - $argument, - ['\Google\Cloud\AIPlatform\V1\Model', 'decode'], - $metadata, $options); - } - - /** - * Lists Models in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListModelsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListModels(\Google\Cloud\AIPlatform\V1\ListModelsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModels', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListModelsResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists versions of the specified model. - * @param \Google\Cloud\AIPlatform\V1\ListModelVersionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListModelVersions(\Google\Cloud\AIPlatform\V1\ListModelVersionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelVersions', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListModelVersionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a Model. - * @param \Google\Cloud\AIPlatform\V1\UpdateModelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateModel(\Google\Cloud\AIPlatform\V1\UpdateModelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/UpdateModel', - $argument, - ['\Google\Cloud\AIPlatform\V1\Model', 'decode'], - $metadata, $options); - } - - /** - * Deletes a Model. - * - * A model cannot be deleted if any - * [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a - * [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the - * model in its - * [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] - * field. - * @param \Google\Cloud\AIPlatform\V1\DeleteModelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteModel(\Google\Cloud\AIPlatform\V1\DeleteModelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/DeleteModel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a Model version. - * - * Model version can only be deleted if there are no - * [DeployedModels][google.cloud.aiplatform.v1.DeployedModel] created from it. - * Deleting the only version in the Model is not allowed. Use - * [DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel] for - * deleting the Model instead. - * @param \Google\Cloud\AIPlatform\V1\DeleteModelVersionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteModelVersion(\Google\Cloud\AIPlatform\V1\DeleteModelVersionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/DeleteModelVersion', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Merges a set of aliases for a Model version. - * @param \Google\Cloud\AIPlatform\V1\MergeVersionAliasesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MergeVersionAliases(\Google\Cloud\AIPlatform\V1\MergeVersionAliasesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/MergeVersionAliases', - $argument, - ['\Google\Cloud\AIPlatform\V1\Model', 'decode'], - $metadata, $options); - } - - /** - * Exports a trained, exportable Model to a location specified by the - * user. A Model is considered to be exportable if it has at least one - * [supported export - * format][google.cloud.aiplatform.v1.Model.supported_export_formats]. - * @param \Google\Cloud\AIPlatform\V1\ExportModelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportModel(\Google\Cloud\AIPlatform\V1\ExportModelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ExportModel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Copies an already existing Vertex AI Model into the specified Location. - * The source Model must exist in the same Project. - * When copying custom Models, the users themselves are responsible for - * [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be - * region-agnostic, as well as making sure that any resources (e.g. files) it - * depends on remain accessible. - * @param \Google\Cloud\AIPlatform\V1\CopyModelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CopyModel(\Google\Cloud\AIPlatform\V1\CopyModelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/CopyModel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Imports an externally generated ModelEvaluation. - * @param \Google\Cloud\AIPlatform\V1\ImportModelEvaluationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportModelEvaluation(\Google\Cloud\AIPlatform\V1\ImportModelEvaluationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ImportModelEvaluation', - $argument, - ['\Google\Cloud\AIPlatform\V1\ModelEvaluation', 'decode'], - $metadata, $options); - } - - /** - * Imports a list of externally generated ModelEvaluationSlice. - * @param \Google\Cloud\AIPlatform\V1\BatchImportModelEvaluationSlicesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function BatchImportModelEvaluationSlices(\Google\Cloud\AIPlatform\V1\BatchImportModelEvaluationSlicesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/BatchImportModelEvaluationSlices', - $argument, - ['\Google\Cloud\AIPlatform\V1\BatchImportModelEvaluationSlicesResponse', 'decode'], - $metadata, $options); - } - - /** - * Imports a list of externally generated EvaluatedAnnotations. - * @param \Google\Cloud\AIPlatform\V1\BatchImportEvaluatedAnnotationsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function BatchImportEvaluatedAnnotations(\Google\Cloud\AIPlatform\V1\BatchImportEvaluatedAnnotationsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/BatchImportEvaluatedAnnotations', - $argument, - ['\Google\Cloud\AIPlatform\V1\BatchImportEvaluatedAnnotationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a ModelEvaluation. - * @param \Google\Cloud\AIPlatform\V1\GetModelEvaluationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetModelEvaluation(\Google\Cloud\AIPlatform\V1\GetModelEvaluationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/GetModelEvaluation', - $argument, - ['\Google\Cloud\AIPlatform\V1\ModelEvaluation', 'decode'], - $metadata, $options); - } - - /** - * Lists ModelEvaluations in a Model. - * @param \Google\Cloud\AIPlatform\V1\ListModelEvaluationsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListModelEvaluations(\Google\Cloud\AIPlatform\V1\ListModelEvaluationsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluations', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListModelEvaluationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a ModelEvaluationSlice. - * @param \Google\Cloud\AIPlatform\V1\GetModelEvaluationSliceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetModelEvaluationSlice(\Google\Cloud\AIPlatform\V1\GetModelEvaluationSliceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/GetModelEvaluationSlice', - $argument, - ['\Google\Cloud\AIPlatform\V1\ModelEvaluationSlice', 'decode'], - $metadata, $options); - } - - /** - * Lists ModelEvaluationSlices in a ModelEvaluation. - * @param \Google\Cloud\AIPlatform\V1\ListModelEvaluationSlicesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListModelEvaluationSlices(\Google\Cloud\AIPlatform\V1\ListModelEvaluationSlicesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluationSlices', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListModelEvaluationSlicesResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/ModelSourceInfo.php b/AiPlatform/src/V1/ModelSourceInfo.php index 42ef8a06c0e4..64cd00677481 100644 --- a/AiPlatform/src/V1/ModelSourceInfo.php +++ b/AiPlatform/src/V1/ModelSourceInfo.php @@ -20,7 +20,7 @@ class ModelSourceInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType source_type = 1; */ - private $source_type = 0; + protected $source_type = 0; /** * If this Model is copy of another Model. If true then * [source_type][google.cloud.aiplatform.v1.ModelSourceInfo.source_type] @@ -28,7 +28,7 @@ class ModelSourceInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool copy = 2; */ - private $copy = false; + protected $copy = false; /** * Constructor. diff --git a/AiPlatform/src/V1/MutateDeployedIndexOperationMetadata.php b/AiPlatform/src/V1/MutateDeployedIndexOperationMetadata.php index 5a5f217405ea..21262d06a69a 100644 --- a/AiPlatform/src/V1/MutateDeployedIndexOperationMetadata.php +++ b/AiPlatform/src/V1/MutateDeployedIndexOperationMetadata.php @@ -21,13 +21,13 @@ class MutateDeployedIndexOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * The unique index id specified by user * * Generated from protobuf field string deployed_index_id = 2; */ - private $deployed_index_id = ''; + protected $deployed_index_id = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/MutateDeployedIndexRequest.php b/AiPlatform/src/V1/MutateDeployedIndexRequest.php index 9127ab629377..36d175f20a78 100644 --- a/AiPlatform/src/V1/MutateDeployedIndexRequest.php +++ b/AiPlatform/src/V1/MutateDeployedIndexRequest.php @@ -23,7 +23,7 @@ class MutateDeployedIndexRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $index_endpoint = ''; + protected $index_endpoint = ''; /** * Required. The DeployedIndex to be updated within the IndexEndpoint. * Currently, the updatable fields are [DeployedIndex][automatic_resources] @@ -31,7 +31,7 @@ class MutateDeployedIndexRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedIndex deployed_index = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployed_index = null; + protected $deployed_index = null; /** * @param string $indexEndpoint Required. The name of the IndexEndpoint resource into which to deploy an diff --git a/AiPlatform/src/V1/MutateDeployedIndexResponse.php b/AiPlatform/src/V1/MutateDeployedIndexResponse.php index fa0760eeea78..28c82f3d6727 100644 --- a/AiPlatform/src/V1/MutateDeployedIndexResponse.php +++ b/AiPlatform/src/V1/MutateDeployedIndexResponse.php @@ -21,7 +21,7 @@ class MutateDeployedIndexResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedIndex deployed_index = 1; */ - private $deployed_index = null; + protected $deployed_index = null; /** * Constructor. diff --git a/AiPlatform/src/V1/MutateDeployedModelOperationMetadata.php b/AiPlatform/src/V1/MutateDeployedModelOperationMetadata.php index 2b176d7085a7..a90ec39619a7 100644 --- a/AiPlatform/src/V1/MutateDeployedModelOperationMetadata.php +++ b/AiPlatform/src/V1/MutateDeployedModelOperationMetadata.php @@ -21,7 +21,7 @@ class MutateDeployedModelOperationMetadata extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/MutateDeployedModelRequest.php b/AiPlatform/src/V1/MutateDeployedModelRequest.php index 0b77576556db..eca7a1d0a436 100644 --- a/AiPlatform/src/V1/MutateDeployedModelRequest.php +++ b/AiPlatform/src/V1/MutateDeployedModelRequest.php @@ -23,7 +23,7 @@ class MutateDeployedModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Required. The DeployedModel to be mutated within the Endpoint. Only the * following fields can be mutated: @@ -39,14 +39,14 @@ class MutateDeployedModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployed_model = null; + protected $deployed_model = null; /** * Required. The update mask applies to the resource. See * [google.protobuf.FieldMask][google.protobuf.FieldMask]. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param string $endpoint Required. The name of the Endpoint resource into which to mutate a diff --git a/AiPlatform/src/V1/MutateDeployedModelResponse.php b/AiPlatform/src/V1/MutateDeployedModelResponse.php index bb21a6c766eb..02ea51d2a1e3 100644 --- a/AiPlatform/src/V1/MutateDeployedModelResponse.php +++ b/AiPlatform/src/V1/MutateDeployedModelResponse.php @@ -21,7 +21,7 @@ class MutateDeployedModelResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DeployedModel deployed_model = 1; */ - private $deployed_model = null; + protected $deployed_model = null; /** * Constructor. diff --git a/AiPlatform/src/V1/NasJob.php b/AiPlatform/src/V1/NasJob.php index 8d066f83b5e0..8336936c13f3 100644 --- a/AiPlatform/src/V1/NasJob.php +++ b/AiPlatform/src/V1/NasJob.php @@ -20,7 +20,7 @@ class NasJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The display name of the NasJob. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -28,58 +28,58 @@ class NasJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Required. The specification of a NasJob. * * Generated from protobuf field .google.cloud.aiplatform.v1.NasJobSpec nas_job_spec = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $nas_job_spec = null; + protected $nas_job_spec = null; /** * Output only. Output of the NasJob. * * Generated from protobuf field .google.cloud.aiplatform.v1.NasJobOutput nas_job_output = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $nas_job_output = null; + protected $nas_job_output = null; /** * Output only. The detailed state of the job. * * Generated from protobuf field .google.cloud.aiplatform.v1.JobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Time when the NasJob was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time when the NasJob for the first time entered the * `JOB_STATE_RUNNING` state. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time when the NasJob entered any of the following states: * `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Time when the NasJob was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Only populated when job's state is JOB_STATE_FAILED or * JOB_STATE_CANCELLED. * * Generated from protobuf field .google.rpc.Status error = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * The labels with user-defined metadata to organize NasJobs. * Label keys and values can be no longer than 64 characters @@ -97,7 +97,7 @@ class NasJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 13; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Optional. Enable a separation of Custom model training * and restricted image training for tenant project. diff --git a/AiPlatform/src/V1/NasJobSpec.php b/AiPlatform/src/V1/NasJobSpec.php index f20b9d6998bb..d54b7d83386a 100644 --- a/AiPlatform/src/V1/NasJobSpec.php +++ b/AiPlatform/src/V1/NasJobSpec.php @@ -23,13 +23,13 @@ class NasJobSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string resume_nas_job_id = 3; */ - private $resume_nas_job_id = ''; + protected $resume_nas_job_id = ''; /** * It defines the search space for Neural Architecture Search (NAS). * * Generated from protobuf field string search_space_spec = 1; */ - private $search_space_spec = ''; + protected $search_space_spec = ''; protected $nas_algorithm_spec; /** diff --git a/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec.php b/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec.php index 16f0c87e8500..a281da5c6b84 100644 --- a/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec.php +++ b/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec.php @@ -21,20 +21,20 @@ class MultiTrialAlgorithmSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MultiTrialAlgorithm multi_trial_algorithm = 1; */ - private $multi_trial_algorithm = 0; + protected $multi_trial_algorithm = 0; /** * Metric specs for the NAS job. * Validation for this field is done at `multi_trial_algorithm_spec` field. * * Generated from protobuf field .google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec metric = 2; */ - private $metric = null; + protected $metric = null; /** * Required. Spec for search trials. * * Generated from protobuf field .google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.SearchTrialSpec search_trial_spec = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $search_trial_spec = null; + protected $search_trial_spec = null; /** * Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count] * search trials will be trained for every M @@ -42,7 +42,7 @@ class MultiTrialAlgorithmSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.TrainTrialSpec train_trial_spec = 4; */ - private $train_trial_spec = null; + protected $train_trial_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/MetricSpec.php b/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/MetricSpec.php index 4f63012015c7..5f6b311c9da5 100644 --- a/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/MetricSpec.php +++ b/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/MetricSpec.php @@ -20,13 +20,13 @@ class MetricSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metric_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $metric_id = ''; + protected $metric_id = ''; /** * Required. The optimization goal of the metric. * * Generated from protobuf field .google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec.GoalType goal = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $goal = 0; + protected $goal = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/SearchTrialSpec.php b/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/SearchTrialSpec.php index 8868685bf7d1..b17fbe4c6f9c 100644 --- a/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/SearchTrialSpec.php +++ b/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/SearchTrialSpec.php @@ -21,20 +21,20 @@ class SearchTrialSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.CustomJobSpec search_trial_job_spec = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $search_trial_job_spec = null; + protected $search_trial_job_spec = null; /** * Required. The maximum number of Neural Architecture Search (NAS) trials * to run. * * Generated from protobuf field int32 max_trial_count = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_trial_count = 0; + protected $max_trial_count = 0; /** * Required. The maximum number of trials to run in parallel. * * Generated from protobuf field int32 max_parallel_trial_count = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_parallel_trial_count = 0; + protected $max_parallel_trial_count = 0; /** * The number of failed trials that need to be seen before failing * the NasJob. @@ -43,7 +43,7 @@ class SearchTrialSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 max_failed_trial_count = 4; */ - private $max_failed_trial_count = 0; + protected $max_failed_trial_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/TrainTrialSpec.php b/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/TrainTrialSpec.php index 4d05fec877fb..e2ca699e1258 100644 --- a/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/TrainTrialSpec.php +++ b/AiPlatform/src/V1/NasJobSpec/MultiTrialAlgorithmSpec/TrainTrialSpec.php @@ -21,13 +21,13 @@ class TrainTrialSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.CustomJobSpec train_trial_job_spec = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $train_trial_job_spec = null; + protected $train_trial_job_spec = null; /** * Required. The maximum number of trials to run in parallel. * * Generated from protobuf field int32 max_parallel_trial_count = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_parallel_trial_count = 0; + protected $max_parallel_trial_count = 0; /** * Required. Frequency of search trials to start train stage. Top N * [TrainTrialSpec.max_parallel_trial_count] @@ -36,7 +36,7 @@ class TrainTrialSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 frequency = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $frequency = 0; + protected $frequency = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/NasTrial.php b/AiPlatform/src/V1/NasTrial.php index 11a8658154bc..d902f57a3342 100644 --- a/AiPlatform/src/V1/NasTrial.php +++ b/AiPlatform/src/V1/NasTrial.php @@ -20,32 +20,32 @@ class NasTrial extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $id = ''; + protected $id = ''; /** * Output only. The detailed state of the NasTrial. * * Generated from protobuf field .google.cloud.aiplatform.v1.NasTrial.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The final measurement containing the objective value. * * Generated from protobuf field .google.cloud.aiplatform.v1.Measurement final_measurement = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $final_measurement = null; + protected $final_measurement = null; /** * Output only. Time when the NasTrial was started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time when the NasTrial's status changed to `SUCCEEDED` or * `INFEASIBLE`. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/AiPlatform/src/V1/NasTrialDetail.php b/AiPlatform/src/V1/NasTrialDetail.php index f561c1453d95..031e875a2bb4 100644 --- a/AiPlatform/src/V1/NasTrialDetail.php +++ b/AiPlatform/src/V1/NasTrialDetail.php @@ -21,19 +21,19 @@ class NasTrialDetail extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * The parameters for the NasJob NasTrial. * * Generated from protobuf field string parameters = 2; */ - private $parameters = ''; + protected $parameters = ''; /** * The requested search NasTrial. * * Generated from protobuf field .google.cloud.aiplatform.v1.NasTrial search_trial = 3; */ - private $search_trial = null; + protected $search_trial = null; /** * The train NasTrial corresponding to * [search_trial][google.cloud.aiplatform.v1.NasTrialDetail.search_trial]. @@ -43,7 +43,7 @@ class NasTrialDetail extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.NasTrial train_trial = 4; */ - private $train_trial = null; + protected $train_trial = null; /** * Constructor. diff --git a/AiPlatform/src/V1/NearestNeighborQuery.php b/AiPlatform/src/V1/NearestNeighborQuery.php index 4dd061e872ae..6e527c3f9dec 100644 --- a/AiPlatform/src/V1/NearestNeighborQuery.php +++ b/AiPlatform/src/V1/NearestNeighborQuery.php @@ -21,7 +21,7 @@ class NearestNeighborQuery extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 neighbor_count = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $neighbor_count = 0; + protected $neighbor_count = 0; /** * Optional. The list of string filters. * @@ -36,13 +36,13 @@ class NearestNeighborQuery extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 per_crowding_attribute_neighbor_count = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $per_crowding_attribute_neighbor_count = 0; + protected $per_crowding_attribute_neighbor_count = 0; /** * Optional. Parameters that can be set to tune query on the fly. * * Generated from protobuf field .google.cloud.aiplatform.v1.NearestNeighborQuery.Parameters parameters = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $parameters = null; + protected $parameters = null; protected $instance; /** diff --git a/AiPlatform/src/V1/NearestNeighborQuery/Parameters.php b/AiPlatform/src/V1/NearestNeighborQuery/Parameters.php index d0fe3a1ad631..61782e69bc46 100644 --- a/AiPlatform/src/V1/NearestNeighborQuery/Parameters.php +++ b/AiPlatform/src/V1/NearestNeighborQuery/Parameters.php @@ -23,7 +23,7 @@ class Parameters extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 approximate_neighbor_candidates = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $approximate_neighbor_candidates = 0; + protected $approximate_neighbor_candidates = 0; /** * Optional. The fraction of the number of leaves to search, set at query * time allows user to tune search performance. This value increase result @@ -32,7 +32,7 @@ class Parameters extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double leaf_nodes_search_fraction = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $leaf_nodes_search_fraction = 0.0; + protected $leaf_nodes_search_fraction = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/NearestNeighborQuery/StringFilter.php b/AiPlatform/src/V1/NearestNeighborQuery/StringFilter.php index 74ed5fb4b40c..3e39be2aefbf 100644 --- a/AiPlatform/src/V1/NearestNeighborQuery/StringFilter.php +++ b/AiPlatform/src/V1/NearestNeighborQuery/StringFilter.php @@ -27,7 +27,7 @@ class StringFilter extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. The allowed tokens. * diff --git a/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata.php b/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata.php index f736938b9b45..3cc0969f3b97 100644 --- a/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata.php +++ b/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata.php @@ -31,7 +31,7 @@ class NearestNeighborSearchOperationMetadata extends \Google\Protobuf\Internal\M * * Generated from protobuf field int64 data_bytes_count = 2; */ - private $data_bytes_count = 0; + protected $data_bytes_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/ContentValidationStats.php b/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/ContentValidationStats.php index 573f0355163b..9eb81cfaab91 100644 --- a/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/ContentValidationStats.php +++ b/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/ContentValidationStats.php @@ -18,19 +18,19 @@ class ContentValidationStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source_gcs_uri = 1; */ - private $source_gcs_uri = ''; + protected $source_gcs_uri = ''; /** * Number of records in this file that were successfully processed. * * Generated from protobuf field int64 valid_record_count = 2; */ - private $valid_record_count = 0; + protected $valid_record_count = 0; /** * Number of records in this file we skipped due to validate errors. * * Generated from protobuf field int64 invalid_record_count = 3; */ - private $invalid_record_count = 0; + protected $invalid_record_count = 0; /** * The detail information of the partial failures encountered for those * invalid records that couldn't be parsed. @@ -39,6 +39,18 @@ class ContentValidationStats extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata.RecordError partial_errors = 4; */ private $partial_errors; + /** + * Number of sparse records in this file that were successfully processed. + * + * Generated from protobuf field int64 valid_sparse_record_count = 5; + */ + protected $valid_sparse_record_count = 0; + /** + * Number of sparse records in this file we skipped due to validate errors. + * + * Generated from protobuf field int64 invalid_sparse_record_count = 6; + */ + protected $invalid_sparse_record_count = 0; /** * Constructor. @@ -56,6 +68,10 @@ class ContentValidationStats extends \Google\Protobuf\Internal\Message * The detail information of the partial failures encountered for those * invalid records that couldn't be parsed. * Up to 50 partial errors will be reported. + * @type int|string $valid_sparse_record_count + * Number of sparse records in this file that were successfully processed. + * @type int|string $invalid_sparse_record_count + * Number of sparse records in this file we skipped due to validate errors. * } */ public function __construct($data = NULL) { @@ -171,6 +187,58 @@ public function setPartialErrors($var) return $this; } + /** + * Number of sparse records in this file that were successfully processed. + * + * Generated from protobuf field int64 valid_sparse_record_count = 5; + * @return int|string + */ + public function getValidSparseRecordCount() + { + return $this->valid_sparse_record_count; + } + + /** + * Number of sparse records in this file that were successfully processed. + * + * Generated from protobuf field int64 valid_sparse_record_count = 5; + * @param int|string $var + * @return $this + */ + public function setValidSparseRecordCount($var) + { + GPBUtil::checkInt64($var); + $this->valid_sparse_record_count = $var; + + return $this; + } + + /** + * Number of sparse records in this file we skipped due to validate errors. + * + * Generated from protobuf field int64 invalid_sparse_record_count = 6; + * @return int|string + */ + public function getInvalidSparseRecordCount() + { + return $this->invalid_sparse_record_count; + } + + /** + * Number of sparse records in this file we skipped due to validate errors. + * + * Generated from protobuf field int64 invalid_sparse_record_count = 6; + * @param int|string $var + * @return $this + */ + public function setInvalidSparseRecordCount($var) + { + GPBUtil::checkInt64($var); + $this->invalid_sparse_record_count = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/RecordError.php b/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/RecordError.php index 602d298d20c7..7ba5bc4af61d 100644 --- a/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/RecordError.php +++ b/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/RecordError.php @@ -18,7 +18,7 @@ class RecordError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata.RecordError.RecordErrorType error_type = 1; */ - private $error_type = 0; + protected $error_type = 0; /** * A human-readable message that is shown to the user to help them fix the * error. Note that this message may change from time to time, your code @@ -26,25 +26,25 @@ class RecordError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string error_message = 2; */ - private $error_message = ''; + protected $error_message = ''; /** * Cloud Storage URI pointing to the original file in user's bucket. * * Generated from protobuf field string source_gcs_uri = 3; */ - private $source_gcs_uri = ''; + protected $source_gcs_uri = ''; /** * Empty if the embedding id is failed to parse. * * Generated from protobuf field string embedding_id = 4; */ - private $embedding_id = ''; + protected $embedding_id = ''; /** * The original content of this record. * * Generated from protobuf field string raw_record = 5; */ - private $raw_record = ''; + protected $raw_record = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/RecordError/RecordErrorType.php b/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/RecordError/RecordErrorType.php index f67d8820d9e3..5b56ba863de7 100644 --- a/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/RecordError/RecordErrorType.php +++ b/AiPlatform/src/V1/NearestNeighborSearchOperationMetadata/RecordError/RecordErrorType.php @@ -48,8 +48,8 @@ class RecordErrorType */ const INVALID_EMBEDDING_ID = 5; /** - * The size of the embedding vectors does not match with the specified - * dimension. + * The size of the dense embedding vectors does not match with the + * specified dimension. * * Generated from protobuf enum EMBEDDING_SIZE_MISMATCH = 6; */ @@ -97,6 +97,30 @@ class RecordErrorType * Generated from protobuf enum INVALID_ENCODING = 13; */ const INVALID_ENCODING = 13; + /** + * Error parsing sparse dimensions field. + * + * Generated from protobuf enum INVALID_SPARSE_DIMENSIONS = 14; + */ + const INVALID_SPARSE_DIMENSIONS = 14; + /** + * Token restrict value is invalid. + * + * Generated from protobuf enum INVALID_TOKEN_VALUE = 15; + */ + const INVALID_TOKEN_VALUE = 15; + /** + * Invalid sparse embedding. + * + * Generated from protobuf enum INVALID_SPARSE_EMBEDDING = 16; + */ + const INVALID_SPARSE_EMBEDDING = 16; + /** + * Invalid dense embedding. + * + * Generated from protobuf enum INVALID_EMBEDDING = 17; + */ + const INVALID_EMBEDDING = 17; private static $valueToName = [ self::ERROR_TYPE_UNSPECIFIED => 'ERROR_TYPE_UNSPECIFIED', @@ -113,6 +137,10 @@ class RecordErrorType self::MULTIPLE_VALUES => 'MULTIPLE_VALUES', self::INVALID_NUMERIC_VALUE => 'INVALID_NUMERIC_VALUE', self::INVALID_ENCODING => 'INVALID_ENCODING', + self::INVALID_SPARSE_DIMENSIONS => 'INVALID_SPARSE_DIMENSIONS', + self::INVALID_TOKEN_VALUE => 'INVALID_TOKEN_VALUE', + self::INVALID_SPARSE_EMBEDDING => 'INVALID_SPARSE_EMBEDDING', + self::INVALID_EMBEDDING => 'INVALID_EMBEDDING', ]; public static function name($value) diff --git a/AiPlatform/src/V1/NearestNeighbors/Neighbor.php b/AiPlatform/src/V1/NearestNeighbors/Neighbor.php index 5b81e6c5ccfc..22b7fcde8dbd 100644 --- a/AiPlatform/src/V1/NearestNeighbors/Neighbor.php +++ b/AiPlatform/src/V1/NearestNeighbors/Neighbor.php @@ -20,13 +20,13 @@ class Neighbor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_id = 1; */ - private $entity_id = ''; + protected $entity_id = ''; /** * The distance between the neighbor and the query vector. * * Generated from protobuf field double distance = 2; */ - private $distance = 0.0; + protected $distance = 0.0; /** * The attributes of the neighbor, e.g. filters, crowding and metadata * Note that full entities are returned only when "return_full_entity" @@ -35,7 +35,7 @@ class Neighbor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FetchFeatureValuesResponse entity_key_values = 3; */ - private $entity_key_values = null; + protected $entity_key_values = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Neighbor.php b/AiPlatform/src/V1/Neighbor.php index 9b5f6c96a2d0..7ed5352a8dda 100644 --- a/AiPlatform/src/V1/Neighbor.php +++ b/AiPlatform/src/V1/Neighbor.php @@ -20,13 +20,13 @@ class Neighbor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $neighbor_id = ''; + protected $neighbor_id = ''; /** * Output only. The neighbor distance. * * Generated from protobuf field double neighbor_distance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $neighbor_distance = 0.0; + protected $neighbor_distance = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/NetworkSpec.php b/AiPlatform/src/V1/NetworkSpec.php index ec4e2234714b..ecdb76c73b77 100644 --- a/AiPlatform/src/V1/NetworkSpec.php +++ b/AiPlatform/src/V1/NetworkSpec.php @@ -20,14 +20,14 @@ class NetworkSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_internet_access = 1; */ - private $enable_internet_access = false; + protected $enable_internet_access = false; /** * The full name of the Google Compute Engine * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) * * Generated from protobuf field string network = 2 [(.google.api.resource_reference) = { */ - private $network = ''; + protected $network = ''; /** * The name of the subnet that this instance is in. * Format: @@ -35,7 +35,7 @@ class NetworkSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string subnetwork = 3 [(.google.api.resource_reference) = { */ - private $subnetwork = ''; + protected $subnetwork = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/NfsMount.php b/AiPlatform/src/V1/NfsMount.php index d22ad9d916d1..b1b11b26b5ad 100644 --- a/AiPlatform/src/V1/NfsMount.php +++ b/AiPlatform/src/V1/NfsMount.php @@ -20,7 +20,7 @@ class NfsMount extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string server = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $server = ''; + protected $server = ''; /** * Required. Source path exported from NFS server. * Has to start with '/', and combined with the ip address, it indicates @@ -28,14 +28,14 @@ class NfsMount extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Required. Destination mount path. The NFS will be mounted for the user * under /mnt/nfs/ * * Generated from protobuf field string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $mount_point = ''; + protected $mount_point = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/NotebookEucConfig.php b/AiPlatform/src/V1/NotebookEucConfig.php index c8a7ee268192..cc1758b89cf2 100644 --- a/AiPlatform/src/V1/NotebookEucConfig.php +++ b/AiPlatform/src/V1/NotebookEucConfig.php @@ -22,7 +22,7 @@ class NotebookEucConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool euc_disabled = 1 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $euc_disabled = false; + protected $euc_disabled = false; /** * Output only. Whether ActAs check is bypassed for service account attached * to the VM. If false, we need ActAs check for the default Compute Engine @@ -34,7 +34,7 @@ class NotebookEucConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool bypass_actas_check = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $bypass_actas_check = false; + protected $bypass_actas_check = false; /** * Constructor. diff --git a/AiPlatform/src/V1/NotebookIdleShutdownConfig.php b/AiPlatform/src/V1/NotebookIdleShutdownConfig.php index b418f7c370ce..012706eb54b8 100644 --- a/AiPlatform/src/V1/NotebookIdleShutdownConfig.php +++ b/AiPlatform/src/V1/NotebookIdleShutdownConfig.php @@ -23,13 +23,13 @@ class NotebookIdleShutdownConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration idle_timeout = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $idle_timeout = null; + protected $idle_timeout = null; /** * Whether Idle Shutdown is disabled in this NotebookRuntimeTemplate. * * Generated from protobuf field bool idle_shutdown_disabled = 2; */ - private $idle_shutdown_disabled = false; + protected $idle_shutdown_disabled = false; /** * Constructor. diff --git a/AiPlatform/src/V1/NotebookRuntime.php b/AiPlatform/src/V1/NotebookRuntime.php index 64f24d6ed899..b7e1dde9a37e 100644 --- a/AiPlatform/src/V1/NotebookRuntime.php +++ b/AiPlatform/src/V1/NotebookRuntime.php @@ -22,44 +22,44 @@ class NotebookRuntime extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The user email of the NotebookRuntime. * * Generated from protobuf field string runtime_user = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $runtime_user = ''; + protected $runtime_user = ''; /** * Output only. The pointer to NotebookRuntimeTemplate this NotebookRuntime is * created from. * * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntimeTemplateRef notebook_runtime_template_ref = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $notebook_runtime_template_ref = null; + protected $notebook_runtime_template_ref = null; /** * Output only. The proxy endpoint used to access the NotebookRuntime. * * Generated from protobuf field string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $proxy_uri = ''; + protected $proxy_uri = ''; /** * Output only. Timestamp when this NotebookRuntime was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this NotebookRuntime was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. The health state of the NotebookRuntime. * * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntime.HealthState health_state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $health_state = 0; + protected $health_state = 0; /** * Required. The display name of the NotebookRuntime. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -67,31 +67,31 @@ class NotebookRuntime extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 10 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * The description of the NotebookRuntime. * * Generated from protobuf field string description = 11; */ - private $description = ''; + protected $description = ''; /** * Output only. The service account that the NotebookRuntime workload runs as. * * Generated from protobuf field string service_account = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service_account = ''; + protected $service_account = ''; /** * Output only. The runtime (instance) state of the NotebookRuntime. * * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntime.RuntimeState runtime_state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $runtime_state = 0; + protected $runtime_state = 0; /** * Output only. Whether NotebookRuntime is upgradable. * * Generated from protobuf field bool is_upgradable = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $is_upgradable = false; + protected $is_upgradable = false; /** * The labels with user-defined metadata to organize your * NotebookRuntime. @@ -121,19 +121,25 @@ class NotebookRuntime extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $expiration_time = null; + protected $expiration_time = null; /** * Output only. The VM os image version of NotebookRuntime. * * Generated from protobuf field string version = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $version = ''; + protected $version = ''; /** * Output only. The type of the notebook runtime. * * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntimeType notebook_runtime_type = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $notebook_runtime_type = 0; + protected $notebook_runtime_type = 0; + /** + * Output only. The idle shutdown configuration of the notebook runtime. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookIdleShutdownConfig idle_shutdown_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $idle_shutdown_config = null; /** * Optional. The Compute Engine tags to add to runtime (see [Tagging * instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). @@ -141,6 +147,24 @@ class NotebookRuntime extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated string network_tags = 25 [(.google.api.field_behavior) = OPTIONAL]; */ private $network_tags; + /** + * Output only. Customer-managed encryption key spec for the notebook runtime. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_spec = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = false; /** * Constructor. @@ -201,9 +225,17 @@ class NotebookRuntime extends \Google\Protobuf\Internal\Message * Output only. The VM os image version of NotebookRuntime. * @type int $notebook_runtime_type * Output only. The type of the notebook runtime. + * @type \Google\Cloud\AIPlatform\V1\NotebookIdleShutdownConfig $idle_shutdown_config + * Output only. The idle shutdown configuration of the notebook runtime. * @type array|\Google\Protobuf\Internal\RepeatedField $network_tags * Optional. The Compute Engine tags to add to runtime (see [Tagging * instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). + * @type \Google\Cloud\AIPlatform\V1\EncryptionSpec $encryption_spec + * Output only. Customer-managed encryption key spec for the notebook runtime. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. * } */ public function __construct($data = NULL) { @@ -709,6 +741,42 @@ public function setNotebookRuntimeType($var) return $this; } + /** + * Output only. The idle shutdown configuration of the notebook runtime. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookIdleShutdownConfig idle_shutdown_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AIPlatform\V1\NotebookIdleShutdownConfig|null + */ + public function getIdleShutdownConfig() + { + return $this->idle_shutdown_config; + } + + public function hasIdleShutdownConfig() + { + return isset($this->idle_shutdown_config); + } + + public function clearIdleShutdownConfig() + { + unset($this->idle_shutdown_config); + } + + /** + * Output only. The idle shutdown configuration of the notebook runtime. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookIdleShutdownConfig idle_shutdown_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AIPlatform\V1\NotebookIdleShutdownConfig $var + * @return $this + */ + public function setIdleShutdownConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\NotebookIdleShutdownConfig::class); + $this->idle_shutdown_config = $var; + + return $this; + } + /** * Optional. The Compute Engine tags to add to runtime (see [Tagging * instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). @@ -737,5 +805,93 @@ public function setNetworkTags($var) return $this; } + /** + * Output only. Customer-managed encryption key spec for the notebook runtime. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AIPlatform\V1\EncryptionSpec|null + */ + public function getEncryptionSpec() + { + return $this->encryption_spec; + } + + public function hasEncryptionSpec() + { + return isset($this->encryption_spec); + } + + public function clearEncryptionSpec() + { + unset($this->encryption_spec); + } + + /** + * Output only. Customer-managed encryption key spec for the notebook runtime. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AIPlatform\V1\EncryptionSpec $var + * @return $this + */ + public function setEncryptionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\EncryptionSpec::class); + $this->encryption_spec = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return $this->satisfies_pzi; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/NotebookRuntimeTemplate.php b/AiPlatform/src/V1/NotebookRuntimeTemplate.php index bbf5c92fdc96..be48eae24404 100644 --- a/AiPlatform/src/V1/NotebookRuntimeTemplate.php +++ b/AiPlatform/src/V1/NotebookRuntimeTemplate.php @@ -18,11 +18,11 @@ class NotebookRuntimeTemplate extends \Google\Protobuf\Internal\Message { /** - * Output only. The resource name of the NotebookRuntimeTemplate. + * The resource name of the NotebookRuntimeTemplate. * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Required. The display name of the NotebookRuntimeTemplate. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -30,26 +30,26 @@ class NotebookRuntimeTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * The description of the NotebookRuntimeTemplate. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Output only. The default template to use if not specified. * * Generated from protobuf field bool is_default = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $is_default = false; + protected $is_default = false; /** * Optional. Immutable. The specification of a single machine for the * template. * * Generated from protobuf field .google.cloud.aiplatform.v1.MachineSpec machine_spec = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; */ - private $machine_spec = null; + protected $machine_spec = null; /** * Optional. The specification of [persistent * disk][https://cloud.google.com/compute/docs/disks/persistent-disks] @@ -57,13 +57,13 @@ class NotebookRuntimeTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PersistentDiskSpec data_persistent_disk_spec = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $data_persistent_disk_spec = null; + protected $data_persistent_disk_spec = null; /** * Optional. Network spec. * * Generated from protobuf field .google.cloud.aiplatform.v1.NetworkSpec network_spec = 12 [(.google.api.field_behavior) = OPTIONAL]; */ - private $network_spec = null; + protected $network_spec = null; /** * The service account that the runtime workload runs as. * You can use any service account within the same project, but you @@ -74,14 +74,14 @@ class NotebookRuntimeTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 13; */ - private $service_account = ''; + protected $service_account = ''; /** * Used to perform consistent read-modify-write updates. If not set, a blind * "overwrite" update happens. * * Generated from protobuf field string etag = 14; */ - private $etag = ''; + protected $etag = ''; /** * The labels with user-defined metadata to organize the * NotebookRuntimeTemplates. @@ -99,38 +99,38 @@ class NotebookRuntimeTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookIdleShutdownConfig idle_shutdown_config = 17; */ - private $idle_shutdown_config = null; + protected $idle_shutdown_config = null; /** * EUC configuration of the NotebookRuntimeTemplate. * * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookEucConfig euc_config = 18; */ - private $euc_config = null; + protected $euc_config = null; /** * Output only. Timestamp when this NotebookRuntimeTemplate was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this NotebookRuntimeTemplate was most recently * updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Immutable. The type of the notebook runtime template. * * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntimeType notebook_runtime_type = 19 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; */ - private $notebook_runtime_type = 0; + protected $notebook_runtime_type = 0; /** * Optional. Immutable. Runtime Shielded VM spec. * * Generated from protobuf field .google.cloud.aiplatform.v1.ShieldedVmConfig shielded_vm_config = 20 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; */ - private $shielded_vm_config = null; + protected $shielded_vm_config = null; /** * Optional. The Compute Engine tags to add to runtime (see [Tagging * instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). @@ -138,6 +138,12 @@ class NotebookRuntimeTemplate extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated string network_tags = 21 [(.google.api.field_behavior) = OPTIONAL]; */ private $network_tags; + /** + * Customer-managed encryption key spec for the notebook runtime. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 23; + */ + protected $encryption_spec = null; /** * Constructor. @@ -146,7 +152,7 @@ class NotebookRuntimeTemplate extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Output only. The resource name of the NotebookRuntimeTemplate. + * The resource name of the NotebookRuntimeTemplate. * @type string $display_name * Required. The display name of the NotebookRuntimeTemplate. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -198,6 +204,8 @@ class NotebookRuntimeTemplate extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\RepeatedField $network_tags * Optional. The Compute Engine tags to add to runtime (see [Tagging * instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). + * @type \Google\Cloud\AIPlatform\V1\EncryptionSpec $encryption_spec + * Customer-managed encryption key spec for the notebook runtime. * } */ public function __construct($data = NULL) { @@ -206,9 +214,9 @@ public function __construct($data = NULL) { } /** - * Output only. The resource name of the NotebookRuntimeTemplate. + * The resource name of the NotebookRuntimeTemplate. * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string name = 1; * @return string */ public function getName() @@ -217,9 +225,9 @@ public function getName() } /** - * Output only. The resource name of the NotebookRuntimeTemplate. + * The resource name of the NotebookRuntimeTemplate. * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string name = 1; * @param string $var * @return $this */ @@ -765,5 +773,41 @@ public function setNetworkTags($var) return $this; } + /** + * Customer-managed encryption key spec for the notebook runtime. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 23; + * @return \Google\Cloud\AIPlatform\V1\EncryptionSpec|null + */ + public function getEncryptionSpec() + { + return $this->encryption_spec; + } + + public function hasEncryptionSpec() + { + return isset($this->encryption_spec); + } + + public function clearEncryptionSpec() + { + unset($this->encryption_spec); + } + + /** + * Customer-managed encryption key spec for the notebook runtime. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 23; + * @param \Google\Cloud\AIPlatform\V1\EncryptionSpec $var + * @return $this + */ + public function setEncryptionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\EncryptionSpec::class); + $this->encryption_spec = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/NotebookRuntimeTemplateRef.php b/AiPlatform/src/V1/NotebookRuntimeTemplateRef.php index c25187dc2d1e..0061713944c1 100644 --- a/AiPlatform/src/V1/NotebookRuntimeTemplateRef.php +++ b/AiPlatform/src/V1/NotebookRuntimeTemplateRef.php @@ -20,7 +20,7 @@ class NotebookRuntimeTemplateRef extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string notebook_runtime_template = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $notebook_runtime_template = ''; + protected $notebook_runtime_template = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/NotebookServiceClient.php b/AiPlatform/src/V1/NotebookServiceClient.php deleted file mode 100644 index fd2e95bbb0a2..000000000000 --- a/AiPlatform/src/V1/NotebookServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the ModelDeploymentMonitoringJob to pause. diff --git a/AiPlatform/src/V1/PauseScheduleRequest.php b/AiPlatform/src/V1/PauseScheduleRequest.php index 5b9a213493f3..b041afecb65a 100644 --- a/AiPlatform/src/V1/PauseScheduleRequest.php +++ b/AiPlatform/src/V1/PauseScheduleRequest.php @@ -23,7 +23,7 @@ class PauseScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Schedule resource to be paused. diff --git a/AiPlatform/src/V1/PersistentDiskSpec.php b/AiPlatform/src/V1/PersistentDiskSpec.php index 0487c4cfeaae..83a6db5c472d 100644 --- a/AiPlatform/src/V1/PersistentDiskSpec.php +++ b/AiPlatform/src/V1/PersistentDiskSpec.php @@ -25,13 +25,13 @@ class PersistentDiskSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string disk_type = 1; */ - private $disk_type = ''; + protected $disk_type = ''; /** * Size in GB of the disk (default is 100GB). * * Generated from protobuf field int64 disk_size_gb = 2; */ - private $disk_size_gb = 0; + protected $disk_size_gb = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/PersistentResource.php b/AiPlatform/src/V1/PersistentResource.php index a58d3e2d1662..e8a7e58fc0dd 100644 --- a/AiPlatform/src/V1/PersistentResource.php +++ b/AiPlatform/src/V1/PersistentResource.php @@ -23,7 +23,7 @@ class PersistentResource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Optional. The display name of the PersistentResource. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -31,7 +31,7 @@ class PersistentResource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Required. The spec of the pools of different resources. * @@ -43,33 +43,33 @@ class PersistentResource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PersistentResource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Only populated when persistent resource's state is `STOPPING` * or `ERROR`. * * Generated from protobuf field .google.rpc.Status error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Output only. Time when the PersistentResource was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time when the PersistentResource for the first time entered * the `RUNNING` state. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time when the PersistentResource was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. The labels with user-defined metadata to organize * PersistentResource. @@ -83,10 +83,10 @@ class PersistentResource extends \Google\Protobuf\Internal\Message private $labels; /** * Optional. The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to peered with + * [network](/compute/docs/networks-and-firewalls#networks) to peered with * Vertex AI to host the persistent resources. * For example, `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. @@ -98,7 +98,7 @@ class PersistentResource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $network = ''; + protected $network = ''; /** * Optional. Customer-managed encryption key spec for a PersistentResource. * If set, this PersistentResource and all sub-resources of this @@ -106,20 +106,20 @@ class PersistentResource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 12 [(.google.api.field_behavior) = OPTIONAL]; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Optional. Persistent Resource runtime spec. * For example, used for Ray cluster configuration. * * Generated from protobuf field .google.cloud.aiplatform.v1.ResourceRuntimeSpec resource_runtime_spec = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $resource_runtime_spec = null; + protected $resource_runtime_spec = null; /** * Output only. Runtime information of the Persistent Resource. * * Generated from protobuf field .google.cloud.aiplatform.v1.ResourceRuntime resource_runtime = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $resource_runtime = null; + protected $resource_runtime = null; /** * Optional. A list of names for the reserved IP ranges under the VPC network * that can be used for this persistent resource. @@ -167,10 +167,10 @@ class PersistentResource extends \Google\Protobuf\Internal\Message * See https://goo.gl/xmQnxf for more information and examples of labels. * @type string $network * Optional. The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to peered with + * [network](/compute/docs/networks-and-firewalls#networks) to peered with * Vertex AI to host the persistent resources. * For example, `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. @@ -496,10 +496,10 @@ public function setLabels($var) /** * Optional. The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to peered with + * [network](/compute/docs/networks-and-firewalls#networks) to peered with * Vertex AI to host the persistent resources. * For example, `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. @@ -519,10 +519,10 @@ public function getNetwork() /** * Optional. The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to peered with + * [network](/compute/docs/networks-and-firewalls#networks) to peered with * Vertex AI to host the persistent resources. * For example, `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. diff --git a/AiPlatform/src/V1/PersistentResourceServiceClient.php b/AiPlatform/src/V1/PersistentResourceServiceClient.php deleted file mode 100644 index 1d1f41c667c9..000000000000 --- a/AiPlatform/src/V1/PersistentResourceServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * The display name of the Pipeline. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -28,56 +28,56 @@ class PipelineJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. Pipeline creation time. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Pipeline start time. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Pipeline end time. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Timestamp when this PipelineJob was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The spec of the pipeline. * * Generated from protobuf field .google.protobuf.Struct pipeline_spec = 7; */ - private $pipeline_spec = null; + protected $pipeline_spec = null; /** * Output only. The detailed state of the job. * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The details of pipeline run. Not available in the list view. * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineJobDetail job_detail = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $job_detail = null; + protected $job_detail = null; /** * Output only. The error that occurred during pipeline execution. * Only populated when the pipeline's state is FAILED or CANCELLED. * * Generated from protobuf field .google.rpc.Status error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * The labels with user-defined metadata to organize PipelineJob. * Label keys and values can be no longer than 64 characters @@ -95,14 +95,14 @@ class PipelineJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig runtime_config = 12; */ - private $runtime_config = null; + protected $runtime_config = null; /** * Customer-managed encryption key spec for a pipelineJob. If set, this * PipelineJob and all of its sub-resources will be secured by this key. * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 16; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * The service account that the pipeline workload runs as. * If not specified, the Compute Engine default service account in the project @@ -114,13 +114,13 @@ class PipelineJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 17; */ - private $service_account = ''; + protected $service_account = ''; /** * The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the + * [network](/compute/docs/networks-and-firewalls#networks) to which the * Pipeline Job's workload should be peered. For example, * `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. @@ -132,7 +132,7 @@ class PipelineJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 18 [(.google.api.resource_reference) = { */ - private $network = ''; + protected $network = ''; /** * A list of names for the reserved ip ranges under the VPC network * that can be used for this Pipeline Job's workload. @@ -153,7 +153,7 @@ class PipelineJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string template_uri = 19; */ - private $template_uri = ''; + protected $template_uri = ''; /** * Output only. Pipeline template metadata. Will fill up fields if * [PipelineJob.template_uri][google.cloud.aiplatform.v1.PipelineJob.template_uri] @@ -161,14 +161,14 @@ class PipelineJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineTemplateMetadata template_metadata = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $template_metadata = null; + protected $template_metadata = null; /** * Output only. The schedule resource name. * Only returned if the Pipeline is created by Schedule API. * * Generated from protobuf field string schedule_name = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $schedule_name = ''; + protected $schedule_name = ''; /** * Constructor. @@ -222,10 +222,10 @@ class PipelineJob extends \Google\Protobuf\Internal\Message * permission on this service account. * @type string $network * The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the + * [network](/compute/docs/networks-and-firewalls#networks) to which the * Pipeline Job's workload should be peered. For example, * `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. @@ -749,10 +749,10 @@ public function setServiceAccount($var) /** * The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the + * [network](/compute/docs/networks-and-firewalls#networks) to which the * Pipeline Job's workload should be peered. For example, * `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. @@ -772,10 +772,10 @@ public function getNetwork() /** * The full name of the Compute Engine - * [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the + * [network](/compute/docs/networks-and-firewalls#networks) to which the * Pipeline Job's workload should be peered. For example, * `projects/12345/global/networks/myVPC`. - * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert) + * [Format](/compute/docs/reference/rest/v1/networks/insert) * is of the form `projects/{project}/global/networks/{network}`. * Where {project} is a project number, as in `12345`, and {network} is a * network name. diff --git a/AiPlatform/src/V1/PipelineJob/RuntimeConfig.php b/AiPlatform/src/V1/PipelineJob/RuntimeConfig.php index 3daf8644c22c..47eee6655fb9 100644 --- a/AiPlatform/src/V1/PipelineJob/RuntimeConfig.php +++ b/AiPlatform/src/V1/PipelineJob/RuntimeConfig.php @@ -40,7 +40,7 @@ class RuntimeConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string gcs_output_directory = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $gcs_output_directory = ''; + protected $gcs_output_directory = ''; /** * The runtime parameters of the PipelineJob. The parameters will be * passed into @@ -63,7 +63,7 @@ class RuntimeConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineFailurePolicy failure_policy = 4; */ - private $failure_policy = 0; + protected $failure_policy = 0; /** * The runtime artifacts of the PipelineJob. The key will be the input * artifact name and the value would be one of the InputArtifact. diff --git a/AiPlatform/src/V1/PipelineJobDetail.php b/AiPlatform/src/V1/PipelineJobDetail.php index 6892ed9b0037..4371fc9f412b 100644 --- a/AiPlatform/src/V1/PipelineJobDetail.php +++ b/AiPlatform/src/V1/PipelineJobDetail.php @@ -20,13 +20,13 @@ class PipelineJobDetail extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Context pipeline_context = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $pipeline_context = null; + protected $pipeline_context = null; /** * Output only. The context of the current pipeline run. * * Generated from protobuf field .google.cloud.aiplatform.v1.Context pipeline_run_context = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $pipeline_run_context = null; + protected $pipeline_run_context = null; /** * Output only. The runtime details of the tasks under the pipeline. * diff --git a/AiPlatform/src/V1/PipelineServiceClient.php b/AiPlatform/src/V1/PipelineServiceClient.php deleted file mode 100644 index 601a3df96da0..000000000000 --- a/AiPlatform/src/V1/PipelineServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/CreateTrainingPipeline', - $argument, - ['\Google\Cloud\AIPlatform\V1\TrainingPipeline', 'decode'], - $metadata, $options); - } - - /** - * Gets a TrainingPipeline. - * @param \Google\Cloud\AIPlatform\V1\GetTrainingPipelineRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTrainingPipeline(\Google\Cloud\AIPlatform\V1\GetTrainingPipelineRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/GetTrainingPipeline', - $argument, - ['\Google\Cloud\AIPlatform\V1\TrainingPipeline', 'decode'], - $metadata, $options); - } - - /** - * Lists TrainingPipelines in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListTrainingPipelinesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTrainingPipelines(\Google\Cloud\AIPlatform\V1\ListTrainingPipelinesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/ListTrainingPipelines', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListTrainingPipelinesResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a TrainingPipeline. - * @param \Google\Cloud\AIPlatform\V1\DeleteTrainingPipelineRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTrainingPipeline(\Google\Cloud\AIPlatform\V1\DeleteTrainingPipelineRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/DeleteTrainingPipeline', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Cancels a TrainingPipeline. - * Starts asynchronous cancellation on the TrainingPipeline. The server - * makes a best effort to cancel the pipeline, but success is not - * guaranteed. Clients can use - * [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline] - * or other methods to check whether the cancellation succeeded or whether the - * pipeline completed despite cancellation. On successful cancellation, - * the TrainingPipeline is not deleted; instead it becomes a pipeline with - * a - * [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error] - * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`, and - * [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] - * is set to `CANCELLED`. - * @param \Google\Cloud\AIPlatform\V1\CancelTrainingPipelineRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelTrainingPipeline(\Google\Cloud\AIPlatform\V1\CancelTrainingPipelineRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/CancelTrainingPipeline', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates a PipelineJob. A PipelineJob will run immediately when created. - * @param \Google\Cloud\AIPlatform\V1\CreatePipelineJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreatePipelineJob(\Google\Cloud\AIPlatform\V1\CreatePipelineJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/CreatePipelineJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\PipelineJob', 'decode'], - $metadata, $options); - } - - /** - * Gets a PipelineJob. - * @param \Google\Cloud\AIPlatform\V1\GetPipelineJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetPipelineJob(\Google\Cloud\AIPlatform\V1\GetPipelineJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/GetPipelineJob', - $argument, - ['\Google\Cloud\AIPlatform\V1\PipelineJob', 'decode'], - $metadata, $options); - } - - /** - * Lists PipelineJobs in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListPipelineJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPipelineJobs(\Google\Cloud\AIPlatform\V1\ListPipelineJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/ListPipelineJobs', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListPipelineJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a PipelineJob. - * @param \Google\Cloud\AIPlatform\V1\DeletePipelineJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeletePipelineJob(\Google\Cloud\AIPlatform\V1\DeletePipelineJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/DeletePipelineJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Cancels a PipelineJob. - * Starts asynchronous cancellation on the PipelineJob. The server - * makes a best effort to cancel the pipeline, but success is not - * guaranteed. Clients can use - * [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob] - * or other methods to check whether the cancellation succeeded or whether the - * pipeline completed despite cancellation. On successful cancellation, - * the PipelineJob is not deleted; instead it becomes a pipeline with - * a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error] value - * with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding - * to `Code.CANCELLED`, and - * [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set to - * `CANCELLED`. - * @param \Google\Cloud\AIPlatform\V1\CancelPipelineJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelPipelineJob(\Google\Cloud\AIPlatform\V1\CancelPipelineJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PipelineService/CancelPipelineJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/PipelineTaskDetail.php b/AiPlatform/src/V1/PipelineTaskDetail.php index c11bebe40378..a50bd22cfa69 100644 --- a/AiPlatform/src/V1/PipelineTaskDetail.php +++ b/AiPlatform/src/V1/PipelineTaskDetail.php @@ -20,64 +20,64 @@ class PipelineTaskDetail extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 task_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $task_id = 0; + protected $task_id = 0; /** * Output only. The id of the parent task if the task is within a component * scope. Empty if the task is at the root level. * * Generated from protobuf field int64 parent_task_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $parent_task_id = 0; + protected $parent_task_id = 0; /** * Output only. The user specified name of the task that is defined in * [pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec]. * * Generated from protobuf field string task_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $task_name = ''; + protected $task_name = ''; /** * Output only. Task create time. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Task start time. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Task end time. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The detailed execution info. * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineTaskExecutorDetail executor_detail = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $executor_detail = null; + protected $executor_detail = null; /** * Output only. State of the task. * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineTaskDetail.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The execution metadata of the task. * * Generated from protobuf field .google.cloud.aiplatform.v1.Execution execution = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $execution = null; + protected $execution = null; /** * Output only. The error that occurred during task execution. * Only populated when the task's state is FAILED or CANCELLED. * * Generated from protobuf field .google.rpc.Status error = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Output only. A list of task status. This field keeps a record of task * status evolving over time. diff --git a/AiPlatform/src/V1/PipelineTaskDetail/PipelineTaskStatus.php b/AiPlatform/src/V1/PipelineTaskDetail/PipelineTaskStatus.php index 79639be6f57a..c582f003989f 100644 --- a/AiPlatform/src/V1/PipelineTaskDetail/PipelineTaskStatus.php +++ b/AiPlatform/src/V1/PipelineTaskDetail/PipelineTaskStatus.php @@ -20,13 +20,13 @@ class PipelineTaskStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. The state of the task. * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineTaskDetail.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The error that occurred during the state. May be set when * the state is any of the non-final state (PENDING/RUNNING/CANCELLING) or @@ -36,7 +36,7 @@ class PipelineTaskStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Constructor. diff --git a/AiPlatform/src/V1/PipelineTaskExecutorDetail/ContainerDetail.php b/AiPlatform/src/V1/PipelineTaskExecutorDetail/ContainerDetail.php index ef14edf9c94e..fb5257874dd9 100644 --- a/AiPlatform/src/V1/PipelineTaskExecutorDetail/ContainerDetail.php +++ b/AiPlatform/src/V1/PipelineTaskExecutorDetail/ContainerDetail.php @@ -23,7 +23,7 @@ class ContainerDetail extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string main_job = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $main_job = ''; + protected $main_job = ''; /** * Output only. The name of the * [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the @@ -33,7 +33,7 @@ class ContainerDetail extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string pre_caching_check_job = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $pre_caching_check_job = ''; + protected $pre_caching_check_job = ''; /** * Output only. The names of the previously failed * [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the main container diff --git a/AiPlatform/src/V1/PipelineTaskExecutorDetail/CustomJobDetail.php b/AiPlatform/src/V1/PipelineTaskExecutorDetail/CustomJobDetail.php index fae9e6a075c2..f1f898fcd76b 100644 --- a/AiPlatform/src/V1/PipelineTaskExecutorDetail/CustomJobDetail.php +++ b/AiPlatform/src/V1/PipelineTaskExecutorDetail/CustomJobDetail.php @@ -21,7 +21,7 @@ class CustomJobDetail extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string job = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $job = ''; + protected $job = ''; /** * Output only. The names of the previously failed * [CustomJob][google.cloud.aiplatform.v1.CustomJob]. The list includes the diff --git a/AiPlatform/src/V1/PipelineTemplateMetadata.php b/AiPlatform/src/V1/PipelineTemplateMetadata.php index 1018b49a69ed..a009c94678ac 100644 --- a/AiPlatform/src/V1/PipelineTemplateMetadata.php +++ b/AiPlatform/src/V1/PipelineTemplateMetadata.php @@ -27,7 +27,7 @@ class PipelineTemplateMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 3; */ - private $version = ''; + protected $version = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/Port.php b/AiPlatform/src/V1/Port.php index def3873b6c21..6e9ac572fcdd 100644 --- a/AiPlatform/src/V1/Port.php +++ b/AiPlatform/src/V1/Port.php @@ -21,7 +21,7 @@ class Port extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 container_port = 3; */ - private $container_port = 0; + protected $container_port = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/PredefinedSplit.php b/AiPlatform/src/V1/PredefinedSplit.php index ef14fb5c0e83..730def2309d1 100644 --- a/AiPlatform/src/V1/PredefinedSplit.php +++ b/AiPlatform/src/V1/PredefinedSplit.php @@ -27,7 +27,7 @@ class PredefinedSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $key = ''; + protected $key = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/PredictRequest.php b/AiPlatform/src/V1/PredictRequest.php index a0e4c18580a1..389959a55afd 100644 --- a/AiPlatform/src/V1/PredictRequest.php +++ b/AiPlatform/src/V1/PredictRequest.php @@ -23,7 +23,7 @@ class PredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Required. The instances that are the input to the prediction call. * A DeployedModel may have an upper limit on the number of instances it @@ -47,7 +47,7 @@ class PredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value parameters = 3; */ - private $parameters = null; + protected $parameters = null; /** * @param string $endpoint Required. The name of the Endpoint requested to serve the prediction. diff --git a/AiPlatform/src/V1/PredictRequestResponseLoggingConfig.php b/AiPlatform/src/V1/PredictRequestResponseLoggingConfig.php index 1ae527784567..4dcb30ae67cc 100644 --- a/AiPlatform/src/V1/PredictRequestResponseLoggingConfig.php +++ b/AiPlatform/src/V1/PredictRequestResponseLoggingConfig.php @@ -20,14 +20,14 @@ class PredictRequestResponseLoggingConfig extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field bool enabled = 1; */ - private $enabled = false; + protected $enabled = false; /** * Percentage of requests to be logged, expressed as a fraction in * range(0,1]. * * Generated from protobuf field double sampling_rate = 2; */ - private $sampling_rate = 0.0; + protected $sampling_rate = 0.0; /** * BigQuery table for logging. * If only given a project, a new dataset will be created with name @@ -38,7 +38,7 @@ class PredictRequestResponseLoggingConfig extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field .google.cloud.aiplatform.v1.BigQueryDestination bigquery_destination = 3; */ - private $bigquery_destination = null; + protected $bigquery_destination = null; /** * Constructor. diff --git a/AiPlatform/src/V1/PredictResponse.php b/AiPlatform/src/V1/PredictResponse.php index 73963c60196d..66f26ce95edf 100644 --- a/AiPlatform/src/V1/PredictResponse.php +++ b/AiPlatform/src/V1/PredictResponse.php @@ -31,21 +31,21 @@ class PredictResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string deployed_model_id = 2; */ - private $deployed_model_id = ''; + protected $deployed_model_id = ''; /** * Output only. The resource name of the Model which is deployed as the * DeployedModel that this prediction hits. * * Generated from protobuf field string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * Output only. The version ID of the Model which is deployed as the * DeployedModel that this prediction hits. * * Generated from protobuf field string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $model_version_id = ''; + protected $model_version_id = ''; /** * Output only. The [display * name][google.cloud.aiplatform.v1.Model.display_name] of the Model which is @@ -53,14 +53,14 @@ class PredictResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $model_display_name = ''; + protected $model_display_name = ''; /** * Output only. Request-level metadata returned by the model. The metadata * type will be dependent upon the model implementation. * * Generated from protobuf field .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata = null; + protected $metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/PredictSchemata.php b/AiPlatform/src/V1/PredictSchemata.php index da256c34e467..3dd33cc0e6bb 100644 --- a/AiPlatform/src/V1/PredictSchemata.php +++ b/AiPlatform/src/V1/PredictSchemata.php @@ -34,7 +34,7 @@ class PredictSchemata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string instance_schema_uri = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $instance_schema_uri = ''; + protected $instance_schema_uri = ''; /** * Immutable. Points to a YAML file stored on Google Cloud Storage describing * the parameters of prediction and explanation via @@ -52,7 +52,7 @@ class PredictSchemata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parameters_schema_uri = 2 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $parameters_schema_uri = ''; + protected $parameters_schema_uri = ''; /** * Immutable. Points to a YAML file stored on Google Cloud Storage describing * the format of a single prediction produced by this Model, which are @@ -70,7 +70,7 @@ class PredictSchemata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string prediction_schema_uri = 3 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $prediction_schema_uri = ''; + protected $prediction_schema_uri = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/PredictionServiceClient.php b/AiPlatform/src/V1/PredictionServiceClient.php deleted file mode 100644 index da9af7577070..000000000000 --- a/AiPlatform/src/V1/PredictionServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.PredictionService/Predict', - $argument, - ['\Google\Cloud\AIPlatform\V1\PredictResponse', 'decode'], - $metadata, $options); - } - - /** - * Perform an online prediction with an arbitrary HTTP payload. - * - * The response includes the following HTTP headers: - * - * * `X-Vertex-AI-Endpoint-Id`: ID of the - * [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this - * prediction. - * - * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's - * [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] that served this - * prediction. - * @param \Google\Cloud\AIPlatform\V1\RawPredictRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RawPredict(\Google\Cloud\AIPlatform\V1\RawPredictRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PredictionService/RawPredict', - $argument, - ['\Google\Api\HttpBody', 'decode'], - $metadata, $options); - } - - /** - * Perform an online explanation. - * - * If - * [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] - * is specified, the corresponding DeployModel must have - * [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] - * populated. If - * [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] - * is not specified, all DeployedModels must have - * [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] - * populated. Only deployed AutoML tabular Models have - * explanation_spec. - * @param \Google\Cloud\AIPlatform\V1\ExplainRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function Explain(\Google\Cloud\AIPlatform\V1\ExplainRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.PredictionService/Explain', - $argument, - ['\Google\Cloud\AIPlatform\V1\ExplainResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/Presets.php b/AiPlatform/src/V1/Presets.php index 85b0fe7e550a..3b2066227e65 100644 --- a/AiPlatform/src/V1/Presets.php +++ b/AiPlatform/src/V1/Presets.php @@ -21,7 +21,7 @@ class Presets extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional .google.cloud.aiplatform.v1.Presets.Query query = 1; */ - private $query = null; + protected $query = null; /** * The modality of the uploaded model, which automatically configures the * distance measurement and feature normalization for the underlying example @@ -30,7 +30,7 @@ class Presets extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Presets.Modality modality = 2; */ - private $modality = 0; + protected $modality = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/PrivateEndpoints.php b/AiPlatform/src/V1/PrivateEndpoints.php index ab0d213bd9cf..d8b2a2851f77 100644 --- a/AiPlatform/src/V1/PrivateEndpoints.php +++ b/AiPlatform/src/V1/PrivateEndpoints.php @@ -24,26 +24,26 @@ class PrivateEndpoints extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $predict_http_uri = ''; + protected $predict_http_uri = ''; /** * Output only. Http(s) path to send explain requests. * * Generated from protobuf field string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $explain_http_uri = ''; + protected $explain_http_uri = ''; /** * Output only. Http(s) path to send health check requests. * * Generated from protobuf field string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $health_http_uri = ''; + protected $health_http_uri = ''; /** * Output only. The name of the service attachment resource. Populated if * private service connect is enabled. * * Generated from protobuf field string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service_attachment = ''; + protected $service_attachment = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/PrivateServiceConnectConfig.php b/AiPlatform/src/V1/PrivateServiceConnectConfig.php index bccce955cc89..f8ba7cc670b9 100644 --- a/AiPlatform/src/V1/PrivateServiceConnectConfig.php +++ b/AiPlatform/src/V1/PrivateServiceConnectConfig.php @@ -20,7 +20,7 @@ class PrivateServiceConnectConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_private_service_connect = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $enable_private_service_connect = false; + protected $enable_private_service_connect = false; /** * A list of Projects from which the forwarding rule will target the service * attachment. diff --git a/AiPlatform/src/V1/Probe.php b/AiPlatform/src/V1/Probe.php index e63d92aeacd7..5783d584ecdf 100644 --- a/AiPlatform/src/V1/Probe.php +++ b/AiPlatform/src/V1/Probe.php @@ -23,7 +23,7 @@ class Probe extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 period_seconds = 2; */ - private $period_seconds = 0; + protected $period_seconds = 0; /** * Number of seconds after which the probe times out. Defaults to 1 second. * Minimum value is 1. Must be greater or equal to period_seconds. @@ -31,7 +31,7 @@ class Probe extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 timeout_seconds = 3; */ - private $timeout_seconds = 0; + protected $timeout_seconds = 0; protected $probe_type; /** @@ -41,7 +41,7 @@ class Probe extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\AIPlatform\V1\Probe\ExecAction $exec - * Exec specifies the action to take. + * ExecAction probes the health of a container by executing a command. * @type int $period_seconds * How often (in seconds) to perform the probe. Default to 10 seconds. * Minimum value is 1. Must be less than timeout_seconds. @@ -58,7 +58,7 @@ public function __construct($data = NULL) { } /** - * Exec specifies the action to take. + * ExecAction probes the health of a container by executing a command. * * Generated from protobuf field .google.cloud.aiplatform.v1.Probe.ExecAction exec = 1; * @return \Google\Cloud\AIPlatform\V1\Probe\ExecAction|null @@ -74,7 +74,7 @@ public function hasExec() } /** - * Exec specifies the action to take. + * ExecAction probes the health of a container by executing a command. * * Generated from protobuf field .google.cloud.aiplatform.v1.Probe.ExecAction exec = 1; * @param \Google\Cloud\AIPlatform\V1\Probe\ExecAction $var diff --git a/AiPlatform/src/V1/PscAutomatedEndpoints.php b/AiPlatform/src/V1/PscAutomatedEndpoints.php index 8b4ed8311659..38684c5a3079 100644 --- a/AiPlatform/src/V1/PscAutomatedEndpoints.php +++ b/AiPlatform/src/V1/PscAutomatedEndpoints.php @@ -21,19 +21,19 @@ class PscAutomatedEndpoints extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * Corresponding network in pscAutomationConfigs. * * Generated from protobuf field string network = 2; */ - private $network = ''; + protected $network = ''; /** * Ip Address created by the automated forwarding rule. * * Generated from protobuf field string match_address = 3; */ - private $match_address = ''; + protected $match_address = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/PublisherModel.php b/AiPlatform/src/V1/PublisherModel.php index daa85979ab06..4acc5cd3902b 100644 --- a/AiPlatform/src/V1/PublisherModel.php +++ b/AiPlatform/src/V1/PublisherModel.php @@ -20,7 +20,7 @@ class PublisherModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Immutable. The version ID of the PublisherModel. * A new version is committed when a new model version is uploaded under an @@ -29,19 +29,19 @@ class PublisherModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version_id = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $version_id = ''; + protected $version_id = ''; /** * Required. Indicates the open source category of the publisher model. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory open_source_category = 7 [(.google.api.field_behavior) = REQUIRED]; */ - private $open_source_category = 0; + protected $open_source_category = 0; /** * Optional. Supported call-to-action options. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction supported_actions = 19 [(.google.api.field_behavior) = OPTIONAL]; */ - private $supported_actions = null; + protected $supported_actions = null; /** * Optional. Additional information about the model's Frameworks. * @@ -53,13 +53,13 @@ class PublisherModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.LaunchStage launch_stage = 29 [(.google.api.field_behavior) = OPTIONAL]; */ - private $launch_stage = 0; + protected $launch_stage = 0; /** * Optional. Indicates the state of the model version. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.VersionState version_state = 37 [(.google.api.field_behavior) = OPTIONAL]; */ - private $version_state = 0; + protected $version_state = 0; /** * Optional. Output only. Immutable. Used to indicate this model has a * publisher model and provide the template of the publisher model resource @@ -67,7 +67,7 @@ class PublisherModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string publisher_model_template = 30 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $publisher_model_template = ''; + protected $publisher_model_template = ''; /** * Optional. The schemata that describes formats of the PublisherModel's * predictions and explanations as given and returned via @@ -75,7 +75,7 @@ class PublisherModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PredictSchemata predict_schemata = 31 [(.google.api.field_behavior) = OPTIONAL]; */ - private $predict_schemata = null; + protected $predict_schemata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/PublisherModel/CallToAction.php b/AiPlatform/src/V1/PublisherModel/CallToAction.php index ce1778237c8d..fed087385f9d 100644 --- a/AiPlatform/src/V1/PublisherModel/CallToAction.php +++ b/AiPlatform/src/V1/PublisherModel/CallToAction.php @@ -20,79 +20,79 @@ class CallToAction extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi view_rest_api = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view_rest_api = null; + protected $view_rest_api = null; /** * Optional. Open notebook of the PublisherModel. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences open_notebook = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $open_notebook = null; + protected $open_notebook = null; /** * Optional. Open notebooks of the PublisherModel. * * Generated from protobuf field optional .google.cloud.aiplatform.v1.PublisherModel.CallToAction.OpenNotebooks open_notebooks = 12 [(.google.api.field_behavior) = OPTIONAL]; */ - private $open_notebooks = null; + protected $open_notebooks = null; /** * Optional. Create application using the PublisherModel. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences create_application = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $create_application = null; + protected $create_application = null; /** * Optional. Open fine-tuning pipeline of the PublisherModel. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences open_fine_tuning_pipeline = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $open_fine_tuning_pipeline = null; + protected $open_fine_tuning_pipeline = null; /** * Optional. Open fine-tuning pipelines of the PublisherModel. * * Generated from protobuf field optional .google.cloud.aiplatform.v1.PublisherModel.CallToAction.OpenFineTuningPipelines open_fine_tuning_pipelines = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $open_fine_tuning_pipelines = null; + protected $open_fine_tuning_pipelines = null; /** * Optional. Open prompt-tuning pipeline of the PublisherModel. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences open_prompt_tuning_pipeline = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $open_prompt_tuning_pipeline = null; + protected $open_prompt_tuning_pipeline = null; /** * Optional. Open Genie / Playground. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences open_genie = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $open_genie = null; + protected $open_genie = null; /** * Optional. Deploy the PublisherModel to Vertex Endpoint. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy deploy = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $deploy = null; + protected $deploy = null; /** * Optional. Deploy PublisherModel to Google Kubernetes Engine. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.DeployGke deploy_gke = 14 [(.google.api.field_behavior) = OPTIONAL]; */ - private $deploy_gke = null; + protected $deploy_gke = null; /** * Optional. Open in Generation AI Studio. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences open_generation_ai_studio = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $open_generation_ai_studio = null; + protected $open_generation_ai_studio = null; /** * Optional. Request for access. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences request_access = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_access = null; + protected $request_access = null; /** * Optional. Open evaluation pipeline of the PublisherModel. * * Generated from protobuf field .google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences open_evaluation_pipeline = 11 [(.google.api.field_behavior) = OPTIONAL]; */ - private $open_evaluation_pipeline = null; + protected $open_evaluation_pipeline = null; /** * Constructor. diff --git a/AiPlatform/src/V1/PublisherModel/CallToAction/Deploy.php b/AiPlatform/src/V1/PublisherModel/CallToAction/Deploy.php index 297c71a9aee1..05b01a0de67e 100644 --- a/AiPlatform/src/V1/PublisherModel/CallToAction/Deploy.php +++ b/AiPlatform/src/V1/PublisherModel/CallToAction/Deploy.php @@ -21,41 +21,48 @@ class Deploy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model_display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $model_display_name = ''; + protected $model_display_name = ''; /** * Optional. Large model reference. When this is set, model_artifact_spec * is not needed. * * Generated from protobuf field .google.cloud.aiplatform.v1.LargeModelReference large_model_reference = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $large_model_reference = null; + protected $large_model_reference = null; /** * Optional. The specification of the container that is to be used when * deploying this Model in Vertex AI. Not present for Large Models. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelContainerSpec container_spec = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $container_spec = null; + protected $container_spec = null; /** * Optional. The path to the directory containing the Model artifact and * any of its supporting files. * * Generated from protobuf field string artifact_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $artifact_uri = ''; + protected $artifact_uri = ''; + /** + * Optional. The name of the deploy task (e.g., "text to image + * generation"). + * + * Generated from protobuf field optional string deploy_task_name = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $deploy_task_name = null; /** * Required. The title of the regional resource reference. * * Generated from protobuf field string title = 8 [(.google.api.field_behavior) = REQUIRED]; */ - private $title = ''; + protected $title = ''; /** * Optional. The signed URI for ephemeral Cloud Storage access to model * artifact. * * Generated from protobuf field string public_artifact_uri = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $public_artifact_uri = ''; + protected $public_artifact_uri = ''; protected $prediction_resources; /** @@ -85,6 +92,9 @@ class Deploy extends \Google\Protobuf\Internal\Message * @type string $artifact_uri * Optional. The path to the directory containing the Model artifact and * any of its supporting files. + * @type string $deploy_task_name + * Optional. The name of the deploy task (e.g., "text to image + * generation"). * @type string $title * Required. The title of the regional resource reference. * @type string $public_artifact_uri @@ -328,6 +338,44 @@ public function setArtifactUri($var) return $this; } + /** + * Optional. The name of the deploy task (e.g., "text to image + * generation"). + * + * Generated from protobuf field optional string deploy_task_name = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDeployTaskName() + { + return isset($this->deploy_task_name) ? $this->deploy_task_name : ''; + } + + public function hasDeployTaskName() + { + return isset($this->deploy_task_name); + } + + public function clearDeployTaskName() + { + unset($this->deploy_task_name); + } + + /** + * Optional. The name of the deploy task (e.g., "text to image + * generation"). + * + * Generated from protobuf field optional string deploy_task_name = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDeployTaskName($var) + { + GPBUtil::checkString($var, True); + $this->deploy_task_name = $var; + + return $this; + } + /** * Required. The title of the regional resource reference. * diff --git a/AiPlatform/src/V1/PublisherModel/CallToAction/RegionalResourceReferences.php b/AiPlatform/src/V1/PublisherModel/CallToAction/RegionalResourceReferences.php index efc16c0098d1..6fa9953885ea 100644 --- a/AiPlatform/src/V1/PublisherModel/CallToAction/RegionalResourceReferences.php +++ b/AiPlatform/src/V1/PublisherModel/CallToAction/RegionalResourceReferences.php @@ -27,25 +27,25 @@ class RegionalResourceReferences extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $title = ''; + protected $title = ''; /** * Optional. Title of the resource. * * Generated from protobuf field optional string resource_title = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $resource_title = null; + protected $resource_title = null; /** * Optional. Use case (CUJ) of the resource. * * Generated from protobuf field optional string resource_use_case = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $resource_use_case = null; + protected $resource_use_case = null; /** * Optional. Description of the resource. * * Generated from protobuf field optional string resource_description = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $resource_description = null; + protected $resource_description = null; /** * Constructor. diff --git a/AiPlatform/src/V1/PublisherModel/CallToAction/ViewRestApi.php b/AiPlatform/src/V1/PublisherModel/CallToAction/ViewRestApi.php index 9413f11171a4..fb27ec3d0677 100644 --- a/AiPlatform/src/V1/PublisherModel/CallToAction/ViewRestApi.php +++ b/AiPlatform/src/V1/PublisherModel/CallToAction/ViewRestApi.php @@ -26,7 +26,7 @@ class ViewRestApi extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $title = ''; + protected $title = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/PublisherModel/Documentation.php b/AiPlatform/src/V1/PublisherModel/Documentation.php index 325fa405f9cc..9c0aec557d49 100644 --- a/AiPlatform/src/V1/PublisherModel/Documentation.php +++ b/AiPlatform/src/V1/PublisherModel/Documentation.php @@ -21,13 +21,13 @@ class Documentation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $title = ''; + protected $title = ''; /** * Required. Content of this piece of document (in Markdown format). * * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $content = ''; + protected $content = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/PurgeArtifactsMetadata.php b/AiPlatform/src/V1/PurgeArtifactsMetadata.php index b0661f6d74b3..5c273df921ef 100644 --- a/AiPlatform/src/V1/PurgeArtifactsMetadata.php +++ b/AiPlatform/src/V1/PurgeArtifactsMetadata.php @@ -21,7 +21,7 @@ class PurgeArtifactsMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/PurgeArtifactsRequest.php b/AiPlatform/src/V1/PurgeArtifactsRequest.php index 537fb664fb25..45c817be093f 100644 --- a/AiPlatform/src/V1/PurgeArtifactsRequest.php +++ b/AiPlatform/src/V1/PurgeArtifactsRequest.php @@ -23,14 +23,14 @@ class PurgeArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. A required filter matching the Artifacts to be purged. * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Flag to indicate to actually perform the purge. * If `force` is set to false, the method will return a sample of @@ -38,7 +38,7 @@ class PurgeArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $force = false; + protected $force = false; /** * @param string $parent Required. The metadata store to purge Artifacts from. diff --git a/AiPlatform/src/V1/PurgeArtifactsResponse.php b/AiPlatform/src/V1/PurgeArtifactsResponse.php index ccd482eeccd2..db7da9771d03 100644 --- a/AiPlatform/src/V1/PurgeArtifactsResponse.php +++ b/AiPlatform/src/V1/PurgeArtifactsResponse.php @@ -22,7 +22,7 @@ class PurgeArtifactsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 purge_count = 1; */ - private $purge_count = 0; + protected $purge_count = 0; /** * A sample of the Artifact names that will be deleted. * Only populated if `force` is set to false. The maximum number of samples is diff --git a/AiPlatform/src/V1/PurgeContextsMetadata.php b/AiPlatform/src/V1/PurgeContextsMetadata.php index b1f8e6822b97..44825c76a605 100644 --- a/AiPlatform/src/V1/PurgeContextsMetadata.php +++ b/AiPlatform/src/V1/PurgeContextsMetadata.php @@ -21,7 +21,7 @@ class PurgeContextsMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/PurgeContextsRequest.php b/AiPlatform/src/V1/PurgeContextsRequest.php index 50d73fdc8b24..5e768771c02c 100644 --- a/AiPlatform/src/V1/PurgeContextsRequest.php +++ b/AiPlatform/src/V1/PurgeContextsRequest.php @@ -23,14 +23,14 @@ class PurgeContextsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. A required filter matching the Contexts to be purged. * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Flag to indicate to actually perform the purge. * If `force` is set to false, the method will return a sample of @@ -38,7 +38,7 @@ class PurgeContextsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $force = false; + protected $force = false; /** * @param string $parent Required. The metadata store to purge Contexts from. diff --git a/AiPlatform/src/V1/PurgeContextsResponse.php b/AiPlatform/src/V1/PurgeContextsResponse.php index cc4428647f08..2e7c049e895b 100644 --- a/AiPlatform/src/V1/PurgeContextsResponse.php +++ b/AiPlatform/src/V1/PurgeContextsResponse.php @@ -22,7 +22,7 @@ class PurgeContextsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 purge_count = 1; */ - private $purge_count = 0; + protected $purge_count = 0; /** * A sample of the Context names that will be deleted. * Only populated if `force` is set to false. The maximum number of samples is diff --git a/AiPlatform/src/V1/PurgeExecutionsMetadata.php b/AiPlatform/src/V1/PurgeExecutionsMetadata.php index 5c6a3c4d83bc..d0cd029efbd3 100644 --- a/AiPlatform/src/V1/PurgeExecutionsMetadata.php +++ b/AiPlatform/src/V1/PurgeExecutionsMetadata.php @@ -21,7 +21,7 @@ class PurgeExecutionsMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/PurgeExecutionsRequest.php b/AiPlatform/src/V1/PurgeExecutionsRequest.php index dad2ce348aca..3cd814d9caa0 100644 --- a/AiPlatform/src/V1/PurgeExecutionsRequest.php +++ b/AiPlatform/src/V1/PurgeExecutionsRequest.php @@ -23,14 +23,14 @@ class PurgeExecutionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. A required filter matching the Executions to be purged. * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Flag to indicate to actually perform the purge. * If `force` is set to false, the method will return a sample of @@ -38,7 +38,7 @@ class PurgeExecutionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $force = false; + protected $force = false; /** * @param string $parent Required. The metadata store to purge Executions from. diff --git a/AiPlatform/src/V1/PurgeExecutionsResponse.php b/AiPlatform/src/V1/PurgeExecutionsResponse.php index 14073c7872b5..493a6831374a 100644 --- a/AiPlatform/src/V1/PurgeExecutionsResponse.php +++ b/AiPlatform/src/V1/PurgeExecutionsResponse.php @@ -23,7 +23,7 @@ class PurgeExecutionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 purge_count = 1; */ - private $purge_count = 0; + protected $purge_count = 0; /** * A sample of the Execution names that will be deleted. * Only populated if `force` is set to false. The maximum number of samples is diff --git a/AiPlatform/src/V1/PythonPackageSpec.php b/AiPlatform/src/V1/PythonPackageSpec.php index b8430078710f..12e697f54867 100644 --- a/AiPlatform/src/V1/PythonPackageSpec.php +++ b/AiPlatform/src/V1/PythonPackageSpec.php @@ -25,7 +25,7 @@ class PythonPackageSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string executor_image_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $executor_image_uri = ''; + protected $executor_image_uri = ''; /** * Required. The Google Cloud Storage location of the Python package files * which are the training program and its dependent packages. The maximum @@ -39,7 +39,7 @@ class PythonPackageSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string python_module = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $python_module = ''; + protected $python_module = ''; /** * Command line arguments to be passed to the Python task. * diff --git a/AiPlatform/src/V1/QueryArtifactLineageSubgraphRequest.php b/AiPlatform/src/V1/QueryArtifactLineageSubgraphRequest.php index 03eefb94f9d9..a1cc28dde0c0 100644 --- a/AiPlatform/src/V1/QueryArtifactLineageSubgraphRequest.php +++ b/AiPlatform/src/V1/QueryArtifactLineageSubgraphRequest.php @@ -26,7 +26,7 @@ class QueryArtifactLineageSubgraphRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string artifact = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $artifact = ''; + protected $artifact = ''; /** * Specifies the size of the lineage graph in terms of number of hops from the * specified artifact. @@ -36,7 +36,7 @@ class QueryArtifactLineageSubgraphRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field int32 max_hops = 2; */ - private $max_hops = 0; + protected $max_hops = 0; /** * Filter specifying the boolean condition for the Artifacts to satisfy in * order to be part of the Lineage Subgraph. @@ -63,7 +63,7 @@ class QueryArtifactLineageSubgraphRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string filter = 3; */ - private $filter = ''; + protected $filter = ''; /** * @param string $artifact Required. The resource name of the Artifact whose Lineage needs to be diff --git a/AiPlatform/src/V1/QueryContextLineageSubgraphRequest.php b/AiPlatform/src/V1/QueryContextLineageSubgraphRequest.php index 3c5d72451db5..d1cbcb689944 100644 --- a/AiPlatform/src/V1/QueryContextLineageSubgraphRequest.php +++ b/AiPlatform/src/V1/QueryContextLineageSubgraphRequest.php @@ -27,7 +27,7 @@ class QueryContextLineageSubgraphRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string context = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $context = ''; + protected $context = ''; /** * @param string $context Required. The resource name of the Context whose Artifacts and Executions diff --git a/AiPlatform/src/V1/QueryDeployedModelsRequest.php b/AiPlatform/src/V1/QueryDeployedModelsRequest.php index fb48cd5a1e9b..abd29b8c6976 100644 --- a/AiPlatform/src/V1/QueryDeployedModelsRequest.php +++ b/AiPlatform/src/V1/QueryDeployedModelsRequest.php @@ -22,14 +22,14 @@ class QueryDeployedModelsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string deployment_resource_pool = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployment_resource_pool = ''; + protected $deployment_resource_pool = ''; /** * The maximum number of DeployedModels to return. The service may return * fewer than this value. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous `QueryDeployedModels` call. * Provide this to retrieve the subsequent page. @@ -39,7 +39,7 @@ class QueryDeployedModelsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $deploymentResourcePool Required. The name of the target DeploymentResourcePool to query. diff --git a/AiPlatform/src/V1/QueryDeployedModelsResponse.php b/AiPlatform/src/V1/QueryDeployedModelsResponse.php index e93eced1db1d..10c15e8c6606 100644 --- a/AiPlatform/src/V1/QueryDeployedModelsResponse.php +++ b/AiPlatform/src/V1/QueryDeployedModelsResponse.php @@ -28,7 +28,7 @@ class QueryDeployedModelsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * References to the DeployedModels that share the specified * deploymentResourcePool. @@ -41,14 +41,14 @@ class QueryDeployedModelsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 total_deployed_model_count = 4; */ - private $total_deployed_model_count = 0; + protected $total_deployed_model_count = 0; /** * The total number of Endpoints that have DeployedModels on this * DeploymentResourcePool. * * Generated from protobuf field int32 total_endpoint_count = 5; */ - private $total_endpoint_count = 0; + protected $total_endpoint_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/QueryExecutionInputsAndOutputsRequest.php b/AiPlatform/src/V1/QueryExecutionInputsAndOutputsRequest.php index e97fd7fb36ed..7ff55225859c 100644 --- a/AiPlatform/src/V1/QueryExecutionInputsAndOutputsRequest.php +++ b/AiPlatform/src/V1/QueryExecutionInputsAndOutputsRequest.php @@ -23,7 +23,7 @@ class QueryExecutionInputsAndOutputsRequest extends \Google\Protobuf\Internal\Me * * Generated from protobuf field string execution = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $execution = ''; + protected $execution = ''; /** * @param string $execution Required. The resource name of the Execution whose input and output diff --git a/AiPlatform/src/V1/RawPredictRequest.php b/AiPlatform/src/V1/RawPredictRequest.php index e9c10f73b092..a9fd56069156 100644 --- a/AiPlatform/src/V1/RawPredictRequest.php +++ b/AiPlatform/src/V1/RawPredictRequest.php @@ -23,7 +23,7 @@ class RawPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * The prediction input. Supports HTTP headers and arbitrary data payload. * A [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] may have an @@ -41,7 +41,7 @@ class RawPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.api.HttpBody http_body = 2; */ - private $http_body = null; + protected $http_body = null; /** * @param string $endpoint Required. The name of the Endpoint requested to serve the prediction. diff --git a/AiPlatform/src/V1/RayMetricSpec.php b/AiPlatform/src/V1/RayMetricSpec.php new file mode 100644 index 000000000000..a704034e4a2d --- /dev/null +++ b/AiPlatform/src/V1/RayMetricSpec.php @@ -0,0 +1,67 @@ +google.cloud.aiplatform.v1.RayMetricSpec + */ +class RayMetricSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Flag to disable the Ray metrics collection. + * + * Generated from protobuf field bool disabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $disabled + * Optional. Flag to disable the Ray metrics collection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\PersistentResource::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Flag to disable the Ray metrics collection. + * + * Generated from protobuf field bool disabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * Optional. Flag to disable the Ray metrics collection. + * + * Generated from protobuf field bool disabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/RaySpec.php b/AiPlatform/src/V1/RaySpec.php index c40d3b5d50cd..d8354d76c376 100644 --- a/AiPlatform/src/V1/RaySpec.php +++ b/AiPlatform/src/V1/RaySpec.php @@ -18,6 +18,46 @@ */ class RaySpec extends \Google\Protobuf\Internal\Message { + /** + * Optional. Default image for user to choose a preferred ML framework + * (for example, TensorFlow or Pytorch) by choosing from [Vertex prebuilt + * images](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). + * Either this or the resource_pool_images is required. Use this field if + * you need all the resource pools to have the same Ray image. Otherwise, use + * the {@code resource_pool_images} field. + * + * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image_uri = ''; + /** + * Optional. Required if image_uri isn't set. A map of resource_pool_id to + * prebuild Ray image if user need to use different images for different + * head/worker pools. This map needs to cover all the resource pool ids. + * Example: + * { + * "ray_head_node_pool": "head image" + * "ray_worker_node_pool1": "worker image" + * "ray_worker_node_pool2": "another worker image" + * } + * + * Generated from protobuf field map resource_pool_images = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $resource_pool_images; + /** + * Optional. This will be used to indicate which resource pool will serve as + * the Ray head node(the first node within that pool). Will use the machine + * from the first workerpool as the head node by default if this field isn't + * set. + * + * Generated from protobuf field string head_node_resource_pool_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $head_node_resource_pool_id = ''; + /** + * Optional. Ray metrics configurations. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.RayMetricSpec ray_metric_spec = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ray_metric_spec = null; /** * Constructor. @@ -25,6 +65,30 @@ class RaySpec extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * + * @type string $image_uri + * Optional. Default image for user to choose a preferred ML framework + * (for example, TensorFlow or Pytorch) by choosing from [Vertex prebuilt + * images](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). + * Either this or the resource_pool_images is required. Use this field if + * you need all the resource pools to have the same Ray image. Otherwise, use + * the {@code resource_pool_images} field. + * @type array|\Google\Protobuf\Internal\MapField $resource_pool_images + * Optional. Required if image_uri isn't set. A map of resource_pool_id to + * prebuild Ray image if user need to use different images for different + * head/worker pools. This map needs to cover all the resource pool ids. + * Example: + * { + * "ray_head_node_pool": "head image" + * "ray_worker_node_pool1": "worker image" + * "ray_worker_node_pool2": "another worker image" + * } + * @type string $head_node_resource_pool_id + * Optional. This will be used to indicate which resource pool will serve as + * the Ray head node(the first node within that pool). Will use the machine + * from the first workerpool as the head node by default if this field isn't + * set. + * @type \Google\Cloud\AIPlatform\V1\RayMetricSpec $ray_metric_spec + * Optional. Ray metrics configurations. * } */ public function __construct($data = NULL) { @@ -32,5 +96,151 @@ public function __construct($data = NULL) { parent::__construct($data); } + /** + * Optional. Default image for user to choose a preferred ML framework + * (for example, TensorFlow or Pytorch) by choosing from [Vertex prebuilt + * images](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). + * Either this or the resource_pool_images is required. Use this field if + * you need all the resource pools to have the same Ray image. Otherwise, use + * the {@code resource_pool_images} field. + * + * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Optional. Default image for user to choose a preferred ML framework + * (for example, TensorFlow or Pytorch) by choosing from [Vertex prebuilt + * images](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). + * Either this or the resource_pool_images is required. Use this field if + * you need all the resource pools to have the same Ray image. Otherwise, use + * the {@code resource_pool_images} field. + * + * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Optional. Required if image_uri isn't set. A map of resource_pool_id to + * prebuild Ray image if user need to use different images for different + * head/worker pools. This map needs to cover all the resource pool ids. + * Example: + * { + * "ray_head_node_pool": "head image" + * "ray_worker_node_pool1": "worker image" + * "ray_worker_node_pool2": "another worker image" + * } + * + * Generated from protobuf field map resource_pool_images = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getResourcePoolImages() + { + return $this->resource_pool_images; + } + + /** + * Optional. Required if image_uri isn't set. A map of resource_pool_id to + * prebuild Ray image if user need to use different images for different + * head/worker pools. This map needs to cover all the resource pool ids. + * Example: + * { + * "ray_head_node_pool": "head image" + * "ray_worker_node_pool1": "worker image" + * "ray_worker_node_pool2": "another worker image" + * } + * + * Generated from protobuf field map resource_pool_images = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setResourcePoolImages($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_pool_images = $arr; + + return $this; + } + + /** + * Optional. This will be used to indicate which resource pool will serve as + * the Ray head node(the first node within that pool). Will use the machine + * from the first workerpool as the head node by default if this field isn't + * set. + * + * Generated from protobuf field string head_node_resource_pool_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getHeadNodeResourcePoolId() + { + return $this->head_node_resource_pool_id; + } + + /** + * Optional. This will be used to indicate which resource pool will serve as + * the Ray head node(the first node within that pool). Will use the machine + * from the first workerpool as the head node by default if this field isn't + * set. + * + * Generated from protobuf field string head_node_resource_pool_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setHeadNodeResourcePoolId($var) + { + GPBUtil::checkString($var, True); + $this->head_node_resource_pool_id = $var; + + return $this; + } + + /** + * Optional. Ray metrics configurations. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.RayMetricSpec ray_metric_spec = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\RayMetricSpec|null + */ + public function getRayMetricSpec() + { + return $this->ray_metric_spec; + } + + public function hasRayMetricSpec() + { + return isset($this->ray_metric_spec); + } + + public function clearRayMetricSpec() + { + unset($this->ray_metric_spec); + } + + /** + * Optional. Ray metrics configurations. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.RayMetricSpec ray_metric_spec = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\RayMetricSpec $var + * @return $this + */ + public function setRayMetricSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\RayMetricSpec::class); + $this->ray_metric_spec = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/ReadFeatureValuesRequest.php b/AiPlatform/src/V1/ReadFeatureValuesRequest.php index 7c0561037be4..c8b14314a1e7 100644 --- a/AiPlatform/src/V1/ReadFeatureValuesRequest.php +++ b/AiPlatform/src/V1/ReadFeatureValuesRequest.php @@ -25,7 +25,7 @@ class ReadFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $entity_type = ''; + protected $entity_type = ''; /** * Required. ID for a specific entity. For example, * for a machine learning model predicting user clicks on a website, an entity @@ -33,13 +33,13 @@ class ReadFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $entity_id = ''; + protected $entity_id = ''; /** * Required. Selector choosing Features of the target EntityType. * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureSelector feature_selector = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_selector = null; + protected $feature_selector = null; /** * @param string $entityType Required. The resource name of the EntityType for the entity being read. diff --git a/AiPlatform/src/V1/ReadFeatureValuesResponse.php b/AiPlatform/src/V1/ReadFeatureValuesResponse.php index 66ab61217f88..b430cb4ba2ac 100644 --- a/AiPlatform/src/V1/ReadFeatureValuesResponse.php +++ b/AiPlatform/src/V1/ReadFeatureValuesResponse.php @@ -21,7 +21,7 @@ class ReadFeatureValuesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ReadFeatureValuesResponse.Header header = 1; */ - private $header = null; + protected $header = null; /** * Entity view with Feature values. This may be the entity in the * Featurestore if values for all Features were requested, or a projection @@ -30,7 +30,7 @@ class ReadFeatureValuesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ReadFeatureValuesResponse.EntityView entity_view = 2; */ - private $entity_view = null; + protected $entity_view = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ReadFeatureValuesResponse/EntityView.php b/AiPlatform/src/V1/ReadFeatureValuesResponse/EntityView.php index c3dc884dfead..52f83d82edb5 100644 --- a/AiPlatform/src/V1/ReadFeatureValuesResponse/EntityView.php +++ b/AiPlatform/src/V1/ReadFeatureValuesResponse/EntityView.php @@ -20,7 +20,7 @@ class EntityView extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_id = 1; */ - private $entity_id = ''; + protected $entity_id = ''; /** * Each piece of data holds the k * requested values for one requested Feature. If no values diff --git a/AiPlatform/src/V1/ReadFeatureValuesResponse/FeatureDescriptor.php b/AiPlatform/src/V1/ReadFeatureValuesResponse/FeatureDescriptor.php index 1194d9d604a0..47ed878c75aa 100644 --- a/AiPlatform/src/V1/ReadFeatureValuesResponse/FeatureDescriptor.php +++ b/AiPlatform/src/V1/ReadFeatureValuesResponse/FeatureDescriptor.php @@ -20,7 +20,7 @@ class FeatureDescriptor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ReadFeatureValuesResponse/Header.php b/AiPlatform/src/V1/ReadFeatureValuesResponse/Header.php index e2cb3f0d5114..57b5f9059624 100644 --- a/AiPlatform/src/V1/ReadFeatureValuesResponse/Header.php +++ b/AiPlatform/src/V1/ReadFeatureValuesResponse/Header.php @@ -25,7 +25,7 @@ class Header extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_type = 1 [(.google.api.resource_reference) = { */ - private $entity_type = ''; + protected $entity_type = ''; /** * List of Feature metadata corresponding to each piece of * [ReadFeatureValuesResponse.EntityView.data][google.cloud.aiplatform.v1.ReadFeatureValuesResponse.EntityView.data]. diff --git a/AiPlatform/src/V1/ReadIndexDatapointsRequest.php b/AiPlatform/src/V1/ReadIndexDatapointsRequest.php index 530eca132afc..815684e21007 100644 --- a/AiPlatform/src/V1/ReadIndexDatapointsRequest.php +++ b/AiPlatform/src/V1/ReadIndexDatapointsRequest.php @@ -23,13 +23,13 @@ class ReadIndexDatapointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $index_endpoint = ''; + protected $index_endpoint = ''; /** * The ID of the DeployedIndex that will serve the request. * * Generated from protobuf field string deployed_index_id = 2; */ - private $deployed_index_id = ''; + protected $deployed_index_id = ''; /** * IDs of the datapoints to be searched for. * diff --git a/AiPlatform/src/V1/ReadTensorboardBlobDataRequest.php b/AiPlatform/src/V1/ReadTensorboardBlobDataRequest.php index 66bcfaf21c55..f1b5a98f39ff 100644 --- a/AiPlatform/src/V1/ReadTensorboardBlobDataRequest.php +++ b/AiPlatform/src/V1/ReadTensorboardBlobDataRequest.php @@ -23,7 +23,7 @@ class ReadTensorboardBlobDataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string time_series = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $time_series = ''; + protected $time_series = ''; /** * IDs of the blobs to read. * diff --git a/AiPlatform/src/V1/ReadTensorboardSizeRequest.php b/AiPlatform/src/V1/ReadTensorboardSizeRequest.php index a5b74b2d907f..4d0e91a974d4 100644 --- a/AiPlatform/src/V1/ReadTensorboardSizeRequest.php +++ b/AiPlatform/src/V1/ReadTensorboardSizeRequest.php @@ -23,7 +23,7 @@ class ReadTensorboardSizeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tensorboard = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $tensorboard = ''; + protected $tensorboard = ''; /** * @param string $tensorboard Required. The name of the Tensorboard resource. diff --git a/AiPlatform/src/V1/ReadTensorboardSizeResponse.php b/AiPlatform/src/V1/ReadTensorboardSizeResponse.php index e09c5a6d8b3b..2994b561384b 100644 --- a/AiPlatform/src/V1/ReadTensorboardSizeResponse.php +++ b/AiPlatform/src/V1/ReadTensorboardSizeResponse.php @@ -21,7 +21,7 @@ class ReadTensorboardSizeResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 storage_size_byte = 1; */ - private $storage_size_byte = 0; + protected $storage_size_byte = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/ReadTensorboardTimeSeriesDataRequest.php b/AiPlatform/src/V1/ReadTensorboardTimeSeriesDataRequest.php index 30583a5287d3..c675a1635476 100644 --- a/AiPlatform/src/V1/ReadTensorboardTimeSeriesDataRequest.php +++ b/AiPlatform/src/V1/ReadTensorboardTimeSeriesDataRequest.php @@ -23,7 +23,7 @@ class ReadTensorboardTimeSeriesDataRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string tensorboard_time_series = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $tensorboard_time_series = ''; + protected $tensorboard_time_series = ''; /** * The maximum number of TensorboardTimeSeries' data to return. * This value should be a positive integer. @@ -31,13 +31,13 @@ class ReadTensorboardTimeSeriesDataRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field int32 max_data_points = 2; */ - private $max_data_points = 0; + protected $max_data_points = 0; /** * Reads the TensorboardTimeSeries' data that match the filter expression. * * Generated from protobuf field string filter = 3; */ - private $filter = ''; + protected $filter = ''; /** * @param string $tensorboardTimeSeries Required. The resource name of the TensorboardTimeSeries to read data from. diff --git a/AiPlatform/src/V1/ReadTensorboardTimeSeriesDataResponse.php b/AiPlatform/src/V1/ReadTensorboardTimeSeriesDataResponse.php index b0be9f22724c..1f6ca585dba7 100644 --- a/AiPlatform/src/V1/ReadTensorboardTimeSeriesDataResponse.php +++ b/AiPlatform/src/V1/ReadTensorboardTimeSeriesDataResponse.php @@ -21,7 +21,7 @@ class ReadTensorboardTimeSeriesDataResponse extends \Google\Protobuf\Internal\Me * * Generated from protobuf field .google.cloud.aiplatform.v1.TimeSeriesData time_series_data = 1; */ - private $time_series_data = null; + protected $time_series_data = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ReadTensorboardUsageRequest.php b/AiPlatform/src/V1/ReadTensorboardUsageRequest.php index 5af61a8282e3..bc4901420dd1 100644 --- a/AiPlatform/src/V1/ReadTensorboardUsageRequest.php +++ b/AiPlatform/src/V1/ReadTensorboardUsageRequest.php @@ -23,7 +23,7 @@ class ReadTensorboardUsageRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tensorboard = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $tensorboard = ''; + protected $tensorboard = ''; /** * @param string $tensorboard Required. The name of the Tensorboard resource. diff --git a/AiPlatform/src/V1/ReadTensorboardUsageResponse/PerUserUsageData.php b/AiPlatform/src/V1/ReadTensorboardUsageResponse/PerUserUsageData.php index c3c058d17b12..5f061c454a6d 100644 --- a/AiPlatform/src/V1/ReadTensorboardUsageResponse/PerUserUsageData.php +++ b/AiPlatform/src/V1/ReadTensorboardUsageResponse/PerUserUsageData.php @@ -20,13 +20,13 @@ class PerUserUsageData extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string username = 1; */ - private $username = ''; + protected $username = ''; /** * Number of times the user has read data within the Tensorboard. * * Generated from protobuf field int64 view_count = 2; */ - private $view_count = 0; + protected $view_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/RebootPersistentResourceOperationMetadata.php b/AiPlatform/src/V1/RebootPersistentResourceOperationMetadata.php index 5ca9b9efdd0e..7d4abb0ac994 100644 --- a/AiPlatform/src/V1/RebootPersistentResourceOperationMetadata.php +++ b/AiPlatform/src/V1/RebootPersistentResourceOperationMetadata.php @@ -20,13 +20,13 @@ class RebootPersistentResourceOperationMetadata extends \Google\Protobuf\Interna * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Progress Message for Reboot LRO * * Generated from protobuf field string progress_message = 2; */ - private $progress_message = ''; + protected $progress_message = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/RebootPersistentResourceRequest.php b/AiPlatform/src/V1/RebootPersistentResourceRequest.php index 7ec9c42a0365..442ded6f5a16 100644 --- a/AiPlatform/src/V1/RebootPersistentResourceRequest.php +++ b/AiPlatform/src/V1/RebootPersistentResourceRequest.php @@ -23,7 +23,7 @@ class RebootPersistentResourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the PersistentResource resource. diff --git a/AiPlatform/src/V1/RemoveContextChildrenRequest.php b/AiPlatform/src/V1/RemoveContextChildrenRequest.php index b3037fd7b4e5..bedcf0cfd6db 100644 --- a/AiPlatform/src/V1/RemoveContextChildrenRequest.php +++ b/AiPlatform/src/V1/RemoveContextChildrenRequest.php @@ -23,7 +23,7 @@ class RemoveContextChildrenRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string context = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $context = ''; + protected $context = ''; /** * The resource names of the child Contexts. * diff --git a/AiPlatform/src/V1/RemoveDatapointsRequest.php b/AiPlatform/src/V1/RemoveDatapointsRequest.php index 6f08732e8f6e..5ca14e91ad51 100644 --- a/AiPlatform/src/V1/RemoveDatapointsRequest.php +++ b/AiPlatform/src/V1/RemoveDatapointsRequest.php @@ -23,7 +23,7 @@ class RemoveDatapointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string index = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $index = ''; + protected $index = ''; /** * A list of datapoint ids to be deleted. * diff --git a/AiPlatform/src/V1/ResourcePool.php b/AiPlatform/src/V1/ResourcePool.php index ba312b74a449..035e41fac877 100644 --- a/AiPlatform/src/V1/ResourcePool.php +++ b/AiPlatform/src/V1/ResourcePool.php @@ -23,38 +23,38 @@ class ResourcePool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $id = ''; + protected $id = ''; /** * Required. Immutable. The specification of a single machine. * * Generated from protobuf field .google.cloud.aiplatform.v1.MachineSpec machine_spec = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $machine_spec = null; + protected $machine_spec = null; /** * Optional. The total number of machines to use for this resource pool. * * Generated from protobuf field optional int64 replica_count = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $replica_count = null; + protected $replica_count = null; /** * Optional. Disk spec for the machine in this node pool. * * Generated from protobuf field .google.cloud.aiplatform.v1.DiskSpec disk_spec = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disk_spec = null; + protected $disk_spec = null; /** * Output only. The number of machines currently in use by training jobs for * this resource pool. Will replace idle_replica_count. * * Generated from protobuf field int64 used_replica_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $used_replica_count = 0; + protected $used_replica_count = 0; /** * Optional. Optional spec to configure GKE autoscaling * * Generated from protobuf field .google.cloud.aiplatform.v1.ResourcePool.AutoscalingSpec autoscaling_spec = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $autoscaling_spec = null; + protected $autoscaling_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ResourcePool/AutoscalingSpec.php b/AiPlatform/src/V1/ResourcePool/AutoscalingSpec.php index af0d2a21b1c6..7ce4c11037b7 100644 --- a/AiPlatform/src/V1/ResourcePool/AutoscalingSpec.php +++ b/AiPlatform/src/V1/ResourcePool/AutoscalingSpec.php @@ -21,14 +21,14 @@ class AutoscalingSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int64 min_replica_count = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $min_replica_count = null; + protected $min_replica_count = null; /** * Optional. max replicas in the node pool, * must be ≥ replica_count and > min_replica_count or will throw error * * Generated from protobuf field optional int64 max_replica_count = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_replica_count = null; + protected $max_replica_count = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ResourceRuntime.php b/AiPlatform/src/V1/ResourceRuntime.php index 41ee6bb3e9f7..c301d63cc09b 100644 --- a/AiPlatform/src/V1/ResourceRuntime.php +++ b/AiPlatform/src/V1/ResourceRuntime.php @@ -15,6 +15,17 @@ */ class ResourceRuntime extends \Google\Protobuf\Internal\Message { + /** + * Output only. URIs for user to connect to the Cluster. + * Example: + * { + * "RAY_HEAD_NODE_INTERNAL_IP": "head-node-IP:10001" + * "RAY_DASHBOARD_URI": "ray-dashboard-address:8888" + * } + * + * Generated from protobuf field map access_uris = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $access_uris; /** * Constructor. @@ -22,6 +33,13 @@ class ResourceRuntime extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * + * @type array|\Google\Protobuf\Internal\MapField $access_uris + * Output only. URIs for user to connect to the Cluster. + * Example: + * { + * "RAY_HEAD_NODE_INTERNAL_IP": "head-node-IP:10001" + * "RAY_DASHBOARD_URI": "ray-dashboard-address:8888" + * } * } */ public function __construct($data = NULL) { @@ -29,5 +47,41 @@ public function __construct($data = NULL) { parent::__construct($data); } + /** + * Output only. URIs for user to connect to the Cluster. + * Example: + * { + * "RAY_HEAD_NODE_INTERNAL_IP": "head-node-IP:10001" + * "RAY_DASHBOARD_URI": "ray-dashboard-address:8888" + * } + * + * Generated from protobuf field map access_uris = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAccessUris() + { + return $this->access_uris; + } + + /** + * Output only. URIs for user to connect to the Cluster. + * Example: + * { + * "RAY_HEAD_NODE_INTERNAL_IP": "head-node-IP:10001" + * "RAY_DASHBOARD_URI": "ray-dashboard-address:8888" + * } + * + * Generated from protobuf field map access_uris = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAccessUris($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->access_uris = $arr; + + return $this; + } + } diff --git a/AiPlatform/src/V1/ResourceRuntimeSpec.php b/AiPlatform/src/V1/ResourceRuntimeSpec.php index 2603db6b157e..9bf65b864d45 100644 --- a/AiPlatform/src/V1/ResourceRuntimeSpec.php +++ b/AiPlatform/src/V1/ResourceRuntimeSpec.php @@ -23,14 +23,14 @@ class ResourceRuntimeSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.ServiceAccountSpec service_account_spec = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_account_spec = null; + protected $service_account_spec = null; /** * Optional. Ray cluster configuration. * Required when creating a dedicated RayCluster on the PersistentResource. * * Generated from protobuf field .google.cloud.aiplatform.v1.RaySpec ray_spec = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $ray_spec = null; + protected $ray_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ResourcesConsumed.php b/AiPlatform/src/V1/ResourcesConsumed.php index 6279ff842f6c..0d41d5452433 100644 --- a/AiPlatform/src/V1/ResourcesConsumed.php +++ b/AiPlatform/src/V1/ResourcesConsumed.php @@ -22,7 +22,7 @@ class ResourcesConsumed extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double replica_hours = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $replica_hours = 0.0; + protected $replica_hours = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/RestoreDatasetVersionOperationMetadata.php b/AiPlatform/src/V1/RestoreDatasetVersionOperationMetadata.php index 59efa8dfd619..217bf03075fb 100644 --- a/AiPlatform/src/V1/RestoreDatasetVersionOperationMetadata.php +++ b/AiPlatform/src/V1/RestoreDatasetVersionOperationMetadata.php @@ -21,7 +21,7 @@ class RestoreDatasetVersionOperationMetadata extends \Google\Protobuf\Internal\M * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/RestoreDatasetVersionRequest.php b/AiPlatform/src/V1/RestoreDatasetVersionRequest.php index 9b2afc54d556..15ded4c0ef97 100644 --- a/AiPlatform/src/V1/RestoreDatasetVersionRequest.php +++ b/AiPlatform/src/V1/RestoreDatasetVersionRequest.php @@ -23,7 +23,7 @@ class RestoreDatasetVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the DatasetVersion resource. diff --git a/AiPlatform/src/V1/ResumeModelDeploymentMonitoringJobRequest.php b/AiPlatform/src/V1/ResumeModelDeploymentMonitoringJobRequest.php index 58fc6d6b097f..221166cae089 100644 --- a/AiPlatform/src/V1/ResumeModelDeploymentMonitoringJobRequest.php +++ b/AiPlatform/src/V1/ResumeModelDeploymentMonitoringJobRequest.php @@ -23,7 +23,7 @@ class ResumeModelDeploymentMonitoringJobRequest extends \Google\Protobuf\Interna * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the ModelDeploymentMonitoringJob to resume. diff --git a/AiPlatform/src/V1/ResumeScheduleRequest.php b/AiPlatform/src/V1/ResumeScheduleRequest.php index a34f4ed6d71b..b0fcb05d11b4 100644 --- a/AiPlatform/src/V1/ResumeScheduleRequest.php +++ b/AiPlatform/src/V1/ResumeScheduleRequest.php @@ -23,7 +23,7 @@ class ResumeScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Whether to backfill missed runs when the schedule is resumed from * PAUSED state. If set to true, all missed runs will be scheduled. New runs @@ -33,7 +33,7 @@ class ResumeScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool catch_up = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $catch_up = false; + protected $catch_up = false; /** * @param string $name Required. The name of the Schedule resource to be resumed. diff --git a/AiPlatform/src/V1/Retrieval.php b/AiPlatform/src/V1/Retrieval.php index 581e7d138df4..584bb80f7da7 100644 --- a/AiPlatform/src/V1/Retrieval.php +++ b/AiPlatform/src/V1/Retrieval.php @@ -22,7 +22,7 @@ class Retrieval extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_attribution = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_attribution = false; + protected $disable_attribution = false; protected $source; /** diff --git a/AiPlatform/src/V1/SafetyRating.php b/AiPlatform/src/V1/SafetyRating.php index 52caea6e68a7..1e6d16fb0727 100644 --- a/AiPlatform/src/V1/SafetyRating.php +++ b/AiPlatform/src/V1/SafetyRating.php @@ -20,38 +20,38 @@ class SafetyRating extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $category = 0; + protected $category = 0; /** * Output only. Harm probability levels in the content. * * Generated from protobuf field .google.cloud.aiplatform.v1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $probability = 0; + protected $probability = 0; /** * Output only. Harm probability score. * * Generated from protobuf field float probability_score = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $probability_score = 0.0; + protected $probability_score = 0.0; /** * Output only. Harm severity levels in the content. * * Generated from protobuf field .google.cloud.aiplatform.v1.SafetyRating.HarmSeverity severity = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $severity = 0; + protected $severity = 0; /** * Output only. Harm severity score. * * Generated from protobuf field float severity_score = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $severity_score = 0.0; + protected $severity_score = 0.0; /** * Output only. Indicates whether the content was filtered out because of this * rating. * * Generated from protobuf field bool blocked = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $blocked = false; + protected $blocked = false; /** * Constructor. diff --git a/AiPlatform/src/V1/SafetySetting.php b/AiPlatform/src/V1/SafetySetting.php index 35baf65e189e..c0e1166ab466 100644 --- a/AiPlatform/src/V1/SafetySetting.php +++ b/AiPlatform/src/V1/SafetySetting.php @@ -20,20 +20,20 @@ class SafetySetting extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $category = 0; + protected $category = 0; /** * Required. The harm block threshold. * * Generated from protobuf field .google.cloud.aiplatform.v1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $threshold = 0; + protected $threshold = 0; /** * Optional. Specify if the threshold is used for probability or severity * score. If not specified, the threshold is used for probability score. * * Generated from protobuf field .google.cloud.aiplatform.v1.SafetySetting.HarmBlockMethod method = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $method = 0; + protected $method = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/SampleConfig.php b/AiPlatform/src/V1/SampleConfig.php index b9d38f11b642..661b3269d4fd 100644 --- a/AiPlatform/src/V1/SampleConfig.php +++ b/AiPlatform/src/V1/SampleConfig.php @@ -22,7 +22,7 @@ class SampleConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.SampleConfig.SampleStrategy sample_strategy = 5; */ - private $sample_strategy = 0; + protected $sample_strategy = 0; protected $initial_batch_sample_size; protected $following_batch_sample_size; diff --git a/AiPlatform/src/V1/SampledShapleyAttribution.php b/AiPlatform/src/V1/SampledShapleyAttribution.php index 915167ea132a..d278e3bd3fe2 100644 --- a/AiPlatform/src/V1/SampledShapleyAttribution.php +++ b/AiPlatform/src/V1/SampledShapleyAttribution.php @@ -24,7 +24,7 @@ class SampledShapleyAttribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 path_count = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $path_count = 0; + protected $path_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/SamplingStrategy.php b/AiPlatform/src/V1/SamplingStrategy.php index 694247c239ad..848503ce1523 100644 --- a/AiPlatform/src/V1/SamplingStrategy.php +++ b/AiPlatform/src/V1/SamplingStrategy.php @@ -21,7 +21,7 @@ class SamplingStrategy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.SamplingStrategy.RandomSampleConfig random_sample_config = 1; */ - private $random_sample_config = null; + protected $random_sample_config = null; /** * Constructor. diff --git a/AiPlatform/src/V1/SamplingStrategy/RandomSampleConfig.php b/AiPlatform/src/V1/SamplingStrategy/RandomSampleConfig.php index 22f73a5ff5ff..770395755056 100644 --- a/AiPlatform/src/V1/SamplingStrategy/RandomSampleConfig.php +++ b/AiPlatform/src/V1/SamplingStrategy/RandomSampleConfig.php @@ -20,7 +20,7 @@ class RandomSampleConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double sample_rate = 1; */ - private $sample_rate = 0.0; + protected $sample_rate = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/SavedQuery.php b/AiPlatform/src/V1/SavedQuery.php index dcc241e41967..82d7fd0f4e47 100644 --- a/AiPlatform/src/V1/SavedQuery.php +++ b/AiPlatform/src/V1/SavedQuery.php @@ -21,7 +21,7 @@ class SavedQuery extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-defined name of the SavedQuery. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -29,31 +29,31 @@ class SavedQuery extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Some additional information about the SavedQuery. * * Generated from protobuf field .google.protobuf.Value metadata = 12; */ - private $metadata = null; + protected $metadata = null; /** * Output only. Timestamp when this SavedQuery was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when SavedQuery was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Filters on the Annotations in the dataset. * * Generated from protobuf field string annotation_filter = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $annotation_filter = ''; + protected $annotation_filter = ''; /** * Required. Problem type of the SavedQuery. * Allowed values: @@ -70,27 +70,27 @@ class SavedQuery extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string problem_type = 6 [(.google.api.field_behavior) = REQUIRED]; */ - private $problem_type = ''; + protected $problem_type = ''; /** * Output only. Number of AnnotationSpecs in the context of the SavedQuery. * * Generated from protobuf field int32 annotation_spec_count = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $annotation_spec_count = 0; + protected $annotation_spec_count = 0; /** * Used to perform a consistent read-modify-write update. If not set, a blind * "overwrite" update happens. * * Generated from protobuf field string etag = 8; */ - private $etag = ''; + protected $etag = ''; /** * Output only. If the Annotations belonging to the SavedQuery can be used for * AutoML training. * * Generated from protobuf field bool support_automl_training = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $support_automl_training = false; + protected $support_automl_training = false; /** * Constructor. diff --git a/AiPlatform/src/V1/Scalar.php b/AiPlatform/src/V1/Scalar.php index 779a9e69be7b..5e961e590f11 100644 --- a/AiPlatform/src/V1/Scalar.php +++ b/AiPlatform/src/V1/Scalar.php @@ -20,7 +20,7 @@ class Scalar extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double value = 1; */ - private $value = 0.0; + protected $value = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/Schedule.php b/AiPlatform/src/V1/Schedule.php index 2fd34e7efc25..89cc4b07e8c6 100644 --- a/AiPlatform/src/V1/Schedule.php +++ b/AiPlatform/src/V1/Schedule.php @@ -21,7 +21,7 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Required. User provided name of the Schedule. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -29,14 +29,14 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. Timestamp after which the first run can be scheduled. * Default to Schedule create time if not specified. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $start_time = null; + protected $start_time = null; /** * Optional. Timestamp after which no new runs can be scheduled. * If specified, The schedule will be completed when either @@ -47,7 +47,7 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $end_time = null; + protected $end_time = null; /** * Optional. Maximum run count of the schedule. * If specified, The schedule will be completed when either @@ -58,31 +58,31 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 max_run_count = 16 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_run_count = 0; + protected $max_run_count = 0; /** * Output only. The number of runs started by this schedule. * * Generated from protobuf field int64 started_run_count = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $started_run_count = 0; + protected $started_run_count = 0; /** * Output only. The state of this Schedule. * * Generated from protobuf field .google.cloud.aiplatform.v1.Schedule.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Timestamp when this Schedule was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Schedule was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Timestamp when this Schedule should schedule the next run. * Having a next_run_time in the past means the runs are being started @@ -90,21 +90,21 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp next_run_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_run_time = null; + protected $next_run_time = null; /** * Output only. Timestamp when this Schedule was last paused. * Unset if never paused. * * Generated from protobuf field .google.protobuf.Timestamp last_pause_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $last_pause_time = null; + protected $last_pause_time = null; /** * Output only. Timestamp when this Schedule was last resumed. * Unset if never resumed from pause. * * Generated from protobuf field .google.protobuf.Timestamp last_resume_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $last_resume_time = null; + protected $last_resume_time = null; /** * Required. Maximum number of runs that can be started concurrently for this * Schedule. This is the limit for starting the scheduled requests and not the @@ -112,7 +112,7 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 max_concurrent_run_count = 11 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_concurrent_run_count = 0; + protected $max_concurrent_run_count = 0; /** * Optional. Whether new scheduled runs can be queued when max_concurrent_runs * limit is reached. If set to true, new runs will be queued instead of @@ -120,7 +120,7 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool allow_queueing = 12 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_queueing = false; + protected $allow_queueing = false; /** * Output only. Whether to backfill missed runs when the schedule is resumed * from PAUSED state. If set to true, all missed runs will be scheduled. New @@ -128,7 +128,7 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool catch_up = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $catch_up = false; + protected $catch_up = false; /** * Output only. Response of the last scheduled run. * This is the response for starting the scheduled requests and not the @@ -137,7 +137,7 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Schedule.RunResponse last_scheduled_run_response = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $last_scheduled_run_response = null; + protected $last_scheduled_run_response = null; protected $time_specification; protected $request; diff --git a/AiPlatform/src/V1/Schedule/RunResponse.php b/AiPlatform/src/V1/Schedule/RunResponse.php index 0cd7dfa917d9..62593a3f5306 100644 --- a/AiPlatform/src/V1/Schedule/RunResponse.php +++ b/AiPlatform/src/V1/Schedule/RunResponse.php @@ -20,13 +20,13 @@ class RunResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp scheduled_run_time = 1; */ - private $scheduled_run_time = null; + protected $scheduled_run_time = null; /** * The response of the scheduled run. * * Generated from protobuf field string run_response = 2; */ - private $run_response = ''; + protected $run_response = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ScheduleServiceClient.php b/AiPlatform/src/V1/ScheduleServiceClient.php deleted file mode 100644 index e172aec6ea60..000000000000 --- a/AiPlatform/src/V1/ScheduleServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -.google.protobuf.Duration timeout = 1; */ - private $timeout = null; + protected $timeout = null; /** * Restarts the entire CustomJob if a worker gets restarted. * This feature can be used by distributed training jobs that are not @@ -28,7 +28,7 @@ class Scheduling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool restart_job_on_worker_restart = 3; */ - private $restart_job_on_worker_restart = false; + protected $restart_job_on_worker_restart = false; /** * Optional. Indicates if the job should retry for internal errors after the * job starts running. If true, overrides @@ -36,7 +36,7 @@ class Scheduling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_retries = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_retries = false; + protected $disable_retries = false; /** * Constructor. diff --git a/AiPlatform/src/V1/Schema.php b/AiPlatform/src/V1/Schema.php index 4fed6769878d..86a814c3aea4 100644 --- a/AiPlatform/src/V1/Schema.php +++ b/AiPlatform/src/V1/Schema.php @@ -23,7 +23,7 @@ class Schema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type = 0; + protected $type = 0; /** * Optional. The format of the data. * Supported formats: @@ -33,50 +33,50 @@ class Schema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string format = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $format = ''; + protected $format = ''; /** * Optional. The title of the Schema. * * Generated from protobuf field string title = 24 [(.google.api.field_behavior) = OPTIONAL]; */ - private $title = ''; + protected $title = ''; /** * Optional. The description of the data. * * Generated from protobuf field string description = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. Indicates if the value may be null. * * Generated from protobuf field bool nullable = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $nullable = false; + protected $nullable = false; /** * Optional. Default value of the data. * * Generated from protobuf field .google.protobuf.Value default = 23 [(.google.api.field_behavior) = OPTIONAL]; */ - private $default = null; + protected $default = null; /** * Optional. SCHEMA FIELDS FOR TYPE ARRAY * Schema of the elements of Type.ARRAY. * * Generated from protobuf field .google.cloud.aiplatform.v1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $items = null; + protected $items = null; /** * Optional. Minimum number of the elements for Type.ARRAY. * * Generated from protobuf field int64 min_items = 21 [(.google.api.field_behavior) = OPTIONAL]; */ - private $min_items = 0; + protected $min_items = 0; /** * Optional. Maximum number of the elements for Type.ARRAY. * * Generated from protobuf field int64 max_items = 22 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_items = 0; + protected $max_items = 0; /** * Optional. Possible values of the element of Type.STRING with enum format. * For example we can define an Enum Direction as : @@ -103,53 +103,53 @@ class Schema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 min_properties = 14 [(.google.api.field_behavior) = OPTIONAL]; */ - private $min_properties = 0; + protected $min_properties = 0; /** * Optional. Maximum number of the properties for Type.OBJECT. * * Generated from protobuf field int64 max_properties = 15 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_properties = 0; + protected $max_properties = 0; /** * Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER * Minimum value of the Type.INTEGER and Type.NUMBER * * Generated from protobuf field double minimum = 16 [(.google.api.field_behavior) = OPTIONAL]; */ - private $minimum = 0.0; + protected $minimum = 0.0; /** * Optional. Maximum value of the Type.INTEGER and Type.NUMBER * * Generated from protobuf field double maximum = 17 [(.google.api.field_behavior) = OPTIONAL]; */ - private $maximum = 0.0; + protected $maximum = 0.0; /** * Optional. SCHEMA FIELDS FOR TYPE STRING * Minimum length of the Type.STRING * * Generated from protobuf field int64 min_length = 18 [(.google.api.field_behavior) = OPTIONAL]; */ - private $min_length = 0; + protected $min_length = 0; /** * Optional. Maximum length of the Type.STRING * * Generated from protobuf field int64 max_length = 19 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_length = 0; + protected $max_length = 0; /** * Optional. Pattern of the Type.STRING to restrict a string to a regular * expression. * * Generated from protobuf field string pattern = 20 [(.google.api.field_behavior) = OPTIONAL]; */ - private $pattern = ''; + protected $pattern = ''; /** * Optional. Example of the object. Will only populated when the object is the * root. * * Generated from protobuf field .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $example = null; + protected $example = null; /** * Constructor. diff --git a/AiPlatform/src/V1/SearchDataItemsRequest.php b/AiPlatform/src/V1/SearchDataItemsRequest.php index 80214aa4d1c8..627f8ecaf19c 100644 --- a/AiPlatform/src/V1/SearchDataItemsRequest.php +++ b/AiPlatform/src/V1/SearchDataItemsRequest.php @@ -23,7 +23,7 @@ class SearchDataItemsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $dataset = ''; + protected $dataset = ''; /** * The resource name of a SavedQuery(annotation set in UI). * Format: @@ -43,7 +43,7 @@ class SearchDataItemsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_labeling_job = 3; */ - private $data_labeling_job = ''; + protected $data_labeling_job = ''; /** * An expression for filtering the DataItem that will be returned. * * `data_item_id` - for = or !=. @@ -57,7 +57,7 @@ class SearchDataItemsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_item_filter = 4; */ - private $data_item_filter = ''; + protected $data_item_filter = ''; /** * An expression for filtering the Annotations that will be returned per * DataItem. @@ -83,7 +83,7 @@ class SearchDataItemsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask field_mask = 6; */ - private $field_mask = null; + protected $field_mask = null; /** * If set, only up to this many of Annotations will be returned per * DataItemView. The maximum value is 1000. If not set, the maximum value will @@ -91,14 +91,14 @@ class SearchDataItemsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 annotations_limit = 7; */ - private $annotations_limit = 0; + protected $annotations_limit = 0; /** * Requested page size. Server may return fewer results than requested. * Default and maximum page size is 100. * * Generated from protobuf field int32 page_size = 8; */ - private $page_size = 0; + protected $page_size = 0; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. @@ -117,7 +117,7 @@ class SearchDataItemsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 10; */ - private $page_token = ''; + protected $page_token = ''; protected $order; /** diff --git a/AiPlatform/src/V1/SearchDataItemsRequest/OrderByAnnotation.php b/AiPlatform/src/V1/SearchDataItemsRequest/OrderByAnnotation.php index 688ee2b906bd..708439caf60b 100644 --- a/AiPlatform/src/V1/SearchDataItemsRequest/OrderByAnnotation.php +++ b/AiPlatform/src/V1/SearchDataItemsRequest/OrderByAnnotation.php @@ -21,7 +21,7 @@ class OrderByAnnotation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string saved_query = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $saved_query = ''; + protected $saved_query = ''; /** * A comma-separated list of annotation fields to order by, sorted in * ascending order. Use "desc" after a field name for descending. Must also @@ -29,7 +29,7 @@ class OrderByAnnotation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 2; */ - private $order_by = ''; + protected $order_by = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/SearchDataItemsResponse.php b/AiPlatform/src/V1/SearchDataItemsResponse.php index 36f12d6efd1f..b2e4f2eee135 100644 --- a/AiPlatform/src/V1/SearchDataItemsResponse.php +++ b/AiPlatform/src/V1/SearchDataItemsResponse.php @@ -30,7 +30,7 @@ class SearchDataItemsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/SearchEntryPoint.php b/AiPlatform/src/V1/SearchEntryPoint.php new file mode 100644 index 000000000000..ad159bbc4f8d --- /dev/null +++ b/AiPlatform/src/V1/SearchEntryPoint.php @@ -0,0 +1,109 @@ +google.cloud.aiplatform.v1.SearchEntryPoint + */ +class SearchEntryPoint extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Web content snippet that can be embedded in a web page or an app + * webview. + * + * Generated from protobuf field string rendered_content = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rendered_content = ''; + /** + * Optional. Base64 encoded JSON representing array of tuple. + * + * Generated from protobuf field bytes sdk_blob = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sdk_blob = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $rendered_content + * Optional. Web content snippet that can be embedded in a web page or an app + * webview. + * @type string $sdk_blob + * Optional. Base64 encoded JSON representing array of tuple. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\Content::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Web content snippet that can be embedded in a web page or an app + * webview. + * + * Generated from protobuf field string rendered_content = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRenderedContent() + { + return $this->rendered_content; + } + + /** + * Optional. Web content snippet that can be embedded in a web page or an app + * webview. + * + * Generated from protobuf field string rendered_content = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRenderedContent($var) + { + GPBUtil::checkString($var, True); + $this->rendered_content = $var; + + return $this; + } + + /** + * Optional. Base64 encoded JSON representing array of tuple. + * + * Generated from protobuf field bytes sdk_blob = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSdkBlob() + { + return $this->sdk_blob; + } + + /** + * Optional. Base64 encoded JSON representing array of tuple. + * + * Generated from protobuf field bytes sdk_blob = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSdkBlob($var) + { + GPBUtil::checkString($var, False); + $this->sdk_blob = $var; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/SearchFeaturesRequest.php b/AiPlatform/src/V1/SearchFeaturesRequest.php index 8c40e22e5153..cc217005173e 100644 --- a/AiPlatform/src/V1/SearchFeaturesRequest.php +++ b/AiPlatform/src/V1/SearchFeaturesRequest.php @@ -23,7 +23,7 @@ class SearchFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $location = ''; + protected $location = ''; /** * Query string that is a conjunction of field-restricted queries and/or * field-restricted filters. Field-restricted queries and filters can be @@ -76,7 +76,7 @@ class SearchFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string query = 3; */ - private $query = ''; + protected $query = ''; /** * The maximum number of Features to return. The service may return fewer * than this value. If unspecified, at most 100 Features will be returned. @@ -85,7 +85,7 @@ class SearchFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 4; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous * [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures] @@ -96,7 +96,7 @@ class SearchFeaturesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 5; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $location Required. The resource name of the Location to search Features. diff --git a/AiPlatform/src/V1/SearchFeaturesResponse.php b/AiPlatform/src/V1/SearchFeaturesResponse.php index 788e1f68232d..636aeed0f6a2 100644 --- a/AiPlatform/src/V1/SearchFeaturesResponse.php +++ b/AiPlatform/src/V1/SearchFeaturesResponse.php @@ -36,7 +36,7 @@ class SearchFeaturesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/SearchMigratableResourcesRequest.php b/AiPlatform/src/V1/SearchMigratableResourcesRequest.php index ebc06fa0e291..8f8a2b73fd50 100644 --- a/AiPlatform/src/V1/SearchMigratableResourcesRequest.php +++ b/AiPlatform/src/V1/SearchMigratableResourcesRequest.php @@ -24,20 +24,20 @@ class SearchMigratableResourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The standard page size. * The default and maximum value is 100. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard page token. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * A filter for your search. You can use the following types of filters: * * Resource type filters. The following strings filter for a specific type @@ -53,7 +53,7 @@ class SearchMigratableResourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The location that the migratable resources should be searched diff --git a/AiPlatform/src/V1/SearchMigratableResourcesResponse.php b/AiPlatform/src/V1/SearchMigratableResourcesResponse.php index 985ac3037688..28f96674416c 100644 --- a/AiPlatform/src/V1/SearchMigratableResourcesResponse.php +++ b/AiPlatform/src/V1/SearchMigratableResourcesResponse.php @@ -30,7 +30,7 @@ class SearchMigratableResourcesResponse extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesRequest.php b/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesRequest.php index ad67e6648c42..9538a5de4774 100644 --- a/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesRequest.php +++ b/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesRequest.php @@ -23,14 +23,14 @@ class SearchModelDeploymentMonitoringStatsAnomaliesRequest extends \Google\Proto * * Generated from protobuf field string model_deployment_monitoring_job = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $model_deployment_monitoring_job = ''; + protected $model_deployment_monitoring_job = ''; /** * Required. The DeployedModel ID of the * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. * * Generated from protobuf field string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployed_model_id = ''; + protected $deployed_model_id = ''; /** * The feature display name. If specified, only return the stats belonging to * this feature. Format: @@ -39,7 +39,7 @@ class SearchModelDeploymentMonitoringStatsAnomaliesRequest extends \Google\Proto * * Generated from protobuf field string feature_display_name = 3; */ - private $feature_display_name = ''; + protected $feature_display_name = ''; /** * Required. Objectives of the stats to retrieve. * @@ -51,7 +51,7 @@ class SearchModelDeploymentMonitoringStatsAnomaliesRequest extends \Google\Proto * * Generated from protobuf field int32 page_size = 5; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token received from a previous * [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies] @@ -59,21 +59,21 @@ class SearchModelDeploymentMonitoringStatsAnomaliesRequest extends \Google\Proto * * Generated from protobuf field string page_token = 6; */ - private $page_token = ''; + protected $page_token = ''; /** * The earliest timestamp of stats being generated. * If not set, indicates fetching stats till the earliest possible one. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 7; */ - private $start_time = null; + protected $start_time = null; /** * The latest timestamp of stats being generated. * If not set, indicates feching stats till the latest possible one. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 8; */ - private $end_time = null; + protected $end_time = null; /** * @param string $modelDeploymentMonitoringJob Required. ModelDeploymentMonitoring Job resource name. diff --git a/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesRequest/StatsAnomaliesObjective.php b/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesRequest/StatsAnomaliesObjective.php index 2e7379de47b7..c5c5dbf7fa7b 100644 --- a/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesRequest/StatsAnomaliesObjective.php +++ b/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesRequest/StatsAnomaliesObjective.php @@ -18,7 +18,7 @@ class StatsAnomaliesObjective extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveType type = 1; */ - private $type = 0; + protected $type = 0; /** * If set, all attribution scores between * [SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time][google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time] @@ -30,7 +30,7 @@ class StatsAnomaliesObjective extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 top_feature_count = 4; */ - private $top_feature_count = 0; + protected $top_feature_count = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesResponse.php b/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesResponse.php index fa055bdc8e55..3b4668717392 100644 --- a/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesResponse.php +++ b/AiPlatform/src/V1/SearchModelDeploymentMonitoringStatsAnomaliesResponse.php @@ -32,7 +32,7 @@ class SearchModelDeploymentMonitoringStatsAnomaliesResponse extends \Google\Prot * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/SearchNearestEntitiesRequest.php b/AiPlatform/src/V1/SearchNearestEntitiesRequest.php index f490ab6e3270..f1098caf7ca7 100644 --- a/AiPlatform/src/V1/SearchNearestEntitiesRequest.php +++ b/AiPlatform/src/V1/SearchNearestEntitiesRequest.php @@ -22,13 +22,13 @@ class SearchNearestEntitiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_view = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $feature_view = ''; + protected $feature_view = ''; /** * Required. The query. * * Generated from protobuf field .google.cloud.aiplatform.v1.NearestNeighborQuery query = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $query = null; + protected $query = null; /** * Optional. If set to true, the full entities (including all vector values * and metadata) of the nearest neighbors are returned; otherwise only entity @@ -37,7 +37,7 @@ class SearchNearestEntitiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool return_full_entity = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $return_full_entity = false; + protected $return_full_entity = false; /** * Constructor. diff --git a/AiPlatform/src/V1/SearchNearestEntitiesResponse.php b/AiPlatform/src/V1/SearchNearestEntitiesResponse.php index 53e3b7e45b7d..8ddfef06dc8b 100644 --- a/AiPlatform/src/V1/SearchNearestEntitiesResponse.php +++ b/AiPlatform/src/V1/SearchNearestEntitiesResponse.php @@ -21,7 +21,7 @@ class SearchNearestEntitiesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.NearestNeighbors nearest_neighbors = 1; */ - private $nearest_neighbors = null; + protected $nearest_neighbors = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Segment.php b/AiPlatform/src/V1/Segment.php deleted file mode 100644 index 63d273996c64..000000000000 --- a/AiPlatform/src/V1/Segment.php +++ /dev/null @@ -1,143 +0,0 @@ -google.cloud.aiplatform.v1.Segment - */ -class Segment extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The index of a Part object within its parent Content object. - * - * Generated from protobuf field int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $part_index = 0; - /** - * Output only. Start index in the given Part, measured in bytes. Offset from - * the start of the Part, inclusive, starting at zero. - * - * Generated from protobuf field int32 start_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_index = 0; - /** - * Output only. End index in the given Part, measured in bytes. Offset from - * the start of the Part, exclusive, starting at zero. - * - * Generated from protobuf field int32 end_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_index = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $part_index - * Output only. The index of a Part object within its parent Content object. - * @type int $start_index - * Output only. Start index in the given Part, measured in bytes. Offset from - * the start of the Part, inclusive, starting at zero. - * @type int $end_index - * Output only. End index in the given Part, measured in bytes. Offset from - * the start of the Part, exclusive, starting at zero. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Aiplatform\V1\Content::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The index of a Part object within its parent Content object. - * - * Generated from protobuf field int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getPartIndex() - { - return $this->part_index; - } - - /** - * Output only. The index of a Part object within its parent Content object. - * - * Generated from protobuf field int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setPartIndex($var) - { - GPBUtil::checkInt32($var); - $this->part_index = $var; - - return $this; - } - - /** - * Output only. Start index in the given Part, measured in bytes. Offset from - * the start of the Part, inclusive, starting at zero. - * - * Generated from protobuf field int32 start_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getStartIndex() - { - return $this->start_index; - } - - /** - * Output only. Start index in the given Part, measured in bytes. Offset from - * the start of the Part, inclusive, starting at zero. - * - * Generated from protobuf field int32 start_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setStartIndex($var) - { - GPBUtil::checkInt32($var); - $this->start_index = $var; - - return $this; - } - - /** - * Output only. End index in the given Part, measured in bytes. Offset from - * the start of the Part, exclusive, starting at zero. - * - * Generated from protobuf field int32 end_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getEndIndex() - { - return $this->end_index; - } - - /** - * Output only. End index in the given Part, measured in bytes. Offset from - * the start of the Part, exclusive, starting at zero. - * - * Generated from protobuf field int32 end_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setEndIndex($var) - { - GPBUtil::checkInt32($var); - $this->end_index = $var; - - return $this; - } - -} - diff --git a/AiPlatform/src/V1/ServiceAccountSpec.php b/AiPlatform/src/V1/ServiceAccountSpec.php index 95c55ce9fbe5..43e9a58b5110 100644 --- a/AiPlatform/src/V1/ServiceAccountSpec.php +++ b/AiPlatform/src/V1/ServiceAccountSpec.php @@ -23,7 +23,7 @@ class ServiceAccountSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_custom_service_account = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $enable_custom_service_account = false; + protected $enable_custom_service_account = false; /** * Optional. Required when all below conditions are met * * `enable_custom_service_account` is true; @@ -37,7 +37,7 @@ class ServiceAccountSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_account = ''; + protected $service_account = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/ShieldedVmConfig.php b/AiPlatform/src/V1/ShieldedVmConfig.php index fda7ed22871d..fef3e5f2ec86 100644 --- a/AiPlatform/src/V1/ShieldedVmConfig.php +++ b/AiPlatform/src/V1/ShieldedVmConfig.php @@ -27,7 +27,7 @@ class ShieldedVmConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_secure_boot = 1; */ - private $enable_secure_boot = false; + protected $enable_secure_boot = false; /** * Constructor. diff --git a/AiPlatform/src/V1/SmoothGradConfig.php b/AiPlatform/src/V1/SmoothGradConfig.php index 69a4e700a76f..68fcd8ec3a2d 100644 --- a/AiPlatform/src/V1/SmoothGradConfig.php +++ b/AiPlatform/src/V1/SmoothGradConfig.php @@ -27,7 +27,7 @@ class SmoothGradConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 noisy_sample_count = 3; */ - private $noisy_sample_count = 0; + protected $noisy_sample_count = 0; protected $GradientNoiseSigma; /** diff --git a/AiPlatform/src/V1/SpecialistPool.php b/AiPlatform/src/V1/SpecialistPool.php index d7a2213c6f27..acbd7028f741 100644 --- a/AiPlatform/src/V1/SpecialistPool.php +++ b/AiPlatform/src/V1/SpecialistPool.php @@ -25,7 +25,7 @@ class SpecialistPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-defined name of the SpecialistPool. * The name can be up to 128 characters long and can consist of any UTF-8 @@ -34,13 +34,13 @@ class SpecialistPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. The number of managers in this SpecialistPool. * * Generated from protobuf field int32 specialist_managers_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $specialist_managers_count = 0; + protected $specialist_managers_count = 0; /** * The email addresses of the managers in the SpecialistPool. * diff --git a/AiPlatform/src/V1/SpecialistPoolServiceClient.php b/AiPlatform/src/V1/SpecialistPoolServiceClient.php deleted file mode 100644 index d913389ac7e8..000000000000 --- a/AiPlatform/src/V1/SpecialistPoolServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.SpecialistPoolService/CreateSpecialistPool', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets a SpecialistPool. - * @param \Google\Cloud\AIPlatform\V1\GetSpecialistPoolRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetSpecialistPool(\Google\Cloud\AIPlatform\V1\GetSpecialistPoolRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.SpecialistPoolService/GetSpecialistPool', - $argument, - ['\Google\Cloud\AIPlatform\V1\SpecialistPool', 'decode'], - $metadata, $options); - } - - /** - * Lists SpecialistPools in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListSpecialistPoolsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListSpecialistPools(\Google\Cloud\AIPlatform\V1\ListSpecialistPoolsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.SpecialistPoolService/ListSpecialistPools', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListSpecialistPoolsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a SpecialistPool as well as all Specialists in the pool. - * @param \Google\Cloud\AIPlatform\V1\DeleteSpecialistPoolRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteSpecialistPool(\Google\Cloud\AIPlatform\V1\DeleteSpecialistPoolRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.SpecialistPoolService/DeleteSpecialistPool', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a SpecialistPool. - * @param \Google\Cloud\AIPlatform\V1\UpdateSpecialistPoolRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateSpecialistPool(\Google\Cloud\AIPlatform\V1\UpdateSpecialistPoolRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.SpecialistPoolService/UpdateSpecialistPool', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/StartNotebookRuntimeOperationMetadata.php b/AiPlatform/src/V1/StartNotebookRuntimeOperationMetadata.php index 7a7a00690d7a..0c969bac9e0f 100644 --- a/AiPlatform/src/V1/StartNotebookRuntimeOperationMetadata.php +++ b/AiPlatform/src/V1/StartNotebookRuntimeOperationMetadata.php @@ -21,14 +21,14 @@ class StartNotebookRuntimeOperationMetadata extends \Google\Protobuf\Internal\Me * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * A human-readable message that shows the intermediate progress details of * NotebookRuntime. * * Generated from protobuf field string progress_message = 2; */ - private $progress_message = ''; + protected $progress_message = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/StartNotebookRuntimeRequest.php b/AiPlatform/src/V1/StartNotebookRuntimeRequest.php index 97757ea4bab6..000e5cc7a293 100644 --- a/AiPlatform/src/V1/StartNotebookRuntimeRequest.php +++ b/AiPlatform/src/V1/StartNotebookRuntimeRequest.php @@ -24,7 +24,7 @@ class StartNotebookRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NotebookRuntime resource to be started. diff --git a/AiPlatform/src/V1/StopTrialRequest.php b/AiPlatform/src/V1/StopTrialRequest.php index a493573bf5b8..1954d1d69d78 100644 --- a/AiPlatform/src/V1/StopTrialRequest.php +++ b/AiPlatform/src/V1/StopTrialRequest.php @@ -23,7 +23,7 @@ class StopTrialRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/StratifiedSplit.php b/AiPlatform/src/V1/StratifiedSplit.php index ba1a0e79af0a..0a08505d2bd2 100644 --- a/AiPlatform/src/V1/StratifiedSplit.php +++ b/AiPlatform/src/V1/StratifiedSplit.php @@ -33,26 +33,26 @@ class StratifiedSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double training_fraction = 1; */ - private $training_fraction = 0.0; + protected $training_fraction = 0.0; /** * The fraction of the input data that is to be used to validate the Model. * * Generated from protobuf field double validation_fraction = 2; */ - private $validation_fraction = 0.0; + protected $validation_fraction = 0.0; /** * The fraction of the input data that is to be used to evaluate the Model. * * Generated from protobuf field double test_fraction = 3; */ - private $test_fraction = 0.0; + protected $test_fraction = 0.0; /** * Required. The key is a name of one of the Dataset's data columns. * The key provided must be for a categorical column. * * Generated from protobuf field string key = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $key = ''; + protected $key = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/StreamDirectPredictRequest.php b/AiPlatform/src/V1/StreamDirectPredictRequest.php index 5cd53ba6f936..2d21ad060147 100644 --- a/AiPlatform/src/V1/StreamDirectPredictRequest.php +++ b/AiPlatform/src/V1/StreamDirectPredictRequest.php @@ -27,7 +27,7 @@ class StreamDirectPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Optional. The prediction input. * @@ -39,7 +39,7 @@ class StreamDirectPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Tensor parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $parameters = null; + protected $parameters = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StreamDirectPredictResponse.php b/AiPlatform/src/V1/StreamDirectPredictResponse.php index 6677eb8e7220..44425eea22f0 100644 --- a/AiPlatform/src/V1/StreamDirectPredictResponse.php +++ b/AiPlatform/src/V1/StreamDirectPredictResponse.php @@ -27,7 +27,7 @@ class StreamDirectPredictResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Tensor parameters = 2; */ - private $parameters = null; + protected $parameters = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StreamDirectRawPredictRequest.php b/AiPlatform/src/V1/StreamDirectRawPredictRequest.php index 30e80119f01b..a67a26f96fbb 100644 --- a/AiPlatform/src/V1/StreamDirectRawPredictRequest.php +++ b/AiPlatform/src/V1/StreamDirectRawPredictRequest.php @@ -33,7 +33,7 @@ class StreamDirectRawPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Optional. Fully qualified name of the API method being invoked to perform * predictions. @@ -44,13 +44,13 @@ class StreamDirectRawPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string method_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $method_name = ''; + protected $method_name = ''; /** * Optional. The prediction input. * * Generated from protobuf field bytes input = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $input = ''; + protected $input = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/StreamDirectRawPredictResponse.php b/AiPlatform/src/V1/StreamDirectRawPredictResponse.php index 5efd68fcdbfe..d0de9bdcf902 100644 --- a/AiPlatform/src/V1/StreamDirectRawPredictResponse.php +++ b/AiPlatform/src/V1/StreamDirectRawPredictResponse.php @@ -21,7 +21,7 @@ class StreamDirectRawPredictResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes output = 1; */ - private $output = ''; + protected $output = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/StreamRawPredictRequest.php b/AiPlatform/src/V1/StreamRawPredictRequest.php index 885c04914ccd..1d18a1f20baf 100644 --- a/AiPlatform/src/V1/StreamRawPredictRequest.php +++ b/AiPlatform/src/V1/StreamRawPredictRequest.php @@ -23,13 +23,13 @@ class StreamRawPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * The prediction input. Supports HTTP headers and arbitrary data payload. * * Generated from protobuf field .google.api.HttpBody http_body = 2; */ - private $http_body = null; + protected $http_body = null; /** * @param string $endpoint Required. The name of the Endpoint requested to serve the prediction. diff --git a/AiPlatform/src/V1/StreamingPredictRequest.php b/AiPlatform/src/V1/StreamingPredictRequest.php index 35b40a6787a1..712c1cdcd8e2 100644 --- a/AiPlatform/src/V1/StreamingPredictRequest.php +++ b/AiPlatform/src/V1/StreamingPredictRequest.php @@ -26,7 +26,7 @@ class StreamingPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * The prediction input. * @@ -38,7 +38,7 @@ class StreamingPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Tensor parameters = 3; */ - private $parameters = null; + protected $parameters = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StreamingPredictResponse.php b/AiPlatform/src/V1/StreamingPredictResponse.php index 44a7b5fce9ae..af912ba64203 100644 --- a/AiPlatform/src/V1/StreamingPredictResponse.php +++ b/AiPlatform/src/V1/StreamingPredictResponse.php @@ -27,7 +27,7 @@ class StreamingPredictResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Tensor parameters = 2; */ - private $parameters = null; + protected $parameters = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StreamingRawPredictRequest.php b/AiPlatform/src/V1/StreamingRawPredictRequest.php index cc16d4d3a4af..889f01be16b5 100644 --- a/AiPlatform/src/V1/StreamingRawPredictRequest.php +++ b/AiPlatform/src/V1/StreamingRawPredictRequest.php @@ -33,7 +33,7 @@ class StreamingRawPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Fully qualified name of the API method being invoked to perform * predictions. @@ -44,13 +44,13 @@ class StreamingRawPredictRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string method_name = 2; */ - private $method_name = ''; + protected $method_name = ''; /** * The prediction input. * * Generated from protobuf field bytes input = 3; */ - private $input = ''; + protected $input = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/StreamingRawPredictResponse.php b/AiPlatform/src/V1/StreamingRawPredictResponse.php index ba43e40ae271..b3d45235e160 100644 --- a/AiPlatform/src/V1/StreamingRawPredictResponse.php +++ b/AiPlatform/src/V1/StreamingRawPredictResponse.php @@ -21,7 +21,7 @@ class StreamingRawPredictResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes output = 1; */ - private $output = ''; + protected $output = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/StreamingReadFeatureValuesRequest.php b/AiPlatform/src/V1/StreamingReadFeatureValuesRequest.php index 16ca42866c64..4bb996f890bd 100644 --- a/AiPlatform/src/V1/StreamingReadFeatureValuesRequest.php +++ b/AiPlatform/src/V1/StreamingReadFeatureValuesRequest.php @@ -26,7 +26,7 @@ class StreamingReadFeatureValuesRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $entity_type = ''; + protected $entity_type = ''; /** * Required. IDs of entities to read Feature values of. The maximum number of * IDs is 100. For example, for a machine learning model predicting user @@ -41,7 +41,7 @@ class StreamingReadFeatureValuesRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureSelector feature_selector = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_selector = null; + protected $feature_selector = null; /** * @param string $entityType Required. The resource name of the entities' type. diff --git a/AiPlatform/src/V1/StructFieldValue.php b/AiPlatform/src/V1/StructFieldValue.php new file mode 100644 index 000000000000..6ca556157e4e --- /dev/null +++ b/AiPlatform/src/V1/StructFieldValue.php @@ -0,0 +1,111 @@ +google.cloud.aiplatform.v1.StructFieldValue + */ +class StructFieldValue extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the field in the struct feature. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The value for this field. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureValue value = 2; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the field in the struct feature. + * @type \Google\Cloud\AIPlatform\V1\FeatureValue $value + * The value for this field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\FeaturestoreOnlineService::initOnce(); + parent::__construct($data); + } + + /** + * Name of the field in the struct feature. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the field in the struct feature. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The value for this field. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureValue value = 2; + * @return \Google\Cloud\AIPlatform\V1\FeatureValue|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The value for this field. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureValue value = 2; + * @param \Google\Cloud\AIPlatform\V1\FeatureValue $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\FeatureValue::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/StructValue.php b/AiPlatform/src/V1/StructValue.php new file mode 100644 index 000000000000..eba3b749277c --- /dev/null +++ b/AiPlatform/src/V1/StructValue.php @@ -0,0 +1,67 @@ +google.cloud.aiplatform.v1.StructValue + */ +class StructValue extends \Google\Protobuf\Internal\Message +{ + /** + * A list of field values. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.StructFieldValue values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AIPlatform\V1\StructFieldValue>|\Google\Protobuf\Internal\RepeatedField $values + * A list of field values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\FeaturestoreOnlineService::initOnce(); + parent::__construct($data); + } + + /** + * A list of field values. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.StructFieldValue values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * A list of field values. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.StructFieldValue values = 1; + * @param array<\Google\Cloud\AIPlatform\V1\StructFieldValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\StructFieldValue::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/Study.php b/AiPlatform/src/V1/Study.php index 84644d762674..7acbb5184d95 100644 --- a/AiPlatform/src/V1/Study.php +++ b/AiPlatform/src/V1/Study.php @@ -21,38 +21,38 @@ class Study extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. Describes the Study, default value is empty string. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Required. Configuration of the Study. * * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec study_spec = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $study_spec = null; + protected $study_spec = null; /** * Output only. The detailed state of a Study. * * Generated from protobuf field .google.cloud.aiplatform.v1.Study.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Time at which the study was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. A human readable reason why the Study is inactive. * This should be empty if a study is ACTIVE or COMPLETED. * * Generated from protobuf field string inactive_reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $inactive_reason = ''; + protected $inactive_reason = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec.php b/AiPlatform/src/V1/StudySpec.php index 5c324dbebffc..8fcef3d12932 100644 --- a/AiPlatform/src/V1/StudySpec.php +++ b/AiPlatform/src/V1/StudySpec.php @@ -32,7 +32,7 @@ class StudySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.Algorithm algorithm = 3; */ - private $algorithm = 0; + protected $algorithm = 0; /** * The observation noise level of the study. * Currently only supported by the Vertex AI Vizier service. Not supported by @@ -40,20 +40,20 @@ class StudySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.ObservationNoise observation_noise = 6; */ - private $observation_noise = 0; + protected $observation_noise = 0; /** * Describe which measurement selection type will be used * * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.MeasurementSelectionType measurement_selection_type = 7; */ - private $measurement_selection_type = 0; + protected $measurement_selection_type = 0; /** * Conditions for automated stopping of a Study. Enable automated stopping by * configuring at least one condition. * * Generated from protobuf field optional .google.cloud.aiplatform.v1.StudySpec.StudyStoppingConfig study_stopping_config = 11; */ - private $study_stopping_config = null; + protected $study_stopping_config = null; protected $automated_stopping_spec; /** diff --git a/AiPlatform/src/V1/StudySpec/ConvexAutomatedStoppingSpec.php b/AiPlatform/src/V1/StudySpec/ConvexAutomatedStoppingSpec.php index 6ef4f13051f2..f69db186b29c 100644 --- a/AiPlatform/src/V1/StudySpec/ConvexAutomatedStoppingSpec.php +++ b/AiPlatform/src/V1/StudySpec/ConvexAutomatedStoppingSpec.php @@ -32,7 +32,7 @@ class ConvexAutomatedStoppingSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 max_step_count = 1; */ - private $max_step_count = 0; + protected $max_step_count = 0; /** * Minimum number of steps for a trial to complete. Trials which do not have * a measurement with step_count > min_step_count won't be considered for @@ -44,7 +44,7 @@ class ConvexAutomatedStoppingSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 min_step_count = 2; */ - private $min_step_count = 0; + protected $min_step_count = 0; /** * The minimal number of measurements in a Trial. Early-stopping checks * will not trigger if less than min_measurement_count+1 completed trials or @@ -53,7 +53,7 @@ class ConvexAutomatedStoppingSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 min_measurement_count = 3; */ - private $min_measurement_count = 0; + protected $min_measurement_count = 0; /** * The hyper-parameter name used in the tuning job that stands for learning * rate. Leave it blank if learning rate is not in a parameter in tuning. @@ -62,7 +62,7 @@ class ConvexAutomatedStoppingSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string learning_rate_parameter_name = 4; */ - private $learning_rate_parameter_name = ''; + protected $learning_rate_parameter_name = ''; /** * This bool determines whether or not the rule is applied based on * elapsed_secs or steps. If use_elapsed_duration==false, the early stopping @@ -74,7 +74,7 @@ class ConvexAutomatedStoppingSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool use_elapsed_duration = 5; */ - private $use_elapsed_duration = false; + protected $use_elapsed_duration = false; /** * ConvexAutomatedStoppingSpec by default only updates the trials that needs * to be early stopped using a newly trained auto-regressive model. When @@ -86,7 +86,7 @@ class ConvexAutomatedStoppingSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional bool update_all_stopped_trials = 6; */ - private $update_all_stopped_trials = null; + protected $update_all_stopped_trials = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec/DecayCurveAutomatedStoppingSpec.php b/AiPlatform/src/V1/StudySpec/DecayCurveAutomatedStoppingSpec.php index 6d2154e4cfe0..8067737f41cb 100644 --- a/AiPlatform/src/V1/StudySpec/DecayCurveAutomatedStoppingSpec.php +++ b/AiPlatform/src/V1/StudySpec/DecayCurveAutomatedStoppingSpec.php @@ -28,7 +28,7 @@ class DecayCurveAutomatedStoppingSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool use_elapsed_duration = 1; */ - private $use_elapsed_duration = false; + protected $use_elapsed_duration = false; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec/MedianAutomatedStoppingSpec.php b/AiPlatform/src/V1/StudySpec/MedianAutomatedStoppingSpec.php index b41e3ca9ae64..18310e9b6efe 100644 --- a/AiPlatform/src/V1/StudySpec/MedianAutomatedStoppingSpec.php +++ b/AiPlatform/src/V1/StudySpec/MedianAutomatedStoppingSpec.php @@ -28,7 +28,7 @@ class MedianAutomatedStoppingSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool use_elapsed_duration = 1; */ - private $use_elapsed_duration = false; + protected $use_elapsed_duration = false; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec/MetricSpec.php b/AiPlatform/src/V1/StudySpec/MetricSpec.php index ec91a70a1613..27ba5cf76bc2 100644 --- a/AiPlatform/src/V1/StudySpec/MetricSpec.php +++ b/AiPlatform/src/V1/StudySpec/MetricSpec.php @@ -21,20 +21,20 @@ class MetricSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metric_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $metric_id = ''; + protected $metric_id = ''; /** * Required. The optimization goal of the metric. * * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.MetricSpec.GoalType goal = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $goal = 0; + protected $goal = 0; /** * Used for safe search. In the case, the metric will be a safety * metric. You must provide a separate metric for objective metric. * * Generated from protobuf field optional .google.cloud.aiplatform.v1.StudySpec.MetricSpec.SafetyMetricConfig safety_config = 3; */ - private $safety_config = null; + protected $safety_config = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec/MetricSpec/SafetyMetricConfig.php b/AiPlatform/src/V1/StudySpec/MetricSpec/SafetyMetricConfig.php index 63972d5d7ba6..f860f6f155af 100644 --- a/AiPlatform/src/V1/StudySpec/MetricSpec/SafetyMetricConfig.php +++ b/AiPlatform/src/V1/StudySpec/MetricSpec/SafetyMetricConfig.php @@ -21,7 +21,7 @@ class SafetyMetricConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double safety_threshold = 1; */ - private $safety_threshold = 0.0; + protected $safety_threshold = 0.0; /** * Desired minimum fraction of safe trials (over total number of trials) * that should be targeted by the algorithm at any time during the @@ -32,7 +32,7 @@ class SafetyMetricConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double desired_min_safe_trials_fraction = 2; */ - private $desired_min_safe_trials_fraction = null; + protected $desired_min_safe_trials_fraction = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec/ParameterSpec.php b/AiPlatform/src/V1/StudySpec/ParameterSpec.php index 476ac2b8dfb4..163df9f7dc3e 100644 --- a/AiPlatform/src/V1/StudySpec/ParameterSpec.php +++ b/AiPlatform/src/V1/StudySpec/ParameterSpec.php @@ -21,14 +21,14 @@ class ParameterSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parameter_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parameter_id = ''; + protected $parameter_id = ''; /** * How the parameter should be scaled. * Leave unset for `CATEGORICAL` parameters. * * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ScaleType scale_type = 6; */ - private $scale_type = 0; + protected $scale_type = 0; /** * A conditional parameter node is active if the parameter's value matches * the conditional node's parent_value_condition. diff --git a/AiPlatform/src/V1/StudySpec/ParameterSpec/CategoricalValueSpec.php b/AiPlatform/src/V1/StudySpec/ParameterSpec/CategoricalValueSpec.php index e80f8d762be0..3709b82cdaa5 100644 --- a/AiPlatform/src/V1/StudySpec/ParameterSpec/CategoricalValueSpec.php +++ b/AiPlatform/src/V1/StudySpec/ParameterSpec/CategoricalValueSpec.php @@ -30,7 +30,7 @@ class CategoricalValueSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional string default_value = 3; */ - private $default_value = null; + protected $default_value = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec/ParameterSpec/ConditionalParameterSpec.php b/AiPlatform/src/V1/StudySpec/ParameterSpec/ConditionalParameterSpec.php index 1af1004db069..073f9e4699f6 100644 --- a/AiPlatform/src/V1/StudySpec/ParameterSpec/ConditionalParameterSpec.php +++ b/AiPlatform/src/V1/StudySpec/ParameterSpec/ConditionalParameterSpec.php @@ -20,7 +20,7 @@ class ConditionalParameterSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.ParameterSpec parameter_spec = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parameter_spec = null; + protected $parameter_spec = null; protected $parent_value_condition; /** diff --git a/AiPlatform/src/V1/StudySpec/ParameterSpec/DiscreteValueSpec.php b/AiPlatform/src/V1/StudySpec/ParameterSpec/DiscreteValueSpec.php index 534a2552d915..4e365fa9aa5c 100644 --- a/AiPlatform/src/V1/StudySpec/ParameterSpec/DiscreteValueSpec.php +++ b/AiPlatform/src/V1/StudySpec/ParameterSpec/DiscreteValueSpec.php @@ -34,7 +34,7 @@ class DiscreteValueSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double default_value = 3; */ - private $default_value = null; + protected $default_value = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec/ParameterSpec/DoubleValueSpec.php b/AiPlatform/src/V1/StudySpec/ParameterSpec/DoubleValueSpec.php index 257d6b0b9a45..60c2894ec955 100644 --- a/AiPlatform/src/V1/StudySpec/ParameterSpec/DoubleValueSpec.php +++ b/AiPlatform/src/V1/StudySpec/ParameterSpec/DoubleValueSpec.php @@ -20,13 +20,13 @@ class DoubleValueSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double min_value = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $min_value = 0.0; + protected $min_value = 0.0; /** * Required. Inclusive maximum value of the parameter. * * Generated from protobuf field double max_value = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_value = 0.0; + protected $max_value = 0.0; /** * A default value for a `DOUBLE` parameter that is assumed to be a * relatively good starting point. Unset value signals that there is no @@ -36,7 +36,7 @@ class DoubleValueSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double default_value = 4; */ - private $default_value = null; + protected $default_value = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec/ParameterSpec/IntegerValueSpec.php b/AiPlatform/src/V1/StudySpec/ParameterSpec/IntegerValueSpec.php index 402f78cb5d3b..0a1a3510f173 100644 --- a/AiPlatform/src/V1/StudySpec/ParameterSpec/IntegerValueSpec.php +++ b/AiPlatform/src/V1/StudySpec/ParameterSpec/IntegerValueSpec.php @@ -20,13 +20,13 @@ class IntegerValueSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 min_value = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $min_value = 0; + protected $min_value = 0; /** * Required. Inclusive maximum value of the parameter. * * Generated from protobuf field int64 max_value = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_value = 0; + protected $max_value = 0; /** * A default value for an `INTEGER` parameter that is assumed to be a * relatively good starting point. Unset value signals that there is no @@ -36,7 +36,7 @@ class IntegerValueSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int64 default_value = 4; */ - private $default_value = null; + protected $default_value = null; /** * Constructor. diff --git a/AiPlatform/src/V1/StudySpec/StudyStoppingConfig.php b/AiPlatform/src/V1/StudySpec/StudyStoppingConfig.php index 6e09fb9dff6b..7c32cff9ecaf 100644 --- a/AiPlatform/src/V1/StudySpec/StudyStoppingConfig.php +++ b/AiPlatform/src/V1/StudySpec/StudyStoppingConfig.php @@ -25,7 +25,7 @@ class StudyStoppingConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.BoolValue should_stop_asap = 1; */ - private $should_stop_asap = null; + protected $should_stop_asap = null; /** * Each "stopping rule" in this proto specifies an "if" condition. Before * Vizier would generate a new suggestion, it first checks each specified @@ -50,26 +50,26 @@ class StudyStoppingConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.StudyTimeConstraint minimum_runtime_constraint = 2; */ - private $minimum_runtime_constraint = null; + protected $minimum_runtime_constraint = null; /** * If the specified time or duration has passed, stop the study. * * Generated from protobuf field .google.cloud.aiplatform.v1.StudyTimeConstraint maximum_runtime_constraint = 3; */ - private $maximum_runtime_constraint = null; + protected $maximum_runtime_constraint = null; /** * If there are fewer than this many COMPLETED trials, do not stop the * study. * * Generated from protobuf field .google.protobuf.Int32Value min_num_trials = 4; */ - private $min_num_trials = null; + protected $min_num_trials = null; /** * If there are more than this many trials, stop the study. * * Generated from protobuf field .google.protobuf.Int32Value max_num_trials = 5; */ - private $max_num_trials = null; + protected $max_num_trials = null; /** * If the objective value has not improved for this many consecutive * trials, stop the study. @@ -77,7 +77,7 @@ class StudyStoppingConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Int32Value max_num_trials_no_progress = 6; */ - private $max_num_trials_no_progress = null; + protected $max_num_trials_no_progress = null; /** * If the objective value has not improved for this much time, stop the * study. @@ -85,7 +85,7 @@ class StudyStoppingConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration max_duration_no_progress = 7; */ - private $max_duration_no_progress = null; + protected $max_duration_no_progress = null; /** * Constructor. @@ -179,7 +179,7 @@ public function clearShouldStopAsap() * Generated from protobuf field .google.protobuf.BoolValue should_stop_asap = 1; * @return bool|null */ - public function getShouldStopAsapValue() + public function getShouldStopAsapUnwrapped() { return $this->readWrapperValue("should_stop_asap"); } @@ -216,7 +216,7 @@ public function setShouldStopAsap($var) * @param bool|null $var * @return $this */ - public function setShouldStopAsapValue($var) + public function setShouldStopAsapUnwrapped($var) { $this->writeWrapperValue("should_stop_asap", $var); return $this;} @@ -362,7 +362,7 @@ public function clearMinNumTrials() * Generated from protobuf field .google.protobuf.Int32Value min_num_trials = 4; * @return int|null */ - public function getMinNumTrialsValue() + public function getMinNumTrialsUnwrapped() { return $this->readWrapperValue("min_num_trials"); } @@ -393,7 +393,7 @@ public function setMinNumTrials($var) * @param int|null $var * @return $this */ - public function setMinNumTrialsValue($var) + public function setMinNumTrialsUnwrapped($var) { $this->writeWrapperValue("min_num_trials", $var); return $this;} @@ -427,7 +427,7 @@ public function clearMaxNumTrials() * Generated from protobuf field .google.protobuf.Int32Value max_num_trials = 5; * @return int|null */ - public function getMaxNumTrialsValue() + public function getMaxNumTrialsUnwrapped() { return $this->readWrapperValue("max_num_trials"); } @@ -456,7 +456,7 @@ public function setMaxNumTrials($var) * @param int|null $var * @return $this */ - public function setMaxNumTrialsValue($var) + public function setMaxNumTrialsUnwrapped($var) { $this->writeWrapperValue("max_num_trials", $var); return $this;} @@ -494,7 +494,7 @@ public function clearMaxNumTrialsNoProgress() * Generated from protobuf field .google.protobuf.Int32Value max_num_trials_no_progress = 6; * @return int|null */ - public function getMaxNumTrialsNoProgressValue() + public function getMaxNumTrialsNoProgressUnwrapped() { return $this->readWrapperValue("max_num_trials_no_progress"); } @@ -527,7 +527,7 @@ public function setMaxNumTrialsNoProgress($var) * @param int|null $var * @return $this */ - public function setMaxNumTrialsNoProgressValue($var) + public function setMaxNumTrialsNoProgressUnwrapped($var) { $this->writeWrapperValue("max_num_trials_no_progress", $var); return $this;} diff --git a/AiPlatform/src/V1/SuggestTrialsMetadata.php b/AiPlatform/src/V1/SuggestTrialsMetadata.php index 1a7b900ef48a..2e785757dba1 100644 --- a/AiPlatform/src/V1/SuggestTrialsMetadata.php +++ b/AiPlatform/src/V1/SuggestTrialsMetadata.php @@ -20,7 +20,7 @@ class SuggestTrialsMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * The identifier of the client that is requesting the suggestion. * If multiple SuggestTrialsRequests have the same `client_id`, @@ -29,7 +29,7 @@ class SuggestTrialsMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string client_id = 2; */ - private $client_id = ''; + protected $client_id = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/SuggestTrialsRequest.php b/AiPlatform/src/V1/SuggestTrialsRequest.php index 55d2734110db..31432c2c063a 100644 --- a/AiPlatform/src/V1/SuggestTrialsRequest.php +++ b/AiPlatform/src/V1/SuggestTrialsRequest.php @@ -22,13 +22,13 @@ class SuggestTrialsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The number of suggestions requested. It must be positive. * * Generated from protobuf field int32 suggestion_count = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $suggestion_count = 0; + protected $suggestion_count = 0; /** * Required. The identifier of the client that is requesting the suggestion. * If multiple SuggestTrialsRequests have the same `client_id`, @@ -37,7 +37,7 @@ class SuggestTrialsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string client_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $client_id = ''; + protected $client_id = ''; /** * Optional. This allows you to specify the "context" for a Trial; a context * is a slice (a subspace) of the search space. diff --git a/AiPlatform/src/V1/SuggestTrialsResponse.php b/AiPlatform/src/V1/SuggestTrialsResponse.php index d6edea600307..a2922d5052dc 100644 --- a/AiPlatform/src/V1/SuggestTrialsResponse.php +++ b/AiPlatform/src/V1/SuggestTrialsResponse.php @@ -27,19 +27,19 @@ class SuggestTrialsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Study.State study_state = 2; */ - private $study_state = 0; + protected $study_state = 0; /** * The time at which the operation was started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; */ - private $start_time = null; + protected $start_time = null; /** * The time at which operation processing completed. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/AiPlatform/src/V1/SupervisedHyperParameters.php b/AiPlatform/src/V1/SupervisedHyperParameters.php index 2399d0e50cc1..ed94144294f7 100644 --- a/AiPlatform/src/V1/SupervisedHyperParameters.php +++ b/AiPlatform/src/V1/SupervisedHyperParameters.php @@ -16,23 +16,24 @@ class SupervisedHyperParameters extends \Google\Protobuf\Internal\Message { /** - * Optional. Number of training epoches for this tuning job. + * Optional. Number of complete passes the model makes over the entire + * training dataset during training. * * Generated from protobuf field int64 epoch_count = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $epoch_count = 0; + protected $epoch_count = 0; /** - * Optional. Learning rate multiplier for tuning. + * Optional. Multiplier for adjusting the default learning rate. * * Generated from protobuf field double learning_rate_multiplier = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $learning_rate_multiplier = 0.0; + protected $learning_rate_multiplier = 0.0; /** * Optional. Adapter size for tuning. * * Generated from protobuf field .google.cloud.aiplatform.v1.SupervisedHyperParameters.AdapterSize adapter_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $adapter_size = 0; + protected $adapter_size = 0; /** * Constructor. @@ -41,9 +42,10 @@ class SupervisedHyperParameters extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $epoch_count - * Optional. Number of training epoches for this tuning job. + * Optional. Number of complete passes the model makes over the entire + * training dataset during training. * @type float $learning_rate_multiplier - * Optional. Learning rate multiplier for tuning. + * Optional. Multiplier for adjusting the default learning rate. * @type int $adapter_size * Optional. Adapter size for tuning. * } @@ -54,7 +56,8 @@ public function __construct($data = NULL) { } /** - * Optional. Number of training epoches for this tuning job. + * Optional. Number of complete passes the model makes over the entire + * training dataset during training. * * Generated from protobuf field int64 epoch_count = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return int|string @@ -65,7 +68,8 @@ public function getEpochCount() } /** - * Optional. Number of training epoches for this tuning job. + * Optional. Number of complete passes the model makes over the entire + * training dataset during training. * * Generated from protobuf field int64 epoch_count = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param int|string $var @@ -80,7 +84,7 @@ public function setEpochCount($var) } /** - * Optional. Learning rate multiplier for tuning. + * Optional. Multiplier for adjusting the default learning rate. * * Generated from protobuf field double learning_rate_multiplier = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return float @@ -91,7 +95,7 @@ public function getLearningRateMultiplier() } /** - * Optional. Learning rate multiplier for tuning. + * Optional. Multiplier for adjusting the default learning rate. * * Generated from protobuf field double learning_rate_multiplier = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param float $var diff --git a/AiPlatform/src/V1/SupervisedTuningDataStats.php b/AiPlatform/src/V1/SupervisedTuningDataStats.php index d7113531c2b1..ffb3538df044 100644 --- a/AiPlatform/src/V1/SupervisedTuningDataStats.php +++ b/AiPlatform/src/V1/SupervisedTuningDataStats.php @@ -20,43 +20,43 @@ class SupervisedTuningDataStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 tuning_dataset_example_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $tuning_dataset_example_count = 0; + protected $tuning_dataset_example_count = 0; /** * Output only. Number of tuning characters in the tuning dataset. * * Generated from protobuf field int64 total_tuning_character_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $total_tuning_character_count = 0; + protected $total_tuning_character_count = 0; /** * Output only. Number of billable characters in the tuning dataset. * * Generated from protobuf field int64 total_billable_character_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $total_billable_character_count = 0; + protected $total_billable_character_count = 0; /** * Output only. Number of tuning steps for this Tuning Job. * * Generated from protobuf field int64 tuning_step_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $tuning_step_count = 0; + protected $tuning_step_count = 0; /** * Output only. Dataset distributions for the user input tokens. * * Generated from protobuf field .google.cloud.aiplatform.v1.SupervisedTuningDatasetDistribution user_input_token_distribution = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $user_input_token_distribution = null; + protected $user_input_token_distribution = null; /** * Output only. Dataset distributions for the user output tokens. * * Generated from protobuf field .google.cloud.aiplatform.v1.SupervisedTuningDatasetDistribution user_output_token_distribution = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $user_output_token_distribution = null; + protected $user_output_token_distribution = null; /** * Output only. Dataset distributions for the messages per example. * * Generated from protobuf field .google.cloud.aiplatform.v1.SupervisedTuningDatasetDistribution user_message_per_example_distribution = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $user_message_per_example_distribution = null; + protected $user_message_per_example_distribution = null; /** * Output only. Sample user messages in the training dataset uri. * diff --git a/AiPlatform/src/V1/SupervisedTuningDatasetDistribution.php b/AiPlatform/src/V1/SupervisedTuningDatasetDistribution.php index 8e10df2eaa4b..d23ca9c9f6f1 100644 --- a/AiPlatform/src/V1/SupervisedTuningDatasetDistribution.php +++ b/AiPlatform/src/V1/SupervisedTuningDatasetDistribution.php @@ -20,43 +20,43 @@ class SupervisedTuningDatasetDistribution extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field int64 sum = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $sum = 0; + protected $sum = 0; /** * Output only. The minimum of the population values. * * Generated from protobuf field double min = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $min = 0.0; + protected $min = 0.0; /** * Output only. The maximum of the population values. * * Generated from protobuf field double max = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $max = 0.0; + protected $max = 0.0; /** * Output only. The arithmetic mean of the values in the population. * * Generated from protobuf field double mean = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $mean = 0.0; + protected $mean = 0.0; /** * Output only. The median of the values in the population. * * Generated from protobuf field double median = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $median = 0.0; + protected $median = 0.0; /** * Output only. The 5th percentile of the values in the population. * * Generated from protobuf field double p5 = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $p5 = 0.0; + protected $p5 = 0.0; /** * Output only. The 95th percentile of the values in the population. * * Generated from protobuf field double p95 = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $p95 = 0.0; + protected $p95 = 0.0; /** * Output only. Defines the histogram bucket. * diff --git a/AiPlatform/src/V1/SupervisedTuningDatasetDistribution/DatasetBucket.php b/AiPlatform/src/V1/SupervisedTuningDatasetDistribution/DatasetBucket.php index ef958607e6e5..c4d05ddc2818 100644 --- a/AiPlatform/src/V1/SupervisedTuningDatasetDistribution/DatasetBucket.php +++ b/AiPlatform/src/V1/SupervisedTuningDatasetDistribution/DatasetBucket.php @@ -21,19 +21,19 @@ class DatasetBucket extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $count = 0.0; + protected $count = 0.0; /** * Output only. Left bound of the bucket. * * Generated from protobuf field double left = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $left = 0.0; + protected $left = 0.0; /** * Output only. Right bound of the bucket. * * Generated from protobuf field double right = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $right = 0.0; + protected $right = 0.0; /** * Constructor. diff --git a/AiPlatform/src/V1/SupervisedTuningSpec.php b/AiPlatform/src/V1/SupervisedTuningSpec.php index 3964310e38fd..cf73588008b6 100644 --- a/AiPlatform/src/V1/SupervisedTuningSpec.php +++ b/AiPlatform/src/V1/SupervisedTuningSpec.php @@ -17,24 +17,24 @@ class SupervisedTuningSpec extends \Google\Protobuf\Internal\Message { /** * Required. Cloud Storage path to file containing training dataset for - * tuning. + * tuning. The dataset must be formatted as a JSONL file. * * Generated from protobuf field string training_dataset_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $training_dataset_uri = ''; + protected $training_dataset_uri = ''; /** * Optional. Cloud Storage path to file containing validation dataset for - * tuning. + * tuning. The dataset must be formatted as a JSONL file. * * Generated from protobuf field string validation_dataset_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validation_dataset_uri = ''; + protected $validation_dataset_uri = ''; /** * Optional. Hyperparameters for SFT. * * Generated from protobuf field .google.cloud.aiplatform.v1.SupervisedHyperParameters hyper_parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $hyper_parameters = null; + protected $hyper_parameters = null; /** * Constructor. @@ -44,10 +44,10 @@ class SupervisedTuningSpec extends \Google\Protobuf\Internal\Message * * @type string $training_dataset_uri * Required. Cloud Storage path to file containing training dataset for - * tuning. + * tuning. The dataset must be formatted as a JSONL file. * @type string $validation_dataset_uri * Optional. Cloud Storage path to file containing validation dataset for - * tuning. + * tuning. The dataset must be formatted as a JSONL file. * @type \Google\Cloud\AIPlatform\V1\SupervisedHyperParameters $hyper_parameters * Optional. Hyperparameters for SFT. * } @@ -59,7 +59,7 @@ public function __construct($data = NULL) { /** * Required. Cloud Storage path to file containing training dataset for - * tuning. + * tuning. The dataset must be formatted as a JSONL file. * * Generated from protobuf field string training_dataset_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -71,7 +71,7 @@ public function getTrainingDatasetUri() /** * Required. Cloud Storage path to file containing training dataset for - * tuning. + * tuning. The dataset must be formatted as a JSONL file. * * Generated from protobuf field string training_dataset_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -87,7 +87,7 @@ public function setTrainingDatasetUri($var) /** * Optional. Cloud Storage path to file containing validation dataset for - * tuning. + * tuning. The dataset must be formatted as a JSONL file. * * Generated from protobuf field string validation_dataset_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -99,7 +99,7 @@ public function getValidationDatasetUri() /** * Optional. Cloud Storage path to file containing validation dataset for - * tuning. + * tuning. The dataset must be formatted as a JSONL file. * * Generated from protobuf field string validation_dataset_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/AiPlatform/src/V1/SyncFeatureViewRequest.php b/AiPlatform/src/V1/SyncFeatureViewRequest.php index 19b01a90d961..f4bb0c592474 100644 --- a/AiPlatform/src/V1/SyncFeatureViewRequest.php +++ b/AiPlatform/src/V1/SyncFeatureViewRequest.php @@ -22,7 +22,7 @@ class SyncFeatureViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_view = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $feature_view = ''; + protected $feature_view = ''; /** * @param string $featureView Required. Format: diff --git a/AiPlatform/src/V1/SyncFeatureViewResponse.php b/AiPlatform/src/V1/SyncFeatureViewResponse.php index 23e336160455..16511782af48 100644 --- a/AiPlatform/src/V1/SyncFeatureViewResponse.php +++ b/AiPlatform/src/V1/SyncFeatureViewResponse.php @@ -22,7 +22,7 @@ class SyncFeatureViewResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string feature_view_sync = 1; */ - private $feature_view_sync = ''; + protected $feature_view_sync = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/TFRecordDestination.php b/AiPlatform/src/V1/TFRecordDestination.php index d6fd07165524..1f10164b6ed8 100644 --- a/AiPlatform/src/V1/TFRecordDestination.php +++ b/AiPlatform/src/V1/TFRecordDestination.php @@ -20,7 +20,7 @@ class TFRecordDestination extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $gcs_destination = null; + protected $gcs_destination = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Tensor.php b/AiPlatform/src/V1/Tensor.php index 4808fbbd0c84..bf65f0799335 100644 --- a/AiPlatform/src/V1/Tensor.php +++ b/AiPlatform/src/V1/Tensor.php @@ -20,7 +20,7 @@ class Tensor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Tensor.DataType dtype = 1; */ - private $dtype = 0; + protected $dtype = 0; /** * Shape of the tensor. * @@ -106,7 +106,7 @@ class Tensor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes tensor_val = 13; */ - private $tensor_val = ''; + protected $tensor_val = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/Tensorboard.php b/AiPlatform/src/V1/Tensorboard.php index 783c477d63b1..3408a7ffe291 100644 --- a/AiPlatform/src/V1/Tensorboard.php +++ b/AiPlatform/src/V1/Tensorboard.php @@ -24,19 +24,19 @@ class Tensorboard extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. User provided name of this Tensorboard. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Description of this Tensorboard. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Customer-managed encryption key spec for a Tensorboard. If set, this * Tensorboard and all sub-resources of this Tensorboard will be secured by @@ -44,32 +44,32 @@ class Tensorboard extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 11; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Output only. Consumer project Cloud Storage path prefix used to store blob * data, which can either be a bucket or directory. Does not end with a '/'. * * Generated from protobuf field string blob_storage_path_prefix = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $blob_storage_path_prefix = ''; + protected $blob_storage_path_prefix = ''; /** * Output only. The number of Runs stored in this Tensorboard. * * Generated from protobuf field int32 run_count = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $run_count = 0; + protected $run_count = 0; /** * Output only. Timestamp when this Tensorboard was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this Tensorboard was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The labels with user-defined metadata to organize your Tensorboards. * Label keys and values can be no longer than 64 characters @@ -90,7 +90,7 @@ class Tensorboard extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 9; */ - private $etag = ''; + protected $etag = ''; /** * Used to indicate if the TensorBoard instance is the default one. * Each project & region can have at most one default TensorBoard instance. @@ -100,7 +100,7 @@ class Tensorboard extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool is_default = 12; */ - private $is_default = false; + protected $is_default = false; /** * Constructor. diff --git a/AiPlatform/src/V1/TensorboardBlob.php b/AiPlatform/src/V1/TensorboardBlob.php index 808e4b3566f2..77bbd50adf5e 100644 --- a/AiPlatform/src/V1/TensorboardBlob.php +++ b/AiPlatform/src/V1/TensorboardBlob.php @@ -21,14 +21,14 @@ class TensorboardBlob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $id = ''; + protected $id = ''; /** * Optional. The bytes of the blob is not present unless it's returned by the * ReadTensorboardBlobData endpoint. * * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $data = ''; + protected $data = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/TensorboardExperiment.php b/AiPlatform/src/V1/TensorboardExperiment.php index 38640a72a987..1f8f96c44777 100644 --- a/AiPlatform/src/V1/TensorboardExperiment.php +++ b/AiPlatform/src/V1/TensorboardExperiment.php @@ -23,31 +23,31 @@ class TensorboardExperiment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * User provided name of this TensorboardExperiment. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * Description of this TensorboardExperiment. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Output only. Timestamp when this TensorboardExperiment was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this TensorboardExperiment was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The labels with user-defined metadata to organize your * TensorboardExperiment. @@ -73,14 +73,14 @@ class TensorboardExperiment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 7; */ - private $etag = ''; + protected $etag = ''; /** * Immutable. Source of the TensorboardExperiment. Example: a custom training * job. * * Generated from protobuf field string source = 8 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $source = ''; + protected $source = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/TensorboardRun.php b/AiPlatform/src/V1/TensorboardRun.php index f8d8eff115d3..2a0fc77d67d0 100644 --- a/AiPlatform/src/V1/TensorboardRun.php +++ b/AiPlatform/src/V1/TensorboardRun.php @@ -23,7 +23,7 @@ class TensorboardRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. User provided name of this TensorboardRun. * This value must be unique among all TensorboardRuns @@ -31,25 +31,25 @@ class TensorboardRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Description of this TensorboardRun. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Output only. Timestamp when this TensorboardRun was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this TensorboardRun was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The labels with user-defined metadata to organize your TensorboardRuns. * This field will be used to filter and visualize Runs in the Tensorboard UI. @@ -76,7 +76,7 @@ class TensorboardRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 9; */ - private $etag = ''; + protected $etag = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/TensorboardServiceClient.php b/AiPlatform/src/V1/TensorboardServiceClient.php deleted file mode 100644 index 2ffdc04ab047..000000000000 --- a/AiPlatform/src/V1/TensorboardServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboard', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets a Tensorboard. - * @param \Google\Cloud\AIPlatform\V1\GetTensorboardRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTensorboard(\Google\Cloud\AIPlatform\V1\GetTensorboardRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/GetTensorboard', - $argument, - ['\Google\Cloud\AIPlatform\V1\Tensorboard', 'decode'], - $metadata, $options); - } - - /** - * Returns a list of monthly active users for a given TensorBoard instance. - * @param \Google\Cloud\AIPlatform\V1\ReadTensorboardUsageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ReadTensorboardUsage(\Google\Cloud\AIPlatform\V1\ReadTensorboardUsageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/ReadTensorboardUsage', - $argument, - ['\Google\Cloud\AIPlatform\V1\ReadTensorboardUsageResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a Tensorboard. - * @param \Google\Cloud\AIPlatform\V1\UpdateTensorboardRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTensorboard(\Google\Cloud\AIPlatform\V1\UpdateTensorboardRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboard', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists Tensorboards in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListTensorboardsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTensorboards(\Google\Cloud\AIPlatform\V1\ListTensorboardsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/ListTensorboards', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListTensorboardsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a Tensorboard. - * @param \Google\Cloud\AIPlatform\V1\DeleteTensorboardRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTensorboard(\Google\Cloud\AIPlatform\V1\DeleteTensorboardRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboard', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a TensorboardExperiment. - * @param \Google\Cloud\AIPlatform\V1\CreateTensorboardExperimentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTensorboardExperiment(\Google\Cloud\AIPlatform\V1\CreateTensorboardExperimentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardExperiment', - $argument, - ['\Google\Cloud\AIPlatform\V1\TensorboardExperiment', 'decode'], - $metadata, $options); - } - - /** - * Gets a TensorboardExperiment. - * @param \Google\Cloud\AIPlatform\V1\GetTensorboardExperimentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTensorboardExperiment(\Google\Cloud\AIPlatform\V1\GetTensorboardExperimentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/GetTensorboardExperiment', - $argument, - ['\Google\Cloud\AIPlatform\V1\TensorboardExperiment', 'decode'], - $metadata, $options); - } - - /** - * Updates a TensorboardExperiment. - * @param \Google\Cloud\AIPlatform\V1\UpdateTensorboardExperimentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTensorboardExperiment(\Google\Cloud\AIPlatform\V1\UpdateTensorboardExperimentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardExperiment', - $argument, - ['\Google\Cloud\AIPlatform\V1\TensorboardExperiment', 'decode'], - $metadata, $options); - } - - /** - * Lists TensorboardExperiments in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListTensorboardExperimentsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTensorboardExperiments(\Google\Cloud\AIPlatform\V1\ListTensorboardExperimentsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/ListTensorboardExperiments', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListTensorboardExperimentsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a TensorboardExperiment. - * @param \Google\Cloud\AIPlatform\V1\DeleteTensorboardExperimentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTensorboardExperiment(\Google\Cloud\AIPlatform\V1\DeleteTensorboardExperimentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardExperiment', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a TensorboardRun. - * @param \Google\Cloud\AIPlatform\V1\CreateTensorboardRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTensorboardRun(\Google\Cloud\AIPlatform\V1\CreateTensorboardRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardRun', - $argument, - ['\Google\Cloud\AIPlatform\V1\TensorboardRun', 'decode'], - $metadata, $options); - } - - /** - * Batch create TensorboardRuns. - * @param \Google\Cloud\AIPlatform\V1\BatchCreateTensorboardRunsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function BatchCreateTensorboardRuns(\Google\Cloud\AIPlatform\V1\BatchCreateTensorboardRunsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/BatchCreateTensorboardRuns', - $argument, - ['\Google\Cloud\AIPlatform\V1\BatchCreateTensorboardRunsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a TensorboardRun. - * @param \Google\Cloud\AIPlatform\V1\GetTensorboardRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTensorboardRun(\Google\Cloud\AIPlatform\V1\GetTensorboardRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/GetTensorboardRun', - $argument, - ['\Google\Cloud\AIPlatform\V1\TensorboardRun', 'decode'], - $metadata, $options); - } - - /** - * Updates a TensorboardRun. - * @param \Google\Cloud\AIPlatform\V1\UpdateTensorboardRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTensorboardRun(\Google\Cloud\AIPlatform\V1\UpdateTensorboardRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardRun', - $argument, - ['\Google\Cloud\AIPlatform\V1\TensorboardRun', 'decode'], - $metadata, $options); - } - - /** - * Lists TensorboardRuns in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListTensorboardRunsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTensorboardRuns(\Google\Cloud\AIPlatform\V1\ListTensorboardRunsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/ListTensorboardRuns', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListTensorboardRunsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a TensorboardRun. - * @param \Google\Cloud\AIPlatform\V1\DeleteTensorboardRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTensorboardRun(\Google\Cloud\AIPlatform\V1\DeleteTensorboardRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardRun', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. - * @param \Google\Cloud\AIPlatform\V1\BatchCreateTensorboardTimeSeriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function BatchCreateTensorboardTimeSeries(\Google\Cloud\AIPlatform\V1\BatchCreateTensorboardTimeSeriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/BatchCreateTensorboardTimeSeries', - $argument, - ['\Google\Cloud\AIPlatform\V1\BatchCreateTensorboardTimeSeriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates a TensorboardTimeSeries. - * @param \Google\Cloud\AIPlatform\V1\CreateTensorboardTimeSeriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTensorboardTimeSeries(\Google\Cloud\AIPlatform\V1\CreateTensorboardTimeSeriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardTimeSeries', - $argument, - ['\Google\Cloud\AIPlatform\V1\TensorboardTimeSeries', 'decode'], - $metadata, $options); - } - - /** - * Gets a TensorboardTimeSeries. - * @param \Google\Cloud\AIPlatform\V1\GetTensorboardTimeSeriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTensorboardTimeSeries(\Google\Cloud\AIPlatform\V1\GetTensorboardTimeSeriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/GetTensorboardTimeSeries', - $argument, - ['\Google\Cloud\AIPlatform\V1\TensorboardTimeSeries', 'decode'], - $metadata, $options); - } - - /** - * Updates a TensorboardTimeSeries. - * @param \Google\Cloud\AIPlatform\V1\UpdateTensorboardTimeSeriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTensorboardTimeSeries(\Google\Cloud\AIPlatform\V1\UpdateTensorboardTimeSeriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardTimeSeries', - $argument, - ['\Google\Cloud\AIPlatform\V1\TensorboardTimeSeries', 'decode'], - $metadata, $options); - } - - /** - * Lists TensorboardTimeSeries in a Location. - * @param \Google\Cloud\AIPlatform\V1\ListTensorboardTimeSeriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTensorboardTimeSeries(\Google\Cloud\AIPlatform\V1\ListTensorboardTimeSeriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/ListTensorboardTimeSeries', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListTensorboardTimeSeriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a TensorboardTimeSeries. - * @param \Google\Cloud\AIPlatform\V1\DeleteTensorboardTimeSeriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTensorboardTimeSeries(\Google\Cloud\AIPlatform\V1\DeleteTensorboardTimeSeriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardTimeSeries', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Reads multiple TensorboardTimeSeries' data. The data point number limit is - * 1000 for scalars, 100 for tensors and blob references. If the number of - * data points stored is less than the limit, all data is returned. - * Otherwise, the number limit of data points is randomly selected from - * this time series and returned. - * @param \Google\Cloud\AIPlatform\V1\BatchReadTensorboardTimeSeriesDataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function BatchReadTensorboardTimeSeriesData(\Google\Cloud\AIPlatform\V1\BatchReadTensorboardTimeSeriesDataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/BatchReadTensorboardTimeSeriesData', - $argument, - ['\Google\Cloud\AIPlatform\V1\BatchReadTensorboardTimeSeriesDataResponse', 'decode'], - $metadata, $options); - } - - /** - * Reads a TensorboardTimeSeries' data. By default, if the number of data - * points stored is less than 1000, all data is returned. Otherwise, 1000 - * data points is randomly selected from this time series and returned. - * This value can be changed by changing max_data_points, which can't be - * greater than 10k. - * @param \Google\Cloud\AIPlatform\V1\ReadTensorboardTimeSeriesDataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ReadTensorboardTimeSeriesData(\Google\Cloud\AIPlatform\V1\ReadTensorboardTimeSeriesDataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/ReadTensorboardTimeSeriesData', - $argument, - ['\Google\Cloud\AIPlatform\V1\ReadTensorboardTimeSeriesDataResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets bytes of TensorboardBlobs. - * This is to allow reading blob data stored in consumer project's Cloud - * Storage bucket without users having to obtain Cloud Storage access - * permission. - * @param \Google\Cloud\AIPlatform\V1\ReadTensorboardBlobDataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\ServerStreamingCall - */ - public function ReadTensorboardBlobData(\Google\Cloud\AIPlatform\V1\ReadTensorboardBlobDataRequest $argument, - $metadata = [], $options = []) { - return $this->_serverStreamRequest('/google.cloud.aiplatform.v1.TensorboardService/ReadTensorboardBlobData', - $argument, - ['\Google\Cloud\AIPlatform\V1\ReadTensorboardBlobDataResponse', 'decode'], - $metadata, $options); - } - - /** - * Write time series data points of multiple TensorboardTimeSeries in multiple - * TensorboardRun's. If any data fail to be ingested, an error is returned. - * @param \Google\Cloud\AIPlatform\V1\WriteTensorboardExperimentDataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function WriteTensorboardExperimentData(\Google\Cloud\AIPlatform\V1\WriteTensorboardExperimentDataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/WriteTensorboardExperimentData', - $argument, - ['\Google\Cloud\AIPlatform\V1\WriteTensorboardExperimentDataResponse', 'decode'], - $metadata, $options); - } - - /** - * Write time series data points into multiple TensorboardTimeSeries under - * a TensorboardRun. If any data fail to be ingested, an error is returned. - * @param \Google\Cloud\AIPlatform\V1\WriteTensorboardRunDataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function WriteTensorboardRunData(\Google\Cloud\AIPlatform\V1\WriteTensorboardRunDataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/WriteTensorboardRunData', - $argument, - ['\Google\Cloud\AIPlatform\V1\WriteTensorboardRunDataResponse', 'decode'], - $metadata, $options); - } - - /** - * Exports a TensorboardTimeSeries' data. Data is returned in paginated - * responses. - * @param \Google\Cloud\AIPlatform\V1\ExportTensorboardTimeSeriesDataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportTensorboardTimeSeriesData(\Google\Cloud\AIPlatform\V1\ExportTensorboardTimeSeriesDataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.TensorboardService/ExportTensorboardTimeSeriesData', - $argument, - ['\Google\Cloud\AIPlatform\V1\ExportTensorboardTimeSeriesDataResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/TensorboardTensor.php b/AiPlatform/src/V1/TensorboardTensor.php index 0cbf66970c4f..b7bb5865e1c1 100644 --- a/AiPlatform/src/V1/TensorboardTensor.php +++ b/AiPlatform/src/V1/TensorboardTensor.php @@ -21,14 +21,14 @@ class TensorboardTensor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes value = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $value = ''; + protected $value = ''; /** * Optional. Version number of TensorProto used to serialize * [value][google.cloud.aiplatform.v1.TensorboardTensor.value]. * * Generated from protobuf field int32 version_number = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $version_number = 0; + protected $version_number = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/TensorboardTimeSeries.php b/AiPlatform/src/V1/TensorboardTimeSeries.php index 9edfb60b8036..31f33441b714 100644 --- a/AiPlatform/src/V1/TensorboardTimeSeries.php +++ b/AiPlatform/src/V1/TensorboardTimeSeries.php @@ -20,7 +20,7 @@ class TensorboardTimeSeries extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. User provided name of this TensorboardTimeSeries. * This value should be unique among all TensorboardTimeSeries resources @@ -28,58 +28,58 @@ class TensorboardTimeSeries extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Description of this TensorboardTimeSeries. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Required. Immutable. Type of TensorboardTimeSeries value. * * Generated from protobuf field .google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType value_type = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $value_type = 0; + protected $value_type = 0; /** * Output only. Timestamp when this TensorboardTimeSeries was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Timestamp when this TensorboardTimeSeries was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Used to perform a consistent read-modify-write updates. If not set, a blind * "overwrite" update happens. * * Generated from protobuf field string etag = 7; */ - private $etag = ''; + protected $etag = ''; /** * Immutable. Name of the plugin this time series pertain to. Such as Scalar, * Tensor, Blob * * Generated from protobuf field string plugin_name = 8 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $plugin_name = ''; + protected $plugin_name = ''; /** * Data of the current plugin, with the size limited to 65KB. * * Generated from protobuf field bytes plugin_data = 9; */ - private $plugin_data = ''; + protected $plugin_data = ''; /** * Output only. Scalar, Tensor, or Blob metadata for this * TensorboardTimeSeries. * * Generated from protobuf field .google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata metadata = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata = null; + protected $metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/TensorboardTimeSeries/Metadata.php b/AiPlatform/src/V1/TensorboardTimeSeries/Metadata.php index 2164aa428d8c..557cae30bdb6 100644 --- a/AiPlatform/src/V1/TensorboardTimeSeries/Metadata.php +++ b/AiPlatform/src/V1/TensorboardTimeSeries/Metadata.php @@ -21,21 +21,21 @@ class Metadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 max_step = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $max_step = 0; + protected $max_step = 0; /** * Output only. Max wall clock timestamp of all data points within a * TensorboardTimeSeries. * * Generated from protobuf field .google.protobuf.Timestamp max_wall_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $max_wall_time = null; + protected $max_wall_time = null; /** * Output only. The largest blob sequence length (number of blobs) of all * data points in this time series, if its ValueType is BLOB_SEQUENCE. * * Generated from protobuf field int64 max_blob_sequence_length = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $max_blob_sequence_length = 0; + protected $max_blob_sequence_length = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/TimeSeriesData.php b/AiPlatform/src/V1/TimeSeriesData.php index 82cddcba4a1c..88bced5fae0e 100644 --- a/AiPlatform/src/V1/TimeSeriesData.php +++ b/AiPlatform/src/V1/TimeSeriesData.php @@ -21,14 +21,14 @@ class TimeSeriesData extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tensorboard_time_series_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard_time_series_id = ''; + protected $tensorboard_time_series_id = ''; /** * Required. Immutable. The value type of this time series. All the values in * this time series data must match this value type. * * Generated from protobuf field .google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType value_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $value_type = 0; + protected $value_type = 0; /** * Required. Data points in this time series. * diff --git a/AiPlatform/src/V1/TimeSeriesDataPoint.php b/AiPlatform/src/V1/TimeSeriesDataPoint.php index 5dbbf7990b5c..22e6cfa43ee4 100644 --- a/AiPlatform/src/V1/TimeSeriesDataPoint.php +++ b/AiPlatform/src/V1/TimeSeriesDataPoint.php @@ -20,13 +20,13 @@ class TimeSeriesDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp wall_time = 1; */ - private $wall_time = null; + protected $wall_time = null; /** * Step index of this data point within the run. * * Generated from protobuf field int64 step = 2; */ - private $step = 0; + protected $step = 0; protected $value; /** diff --git a/AiPlatform/src/V1/TimestampSplit.php b/AiPlatform/src/V1/TimestampSplit.php index 2060af6b5893..a6b773b93f81 100644 --- a/AiPlatform/src/V1/TimestampSplit.php +++ b/AiPlatform/src/V1/TimestampSplit.php @@ -23,19 +23,19 @@ class TimestampSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double training_fraction = 1; */ - private $training_fraction = 0.0; + protected $training_fraction = 0.0; /** * The fraction of the input data that is to be used to validate the Model. * * Generated from protobuf field double validation_fraction = 2; */ - private $validation_fraction = 0.0; + protected $validation_fraction = 0.0; /** * The fraction of the input data that is to be used to evaluate the Model. * * Generated from protobuf field double test_fraction = 3; */ - private $test_fraction = 0.0; + protected $test_fraction = 0.0; /** * Required. The key is a name of one of the Dataset's data columns. * The values of the key (the values in the column) must be in RFC 3339 @@ -45,7 +45,7 @@ class TimestampSplit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $key = ''; + protected $key = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/Tool.php b/AiPlatform/src/V1/Tool.php index 807035a78d52..45c00a030c0a 100644 --- a/AiPlatform/src/V1/Tool.php +++ b/AiPlatform/src/V1/Tool.php @@ -41,14 +41,14 @@ class Tool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $retrieval = null; + protected $retrieval = null; /** * Optional. GoogleSearchRetrieval tool type. * Specialized retrieval tool that is powered by Google search. * * Generated from protobuf field .google.cloud.aiplatform.v1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $google_search_retrieval = null; + protected $google_search_retrieval = null; /** * Constructor. diff --git a/AiPlatform/src/V1/ToolConfig.php b/AiPlatform/src/V1/ToolConfig.php new file mode 100644 index 000000000000..8c9692f4cee4 --- /dev/null +++ b/AiPlatform/src/V1/ToolConfig.php @@ -0,0 +1,77 @@ +google.cloud.aiplatform.v1.ToolConfig + */ +class ToolConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Function calling config. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FunctionCallingConfig function_calling_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $function_calling_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AIPlatform\V1\FunctionCallingConfig $function_calling_config + * Optional. Function calling config. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Function calling config. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FunctionCallingConfig function_calling_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\FunctionCallingConfig|null + */ + public function getFunctionCallingConfig() + { + return $this->function_calling_config; + } + + public function hasFunctionCallingConfig() + { + return isset($this->function_calling_config); + } + + public function clearFunctionCallingConfig() + { + unset($this->function_calling_config); + } + + /** + * Optional. Function calling config. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.FunctionCallingConfig function_calling_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\FunctionCallingConfig $var + * @return $this + */ + public function setFunctionCallingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\FunctionCallingConfig::class); + $this->function_calling_config = $var; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/TrainingConfig.php b/AiPlatform/src/V1/TrainingConfig.php index 25b90683525f..adf7e0e3d1ef 100644 --- a/AiPlatform/src/V1/TrainingConfig.php +++ b/AiPlatform/src/V1/TrainingConfig.php @@ -23,7 +23,7 @@ class TrainingConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 timeout_training_milli_hours = 1; */ - private $timeout_training_milli_hours = 0; + protected $timeout_training_milli_hours = 0; /** * Constructor. diff --git a/AiPlatform/src/V1/TrainingPipeline.php b/AiPlatform/src/V1/TrainingPipeline.php index 39e8f21b5374..5564360e527b 100644 --- a/AiPlatform/src/V1/TrainingPipeline.php +++ b/AiPlatform/src/V1/TrainingPipeline.php @@ -24,13 +24,13 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-defined name of this TrainingPipeline. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Specifies Vertex AI owned input data that may be used for training the * Model. The TrainingPipeline's @@ -44,7 +44,7 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.InputDataConfig input_data_config = 3; */ - private $input_data_config = null; + protected $input_data_config = null; /** * Required. A Google Cloud Storage path to the YAML file that defines the * training task which is responsible for producing the model artifact, and @@ -57,7 +57,7 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string training_task_definition = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $training_task_definition = ''; + protected $training_task_definition = ''; /** * Required. The training task's parameter(s), as specified in the * [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition]'s @@ -65,7 +65,7 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value training_task_inputs = 5 [(.google.api.field_behavior) = REQUIRED]; */ - private $training_task_inputs = null; + protected $training_task_inputs = null; /** * Output only. The metadata information as specified in the * [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition]'s @@ -78,7 +78,7 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value training_task_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $training_task_metadata = null; + protected $training_task_metadata = null; /** * Describes the Model that may be uploaded (via * [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel]) @@ -99,7 +99,7 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Model model_to_upload = 7; */ - private $model_to_upload = null; + protected $model_to_upload = null; /** * Optional. The ID to use for the uploaded Model, which will become the final * component of the model resource name. @@ -108,7 +108,7 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model_id = 22 [(.google.api.field_behavior) = OPTIONAL]; */ - private $model_id = ''; + protected $model_id = ''; /** * Optional. When specify this field, the `model_to_upload` will not be * uploaded as a new model, instead, it will become a new version of this @@ -116,33 +116,33 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent_model = 21 [(.google.api.field_behavior) = OPTIONAL]; */ - private $parent_model = ''; + protected $parent_model = ''; /** * Output only. The detailed state of the pipeline. * * Generated from protobuf field .google.cloud.aiplatform.v1.PipelineState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Only populated when the pipeline's state is * `PIPELINE_STATE_FAILED` or `PIPELINE_STATE_CANCELLED`. * * Generated from protobuf field .google.rpc.Status error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Output only. Time when the TrainingPipeline was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time when the TrainingPipeline for the first time entered the * `PIPELINE_STATE_RUNNING` state. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time when the TrainingPipeline entered any of the following * states: `PIPELINE_STATE_SUCCEEDED`, `PIPELINE_STATE_FAILED`, @@ -150,13 +150,13 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Time when the TrainingPipeline was most recently updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The labels with user-defined metadata to organize TrainingPipelines. * Label keys and values can be no longer than 64 characters @@ -176,7 +176,7 @@ class TrainingPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 18; */ - private $encryption_spec = null; + protected $encryption_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/Trial.php b/AiPlatform/src/V1/Trial.php index 680374edf802..34063934e389 100644 --- a/AiPlatform/src/V1/Trial.php +++ b/AiPlatform/src/V1/Trial.php @@ -22,19 +22,19 @@ class Trial extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The identifier of the Trial assigned by the service. * * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $id = ''; + protected $id = ''; /** * Output only. The detailed state of the Trial. * * Generated from protobuf field .google.cloud.aiplatform.v1.Trial.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The parameters of the Trial. * @@ -46,7 +46,7 @@ class Trial extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Measurement final_measurement = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $final_measurement = null; + protected $final_measurement = null; /** * Output only. A list of measurements that are strictly lexicographically * ordered by their induced tuples (steps, elapsed_duration). @@ -60,14 +60,14 @@ class Trial extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time when the Trial's status changed to `SUCCEEDED` or * `INFEASIBLE`. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The identifier of the client that originally requested this * Trial. Each client is identified by a unique client_id. When a client asks @@ -80,21 +80,21 @@ class Trial extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string client_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $client_id = ''; + protected $client_id = ''; /** * Output only. A human readable string describing why the Trial is * infeasible. This is set only if Trial state is `INFEASIBLE`. * * Generated from protobuf field string infeasible_reason = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $infeasible_reason = ''; + protected $infeasible_reason = ''; /** * Output only. The CustomJob name linked to the Trial. * It's set for a HyperparameterTuningJob's Trial. * * Generated from protobuf field string custom_job = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $custom_job = ''; + protected $custom_job = ''; /** * Output only. URIs for accessing [interactive * shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) diff --git a/AiPlatform/src/V1/Trial/Parameter.php b/AiPlatform/src/V1/Trial/Parameter.php index 6fad55b5c1b7..adb0630f3742 100644 --- a/AiPlatform/src/V1/Trial/Parameter.php +++ b/AiPlatform/src/V1/Trial/Parameter.php @@ -22,7 +22,7 @@ class Parameter extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parameter_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $parameter_id = ''; + protected $parameter_id = ''; /** * Output only. The value of the parameter. * `number_value` will be set if a parameter defined in StudySpec is @@ -32,7 +32,7 @@ class Parameter extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $value = null; + protected $value = null; /** * Constructor. diff --git a/AiPlatform/src/V1/TrialContext.php b/AiPlatform/src/V1/TrialContext.php index 98c7057a3a5f..24ef9182a4d0 100644 --- a/AiPlatform/src/V1/TrialContext.php +++ b/AiPlatform/src/V1/TrialContext.php @@ -21,7 +21,7 @@ class TrialContext extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 1; */ - private $description = ''; + protected $description = ''; /** * If/when a Trial is generated or selected from this Context, * its Parameters will match any parameters specified here. diff --git a/AiPlatform/src/V1/TunedModel.php b/AiPlatform/src/V1/TunedModel.php index e96cfa85de86..00bd472f10b2 100644 --- a/AiPlatform/src/V1/TunedModel.php +++ b/AiPlatform/src/V1/TunedModel.php @@ -22,14 +22,14 @@ class TunedModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * Output only. A resource name of an Endpoint. Format: * `projects/{project}/locations/{location}/endpoints/{endpoint}`. * * Generated from protobuf field string endpoint = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/TuningJob.php b/AiPlatform/src/V1/TuningJob.php index 60e01bd7b5ea..4d1ad470468b 100644 --- a/AiPlatform/src/V1/TuningJob.php +++ b/AiPlatform/src/V1/TuningJob.php @@ -21,35 +21,35 @@ class TuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Optional. The display name of the - * [TunedModel][google.cloud.aiplatform.v1.Model]. The name can be up to - * 128 characters long and can consist of any UTF-8 characters. + * [TunedModel][google.cloud.aiplatform.v1.Model]. The name can be up to 128 + * characters long and can consist of any UTF-8 characters. * * Generated from protobuf field string tuned_model_display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $tuned_model_display_name = ''; + protected $tuned_model_display_name = ''; /** * Optional. The description of the * [TuningJob][google.cloud.aiplatform.v1.TuningJob]. * * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. The detailed state of the job. * * Generated from protobuf field .google.cloud.aiplatform.v1.JobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Time when the * [TuningJob][google.cloud.aiplatform.v1.TuningJob] was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time when the * [TuningJob][google.cloud.aiplatform.v1.TuningJob] for the first time @@ -57,7 +57,7 @@ class TuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time when the TuningJob entered any of the following * [JobStates][google.cloud.aiplatform.v1.JobState]: `JOB_STATE_SUCCEEDED`, @@ -65,7 +65,7 @@ class TuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Time when the * [TuningJob][google.cloud.aiplatform.v1.TuningJob] was most recently @@ -73,14 +73,14 @@ class TuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Only populated when job's state is `JOB_STATE_FAILED` or * `JOB_STATE_CANCELLED`. * * Generated from protobuf field .google.rpc.Status error = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Optional. The labels with user-defined metadata to organize * [TuningJob][google.cloud.aiplatform.v1.TuningJob] and generated resources @@ -100,21 +100,21 @@ class TuningJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string experiment = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $experiment = ''; + protected $experiment = ''; /** * Output only. The tuned model resources assiociated with this * [TuningJob][google.cloud.aiplatform.v1.TuningJob]. * * Generated from protobuf field .google.cloud.aiplatform.v1.TunedModel tuned_model = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $tuned_model = null; + protected $tuned_model = null; /** * Output only. The tuning data statistics associated with this * [TuningJob][google.cloud.aiplatform.v1.TuningJob]. * * Generated from protobuf field .google.cloud.aiplatform.v1.TuningDataStats tuning_data_stats = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $tuning_data_stats = null; + protected $tuning_data_stats = null; protected $source_model; protected $tuning_spec; @@ -125,7 +125,7 @@ class TuningJob extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $base_model - * Model name for tuning, e.g., "gemini-1.0-pro-002". + * The base model that is being tuned, e.g., "gemini-1.0-pro-002". * @type \Google\Cloud\AIPlatform\V1\SupervisedTuningSpec $supervised_tuning_spec * Tuning Spec for Supervised Fine Tuning. * @type string $name @@ -133,8 +133,8 @@ class TuningJob extends \Google\Protobuf\Internal\Message * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` * @type string $tuned_model_display_name * Optional. The display name of the - * [TunedModel][google.cloud.aiplatform.v1.Model]. The name can be up to - * 128 characters long and can consist of any UTF-8 characters. + * [TunedModel][google.cloud.aiplatform.v1.Model]. The name can be up to 128 + * characters long and can consist of any UTF-8 characters. * @type string $description * Optional. The description of the * [TuningJob][google.cloud.aiplatform.v1.TuningJob]. @@ -184,7 +184,7 @@ public function __construct($data = NULL) { } /** - * Model name for tuning, e.g., "gemini-1.0-pro-002". + * The base model that is being tuned, e.g., "gemini-1.0-pro-002". * * Generated from protobuf field string base_model = 4; * @return string @@ -200,7 +200,7 @@ public function hasBaseModel() } /** - * Model name for tuning, e.g., "gemini-1.0-pro-002". + * The base model that is being tuned, e.g., "gemini-1.0-pro-002". * * Generated from protobuf field string base_model = 4; * @param string $var @@ -275,8 +275,8 @@ public function setName($var) /** * Optional. The display name of the - * [TunedModel][google.cloud.aiplatform.v1.Model]. The name can be up to - * 128 characters long and can consist of any UTF-8 characters. + * [TunedModel][google.cloud.aiplatform.v1.Model]. The name can be up to 128 + * characters long and can consist of any UTF-8 characters. * * Generated from protobuf field string tuned_model_display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -288,8 +288,8 @@ public function getTunedModelDisplayName() /** * Optional. The display name of the - * [TunedModel][google.cloud.aiplatform.v1.Model]. The name can be up to - * 128 characters long and can consist of any UTF-8 characters. + * [TunedModel][google.cloud.aiplatform.v1.Model]. The name can be up to 128 + * characters long and can consist of any UTF-8 characters. * * Generated from protobuf field string tuned_model_display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/AiPlatform/src/V1/UndeployIndexOperationMetadata.php b/AiPlatform/src/V1/UndeployIndexOperationMetadata.php index 02644e927bf5..0e7a468c4c70 100644 --- a/AiPlatform/src/V1/UndeployIndexOperationMetadata.php +++ b/AiPlatform/src/V1/UndeployIndexOperationMetadata.php @@ -21,7 +21,7 @@ class UndeployIndexOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UndeployIndexRequest.php b/AiPlatform/src/V1/UndeployIndexRequest.php index 91bec5c1ce29..7eb8447478ee 100644 --- a/AiPlatform/src/V1/UndeployIndexRequest.php +++ b/AiPlatform/src/V1/UndeployIndexRequest.php @@ -23,14 +23,14 @@ class UndeployIndexRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $index_endpoint = ''; + protected $index_endpoint = ''; /** * Required. The ID of the DeployedIndex to be undeployed from the * IndexEndpoint. * * Generated from protobuf field string deployed_index_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployed_index_id = ''; + protected $deployed_index_id = ''; /** * @param string $indexEndpoint Required. The name of the IndexEndpoint resource from which to undeploy an diff --git a/AiPlatform/src/V1/UndeployModelOperationMetadata.php b/AiPlatform/src/V1/UndeployModelOperationMetadata.php index 5eb62608c798..df68cb650fcb 100644 --- a/AiPlatform/src/V1/UndeployModelOperationMetadata.php +++ b/AiPlatform/src/V1/UndeployModelOperationMetadata.php @@ -21,7 +21,7 @@ class UndeployModelOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UndeployModelRequest.php b/AiPlatform/src/V1/UndeployModelRequest.php index 289a8bc70a9e..6a3e4dc6f079 100644 --- a/AiPlatform/src/V1/UndeployModelRequest.php +++ b/AiPlatform/src/V1/UndeployModelRequest.php @@ -23,13 +23,13 @@ class UndeployModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $endpoint = ''; + protected $endpoint = ''; /** * Required. The ID of the DeployedModel to be undeployed from the Endpoint. * * Generated from protobuf field string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployed_model_id = ''; + protected $deployed_model_id = ''; /** * If this field is provided, then the Endpoint's * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be diff --git a/AiPlatform/src/V1/UnmanagedContainerModel.php b/AiPlatform/src/V1/UnmanagedContainerModel.php index f4b3f7868b90..5979bb7bb0dc 100644 --- a/AiPlatform/src/V1/UnmanagedContainerModel.php +++ b/AiPlatform/src/V1/UnmanagedContainerModel.php @@ -22,20 +22,20 @@ class UnmanagedContainerModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string artifact_uri = 1; */ - private $artifact_uri = ''; + protected $artifact_uri = ''; /** * Contains the schemata used in Model's predictions and explanations * * Generated from protobuf field .google.cloud.aiplatform.v1.PredictSchemata predict_schemata = 2; */ - private $predict_schemata = null; + protected $predict_schemata = null; /** * Input only. The specification of the container that is to be used when * deploying this Model. * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelContainerSpec container_spec = 3 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $container_spec = null; + protected $container_spec = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateArtifactRequest.php b/AiPlatform/src/V1/UpdateArtifactRequest.php index f2e5eb88bd80..18855d1f1bf8 100644 --- a/AiPlatform/src/V1/UpdateArtifactRequest.php +++ b/AiPlatform/src/V1/UpdateArtifactRequest.php @@ -24,13 +24,13 @@ class UpdateArtifactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Artifact artifact = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $artifact = null; + protected $artifact = null; /** * Optional. A FieldMask indicating which fields should be updated. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * If set to true, and the [Artifact][google.cloud.aiplatform.v1.Artifact] is * not found, a new [Artifact][google.cloud.aiplatform.v1.Artifact] is @@ -38,7 +38,7 @@ class UpdateArtifactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool allow_missing = 3; */ - private $allow_missing = false; + protected $allow_missing = false; /** * @param \Google\Cloud\AIPlatform\V1\Artifact $artifact Required. The Artifact containing updates. diff --git a/AiPlatform/src/V1/UpdateContextRequest.php b/AiPlatform/src/V1/UpdateContextRequest.php index 03c516f00026..8be1b17c37e8 100644 --- a/AiPlatform/src/V1/UpdateContextRequest.php +++ b/AiPlatform/src/V1/UpdateContextRequest.php @@ -24,20 +24,20 @@ class UpdateContextRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Context context = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $context = null; + protected $context = null; /** * Optional. A FieldMask indicating which fields should be updated. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * If set to true, and the [Context][google.cloud.aiplatform.v1.Context] is * not found, a new [Context][google.cloud.aiplatform.v1.Context] is created. * * Generated from protobuf field bool allow_missing = 3; */ - private $allow_missing = false; + protected $allow_missing = false; /** * @param \Google\Cloud\AIPlatform\V1\Context $context Required. The Context containing updates. diff --git a/AiPlatform/src/V1/UpdateDatasetRequest.php b/AiPlatform/src/V1/UpdateDatasetRequest.php index 0d0c49a38207..46d4576ab1f3 100644 --- a/AiPlatform/src/V1/UpdateDatasetRequest.php +++ b/AiPlatform/src/V1/UpdateDatasetRequest.php @@ -21,7 +21,7 @@ class UpdateDatasetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $dataset = null; + protected $dataset = null; /** * Required. The update mask applies to the resource. * For the `FieldMask` definition, see @@ -32,7 +32,7 @@ class UpdateDatasetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\Dataset $dataset Required. The Dataset which replaces the resource on the server. diff --git a/AiPlatform/src/V1/UpdateDatasetVersionRequest.php b/AiPlatform/src/V1/UpdateDatasetVersionRequest.php new file mode 100644 index 000000000000..b49bdac761b6 --- /dev/null +++ b/AiPlatform/src/V1/UpdateDatasetVersionRequest.php @@ -0,0 +1,153 @@ +google.cloud.aiplatform.v1.UpdateDatasetVersionRequest + */ +class UpdateDatasetVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The DatasetVersion which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.DatasetVersion dataset_version = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset_version = null; + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Updatable fields: + * * `display_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\AIPlatform\V1\DatasetVersion $datasetVersion Required. The DatasetVersion which replaces the resource on the server. + * @param \Google\Protobuf\FieldMask $updateMask Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Updatable fields: + * + * * `display_name` + * + * @return \Google\Cloud\AIPlatform\V1\UpdateDatasetVersionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AIPlatform\V1\DatasetVersion $datasetVersion, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDatasetVersion($datasetVersion) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AIPlatform\V1\DatasetVersion $dataset_version + * Required. The DatasetVersion which replaces the resource on the server. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Updatable fields: + * * `display_name` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\DatasetService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The DatasetVersion which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.DatasetVersion dataset_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AIPlatform\V1\DatasetVersion|null + */ + public function getDatasetVersion() + { + return $this->dataset_version; + } + + public function hasDatasetVersion() + { + return isset($this->dataset_version); + } + + public function clearDatasetVersion() + { + unset($this->dataset_version); + } + + /** + * Required. The DatasetVersion which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.DatasetVersion dataset_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AIPlatform\V1\DatasetVersion $var + * @return $this + */ + public function setDatasetVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\DatasetVersion::class); + $this->dataset_version = $var; + + return $this; + } + + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Updatable fields: + * * `display_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Updatable fields: + * * `display_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/UpdateDeploymentResourcePoolOperationMetadata.php b/AiPlatform/src/V1/UpdateDeploymentResourcePoolOperationMetadata.php index 9e04bd54895b..df5bff1bdeb0 100644 --- a/AiPlatform/src/V1/UpdateDeploymentResourcePoolOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateDeploymentResourcePoolOperationMetadata.php @@ -20,7 +20,7 @@ class UpdateDeploymentResourcePoolOperationMetadata extends \Google\Protobuf\Int * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateEndpointRequest.php b/AiPlatform/src/V1/UpdateEndpointRequest.php index a6c30c84a81d..cf13c3301717 100644 --- a/AiPlatform/src/V1/UpdateEndpointRequest.php +++ b/AiPlatform/src/V1/UpdateEndpointRequest.php @@ -21,14 +21,14 @@ class UpdateEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $endpoint = null; + protected $endpoint = null; /** * Required. The update mask applies to the resource. See * [google.protobuf.FieldMask][google.protobuf.FieldMask]. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\Endpoint $endpoint Required. The Endpoint which replaces the resource on the server. diff --git a/AiPlatform/src/V1/UpdateEntityTypeRequest.php b/AiPlatform/src/V1/UpdateEntityTypeRequest.php index 2778fd54ba69..f27af5d78b33 100644 --- a/AiPlatform/src/V1/UpdateEntityTypeRequest.php +++ b/AiPlatform/src/V1/UpdateEntityTypeRequest.php @@ -23,7 +23,7 @@ class UpdateEntityTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $entity_type = null; + protected $entity_type = null; /** * Field mask is used to specify the fields to be overwritten in the * EntityType resource by the update. @@ -46,7 +46,7 @@ class UpdateEntityTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\EntityType $entityType Required. The EntityType's `name` field is used to identify the EntityType diff --git a/AiPlatform/src/V1/UpdateExecutionRequest.php b/AiPlatform/src/V1/UpdateExecutionRequest.php index 8fc514b04b44..0619ab61b705 100644 --- a/AiPlatform/src/V1/UpdateExecutionRequest.php +++ b/AiPlatform/src/V1/UpdateExecutionRequest.php @@ -24,13 +24,13 @@ class UpdateExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Execution execution = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $execution = null; + protected $execution = null; /** * Optional. A FieldMask indicating which fields should be updated. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * If set to true, and the [Execution][google.cloud.aiplatform.v1.Execution] * is not found, a new [Execution][google.cloud.aiplatform.v1.Execution] is @@ -38,7 +38,7 @@ class UpdateExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool allow_missing = 3; */ - private $allow_missing = false; + protected $allow_missing = false; /** * @param \Google\Cloud\AIPlatform\V1\Execution $execution Required. The Execution containing updates. diff --git a/AiPlatform/src/V1/UpdateExplanationDatasetOperationMetadata.php b/AiPlatform/src/V1/UpdateExplanationDatasetOperationMetadata.php index 00ede2b06c38..3e0db6c897fe 100644 --- a/AiPlatform/src/V1/UpdateExplanationDatasetOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateExplanationDatasetOperationMetadata.php @@ -21,7 +21,7 @@ class UpdateExplanationDatasetOperationMetadata extends \Google\Protobuf\Interna * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateExplanationDatasetRequest.php b/AiPlatform/src/V1/UpdateExplanationDatasetRequest.php index f81ef7afb096..5802f79b97b7 100644 --- a/AiPlatform/src/V1/UpdateExplanationDatasetRequest.php +++ b/AiPlatform/src/V1/UpdateExplanationDatasetRequest.php @@ -22,13 +22,13 @@ class UpdateExplanationDatasetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * The example config containing the location of the dataset. * * Generated from protobuf field .google.cloud.aiplatform.v1.Examples examples = 2; */ - private $examples = null; + protected $examples = null; /** * @param string $model Required. The resource name of the Model to update. diff --git a/AiPlatform/src/V1/UpdateFeatureGroupOperationMetadata.php b/AiPlatform/src/V1/UpdateFeatureGroupOperationMetadata.php index e74c98a20283..cde219acc27c 100644 --- a/AiPlatform/src/V1/UpdateFeatureGroupOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateFeatureGroupOperationMetadata.php @@ -20,7 +20,7 @@ class UpdateFeatureGroupOperationMetadata extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateFeatureGroupRequest.php b/AiPlatform/src/V1/UpdateFeatureGroupRequest.php index b4cafc2bba3c..f35043a6db47 100644 --- a/AiPlatform/src/V1/UpdateFeatureGroupRequest.php +++ b/AiPlatform/src/V1/UpdateFeatureGroupRequest.php @@ -23,7 +23,7 @@ class UpdateFeatureGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureGroup feature_group = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_group = null; + protected $feature_group = null; /** * Field mask is used to specify the fields to be overwritten in the * FeatureGroup resource by the update. @@ -37,7 +37,7 @@ class UpdateFeatureGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\FeatureGroup $featureGroup Required. The FeatureGroup's `name` field is used to identify the diff --git a/AiPlatform/src/V1/UpdateFeatureOnlineStoreOperationMetadata.php b/AiPlatform/src/V1/UpdateFeatureOnlineStoreOperationMetadata.php index 381f5553ffd6..470e7b56be7b 100644 --- a/AiPlatform/src/V1/UpdateFeatureOnlineStoreOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateFeatureOnlineStoreOperationMetadata.php @@ -20,7 +20,7 @@ class UpdateFeatureOnlineStoreOperationMetadata extends \Google\Protobuf\Interna * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateFeatureOnlineStoreRequest.php b/AiPlatform/src/V1/UpdateFeatureOnlineStoreRequest.php index 3761802094f4..5603df68aca6 100644 --- a/AiPlatform/src/V1/UpdateFeatureOnlineStoreRequest.php +++ b/AiPlatform/src/V1/UpdateFeatureOnlineStoreRequest.php @@ -23,7 +23,7 @@ class UpdateFeatureOnlineStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureOnlineStore feature_online_store = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_online_store = null; + protected $feature_online_store = null; /** * Field mask is used to specify the fields to be overwritten in the * FeatureOnlineStore resource by the update. @@ -40,7 +40,7 @@ class UpdateFeatureOnlineStoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\FeatureOnlineStore $featureOnlineStore Required. The FeatureOnlineStore's `name` field is used to identify the diff --git a/AiPlatform/src/V1/UpdateFeatureOperationMetadata.php b/AiPlatform/src/V1/UpdateFeatureOperationMetadata.php index 05559b062e28..5cafd18f122d 100644 --- a/AiPlatform/src/V1/UpdateFeatureOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateFeatureOperationMetadata.php @@ -20,7 +20,7 @@ class UpdateFeatureOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateFeatureRequest.php b/AiPlatform/src/V1/UpdateFeatureRequest.php index fd7a30ad8969..6a4fd909e868 100644 --- a/AiPlatform/src/V1/UpdateFeatureRequest.php +++ b/AiPlatform/src/V1/UpdateFeatureRequest.php @@ -27,7 +27,7 @@ class UpdateFeatureRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Feature feature = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature = null; + protected $feature = null; /** * Field mask is used to specify the fields to be overwritten in the * Features resource by the update. @@ -43,7 +43,7 @@ class UpdateFeatureRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\Feature $feature Required. The Feature's `name` field is used to identify the Feature to be diff --git a/AiPlatform/src/V1/UpdateFeatureViewOperationMetadata.php b/AiPlatform/src/V1/UpdateFeatureViewOperationMetadata.php index ba0d2b12d3d0..aba40ee40138 100644 --- a/AiPlatform/src/V1/UpdateFeatureViewOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateFeatureViewOperationMetadata.php @@ -20,7 +20,7 @@ class UpdateFeatureViewOperationMetadata extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateFeatureViewRequest.php b/AiPlatform/src/V1/UpdateFeatureViewRequest.php index 761ba08ca67e..b23313f79682 100644 --- a/AiPlatform/src/V1/UpdateFeatureViewRequest.php +++ b/AiPlatform/src/V1/UpdateFeatureViewRequest.php @@ -23,7 +23,7 @@ class UpdateFeatureViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.FeatureView feature_view = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $feature_view = null; + protected $feature_view = null; /** * Field mask is used to specify the fields to be overwritten in the * FeatureView resource by the update. @@ -38,7 +38,7 @@ class UpdateFeatureViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\FeatureView $featureView Required. The FeatureView's `name` field is used to identify the diff --git a/AiPlatform/src/V1/UpdateFeaturestoreOperationMetadata.php b/AiPlatform/src/V1/UpdateFeaturestoreOperationMetadata.php index a0ae8b87d2a5..e28ad331cc20 100644 --- a/AiPlatform/src/V1/UpdateFeaturestoreOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateFeaturestoreOperationMetadata.php @@ -20,7 +20,7 @@ class UpdateFeaturestoreOperationMetadata extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateFeaturestoreRequest.php b/AiPlatform/src/V1/UpdateFeaturestoreRequest.php index 16e73829bd05..75712ca8651f 100644 --- a/AiPlatform/src/V1/UpdateFeaturestoreRequest.php +++ b/AiPlatform/src/V1/UpdateFeaturestoreRequest.php @@ -23,7 +23,7 @@ class UpdateFeaturestoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Featurestore featurestore = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $featurestore = null; + protected $featurestore = null; /** * Field mask is used to specify the fields to be overwritten in the * Featurestore resource by the update. @@ -40,7 +40,7 @@ class UpdateFeaturestoreRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\Featurestore $featurestore Required. The Featurestore's `name` field is used to identify the diff --git a/AiPlatform/src/V1/UpdateIndexEndpointRequest.php b/AiPlatform/src/V1/UpdateIndexEndpointRequest.php index 50e17ace00e8..ce8da1331e74 100644 --- a/AiPlatform/src/V1/UpdateIndexEndpointRequest.php +++ b/AiPlatform/src/V1/UpdateIndexEndpointRequest.php @@ -21,14 +21,14 @@ class UpdateIndexEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.IndexEndpoint index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $index_endpoint = null; + protected $index_endpoint = null; /** * Required. The update mask applies to the resource. See * [google.protobuf.FieldMask][google.protobuf.FieldMask]. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\IndexEndpoint $indexEndpoint Required. The IndexEndpoint which replaces the resource on the server. diff --git a/AiPlatform/src/V1/UpdateIndexOperationMetadata.php b/AiPlatform/src/V1/UpdateIndexOperationMetadata.php index ea8b51449860..e849d182effb 100644 --- a/AiPlatform/src/V1/UpdateIndexOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateIndexOperationMetadata.php @@ -21,13 +21,13 @@ class UpdateIndexOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * The operation metadata with regard to Matching Engine Index operation. * * Generated from protobuf field .google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; */ - private $nearest_neighbor_search_operation_metadata = null; + protected $nearest_neighbor_search_operation_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateIndexRequest.php b/AiPlatform/src/V1/UpdateIndexRequest.php index ddfaca5fed5c..5bac41030df1 100644 --- a/AiPlatform/src/V1/UpdateIndexRequest.php +++ b/AiPlatform/src/V1/UpdateIndexRequest.php @@ -21,7 +21,7 @@ class UpdateIndexRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Index index = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $index = null; + protected $index = null; /** * The update mask applies to the resource. * For the `FieldMask` definition, see @@ -29,7 +29,7 @@ class UpdateIndexRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\Index $index Required. The Index which updates the resource on the server. diff --git a/AiPlatform/src/V1/UpdateModelDeploymentMonitoringJobOperationMetadata.php b/AiPlatform/src/V1/UpdateModelDeploymentMonitoringJobOperationMetadata.php index 711291725583..3d0fc95854ce 100644 --- a/AiPlatform/src/V1/UpdateModelDeploymentMonitoringJobOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateModelDeploymentMonitoringJobOperationMetadata.php @@ -21,7 +21,7 @@ class UpdateModelDeploymentMonitoringJobOperationMetadata extends \Google\Protob * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateModelDeploymentMonitoringJobRequest.php b/AiPlatform/src/V1/UpdateModelDeploymentMonitoringJobRequest.php index b79d2fccda62..9c23d08874e2 100644 --- a/AiPlatform/src/V1/UpdateModelDeploymentMonitoringJobRequest.php +++ b/AiPlatform/src/V1/UpdateModelDeploymentMonitoringJobRequest.php @@ -22,7 +22,7 @@ class UpdateModelDeploymentMonitoringJobRequest extends \Google\Protobuf\Interna * * Generated from protobuf field .google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob model_deployment_monitoring_job = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $model_deployment_monitoring_job = null; + protected $model_deployment_monitoring_job = null; /** * Required. The update mask is used to specify the fields to be overwritten * in the ModelDeploymentMonitoringJob resource by the update. The fields @@ -51,7 +51,7 @@ class UpdateModelDeploymentMonitoringJobRequest extends \Google\Protobuf\Interna * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob $modelDeploymentMonitoringJob Required. The model monitoring configuration which replaces the resource on diff --git a/AiPlatform/src/V1/UpdateModelRequest.php b/AiPlatform/src/V1/UpdateModelRequest.php index baf2609c9654..3945ac5f6e7e 100644 --- a/AiPlatform/src/V1/UpdateModelRequest.php +++ b/AiPlatform/src/V1/UpdateModelRequest.php @@ -38,7 +38,7 @@ class UpdateModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $model = null; + protected $model = null; /** * Required. The update mask applies to the resource. * For the `FieldMask` definition, see @@ -46,7 +46,7 @@ class UpdateModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\Model $model Required. The Model which replaces the resource on the server. diff --git a/AiPlatform/src/V1/UpdateNotebookRuntimeTemplateRequest.php b/AiPlatform/src/V1/UpdateNotebookRuntimeTemplateRequest.php new file mode 100644 index 000000000000..512191eab074 --- /dev/null +++ b/AiPlatform/src/V1/UpdateNotebookRuntimeTemplateRequest.php @@ -0,0 +1,158 @@ +google.cloud.aiplatform.v1.UpdateNotebookRuntimeTemplateRequest + */ +class UpdateNotebookRuntimeTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The NotebookRuntimeTemplate to update. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntimeTemplate notebook_runtime_template = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $notebook_runtime_template = null; + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Input format: + * `{paths: "${updated_filed}"}` Updatable fields: + * * `encryption_spec.kms_key_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate $notebookRuntimeTemplate Required. The NotebookRuntimeTemplate to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Input format: + * `{paths: "${updated_filed}"}` Updatable fields: + * + * * `encryption_spec.kms_key_name` + * + * @return \Google\Cloud\AIPlatform\V1\UpdateNotebookRuntimeTemplateRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate $notebookRuntimeTemplate, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setNotebookRuntimeTemplate($notebookRuntimeTemplate) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate $notebook_runtime_template + * Required. The NotebookRuntimeTemplate to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Input format: + * `{paths: "${updated_filed}"}` Updatable fields: + * * `encryption_spec.kms_key_name` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\NotebookService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The NotebookRuntimeTemplate to update. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntimeTemplate notebook_runtime_template = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate|null + */ + public function getNotebookRuntimeTemplate() + { + return $this->notebook_runtime_template; + } + + public function hasNotebookRuntimeTemplate() + { + return isset($this->notebook_runtime_template); + } + + public function clearNotebookRuntimeTemplate() + { + unset($this->notebook_runtime_template); + } + + /** + * Required. The NotebookRuntimeTemplate to update. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.NotebookRuntimeTemplate notebook_runtime_template = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate $var + * @return $this + */ + public function setNotebookRuntimeTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate::class); + $this->notebook_runtime_template = $var; + + return $this; + } + + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Input format: + * `{paths: "${updated_filed}"}` Updatable fields: + * * `encryption_spec.kms_key_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * [google.protobuf.FieldMask][google.protobuf.FieldMask]. Input format: + * `{paths: "${updated_filed}"}` Updatable fields: + * * `encryption_spec.kms_key_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/UpdatePersistentResourceOperationMetadata.php b/AiPlatform/src/V1/UpdatePersistentResourceOperationMetadata.php index bc3dd13eaf1f..b1dd3ee768f6 100644 --- a/AiPlatform/src/V1/UpdatePersistentResourceOperationMetadata.php +++ b/AiPlatform/src/V1/UpdatePersistentResourceOperationMetadata.php @@ -20,13 +20,13 @@ class UpdatePersistentResourceOperationMetadata extends \Google\Protobuf\Interna * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Progress Message for Update LRO * * Generated from protobuf field string progress_message = 2; */ - private $progress_message = ''; + protected $progress_message = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdatePersistentResourceRequest.php b/AiPlatform/src/V1/UpdatePersistentResourceRequest.php index 8da87c571779..1bab652a757f 100644 --- a/AiPlatform/src/V1/UpdatePersistentResourceRequest.php +++ b/AiPlatform/src/V1/UpdatePersistentResourceRequest.php @@ -23,14 +23,14 @@ class UpdatePersistentResourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.PersistentResource persistent_resource = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $persistent_resource = null; + protected $persistent_resource = null; /** * Required. Specify the fields to be overwritten in the PersistentResource by * the update method. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\PersistentResource $persistentResource Required. The PersistentResource to update. diff --git a/AiPlatform/src/V1/UpdateScheduleRequest.php b/AiPlatform/src/V1/UpdateScheduleRequest.php index d324cb71cc6a..6194c0c97b54 100644 --- a/AiPlatform/src/V1/UpdateScheduleRequest.php +++ b/AiPlatform/src/V1/UpdateScheduleRequest.php @@ -25,14 +25,14 @@ class UpdateScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $schedule = null; + protected $schedule = null; /** * Required. The update mask applies to the resource. See * [google.protobuf.FieldMask][google.protobuf.FieldMask]. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\Schedule $schedule Required. The Schedule which replaces the resource on the server. diff --git a/AiPlatform/src/V1/UpdateSpecialistPoolOperationMetadata.php b/AiPlatform/src/V1/UpdateSpecialistPoolOperationMetadata.php index b772b989ab16..9e645333a7e3 100644 --- a/AiPlatform/src/V1/UpdateSpecialistPoolOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateSpecialistPoolOperationMetadata.php @@ -23,13 +23,13 @@ class UpdateSpecialistPoolOperationMetadata extends \Google\Protobuf\Internal\Me * * Generated from protobuf field string specialist_pool = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $specialist_pool = ''; + protected $specialist_pool = ''; /** * The operation generic information. * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 2; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateSpecialistPoolRequest.php b/AiPlatform/src/V1/UpdateSpecialistPoolRequest.php index 28085aa69968..2d9a847c6940 100644 --- a/AiPlatform/src/V1/UpdateSpecialistPoolRequest.php +++ b/AiPlatform/src/V1/UpdateSpecialistPoolRequest.php @@ -21,13 +21,13 @@ class UpdateSpecialistPoolRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.SpecialistPool specialist_pool = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $specialist_pool = null; + protected $specialist_pool = null; /** * Required. The update mask applies to the resource. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AIPlatform\V1\SpecialistPool $specialistPool Required. The SpecialistPool which replaces the resource on the server. diff --git a/AiPlatform/src/V1/UpdateTensorboardExperimentRequest.php b/AiPlatform/src/V1/UpdateTensorboardExperimentRequest.php index 1798e41de4a5..caea902e4747 100644 --- a/AiPlatform/src/V1/UpdateTensorboardExperimentRequest.php +++ b/AiPlatform/src/V1/UpdateTensorboardExperimentRequest.php @@ -26,7 +26,7 @@ class UpdateTensorboardExperimentRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The TensorboardExperiment's `name` field is used to identify the * TensorboardExperiment to be updated. Format: @@ -34,7 +34,7 @@ class UpdateTensorboardExperimentRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field .google.cloud.aiplatform.v1.TensorboardExperiment tensorboard_experiment = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard_experiment = null; + protected $tensorboard_experiment = null; /** * @param \Google\Cloud\AIPlatform\V1\TensorboardExperiment $tensorboardExperiment Required. The TensorboardExperiment's `name` field is used to identify the diff --git a/AiPlatform/src/V1/UpdateTensorboardOperationMetadata.php b/AiPlatform/src/V1/UpdateTensorboardOperationMetadata.php index b40468584cd0..c0a6ec8108c9 100644 --- a/AiPlatform/src/V1/UpdateTensorboardOperationMetadata.php +++ b/AiPlatform/src/V1/UpdateTensorboardOperationMetadata.php @@ -20,7 +20,7 @@ class UpdateTensorboardOperationMetadata extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UpdateTensorboardRequest.php b/AiPlatform/src/V1/UpdateTensorboardRequest.php index abf5d3a06bc2..0e92dfc199a8 100644 --- a/AiPlatform/src/V1/UpdateTensorboardRequest.php +++ b/AiPlatform/src/V1/UpdateTensorboardRequest.php @@ -26,7 +26,7 @@ class UpdateTensorboardRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The Tensorboard's `name` field is used to identify the * Tensorboard to be updated. Format: @@ -34,7 +34,7 @@ class UpdateTensorboardRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.Tensorboard tensorboard = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard = null; + protected $tensorboard = null; /** * @param \Google\Cloud\AIPlatform\V1\Tensorboard $tensorboard Required. The Tensorboard's `name` field is used to identify the diff --git a/AiPlatform/src/V1/UpdateTensorboardRunRequest.php b/AiPlatform/src/V1/UpdateTensorboardRunRequest.php index 2e4a998fdd62..2f0a0bac0536 100644 --- a/AiPlatform/src/V1/UpdateTensorboardRunRequest.php +++ b/AiPlatform/src/V1/UpdateTensorboardRunRequest.php @@ -26,7 +26,7 @@ class UpdateTensorboardRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The TensorboardRun's `name` field is used to identify the * TensorboardRun to be updated. Format: @@ -34,7 +34,7 @@ class UpdateTensorboardRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.TensorboardRun tensorboard_run = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard_run = null; + protected $tensorboard_run = null; /** * @param \Google\Cloud\AIPlatform\V1\TensorboardRun $tensorboardRun Required. The TensorboardRun's `name` field is used to identify the diff --git a/AiPlatform/src/V1/UpdateTensorboardTimeSeriesRequest.php b/AiPlatform/src/V1/UpdateTensorboardTimeSeriesRequest.php index 91b844b81ed0..537c8d8e03ec 100644 --- a/AiPlatform/src/V1/UpdateTensorboardTimeSeriesRequest.php +++ b/AiPlatform/src/V1/UpdateTensorboardTimeSeriesRequest.php @@ -26,7 +26,7 @@ class UpdateTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The TensorboardTimeSeries' `name` field is used to identify the * TensorboardTimeSeries to be updated. @@ -35,7 +35,7 @@ class UpdateTensorboardTimeSeriesRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field .google.cloud.aiplatform.v1.TensorboardTimeSeries tensorboard_time_series = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $tensorboard_time_series = null; + protected $tensorboard_time_series = null; /** * @param \Google\Cloud\AIPlatform\V1\TensorboardTimeSeries $tensorboardTimeSeries Required. The TensorboardTimeSeries' `name` field is used to identify the diff --git a/AiPlatform/src/V1/UpgradeNotebookRuntimeOperationMetadata.php b/AiPlatform/src/V1/UpgradeNotebookRuntimeOperationMetadata.php index 79aef9cbfdcd..358eb463a38b 100644 --- a/AiPlatform/src/V1/UpgradeNotebookRuntimeOperationMetadata.php +++ b/AiPlatform/src/V1/UpgradeNotebookRuntimeOperationMetadata.php @@ -21,14 +21,14 @@ class UpgradeNotebookRuntimeOperationMetadata extends \Google\Protobuf\Internal\ * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * A human-readable message that shows the intermediate progress details of * NotebookRuntime. * * Generated from protobuf field string progress_message = 2; */ - private $progress_message = ''; + protected $progress_message = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/UpgradeNotebookRuntimeRequest.php b/AiPlatform/src/V1/UpgradeNotebookRuntimeRequest.php index 9ed6b370b2cb..6ce9eb6ae5f1 100644 --- a/AiPlatform/src/V1/UpgradeNotebookRuntimeRequest.php +++ b/AiPlatform/src/V1/UpgradeNotebookRuntimeRequest.php @@ -24,7 +24,7 @@ class UpgradeNotebookRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the NotebookRuntime resource to be upgrade. diff --git a/AiPlatform/src/V1/UploadModelOperationMetadata.php b/AiPlatform/src/V1/UploadModelOperationMetadata.php index 22b4cd30be6b..d70bfb3ab8a6 100644 --- a/AiPlatform/src/V1/UploadModelOperationMetadata.php +++ b/AiPlatform/src/V1/UploadModelOperationMetadata.php @@ -22,7 +22,7 @@ class UploadModelOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; */ - private $generic_metadata = null; + protected $generic_metadata = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UploadModelRequest.php b/AiPlatform/src/V1/UploadModelRequest.php index 75e1f5079c13..69501a951a39 100644 --- a/AiPlatform/src/V1/UploadModelRequest.php +++ b/AiPlatform/src/V1/UploadModelRequest.php @@ -22,14 +22,14 @@ class UploadModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The resource name of the model into which to upload the version. * Only specify this field when uploading a new version. * * Generated from protobuf field string parent_model = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $parent_model = ''; + protected $parent_model = ''; /** * Optional. The ID to use for the uploaded Model, which will become the final * component of the model resource name. @@ -38,13 +38,13 @@ class UploadModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model_id = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $model_id = ''; + protected $model_id = ''; /** * Required. The Model to create. * * Generated from protobuf field .google.cloud.aiplatform.v1.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $model = null; + protected $model = null; /** * Optional. The user-provided custom service account to use to do the model * upload. If empty, [Vertex AI Service @@ -56,7 +56,7 @@ class UploadModelRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_account = ''; + protected $service_account = ''; /** * @param string $parent Required. The resource name of the Location into which to upload the Model. diff --git a/AiPlatform/src/V1/UploadModelResponse.php b/AiPlatform/src/V1/UploadModelResponse.php index f7d6f9fa34ee..c23e9cb588b0 100644 --- a/AiPlatform/src/V1/UploadModelResponse.php +++ b/AiPlatform/src/V1/UploadModelResponse.php @@ -23,13 +23,13 @@ class UploadModelResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string model = 1 [(.google.api.resource_reference) = { */ - private $model = ''; + protected $model = ''; /** * Output only. The version ID of the model that is uploaded. * * Generated from protobuf field string model_version_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $model_version_id = ''; + protected $model_version_id = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/UpsertDatapointsRequest.php b/AiPlatform/src/V1/UpsertDatapointsRequest.php index 4a94240bca6e..483d4b8da232 100644 --- a/AiPlatform/src/V1/UpsertDatapointsRequest.php +++ b/AiPlatform/src/V1/UpsertDatapointsRequest.php @@ -23,7 +23,7 @@ class UpsertDatapointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string index = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $index = ''; + protected $index = ''; /** * A list of datapoints to be created/updated. * @@ -39,7 +39,7 @@ class UpsertDatapointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * Constructor. diff --git a/AiPlatform/src/V1/UserActionReference.php b/AiPlatform/src/V1/UserActionReference.php index b60a9fab6a72..0f20b8fd1531 100644 --- a/AiPlatform/src/V1/UserActionReference.php +++ b/AiPlatform/src/V1/UserActionReference.php @@ -22,7 +22,7 @@ class UserActionReference extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string method = 3; */ - private $method = ''; + protected $method = ''; protected $reference; /** diff --git a/AiPlatform/src/V1/VertexAISearch.php b/AiPlatform/src/V1/VertexAISearch.php index cdf98c4910d7..9c1e78170308 100644 --- a/AiPlatform/src/V1/VertexAISearch.php +++ b/AiPlatform/src/V1/VertexAISearch.php @@ -23,7 +23,7 @@ class VertexAISearch extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string datastore = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $datastore = ''; + protected $datastore = ''; /** * Constructor. diff --git a/AiPlatform/src/V1/VideoMetadata.php b/AiPlatform/src/V1/VideoMetadata.php index 960e74b28dae..f59bf9eae70e 100644 --- a/AiPlatform/src/V1/VideoMetadata.php +++ b/AiPlatform/src/V1/VideoMetadata.php @@ -20,13 +20,13 @@ class VideoMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $start_offset = null; + protected $start_offset = null; /** * Optional. The end offset of the video. * * Generated from protobuf field .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $end_offset = null; + protected $end_offset = null; /** * Constructor. diff --git a/AiPlatform/src/V1/VizierServiceClient.php b/AiPlatform/src/V1/VizierServiceClient.php deleted file mode 100644 index fb24f047ec6b..000000000000 --- a/AiPlatform/src/V1/VizierServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.aiplatform.v1.VizierService/CreateStudy', - $argument, - ['\Google\Cloud\AIPlatform\V1\Study', 'decode'], - $metadata, $options); - } - - /** - * Gets a Study by name. - * @param \Google\Cloud\AIPlatform\V1\GetStudyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetStudy(\Google\Cloud\AIPlatform\V1\GetStudyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/GetStudy', - $argument, - ['\Google\Cloud\AIPlatform\V1\Study', 'decode'], - $metadata, $options); - } - - /** - * Lists all the studies in a region for an associated project. - * @param \Google\Cloud\AIPlatform\V1\ListStudiesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListStudies(\Google\Cloud\AIPlatform\V1\ListStudiesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/ListStudies', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListStudiesResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a Study. - * @param \Google\Cloud\AIPlatform\V1\DeleteStudyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteStudy(\Google\Cloud\AIPlatform\V1\DeleteStudyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/DeleteStudy', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Looks a study up using the user-defined display_name field instead of the - * fully qualified resource name. - * @param \Google\Cloud\AIPlatform\V1\LookupStudyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function LookupStudy(\Google\Cloud\AIPlatform\V1\LookupStudyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/LookupStudy', - $argument, - ['\Google\Cloud\AIPlatform\V1\Study', 'decode'], - $metadata, $options); - } - - /** - * Adds one or more Trials to a Study, with parameter values - * suggested by Vertex AI Vizier. Returns a long-running - * operation associated with the generation of Trial suggestions. - * When this long-running operation succeeds, it will contain - * a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse]. - * @param \Google\Cloud\AIPlatform\V1\SuggestTrialsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SuggestTrials(\Google\Cloud\AIPlatform\V1\SuggestTrialsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/SuggestTrials', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Adds a user provided Trial to a Study. - * @param \Google\Cloud\AIPlatform\V1\CreateTrialRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTrial(\Google\Cloud\AIPlatform\V1\CreateTrialRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/CreateTrial', - $argument, - ['\Google\Cloud\AIPlatform\V1\Trial', 'decode'], - $metadata, $options); - } - - /** - * Gets a Trial. - * @param \Google\Cloud\AIPlatform\V1\GetTrialRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTrial(\Google\Cloud\AIPlatform\V1\GetTrialRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/GetTrial', - $argument, - ['\Google\Cloud\AIPlatform\V1\Trial', 'decode'], - $metadata, $options); - } - - /** - * Lists the Trials associated with a Study. - * @param \Google\Cloud\AIPlatform\V1\ListTrialsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTrials(\Google\Cloud\AIPlatform\V1\ListTrialsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/ListTrials', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListTrialsResponse', 'decode'], - $metadata, $options); - } - - /** - * Adds a measurement of the objective metrics to a Trial. This measurement - * is assumed to have been taken before the Trial is complete. - * @param \Google\Cloud\AIPlatform\V1\AddTrialMeasurementRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AddTrialMeasurement(\Google\Cloud\AIPlatform\V1\AddTrialMeasurementRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/AddTrialMeasurement', - $argument, - ['\Google\Cloud\AIPlatform\V1\Trial', 'decode'], - $metadata, $options); - } - - /** - * Marks a Trial as complete. - * @param \Google\Cloud\AIPlatform\V1\CompleteTrialRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CompleteTrial(\Google\Cloud\AIPlatform\V1\CompleteTrialRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/CompleteTrial', - $argument, - ['\Google\Cloud\AIPlatform\V1\Trial', 'decode'], - $metadata, $options); - } - - /** - * Deletes a Trial. - * @param \Google\Cloud\AIPlatform\V1\DeleteTrialRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTrial(\Google\Cloud\AIPlatform\V1\DeleteTrialRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/DeleteTrial', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Checks whether a Trial should stop or not. Returns a - * long-running operation. When the operation is successful, - * it will contain a - * [CheckTrialEarlyStoppingStateResponse][google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse]. - * @param \Google\Cloud\AIPlatform\V1\CheckTrialEarlyStoppingStateRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CheckTrialEarlyStoppingState(\Google\Cloud\AIPlatform\V1\CheckTrialEarlyStoppingStateRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/CheckTrialEarlyStoppingState', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Stops a Trial. - * @param \Google\Cloud\AIPlatform\V1\StopTrialRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StopTrial(\Google\Cloud\AIPlatform\V1\StopTrialRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/StopTrial', - $argument, - ['\Google\Cloud\AIPlatform\V1\Trial', 'decode'], - $metadata, $options); - } - - /** - * Lists the pareto-optimal Trials for multi-objective Study or the - * optimal Trials for single-objective Study. The definition of - * pareto-optimal can be checked in wiki page. - * https://en.wikipedia.org/wiki/Pareto_efficiency - * @param \Google\Cloud\AIPlatform\V1\ListOptimalTrialsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListOptimalTrials(\Google\Cloud\AIPlatform\V1\ListOptimalTrialsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.aiplatform.v1.VizierService/ListOptimalTrials', - $argument, - ['\Google\Cloud\AIPlatform\V1\ListOptimalTrialsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AiPlatform/src/V1/WorkerPoolSpec.php b/AiPlatform/src/V1/WorkerPoolSpec.php index 9285f136b42f..7187edeeb7e5 100644 --- a/AiPlatform/src/V1/WorkerPoolSpec.php +++ b/AiPlatform/src/V1/WorkerPoolSpec.php @@ -20,13 +20,13 @@ class WorkerPoolSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; */ - private $machine_spec = null; + protected $machine_spec = null; /** * Optional. The number of worker replicas to use for this worker pool. * * Generated from protobuf field int64 replica_count = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $replica_count = 0; + protected $replica_count = 0; /** * Optional. List of NFS mount spec. * @@ -38,7 +38,7 @@ class WorkerPoolSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.DiskSpec disk_spec = 5; */ - private $disk_spec = null; + protected $disk_spec = null; protected $task; /** diff --git a/AiPlatform/src/V1/WriteFeatureValuesPayload.php b/AiPlatform/src/V1/WriteFeatureValuesPayload.php index bf8e92379307..97cb1a18d92d 100644 --- a/AiPlatform/src/V1/WriteFeatureValuesPayload.php +++ b/AiPlatform/src/V1/WriteFeatureValuesPayload.php @@ -20,7 +20,7 @@ class WriteFeatureValuesPayload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $entity_id = ''; + protected $entity_id = ''; /** * Required. Feature values to be written, mapping from Feature ID to value. * Up to 100,000 `feature_values` entries may be written across all payloads. diff --git a/AiPlatform/src/V1/WriteFeatureValuesRequest.php b/AiPlatform/src/V1/WriteFeatureValuesRequest.php index 7965ea6a4369..eca5d3ecd97e 100644 --- a/AiPlatform/src/V1/WriteFeatureValuesRequest.php +++ b/AiPlatform/src/V1/WriteFeatureValuesRequest.php @@ -26,7 +26,7 @@ class WriteFeatureValuesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $entity_type = ''; + protected $entity_type = ''; /** * Required. The entities to be written. Up to 100,000 feature values can be * written across all `payloads`. diff --git a/AiPlatform/src/V1/WriteTensorboardExperimentDataRequest.php b/AiPlatform/src/V1/WriteTensorboardExperimentDataRequest.php index e63777f25b80..884f4b0e7ebb 100644 --- a/AiPlatform/src/V1/WriteTensorboardExperimentDataRequest.php +++ b/AiPlatform/src/V1/WriteTensorboardExperimentDataRequest.php @@ -23,7 +23,7 @@ class WriteTensorboardExperimentDataRequest extends \Google\Protobuf\Internal\Me * * Generated from protobuf field string tensorboard_experiment = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $tensorboard_experiment = ''; + protected $tensorboard_experiment = ''; /** * Required. Requests containing per-run TensorboardTimeSeries data to write. * diff --git a/AiPlatform/src/V1/WriteTensorboardRunDataRequest.php b/AiPlatform/src/V1/WriteTensorboardRunDataRequest.php index 0e5837b9f67c..8506fce8fcce 100644 --- a/AiPlatform/src/V1/WriteTensorboardRunDataRequest.php +++ b/AiPlatform/src/V1/WriteTensorboardRunDataRequest.php @@ -23,7 +23,7 @@ class WriteTensorboardRunDataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tensorboard_run = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $tensorboard_run = ''; + protected $tensorboard_run = ''; /** * Required. The TensorboardTimeSeries data to write. * Values with in a time series are indexed by their step value. diff --git a/AiPlatform/src/V1/XraiAttribution.php b/AiPlatform/src/V1/XraiAttribution.php index c9970d191faf..bac942e9f60f 100644 --- a/AiPlatform/src/V1/XraiAttribution.php +++ b/AiPlatform/src/V1/XraiAttribution.php @@ -27,7 +27,7 @@ class XraiAttribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $step_count = 0; + protected $step_count = 0; /** * Config for SmoothGrad approximation of gradients. * When enabled, the gradients are approximated by averaging the gradients @@ -37,7 +37,7 @@ class XraiAttribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.SmoothGradConfig smooth_grad_config = 2; */ - private $smooth_grad_config = null; + protected $smooth_grad_config = null; /** * Config for XRAI with blur baseline. * When enabled, a linear path from the maximally blurred image to the input @@ -47,7 +47,7 @@ class XraiAttribution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.aiplatform.v1.BlurBaselineConfig blur_baseline_config = 3; */ - private $blur_baseline_config = null; + protected $blur_baseline_config = null; /** * Constructor. diff --git a/AiPlatform/src/V1/gapic_metadata.json b/AiPlatform/src/V1/gapic_metadata.json index e1ab0115869f..c8479fe9a50d 100644 --- a/AiPlatform/src/V1/gapic_metadata.json +++ b/AiPlatform/src/V1/gapic_metadata.json @@ -100,6 +100,11 @@ "updateDataset" ] }, + "UpdateDatasetVersion": { + "methods": [ + "updateDatasetVersion" + ] + }, "GetLocation": { "methods": [ "getLocation" @@ -1508,6 +1513,45 @@ } } }, + "ModelGardenService": { + "clients": { + "grpc": { + "libraryClient": "ModelGardenServiceGapicClient", + "rpcs": { + "GetPublisherModel": { + "methods": [ + "getPublisherModel" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + }, "ModelService": { "clients": { "grpc": { @@ -1632,45 +1676,6 @@ } } }, - "ModelGardenService": { - "clients": { - "grpc": { - "libraryClient": "ModelGardenServiceGapicClient", - "rpcs": { - "GetPublisherModel": { - "methods": [ - "getPublisherModel" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - }, "NotebookService": { "clients": { "grpc": { @@ -1721,6 +1726,11 @@ "startNotebookRuntime" ] }, + "UpdateNotebookRuntimeTemplate": { + "methods": [ + "updateNotebookRuntimeTemplate" + ] + }, "UpgradeNotebookRuntime": { "methods": [ "upgradeNotebookRuntime" diff --git a/AiPlatform/src/V1/resources/dataset_service_client_config.json b/AiPlatform/src/V1/resources/dataset_service_client_config.json index f2eef2cb9580..9545b9e5a2ce 100644 --- a/AiPlatform/src/V1/resources/dataset_service_client_config.json +++ b/AiPlatform/src/V1/resources/dataset_service_client_config.json @@ -106,6 +106,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "UpdateDatasetVersion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetLocation": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/AiPlatform/src/V1/resources/dataset_service_descriptor_config.php b/AiPlatform/src/V1/resources/dataset_service_descriptor_config.php index 886d56c6fbd0..fdb258d4597d 100644 --- a/AiPlatform/src/V1/resources/dataset_service_descriptor_config.php +++ b/AiPlatform/src/V1/resources/dataset_service_descriptor_config.php @@ -344,6 +344,19 @@ ], ], ], + 'UpdateDatasetVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AIPlatform\V1\DatasetVersion', + 'headerParams' => [ + [ + 'keyName' => 'dataset_version.name', + 'fieldAccessors' => [ + 'getDatasetVersion', + 'getName', + ], + ], + ], + ], 'GetLocation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Location\Location', diff --git a/AiPlatform/src/V1/resources/dataset_service_rest_client_config.php b/AiPlatform/src/V1/resources/dataset_service_rest_client_config.php index 11e21abad0d1..8ad245bb08b8 100644 --- a/AiPlatform/src/V1/resources/dataset_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/dataset_service_rest_client_config.php @@ -230,6 +230,22 @@ 'update_mask', ], ], + 'UpdateDatasetVersion' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{dataset_version.name=projects/*/locations/*/datasets/*/datasetVersions/*}', + 'body' => 'dataset_version', + 'placeholders' => [ + 'dataset_version.name' => [ + 'getters' => [ + 'getDatasetVersion', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], ], 'google.cloud.location.Locations' => [ 'GetLocation' => [ @@ -448,6 +464,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -761,6 +785,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1098,6 +1130,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1447,6 +1487,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1792,6 +1840,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/deployment_resource_pool_service_rest_client_config.php b/AiPlatform/src/V1/resources/deployment_resource_pool_service_rest_client_config.php index 3e4bf8bbe78a..3d307d2f8e44 100644 --- a/AiPlatform/src/V1/resources/deployment_resource_pool_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/deployment_resource_pool_service_rest_client_config.php @@ -297,6 +297,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -610,6 +618,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -947,6 +963,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1296,6 +1320,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1641,6 +1673,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/endpoint_service_rest_client_config.php b/AiPlatform/src/V1/resources/endpoint_service_rest_client_config.php index a1ce269a0d90..cf74fd0d0207 100644 --- a/AiPlatform/src/V1/resources/endpoint_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/endpoint_service_rest_client_config.php @@ -338,6 +338,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -651,6 +659,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -988,6 +1004,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1337,6 +1361,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1682,6 +1714,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/feature_online_store_admin_service_rest_client_config.php b/AiPlatform/src/V1/resources/feature_online_store_admin_service_rest_client_config.php index 15f14f1c340f..4edff8ec6d78 100644 --- a/AiPlatform/src/V1/resources/feature_online_store_admin_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/feature_online_store_admin_service_rest_client_config.php @@ -397,6 +397,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -710,6 +718,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1047,6 +1063,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1396,6 +1420,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1741,6 +1773,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/feature_online_store_service_rest_client_config.php b/AiPlatform/src/V1/resources/feature_online_store_service_rest_client_config.php index b164a2bf4012..3f67ec3fd7b9 100644 --- a/AiPlatform/src/V1/resources/feature_online_store_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/feature_online_store_service_rest_client_config.php @@ -265,6 +265,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -578,6 +586,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -915,6 +931,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1264,6 +1288,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1609,6 +1641,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/feature_registry_service_rest_client_config.php b/AiPlatform/src/V1/resources/feature_registry_service_rest_client_config.php index 88687e5e3173..84d4228cf65d 100644 --- a/AiPlatform/src/V1/resources/feature_registry_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/feature_registry_service_rest_client_config.php @@ -363,6 +363,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -676,6 +684,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1013,6 +1029,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1362,6 +1386,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1707,6 +1739,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/featurestore_online_serving_service_rest_client_config.php b/AiPlatform/src/V1/resources/featurestore_online_serving_service_rest_client_config.php index 7b69b757554f..0e783f3b97dd 100644 --- a/AiPlatform/src/V1/resources/featurestore_online_serving_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/featurestore_online_serving_service_rest_client_config.php @@ -277,6 +277,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -590,6 +598,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -927,6 +943,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1276,6 +1300,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1621,6 +1653,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/featurestore_service_rest_client_config.php b/AiPlatform/src/V1/resources/featurestore_service_rest_client_config.php index 47f5a60820a3..cf6209e549b5 100644 --- a/AiPlatform/src/V1/resources/featurestore_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/featurestore_service_rest_client_config.php @@ -495,6 +495,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -808,6 +816,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1145,6 +1161,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1494,6 +1518,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1839,6 +1871,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/gen_ai_tuning_service_rest_client_config.php b/AiPlatform/src/V1/resources/gen_ai_tuning_service_rest_client_config.php index 2bb864d8d182..d7dab8f28fc4 100644 --- a/AiPlatform/src/V1/resources/gen_ai_tuning_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/gen_ai_tuning_service_rest_client_config.php @@ -287,6 +287,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -600,6 +608,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -937,6 +953,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1286,6 +1310,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1631,6 +1663,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/index_endpoint_service_rest_client_config.php b/AiPlatform/src/V1/resources/index_endpoint_service_rest_client_config.php index 43df1a4a494b..952411ba6600 100644 --- a/AiPlatform/src/V1/resources/index_endpoint_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/index_endpoint_service_rest_client_config.php @@ -338,6 +338,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -651,6 +659,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -988,6 +1004,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1337,6 +1361,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1682,6 +1714,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/index_service_rest_client_config.php b/AiPlatform/src/V1/resources/index_service_rest_client_config.php index 5b6d0d17f18e..1055bcad2da5 100644 --- a/AiPlatform/src/V1/resources/index_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/index_service_rest_client_config.php @@ -323,6 +323,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -636,6 +644,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -973,6 +989,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1322,6 +1346,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1667,6 +1699,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/job_service_rest_client_config.php b/AiPlatform/src/V1/resources/job_service_rest_client_config.php index bb5f3227dbe9..679241f26e57 100644 --- a/AiPlatform/src/V1/resources/job_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/job_service_rest_client_config.php @@ -645,6 +645,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -958,6 +966,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1295,6 +1311,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1644,6 +1668,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1989,6 +2021,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/llm_utility_service_rest_client_config.php b/AiPlatform/src/V1/resources/llm_utility_service_rest_client_config.php index a86ce86a4b06..7718e2d54a4f 100644 --- a/AiPlatform/src/V1/resources/llm_utility_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/llm_utility_service_rest_client_config.php @@ -279,6 +279,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -592,6 +600,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -929,6 +945,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1278,6 +1302,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1623,6 +1655,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/match_service_rest_client_config.php b/AiPlatform/src/V1/resources/match_service_rest_client_config.php index 1762bf680174..e606da065aa0 100644 --- a/AiPlatform/src/V1/resources/match_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/match_service_rest_client_config.php @@ -265,6 +265,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -578,6 +586,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -915,6 +931,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1264,6 +1288,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1609,6 +1641,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/metadata_service_rest_client_config.php b/AiPlatform/src/V1/resources/metadata_service_rest_client_config.php index ba387c35bc17..e3e2883373c5 100644 --- a/AiPlatform/src/V1/resources/metadata_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/metadata_service_rest_client_config.php @@ -611,6 +611,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -924,6 +932,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1261,6 +1277,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1610,6 +1634,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1955,6 +1987,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/migration_service_rest_client_config.php b/AiPlatform/src/V1/resources/migration_service_rest_client_config.php index c2d8f89d909e..52bd7dd3a385 100644 --- a/AiPlatform/src/V1/resources/migration_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/migration_service_rest_client_config.php @@ -265,6 +265,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -578,6 +586,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -915,6 +931,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1264,6 +1288,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1609,6 +1641,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/model_garden_service_rest_client_config.php b/AiPlatform/src/V1/resources/model_garden_service_rest_client_config.php index 1541f49d832b..cbd4e41bb58b 100644 --- a/AiPlatform/src/V1/resources/model_garden_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/model_garden_service_rest_client_config.php @@ -252,6 +252,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -565,6 +573,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -902,6 +918,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1251,6 +1275,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1596,6 +1628,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/model_service_rest_client_config.php b/AiPlatform/src/V1/resources/model_service_rest_client_config.php index f77ef30f63ad..d90ad02b7f3c 100644 --- a/AiPlatform/src/V1/resources/model_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/model_service_rest_client_config.php @@ -452,6 +452,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -765,6 +773,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1102,6 +1118,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1451,6 +1475,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1796,6 +1828,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/notebook_service_client_config.json b/AiPlatform/src/V1/resources/notebook_service_client_config.json index 07d9bbb7ed13..a902448d9065 100644 --- a/AiPlatform/src/V1/resources/notebook_service_client_config.json +++ b/AiPlatform/src/V1/resources/notebook_service_client_config.json @@ -61,6 +61,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "UpdateNotebookRuntimeTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "UpgradeNotebookRuntime": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/AiPlatform/src/V1/resources/notebook_service_descriptor_config.php b/AiPlatform/src/V1/resources/notebook_service_descriptor_config.php index 5200333d88ae..005d0f0e10a8 100644 --- a/AiPlatform/src/V1/resources/notebook_service_descriptor_config.php +++ b/AiPlatform/src/V1/resources/notebook_service_descriptor_config.php @@ -201,6 +201,19 @@ ], ], ], + 'UpdateNotebookRuntimeTemplate' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate', + 'headerParams' => [ + [ + 'keyName' => 'notebook_runtime_template.name', + 'fieldAccessors' => [ + 'getNotebookRuntimeTemplate', + 'getName', + ], + ], + ], + ], 'GetLocation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Location\Location', diff --git a/AiPlatform/src/V1/resources/notebook_service_rest_client_config.php b/AiPlatform/src/V1/resources/notebook_service_rest_client_config.php index 4ed3225fe459..7490a3cb06f5 100644 --- a/AiPlatform/src/V1/resources/notebook_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/notebook_service_rest_client_config.php @@ -125,6 +125,22 @@ ], ], ], + 'UpdateNotebookRuntimeTemplate' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{notebook_runtime_template.name=projects/*/locations/*/notebookRuntimeTemplates/*}', + 'body' => 'notebook_runtime_template', + 'placeholders' => [ + 'notebook_runtime_template.name' => [ + 'getters' => [ + 'getNotebookRuntimeTemplate', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], 'UpgradeNotebookRuntime' => [ 'method' => 'post', 'uriTemplate' => '/v1/{name=projects/*/locations/*/notebookRuntimes/*}:upgrade', @@ -355,6 +371,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -668,6 +692,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1005,6 +1037,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1354,6 +1394,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1699,6 +1747,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/persistent_resource_service_rest_client_config.php b/AiPlatform/src/V1/resources/persistent_resource_service_rest_client_config.php index 1ff1bac709d7..9b254ee40626 100644 --- a/AiPlatform/src/V1/resources/persistent_resource_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/persistent_resource_service_rest_client_config.php @@ -317,6 +317,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -630,6 +638,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -967,6 +983,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1316,6 +1340,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1661,6 +1693,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/pipeline_service_rest_client_config.php b/AiPlatform/src/V1/resources/pipeline_service_rest_client_config.php index ecb44727c70f..eaf0d7cb31b8 100644 --- a/AiPlatform/src/V1/resources/pipeline_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/pipeline_service_rest_client_config.php @@ -379,6 +379,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -692,6 +700,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1029,6 +1045,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1378,6 +1402,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1723,6 +1755,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/prediction_service_descriptor_config.php b/AiPlatform/src/V1/resources/prediction_service_descriptor_config.php index 17b7e796d03f..7be0de9ddf83 100644 --- a/AiPlatform/src/V1/resources/prediction_service_descriptor_config.php +++ b/AiPlatform/src/V1/resources/prediction_service_descriptor_config.php @@ -116,6 +116,14 @@ ], 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, 'responseType' => 'Google\Cloud\AIPlatform\V1\StreamDirectPredictResponse', + 'headerParams' => [ + [ + 'keyName' => 'endpoint', + 'fieldAccessors' => [ + 'getEndpoint', + ], + ], + ], ], 'StreamDirectRawPredict' => [ 'grpcStreaming' => [ @@ -123,6 +131,14 @@ ], 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, 'responseType' => 'Google\Cloud\AIPlatform\V1\StreamDirectRawPredictResponse', + 'headerParams' => [ + [ + 'keyName' => 'endpoint', + 'fieldAccessors' => [ + 'getEndpoint', + ], + ], + ], ], 'StreamGenerateContent' => [ 'grpcStreaming' => [ diff --git a/AiPlatform/src/V1/resources/prediction_service_rest_client_config.php b/AiPlatform/src/V1/resources/prediction_service_rest_client_config.php index d2f8ea697d52..3718cf44c880 100644 --- a/AiPlatform/src/V1/resources/prediction_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/prediction_service_rest_client_config.php @@ -27,6 +27,13 @@ 'method' => 'post', 'uriTemplate' => '/v1/{endpoint=projects/*/locations/*/endpoints/*}:directPredict', 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directPredict', + 'body' => '*', + ], + ], 'placeholders' => [ 'endpoint' => [ 'getters' => [ @@ -39,6 +46,13 @@ 'method' => 'post', 'uriTemplate' => '/v1/{endpoint=projects/*/locations/*/endpoints/*}:directRawPredict', 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directRawPredict', + 'body' => '*', + ], + ], 'placeholders' => [ 'endpoint' => [ 'getters' => [ @@ -391,6 +405,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -704,6 +726,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1041,6 +1071,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1390,6 +1428,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1735,6 +1781,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/schedule_service_rest_client_config.php b/AiPlatform/src/V1/resources/schedule_service_rest_client_config.php index d907c2d1c0ae..d616640002de 100644 --- a/AiPlatform/src/V1/resources/schedule_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/schedule_service_rest_client_config.php @@ -326,6 +326,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -639,6 +647,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -976,6 +992,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1325,6 +1349,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1670,6 +1702,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/specialist_pool_service_rest_client_config.php b/AiPlatform/src/V1/resources/specialist_pool_service_rest_client_config.php index c976096ab75e..b8046651c6a4 100644 --- a/AiPlatform/src/V1/resources/specialist_pool_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/specialist_pool_service_rest_client_config.php @@ -302,6 +302,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -615,6 +623,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -952,6 +968,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1301,6 +1325,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1646,6 +1678,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/tensorboard_service_rest_client_config.php b/AiPlatform/src/V1/resources/tensorboard_service_rest_client_config.php index 6a3ac034263c..e318f9261879 100644 --- a/AiPlatform/src/V1/resources/tensorboard_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/tensorboard_service_rest_client_config.php @@ -606,6 +606,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -919,6 +927,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1256,6 +1272,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1605,6 +1629,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1950,6 +1982,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/src/V1/resources/vizier_service_rest_client_config.php b/AiPlatform/src/V1/resources/vizier_service_rest_client_config.php index 024f1623034f..3d30945a397a 100644 --- a/AiPlatform/src/V1/resources/vizier_service_rest_client_config.php +++ b/AiPlatform/src/V1/resources/vizier_service_rest_client_config.php @@ -415,6 +415,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:cancel', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', @@ -728,6 +736,14 @@ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'delete', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1065,6 +1081,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', @@ -1414,6 +1438,14 @@ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*}/operations', 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*}/operations', + ], [ 'method' => 'get', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*}/operations', @@ -1759,6 +1791,14 @@ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/operations/*}:wait', 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + ], [ 'method' => 'post', 'uriTemplate' => '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', diff --git a/AiPlatform/tests/Unit/V1/Client/DatasetServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/DatasetServiceClientTest.php index d87a05c9395d..be5519ca77be 100644 --- a/AiPlatform/tests/Unit/V1/Client/DatasetServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/DatasetServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DatasetServiceClient */ @@ -136,6 +139,7 @@ public function createDatasetTest() $dataItemCount = 2014260376; $etag = 'etag3123477'; $metadataArtifact = 'metadataArtifact2087706850'; + $modelReference = 'modelReference-1502407243'; $expectedResponse = new Dataset(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -144,6 +148,7 @@ public function createDatasetTest() $expectedResponse->setDataItemCount($dataItemCount); $expectedResponse->setEtag($etag); $expectedResponse->setMetadataArtifact($metadataArtifact); + $expectedResponse->setModelReference($modelReference); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -160,9 +165,7 @@ public function createDatasetTest() $dataset->setMetadataSchemaUri($datasetMetadataSchemaUri); $datasetMetadata = new Value(); $dataset->setMetadata($datasetMetadata); - $request = (new CreateDatasetRequest()) - ->setParent($formattedParent) - ->setDataset($dataset); + $request = (new CreateDatasetRequest())->setParent($formattedParent)->setDataset($dataset); $response = $gapicClient->createDataset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -220,12 +223,15 @@ public function createDatasetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -236,9 +242,7 @@ public function createDatasetExceptionTest() $dataset->setMetadataSchemaUri($datasetMetadataSchemaUri); $datasetMetadata = new Value(); $dataset->setMetadata($datasetMetadata); - $request = (new CreateDatasetRequest()) - ->setParent($formattedParent) - ->setDataset($dataset); + $request = (new CreateDatasetRequest())->setParent($formattedParent)->setDataset($dataset); $response = $gapicClient->createDataset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -286,11 +290,13 @@ public function createDatasetVersionTest() $etag = 'etag3123477'; $bigQueryDatasetName = 'bigQueryDatasetName-1230960216'; $displayName = 'displayName1615086568'; + $modelReference = 'modelReference-1502407243'; $expectedResponse = new DatasetVersion(); $expectedResponse->setName($name); $expectedResponse->setEtag($etag); $expectedResponse->setBigQueryDatasetName($bigQueryDatasetName); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelReference($modelReference); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -303,9 +309,7 @@ public function createDatasetVersionTest() $datasetVersion = new DatasetVersion(); $datasetVersionMetadata = new Value(); $datasetVersion->setMetadata($datasetVersionMetadata); - $request = (new CreateDatasetVersionRequest()) - ->setParent($formattedParent) - ->setDatasetVersion($datasetVersion); + $request = (new CreateDatasetVersionRequest())->setParent($formattedParent)->setDatasetVersion($datasetVersion); $response = $gapicClient->createDatasetVersion($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -363,21 +367,22 @@ public function createDatasetVersionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); $datasetVersion = new DatasetVersion(); $datasetVersionMetadata = new Value(); $datasetVersion->setMetadata($datasetVersionMetadata); - $request = (new CreateDatasetVersionRequest()) - ->setParent($formattedParent) - ->setDatasetVersion($datasetVersion); + $request = (new CreateDatasetVersionRequest())->setParent($formattedParent)->setDatasetVersion($datasetVersion); $response = $gapicClient->createDatasetVersion($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -431,8 +436,7 @@ public function deleteDatasetTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new DeleteDatasetRequest()) - ->setName($formattedName); + $request = (new DeleteDatasetRequest())->setName($formattedName); $response = $gapicClient->deleteDataset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -488,17 +492,19 @@ public function deleteDatasetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new DeleteDatasetRequest()) - ->setName($formattedName); + $request = (new DeleteDatasetRequest())->setName($formattedName); $response = $gapicClient->deleteDataset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -552,8 +558,7 @@ public function deleteDatasetVersionTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $request = (new DeleteDatasetVersionRequest()) - ->setName($formattedName); + $request = (new DeleteDatasetVersionRequest())->setName($formattedName); $response = $gapicClient->deleteDatasetVersion($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -609,17 +614,19 @@ public function deleteDatasetVersionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $request = (new DeleteDatasetVersionRequest()) - ->setName($formattedName); + $request = (new DeleteDatasetVersionRequest())->setName($formattedName); $response = $gapicClient->deleteDatasetVersion($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -673,8 +680,7 @@ public function deleteSavedQueryTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->savedQueryName('[PROJECT]', '[LOCATION]', '[DATASET]', '[SAVED_QUERY]'); - $request = (new DeleteSavedQueryRequest()) - ->setName($formattedName); + $request = (new DeleteSavedQueryRequest())->setName($formattedName); $response = $gapicClient->deleteSavedQuery($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -730,17 +736,19 @@ public function deleteSavedQueryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->savedQueryName('[PROJECT]', '[LOCATION]', '[DATASET]', '[SAVED_QUERY]'); - $request = (new DeleteSavedQueryRequest()) - ->setName($formattedName); + $request = (new DeleteSavedQueryRequest())->setName($formattedName); $response = $gapicClient->deleteSavedQuery($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -795,9 +803,7 @@ public function exportDataTest() // Mock request $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); $exportConfig = new ExportDataConfig(); - $request = (new ExportDataRequest()) - ->setName($formattedName) - ->setExportConfig($exportConfig); + $request = (new ExportDataRequest())->setName($formattedName)->setExportConfig($exportConfig); $response = $gapicClient->exportData($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -855,19 +861,20 @@ public function exportDataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); $exportConfig = new ExportDataConfig(); - $request = (new ExportDataRequest()) - ->setName($formattedName) - ->setExportConfig($exportConfig); + $request = (new ExportDataRequest())->setName($formattedName)->setExportConfig($exportConfig); $response = $gapicClient->exportData($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -909,8 +916,7 @@ public function getAnnotationSpecTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->annotationSpecName('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); - $request = (new GetAnnotationSpecRequest()) - ->setName($formattedName); + $request = (new GetAnnotationSpecRequest())->setName($formattedName); $response = $gapicClient->getAnnotationSpec($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -934,17 +940,19 @@ public function getAnnotationSpecExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->annotationSpecName('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); - $request = (new GetAnnotationSpecRequest()) - ->setName($formattedName); + $request = (new GetAnnotationSpecRequest())->setName($formattedName); try { $gapicClient->getAnnotationSpec($request); // If the $gapicClient method call did not throw, fail the test @@ -974,6 +982,7 @@ public function getDatasetTest() $dataItemCount = 2014260376; $etag = 'etag3123477'; $metadataArtifact = 'metadataArtifact2087706850'; + $modelReference = 'modelReference-1502407243'; $expectedResponse = new Dataset(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); @@ -982,11 +991,11 @@ public function getDatasetTest() $expectedResponse->setDataItemCount($dataItemCount); $expectedResponse->setEtag($etag); $expectedResponse->setMetadataArtifact($metadataArtifact); + $expectedResponse->setModelReference($modelReference); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new GetDatasetRequest()) - ->setName($formattedName); + $request = (new GetDatasetRequest())->setName($formattedName); $response = $gapicClient->getDataset($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1010,17 +1019,19 @@ public function getDatasetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new GetDatasetRequest()) - ->setName($formattedName); + $request = (new GetDatasetRequest())->setName($formattedName); try { $gapicClient->getDataset($request); // If the $gapicClient method call did not throw, fail the test @@ -1047,16 +1058,17 @@ public function getDatasetVersionTest() $etag = 'etag3123477'; $bigQueryDatasetName = 'bigQueryDatasetName-1230960216'; $displayName = 'displayName1615086568'; + $modelReference = 'modelReference-1502407243'; $expectedResponse = new DatasetVersion(); $expectedResponse->setName($name2); $expectedResponse->setEtag($etag); $expectedResponse->setBigQueryDatasetName($bigQueryDatasetName); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelReference($modelReference); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $request = (new GetDatasetVersionRequest()) - ->setName($formattedName); + $request = (new GetDatasetVersionRequest())->setName($formattedName); $response = $gapicClient->getDatasetVersion($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1080,17 +1092,19 @@ public function getDatasetVersionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $request = (new GetDatasetVersionRequest()) - ->setName($formattedName); + $request = (new GetDatasetVersionRequest())->setName($formattedName); try { $gapicClient->getDatasetVersion($request); // If the $gapicClient method call did not throw, fail the test @@ -1136,9 +1150,7 @@ public function importDataTest() // Mock request $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); $importConfigs = []; - $request = (new ImportDataRequest()) - ->setName($formattedName) - ->setImportConfigs($importConfigs); + $request = (new ImportDataRequest())->setName($formattedName)->setImportConfigs($importConfigs); $response = $gapicClient->importData($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1196,19 +1208,20 @@ public function importDataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); $importConfigs = []; - $request = (new ImportDataRequest()) - ->setName($formattedName) - ->setImportConfigs($importConfigs); + $request = (new ImportDataRequest())->setName($formattedName)->setImportConfigs($importConfigs); $response = $gapicClient->importData($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1242,17 +1255,14 @@ public function listAnnotationsTest() // Mock response $nextPageToken = ''; $annotationsElement = new Annotation(); - $annotations = [ - $annotationsElement, - ]; + $annotations = [$annotationsElement]; $expectedResponse = new ListAnnotationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAnnotations($annotations); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->dataItemName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATA_ITEM]'); - $request = (new ListAnnotationsRequest()) - ->setParent($formattedParent); + $request = (new ListAnnotationsRequest())->setParent($formattedParent); $response = $gapicClient->listAnnotations($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1279,17 +1289,19 @@ public function listAnnotationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->dataItemName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATA_ITEM]'); - $request = (new ListAnnotationsRequest()) - ->setParent($formattedParent); + $request = (new ListAnnotationsRequest())->setParent($formattedParent); try { $gapicClient->listAnnotations($request); // If the $gapicClient method call did not throw, fail the test @@ -1314,17 +1326,14 @@ public function listDataItemsTest() // Mock response $nextPageToken = ''; $dataItemsElement = new DataItem(); - $dataItems = [ - $dataItemsElement, - ]; + $dataItems = [$dataItemsElement]; $expectedResponse = new ListDataItemsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDataItems($dataItems); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new ListDataItemsRequest()) - ->setParent($formattedParent); + $request = (new ListDataItemsRequest())->setParent($formattedParent); $response = $gapicClient->listDataItems($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1351,17 +1360,19 @@ public function listDataItemsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new ListDataItemsRequest()) - ->setParent($formattedParent); + $request = (new ListDataItemsRequest())->setParent($formattedParent); try { $gapicClient->listDataItems($request); // If the $gapicClient method call did not throw, fail the test @@ -1386,17 +1397,14 @@ public function listDatasetVersionsTest() // Mock response $nextPageToken = ''; $datasetVersionsElement = new DatasetVersion(); - $datasetVersions = [ - $datasetVersionsElement, - ]; + $datasetVersions = [$datasetVersionsElement]; $expectedResponse = new ListDatasetVersionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDatasetVersions($datasetVersions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new ListDatasetVersionsRequest()) - ->setParent($formattedParent); + $request = (new ListDatasetVersionsRequest())->setParent($formattedParent); $response = $gapicClient->listDatasetVersions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1423,17 +1431,19 @@ public function listDatasetVersionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new ListDatasetVersionsRequest()) - ->setParent($formattedParent); + $request = (new ListDatasetVersionsRequest())->setParent($formattedParent); try { $gapicClient->listDatasetVersions($request); // If the $gapicClient method call did not throw, fail the test @@ -1458,17 +1468,14 @@ public function listDatasetsTest() // Mock response $nextPageToken = ''; $datasetsElement = new Dataset(); - $datasets = [ - $datasetsElement, - ]; + $datasets = [$datasetsElement]; $expectedResponse = new ListDatasetsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDatasets($datasets); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDatasetsRequest()) - ->setParent($formattedParent); + $request = (new ListDatasetsRequest())->setParent($formattedParent); $response = $gapicClient->listDatasets($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1495,17 +1502,19 @@ public function listDatasetsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDatasetsRequest()) - ->setParent($formattedParent); + $request = (new ListDatasetsRequest())->setParent($formattedParent); try { $gapicClient->listDatasets($request); // If the $gapicClient method call did not throw, fail the test @@ -1530,17 +1539,14 @@ public function listSavedQueriesTest() // Mock response $nextPageToken = ''; $savedQueriesElement = new SavedQuery(); - $savedQueries = [ - $savedQueriesElement, - ]; + $savedQueries = [$savedQueriesElement]; $expectedResponse = new ListSavedQueriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSavedQueries($savedQueries); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new ListSavedQueriesRequest()) - ->setParent($formattedParent); + $request = (new ListSavedQueriesRequest())->setParent($formattedParent); $response = $gapicClient->listSavedQueries($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1567,17 +1573,19 @@ public function listSavedQueriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new ListSavedQueriesRequest()) - ->setParent($formattedParent); + $request = (new ListSavedQueriesRequest())->setParent($formattedParent); try { $gapicClient->listSavedQueries($request); // If the $gapicClient method call did not throw, fail the test @@ -1616,11 +1624,13 @@ public function restoreDatasetVersionTest() $etag = 'etag3123477'; $bigQueryDatasetName = 'bigQueryDatasetName-1230960216'; $displayName = 'displayName1615086568'; + $modelReference = 'modelReference-1502407243'; $expectedResponse = new DatasetVersion(); $expectedResponse->setName($name2); $expectedResponse->setEtag($etag); $expectedResponse->setBigQueryDatasetName($bigQueryDatasetName); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelReference($modelReference); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -1630,8 +1640,7 @@ public function restoreDatasetVersionTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $request = (new RestoreDatasetVersionRequest()) - ->setName($formattedName); + $request = (new RestoreDatasetVersionRequest())->setName($formattedName); $response = $gapicClient->restoreDatasetVersion($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1687,17 +1696,19 @@ public function restoreDatasetVersionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $request = (new RestoreDatasetVersionRequest()) - ->setName($formattedName); + $request = (new RestoreDatasetVersionRequest())->setName($formattedName); $response = $gapicClient->restoreDatasetVersion($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1731,17 +1742,14 @@ public function searchDataItemsTest() // Mock response $nextPageToken = ''; $dataItemViewsElement = new DataItemView(); - $dataItemViews = [ - $dataItemViewsElement, - ]; + $dataItemViews = [$dataItemViewsElement]; $expectedResponse = new SearchDataItemsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDataItemViews($dataItemViews); $transport->addResponse($expectedResponse); // Mock request $formattedDataset = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new SearchDataItemsRequest()) - ->setDataset($formattedDataset); + $request = (new SearchDataItemsRequest())->setDataset($formattedDataset); $response = $gapicClient->searchDataItems($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1768,17 +1776,19 @@ public function searchDataItemsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedDataset = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $request = (new SearchDataItemsRequest()) - ->setDataset($formattedDataset); + $request = (new SearchDataItemsRequest())->setDataset($formattedDataset); try { $gapicClient->searchDataItems($request); // If the $gapicClient method call did not throw, fail the test @@ -1808,6 +1818,7 @@ public function updateDatasetTest() $dataItemCount = 2014260376; $etag = 'etag3123477'; $metadataArtifact = 'metadataArtifact2087706850'; + $modelReference = 'modelReference-1502407243'; $expectedResponse = new Dataset(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -1816,6 +1827,7 @@ public function updateDatasetTest() $expectedResponse->setDataItemCount($dataItemCount); $expectedResponse->setEtag($etag); $expectedResponse->setMetadataArtifact($metadataArtifact); + $expectedResponse->setModelReference($modelReference); $transport->addResponse($expectedResponse); // Mock request $dataset = new Dataset(); @@ -1826,9 +1838,7 @@ public function updateDatasetTest() $datasetMetadata = new Value(); $dataset->setMetadata($datasetMetadata); $updateMask = new FieldMask(); - $request = (new UpdateDatasetRequest()) - ->setDataset($dataset) - ->setUpdateMask($updateMask); + $request = (new UpdateDatasetRequest())->setDataset($dataset)->setUpdateMask($updateMask); $response = $gapicClient->updateDataset($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1854,12 +1864,15 @@ public function updateDatasetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $dataset = new Dataset(); @@ -1870,9 +1883,7 @@ public function updateDatasetExceptionTest() $datasetMetadata = new Value(); $dataset->setMetadata($datasetMetadata); $updateMask = new FieldMask(); - $request = (new UpdateDatasetRequest()) - ->setDataset($dataset) - ->setUpdateMask($updateMask); + $request = (new UpdateDatasetRequest())->setDataset($dataset)->setUpdateMask($updateMask); try { $gapicClient->updateDataset($request); // If the $gapicClient method call did not throw, fail the test @@ -1886,6 +1897,87 @@ public function updateDatasetExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateDatasetVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $bigQueryDatasetName = 'bigQueryDatasetName-1230960216'; + $displayName = 'displayName1615086568'; + $modelReference = 'modelReference-1502407243'; + $expectedResponse = new DatasetVersion(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setBigQueryDatasetName($bigQueryDatasetName); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setModelReference($modelReference); + $transport->addResponse($expectedResponse); + // Mock request + $datasetVersion = new DatasetVersion(); + $datasetVersionMetadata = new Value(); + $datasetVersion->setMetadata($datasetVersionMetadata); + $updateMask = new FieldMask(); + $request = (new UpdateDatasetVersionRequest())->setDatasetVersion($datasetVersion)->setUpdateMask($updateMask); + $response = $gapicClient->updateDatasetVersion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/UpdateDatasetVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getDatasetVersion(); + $this->assertProtobufEquals($datasetVersion, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDatasetVersionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $datasetVersion = new DatasetVersion(); + $datasetVersionMetadata = new Value(); + $datasetVersion->setMetadata($datasetVersionMetadata); + $updateMask = new FieldMask(); + $request = (new UpdateDatasetVersionRequest())->setDatasetVersion($datasetVersion)->setUpdateMask($updateMask); + try { + $gapicClient->updateDatasetVersion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getLocationTest() { @@ -1925,12 +2017,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1957,9 +2052,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1989,12 +2082,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -2027,8 +2123,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2052,17 +2147,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2094,9 +2191,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2122,19 +2217,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2162,9 +2258,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2190,19 +2284,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2244,6 +2339,7 @@ public function createDatasetAsyncTest() $dataItemCount = 2014260376; $etag = 'etag3123477'; $metadataArtifact = 'metadataArtifact2087706850'; + $modelReference = 'modelReference-1502407243'; $expectedResponse = new Dataset(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -2252,6 +2348,7 @@ public function createDatasetAsyncTest() $expectedResponse->setDataItemCount($dataItemCount); $expectedResponse->setEtag($etag); $expectedResponse->setMetadataArtifact($metadataArtifact); + $expectedResponse->setModelReference($modelReference); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -2268,9 +2365,7 @@ public function createDatasetAsyncTest() $dataset->setMetadataSchemaUri($datasetMetadataSchemaUri); $datasetMetadata = new Value(); $dataset->setMetadata($datasetMetadata); - $request = (new CreateDatasetRequest()) - ->setParent($formattedParent) - ->setDataset($dataset); + $request = (new CreateDatasetRequest())->setParent($formattedParent)->setDataset($dataset); $response = $gapicClient->createDatasetAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/AiPlatform/tests/Unit/V1/Client/DeploymentResourcePoolServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/DeploymentResourcePoolServiceClientTest.php index 91b1272065c9..aef6679cf8df 100644 --- a/AiPlatform/tests/Unit/V1/Client/DeploymentResourcePoolServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/DeploymentResourcePoolServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DeploymentResourcePoolServiceClient */ @@ -105,8 +107,12 @@ public function createDeploymentResourcePoolTest() $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $name = 'name3373707'; + $serviceAccount = 'serviceAccount-1948028253'; + $disableContainerLogging = true; $expectedResponse = new DeploymentResourcePool(); $expectedResponse->setName($name); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setDisableContainerLogging($disableContainerLogging); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -137,7 +143,10 @@ public function createDeploymentResourcePoolTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/CreateDeploymentResourcePool', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.DeploymentResourcePoolService/CreateDeploymentResourcePool', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getDeploymentResourcePool(); @@ -187,12 +196,15 @@ public function createDeploymentResourcePoolExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -260,9 +272,12 @@ public function deleteDeploymentResourcePoolTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - $request = (new DeleteDeploymentResourcePoolRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->deploymentResourcePoolName( + '[PROJECT]', + '[LOCATION]', + '[DEPLOYMENT_RESOURCE_POOL]' + ); + $request = (new DeleteDeploymentResourcePoolRequest())->setName($formattedName); $response = $gapicClient->deleteDeploymentResourcePool($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -272,7 +287,10 @@ public function deleteDeploymentResourcePoolTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/DeleteDeploymentResourcePool', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.DeploymentResourcePoolService/DeleteDeploymentResourcePool', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -318,17 +336,23 @@ public function deleteDeploymentResourcePoolExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - $request = (new DeleteDeploymentResourcePoolRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->deploymentResourcePoolName( + '[PROJECT]', + '[LOCATION]', + '[DEPLOYMENT_RESOURCE_POOL]' + ); + $request = (new DeleteDeploymentResourcePoolRequest())->setName($formattedName); $response = $gapicClient->deleteDeploymentResourcePool($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -361,20 +385,30 @@ public function getDeploymentResourcePoolTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; + $serviceAccount = 'serviceAccount-1948028253'; + $disableContainerLogging = true; $expectedResponse = new DeploymentResourcePool(); $expectedResponse->setName($name2); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setDisableContainerLogging($disableContainerLogging); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - $request = (new GetDeploymentResourcePoolRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->deploymentResourcePoolName( + '[PROJECT]', + '[LOCATION]', + '[DEPLOYMENT_RESOURCE_POOL]' + ); + $request = (new GetDeploymentResourcePoolRequest())->setName($formattedName); $response = $gapicClient->getDeploymentResourcePool($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/GetDeploymentResourcePool', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.DeploymentResourcePoolService/GetDeploymentResourcePool', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -391,17 +425,23 @@ public function getDeploymentResourcePoolExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - $request = (new GetDeploymentResourcePoolRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->deploymentResourcePoolName( + '[PROJECT]', + '[LOCATION]', + '[DEPLOYMENT_RESOURCE_POOL]' + ); + $request = (new GetDeploymentResourcePoolRequest())->setName($formattedName); try { $gapicClient->getDeploymentResourcePool($request); // If the $gapicClient method call did not throw, fail the test @@ -426,17 +466,14 @@ public function listDeploymentResourcePoolsTest() // Mock response $nextPageToken = ''; $deploymentResourcePoolsElement = new DeploymentResourcePool(); - $deploymentResourcePools = [ - $deploymentResourcePoolsElement, - ]; + $deploymentResourcePools = [$deploymentResourcePoolsElement]; $expectedResponse = new ListDeploymentResourcePoolsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDeploymentResourcePools($deploymentResourcePools); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListDeploymentResourcePoolsRequest()) - ->setParent($formattedParent); + $request = (new ListDeploymentResourcePoolsRequest())->setParent($formattedParent); $response = $gapicClient->listDeploymentResourcePools($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -446,7 +483,10 @@ public function listDeploymentResourcePoolsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/ListDeploymentResourcePools', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.DeploymentResourcePoolService/ListDeploymentResourcePools', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -463,17 +503,19 @@ public function listDeploymentResourcePoolsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListDeploymentResourcePoolsRequest()) - ->setParent($formattedParent); + $request = (new ListDeploymentResourcePoolsRequest())->setParent($formattedParent); try { $gapicClient->listDeploymentResourcePools($request); // If the $gapicClient method call did not throw, fail the test @@ -500,9 +542,7 @@ public function queryDeployedModelsTest() $totalDeployedModelCount = 591684507; $totalEndpointCount = 61124672; $deployedModelsElement = new DeployedModel(); - $deployedModels = [ - $deployedModelsElement, - ]; + $deployedModels = [$deployedModelsElement]; $expectedResponse = new QueryDeployedModelsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTotalDeployedModelCount($totalDeployedModelCount); @@ -511,8 +551,7 @@ public function queryDeployedModelsTest() $transport->addResponse($expectedResponse); // Mock request $deploymentResourcePool = 'deploymentResourcePool-1160399437'; - $request = (new QueryDeployedModelsRequest()) - ->setDeploymentResourcePool($deploymentResourcePool); + $request = (new QueryDeployedModelsRequest())->setDeploymentResourcePool($deploymentResourcePool); $response = $gapicClient->queryDeployedModels($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -522,7 +561,10 @@ public function queryDeployedModelsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/QueryDeployedModels', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.DeploymentResourcePoolService/QueryDeployedModels', + $actualFuncCall + ); $actualValue = $actualRequestObject->getDeploymentResourcePool(); $this->assertProtobufEquals($deploymentResourcePool, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -539,17 +581,19 @@ public function queryDeployedModelsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $deploymentResourcePool = 'deploymentResourcePool-1160399437'; - $request = (new QueryDeployedModelsRequest()) - ->setDeploymentResourcePool($deploymentResourcePool); + $request = (new QueryDeployedModelsRequest())->setDeploymentResourcePool($deploymentResourcePool); try { $gapicClient->queryDeployedModels($request); // If the $gapicClient method call did not throw, fail the test @@ -602,12 +646,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -634,9 +681,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -666,12 +711,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -704,8 +752,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -729,17 +776,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -771,9 +820,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -799,19 +846,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -839,9 +887,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -867,19 +913,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -915,8 +962,12 @@ public function createDeploymentResourcePoolAsyncTest() $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $name = 'name3373707'; + $serviceAccount = 'serviceAccount-1948028253'; + $disableContainerLogging = true; $expectedResponse = new DeploymentResourcePool(); $expectedResponse->setName($name); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setDisableContainerLogging($disableContainerLogging); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -947,7 +998,10 @@ public function createDeploymentResourcePoolAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/CreateDeploymentResourcePool', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.DeploymentResourcePoolService/CreateDeploymentResourcePool', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getDeploymentResourcePool(); diff --git a/AiPlatform/tests/Unit/V1/Client/EndpointServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/EndpointServiceClientTest.php index 13dc011c7c3a..b523ec2af791 100644 --- a/AiPlatform/tests/Unit/V1/Client/EndpointServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/EndpointServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return EndpointServiceClient */ @@ -135,9 +137,7 @@ public function createEndpointTest() $endpoint = new Endpoint(); $endpointDisplayName = 'endpointDisplayName697270680'; $endpoint->setDisplayName($endpointDisplayName); - $request = (new CreateEndpointRequest()) - ->setParent($formattedParent) - ->setEndpoint($endpoint); + $request = (new CreateEndpointRequest())->setParent($formattedParent)->setEndpoint($endpoint); $response = $gapicClient->createEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -195,21 +195,22 @@ public function createEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $endpoint = new Endpoint(); $endpointDisplayName = 'endpointDisplayName697270680'; $endpoint->setDisplayName($endpointDisplayName); - $request = (new CreateEndpointRequest()) - ->setParent($formattedParent) - ->setEndpoint($endpoint); + $request = (new CreateEndpointRequest())->setParent($formattedParent)->setEndpoint($endpoint); $response = $gapicClient->createEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -263,8 +264,7 @@ public function deleteEndpointTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new DeleteEndpointRequest()) - ->setName($formattedName); + $request = (new DeleteEndpointRequest())->setName($formattedName); $response = $gapicClient->deleteEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -320,17 +320,19 @@ public function deleteEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new DeleteEndpointRequest()) - ->setName($formattedName); + $request = (new DeleteEndpointRequest())->setName($formattedName); $response = $gapicClient->deleteEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -387,9 +389,7 @@ public function deployModelTest() $deployedModel = new DeployedModel(); $deployedModelModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); $deployedModel->setModel($deployedModelModel); - $request = (new DeployModelRequest()) - ->setEndpoint($formattedEndpoint) - ->setDeployedModel($deployedModel); + $request = (new DeployModelRequest())->setEndpoint($formattedEndpoint)->setDeployedModel($deployedModel); $response = $gapicClient->deployModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -447,21 +447,22 @@ public function deployModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $deployedModel = new DeployedModel(); $deployedModelModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); $deployedModel->setModel($deployedModelModel); - $request = (new DeployModelRequest()) - ->setEndpoint($formattedEndpoint) - ->setDeployedModel($deployedModel); + $request = (new DeployModelRequest())->setEndpoint($formattedEndpoint)->setDeployedModel($deployedModel); $response = $gapicClient->deployModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -511,8 +512,7 @@ public function getEndpointTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new GetEndpointRequest()) - ->setName($formattedName); + $request = (new GetEndpointRequest())->setName($formattedName); $response = $gapicClient->getEndpoint($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -536,17 +536,19 @@ public function getEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new GetEndpointRequest()) - ->setName($formattedName); + $request = (new GetEndpointRequest())->setName($formattedName); try { $gapicClient->getEndpoint($request); // If the $gapicClient method call did not throw, fail the test @@ -571,17 +573,14 @@ public function listEndpointsTest() // Mock response $nextPageToken = ''; $endpointsElement = new Endpoint(); - $endpoints = [ - $endpointsElement, - ]; + $endpoints = [$endpointsElement]; $expectedResponse = new ListEndpointsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setEndpoints($endpoints); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEndpointsRequest()) - ->setParent($formattedParent); + $request = (new ListEndpointsRequest())->setParent($formattedParent); $response = $gapicClient->listEndpoints($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -608,17 +607,19 @@ public function listEndpointsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEndpointsRequest()) - ->setParent($formattedParent); + $request = (new ListEndpointsRequest())->setParent($formattedParent); try { $gapicClient->listEndpoints($request); // If the $gapicClient method call did not throw, fail the test @@ -730,12 +731,15 @@ public function mutateDeployedModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); @@ -801,9 +805,7 @@ public function undeployModelTest() // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $deployedModelId = 'deployedModelId866642506'; - $request = (new UndeployModelRequest()) - ->setEndpoint($formattedEndpoint) - ->setDeployedModelId($deployedModelId); + $request = (new UndeployModelRequest())->setEndpoint($formattedEndpoint)->setDeployedModelId($deployedModelId); $response = $gapicClient->undeployModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -861,19 +863,20 @@ public function undeployModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $deployedModelId = 'deployedModelId866642506'; - $request = (new UndeployModelRequest()) - ->setEndpoint($formattedEndpoint) - ->setDeployedModelId($deployedModelId); + $request = (new UndeployModelRequest())->setEndpoint($formattedEndpoint)->setDeployedModelId($deployedModelId); $response = $gapicClient->undeployModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -926,9 +929,7 @@ public function updateEndpointTest() $endpointDisplayName = 'endpointDisplayName697270680'; $endpoint->setDisplayName($endpointDisplayName); $updateMask = new FieldMask(); - $request = (new UpdateEndpointRequest()) - ->setEndpoint($endpoint) - ->setUpdateMask($updateMask); + $request = (new UpdateEndpointRequest())->setEndpoint($endpoint)->setUpdateMask($updateMask); $response = $gapicClient->updateEndpoint($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -954,21 +955,22 @@ public function updateEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $endpoint = new Endpoint(); $endpointDisplayName = 'endpointDisplayName697270680'; $endpoint->setDisplayName($endpointDisplayName); $updateMask = new FieldMask(); - $request = (new UpdateEndpointRequest()) - ->setEndpoint($endpoint) - ->setUpdateMask($updateMask); + $request = (new UpdateEndpointRequest())->setEndpoint($endpoint)->setUpdateMask($updateMask); try { $gapicClient->updateEndpoint($request); // If the $gapicClient method call did not throw, fail the test @@ -1021,12 +1023,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1053,9 +1058,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1085,12 +1088,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1123,8 +1129,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1148,17 +1153,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1190,9 +1197,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1218,19 +1223,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1258,9 +1264,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1286,19 +1290,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1360,9 +1365,7 @@ public function createEndpointAsyncTest() $endpoint = new Endpoint(); $endpointDisplayName = 'endpointDisplayName697270680'; $endpoint->setDisplayName($endpointDisplayName); - $request = (new CreateEndpointRequest()) - ->setParent($formattedParent) - ->setEndpoint($endpoint); + $request = (new CreateEndpointRequest())->setParent($formattedParent)->setEndpoint($endpoint); $response = $gapicClient->createEndpointAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/AiPlatform/tests/Unit/V1/Client/FeatureOnlineStoreAdminServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/FeatureOnlineStoreAdminServiceClientTest.php index 79f1b8535a4d..5deaef9daef6 100644 --- a/AiPlatform/tests/Unit/V1/Client/FeatureOnlineStoreAdminServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/FeatureOnlineStoreAdminServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return FeatureOnlineStoreAdminServiceClient */ @@ -142,7 +144,10 @@ public function createFeatureOnlineStoreTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/CreateFeatureOnlineStore', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/CreateFeatureOnlineStore', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getFeatureOnlineStore(); @@ -192,12 +197,15 @@ public function createFeatureOnlineStoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -279,7 +287,10 @@ public function createFeatureViewTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/CreateFeatureView', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/CreateFeatureView', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getFeatureView(); @@ -329,12 +340,15 @@ public function createFeatureViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); @@ -397,8 +411,7 @@ public function deleteFeatureOnlineStoreTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $request = (new DeleteFeatureOnlineStoreRequest()) - ->setName($formattedName); + $request = (new DeleteFeatureOnlineStoreRequest())->setName($formattedName); $response = $gapicClient->deleteFeatureOnlineStore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -408,7 +421,10 @@ public function deleteFeatureOnlineStoreTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/DeleteFeatureOnlineStore', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/DeleteFeatureOnlineStore', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -454,17 +470,19 @@ public function deleteFeatureOnlineStoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $request = (new DeleteFeatureOnlineStoreRequest()) - ->setName($formattedName); + $request = (new DeleteFeatureOnlineStoreRequest())->setName($formattedName); $response = $gapicClient->deleteFeatureOnlineStore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -517,9 +535,13 @@ public function deleteFeatureViewTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new DeleteFeatureViewRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new DeleteFeatureViewRequest())->setName($formattedName); $response = $gapicClient->deleteFeatureView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -529,7 +551,10 @@ public function deleteFeatureViewTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/DeleteFeatureView', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/DeleteFeatureView', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -575,17 +600,24 @@ public function deleteFeatureViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new DeleteFeatureViewRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new DeleteFeatureViewRequest())->setName($formattedName); $response = $gapicClient->deleteFeatureView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -625,15 +657,17 @@ public function getFeatureOnlineStoreTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $request = (new GetFeatureOnlineStoreRequest()) - ->setName($formattedName); + $request = (new GetFeatureOnlineStoreRequest())->setName($formattedName); $response = $gapicClient->getFeatureOnlineStore($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/GetFeatureOnlineStore', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/GetFeatureOnlineStore', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -650,17 +684,19 @@ public function getFeatureOnlineStoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $request = (new GetFeatureOnlineStoreRequest()) - ->setName($formattedName); + $request = (new GetFeatureOnlineStoreRequest())->setName($formattedName); try { $gapicClient->getFeatureOnlineStore($request); // If the $gapicClient method call did not throw, fail the test @@ -690,9 +726,13 @@ public function getFeatureViewTest() $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new GetFeatureViewRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new GetFeatureViewRequest())->setName($formattedName); $response = $gapicClient->getFeatureView($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -716,17 +756,24 @@ public function getFeatureViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new GetFeatureViewRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new GetFeatureViewRequest())->setName($formattedName); try { $gapicClient->getFeatureView($request); // If the $gapicClient method call did not throw, fail the test @@ -754,16 +801,23 @@ public function getFeatureViewSyncTest() $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->featureViewSyncName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new GetFeatureViewSyncRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureViewSyncName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new GetFeatureViewSyncRequest())->setName($formattedName); $response = $gapicClient->getFeatureViewSync($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/GetFeatureViewSync', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/GetFeatureViewSync', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -780,17 +834,24 @@ public function getFeatureViewSyncExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->featureViewSyncName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new GetFeatureViewSyncRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureViewSyncName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new GetFeatureViewSyncRequest())->setName($formattedName); try { $gapicClient->getFeatureViewSync($request); // If the $gapicClient method call did not throw, fail the test @@ -815,17 +876,14 @@ public function listFeatureOnlineStoresTest() // Mock response $nextPageToken = ''; $featureOnlineStoresElement = new FeatureOnlineStore(); - $featureOnlineStores = [ - $featureOnlineStoresElement, - ]; + $featureOnlineStores = [$featureOnlineStoresElement]; $expectedResponse = new ListFeatureOnlineStoresResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFeatureOnlineStores($featureOnlineStores); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFeatureOnlineStoresRequest()) - ->setParent($formattedParent); + $request = (new ListFeatureOnlineStoresRequest())->setParent($formattedParent); $response = $gapicClient->listFeatureOnlineStores($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -835,7 +893,10 @@ public function listFeatureOnlineStoresTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/ListFeatureOnlineStores', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/ListFeatureOnlineStores', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -852,17 +913,19 @@ public function listFeatureOnlineStoresExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFeatureOnlineStoresRequest()) - ->setParent($formattedParent); + $request = (new ListFeatureOnlineStoresRequest())->setParent($formattedParent); try { $gapicClient->listFeatureOnlineStores($request); // If the $gapicClient method call did not throw, fail the test @@ -887,17 +950,19 @@ public function listFeatureViewSyncsTest() // Mock response $nextPageToken = ''; $featureViewSyncsElement = new FeatureViewSync(); - $featureViewSyncs = [ - $featureViewSyncsElement, - ]; + $featureViewSyncs = [$featureViewSyncsElement]; $expectedResponse = new ListFeatureViewSyncsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFeatureViewSyncs($featureViewSyncs); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new ListFeatureViewSyncsRequest()) - ->setParent($formattedParent); + $formattedParent = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new ListFeatureViewSyncsRequest())->setParent($formattedParent); $response = $gapicClient->listFeatureViewSyncs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -907,7 +972,10 @@ public function listFeatureViewSyncsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/ListFeatureViewSyncs', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/ListFeatureViewSyncs', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -924,17 +992,24 @@ public function listFeatureViewSyncsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new ListFeatureViewSyncsRequest()) - ->setParent($formattedParent); + $formattedParent = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new ListFeatureViewSyncsRequest())->setParent($formattedParent); try { $gapicClient->listFeatureViewSyncs($request); // If the $gapicClient method call did not throw, fail the test @@ -959,17 +1034,14 @@ public function listFeatureViewsTest() // Mock response $nextPageToken = ''; $featureViewsElement = new FeatureView(); - $featureViews = [ - $featureViewsElement, - ]; + $featureViews = [$featureViewsElement]; $expectedResponse = new ListFeatureViewsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFeatureViews($featureViews); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $request = (new ListFeatureViewsRequest()) - ->setParent($formattedParent); + $request = (new ListFeatureViewsRequest())->setParent($formattedParent); $response = $gapicClient->listFeatureViews($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -979,7 +1051,10 @@ public function listFeatureViewsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/ListFeatureViews', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/ListFeatureViews', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -996,17 +1071,19 @@ public function listFeatureViewsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $request = (new ListFeatureViewsRequest()) - ->setParent($formattedParent); + $request = (new ListFeatureViewsRequest())->setParent($formattedParent); try { $gapicClient->listFeatureViews($request); // If the $gapicClient method call did not throw, fail the test @@ -1034,16 +1111,23 @@ public function syncFeatureViewTest() $expectedResponse->setFeatureViewSync($featureViewSync); $transport->addResponse($expectedResponse); // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new SyncFeatureViewRequest()) - ->setFeatureView($formattedFeatureView); + $formattedFeatureView = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new SyncFeatureViewRequest())->setFeatureView($formattedFeatureView); $response = $gapicClient->syncFeatureView($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/SyncFeatureView', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/SyncFeatureView', + $actualFuncCall + ); $actualValue = $actualRequestObject->getFeatureView(); $this->assertProtobufEquals($formattedFeatureView, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -1060,17 +1144,24 @@ public function syncFeatureViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new SyncFeatureViewRequest()) - ->setFeatureView($formattedFeatureView); + $formattedFeatureView = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new SyncFeatureViewRequest())->setFeatureView($formattedFeatureView); try { $gapicClient->syncFeatureView($request); // If the $gapicClient method call did not throw, fail the test @@ -1119,8 +1210,7 @@ public function updateFeatureOnlineStoreTest() $operationsTransport->addResponse($completeOperation); // Mock request $featureOnlineStore = new FeatureOnlineStore(); - $request = (new UpdateFeatureOnlineStoreRequest()) - ->setFeatureOnlineStore($featureOnlineStore); + $request = (new UpdateFeatureOnlineStoreRequest())->setFeatureOnlineStore($featureOnlineStore); $response = $gapicClient->updateFeatureOnlineStore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1130,7 +1220,10 @@ public function updateFeatureOnlineStoreTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/UpdateFeatureOnlineStore', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/UpdateFeatureOnlineStore', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getFeatureOnlineStore(); $this->assertProtobufEquals($featureOnlineStore, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -1176,17 +1269,19 @@ public function updateFeatureOnlineStoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $featureOnlineStore = new FeatureOnlineStore(); - $request = (new UpdateFeatureOnlineStoreRequest()) - ->setFeatureOnlineStore($featureOnlineStore); + $request = (new UpdateFeatureOnlineStoreRequest())->setFeatureOnlineStore($featureOnlineStore); $response = $gapicClient->updateFeatureOnlineStore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1244,8 +1339,7 @@ public function updateFeatureViewTest() $operationsTransport->addResponse($completeOperation); // Mock request $featureView = new FeatureView(); - $request = (new UpdateFeatureViewRequest()) - ->setFeatureView($featureView); + $request = (new UpdateFeatureViewRequest())->setFeatureView($featureView); $response = $gapicClient->updateFeatureView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1255,7 +1349,10 @@ public function updateFeatureViewTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/UpdateFeatureView', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/UpdateFeatureView', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getFeatureView(); $this->assertProtobufEquals($featureView, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -1301,17 +1398,19 @@ public function updateFeatureViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $featureView = new FeatureView(); - $request = (new UpdateFeatureViewRequest()) - ->setFeatureView($featureView); + $request = (new UpdateFeatureViewRequest())->setFeatureView($featureView); $response = $gapicClient->updateFeatureView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1373,12 +1472,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1405,9 +1507,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1437,12 +1537,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1475,8 +1578,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1500,17 +1602,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1542,9 +1646,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1570,19 +1672,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1610,9 +1713,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1638,19 +1739,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1714,7 +1816,10 @@ public function createFeatureOnlineStoreAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/CreateFeatureOnlineStore', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/CreateFeatureOnlineStore', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getFeatureOnlineStore(); diff --git a/AiPlatform/tests/Unit/V1/Client/FeatureOnlineStoreServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/FeatureOnlineStoreServiceClientTest.php index 466b19079c5a..bdfe7d0f5efa 100644 --- a/AiPlatform/tests/Unit/V1/Client/FeatureOnlineStoreServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/FeatureOnlineStoreServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return FeatureOnlineStoreServiceClient */ @@ -84,9 +86,13 @@ public function fetchFeatureValuesTest() $expectedResponse = new FetchFeatureValuesResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new FetchFeatureValuesRequest()) - ->setFeatureView($formattedFeatureView); + $formattedFeatureView = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new FetchFeatureValuesRequest())->setFeatureView($formattedFeatureView); $response = $gapicClient->fetchFeatureValues($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -110,17 +116,24 @@ public function fetchFeatureValuesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new FetchFeatureValuesRequest()) - ->setFeatureView($formattedFeatureView); + $formattedFeatureView = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new FetchFeatureValuesRequest())->setFeatureView($formattedFeatureView); try { $gapicClient->fetchFeatureValues($request); // If the $gapicClient method call did not throw, fail the test @@ -146,18 +159,24 @@ public function searchNearestEntitiesTest() $expectedResponse = new SearchNearestEntitiesResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); + $formattedFeatureView = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); $query = new NearestNeighborQuery(); - $request = (new SearchNearestEntitiesRequest()) - ->setFeatureView($formattedFeatureView) - ->setQuery($query); + $request = (new SearchNearestEntitiesRequest())->setFeatureView($formattedFeatureView)->setQuery($query); $response = $gapicClient->searchNearestEntities($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreService/SearchNearestEntities', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeatureOnlineStoreService/SearchNearestEntities', + $actualFuncCall + ); $actualValue = $actualRequestObject->getFeatureView(); $this->assertProtobufEquals($formattedFeatureView, $actualValue); $actualValue = $actualRequestObject->getQuery(); @@ -176,19 +195,25 @@ public function searchNearestEntitiesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); + $formattedFeatureView = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); $query = new NearestNeighborQuery(); - $request = (new SearchNearestEntitiesRequest()) - ->setFeatureView($formattedFeatureView) - ->setQuery($query); + $request = (new SearchNearestEntitiesRequest())->setFeatureView($formattedFeatureView)->setQuery($query); try { $gapicClient->searchNearestEntities($request); // If the $gapicClient method call did not throw, fail the test @@ -241,12 +266,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -273,9 +301,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -305,12 +331,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -343,8 +372,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -368,17 +396,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -410,9 +440,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -438,19 +466,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -478,9 +507,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -506,19 +533,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -544,9 +572,13 @@ public function fetchFeatureValuesAsyncTest() $expectedResponse = new FetchFeatureValuesResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $request = (new FetchFeatureValuesRequest()) - ->setFeatureView($formattedFeatureView); + $formattedFeatureView = $gapicClient->featureViewName( + '[PROJECT]', + '[LOCATION]', + '[FEATURE_ONLINE_STORE]', + '[FEATURE_VIEW]' + ); + $request = (new FetchFeatureValuesRequest())->setFeatureView($formattedFeatureView); $response = $gapicClient->fetchFeatureValuesAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/AiPlatform/tests/Unit/V1/Client/FeatureRegistryServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/FeatureRegistryServiceClientTest.php index 78d73317efd1..78a1713fd026 100644 --- a/AiPlatform/tests/Unit/V1/Client/FeatureRegistryServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/FeatureRegistryServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return FeatureRegistryServiceClient */ @@ -194,12 +196,15 @@ public function createFeatureExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); @@ -333,12 +338,15 @@ public function createFeatureGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -400,9 +408,14 @@ public function deleteFeatureTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $request = (new DeleteFeatureRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]', + '[FEATURE]' + ); + $request = (new DeleteFeatureRequest())->setName($formattedName); $response = $gapicClient->deleteFeature($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -458,17 +471,25 @@ public function deleteFeatureExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $request = (new DeleteFeatureRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]', + '[FEATURE]' + ); + $request = (new DeleteFeatureRequest())->setName($formattedName); $response = $gapicClient->deleteFeature($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -522,8 +543,7 @@ public function deleteFeatureGroupTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - $request = (new DeleteFeatureGroupRequest()) - ->setName($formattedName); + $request = (new DeleteFeatureGroupRequest())->setName($formattedName); $response = $gapicClient->deleteFeatureGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -579,17 +599,19 @@ public function deleteFeatureGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - $request = (new DeleteFeatureGroupRequest()) - ->setName($formattedName); + $request = (new DeleteFeatureGroupRequest())->setName($formattedName); $response = $gapicClient->deleteFeatureGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -636,9 +658,14 @@ public function getFeatureTest() $expectedResponse->setPointOfContact($pointOfContact); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $request = (new GetFeatureRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]', + '[FEATURE]' + ); + $request = (new GetFeatureRequest())->setName($formattedName); $response = $gapicClient->getFeature($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -662,17 +689,25 @@ public function getFeatureExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $request = (new GetFeatureRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]', + '[FEATURE]' + ); + $request = (new GetFeatureRequest())->setName($formattedName); try { $gapicClient->getFeature($request); // If the $gapicClient method call did not throw, fail the test @@ -705,8 +740,7 @@ public function getFeatureGroupTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - $request = (new GetFeatureGroupRequest()) - ->setName($formattedName); + $request = (new GetFeatureGroupRequest())->setName($formattedName); $response = $gapicClient->getFeatureGroup($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -730,17 +764,19 @@ public function getFeatureGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - $request = (new GetFeatureGroupRequest()) - ->setName($formattedName); + $request = (new GetFeatureGroupRequest())->setName($formattedName); try { $gapicClient->getFeatureGroup($request); // If the $gapicClient method call did not throw, fail the test @@ -765,17 +801,14 @@ public function listFeatureGroupsTest() // Mock response $nextPageToken = ''; $featureGroupsElement = new FeatureGroup(); - $featureGroups = [ - $featureGroupsElement, - ]; + $featureGroups = [$featureGroupsElement]; $expectedResponse = new ListFeatureGroupsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFeatureGroups($featureGroups); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFeatureGroupsRequest()) - ->setParent($formattedParent); + $request = (new ListFeatureGroupsRequest())->setParent($formattedParent); $response = $gapicClient->listFeatureGroups($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -802,17 +835,19 @@ public function listFeatureGroupsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFeatureGroupsRequest()) - ->setParent($formattedParent); + $request = (new ListFeatureGroupsRequest())->setParent($formattedParent); try { $gapicClient->listFeatureGroups($request); // If the $gapicClient method call did not throw, fail the test @@ -837,17 +872,14 @@ public function listFeaturesTest() // Mock response $nextPageToken = ''; $featuresElement = new Feature(); - $features = [ - $featuresElement, - ]; + $features = [$featuresElement]; $expectedResponse = new ListFeaturesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFeatures($features); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new ListFeaturesRequest()) - ->setParent($formattedParent); + $request = (new ListFeaturesRequest())->setParent($formattedParent); $response = $gapicClient->listFeatures($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -874,17 +906,19 @@ public function listFeaturesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new ListFeaturesRequest()) - ->setParent($formattedParent); + $request = (new ListFeaturesRequest())->setParent($formattedParent); try { $gapicClient->listFeatures($request); // If the $gapicClient method call did not throw, fail the test @@ -941,8 +975,7 @@ public function updateFeatureTest() $operationsTransport->addResponse($completeOperation); // Mock request $feature = new Feature(); - $request = (new UpdateFeatureRequest()) - ->setFeature($feature); + $request = (new UpdateFeatureRequest())->setFeature($feature); $response = $gapicClient->updateFeature($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -998,17 +1031,19 @@ public function updateFeatureExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $feature = new Feature(); - $request = (new UpdateFeatureRequest()) - ->setFeature($feature); + $request = (new UpdateFeatureRequest())->setFeature($feature); $response = $gapicClient->updateFeature($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1068,8 +1103,7 @@ public function updateFeatureGroupTest() $operationsTransport->addResponse($completeOperation); // Mock request $featureGroup = new FeatureGroup(); - $request = (new UpdateFeatureGroupRequest()) - ->setFeatureGroup($featureGroup); + $request = (new UpdateFeatureGroupRequest())->setFeatureGroup($featureGroup); $response = $gapicClient->updateFeatureGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1125,17 +1159,19 @@ public function updateFeatureGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $featureGroup = new FeatureGroup(); - $request = (new UpdateFeatureGroupRequest()) - ->setFeatureGroup($featureGroup); + $request = (new UpdateFeatureGroupRequest())->setFeatureGroup($featureGroup); $response = $gapicClient->updateFeatureGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1197,12 +1233,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1229,9 +1268,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1261,12 +1298,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1299,8 +1339,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1324,17 +1363,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1366,9 +1407,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1394,19 +1433,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1434,9 +1474,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1462,19 +1500,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test diff --git a/AiPlatform/tests/Unit/V1/Client/FeaturestoreOnlineServingServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/FeaturestoreOnlineServingServiceClientTest.php index e692463bd351..f2a4e7e404cf 100644 --- a/AiPlatform/tests/Unit/V1/Client/FeaturestoreOnlineServingServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/FeaturestoreOnlineServingServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return FeaturestoreOnlineServingServiceClient */ @@ -87,7 +89,12 @@ public function readFeatureValuesTest() $expectedResponse = new ReadFeatureValuesResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $entityId = 'entityId-740565257'; $featureSelector = new FeatureSelector(); $featureSelectorIdMatcher = new IdMatcher(); @@ -104,7 +111,10 @@ public function readFeatureValuesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/ReadFeatureValues', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/ReadFeatureValues', + $actualFuncCall + ); $actualValue = $actualRequestObject->getEntityType(); $this->assertProtobufEquals($formattedEntityType, $actualValue); $actualValue = $actualRequestObject->getEntityId(); @@ -125,15 +135,23 @@ public function readFeatureValuesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $entityId = 'entityId-740565257'; $featureSelector = new FeatureSelector(); $featureSelectorIdMatcher = new IdMatcher(); @@ -173,7 +191,12 @@ public function streamingReadFeatureValuesTest() $expectedResponse3 = new ReadFeatureValuesResponse(); $transport->addResponse($expectedResponse3); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $entityIds = []; $featureSelector = new FeatureSelector(); $featureSelectorIdMatcher = new IdMatcher(); @@ -196,7 +219,10 @@ public function streamingReadFeatureValuesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/StreamingReadFeatureValues', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/StreamingReadFeatureValues', + $actualFuncCall + ); $actualValue = $actualRequestObject->getEntityType(); $this->assertProtobufEquals($formattedEntityType, $actualValue); $actualValue = $actualRequestObject->getEntityIds(); @@ -216,16 +242,24 @@ public function streamingReadFeatureValuesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $entityIds = []; $featureSelector = new FeatureSelector(); $featureSelectorIdMatcher = new IdMatcher(); @@ -263,18 +297,24 @@ public function writeFeatureValuesTest() $expectedResponse = new WriteFeatureValuesResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $payloads = []; - $request = (new WriteFeatureValuesRequest()) - ->setEntityType($formattedEntityType) - ->setPayloads($payloads); + $request = (new WriteFeatureValuesRequest())->setEntityType($formattedEntityType)->setPayloads($payloads); $response = $gapicClient->writeFeatureValues($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/WriteFeatureValues', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/WriteFeatureValues', + $actualFuncCall + ); $actualValue = $actualRequestObject->getEntityType(); $this->assertProtobufEquals($formattedEntityType, $actualValue); $actualValue = $actualRequestObject->getPayloads(); @@ -293,19 +333,25 @@ public function writeFeatureValuesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $payloads = []; - $request = (new WriteFeatureValuesRequest()) - ->setEntityType($formattedEntityType) - ->setPayloads($payloads); + $request = (new WriteFeatureValuesRequest())->setEntityType($formattedEntityType)->setPayloads($payloads); try { $gapicClient->writeFeatureValues($request); // If the $gapicClient method call did not throw, fail the test @@ -358,12 +404,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -390,9 +439,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -422,12 +469,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -460,8 +510,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -485,17 +534,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -527,9 +578,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -555,19 +604,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -595,9 +645,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -623,19 +671,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -661,7 +710,12 @@ public function readFeatureValuesAsyncTest() $expectedResponse = new ReadFeatureValuesResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $entityId = 'entityId-740565257'; $featureSelector = new FeatureSelector(); $featureSelectorIdMatcher = new IdMatcher(); @@ -678,7 +732,10 @@ public function readFeatureValuesAsyncTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/ReadFeatureValues', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/ReadFeatureValues', + $actualFuncCall + ); $actualValue = $actualRequestObject->getEntityType(); $this->assertProtobufEquals($formattedEntityType, $actualValue); $actualValue = $actualRequestObject->getEntityId(); diff --git a/AiPlatform/tests/Unit/V1/Client/FeaturestoreServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/FeaturestoreServiceClientTest.php index 15c7ff76bc9f..fd2890037761 100644 --- a/AiPlatform/tests/Unit/V1/Client/FeaturestoreServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/FeaturestoreServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return FeaturestoreServiceClient */ @@ -140,9 +142,7 @@ public function batchCreateFeaturesTest() // Mock request $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); $requests = []; - $request = (new BatchCreateFeaturesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateFeaturesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateFeatures($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -200,19 +200,20 @@ public function batchCreateFeaturesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); $requests = []; - $request = (new BatchCreateFeaturesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateFeaturesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateFeatures($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -331,12 +332,15 @@ public function batchReadFeatureValuesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedFeaturestore = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); @@ -408,9 +412,7 @@ public function createEntityTypeTest() // Mock request $formattedParent = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); $entityTypeId = 'entityTypeId1181734884'; - $request = (new CreateEntityTypeRequest()) - ->setParent($formattedParent) - ->setEntityTypeId($entityTypeId); + $request = (new CreateEntityTypeRequest())->setParent($formattedParent)->setEntityTypeId($entityTypeId); $response = $gapicClient->createEntityType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -468,19 +470,20 @@ public function createEntityTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); $entityTypeId = 'entityTypeId1181734884'; - $request = (new CreateEntityTypeRequest()) - ->setParent($formattedParent) - ->setEntityTypeId($entityTypeId); + $request = (new CreateEntityTypeRequest())->setParent($formattedParent)->setEntityTypeId($entityTypeId); $response = $gapicClient->createEntityType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -611,12 +614,15 @@ public function createFeatureExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); @@ -750,12 +756,15 @@ public function createFeaturestoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -818,8 +827,7 @@ public function deleteEntityTypeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new DeleteEntityTypeRequest()) - ->setName($formattedName); + $request = (new DeleteEntityTypeRequest())->setName($formattedName); $response = $gapicClient->deleteEntityType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -875,17 +883,19 @@ public function deleteEntityTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new DeleteEntityTypeRequest()) - ->setName($formattedName); + $request = (new DeleteEntityTypeRequest())->setName($formattedName); $response = $gapicClient->deleteEntityType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -938,9 +948,14 @@ public function deleteFeatureTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $request = (new DeleteFeatureRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]', + '[FEATURE]' + ); + $request = (new DeleteFeatureRequest())->setName($formattedName); $response = $gapicClient->deleteFeature($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -996,17 +1011,25 @@ public function deleteFeatureExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $request = (new DeleteFeatureRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]', + '[FEATURE]' + ); + $request = (new DeleteFeatureRequest())->setName($formattedName); $response = $gapicClient->deleteFeature($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1059,9 +1082,13 @@ public function deleteFeatureValuesTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new DeleteFeatureValuesRequest()) - ->setEntityType($formattedEntityType); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); + $request = (new DeleteFeatureValuesRequest())->setEntityType($formattedEntityType); $response = $gapicClient->deleteFeatureValues($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1117,17 +1144,24 @@ public function deleteFeatureValuesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new DeleteFeatureValuesRequest()) - ->setEntityType($formattedEntityType); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); + $request = (new DeleteFeatureValuesRequest())->setEntityType($formattedEntityType); $response = $gapicClient->deleteFeatureValues($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1181,8 +1215,7 @@ public function deleteFeaturestoreTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $request = (new DeleteFeaturestoreRequest()) - ->setName($formattedName); + $request = (new DeleteFeaturestoreRequest())->setName($formattedName); $response = $gapicClient->deleteFeaturestore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1238,17 +1271,19 @@ public function deleteFeaturestoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $request = (new DeleteFeaturestoreRequest()) - ->setName($formattedName); + $request = (new DeleteFeaturestoreRequest())->setName($formattedName); $response = $gapicClient->deleteFeaturestore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1301,7 +1336,12 @@ public function exportFeatureValuesTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $destination = new FeatureValueDestination(); $featureSelector = new FeatureSelector(); $featureSelectorIdMatcher = new IdMatcher(); @@ -1371,15 +1411,23 @@ public function exportFeatureValuesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $destination = new FeatureValueDestination(); $featureSelector = new FeatureSelector(); $featureSelectorIdMatcher = new IdMatcher(); @@ -1433,8 +1481,7 @@ public function getEntityTypeTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new GetEntityTypeRequest()) - ->setName($formattedName); + $request = (new GetEntityTypeRequest())->setName($formattedName); $response = $gapicClient->getEntityType($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1458,17 +1505,19 @@ public function getEntityTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new GetEntityTypeRequest()) - ->setName($formattedName); + $request = (new GetEntityTypeRequest())->setName($formattedName); try { $gapicClient->getEntityType($request); // If the $gapicClient method call did not throw, fail the test @@ -1506,9 +1555,14 @@ public function getFeatureTest() $expectedResponse->setPointOfContact($pointOfContact); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $request = (new GetFeatureRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]', + '[FEATURE]' + ); + $request = (new GetFeatureRequest())->setName($formattedName); $response = $gapicClient->getFeature($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1532,17 +1586,25 @@ public function getFeatureExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $request = (new GetFeatureRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->featureName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]', + '[FEATURE]' + ); + $request = (new GetFeatureRequest())->setName($formattedName); try { $gapicClient->getFeature($request); // If the $gapicClient method call did not throw, fail the test @@ -1575,8 +1637,7 @@ public function getFeaturestoreTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $request = (new GetFeaturestoreRequest()) - ->setName($formattedName); + $request = (new GetFeaturestoreRequest())->setName($formattedName); $response = $gapicClient->getFeaturestore($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1600,17 +1661,19 @@ public function getFeaturestoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $request = (new GetFeaturestoreRequest()) - ->setName($formattedName); + $request = (new GetFeaturestoreRequest())->setName($formattedName); try { $gapicClient->getFeaturestore($request); // If the $gapicClient method call did not throw, fail the test @@ -1662,7 +1725,12 @@ public function importFeatureValuesTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $featureSpecs = []; $request = (new ImportFeatureValuesRequest()) ->setEntityType($formattedEntityType) @@ -1724,15 +1792,23 @@ public function importFeatureValuesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); + $formattedEntityType = $gapicClient->entityTypeName( + '[PROJECT]', + '[LOCATION]', + '[FEATURESTORE]', + '[ENTITY_TYPE]' + ); $featureSpecs = []; $request = (new ImportFeatureValuesRequest()) ->setEntityType($formattedEntityType) @@ -1770,17 +1846,14 @@ public function listEntityTypesTest() // Mock response $nextPageToken = ''; $entityTypesElement = new EntityType(); - $entityTypes = [ - $entityTypesElement, - ]; + $entityTypes = [$entityTypesElement]; $expectedResponse = new ListEntityTypesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setEntityTypes($entityTypes); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $request = (new ListEntityTypesRequest()) - ->setParent($formattedParent); + $request = (new ListEntityTypesRequest())->setParent($formattedParent); $response = $gapicClient->listEntityTypes($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1807,17 +1880,19 @@ public function listEntityTypesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $request = (new ListEntityTypesRequest()) - ->setParent($formattedParent); + $request = (new ListEntityTypesRequest())->setParent($formattedParent); try { $gapicClient->listEntityTypes($request); // If the $gapicClient method call did not throw, fail the test @@ -1842,17 +1917,14 @@ public function listFeaturesTest() // Mock response $nextPageToken = ''; $featuresElement = new Feature(); - $features = [ - $featuresElement, - ]; + $features = [$featuresElement]; $expectedResponse = new ListFeaturesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFeatures($features); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new ListFeaturesRequest()) - ->setParent($formattedParent); + $request = (new ListFeaturesRequest())->setParent($formattedParent); $response = $gapicClient->listFeatures($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1879,17 +1951,19 @@ public function listFeaturesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $request = (new ListFeaturesRequest()) - ->setParent($formattedParent); + $request = (new ListFeaturesRequest())->setParent($formattedParent); try { $gapicClient->listFeatures($request); // If the $gapicClient method call did not throw, fail the test @@ -1914,17 +1988,14 @@ public function listFeaturestoresTest() // Mock response $nextPageToken = ''; $featurestoresElement = new Featurestore(); - $featurestores = [ - $featurestoresElement, - ]; + $featurestores = [$featurestoresElement]; $expectedResponse = new ListFeaturestoresResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFeaturestores($featurestores); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFeaturestoresRequest()) - ->setParent($formattedParent); + $request = (new ListFeaturestoresRequest())->setParent($formattedParent); $response = $gapicClient->listFeaturestores($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1951,17 +2022,19 @@ public function listFeaturestoresExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFeaturestoresRequest()) - ->setParent($formattedParent); + $request = (new ListFeaturestoresRequest())->setParent($formattedParent); try { $gapicClient->listFeaturestores($request); // If the $gapicClient method call did not throw, fail the test @@ -1986,17 +2059,14 @@ public function searchFeaturesTest() // Mock response $nextPageToken = ''; $featuresElement = new Feature(); - $features = [ - $featuresElement, - ]; + $features = [$featuresElement]; $expectedResponse = new SearchFeaturesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFeatures($features); $transport->addResponse($expectedResponse); // Mock request $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new SearchFeaturesRequest()) - ->setLocation($formattedLocation); + $request = (new SearchFeaturesRequest())->setLocation($formattedLocation); $response = $gapicClient->searchFeatures($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2023,17 +2093,19 @@ public function searchFeaturesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new SearchFeaturesRequest()) - ->setLocation($formattedLocation); + $request = (new SearchFeaturesRequest())->setLocation($formattedLocation); try { $gapicClient->searchFeatures($request); // If the $gapicClient method call did not throw, fail the test @@ -2068,8 +2140,7 @@ public function updateEntityTypeTest() $transport->addResponse($expectedResponse); // Mock request $entityType = new EntityType(); - $request = (new UpdateEntityTypeRequest()) - ->setEntityType($entityType); + $request = (new UpdateEntityTypeRequest())->setEntityType($entityType); $response = $gapicClient->updateEntityType($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2093,17 +2164,19 @@ public function updateEntityTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $entityType = new EntityType(); - $request = (new UpdateEntityTypeRequest()) - ->setEntityType($entityType); + $request = (new UpdateEntityTypeRequest())->setEntityType($entityType); try { $gapicClient->updateEntityType($request); // If the $gapicClient method call did not throw, fail the test @@ -2142,8 +2215,7 @@ public function updateFeatureTest() $transport->addResponse($expectedResponse); // Mock request $feature = new Feature(); - $request = (new UpdateFeatureRequest()) - ->setFeature($feature); + $request = (new UpdateFeatureRequest())->setFeature($feature); $response = $gapicClient->updateFeature($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2167,17 +2239,19 @@ public function updateFeatureExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $feature = new Feature(); - $request = (new UpdateFeatureRequest()) - ->setFeature($feature); + $request = (new UpdateFeatureRequest())->setFeature($feature); try { $gapicClient->updateFeature($request); // If the $gapicClient method call did not throw, fail the test @@ -2228,8 +2302,7 @@ public function updateFeaturestoreTest() $operationsTransport->addResponse($completeOperation); // Mock request $featurestore = new Featurestore(); - $request = (new UpdateFeaturestoreRequest()) - ->setFeaturestore($featurestore); + $request = (new UpdateFeaturestoreRequest())->setFeaturestore($featurestore); $response = $gapicClient->updateFeaturestore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2285,17 +2358,19 @@ public function updateFeaturestoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $featurestore = new Featurestore(); - $request = (new UpdateFeaturestoreRequest()) - ->setFeaturestore($featurestore); + $request = (new UpdateFeaturestoreRequest())->setFeaturestore($featurestore); $response = $gapicClient->updateFeaturestore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2357,12 +2432,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -2389,9 +2467,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -2421,12 +2497,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -2459,8 +2538,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2484,17 +2562,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2526,9 +2606,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2554,19 +2632,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2594,9 +2673,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2622,19 +2699,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2680,9 +2758,7 @@ public function batchCreateFeaturesAsyncTest() // Mock request $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); $requests = []; - $request = (new BatchCreateFeaturesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateFeaturesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateFeaturesAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/AiPlatform/tests/Unit/V1/Client/GenAiTuningServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/GenAiTuningServiceClientTest.php index ef3c0534fa23..172464f55bc5 100644 --- a/AiPlatform/tests/Unit/V1/Client/GenAiTuningServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/GenAiTuningServiceClientTest.php @@ -62,7 +62,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return GenAiTuningServiceClient */ @@ -87,8 +89,7 @@ public function cancelTuningJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - $request = (new CancelTuningJobRequest()) - ->setName($formattedName); + $request = (new CancelTuningJobRequest())->setName($formattedName); $gapicClient->cancelTuningJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -111,17 +112,19 @@ public function cancelTuningJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - $request = (new CancelTuningJobRequest()) - ->setName($formattedName); + $request = (new CancelTuningJobRequest())->setName($formattedName); try { $gapicClient->cancelTuningJob($request); // If the $gapicClient method call did not throw, fail the test @@ -159,9 +162,7 @@ public function createTuningJobTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $tuningJob = new TuningJob(); - $request = (new CreateTuningJobRequest()) - ->setParent($formattedParent) - ->setTuningJob($tuningJob); + $request = (new CreateTuningJobRequest())->setParent($formattedParent)->setTuningJob($tuningJob); $response = $gapicClient->createTuningJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -187,19 +188,20 @@ public function createTuningJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $tuningJob = new TuningJob(); - $request = (new CreateTuningJobRequest()) - ->setParent($formattedParent) - ->setTuningJob($tuningJob); + $request = (new CreateTuningJobRequest())->setParent($formattedParent)->setTuningJob($tuningJob); try { $gapicClient->createTuningJob($request); // If the $gapicClient method call did not throw, fail the test @@ -236,8 +238,7 @@ public function getTuningJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - $request = (new GetTuningJobRequest()) - ->setName($formattedName); + $request = (new GetTuningJobRequest())->setName($formattedName); $response = $gapicClient->getTuningJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -261,17 +262,19 @@ public function getTuningJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - $request = (new GetTuningJobRequest()) - ->setName($formattedName); + $request = (new GetTuningJobRequest())->setName($formattedName); try { $gapicClient->getTuningJob($request); // If the $gapicClient method call did not throw, fail the test @@ -296,17 +299,14 @@ public function listTuningJobsTest() // Mock response $nextPageToken = ''; $tuningJobsElement = new TuningJob(); - $tuningJobs = [ - $tuningJobsElement, - ]; + $tuningJobs = [$tuningJobsElement]; $expectedResponse = new ListTuningJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTuningJobs($tuningJobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListTuningJobsRequest()) - ->setParent($formattedParent); + $request = (new ListTuningJobsRequest())->setParent($formattedParent); $response = $gapicClient->listTuningJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -333,17 +333,19 @@ public function listTuningJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListTuningJobsRequest()) - ->setParent($formattedParent); + $request = (new ListTuningJobsRequest())->setParent($formattedParent); try { $gapicClient->listTuningJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -396,12 +398,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -428,9 +433,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -460,12 +463,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -498,8 +504,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -523,17 +528,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -565,9 +572,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -593,19 +598,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -633,9 +639,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -661,19 +665,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -700,8 +705,7 @@ public function cancelTuningJobAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - $request = (new CancelTuningJobRequest()) - ->setName($formattedName); + $request = (new CancelTuningJobRequest())->setName($formattedName); $gapicClient->cancelTuningJobAsync($request)->wait(); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); diff --git a/AiPlatform/tests/Unit/V1/Client/IndexEndpointServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/IndexEndpointServiceClientTest.php index 3f7d2996bee2..f27a08ad11a7 100644 --- a/AiPlatform/tests/Unit/V1/Client/IndexEndpointServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/IndexEndpointServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return IndexEndpointServiceClient */ @@ -137,9 +139,7 @@ public function createIndexEndpointTest() $indexEndpoint = new IndexEndpoint(); $indexEndpointDisplayName = 'indexEndpointDisplayName-894895258'; $indexEndpoint->setDisplayName($indexEndpointDisplayName); - $request = (new CreateIndexEndpointRequest()) - ->setParent($formattedParent) - ->setIndexEndpoint($indexEndpoint); + $request = (new CreateIndexEndpointRequest())->setParent($formattedParent)->setIndexEndpoint($indexEndpoint); $response = $gapicClient->createIndexEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -197,21 +197,22 @@ public function createIndexEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $indexEndpoint = new IndexEndpoint(); $indexEndpointDisplayName = 'indexEndpointDisplayName-894895258'; $indexEndpoint->setDisplayName($indexEndpointDisplayName); - $request = (new CreateIndexEndpointRequest()) - ->setParent($formattedParent) - ->setIndexEndpoint($indexEndpoint); + $request = (new CreateIndexEndpointRequest())->setParent($formattedParent)->setIndexEndpoint($indexEndpoint); $response = $gapicClient->createIndexEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -265,8 +266,7 @@ public function deleteIndexEndpointTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $request = (new DeleteIndexEndpointRequest()) - ->setName($formattedName); + $request = (new DeleteIndexEndpointRequest())->setName($formattedName); $response = $gapicClient->deleteIndexEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -322,17 +322,19 @@ public function deleteIndexEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $request = (new DeleteIndexEndpointRequest()) - ->setName($formattedName); + $request = (new DeleteIndexEndpointRequest())->setName($formattedName); $response = $gapicClient->deleteIndexEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -451,12 +453,15 @@ public function deployIndexExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); @@ -519,8 +524,7 @@ public function getIndexEndpointTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $request = (new GetIndexEndpointRequest()) - ->setName($formattedName); + $request = (new GetIndexEndpointRequest())->setName($formattedName); $response = $gapicClient->getIndexEndpoint($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -544,17 +548,19 @@ public function getIndexEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $request = (new GetIndexEndpointRequest()) - ->setName($formattedName); + $request = (new GetIndexEndpointRequest())->setName($formattedName); try { $gapicClient->getIndexEndpoint($request); // If the $gapicClient method call did not throw, fail the test @@ -579,17 +585,14 @@ public function listIndexEndpointsTest() // Mock response $nextPageToken = ''; $indexEndpointsElement = new IndexEndpoint(); - $indexEndpoints = [ - $indexEndpointsElement, - ]; + $indexEndpoints = [$indexEndpointsElement]; $expectedResponse = new ListIndexEndpointsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setIndexEndpoints($indexEndpoints); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListIndexEndpointsRequest()) - ->setParent($formattedParent); + $request = (new ListIndexEndpointsRequest())->setParent($formattedParent); $response = $gapicClient->listIndexEndpoints($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -616,17 +619,19 @@ public function listIndexEndpointsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListIndexEndpointsRequest()) - ->setParent($formattedParent); + $request = (new ListIndexEndpointsRequest())->setParent($formattedParent); try { $gapicClient->listIndexEndpoints($request); // If the $gapicClient method call did not throw, fail the test @@ -736,12 +741,15 @@ public function mutateDeployedIndexExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); @@ -867,12 +875,15 @@ public function undeployIndexExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); @@ -934,9 +945,7 @@ public function updateIndexEndpointTest() $indexEndpointDisplayName = 'indexEndpointDisplayName-894895258'; $indexEndpoint->setDisplayName($indexEndpointDisplayName); $updateMask = new FieldMask(); - $request = (new UpdateIndexEndpointRequest()) - ->setIndexEndpoint($indexEndpoint) - ->setUpdateMask($updateMask); + $request = (new UpdateIndexEndpointRequest())->setIndexEndpoint($indexEndpoint)->setUpdateMask($updateMask); $response = $gapicClient->updateIndexEndpoint($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -962,21 +971,22 @@ public function updateIndexEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $indexEndpoint = new IndexEndpoint(); $indexEndpointDisplayName = 'indexEndpointDisplayName-894895258'; $indexEndpoint->setDisplayName($indexEndpointDisplayName); $updateMask = new FieldMask(); - $request = (new UpdateIndexEndpointRequest()) - ->setIndexEndpoint($indexEndpoint) - ->setUpdateMask($updateMask); + $request = (new UpdateIndexEndpointRequest())->setIndexEndpoint($indexEndpoint)->setUpdateMask($updateMask); try { $gapicClient->updateIndexEndpoint($request); // If the $gapicClient method call did not throw, fail the test @@ -1029,12 +1039,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1061,9 +1074,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1093,12 +1104,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1131,8 +1145,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1156,17 +1169,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1198,9 +1213,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1226,19 +1239,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1266,9 +1280,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1294,19 +1306,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1370,9 +1383,7 @@ public function createIndexEndpointAsyncTest() $indexEndpoint = new IndexEndpoint(); $indexEndpointDisplayName = 'indexEndpointDisplayName-894895258'; $indexEndpoint->setDisplayName($indexEndpointDisplayName); - $request = (new CreateIndexEndpointRequest()) - ->setParent($formattedParent) - ->setIndexEndpoint($indexEndpoint); + $request = (new CreateIndexEndpointRequest())->setParent($formattedParent)->setIndexEndpoint($indexEndpoint); $response = $gapicClient->createIndexEndpointAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/AiPlatform/tests/Unit/V1/Client/IndexServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/IndexServiceClientTest.php index b04bc31eba84..78e2cc63b21b 100644 --- a/AiPlatform/tests/Unit/V1/Client/IndexServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/IndexServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return IndexServiceClient */ @@ -127,9 +129,7 @@ public function createIndexTest() $index = new Index(); $indexDisplayName = 'indexDisplayName-632619461'; $index->setDisplayName($indexDisplayName); - $request = (new CreateIndexRequest()) - ->setParent($formattedParent) - ->setIndex($index); + $request = (new CreateIndexRequest())->setParent($formattedParent)->setIndex($index); $response = $gapicClient->createIndex($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -187,21 +187,22 @@ public function createIndexExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $index = new Index(); $indexDisplayName = 'indexDisplayName-632619461'; $index->setDisplayName($indexDisplayName); - $request = (new CreateIndexRequest()) - ->setParent($formattedParent) - ->setIndex($index); + $request = (new CreateIndexRequest())->setParent($formattedParent)->setIndex($index); $response = $gapicClient->createIndex($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -255,8 +256,7 @@ public function deleteIndexTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $request = (new DeleteIndexRequest()) - ->setName($formattedName); + $request = (new DeleteIndexRequest())->setName($formattedName); $response = $gapicClient->deleteIndex($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -312,17 +312,19 @@ public function deleteIndexExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $request = (new DeleteIndexRequest()) - ->setName($formattedName); + $request = (new DeleteIndexRequest())->setName($formattedName); $response = $gapicClient->deleteIndex($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -368,8 +370,7 @@ public function getIndexTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $request = (new GetIndexRequest()) - ->setName($formattedName); + $request = (new GetIndexRequest())->setName($formattedName); $response = $gapicClient->getIndex($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -393,17 +394,19 @@ public function getIndexExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $request = (new GetIndexRequest()) - ->setName($formattedName); + $request = (new GetIndexRequest())->setName($formattedName); try { $gapicClient->getIndex($request); // If the $gapicClient method call did not throw, fail the test @@ -428,17 +431,14 @@ public function listIndexesTest() // Mock response $nextPageToken = ''; $indexesElement = new Index(); - $indexes = [ - $indexesElement, - ]; + $indexes = [$indexesElement]; $expectedResponse = new ListIndexesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setIndexes($indexes); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListIndexesRequest()) - ->setParent($formattedParent); + $request = (new ListIndexesRequest())->setParent($formattedParent); $response = $gapicClient->listIndexes($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -465,17 +465,19 @@ public function listIndexesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListIndexesRequest()) - ->setParent($formattedParent); + $request = (new ListIndexesRequest())->setParent($formattedParent); try { $gapicClient->listIndexes($request); // If the $gapicClient method call did not throw, fail the test @@ -502,8 +504,7 @@ public function removeDatapointsTest() $transport->addResponse($expectedResponse); // Mock request $formattedIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $request = (new RemoveDatapointsRequest()) - ->setIndex($formattedIndex); + $request = (new RemoveDatapointsRequest())->setIndex($formattedIndex); $response = $gapicClient->removeDatapoints($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -527,17 +528,19 @@ public function removeDatapointsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $request = (new RemoveDatapointsRequest()) - ->setIndex($formattedIndex); + $request = (new RemoveDatapointsRequest())->setIndex($formattedIndex); try { $gapicClient->removeDatapoints($request); // If the $gapicClient method call did not throw, fail the test @@ -594,8 +597,7 @@ public function updateIndexTest() $index = new Index(); $indexDisplayName = 'indexDisplayName-632619461'; $index->setDisplayName($indexDisplayName); - $request = (new UpdateIndexRequest()) - ->setIndex($index); + $request = (new UpdateIndexRequest())->setIndex($index); $response = $gapicClient->updateIndex($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -651,19 +653,21 @@ public function updateIndexExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $index = new Index(); $indexDisplayName = 'indexDisplayName-632619461'; $index->setDisplayName($indexDisplayName); - $request = (new UpdateIndexRequest()) - ->setIndex($index); + $request = (new UpdateIndexRequest())->setIndex($index); $response = $gapicClient->updateIndex($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -699,8 +703,7 @@ public function upsertDatapointsTest() $transport->addResponse($expectedResponse); // Mock request $formattedIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $request = (new UpsertDatapointsRequest()) - ->setIndex($formattedIndex); + $request = (new UpsertDatapointsRequest())->setIndex($formattedIndex); $response = $gapicClient->upsertDatapoints($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -724,17 +727,19 @@ public function upsertDatapointsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $request = (new UpsertDatapointsRequest()) - ->setIndex($formattedIndex); + $request = (new UpsertDatapointsRequest())->setIndex($formattedIndex); try { $gapicClient->upsertDatapoints($request); // If the $gapicClient method call did not throw, fail the test @@ -787,12 +792,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -819,9 +827,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -851,12 +857,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -889,8 +898,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -914,17 +922,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -956,9 +966,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -984,19 +992,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1024,9 +1033,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1052,19 +1059,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1122,9 +1130,7 @@ public function createIndexAsyncTest() $index = new Index(); $indexDisplayName = 'indexDisplayName-632619461'; $index->setDisplayName($indexDisplayName); - $request = (new CreateIndexRequest()) - ->setParent($formattedParent) - ->setIndex($index); + $request = (new CreateIndexRequest())->setParent($formattedParent)->setIndex($index); $response = $gapicClient->createIndexAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/AiPlatform/tests/Unit/V1/Client/JobServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/JobServiceClientTest.php index 5456bd0ce888..4a3fdcd081c2 100644 --- a/AiPlatform/tests/Unit/V1/Client/JobServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/JobServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return JobServiceClient */ @@ -146,8 +148,7 @@ public function cancelBatchPredictionJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $request = (new CancelBatchPredictionJobRequest()) - ->setName($formattedName); + $request = (new CancelBatchPredictionJobRequest())->setName($formattedName); $gapicClient->cancelBatchPredictionJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -170,17 +171,19 @@ public function cancelBatchPredictionJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $request = (new CancelBatchPredictionJobRequest()) - ->setName($formattedName); + $request = (new CancelBatchPredictionJobRequest())->setName($formattedName); try { $gapicClient->cancelBatchPredictionJob($request); // If the $gapicClient method call did not throw, fail the test @@ -207,8 +210,7 @@ public function cancelCustomJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $request = (new CancelCustomJobRequest()) - ->setName($formattedName); + $request = (new CancelCustomJobRequest())->setName($formattedName); $gapicClient->cancelCustomJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -231,17 +233,19 @@ public function cancelCustomJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $request = (new CancelCustomJobRequest()) - ->setName($formattedName); + $request = (new CancelCustomJobRequest())->setName($formattedName); try { $gapicClient->cancelCustomJob($request); // If the $gapicClient method call did not throw, fail the test @@ -268,8 +272,7 @@ public function cancelDataLabelingJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $request = (new CancelDataLabelingJobRequest()) - ->setName($formattedName); + $request = (new CancelDataLabelingJobRequest())->setName($formattedName); $gapicClient->cancelDataLabelingJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -292,17 +295,19 @@ public function cancelDataLabelingJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $request = (new CancelDataLabelingJobRequest()) - ->setName($formattedName); + $request = (new CancelDataLabelingJobRequest())->setName($formattedName); try { $gapicClient->cancelDataLabelingJob($request); // If the $gapicClient method call did not throw, fail the test @@ -328,9 +333,12 @@ public function cancelHyperparameterTuningJobTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $request = (new CancelHyperparameterTuningJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->hyperparameterTuningJobName( + '[PROJECT]', + '[LOCATION]', + '[HYPERPARAMETER_TUNING_JOB]' + ); + $request = (new CancelHyperparameterTuningJobRequest())->setName($formattedName); $gapicClient->cancelHyperparameterTuningJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -353,17 +361,23 @@ public function cancelHyperparameterTuningJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $request = (new CancelHyperparameterTuningJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->hyperparameterTuningJobName( + '[PROJECT]', + '[LOCATION]', + '[HYPERPARAMETER_TUNING_JOB]' + ); + $request = (new CancelHyperparameterTuningJobRequest())->setName($formattedName); try { $gapicClient->cancelHyperparameterTuningJob($request); // If the $gapicClient method call did not throw, fail the test @@ -390,8 +404,7 @@ public function cancelNasJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $request = (new CancelNasJobRequest()) - ->setName($formattedName); + $request = (new CancelNasJobRequest())->setName($formattedName); $gapicClient->cancelNasJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -414,17 +427,19 @@ public function cancelNasJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $request = (new CancelNasJobRequest()) - ->setName($formattedName); + $request = (new CancelNasJobRequest())->setName($formattedName); try { $gapicClient->cancelNasJob($request); // If the $gapicClient method call did not throw, fail the test @@ -504,12 +519,15 @@ public function createBatchPredictionJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -564,9 +582,7 @@ public function createCustomJobTest() $jobSpecWorkerPoolSpecs = []; $customJobJobSpec->setWorkerPoolSpecs($jobSpecWorkerPoolSpecs); $customJob->setJobSpec($customJobJobSpec); - $request = (new CreateCustomJobRequest()) - ->setParent($formattedParent) - ->setCustomJob($customJob); + $request = (new CreateCustomJobRequest())->setParent($formattedParent)->setCustomJob($customJob); $response = $gapicClient->createCustomJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -592,12 +608,15 @@ public function createCustomJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -608,9 +627,7 @@ public function createCustomJobExceptionTest() $jobSpecWorkerPoolSpecs = []; $customJobJobSpec->setWorkerPoolSpecs($jobSpecWorkerPoolSpecs); $customJob->setJobSpec($customJobJobSpec); - $request = (new CreateCustomJobRequest()) - ->setParent($formattedParent) - ->setCustomJob($customJob); + $request = (new CreateCustomJobRequest())->setParent($formattedParent)->setCustomJob($customJob); try { $gapicClient->createCustomJob($request); // If the $gapicClient method call did not throw, fail the test @@ -652,9 +669,7 @@ public function createDataLabelingJobTest() $dataLabelingJob = new DataLabelingJob(); $dataLabelingJobDisplayName = 'dataLabelingJobDisplayName708178632'; $dataLabelingJob->setDisplayName($dataLabelingJobDisplayName); - $dataLabelingJobDatasets = [ - $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'), - ]; + $dataLabelingJobDatasets = [$gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]')]; $dataLabelingJob->setDatasets($dataLabelingJobDatasets); $dataLabelingJobLabelerCount = 500093453; $dataLabelingJob->setLabelerCount($dataLabelingJobLabelerCount); @@ -692,21 +707,22 @@ public function createDataLabelingJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $dataLabelingJob = new DataLabelingJob(); $dataLabelingJobDisplayName = 'dataLabelingJobDisplayName708178632'; $dataLabelingJob->setDisplayName($dataLabelingJobDisplayName); - $dataLabelingJobDatasets = [ - $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'), - ]; + $dataLabelingJobDatasets = [$gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]')]; $dataLabelingJob->setDatasets($dataLabelingJobDatasets); $dataLabelingJobLabelerCount = 500093453; $dataLabelingJob->setLabelerCount($dataLabelingJobLabelerCount); @@ -800,12 +816,15 @@ public function createHyperparameterTuningJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -873,11 +892,17 @@ public function createModelDeploymentMonitoringJobTest() $modelDeploymentMonitoringJobEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $modelDeploymentMonitoringJob->setEndpoint($modelDeploymentMonitoringJobEndpoint); $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = []; - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs($modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs); + $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs( + $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs + ); $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = new ModelDeploymentMonitoringScheduleConfig(); $modelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration(); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval($modelDeploymentMonitoringScheduleConfigMonitorInterval); - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig($modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig); + $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval( + $modelDeploymentMonitoringScheduleConfigMonitorInterval + ); + $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig( + $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig + ); $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy(); $modelDeploymentMonitoringJob->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy); $request = (new CreateModelDeploymentMonitoringJobRequest()) @@ -908,12 +933,15 @@ public function createModelDeploymentMonitoringJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -923,11 +951,17 @@ public function createModelDeploymentMonitoringJobExceptionTest() $modelDeploymentMonitoringJobEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $modelDeploymentMonitoringJob->setEndpoint($modelDeploymentMonitoringJobEndpoint); $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = []; - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs($modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs); + $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs( + $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs + ); $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = new ModelDeploymentMonitoringScheduleConfig(); $modelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration(); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval($modelDeploymentMonitoringScheduleConfigMonitorInterval); - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig($modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig); + $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval( + $modelDeploymentMonitoringScheduleConfigMonitorInterval + ); + $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig( + $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig + ); $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy(); $modelDeploymentMonitoringJob->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy); $request = (new CreateModelDeploymentMonitoringJobRequest()) @@ -970,9 +1004,7 @@ public function createNasJobTest() $nasJob->setDisplayName($nasJobDisplayName); $nasJobNasJobSpec = new NasJobSpec(); $nasJob->setNasJobSpec($nasJobNasJobSpec); - $request = (new CreateNasJobRequest()) - ->setParent($formattedParent) - ->setNasJob($nasJob); + $request = (new CreateNasJobRequest())->setParent($formattedParent)->setNasJob($nasJob); $response = $gapicClient->createNasJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -998,12 +1030,15 @@ public function createNasJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -1012,9 +1047,7 @@ public function createNasJobExceptionTest() $nasJob->setDisplayName($nasJobDisplayName); $nasJobNasJobSpec = new NasJobSpec(); $nasJob->setNasJobSpec($nasJobNasJobSpec); - $request = (new CreateNasJobRequest()) - ->setParent($formattedParent) - ->setNasJob($nasJob); + $request = (new CreateNasJobRequest())->setParent($formattedParent)->setNasJob($nasJob); try { $gapicClient->createNasJob($request); // If the $gapicClient method call did not throw, fail the test @@ -1059,8 +1092,7 @@ public function deleteBatchPredictionJobTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $request = (new DeleteBatchPredictionJobRequest()) - ->setName($formattedName); + $request = (new DeleteBatchPredictionJobRequest())->setName($formattedName); $response = $gapicClient->deleteBatchPredictionJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1116,17 +1148,19 @@ public function deleteBatchPredictionJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $request = (new DeleteBatchPredictionJobRequest()) - ->setName($formattedName); + $request = (new DeleteBatchPredictionJobRequest())->setName($formattedName); $response = $gapicClient->deleteBatchPredictionJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1180,8 +1214,7 @@ public function deleteCustomJobTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $request = (new DeleteCustomJobRequest()) - ->setName($formattedName); + $request = (new DeleteCustomJobRequest())->setName($formattedName); $response = $gapicClient->deleteCustomJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1237,17 +1270,19 @@ public function deleteCustomJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $request = (new DeleteCustomJobRequest()) - ->setName($formattedName); + $request = (new DeleteCustomJobRequest())->setName($formattedName); $response = $gapicClient->deleteCustomJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1301,8 +1336,7 @@ public function deleteDataLabelingJobTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $request = (new DeleteDataLabelingJobRequest()) - ->setName($formattedName); + $request = (new DeleteDataLabelingJobRequest())->setName($formattedName); $response = $gapicClient->deleteDataLabelingJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1358,17 +1392,19 @@ public function deleteDataLabelingJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $request = (new DeleteDataLabelingJobRequest()) - ->setName($formattedName); + $request = (new DeleteDataLabelingJobRequest())->setName($formattedName); $response = $gapicClient->deleteDataLabelingJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1421,9 +1457,12 @@ public function deleteHyperparameterTuningJobTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $request = (new DeleteHyperparameterTuningJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->hyperparameterTuningJobName( + '[PROJECT]', + '[LOCATION]', + '[HYPERPARAMETER_TUNING_JOB]' + ); + $request = (new DeleteHyperparameterTuningJobRequest())->setName($formattedName); $response = $gapicClient->deleteHyperparameterTuningJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1479,17 +1518,23 @@ public function deleteHyperparameterTuningJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $request = (new DeleteHyperparameterTuningJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->hyperparameterTuningJobName( + '[PROJECT]', + '[LOCATION]', + '[HYPERPARAMETER_TUNING_JOB]' + ); + $request = (new DeleteHyperparameterTuningJobRequest())->setName($formattedName); $response = $gapicClient->deleteHyperparameterTuningJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1542,9 +1587,12 @@ public function deleteModelDeploymentMonitoringJobTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $request = (new DeleteModelDeploymentMonitoringJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); + $request = (new DeleteModelDeploymentMonitoringJobRequest())->setName($formattedName); $response = $gapicClient->deleteModelDeploymentMonitoringJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1554,7 +1602,10 @@ public function deleteModelDeploymentMonitoringJobTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/DeleteModelDeploymentMonitoringJob', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.JobService/DeleteModelDeploymentMonitoringJob', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -1600,17 +1651,23 @@ public function deleteModelDeploymentMonitoringJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $request = (new DeleteModelDeploymentMonitoringJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); + $request = (new DeleteModelDeploymentMonitoringJobRequest())->setName($formattedName); $response = $gapicClient->deleteModelDeploymentMonitoringJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1664,8 +1721,7 @@ public function deleteNasJobTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $request = (new DeleteNasJobRequest()) - ->setName($formattedName); + $request = (new DeleteNasJobRequest())->setName($formattedName); $response = $gapicClient->deleteNasJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1721,17 +1777,19 @@ public function deleteNasJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $request = (new DeleteNasJobRequest()) - ->setName($formattedName); + $request = (new DeleteNasJobRequest())->setName($formattedName); $response = $gapicClient->deleteNasJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1781,8 +1839,7 @@ public function getBatchPredictionJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $request = (new GetBatchPredictionJobRequest()) - ->setName($formattedName); + $request = (new GetBatchPredictionJobRequest())->setName($formattedName); $response = $gapicClient->getBatchPredictionJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1806,17 +1863,19 @@ public function getBatchPredictionJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $request = (new GetBatchPredictionJobRequest()) - ->setName($formattedName); + $request = (new GetBatchPredictionJobRequest())->setName($formattedName); try { $gapicClient->getBatchPredictionJob($request); // If the $gapicClient method call did not throw, fail the test @@ -1847,8 +1906,7 @@ public function getCustomJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $request = (new GetCustomJobRequest()) - ->setName($formattedName); + $request = (new GetCustomJobRequest())->setName($formattedName); $response = $gapicClient->getCustomJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1872,17 +1930,19 @@ public function getCustomJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $request = (new GetCustomJobRequest()) - ->setName($formattedName); + $request = (new GetCustomJobRequest())->setName($formattedName); try { $gapicClient->getCustomJob($request); // If the $gapicClient method call did not throw, fail the test @@ -1921,8 +1981,7 @@ public function getDataLabelingJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $request = (new GetDataLabelingJobRequest()) - ->setName($formattedName); + $request = (new GetDataLabelingJobRequest())->setName($formattedName); $response = $gapicClient->getDataLabelingJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1946,17 +2005,19 @@ public function getDataLabelingJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $request = (new GetDataLabelingJobRequest()) - ->setName($formattedName); + $request = (new GetDataLabelingJobRequest())->setName($formattedName); try { $gapicClient->getDataLabelingJob($request); // If the $gapicClient method call did not throw, fail the test @@ -1992,9 +2053,12 @@ public function getHyperparameterTuningJobTest() $expectedResponse->setMaxFailedTrialCount($maxFailedTrialCount); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $request = (new GetHyperparameterTuningJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->hyperparameterTuningJobName( + '[PROJECT]', + '[LOCATION]', + '[HYPERPARAMETER_TUNING_JOB]' + ); + $request = (new GetHyperparameterTuningJobRequest())->setName($formattedName); $response = $gapicClient->getHyperparameterTuningJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2018,17 +2082,23 @@ public function getHyperparameterTuningJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $request = (new GetHyperparameterTuningJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->hyperparameterTuningJobName( + '[PROJECT]', + '[LOCATION]', + '[HYPERPARAMETER_TUNING_JOB]' + ); + $request = (new GetHyperparameterTuningJobRequest())->setName($formattedName); try { $gapicClient->getHyperparameterTuningJob($request); // If the $gapicClient method call did not throw, fail the test @@ -2066,9 +2136,12 @@ public function getModelDeploymentMonitoringJobTest() $expectedResponse->setEnableMonitoringPipelineLogs($enableMonitoringPipelineLogs); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $request = (new GetModelDeploymentMonitoringJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); + $request = (new GetModelDeploymentMonitoringJobRequest())->setName($formattedName); $response = $gapicClient->getModelDeploymentMonitoringJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2092,17 +2165,23 @@ public function getModelDeploymentMonitoringJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $request = (new GetModelDeploymentMonitoringJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); + $request = (new GetModelDeploymentMonitoringJobRequest())->setName($formattedName); try { $gapicClient->getModelDeploymentMonitoringJob($request); // If the $gapicClient method call did not throw, fail the test @@ -2135,8 +2214,7 @@ public function getNasJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $request = (new GetNasJobRequest()) - ->setName($formattedName); + $request = (new GetNasJobRequest())->setName($formattedName); $response = $gapicClient->getNasJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2160,17 +2238,19 @@ public function getNasJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $request = (new GetNasJobRequest()) - ->setName($formattedName); + $request = (new GetNasJobRequest())->setName($formattedName); try { $gapicClient->getNasJob($request); // If the $gapicClient method call did not throw, fail the test @@ -2201,8 +2281,7 @@ public function getNasTrialDetailTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->nasTrialDetailName('[PROJECT]', '[LOCATION]', '[NAS_JOB]', '[NAS_TRIAL_DETAIL]'); - $request = (new GetNasTrialDetailRequest()) - ->setName($formattedName); + $request = (new GetNasTrialDetailRequest())->setName($formattedName); $response = $gapicClient->getNasTrialDetail($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2226,17 +2305,19 @@ public function getNasTrialDetailExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->nasTrialDetailName('[PROJECT]', '[LOCATION]', '[NAS_JOB]', '[NAS_TRIAL_DETAIL]'); - $request = (new GetNasTrialDetailRequest()) - ->setName($formattedName); + $request = (new GetNasTrialDetailRequest())->setName($formattedName); try { $gapicClient->getNasTrialDetail($request); // If the $gapicClient method call did not throw, fail the test @@ -2261,17 +2342,14 @@ public function listBatchPredictionJobsTest() // Mock response $nextPageToken = ''; $batchPredictionJobsElement = new BatchPredictionJob(); - $batchPredictionJobs = [ - $batchPredictionJobsElement, - ]; + $batchPredictionJobs = [$batchPredictionJobsElement]; $expectedResponse = new ListBatchPredictionJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setBatchPredictionJobs($batchPredictionJobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBatchPredictionJobsRequest()) - ->setParent($formattedParent); + $request = (new ListBatchPredictionJobsRequest())->setParent($formattedParent); $response = $gapicClient->listBatchPredictionJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2298,17 +2376,19 @@ public function listBatchPredictionJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBatchPredictionJobsRequest()) - ->setParent($formattedParent); + $request = (new ListBatchPredictionJobsRequest())->setParent($formattedParent); try { $gapicClient->listBatchPredictionJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -2333,17 +2413,14 @@ public function listCustomJobsTest() // Mock response $nextPageToken = ''; $customJobsElement = new CustomJob(); - $customJobs = [ - $customJobsElement, - ]; + $customJobs = [$customJobsElement]; $expectedResponse = new ListCustomJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCustomJobs($customJobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListCustomJobsRequest()) - ->setParent($formattedParent); + $request = (new ListCustomJobsRequest())->setParent($formattedParent); $response = $gapicClient->listCustomJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2370,17 +2447,19 @@ public function listCustomJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListCustomJobsRequest()) - ->setParent($formattedParent); + $request = (new ListCustomJobsRequest())->setParent($formattedParent); try { $gapicClient->listCustomJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -2405,17 +2484,14 @@ public function listDataLabelingJobsTest() // Mock response $nextPageToken = ''; $dataLabelingJobsElement = new DataLabelingJob(); - $dataLabelingJobs = [ - $dataLabelingJobsElement, - ]; + $dataLabelingJobs = [$dataLabelingJobsElement]; $expectedResponse = new ListDataLabelingJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDataLabelingJobs($dataLabelingJobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDataLabelingJobsRequest()) - ->setParent($formattedParent); + $request = (new ListDataLabelingJobsRequest())->setParent($formattedParent); $response = $gapicClient->listDataLabelingJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2442,17 +2518,19 @@ public function listDataLabelingJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDataLabelingJobsRequest()) - ->setParent($formattedParent); + $request = (new ListDataLabelingJobsRequest())->setParent($formattedParent); try { $gapicClient->listDataLabelingJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -2477,17 +2555,14 @@ public function listHyperparameterTuningJobsTest() // Mock response $nextPageToken = ''; $hyperparameterTuningJobsElement = new HyperparameterTuningJob(); - $hyperparameterTuningJobs = [ - $hyperparameterTuningJobsElement, - ]; + $hyperparameterTuningJobs = [$hyperparameterTuningJobsElement]; $expectedResponse = new ListHyperparameterTuningJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setHyperparameterTuningJobs($hyperparameterTuningJobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListHyperparameterTuningJobsRequest()) - ->setParent($formattedParent); + $request = (new ListHyperparameterTuningJobsRequest())->setParent($formattedParent); $response = $gapicClient->listHyperparameterTuningJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2514,17 +2589,19 @@ public function listHyperparameterTuningJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListHyperparameterTuningJobsRequest()) - ->setParent($formattedParent); + $request = (new ListHyperparameterTuningJobsRequest())->setParent($formattedParent); try { $gapicClient->listHyperparameterTuningJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -2549,17 +2626,14 @@ public function listModelDeploymentMonitoringJobsTest() // Mock response $nextPageToken = ''; $modelDeploymentMonitoringJobsElement = new ModelDeploymentMonitoringJob(); - $modelDeploymentMonitoringJobs = [ - $modelDeploymentMonitoringJobsElement, - ]; + $modelDeploymentMonitoringJobs = [$modelDeploymentMonitoringJobsElement]; $expectedResponse = new ListModelDeploymentMonitoringJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setModelDeploymentMonitoringJobs($modelDeploymentMonitoringJobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListModelDeploymentMonitoringJobsRequest()) - ->setParent($formattedParent); + $request = (new ListModelDeploymentMonitoringJobsRequest())->setParent($formattedParent); $response = $gapicClient->listModelDeploymentMonitoringJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2586,17 +2660,19 @@ public function listModelDeploymentMonitoringJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListModelDeploymentMonitoringJobsRequest()) - ->setParent($formattedParent); + $request = (new ListModelDeploymentMonitoringJobsRequest())->setParent($formattedParent); try { $gapicClient->listModelDeploymentMonitoringJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -2621,17 +2697,14 @@ public function listNasJobsTest() // Mock response $nextPageToken = ''; $nasJobsElement = new NasJob(); - $nasJobs = [ - $nasJobsElement, - ]; + $nasJobs = [$nasJobsElement]; $expectedResponse = new ListNasJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setNasJobs($nasJobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListNasJobsRequest()) - ->setParent($formattedParent); + $request = (new ListNasJobsRequest())->setParent($formattedParent); $response = $gapicClient->listNasJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2658,17 +2731,19 @@ public function listNasJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListNasJobsRequest()) - ->setParent($formattedParent); + $request = (new ListNasJobsRequest())->setParent($formattedParent); try { $gapicClient->listNasJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -2693,17 +2768,14 @@ public function listNasTrialDetailsTest() // Mock response $nextPageToken = ''; $nasTrialDetailsElement = new NasTrialDetail(); - $nasTrialDetails = [ - $nasTrialDetailsElement, - ]; + $nasTrialDetails = [$nasTrialDetailsElement]; $expectedResponse = new ListNasTrialDetailsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setNasTrialDetails($nasTrialDetails); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $request = (new ListNasTrialDetailsRequest()) - ->setParent($formattedParent); + $request = (new ListNasTrialDetailsRequest())->setParent($formattedParent); $response = $gapicClient->listNasTrialDetails($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2730,17 +2802,19 @@ public function listNasTrialDetailsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $request = (new ListNasTrialDetailsRequest()) - ->setParent($formattedParent); + $request = (new ListNasTrialDetailsRequest())->setParent($formattedParent); try { $gapicClient->listNasTrialDetails($request); // If the $gapicClient method call did not throw, fail the test @@ -2766,9 +2840,12 @@ public function pauseModelDeploymentMonitoringJobTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $request = (new PauseModelDeploymentMonitoringJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); + $request = (new PauseModelDeploymentMonitoringJobRequest())->setName($formattedName); $gapicClient->pauseModelDeploymentMonitoringJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -2791,17 +2868,23 @@ public function pauseModelDeploymentMonitoringJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $request = (new PauseModelDeploymentMonitoringJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); + $request = (new PauseModelDeploymentMonitoringJobRequest())->setName($formattedName); try { $gapicClient->pauseModelDeploymentMonitoringJob($request); // If the $gapicClient method call did not throw, fail the test @@ -2827,9 +2910,12 @@ public function resumeModelDeploymentMonitoringJobTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $request = (new ResumeModelDeploymentMonitoringJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); + $request = (new ResumeModelDeploymentMonitoringJobRequest())->setName($formattedName); $gapicClient->resumeModelDeploymentMonitoringJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -2852,17 +2938,23 @@ public function resumeModelDeploymentMonitoringJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $request = (new ResumeModelDeploymentMonitoringJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); + $request = (new ResumeModelDeploymentMonitoringJobRequest())->setName($formattedName); try { $gapicClient->resumeModelDeploymentMonitoringJob($request); // If the $gapicClient method call did not throw, fail the test @@ -2887,15 +2979,17 @@ public function searchModelDeploymentMonitoringStatsAnomaliesTest() // Mock response $nextPageToken = ''; $monitoringStatsElement = new ModelMonitoringStatsAnomalies(); - $monitoringStats = [ - $monitoringStatsElement, - ]; + $monitoringStats = [$monitoringStatsElement]; $expectedResponse = new SearchModelDeploymentMonitoringStatsAnomaliesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMonitoringStats($monitoringStats); $transport->addResponse($expectedResponse); // Mock request - $formattedModelDeploymentMonitoringJob = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); + $formattedModelDeploymentMonitoringJob = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); $deployedModelId = 'deployedModelId866642506'; $objectives = []; $request = (new SearchModelDeploymentMonitoringStatsAnomaliesRequest()) @@ -2911,7 +3005,10 @@ public function searchModelDeploymentMonitoringStatsAnomaliesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/SearchModelDeploymentMonitoringStatsAnomalies', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.JobService/SearchModelDeploymentMonitoringStatsAnomalies', + $actualFuncCall + ); $actualValue = $actualRequestObject->getModelDeploymentMonitoringJob(); $this->assertProtobufEquals($formattedModelDeploymentMonitoringJob, $actualValue); $actualValue = $actualRequestObject->getDeployedModelId(); @@ -2932,15 +3029,22 @@ public function searchModelDeploymentMonitoringStatsAnomaliesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedModelDeploymentMonitoringJob = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); + $formattedModelDeploymentMonitoringJob = $gapicClient->modelDeploymentMonitoringJobName( + '[PROJECT]', + '[LOCATION]', + '[MODEL_DEPLOYMENT_MONITORING_JOB]' + ); $deployedModelId = 'deployedModelId866642506'; $objectives = []; $request = (new SearchModelDeploymentMonitoringStatsAnomaliesRequest()) @@ -3008,11 +3112,17 @@ public function updateModelDeploymentMonitoringJobTest() $modelDeploymentMonitoringJobEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $modelDeploymentMonitoringJob->setEndpoint($modelDeploymentMonitoringJobEndpoint); $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = []; - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs($modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs); + $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs( + $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs + ); $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = new ModelDeploymentMonitoringScheduleConfig(); $modelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration(); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval($modelDeploymentMonitoringScheduleConfigMonitorInterval); - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig($modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig); + $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval( + $modelDeploymentMonitoringScheduleConfigMonitorInterval + ); + $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig( + $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig + ); $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy(); $modelDeploymentMonitoringJob->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy); $updateMask = new FieldMask(); @@ -3028,7 +3138,10 @@ public function updateModelDeploymentMonitoringJobTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/UpdateModelDeploymentMonitoringJob', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.JobService/UpdateModelDeploymentMonitoringJob', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getModelDeploymentMonitoringJob(); $this->assertProtobufEquals($modelDeploymentMonitoringJob, $actualValue); $actualValue = $actualApiRequestObject->getUpdateMask(); @@ -3076,12 +3189,15 @@ public function updateModelDeploymentMonitoringJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $modelDeploymentMonitoringJob = new ModelDeploymentMonitoringJob(); @@ -3090,11 +3206,17 @@ public function updateModelDeploymentMonitoringJobExceptionTest() $modelDeploymentMonitoringJobEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $modelDeploymentMonitoringJob->setEndpoint($modelDeploymentMonitoringJobEndpoint); $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = []; - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs($modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs); + $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs( + $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs + ); $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = new ModelDeploymentMonitoringScheduleConfig(); $modelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration(); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval($modelDeploymentMonitoringScheduleConfigMonitorInterval); - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig($modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig); + $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval( + $modelDeploymentMonitoringScheduleConfigMonitorInterval + ); + $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig( + $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig + ); $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy(); $modelDeploymentMonitoringJob->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy); $updateMask = new FieldMask(); @@ -3162,12 +3284,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -3194,9 +3319,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -3226,12 +3349,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -3264,8 +3390,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3289,17 +3414,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -3331,9 +3458,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3359,19 +3484,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -3399,9 +3525,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3427,19 +3551,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -3466,8 +3591,7 @@ public function cancelBatchPredictionJobAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $request = (new CancelBatchPredictionJobRequest()) - ->setName($formattedName); + $request = (new CancelBatchPredictionJobRequest())->setName($formattedName); $gapicClient->cancelBatchPredictionJobAsync($request)->wait(); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); diff --git a/AiPlatform/tests/Unit/V1/Client/LlmUtilityServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/LlmUtilityServiceClientTest.php index dbae1163398d..26e8ed46af9c 100644 --- a/AiPlatform/tests/Unit/V1/Client/LlmUtilityServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/LlmUtilityServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return LlmUtilityServiceClient */ @@ -85,9 +87,7 @@ public function computeTokensTest() // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $instances = []; - $request = (new ComputeTokensRequest()) - ->setEndpoint($formattedEndpoint) - ->setInstances($instances); + $request = (new ComputeTokensRequest())->setEndpoint($formattedEndpoint)->setInstances($instances); $response = $gapicClient->computeTokens($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -113,19 +113,20 @@ public function computeTokensExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $instances = []; - $request = (new ComputeTokensRequest()) - ->setEndpoint($formattedEndpoint) - ->setInstances($instances); + $request = (new ComputeTokensRequest())->setEndpoint($formattedEndpoint)->setInstances($instances); try { $gapicClient->computeTokens($request); // If the $gapicClient method call did not throw, fail the test @@ -193,12 +194,15 @@ public function countTokensExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); @@ -262,12 +266,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -294,9 +301,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -326,12 +331,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -364,8 +372,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -389,17 +396,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -431,9 +440,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -459,19 +466,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -499,9 +507,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -527,19 +533,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -567,9 +574,7 @@ public function computeTokensAsyncTest() // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $instances = []; - $request = (new ComputeTokensRequest()) - ->setEndpoint($formattedEndpoint) - ->setInstances($instances); + $request = (new ComputeTokensRequest())->setEndpoint($formattedEndpoint)->setInstances($instances); $response = $gapicClient->computeTokensAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/AiPlatform/tests/Unit/V1/Client/MatchServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/MatchServiceClientTest.php index 9fb91d59ad84..bde5187350e7 100644 --- a/AiPlatform/tests/Unit/V1/Client/MatchServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/MatchServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return MatchServiceClient */ @@ -84,8 +86,7 @@ public function findNeighborsTest() $transport->addResponse($expectedResponse); // Mock request $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $request = (new FindNeighborsRequest()) - ->setIndexEndpoint($formattedIndexEndpoint); + $request = (new FindNeighborsRequest())->setIndexEndpoint($formattedIndexEndpoint); $response = $gapicClient->findNeighbors($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -109,17 +110,19 @@ public function findNeighborsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $request = (new FindNeighborsRequest()) - ->setIndexEndpoint($formattedIndexEndpoint); + $request = (new FindNeighborsRequest())->setIndexEndpoint($formattedIndexEndpoint); try { $gapicClient->findNeighbors($request); // If the $gapicClient method call did not throw, fail the test @@ -146,8 +149,7 @@ public function readIndexDatapointsTest() $transport->addResponse($expectedResponse); // Mock request $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $request = (new ReadIndexDatapointsRequest()) - ->setIndexEndpoint($formattedIndexEndpoint); + $request = (new ReadIndexDatapointsRequest())->setIndexEndpoint($formattedIndexEndpoint); $response = $gapicClient->readIndexDatapoints($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -171,17 +173,19 @@ public function readIndexDatapointsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $request = (new ReadIndexDatapointsRequest()) - ->setIndexEndpoint($formattedIndexEndpoint); + $request = (new ReadIndexDatapointsRequest())->setIndexEndpoint($formattedIndexEndpoint); try { $gapicClient->readIndexDatapoints($request); // If the $gapicClient method call did not throw, fail the test @@ -234,12 +238,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -266,9 +273,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -298,12 +303,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -336,8 +344,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -361,17 +368,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -403,9 +412,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -431,19 +438,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -471,9 +479,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -499,19 +505,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -538,8 +545,7 @@ public function findNeighborsAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $request = (new FindNeighborsRequest()) - ->setIndexEndpoint($formattedIndexEndpoint); + $request = (new FindNeighborsRequest())->setIndexEndpoint($formattedIndexEndpoint); $response = $gapicClient->findNeighborsAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/AiPlatform/tests/Unit/V1/Client/MetadataServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/MetadataServiceClientTest.php index 71c07963bd86..932f3063741e 100644 --- a/AiPlatform/tests/Unit/V1/Client/MetadataServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/MetadataServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return MetadataServiceClient */ @@ -135,15 +137,17 @@ public function addContextArtifactsAndExecutionsTest() $transport->addResponse($expectedResponse); // Mock request $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new AddContextArtifactsAndExecutionsRequest()) - ->setContext($formattedContext); + $request = (new AddContextArtifactsAndExecutionsRequest())->setContext($formattedContext); $response = $gapicClient->addContextArtifactsAndExecutions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/AddContextArtifactsAndExecutions', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.MetadataService/AddContextArtifactsAndExecutions', + $actualFuncCall + ); $actualValue = $actualRequestObject->getContext(); $this->assertProtobufEquals($formattedContext, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -160,17 +164,19 @@ public function addContextArtifactsAndExecutionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new AddContextArtifactsAndExecutionsRequest()) - ->setContext($formattedContext); + $request = (new AddContextArtifactsAndExecutionsRequest())->setContext($formattedContext); try { $gapicClient->addContextArtifactsAndExecutions($request); // If the $gapicClient method call did not throw, fail the test @@ -197,8 +203,7 @@ public function addContextChildrenTest() $transport->addResponse($expectedResponse); // Mock request $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new AddContextChildrenRequest()) - ->setContext($formattedContext); + $request = (new AddContextChildrenRequest())->setContext($formattedContext); $response = $gapicClient->addContextChildren($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -222,17 +227,19 @@ public function addContextChildrenExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new AddContextChildrenRequest()) - ->setContext($formattedContext); + $request = (new AddContextChildrenRequest())->setContext($formattedContext); try { $gapicClient->addContextChildren($request); // If the $gapicClient method call did not throw, fail the test @@ -259,8 +266,7 @@ public function addExecutionEventsTest() $transport->addResponse($expectedResponse); // Mock request $formattedExecution = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $request = (new AddExecutionEventsRequest()) - ->setExecution($formattedExecution); + $request = (new AddExecutionEventsRequest())->setExecution($formattedExecution); $response = $gapicClient->addExecutionEvents($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -284,17 +290,19 @@ public function addExecutionEventsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedExecution = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $request = (new AddExecutionEventsRequest()) - ->setExecution($formattedExecution); + $request = (new AddExecutionEventsRequest())->setExecution($formattedExecution); try { $gapicClient->addExecutionEvents($request); // If the $gapicClient method call did not throw, fail the test @@ -336,9 +344,7 @@ public function createArtifactTest() // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $artifact = new Artifact(); - $request = (new CreateArtifactRequest()) - ->setParent($formattedParent) - ->setArtifact($artifact); + $request = (new CreateArtifactRequest())->setParent($formattedParent)->setArtifact($artifact); $response = $gapicClient->createArtifact($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -364,19 +370,20 @@ public function createArtifactExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $artifact = new Artifact(); - $request = (new CreateArtifactRequest()) - ->setParent($formattedParent) - ->setArtifact($artifact); + $request = (new CreateArtifactRequest())->setParent($formattedParent)->setArtifact($artifact); try { $gapicClient->createArtifact($request); // If the $gapicClient method call did not throw, fail the test @@ -416,9 +423,7 @@ public function createContextTest() // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $context = new Context(); - $request = (new CreateContextRequest()) - ->setParent($formattedParent) - ->setContext($context); + $request = (new CreateContextRequest())->setParent($formattedParent)->setContext($context); $response = $gapicClient->createContext($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -444,19 +449,20 @@ public function createContextExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $context = new Context(); - $request = (new CreateContextRequest()) - ->setParent($formattedParent) - ->setContext($context); + $request = (new CreateContextRequest())->setParent($formattedParent)->setContext($context); try { $gapicClient->createContext($request); // If the $gapicClient method call did not throw, fail the test @@ -496,9 +502,7 @@ public function createExecutionTest() // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $execution = new Execution(); - $request = (new CreateExecutionRequest()) - ->setParent($formattedParent) - ->setExecution($execution); + $request = (new CreateExecutionRequest())->setParent($formattedParent)->setExecution($execution); $response = $gapicClient->createExecution($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -524,19 +528,20 @@ public function createExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $execution = new Execution(); - $request = (new CreateExecutionRequest()) - ->setParent($formattedParent) - ->setExecution($execution); + $request = (new CreateExecutionRequest())->setParent($formattedParent)->setExecution($execution); try { $gapicClient->createExecution($request); // If the $gapicClient method call did not throw, fail the test @@ -574,9 +579,7 @@ public function createMetadataSchemaTest() $metadataSchema = new MetadataSchema(); $metadataSchemaSchema = 'metadataSchemaSchema-249734287'; $metadataSchema->setSchema($metadataSchemaSchema); - $request = (new CreateMetadataSchemaRequest()) - ->setParent($formattedParent) - ->setMetadataSchema($metadataSchema); + $request = (new CreateMetadataSchemaRequest())->setParent($formattedParent)->setMetadataSchema($metadataSchema); $response = $gapicClient->createMetadataSchema($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -602,21 +605,22 @@ public function createMetadataSchemaExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $metadataSchema = new MetadataSchema(); $metadataSchemaSchema = 'metadataSchemaSchema-249734287'; $metadataSchema->setSchema($metadataSchemaSchema); - $request = (new CreateMetadataSchemaRequest()) - ->setParent($formattedParent) - ->setMetadataSchema($metadataSchema); + $request = (new CreateMetadataSchemaRequest())->setParent($formattedParent)->setMetadataSchema($metadataSchema); try { $gapicClient->createMetadataSchema($request); // If the $gapicClient method call did not throw, fail the test @@ -666,9 +670,7 @@ public function createMetadataStoreTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $metadataStore = new MetadataStore(); - $request = (new CreateMetadataStoreRequest()) - ->setParent($formattedParent) - ->setMetadataStore($metadataStore); + $request = (new CreateMetadataStoreRequest())->setParent($formattedParent)->setMetadataStore($metadataStore); $response = $gapicClient->createMetadataStore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -726,19 +728,20 @@ public function createMetadataStoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $metadataStore = new MetadataStore(); - $request = (new CreateMetadataStoreRequest()) - ->setParent($formattedParent) - ->setMetadataStore($metadataStore); + $request = (new CreateMetadataStoreRequest())->setParent($formattedParent)->setMetadataStore($metadataStore); $response = $gapicClient->createMetadataStore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -792,8 +795,7 @@ public function deleteArtifactTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $request = (new DeleteArtifactRequest()) - ->setName($formattedName); + $request = (new DeleteArtifactRequest())->setName($formattedName); $response = $gapicClient->deleteArtifact($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -849,17 +851,19 @@ public function deleteArtifactExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $request = (new DeleteArtifactRequest()) - ->setName($formattedName); + $request = (new DeleteArtifactRequest())->setName($formattedName); $response = $gapicClient->deleteArtifact($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -913,8 +917,7 @@ public function deleteContextTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new DeleteContextRequest()) - ->setName($formattedName); + $request = (new DeleteContextRequest())->setName($formattedName); $response = $gapicClient->deleteContext($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -970,17 +973,19 @@ public function deleteContextExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new DeleteContextRequest()) - ->setName($formattedName); + $request = (new DeleteContextRequest())->setName($formattedName); $response = $gapicClient->deleteContext($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1034,8 +1039,7 @@ public function deleteExecutionTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $request = (new DeleteExecutionRequest()) - ->setName($formattedName); + $request = (new DeleteExecutionRequest())->setName($formattedName); $response = $gapicClient->deleteExecution($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1091,17 +1095,19 @@ public function deleteExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $request = (new DeleteExecutionRequest()) - ->setName($formattedName); + $request = (new DeleteExecutionRequest())->setName($formattedName); $response = $gapicClient->deleteExecution($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1155,8 +1161,7 @@ public function deleteMetadataStoreTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new DeleteMetadataStoreRequest()) - ->setName($formattedName); + $request = (new DeleteMetadataStoreRequest())->setName($formattedName); $response = $gapicClient->deleteMetadataStore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1212,17 +1217,19 @@ public function deleteMetadataStoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new DeleteMetadataStoreRequest()) - ->setName($formattedName); + $request = (new DeleteMetadataStoreRequest())->setName($formattedName); $response = $gapicClient->deleteMetadataStore($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1272,8 +1279,7 @@ public function getArtifactTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $request = (new GetArtifactRequest()) - ->setName($formattedName); + $request = (new GetArtifactRequest())->setName($formattedName); $response = $gapicClient->getArtifact($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1297,17 +1303,19 @@ public function getArtifactExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $request = (new GetArtifactRequest()) - ->setName($formattedName); + $request = (new GetArtifactRequest())->setName($formattedName); try { $gapicClient->getArtifact($request); // If the $gapicClient method call did not throw, fail the test @@ -1346,8 +1354,7 @@ public function getContextTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new GetContextRequest()) - ->setName($formattedName); + $request = (new GetContextRequest())->setName($formattedName); $response = $gapicClient->getContext($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1371,17 +1378,19 @@ public function getContextExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new GetContextRequest()) - ->setName($formattedName); + $request = (new GetContextRequest())->setName($formattedName); try { $gapicClient->getContext($request); // If the $gapicClient method call did not throw, fail the test @@ -1420,8 +1429,7 @@ public function getExecutionTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); + $request = (new GetExecutionRequest())->setName($formattedName); $response = $gapicClient->getExecution($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1445,17 +1453,19 @@ public function getExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); + $request = (new GetExecutionRequest())->setName($formattedName); try { $gapicClient->getExecution($request); // If the $gapicClient method call did not throw, fail the test @@ -1489,9 +1499,13 @@ public function getMetadataSchemaTest() $expectedResponse->setDescription($description); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->metadataSchemaName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[METADATA_SCHEMA]'); - $request = (new GetMetadataSchemaRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->metadataSchemaName( + '[PROJECT]', + '[LOCATION]', + '[METADATA_STORE]', + '[METADATA_SCHEMA]' + ); + $request = (new GetMetadataSchemaRequest())->setName($formattedName); $response = $gapicClient->getMetadataSchema($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1515,17 +1529,24 @@ public function getMetadataSchemaExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->metadataSchemaName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[METADATA_SCHEMA]'); - $request = (new GetMetadataSchemaRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->metadataSchemaName( + '[PROJECT]', + '[LOCATION]', + '[METADATA_STORE]', + '[METADATA_SCHEMA]' + ); + $request = (new GetMetadataSchemaRequest())->setName($formattedName); try { $gapicClient->getMetadataSchema($request); // If the $gapicClient method call did not throw, fail the test @@ -1556,8 +1577,7 @@ public function getMetadataStoreTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new GetMetadataStoreRequest()) - ->setName($formattedName); + $request = (new GetMetadataStoreRequest())->setName($formattedName); $response = $gapicClient->getMetadataStore($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1581,17 +1601,19 @@ public function getMetadataStoreExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new GetMetadataStoreRequest()) - ->setName($formattedName); + $request = (new GetMetadataStoreRequest())->setName($formattedName); try { $gapicClient->getMetadataStore($request); // If the $gapicClient method call did not throw, fail the test @@ -1616,17 +1638,14 @@ public function listArtifactsTest() // Mock response $nextPageToken = ''; $artifactsElement = new Artifact(); - $artifacts = [ - $artifactsElement, - ]; + $artifacts = [$artifactsElement]; $expectedResponse = new ListArtifactsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setArtifacts($artifacts); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new ListArtifactsRequest()) - ->setParent($formattedParent); + $request = (new ListArtifactsRequest())->setParent($formattedParent); $response = $gapicClient->listArtifacts($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1653,17 +1672,19 @@ public function listArtifactsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new ListArtifactsRequest()) - ->setParent($formattedParent); + $request = (new ListArtifactsRequest())->setParent($formattedParent); try { $gapicClient->listArtifacts($request); // If the $gapicClient method call did not throw, fail the test @@ -1688,17 +1709,14 @@ public function listContextsTest() // Mock response $nextPageToken = ''; $contextsElement = new Context(); - $contexts = [ - $contextsElement, - ]; + $contexts = [$contextsElement]; $expectedResponse = new ListContextsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setContexts($contexts); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new ListContextsRequest()) - ->setParent($formattedParent); + $request = (new ListContextsRequest())->setParent($formattedParent); $response = $gapicClient->listContexts($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1725,17 +1743,19 @@ public function listContextsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new ListContextsRequest()) - ->setParent($formattedParent); + $request = (new ListContextsRequest())->setParent($formattedParent); try { $gapicClient->listContexts($request); // If the $gapicClient method call did not throw, fail the test @@ -1760,17 +1780,14 @@ public function listExecutionsTest() // Mock response $nextPageToken = ''; $executionsElement = new Execution(); - $executions = [ - $executionsElement, - ]; + $executions = [$executionsElement]; $expectedResponse = new ListExecutionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setExecutions($executions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); + $request = (new ListExecutionsRequest())->setParent($formattedParent); $response = $gapicClient->listExecutions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1797,17 +1814,19 @@ public function listExecutionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); + $request = (new ListExecutionsRequest())->setParent($formattedParent); try { $gapicClient->listExecutions($request); // If the $gapicClient method call did not throw, fail the test @@ -1832,17 +1851,14 @@ public function listMetadataSchemasTest() // Mock response $nextPageToken = ''; $metadataSchemasElement = new MetadataSchema(); - $metadataSchemas = [ - $metadataSchemasElement, - ]; + $metadataSchemas = [$metadataSchemasElement]; $expectedResponse = new ListMetadataSchemasResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMetadataSchemas($metadataSchemas); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new ListMetadataSchemasRequest()) - ->setParent($formattedParent); + $request = (new ListMetadataSchemasRequest())->setParent($formattedParent); $response = $gapicClient->listMetadataSchemas($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1869,17 +1885,19 @@ public function listMetadataSchemasExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $request = (new ListMetadataSchemasRequest()) - ->setParent($formattedParent); + $request = (new ListMetadataSchemasRequest())->setParent($formattedParent); try { $gapicClient->listMetadataSchemas($request); // If the $gapicClient method call did not throw, fail the test @@ -1904,17 +1922,14 @@ public function listMetadataStoresTest() // Mock response $nextPageToken = ''; $metadataStoresElement = new MetadataStore(); - $metadataStores = [ - $metadataStoresElement, - ]; + $metadataStores = [$metadataStoresElement]; $expectedResponse = new ListMetadataStoresResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMetadataStores($metadataStores); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListMetadataStoresRequest()) - ->setParent($formattedParent); + $request = (new ListMetadataStoresRequest())->setParent($formattedParent); $response = $gapicClient->listMetadataStores($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1941,17 +1956,19 @@ public function listMetadataStoresExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListMetadataStoresRequest()) - ->setParent($formattedParent); + $request = (new ListMetadataStoresRequest())->setParent($formattedParent); try { $gapicClient->listMetadataStores($request); // If the $gapicClient method call did not throw, fail the test @@ -1999,9 +2016,7 @@ public function purgeArtifactsTest() // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $filter = 'filter-1274492040'; - $request = (new PurgeArtifactsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); + $request = (new PurgeArtifactsRequest())->setParent($formattedParent)->setFilter($filter); $response = $gapicClient->purgeArtifacts($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2059,19 +2074,20 @@ public function purgeArtifactsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $filter = 'filter-1274492040'; - $request = (new PurgeArtifactsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); + $request = (new PurgeArtifactsRequest())->setParent($formattedParent)->setFilter($filter); $response = $gapicClient->purgeArtifacts($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2128,9 +2144,7 @@ public function purgeContextsTest() // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $filter = 'filter-1274492040'; - $request = (new PurgeContextsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); + $request = (new PurgeContextsRequest())->setParent($formattedParent)->setFilter($filter); $response = $gapicClient->purgeContexts($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2188,19 +2202,20 @@ public function purgeContextsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $filter = 'filter-1274492040'; - $request = (new PurgeContextsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); + $request = (new PurgeContextsRequest())->setParent($formattedParent)->setFilter($filter); $response = $gapicClient->purgeContexts($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2257,9 +2272,7 @@ public function purgeExecutionsTest() // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $filter = 'filter-1274492040'; - $request = (new PurgeExecutionsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); + $request = (new PurgeExecutionsRequest())->setParent($formattedParent)->setFilter($filter); $response = $gapicClient->purgeExecutions($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2317,19 +2330,20 @@ public function purgeExecutionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); $filter = 'filter-1274492040'; - $request = (new PurgeExecutionsRequest()) - ->setParent($formattedParent) - ->setFilter($filter); + $request = (new PurgeExecutionsRequest())->setParent($formattedParent)->setFilter($filter); $response = $gapicClient->purgeExecutions($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2365,8 +2379,7 @@ public function queryArtifactLineageSubgraphTest() $transport->addResponse($expectedResponse); // Mock request $formattedArtifact = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $request = (new QueryArtifactLineageSubgraphRequest()) - ->setArtifact($formattedArtifact); + $request = (new QueryArtifactLineageSubgraphRequest())->setArtifact($formattedArtifact); $response = $gapicClient->queryArtifactLineageSubgraph($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2390,17 +2403,19 @@ public function queryArtifactLineageSubgraphExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedArtifact = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $request = (new QueryArtifactLineageSubgraphRequest()) - ->setArtifact($formattedArtifact); + $request = (new QueryArtifactLineageSubgraphRequest())->setArtifact($formattedArtifact); try { $gapicClient->queryArtifactLineageSubgraph($request); // If the $gapicClient method call did not throw, fail the test @@ -2427,8 +2442,7 @@ public function queryContextLineageSubgraphTest() $transport->addResponse($expectedResponse); // Mock request $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new QueryContextLineageSubgraphRequest()) - ->setContext($formattedContext); + $request = (new QueryContextLineageSubgraphRequest())->setContext($formattedContext); $response = $gapicClient->queryContextLineageSubgraph($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2452,17 +2466,19 @@ public function queryContextLineageSubgraphExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new QueryContextLineageSubgraphRequest()) - ->setContext($formattedContext); + $request = (new QueryContextLineageSubgraphRequest())->setContext($formattedContext); try { $gapicClient->queryContextLineageSubgraph($request); // If the $gapicClient method call did not throw, fail the test @@ -2489,15 +2505,17 @@ public function queryExecutionInputsAndOutputsTest() $transport->addResponse($expectedResponse); // Mock request $formattedExecution = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $request = (new QueryExecutionInputsAndOutputsRequest()) - ->setExecution($formattedExecution); + $request = (new QueryExecutionInputsAndOutputsRequest())->setExecution($formattedExecution); $response = $gapicClient->queryExecutionInputsAndOutputs($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/QueryExecutionInputsAndOutputs', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.MetadataService/QueryExecutionInputsAndOutputs', + $actualFuncCall + ); $actualValue = $actualRequestObject->getExecution(); $this->assertProtobufEquals($formattedExecution, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -2514,17 +2532,19 @@ public function queryExecutionInputsAndOutputsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedExecution = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $request = (new QueryExecutionInputsAndOutputsRequest()) - ->setExecution($formattedExecution); + $request = (new QueryExecutionInputsAndOutputsRequest())->setExecution($formattedExecution); try { $gapicClient->queryExecutionInputsAndOutputs($request); // If the $gapicClient method call did not throw, fail the test @@ -2551,8 +2571,7 @@ public function removeContextChildrenTest() $transport->addResponse($expectedResponse); // Mock request $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new RemoveContextChildrenRequest()) - ->setContext($formattedContext); + $request = (new RemoveContextChildrenRequest())->setContext($formattedContext); $response = $gapicClient->removeContextChildren($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2576,17 +2595,19 @@ public function removeContextChildrenExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new RemoveContextChildrenRequest()) - ->setContext($formattedContext); + $request = (new RemoveContextChildrenRequest())->setContext($formattedContext); try { $gapicClient->removeContextChildren($request); // If the $gapicClient method call did not throw, fail the test @@ -2627,8 +2648,7 @@ public function updateArtifactTest() $transport->addResponse($expectedResponse); // Mock request $artifact = new Artifact(); - $request = (new UpdateArtifactRequest()) - ->setArtifact($artifact); + $request = (new UpdateArtifactRequest())->setArtifact($artifact); $response = $gapicClient->updateArtifact($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2652,17 +2672,19 @@ public function updateArtifactExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $artifact = new Artifact(); - $request = (new UpdateArtifactRequest()) - ->setArtifact($artifact); + $request = (new UpdateArtifactRequest())->setArtifact($artifact); try { $gapicClient->updateArtifact($request); // If the $gapicClient method call did not throw, fail the test @@ -2701,8 +2723,7 @@ public function updateContextTest() $transport->addResponse($expectedResponse); // Mock request $context = new Context(); - $request = (new UpdateContextRequest()) - ->setContext($context); + $request = (new UpdateContextRequest())->setContext($context); $response = $gapicClient->updateContext($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2726,17 +2747,19 @@ public function updateContextExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $context = new Context(); - $request = (new UpdateContextRequest()) - ->setContext($context); + $request = (new UpdateContextRequest())->setContext($context); try { $gapicClient->updateContext($request); // If the $gapicClient method call did not throw, fail the test @@ -2775,8 +2798,7 @@ public function updateExecutionTest() $transport->addResponse($expectedResponse); // Mock request $execution = new Execution(); - $request = (new UpdateExecutionRequest()) - ->setExecution($execution); + $request = (new UpdateExecutionRequest())->setExecution($execution); $response = $gapicClient->updateExecution($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2800,17 +2822,19 @@ public function updateExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $execution = new Execution(); - $request = (new UpdateExecutionRequest()) - ->setExecution($execution); + $request = (new UpdateExecutionRequest())->setExecution($execution); try { $gapicClient->updateExecution($request); // If the $gapicClient method call did not throw, fail the test @@ -2863,12 +2887,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -2895,9 +2922,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -2927,12 +2952,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -2965,8 +2993,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2990,17 +3017,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -3032,9 +3061,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3060,19 +3087,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -3100,9 +3128,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3128,19 +3154,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -3167,15 +3194,17 @@ public function addContextArtifactsAndExecutionsAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $request = (new AddContextArtifactsAndExecutionsRequest()) - ->setContext($formattedContext); + $request = (new AddContextArtifactsAndExecutionsRequest())->setContext($formattedContext); $response = $gapicClient->addContextArtifactsAndExecutionsAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/AddContextArtifactsAndExecutions', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.MetadataService/AddContextArtifactsAndExecutions', + $actualFuncCall + ); $actualValue = $actualRequestObject->getContext(); $this->assertProtobufEquals($formattedContext, $actualValue); $this->assertTrue($transport->isExhausted()); diff --git a/AiPlatform/tests/Unit/V1/Client/MigrationServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/MigrationServiceClientTest.php index 8a3817d32220..d400c757da71 100644 --- a/AiPlatform/tests/Unit/V1/Client/MigrationServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/MigrationServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return MigrationServiceClient */ @@ -168,12 +170,15 @@ public function batchMigrateResourcesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -214,17 +219,14 @@ public function searchMigratableResourcesTest() // Mock response $nextPageToken = ''; $migratableResourcesElement = new MigratableResource(); - $migratableResources = [ - $migratableResourcesElement, - ]; + $migratableResources = [$migratableResourcesElement]; $expectedResponse = new SearchMigratableResourcesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMigratableResources($migratableResources); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new SearchMigratableResourcesRequest()) - ->setParent($formattedParent); + $request = (new SearchMigratableResourcesRequest())->setParent($formattedParent); $response = $gapicClient->searchMigratableResources($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -251,17 +253,19 @@ public function searchMigratableResourcesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new SearchMigratableResourcesRequest()) - ->setParent($formattedParent); + $request = (new SearchMigratableResourcesRequest())->setParent($formattedParent); try { $gapicClient->searchMigratableResources($request); // If the $gapicClient method call did not throw, fail the test @@ -314,12 +318,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -346,9 +353,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -378,12 +383,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -416,8 +424,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -441,17 +448,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -483,9 +492,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -511,19 +518,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -551,9 +559,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -579,19 +585,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test diff --git a/AiPlatform/tests/Unit/V1/Client/ModelGardenServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/ModelGardenServiceClientTest.php index 066646cb2261..330de89e4e88 100644 --- a/AiPlatform/tests/Unit/V1/Client/ModelGardenServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/ModelGardenServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ModelGardenServiceClient */ @@ -88,8 +90,7 @@ public function getPublisherModelTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->publisherModelName('[PUBLISHER]', '[MODEL]'); - $request = (new GetPublisherModelRequest()) - ->setName($formattedName); + $request = (new GetPublisherModelRequest())->setName($formattedName); $response = $gapicClient->getPublisherModel($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -113,17 +114,19 @@ public function getPublisherModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->publisherModelName('[PUBLISHER]', '[MODEL]'); - $request = (new GetPublisherModelRequest()) - ->setName($formattedName); + $request = (new GetPublisherModelRequest())->setName($formattedName); try { $gapicClient->getPublisherModel($request); // If the $gapicClient method call did not throw, fail the test @@ -176,12 +179,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -208,9 +214,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -240,12 +244,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -278,8 +285,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -303,17 +309,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -345,9 +353,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -373,19 +379,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -413,9 +420,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -441,19 +446,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -486,8 +492,7 @@ public function getPublisherModelAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->publisherModelName('[PUBLISHER]', '[MODEL]'); - $request = (new GetPublisherModelRequest()) - ->setName($formattedName); + $request = (new GetPublisherModelRequest())->setName($formattedName); $response = $gapicClient->getPublisherModelAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/AiPlatform/tests/Unit/V1/Client/ModelServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/ModelServiceClientTest.php index f54ecc36feaf..7815ca97ac96 100644 --- a/AiPlatform/tests/Unit/V1/Client/ModelServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/ModelServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ModelServiceClient */ @@ -119,7 +121,13 @@ public function batchImportEvaluatedAnnotationsTest() $expectedResponse->setImportedEvaluatedAnnotationsCount($importedEvaluatedAnnotationsCount); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); + $formattedParent = $gapicClient->modelEvaluationSliceName( + '[PROJECT]', + '[LOCATION]', + '[MODEL]', + '[EVALUATION]', + '[SLICE]' + ); $evaluatedAnnotations = []; $request = (new BatchImportEvaluatedAnnotationsRequest()) ->setParent($formattedParent) @@ -149,15 +157,24 @@ public function batchImportEvaluatedAnnotationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); + $formattedParent = $gapicClient->modelEvaluationSliceName( + '[PROJECT]', + '[LOCATION]', + '[MODEL]', + '[EVALUATION]', + '[SLICE]' + ); $evaluatedAnnotations = []; $request = (new BatchImportEvaluatedAnnotationsRequest()) ->setParent($formattedParent) @@ -217,12 +234,15 @@ public function batchImportModelEvaluationSlicesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); @@ -279,9 +299,7 @@ public function copyModelTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $formattedSourceModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new CopyModelRequest()) - ->setParent($formattedParent) - ->setSourceModel($formattedSourceModel); + $request = (new CopyModelRequest())->setParent($formattedParent)->setSourceModel($formattedSourceModel); $response = $gapicClient->copyModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -339,19 +357,20 @@ public function copyModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $formattedSourceModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new CopyModelRequest()) - ->setParent($formattedParent) - ->setSourceModel($formattedSourceModel); + $request = (new CopyModelRequest())->setParent($formattedParent)->setSourceModel($formattedSourceModel); $response = $gapicClient->copyModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -405,8 +424,7 @@ public function deleteModelTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new DeleteModelRequest()) - ->setName($formattedName); + $request = (new DeleteModelRequest())->setName($formattedName); $response = $gapicClient->deleteModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -462,17 +480,19 @@ public function deleteModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new DeleteModelRequest()) - ->setName($formattedName); + $request = (new DeleteModelRequest())->setName($formattedName); $response = $gapicClient->deleteModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -526,8 +546,7 @@ public function deleteModelVersionTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new DeleteModelVersionRequest()) - ->setName($formattedName); + $request = (new DeleteModelVersionRequest())->setName($formattedName); $response = $gapicClient->deleteModelVersion($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -583,17 +602,19 @@ public function deleteModelVersionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new DeleteModelVersionRequest()) - ->setName($formattedName); + $request = (new DeleteModelVersionRequest())->setName($formattedName); $response = $gapicClient->deleteModelVersion($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -648,9 +669,7 @@ public function exportModelTest() // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); $outputConfig = new OutputConfig(); - $request = (new ExportModelRequest()) - ->setName($formattedName) - ->setOutputConfig($outputConfig); + $request = (new ExportModelRequest())->setName($formattedName)->setOutputConfig($outputConfig); $response = $gapicClient->exportModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -708,19 +727,20 @@ public function exportModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); $outputConfig = new OutputConfig(); - $request = (new ExportModelRequest()) - ->setName($formattedName) - ->setOutputConfig($outputConfig); + $request = (new ExportModelRequest())->setName($formattedName)->setOutputConfig($outputConfig); $response = $gapicClient->exportModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -778,8 +798,7 @@ public function getModelTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new GetModelRequest()) - ->setName($formattedName); + $request = (new GetModelRequest())->setName($formattedName); $response = $gapicClient->getModel($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -803,17 +822,19 @@ public function getModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new GetModelRequest()) - ->setName($formattedName); + $request = (new GetModelRequest())->setName($formattedName); try { $gapicClient->getModel($request); // If the $gapicClient method call did not throw, fail the test @@ -850,8 +871,7 @@ public function getModelEvaluationTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - $request = (new GetModelEvaluationRequest()) - ->setName($formattedName); + $request = (new GetModelEvaluationRequest())->setName($formattedName); $response = $gapicClient->getModelEvaluation($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -875,17 +895,19 @@ public function getModelEvaluationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - $request = (new GetModelEvaluationRequest()) - ->setName($formattedName); + $request = (new GetModelEvaluationRequest())->setName($formattedName); try { $gapicClient->getModelEvaluation($request); // If the $gapicClient method call did not throw, fail the test @@ -915,9 +937,14 @@ public function getModelEvaluationSliceTest() $expectedResponse->setMetricsSchemaUri($metricsSchemaUri); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); - $request = (new GetModelEvaluationSliceRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelEvaluationSliceName( + '[PROJECT]', + '[LOCATION]', + '[MODEL]', + '[EVALUATION]', + '[SLICE]' + ); + $request = (new GetModelEvaluationSliceRequest())->setName($formattedName); $response = $gapicClient->getModelEvaluationSlice($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -941,17 +968,25 @@ public function getModelEvaluationSliceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); - $request = (new GetModelEvaluationSliceRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->modelEvaluationSliceName( + '[PROJECT]', + '[LOCATION]', + '[MODEL]', + '[EVALUATION]', + '[SLICE]' + ); + $request = (new GetModelEvaluationSliceRequest())->setName($formattedName); try { $gapicClient->getModelEvaluationSlice($request); // If the $gapicClient method call did not throw, fail the test @@ -1017,12 +1052,15 @@ public function importModelEvaluationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); @@ -1054,17 +1092,14 @@ public function listModelEvaluationSlicesTest() // Mock response $nextPageToken = ''; $modelEvaluationSlicesElement = new ModelEvaluationSlice(); - $modelEvaluationSlices = [ - $modelEvaluationSlicesElement, - ]; + $modelEvaluationSlices = [$modelEvaluationSlicesElement]; $expectedResponse = new ListModelEvaluationSlicesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setModelEvaluationSlices($modelEvaluationSlices); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - $request = (new ListModelEvaluationSlicesRequest()) - ->setParent($formattedParent); + $request = (new ListModelEvaluationSlicesRequest())->setParent($formattedParent); $response = $gapicClient->listModelEvaluationSlices($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1091,17 +1126,19 @@ public function listModelEvaluationSlicesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - $request = (new ListModelEvaluationSlicesRequest()) - ->setParent($formattedParent); + $request = (new ListModelEvaluationSlicesRequest())->setParent($formattedParent); try { $gapicClient->listModelEvaluationSlices($request); // If the $gapicClient method call did not throw, fail the test @@ -1126,17 +1163,14 @@ public function listModelEvaluationsTest() // Mock response $nextPageToken = ''; $modelEvaluationsElement = new ModelEvaluation(); - $modelEvaluations = [ - $modelEvaluationsElement, - ]; + $modelEvaluations = [$modelEvaluationsElement]; $expectedResponse = new ListModelEvaluationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setModelEvaluations($modelEvaluations); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new ListModelEvaluationsRequest()) - ->setParent($formattedParent); + $request = (new ListModelEvaluationsRequest())->setParent($formattedParent); $response = $gapicClient->listModelEvaluations($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1163,17 +1197,19 @@ public function listModelEvaluationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new ListModelEvaluationsRequest()) - ->setParent($formattedParent); + $request = (new ListModelEvaluationsRequest())->setParent($formattedParent); try { $gapicClient->listModelEvaluations($request); // If the $gapicClient method call did not throw, fail the test @@ -1198,17 +1234,14 @@ public function listModelVersionsTest() // Mock response $nextPageToken = ''; $modelsElement = new Model(); - $models = [ - $modelsElement, - ]; + $models = [$modelsElement]; $expectedResponse = new ListModelVersionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setModels($models); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new ListModelVersionsRequest()) - ->setName($formattedName); + $request = (new ListModelVersionsRequest())->setName($formattedName); $response = $gapicClient->listModelVersions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1235,17 +1268,19 @@ public function listModelVersionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new ListModelVersionsRequest()) - ->setName($formattedName); + $request = (new ListModelVersionsRequest())->setName($formattedName); try { $gapicClient->listModelVersions($request); // If the $gapicClient method call did not throw, fail the test @@ -1270,17 +1305,14 @@ public function listModelsTest() // Mock response $nextPageToken = ''; $modelsElement = new Model(); - $models = [ - $modelsElement, - ]; + $models = [$modelsElement]; $expectedResponse = new ListModelsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setModels($models); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListModelsRequest()) - ->setParent($formattedParent); + $request = (new ListModelsRequest())->setParent($formattedParent); $response = $gapicClient->listModels($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1307,17 +1339,19 @@ public function listModelsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListModelsRequest()) - ->setParent($formattedParent); + $request = (new ListModelsRequest())->setParent($formattedParent); try { $gapicClient->listModels($request); // If the $gapicClient method call did not throw, fail the test @@ -1367,9 +1401,7 @@ public function mergeVersionAliasesTest() // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); $versionAliases = []; - $request = (new MergeVersionAliasesRequest()) - ->setName($formattedName) - ->setVersionAliases($versionAliases); + $request = (new MergeVersionAliasesRequest())->setName($formattedName)->setVersionAliases($versionAliases); $response = $gapicClient->mergeVersionAliases($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1395,19 +1427,20 @@ public function mergeVersionAliasesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); $versionAliases = []; - $request = (new MergeVersionAliasesRequest()) - ->setName($formattedName) - ->setVersionAliases($versionAliases); + $request = (new MergeVersionAliasesRequest())->setName($formattedName)->setVersionAliases($versionAliases); try { $gapicClient->mergeVersionAliases($request); // If the $gapicClient method call did not throw, fail the test @@ -1452,8 +1485,7 @@ public function updateExplanationDatasetTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new UpdateExplanationDatasetRequest()) - ->setModel($formattedModel); + $request = (new UpdateExplanationDatasetRequest())->setModel($formattedModel); $response = $gapicClient->updateExplanationDataset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1509,17 +1541,19 @@ public function updateExplanationDatasetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $request = (new UpdateExplanationDatasetRequest()) - ->setModel($formattedModel); + $request = (new UpdateExplanationDatasetRequest())->setModel($formattedModel); $response = $gapicClient->updateExplanationDataset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1580,9 +1614,7 @@ public function updateModelTest() $modelDisplayName = 'modelDisplayName1578770308'; $model->setDisplayName($modelDisplayName); $updateMask = new FieldMask(); - $request = (new UpdateModelRequest()) - ->setModel($model) - ->setUpdateMask($updateMask); + $request = (new UpdateModelRequest())->setModel($model)->setUpdateMask($updateMask); $response = $gapicClient->updateModel($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1608,21 +1640,22 @@ public function updateModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $model = new Model(); $modelDisplayName = 'modelDisplayName1578770308'; $model->setDisplayName($modelDisplayName); $updateMask = new FieldMask(); - $request = (new UpdateModelRequest()) - ->setModel($model) - ->setUpdateMask($updateMask); + $request = (new UpdateModelRequest())->setModel($model)->setUpdateMask($updateMask); try { $gapicClient->updateModel($request); // If the $gapicClient method call did not throw, fail the test @@ -1674,9 +1707,7 @@ public function uploadModelTest() $model = new Model(); $modelDisplayName = 'modelDisplayName1578770308'; $model->setDisplayName($modelDisplayName); - $request = (new UploadModelRequest()) - ->setParent($formattedParent) - ->setModel($model); + $request = (new UploadModelRequest())->setParent($formattedParent)->setModel($model); $response = $gapicClient->uploadModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1734,21 +1765,22 @@ public function uploadModelExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $model = new Model(); $modelDisplayName = 'modelDisplayName1578770308'; $model->setDisplayName($modelDisplayName); - $request = (new UploadModelRequest()) - ->setParent($formattedParent) - ->setModel($model); + $request = (new UploadModelRequest())->setParent($formattedParent)->setModel($model); $response = $gapicClient->uploadModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1810,12 +1842,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1842,9 +1877,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1874,12 +1907,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1912,8 +1948,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1937,17 +1972,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1979,9 +2016,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2007,19 +2042,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2047,9 +2083,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2075,19 +2109,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2115,7 +2150,13 @@ public function batchImportEvaluatedAnnotationsAsyncTest() $expectedResponse->setImportedEvaluatedAnnotationsCount($importedEvaluatedAnnotationsCount); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); + $formattedParent = $gapicClient->modelEvaluationSliceName( + '[PROJECT]', + '[LOCATION]', + '[MODEL]', + '[EVALUATION]', + '[SLICE]' + ); $evaluatedAnnotations = []; $request = (new BatchImportEvaluatedAnnotationsRequest()) ->setParent($formattedParent) diff --git a/AiPlatform/tests/Unit/V1/Client/NotebookServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/NotebookServiceClientTest.php index 4a1303f87954..53be8286861d 100644 --- a/AiPlatform/tests/Unit/V1/Client/NotebookServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/NotebookServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\AIPlatform\V1\AssignNotebookRuntimeRequest; @@ -42,6 +41,7 @@ use Google\Cloud\AIPlatform\V1\NotebookRuntimeTemplate; use Google\Cloud\AIPlatform\V1\StartNotebookRuntimeRequest; use Google\Cloud\AIPlatform\V1\StartNotebookRuntimeResponse; +use Google\Cloud\AIPlatform\V1\UpdateNotebookRuntimeTemplateRequest; use Google\Cloud\AIPlatform\V1\UpgradeNotebookRuntimeRequest; use Google\Cloud\AIPlatform\V1\UpgradeNotebookRuntimeResponse; use Google\Cloud\Iam\V1\GetIamPolicyRequest; @@ -53,9 +53,11 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; +use Google\Protobuf\FieldMask; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; @@ -76,7 +78,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return NotebookServiceClient */ @@ -117,6 +121,8 @@ public function assignNotebookRuntimeTest() $serviceAccount = 'serviceAccount-1948028253'; $isUpgradable = true; $version = 'version351608024'; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new NotebookRuntime(); $expectedResponse->setName($name); $expectedResponse->setRuntimeUser($runtimeUser); @@ -126,6 +132,8 @@ public function assignNotebookRuntimeTest() $expectedResponse->setServiceAccount($serviceAccount); $expectedResponse->setIsUpgradable($isUpgradable); $expectedResponse->setVersion($version); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -135,7 +143,11 @@ public function assignNotebookRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNotebookRuntimeTemplate = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); + $formattedNotebookRuntimeTemplate = $gapicClient->notebookRuntimeTemplateName( + '[PROJECT]', + '[LOCATION]', + '[NOTEBOOK_RUNTIME_TEMPLATE]' + ); $notebookRuntime = new NotebookRuntime(); $notebookRuntimeRuntimeUser = 'notebookRuntimeRuntimeUser825639430'; $notebookRuntime->setRuntimeUser($notebookRuntimeRuntimeUser); @@ -204,16 +216,23 @@ public function assignNotebookRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNotebookRuntimeTemplate = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); + $formattedNotebookRuntimeTemplate = $gapicClient->notebookRuntimeTemplateName( + '[PROJECT]', + '[LOCATION]', + '[NOTEBOOK_RUNTIME_TEMPLATE]' + ); $notebookRuntime = new NotebookRuntime(); $notebookRuntimeRuntimeUser = 'notebookRuntimeRuntimeUser825639430'; $notebookRuntime->setRuntimeUser($notebookRuntimeRuntimeUser); @@ -303,7 +322,10 @@ public function createNotebookRuntimeTemplateTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/CreateNotebookRuntimeTemplate', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.NotebookService/CreateNotebookRuntimeTemplate', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getNotebookRuntimeTemplate(); @@ -351,12 +373,15 @@ public function createNotebookRuntimeTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -419,8 +444,7 @@ public function deleteNotebookRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $request = (new DeleteNotebookRuntimeRequest()) - ->setName($formattedName); + $request = (new DeleteNotebookRuntimeRequest())->setName($formattedName); $response = $gapicClient->deleteNotebookRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -476,17 +500,19 @@ public function deleteNotebookRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $request = (new DeleteNotebookRuntimeRequest()) - ->setName($formattedName); + $request = (new DeleteNotebookRuntimeRequest())->setName($formattedName); $response = $gapicClient->deleteNotebookRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -539,9 +565,12 @@ public function deleteNotebookRuntimeTemplateTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - $request = (new DeleteNotebookRuntimeTemplateRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->notebookRuntimeTemplateName( + '[PROJECT]', + '[LOCATION]', + '[NOTEBOOK_RUNTIME_TEMPLATE]' + ); + $request = (new DeleteNotebookRuntimeTemplateRequest())->setName($formattedName); $response = $gapicClient->deleteNotebookRuntimeTemplate($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -551,7 +580,10 @@ public function deleteNotebookRuntimeTemplateTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/DeleteNotebookRuntimeTemplate', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.NotebookService/DeleteNotebookRuntimeTemplate', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -597,17 +629,23 @@ public function deleteNotebookRuntimeTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - $request = (new DeleteNotebookRuntimeTemplateRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->notebookRuntimeTemplateName( + '[PROJECT]', + '[LOCATION]', + '[NOTEBOOK_RUNTIME_TEMPLATE]' + ); + $request = (new DeleteNotebookRuntimeTemplateRequest())->setName($formattedName); $response = $gapicClient->deleteNotebookRuntimeTemplate($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -647,6 +685,8 @@ public function getNotebookRuntimeTest() $serviceAccount = 'serviceAccount-1948028253'; $isUpgradable = true; $version = 'version351608024'; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new NotebookRuntime(); $expectedResponse->setName($name2); $expectedResponse->setRuntimeUser($runtimeUser); @@ -656,11 +696,12 @@ public function getNotebookRuntimeTest() $expectedResponse->setServiceAccount($serviceAccount); $expectedResponse->setIsUpgradable($isUpgradable); $expectedResponse->setVersion($version); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $request = (new GetNotebookRuntimeRequest()) - ->setName($formattedName); + $request = (new GetNotebookRuntimeRequest())->setName($formattedName); $response = $gapicClient->getNotebookRuntime($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -684,17 +725,19 @@ public function getNotebookRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $request = (new GetNotebookRuntimeRequest()) - ->setName($formattedName); + $request = (new GetNotebookRuntimeRequest())->setName($formattedName); try { $gapicClient->getNotebookRuntime($request); // If the $gapicClient method call did not throw, fail the test @@ -732,9 +775,12 @@ public function getNotebookRuntimeTemplateTest() $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - $request = (new GetNotebookRuntimeTemplateRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->notebookRuntimeTemplateName( + '[PROJECT]', + '[LOCATION]', + '[NOTEBOOK_RUNTIME_TEMPLATE]' + ); + $request = (new GetNotebookRuntimeTemplateRequest())->setName($formattedName); $response = $gapicClient->getNotebookRuntimeTemplate($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -758,17 +804,23 @@ public function getNotebookRuntimeTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - $request = (new GetNotebookRuntimeTemplateRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->notebookRuntimeTemplateName( + '[PROJECT]', + '[LOCATION]', + '[NOTEBOOK_RUNTIME_TEMPLATE]' + ); + $request = (new GetNotebookRuntimeTemplateRequest())->setName($formattedName); try { $gapicClient->getNotebookRuntimeTemplate($request); // If the $gapicClient method call did not throw, fail the test @@ -793,17 +845,14 @@ public function listNotebookRuntimeTemplatesTest() // Mock response $nextPageToken = ''; $notebookRuntimeTemplatesElement = new NotebookRuntimeTemplate(); - $notebookRuntimeTemplates = [ - $notebookRuntimeTemplatesElement, - ]; + $notebookRuntimeTemplates = [$notebookRuntimeTemplatesElement]; $expectedResponse = new ListNotebookRuntimeTemplatesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setNotebookRuntimeTemplates($notebookRuntimeTemplates); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListNotebookRuntimeTemplatesRequest()) - ->setParent($formattedParent); + $request = (new ListNotebookRuntimeTemplatesRequest())->setParent($formattedParent); $response = $gapicClient->listNotebookRuntimeTemplates($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -830,17 +879,19 @@ public function listNotebookRuntimeTemplatesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListNotebookRuntimeTemplatesRequest()) - ->setParent($formattedParent); + $request = (new ListNotebookRuntimeTemplatesRequest())->setParent($formattedParent); try { $gapicClient->listNotebookRuntimeTemplates($request); // If the $gapicClient method call did not throw, fail the test @@ -865,17 +916,14 @@ public function listNotebookRuntimesTest() // Mock response $nextPageToken = ''; $notebookRuntimesElement = new NotebookRuntime(); - $notebookRuntimes = [ - $notebookRuntimesElement, - ]; + $notebookRuntimes = [$notebookRuntimesElement]; $expectedResponse = new ListNotebookRuntimesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setNotebookRuntimes($notebookRuntimes); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListNotebookRuntimesRequest()) - ->setParent($formattedParent); + $request = (new ListNotebookRuntimesRequest())->setParent($formattedParent); $response = $gapicClient->listNotebookRuntimes($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -902,17 +950,19 @@ public function listNotebookRuntimesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListNotebookRuntimesRequest()) - ->setParent($formattedParent); + $request = (new ListNotebookRuntimesRequest())->setParent($formattedParent); try { $gapicClient->listNotebookRuntimes($request); // If the $gapicClient method call did not throw, fail the test @@ -957,8 +1007,7 @@ public function startNotebookRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $request = (new StartNotebookRuntimeRequest()) - ->setName($formattedName); + $request = (new StartNotebookRuntimeRequest())->setName($formattedName); $response = $gapicClient->startNotebookRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1014,17 +1063,19 @@ public function startNotebookRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $request = (new StartNotebookRuntimeRequest()) - ->setName($formattedName); + $request = (new StartNotebookRuntimeRequest())->setName($formattedName); $response = $gapicClient->startNotebookRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1047,6 +1098,93 @@ public function startNotebookRuntimeExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function updateNotebookRuntimeTemplateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $isDefault = true; + $serviceAccount = 'serviceAccount-1948028253'; + $etag = 'etag3123477'; + $expectedResponse = new NotebookRuntimeTemplate(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setIsDefault($isDefault); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $notebookRuntimeTemplate = new NotebookRuntimeTemplate(); + $notebookRuntimeTemplateDisplayName = 'notebookRuntimeTemplateDisplayName-1609642794'; + $notebookRuntimeTemplate->setDisplayName($notebookRuntimeTemplateDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateNotebookRuntimeTemplateRequest()) + ->setNotebookRuntimeTemplate($notebookRuntimeTemplate) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateNotebookRuntimeTemplate($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/UpdateNotebookRuntimeTemplate', $actualFuncCall); + $actualValue = $actualRequestObject->getNotebookRuntimeTemplate(); + $this->assertProtobufEquals($notebookRuntimeTemplate, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateNotebookRuntimeTemplateExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $notebookRuntimeTemplate = new NotebookRuntimeTemplate(); + $notebookRuntimeTemplateDisplayName = 'notebookRuntimeTemplateDisplayName-1609642794'; + $notebookRuntimeTemplate->setDisplayName($notebookRuntimeTemplateDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateNotebookRuntimeTemplateRequest()) + ->setNotebookRuntimeTemplate($notebookRuntimeTemplate) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateNotebookRuntimeTemplate($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function upgradeNotebookRuntimeTest() { @@ -1078,8 +1216,7 @@ public function upgradeNotebookRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $request = (new UpgradeNotebookRuntimeRequest()) - ->setName($formattedName); + $request = (new UpgradeNotebookRuntimeRequest())->setName($formattedName); $response = $gapicClient->upgradeNotebookRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1135,17 +1272,19 @@ public function upgradeNotebookRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $request = (new UpgradeNotebookRuntimeRequest()) - ->setName($formattedName); + $request = (new UpgradeNotebookRuntimeRequest())->setName($formattedName); $response = $gapicClient->upgradeNotebookRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1207,12 +1346,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1239,9 +1381,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1271,12 +1411,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1309,8 +1452,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1334,17 +1476,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1376,9 +1520,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1404,19 +1546,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1444,9 +1587,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1472,19 +1613,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1527,6 +1669,8 @@ public function assignNotebookRuntimeAsyncTest() $serviceAccount = 'serviceAccount-1948028253'; $isUpgradable = true; $version = 'version351608024'; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new NotebookRuntime(); $expectedResponse->setName($name); $expectedResponse->setRuntimeUser($runtimeUser); @@ -1536,6 +1680,8 @@ public function assignNotebookRuntimeAsyncTest() $expectedResponse->setServiceAccount($serviceAccount); $expectedResponse->setIsUpgradable($isUpgradable); $expectedResponse->setVersion($version); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -1545,7 +1691,11 @@ public function assignNotebookRuntimeAsyncTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNotebookRuntimeTemplate = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); + $formattedNotebookRuntimeTemplate = $gapicClient->notebookRuntimeTemplateName( + '[PROJECT]', + '[LOCATION]', + '[NOTEBOOK_RUNTIME_TEMPLATE]' + ); $notebookRuntime = new NotebookRuntime(); $notebookRuntimeRuntimeUser = 'notebookRuntimeRuntimeUser825639430'; $notebookRuntime->setRuntimeUser($notebookRuntimeRuntimeUser); diff --git a/AiPlatform/tests/Unit/V1/Client/PersistentResourceServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/PersistentResourceServiceClientTest.php index d7883ca272d8..ef17bc41e889 100644 --- a/AiPlatform/tests/Unit/V1/Client/PersistentResourceServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/PersistentResourceServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\AIPlatform\V1\Client\PersistentResourceServiceClient; @@ -45,6 +44,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -69,7 +69,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return PersistentResourceServiceClient */ @@ -135,7 +137,10 @@ public function createPersistentResourceTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/CreatePersistentResource', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.PersistentResourceService/CreatePersistentResource', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getPersistentResource(); @@ -185,12 +190,15 @@ public function createPersistentResourceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -255,8 +263,7 @@ public function deletePersistentResourceTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $request = (new DeletePersistentResourceRequest()) - ->setName($formattedName); + $request = (new DeletePersistentResourceRequest())->setName($formattedName); $response = $gapicClient->deletePersistentResource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -266,7 +273,10 @@ public function deletePersistentResourceTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/DeletePersistentResource', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.PersistentResourceService/DeletePersistentResource', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -312,17 +322,19 @@ public function deletePersistentResourceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $request = (new DeletePersistentResourceRequest()) - ->setName($formattedName); + $request = (new DeletePersistentResourceRequest())->setName($formattedName); $response = $gapicClient->deletePersistentResource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -364,15 +376,17 @@ public function getPersistentResourceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $request = (new GetPersistentResourceRequest()) - ->setName($formattedName); + $request = (new GetPersistentResourceRequest())->setName($formattedName); $response = $gapicClient->getPersistentResource($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/GetPersistentResource', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.PersistentResourceService/GetPersistentResource', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -389,17 +403,19 @@ public function getPersistentResourceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $request = (new GetPersistentResourceRequest()) - ->setName($formattedName); + $request = (new GetPersistentResourceRequest())->setName($formattedName); try { $gapicClient->getPersistentResource($request); // If the $gapicClient method call did not throw, fail the test @@ -424,17 +440,14 @@ public function listPersistentResourcesTest() // Mock response $nextPageToken = ''; $persistentResourcesElement = new PersistentResource(); - $persistentResources = [ - $persistentResourcesElement, - ]; + $persistentResources = [$persistentResourcesElement]; $expectedResponse = new ListPersistentResourcesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setPersistentResources($persistentResources); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListPersistentResourcesRequest()) - ->setParent($formattedParent); + $request = (new ListPersistentResourcesRequest())->setParent($formattedParent); $response = $gapicClient->listPersistentResources($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -444,7 +457,10 @@ public function listPersistentResourcesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/ListPersistentResources', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.PersistentResourceService/ListPersistentResources', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -461,17 +477,19 @@ public function listPersistentResourcesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListPersistentResourcesRequest()) - ->setParent($formattedParent); + $request = (new ListPersistentResourcesRequest())->setParent($formattedParent); try { $gapicClient->listPersistentResources($request); // If the $gapicClient method call did not throw, fail the test @@ -522,8 +540,7 @@ public function rebootPersistentResourceTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $request = (new RebootPersistentResourceRequest()) - ->setName($formattedName); + $request = (new RebootPersistentResourceRequest())->setName($formattedName); $response = $gapicClient->rebootPersistentResource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -533,7 +550,10 @@ public function rebootPersistentResourceTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/RebootPersistentResource', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.PersistentResourceService/RebootPersistentResource', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -579,17 +599,19 @@ public function rebootPersistentResourceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $request = (new RebootPersistentResourceRequest()) - ->setName($formattedName); + $request = (new RebootPersistentResourceRequest())->setName($formattedName); $response = $gapicClient->rebootPersistentResource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -664,7 +686,10 @@ public function updatePersistentResourceTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/UpdatePersistentResource', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.PersistentResourceService/UpdatePersistentResource', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getPersistentResource(); $this->assertProtobufEquals($persistentResource, $actualValue); $actualValue = $actualApiRequestObject->getUpdateMask(); @@ -712,12 +737,15 @@ public function updatePersistentResourceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $persistentResource = new PersistentResource(); @@ -788,12 +816,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -820,9 +851,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -852,12 +881,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -890,8 +922,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -915,17 +946,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -957,9 +990,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -985,19 +1016,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1025,9 +1057,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1053,19 +1083,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1133,7 +1164,10 @@ public function createPersistentResourceAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/CreatePersistentResource', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.PersistentResourceService/CreatePersistentResource', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getPersistentResource(); diff --git a/AiPlatform/tests/Unit/V1/Client/PipelineServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/PipelineServiceClientTest.php index 7f93b7647796..719791e5e651 100644 --- a/AiPlatform/tests/Unit/V1/Client/PipelineServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/PipelineServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return PipelineServiceClient */ @@ -122,12 +124,8 @@ public function batchCancelPipelineJobsTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNames = [ - $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - ]; - $request = (new BatchCancelPipelineJobsRequest()) - ->setParent($formattedParent) - ->setNames($formattedNames); + $formattedNames = [$gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]')]; + $request = (new BatchCancelPipelineJobsRequest())->setParent($formattedParent)->setNames($formattedNames); $response = $gapicClient->batchCancelPipelineJobs($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -185,21 +183,20 @@ public function batchCancelPipelineJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNames = [ - $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - ]; - $request = (new BatchCancelPipelineJobsRequest()) - ->setParent($formattedParent) - ->setNames($formattedNames); + $formattedNames = [$gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]')]; + $request = (new BatchCancelPipelineJobsRequest())->setParent($formattedParent)->setNames($formattedNames); $response = $gapicClient->batchCancelPipelineJobs($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -253,12 +250,8 @@ public function batchDeletePipelineJobsTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNames = [ - $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - ]; - $request = (new BatchDeletePipelineJobsRequest()) - ->setParent($formattedParent) - ->setNames($formattedNames); + $formattedNames = [$gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]')]; + $request = (new BatchDeletePipelineJobsRequest())->setParent($formattedParent)->setNames($formattedNames); $response = $gapicClient->batchDeletePipelineJobs($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -316,21 +309,20 @@ public function batchDeletePipelineJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNames = [ - $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - ]; - $request = (new BatchDeletePipelineJobsRequest()) - ->setParent($formattedParent) - ->setNames($formattedNames); + $formattedNames = [$gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]')]; + $request = (new BatchDeletePipelineJobsRequest())->setParent($formattedParent)->setNames($formattedNames); $response = $gapicClient->batchDeletePipelineJobs($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -366,8 +358,7 @@ public function cancelPipelineJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $request = (new CancelPipelineJobRequest()) - ->setName($formattedName); + $request = (new CancelPipelineJobRequest())->setName($formattedName); $gapicClient->cancelPipelineJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -390,17 +381,19 @@ public function cancelPipelineJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $request = (new CancelPipelineJobRequest()) - ->setName($formattedName); + $request = (new CancelPipelineJobRequest())->setName($formattedName); try { $gapicClient->cancelPipelineJob($request); // If the $gapicClient method call did not throw, fail the test @@ -427,8 +420,7 @@ public function cancelTrainingPipelineTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $request = (new CancelTrainingPipelineRequest()) - ->setName($formattedName); + $request = (new CancelTrainingPipelineRequest())->setName($formattedName); $gapicClient->cancelTrainingPipeline($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -451,17 +443,19 @@ public function cancelTrainingPipelineExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $request = (new CancelTrainingPipelineRequest()) - ->setName($formattedName); + $request = (new CancelTrainingPipelineRequest())->setName($formattedName); try { $gapicClient->cancelTrainingPipeline($request); // If the $gapicClient method call did not throw, fail the test @@ -501,9 +495,7 @@ public function createPipelineJobTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pipelineJob = new PipelineJob(); - $request = (new CreatePipelineJobRequest()) - ->setParent($formattedParent) - ->setPipelineJob($pipelineJob); + $request = (new CreatePipelineJobRequest())->setParent($formattedParent)->setPipelineJob($pipelineJob); $response = $gapicClient->createPipelineJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -529,19 +521,20 @@ public function createPipelineJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pipelineJob = new PipelineJob(); - $request = (new CreatePipelineJobRequest()) - ->setParent($formattedParent) - ->setPipelineJob($pipelineJob); + $request = (new CreatePipelineJobRequest())->setParent($formattedParent)->setPipelineJob($pipelineJob); try { $gapicClient->createPipelineJob($request); // If the $gapicClient method call did not throw, fail the test @@ -613,12 +606,15 @@ public function createTrainingPipelineExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -676,8 +672,7 @@ public function deletePipelineJobTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $request = (new DeletePipelineJobRequest()) - ->setName($formattedName); + $request = (new DeletePipelineJobRequest())->setName($formattedName); $response = $gapicClient->deletePipelineJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -733,17 +728,19 @@ public function deletePipelineJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $request = (new DeletePipelineJobRequest()) - ->setName($formattedName); + $request = (new DeletePipelineJobRequest())->setName($formattedName); $response = $gapicClient->deletePipelineJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -797,8 +794,7 @@ public function deleteTrainingPipelineTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $request = (new DeleteTrainingPipelineRequest()) - ->setName($formattedName); + $request = (new DeleteTrainingPipelineRequest())->setName($formattedName); $response = $gapicClient->deleteTrainingPipeline($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -854,17 +850,19 @@ public function deleteTrainingPipelineExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $request = (new DeleteTrainingPipelineRequest()) - ->setName($formattedName); + $request = (new DeleteTrainingPipelineRequest())->setName($formattedName); $response = $gapicClient->deleteTrainingPipeline($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -912,8 +910,7 @@ public function getPipelineJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $request = (new GetPipelineJobRequest()) - ->setName($formattedName); + $request = (new GetPipelineJobRequest())->setName($formattedName); $response = $gapicClient->getPipelineJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -937,17 +934,19 @@ public function getPipelineJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $request = (new GetPipelineJobRequest()) - ->setName($formattedName); + $request = (new GetPipelineJobRequest())->setName($formattedName); try { $gapicClient->getPipelineJob($request); // If the $gapicClient method call did not throw, fail the test @@ -984,8 +983,7 @@ public function getTrainingPipelineTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $request = (new GetTrainingPipelineRequest()) - ->setName($formattedName); + $request = (new GetTrainingPipelineRequest())->setName($formattedName); $response = $gapicClient->getTrainingPipeline($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1009,17 +1007,19 @@ public function getTrainingPipelineExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $request = (new GetTrainingPipelineRequest()) - ->setName($formattedName); + $request = (new GetTrainingPipelineRequest())->setName($formattedName); try { $gapicClient->getTrainingPipeline($request); // If the $gapicClient method call did not throw, fail the test @@ -1044,17 +1044,14 @@ public function listPipelineJobsTest() // Mock response $nextPageToken = ''; $pipelineJobsElement = new PipelineJob(); - $pipelineJobs = [ - $pipelineJobsElement, - ]; + $pipelineJobs = [$pipelineJobsElement]; $expectedResponse = new ListPipelineJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setPipelineJobs($pipelineJobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListPipelineJobsRequest()) - ->setParent($formattedParent); + $request = (new ListPipelineJobsRequest())->setParent($formattedParent); $response = $gapicClient->listPipelineJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1081,17 +1078,19 @@ public function listPipelineJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListPipelineJobsRequest()) - ->setParent($formattedParent); + $request = (new ListPipelineJobsRequest())->setParent($formattedParent); try { $gapicClient->listPipelineJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -1116,17 +1115,14 @@ public function listTrainingPipelinesTest() // Mock response $nextPageToken = ''; $trainingPipelinesElement = new TrainingPipeline(); - $trainingPipelines = [ - $trainingPipelinesElement, - ]; + $trainingPipelines = [$trainingPipelinesElement]; $expectedResponse = new ListTrainingPipelinesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTrainingPipelines($trainingPipelines); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListTrainingPipelinesRequest()) - ->setParent($formattedParent); + $request = (new ListTrainingPipelinesRequest())->setParent($formattedParent); $response = $gapicClient->listTrainingPipelines($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1153,17 +1149,19 @@ public function listTrainingPipelinesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListTrainingPipelinesRequest()) - ->setParent($formattedParent); + $request = (new ListTrainingPipelinesRequest())->setParent($formattedParent); try { $gapicClient->listTrainingPipelines($request); // If the $gapicClient method call did not throw, fail the test @@ -1216,12 +1214,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1248,9 +1249,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1280,12 +1279,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1318,8 +1320,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1343,17 +1344,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1385,9 +1388,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1413,19 +1414,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1453,9 +1455,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1481,19 +1481,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1538,12 +1539,8 @@ public function batchCancelPipelineJobsAsyncTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNames = [ - $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - ]; - $request = (new BatchCancelPipelineJobsRequest()) - ->setParent($formattedParent) - ->setNames($formattedNames); + $formattedNames = [$gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]')]; + $request = (new BatchCancelPipelineJobsRequest())->setParent($formattedParent)->setNames($formattedNames); $response = $gapicClient->batchCancelPipelineJobsAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/AiPlatform/tests/Unit/V1/Client/PredictionServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/PredictionServiceClientTest.php index ee62251314c8..037cb7db22d2 100644 --- a/AiPlatform/tests/Unit/V1/Client/PredictionServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/PredictionServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return PredictionServiceClient */ @@ -103,8 +105,7 @@ public function directPredictTest() $transport->addResponse($expectedResponse); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new DirectPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new DirectPredictRequest())->setEndpoint($formattedEndpoint); $response = $gapicClient->directPredict($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -128,17 +129,19 @@ public function directPredictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new DirectPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new DirectPredictRequest())->setEndpoint($formattedEndpoint); try { $gapicClient->directPredict($request); // If the $gapicClient method call did not throw, fail the test @@ -167,8 +170,7 @@ public function directRawPredictTest() $transport->addResponse($expectedResponse); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new DirectRawPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new DirectRawPredictRequest())->setEndpoint($formattedEndpoint); $response = $gapicClient->directRawPredict($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -192,17 +194,19 @@ public function directRawPredictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new DirectRawPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new DirectRawPredictRequest())->setEndpoint($formattedEndpoint); try { $gapicClient->directRawPredict($request); // If the $gapicClient method call did not throw, fail the test @@ -232,9 +236,7 @@ public function explainTest() // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $instances = []; - $request = (new ExplainRequest()) - ->setEndpoint($formattedEndpoint) - ->setInstances($instances); + $request = (new ExplainRequest())->setEndpoint($formattedEndpoint)->setInstances($instances); $response = $gapicClient->explain($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -260,19 +262,20 @@ public function explainExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $instances = []; - $request = (new ExplainRequest()) - ->setEndpoint($formattedEndpoint) - ->setInstances($instances); + $request = (new ExplainRequest())->setEndpoint($formattedEndpoint)->setInstances($instances); try { $gapicClient->explain($request); // If the $gapicClient method call did not throw, fail the test @@ -300,9 +303,7 @@ public function generateContentTest() // Mock request $model = 'model104069929'; $contents = []; - $request = (new GenerateContentRequest()) - ->setModel($model) - ->setContents($contents); + $request = (new GenerateContentRequest())->setModel($model)->setContents($contents); $response = $gapicClient->generateContent($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -328,19 +329,20 @@ public function generateContentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $model = 'model104069929'; $contents = []; - $request = (new GenerateContentRequest()) - ->setModel($model) - ->setContents($contents); + $request = (new GenerateContentRequest())->setModel($model)->setContents($contents); try { $gapicClient->generateContent($request); // If the $gapicClient method call did not throw, fail the test @@ -376,9 +378,7 @@ public function predictTest() // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $instances = []; - $request = (new PredictRequest()) - ->setEndpoint($formattedEndpoint) - ->setInstances($instances); + $request = (new PredictRequest())->setEndpoint($formattedEndpoint)->setInstances($instances); $response = $gapicClient->predict($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -404,19 +404,20 @@ public function predictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); $instances = []; - $request = (new PredictRequest()) - ->setEndpoint($formattedEndpoint) - ->setInstances($instances); + $request = (new PredictRequest())->setEndpoint($formattedEndpoint)->setInstances($instances); try { $gapicClient->predict($request); // If the $gapicClient method call did not throw, fail the test @@ -447,8 +448,7 @@ public function rawPredictTest() $transport->addResponse($expectedResponse); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new RawPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new RawPredictRequest())->setEndpoint($formattedEndpoint); $response = $gapicClient->rawPredict($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -472,17 +472,19 @@ public function rawPredictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new RawPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new RawPredictRequest())->setEndpoint($formattedEndpoint); try { $gapicClient->rawPredict($request); // If the $gapicClient method call did not throw, fail the test @@ -513,8 +515,7 @@ public function serverStreamingPredictTest() $transport->addResponse($expectedResponse3); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new StreamingPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new StreamingPredictRequest())->setEndpoint($formattedEndpoint); $serverStream = $gapicClient->serverStreamingPredict($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -543,18 +544,20 @@ public function serverStreamingPredictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new StreamingPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new StreamingPredictRequest())->setEndpoint($formattedEndpoint); $serverStream = $gapicClient->serverStreamingPredict($request); $results = $serverStream->readAll(); try { @@ -600,10 +603,7 @@ public function streamDirectPredictTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); + $bidi->writeAll([$request2, $request3]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -641,12 +641,15 @@ public function streamDirectPredictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->streamDirectPredict(); @@ -700,10 +703,7 @@ public function streamDirectRawPredictTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); + $bidi->writeAll([$request2, $request3]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -741,12 +741,15 @@ public function streamDirectRawPredictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->streamDirectRawPredict(); @@ -782,9 +785,7 @@ public function streamGenerateContentTest() // Mock request $model = 'model104069929'; $contents = []; - $request = (new GenerateContentRequest()) - ->setModel($model) - ->setContents($contents); + $request = (new GenerateContentRequest())->setModel($model)->setContents($contents); $serverStream = $gapicClient->streamGenerateContent($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -815,20 +816,21 @@ public function streamGenerateContentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $model = 'model104069929'; $contents = []; - $request = (new GenerateContentRequest()) - ->setModel($model) - ->setContents($contents); + $request = (new GenerateContentRequest())->setModel($model)->setContents($contents); $serverStream = $gapicClient->streamGenerateContent($request); $results = $serverStream->readAll(); try { @@ -873,8 +875,7 @@ public function streamRawPredictTest() $transport->addResponse($expectedResponse3); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new StreamRawPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new StreamRawPredictRequest())->setEndpoint($formattedEndpoint); $serverStream = $gapicClient->streamRawPredict($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -903,18 +904,20 @@ public function streamRawPredictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new StreamRawPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new StreamRawPredictRequest())->setEndpoint($formattedEndpoint); $serverStream = $gapicClient->streamRawPredict($request); $results = $serverStream->readAll(); try { @@ -960,10 +963,7 @@ public function streamingPredictTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); + $bidi->writeAll([$request2, $request3]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -1001,12 +1001,15 @@ public function streamingPredictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->streamingPredict(); @@ -1060,10 +1063,7 @@ public function streamingRawPredictTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); + $bidi->writeAll([$request2, $request3]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -1101,12 +1101,15 @@ public function streamingRawPredictExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->streamingRawPredict(); @@ -1163,12 +1166,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1195,9 +1201,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1227,12 +1231,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1265,8 +1272,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1290,17 +1296,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1332,9 +1340,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1360,19 +1366,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1400,9 +1407,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1428,19 +1433,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1467,8 +1473,7 @@ public function directPredictAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new DirectPredictRequest()) - ->setEndpoint($formattedEndpoint); + $request = (new DirectPredictRequest())->setEndpoint($formattedEndpoint); $response = $gapicClient->directPredictAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/AiPlatform/tests/Unit/V1/Client/ScheduleServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/ScheduleServiceClientTest.php index 2f535f076c9a..9da175606c68 100644 --- a/AiPlatform/tests/Unit/V1/Client/ScheduleServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/ScheduleServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ScheduleServiceClient */ @@ -116,9 +118,7 @@ public function createScheduleTest() $schedule->setDisplayName($scheduleDisplayName); $scheduleMaxConcurrentRunCount = 423065016; $schedule->setMaxConcurrentRunCount($scheduleMaxConcurrentRunCount); - $request = (new CreateScheduleRequest()) - ->setParent($formattedParent) - ->setSchedule($schedule); + $request = (new CreateScheduleRequest())->setParent($formattedParent)->setSchedule($schedule); $response = $gapicClient->createSchedule($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -144,12 +144,15 @@ public function createScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -158,9 +161,7 @@ public function createScheduleExceptionTest() $schedule->setDisplayName($scheduleDisplayName); $scheduleMaxConcurrentRunCount = 423065016; $schedule->setMaxConcurrentRunCount($scheduleMaxConcurrentRunCount); - $request = (new CreateScheduleRequest()) - ->setParent($formattedParent) - ->setSchedule($schedule); + $request = (new CreateScheduleRequest())->setParent($formattedParent)->setSchedule($schedule); try { $gapicClient->createSchedule($request); // If the $gapicClient method call did not throw, fail the test @@ -205,8 +206,7 @@ public function deleteScheduleTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new DeleteScheduleRequest()) - ->setName($formattedName); + $request = (new DeleteScheduleRequest())->setName($formattedName); $response = $gapicClient->deleteSchedule($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -262,17 +262,19 @@ public function deleteScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new DeleteScheduleRequest()) - ->setName($formattedName); + $request = (new DeleteScheduleRequest())->setName($formattedName); $response = $gapicClient->deleteSchedule($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -324,8 +326,7 @@ public function getScheduleTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new GetScheduleRequest()) - ->setName($formattedName); + $request = (new GetScheduleRequest())->setName($formattedName); $response = $gapicClient->getSchedule($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -349,17 +350,19 @@ public function getScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new GetScheduleRequest()) - ->setName($formattedName); + $request = (new GetScheduleRequest())->setName($formattedName); try { $gapicClient->getSchedule($request); // If the $gapicClient method call did not throw, fail the test @@ -384,17 +387,14 @@ public function listSchedulesTest() // Mock response $nextPageToken = ''; $schedulesElement = new Schedule(); - $schedules = [ - $schedulesElement, - ]; + $schedules = [$schedulesElement]; $expectedResponse = new ListSchedulesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSchedules($schedules); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListSchedulesRequest()) - ->setParent($formattedParent); + $request = (new ListSchedulesRequest())->setParent($formattedParent); $response = $gapicClient->listSchedules($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -421,17 +421,19 @@ public function listSchedulesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListSchedulesRequest()) - ->setParent($formattedParent); + $request = (new ListSchedulesRequest())->setParent($formattedParent); try { $gapicClient->listSchedules($request); // If the $gapicClient method call did not throw, fail the test @@ -458,8 +460,7 @@ public function pauseScheduleTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new PauseScheduleRequest()) - ->setName($formattedName); + $request = (new PauseScheduleRequest())->setName($formattedName); $gapicClient->pauseSchedule($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -482,17 +483,19 @@ public function pauseScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new PauseScheduleRequest()) - ->setName($formattedName); + $request = (new PauseScheduleRequest())->setName($formattedName); try { $gapicClient->pauseSchedule($request); // If the $gapicClient method call did not throw, fail the test @@ -519,8 +522,7 @@ public function resumeScheduleTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new ResumeScheduleRequest()) - ->setName($formattedName); + $request = (new ResumeScheduleRequest())->setName($formattedName); $gapicClient->resumeSchedule($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -543,17 +545,19 @@ public function resumeScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new ResumeScheduleRequest()) - ->setName($formattedName); + $request = (new ResumeScheduleRequest())->setName($formattedName); try { $gapicClient->resumeSchedule($request); // If the $gapicClient method call did not throw, fail the test @@ -601,9 +605,7 @@ public function updateScheduleTest() $scheduleMaxConcurrentRunCount = 423065016; $schedule->setMaxConcurrentRunCount($scheduleMaxConcurrentRunCount); $updateMask = new FieldMask(); - $request = (new UpdateScheduleRequest()) - ->setSchedule($schedule) - ->setUpdateMask($updateMask); + $request = (new UpdateScheduleRequest())->setSchedule($schedule)->setUpdateMask($updateMask); $response = $gapicClient->updateSchedule($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -629,12 +631,15 @@ public function updateScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $schedule = new Schedule(); @@ -643,9 +648,7 @@ public function updateScheduleExceptionTest() $scheduleMaxConcurrentRunCount = 423065016; $schedule->setMaxConcurrentRunCount($scheduleMaxConcurrentRunCount); $updateMask = new FieldMask(); - $request = (new UpdateScheduleRequest()) - ->setSchedule($schedule) - ->setUpdateMask($updateMask); + $request = (new UpdateScheduleRequest())->setSchedule($schedule)->setUpdateMask($updateMask); try { $gapicClient->updateSchedule($request); // If the $gapicClient method call did not throw, fail the test @@ -698,12 +701,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -730,9 +736,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -762,12 +766,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -800,8 +807,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -825,17 +831,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -867,9 +875,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -895,19 +901,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -935,9 +942,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -963,19 +968,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1023,9 +1029,7 @@ public function createScheduleAsyncTest() $schedule->setDisplayName($scheduleDisplayName); $scheduleMaxConcurrentRunCount = 423065016; $schedule->setMaxConcurrentRunCount($scheduleMaxConcurrentRunCount); - $request = (new CreateScheduleRequest()) - ->setParent($formattedParent) - ->setSchedule($schedule); + $request = (new CreateScheduleRequest())->setParent($formattedParent)->setSchedule($schedule); $response = $gapicClient->createScheduleAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/AiPlatform/tests/Unit/V1/Client/SpecialistPoolServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/SpecialistPoolServiceClientTest.php index 807351f28fa1..1a2d5efe5a48 100644 --- a/AiPlatform/tests/Unit/V1/Client/SpecialistPoolServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/SpecialistPoolServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return SpecialistPoolServiceClient */ @@ -122,9 +124,7 @@ public function createSpecialistPoolTest() $specialistPool->setName($specialistPoolName); $specialistPoolDisplayName = 'specialistPoolDisplayName703175488'; $specialistPool->setDisplayName($specialistPoolDisplayName); - $request = (new CreateSpecialistPoolRequest()) - ->setParent($formattedParent) - ->setSpecialistPool($specialistPool); + $request = (new CreateSpecialistPoolRequest())->setParent($formattedParent)->setSpecialistPool($specialistPool); $response = $gapicClient->createSpecialistPool($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -182,12 +182,15 @@ public function createSpecialistPoolExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -196,9 +199,7 @@ public function createSpecialistPoolExceptionTest() $specialistPool->setName($specialistPoolName); $specialistPoolDisplayName = 'specialistPoolDisplayName703175488'; $specialistPool->setDisplayName($specialistPoolDisplayName); - $request = (new CreateSpecialistPoolRequest()) - ->setParent($formattedParent) - ->setSpecialistPool($specialistPool); + $request = (new CreateSpecialistPoolRequest())->setParent($formattedParent)->setSpecialistPool($specialistPool); $response = $gapicClient->createSpecialistPool($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -252,8 +253,7 @@ public function deleteSpecialistPoolTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - $request = (new DeleteSpecialistPoolRequest()) - ->setName($formattedName); + $request = (new DeleteSpecialistPoolRequest())->setName($formattedName); $response = $gapicClient->deleteSpecialistPool($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -309,17 +309,19 @@ public function deleteSpecialistPoolExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - $request = (new DeleteSpecialistPoolRequest()) - ->setName($formattedName); + $request = (new DeleteSpecialistPoolRequest())->setName($formattedName); $response = $gapicClient->deleteSpecialistPool($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -361,8 +363,7 @@ public function getSpecialistPoolTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - $request = (new GetSpecialistPoolRequest()) - ->setName($formattedName); + $request = (new GetSpecialistPoolRequest())->setName($formattedName); $response = $gapicClient->getSpecialistPool($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -386,17 +387,19 @@ public function getSpecialistPoolExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - $request = (new GetSpecialistPoolRequest()) - ->setName($formattedName); + $request = (new GetSpecialistPoolRequest())->setName($formattedName); try { $gapicClient->getSpecialistPool($request); // If the $gapicClient method call did not throw, fail the test @@ -421,17 +424,14 @@ public function listSpecialistPoolsTest() // Mock response $nextPageToken = ''; $specialistPoolsElement = new SpecialistPool(); - $specialistPools = [ - $specialistPoolsElement, - ]; + $specialistPools = [$specialistPoolsElement]; $expectedResponse = new ListSpecialistPoolsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSpecialistPools($specialistPools); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListSpecialistPoolsRequest()) - ->setParent($formattedParent); + $request = (new ListSpecialistPoolsRequest())->setParent($formattedParent); $response = $gapicClient->listSpecialistPools($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -458,17 +458,19 @@ public function listSpecialistPoolsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListSpecialistPoolsRequest()) - ->setParent($formattedParent); + $request = (new ListSpecialistPoolsRequest())->setParent($formattedParent); try { $gapicClient->listSpecialistPools($request); // If the $gapicClient method call did not throw, fail the test @@ -524,9 +526,7 @@ public function updateSpecialistPoolTest() $specialistPoolDisplayName = 'specialistPoolDisplayName703175488'; $specialistPool->setDisplayName($specialistPoolDisplayName); $updateMask = new FieldMask(); - $request = (new UpdateSpecialistPoolRequest()) - ->setSpecialistPool($specialistPool) - ->setUpdateMask($updateMask); + $request = (new UpdateSpecialistPoolRequest())->setSpecialistPool($specialistPool)->setUpdateMask($updateMask); $response = $gapicClient->updateSpecialistPool($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -584,12 +584,15 @@ public function updateSpecialistPoolExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $specialistPool = new SpecialistPool(); @@ -598,9 +601,7 @@ public function updateSpecialistPoolExceptionTest() $specialistPoolDisplayName = 'specialistPoolDisplayName703175488'; $specialistPool->setDisplayName($specialistPoolDisplayName); $updateMask = new FieldMask(); - $request = (new UpdateSpecialistPoolRequest()) - ->setSpecialistPool($specialistPool) - ->setUpdateMask($updateMask); + $request = (new UpdateSpecialistPoolRequest())->setSpecialistPool($specialistPool)->setUpdateMask($updateMask); $response = $gapicClient->updateSpecialistPool($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -662,12 +663,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -694,9 +698,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -726,12 +728,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -764,8 +769,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -789,17 +793,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -831,9 +837,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -859,19 +863,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -899,9 +904,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -927,19 +930,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -995,9 +999,7 @@ public function createSpecialistPoolAsyncTest() $specialistPool->setName($specialistPoolName); $specialistPoolDisplayName = 'specialistPoolDisplayName703175488'; $specialistPool->setDisplayName($specialistPoolDisplayName); - $request = (new CreateSpecialistPoolRequest()) - ->setParent($formattedParent) - ->setSpecialistPool($specialistPool); + $request = (new CreateSpecialistPoolRequest())->setParent($formattedParent)->setSpecialistPool($specialistPool); $response = $gapicClient->createSpecialistPoolAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/AiPlatform/tests/Unit/V1/Client/TensorboardServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/TensorboardServiceClientTest.php index e61a543c3f95..c12487cf37cb 100644 --- a/AiPlatform/tests/Unit/V1/Client/TensorboardServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/TensorboardServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return TensorboardServiceClient */ @@ -136,11 +138,14 @@ public function batchCreateTensorboardRunsTest() $expectedResponse = new BatchCreateTensorboardRunsResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); + $formattedParent = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); $requests = []; - $request = (new BatchCreateTensorboardRunsRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateTensorboardRunsRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateTensorboardRuns($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -166,19 +171,25 @@ public function batchCreateTensorboardRunsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); + $formattedParent = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); $requests = []; - $request = (new BatchCreateTensorboardRunsRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateTensorboardRunsRequest())->setParent($formattedParent)->setRequests($requests); try { $gapicClient->batchCreateTensorboardRuns($request); // If the $gapicClient method call did not throw, fail the test @@ -204,18 +215,24 @@ public function batchCreateTensorboardTimeSeriesTest() $expectedResponse = new BatchCreateTensorboardTimeSeriesResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); + $formattedParent = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); $requests = []; - $request = (new BatchCreateTensorboardTimeSeriesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateTensorboardTimeSeriesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateTensorboardTimeSeries($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/BatchCreateTensorboardTimeSeries', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/BatchCreateTensorboardTimeSeries', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getRequests(); @@ -234,19 +251,25 @@ public function batchCreateTensorboardTimeSeriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); + $formattedParent = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); $requests = []; - $request = (new BatchCreateTensorboardTimeSeriesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateTensorboardTimeSeriesRequest())->setParent($formattedParent)->setRequests($requests); try { $gapicClient->batchCreateTensorboardTimeSeries($request); // If the $gapicClient method call did not throw, fail the test @@ -274,7 +297,14 @@ public function batchReadTensorboardTimeSeriesDataTest() // Mock request $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); $formattedTimeSeries = [ - $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'), + $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ), ]; $request = (new BatchReadTensorboardTimeSeriesDataRequest()) ->setTensorboard($formattedTensorboard) @@ -285,7 +315,10 @@ public function batchReadTensorboardTimeSeriesDataTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/BatchReadTensorboardTimeSeriesData', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/BatchReadTensorboardTimeSeriesData', + $actualFuncCall + ); $actualValue = $actualRequestObject->getTensorboard(); $this->assertProtobufEquals($formattedTensorboard, $actualValue); $actualValue = $actualRequestObject->getTimeSeries(); @@ -304,17 +337,27 @@ public function batchReadTensorboardTimeSeriesDataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); $formattedTimeSeries = [ - $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'), + $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ), ]; $request = (new BatchReadTensorboardTimeSeriesDataRequest()) ->setTensorboard($formattedTensorboard) @@ -380,9 +423,7 @@ public function createTensorboardTest() $tensorboard = new Tensorboard(); $tensorboardDisplayName = 'tensorboardDisplayName-448676352'; $tensorboard->setDisplayName($tensorboardDisplayName); - $request = (new CreateTensorboardRequest()) - ->setParent($formattedParent) - ->setTensorboard($tensorboard); + $request = (new CreateTensorboardRequest())->setParent($formattedParent)->setTensorboard($tensorboard); $response = $gapicClient->createTensorboard($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -440,21 +481,22 @@ public function createTensorboardExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); $tensorboard = new Tensorboard(); $tensorboardDisplayName = 'tensorboardDisplayName-448676352'; $tensorboard->setDisplayName($tensorboardDisplayName); - $request = (new CreateTensorboardRequest()) - ->setParent($formattedParent) - ->setTensorboard($tensorboard); + $request = (new CreateTensorboardRequest())->setParent($formattedParent)->setTensorboard($tensorboard); $response = $gapicClient->createTensorboard($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -499,7 +541,12 @@ public function createTensorboardExperimentTest() $expectedResponse->setSource($source); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); + $formattedParent = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); $tensorboardExperimentId = 'tensorboardExperimentId932137483'; $request = (new CreateTensorboardExperimentRequest()) ->setParent($formattedParent) @@ -510,7 +557,10 @@ public function createTensorboardExperimentTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardExperiment', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardExperiment', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getTensorboardExperimentId(); @@ -529,15 +579,23 @@ public function createTensorboardExperimentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); + $formattedParent = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); $tensorboardExperimentId = 'tensorboardExperimentId932137483'; $request = (new CreateTensorboardExperimentRequest()) ->setParent($formattedParent) @@ -575,7 +633,13 @@ public function createTensorboardRunTest() $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); + $formattedParent = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); $tensorboardRun = new TensorboardRun(); $tensorboardRunDisplayName = 'tensorboardRunDisplayName-996156817'; $tensorboardRun->setDisplayName($tensorboardRunDisplayName); @@ -611,15 +675,24 @@ public function createTensorboardRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); + $formattedParent = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); $tensorboardRun = new TensorboardRun(); $tensorboardRunDisplayName = 'tensorboardRunDisplayName-996156817'; $tensorboardRun->setDisplayName($tensorboardRunDisplayName); @@ -665,7 +738,14 @@ public function createTensorboardTimeSeriesTest() $expectedResponse->setPluginData($pluginData); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); + $formattedParent = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); $tensorboardTimeSeries = new TensorboardTimeSeries(); $tensorboardTimeSeriesDisplayName = 'tensorboardTimeSeriesDisplayName1084140540'; $tensorboardTimeSeries->setDisplayName($tensorboardTimeSeriesDisplayName); @@ -680,7 +760,10 @@ public function createTensorboardTimeSeriesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardTimeSeries', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardTimeSeries', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getTensorboardTimeSeries(); @@ -699,15 +782,25 @@ public function createTensorboardTimeSeriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); + $formattedParent = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); $tensorboardTimeSeries = new TensorboardTimeSeries(); $tensorboardTimeSeriesDisplayName = 'tensorboardTimeSeriesDisplayName1084140540'; $tensorboardTimeSeries->setDisplayName($tensorboardTimeSeriesDisplayName); @@ -760,8 +853,7 @@ public function deleteTensorboardTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new DeleteTensorboardRequest()) - ->setName($formattedName); + $request = (new DeleteTensorboardRequest())->setName($formattedName); $response = $gapicClient->deleteTensorboard($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -817,17 +909,19 @@ public function deleteTensorboardExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new DeleteTensorboardRequest()) - ->setName($formattedName); + $request = (new DeleteTensorboardRequest())->setName($formattedName); $response = $gapicClient->deleteTensorboard($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -880,9 +974,13 @@ public function deleteTensorboardExperimentTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $request = (new DeleteTensorboardExperimentRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); + $request = (new DeleteTensorboardExperimentRequest())->setName($formattedName); $response = $gapicClient->deleteTensorboardExperiment($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -892,7 +990,10 @@ public function deleteTensorboardExperimentTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardExperiment', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardExperiment', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -938,17 +1039,24 @@ public function deleteTensorboardExperimentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $request = (new DeleteTensorboardExperimentRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); + $request = (new DeleteTensorboardExperimentRequest())->setName($formattedName); $response = $gapicClient->deleteTensorboardExperiment($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1001,9 +1109,14 @@ public function deleteTensorboardRunTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $request = (new DeleteTensorboardRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); + $request = (new DeleteTensorboardRunRequest())->setName($formattedName); $response = $gapicClient->deleteTensorboardRun($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1059,17 +1172,25 @@ public function deleteTensorboardRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $request = (new DeleteTensorboardRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); + $request = (new DeleteTensorboardRunRequest())->setName($formattedName); $response = $gapicClient->deleteTensorboardRun($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1122,9 +1243,15 @@ public function deleteTensorboardTimeSeriesTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new DeleteTensorboardTimeSeriesRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new DeleteTensorboardTimeSeriesRequest())->setName($formattedName); $response = $gapicClient->deleteTensorboardTimeSeries($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1134,7 +1261,10 @@ public function deleteTensorboardTimeSeriesTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardTimeSeries', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardTimeSeries', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -1180,17 +1310,26 @@ public function deleteTensorboardTimeSeriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new DeleteTensorboardTimeSeriesRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new DeleteTensorboardTimeSeriesRequest())->setName($formattedName); $response = $gapicClient->deleteTensorboardTimeSeries($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1224,17 +1363,23 @@ public function exportTensorboardTimeSeriesDataTest() // Mock response $nextPageToken = ''; $timeSeriesDataPointsElement = new TimeSeriesDataPoint(); - $timeSeriesDataPoints = [ - $timeSeriesDataPointsElement, - ]; + $timeSeriesDataPoints = [$timeSeriesDataPointsElement]; $expectedResponse = new ExportTensorboardTimeSeriesDataResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTimeSeriesDataPoints($timeSeriesDataPoints); $transport->addResponse($expectedResponse); // Mock request - $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new ExportTensorboardTimeSeriesDataRequest()) - ->setTensorboardTimeSeries($formattedTensorboardTimeSeries); + $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new ExportTensorboardTimeSeriesDataRequest())->setTensorboardTimeSeries( + $formattedTensorboardTimeSeries + ); $response = $gapicClient->exportTensorboardTimeSeriesData($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1244,7 +1389,10 @@ public function exportTensorboardTimeSeriesDataTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ExportTensorboardTimeSeriesData', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/ExportTensorboardTimeSeriesData', + $actualFuncCall + ); $actualValue = $actualRequestObject->getTensorboardTimeSeries(); $this->assertProtobufEquals($formattedTensorboardTimeSeries, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -1261,17 +1409,28 @@ public function exportTensorboardTimeSeriesDataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new ExportTensorboardTimeSeriesDataRequest()) - ->setTensorboardTimeSeries($formattedTensorboardTimeSeries); + $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new ExportTensorboardTimeSeriesDataRequest())->setTensorboardTimeSeries( + $formattedTensorboardTimeSeries + ); try { $gapicClient->exportTensorboardTimeSeriesData($request); // If the $gapicClient method call did not throw, fail the test @@ -1312,8 +1471,7 @@ public function getTensorboardTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new GetTensorboardRequest()) - ->setName($formattedName); + $request = (new GetTensorboardRequest())->setName($formattedName); $response = $gapicClient->getTensorboard($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1337,17 +1495,19 @@ public function getTensorboardExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new GetTensorboardRequest()) - ->setName($formattedName); + $request = (new GetTensorboardRequest())->setName($formattedName); try { $gapicClient->getTensorboard($request); // If the $gapicClient method call did not throw, fail the test @@ -1383,9 +1543,13 @@ public function getTensorboardExperimentTest() $expectedResponse->setSource($source); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $request = (new GetTensorboardExperimentRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); + $request = (new GetTensorboardExperimentRequest())->setName($formattedName); $response = $gapicClient->getTensorboardExperiment($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1409,17 +1573,24 @@ public function getTensorboardExperimentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $request = (new GetTensorboardExperimentRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); + $request = (new GetTensorboardExperimentRequest())->setName($formattedName); try { $gapicClient->getTensorboardExperiment($request); // If the $gapicClient method call did not throw, fail the test @@ -1453,9 +1624,14 @@ public function getTensorboardRunTest() $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $request = (new GetTensorboardRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); + $request = (new GetTensorboardRunRequest())->setName($formattedName); $response = $gapicClient->getTensorboardRun($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1479,17 +1655,25 @@ public function getTensorboardRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $request = (new GetTensorboardRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); + $request = (new GetTensorboardRunRequest())->setName($formattedName); try { $gapicClient->getTensorboardRun($request); // If the $gapicClient method call did not throw, fail the test @@ -1527,9 +1711,15 @@ public function getTensorboardTimeSeriesTest() $expectedResponse->setPluginData($pluginData); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new GetTensorboardTimeSeriesRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new GetTensorboardTimeSeriesRequest())->setName($formattedName); $response = $gapicClient->getTensorboardTimeSeries($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1553,17 +1743,26 @@ public function getTensorboardTimeSeriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new GetTensorboardTimeSeriesRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new GetTensorboardTimeSeriesRequest())->setName($formattedName); try { $gapicClient->getTensorboardTimeSeries($request); // If the $gapicClient method call did not throw, fail the test @@ -1588,17 +1787,14 @@ public function listTensorboardExperimentsTest() // Mock response $nextPageToken = ''; $tensorboardExperimentsElement = new TensorboardExperiment(); - $tensorboardExperiments = [ - $tensorboardExperimentsElement, - ]; + $tensorboardExperiments = [$tensorboardExperimentsElement]; $expectedResponse = new ListTensorboardExperimentsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTensorboardExperiments($tensorboardExperiments); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new ListTensorboardExperimentsRequest()) - ->setParent($formattedParent); + $request = (new ListTensorboardExperimentsRequest())->setParent($formattedParent); $response = $gapicClient->listTensorboardExperiments($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1625,17 +1821,19 @@ public function listTensorboardExperimentsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new ListTensorboardExperimentsRequest()) - ->setParent($formattedParent); + $request = (new ListTensorboardExperimentsRequest())->setParent($formattedParent); try { $gapicClient->listTensorboardExperiments($request); // If the $gapicClient method call did not throw, fail the test @@ -1660,17 +1858,19 @@ public function listTensorboardRunsTest() // Mock response $nextPageToken = ''; $tensorboardRunsElement = new TensorboardRun(); - $tensorboardRuns = [ - $tensorboardRunsElement, - ]; + $tensorboardRuns = [$tensorboardRunsElement]; $expectedResponse = new ListTensorboardRunsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTensorboardRuns($tensorboardRuns); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $request = (new ListTensorboardRunsRequest()) - ->setParent($formattedParent); + $formattedParent = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); + $request = (new ListTensorboardRunsRequest())->setParent($formattedParent); $response = $gapicClient->listTensorboardRuns($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1697,17 +1897,24 @@ public function listTensorboardRunsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $request = (new ListTensorboardRunsRequest()) - ->setParent($formattedParent); + $formattedParent = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); + $request = (new ListTensorboardRunsRequest())->setParent($formattedParent); try { $gapicClient->listTensorboardRuns($request); // If the $gapicClient method call did not throw, fail the test @@ -1732,17 +1939,20 @@ public function listTensorboardTimeSeriesTest() // Mock response $nextPageToken = ''; $tensorboardTimeSeriesElement = new TensorboardTimeSeries(); - $tensorboardTimeSeries = [ - $tensorboardTimeSeriesElement, - ]; + $tensorboardTimeSeries = [$tensorboardTimeSeriesElement]; $expectedResponse = new ListTensorboardTimeSeriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTensorboardTimeSeries($tensorboardTimeSeries); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $request = (new ListTensorboardTimeSeriesRequest()) - ->setParent($formattedParent); + $formattedParent = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); + $request = (new ListTensorboardTimeSeriesRequest())->setParent($formattedParent); $response = $gapicClient->listTensorboardTimeSeries($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1769,17 +1979,25 @@ public function listTensorboardTimeSeriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $request = (new ListTensorboardTimeSeriesRequest()) - ->setParent($formattedParent); + $formattedParent = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); + $request = (new ListTensorboardTimeSeriesRequest())->setParent($formattedParent); try { $gapicClient->listTensorboardTimeSeries($request); // If the $gapicClient method call did not throw, fail the test @@ -1804,17 +2022,14 @@ public function listTensorboardsTest() // Mock response $nextPageToken = ''; $tensorboardsElement = new Tensorboard(); - $tensorboards = [ - $tensorboardsElement, - ]; + $tensorboards = [$tensorboardsElement]; $expectedResponse = new ListTensorboardsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTensorboards($tensorboards); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListTensorboardsRequest()) - ->setParent($formattedParent); + $request = (new ListTensorboardsRequest())->setParent($formattedParent); $response = $gapicClient->listTensorboards($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1841,17 +2056,19 @@ public function listTensorboardsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListTensorboardsRequest()) - ->setParent($formattedParent); + $request = (new ListTensorboardsRequest())->setParent($formattedParent); try { $gapicClient->listTensorboards($request); // If the $gapicClient method call did not throw, fail the test @@ -1881,9 +2098,15 @@ public function readTensorboardBlobDataTest() $expectedResponse3 = new ReadTensorboardBlobDataResponse(); $transport->addResponse($expectedResponse3); // Mock request - $formattedTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new ReadTensorboardBlobDataRequest()) - ->setTimeSeries($formattedTimeSeries); + $formattedTimeSeries = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new ReadTensorboardBlobDataRequest())->setTimeSeries($formattedTimeSeries); $serverStream = $gapicClient->readTensorboardBlobData($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -1912,18 +2135,27 @@ public function readTensorboardBlobDataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request - $formattedTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new ReadTensorboardBlobDataRequest()) - ->setTimeSeries($formattedTimeSeries); + $formattedTimeSeries = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new ReadTensorboardBlobDataRequest())->setTimeSeries($formattedTimeSeries); $serverStream = $gapicClient->readTensorboardBlobData($request); $results = $serverStream->readAll(); try { @@ -1954,8 +2186,7 @@ public function readTensorboardSizeTest() $transport->addResponse($expectedResponse); // Mock request $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new ReadTensorboardSizeRequest()) - ->setTensorboard($formattedTensorboard); + $request = (new ReadTensorboardSizeRequest())->setTensorboard($formattedTensorboard); $response = $gapicClient->readTensorboardSize($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1979,17 +2210,19 @@ public function readTensorboardSizeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new ReadTensorboardSizeRequest()) - ->setTensorboard($formattedTensorboard); + $request = (new ReadTensorboardSizeRequest())->setTensorboard($formattedTensorboard); try { $gapicClient->readTensorboardSize($request); // If the $gapicClient method call did not throw, fail the test @@ -2015,16 +2248,27 @@ public function readTensorboardTimeSeriesDataTest() $expectedResponse = new ReadTensorboardTimeSeriesDataResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new ReadTensorboardTimeSeriesDataRequest()) - ->setTensorboardTimeSeries($formattedTensorboardTimeSeries); + $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new ReadTensorboardTimeSeriesDataRequest())->setTensorboardTimeSeries( + $formattedTensorboardTimeSeries + ); $response = $gapicClient->readTensorboardTimeSeriesData($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ReadTensorboardTimeSeriesData', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/ReadTensorboardTimeSeriesData', + $actualFuncCall + ); $actualValue = $actualRequestObject->getTensorboardTimeSeries(); $this->assertProtobufEquals($formattedTensorboardTimeSeries, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -2041,17 +2285,28 @@ public function readTensorboardTimeSeriesDataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $request = (new ReadTensorboardTimeSeriesDataRequest()) - ->setTensorboardTimeSeries($formattedTensorboardTimeSeries); + $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]', + '[TIME_SERIES]' + ); + $request = (new ReadTensorboardTimeSeriesDataRequest())->setTensorboardTimeSeries( + $formattedTensorboardTimeSeries + ); try { $gapicClient->readTensorboardTimeSeriesData($request); // If the $gapicClient method call did not throw, fail the test @@ -2078,8 +2333,7 @@ public function readTensorboardUsageTest() $transport->addResponse($expectedResponse); // Mock request $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new ReadTensorboardUsageRequest()) - ->setTensorboard($formattedTensorboard); + $request = (new ReadTensorboardUsageRequest())->setTensorboard($formattedTensorboard); $response = $gapicClient->readTensorboardUsage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2103,17 +2357,19 @@ public function readTensorboardUsageExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $request = (new ReadTensorboardUsageRequest()) - ->setTensorboard($formattedTensorboard); + $request = (new ReadTensorboardUsageRequest())->setTensorboard($formattedTensorboard); try { $gapicClient->readTensorboardUsage($request); // If the $gapicClient method call did not throw, fail the test @@ -2175,9 +2431,7 @@ public function updateTensorboardTest() $tensorboard = new Tensorboard(); $tensorboardDisplayName = 'tensorboardDisplayName-448676352'; $tensorboard->setDisplayName($tensorboardDisplayName); - $request = (new UpdateTensorboardRequest()) - ->setUpdateMask($updateMask) - ->setTensorboard($tensorboard); + $request = (new UpdateTensorboardRequest())->setUpdateMask($updateMask)->setTensorboard($tensorboard); $response = $gapicClient->updateTensorboard($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2235,21 +2489,22 @@ public function updateTensorboardExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $tensorboard = new Tensorboard(); $tensorboardDisplayName = 'tensorboardDisplayName-448676352'; $tensorboard->setDisplayName($tensorboardDisplayName); - $request = (new UpdateTensorboardRequest()) - ->setUpdateMask($updateMask) - ->setTensorboard($tensorboard); + $request = (new UpdateTensorboardRequest())->setUpdateMask($updateMask)->setTensorboard($tensorboard); $response = $gapicClient->updateTensorboard($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2305,7 +2560,10 @@ public function updateTensorboardExperimentTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardExperiment', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardExperiment', + $actualFuncCall + ); $actualValue = $actualRequestObject->getUpdateMask(); $this->assertProtobufEquals($updateMask, $actualValue); $actualValue = $actualRequestObject->getTensorboardExperiment(); @@ -2324,12 +2582,15 @@ public function updateTensorboardExperimentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -2374,9 +2635,7 @@ public function updateTensorboardRunTest() $tensorboardRun = new TensorboardRun(); $tensorboardRunDisplayName = 'tensorboardRunDisplayName-996156817'; $tensorboardRun->setDisplayName($tensorboardRunDisplayName); - $request = (new UpdateTensorboardRunRequest()) - ->setUpdateMask($updateMask) - ->setTensorboardRun($tensorboardRun); + $request = (new UpdateTensorboardRunRequest())->setUpdateMask($updateMask)->setTensorboardRun($tensorboardRun); $response = $gapicClient->updateTensorboardRun($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2402,21 +2661,22 @@ public function updateTensorboardRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $tensorboardRun = new TensorboardRun(); $tensorboardRunDisplayName = 'tensorboardRunDisplayName-996156817'; $tensorboardRun->setDisplayName($tensorboardRunDisplayName); - $request = (new UpdateTensorboardRunRequest()) - ->setUpdateMask($updateMask) - ->setTensorboardRun($tensorboardRun); + $request = (new UpdateTensorboardRunRequest())->setUpdateMask($updateMask)->setTensorboardRun($tensorboardRun); try { $gapicClient->updateTensorboardRun($request); // If the $gapicClient method call did not throw, fail the test @@ -2469,7 +2729,10 @@ public function updateTensorboardTimeSeriesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardTimeSeries', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardTimeSeries', + $actualFuncCall + ); $actualValue = $actualRequestObject->getUpdateMask(); $this->assertProtobufEquals($updateMask, $actualValue); $actualValue = $actualRequestObject->getTensorboardTimeSeries(); @@ -2488,12 +2751,15 @@ public function updateTensorboardTimeSeriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -2530,7 +2796,12 @@ public function writeTensorboardExperimentDataTest() $expectedResponse = new WriteTensorboardExperimentDataResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedTensorboardExperiment = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); + $formattedTensorboardExperiment = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); $writeRunDataRequests = []; $request = (new WriteTensorboardExperimentDataRequest()) ->setTensorboardExperiment($formattedTensorboardExperiment) @@ -2541,7 +2812,10 @@ public function writeTensorboardExperimentDataTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/WriteTensorboardExperimentData', $actualFuncCall); + $this->assertSame( + '/google.cloud.aiplatform.v1.TensorboardService/WriteTensorboardExperimentData', + $actualFuncCall + ); $actualValue = $actualRequestObject->getTensorboardExperiment(); $this->assertProtobufEquals($formattedTensorboardExperiment, $actualValue); $actualValue = $actualRequestObject->getWriteRunDataRequests(); @@ -2560,15 +2834,23 @@ public function writeTensorboardExperimentDataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedTensorboardExperiment = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); + $formattedTensorboardExperiment = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); $writeRunDataRequests = []; $request = (new WriteTensorboardExperimentDataRequest()) ->setTensorboardExperiment($formattedTensorboardExperiment) @@ -2598,7 +2880,13 @@ public function writeTensorboardRunDataTest() $expectedResponse = new WriteTensorboardRunDataResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedTensorboardRun = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); + $formattedTensorboardRun = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); $timeSeriesData = []; $request = (new WriteTensorboardRunDataRequest()) ->setTensorboardRun($formattedTensorboardRun) @@ -2628,15 +2916,24 @@ public function writeTensorboardRunDataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedTensorboardRun = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); + $formattedTensorboardRun = $gapicClient->tensorboardRunName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]', + '[RUN]' + ); $timeSeriesData = []; $request = (new WriteTensorboardRunDataRequest()) ->setTensorboardRun($formattedTensorboardRun) @@ -2693,12 +2990,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -2725,9 +3025,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -2757,12 +3055,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -2795,8 +3096,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2820,17 +3120,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2862,9 +3164,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2890,19 +3190,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2930,9 +3231,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2958,19 +3257,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2996,11 +3296,14 @@ public function batchCreateTensorboardRunsAsyncTest() $expectedResponse = new BatchCreateTensorboardRunsResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); + $formattedParent = $gapicClient->tensorboardExperimentName( + '[PROJECT]', + '[LOCATION]', + '[TENSORBOARD]', + '[EXPERIMENT]' + ); $requests = []; - $request = (new BatchCreateTensorboardRunsRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateTensorboardRunsRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateTensorboardRunsAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/AiPlatform/tests/Unit/V1/Client/VizierServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/VizierServiceClientTest.php index 13392b55692e..622ea009cf97 100644 --- a/AiPlatform/tests/Unit/V1/Client/VizierServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/VizierServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return VizierServiceClient */ @@ -120,9 +122,7 @@ public function addTrialMeasurementTest() // Mock request $formattedTrialName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); $measurement = new Measurement(); - $request = (new AddTrialMeasurementRequest()) - ->setTrialName($formattedTrialName) - ->setMeasurement($measurement); + $request = (new AddTrialMeasurementRequest())->setTrialName($formattedTrialName)->setMeasurement($measurement); $response = $gapicClient->addTrialMeasurement($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -148,19 +148,20 @@ public function addTrialMeasurementExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedTrialName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); $measurement = new Measurement(); - $request = (new AddTrialMeasurementRequest()) - ->setTrialName($formattedTrialName) - ->setMeasurement($measurement); + $request = (new AddTrialMeasurementRequest())->setTrialName($formattedTrialName)->setMeasurement($measurement); try { $gapicClient->addTrialMeasurement($request); // If the $gapicClient method call did not throw, fail the test @@ -207,8 +208,7 @@ public function checkTrialEarlyStoppingStateTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedTrialName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new CheckTrialEarlyStoppingStateRequest()) - ->setTrialName($formattedTrialName); + $request = (new CheckTrialEarlyStoppingStateRequest())->setTrialName($formattedTrialName); $response = $gapicClient->checkTrialEarlyStoppingState($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -264,17 +264,19 @@ public function checkTrialEarlyStoppingStateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedTrialName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new CheckTrialEarlyStoppingStateRequest()) - ->setTrialName($formattedTrialName); + $request = (new CheckTrialEarlyStoppingStateRequest())->setTrialName($formattedTrialName); $response = $gapicClient->checkTrialEarlyStoppingState($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -320,8 +322,7 @@ public function completeTrialTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new CompleteTrialRequest()) - ->setName($formattedName); + $request = (new CompleteTrialRequest())->setName($formattedName); $response = $gapicClient->completeTrial($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -345,17 +346,19 @@ public function completeTrialExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new CompleteTrialRequest()) - ->setName($formattedName); + $request = (new CompleteTrialRequest())->setName($formattedName); try { $gapicClient->completeTrial($request); // If the $gapicClient method call did not throw, fail the test @@ -397,9 +400,7 @@ public function createStudyTest() $studySpecParameters = []; $studyStudySpec->setParameters($studySpecParameters); $study->setStudySpec($studyStudySpec); - $request = (new CreateStudyRequest()) - ->setParent($formattedParent) - ->setStudy($study); + $request = (new CreateStudyRequest())->setParent($formattedParent)->setStudy($study); $response = $gapicClient->createStudy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -425,12 +426,15 @@ public function createStudyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -443,9 +447,7 @@ public function createStudyExceptionTest() $studySpecParameters = []; $studyStudySpec->setParameters($studySpecParameters); $study->setStudySpec($studyStudySpec); - $request = (new CreateStudyRequest()) - ->setParent($formattedParent) - ->setStudy($study); + $request = (new CreateStudyRequest())->setParent($formattedParent)->setStudy($study); try { $gapicClient->createStudy($request); // If the $gapicClient method call did not throw, fail the test @@ -483,9 +485,7 @@ public function createTrialTest() // Mock request $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); $trial = new Trial(); - $request = (new CreateTrialRequest()) - ->setParent($formattedParent) - ->setTrial($trial); + $request = (new CreateTrialRequest())->setParent($formattedParent)->setTrial($trial); $response = $gapicClient->createTrial($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -511,19 +511,20 @@ public function createTrialExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); $trial = new Trial(); - $request = (new CreateTrialRequest()) - ->setParent($formattedParent) - ->setTrial($trial); + $request = (new CreateTrialRequest())->setParent($formattedParent)->setTrial($trial); try { $gapicClient->createTrial($request); // If the $gapicClient method call did not throw, fail the test @@ -550,8 +551,7 @@ public function deleteStudyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $request = (new DeleteStudyRequest()) - ->setName($formattedName); + $request = (new DeleteStudyRequest())->setName($formattedName); $gapicClient->deleteStudy($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -574,17 +574,19 @@ public function deleteStudyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $request = (new DeleteStudyRequest()) - ->setName($formattedName); + $request = (new DeleteStudyRequest())->setName($formattedName); try { $gapicClient->deleteStudy($request); // If the $gapicClient method call did not throw, fail the test @@ -611,8 +613,7 @@ public function deleteTrialTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new DeleteTrialRequest()) - ->setName($formattedName); + $request = (new DeleteTrialRequest())->setName($formattedName); $gapicClient->deleteTrial($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -635,17 +636,19 @@ public function deleteTrialExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new DeleteTrialRequest()) - ->setName($formattedName); + $request = (new DeleteTrialRequest())->setName($formattedName); try { $gapicClient->deleteTrial($request); // If the $gapicClient method call did not throw, fail the test @@ -678,8 +681,7 @@ public function getStudyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $request = (new GetStudyRequest()) - ->setName($formattedName); + $request = (new GetStudyRequest())->setName($formattedName); $response = $gapicClient->getStudy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -703,17 +705,19 @@ public function getStudyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $request = (new GetStudyRequest()) - ->setName($formattedName); + $request = (new GetStudyRequest())->setName($formattedName); try { $gapicClient->getStudy($request); // If the $gapicClient method call did not throw, fail the test @@ -750,8 +754,7 @@ public function getTrialTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new GetTrialRequest()) - ->setName($formattedName); + $request = (new GetTrialRequest())->setName($formattedName); $response = $gapicClient->getTrial($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -775,17 +778,19 @@ public function getTrialExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new GetTrialRequest()) - ->setName($formattedName); + $request = (new GetTrialRequest())->setName($formattedName); try { $gapicClient->getTrial($request); // If the $gapicClient method call did not throw, fail the test @@ -812,8 +817,7 @@ public function listOptimalTrialsTest() $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $request = (new ListOptimalTrialsRequest()) - ->setParent($formattedParent); + $request = (new ListOptimalTrialsRequest())->setParent($formattedParent); $response = $gapicClient->listOptimalTrials($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -837,17 +841,19 @@ public function listOptimalTrialsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $request = (new ListOptimalTrialsRequest()) - ->setParent($formattedParent); + $request = (new ListOptimalTrialsRequest())->setParent($formattedParent); try { $gapicClient->listOptimalTrials($request); // If the $gapicClient method call did not throw, fail the test @@ -872,17 +878,14 @@ public function listStudiesTest() // Mock response $nextPageToken = ''; $studiesElement = new Study(); - $studies = [ - $studiesElement, - ]; + $studies = [$studiesElement]; $expectedResponse = new ListStudiesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setStudies($studies); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListStudiesRequest()) - ->setParent($formattedParent); + $request = (new ListStudiesRequest())->setParent($formattedParent); $response = $gapicClient->listStudies($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -909,17 +912,19 @@ public function listStudiesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListStudiesRequest()) - ->setParent($formattedParent); + $request = (new ListStudiesRequest())->setParent($formattedParent); try { $gapicClient->listStudies($request); // If the $gapicClient method call did not throw, fail the test @@ -944,17 +949,14 @@ public function listTrialsTest() // Mock response $nextPageToken = ''; $trialsElement = new Trial(); - $trials = [ - $trialsElement, - ]; + $trials = [$trialsElement]; $expectedResponse = new ListTrialsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTrials($trials); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $request = (new ListTrialsRequest()) - ->setParent($formattedParent); + $request = (new ListTrialsRequest())->setParent($formattedParent); $response = $gapicClient->listTrials($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -981,17 +983,19 @@ public function listTrialsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $request = (new ListTrialsRequest()) - ->setParent($formattedParent); + $request = (new ListTrialsRequest())->setParent($formattedParent); try { $gapicClient->listTrials($request); // If the $gapicClient method call did not throw, fail the test @@ -1025,9 +1029,7 @@ public function lookupStudyTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $displayName = 'displayName1615086568'; - $request = (new LookupStudyRequest()) - ->setParent($formattedParent) - ->setDisplayName($displayName); + $request = (new LookupStudyRequest())->setParent($formattedParent)->setDisplayName($displayName); $response = $gapicClient->lookupStudy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1053,19 +1055,20 @@ public function lookupStudyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $displayName = 'displayName1615086568'; - $request = (new LookupStudyRequest()) - ->setParent($formattedParent) - ->setDisplayName($displayName); + $request = (new LookupStudyRequest())->setParent($formattedParent)->setDisplayName($displayName); try { $gapicClient->lookupStudy($request); // If the $gapicClient method call did not throw, fail the test @@ -1102,8 +1105,7 @@ public function stopTrialTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new StopTrialRequest()) - ->setName($formattedName); + $request = (new StopTrialRequest())->setName($formattedName); $response = $gapicClient->stopTrial($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1127,17 +1129,19 @@ public function stopTrialExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $request = (new StopTrialRequest()) - ->setName($formattedName); + $request = (new StopTrialRequest())->setName($formattedName); try { $gapicClient->stopTrial($request); // If the $gapicClient method call did not throw, fail the test @@ -1247,12 +1251,15 @@ public function suggestTrialsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); @@ -1323,12 +1330,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1355,9 +1365,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1387,12 +1395,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1425,8 +1436,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1450,17 +1460,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1492,9 +1504,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1520,19 +1530,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1560,9 +1571,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1588,19 +1597,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1638,9 +1648,7 @@ public function addTrialMeasurementAsyncTest() // Mock request $formattedTrialName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); $measurement = new Measurement(); - $request = (new AddTrialMeasurementRequest()) - ->setTrialName($formattedTrialName) - ->setMeasurement($measurement); + $request = (new AddTrialMeasurementRequest())->setTrialName($formattedTrialName)->setMeasurement($measurement); $response = $gapicClient->addTrialMeasurementAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/AiPlatform/tests/Unit/V1/DatasetServiceClientTest.php b/AiPlatform/tests/Unit/V1/DatasetServiceClientTest.php deleted file mode 100644 index 02fb0db8eea1..000000000000 --- a/AiPlatform/tests/Unit/V1/DatasetServiceClientTest.php +++ /dev/null @@ -1,2093 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DatasetServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DatasetServiceClient($options); - } - - /** @test */ - public function createDatasetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $metadataSchemaUri = 'metadataSchemaUri-152319778'; - $dataItemCount = 2014260376; - $etag = 'etag3123477'; - $metadataArtifact = 'metadataArtifact2087706850'; - $expectedResponse = new Dataset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setMetadataSchemaUri($metadataSchemaUri); - $expectedResponse->setDataItemCount($dataItemCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setMetadataArtifact($metadataArtifact); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDatasetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataset = new Dataset(); - $datasetDisplayName = 'datasetDisplayName1912393429'; - $dataset->setDisplayName($datasetDisplayName); - $datasetMetadataSchemaUri = 'datasetMetadataSchemaUri-1520763900'; - $dataset->setMetadataSchemaUri($datasetMetadataSchemaUri); - $datasetMetadata = new Value(); - $dataset->setMetadata($datasetMetadata); - $response = $gapicClient->createDataset($formattedParent, $dataset); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/CreateDataset', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDataset(); - $this->assertProtobufEquals($dataset, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatasetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDatasetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataset = new Dataset(); - $datasetDisplayName = 'datasetDisplayName1912393429'; - $dataset->setDisplayName($datasetDisplayName); - $datasetMetadataSchemaUri = 'datasetMetadataSchemaUri-1520763900'; - $dataset->setMetadataSchemaUri($datasetMetadataSchemaUri); - $datasetMetadata = new Value(); - $dataset->setMetadata($datasetMetadata); - $response = $gapicClient->createDataset($formattedParent, $dataset); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatasetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDatasetVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatasetVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $bigQueryDatasetName = 'bigQueryDatasetName-1230960216'; - $displayName = 'displayName1615086568'; - $expectedResponse = new DatasetVersion(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setBigQueryDatasetName($bigQueryDatasetName); - $expectedResponse->setDisplayName($displayName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDatasetVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $datasetVersion = new DatasetVersion(); - $datasetVersionMetadata = new Value(); - $datasetVersion->setMetadata($datasetVersionMetadata); - $response = $gapicClient->createDatasetVersion($formattedParent, $datasetVersion); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/CreateDatasetVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDatasetVersion(); - $this->assertProtobufEquals($datasetVersion, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatasetVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDatasetVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatasetVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $datasetVersion = new DatasetVersion(); - $datasetVersionMetadata = new Value(); - $datasetVersion->setMetadata($datasetVersionMetadata); - $response = $gapicClient->createDatasetVersion($formattedParent, $datasetVersion); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatasetVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatasetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDatasetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $response = $gapicClient->deleteDataset($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/DeleteDataset', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatasetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatasetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $response = $gapicClient->deleteDataset($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatasetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatasetVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatasetVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDatasetVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $response = $gapicClient->deleteDatasetVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/DeleteDatasetVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatasetVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatasetVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatasetVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $response = $gapicClient->deleteDatasetVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatasetVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteSavedQueryTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteSavedQueryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteSavedQueryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->savedQueryName('[PROJECT]', '[LOCATION]', '[DATASET]', '[SAVED_QUERY]'); - $response = $gapicClient->deleteSavedQuery($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/DeleteSavedQuery', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteSavedQueryTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteSavedQueryExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteSavedQueryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->savedQueryName('[PROJECT]', '[LOCATION]', '[DATASET]', '[SAVED_QUERY]'); - $response = $gapicClient->deleteSavedQuery($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteSavedQueryTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportDataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ExportDataResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportDataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $exportConfig = new ExportDataConfig(); - $response = $gapicClient->exportData($formattedName, $exportConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/ExportData', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getExportConfig(); - $this->assertProtobufEquals($exportConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportDataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $exportConfig = new ExportDataConfig(); - $response = $gapicClient->exportData($formattedName, $exportConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getAnnotationSpecTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new AnnotationSpec(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->annotationSpecName('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); - $response = $gapicClient->getAnnotationSpec($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/GetAnnotationSpec', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAnnotationSpecExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->annotationSpecName('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); - try { - $gapicClient->getAnnotationSpec($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDatasetTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $metadataSchemaUri = 'metadataSchemaUri-152319778'; - $dataItemCount = 2014260376; - $etag = 'etag3123477'; - $metadataArtifact = 'metadataArtifact2087706850'; - $expectedResponse = new Dataset(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setMetadataSchemaUri($metadataSchemaUri); - $expectedResponse->setDataItemCount($dataItemCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setMetadataArtifact($metadataArtifact); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $response = $gapicClient->getDataset($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/GetDataset', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDatasetExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - try { - $gapicClient->getDataset($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDatasetVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $bigQueryDatasetName = 'bigQueryDatasetName-1230960216'; - $displayName = 'displayName1615086568'; - $expectedResponse = new DatasetVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setBigQueryDatasetName($bigQueryDatasetName); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $response = $gapicClient->getDatasetVersion($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/GetDatasetVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDatasetVersionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - try { - $gapicClient->getDatasetVersion($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importDataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportDataResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importDataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $importConfigs = []; - $response = $gapicClient->importData($formattedName, $importConfigs); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/ImportData', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getImportConfigs(); - $this->assertProtobufEquals($importConfigs, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importDataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $importConfigs = []; - $response = $gapicClient->importData($formattedName, $importConfigs); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listAnnotationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $annotationsElement = new Annotation(); - $annotations = [ - $annotationsElement, - ]; - $expectedResponse = new ListAnnotationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAnnotations($annotations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->dataItemName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATA_ITEM]'); - $response = $gapicClient->listAnnotations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAnnotations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/ListAnnotations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAnnotationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->dataItemName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATA_ITEM]'); - try { - $gapicClient->listAnnotations($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataItemsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $dataItemsElement = new DataItem(); - $dataItems = [ - $dataItemsElement, - ]; - $expectedResponse = new ListDataItemsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDataItems($dataItems); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $response = $gapicClient->listDataItems($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDataItems()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/ListDataItems', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataItemsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - try { - $gapicClient->listDataItems($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDatasetVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $datasetVersionsElement = new DatasetVersion(); - $datasetVersions = [ - $datasetVersionsElement, - ]; - $expectedResponse = new ListDatasetVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDatasetVersions($datasetVersions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $response = $gapicClient->listDatasetVersions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDatasetVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/ListDatasetVersions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDatasetVersionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - try { - $gapicClient->listDatasetVersions($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDatasetsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $datasetsElement = new Dataset(); - $datasets = [ - $datasetsElement, - ]; - $expectedResponse = new ListDatasetsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDatasets($datasets); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listDatasets($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDatasets()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/ListDatasets', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDatasetsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listDatasets($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSavedQueriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $savedQueriesElement = new SavedQuery(); - $savedQueries = [ - $savedQueriesElement, - ]; - $expectedResponse = new ListSavedQueriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSavedQueries($savedQueries); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $response = $gapicClient->listSavedQueries($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSavedQueries()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/ListSavedQueries', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSavedQueriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - try { - $gapicClient->listSavedQueries($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restoreDatasetVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreDatasetVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $bigQueryDatasetName = 'bigQueryDatasetName-1230960216'; - $displayName = 'displayName1615086568'; - $expectedResponse = new DatasetVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setBigQueryDatasetName($bigQueryDatasetName); - $expectedResponse->setDisplayName($displayName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreDatasetVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $response = $gapicClient->restoreDatasetVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/RestoreDatasetVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreDatasetVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreDatasetVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreDatasetVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->datasetVersionName('[PROJECT]', '[LOCATION]', '[DATASET]', '[DATASET_VERSION]'); - $response = $gapicClient->restoreDatasetVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreDatasetVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function searchDataItemsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $dataItemViewsElement = new DataItemView(); - $dataItemViews = [ - $dataItemViewsElement, - ]; - $expectedResponse = new SearchDataItemsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDataItemViews($dataItemViews); - $transport->addResponse($expectedResponse); - // Mock request - $formattedDataset = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - $response = $gapicClient->searchDataItems($formattedDataset); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDataItemViews()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/SearchDataItems', $actualFuncCall); - $actualValue = $actualRequestObject->getDataset(); - $this->assertProtobufEquals($formattedDataset, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchDataItemsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedDataset = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); - try { - $gapicClient->searchDataItems($formattedDataset); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDatasetTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $metadataSchemaUri = 'metadataSchemaUri-152319778'; - $dataItemCount = 2014260376; - $etag = 'etag3123477'; - $metadataArtifact = 'metadataArtifact2087706850'; - $expectedResponse = new Dataset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setMetadataSchemaUri($metadataSchemaUri); - $expectedResponse->setDataItemCount($dataItemCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setMetadataArtifact($metadataArtifact); - $transport->addResponse($expectedResponse); - // Mock request - $dataset = new Dataset(); - $datasetDisplayName = 'datasetDisplayName1912393429'; - $dataset->setDisplayName($datasetDisplayName); - $datasetMetadataSchemaUri = 'datasetMetadataSchemaUri-1520763900'; - $dataset->setMetadataSchemaUri($datasetMetadataSchemaUri); - $datasetMetadata = new Value(); - $dataset->setMetadata($datasetMetadata); - $updateMask = new FieldMask(); - $response = $gapicClient->updateDataset($dataset, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DatasetService/UpdateDataset', $actualFuncCall); - $actualValue = $actualRequestObject->getDataset(); - $this->assertProtobufEquals($dataset, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDatasetExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $dataset = new Dataset(); - $datasetDisplayName = 'datasetDisplayName1912393429'; - $dataset->setDisplayName($datasetDisplayName); - $datasetMetadataSchemaUri = 'datasetMetadataSchemaUri-1520763900'; - $dataset->setMetadataSchemaUri($datasetMetadataSchemaUri); - $datasetMetadata = new Value(); - $dataset->setMetadata($datasetMetadata); - $updateMask = new FieldMask(); - try { - $gapicClient->updateDataset($dataset, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/DeploymentResourcePoolServiceClientTest.php b/AiPlatform/tests/Unit/V1/DeploymentResourcePoolServiceClientTest.php deleted file mode 100644 index 8f21eea6974d..000000000000 --- a/AiPlatform/tests/Unit/V1/DeploymentResourcePoolServiceClientTest.php +++ /dev/null @@ -1,841 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DeploymentResourcePoolServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DeploymentResourcePoolServiceClient($options); - } - - /** @test */ - public function createDeploymentResourcePoolTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDeploymentResourcePoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new DeploymentResourcePool(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDeploymentResourcePoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $deploymentResourcePool = new DeploymentResourcePool(); - $deploymentResourcePoolDedicatedResources = new DedicatedResources(); - $dedicatedResourcesMachineSpec = new MachineSpec(); - $deploymentResourcePoolDedicatedResources->setMachineSpec($dedicatedResourcesMachineSpec); - $dedicatedResourcesMinReplicaCount = 386489645; - $deploymentResourcePoolDedicatedResources->setMinReplicaCount($dedicatedResourcesMinReplicaCount); - $deploymentResourcePool->setDedicatedResources($deploymentResourcePoolDedicatedResources); - $deploymentResourcePoolId = 'deploymentResourcePoolId732232487'; - $response = $gapicClient->createDeploymentResourcePool($formattedParent, $deploymentResourcePool, $deploymentResourcePoolId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/CreateDeploymentResourcePool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDeploymentResourcePool(); - $this->assertProtobufEquals($deploymentResourcePool, $actualValue); - $actualValue = $actualApiRequestObject->getDeploymentResourcePoolId(); - $this->assertProtobufEquals($deploymentResourcePoolId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDeploymentResourcePoolTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDeploymentResourcePoolExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDeploymentResourcePoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $deploymentResourcePool = new DeploymentResourcePool(); - $deploymentResourcePoolDedicatedResources = new DedicatedResources(); - $dedicatedResourcesMachineSpec = new MachineSpec(); - $deploymentResourcePoolDedicatedResources->setMachineSpec($dedicatedResourcesMachineSpec); - $dedicatedResourcesMinReplicaCount = 386489645; - $deploymentResourcePoolDedicatedResources->setMinReplicaCount($dedicatedResourcesMinReplicaCount); - $deploymentResourcePool->setDedicatedResources($deploymentResourcePoolDedicatedResources); - $deploymentResourcePoolId = 'deploymentResourcePoolId732232487'; - $response = $gapicClient->createDeploymentResourcePool($formattedParent, $deploymentResourcePool, $deploymentResourcePoolId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDeploymentResourcePoolTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDeploymentResourcePoolTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDeploymentResourcePoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDeploymentResourcePoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - $response = $gapicClient->deleteDeploymentResourcePool($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/DeleteDeploymentResourcePool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDeploymentResourcePoolTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDeploymentResourcePoolExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDeploymentResourcePoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - $response = $gapicClient->deleteDeploymentResourcePool($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDeploymentResourcePoolTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getDeploymentResourcePoolTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new DeploymentResourcePool(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - $response = $gapicClient->getDeploymentResourcePool($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/GetDeploymentResourcePool', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDeploymentResourcePoolExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->deploymentResourcePoolName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_RESOURCE_POOL]'); - try { - $gapicClient->getDeploymentResourcePool($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDeploymentResourcePoolsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $deploymentResourcePoolsElement = new DeploymentResourcePool(); - $deploymentResourcePools = [ - $deploymentResourcePoolsElement, - ]; - $expectedResponse = new ListDeploymentResourcePoolsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDeploymentResourcePools($deploymentResourcePools); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listDeploymentResourcePools($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDeploymentResourcePools()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/ListDeploymentResourcePools', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDeploymentResourcePoolsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listDeploymentResourcePools($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryDeployedModelsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalDeployedModelCount = 591684507; - $totalEndpointCount = 61124672; - $deployedModelsElement = new DeployedModel(); - $deployedModels = [ - $deployedModelsElement, - ]; - $expectedResponse = new QueryDeployedModelsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalDeployedModelCount($totalDeployedModelCount); - $expectedResponse->setTotalEndpointCount($totalEndpointCount); - $expectedResponse->setDeployedModels($deployedModels); - $transport->addResponse($expectedResponse); - // Mock request - $deploymentResourcePool = 'deploymentResourcePool-1160399437'; - $response = $gapicClient->queryDeployedModels($deploymentResourcePool); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDeployedModels()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.DeploymentResourcePoolService/QueryDeployedModels', $actualFuncCall); - $actualValue = $actualRequestObject->getDeploymentResourcePool(); - $this->assertProtobufEquals($deploymentResourcePool, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryDeployedModelsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $deploymentResourcePool = 'deploymentResourcePool-1160399437'; - try { - $gapicClient->queryDeployedModels($deploymentResourcePool); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/EndpointServiceClientTest.php b/AiPlatform/tests/Unit/V1/EndpointServiceClientTest.php deleted file mode 100644 index 314831724b7b..000000000000 --- a/AiPlatform/tests/Unit/V1/EndpointServiceClientTest.php +++ /dev/null @@ -1,1237 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return EndpointServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new EndpointServiceClient($options); - } - - /** @test */ - public function createEndpointTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $network = 'network1843485230'; - $enablePrivateServiceConnect = true; - $modelDeploymentMonitoringJob = 'modelDeploymentMonitoringJob1797127786'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setNetwork($network); - $expectedResponse->setEnablePrivateServiceConnect($enablePrivateServiceConnect); - $expectedResponse->setModelDeploymentMonitoringJob($modelDeploymentMonitoringJob); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createEndpointTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $endpoint = new Endpoint(); - $endpointDisplayName = 'endpointDisplayName697270680'; - $endpoint->setDisplayName($endpointDisplayName); - $response = $gapicClient->createEndpoint($formattedParent, $endpoint); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.EndpointService/CreateEndpoint', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEndpointTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEndpointExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $endpoint = new Endpoint(); - $endpointDisplayName = 'endpointDisplayName697270680'; - $endpoint->setDisplayName($endpointDisplayName); - $response = $gapicClient->createEndpoint($formattedParent, $endpoint); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEndpointTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEndpointTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteEndpointTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $response = $gapicClient->deleteEndpoint($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.EndpointService/DeleteEndpoint', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEndpointTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEndpointExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $response = $gapicClient->deleteEndpoint($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEndpointTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new DeployModelResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deployModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $deployedModel = new DeployedModel(); - $deployedModelModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $deployedModel->setModel($deployedModelModel); - $response = $gapicClient->deployModel($formattedEndpoint, $deployedModel); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.EndpointService/DeployModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $actualValue = $actualApiRequestObject->getDeployedModel(); - $this->assertProtobufEquals($deployedModel, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $deployedModel = new DeployedModel(); - $deployedModelModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $deployedModel->setModel($deployedModelModel); - $response = $gapicClient->deployModel($formattedEndpoint, $deployedModel); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $network = 'network1843485230'; - $enablePrivateServiceConnect = true; - $modelDeploymentMonitoringJob = 'modelDeploymentMonitoringJob1797127786'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setNetwork($network); - $expectedResponse->setEnablePrivateServiceConnect($enablePrivateServiceConnect); - $expectedResponse->setModelDeploymentMonitoringJob($modelDeploymentMonitoringJob); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $response = $gapicClient->getEndpoint($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.EndpointService/GetEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - try { - $gapicClient->getEndpoint($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $endpointsElement = new Endpoint(); - $endpoints = [ - $endpointsElement, - ]; - $expectedResponse = new ListEndpointsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEndpoints($endpoints); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listEndpoints($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEndpoints()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.EndpointService/ListEndpoints', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listEndpoints($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function mutateDeployedModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/mutateDeployedModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new MutateDeployedModelResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/mutateDeployedModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $deployedModel = new DeployedModel(); - $deployedModelModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $deployedModel->setModel($deployedModelModel); - $updateMask = new FieldMask(); - $response = $gapicClient->mutateDeployedModel($formattedEndpoint, $deployedModel, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.EndpointService/MutateDeployedModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $actualValue = $actualApiRequestObject->getDeployedModel(); - $this->assertProtobufEquals($deployedModel, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/mutateDeployedModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function mutateDeployedModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/mutateDeployedModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $deployedModel = new DeployedModel(); - $deployedModelModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $deployedModel->setModel($deployedModelModel); - $updateMask = new FieldMask(); - $response = $gapicClient->mutateDeployedModel($formattedEndpoint, $deployedModel, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/mutateDeployedModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeployModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new UndeployModelResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeployModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $deployedModelId = 'deployedModelId866642506'; - $response = $gapicClient->undeployModel($formattedEndpoint, $deployedModelId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.EndpointService/UndeployModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $actualValue = $actualApiRequestObject->getDeployedModelId(); - $this->assertProtobufEquals($deployedModelId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeployModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $deployedModelId = 'deployedModelId866642506'; - $response = $gapicClient->undeployModel($formattedEndpoint, $deployedModelId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $network = 'network1843485230'; - $enablePrivateServiceConnect = true; - $modelDeploymentMonitoringJob = 'modelDeploymentMonitoringJob1797127786'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setNetwork($network); - $expectedResponse->setEnablePrivateServiceConnect($enablePrivateServiceConnect); - $expectedResponse->setModelDeploymentMonitoringJob($modelDeploymentMonitoringJob); - $transport->addResponse($expectedResponse); - // Mock request - $endpoint = new Endpoint(); - $endpointDisplayName = 'endpointDisplayName697270680'; - $endpoint->setDisplayName($endpointDisplayName); - $updateMask = new FieldMask(); - $response = $gapicClient->updateEndpoint($endpoint, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.EndpointService/UpdateEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $endpoint = new Endpoint(); - $endpointDisplayName = 'endpointDisplayName697270680'; - $endpoint->setDisplayName($endpointDisplayName); - $updateMask = new FieldMask(); - try { - $gapicClient->updateEndpoint($endpoint, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/FeatureOnlineStoreAdminServiceClientTest.php b/AiPlatform/tests/Unit/V1/FeatureOnlineStoreAdminServiceClientTest.php deleted file mode 100644 index f535822129fe..000000000000 --- a/AiPlatform/tests/Unit/V1/FeatureOnlineStoreAdminServiceClientTest.php +++ /dev/null @@ -1,1568 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FeatureOnlineStoreAdminServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FeatureOnlineStoreAdminServiceClient($options); - } - - /** @test */ - public function createFeatureOnlineStoreTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureOnlineStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $expectedResponse = new FeatureOnlineStore(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFeatureOnlineStoreTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $featureOnlineStore = new FeatureOnlineStore(); - $featureOnlineStoreId = 'featureOnlineStoreId-10760612'; - $response = $gapicClient->createFeatureOnlineStore($formattedParent, $featureOnlineStore, $featureOnlineStoreId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/CreateFeatureOnlineStore', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureOnlineStore(); - $this->assertProtobufEquals($featureOnlineStore, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureOnlineStoreId(); - $this->assertProtobufEquals($featureOnlineStoreId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureOnlineStoreTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeatureOnlineStoreExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureOnlineStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $featureOnlineStore = new FeatureOnlineStore(); - $featureOnlineStoreId = 'featureOnlineStoreId-10760612'; - $response = $gapicClient->createFeatureOnlineStore($formattedParent, $featureOnlineStore, $featureOnlineStoreId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureOnlineStoreTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeatureViewTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $expectedResponse = new FeatureView(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFeatureViewTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $featureView = new FeatureView(); - $featureViewId = 'featureViewId-1041382228'; - $response = $gapicClient->createFeatureView($formattedParent, $featureView, $featureViewId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/CreateFeatureView', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureView(); - $this->assertProtobufEquals($featureView, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureViewId(); - $this->assertProtobufEquals($featureViewId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureViewTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeatureViewExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $featureView = new FeatureView(); - $featureViewId = 'featureViewId-1041382228'; - $response = $gapicClient->createFeatureView($formattedParent, $featureView, $featureViewId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureViewTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureOnlineStoreTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureOnlineStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFeatureOnlineStoreTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $response = $gapicClient->deleteFeatureOnlineStore($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/DeleteFeatureOnlineStore', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureOnlineStoreTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureOnlineStoreExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureOnlineStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $response = $gapicClient->deleteFeatureOnlineStore($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureOnlineStoreTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureViewTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFeatureViewTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $response = $gapicClient->deleteFeatureView($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/DeleteFeatureView', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureViewTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureViewExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $response = $gapicClient->deleteFeatureView($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureViewTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFeatureOnlineStoreTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $expectedResponse = new FeatureOnlineStore(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $response = $gapicClient->getFeatureOnlineStore($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/GetFeatureOnlineStore', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureOnlineStoreExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - try { - $gapicClient->getFeatureOnlineStore($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureViewTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $expectedResponse = new FeatureView(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $response = $gapicClient->getFeatureView($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/GetFeatureView', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureViewExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - try { - $gapicClient->getFeatureView($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureViewSyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new FeatureViewSync(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->featureViewSyncName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $response = $gapicClient->getFeatureViewSync($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/GetFeatureViewSync', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureViewSyncExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureViewSyncName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - try { - $gapicClient->getFeatureViewSync($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeatureOnlineStoresTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $featureOnlineStoresElement = new FeatureOnlineStore(); - $featureOnlineStores = [ - $featureOnlineStoresElement, - ]; - $expectedResponse = new ListFeatureOnlineStoresResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFeatureOnlineStores($featureOnlineStores); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listFeatureOnlineStores($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFeatureOnlineStores()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/ListFeatureOnlineStores', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeatureOnlineStoresExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listFeatureOnlineStores($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeatureViewSyncsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $featureViewSyncsElement = new FeatureViewSync(); - $featureViewSyncs = [ - $featureViewSyncsElement, - ]; - $expectedResponse = new ListFeatureViewSyncsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFeatureViewSyncs($featureViewSyncs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $response = $gapicClient->listFeatureViewSyncs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFeatureViewSyncs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/ListFeatureViewSyncs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeatureViewSyncsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - try { - $gapicClient->listFeatureViewSyncs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeatureViewsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $featureViewsElement = new FeatureView(); - $featureViews = [ - $featureViewsElement, - ]; - $expectedResponse = new ListFeatureViewsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFeatureViews($featureViews); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - $response = $gapicClient->listFeatureViews($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFeatureViews()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/ListFeatureViews', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeatureViewsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->featureOnlineStoreName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]'); - try { - $gapicClient->listFeatureViews($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function syncFeatureViewTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $featureViewSync = 'featureViewSync-40619540'; - $expectedResponse = new SyncFeatureViewResponse(); - $expectedResponse->setFeatureViewSync($featureViewSync); - $transport->addResponse($expectedResponse); - // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $response = $gapicClient->syncFeatureView($formattedFeatureView); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/SyncFeatureView', $actualFuncCall); - $actualValue = $actualRequestObject->getFeatureView(); - $this->assertProtobufEquals($formattedFeatureView, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function syncFeatureViewExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - try { - $gapicClient->syncFeatureView($formattedFeatureView); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFeatureOnlineStoreTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureOnlineStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $expectedResponse = new FeatureOnlineStore(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFeatureOnlineStoreTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $featureOnlineStore = new FeatureOnlineStore(); - $response = $gapicClient->updateFeatureOnlineStore($featureOnlineStore); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/UpdateFeatureOnlineStore', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFeatureOnlineStore(); - $this->assertProtobufEquals($featureOnlineStore, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureOnlineStoreTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFeatureOnlineStoreExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureOnlineStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $featureOnlineStore = new FeatureOnlineStore(); - $response = $gapicClient->updateFeatureOnlineStore($featureOnlineStore); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureOnlineStoreTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFeatureViewTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $expectedResponse = new FeatureView(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFeatureViewTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $featureView = new FeatureView(); - $response = $gapicClient->updateFeatureView($featureView); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService/UpdateFeatureView', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFeatureView(); - $this->assertProtobufEquals($featureView, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureViewTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFeatureViewExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $featureView = new FeatureView(); - $response = $gapicClient->updateFeatureView($featureView); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureViewTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/FeatureOnlineStoreServiceClientTest.php b/AiPlatform/tests/Unit/V1/FeatureOnlineStoreServiceClientTest.php deleted file mode 100644 index 5007b6696c1b..000000000000 --- a/AiPlatform/tests/Unit/V1/FeatureOnlineStoreServiceClientTest.php +++ /dev/null @@ -1,497 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FeatureOnlineStoreServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FeatureOnlineStoreServiceClient($options); - } - - /** @test */ - public function fetchFeatureValuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FetchFeatureValuesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $response = $gapicClient->fetchFeatureValues($formattedFeatureView); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreService/FetchFeatureValues', $actualFuncCall); - $actualValue = $actualRequestObject->getFeatureView(); - $this->assertProtobufEquals($formattedFeatureView, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchFeatureValuesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - try { - $gapicClient->fetchFeatureValues($formattedFeatureView); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchNearestEntitiesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new SearchNearestEntitiesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $query = new NearestNeighborQuery(); - $response = $gapicClient->searchNearestEntities($formattedFeatureView, $query); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureOnlineStoreService/SearchNearestEntities', $actualFuncCall); - $actualValue = $actualRequestObject->getFeatureView(); - $this->assertProtobufEquals($formattedFeatureView, $actualValue); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchNearestEntitiesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedFeatureView = $gapicClient->featureViewName('[PROJECT]', '[LOCATION]', '[FEATURE_ONLINE_STORE]', '[FEATURE_VIEW]'); - $query = new NearestNeighborQuery(); - try { - $gapicClient->searchNearestEntities($formattedFeatureView, $query); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/FeatureRegistryServiceClientTest.php b/AiPlatform/tests/Unit/V1/FeatureRegistryServiceClientTest.php deleted file mode 100644 index a224521d73af..000000000000 --- a/AiPlatform/tests/Unit/V1/FeatureRegistryServiceClientTest.php +++ /dev/null @@ -1,1407 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FeatureRegistryServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FeatureRegistryServiceClient($options); - } - - /** @test */ - public function createFeatureTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $disableMonitoring = false; - $versionColumnName = 'versionColumnName-1981743891'; - $pointOfContact = 'pointOfContact1207498695'; - $expectedResponse = new Feature(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setDisableMonitoring($disableMonitoring); - $expectedResponse->setVersionColumnName($versionColumnName); - $expectedResponse->setPointOfContact($pointOfContact); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFeatureTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $feature = new Feature(); - $featureId = 'featureId-150697212'; - $response = $gapicClient->createFeature($formattedParent, $feature, $featureId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/CreateFeature', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFeature(); - $this->assertProtobufEquals($feature, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureId(); - $this->assertProtobufEquals($featureId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeatureExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $feature = new Feature(); - $featureId = 'featureId-150697212'; - $response = $gapicClient->createFeature($formattedParent, $feature, $featureId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeatureGroupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $description = 'description-1724546052'; - $expectedResponse = new FeatureGroup(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFeatureGroupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $featureGroup = new FeatureGroup(); - $featureGroupId = 'featureGroupId1387078148'; - $response = $gapicClient->createFeatureGroup($formattedParent, $featureGroup, $featureGroupId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/CreateFeatureGroup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureGroup(); - $this->assertProtobufEquals($featureGroup, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureGroupId(); - $this->assertProtobufEquals($featureGroupId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureGroupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeatureGroupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $featureGroup = new FeatureGroup(); - $featureGroupId = 'featureGroupId1387078148'; - $response = $gapicClient->createFeatureGroup($formattedParent, $featureGroup, $featureGroupId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureGroupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFeatureTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $response = $gapicClient->deleteFeature($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/DeleteFeature', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $response = $gapicClient->deleteFeature($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureGroupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFeatureGroupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - $response = $gapicClient->deleteFeatureGroup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/DeleteFeatureGroup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureGroupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureGroupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - $response = $gapicClient->deleteFeatureGroup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureGroupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFeatureTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $disableMonitoring = false; - $versionColumnName = 'versionColumnName-1981743891'; - $pointOfContact = 'pointOfContact1207498695'; - $expectedResponse = new Feature(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setDisableMonitoring($disableMonitoring); - $expectedResponse->setVersionColumnName($versionColumnName); - $expectedResponse->setPointOfContact($pointOfContact); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $response = $gapicClient->getFeature($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/GetFeature', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - try { - $gapicClient->getFeature($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureGroupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $description = 'description-1724546052'; - $expectedResponse = new FeatureGroup(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - $response = $gapicClient->getFeatureGroup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/GetFeatureGroup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureGroupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureGroupName('[PROJECT]', '[LOCATION]', '[FEATURE_GROUP]'); - try { - $gapicClient->getFeatureGroup($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeatureGroupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $featureGroupsElement = new FeatureGroup(); - $featureGroups = [ - $featureGroupsElement, - ]; - $expectedResponse = new ListFeatureGroupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFeatureGroups($featureGroups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listFeatureGroups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFeatureGroups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/ListFeatureGroups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeatureGroupsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listFeatureGroups($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeaturesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $featuresElement = new Feature(); - $features = [ - $featuresElement, - ]; - $expectedResponse = new ListFeaturesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFeatures($features); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $response = $gapicClient->listFeatures($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFeatures()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/ListFeatures', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeaturesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - try { - $gapicClient->listFeatures($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFeatureTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $disableMonitoring = false; - $versionColumnName = 'versionColumnName-1981743891'; - $pointOfContact = 'pointOfContact1207498695'; - $expectedResponse = new Feature(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setDisableMonitoring($disableMonitoring); - $expectedResponse->setVersionColumnName($versionColumnName); - $expectedResponse->setPointOfContact($pointOfContact); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFeatureTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $feature = new Feature(); - $response = $gapicClient->updateFeature($feature); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/UpdateFeature', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFeature(); - $this->assertProtobufEquals($feature, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFeatureExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $feature = new Feature(); - $response = $gapicClient->updateFeature($feature); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFeatureGroupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $description = 'description-1724546052'; - $expectedResponse = new FeatureGroup(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFeatureGroupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $featureGroup = new FeatureGroup(); - $response = $gapicClient->updateFeatureGroup($featureGroup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeatureRegistryService/UpdateFeatureGroup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFeatureGroup(); - $this->assertProtobufEquals($featureGroup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureGroupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFeatureGroupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $featureGroup = new FeatureGroup(); - $response = $gapicClient->updateFeatureGroup($featureGroup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureGroupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/FeaturestoreOnlineServingServiceClientTest.php b/AiPlatform/tests/Unit/V1/FeaturestoreOnlineServingServiceClientTest.php deleted file mode 100644 index 6979e443a946..000000000000 --- a/AiPlatform/tests/Unit/V1/FeaturestoreOnlineServingServiceClientTest.php +++ /dev/null @@ -1,601 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FeaturestoreOnlineServingServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FeaturestoreOnlineServingServiceClient($options); - } - - /** @test */ - public function readFeatureValuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReadFeatureValuesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $entityId = 'entityId-740565257'; - $featureSelector = new FeatureSelector(); - $featureSelectorIdMatcher = new IdMatcher(); - $idMatcherIds = []; - $featureSelectorIdMatcher->setIds($idMatcherIds); - $featureSelector->setIdMatcher($featureSelectorIdMatcher); - $response = $gapicClient->readFeatureValues($formattedEntityType, $entityId, $featureSelector); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/ReadFeatureValues', $actualFuncCall); - $actualValue = $actualRequestObject->getEntityType(); - $this->assertProtobufEquals($formattedEntityType, $actualValue); - $actualValue = $actualRequestObject->getEntityId(); - $this->assertProtobufEquals($entityId, $actualValue); - $actualValue = $actualRequestObject->getFeatureSelector(); - $this->assertProtobufEquals($featureSelector, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readFeatureValuesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $entityId = 'entityId-740565257'; - $featureSelector = new FeatureSelector(); - $featureSelectorIdMatcher = new IdMatcher(); - $idMatcherIds = []; - $featureSelectorIdMatcher->setIds($idMatcherIds); - $featureSelector->setIdMatcher($featureSelectorIdMatcher); - try { - $gapicClient->readFeatureValues($formattedEntityType, $entityId, $featureSelector); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingReadFeatureValuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReadFeatureValuesResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new ReadFeatureValuesResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new ReadFeatureValuesResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $entityIds = []; - $featureSelector = new FeatureSelector(); - $featureSelectorIdMatcher = new IdMatcher(); - $idMatcherIds = []; - $featureSelectorIdMatcher->setIds($idMatcherIds); - $featureSelector->setIdMatcher($featureSelectorIdMatcher); - $serverStream = $gapicClient->streamingReadFeatureValues($formattedEntityType, $entityIds, $featureSelector); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/StreamingReadFeatureValues', $actualFuncCall); - $actualValue = $actualRequestObject->getEntityType(); - $this->assertProtobufEquals($formattedEntityType, $actualValue); - $actualValue = $actualRequestObject->getEntityIds(); - $this->assertProtobufEquals($entityIds, $actualValue); - $actualValue = $actualRequestObject->getFeatureSelector(); - $this->assertProtobufEquals($featureSelector, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingReadFeatureValuesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $entityIds = []; - $featureSelector = new FeatureSelector(); - $featureSelectorIdMatcher = new IdMatcher(); - $idMatcherIds = []; - $featureSelectorIdMatcher->setIds($idMatcherIds); - $featureSelector->setIdMatcher($featureSelectorIdMatcher); - $serverStream = $gapicClient->streamingReadFeatureValues($formattedEntityType, $entityIds, $featureSelector); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeFeatureValuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new WriteFeatureValuesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $payloads = []; - $response = $gapicClient->writeFeatureValues($formattedEntityType, $payloads); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/WriteFeatureValues', $actualFuncCall); - $actualValue = $actualRequestObject->getEntityType(); - $this->assertProtobufEquals($formattedEntityType, $actualValue); - $actualValue = $actualRequestObject->getPayloads(); - $this->assertProtobufEquals($payloads, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeFeatureValuesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $payloads = []; - try { - $gapicClient->writeFeatureValues($formattedEntityType, $payloads); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/FeaturestoreServiceClientTest.php b/AiPlatform/tests/Unit/V1/FeaturestoreServiceClientTest.php deleted file mode 100644 index 9ff4b63043f5..000000000000 --- a/AiPlatform/tests/Unit/V1/FeaturestoreServiceClientTest.php +++ /dev/null @@ -1,2498 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FeaturestoreServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FeaturestoreServiceClient($options); - } - - /** @test */ - public function batchCreateFeaturesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchCreateFeaturesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchCreateFeaturesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchCreateFeaturesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $requests = []; - $response = $gapicClient->batchCreateFeatures($formattedParent, $requests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/BatchCreateFeatures', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateFeaturesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchCreateFeaturesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchCreateFeaturesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $requests = []; - $response = $gapicClient->batchCreateFeatures($formattedParent, $requests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateFeaturesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchReadFeatureValuesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchReadFeatureValuesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchReadFeatureValuesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchReadFeatureValuesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedFeaturestore = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $destination = new FeatureValueDestination(); - $entityTypeSpecs = []; - $response = $gapicClient->batchReadFeatureValues($formattedFeaturestore, $destination, $entityTypeSpecs); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/BatchReadFeatureValues', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFeaturestore(); - $this->assertProtobufEquals($formattedFeaturestore, $actualValue); - $actualValue = $actualApiRequestObject->getDestination(); - $this->assertProtobufEquals($destination, $actualValue); - $actualValue = $actualApiRequestObject->getEntityTypeSpecs(); - $this->assertProtobufEquals($entityTypeSpecs, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchReadFeatureValuesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchReadFeatureValuesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchReadFeatureValuesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedFeaturestore = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $destination = new FeatureValueDestination(); - $entityTypeSpecs = []; - $response = $gapicClient->batchReadFeatureValues($formattedFeaturestore, $destination, $entityTypeSpecs); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchReadFeatureValuesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEntityTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEntityTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $offlineStorageTtlDays = 844678422; - $expectedResponse = new EntityType(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setOfflineStorageTtlDays($offlineStorageTtlDays); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createEntityTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $entityTypeId = 'entityTypeId1181734884'; - $response = $gapicClient->createEntityType($formattedParent, $entityTypeId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/CreateEntityType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getEntityTypeId(); - $this->assertProtobufEquals($entityTypeId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEntityTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEntityTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEntityTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $entityTypeId = 'entityTypeId1181734884'; - $response = $gapicClient->createEntityType($formattedParent, $entityTypeId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEntityTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeatureTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $disableMonitoring = false; - $versionColumnName = 'versionColumnName-1981743891'; - $pointOfContact = 'pointOfContact1207498695'; - $expectedResponse = new Feature(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setDisableMonitoring($disableMonitoring); - $expectedResponse->setVersionColumnName($versionColumnName); - $expectedResponse->setPointOfContact($pointOfContact); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFeatureTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $feature = new Feature(); - $featureId = 'featureId-150697212'; - $response = $gapicClient->createFeature($formattedParent, $feature, $featureId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/CreateFeature', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFeature(); - $this->assertProtobufEquals($feature, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureId(); - $this->assertProtobufEquals($featureId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeatureExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $feature = new Feature(); - $featureId = 'featureId-150697212'; - $response = $gapicClient->createFeature($formattedParent, $feature, $featureId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeatureTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeaturestoreTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeaturestoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $onlineStorageTtlDays = 1491501178; - $expectedResponse = new Featurestore(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setOnlineStorageTtlDays($onlineStorageTtlDays); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFeaturestoreTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $featurestore = new Featurestore(); - $featurestoreId = 'featurestoreId-2136676817'; - $response = $gapicClient->createFeaturestore($formattedParent, $featurestore, $featurestoreId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/CreateFeaturestore', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFeaturestore(); - $this->assertProtobufEquals($featurestore, $actualValue); - $actualValue = $actualApiRequestObject->getFeaturestoreId(); - $this->assertProtobufEquals($featurestoreId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeaturestoreTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFeaturestoreExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFeaturestoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $featurestore = new Featurestore(); - $featurestoreId = 'featurestoreId-2136676817'; - $response = $gapicClient->createFeaturestore($formattedParent, $featurestore, $featurestoreId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFeaturestoreTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEntityTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEntityTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteEntityTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $response = $gapicClient->deleteEntityType($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/DeleteEntityType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEntityTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEntityTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEntityTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $response = $gapicClient->deleteEntityType($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEntityTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFeatureTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $response = $gapicClient->deleteFeature($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/DeleteFeature', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $response = $gapicClient->deleteFeature($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureValuesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureValuesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new DeleteFeatureValuesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFeatureValuesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $response = $gapicClient->deleteFeatureValues($formattedEntityType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/DeleteFeatureValues', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEntityType(); - $this->assertProtobufEquals($formattedEntityType, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureValuesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeatureValuesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureValuesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $response = $gapicClient->deleteFeatureValues($formattedEntityType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureValuesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeaturestoreTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeaturestoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFeaturestoreTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $response = $gapicClient->deleteFeaturestore($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/DeleteFeaturestore', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeaturestoreTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFeaturestoreExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeaturestoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $response = $gapicClient->deleteFeaturestore($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeaturestoreTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportFeatureValuesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportFeatureValuesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ExportFeatureValuesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportFeatureValuesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $destination = new FeatureValueDestination(); - $featureSelector = new FeatureSelector(); - $featureSelectorIdMatcher = new IdMatcher(); - $idMatcherIds = []; - $featureSelectorIdMatcher->setIds($idMatcherIds); - $featureSelector->setIdMatcher($featureSelectorIdMatcher); - $response = $gapicClient->exportFeatureValues($formattedEntityType, $destination, $featureSelector); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/ExportFeatureValues', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEntityType(); - $this->assertProtobufEquals($formattedEntityType, $actualValue); - $actualValue = $actualApiRequestObject->getDestination(); - $this->assertProtobufEquals($destination, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureSelector(); - $this->assertProtobufEquals($featureSelector, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportFeatureValuesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportFeatureValuesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportFeatureValuesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $destination = new FeatureValueDestination(); - $featureSelector = new FeatureSelector(); - $featureSelectorIdMatcher = new IdMatcher(); - $idMatcherIds = []; - $featureSelectorIdMatcher->setIds($idMatcherIds); - $featureSelector->setIdMatcher($featureSelectorIdMatcher); - $response = $gapicClient->exportFeatureValues($formattedEntityType, $destination, $featureSelector); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportFeatureValuesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getEntityTypeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $offlineStorageTtlDays = 844678422; - $expectedResponse = new EntityType(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setOfflineStorageTtlDays($offlineStorageTtlDays); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $response = $gapicClient->getEntityType($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/GetEntityType', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntityTypeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - try { - $gapicClient->getEntityType($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $disableMonitoring = false; - $versionColumnName = 'versionColumnName-1981743891'; - $pointOfContact = 'pointOfContact1207498695'; - $expectedResponse = new Feature(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setDisableMonitoring($disableMonitoring); - $expectedResponse->setVersionColumnName($versionColumnName); - $expectedResponse->setPointOfContact($pointOfContact); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - $response = $gapicClient->getFeature($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/GetFeature', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeatureExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featureName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]', '[FEATURE]'); - try { - $gapicClient->getFeature($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeaturestoreTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $onlineStorageTtlDays = 1491501178; - $expectedResponse = new Featurestore(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setOnlineStorageTtlDays($onlineStorageTtlDays); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $response = $gapicClient->getFeaturestore($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/GetFeaturestore', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFeaturestoreExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - try { - $gapicClient->getFeaturestore($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importFeatureValuesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importFeatureValuesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $importedEntityCount = 1840044274; - $importedFeatureValueCount = 1221471427; - $invalidRowCount = 366655966; - $timestampOutsideRetentionRowsCount = 43092019; - $expectedResponse = new ImportFeatureValuesResponse(); - $expectedResponse->setImportedEntityCount($importedEntityCount); - $expectedResponse->setImportedFeatureValueCount($importedFeatureValueCount); - $expectedResponse->setInvalidRowCount($invalidRowCount); - $expectedResponse->setTimestampOutsideRetentionRowsCount($timestampOutsideRetentionRowsCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importFeatureValuesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $featureSpecs = []; - $response = $gapicClient->importFeatureValues($formattedEntityType, $featureSpecs); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/ImportFeatureValues', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEntityType(); - $this->assertProtobufEquals($formattedEntityType, $actualValue); - $actualValue = $actualApiRequestObject->getFeatureSpecs(); - $this->assertProtobufEquals($featureSpecs, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importFeatureValuesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importFeatureValuesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importFeatureValuesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedEntityType = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $featureSpecs = []; - $response = $gapicClient->importFeatureValues($formattedEntityType, $featureSpecs); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importFeatureValuesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listEntityTypesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $entityTypesElement = new EntityType(); - $entityTypes = [ - $entityTypesElement, - ]; - $expectedResponse = new ListEntityTypesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEntityTypes($entityTypes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - $response = $gapicClient->listEntityTypes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEntityTypes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/ListEntityTypes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntityTypesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->featurestoreName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]'); - try { - $gapicClient->listEntityTypes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeaturesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $featuresElement = new Feature(); - $features = [ - $featuresElement, - ]; - $expectedResponse = new ListFeaturesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFeatures($features); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - $response = $gapicClient->listFeatures($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFeatures()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/ListFeatures', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeaturesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[LOCATION]', '[FEATURESTORE]', '[ENTITY_TYPE]'); - try { - $gapicClient->listFeatures($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeaturestoresTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $featurestoresElement = new Featurestore(); - $featurestores = [ - $featurestoresElement, - ]; - $expectedResponse = new ListFeaturestoresResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFeaturestores($featurestores); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listFeaturestores($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFeaturestores()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/ListFeaturestores', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFeaturestoresExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listFeaturestores($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchFeaturesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $featuresElement = new Feature(); - $features = [ - $featuresElement, - ]; - $expectedResponse = new SearchFeaturesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFeatures($features); - $transport->addResponse($expectedResponse); - // Mock request - $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->searchFeatures($formattedLocation); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFeatures()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/SearchFeatures', $actualFuncCall); - $actualValue = $actualRequestObject->getLocation(); - $this->assertProtobufEquals($formattedLocation, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchFeaturesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->searchFeatures($formattedLocation); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEntityTypeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $offlineStorageTtlDays = 844678422; - $expectedResponse = new EntityType(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setOfflineStorageTtlDays($offlineStorageTtlDays); - $transport->addResponse($expectedResponse); - // Mock request - $entityType = new EntityType(); - $response = $gapicClient->updateEntityType($entityType); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/UpdateEntityType', $actualFuncCall); - $actualValue = $actualRequestObject->getEntityType(); - $this->assertProtobufEquals($entityType, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEntityTypeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $entityType = new EntityType(); - try { - $gapicClient->updateEntityType($entityType); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFeatureTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $disableMonitoring = false; - $versionColumnName = 'versionColumnName-1981743891'; - $pointOfContact = 'pointOfContact1207498695'; - $expectedResponse = new Feature(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setDisableMonitoring($disableMonitoring); - $expectedResponse->setVersionColumnName($versionColumnName); - $expectedResponse->setPointOfContact($pointOfContact); - $transport->addResponse($expectedResponse); - // Mock request - $feature = new Feature(); - $response = $gapicClient->updateFeature($feature); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/UpdateFeature', $actualFuncCall); - $actualValue = $actualRequestObject->getFeature(); - $this->assertProtobufEquals($feature, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFeatureExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $feature = new Feature(); - try { - $gapicClient->updateFeature($feature); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFeaturestoreTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeaturestoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $onlineStorageTtlDays = 1491501178; - $expectedResponse = new Featurestore(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setOnlineStorageTtlDays($onlineStorageTtlDays); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFeaturestoreTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $featurestore = new Featurestore(); - $response = $gapicClient->updateFeaturestore($featurestore); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.FeaturestoreService/UpdateFeaturestore', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFeaturestore(); - $this->assertProtobufEquals($featurestore, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeaturestoreTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFeaturestoreExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeaturestoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $featurestore = new Featurestore(); - $response = $gapicClient->updateFeaturestore($featurestore); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeaturestoreTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/GenAiTuningServiceClientTest.php b/AiPlatform/tests/Unit/V1/GenAiTuningServiceClientTest.php deleted file mode 100644 index 260b16c29e29..000000000000 --- a/AiPlatform/tests/Unit/V1/GenAiTuningServiceClientTest.php +++ /dev/null @@ -1,642 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return GenAiTuningServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new GenAiTuningServiceClient($options); - } - - /** @test */ - public function cancelTuningJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - $gapicClient->cancelTuningJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.GenAiTuningService/CancelTuningJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelTuningJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - try { - $gapicClient->cancelTuningJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTuningJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $baseModel = 'baseModel-480754629'; - $name = 'name3373707'; - $tunedModelDisplayName = 'tunedModelDisplayName358986993'; - $description = 'description-1724546052'; - $experiment = 'experiment-85337091'; - $expectedResponse = new TuningJob(); - $expectedResponse->setBaseModel($baseModel); - $expectedResponse->setName($name); - $expectedResponse->setTunedModelDisplayName($tunedModelDisplayName); - $expectedResponse->setDescription($description); - $expectedResponse->setExperiment($experiment); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $tuningJob = new TuningJob(); - $response = $gapicClient->createTuningJob($formattedParent, $tuningJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.GenAiTuningService/CreateTuningJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTuningJob(); - $this->assertProtobufEquals($tuningJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTuningJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $tuningJob = new TuningJob(); - try { - $gapicClient->createTuningJob($formattedParent, $tuningJob); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTuningJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $baseModel = 'baseModel-480754629'; - $name2 = 'name2-1052831874'; - $tunedModelDisplayName = 'tunedModelDisplayName358986993'; - $description = 'description-1724546052'; - $experiment = 'experiment-85337091'; - $expectedResponse = new TuningJob(); - $expectedResponse->setBaseModel($baseModel); - $expectedResponse->setName($name2); - $expectedResponse->setTunedModelDisplayName($tunedModelDisplayName); - $expectedResponse->setDescription($description); - $expectedResponse->setExperiment($experiment); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - $response = $gapicClient->getTuningJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.GenAiTuningService/GetTuningJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTuningJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tuningJobName('[PROJECT]', '[LOCATION]', '[TUNING_JOB]'); - try { - $gapicClient->getTuningJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTuningJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tuningJobsElement = new TuningJob(); - $tuningJobs = [ - $tuningJobsElement, - ]; - $expectedResponse = new ListTuningJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTuningJobs($tuningJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listTuningJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTuningJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.GenAiTuningService/ListTuningJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTuningJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listTuningJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/IndexEndpointServiceClientTest.php b/AiPlatform/tests/Unit/V1/IndexEndpointServiceClientTest.php deleted file mode 100644 index d3cb83c22d93..000000000000 --- a/AiPlatform/tests/Unit/V1/IndexEndpointServiceClientTest.php +++ /dev/null @@ -1,1247 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return IndexEndpointServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new IndexEndpointServiceClient($options); - } - - /** @test */ - public function createIndexEndpointTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $network = 'network1843485230'; - $enablePrivateServiceConnect = true; - $publicEndpointEnabled = false; - $publicEndpointDomainName = 'publicEndpointDomainName2015998354'; - $expectedResponse = new IndexEndpoint(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setNetwork($network); - $expectedResponse->setEnablePrivateServiceConnect($enablePrivateServiceConnect); - $expectedResponse->setPublicEndpointEnabled($publicEndpointEnabled); - $expectedResponse->setPublicEndpointDomainName($publicEndpointDomainName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createIndexEndpointTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $indexEndpoint = new IndexEndpoint(); - $indexEndpointDisplayName = 'indexEndpointDisplayName-894895258'; - $indexEndpoint->setDisplayName($indexEndpointDisplayName); - $response = $gapicClient->createIndexEndpoint($formattedParent, $indexEndpoint); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexEndpointService/CreateIndexEndpoint', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getIndexEndpoint(); - $this->assertProtobufEquals($indexEndpoint, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexEndpointTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createIndexEndpointExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $indexEndpoint = new IndexEndpoint(); - $indexEndpointDisplayName = 'indexEndpointDisplayName-894895258'; - $indexEndpoint->setDisplayName($indexEndpointDisplayName); - $response = $gapicClient->createIndexEndpoint($formattedParent, $indexEndpoint); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexEndpointTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexEndpointTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIndexEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteIndexEndpointTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $response = $gapicClient->deleteIndexEndpoint($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexEndpointService/DeleteIndexEndpoint', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIndexEndpointTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexEndpointExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIndexEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $response = $gapicClient->deleteIndexEndpoint($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIndexEndpointTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new DeployIndexResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deployIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $deployedIndex = new DeployedIndex(); - $deployedIndexId = 'deployedIndexId-1101212953'; - $deployedIndex->setId($deployedIndexId); - $deployedIndexIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $deployedIndex->setIndex($deployedIndexIndex); - $response = $gapicClient->deployIndex($formattedIndexEndpoint, $deployedIndex); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexEndpointService/DeployIndex', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getIndexEndpoint(); - $this->assertProtobufEquals($formattedIndexEndpoint, $actualValue); - $actualValue = $actualApiRequestObject->getDeployedIndex(); - $this->assertProtobufEquals($deployedIndex, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $deployedIndex = new DeployedIndex(); - $deployedIndexId = 'deployedIndexId-1101212953'; - $deployedIndex->setId($deployedIndexId); - $deployedIndexIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $deployedIndex->setIndex($deployedIndexIndex); - $response = $gapicClient->deployIndex($formattedIndexEndpoint, $deployedIndex); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIndexEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $network = 'network1843485230'; - $enablePrivateServiceConnect = true; - $publicEndpointEnabled = false; - $publicEndpointDomainName = 'publicEndpointDomainName2015998354'; - $expectedResponse = new IndexEndpoint(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setNetwork($network); - $expectedResponse->setEnablePrivateServiceConnect($enablePrivateServiceConnect); - $expectedResponse->setPublicEndpointEnabled($publicEndpointEnabled); - $expectedResponse->setPublicEndpointDomainName($publicEndpointDomainName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $response = $gapicClient->getIndexEndpoint($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexEndpointService/GetIndexEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIndexEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - try { - $gapicClient->getIndexEndpoint($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexEndpointsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $indexEndpointsElement = new IndexEndpoint(); - $indexEndpoints = [ - $indexEndpointsElement, - ]; - $expectedResponse = new ListIndexEndpointsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setIndexEndpoints($indexEndpoints); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listIndexEndpoints($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getIndexEndpoints()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexEndpointService/ListIndexEndpoints', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexEndpointsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listIndexEndpoints($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function mutateDeployedIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/mutateDeployedIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new MutateDeployedIndexResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/mutateDeployedIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $deployedIndex = new DeployedIndex(); - $deployedIndexId = 'deployedIndexId-1101212953'; - $deployedIndex->setId($deployedIndexId); - $deployedIndexIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $deployedIndex->setIndex($deployedIndexIndex); - $response = $gapicClient->mutateDeployedIndex($formattedIndexEndpoint, $deployedIndex); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexEndpointService/MutateDeployedIndex', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getIndexEndpoint(); - $this->assertProtobufEquals($formattedIndexEndpoint, $actualValue); - $actualValue = $actualApiRequestObject->getDeployedIndex(); - $this->assertProtobufEquals($deployedIndex, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/mutateDeployedIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function mutateDeployedIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/mutateDeployedIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $deployedIndex = new DeployedIndex(); - $deployedIndexId = 'deployedIndexId-1101212953'; - $deployedIndex->setId($deployedIndexId); - $deployedIndexIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $deployedIndex->setIndex($deployedIndexIndex); - $response = $gapicClient->mutateDeployedIndex($formattedIndexEndpoint, $deployedIndex); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/mutateDeployedIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeployIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new UndeployIndexResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeployIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $deployedIndexId = 'deployedIndexId1598189569'; - $response = $gapicClient->undeployIndex($formattedIndexEndpoint, $deployedIndexId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexEndpointService/UndeployIndex', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getIndexEndpoint(); - $this->assertProtobufEquals($formattedIndexEndpoint, $actualValue); - $actualValue = $actualApiRequestObject->getDeployedIndexId(); - $this->assertProtobufEquals($deployedIndexId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeployIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $deployedIndexId = 'deployedIndexId1598189569'; - $response = $gapicClient->undeployIndex($formattedIndexEndpoint, $deployedIndexId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateIndexEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $network = 'network1843485230'; - $enablePrivateServiceConnect = true; - $publicEndpointEnabled = false; - $publicEndpointDomainName = 'publicEndpointDomainName2015998354'; - $expectedResponse = new IndexEndpoint(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setNetwork($network); - $expectedResponse->setEnablePrivateServiceConnect($enablePrivateServiceConnect); - $expectedResponse->setPublicEndpointEnabled($publicEndpointEnabled); - $expectedResponse->setPublicEndpointDomainName($publicEndpointDomainName); - $transport->addResponse($expectedResponse); - // Mock request - $indexEndpoint = new IndexEndpoint(); - $indexEndpointDisplayName = 'indexEndpointDisplayName-894895258'; - $indexEndpoint->setDisplayName($indexEndpointDisplayName); - $updateMask = new FieldMask(); - $response = $gapicClient->updateIndexEndpoint($indexEndpoint, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexEndpointService/UpdateIndexEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getIndexEndpoint(); - $this->assertProtobufEquals($indexEndpoint, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateIndexEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $indexEndpoint = new IndexEndpoint(); - $indexEndpointDisplayName = 'indexEndpointDisplayName-894895258'; - $indexEndpoint->setDisplayName($indexEndpointDisplayName); - $updateMask = new FieldMask(); - try { - $gapicClient->updateIndexEndpoint($indexEndpoint, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/IndexServiceClientTest.php b/AiPlatform/tests/Unit/V1/IndexServiceClientTest.php deleted file mode 100644 index 73dc363d7e81..000000000000 --- a/AiPlatform/tests/Unit/V1/IndexServiceClientTest.php +++ /dev/null @@ -1,1018 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return IndexServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new IndexServiceClient($options); - } - - /** @test */ - public function createIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $metadataSchemaUri = 'metadataSchemaUri-152319778'; - $etag = 'etag3123477'; - $expectedResponse = new Index(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setMetadataSchemaUri($metadataSchemaUri); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $index = new Index(); - $indexDisplayName = 'indexDisplayName-632619461'; - $index->setDisplayName($indexDisplayName); - $response = $gapicClient->createIndex($formattedParent, $index); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexService/CreateIndex', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getIndex(); - $this->assertProtobufEquals($index, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $index = new Index(); - $indexDisplayName = 'indexDisplayName-632619461'; - $index->setDisplayName($indexDisplayName); - $response = $gapicClient->createIndex($formattedParent, $index); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $response = $gapicClient->deleteIndex($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexService/DeleteIndex', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $response = $gapicClient->deleteIndex($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIndexTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $metadataSchemaUri = 'metadataSchemaUri-152319778'; - $etag = 'etag3123477'; - $expectedResponse = new Index(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setMetadataSchemaUri($metadataSchemaUri); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $response = $gapicClient->getIndex($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexService/GetIndex', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIndexExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - try { - $gapicClient->getIndex($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $indexesElement = new Index(); - $indexes = [ - $indexesElement, - ]; - $expectedResponse = new ListIndexesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setIndexes($indexes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listIndexes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getIndexes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexService/ListIndexes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listIndexes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeDatapointsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RemoveDatapointsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $response = $gapicClient->removeDatapoints($formattedIndex); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexService/RemoveDatapoints', $actualFuncCall); - $actualValue = $actualRequestObject->getIndex(); - $this->assertProtobufEquals($formattedIndex, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeDatapointsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - try { - $gapicClient->removeDatapoints($formattedIndex); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $metadataSchemaUri = 'metadataSchemaUri-152319778'; - $etag = 'etag3123477'; - $expectedResponse = new Index(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setMetadataSchemaUri($metadataSchemaUri); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $index = new Index(); - $indexDisplayName = 'indexDisplayName-632619461'; - $index->setDisplayName($indexDisplayName); - $response = $gapicClient->updateIndex($index); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexService/UpdateIndex', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getIndex(); - $this->assertProtobufEquals($index, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $index = new Index(); - $indexDisplayName = 'indexDisplayName-632619461'; - $index->setDisplayName($indexDisplayName); - $response = $gapicClient->updateIndex($index); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function upsertDatapointsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new UpsertDatapointsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - $response = $gapicClient->upsertDatapoints($formattedIndex); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.IndexService/UpsertDatapoints', $actualFuncCall); - $actualValue = $actualRequestObject->getIndex(); - $this->assertProtobufEquals($formattedIndex, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function upsertDatapointsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedIndex = $gapicClient->indexName('[PROJECT]', '[LOCATION]', '[INDEX]'); - try { - $gapicClient->upsertDatapoints($formattedIndex); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/JobServiceClientTest.php b/AiPlatform/tests/Unit/V1/JobServiceClientTest.php deleted file mode 100644 index f4fd5eebb1a7..000000000000 --- a/AiPlatform/tests/Unit/V1/JobServiceClientTest.php +++ /dev/null @@ -1,3237 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return JobServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new JobServiceClient($options); - } - - /** @test */ - public function cancelBatchPredictionJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $gapicClient->cancelBatchPredictionJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CancelBatchPredictionJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelBatchPredictionJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - try { - $gapicClient->cancelBatchPredictionJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelCustomJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $gapicClient->cancelCustomJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CancelCustomJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelCustomJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - try { - $gapicClient->cancelCustomJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelDataLabelingJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $gapicClient->cancelDataLabelingJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CancelDataLabelingJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelDataLabelingJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - try { - $gapicClient->cancelDataLabelingJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelHyperparameterTuningJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $gapicClient->cancelHyperparameterTuningJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CancelHyperparameterTuningJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelHyperparameterTuningJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - try { - $gapicClient->cancelHyperparameterTuningJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelNasJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $gapicClient->cancelNasJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CancelNasJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelNasJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - try { - $gapicClient->cancelNasJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBatchPredictionJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $model = 'model104069929'; - $modelVersionId = 'modelVersionId-1385431880'; - $serviceAccount = 'serviceAccount-1948028253'; - $generateExplanation = false; - $disableContainerLogging = true; - $expectedResponse = new BatchPredictionJob(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setModel($model); - $expectedResponse->setModelVersionId($modelVersionId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setGenerateExplanation($generateExplanation); - $expectedResponse->setDisableContainerLogging($disableContainerLogging); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $batchPredictionJob = new BatchPredictionJob(); - $batchPredictionJobDisplayName = 'batchPredictionJobDisplayName-916867527'; - $batchPredictionJob->setDisplayName($batchPredictionJobDisplayName); - $batchPredictionJobInputConfig = new InputConfig(); - $inputConfigInstancesFormat = 'inputConfigInstancesFormat883633865'; - $batchPredictionJobInputConfig->setInstancesFormat($inputConfigInstancesFormat); - $batchPredictionJob->setInputConfig($batchPredictionJobInputConfig); - $batchPredictionJobOutputConfig = new OutputConfig(); - $outputConfigPredictionsFormat = 'outputConfigPredictionsFormat999432568'; - $batchPredictionJobOutputConfig->setPredictionsFormat($outputConfigPredictionsFormat); - $batchPredictionJob->setOutputConfig($batchPredictionJobOutputConfig); - $response = $gapicClient->createBatchPredictionJob($formattedParent, $batchPredictionJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CreateBatchPredictionJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getBatchPredictionJob(); - $this->assertProtobufEquals($batchPredictionJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBatchPredictionJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $batchPredictionJob = new BatchPredictionJob(); - $batchPredictionJobDisplayName = 'batchPredictionJobDisplayName-916867527'; - $batchPredictionJob->setDisplayName($batchPredictionJobDisplayName); - $batchPredictionJobInputConfig = new InputConfig(); - $inputConfigInstancesFormat = 'inputConfigInstancesFormat883633865'; - $batchPredictionJobInputConfig->setInstancesFormat($inputConfigInstancesFormat); - $batchPredictionJob->setInputConfig($batchPredictionJobInputConfig); - $batchPredictionJobOutputConfig = new OutputConfig(); - $outputConfigPredictionsFormat = 'outputConfigPredictionsFormat999432568'; - $batchPredictionJobOutputConfig->setPredictionsFormat($outputConfigPredictionsFormat); - $batchPredictionJob->setOutputConfig($batchPredictionJobOutputConfig); - try { - $gapicClient->createBatchPredictionJob($formattedParent, $batchPredictionJob); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createCustomJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new CustomJob(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $customJob = new CustomJob(); - $customJobDisplayName = 'customJobDisplayName-299624383'; - $customJob->setDisplayName($customJobDisplayName); - $customJobJobSpec = new CustomJobSpec(); - $jobSpecWorkerPoolSpecs = []; - $customJobJobSpec->setWorkerPoolSpecs($jobSpecWorkerPoolSpecs); - $customJob->setJobSpec($customJobJobSpec); - $response = $gapicClient->createCustomJob($formattedParent, $customJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CreateCustomJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCustomJob(); - $this->assertProtobufEquals($customJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createCustomJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $customJob = new CustomJob(); - $customJobDisplayName = 'customJobDisplayName-299624383'; - $customJob->setDisplayName($customJobDisplayName); - $customJobJobSpec = new CustomJobSpec(); - $jobSpecWorkerPoolSpecs = []; - $customJobJobSpec->setWorkerPoolSpecs($jobSpecWorkerPoolSpecs); - $customJob->setJobSpec($customJobJobSpec); - try { - $gapicClient->createCustomJob($formattedParent, $customJob); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createDataLabelingJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $labelerCount = 1457777167; - $instructionUri = 'instructionUri1537272379'; - $inputsSchemaUri = 'inputsSchemaUri990382564'; - $labelingProgress = 685978914; - $expectedResponse = new DataLabelingJob(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLabelerCount($labelerCount); - $expectedResponse->setInstructionUri($instructionUri); - $expectedResponse->setInputsSchemaUri($inputsSchemaUri); - $expectedResponse->setLabelingProgress($labelingProgress); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataLabelingJob = new DataLabelingJob(); - $dataLabelingJobDisplayName = 'dataLabelingJobDisplayName708178632'; - $dataLabelingJob->setDisplayName($dataLabelingJobDisplayName); - $dataLabelingJobDatasets = [ - $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'), - ]; - $dataLabelingJob->setDatasets($dataLabelingJobDatasets); - $dataLabelingJobLabelerCount = 500093453; - $dataLabelingJob->setLabelerCount($dataLabelingJobLabelerCount); - $dataLabelingJobInstructionUri = 'dataLabelingJobInstructionUri-886362173'; - $dataLabelingJob->setInstructionUri($dataLabelingJobInstructionUri); - $dataLabelingJobInputsSchemaUri = 'dataLabelingJobInputsSchemaUri-1486933251'; - $dataLabelingJob->setInputsSchemaUri($dataLabelingJobInputsSchemaUri); - $dataLabelingJobInputs = new Value(); - $dataLabelingJob->setInputs($dataLabelingJobInputs); - $response = $gapicClient->createDataLabelingJob($formattedParent, $dataLabelingJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CreateDataLabelingJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getDataLabelingJob(); - $this->assertProtobufEquals($dataLabelingJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createDataLabelingJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataLabelingJob = new DataLabelingJob(); - $dataLabelingJobDisplayName = 'dataLabelingJobDisplayName708178632'; - $dataLabelingJob->setDisplayName($dataLabelingJobDisplayName); - $dataLabelingJobDatasets = [ - $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'), - ]; - $dataLabelingJob->setDatasets($dataLabelingJobDatasets); - $dataLabelingJobLabelerCount = 500093453; - $dataLabelingJob->setLabelerCount($dataLabelingJobLabelerCount); - $dataLabelingJobInstructionUri = 'dataLabelingJobInstructionUri-886362173'; - $dataLabelingJob->setInstructionUri($dataLabelingJobInstructionUri); - $dataLabelingJobInputsSchemaUri = 'dataLabelingJobInputsSchemaUri-1486933251'; - $dataLabelingJob->setInputsSchemaUri($dataLabelingJobInputsSchemaUri); - $dataLabelingJobInputs = new Value(); - $dataLabelingJob->setInputs($dataLabelingJobInputs); - try { - $gapicClient->createDataLabelingJob($formattedParent, $dataLabelingJob); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createHyperparameterTuningJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $maxTrialCount = 445994933; - $parallelTrialCount = 1813795950; - $maxFailedTrialCount = 887662497; - $expectedResponse = new HyperparameterTuningJob(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxTrialCount($maxTrialCount); - $expectedResponse->setParallelTrialCount($parallelTrialCount); - $expectedResponse->setMaxFailedTrialCount($maxFailedTrialCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $hyperparameterTuningJob = new HyperparameterTuningJob(); - $hyperparameterTuningJobDisplayName = 'hyperparameterTuningJobDisplayName279209698'; - $hyperparameterTuningJob->setDisplayName($hyperparameterTuningJobDisplayName); - $hyperparameterTuningJobStudySpec = new StudySpec(); - $studySpecMetrics = []; - $hyperparameterTuningJobStudySpec->setMetrics($studySpecMetrics); - $studySpecParameters = []; - $hyperparameterTuningJobStudySpec->setParameters($studySpecParameters); - $hyperparameterTuningJob->setStudySpec($hyperparameterTuningJobStudySpec); - $hyperparameterTuningJobMaxTrialCount = 1019368622; - $hyperparameterTuningJob->setMaxTrialCount($hyperparameterTuningJobMaxTrialCount); - $hyperparameterTuningJobParallelTrialCount = 1531269397; - $hyperparameterTuningJob->setParallelTrialCount($hyperparameterTuningJobParallelTrialCount); - $hyperparameterTuningJobTrialJobSpec = new CustomJobSpec(); - $trialJobSpecWorkerPoolSpecs = []; - $hyperparameterTuningJobTrialJobSpec->setWorkerPoolSpecs($trialJobSpecWorkerPoolSpecs); - $hyperparameterTuningJob->setTrialJobSpec($hyperparameterTuningJobTrialJobSpec); - $response = $gapicClient->createHyperparameterTuningJob($formattedParent, $hyperparameterTuningJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CreateHyperparameterTuningJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getHyperparameterTuningJob(); - $this->assertProtobufEquals($hyperparameterTuningJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createHyperparameterTuningJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $hyperparameterTuningJob = new HyperparameterTuningJob(); - $hyperparameterTuningJobDisplayName = 'hyperparameterTuningJobDisplayName279209698'; - $hyperparameterTuningJob->setDisplayName($hyperparameterTuningJobDisplayName); - $hyperparameterTuningJobStudySpec = new StudySpec(); - $studySpecMetrics = []; - $hyperparameterTuningJobStudySpec->setMetrics($studySpecMetrics); - $studySpecParameters = []; - $hyperparameterTuningJobStudySpec->setParameters($studySpecParameters); - $hyperparameterTuningJob->setStudySpec($hyperparameterTuningJobStudySpec); - $hyperparameterTuningJobMaxTrialCount = 1019368622; - $hyperparameterTuningJob->setMaxTrialCount($hyperparameterTuningJobMaxTrialCount); - $hyperparameterTuningJobParallelTrialCount = 1531269397; - $hyperparameterTuningJob->setParallelTrialCount($hyperparameterTuningJobParallelTrialCount); - $hyperparameterTuningJobTrialJobSpec = new CustomJobSpec(); - $trialJobSpecWorkerPoolSpecs = []; - $hyperparameterTuningJobTrialJobSpec->setWorkerPoolSpecs($trialJobSpecWorkerPoolSpecs); - $hyperparameterTuningJob->setTrialJobSpec($hyperparameterTuningJobTrialJobSpec); - try { - $gapicClient->createHyperparameterTuningJob($formattedParent, $hyperparameterTuningJob); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createModelDeploymentMonitoringJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $endpoint = 'endpoint1741102485'; - $predictInstanceSchemaUri = 'predictInstanceSchemaUri1705398098'; - $analysisInstanceSchemaUri = 'analysisInstanceSchemaUri1555410389'; - $enableMonitoringPipelineLogs = false; - $expectedResponse = new ModelDeploymentMonitoringJob(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEndpoint($endpoint); - $expectedResponse->setPredictInstanceSchemaUri($predictInstanceSchemaUri); - $expectedResponse->setAnalysisInstanceSchemaUri($analysisInstanceSchemaUri); - $expectedResponse->setEnableMonitoringPipelineLogs($enableMonitoringPipelineLogs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $modelDeploymentMonitoringJob = new ModelDeploymentMonitoringJob(); - $modelDeploymentMonitoringJobDisplayName = 'modelDeploymentMonitoringJobDisplayName-563611194'; - $modelDeploymentMonitoringJob->setDisplayName($modelDeploymentMonitoringJobDisplayName); - $modelDeploymentMonitoringJobEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $modelDeploymentMonitoringJob->setEndpoint($modelDeploymentMonitoringJobEndpoint); - $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = []; - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs($modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = new ModelDeploymentMonitoringScheduleConfig(); - $modelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration(); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval($modelDeploymentMonitoringScheduleConfigMonitorInterval); - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig($modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig); - $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy(); - $modelDeploymentMonitoringJob->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy); - $response = $gapicClient->createModelDeploymentMonitoringJob($formattedParent, $modelDeploymentMonitoringJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CreateModelDeploymentMonitoringJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getModelDeploymentMonitoringJob(); - $this->assertProtobufEquals($modelDeploymentMonitoringJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createModelDeploymentMonitoringJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $modelDeploymentMonitoringJob = new ModelDeploymentMonitoringJob(); - $modelDeploymentMonitoringJobDisplayName = 'modelDeploymentMonitoringJobDisplayName-563611194'; - $modelDeploymentMonitoringJob->setDisplayName($modelDeploymentMonitoringJobDisplayName); - $modelDeploymentMonitoringJobEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $modelDeploymentMonitoringJob->setEndpoint($modelDeploymentMonitoringJobEndpoint); - $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = []; - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs($modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = new ModelDeploymentMonitoringScheduleConfig(); - $modelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration(); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval($modelDeploymentMonitoringScheduleConfigMonitorInterval); - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig($modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig); - $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy(); - $modelDeploymentMonitoringJob->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy); - try { - $gapicClient->createModelDeploymentMonitoringJob($formattedParent, $modelDeploymentMonitoringJob); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createNasJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $enableRestrictedImageTraining = true; - $expectedResponse = new NasJob(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEnableRestrictedImageTraining($enableRestrictedImageTraining); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $nasJob = new NasJob(); - $nasJobDisplayName = 'nasJobDisplayName-279570512'; - $nasJob->setDisplayName($nasJobDisplayName); - $nasJobNasJobSpec = new NasJobSpec(); - $nasJob->setNasJobSpec($nasJobNasJobSpec); - $response = $gapicClient->createNasJob($formattedParent, $nasJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/CreateNasJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getNasJob(); - $this->assertProtobufEquals($nasJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createNasJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $nasJob = new NasJob(); - $nasJobDisplayName = 'nasJobDisplayName-279570512'; - $nasJob->setDisplayName($nasJobDisplayName); - $nasJobNasJobSpec = new NasJobSpec(); - $nasJob->setNasJobSpec($nasJobNasJobSpec); - try { - $gapicClient->createNasJob($formattedParent, $nasJob); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBatchPredictionJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBatchPredictionJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBatchPredictionJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $response = $gapicClient->deleteBatchPredictionJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/DeleteBatchPredictionJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBatchPredictionJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBatchPredictionJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBatchPredictionJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $response = $gapicClient->deleteBatchPredictionJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBatchPredictionJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteCustomJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteCustomJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteCustomJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $response = $gapicClient->deleteCustomJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/DeleteCustomJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteCustomJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteCustomJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteCustomJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $response = $gapicClient->deleteCustomJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteCustomJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataLabelingJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataLabelingJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDataLabelingJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $response = $gapicClient->deleteDataLabelingJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/DeleteDataLabelingJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataLabelingJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataLabelingJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataLabelingJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $response = $gapicClient->deleteDataLabelingJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataLabelingJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteHyperparameterTuningJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteHyperparameterTuningJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteHyperparameterTuningJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $response = $gapicClient->deleteHyperparameterTuningJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/DeleteHyperparameterTuningJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteHyperparameterTuningJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteHyperparameterTuningJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteHyperparameterTuningJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $response = $gapicClient->deleteHyperparameterTuningJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteHyperparameterTuningJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteModelDeploymentMonitoringJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteModelDeploymentMonitoringJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteModelDeploymentMonitoringJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $response = $gapicClient->deleteModelDeploymentMonitoringJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/DeleteModelDeploymentMonitoringJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteModelDeploymentMonitoringJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteModelDeploymentMonitoringJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteModelDeploymentMonitoringJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $response = $gapicClient->deleteModelDeploymentMonitoringJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteModelDeploymentMonitoringJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteNasJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteNasJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteNasJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $response = $gapicClient->deleteNasJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/DeleteNasJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteNasJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteNasJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteNasJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $response = $gapicClient->deleteNasJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteNasJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getBatchPredictionJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $model = 'model104069929'; - $modelVersionId = 'modelVersionId-1385431880'; - $serviceAccount = 'serviceAccount-1948028253'; - $generateExplanation = false; - $disableContainerLogging = true; - $expectedResponse = new BatchPredictionJob(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setModel($model); - $expectedResponse->setModelVersionId($modelVersionId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setGenerateExplanation($generateExplanation); - $expectedResponse->setDisableContainerLogging($disableContainerLogging); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - $response = $gapicClient->getBatchPredictionJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/GetBatchPredictionJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBatchPredictionJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->batchPredictionJobName('[PROJECT]', '[LOCATION]', '[BATCH_PREDICTION_JOB]'); - try { - $gapicClient->getBatchPredictionJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCustomJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new CustomJob(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - $response = $gapicClient->getCustomJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/GetCustomJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCustomJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]'); - try { - $gapicClient->getCustomJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataLabelingJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $labelerCount = 1457777167; - $instructionUri = 'instructionUri1537272379'; - $inputsSchemaUri = 'inputsSchemaUri990382564'; - $labelingProgress = 685978914; - $expectedResponse = new DataLabelingJob(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLabelerCount($labelerCount); - $expectedResponse->setInstructionUri($instructionUri); - $expectedResponse->setInputsSchemaUri($inputsSchemaUri); - $expectedResponse->setLabelingProgress($labelingProgress); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - $response = $gapicClient->getDataLabelingJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/GetDataLabelingJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataLabelingJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataLabelingJobName('[PROJECT]', '[LOCATION]', '[DATA_LABELING_JOB]'); - try { - $gapicClient->getDataLabelingJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getHyperparameterTuningJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $maxTrialCount = 445994933; - $parallelTrialCount = 1813795950; - $maxFailedTrialCount = 887662497; - $expectedResponse = new HyperparameterTuningJob(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxTrialCount($maxTrialCount); - $expectedResponse->setParallelTrialCount($parallelTrialCount); - $expectedResponse->setMaxFailedTrialCount($maxFailedTrialCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - $response = $gapicClient->getHyperparameterTuningJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/GetHyperparameterTuningJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getHyperparameterTuningJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->hyperparameterTuningJobName('[PROJECT]', '[LOCATION]', '[HYPERPARAMETER_TUNING_JOB]'); - try { - $gapicClient->getHyperparameterTuningJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getModelDeploymentMonitoringJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $endpoint = 'endpoint1741102485'; - $predictInstanceSchemaUri = 'predictInstanceSchemaUri1705398098'; - $analysisInstanceSchemaUri = 'analysisInstanceSchemaUri1555410389'; - $enableMonitoringPipelineLogs = false; - $expectedResponse = new ModelDeploymentMonitoringJob(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEndpoint($endpoint); - $expectedResponse->setPredictInstanceSchemaUri($predictInstanceSchemaUri); - $expectedResponse->setAnalysisInstanceSchemaUri($analysisInstanceSchemaUri); - $expectedResponse->setEnableMonitoringPipelineLogs($enableMonitoringPipelineLogs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $response = $gapicClient->getModelDeploymentMonitoringJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/GetModelDeploymentMonitoringJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getModelDeploymentMonitoringJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - try { - $gapicClient->getModelDeploymentMonitoringJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNasJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $enableRestrictedImageTraining = true; - $expectedResponse = new NasJob(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEnableRestrictedImageTraining($enableRestrictedImageTraining); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $response = $gapicClient->getNasJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/GetNasJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNasJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - try { - $gapicClient->getNasJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNasTrialDetailTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parameters = 'parameters458736106'; - $expectedResponse = new NasTrialDetail(); - $expectedResponse->setName($name2); - $expectedResponse->setParameters($parameters); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->nasTrialDetailName('[PROJECT]', '[LOCATION]', '[NAS_JOB]', '[NAS_TRIAL_DETAIL]'); - $response = $gapicClient->getNasTrialDetail($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/GetNasTrialDetail', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNasTrialDetailExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->nasTrialDetailName('[PROJECT]', '[LOCATION]', '[NAS_JOB]', '[NAS_TRIAL_DETAIL]'); - try { - $gapicClient->getNasTrialDetail($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBatchPredictionJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $batchPredictionJobsElement = new BatchPredictionJob(); - $batchPredictionJobs = [ - $batchPredictionJobsElement, - ]; - $expectedResponse = new ListBatchPredictionJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBatchPredictionJobs($batchPredictionJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listBatchPredictionJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBatchPredictionJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/ListBatchPredictionJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBatchPredictionJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listBatchPredictionJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCustomJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $customJobsElement = new CustomJob(); - $customJobs = [ - $customJobsElement, - ]; - $expectedResponse = new ListCustomJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCustomJobs($customJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listCustomJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCustomJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/ListCustomJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCustomJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listCustomJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataLabelingJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $dataLabelingJobsElement = new DataLabelingJob(); - $dataLabelingJobs = [ - $dataLabelingJobsElement, - ]; - $expectedResponse = new ListDataLabelingJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDataLabelingJobs($dataLabelingJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listDataLabelingJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDataLabelingJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/ListDataLabelingJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataLabelingJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listDataLabelingJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listHyperparameterTuningJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $hyperparameterTuningJobsElement = new HyperparameterTuningJob(); - $hyperparameterTuningJobs = [ - $hyperparameterTuningJobsElement, - ]; - $expectedResponse = new ListHyperparameterTuningJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setHyperparameterTuningJobs($hyperparameterTuningJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listHyperparameterTuningJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getHyperparameterTuningJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/ListHyperparameterTuningJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listHyperparameterTuningJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listHyperparameterTuningJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelDeploymentMonitoringJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $modelDeploymentMonitoringJobsElement = new ModelDeploymentMonitoringJob(); - $modelDeploymentMonitoringJobs = [ - $modelDeploymentMonitoringJobsElement, - ]; - $expectedResponse = new ListModelDeploymentMonitoringJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setModelDeploymentMonitoringJobs($modelDeploymentMonitoringJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listModelDeploymentMonitoringJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getModelDeploymentMonitoringJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/ListModelDeploymentMonitoringJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelDeploymentMonitoringJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listModelDeploymentMonitoringJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNasJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $nasJobsElement = new NasJob(); - $nasJobs = [ - $nasJobsElement, - ]; - $expectedResponse = new ListNasJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setNasJobs($nasJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listNasJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getNasJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/ListNasJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNasJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listNasJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNasTrialDetailsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $nasTrialDetailsElement = new NasTrialDetail(); - $nasTrialDetails = [ - $nasTrialDetailsElement, - ]; - $expectedResponse = new ListNasTrialDetailsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setNasTrialDetails($nasTrialDetails); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - $response = $gapicClient->listNasTrialDetails($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getNasTrialDetails()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/ListNasTrialDetails', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNasTrialDetailsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]'); - try { - $gapicClient->listNasTrialDetails($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseModelDeploymentMonitoringJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $gapicClient->pauseModelDeploymentMonitoringJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/PauseModelDeploymentMonitoringJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseModelDeploymentMonitoringJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - try { - $gapicClient->pauseModelDeploymentMonitoringJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeModelDeploymentMonitoringJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $gapicClient->resumeModelDeploymentMonitoringJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/ResumeModelDeploymentMonitoringJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeModelDeploymentMonitoringJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - try { - $gapicClient->resumeModelDeploymentMonitoringJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchModelDeploymentMonitoringStatsAnomaliesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $monitoringStatsElement = new ModelMonitoringStatsAnomalies(); - $monitoringStats = [ - $monitoringStatsElement, - ]; - $expectedResponse = new SearchModelDeploymentMonitoringStatsAnomaliesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMonitoringStats($monitoringStats); - $transport->addResponse($expectedResponse); - // Mock request - $formattedModelDeploymentMonitoringJob = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $deployedModelId = 'deployedModelId866642506'; - $objectives = []; - $response = $gapicClient->searchModelDeploymentMonitoringStatsAnomalies($formattedModelDeploymentMonitoringJob, $deployedModelId, $objectives); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMonitoringStats()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/SearchModelDeploymentMonitoringStatsAnomalies', $actualFuncCall); - $actualValue = $actualRequestObject->getModelDeploymentMonitoringJob(); - $this->assertProtobufEquals($formattedModelDeploymentMonitoringJob, $actualValue); - $actualValue = $actualRequestObject->getDeployedModelId(); - $this->assertProtobufEquals($deployedModelId, $actualValue); - $actualValue = $actualRequestObject->getObjectives(); - $this->assertProtobufEquals($objectives, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchModelDeploymentMonitoringStatsAnomaliesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedModelDeploymentMonitoringJob = $gapicClient->modelDeploymentMonitoringJobName('[PROJECT]', '[LOCATION]', '[MODEL_DEPLOYMENT_MONITORING_JOB]'); - $deployedModelId = 'deployedModelId866642506'; - $objectives = []; - try { - $gapicClient->searchModelDeploymentMonitoringStatsAnomalies($formattedModelDeploymentMonitoringJob, $deployedModelId, $objectives); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateModelDeploymentMonitoringJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateModelDeploymentMonitoringJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $endpoint = 'endpoint1741102485'; - $predictInstanceSchemaUri = 'predictInstanceSchemaUri1705398098'; - $analysisInstanceSchemaUri = 'analysisInstanceSchemaUri1555410389'; - $enableMonitoringPipelineLogs = false; - $expectedResponse = new ModelDeploymentMonitoringJob(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEndpoint($endpoint); - $expectedResponse->setPredictInstanceSchemaUri($predictInstanceSchemaUri); - $expectedResponse->setAnalysisInstanceSchemaUri($analysisInstanceSchemaUri); - $expectedResponse->setEnableMonitoringPipelineLogs($enableMonitoringPipelineLogs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateModelDeploymentMonitoringJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $modelDeploymentMonitoringJob = new ModelDeploymentMonitoringJob(); - $modelDeploymentMonitoringJobDisplayName = 'modelDeploymentMonitoringJobDisplayName-563611194'; - $modelDeploymentMonitoringJob->setDisplayName($modelDeploymentMonitoringJobDisplayName); - $modelDeploymentMonitoringJobEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $modelDeploymentMonitoringJob->setEndpoint($modelDeploymentMonitoringJobEndpoint); - $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = []; - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs($modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = new ModelDeploymentMonitoringScheduleConfig(); - $modelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration(); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval($modelDeploymentMonitoringScheduleConfigMonitorInterval); - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig($modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig); - $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy(); - $modelDeploymentMonitoringJob->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy); - $updateMask = new FieldMask(); - $response = $gapicClient->updateModelDeploymentMonitoringJob($modelDeploymentMonitoringJob, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.JobService/UpdateModelDeploymentMonitoringJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getModelDeploymentMonitoringJob(); - $this->assertProtobufEquals($modelDeploymentMonitoringJob, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateModelDeploymentMonitoringJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateModelDeploymentMonitoringJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateModelDeploymentMonitoringJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $modelDeploymentMonitoringJob = new ModelDeploymentMonitoringJob(); - $modelDeploymentMonitoringJobDisplayName = 'modelDeploymentMonitoringJobDisplayName-563611194'; - $modelDeploymentMonitoringJob->setDisplayName($modelDeploymentMonitoringJobDisplayName); - $modelDeploymentMonitoringJobEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $modelDeploymentMonitoringJob->setEndpoint($modelDeploymentMonitoringJobEndpoint); - $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = []; - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringObjectiveConfigs($modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = new ModelDeploymentMonitoringScheduleConfig(); - $modelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration(); - $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig->setMonitorInterval($modelDeploymentMonitoringScheduleConfigMonitorInterval); - $modelDeploymentMonitoringJob->setModelDeploymentMonitoringScheduleConfig($modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig); - $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy(); - $modelDeploymentMonitoringJob->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy); - $updateMask = new FieldMask(); - $response = $gapicClient->updateModelDeploymentMonitoringJob($modelDeploymentMonitoringJob, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateModelDeploymentMonitoringJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/LlmUtilityServiceClientTest.php b/AiPlatform/tests/Unit/V1/LlmUtilityServiceClientTest.php deleted file mode 100644 index cb9ce55f8ac4..000000000000 --- a/AiPlatform/tests/Unit/V1/LlmUtilityServiceClientTest.php +++ /dev/null @@ -1,512 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return LlmUtilityServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new LlmUtilityServiceClient($options); - } - - /** @test */ - public function computeTokensTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ComputeTokensResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $instances = []; - $response = $gapicClient->computeTokens($formattedEndpoint, $instances); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.LlmUtilityService/ComputeTokens', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $actualValue = $actualRequestObject->getInstances(); - $this->assertProtobufEquals($instances, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function computeTokensExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $instances = []; - try { - $gapicClient->computeTokens($formattedEndpoint, $instances); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function countTokensTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $totalTokens = 730673909; - $totalBillableCharacters = 1242495501; - $expectedResponse = new CountTokensResponse(); - $expectedResponse->setTotalTokens($totalTokens); - $expectedResponse->setTotalBillableCharacters($totalBillableCharacters); - $transport->addResponse($expectedResponse); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $model = 'model104069929'; - $instances = []; - $contents = []; - $response = $gapicClient->countTokens($formattedEndpoint, $model, $instances, $contents); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.LlmUtilityService/CountTokens', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $actualValue = $actualRequestObject->getModel(); - $this->assertProtobufEquals($model, $actualValue); - $actualValue = $actualRequestObject->getInstances(); - $this->assertProtobufEquals($instances, $actualValue); - $actualValue = $actualRequestObject->getContents(); - $this->assertProtobufEquals($contents, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function countTokensExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $model = 'model104069929'; - $instances = []; - $contents = []; - try { - $gapicClient->countTokens($formattedEndpoint, $model, $instances, $contents); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/MatchServiceClientTest.php b/AiPlatform/tests/Unit/V1/MatchServiceClientTest.php deleted file mode 100644 index 367f4a932854..000000000000 --- a/AiPlatform/tests/Unit/V1/MatchServiceClientTest.php +++ /dev/null @@ -1,492 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return MatchServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new MatchServiceClient($options); - } - - /** @test */ - public function findNeighborsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FindNeighborsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $response = $gapicClient->findNeighbors($formattedIndexEndpoint); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MatchService/FindNeighbors', $actualFuncCall); - $actualValue = $actualRequestObject->getIndexEndpoint(); - $this->assertProtobufEquals($formattedIndexEndpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function findNeighborsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - try { - $gapicClient->findNeighbors($formattedIndexEndpoint); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readIndexDatapointsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReadIndexDatapointsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - $response = $gapicClient->readIndexDatapoints($formattedIndexEndpoint); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MatchService/ReadIndexDatapoints', $actualFuncCall); - $actualValue = $actualRequestObject->getIndexEndpoint(); - $this->assertProtobufEquals($formattedIndexEndpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readIndexDatapointsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedIndexEndpoint = $gapicClient->indexEndpointName('[PROJECT]', '[LOCATION]', '[INDEX_ENDPOINT]'); - try { - $gapicClient->readIndexDatapoints($formattedIndexEndpoint); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/MetadataServiceClientTest.php b/AiPlatform/tests/Unit/V1/MetadataServiceClientTest.php deleted file mode 100644 index 0a7c3885b884..000000000000 --- a/AiPlatform/tests/Unit/V1/MetadataServiceClientTest.php +++ /dev/null @@ -1,2955 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return MetadataServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new MetadataServiceClient($options); - } - - /** @test */ - public function addContextArtifactsAndExecutionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AddContextArtifactsAndExecutionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $response = $gapicClient->addContextArtifactsAndExecutions($formattedContext); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/AddContextArtifactsAndExecutions', $actualFuncCall); - $actualValue = $actualRequestObject->getContext(); - $this->assertProtobufEquals($formattedContext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addContextArtifactsAndExecutionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - try { - $gapicClient->addContextArtifactsAndExecutions($formattedContext); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addContextChildrenTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AddContextChildrenResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $response = $gapicClient->addContextChildren($formattedContext); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/AddContextChildren', $actualFuncCall); - $actualValue = $actualRequestObject->getContext(); - $this->assertProtobufEquals($formattedContext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addContextChildrenExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - try { - $gapicClient->addContextChildren($formattedContext); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addExecutionEventsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AddExecutionEventsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedExecution = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $response = $gapicClient->addExecutionEvents($formattedExecution); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/AddExecutionEvents', $actualFuncCall); - $actualValue = $actualRequestObject->getExecution(); - $this->assertProtobufEquals($formattedExecution, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addExecutionEventsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedExecution = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - try { - $gapicClient->addExecutionEvents($formattedExecution); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createArtifactTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uri = 'uri116076'; - $etag = 'etag3123477'; - $schemaTitle = 'schemaTitle-1260306886'; - $schemaVersion = 'schemaVersion1684719674'; - $description = 'description-1724546052'; - $expectedResponse = new Artifact(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUri($uri); - $expectedResponse->setEtag($etag); - $expectedResponse->setSchemaTitle($schemaTitle); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $artifact = new Artifact(); - $response = $gapicClient->createArtifact($formattedParent, $artifact); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/CreateArtifact', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getArtifact(); - $this->assertProtobufEquals($artifact, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createArtifactExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $artifact = new Artifact(); - try { - $gapicClient->createArtifact($formattedParent, $artifact); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createContextTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $schemaTitle = 'schemaTitle-1260306886'; - $schemaVersion = 'schemaVersion1684719674'; - $description = 'description-1724546052'; - $expectedResponse = new Context(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setSchemaTitle($schemaTitle); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $context = new Context(); - $response = $gapicClient->createContext($formattedParent, $context); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/CreateContext', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getContext(); - $this->assertProtobufEquals($context, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createContextExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $context = new Context(); - try { - $gapicClient->createContext($formattedParent, $context); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $schemaTitle = 'schemaTitle-1260306886'; - $schemaVersion = 'schemaVersion1684719674'; - $description = 'description-1724546052'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setSchemaTitle($schemaTitle); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $execution = new Execution(); - $response = $gapicClient->createExecution($formattedParent, $execution); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/CreateExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getExecution(); - $this->assertProtobufEquals($execution, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createExecutionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $execution = new Execution(); - try { - $gapicClient->createExecution($formattedParent, $execution); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createMetadataSchemaTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $schemaVersion = 'schemaVersion1684719674'; - $schema = 'schema-907987551'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataSchema(); - $expectedResponse->setName($name); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setSchema($schema); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $metadataSchema = new MetadataSchema(); - $metadataSchemaSchema = 'metadataSchemaSchema-249734287'; - $metadataSchema->setSchema($metadataSchemaSchema); - $response = $gapicClient->createMetadataSchema($formattedParent, $metadataSchema); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/CreateMetadataSchema', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getMetadataSchema(); - $this->assertProtobufEquals($metadataSchema, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createMetadataSchemaExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $metadataSchema = new MetadataSchema(); - $metadataSchemaSchema = 'metadataSchemaSchema-249734287'; - $metadataSchema->setSchema($metadataSchemaSchema); - try { - $gapicClient->createMetadataSchema($formattedParent, $metadataSchema); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createMetadataStoreTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataStore(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createMetadataStoreTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $metadataStore = new MetadataStore(); - $response = $gapicClient->createMetadataStore($formattedParent, $metadataStore); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/CreateMetadataStore', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataStore(); - $this->assertProtobufEquals($metadataStore, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataStoreTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataStoreExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $metadataStore = new MetadataStore(); - $response = $gapicClient->createMetadataStore($formattedParent, $metadataStore); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataStoreTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteArtifactTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteArtifactTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteArtifactTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $response = $gapicClient->deleteArtifact($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/DeleteArtifact', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteArtifactTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteArtifactExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteArtifactTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $response = $gapicClient->deleteArtifact($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteArtifactTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteContextTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteContextTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteContextTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $response = $gapicClient->deleteContext($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/DeleteContext', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteContextTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteContextExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteContextTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $response = $gapicClient->deleteContext($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteContextTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteExecutionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteExecutionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteExecutionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $response = $gapicClient->deleteExecution($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/DeleteExecution', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteExecutionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteExecutionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteExecutionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $response = $gapicClient->deleteExecution($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteExecutionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteMetadataStoreTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteMetadataStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteMetadataStoreTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $response = $gapicClient->deleteMetadataStore($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/DeleteMetadataStore', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteMetadataStoreTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteMetadataStoreExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteMetadataStoreTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $response = $gapicClient->deleteMetadataStore($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteMetadataStoreTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getArtifactTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uri = 'uri116076'; - $etag = 'etag3123477'; - $schemaTitle = 'schemaTitle-1260306886'; - $schemaVersion = 'schemaVersion1684719674'; - $description = 'description-1724546052'; - $expectedResponse = new Artifact(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUri($uri); - $expectedResponse->setEtag($etag); - $expectedResponse->setSchemaTitle($schemaTitle); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $response = $gapicClient->getArtifact($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/GetArtifact', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getArtifactExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - try { - $gapicClient->getArtifact($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getContextTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $schemaTitle = 'schemaTitle-1260306886'; - $schemaVersion = 'schemaVersion1684719674'; - $description = 'description-1724546052'; - $expectedResponse = new Context(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setSchemaTitle($schemaTitle); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $response = $gapicClient->getContext($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/GetContext', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getContextExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - try { - $gapicClient->getContext($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $schemaTitle = 'schemaTitle-1260306886'; - $schemaVersion = 'schemaVersion1684719674'; - $description = 'description-1724546052'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setSchemaTitle($schemaTitle); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $response = $gapicClient->getExecution($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/GetExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getExecutionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - try { - $gapicClient->getExecution($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataSchemaTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $schemaVersion = 'schemaVersion1684719674'; - $schema = 'schema-907987551'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataSchema(); - $expectedResponse->setName($name2); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setSchema($schema); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metadataSchemaName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[METADATA_SCHEMA]'); - $response = $gapicClient->getMetadataSchema($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/GetMetadataSchema', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataSchemaExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->metadataSchemaName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[METADATA_SCHEMA]'); - try { - $gapicClient->getMetadataSchema($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataStoreTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataStore(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $response = $gapicClient->getMetadataStore($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/GetMetadataStore', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataStoreExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - try { - $gapicClient->getMetadataStore($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listArtifactsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $artifactsElement = new Artifact(); - $artifacts = [ - $artifactsElement, - ]; - $expectedResponse = new ListArtifactsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setArtifacts($artifacts); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $response = $gapicClient->listArtifacts($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getArtifacts()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/ListArtifacts', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listArtifactsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - try { - $gapicClient->listArtifacts($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listContextsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $contextsElement = new Context(); - $contexts = [ - $contextsElement, - ]; - $expectedResponse = new ListContextsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setContexts($contexts); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $response = $gapicClient->listContexts($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getContexts()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/ListContexts', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listContextsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - try { - $gapicClient->listContexts($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listExecutionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $executionsElement = new Execution(); - $executions = [ - $executionsElement, - ]; - $expectedResponse = new ListExecutionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setExecutions($executions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $response = $gapicClient->listExecutions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getExecutions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/ListExecutions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listExecutionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - try { - $gapicClient->listExecutions($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataSchemasTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metadataSchemasElement = new MetadataSchema(); - $metadataSchemas = [ - $metadataSchemasElement, - ]; - $expectedResponse = new ListMetadataSchemasResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetadataSchemas($metadataSchemas); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $response = $gapicClient->listMetadataSchemas($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetadataSchemas()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/ListMetadataSchemas', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataSchemasExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - try { - $gapicClient->listMetadataSchemas($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataStoresTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metadataStoresElement = new MetadataStore(); - $metadataStores = [ - $metadataStoresElement, - ]; - $expectedResponse = new ListMetadataStoresResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetadataStores($metadataStores); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listMetadataStores($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetadataStores()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/ListMetadataStores', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataStoresExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listMetadataStores($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function purgeArtifactsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/purgeArtifactsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $purgeCount = 575305851; - $expectedResponse = new PurgeArtifactsResponse(); - $expectedResponse->setPurgeCount($purgeCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/purgeArtifactsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->purgeArtifacts($formattedParent, $filter); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/PurgeArtifacts', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFilter(); - $this->assertProtobufEquals($filter, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeArtifactsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function purgeArtifactsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/purgeArtifactsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->purgeArtifacts($formattedParent, $filter); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeArtifactsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function purgeContextsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/purgeContextsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $purgeCount = 575305851; - $expectedResponse = new PurgeContextsResponse(); - $expectedResponse->setPurgeCount($purgeCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/purgeContextsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->purgeContexts($formattedParent, $filter); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/PurgeContexts', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFilter(); - $this->assertProtobufEquals($filter, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeContextsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function purgeContextsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/purgeContextsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->purgeContexts($formattedParent, $filter); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeContextsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function purgeExecutionsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/purgeExecutionsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $purgeCount = 575305851; - $expectedResponse = new PurgeExecutionsResponse(); - $expectedResponse->setPurgeCount($purgeCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/purgeExecutionsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->purgeExecutions($formattedParent, $filter); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/PurgeExecutions', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFilter(); - $this->assertProtobufEquals($filter, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeExecutionsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function purgeExecutionsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/purgeExecutionsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->purgeExecutions($formattedParent, $filter); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeExecutionsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryArtifactLineageSubgraphTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new LineageSubgraph(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedArtifact = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - $response = $gapicClient->queryArtifactLineageSubgraph($formattedArtifact); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/QueryArtifactLineageSubgraph', $actualFuncCall); - $actualValue = $actualRequestObject->getArtifact(); - $this->assertProtobufEquals($formattedArtifact, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryArtifactLineageSubgraphExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedArtifact = $gapicClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]'); - try { - $gapicClient->queryArtifactLineageSubgraph($formattedArtifact); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryContextLineageSubgraphTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new LineageSubgraph(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $response = $gapicClient->queryContextLineageSubgraph($formattedContext); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/QueryContextLineageSubgraph', $actualFuncCall); - $actualValue = $actualRequestObject->getContext(); - $this->assertProtobufEquals($formattedContext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryContextLineageSubgraphExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - try { - $gapicClient->queryContextLineageSubgraph($formattedContext); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryExecutionInputsAndOutputsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new LineageSubgraph(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedExecution = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - $response = $gapicClient->queryExecutionInputsAndOutputs($formattedExecution); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/QueryExecutionInputsAndOutputs', $actualFuncCall); - $actualValue = $actualRequestObject->getExecution(); - $this->assertProtobufEquals($formattedExecution, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryExecutionInputsAndOutputsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedExecution = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]'); - try { - $gapicClient->queryExecutionInputsAndOutputs($formattedExecution); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeContextChildrenTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RemoveContextChildrenResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - $response = $gapicClient->removeContextChildren($formattedContext); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/RemoveContextChildren', $actualFuncCall); - $actualValue = $actualRequestObject->getContext(); - $this->assertProtobufEquals($formattedContext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeContextChildrenExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedContext = $gapicClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]'); - try { - $gapicClient->removeContextChildren($formattedContext); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateArtifactTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uri = 'uri116076'; - $etag = 'etag3123477'; - $schemaTitle = 'schemaTitle-1260306886'; - $schemaVersion = 'schemaVersion1684719674'; - $description = 'description-1724546052'; - $expectedResponse = new Artifact(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUri($uri); - $expectedResponse->setEtag($etag); - $expectedResponse->setSchemaTitle($schemaTitle); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $artifact = new Artifact(); - $response = $gapicClient->updateArtifact($artifact); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/UpdateArtifact', $actualFuncCall); - $actualValue = $actualRequestObject->getArtifact(); - $this->assertProtobufEquals($artifact, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateArtifactExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $artifact = new Artifact(); - try { - $gapicClient->updateArtifact($artifact); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateContextTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $schemaTitle = 'schemaTitle-1260306886'; - $schemaVersion = 'schemaVersion1684719674'; - $description = 'description-1724546052'; - $expectedResponse = new Context(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setSchemaTitle($schemaTitle); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $context = new Context(); - $response = $gapicClient->updateContext($context); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/UpdateContext', $actualFuncCall); - $actualValue = $actualRequestObject->getContext(); - $this->assertProtobufEquals($context, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateContextExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $context = new Context(); - try { - $gapicClient->updateContext($context); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $schemaTitle = 'schemaTitle-1260306886'; - $schemaVersion = 'schemaVersion1684719674'; - $description = 'description-1724546052'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setSchemaTitle($schemaTitle); - $expectedResponse->setSchemaVersion($schemaVersion); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $execution = new Execution(); - $response = $gapicClient->updateExecution($execution); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MetadataService/UpdateExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getExecution(); - $this->assertProtobufEquals($execution, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateExecutionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $execution = new Execution(); - try { - $gapicClient->updateExecution($execution); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/MigrationServiceClientTest.php b/AiPlatform/tests/Unit/V1/MigrationServiceClientTest.php deleted file mode 100644 index d5581592ab67..000000000000 --- a/AiPlatform/tests/Unit/V1/MigrationServiceClientTest.php +++ /dev/null @@ -1,570 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return MigrationServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new MigrationServiceClient($options); - } - - /** @test */ - public function batchMigrateResourcesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchMigrateResourcesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchMigrateResourcesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchMigrateResourcesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $migrateResourceRequests = []; - $response = $gapicClient->batchMigrateResources($formattedParent, $migrateResourceRequests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MigrationService/BatchMigrateResources', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getMigrateResourceRequests(); - $this->assertProtobufEquals($migrateResourceRequests, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchMigrateResourcesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchMigrateResourcesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchMigrateResourcesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $migrateResourceRequests = []; - $response = $gapicClient->batchMigrateResources($formattedParent, $migrateResourceRequests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchMigrateResourcesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function searchMigratableResourcesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $migratableResourcesElement = new MigratableResource(); - $migratableResources = [ - $migratableResourcesElement, - ]; - $expectedResponse = new SearchMigratableResourcesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMigratableResources($migratableResources); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->searchMigratableResources($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMigratableResources()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.MigrationService/SearchMigratableResources', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchMigratableResourcesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->searchMigratableResources($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/ModelGardenServiceClientTest.php b/AiPlatform/tests/Unit/V1/ModelGardenServiceClientTest.php deleted file mode 100644 index 9ecba3aaf8c1..000000000000 --- a/AiPlatform/tests/Unit/V1/ModelGardenServiceClientTest.php +++ /dev/null @@ -1,439 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ModelGardenServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ModelGardenServiceClient($options); - } - - /** @test */ - public function getPublisherModelTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $versionId = 'versionId-670497310'; - $publisherModelTemplate = 'publisherModelTemplate-215968397'; - $expectedResponse = new PublisherModel(); - $expectedResponse->setName($name2); - $expectedResponse->setVersionId($versionId); - $expectedResponse->setPublisherModelTemplate($publisherModelTemplate); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->publisherModelName('[PUBLISHER]', '[MODEL]'); - $response = $gapicClient->getPublisherModel($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelGardenService/GetPublisherModel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPublisherModelExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->publisherModelName('[PUBLISHER]', '[MODEL]'); - try { - $gapicClient->getPublisherModel($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/ModelServiceClientTest.php b/AiPlatform/tests/Unit/V1/ModelServiceClientTest.php deleted file mode 100644 index b7efa891c512..000000000000 --- a/AiPlatform/tests/Unit/V1/ModelServiceClientTest.php +++ /dev/null @@ -1,1972 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ModelServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ModelServiceClient($options); - } - - /** @test */ - public function batchImportEvaluatedAnnotationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $importedEvaluatedAnnotationsCount = 765638363; - $expectedResponse = new BatchImportEvaluatedAnnotationsResponse(); - $expectedResponse->setImportedEvaluatedAnnotationsCount($importedEvaluatedAnnotationsCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); - $evaluatedAnnotations = []; - $response = $gapicClient->batchImportEvaluatedAnnotations($formattedParent, $evaluatedAnnotations); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/BatchImportEvaluatedAnnotations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEvaluatedAnnotations(); - $this->assertProtobufEquals($evaluatedAnnotations, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchImportEvaluatedAnnotationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); - $evaluatedAnnotations = []; - try { - $gapicClient->batchImportEvaluatedAnnotations($formattedParent, $evaluatedAnnotations); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchImportModelEvaluationSlicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchImportModelEvaluationSlicesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - $modelEvaluationSlices = []; - $response = $gapicClient->batchImportModelEvaluationSlices($formattedParent, $modelEvaluationSlices); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/BatchImportModelEvaluationSlices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getModelEvaluationSlices(); - $this->assertProtobufEquals($modelEvaluationSlices, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchImportModelEvaluationSlicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - $modelEvaluationSlices = []; - try { - $gapicClient->batchImportModelEvaluationSlices($formattedParent, $modelEvaluationSlices); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function copyModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/copyModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $model = 'model104069929'; - $modelVersionId = 'modelVersionId-1385431880'; - $expectedResponse = new CopyModelResponse(); - $expectedResponse->setModel($model); - $expectedResponse->setModelVersionId($modelVersionId); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/copyModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedSourceModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->copyModel($formattedParent, $formattedSourceModel); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/CopyModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getSourceModel(); - $this->assertProtobufEquals($formattedSourceModel, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/copyModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function copyModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/copyModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedSourceModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->copyModel($formattedParent, $formattedSourceModel); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/copyModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->deleteModel($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/DeleteModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->deleteModel($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteModelVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteModelVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteModelVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->deleteModelVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/DeleteModelVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteModelVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteModelVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteModelVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->deleteModelVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteModelVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ExportModelResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $outputConfig = new OutputConfig(); - $response = $gapicClient->exportModel($formattedName, $outputConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/ExportModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getOutputConfig(); - $this->assertProtobufEquals($outputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $outputConfig = new OutputConfig(); - $response = $gapicClient->exportModel($formattedName, $outputConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getModelTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $versionId = 'versionId-670497310'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $versionDescription = 'versionDescription1423604501'; - $metadataSchemaUri = 'metadataSchemaUri-152319778'; - $trainingPipeline = 'trainingPipeline-2026166169'; - $pipelineJob = 'pipelineJob361059488'; - $artifactUri = 'artifactUri-671891073'; - $etag = 'etag3123477'; - $metadataArtifact = 'metadataArtifact2087706850'; - $expectedResponse = new Model(); - $expectedResponse->setName($name2); - $expectedResponse->setVersionId($versionId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setVersionDescription($versionDescription); - $expectedResponse->setMetadataSchemaUri($metadataSchemaUri); - $expectedResponse->setTrainingPipeline($trainingPipeline); - $expectedResponse->setPipelineJob($pipelineJob); - $expectedResponse->setArtifactUri($artifactUri); - $expectedResponse->setEtag($etag); - $expectedResponse->setMetadataArtifact($metadataArtifact); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->getModel($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/GetModel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getModelExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - try { - $gapicClient->getModel($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getModelEvaluationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $metricsSchemaUri = 'metricsSchemaUri981925578'; - $dataItemSchemaUri = 'dataItemSchemaUri2052678629'; - $annotationSchemaUri = 'annotationSchemaUri669210846'; - $expectedResponse = new ModelEvaluation(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMetricsSchemaUri($metricsSchemaUri); - $expectedResponse->setDataItemSchemaUri($dataItemSchemaUri); - $expectedResponse->setAnnotationSchemaUri($annotationSchemaUri); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - $response = $gapicClient->getModelEvaluation($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/GetModelEvaluation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getModelEvaluationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - try { - $gapicClient->getModelEvaluation($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getModelEvaluationSliceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $metricsSchemaUri = 'metricsSchemaUri981925578'; - $expectedResponse = new ModelEvaluationSlice(); - $expectedResponse->setName($name2); - $expectedResponse->setMetricsSchemaUri($metricsSchemaUri); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); - $response = $gapicClient->getModelEvaluationSlice($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/GetModelEvaluationSlice', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getModelEvaluationSliceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelEvaluationSliceName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]', '[SLICE]'); - try { - $gapicClient->getModelEvaluationSlice($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importModelEvaluationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $metricsSchemaUri = 'metricsSchemaUri981925578'; - $dataItemSchemaUri = 'dataItemSchemaUri2052678629'; - $annotationSchemaUri = 'annotationSchemaUri669210846'; - $expectedResponse = new ModelEvaluation(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMetricsSchemaUri($metricsSchemaUri); - $expectedResponse->setDataItemSchemaUri($dataItemSchemaUri); - $expectedResponse->setAnnotationSchemaUri($annotationSchemaUri); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $modelEvaluation = new ModelEvaluation(); - $response = $gapicClient->importModelEvaluation($formattedParent, $modelEvaluation); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/ImportModelEvaluation', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getModelEvaluation(); - $this->assertProtobufEquals($modelEvaluation, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importModelEvaluationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $modelEvaluation = new ModelEvaluation(); - try { - $gapicClient->importModelEvaluation($formattedParent, $modelEvaluation); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelEvaluationSlicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $modelEvaluationSlicesElement = new ModelEvaluationSlice(); - $modelEvaluationSlices = [ - $modelEvaluationSlicesElement, - ]; - $expectedResponse = new ListModelEvaluationSlicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setModelEvaluationSlices($modelEvaluationSlices); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - $response = $gapicClient->listModelEvaluationSlices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getModelEvaluationSlices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluationSlices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelEvaluationSlicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[EVALUATION]'); - try { - $gapicClient->listModelEvaluationSlices($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelEvaluationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $modelEvaluationsElement = new ModelEvaluation(); - $modelEvaluations = [ - $modelEvaluationsElement, - ]; - $expectedResponse = new ListModelEvaluationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setModelEvaluations($modelEvaluations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->listModelEvaluations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getModelEvaluations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelEvaluationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - try { - $gapicClient->listModelEvaluations($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $modelsElement = new Model(); - $models = [ - $modelsElement, - ]; - $expectedResponse = new ListModelVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setModels($models); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->listModelVersions($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getModels()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/ListModelVersions', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelVersionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - try { - $gapicClient->listModelVersions($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $modelsElement = new Model(); - $models = [ - $modelsElement, - ]; - $expectedResponse = new ListModelsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setModels($models); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listModels($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getModels()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/ListModels', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listModelsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listModels($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function mergeVersionAliasesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $versionId = 'versionId-670497310'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $versionDescription = 'versionDescription1423604501'; - $metadataSchemaUri = 'metadataSchemaUri-152319778'; - $trainingPipeline = 'trainingPipeline-2026166169'; - $pipelineJob = 'pipelineJob361059488'; - $artifactUri = 'artifactUri-671891073'; - $etag = 'etag3123477'; - $metadataArtifact = 'metadataArtifact2087706850'; - $expectedResponse = new Model(); - $expectedResponse->setName($name2); - $expectedResponse->setVersionId($versionId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setVersionDescription($versionDescription); - $expectedResponse->setMetadataSchemaUri($metadataSchemaUri); - $expectedResponse->setTrainingPipeline($trainingPipeline); - $expectedResponse->setPipelineJob($pipelineJob); - $expectedResponse->setArtifactUri($artifactUri); - $expectedResponse->setEtag($etag); - $expectedResponse->setMetadataArtifact($metadataArtifact); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $versionAliases = []; - $response = $gapicClient->mergeVersionAliases($formattedName, $versionAliases); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/MergeVersionAliases', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getVersionAliases(); - $this->assertProtobufEquals($versionAliases, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function mergeVersionAliasesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $versionAliases = []; - try { - $gapicClient->mergeVersionAliases($formattedName, $versionAliases); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateExplanationDatasetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateExplanationDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new UpdateExplanationDatasetResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateExplanationDatasetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->updateExplanationDataset($formattedModel); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/UpdateExplanationDataset', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getModel(); - $this->assertProtobufEquals($formattedModel, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateExplanationDatasetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateExplanationDatasetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateExplanationDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedModel = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); - $response = $gapicClient->updateExplanationDataset($formattedModel); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateExplanationDatasetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateModelTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $versionId = 'versionId-670497310'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $versionDescription = 'versionDescription1423604501'; - $metadataSchemaUri = 'metadataSchemaUri-152319778'; - $trainingPipeline = 'trainingPipeline-2026166169'; - $pipelineJob = 'pipelineJob361059488'; - $artifactUri = 'artifactUri-671891073'; - $etag = 'etag3123477'; - $metadataArtifact = 'metadataArtifact2087706850'; - $expectedResponse = new Model(); - $expectedResponse->setName($name); - $expectedResponse->setVersionId($versionId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setVersionDescription($versionDescription); - $expectedResponse->setMetadataSchemaUri($metadataSchemaUri); - $expectedResponse->setTrainingPipeline($trainingPipeline); - $expectedResponse->setPipelineJob($pipelineJob); - $expectedResponse->setArtifactUri($artifactUri); - $expectedResponse->setEtag($etag); - $expectedResponse->setMetadataArtifact($metadataArtifact); - $transport->addResponse($expectedResponse); - // Mock request - $model = new Model(); - $modelDisplayName = 'modelDisplayName1578770308'; - $model->setDisplayName($modelDisplayName); - $updateMask = new FieldMask(); - $response = $gapicClient->updateModel($model, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/UpdateModel', $actualFuncCall); - $actualValue = $actualRequestObject->getModel(); - $this->assertProtobufEquals($model, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateModelExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $model = new Model(); - $modelDisplayName = 'modelDisplayName1578770308'; - $model->setDisplayName($modelDisplayName); - $updateMask = new FieldMask(); - try { - $gapicClient->updateModel($model, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function uploadModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/uploadModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $model2 = 'model21226956956'; - $modelVersionId = 'modelVersionId-1385431880'; - $expectedResponse = new UploadModelResponse(); - $expectedResponse->setModel($model2); - $expectedResponse->setModelVersionId($modelVersionId); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/uploadModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $model = new Model(); - $modelDisplayName = 'modelDisplayName1578770308'; - $model->setDisplayName($modelDisplayName); - $response = $gapicClient->uploadModel($formattedParent, $model); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ModelService/UploadModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getModel(); - $this->assertProtobufEquals($model, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/uploadModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function uploadModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/uploadModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $model = new Model(); - $modelDisplayName = 'modelDisplayName1578770308'; - $model->setDisplayName($modelDisplayName); - $response = $gapicClient->uploadModel($formattedParent, $model); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/uploadModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/NotebookServiceClientTest.php b/AiPlatform/tests/Unit/V1/NotebookServiceClientTest.php deleted file mode 100644 index 480df68da8bb..000000000000 --- a/AiPlatform/tests/Unit/V1/NotebookServiceClientTest.php +++ /dev/null @@ -1,1419 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return NotebookServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new NotebookServiceClient($options); - } - - /** @test */ - public function assignNotebookRuntimeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/assignNotebookRuntimeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $runtimeUser = 'runtimeUser1935670226'; - $proxyUri = 'proxyUri-475670501'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $isUpgradable = true; - $version = 'version351608024'; - $expectedResponse = new NotebookRuntime(); - $expectedResponse->setName($name); - $expectedResponse->setRuntimeUser($runtimeUser); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setIsUpgradable($isUpgradable); - $expectedResponse->setVersion($version); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/assignNotebookRuntimeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNotebookRuntimeTemplate = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - $notebookRuntime = new NotebookRuntime(); - $notebookRuntimeRuntimeUser = 'notebookRuntimeRuntimeUser825639430'; - $notebookRuntime->setRuntimeUser($notebookRuntimeRuntimeUser); - $notebookRuntimeDisplayName = 'notebookRuntimeDisplayName1784911024'; - $notebookRuntime->setDisplayName($notebookRuntimeDisplayName); - $response = $gapicClient->assignNotebookRuntime($formattedParent, $formattedNotebookRuntimeTemplate, $notebookRuntime); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/AssignNotebookRuntime', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getNotebookRuntimeTemplate(); - $this->assertProtobufEquals($formattedNotebookRuntimeTemplate, $actualValue); - $actualValue = $actualApiRequestObject->getNotebookRuntime(); - $this->assertProtobufEquals($notebookRuntime, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/assignNotebookRuntimeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function assignNotebookRuntimeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/assignNotebookRuntimeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNotebookRuntimeTemplate = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - $notebookRuntime = new NotebookRuntime(); - $notebookRuntimeRuntimeUser = 'notebookRuntimeRuntimeUser825639430'; - $notebookRuntime->setRuntimeUser($notebookRuntimeRuntimeUser); - $notebookRuntimeDisplayName = 'notebookRuntimeDisplayName1784911024'; - $notebookRuntime->setDisplayName($notebookRuntimeDisplayName); - $response = $gapicClient->assignNotebookRuntime($formattedParent, $formattedNotebookRuntimeTemplate, $notebookRuntime); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/assignNotebookRuntimeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createNotebookRuntimeTemplateTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createNotebookRuntimeTemplateTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $isDefault = true; - $serviceAccount = 'serviceAccount-1948028253'; - $etag = 'etag3123477'; - $expectedResponse = new NotebookRuntimeTemplate(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setIsDefault($isDefault); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createNotebookRuntimeTemplateTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $notebookRuntimeTemplate = new NotebookRuntimeTemplate(); - $notebookRuntimeTemplateDisplayName = 'notebookRuntimeTemplateDisplayName-1609642794'; - $notebookRuntimeTemplate->setDisplayName($notebookRuntimeTemplateDisplayName); - $response = $gapicClient->createNotebookRuntimeTemplate($formattedParent, $notebookRuntimeTemplate); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/CreateNotebookRuntimeTemplate', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getNotebookRuntimeTemplate(); - $this->assertProtobufEquals($notebookRuntimeTemplate, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createNotebookRuntimeTemplateTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createNotebookRuntimeTemplateExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createNotebookRuntimeTemplateTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $notebookRuntimeTemplate = new NotebookRuntimeTemplate(); - $notebookRuntimeTemplateDisplayName = 'notebookRuntimeTemplateDisplayName-1609642794'; - $notebookRuntimeTemplate->setDisplayName($notebookRuntimeTemplateDisplayName); - $response = $gapicClient->createNotebookRuntimeTemplate($formattedParent, $notebookRuntimeTemplate); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createNotebookRuntimeTemplateTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteNotebookRuntimeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteNotebookRuntimeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteNotebookRuntimeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $response = $gapicClient->deleteNotebookRuntime($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/DeleteNotebookRuntime', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteNotebookRuntimeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteNotebookRuntimeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteNotebookRuntimeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $response = $gapicClient->deleteNotebookRuntime($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteNotebookRuntimeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteNotebookRuntimeTemplateTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteNotebookRuntimeTemplateTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteNotebookRuntimeTemplateTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - $response = $gapicClient->deleteNotebookRuntimeTemplate($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/DeleteNotebookRuntimeTemplate', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteNotebookRuntimeTemplateTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteNotebookRuntimeTemplateExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteNotebookRuntimeTemplateTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - $response = $gapicClient->deleteNotebookRuntimeTemplate($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteNotebookRuntimeTemplateTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getNotebookRuntimeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $runtimeUser = 'runtimeUser1935670226'; - $proxyUri = 'proxyUri-475670501'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $isUpgradable = true; - $version = 'version351608024'; - $expectedResponse = new NotebookRuntime(); - $expectedResponse->setName($name2); - $expectedResponse->setRuntimeUser($runtimeUser); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setIsUpgradable($isUpgradable); - $expectedResponse->setVersion($version); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $response = $gapicClient->getNotebookRuntime($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/GetNotebookRuntime', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNotebookRuntimeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - try { - $gapicClient->getNotebookRuntime($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNotebookRuntimeTemplateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $isDefault = true; - $serviceAccount = 'serviceAccount-1948028253'; - $etag = 'etag3123477'; - $expectedResponse = new NotebookRuntimeTemplate(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setIsDefault($isDefault); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - $response = $gapicClient->getNotebookRuntimeTemplate($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/GetNotebookRuntimeTemplate', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNotebookRuntimeTemplateExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->notebookRuntimeTemplateName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME_TEMPLATE]'); - try { - $gapicClient->getNotebookRuntimeTemplate($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNotebookRuntimeTemplatesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $notebookRuntimeTemplatesElement = new NotebookRuntimeTemplate(); - $notebookRuntimeTemplates = [ - $notebookRuntimeTemplatesElement, - ]; - $expectedResponse = new ListNotebookRuntimeTemplatesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setNotebookRuntimeTemplates($notebookRuntimeTemplates); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listNotebookRuntimeTemplates($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getNotebookRuntimeTemplates()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/ListNotebookRuntimeTemplates', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNotebookRuntimeTemplatesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listNotebookRuntimeTemplates($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNotebookRuntimesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $notebookRuntimesElement = new NotebookRuntime(); - $notebookRuntimes = [ - $notebookRuntimesElement, - ]; - $expectedResponse = new ListNotebookRuntimesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setNotebookRuntimes($notebookRuntimes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listNotebookRuntimes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getNotebookRuntimes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/ListNotebookRuntimes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNotebookRuntimesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listNotebookRuntimes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function startNotebookRuntimeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/startNotebookRuntimeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new StartNotebookRuntimeResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/startNotebookRuntimeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $response = $gapicClient->startNotebookRuntime($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/StartNotebookRuntime', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/startNotebookRuntimeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function startNotebookRuntimeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/startNotebookRuntimeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $response = $gapicClient->startNotebookRuntime($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/startNotebookRuntimeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function upgradeNotebookRuntimeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/upgradeNotebookRuntimeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new UpgradeNotebookRuntimeResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/upgradeNotebookRuntimeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $response = $gapicClient->upgradeNotebookRuntime($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.NotebookService/UpgradeNotebookRuntime', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeNotebookRuntimeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function upgradeNotebookRuntimeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/upgradeNotebookRuntimeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->notebookRuntimeName('[PROJECT]', '[LOCATION]', '[NOTEBOOK_RUNTIME]'); - $response = $gapicClient->upgradeNotebookRuntime($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeNotebookRuntimeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/PersistentResourceServiceClientTest.php b/AiPlatform/tests/Unit/V1/PersistentResourceServiceClientTest.php deleted file mode 100644 index f7ae0cc14d43..000000000000 --- a/AiPlatform/tests/Unit/V1/PersistentResourceServiceClientTest.php +++ /dev/null @@ -1,1020 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return PersistentResourceServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PersistentResourceServiceClient($options); - } - - /** @test */ - public function createPersistentResourceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createPersistentResourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $network = 'network1843485230'; - $expectedResponse = new PersistentResource(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setNetwork($network); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createPersistentResourceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $persistentResource = new PersistentResource(); - $persistentResourceResourcePools = []; - $persistentResource->setResourcePools($persistentResourceResourcePools); - $persistentResourceId = 'persistentResourceId661736772'; - $response = $gapicClient->createPersistentResource($formattedParent, $persistentResource, $persistentResourceId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/CreatePersistentResource', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getPersistentResource(); - $this->assertProtobufEquals($persistentResource, $actualValue); - $actualValue = $actualApiRequestObject->getPersistentResourceId(); - $this->assertProtobufEquals($persistentResourceId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createPersistentResourceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createPersistentResourceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createPersistentResourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $persistentResource = new PersistentResource(); - $persistentResourceResourcePools = []; - $persistentResource->setResourcePools($persistentResourceResourcePools); - $persistentResourceId = 'persistentResourceId661736772'; - $response = $gapicClient->createPersistentResource($formattedParent, $persistentResource, $persistentResourceId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createPersistentResourceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deletePersistentResourceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deletePersistentResourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deletePersistentResourceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $response = $gapicClient->deletePersistentResource($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/DeletePersistentResource', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deletePersistentResourceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deletePersistentResourceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deletePersistentResourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $response = $gapicClient->deletePersistentResource($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deletePersistentResourceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getPersistentResourceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $network = 'network1843485230'; - $expectedResponse = new PersistentResource(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setNetwork($network); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $response = $gapicClient->getPersistentResource($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/GetPersistentResource', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPersistentResourceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - try { - $gapicClient->getPersistentResource($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPersistentResourcesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $persistentResourcesElement = new PersistentResource(); - $persistentResources = [ - $persistentResourcesElement, - ]; - $expectedResponse = new ListPersistentResourcesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPersistentResources($persistentResources); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listPersistentResources($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPersistentResources()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/ListPersistentResources', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPersistentResourcesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listPersistentResources($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rebootPersistentResourceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/rebootPersistentResourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $network = 'network1843485230'; - $expectedResponse = new PersistentResource(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setNetwork($network); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/rebootPersistentResourceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $response = $gapicClient->rebootPersistentResource($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/RebootPersistentResource', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/rebootPersistentResourceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function rebootPersistentResourceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/rebootPersistentResourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->persistentResourceName('[PROJECT]', '[LOCATION]', '[PERSISTENT_RESOURCE]'); - $response = $gapicClient->rebootPersistentResource($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/rebootPersistentResourceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updatePersistentResourceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updatePersistentResourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $network = 'network1843485230'; - $expectedResponse = new PersistentResource(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setNetwork($network); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updatePersistentResourceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $persistentResource = new PersistentResource(); - $persistentResourceResourcePools = []; - $persistentResource->setResourcePools($persistentResourceResourcePools); - $updateMask = new FieldMask(); - $response = $gapicClient->updatePersistentResource($persistentResource, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PersistentResourceService/UpdatePersistentResource', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getPersistentResource(); - $this->assertProtobufEquals($persistentResource, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updatePersistentResourceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updatePersistentResourceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updatePersistentResourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $persistentResource = new PersistentResource(); - $persistentResourceResourcePools = []; - $persistentResource->setResourcePools($persistentResourceResourcePools); - $updateMask = new FieldMask(); - $response = $gapicClient->updatePersistentResource($persistentResource, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updatePersistentResourceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/PipelineServiceClientTest.php b/AiPlatform/tests/Unit/V1/PipelineServiceClientTest.php deleted file mode 100644 index 08a898d8bb12..000000000000 --- a/AiPlatform/tests/Unit/V1/PipelineServiceClientTest.php +++ /dev/null @@ -1,1416 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return PipelineServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PipelineServiceClient($options); - } - - /** @test */ - public function batchCancelPipelineJobsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchCancelPipelineJobsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchCancelPipelineJobsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchCancelPipelineJobsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNames = [ - $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - ]; - $response = $gapicClient->batchCancelPipelineJobs($formattedParent, $formattedNames); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/BatchCancelPipelineJobs', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getNames(); - $this->assertProtobufEquals($formattedNames, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCancelPipelineJobsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchCancelPipelineJobsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchCancelPipelineJobsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNames = [ - $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - ]; - $response = $gapicClient->batchCancelPipelineJobs($formattedParent, $formattedNames); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCancelPipelineJobsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchDeletePipelineJobsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchDeletePipelineJobsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchDeletePipelineJobsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchDeletePipelineJobsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNames = [ - $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - ]; - $response = $gapicClient->batchDeletePipelineJobs($formattedParent, $formattedNames); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/BatchDeletePipelineJobs', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getNames(); - $this->assertProtobufEquals($formattedNames, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchDeletePipelineJobsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchDeletePipelineJobsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchDeletePipelineJobsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $formattedNames = [ - $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'), - ]; - $response = $gapicClient->batchDeletePipelineJobs($formattedParent, $formattedNames); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchDeletePipelineJobsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function cancelPipelineJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $gapicClient->cancelPipelineJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/CancelPipelineJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelPipelineJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - try { - $gapicClient->cancelPipelineJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelTrainingPipelineTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $gapicClient->cancelTrainingPipeline($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/CancelTrainingPipeline', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelTrainingPipelineExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - try { - $gapicClient->cancelTrainingPipeline($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createPipelineJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $serviceAccount = 'serviceAccount-1948028253'; - $network = 'network1843485230'; - $templateUri = 'templateUri-975637465'; - $scheduleName = 'scheduleName1677633331'; - $expectedResponse = new PipelineJob(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setNetwork($network); - $expectedResponse->setTemplateUri($templateUri); - $expectedResponse->setScheduleName($scheduleName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pipelineJob = new PipelineJob(); - $response = $gapicClient->createPipelineJob($formattedParent, $pipelineJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/CreatePipelineJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPipelineJob(); - $this->assertProtobufEquals($pipelineJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createPipelineJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pipelineJob = new PipelineJob(); - try { - $gapicClient->createPipelineJob($formattedParent, $pipelineJob); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTrainingPipelineTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $trainingTaskDefinition = 'trainingTaskDefinition-1916695832'; - $modelId = 'modelId-619038223'; - $parentModel = 'parentModel1400422228'; - $expectedResponse = new TrainingPipeline(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setTrainingTaskDefinition($trainingTaskDefinition); - $expectedResponse->setModelId($modelId); - $expectedResponse->setParentModel($parentModel); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $trainingPipeline = new TrainingPipeline(); - $trainingPipelineDisplayName = 'trainingPipelineDisplayName-236550351'; - $trainingPipeline->setDisplayName($trainingPipelineDisplayName); - $trainingPipelineTrainingTaskDefinition = 'trainingPipelineTrainingTaskDefinition2032083182'; - $trainingPipeline->setTrainingTaskDefinition($trainingPipelineTrainingTaskDefinition); - $trainingPipelineTrainingTaskInputs = new Value(); - $trainingPipeline->setTrainingTaskInputs($trainingPipelineTrainingTaskInputs); - $response = $gapicClient->createTrainingPipeline($formattedParent, $trainingPipeline); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/CreateTrainingPipeline', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTrainingPipeline(); - $this->assertProtobufEquals($trainingPipeline, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTrainingPipelineExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $trainingPipeline = new TrainingPipeline(); - $trainingPipelineDisplayName = 'trainingPipelineDisplayName-236550351'; - $trainingPipeline->setDisplayName($trainingPipelineDisplayName); - $trainingPipelineTrainingTaskDefinition = 'trainingPipelineTrainingTaskDefinition2032083182'; - $trainingPipeline->setTrainingTaskDefinition($trainingPipelineTrainingTaskDefinition); - $trainingPipelineTrainingTaskInputs = new Value(); - $trainingPipeline->setTrainingTaskInputs($trainingPipelineTrainingTaskInputs); - try { - $gapicClient->createTrainingPipeline($formattedParent, $trainingPipeline); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deletePipelineJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deletePipelineJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deletePipelineJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $response = $gapicClient->deletePipelineJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/DeletePipelineJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deletePipelineJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deletePipelineJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deletePipelineJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $response = $gapicClient->deletePipelineJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deletePipelineJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTrainingPipelineTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTrainingPipelineTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTrainingPipelineTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $response = $gapicClient->deleteTrainingPipeline($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/DeleteTrainingPipeline', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTrainingPipelineTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTrainingPipelineExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTrainingPipelineTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $response = $gapicClient->deleteTrainingPipeline($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTrainingPipelineTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getPipelineJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $serviceAccount = 'serviceAccount-1948028253'; - $network = 'network1843485230'; - $templateUri = 'templateUri-975637465'; - $scheduleName = 'scheduleName1677633331'; - $expectedResponse = new PipelineJob(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setNetwork($network); - $expectedResponse->setTemplateUri($templateUri); - $expectedResponse->setScheduleName($scheduleName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - $response = $gapicClient->getPipelineJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/GetPipelineJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPipelineJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->pipelineJobName('[PROJECT]', '[LOCATION]', '[PIPELINE_JOB]'); - try { - $gapicClient->getPipelineJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTrainingPipelineTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $trainingTaskDefinition = 'trainingTaskDefinition-1916695832'; - $modelId = 'modelId-619038223'; - $parentModel = 'parentModel1400422228'; - $expectedResponse = new TrainingPipeline(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setTrainingTaskDefinition($trainingTaskDefinition); - $expectedResponse->setModelId($modelId); - $expectedResponse->setParentModel($parentModel); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - $response = $gapicClient->getTrainingPipeline($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/GetTrainingPipeline', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTrainingPipelineExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->trainingPipelineName('[PROJECT]', '[LOCATION]', '[TRAINING_PIPELINE]'); - try { - $gapicClient->getTrainingPipeline($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPipelineJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $pipelineJobsElement = new PipelineJob(); - $pipelineJobs = [ - $pipelineJobsElement, - ]; - $expectedResponse = new ListPipelineJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPipelineJobs($pipelineJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listPipelineJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPipelineJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/ListPipelineJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPipelineJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listPipelineJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTrainingPipelinesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $trainingPipelinesElement = new TrainingPipeline(); - $trainingPipelines = [ - $trainingPipelinesElement, - ]; - $expectedResponse = new ListTrainingPipelinesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTrainingPipelines($trainingPipelines); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listTrainingPipelines($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTrainingPipelines()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PipelineService/ListTrainingPipelines', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTrainingPipelinesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listTrainingPipelines($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/PredictionServiceClientTest.php b/AiPlatform/tests/Unit/V1/PredictionServiceClientTest.php deleted file mode 100644 index 3caec78ade36..000000000000 --- a/AiPlatform/tests/Unit/V1/PredictionServiceClientTest.php +++ /dev/null @@ -1,1380 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return PredictionServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PredictionServiceClient($options); - } - - /** @test */ - public function directPredictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new DirectPredictResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $response = $gapicClient->directPredict($formattedEndpoint); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/DirectPredict', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function directPredictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - try { - $gapicClient->directPredict($formattedEndpoint); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function directRawPredictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $output = '1'; - $expectedResponse = new DirectRawPredictResponse(); - $expectedResponse->setOutput($output); - $transport->addResponse($expectedResponse); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $response = $gapicClient->directRawPredict($formattedEndpoint); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/DirectRawPredict', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function directRawPredictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - try { - $gapicClient->directRawPredict($formattedEndpoint); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function explainTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $deployedModelId2 = 'deployedModelId2-380204163'; - $expectedResponse = new ExplainResponse(); - $expectedResponse->setDeployedModelId($deployedModelId2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $instances = []; - $response = $gapicClient->explain($formattedEndpoint, $instances); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/Explain', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $actualValue = $actualRequestObject->getInstances(); - $this->assertProtobufEquals($instances, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function explainExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $instances = []; - try { - $gapicClient->explain($formattedEndpoint, $instances); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateContentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GenerateContentResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $model = 'model104069929'; - $contents = []; - $response = $gapicClient->generateContent($model, $contents); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/GenerateContent', $actualFuncCall); - $actualValue = $actualRequestObject->getModel(); - $this->assertProtobufEquals($model, $actualValue); - $actualValue = $actualRequestObject->getContents(); - $this->assertProtobufEquals($contents, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateContentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $model = 'model104069929'; - $contents = []; - try { - $gapicClient->generateContent($model, $contents); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function predictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $deployedModelId = 'deployedModelId866642506'; - $model = 'model104069929'; - $modelVersionId = 'modelVersionId-1385431880'; - $modelDisplayName = 'modelDisplayName1757732158'; - $expectedResponse = new PredictResponse(); - $expectedResponse->setDeployedModelId($deployedModelId); - $expectedResponse->setModel($model); - $expectedResponse->setModelVersionId($modelVersionId); - $expectedResponse->setModelDisplayName($modelDisplayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $instances = []; - $response = $gapicClient->predict($formattedEndpoint, $instances); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/Predict', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $actualValue = $actualRequestObject->getInstances(); - $this->assertProtobufEquals($instances, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function predictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $instances = []; - try { - $gapicClient->predict($formattedEndpoint, $instances); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rawPredictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $contentType = 'contentType831846208'; - $data = '-86'; - $expectedResponse = new HttpBody(); - $expectedResponse->setContentType($contentType); - $expectedResponse->setData($data); - $transport->addResponse($expectedResponse); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $response = $gapicClient->rawPredict($formattedEndpoint); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/RawPredict', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rawPredictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - try { - $gapicClient->rawPredict($formattedEndpoint); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function serverStreamingPredictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new StreamingPredictResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new StreamingPredictResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new StreamingPredictResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $serverStream = $gapicClient->serverStreamingPredict($formattedEndpoint); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/ServerStreamingPredict', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function serverStreamingPredictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $serverStream = $gapicClient->serverStreamingPredict($formattedEndpoint); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamDirectPredictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new StreamDirectPredictResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new StreamDirectPredictResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new StreamDirectPredictResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = new StreamDirectPredictRequest(); - $request->setEndpoint($formattedEndpoint); - $formattedEndpoint2 = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request2 = new StreamDirectPredictRequest(); - $request2->setEndpoint($formattedEndpoint2); - $formattedEndpoint3 = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request3 = new StreamDirectPredictRequest(); - $request3->setEndpoint($formattedEndpoint3); - $bidi = $gapicClient->streamDirectPredict(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/StreamDirectPredict', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamDirectPredictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->streamDirectPredict(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamDirectRawPredictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $output = '1'; - $expectedResponse = new StreamDirectRawPredictResponse(); - $expectedResponse->setOutput($output); - $transport->addResponse($expectedResponse); - $output2 = '116'; - $expectedResponse2 = new StreamDirectRawPredictResponse(); - $expectedResponse2->setOutput($output2); - $transport->addResponse($expectedResponse2); - $output3 = '117'; - $expectedResponse3 = new StreamDirectRawPredictResponse(); - $expectedResponse3->setOutput($output3); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = new StreamDirectRawPredictRequest(); - $request->setEndpoint($formattedEndpoint); - $formattedEndpoint2 = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request2 = new StreamDirectRawPredictRequest(); - $request2->setEndpoint($formattedEndpoint2); - $formattedEndpoint3 = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request3 = new StreamDirectRawPredictRequest(); - $request3->setEndpoint($formattedEndpoint3); - $bidi = $gapicClient->streamDirectRawPredict(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/StreamDirectRawPredict', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamDirectRawPredictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->streamDirectRawPredict(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamGenerateContentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GenerateContentResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new GenerateContentResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new GenerateContentResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $model = 'model104069929'; - $contents = []; - $serverStream = $gapicClient->streamGenerateContent($model, $contents); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/StreamGenerateContent', $actualFuncCall); - $actualValue = $actualRequestObject->getModel(); - $this->assertProtobufEquals($model, $actualValue); - $actualValue = $actualRequestObject->getContents(); - $this->assertProtobufEquals($contents, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamGenerateContentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $model = 'model104069929'; - $contents = []; - $serverStream = $gapicClient->streamGenerateContent($model, $contents); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamRawPredictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $contentType = 'contentType831846208'; - $data = '-86'; - $expectedResponse = new HttpBody(); - $expectedResponse->setContentType($contentType); - $expectedResponse->setData($data); - $transport->addResponse($expectedResponse); - $contentType2 = 'contentType2540291827'; - $data2 = '-35'; - $expectedResponse2 = new HttpBody(); - $expectedResponse2->setContentType($contentType2); - $expectedResponse2->setData($data2); - $transport->addResponse($expectedResponse2); - $contentType3 = 'contentType3540291828'; - $data3 = '-34'; - $expectedResponse3 = new HttpBody(); - $expectedResponse3->setContentType($contentType3); - $expectedResponse3->setData($data3); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $serverStream = $gapicClient->streamRawPredict($formattedEndpoint); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/StreamRawPredict', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($formattedEndpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamRawPredictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $serverStream = $gapicClient->streamRawPredict($formattedEndpoint); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingPredictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new StreamingPredictResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new StreamingPredictResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new StreamingPredictResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = new StreamingPredictRequest(); - $request->setEndpoint($formattedEndpoint); - $formattedEndpoint2 = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request2 = new StreamingPredictRequest(); - $request2->setEndpoint($formattedEndpoint2); - $formattedEndpoint3 = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request3 = new StreamingPredictRequest(); - $request3->setEndpoint($formattedEndpoint3); - $bidi = $gapicClient->streamingPredict(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/StreamingPredict', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingPredictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->streamingPredict(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingRawPredictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $output = '1'; - $expectedResponse = new StreamingRawPredictResponse(); - $expectedResponse->setOutput($output); - $transport->addResponse($expectedResponse); - $output2 = '116'; - $expectedResponse2 = new StreamingRawPredictResponse(); - $expectedResponse2->setOutput($output2); - $transport->addResponse($expectedResponse2); - $output3 = '117'; - $expectedResponse3 = new StreamingRawPredictResponse(); - $expectedResponse3->setOutput($output3); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedEndpoint = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = new StreamingRawPredictRequest(); - $request->setEndpoint($formattedEndpoint); - $formattedEndpoint2 = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request2 = new StreamingRawPredictRequest(); - $request2->setEndpoint($formattedEndpoint2); - $formattedEndpoint3 = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request3 = new StreamingRawPredictRequest(); - $request3->setEndpoint($formattedEndpoint3); - $bidi = $gapicClient->streamingRawPredict(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.PredictionService/StreamingRawPredict', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function streamingRawPredictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->streamingRawPredict(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/ScheduleServiceClientTest.php b/AiPlatform/tests/Unit/V1/ScheduleServiceClientTest.php deleted file mode 100644 index 5aea66e620e7..000000000000 --- a/AiPlatform/tests/Unit/V1/ScheduleServiceClientTest.php +++ /dev/null @@ -1,927 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ScheduleServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ScheduleServiceClient($options); - } - - /** @test */ - public function createScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $cron = 'cron3062414'; - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $maxRunCount = 845001408; - $startedRunCount = 479303651; - $maxConcurrentRunCount = 1478623794; - $allowQueueing = false; - $catchUp = false; - $expectedResponse = new Schedule(); - $expectedResponse->setCron($cron); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxRunCount($maxRunCount); - $expectedResponse->setStartedRunCount($startedRunCount); - $expectedResponse->setMaxConcurrentRunCount($maxConcurrentRunCount); - $expectedResponse->setAllowQueueing($allowQueueing); - $expectedResponse->setCatchUp($catchUp); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $schedule = new Schedule(); - $scheduleDisplayName = 'scheduleDisplayName-242731178'; - $schedule->setDisplayName($scheduleDisplayName); - $scheduleMaxConcurrentRunCount = 423065016; - $schedule->setMaxConcurrentRunCount($scheduleMaxConcurrentRunCount); - $response = $gapicClient->createSchedule($formattedParent, $schedule); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ScheduleService/CreateSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSchedule(); - $this->assertProtobufEquals($schedule, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createScheduleExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $schedule = new Schedule(); - $scheduleDisplayName = 'scheduleDisplayName-242731178'; - $schedule->setDisplayName($scheduleDisplayName); - $scheduleMaxConcurrentRunCount = 423065016; - $schedule->setMaxConcurrentRunCount($scheduleMaxConcurrentRunCount); - try { - $gapicClient->createSchedule($formattedParent, $schedule); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteScheduleTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteScheduleTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteScheduleTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $response = $gapicClient->deleteSchedule($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ScheduleService/DeleteSchedule', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteScheduleTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteScheduleExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteScheduleTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $response = $gapicClient->deleteSchedule($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteScheduleTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $cron = 'cron3062414'; - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $maxRunCount = 845001408; - $startedRunCount = 479303651; - $maxConcurrentRunCount = 1478623794; - $allowQueueing = false; - $catchUp = false; - $expectedResponse = new Schedule(); - $expectedResponse->setCron($cron); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxRunCount($maxRunCount); - $expectedResponse->setStartedRunCount($startedRunCount); - $expectedResponse->setMaxConcurrentRunCount($maxConcurrentRunCount); - $expectedResponse->setAllowQueueing($allowQueueing); - $expectedResponse->setCatchUp($catchUp); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $response = $gapicClient->getSchedule($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ScheduleService/GetSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getScheduleExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - try { - $gapicClient->getSchedule($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSchedulesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $schedulesElement = new Schedule(); - $schedules = [ - $schedulesElement, - ]; - $expectedResponse = new ListSchedulesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSchedules($schedules); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listSchedules($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSchedules()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ScheduleService/ListSchedules', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSchedulesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listSchedules($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $gapicClient->pauseSchedule($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ScheduleService/PauseSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseScheduleExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - try { - $gapicClient->pauseSchedule($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $gapicClient->resumeSchedule($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ScheduleService/ResumeSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeScheduleExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - try { - $gapicClient->resumeSchedule($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $cron = 'cron3062414'; - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $maxRunCount = 845001408; - $startedRunCount = 479303651; - $maxConcurrentRunCount = 1478623794; - $allowQueueing = false; - $catchUp = false; - $expectedResponse = new Schedule(); - $expectedResponse->setCron($cron); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxRunCount($maxRunCount); - $expectedResponse->setStartedRunCount($startedRunCount); - $expectedResponse->setMaxConcurrentRunCount($maxConcurrentRunCount); - $expectedResponse->setAllowQueueing($allowQueueing); - $expectedResponse->setCatchUp($catchUp); - $transport->addResponse($expectedResponse); - // Mock request - $schedule = new Schedule(); - $scheduleDisplayName = 'scheduleDisplayName-242731178'; - $schedule->setDisplayName($scheduleDisplayName); - $scheduleMaxConcurrentRunCount = 423065016; - $schedule->setMaxConcurrentRunCount($scheduleMaxConcurrentRunCount); - $updateMask = new FieldMask(); - $response = $gapicClient->updateSchedule($schedule, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.ScheduleService/UpdateSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getSchedule(); - $this->assertProtobufEquals($schedule, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateScheduleExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $schedule = new Schedule(); - $scheduleDisplayName = 'scheduleDisplayName-242731178'; - $schedule->setDisplayName($scheduleDisplayName); - $scheduleMaxConcurrentRunCount = 423065016; - $schedule->setMaxConcurrentRunCount($scheduleMaxConcurrentRunCount); - $updateMask = new FieldMask(); - try { - $gapicClient->updateSchedule($schedule, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/SpecialistPoolServiceClientTest.php b/AiPlatform/tests/Unit/V1/SpecialistPoolServiceClientTest.php deleted file mode 100644 index be94044b74d3..000000000000 --- a/AiPlatform/tests/Unit/V1/SpecialistPoolServiceClientTest.php +++ /dev/null @@ -1,901 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SpecialistPoolServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SpecialistPoolServiceClient($options); - } - - /** @test */ - public function createSpecialistPoolTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createSpecialistPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $specialistManagersCount = 984151356; - $expectedResponse = new SpecialistPool(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setSpecialistManagersCount($specialistManagersCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSpecialistPoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $specialistPool = new SpecialistPool(); - $specialistPoolName = 'specialistPoolName-1068552936'; - $specialistPool->setName($specialistPoolName); - $specialistPoolDisplayName = 'specialistPoolDisplayName703175488'; - $specialistPool->setDisplayName($specialistPoolDisplayName); - $response = $gapicClient->createSpecialistPool($formattedParent, $specialistPool); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.SpecialistPoolService/CreateSpecialistPool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getSpecialistPool(); - $this->assertProtobufEquals($specialistPool, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSpecialistPoolTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createSpecialistPoolExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createSpecialistPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $specialistPool = new SpecialistPool(); - $specialistPoolName = 'specialistPoolName-1068552936'; - $specialistPool->setName($specialistPoolName); - $specialistPoolDisplayName = 'specialistPoolDisplayName703175488'; - $specialistPool->setDisplayName($specialistPoolDisplayName); - $response = $gapicClient->createSpecialistPool($formattedParent, $specialistPool); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSpecialistPoolTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteSpecialistPoolTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteSpecialistPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteSpecialistPoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - $response = $gapicClient->deleteSpecialistPool($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.SpecialistPoolService/DeleteSpecialistPool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteSpecialistPoolTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteSpecialistPoolExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteSpecialistPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - $response = $gapicClient->deleteSpecialistPool($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteSpecialistPoolTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getSpecialistPoolTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $specialistManagersCount = 984151356; - $expectedResponse = new SpecialistPool(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setSpecialistManagersCount($specialistManagersCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - $response = $gapicClient->getSpecialistPool($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.SpecialistPoolService/GetSpecialistPool', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSpecialistPoolExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->specialistPoolName('[PROJECT]', '[LOCATION]', '[SPECIALIST_POOL]'); - try { - $gapicClient->getSpecialistPool($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSpecialistPoolsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $specialistPoolsElement = new SpecialistPool(); - $specialistPools = [ - $specialistPoolsElement, - ]; - $expectedResponse = new ListSpecialistPoolsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSpecialistPools($specialistPools); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listSpecialistPools($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSpecialistPools()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.SpecialistPoolService/ListSpecialistPools', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSpecialistPoolsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listSpecialistPools($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSpecialistPoolTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateSpecialistPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $specialistManagersCount = 984151356; - $expectedResponse = new SpecialistPool(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setSpecialistManagersCount($specialistManagersCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateSpecialistPoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $specialistPool = new SpecialistPool(); - $specialistPoolName = 'specialistPoolName-1068552936'; - $specialistPool->setName($specialistPoolName); - $specialistPoolDisplayName = 'specialistPoolDisplayName703175488'; - $specialistPool->setDisplayName($specialistPoolDisplayName); - $updateMask = new FieldMask(); - $response = $gapicClient->updateSpecialistPool($specialistPool, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.SpecialistPoolService/UpdateSpecialistPool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getSpecialistPool(); - $this->assertProtobufEquals($specialistPool, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateSpecialistPoolTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateSpecialistPoolExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateSpecialistPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $specialistPool = new SpecialistPool(); - $specialistPoolName = 'specialistPoolName-1068552936'; - $specialistPool->setName($specialistPoolName); - $specialistPoolDisplayName = 'specialistPoolDisplayName703175488'; - $specialistPool->setDisplayName($specialistPoolDisplayName); - $updateMask = new FieldMask(); - $response = $gapicClient->updateSpecialistPool($specialistPool, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateSpecialistPoolTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/TensorboardServiceClientTest.php b/AiPlatform/tests/Unit/V1/TensorboardServiceClientTest.php deleted file mode 100644 index 03dfdab5b747..000000000000 --- a/AiPlatform/tests/Unit/V1/TensorboardServiceClientTest.php +++ /dev/null @@ -1,2783 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TensorboardServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TensorboardServiceClient($options); - } - - /** @test */ - public function batchCreateTensorboardRunsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchCreateTensorboardRunsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $requests = []; - $response = $gapicClient->batchCreateTensorboardRuns($formattedParent, $requests); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/BatchCreateTensorboardRuns', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchCreateTensorboardRunsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $requests = []; - try { - $gapicClient->batchCreateTensorboardRuns($formattedParent, $requests); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchCreateTensorboardTimeSeriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchCreateTensorboardTimeSeriesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $requests = []; - $response = $gapicClient->batchCreateTensorboardTimeSeries($formattedParent, $requests); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/BatchCreateTensorboardTimeSeries', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchCreateTensorboardTimeSeriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $requests = []; - try { - $gapicClient->batchCreateTensorboardTimeSeries($formattedParent, $requests); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchReadTensorboardTimeSeriesDataTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchReadTensorboardTimeSeriesDataResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $formattedTimeSeries = [ - $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'), - ]; - $response = $gapicClient->batchReadTensorboardTimeSeriesData($formattedTensorboard, $formattedTimeSeries); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/BatchReadTensorboardTimeSeriesData', $actualFuncCall); - $actualValue = $actualRequestObject->getTensorboard(); - $this->assertProtobufEquals($formattedTensorboard, $actualValue); - $actualValue = $actualRequestObject->getTimeSeries(); - $this->assertProtobufEquals($formattedTimeSeries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchReadTensorboardTimeSeriesDataExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $formattedTimeSeries = [ - $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'), - ]; - try { - $gapicClient->batchReadTensorboardTimeSeriesData($formattedTensorboard, $formattedTimeSeries); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTensorboardTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTensorboardTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $blobStoragePathPrefix = 'blobStoragePathPrefix566154374'; - $runCount = 485221797; - $etag = 'etag3123477'; - $isDefault = true; - $expectedResponse = new Tensorboard(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setBlobStoragePathPrefix($blobStoragePathPrefix); - $expectedResponse->setRunCount($runCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setIsDefault($isDefault); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTensorboardTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $tensorboard = new Tensorboard(); - $tensorboardDisplayName = 'tensorboardDisplayName-448676352'; - $tensorboard->setDisplayName($tensorboardDisplayName); - $response = $gapicClient->createTensorboard($formattedParent, $tensorboard); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboard', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTensorboard(); - $this->assertProtobufEquals($tensorboard, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTensorboardTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTensorboardExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTensorboardTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $tensorboard = new Tensorboard(); - $tensorboardDisplayName = 'tensorboardDisplayName-448676352'; - $tensorboard->setDisplayName($tensorboardDisplayName); - $response = $gapicClient->createTensorboard($formattedParent, $tensorboard); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTensorboardTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTensorboardExperimentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $source = 'source-896505829'; - $expectedResponse = new TensorboardExperiment(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setSource($source); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $tensorboardExperimentId = 'tensorboardExperimentId932137483'; - $response = $gapicClient->createTensorboardExperiment($formattedParent, $tensorboardExperimentId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardExperiment', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTensorboardExperimentId(); - $this->assertProtobufEquals($tensorboardExperimentId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTensorboardExperimentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $tensorboardExperimentId = 'tensorboardExperimentId932137483'; - try { - $gapicClient->createTensorboardExperiment($formattedParent, $tensorboardExperimentId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTensorboardRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TensorboardRun(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $tensorboardRun = new TensorboardRun(); - $tensorboardRunDisplayName = 'tensorboardRunDisplayName-996156817'; - $tensorboardRun->setDisplayName($tensorboardRunDisplayName); - $tensorboardRunId = 'tensorboardRunId1793766817'; - $response = $gapicClient->createTensorboardRun($formattedParent, $tensorboardRun, $tensorboardRunId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardRun', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTensorboardRun(); - $this->assertProtobufEquals($tensorboardRun, $actualValue); - $actualValue = $actualRequestObject->getTensorboardRunId(); - $this->assertProtobufEquals($tensorboardRunId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTensorboardRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $tensorboardRun = new TensorboardRun(); - $tensorboardRunDisplayName = 'tensorboardRunDisplayName-996156817'; - $tensorboardRun->setDisplayName($tensorboardRunDisplayName); - $tensorboardRunId = 'tensorboardRunId1793766817'; - try { - $gapicClient->createTensorboardRun($formattedParent, $tensorboardRun, $tensorboardRunId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTensorboardTimeSeriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $pluginName = 'pluginName897272855'; - $pluginData = '54'; - $expectedResponse = new TensorboardTimeSeries(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setPluginName($pluginName); - $expectedResponse->setPluginData($pluginData); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $tensorboardTimeSeries = new TensorboardTimeSeries(); - $tensorboardTimeSeriesDisplayName = 'tensorboardTimeSeriesDisplayName1084140540'; - $tensorboardTimeSeries->setDisplayName($tensorboardTimeSeriesDisplayName); - $tensorboardTimeSeriesValueType = ValueType::VALUE_TYPE_UNSPECIFIED; - $tensorboardTimeSeries->setValueType($tensorboardTimeSeriesValueType); - $response = $gapicClient->createTensorboardTimeSeries($formattedParent, $tensorboardTimeSeries); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/CreateTensorboardTimeSeries', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTensorboardTimeSeries(); - $this->assertProtobufEquals($tensorboardTimeSeries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTensorboardTimeSeriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $tensorboardTimeSeries = new TensorboardTimeSeries(); - $tensorboardTimeSeriesDisplayName = 'tensorboardTimeSeriesDisplayName1084140540'; - $tensorboardTimeSeries->setDisplayName($tensorboardTimeSeriesDisplayName); - $tensorboardTimeSeriesValueType = ValueType::VALUE_TYPE_UNSPECIFIED; - $tensorboardTimeSeries->setValueType($tensorboardTimeSeriesValueType); - try { - $gapicClient->createTensorboardTimeSeries($formattedParent, $tensorboardTimeSeries); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTensorboardTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTensorboardTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTensorboardTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $response = $gapicClient->deleteTensorboard($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboard', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTensorboardTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTensorboardExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTensorboardTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $response = $gapicClient->deleteTensorboard($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTensorboardTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTensorboardExperimentTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTensorboardExperimentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTensorboardExperimentTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $response = $gapicClient->deleteTensorboardExperiment($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardExperiment', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTensorboardExperimentTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTensorboardExperimentExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTensorboardExperimentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $response = $gapicClient->deleteTensorboardExperiment($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTensorboardExperimentTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTensorboardRunTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTensorboardRunTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTensorboardRunTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $response = $gapicClient->deleteTensorboardRun($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardRun', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTensorboardRunTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTensorboardRunExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTensorboardRunTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $response = $gapicClient->deleteTensorboardRun($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTensorboardRunTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTensorboardTimeSeriesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTensorboardTimeSeriesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTensorboardTimeSeriesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $response = $gapicClient->deleteTensorboardTimeSeries($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/DeleteTensorboardTimeSeries', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTensorboardTimeSeriesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTensorboardTimeSeriesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTensorboardTimeSeriesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $response = $gapicClient->deleteTensorboardTimeSeries($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTensorboardTimeSeriesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportTensorboardTimeSeriesDataTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $timeSeriesDataPointsElement = new TimeSeriesDataPoint(); - $timeSeriesDataPoints = [ - $timeSeriesDataPointsElement, - ]; - $expectedResponse = new ExportTensorboardTimeSeriesDataResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTimeSeriesDataPoints($timeSeriesDataPoints); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $response = $gapicClient->exportTensorboardTimeSeriesData($formattedTensorboardTimeSeries); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTimeSeriesDataPoints()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ExportTensorboardTimeSeriesData', $actualFuncCall); - $actualValue = $actualRequestObject->getTensorboardTimeSeries(); - $this->assertProtobufEquals($formattedTensorboardTimeSeries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function exportTensorboardTimeSeriesDataExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - try { - $gapicClient->exportTensorboardTimeSeriesData($formattedTensorboardTimeSeries); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTensorboardTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $blobStoragePathPrefix = 'blobStoragePathPrefix566154374'; - $runCount = 485221797; - $etag = 'etag3123477'; - $isDefault = true; - $expectedResponse = new Tensorboard(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setBlobStoragePathPrefix($blobStoragePathPrefix); - $expectedResponse->setRunCount($runCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setIsDefault($isDefault); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $response = $gapicClient->getTensorboard($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/GetTensorboard', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTensorboardExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - try { - $gapicClient->getTensorboard($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTensorboardExperimentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $source = 'source-896505829'; - $expectedResponse = new TensorboardExperiment(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setSource($source); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $response = $gapicClient->getTensorboardExperiment($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/GetTensorboardExperiment', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTensorboardExperimentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - try { - $gapicClient->getTensorboardExperiment($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTensorboardRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TensorboardRun(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $response = $gapicClient->getTensorboardRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/GetTensorboardRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTensorboardRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - try { - $gapicClient->getTensorboardRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTensorboardTimeSeriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $pluginName = 'pluginName897272855'; - $pluginData = '54'; - $expectedResponse = new TensorboardTimeSeries(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setPluginName($pluginName); - $expectedResponse->setPluginData($pluginData); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $response = $gapicClient->getTensorboardTimeSeries($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/GetTensorboardTimeSeries', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTensorboardTimeSeriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - try { - $gapicClient->getTensorboardTimeSeries($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTensorboardExperimentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tensorboardExperimentsElement = new TensorboardExperiment(); - $tensorboardExperiments = [ - $tensorboardExperimentsElement, - ]; - $expectedResponse = new ListTensorboardExperimentsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTensorboardExperiments($tensorboardExperiments); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $response = $gapicClient->listTensorboardExperiments($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTensorboardExperiments()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ListTensorboardExperiments', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTensorboardExperimentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - try { - $gapicClient->listTensorboardExperiments($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTensorboardRunsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tensorboardRunsElement = new TensorboardRun(); - $tensorboardRuns = [ - $tensorboardRunsElement, - ]; - $expectedResponse = new ListTensorboardRunsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTensorboardRuns($tensorboardRuns); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $response = $gapicClient->listTensorboardRuns($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTensorboardRuns()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ListTensorboardRuns', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTensorboardRunsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - try { - $gapicClient->listTensorboardRuns($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTensorboardTimeSeriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tensorboardTimeSeriesElement = new TensorboardTimeSeries(); - $tensorboardTimeSeries = [ - $tensorboardTimeSeriesElement, - ]; - $expectedResponse = new ListTensorboardTimeSeriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTensorboardTimeSeries($tensorboardTimeSeries); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $response = $gapicClient->listTensorboardTimeSeries($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTensorboardTimeSeries()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ListTensorboardTimeSeries', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTensorboardTimeSeriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - try { - $gapicClient->listTensorboardTimeSeries($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTensorboardsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tensorboardsElement = new Tensorboard(); - $tensorboards = [ - $tensorboardsElement, - ]; - $expectedResponse = new ListTensorboardsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTensorboards($tensorboards); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listTensorboards($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTensorboards()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ListTensorboards', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTensorboardsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listTensorboards($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readTensorboardBlobDataTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReadTensorboardBlobDataResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new ReadTensorboardBlobDataResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new ReadTensorboardBlobDataResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $serverStream = $gapicClient->readTensorboardBlobData($formattedTimeSeries); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ReadTensorboardBlobData', $actualFuncCall); - $actualValue = $actualRequestObject->getTimeSeries(); - $this->assertProtobufEquals($formattedTimeSeries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readTensorboardBlobDataExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $formattedTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $serverStream = $gapicClient->readTensorboardBlobData($formattedTimeSeries); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readTensorboardSizeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $storageSizeByte = 126045758; - $expectedResponse = new ReadTensorboardSizeResponse(); - $expectedResponse->setStorageSizeByte($storageSizeByte); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $response = $gapicClient->readTensorboardSize($formattedTensorboard); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ReadTensorboardSize', $actualFuncCall); - $actualValue = $actualRequestObject->getTensorboard(); - $this->assertProtobufEquals($formattedTensorboard, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readTensorboardSizeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - try { - $gapicClient->readTensorboardSize($formattedTensorboard); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readTensorboardTimeSeriesDataTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReadTensorboardTimeSeriesDataResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - $response = $gapicClient->readTensorboardTimeSeriesData($formattedTensorboardTimeSeries); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ReadTensorboardTimeSeriesData', $actualFuncCall); - $actualValue = $actualRequestObject->getTensorboardTimeSeries(); - $this->assertProtobufEquals($formattedTensorboardTimeSeries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readTensorboardTimeSeriesDataExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTensorboardTimeSeries = $gapicClient->tensorboardTimeSeriesName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]', '[TIME_SERIES]'); - try { - $gapicClient->readTensorboardTimeSeriesData($formattedTensorboardTimeSeries); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readTensorboardUsageTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReadTensorboardUsageResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - $response = $gapicClient->readTensorboardUsage($formattedTensorboard); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/ReadTensorboardUsage', $actualFuncCall); - $actualValue = $actualRequestObject->getTensorboard(); - $this->assertProtobufEquals($formattedTensorboard, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readTensorboardUsageExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTensorboard = $gapicClient->tensorboardName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]'); - try { - $gapicClient->readTensorboardUsage($formattedTensorboard); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTensorboardTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTensorboardTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $blobStoragePathPrefix = 'blobStoragePathPrefix566154374'; - $runCount = 485221797; - $etag = 'etag3123477'; - $isDefault = true; - $expectedResponse = new Tensorboard(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setBlobStoragePathPrefix($blobStoragePathPrefix); - $expectedResponse->setRunCount($runCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setIsDefault($isDefault); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTensorboardTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $tensorboard = new Tensorboard(); - $tensorboardDisplayName = 'tensorboardDisplayName-448676352'; - $tensorboard->setDisplayName($tensorboardDisplayName); - $response = $gapicClient->updateTensorboard($updateMask, $tensorboard); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboard', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getTensorboard(); - $this->assertProtobufEquals($tensorboard, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTensorboardTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTensorboardExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTensorboardTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $tensorboard = new Tensorboard(); - $tensorboardDisplayName = 'tensorboardDisplayName-448676352'; - $tensorboard->setDisplayName($tensorboardDisplayName); - $response = $gapicClient->updateTensorboard($updateMask, $tensorboard); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTensorboardTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTensorboardExperimentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $source = 'source-896505829'; - $expectedResponse = new TensorboardExperiment(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setSource($source); - $transport->addResponse($expectedResponse); - // Mock request - $updateMask = new FieldMask(); - $tensorboardExperiment = new TensorboardExperiment(); - $response = $gapicClient->updateTensorboardExperiment($updateMask, $tensorboardExperiment); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardExperiment', $actualFuncCall); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualRequestObject->getTensorboardExperiment(); - $this->assertProtobufEquals($tensorboardExperiment, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTensorboardExperimentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $tensorboardExperiment = new TensorboardExperiment(); - try { - $gapicClient->updateTensorboardExperiment($updateMask, $tensorboardExperiment); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTensorboardRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TensorboardRun(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $updateMask = new FieldMask(); - $tensorboardRun = new TensorboardRun(); - $tensorboardRunDisplayName = 'tensorboardRunDisplayName-996156817'; - $tensorboardRun->setDisplayName($tensorboardRunDisplayName); - $response = $gapicClient->updateTensorboardRun($updateMask, $tensorboardRun); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardRun', $actualFuncCall); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualRequestObject->getTensorboardRun(); - $this->assertProtobufEquals($tensorboardRun, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTensorboardRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $tensorboardRun = new TensorboardRun(); - $tensorboardRunDisplayName = 'tensorboardRunDisplayName-996156817'; - $tensorboardRun->setDisplayName($tensorboardRunDisplayName); - try { - $gapicClient->updateTensorboardRun($updateMask, $tensorboardRun); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTensorboardTimeSeriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $pluginName = 'pluginName897272855'; - $pluginData = '54'; - $expectedResponse = new TensorboardTimeSeries(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setPluginName($pluginName); - $expectedResponse->setPluginData($pluginData); - $transport->addResponse($expectedResponse); - // Mock request - $updateMask = new FieldMask(); - $tensorboardTimeSeries = new TensorboardTimeSeries(); - $tensorboardTimeSeriesDisplayName = 'tensorboardTimeSeriesDisplayName1084140540'; - $tensorboardTimeSeries->setDisplayName($tensorboardTimeSeriesDisplayName); - $tensorboardTimeSeriesValueType = ValueType::VALUE_TYPE_UNSPECIFIED; - $tensorboardTimeSeries->setValueType($tensorboardTimeSeriesValueType); - $response = $gapicClient->updateTensorboardTimeSeries($updateMask, $tensorboardTimeSeries); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/UpdateTensorboardTimeSeries', $actualFuncCall); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualRequestObject->getTensorboardTimeSeries(); - $this->assertProtobufEquals($tensorboardTimeSeries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTensorboardTimeSeriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $tensorboardTimeSeries = new TensorboardTimeSeries(); - $tensorboardTimeSeriesDisplayName = 'tensorboardTimeSeriesDisplayName1084140540'; - $tensorboardTimeSeries->setDisplayName($tensorboardTimeSeriesDisplayName); - $tensorboardTimeSeriesValueType = ValueType::VALUE_TYPE_UNSPECIFIED; - $tensorboardTimeSeries->setValueType($tensorboardTimeSeriesValueType); - try { - $gapicClient->updateTensorboardTimeSeries($updateMask, $tensorboardTimeSeries); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeTensorboardExperimentDataTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new WriteTensorboardExperimentDataResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTensorboardExperiment = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $writeRunDataRequests = []; - $response = $gapicClient->writeTensorboardExperimentData($formattedTensorboardExperiment, $writeRunDataRequests); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/WriteTensorboardExperimentData', $actualFuncCall); - $actualValue = $actualRequestObject->getTensorboardExperiment(); - $this->assertProtobufEquals($formattedTensorboardExperiment, $actualValue); - $actualValue = $actualRequestObject->getWriteRunDataRequests(); - $this->assertProtobufEquals($writeRunDataRequests, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeTensorboardExperimentDataExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTensorboardExperiment = $gapicClient->tensorboardExperimentName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]'); - $writeRunDataRequests = []; - try { - $gapicClient->writeTensorboardExperimentData($formattedTensorboardExperiment, $writeRunDataRequests); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeTensorboardRunDataTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new WriteTensorboardRunDataResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTensorboardRun = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $timeSeriesData = []; - $response = $gapicClient->writeTensorboardRunData($formattedTensorboardRun, $timeSeriesData); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.TensorboardService/WriteTensorboardRunData', $actualFuncCall); - $actualValue = $actualRequestObject->getTensorboardRun(); - $this->assertProtobufEquals($formattedTensorboardRun, $actualValue); - $actualValue = $actualRequestObject->getTimeSeriesData(); - $this->assertProtobufEquals($timeSeriesData, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeTensorboardRunDataExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTensorboardRun = $gapicClient->tensorboardRunName('[PROJECT]', '[LOCATION]', '[TENSORBOARD]', '[EXPERIMENT]', '[RUN]'); - $timeSeriesData = []; - try { - $gapicClient->writeTensorboardRunData($formattedTensorboardRun, $timeSeriesData); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AiPlatform/tests/Unit/V1/VizierServiceClientTest.php b/AiPlatform/tests/Unit/V1/VizierServiceClientTest.php deleted file mode 100644 index fd86fd1d03be..000000000000 --- a/AiPlatform/tests/Unit/V1/VizierServiceClientTest.php +++ /dev/null @@ -1,1504 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return VizierServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new VizierServiceClient($options); - } - - /** @test */ - public function addTrialMeasurementTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $id = 'id3355'; - $clientId = 'clientId-1904089585'; - $infeasibleReason = 'infeasibleReason1225702715'; - $customJob = 'customJob-1581369873'; - $expectedResponse = new Trial(); - $expectedResponse->setName($name); - $expectedResponse->setId($id); - $expectedResponse->setClientId($clientId); - $expectedResponse->setInfeasibleReason($infeasibleReason); - $expectedResponse->setCustomJob($customJob); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTrialName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $measurement = new Measurement(); - $response = $gapicClient->addTrialMeasurement($formattedTrialName, $measurement); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/AddTrialMeasurement', $actualFuncCall); - $actualValue = $actualRequestObject->getTrialName(); - $this->assertProtobufEquals($formattedTrialName, $actualValue); - $actualValue = $actualRequestObject->getMeasurement(); - $this->assertProtobufEquals($measurement, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function addTrialMeasurementExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTrialName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $measurement = new Measurement(); - try { - $gapicClient->addTrialMeasurement($formattedTrialName, $measurement); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function checkTrialEarlyStoppingStateTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/checkTrialEarlyStoppingStateTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $shouldStop = true; - $expectedResponse = new CheckTrialEarlyStoppingStateResponse(); - $expectedResponse->setShouldStop($shouldStop); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/checkTrialEarlyStoppingStateTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedTrialName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $response = $gapicClient->checkTrialEarlyStoppingState($formattedTrialName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/CheckTrialEarlyStoppingState', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTrialName(); - $this->assertProtobufEquals($formattedTrialName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/checkTrialEarlyStoppingStateTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function checkTrialEarlyStoppingStateExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/checkTrialEarlyStoppingStateTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedTrialName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $response = $gapicClient->checkTrialEarlyStoppingState($formattedTrialName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/checkTrialEarlyStoppingStateTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function completeTrialTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $id = 'id3355'; - $clientId = 'clientId-1904089585'; - $infeasibleReason2 = 'infeasibleReason21079273006'; - $customJob = 'customJob-1581369873'; - $expectedResponse = new Trial(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id); - $expectedResponse->setClientId($clientId); - $expectedResponse->setInfeasibleReason($infeasibleReason2); - $expectedResponse->setCustomJob($customJob); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $response = $gapicClient->completeTrial($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/CompleteTrial', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function completeTrialExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - try { - $gapicClient->completeTrial($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createStudyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $inactiveReason = 'inactiveReason-1468304232'; - $expectedResponse = new Study(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setInactiveReason($inactiveReason); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $study = new Study(); - $studyDisplayName = 'studyDisplayName-569693980'; - $study->setDisplayName($studyDisplayName); - $studyStudySpec = new StudySpec(); - $studySpecMetrics = []; - $studyStudySpec->setMetrics($studySpecMetrics); - $studySpecParameters = []; - $studyStudySpec->setParameters($studySpecParameters); - $study->setStudySpec($studyStudySpec); - $response = $gapicClient->createStudy($formattedParent, $study); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/CreateStudy', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getStudy(); - $this->assertProtobufEquals($study, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createStudyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $study = new Study(); - $studyDisplayName = 'studyDisplayName-569693980'; - $study->setDisplayName($studyDisplayName); - $studyStudySpec = new StudySpec(); - $studySpecMetrics = []; - $studyStudySpec->setMetrics($studySpecMetrics); - $studySpecParameters = []; - $studyStudySpec->setParameters($studySpecParameters); - $study->setStudySpec($studyStudySpec); - try { - $gapicClient->createStudy($formattedParent, $study); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTrialTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $id = 'id3355'; - $clientId = 'clientId-1904089585'; - $infeasibleReason = 'infeasibleReason1225702715'; - $customJob = 'customJob-1581369873'; - $expectedResponse = new Trial(); - $expectedResponse->setName($name); - $expectedResponse->setId($id); - $expectedResponse->setClientId($clientId); - $expectedResponse->setInfeasibleReason($infeasibleReason); - $expectedResponse->setCustomJob($customJob); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $trial = new Trial(); - $response = $gapicClient->createTrial($formattedParent, $trial); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/CreateTrial', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTrial(); - $this->assertProtobufEquals($trial, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTrialExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $trial = new Trial(); - try { - $gapicClient->createTrial($formattedParent, $trial); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteStudyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $gapicClient->deleteStudy($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/DeleteStudy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteStudyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - try { - $gapicClient->deleteStudy($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTrialTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $gapicClient->deleteTrial($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/DeleteTrial', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTrialExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - try { - $gapicClient->deleteTrial($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getStudyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $inactiveReason = 'inactiveReason-1468304232'; - $expectedResponse = new Study(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setInactiveReason($inactiveReason); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $response = $gapicClient->getStudy($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/GetStudy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getStudyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - try { - $gapicClient->getStudy($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTrialTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $id = 'id3355'; - $clientId = 'clientId-1904089585'; - $infeasibleReason = 'infeasibleReason1225702715'; - $customJob = 'customJob-1581369873'; - $expectedResponse = new Trial(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id); - $expectedResponse->setClientId($clientId); - $expectedResponse->setInfeasibleReason($infeasibleReason); - $expectedResponse->setCustomJob($customJob); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $response = $gapicClient->getTrial($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/GetTrial', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTrialExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - try { - $gapicClient->getTrial($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listOptimalTrialsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListOptimalTrialsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $response = $gapicClient->listOptimalTrials($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/ListOptimalTrials', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listOptimalTrialsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - try { - $gapicClient->listOptimalTrials($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listStudiesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $studiesElement = new Study(); - $studies = [ - $studiesElement, - ]; - $expectedResponse = new ListStudiesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setStudies($studies); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listStudies($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getStudies()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/ListStudies', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listStudiesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listStudies($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTrialsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $trialsElement = new Trial(); - $trials = [ - $trialsElement, - ]; - $expectedResponse = new ListTrialsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTrials($trials); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $response = $gapicClient->listTrials($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTrials()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/ListTrials', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTrialsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - try { - $gapicClient->listTrials($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function lookupStudyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName2 = 'displayName21615000987'; - $inactiveReason = 'inactiveReason-1468304232'; - $expectedResponse = new Study(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName2); - $expectedResponse->setInactiveReason($inactiveReason); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $displayName = 'displayName1615086568'; - $response = $gapicClient->lookupStudy($formattedParent, $displayName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/LookupStudy', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getDisplayName(); - $this->assertProtobufEquals($displayName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function lookupStudyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $displayName = 'displayName1615086568'; - try { - $gapicClient->lookupStudy($formattedParent, $displayName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function stopTrialTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $id = 'id3355'; - $clientId = 'clientId-1904089585'; - $infeasibleReason = 'infeasibleReason1225702715'; - $customJob = 'customJob-1581369873'; - $expectedResponse = new Trial(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id); - $expectedResponse->setClientId($clientId); - $expectedResponse->setInfeasibleReason($infeasibleReason); - $expectedResponse->setCustomJob($customJob); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - $response = $gapicClient->stopTrial($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/StopTrial', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function stopTrialExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->trialName('[PROJECT]', '[LOCATION]', '[STUDY]', '[TRIAL]'); - try { - $gapicClient->stopTrial($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function suggestTrialsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/suggestTrialsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SuggestTrialsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/suggestTrialsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $suggestionCount = 390130452; - $clientId = 'clientId-1904089585'; - $response = $gapicClient->suggestTrials($formattedParent, $suggestionCount, $clientId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.aiplatform.v1.VizierService/SuggestTrials', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getSuggestionCount(); - $this->assertProtobufEquals($suggestionCount, $actualValue); - $actualValue = $actualApiRequestObject->getClientId(); - $this->assertProtobufEquals($clientId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/suggestTrialsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function suggestTrialsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/suggestTrialsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->studyName('[PROJECT]', '[LOCATION]', '[STUDY]'); - $suggestionCount = 390130452; - $clientId = 'clientId-1904089585'; - $response = $gapicClient->suggestTrials($formattedParent, $suggestionCount, $clientId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/suggestTrialsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AlloyDb/.repo-metadata.json b/AlloyDb/.repo-metadata.json deleted file mode 100644 index e5702ebd1776..000000000000 --- a/AlloyDb/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-alloydb", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-alloydb/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "alloydb" -} diff --git a/AlloyDb/VERSION b/AlloyDb/VERSION index 571215736a66..a3f5a8ed4d60 100644 --- a/AlloyDb/VERSION +++ b/AlloyDb/VERSION @@ -1 +1 @@ -0.10.1 +0.10.3 diff --git a/AlloyDb/composer.json b/AlloyDb/composer.json index 2c586e32a2dd..8ceb7cb3ec4e 100644 --- a/AlloyDb/composer.json +++ b/AlloyDb/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/common-protos": "^4.4" }, "require-dev": { diff --git a/AnalyticsAdmin/.repo-metadata.json b/AnalyticsAdmin/.repo-metadata.json deleted file mode 100644 index 490f47f52f90..000000000000 --- a/AnalyticsAdmin/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/analytics-admin", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/analytics-admin/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "analyticsadmin" -} diff --git a/AnalyticsAdmin/VERSION b/AnalyticsAdmin/VERSION index d90746a79af3..03035cdde5be 100644 --- a/AnalyticsAdmin/VERSION +++ b/AnalyticsAdmin/VERSION @@ -1 +1 @@ -0.22.3 +0.22.5 diff --git a/AnalyticsAdmin/composer.json b/AnalyticsAdmin/composer.json index 7ac55c7c7bec..dbd7c8c27fe2 100644 --- a/AnalyticsAdmin/composer.json +++ b/AnalyticsAdmin/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AnalyticsData/.repo-metadata.json b/AnalyticsData/.repo-metadata.json deleted file mode 100644 index 16f59f176ede..000000000000 --- a/AnalyticsData/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/analytics-data", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/analytics-data/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "analyticsdata" -} diff --git a/AnalyticsData/VERSION b/AnalyticsData/VERSION index 7eb3095a3295..7cca7711a0dd 100644 --- a/AnalyticsData/VERSION +++ b/AnalyticsData/VERSION @@ -1 +1 @@ -0.16.3 +0.17.1 diff --git a/AnalyticsData/composer.json b/AnalyticsData/composer.json index 9e605ad46acd..2184b1805fd1 100644 --- a/AnalyticsData/composer.json +++ b/AnalyticsData/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AnalyticsData/metadata/V1Alpha/AnalyticsDataApi.php b/AnalyticsData/metadata/V1Alpha/AnalyticsDataApi.php index d3e47e5ae49bacfc3542b7537134361b209ce38f..fce3ba97b7179fb6a742b0c8508cc93e69987adf 100644 GIT binary patch delta 1950 zcmaJ?O>7%g5Y~Ea#~%MB&vv{`9BMC^B&Lchw?wHUnyeEH0@y#c4@W-pLdiUb$;m`7?>6H2~2GGF$o@rk(tQ+KRD3^a7W=w9;TX?tKZQJc$ zR|yoPrC7B_zD=K8_u^N?&+SoMU4EcR=v7EL89LZDT83>XGJn6u-fvF4f6<9zujRR~ zLohv_7ij>kb_aJYS`7I-ymXdkjjh#<7z z?zC+s;@KLIc5)bddnVp9*zhbRN^44z+wo#aRHS)Mk?TA}du9up`kO;b0kWAbZM@9B z>qFt6gG6&+nz-8>>djsYD=~^06}~NqHG9`7gSyqnO(o7Jz0CT*yv6OWP_qclL+S>` zeI0lD_E0x_2bPkc;Suhg`&EXd7(A_#(}rGykY&@UDH07!R?oAnC;pQ^@^^em3Xpu_ z(i4pD5KAkg0wis!Ee1zxA9QUx`#Xt3B}7Ab3-XTqfh3_Kr0kw;?E3=4qbxf?axHm* zETx`|%s@(K3CT;Tg?R+i`q-=5+ka>lTw5eFun_lZMHTW_A^TRv9I4%^yemFxNlHmY(AoBz4AZ{{G%-+fnW3E%h z;ykT+QEX%ZH3P^qxn!tUVD|C=n?uh)R8kf# zlx@fg<+7lf?wS%9ug8#mw$H?kP zLqfo(eD%Ed%WoubPA!v_g<{$Lcd%-H0iz!zNR8=^Nb^Ny%;t=4j+ePK;S}Rg>qiH`W7_aly=E(=Sm#XpQuB8|5uGN83ltZwe`}g|yd!E0Cf4%%hj>W$8 z&q}ecV^7|PREGuL*d|#>IM#&8(zdjlCIoa{l)(MmXKVYOCB8`6XEggNI!GSzo^ zfgKezqUc2p;v6vFmJ=L6=|1F^nvz!`69S+YuPOZ@LE&nvxt@?WNFTuE&}lH6GV#uQ zRpAg$Z-P(}0Ta{9V@RJHqy!sXqoEqqJlI!hU+?X!b?vF9HVP}G09mEI-%|8`M>Vv1 zK_d5Hv##`1s_8vd?`fv?Or=XHTQQP>)u)xmINeerRTm37mfIE$G1mpvSlGbK3~`X z7n6UBPGTD}RZS@OYWqr$S6b+f>Y|L+%IA`V%FWp)p2r+}Ms0V%YIVJot?!OILHkk%9L}2-NAy!2w&O^`dL(xAue9r8E1}+Uo2y)~e4^U0=8m6ta z5|~!{J_fgM1V%oSpk(12Uog5@XY3Ne7y91KRIUH{+=?PPh6m%)?1AYOg?!US_0L0+|XL$bWe_`vvxQ9t`1D2uK+YJvOwsqDUFGI;x3BiYm>fp*H7# z?yc|P7MNXAY2y~)QR-;A*6DW&Nnt1-2_r=?sow4DW+8F*Ml~VrJfg53{bV+{csh9q rWkc=p8K&Bx^C#8Pb`H|@ZqK9*#Z+(z-b+J$rs{n)^u*?SkAL_VHem?G delta 38 wcmV+>0NMZbcll?q7y<&AW3w6pqyn@31VIIp6Aa$74-!u&v&T6D0h22`$}JHNR{#J2 diff --git a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/create_report_task.php b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/create_report_task.php new file mode 100644 index 000000000000..22e5fc7dfc78 --- /dev/null +++ b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/create_report_task.php @@ -0,0 +1,89 @@ +setParent($formattedParent) + ->setReportTask($reportTask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alphaAnalyticsDataClient->createReportTask($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ReportTask $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = AlphaAnalyticsDataClient::propertyName('[PROPERTY]'); + + create_report_task_sample($formattedParent); +} +// [END analyticsdata_v1alpha_generated_AlphaAnalyticsData_CreateReportTask_sync] diff --git a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/get_report_task.php b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/get_report_task.php new file mode 100644 index 000000000000..5dddf6fc9bb2 --- /dev/null +++ b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/get_report_task.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ReportTask $response */ + $response = $alphaAnalyticsDataClient->getReportTask($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 = AlphaAnalyticsDataClient::reportTaskName('[PROPERTY]', '[REPORT_TASK]'); + + get_report_task_sample($formattedName); +} +// [END analyticsdata_v1alpha_generated_AlphaAnalyticsData_GetReportTask_sync] diff --git a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/list_report_tasks.php b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/list_report_tasks.php new file mode 100644 index 000000000000..43c27b56ef25 --- /dev/null +++ b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/list_report_tasks.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $alphaAnalyticsDataClient->listReportTasks($request); + + /** @var ReportTask $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = AlphaAnalyticsDataClient::propertyName('[PROPERTY]'); + + list_report_tasks_sample($formattedParent); +} +// [END analyticsdata_v1alpha_generated_AlphaAnalyticsData_ListReportTasks_sync] diff --git a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/query_report_task.php b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/query_report_task.php new file mode 100644 index 000000000000..3282d2889f78 --- /dev/null +++ b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/query_report_task.php @@ -0,0 +1,75 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var QueryReportTaskResponse $response */ + $response = $alphaAnalyticsDataClient->queryReportTask($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 +{ + $name = '[NAME]'; + + query_report_task_sample($name); +} +// [END analyticsdata_v1alpha_generated_AlphaAnalyticsData_QueryReportTask_sync] diff --git a/AnalyticsData/src/V1alpha/Client/AlphaAnalyticsDataClient.php b/AnalyticsData/src/V1alpha/Client/AlphaAnalyticsDataClient.php index 0d6549f6af1f..6ef322b24f54 100644 --- a/AnalyticsData/src/V1alpha/Client/AlphaAnalyticsDataClient.php +++ b/AnalyticsData/src/V1alpha/Client/AlphaAnalyticsDataClient.php @@ -29,13 +29,19 @@ use Google\Analytics\Data\V1alpha\AudienceList; use Google\Analytics\Data\V1alpha\CreateAudienceListRequest; use Google\Analytics\Data\V1alpha\CreateRecurringAudienceListRequest; +use Google\Analytics\Data\V1alpha\CreateReportTaskRequest; use Google\Analytics\Data\V1alpha\GetAudienceListRequest; use Google\Analytics\Data\V1alpha\GetRecurringAudienceListRequest; +use Google\Analytics\Data\V1alpha\GetReportTaskRequest; use Google\Analytics\Data\V1alpha\ListAudienceListsRequest; use Google\Analytics\Data\V1alpha\ListRecurringAudienceListsRequest; +use Google\Analytics\Data\V1alpha\ListReportTasksRequest; use Google\Analytics\Data\V1alpha\QueryAudienceListRequest; use Google\Analytics\Data\V1alpha\QueryAudienceListResponse; +use Google\Analytics\Data\V1alpha\QueryReportTaskRequest; +use Google\Analytics\Data\V1alpha\QueryReportTaskResponse; use Google\Analytics\Data\V1alpha\RecurringAudienceList; +use Google\Analytics\Data\V1alpha\ReportTask; use Google\Analytics\Data\V1alpha\RunFunnelReportRequest; use Google\Analytics\Data\V1alpha\RunFunnelReportResponse; use Google\Analytics\Data\V1alpha\Segment; @@ -70,11 +76,15 @@ * * @method PromiseInterface createAudienceListAsync(CreateAudienceListRequest $request, array $optionalArgs = []) * @method PromiseInterface createRecurringAudienceListAsync(CreateRecurringAudienceListRequest $request, array $optionalArgs = []) + * @method PromiseInterface createReportTaskAsync(CreateReportTaskRequest $request, array $optionalArgs = []) * @method PromiseInterface getAudienceListAsync(GetAudienceListRequest $request, array $optionalArgs = []) * @method PromiseInterface getRecurringAudienceListAsync(GetRecurringAudienceListRequest $request, array $optionalArgs = []) + * @method PromiseInterface getReportTaskAsync(GetReportTaskRequest $request, array $optionalArgs = []) * @method PromiseInterface listAudienceListsAsync(ListAudienceListsRequest $request, array $optionalArgs = []) * @method PromiseInterface listRecurringAudienceListsAsync(ListRecurringAudienceListsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listReportTasksAsync(ListReportTasksRequest $request, array $optionalArgs = []) * @method PromiseInterface queryAudienceListAsync(QueryAudienceListRequest $request, array $optionalArgs = []) + * @method PromiseInterface queryReportTaskAsync(QueryReportTaskRequest $request, array $optionalArgs = []) * @method PromiseInterface runFunnelReportAsync(RunFunnelReportRequest $request, array $optionalArgs = []) * @method PromiseInterface sheetExportAudienceListAsync(SheetExportAudienceListRequest $request, array $optionalArgs = []) */ @@ -220,6 +230,25 @@ public static function recurringAudienceListName(string $property, string $recur ]); } + /** + * Formats a string containing the fully-qualified path to represent a report_task + * resource. + * + * @param string $property + * @param string $reportTask + * + * @return string The formatted report_task resource. + * + * @experimental + */ + public static function reportTaskName(string $property, string $reportTask): string + { + return self::getPathTemplate('reportTask')->render([ + 'property' => $property, + 'report_task' => $reportTask, + ]); + } + /** * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: @@ -227,6 +256,7 @@ public static function recurringAudienceListName(string $property, string $recur * - audienceList: properties/{property}/audienceLists/{audience_list} * - property: properties/{property} * - recurringAudienceList: properties/{property}/recurringAudienceLists/{recurring_audience_list} + * - reportTask: properties/{property}/reportTasks/{report_task} * * The optional $template argument can be supplied to specify a particular pattern, * and must match one of the templates listed above. If no $template argument is @@ -420,6 +450,37 @@ public function createRecurringAudienceList(CreateRecurringAudienceListRequest $ return $this->startApiCall('CreateRecurringAudienceList', $request, $callOptions)->wait(); } + /** + * Initiates the creation of a report task. This method quickly + * returns a report task and initiates a long running + * asynchronous request to form a customized report of your Google Analytics + * event data. + * + * The async variant is {@see AlphaAnalyticsDataClient::createReportTaskAsync()} . + * + * @example samples/V1alpha/AlphaAnalyticsDataClient/create_report_task.php + * + * @param CreateReportTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createReportTask(CreateReportTaskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateReportTask', $request, $callOptions)->wait(); + } + /** * Gets configuration metadata about a specific audience list. This method * can be used to understand an audience list after it has been created. @@ -498,6 +559,36 @@ public function getRecurringAudienceList(GetRecurringAudienceListRequest $reques return $this->startApiCall('GetRecurringAudienceList', $request, $callOptions)->wait(); } + /** + * Gets report metadata about a specific report task. After creating a report + * task, use this method to check its processing state or inspect its + * report definition. + * + * The async variant is {@see AlphaAnalyticsDataClient::getReportTaskAsync()} . + * + * @example samples/V1alpha/AlphaAnalyticsDataClient/get_report_task.php + * + * @param GetReportTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ReportTask + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getReportTask(GetReportTaskRequest $request, array $callOptions = []): ReportTask + { + return $this->startApiCall('GetReportTask', $request, $callOptions)->wait(); + } + /** * Lists all audience lists for a property. This method can be used for you to * find and reuse existing audience lists rather than creating unnecessary new @@ -579,6 +670,34 @@ public function listRecurringAudienceLists(ListRecurringAudienceListsRequest $re return $this->startApiCall('ListRecurringAudienceLists', $request, $callOptions); } + /** + * Lists all report tasks for a property. + * + * The async variant is {@see AlphaAnalyticsDataClient::listReportTasksAsync()} . + * + * @example samples/V1alpha/AlphaAnalyticsDataClient/list_report_tasks.php + * + * @param ListReportTasksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listReportTasks(ListReportTasksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListReportTasks', $request, $callOptions); + } + /** * Retrieves an audience list of users. After creating an audience, the users * are not immediately available for listing. First, a request to @@ -624,6 +743,38 @@ public function queryAudienceList(QueryAudienceListRequest $request, array $call return $this->startApiCall('QueryAudienceList', $request, $callOptions)->wait(); } + /** + * Retrieves a report task's content. After requesting the `CreateReportTask`, + * you are able to retrieve the report content once the report is + * ACTIVE. This method will return an error if the report task's state is not + * `ACTIVE`. A query response will return the tabular row & column values of + * the report. + * + * The async variant is {@see AlphaAnalyticsDataClient::queryReportTaskAsync()} . + * + * @example samples/V1alpha/AlphaAnalyticsDataClient/query_report_task.php + * + * @param QueryReportTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return QueryReportTaskResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function queryReportTask(QueryReportTaskRequest $request, array $callOptions = []): QueryReportTaskResponse + { + return $this->startApiCall('QueryReportTask', $request, $callOptions)->wait(); + } + /** * Returns a customized funnel report of your Google Analytics event data. The * data returned from the API is as a table with columns for the requested diff --git a/AnalyticsData/src/V1alpha/Cohort.php b/AnalyticsData/src/V1alpha/Cohort.php index 1faef89f0618..8594825d2ac4 100644 --- a/AnalyticsData/src/V1alpha/Cohort.php +++ b/AnalyticsData/src/V1alpha/Cohort.php @@ -10,7 +10,7 @@ /** * Defines a cohort selection criteria. A cohort is a group of users who share - * a common characteristic. For example, users with the same `firstTouchDate` + * a common characteristic. For example, users with the same `firstSessionDate` * belong to the same cohort. * * Generated from protobuf message google.analytics.data.v1alpha.Cohort @@ -27,7 +27,8 @@ class Cohort extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Dimension used by the cohort. Required and only supports `firstTouchDate`. + * Dimension used by the cohort. Required and only supports + * `firstSessionDate`. * * Generated from protobuf field string dimension = 2; */ @@ -64,7 +65,8 @@ class Cohort extends \Google\Protobuf\Internal\Message * `RESERVED_`. If not set, cohorts are named by their zero based index * `cohort_0`, `cohort_1`, etc. * @type string $dimension - * Dimension used by the cohort. Required and only supports `firstTouchDate`. + * Dimension used by the cohort. Required and only supports + * `firstSessionDate`. * @type \Google\Analytics\Data\V1alpha\DateRange $date_range * The cohort selects users whose first touch date is between start date and * end date defined in the `dateRange`. This `dateRange` does not specify the @@ -120,7 +122,8 @@ public function setName($var) } /** - * Dimension used by the cohort. Required and only supports `firstTouchDate`. + * Dimension used by the cohort. Required and only supports + * `firstSessionDate`. * * Generated from protobuf field string dimension = 2; * @return string @@ -131,7 +134,8 @@ public function getDimension() } /** - * Dimension used by the cohort. Required and only supports `firstTouchDate`. + * Dimension used by the cohort. Required and only supports + * `firstSessionDate`. * * Generated from protobuf field string dimension = 2; * @param string $var @@ -166,7 +170,7 @@ public function setDimension($var) */ public function getDateRange() { - return isset($this->date_range) ? $this->date_range : null; + return $this->date_range; } public function hasDateRange() diff --git a/AnalyticsData/src/V1alpha/CohortSpec.php b/AnalyticsData/src/V1alpha/CohortSpec.php index 70e225a5700e..822fec521a63 100644 --- a/AnalyticsData/src/V1alpha/CohortSpec.php +++ b/AnalyticsData/src/V1alpha/CohortSpec.php @@ -9,13 +9,15 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Specification of cohorts for a cohort report. - * Cohort reports can be used for example to create a time series of user - * retention for the cohort. For example, you could select the cohort of users - * that were acquired in the first week of September and follow that cohort for - * the next six weeks. Selecting the users acquired in the first week of - * September cohort is specified in the `cohort` object. Following that - * cohort for the next six weeks is specified in the `cohortsRange` object. + * The specification of cohorts for a cohort report. + * Cohort reports create a time series of user retention for the cohort. For + * example, you could select the cohort of users that were acquired in the first + * week of September and follow that cohort for the next six weeks. Selecting + * the users acquired in the first week of September cohort is specified in the + * `cohort` object. Following that cohort for the next six weeks is specified in + * the `cohortsRange` object. + * For examples, see [Cohort Report + * Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). * The report response could show a weekly time series where say your app has * retained 60% of this cohort after three weeks and 25% of this cohort after * six weeks. These two percentages can be calculated by the metric @@ -53,7 +55,7 @@ class CohortSpec extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type \Google\Analytics\Data\V1alpha\Cohort[]|\Google\Protobuf\Internal\RepeatedField $cohorts + * @type array<\Google\Analytics\Data\V1alpha\Cohort>|\Google\Protobuf\Internal\RepeatedField $cohorts * Defines the selection criteria to group users into cohorts. * Most cohort reports define only a single cohort. If multiple cohorts are * specified, each cohort can be recognized in the report by their name. @@ -88,7 +90,7 @@ public function getCohorts() * specified, each cohort can be recognized in the report by their name. * * Generated from protobuf field repeated .google.analytics.data.v1alpha.Cohort cohorts = 1; - * @param \Google\Analytics\Data\V1alpha\Cohort[]|\Google\Protobuf\Internal\RepeatedField $var + * @param array<\Google\Analytics\Data\V1alpha\Cohort>|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setCohorts($var) @@ -108,7 +110,7 @@ public function setCohorts($var) */ public function getCohortsRange() { - return isset($this->cohorts_range) ? $this->cohorts_range : null; + return $this->cohorts_range; } public function hasCohortsRange() @@ -145,7 +147,7 @@ public function setCohortsRange($var) */ public function getCohortReportSettings() { - return isset($this->cohort_report_settings) ? $this->cohort_report_settings : null; + return $this->cohort_report_settings; } public function hasCohortReportSettings() diff --git a/AnalyticsData/src/V1alpha/CohortsRange.php b/AnalyticsData/src/V1alpha/CohortsRange.php index 660b47d38ff5..796eaf0a3117 100644 --- a/AnalyticsData/src/V1alpha/CohortsRange.php +++ b/AnalyticsData/src/V1alpha/CohortsRange.php @@ -17,8 +17,8 @@ class CohortsRange extends \Google\Protobuf\Internal\Message { /** - * The granularity used to interpret the `startOffset` and `endOffset` for the - * extended reporting date range for a cohort report. + * Required. The granularity used to interpret the `startOffset` and + * `endOffset` for the extended reporting date range for a cohort report. * * Generated from protobuf field .google.analytics.data.v1alpha.CohortsRange.Granularity granularity = 1; */ @@ -38,8 +38,8 @@ class CohortsRange extends \Google\Protobuf\Internal\Message */ private $start_offset = 0; /** - * `endOffset` specifies the end date of the extended reporting date range - * for a cohort report. `endOffset` can be any positive integer but is + * Required. `endOffset` specifies the end date of the extended reporting date + * range for a cohort report. `endOffset` can be any positive integer but is * commonly set to 5 to 10 so that reports contain data on the cohort for the * next several granularity time periods. * If `granularity` is `DAILY`, the `endDate` of the extended reporting date @@ -60,8 +60,8 @@ class CohortsRange extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $granularity - * The granularity used to interpret the `startOffset` and `endOffset` for the - * extended reporting date range for a cohort report. + * Required. The granularity used to interpret the `startOffset` and + * `endOffset` for the extended reporting date range for a cohort report. * @type int $start_offset * `startOffset` specifies the start date of the extended reporting date range * for a cohort report. `startOffset` is commonly set to 0 so that reports @@ -73,8 +73,8 @@ class CohortsRange extends \Google\Protobuf\Internal\Message * If `granularity` is `MONTHLY`, the `startDate` of the extended reporting * date range is `startDate` of the cohort plus `startOffset * 30` days. * @type int $end_offset - * `endOffset` specifies the end date of the extended reporting date range - * for a cohort report. `endOffset` can be any positive integer but is + * Required. `endOffset` specifies the end date of the extended reporting date + * range for a cohort report. `endOffset` can be any positive integer but is * commonly set to 5 to 10 so that reports contain data on the cohort for the * next several granularity time periods. * If `granularity` is `DAILY`, the `endDate` of the extended reporting date @@ -91,8 +91,8 @@ public function __construct($data = NULL) { } /** - * The granularity used to interpret the `startOffset` and `endOffset` for the - * extended reporting date range for a cohort report. + * Required. The granularity used to interpret the `startOffset` and + * `endOffset` for the extended reporting date range for a cohort report. * * Generated from protobuf field .google.analytics.data.v1alpha.CohortsRange.Granularity granularity = 1; * @return int @@ -103,8 +103,8 @@ public function getGranularity() } /** - * The granularity used to interpret the `startOffset` and `endOffset` for the - * extended reporting date range for a cohort report. + * Required. The granularity used to interpret the `startOffset` and + * `endOffset` for the extended reporting date range for a cohort report. * * Generated from protobuf field .google.analytics.data.v1alpha.CohortsRange.Granularity granularity = 1; * @param int $var @@ -161,8 +161,8 @@ public function setStartOffset($var) } /** - * `endOffset` specifies the end date of the extended reporting date range - * for a cohort report. `endOffset` can be any positive integer but is + * Required. `endOffset` specifies the end date of the extended reporting date + * range for a cohort report. `endOffset` can be any positive integer but is * commonly set to 5 to 10 so that reports contain data on the cohort for the * next several granularity time periods. * If `granularity` is `DAILY`, the `endDate` of the extended reporting date @@ -181,8 +181,8 @@ public function getEndOffset() } /** - * `endOffset` specifies the end date of the extended reporting date range - * for a cohort report. `endOffset` can be any positive integer but is + * Required. `endOffset` specifies the end date of the extended reporting date + * range for a cohort report. `endOffset` can be any positive integer but is * commonly set to 5 to 10 so that reports contain data on the cohort for the * next several granularity time periods. * If `granularity` is `DAILY`, the `endDate` of the extended reporting date diff --git a/AnalyticsData/src/V1alpha/CreateReportTaskRequest.php b/AnalyticsData/src/V1alpha/CreateReportTaskRequest.php new file mode 100644 index 000000000000..86b48a18bd5e --- /dev/null +++ b/AnalyticsData/src/V1alpha/CreateReportTaskRequest.php @@ -0,0 +1,132 @@ +google.analytics.data.v1alpha.CreateReportTaskRequest + */ +class CreateReportTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource where this report task will be created. + * Format: `properties/{propertyId}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. The report task configuration to create. + * + * Generated from protobuf field .google.analytics.data.v1alpha.ReportTask report_task = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $report_task = null; + + /** + * @param string $parent Required. The parent resource where this report task will be created. + * Format: `properties/{propertyId}` + * Please see {@see AlphaAnalyticsDataClient::propertyName()} for help formatting this field. + * @param \Google\Analytics\Data\V1alpha\ReportTask $reportTask Required. The report task configuration to create. + * + * @return \Google\Analytics\Data\V1alpha\CreateReportTaskRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Analytics\Data\V1alpha\ReportTask $reportTask): self + { + return (new self()) + ->setParent($parent) + ->setReportTask($reportTask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource where this report task will be created. + * Format: `properties/{propertyId}` + * @type \Google\Analytics\Data\V1alpha\ReportTask $report_task + * Required. The report task configuration to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource where this report task will be created. + * Format: `properties/{propertyId}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource where this report task will be created. + * Format: `properties/{propertyId}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The report task configuration to create. + * + * Generated from protobuf field .google.analytics.data.v1alpha.ReportTask report_task = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Analytics\Data\V1alpha\ReportTask|null + */ + public function getReportTask() + { + return $this->report_task; + } + + public function hasReportTask() + { + return isset($this->report_task); + } + + public function clearReportTask() + { + unset($this->report_task); + } + + /** + * Required. The report task configuration to create. + * + * Generated from protobuf field .google.analytics.data.v1alpha.ReportTask report_task = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Analytics\Data\V1alpha\ReportTask $var + * @return $this + */ + public function setReportTask($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\ReportTask::class); + $this->report_task = $var; + + return $this; + } + +} + diff --git a/AnalyticsData/src/V1alpha/Gapic/AlphaAnalyticsDataGapicClient.php b/AnalyticsData/src/V1alpha/Gapic/AlphaAnalyticsDataGapicClient.php index 0ea1632b5629..749a0cf0226a 100644 --- a/AnalyticsData/src/V1alpha/Gapic/AlphaAnalyticsDataGapicClient.php +++ b/AnalyticsData/src/V1alpha/Gapic/AlphaAnalyticsDataGapicClient.php @@ -29,6 +29,7 @@ use Google\Analytics\Data\V1alpha\AudienceList; use Google\Analytics\Data\V1alpha\CreateAudienceListRequest; use Google\Analytics\Data\V1alpha\CreateRecurringAudienceListRequest; +use Google\Analytics\Data\V1alpha\CreateReportTaskRequest; use Google\Analytics\Data\V1alpha\DateRange; use Google\Analytics\Data\V1alpha\FilterExpression; use Google\Analytics\Data\V1alpha\Funnel; @@ -36,13 +37,19 @@ use Google\Analytics\Data\V1alpha\FunnelNextAction; use Google\Analytics\Data\V1alpha\GetAudienceListRequest; use Google\Analytics\Data\V1alpha\GetRecurringAudienceListRequest; +use Google\Analytics\Data\V1alpha\GetReportTaskRequest; use Google\Analytics\Data\V1alpha\ListAudienceListsRequest; use Google\Analytics\Data\V1alpha\ListAudienceListsResponse; use Google\Analytics\Data\V1alpha\ListRecurringAudienceListsRequest; use Google\Analytics\Data\V1alpha\ListRecurringAudienceListsResponse; +use Google\Analytics\Data\V1alpha\ListReportTasksRequest; +use Google\Analytics\Data\V1alpha\ListReportTasksResponse; use Google\Analytics\Data\V1alpha\QueryAudienceListRequest; use Google\Analytics\Data\V1alpha\QueryAudienceListResponse; +use Google\Analytics\Data\V1alpha\QueryReportTaskRequest; +use Google\Analytics\Data\V1alpha\QueryReportTaskResponse; use Google\Analytics\Data\V1alpha\RecurringAudienceList; +use Google\Analytics\Data\V1alpha\ReportTask; use Google\Analytics\Data\V1alpha\RunFunnelReportRequest; use Google\Analytics\Data\V1alpha\RunFunnelReportResponse; use Google\Analytics\Data\V1alpha\Segment; @@ -150,6 +157,8 @@ class AlphaAnalyticsDataGapicClient private static $recurringAudienceListNameTemplate; + private static $reportTaskNameTemplate; + private static $pathTemplateMap; private $operationsClient; @@ -214,6 +223,17 @@ private static function getRecurringAudienceListNameTemplate() return self::$recurringAudienceListNameTemplate; } + private static function getReportTaskNameTemplate() + { + if (self::$reportTaskNameTemplate == null) { + self::$reportTaskNameTemplate = new PathTemplate( + 'properties/{property}/reportTasks/{report_task}' + ); + } + + return self::$reportTaskNameTemplate; + } + private static function getPathTemplateMap() { if (self::$pathTemplateMap == null) { @@ -221,6 +241,7 @@ private static function getPathTemplateMap() 'audienceList' => self::getAudienceListNameTemplate(), 'property' => self::getPropertyNameTemplate(), 'recurringAudienceList' => self::getRecurringAudienceListNameTemplate(), + 'reportTask' => self::getReportTaskNameTemplate(), ]; } @@ -284,6 +305,25 @@ public static function recurringAudienceListName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a report_task + * resource. + * + * @param string $property + * @param string $reportTask + * + * @return string The formatted report_task resource. + * + * @experimental + */ + public static function reportTaskName($property, $reportTask) + { + return self::getReportTaskNameTemplate()->render([ + 'property' => $property, + 'report_task' => $reportTask, + ]); + } + /** * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: @@ -291,6 +331,7 @@ public static function recurringAudienceListName( * - audienceList: properties/{property}/audienceLists/{audience_list} * - property: properties/{property} * - recurringAudienceList: properties/{property}/recurringAudienceLists/{recurring_audience_list} + * - reportTask: properties/{property}/reportTasks/{report_task} * * The optional $template argument can be supplied to specify a particular pattern, * and must match one of the templates listed above. If no $template argument is @@ -614,6 +655,91 @@ public function createRecurringAudienceList( )->wait(); } + /** + * Initiates the creation of a report task. This method quickly + * returns a report task and initiates a long running + * asynchronous request to form a customized report of your Google Analytics + * event data. + * + * Sample code: + * ``` + * $alphaAnalyticsDataClient = new AlphaAnalyticsDataClient(); + * try { + * $formattedParent = $alphaAnalyticsDataClient->propertyName('[PROPERTY]'); + * $reportTask = new ReportTask(); + * $operationResponse = $alphaAnalyticsDataClient->createReportTask($formattedParent, $reportTask); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alphaAnalyticsDataClient->createReportTask($formattedParent, $reportTask); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alphaAnalyticsDataClient->resumeOperation($operationName, 'createReportTask'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alphaAnalyticsDataClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource where this report task will be created. + * Format: `properties/{propertyId}` + * @param ReportTask $reportTask Required. The report task configuration to create. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createReportTask( + $parent, + $reportTask, + array $optionalArgs = [] + ) { + $request = new CreateReportTaskRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setReportTask($reportTask); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'CreateReportTask', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + /** * Gets configuration metadata about a specific audience list. This method * can be used to understand an audience list after it has been created. @@ -738,6 +864,59 @@ public function getRecurringAudienceList($name, array $optionalArgs = []) )->wait(); } + /** + * Gets report metadata about a specific report task. After creating a report + * task, use this method to check its processing state or inspect its + * report definition. + * + * Sample code: + * ``` + * $alphaAnalyticsDataClient = new AlphaAnalyticsDataClient(); + * try { + * $formattedName = $alphaAnalyticsDataClient->reportTaskName('[PROPERTY]', '[REPORT_TASK]'); + * $response = $alphaAnalyticsDataClient->getReportTask($formattedName); + * } finally { + * $alphaAnalyticsDataClient->close(); + * } + * ``` + * + * @param string $name Required. The report task resource name. + * Format: `properties/{property}/reportTasks/{report_task}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Analytics\Data\V1alpha\ReportTask + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getReportTask($name, array $optionalArgs = []) + { + $request = new GetReportTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetReportTask', + ReportTask::class, + $optionalArgs, + $request + )->wait(); + } + /** * Lists all audience lists for a property. This method can be used for you to * find and reuse existing audience lists rather than creating unnecessary new @@ -924,6 +1103,86 @@ public function listRecurringAudienceLists( ); } + /** + * Lists all report tasks for a property. + * + * Sample code: + * ``` + * $alphaAnalyticsDataClient = new AlphaAnalyticsDataClient(); + * try { + * $formattedParent = $alphaAnalyticsDataClient->propertyName('[PROPERTY]'); + * // Iterate over pages of elements + * $pagedResponse = $alphaAnalyticsDataClient->listReportTasks($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alphaAnalyticsDataClient->listReportTasks($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alphaAnalyticsDataClient->close(); + * } + * ``` + * + * @param string $parent Required. All report tasks for this property will be listed in the + * response. Format: `properties/{property}` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listReportTasks($parent, array $optionalArgs = []) + { + $request = new ListReportTasksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListReportTasks', + $optionalArgs, + ListReportTasksResponse::class, + $request + ); + } + /** * Retrieves an audience list of users. After creating an audience, the users * are not immediately available for listing. First, a request to @@ -1021,6 +1280,95 @@ public function queryAudienceList($name, array $optionalArgs = []) )->wait(); } + /** + * Retrieves a report task's content. After requesting the `CreateReportTask`, + * you are able to retrieve the report content once the report is + * ACTIVE. This method will return an error if the report task's state is not + * `ACTIVE`. A query response will return the tabular row & column values of + * the report. + * + * Sample code: + * ``` + * $alphaAnalyticsDataClient = new AlphaAnalyticsDataClient(); + * try { + * $name = 'name'; + * $response = $alphaAnalyticsDataClient->queryReportTask($name); + * } finally { + * $alphaAnalyticsDataClient->close(); + * } + * ``` + * + * @param string $name Required. The report source name. + * Format: `properties/{property}/reportTasks/{report}` + * @param array $optionalArgs { + * Optional. + * + * @type int $offset + * Optional. The row count of the start row in the report. The first row is + * counted as row 0. + * + * When paging, the first request does not specify offset; or equivalently, + * sets offset to 0; the first request returns the first `limit` of rows. The + * second request sets offset to the `limit` of the first request; the second + * request returns the second `limit` of rows. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @type int $limit + * Optional. The number of rows to return from the report. If unspecified, + * 10,000 rows are returned. The API returns a maximum of 250,000 rows per + * request, no matter how many you ask for. `limit` must be positive. + * + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. The number of rows + * available to a QueryReportTaskRequest is further limited by the limit of + * the associated ReportTask. A query can retrieve at most ReportTask.limit + * rows. For example, if the ReportTask has a limit of 1,000, then a + * QueryReportTask request with offset=900 and limit=500 will return at most + * 100 rows. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Analytics\Data\V1alpha\QueryReportTaskResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function queryReportTask($name, array $optionalArgs = []) + { + $request = new QueryReportTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['offset'])) { + $request->setOffset($optionalArgs['offset']); + } + + if (isset($optionalArgs['limit'])) { + $request->setLimit($optionalArgs['limit']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'QueryReportTask', + QueryReportTaskResponse::class, + $optionalArgs, + $request + )->wait(); + } + /** * Returns a customized funnel report of your Google Analytics event data. The * data returned from the API is as a table with columns for the requested diff --git a/AnalyticsData/src/V1alpha/GetReportTaskRequest.php b/AnalyticsData/src/V1alpha/GetReportTaskRequest.php new file mode 100644 index 000000000000..e50713f7969d --- /dev/null +++ b/AnalyticsData/src/V1alpha/GetReportTaskRequest.php @@ -0,0 +1,86 @@ +google.analytics.data.v1alpha.GetReportTaskRequest + */ +class GetReportTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The report task resource name. + * Format: `properties/{property}/reportTasks/{report_task}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. The report task resource name. + * Format: `properties/{property}/reportTasks/{report_task}` + * Please see {@see AlphaAnalyticsDataClient::reportTaskName()} for help formatting this field. + * + * @return \Google\Analytics\Data\V1alpha\GetReportTaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The report task resource name. + * Format: `properties/{property}/reportTasks/{report_task}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Required. The report task resource name. + * Format: `properties/{property}/reportTasks/{report_task}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The report task resource name. + * Format: `properties/{property}/reportTasks/{report_task}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AnalyticsData/src/V1alpha/ListReportTasksRequest.php b/AnalyticsData/src/V1alpha/ListReportTasksRequest.php new file mode 100644 index 000000000000..5d2935453bf6 --- /dev/null +++ b/AnalyticsData/src/V1alpha/ListReportTasksRequest.php @@ -0,0 +1,158 @@ +google.analytics.data.v1alpha.ListReportTasksRequest + */ +class ListReportTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. All report tasks for this property will be listed in the + * response. Format: `properties/{property}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Optional. The maximum number of report tasks to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_size = 0; + /** + * Optional. A page token, received from a previous `ListReportTasks` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_token = ''; + + /** + * @param string $parent Required. All report tasks for this property will be listed in the + * response. Format: `properties/{property}` + * Please see {@see AlphaAnalyticsDataClient::propertyName()} for help formatting this field. + * + * @return \Google\Analytics\Data\V1alpha\ListReportTasksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. All report tasks for this property will be listed in the + * response. Format: `properties/{property}` + * @type int $page_size + * Optional. The maximum number of report tasks to return. + * @type string $page_token + * Optional. A page token, received from a previous `ListReportTasks` call. + * Provide this to retrieve the subsequent page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Required. All report tasks for this property will be listed in the + * response. Format: `properties/{property}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. All report tasks for this property will be listed in the + * response. Format: `properties/{property}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of report tasks to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of report tasks to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListReportTasks` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListReportTasks` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/AnalyticsData/src/V1alpha/ListReportTasksResponse.php b/AnalyticsData/src/V1alpha/ListReportTasksResponse.php new file mode 100644 index 000000000000..a8917c897668 --- /dev/null +++ b/AnalyticsData/src/V1alpha/ListReportTasksResponse.php @@ -0,0 +1,115 @@ +google.analytics.data.v1alpha.ListReportTasksResponse + */ +class ListReportTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Each report task for a property. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.ReportTask report_tasks = 1; + */ + private $report_tasks; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field optional string next_page_token = 2; + */ + private $next_page_token = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Analytics\Data\V1alpha\ReportTask>|\Google\Protobuf\Internal\RepeatedField $report_tasks + * Each report task for a property. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Each report task for a property. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.ReportTask report_tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReportTasks() + { + return $this->report_tasks; + } + + /** + * Each report task for a property. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.ReportTask report_tasks = 1; + * @param array<\Google\Analytics\Data\V1alpha\ReportTask>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReportTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\ReportTask::class); + $this->report_tasks = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field optional string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return isset($this->next_page_token) ? $this->next_page_token : ''; + } + + public function hasNextPageToken() + { + return isset($this->next_page_token); + } + + public function clearNextPageToken() + { + unset($this->next_page_token); + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field optional string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/AnalyticsData/src/V1alpha/Metric.php b/AnalyticsData/src/V1alpha/Metric.php index 847c5c68e977..1ec6f928792f 100644 --- a/AnalyticsData/src/V1alpha/Metric.php +++ b/AnalyticsData/src/V1alpha/Metric.php @@ -20,10 +20,21 @@ class Metric extends \Google\Protobuf\Internal\Message /** * The name of the metric. See the [API * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) - * for the list of metric names. - * If `expression` is specified, `name` can be any string that you would like. - * For example if `expression` is `screenPageViews/sessions`, you could call - * that metric's name = `viewsPerSession`. + * for the list of metric names supported by core reporting methods such + * as `runReport` and `batchRunReports`. See + * [Realtime + * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#metrics) + * for the list of metric names supported by the `runRealtimeReport` + * method. See + * [Funnel + * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#metrics) + * for the list of metric names supported by the `runFunnelReport` + * method. + * If `expression` is specified, `name` can be any string that you would like + * within the allowed character set. For example if `expression` is + * `screenPageViews/sessions`, you could call that metric's name = + * `viewsPerSession`. Metric names that you choose must match the regular + * expression `^[a-zA-Z0-9_]$`. * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric * `expression`. * @@ -55,10 +66,21 @@ class Metric extends \Google\Protobuf\Internal\Message * @type string $name * The name of the metric. See the [API * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) - * for the list of metric names. - * If `expression` is specified, `name` can be any string that you would like. - * For example if `expression` is `screenPageViews/sessions`, you could call - * that metric's name = `viewsPerSession`. + * for the list of metric names supported by core reporting methods such + * as `runReport` and `batchRunReports`. See + * [Realtime + * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#metrics) + * for the list of metric names supported by the `runRealtimeReport` + * method. See + * [Funnel + * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#metrics) + * for the list of metric names supported by the `runFunnelReport` + * method. + * If `expression` is specified, `name` can be any string that you would like + * within the allowed character set. For example if `expression` is + * `screenPageViews/sessions`, you could call that metric's name = + * `viewsPerSession`. Metric names that you choose must match the regular + * expression `^[a-zA-Z0-9_]$`. * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric * `expression`. * @type string $expression @@ -78,10 +100,21 @@ public function __construct($data = NULL) { /** * The name of the metric. See the [API * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) - * for the list of metric names. - * If `expression` is specified, `name` can be any string that you would like. - * For example if `expression` is `screenPageViews/sessions`, you could call - * that metric's name = `viewsPerSession`. + * for the list of metric names supported by core reporting methods such + * as `runReport` and `batchRunReports`. See + * [Realtime + * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#metrics) + * for the list of metric names supported by the `runRealtimeReport` + * method. See + * [Funnel + * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#metrics) + * for the list of metric names supported by the `runFunnelReport` + * method. + * If `expression` is specified, `name` can be any string that you would like + * within the allowed character set. For example if `expression` is + * `screenPageViews/sessions`, you could call that metric's name = + * `viewsPerSession`. Metric names that you choose must match the regular + * expression `^[a-zA-Z0-9_]$`. * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric * `expression`. * @@ -96,10 +129,21 @@ public function getName() /** * The name of the metric. See the [API * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) - * for the list of metric names. - * If `expression` is specified, `name` can be any string that you would like. - * For example if `expression` is `screenPageViews/sessions`, you could call - * that metric's name = `viewsPerSession`. + * for the list of metric names supported by core reporting methods such + * as `runReport` and `batchRunReports`. See + * [Realtime + * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#metrics) + * for the list of metric names supported by the `runRealtimeReport` + * method. See + * [Funnel + * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#metrics) + * for the list of metric names supported by the `runFunnelReport` + * method. + * If `expression` is specified, `name` can be any string that you would like + * within the allowed character set. For example if `expression` is + * `screenPageViews/sessions`, you could call that metric's name = + * `viewsPerSession`. Metric names that you choose must match the regular + * expression `^[a-zA-Z0-9_]$`. * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric * `expression`. * diff --git a/AnalyticsData/src/V1alpha/OrderBy.php b/AnalyticsData/src/V1alpha/OrderBy.php index 67341afaca36..b94bbe77863b 100644 --- a/AnalyticsData/src/V1alpha/OrderBy.php +++ b/AnalyticsData/src/V1alpha/OrderBy.php @@ -9,7 +9,9 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The sort options. + * Order bys define how rows will be sorted in the response. For example, + * ordering rows by descending event count is one ordering, and ordering rows by + * the event name string is a different ordering. * * Generated from protobuf message google.analytics.data.v1alpha.OrderBy */ @@ -33,8 +35,6 @@ class OrderBy extends \Google\Protobuf\Internal\Message * Sorts results by a metric's values. * @type \Google\Analytics\Data\V1alpha\OrderBy\DimensionOrderBy $dimension * Sorts results by a dimension's values. - * @type \Google\Analytics\Data\V1alpha\OrderBy\PivotOrderBy $pivot - * Sorts results by a metric's values within a pivot column group. * @type bool $desc * If true, sorts by descending order. * } @@ -106,37 +106,6 @@ public function setDimension($var) return $this; } - /** - * Sorts results by a metric's values within a pivot column group. - * - * Generated from protobuf field .google.analytics.data.v1alpha.OrderBy.PivotOrderBy pivot = 3; - * @return \Google\Analytics\Data\V1alpha\OrderBy\PivotOrderBy|null - */ - public function getPivot() - { - return $this->readOneof(3); - } - - public function hasPivot() - { - return $this->hasOneof(3); - } - - /** - * Sorts results by a metric's values within a pivot column group. - * - * Generated from protobuf field .google.analytics.data.v1alpha.OrderBy.PivotOrderBy pivot = 3; - * @param \Google\Analytics\Data\V1alpha\OrderBy\PivotOrderBy $var - * @return $this - */ - public function setPivot($var) - { - GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\OrderBy\PivotOrderBy::class); - $this->writeOneof(3, $var); - - return $this; - } - /** * If true, sorts by descending order. * diff --git a/AnalyticsData/src/V1alpha/QueryReportTaskRequest.php b/AnalyticsData/src/V1alpha/QueryReportTaskRequest.php new file mode 100644 index 000000000000..4f58b1384f41 --- /dev/null +++ b/AnalyticsData/src/V1alpha/QueryReportTaskRequest.php @@ -0,0 +1,225 @@ +google.analytics.data.v1alpha.QueryReportTaskRequest + */ +class QueryReportTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The report source name. + * Format: `properties/{property}/reportTasks/{report}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $name = ''; + /** + * Optional. The row count of the start row in the report. The first row is + * counted as row 0. + * When paging, the first request does not specify offset; or equivalently, + * sets offset to 0; the first request returns the first `limit` of rows. The + * second request sets offset to the `limit` of the first request; the second + * request returns the second `limit` of rows. + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * + * Generated from protobuf field int64 offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $offset = 0; + /** + * Optional. The number of rows to return from the report. If unspecified, + * 10,000 rows are returned. The API returns a maximum of 250,000 rows per + * request, no matter how many you ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. The number of rows + * available to a QueryReportTaskRequest is further limited by the limit of + * the associated ReportTask. A query can retrieve at most ReportTask.limit + * rows. For example, if the ReportTask has a limit of 1,000, then a + * QueryReportTask request with offset=900 and limit=500 will return at most + * 100 rows. + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * + * Generated from protobuf field int64 limit = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $limit = 0; + + /** + * @param string $name Required. The report source name. + * Format: `properties/{property}/reportTasks/{report}` + * + * @return \Google\Analytics\Data\V1alpha\QueryReportTaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The report source name. + * Format: `properties/{property}/reportTasks/{report}` + * @type int|string $offset + * Optional. The row count of the start row in the report. The first row is + * counted as row 0. + * When paging, the first request does not specify offset; or equivalently, + * sets offset to 0; the first request returns the first `limit` of rows. The + * second request sets offset to the `limit` of the first request; the second + * request returns the second `limit` of rows. + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @type int|string $limit + * Optional. The number of rows to return from the report. If unspecified, + * 10,000 rows are returned. The API returns a maximum of 250,000 rows per + * request, no matter how many you ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. The number of rows + * available to a QueryReportTaskRequest is further limited by the limit of + * the associated ReportTask. A query can retrieve at most ReportTask.limit + * rows. For example, if the ReportTask has a limit of 1,000, then a + * QueryReportTask request with offset=900 and limit=500 will return at most + * 100 rows. + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Required. The report source name. + * Format: `properties/{property}/reportTasks/{report}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The report source name. + * Format: `properties/{property}/reportTasks/{report}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The row count of the start row in the report. The first row is + * counted as row 0. + * When paging, the first request does not specify offset; or equivalently, + * sets offset to 0; the first request returns the first `limit` of rows. The + * second request sets offset to the `limit` of the first request; the second + * request returns the second `limit` of rows. + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * + * Generated from protobuf field int64 offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getOffset() + { + return $this->offset; + } + + /** + * Optional. The row count of the start row in the report. The first row is + * counted as row 0. + * When paging, the first request does not specify offset; or equivalently, + * sets offset to 0; the first request returns the first `limit` of rows. The + * second request sets offset to the `limit` of the first request; the second + * request returns the second `limit` of rows. + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * + * Generated from protobuf field int64 offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt64($var); + $this->offset = $var; + + return $this; + } + + /** + * Optional. The number of rows to return from the report. If unspecified, + * 10,000 rows are returned. The API returns a maximum of 250,000 rows per + * request, no matter how many you ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. The number of rows + * available to a QueryReportTaskRequest is further limited by the limit of + * the associated ReportTask. A query can retrieve at most ReportTask.limit + * rows. For example, if the ReportTask has a limit of 1,000, then a + * QueryReportTask request with offset=900 and limit=500 will return at most + * 100 rows. + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * + * Generated from protobuf field int64 limit = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getLimit() + { + return $this->limit; + } + + /** + * Optional. The number of rows to return from the report. If unspecified, + * 10,000 rows are returned. The API returns a maximum of 250,000 rows per + * request, no matter how many you ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. The number of rows + * available to a QueryReportTaskRequest is further limited by the limit of + * the associated ReportTask. A query can retrieve at most ReportTask.limit + * rows. For example, if the ReportTask has a limit of 1,000, then a + * QueryReportTask request with offset=900 and limit=500 will return at most + * 100 rows. + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * + * Generated from protobuf field int64 limit = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkInt64($var); + $this->limit = $var; + + return $this; + } + +} + diff --git a/AnalyticsData/src/V1alpha/QueryReportTaskResponse.php b/AnalyticsData/src/V1alpha/QueryReportTaskResponse.php new file mode 100644 index 000000000000..6d04e25e9d27 --- /dev/null +++ b/AnalyticsData/src/V1alpha/QueryReportTaskResponse.php @@ -0,0 +1,323 @@ +google.analytics.data.v1alpha.QueryReportTaskResponse + */ +class QueryReportTaskResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Describes dimension columns. The number of DimensionHeaders and ordering of + * DimensionHeaders matches the dimensions present in rows. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.DimensionHeader dimension_headers = 1; + */ + private $dimension_headers; + /** + * Describes metric columns. The number of MetricHeaders and ordering of + * MetricHeaders matches the metrics present in rows. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.MetricHeader metric_headers = 2; + */ + private $metric_headers; + /** + * Rows of dimension value combinations and metric values in the report. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row rows = 3; + */ + private $rows; + /** + * If requested, the totaled values of metrics. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row totals = 4; + */ + private $totals; + /** + * If requested, the maximum values of metrics. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row maximums = 5; + */ + private $maximums; + /** + * If requested, the minimum values of metrics. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row minimums = 6; + */ + private $minimums; + /** + * The total number of rows in the query result. + * + * Generated from protobuf field int32 row_count = 7; + */ + private $row_count = 0; + /** + * Metadata for the report. + * + * Generated from protobuf field .google.analytics.data.v1alpha.ResponseMetaData metadata = 8; + */ + private $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Analytics\Data\V1alpha\DimensionHeader>|\Google\Protobuf\Internal\RepeatedField $dimension_headers + * Describes dimension columns. The number of DimensionHeaders and ordering of + * DimensionHeaders matches the dimensions present in rows. + * @type array<\Google\Analytics\Data\V1alpha\MetricHeader>|\Google\Protobuf\Internal\RepeatedField $metric_headers + * Describes metric columns. The number of MetricHeaders and ordering of + * MetricHeaders matches the metrics present in rows. + * @type array<\Google\Analytics\Data\V1alpha\Row>|\Google\Protobuf\Internal\RepeatedField $rows + * Rows of dimension value combinations and metric values in the report. + * @type array<\Google\Analytics\Data\V1alpha\Row>|\Google\Protobuf\Internal\RepeatedField $totals + * If requested, the totaled values of metrics. + * @type array<\Google\Analytics\Data\V1alpha\Row>|\Google\Protobuf\Internal\RepeatedField $maximums + * If requested, the maximum values of metrics. + * @type array<\Google\Analytics\Data\V1alpha\Row>|\Google\Protobuf\Internal\RepeatedField $minimums + * If requested, the minimum values of metrics. + * @type int $row_count + * The total number of rows in the query result. + * @type \Google\Analytics\Data\V1alpha\ResponseMetaData $metadata + * Metadata for the report. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Describes dimension columns. The number of DimensionHeaders and ordering of + * DimensionHeaders matches the dimensions present in rows. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.DimensionHeader dimension_headers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDimensionHeaders() + { + return $this->dimension_headers; + } + + /** + * Describes dimension columns. The number of DimensionHeaders and ordering of + * DimensionHeaders matches the dimensions present in rows. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.DimensionHeader dimension_headers = 1; + * @param array<\Google\Analytics\Data\V1alpha\DimensionHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDimensionHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\DimensionHeader::class); + $this->dimension_headers = $arr; + + return $this; + } + + /** + * Describes metric columns. The number of MetricHeaders and ordering of + * MetricHeaders matches the metrics present in rows. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.MetricHeader metric_headers = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetricHeaders() + { + return $this->metric_headers; + } + + /** + * Describes metric columns. The number of MetricHeaders and ordering of + * MetricHeaders matches the metrics present in rows. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.MetricHeader metric_headers = 2; + * @param array<\Google\Analytics\Data\V1alpha\MetricHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetricHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\MetricHeader::class); + $this->metric_headers = $arr; + + return $this; + } + + /** + * Rows of dimension value combinations and metric values in the report. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row rows = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRows() + { + return $this->rows; + } + + /** + * Rows of dimension value combinations and metric values in the report. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row rows = 3; + * @param array<\Google\Analytics\Data\V1alpha\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\Row::class); + $this->rows = $arr; + + return $this; + } + + /** + * If requested, the totaled values of metrics. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row totals = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTotals() + { + return $this->totals; + } + + /** + * If requested, the totaled values of metrics. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row totals = 4; + * @param array<\Google\Analytics\Data\V1alpha\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTotals($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\Row::class); + $this->totals = $arr; + + return $this; + } + + /** + * If requested, the maximum values of metrics. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row maximums = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMaximums() + { + return $this->maximums; + } + + /** + * If requested, the maximum values of metrics. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row maximums = 5; + * @param array<\Google\Analytics\Data\V1alpha\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMaximums($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\Row::class); + $this->maximums = $arr; + + return $this; + } + + /** + * If requested, the minimum values of metrics. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row minimums = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMinimums() + { + return $this->minimums; + } + + /** + * If requested, the minimum values of metrics. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Row minimums = 6; + * @param array<\Google\Analytics\Data\V1alpha\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMinimums($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\Row::class); + $this->minimums = $arr; + + return $this; + } + + /** + * The total number of rows in the query result. + * + * Generated from protobuf field int32 row_count = 7; + * @return int + */ + public function getRowCount() + { + return $this->row_count; + } + + /** + * The total number of rows in the query result. + * + * Generated from protobuf field int32 row_count = 7; + * @param int $var + * @return $this + */ + public function setRowCount($var) + { + GPBUtil::checkInt32($var); + $this->row_count = $var; + + return $this; + } + + /** + * Metadata for the report. + * + * Generated from protobuf field .google.analytics.data.v1alpha.ResponseMetaData metadata = 8; + * @return \Google\Analytics\Data\V1alpha\ResponseMetaData|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Metadata for the report. + * + * Generated from protobuf field .google.analytics.data.v1alpha.ResponseMetaData metadata = 8; + * @param \Google\Analytics\Data\V1alpha\ResponseMetaData $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\ResponseMetaData::class); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/AnalyticsData/src/V1alpha/ReportTask.php b/AnalyticsData/src/V1alpha/ReportTask.php new file mode 100644 index 000000000000..38e457422bb5 --- /dev/null +++ b/AnalyticsData/src/V1alpha/ReportTask.php @@ -0,0 +1,183 @@ +google.analytics.data.v1alpha.ReportTask + */ +class ReportTask extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The report task resource name assigned during + * creation. Format: `properties/{property}/reportTasks/{report_task}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $name = ''; + /** + * Optional. A report definition to fetch report data, which describes the + * structure of a report. It typically includes the fields that will be + * included in the report and the criteria that will be used to filter the + * data. + * + * Generated from protobuf field .google.analytics.data.v1alpha.ReportTask.ReportDefinition report_definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $report_definition = null; + /** + * Output only. The report metadata for a specific report task, which provides + * information about a report. It typically includes the following + * information: the resource name of the report, the state of the report, the + * timestamp the report was created, etc, + * + * Generated from protobuf field .google.analytics.data.v1alpha.ReportTask.ReportMetadata report_metadata = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $report_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The report task resource name assigned during + * creation. Format: `properties/{property}/reportTasks/{report_task}` + * @type \Google\Analytics\Data\V1alpha\ReportTask\ReportDefinition $report_definition + * Optional. A report definition to fetch report data, which describes the + * structure of a report. It typically includes the fields that will be + * included in the report and the criteria that will be used to filter the + * data. + * @type \Google\Analytics\Data\V1alpha\ReportTask\ReportMetadata $report_metadata + * Output only. The report metadata for a specific report task, which provides + * information about a report. It typically includes the following + * information: the resource name of the report, the state of the report, the + * timestamp the report was created, etc, + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The report task resource name assigned during + * creation. Format: `properties/{property}/reportTasks/{report_task}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The report task resource name assigned during + * creation. Format: `properties/{property}/reportTasks/{report_task}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A report definition to fetch report data, which describes the + * structure of a report. It typically includes the fields that will be + * included in the report and the criteria that will be used to filter the + * data. + * + * Generated from protobuf field .google.analytics.data.v1alpha.ReportTask.ReportDefinition report_definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Analytics\Data\V1alpha\ReportTask\ReportDefinition|null + */ + public function getReportDefinition() + { + return $this->report_definition; + } + + public function hasReportDefinition() + { + return isset($this->report_definition); + } + + public function clearReportDefinition() + { + unset($this->report_definition); + } + + /** + * Optional. A report definition to fetch report data, which describes the + * structure of a report. It typically includes the fields that will be + * included in the report and the criteria that will be used to filter the + * data. + * + * Generated from protobuf field .google.analytics.data.v1alpha.ReportTask.ReportDefinition report_definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Analytics\Data\V1alpha\ReportTask\ReportDefinition $var + * @return $this + */ + public function setReportDefinition($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\ReportTask\ReportDefinition::class); + $this->report_definition = $var; + + return $this; + } + + /** + * Output only. The report metadata for a specific report task, which provides + * information about a report. It typically includes the following + * information: the resource name of the report, the state of the report, the + * timestamp the report was created, etc, + * + * Generated from protobuf field .google.analytics.data.v1alpha.ReportTask.ReportMetadata report_metadata = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Analytics\Data\V1alpha\ReportTask\ReportMetadata|null + */ + public function getReportMetadata() + { + return $this->report_metadata; + } + + public function hasReportMetadata() + { + return isset($this->report_metadata); + } + + public function clearReportMetadata() + { + unset($this->report_metadata); + } + + /** + * Output only. The report metadata for a specific report task, which provides + * information about a report. It typically includes the following + * information: the resource name of the report, the state of the report, the + * timestamp the report was created, etc, + * + * Generated from protobuf field .google.analytics.data.v1alpha.ReportTask.ReportMetadata report_metadata = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Analytics\Data\V1alpha\ReportTask\ReportMetadata $var + * @return $this + */ + public function setReportMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\ReportTask\ReportMetadata::class); + $this->report_metadata = $var; + + return $this; + } + +} + diff --git a/AnalyticsData/src/V1alpha/ReportTask/ReportDefinition.php b/AnalyticsData/src/V1alpha/ReportTask/ReportDefinition.php new file mode 100644 index 000000000000..caf7fa7236ba --- /dev/null +++ b/AnalyticsData/src/V1alpha/ReportTask/ReportDefinition.php @@ -0,0 +1,612 @@ +google.analytics.data.v1alpha.ReportTask.ReportDefinition + */ +class ReportDefinition extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The dimensions requested and displayed. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Dimension dimensions = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $dimensions; + /** + * Optional. The metrics requested and displayed. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Metric metrics = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $metrics; + /** + * Optional. Date ranges of data to read. If multiple date ranges are + * requested, each response row will contain a zero based date range index. + * If two date ranges overlap, the event data for the overlapping days is + * included in the response rows for both date ranges. In a cohort request, + * this `dateRanges` must be unspecified. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.DateRange date_ranges = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $date_ranges; + /** + * Optional. Dimension filters let you ask for only specific dimension + * values in the report. To learn more, see [Fundamentals of Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * + * Generated from protobuf field .google.analytics.data.v1alpha.FilterExpression dimension_filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $dimension_filter = null; + /** + * Optional. The filter clause of metrics. Applied after aggregating the + * report's rows, similar to SQL having-clause. Dimensions cannot be used in + * this filter. + * + * Generated from protobuf field .google.analytics.data.v1alpha.FilterExpression metric_filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $metric_filter = null; + /** + * Optional. The row count of the start row from Google Analytics Storage. + * The first row is counted as row 0. + * When creating a report task, the `offset` and `limit` parameters define + * the subset of data rows from Google Analytics storage to be included in + * the generated report. For example, if there are a total of 300,000 rows + * in Google Analytics storage, the initial report task may have the + * first 10,000 rows with a limit of 10,000 and an offset of 0. + * Subsequently, another report task could cover the next 10,000 rows with a + * limit of 10,000 and an offset of 10,000. + * + * Generated from protobuf field int64 offset = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $offset = 0; + /** + * Optional. The number of rows to return in the Report. If unspecified, + * 10,000 rows are returned. The API returns a maximum of 250,000 rows per + * request, no matter how many you ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if + * you set `limit` to a higher value. + * + * Generated from protobuf field int64 limit = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $limit = 0; + /** + * Optional. Aggregation of metrics. Aggregated metric values will be shown + * in rows where the dimension_values are set to + * "RESERVED_(MetricAggregation)". + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.MetricAggregation metric_aggregations = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $metric_aggregations; + /** + * Optional. Specifies how rows are ordered in the response. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.OrderBy order_bys = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $order_bys; + /** + * Optional. A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + * + * Generated from protobuf field string currency_code = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $currency_code = ''; + /** + * Optional. Cohort group associated with this request. If there is a cohort + * group in the request the 'cohort' dimension must be present. + * + * Generated from protobuf field .google.analytics.data.v1alpha.CohortSpec cohort_spec = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $cohort_spec = null; + /** + * Optional. If false or unspecified, each row with all metrics equal to 0 + * will not be returned. If true, these rows will be returned if they are + * not separately removed by a filter. + * Regardless of this `keep_empty_rows` setting, only data recorded by the + * Google Analytics (GA4) property can be displayed in a report. + * For example if a property never logs a `purchase` event, then a query for + * the `eventName` dimension and `eventCount` metric will not have a row + * containing eventName: "purchase" and eventCount: 0. + * + * Generated from protobuf field bool keep_empty_rows = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $keep_empty_rows = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Analytics\Data\V1alpha\Dimension>|\Google\Protobuf\Internal\RepeatedField $dimensions + * Optional. The dimensions requested and displayed. + * @type array<\Google\Analytics\Data\V1alpha\Metric>|\Google\Protobuf\Internal\RepeatedField $metrics + * Optional. The metrics requested and displayed. + * @type array<\Google\Analytics\Data\V1alpha\DateRange>|\Google\Protobuf\Internal\RepeatedField $date_ranges + * Optional. Date ranges of data to read. If multiple date ranges are + * requested, each response row will contain a zero based date range index. + * If two date ranges overlap, the event data for the overlapping days is + * included in the response rows for both date ranges. In a cohort request, + * this `dateRanges` must be unspecified. + * @type \Google\Analytics\Data\V1alpha\FilterExpression $dimension_filter + * Optional. Dimension filters let you ask for only specific dimension + * values in the report. To learn more, see [Fundamentals of Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * @type \Google\Analytics\Data\V1alpha\FilterExpression $metric_filter + * Optional. The filter clause of metrics. Applied after aggregating the + * report's rows, similar to SQL having-clause. Dimensions cannot be used in + * this filter. + * @type int|string $offset + * Optional. The row count of the start row from Google Analytics Storage. + * The first row is counted as row 0. + * When creating a report task, the `offset` and `limit` parameters define + * the subset of data rows from Google Analytics storage to be included in + * the generated report. For example, if there are a total of 300,000 rows + * in Google Analytics storage, the initial report task may have the + * first 10,000 rows with a limit of 10,000 and an offset of 0. + * Subsequently, another report task could cover the next 10,000 rows with a + * limit of 10,000 and an offset of 10,000. + * @type int|string $limit + * Optional. The number of rows to return in the Report. If unspecified, + * 10,000 rows are returned. The API returns a maximum of 250,000 rows per + * request, no matter how many you ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if + * you set `limit` to a higher value. + * @type array|\Google\Protobuf\Internal\RepeatedField $metric_aggregations + * Optional. Aggregation of metrics. Aggregated metric values will be shown + * in rows where the dimension_values are set to + * "RESERVED_(MetricAggregation)". + * @type array<\Google\Analytics\Data\V1alpha\OrderBy>|\Google\Protobuf\Internal\RepeatedField $order_bys + * Optional. Specifies how rows are ordered in the response. + * @type string $currency_code + * Optional. A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + * @type \Google\Analytics\Data\V1alpha\CohortSpec $cohort_spec + * Optional. Cohort group associated with this request. If there is a cohort + * group in the request the 'cohort' dimension must be present. + * @type bool $keep_empty_rows + * Optional. If false or unspecified, each row with all metrics equal to 0 + * will not be returned. If true, these rows will be returned if they are + * not separately removed by a filter. + * Regardless of this `keep_empty_rows` setting, only data recorded by the + * Google Analytics (GA4) property can be displayed in a report. + * For example if a property never logs a `purchase` event, then a query for + * the `eventName` dimension and `eventCount` metric will not have a row + * containing eventName: "purchase" and eventCount: 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The dimensions requested and displayed. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Dimension dimensions = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDimensions() + { + return $this->dimensions; + } + + /** + * Optional. The dimensions requested and displayed. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Dimension dimensions = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Analytics\Data\V1alpha\Dimension>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDimensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\Dimension::class); + $this->dimensions = $arr; + + return $this; + } + + /** + * Optional. The metrics requested and displayed. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Metric metrics = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * Optional. The metrics requested and displayed. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.Metric metrics = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Analytics\Data\V1alpha\Metric>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\Metric::class); + $this->metrics = $arr; + + return $this; + } + + /** + * Optional. Date ranges of data to read. If multiple date ranges are + * requested, each response row will contain a zero based date range index. + * If two date ranges overlap, the event data for the overlapping days is + * included in the response rows for both date ranges. In a cohort request, + * this `dateRanges` must be unspecified. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.DateRange date_ranges = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDateRanges() + { + return $this->date_ranges; + } + + /** + * Optional. Date ranges of data to read. If multiple date ranges are + * requested, each response row will contain a zero based date range index. + * If two date ranges overlap, the event data for the overlapping days is + * included in the response rows for both date ranges. In a cohort request, + * this `dateRanges` must be unspecified. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.DateRange date_ranges = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Analytics\Data\V1alpha\DateRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDateRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\DateRange::class); + $this->date_ranges = $arr; + + return $this; + } + + /** + * Optional. Dimension filters let you ask for only specific dimension + * values in the report. To learn more, see [Fundamentals of Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * + * Generated from protobuf field .google.analytics.data.v1alpha.FilterExpression dimension_filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Analytics\Data\V1alpha\FilterExpression|null + */ + public function getDimensionFilter() + { + return $this->dimension_filter; + } + + public function hasDimensionFilter() + { + return isset($this->dimension_filter); + } + + public function clearDimensionFilter() + { + unset($this->dimension_filter); + } + + /** + * Optional. Dimension filters let you ask for only specific dimension + * values in the report. To learn more, see [Fundamentals of Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * + * Generated from protobuf field .google.analytics.data.v1alpha.FilterExpression dimension_filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Analytics\Data\V1alpha\FilterExpression $var + * @return $this + */ + public function setDimensionFilter($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\FilterExpression::class); + $this->dimension_filter = $var; + + return $this; + } + + /** + * Optional. The filter clause of metrics. Applied after aggregating the + * report's rows, similar to SQL having-clause. Dimensions cannot be used in + * this filter. + * + * Generated from protobuf field .google.analytics.data.v1alpha.FilterExpression metric_filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Analytics\Data\V1alpha\FilterExpression|null + */ + public function getMetricFilter() + { + return $this->metric_filter; + } + + public function hasMetricFilter() + { + return isset($this->metric_filter); + } + + public function clearMetricFilter() + { + unset($this->metric_filter); + } + + /** + * Optional. The filter clause of metrics. Applied after aggregating the + * report's rows, similar to SQL having-clause. Dimensions cannot be used in + * this filter. + * + * Generated from protobuf field .google.analytics.data.v1alpha.FilterExpression metric_filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Analytics\Data\V1alpha\FilterExpression $var + * @return $this + */ + public function setMetricFilter($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\FilterExpression::class); + $this->metric_filter = $var; + + return $this; + } + + /** + * Optional. The row count of the start row from Google Analytics Storage. + * The first row is counted as row 0. + * When creating a report task, the `offset` and `limit` parameters define + * the subset of data rows from Google Analytics storage to be included in + * the generated report. For example, if there are a total of 300,000 rows + * in Google Analytics storage, the initial report task may have the + * first 10,000 rows with a limit of 10,000 and an offset of 0. + * Subsequently, another report task could cover the next 10,000 rows with a + * limit of 10,000 and an offset of 10,000. + * + * Generated from protobuf field int64 offset = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getOffset() + { + return $this->offset; + } + + /** + * Optional. The row count of the start row from Google Analytics Storage. + * The first row is counted as row 0. + * When creating a report task, the `offset` and `limit` parameters define + * the subset of data rows from Google Analytics storage to be included in + * the generated report. For example, if there are a total of 300,000 rows + * in Google Analytics storage, the initial report task may have the + * first 10,000 rows with a limit of 10,000 and an offset of 0. + * Subsequently, another report task could cover the next 10,000 rows with a + * limit of 10,000 and an offset of 10,000. + * + * Generated from protobuf field int64 offset = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt64($var); + $this->offset = $var; + + return $this; + } + + /** + * Optional. The number of rows to return in the Report. If unspecified, + * 10,000 rows are returned. The API returns a maximum of 250,000 rows per + * request, no matter how many you ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if + * you set `limit` to a higher value. + * + * Generated from protobuf field int64 limit = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getLimit() + { + return $this->limit; + } + + /** + * Optional. The number of rows to return in the Report. If unspecified, + * 10,000 rows are returned. The API returns a maximum of 250,000 rows per + * request, no matter how many you ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if + * you set `limit` to a higher value. + * + * Generated from protobuf field int64 limit = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkInt64($var); + $this->limit = $var; + + return $this; + } + + /** + * Optional. Aggregation of metrics. Aggregated metric values will be shown + * in rows where the dimension_values are set to + * "RESERVED_(MetricAggregation)". + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.MetricAggregation metric_aggregations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetricAggregations() + { + return $this->metric_aggregations; + } + + /** + * Optional. Aggregation of metrics. Aggregated metric values will be shown + * in rows where the dimension_values are set to + * "RESERVED_(MetricAggregation)". + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.MetricAggregation metric_aggregations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetricAggregations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Analytics\Data\V1alpha\MetricAggregation::class); + $this->metric_aggregations = $arr; + + return $this; + } + + /** + * Optional. Specifies how rows are ordered in the response. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.OrderBy order_bys = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrderBys() + { + return $this->order_bys; + } + + /** + * Optional. Specifies how rows are ordered in the response. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.OrderBy order_bys = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Analytics\Data\V1alpha\OrderBy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrderBys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\OrderBy::class); + $this->order_bys = $arr; + + return $this; + } + + /** + * Optional. A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + * + * Generated from protobuf field string currency_code = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * Optional. A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + * + * Generated from protobuf field string currency_code = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * Optional. Cohort group associated with this request. If there is a cohort + * group in the request the 'cohort' dimension must be present. + * + * Generated from protobuf field .google.analytics.data.v1alpha.CohortSpec cohort_spec = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Analytics\Data\V1alpha\CohortSpec|null + */ + public function getCohortSpec() + { + return $this->cohort_spec; + } + + public function hasCohortSpec() + { + return isset($this->cohort_spec); + } + + public function clearCohortSpec() + { + unset($this->cohort_spec); + } + + /** + * Optional. Cohort group associated with this request. If there is a cohort + * group in the request the 'cohort' dimension must be present. + * + * Generated from protobuf field .google.analytics.data.v1alpha.CohortSpec cohort_spec = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Analytics\Data\V1alpha\CohortSpec $var + * @return $this + */ + public function setCohortSpec($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\CohortSpec::class); + $this->cohort_spec = $var; + + return $this; + } + + /** + * Optional. If false or unspecified, each row with all metrics equal to 0 + * will not be returned. If true, these rows will be returned if they are + * not separately removed by a filter. + * Regardless of this `keep_empty_rows` setting, only data recorded by the + * Google Analytics (GA4) property can be displayed in a report. + * For example if a property never logs a `purchase` event, then a query for + * the `eventName` dimension and `eventCount` metric will not have a row + * containing eventName: "purchase" and eventCount: 0. + * + * Generated from protobuf field bool keep_empty_rows = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getKeepEmptyRows() + { + return $this->keep_empty_rows; + } + + /** + * Optional. If false or unspecified, each row with all metrics equal to 0 + * will not be returned. If true, these rows will be returned if they are + * not separately removed by a filter. + * Regardless of this `keep_empty_rows` setting, only data recorded by the + * Google Analytics (GA4) property can be displayed in a report. + * For example if a property never logs a `purchase` event, then a query for + * the `eventName` dimension and `eventCount` metric will not have a row + * containing eventName: "purchase" and eventCount: 0. + * + * Generated from protobuf field bool keep_empty_rows = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setKeepEmptyRows($var) + { + GPBUtil::checkBool($var); + $this->keep_empty_rows = $var; + + return $this; + } + +} + + diff --git a/AnalyticsData/src/V1alpha/ReportTask/ReportMetadata.php b/AnalyticsData/src/V1alpha/ReportTask/ReportMetadata.php new file mode 100644 index 000000000000..f8dbf6056acb --- /dev/null +++ b/AnalyticsData/src/V1alpha/ReportTask/ReportMetadata.php @@ -0,0 +1,372 @@ +google.analytics.data.v1alpha.ReportTask.ReportMetadata + */ +class ReportMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current state for this report task. + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.ReportTask.ReportMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state = null; + /** + * Output only. The time when `CreateReportTask` was called and the report + * began the `CREATING` state. + * + * Generated from protobuf field optional .google.protobuf.Timestamp begin_creating_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $begin_creating_time = null; + /** + * Output only. The total quota tokens charged during creation of the + * report. Because this token count is based on activity from the `CREATING` + * state, this tokens charge will be fixed once a report task enters the + * `ACTIVE` or `FAILED` state. + * + * Generated from protobuf field int32 creation_quota_tokens_charged = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $creation_quota_tokens_charged = 0; + /** + * Output only. The total number of rows in the report result. This field + * will be populated when the state is active. You can utilize + * `task_row_count` for pagination within the confines of their existing + * report. + * + * Generated from protobuf field optional int32 task_row_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $task_row_count = null; + /** + * Output only. Error message is populated if a report task fails during + * creation. + * + * Generated from protobuf field optional string error_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $error_message = null; + /** + * Output only. The total number of rows in Google Analytics storage. If you + * want to query additional data rows beyond the current report, they can + * initiate a new report task based on the `total_row_count`. + * The `task_row_count` represents the number of rows specifically + * pertaining to the current report, whereas `total_row_count` encompasses + * the total count of rows across all data retrieved from Google + * Analytics storage. + * For example, suppose the current report's `task_row_count` is 20, + * displaying the data from the first 20 rows. Simultaneously, the + * `total_row_count` is 30, indicating the presence of data for all 30 rows. + * The `task_row_count` can be utilizated to paginate through the initial 20 + * rows. To expand the report and include data from all 30 rows, a new + * report task can be created using the total_row_count to access the full + * set of 30 rows' worth of data. + * + * Generated from protobuf field optional int32 total_row_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $total_row_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Output only. The current state for this report task. + * @type \Google\Protobuf\Timestamp $begin_creating_time + * Output only. The time when `CreateReportTask` was called and the report + * began the `CREATING` state. + * @type int $creation_quota_tokens_charged + * Output only. The total quota tokens charged during creation of the + * report. Because this token count is based on activity from the `CREATING` + * state, this tokens charge will be fixed once a report task enters the + * `ACTIVE` or `FAILED` state. + * @type int $task_row_count + * Output only. The total number of rows in the report result. This field + * will be populated when the state is active. You can utilize + * `task_row_count` for pagination within the confines of their existing + * report. + * @type string $error_message + * Output only. Error message is populated if a report task fails during + * creation. + * @type int $total_row_count + * Output only. The total number of rows in Google Analytics storage. If you + * want to query additional data rows beyond the current report, they can + * initiate a new report task based on the `total_row_count`. + * The `task_row_count` represents the number of rows specifically + * pertaining to the current report, whereas `total_row_count` encompasses + * the total count of rows across all data retrieved from Google + * Analytics storage. + * For example, suppose the current report's `task_row_count` is 20, + * displaying the data from the first 20 rows. Simultaneously, the + * `total_row_count` is 30, indicating the presence of data for all 30 rows. + * The `task_row_count` can be utilizated to paginate through the initial 20 + * rows. To expand the report and include data from all 30 rows, a new + * report task can be created using the total_row_count to access the full + * set of 30 rows' worth of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The current state for this report task. + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.ReportTask.ReportMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return isset($this->state) ? $this->state : 0; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * Output only. The current state for this report task. + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.ReportTask.ReportMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\ReportTask\ReportMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The time when `CreateReportTask` was called and the report + * began the `CREATING` state. + * + * Generated from protobuf field optional .google.protobuf.Timestamp begin_creating_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getBeginCreatingTime() + { + return $this->begin_creating_time; + } + + public function hasBeginCreatingTime() + { + return isset($this->begin_creating_time); + } + + public function clearBeginCreatingTime() + { + unset($this->begin_creating_time); + } + + /** + * Output only. The time when `CreateReportTask` was called and the report + * began the `CREATING` state. + * + * Generated from protobuf field optional .google.protobuf.Timestamp begin_creating_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setBeginCreatingTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->begin_creating_time = $var; + + return $this; + } + + /** + * Output only. The total quota tokens charged during creation of the + * report. Because this token count is based on activity from the `CREATING` + * state, this tokens charge will be fixed once a report task enters the + * `ACTIVE` or `FAILED` state. + * + * Generated from protobuf field int32 creation_quota_tokens_charged = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCreationQuotaTokensCharged() + { + return $this->creation_quota_tokens_charged; + } + + /** + * Output only. The total quota tokens charged during creation of the + * report. Because this token count is based on activity from the `CREATING` + * state, this tokens charge will be fixed once a report task enters the + * `ACTIVE` or `FAILED` state. + * + * Generated from protobuf field int32 creation_quota_tokens_charged = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCreationQuotaTokensCharged($var) + { + GPBUtil::checkInt32($var); + $this->creation_quota_tokens_charged = $var; + + return $this; + } + + /** + * Output only. The total number of rows in the report result. This field + * will be populated when the state is active. You can utilize + * `task_row_count` for pagination within the confines of their existing + * report. + * + * Generated from protobuf field optional int32 task_row_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTaskRowCount() + { + return isset($this->task_row_count) ? $this->task_row_count : 0; + } + + public function hasTaskRowCount() + { + return isset($this->task_row_count); + } + + public function clearTaskRowCount() + { + unset($this->task_row_count); + } + + /** + * Output only. The total number of rows in the report result. This field + * will be populated when the state is active. You can utilize + * `task_row_count` for pagination within the confines of their existing + * report. + * + * Generated from protobuf field optional int32 task_row_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTaskRowCount($var) + { + GPBUtil::checkInt32($var); + $this->task_row_count = $var; + + return $this; + } + + /** + * Output only. Error message is populated if a report task fails during + * creation. + * + * Generated from protobuf field optional string error_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getErrorMessage() + { + return isset($this->error_message) ? $this->error_message : ''; + } + + public function hasErrorMessage() + { + return isset($this->error_message); + } + + public function clearErrorMessage() + { + unset($this->error_message); + } + + /** + * Output only. Error message is populated if a report task fails during + * creation. + * + * Generated from protobuf field optional string error_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + + /** + * Output only. The total number of rows in Google Analytics storage. If you + * want to query additional data rows beyond the current report, they can + * initiate a new report task based on the `total_row_count`. + * The `task_row_count` represents the number of rows specifically + * pertaining to the current report, whereas `total_row_count` encompasses + * the total count of rows across all data retrieved from Google + * Analytics storage. + * For example, suppose the current report's `task_row_count` is 20, + * displaying the data from the first 20 rows. Simultaneously, the + * `total_row_count` is 30, indicating the presence of data for all 30 rows. + * The `task_row_count` can be utilizated to paginate through the initial 20 + * rows. To expand the report and include data from all 30 rows, a new + * report task can be created using the total_row_count to access the full + * set of 30 rows' worth of data. + * + * Generated from protobuf field optional int32 total_row_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTotalRowCount() + { + return isset($this->total_row_count) ? $this->total_row_count : 0; + } + + public function hasTotalRowCount() + { + return isset($this->total_row_count); + } + + public function clearTotalRowCount() + { + unset($this->total_row_count); + } + + /** + * Output only. The total number of rows in Google Analytics storage. If you + * want to query additional data rows beyond the current report, they can + * initiate a new report task based on the `total_row_count`. + * The `task_row_count` represents the number of rows specifically + * pertaining to the current report, whereas `total_row_count` encompasses + * the total count of rows across all data retrieved from Google + * Analytics storage. + * For example, suppose the current report's `task_row_count` is 20, + * displaying the data from the first 20 rows. Simultaneously, the + * `total_row_count` is 30, indicating the presence of data for all 30 rows. + * The `task_row_count` can be utilizated to paginate through the initial 20 + * rows. To expand the report and include data from all 30 rows, a new + * report task can be created using the total_row_count to access the full + * set of 30 rows' worth of data. + * + * Generated from protobuf field optional int32 total_row_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTotalRowCount($var) + { + GPBUtil::checkInt32($var); + $this->total_row_count = $var; + + return $this; + } + +} + + diff --git a/AnalyticsData/src/V1alpha/ReportTask/ReportMetadata/State.php b/AnalyticsData/src/V1alpha/ReportTask/ReportMetadata/State.php new file mode 100644 index 000000000000..d52e28949d86 --- /dev/null +++ b/AnalyticsData/src/V1alpha/ReportTask/ReportMetadata/State.php @@ -0,0 +1,70 @@ +google.analytics.data.v1alpha.ReportTask.ReportMetadata.State + */ +class State +{ + /** + * Unspecified state will never be used. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The report is currently creating and will be available in the + * future. Creating occurs immediately after the CreateReport call. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The report is fully created and ready for querying. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The report failed to be created. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/AnalyticsData/src/V1alpha/ReportTaskMetadata.php b/AnalyticsData/src/V1alpha/ReportTaskMetadata.php new file mode 100644 index 000000000000..8331635b0a26 --- /dev/null +++ b/AnalyticsData/src/V1alpha/ReportTaskMetadata.php @@ -0,0 +1,34 @@ +google.analytics.data.v1alpha.ReportTaskMetadata + */ +class ReportTaskMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AnalyticsData/src/V1alpha/ResponseMetaData.php b/AnalyticsData/src/V1alpha/ResponseMetaData.php index 2a59512caa26..8874cfd66fc9 100644 --- a/AnalyticsData/src/V1alpha/ResponseMetaData.php +++ b/AnalyticsData/src/V1alpha/ResponseMetaData.php @@ -18,10 +18,69 @@ class ResponseMetaData extends \Google\Protobuf\Internal\Message /** * If true, indicates some buckets of dimension combinations are rolled into * "(other)" row. This can happen for high cardinality reports. + * The metadata parameter dataLossFromOtherRow is populated based on the + * aggregated data table used in the report. The parameter will be accurately + * populated regardless of the filters and limits in the report. + * For example, the (other) row could be dropped from the report because the + * request contains a filter on sessionSource = google. This parameter will + * still be populated if data loss from other row was present in the input + * aggregate data used to generate this report. + * To learn more, see [About the (other) row and data + * sampling](https://support.google.com/analytics/answer/13208658#reports). * * Generated from protobuf field bool data_loss_from_other_row = 3; */ private $data_loss_from_other_row = false; + /** + * Describes the schema restrictions actively enforced in creating this + * report. To learn more, see [Access and data-restriction + * management](https://support.google.com/analytics/answer/10851388). + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse schema_restriction_response = 4; + */ + private $schema_restriction_response = null; + /** + * The currency code used in this report. Intended to be used in formatting + * currency metrics like `purchaseRevenue` for visualization. If currency_code + * was specified in the request, this response parameter will echo the request + * parameter; otherwise, this response parameter is the property's current + * currency_code. + * Currency codes are string encodings of currency types from the ISO 4217 + * standard (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", + * "EUR", "JPY". To learn more, see + * https://support.google.com/analytics/answer/9796179. + * + * Generated from protobuf field optional string currency_code = 5; + */ + private $currency_code = null; + /** + * The property's current timezone. Intended to be used to interpret + * time-based dimensions like `hour` and `minute`. Formatted as strings from + * the IANA Time Zone database (https://www.iana.org/time-zones); for example + * "America/New_York" or "Asia/Tokyo". + * + * Generated from protobuf field optional string time_zone = 6; + */ + private $time_zone = null; + /** + * If empty reason is specified, the report is empty for this reason. + * + * Generated from protobuf field optional string empty_reason = 7; + */ + private $empty_reason = null; + /** + * If `subjectToThresholding` is true, this report is subject to thresholding + * and only returns data that meets the minimum aggregation thresholds. It is + * possible for a request to be subject to thresholding thresholding and no + * data is absent from the report, and this happens when all data is above the + * thresholds. To learn more, see [Data + * thresholds](https://support.google.com/analytics/answer/9383630) and [About + * Demographics and + * Interests](https://support.google.com/analytics/answer/2799357). + * + * Generated from protobuf field optional bool subject_to_thresholding = 8; + */ + private $subject_to_thresholding = null; /** * Constructor. @@ -32,6 +91,45 @@ class ResponseMetaData extends \Google\Protobuf\Internal\Message * @type bool $data_loss_from_other_row * If true, indicates some buckets of dimension combinations are rolled into * "(other)" row. This can happen for high cardinality reports. + * The metadata parameter dataLossFromOtherRow is populated based on the + * aggregated data table used in the report. The parameter will be accurately + * populated regardless of the filters and limits in the report. + * For example, the (other) row could be dropped from the report because the + * request contains a filter on sessionSource = google. This parameter will + * still be populated if data loss from other row was present in the input + * aggregate data used to generate this report. + * To learn more, see [About the (other) row and data + * sampling](https://support.google.com/analytics/answer/13208658#reports). + * @type \Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse $schema_restriction_response + * Describes the schema restrictions actively enforced in creating this + * report. To learn more, see [Access and data-restriction + * management](https://support.google.com/analytics/answer/10851388). + * @type string $currency_code + * The currency code used in this report. Intended to be used in formatting + * currency metrics like `purchaseRevenue` for visualization. If currency_code + * was specified in the request, this response parameter will echo the request + * parameter; otherwise, this response parameter is the property's current + * currency_code. + * Currency codes are string encodings of currency types from the ISO 4217 + * standard (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", + * "EUR", "JPY". To learn more, see + * https://support.google.com/analytics/answer/9796179. + * @type string $time_zone + * The property's current timezone. Intended to be used to interpret + * time-based dimensions like `hour` and `minute`. Formatted as strings from + * the IANA Time Zone database (https://www.iana.org/time-zones); for example + * "America/New_York" or "Asia/Tokyo". + * @type string $empty_reason + * If empty reason is specified, the report is empty for this reason. + * @type bool $subject_to_thresholding + * If `subjectToThresholding` is true, this report is subject to thresholding + * and only returns data that meets the minimum aggregation thresholds. It is + * possible for a request to be subject to thresholding thresholding and no + * data is absent from the report, and this happens when all data is above the + * thresholds. To learn more, see [Data + * thresholds](https://support.google.com/analytics/answer/9383630) and [About + * Demographics and + * Interests](https://support.google.com/analytics/answer/2799357). * } */ public function __construct($data = NULL) { @@ -42,6 +140,15 @@ public function __construct($data = NULL) { /** * If true, indicates some buckets of dimension combinations are rolled into * "(other)" row. This can happen for high cardinality reports. + * The metadata parameter dataLossFromOtherRow is populated based on the + * aggregated data table used in the report. The parameter will be accurately + * populated regardless of the filters and limits in the report. + * For example, the (other) row could be dropped from the report because the + * request contains a filter on sessionSource = google. This parameter will + * still be populated if data loss from other row was present in the input + * aggregate data used to generate this report. + * To learn more, see [About the (other) row and data + * sampling](https://support.google.com/analytics/answer/13208658#reports). * * Generated from protobuf field bool data_loss_from_other_row = 3; * @return bool @@ -54,6 +161,15 @@ public function getDataLossFromOtherRow() /** * If true, indicates some buckets of dimension combinations are rolled into * "(other)" row. This can happen for high cardinality reports. + * The metadata parameter dataLossFromOtherRow is populated based on the + * aggregated data table used in the report. The parameter will be accurately + * populated regardless of the filters and limits in the report. + * For example, the (other) row could be dropped from the report because the + * request contains a filter on sessionSource = google. This parameter will + * still be populated if data loss from other row was present in the input + * aggregate data used to generate this report. + * To learn more, see [About the (other) row and data + * sampling](https://support.google.com/analytics/answer/13208658#reports). * * Generated from protobuf field bool data_loss_from_other_row = 3; * @param bool $var @@ -67,5 +183,225 @@ public function setDataLossFromOtherRow($var) return $this; } + /** + * Describes the schema restrictions actively enforced in creating this + * report. To learn more, see [Access and data-restriction + * management](https://support.google.com/analytics/answer/10851388). + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse schema_restriction_response = 4; + * @return \Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse|null + */ + public function getSchemaRestrictionResponse() + { + return $this->schema_restriction_response; + } + + public function hasSchemaRestrictionResponse() + { + return isset($this->schema_restriction_response); + } + + public function clearSchemaRestrictionResponse() + { + unset($this->schema_restriction_response); + } + + /** + * Describes the schema restrictions actively enforced in creating this + * report. To learn more, see [Access and data-restriction + * management](https://support.google.com/analytics/answer/10851388). + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse schema_restriction_response = 4; + * @param \Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse $var + * @return $this + */ + public function setSchemaRestrictionResponse($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse::class); + $this->schema_restriction_response = $var; + + return $this; + } + + /** + * The currency code used in this report. Intended to be used in formatting + * currency metrics like `purchaseRevenue` for visualization. If currency_code + * was specified in the request, this response parameter will echo the request + * parameter; otherwise, this response parameter is the property's current + * currency_code. + * Currency codes are string encodings of currency types from the ISO 4217 + * standard (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", + * "EUR", "JPY". To learn more, see + * https://support.google.com/analytics/answer/9796179. + * + * Generated from protobuf field optional string currency_code = 5; + * @return string + */ + public function getCurrencyCode() + { + return isset($this->currency_code) ? $this->currency_code : ''; + } + + public function hasCurrencyCode() + { + return isset($this->currency_code); + } + + public function clearCurrencyCode() + { + unset($this->currency_code); + } + + /** + * The currency code used in this report. Intended to be used in formatting + * currency metrics like `purchaseRevenue` for visualization. If currency_code + * was specified in the request, this response parameter will echo the request + * parameter; otherwise, this response parameter is the property's current + * currency_code. + * Currency codes are string encodings of currency types from the ISO 4217 + * standard (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", + * "EUR", "JPY". To learn more, see + * https://support.google.com/analytics/answer/9796179. + * + * Generated from protobuf field optional string currency_code = 5; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * The property's current timezone. Intended to be used to interpret + * time-based dimensions like `hour` and `minute`. Formatted as strings from + * the IANA Time Zone database (https://www.iana.org/time-zones); for example + * "America/New_York" or "Asia/Tokyo". + * + * Generated from protobuf field optional string time_zone = 6; + * @return string + */ + public function getTimeZone() + { + return isset($this->time_zone) ? $this->time_zone : ''; + } + + public function hasTimeZone() + { + return isset($this->time_zone); + } + + public function clearTimeZone() + { + unset($this->time_zone); + } + + /** + * The property's current timezone. Intended to be used to interpret + * time-based dimensions like `hour` and `minute`. Formatted as strings from + * the IANA Time Zone database (https://www.iana.org/time-zones); for example + * "America/New_York" or "Asia/Tokyo". + * + * Generated from protobuf field optional string time_zone = 6; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * If empty reason is specified, the report is empty for this reason. + * + * Generated from protobuf field optional string empty_reason = 7; + * @return string + */ + public function getEmptyReason() + { + return isset($this->empty_reason) ? $this->empty_reason : ''; + } + + public function hasEmptyReason() + { + return isset($this->empty_reason); + } + + public function clearEmptyReason() + { + unset($this->empty_reason); + } + + /** + * If empty reason is specified, the report is empty for this reason. + * + * Generated from protobuf field optional string empty_reason = 7; + * @param string $var + * @return $this + */ + public function setEmptyReason($var) + { + GPBUtil::checkString($var, True); + $this->empty_reason = $var; + + return $this; + } + + /** + * If `subjectToThresholding` is true, this report is subject to thresholding + * and only returns data that meets the minimum aggregation thresholds. It is + * possible for a request to be subject to thresholding thresholding and no + * data is absent from the report, and this happens when all data is above the + * thresholds. To learn more, see [Data + * thresholds](https://support.google.com/analytics/answer/9383630) and [About + * Demographics and + * Interests](https://support.google.com/analytics/answer/2799357). + * + * Generated from protobuf field optional bool subject_to_thresholding = 8; + * @return bool + */ + public function getSubjectToThresholding() + { + return isset($this->subject_to_thresholding) ? $this->subject_to_thresholding : false; + } + + public function hasSubjectToThresholding() + { + return isset($this->subject_to_thresholding); + } + + public function clearSubjectToThresholding() + { + unset($this->subject_to_thresholding); + } + + /** + * If `subjectToThresholding` is true, this report is subject to thresholding + * and only returns data that meets the minimum aggregation thresholds. It is + * possible for a request to be subject to thresholding thresholding and no + * data is absent from the report, and this happens when all data is above the + * thresholds. To learn more, see [Data + * thresholds](https://support.google.com/analytics/answer/9383630) and [About + * Demographics and + * Interests](https://support.google.com/analytics/answer/2799357). + * + * Generated from protobuf field optional bool subject_to_thresholding = 8; + * @param bool $var + * @return $this + */ + public function setSubjectToThresholding($var) + { + GPBUtil::checkBool($var); + $this->subject_to_thresholding = $var; + + return $this; + } + } diff --git a/AnalyticsData/src/V1alpha/ResponseMetaData/SchemaRestrictionResponse.php b/AnalyticsData/src/V1alpha/ResponseMetaData/SchemaRestrictionResponse.php new file mode 100644 index 000000000000..e2bed167d7d6 --- /dev/null +++ b/AnalyticsData/src/V1alpha/ResponseMetaData/SchemaRestrictionResponse.php @@ -0,0 +1,82 @@ +google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse + */ +class SchemaRestrictionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All restrictions actively enforced in creating the report. For example, + * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. + * However, this active response restriction is only populated if the user's + * custom role disallows access to `REVENUE_DATA`. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction active_metric_restrictions = 1; + */ + private $active_metric_restrictions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse\ActiveMetricRestriction>|\Google\Protobuf\Internal\RepeatedField $active_metric_restrictions + * All restrictions actively enforced in creating the report. For example, + * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. + * However, this active response restriction is only populated if the user's + * custom role disallows access to `REVENUE_DATA`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); + parent::__construct($data); + } + + /** + * All restrictions actively enforced in creating the report. For example, + * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. + * However, this active response restriction is only populated if the user's + * custom role disallows access to `REVENUE_DATA`. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction active_metric_restrictions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActiveMetricRestrictions() + { + return $this->active_metric_restrictions; + } + + /** + * All restrictions actively enforced in creating the report. For example, + * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. + * However, this active response restriction is only populated if the user's + * custom role disallows access to `REVENUE_DATA`. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction active_metric_restrictions = 1; + * @param array<\Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse\ActiveMetricRestriction>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActiveMetricRestrictions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse\ActiveMetricRestriction::class); + $this->active_metric_restrictions = $arr; + + return $this; + } + +} + + diff --git a/AnalyticsData/src/V1alpha/ResponseMetaData/SchemaRestrictionResponse/ActiveMetricRestriction.php b/AnalyticsData/src/V1alpha/ResponseMetaData/SchemaRestrictionResponse/ActiveMetricRestriction.php new file mode 100644 index 000000000000..1d3df5152fab --- /dev/null +++ b/AnalyticsData/src/V1alpha/ResponseMetaData/SchemaRestrictionResponse/ActiveMetricRestriction.php @@ -0,0 +1,112 @@ +google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + */ +class ActiveMetricRestriction extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the restricted metric. + * + * Generated from protobuf field optional string metric_name = 1; + */ + private $metric_name = null; + /** + * The reason for this metric's restriction. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.RestrictedMetricType restricted_metric_types = 2; + */ + private $restricted_metric_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $metric_name + * The name of the restricted metric. + * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_metric_types + * The reason for this metric's restriction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the restricted metric. + * + * Generated from protobuf field optional string metric_name = 1; + * @return string + */ + public function getMetricName() + { + return isset($this->metric_name) ? $this->metric_name : ''; + } + + public function hasMetricName() + { + return isset($this->metric_name); + } + + public function clearMetricName() + { + unset($this->metric_name); + } + + /** + * The name of the restricted metric. + * + * Generated from protobuf field optional string metric_name = 1; + * @param string $var + * @return $this + */ + public function setMetricName($var) + { + GPBUtil::checkString($var, True); + $this->metric_name = $var; + + return $this; + } + + /** + * The reason for this metric's restriction. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.RestrictedMetricType restricted_metric_types = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRestrictedMetricTypes() + { + return $this->restricted_metric_types; + } + + /** + * The reason for this metric's restriction. + * + * Generated from protobuf field repeated .google.analytics.data.v1alpha.RestrictedMetricType restricted_metric_types = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRestrictedMetricTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Analytics\Data\V1alpha\RestrictedMetricType::class); + $this->restricted_metric_types = $arr; + + return $this; + } + +} + + diff --git a/AnalyticsData/src/V1alpha/RestrictedMetricType.php b/AnalyticsData/src/V1alpha/RestrictedMetricType.php new file mode 100644 index 000000000000..b3c8bdd09ad0 --- /dev/null +++ b/AnalyticsData/src/V1alpha/RestrictedMetricType.php @@ -0,0 +1,62 @@ +google.analytics.data.v1alpha.RestrictedMetricType + */ +class RestrictedMetricType +{ + /** + * Unspecified type. + * + * Generated from protobuf enum RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; + */ + const RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; + /** + * Cost metrics such as `adCost`. + * + * Generated from protobuf enum COST_DATA = 1; + */ + const COST_DATA = 1; + /** + * Revenue metrics such as `purchaseRevenue`. + * + * Generated from protobuf enum REVENUE_DATA = 2; + */ + const REVENUE_DATA = 2; + + private static $valueToName = [ + self::RESTRICTED_METRIC_TYPE_UNSPECIFIED => 'RESTRICTED_METRIC_TYPE_UNSPECIFIED', + self::COST_DATA => 'COST_DATA', + self::REVENUE_DATA => 'REVENUE_DATA', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/AnalyticsData/src/V1alpha/gapic_metadata.json b/AnalyticsData/src/V1alpha/gapic_metadata.json index 34f0f627b2fb..6b8b6ebe92b6 100644 --- a/AnalyticsData/src/V1alpha/gapic_metadata.json +++ b/AnalyticsData/src/V1alpha/gapic_metadata.json @@ -20,6 +20,11 @@ "createRecurringAudienceList" ] }, + "CreateReportTask": { + "methods": [ + "createReportTask" + ] + }, "GetAudienceList": { "methods": [ "getAudienceList" @@ -30,6 +35,11 @@ "getRecurringAudienceList" ] }, + "GetReportTask": { + "methods": [ + "getReportTask" + ] + }, "ListAudienceLists": { "methods": [ "listAudienceLists" @@ -40,11 +50,21 @@ "listRecurringAudienceLists" ] }, + "ListReportTasks": { + "methods": [ + "listReportTasks" + ] + }, "QueryAudienceList": { "methods": [ "queryAudienceList" ] }, + "QueryReportTask": { + "methods": [ + "queryReportTask" + ] + }, "RunFunnelReport": { "methods": [ "runFunnelReport" diff --git a/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_client_config.json b/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_client_config.json index 2718a17f7bdf..730a2dea65ba 100644 --- a/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_client_config.json +++ b/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_client_config.json @@ -48,6 +48,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "CreateReportTask": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetAudienceList": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -58,6 +63,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetReportTask": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListAudienceLists": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -68,11 +78,21 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListReportTasks": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "QueryAudienceList": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "QueryReportTask": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "RunFunnelReport": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_descriptor_config.php b/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_descriptor_config.php index 2dd5ef0502ab..6903c5bf2ef3 100644 --- a/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_descriptor_config.php +++ b/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_descriptor_config.php @@ -42,6 +42,25 @@ ], ], ], + 'CreateReportTask' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Analytics\Data\V1alpha\ReportTask', + 'metadataReturnType' => '\Google\Analytics\Data\V1alpha\ReportTaskMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateRecurringAudienceList' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Analytics\Data\V1alpha\RecurringAudienceList', @@ -78,6 +97,18 @@ ], ], ], + 'GetReportTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Analytics\Data\V1alpha\ReportTask', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'ListAudienceLists' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -118,6 +149,26 @@ ], ], ], + 'ListReportTasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getReportTasks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Analytics\Data\V1alpha\ListReportTasksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'QueryAudienceList' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Analytics\Data\V1alpha\QueryAudienceListResponse', @@ -130,6 +181,18 @@ ], ], ], + 'QueryReportTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Analytics\Data\V1alpha\QueryReportTaskResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'RunFunnelReport' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Analytics\Data\V1alpha\RunFunnelReportResponse', @@ -158,6 +221,7 @@ 'audienceList' => 'properties/{property}/audienceLists/{audience_list}', 'property' => 'properties/{property}', 'recurringAudienceList' => 'properties/{property}/recurringAudienceLists/{recurring_audience_list}', + 'reportTask' => 'properties/{property}/reportTasks/{report_task}', ], ], ], diff --git a/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_rest_client_config.php b/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_rest_client_config.php index 73859d059df6..6b05bd390654 100644 --- a/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_rest_client_config.php +++ b/AnalyticsData/src/V1alpha/resources/alpha_analytics_data_rest_client_config.php @@ -47,6 +47,18 @@ ], ], ], + 'CreateReportTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=properties/*}/reportTasks', + 'body' => 'report_task', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'GetAudienceList' => [ 'method' => 'get', 'uriTemplate' => '/v1alpha/{name=properties/*/audienceLists/*}', @@ -69,6 +81,17 @@ ], ], ], + 'GetReportTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=properties/*/reportTasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'ListAudienceLists' => [ 'method' => 'get', 'uriTemplate' => '/v1alpha/{parent=properties/*}/audienceLists', @@ -91,6 +114,17 @@ ], ], ], + 'ListReportTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=properties/*}/reportTasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'QueryAudienceList' => [ 'method' => 'post', 'uriTemplate' => '/v1alpha/{name=properties/*/audienceLists/*}:query', @@ -103,6 +137,18 @@ ], ], ], + 'QueryReportTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=properties/*/reportTasks/*}:query', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'RunFunnelReport' => [ 'method' => 'post', 'uriTemplate' => '/v1alpha/{property=properties/*}:runFunnelReport', diff --git a/AnalyticsData/tests/Unit/V1alpha/AlphaAnalyticsDataClientTest.php b/AnalyticsData/tests/Unit/V1alpha/AlphaAnalyticsDataClientTest.php index 588ceb5caa44..df143d25ace6 100644 --- a/AnalyticsData/tests/Unit/V1alpha/AlphaAnalyticsDataClientTest.php +++ b/AnalyticsData/tests/Unit/V1alpha/AlphaAnalyticsDataClientTest.php @@ -26,8 +26,11 @@ use Google\Analytics\Data\V1alpha\AudienceList; use Google\Analytics\Data\V1alpha\ListAudienceListsResponse; use Google\Analytics\Data\V1alpha\ListRecurringAudienceListsResponse; +use Google\Analytics\Data\V1alpha\ListReportTasksResponse; use Google\Analytics\Data\V1alpha\QueryAudienceListResponse; +use Google\Analytics\Data\V1alpha\QueryReportTaskResponse; use Google\Analytics\Data\V1alpha\RecurringAudienceList; +use Google\Analytics\Data\V1alpha\ReportTask; use Google\Analytics\Data\V1alpha\RunFunnelReportResponse; use Google\Analytics\Data\V1alpha\SheetExportAudienceListResponse; use Google\ApiCore\ApiException; @@ -292,6 +295,129 @@ public function createRecurringAudienceListExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function createReportTaskTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createReportTaskTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new ReportTask(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createReportTaskTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->propertyName('[PROPERTY]'); + $reportTask = new ReportTask(); + $response = $gapicClient->createReportTask($formattedParent, $reportTask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.analytics.data.v1alpha.AlphaAnalyticsData/CreateReportTask', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getReportTask(); + $this->assertProtobufEquals($reportTask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createReportTaskTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createReportTaskExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createReportTaskTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->propertyName('[PROPERTY]'); + $reportTask = new ReportTask(); + $response = $gapicClient->createReportTask($formattedParent, $reportTask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createReportTaskTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function getAudienceListTest() { @@ -432,6 +558,66 @@ public function getRecurringAudienceListExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getReportTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new ReportTask(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->reportTaskName('[PROPERTY]', '[REPORT_TASK]'); + $response = $gapicClient->getReportTask($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.analytics.data.v1alpha.AlphaAnalyticsData/GetReportTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getReportTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->reportTaskName('[PROPERTY]', '[REPORT_TASK]'); + try { + $gapicClient->getReportTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listAudienceListsTest() { @@ -568,6 +754,74 @@ public function listRecurringAudienceListsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listReportTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $reportTasksElement = new ReportTask(); + $reportTasks = [ + $reportTasksElement, + ]; + $expectedResponse = new ListReportTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setReportTasks($reportTasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->propertyName('[PROPERTY]'); + $response = $gapicClient->listReportTasks($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getReportTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.analytics.data.v1alpha.AlphaAnalyticsData/ListReportTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReportTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->propertyName('[PROPERTY]'); + try { + $gapicClient->listReportTasks($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function queryAudienceListTest() { @@ -628,6 +882,66 @@ public function queryAudienceListExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function queryReportTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $rowCount = 1340416618; + $expectedResponse = new QueryReportTaskResponse(); + $expectedResponse->setRowCount($rowCount); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $gapicClient->queryReportTask($name); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.analytics.data.v1alpha.AlphaAnalyticsData/QueryReportTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function queryReportTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $gapicClient->queryReportTask($name); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function runFunnelReportTest() { diff --git a/AnalyticsData/tests/Unit/V1alpha/Client/AlphaAnalyticsDataClientTest.php b/AnalyticsData/tests/Unit/V1alpha/Client/AlphaAnalyticsDataClientTest.php index a64dab8f9e60..27ed731150f6 100644 --- a/AnalyticsData/tests/Unit/V1alpha/Client/AlphaAnalyticsDataClientTest.php +++ b/AnalyticsData/tests/Unit/V1alpha/Client/AlphaAnalyticsDataClientTest.php @@ -26,15 +26,22 @@ use Google\Analytics\Data\V1alpha\Client\AlphaAnalyticsDataClient; use Google\Analytics\Data\V1alpha\CreateAudienceListRequest; use Google\Analytics\Data\V1alpha\CreateRecurringAudienceListRequest; +use Google\Analytics\Data\V1alpha\CreateReportTaskRequest; use Google\Analytics\Data\V1alpha\GetAudienceListRequest; use Google\Analytics\Data\V1alpha\GetRecurringAudienceListRequest; +use Google\Analytics\Data\V1alpha\GetReportTaskRequest; use Google\Analytics\Data\V1alpha\ListAudienceListsRequest; use Google\Analytics\Data\V1alpha\ListAudienceListsResponse; use Google\Analytics\Data\V1alpha\ListRecurringAudienceListsRequest; use Google\Analytics\Data\V1alpha\ListRecurringAudienceListsResponse; +use Google\Analytics\Data\V1alpha\ListReportTasksRequest; +use Google\Analytics\Data\V1alpha\ListReportTasksResponse; use Google\Analytics\Data\V1alpha\QueryAudienceListRequest; use Google\Analytics\Data\V1alpha\QueryAudienceListResponse; +use Google\Analytics\Data\V1alpha\QueryReportTaskRequest; +use Google\Analytics\Data\V1alpha\QueryReportTaskResponse; use Google\Analytics\Data\V1alpha\RecurringAudienceList; +use Google\Analytics\Data\V1alpha\ReportTask; use Google\Analytics\Data\V1alpha\RunFunnelReportRequest; use Google\Analytics\Data\V1alpha\RunFunnelReportResponse; use Google\Analytics\Data\V1alpha\SheetExportAudienceListRequest; @@ -313,6 +320,135 @@ public function createRecurringAudienceListExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function createReportTaskTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createReportTaskTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new ReportTask(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createReportTaskTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->propertyName('[PROPERTY]'); + $reportTask = new ReportTask(); + $request = (new CreateReportTaskRequest()) + ->setParent($formattedParent) + ->setReportTask($reportTask); + $response = $gapicClient->createReportTask($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.analytics.data.v1alpha.AlphaAnalyticsData/CreateReportTask', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getReportTask(); + $this->assertProtobufEquals($reportTask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createReportTaskTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createReportTaskExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createReportTaskTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->propertyName('[PROPERTY]'); + $reportTask = new ReportTask(); + $request = (new CreateReportTaskRequest()) + ->setParent($formattedParent) + ->setReportTask($reportTask); + $response = $gapicClient->createReportTask($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createReportTaskTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function getAudienceListTest() { @@ -461,6 +597,70 @@ public function getRecurringAudienceListExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getReportTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new ReportTask(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->reportTaskName('[PROPERTY]', '[REPORT_TASK]'); + $request = (new GetReportTaskRequest()) + ->setName($formattedName); + $response = $gapicClient->getReportTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.analytics.data.v1alpha.AlphaAnalyticsData/GetReportTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getReportTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->reportTaskName('[PROPERTY]', '[REPORT_TASK]'); + $request = (new GetReportTaskRequest()) + ->setName($formattedName); + try { + $gapicClient->getReportTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listAudienceListsTest() { @@ -605,6 +805,78 @@ public function listRecurringAudienceListsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listReportTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $reportTasksElement = new ReportTask(); + $reportTasks = [ + $reportTasksElement, + ]; + $expectedResponse = new ListReportTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setReportTasks($reportTasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->propertyName('[PROPERTY]'); + $request = (new ListReportTasksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listReportTasks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getReportTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.analytics.data.v1alpha.AlphaAnalyticsData/ListReportTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReportTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->propertyName('[PROPERTY]'); + $request = (new ListReportTasksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listReportTasks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function queryAudienceListTest() { @@ -669,6 +941,70 @@ public function queryAudienceListExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function queryReportTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $rowCount = 1340416618; + $expectedResponse = new QueryReportTaskResponse(); + $expectedResponse->setRowCount($rowCount); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new QueryReportTaskRequest()) + ->setName($name); + $response = $gapicClient->queryReportTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.analytics.data.v1alpha.AlphaAnalyticsData/QueryReportTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function queryReportTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new QueryReportTaskRequest()) + ->setName($name); + try { + $gapicClient->queryReportTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function runFunnelReportTest() { diff --git a/ApiGateway/.repo-metadata.json b/ApiGateway/.repo-metadata.json deleted file mode 100644 index 909cdfa03818..000000000000 --- a/ApiGateway/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-api-gateway", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-api-gateway/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "apigateway" -} diff --git a/ApiGateway/VERSION b/ApiGateway/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/ApiGateway/VERSION +++ b/ApiGateway/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/ApiGateway/composer.json b/ApiGateway/composer.json index a5c64fcdaced..f00c3ceabc0c 100644 --- a/ApiGateway/composer.json +++ b/ApiGateway/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ApiKeys/.repo-metadata.json b/ApiKeys/.repo-metadata.json deleted file mode 100644 index 4b445b37c392..000000000000 --- a/ApiKeys/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-api-keys", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-api-keys/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/api-keys/docs", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "apikeys" -} diff --git a/ApiKeys/VERSION b/ApiKeys/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/ApiKeys/VERSION +++ b/ApiKeys/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/ApiKeys/composer.json b/ApiKeys/composer.json index a17d7f4b0865..7628542bed78 100644 --- a/ApiKeys/composer.json +++ b/ApiKeys/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ApigeeConnect/.repo-metadata.json b/ApigeeConnect/.repo-metadata.json deleted file mode 100644 index e59a1fe9d015..000000000000 --- a/ApigeeConnect/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-apigee-connect", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-apigee-connect/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "apigeeconnect" -} diff --git a/ApigeeConnect/VERSION b/ApigeeConnect/VERSION index 0495c4a88cae..c813fe116c9f 100644 --- a/ApigeeConnect/VERSION +++ b/ApigeeConnect/VERSION @@ -1 +1 @@ -1.2.3 +1.2.5 diff --git a/ApigeeConnect/composer.json b/ApigeeConnect/composer.json index 8f2866e1a2e6..09126b60958c 100644 --- a/ApigeeConnect/composer.json +++ b/ApigeeConnect/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ApigeeRegistry/.repo-metadata.json b/ApigeeRegistry/.repo-metadata.json deleted file mode 100644 index 86b4edc53233..000000000000 --- a/ApigeeRegistry/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-apigee-registry", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-apigee-registry/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "apigeeregistry" -} diff --git a/ApigeeRegistry/VERSION b/ApigeeRegistry/VERSION index be14282b7fff..d1d899fa33a0 100644 --- a/ApigeeRegistry/VERSION +++ b/ApigeeRegistry/VERSION @@ -1 +1 @@ -0.5.3 +0.5.5 diff --git a/ApigeeRegistry/composer.json b/ApigeeRegistry/composer.json index 895fae90c6b2..5baf0622edbb 100644 --- a/ApigeeRegistry/composer.json +++ b/ApigeeRegistry/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AppEngineAdmin/.repo-metadata.json b/AppEngineAdmin/.repo-metadata.json deleted file mode 100644 index 46eb7959b782..000000000000 --- a/AppEngineAdmin/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-appengine-admin", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-appengine-admin/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "appengine" -} diff --git a/AppEngineAdmin/VERSION b/AppEngineAdmin/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/AppEngineAdmin/VERSION +++ b/AppEngineAdmin/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/AppEngineAdmin/composer.json b/AppEngineAdmin/composer.json index b72dec6763be..278b23d8ce47 100644 --- a/AppEngineAdmin/composer.json +++ b/AppEngineAdmin/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AppHub/.repo-metadata.json b/AppHub/.repo-metadata.json deleted file mode 100644 index 5ffa2bac8a18..000000000000 --- a/AppHub/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-apphub", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-apphub/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "apphub" -} diff --git a/AppHub/VERSION b/AppHub/VERSION index 17e51c385ea3..b1e80bb2480a 100644 --- a/AppHub/VERSION +++ b/AppHub/VERSION @@ -1 +1 @@ -0.1.1 +0.1.3 diff --git a/AppHub/composer.json b/AppHub/composer.json index 6191b7536c25..ade404d59426 100644 --- a/AppHub/composer.json +++ b/AppHub/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AppHub/src/V1/Client/AppHubClient.php b/AppHub/src/V1/Client/AppHubClient.php index 05f943943e59..0cbd2116701a 100644 --- a/AppHub/src/V1/Client/AppHubClient.php +++ b/AppHub/src/V1/Client/AppHubClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -80,6 +79,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -206,6 +206,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a application * resource. diff --git a/AppHub/tests/Unit/V1/Client/AppHubClientTest.php b/AppHub/tests/Unit/V1/Client/AppHubClientTest.php index 56a55d8c2d99..bbfb950d329d 100644 --- a/AppHub/tests/Unit/V1/Client/AppHubClientTest.php +++ b/AppHub/tests/Unit/V1/Client/AppHubClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\AppHub\V1\Application; @@ -82,6 +81,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/AppsChat/.repo-metadata.json b/AppsChat/.repo-metadata.json deleted file mode 100644 index 0b70a325cd0a..000000000000 --- a/AppsChat/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/apps-chat", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/apps-chat/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "chat" -} diff --git a/AppsChat/VERSION b/AppsChat/VERSION index 6e8bf73aa550..b1e80bb2480a 100644 --- a/AppsChat/VERSION +++ b/AppsChat/VERSION @@ -1 +1 @@ -0.1.0 +0.1.3 diff --git a/AppsChat/composer.json b/AppsChat/composer.json index 29d44291df31..813ddf48e9ac 100644 --- a/AppsChat/composer.json +++ b/AppsChat/composer.json @@ -20,7 +20,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AppsChat/metadata/Chat/V1/ActionStatus.php b/AppsChat/metadata/Chat/V1/ActionStatus.php index 5e1bb871cebf..809c8f272695 100644 --- a/AppsChat/metadata/Chat/V1/ActionStatus.php +++ b/AppsChat/metadata/Chat/V1/ActionStatus.php @@ -17,12 +17,12 @@ public static function initOnce() { \GPBMetadata\Google\Rpc\Code::initOnce(); $pool->internalAddGeneratedFile( ' -¯ +½ "google/chat/v1/action_status.protogoogle.chat.v1"R ActionStatus% status_code (2.google.rpc.Code -user_facing_message ( Bœ -com.google.chat.v1BActionStatusProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' +user_facing_message ( Bª +com.google.chat.v1BActionStatusProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpb¢ DYNAPIProtoªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' , true); static::$is_initialized = true; diff --git a/AppsChat/metadata/Chat/V1/Annotation.php b/AppsChat/metadata/Chat/V1/Annotation.php index 62c79c5cae09771481e1c0528979740f40f3e6af..3c94084b9dda11f26f8b80414833c9925a09afe7 100644 GIT binary patch delta 98 zcmeyye_LR~21Xvog3Oqp)Z+ZoqU6-chZv0}?_g|Yn#Voap20NMZB5cUtSumO|i0gVLj3JM>QOCOV#0ui&w0+|E>nv-G&R+GjDl`HKIvH$=8 diff --git a/AppsChat/metadata/Chat/V1/Attachment.php b/AppsChat/metadata/Chat/V1/Attachment.php index 013dfc061df3f3f8599d69bcea444d2799d17c9e..1609b69644668bc8ee18ae9b6ac7f4f608e3d08e 100644 GIT binary patch delta 39 vcmey&+sL=UhKcdlW?QCH%#150bFhW+En?z!iS%;}@C+!*FUg-A$2JuJ2HFhz delta 24 gcmZqV`^>w+hKcdbW?QCH%#5=pbFhU?&S9Gh0Blqovm>AbizRnWOw}^?`CDP9^z%!sIza)RM5$jX{5-kmC delta 24 gcmcc0eVls(KNI7-%>qovm>B0zzRnUo*@1N`0B?B+#sB~S diff --git a/AppsChat/metadata/Chat/V1/DeletionMetadata.php b/AppsChat/metadata/Chat/V1/DeletionMetadata.php index ce6976a0ddc4853dae10d7d19840e5eb7466bf68..0fe6a8e5df12023ac54bd3170049c7c18625ab87 100644 GIT binary patch delta 39 vcmey*-pjG!1|#F^%{LiM7#Y`1=3|cGTg1fe66xm{;2BVqUy?sLi+L&l9%&7& delta 24 gcmeC>_|LxK1|#F$%{LiM7#SB#=3|bTT){jQ0D1HY2><{9 diff --git a/AppsChat/metadata/Chat/V1/Group.php b/AppsChat/metadata/Chat/V1/Group.php index 4672bcfeb862..5032c0f55dde 100644 --- a/AppsChat/metadata/Chat/V1/Group.php +++ b/AppsChat/metadata/Chat/V1/Group.php @@ -16,12 +16,12 @@ public static function initOnce() { } $pool->internalAddGeneratedFile( ' -ã +ñ google/chat/v1/group.protogoogle.chat.v1" Group -name ( B• +name ( B£ com.google.chat.v1B -GroupProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' +GroupProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpb¢ DYNAPIProtoªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' , true); static::$is_initialized = true; diff --git a/AppsChat/metadata/Chat/V1/HistoryState.php b/AppsChat/metadata/Chat/V1/HistoryState.php index ec2fc6b93e7166f3871733c628257c784c81279c..7ddf20031fdd6920dcc6cfb9a957c8a523c9f7fc 100644 GIT binary patch delta 38 ucmX@gcA0I%1xCi5lP@y1F|L{%!4$!_h>6=J($6u#GoUEHB!BV-rl|lNr4B0q delta 23 fcmcc2c9d#_% diff --git a/AppsChat/metadata/Chat/V1/MatchedUrl.php b/AppsChat/metadata/Chat/V1/MatchedUrl.php index bfe88200ad6f..bcea53750339 100644 --- a/AppsChat/metadata/Chat/V1/MatchedUrl.php +++ b/AppsChat/metadata/Chat/V1/MatchedUrl.php @@ -17,12 +17,12 @@ public static function initOnce() { \GPBMetadata\Google\Api\FieldBehavior::initOnce(); $pool->internalAddGeneratedFile( ' -÷ +… google/chat/v1/matched_url.protogoogle.chat.v1" MatchedUrl -url ( BàABš -com.google.chat.v1BMatchedUrlProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' +url ( BàAB¨ +com.google.chat.v1BMatchedUrlProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpb¢ DYNAPIProtoªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' , true); static::$is_initialized = true; diff --git a/AppsChat/metadata/Chat/V1/Membership.php b/AppsChat/metadata/Chat/V1/Membership.php index e86c272e3b7eb5de34cfce038c59a8ac1a9653a8..69871f885f29bb2515b7180a7bb03d98ffca383f 100644 GIT binary patch delta 45 zcmca0a!+J~A~VZpUM~5G-twDWm=)LXj4C7nG#O)I4=NRA_P?TSiKY2IjQ~*MG B4s`$k delta 30 mcmca7azSK+A~VZVUM~5G-twDWm=)LtWE-q(E{^W8Bmm8l0SJa+f)E%C>BKk delta 58 zcmX@gw~22<9uw0~j?D#3y^PXQT-?s3#U=TinternalAddGeneratedFile( ' -ÿ + "google/chat/v1/slash_command.protogoogle.chat.v1"" SlashCommand -command_id (Bœ -com.google.chat.v1BSlashCommandProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' +command_id (Bª +com.google.chat.v1BSlashCommandProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpb¢ DYNAPIProtoªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' , true); static::$is_initialized = true; diff --git a/AppsChat/metadata/Chat/V1/Space.php b/AppsChat/metadata/Chat/V1/Space.php index d0f7fa81bd7fd68d1337f2f4a777fdc29a2fe4d5..8e957f44af4ae73696bc23a189ab4bdc4e49be75 100644 GIT binary patch delta 39 vcmaDU`dxIx3ns>+n_n_XvNJB8%*++Yw}^?`CDP9^z%!sIza)Qh2-j2qDJTuv delta 24 gcmew^`cibm3ns?xn_n_XvNKMd%*+)yIf-j30D>(EHUIzs diff --git a/AppsChat/metadata/Chat/V1/SpaceReadState.php b/AppsChat/metadata/Chat/V1/SpaceReadState.php index c50a77eec7f1..40bb79eed855 100644 --- a/AppsChat/metadata/Chat/V1/SpaceReadState.php +++ b/AppsChat/metadata/Chat/V1/SpaceReadState.php @@ -20,7 +20,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -è +ö %google/chat/v1/space_read_state.protogoogle.chat.v1google/api/resource.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"¼ SpaceReadState name ( 7 @@ -31,8 +31,8 @@ public static function initOnce() { "chat.googleapis.com/SpaceReadState"’ UpdateSpaceReadStateRequest= space_read_state ( 2.google.chat.v1.SpaceReadStateBàA4 - update_mask ( 2.google.protobuf.FieldMaskBàABž -com.google.chat.v1BSpaceReadStateProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' + update_mask ( 2.google.protobuf.FieldMaskBàAB¬ +com.google.chat.v1BSpaceReadStateProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpb¢ DYNAPIProtoªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' , true); static::$is_initialized = true; diff --git a/AppsChat/metadata/Chat/V1/SpaceSetup.php b/AppsChat/metadata/Chat/V1/SpaceSetup.php index 69d661afdf88..ee6cbcbaa165 100644 --- a/AppsChat/metadata/Chat/V1/SpaceSetup.php +++ b/AppsChat/metadata/Chat/V1/SpaceSetup.php @@ -19,14 +19,14 @@ public static function initOnce() { \GPBMetadata\Google\Chat\V1\Space::initOnce(); $pool->internalAddGeneratedFile( ' -¤ +² google/chat/v1/space_setup.protogoogle.chat.v1google/chat/v1/membership.protogoogle/chat/v1/space.proto" SetUpSpaceRequest) space ( 2.google.chat.v1.SpaceBàA request_id ( BàA4 - memberships ( 2.google.chat.v1.MembershipBàABš -com.google.chat.v1BSpaceSetupProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' + memberships ( 2.google.chat.v1.MembershipBàAB¨ +com.google.chat.v1BSpaceSetupProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpb¢ DYNAPIProtoªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' , true); static::$is_initialized = true; diff --git a/AppsChat/metadata/Chat/V1/ThreadReadState.php b/AppsChat/metadata/Chat/V1/ThreadReadState.php index f1dcbd1fc458..d8c72b7e4905 100644 --- a/AppsChat/metadata/Chat/V1/ThreadReadState.php +++ b/AppsChat/metadata/Chat/V1/ThreadReadState.php @@ -19,7 +19,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -Å +Ó &google/chat/v1/thread_read_state.protogoogle.chat.v1google/api/resource.protogoogle/protobuf/timestamp.proto"Ì ThreadReadState name ( 2 @@ -27,8 +27,8 @@ public static function initOnce() { #chat.googleapis.com/ThreadReadStatestring uid = 1; + * Generated from protobuf field string uid = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $uid = ''; @@ -29,7 +29,7 @@ class CustomEmoji extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $uid - * Unique key for the custom emoji resource. + * Output only. Unique key for the custom emoji resource. * } */ public function __construct($data = NULL) { @@ -38,9 +38,9 @@ public function __construct($data = NULL) { } /** - * Unique key for the custom emoji resource. + * Output only. Unique key for the custom emoji resource. * - * Generated from protobuf field string uid = 1; + * Generated from protobuf field string uid = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string */ public function getUid() @@ -49,9 +49,9 @@ public function getUid() } /** - * Unique key for the custom emoji resource. + * Output only. Unique key for the custom emoji resource. * - * Generated from protobuf field string uid = 1; + * Generated from protobuf field string uid = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var * @return $this */ diff --git a/AppsChat/src/Chat/V1/GetMembershipRequest.php b/AppsChat/src/Chat/V1/GetMembershipRequest.php index bd46f59d7711..65f2f8ab4b5a 100644 --- a/AppsChat/src/Chat/V1/GetMembershipRequest.php +++ b/AppsChat/src/Chat/V1/GetMembershipRequest.php @@ -17,8 +17,9 @@ class GetMembershipRequest extends \Google\Protobuf\Internal\Message { /** * Required. Resource name of the membership to retrieve. - * To get the app's own membership, you can optionally use - * `spaces/{space}/members/app`. + * To get the app's own membership [by using user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can optionally use `spaces/{space}/members/app`. * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * When [authenticated as a * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), @@ -33,8 +34,9 @@ class GetMembershipRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Resource name of the membership to retrieve. * - * To get the app's own membership, you can optionally use - * `spaces/{space}/members/app`. + * To get the app's own membership [by using user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can optionally use `spaces/{space}/members/app`. * * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * @@ -63,8 +65,9 @@ public static function build(string $name): self * * @type string $name * Required. Resource name of the membership to retrieve. - * To get the app's own membership, you can optionally use - * `spaces/{space}/members/app`. + * To get the app's own membership [by using user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can optionally use `spaces/{space}/members/app`. * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * When [authenticated as a * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), @@ -80,8 +83,9 @@ public function __construct($data = NULL) { /** * Required. Resource name of the membership to retrieve. - * To get the app's own membership, you can optionally use - * `spaces/{space}/members/app`. + * To get the app's own membership [by using user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can optionally use `spaces/{space}/members/app`. * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * When [authenticated as a * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), @@ -99,8 +103,9 @@ public function getName() /** * Required. Resource name of the membership to retrieve. - * To get the app's own membership, you can optionally use - * `spaces/{space}/members/app`. + * To get the app's own membership [by using user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can optionally use `spaces/{space}/members/app`. * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * When [authenticated as a * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), diff --git a/AppsChat/src/Chat/V1/Membership.php b/AppsChat/src/Chat/V1/Membership.php index b588dfd08aa5..87288062d418 100644 --- a/AppsChat/src/Chat/V1/Membership.php +++ b/AppsChat/src/Chat/V1/Membership.php @@ -79,8 +79,8 @@ class Membership extends \Google\Protobuf\Internal\Message * `name` and `type`. * @type \Google\Apps\Chat\V1\Group $group_member * The Google Group the membership corresponds to. - * Only supports read operations. Other operations, like creating or - * updating a membership, aren't currently supported. + * Only supports read operations. Other operations, like + * creating or updating a membership, aren't currently supported. * @type \Google\Protobuf\Timestamp $create_time * Optional. Immutable. The creation time of the membership, such as when a * member joined or was invited to join a space. This field is output only, @@ -223,8 +223,8 @@ public function setMember($var) /** * The Google Group the membership corresponds to. - * Only supports read operations. Other operations, like creating or - * updating a membership, aren't currently supported. + * Only supports read operations. Other operations, like + * creating or updating a membership, aren't currently supported. * * Generated from protobuf field .google.chat.v1.Group group_member = 5; * @return \Google\Apps\Chat\V1\Group|null @@ -241,8 +241,8 @@ public function hasGroupMember() /** * The Google Group the membership corresponds to. - * Only supports read operations. Other operations, like creating or - * updating a membership, aren't currently supported. + * Only supports read operations. Other operations, like + * creating or updating a membership, aren't currently supported. * * Generated from protobuf field .google.chat.v1.Group group_member = 5; * @param \Google\Apps\Chat\V1\Group $var diff --git a/AppsChat/src/Chat/V1/SetUpSpaceRequest.php b/AppsChat/src/Chat/V1/SetUpSpaceRequest.php index 5051e3a70944..4cd10ee2c3b6 100644 --- a/AppsChat/src/Chat/V1/SetUpSpaceRequest.php +++ b/AppsChat/src/Chat/V1/SetUpSpaceRequest.php @@ -53,14 +53,14 @@ class SetUpSpaceRequest extends \Google\Protobuf\Internal\Message * Optional. The Google Chat users to invite to join the space. Omit the * calling user, as they are added automatically. * The set currently allows up to 20 memberships (in addition to the caller). - * The `Membership.member` field must contain a `user` with `name` populated - * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only - * add human users when setting up a space (adding Chat apps is only supported - * for direct message setup with the calling app). You can also add members - * using the user's email as an alias for {user}. For example, the `user.name` - * can be `users/example@gmail.com`." To invite Gmail users or users from - * external Google Workspace domains, user's email must be used for - * `{user}`. + * For human membership, the `Membership.member` field must contain a `user` + * with `name` populated (format: `users/{user}`) and `type` set to + * `User.Type.HUMAN`. You can only add human users when setting up a space + * (adding Chat apps is only supported for direct message setup with the + * calling app). You can also add members using the user's email as an alias + * for {user}. For example, the `user.name` can be `users/example@gmail.com`. + * To invite Gmail users or users from external Google Workspace domains, + * user's email must be used for `{user}`. * Optional when setting `Space.spaceType` to `SPACE`. * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at * least two memberships. @@ -110,14 +110,14 @@ class SetUpSpaceRequest extends \Google\Protobuf\Internal\Message * Optional. The Google Chat users to invite to join the space. Omit the * calling user, as they are added automatically. * The set currently allows up to 20 memberships (in addition to the caller). - * The `Membership.member` field must contain a `user` with `name` populated - * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only - * add human users when setting up a space (adding Chat apps is only supported - * for direct message setup with the calling app). You can also add members - * using the user's email as an alias for {user}. For example, the `user.name` - * can be `users/example@gmail.com`." To invite Gmail users or users from - * external Google Workspace domains, user's email must be used for - * `{user}`. + * For human membership, the `Membership.member` field must contain a `user` + * with `name` populated (format: `users/{user}`) and `type` set to + * `User.Type.HUMAN`. You can only add human users when setting up a space + * (adding Chat apps is only supported for direct message setup with the + * calling app). You can also add members using the user's email as an alias + * for {user}. For example, the `user.name` can be `users/example@gmail.com`. + * To invite Gmail users or users from external Google Workspace domains, + * user's email must be used for `{user}`. * Optional when setting `Space.spaceType` to `SPACE`. * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at * least two memberships. @@ -243,14 +243,14 @@ public function setRequestId($var) * Optional. The Google Chat users to invite to join the space. Omit the * calling user, as they are added automatically. * The set currently allows up to 20 memberships (in addition to the caller). - * The `Membership.member` field must contain a `user` with `name` populated - * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only - * add human users when setting up a space (adding Chat apps is only supported - * for direct message setup with the calling app). You can also add members - * using the user's email as an alias for {user}. For example, the `user.name` - * can be `users/example@gmail.com`." To invite Gmail users or users from - * external Google Workspace domains, user's email must be used for - * `{user}`. + * For human membership, the `Membership.member` field must contain a `user` + * with `name` populated (format: `users/{user}`) and `type` set to + * `User.Type.HUMAN`. You can only add human users when setting up a space + * (adding Chat apps is only supported for direct message setup with the + * calling app). You can also add members using the user's email as an alias + * for {user}. For example, the `user.name` can be `users/example@gmail.com`. + * To invite Gmail users or users from external Google Workspace domains, + * user's email must be used for `{user}`. * Optional when setting `Space.spaceType` to `SPACE`. * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at * least two memberships. @@ -272,14 +272,14 @@ public function getMemberships() * Optional. The Google Chat users to invite to join the space. Omit the * calling user, as they are added automatically. * The set currently allows up to 20 memberships (in addition to the caller). - * The `Membership.member` field must contain a `user` with `name` populated - * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only - * add human users when setting up a space (adding Chat apps is only supported - * for direct message setup with the calling app). You can also add members - * using the user's email as an alias for {user}. For example, the `user.name` - * can be `users/example@gmail.com`." To invite Gmail users or users from - * external Google Workspace domains, user's email must be used for - * `{user}`. + * For human membership, the `Membership.member` field must contain a `user` + * with `name` populated (format: `users/{user}`) and `type` set to + * `User.Type.HUMAN`. You can only add human users when setting up a space + * (adding Chat apps is only supported for direct message setup with the + * calling app). You can also add members using the user's email as an alias + * for {user}. For example, the `user.name` can be `users/example@gmail.com`. + * To invite Gmail users or users from external Google Workspace domains, + * user's email must be used for `{user}`. * Optional when setting `Space.spaceType` to `SPACE`. * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at * least two memberships. diff --git a/AppsChat/src/Chat/V1/Space.php b/AppsChat/src/Chat/V1/Space.php index 9164e82839b9..fdaa0a73a7cf 100644 --- a/AppsChat/src/Chat/V1/Space.php +++ b/AppsChat/src/Chat/V1/Space.php @@ -124,12 +124,11 @@ class Space extends \Google\Protobuf\Internal\Message */ protected $create_time = null; /** - * Output only. Whether the Chat app was installed by a Google Workspace - * administrator. Administrators can install a Chat app for their domain, - * organizational unit, or a group of users. - * Administrators can only install Chat apps for direct messaging between - * users and the app. To support admin install, your app must feature direct - * messaging. + * Output only. For direct message (DM) spaces with a Chat app, whether the + * space was created by a Google Workspace administrator. Administrators can + * install and set up a direct message with a Chat app on behalf of users in + * their organization. + * To support admin install, your Chat app must feature direct messaging. * * Generated from protobuf field bool admin_installed = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -199,12 +198,11 @@ class Space extends \Google\Protobuf\Internal\Message * creation time. * Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`. * @type bool $admin_installed - * Output only. Whether the Chat app was installed by a Google Workspace - * administrator. Administrators can install a Chat app for their domain, - * organizational unit, or a group of users. - * Administrators can only install Chat apps for direct messaging between - * users and the app. To support admin install, your app must feature direct - * messaging. + * Output only. For direct message (DM) spaces with a Chat app, whether the + * space was created by a Google Workspace administrator. Administrators can + * install and set up a direct message with a Chat app on behalf of users in + * their organization. + * To support admin install, your Chat app must feature direct messaging. * } */ public function __construct($data = NULL) { @@ -619,12 +617,11 @@ public function setCreateTime($var) } /** - * Output only. Whether the Chat app was installed by a Google Workspace - * administrator. Administrators can install a Chat app for their domain, - * organizational unit, or a group of users. - * Administrators can only install Chat apps for direct messaging between - * users and the app. To support admin install, your app must feature direct - * messaging. + * Output only. For direct message (DM) spaces with a Chat app, whether the + * space was created by a Google Workspace administrator. Administrators can + * install and set up a direct message with a Chat app on behalf of users in + * their organization. + * To support admin install, your Chat app must feature direct messaging. * * Generated from protobuf field bool admin_installed = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return bool @@ -635,12 +632,11 @@ public function getAdminInstalled() } /** - * Output only. Whether the Chat app was installed by a Google Workspace - * administrator. Administrators can install a Chat app for their domain, - * organizational unit, or a group of users. - * Administrators can only install Chat apps for direct messaging between - * users and the app. To support admin install, your app must feature direct - * messaging. + * Output only. For direct message (DM) spaces with a Chat app, whether the + * space was created by a Google Workspace administrator. Administrators can + * install and set up a direct message with a Chat app on behalf of users in + * their organization. + * To support admin install, your Chat app must feature direct messaging. * * Generated from protobuf field bool admin_installed = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param bool $var diff --git a/AppsEventsSubscriptions/.repo-metadata.json b/AppsEventsSubscriptions/.repo-metadata.json deleted file mode 100644 index fc82b08f9157..000000000000 --- a/AppsEventsSubscriptions/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/apps-events-subscriptions", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/apps-events-subscriptions/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "workspaceevents" -} diff --git a/AppsEventsSubscriptions/VERSION b/AppsEventsSubscriptions/VERSION index 17e51c385ea3..b1e80bb2480a 100644 --- a/AppsEventsSubscriptions/VERSION +++ b/AppsEventsSubscriptions/VERSION @@ -1 +1 @@ -0.1.1 +0.1.3 diff --git a/AppsEventsSubscriptions/composer.json b/AppsEventsSubscriptions/composer.json index 5d6771b7c21f..e2fbdacd2ea0 100644 --- a/AppsEventsSubscriptions/composer.json +++ b/AppsEventsSubscriptions/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AppsEventsSubscriptions/src/V1/Client/SubscriptionsServiceClient.php b/AppsEventsSubscriptions/src/V1/Client/SubscriptionsServiceClient.php index 24289981d332..cad8645a3030 100644 --- a/AppsEventsSubscriptions/src/V1/Client/SubscriptionsServiceClient.php +++ b/AppsEventsSubscriptions/src/V1/Client/SubscriptionsServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -42,6 +41,7 @@ use Google\Apps\Events\Subscriptions\V1\Subscription; use Google\Apps\Events\Subscriptions\V1\UpdateSubscriptionRequest; use Google\Auth\FetchAuthTokenInterface; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -154,6 +154,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a subscription * resource. diff --git a/AppsEventsSubscriptions/tests/Unit/V1/Client/SubscriptionsServiceClientTest.php b/AppsEventsSubscriptions/tests/Unit/V1/Client/SubscriptionsServiceClientTest.php index 7098b977aeb0..9854f0fee2c6 100644 --- a/AppsEventsSubscriptions/tests/Unit/V1/Client/SubscriptionsServiceClientTest.php +++ b/AppsEventsSubscriptions/tests/Unit/V1/Client/SubscriptionsServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Apps\Events\Subscriptions\V1\Client\SubscriptionsServiceClient; @@ -37,6 +36,7 @@ use Google\Apps\Events\Subscriptions\V1\ReactivateSubscriptionRequest; use Google\Apps\Events\Subscriptions\V1\Subscription; use Google\Apps\Events\Subscriptions\V1\UpdateSubscriptionRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/AppsMeet/.repo-metadata.json b/AppsMeet/.repo-metadata.json deleted file mode 100644 index 0666ab0d28e5..000000000000 --- a/AppsMeet/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/apps-meet", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/apps-meet/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "meet" -} diff --git a/AppsMeet/VERSION b/AppsMeet/VERSION index 0c62199f16ac..7179039691ce 100644 --- a/AppsMeet/VERSION +++ b/AppsMeet/VERSION @@ -1 +1 @@ -0.2.1 +0.2.3 diff --git a/AppsMeet/composer.json b/AppsMeet/composer.json index 43b15fcf9ec0..91528e57c9ee 100644 --- a/AppsMeet/composer.json +++ b/AppsMeet/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ArtifactRegistry/.OwlBot.yaml b/ArtifactRegistry/.OwlBot.yaml index 78bc291bec93..f38b4fcc4ae1 100644 --- a/ArtifactRegistry/.OwlBot.yaml +++ b/ArtifactRegistry/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/devtools/artifactregistry/(v1|v1beta2)/.*-php/(.*) + - source: /google/devtools/artifactregistry/(v1)/.*-php/(.*) dest: /owl-bot-staging/ArtifactRegistry/$1/$2 api-name: ArtifactRegistry diff --git a/ArtifactRegistry/.repo-metadata.json b/ArtifactRegistry/.repo-metadata.json deleted file mode 100644 index ceca690daeb6..000000000000 --- a/ArtifactRegistry/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-artifact-registry", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-artifact-registry/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "artifactregistry" -} diff --git a/ArtifactRegistry/README.md b/ArtifactRegistry/README.md index f77bb6a09ba5..7ebf410cf344 100644 --- a/ArtifactRegistry/README.md +++ b/ArtifactRegistry/README.md @@ -31,9 +31,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/ArtifactRegistry/VERSION b/ArtifactRegistry/VERSION index 844f6a91acb9..ef5e4454454d 100644 --- a/ArtifactRegistry/VERSION +++ b/ArtifactRegistry/VERSION @@ -1 +1 @@ -0.6.3 +0.6.5 diff --git a/ArtifactRegistry/composer.json b/ArtifactRegistry/composer.json index 971c62fac7f1..6497e5504367 100644 --- a/ArtifactRegistry/composer.json +++ b/ArtifactRegistry/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ArtifactRegistry/metadata/V1Beta2/AptArtifact.php b/ArtifactRegistry/metadata/V1Beta2/AptArtifact.php deleted file mode 100644 index e8b92d5640f499908b155ec62bc0e744568f21cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2259 zcmb_d-EJF26t3;mYQ||5Rsx*Ri>WE9E6T1K#Lb3+){bK=AhDbTsj$czkH^lyc4wKH z4GNXtfD43p2P9qsam!P{ZJ&ZO`{$LNs*#FsJUi!{@BDpd&c~ld=Mj1r_gTm!(QJw* zmsp=O97&-C6#<^avl)|^if0iIn6xoIIL1fEr?_`8IK2m^O2m>f7te*52h5qW3oS&T z93nNJ5vnDdbEV~_bMbh>G}&`Vq{q3?PW&Jgl4ndsgfiS8cD@9)Dbd95Cy@R@2I+e% zkp5SXI|gzeAsP^+uovlE2R%m^eo;ILIK@g64S)B!8uO5AP6GZDB>M!HaG2u znOg(LXSkil=(=k`KEYbXtn3|Q$#g8k{UmM!uqaOc6&3U%?jLd%OgrqHTyP;>cbU}^ zR-=geCs6ZPUF|6;-v^)YtXST3TGZwcXx1*WF}XcJ|2EM6Yw*izr^a?p zPCMscPEI=`=k8AChD6+vS=uQ{ci+xLGNO*@Rjg7$>(3f$l$d9|fi?`En-yGXZ+2?` zcr|MWZ2`N#Cv!GVMAfCp_m?t#8L?&!WOw#F`?@jPCExZi^>PY8g=Zq^IoFH=V_0)z z>G>_RX~tTFEY!`L%X3!Qr5HuzkZqsNNYId84P>6>~m0J{xs=+g10M$_wx33VMI732DYqdSydkPAMXJ{@r|Kkm+^j9M5lgP1qqX*?^(MLnX-2UAMqR5eXEZ?%4{pq+J)5&I!#N?YF` zG^c8u4pL&#*y~-t$LqjFbf4X@?x1=^q-kTyxm&27I%@r1xhk`sltK=|nOF(SSpSb< z-9tB-@sy=&<>|r%+3D-hSw{L-1?{e92~Q6YR59xdbi3TLv=@!Nk8;dcj&^xWtTR+k zA~U_Ky>7}yHCuPDN+Dloo!_eH5%Buj5qGvrY)lr+u=4d84MaT6G0d3E#rm#=87kK8 z%F>J``>TT&P5!99*H4zM-A&;0K^bMs+s-!a-?^UeCyIWtlXFcUmU6P^UsT&Er0XWC muDc5Ax|!;v4l}LAhYyNp|53W~N*nT}+cD8hch~|g5c&_THuk*$ diff --git a/ArtifactRegistry/metadata/V1Beta2/File.php b/ArtifactRegistry/metadata/V1Beta2/File.php deleted file mode 100644 index 012ac3638d8dcc82e361cf0cfa6a8b08a598a9d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1825 zcmbVNQEwAR5Uw4^;0+DoBvh9Nx^;sv65I(RTIoVS4mM7tl30nUM0Jw2K98L(m)q^_ zUZ{)w6L{x0^r!T>zk|EO9i@{ABs3H!l1GrZly(m2{=tBDJ9~p~(N&2w3BjjRA*K;{V>s19M9O1{ z<`Wj`1g2c+WagdTAAx2qZ-O|k#U~_YC!iz?f%f`4&++w`X%_S>RM5$wg7!J6;HUdL z25O6tFk(v4X9!8&5Q;yUjv^jXrJ2URO|FJK=9;sJ|Blsd(+P_dpyRUbB#lGOMNEyu zK^#K!4qadx+f9j8p?{uS-w=f41beZDBxVt&tHOj!Es{Q(`u-GjL901w-pRrmI6k4x zMUK9|l;k$mNeXA9Q<{KIlX%PKZ2;!QU2p+)ZOMZ}$XernDCmR#MP5Zs1CDLc>_qw( z`dTjTJ?2^E?eVxM)O4a*q-GMmP5!=29(=}hIL(EVn~#)xex%%Nq;7nZ!P}|Arg%Cp zU@>TocO_EUW$M`Jl8T;5sF!G|x!(H0{l6hx<83bkba%catEVhVpzSuwNcc1P(+v|2VzHkVs9__YU55M0iIhV-F^UlMKa^tTusTkIr zE2Lu9!KPMo&{*Nf4o5Q$s=k6@R-DJAdW>Q4xk6W(Yc2QF(sw+v7AAmeJ~aH)R}plr zbt4DK$#aYD8;4ZlN@fn#k2)YP;x$T1{Suni{Mq~VDcM|V+k$i^xpGlgJX`%fhW`aZ zt-Lqc-Q0^rh+8aTJj-wAUIJ1mj$6h7&x@zo+zJaGO_0oa<0aYn5p~C4t3&uT#d&tt zNma50Vx4h}&uEP6i+p0b&NWh#Yzjj|yzT6&X@fn|;uXZU4YkHAa_tPXl9(Vk+ho-Q zRtWuxtuZM&Uy-XZ{HBLzf|=2(HExpi9@sMSD*iPmJ8#S6E|Qox@uR!4Q#0}UM!ou_ zpI?NLNXNOeX~tA6D>rs37w_}El%uWXqd&^GdRD^Srxw1Q>GxswDR49W{xi1=0&5r) zN}pQ>DE0QM@xI(#K>EHl_5JgpzMq+ns&internalAddGeneratedFile( - ' -œ -6google/devtools/artifactregistry/v1beta2/package.proto(google.devtools.artifactregistry.v1beta2" -Package -name (  - display_name ( / - create_time ( 2.google.protobuf.Timestamp/ - update_time ( 2.google.protobuf.Timestamp"L -ListPackagesRequest -parent (  - page_size ( - -page_token ( "t -ListPackagesResponseC -packages ( 21.google.devtools.artifactregistry.v1beta2.Package -next_page_token ( "! -GetPackageRequest -name ( "$ -DeletePackageRequest -name ( B -,com.google.devtools.artifactregistry.v1beta2B PackageProtoPZUcloud.google.com/go/artifactregistry/apiv1beta2/artifactregistrypb;artifactregistrypbª%Google.Cloud.ArtifactRegistry.V1Beta2Ê%Google\\Cloud\\ArtifactRegistry\\V1beta2ê(Google::Cloud::ArtifactRegistry::V1beta2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/ArtifactRegistry/metadata/V1Beta2/Repository.php b/ArtifactRegistry/metadata/V1Beta2/Repository.php deleted file mode 100644 index 71849a2a044618ba345e9a5372787156002a587e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3046 zcmb_e&2k$>5RT+nwp(_rED2V8fQ<+hg>qIE!vWR=va)4cjwNl$vMUA^Tcg!TUcA~_ zc1I2(<>JB{z*BJM!i5LmDLCf|C{Faw{>ZVMievD_tEuj9;K^+rpsY*br!(bZ=|&!no{XRL42 zQkR}^#%#YtJZ|-f$vxV)eC~}(CyzRmlhu+(UFKVyc_T$c0dUBG`Yti4yrq|GXw)T~ zw6_Fcdm{pDYv%yl2an1D;2MBw6W^Dc2{60>8UNg2$F@w_=Y-?GdzNolj>RovTR&i> zkL4b*eTwdrw!NWaa*H`~;LvbPT6`dfn1Ss*7b`^nI7K}m3yEr19Zo%m*qF3$dX|et z>S(H}eaaJxgOlQeC~N>{_2gohqpD6M`B>)Oke-b$%O2%J&sh_B2LPwZSNj42HP>oy zTGZ~A=@B`xn5U}as>UF%b8XV-hA-`v&>^DMh<|+fh>35@LQQZoa4+^1SMcx)DcISfoKVLwnbWiS`8hdN%&zVzm(5lgV=1)& zX#9I!AZ}li=HYtKo%s}E&q+@q(_`L%@O&D7-&kF{Qmjn@A-x0HZqz2&Y56G;L5GY@ zI@I>_*X1d!=E;>J>s;A%FgWclwD+`f=i=`P$Mw#}X!zC&F9h;f6RQ17{Caq0`AXC)VI;E|8K z7%syZHi`&;7U%s&DZcS?m4h&VF7OLGu<*)(^d2l9RGNF$M%~aGyVdnWW52$qSJtbW z)yhWhnv{i^W@Wdc?NxFql*#N~UDNlr8?9V=`5|P_-ar>(8e&8g{6 zQ-yCJ6G`G-kTx65n$|iO3m~)6Sbth+VyHQou4xCAdM+)^z*JqY<)(rUO>gCMQuVmB!+iG*rd6)Z~8YMf7!AvYCmm2y^f( z{yfDNkDfA%;(79GbXs17g|Jhi<}Cb_f~8%22$L}A(xl%FamYz!$hgF#4i7mhul}W_ z|It>Yx5@b?%(qPuz-Crc_s^ZHA*mzuNdXbcnh8$QABoiavmmccj0ST+MqV& zbTX^|d}-yM)3AcwcWI547spxX!P=##zS=i!Htfa_K`-~&_k8 z{o$6_K$Ud?uSM%;GumgBX#M;%wrjVAVLMq=W6L&fs$%thnJ$KqswzxX^*pGmMy8#N dc$q%FpDZ#f;UaiuZ+z{}C@jOx?i5Y|{smEP`!fIl diff --git a/ArtifactRegistry/metadata/V1Beta2/Service.php b/ArtifactRegistry/metadata/V1Beta2/Service.php deleted file mode 100644 index cb70b939582a..000000000000 --- a/ArtifactRegistry/metadata/V1Beta2/Service.php +++ /dev/null @@ -1,78 +0,0 @@ -internalAddGeneratedFile( - ' -Ù7 -6google/devtools/artifactregistry/v1beta2/service.proto(google.devtools.artifactregistry.v1beta2google/api/client.proto;google/devtools/artifactregistry/v1beta2/apt_artifact.proto3google/devtools/artifactregistry/v1beta2/file.proto6google/devtools/artifactregistry/v1beta2/package.proto9google/devtools/artifactregistry/v1beta2/repository.proto7google/devtools/artifactregistry/v1beta2/settings.proto2google/devtools/artifactregistry/v1beta2/tag.proto6google/devtools/artifactregistry/v1beta2/version.proto;google/devtools/artifactregistry/v1beta2/yum_artifact.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto" -OperationMetadata2æ/ -ArtifactRegistryß -ImportAptArtifactsC.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest.google.longrunning.Operation"äÊAŠ -Cgoogle.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponseCgoogle.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata‚Óä“P"K/v1beta2/{parent=projects/*/locations/*/repositories/*}/aptArtifacts:import:*ß -ImportYumArtifactsC.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest.google.longrunning.Operation"äÊAŠ -Cgoogle.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponseCgoogle.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata‚Óä“P"K/v1beta2/{parent=projects/*/locations/*/repositories/*}/yumArtifacts:import:*á -ListRepositoriesA.google.devtools.artifactregistry.v1beta2.ListRepositoriesRequestB.google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse"FÚAparent‚Óä“75/v1beta2/{parent=projects/*/locations/*}/repositoriesË - GetRepository>.google.devtools.artifactregistry.v1beta2.GetRepositoryRequest4.google.devtools.artifactregistry.v1beta2.Repository"DÚAname‚Óä“75/v1beta2/{name=projects/*/locations/*/repositories/*}Ö -CreateRepositoryA.google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest.google.longrunning.Operation"ßÊAq -3google.devtools.artifactregistry.v1beta2.Repository:google.devtools.artifactregistry.v1beta2.OperationMetadataÚAparent,repository,repository_id‚Óä“C"5/v1beta2/{parent=projects/*/locations/*}/repositories: -repositoryú -UpdateRepositoryA.google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest4.google.devtools.artifactregistry.v1beta2.Repository"mÚArepository,update_mask‚Óä“N2@/v1beta2/{repository.name=projects/*/locations/*/repositories/*}: -repository‘ -DeleteRepositoryA.google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest.google.longrunning.Operation"šÊAS -google.protobuf.Empty:google.devtools.artifactregistry.v1beta2.OperationMetadataÚAname‚Óä“7*5/v1beta2/{name=projects/*/locations/*/repositories/*}à - ListPackages=.google.devtools.artifactregistry.v1beta2.ListPackagesRequest>.google.devtools.artifactregistry.v1beta2.ListPackagesResponse"QÚAparent‚Óä“B@/v1beta2/{parent=projects/*/locations/*/repositories/*}/packagesÍ - -GetPackage;.google.devtools.artifactregistry.v1beta2.GetPackageRequest1.google.devtools.artifactregistry.v1beta2.Package"OÚAname‚Óä“B@/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*}– - DeletePackage>.google.devtools.artifactregistry.v1beta2.DeletePackageRequest.google.longrunning.Operation"¥ÊAS -google.protobuf.Empty:google.devtools.artifactregistry.v1beta2.OperationMetadataÚAname‚Óä“B*@/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*}ë - ListVersions=.google.devtools.artifactregistry.v1beta2.ListVersionsRequest>.google.devtools.artifactregistry.v1beta2.ListVersionsResponse"\\ÚAparent‚Óä“MK/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/versionsØ - -GetVersion;.google.devtools.artifactregistry.v1beta2.GetVersionRequest1.google.devtools.artifactregistry.v1beta2.Version"ZÚAname‚Óä“MK/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}¡ - DeleteVersion>.google.devtools.artifactregistry.v1beta2.DeleteVersionRequest.google.longrunning.Operation"°ÊAS -google.protobuf.Empty:google.devtools.artifactregistry.v1beta2.OperationMetadataÚAname‚Óä“M*K/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}Ô - ListFiles:.google.devtools.artifactregistry.v1beta2.ListFilesRequest;.google.devtools.artifactregistry.v1beta2.ListFilesResponse"NÚAparent‚Óä“?=/v1beta2/{parent=projects/*/locations/*/repositories/*}/files -GetFile8.google.devtools.artifactregistry.v1beta2.GetFileRequest..google.devtools.artifactregistry.v1beta2.File"MÚAname‚Óä“@>/v1beta2/{name=projects/*/locations/*/repositories/*/files/**}Û -ListTags9.google.devtools.artifactregistry.v1beta2.ListTagsRequest:.google.devtools.artifactregistry.v1beta2.ListTagsResponse"XÚAparent‚Óä“IG/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/tagsÈ -GetTag7.google.devtools.artifactregistry.v1beta2.GetTagRequest-.google.devtools.artifactregistry.v1beta2.Tag"VÚAname‚Óä“IG/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}à - CreateTag:.google.devtools.artifactregistry.v1beta2.CreateTagRequest-.google.devtools.artifactregistry.v1beta2.Tag"hÚAparent,tag,tag_id‚Óä“N"G/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/tags:tagâ - UpdateTag:.google.devtools.artifactregistry.v1beta2.UpdateTagRequest-.google.devtools.artifactregistry.v1beta2.Tag"jÚAtag,update_mask‚Óä“R2K/v1beta2/{tag.name=projects/*/locations/*/repositories/*/packages/*/tags/*}:tag· - DeleteTag:.google.devtools.artifactregistry.v1beta2.DeleteTagRequest.google.protobuf.Empty"VÚAname‚Óä“I*G/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}œ - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"Q‚Óä“K"F/v1beta2/{resource=projects/*/locations/*/repositories/*}:setIamPolicy:*™ - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"N‚Óä“HF/v1beta2/{resource=projects/*/locations/*/repositories/*}:getIamPolicy -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"W‚Óä“Q"L/v1beta2/{resource=projects/*/locations/*/repositories/*}:testIamPermissions:*Ï -GetProjectSettingsC.google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest9.google.devtools.artifactregistry.v1beta2.ProjectSettings"9ÚAname‚Óä“,*/v1beta2/{name=projects/*/projectSettings} -UpdateProjectSettingsF.google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest9.google.devtools.artifactregistry.v1beta2.ProjectSettings"tÚAproject_settings,update_mask‚Óä“O2;/v1beta2/{project_settings.name=projects/*/projectSettings}:project_settingsŒÊAartifactregistry.googleapis.comÒAghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB -,com.google.devtools.artifactregistry.v1beta2B ServiceProtoPZUcloud.google.com/go/artifactregistry/apiv1beta2/artifactregistrypb;artifactregistrypbª%Google.Cloud.ArtifactRegistry.V1Beta2Ê%Google\\Cloud\\ArtifactRegistry\\V1beta2ê(Google::Cloud::ArtifactRegistry::V1beta2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/ArtifactRegistry/metadata/V1Beta2/Settings.php b/ArtifactRegistry/metadata/V1Beta2/Settings.php deleted file mode 100644 index 8ea9e61479a6d64dbb5d11c8b35af5ade54db9b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1869 zcmbVN%Wl&^6eTG_Fy&Esl~y38X{!dQ*lJi*xD@0(Wz;579tc&Itcf#82VC2X$CXOe zkLW)jA@M2v0vp!-1Xhg4k48=-O0$VII``ar&%JZz%{%YN18cB}9ZV6!BRD*T>U<) zi%~owKBK3~$@UO4R91Y<7;z@PEOG$gpkwTN$ilGMsT^>~2r*~RzPx({}4xnNQ$3Y3%0l(U;D z$D6sb9H&4YQE1$Hw52P_dW)Uq<5tF@s^&3oFhUeB7QhqU{U>a(WEG`{;BL6xg&fS4 z9!NGQ*m#1hQebpWR!jc)tEY*xFb-ZpD`Ppj;6R8Cq0&*!1) ztq7EtHo)pUP(yEN`}!g0T2Mb;Y6CFi7qJw47QW2gN69oS75OMav3=z%{yJCUk3|3C z5G*$_%S3kZmjL@rs!tE6vh!QZ|IxPpyN=?w9C$kLxM$%xd3sNXC{dBO#oSKraA4VPFiHr* zkxbl~sVRJ3iP2~8nK#^>J^GQ~XbP*BtAal9`ELAd$g$7=OmK!FfJXWvBuIll3F3vh q%$FicRTWTG&628W3?1GRQoY(t{bnoj+$oEmYtI51ndmt<2jDN~N_xZq diff --git a/ArtifactRegistry/metadata/V1Beta2/Tag.php b/ArtifactRegistry/metadata/V1Beta2/Tag.php deleted file mode 100644 index 5469e3cf6a1f..000000000000 --- a/ArtifactRegistry/metadata/V1Beta2/Tag.php +++ /dev/null @@ -1,53 +0,0 @@ -internalAddGeneratedFile( - ' -Á -2google/devtools/artifactregistry/v1beta2/tag.proto(google.devtools.artifactregistry.v1beta2 google/protobuf/field_mask.proto"± -Tag -name (  -version ( :ŠêA† -#artifactregistry.googleapis.com/Tag_projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}"X -ListTagsRequest -parent (  -filter (  - page_size ( - -page_token ( "h -ListTagsResponse; -tags ( 2-.google.devtools.artifactregistry.v1beta2.Tag -next_page_token ( " - GetTagRequest -name ( "n -CreateTagRequest -parent (  -tag_id ( : -tag ( 2-.google.devtools.artifactregistry.v1beta2.Tag" -UpdateTagRequest: -tag ( 2-.google.devtools.artifactregistry.v1beta2.Tag/ - update_mask ( 2.google.protobuf.FieldMask" -DeleteTagRequest -name ( BŒ -,com.google.devtools.artifactregistry.v1beta2BTagProtoPZUcloud.google.com/go/artifactregistry/apiv1beta2/artifactregistrypb;artifactregistrypbª%Google.Cloud.ArtifactRegistry.V1Beta2Ê%Google\\Cloud\\ArtifactRegistry\\V1beta2ê(Google::Cloud::ArtifactRegistry::V1beta2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/ArtifactRegistry/metadata/V1Beta2/Version.php b/ArtifactRegistry/metadata/V1Beta2/Version.php deleted file mode 100644 index 6fa2151082d0bf0c40580c0e2fc3b6b3c55c066a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2339 zcmbVO+iu%N5UnKJkydW%Fe#!M0lHOESP2pmcF;c1O0&<_Wzz4|`3~2w1 zsuQ4r6iT?lqy6!42$H(uG~gaclhVdM-P=E+%|`p^8#E2YSh`@-kq{#ftN~1v5MF38 zsrZn&O2UYTN}gGh%|0l$WlcbaT=-_}f)JmbLKrX?Xsc6ujv51|nA3{UoQ6hos&i;g zce56uZ4=^pEDUKkK_zbp#ZNHqd)%d=VhX<=@UX{yt~m4f@0jB=I%Hl5XuGI89Q&@q z@MvVP@4HZWNE6IR_d$TUp?w-(C!z@{a@xKE=`#-_4qeFuC1eLxZF>Z2Ms6gjJk)L@ zI6kD6Bu3j_2=W?>OIKE zObHa9AXotch@IX@nz9*^~}v+ge3~)zjNe<9xY>)EJedw%Fs-uVB99ff$nu2mr^bkTBPVoz(vxFfJ)0K zEN-oviI)TtV=!lBG0S?c{c?}c`}optL6Ty=Ip;R@2Y=hh_kU!wInmFRcPXhv{I@@2=fA56ZfVCIZ>o{=(PM#hTPu8{i+>@2k_e% zJKnfSRstr$SGroaNFhM9UWf~@l*N>n4TF$aq{K@|>sKdB6ArIROQ>;k>${Yc%URX_ zyJ&2DN%BGtK=%4)aR(G45;J8*?tB<&7$6y7)Ja~a6JoGYH8(%muW^@r;lpdyJC{+E zWuZJIw_1?Wld|(+C#OkA2G>ox{FK~jfCmaR6BoPsoGcFop3Ard`A0vK;(6lkky5vL zaM<48>vh}BUwX%Thn;4%H@wSM5=h&QRc(77)V8&1ec<8qbcMf%VQX zGaFPp3pc%;ubiL|72+9m0ddW7yjp9N*KXlEnfO2hJFqg~SfXxneAo zHWG?X5mtiCs8nKMpFf@ug?8*kJRcWAEA<0FgyuwYgbC~qy>GQzfE4okDWt!bL;CIo zNdLRXUIMub01lCq@HCzmI^Y$6`p4r*NHLTODgAe!$}x?oq9~-l=wzS4DGDXg_UpRS zIKqmu2qp%H5hk67FvCoA?{l4`wl88FCiT*_@&}P3B0`~#T4F)DVq&OO9cM;VS>@!W z^DuXtz|kq}WHCCwRcd$R`?QLE&0cd!G19x<~X(Z>P!;?|B zw^?(3HQu}%czsgTbJ7idoD2w!6aa`&Sa3-l9 zAxiXp`L$Rkk4Q1;TB5(oCuQ08z{i6*XF^qc%08Ay=}Tqa1RJrSQn#nxxnX_;ZpD&} zf2Lu8kqBffY0dTaZwA;}2N{u{Vj`9K0)QEo<7_HYi{?)6>J3{5E~ESEnt2;EI1(gM zIf1T&M&_vfhjCeEJt3GFL{oMltb~5=F|2#w1Cn^k(>059^*C7BsC%nO|2Dw(dY1Yf z;kv`b{07{rwk+#KbLWc!^MB{G%6anyG}6eD-qqhV<+7UXyO*U<>?ZH`8hE66edUO~ z%?caSZ80>yKfxi3g90NNlNnoIoO*_e-Fb1!_+)qe>d)Gz{d99$-4wnUlu^Ekt$c0% zQ|S4As_2&sw$SwThE13Dn_4G>bevSxaV~;7POds>=$TgR$%FC@f0XU7%DQ{&s!KJq Kg|q}q0R97rpz8Jj diff --git a/ArtifactRegistry/owlbot.py b/ArtifactRegistry/owlbot.py index 59e026157de7..7b55f4029e03 100644 --- a/ArtifactRegistry/owlbot.py +++ b/ArtifactRegistry/owlbot.py @@ -20,42 +20,37 @@ import synthtool as s from synthtool.languages import php +from synthtool import _tracked_paths logging.basicConfig(level=logging.DEBUG) src = Path(f"../{php.STAGING_DIR}/ArtifactRegistry").resolve() dest = Path().resolve() -php.owlbot_main(src=src, dest=dest) - -# Change the wording for the deprecation warning. -s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes +php.owlbot_main(src=src, dest=dest) -# fix relative cloud.google.com links +# remove class_alias code s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/ArtifactRegistry/src/V1/AptArtifact.php b/ArtifactRegistry/src/V1/AptArtifact.php index e65566777c88..d9ae52ba014a 100644 --- a/ArtifactRegistry/src/V1/AptArtifact.php +++ b/ArtifactRegistry/src/V1/AptArtifact.php @@ -22,37 +22,37 @@ class AptArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The Apt package name of the artifact. * * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $package_name = ''; + protected $package_name = ''; /** * Output only. An artifact is a binary or source package. * * Generated from protobuf field .google.devtools.artifactregistry.v1.AptArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $package_type = 0; + protected $package_type = 0; /** * Output only. Operating system architecture of the artifact. * * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $architecture = ''; + protected $architecture = ''; /** * Output only. Repository component of the artifact. * * Generated from protobuf field string component = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $component = ''; + protected $component = ''; /** * Output only. Contents of the artifact's control metadata file. * * Generated from protobuf field bytes control_file = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $control_file = ''; + protected $control_file = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/AptArtifact/PackageType.php b/ArtifactRegistry/src/V1/AptArtifact/PackageType.php index cc6369f933a6..503acc22046d 100644 --- a/ArtifactRegistry/src/V1/AptArtifact/PackageType.php +++ b/ArtifactRegistry/src/V1/AptArtifact/PackageType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PackageType::class, \Google\Cloud\ArtifactRegistry\V1\AptArtifact_PackageType::class); diff --git a/ArtifactRegistry/src/V1/ArtifactRegistryGrpcClient.php b/ArtifactRegistry/src/V1/ArtifactRegistryGrpcClient.php deleted file mode 100644 index 7fd278964b2f..000000000000 --- a/ArtifactRegistry/src/V1/ArtifactRegistryGrpcClient.php +++ /dev/null @@ -1,583 +0,0 @@ -_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListDockerImages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListDockerImagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a docker image. - * @param \Google\Cloud\ArtifactRegistry\V1\GetDockerImageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetDockerImage(\Google\Cloud\ArtifactRegistry\V1\GetDockerImageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetDockerImage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\DockerImage', 'decode'], - $metadata, $options); - } - - /** - * Lists maven artifacts. - * @param \Google\Cloud\ArtifactRegistry\V1\ListMavenArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMavenArtifacts(\Google\Cloud\ArtifactRegistry\V1\ListMavenArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListMavenArtifacts', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListMavenArtifactsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a maven artifact. - * @param \Google\Cloud\ArtifactRegistry\V1\GetMavenArtifactRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMavenArtifact(\Google\Cloud\ArtifactRegistry\V1\GetMavenArtifactRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetMavenArtifact', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\MavenArtifact', 'decode'], - $metadata, $options); - } - - /** - * Lists npm packages. - * @param \Google\Cloud\ArtifactRegistry\V1\ListNpmPackagesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListNpmPackages(\Google\Cloud\ArtifactRegistry\V1\ListNpmPackagesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListNpmPackages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListNpmPackagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a npm package. - * @param \Google\Cloud\ArtifactRegistry\V1\GetNpmPackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetNpmPackage(\Google\Cloud\ArtifactRegistry\V1\GetNpmPackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetNpmPackage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\NpmPackage', 'decode'], - $metadata, $options); - } - - /** - * Lists python packages. - * @param \Google\Cloud\ArtifactRegistry\V1\ListPythonPackagesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPythonPackages(\Google\Cloud\ArtifactRegistry\V1\ListPythonPackagesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListPythonPackages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListPythonPackagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a python package. - * @param \Google\Cloud\ArtifactRegistry\V1\GetPythonPackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetPythonPackage(\Google\Cloud\ArtifactRegistry\V1\GetPythonPackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetPythonPackage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\PythonPackage', 'decode'], - $metadata, $options); - } - - /** - * Imports Apt artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * @param \Google\Cloud\ArtifactRegistry\V1\ImportAptArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportAptArtifacts(\Google\Cloud\ArtifactRegistry\V1\ImportAptArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportAptArtifacts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Imports Yum (RPM) artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * @param \Google\Cloud\ArtifactRegistry\V1\ImportYumArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportYumArtifacts(\Google\Cloud\ArtifactRegistry\V1\ImportYumArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportYumArtifacts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists repositories. - * @param \Google\Cloud\ArtifactRegistry\V1\ListRepositoriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListRepositories(\Google\Cloud\ArtifactRegistry\V1\ListRepositoriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListRepositories', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListRepositoriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a repository. - * @param \Google\Cloud\ArtifactRegistry\V1\GetRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetRepository(\Google\Cloud\ArtifactRegistry\V1\GetRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetRepository', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Repository', 'decode'], - $metadata, $options); - } - - /** - * Creates a repository. The returned Operation will finish once the - * repository has been created. Its response will be the created Repository. - * @param \Google\Cloud\ArtifactRegistry\V1\CreateRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateRepository(\Google\Cloud\ArtifactRegistry\V1\CreateRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/CreateRepository', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a repository. - * @param \Google\Cloud\ArtifactRegistry\V1\UpdateRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateRepository(\Google\Cloud\ArtifactRegistry\V1\UpdateRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateRepository', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Repository', 'decode'], - $metadata, $options); - } - - /** - * Deletes a repository and all of its contents. The returned Operation will - * finish once the repository has been deleted. It will not have any Operation - * metadata and will return a google.protobuf.Empty response. - * @param \Google\Cloud\ArtifactRegistry\V1\DeleteRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteRepository(\Google\Cloud\ArtifactRegistry\V1\DeleteRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteRepository', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists packages. - * @param \Google\Cloud\ArtifactRegistry\V1\ListPackagesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPackages(\Google\Cloud\ArtifactRegistry\V1\ListPackagesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListPackages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListPackagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a package. - * @param \Google\Cloud\ArtifactRegistry\V1\GetPackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetPackage(\Google\Cloud\ArtifactRegistry\V1\GetPackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetPackage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Package', 'decode'], - $metadata, $options); - } - - /** - * Deletes a package and all of its versions and tags. The returned operation - * will complete once the package has been deleted. - * @param \Google\Cloud\ArtifactRegistry\V1\DeletePackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeletePackage(\Google\Cloud\ArtifactRegistry\V1\DeletePackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/DeletePackage', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists versions. - * @param \Google\Cloud\ArtifactRegistry\V1\ListVersionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListVersions(\Google\Cloud\ArtifactRegistry\V1\ListVersionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListVersions', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListVersionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a version - * @param \Google\Cloud\ArtifactRegistry\V1\GetVersionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetVersion(\Google\Cloud\ArtifactRegistry\V1\GetVersionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetVersion', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Version', 'decode'], - $metadata, $options); - } - - /** - * Deletes a version and all of its content. The returned operation will - * complete once the version has been deleted. - * @param \Google\Cloud\ArtifactRegistry\V1\DeleteVersionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteVersion(\Google\Cloud\ArtifactRegistry\V1\DeleteVersionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteVersion', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists files. - * @param \Google\Cloud\ArtifactRegistry\V1\ListFilesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFiles(\Google\Cloud\ArtifactRegistry\V1\ListFilesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListFiles', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListFilesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a file. - * @param \Google\Cloud\ArtifactRegistry\V1\GetFileRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFile(\Google\Cloud\ArtifactRegistry\V1\GetFileRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetFile', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\File', 'decode'], - $metadata, $options); - } - - /** - * Lists tags. - * @param \Google\Cloud\ArtifactRegistry\V1\ListTagsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTags(\Google\Cloud\ArtifactRegistry\V1\ListTagsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListTags', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListTagsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a tag. - * @param \Google\Cloud\ArtifactRegistry\V1\GetTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTag(\Google\Cloud\ArtifactRegistry\V1\GetTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Tag', 'decode'], - $metadata, $options); - } - - /** - * Creates a tag. - * @param \Google\Cloud\ArtifactRegistry\V1\CreateTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTag(\Google\Cloud\ArtifactRegistry\V1\CreateTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/CreateTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Tag', 'decode'], - $metadata, $options); - } - - /** - * Updates a tag. - * @param \Google\Cloud\ArtifactRegistry\V1\UpdateTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTag(\Google\Cloud\ArtifactRegistry\V1\UpdateTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Tag', 'decode'], - $metadata, $options); - } - - /** - * Deletes a tag. - * @param \Google\Cloud\ArtifactRegistry\V1\DeleteTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTag(\Google\Cloud\ArtifactRegistry\V1\DeleteTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteTag', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Updates the IAM policy for a given resource. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Gets the IAM policy for a given resource. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Tests if the caller has a list of permissions on a resource. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves the Settings for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1\GetProjectSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetProjectSettings(\Google\Cloud\ArtifactRegistry\V1\GetProjectSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetProjectSettings', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ProjectSettings', 'decode'], - $metadata, $options); - } - - /** - * Updates the Settings for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1\UpdateProjectSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateProjectSettings(\Google\Cloud\ArtifactRegistry\V1\UpdateProjectSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateProjectSettings', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ProjectSettings', 'decode'], - $metadata, $options); - } - - /** - * Retrieves the VPCSC Config for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1\GetVPCSCConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetVPCSCConfig(\Google\Cloud\ArtifactRegistry\V1\GetVPCSCConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetVPCSCConfig', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\VPCSCConfig', 'decode'], - $metadata, $options); - } - - /** - * Updates the VPCSC Config for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1\UpdateVPCSCConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateVPCSCConfig(\Google\Cloud\ArtifactRegistry\V1\UpdateVPCSCConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateVPCSCConfig', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\VPCSCConfig', 'decode'], - $metadata, $options); - } - -} diff --git a/ArtifactRegistry/src/V1/BatchDeleteVersionsRequest.php b/ArtifactRegistry/src/V1/BatchDeleteVersionsRequest.php index a5c0ce417dcd..723201eacaeb 100644 --- a/ArtifactRegistry/src/V1/BatchDeleteVersionsRequest.php +++ b/ArtifactRegistry/src/V1/BatchDeleteVersionsRequest.php @@ -20,7 +20,7 @@ class BatchDeleteVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The names of the versions to delete. * A maximum of 10000 versions can be deleted in a batch. @@ -33,7 +33,7 @@ class BatchDeleteVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool validate_only = 3; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent The name of the repository holding all requested versions. diff --git a/ArtifactRegistry/src/V1/CleanupPolicy.php b/ArtifactRegistry/src/V1/CleanupPolicy.php index 9be654cb0c45..4b2b630b4d61 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicy.php +++ b/ArtifactRegistry/src/V1/CleanupPolicy.php @@ -20,13 +20,13 @@ class CleanupPolicy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * Policy action. * * Generated from protobuf field .google.devtools.artifactregistry.v1.CleanupPolicy.Action action = 3; */ - private $action = 0; + protected $action = 0; protected $condition_type; /** diff --git a/ArtifactRegistry/src/V1/CleanupPolicy/Action.php b/ArtifactRegistry/src/V1/CleanupPolicy/Action.php index e879ac0ca239..32d26e285052 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicy/Action.php +++ b/ArtifactRegistry/src/V1/CleanupPolicy/Action.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Action::class, \Google\Cloud\ArtifactRegistry\V1\CleanupPolicy_Action::class); diff --git a/ArtifactRegistry/src/V1/CleanupPolicyCondition.php b/ArtifactRegistry/src/V1/CleanupPolicyCondition.php index 884037598baf..768afa66b916 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicyCondition.php +++ b/ArtifactRegistry/src/V1/CleanupPolicyCondition.php @@ -22,7 +22,7 @@ class CleanupPolicyCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional .google.devtools.artifactregistry.v1.CleanupPolicyCondition.TagState tag_state = 2; */ - private $tag_state = null; + protected $tag_state = null; /** * Match versions by tag prefix. Applied on any prefix match. * @@ -46,13 +46,13 @@ class CleanupPolicyCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional .google.protobuf.Duration older_than = 6; */ - private $older_than = null; + protected $older_than = null; /** * Match versions newer than a duration. * * Generated from protobuf field optional .google.protobuf.Duration newer_than = 7; */ - private $newer_than = null; + protected $newer_than = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/CleanupPolicyCondition/TagState.php b/ArtifactRegistry/src/V1/CleanupPolicyCondition/TagState.php index 9a02a60e43c3..603ecfb2cce3 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicyCondition/TagState.php +++ b/ArtifactRegistry/src/V1/CleanupPolicyCondition/TagState.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TagState::class, \Google\Cloud\ArtifactRegistry\V1\CleanupPolicyCondition_TagState::class); diff --git a/ArtifactRegistry/src/V1/CleanupPolicyMostRecentVersions.php b/ArtifactRegistry/src/V1/CleanupPolicyMostRecentVersions.php index 256703149a3c..7177ec80be40 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicyMostRecentVersions.php +++ b/ArtifactRegistry/src/V1/CleanupPolicyMostRecentVersions.php @@ -27,7 +27,7 @@ class CleanupPolicyMostRecentVersions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int32 keep_count = 2; */ - private $keep_count = null; + protected $keep_count = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php b/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php index 7699e6fbee63..8ef0e0bde17b 100644 --- a/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php +++ b/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a docker_image * resource. @@ -243,8 +264,12 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted docker_image resource. */ - public static function dockerImageName(string $project, string $location, string $repository, string $dockerImage): string - { + public static function dockerImageName( + string $project, + string $location, + string $repository, + string $dockerImage + ): string { return self::getPathTemplate('dockerImage')->render([ 'project' => $project, 'location' => $location, @@ -302,8 +327,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted maven_artifact resource. */ - public static function mavenArtifactName(string $project, string $location, string $repository, string $mavenArtifact): string - { + public static function mavenArtifactName( + string $project, + string $location, + string $repository, + string $mavenArtifact + ): string { return self::getPathTemplate('mavenArtifact')->render([ 'project' => $project, 'location' => $location, @@ -323,8 +352,12 @@ public static function mavenArtifactName(string $project, string $location, stri * * @return string The formatted npm_package resource. */ - public static function npmPackageName(string $project, string $location, string $repository, string $npmPackage): string - { + public static function npmPackageName( + string $project, + string $location, + string $repository, + string $npmPackage + ): string { return self::getPathTemplate('npmPackage')->render([ 'project' => $project, 'location' => $location, @@ -380,8 +413,12 @@ public static function projectSettingsName(string $project): string * * @return string The formatted python_package resource. */ - public static function pythonPackageName(string $project, string $location, string $repository, string $pythonPackage): string - { + public static function pythonPackageName( + string $project, + string $location, + string $repository, + string $pythonPackage + ): string { return self::getPathTemplate('pythonPackage')->render([ 'project' => $project, 'location' => $location, @@ -440,8 +477,13 @@ public static function secretVersionName(string $project, string $secret, string * * @return string The formatted tag resource. */ - public static function tagName(string $project, string $location, string $repository, string $package, string $tag): string - { + public static function tagName( + string $project, + string $location, + string $repository, + string $package, + string $tag + ): string { return self::getPathTemplate('tag')->render([ 'project' => $project, 'location' => $location, @@ -463,8 +505,13 @@ public static function tagName(string $project, string $location, string $reposi * * @return string The formatted version resource. */ - public static function versionName(string $project, string $location, string $repository, string $package, string $version): string - { + public static function versionName( + string $project, + string $location, + string $repository, + string $package, + string $version + ): string { return self::getPathTemplate('version')->render([ 'project' => $project, 'location' => $location, @@ -1436,8 +1483,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } @@ -1463,8 +1512,10 @@ public function testIamPermissions(TestIamPermissionsRequest $request, array $ca * * @throws ApiException Thrown if the API call fails. */ - public function updateProjectSettings(UpdateProjectSettingsRequest $request, array $callOptions = []): ProjectSettings - { + public function updateProjectSettings( + UpdateProjectSettingsRequest $request, + array $callOptions = [] + ): ProjectSettings { return $this->startApiCall('UpdateProjectSettings', $request, $callOptions)->wait(); } diff --git a/ArtifactRegistry/src/V1/CreateRepositoryRequest.php b/ArtifactRegistry/src/V1/CreateRepositoryRequest.php index 9d74f8efdb82..65a034b5daab 100644 --- a/ArtifactRegistry/src/V1/CreateRepositoryRequest.php +++ b/ArtifactRegistry/src/V1/CreateRepositoryRequest.php @@ -21,19 +21,19 @@ class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The repository id to use for this repository. * * Generated from protobuf field string repository_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository_id = ''; + protected $repository_id = ''; /** * Required. The repository to be created. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository repository = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository = null; + protected $repository = null; /** * @param string $parent Required. The name of the parent resource where the repository will be diff --git a/ArtifactRegistry/src/V1/CreateTagRequest.php b/ArtifactRegistry/src/V1/CreateTagRequest.php index f2a0b641395d..731776f2ec05 100644 --- a/ArtifactRegistry/src/V1/CreateTagRequest.php +++ b/ArtifactRegistry/src/V1/CreateTagRequest.php @@ -20,19 +20,19 @@ class CreateTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * The tag id to use for this repository. * * Generated from protobuf field string tag_id = 2; */ - private $tag_id = ''; + protected $tag_id = ''; /** * The tag to be created. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Tag tag = 3; */ - private $tag = null; + protected $tag = null; /** * @param string $parent The name of the parent resource where the tag will be created. diff --git a/ArtifactRegistry/src/V1/DeletePackageRequest.php b/ArtifactRegistry/src/V1/DeletePackageRequest.php index cd5d727f1c10..fe1c79b9ac60 100644 --- a/ArtifactRegistry/src/V1/DeletePackageRequest.php +++ b/ArtifactRegistry/src/V1/DeletePackageRequest.php @@ -20,7 +20,7 @@ class DeletePackageRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the package to delete. Please see diff --git a/ArtifactRegistry/src/V1/DeleteRepositoryRequest.php b/ArtifactRegistry/src/V1/DeleteRepositoryRequest.php index d325e71b4d1a..2d627544d77a 100644 --- a/ArtifactRegistry/src/V1/DeleteRepositoryRequest.php +++ b/ArtifactRegistry/src/V1/DeleteRepositoryRequest.php @@ -20,7 +20,7 @@ class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the repository to delete. Please see diff --git a/ArtifactRegistry/src/V1/DeleteTagRequest.php b/ArtifactRegistry/src/V1/DeleteTagRequest.php index b04c2d5e3417..d358ac8e1a2c 100644 --- a/ArtifactRegistry/src/V1/DeleteTagRequest.php +++ b/ArtifactRegistry/src/V1/DeleteTagRequest.php @@ -20,7 +20,7 @@ class DeleteTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * @param string $name The name of the tag to delete. diff --git a/ArtifactRegistry/src/V1/DeleteVersionRequest.php b/ArtifactRegistry/src/V1/DeleteVersionRequest.php index c370bca3848d..4964e3e74200 100644 --- a/ArtifactRegistry/src/V1/DeleteVersionRequest.php +++ b/ArtifactRegistry/src/V1/DeleteVersionRequest.php @@ -20,14 +20,14 @@ class DeleteVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * By default, a version that is tagged may not be deleted. If force=true, the * version and any tags pointing to the version are deleted. * * Generated from protobuf field bool force = 2; */ - private $force = false; + protected $force = false; /** * @param string $name The name of the version to delete. diff --git a/ArtifactRegistry/src/V1/DockerImage.php b/ArtifactRegistry/src/V1/DockerImage.php index 036b685c4915..9637bc23a46d 100644 --- a/ArtifactRegistry/src/V1/DockerImage.php +++ b/ArtifactRegistry/src/V1/DockerImage.php @@ -34,7 +34,7 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. URL to access the image. * Example: @@ -42,7 +42,7 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $uri = ''; + protected $uri = ''; /** * Tags attached to this image. * @@ -56,13 +56,13 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 image_size_bytes = 4; */ - private $image_size_bytes = 0; + protected $image_size_bytes = 0; /** * Time the image was uploaded. * * Generated from protobuf field .google.protobuf.Timestamp upload_time = 5; */ - private $upload_time = null; + protected $upload_time = null; /** * Media type of this image, e.g. * "application/vnd.docker.distribution.manifest.v2+json". @@ -71,7 +71,7 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string media_type = 6; */ - private $media_type = ''; + protected $media_type = ''; /** * The time this image was built. * This field is returned as the 'metadata.buildTime' field in the @@ -81,13 +81,13 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp build_time = 7; */ - private $build_time = null; + protected $build_time = null; /** * Output only. The time when the docker image was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/File.php b/ArtifactRegistry/src/V1/File.php index aacd601a85c6..a9aa22d95500 100644 --- a/ArtifactRegistry/src/V1/File.php +++ b/ArtifactRegistry/src/V1/File.php @@ -22,13 +22,13 @@ class File extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The size of the File in bytes. * * Generated from protobuf field int64 size_bytes = 3; */ - private $size_bytes = 0; + protected $size_bytes = 0; /** * The hashes of the file content. * @@ -40,26 +40,26 @@ class File extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the File was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The name of the Package or Version that owns this file, if any. * * Generated from protobuf field string owner = 7; */ - private $owner = ''; + protected $owner = ''; /** * Output only. The time when the last attempt to refresh the file's data was * made. Only set when the repository is remote. * * Generated from protobuf field .google.protobuf.Timestamp fetch_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $fetch_time = null; + protected $fetch_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/GetDockerImageRequest.php b/ArtifactRegistry/src/V1/GetDockerImageRequest.php index 93baa0715edc..61b5cf12ccfd 100644 --- a/ArtifactRegistry/src/V1/GetDockerImageRequest.php +++ b/ArtifactRegistry/src/V1/GetDockerImageRequest.php @@ -20,7 +20,7 @@ class GetDockerImageRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the docker images. Please see diff --git a/ArtifactRegistry/src/V1/GetFileRequest.php b/ArtifactRegistry/src/V1/GetFileRequest.php index 763e239ddd95..dfb6c5bd26ac 100644 --- a/ArtifactRegistry/src/V1/GetFileRequest.php +++ b/ArtifactRegistry/src/V1/GetFileRequest.php @@ -20,7 +20,7 @@ class GetFileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the file to retrieve. Please see diff --git a/ArtifactRegistry/src/V1/GetMavenArtifactRequest.php b/ArtifactRegistry/src/V1/GetMavenArtifactRequest.php index 81b23e3d99d6..33f61844532d 100644 --- a/ArtifactRegistry/src/V1/GetMavenArtifactRequest.php +++ b/ArtifactRegistry/src/V1/GetMavenArtifactRequest.php @@ -20,7 +20,7 @@ class GetMavenArtifactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the maven artifact. Please see diff --git a/ArtifactRegistry/src/V1/GetNpmPackageRequest.php b/ArtifactRegistry/src/V1/GetNpmPackageRequest.php index 481778356a00..19e47bc35963 100644 --- a/ArtifactRegistry/src/V1/GetNpmPackageRequest.php +++ b/ArtifactRegistry/src/V1/GetNpmPackageRequest.php @@ -20,7 +20,7 @@ class GetNpmPackageRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the npm package. Please see diff --git a/ArtifactRegistry/src/V1/GetPackageRequest.php b/ArtifactRegistry/src/V1/GetPackageRequest.php index ca55baadd1cb..d1cb4907aeb9 100644 --- a/ArtifactRegistry/src/V1/GetPackageRequest.php +++ b/ArtifactRegistry/src/V1/GetPackageRequest.php @@ -20,7 +20,7 @@ class GetPackageRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the package to retrieve. Please see diff --git a/ArtifactRegistry/src/V1/GetProjectSettingsRequest.php b/ArtifactRegistry/src/V1/GetProjectSettingsRequest.php index 2c985ed4c451..98fd5df8ddc6 100644 --- a/ArtifactRegistry/src/V1/GetProjectSettingsRequest.php +++ b/ArtifactRegistry/src/V1/GetProjectSettingsRequest.php @@ -20,7 +20,7 @@ class GetProjectSettingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the projectSettings resource. Please see diff --git a/ArtifactRegistry/src/V1/GetPythonPackageRequest.php b/ArtifactRegistry/src/V1/GetPythonPackageRequest.php index eb29a291ef2b..cc414d1512f2 100644 --- a/ArtifactRegistry/src/V1/GetPythonPackageRequest.php +++ b/ArtifactRegistry/src/V1/GetPythonPackageRequest.php @@ -20,7 +20,7 @@ class GetPythonPackageRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the python package. Please see diff --git a/ArtifactRegistry/src/V1/GetRepositoryRequest.php b/ArtifactRegistry/src/V1/GetRepositoryRequest.php index a8d2dd01e291..3d634bac4006 100644 --- a/ArtifactRegistry/src/V1/GetRepositoryRequest.php +++ b/ArtifactRegistry/src/V1/GetRepositoryRequest.php @@ -20,7 +20,7 @@ class GetRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the repository to retrieve. Please see diff --git a/ArtifactRegistry/src/V1/GetTagRequest.php b/ArtifactRegistry/src/V1/GetTagRequest.php index 4e14051ace39..1f8670ee2d17 100644 --- a/ArtifactRegistry/src/V1/GetTagRequest.php +++ b/ArtifactRegistry/src/V1/GetTagRequest.php @@ -20,7 +20,7 @@ class GetTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * @param string $name The name of the tag to retrieve. diff --git a/ArtifactRegistry/src/V1/GetVPCSCConfigRequest.php b/ArtifactRegistry/src/V1/GetVPCSCConfigRequest.php index c042439898e8..15127233c42b 100644 --- a/ArtifactRegistry/src/V1/GetVPCSCConfigRequest.php +++ b/ArtifactRegistry/src/V1/GetVPCSCConfigRequest.php @@ -20,7 +20,7 @@ class GetVPCSCConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the VPCSCConfig resource. Please see diff --git a/ArtifactRegistry/src/V1/GetVersionRequest.php b/ArtifactRegistry/src/V1/GetVersionRequest.php index 69b3d32b7ff0..c41a97ec0384 100644 --- a/ArtifactRegistry/src/V1/GetVersionRequest.php +++ b/ArtifactRegistry/src/V1/GetVersionRequest.php @@ -20,13 +20,13 @@ class GetVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The view that should be returned in the response. * * Generated from protobuf field .google.devtools.artifactregistry.v1.VersionView view = 2; */ - private $view = 0; + protected $view = 0; /** * @param string $name The name of the version to retrieve. diff --git a/ArtifactRegistry/src/V1/Hash.php b/ArtifactRegistry/src/V1/Hash.php index 9ab59f95dcd2..79bcb7533540 100644 --- a/ArtifactRegistry/src/V1/Hash.php +++ b/ArtifactRegistry/src/V1/Hash.php @@ -20,13 +20,13 @@ class Hash extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.Hash.HashType type = 1; */ - private $type = 0; + protected $type = 0; /** * The hash value. * * Generated from protobuf field bytes value = 2; */ - private $value = ''; + protected $value = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/Hash/HashType.php b/ArtifactRegistry/src/V1/Hash/HashType.php index 51fcd6f07fc3..84d9f35c2818 100644 --- a/ArtifactRegistry/src/V1/Hash/HashType.php +++ b/ArtifactRegistry/src/V1/Hash/HashType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HashType::class, \Google\Cloud\ArtifactRegistry\V1\Hash_HashType::class); diff --git a/ArtifactRegistry/src/V1/ImportAptArtifactsErrorInfo.php b/ArtifactRegistry/src/V1/ImportAptArtifactsErrorInfo.php index 3fa98d6f5c00..eb25e2abc7e3 100644 --- a/ArtifactRegistry/src/V1/ImportAptArtifactsErrorInfo.php +++ b/ArtifactRegistry/src/V1/ImportAptArtifactsErrorInfo.php @@ -20,7 +20,7 @@ class ImportAptArtifactsErrorInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status error = 2; */ - private $error = null; + protected $error = null; protected $source; /** diff --git a/ArtifactRegistry/src/V1/ImportAptArtifactsGcsSource.php b/ArtifactRegistry/src/V1/ImportAptArtifactsGcsSource.php index 0a3036bf77c6..0d7d9bee210a 100644 --- a/ArtifactRegistry/src/V1/ImportAptArtifactsGcsSource.php +++ b/ArtifactRegistry/src/V1/ImportAptArtifactsGcsSource.php @@ -26,7 +26,7 @@ class ImportAptArtifactsGcsSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool use_wildcards = 2; */ - private $use_wildcards = false; + protected $use_wildcards = false; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ImportAptArtifactsRequest.php b/ArtifactRegistry/src/V1/ImportAptArtifactsRequest.php index 6a4a07eb8067..fc3e346ecd7c 100644 --- a/ArtifactRegistry/src/V1/ImportAptArtifactsRequest.php +++ b/ArtifactRegistry/src/V1/ImportAptArtifactsRequest.php @@ -20,7 +20,7 @@ class ImportAptArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; protected $source; /** diff --git a/ArtifactRegistry/src/V1/ImportYumArtifactsErrorInfo.php b/ArtifactRegistry/src/V1/ImportYumArtifactsErrorInfo.php index 748801707ca3..1a2af81059d7 100644 --- a/ArtifactRegistry/src/V1/ImportYumArtifactsErrorInfo.php +++ b/ArtifactRegistry/src/V1/ImportYumArtifactsErrorInfo.php @@ -20,7 +20,7 @@ class ImportYumArtifactsErrorInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status error = 2; */ - private $error = null; + protected $error = null; protected $source; /** diff --git a/ArtifactRegistry/src/V1/ImportYumArtifactsGcsSource.php b/ArtifactRegistry/src/V1/ImportYumArtifactsGcsSource.php index 766c697927e9..5260dca32be4 100644 --- a/ArtifactRegistry/src/V1/ImportYumArtifactsGcsSource.php +++ b/ArtifactRegistry/src/V1/ImportYumArtifactsGcsSource.php @@ -26,7 +26,7 @@ class ImportYumArtifactsGcsSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool use_wildcards = 2; */ - private $use_wildcards = false; + protected $use_wildcards = false; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ImportYumArtifactsRequest.php b/ArtifactRegistry/src/V1/ImportYumArtifactsRequest.php index bc4fba037d5b..a9852949319c 100644 --- a/ArtifactRegistry/src/V1/ImportYumArtifactsRequest.php +++ b/ArtifactRegistry/src/V1/ImportYumArtifactsRequest.php @@ -20,7 +20,7 @@ class ImportYumArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; protected $source; /** diff --git a/ArtifactRegistry/src/V1/ListDockerImagesRequest.php b/ArtifactRegistry/src/V1/ListDockerImagesRequest.php index ff73977e5df1..6b0dff272eab 100644 --- a/ArtifactRegistry/src/V1/ListDockerImagesRequest.php +++ b/ArtifactRegistry/src/V1/ListDockerImagesRequest.php @@ -21,25 +21,25 @@ class ListDockerImagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of artifacts to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The field to order the results by. * * Generated from protobuf field string order_by = 4; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The name of the parent resource whose docker images will be diff --git a/ArtifactRegistry/src/V1/ListDockerImagesResponse.php b/ArtifactRegistry/src/V1/ListDockerImagesResponse.php index 32460b5c4103..2ccec19eb3ee 100644 --- a/ArtifactRegistry/src/V1/ListDockerImagesResponse.php +++ b/ArtifactRegistry/src/V1/ListDockerImagesResponse.php @@ -27,7 +27,7 @@ class ListDockerImagesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListFilesRequest.php b/ArtifactRegistry/src/V1/ListFilesRequest.php index 31f8a7eeb749..f8cf0a6173ca 100644 --- a/ArtifactRegistry/src/V1/ListFilesRequest.php +++ b/ArtifactRegistry/src/V1/ListFilesRequest.php @@ -21,7 +21,7 @@ class ListFilesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -35,25 +35,25 @@ class ListFilesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of files to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The field to order the results by. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The name of the repository whose files will be listed. For diff --git a/ArtifactRegistry/src/V1/ListFilesResponse.php b/ArtifactRegistry/src/V1/ListFilesResponse.php index 8ed6ed608ede..96f058260762 100644 --- a/ArtifactRegistry/src/V1/ListFilesResponse.php +++ b/ArtifactRegistry/src/V1/ListFilesResponse.php @@ -27,7 +27,7 @@ class ListFilesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php b/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php index 010b068680ab..4db5ada82688 100644 --- a/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php +++ b/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php @@ -21,19 +21,19 @@ class ListMavenArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of artifacts to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose maven artifacts will be diff --git a/ArtifactRegistry/src/V1/ListMavenArtifactsResponse.php b/ArtifactRegistry/src/V1/ListMavenArtifactsResponse.php index cb3f930a7dd3..b1de1f21db3d 100644 --- a/ArtifactRegistry/src/V1/ListMavenArtifactsResponse.php +++ b/ArtifactRegistry/src/V1/ListMavenArtifactsResponse.php @@ -27,7 +27,7 @@ class ListMavenArtifactsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php b/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php index 6631badb0e31..66ab4c44a7c4 100644 --- a/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php +++ b/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php @@ -21,19 +21,19 @@ class ListNpmPackagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of artifacts to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose npm packages will be diff --git a/ArtifactRegistry/src/V1/ListNpmPackagesResponse.php b/ArtifactRegistry/src/V1/ListNpmPackagesResponse.php index 246166ff20db..ad1c6898e324 100644 --- a/ArtifactRegistry/src/V1/ListNpmPackagesResponse.php +++ b/ArtifactRegistry/src/V1/ListNpmPackagesResponse.php @@ -27,7 +27,7 @@ class ListNpmPackagesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListPackagesRequest.php b/ArtifactRegistry/src/V1/ListPackagesRequest.php index d2a6f0f0b2b3..cf8929daaf9d 100644 --- a/ArtifactRegistry/src/V1/ListPackagesRequest.php +++ b/ArtifactRegistry/src/V1/ListPackagesRequest.php @@ -20,19 +20,19 @@ class ListPackagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of packages to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose packages will be listed. Please see diff --git a/ArtifactRegistry/src/V1/ListPackagesResponse.php b/ArtifactRegistry/src/V1/ListPackagesResponse.php index ad39ce5ef351..8822cdbba69f 100644 --- a/ArtifactRegistry/src/V1/ListPackagesResponse.php +++ b/ArtifactRegistry/src/V1/ListPackagesResponse.php @@ -27,7 +27,7 @@ class ListPackagesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php b/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php index 91fc8ff849d0..a49653837a14 100644 --- a/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php +++ b/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php @@ -21,19 +21,19 @@ class ListPythonPackagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of artifacts to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose python packages will be diff --git a/ArtifactRegistry/src/V1/ListPythonPackagesResponse.php b/ArtifactRegistry/src/V1/ListPythonPackagesResponse.php index e3bc4b6a5f6c..b985eecc48ea 100644 --- a/ArtifactRegistry/src/V1/ListPythonPackagesResponse.php +++ b/ArtifactRegistry/src/V1/ListPythonPackagesResponse.php @@ -27,7 +27,7 @@ class ListPythonPackagesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListRepositoriesRequest.php b/ArtifactRegistry/src/V1/ListRepositoriesRequest.php index 9a3013bc329c..6c4d1e49225d 100644 --- a/ArtifactRegistry/src/V1/ListRepositoriesRequest.php +++ b/ArtifactRegistry/src/V1/ListRepositoriesRequest.php @@ -21,19 +21,19 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of repositories to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose repositories will be diff --git a/ArtifactRegistry/src/V1/ListRepositoriesResponse.php b/ArtifactRegistry/src/V1/ListRepositoriesResponse.php index 299768440de9..263872d9a2dc 100644 --- a/ArtifactRegistry/src/V1/ListRepositoriesResponse.php +++ b/ArtifactRegistry/src/V1/ListRepositoriesResponse.php @@ -27,7 +27,7 @@ class ListRepositoriesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListTagsRequest.php b/ArtifactRegistry/src/V1/ListTagsRequest.php index d823bad7f24a..3f5b8a81b0c6 100644 --- a/ArtifactRegistry/src/V1/ListTagsRequest.php +++ b/ArtifactRegistry/src/V1/ListTagsRequest.php @@ -22,7 +22,7 @@ class ListTagsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -33,19 +33,19 @@ class ListTagsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of tags to return. Maximum page size is 10,000. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent The name of the parent package whose tags will be listed. diff --git a/ArtifactRegistry/src/V1/ListTagsResponse.php b/ArtifactRegistry/src/V1/ListTagsResponse.php index c2696eb15f1d..5d1c4b49930c 100644 --- a/ArtifactRegistry/src/V1/ListTagsResponse.php +++ b/ArtifactRegistry/src/V1/ListTagsResponse.php @@ -27,7 +27,7 @@ class ListTagsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListVersionsRequest.php b/ArtifactRegistry/src/V1/ListVersionsRequest.php index 19aa4a5d85bb..b10835ebe609 100644 --- a/ArtifactRegistry/src/V1/ListVersionsRequest.php +++ b/ArtifactRegistry/src/V1/ListVersionsRequest.php @@ -20,31 +20,31 @@ class ListVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of versions to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The view that should be returned in the response. * * Generated from protobuf field .google.devtools.artifactregistry.v1.VersionView view = 4; */ - private $view = 0; + protected $view = 0; /** * Optional. The field to order the results by. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent The name of the parent resource whose versions will be listed. diff --git a/ArtifactRegistry/src/V1/ListVersionsResponse.php b/ArtifactRegistry/src/V1/ListVersionsResponse.php index fd6fc996a52c..3aaa352298a4 100644 --- a/ArtifactRegistry/src/V1/ListVersionsResponse.php +++ b/ArtifactRegistry/src/V1/ListVersionsResponse.php @@ -27,7 +27,7 @@ class ListVersionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/MavenArtifact.php b/ArtifactRegistry/src/V1/MavenArtifact.php index dc5d943f5dcc..6ade7c6ddb1e 100644 --- a/ArtifactRegistry/src/V1/MavenArtifact.php +++ b/ArtifactRegistry/src/V1/MavenArtifact.php @@ -27,7 +27,7 @@ class MavenArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. URL to access the pom file of the artifact. * Example: @@ -35,7 +35,7 @@ class MavenArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string pom_uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $pom_uri = ''; + protected $pom_uri = ''; /** * Group ID for the artifact. * Example: @@ -43,31 +43,31 @@ class MavenArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string group_id = 3; */ - private $group_id = ''; + protected $group_id = ''; /** * Artifact ID for the artifact. * * Generated from protobuf field string artifact_id = 4; */ - private $artifact_id = ''; + protected $artifact_id = ''; /** * Version of this artifact. * * Generated from protobuf field string version = 5; */ - private $version = ''; + protected $version = ''; /** * Output only. Time the artifact was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time the artifact was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/NpmPackage.php b/ArtifactRegistry/src/V1/NpmPackage.php index 5e00d0646b7e..ef9668517d0a 100644 --- a/ArtifactRegistry/src/V1/NpmPackage.php +++ b/ArtifactRegistry/src/V1/NpmPackage.php @@ -26,19 +26,19 @@ class NpmPackage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Package for the artifact. * * Generated from protobuf field string package_name = 3; */ - private $package_name = ''; + protected $package_name = ''; /** * Version of this package. * * Generated from protobuf field string version = 4; */ - private $version = ''; + protected $version = ''; /** * Tags attached to this package. * @@ -50,13 +50,13 @@ class NpmPackage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time the package was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/Package.php b/ArtifactRegistry/src/V1/Package.php index ac28a080f850..a61c4fe1b73a 100644 --- a/ArtifactRegistry/src/V1/Package.php +++ b/ArtifactRegistry/src/V1/Package.php @@ -22,26 +22,26 @@ class Package extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The display name of the package. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * The time when the package was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; */ - private $create_time = null; + protected $create_time = null; /** * The time when the package was last updated. This includes publishing a new * version of the package. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ProjectSettings.php b/ArtifactRegistry/src/V1/ProjectSettings.php index e9a64f8a8cf3..d9ff5a79afbf 100644 --- a/ArtifactRegistry/src/V1/ProjectSettings.php +++ b/ArtifactRegistry/src/V1/ProjectSettings.php @@ -24,13 +24,13 @@ class ProjectSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The redirection state of the legacy repositories in this project. * * Generated from protobuf field .google.devtools.artifactregistry.v1.ProjectSettings.RedirectionState legacy_redirection_state = 2; */ - private $legacy_redirection_state = 0; + protected $legacy_redirection_state = 0; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php b/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php index 111982d6d491..e07820abc46e 100644 --- a/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php +++ b/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RedirectionState::class, \Google\Cloud\ArtifactRegistry\V1\ProjectSettings_RedirectionState::class); diff --git a/ArtifactRegistry/src/V1/PythonPackage.php b/ArtifactRegistry/src/V1/PythonPackage.php index c700bddba577..208ad38fd84c 100644 --- a/ArtifactRegistry/src/V1/PythonPackage.php +++ b/ArtifactRegistry/src/V1/PythonPackage.php @@ -28,7 +28,7 @@ class PythonPackage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. URL to access the package. * Example: @@ -36,31 +36,31 @@ class PythonPackage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $uri = ''; + protected $uri = ''; /** * Package for the artifact. * * Generated from protobuf field string package_name = 3; */ - private $package_name = ''; + protected $package_name = ''; /** * Version of this package. * * Generated from protobuf field string version = 4; */ - private $version = ''; + protected $version = ''; /** * Output only. Time the package was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time the package was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php index 5f03fc03310d..cb55a85f5d2b 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php @@ -20,13 +20,13 @@ class RemoteRepositoryConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 1; */ - private $description = ''; + protected $description = ''; /** * Optional. The credentials used to access the remote repository. * * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials upstream_credentials = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $upstream_credentials = null; + protected $upstream_credentials = null; protected $remote_source; /** diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php index e4ff37453569..18e276a813fc 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AptRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_AptRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository.php index f3d02fce05a0..f60518a37a4a 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository.php @@ -21,13 +21,13 @@ class PublicRepository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.RepositoryBase repository_base = 1; */ - private $repository_base = 0; + protected $repository_base = 0; /** * A custom field to define a path to a specific repository from the base. * * Generated from protobuf field string repository_path = 2; */ - private $repository_path = ''; + protected $repository_path = ''; /** * Constructor. @@ -100,6 +100,4 @@ public function setRepositoryPath($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_AptRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php index bfac3b3c00f2..54db0e457c47 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RepositoryBase::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_AptRepository_PublicRepository_RepositoryBase::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php index f3aa08487fec..07f77336e9c7 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DockerRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_DockerRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/PublicRepository.php index 82a2deb86984..4d954a9f3918 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/PublicRepository.php @@ -53,6 +53,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_DockerRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php index a8bd17ce0816..85653c2ba49d 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MavenRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_MavenRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/PublicRepository.php index 7756888aacf6..7b25a3fb3142 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/PublicRepository.php @@ -53,6 +53,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_MavenRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php index df82dde05d50..9dabce6bd8f3 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NpmRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_NpmRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/PublicRepository.php index 35a37914d7d1..4c0f8ad74199 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/PublicRepository.php @@ -52,6 +52,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_NpmRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php index 112d8e310400..8dd53a3ffb4d 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PythonRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_PythonRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/PublicRepository.php index 1a20ffd2e141..0c0f019d3aa9 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/PublicRepository.php @@ -52,6 +52,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_PythonRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials.php index f4b88b8352ad..7d2d010db09e 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials.php @@ -73,6 +73,4 @@ public function getCredentials() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UpstreamCredentials::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_UpstreamCredentials::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials/UsernamePasswordCredentials.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials/UsernamePasswordCredentials.php index 03f346069806..ed75420760fd 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials/UsernamePasswordCredentials.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials/UsernamePasswordCredentials.php @@ -20,7 +20,7 @@ class UsernamePasswordCredentials extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string username = 1; */ - private $username = ''; + protected $username = ''; /** * The Secret Manager key version that holds the password to access the * remote repository. Must be in the format of @@ -28,7 +28,7 @@ class UsernamePasswordCredentials extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string password_secret_version = 2 [(.google.api.resource_reference) = { */ - private $password_secret_version = ''; + protected $password_secret_version = ''; /** * Constructor. @@ -107,6 +107,4 @@ public function setPasswordSecretVersion($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UsernamePasswordCredentials::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_UpstreamCredentials_UsernamePasswordCredentials::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php index 85505dc27beb..a9792a1236b4 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(YumRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_YumRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository.php index ec5e8961c537..49be52dee114 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository.php @@ -21,13 +21,13 @@ class PublicRepository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.RepositoryBase repository_base = 1; */ - private $repository_base = 0; + protected $repository_base = 0; /** * A custom field to define a path to a specific repository from the base. * * Generated from protobuf field string repository_path = 2; */ - private $repository_path = ''; + protected $repository_path = ''; /** * Constructor. @@ -100,6 +100,4 @@ public function setRepositoryPath($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_YumRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository/RepositoryBase.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository/RepositoryBase.php index 938be50a17f8..7a57cf061198 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository/RepositoryBase.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository/RepositoryBase.php @@ -87,6 +87,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RepositoryBase::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_YumRepository_PublicRepository_RepositoryBase::class); diff --git a/ArtifactRegistry/src/V1/Repository.php b/ArtifactRegistry/src/V1/Repository.php index 9854921dd605..b162598ad0f5 100644 --- a/ArtifactRegistry/src/V1/Repository.php +++ b/ArtifactRegistry/src/V1/Repository.php @@ -21,19 +21,19 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Optional. The format of packages that are stored in the repository. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.Format format = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $format = 0; + protected $format = 0; /** * The user-provided description of the repository. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Labels with user-defined metadata. * This field may contain up to 64 entries. Label keys and values may be no @@ -49,13 +49,13 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the repository was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The Cloud KMS resource name of the customer managed encryption key that's * used to encrypt the contents of the Repository. Has the form: @@ -64,13 +64,13 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key_name = 8; */ - private $kms_key_name = ''; + protected $kms_key_name = ''; /** * Optional. The mode of the repository. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.Mode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $mode = 0; + protected $mode = 0; /** * Optional. Cleanup policies for this repository. Cleanup policies indicate * when certain package versions can be automatically deleted. Map keys are @@ -87,20 +87,20 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 size_bytes = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $size_bytes = 0; + protected $size_bytes = 0; /** * Output only. If set, the repository satisfies physical zone separation. * * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $satisfies_pzs = false; + protected $satisfies_pzs = false; /** * Optional. If true, the cleanup pipeline is prevented from deleting versions * in this repository. * * Generated from protobuf field bool cleanup_policy_dry_run = 18 [(.google.api.field_behavior) = OPTIONAL]; */ - private $cleanup_policy_dry_run = false; + protected $cleanup_policy_dry_run = false; protected $format_config; protected $mode_config; diff --git a/ArtifactRegistry/src/V1/Repository/DockerRepositoryConfig.php b/ArtifactRegistry/src/V1/Repository/DockerRepositoryConfig.php index 8111fd29bab9..d81fb3345003 100644 --- a/ArtifactRegistry/src/V1/Repository/DockerRepositoryConfig.php +++ b/ArtifactRegistry/src/V1/Repository/DockerRepositoryConfig.php @@ -24,7 +24,7 @@ class DockerRepositoryConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool immutable_tags = 1; */ - private $immutable_tags = false; + protected $immutable_tags = false; /** * Constructor. @@ -75,6 +75,4 @@ public function setImmutableTags($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DockerRepositoryConfig::class, \Google\Cloud\ArtifactRegistry\V1\Repository_DockerRepositoryConfig::class); diff --git a/ArtifactRegistry/src/V1/Repository/Format.php b/ArtifactRegistry/src/V1/Repository/Format.php index 20aa9b235548..6fc8c1369014 100644 --- a/ArtifactRegistry/src/V1/Repository/Format.php +++ b/ArtifactRegistry/src/V1/Repository/Format.php @@ -101,6 +101,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Format::class, \Google\Cloud\ArtifactRegistry\V1\Repository_Format::class); diff --git a/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig.php b/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig.php index 1dc575167345..00844c17eaaa 100644 --- a/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig.php +++ b/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig.php @@ -23,13 +23,13 @@ class MavenRepositoryConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool allow_snapshot_overwrites = 1; */ - private $allow_snapshot_overwrites = false; + protected $allow_snapshot_overwrites = false; /** * Version policy defines the versions that the registry will accept. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.VersionPolicy version_policy = 2; */ - private $version_policy = 0; + protected $version_policy = 0; /** * Constructor. @@ -105,6 +105,4 @@ public function setVersionPolicy($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MavenRepositoryConfig::class, \Google\Cloud\ArtifactRegistry\V1\Repository_MavenRepositoryConfig::class); diff --git a/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig/VersionPolicy.php b/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig/VersionPolicy.php index f31177cd8212..c59076e33839 100644 --- a/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig/VersionPolicy.php +++ b/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig/VersionPolicy.php @@ -61,6 +61,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(VersionPolicy::class, \Google\Cloud\ArtifactRegistry\V1\Repository_MavenRepositoryConfig_VersionPolicy::class); diff --git a/ArtifactRegistry/src/V1/Repository/Mode.php b/ArtifactRegistry/src/V1/Repository/Mode.php index b4830a8974a9..eb6554e12f24 100644 --- a/ArtifactRegistry/src/V1/Repository/Mode.php +++ b/ArtifactRegistry/src/V1/Repository/Mode.php @@ -67,6 +67,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Mode::class, \Google\Cloud\ArtifactRegistry\V1\Repository_Mode::class); diff --git a/ArtifactRegistry/src/V1/Tag.php b/ArtifactRegistry/src/V1/Tag.php index a0f36f6551c9..01d7525b1fee 100644 --- a/ArtifactRegistry/src/V1/Tag.php +++ b/ArtifactRegistry/src/V1/Tag.php @@ -25,7 +25,7 @@ class Tag extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The name of the version the tag refers to, for example: * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" @@ -34,7 +34,7 @@ class Tag extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 2; */ - private $version = ''; + protected $version = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/UpdateProjectSettingsRequest.php b/ArtifactRegistry/src/V1/UpdateProjectSettingsRequest.php index 170780c1977c..77413896bc4a 100644 --- a/ArtifactRegistry/src/V1/UpdateProjectSettingsRequest.php +++ b/ArtifactRegistry/src/V1/UpdateProjectSettingsRequest.php @@ -20,13 +20,13 @@ class UpdateProjectSettingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.ProjectSettings project_settings = 2; */ - private $project_settings = null; + protected $project_settings = null; /** * Field mask to support partial updates. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\ArtifactRegistry\V1\ProjectSettings $projectSettings The project settings. diff --git a/ArtifactRegistry/src/V1/UpdateRepositoryRequest.php b/ArtifactRegistry/src/V1/UpdateRepositoryRequest.php index 249a68d8a627..c0156c13d4c5 100644 --- a/ArtifactRegistry/src/V1/UpdateRepositoryRequest.php +++ b/ArtifactRegistry/src/V1/UpdateRepositoryRequest.php @@ -20,7 +20,7 @@ class UpdateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository repository = 1; */ - private $repository = null; + protected $repository = null; /** * The update mask applies to the resource. For the `FieldMask` definition, * see @@ -28,7 +28,7 @@ class UpdateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\ArtifactRegistry\V1\Repository $repository The repository that replaces the resource on the server. diff --git a/ArtifactRegistry/src/V1/UpdateTagRequest.php b/ArtifactRegistry/src/V1/UpdateTagRequest.php index b9ed0350e838..d9315b739945 100644 --- a/ArtifactRegistry/src/V1/UpdateTagRequest.php +++ b/ArtifactRegistry/src/V1/UpdateTagRequest.php @@ -20,7 +20,7 @@ class UpdateTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.Tag tag = 1; */ - private $tag = null; + protected $tag = null; /** * The update mask applies to the resource. For the `FieldMask` definition, * see @@ -28,7 +28,7 @@ class UpdateTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\ArtifactRegistry\V1\Tag $tag The tag that replaces the resource on the server. diff --git a/ArtifactRegistry/src/V1/UpdateVPCSCConfigRequest.php b/ArtifactRegistry/src/V1/UpdateVPCSCConfigRequest.php index 64fcf395ecbc..bce2a364212f 100644 --- a/ArtifactRegistry/src/V1/UpdateVPCSCConfigRequest.php +++ b/ArtifactRegistry/src/V1/UpdateVPCSCConfigRequest.php @@ -20,13 +20,13 @@ class UpdateVPCSCConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.VPCSCConfig vpcsc_config = 1; */ - private $vpcsc_config = null; + protected $vpcsc_config = null; /** * Field mask to support partial updates. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\ArtifactRegistry\V1\VPCSCConfig $vpcscConfig The project config. diff --git a/ArtifactRegistry/src/V1/UpstreamPolicy.php b/ArtifactRegistry/src/V1/UpstreamPolicy.php index cfd7fbcf1563..909b306d0796 100644 --- a/ArtifactRegistry/src/V1/UpstreamPolicy.php +++ b/ArtifactRegistry/src/V1/UpstreamPolicy.php @@ -20,20 +20,20 @@ class UpstreamPolicy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * A reference to the repository resource, for example: * `projects/p1/locations/us-central1/repositories/repo1`. * * Generated from protobuf field string repository = 2 [(.google.api.resource_reference) = { */ - private $repository = ''; + protected $repository = ''; /** * Entries with a greater priority value take precedence in the pull order. * * Generated from protobuf field int32 priority = 3; */ - private $priority = 0; + protected $priority = 0; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/VPCSCConfig.php b/ArtifactRegistry/src/V1/VPCSCConfig.php index 666ce5c4a7d1..ceb797f0ad22 100644 --- a/ArtifactRegistry/src/V1/VPCSCConfig.php +++ b/ArtifactRegistry/src/V1/VPCSCConfig.php @@ -24,14 +24,14 @@ class VPCSCConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The project per location VPC SC policy that defines the VPC SC behavior for * the Remote Repository (Allow/Deny). * * Generated from protobuf field .google.devtools.artifactregistry.v1.VPCSCConfig.VPCSCPolicy vpcsc_policy = 2; */ - private $vpcsc_policy = 0; + protected $vpcsc_policy = 0; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/VPCSCConfig/VPCSCPolicy.php b/ArtifactRegistry/src/V1/VPCSCConfig/VPCSCPolicy.php index b42a04df0262..450db453f7bc 100644 --- a/ArtifactRegistry/src/V1/VPCSCConfig/VPCSCPolicy.php +++ b/ArtifactRegistry/src/V1/VPCSCConfig/VPCSCPolicy.php @@ -63,6 +63,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(VPCSCPolicy::class, \Google\Cloud\ArtifactRegistry\V1\VPCSCConfig_VPCSCPolicy::class); diff --git a/ArtifactRegistry/src/V1/Version.php b/ArtifactRegistry/src/V1/Version.php index 26d12fd0f97d..d0e6b33aa05a 100644 --- a/ArtifactRegistry/src/V1/Version.php +++ b/ArtifactRegistry/src/V1/Version.php @@ -25,25 +25,25 @@ class Version extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Optional. Description of the version, as specified in its metadata. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * The time when the version was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; */ - private $create_time = null; + protected $create_time = null; /** * The time when the version was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; */ - private $update_time = null; + protected $update_time = null; /** * Output only. A list of related tags. Will contain up to 100 tags that * reference this version. @@ -60,7 +60,7 @@ class Version extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata = null; + protected $metadata = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/YumArtifact.php b/ArtifactRegistry/src/V1/YumArtifact.php index 7c7ac761b7da..b50bad3012ac 100644 --- a/ArtifactRegistry/src/V1/YumArtifact.php +++ b/ArtifactRegistry/src/V1/YumArtifact.php @@ -20,25 +20,25 @@ class YumArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The yum package name of the artifact. * * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $package_name = ''; + protected $package_name = ''; /** * Output only. An artifact is a binary or source package. * * Generated from protobuf field .google.devtools.artifactregistry.v1.YumArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $package_type = 0; + protected $package_type = 0; /** * Output only. Operating system architecture of the artifact. * * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $architecture = ''; + protected $architecture = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/YumArtifact/PackageType.php b/ArtifactRegistry/src/V1/YumArtifact/PackageType.php index 3e2b075bd74b..5c17f3f677d0 100644 --- a/ArtifactRegistry/src/V1/YumArtifact/PackageType.php +++ b/ArtifactRegistry/src/V1/YumArtifact/PackageType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PackageType::class, \Google\Cloud\ArtifactRegistry\V1\YumArtifact_PackageType::class); diff --git a/ArtifactRegistry/src/V1beta2/AptArtifact.php b/ArtifactRegistry/src/V1beta2/AptArtifact.php deleted file mode 100644 index 95e358de484d..000000000000 --- a/ArtifactRegistry/src/V1beta2/AptArtifact.php +++ /dev/null @@ -1,239 +0,0 @@ -google.devtools.artifactregistry.v1beta2.AptArtifact - */ -class AptArtifact extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Output only. The Apt package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $package_name = ''; - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $package_type = 0; - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $architecture = ''; - /** - * Output only. Repository component of the artifact. - * - * Generated from protobuf field string component = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $component = ''; - /** - * Output only. Contents of the artifact's control metadata file. - * - * Generated from protobuf field bytes control_file = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $control_file = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The Artifact Registry resource name of the artifact. - * @type string $package_name - * Output only. The Apt package name of the artifact. - * @type int $package_type - * Output only. An artifact is a binary or source package. - * @type string $architecture - * Output only. Operating system architecture of the artifact. - * @type string $component - * Output only. Repository component of the artifact. - * @type string $control_file - * Output only. Contents of the artifact's control metadata file. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The Apt package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPackageName() - { - return $this->package_name; - } - - /** - * Output only. The Apt package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPackageName($var) - { - GPBUtil::checkString($var, True); - $this->package_name = $var; - - return $this; - } - - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getPackageType() - { - return $this->package_type; - } - - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setPackageType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact\PackageType::class); - $this->package_type = $var; - - return $this; - } - - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getArchitecture() - { - return $this->architecture; - } - - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setArchitecture($var) - { - GPBUtil::checkString($var, True); - $this->architecture = $var; - - return $this; - } - - /** - * Output only. Repository component of the artifact. - * - * Generated from protobuf field string component = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getComponent() - { - return $this->component; - } - - /** - * Output only. Repository component of the artifact. - * - * Generated from protobuf field string component = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setComponent($var) - { - GPBUtil::checkString($var, True); - $this->component = $var; - - return $this; - } - - /** - * Output only. Contents of the artifact's control metadata file. - * - * Generated from protobuf field bytes control_file = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getControlFile() - { - return $this->control_file; - } - - /** - * Output only. Contents of the artifact's control metadata file. - * - * Generated from protobuf field bytes control_file = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setControlFile($var) - { - GPBUtil::checkString($var, False); - $this->control_file = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/AptArtifact/PackageType.php b/ArtifactRegistry/src/V1beta2/AptArtifact/PackageType.php deleted file mode 100644 index bbc443e0e109..000000000000 --- a/ArtifactRegistry/src/V1beta2/AptArtifact/PackageType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType - */ -class PackageType -{ - /** - * Package type is not specified. - * - * Generated from protobuf enum PACKAGE_TYPE_UNSPECIFIED = 0; - */ - const PACKAGE_TYPE_UNSPECIFIED = 0; - /** - * Binary package. - * - * Generated from protobuf enum BINARY = 1; - */ - const BINARY = 1; - /** - * Source package. - * - * Generated from protobuf enum SOURCE = 2; - */ - const SOURCE = 2; - - private static $valueToName = [ - self::PACKAGE_TYPE_UNSPECIFIED => 'PACKAGE_TYPE_UNSPECIFIED', - self::BINARY => 'BINARY', - self::SOURCE => 'SOURCE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PackageType::class, \Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact_PackageType::class); - diff --git a/ArtifactRegistry/src/V1beta2/AptArtifact_PackageType.php b/ArtifactRegistry/src/V1beta2/AptArtifact_PackageType.php deleted file mode 100644 index 8dbb125dad92..000000000000 --- a/ArtifactRegistry/src/V1beta2/AptArtifact_PackageType.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ImportAptArtifacts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Imports Yum (RPM) artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportYumArtifacts(\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ImportYumArtifacts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists repositories. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListRepositoriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListRepositories(\Google\Cloud\ArtifactRegistry\V1beta2\ListRepositoriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListRepositories', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListRepositoriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a repository. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetRepository(\Google\Cloud\ArtifactRegistry\V1beta2\GetRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetRepository', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Repository', 'decode'], - $metadata, $options); - } - - /** - * Creates a repository. The returned Operation will finish once the - * repository has been created. Its response will be the created Repository. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\CreateRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateRepository(\Google\Cloud\ArtifactRegistry\V1beta2\CreateRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/CreateRepository', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a repository. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\UpdateRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateRepository(\Google\Cloud\ArtifactRegistry\V1beta2\UpdateRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateRepository', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Repository', 'decode'], - $metadata, $options); - } - - /** - * Deletes a repository and all of its contents. The returned Operation will - * finish once the repository has been deleted. It will not have any Operation - * metadata and will return a google.protobuf.Empty response. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\DeleteRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteRepository(\Google\Cloud\ArtifactRegistry\V1beta2\DeleteRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteRepository', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists packages. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListPackagesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPackages(\Google\Cloud\ArtifactRegistry\V1beta2\ListPackagesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListPackages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListPackagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a package. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetPackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetPackage(\Google\Cloud\ArtifactRegistry\V1beta2\GetPackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetPackage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Package', 'decode'], - $metadata, $options); - } - - /** - * Deletes a package and all of its versions and tags. The returned operation - * will complete once the package has been deleted. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\DeletePackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeletePackage(\Google\Cloud\ArtifactRegistry\V1beta2\DeletePackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeletePackage', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists versions. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListVersionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListVersions(\Google\Cloud\ArtifactRegistry\V1beta2\ListVersionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListVersions', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListVersionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a version - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetVersionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetVersion(\Google\Cloud\ArtifactRegistry\V1beta2\GetVersionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetVersion', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Version', 'decode'], - $metadata, $options); - } - - /** - * Deletes a version and all of its content. The returned operation will - * complete once the version has been deleted. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\DeleteVersionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteVersion(\Google\Cloud\ArtifactRegistry\V1beta2\DeleteVersionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteVersion', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists files. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListFilesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFiles(\Google\Cloud\ArtifactRegistry\V1beta2\ListFilesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListFiles', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListFilesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a file. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetFileRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFile(\Google\Cloud\ArtifactRegistry\V1beta2\GetFileRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetFile', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\File', 'decode'], - $metadata, $options); - } - - /** - * Lists tags. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListTagsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTags(\Google\Cloud\ArtifactRegistry\V1beta2\ListTagsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListTags', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListTagsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a tag. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTag(\Google\Cloud\ArtifactRegistry\V1beta2\GetTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Tag', 'decode'], - $metadata, $options); - } - - /** - * Creates a tag. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\CreateTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTag(\Google\Cloud\ArtifactRegistry\V1beta2\CreateTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/CreateTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Tag', 'decode'], - $metadata, $options); - } - - /** - * Updates a tag. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\UpdateTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTag(\Google\Cloud\ArtifactRegistry\V1beta2\UpdateTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Tag', 'decode'], - $metadata, $options); - } - - /** - * Deletes a tag. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\DeleteTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTag(\Google\Cloud\ArtifactRegistry\V1beta2\DeleteTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteTag', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Updates the IAM policy for a given resource. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Gets the IAM policy for a given resource. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Tests if the caller has a list of permissions on a resource. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves the Settings for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetProjectSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetProjectSettings(\Google\Cloud\ArtifactRegistry\V1beta2\GetProjectSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetProjectSettings', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings', 'decode'], - $metadata, $options); - } - - /** - * Updates the Settings for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\UpdateProjectSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateProjectSettings(\Google\Cloud\ArtifactRegistry\V1beta2\UpdateProjectSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateProjectSettings', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings', 'decode'], - $metadata, $options); - } - -} diff --git a/ArtifactRegistry/src/V1beta2/CreateRepositoryRequest.php b/ArtifactRegistry/src/V1beta2/CreateRepositoryRequest.php deleted file mode 100644 index e96787f60dee..000000000000 --- a/ArtifactRegistry/src/V1beta2/CreateRepositoryRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest - */ -class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource where the repository will be created. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * The repository id to use for this repository. - * - * Generated from protobuf field string repository_id = 2; - */ - private $repository_id = ''; - /** - * The repository to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 3; - */ - private $repository = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource where the repository will be created. - * @type string $repository_id - * The repository id to use for this repository. - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Repository $repository - * The repository to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource where the repository will be created. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The name of the parent resource where the repository will be created. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The repository id to use for this repository. - * - * Generated from protobuf field string repository_id = 2; - * @return string - */ - public function getRepositoryId() - { - return $this->repository_id; - } - - /** - * The repository id to use for this repository. - * - * Generated from protobuf field string repository_id = 2; - * @param string $var - * @return $this - */ - public function setRepositoryId($var) - { - GPBUtil::checkString($var, True); - $this->repository_id = $var; - - return $this; - } - - /** - * The repository to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 3; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Repository|null - */ - public function getRepository() - { - return $this->repository; - } - - public function hasRepository() - { - return isset($this->repository); - } - - public function clearRepository() - { - unset($this->repository); - } - - /** - * The repository to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 3; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Repository $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository::class); - $this->repository = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/CreateTagRequest.php b/ArtifactRegistry/src/V1beta2/CreateTagRequest.php deleted file mode 100644 index 530103e2ba3a..000000000000 --- a/ArtifactRegistry/src/V1beta2/CreateTagRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.devtools.artifactregistry.v1beta2.CreateTagRequest - */ -class CreateTagRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource where the tag will be created. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * The tag id to use for this repository. - * - * Generated from protobuf field string tag_id = 2; - */ - private $tag_id = ''; - /** - * The tag to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 3; - */ - private $tag = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The name of the parent resource where the tag will be created. - * @type string $tag_id - * The tag id to use for this repository. - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Tag $tag - * The tag to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the parent resource where the tag will be created. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource where the tag will be created. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The tag id to use for this repository. - * - * Generated from protobuf field string tag_id = 2; - * @return string - */ - public function getTagId() - { - return $this->tag_id; - } - - /** - * The tag id to use for this repository. - * - * Generated from protobuf field string tag_id = 2; - * @param string $var - * @return $this - */ - public function setTagId($var) - { - GPBUtil::checkString($var, True); - $this->tag_id = $var; - - return $this; - } - - /** - * The tag to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 3; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Tag|null - */ - public function getTag() - { - return $this->tag; - } - - public function hasTag() - { - return isset($this->tag); - } - - public function clearTag() - { - unset($this->tag); - } - - /** - * The tag to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 3; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Tag $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Tag::class); - $this->tag = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/DeletePackageRequest.php b/ArtifactRegistry/src/V1beta2/DeletePackageRequest.php deleted file mode 100644 index 05cc5acafe72..000000000000 --- a/ArtifactRegistry/src/V1beta2/DeletePackageRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.DeletePackageRequest - */ -class DeletePackageRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the package to delete. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the package to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The name of the package to delete. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the package to delete. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/DeleteRepositoryRequest.php b/ArtifactRegistry/src/V1beta2/DeleteRepositoryRequest.php deleted file mode 100644 index cbe81a5e95d2..000000000000 --- a/ArtifactRegistry/src/V1beta2/DeleteRepositoryRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest - */ -class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the repository to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the repository to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the repository to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the repository to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/DeleteTagRequest.php b/ArtifactRegistry/src/V1beta2/DeleteTagRequest.php deleted file mode 100644 index d07f92a00ac9..000000000000 --- a/ArtifactRegistry/src/V1beta2/DeleteTagRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.DeleteTagRequest - */ -class DeleteTagRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the tag to delete. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the tag to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the tag to delete. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the tag to delete. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/DeleteVersionRequest.php b/ArtifactRegistry/src/V1beta2/DeleteVersionRequest.php deleted file mode 100644 index 68ebb8aef235..000000000000 --- a/ArtifactRegistry/src/V1beta2/DeleteVersionRequest.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.DeleteVersionRequest - */ -class DeleteVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the version to delete. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * - * Generated from protobuf field bool force = 2; - */ - private $force = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the version to delete. - * @type bool $force - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The name of the version to delete. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the version to delete. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * - * Generated from protobuf field bool force = 2; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * - * Generated from protobuf field bool force = 2; - * @param bool $var - * @return $this - */ - public function setForce($var) - { - GPBUtil::checkBool($var); - $this->force = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/File.php b/ArtifactRegistry/src/V1beta2/File.php deleted file mode 100644 index bb0abb82f784..000000000000 --- a/ArtifactRegistry/src/V1beta2/File.php +++ /dev/null @@ -1,265 +0,0 @@ -google.devtools.artifactregistry.v1beta2.File - */ -class File extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". - * If the file ID part contains slashes, they are escaped. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The size of the File in bytes. - * - * Generated from protobuf field int64 size_bytes = 3; - */ - private $size_bytes = 0; - /** - * The hashes of the file content. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Hash hashes = 4; - */ - private $hashes; - /** - * The time when the File was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - private $create_time = null; - /** - * The time when the File was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - private $update_time = null; - /** - * The name of the Package or Version that owns this file, if any. - * - * Generated from protobuf field string owner = 7; - */ - private $owner = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". - * If the file ID part contains slashes, they are escaped. - * @type int|string $size_bytes - * The size of the File in bytes. - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Hash>|\Google\Protobuf\Internal\RepeatedField $hashes - * The hashes of the file content. - * @type \Google\Protobuf\Timestamp $create_time - * The time when the File was created. - * @type \Google\Protobuf\Timestamp $update_time - * The time when the File was last updated. - * @type string $owner - * The name of the Package or Version that owns this file, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". - * If the file ID part contains slashes, they are escaped. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". - * If the file ID part contains slashes, they are escaped. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The size of the File in bytes. - * - * Generated from protobuf field int64 size_bytes = 3; - * @return int|string - */ - public function getSizeBytes() - { - return $this->size_bytes; - } - - /** - * The size of the File in bytes. - * - * Generated from protobuf field int64 size_bytes = 3; - * @param int|string $var - * @return $this - */ - public function setSizeBytes($var) - { - GPBUtil::checkInt64($var); - $this->size_bytes = $var; - - return $this; - } - - /** - * The hashes of the file content. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Hash hashes = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHashes() - { - return $this->hashes; - } - - /** - * The hashes of the file content. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Hash hashes = 4; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Hash>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHashes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Hash::class); - $this->hashes = $arr; - - return $this; - } - - /** - * The time when the File was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time when the File was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time when the File was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * The time when the File was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * The name of the Package or Version that owns this file, if any. - * - * Generated from protobuf field string owner = 7; - * @return string - */ - public function getOwner() - { - return $this->owner; - } - - /** - * The name of the Package or Version that owns this file, if any. - * - * Generated from protobuf field string owner = 7; - * @param string $var - * @return $this - */ - public function setOwner($var) - { - GPBUtil::checkString($var, True); - $this->owner = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Gapic/ArtifactRegistryGapicClient.php b/ArtifactRegistry/src/V1beta2/Gapic/ArtifactRegistryGapicClient.php deleted file mode 100644 index 4f01891ec21d..000000000000 --- a/ArtifactRegistry/src/V1beta2/Gapic/ArtifactRegistryGapicClient.php +++ /dev/null @@ -1,2128 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $operationResponse = $artifactRegistryClient->createRepository($formattedParent); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $artifactRegistryClient->createRepository($formattedParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'createRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class ArtifactRegistryGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.devtools.artifactregistry.v1beta2.ArtifactRegistry'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'artifactregistry.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'artifactregistry.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $locationNameTemplate; - - private static $projectSettingsNameTemplate; - - private static $repositoryNameTemplate; - - private static $tagNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/artifact_registry_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/artifact_registry_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/artifact_registry_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/artifact_registry_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getProjectSettingsNameTemplate() - { - if (self::$projectSettingsNameTemplate == null) { - self::$projectSettingsNameTemplate = new PathTemplate('projects/{project}/projectSettings'); - } - - return self::$projectSettingsNameTemplate; - } - - private static function getRepositoryNameTemplate() - { - if (self::$repositoryNameTemplate == null) { - self::$repositoryNameTemplate = new PathTemplate('projects/{project}/locations/{location}/repositories/{repository}'); - } - - return self::$repositoryNameTemplate; - } - - private static function getTagNameTemplate() - { - if (self::$tagNameTemplate == null) { - self::$tagNameTemplate = new PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}'); - } - - return self::$tagNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'projectSettings' => self::getProjectSettingsNameTemplate(), - 'repository' => self::getRepositoryNameTemplate(), - 'tag' => self::getTagNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_settings resource. - * - * @param string $project - * - * @return string The formatted project_settings resource. - * - * @experimental - */ - public static function projectSettingsName($project) - { - return self::getProjectSettingsNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a repository - * resource. - * - * @param string $project - * @param string $location - * @param string $repository - * - * @return string The formatted repository resource. - * - * @experimental - */ - public static function repositoryName($project, $location, $repository) - { - return self::getRepositoryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a tag - * resource. - * - * @param string $project - * @param string $location - * @param string $repository - * @param string $package - * @param string $tag - * - * @return string The formatted tag resource. - * - * @experimental - */ - public static function tagName($project, $location, $repository, $package, $tag) - { - return self::getTagNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - 'package' => $package, - 'tag' => $tag, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - projectSettings: projects/{project}/projectSettings - * - repository: projects/{project}/locations/{location}/repositories/{repository} - * - tag: projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'artifactregistry.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a repository. The returned Operation will finish once the - * repository has been created. Its response will be the created Repository. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedParent = $artifactRegistryClient->locationName('[PROJECT]', '[LOCATION]'); - * $operationResponse = $artifactRegistryClient->createRepository($formattedParent); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $artifactRegistryClient->createRepository($formattedParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'createRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource where the repository will be created. - * @param array $optionalArgs { - * Optional. - * - * @type string $repositoryId - * The repository id to use for this repository. - * @type Repository $repository - * The repository to be created. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createRepository($parent, array $optionalArgs = []) - { - $request = new CreateRepositoryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['repositoryId'])) { - $request->setRepositoryId($optionalArgs['repositoryId']); - } - - if (isset($optionalArgs['repository'])) { - $request->setRepository($optionalArgs['repository']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateRepository', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a tag. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->createTag(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the parent resource where the tag will be created. - * @type string $tagId - * The tag id to use for this repository. - * @type Tag $tag - * The tag to be created. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Tag - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createTag(array $optionalArgs = []) - { - $request = new CreateTagRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['tagId'])) { - $request->setTagId($optionalArgs['tagId']); - } - - if (isset($optionalArgs['tag'])) { - $request->setTag($optionalArgs['tag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateTag', Tag::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a package and all of its versions and tags. The returned operation - * will complete once the package has been deleted. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $operationResponse = $artifactRegistryClient->deletePackage(); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $artifactRegistryClient->deletePackage(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'deletePackage'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the package to delete. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deletePackage(array $optionalArgs = []) - { - $request = new DeletePackageRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeletePackage', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a repository and all of its contents. The returned Operation will - * finish once the repository has been deleted. It will not have any Operation - * metadata and will return a google.protobuf.Empty response. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedName = $artifactRegistryClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $operationResponse = $artifactRegistryClient->deleteRepository($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $artifactRegistryClient->deleteRepository($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'deleteRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the repository to delete. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteRepository($name, array $optionalArgs = []) - { - $request = new DeleteRepositoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteRepository', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a tag. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $artifactRegistryClient->deleteTag(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the tag to delete. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteTag(array $optionalArgs = []) - { - $request = new DeleteTagRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteTag', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a version and all of its content. The returned operation will - * complete once the version has been deleted. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $operationResponse = $artifactRegistryClient->deleteVersion(); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $artifactRegistryClient->deleteVersion(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'deleteVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the version to delete. - * @type bool $force - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteVersion(array $optionalArgs = []) - { - $request = new DeleteVersionRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets a file. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getFile(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the file to retrieve. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\File - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getFile(array $optionalArgs = []) - { - $request = new GetFileRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetFile', File::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the IAM policy for a given resource. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $resource = 'resource'; - * $response = $artifactRegistryClient->getIamPolicy($resource); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a package. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getPackage(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the package to retrieve. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Package - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getPackage(array $optionalArgs = []) - { - $request = new GetPackageRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetPackage', Package::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the Settings for the Project. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedName = $artifactRegistryClient->projectSettingsName('[PROJECT]'); - * $response = $artifactRegistryClient->getProjectSettings($formattedName); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the projectSettings resource. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getProjectSettings($name, array $optionalArgs = []) - { - $request = new GetProjectSettingsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetProjectSettings', ProjectSettings::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a repository. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedName = $artifactRegistryClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $response = $artifactRegistryClient->getRepository($formattedName); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the repository to retrieve. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Repository - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getRepository($name, array $optionalArgs = []) - { - $request = new GetRepositoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetRepository', Repository::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a tag. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getTag(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the tag to retrieve. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Tag - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getTag(array $optionalArgs = []) - { - $request = new GetTagRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetTag', Tag::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a version - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getVersion(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the version to retrieve. - * @type int $view - * The view that should be returned in the response. - * For allowed values, use constants defined on {@see \Google\Cloud\ArtifactRegistry\V1beta2\VersionView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Version - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getVersion(array $optionalArgs = []) - { - $request = new GetVersionRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetVersion', Version::class, $optionalArgs, $request)->wait(); - } - - /** - * Imports Apt artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $operationResponse = $artifactRegistryClient->importAptArtifacts(); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $artifactRegistryClient->importAptArtifacts(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'importAptArtifacts'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type ImportAptArtifactsGcsSource $gcsSource - * Google Cloud Storage location where input content is located. - * @type string $parent - * The name of the parent resource where the artifacts will be imported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function importAptArtifacts(array $optionalArgs = []) - { - $request = new ImportAptArtifactsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['gcsSource'])) { - $request->setGcsSource($optionalArgs['gcsSource']); - } - - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportAptArtifacts', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Imports Yum (RPM) artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $operationResponse = $artifactRegistryClient->importYumArtifacts(); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $artifactRegistryClient->importYumArtifacts(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'importYumArtifacts'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type ImportYumArtifactsGcsSource $gcsSource - * Google Cloud Storage location where input content is located. - * @type string $parent - * The name of the parent resource where the artifacts will be imported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function importYumArtifacts(array $optionalArgs = []) - { - $request = new ImportYumArtifactsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['gcsSource'])) { - $request->setGcsSource($optionalArgs['gcsSource']); - } - - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportYumArtifacts', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Lists files. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listFiles(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listFiles(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * @type string $filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `name` - * * `owner` - * - * An example of using a filter: - * - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listFiles(array $optionalArgs = []) - { - $request = new ListFilesRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFiles', $optionalArgs, ListFilesResponse::class, $request); - } - - /** - * Lists packages. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listPackages(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listPackages(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the parent resource whose packages will be listed. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listPackages(array $optionalArgs = []) - { - $request = new ListPackagesRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListPackages', $optionalArgs, ListPackagesResponse::class, $request); - } - - /** - * Lists repositories. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedParent = $artifactRegistryClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource whose repositories will be listed. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listRepositories($parent, array $optionalArgs = []) - { - $request = new ListRepositoriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListRepositories', $optionalArgs, ListRepositoriesResponse::class, $request); - } - - /** - * Lists tags. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listTags(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listTags(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the parent resource whose tags will be listed. - * @type string $filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `version` - * - * An example of using a filter: - * - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listTags(array $optionalArgs = []) - { - $request = new ListTagsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListTags', $optionalArgs, ListTagsResponse::class, $request); - } - - /** - * Lists versions. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listVersions(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listVersions(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the parent resource whose versions will be listed. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $view - * The view that should be returned in the response. - * For allowed values, use constants defined on {@see \Google\Cloud\ArtifactRegistry\V1beta2\VersionView} - * @type string $orderBy - * Optional. The field to order the results by. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listVersions(array $optionalArgs = []) - { - $request = new ListVersionsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListVersions', $optionalArgs, ListVersionsResponse::class, $request); - } - - /** - * Updates the IAM policy for a given resource. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $artifactRegistryClient->setIamPolicy($resource, $policy); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Tests if the caller has a list of permissions on a resource. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $artifactRegistryClient->testIamPermissions($resource, $permissions); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates the Settings for the Project. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->updateProjectSettings(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type ProjectSettings $projectSettings - * The project settings. - * @type FieldMask $updateMask - * Field mask to support partial updates. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateProjectSettings(array $optionalArgs = []) - { - $request = new UpdateProjectSettingsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectSettings'])) { - $request->setProjectSettings($optionalArgs['projectSettings']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateProjectSettings', ProjectSettings::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a repository. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->updateRepository(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type Repository $repository - * The repository that replaces the resource on the server. - * @type FieldMask $updateMask - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Repository - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateRepository(array $optionalArgs = []) - { - $request = new UpdateRepositoryRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['repository'])) { - $request->setRepository($optionalArgs['repository']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateRepository', Repository::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a tag. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->updateTag(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type Tag $tag - * The tag that replaces the resource on the server. - * @type FieldMask $updateMask - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Tag - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateTag(array $optionalArgs = []) - { - $request = new UpdateTagRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['tag'])) { - $request->setTag($optionalArgs['tag']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateTag', Tag::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getLocation(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/ArtifactRegistry/src/V1beta2/GetFileRequest.php b/ArtifactRegistry/src/V1beta2/GetFileRequest.php deleted file mode 100644 index 5fcadade74ea..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetFileRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetFileRequest - */ -class GetFileRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the file to retrieve. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the file to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The name of the file to retrieve. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the file to retrieve. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/GetPackageRequest.php b/ArtifactRegistry/src/V1beta2/GetPackageRequest.php deleted file mode 100644 index 059c98de95bd..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetPackageRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetPackageRequest - */ -class GetPackageRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the package to retrieve. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the package to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The name of the package to retrieve. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the package to retrieve. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/GetProjectSettingsRequest.php b/ArtifactRegistry/src/V1beta2/GetProjectSettingsRequest.php deleted file mode 100644 index 5e8116ace16a..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetProjectSettingsRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest - */ -class GetProjectSettingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the projectSettings resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the projectSettings resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Settings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the projectSettings resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the projectSettings resource. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/GetRepositoryRequest.php b/ArtifactRegistry/src/V1beta2/GetRepositoryRequest.php deleted file mode 100644 index c887770f2b21..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetRepositoryRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetRepositoryRequest - */ -class GetRepositoryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the repository to retrieve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the repository to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the repository to retrieve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the repository to retrieve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/GetTagRequest.php b/ArtifactRegistry/src/V1beta2/GetTagRequest.php deleted file mode 100644 index e9c9dd17a090..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetTagRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetTagRequest - */ -class GetTagRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the tag to retrieve. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the tag to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the tag to retrieve. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the tag to retrieve. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/GetVersionRequest.php b/ArtifactRegistry/src/V1beta2/GetVersionRequest.php deleted file mode 100644 index bb912979f041..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetVersionRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetVersionRequest - */ -class GetVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the version to retrieve. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 2; - */ - private $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the version to retrieve. - * @type int $view - * The view that should be returned in the response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The name of the version to retrieve. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the version to retrieve. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 2; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 2; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\VersionView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Hash.php b/ArtifactRegistry/src/V1beta2/Hash.php deleted file mode 100644 index 666877fbae30..000000000000 --- a/ArtifactRegistry/src/V1beta2/Hash.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Hash - */ -class Hash extends \Google\Protobuf\Internal\Message -{ - /** - * The algorithm used to compute the hash value. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Hash.HashType type = 1; - */ - private $type = 0; - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - */ - private $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * The algorithm used to compute the hash value. - * @type string $value - * The hash value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The algorithm used to compute the hash value. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Hash.HashType type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The algorithm used to compute the hash value. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Hash.HashType type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\Hash\HashType::class); - $this->type = $var; - - return $this; - } - - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, False); - $this->value = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Hash/HashType.php b/ArtifactRegistry/src/V1beta2/Hash/HashType.php deleted file mode 100644 index bf8d013dc3d2..000000000000 --- a/ArtifactRegistry/src/V1beta2/Hash/HashType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Hash.HashType - */ -class HashType -{ - /** - * Unspecified. - * - * Generated from protobuf enum HASH_TYPE_UNSPECIFIED = 0; - */ - const HASH_TYPE_UNSPECIFIED = 0; - /** - * SHA256 hash. - * - * Generated from protobuf enum SHA256 = 1; - */ - const SHA256 = 1; - /** - * MD5 hash. - * - * Generated from protobuf enum MD5 = 2; - */ - const MD5 = 2; - - private static $valueToName = [ - self::HASH_TYPE_UNSPECIFIED => 'HASH_TYPE_UNSPECIFIED', - self::SHA256 => 'SHA256', - self::MD5 => 'MD5', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HashType::class, \Google\Cloud\ArtifactRegistry\V1beta2\Hash_HashType::class); - diff --git a/ArtifactRegistry/src/V1beta2/Hash_HashType.php b/ArtifactRegistry/src/V1beta2/Hash_HashType.php deleted file mode 100644 index b88cd4be1d96..000000000000 --- a/ArtifactRegistry/src/V1beta2/Hash_HashType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo - */ -class ImportAptArtifactsErrorInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - */ - private $error = null; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $gcs_source - * Google Cloud Storage location requested. - * @type \Google\Rpc\Status $error - * The detailed error status. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage location requested. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 1; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(1); - } - - public function hasGcsSource() - { - return $this->hasOneof(1); - } - - /** - * Google Cloud Storage location requested. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 1; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsGcsSource.php b/ArtifactRegistry/src/V1beta2/ImportAptArtifactsGcsSource.php deleted file mode 100644 index 04ecc8177ccc..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsGcsSource.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource - */ -class ImportAptArtifactsGcsSource extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - */ - private $uris; - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - */ - private $use_wildcards = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $uris - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * @type bool $use_wildcards - * Supports URI wildcards for matching multiple objects from a single URI. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUris() - { - return $this->uris; - } - - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUris($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->uris = $arr; - - return $this; - } - - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - * @return bool - */ - public function getUseWildcards() - { - return $this->use_wildcards; - } - - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - * @param bool $var - * @return $this - */ - public function setUseWildcards($var) - { - GPBUtil::checkBool($var); - $this->use_wildcards = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsMetadata.php b/ArtifactRegistry/src/V1beta2/ImportAptArtifactsMetadata.php deleted file mode 100644 index 82ea2506cca4..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata - */ -class ImportAptArtifactsMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsRequest.php b/ArtifactRegistry/src/V1beta2/ImportAptArtifactsRequest.php deleted file mode 100644 index 609c7e632718..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest - */ -class ImportAptArtifactsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $gcs_source - * Google Cloud Storage location where input content is located. - * @type string $parent - * The name of the parent resource where the artifacts will be imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 2; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(2); - } - - public function hasGcsSource() - { - return $this->hasOneof(2); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 2; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsResponse.php b/ArtifactRegistry/src/V1beta2/ImportAptArtifactsResponse.php deleted file mode 100644 index 9fc27ce1bca5..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse - */ -class ImportAptArtifactsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The Apt artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.AptArtifact apt_artifacts = 1; - */ - private $apt_artifacts; - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo errors = 2; - */ - private $errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact>|\Google\Protobuf\Internal\RepeatedField $apt_artifacts - * The Apt artifacts imported. - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsErrorInfo>|\Google\Protobuf\Internal\RepeatedField $errors - * Detailed error info for artifacts that were not imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * The Apt artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.AptArtifact apt_artifacts = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAptArtifacts() - { - return $this->apt_artifacts; - } - - /** - * The Apt artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.AptArtifact apt_artifacts = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAptArtifacts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact::class); - $this->apt_artifacts = $arr; - - return $this; - } - - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo errors = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo errors = 2; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsErrorInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsErrorInfo::class); - $this->errors = $arr; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsErrorInfo.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsErrorInfo.php deleted file mode 100644 index b8b08575396d..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsErrorInfo.php +++ /dev/null @@ -1,119 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo - */ -class ImportYumArtifactsErrorInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - */ - private $error = null; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource $gcs_source - * Google Cloud Storage location requested. - * @type \Google\Rpc\Status $error - * The detailed error status. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage location requested. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource gcs_source = 1; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(1); - } - - public function hasGcsSource() - { - return $this->hasOneof(1); - } - - /** - * Google Cloud Storage location requested. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource gcs_source = 1; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsGcsSource.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsGcsSource.php deleted file mode 100644 index 7cda21a8fad9..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsGcsSource.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource - */ -class ImportYumArtifactsGcsSource extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - */ - private $uris; - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - */ - private $use_wildcards = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $uris - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * @type bool $use_wildcards - * Supports URI wildcards for matching multiple objects from a single URI. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUris() - { - return $this->uris; - } - - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUris($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->uris = $arr; - - return $this; - } - - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - * @return bool - */ - public function getUseWildcards() - { - return $this->use_wildcards; - } - - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - * @param bool $var - * @return $this - */ - public function setUseWildcards($var) - { - GPBUtil::checkBool($var); - $this->use_wildcards = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsMetadata.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsMetadata.php deleted file mode 100644 index 9ad88cd05b9f..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata - */ -class ImportYumArtifactsMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsRequest.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsRequest.php deleted file mode 100644 index 9fb722be4c58..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest - */ -class ImportYumArtifactsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource $gcs_source - * Google Cloud Storage location where input content is located. - * @type string $parent - * The name of the parent resource where the artifacts will be imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource gcs_source = 2; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(2); - } - - public function hasGcsSource() - { - return $this->hasOneof(2); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource gcs_source = 2; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsResponse.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsResponse.php deleted file mode 100644 index e0ba4b63b2c8..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse - */ -class ImportYumArtifactsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The yum artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.YumArtifact yum_artifacts = 1; - */ - private $yum_artifacts; - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo errors = 2; - */ - private $errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact>|\Google\Protobuf\Internal\RepeatedField $yum_artifacts - * The yum artifacts imported. - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsErrorInfo>|\Google\Protobuf\Internal\RepeatedField $errors - * Detailed error info for artifacts that were not imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * The yum artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.YumArtifact yum_artifacts = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getYumArtifacts() - { - return $this->yum_artifacts; - } - - /** - * The yum artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.YumArtifact yum_artifacts = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setYumArtifacts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact::class); - $this->yum_artifacts = $arr; - - return $this; - } - - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo errors = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo errors = 2; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsErrorInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsErrorInfo::class); - $this->errors = $arr; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListFilesRequest.php b/ArtifactRegistry/src/V1beta2/ListFilesRequest.php deleted file mode 100644 index 6c97dc8d1696..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListFilesRequest.php +++ /dev/null @@ -1,205 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListFilesRequest - */ -class ListFilesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `name` - * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - */ - private $filter = ''; - /** - * The maximum number of files to return. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * @type string $filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `name` - * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * @type int $page_size - * The maximum number of files to return. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `name` - * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `name` - * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The maximum number of files to return. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of files to return. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListFilesResponse.php b/ArtifactRegistry/src/V1beta2/ListFilesResponse.php deleted file mode 100644 index b2acdbeb5e83..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListFilesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListFilesResponse - */ -class ListFilesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The files returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.File files = 1; - */ - private $files; - /** - * The token to retrieve the next page of files, or empty if there are no - * more files to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\File>|\Google\Protobuf\Internal\RepeatedField $files - * The files returned. - * @type string $next_page_token - * The token to retrieve the next page of files, or empty if there are no - * more files to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The files returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.File files = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFiles() - { - return $this->files; - } - - /** - * The files returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.File files = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\File>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFiles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\File::class); - $this->files = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of files, or empty if there are no - * more files to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of files, or empty if there are no - * more files to return. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListPackagesRequest.php b/ArtifactRegistry/src/V1beta2/ListPackagesRequest.php deleted file mode 100644 index 3a8f63870fd4..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListPackagesRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListPackagesRequest - */ -class ListPackagesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource whose packages will be listed. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * The maximum number of packages to return. - * Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The name of the parent resource whose packages will be listed. - * @type int $page_size - * The maximum number of packages to return. - * Maximum page size is 10,000. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The name of the parent resource whose packages will be listed. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource whose packages will be listed. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of packages to return. - * Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of packages to return. - * Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListPackagesResponse.php b/ArtifactRegistry/src/V1beta2/ListPackagesResponse.php deleted file mode 100644 index 9d404fa391a1..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListPackagesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListPackagesResponse - */ -class ListPackagesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The packages returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Package packages = 1; - */ - private $packages; - /** - * The token to retrieve the next page of packages, or empty if there are no - * more packages to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Package>|\Google\Protobuf\Internal\RepeatedField $packages - * The packages returned. - * @type string $next_page_token - * The token to retrieve the next page of packages, or empty if there are no - * more packages to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The packages returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Package packages = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPackages() - { - return $this->packages; - } - - /** - * The packages returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Package packages = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Package>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Package::class); - $this->packages = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of packages, or empty if there are no - * more packages to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of packages, or empty if there are no - * more packages to return. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListRepositoriesRequest.php b/ArtifactRegistry/src/V1beta2/ListRepositoriesRequest.php deleted file mode 100644 index ee38a3e8ab87..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListRepositoriesRequest.php +++ /dev/null @@ -1,135 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest - */ -class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource whose repositories will be listed. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * The maximum number of repositories to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource whose repositories will be listed. - * @type int $page_size - * The maximum number of repositories to return. Maximum page size is 1,000. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource whose repositories will be listed. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The name of the parent resource whose repositories will be listed. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of repositories to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of repositories to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListRepositoriesResponse.php b/ArtifactRegistry/src/V1beta2/ListRepositoriesResponse.php deleted file mode 100644 index 337a371c23a7..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListRepositoriesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse - */ -class ListRepositoriesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The repositories returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Repository repositories = 1; - */ - private $repositories; - /** - * The token to retrieve the next page of repositories, or empty if there are - * no more repositories to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Repository>|\Google\Protobuf\Internal\RepeatedField $repositories - * The repositories returned. - * @type string $next_page_token - * The token to retrieve the next page of repositories, or empty if there are - * no more repositories to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * The repositories returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Repository repositories = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRepositories() - { - return $this->repositories; - } - - /** - * The repositories returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Repository repositories = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Repository>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRepositories($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Repository::class); - $this->repositories = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of repositories, or empty if there are - * no more repositories to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of repositories, or empty if there are - * no more repositories to return. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListTagsRequest.php b/ArtifactRegistry/src/V1beta2/ListTagsRequest.php deleted file mode 100644 index 1212c472ed43..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListTagsRequest.php +++ /dev/null @@ -1,189 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListTagsRequest - */ -class ListTagsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource whose tags will be listed. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - */ - private $filter = ''; - /** - * The maximum number of tags to return. Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The name of the parent resource whose tags will be listed. - * @type string $filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * @type int $page_size - * The maximum number of tags to return. Maximum page size is 10,000. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the parent resource whose tags will be listed. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource whose tags will be listed. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The maximum number of tags to return. Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of tags to return. Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListTagsResponse.php b/ArtifactRegistry/src/V1beta2/ListTagsResponse.php deleted file mode 100644 index 12887c6976c8..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListTagsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListTagsResponse - */ -class ListTagsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The tags returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag tags = 1; - */ - private $tags; - /** - * The token to retrieve the next page of tags, or empty if there are no - * more tags to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Tag>|\Google\Protobuf\Internal\RepeatedField $tags - * The tags returned. - * @type string $next_page_token - * The token to retrieve the next page of tags, or empty if there are no - * more tags to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The tags returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag tags = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTags() - { - return $this->tags; - } - - /** - * The tags returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag tags = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Tag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Tag::class); - $this->tags = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of tags, or empty if there are no - * more tags to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of tags, or empty if there are no - * more tags to return. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListVersionsRequest.php b/ArtifactRegistry/src/V1beta2/ListVersionsRequest.php deleted file mode 100644 index 90b25b764721..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListVersionsRequest.php +++ /dev/null @@ -1,203 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListVersionsRequest - */ -class ListVersionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource whose versions will be listed. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * The maximum number of versions to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 4; - */ - private $view = 0; - /** - * Optional. The field to order the results by. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The name of the parent resource whose versions will be listed. - * @type int $page_size - * The maximum number of versions to return. Maximum page size is 1,000. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * @type int $view - * The view that should be returned in the response. - * @type string $order_by - * Optional. The field to order the results by. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The name of the parent resource whose versions will be listed. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource whose versions will be listed. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of versions to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of versions to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 4; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 4; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\VersionView::class); - $this->view = $var; - - return $this; - } - - /** - * Optional. The field to order the results by. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The field to order the results by. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListVersionsResponse.php b/ArtifactRegistry/src/V1beta2/ListVersionsResponse.php deleted file mode 100644 index 60eb07d871a8..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListVersionsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListVersionsResponse - */ -class ListVersionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The versions returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Version versions = 1; - */ - private $versions; - /** - * The token to retrieve the next page of versions, or empty if there are no - * more versions to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Version>|\Google\Protobuf\Internal\RepeatedField $versions - * The versions returned. - * @type string $next_page_token - * The token to retrieve the next page of versions, or empty if there are no - * more versions to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The versions returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Version versions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVersions() - { - return $this->versions; - } - - /** - * The versions returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Version versions = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Version>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Version::class); - $this->versions = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of versions, or empty if there are no - * more versions to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of versions, or empty if there are no - * more versions to return. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/OperationMetadata.php b/ArtifactRegistry/src/V1beta2/OperationMetadata.php deleted file mode 100644 index 4ddb09fc46da..000000000000 --- a/ArtifactRegistry/src/V1beta2/OperationMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.devtools.artifactregistry.v1beta2.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Service::initOnce(); - parent::__construct($data); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Package.php b/ArtifactRegistry/src/V1beta2/Package.php deleted file mode 100644 index 78b70d30c9f5..000000000000 --- a/ArtifactRegistry/src/V1beta2/Package.php +++ /dev/null @@ -1,197 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Package - */ -class Package extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the package, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The display name of the package. - * - * Generated from protobuf field string display_name = 2; - */ - private $display_name = ''; - /** - * The time when the package was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - private $create_time = null; - /** - * The time when the package was last updated. This includes publishing a new - * version of the package. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - private $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the package, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - * @type string $display_name - * The display name of the package. - * @type \Google\Protobuf\Timestamp $create_time - * The time when the package was created. - * @type \Google\Protobuf\Timestamp $update_time - * The time when the package was last updated. This includes publishing a new - * version of the package. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The name of the package, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the package, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The display name of the package. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the package. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The time when the package was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time when the package was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time when the package was last updated. This includes publishing a new - * version of the package. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * The time when the package was last updated. This includes publishing a new - * version of the package. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ProjectSettings.php b/ArtifactRegistry/src/V1beta2/ProjectSettings.php deleted file mode 100644 index 35382b3d31b5..000000000000 --- a/ArtifactRegistry/src/V1beta2/ProjectSettings.php +++ /dev/null @@ -1,117 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ProjectSettings - */ -class ProjectSettings extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the project's settings. - * Always of the form: - * projects/{project-id}/projectSettings - * In update request: never set - * In response: always set - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The redirection state of the legacy repositories in this project. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState legacy_redirection_state = 2; - */ - private $legacy_redirection_state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the project's settings. - * Always of the form: - * projects/{project-id}/projectSettings - * In update request: never set - * In response: always set - * @type int $legacy_redirection_state - * The redirection state of the legacy repositories in this project. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Settings::initOnce(); - parent::__construct($data); - } - - /** - * The name of the project's settings. - * Always of the form: - * projects/{project-id}/projectSettings - * In update request: never set - * In response: always set - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the project's settings. - * Always of the form: - * projects/{project-id}/projectSettings - * In update request: never set - * In response: always set - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The redirection state of the legacy repositories in this project. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState legacy_redirection_state = 2; - * @return int - */ - public function getLegacyRedirectionState() - { - return $this->legacy_redirection_state; - } - - /** - * The redirection state of the legacy repositories in this project. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState legacy_redirection_state = 2; - * @param int $var - * @return $this - */ - public function setLegacyRedirectionState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings\RedirectionState::class); - $this->legacy_redirection_state = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ProjectSettings/RedirectionState.php b/ArtifactRegistry/src/V1beta2/ProjectSettings/RedirectionState.php deleted file mode 100644 index 63c66fb968b9..000000000000 --- a/ArtifactRegistry/src/V1beta2/ProjectSettings/RedirectionState.php +++ /dev/null @@ -1,71 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState - */ -class RedirectionState -{ - /** - * No redirection status has been set. - * - * Generated from protobuf enum REDIRECTION_STATE_UNSPECIFIED = 0; - */ - const REDIRECTION_STATE_UNSPECIFIED = 0; - /** - * Redirection is disabled. - * - * Generated from protobuf enum REDIRECTION_FROM_GCR_IO_DISABLED = 1; - */ - const REDIRECTION_FROM_GCR_IO_DISABLED = 1; - /** - * Redirection is enabled. - * - * Generated from protobuf enum REDIRECTION_FROM_GCR_IO_ENABLED = 2; - */ - const REDIRECTION_FROM_GCR_IO_ENABLED = 2; - /** - * Redirection is enabled, and has been finalized so cannot be reverted. - * - * Generated from protobuf enum REDIRECTION_FROM_GCR_IO_FINALIZED = 3; - */ - const REDIRECTION_FROM_GCR_IO_FINALIZED = 3; - - private static $valueToName = [ - self::REDIRECTION_STATE_UNSPECIFIED => 'REDIRECTION_STATE_UNSPECIFIED', - self::REDIRECTION_FROM_GCR_IO_DISABLED => 'REDIRECTION_FROM_GCR_IO_DISABLED', - self::REDIRECTION_FROM_GCR_IO_ENABLED => 'REDIRECTION_FROM_GCR_IO_ENABLED', - self::REDIRECTION_FROM_GCR_IO_FINALIZED => 'REDIRECTION_FROM_GCR_IO_FINALIZED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RedirectionState::class, \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings_RedirectionState::class); - diff --git a/ArtifactRegistry/src/V1beta2/ProjectSettings_RedirectionState.php b/ArtifactRegistry/src/V1beta2/ProjectSettings_RedirectionState.php deleted file mode 100644 index 0ed24bea5283..000000000000 --- a/ArtifactRegistry/src/V1beta2/ProjectSettings_RedirectionState.php +++ /dev/null @@ -1,16 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Repository - */ -class Repository extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the repository, for example: - * "projects/p1/locations/us-central1/repositories/repo1". - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The format of packages that are stored in the repository. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.Format format = 2; - */ - private $format = 0; - /** - * The user-provided description of the repository. - * - * Generated from protobuf field string description = 3; - */ - private $description = ''; - /** - * Labels with user-defined metadata. - * This field may contain up to 64 entries. Label keys and values may be no - * longer than 63 characters. Label keys must begin with a lowercase letter - * and may only contain lowercase letters, numeric characters, underscores, - * and dashes. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * The time when the repository was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - private $create_time = null; - /** - * The time when the repository was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - private $update_time = null; - /** - * The Cloud KMS resource name of the customer managed encryption key that’s - * used to encrypt the contents of the Repository. Has the form: - * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - * This value may not be changed after the Repository has been created. - * - * Generated from protobuf field string kms_key_name = 8; - */ - private $kms_key_name = ''; - protected $format_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig $maven_config - * Maven repository config contains repository level configuration - * for the repositories of maven type. - * @type string $name - * The name of the repository, for example: - * "projects/p1/locations/us-central1/repositories/repo1". - * @type int $format - * The format of packages that are stored in the repository. - * @type string $description - * The user-provided description of the repository. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels with user-defined metadata. - * This field may contain up to 64 entries. Label keys and values may be no - * longer than 63 characters. Label keys must begin with a lowercase letter - * and may only contain lowercase letters, numeric characters, underscores, - * and dashes. - * @type \Google\Protobuf\Timestamp $create_time - * The time when the repository was created. - * @type \Google\Protobuf\Timestamp $update_time - * The time when the repository was last updated. - * @type string $kms_key_name - * The Cloud KMS resource name of the customer managed encryption key that’s - * used to encrypt the contents of the Repository. Has the form: - * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - * This value may not be changed after the Repository has been created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Maven repository config contains repository level configuration - * for the repositories of maven type. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig maven_config = 9; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig|null - */ - public function getMavenConfig() - { - return $this->readOneof(9); - } - - public function hasMavenConfig() - { - return $this->hasOneof(9); - } - - /** - * Maven repository config contains repository level configuration - * for the repositories of maven type. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig maven_config = 9; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig $var - * @return $this - */ - public function setMavenConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig::class); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * The name of the repository, for example: - * "projects/p1/locations/us-central1/repositories/repo1". - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the repository, for example: - * "projects/p1/locations/us-central1/repositories/repo1". - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The format of packages that are stored in the repository. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.Format format = 2; - * @return int - */ - public function getFormat() - { - return $this->format; - } - - /** - * The format of packages that are stored in the repository. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.Format format = 2; - * @param int $var - * @return $this - */ - public function setFormat($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository\Format::class); - $this->format = $var; - - return $this; - } - - /** - * The user-provided description of the repository. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The user-provided description of the repository. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Labels with user-defined metadata. - * This field may contain up to 64 entries. Label keys and values may be no - * longer than 63 characters. Label keys must begin with a lowercase letter - * and may only contain lowercase letters, numeric characters, underscores, - * and dashes. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels with user-defined metadata. - * This field may contain up to 64 entries. Label keys and values may be no - * longer than 63 characters. Label keys must begin with a lowercase letter - * and may only contain lowercase letters, numeric characters, underscores, - * and dashes. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * The time when the repository was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time when the repository was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time when the repository was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * The time when the repository was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * The Cloud KMS resource name of the customer managed encryption key that’s - * used to encrypt the contents of the Repository. Has the form: - * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - * This value may not be changed after the Repository has been created. - * - * Generated from protobuf field string kms_key_name = 8; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * The Cloud KMS resource name of the customer managed encryption key that’s - * used to encrypt the contents of the Repository. Has the form: - * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - * This value may not be changed after the Repository has been created. - * - * Generated from protobuf field string kms_key_name = 8; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * @return string - */ - public function getFormatConfig() - { - return $this->whichOneof("format_config"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Repository/Format.php b/ArtifactRegistry/src/V1beta2/Repository/Format.php deleted file mode 100644 index f0e7144895af..000000000000 --- a/ArtifactRegistry/src/V1beta2/Repository/Format.php +++ /dev/null @@ -1,92 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Repository.Format - */ -class Format -{ - /** - * Unspecified package format. - * - * Generated from protobuf enum FORMAT_UNSPECIFIED = 0; - */ - const FORMAT_UNSPECIFIED = 0; - /** - * Docker package format. - * - * Generated from protobuf enum DOCKER = 1; - */ - const DOCKER = 1; - /** - * Maven package format. - * - * Generated from protobuf enum MAVEN = 2; - */ - const MAVEN = 2; - /** - * NPM package format. - * - * Generated from protobuf enum NPM = 3; - */ - const NPM = 3; - /** - * APT package format. - * - * Generated from protobuf enum APT = 5; - */ - const APT = 5; - /** - * YUM package format. - * - * Generated from protobuf enum YUM = 6; - */ - const YUM = 6; - /** - * Python package format. - * - * Generated from protobuf enum PYTHON = 8; - */ - const PYTHON = 8; - - private static $valueToName = [ - self::FORMAT_UNSPECIFIED => 'FORMAT_UNSPECIFIED', - self::DOCKER => 'DOCKER', - self::MAVEN => 'MAVEN', - self::NPM => 'NPM', - self::APT => 'APT', - self::YUM => 'YUM', - self::PYTHON => 'PYTHON', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Format::class, \Google\Cloud\ArtifactRegistry\V1beta2\Repository_Format::class); - diff --git a/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig.php b/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig.php deleted file mode 100644 index cfc8302d1b41..000000000000 --- a/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig.php +++ /dev/null @@ -1,110 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig - */ -class MavenRepositoryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The repository with this flag will allow publishing - * the same snapshot versions. - * - * Generated from protobuf field bool allow_snapshot_overwrites = 1; - */ - private $allow_snapshot_overwrites = false; - /** - * Version policy defines the versions that the registry will accept. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy version_policy = 2; - */ - private $version_policy = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $allow_snapshot_overwrites - * The repository with this flag will allow publishing - * the same snapshot versions. - * @type int $version_policy - * Version policy defines the versions that the registry will accept. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * The repository with this flag will allow publishing - * the same snapshot versions. - * - * Generated from protobuf field bool allow_snapshot_overwrites = 1; - * @return bool - */ - public function getAllowSnapshotOverwrites() - { - return $this->allow_snapshot_overwrites; - } - - /** - * The repository with this flag will allow publishing - * the same snapshot versions. - * - * Generated from protobuf field bool allow_snapshot_overwrites = 1; - * @param bool $var - * @return $this - */ - public function setAllowSnapshotOverwrites($var) - { - GPBUtil::checkBool($var); - $this->allow_snapshot_overwrites = $var; - - return $this; - } - - /** - * Version policy defines the versions that the registry will accept. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy version_policy = 2; - * @return int - */ - public function getVersionPolicy() - { - return $this->version_policy; - } - - /** - * Version policy defines the versions that the registry will accept. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy version_policy = 2; - * @param int $var - * @return $this - */ - public function setVersionPolicy($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig\VersionPolicy::class); - $this->version_policy = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MavenRepositoryConfig::class, \Google\Cloud\ArtifactRegistry\V1beta2\Repository_MavenRepositoryConfig::class); - diff --git a/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig/VersionPolicy.php b/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig/VersionPolicy.php deleted file mode 100644 index 0fd8426ce626..000000000000 --- a/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig/VersionPolicy.php +++ /dev/null @@ -1,66 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy - */ -class VersionPolicy -{ - /** - * VERSION_POLICY_UNSPECIFIED - the version policy is not defined. - * When the version policy is not defined, no validation is performed - * for the versions. - * - * Generated from protobuf enum VERSION_POLICY_UNSPECIFIED = 0; - */ - const VERSION_POLICY_UNSPECIFIED = 0; - /** - * RELEASE - repository will accept only Release versions. - * - * Generated from protobuf enum RELEASE = 1; - */ - const RELEASE = 1; - /** - * SNAPSHOT - repository will accept only Snapshot versions. - * - * Generated from protobuf enum SNAPSHOT = 2; - */ - const SNAPSHOT = 2; - - private static $valueToName = [ - self::VERSION_POLICY_UNSPECIFIED => 'VERSION_POLICY_UNSPECIFIED', - self::RELEASE => 'RELEASE', - self::SNAPSHOT => 'SNAPSHOT', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(VersionPolicy::class, \Google\Cloud\ArtifactRegistry\V1beta2\Repository_MavenRepositoryConfig_VersionPolicy::class); - diff --git a/ArtifactRegistry/src/V1beta2/Repository_Format.php b/ArtifactRegistry/src/V1beta2/Repository_Format.php deleted file mode 100644 index 4d3d83b8716c..000000000000 --- a/ArtifactRegistry/src/V1beta2/Repository_Format.php +++ /dev/null @@ -1,16 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Tag - */ -class Tag extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the tag, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - * If the package part contains slashes, the slashes are escaped. - * The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else - * must be URL encoded. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string version = 2; - */ - private $version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the tag, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - * If the package part contains slashes, the slashes are escaped. - * The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else - * must be URL encoded. - * @type string $version - * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the tag, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - * If the package part contains slashes, the slashes are escaped. - * The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else - * must be URL encoded. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the tag, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - * If the package part contains slashes, the slashes are escaped. - * The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else - * must be URL encoded. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string version = 2; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string version = 2; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/UpdateProjectSettingsRequest.php b/ArtifactRegistry/src/V1beta2/UpdateProjectSettingsRequest.php deleted file mode 100644 index a171a387495a..000000000000 --- a/ArtifactRegistry/src/V1beta2/UpdateProjectSettingsRequest.php +++ /dev/null @@ -1,121 +0,0 @@ -google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest - */ -class UpdateProjectSettingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The project settings. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings project_settings = 2; - */ - private $project_settings = null; - /** - * Field mask to support partial updates. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings $project_settings - * The project settings. - * @type \Google\Protobuf\FieldMask $update_mask - * Field mask to support partial updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Settings::initOnce(); - parent::__construct($data); - } - - /** - * The project settings. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings project_settings = 2; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings|null - */ - public function getProjectSettings() - { - return $this->project_settings; - } - - public function hasProjectSettings() - { - return isset($this->project_settings); - } - - public function clearProjectSettings() - { - unset($this->project_settings); - } - - /** - * The project settings. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings project_settings = 2; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings $var - * @return $this - */ - public function setProjectSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings::class); - $this->project_settings = $var; - - return $this; - } - - /** - * Field mask to support partial updates. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Field mask to support partial updates. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/UpdateRepositoryRequest.php b/ArtifactRegistry/src/V1beta2/UpdateRepositoryRequest.php deleted file mode 100644 index f10bbce98dc9..000000000000 --- a/ArtifactRegistry/src/V1beta2/UpdateRepositoryRequest.php +++ /dev/null @@ -1,129 +0,0 @@ -google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest - */ -class UpdateRepositoryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The repository that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 1; - */ - private $repository = null; - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Repository $repository - * The repository that replaces the resource on the server. - * @type \Google\Protobuf\FieldMask $update_mask - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * The repository that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 1; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Repository|null - */ - public function getRepository() - { - return $this->repository; - } - - public function hasRepository() - { - return isset($this->repository); - } - - public function clearRepository() - { - unset($this->repository); - } - - /** - * The repository that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 1; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Repository $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository::class); - $this->repository = $var; - - return $this; - } - - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/UpdateTagRequest.php b/ArtifactRegistry/src/V1beta2/UpdateTagRequest.php deleted file mode 100644 index 0ee71a51ac92..000000000000 --- a/ArtifactRegistry/src/V1beta2/UpdateTagRequest.php +++ /dev/null @@ -1,129 +0,0 @@ -google.devtools.artifactregistry.v1beta2.UpdateTagRequest - */ -class UpdateTagRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The tag that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 1; - */ - private $tag = null; - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Tag $tag - * The tag that replaces the resource on the server. - * @type \Google\Protobuf\FieldMask $update_mask - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The tag that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 1; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Tag|null - */ - public function getTag() - { - return $this->tag; - } - - public function hasTag() - { - return isset($this->tag); - } - - public function clearTag() - { - unset($this->tag); - } - - /** - * The tag that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 1; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Tag $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Tag::class); - $this->tag = $var; - - return $this; - } - - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Version.php b/ArtifactRegistry/src/V1beta2/Version.php deleted file mode 100644 index d04ce13e5d7e..000000000000 --- a/ArtifactRegistry/src/V1beta2/Version.php +++ /dev/null @@ -1,297 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Version - */ -class Version extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Optional. Description of the version, as specified in its metadata. - * - * Generated from protobuf field string description = 3; - */ - private $description = ''; - /** - * The time when the version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - private $create_time = null; - /** - * The time when the version was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - private $update_time = null; - /** - * Output only. A list of related tags. Will contain up to 100 tags that - * reference this version. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag related_tags = 7; - */ - private $related_tags; - /** - * Output only. Repository-specific Metadata stored against this version. - * The fields returned are defined by the underlying repository-specific - * resource. Currently, the only resource in use is - * [DockerImage][google.devtools.artifactregistry.v1.DockerImage] - * - * Generated from protobuf field .google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * @type string $description - * Optional. Description of the version, as specified in its metadata. - * @type \Google\Protobuf\Timestamp $create_time - * The time when the version was created. - * @type \Google\Protobuf\Timestamp $update_time - * The time when the version was last updated. - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Tag>|\Google\Protobuf\Internal\RepeatedField $related_tags - * Output only. A list of related tags. Will contain up to 100 tags that - * reference this version. - * @type \Google\Protobuf\Struct $metadata - * Output only. Repository-specific Metadata stored against this version. - * The fields returned are defined by the underlying repository-specific - * resource. Currently, the only resource in use is - * [DockerImage][google.devtools.artifactregistry.v1.DockerImage] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Description of the version, as specified in its metadata. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. Description of the version, as specified in its metadata. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * The time when the version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time when the version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time when the version was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * The time when the version was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. A list of related tags. Will contain up to 100 tags that - * reference this version. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag related_tags = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRelatedTags() - { - return $this->related_tags; - } - - /** - * Output only. A list of related tags. Will contain up to 100 tags that - * reference this version. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag related_tags = 7; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Tag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRelatedTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Tag::class); - $this->related_tags = $arr; - - return $this; - } - - /** - * Output only. Repository-specific Metadata stored against this version. - * The fields returned are defined by the underlying repository-specific - * resource. Currently, the only resource in use is - * [DockerImage][google.devtools.artifactregistry.v1.DockerImage] - * - * Generated from protobuf field .google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Struct|null - */ - public function getMetadata() - { - return $this->metadata; - } - - public function hasMetadata() - { - return isset($this->metadata); - } - - public function clearMetadata() - { - unset($this->metadata); - } - - /** - * Output only. Repository-specific Metadata stored against this version. - * The fields returned are defined by the underlying repository-specific - * resource. Currently, the only resource in use is - * [DockerImage][google.devtools.artifactregistry.v1.DockerImage] - * - * Generated from protobuf field .google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->metadata = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/VersionView.php b/ArtifactRegistry/src/V1beta2/VersionView.php deleted file mode 100644 index 9de024bf381d..000000000000 --- a/ArtifactRegistry/src/V1beta2/VersionView.php +++ /dev/null @@ -1,63 +0,0 @@ -google.devtools.artifactregistry.v1beta2.VersionView - */ -class VersionView -{ - /** - * The default / unset value. - * The API will default to the BASIC view. - * - * Generated from protobuf enum VERSION_VIEW_UNSPECIFIED = 0; - */ - const VERSION_VIEW_UNSPECIFIED = 0; - /** - * Includes basic information about the version, but not any related tags. - * - * Generated from protobuf enum BASIC = 1; - */ - const BASIC = 1; - /** - * Include everything. - * - * Generated from protobuf enum FULL = 2; - */ - const FULL = 2; - - private static $valueToName = [ - self::VERSION_VIEW_UNSPECIFIED => 'VERSION_VIEW_UNSPECIFIED', - self::BASIC => 'BASIC', - self::FULL => 'FULL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/ArtifactRegistry/src/V1beta2/YumArtifact.php b/ArtifactRegistry/src/V1beta2/YumArtifact.php deleted file mode 100644 index f8d44fa515b9..000000000000 --- a/ArtifactRegistry/src/V1beta2/YumArtifact.php +++ /dev/null @@ -1,169 +0,0 @@ -google.devtools.artifactregistry.v1beta2.YumArtifact - */ -class YumArtifact extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Output only. The yum package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $package_name = ''; - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $package_type = 0; - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $architecture = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The Artifact Registry resource name of the artifact. - * @type string $package_name - * Output only. The yum package name of the artifact. - * @type int $package_type - * Output only. An artifact is a binary or source package. - * @type string $architecture - * Output only. Operating system architecture of the artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The yum package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPackageName() - { - return $this->package_name; - } - - /** - * Output only. The yum package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPackageName($var) - { - GPBUtil::checkString($var, True); - $this->package_name = $var; - - return $this; - } - - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getPackageType() - { - return $this->package_type; - } - - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setPackageType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact\PackageType::class); - $this->package_type = $var; - - return $this; - } - - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getArchitecture() - { - return $this->architecture; - } - - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setArchitecture($var) - { - GPBUtil::checkString($var, True); - $this->architecture = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/YumArtifact/PackageType.php b/ArtifactRegistry/src/V1beta2/YumArtifact/PackageType.php deleted file mode 100644 index 6b7517f0879e..000000000000 --- a/ArtifactRegistry/src/V1beta2/YumArtifact/PackageType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType - */ -class PackageType -{ - /** - * Package type is not specified. - * - * Generated from protobuf enum PACKAGE_TYPE_UNSPECIFIED = 0; - */ - const PACKAGE_TYPE_UNSPECIFIED = 0; - /** - * Binary package (.rpm). - * - * Generated from protobuf enum BINARY = 1; - */ - const BINARY = 1; - /** - * Source package (.srpm). - * - * Generated from protobuf enum SOURCE = 2; - */ - const SOURCE = 2; - - private static $valueToName = [ - self::PACKAGE_TYPE_UNSPECIFIED => 'PACKAGE_TYPE_UNSPECIFIED', - self::BINARY => 'BINARY', - self::SOURCE => 'SOURCE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PackageType::class, \Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact_PackageType::class); - diff --git a/ArtifactRegistry/src/V1beta2/YumArtifact_PackageType.php b/ArtifactRegistry/src/V1beta2/YumArtifact_PackageType.php deleted file mode 100644 index 9b9ef4559029..000000000000 --- a/ArtifactRegistry/src/V1beta2/YumArtifact_PackageType.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - 'google.devtools.artifactregistry.v1beta2.ArtifactRegistry' => [ - 'CreateRepository' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\Repository', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeletePackage' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteRepository' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteVersion' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ImportAptArtifacts' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsResponse', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ImportYumArtifacts' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsResponse', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListFiles' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFiles', - ], - ], - 'ListPackages' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getPackages', - ], - ], - 'ListRepositories' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getRepositories', - ], - ], - 'ListTags' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTags', - ], - ], - 'ListVersions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getVersions', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - ], - ], -]; diff --git a/ArtifactRegistry/src/V1beta2/resources/artifact_registry_rest_client_config.php b/ArtifactRegistry/src/V1beta2/resources/artifact_registry_rest_client_config.php deleted file mode 100644 index 9e1bfa389e17..000000000000 --- a/ArtifactRegistry/src/V1beta2/resources/artifact_registry_rest_client_config.php +++ /dev/null @@ -1,353 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.devtools.artifactregistry.v1beta2.ArtifactRegistry' => [ - 'CreateRepository' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*}/repositories', - 'body' => 'repository', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateTag' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/tags', - 'body' => 'tag', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeletePackage' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteRepository' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteTag' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteVersion' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFile' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/files/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{resource=projects/*/locations/*/repositories/*}:getIamPolicy', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetPackage' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetProjectSettings' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/projectSettings}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetRepository' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetTag' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetVersion' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ImportAptArtifacts' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*}/aptArtifacts:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ImportYumArtifacts' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*}/yumArtifacts:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListFiles' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*}/files', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListPackages' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*}/packages', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListRepositories' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*}/repositories', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListTags' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/tags', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListVersions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/versions', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{resource=projects/*/locations/*/repositories/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{resource=projects/*/locations/*/repositories/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateProjectSettings' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta2/{project_settings.name=projects/*/projectSettings}', - 'body' => 'project_settings', - 'placeholders' => [ - 'project_settings.name' => [ - 'getters' => [ - 'getProjectSettings', - 'getName', - ], - ], - ], - ], - 'UpdateRepository' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta2/{repository.name=projects/*/locations/*/repositories/*}', - 'body' => 'repository', - 'placeholders' => [ - 'repository.name' => [ - 'getters' => [ - 'getRepository', - 'getName', - ], - ], - ], - ], - 'UpdateTag' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta2/{tag.name=projects/*/locations/*/repositories/*/packages/*/tags/*}', - 'body' => 'tag', - 'placeholders' => [ - 'tag.name' => [ - 'getters' => [ - 'getTag', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php b/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php index a1dd03f0a660..f718ccb27026 100644 --- a/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php +++ b/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ArtifactRegistryClient */ @@ -160,8 +162,7 @@ public function batchDeleteVersionsTest() $formattedNames = [ $gapicClient->versionName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]', '[VERSION]'), ]; - $request = (new BatchDeleteVersionsRequest()) - ->setNames($formattedNames); + $request = (new BatchDeleteVersionsRequest())->setNames($formattedNames); $response = $gapicClient->batchDeleteVersions($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -171,7 +172,10 @@ public function batchDeleteVersionsTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/BatchDeleteVersions', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/BatchDeleteVersions', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getNames(); $this->assertProtobufEquals($formattedNames, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -217,19 +221,21 @@ public function batchDeleteVersionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedNames = [ $gapicClient->versionName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]', '[VERSION]'), ]; - $request = (new BatchDeleteVersionsRequest()) - ->setNames($formattedNames); + $request = (new BatchDeleteVersionsRequest())->setNames($formattedNames); $response = $gapicClient->batchDeleteVersions($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -295,8 +301,7 @@ public function createRepositoryTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new CreateRepositoryRequest()) - ->setParent($formattedParent); + $request = (new CreateRepositoryRequest())->setParent($formattedParent); $response = $gapicClient->createRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -352,17 +357,19 @@ public function createRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new CreateRepositoryRequest()) - ->setParent($formattedParent); + $request = (new CreateRepositoryRequest())->setParent($formattedParent); $response = $gapicClient->createRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -422,12 +429,15 @@ public function createTagExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new CreateTagRequest(); try { @@ -474,8 +484,7 @@ public function deletePackageTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->packageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]'); - $request = (new DeletePackageRequest()) - ->setName($formattedName); + $request = (new DeletePackageRequest())->setName($formattedName); $response = $gapicClient->deletePackage($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -531,17 +540,19 @@ public function deletePackageExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->packageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]'); - $request = (new DeletePackageRequest()) - ->setName($formattedName); + $request = (new DeletePackageRequest())->setName($formattedName); $response = $gapicClient->deletePackage($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -595,8 +606,7 @@ public function deleteRepositoryTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); $response = $gapicClient->deleteRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -652,17 +662,19 @@ public function deleteRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); $response = $gapicClient->deleteRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -717,12 +729,15 @@ public function deleteTagExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new DeleteTagRequest(); try { @@ -821,12 +836,15 @@ public function deleteVersionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); $request = new DeleteVersionRequest(); $response = $gapicClient->deleteVersion($request); @@ -872,8 +890,7 @@ public function getDockerImageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->dockerImageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[DOCKER_IMAGE]'); - $request = (new GetDockerImageRequest()) - ->setName($formattedName); + $request = (new GetDockerImageRequest())->setName($formattedName); $response = $gapicClient->getDockerImage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -897,17 +914,19 @@ public function getDockerImageExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dockerImageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[DOCKER_IMAGE]'); - $request = (new GetDockerImageRequest()) - ->setName($formattedName); + $request = (new GetDockerImageRequest())->setName($formattedName); try { $gapicClient->getDockerImage($request); // If the $gapicClient method call did not throw, fail the test @@ -940,8 +959,7 @@ public function getFileTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->fileName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[FILE]'); - $request = (new GetFileRequest()) - ->setName($formattedName); + $request = (new GetFileRequest())->setName($formattedName); $response = $gapicClient->getFile($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -965,17 +983,19 @@ public function getFileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->fileName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[FILE]'); - $request = (new GetFileRequest()) - ->setName($formattedName); + $request = (new GetFileRequest())->setName($formattedName); try { $gapicClient->getFile($request); // If the $gapicClient method call did not throw, fail the test @@ -1006,8 +1026,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1031,17 +1050,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1078,8 +1099,7 @@ public function getMavenArtifactTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->mavenArtifactName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[MAVEN_ARTIFACT]'); - $request = (new GetMavenArtifactRequest()) - ->setName($formattedName); + $request = (new GetMavenArtifactRequest())->setName($formattedName); $response = $gapicClient->getMavenArtifact($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1103,17 +1123,19 @@ public function getMavenArtifactExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->mavenArtifactName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[MAVEN_ARTIFACT]'); - $request = (new GetMavenArtifactRequest()) - ->setName($formattedName); + $request = (new GetMavenArtifactRequest())->setName($formattedName); try { $gapicClient->getMavenArtifact($request); // If the $gapicClient method call did not throw, fail the test @@ -1146,8 +1168,7 @@ public function getNpmPackageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->npmPackageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[NPM_PACKAGE]'); - $request = (new GetNpmPackageRequest()) - ->setName($formattedName); + $request = (new GetNpmPackageRequest())->setName($formattedName); $response = $gapicClient->getNpmPackage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1171,17 +1192,19 @@ public function getNpmPackageExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->npmPackageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[NPM_PACKAGE]'); - $request = (new GetNpmPackageRequest()) - ->setName($formattedName); + $request = (new GetNpmPackageRequest())->setName($formattedName); try { $gapicClient->getNpmPackage($request); // If the $gapicClient method call did not throw, fail the test @@ -1212,8 +1235,7 @@ public function getPackageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->packageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]'); - $request = (new GetPackageRequest()) - ->setName($formattedName); + $request = (new GetPackageRequest())->setName($formattedName); $response = $gapicClient->getPackage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1237,17 +1259,19 @@ public function getPackageExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->packageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]'); - $request = (new GetPackageRequest()) - ->setName($formattedName); + $request = (new GetPackageRequest())->setName($formattedName); try { $gapicClient->getPackage($request); // If the $gapicClient method call did not throw, fail the test @@ -1276,8 +1300,7 @@ public function getProjectSettingsTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->projectSettingsName('[PROJECT]'); - $request = (new GetProjectSettingsRequest()) - ->setName($formattedName); + $request = (new GetProjectSettingsRequest())->setName($formattedName); $response = $gapicClient->getProjectSettings($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1301,17 +1324,19 @@ public function getProjectSettingsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->projectSettingsName('[PROJECT]'); - $request = (new GetProjectSettingsRequest()) - ->setName($formattedName); + $request = (new GetProjectSettingsRequest())->setName($formattedName); try { $gapicClient->getProjectSettings($request); // If the $gapicClient method call did not throw, fail the test @@ -1346,8 +1371,7 @@ public function getPythonPackageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->pythonPackageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PYTHON_PACKAGE]'); - $request = (new GetPythonPackageRequest()) - ->setName($formattedName); + $request = (new GetPythonPackageRequest())->setName($formattedName); $response = $gapicClient->getPythonPackage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1371,17 +1395,19 @@ public function getPythonPackageExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->pythonPackageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PYTHON_PACKAGE]'); - $request = (new GetPythonPackageRequest()) - ->setName($formattedName); + $request = (new GetPythonPackageRequest())->setName($formattedName); try { $gapicClient->getPythonPackage($request); // If the $gapicClient method call did not throw, fail the test @@ -1420,8 +1446,7 @@ public function getRepositoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); $response = $gapicClient->getRepository($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1445,17 +1470,19 @@ public function getRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); try { $gapicClient->getRepository($request); // If the $gapicClient method call did not throw, fail the test @@ -1506,12 +1533,15 @@ public function getTagExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetTagRequest(); try { @@ -1542,8 +1572,7 @@ public function getVPCSCConfigTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->vpcscConfigName('[PROJECT]', '[LOCATION]'); - $request = (new GetVPCSCConfigRequest()) - ->setName($formattedName); + $request = (new GetVPCSCConfigRequest())->setName($formattedName); $response = $gapicClient->getVPCSCConfig($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1567,17 +1596,19 @@ public function getVPCSCConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->vpcscConfigName('[PROJECT]', '[LOCATION]'); - $request = (new GetVPCSCConfigRequest()) - ->setName($formattedName); + $request = (new GetVPCSCConfigRequest())->setName($formattedName); try { $gapicClient->getVPCSCConfig($request); // If the $gapicClient method call did not throw, fail the test @@ -1628,12 +1659,15 @@ public function getVersionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetVersionRequest(); try { @@ -1688,7 +1722,10 @@ public function importAptArtifactsTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportAptArtifacts', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportAptArtifacts', + $actualApiFuncCall + ); $expectedOperationsRequestObject = new GetOperationRequest(); $expectedOperationsRequestObject->setName('operations/importAptArtifactsTest'); $response->pollUntilComplete([ @@ -1732,12 +1769,15 @@ public function importAptArtifactsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); $request = new ImportAptArtifactsRequest(); $response = $gapicClient->importAptArtifacts($request); @@ -1801,7 +1841,10 @@ public function importYumArtifactsTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportYumArtifacts', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportYumArtifacts', + $actualApiFuncCall + ); $expectedOperationsRequestObject = new GetOperationRequest(); $expectedOperationsRequestObject->setName('operations/importYumArtifactsTest'); $response->pollUntilComplete([ @@ -1845,12 +1888,15 @@ public function importYumArtifactsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); $request = new ImportYumArtifactsRequest(); $response = $gapicClient->importYumArtifacts($request); @@ -1886,17 +1932,14 @@ public function listDockerImagesTest() // Mock response $nextPageToken = ''; $dockerImagesElement = new DockerImage(); - $dockerImages = [ - $dockerImagesElement, - ]; + $dockerImages = [$dockerImagesElement]; $expectedResponse = new ListDockerImagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDockerImages($dockerImages); $transport->addResponse($expectedResponse); // Mock request $parent = 'parent-995424086'; - $request = (new ListDockerImagesRequest()) - ->setParent($parent); + $request = (new ListDockerImagesRequest())->setParent($parent); $response = $gapicClient->listDockerImages($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1923,17 +1966,19 @@ public function listDockerImagesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $parent = 'parent-995424086'; - $request = (new ListDockerImagesRequest()) - ->setParent($parent); + $request = (new ListDockerImagesRequest())->setParent($parent); try { $gapicClient->listDockerImages($request); // If the $gapicClient method call did not throw, fail the test @@ -1958,17 +2003,14 @@ public function listFilesTest() // Mock response $nextPageToken = ''; $filesElement = new File(); - $files = [ - $filesElement, - ]; + $files = [$filesElement]; $expectedResponse = new ListFilesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFiles($files); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListFilesRequest()) - ->setParent($formattedParent); + $request = (new ListFilesRequest())->setParent($formattedParent); $response = $gapicClient->listFiles($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1995,17 +2037,19 @@ public function listFilesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListFilesRequest()) - ->setParent($formattedParent); + $request = (new ListFilesRequest())->setParent($formattedParent); try { $gapicClient->listFiles($request); // If the $gapicClient method call did not throw, fail the test @@ -2030,17 +2074,14 @@ public function listMavenArtifactsTest() // Mock response $nextPageToken = ''; $mavenArtifactsElement = new MavenArtifact(); - $mavenArtifacts = [ - $mavenArtifactsElement, - ]; + $mavenArtifacts = [$mavenArtifactsElement]; $expectedResponse = new ListMavenArtifactsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMavenArtifacts($mavenArtifacts); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListMavenArtifactsRequest()) - ->setParent($formattedParent); + $request = (new ListMavenArtifactsRequest())->setParent($formattedParent); $response = $gapicClient->listMavenArtifacts($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2067,17 +2108,19 @@ public function listMavenArtifactsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListMavenArtifactsRequest()) - ->setParent($formattedParent); + $request = (new ListMavenArtifactsRequest())->setParent($formattedParent); try { $gapicClient->listMavenArtifacts($request); // If the $gapicClient method call did not throw, fail the test @@ -2102,17 +2145,14 @@ public function listNpmPackagesTest() // Mock response $nextPageToken = ''; $npmPackagesElement = new NpmPackage(); - $npmPackages = [ - $npmPackagesElement, - ]; + $npmPackages = [$npmPackagesElement]; $expectedResponse = new ListNpmPackagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setNpmPackages($npmPackages); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListNpmPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListNpmPackagesRequest())->setParent($formattedParent); $response = $gapicClient->listNpmPackages($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2139,17 +2179,19 @@ public function listNpmPackagesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListNpmPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListNpmPackagesRequest())->setParent($formattedParent); try { $gapicClient->listNpmPackages($request); // If the $gapicClient method call did not throw, fail the test @@ -2174,17 +2216,14 @@ public function listPackagesTest() // Mock response $nextPageToken = ''; $packagesElement = new Package(); - $packages = [ - $packagesElement, - ]; + $packages = [$packagesElement]; $expectedResponse = new ListPackagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setPackages($packages); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListPackagesRequest())->setParent($formattedParent); $response = $gapicClient->listPackages($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2211,17 +2250,19 @@ public function listPackagesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListPackagesRequest())->setParent($formattedParent); try { $gapicClient->listPackages($request); // If the $gapicClient method call did not throw, fail the test @@ -2246,17 +2287,14 @@ public function listPythonPackagesTest() // Mock response $nextPageToken = ''; $pythonPackagesElement = new PythonPackage(); - $pythonPackages = [ - $pythonPackagesElement, - ]; + $pythonPackages = [$pythonPackagesElement]; $expectedResponse = new ListPythonPackagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setPythonPackages($pythonPackages); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPythonPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListPythonPackagesRequest())->setParent($formattedParent); $response = $gapicClient->listPythonPackages($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2283,17 +2321,19 @@ public function listPythonPackagesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPythonPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListPythonPackagesRequest())->setParent($formattedParent); try { $gapicClient->listPythonPackages($request); // If the $gapicClient method call did not throw, fail the test @@ -2318,17 +2358,14 @@ public function listRepositoriesTest() // Mock response $nextPageToken = ''; $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; + $repositories = [$repositoriesElement]; $expectedResponse = new ListRepositoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRepositories($repositories); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); $response = $gapicClient->listRepositories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2355,17 +2392,19 @@ public function listRepositoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); try { $gapicClient->listRepositories($request); // If the $gapicClient method call did not throw, fail the test @@ -2390,9 +2429,7 @@ public function listTagsTest() // Mock response $nextPageToken = ''; $tagsElement = new Tag(); - $tags = [ - $tagsElement, - ]; + $tags = [$tagsElement]; $expectedResponse = new ListTagsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTags($tags); @@ -2422,12 +2459,15 @@ public function listTagsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListTagsRequest(); try { @@ -2454,9 +2494,7 @@ public function listVersionsTest() // Mock response $nextPageToken = ''; $versionsElement = new Version(); - $versions = [ - $versionsElement, - ]; + $versions = [$versionsElement]; $expectedResponse = new ListVersionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setVersions($versions); @@ -2486,12 +2524,15 @@ public function listVersionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListVersionsRequest(); try { @@ -2525,9 +2566,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2553,19 +2592,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2593,9 +2633,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2621,19 +2659,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2667,7 +2706,10 @@ public function updateProjectSettingsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateProjectSettings', $actualFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateProjectSettings', + $actualFuncCall + ); $this->assertTrue($transport->isExhausted()); } @@ -2682,12 +2724,15 @@ public function updateProjectSettingsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new UpdateProjectSettingsRequest(); try { @@ -2748,12 +2793,15 @@ public function updateRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new UpdateRepositoryRequest(); try { @@ -2806,12 +2854,15 @@ public function updateTagExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new UpdateTagRequest(); try { @@ -2862,12 +2913,15 @@ public function updateVPCSCConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new UpdateVPCSCConfigRequest(); try { @@ -2922,12 +2976,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -2954,9 +3011,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -2986,12 +3041,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -3040,8 +3098,7 @@ public function batchDeleteVersionsAsyncTest() $formattedNames = [ $gapicClient->versionName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]', '[VERSION]'), ]; - $request = (new BatchDeleteVersionsRequest()) - ->setNames($formattedNames); + $request = (new BatchDeleteVersionsRequest())->setNames($formattedNames); $response = $gapicClient->batchDeleteVersionsAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3051,7 +3108,10 @@ public function batchDeleteVersionsAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/BatchDeleteVersions', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/BatchDeleteVersions', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getNames(); $this->assertProtobufEquals($formattedNames, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); diff --git a/ArtifactRegistry/tests/Unit/V1beta2/ArtifactRegistryClientTest.php b/ArtifactRegistry/tests/Unit/V1beta2/ArtifactRegistryClientTest.php deleted file mode 100644 index 24c868517e30..000000000000 --- a/ArtifactRegistry/tests/Unit/V1beta2/ArtifactRegistryClientTest.php +++ /dev/null @@ -1,2017 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ArtifactRegistryClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ArtifactRegistryClient($options); - } - - /** @test */ - public function createRepositoryTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $kmsKeyName = 'kmsKeyName2094986649'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setKmsKeyName($kmsKeyName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createRepositoryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->createRepository($formattedParent); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/CreateRepository', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRepositoryTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createRepositoryExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->createRepository($formattedParent); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRepositoryTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTagTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $version = 'version351608024'; - $expectedResponse = new Tag(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $transport->addResponse($expectedResponse); - $response = $gapicClient->createTag(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/CreateTag', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTagExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->createTag(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deletePackageTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deletePackageTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deletePackageTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->deletePackage(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeletePackage', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deletePackageTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deletePackageExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deletePackageTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - $response = $gapicClient->deletePackage(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deletePackageTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteRepositoryTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteRepositoryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->deleteRepository($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteRepository', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteRepositoryExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->deleteRepository($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTagTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - $gapicClient->deleteTag(); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteTag', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTagExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->deleteTag(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->deleteVersion(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteVersion', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - $response = $gapicClient->deleteVersion(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $sizeBytes = 1796325715; - $owner = 'owner106164915'; - $expectedResponse = new File(); - $expectedResponse->setName($name2); - $expectedResponse->setSizeBytes($sizeBytes); - $expectedResponse->setOwner($owner); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getFile(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetFile', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFileExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getFile(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPackageTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Package(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getPackage(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetPackage', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPackageExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getPackage(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProjectSettingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new ProjectSettings(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectSettingsName('[PROJECT]'); - $response = $gapicClient->getProjectSettings($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetProjectSettings', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProjectSettingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->projectSettingsName('[PROJECT]'); - try { - $gapicClient->getProjectSettings($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $kmsKeyName = 'kmsKeyName2094986649'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setKmsKeyName($kmsKeyName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->getRepository($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetRepository', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRepositoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->getRepository($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTagTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $version = 'version351608024'; - $expectedResponse = new Tag(); - $expectedResponse->setName($name2); - $expectedResponse->setVersion($version); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getTag(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetTag', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTagExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getTag(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Version(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getVersion(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetVersion', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getVersionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getVersion(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importAptArtifactsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importAptArtifactsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportAptArtifactsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importAptArtifactsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->importAptArtifacts(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ImportAptArtifacts', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importAptArtifactsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importAptArtifactsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importAptArtifactsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - $response = $gapicClient->importAptArtifacts(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importAptArtifactsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importYumArtifactsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importYumArtifactsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportYumArtifactsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importYumArtifactsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->importYumArtifacts(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ImportYumArtifacts', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importYumArtifactsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importYumArtifactsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importYumArtifactsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - $response = $gapicClient->importYumArtifacts(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importYumArtifactsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listFilesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $filesElement = new File(); - $files = [ - $filesElement, - ]; - $expectedResponse = new ListFilesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFiles($files); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listFiles(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFiles()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListFiles', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFilesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listFiles(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPackagesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $packagesElement = new Package(); - $packages = [ - $packagesElement, - ]; - $expectedResponse = new ListPackagesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPackages($packages); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listPackages(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPackages()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListPackages', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPackagesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listPackages(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRepositoriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; - $expectedResponse = new ListRepositoriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRepositories($repositories); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listRepositories($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRepositories()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListRepositories', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRepositoriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listRepositories($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagsElement = new Tag(); - $tags = [ - $tagsElement, - ]; - $expectedResponse = new ListTagsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTags($tags); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listTags(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTags()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListTags', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listTags(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $versionsElement = new Version(); - $versions = [ - $versionsElement, - ]; - $expectedResponse = new ListVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setVersions($versions); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listVersions(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListVersions', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listVersionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listVersions(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateProjectSettingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new ProjectSettings(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - $response = $gapicClient->updateProjectSettings(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateProjectSettings', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateProjectSettingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->updateProjectSettings(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $kmsKeyName = 'kmsKeyName2094986649'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setKmsKeyName($kmsKeyName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->updateRepository(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateRepository', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRepositoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->updateRepository(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTagTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $version = 'version351608024'; - $expectedResponse = new Tag(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $transport->addResponse($expectedResponse); - $response = $gapicClient->updateTag(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateTag', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTagExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->updateTag(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Asset/.repo-metadata.json b/Asset/.repo-metadata.json deleted file mode 100644 index 8e085a0557f7..000000000000 --- a/Asset/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-asset", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-asset/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudasset" -} diff --git a/Asset/VERSION b/Asset/VERSION index 41c11ffb730c..c807441cfed7 100644 --- a/Asset/VERSION +++ b/Asset/VERSION @@ -1 +1 @@ -1.16.1 +1.16.3 diff --git a/Asset/composer.json b/Asset/composer.json index 20c8d2a7d623..d69d38d863f4 100644 --- a/Asset/composer.json +++ b/Asset/composer.json @@ -26,7 +26,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/access-context-manager": "^0.5", "google/cloud-osconfig": "^1.0" }, diff --git a/AssuredWorkloads/.OwlBot.yaml b/AssuredWorkloads/.OwlBot.yaml index dd576b772491..503f2d9e7e46 100644 --- a/AssuredWorkloads/.OwlBot.yaml +++ b/AssuredWorkloads/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/assuredworkloads/(v1|v1beta1)/.*-php/(.*) + - source: /google/cloud/assuredworkloads/(v1)/.*-php/(.*) dest: /owl-bot-staging/AssuredWorkloads/$1/$2 api-name: AssuredWorkloads diff --git a/AssuredWorkloads/.repo-metadata.json b/AssuredWorkloads/.repo-metadata.json deleted file mode 100644 index 15041b98c52e..000000000000 --- a/AssuredWorkloads/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-assured-workloads", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-assured-workloads/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "assuredworkloads" -} diff --git a/AssuredWorkloads/README.md b/AssuredWorkloads/README.md index 019cd2dfec23..2ba6957ef361 100644 --- a/AssuredWorkloads/README.md +++ b/AssuredWorkloads/README.md @@ -48,9 +48,8 @@ foreach ($workloads as $workload) { ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/AssuredWorkloads/VERSION b/AssuredWorkloads/VERSION index 1a96df19c09a..62d5dbdf3c7a 100644 --- a/AssuredWorkloads/VERSION +++ b/AssuredWorkloads/VERSION @@ -1 +1 @@ -0.11.3 +0.11.5 diff --git a/AssuredWorkloads/composer.json b/AssuredWorkloads/composer.json index 2f0c11c7974a..3c40b99d31ad 100644 --- a/AssuredWorkloads/composer.json +++ b/AssuredWorkloads/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/AssuredWorkloads/metadata/V1Beta1/Assuredworkloads.php b/AssuredWorkloads/metadata/V1Beta1/Assuredworkloads.php deleted file mode 100644 index 6ba11ddfa4afb82cef0dc31b24cd1e732d3ad7e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6659 zcmcIpOLN=E5jLrZ#ilG#v(}oTy)n%7?#ii{j2%}cMcbPNNr-~YSAmpwozfNpk|P=x zL?8gDUD>5d<+7DilB!g0smeXaT=Nf-TYiDh`vY>wDLn%WNR#wh^uq_6#?18B-P8R| z_sqRtI!_$YjEvYj+IH0c7wT~RrqHa!-$_=UBXiG|2 zZC}Hso;`HCv>^3uyKm8a*RqGbyy1C6m-fD~-9yVZdS3qcR)_k=t*L<=2Lc!vN7QqS zE|n_HVhyME4ByzVaGCohCUak&kh%ZpR*}iP3(&O?P@0?o&q2aJ&ah*dUCHweAOE>- zdb&9AGlmNkjds=cWm^}eMxB9WG+K@ z?W+Tyx&y=7FH^7UnvQR~O`KXN^r;^?ntj>65yCQY=7F>w=vXLBDS2P=-60)Emn4_^ zLw9hO>&*n5M!)uF_)vDt{T-89y&`>L9GkXVD2%Kc33=60jfVSt=2ek9%0rAS^y1k8 zqorKon&BP3!P>To5#<|4&g`{(_ilb}hI=LVdePSGV4!bD&Sb9r4E}Tz?!8TflTU)x zIi4T6$^6KL`H|TQK@7*tyP?m69LfAB9O4;+ahC6ejt$2}21ertY`gU%bYD2*>ZAl; z_$Zi={bvj|OD;ts_%h5~js9kcZX{p8vSYY(;HP6!Y&%i>=?gjjKl#UGd&-gk1NHZE zNE&$|i0r_Mpo4TAWh8IsbHUu#_#`Jp6c-Sbq#;Sa4H8T@d+7zP4vxgKe?jf{93+k@ z?Z>g1{%?wX2a-b$z`Yupkr8GH$LFH3-adS^d>$!}p)!r7w|{f=iypF1|e91zR4fmEn3 zf=+DETLNW0$jEpmoIHzyvt}PtAw31l0lx+TuzQYdz~aH^2m#=qeEX0N0yD`PEFYK_=68CLWp>tw%?X7<<%^IId=h9se^Qf6us%RC z(Z{r4)Rf5n=Q6AaZ{k)=|GgOasdh-KBkGZtkJA+h5Epy%Y)3xSZlL^6CqDiToUrUC#bG zI~dYSoGGX2Ejn4*Ley@FT!HnDX<6o=uN&R2J;Y;TnfWo${cBh?tvk9$eII9d>GNFf z-Fekkt9M$Vh~i2*_Cj7nXiN(oE_9z_RTs%$;qvEpdg+1Mnh7v~%>&wVv6RrCnEfXs zpd<$>&1=X`AZ!<9&BQx~ErEAr_jp}C!d&H;l{dt!h4N2EKd3*_GUYE67*JriX_M?O`N`se(Dk%Zm#Fe35(wtA|Hp`?|(WpIe28 zwb8aN@wg$sh7AEc^6WadaPDjpxf;0?Gh&fYxOiwh)#<>sE$ayDCY{yxG`)c~tlcio zyL}Ihr%EKM#Uur(^(k!8fzh#$R`E1(so5XsT^qe^a&S#>m9KY(zK&FB1a%L3+dVeB)Jvz?dBf*t{t$;%;YG%H zc+e$LJ(R(gqgqz9)FP{qlzK^f+~h^nL*;QRS`{ZrIFDa6wO&ar zWd0n3K zw-}^ECJ5%5m3N8vpLgWqL@~u%y3BWrusM@t$RVtHc=zFON*%J|k8x^K1oCT|qNvE4 zDLjYH7&@F`chCJk79$4&jJmFkb#fee>)nDWOmJ2M7(p|xXesTzrrv7H?a5|~z#99! zhy0<`%ZxHOW2wywY;V;;071*aVhx=+bH*t03d8SZcaAQ6$9DV1zK3OYg42jTQeJhZ|_b*;u!@Ie9tXWVhwb*st~ix)wKqcw^YNr(Oy2 zc%AsF7X+tsck&L>>HIzZNrk^1internalAddGeneratedFile( - ' -Á -Dgoogle/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto%google.cloud.assuredworkloads.v1beta1google/api/client.proto%N2$SwBqpNB;UgJ$*g+xkl0pOl z2mne|G}?5RRTrK9g6_I#e?YqF*3(tnl~-A0CR6`_&a|tZdw~mrq-BwEYHv*O-t#`^ zJLg<}^mFULLhp#%#2~inlD4>iD!KK?-g`eXj*cLsRH|^tW}C{~-z+zvppDGk8c3!$aCf zf#ixWOtmyX5}IWmFeLAU4mvcIlzl&!{0pn03$~vy{?R-Bk>1aWj2UEwf9Xg5C5A&# zwwbmcdjI^*;d4TR>mPFP3y3`xk06Bp4X%H1!{u@EE~LH@&~nZufWe>ppjjnf_8^q_ zF`Bhh8(fhPL}4wO{mHj-?9yN3;*irutu1_CplwF#!tos&7V;o59_h z4oZhZ(I2JeTWN4<|%(R^ETEL}ZS*b$@h z(zcGG91$F_iR$$cPn?(IQIP*>-h+xp$D~}Ra0^|hLy@kjFbOC&=|Vv>4=rvyo|Jno zU{qy%va?Wb-^w%i0~Bj9P*5mdBxYCvjb?oS`jil~o56R`(!Qqa&;S*+)iQg49<$Vs zKIdutD>Sd^4;6>FE?jaF*BI+ZlWJbveOU8ZWMc_|sXYw}?7V^Z(L(DB7_R~mb4Vg-<`0iT0bXR*PprbHrG9)Nd1-E5=VJS=U1Ii4Tw1(v1D{d}$?pX; z&rfJc;~OXzh=kTgJJl5Eu@HReo?0GAE^ZVj4R2UdfFyNbn1U+ghxBiJ8?9CgwQ{4H zD=76Rm4edPt5piQ;#RSckH3L$qIj;nS8J3CRi#obe^SWR;{tvYtrYfh)hCsDvAm~z zT6j_m4kJnEAF+^wv5YVSSlCY3RO|tZ*O^}iEYYB}@g`ads9}uK%(mZ-SGi+?cFgDJ zY@a-7qF4wuaI-m-MV>CNltq1MQY0ZHEi@knk=G&e1l@Q6mb?zhXK2NjJPaqVL;BYO zit~)-CHJD@ivItLD|sKqLgw}`HoBcF zmnyqOc@IjmTG%d@hKuqVnu2_WI-En(G|l1>97pq8g?v>mRg|6L_D+0?RxbahRL&Qw za=j3r#83GrHO02mIrCCK&EAXZ+)N_AQhg z8G{1QPW?+jcLukbU>)a=I~XSW@Qiag6aj+2WZn}X-T1=P-%w~z8PW3x8`r2t8-IwR z760jp52{X$*vDFn;Qt6{anKKV+&O5F%%A>~w>i{?mfCdS+tk;>Z~pP!?;^R>2f@qR znb*HJ!+~}(>!DDuhe9j`8{;#1$)mi-gZ@6=95s?ub+p#a+9;T7urklpTO9`jdN^c2g$gxw|Jm~p2}X8Qd`WX z57$Ehp2(DEGFzeWUtvB7t*!V&F7J}fC`7|moj5MO4fs`U_@{st23Ar$?({G~#qAik zGKYx0EjYE~1tx6NM3whU_R%X@dn(_#G9rs7rng zcrTgg^B)|V@T&m(#o>8m&0{G^jHe_G zGnFKMRsQAW4RqJFv#}7UGU-;zDZhBAi=ja@v{{ffy B#-{)P diff --git a/AssuredWorkloads/owlbot.py b/AssuredWorkloads/owlbot.py index e30d63687ede..e818176d5665 100644 --- a/AssuredWorkloads/owlbot.py +++ b/AssuredWorkloads/owlbot.py @@ -20,42 +20,37 @@ import synthtool as s from synthtool.languages import php +from synthtool import _tracked_paths logging.basicConfig(level=logging.DEBUG) src = Path(f"../{php.STAGING_DIR}/AssuredWorkloads").resolve() dest = Path().resolve() -php.owlbot_main(src=src, dest=dest) - -# Change the wording for the deprecation warning. -s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes +php.owlbot_main(src=src, dest=dest) -# fix relative cloud.google.com links +# remove class_alias code s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/AssuredWorkloads/src/V1/AcknowledgeViolationRequest.php b/AssuredWorkloads/src/V1/AcknowledgeViolationRequest.php index 953ec3c991d2..0be4636db1af 100644 --- a/AssuredWorkloads/src/V1/AcknowledgeViolationRequest.php +++ b/AssuredWorkloads/src/V1/AcknowledgeViolationRequest.php @@ -23,13 +23,13 @@ class AcknowledgeViolationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. Business justification explaining the need for violation acknowledgement * * Generated from protobuf field string comment = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $comment = ''; + protected $comment = ''; /** * Optional. This field is deprecated and will be removed in future version of the API. * Name of the OrgPolicy which was modified with non-compliant change and diff --git a/AssuredWorkloads/src/V1/AssuredWorkloadsServiceGrpcClient.php b/AssuredWorkloads/src/V1/AssuredWorkloadsServiceGrpcClient.php deleted file mode 100644 index 9c58d26be31b..000000000000 --- a/AssuredWorkloads/src/V1/AssuredWorkloadsServiceGrpcClient.php +++ /dev/null @@ -1,187 +0,0 @@ -_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/CreateWorkload', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates an existing workload. - * Currently allows updating of workload display_name and labels. - * For force updates don't set etag field in the Workload. - * Only one update operation per workload can be in progress. - * @param \Google\Cloud\AssuredWorkloads\V1\UpdateWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateWorkload(\Google\Cloud\AssuredWorkloads\V1\UpdateWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/UpdateWorkload', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\Workload', 'decode'], - $metadata, $options); - } - - /** - * Restrict the list of resources allowed in the Workload environment. - * The current list of allowed products can be found at - * https://cloud.google.com/assured-workloads/docs/supported-products - * In addition to assuredworkloads.workload.update permission, the user should - * also have orgpolicy.policy.set permission on the folder resource - * to use this functionality. - * @param \Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestrictAllowedResources(\Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/RestrictAllowedResources', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes the workload. Make sure that workload's direct children are already - * in a deleted state, otherwise the request will fail with a - * FAILED_PRECONDITION error. - * @param \Google\Cloud\AssuredWorkloads\V1\DeleteWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteWorkload(\Google\Cloud\AssuredWorkloads\V1\DeleteWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/DeleteWorkload', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets Assured Workload associated with a CRM Node - * @param \Google\Cloud\AssuredWorkloads\V1\GetWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetWorkload(\Google\Cloud\AssuredWorkloads\V1\GetWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/GetWorkload', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\Workload', 'decode'], - $metadata, $options); - } - - /** - * Lists Assured Workloads under a CRM Node. - * @param \Google\Cloud\AssuredWorkloads\V1\ListWorkloadsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListWorkloads(\Google\Cloud\AssuredWorkloads\V1\ListWorkloadsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/ListWorkloads', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\ListWorkloadsResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists the Violations in the AssuredWorkload Environment. - * Callers may also choose to read across multiple Workloads as per - * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash - * character) as a wildcard character instead of workload-id in the parent. - * Format `organizations/{org_id}/locations/{location}/workloads/-` - * @param \Google\Cloud\AssuredWorkloads\V1\ListViolationsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListViolations(\Google\Cloud\AssuredWorkloads\V1\ListViolationsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/ListViolations', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\ListViolationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves Assured Workload Violation based on ID. - * @param \Google\Cloud\AssuredWorkloads\V1\GetViolationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetViolation(\Google\Cloud\AssuredWorkloads\V1\GetViolationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/GetViolation', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\Violation', 'decode'], - $metadata, $options); - } - - /** - * Acknowledges an existing violation. By acknowledging a violation, users - * acknowledge the existence of a compliance violation in their workload and - * decide to ignore it due to a valid business justification. Acknowledgement - * is a permanent operation and it cannot be reverted. - * @param \Google\Cloud\AssuredWorkloads\V1\AcknowledgeViolationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AcknowledgeViolation(\Google\Cloud\AssuredWorkloads\V1\AcknowledgeViolationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\AcknowledgeViolationResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AssuredWorkloads/src/V1/Client/AssuredWorkloadsServiceClient.php b/AssuredWorkloads/src/V1/Client/AssuredWorkloadsServiceClient.php index 138b6ecdb4c6..635f6b4714a0 100644 --- a/AssuredWorkloads/src/V1/Client/AssuredWorkloadsServiceClient.php +++ b/AssuredWorkloads/src/V1/Client/AssuredWorkloadsServiceClient.php @@ -1,6 +1,6 @@ [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/assured_workloads_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/assured_workloads_service_rest_client_config.php', ], ], ]; @@ -145,12 +144,33 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -179,8 +199,12 @@ public static function locationName(string $organization, string $location): str * * @return string The formatted violation resource. */ - public static function violationName(string $organization, string $location, string $workload, string $violation): string - { + public static function violationName( + string $organization, + string $location, + string $workload, + string $violation + ): string { return self::getPathTemplate('violation')->render([ 'organization' => $organization, 'location' => $location, @@ -331,8 +355,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function acknowledgeViolation(AcknowledgeViolationRequest $request, array $callOptions = []): AcknowledgeViolationResponse - { + public function acknowledgeViolation( + AcknowledgeViolationRequest $request, + array $callOptions = [] + ): AcknowledgeViolationResponse { return $this->startApiCall('AcknowledgeViolation', $request, $callOptions)->wait(); } @@ -527,8 +553,10 @@ public function listWorkloads(ListWorkloadsRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function restrictAllowedResources(RestrictAllowedResourcesRequest $request, array $callOptions = []): RestrictAllowedResourcesResponse - { + public function restrictAllowedResources( + RestrictAllowedResourcesRequest $request, + array $callOptions = [] + ): RestrictAllowedResourcesResponse { return $this->startApiCall('RestrictAllowedResources', $request, $callOptions)->wait(); } diff --git a/AssuredWorkloads/src/V1/CreateWorkloadOperationMetadata.php b/AssuredWorkloads/src/V1/CreateWorkloadOperationMetadata.php index 05e561746633..1a4b40123dbc 100644 --- a/AssuredWorkloads/src/V1/CreateWorkloadOperationMetadata.php +++ b/AssuredWorkloads/src/V1/CreateWorkloadOperationMetadata.php @@ -20,26 +20,26 @@ class CreateWorkloadOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $create_time = null; + protected $create_time = null; /** * Optional. The display name of the workload. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. The parent of the workload. * * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $parent = ''; + protected $parent = ''; /** * Optional. Compliance controls that should be applied to the resources managed by * the workload. * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $compliance_regime = 0; + protected $compliance_regime = 0; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/CreateWorkloadRequest.php b/AssuredWorkloads/src/V1/CreateWorkloadRequest.php index 348b0e4498f6..be66d2add195 100644 --- a/AssuredWorkloads/src/V1/CreateWorkloadRequest.php +++ b/AssuredWorkloads/src/V1/CreateWorkloadRequest.php @@ -21,13 +21,13 @@ class CreateWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Assured Workload to create * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $workload = null; + protected $workload = null; /** * Optional. A identifier associated with the workload and underlying projects which * allows for the break down of billing costs for a workload. The value @@ -36,7 +36,7 @@ class CreateWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $external_id = ''; + protected $external_id = ''; /** * @param string $parent Required. The resource name of the new Workload's parent. diff --git a/AssuredWorkloads/src/V1/DeleteWorkloadRequest.php b/AssuredWorkloads/src/V1/DeleteWorkloadRequest.php index 876cc89d552f..2c5dfe38cdf4 100644 --- a/AssuredWorkloads/src/V1/DeleteWorkloadRequest.php +++ b/AssuredWorkloads/src/V1/DeleteWorkloadRequest.php @@ -22,14 +22,14 @@ class DeleteWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The etag of the workload. * If this is provided, it must match the server's etag. * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The `name` field is used to identify the workload. diff --git a/AssuredWorkloads/src/V1/GetViolationRequest.php b/AssuredWorkloads/src/V1/GetViolationRequest.php index 5cfcdde39915..6790c069eb29 100644 --- a/AssuredWorkloads/src/V1/GetViolationRequest.php +++ b/AssuredWorkloads/src/V1/GetViolationRequest.php @@ -22,7 +22,7 @@ class GetViolationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Violation to fetch (ie. Violation.name). diff --git a/AssuredWorkloads/src/V1/GetWorkloadRequest.php b/AssuredWorkloads/src/V1/GetWorkloadRequest.php index e7b6a0aa4a96..96dccb40d104 100644 --- a/AssuredWorkloads/src/V1/GetWorkloadRequest.php +++ b/AssuredWorkloads/src/V1/GetWorkloadRequest.php @@ -24,7 +24,7 @@ class GetWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Workload to fetch. This is the workload's diff --git a/AssuredWorkloads/src/V1/ListViolationsRequest.php b/AssuredWorkloads/src/V1/ListViolationsRequest.php index 7e8a85eb52ab..deeba4814a66 100644 --- a/AssuredWorkloads/src/V1/ListViolationsRequest.php +++ b/AssuredWorkloads/src/V1/ListViolationsRequest.php @@ -21,7 +21,7 @@ class ListViolationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Specifies the time window for retrieving active Violations. * When specified, retrieves Violations that were active between start_time @@ -29,25 +29,25 @@ class ListViolationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $interval = null; + protected $interval = null; /** * Optional. Page size. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token returned from previous request. * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. A custom filter for filtering by the Violations properties. * * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The Workload name. diff --git a/AssuredWorkloads/src/V1/ListViolationsResponse.php b/AssuredWorkloads/src/V1/ListViolationsResponse.php index 7b1c4dc42bc8..9cd32a438855 100644 --- a/AssuredWorkloads/src/V1/ListViolationsResponse.php +++ b/AssuredWorkloads/src/V1/ListViolationsResponse.php @@ -26,7 +26,7 @@ class ListViolationsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/ListWorkloadsRequest.php b/AssuredWorkloads/src/V1/ListWorkloadsRequest.php index e839981172e4..fc9101c054ff 100644 --- a/AssuredWorkloads/src/V1/ListWorkloadsRequest.php +++ b/AssuredWorkloads/src/V1/ListWorkloadsRequest.php @@ -21,13 +21,13 @@ class ListWorkloadsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Page size. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page token returned from previous request. Page token contains context from * previous request. Page token needs to be passed in the second and following @@ -35,14 +35,14 @@ class ListWorkloadsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * A custom filter for filtering by properties of a workload. At this time, * only filtering by labels is supported. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. Parent Resource to list workloads from. diff --git a/AssuredWorkloads/src/V1/ListWorkloadsResponse.php b/AssuredWorkloads/src/V1/ListWorkloadsResponse.php index babb8db1c9b8..0c78b8bd31d0 100644 --- a/AssuredWorkloads/src/V1/ListWorkloadsResponse.php +++ b/AssuredWorkloads/src/V1/ListWorkloadsResponse.php @@ -26,7 +26,7 @@ class ListWorkloadsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest.php b/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest.php index 849083c077da..12940165bbd3 100644 --- a/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest.php +++ b/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest.php @@ -24,13 +24,13 @@ class RestrictAllowedResourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The type of restriction for using gcp products in the Workload environment. * * Generated from protobuf field .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $restriction_type = 0; + protected $restriction_type = 0; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest/RestrictionType.php b/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest/RestrictionType.php index 630c16506a1c..35b75ae87199 100644 --- a/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest/RestrictionType.php +++ b/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest/RestrictionType.php @@ -63,6 +63,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestrictionType::class, \Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesRequest_RestrictionType::class); diff --git a/AssuredWorkloads/src/V1/TimeWindow.php b/AssuredWorkloads/src/V1/TimeWindow.php index 662fc79922d9..d85b5f8d271b 100644 --- a/AssuredWorkloads/src/V1/TimeWindow.php +++ b/AssuredWorkloads/src/V1/TimeWindow.php @@ -20,13 +20,13 @@ class TimeWindow extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - private $start_time = null; + protected $start_time = null; /** * The end of the time window. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/UpdateWorkloadRequest.php b/AssuredWorkloads/src/V1/UpdateWorkloadRequest.php index 66d585972ee7..686a9c01e44b 100644 --- a/AssuredWorkloads/src/V1/UpdateWorkloadRequest.php +++ b/AssuredWorkloads/src/V1/UpdateWorkloadRequest.php @@ -23,13 +23,13 @@ class UpdateWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $workload = null; + protected $workload = null; /** * Required. The list of fields to be updated. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AssuredWorkloads\V1\Workload $workload Required. The workload to update. diff --git a/AssuredWorkloads/src/V1/Violation.php b/AssuredWorkloads/src/V1/Violation.php index fdb6779f1c06..513913ec2734 100644 --- a/AssuredWorkloads/src/V1/Violation.php +++ b/AssuredWorkloads/src/V1/Violation.php @@ -22,53 +22,53 @@ class Violation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. Description for the Violation. * e.g. OrgPolicy gcp.resourceLocations has non compliant value. * * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $description = ''; + protected $description = ''; /** * Output only. Time of the event which triggered the Violation. * * Generated from protobuf field .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $begin_time = null; + protected $begin_time = null; /** * Output only. The last time when the Violation record was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Time of the event which fixed the Violation. * If the violation is ACTIVE this will be empty. * * Generated from protobuf field .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $resolve_time = null; + protected $resolve_time = null; /** * Output only. Category under which this violation is mapped. * e.g. Location, Service Usage, Access, Encryption, etc. * * Generated from protobuf field string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $category = ''; + protected $category = ''; /** * Output only. State of the violation * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in * this violation. * * Generated from protobuf field string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $org_policy_constraint = ''; + protected $org_policy_constraint = ''; /** * Output only. Immutable. Audit Log Link for violated resource * Format: @@ -76,7 +76,7 @@ class Violation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $audit_log_link = ''; + protected $audit_log_link = ''; /** * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and * resulted this violation. @@ -87,26 +87,26 @@ class Violation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $non_compliant_org_policy = ''; + protected $non_compliant_org_policy = ''; /** * Output only. Compliance violation remediation * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $remediation = null; + protected $remediation = null; /** * Output only. A boolean that indicates if the violation is acknowledged * * Generated from protobuf field bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $acknowledged = false; + protected $acknowledged = false; /** * Optional. Timestamp when this violation was acknowledged last. * This will be absent when acknowledged field is marked as false. * * Generated from protobuf field optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; */ - private $acknowledgement_time = null; + protected $acknowledgement_time = null; /** * Output only. Immutable. Audit Log link to find business justification provided for violation * exception. Format: @@ -114,7 +114,7 @@ class Violation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string exception_audit_log_link = 16 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $exception_audit_log_link = ''; + protected $exception_audit_log_link = ''; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/Violation/Remediation.php b/AssuredWorkloads/src/V1/Violation/Remediation.php index 5bbe4158ada5..11159e2597d1 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation.php @@ -21,7 +21,7 @@ class Remediation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $instructions = null; + protected $instructions = null; /** * Values that can resolve the violation * For example: for list org policy violations, this will either be the list @@ -35,7 +35,7 @@ class Remediation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $remediation_type = 0; + protected $remediation_type = 0; /** * Constructor. @@ -152,6 +152,4 @@ public function setRemediationType($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Remediation::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation::class); diff --git a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions.php b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions.php index e1beb14dcfcf..0e7b4d1d475f 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions.php @@ -20,13 +20,13 @@ class Instructions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; */ - private $gcloud_instructions = null; + protected $gcloud_instructions = null; /** * Remediation instructions to resolve violation via cloud console * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; */ - private $console_instructions = null; + protected $console_instructions = null; /** * Constructor. @@ -119,6 +119,4 @@ public function setConsoleInstructions($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Instructions::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_Instructions::class); diff --git a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Console.php b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Console.php index cdf9485e5183..32fef6eb1508 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Console.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Console.php @@ -133,6 +133,4 @@ public function setAdditionalLinks($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Console::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_Instructions_Console::class); diff --git a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Gcloud.php b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Gcloud.php index d3d08eceacca..be103fa766f3 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Gcloud.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Gcloud.php @@ -133,6 +133,4 @@ public function setAdditionalLinks($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Gcloud::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_Instructions_Gcloud::class); diff --git a/AssuredWorkloads/src/V1/Violation/Remediation/RemediationType.php b/AssuredWorkloads/src/V1/Violation/Remediation/RemediationType.php index 838ccee58368..c58698446b73 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation/RemediationType.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation/RemediationType.php @@ -78,6 +78,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RemediationType::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_RemediationType::class); diff --git a/AssuredWorkloads/src/V1/Violation/State.php b/AssuredWorkloads/src/V1/Violation/State.php index 3dffecec7cbf..0d3ee235af0c 100644 --- a/AssuredWorkloads/src/V1/Violation/State.php +++ b/AssuredWorkloads/src/V1/Violation/State.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\AssuredWorkloads\V1\Violation_State::class); diff --git a/AssuredWorkloads/src/V1/Workload.php b/AssuredWorkloads/src/V1/Workload.php index fa58b28f653b..134a7e8f8a3b 100644 --- a/AssuredWorkloads/src/V1/Workload.php +++ b/AssuredWorkloads/src/V1/Workload.php @@ -24,7 +24,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-assigned display name of the Workload. * When present it must be between 4 to 30 characters. @@ -34,7 +34,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. The resources associated with this workload. * These resources will be created when creating the workload. @@ -49,13 +49,13 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $compliance_regime = 0; + protected $compliance_regime = 0; /** * Output only. Immutable. The Workload creation timestamp. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $create_time = null; + protected $create_time = null; /** * Optional. The billing account used for the resources which are * direct children of workload. This billing account is initially associated @@ -68,14 +68,14 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $billing_account = ''; + protected $billing_account = ''; /** * Optional. ETag of the workload, it is calculated on the basis * of the Workload contents. It will be used in Update & Delete operations. * * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Optional. Labels applied to the workload. * @@ -92,7 +92,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $provisioned_resources_parent = ''; + protected $provisioned_resources_parent = ''; /** * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS * CMEK key is provisioned. @@ -117,14 +117,14 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $kaj_enrollment_state = 0; + protected $kaj_enrollment_state = 0; /** * Optional. Indicates the sovereignty status of the given workload. * Currently meant to be used by Europe/Canada customers. * * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_sovereign_controls = false; + protected $enable_sovereign_controls = false; /** * Output only. Represents the SAA enrollment response of the given workload. * SAA enrollment response is queried during GetWorkload call. @@ -132,7 +132,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $saa_enrollment_response = null; + protected $saa_enrollment_response = null; /** * Output only. Urls for services which are compliant for this Assured Workload, but which * are currently disallowed by the ResourceUsageRestriction org policy. @@ -147,7 +147,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; */ - private $partner = 0; + protected $partner = 0; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/Workload/ComplianceRegime.php b/AssuredWorkloads/src/V1/Workload/ComplianceRegime.php index f921eaced85e..40333fc47c2d 100644 --- a/AssuredWorkloads/src/V1/Workload/ComplianceRegime.php +++ b/AssuredWorkloads/src/V1/Workload/ComplianceRegime.php @@ -131,6 +131,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ComplianceRegime::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ComplianceRegime::class); diff --git a/AssuredWorkloads/src/V1/Workload/KMSSettings.php b/AssuredWorkloads/src/V1/Workload/KMSSettings.php index c5552a23a983..d8842b17b814 100644 --- a/AssuredWorkloads/src/V1/Workload/KMSSettings.php +++ b/AssuredWorkloads/src/V1/Workload/KMSSettings.php @@ -25,7 +25,7 @@ class KMSSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $next_rotation_time = null; + protected $next_rotation_time = null; /** * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key * Management Service automatically rotates a key. Must be at least 24 hours @@ -33,7 +33,7 @@ class KMSSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $rotation_period = null; + protected $rotation_period = null; /** * Constructor. @@ -135,6 +135,4 @@ public function setRotationPeriod($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KMSSettings::class, \Google\Cloud\AssuredWorkloads\V1\Workload_KMSSettings::class); diff --git a/AssuredWorkloads/src/V1/Workload/KajEnrollmentState.php b/AssuredWorkloads/src/V1/Workload/KajEnrollmentState.php index 5daeeb90a74f..50a571517eaa 100644 --- a/AssuredWorkloads/src/V1/Workload/KajEnrollmentState.php +++ b/AssuredWorkloads/src/V1/Workload/KajEnrollmentState.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KajEnrollmentState::class, \Google\Cloud\AssuredWorkloads\V1\Workload_KajEnrollmentState::class); diff --git a/AssuredWorkloads/src/V1/Workload/Partner.php b/AssuredWorkloads/src/V1/Workload/Partner.php index b3ab77303ba3..0b2606d72d24 100644 --- a/AssuredWorkloads/src/V1/Workload/Partner.php +++ b/AssuredWorkloads/src/V1/Workload/Partner.php @@ -52,6 +52,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Partner::class, \Google\Cloud\AssuredWorkloads\V1\Workload_Partner::class); diff --git a/AssuredWorkloads/src/V1/Workload/ResourceInfo.php b/AssuredWorkloads/src/V1/Workload/ResourceInfo.php index ca47d24b1c66..a10c4193ce0a 100644 --- a/AssuredWorkloads/src/V1/Workload/ResourceInfo.php +++ b/AssuredWorkloads/src/V1/Workload/ResourceInfo.php @@ -21,13 +21,13 @@ class ResourceInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 resource_id = 1; */ - private $resource_id = 0; + protected $resource_id = 0; /** * Indicates the type of resource. * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; */ - private $resource_type = 0; + protected $resource_type = 0; /** * Constructor. @@ -103,6 +103,4 @@ public function setResourceType($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceInfo::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ResourceInfo::class); diff --git a/AssuredWorkloads/src/V1/Workload/ResourceInfo/ResourceType.php b/AssuredWorkloads/src/V1/Workload/ResourceInfo/ResourceType.php index dc3182744b09..76e36b979c72 100644 --- a/AssuredWorkloads/src/V1/Workload/ResourceInfo/ResourceType.php +++ b/AssuredWorkloads/src/V1/Workload/ResourceInfo/ResourceType.php @@ -77,6 +77,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceType::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ResourceInfo_ResourceType::class); diff --git a/AssuredWorkloads/src/V1/Workload/ResourceSettings.php b/AssuredWorkloads/src/V1/Workload/ResourceSettings.php index 77413bf5dd3d..7a9ee52d06bb 100644 --- a/AssuredWorkloads/src/V1/Workload/ResourceSettings.php +++ b/AssuredWorkloads/src/V1/Workload/ResourceSettings.php @@ -24,7 +24,7 @@ class ResourceSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string resource_id = 1; */ - private $resource_id = ''; + protected $resource_id = ''; /** * Indicates the type of resource. This field should be specified to * correspond the id to the right resource type (CONSUMER_FOLDER or @@ -32,7 +32,7 @@ class ResourceSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; */ - private $resource_type = 0; + protected $resource_type = 0; /** * User-assigned resource display name. * If not empty it will be used to create a resource with the specified @@ -40,7 +40,7 @@ class ResourceSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 3; */ - private $display_name = ''; + protected $display_name = ''; /** * Constructor. @@ -165,6 +165,4 @@ public function setDisplayName($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceSettings::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ResourceSettings::class); diff --git a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse.php b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse.php index 71de2ac364db..0a16a146d91b 100644 --- a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse.php +++ b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse.php @@ -20,7 +20,7 @@ class SaaEnrollmentResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; */ - private $setup_status = null; + protected $setup_status = null; /** * Indicates SAA enrollment setup error if any. * @@ -109,6 +109,4 @@ public function setSetupErrors($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SaaEnrollmentResponse::class, \Google\Cloud\AssuredWorkloads\V1\Workload_SaaEnrollmentResponse::class); diff --git a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupError.php b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupError.php index 6ced16897348..0a5232c393ba 100644 --- a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupError.php +++ b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupError.php @@ -76,6 +76,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SetupError::class, \Google\Cloud\AssuredWorkloads\V1\Workload_SaaEnrollmentResponse_SetupError::class); diff --git a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupState.php b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupState.php index 27112e59383a..7ccd00e753ac 100644 --- a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupState.php +++ b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupState.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SetupState::class, \Google\Cloud\AssuredWorkloads\V1\Workload_SaaEnrollmentResponse_SetupState::class); diff --git a/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveRequest.php b/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveRequest.php deleted file mode 100644 index 2fe6c54431da..000000000000 --- a/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveRequest.php +++ /dev/null @@ -1,190 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest - */ -class AnalyzeWorkloadMoveRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * - * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $target = ''; - protected $projectOrWorkloadResource; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $source - * The source type is a project-based workload. Specify the workloads's - * relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-1" - * @type string $project - * The source type is a project. Specify the project's relative resource - * name, formatted as either a project number or a project ID: - * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" - * For example: - * "projects/951040570662" when specifying a project number, or - * "projects/my-project-123" when specifying a project ID. - * @type string $target - * Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * The source type is a project-based workload. Specify the workloads's - * relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-1" - * - * Generated from protobuf field string source = 1; - * @return string - */ - public function getSource() - { - return $this->readOneof(1); - } - - public function hasSource() - { - return $this->hasOneof(1); - } - - /** - * The source type is a project-based workload. Specify the workloads's - * relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-1" - * - * Generated from protobuf field string source = 1; - * @param string $var - * @return $this - */ - public function setSource($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The source type is a project. Specify the project's relative resource - * name, formatted as either a project number or a project ID: - * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" - * For example: - * "projects/951040570662" when specifying a project number, or - * "projects/my-project-123" when specifying a project ID. - * - * Generated from protobuf field string project = 3; - * @return string - */ - public function getProject() - { - return $this->readOneof(3); - } - - public function hasProject() - { - return $this->hasOneof(3); - } - - /** - * The source type is a project. Specify the project's relative resource - * name, formatted as either a project number or a project ID: - * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" - * For example: - * "projects/951040570662" when specifying a project number, or - * "projects/my-project-123" when specifying a project ID. - * - * Generated from protobuf field string project = 3; - * @param string $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * - * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * - * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * @return string - */ - public function getProjectOrWorkloadResource() - { - return $this->whichOneof("projectOrWorkloadResource"); - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveResponse.php b/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveResponse.php deleted file mode 100644 index 358677fb9f89..000000000000 --- a/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveResponse.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse - */ -class AnalyzeWorkloadMoveResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of blockers that should be addressed before moving the source - * project or project-based workload to the destination folder-based workload. - * - * Generated from protobuf field repeated string blockers = 1; - */ - private $blockers; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $blockers - * A list of blockers that should be addressed before moving the source - * project or project-based workload to the destination folder-based workload. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * A list of blockers that should be addressed before moving the source - * project or project-based workload to the destination folder-based workload. - * - * Generated from protobuf field repeated string blockers = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBlockers() - { - return $this->blockers; - } - - /** - * A list of blockers that should be addressed before moving the source - * project or project-based workload to the destination folder-based workload. - * - * Generated from protobuf field repeated string blockers = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBlockers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->blockers = $arr; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/AssuredWorkloadsServiceClient.php b/AssuredWorkloads/src/V1beta1/AssuredWorkloadsServiceClient.php deleted file mode 100644 index d3beb8ce6161..000000000000 --- a/AssuredWorkloads/src/V1beta1/AssuredWorkloadsServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/CreateWorkload', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates an existing workload. - * Currently allows updating of workload display_name and labels. - * For force updates don't set etag field in the Workload. - * Only one update operation per workload can be in progress. - * @param \Google\Cloud\AssuredWorkloads\V1beta1\UpdateWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateWorkload(\Google\Cloud\AssuredWorkloads\V1beta1\UpdateWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/UpdateWorkload', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\Workload', 'decode'], - $metadata, $options); - } - - /** - * Restrict the list of resources allowed in the Workload environment. - * The current list of allowed products can be found at - * https://cloud.google.com/assured-workloads/docs/supported-products - * In addition to assuredworkloads.workload.update permission, the user should - * also have orgpolicy.policy.set permission on the folder resource - * to use this functionality. - * @param \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestrictAllowedResources(\Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/RestrictAllowedResources', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes the workload. Make sure that workload's direct children are already - * in a deleted state, otherwise the request will fail with a - * FAILED_PRECONDITION error. - * In addition to assuredworkloads.workload.delete permission, the user should - * also have orgpolicy.policy.set permission on the deleted folder to remove - * Assured Workloads OrgPolicies. - * @param \Google\Cloud\AssuredWorkloads\V1beta1\DeleteWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteWorkload(\Google\Cloud\AssuredWorkloads\V1beta1\DeleteWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/DeleteWorkload', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets Assured Workload associated with a CRM Node - * @param \Google\Cloud\AssuredWorkloads\V1beta1\GetWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetWorkload(\Google\Cloud\AssuredWorkloads\V1beta1\GetWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/GetWorkload', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\Workload', 'decode'], - $metadata, $options); - } - - /** - * Analyze if the source Assured Workloads can be moved to the target Assured - * Workload - * @param \Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AnalyzeWorkloadMove(\Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/AnalyzeWorkloadMove', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists Assured Workloads under a CRM Node. - * @param \Google\Cloud\AssuredWorkloads\V1beta1\ListWorkloadsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListWorkloads(\Google\Cloud\AssuredWorkloads\V1beta1\ListWorkloadsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/ListWorkloads', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\ListWorkloadsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AssuredWorkloads/src/V1beta1/CreateWorkloadOperationMetadata.php b/AssuredWorkloads/src/V1beta1/CreateWorkloadOperationMetadata.php deleted file mode 100644 index 7a7a6d5dd466..000000000000 --- a/AssuredWorkloads/src/V1beta1/CreateWorkloadOperationMetadata.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - */ -class CreateWorkloadOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Time when the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $create_time = null; - /** - * Optional. The display name of the workload. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $display_name = ''; - /** - * Optional. The parent of the workload. - * - * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $parent = ''; - /** - * Optional. Compliance controls that should be applied to the resources managed by - * the workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $compliance_regime = 0; - /** - * Optional. Resource properties in the input that are used for creating/customizing - * workload resources. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $resource_settings; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Optional. Time when the operation was created. - * @type string $display_name - * Optional. The display name of the workload. - * @type string $parent - * Optional. The parent of the workload. - * @type int $compliance_regime - * Optional. Compliance controls that should be applied to the resources managed by - * the workload. - * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $resource_settings - * Optional. Resource properties in the input that are used for creating/customizing - * workload resources. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Time when the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Optional. Time when the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Optional. The display name of the workload. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Optional. The display name of the workload. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Optional. The parent of the workload. - * - * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Optional. The parent of the workload. - * - * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Compliance controls that should be applied to the resources managed by - * the workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getComplianceRegime() - { - return $this->compliance_regime; - } - - /** - * Optional. Compliance controls that should be applied to the resources managed by - * the workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setComplianceRegime($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ComplianceRegime::class); - $this->compliance_regime = $var; - - return $this; - } - - /** - * Optional. Resource properties in the input that are used for creating/customizing - * workload resources. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceSettings() - { - return $this->resource_settings; - } - - /** - * Optional. Resource properties in the input that are used for creating/customizing - * workload resources. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceSettings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings::class); - $this->resource_settings = $arr; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/CreateWorkloadRequest.php b/AssuredWorkloads/src/V1beta1/CreateWorkloadRequest.php deleted file mode 100644 index 31afabe7175c..000000000000 --- a/AssuredWorkloads/src/V1beta1/CreateWorkloadRequest.php +++ /dev/null @@ -1,161 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest - */ -class CreateWorkloadRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. Assured Workload to create - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $workload = null; - /** - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * - * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $external_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload - * Required. Assured Workload to create - * @type string $external_id - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Assured Workload to create - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload|null - */ - public function getWorkload() - { - return $this->workload; - } - - public function hasWorkload() - { - return isset($this->workload); - } - - public function clearWorkload() - { - unset($this->workload); - } - - /** - * Required. Assured Workload to create - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload $var - * @return $this - */ - public function setWorkload($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload::class); - $this->workload = $var; - - return $this; - } - - /** - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * - * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getExternalId() - { - return $this->external_id; - } - - /** - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * - * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setExternalId($var) - { - GPBUtil::checkString($var, True); - $this->external_id = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/DeleteWorkloadRequest.php b/AssuredWorkloads/src/V1beta1/DeleteWorkloadRequest.php deleted file mode 100644 index 37ec1ea5c89f..000000000000 --- a/AssuredWorkloads/src/V1beta1/DeleteWorkloadRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest - */ -class DeleteWorkloadRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @type string $etag - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/Gapic/AssuredWorkloadsServiceGapicClient.php b/AssuredWorkloads/src/V1beta1/Gapic/AssuredWorkloadsServiceGapicClient.php deleted file mode 100644 index 3934c60be5f8..000000000000 --- a/AssuredWorkloads/src/V1beta1/Gapic/AssuredWorkloadsServiceGapicClient.php +++ /dev/null @@ -1,756 +0,0 @@ -analyzeWorkloadMove($target); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class AssuredWorkloadsServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'assuredworkloads.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'assuredworkloads.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationNameTemplate; - - private static $workloadNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/assured_workloads_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/assured_workloads_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/assured_workloads_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/assured_workloads_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getWorkloadNameTemplate() - { - if (self::$workloadNameTemplate == null) { - self::$workloadNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/workloads/{workload}'); - } - - return self::$workloadNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'workload' => self::getWorkloadNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $organization - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($organization, $location) - { - return self::getLocationNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a workload - * resource. - * - * @param string $organization - * @param string $location - * @param string $workload - * - * @return string The formatted workload resource. - * - * @experimental - */ - public static function workloadName($organization, $location, $workload) - { - return self::getWorkloadNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'workload' => $workload, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: organizations/{organization}/locations/{location} - * - workload: organizations/{organization}/locations/{location}/workloads/{workload} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'assuredworkloads.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Analyze if the source Assured Workloads can be moved to the target Assured - * Workload - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $target = 'target'; - * $response = $assuredWorkloadsServiceClient->analyzeWorkloadMove($target); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $target Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * @param array $optionalArgs { - * Optional. - * - * @type string $source - * The source type is a project-based workload. Specify the workloads's - * relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-1" - * @type string $project - * The source type is a project. Specify the project's relative resource - * name, formatted as either a project number or a project ID: - * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" - * For example: - * "projects/951040570662" when specifying a project number, or - * "projects/my-project-123" when specifying a project ID. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function analyzeWorkloadMove($target, array $optionalArgs = []) - { - $request = new AnalyzeWorkloadMoveRequest(); - $request->setTarget($target); - if (isset($optionalArgs['source'])) { - $request->setSource($optionalArgs['source']); - } - - if (isset($optionalArgs['project'])) { - $request->setProject($optionalArgs['project']); - } - - return $this->startCall('AnalyzeWorkloadMove', AnalyzeWorkloadMoveResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates Assured Workload. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $formattedParent = $assuredWorkloadsServiceClient->locationName('[ORGANIZATION]', '[LOCATION]'); - * $workload = new Workload(); - * $operationResponse = $assuredWorkloadsServiceClient->createWorkload($formattedParent, $workload); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $assuredWorkloadsServiceClient->createWorkload($formattedParent, $workload); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $assuredWorkloadsServiceClient->resumeOperation($operationName, 'createWorkload'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * @param Workload $workload Required. Assured Workload to create - * @param array $optionalArgs { - * Optional. - * - * @type string $externalId - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createWorkload($parent, $workload, array $optionalArgs = []) - { - $request = new CreateWorkloadRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setWorkload($workload); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['externalId'])) { - $request->setExternalId($optionalArgs['externalId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateWorkload', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes the workload. Make sure that workload's direct children are already - * in a deleted state, otherwise the request will fail with a - * FAILED_PRECONDITION error. - * In addition to assuredworkloads.workload.delete permission, the user should - * also have orgpolicy.policy.set permission on the deleted folder to remove - * Assured Workloads OrgPolicies. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $formattedName = $assuredWorkloadsServiceClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - * $assuredWorkloadsServiceClient->deleteWorkload($formattedName); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteWorkload($name, array $optionalArgs = []) - { - $request = new DeleteWorkloadRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteWorkload', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets Assured Workload associated with a CRM Node - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $formattedName = $assuredWorkloadsServiceClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - * $response = $assuredWorkloadsServiceClient->getWorkload($formattedName); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getWorkload($name, array $optionalArgs = []) - { - $request = new GetWorkloadRequest(); - $request->setName($name); - return $this->startCall('GetWorkload', Workload::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists Assured Workloads under a CRM Node. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $formattedParent = $assuredWorkloadsServiceClient->locationName('[ORGANIZATION]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $assuredWorkloadsServiceClient->listWorkloads($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $assuredWorkloadsServiceClient->listWorkloads($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listWorkloads($parent, array $optionalArgs = []) - { - $request = new ListWorkloadsRequest(); - $request->setParent($parent); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - return $this->getPagedListResponse('ListWorkloads', $optionalArgs, ListWorkloadsResponse::class, $request); - } - - /** - * Restrict the list of resources allowed in the Workload environment. - * The current list of allowed products can be found at - * https://cloud.google.com/assured-workloads/docs/supported-products - * In addition to assuredworkloads.workload.update permission, the user should - * also have orgpolicy.policy.set permission on the folder resource - * to use this functionality. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $name = 'name'; - * $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - * $response = $assuredWorkloadsServiceClient->restrictAllowedResources($name, $restrictionType); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * @param int $restrictionType Required. The type of restriction for using gcp products in the Workload environment. - * For allowed values, use constants defined on {@see \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest\RestrictionType} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restrictAllowedResources($name, $restrictionType, array $optionalArgs = []) - { - $request = new RestrictAllowedResourcesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setRestrictionType($restrictionType); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RestrictAllowedResources', RestrictAllowedResourcesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates an existing workload. - * Currently allows updating of workload display_name and labels. - * For force updates don't set etag field in the Workload. - * Only one update operation per workload can be in progress. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $workload = new Workload(); - * $updateMask = new FieldMask(); - * $response = $assuredWorkloadsServiceClient->updateWorkload($workload, $updateMask); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param Workload $workload Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @param FieldMask $updateMask Required. The list of fields to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateWorkload($workload, $updateMask, array $optionalArgs = []) - { - $request = new UpdateWorkloadRequest(); - $request->setWorkload($workload); - $request->setUpdateMask($updateMask); - return $this->startCall('UpdateWorkload', Workload::class, $optionalArgs, $request)->wait(); - } -} diff --git a/AssuredWorkloads/src/V1beta1/GetWorkloadRequest.php b/AssuredWorkloads/src/V1beta1/GetWorkloadRequest.php deleted file mode 100644 index ddc24db8f691..000000000000 --- a/AssuredWorkloads/src/V1beta1/GetWorkloadRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest - */ -class GetWorkloadRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/ListWorkloadsRequest.php b/AssuredWorkloads/src/V1beta1/ListWorkloadsRequest.php deleted file mode 100644 index 886782a32a43..000000000000 --- a/AssuredWorkloads/src/V1beta1/ListWorkloadsRequest.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest - */ -class ListWorkloadsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - /** - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * - * Generated from protobuf field string filter = 4; - */ - private $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * @type int $page_size - * Page size. - * @type string $page_token - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * @type string $filter - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/ListWorkloadsResponse.php b/AssuredWorkloads/src/V1beta1/ListWorkloadsResponse.php deleted file mode 100644 index cbb1c3f37e61..000000000000 --- a/AssuredWorkloads/src/V1beta1/ListWorkloadsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse - */ -class ListWorkloadsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of Workloads under a given parent. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; - */ - private $workloads; - /** - * The next page token. Return empty if reached the last page. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload>|\Google\Protobuf\Internal\RepeatedField $workloads - * List of Workloads under a given parent. - * @type string $next_page_token - * The next page token. Return empty if reached the last page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * List of Workloads under a given parent. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWorkloads() - { - return $this->workloads; - } - - /** - * List of Workloads under a given parent. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; - * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWorkloads($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload::class); - $this->workloads = $arr; - - return $this; - } - - /** - * The next page token. Return empty if reached the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The next page token. Return empty if reached the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/README.md b/AssuredWorkloads/src/V1beta1/README.md deleted file mode 100644 index c923670fae12..000000000000 --- a/AssuredWorkloads/src/V1beta1/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Google Cloud Assured Workloads V1beta1 generated client for PHP - -### Sample - -```php -require 'vendor/autoload.php'; - -use Google\Cloud\AssuredWorkloads\V1beta1\AssuredWorkloadsServiceClient; - -$client = new AssuredWorkloadsServiceClient(); - -$workloads = $client->listWorkloads( - AssuredWorkloadsServiceClient::locationNAme('[MY_ORGANIZATION'], 'us-west1') -); - -foreach ($workloads as $workload) { - print 'Workload: ' . $workload->getName() . PHP_EOL; -} -``` diff --git a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest.php b/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest.php deleted file mode 100644 index 7367d285f25e..000000000000 --- a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest - */ -class RestrictAllowedResourcesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Required. The type of restriction for using gcp products in the Workload environment. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $restriction_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * @type int $restriction_type - * Required. The type of restriction for using gcp products in the Workload environment. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The type of restriction for using gcp products in the Workload environment. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getRestrictionType() - { - return $this->restriction_type; - } - - /** - * Required. The type of restriction for using gcp products in the Workload environment. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setRestrictionType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest\RestrictionType::class); - $this->restriction_type = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php b/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php deleted file mode 100644 index b6587e19dd4d..000000000000 --- a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType - */ -class RestrictionType -{ - /** - * Unknown restriction type. - * - * Generated from protobuf enum RESTRICTION_TYPE_UNSPECIFIED = 0; - */ - const RESTRICTION_TYPE_UNSPECIFIED = 0; - /** - * Allow the use all of all gcp products, irrespective of the compliance - * posture. This effectively removes gcp.restrictServiceUsage OrgPolicy - * on the AssuredWorkloads Folder. - * - * Generated from protobuf enum ALLOW_ALL_GCP_RESOURCES = 1; - */ - const ALLOW_ALL_GCP_RESOURCES = 1; - /** - * Based on Workload's compliance regime, allowed list changes. - * See - https://cloud.google.com/assured-workloads/docs/supported-products - * for the list of supported resources. - * - * Generated from protobuf enum ALLOW_COMPLIANT_RESOURCES = 2; - */ - const ALLOW_COMPLIANT_RESOURCES = 2; - - private static $valueToName = [ - self::RESTRICTION_TYPE_UNSPECIFIED => 'RESTRICTION_TYPE_UNSPECIFIED', - self::ALLOW_ALL_GCP_RESOURCES => 'ALLOW_ALL_GCP_RESOURCES', - self::ALLOW_COMPLIANT_RESOURCES => 'ALLOW_COMPLIANT_RESOURCES', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestrictionType::class, \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest_RestrictionType::class); - diff --git a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest_RestrictionType.php b/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest_RestrictionType.php deleted file mode 100644 index 42268d62e7b7..000000000000 --- a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest_RestrictionType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse - */ -class RestrictAllowedResourcesResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/UpdateWorkloadRequest.php b/AssuredWorkloads/src/V1beta1/UpdateWorkloadRequest.php deleted file mode 100644 index af5e97b5f06d..000000000000 --- a/AssuredWorkloads/src/V1beta1/UpdateWorkloadRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest - */ -class UpdateWorkloadRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $workload = null; - /** - * Required. The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload - * Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @type \Google\Protobuf\FieldMask $update_mask - * Required. The list of fields to be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload|null - */ - public function getWorkload() - { - return $this->workload; - } - - public function hasWorkload() - { - return isset($this->workload); - } - - public function clearWorkload() - { - unset($this->workload); - } - - /** - * Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload $var - * @return $this - */ - public function setWorkload($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload::class); - $this->workload = $var; - - return $this; - } - - /** - * Required. The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/Workload.php b/AssuredWorkloads/src/V1beta1/Workload.php deleted file mode 100644 index 7325a29fdb5a..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload.php +++ /dev/null @@ -1,882 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload - */ -class Workload extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The resource name of the workload. - * Format: - * organizations/{organization}/locations/{location}/workloads/{workload} - * Read-only. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $name = ''; - /** - * Required. The user-assigned display name of the Workload. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, and spaces. - * Example: My Workload - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $display_name = ''; - /** - * Output only. The resources associated with this workload. - * These resources will be created when creating the workload. - * If any of the projects already exist, the workload creation will fail. - * Always read only. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $resources; - /** - * Required. Immutable. Compliance Regime associated with this workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $compliance_regime = 0; - /** - * Output only. Immutable. The Workload creation timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $create_time = null; - /** - * Output only. The billing account used for the resources which are - * direct children of workload. This billing account is initially associated - * with the resources created as part of Workload creation. - * After the initial creation of these resources, the customer can change - * the assigned billing account. - * The resource name has the form - * `billingAccounts/{billing_account_id}`. For example, - * `billingAccounts/012345-567890-ABCDEF`. - * - * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $billing_account = ''; - /** - * Optional. ETag of the workload, it is calculated on the basis - * of the Workload contents. It will be used in Update & Delete operations. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $etag = ''; - /** - * Optional. Labels applied to the workload. - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Input only. The parent resource for the resources managed by this Assured Workload. May - * be either empty or a folder resource which is a child of the - * Workload parent. If not specified all resources are created under the - * parent organization. - * Format: - * folders/{folder_id} - * - * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $provisioned_resources_parent = ''; - /** - * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS - * CMEK key is provisioned. - * This field is deprecated as of Feb 28, 2022. - * In order to create a Keyring, callers should specify, - * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; - * @deprecated - */ - protected $kms_settings = null; - /** - * Input only. Resource properties that are used to customize workload resources. - * These properties (such as custom project id) will be used to create - * workload resources if possible. This field is optional. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $resource_settings; - /** - * Output only. Represents the KAJ enrollment state of the given workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $kaj_enrollment_state = 0; - /** - * Optional. Indicates the sovereignty status of the given workload. - * Currently meant to be used by Europe/Canada customers. - * - * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $enable_sovereign_controls = false; - /** - * Output only. Represents the SAA enrollment response of the given workload. - * SAA enrollment response is queried during GetWorkload call. - * In failure cases, user friendly error message is shown in SAA details page. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $saa_enrollment_response = null; - /** - * Output only. Urls for services which are compliant for this Assured Workload, but which - * are currently disallowed by the ResourceUsageRestriction org policy. - * Invoke RestrictAllowedResources endpoint to allow your project developers - * to use these services in their environment." - * - * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $compliant_but_disallowed_services; - protected $compliance_regime_settings; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optional. The resource name of the workload. - * Format: - * organizations/{organization}/locations/{location}/workloads/{workload} - * Read-only. - * @type string $display_name - * Required. The user-assigned display name of the Workload. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, and spaces. - * Example: My Workload - * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $resources - * Output only. The resources associated with this workload. - * These resources will be created when creating the workload. - * If any of the projects already exist, the workload creation will fail. - * Always read only. - * @type int $compliance_regime - * Required. Immutable. Compliance Regime associated with this workload. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Immutable. The Workload creation timestamp. - * @type string $billing_account - * Output only. The billing account used for the resources which are - * direct children of workload. This billing account is initially associated - * with the resources created as part of Workload creation. - * After the initial creation of these resources, the customer can change - * the assigned billing account. - * The resource name has the form - * `billingAccounts/{billing_account_id}`. For example, - * `billingAccounts/012345-567890-ABCDEF`. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings $il4_settings - * Input only. Immutable. Settings specific to resources needed for IL4. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings $cjis_settings - * Input only. Immutable. Settings specific to resources needed for CJIS. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings $fedramp_high_settings - * Input only. Immutable. Settings specific to resources needed for FedRAMP High. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings $fedramp_moderate_settings - * Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. - * @type string $etag - * Optional. ETag of the workload, it is calculated on the basis - * of the Workload contents. It will be used in Update & Delete operations. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Labels applied to the workload. - * @type string $provisioned_resources_parent - * Input only. The parent resource for the resources managed by this Assured Workload. May - * be either empty or a folder resource which is a child of the - * Workload parent. If not specified all resources are created under the - * parent organization. - * Format: - * folders/{folder_id} - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS - * CMEK key is provisioned. - * This field is deprecated as of Feb 28, 2022. - * In order to create a Keyring, callers should specify, - * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. - * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $resource_settings - * Input only. Resource properties that are used to customize workload resources. - * These properties (such as custom project id) will be used to create - * workload resources if possible. This field is optional. - * @type int $kaj_enrollment_state - * Output only. Represents the KAJ enrollment state of the given workload. - * @type bool $enable_sovereign_controls - * Optional. Indicates the sovereignty status of the given workload. - * Currently meant to be used by Europe/Canada customers. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse $saa_enrollment_response - * Output only. Represents the SAA enrollment response of the given workload. - * SAA enrollment response is queried during GetWorkload call. - * In failure cases, user friendly error message is shown in SAA details page. - * @type array|\Google\Protobuf\Internal\RepeatedField $compliant_but_disallowed_services - * Output only. Urls for services which are compliant for this Assured Workload, but which - * are currently disallowed by the ResourceUsageRestriction org policy. - * Invoke RestrictAllowedResources endpoint to allow your project developers - * to use these services in their environment." - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The resource name of the workload. - * Format: - * organizations/{organization}/locations/{location}/workloads/{workload} - * Read-only. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optional. The resource name of the workload. - * Format: - * organizations/{organization}/locations/{location}/workloads/{workload} - * Read-only. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The user-assigned display name of the Workload. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, and spaces. - * Example: My Workload - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. The user-assigned display name of the Workload. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, and spaces. - * Example: My Workload - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The resources associated with this workload. - * These resources will be created when creating the workload. - * If any of the projects already exist, the workload creation will fail. - * Always read only. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResources() - { - return $this->resources; - } - - /** - * Output only. The resources associated with this workload. - * These resources will be created when creating the workload. - * If any of the projects already exist, the workload creation will fail. - * Always read only. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResources($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo::class); - $this->resources = $arr; - - return $this; - } - - /** - * Required. Immutable. Compliance Regime associated with this workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getComplianceRegime() - { - return $this->compliance_regime; - } - - /** - * Required. Immutable. Compliance Regime associated with this workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setComplianceRegime($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ComplianceRegime::class); - $this->compliance_regime = $var; - - return $this; - } - - /** - * Output only. Immutable. The Workload creation timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Immutable. The Workload creation timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The billing account used for the resources which are - * direct children of workload. This billing account is initially associated - * with the resources created as part of Workload creation. - * After the initial creation of these resources, the customer can change - * the assigned billing account. - * The resource name has the form - * `billingAccounts/{billing_account_id}`. For example, - * `billingAccounts/012345-567890-ABCDEF`. - * - * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getBillingAccount() - { - return $this->billing_account; - } - - /** - * Output only. The billing account used for the resources which are - * direct children of workload. This billing account is initially associated - * with the resources created as part of Workload creation. - * After the initial creation of these resources, the customer can change - * the assigned billing account. - * The resource name has the form - * `billingAccounts/{billing_account_id}`. For example, - * `billingAccounts/012345-567890-ABCDEF`. - * - * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setBillingAccount($var) - { - GPBUtil::checkString($var, True); - $this->billing_account = $var; - - return $this; - } - - /** - * Input only. Immutable. Settings specific to resources needed for IL4. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings|null - * @deprecated - */ - public function getIl4Settings() - { - @trigger_error('il4_settings is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(7); - } - - public function hasIl4Settings() - { - @trigger_error('il4_settings is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(7); - } - - /** - * Input only. Immutable. Settings specific to resources needed for IL4. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings $var - * @return $this - * @deprecated - */ - public function setIl4Settings($var) - { - @trigger_error('il4_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Input only. Immutable. Settings specific to resources needed for CJIS. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings|null - * @deprecated - */ - public function getCjisSettings() - { - @trigger_error('cjis_settings is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(8); - } - - public function hasCjisSettings() - { - @trigger_error('cjis_settings is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(8); - } - - /** - * Input only. Immutable. Settings specific to resources needed for CJIS. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings $var - * @return $this - * @deprecated - */ - public function setCjisSettings($var) - { - @trigger_error('cjis_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Input only. Immutable. Settings specific to resources needed for FedRAMP High. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings|null - * @deprecated - */ - public function getFedrampHighSettings() - { - @trigger_error('fedramp_high_settings is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(11); - } - - public function hasFedrampHighSettings() - { - @trigger_error('fedramp_high_settings is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(11); - } - - /** - * Input only. Immutable. Settings specific to resources needed for FedRAMP High. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings $var - * @return $this - * @deprecated - */ - public function setFedrampHighSettings($var) - { - @trigger_error('fedramp_high_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings|null - * @deprecated - */ - public function getFedrampModerateSettings() - { - @trigger_error('fedramp_moderate_settings is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(12); - } - - public function hasFedrampModerateSettings() - { - @trigger_error('fedramp_moderate_settings is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(12); - } - - /** - * Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings $var - * @return $this - * @deprecated - */ - public function setFedrampModerateSettings($var) - { - @trigger_error('fedramp_moderate_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings::class); - $this->writeOneof(12, $var); - - return $this; - } - - /** - * Optional. ETag of the workload, it is calculated on the basis - * of the Workload contents. It will be used in Update & Delete operations. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. ETag of the workload, it is calculated on the basis - * of the Workload contents. It will be used in Update & Delete operations. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. Labels applied to the workload. - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Labels applied to the workload. - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Input only. The parent resource for the resources managed by this Assured Workload. May - * be either empty or a folder resource which is a child of the - * Workload parent. If not specified all resources are created under the - * parent organization. - * Format: - * folders/{folder_id} - * - * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getProvisionedResourcesParent() - { - return $this->provisioned_resources_parent; - } - - /** - * Input only. The parent resource for the resources managed by this Assured Workload. May - * be either empty or a folder resource which is a child of the - * Workload parent. If not specified all resources are created under the - * parent organization. - * Format: - * folders/{folder_id} - * - * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setProvisionedResourcesParent($var) - { - GPBUtil::checkString($var, True); - $this->provisioned_resources_parent = $var; - - return $this; - } - - /** - * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS - * CMEK key is provisioned. - * This field is deprecated as of Feb 28, 2022. - * In order to create a Keyring, callers should specify, - * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - * @deprecated - */ - public function getKmsSettings() - { - @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); - return $this->kms_settings; - } - - public function hasKmsSettings() - { - @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); - unset($this->kms_settings); - } - - /** - * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS - * CMEK key is provisioned. - * This field is deprecated as of Feb 28, 2022. - * In order to create a Keyring, callers should specify, - * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - * @deprecated - */ - public function setKmsSettings($var) - { - @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - - /** - * Input only. Resource properties that are used to customize workload resources. - * These properties (such as custom project id) will be used to create - * workload resources if possible. This field is optional. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceSettings() - { - return $this->resource_settings; - } - - /** - * Input only. Resource properties that are used to customize workload resources. - * These properties (such as custom project id) will be used to create - * workload resources if possible. This field is optional. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceSettings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings::class); - $this->resource_settings = $arr; - - return $this; - } - - /** - * Output only. Represents the KAJ enrollment state of the given workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getKajEnrollmentState() - { - return $this->kaj_enrollment_state; - } - - /** - * Output only. Represents the KAJ enrollment state of the given workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setKajEnrollmentState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KajEnrollmentState::class); - $this->kaj_enrollment_state = $var; - - return $this; - } - - /** - * Optional. Indicates the sovereignty status of the given workload. - * Currently meant to be used by Europe/Canada customers. - * - * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableSovereignControls() - { - return $this->enable_sovereign_controls; - } - - /** - * Optional. Indicates the sovereignty status of the given workload. - * Currently meant to be used by Europe/Canada customers. - * - * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableSovereignControls($var) - { - GPBUtil::checkBool($var); - $this->enable_sovereign_controls = $var; - - return $this; - } - - /** - * Output only. Represents the SAA enrollment response of the given workload. - * SAA enrollment response is queried during GetWorkload call. - * In failure cases, user friendly error message is shown in SAA details page. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse|null - */ - public function getSaaEnrollmentResponse() - { - return $this->saa_enrollment_response; - } - - public function hasSaaEnrollmentResponse() - { - return isset($this->saa_enrollment_response); - } - - public function clearSaaEnrollmentResponse() - { - unset($this->saa_enrollment_response); - } - - /** - * Output only. Represents the SAA enrollment response of the given workload. - * SAA enrollment response is queried during GetWorkload call. - * In failure cases, user friendly error message is shown in SAA details page. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse $var - * @return $this - */ - public function setSaaEnrollmentResponse($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse::class); - $this->saa_enrollment_response = $var; - - return $this; - } - - /** - * Output only. Urls for services which are compliant for this Assured Workload, but which - * are currently disallowed by the ResourceUsageRestriction org policy. - * Invoke RestrictAllowedResources endpoint to allow your project developers - * to use these services in their environment." - * - * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCompliantButDisallowedServices() - { - return $this->compliant_but_disallowed_services; - } - - /** - * Output only. Urls for services which are compliant for this Assured Workload, but which - * are currently disallowed by the ResourceUsageRestriction org policy. - * Invoke RestrictAllowedResources endpoint to allow your project developers - * to use these services in their environment." - * - * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCompliantButDisallowedServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->compliant_but_disallowed_services = $arr; - - return $this; - } - - /** - * @return string - */ - public function getComplianceRegimeSettings() - { - return $this->whichOneof("compliance_regime_settings"); - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/Workload/CJISSettings.php b/AssuredWorkloads/src/V1beta1/Workload/CJISSettings.php deleted file mode 100644 index 8bc80d4866cf..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/CJISSettings.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - */ -class CJISSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $kms_settings = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Immutable. Settings used to create a CMEK crypto key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - */ - public function getKmsSettings() - { - return $this->kms_settings; - } - - public function hasKmsSettings() - { - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - unset($this->kms_settings); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - */ - public function setKmsSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CJISSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_CJISSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/ComplianceRegime.php b/AssuredWorkloads/src/V1beta1/Workload/ComplianceRegime.php deleted file mode 100644 index 2a313655a862..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/ComplianceRegime.php +++ /dev/null @@ -1,127 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime - */ -class ComplianceRegime -{ - /** - * Unknown compliance regime. - * - * Generated from protobuf enum COMPLIANCE_REGIME_UNSPECIFIED = 0; - */ - const COMPLIANCE_REGIME_UNSPECIFIED = 0; - /** - * Information protection as per DoD IL4 requirements. - * - * Generated from protobuf enum IL4 = 1; - */ - const IL4 = 1; - /** - * Criminal Justice Information Services (CJIS) Security policies. - * - * Generated from protobuf enum CJIS = 2; - */ - const CJIS = 2; - /** - * FedRAMP High data protection controls - * - * Generated from protobuf enum FEDRAMP_HIGH = 3; - */ - const FEDRAMP_HIGH = 3; - /** - * FedRAMP Moderate data protection controls - * - * Generated from protobuf enum FEDRAMP_MODERATE = 4; - */ - const FEDRAMP_MODERATE = 4; - /** - * Assured Workloads For US Regions data protection controls - * - * Generated from protobuf enum US_REGIONAL_ACCESS = 5; - */ - const US_REGIONAL_ACCESS = 5; - /** - * Health Insurance Portability and Accountability Act controls - * - * Generated from protobuf enum HIPAA = 6; - */ - const HIPAA = 6; - /** - * Health Information Trust Alliance controls - * - * Generated from protobuf enum HITRUST = 7; - */ - const HITRUST = 7; - /** - * Assured Workloads For EU Regions and Support controls - * - * Generated from protobuf enum EU_REGIONS_AND_SUPPORT = 8; - */ - const EU_REGIONS_AND_SUPPORT = 8; - /** - * Assured Workloads For Canada Regions and Support controls - * - * Generated from protobuf enum CA_REGIONS_AND_SUPPORT = 9; - */ - const CA_REGIONS_AND_SUPPORT = 9; - /** - * International Traffic in Arms Regulations - * - * Generated from protobuf enum ITAR = 10; - */ - const ITAR = 10; - /** - * Assured Workloads for Australia Regions and Support controls - * - * Generated from protobuf enum AU_REGIONS_AND_US_SUPPORT = 11; - */ - const AU_REGIONS_AND_US_SUPPORT = 11; - - private static $valueToName = [ - self::COMPLIANCE_REGIME_UNSPECIFIED => 'COMPLIANCE_REGIME_UNSPECIFIED', - self::IL4 => 'IL4', - self::CJIS => 'CJIS', - self::FEDRAMP_HIGH => 'FEDRAMP_HIGH', - self::FEDRAMP_MODERATE => 'FEDRAMP_MODERATE', - self::US_REGIONAL_ACCESS => 'US_REGIONAL_ACCESS', - self::HIPAA => 'HIPAA', - self::HITRUST => 'HITRUST', - self::EU_REGIONS_AND_SUPPORT => 'EU_REGIONS_AND_SUPPORT', - self::CA_REGIONS_AND_SUPPORT => 'CA_REGIONS_AND_SUPPORT', - self::ITAR => 'ITAR', - self::AU_REGIONS_AND_US_SUPPORT => 'AU_REGIONS_AND_US_SUPPORT', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ComplianceRegime::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ComplianceRegime::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/FedrampHighSettings.php b/AssuredWorkloads/src/V1beta1/Workload/FedrampHighSettings.php deleted file mode 100644 index e74383103c46..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/FedrampHighSettings.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - */ -class FedrampHighSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $kms_settings = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Immutable. Settings used to create a CMEK crypto key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - */ - public function getKmsSettings() - { - return $this->kms_settings; - } - - public function hasKmsSettings() - { - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - unset($this->kms_settings); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - */ - public function setKmsSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FedrampHighSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_FedrampHighSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/FedrampModerateSettings.php b/AssuredWorkloads/src/V1beta1/Workload/FedrampModerateSettings.php deleted file mode 100644 index c40f0181afb7..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/FedrampModerateSettings.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - */ -class FedrampModerateSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $kms_settings = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Immutable. Settings used to create a CMEK crypto key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - */ - public function getKmsSettings() - { - return $this->kms_settings; - } - - public function hasKmsSettings() - { - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - unset($this->kms_settings); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - */ - public function setKmsSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FedrampModerateSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_FedrampModerateSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/IL4Settings.php b/AssuredWorkloads/src/V1beta1/Workload/IL4Settings.php deleted file mode 100644 index aef40fe8f140..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/IL4Settings.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - */ -class IL4Settings extends \Google\Protobuf\Internal\Message -{ - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $kms_settings = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Immutable. Settings used to create a CMEK crypto key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - */ - public function getKmsSettings() - { - return $this->kms_settings; - } - - public function hasKmsSettings() - { - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - unset($this->kms_settings); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - */ - public function setKmsSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IL4Settings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_IL4Settings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/KMSSettings.php b/AssuredWorkloads/src/V1beta1/Workload/KMSSettings.php deleted file mode 100644 index 3bfcdc8a6f9e..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/KMSSettings.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - */ -class KMSSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - * new version of the crypto key and mark it as the primary. - * - * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $next_rotation_time = null; - /** - * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - * Management Service automatically rotates a key. Must be at least 24 hours - * and at most 876,000 hours. - * - * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $rotation_period = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $next_rotation_time - * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - * new version of the crypto key and mark it as the primary. - * @type \Google\Protobuf\Duration $rotation_period - * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - * Management Service automatically rotates a key. Must be at least 24 hours - * and at most 876,000 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - * new version of the crypto key and mark it as the primary. - * - * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getNextRotationTime() - { - return $this->next_rotation_time; - } - - public function hasNextRotationTime() - { - return isset($this->next_rotation_time); - } - - public function clearNextRotationTime() - { - unset($this->next_rotation_time); - } - - /** - * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - * new version of the crypto key and mark it as the primary. - * - * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setNextRotationTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->next_rotation_time = $var; - - return $this; - } - - /** - * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - * Management Service automatically rotates a key. Must be at least 24 hours - * and at most 876,000 hours. - * - * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Duration|null - */ - public function getRotationPeriod() - { - return $this->rotation_period; - } - - public function hasRotationPeriod() - { - return isset($this->rotation_period); - } - - public function clearRotationPeriod() - { - unset($this->rotation_period); - } - - /** - * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - * Management Service automatically rotates a key. Must be at least 24 hours - * and at most 876,000 hours. - * - * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRotationPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->rotation_period = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KMSSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_KMSSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/KajEnrollmentState.php b/AssuredWorkloads/src/V1beta1/Workload/KajEnrollmentState.php deleted file mode 100644 index 393673186a18..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/KajEnrollmentState.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState - */ -class KajEnrollmentState -{ - /** - * Default State for KAJ Enrollment. - * - * Generated from protobuf enum KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; - */ - const KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; - /** - * Pending State for KAJ Enrollment. - * - * Generated from protobuf enum KAJ_ENROLLMENT_STATE_PENDING = 1; - */ - const KAJ_ENROLLMENT_STATE_PENDING = 1; - /** - * Complete State for KAJ Enrollment. - * - * Generated from protobuf enum KAJ_ENROLLMENT_STATE_COMPLETE = 2; - */ - const KAJ_ENROLLMENT_STATE_COMPLETE = 2; - - private static $valueToName = [ - self::KAJ_ENROLLMENT_STATE_UNSPECIFIED => 'KAJ_ENROLLMENT_STATE_UNSPECIFIED', - self::KAJ_ENROLLMENT_STATE_PENDING => 'KAJ_ENROLLMENT_STATE_PENDING', - self::KAJ_ENROLLMENT_STATE_COMPLETE => 'KAJ_ENROLLMENT_STATE_COMPLETE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KajEnrollmentState::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_KajEnrollmentState::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo.php b/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo.php deleted file mode 100644 index 71798337d145..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - */ -class ResourceInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Resource identifier. - * For a project this represents project_number. - * - * Generated from protobuf field int64 resource_id = 1; - */ - private $resource_id = 0; - /** - * Indicates the type of resource. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - */ - private $resource_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $resource_id - * Resource identifier. - * For a project this represents project_number. - * @type int $resource_type - * Indicates the type of resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Resource identifier. - * For a project this represents project_number. - * - * Generated from protobuf field int64 resource_id = 1; - * @return int|string - */ - public function getResourceId() - { - return $this->resource_id; - } - - /** - * Resource identifier. - * For a project this represents project_number. - * - * Generated from protobuf field int64 resource_id = 1; - * @param int|string $var - * @return $this - */ - public function setResourceId($var) - { - GPBUtil::checkInt64($var); - $this->resource_id = $var; - - return $this; - } - - /** - * Indicates the type of resource. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - * @return int - */ - public function getResourceType() - { - return $this->resource_type; - } - - /** - * Indicates the type of resource. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - * @param int $var - * @return $this - */ - public function setResourceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo\ResourceType::class); - $this->resource_type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceInfo::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceInfo::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo/ResourceType.php b/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo/ResourceType.php deleted file mode 100644 index 0e9955769014..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo/ResourceType.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType - */ -class ResourceType -{ - /** - * Unknown resource type. - * - * Generated from protobuf enum RESOURCE_TYPE_UNSPECIFIED = 0; - */ - const RESOURCE_TYPE_UNSPECIFIED = 0; - /** - * Deprecated. Existing workloads will continue to support this, but new - * CreateWorkloadRequests should not specify this as an input value. - * - * Generated from protobuf enum CONSUMER_PROJECT = 1 [deprecated = true]; - */ - const CONSUMER_PROJECT = 1; - /** - * Consumer Folder. - * - * Generated from protobuf enum CONSUMER_FOLDER = 4; - */ - const CONSUMER_FOLDER = 4; - /** - * Consumer project containing encryption keys. - * - * Generated from protobuf enum ENCRYPTION_KEYS_PROJECT = 2; - */ - const ENCRYPTION_KEYS_PROJECT = 2; - /** - * Keyring resource that hosts encryption keys. - * - * Generated from protobuf enum KEYRING = 3; - */ - const KEYRING = 3; - - private static $valueToName = [ - self::RESOURCE_TYPE_UNSPECIFIED => 'RESOURCE_TYPE_UNSPECIFIED', - self::CONSUMER_PROJECT => 'CONSUMER_PROJECT', - self::CONSUMER_FOLDER => 'CONSUMER_FOLDER', - self::ENCRYPTION_KEYS_PROJECT => 'ENCRYPTION_KEYS_PROJECT', - self::KEYRING => 'KEYRING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceType::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceInfo_ResourceType::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/ResourceSettings.php b/AssuredWorkloads/src/V1beta1/Workload/ResourceSettings.php deleted file mode 100644 index b64e1982f79a..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/ResourceSettings.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - */ -class ResourceSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Resource identifier. - * For a project this represents project_id. If the project is already - * taken, the workload creation will fail. - * For KeyRing, this represents the keyring_id. - * For a folder, don't set this value as folder_id is assigned by Google. - * - * Generated from protobuf field string resource_id = 1; - */ - private $resource_id = ''; - /** - * Indicates the type of resource. This field should be specified to - * correspond the id to the right project type (CONSUMER_PROJECT or - * ENCRYPTION_KEYS_PROJECT) - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - */ - private $resource_type = 0; - /** - * User-assigned resource display name. - * If not empty it will be used to create a resource with the specified - * name. - * - * Generated from protobuf field string display_name = 3; - */ - private $display_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource_id - * Resource identifier. - * For a project this represents project_id. If the project is already - * taken, the workload creation will fail. - * For KeyRing, this represents the keyring_id. - * For a folder, don't set this value as folder_id is assigned by Google. - * @type int $resource_type - * Indicates the type of resource. This field should be specified to - * correspond the id to the right project type (CONSUMER_PROJECT or - * ENCRYPTION_KEYS_PROJECT) - * @type string $display_name - * User-assigned resource display name. - * If not empty it will be used to create a resource with the specified - * name. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Resource identifier. - * For a project this represents project_id. If the project is already - * taken, the workload creation will fail. - * For KeyRing, this represents the keyring_id. - * For a folder, don't set this value as folder_id is assigned by Google. - * - * Generated from protobuf field string resource_id = 1; - * @return string - */ - public function getResourceId() - { - return $this->resource_id; - } - - /** - * Resource identifier. - * For a project this represents project_id. If the project is already - * taken, the workload creation will fail. - * For KeyRing, this represents the keyring_id. - * For a folder, don't set this value as folder_id is assigned by Google. - * - * Generated from protobuf field string resource_id = 1; - * @param string $var - * @return $this - */ - public function setResourceId($var) - { - GPBUtil::checkString($var, True); - $this->resource_id = $var; - - return $this; - } - - /** - * Indicates the type of resource. This field should be specified to - * correspond the id to the right project type (CONSUMER_PROJECT or - * ENCRYPTION_KEYS_PROJECT) - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - * @return int - */ - public function getResourceType() - { - return $this->resource_type; - } - - /** - * Indicates the type of resource. This field should be specified to - * correspond the id to the right project type (CONSUMER_PROJECT or - * ENCRYPTION_KEYS_PROJECT) - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - * @param int $var - * @return $this - */ - public function setResourceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo\ResourceType::class); - $this->resource_type = $var; - - return $this; - } - - /** - * User-assigned resource display name. - * If not empty it will be used to create a resource with the specified - * name. - * - * Generated from protobuf field string display_name = 3; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-assigned resource display name. - * If not empty it will be used to create a resource with the specified - * name. - * - * Generated from protobuf field string display_name = 3; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse.php b/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse.php deleted file mode 100644 index 3262c3e36835..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse - */ -class SaaEnrollmentResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates SAA enrollment status of a given workload. - * - * Generated from protobuf field optional .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; - */ - private $setup_status = null; - /** - * Indicates SAA enrollment setup error if any. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; - */ - private $setup_errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $setup_status - * Indicates SAA enrollment status of a given workload. - * @type array|\Google\Protobuf\Internal\RepeatedField $setup_errors - * Indicates SAA enrollment setup error if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Indicates SAA enrollment status of a given workload. - * - * Generated from protobuf field optional .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; - * @return int - */ - public function getSetupStatus() - { - return isset($this->setup_status) ? $this->setup_status : 0; - } - - public function hasSetupStatus() - { - return isset($this->setup_status); - } - - public function clearSetupStatus() - { - unset($this->setup_status); - } - - /** - * Indicates SAA enrollment status of a given workload. - * - * Generated from protobuf field optional .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; - * @param int $var - * @return $this - */ - public function setSetupStatus($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse\SetupState::class); - $this->setup_status = $var; - - return $this; - } - - /** - * Indicates SAA enrollment setup error if any. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSetupErrors() - { - return $this->setup_errors; - } - - /** - * Indicates SAA enrollment setup error if any. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSetupErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse\SetupError::class); - $this->setup_errors = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SaaEnrollmentResponse::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php b/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php deleted file mode 100644 index 8a777f423600..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError - */ -class SetupError -{ - /** - * Unspecified. - * - * Generated from protobuf enum SETUP_ERROR_UNSPECIFIED = 0; - */ - const SETUP_ERROR_UNSPECIFIED = 0; - /** - * Invalid states for all customers, to be redirected to AA UI for - * additional details. - * - * Generated from protobuf enum ERROR_INVALID_BASE_SETUP = 1; - */ - const ERROR_INVALID_BASE_SETUP = 1; - /** - * Returned when there is not an EKM key configured. - * - * Generated from protobuf enum ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; - */ - const ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; - /** - * Returned when there are no enrolled services or the customer is - * enrolled in CAA only for a subset of services. - * - * Generated from protobuf enum ERROR_NOT_ALL_SERVICES_ENROLLED = 3; - */ - const ERROR_NOT_ALL_SERVICES_ENROLLED = 3; - /** - * Returned when exception was encountered during evaluation of other - * criteria. - * - * Generated from protobuf enum ERROR_SETUP_CHECK_FAILED = 4; - */ - const ERROR_SETUP_CHECK_FAILED = 4; - - private static $valueToName = [ - self::SETUP_ERROR_UNSPECIFIED => 'SETUP_ERROR_UNSPECIFIED', - self::ERROR_INVALID_BASE_SETUP => 'ERROR_INVALID_BASE_SETUP', - self::ERROR_MISSING_EXTERNAL_SIGNING_KEY => 'ERROR_MISSING_EXTERNAL_SIGNING_KEY', - self::ERROR_NOT_ALL_SERVICES_ENROLLED => 'ERROR_NOT_ALL_SERVICES_ENROLLED', - self::ERROR_SETUP_CHECK_FAILED => 'ERROR_SETUP_CHECK_FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SetupError::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse_SetupError::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php b/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php deleted file mode 100644 index 14bd01931eb5..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState - */ -class SetupState -{ - /** - * Unspecified. - * - * Generated from protobuf enum SETUP_STATE_UNSPECIFIED = 0; - */ - const SETUP_STATE_UNSPECIFIED = 0; - /** - * SAA enrollment pending. - * - * Generated from protobuf enum STATUS_PENDING = 1; - */ - const STATUS_PENDING = 1; - /** - * SAA enrollment comopleted. - * - * Generated from protobuf enum STATUS_COMPLETE = 2; - */ - const STATUS_COMPLETE = 2; - - private static $valueToName = [ - self::SETUP_STATE_UNSPECIFIED => 'SETUP_STATE_UNSPECIFIED', - self::STATUS_PENDING => 'STATUS_PENDING', - self::STATUS_COMPLETE => 'STATUS_COMPLETE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SetupState::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse_SetupState::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload_CJISSettings.php b/AssuredWorkloads/src/V1beta1/Workload_CJISSettings.php deleted file mode 100644 index eb7a4423946a..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload_CJISSettings.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService' => [ - 'CreateWorkload' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AssuredWorkloads\V1beta1\Workload', - 'metadataReturnType' => '\Google\Cloud\AssuredWorkloads\V1beta1\CreateWorkloadOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListWorkloads' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getWorkloads', - ], - ], - ], - ], -]; diff --git a/AssuredWorkloads/src/V1beta1/resources/assured_workloads_service_rest_client_config.php b/AssuredWorkloads/src/V1beta1/resources/assured_workloads_service_rest_client_config.php deleted file mode 100644 index 2148a2339c57..000000000000 --- a/AssuredWorkloads/src/V1beta1/resources/assured_workloads_service_rest_client_config.php +++ /dev/null @@ -1,88 +0,0 @@ - [ - 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService' => [ - 'CreateWorkload' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=organizations/*/locations/*}/workloads', - 'body' => 'workload', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteWorkload' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*/workloads/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RestrictAllowedResources' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/AssuredWorkloads/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php b/AssuredWorkloads/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php index 88948df5f8aa..b319fe71a485 100644 --- a/AssuredWorkloads/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php +++ b/AssuredWorkloads/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return AssuredWorkloadsServiceClient */ @@ -95,16 +97,17 @@ public function acknowledgeViolationTest() // Mock request $name = 'name3373707'; $comment = 'comment950398559'; - $request = (new AcknowledgeViolationRequest()) - ->setName($name) - ->setComment($comment); + $request = (new AcknowledgeViolationRequest())->setName($name)->setComment($comment); $response = $gapicClient->acknowledgeViolation($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', $actualFuncCall); + $this->assertSame( + '/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($name, $actualValue); $actualValue = $actualRequestObject->getComment(); @@ -123,19 +126,20 @@ public function acknowledgeViolationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; $comment = 'comment950398559'; - $request = (new AcknowledgeViolationRequest()) - ->setName($name) - ->setComment($comment); + $request = (new AcknowledgeViolationRequest())->setName($name)->setComment($comment); try { $gapicClient->acknowledgeViolation($request); // If the $gapicClient method call did not throw, fail the test @@ -197,9 +201,7 @@ public function createWorkloadTest() $workload->setDisplayName($workloadDisplayName); $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; $workload->setComplianceRegime($workloadComplianceRegime); - $request = (new CreateWorkloadRequest()) - ->setParent($formattedParent) - ->setWorkload($workload); + $request = (new CreateWorkloadRequest())->setParent($formattedParent)->setWorkload($workload); $response = $gapicClient->createWorkload($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -209,7 +211,10 @@ public function createWorkloadTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/CreateWorkload', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/CreateWorkload', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getWorkload(); @@ -257,12 +262,15 @@ public function createWorkloadExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); @@ -271,9 +279,7 @@ public function createWorkloadExceptionTest() $workload->setDisplayName($workloadDisplayName); $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; $workload->setComplianceRegime($workloadComplianceRegime); - $request = (new CreateWorkloadRequest()) - ->setParent($formattedParent) - ->setWorkload($workload); + $request = (new CreateWorkloadRequest())->setParent($formattedParent)->setWorkload($workload); $response = $gapicClient->createWorkload($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -309,8 +315,7 @@ public function deleteWorkloadTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new DeleteWorkloadRequest()) - ->setName($formattedName); + $request = (new DeleteWorkloadRequest())->setName($formattedName); $gapicClient->deleteWorkload($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -333,17 +338,19 @@ public function deleteWorkloadExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new DeleteWorkloadRequest()) - ->setName($formattedName); + $request = (new DeleteWorkloadRequest())->setName($formattedName); try { $gapicClient->deleteWorkload($request); // If the $gapicClient method call did not throw, fail the test @@ -386,8 +393,7 @@ public function getViolationTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->violationName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]', '[VIOLATION]'); - $request = (new GetViolationRequest()) - ->setName($formattedName); + $request = (new GetViolationRequest())->setName($formattedName); $response = $gapicClient->getViolation($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -411,17 +417,19 @@ public function getViolationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->violationName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]', '[VIOLATION]'); - $request = (new GetViolationRequest()) - ->setName($formattedName); + $request = (new GetViolationRequest())->setName($formattedName); try { $gapicClient->getViolation($request); // If the $gapicClient method call did not throw, fail the test @@ -460,8 +468,7 @@ public function getWorkloadTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new GetWorkloadRequest()) - ->setName($formattedName); + $request = (new GetWorkloadRequest())->setName($formattedName); $response = $gapicClient->getWorkload($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -485,17 +492,19 @@ public function getWorkloadExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new GetWorkloadRequest()) - ->setName($formattedName); + $request = (new GetWorkloadRequest())->setName($formattedName); try { $gapicClient->getWorkload($request); // If the $gapicClient method call did not throw, fail the test @@ -520,17 +529,14 @@ public function listViolationsTest() // Mock response $nextPageToken = ''; $violationsElement = new Violation(); - $violations = [ - $violationsElement, - ]; + $violations = [$violationsElement]; $expectedResponse = new ListViolationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setViolations($violations); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new ListViolationsRequest()) - ->setParent($formattedParent); + $request = (new ListViolationsRequest())->setParent($formattedParent); $response = $gapicClient->listViolations($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -557,17 +563,19 @@ public function listViolationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new ListViolationsRequest()) - ->setParent($formattedParent); + $request = (new ListViolationsRequest())->setParent($formattedParent); try { $gapicClient->listViolations($request); // If the $gapicClient method call did not throw, fail the test @@ -592,17 +600,14 @@ public function listWorkloadsTest() // Mock response $nextPageToken = ''; $workloadsElement = new Workload(); - $workloads = [ - $workloadsElement, - ]; + $workloads = [$workloadsElement]; $expectedResponse = new ListWorkloadsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setWorkloads($workloads); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $request = (new ListWorkloadsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkloadsRequest())->setParent($formattedParent); $response = $gapicClient->listWorkloads($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -629,17 +634,19 @@ public function listWorkloadsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $request = (new ListWorkloadsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkloadsRequest())->setParent($formattedParent); try { $gapicClient->listWorkloads($request); // If the $gapicClient method call did not throw, fail the test @@ -667,16 +674,17 @@ public function restrictAllowedResourcesTest() // Mock request $name = 'name3373707'; $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - $request = (new RestrictAllowedResourcesRequest()) - ->setName($name) - ->setRestrictionType($restrictionType); + $request = (new RestrictAllowedResourcesRequest())->setName($name)->setRestrictionType($restrictionType); $response = $gapicClient->restrictAllowedResources($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/RestrictAllowedResources', $actualFuncCall); + $this->assertSame( + '/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/RestrictAllowedResources', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($name, $actualValue); $actualValue = $actualRequestObject->getRestrictionType(); @@ -695,19 +703,20 @@ public function restrictAllowedResourcesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - $request = (new RestrictAllowedResourcesRequest()) - ->setName($name) - ->setRestrictionType($restrictionType); + $request = (new RestrictAllowedResourcesRequest())->setName($name)->setRestrictionType($restrictionType); try { $gapicClient->restrictAllowedResources($request); // If the $gapicClient method call did not throw, fail the test @@ -751,9 +760,7 @@ public function updateWorkloadTest() $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; $workload->setComplianceRegime($workloadComplianceRegime); $updateMask = new FieldMask(); - $request = (new UpdateWorkloadRequest()) - ->setWorkload($workload) - ->setUpdateMask($updateMask); + $request = (new UpdateWorkloadRequest())->setWorkload($workload)->setUpdateMask($updateMask); $response = $gapicClient->updateWorkload($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -779,12 +786,15 @@ public function updateWorkloadExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $workload = new Workload(); @@ -793,9 +803,7 @@ public function updateWorkloadExceptionTest() $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; $workload->setComplianceRegime($workloadComplianceRegime); $updateMask = new FieldMask(); - $request = (new UpdateWorkloadRequest()) - ->setWorkload($workload) - ->setUpdateMask($updateMask); + $request = (new UpdateWorkloadRequest())->setWorkload($workload)->setUpdateMask($updateMask); try { $gapicClient->updateWorkload($request); // If the $gapicClient method call did not throw, fail the test @@ -823,16 +831,17 @@ public function acknowledgeViolationAsyncTest() // Mock request $name = 'name3373707'; $comment = 'comment950398559'; - $request = (new AcknowledgeViolationRequest()) - ->setName($name) - ->setComment($comment); + $request = (new AcknowledgeViolationRequest())->setName($name)->setComment($comment); $response = $gapicClient->acknowledgeViolationAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', $actualFuncCall); + $this->assertSame( + '/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($name, $actualValue); $actualValue = $actualRequestObject->getComment(); diff --git a/AssuredWorkloads/tests/Unit/V1beta1/AssuredWorkloadsServiceClientTest.php b/AssuredWorkloads/tests/Unit/V1beta1/AssuredWorkloadsServiceClientTest.php deleted file mode 100644 index 6aa4587bde2c..000000000000 --- a/AssuredWorkloads/tests/Unit/V1beta1/AssuredWorkloadsServiceClientTest.php +++ /dev/null @@ -1,610 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return AssuredWorkloadsServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new AssuredWorkloadsServiceClient($options); - } - - /** @test */ - public function analyzeWorkloadMoveTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AnalyzeWorkloadMoveResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $target = 'target-880905839'; - $response = $gapicClient->analyzeWorkloadMove($target); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/AnalyzeWorkloadMove', $actualFuncCall); - $actualValue = $actualRequestObject->getTarget(); - $this->assertProtobufEquals($target, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function analyzeWorkloadMoveExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $target = 'target-880905839'; - try { - $gapicClient->analyzeWorkloadMove($target); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createWorkloadTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createWorkloadTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $billingAccount = 'billingAccount-545871767'; - $etag = 'etag3123477'; - $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; - $enableSovereignControls = false; - $expectedResponse = new Workload(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setBillingAccount($billingAccount); - $expectedResponse->setEtag($etag); - $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); - $expectedResponse->setEnableSovereignControls($enableSovereignControls); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createWorkloadTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $workload = new Workload(); - $workloadDisplayName = 'workloadDisplayName191619702'; - $workload->setDisplayName($workloadDisplayName); - $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; - $workload->setComplianceRegime($workloadComplianceRegime); - $response = $gapicClient->createWorkload($formattedParent, $workload); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/CreateWorkload', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getWorkload(); - $this->assertProtobufEquals($workload, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkloadTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createWorkloadExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createWorkloadTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $workload = new Workload(); - $workloadDisplayName = 'workloadDisplayName191619702'; - $workload->setDisplayName($workloadDisplayName); - $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; - $workload->setComplianceRegime($workloadComplianceRegime); - $response = $gapicClient->createWorkload($formattedParent, $workload); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkloadTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteWorkloadTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $gapicClient->deleteWorkload($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/DeleteWorkload', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteWorkloadExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - try { - $gapicClient->deleteWorkload($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkloadTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $billingAccount = 'billingAccount-545871767'; - $etag = 'etag3123477'; - $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; - $enableSovereignControls = false; - $expectedResponse = new Workload(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setBillingAccount($billingAccount); - $expectedResponse->setEtag($etag); - $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); - $expectedResponse->setEnableSovereignControls($enableSovereignControls); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $response = $gapicClient->getWorkload($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/GetWorkload', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkloadExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - try { - $gapicClient->getWorkload($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkloadsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workloadsElement = new Workload(); - $workloads = [ - $workloadsElement, - ]; - $expectedResponse = new ListWorkloadsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkloads($workloads); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $response = $gapicClient->listWorkloads($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkloads()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/ListWorkloads', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkloadsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - try { - $gapicClient->listWorkloads($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restrictAllowedResourcesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RestrictAllowedResourcesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - $response = $gapicClient->restrictAllowedResources($name, $restrictionType); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/RestrictAllowedResources', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getRestrictionType(); - $this->assertProtobufEquals($restrictionType, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restrictAllowedResourcesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - try { - $gapicClient->restrictAllowedResources($name, $restrictionType); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateWorkloadTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $billingAccount = 'billingAccount-545871767'; - $etag = 'etag3123477'; - $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; - $enableSovereignControls = false; - $expectedResponse = new Workload(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setBillingAccount($billingAccount); - $expectedResponse->setEtag($etag); - $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); - $expectedResponse->setEnableSovereignControls($enableSovereignControls); - $transport->addResponse($expectedResponse); - // Mock request - $workload = new Workload(); - $workloadDisplayName = 'workloadDisplayName191619702'; - $workload->setDisplayName($workloadDisplayName); - $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; - $workload->setComplianceRegime($workloadComplianceRegime); - $updateMask = new FieldMask(); - $response = $gapicClient->updateWorkload($workload, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/UpdateWorkload', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkload(); - $this->assertProtobufEquals($workload, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateWorkloadExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $workload = new Workload(); - $workloadDisplayName = 'workloadDisplayName191619702'; - $workload->setDisplayName($workloadDisplayName); - $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; - $workload->setComplianceRegime($workloadComplianceRegime); - $updateMask = new FieldMask(); - try { - $gapicClient->updateWorkload($workload, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/AutoMl/.repo-metadata.json b/AutoMl/.repo-metadata.json deleted file mode 100644 index 8961bcce47f1..000000000000 --- a/AutoMl/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-automl", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-automl/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "automl" -} diff --git a/AutoMl/VERSION b/AutoMl/VERSION index 266146b87cbc..9f05f9f2ce1c 100644 --- a/AutoMl/VERSION +++ b/AutoMl/VERSION @@ -1 +1 @@ -1.6.3 +1.6.5 diff --git a/AutoMl/composer.json b/AutoMl/composer.json index 633b01ef735f..fa903fa09d32 100644 --- a/AutoMl/composer.json +++ b/AutoMl/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/BackupDr/.OwlBot.yaml b/BackupDr/.OwlBot.yaml new file mode 100644 index 000000000000..8f8bbba75403 --- /dev/null +++ b/BackupDr/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/cloud/backupdr/(v1)/.*-php/(.*) + dest: /owl-bot-staging/BackupDr/$1/$2 +api-name: BackupDr diff --git a/BackupDr/.gitattributes b/BackupDr/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/BackupDr/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/BackupDr/.github/pull_request_template.md b/BackupDr/.github/pull_request_template.md new file mode 100644 index 000000000000..50668535d9ba --- /dev/null +++ b/BackupDr/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `BackupDr/src`, and tests in `BackupDr/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/BackupDr/CONTRIBUTING.md b/BackupDr/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/BackupDr/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/BackupDr/LICENSE b/BackupDr/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/BackupDr/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/BackupDr/README.md b/BackupDr/README.md new file mode 100644 index 000000000000..c931baed414b --- /dev/null +++ b/BackupDr/README.md @@ -0,0 +1,45 @@ +# Google Cloud Backup Dr for PHP + +> Idiomatic PHP client for [Google Cloud Backup Dr](https://cloud.google.com/backup-disaster-recovery). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-backupdr/v/stable)](https://packagist.org/packages/google/cloud-backupdr) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-backupdr.svg)](https://packagist.org/packages/google/cloud-backupdr) + +* [API documentation](https://cloud.google.com/php/docs/reference/cloud-backupdr/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/cloud-backupdr +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/google-cloud-php-backupdr/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-dr). diff --git a/BackupDr/VERSION b/BackupDr/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/BackupDr/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/BackupDr/composer.json b/BackupDr/composer.json new file mode 100644 index 000000000000..76c277f77764 --- /dev/null +++ b/BackupDr/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/cloud-backupdr", + "description": "Google Cloud Backup Dr Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Cloud\\BackupDR\\": "src", + "GPBMetadata\\Google\\Cloud\\Backupdr\\": "metadata" + } + }, + "extra": { + "component": { + "id": "cloud-backupdr", + "path": "BackupDr", + "target": "googleapis/google-cloud-php-backupdr" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/BackupDr/metadata/V1/Backupdr.php b/BackupDr/metadata/V1/Backupdr.php new file mode 100644 index 0000000000000000000000000000000000000000..39dafc56b902b03f7555a483dbdb081f8758306a GIT binary patch literal 5436 zcmbtYPjB1U5no#VJBl6UW!F)ZxaBG->=+xW_Wlc$I$KJjy-I9ZkQEnOs30imNoGTn zT#~Y*roQylTMtEhDSGIw=yzy8Ku$$_%cTpnm+oOdK#K)-9v?}`7Ujy_Tq5($%$u3_ zo8QcPKlsExvf-Y%Lrv;v9&L-wzUUoM(RM7)YFUQZ>~%WS5nI-=tsB&lM6t9lR`%_mtwO;h>wv#*Ah<;1HO#o9nrmn5EsJK%t>`_l^ zYo6BF@zonerrsz7>W#yV#{exub6qj~2CqQGe|E2F=q=IpG!Or~ue+*l>YlC{`p+0*-p=FdAenaOkv+_(X|I6x5;Gh+ZIN>C58@FSt2kAjk4)c$JC5QiMlOE zw>`_LqG&$frCyXi_GRrsuq`vEcf>XBV?ICPZIp$;EZ)V^u`qhX@ zmu%||*)%Pd1a6}AfvOx%qhpV*PqV%a-(p*sTOG*k$N;=ud+zL!+wvGkIPLUT^=DR}+9d=Y|GdQb2;P#M!6C6me zbT3#k23gNpQPu;YJAsg2%UBjU%JO<)_h``zlg9PbctD*K>foVIvnCLjoc%(^L!T#UNVWrN#WGJX zgdqsz8O$15lNxS%T1>1ZH$NH=go}GgyS}1gdQP8X>jOx(9E!b8W$5$|DY=;mEr!sQ zqPk~V34&VK&mye^IyZsVQ<(PpHcc=2`29HCWTc>_5x2`Gk`DH!I;wNOOR#hS4oTmM z#_A+y5vx297YT^fpASVmSB^!s$-sCKZz+F+t?~Bbfi(yw+I1IZSQn(}IX@GR#+w`{ zbFfHZCJvZBkKqZ-2c+Sq=Y2$6mV|TMzzj^08!(M?M>oBQ-UO7h0;v%kUk{fP+{&z`i;S-Kx#8}@l*C60^Hrz zU2iWU^FX#nKkwmeL4F9cNcUKX0U>@LA^IPAolG9pGA!8GlvEdoU!T!t707@P1nhqEmeZz=+U%!i25SPY6&7Glw_;W9Q~A73XIQ-%RuH|a~(9x+-TmEUZz4<~yj(t7Ji zYZ??o#WKk@8j#tcBZ&|5{^VR63bH;qma_lGu#0{xx#(xO!?!=#cj4`k#IbH1wb&{0 z6oz0JT&)--cr%9%jO@}DLK=VpTKpk-NxIkh4)Xq=XR{1 z?R_%7bVgDp;oT%KQAP{VM3l&U2sdNa{#QfU{Av#7`K7#6BYzd(omdJWmkevM3PJ5; zE}53b=y9&eZoiQOKK;et|MlyskI9GZ72*}A*sX~F*N1q2J%;bep9Q!X!ye>=@kx&n z55u_v%VkS%WPd4{$BrZck7+B|lUljwHXRqa3V`ihj$bHS_sUHJ?A+XwLd+e}6T4 cmU)jq!419GF&5WbF|T#LB!5*qgEN3{02n#}T>t<8 literal 0 HcmV?d00001 diff --git a/BackupDr/owlbot.py b/BackupDr/owlbot.py new file mode 100644 index 000000000000..058fd7e0e1e4 --- /dev/null +++ b/BackupDr/owlbot.py @@ -0,0 +1,62 @@ +# Copyright 2023 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/BackupDr").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main( + src=src, + dest=dest, + copy_excludes=[ + src / "**/[A-Z]*_*.php", + ] +) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/BackupDr/phpunit.xml.dist b/BackupDr/phpunit.xml.dist new file mode 100644 index 000000000000..52ed8e7e232f --- /dev/null +++ b/BackupDr/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/BackupDr/samples/V1/BackupDRClient/create_management_server.php b/BackupDr/samples/V1/BackupDRClient/create_management_server.php new file mode 100644 index 000000000000..363df2a44dd8 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/create_management_server.php @@ -0,0 +1,96 @@ +setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->createManagementServer($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ManagementServer $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = '[MANAGEMENT_SERVER_ID]'; + + create_management_server_sample($formattedParent, $managementServerId); +} +// [END backupdr_v1_generated_BackupDR_CreateManagementServer_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/delete_management_server.php b/BackupDr/samples/V1/BackupDRClient/delete_management_server.php new file mode 100644 index 000000000000..600741c46b66 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/delete_management_server.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteManagementServer($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = BackupDRClient::managementServerName( + '[PROJECT]', + '[LOCATION]', + '[MANAGEMENTSERVER]' + ); + + delete_management_server_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteManagementServer_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/get_iam_policy.php b/BackupDr/samples/V1/BackupDRClient/get_iam_policy.php new file mode 100644 index 000000000000..051e2e471612 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $backupDRClient->getIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END backupdr_v1_generated_BackupDR_GetIamPolicy_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/get_location.php b/BackupDr/samples/V1/BackupDRClient/get_location.php new file mode 100644 index 000000000000..6e6c3ede82e1 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_GetLocation_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/get_management_server.php b/BackupDr/samples/V1/BackupDRClient/get_management_server.php new file mode 100644 index 000000000000..c6ad450d29fa --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/get_management_server.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ManagementServer $response */ + $response = $backupDRClient->getManagementServer($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 = BackupDRClient::managementServerName( + '[PROJECT]', + '[LOCATION]', + '[MANAGEMENTSERVER]' + ); + + get_management_server_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetManagementServer_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/list_locations.php b/BackupDr/samples/V1/BackupDRClient/list_locations.php new file mode 100644 index 000000000000..baacf567a7fa --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_ListLocations_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/list_management_servers.php b/BackupDr/samples/V1/BackupDRClient/list_management_servers.php new file mode 100644 index 000000000000..5d3871049b33 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/list_management_servers.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listManagementServers($request); + + /** @var ManagementServer $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + list_management_servers_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListManagementServers_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/set_iam_policy.php b/BackupDr/samples/V1/BackupDRClient/set_iam_policy.php new file mode 100644 index 000000000000..5de0fc44b7fb --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $backupDRClient->setIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END backupdr_v1_generated_BackupDR_SetIamPolicy_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/test_iam_permissions.php b/BackupDr/samples/V1/BackupDRClient/test_iam_permissions.php new file mode 100644 index 000000000000..e9e41bb418a7 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $backupDRClient->testIamPermissions($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 +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END backupdr_v1_generated_BackupDR_TestIamPermissions_sync] diff --git a/BackupDr/src/V1/Client/BackupDRClient.php b/BackupDr/src/V1/Client/BackupDRClient.php new file mode 100644 index 000000000000..b3150d620337 --- /dev/null +++ b/BackupDr/src/V1/Client/BackupDRClient.php @@ -0,0 +1,558 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/backup_dr_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/backup_dr_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/backup_dr_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/backup_dr_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * management_server resource. + * + * @param string $project + * @param string $location + * @param string $managementserver + * + * @return string The formatted management_server resource. + */ + public static function managementServerName(string $project, string $location, string $managementserver): string + { + return self::getPathTemplate('managementServer')->render([ + 'project' => $project, + 'location' => $location, + 'managementserver' => $managementserver, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - managementServer: projects/{project}/locations/{location}/managementServers/{managementserver} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'backupdr.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new ManagementServer in a given project and location. + * + * The async variant is {@see BackupDRClient::createManagementServerAsync()} . + * + * @example samples/V1/BackupDRClient/create_management_server.php + * + * @param CreateManagementServerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createManagementServer( + CreateManagementServerRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateManagementServer', $request, $callOptions)->wait(); + } + + /** + * Deletes a single ManagementServer. + * + * The async variant is {@see BackupDRClient::deleteManagementServerAsync()} . + * + * @example samples/V1/BackupDRClient/delete_management_server.php + * + * @param DeleteManagementServerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteManagementServer( + DeleteManagementServerRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteManagementServer', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single ManagementServer. + * + * The async variant is {@see BackupDRClient::getManagementServerAsync()} . + * + * @example samples/V1/BackupDRClient/get_management_server.php + * + * @param GetManagementServerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ManagementServer + * + * @throws ApiException Thrown if the API call fails. + */ + public function getManagementServer(GetManagementServerRequest $request, array $callOptions = []): ManagementServer + { + return $this->startApiCall('GetManagementServer', $request, $callOptions)->wait(); + } + + /** + * Lists ManagementServers in a given project and location. + * + * The async variant is {@see BackupDRClient::listManagementServersAsync()} . + * + * @example samples/V1/BackupDRClient/list_management_servers.php + * + * @param ListManagementServersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listManagementServers( + ListManagementServersRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListManagementServers', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see BackupDRClient::getLocationAsync()} . + * + * @example samples/V1/BackupDRClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see BackupDRClient::listLocationsAsync()} . + * + * @example samples/V1/BackupDRClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see BackupDRClient::getIamPolicyAsync()} . + * + * @example samples/V1/BackupDRClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see BackupDRClient::setIamPolicyAsync()} . + * + * @example samples/V1/BackupDRClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see BackupDRClient::testIamPermissionsAsync()} . + * + * @example samples/V1/BackupDRClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/BackupDr/src/V1/CreateManagementServerRequest.php b/BackupDr/src/V1/CreateManagementServerRequest.php new file mode 100644 index 000000000000..4f329ab68f27 --- /dev/null +++ b/BackupDr/src/V1/CreateManagementServerRequest.php @@ -0,0 +1,257 @@ +google.cloud.backupdr.v1.CreateManagementServerRequest + */ +class CreateManagementServerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The management server project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR + * locations map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * + * Generated from protobuf field string management_server_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $management_server_id = ''; + /** + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer management_server = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $management_server = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The management server project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR + * locations map to GCP regions, for example **us-central1**. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BackupDR\V1\ManagementServer $managementServer Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * @param string $managementServerId Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * + * @return \Google\Cloud\BackupDR\V1\CreateManagementServerRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BackupDR\V1\ManagementServer $managementServer, string $managementServerId): self + { + return (new self()) + ->setParent($parent) + ->setManagementServer($managementServer) + ->setManagementServerId($managementServerId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The management server project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR + * locations map to GCP regions, for example **us-central1**. + * @type string $management_server_id + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * @type \Google\Cloud\BackupDR\V1\ManagementServer $management_server + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Required. The management server project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR + * locations map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The management server project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR + * locations map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * + * Generated from protobuf field string management_server_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getManagementServerId() + { + return $this->management_server_id; + } + + /** + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * + * Generated from protobuf field string management_server_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setManagementServerId($var) + { + GPBUtil::checkString($var, True); + $this->management_server_id = $var; + + return $this; + } + + /** + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer management_server = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\ManagementServer|null + */ + public function getManagementServer() + { + return $this->management_server; + } + + public function hasManagementServer() + { + return isset($this->management_server); + } + + public function clearManagementServer() + { + unset($this->management_server); + } + + /** + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer management_server = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\ManagementServer $var + * @return $this + */ + public function setManagementServer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ManagementServer::class); + $this->management_server = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/DeleteManagementServerRequest.php b/BackupDr/src/V1/DeleteManagementServerRequest.php new file mode 100644 index 000000000000..c8bc344f88f3 --- /dev/null +++ b/BackupDr/src/V1/DeleteManagementServerRequest.php @@ -0,0 +1,155 @@ +google.cloud.backupdr.v1.DeleteManagementServerRequest + */ +class DeleteManagementServerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see BackupDRClient::managementServerName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteManagementServerRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GetManagementServerRequest.php b/BackupDr/src/V1/GetManagementServerRequest.php new file mode 100644 index 000000000000..4787333aa02d --- /dev/null +++ b/BackupDr/src/V1/GetManagementServerRequest.php @@ -0,0 +1,86 @@ +google.cloud.backupdr.v1.GetManagementServerRequest + */ +class GetManagementServerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the management server resource name, in the format + * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the management server resource name, in the format + * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * Please see {@see BackupDRClient::managementServerName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetManagementServerRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the management server resource name, in the format + * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the management server resource name, in the format + * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the management server resource name, in the format + * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListManagementServersRequest.php b/BackupDr/src/V1/ListManagementServersRequest.php new file mode 100644 index 000000000000..37886b801be4 --- /dev/null +++ b/BackupDr/src/V1/ListManagementServersRequest.php @@ -0,0 +1,261 @@ +google.cloud.backupdr.v1.ListManagementServersRequest + */ +class ListManagementServersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve management servers + * information, in the format `projects/{project_id}/locations/{location}`. In + * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. + * To retrieve management servers for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field optional string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = null; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field optional string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = null; + + /** + * @param string $parent Required. The project and location for which to retrieve management servers + * information, in the format `projects/{project_id}/locations/{location}`. In + * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. + * To retrieve management servers for all locations, use "-" for the + * `{location}` value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListManagementServersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve management servers + * information, in the format `projects/{project_id}/locations/{location}`. In + * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. + * To retrieve management servers for all locations, use "-" for the + * `{location}` value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve management servers + * information, in the format `projects/{project_id}/locations/{location}`. In + * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. + * To retrieve management servers for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve management servers + * information, in the format `projects/{project_id}/locations/{location}`. In + * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. + * To retrieve management servers for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field optional string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return isset($this->filter) ? $this->filter : ''; + } + + public function hasFilter() + { + return isset($this->filter); + } + + public function clearFilter() + { + unset($this->filter); + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field optional string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field optional string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return isset($this->order_by) ? $this->order_by : ''; + } + + public function hasOrderBy() + { + return isset($this->order_by); + } + + public function clearOrderBy() + { + unset($this->order_by); + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field optional string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListManagementServersResponse.php b/BackupDr/src/V1/ListManagementServersResponse.php new file mode 100644 index 000000000000..fa2d796a5d0e --- /dev/null +++ b/BackupDr/src/V1/ListManagementServersResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListManagementServersResponse + */ +class ListManagementServersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of ManagementServer instances in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return management servers in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ManagementServer management_servers = 1; + */ + private $management_servers; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\ManagementServer>|\Google\Protobuf\Internal\RepeatedField $management_servers + * The list of ManagementServer instances in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return management servers in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * The list of ManagementServer instances in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return management servers in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ManagementServer management_servers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getManagementServers() + { + return $this->management_servers; + } + + /** + * The list of ManagementServer instances in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return management servers in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ManagementServer management_servers = 1; + * @param array<\Google\Cloud\BackupDR\V1\ManagementServer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setManagementServers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\ManagementServer::class); + $this->management_servers = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ManagementServer.php b/BackupDr/src/V1/ManagementServer.php new file mode 100644 index 000000000000..67a65fc301f5 --- /dev/null +++ b/BackupDr/src/V1/ManagementServer.php @@ -0,0 +1,611 @@ +google.cloud.backupdr.v1.ManagementServer + */ +class ManagementServer extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The description of the ManagementServer instance (2048 characters + * or less). + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Resource labels to represent user provided metadata. + * Labels currently defined: + * 1. migrate_from_go= + * If set to true, the MS is created in migration ready mode. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. The type of the ManagementServer resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceType type = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = 0; + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by clients to connect to AGM/RD graphical user interface and APIs. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementURI management_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $management_uri = null; + /** + * Output only. The hostnames of the exposed AGM endpoints for both types of + * user i.e. 1p and 3p, used to connect AGM/RM UI. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $workforce_identity_based_management_uri = null; + /** + * Output only. The ManagementServer state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. VPC networks to which the ManagementServer instance is connected. + * For this version, only a single network is supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkConfig networks = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + private $networks; + /** + * Optional. Server specified ETag for the ManagementServer resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field string etag = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Output only. The OAuth 2.0 client id is required to make API calls to the + * BackupDR instance API of this ManagementServer. This is the value that + * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * specification + * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + * + * Generated from protobuf field string oauth2_client_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $oauth2_client_id = ''; + /** + * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID workforce_identity_based_oauth2_client_id = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $workforce_identity_based_oauth2_client_id = null; + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by BAs to connect to BA proxy. + * + * Generated from protobuf field repeated string ba_proxy_uri = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $ba_proxy_uri; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name. + * @type string $description + * Optional. The description of the ManagementServer instance (2048 characters + * or less). + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * Labels currently defined: + * 1. migrate_from_go= + * If set to true, the MS is created in migration ready mode. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type int $type + * Optional. The type of the ManagementServer resource. + * @type \Google\Cloud\BackupDR\V1\ManagementURI $management_uri + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by clients to connect to AGM/RD graphical user interface and APIs. + * @type \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI $workforce_identity_based_management_uri + * Output only. The hostnames of the exposed AGM endpoints for both types of + * user i.e. 1p and 3p, used to connect AGM/RM UI. + * @type int $state + * Output only. The ManagementServer state. + * @type array<\Google\Cloud\BackupDR\V1\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $networks + * Required. VPC networks to which the ManagementServer instance is connected. + * For this version, only a single network is supported. + * @type string $etag + * Optional. Server specified ETag for the ManagementServer resource to + * prevent simultaneous updates from overwiting each other. + * @type string $oauth2_client_id + * Output only. The OAuth 2.0 client id is required to make API calls to the + * BackupDR instance API of this ManagementServer. This is the value that + * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * specification + * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + * @type \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID $workforce_identity_based_oauth2_client_id + * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + * @type array|\Google\Protobuf\Internal\RepeatedField $ba_proxy_uri + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by BAs to connect to BA proxy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The description of the ManagementServer instance (2048 characters + * or less). + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the ManagementServer instance (2048 characters + * or less). + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * Labels currently defined: + * 1. migrate_from_go= + * If set to true, the MS is created in migration ready mode. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * Labels currently defined: + * 1. migrate_from_go= + * If set to true, the MS is created in migration ready mode. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. The type of the ManagementServer resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceType type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. The type of the ManagementServer resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceType type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\ManagementServer\InstanceType::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by clients to connect to AGM/RD graphical user interface and APIs. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementURI management_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\ManagementURI|null + */ + public function getManagementUri() + { + return $this->management_uri; + } + + public function hasManagementUri() + { + return isset($this->management_uri); + } + + public function clearManagementUri() + { + unset($this->management_uri); + } + + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by clients to connect to AGM/RD graphical user interface and APIs. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementURI management_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\ManagementURI $var + * @return $this + */ + public function setManagementUri($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ManagementURI::class); + $this->management_uri = $var; + + return $this; + } + + /** + * Output only. The hostnames of the exposed AGM endpoints for both types of + * user i.e. 1p and 3p, used to connect AGM/RM UI. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI|null + */ + public function getWorkforceIdentityBasedManagementUri() + { + return $this->workforce_identity_based_management_uri; + } + + public function hasWorkforceIdentityBasedManagementUri() + { + return isset($this->workforce_identity_based_management_uri); + } + + public function clearWorkforceIdentityBasedManagementUri() + { + unset($this->workforce_identity_based_management_uri); + } + + /** + * Output only. The hostnames of the exposed AGM endpoints for both types of + * user i.e. 1p and 3p, used to connect AGM/RM UI. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI $var + * @return $this + */ + public function setWorkforceIdentityBasedManagementUri($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI::class); + $this->workforce_identity_based_management_uri = $var; + + return $this; + } + + /** + * Output only. The ManagementServer state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The ManagementServer state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\ManagementServer\InstanceState::class); + $this->state = $var; + + return $this; + } + + /** + * Required. VPC networks to which the ManagementServer instance is connected. + * For this version, only a single network is supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkConfig networks = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworks() + { + return $this->networks; + } + + /** + * Required. VPC networks to which the ManagementServer instance is connected. + * For this version, only a single network is supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkConfig networks = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\BackupDR\V1\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\NetworkConfig::class); + $this->networks = $arr; + + return $this; + } + + /** + * Optional. Server specified ETag for the ManagementServer resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field string etag = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. Server specified ETag for the ManagementServer resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field string etag = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. The OAuth 2.0 client id is required to make API calls to the + * BackupDR instance API of this ManagementServer. This is the value that + * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * specification + * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + * + * Generated from protobuf field string oauth2_client_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getOauth2ClientId() + { + return $this->oauth2_client_id; + } + + /** + * Output only. The OAuth 2.0 client id is required to make API calls to the + * BackupDR instance API of this ManagementServer. This is the value that + * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * specification + * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + * + * Generated from protobuf field string oauth2_client_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setOauth2ClientId($var) + { + GPBUtil::checkString($var, True); + $this->oauth2_client_id = $var; + + return $this; + } + + /** + * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID workforce_identity_based_oauth2_client_id = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID|null + */ + public function getWorkforceIdentityBasedOauth2ClientId() + { + return $this->workforce_identity_based_oauth2_client_id; + } + + public function hasWorkforceIdentityBasedOauth2ClientId() + { + return isset($this->workforce_identity_based_oauth2_client_id); + } + + public function clearWorkforceIdentityBasedOauth2ClientId() + { + unset($this->workforce_identity_based_oauth2_client_id); + } + + /** + * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID workforce_identity_based_oauth2_client_id = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID $var + * @return $this + */ + public function setWorkforceIdentityBasedOauth2ClientId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID::class); + $this->workforce_identity_based_oauth2_client_id = $var; + + return $this; + } + + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by BAs to connect to BA proxy. + * + * Generated from protobuf field repeated string ba_proxy_uri = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBaProxyUri() + { + return $this->ba_proxy_uri; + } + + /** + * Output only. The hostname or ip address of the exposed AGM endpoints, used + * by BAs to connect to BA proxy. + * + * Generated from protobuf field repeated string ba_proxy_uri = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBaProxyUri($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ba_proxy_uri = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ManagementServer/InstanceState.php b/BackupDr/src/V1/ManagementServer/InstanceState.php new file mode 100644 index 000000000000..b898cc597a6c --- /dev/null +++ b/BackupDr/src/V1/ManagementServer/InstanceState.php @@ -0,0 +1,100 @@ +google.cloud.backupdr.v1.ManagementServer.InstanceState + */ +class InstanceState +{ + /** + * State not set. + * + * Generated from protobuf enum INSTANCE_STATE_UNSPECIFIED = 0; + */ + const INSTANCE_STATE_UNSPECIFIED = 0; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The instance has been created and is fully usable. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The instance configuration is being updated. Certain kinds of updates + * may cause the instance to become unusable while the update is in + * progress. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * The instance is being repaired and may be unstable. + * + * Generated from protobuf enum REPAIRING = 5; + */ + const REPAIRING = 5; + /** + * Maintenance is being performed on this instance. + * + * Generated from protobuf enum MAINTENANCE = 6; + */ + const MAINTENANCE = 6; + /** + * The instance is experiencing an issue and might be unusable. You can get + * further details from the statusMessage field of Instance resource. + * + * Generated from protobuf enum ERROR = 7; + */ + const ERROR = 7; + + private static $valueToName = [ + self::INSTANCE_STATE_UNSPECIFIED => 'INSTANCE_STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + self::REPAIRING => 'REPAIRING', + self::MAINTENANCE => 'MAINTENANCE', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/BackupDr/src/V1/ManagementServer/InstanceType.php b/BackupDr/src/V1/ManagementServer/InstanceType.php new file mode 100644 index 000000000000..8ab1d2429537 --- /dev/null +++ b/BackupDr/src/V1/ManagementServer/InstanceType.php @@ -0,0 +1,55 @@ +google.cloud.backupdr.v1.ManagementServer.InstanceType + */ +class InstanceType +{ + /** + * Instance type is not mentioned. + * + * Generated from protobuf enum INSTANCE_TYPE_UNSPECIFIED = 0; + */ + const INSTANCE_TYPE_UNSPECIFIED = 0; + /** + * Instance for backup and restore management (i.e., AGM). + * + * Generated from protobuf enum BACKUP_RESTORE = 1; + */ + const BACKUP_RESTORE = 1; + + private static $valueToName = [ + self::INSTANCE_TYPE_UNSPECIFIED => 'INSTANCE_TYPE_UNSPECIFIED', + self::BACKUP_RESTORE => 'BACKUP_RESTORE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/BackupDr/src/V1/ManagementURI.php b/BackupDr/src/V1/ManagementURI.php new file mode 100644 index 000000000000..5f9224ac9402 --- /dev/null +++ b/BackupDr/src/V1/ManagementURI.php @@ -0,0 +1,101 @@ +google.cloud.backupdr.v1.ManagementURI + */ +class ManagementURI extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The ManagementServer AGM/RD WebUI URL. + * + * Generated from protobuf field string web_ui = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $web_ui = ''; + /** + * Output only. The ManagementServer AGM/RD API URL. + * + * Generated from protobuf field string api = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $web_ui + * Output only. The ManagementServer AGM/RD WebUI URL. + * @type string $api + * Output only. The ManagementServer AGM/RD API URL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The ManagementServer AGM/RD WebUI URL. + * + * Generated from protobuf field string web_ui = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getWebUi() + { + return $this->web_ui; + } + + /** + * Output only. The ManagementServer AGM/RD WebUI URL. + * + * Generated from protobuf field string web_ui = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setWebUi($var) + { + GPBUtil::checkString($var, True); + $this->web_ui = $var; + + return $this; + } + + /** + * Output only. The ManagementServer AGM/RD API URL. + * + * Generated from protobuf field string api = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApi() + { + return $this->api; + } + + /** + * Output only. The ManagementServer AGM/RD API URL. + * + * Generated from protobuf field string api = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApi($var) + { + GPBUtil::checkString($var, True); + $this->api = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/NetworkConfig.php b/BackupDr/src/V1/NetworkConfig.php new file mode 100644 index 000000000000..93a42fa20272 --- /dev/null +++ b/BackupDr/src/V1/NetworkConfig.php @@ -0,0 +1,109 @@ +google.cloud.backupdr.v1.NetworkConfig + */ +class NetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The resource name of the Google Compute Engine VPC network to + * which the ManagementServer instance is connected. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network = ''; + /** + * Optional. The network connect mode of the ManagementServer instance. For + * this version, only PRIVATE_SERVICE_ACCESS is supported. + * + * Generated from protobuf field .google.cloud.backupdr.v1.NetworkConfig.PeeringMode peering_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $peering_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Optional. The resource name of the Google Compute Engine VPC network to + * which the ManagementServer instance is connected. + * @type int $peering_mode + * Optional. The network connect mode of the ManagementServer instance. For + * this version, only PRIVATE_SERVICE_ACCESS is supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The resource name of the Google Compute Engine VPC network to + * which the ManagementServer instance is connected. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Optional. The resource name of the Google Compute Engine VPC network to + * which the ManagementServer instance is connected. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. The network connect mode of the ManagementServer instance. For + * this version, only PRIVATE_SERVICE_ACCESS is supported. + * + * Generated from protobuf field .google.cloud.backupdr.v1.NetworkConfig.PeeringMode peering_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPeeringMode() + { + return $this->peering_mode; + } + + /** + * Optional. The network connect mode of the ManagementServer instance. For + * this version, only PRIVATE_SERVICE_ACCESS is supported. + * + * Generated from protobuf field .google.cloud.backupdr.v1.NetworkConfig.PeeringMode peering_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPeeringMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkConfig\PeeringMode::class); + $this->peering_mode = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/NetworkConfig/PeeringMode.php b/BackupDr/src/V1/NetworkConfig/PeeringMode.php new file mode 100644 index 000000000000..1cd2cf87fa9a --- /dev/null +++ b/BackupDr/src/V1/NetworkConfig/PeeringMode.php @@ -0,0 +1,57 @@ +google.cloud.backupdr.v1.NetworkConfig.PeeringMode + */ +class PeeringMode +{ + /** + * Peering mode not set. + * + * Generated from protobuf enum PEERING_MODE_UNSPECIFIED = 0; + */ + const PEERING_MODE_UNSPECIFIED = 0; + /** + * Connect using Private Service Access to the Management Server. Private + * services access provides an IP address range for multiple Google Cloud + * services, including Cloud BackupDR. + * + * Generated from protobuf enum PRIVATE_SERVICE_ACCESS = 1; + */ + const PRIVATE_SERVICE_ACCESS = 1; + + private static $valueToName = [ + self::PEERING_MODE_UNSPECIFIED => 'PEERING_MODE_UNSPECIFIED', + self::PRIVATE_SERVICE_ACCESS => 'PRIVATE_SERVICE_ACCESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/BackupDr/src/V1/OperationMetadata.php b/BackupDr/src/V1/OperationMetadata.php new file mode 100644 index 000000000000..822d7b9a09a9 --- /dev/null +++ b/BackupDr/src/V1/OperationMetadata.php @@ -0,0 +1,345 @@ +google.cloud.backupdr.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + /** + * Output only. AdditionalInfo contains additional Info related to backup plan + * association resource. + * + * Generated from protobuf field map additional_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $additional_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * @type array|\Google\Protobuf\Internal\MapField $additional_info + * Output only. AdditionalInfo contains additional Info related to backup plan + * association resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + + /** + * Output only. AdditionalInfo contains additional Info related to backup plan + * association resource. + * + * Generated from protobuf field map additional_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAdditionalInfo() + { + return $this->additional_info; + } + + /** + * Output only. AdditionalInfo contains additional Info related to backup plan + * association resource. + * + * Generated from protobuf field map additional_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAdditionalInfo($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_info = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/WorkforceIdentityBasedManagementURI.php b/BackupDr/src/V1/WorkforceIdentityBasedManagementURI.php new file mode 100644 index 000000000000..d12b8eb71a64 --- /dev/null +++ b/BackupDr/src/V1/WorkforceIdentityBasedManagementURI.php @@ -0,0 +1,101 @@ +google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + */ +class WorkforceIdentityBasedManagementURI extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. First party Management URI for Google Identities. + * + * Generated from protobuf field string first_party_management_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $first_party_management_uri = ''; + /** + * Output only. Third party Management URI for External Identity Providers. + * + * Generated from protobuf field string third_party_management_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $third_party_management_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $first_party_management_uri + * Output only. First party Management URI for Google Identities. + * @type string $third_party_management_uri + * Output only. Third party Management URI for External Identity Providers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. First party Management URI for Google Identities. + * + * Generated from protobuf field string first_party_management_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getFirstPartyManagementUri() + { + return $this->first_party_management_uri; + } + + /** + * Output only. First party Management URI for Google Identities. + * + * Generated from protobuf field string first_party_management_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setFirstPartyManagementUri($var) + { + GPBUtil::checkString($var, True); + $this->first_party_management_uri = $var; + + return $this; + } + + /** + * Output only. Third party Management URI for External Identity Providers. + * + * Generated from protobuf field string third_party_management_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getThirdPartyManagementUri() + { + return $this->third_party_management_uri; + } + + /** + * Output only. Third party Management URI for External Identity Providers. + * + * Generated from protobuf field string third_party_management_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setThirdPartyManagementUri($var) + { + GPBUtil::checkString($var, True); + $this->third_party_management_uri = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/WorkforceIdentityBasedOAuth2ClientID.php b/BackupDr/src/V1/WorkforceIdentityBasedOAuth2ClientID.php new file mode 100644 index 000000000000..dd38518e5411 --- /dev/null +++ b/BackupDr/src/V1/WorkforceIdentityBasedOAuth2ClientID.php @@ -0,0 +1,101 @@ +google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + */ +class WorkforceIdentityBasedOAuth2ClientID extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. First party OAuth Client ID for Google Identities. + * + * Generated from protobuf field string first_party_oauth2_client_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $first_party_oauth2_client_id = ''; + /** + * Output only. Third party OAuth Client ID for External Identity Providers. + * + * Generated from protobuf field string third_party_oauth2_client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $third_party_oauth2_client_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $first_party_oauth2_client_id + * Output only. First party OAuth Client ID for Google Identities. + * @type string $third_party_oauth2_client_id + * Output only. Third party OAuth Client ID for External Identity Providers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); + parent::__construct($data); + } + + /** + * Output only. First party OAuth Client ID for Google Identities. + * + * Generated from protobuf field string first_party_oauth2_client_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getFirstPartyOauth2ClientId() + { + return $this->first_party_oauth2_client_id; + } + + /** + * Output only. First party OAuth Client ID for Google Identities. + * + * Generated from protobuf field string first_party_oauth2_client_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setFirstPartyOauth2ClientId($var) + { + GPBUtil::checkString($var, True); + $this->first_party_oauth2_client_id = $var; + + return $this; + } + + /** + * Output only. Third party OAuth Client ID for External Identity Providers. + * + * Generated from protobuf field string third_party_oauth2_client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getThirdPartyOauth2ClientId() + { + return $this->third_party_oauth2_client_id; + } + + /** + * Output only. Third party OAuth Client ID for External Identity Providers. + * + * Generated from protobuf field string third_party_oauth2_client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setThirdPartyOauth2ClientId($var) + { + GPBUtil::checkString($var, True); + $this->third_party_oauth2_client_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/gapic_metadata.json b/BackupDr/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..37b3567fa87d --- /dev/null +++ b/BackupDr/src/V1/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.backupdr.v1", + "libraryPackage": "Google\\Cloud\\BackupDR\\V1", + "services": { + "BackupDR": { + "clients": { + "grpc": { + "libraryClient": "BackupDRGapicClient", + "rpcs": { + "CreateManagementServer": { + "methods": [ + "createManagementServer" + ] + }, + "DeleteManagementServer": { + "methods": [ + "deleteManagementServer" + ] + }, + "GetManagementServer": { + "methods": [ + "getManagementServer" + ] + }, + "ListManagementServers": { + "methods": [ + "listManagementServers" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/BackupDr/src/V1/resources/backup_dr_client_config.json b/BackupDr/src/V1/resources/backup_dr_client_config.json new file mode 100644 index 000000000000..5c162679d6d7 --- /dev/null +++ b/BackupDr/src/V1/resources/backup_dr_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.backupdr.v1.BackupDR": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateManagementServer": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteManagementServer": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetManagementServer": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListManagementServers": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/BackupDr/src/V1/resources/backup_dr_descriptor_config.php b/BackupDr/src/V1/resources/backup_dr_descriptor_config.php new file mode 100644 index 000000000000..44417b94b54a --- /dev/null +++ b/BackupDr/src/V1/resources/backup_dr_descriptor_config.php @@ -0,0 +1,175 @@ + [ + 'google.cloud.backupdr.v1.BackupDR' => [ + 'CreateManagementServer' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\ManagementServer', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteManagementServer' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetManagementServer' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ManagementServer', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListManagementServers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getManagementServers', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListManagementServersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'location' => 'projects/{project}/locations/{location}', + 'managementServer' => 'projects/{project}/locations/{location}/managementServers/{managementserver}', + ], + ], + ], +]; diff --git a/BackupDr/src/V1/resources/backup_dr_rest_client_config.php b/BackupDr/src/V1/resources/backup_dr_rest_client_config.php new file mode 100644 index 000000000000..d222523ff2d5 --- /dev/null +++ b/BackupDr/src/V1/resources/backup_dr_rest_client_config.php @@ -0,0 +1,192 @@ + [ + 'google.cloud.backupdr.v1.BackupDR' => [ + 'CreateManagementServer' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', + 'body' => 'management_server', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'management_server_id', + ], + ], + 'DeleteManagementServer' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetManagementServer' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListManagementServers' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/managementServers/*}:getIamPolicy', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/managementServers/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/managementServers/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/backupVaults/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php b/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php new file mode 100644 index 000000000000..f54477fdb478 --- /dev/null +++ b/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php @@ -0,0 +1,909 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return BackupDRClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BackupDRClient($options); + } + + /** @test */ + public function createManagementServerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $oauth2ClientId = 'oauth2ClientId-1833466037'; + $expectedResponse = new ManagementServer(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setOauth2ClientId($oauth2ClientId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createManagementServerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = 'managementServerId1884787355'; + $managementServer = new ManagementServer(); + $managementServerNetworks = []; + $managementServer->setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + $response = $gapicClient->createManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServerId(); + $this->assertProtobufEquals($managementServerId, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServer(); + $this->assertProtobufEquals($managementServer, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createManagementServerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = 'managementServerId1884787355'; + $managementServer = new ManagementServer(); + $managementServerNetworks = []; + $managementServer->setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + $response = $gapicClient->createManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteManagementServerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteManagementServerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new DeleteManagementServerRequest())->setName($formattedName); + $response = $gapicClient->deleteManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteManagementServer', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteManagementServerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new DeleteManagementServerRequest())->setName($formattedName); + $response = $gapicClient->deleteManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getManagementServerTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $oauth2ClientId = 'oauth2ClientId-1833466037'; + $expectedResponse = new ManagementServer(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setOauth2ClientId($oauth2ClientId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new GetManagementServerRequest())->setName($formattedName); + $response = $gapicClient->getManagementServer($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetManagementServer', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getManagementServerExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new GetManagementServerRequest())->setName($formattedName); + try { + $gapicClient->getManagementServer($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagementServersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $managementServersElement = new ManagementServer(); + $managementServers = [$managementServersElement]; + $expectedResponse = new ListManagementServersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setManagementServers($managementServers); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListManagementServersRequest())->setParent($formattedParent); + $response = $gapicClient->listManagementServers($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getManagementServers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListManagementServers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagementServersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListManagementServersRequest())->setParent($formattedParent); + try { + $gapicClient->listManagementServers($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [$locationsElement]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest())->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest())->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createManagementServerAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $oauth2ClientId = 'oauth2ClientId-1833466037'; + $expectedResponse = new ManagementServer(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setOauth2ClientId($oauth2ClientId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createManagementServerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = 'managementServerId1884787355'; + $managementServer = new ManagementServer(); + $managementServerNetworks = []; + $managementServer->setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + $response = $gapicClient->createManagementServerAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServerId(); + $this->assertProtobufEquals($managementServerId, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServer(); + $this->assertProtobufEquals($managementServer, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/BareMetalSolution/.repo-metadata.json b/BareMetalSolution/.repo-metadata.json deleted file mode 100644 index 5969abbba09e..000000000000 --- a/BareMetalSolution/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bare-metal-solution", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bare-metal-solution/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "baremetalsolution" -} diff --git a/BareMetalSolution/VERSION b/BareMetalSolution/VERSION index 844f6a91acb9..ef5e4454454d 100644 --- a/BareMetalSolution/VERSION +++ b/BareMetalSolution/VERSION @@ -1 +1 @@ -0.6.3 +0.6.5 diff --git a/BareMetalSolution/composer.json b/BareMetalSolution/composer.json index 0448d6c97220..dc04de135555 100644 --- a/BareMetalSolution/composer.json +++ b/BareMetalSolution/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Batch/.repo-metadata.json b/Batch/.repo-metadata.json deleted file mode 100644 index 8ceaba7a1573..000000000000 --- a/Batch/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-batch", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-batch/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/batch/docs", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "batch" -} diff --git a/Batch/VERSION b/Batch/VERSION index c3f65805f7b7..084c7bd08068 100644 --- a/Batch/VERSION +++ b/Batch/VERSION @@ -1 +1 @@ -0.16.6 +0.16.10 diff --git a/Batch/composer.json b/Batch/composer.json index 39d3dc30819e..34d409ff9215 100644 --- a/Batch/composer.json +++ b/Batch/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Batch/src/V1/AllocationPolicy/InstancePolicyOrTemplate.php b/Batch/src/V1/AllocationPolicy/InstancePolicyOrTemplate.php index aa1f184f181a..fc82cb166869 100644 --- a/Batch/src/V1/AllocationPolicy/InstancePolicyOrTemplate.php +++ b/Batch/src/V1/AllocationPolicy/InstancePolicyOrTemplate.php @@ -19,9 +19,9 @@ class InstancePolicyOrTemplate extends \Google\Protobuf\Internal\Message { /** - * Set this field true if users want Batch to help fetch drivers from a - * third party location and install them for GPUs specified in - * policy.accelerators or instance_template on their behalf. Default is + * Set this field true if you want Batch to help fetch drivers from a third + * party location and install them for GPUs specified in + * `policy.accelerators` or `instance_template` on your behalf. Default is * false. * For Container-Optimized Image cases, Batch will install the * accelerator driver following milestones of @@ -47,9 +47,9 @@ class InstancePolicyOrTemplate extends \Google\Protobuf\Internal\Message * Named the field as 'instance_template' instead of 'template' to avoid * c++ keyword conflict. * @type bool $install_gpu_drivers - * Set this field true if users want Batch to help fetch drivers from a - * third party location and install them for GPUs specified in - * policy.accelerators or instance_template on their behalf. Default is + * Set this field true if you want Batch to help fetch drivers from a third + * party location and install them for GPUs specified in + * `policy.accelerators` or `instance_template` on your behalf. Default is * false. * For Container-Optimized Image cases, Batch will install the * accelerator driver following milestones of @@ -130,9 +130,9 @@ public function setInstanceTemplate($var) } /** - * Set this field true if users want Batch to help fetch drivers from a - * third party location and install them for GPUs specified in - * policy.accelerators or instance_template on their behalf. Default is + * Set this field true if you want Batch to help fetch drivers from a third + * party location and install them for GPUs specified in + * `policy.accelerators` or `instance_template` on your behalf. Default is * false. * For Container-Optimized Image cases, Batch will install the * accelerator driver following milestones of @@ -149,9 +149,9 @@ public function getInstallGpuDrivers() } /** - * Set this field true if users want Batch to help fetch drivers from a - * third party location and install them for GPUs specified in - * policy.accelerators or instance_template on their behalf. Default is + * Set this field true if you want Batch to help fetch drivers from a third + * party location and install them for GPUs specified in + * `policy.accelerators` or `instance_template` on your behalf. Default is * false. * For Container-Optimized Image cases, Batch will install the * accelerator driver following milestones of diff --git a/Batch/src/V1/TaskExecution.php b/Batch/src/V1/TaskExecution.php index 4aded69c1ddf..abcaa1763b35 100644 --- a/Batch/src/V1/TaskExecution.php +++ b/Batch/src/V1/TaskExecution.php @@ -17,8 +17,15 @@ class TaskExecution extends \Google\Protobuf\Internal\Message { /** - * When task is completed as the status of FAILED or SUCCEEDED, - * exit code is for one task execution result, default is 0 as success. + * The exit code of a finished task. + * If the task succeeded, the exit code will be 0. If the task failed but not + * due to the following reasons, the exit code will be 50000. + * Otherwise, it can be from different sources: + * * Batch known failures: + * https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + * * Batch runnable execution failures; you can rely on Batch logs to further + * diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + * there are multiple runnables failures, Batch only exposes the first error. * * Generated from protobuf field int32 exit_code = 1; */ @@ -31,8 +38,15 @@ class TaskExecution extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $exit_code - * When task is completed as the status of FAILED or SUCCEEDED, - * exit code is for one task execution result, default is 0 as success. + * The exit code of a finished task. + * If the task succeeded, the exit code will be 0. If the task failed but not + * due to the following reasons, the exit code will be 50000. + * Otherwise, it can be from different sources: + * * Batch known failures: + * https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + * * Batch runnable execution failures; you can rely on Batch logs to further + * diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + * there are multiple runnables failures, Batch only exposes the first error. * } */ public function __construct($data = NULL) { @@ -41,8 +55,15 @@ public function __construct($data = NULL) { } /** - * When task is completed as the status of FAILED or SUCCEEDED, - * exit code is for one task execution result, default is 0 as success. + * The exit code of a finished task. + * If the task succeeded, the exit code will be 0. If the task failed but not + * due to the following reasons, the exit code will be 50000. + * Otherwise, it can be from different sources: + * * Batch known failures: + * https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + * * Batch runnable execution failures; you can rely on Batch logs to further + * diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + * there are multiple runnables failures, Batch only exposes the first error. * * Generated from protobuf field int32 exit_code = 1; * @return int @@ -53,8 +74,15 @@ public function getExitCode() } /** - * When task is completed as the status of FAILED or SUCCEEDED, - * exit code is for one task execution result, default is 0 as success. + * The exit code of a finished task. + * If the task succeeded, the exit code will be 0. If the task failed but not + * due to the following reasons, the exit code will be 50000. + * Otherwise, it can be from different sources: + * * Batch known failures: + * https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + * * Batch runnable execution failures; you can rely on Batch logs to further + * diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + * there are multiple runnables failures, Batch only exposes the first error. * * Generated from protobuf field int32 exit_code = 1; * @param int $var diff --git a/Batch/src/V1/TaskSpec.php b/Batch/src/V1/TaskSpec.php index 0b87d0fed3cf..f24448c76bb7 100644 --- a/Batch/src/V1/TaskSpec.php +++ b/Batch/src/V1/TaskSpec.php @@ -36,10 +36,15 @@ class TaskSpec extends \Google\Protobuf\Internal\Message */ private $compute_resource = null; /** - * Maximum duration the task should run. - * The task will be killed and marked as FAILED if over this limit. - * The valid value range for max_run_duration in seconds is [0, - * 315576000000.999999999], + * Maximum duration the task should run before being automatically retried + * (if enabled) or automatically failed. Format the value of this field + * as a time limit in seconds followed by `s`—for example, `3600s` + * for 1 hour. The field accepts any value between 0 and the maximum listed + * for the `Duration` field type at + * https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + * the actual maximum run time for a job will be limited to the maximum run + * time for a job listed at + * https://cloud.google.com/batch/quotas#max-job-duration. * * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; */ @@ -104,10 +109,15 @@ class TaskSpec extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Batch\V1\ComputeResource $compute_resource * ComputeResource requirements. * @type \Google\Protobuf\Duration $max_run_duration - * Maximum duration the task should run. - * The task will be killed and marked as FAILED if over this limit. - * The valid value range for max_run_duration in seconds is [0, - * 315576000000.999999999], + * Maximum duration the task should run before being automatically retried + * (if enabled) or automatically failed. Format the value of this field + * as a time limit in seconds followed by `s`—for example, `3600s` + * for 1 hour. The field accepts any value between 0 and the maximum listed + * for the `Duration` field type at + * https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + * the actual maximum run time for a job will be limited to the maximum run + * time for a job listed at + * https://cloud.google.com/batch/quotas#max-job-duration. * @type int $max_retry_count * Maximum number of retries on failures. * The default, 0, which means never retry. @@ -213,10 +223,15 @@ public function setComputeResource($var) } /** - * Maximum duration the task should run. - * The task will be killed and marked as FAILED if over this limit. - * The valid value range for max_run_duration in seconds is [0, - * 315576000000.999999999], + * Maximum duration the task should run before being automatically retried + * (if enabled) or automatically failed. Format the value of this field + * as a time limit in seconds followed by `s`—for example, `3600s` + * for 1 hour. The field accepts any value between 0 and the maximum listed + * for the `Duration` field type at + * https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + * the actual maximum run time for a job will be limited to the maximum run + * time for a job listed at + * https://cloud.google.com/batch/quotas#max-job-duration. * * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; * @return \Google\Protobuf\Duration|null @@ -237,10 +252,15 @@ public function clearMaxRunDuration() } /** - * Maximum duration the task should run. - * The task will be killed and marked as FAILED if over this limit. - * The valid value range for max_run_duration in seconds is [0, - * 315576000000.999999999], + * Maximum duration the task should run before being automatically retried + * (if enabled) or automatically failed. Format the value of this field + * as a time limit in seconds followed by `s`—for example, `3600s` + * for 1 hour. The field accepts any value between 0 and the maximum listed + * for the `Duration` field type at + * https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + * the actual maximum run time for a job will be limited to the maximum run + * time for a job listed at + * https://cloud.google.com/batch/quotas#max-job-duration. * * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; * @param \Google\Protobuf\Duration $var diff --git a/BeyondCorpAppConnections/.repo-metadata.json b/BeyondCorpAppConnections/.repo-metadata.json deleted file mode 100644 index b56df074cbf0..000000000000 --- a/BeyondCorpAppConnections/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-beyondcorp-appconnections", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-appconnections/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/beyondcorp-enterprise/docs", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "beyondcorp" -} diff --git a/BeyondCorpAppConnections/VERSION b/BeyondCorpAppConnections/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/BeyondCorpAppConnections/VERSION +++ b/BeyondCorpAppConnections/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/BeyondCorpAppConnections/composer.json b/BeyondCorpAppConnections/composer.json index 31c9b2eead76..5444168473bb 100644 --- a/BeyondCorpAppConnections/composer.json +++ b/BeyondCorpAppConnections/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BeyondCorpAppConnectors/.repo-metadata.json b/BeyondCorpAppConnectors/.repo-metadata.json deleted file mode 100644 index 8f18af52379e..000000000000 --- a/BeyondCorpAppConnectors/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-beyondcorp-appconnectors", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-appconnectors/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "beyondcorp" -} diff --git a/BeyondCorpAppConnectors/VERSION b/BeyondCorpAppConnectors/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/BeyondCorpAppConnectors/VERSION +++ b/BeyondCorpAppConnectors/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/BeyondCorpAppConnectors/composer.json b/BeyondCorpAppConnectors/composer.json index 5af371e61057..9531e665af3c 100644 --- a/BeyondCorpAppConnectors/composer.json +++ b/BeyondCorpAppConnectors/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BeyondCorpAppGateways/.repo-metadata.json b/BeyondCorpAppGateways/.repo-metadata.json deleted file mode 100644 index d42a95905e2e..000000000000 --- a/BeyondCorpAppGateways/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-beyondcorp-appgateways", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-appgateways/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "beyondcorp" -} diff --git a/BeyondCorpAppGateways/VERSION b/BeyondCorpAppGateways/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/BeyondCorpAppGateways/VERSION +++ b/BeyondCorpAppGateways/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/BeyondCorpAppGateways/composer.json b/BeyondCorpAppGateways/composer.json index d0132c85b41d..549a33960821 100644 --- a/BeyondCorpAppGateways/composer.json +++ b/BeyondCorpAppGateways/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BeyondCorpClientConnectorServices/.repo-metadata.json b/BeyondCorpClientConnectorServices/.repo-metadata.json deleted file mode 100644 index 8f847ebc36a3..000000000000 --- a/BeyondCorpClientConnectorServices/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-beyondcorp-clientconnectorservices", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-clientconnectorservices/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "beyondcorp" -} diff --git a/BeyondCorpClientConnectorServices/VERSION b/BeyondCorpClientConnectorServices/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/BeyondCorpClientConnectorServices/VERSION +++ b/BeyondCorpClientConnectorServices/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/BeyondCorpClientConnectorServices/composer.json b/BeyondCorpClientConnectorServices/composer.json index 2d37ad0a0090..dbd1b5f5f65e 100644 --- a/BeyondCorpClientConnectorServices/composer.json +++ b/BeyondCorpClientConnectorServices/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BeyondCorpClientGateways/.repo-metadata.json b/BeyondCorpClientGateways/.repo-metadata.json deleted file mode 100644 index 50dca3b8a078..000000000000 --- a/BeyondCorpClientGateways/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-beyondcorp-clientgateways", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-beyondcorp-clientgateways/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "beyondcorp" -} diff --git a/BeyondCorpClientGateways/VERSION b/BeyondCorpClientGateways/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/BeyondCorpClientGateways/VERSION +++ b/BeyondCorpClientGateways/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/BeyondCorpClientGateways/composer.json b/BeyondCorpClientGateways/composer.json index 8ef182a14fbe..8b23664ee2ef 100644 --- a/BeyondCorpClientGateways/composer.json +++ b/BeyondCorpClientGateways/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BigQuery/.repo-metadata.json b/BigQuery/.repo-metadata.json deleted file mode 100644 index 3e867e8caf82..000000000000 --- a/BigQuery/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigquery", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery/latest", - "library_type": "GAPIC_MANUAL", - "api_shortname": "bigquery" -} diff --git a/BigQuery/VERSION b/BigQuery/VERSION index 7f3c3affd72c..b0f33908df16 100644 --- a/BigQuery/VERSION +++ b/BigQuery/VERSION @@ -1 +1 @@ -1.30.1 +1.30.3 diff --git a/BigQuery/src/BigQueryClient.php b/BigQuery/src/BigQueryClient.php index db8e78c2d633..2dc3e38a0067 100644 --- a/BigQuery/src/BigQueryClient.php +++ b/BigQuery/src/BigQueryClient.php @@ -50,7 +50,7 @@ class BigQueryClient ClientTrait::jsonDecode insteadof RetryDeciderTrait; } - const VERSION = '1.30.1'; + const VERSION = '1.30.3'; const MAX_DELAY_MICROSECONDS = 32000000; diff --git a/BigQuery/src/JobWaitTrait.php b/BigQuery/src/JobWaitTrait.php index fb74af442eca..e4339f7ba524 100644 --- a/BigQuery/src/JobWaitTrait.php +++ b/BigQuery/src/JobWaitTrait.php @@ -19,7 +19,9 @@ use Google\Cloud\BigQuery\Exception\JobException; use Google\Cloud\BigQuery\Job; +use Google\Cloud\Core\Exception\ServiceException; use Google\Cloud\Core\ExponentialBackoff; +use Throwable; /** * A utility trait which utilizes exponential backoff to wait until an operation @@ -55,7 +57,12 @@ private function wait( } }; - (new ExponentialBackoff($maxRetries)) + (new ExponentialBackoff($maxRetries, function (Throwable $e) { + if ($e instanceof ServiceException) { + return $e->getCode() !== 499; + } + return true; + })) ->execute($retryFn); } } diff --git a/BigQuery/tests/Unit/JobWaitTraitTest.php b/BigQuery/tests/Unit/JobWaitTraitTest.php index fd65c31e454e..9c63bc43398b 100644 --- a/BigQuery/tests/Unit/JobWaitTraitTest.php +++ b/BigQuery/tests/Unit/JobWaitTraitTest.php @@ -20,6 +20,7 @@ use Google\Cloud\BigQuery\Exception\JobException; use Google\Cloud\BigQuery\Job; use Google\Cloud\BigQuery\JobWaitTrait; +use Google\Cloud\Core\Exception\ServiceException; use Google\Cloud\Core\Testing\TestHelpers; use PHPUnit\Framework\TestCase; use Prophecy\PhpUnit\ProphecyTrait; @@ -100,4 +101,25 @@ function () { 1 ]); } + + + public function testWaitThrowsExceptionWhenJobWasCanceled() + { + $this->expectException(ServiceException::class); + $this->expectExceptionMessage('Job execution was cancelled: Job timed out after 10 sec'); + + $this->trait->call('wait', [ + function () { + return false; + }, + function () { + throw new ServiceException( + 'Job execution was cancelled: Job timed out after 10 sec', + 499 + ); + }, + $this->job, + null + ]); + } } diff --git a/BigQueryAnalyticsHub/.repo-metadata.json b/BigQueryAnalyticsHub/.repo-metadata.json deleted file mode 100644 index a19c6995efc8..000000000000 --- a/BigQueryAnalyticsHub/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigquery-analyticshub", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/analytics-hub", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "analyticshub" -} diff --git a/BigQueryAnalyticsHub/VERSION b/BigQueryAnalyticsHub/VERSION index 4b9fcbec101a..be14282b7fff 100644 --- a/BigQueryAnalyticsHub/VERSION +++ b/BigQueryAnalyticsHub/VERSION @@ -1 +1 @@ -0.5.1 +0.5.3 diff --git a/BigQueryAnalyticsHub/composer.json b/BigQueryAnalyticsHub/composer.json index ed8332affab0..96c1460b5fb5 100644 --- a/BigQueryAnalyticsHub/composer.json +++ b/BigQueryAnalyticsHub/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BigQueryConnection/.repo-metadata.json b/BigQueryConnection/.repo-metadata.json deleted file mode 100644 index 6f27fdd8d0c0..000000000000 --- a/BigQueryConnection/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigquery-connection", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-connection/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "bigqueryconnection" -} diff --git a/BigQueryConnection/VERSION b/BigQueryConnection/VERSION index 8af85beb5159..9075be495155 100644 --- a/BigQueryConnection/VERSION +++ b/BigQueryConnection/VERSION @@ -1 +1 @@ -1.5.3 +1.5.5 diff --git a/BigQueryConnection/composer.json b/BigQueryConnection/composer.json index f87604a75b01..13ea13c525b8 100644 --- a/BigQueryConnection/composer.json +++ b/BigQueryConnection/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BigQueryDataExchange/.repo-metadata.json b/BigQueryDataExchange/.repo-metadata.json deleted file mode 100644 index 21f4b2ce89e7..000000000000 --- a/BigQueryDataExchange/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigquery-data-exchange", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-data-exchange/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "analyticshub" -} diff --git a/BigQueryDataExchange/VERSION b/BigQueryDataExchange/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/BigQueryDataExchange/VERSION +++ b/BigQueryDataExchange/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/BigQueryDataExchange/composer.json b/BigQueryDataExchange/composer.json index a35b51bb7479..8693de2288c9 100644 --- a/BigQueryDataExchange/composer.json +++ b/BigQueryDataExchange/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BigQueryDataPolicies/.repo-metadata.json b/BigQueryDataPolicies/.repo-metadata.json deleted file mode 100644 index 10f0d1a7739e..000000000000 --- a/BigQueryDataPolicies/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigquery-datapolicies", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-datapolicies/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/bigquery/docs/reference/bigquerydatapolicy/rest", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "bigquerydatapolicy" -} diff --git a/BigQueryDataPolicies/VERSION b/BigQueryDataPolicies/VERSION index be14282b7fff..d1d899fa33a0 100644 --- a/BigQueryDataPolicies/VERSION +++ b/BigQueryDataPolicies/VERSION @@ -1 +1 @@ -0.5.3 +0.5.5 diff --git a/BigQueryDataPolicies/composer.json b/BigQueryDataPolicies/composer.json index fb7cbbdae4b4..986f35ced4f5 100644 --- a/BigQueryDataPolicies/composer.json +++ b/BigQueryDataPolicies/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BigQueryDataTransfer/.repo-metadata.json b/BigQueryDataTransfer/.repo-metadata.json deleted file mode 100644 index 1ed1302ffcd8..000000000000 --- a/BigQueryDataTransfer/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigquerydatatransfer", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquerydatatransfer/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "bigquerydatatransfer" -} diff --git a/BigQueryDataTransfer/VERSION b/BigQueryDataTransfer/VERSION index a7ee35a3ea70..8decb929b986 100644 --- a/BigQueryDataTransfer/VERSION +++ b/BigQueryDataTransfer/VERSION @@ -1 +1 @@ -1.8.3 +1.8.5 diff --git a/BigQueryDataTransfer/composer.json b/BigQueryDataTransfer/composer.json index 756f94f2ac62..e8c2d791df35 100644 --- a/BigQueryDataTransfer/composer.json +++ b/BigQueryDataTransfer/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/BigQueryDataTransfer/src/V1/CreateTransferConfigRequest.php b/BigQueryDataTransfer/src/V1/CreateTransferConfigRequest.php index 34d5d93a8562..5533fd32b596 100644 --- a/BigQueryDataTransfer/src/V1/CreateTransferConfigRequest.php +++ b/BigQueryDataTransfer/src/V1/CreateTransferConfigRequest.php @@ -42,7 +42,7 @@ class CreateTransferConfigRequest extends \Google\Protobuf\Internal\Message * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -60,7 +60,7 @@ class CreateTransferConfigRequest extends \Google\Protobuf\Internal\Message * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -126,7 +126,7 @@ public static function build(string $parent, \Google\Cloud\BigQuery\DataTransfer * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     *           https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      *           
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -140,7 +140,7 @@ public static function build(string $parent, \Google\Cloud\BigQuery\DataTransfer * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     *           https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      *           
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -240,7 +240,7 @@ public function setTransferConfig($var) * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -263,7 +263,7 @@ public function getAuthorizationCode() * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -290,7 +290,7 @@ public function setAuthorizationCode($var) * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -313,7 +313,7 @@ public function getVersionInfo() * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. diff --git a/BigQueryDataTransfer/src/V1/Gapic/DataTransferServiceGapicClient.php b/BigQueryDataTransfer/src/V1/Gapic/DataTransferServiceGapicClient.php index 15469ac5d2db..1bb3d675bcc4 100644 --- a/BigQueryDataTransfer/src/V1/Gapic/DataTransferServiceGapicClient.php +++ b/BigQueryDataTransfer/src/V1/Gapic/DataTransferServiceGapicClient.php @@ -663,7 +663,7 @@ public function checkValidCreds($name, array $optionalArgs = []) * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     *           https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      *           
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -678,7 +678,7 @@ public function checkValidCreds($name, array $optionalArgs = []) * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     *           https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      *           
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -1499,7 +1499,7 @@ public function unenrollDataSources(array $optionalArgs = []) * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     *           https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      *           
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -1514,7 +1514,7 @@ public function unenrollDataSources(array $optionalArgs = []) * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     *           https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      *           
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. diff --git a/BigQueryDataTransfer/src/V1/UpdateTransferConfigRequest.php b/BigQueryDataTransfer/src/V1/UpdateTransferConfigRequest.php index b5c85fd528e5..2f6da0a2eea7 100644 --- a/BigQueryDataTransfer/src/V1/UpdateTransferConfigRequest.php +++ b/BigQueryDataTransfer/src/V1/UpdateTransferConfigRequest.php @@ -28,7 +28,7 @@ class UpdateTransferConfigRequest extends \Google\Protobuf\Internal\Message * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -52,7 +52,7 @@ class UpdateTransferConfigRequest extends \Google\Protobuf\Internal\Message * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -107,7 +107,7 @@ public static function build(\Google\Cloud\BigQuery\DataTransfer\V1\TransferConf * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     *           https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      *           
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -123,7 +123,7 @@ public static function build(\Google\Cloud\BigQuery\DataTransfer\V1\TransferConf * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     *           https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     *           https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      *           
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -189,7 +189,7 @@ public function setTransferConfig($var) * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -212,7 +212,7 @@ public function getAuthorizationCode() * and new credentials are needed, as indicated by `CheckValidCreds`. In order * to obtain authorization_code, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -275,7 +275,7 @@ public function setUpdateMask($var) * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. @@ -298,7 +298,7 @@ public function getVersionInfo() * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
-     * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+     * https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
      * 
* * The client_id is the OAuth client_id of the a data source as * returned by ListDataSources method. diff --git a/BigQueryMigration/.repo-metadata.json b/BigQueryMigration/.repo-metadata.json deleted file mode 100644 index cbd910ef0186..000000000000 --- a/BigQueryMigration/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigquery-migration", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/bigquery/docs/migration-intro/docs", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "bigquerymigration" -} diff --git a/BigQueryMigration/VERSION b/BigQueryMigration/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/BigQueryMigration/VERSION +++ b/BigQueryMigration/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/BigQueryMigration/composer.json b/BigQueryMigration/composer.json index 6e8fdde72b14..578e0bd69b78 100644 --- a/BigQueryMigration/composer.json +++ b/BigQueryMigration/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BigQueryReservation/.repo-metadata.json b/BigQueryReservation/.repo-metadata.json deleted file mode 100644 index 7a879cbc2f9c..000000000000 --- a/BigQueryReservation/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigquery-reservation", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "bigqueryreservation" -} diff --git a/BigQueryReservation/VERSION b/BigQueryReservation/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/BigQueryReservation/VERSION +++ b/BigQueryReservation/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/BigQueryReservation/composer.json b/BigQueryReservation/composer.json index 6786c9177d03..d8f4fac061a3 100644 --- a/BigQueryReservation/composer.json +++ b/BigQueryReservation/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/BigQueryStorage/.repo-metadata.json b/BigQueryStorage/.repo-metadata.json deleted file mode 100644 index 5f9a58801700..000000000000 --- a/BigQueryStorage/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigquery-storage", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigquery-storage/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "bigquerystorage" -} diff --git a/BigQueryStorage/VERSION b/BigQueryStorage/VERSION index 5ad2491cf880..18b311420650 100644 --- a/BigQueryStorage/VERSION +++ b/BigQueryStorage/VERSION @@ -1 +1 @@ -1.10.2 +1.10.4 diff --git a/BigQueryStorage/composer.json b/BigQueryStorage/composer.json index c3bf4588cf5a..2fab8b412da0 100644 --- a/BigQueryStorage/composer.json +++ b/BigQueryStorage/composer.json @@ -27,7 +27,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Bigtable/.repo-metadata.json b/Bigtable/.repo-metadata.json deleted file mode 100644 index 53522cc32b89..000000000000 --- a/Bigtable/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-bigtable", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-bigtable/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "bigtable" -} diff --git a/Bigtable/MIGRATING.md b/Bigtable/MIGRATING.md new file mode 100644 index 000000000000..8f9365755429 --- /dev/null +++ b/Bigtable/MIGRATING.md @@ -0,0 +1,91 @@ +# Migrating Google Cloud Bigtable from V1 to V2 + +## How to upgrade + +Update your `google/cloud-bigtable` dependency to `^2.0`: + +``` +{ + "require": { + "google/cloud-bigtable": "^2.0" + } +} +``` + +## Changes + +### Retry Options changes + +The `retries` parameter in the following RPC calls is changed to `retrySettings.maxRetries`: +- Google\Cloud\Bigtable\Table::mutateRows +- Google\Cloud\Bigtable\Table::upsert +- Google\Cloud\Bigtable\Table::readRows + +For example: +```php +$table->readRows([ + 'retrySettings' => [ + 'maxRetries' => 3 + ] +]); +``` + +OR + +```php +$retrySettings = RetrySettings::constructDefault(); +$retrySettings = $retrySettings->with(['maxRetries' => 3]) +$table->readRows([ + 'retrySettings' => $retrySettings +]); +``` + +This is done in order to be consistent across other RPC calls which use GAX's retrySettings and to be consistent across other products which mostly use the [RetrySettings](https://github.com/googleapis/gax-php/blob/main/src/RetrySettings.php) from GAX already. + +Only the maxRetries parameter is supported for now and not the other options in the `RetrySettings`. + +### Removed deprecated classes + +The following deprecated classes are now removed completely. Use the specified alternatives. +- `Google\Cloud\Bigtable\V2\Gapic\BigtableGapicClient`, use `Google\Cloud\Bigtable\V2\Client\BigtableClient` instead. +- `Google\Cloud\Bigtable\V2\BigtableClient`, use `Google\Cloud\Bigtable\V2\Client\BigtableClient` instead. +- `Google\Cloud\Bigtable\Admin\V2\Gapic\BigtableInstanceAdminGapicClient`, use `Google\Cloud\Bigtable\Admin\V2\Client\BigtableInstanceAdminClient` instead. +- `Google\Cloud\Bigtable\Admin\V2\Gapic\BigtableTableAdminGapicClient`, use `Google\Cloud\Bigtable\Admin\V2\Client\BigtableTableAdminClient` instead. +- `Google\Cloud\Bigtable\V2\MutateRowsRequest_Entry`, use `Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry` instead. +- `Google\Cloud\Bigtable\V2\MutateRowsResponse_Entry`, use `Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry` instead. +- `Google\Cloud\Bigtable\V2\Mutation_DeleteFromFamily`, use `Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily` instead. +- `Google\Cloud\Bigtable\V2\Mutation_DeleteFromColumn`, use `Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn` instead. +- `Google\Cloud\Bigtable\V2\Mutation_DeleteFromRow`, use `Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow` instead. +- `Google\Cloud\Bigtable\V2\Mutation_SetCell`, use `Google\Cloud\Bigtable\V2\Mutation\SetCell` instead. +- `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_CloseStream`, use Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream`` instead. +- `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_DataChange_Type`, use `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange\Type` instead. +- `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_DataChange`, use `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange` instead. +- `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_Heartbeat`, use `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeat` instead. +- `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_MutationChunk_ChunkInfo`, use `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfo` instead. +- `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_MutationChunk`, use `Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk` instead. +- `Google\Cloud\Bigtable\V2\ReadRowsRequest_RequestStatsView`, use `Google\Cloud\Bigtable\V2\ReadRowsRequest\RequestStatsView` instead. +- `Google\Cloud\Bigtable\V2\RowFilter_Chain`, use `Google\Cloud\Bigtable\V2\RowFilter\Chain` instead. +- `Google\Cloud\Bigtable\V2\RowFilter_Condition`, use `Google\Cloud\Bigtable\V2\RowFilter\Condition` instead. +- `Google\Cloud\Bigtable\V2\RowFilter_Interleave`, use `Google\Cloud\Bigtable\V2\RowFilter\Interleave` instead. +- `Google\Cloud\Bigtable\V2\ReadRowsResponse_CellChunk`, use `Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk` instead. +- `Google\Cloud\Bigtable\Admin\V2\AppProfile_MultiClusterRoutingUseAny`, use `Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny` instead. +- `Google\Cloud\Bigtable\Admin\V2\AppProfile_SingleClusterRouting`, use `Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting` instead. +- `Google\Cloud\Bigtable\Admin\V2\Backup_State`, use `Google\Cloud\Bigtable\Admin\V2\Backup\State` instead. +- `Google\Cloud\Bigtable\Admin\V2\Cluster_ClusterAutoscalingConfig`, use `Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterAutoscalingConfig` instead. +- `Google\Cloud\Bigtable\Admin\V2\Cluster_ClusterConfig`, use `Google\Cloud\Bigtable\Admin\V2\Cluster\ClusterConfig` instead. +- `Google\Cloud\Bigtable\Admin\V2\Cluster_EncryptionConfig`, use `Google\Cloud\Bigtable\Admin\V2\Cluster\EncryptionConfig` instead. +- `Google\Cloud\Bigtable\Admin\V2\Cluster_State`, use `Google\Cloud\Bigtable\Admin\V2\Cluster\State` instead. +- `Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata_TableProgress`, use `Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata\TableProgress` instead. +- `Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata_TableProgress_State`, use `Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata\TableProgress\State` instead. +- `Google\Cloud\Bigtable\Admin\V2\CreateTableRequest_Split`, use `Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split` instead. +- `Google\Cloud\Bigtable\Admin\V2\EncryptionInfo_EncryptionType`, use `Google\Cloud\Bigtable\Admin\V2\EncryptionInfo\EncryptionType` instead. +- `Google\Cloud\Bigtable\Admin\V2\GcRule_Intersection`, use `Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection` instead. +- `Google\Cloud\Bigtable\Admin\V2\GcRule_Union`, use `Google\Cloud\Bigtable\Admin\V2\GcRule\Union` instead. +- `Google\Cloud\Bigtable\Admin\V2\Instance_State`, use `Google\Cloud\Bigtable\Admin\V2\Instance\State` instead. +- `Google\Cloud\Bigtable\Admin\V2\Instance_Type`, use `Google\Cloud\Bigtable\Admin\V2\Instance\Type` instead. +- `Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest_Modification`, use `Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification` instead. +- `Google\Cloud\Bigtable\Admin\V2\Snapshot_State`, use `Google\Cloud\Bigtable\Admin\V2\Snapshot\State` instead. +- `Google\Cloud\Bigtable\Admin\V2\Table_ClusterState`, use `Google\Cloud\Bigtable\Admin\V2\Table\ClusterState` instead. +- `Google\Cloud\Bigtable\Admin\V2\Table_ClusterState_ReplicationState`, use `Google\Cloud\Bigtable\Admin\V2\Table\ClusterState\ReplicationState` instead. +- `Google\Cloud\Bigtable\Admin\V2\Table_TimestampGranularity`, use `Google\Cloud\Bigtable\Admin\V2\Table\TimestampGranularity` instead. +- `Google\Cloud\Bigtable\Admin\V2\Table_View`, use `Google\Cloud\Bigtable\Admin\V2\Table\View` instead. diff --git a/Bigtable/README.md b/Bigtable/README.md index 3408b4f6aec2..c8b4acaccb43 100644 --- a/Bigtable/README.md +++ b/Bigtable/README.md @@ -66,6 +66,8 @@ foreach ($rows as $row) { This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority. +Please see the [migration guide](./MIGRATING.md) to upgrade from **V1** of the library to **V2**. + ### Next Steps Take a look at and understand the [official documentation](https://cloud.google.com/bigtable/docs). diff --git a/Bigtable/VERSION b/Bigtable/VERSION index 34aae156b192..54ef5dd137b3 100644 --- a/Bigtable/VERSION +++ b/Bigtable/VERSION @@ -1 +1 @@ -1.31.0 +2.0.0-RC1 diff --git a/Bigtable/composer.json b/Bigtable/composer.json index 4103987dc741..6d49236e1b90 100644 --- a/Bigtable/composer.json +++ b/Bigtable/composer.json @@ -5,15 +5,16 @@ "minimum-stability": "stable", "require": { "php": "^8.0", - "google/gax": "^1.30", - "google/cloud-core": "^1.52.7" + "google/gax": "^1.34", + "google/cloud-core": "^1.55" }, "require-dev": { "phpunit/phpunit": "^9.0", "erusev/parsedown": "^1.6", "phpdocumentor/reflection": "^5.3.3", "phpdocumentor/reflection-docblock": "^5.3", - "phpspec/prophecy-phpunit": "^2.0" + "phpspec/prophecy-phpunit": "^2.0", + "dg/bypass-finals": "^1.7" }, "suggest": { "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." diff --git a/Bigtable/metadata/Admin/V2/Types.php b/Bigtable/metadata/Admin/V2/Types.php index bee616b20e2a6164f9d554b74367dc2500212da2..4dedcc0cac878a14afce4a49ff34d23bfdc45ff6 100644 GIT binary patch delta 191 zcmX@Xdx(F7029k|E-sac-YSzVn53DGb4(6pau&1U;w~;J%FIiTFR3g@m0(g})ZjK! zom|Ky&lU_8-#nE`pHXfnBNvn}|029kw4lb36-YSzVn53D`vP}+Ua^8H6Nr!RsJ{A^c0M3RAt^fc4 diff --git a/Bigtable/owlbot.py b/Bigtable/owlbot.py index 56fef8578794..a770b3d174e9 100644 --- a/Bigtable/owlbot.py +++ b/Bigtable/owlbot.py @@ -38,88 +38,18 @@ src=src, dest=dest, copy_excludes=[ - src / "*/src/V2/BigtableClient.php" + src / "**/[A-Z]*_*.php", ] ) # First copy the Bigtable Admin admin_library = Path(f"../{php.STAGING_DIR}/Bigtable/v2/Admin").resolve() -# copy all src except handwritten partial veneers -s.move(admin_library / f'src/V2/Gapic', 'src/Admin/V2/Gapic', merge=preserve_copyright_year) -s.move(admin_library / f'src/V2/Client', 'src/Admin/V2/Client', merge=preserve_copyright_year) -s.move(admin_library / f'src/V2/resources', f'src/Admin/V2/resources', merge=preserve_copyright_year) - -# copy proto files to src also -s.move(admin_library / f'proto/src/Google/Cloud/Bigtable', f'src/', merge=preserve_copyright_year) +# copy gapic src and tests +s.move(admin_library / f'src', 'src/Admin', merge=preserve_copyright_year) s.move(admin_library / f'tests/Unit', 'tests/Unit/Admin', merge=preserve_copyright_year) -# copy GPBMetadata file to metadata +# copy proto and metadata files +s.move(admin_library / f'proto/src/Google/Cloud/Bigtable', f'src/', merge=preserve_copyright_year) s.move(admin_library / f'proto/src/GPBMetadata/Google/Bigtable', f'metadata/', merge=preserve_copyright_year) - -# fix unit test namespace -s.replace( - 'tests/Unit/Admin/*/*.php', - r'namespace Google\\Cloud\\Bigtable\\Admin\\Tests\\Unit', - r'namespace Google\\Cloud\\Bigtable\\Tests\\Unit\\Admin') - -# fix test group -s.replace( - 'tests/**/Admin/**/*Test.php', - '@group admin', - '@group bigtable' + '\n' + ' * bigtable-admin') - -# Fix class references in gapic samples -for version in ['V2']: - pathExpr = [ - 'src/' + version + '/Gapic/BigtableGapicClient.php', - 'src/Admin/' + version + '/Gapic/*GapicClient.php' - ] - - types = { - 'new BigtableClient': r'new Google\\Cloud\\Bigtable\\' + version + r'\\BigtableClient', - 'new BigtableInstanceAdminClient': r'new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\BigtableInstanceAdminClient', - r'\$instance = new Instance': r'$instance = new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\Instance', - '= Type::': r'= Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\Instance\\Type::', - 'new FieldMask': r'new Google\\Protobuf\\FieldMask', - r'\$cluster = new Cluster': r'$cluster = new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\Cluster', - 'new AppProfile': r'new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\AppProfile', - 'new Policy': r'new Google\\Cloud\\Iam\\V1\\Policy', - 'new BigtableTableAdminClient': r'new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\BigtableTableAdminClient', - 'new Table': r'new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\Table', - } - - for search, replace in types.items(): - s.replace( - pathExpr, - search, - replace -) - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) - diff --git a/Bigtable/phpunit-snippets.xml.dist b/Bigtable/phpunit-snippets.xml.dist index 319673b50fe0..e8f38489b71b 100644 --- a/Bigtable/phpunit-snippets.xml.dist +++ b/Bigtable/phpunit-snippets.xml.dist @@ -1,5 +1,5 @@ - + src diff --git a/Bigtable/phpunit.xml.dist b/Bigtable/phpunit.xml.dist index 06944c9f2977..3df735a10968 100644 --- a/Bigtable/phpunit.xml.dist +++ b/Bigtable/phpunit.xml.dist @@ -1,5 +1,5 @@ - + src diff --git a/Bigtable/src/Admin/V2/AppProfile.php b/Bigtable/src/Admin/V2/AppProfile.php index 7dca81d1a909..4eb3ef034a7e 100644 --- a/Bigtable/src/Admin/V2/AppProfile.php +++ b/Bigtable/src/Admin/V2/AppProfile.php @@ -22,7 +22,7 @@ class AppProfile extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Strongly validated etag for optimistic concurrency control. Preserve the * value returned from `GetAppProfile` when calling `UpdateAppProfile` to @@ -35,13 +35,13 @@ class AppProfile extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 2; */ - private $etag = ''; + protected $etag = ''; /** * Long form description of the use case for this AppProfile. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; protected $routing_policy; protected $isolation; diff --git a/Bigtable/src/Admin/V2/AppProfile/DataBoostIsolationReadOnly.php b/Bigtable/src/Admin/V2/AppProfile/DataBoostIsolationReadOnly.php index 981244776615..7a8e71fd8019 100644 --- a/Bigtable/src/Admin/V2/AppProfile/DataBoostIsolationReadOnly.php +++ b/Bigtable/src/Admin/V2/AppProfile/DataBoostIsolationReadOnly.php @@ -30,7 +30,7 @@ class DataBoostIsolationReadOnly extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; */ - private $compute_billing_owner = null; + protected $compute_billing_owner = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/AppProfile/SingleClusterRouting.php b/Bigtable/src/Admin/V2/AppProfile/SingleClusterRouting.php index 4bdf45e1f030..5bd27b02ed0b 100644 --- a/Bigtable/src/Admin/V2/AppProfile/SingleClusterRouting.php +++ b/Bigtable/src/Admin/V2/AppProfile/SingleClusterRouting.php @@ -22,7 +22,7 @@ class SingleClusterRouting extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string cluster_id = 1; */ - private $cluster_id = ''; + protected $cluster_id = ''; /** * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are * allowed by this app profile. It is unsafe to send these requests to @@ -30,7 +30,7 @@ class SingleClusterRouting extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool allow_transactional_writes = 2; */ - private $allow_transactional_writes = false; + protected $allow_transactional_writes = false; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/AppProfile/StandardIsolation.php b/Bigtable/src/Admin/V2/AppProfile/StandardIsolation.php index 42e7b0d4dbb5..3638ebc75214 100644 --- a/Bigtable/src/Admin/V2/AppProfile/StandardIsolation.php +++ b/Bigtable/src/Admin/V2/AppProfile/StandardIsolation.php @@ -21,7 +21,7 @@ class StandardIsolation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.Priority priority = 1; */ - private $priority = 0; + protected $priority = 0; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/AppProfile_MultiClusterRoutingUseAny.php b/Bigtable/src/Admin/V2/AppProfile_MultiClusterRoutingUseAny.php deleted file mode 100644 index b37ee5d7f97e..000000000000 --- a/Bigtable/src/Admin/V2/AppProfile_MultiClusterRoutingUseAny.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ - private $name = ''; + protected $name = ''; /** * The etag for this AuthorizedView. * If this is provided on update, it must match the server's etag. The server @@ -32,7 +32,7 @@ class AuthorizedView extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 3; */ - private $etag = ''; + protected $etag = ''; /** * Set to true to make the AuthorizedView protected against deletion. * The parent Table and containing Instance cannot be deleted if an @@ -40,7 +40,7 @@ class AuthorizedView extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool deletion_protection = 4; */ - private $deletion_protection = false; + protected $deletion_protection = false; protected $authorized_view; /** diff --git a/Bigtable/src/Admin/V2/AutoscalingLimits.php b/Bigtable/src/Admin/V2/AutoscalingLimits.php index da98a23a0c74..87c9350253d9 100644 --- a/Bigtable/src/Admin/V2/AutoscalingLimits.php +++ b/Bigtable/src/Admin/V2/AutoscalingLimits.php @@ -20,13 +20,13 @@ class AutoscalingLimits extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 min_serve_nodes = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $min_serve_nodes = 0; + protected $min_serve_nodes = 0; /** * Required. Maximum number of nodes to scale up to. * * Generated from protobuf field int32 max_serve_nodes = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_serve_nodes = 0; + protected $max_serve_nodes = 0; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/AutoscalingTargets.php b/Bigtable/src/Admin/V2/AutoscalingTargets.php index 7faa6668dd66..4825251531fe 100644 --- a/Bigtable/src/Admin/V2/AutoscalingTargets.php +++ b/Bigtable/src/Admin/V2/AutoscalingTargets.php @@ -23,7 +23,7 @@ class AutoscalingTargets extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 cpu_utilization_percent = 2; */ - private $cpu_utilization_percent = 0; + protected $cpu_utilization_percent = 0; /** * The storage utilization that the Autoscaler should be trying to achieve. * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD @@ -34,7 +34,7 @@ class AutoscalingTargets extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 storage_utilization_gib_per_node = 3; */ - private $storage_utilization_gib_per_node = 0; + protected $storage_utilization_gib_per_node = 0; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Backup.php b/Bigtable/src/Admin/V2/Backup.php index 45cdcd433d96..6dbc78c186c5 100644 --- a/Bigtable/src/Admin/V2/Backup.php +++ b/Bigtable/src/Admin/V2/Backup.php @@ -28,7 +28,7 @@ class Backup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Required. Immutable. Name of the table from which this backup was created. * This needs to be in the same instance as the backup. Values are of the form @@ -36,7 +36,7 @@ class Backup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; */ - private $source_table = ''; + protected $source_table = ''; /** * Output only. Name of the backup from which this backup was copied. If a * backup is not created by copying a backup, this field will be empty. Values @@ -44,7 +44,7 @@ class Backup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $source_backup = ''; + protected $source_backup = ''; /** * Required. The expiration time of the backup, with microseconds * granularity that must be at least 6 hours and at most 90 days @@ -54,7 +54,7 @@ class Backup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $expire_time = null; + protected $expire_time = null; /** * Output only. `start_time` is the time that the backup was started * (i.e. approximately the time the @@ -64,32 +64,32 @@ class Backup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. `end_time` is the time that the backup was finished. The row * data in the backup will be no newer than this timestamp. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Size of the backup in bytes. * * Generated from protobuf field int64 size_bytes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $size_bytes = 0; + protected $size_bytes = 0; /** * Output only. The current state of the backup. * * Generated from protobuf field .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The encryption information for the backup. * * Generated from protobuf field .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $encryption_info = null; + protected $encryption_info = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/BackupInfo.php b/Bigtable/src/Admin/V2/BackupInfo.php index 6b7445be61b3..97b8b310985c 100644 --- a/Bigtable/src/Admin/V2/BackupInfo.php +++ b/Bigtable/src/Admin/V2/BackupInfo.php @@ -20,27 +20,27 @@ class BackupInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $backup = ''; + protected $backup = ''; /** * Output only. The time that the backup was started. Row data in the backup * will be no older than this timestamp. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. This time that the backup was finished. Row data in the * backup will be no newer than this timestamp. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Name of the table the backup was created from. * * Generated from protobuf field string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $source_table = ''; + protected $source_table = ''; /** * Output only. Name of the backup from which this backup was copied. If a * backup is not created by copying a backup, this field will be empty. Values @@ -48,7 +48,7 @@ class BackupInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $source_backup = ''; + protected $source_backup = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Backup_State.php b/Bigtable/src/Admin/V2/Backup_State.php deleted file mode 100644 index 9890badcb534..000000000000 --- a/Bigtable/src/Admin/V2/Backup_State.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets information about an instance. - * @param \Google\Cloud\Bigtable\Admin\V2\GetInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetInstance(\Google\Cloud\Bigtable\Admin\V2\GetInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetInstance', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\Instance', 'decode'], - $metadata, $options); - } - - /** - * Lists information about instances in a project. - * @param \Google\Cloud\Bigtable\Admin\V2\ListInstancesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListInstances(\Google\Cloud\Bigtable\Admin\V2\ListInstancesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\ListInstancesResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates an instance within a project. This method updates only the display - * name and type for an Instance. To update other Instance properties, such as - * labels, use PartialUpdateInstance. - * @param \Google\Cloud\Bigtable\Admin\V2\Instance $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateInstance(\Google\Cloud\Bigtable\Admin\V2\Instance $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateInstance', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\Instance', 'decode'], - $metadata, $options); - } - - /** - * Partially updates an instance within a project. This method can modify all - * fields of an Instance and is the preferred way to update an Instance. - * @param \Google\Cloud\Bigtable\Admin\V2\PartialUpdateInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PartialUpdateInstance(\Google\Cloud\Bigtable\Admin\V2\PartialUpdateInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/PartialUpdateInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Delete an instance from a project. - * @param \Google\Cloud\Bigtable\Admin\V2\DeleteInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteInstance(\Google\Cloud\Bigtable\Admin\V2\DeleteInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteInstance', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates a cluster within an instance. - * - * Note that exactly one of Cluster.serve_nodes and - * Cluster.cluster_config.cluster_autoscaling_config can be set. If - * serve_nodes is set to non-zero, then the cluster is manually scaled. If - * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is - * enabled. - * @param \Google\Cloud\Bigtable\Admin\V2\CreateClusterRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateCluster(\Google\Cloud\Bigtable\Admin\V2\CreateClusterRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateCluster', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets information about a cluster. - * @param \Google\Cloud\Bigtable\Admin\V2\GetClusterRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetCluster(\Google\Cloud\Bigtable\Admin\V2\GetClusterRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetCluster', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\Cluster', 'decode'], - $metadata, $options); - } - - /** - * Lists information about clusters in an instance. - * @param \Google\Cloud\Bigtable\Admin\V2\ListClustersRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListClusters(\Google\Cloud\Bigtable\Admin\V2\ListClustersRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\ListClustersResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a cluster within an instance. - * - * Note that UpdateCluster does not support updating - * cluster_config.cluster_autoscaling_config. In order to update it, you - * must use PartialUpdateCluster. - * @param \Google\Cloud\Bigtable\Admin\V2\Cluster $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateCluster(\Google\Cloud\Bigtable\Admin\V2\Cluster $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateCluster', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Partially updates a cluster within a project. This method is the preferred - * way to update a Cluster. - * - * To enable and update autoscaling, set - * cluster_config.cluster_autoscaling_config. When autoscaling is enabled, - * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it - * are ignored. Note that an update cannot simultaneously set serve_nodes to - * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and - * also specify both in the update_mask. - * - * To disable autoscaling, clear cluster_config.cluster_autoscaling_config, - * and explicitly set a serve_node count via the update_mask. - * @param \Google\Cloud\Bigtable\Admin\V2\PartialUpdateClusterRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PartialUpdateCluster(\Google\Cloud\Bigtable\Admin\V2\PartialUpdateClusterRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/PartialUpdateCluster', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a cluster from an instance. - * @param \Google\Cloud\Bigtable\Admin\V2\DeleteClusterRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteCluster(\Google\Cloud\Bigtable\Admin\V2\DeleteClusterRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteCluster', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates an app profile within an instance. - * @param \Google\Cloud\Bigtable\Admin\V2\CreateAppProfileRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateAppProfile(\Google\Cloud\Bigtable\Admin\V2\CreateAppProfileRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateAppProfile', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\AppProfile', 'decode'], - $metadata, $options); - } - - /** - * Gets information about an app profile. - * @param \Google\Cloud\Bigtable\Admin\V2\GetAppProfileRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetAppProfile(\Google\Cloud\Bigtable\Admin\V2\GetAppProfileRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetAppProfile', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\AppProfile', 'decode'], - $metadata, $options); - } - - /** - * Lists information about app profiles in an instance. - * @param \Google\Cloud\Bigtable\Admin\V2\ListAppProfilesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListAppProfiles(\Google\Cloud\Bigtable\Admin\V2\ListAppProfilesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListAppProfiles', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\ListAppProfilesResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates an app profile within an instance. - * @param \Google\Cloud\Bigtable\Admin\V2\UpdateAppProfileRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateAppProfile(\Google\Cloud\Bigtable\Admin\V2\UpdateAppProfileRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateAppProfile', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes an app profile from an instance. - * @param \Google\Cloud\Bigtable\Admin\V2\DeleteAppProfileRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteAppProfile(\Google\Cloud\Bigtable\Admin\V2\DeleteAppProfileRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteAppProfile', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets the access control policy for an instance resource. Returns an empty - * policy if an instance exists but does not have a policy set. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Sets the access control policy on an instance resource. Replaces any - * existing policy. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Returns permissions that the caller has on the specified instance resource. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists hot tablets in a cluster, within the time range provided. Hot - * tablets are ordered based on CPU usage. - * @param \Google\Cloud\Bigtable\Admin\V2\ListHotTabletsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListHotTablets(\Google\Cloud\Bigtable\Admin\V2\ListHotTabletsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListHotTablets', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\ListHotTabletsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Bigtable/src/Admin/V2/BigtableTableAdminClient.php b/Bigtable/src/Admin/V2/BigtableTableAdminClient.php deleted file mode 100644 index 0b35aa6938f9..000000000000 --- a/Bigtable/src/Admin/V2/BigtableTableAdminClient.php +++ /dev/null @@ -1,45 +0,0 @@ -_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/CreateTable', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\Table', 'decode'], - $metadata, $options); - } - - /** - * Creates a new table from the specified snapshot. The target table must - * not exist. The snapshot and the table must be in the same instance. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * @param \Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTableFromSnapshot(\Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/CreateTableFromSnapshot', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists all tables served from a specified instance. - * @param \Google\Cloud\Bigtable\Admin\V2\ListTablesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTables(\Google\Cloud\Bigtable\Admin\V2\ListTablesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/ListTables', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\ListTablesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets metadata information about the specified table. - * @param \Google\Cloud\Bigtable\Admin\V2\GetTableRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTable(\Google\Cloud\Bigtable\Admin\V2\GetTableRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/GetTable', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\Table', 'decode'], - $metadata, $options); - } - - /** - * Updates a specified table. - * @param \Google\Cloud\Bigtable\Admin\V2\UpdateTableRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTable(\Google\Cloud\Bigtable\Admin\V2\UpdateTableRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/UpdateTable', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Permanently deletes a specified table and all of its data. - * @param \Google\Cloud\Bigtable\Admin\V2\DeleteTableRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTable(\Google\Cloud\Bigtable\Admin\V2\DeleteTableRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteTable', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Restores a specified table which was accidentally deleted. - * @param \Google\Cloud\Bigtable\Admin\V2\UndeleteTableRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UndeleteTable(\Google\Cloud\Bigtable\Admin\V2\UndeleteTableRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/UndeleteTable', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Performs a series of column family modifications on the specified table. - * Either all or none of the modifications will occur before this method - * returns, but data requests received prior to that point may see a table - * where only some modifications have taken effect. - * @param \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ModifyColumnFamilies(\Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\Table', 'decode'], - $metadata, $options); - } - - /** - * Permanently drop/delete a row range from a specified table. The request can - * specify whether to delete all rows in a table, or only those that match a - * particular prefix. - * @param \Google\Cloud\Bigtable\Admin\V2\DropRowRangeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DropRowRange(\Google\Cloud\Bigtable\Admin\V2\DropRowRangeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/DropRowRange', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Generates a consistency token for a Table, which can be used in - * CheckConsistency to check whether mutations to the table that finished - * before this call started have been replicated. The tokens will be available - * for 90 days. - * @param \Google\Cloud\Bigtable\Admin\V2\GenerateConsistencyTokenRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GenerateConsistencyToken(\Google\Cloud\Bigtable\Admin\V2\GenerateConsistencyTokenRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/GenerateConsistencyToken', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\GenerateConsistencyTokenResponse', 'decode'], - $metadata, $options); - } - - /** - * Checks replication consistency based on a consistency token, that is, if - * replication has caught up based on the conditions specified in the token - * and the check request. - * @param \Google\Cloud\Bigtable\Admin\V2\CheckConsistencyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CheckConsistency(\Google\Cloud\Bigtable\Admin\V2\CheckConsistencyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/CheckConsistency', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\CheckConsistencyResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates a new snapshot in the specified cluster from the specified - * source table. The cluster and the table must be in the same instance. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * @param \Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SnapshotTable(\Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/SnapshotTable', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets metadata information about the specified snapshot. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * @param \Google\Cloud\Bigtable\Admin\V2\GetSnapshotRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetSnapshot(\Google\Cloud\Bigtable\Admin\V2\GetSnapshotRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/GetSnapshot', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\Snapshot', 'decode'], - $metadata, $options); - } - - /** - * Lists all snapshots associated with the specified cluster. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * @param \Google\Cloud\Bigtable\Admin\V2\ListSnapshotsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListSnapshots(\Google\Cloud\Bigtable\Admin\V2\ListSnapshotsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/ListSnapshots', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\ListSnapshotsResponse', 'decode'], - $metadata, $options); - } - - /** - * Permanently deletes the specified snapshot. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * @param \Google\Cloud\Bigtable\Admin\V2\DeleteSnapshotRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteSnapshot(\Google\Cloud\Bigtable\Admin\V2\DeleteSnapshotRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteSnapshot', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Starts creating a new Cloud Bigtable Backup. The returned backup - * [long-running operation][google.longrunning.Operation] can be used to - * track creation of the backup. The - * [metadata][google.longrunning.Operation.metadata] field type is - * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation will stop the - * creation and delete the backup. - * @param \Google\Cloud\Bigtable\Admin\V2\CreateBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBackup(\Google\Cloud\Bigtable\Admin\V2\CreateBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/CreateBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets metadata on a pending or completed Cloud Bigtable Backup. - * @param \Google\Cloud\Bigtable\Admin\V2\GetBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetBackup(\Google\Cloud\Bigtable\Admin\V2\GetBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/GetBackup', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\Backup', 'decode'], - $metadata, $options); - } - - /** - * Updates a pending or completed Cloud Bigtable Backup. - * @param \Google\Cloud\Bigtable\Admin\V2\UpdateBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateBackup(\Google\Cloud\Bigtable\Admin\V2\UpdateBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/UpdateBackup', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\Backup', 'decode'], - $metadata, $options); - } - - /** - * Deletes a pending or completed Cloud Bigtable backup. - * @param \Google\Cloud\Bigtable\Admin\V2\DeleteBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteBackup(\Google\Cloud\Bigtable\Admin\V2\DeleteBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteBackup', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Lists Cloud Bigtable backups. Returns both completed and pending - * backups. - * @param \Google\Cloud\Bigtable\Admin\V2\ListBackupsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListBackups(\Google\Cloud\Bigtable\Admin\V2\ListBackupsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/ListBackups', - $argument, - ['\Google\Cloud\Bigtable\Admin\V2\ListBackupsResponse', 'decode'], - $metadata, $options); - } - - /** - * Create a new table by restoring from a completed backup. The new table - * must be in the same project as the instance containing the backup. The - * returned table [long-running operation][google.longrunning.Operation] can - * be used to track the progress of the operation, and to cancel it. The - * [metadata][google.longrunning.Operation.metadata] field type is - * [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The - * [response][google.longrunning.Operation.response] type is - * [Table][google.bigtable.admin.v2.Table], if successful. - * @param \Google\Cloud\Bigtable\Admin\V2\RestoreTableRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestoreTable(\Google\Cloud\Bigtable\Admin\V2\RestoreTableRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/RestoreTable', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets the access control policy for a Table or Backup resource. - * Returns an empty policy if the resource exists but does not have a policy - * set. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Sets the access control policy on a Table or Backup resource. - * Replaces any existing policy. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Returns permissions that the caller has on the specified Table or Backup resource. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableTableAdmin/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Bigtable/src/Admin/V2/ChangeStreamConfig.php b/Bigtable/src/Admin/V2/ChangeStreamConfig.php index 592d8a711cda..49dbf3a36659 100644 --- a/Bigtable/src/Admin/V2/ChangeStreamConfig.php +++ b/Bigtable/src/Admin/V2/ChangeStreamConfig.php @@ -24,7 +24,7 @@ class ChangeStreamConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration retention_period = 1; */ - private $retention_period = null; + protected $retention_period = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/CheckConsistencyRequest.php b/Bigtable/src/Admin/V2/CheckConsistencyRequest.php index 1a96e4a2a4af..543b4f861565 100644 --- a/Bigtable/src/Admin/V2/CheckConsistencyRequest.php +++ b/Bigtable/src/Admin/V2/CheckConsistencyRequest.php @@ -23,13 +23,13 @@ class CheckConsistencyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The token created using GenerateConsistencyToken for the Table. * * Generated from protobuf field string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $consistency_token = ''; + protected $consistency_token = ''; protected $mode; /** diff --git a/Bigtable/src/Admin/V2/CheckConsistencyResponse.php b/Bigtable/src/Admin/V2/CheckConsistencyResponse.php index b4f54edcb244..86e789432683 100644 --- a/Bigtable/src/Admin/V2/CheckConsistencyResponse.php +++ b/Bigtable/src/Admin/V2/CheckConsistencyResponse.php @@ -22,7 +22,7 @@ class CheckConsistencyResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool consistent = 1; */ - private $consistent = false; + protected $consistent = false; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php b/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php index db440391631d..a0b01364dd39 100644 --- a/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php +++ b/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php @@ -1,6 +1,6 @@ setDefaultEmulatorConfig($options); $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); $this->operationsClient = $this->createOperationsClient($clientOptions); @@ -972,4 +994,23 @@ public function updateInstance(Instance $request, array $callOptions = []): Inst { return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); } + + /** Configure the gapic configuration to use a service emulator. */ + private function setDefaultEmulatorConfig(array $options): array + { + $emulatorHost = getenv('BIGTABLE_EMULATOR_HOST'); + if (empty($emulatorHost)) { + return $options; + } + + if ($scheme = parse_url($emulatorHost, PHP_URL_SCHEME)) { + $search = $scheme . '://'; + $emulatorHost = str_replace($search, '', $emulatorHost); + } + + $options['apiEndpoint'] ??= $emulatorHost; + $options['transportConfig']['grpc']['stubOpts']['credentials'] ??= ChannelCredentials::createInsecure(); + $options['credentials'] ??= new InsecureCredentialsWrapper(); + return $options; + } } diff --git a/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php b/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php index 2bad059c5935..452b858a4e7e 100644 --- a/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php +++ b/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php @@ -1,6 +1,6 @@ setDefaultEmulatorConfig($options); $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); $this->operationsClient = $this->createOperationsClient($clientOptions); @@ -1291,4 +1313,23 @@ public function updateTable(UpdateTableRequest $request, array $callOptions = [] { return $this->startApiCall('UpdateTable', $request, $callOptions)->wait(); } + + /** Configure the gapic configuration to use a service emulator. */ + private function setDefaultEmulatorConfig(array $options): array + { + $emulatorHost = getenv('BIGTABLE_EMULATOR_HOST'); + if (empty($emulatorHost)) { + return $options; + } + + if ($scheme = parse_url($emulatorHost, PHP_URL_SCHEME)) { + $search = $scheme . '://'; + $emulatorHost = str_replace($search, '', $emulatorHost); + } + + $options['apiEndpoint'] ??= $emulatorHost; + $options['transportConfig']['grpc']['stubOpts']['credentials'] ??= ChannelCredentials::createInsecure(); + $options['credentials'] ??= new InsecureCredentialsWrapper(); + return $options; + } } diff --git a/Bigtable/src/Admin/V2/Cluster.php b/Bigtable/src/Admin/V2/Cluster.php index 21ebc80ddbdf..4039b9ce2cbd 100644 --- a/Bigtable/src/Admin/V2/Cluster.php +++ b/Bigtable/src/Admin/V2/Cluster.php @@ -23,7 +23,7 @@ class Cluster extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Immutable. The location where this cluster's nodes and storage reside. For * best performance, clients should be located as close as possible to this @@ -32,33 +32,33 @@ class Cluster extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $location = ''; + protected $location = ''; /** * Output only. The current state of the cluster. * * Generated from protobuf field .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * The number of nodes allocated to this cluster. More nodes enable higher * throughput and more consistent performance. * * Generated from protobuf field int32 serve_nodes = 4; */ - private $serve_nodes = 0; + protected $serve_nodes = 0; /** * Immutable. The type of storage used by this cluster to serve its * parent instance's tables, unless explicitly overridden. * * Generated from protobuf field .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $default_storage_type = 0; + protected $default_storage_type = 0; /** * Immutable. The encryption configuration for CMEK-protected clusters. * * Generated from protobuf field .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $encryption_config = null; + protected $encryption_config = null; protected $config; /** diff --git a/Bigtable/src/Admin/V2/Cluster/ClusterAutoscalingConfig.php b/Bigtable/src/Admin/V2/Cluster/ClusterAutoscalingConfig.php index b66b8c8de5f7..997961367dd3 100644 --- a/Bigtable/src/Admin/V2/Cluster/ClusterAutoscalingConfig.php +++ b/Bigtable/src/Admin/V2/Cluster/ClusterAutoscalingConfig.php @@ -20,13 +20,13 @@ class ClusterAutoscalingConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $autoscaling_limits = null; + protected $autoscaling_limits = null; /** * Required. Autoscaling targets for this cluster. * * Generated from protobuf field .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $autoscaling_targets = null; + protected $autoscaling_targets = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Cluster/ClusterConfig.php b/Bigtable/src/Admin/V2/Cluster/ClusterConfig.php index e8d1f29fc4ad..b8856b291e62 100644 --- a/Bigtable/src/Admin/V2/Cluster/ClusterConfig.php +++ b/Bigtable/src/Admin/V2/Cluster/ClusterConfig.php @@ -20,7 +20,7 @@ class ClusterConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; */ - private $cluster_autoscaling_config = null; + protected $cluster_autoscaling_config = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Cluster/EncryptionConfig.php b/Bigtable/src/Admin/V2/Cluster/EncryptionConfig.php index 711feebc6639..3294a44ba562 100644 --- a/Bigtable/src/Admin/V2/Cluster/EncryptionConfig.php +++ b/Bigtable/src/Admin/V2/Cluster/EncryptionConfig.php @@ -30,7 +30,7 @@ class EncryptionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { */ - private $kms_key_name = ''; + protected $kms_key_name = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Cluster_ClusterAutoscalingConfig.php b/Bigtable/src/Admin/V2/Cluster_ClusterAutoscalingConfig.php deleted file mode 100644 index 397dd0cbc7bd..000000000000 --- a/Bigtable/src/Admin/V2/Cluster_ClusterAutoscalingConfig.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.bigtable.admin.v2.GcRule gc_rule = 1; */ - private $gc_rule = null; + protected $gc_rule = null; /** * The type of data stored in each of this family's cell values, including its * full encoding. If omitted, the family only serves raw untyped bytes. @@ -35,7 +35,7 @@ class ColumnFamily extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Type value_type = 3; */ - private $value_type = null; + protected $value_type = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/CopyBackupMetadata.php b/Bigtable/src/Admin/V2/CopyBackupMetadata.php index 98165e430e07..0efc355bd7d8 100644 --- a/Bigtable/src/Admin/V2/CopyBackupMetadata.php +++ b/Bigtable/src/Admin/V2/CopyBackupMetadata.php @@ -23,13 +23,13 @@ class CopyBackupMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Information about the source backup that is being copied from. * * Generated from protobuf field .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; */ - private $source_backup_info = null; + protected $source_backup_info = null; /** * The progress of the * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] @@ -37,7 +37,7 @@ class CopyBackupMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 3; */ - private $progress = null; + protected $progress = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/CopyBackupRequest.php b/Bigtable/src/Admin/V2/CopyBackupRequest.php index 877e9e5c6027..2212688f3c06 100644 --- a/Bigtable/src/Admin/V2/CopyBackupRequest.php +++ b/Bigtable/src/Admin/V2/CopyBackupRequest.php @@ -23,7 +23,7 @@ class CopyBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The id of the new backup. The `backup_id` along with `parent` * are combined as {parent}/backups/{backup_id} to create the full backup @@ -34,7 +34,7 @@ class CopyBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $backup_id = ''; + protected $backup_id = ''; /** * Required. The source backup to be copied from. * The source backup needs to be in READY state for it to be copied. @@ -46,7 +46,7 @@ class CopyBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $source_backup = ''; + protected $source_backup = ''; /** * Required. Required. The expiration time of the copied backup with * microsecond granularity that must be at least 6 hours and at most 30 days @@ -56,7 +56,7 @@ class CopyBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $expire_time = null; + protected $expire_time = null; /** * @param string $parent Required. The name of the destination cluster that will contain the backup diff --git a/Bigtable/src/Admin/V2/CreateAppProfileRequest.php b/Bigtable/src/Admin/V2/CreateAppProfileRequest.php index 3495b4a6bced..12b67e4093aa 100644 --- a/Bigtable/src/Admin/V2/CreateAppProfileRequest.php +++ b/Bigtable/src/Admin/V2/CreateAppProfileRequest.php @@ -21,7 +21,7 @@ class CreateAppProfileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The ID to be used when referring to the new app profile within * its instance, e.g., just `myprofile` rather than @@ -29,20 +29,20 @@ class CreateAppProfileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * Required. The app profile to be created. * Fields marked `OutputOnly` will be ignored. * * Generated from protobuf field .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $app_profile = null; + protected $app_profile = null; /** * If true, ignore safety checks when creating the app profile. * * Generated from protobuf field bool ignore_warnings = 4; */ - private $ignore_warnings = false; + protected $ignore_warnings = false; /** * @param string $parent Required. The unique name of the instance in which to create the new app diff --git a/Bigtable/src/Admin/V2/CreateAuthorizedViewMetadata.php b/Bigtable/src/Admin/V2/CreateAuthorizedViewMetadata.php index d2a0d15a4087..e2172d832ac3 100644 --- a/Bigtable/src/Admin/V2/CreateAuthorizedViewMetadata.php +++ b/Bigtable/src/Admin/V2/CreateAuthorizedViewMetadata.php @@ -20,19 +20,19 @@ class CreateAuthorizedViewMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; */ - private $original_request = null; + protected $original_request = null; /** * The time at which the original request was received. * * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; */ - private $request_time = null; + protected $request_time = null; /** * The time at which the operation failed or was completed successfully. * * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; */ - private $finish_time = null; + protected $finish_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/CreateAuthorizedViewRequest.php b/Bigtable/src/Admin/V2/CreateAuthorizedViewRequest.php index e3971ef2ea32..0329adcb6e04 100644 --- a/Bigtable/src/Admin/V2/CreateAuthorizedViewRequest.php +++ b/Bigtable/src/Admin/V2/CreateAuthorizedViewRequest.php @@ -23,7 +23,7 @@ class CreateAuthorizedViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The id of the AuthorizedView to create. This AuthorizedView must * not already exist. The `authorized_view_id` appended to `parent` forms the @@ -32,13 +32,13 @@ class CreateAuthorizedViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $authorized_view_id = ''; + protected $authorized_view_id = ''; /** * Required. The AuthorizedView to create. * * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $authorized_view = null; + protected $authorized_view = null; /** * @param string $parent Required. This is the name of the table the AuthorizedView belongs to. diff --git a/Bigtable/src/Admin/V2/CreateBackupMetadata.php b/Bigtable/src/Admin/V2/CreateBackupMetadata.php index dddaf94be6d3..557de786e6de 100644 --- a/Bigtable/src/Admin/V2/CreateBackupMetadata.php +++ b/Bigtable/src/Admin/V2/CreateBackupMetadata.php @@ -21,25 +21,25 @@ class CreateBackupMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The name of the table the backup is created from. * * Generated from protobuf field string source_table = 2; */ - private $source_table = ''; + protected $source_table = ''; /** * The time at which this operation started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; */ - private $start_time = null; + protected $start_time = null; /** * If set, the time at which this operation finished or was cancelled. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/CreateBackupRequest.php b/Bigtable/src/Admin/V2/CreateBackupRequest.php index f0510f3ded12..8022a0ae61ec 100644 --- a/Bigtable/src/Admin/V2/CreateBackupRequest.php +++ b/Bigtable/src/Admin/V2/CreateBackupRequest.php @@ -23,7 +23,7 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The id of the backup to be created. The `backup_id` along with * the parent `parent` are combined as {parent}/backups/{backup_id} to create @@ -34,13 +34,13 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $backup_id = ''; + protected $backup_id = ''; /** * Required. The backup to create. * * Generated from protobuf field .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $backup = null; + protected $backup = null; /** * @param string $parent Required. This must be one of the clusters in the instance in which this diff --git a/Bigtable/src/Admin/V2/CreateClusterMetadata.php b/Bigtable/src/Admin/V2/CreateClusterMetadata.php index a846611ca3cb..c752a40618c5 100644 --- a/Bigtable/src/Admin/V2/CreateClusterMetadata.php +++ b/Bigtable/src/Admin/V2/CreateClusterMetadata.php @@ -20,19 +20,19 @@ class CreateClusterMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; */ - private $original_request = null; + protected $original_request = null; /** * The time at which the original request was received. * * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; */ - private $request_time = null; + protected $request_time = null; /** * The time at which the operation failed or was completed successfully. * * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; */ - private $finish_time = null; + protected $finish_time = null; /** * Keys: the full `name` of each table that existed in the instance when * CreateCluster was first called, i.e. diff --git a/Bigtable/src/Admin/V2/CreateClusterMetadata/TableProgress.php b/Bigtable/src/Admin/V2/CreateClusterMetadata/TableProgress.php index da30502037b7..6fbf11f7cc3b 100644 --- a/Bigtable/src/Admin/V2/CreateClusterMetadata/TableProgress.php +++ b/Bigtable/src/Admin/V2/CreateClusterMetadata/TableProgress.php @@ -20,7 +20,7 @@ class TableProgress extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 estimated_size_bytes = 2; */ - private $estimated_size_bytes = 0; + protected $estimated_size_bytes = 0; /** * Estimate of the number of bytes copied so far for this table. * This will eventually reach 'estimated_size_bytes' unless the table copy @@ -28,11 +28,11 @@ class TableProgress extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 estimated_copied_bytes = 3; */ - private $estimated_copied_bytes = 0; + protected $estimated_copied_bytes = 0; /** * Generated from protobuf field .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; */ - private $state = 0; + protected $state = 0; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/CreateClusterMetadata_TableProgress.php b/Bigtable/src/Admin/V2/CreateClusterMetadata_TableProgress.php deleted file mode 100644 index 79f53089d7d2..000000000000 --- a/Bigtable/src/Admin/V2/CreateClusterMetadata_TableProgress.php +++ /dev/null @@ -1,16 +0,0 @@ -string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The ID to be used when referring to the new cluster within its * instance, e.g., just `mycluster` rather than @@ -29,14 +29,14 @@ class CreateClusterRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $cluster_id = ''; + protected $cluster_id = ''; /** * Required. The cluster to be created. * Fields marked `OutputOnly` must be left blank. * * Generated from protobuf field .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $cluster = null; + protected $cluster = null; /** * @param string $parent Required. The unique name of the instance in which to create the new diff --git a/Bigtable/src/Admin/V2/CreateInstanceMetadata.php b/Bigtable/src/Admin/V2/CreateInstanceMetadata.php index 515bf09d2520..dd7f505c0775 100644 --- a/Bigtable/src/Admin/V2/CreateInstanceMetadata.php +++ b/Bigtable/src/Admin/V2/CreateInstanceMetadata.php @@ -20,19 +20,19 @@ class CreateInstanceMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; */ - private $original_request = null; + protected $original_request = null; /** * The time at which the original request was received. * * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; */ - private $request_time = null; + protected $request_time = null; /** * The time at which the operation failed or was completed successfully. * * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; */ - private $finish_time = null; + protected $finish_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/CreateInstanceRequest.php b/Bigtable/src/Admin/V2/CreateInstanceRequest.php index 5649c4eed16f..7af92a99c778 100644 --- a/Bigtable/src/Admin/V2/CreateInstanceRequest.php +++ b/Bigtable/src/Admin/V2/CreateInstanceRequest.php @@ -21,7 +21,7 @@ class CreateInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The ID to be used when referring to the new instance within its * project, e.g., just `myinstance` rather than @@ -29,14 +29,14 @@ class CreateInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance_id = ''; + protected $instance_id = ''; /** * Required. The instance to create. * Fields marked `OutputOnly` must be left blank. * * Generated from protobuf field .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance = null; + protected $instance = null; /** * Required. The clusters to be created within the instance, mapped by desired * cluster ID, e.g., just `mycluster` rather than diff --git a/Bigtable/src/Admin/V2/CreateTableFromSnapshotMetadata.php b/Bigtable/src/Admin/V2/CreateTableFromSnapshotMetadata.php index f5b508a121d6..ad6178e78b9b 100644 --- a/Bigtable/src/Admin/V2/CreateTableFromSnapshotMetadata.php +++ b/Bigtable/src/Admin/V2/CreateTableFromSnapshotMetadata.php @@ -25,19 +25,19 @@ class CreateTableFromSnapshotMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; */ - private $original_request = null; + protected $original_request = null; /** * The time at which the original request was received. * * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; */ - private $request_time = null; + protected $request_time = null; /** * The time at which the operation failed or was completed successfully. * * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; */ - private $finish_time = null; + protected $finish_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/CreateTableFromSnapshotRequest.php b/Bigtable/src/Admin/V2/CreateTableFromSnapshotRequest.php index 1254d92e8935..2dfa7bc94901 100644 --- a/Bigtable/src/Admin/V2/CreateTableFromSnapshotRequest.php +++ b/Bigtable/src/Admin/V2/CreateTableFromSnapshotRequest.php @@ -26,14 +26,14 @@ class CreateTableFromSnapshotRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The name by which the new table should be referred to within the * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. * * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $table_id = ''; + protected $table_id = ''; /** * Required. The unique name of the snapshot from which to restore the table. * The snapshot and the table must be in the same instance. Values are of the @@ -42,7 +42,7 @@ class CreateTableFromSnapshotRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $source_snapshot = ''; + protected $source_snapshot = ''; /** * @param string $parent Required. The unique name of the instance in which to create the table. diff --git a/Bigtable/src/Admin/V2/CreateTableRequest.php b/Bigtable/src/Admin/V2/CreateTableRequest.php index 697f98579ee0..06608297cf48 100644 --- a/Bigtable/src/Admin/V2/CreateTableRequest.php +++ b/Bigtable/src/Admin/V2/CreateTableRequest.php @@ -22,7 +22,7 @@ class CreateTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The name by which the new table should be referred to within the * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. @@ -30,13 +30,13 @@ class CreateTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $table_id = ''; + protected $table_id = ''; /** * Required. The Table to create. * * Generated from protobuf field .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $table = null; + protected $table = null; /** * The optional list of row keys that will be used to initially split the * table into several tablets (tablets are similar to HBase regions). diff --git a/Bigtable/src/Admin/V2/CreateTableRequest/Split.php b/Bigtable/src/Admin/V2/CreateTableRequest/Split.php index 42f28883717d..af1990b8531e 100644 --- a/Bigtable/src/Admin/V2/CreateTableRequest/Split.php +++ b/Bigtable/src/Admin/V2/CreateTableRequest/Split.php @@ -20,7 +20,7 @@ class Split extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes key = 1; */ - private $key = ''; + protected $key = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/CreateTableRequest_Split.php b/Bigtable/src/Admin/V2/CreateTableRequest_Split.php deleted file mode 100644 index c74f8496363f..000000000000 --- a/Bigtable/src/Admin/V2/CreateTableRequest_Split.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. If true, ignore safety checks when deleting the app profile. * * Generated from protobuf field bool ignore_warnings = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $ignore_warnings = false; + protected $ignore_warnings = false; /** * @param string $name Required. The unique name of the app profile to be deleted. Values are of diff --git a/Bigtable/src/Admin/V2/DeleteAuthorizedViewRequest.php b/Bigtable/src/Admin/V2/DeleteAuthorizedViewRequest.php index 38e240c2b038..e623fe8ebb9d 100644 --- a/Bigtable/src/Admin/V2/DeleteAuthorizedViewRequest.php +++ b/Bigtable/src/Admin/V2/DeleteAuthorizedViewRequest.php @@ -23,7 +23,7 @@ class DeleteAuthorizedViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The current etag of the AuthorizedView. * If an etag is provided and does not match the current etag of the @@ -32,7 +32,7 @@ class DeleteAuthorizedViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The unique name of the AuthorizedView to be deleted. diff --git a/Bigtable/src/Admin/V2/DeleteBackupRequest.php b/Bigtable/src/Admin/V2/DeleteBackupRequest.php index 2e6ba3f8f59e..6bd500313c94 100644 --- a/Bigtable/src/Admin/V2/DeleteBackupRequest.php +++ b/Bigtable/src/Admin/V2/DeleteBackupRequest.php @@ -23,7 +23,7 @@ class DeleteBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the backup to delete. diff --git a/Bigtable/src/Admin/V2/DeleteClusterRequest.php b/Bigtable/src/Admin/V2/DeleteClusterRequest.php index 7f83bd0b9c61..690cdb21a15f 100644 --- a/Bigtable/src/Admin/V2/DeleteClusterRequest.php +++ b/Bigtable/src/Admin/V2/DeleteClusterRequest.php @@ -21,7 +21,7 @@ class DeleteClusterRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the cluster to be deleted. Values are of the diff --git a/Bigtable/src/Admin/V2/DeleteInstanceRequest.php b/Bigtable/src/Admin/V2/DeleteInstanceRequest.php index 3dda4c4c00fe..bcbc1c1a1e58 100644 --- a/Bigtable/src/Admin/V2/DeleteInstanceRequest.php +++ b/Bigtable/src/Admin/V2/DeleteInstanceRequest.php @@ -21,7 +21,7 @@ class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the instance to be deleted. diff --git a/Bigtable/src/Admin/V2/DeleteSnapshotRequest.php b/Bigtable/src/Admin/V2/DeleteSnapshotRequest.php index 90c5e10db833..b83ec8b2043b 100644 --- a/Bigtable/src/Admin/V2/DeleteSnapshotRequest.php +++ b/Bigtable/src/Admin/V2/DeleteSnapshotRequest.php @@ -27,7 +27,7 @@ class DeleteSnapshotRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the snapshot to be deleted. diff --git a/Bigtable/src/Admin/V2/DeleteTableRequest.php b/Bigtable/src/Admin/V2/DeleteTableRequest.php index aec8bd70a69c..3bd4eac51dc3 100644 --- a/Bigtable/src/Admin/V2/DeleteTableRequest.php +++ b/Bigtable/src/Admin/V2/DeleteTableRequest.php @@ -23,7 +23,7 @@ class DeleteTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the table to be deleted. diff --git a/Bigtable/src/Admin/V2/DropRowRangeRequest.php b/Bigtable/src/Admin/V2/DropRowRangeRequest.php index 9ed18eed7cae..a005c44024c4 100644 --- a/Bigtable/src/Admin/V2/DropRowRangeRequest.php +++ b/Bigtable/src/Admin/V2/DropRowRangeRequest.php @@ -23,7 +23,7 @@ class DropRowRangeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; protected $target; /** diff --git a/Bigtable/src/Admin/V2/EncryptionInfo.php b/Bigtable/src/Admin/V2/EncryptionInfo.php index 86527572f717..d13861cd38e2 100644 --- a/Bigtable/src/Admin/V2/EncryptionInfo.php +++ b/Bigtable/src/Admin/V2/EncryptionInfo.php @@ -23,7 +23,7 @@ class EncryptionInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $encryption_type = 0; + protected $encryption_type = 0; /** * Output only. The status of encrypt/decrypt calls on underlying data for * this resource. Regardless of status, the existing data is always encrypted @@ -31,14 +31,14 @@ class EncryptionInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $encryption_status = null; + protected $encryption_status = null; /** * Output only. The version of the Cloud KMS key specified in the parent * cluster that is in use for the data underlying this table. * * Generated from protobuf field string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $kms_key_version = ''; + protected $kms_key_version = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/EncryptionInfo_EncryptionType.php b/Bigtable/src/Admin/V2/EncryptionInfo_EncryptionType.php deleted file mode 100644 index 3469727584de..000000000000 --- a/Bigtable/src/Admin/V2/EncryptionInfo_EncryptionType.php +++ /dev/null @@ -1,16 +0,0 @@ -instanceName('[PROJECT]', '[INSTANCE]'); - * $appProfileId = 'app_profile_id'; - * $appProfile = new Google\Cloud\Bigtable\Admin\V2\AppProfile(); - * $response = $bigtableInstanceAdminClient->createAppProfile($formattedParent, $appProfileId, $appProfile); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Bigtable\Admin\V2\Client\BigtableInstanceAdminClient}. - */ -class BigtableInstanceAdminGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.bigtable.admin.v2.BigtableInstanceAdmin'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'bigtableadmin.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'bigtableadmin.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/bigtable.admin', - 'https://www.googleapis.com/auth/bigtable.admin.cluster', - 'https://www.googleapis.com/auth/bigtable.admin.instance', - 'https://www.googleapis.com/auth/cloud-bigtable.admin', - 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $appProfileNameTemplate; - - private static $clusterNameTemplate; - - private static $cryptoKeyNameTemplate; - - private static $instanceNameTemplate; - - private static $locationNameTemplate; - - private static $projectNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/bigtable_instance_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/bigtable_instance_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/bigtable_instance_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/bigtable_instance_admin_rest_client_config.php', - ], - ], - ]; - } - - private static function getAppProfileNameTemplate() - { - if (self::$appProfileNameTemplate == null) { - self::$appProfileNameTemplate = new PathTemplate('projects/{project}/instances/{instance}/appProfiles/{app_profile}'); - } - - return self::$appProfileNameTemplate; - } - - private static function getClusterNameTemplate() - { - if (self::$clusterNameTemplate == null) { - self::$clusterNameTemplate = new PathTemplate('projects/{project}/instances/{instance}/clusters/{cluster}'); - } - - return self::$clusterNameTemplate; - } - - private static function getCryptoKeyNameTemplate() - { - if (self::$cryptoKeyNameTemplate == null) { - self::$cryptoKeyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'); - } - - return self::$cryptoKeyNameTemplate; - } - - private static function getInstanceNameTemplate() - { - if (self::$instanceNameTemplate == null) { - self::$instanceNameTemplate = new PathTemplate('projects/{project}/instances/{instance}'); - } - - return self::$instanceNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'appProfile' => self::getAppProfileNameTemplate(), - 'cluster' => self::getClusterNameTemplate(), - 'cryptoKey' => self::getCryptoKeyNameTemplate(), - 'instance' => self::getInstanceNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'project' => self::getProjectNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a app_profile - * resource. - * - * @param string $project - * @param string $instance - * @param string $appProfile - * - * @return string The formatted app_profile resource. - */ - public static function appProfileName($project, $instance, $appProfile) - { - return self::getAppProfileNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - 'app_profile' => $appProfile, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cluster - * resource. - * - * @param string $project - * @param string $instance - * @param string $cluster - * - * @return string The formatted cluster resource. - */ - public static function clusterName($project, $instance, $cluster) - { - return self::getClusterNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a crypto_key - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * - * @return string The formatted crypto_key resource. - */ - public static function cryptoKeyName($project, $location, $keyRing, $cryptoKey) - { - return self::getCryptoKeyNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $instance - * - * @return string The formatted instance resource. - */ - public static function instanceName($project, $instance) - { - return self::getInstanceNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - appProfile: projects/{project}/instances/{instance}/appProfiles/{app_profile} - * - cluster: projects/{project}/instances/{instance}/clusters/{cluster} - * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} - * - instance: projects/{project}/instances/{instance} - * - location: projects/{project}/locations/{location} - * - project: projects/{project} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'bigtableadmin.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates an app profile within an instance. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $appProfileId = 'app_profile_id'; - * $appProfile = new Google\Cloud\Bigtable\Admin\V2\AppProfile(); - * $response = $bigtableInstanceAdminClient->createAppProfile($formattedParent, $appProfileId, $appProfile); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the instance in which to create the new app - * profile. Values are of the form `projects/{project}/instances/{instance}`. - * @param string $appProfileId Required. The ID to be used when referring to the new app profile within - * its instance, e.g., just `myprofile` rather than - * `projects/myproject/instances/myinstance/appProfiles/myprofile`. - * @param AppProfile $appProfile Required. The app profile to be created. - * Fields marked `OutputOnly` will be ignored. - * @param array $optionalArgs { - * Optional. - * - * @type bool $ignoreWarnings - * If true, ignore safety checks when creating the app profile. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile - * - * @throws ApiException if the remote call fails - */ - public function createAppProfile($parent, $appProfileId, $appProfile, array $optionalArgs = []) - { - $request = new CreateAppProfileRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAppProfileId($appProfileId); - $request->setAppProfile($appProfile); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['ignoreWarnings'])) { - $request->setIgnoreWarnings($optionalArgs['ignoreWarnings']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateAppProfile', AppProfile::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a cluster within an instance. - * - * Note that exactly one of Cluster.serve_nodes and - * Cluster.cluster_config.cluster_autoscaling_config can be set. If - * serve_nodes is set to non-zero, then the cluster is manually scaled. If - * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is - * enabled. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $clusterId = 'cluster_id'; - * $cluster = new Google\Cloud\Bigtable\Admin\V2\Cluster(); - * $operationResponse = $bigtableInstanceAdminClient->createCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableInstanceAdminClient->createCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'createCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the instance in which to create the new - * cluster. Values are of the form `projects/{project}/instances/{instance}`. - * @param string $clusterId Required. The ID to be used when referring to the new cluster within its - * instance, e.g., just `mycluster` rather than - * `projects/myproject/instances/myinstance/clusters/mycluster`. - * @param Cluster $cluster Required. The cluster to be created. - * Fields marked `OutputOnly` must be left blank. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new CreateClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Create an instance within a project. - * - * Note that exactly one of Cluster.serve_nodes and - * Cluster.cluster_config.cluster_autoscaling_config can be set. If - * serve_nodes is set to non-zero, then the cluster is manually scaled. If - * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is - * enabled. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedParent = $bigtableInstanceAdminClient->projectName('[PROJECT]'); - * $instanceId = 'instance_id'; - * $instance = new Google\Cloud\Bigtable\Admin\V2\Instance(); - * $clusters = []; - * $operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'createInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the project in which to create the new - * instance. Values are of the form `projects/{project}`. - * @param string $instanceId Required. The ID to be used when referring to the new instance within its - * project, e.g., just `myinstance` rather than - * `projects/myproject/instances/myinstance`. - * @param Instance $instance Required. The instance to create. - * Fields marked `OutputOnly` must be left blank. - * @param array $clusters Required. The clusters to be created within the instance, mapped by desired - * cluster ID, e.g., just `mycluster` rather than - * `projects/myproject/instances/myinstance/clusters/mycluster`. - * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createInstance($parent, $instanceId, $instance, $clusters, array $optionalArgs = []) - { - $request = new CreateInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $request->setInstance($instance); - $request->setClusters($clusters); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes an app profile from an instance. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedName = $bigtableInstanceAdminClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - * $ignoreWarnings = false; - * $bigtableInstanceAdminClient->deleteAppProfile($formattedName, $ignoreWarnings); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the app profile to be deleted. Values are of - * the form - * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - * @param bool $ignoreWarnings Required. If true, ignore safety checks when deleting the app profile. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteAppProfile($name, $ignoreWarnings, array $optionalArgs = []) - { - $request = new DeleteAppProfileRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setIgnoreWarnings($ignoreWarnings); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteAppProfile', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a cluster from an instance. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedName = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * $bigtableInstanceAdminClient->deleteCluster($formattedName); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the cluster to be deleted. Values are of the - * form `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteCluster($name, array $optionalArgs = []) - { - $request = new DeleteClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteCluster', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Delete an instance from a project. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedName = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $bigtableInstanceAdminClient->deleteInstance($formattedName); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the instance to be deleted. - * Values are of the form `projects/{project}/instances/{instance}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteInstance($name, array $optionalArgs = []) - { - $request = new DeleteInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteInstance', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about an app profile. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedName = $bigtableInstanceAdminClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - * $response = $bigtableInstanceAdminClient->getAppProfile($formattedName); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the requested app profile. Values are of the - * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile - * - * @throws ApiException if the remote call fails - */ - public function getAppProfile($name, array $optionalArgs = []) - { - $request = new GetAppProfileRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetAppProfile', AppProfile::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a cluster. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedName = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * $response = $bigtableInstanceAdminClient->getCluster($formattedName); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the requested cluster. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\Cluster - * - * @throws ApiException if the remote call fails - */ - public function getCluster($name, array $optionalArgs = []) - { - $request = new GetClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetCluster', Cluster::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the access control policy for an instance resource. Returns an empty - * policy if an instance exists but does not have a policy set. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $resource = 'resource'; - * $response = $bigtableInstanceAdminClient->getIamPolicy($resource); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about an instance. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedName = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $response = $bigtableInstanceAdminClient->getInstance($formattedName); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the requested instance. Values are of the form - * `projects/{project}/instances/{instance}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\Instance - * - * @throws ApiException if the remote call fails - */ - public function getInstance($name, array $optionalArgs = []) - { - $request = new GetInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetInstance', Instance::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists information about app profiles in an instance. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * // Iterate over pages of elements - * $pagedResponse = $bigtableInstanceAdminClient->listAppProfiles($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $bigtableInstanceAdminClient->listAppProfiles($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the instance for which a list of app profiles - * is requested. Values are of the form - * `projects/{project}/instances/{instance}`. - * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, - * e.g., `projects/myproject/instances/-`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAppProfiles($parent, array $optionalArgs = []) - { - $request = new ListAppProfilesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListAppProfiles', $optionalArgs, ListAppProfilesResponse::class, $request); - } - - /** - * Lists information about clusters in an instance. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $response = $bigtableInstanceAdminClient->listClusters($formattedParent); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the instance for which a list of clusters is - * requested. Values are of the form - * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list - * Clusters for all Instances in a project, e.g., - * `projects/myproject/instances/-`. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * DEPRECATED: This field is unused and ignored. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\ListClustersResponse - * - * @throws ApiException if the remote call fails - */ - public function listClusters($parent, array $optionalArgs = []) - { - $request = new ListClustersRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ListClusters', ListClustersResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists hot tablets in a cluster, within the time range provided. Hot - * tablets are ordered based on CPU usage. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedParent = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * // Iterate over pages of elements - * $pagedResponse = $bigtableInstanceAdminClient->listHotTablets($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $bigtableInstanceAdminClient->listHotTablets($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The cluster name to list hot tablets. - * Value is in the following form: - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param array $optionalArgs { - * Optional. - * - * @type Timestamp $startTime - * The start time to list hot tablets. The hot tablets in the response will - * have start times between the requested start time and end time. Start time - * defaults to Now if it is unset, and end time defaults to Now - 24 hours if - * it is unset. The start time should be less than the end time, and the - * maximum allowed time range between start time and end time is 48 hours. - * Start time and end time should have values between Now and Now - 14 days. - * @type Timestamp $endTime - * The end time to list hot tablets. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listHotTablets($parent, array $optionalArgs = []) - { - $request = new ListHotTabletsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['startTime'])) { - $request->setStartTime($optionalArgs['startTime']); - } - - if (isset($optionalArgs['endTime'])) { - $request->setEndTime($optionalArgs['endTime']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListHotTablets', $optionalArgs, ListHotTabletsResponse::class, $request); - } - - /** - * Lists information about instances in a project. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $formattedParent = $bigtableInstanceAdminClient->projectName('[PROJECT]'); - * $response = $bigtableInstanceAdminClient->listInstances($formattedParent); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the project for which a list of instances is - * requested. Values are of the form `projects/{project}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * DEPRECATED: This field is unused and ignored. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\ListInstancesResponse - * - * @throws ApiException if the remote call fails - */ - public function listInstances($parent, array $optionalArgs = []) - { - $request = new ListInstancesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ListInstances', ListInstancesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Partially updates a cluster within a project. This method is the preferred - * way to update a Cluster. - * - * To enable and update autoscaling, set - * cluster_config.cluster_autoscaling_config. When autoscaling is enabled, - * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it - * are ignored. Note that an update cannot simultaneously set serve_nodes to - * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and - * also specify both in the update_mask. - * - * To disable autoscaling, clear cluster_config.cluster_autoscaling_config, - * and explicitly set a serve_node count via the update_mask. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $cluster = new Google\Cloud\Bigtable\Admin\V2\Cluster(); - * $updateMask = new Google\Protobuf\FieldMask(); - * $operationResponse = $bigtableInstanceAdminClient->partialUpdateCluster($cluster, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableInstanceAdminClient->partialUpdateCluster($cluster, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'partialUpdateCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param Cluster $cluster Required. The Cluster which contains the partial updates to be applied, - * subject to the update_mask. - * @param FieldMask $updateMask Required. The subset of Cluster fields which should be replaced. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function partialUpdateCluster($cluster, $updateMask, array $optionalArgs = []) - { - $request = new PartialUpdateClusterRequest(); - $requestParamHeaders = []; - $request->setCluster($cluster); - $request->setUpdateMask($updateMask); - $requestParamHeaders['cluster.name'] = $cluster->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('PartialUpdateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Partially updates an instance within a project. This method can modify all - * fields of an Instance and is the preferred way to update an Instance. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $instance = new Google\Cloud\Bigtable\Admin\V2\Instance(); - * $updateMask = new Google\Protobuf\FieldMask(); - * $operationResponse = $bigtableInstanceAdminClient->partialUpdateInstance($instance, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableInstanceAdminClient->partialUpdateInstance($instance, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'partialUpdateInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param Instance $instance Required. The Instance which will (partially) replace the current value. - * @param FieldMask $updateMask Required. The subset of Instance fields which should be replaced. - * Must be explicitly set. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function partialUpdateInstance($instance, $updateMask, array $optionalArgs = []) - { - $request = new PartialUpdateInstanceRequest(); - $requestParamHeaders = []; - $request->setInstance($instance); - $request->setUpdateMask($updateMask); - $requestParamHeaders['instance.name'] = $instance->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('PartialUpdateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Sets the access control policy on an instance resource. Replaces any - * existing policy. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $resource = 'resource'; - * $policy = new Google\Cloud\Iam\V1\Policy(); - * $response = $bigtableInstanceAdminClient->setIamPolicy($resource, $policy); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns permissions that the caller has on the specified instance resource. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $bigtableInstanceAdminClient->testIamPermissions($resource, $permissions); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates an app profile within an instance. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $appProfile = new Google\Cloud\Bigtable\Admin\V2\AppProfile(); - * $updateMask = new Google\Protobuf\FieldMask(); - * $operationResponse = $bigtableInstanceAdminClient->updateAppProfile($appProfile, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableInstanceAdminClient->updateAppProfile($appProfile, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'updateAppProfile'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param AppProfile $appProfile Required. The app profile which will (partially) replace the current value. - * @param FieldMask $updateMask Required. The subset of app profile fields which should be replaced. - * If unset, all fields will be replaced. - * @param array $optionalArgs { - * Optional. - * - * @type bool $ignoreWarnings - * If true, ignore safety checks when updating the app profile. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateAppProfile($appProfile, $updateMask, array $optionalArgs = []) - { - $request = new UpdateAppProfileRequest(); - $requestParamHeaders = []; - $request->setAppProfile($appProfile); - $request->setUpdateMask($updateMask); - $requestParamHeaders['app_profile.name'] = $appProfile->getName(); - if (isset($optionalArgs['ignoreWarnings'])) { - $request->setIgnoreWarnings($optionalArgs['ignoreWarnings']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateAppProfile', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a cluster within an instance. - * - * Note that UpdateCluster does not support updating - * cluster_config.cluster_autoscaling_config. In order to update it, you - * must use PartialUpdateCluster. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $name = 'name'; - * $serveNodes = 0; - * $operationResponse = $bigtableInstanceAdminClient->updateCluster($name, $serveNodes); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableInstanceAdminClient->updateCluster($name, $serveNodes); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'updateCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $name The unique name of the cluster. Values are of the form - * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. - * @param int $serveNodes The number of nodes allocated to this cluster. More nodes enable higher - * throughput and more consistent performance. - * @param array $optionalArgs { - * Optional. - * - * @type string $location - * Immutable. The location where this cluster's nodes and storage reside. For - * best performance, clients should be located as close as possible to this - * cluster. Currently only zones are supported, so values should be of the - * form `projects/{project}/locations/{zone}`. - * @type int $state - * Output only. The current state of the cluster. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Cluster\State} - * @type ClusterConfig $clusterConfig - * Configuration for this cluster. - * @type int $defaultStorageType - * Immutable. The type of storage used by this cluster to serve its - * parent instance's tables, unless explicitly overridden. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\StorageType} - * @type EncryptionConfig $encryptionConfig - * Immutable. The encryption configuration for CMEK-protected clusters. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateCluster($name, $serveNodes, array $optionalArgs = []) - { - $request = new Cluster(); - $requestParamHeaders = []; - $request->setName($name); - $request->setServeNodes($serveNodes); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - } - - if (isset($optionalArgs['state'])) { - $request->setState($optionalArgs['state']); - } - - if (isset($optionalArgs['clusterConfig'])) { - $request->setClusterConfig($optionalArgs['clusterConfig']); - } - - if (isset($optionalArgs['defaultStorageType'])) { - $request->setDefaultStorageType($optionalArgs['defaultStorageType']); - } - - if (isset($optionalArgs['encryptionConfig'])) { - $request->setEncryptionConfig($optionalArgs['encryptionConfig']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates an instance within a project. This method updates only the display - * name and type for an Instance. To update other Instance properties, such as - * labels, use PartialUpdateInstance. - * - * Sample code: - * ``` - * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); - * try { - * $name = 'name'; - * $displayName = 'display_name'; - * $type = Google\Cloud\Bigtable\Admin\V2\Instance\Type::TYPE_UNSPECIFIED; - * $labels = []; - * $response = $bigtableInstanceAdminClient->updateInstance($name, $displayName, $type, $labels); - * } finally { - * $bigtableInstanceAdminClient->close(); - * } - * ``` - * - * @param string $name The unique name of the instance. Values are of the form - * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. - * @param string $displayName Required. The descriptive name for this instance as it appears in UIs. - * Can be changed at any time, but should be kept globally unique - * to avoid confusion. - * @param int $type The type of the instance. Defaults to `PRODUCTION`. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Instance\Type} - * @param array $labels Labels are a flexible and lightweight mechanism for organizing cloud - * resources into groups that reflect a customer's organizational needs and - * deployment strategies. They can be used to filter resources and aggregate - * metrics. - * - * * Label keys must be between 1 and 63 characters long and must conform to - * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. - * * Label values must be between 0 and 63 characters long and must conform to - * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. - * * No more than 64 labels can be associated with a given resource. - * * Keys and values must both be under 128 bytes. - * @param array $optionalArgs { - * Optional. - * - * @type int $state - * (`OutputOnly`) - * The current state of the instance. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Instance\State} - * @type Timestamp $createTime - * Output only. A server-assigned timestamp representing when this Instance - * was created. For instances created before this field was added (August - * 2021), this value is `seconds: 0, nanos: 1`. - * @type bool $satisfiesPzs - * Output only. Reserved for future use. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\Instance - * - * @throws ApiException if the remote call fails - */ - public function updateInstance($name, $displayName, $type, $labels, array $optionalArgs = []) - { - $request = new Instance(); - $requestParamHeaders = []; - $request->setName($name); - $request->setDisplayName($displayName); - $request->setType($type); - $request->setLabels($labels); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['state'])) { - $request->setState($optionalArgs['state']); - } - - if (isset($optionalArgs['createTime'])) { - $request->setCreateTime($optionalArgs['createTime']); - } - - if (isset($optionalArgs['satisfiesPzs'])) { - $request->setSatisfiesPzs($optionalArgs['satisfiesPzs']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateInstance', Instance::class, $optionalArgs, $request)->wait(); - } -} diff --git a/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php b/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php deleted file mode 100644 index f109aeeae093..000000000000 --- a/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php +++ /dev/null @@ -1,2512 +0,0 @@ -tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $consistencyToken = 'consistency_token'; - * $response = $bigtableTableAdminClient->checkConsistency($formattedName, $consistencyToken); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Bigtable\Admin\V2\Client\BigtableTableAdminClient}. - */ -class BigtableTableAdminGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.bigtable.admin.v2.BigtableTableAdmin'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'bigtableadmin.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'bigtableadmin.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/bigtable.admin', - 'https://www.googleapis.com/auth/bigtable.admin.table', - 'https://www.googleapis.com/auth/cloud-bigtable.admin', - 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $authorizedViewNameTemplate; - - private static $backupNameTemplate; - - private static $clusterNameTemplate; - - private static $cryptoKeyVersionNameTemplate; - - private static $instanceNameTemplate; - - private static $snapshotNameTemplate; - - private static $tableNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/bigtable_table_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/bigtable_table_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/bigtable_table_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/bigtable_table_admin_rest_client_config.php', - ], - ], - ]; - } - - private static function getAuthorizedViewNameTemplate() - { - if (self::$authorizedViewNameTemplate == null) { - self::$authorizedViewNameTemplate = new PathTemplate('projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}'); - } - - return self::$authorizedViewNameTemplate; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getClusterNameTemplate() - { - if (self::$clusterNameTemplate == null) { - self::$clusterNameTemplate = new PathTemplate('projects/{project}/instances/{instance}/clusters/{cluster}'); - } - - return self::$clusterNameTemplate; - } - - private static function getCryptoKeyVersionNameTemplate() - { - if (self::$cryptoKeyVersionNameTemplate == null) { - self::$cryptoKeyVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}'); - } - - return self::$cryptoKeyVersionNameTemplate; - } - - private static function getInstanceNameTemplate() - { - if (self::$instanceNameTemplate == null) { - self::$instanceNameTemplate = new PathTemplate('projects/{project}/instances/{instance}'); - } - - return self::$instanceNameTemplate; - } - - private static function getSnapshotNameTemplate() - { - if (self::$snapshotNameTemplate == null) { - self::$snapshotNameTemplate = new PathTemplate('projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}'); - } - - return self::$snapshotNameTemplate; - } - - private static function getTableNameTemplate() - { - if (self::$tableNameTemplate == null) { - self::$tableNameTemplate = new PathTemplate('projects/{project}/instances/{instance}/tables/{table}'); - } - - return self::$tableNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'authorizedView' => self::getAuthorizedViewNameTemplate(), - 'backup' => self::getBackupNameTemplate(), - 'cluster' => self::getClusterNameTemplate(), - 'cryptoKeyVersion' => self::getCryptoKeyVersionNameTemplate(), - 'instance' => self::getInstanceNameTemplate(), - 'snapshot' => self::getSnapshotNameTemplate(), - 'table' => self::getTableNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * authorized_view resource. - * - * @param string $project - * @param string $instance - * @param string $table - * @param string $authorizedView - * - * @return string The formatted authorized_view resource. - */ - public static function authorizedViewName($project, $instance, $table, $authorizedView) - { - return self::getAuthorizedViewNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - 'table' => $table, - 'authorized_view' => $authorizedView, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $instance - * @param string $cluster - * @param string $backup - * - * @return string The formatted backup resource. - */ - public static function backupName($project, $instance, $cluster, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - 'cluster' => $cluster, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cluster - * resource. - * - * @param string $project - * @param string $instance - * @param string $cluster - * - * @return string The formatted cluster resource. - */ - public static function clusterName($project, $instance, $cluster) - { - return self::getClusterNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * crypto_key_version resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * @param string $cryptoKeyVersion - * - * @return string The formatted crypto_key_version resource. - */ - public static function cryptoKeyVersionName($project, $location, $keyRing, $cryptoKey, $cryptoKeyVersion) - { - return self::getCryptoKeyVersionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - 'crypto_key_version' => $cryptoKeyVersion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $instance - * - * @return string The formatted instance resource. - */ - public static function instanceName($project, $instance) - { - return self::getInstanceNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a snapshot - * resource. - * - * @param string $project - * @param string $instance - * @param string $cluster - * @param string $snapshot - * - * @return string The formatted snapshot resource. - */ - public static function snapshotName($project, $instance, $cluster, $snapshot) - { - return self::getSnapshotNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - 'cluster' => $cluster, - 'snapshot' => $snapshot, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a table - * resource. - * - * @param string $project - * @param string $instance - * @param string $table - * - * @return string The formatted table resource. - */ - public static function tableName($project, $instance, $table) - { - return self::getTableNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - 'table' => $table, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - authorizedView: projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view} - * - backup: projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup} - * - cluster: projects/{project}/instances/{instance}/clusters/{cluster} - * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} - * - instance: projects/{project}/instances/{instance} - * - snapshot: projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot} - * - table: projects/{project}/instances/{instance}/tables/{table} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'bigtableadmin.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Checks replication consistency based on a consistency token, that is, if - * replication has caught up based on the conditions specified in the token - * and the check request. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $consistencyToken = 'consistency_token'; - * $response = $bigtableTableAdminClient->checkConsistency($formattedName, $consistencyToken); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the Table for which to check replication - * consistency. Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param string $consistencyToken Required. The token created using GenerateConsistencyToken for the Table. - * @param array $optionalArgs { - * Optional. - * - * @type StandardReadRemoteWrites $standardReadRemoteWrites - * Checks that reads using an app profile with `StandardIsolation` can - * see all writes committed before the token was created, even if the - * read and write target different clusters. - * @type DataBoostReadLocalWrites $dataBoostReadLocalWrites - * Checks that reads using an app profile with `DataBoostIsolationReadOnly` - * can see all writes committed before the token was created, but only if - * the read and write target the same cluster. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\CheckConsistencyResponse - * - * @throws ApiException if the remote call fails - */ - public function checkConsistency($name, $consistencyToken, array $optionalArgs = []) - { - $request = new CheckConsistencyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setConsistencyToken($consistencyToken); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['standardReadRemoteWrites'])) { - $request->setStandardReadRemoteWrites($optionalArgs['standardReadRemoteWrites']); - } - - if (isset($optionalArgs['dataBoostReadLocalWrites'])) { - $request->setDataBoostReadLocalWrites($optionalArgs['dataBoostReadLocalWrites']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CheckConsistency', CheckConsistencyResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Copy a Cloud Bigtable backup to a new backup in the destination cluster - * located in the destination instance and project. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * $backupId = 'backup_id'; - * $formattedSourceBackup = $bigtableTableAdminClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - * $expireTime = new Timestamp(); - * $operationResponse = $bigtableTableAdminClient->copyBackup($formattedParent, $backupId, $formattedSourceBackup, $expireTime); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableTableAdminClient->copyBackup($formattedParent, $backupId, $formattedSourceBackup, $expireTime); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableTableAdminClient->resumeOperation($operationName, 'copyBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the destination cluster that will contain the backup - * copy. The cluster must already exists. Values are of the form: - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param string $backupId Required. The id of the new backup. The `backup_id` along with `parent` - * are combined as {parent}/backups/{backup_id} to create the full backup - * name, of the form: - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. - * This string must be between 1 and 50 characters in length and match the - * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. - * @param string $sourceBackup Required. The source backup to be copied from. - * The source backup needs to be in READY state for it to be copied. - * Copying a copied backup is not allowed. - * Once CopyBackup is in progress, the source backup cannot be deleted or - * cleaned up on expiration until CopyBackup is finished. - * Values are of the form: - * `projects//instances//clusters//backups/`. - * @param Timestamp $expireTime Required. Required. The expiration time of the copied backup with - * microsecond granularity that must be at least 6 hours and at most 30 days - * from the time the request is received. Once the `expire_time` has - * passed, Cloud Bigtable will delete the backup and free the resources used - * by the backup. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function copyBackup($parent, $backupId, $sourceBackup, $expireTime, array $optionalArgs = []) - { - $request = new CopyBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setSourceBackup($sourceBackup); - $request->setExpireTime($expireTime); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CopyBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new AuthorizedView in a table. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $authorizedViewId = 'authorized_view_id'; - * $authorizedView = new AuthorizedView(); - * $operationResponse = $bigtableTableAdminClient->createAuthorizedView($formattedParent, $authorizedViewId, $authorizedView); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableTableAdminClient->createAuthorizedView($formattedParent, $authorizedViewId, $authorizedView); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableTableAdminClient->resumeOperation($operationName, 'createAuthorizedView'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. This is the name of the table the AuthorizedView belongs to. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param string $authorizedViewId Required. The id of the AuthorizedView to create. This AuthorizedView must - * not already exist. The `authorized_view_id` appended to `parent` forms the - * full AuthorizedView name of the form - * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. - * @param AuthorizedView $authorizedView Required. The AuthorizedView to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createAuthorizedView($parent, $authorizedViewId, $authorizedView, array $optionalArgs = []) - { - $request = new CreateAuthorizedViewRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAuthorizedViewId($authorizedViewId); - $request->setAuthorizedView($authorizedView); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateAuthorizedView', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Starts creating a new Cloud Bigtable Backup. The returned backup - * [long-running operation][google.longrunning.Operation] can be used to - * track creation of the backup. The - * [metadata][google.longrunning.Operation.metadata] field type is - * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the - * returned operation will stop the creation and delete the backup. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $bigtableTableAdminClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableTableAdminClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableTableAdminClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. This must be one of the clusters in the instance in which this - * table is located. The backup will be stored in this cluster. Values are - * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param string $backupId Required. The id of the backup to be created. The `backup_id` along with - * the parent `parent` are combined as {parent}/backups/{backup_id} to create - * the full backup name, of the form: - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. - * This string must be between 1 and 50 characters in length and match the - * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. - * @param Backup $backup Required. The backup to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new table in the specified instance. - * The table can be created with a full set of initial column families, - * specified in the request. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $tableId = 'table_id'; - * $table = new Google\Cloud\Bigtable\Admin\V2\Table(); - * $response = $bigtableTableAdminClient->createTable($formattedParent, $tableId, $table); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the instance in which to create the table. - * Values are of the form `projects/{project}/instances/{instance}`. - * @param string $tableId Required. The name by which the new table should be referred to within the - * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. - * Maximum 50 characters. - * @param Table $table Required. The Table to create. - * @param array $optionalArgs { - * Optional. - * - * @type Split[] $initialSplits - * The optional list of row keys that will be used to initially split the - * table into several tablets (tablets are similar to HBase regions). - * Given two split keys, `s1` and `s2`, three tablets will be created, - * spanning the key ranges: `[, s1), [s1, s2), [s2, )`. - * - * Example: - * - * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` - * `"other", "zz"]` - * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` - * * Key assignment: - * - Tablet 1 `[, apple) => {"a"}.` - * - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` - * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` - * - Tablet 4 `[customer_2, other) => {"customer_2"}.` - * - Tablet 5 `[other, ) => {"other", "zz"}.` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\Table - * - * @throws ApiException if the remote call fails - */ - public function createTable($parent, $tableId, $table, array $optionalArgs = []) - { - $request = new CreateTableRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTableId($tableId); - $request->setTable($table); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['initialSplits'])) { - $request->setInitialSplits($optionalArgs['initialSplits']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateTable', Table::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new table from the specified snapshot. The target table must - * not exist. The snapshot and the table must be in the same instance. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $tableId = 'table_id'; - * $formattedSourceSnapshot = $bigtableTableAdminClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - * $operationResponse = $bigtableTableAdminClient->createTableFromSnapshot($formattedParent, $tableId, $formattedSourceSnapshot); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableTableAdminClient->createTableFromSnapshot($formattedParent, $tableId, $formattedSourceSnapshot); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableTableAdminClient->resumeOperation($operationName, 'createTableFromSnapshot'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the instance in which to create the table. - * Values are of the form `projects/{project}/instances/{instance}`. - * @param string $tableId Required. The name by which the new table should be referred to within the - * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. - * @param string $sourceSnapshot Required. The unique name of the snapshot from which to restore the table. - * The snapshot and the table must be in the same instance. Values are of the - * form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTableFromSnapshot($parent, $tableId, $sourceSnapshot, array $optionalArgs = []) - { - $request = new CreateTableFromSnapshotRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTableId($tableId); - $request->setSourceSnapshot($sourceSnapshot); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateTableFromSnapshot', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Permanently deletes a specified AuthorizedView. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - * $bigtableTableAdminClient->deleteAuthorizedView($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the AuthorizedView to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. The current etag of the AuthorizedView. - * If an etag is provided and does not match the current etag of the - * AuthorizedView, deletion will be blocked and an ABORTED error will be - * returned. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteAuthorizedView($name, array $optionalArgs = []) - { - $request = new DeleteAuthorizedViewRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteAuthorizedView', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a pending or completed Cloud Bigtable backup. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - * $bigtableTableAdminClient->deleteBackup($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the backup to delete. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteBackup', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Permanently deletes the specified snapshot. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - * $bigtableTableAdminClient->deleteSnapshot($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the snapshot to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteSnapshot($name, array $optionalArgs = []) - { - $request = new DeleteSnapshotRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteSnapshot', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Permanently deletes a specified table and all of its data. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $bigtableTableAdminClient->deleteTable($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the table to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteTable($name, array $optionalArgs = []) - { - $request = new DeleteTableRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteTable', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Permanently drop/delete a row range from a specified table. The request can - * specify whether to delete all rows in a table, or only those that match a - * particular prefix. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $bigtableTableAdminClient->dropRowRange($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the table on which to drop a range of rows. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $rowKeyPrefix - * Delete all rows that start with this row key prefix. Prefix cannot be - * zero length. - * @type bool $deleteAllDataFromTable - * Delete all rows in the table. Setting this to false is a no-op. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function dropRowRange($name, array $optionalArgs = []) - { - $request = new DropRowRangeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['rowKeyPrefix'])) { - $request->setRowKeyPrefix($optionalArgs['rowKeyPrefix']); - } - - if (isset($optionalArgs['deleteAllDataFromTable'])) { - $request->setDeleteAllDataFromTable($optionalArgs['deleteAllDataFromTable']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DropRowRange', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Generates a consistency token for a Table, which can be used in - * CheckConsistency to check whether mutations to the table that finished - * before this call started have been replicated. The tokens will be available - * for 90 days. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $response = $bigtableTableAdminClient->generateConsistencyToken($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the Table for which to create a consistency - * token. Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\GenerateConsistencyTokenResponse - * - * @throws ApiException if the remote call fails - */ - public function generateConsistencyToken($name, array $optionalArgs = []) - { - $request = new GenerateConsistencyTokenRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GenerateConsistencyToken', GenerateConsistencyTokenResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information from a specified AuthorizedView. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - * $response = $bigtableTableAdminClient->getAuthorizedView($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the requested AuthorizedView. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. The resource_view to be applied to the returned AuthorizedView's - * fields. Default to BASIC. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\AuthorizedView\ResponseView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\AuthorizedView - * - * @throws ApiException if the remote call fails - */ - public function getAuthorizedView($name, array $optionalArgs = []) - { - $request = new GetAuthorizedViewRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetAuthorizedView', AuthorizedView::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets metadata on a pending or completed Cloud Bigtable Backup. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - * $response = $bigtableTableAdminClient->getBackup($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the backup. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\Backup - * - * @throws ApiException if the remote call fails - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the access control policy for a Table or Backup resource. - * Returns an empty policy if the resource exists but does not have a policy - * set. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $resource = 'resource'; - * $response = $bigtableTableAdminClient->getIamPolicy($resource); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets metadata information about the specified snapshot. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - * $response = $bigtableTableAdminClient->getSnapshot($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the requested snapshot. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\Snapshot - * - * @throws ApiException if the remote call fails - */ - public function getSnapshot($name, array $optionalArgs = []) - { - $request = new GetSnapshotRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetSnapshot', Snapshot::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets metadata information about the specified table. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $response = $bigtableTableAdminClient->getTable($formattedName); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the requested table. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * The view to be applied to the returned table's fields. - * Defaults to `SCHEMA_VIEW` if unspecified. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Table\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\Table - * - * @throws ApiException if the remote call fails - */ - public function getTable($name, array $optionalArgs = []) - { - $request = new GetTableRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetTable', Table::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists all AuthorizedViews from a specific table. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * // Iterate over pages of elements - * $pagedResponse = $bigtableTableAdminClient->listAuthorizedViews($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $bigtableTableAdminClient->listAuthorizedViews($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the table for which AuthorizedViews should be - * listed. Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $view - * Optional. The resource_view to be applied to the returned views' fields. - * Default to NAME_ONLY. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\AuthorizedView\ResponseView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAuthorizedViews($parent, array $optionalArgs = []) - { - $request = new ListAuthorizedViewsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListAuthorizedViews', $optionalArgs, ListAuthorizedViewsResponse::class, $request); - } - - /** - * Lists Cloud Bigtable backups. Returns both completed and pending - * backups. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * // Iterate over pages of elements - * $pagedResponse = $bigtableTableAdminClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $bigtableTableAdminClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The cluster to list backups from. Values are of the - * form `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list backups for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * A filter expression that filters backups listed in the response. - * The expression must specify the field name, a comparison operator, - * and the value that you want to use for filtering. The value must be a - * string, a number, or a boolean. The comparison operator must be - * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is - * roughly synonymous with equality. Filter rules are case insensitive. - * - * The fields eligible for filtering are: - * - * * `name` - * * `source_table` - * * `state` - * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `size_bytes` - * - * To filter on multiple expressions, provide each separate expression within - * parentheses. By default, each expression is an AND expression. However, - * you can include AND, OR, and NOT expressions explicitly. - * - * Some examples of using filters are: - * - * * `name:"exact"` --> The backup's name is the string "exact". - * * `name:howl` --> The backup's name contains the string "howl". - * * `source_table:prod` - * --> The source_table's name contains the string "prod". - * * `state:CREATING` --> The backup is pending creation. - * * `state:READY` --> The backup is fully created and ready for use. - * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` - * --> The backup name contains the string "howl" and start_time - * of the backup is before 2018-03-28T14:50:00Z. - * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB - * @type string $orderBy - * An expression for specifying the sort order of the results of the request. - * The string value should specify one or more fields in - * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at - * https://aip.dev/132#ordering. - * - * Fields supported are: - * - * * name - * * source_table - * * expire_time - * * start_time - * * end_time - * * size_bytes - * * state - * - * For example, "start_time". The default sorting order is ascending. - * To specify descending order for the field, a suffix " desc" should - * be appended to the field name. For example, "start_time desc". - * Redundant space characters in the syntax are insigificant. - * - * If order_by is empty, results will be sorted by `start_time` in descending - * order starting from the most recently created backup. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists all snapshots associated with the specified cluster. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * // Iterate over pages of elements - * $pagedResponse = $bigtableTableAdminClient->listSnapshots($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $bigtableTableAdminClient->listSnapshots($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the cluster for which snapshots should be - * listed. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSnapshots($parent, array $optionalArgs = []) - { - $request = new ListSnapshotsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListSnapshots', $optionalArgs, ListSnapshotsResponse::class, $request); - } - - /** - * Lists all tables served from a specified instance. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * // Iterate over pages of elements - * $pagedResponse = $bigtableTableAdminClient->listTables($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $bigtableTableAdminClient->listTables($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The unique name of the instance for which tables should be - * listed. Values are of the form `projects/{project}/instances/{instance}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * The view to be applied to the returned tables' fields. - * NAME_ONLY view (default) and REPLICATION_VIEW are supported. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Table\View} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTables($parent, array $optionalArgs = []) - { - $request = new ListTablesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListTables', $optionalArgs, ListTablesResponse::class, $request); - } - - /** - * Performs a series of column family modifications on the specified table. - * Either all or none of the modifications will occur before this method - * returns, but data requests received prior to that point may see a table - * where only some modifications have taken effect. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $modifications = []; - * $response = $bigtableTableAdminClient->modifyColumnFamilies($formattedName, $modifications); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the table whose families should be modified. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param Modification[] $modifications Required. Modifications to be atomically applied to the specified table's - * families. Entries are applied in order, meaning that earlier modifications - * can be masked by later ones (in the case of repeated updates to the same - * family, for example). - * @param array $optionalArgs { - * Optional. - * - * @type bool $ignoreWarnings - * Optional. If true, ignore safety checks when modifying the column families. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\Table - * - * @throws ApiException if the remote call fails - */ - public function modifyColumnFamilies($name, $modifications, array $optionalArgs = []) - { - $request = new ModifyColumnFamiliesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setModifications($modifications); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['ignoreWarnings'])) { - $request->setIgnoreWarnings($optionalArgs['ignoreWarnings']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ModifyColumnFamilies', Table::class, $optionalArgs, $request)->wait(); - } - - /** - * Create a new table by restoring from a completed backup. The - * returned table [long-running operation][google.longrunning.Operation] can - * be used to track the progress of the operation, and to cancel it. The - * [metadata][google.longrunning.Operation.metadata] field type is - * [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The - * [response][google.longrunning.Operation.response] type is - * [Table][google.bigtable.admin.v2.Table], if successful. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedParent = $bigtableTableAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $tableId = 'table_id'; - * $operationResponse = $bigtableTableAdminClient->restoreTable($formattedParent, $tableId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableTableAdminClient->restoreTable($formattedParent, $tableId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableTableAdminClient->resumeOperation($operationName, 'restoreTable'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the instance in which to create the restored - * table. Values are of the form `projects//instances/`. - * @param string $tableId Required. The id of the table to create and restore to. This - * table must not already exist. The `table_id` appended to - * `parent` forms the full table name of the form - * `projects//instances//tables/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $backup - * Name of the backup from which to restore. Values are of the form - * `projects//instances//clusters//backups/`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function restoreTable($parent, $tableId, array $optionalArgs = []) - { - $request = new RestoreTableRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTableId($tableId); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['backup'])) { - $request->setBackup($optionalArgs['backup']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreTable', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Sets the access control policy on a Table or Backup resource. - * Replaces any existing policy. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $resource = 'resource'; - * $policy = new Google\Cloud\Iam\V1\Policy(); - * $response = $bigtableTableAdminClient->setIamPolicy($resource, $policy); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new snapshot in the specified cluster from the specified - * source table. The cluster and the table must be in the same instance. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $formattedCluster = $bigtableTableAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * $snapshotId = 'snapshot_id'; - * $operationResponse = $bigtableTableAdminClient->snapshotTable($formattedName, $formattedCluster, $snapshotId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableTableAdminClient->snapshotTable($formattedName, $formattedCluster, $snapshotId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableTableAdminClient->resumeOperation($operationName, 'snapshotTable'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the table to have the snapshot taken. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param string $cluster Required. The name of the cluster where the snapshot will be created in. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param string $snapshotId Required. The ID by which the new snapshot should be referred to within the - * parent cluster, e.g., `mysnapshot` of the form: - * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. - * @param array $optionalArgs { - * Optional. - * - * @type Duration $ttl - * The amount of time that the new snapshot can stay active after it is - * created. Once 'ttl' expires, the snapshot will get deleted. The maximum - * amount of time a snapshot can stay active is 7 days. If 'ttl' is not - * specified, the default value of 24 hours will be used. - * @type string $description - * Description of the snapshot. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function snapshotTable($name, $cluster, $snapshotId, array $optionalArgs = []) - { - $request = new SnapshotTableRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setCluster($cluster); - $request->setSnapshotId($snapshotId); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['ttl'])) { - $request->setTtl($optionalArgs['ttl']); - } - - if (isset($optionalArgs['description'])) { - $request->setDescription($optionalArgs['description']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('SnapshotTable', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Returns permissions that the caller has on the specified Table or Backup - * resource. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $bigtableTableAdminClient->testIamPermissions($resource, $permissions); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Restores a specified table which was accidentally deleted. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $operationResponse = $bigtableTableAdminClient->undeleteTable($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableTableAdminClient->undeleteTable($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableTableAdminClient->resumeOperation($operationName, 'undeleteTable'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the table to be restored. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function undeleteTable($name, array $optionalArgs = []) - { - $request = new UndeleteTableRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UndeleteTable', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates an AuthorizedView in a table. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $authorizedView = new AuthorizedView(); - * $operationResponse = $bigtableTableAdminClient->updateAuthorizedView($authorizedView); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableTableAdminClient->updateAuthorizedView($authorizedView); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableTableAdminClient->resumeOperation($operationName, 'updateAuthorizedView'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param AuthorizedView $authorizedView Required. The AuthorizedView to update. The `name` in `authorized_view` is - * used to identify the AuthorizedView. AuthorizedView name must in this - * format - * projects//instances//tables//authorizedViews/ - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. The list of fields to update. - * A mask specifying which fields in the AuthorizedView resource should be - * updated. This mask is relative to the AuthorizedView resource, not to the - * request message. A field will be overwritten if it is in the mask. If - * empty, all fields set in the request will be overwritten. A special value - * `*` means to overwrite all fields (including fields not set in the - * request). - * @type bool $ignoreWarnings - * Optional. If true, ignore the safety checks when updating the - * AuthorizedView. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateAuthorizedView($authorizedView, array $optionalArgs = []) - { - $request = new UpdateAuthorizedViewRequest(); - $requestParamHeaders = []; - $request->setAuthorizedView($authorizedView); - $requestParamHeaders['authorized_view.name'] = $authorizedView->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['ignoreWarnings'])) { - $request->setIgnoreWarnings($optionalArgs['ignoreWarnings']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateAuthorizedView', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a pending or completed Cloud Bigtable Backup. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $backup = new Backup(); - * $updateMask = new Google\Protobuf\FieldMask(); - * $response = $bigtableTableAdminClient->updateBackup($backup, $updateMask); - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param Backup $backup Required. The backup to update. `backup.name`, and the fields to be updated - * as specified by `update_mask` are required. Other fields are ignored. - * Update is only supported for the following fields: - * - * * `backup.expire_time`. - * @param FieldMask $updateMask Required. A mask specifying which fields (e.g. `expire_time`) in the - * Backup resource should be updated. This mask is relative to the Backup - * resource, not to the request message. The field mask must always be - * specified; this prevents any future fields from being erased accidentally - * by clients that do not know about them. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\Admin\V2\Backup - * - * @throws ApiException if the remote call fails - */ - public function updateBackup($backup, $updateMask, array $optionalArgs = []) - { - $request = new UpdateBackupRequest(); - $requestParamHeaders = []; - $request->setBackup($backup); - $request->setUpdateMask($updateMask); - $requestParamHeaders['backup.name'] = $backup->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a specified table. - * - * Sample code: - * ``` - * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); - * try { - * $table = new Google\Cloud\Bigtable\Admin\V2\Table(); - * $updateMask = new Google\Protobuf\FieldMask(); - * $operationResponse = $bigtableTableAdminClient->updateTable($table, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableTableAdminClient->updateTable($table, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $bigtableTableAdminClient->resumeOperation($operationName, 'updateTable'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $bigtableTableAdminClient->close(); - * } - * ``` - * - * @param Table $table Required. The table to update. - * The table's `name` field is used to identify the table to update. - * @param FieldMask $updateMask Required. The list of fields to update. - * A mask specifying which fields (e.g. `change_stream_config`) in the `table` - * field should be updated. This mask is relative to the `table` field, not to - * the request message. The wildcard (*) path is currently not supported. - * Currently UpdateTable is only supported for the following fields: - * - * * `change_stream_config` - * * `change_stream_config.retention_period` - * * `deletion_protection` - * - * If `column_families` is set in `update_mask`, it will return an - * UNIMPLEMENTED error. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateTable($table, $updateMask, array $optionalArgs = []) - { - $request = new UpdateTableRequest(); - $requestParamHeaders = []; - $request->setTable($table); - $request->setUpdateMask($updateMask); - $requestParamHeaders['table.name'] = $table->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateTable', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/Bigtable/src/Admin/V2/GcRule_Intersection.php b/Bigtable/src/Admin/V2/GcRule_Intersection.php deleted file mode 100644 index 8c207f194674..000000000000 --- a/Bigtable/src/Admin/V2/GcRule_Intersection.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the Table for which to create a consistency diff --git a/Bigtable/src/Admin/V2/GenerateConsistencyTokenResponse.php b/Bigtable/src/Admin/V2/GenerateConsistencyTokenResponse.php index 54c768b2ce61..6b02098b9ffc 100644 --- a/Bigtable/src/Admin/V2/GenerateConsistencyTokenResponse.php +++ b/Bigtable/src/Admin/V2/GenerateConsistencyTokenResponse.php @@ -21,7 +21,7 @@ class GenerateConsistencyTokenResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string consistency_token = 1; */ - private $consistency_token = ''; + protected $consistency_token = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/GetAppProfileRequest.php b/Bigtable/src/Admin/V2/GetAppProfileRequest.php index de9af9eb1acd..017793bbb5ff 100644 --- a/Bigtable/src/Admin/V2/GetAppProfileRequest.php +++ b/Bigtable/src/Admin/V2/GetAppProfileRequest.php @@ -21,7 +21,7 @@ class GetAppProfileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the requested app profile. Values are of the diff --git a/Bigtable/src/Admin/V2/GetAuthorizedViewRequest.php b/Bigtable/src/Admin/V2/GetAuthorizedViewRequest.php index 7e0db42b32bd..385c1c34c266 100644 --- a/Bigtable/src/Admin/V2/GetAuthorizedViewRequest.php +++ b/Bigtable/src/Admin/V2/GetAuthorizedViewRequest.php @@ -23,14 +23,14 @@ class GetAuthorizedViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The resource_view to be applied to the returned AuthorizedView's * fields. Default to BASIC. * * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $name Required. The unique name of the requested AuthorizedView. diff --git a/Bigtable/src/Admin/V2/GetBackupRequest.php b/Bigtable/src/Admin/V2/GetBackupRequest.php index 99fdcb4b3703..5f73e6f2900e 100644 --- a/Bigtable/src/Admin/V2/GetBackupRequest.php +++ b/Bigtable/src/Admin/V2/GetBackupRequest.php @@ -23,7 +23,7 @@ class GetBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the backup. diff --git a/Bigtable/src/Admin/V2/GetClusterRequest.php b/Bigtable/src/Admin/V2/GetClusterRequest.php index fffa489e7993..037844cc19a3 100644 --- a/Bigtable/src/Admin/V2/GetClusterRequest.php +++ b/Bigtable/src/Admin/V2/GetClusterRequest.php @@ -21,7 +21,7 @@ class GetClusterRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the requested cluster. Values are of the form diff --git a/Bigtable/src/Admin/V2/GetInstanceRequest.php b/Bigtable/src/Admin/V2/GetInstanceRequest.php index 850496e920cf..28ca52c590cd 100644 --- a/Bigtable/src/Admin/V2/GetInstanceRequest.php +++ b/Bigtable/src/Admin/V2/GetInstanceRequest.php @@ -21,7 +21,7 @@ class GetInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the requested instance. Values are of the form diff --git a/Bigtable/src/Admin/V2/GetSnapshotRequest.php b/Bigtable/src/Admin/V2/GetSnapshotRequest.php index ab9de859048f..5b3547a68e7a 100644 --- a/Bigtable/src/Admin/V2/GetSnapshotRequest.php +++ b/Bigtable/src/Admin/V2/GetSnapshotRequest.php @@ -27,7 +27,7 @@ class GetSnapshotRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the requested snapshot. diff --git a/Bigtable/src/Admin/V2/GetTableRequest.php b/Bigtable/src/Admin/V2/GetTableRequest.php index 296403090a61..34142b7797a5 100644 --- a/Bigtable/src/Admin/V2/GetTableRequest.php +++ b/Bigtable/src/Admin/V2/GetTableRequest.php @@ -23,14 +23,14 @@ class GetTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * The view to be applied to the returned table's fields. * Defaults to `SCHEMA_VIEW` if unspecified. * * Generated from protobuf field .google.bigtable.admin.v2.Table.View view = 2; */ - private $view = 0; + protected $view = 0; /** * @param string $name Required. The unique name of the requested table. diff --git a/Bigtable/src/Admin/V2/HotTablet.php b/Bigtable/src/Admin/V2/HotTablet.php index fed0f7cc296c..4d75a90e66ee 100644 --- a/Bigtable/src/Admin/V2/HotTablet.php +++ b/Bigtable/src/Admin/V2/HotTablet.php @@ -25,38 +25,38 @@ class HotTablet extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Name of the table that contains the tablet. Values are of the form * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. * * Generated from protobuf field string table_name = 2 [(.google.api.resource_reference) = { */ - private $table_name = ''; + protected $table_name = ''; /** * Output only. The start time of the hot tablet. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The end time of the hot tablet. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Tablet Start Key (inclusive). * * Generated from protobuf field string start_key = 5; */ - private $start_key = ''; + protected $start_key = ''; /** * Tablet End Key (inclusive). * * Generated from protobuf field string end_key = 6; */ - private $end_key = ''; + protected $end_key = ''; /** * Output only. The average CPU usage spent by a node on this tablet over the * start_time to end_time time range. The percentage is the amount of CPU used @@ -65,7 +65,7 @@ class HotTablet extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $node_cpu_usage_percent = 0.0; + protected $node_cpu_usage_percent = 0.0; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Instance.php b/Bigtable/src/Admin/V2/Instance.php index ba69bf7c6cf6..69fc8d87d690 100644 --- a/Bigtable/src/Admin/V2/Instance.php +++ b/Bigtable/src/Admin/V2/Instance.php @@ -24,7 +24,7 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Required. The descriptive name for this instance as it appears in UIs. * Can be changed at any time, but should be kept globally unique @@ -32,20 +32,20 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * (`OutputOnly`) * The current state of the instance. * * Generated from protobuf field .google.bigtable.admin.v2.Instance.State state = 3; */ - private $state = 0; + protected $state = 0; /** * The type of the instance. Defaults to `PRODUCTION`. * * Generated from protobuf field .google.bigtable.admin.v2.Instance.Type type = 4; */ - private $type = 0; + protected $type = 0; /** * Labels are a flexible and lightweight mechanism for organizing cloud * resources into groups that reflect a customer's organizational needs and @@ -68,13 +68,13 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Reserved for future use. * * Generated from protobuf field optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $satisfies_pzs = null; + protected $satisfies_pzs = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Instance_State.php b/Bigtable/src/Admin/V2/Instance_State.php deleted file mode 100644 index 859a38d93cdd..000000000000 --- a/Bigtable/src/Admin/V2/Instance_State.php +++ /dev/null @@ -1,16 +0,0 @@ -string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Maximum number of results per page. * A page_size of zero lets the server choose the number of items to return. @@ -36,13 +36,13 @@ class ListAppProfilesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * The value of `next_page_token` returned by a previous call. * * Generated from protobuf field string page_token = 2; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The unique name of the instance for which a list of app profiles diff --git a/Bigtable/src/Admin/V2/ListAppProfilesResponse.php b/Bigtable/src/Admin/V2/ListAppProfilesResponse.php index e3580387207f..c49770b40a07 100644 --- a/Bigtable/src/Admin/V2/ListAppProfilesResponse.php +++ b/Bigtable/src/Admin/V2/ListAppProfilesResponse.php @@ -28,7 +28,7 @@ class ListAppProfilesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations from which AppProfile information could not be retrieved, * due to an outage or some other transient condition. diff --git a/Bigtable/src/Admin/V2/ListAuthorizedViewsRequest.php b/Bigtable/src/Admin/V2/ListAuthorizedViewsRequest.php index 02e566a938e8..4a02cb12c2c3 100644 --- a/Bigtable/src/Admin/V2/ListAuthorizedViewsRequest.php +++ b/Bigtable/src/Admin/V2/ListAuthorizedViewsRequest.php @@ -23,7 +23,7 @@ class ListAuthorizedViewsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of results per page. * A page_size of zero lets the server choose the number of items to return. @@ -35,20 +35,20 @@ class ListAuthorizedViewsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. The value of `next_page_token` returned by a previous call. * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The resource_view to be applied to the returned views' fields. * Default to NAME_ONLY. * * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $parent Required. The unique name of the table for which AuthorizedViews should be diff --git a/Bigtable/src/Admin/V2/ListAuthorizedViewsResponse.php b/Bigtable/src/Admin/V2/ListAuthorizedViewsResponse.php index e143146f2344..83d26b843966 100644 --- a/Bigtable/src/Admin/V2/ListAuthorizedViewsResponse.php +++ b/Bigtable/src/Admin/V2/ListAuthorizedViewsResponse.php @@ -29,7 +29,7 @@ class ListAuthorizedViewsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/ListBackupsRequest.php b/Bigtable/src/Admin/V2/ListBackupsRequest.php index 6db24178e80a..6f5666e3bdbd 100644 --- a/Bigtable/src/Admin/V2/ListBackupsRequest.php +++ b/Bigtable/src/Admin/V2/ListBackupsRequest.php @@ -24,7 +24,7 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * A filter expression that filters backups listed in the response. * The expression must specify the field name, a comparison operator, @@ -57,7 +57,7 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * An expression for specifying the sort order of the results of the request. * The string value should specify one or more fields in @@ -80,14 +80,14 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 3; */ - private $order_by = ''; + protected $order_by = ''; /** * Number of backups to be returned in the response. If 0 or * less, defaults to the server's maximum allowed page size. * * Generated from protobuf field int32 page_size = 4; */ - private $page_size = 0; + protected $page_size = 0; /** * If non-empty, `page_token` should contain a * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token] @@ -97,7 +97,7 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 5; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The cluster to list backups from. Values are of the diff --git a/Bigtable/src/Admin/V2/ListBackupsResponse.php b/Bigtable/src/Admin/V2/ListBackupsResponse.php index 023795edd043..c9792bd915b6 100644 --- a/Bigtable/src/Admin/V2/ListBackupsResponse.php +++ b/Bigtable/src/Admin/V2/ListBackupsResponse.php @@ -29,7 +29,7 @@ class ListBackupsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/ListClustersRequest.php b/Bigtable/src/Admin/V2/ListClustersRequest.php index 8376ed2de6bb..00a12138e516 100644 --- a/Bigtable/src/Admin/V2/ListClustersRequest.php +++ b/Bigtable/src/Admin/V2/ListClustersRequest.php @@ -24,13 +24,13 @@ class ListClustersRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * DEPRECATED: This field is unused and ignored. * * Generated from protobuf field string page_token = 2; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The unique name of the instance for which a list of clusters is diff --git a/Bigtable/src/Admin/V2/ListClustersResponse.php b/Bigtable/src/Admin/V2/ListClustersResponse.php index 55159e1a95cc..84ccf514aa70 100644 --- a/Bigtable/src/Admin/V2/ListClustersResponse.php +++ b/Bigtable/src/Admin/V2/ListClustersResponse.php @@ -36,7 +36,7 @@ class ListClustersResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 3; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/ListHotTabletsRequest.php b/Bigtable/src/Admin/V2/ListHotTabletsRequest.php index 7a6eebbbdfec..2fcefef12c29 100644 --- a/Bigtable/src/Admin/V2/ListHotTabletsRequest.php +++ b/Bigtable/src/Admin/V2/ListHotTabletsRequest.php @@ -22,7 +22,7 @@ class ListHotTabletsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The start time to list hot tablets. The hot tablets in the response will * have start times between the requested start time and end time. Start time @@ -33,13 +33,13 @@ class ListHotTabletsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; */ - private $start_time = null; + protected $start_time = null; /** * The end time to list hot tablets. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; */ - private $end_time = null; + protected $end_time = null; /** * Maximum number of results per page. * A page_size that is empty or zero lets the server choose the number of @@ -51,13 +51,13 @@ class ListHotTabletsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 4; */ - private $page_size = 0; + protected $page_size = 0; /** * The value of `next_page_token` returned by a previous call. * * Generated from protobuf field string page_token = 5; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The cluster name to list hot tablets. diff --git a/Bigtable/src/Admin/V2/ListHotTabletsResponse.php b/Bigtable/src/Admin/V2/ListHotTabletsResponse.php index 92391aae5db3..39b6a733dade 100644 --- a/Bigtable/src/Admin/V2/ListHotTabletsResponse.php +++ b/Bigtable/src/Admin/V2/ListHotTabletsResponse.php @@ -32,7 +32,7 @@ class ListHotTabletsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/ListInstancesRequest.php b/Bigtable/src/Admin/V2/ListInstancesRequest.php index e87c9af9c131..e0d88b2803fa 100644 --- a/Bigtable/src/Admin/V2/ListInstancesRequest.php +++ b/Bigtable/src/Admin/V2/ListInstancesRequest.php @@ -21,13 +21,13 @@ class ListInstancesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * DEPRECATED: This field is unused and ignored. * * Generated from protobuf field string page_token = 2; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The unique name of the project for which a list of instances is diff --git a/Bigtable/src/Admin/V2/ListInstancesResponse.php b/Bigtable/src/Admin/V2/ListInstancesResponse.php index c9d8c6c2d262..6e08425dbe3e 100644 --- a/Bigtable/src/Admin/V2/ListInstancesResponse.php +++ b/Bigtable/src/Admin/V2/ListInstancesResponse.php @@ -37,7 +37,7 @@ class ListInstancesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 3; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/ListSnapshotsRequest.php b/Bigtable/src/Admin/V2/ListSnapshotsRequest.php index 49e1998d96e0..5ee84a207816 100644 --- a/Bigtable/src/Admin/V2/ListSnapshotsRequest.php +++ b/Bigtable/src/Admin/V2/ListSnapshotsRequest.php @@ -29,20 +29,20 @@ class ListSnapshotsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of snapshots to return per page. * CURRENTLY UNIMPLEMENTED AND IGNORED. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The value of `next_page_token` returned by a previous call. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The unique name of the cluster for which snapshots should be diff --git a/Bigtable/src/Admin/V2/ListSnapshotsResponse.php b/Bigtable/src/Admin/V2/ListSnapshotsResponse.php index 82136fba1330..c3d9df13f7e0 100644 --- a/Bigtable/src/Admin/V2/ListSnapshotsResponse.php +++ b/Bigtable/src/Admin/V2/ListSnapshotsResponse.php @@ -33,7 +33,7 @@ class ListSnapshotsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/ListTablesRequest.php b/Bigtable/src/Admin/V2/ListTablesRequest.php index 201df5423914..d10580296a66 100644 --- a/Bigtable/src/Admin/V2/ListTablesRequest.php +++ b/Bigtable/src/Admin/V2/ListTablesRequest.php @@ -22,14 +22,14 @@ class ListTablesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The view to be applied to the returned tables' fields. * NAME_ONLY view (default) and REPLICATION_VIEW are supported. * * Generated from protobuf field .google.bigtable.admin.v2.Table.View view = 2; */ - private $view = 0; + protected $view = 0; /** * Maximum number of results per page. * A page_size of zero lets the server choose the number of items to return. @@ -41,13 +41,13 @@ class ListTablesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 4; */ - private $page_size = 0; + protected $page_size = 0; /** * The value of `next_page_token` returned by a previous call. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The unique name of the instance for which tables should be diff --git a/Bigtable/src/Admin/V2/ListTablesResponse.php b/Bigtable/src/Admin/V2/ListTablesResponse.php index efdcb1c3e898..1dac80ef82f5 100644 --- a/Bigtable/src/Admin/V2/ListTablesResponse.php +++ b/Bigtable/src/Admin/V2/ListTablesResponse.php @@ -29,7 +29,7 @@ class ListTablesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest.php b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest.php index e7d4d8ff7bd4..8960e4680f7d 100644 --- a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest.php +++ b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest.php @@ -23,7 +23,7 @@ class ModifyColumnFamiliesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. Modifications to be atomically applied to the specified table's * families. Entries are applied in order, meaning that earlier modifications @@ -38,7 +38,7 @@ class ModifyColumnFamiliesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $ignore_warnings = false; + protected $ignore_warnings = false; /** * @param string $name Required. The unique name of the table whose families should be modified. diff --git a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest/Modification.php b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest/Modification.php index 0886bfccdd8f..0675f7d22032 100644 --- a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest/Modification.php +++ b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest/Modification.php @@ -20,7 +20,7 @@ class Modification extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update` * mod should be updated, ignored for other modification types. If unset or @@ -28,7 +28,7 @@ class Modification extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; protected $mod; /** diff --git a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest_Modification.php b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest_Modification.php deleted file mode 100644 index ff3e5589863d..000000000000 --- a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest_Modification.php +++ /dev/null @@ -1,16 +0,0 @@ -int32 progress_percent = 1; */ - private $progress_percent = 0; + protected $progress_percent = 0; /** * Time the request was received. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; */ - private $start_time = null; + protected $start_time = null; /** * If set, the time at which this operation failed or was completed * successfully. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/OptimizeRestoredTableMetadata.php b/Bigtable/src/Admin/V2/OptimizeRestoredTableMetadata.php index 7c17e6ceff38..6a51fb65bbe8 100644 --- a/Bigtable/src/Admin/V2/OptimizeRestoredTableMetadata.php +++ b/Bigtable/src/Admin/V2/OptimizeRestoredTableMetadata.php @@ -23,13 +23,13 @@ class OptimizeRestoredTableMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The progress of the post-restore optimizations. * * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 2; */ - private $progress = null; + protected $progress = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/PartialUpdateClusterMetadata.php b/Bigtable/src/Admin/V2/PartialUpdateClusterMetadata.php index 613219b35f73..60d2f7c47f64 100644 --- a/Bigtable/src/Admin/V2/PartialUpdateClusterMetadata.php +++ b/Bigtable/src/Admin/V2/PartialUpdateClusterMetadata.php @@ -20,19 +20,19 @@ class PartialUpdateClusterMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp request_time = 1; */ - private $request_time = null; + protected $request_time = null; /** * The time at which the operation failed or was completed successfully. * * Generated from protobuf field .google.protobuf.Timestamp finish_time = 2; */ - private $finish_time = null; + protected $finish_time = null; /** * The original request for PartialUpdateCluster. * * Generated from protobuf field .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; */ - private $original_request = null; + protected $original_request = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/PartialUpdateClusterRequest.php b/Bigtable/src/Admin/V2/PartialUpdateClusterRequest.php index d9d6c1483e99..c5cb2b443eef 100644 --- a/Bigtable/src/Admin/V2/PartialUpdateClusterRequest.php +++ b/Bigtable/src/Admin/V2/PartialUpdateClusterRequest.php @@ -21,13 +21,13 @@ class PartialUpdateClusterRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $cluster = null; + protected $cluster = null; /** * Required. The subset of Cluster fields which should be replaced. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\Bigtable\Admin\V2\Cluster $cluster Required. The Cluster which contains the partial updates to be applied, diff --git a/Bigtable/src/Admin/V2/PartialUpdateInstanceRequest.php b/Bigtable/src/Admin/V2/PartialUpdateInstanceRequest.php index 8324d4d0daec..91e4ac7d79eb 100644 --- a/Bigtable/src/Admin/V2/PartialUpdateInstanceRequest.php +++ b/Bigtable/src/Admin/V2/PartialUpdateInstanceRequest.php @@ -20,14 +20,14 @@ class PartialUpdateInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance = null; + protected $instance = null; /** * Required. The subset of Instance fields which should be replaced. * Must be explicitly set. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\Bigtable\Admin\V2\Instance $instance Required. The Instance which will (partially) replace the current value. diff --git a/Bigtable/src/Admin/V2/RestoreInfo.php b/Bigtable/src/Admin/V2/RestoreInfo.php index f4727ceb5280..d470c27dc7b8 100644 --- a/Bigtable/src/Admin/V2/RestoreInfo.php +++ b/Bigtable/src/Admin/V2/RestoreInfo.php @@ -20,7 +20,7 @@ class RestoreInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.RestoreSourceType source_type = 1; */ - private $source_type = 0; + protected $source_type = 0; protected $source_info; /** diff --git a/Bigtable/src/Admin/V2/RestoreTableMetadata.php b/Bigtable/src/Admin/V2/RestoreTableMetadata.php index f5957fb7951f..c487dd2c61b1 100644 --- a/Bigtable/src/Admin/V2/RestoreTableMetadata.php +++ b/Bigtable/src/Admin/V2/RestoreTableMetadata.php @@ -21,13 +21,13 @@ class RestoreTableMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The type of the restore source. * * Generated from protobuf field .google.bigtable.admin.v2.RestoreSourceType source_type = 2; */ - private $source_type = 0; + protected $source_type = 0; /** * If exists, the name of the long-running operation that will be used to * track the post-restore optimization process to optimize the performance of @@ -41,7 +41,7 @@ class RestoreTableMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string optimize_table_operation_name = 4; */ - private $optimize_table_operation_name = ''; + protected $optimize_table_operation_name = ''; /** * The progress of the * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] @@ -49,7 +49,7 @@ class RestoreTableMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.OperationProgress progress = 5; */ - private $progress = null; + protected $progress = null; protected $source_info; /** diff --git a/Bigtable/src/Admin/V2/RestoreTableRequest.php b/Bigtable/src/Admin/V2/RestoreTableRequest.php index 00a80fdfaf6e..abdc023aa9c7 100644 --- a/Bigtable/src/Admin/V2/RestoreTableRequest.php +++ b/Bigtable/src/Admin/V2/RestoreTableRequest.php @@ -22,7 +22,7 @@ class RestoreTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The id of the table to create and restore to. This * table must not already exist. The `table_id` appended to @@ -31,7 +31,7 @@ class RestoreTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $table_id = ''; + protected $table_id = ''; protected $source; /** diff --git a/Bigtable/src/Admin/V2/Snapshot.php b/Bigtable/src/Admin/V2/Snapshot.php index 07ca6e32aa54..ed150a235f5b 100644 --- a/Bigtable/src/Admin/V2/Snapshot.php +++ b/Bigtable/src/Admin/V2/Snapshot.php @@ -27,13 +27,13 @@ class Snapshot extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Output only. The source table at the time the snapshot was taken. * * Generated from protobuf field .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $source_table = null; + protected $source_table = null; /** * Output only. The size of the data in the source table at the time the * snapshot was taken. In some cases, this value may be computed @@ -42,13 +42,13 @@ class Snapshot extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $data_size_bytes = 0; + protected $data_size_bytes = 0; /** * Output only. The time when the snapshot is created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * The time when the snapshot will be deleted. The maximum amount of time a * snapshot can stay active is 365 days. If 'ttl' is not specified, @@ -56,19 +56,19 @@ class Snapshot extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; */ - private $delete_time = null; + protected $delete_time = null; /** * Output only. The current state of the snapshot. * * Generated from protobuf field .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Description of the snapshot. * * Generated from protobuf field string description = 7; */ - private $description = ''; + protected $description = ''; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/SnapshotTableMetadata.php b/Bigtable/src/Admin/V2/SnapshotTableMetadata.php index dc35add98b90..62d29e1d1bfa 100644 --- a/Bigtable/src/Admin/V2/SnapshotTableMetadata.php +++ b/Bigtable/src/Admin/V2/SnapshotTableMetadata.php @@ -24,19 +24,19 @@ class SnapshotTableMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; */ - private $original_request = null; + protected $original_request = null; /** * The time at which the original request was received. * * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; */ - private $request_time = null; + protected $request_time = null; /** * The time at which the operation failed or was completed successfully. * * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; */ - private $finish_time = null; + protected $finish_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/SnapshotTableRequest.php b/Bigtable/src/Admin/V2/SnapshotTableRequest.php index 4d11a8f8390e..007e4b8c67ae 100644 --- a/Bigtable/src/Admin/V2/SnapshotTableRequest.php +++ b/Bigtable/src/Admin/V2/SnapshotTableRequest.php @@ -27,7 +27,7 @@ class SnapshotTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The name of the cluster where the snapshot will be created in. * Values are of the form @@ -35,7 +35,7 @@ class SnapshotTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $cluster = ''; + protected $cluster = ''; /** * Required. The ID by which the new snapshot should be referred to within the * parent cluster, e.g., `mysnapshot` of the form: @@ -44,7 +44,7 @@ class SnapshotTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $snapshot_id = ''; + protected $snapshot_id = ''; /** * The amount of time that the new snapshot can stay active after it is * created. Once 'ttl' expires, the snapshot will get deleted. The maximum @@ -53,13 +53,13 @@ class SnapshotTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration ttl = 4; */ - private $ttl = null; + protected $ttl = null; /** * Description of the snapshot. * * Generated from protobuf field string description = 5; */ - private $description = ''; + protected $description = ''; /** * @param string $name Required. The unique name of the table to have the snapshot taken. diff --git a/Bigtable/src/Admin/V2/Snapshot_State.php b/Bigtable/src/Admin/V2/Snapshot_State.php deleted file mode 100644 index 6dad2fe7d1b7..000000000000 --- a/Bigtable/src/Admin/V2/Snapshot_State.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1; */ - private $name = ''; + protected $name = ''; /** * Output only. Map from cluster ID to per-cluster table state. * If it could not be determined whether or not the table has data in a @@ -49,14 +49,14 @@ class Table extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $granularity = 0; + protected $granularity = 0; /** * Output only. If this table was restored from another data source (e.g. a * backup), this field will be populated with information about the restore. * * Generated from protobuf field .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $restore_info = null; + protected $restore_info = null; /** * If specified, enable the change stream on this table. * Otherwise, the change stream is disabled and the change stream is not @@ -64,7 +64,7 @@ class Table extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - private $change_stream_config = null; + protected $change_stream_config = null; /** * Set to true to make the table protected against data loss. i.e. deleting * the following resources through Admin APIs are prohibited: @@ -75,7 +75,7 @@ class Table extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool deletion_protection = 9; */ - private $deletion_protection = false; + protected $deletion_protection = false; protected $automated_backup_config; /** diff --git a/Bigtable/src/Admin/V2/Table/AutomatedBackupPolicy.php b/Bigtable/src/Admin/V2/Table/AutomatedBackupPolicy.php index 77c2510af299..4befbef5a7dd 100644 --- a/Bigtable/src/Admin/V2/Table/AutomatedBackupPolicy.php +++ b/Bigtable/src/Admin/V2/Table/AutomatedBackupPolicy.php @@ -21,14 +21,14 @@ class AutomatedBackupPolicy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $retention_period = null; + protected $retention_period = null; /** * Required. How frequently automated backups should occur. The only * supported value at this time is 24 hours. * * Generated from protobuf field .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $frequency = null; + protected $frequency = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Table/ClusterState.php b/Bigtable/src/Admin/V2/Table/ClusterState.php index 73db21ce54c4..73802c4ea588 100644 --- a/Bigtable/src/Admin/V2/Table/ClusterState.php +++ b/Bigtable/src/Admin/V2/Table/ClusterState.php @@ -20,7 +20,7 @@ class ClusterState extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $replication_state = 0; + protected $replication_state = 0; /** * Output only. The encryption information for the table in this cluster. * If the encryption key protecting this resource is customer managed, then diff --git a/Bigtable/src/Admin/V2/Table_ClusterState.php b/Bigtable/src/Admin/V2/Table_ClusterState.php deleted file mode 100644 index 22d77c472d08..000000000000 --- a/Bigtable/src/Admin/V2/Table_ClusterState.php +++ /dev/null @@ -1,16 +0,0 @@ - INT64(-1), but STRING("-00001") > STRING("00001). - * - The overall encoding chain sorts naturally if *every* link does. + * - The overall encoding chain has this property if *every* link does. * * Self-delimiting: If we concatenate two encoded values, can we always tell * where the first one ends and the second one begins? * - Example: If we encode INT64s to fixed-width STRINGs, the first value * will always contain exactly N digits, possibly preceded by a sign. * - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have * no way to tell where the first one ends. - * - The overall encoding chain is self-delimiting if *any* link is. + * - The overall encoding chain has this property if *any* link does. * * Compatibility: Which other systems have matching encoding schemes? For * example, does this encoding have a GoogleSQL equivalent? HBase? Java? * @@ -51,6 +51,8 @@ class Type extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\Bigtable\Admin\V2\Type\Bytes $bytes_type * Bytes + * @type \Google\Cloud\Bigtable\Admin\V2\Type\PBString $string_type + * String * @type \Google\Cloud\Bigtable\Admin\V2\Type\Int64 $int64_type * Int64 * @type \Google\Cloud\Bigtable\Admin\V2\Type\Aggregate $aggregate_type @@ -93,6 +95,37 @@ public function setBytesType($var) return $this; } + /** + * String + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String string_type = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\PBString|null + */ + public function getStringType() + { + return $this->readOneof(2); + } + + public function hasStringType() + { + return $this->hasOneof(2); + } + + /** + * String + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String string_type = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\PBString $var + * @return $this + */ + public function setStringType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\PBString::class); + $this->writeOneof(2, $var); + + return $this; + } + /** * Int64 * diff --git a/Bigtable/src/Admin/V2/Type/Aggregate.php b/Bigtable/src/Admin/V2/Type/Aggregate.php index b8d2747badb0..bfa2b8e74343 100644 --- a/Bigtable/src/Admin/V2/Type/Aggregate.php +++ b/Bigtable/src/Admin/V2/Type/Aggregate.php @@ -25,7 +25,7 @@ class Aggregate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Type input_type = 1; */ - private $input_type = null; + protected $input_type = null; /** * Output only. Type that holds the internal accumulator state for the * `Aggregate`. This is a function of the `input_type` and `aggregator` @@ -33,7 +33,7 @@ class Aggregate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_type = null; + protected $state_type = null; protected $aggregator; /** diff --git a/Bigtable/src/Admin/V2/Type/Bytes.php b/Bigtable/src/Admin/V2/Type/Bytes.php index 02a0e4454513..8bd21135affc 100644 --- a/Bigtable/src/Admin/V2/Type/Bytes.php +++ b/Bigtable/src/Admin/V2/Type/Bytes.php @@ -21,7 +21,7 @@ class Bytes extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; */ - private $encoding = null; + protected $encoding = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Type/Int64.php b/Bigtable/src/Admin/V2/Type/Int64.php index cdc02b870421..90641966f566 100644 --- a/Bigtable/src/Admin/V2/Type/Int64.php +++ b/Bigtable/src/Admin/V2/Type/Int64.php @@ -21,7 +21,7 @@ class Int64 extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; */ - private $encoding = null; + protected $encoding = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Type/Int64/Encoding/BigEndianBytes.php b/Bigtable/src/Admin/V2/Type/Int64/Encoding/BigEndianBytes.php index 4d45c8bd7cdb..a758e28bb91d 100644 --- a/Bigtable/src/Admin/V2/Type/Int64/Encoding/BigEndianBytes.php +++ b/Bigtable/src/Admin/V2/Type/Int64/Encoding/BigEndianBytes.php @@ -27,7 +27,7 @@ class BigEndianBytes extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; */ - private $bytes_type = null; + protected $bytes_type = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/Type/PBString.php b/Bigtable/src/Admin/V2/Type/PBString.php new file mode 100644 index 000000000000..dec7bacd8182 --- /dev/null +++ b/Bigtable/src/Admin/V2/Type/PBString.php @@ -0,0 +1,81 @@ +google.bigtable.admin.v2.Type.String + */ +class PBString extends \Google\Protobuf\Internal\Message +{ + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + protected $encoding = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding $encoding + * The encoding to use when converting to/from lower level types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding|null + */ + public function getEncoding() + { + return $this->encoding; + } + + public function hasEncoding() + { + return isset($this->encoding); + } + + public function clearEncoding() + { + unset($this->encoding); + } + + /** + * The encoding to use when converting to/from lower level types. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding $var + * @return $this + */ + public function setEncoding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding::class); + $this->encoding = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBString::class, \Google\Cloud\Bigtable\Admin\V2\Type_String::class); + diff --git a/Bigtable/src/Admin/V2/Type/PBString/Encoding.php b/Bigtable/src/Admin/V2/Type/PBString/Encoding.php new file mode 100644 index 000000000000..fd1365320bf9 --- /dev/null +++ b/Bigtable/src/Admin/V2/Type/PBString/Encoding.php @@ -0,0 +1,78 @@ +google.bigtable.admin.v2.Type.String.Encoding + */ +class Encoding extends \Google\Protobuf\Internal\Message +{ + protected $encoding; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Raw $utf8_raw + * Use `Utf8Raw` encoding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + + /** + * Use `Utf8Raw` encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1; + * @return \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Raw|null + */ + public function getUtf8Raw() + { + return $this->readOneof(1); + } + + public function hasUtf8Raw() + { + return $this->hasOneof(1); + } + + /** + * Use `Utf8Raw` encoding. + * + * Generated from protobuf field .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Raw $var + * @return $this + */ + public function setUtf8Raw($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\Type\PBString\Encoding\Utf8Raw::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getEncoding() + { + return $this->whichOneof("encoding"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Encoding::class, \Google\Cloud\Bigtable\Admin\V2\Type_String_Encoding::class); + diff --git a/Bigtable/src/Admin/V2/Type/PBString/Encoding/Utf8Raw.php b/Bigtable/src/Admin/V2/Type/PBString/Encoding/Utf8Raw.php new file mode 100644 index 000000000000..a474b3f01b72 --- /dev/null +++ b/Bigtable/src/Admin/V2/Type/PBString/Encoding/Utf8Raw.php @@ -0,0 +1,42 @@ +google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + */ +class Utf8Raw extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Types::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Utf8Raw::class, \Google\Cloud\Bigtable\Admin\V2\Type_String_Encoding_Utf8Raw::class); + diff --git a/Bigtable/src/Admin/V2/UndeleteTableMetadata.php b/Bigtable/src/Admin/V2/UndeleteTableMetadata.php index a92d928bc943..b847a234a946 100644 --- a/Bigtable/src/Admin/V2/UndeleteTableMetadata.php +++ b/Bigtable/src/Admin/V2/UndeleteTableMetadata.php @@ -21,19 +21,19 @@ class UndeleteTableMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The time at which this operation started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; */ - private $start_time = null; + protected $start_time = null; /** * If set, the time at which this operation finished or was cancelled. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/UndeleteTableRequest.php b/Bigtable/src/Admin/V2/UndeleteTableRequest.php index 81af8d6ec506..d3ead7ced6a2 100644 --- a/Bigtable/src/Admin/V2/UndeleteTableRequest.php +++ b/Bigtable/src/Admin/V2/UndeleteTableRequest.php @@ -23,7 +23,7 @@ class UndeleteTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The unique name of the table to be restored. diff --git a/Bigtable/src/Admin/V2/UpdateAppProfileRequest.php b/Bigtable/src/Admin/V2/UpdateAppProfileRequest.php index 88e6a951b68f..5933bed32b54 100644 --- a/Bigtable/src/Admin/V2/UpdateAppProfileRequest.php +++ b/Bigtable/src/Admin/V2/UpdateAppProfileRequest.php @@ -20,20 +20,20 @@ class UpdateAppProfileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $app_profile = null; + protected $app_profile = null; /** * Required. The subset of app profile fields which should be replaced. * If unset, all fields will be replaced. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * If true, ignore safety checks when updating the app profile. * * Generated from protobuf field bool ignore_warnings = 3; */ - private $ignore_warnings = false; + protected $ignore_warnings = false; /** * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile $appProfile Required. The app profile which will (partially) replace the current value. diff --git a/Bigtable/src/Admin/V2/UpdateAuthorizedViewMetadata.php b/Bigtable/src/Admin/V2/UpdateAuthorizedViewMetadata.php index 3133122f2298..1457fd96929c 100644 --- a/Bigtable/src/Admin/V2/UpdateAuthorizedViewMetadata.php +++ b/Bigtable/src/Admin/V2/UpdateAuthorizedViewMetadata.php @@ -22,19 +22,19 @@ class UpdateAuthorizedViewMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; */ - private $original_request = null; + protected $original_request = null; /** * The time at which the original request was received. * * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; */ - private $request_time = null; + protected $request_time = null; /** * The time at which the operation failed or was completed successfully. * * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; */ - private $finish_time = null; + protected $finish_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/UpdateAuthorizedViewRequest.php b/Bigtable/src/Admin/V2/UpdateAuthorizedViewRequest.php index 9616019d26d0..c5ba84b2314f 100644 --- a/Bigtable/src/Admin/V2/UpdateAuthorizedViewRequest.php +++ b/Bigtable/src/Admin/V2/UpdateAuthorizedViewRequest.php @@ -24,7 +24,7 @@ class UpdateAuthorizedViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $authorized_view = null; + protected $authorized_view = null; /** * Optional. The list of fields to update. * A mask specifying which fields in the AuthorizedView resource should be @@ -36,14 +36,14 @@ class UpdateAuthorizedViewRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * Optional. If true, ignore the safety checks when updating the * AuthorizedView. * * Generated from protobuf field bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $ignore_warnings = false; + protected $ignore_warnings = false; /** * @param \Google\Cloud\Bigtable\Admin\V2\AuthorizedView $authorizedView Required. The AuthorizedView to update. The `name` in `authorized_view` is diff --git a/Bigtable/src/Admin/V2/UpdateBackupRequest.php b/Bigtable/src/Admin/V2/UpdateBackupRequest.php index f4660b9f49d4..b450460b852b 100644 --- a/Bigtable/src/Admin/V2/UpdateBackupRequest.php +++ b/Bigtable/src/Admin/V2/UpdateBackupRequest.php @@ -24,7 +24,7 @@ class UpdateBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $backup = null; + protected $backup = null; /** * Required. A mask specifying which fields (e.g. `expire_time`) in the * Backup resource should be updated. This mask is relative to the Backup @@ -34,7 +34,7 @@ class UpdateBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\Bigtable\Admin\V2\Backup $backup Required. The backup to update. `backup.name`, and the fields to be updated diff --git a/Bigtable/src/Admin/V2/UpdateClusterMetadata.php b/Bigtable/src/Admin/V2/UpdateClusterMetadata.php index 4b684eb52957..09fcde08400d 100644 --- a/Bigtable/src/Admin/V2/UpdateClusterMetadata.php +++ b/Bigtable/src/Admin/V2/UpdateClusterMetadata.php @@ -20,19 +20,19 @@ class UpdateClusterMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Cluster original_request = 1; */ - private $original_request = null; + protected $original_request = null; /** * The time at which the original request was received. * * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; */ - private $request_time = null; + protected $request_time = null; /** * The time at which the operation failed or was completed successfully. * * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; */ - private $finish_time = null; + protected $finish_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/UpdateInstanceMetadata.php b/Bigtable/src/Admin/V2/UpdateInstanceMetadata.php index 1dd8a95843c8..5caa3d20f2a2 100644 --- a/Bigtable/src/Admin/V2/UpdateInstanceMetadata.php +++ b/Bigtable/src/Admin/V2/UpdateInstanceMetadata.php @@ -20,19 +20,19 @@ class UpdateInstanceMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; */ - private $original_request = null; + protected $original_request = null; /** * The time at which the original request was received. * * Generated from protobuf field .google.protobuf.Timestamp request_time = 2; */ - private $request_time = null; + protected $request_time = null; /** * The time at which the operation failed or was completed successfully. * * Generated from protobuf field .google.protobuf.Timestamp finish_time = 3; */ - private $finish_time = null; + protected $finish_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/UpdateTableMetadata.php b/Bigtable/src/Admin/V2/UpdateTableMetadata.php index 363254ade50c..ab407c9bfd1b 100644 --- a/Bigtable/src/Admin/V2/UpdateTableMetadata.php +++ b/Bigtable/src/Admin/V2/UpdateTableMetadata.php @@ -21,19 +21,19 @@ class UpdateTableMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The time at which this operation started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; */ - private $start_time = null; + protected $start_time = null; /** * If set, the time at which this operation finished or was canceled. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/Bigtable/src/Admin/V2/UpdateTableRequest.php b/Bigtable/src/Admin/V2/UpdateTableRequest.php index 2cd4ad6f4f14..17d6cb5e06e6 100644 --- a/Bigtable/src/Admin/V2/UpdateTableRequest.php +++ b/Bigtable/src/Admin/V2/UpdateTableRequest.php @@ -22,7 +22,7 @@ class UpdateTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $table = null; + protected $table = null; /** * Required. The list of fields to update. * A mask specifying which fields (e.g. `change_stream_config`) in the `table` @@ -37,7 +37,7 @@ class UpdateTableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\Bigtable\Admin\V2\Table $table Required. The table to update. diff --git a/Bigtable/src/Admin/V2/gapic_metadata.json b/Bigtable/src/Admin/V2/gapic_metadata.json new file mode 100644 index 000000000000..fecd9cc3d7ed --- /dev/null +++ b/Bigtable/src/Admin/V2/gapic_metadata.json @@ -0,0 +1,282 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.bigtable.admin.v2", + "libraryPackage": "Google\\Cloud\\Bigtable\\Admin\\V2", + "services": { + "BigtableInstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "BigtableInstanceAdminGapicClient", + "rpcs": { + "CreateAppProfile": { + "methods": [ + "createAppProfile" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteAppProfile": { + "methods": [ + "deleteAppProfile" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "GetAppProfile": { + "methods": [ + "getAppProfile" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ListAppProfiles": { + "methods": [ + "listAppProfiles" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "ListHotTablets": { + "methods": [ + "listHotTablets" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "PartialUpdateCluster": { + "methods": [ + "partialUpdateCluster" + ] + }, + "PartialUpdateInstance": { + "methods": [ + "partialUpdateInstance" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateAppProfile": { + "methods": [ + "updateAppProfile" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + } + } + } + } + }, + "BigtableTableAdmin": { + "clients": { + "grpc": { + "libraryClient": "BigtableTableAdminGapicClient", + "rpcs": { + "CheckConsistency": { + "methods": [ + "checkConsistency" + ] + }, + "CopyBackup": { + "methods": [ + "copyBackup" + ] + }, + "CreateAuthorizedView": { + "methods": [ + "createAuthorizedView" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "CreateTable": { + "methods": [ + "createTable" + ] + }, + "CreateTableFromSnapshot": { + "methods": [ + "createTableFromSnapshot" + ] + }, + "DeleteAuthorizedView": { + "methods": [ + "deleteAuthorizedView" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "DeleteSnapshot": { + "methods": [ + "deleteSnapshot" + ] + }, + "DeleteTable": { + "methods": [ + "deleteTable" + ] + }, + "DropRowRange": { + "methods": [ + "dropRowRange" + ] + }, + "GenerateConsistencyToken": { + "methods": [ + "generateConsistencyToken" + ] + }, + "GetAuthorizedView": { + "methods": [ + "getAuthorizedView" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetSnapshot": { + "methods": [ + "getSnapshot" + ] + }, + "GetTable": { + "methods": [ + "getTable" + ] + }, + "ListAuthorizedViews": { + "methods": [ + "listAuthorizedViews" + ] + }, + "ListBackups": { + "methods": [ + "listBackups" + ] + }, + "ListSnapshots": { + "methods": [ + "listSnapshots" + ] + }, + "ListTables": { + "methods": [ + "listTables" + ] + }, + "ModifyColumnFamilies": { + "methods": [ + "modifyColumnFamilies" + ] + }, + "RestoreTable": { + "methods": [ + "restoreTable" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SnapshotTable": { + "methods": [ + "snapshotTable" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UndeleteTable": { + "methods": [ + "undeleteTable" + ] + }, + "UpdateAuthorizedView": { + "methods": [ + "updateAuthorizedView" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "UpdateTable": { + "methods": [ + "updateTable" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Bigtable/src/BigtableClient.php b/Bigtable/src/BigtableClient.php index 306fb40bcfee..7bca91745c72 100644 --- a/Bigtable/src/BigtableClient.php +++ b/Bigtable/src/BigtableClient.php @@ -21,8 +21,12 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; -use Google\Cloud\Bigtable\V2\BigtableClient as GapicClient; -use Google\Cloud\Core\ArrayTrait; +use Google\ApiCore\ArrayTrait; +use Google\ApiCore\ClientOptionsTrait; +use Google\ApiCore\Serializer; +use Google\Cloud\Bigtable\V2\Client\BigtableClient as GapicClient; +use Google\Cloud\Core\DetectProjectIdTrait; +use Google\Cloud\Core\RequestHandler; /** * Google Cloud Bigtable is Google's NoSQL Big Data database service. @@ -39,8 +43,8 @@ class BigtableClient { use ArrayTrait; - - const VERSION = '1.31.0'; + use DetectProjectIdTrait; + use ClientOptionsTrait; /** * @var GapicClient @@ -48,9 +52,9 @@ class BigtableClient private $gapicClient; /** - * @var string + * @var Serializer */ - private $projectId; + private Serializer $serializer; /** * Create a Bigtable client. @@ -122,8 +126,16 @@ public function __construct(array $config = []) 'grpc.keepalive_timeout_ms' => 10000 ]; - $this->projectId = $this->pluck('projectId', $config, false) - ?: $this->detectProjectId(); + // Configure GAPIC client options + $detectProjectIdConfig = $this->buildClientOptions($config); + $detectProjectIdConfig['credentials'] = $this->createCredentialsWrapper( + $detectProjectIdConfig['credentials'], + $detectProjectIdConfig['credentialsConfig'], + $detectProjectIdConfig['universeDomain'] + ); + + $this->projectId = $this->detectProjectId($detectProjectIdConfig); + $this->serializer = new Serializer(); $this->gapicClient = new GapicClient($config); } @@ -151,31 +163,9 @@ public function table($instanceId, $tableId, array $options = []) { return new Table( $this->gapicClient, + $this->serializer, GapicClient::tableName($this->projectId, $instanceId, $tableId), $options ); } - - /** - * Attempts to detect the project ID. - * - * @todo Add better support for detecting the project ID (check keyFile/GCE metadata server). - * @return string - * @throws ValidationException If a project ID cannot be detected. - */ - private function detectProjectId() - { - if (getenv('GOOGLE_CLOUD_PROJECT')) { - return getenv('GOOGLE_CLOUD_PROJECT'); - } - - if (getenv('GCLOUD_PROJECT')) { - return getenv('GCLOUD_PROJECT'); - } - - throw new ValidationException( - 'No project ID was provided, ' . - 'and we were unable to detect a default project ID.' - ); - } } diff --git a/Bigtable/src/ChunkFormatter.php b/Bigtable/src/ChunkFormatter.php index 9a9fb1372f9f..af7ffc441292 100644 --- a/Bigtable/src/ChunkFormatter.php +++ b/Bigtable/src/ChunkFormatter.php @@ -17,11 +17,14 @@ namespace Google\Cloud\Bigtable; +use Google\ApiCore\ArrayTrait; use Google\Cloud\Bigtable\Exception\BigtableDataOperationException; +use Google\Cloud\Bigtable\V2\ReadRowsRequest; use Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk; use Google\Cloud\Bigtable\V2\RowRange; use Google\Cloud\Bigtable\V2\RowSet; -use Google\Cloud\Core\ArrayTrait; +use Google\Protobuf\Internal\Message; +use Google\Cloud\Bigtable\V2\Client\BigtableClient as GapicClient; /** * Converts cell chunks into an easily digestable format. Please note this class @@ -50,6 +53,20 @@ class ChunkFormatter implements \IteratorAggregate 'CELL_IN_PROGRESS' => 3, ]; + // When we use ChunkFormatter, we know that we always + // need to readRows. + private const GAPIC_CLIENT_METHOD = 'readRows'; + + /** + * @var GapicClient + */ + private $gapicClient; + + /** + * @var Message + */ + private $request; + /** * @var string */ @@ -113,34 +130,46 @@ class ChunkFormatter implements \IteratorAggregate /** * Constructs the ChunkFormatter. * - * @param callable $readRowsCall A callable which executes a read rows call and returns a stream. - * @param string $tableName The table name used for the read rows call. + * @param GapicClient $gapicClient The GAPIC client to use in order to send requests. + * @param ReadRowsRequest $request The proto request to be passed to the Gapic client. * @param array $options [optional] Configuration options for read rows call. */ - public function __construct(callable $readRowsCall, $tableName, array $options = []) - { - $this->tableName = $tableName; + public function __construct( + GapicClient $gapicClient, + ReadRowsRequest $request, + array $options = [] + ) { + $this->gapicClient = $gapicClient; + $this->request = $request; $this->options = $options; - if (isset($options['rowsLimit'])) { - $this->originalRowsLimit = $options['rowsLimit']; + + if ($request->getRowsLimit()) { + $this->originalRowsLimit = $request->getRowsLimit(); } + + $argumentFunction = function ($request, $options) { + $prevRowKey = $this->prevRowKey; + $this->reset(); + if ($prevRowKey) { + list($request, $options) = $this->updateReadRowsRequest($request, $options, $prevRowKey); + } + return [$request, $options]; + }; + + $retryFunction = function ($ex) { + if ($ex && ResumableStream::isRetryable($ex->getCode())) { + return true; + } + return false; + }; + $this->stream = new ResumableStream( - $readRowsCall, - function () { - $prevRowKey = $this->prevRowKey; - $this->reset(); - if ($prevRowKey) { - $this->updateOptions($prevRowKey); - } - return [$this->tableName, $this->options]; - }, - function ($ex) { - if ($ex && ResumableStream::isRetryable($ex->getCode())) { - return true; - } - return false; - }, - $this->pluck('retries', $this->options, false) + $this->gapicClient, + self::GAPIC_CLIENT_METHOD, + $request, + $argumentFunction, + $retryFunction, + $options ); } @@ -192,13 +221,17 @@ public function readAll() $this->onStreamEnd(); } - private function updateOptions($prevRowKey) + /** + * Helper to modify the request and the options in b/w retries. + */ + private function updateReadRowsRequest($request, $options, $prevRowKey) { if ($this->originalRowsLimit) { - $this->options['rowsLimit'] = $this->originalRowsLimit - $this->numberOfRowsRead; + $request->setRowsLimit($this->originalRowsLimit - $this->numberOfRowsRead); } - if (isset($this->options['rows'])) { - $rowSet = $this->options['rows']; + + if ($request->hasRows()) { + $rowSet = $request->getRows(); if (count($rowSet->getRowKeys()) > 0) { $rowKeys = []; foreach ($rowSet->getRowKeys() as $rowKey) { @@ -229,12 +262,14 @@ private function updateOptions($prevRowKey) // after all data is received causing empty rows to be sent in next retry // request resulting in a full table scan. if (empty($rowKeys) && empty($ranges)) { - $this->options['requestCompleted'] = true; + $options['requestCompleted'] = true; } } else { $range = (new RowRange)->setStartKeyOpen($prevRowKey); - $this->options['rows'] = (new RowSet)->setRowRanges([$range]); + $options['rows'] = (new RowSet)->setRowRanges([$range]); } + + return [$request, $options]; } /** diff --git a/Bigtable/src/ResumableStream.php b/Bigtable/src/ResumableStream.php index 8b169ce3ec38..597a8fa391a0 100644 --- a/Bigtable/src/ResumableStream.php +++ b/Bigtable/src/ResumableStream.php @@ -18,15 +18,21 @@ namespace Google\Cloud\Bigtable; use Google\ApiCore\ApiException; -use Google\Cloud\Core\ExponentialBackoff; +use Google\ApiCore\ArrayTrait; +use Google\ApiCore\RetrySettings; +use Google\Cloud\Bigtable\V2\Client\BigtableClient as GapicClient; +use Google\Protobuf\Internal\Message; use Google\Rpc\Code; /** * User stream which handles failure from upstream, retries if necessary and * provides single retrying user stream. + * @internal */ class ResumableStream implements \IteratorAggregate { + use ArrayTrait; + const DEFAULT_MAX_RETRIES = 3; /** @@ -44,9 +50,19 @@ class ResumableStream implements \IteratorAggregate private $retries; /** - * @var callable + * @var GapicClient + */ + private $gapicClient; + + /** + * @var Message */ - private $apiFunction; + private $request; + + /** + * @var string + */ + private $method; /** * @var callable @@ -58,26 +74,48 @@ class ResumableStream implements \IteratorAggregate */ private $retryFunction; + /** + * @var array + */ + private $callOptions; + /** * Constructs a resumable stream. * - * @param callable $apiFunction Function to execute to get server stream. Function signature - * should match: `function (...) : Google\ApiCore\ServerStream`. + * @param GapicClient $gapicClient The GAPIC client to use in order to send requests. + * @param string $method The method to call on the GAPIC client. + * @param Message $request The request to pass on to the GAPIC client method. * @param callable $argumentFunction Function which returns the argument to be used while * calling `$apiFunction`. * @param callable $retryFunction Function which determines whether to retry or not. - * @param int $retries [optional] Number of times to retry. **Defaults to** `3`. + * @param array $callOptions { + * @option RetrySettings|array $retrySettings { + * @option int $maxRetries Number of times to retry. **Defaults to** `3`. + * Only maxRetries works for RetrySettings in this API. + * } + * } */ public function __construct( - callable $apiFunction, + GapicClient $gapicClient, + string $method, + Message $request, callable $argumentFunction, callable $retryFunction, - $retries = self::DEFAULT_MAX_RETRIES + array $callOptions = [] ) { - $this->retries = $retries ?: self::DEFAULT_MAX_RETRIES; - $this->apiFunction = $apiFunction; + $this->gapicClient = $gapicClient; + $this->method = $method; + $this->request = $request; + $this->retries = $this->getMaxRetries($callOptions); $this->argumentFunction = $argumentFunction; $this->retryFunction = $retryFunction; + $this->callOptions = $callOptions; + // Disable GAX retries because we want to handle the retries here. + // Once GAX has the provision to modify request/args in between retries, + // we can re enable GAX's retries and use them completely. + $this->callOptions['retrySettings'] = [ + 'retriesEnabled' => false + ]; } /** @@ -93,9 +131,16 @@ public function readAll() $retryFunction = $this->retryFunction; do { $ex = null; - $args = $argumentFunction(); - if (!isset($args[1]['requestCompleted']) || $args[1]['requestCompleted'] !== true) { - $stream = $this->createExponentialBackoff()->execute($this->apiFunction, $args); + list($this->request, $this->callOptions) = $argumentFunction($this->request, $this->callOptions); + + $completed = $this->pluck('requestCompleted', $this->callOptions, false); + + if ($completed !== true) { + $stream = call_user_func_array( + [$this->gapicClient, $this->method], + [$this->request, $this->callOptions] + ); + try { foreach ($stream->readAll() as $item) { yield $item; @@ -132,13 +177,14 @@ public static function isRetryable($code) return isset(self::$retryableStatusCodes[$code]); } - private function createExponentialBackoff() + private function getMaxRetries(array $options) : int { - return new ExponentialBackoff( - $this->retries, - function ($ex) { - return self::isRetryable($ex->getCode()); - } - ); + $retrySettings = $options['retrySettings'] ?? []; + + if ($retrySettings instanceof RetrySettings) { + return $retrySettings->getMaxRetries(); + } + + return $retrySettings['maxRetries'] ?? ResumableStream::DEFAULT_MAX_RETRIES; } } diff --git a/Bigtable/src/Table.php b/Bigtable/src/Table.php index fe157fb9bc93..71d5d577f3cd 100644 --- a/Bigtable/src/Table.php +++ b/Bigtable/src/Table.php @@ -23,12 +23,19 @@ use Google\Cloud\Bigtable\Filter\FilterInterface; use Google\Cloud\Bigtable\Mutations; use Google\Cloud\Bigtable\ReadModifyWriteRowRules; -use Google\Cloud\Bigtable\V2\BigtableClient as GapicClient; use Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry; use Google\Cloud\Bigtable\V2\Row; use Google\Cloud\Bigtable\V2\RowRange; use Google\Cloud\Bigtable\V2\RowSet; -use Google\Cloud\Core\ArrayTrait; +use Google\ApiCore\ArrayTrait; +use Google\Cloud\Bigtable\V2\CheckAndMutateRowRequest; +use Google\Cloud\Bigtable\V2\Client\BigtableClient as GapicClient; +use Google\Cloud\Bigtable\V2\MutateRowRequest; +use Google\Cloud\Bigtable\V2\MutateRowsRequest; +use Google\Cloud\Bigtable\V2\ReadModifyWriteRowRequest; +use Google\Cloud\Bigtable\V2\ReadRowsRequest; +use Google\Cloud\Bigtable\V2\SampleRowKeysRequest; +use Google\Cloud\Core\ApiHelperTrait; use Google\Rpc\Code; /** @@ -46,6 +53,7 @@ class Table { use ArrayTrait; + use ApiHelperTrait; /** * @var GapicClient @@ -70,7 +78,8 @@ class Table /** * Create a table instance. * - * @param GapicClient $gapicClient The GAPIC client used to make requests. + * @param GapicClient $gapicClient The GAPIC client to use in order to send requests. + * @param Serializer $serializer The serializer instance to encode/decode messages. * @param string $tableName The full table name. Must match the following * pattern: projects/{project}/instances/{instance}/tables/{table}. * @param array $options [optional] { @@ -79,21 +88,22 @@ class Table * @type string $appProfileId This value specifies routing for * replication. **Defaults to** the "default" application profile. * @type array $headers Headers to be passed with each request. - * @type int $retries Number of times to retry. **Defaults to** `3`. + * @type int $retrySettings.maxRetries Number of times to retry. **Defaults to** `3`. * This settings only applies to {@see \Google\Cloud\Bigtable\Table::mutateRows()}, * {@see \Google\Cloud\Bigtable\Table::upsert()} and * {@see \Google\Cloud\Bigtable\Table::readRows()}. * } */ public function __construct( - GapicClient $gapicClient, - $tableName, + $gapicClient, + Serializer $serializer, + string $tableName, array $options = [] ) { $this->gapicClient = $gapicClient; + $this->serializer = $serializer; $this->tableName = $tableName; $this->options = $options; - $this->serializer = new Serializer(); } /** @@ -128,7 +138,7 @@ public function mutateRows(array $rowMutations, array $options = []) foreach ($rowMutations as $rowKey => $mutations) { $entries[] = $this->toEntry($rowKey, $mutations); } - $this->mutateRowsWithEntries($entries, $options); + $this->mutateRowsWithEntries($entries, $options + $this->options); } /** @@ -150,19 +160,27 @@ public function mutateRows(array $rowMutations, array $options = []) * @param array $options [optional] { * Configuration options. * - * @type int $retries Number of times to retry. **Defaults to** `3`. + * @param RetrySettings|array $retrySettings { + * @option int $maxRetries Number of times to retry. **Defaults to** `3`. + * Only maxRetries works for RetrySettings in this API. + * } * } * @return void * @throws ApiException If the remote call fails. */ public function mutateRow($rowKey, Mutations $mutations, array $options = []) { - $this->gapicClient->mutateRow( - $this->tableName, - $rowKey, - $mutations->toProto(), - $options + $this->options + list($data, $optionalArgs) = $this->splitOptionalArgs($options); + $data['table_name'] = $this->tableName; + $data['row_key'] = $rowKey; + $data['mutations'] = $mutations->toProto(); + $request = $this->serializer->decodeMessage( + new MutateRowRequest(), + $data ); + $optionalArgs += $this->options; + + $this->gapicClient->mutateRow($request, $optionalArgs); } /** @@ -186,7 +204,10 @@ public function mutateRow($rowKey, Mutations $mutations, array $options = []) * @param array $options [optional] { * Configuration options. * - * @type int $retries Number of times to retry. **Defaults to** `3`. + * @param RetrySettings|array $retrySettings { + * @option int $maxRetries Number of times to retry. **Defaults to** `3`. + * Only maxRetries works for RetrySettings in this API. + * } * } * @return void * @throws ApiException|BigtableDataOperationException If the remote call fails or operation fails @@ -212,7 +233,7 @@ public function upsert(array $rows, array $options = []) } $entries[] = $this->toEntry($rowKey, $mutations); } - $this->mutateRowsWithEntries($entries, $options); + $this->mutateRowsWithEntries($entries, $options + $this->options); } /** @@ -256,7 +277,10 @@ public function upsert(array $rows, array $options = []) * To learn more please see {@see \Google\Cloud\Bigtable\Filter} which * provides static factory methods for the various filter types. * @type int $rowsLimit The number of rows to scan. - * @type int $retries Number of times to retry. **Defaults to** `3`. + * @param RetrySettings|array $retrySettings { + * @option int $maxRetries Number of times to retry. **Defaults to** `3`. + * Only maxRetries works for RetrySettings in this API. + * } * } * @return ChunkFormatter */ @@ -265,6 +289,7 @@ public function readRows(array $options = []) $rowKeys = $this->pluck('rowKeys', $options, false) ?: []; $ranges = $this->pluck('rowRanges', $options, false) ?: []; $filter = $this->pluck('filter', $options, false) ?: null; + list($data, $optionalArgs) = $this->splitOptionalArgs($options, ['retrySettings']); array_walk($ranges, function (&$range) { $range = $this->serializer->decodeMessage( @@ -280,8 +305,9 @@ public function readRows(array $options = []) ) ); } + if ($ranges || $rowKeys) { - $options['rows'] = $this->serializer->decodeMessage( + $data['rows'] = $this->serializer->decodeMessage( new RowSet, [ 'rowKeys' => $rowKeys, @@ -290,21 +316,18 @@ public function readRows(array $options = []) ); } if ($filter !== null) { - if (!$filter instanceof FilterInterface) { - throw new \InvalidArgumentException( - sprintf( - 'Expected filter to be of type \'%s\', instead got \'%s\'.', - FilterInterface::class, - gettype($filter) - ) - ); - } - $options['filter'] = $filter->toProto(); + $data['filter'] = $filter instanceof FilterInterface + ? $filter->toProto() + : $filter; } + + $data['table_name'] = $this->tableName; + $request = $this->serializer->decodeMessage(new ReadRowsRequest(), $data); + return new ChunkFormatter( - [$this->gapicClient, 'readRows'], - $this->tableName, - $options + $this->options + $this->gapicClient, + $request, + $optionalArgs + $this->options ); } @@ -375,12 +398,17 @@ public function readRow($rowKey, array $options = []) */ public function readModifyWriteRow($rowKey, ReadModifyWriteRowRules $rules, array $options = []) { + list($data, $optionalArgs) = $this->splitOptionalArgs($options); + $data['table_name'] = $this->tableName; + $data['row_key'] = $rowKey; + $data['rules'] = $rules->toProto(); + + $request = $this->serializer->decodeMessage(new ReadModifyWriteRowRequest(), $data); $readModifyWriteRowResponse = $this->gapicClient->readModifyWriteRow( - $this->tableName, - $rowKey, - $rules->toProto(), - $options + $this->options + $request, + $optionalArgs + $this->options ); + return $this->convertToArray($readModifyWriteRowResponse->getRow()); } @@ -404,9 +432,13 @@ public function readModifyWriteRow($rowKey, ReadModifyWriteRowRules $rules, arra */ public function sampleRowKeys(array $options = []) { + list($data, $optionalArgs) = $this->splitOptionalArgs($options); + $data['table_name'] = $this->tableName; + + $request = $this->serializer->decodeMessage(new SampleRowKeysRequest(), $data); $stream = $this->gapicClient->sampleRowKeys( - $this->tableName, - $options + $this->options + $request, + $optionalArgs + $this->options ); foreach ($stream->readAll() as $response) { @@ -485,26 +517,32 @@ public function checkAndMutateRow($rowKey, array $options = []) throw new \InvalidArgumentException('checkAndMutateRow must have either trueMutations or falseMutations.'); } - return $this->gapicClient - ->checkAndMutateRow( - $this->tableName, - $rowKey, - $options + $this->options - ) - ->getPredicateMatched(); + list($data, $optionalArgs) = $this->splitOptionalArgs($options); + $data['table_name'] = $this->tableName; + $data['row_key'] = $rowKey; + $request = $this->serializer->decodeMessage(new CheckAndMutateRowRequest, $data); + + return $this->gapicClient->checkAndMutateRow( + $request, + $optionalArgs + $this->options + )->getPredicateMatched(); } private function mutateRowsWithEntries(array $entries, array $options = []) { $rowMutationsFailedResponse = []; $options = $options + $this->options; - $argumentFunction = function () use (&$entries, &$rowMutationsFailedResponse, $options) { + // This function is responsible to modify the $entries before every retry. + $argumentFunction = function ($request, $options) use (&$entries, &$rowMutationsFailedResponse) { if (count($rowMutationsFailedResponse) > 0) { $entries = array_values($entries); $rowMutationsFailedResponse = []; } - return [$this->tableName, $entries, $options]; + + $request->setEntries($entries); + return [$request, $options]; }; + $statusCode = Code::OK; $lastProcessedIndex = -1; $retryFunction = function ($ex) use (&$statusCode, &$lastProcessedIndex) { @@ -515,11 +553,19 @@ private function mutateRowsWithEntries(array $entries, array $options = []) } return false; }; + + list($data, $optionalArgs) = $this->splitOptionalArgs($options, ['retrySettings']); + + $request = $this->serializer->decodeMessage(new MutateRowsRequest(), $data); + $request->setTableName($this->tableName); + $retryingStream = new ResumableStream( - [$this->gapicClient, 'mutateRows'], + $this->gapicClient, + 'mutateRows', + $request, $argumentFunction, $retryFunction, - $this->pluck('retries', $options, false) + $optionalArgs ); $message = 'partial failure'; try { diff --git a/Bigtable/src/V2/AllReadStats.php b/Bigtable/src/V2/AllReadStats.php deleted file mode 100644 index cc4f14f1b51c..000000000000 --- a/Bigtable/src/V2/AllReadStats.php +++ /dev/null @@ -1,137 +0,0 @@ -google.bigtable.v2.AllReadStats - */ -class AllReadStats extends \Google\Protobuf\Internal\Message -{ - /** - * Iteration stats describe how efficient the read is, e.g. comparing - * rows seen vs. rows returned or cells seen vs cells returned can provide an - * indication of read efficiency (the higher the ratio of seen to retuned the - * better). - * - * Generated from protobuf field .google.bigtable.v2.ReadIteratorStats read_iterator_stats = 1; - */ - private $read_iterator_stats = null; - /** - * Request latency stats describe the time taken to complete a request, from - * the server side. - * - * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; - */ - private $request_latency_stats = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Bigtable\V2\ReadIteratorStats $read_iterator_stats - * Iteration stats describe how efficient the read is, e.g. comparing - * rows seen vs. rows returned or cells seen vs cells returned can provide an - * indication of read efficiency (the higher the ratio of seen to retuned the - * better). - * @type \Google\Cloud\Bigtable\V2\RequestLatencyStats $request_latency_stats - * Request latency stats describe the time taken to complete a request, from - * the server side. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Bigtable\V2\RequestStats::initOnce(); - parent::__construct($data); - } - - /** - * Iteration stats describe how efficient the read is, e.g. comparing - * rows seen vs. rows returned or cells seen vs cells returned can provide an - * indication of read efficiency (the higher the ratio of seen to retuned the - * better). - * - * Generated from protobuf field .google.bigtable.v2.ReadIteratorStats read_iterator_stats = 1; - * @return \Google\Cloud\Bigtable\V2\ReadIteratorStats|null - */ - public function getReadIteratorStats() - { - return $this->read_iterator_stats; - } - - public function hasReadIteratorStats() - { - return isset($this->read_iterator_stats); - } - - public function clearReadIteratorStats() - { - unset($this->read_iterator_stats); - } - - /** - * Iteration stats describe how efficient the read is, e.g. comparing - * rows seen vs. rows returned or cells seen vs cells returned can provide an - * indication of read efficiency (the higher the ratio of seen to retuned the - * better). - * - * Generated from protobuf field .google.bigtable.v2.ReadIteratorStats read_iterator_stats = 1; - * @param \Google\Cloud\Bigtable\V2\ReadIteratorStats $var - * @return $this - */ - public function setReadIteratorStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadIteratorStats::class); - $this->read_iterator_stats = $var; - - return $this; - } - - /** - * Request latency stats describe the time taken to complete a request, from - * the server side. - * - * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; - * @return \Google\Cloud\Bigtable\V2\RequestLatencyStats|null - */ - public function getRequestLatencyStats() - { - return $this->request_latency_stats; - } - - public function hasRequestLatencyStats() - { - return isset($this->request_latency_stats); - } - - public function clearRequestLatencyStats() - { - unset($this->request_latency_stats); - } - - /** - * Request latency stats describe the time taken to complete a request, from - * the server side. - * - * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; - * @param \Google\Cloud\Bigtable\V2\RequestLatencyStats $var - * @return $this - */ - public function setRequestLatencyStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RequestLatencyStats::class); - $this->request_latency_stats = $var; - - return $this; - } - -} - diff --git a/Bigtable/src/V2/BigtableClient.php b/Bigtable/src/V2/BigtableClient.php deleted file mode 100644 index ac3ab8f2607e..000000000000 --- a/Bigtable/src/V2/BigtableClient.php +++ /dev/null @@ -1,45 +0,0 @@ -_serverStreamRequest('/google.bigtable.v2.Bigtable/ReadRows', - $argument, - ['\Google\Cloud\Bigtable\V2\ReadRowsResponse', 'decode'], - $metadata, $options); - } - - /** - * Returns a sample of row keys in the table. The returned row keys will - * delimit contiguous sections of the table of approximately equal size, - * which can be used to break up the data for distributed tasks like - * mapreduces. - * @param \Google\Cloud\Bigtable\V2\SampleRowKeysRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\ServerStreamingCall - */ - public function SampleRowKeys(\Google\Cloud\Bigtable\V2\SampleRowKeysRequest $argument, - $metadata = [], $options = []) { - return $this->_serverStreamRequest('/google.bigtable.v2.Bigtable/SampleRowKeys', - $argument, - ['\Google\Cloud\Bigtable\V2\SampleRowKeysResponse', 'decode'], - $metadata, $options); - } - - /** - * Mutates a row atomically. Cells already present in the row are left - * unchanged unless explicitly changed by `mutation`. - * @param \Google\Cloud\Bigtable\V2\MutateRowRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MutateRow(\Google\Cloud\Bigtable\V2\MutateRowRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.v2.Bigtable/MutateRow', - $argument, - ['\Google\Cloud\Bigtable\V2\MutateRowResponse', 'decode'], - $metadata, $options); - } - - /** - * Mutates multiple rows in a batch. Each individual row is mutated - * atomically as in MutateRow, but the entire batch is not executed - * atomically. - * @param \Google\Cloud\Bigtable\V2\MutateRowsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\ServerStreamingCall - */ - public function MutateRows(\Google\Cloud\Bigtable\V2\MutateRowsRequest $argument, - $metadata = [], $options = []) { - return $this->_serverStreamRequest('/google.bigtable.v2.Bigtable/MutateRows', - $argument, - ['\Google\Cloud\Bigtable\V2\MutateRowsResponse', 'decode'], - $metadata, $options); - } - - /** - * Mutates a row atomically based on the output of a predicate Reader filter. - * @param \Google\Cloud\Bigtable\V2\CheckAndMutateRowRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CheckAndMutateRow(\Google\Cloud\Bigtable\V2\CheckAndMutateRowRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.v2.Bigtable/CheckAndMutateRow', - $argument, - ['\Google\Cloud\Bigtable\V2\CheckAndMutateRowResponse', 'decode'], - $metadata, $options); - } - - /** - * Warm up associated instance metadata for this connection. - * This call is not required but may be useful for connection keep-alive. - * @param \Google\Cloud\Bigtable\V2\PingAndWarmRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PingAndWarm(\Google\Cloud\Bigtable\V2\PingAndWarmRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.v2.Bigtable/PingAndWarm', - $argument, - ['\Google\Cloud\Bigtable\V2\PingAndWarmResponse', 'decode'], - $metadata, $options); - } - - /** - * Modifies a row atomically on the server. The method reads the latest - * existing timestamp and value from the specified columns and writes a new - * entry based on pre-defined read/modify/write rules. The new value for the - * timestamp is the greater of the existing timestamp or the current server - * time. The method returns the new contents of all modified cells. - * @param \Google\Cloud\Bigtable\V2\ReadModifyWriteRowRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ReadModifyWriteRow(\Google\Cloud\Bigtable\V2\ReadModifyWriteRowRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.bigtable.v2.Bigtable/ReadModifyWriteRow', - $argument, - ['\Google\Cloud\Bigtable\V2\ReadModifyWriteRowResponse', 'decode'], - $metadata, $options); - } - - /** - * NOTE: This API is intended to be used by Apache Beam BigtableIO. - * Returns the current list of partitions that make up the table's - * change stream. The union of partitions will cover the entire keyspace. - * Partitions can be read with `ReadChangeStream`. - * @param \Google\Cloud\Bigtable\V2\GenerateInitialChangeStreamPartitionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\ServerStreamingCall - */ - public function GenerateInitialChangeStreamPartitions(\Google\Cloud\Bigtable\V2\GenerateInitialChangeStreamPartitionsRequest $argument, - $metadata = [], $options = []) { - return $this->_serverStreamRequest('/google.bigtable.v2.Bigtable/GenerateInitialChangeStreamPartitions', - $argument, - ['\Google\Cloud\Bigtable\V2\GenerateInitialChangeStreamPartitionsResponse', 'decode'], - $metadata, $options); - } - - /** - * NOTE: This API is intended to be used by Apache Beam BigtableIO. - * Reads changes from a table's change stream. Changes will - * reflect both user-initiated mutations and mutations that are caused by - * garbage collection. - * @param \Google\Cloud\Bigtable\V2\ReadChangeStreamRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\ServerStreamingCall - */ - public function ReadChangeStream(\Google\Cloud\Bigtable\V2\ReadChangeStreamRequest $argument, - $metadata = [], $options = []) { - return $this->_serverStreamRequest('/google.bigtable.v2.Bigtable/ReadChangeStream', - $argument, - ['\Google\Cloud\Bigtable\V2\ReadChangeStreamResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Bigtable/src/V2/Cell.php b/Bigtable/src/V2/Cell.php index 71a3c01f6265..ae97f1e167af 100644 --- a/Bigtable/src/V2/Cell.php +++ b/Bigtable/src/V2/Cell.php @@ -25,7 +25,7 @@ class Cell extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 timestamp_micros = 1; */ - private $timestamp_micros = 0; + protected $timestamp_micros = 0; /** * The value stored in the cell. * May contain any byte string, including the empty string, up to 100MiB in @@ -33,7 +33,7 @@ class Cell extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes value = 2; */ - private $value = ''; + protected $value = ''; /** * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. * diff --git a/Bigtable/src/V2/CheckAndMutateRowRequest.php b/Bigtable/src/V2/CheckAndMutateRowRequest.php index c87631158d03..71dc9e6065dd 100644 --- a/Bigtable/src/V2/CheckAndMutateRowRequest.php +++ b/Bigtable/src/V2/CheckAndMutateRowRequest.php @@ -23,7 +23,7 @@ class CheckAndMutateRowRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $table_name = ''; + protected $table_name = ''; /** * Optional. The unique name of the AuthorizedView to which the conditional * mutation should be applied. @@ -32,21 +32,21 @@ class CheckAndMutateRowRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $authorized_view_name = ''; + protected $authorized_view_name = ''; /** * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * * Generated from protobuf field string app_profile_id = 7; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * Required. The key of the row to which the conditional mutation should be * applied. * * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $row_key = ''; + protected $row_key = ''; /** * The filter to be applied to the contents of the specified row. Depending * on whether or not any results are yielded, either `true_mutations` or @@ -55,7 +55,7 @@ class CheckAndMutateRowRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 6; */ - private $predicate_filter = null; + protected $predicate_filter = null; /** * Changes to be atomically applied to the specified row if `predicate_filter` * yields at least one cell when applied to `row_key`. Entries are applied in diff --git a/Bigtable/src/V2/CheckAndMutateRowResponse.php b/Bigtable/src/V2/CheckAndMutateRowResponse.php index 2e970bd41dd4..ea562f574e70 100644 --- a/Bigtable/src/V2/CheckAndMutateRowResponse.php +++ b/Bigtable/src/V2/CheckAndMutateRowResponse.php @@ -21,7 +21,7 @@ class CheckAndMutateRowResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool predicate_matched = 1; */ - private $predicate_matched = false; + protected $predicate_matched = false; /** * Constructor. diff --git a/Bigtable/src/V2/Client/BigtableClient.php b/Bigtable/src/V2/Client/BigtableClient.php index 01f9efeb2843..770c2d544d15 100644 --- a/Bigtable/src/V2/Client/BigtableClient.php +++ b/Bigtable/src/V2/Client/BigtableClient.php @@ -1,6 +1,6 @@ setDefaultEmulatorConfig($options); $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); } @@ -507,4 +510,23 @@ public function sampleRowKeys(SampleRowKeysRequest $request, array $callOptions { return $this->startApiCall('SampleRowKeys', $request, $callOptions); } + + /** Configure the gapic configuration to use a service emulator. */ + private function setDefaultEmulatorConfig(array $options): array + { + $emulatorHost = getenv('BIGTABLE_EMULATOR_HOST'); + if (empty($emulatorHost)) { + return $options; + } + + if ($scheme = parse_url($emulatorHost, PHP_URL_SCHEME)) { + $search = $scheme . '://'; + $emulatorHost = str_replace($search, '', $emulatorHost); + } + + $options['apiEndpoint'] ??= $emulatorHost; + $options['transportConfig']['grpc']['stubOpts']['credentials'] ??= ChannelCredentials::createInsecure(); + $options['credentials'] ??= new InsecureCredentialsWrapper(); + return $options; + } } diff --git a/Bigtable/src/V2/Column.php b/Bigtable/src/V2/Column.php index 99b5e8dee8af..b2f46bdf290b 100644 --- a/Bigtable/src/V2/Column.php +++ b/Bigtable/src/V2/Column.php @@ -25,7 +25,7 @@ class Column extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes qualifier = 1; */ - private $qualifier = ''; + protected $qualifier = ''; /** * Must not be empty. Sorted in order of decreasing "timestamp_micros". * diff --git a/Bigtable/src/V2/ColumnRange.php b/Bigtable/src/V2/ColumnRange.php index f094744c2b59..d5ff522b00d6 100644 --- a/Bigtable/src/V2/ColumnRange.php +++ b/Bigtable/src/V2/ColumnRange.php @@ -23,7 +23,7 @@ class ColumnRange extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string family_name = 1; */ - private $family_name = ''; + protected $family_name = ''; protected $start_qualifier; protected $end_qualifier; diff --git a/Bigtable/src/V2/Family.php b/Bigtable/src/V2/Family.php index 6a428080d244..429023c4587d 100644 --- a/Bigtable/src/V2/Family.php +++ b/Bigtable/src/V2/Family.php @@ -26,7 +26,7 @@ class Family extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Must not be empty. Sorted in order of increasing "qualifier". * diff --git a/Bigtable/src/V2/FeatureFlags.php b/Bigtable/src/V2/FeatureFlags.php index f9d2d8bcacea..06504aadd20c 100644 --- a/Bigtable/src/V2/FeatureFlags.php +++ b/Bigtable/src/V2/FeatureFlags.php @@ -28,7 +28,7 @@ class FeatureFlags extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool reverse_scans = 1; */ - private $reverse_scans = false; + protected $reverse_scans = false; /** * Notify the server that the client enables batch write flow control by * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons, @@ -36,7 +36,7 @@ class FeatureFlags extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool mutate_rows_rate_limit = 3; */ - private $mutate_rows_rate_limit = false; + protected $mutate_rows_rate_limit = false; /** * Notify the server that the client enables batch write flow control by * requesting RateLimitInfo from MutateRowsResponse. With partial retries @@ -44,34 +44,34 @@ class FeatureFlags extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool mutate_rows_rate_limit2 = 5; */ - private $mutate_rows_rate_limit2 = false; + protected $mutate_rows_rate_limit2 = false; /** * Notify the server that the client supports the last_scanned_row field * in ReadRowsResponse for long-running scans. * * Generated from protobuf field bool last_scanned_row_responses = 4; */ - private $last_scanned_row_responses = false; + protected $last_scanned_row_responses = false; /** * Notify the server that the client supports using encoded routing cookie * strings to retry requests with. * * Generated from protobuf field bool routing_cookie = 6; */ - private $routing_cookie = false; + protected $routing_cookie = false; /** * Notify the server that the client supports using retry info back off * durations to retry requests with. * * Generated from protobuf field bool retry_info = 7; */ - private $retry_info = false; + protected $retry_info = false; /** * Notify the server that the client has client side metrics enabled. * * Generated from protobuf field bool client_side_metrics_enabled = 8; */ - private $client_side_metrics_enabled = false; + protected $client_side_metrics_enabled = false; /** * Constructor. diff --git a/Bigtable/src/V2/FullReadStatsView.php b/Bigtable/src/V2/FullReadStatsView.php index 7e407f5aca7a..3376ecb5017e 100644 --- a/Bigtable/src/V2/FullReadStatsView.php +++ b/Bigtable/src/V2/FullReadStatsView.php @@ -23,14 +23,14 @@ class FullReadStatsView extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; */ - private $read_iteration_stats = null; + protected $read_iteration_stats = null; /** * Request latency stats describe the time taken to complete a request, from * the server side. * * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; */ - private $request_latency_stats = null; + protected $request_latency_stats = null; /** * Constructor. diff --git a/Bigtable/src/V2/Gapic/BigtableGapicClient.php b/Bigtable/src/V2/Gapic/BigtableGapicClient.php deleted file mode 100644 index 99c5625a5b27..000000000000 --- a/Bigtable/src/V2/Gapic/BigtableGapicClient.php +++ /dev/null @@ -1,1090 +0,0 @@ -tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $rowKey = '...'; - * $response = $bigtableClient->checkAndMutateRow($formattedTableName, $rowKey); - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Bigtable\V2\Client\BigtableClient}. - */ -class BigtableGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.bigtable.v2.Bigtable'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'bigtable.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'bigtable.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/bigtable.data', - 'https://www.googleapis.com/auth/bigtable.data.readonly', - 'https://www.googleapis.com/auth/cloud-bigtable.data', - 'https://www.googleapis.com/auth/cloud-bigtable.data.readonly', - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $authorizedViewNameTemplate; - - private static $instanceNameTemplate; - - private static $tableNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/bigtable_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/bigtable_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/bigtable_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/bigtable_rest_client_config.php', - ], - ], - ]; - } - - private static function getAuthorizedViewNameTemplate() - { - if (self::$authorizedViewNameTemplate == null) { - self::$authorizedViewNameTemplate = new PathTemplate('projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}'); - } - - return self::$authorizedViewNameTemplate; - } - - private static function getInstanceNameTemplate() - { - if (self::$instanceNameTemplate == null) { - self::$instanceNameTemplate = new PathTemplate('projects/{project}/instances/{instance}'); - } - - return self::$instanceNameTemplate; - } - - private static function getTableNameTemplate() - { - if (self::$tableNameTemplate == null) { - self::$tableNameTemplate = new PathTemplate('projects/{project}/instances/{instance}/tables/{table}'); - } - - return self::$tableNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'authorizedView' => self::getAuthorizedViewNameTemplate(), - 'instance' => self::getInstanceNameTemplate(), - 'table' => self::getTableNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * authorized_view resource. - * - * @param string $project - * @param string $instance - * @param string $table - * @param string $authorizedView - * - * @return string The formatted authorized_view resource. - */ - public static function authorizedViewName($project, $instance, $table, $authorizedView) - { - return self::getAuthorizedViewNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - 'table' => $table, - 'authorized_view' => $authorizedView, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $instance - * - * @return string The formatted instance resource. - */ - public static function instanceName($project, $instance) - { - return self::getInstanceNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a table - * resource. - * - * @param string $project - * @param string $instance - * @param string $table - * - * @return string The formatted table resource. - */ - public static function tableName($project, $instance, $table) - { - return self::getTableNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - 'table' => $table, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - authorizedView: projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view} - * - instance: projects/{project}/instances/{instance} - * - table: projects/{project}/instances/{instance}/tables/{table} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'bigtable.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Mutates a row atomically based on the output of a predicate Reader filter. - * - * Sample code: - * ``` - * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); - * try { - * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $rowKey = '...'; - * $response = $bigtableClient->checkAndMutateRow($formattedTableName, $rowKey); - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * @param string $tableName Optional. The unique name of the table to which the conditional mutation - * should be applied. - * - * Values are of the form - * `projects//instances//tables/
`. - * @param string $rowKey Required. The key of the row to which the conditional mutation should be - * applied. - * @param array $optionalArgs { - * Optional. - * - * @type string $authorizedViewName - * Optional. The unique name of the AuthorizedView to which the conditional - * mutation should be applied. - * - * Values are of the form - * `projects//instances//tables/
/authorizedViews/`. - * @type string $appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @type RowFilter $predicateFilter - * The filter to be applied to the contents of the specified row. Depending - * on whether or not any results are yielded, either `true_mutations` or - * `false_mutations` will be executed. If unset, checks that the row contains - * any values at all. - * @type Mutation[] $trueMutations - * Changes to be atomically applied to the specified row if `predicate_filter` - * yields at least one cell when applied to `row_key`. Entries are applied in - * order, meaning that earlier mutations can be masked by later ones. - * Must contain at least one entry if `false_mutations` is empty, and at most - * 100000. - * @type Mutation[] $falseMutations - * Changes to be atomically applied to the specified row if `predicate_filter` - * does not yield any cells when applied to `row_key`. Entries are applied in - * order, meaning that earlier mutations can be masked by later ones. - * Must contain at least one entry if `true_mutations` is empty, and at most - * 100000. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\V2\CheckAndMutateRowResponse - * - * @throws ApiException if the remote call fails - */ - public function checkAndMutateRow($tableName, $rowKey, array $optionalArgs = []) - { - $request = new CheckAndMutateRowRequest(); - $requestParamHeaders = []; - $request->setTableName($tableName); - $request->setRowKey($rowKey); - $tableNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', $tableName, $tableNameMatches)) { - $requestParamHeaders['table_name'] = $tableNameMatches['table_name']; - } - - if (isset($optionalArgs['authorizedViewName'])) { - $request->setAuthorizedViewName($optionalArgs['authorizedViewName']); - $authorizedViewNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', $optionalArgs['authorizedViewName'], $authorizedViewNameMatches)) { - $requestParamHeaders['authorized_view_name'] = $authorizedViewNameMatches['authorized_view_name']; - } - } - - if (isset($optionalArgs['appProfileId'])) { - $request->setAppProfileId($optionalArgs['appProfileId']); - $requestParamHeaders['app_profile_id'] = $optionalArgs['appProfileId']; - } - - if (isset($optionalArgs['predicateFilter'])) { - $request->setPredicateFilter($optionalArgs['predicateFilter']); - } - - if (isset($optionalArgs['trueMutations'])) { - $request->setTrueMutations($optionalArgs['trueMutations']); - } - - if (isset($optionalArgs['falseMutations'])) { - $request->setFalseMutations($optionalArgs['falseMutations']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CheckAndMutateRow', CheckAndMutateRowResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * NOTE: This API is intended to be used by Apache Beam BigtableIO. - * Returns the current list of partitions that make up the table's - * change stream. The union of partitions will cover the entire keyspace. - * Partitions can be read with `ReadChangeStream`. - * - * Sample code: - * ``` - * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); - * try { - * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * // Read all responses until the stream is complete - * $stream = $bigtableClient->generateInitialChangeStreamPartitions($formattedTableName); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * @param string $tableName Required. The unique name of the table from which to get change stream - * partitions. Values are of the form - * `projects//instances//tables/
`. - * Change streaming must be enabled on the table. - * @param array $optionalArgs { - * Optional. - * - * @type string $appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * Single cluster routing must be configured on the profile. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function generateInitialChangeStreamPartitions($tableName, array $optionalArgs = []) - { - $request = new GenerateInitialChangeStreamPartitionsRequest(); - $requestParamHeaders = []; - $request->setTableName($tableName); - $requestParamHeaders['table_name'] = $tableName; - if (isset($optionalArgs['appProfileId'])) { - $request->setAppProfileId($optionalArgs['appProfileId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GenerateInitialChangeStreamPartitions', GenerateInitialChangeStreamPartitionsResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); - } - - /** - * Mutates a row atomically. Cells already present in the row are left - * unchanged unless explicitly changed by `mutation`. - * - * Sample code: - * ``` - * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); - * try { - * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $rowKey = '...'; - * $mutations = []; - * $response = $bigtableClient->mutateRow($formattedTableName, $rowKey, $mutations); - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * @param string $tableName Optional. The unique name of the table to which the mutation should be - * applied. - * - * Values are of the form - * `projects//instances//tables/
`. - * @param string $rowKey Required. The key of the row to which the mutation should be applied. - * @param Mutation[] $mutations Required. Changes to be atomically applied to the specified row. Entries - * are applied in order, meaning that earlier mutations can be masked by later - * ones. Must contain at least one entry and at most 100000. - * @param array $optionalArgs { - * Optional. - * - * @type string $authorizedViewName - * Optional. The unique name of the AuthorizedView to which the mutation - * should be applied. - * - * Values are of the form - * `projects//instances//tables/
/authorizedViews/`. - * @type string $appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\V2\MutateRowResponse - * - * @throws ApiException if the remote call fails - */ - public function mutateRow($tableName, $rowKey, $mutations, array $optionalArgs = []) - { - $request = new MutateRowRequest(); - $requestParamHeaders = []; - $request->setTableName($tableName); - $request->setRowKey($rowKey); - $request->setMutations($mutations); - $tableNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', $tableName, $tableNameMatches)) { - $requestParamHeaders['table_name'] = $tableNameMatches['table_name']; - } - - if (isset($optionalArgs['authorizedViewName'])) { - $request->setAuthorizedViewName($optionalArgs['authorizedViewName']); - $authorizedViewNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', $optionalArgs['authorizedViewName'], $authorizedViewNameMatches)) { - $requestParamHeaders['authorized_view_name'] = $authorizedViewNameMatches['authorized_view_name']; - } - } - - if (isset($optionalArgs['appProfileId'])) { - $request->setAppProfileId($optionalArgs['appProfileId']); - $requestParamHeaders['app_profile_id'] = $optionalArgs['appProfileId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MutateRow', MutateRowResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Mutates multiple rows in a batch. Each individual row is mutated - * atomically as in MutateRow, but the entire batch is not executed - * atomically. - * - * Sample code: - * ``` - * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); - * try { - * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $entries = []; - * // Read all responses until the stream is complete - * $stream = $bigtableClient->mutateRows($formattedTableName, $entries); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * @param string $tableName Optional. The unique name of the table to which the mutations should be - * applied. - * - * Values are of the form - * `projects//instances//tables/
`. - * @param Entry[] $entries Required. The row keys and corresponding mutations to be applied in bulk. - * Each entry is applied as an atomic mutation, but the entries may be - * applied in arbitrary order (even between entries for the same row). - * At least one entry must be specified, and in total the entries can - * contain at most 100000 mutations. - * @param array $optionalArgs { - * Optional. - * - * @type string $authorizedViewName - * Optional. The unique name of the AuthorizedView to which the mutations - * should be applied. - * - * Values are of the form - * `projects//instances//tables/
/authorizedViews/`. - * @type string $appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function mutateRows($tableName, $entries, array $optionalArgs = []) - { - $request = new MutateRowsRequest(); - $requestParamHeaders = []; - $request->setTableName($tableName); - $request->setEntries($entries); - $tableNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', $tableName, $tableNameMatches)) { - $requestParamHeaders['table_name'] = $tableNameMatches['table_name']; - } - - if (isset($optionalArgs['authorizedViewName'])) { - $request->setAuthorizedViewName($optionalArgs['authorizedViewName']); - $authorizedViewNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', $optionalArgs['authorizedViewName'], $authorizedViewNameMatches)) { - $requestParamHeaders['authorized_view_name'] = $authorizedViewNameMatches['authorized_view_name']; - } - } - - if (isset($optionalArgs['appProfileId'])) { - $request->setAppProfileId($optionalArgs['appProfileId']); - $requestParamHeaders['app_profile_id'] = $optionalArgs['appProfileId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MutateRows', MutateRowsResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); - } - - /** - * Warm up associated instance metadata for this connection. - * This call is not required but may be useful for connection keep-alive. - * - * Sample code: - * ``` - * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); - * try { - * $formattedName = $bigtableClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $response = $bigtableClient->pingAndWarm($formattedName); - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * @param string $name Required. The unique name of the instance to check permissions for as well - * as respond. Values are of the form - * `projects//instances/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\V2\PingAndWarmResponse - * - * @throws ApiException if the remote call fails - */ - public function pingAndWarm($name, array $optionalArgs = []) - { - $request = new PingAndWarmRequest(); - $requestParamHeaders = []; - $request->setName($name); - $nameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+)$/', $name, $nameMatches)) { - $requestParamHeaders['name'] = $nameMatches['name']; - } - - if (isset($optionalArgs['appProfileId'])) { - $request->setAppProfileId($optionalArgs['appProfileId']); - $requestParamHeaders['app_profile_id'] = $optionalArgs['appProfileId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('PingAndWarm', PingAndWarmResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * NOTE: This API is intended to be used by Apache Beam BigtableIO. - * Reads changes from a table's change stream. Changes will - * reflect both user-initiated mutations and mutations that are caused by - * garbage collection. - * - * Sample code: - * ``` - * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); - * try { - * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * // Read all responses until the stream is complete - * $stream = $bigtableClient->readChangeStream($formattedTableName); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * @param string $tableName Required. The unique name of the table from which to read a change stream. - * Values are of the form - * `projects//instances//tables/
`. - * Change streaming must be enabled on the table. - * @param array $optionalArgs { - * Optional. - * - * @type string $appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * Single cluster routing must be configured on the profile. - * @type StreamPartition $partition - * The partition to read changes from. - * @type Timestamp $startTime - * Start reading the stream at the specified timestamp. This timestamp must - * be within the change stream retention period, less than or equal to the - * current time, and after change stream creation, whichever is greater. - * This value is inclusive and will be truncated to microsecond granularity. - * @type StreamContinuationTokens $continuationTokens - * Tokens that describe how to resume reading a stream where reading - * previously left off. If specified, changes will be read starting at the - * the position. Tokens are delivered on the stream as part of `Heartbeat` - * and `CloseStream` messages. - * - * If a single token is provided, the token’s partition must exactly match - * the request’s partition. If multiple tokens are provided, as in the case - * of a partition merge, the union of the token partitions must exactly - * cover the request’s partition. Otherwise, INVALID_ARGUMENT will be - * returned. - * @type Timestamp $endTime - * If specified, OK will be returned when the stream advances beyond - * this time. Otherwise, changes will be continuously delivered on the stream. - * This value is inclusive and will be truncated to microsecond granularity. - * @type Duration $heartbeatDuration - * If specified, the duration between `Heartbeat` messages on the stream. - * Otherwise, defaults to 5 seconds. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function readChangeStream($tableName, array $optionalArgs = []) - { - $request = new ReadChangeStreamRequest(); - $requestParamHeaders = []; - $request->setTableName($tableName); - $requestParamHeaders['table_name'] = $tableName; - if (isset($optionalArgs['appProfileId'])) { - $request->setAppProfileId($optionalArgs['appProfileId']); - } - - if (isset($optionalArgs['partition'])) { - $request->setPartition($optionalArgs['partition']); - } - - if (isset($optionalArgs['startTime'])) { - $request->setStartTime($optionalArgs['startTime']); - } - - if (isset($optionalArgs['continuationTokens'])) { - $request->setContinuationTokens($optionalArgs['continuationTokens']); - } - - if (isset($optionalArgs['endTime'])) { - $request->setEndTime($optionalArgs['endTime']); - } - - if (isset($optionalArgs['heartbeatDuration'])) { - $request->setHeartbeatDuration($optionalArgs['heartbeatDuration']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ReadChangeStream', ReadChangeStreamResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); - } - - /** - * Modifies a row atomically on the server. The method reads the latest - * existing timestamp and value from the specified columns and writes a new - * entry based on pre-defined read/modify/write rules. The new value for the - * timestamp is the greater of the existing timestamp or the current server - * time. The method returns the new contents of all modified cells. - * - * Sample code: - * ``` - * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); - * try { - * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * $rowKey = '...'; - * $rules = []; - * $response = $bigtableClient->readModifyWriteRow($formattedTableName, $rowKey, $rules); - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * @param string $tableName Optional. The unique name of the table to which the read/modify/write rules - * should be applied. - * - * Values are of the form - * `projects//instances//tables/
`. - * @param string $rowKey Required. The key of the row to which the read/modify/write rules should be - * applied. - * @param ReadModifyWriteRule[] $rules Required. Rules specifying how the specified row's contents are to be - * transformed into writes. Entries are applied in order, meaning that earlier - * rules will affect the results of later ones. - * @param array $optionalArgs { - * Optional. - * - * @type string $authorizedViewName - * Optional. The unique name of the AuthorizedView to which the - * read/modify/write rules should be applied. - * - * Values are of the form - * `projects//instances//tables/
/authorizedViews/`. - * @type string $appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Bigtable\V2\ReadModifyWriteRowResponse - * - * @throws ApiException if the remote call fails - */ - public function readModifyWriteRow($tableName, $rowKey, $rules, array $optionalArgs = []) - { - $request = new ReadModifyWriteRowRequest(); - $requestParamHeaders = []; - $request->setTableName($tableName); - $request->setRowKey($rowKey); - $request->setRules($rules); - $tableNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', $tableName, $tableNameMatches)) { - $requestParamHeaders['table_name'] = $tableNameMatches['table_name']; - } - - if (isset($optionalArgs['authorizedViewName'])) { - $request->setAuthorizedViewName($optionalArgs['authorizedViewName']); - $authorizedViewNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', $optionalArgs['authorizedViewName'], $authorizedViewNameMatches)) { - $requestParamHeaders['authorized_view_name'] = $authorizedViewNameMatches['authorized_view_name']; - } - } - - if (isset($optionalArgs['appProfileId'])) { - $request->setAppProfileId($optionalArgs['appProfileId']); - $requestParamHeaders['app_profile_id'] = $optionalArgs['appProfileId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ReadModifyWriteRow', ReadModifyWriteRowResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Streams back the contents of all requested rows in key order, optionally - * applying the same Reader filter to each. Depending on their size, - * rows and cells may be broken up across multiple responses, but - * atomicity of each row will still be preserved. See the - * ReadRowsResponse documentation for details. - * - * Sample code: - * ``` - * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); - * try { - * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * // Read all responses until the stream is complete - * $stream = $bigtableClient->readRows($formattedTableName); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * @param string $tableName Optional. The unique name of the table from which to read. - * - * Values are of the form - * `projects//instances//tables/
`. - * @param array $optionalArgs { - * Optional. - * - * @type string $authorizedViewName - * Optional. The unique name of the AuthorizedView from which to read. - * - * Values are of the form - * `projects//instances//tables/
/authorizedViews/`. - * @type string $appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @type RowSet $rows - * The row keys and/or ranges to read sequentially. If not specified, reads - * from all rows. - * @type RowFilter $filter - * The filter to apply to the contents of the specified row(s). If unset, - * reads the entirety of each row. - * @type int $rowsLimit - * The read will stop after committing to N rows' worth of results. The - * default (zero) is to return all results. - * @type int $requestStatsView - * The view into RequestStats, as described above. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\V2\ReadRowsRequest\RequestStatsView} - * @type bool $reversed - * Experimental API - Please note that this API is currently experimental - * and can change in the future. - * - * Return rows in lexiographical descending order of the row keys. The row - * contents will not be affected by this flag. - * - * Example result set: - * - * [ - * {key: "k2", "f:col1": "v1", "f:col2": "v1"}, - * {key: "k1", "f:col1": "v2", "f:col2": "v2"} - * ] - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function readRows($tableName, array $optionalArgs = []) - { - $request = new ReadRowsRequest(); - $requestParamHeaders = []; - $request->setTableName($tableName); - $tableNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', $tableName, $tableNameMatches)) { - $requestParamHeaders['table_name'] = $tableNameMatches['table_name']; - } - - if (isset($optionalArgs['authorizedViewName'])) { - $request->setAuthorizedViewName($optionalArgs['authorizedViewName']); - $authorizedViewNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', $optionalArgs['authorizedViewName'], $authorizedViewNameMatches)) { - $requestParamHeaders['authorized_view_name'] = $authorizedViewNameMatches['authorized_view_name']; - } - } - - if (isset($optionalArgs['appProfileId'])) { - $request->setAppProfileId($optionalArgs['appProfileId']); - $requestParamHeaders['app_profile_id'] = $optionalArgs['appProfileId']; - } - - if (isset($optionalArgs['rows'])) { - $request->setRows($optionalArgs['rows']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['rowsLimit'])) { - $request->setRowsLimit($optionalArgs['rowsLimit']); - } - - if (isset($optionalArgs['requestStatsView'])) { - $request->setRequestStatsView($optionalArgs['requestStatsView']); - } - - if (isset($optionalArgs['reversed'])) { - $request->setReversed($optionalArgs['reversed']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ReadRows', ReadRowsResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); - } - - /** - * Returns a sample of row keys in the table. The returned row keys will - * delimit contiguous sections of the table of approximately equal size, - * which can be used to break up the data for distributed tasks like - * mapreduces. - * - * Sample code: - * ``` - * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); - * try { - * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * // Read all responses until the stream is complete - * $stream = $bigtableClient->sampleRowKeys($formattedTableName); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $bigtableClient->close(); - * } - * ``` - * - * @param string $tableName Optional. The unique name of the table from which to sample row keys. - * - * Values are of the form - * `projects//instances//tables/
`. - * @param array $optionalArgs { - * Optional. - * - * @type string $authorizedViewName - * Optional. The unique name of the AuthorizedView from which to sample row - * keys. - * - * Values are of the form - * `projects//instances//tables/
/authorizedViews/`. - * @type string $appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function sampleRowKeys($tableName, array $optionalArgs = []) - { - $request = new SampleRowKeysRequest(); - $requestParamHeaders = []; - $request->setTableName($tableName); - $tableNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+)$/', $tableName, $tableNameMatches)) { - $requestParamHeaders['table_name'] = $tableNameMatches['table_name']; - } - - if (isset($optionalArgs['authorizedViewName'])) { - $request->setAuthorizedViewName($optionalArgs['authorizedViewName']); - $authorizedViewNameMatches = []; - if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+\/tables\/[^\/]+\/authorizedViews\/[^\/]+)$/', $optionalArgs['authorizedViewName'], $authorizedViewNameMatches)) { - $requestParamHeaders['authorized_view_name'] = $authorizedViewNameMatches['authorized_view_name']; - } - } - - if (isset($optionalArgs['appProfileId'])) { - $request->setAppProfileId($optionalArgs['appProfileId']); - $requestParamHeaders['app_profile_id'] = $optionalArgs['appProfileId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SampleRowKeys', SampleRowKeysResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); - } -} diff --git a/Bigtable/src/V2/GenerateInitialChangeStreamPartitionsRequest.php b/Bigtable/src/V2/GenerateInitialChangeStreamPartitionsRequest.php index 8bd603cf583d..67233adb93bf 100644 --- a/Bigtable/src/V2/GenerateInitialChangeStreamPartitionsRequest.php +++ b/Bigtable/src/V2/GenerateInitialChangeStreamPartitionsRequest.php @@ -24,7 +24,7 @@ class GenerateInitialChangeStreamPartitionsRequest extends \Google\Protobuf\Inte * * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $table_name = ''; + protected $table_name = ''; /** * This value specifies routing for replication. If not specified, the * "default" application profile will be used. @@ -32,7 +32,7 @@ class GenerateInitialChangeStreamPartitionsRequest extends \Google\Protobuf\Inte * * Generated from protobuf field string app_profile_id = 2; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * @param string $tableName Required. The unique name of the table from which to get change stream diff --git a/Bigtable/src/V2/GenerateInitialChangeStreamPartitionsResponse.php b/Bigtable/src/V2/GenerateInitialChangeStreamPartitionsResponse.php index dc2e835d8872..26f241b3bd8c 100644 --- a/Bigtable/src/V2/GenerateInitialChangeStreamPartitionsResponse.php +++ b/Bigtable/src/V2/GenerateInitialChangeStreamPartitionsResponse.php @@ -21,7 +21,7 @@ class GenerateInitialChangeStreamPartitionsResponse extends \Google\Protobuf\Int * * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 1; */ - private $partition = null; + protected $partition = null; /** * Constructor. diff --git a/Bigtable/src/V2/MutateRowRequest.php b/Bigtable/src/V2/MutateRowRequest.php index e03d01a62110..50e64e6e0217 100644 --- a/Bigtable/src/V2/MutateRowRequest.php +++ b/Bigtable/src/V2/MutateRowRequest.php @@ -23,7 +23,7 @@ class MutateRowRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $table_name = ''; + protected $table_name = ''; /** * Optional. The unique name of the AuthorizedView to which the mutation * should be applied. @@ -32,20 +32,20 @@ class MutateRowRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $authorized_view_name = ''; + protected $authorized_view_name = ''; /** * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * * Generated from protobuf field string app_profile_id = 4; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * Required. The key of the row to which the mutation should be applied. * * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $row_key = ''; + protected $row_key = ''; /** * Required. Changes to be atomically applied to the specified row. Entries * are applied in order, meaning that earlier mutations can be masked by later diff --git a/Bigtable/src/V2/MutateRowsRequest.php b/Bigtable/src/V2/MutateRowsRequest.php index 8405df53f720..64ce09021ece 100644 --- a/Bigtable/src/V2/MutateRowsRequest.php +++ b/Bigtable/src/V2/MutateRowsRequest.php @@ -23,7 +23,7 @@ class MutateRowsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $table_name = ''; + protected $table_name = ''; /** * Optional. The unique name of the AuthorizedView to which the mutations * should be applied. @@ -32,14 +32,14 @@ class MutateRowsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $authorized_view_name = ''; + protected $authorized_view_name = ''; /** * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * * Generated from protobuf field string app_profile_id = 3; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * Required. The row keys and corresponding mutations to be applied in bulk. * Each entry is applied as an atomic mutation, but the entries may be diff --git a/Bigtable/src/V2/MutateRowsRequest/Entry.php b/Bigtable/src/V2/MutateRowsRequest/Entry.php index 801cd61cc2df..96659f4574ed 100644 --- a/Bigtable/src/V2/MutateRowsRequest/Entry.php +++ b/Bigtable/src/V2/MutateRowsRequest/Entry.php @@ -20,7 +20,7 @@ class Entry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes row_key = 1; */ - private $row_key = ''; + protected $row_key = ''; /** * Required. Changes to be atomically applied to the specified row. * Mutations are applied in order, meaning that earlier mutations can be diff --git a/Bigtable/src/V2/MutateRowsRequest_Entry.php b/Bigtable/src/V2/MutateRowsRequest_Entry.php deleted file mode 100644 index a25e607142dd..000000000000 --- a/Bigtable/src/V2/MutateRowsRequest_Entry.php +++ /dev/null @@ -1,16 +0,0 @@ -optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; */ - private $rate_limit_info = null; + protected $rate_limit_info = null; /** * Constructor. diff --git a/Bigtable/src/V2/MutateRowsResponse/Entry.php b/Bigtable/src/V2/MutateRowsResponse/Entry.php index 3b2d1c08381a..a6049b0d0792 100644 --- a/Bigtable/src/V2/MutateRowsResponse/Entry.php +++ b/Bigtable/src/V2/MutateRowsResponse/Entry.php @@ -21,7 +21,7 @@ class Entry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 index = 1; */ - private $index = 0; + protected $index = 0; /** * The result of the request Entry identified by `index`. * Depending on how requests are batched during execution, it is possible @@ -30,7 +30,7 @@ class Entry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status status = 2; */ - private $status = null; + protected $status = null; /** * Constructor. diff --git a/Bigtable/src/V2/MutateRowsResponse_Entry.php b/Bigtable/src/V2/MutateRowsResponse_Entry.php deleted file mode 100644 index 5cb4efda8e19..000000000000 --- a/Bigtable/src/V2/MutateRowsResponse_Entry.php +++ /dev/null @@ -1,16 +0,0 @@ -string family_name = 1; */ - private $family_name = ''; + protected $family_name = ''; /** * The qualifier of the column into which new data should be added. This * must be a `raw_value`. * * Generated from protobuf field .google.bigtable.v2.Value column_qualifier = 2; */ - private $column_qualifier = null; + protected $column_qualifier = null; /** * The timestamp of the cell to which new data should be added. This must * be a `raw_timestamp_micros` that matches the table's `granularity`. * * Generated from protobuf field .google.bigtable.v2.Value timestamp = 3; */ - private $timestamp = null; + protected $timestamp = null; /** * The input value to be accumulated into the specified cell. This must be * compatible with the family's `value_type.input_type`. * * Generated from protobuf field .google.bigtable.v2.Value input = 4; */ - private $input = null; + protected $input = null; /** * Constructor. diff --git a/Bigtable/src/V2/Mutation/DeleteFromColumn.php b/Bigtable/src/V2/Mutation/DeleteFromColumn.php index 47c56247ae18..a91638edfa4a 100644 --- a/Bigtable/src/V2/Mutation/DeleteFromColumn.php +++ b/Bigtable/src/V2/Mutation/DeleteFromColumn.php @@ -22,20 +22,20 @@ class DeleteFromColumn extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string family_name = 1; */ - private $family_name = ''; + protected $family_name = ''; /** * The qualifier of the column from which cells should be deleted. * Can be any byte string, including the empty string. * * Generated from protobuf field bytes column_qualifier = 2; */ - private $column_qualifier = ''; + protected $column_qualifier = ''; /** * The range of timestamps within which cells should be deleted. * * Generated from protobuf field .google.bigtable.v2.TimestampRange time_range = 3; */ - private $time_range = null; + protected $time_range = null; /** * Constructor. diff --git a/Bigtable/src/V2/Mutation/DeleteFromFamily.php b/Bigtable/src/V2/Mutation/DeleteFromFamily.php index b1a7ea953efc..66cdb291bf3c 100644 --- a/Bigtable/src/V2/Mutation/DeleteFromFamily.php +++ b/Bigtable/src/V2/Mutation/DeleteFromFamily.php @@ -21,7 +21,7 @@ class DeleteFromFamily extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string family_name = 1; */ - private $family_name = ''; + protected $family_name = ''; /** * Constructor. diff --git a/Bigtable/src/V2/Mutation/SetCell.php b/Bigtable/src/V2/Mutation/SetCell.php index bfe91782bbed..b156e5d5d564 100644 --- a/Bigtable/src/V2/Mutation/SetCell.php +++ b/Bigtable/src/V2/Mutation/SetCell.php @@ -21,14 +21,14 @@ class SetCell extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string family_name = 1; */ - private $family_name = ''; + protected $family_name = ''; /** * The qualifier of the column into which new data should be written. * Can be any byte string, including the empty string. * * Generated from protobuf field bytes column_qualifier = 2; */ - private $column_qualifier = ''; + protected $column_qualifier = ''; /** * The timestamp of the cell into which new data should be written. * Use -1 for current Bigtable server time. @@ -38,13 +38,13 @@ class SetCell extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 timestamp_micros = 3; */ - private $timestamp_micros = 0; + protected $timestamp_micros = 0; /** * The value to be written into the specified cell. * * Generated from protobuf field bytes value = 4; */ - private $value = ''; + protected $value = ''; /** * Constructor. diff --git a/Bigtable/src/V2/Mutation_DeleteFromColumn.php b/Bigtable/src/V2/Mutation_DeleteFromColumn.php deleted file mode 100644 index 0cd0013a1e3e..000000000000 --- a/Bigtable/src/V2/Mutation_DeleteFromColumn.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * * Generated from protobuf field string app_profile_id = 2; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * @param string $name Required. The unique name of the instance to check permissions for as well diff --git a/Bigtable/src/V2/RateLimitInfo.php b/Bigtable/src/V2/RateLimitInfo.php index 72593d9d9b69..db1f756b6be9 100644 --- a/Bigtable/src/V2/RateLimitInfo.php +++ b/Bigtable/src/V2/RateLimitInfo.php @@ -25,7 +25,7 @@ class RateLimitInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration period = 1; */ - private $period = null; + protected $period = null; /** * If it has been at least one `period` since the last load adjustment, the * client should multiply the current load by this value to get the new target @@ -38,7 +38,7 @@ class RateLimitInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double factor = 2; */ - private $factor = 0.0; + protected $factor = 0.0; /** * Constructor. diff --git a/Bigtable/src/V2/ReadChangeStreamRequest.php b/Bigtable/src/V2/ReadChangeStreamRequest.php index b9fd1baa84e5..cac57eea1345 100644 --- a/Bigtable/src/V2/ReadChangeStreamRequest.php +++ b/Bigtable/src/V2/ReadChangeStreamRequest.php @@ -24,7 +24,7 @@ class ReadChangeStreamRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $table_name = ''; + protected $table_name = ''; /** * This value specifies routing for replication. If not specified, the * "default" application profile will be used. @@ -32,13 +32,13 @@ class ReadChangeStreamRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string app_profile_id = 2; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * The partition to read changes from. * * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 3; */ - private $partition = null; + protected $partition = null; /** * If specified, OK will be returned when the stream advances beyond * this time. Otherwise, changes will be continuously delivered on the stream. @@ -46,14 +46,14 @@ class ReadChangeStreamRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; */ - private $end_time = null; + protected $end_time = null; /** * If specified, the duration between `Heartbeat` messages on the stream. * Otherwise, defaults to 5 seconds. * * Generated from protobuf field .google.protobuf.Duration heartbeat_duration = 7; */ - private $heartbeat_duration = null; + protected $heartbeat_duration = null; protected $start_from; /** diff --git a/Bigtable/src/V2/ReadChangeStreamResponse/CloseStream.php b/Bigtable/src/V2/ReadChangeStreamResponse/CloseStream.php index bc432a594e2e..4551bb34ed65 100644 --- a/Bigtable/src/V2/ReadChangeStreamResponse/CloseStream.php +++ b/Bigtable/src/V2/ReadChangeStreamResponse/CloseStream.php @@ -39,7 +39,7 @@ class CloseStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status status = 1; */ - private $status = null; + protected $status = null; /** * If non-empty, contains the information needed to resume reading their * associated partitions. diff --git a/Bigtable/src/V2/ReadChangeStreamResponse/DataChange.php b/Bigtable/src/V2/ReadChangeStreamResponse/DataChange.php index e1fd22a6fe65..9bb24720fb1a 100644 --- a/Bigtable/src/V2/ReadChangeStreamResponse/DataChange.php +++ b/Bigtable/src/V2/ReadChangeStreamResponse/DataChange.php @@ -25,14 +25,14 @@ class DataChange extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; */ - private $type = 0; + protected $type = 0; /** * The cluster where the mutation was applied. * Not set when `type` is `GARBAGE_COLLECTION`. * * Generated from protobuf field string source_cluster_id = 2; */ - private $source_cluster_id = ''; + protected $source_cluster_id = ''; /** * The row key for all mutations that are part of this `DataChange`. * If the `DataChange` is chunked across multiple messages, then this field @@ -40,13 +40,13 @@ class DataChange extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes row_key = 3; */ - private $row_key = ''; + protected $row_key = ''; /** * The timestamp at which the mutation was applied on the Bigtable server. * * Generated from protobuf field .google.protobuf.Timestamp commit_timestamp = 4; */ - private $commit_timestamp = null; + protected $commit_timestamp = null; /** * A value that lets stream consumers reconstruct Bigtable's * conflict resolution semantics. @@ -58,7 +58,7 @@ class DataChange extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 tiebreaker = 5; */ - private $tiebreaker = 0; + protected $tiebreaker = 0; /** * The mutations associated with this change to the partition. * May contain complete mutations or chunks of a multi-message chunked @@ -73,14 +73,14 @@ class DataChange extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool done = 8; */ - private $done = false; + protected $done = false; /** * An encoded position for this stream's partition to restart reading from. * This token is for the StreamPartition from the request. * * Generated from protobuf field string token = 9; */ - private $token = ''; + protected $token = ''; /** * An estimate of the commit timestamp that is usually lower than or equal * to any timestamp for a record that will be delivered in the future on the @@ -91,7 +91,7 @@ class DataChange extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp estimated_low_watermark = 10; */ - private $estimated_low_watermark = null; + protected $estimated_low_watermark = null; /** * Constructor. diff --git a/Bigtable/src/V2/ReadChangeStreamResponse/Heartbeat.php b/Bigtable/src/V2/ReadChangeStreamResponse/Heartbeat.php index b2dd35fa7fbd..e20a2f711230 100644 --- a/Bigtable/src/V2/ReadChangeStreamResponse/Heartbeat.php +++ b/Bigtable/src/V2/ReadChangeStreamResponse/Heartbeat.php @@ -22,7 +22,7 @@ class Heartbeat extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.StreamContinuationToken continuation_token = 1; */ - private $continuation_token = null; + protected $continuation_token = null; /** * An estimate of the commit timestamp that is usually lower than or equal * to any timestamp for a record that will be delivered in the future on the @@ -33,7 +33,7 @@ class Heartbeat extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp estimated_low_watermark = 2; */ - private $estimated_low_watermark = null; + protected $estimated_low_watermark = null; /** * Constructor. diff --git a/Bigtable/src/V2/ReadChangeStreamResponse/MutationChunk.php b/Bigtable/src/V2/ReadChangeStreamResponse/MutationChunk.php index c6bb931d5d08..861921c6235d 100644 --- a/Bigtable/src/V2/ReadChangeStreamResponse/MutationChunk.php +++ b/Bigtable/src/V2/ReadChangeStreamResponse/MutationChunk.php @@ -21,7 +21,7 @@ class MutationChunk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; */ - private $chunk_info = null; + protected $chunk_info = null; /** * If this is a continuation of a chunked message (`chunked_value_offset` > * 0), ignore all fields except the `SetCell`'s value and merge it with @@ -29,7 +29,7 @@ class MutationChunk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.Mutation mutation = 2; */ - private $mutation = null; + protected $mutation = null; /** * Constructor. diff --git a/Bigtable/src/V2/ReadChangeStreamResponse/MutationChunk/ChunkInfo.php b/Bigtable/src/V2/ReadChangeStreamResponse/MutationChunk/ChunkInfo.php index 174f68585200..f8a6c673c8bf 100644 --- a/Bigtable/src/V2/ReadChangeStreamResponse/MutationChunk/ChunkInfo.php +++ b/Bigtable/src/V2/ReadChangeStreamResponse/MutationChunk/ChunkInfo.php @@ -22,20 +22,20 @@ class ChunkInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 chunked_value_size = 1; */ - private $chunked_value_size = 0; + protected $chunked_value_size = 0; /** * The byte offset of this chunk into the total value size of the * mutation. * * Generated from protobuf field int32 chunked_value_offset = 2; */ - private $chunked_value_offset = 0; + protected $chunked_value_offset = 0; /** * When true, this is the last chunk of a chunked `SetCell`. * * Generated from protobuf field bool last_chunk = 3; */ - private $last_chunk = false; + protected $last_chunk = false; /** * Constructor. diff --git a/Bigtable/src/V2/ReadChangeStreamResponse_CloseStream.php b/Bigtable/src/V2/ReadChangeStreamResponse_CloseStream.php deleted file mode 100644 index dd23b1d8efa7..000000000000 --- a/Bigtable/src/V2/ReadChangeStreamResponse_CloseStream.php +++ /dev/null @@ -1,16 +0,0 @@ -google.bigtable.v2.ReadEfficiencyStats - */ -class ReadEfficiencyStats extends \Google\Protobuf\Internal\Message -{ - /** - * Iteration stats describe how efficient the read is, e.g. comparing - * rows seen vs. rows returned or cells seen vs cells returned can provide an - * indication of read efficiency (the higher the ratio of seen to retuned the - * better). - * - * Generated from protobuf field .google.bigtable.v2.ReadIteratorStats read_iterator_stats = 1; - */ - private $read_iterator_stats = null; - /** - * Request latency stats describe the time taken to complete a request, from - * the server side. - * - * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; - */ - private $request_latency_stats = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Bigtable\V2\ReadIteratorStats $read_iterator_stats - * Iteration stats describe how efficient the read is, e.g. comparing - * rows seen vs. rows returned or cells seen vs cells returned can provide an - * indication of read efficiency (the higher the ratio of seen to retuned the - * better). - * @type \Google\Cloud\Bigtable\V2\RequestLatencyStats $request_latency_stats - * Request latency stats describe the time taken to complete a request, from - * the server side. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Bigtable\V2\RequestStats::initOnce(); - parent::__construct($data); - } - - /** - * Iteration stats describe how efficient the read is, e.g. comparing - * rows seen vs. rows returned or cells seen vs cells returned can provide an - * indication of read efficiency (the higher the ratio of seen to retuned the - * better). - * - * Generated from protobuf field .google.bigtable.v2.ReadIteratorStats read_iterator_stats = 1; - * @return \Google\Cloud\Bigtable\V2\ReadIteratorStats|null - */ - public function getReadIteratorStats() - { - return $this->read_iterator_stats; - } - - public function hasReadIteratorStats() - { - return isset($this->read_iterator_stats); - } - - public function clearReadIteratorStats() - { - unset($this->read_iterator_stats); - } - - /** - * Iteration stats describe how efficient the read is, e.g. comparing - * rows seen vs. rows returned or cells seen vs cells returned can provide an - * indication of read efficiency (the higher the ratio of seen to retuned the - * better). - * - * Generated from protobuf field .google.bigtable.v2.ReadIteratorStats read_iterator_stats = 1; - * @param \Google\Cloud\Bigtable\V2\ReadIteratorStats $var - * @return $this - */ - public function setReadIteratorStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadIteratorStats::class); - $this->read_iterator_stats = $var; - - return $this; - } - - /** - * Request latency stats describe the time taken to complete a request, from - * the server side. - * - * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; - * @return \Google\Cloud\Bigtable\V2\RequestLatencyStats|null - */ - public function getRequestLatencyStats() - { - return $this->request_latency_stats; - } - - public function hasRequestLatencyStats() - { - return isset($this->request_latency_stats); - } - - public function clearRequestLatencyStats() - { - unset($this->request_latency_stats); - } - - /** - * Request latency stats describe the time taken to complete a request, from - * the server side. - * - * Generated from protobuf field .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; - * @param \Google\Cloud\Bigtable\V2\RequestLatencyStats $var - * @return $this - */ - public function setRequestLatencyStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RequestLatencyStats::class); - $this->request_latency_stats = $var; - - return $this; - } - -} - diff --git a/Bigtable/src/V2/ReadIterationStats.php b/Bigtable/src/V2/ReadIterationStats.php index d956a7d0c9f5..f226aa85abc9 100644 --- a/Bigtable/src/V2/ReadIterationStats.php +++ b/Bigtable/src/V2/ReadIterationStats.php @@ -23,26 +23,26 @@ class ReadIterationStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 rows_seen_count = 1; */ - private $rows_seen_count = 0; + protected $rows_seen_count = 0; /** * The rows returned as part of the request. * * Generated from protobuf field int64 rows_returned_count = 2; */ - private $rows_returned_count = 0; + protected $rows_returned_count = 0; /** * The cells seen (scanned) as part of the request. This includes the count of * cells returned, as captured below. * * Generated from protobuf field int64 cells_seen_count = 3; */ - private $cells_seen_count = 0; + protected $cells_seen_count = 0; /** * The cells returned as part of the request. * * Generated from protobuf field int64 cells_returned_count = 4; */ - private $cells_returned_count = 0; + protected $cells_returned_count = 0; /** * Constructor. diff --git a/Bigtable/src/V2/ReadIteratorStats.php b/Bigtable/src/V2/ReadIteratorStats.php deleted file mode 100644 index 03a87f6900df..000000000000 --- a/Bigtable/src/V2/ReadIteratorStats.php +++ /dev/null @@ -1,213 +0,0 @@ -google.bigtable.v2.ReadIteratorStats - */ -class ReadIteratorStats extends \Google\Protobuf\Internal\Message -{ - /** - * The rows seen (scanned) as part of the request. This includes the count of - * rows returned, as captured below. - * - * Generated from protobuf field int64 rows_seen_count = 1; - */ - private $rows_seen_count = 0; - /** - * The rows returned as part of the request. - * - * Generated from protobuf field int64 rows_returned_count = 2; - */ - private $rows_returned_count = 0; - /** - * The cells seen (scanned) as part of the request. This includes the count of - * cells returned, as captured below. - * - * Generated from protobuf field int64 cells_seen_count = 3; - */ - private $cells_seen_count = 0; - /** - * The cells returned as part of the request. - * - * Generated from protobuf field int64 cells_returned_count = 4; - */ - private $cells_returned_count = 0; - /** - * The deletes seen as part of the request. - * - * Generated from protobuf field int64 deletes_seen_count = 5; - */ - private $deletes_seen_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $rows_seen_count - * The rows seen (scanned) as part of the request. This includes the count of - * rows returned, as captured below. - * @type int|string $rows_returned_count - * The rows returned as part of the request. - * @type int|string $cells_seen_count - * The cells seen (scanned) as part of the request. This includes the count of - * cells returned, as captured below. - * @type int|string $cells_returned_count - * The cells returned as part of the request. - * @type int|string $deletes_seen_count - * The deletes seen as part of the request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Bigtable\V2\RequestStats::initOnce(); - parent::__construct($data); - } - - /** - * The rows seen (scanned) as part of the request. This includes the count of - * rows returned, as captured below. - * - * Generated from protobuf field int64 rows_seen_count = 1; - * @return int|string - */ - public function getRowsSeenCount() - { - return $this->rows_seen_count; - } - - /** - * The rows seen (scanned) as part of the request. This includes the count of - * rows returned, as captured below. - * - * Generated from protobuf field int64 rows_seen_count = 1; - * @param int|string $var - * @return $this - */ - public function setRowsSeenCount($var) - { - GPBUtil::checkInt64($var); - $this->rows_seen_count = $var; - - return $this; - } - - /** - * The rows returned as part of the request. - * - * Generated from protobuf field int64 rows_returned_count = 2; - * @return int|string - */ - public function getRowsReturnedCount() - { - return $this->rows_returned_count; - } - - /** - * The rows returned as part of the request. - * - * Generated from protobuf field int64 rows_returned_count = 2; - * @param int|string $var - * @return $this - */ - public function setRowsReturnedCount($var) - { - GPBUtil::checkInt64($var); - $this->rows_returned_count = $var; - - return $this; - } - - /** - * The cells seen (scanned) as part of the request. This includes the count of - * cells returned, as captured below. - * - * Generated from protobuf field int64 cells_seen_count = 3; - * @return int|string - */ - public function getCellsSeenCount() - { - return $this->cells_seen_count; - } - - /** - * The cells seen (scanned) as part of the request. This includes the count of - * cells returned, as captured below. - * - * Generated from protobuf field int64 cells_seen_count = 3; - * @param int|string $var - * @return $this - */ - public function setCellsSeenCount($var) - { - GPBUtil::checkInt64($var); - $this->cells_seen_count = $var; - - return $this; - } - - /** - * The cells returned as part of the request. - * - * Generated from protobuf field int64 cells_returned_count = 4; - * @return int|string - */ - public function getCellsReturnedCount() - { - return $this->cells_returned_count; - } - - /** - * The cells returned as part of the request. - * - * Generated from protobuf field int64 cells_returned_count = 4; - * @param int|string $var - * @return $this - */ - public function setCellsReturnedCount($var) - { - GPBUtil::checkInt64($var); - $this->cells_returned_count = $var; - - return $this; - } - - /** - * The deletes seen as part of the request. - * - * Generated from protobuf field int64 deletes_seen_count = 5; - * @return int|string - */ - public function getDeletesSeenCount() - { - return $this->deletes_seen_count; - } - - /** - * The deletes seen as part of the request. - * - * Generated from protobuf field int64 deletes_seen_count = 5; - * @param int|string $var - * @return $this - */ - public function setDeletesSeenCount($var) - { - GPBUtil::checkInt64($var); - $this->deletes_seen_count = $var; - - return $this; - } - -} - diff --git a/Bigtable/src/V2/ReadModifyWriteRowRequest.php b/Bigtable/src/V2/ReadModifyWriteRowRequest.php index d7d0a6df01b8..ab877a010aab 100644 --- a/Bigtable/src/V2/ReadModifyWriteRowRequest.php +++ b/Bigtable/src/V2/ReadModifyWriteRowRequest.php @@ -23,7 +23,7 @@ class ReadModifyWriteRowRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $table_name = ''; + protected $table_name = ''; /** * Optional. The unique name of the AuthorizedView to which the * read/modify/write rules should be applied. @@ -32,21 +32,21 @@ class ReadModifyWriteRowRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $authorized_view_name = ''; + protected $authorized_view_name = ''; /** * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * * Generated from protobuf field string app_profile_id = 4; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * Required. The key of the row to which the read/modify/write rules should be * applied. * * Generated from protobuf field bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $row_key = ''; + protected $row_key = ''; /** * Required. Rules specifying how the specified row's contents are to be * transformed into writes. Entries are applied in order, meaning that earlier diff --git a/Bigtable/src/V2/ReadModifyWriteRowResponse.php b/Bigtable/src/V2/ReadModifyWriteRowResponse.php index 74b5b8fb2baa..1b1c1cdac4a9 100644 --- a/Bigtable/src/V2/ReadModifyWriteRowResponse.php +++ b/Bigtable/src/V2/ReadModifyWriteRowResponse.php @@ -20,7 +20,7 @@ class ReadModifyWriteRowResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.Row row = 1; */ - private $row = null; + protected $row = null; /** * Constructor. diff --git a/Bigtable/src/V2/ReadModifyWriteRule.php b/Bigtable/src/V2/ReadModifyWriteRule.php index e38ec7a115a7..1afafb1f597a 100644 --- a/Bigtable/src/V2/ReadModifyWriteRule.php +++ b/Bigtable/src/V2/ReadModifyWriteRule.php @@ -22,7 +22,7 @@ class ReadModifyWriteRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string family_name = 1; */ - private $family_name = ''; + protected $family_name = ''; /** * The qualifier of the column to which the read/modify/write should be * applied. @@ -30,7 +30,7 @@ class ReadModifyWriteRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes column_qualifier = 2; */ - private $column_qualifier = ''; + protected $column_qualifier = ''; protected $rule; /** diff --git a/Bigtable/src/V2/ReadRowsRequest.php b/Bigtable/src/V2/ReadRowsRequest.php index d5821fca7945..d8401d3e4c46 100644 --- a/Bigtable/src/V2/ReadRowsRequest.php +++ b/Bigtable/src/V2/ReadRowsRequest.php @@ -22,7 +22,7 @@ class ReadRowsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $table_name = ''; + protected $table_name = ''; /** * Optional. The unique name of the AuthorizedView from which to read. * Values are of the form @@ -30,41 +30,41 @@ class ReadRowsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $authorized_view_name = ''; + protected $authorized_view_name = ''; /** * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * * Generated from protobuf field string app_profile_id = 5; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * The row keys and/or ranges to read sequentially. If not specified, reads * from all rows. * * Generated from protobuf field .google.bigtable.v2.RowSet rows = 2; */ - private $rows = null; + protected $rows = null; /** * The filter to apply to the contents of the specified row(s). If unset, * reads the entirety of each row. * * Generated from protobuf field .google.bigtable.v2.RowFilter filter = 3; */ - private $filter = null; + protected $filter = null; /** * The read will stop after committing to N rows' worth of results. The * default (zero) is to return all results. * * Generated from protobuf field int64 rows_limit = 4; */ - private $rows_limit = 0; + protected $rows_limit = 0; /** * The view into RequestStats, as described above. * * Generated from protobuf field .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; */ - private $request_stats_view = 0; + protected $request_stats_view = 0; /** * Experimental API - Please note that this API is currently experimental * and can change in the future. @@ -78,7 +78,7 @@ class ReadRowsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool reversed = 7; */ - private $reversed = false; + protected $reversed = false; /** * @param string $tableName Optional. The unique name of the table from which to read. diff --git a/Bigtable/src/V2/ReadRowsRequest_RequestStatsView.php b/Bigtable/src/V2/ReadRowsRequest_RequestStatsView.php deleted file mode 100644 index bd74e290a997..000000000000 --- a/Bigtable/src/V2/ReadRowsRequest_RequestStatsView.php +++ /dev/null @@ -1,16 +0,0 @@ -bytes last_scanned_row_key = 2; */ - private $last_scanned_row_key = ''; + protected $last_scanned_row_key = ''; /** * If requested, provide enhanced query performance statistics. The semantics * dictate: @@ -54,7 +54,7 @@ class ReadRowsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.RequestStats request_stats = 3; */ - private $request_stats = null; + protected $request_stats = null; /** * Constructor. diff --git a/Bigtable/src/V2/ReadRowsResponse/CellChunk.php b/Bigtable/src/V2/ReadRowsResponse/CellChunk.php index 152f9b5353d7..0ff8217f7de4 100644 --- a/Bigtable/src/V2/ReadRowsResponse/CellChunk.php +++ b/Bigtable/src/V2/ReadRowsResponse/CellChunk.php @@ -24,7 +24,7 @@ class CellChunk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes row_key = 1; */ - private $row_key = ''; + protected $row_key = ''; /** * The column family name for this chunk of data. If this message * is not present this CellChunk is a continuation of the same column @@ -35,7 +35,7 @@ class CellChunk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.StringValue family_name = 2; */ - private $family_name = null; + protected $family_name = null; /** * The column qualifier for this chunk of data. If this message * is not present, this CellChunk is a continuation of the same column @@ -45,7 +45,7 @@ class CellChunk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; */ - private $qualifier = null; + protected $qualifier = null; /** * The cell's stored timestamp, which also uniquely identifies it * within its column. Values are always expressed in @@ -58,7 +58,7 @@ class CellChunk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 timestamp_micros = 4; */ - private $timestamp_micros = 0; + protected $timestamp_micros = 0; /** * Labels applied to the cell by a * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set @@ -76,7 +76,7 @@ class CellChunk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes value = 6; */ - private $value = ''; + protected $value = ''; /** * If this CellChunk is part of a chunked cell value and this is * not the final chunk of that cell, value_size will be set to the @@ -85,7 +85,7 @@ class CellChunk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 value_size = 7; */ - private $value_size = 0; + protected $value_size = 0; protected $row_status; /** @@ -220,7 +220,7 @@ public function clearFamilyName() * Generated from protobuf field .google.protobuf.StringValue family_name = 2; * @return string|null */ - public function getFamilyNameValue() + public function getFamilyNameUnwrapped() { return $this->readWrapperValue("family_name"); } @@ -259,7 +259,7 @@ public function setFamilyName($var) * @param string|null $var * @return $this */ - public function setFamilyNameValue($var) + public function setFamilyNameUnwrapped($var) { $this->writeWrapperValue("family_name", $var); return $this;} @@ -301,7 +301,7 @@ public function clearQualifier() * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; * @return string|null */ - public function getQualifierValue() + public function getQualifierUnwrapped() { return $this->readWrapperValue("qualifier"); } @@ -338,7 +338,7 @@ public function setQualifier($var) * @param string|null $var * @return $this */ - public function setQualifierValue($var) + public function setQualifierUnwrapped($var) { $this->writeWrapperValue("qualifier", $var); return $this;} diff --git a/Bigtable/src/V2/ReadRowsResponse_CellChunk.php b/Bigtable/src/V2/ReadRowsResponse_CellChunk.php deleted file mode 100644 index 8b3e65f4fb19..000000000000 --- a/Bigtable/src/V2/ReadRowsResponse_CellChunk.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.protobuf.Duration frontend_server_latency = 1; */ - private $frontend_server_latency = null; + protected $frontend_server_latency = null; /** * Constructor. diff --git a/Bigtable/src/V2/ResponseParams.php b/Bigtable/src/V2/ResponseParams.php index 201a3a427806..08a68a68ff05 100644 --- a/Bigtable/src/V2/ResponseParams.php +++ b/Bigtable/src/V2/ResponseParams.php @@ -23,14 +23,14 @@ class ResponseParams extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional string zone_id = 1; */ - private $zone_id = null; + protected $zone_id = null; /** * Identifier for a cluster that represents set of * bigtable resources. * * Generated from protobuf field optional string cluster_id = 2; */ - private $cluster_id = null; + protected $cluster_id = null; /** * Constructor. diff --git a/Bigtable/src/V2/Row.php b/Bigtable/src/V2/Row.php index 2b02b14d37e8..ad1d56187e7a 100644 --- a/Bigtable/src/V2/Row.php +++ b/Bigtable/src/V2/Row.php @@ -23,7 +23,7 @@ class Row extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes key = 1; */ - private $key = ''; + protected $key = ''; /** * May be empty, but only if the entire row is empty. * The mutual ordering of column families is not specified. diff --git a/Bigtable/src/V2/RowFilter/Condition.php b/Bigtable/src/V2/RowFilter/Condition.php index 546e900076da..f7e66bf81817 100644 --- a/Bigtable/src/V2/RowFilter/Condition.php +++ b/Bigtable/src/V2/RowFilter/Condition.php @@ -26,14 +26,14 @@ class Condition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; */ - private $predicate_filter = null; + protected $predicate_filter = null; /** * The filter to apply to the input row if `predicate_filter` returns any * results. If not provided, no results will be returned in the true case. * * Generated from protobuf field .google.bigtable.v2.RowFilter true_filter = 2; */ - private $true_filter = null; + protected $true_filter = null; /** * The filter to apply to the input row if `predicate_filter` does not * return any results. If not provided, no results will be returned in the @@ -41,7 +41,7 @@ class Condition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; */ - private $false_filter = null; + protected $false_filter = null; /** * Constructor. diff --git a/Bigtable/src/V2/RowFilter_Chain.php b/Bigtable/src/V2/RowFilter_Chain.php deleted file mode 100644 index 7b673832ddcc..000000000000 --- a/Bigtable/src/V2/RowFilter_Chain.php +++ /dev/null @@ -1,16 +0,0 @@ -string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $table_name = ''; + protected $table_name = ''; /** * Optional. The unique name of the AuthorizedView from which to sample row * keys. @@ -31,14 +31,14 @@ class SampleRowKeysRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $authorized_view_name = ''; + protected $authorized_view_name = ''; /** * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * * Generated from protobuf field string app_profile_id = 2; */ - private $app_profile_id = ''; + protected $app_profile_id = ''; /** * @param string $tableName Optional. The unique name of the table from which to sample row keys. diff --git a/Bigtable/src/V2/SampleRowKeysResponse.php b/Bigtable/src/V2/SampleRowKeysResponse.php index 2dc0b5c3b217..1c38c831d343 100644 --- a/Bigtable/src/V2/SampleRowKeysResponse.php +++ b/Bigtable/src/V2/SampleRowKeysResponse.php @@ -26,7 +26,7 @@ class SampleRowKeysResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes row_key = 1; */ - private $row_key = ''; + protected $row_key = ''; /** * Approximate total storage space used by all rows in the table which precede * `row_key`. Buffering the contents of all rows between two subsequent @@ -35,7 +35,7 @@ class SampleRowKeysResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 offset_bytes = 2; */ - private $offset_bytes = 0; + protected $offset_bytes = 0; /** * Constructor. diff --git a/Bigtable/src/V2/StreamContinuationToken.php b/Bigtable/src/V2/StreamContinuationToken.php index e0cf4401cf9c..9a623c62ebaa 100644 --- a/Bigtable/src/V2/StreamContinuationToken.php +++ b/Bigtable/src/V2/StreamContinuationToken.php @@ -22,13 +22,13 @@ class StreamContinuationToken extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.StreamPartition partition = 1; */ - private $partition = null; + protected $partition = null; /** * An encoded position in the stream to restart reading from. * * Generated from protobuf field string token = 2; */ - private $token = ''; + protected $token = ''; /** * Constructor. diff --git a/Bigtable/src/V2/StreamPartition.php b/Bigtable/src/V2/StreamPartition.php index 41ba99037b30..2efb7f58fd23 100644 --- a/Bigtable/src/V2/StreamPartition.php +++ b/Bigtable/src/V2/StreamPartition.php @@ -22,7 +22,7 @@ class StreamPartition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.bigtable.v2.RowRange row_range = 1; */ - private $row_range = null; + protected $row_range = null; /** * Constructor. diff --git a/Bigtable/src/V2/TimestampRange.php b/Bigtable/src/V2/TimestampRange.php index a75b65d5f109..ddd1bcea30d4 100644 --- a/Bigtable/src/V2/TimestampRange.php +++ b/Bigtable/src/V2/TimestampRange.php @@ -20,13 +20,13 @@ class TimestampRange extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 start_timestamp_micros = 1; */ - private $start_timestamp_micros = 0; + protected $start_timestamp_micros = 0; /** * Exclusive upper bound. If left empty, interpreted as infinity. * * Generated from protobuf field int64 end_timestamp_micros = 2; */ - private $end_timestamp_micros = 0; + protected $end_timestamp_micros = 0; /** * Constructor. diff --git a/Bigtable/tests/Snippet/ChunkFormatterTest.php b/Bigtable/tests/Snippet/ChunkFormatterTest.php index 0d4ac6a163dd..1b44d20b5e20 100644 --- a/Bigtable/tests/Snippet/ChunkFormatterTest.php +++ b/Bigtable/tests/Snippet/ChunkFormatterTest.php @@ -17,12 +17,15 @@ namespace Google\Cloud\Bigtable\Tests\Snippet; +use Google\ApiCore\Serializer; use \Google\ApiCore\ServerStream; use Google\Cloud\Bigtable\ChunkFormatter; use Google\Cloud\Bigtable\Table; -use Google\Cloud\Bigtable\V2\BigtableClient as TableClient; +use Google\Cloud\Bigtable\V2\Client\BigtableClient as TableClient; +use Google\Cloud\Bigtable\V2\ReadRowsRequest; use Google\Cloud\Core\Testing\Snippet\SnippetTestCase; use Google\Cloud\Core\Testing\TestHelpers; +use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; /** @@ -47,6 +50,7 @@ public function setUp(): void Table::class, [ $this->bigtableClient->reveal(), + new Serializer(), self::TABLE_NAME ] ); @@ -63,11 +67,13 @@ public function testClass() $this->serverStream->readAll() ->shouldBeCalled() ->willReturn([]); - $this->bigtableClient->readRows(self::TABLE_NAME, []) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $snippet->addLocal('table', $this->table); $res = $snippet->invoke('formatter'); $this->assertInstanceOf(ChunkFormatter::class, $res->returnVal()); diff --git a/Bigtable/tests/Snippet/TableTest.php b/Bigtable/tests/Snippet/TableTest.php index 49adb17bd0a3..cc477087ceba 100644 --- a/Bigtable/tests/Snippet/TableTest.php +++ b/Bigtable/tests/Snippet/TableTest.php @@ -17,28 +17,35 @@ namespace Google\Cloud\Bigtable\Tests\Snippet; +use Google\ApiCore\Serializer; use Google\ApiCore\ServerStream; use Google\Cloud\Bigtable\DataUtil; use Google\Cloud\Bigtable\Mutations; use Google\Cloud\Bigtable\ReadModifyWriteRowRules; use Google\Cloud\Bigtable\Table; -use Google\Cloud\Bigtable\V2\BigtableClient as TableClient; +use Google\Cloud\Bigtable\V2\Client\BigtableClient as TableClient; use Google\Cloud\Bigtable\V2\Cell; +use Google\Cloud\Bigtable\V2\CheckAndMutateRowRequest; use Google\Cloud\Bigtable\V2\CheckAndMutateRowResponse; use Google\Cloud\Bigtable\V2\Column; use Google\Cloud\Bigtable\V2\Family; +use Google\Cloud\Bigtable\V2\MutateRowRequest; use Google\Cloud\Bigtable\V2\MutateRowResponse; +use Google\Cloud\Bigtable\V2\MutateRowsRequest; use Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry as MutateRowsRequest_Entry; use Google\Cloud\Bigtable\V2\MutateRowsResponse; use Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry as MutateRowsResponse_Entry; use Google\Cloud\Bigtable\V2\Mutation; use Google\Cloud\Bigtable\V2\Mutation\SetCell; +use Google\Cloud\Bigtable\V2\ReadModifyWriteRowRequest; use Google\Cloud\Bigtable\V2\ReadModifyWriteRowResponse; +use Google\Cloud\Bigtable\V2\ReadRowsRequest; use Google\Cloud\Bigtable\V2\ReadRowsResponse; -use Google\Cloud\Bigtable\V2\ReadRowsResponse_CellChunk as ReadRowsResponse_CellChunk; +use Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk; use Google\Cloud\Bigtable\V2\Row; use Google\Cloud\Bigtable\V2\RowRange; use Google\Cloud\Bigtable\V2\RowSet; +use Google\Cloud\Bigtable\V2\SampleRowKeysRequest; use Google\Cloud\Bigtable\V2\SampleRowKeysResponse; use Google\Cloud\Core\Testing\Snippet\SnippetTestCase; use Google\Cloud\Core\Testing\TestHelpers; @@ -93,6 +100,7 @@ public function setUp(): void Table::class, [ $this->bigtableClient->reveal(), + new Serializer(), self::TABLE_NAME ] ); @@ -117,11 +125,13 @@ public function testMutateRows() ->willReturn( $this->arrayAsGenerator($this->mutateRowsResponses) ); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, []) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $snippet = $this->snippetFromMethod(Table::class, 'mutateRows'); $snippet->addLocal('table', $this->table); $snippet->invoke(); @@ -131,11 +141,13 @@ public function testMutateRow() { $mutations = (new Mutations) ->upsert('cf1', 'cq1', 'value1', 1534183334215000); - $this->bigtableClient->mutateRow(self::TABLE_NAME, 'r1', $mutations->toProto(), []) - ->shouldBeCalled() - ->willReturn( - new MutateRowResponse - ); + $this->bigtableClient->mutateRow( + Argument::type(MutateRowRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + new MutateRowResponse + ); $snippet = $this->snippetFromMethod(Table::class, 'mutateRow'); $snippet->addLocal('table', $this->table); $snippet->invoke(); @@ -148,11 +160,13 @@ public function testUpsert() ->willReturn( $this->arrayAsGenerator($this->mutateRowsResponses) ); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, []) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $snippet = $this->snippetFromMethod(Table::class, 'upsert'); $snippet->addLocal('table', $this->table); $snippet->invoke(); @@ -165,11 +179,13 @@ public function testReadRows() ->willReturn( $this->arrayAsGenerator([$this->setUpReadRowsResponse()]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, []) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $snippet = $this->snippetFromMethod(Table::class, 'readRows'); $snippet->addLocal('table', $this->table); $res = $snippet->invoke('rows'); @@ -200,11 +216,13 @@ public function testReadRowsWithRowRanges() ->setEndKeyOpen('lincoln'); $rowSet = (new RowSet()) ->setRowRanges([$rowRange]); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($rowSet) { - return $argument['rows']->serializeToJsonString() === $rowSet->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn($this->serverStream->reveal()); + $this->bigtableClient->readRows( + Argument::that(function ($request) use ($rowSet) { + return $request->getRows()->serializeToJsonString() === $rowSet->serializeToJsonString(); + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn($this->serverStream->reveal()); $snippet = $this->snippetFromMethod(Table::class, 'readRows', 1); $snippet->addLocal('table', $this->table); @@ -233,11 +251,13 @@ public function testReadRow() ); $rowSet = (new RowSet()) ->setRowKeys(['jefferson']); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($rowSet) { - return $argument['rows']->serializeToJsonString() === $rowSet->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn($this->serverStream->reveal()); + $this->bigtableClient->readRows( + Argument::that(function ($request) use ($rowSet) { + return $request->getRows()->serializeToJsonString() === $rowSet->serializeToJsonString(); + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn($this->serverStream->reveal()); $snippet = $this->snippetFromMethod(Table::class, 'readRow'); $snippet->addLocal('table', $this->table); $res = $snippet->invoke('row'); @@ -279,10 +299,8 @@ public function testReadModifyWriteRowAppend() ->append('cf1', 'cq1', 'value12'); $this->bigtableClient ->readModifyWriteRow( - self::TABLE_NAME, - 'rk1', - $readModifyWriteRowRules->toProto(), - [] + Argument::type(ReadModifyWriteRowRequest::class), + Argument::type('array') ) ->shouldBeCalled() ->willReturn( @@ -320,11 +338,13 @@ public function testReadModifyWriteRowIncrement() ->willReturn( $this->arrayAsGenerator($this->mutateRowsResponses) ); - $this->bigtableClient->mutateRows(self::TABLE_NAME, Argument::any(), []) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $readModifyWriteRowResponse = (new ReadModifyWriteRowResponse) ->setRow( (new Row) @@ -346,12 +366,9 @@ public function testReadModifyWriteRowIncrement() ->increment('cf1', 'cq1', 3); $this->bigtableClient ->readModifyWriteRow( - self::TABLE_NAME, - 'rk1', - $readModifyWriteRowRules->toProto(), - [] - ) - ->shouldBeCalled() + Argument::type(ReadModifyWriteRowRequest::class), + Argument::type('array') + )->shouldBeCalled() ->willReturn( $readModifyWriteRowResponse ); @@ -383,11 +400,13 @@ public function testSampleRowKeys() ->willReturn( $this->arrayAsGenerator($sampleRowKeyResponses) ); - $this->bigtableClient->sampleRowKeys(self::TABLE_NAME, []) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->sampleRowKeys( + Argument::type(SampleRowKeysRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $snippet = $this->snippetFromMethod(Table::class, 'sampleRowKeys'); $snippet->addLocal('table', $this->table); $res = $snippet->invoke('rowKeyStream'); @@ -403,9 +422,11 @@ public function testSampleRowKeys() public function testCheckAndMutateRow() { - $this->bigtableClient->checkAndMutateRow(self::TABLE_NAME, 'rk1', Argument::any()) - ->shouldBeCalled() - ->willReturn((new CheckAndMutateRowResponse)->setPredicateMatched(true)); + $this->bigtableClient->checkAndMutateRow( + Argument::type(CheckAndMutateRowRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn((new CheckAndMutateRowResponse)->setPredicateMatched(true)); $snippet = $this->snippetFromMethod(Table::class, 'checkAndMutateRow'); $snippet->addLocal('table', $this->table); $res = $snippet->invoke('result'); @@ -416,9 +437,8 @@ public function testCheckAndMutateRowWithFilter() { $this->bigtableClient ->checkAndMutateRow( - self::TABLE_NAME, - 'rk1', - Argument::any() + Argument::type(CheckAndMutateRowRequest::class), + Argument::type('array') ) ->shouldBeCalled() ->willReturn((new CheckAndMutateRowResponse)->setPredicateMatched(true)); @@ -432,7 +452,7 @@ private function setUpReadRowsResponse() { $readRowsResponse = new ReadRowsResponse; $chunks = []; - $chunk = new ReadRowsResponse_CellChunk(); + $chunk = new CellChunk(); $chunk->setRowKey('rk1'); $stringValue = new StringValue(); $stringValue->setValue('cf1'); diff --git a/Bigtable/tests/System/BackupTests.php b/Bigtable/tests/System/BackupTests.php index 305814638b46..854718d0ff54 100644 --- a/Bigtable/tests/System/BackupTests.php +++ b/Bigtable/tests/System/BackupTests.php @@ -20,9 +20,17 @@ use Exception; use Google\ApiCore\ApiException; use Google\Cloud\Bigtable\Admin\V2\Backup; -use Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient; -use Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient; +use Google\Cloud\Bigtable\Admin\V2\Client\BigtableInstanceAdminClient; +use Google\Cloud\Bigtable\Admin\V2\Client\BigtableTableAdminClient; use Google\Cloud\Bigtable\Admin\V2\Cluster; +use Google\Cloud\Bigtable\Admin\V2\CopyBackupRequest; +use Google\Cloud\Bigtable\Admin\V2\CreateBackupRequest; +use Google\Cloud\Bigtable\Admin\V2\CreateClusterRequest; +use Google\Cloud\Bigtable\Admin\V2\CreateInstanceRequest; +use Google\Cloud\Bigtable\Admin\V2\DeleteBackupRequest; +use Google\Cloud\Bigtable\Admin\V2\DeleteInstanceRequest; +use Google\Cloud\Bigtable\Admin\V2\GetBackupRequest; +use Google\Cloud\Bigtable\Admin\V2\GetInstanceRequest; use Google\Cloud\Bigtable\Admin\V2\Instance; use Google\Cloud\Bigtable\Admin\V2\StorageType; use Google\Protobuf\Timestamp; @@ -106,11 +114,12 @@ public function testCreateBackup(): void self::$instanceId, self::$clusterId ); - $operationResponse = self::$tableAdminClient->createBackup( - $parentName, - self::$backupId, - $backup - ); + $request = new CreateBackupRequest([ + 'parent' => $parentName, + 'backup_id' => self::$backupId, + 'backup' => $backup + ]); + $operationResponse = self::$tableAdminClient->createBackup($request); $operationResponse->pollUntilComplete(); $result = $operationResponse->getResult(); $this->assertStringContainsString(self::$backupName, $result->getName()); @@ -131,13 +140,15 @@ public function testCopyBackupSameProjectDifferentCluster(): void $ex = null; try { - $operationResponse = self::$tableAdminClient->copyBackup( - $clusterName, - self::$copyBackupId, - self::$backupName, - // Setting 10 days expiration time - new Timestamp(['seconds' => time() + self::SECONDS_IN_A_DAY * 10]) - ); + // Setting 10 days expiration time + $expireTime = new Timestamp(['seconds' => time() + self::SECONDS_IN_A_DAY * 10]); + $request = new CopyBackupRequest([ + 'parent' => $clusterName, + 'backup_id' => self::$copyBackupId, + 'source_backup' => self::$backupName, + 'expire_time' => $expireTime + ]); + $operationResponse = self::$tableAdminClient->copyBackup($request); $operationResponse->pollUntilComplete(); $copyBackup = $operationResponse->getResult(); @@ -193,23 +204,26 @@ public function testCopyBackupInDifferentProject(): void $ex = null; try { - $operationResponse = $instanceClient->createInstance( - $projectName, - $instanceId, - $instance, - $clusters - ); + $request = new CreateInstanceRequest([ + 'parent' => $projectName, + 'instance_id' => $instanceId, + 'instance' => $instance, + 'clusters' => $clusters + ]); + $operationResponse = $instanceClient->createInstance($request); $operationResponse->pollUntilComplete(); if (!$operationResponse->operationSucceeded()) { $this->fail("Secondary project's instance creation failed"); } - $operationResponse = $tableClient->copyBackup( - $clusterName, - $copyBackupId, - self::$backupName, - new Timestamp(['seconds' => time() + self::SECONDS_IN_A_DAY * 10]) - ); + $expireTime = new Timestamp(['seconds' => time() + self::SECONDS_IN_A_DAY * 10]); + $copyBackupRequest = new CopyBackupRequest([ + 'parent' => $clusterName, + 'backup_id' => $copyBackupId, + 'source_backup' => self::$backupName, + 'expire_time' => $expireTime + ]); + $operationResponse = $tableClient->copyBackup($copyBackupRequest); $operationResponse->pollUntilComplete(); $result = $operationResponse->getResult(); @@ -224,8 +238,10 @@ public function testCopyBackupInDifferentProject(): void if (!self::isEmulatorUsed()) { try { $instanceName = $instanceClient->instanceName($projectId, $instanceId); - $instanceClient->getInstance($instanceName); - $instanceClient->deleteInstance($instanceName); + $getInstanceRequest = new GetInstanceRequest(['name' => $instanceName]); + $instanceClient->getInstance($getInstanceRequest); + $deleteInstanceRequest = new DeleteInstanceRequest(['name' => $instanceName]); + $instanceClient->deleteInstance($deleteInstanceRequest); } catch (Exception $th) { printf($th->getMessage() . PHP_EOL); } @@ -250,16 +266,20 @@ public function testCopyBackupShouldThrowForCopiedBackup(): void self::$copyBackupClusterId, self::$copyBackupId ); - $operationResponse = self::$tableAdminClient->copyBackup( - self::$instanceAdminClient->clusterName( - self::$projectId, - self::$instanceId, - self::$clusterId - ), - self::$copyBackupId, - $copyBackupName, - new Timestamp(['seconds' => time() + self::SECONDS_IN_A_DAY * 10]) + + $clusterName = self::$instanceAdminClient->clusterName( + self::$projectId, + self::$instanceId, + self::$clusterId ); + $expireTime = new Timestamp(['seconds' => time() + self::SECONDS_IN_A_DAY * 10]); + $request = new CopyBackupRequest([ + 'parent' => $clusterName, + 'backup_id' => self::$copyBackupId, + 'source_backup' => $copyBackupName, + 'expire_time' => $expireTime + ]); + $operationResponse = self::$tableAdminClient->copyBackup($request); $operationResponse->pollUntilComplete(); } @@ -292,11 +312,12 @@ private function createCustomCluster( $location ) ); - $operationResponse = self::$instanceAdminClient->createCluster( - $instanceName, - $clusterId, - $cluster - ); + $request = new CreateClusterRequest([ + 'parent' => $instanceName, + 'cluster_id' => $clusterId, + 'cluster' => $cluster + ]); + $operationResponse = self::$instanceAdminClient->createCluster($request); $operationResponse->pollUntilComplete(); if (!$operationResponse->operationSucceeded()) { $this->fail('Cluster creation failed'); @@ -309,8 +330,15 @@ private static function deleteBackupIfExists( string $backupName ): void { try { - $client->getBackup($backupName); - $client->deleteBackup($backupName); + $getBackupRequest = new GetBackupRequest([ + 'name' => $backupName + ]); + $client->getBackup($getBackupRequest); + + $deleteBackupRequest = new DeleteBackupRequest([ + 'name' => $backupName + ]); + $client->deleteBackup($deleteBackupRequest); } catch (ApiException $th) { printf($th->getMessage() . PHP_EOL); } diff --git a/Bigtable/tests/System/BigtableInstanceAdminClientTest.php b/Bigtable/tests/System/BigtableInstanceAdminClientTest.php index 4544d80ca509..eda7f68a49cd 100644 --- a/Bigtable/tests/System/BigtableInstanceAdminClientTest.php +++ b/Bigtable/tests/System/BigtableInstanceAdminClientTest.php @@ -17,7 +17,8 @@ namespace Google\Cloud\Bigtable\Tests\System; -use Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient; +use Google\Cloud\Bigtable\Admin\V2\Client\BigtableInstanceAdminClient; +use Google\Cloud\Bigtable\Admin\V2\ListInstancesRequest; use Google\Cloud\Bigtable\Admin\V2\ListInstancesResponse; use PHPUnit\Framework\TestCase; @@ -67,9 +68,9 @@ public static function setUpBeforeClass(): void */ public function testListInstances(BigtableInstanceAdminClient $client) { - $response = $client->listInstances( - $client->projectName(self::$projectId) - ); + $project = $client::projectName(self::$projectId); + $request = new ListInstancesRequest(['parent' => $project]); + $response = $client->listInstances($request); $this->assertInstanceOf(ListInstancesResponse::class, $response); } diff --git a/Bigtable/tests/System/BigtableTestCase.php b/Bigtable/tests/System/BigtableTestCase.php index 72f14b9ef3bb..642eb5901be3 100644 --- a/Bigtable/tests/System/BigtableTestCase.php +++ b/Bigtable/tests/System/BigtableTestCase.php @@ -17,8 +17,8 @@ namespace Google\Cloud\Bigtable\Tests\System; -use Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient as InstanceAdminClient; -use Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient as TableAdminClient; +use Google\Cloud\Bigtable\Admin\V2\Client\BigtableInstanceAdminClient as InstanceAdminClient; +use Google\Cloud\Bigtable\Admin\V2\Client\BigtableTableAdminClient as TableAdminClient; use Google\Cloud\Bigtable\Admin\V2\Cluster; use Google\Cloud\Bigtable\Admin\V2\ColumnFamily; use Google\Cloud\Bigtable\Admin\V2\Instance; @@ -26,6 +26,10 @@ use Google\Cloud\Bigtable\BigtableClient; use Google\Cloud\Core\Testing\System\SystemTestCase; use Exception; +use Google\Cloud\Bigtable\Admin\V2\CreateInstanceRequest; +use Google\Cloud\Bigtable\Admin\V2\CreateTableRequest; +use Google\Cloud\Bigtable\Admin\V2\DeleteInstanceRequest; +use Google\Cloud\Bigtable\Admin\V2\DeleteTableRequest; /** * @group bigtable @@ -49,11 +53,12 @@ public static function setUpBeforeClass(): void { self::setUsingEmulator(getenv('BIGTABLE_EMULATOR_HOST')); $keyFilePath = getenv('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH'); + $credentials = self::isEmulatorUsed() ? null : $keyFilePath; self::$instanceAdminClient = new InstanceAdminClient([ - 'credentials' => $keyFilePath + 'credentials' => $credentials, ]); self::$tableAdminClient = new TableAdminClient([ - 'credentials' => $keyFilePath + 'credentials' => $credentials, ]); $keyFileData = json_decode(file_get_contents($keyFilePath), true); self::$projectId = $keyFileData['project_id']; @@ -61,7 +66,7 @@ public static function setUpBeforeClass(): void self::$clusterId = uniqid(self::CLUSTER_ID_PREFIX); self::$table = (new BigtableClient([ 'projectId' => self::$projectId, - 'credentials' => $keyFilePath + 'credentials' => $credentials, ]))->table(self::$instanceId, self::TABLE_ID); if (!self::isEmulatorUsed()) { self::createInstance(); @@ -93,12 +98,13 @@ private static function createInstance() $clusters = [ self::$clusterId => $cluster ]; - $operationResponse = self::$instanceAdminClient->createInstance( - $formattedParent, - self::$instanceId, - $instance, - $clusters - ); + $request = new CreateInstanceRequest([ + 'parent' => $formattedParent, + 'instance_id' => self::$instanceId, + 'instance' => $instance, + 'clusters' => $clusters + ]); + $operationResponse = self::$instanceAdminClient->createInstance($request); $operationResponse->pollUntilComplete(); if (!$operationResponse->operationSucceeded()) { throw new Exception('error creating instance', -1); @@ -111,7 +117,10 @@ private static function deleteInstance() self::$projectId, self::$instanceId ); - self::$instanceAdminClient->deleteInstance($formattedName); + $request = new DeleteInstanceRequest([ + 'name' => $formattedName + ]); + self::$instanceAdminClient->deleteInstance($request); } private static function createTable() @@ -134,11 +143,12 @@ private static function createTable() 'cf8' => $columnFamily, 'cf9' => $columnFamily ]); - self::$tableAdminClient->createTable( - $formattedParent, - self::TABLE_ID, - $table - ); + $request = new CreateTableRequest([ + 'parent' => $formattedParent, + 'table_id' => self::TABLE_ID, + 'table' => $table + ]); + self::$tableAdminClient->createTable($request); } private static function deleteTable() @@ -148,6 +158,9 @@ private static function deleteTable() self::$instanceId, self::TABLE_ID ); - self::$tableAdminClient->deleteTable($formattedName); + $request = new DeleteTableRequest([ + 'name' => $formattedName + ]); + self::$tableAdminClient->deleteTable($request); } } diff --git a/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php deleted file mode 100644 index 3301cbdc2688..000000000000 --- a/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php +++ /dev/null @@ -1,1893 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return BigtableInstanceAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new BigtableInstanceAdminClient($options); - } - - /** @test */ - public function createAppProfileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $description = 'description-1724546052'; - $expectedResponse = new AppProfile(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $appProfileId = 'appProfileId1262094415'; - $appProfile = new AppProfile(); - $response = $gapicClient->createAppProfile($formattedParent, $appProfileId, $appProfile); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateAppProfile', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getAppProfileId(); - $this->assertProtobufEquals($appProfileId, $actualValue); - $actualValue = $actualRequestObject->getAppProfile(); - $this->assertProtobufEquals($appProfile, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createAppProfileExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $appProfileId = 'appProfileId1262094415'; - $appProfile = new AppProfile(); - try { - $gapicClient->createAppProfile($formattedParent, $appProfileId, $appProfile); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createClusterTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $location = 'location1901043637'; - $serveNodes = 1288838783; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setLocation($location); - $expectedResponse->setServeNodes($serveNodes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterServeNodes = 1434304124; - $cluster->setServeNodes($clusterServeNodes); - $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createClusterExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterServeNodes = 1434304124; - $cluster->setServeNodes($clusterServeNodes); - $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceName = 'instanceName-737857344'; - $instance->setName($instanceName); - $instanceDisplayName = 'instanceDisplayName1824500376'; - $instance->setDisplayName($instanceDisplayName); - $instanceType = Type::TYPE_UNSPECIFIED; - $instance->setType($instanceType); - $labelsValue = 'labelsValue950036658'; - $instanceLabels = [ - 'labelsKey' => $labelsValue, - ]; - $instance->setLabels($instanceLabels); - $clustersValue = new Cluster(); - $valueName = 'valueName-765894756'; - $clustersValue->setName($valueName); - $valueServeNodes = 370436813; - $clustersValue->setServeNodes($valueServeNodes); - $clusters = [ - 'clustersKey' => $clustersValue, - ]; - $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance, $clusters); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $actualValue = $actualApiRequestObject->getClusters(); - $this->assertProtobufEquals($clusters, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceName = 'instanceName-737857344'; - $instance->setName($instanceName); - $instanceDisplayName = 'instanceDisplayName1824500376'; - $instance->setDisplayName($instanceDisplayName); - $instanceType = Type::TYPE_UNSPECIFIED; - $instance->setType($instanceType); - $labelsValue = 'labelsValue950036658'; - $instanceLabels = [ - 'labelsKey' => $labelsValue, - ]; - $instance->setLabels($instanceLabels); - $clustersValue = new Cluster(); - $valueName = 'valueName-765894756'; - $clustersValue->setName($valueName); - $valueServeNodes = 370436813; - $clustersValue->setServeNodes($valueServeNodes); - $clusters = [ - 'clustersKey' => $clustersValue, - ]; - $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance, $clusters); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteAppProfileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - $ignoreWarnings = true; - $gapicClient->deleteAppProfile($formattedName, $ignoreWarnings); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteAppProfile', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getIgnoreWarnings(); - $this->assertProtobufEquals($ignoreWarnings, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteAppProfileExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - $ignoreWarnings = true; - try { - $gapicClient->deleteAppProfile($formattedName, $ignoreWarnings); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteClusterTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $gapicClient->deleteCluster($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteCluster', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteClusterExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - try { - $gapicClient->deleteCluster($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $gapicClient->deleteInstance($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteInstanceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - try { - $gapicClient->deleteInstance($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAppProfileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $description = 'description-1724546052'; - $expectedResponse = new AppProfile(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - $response = $gapicClient->getAppProfile($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetAppProfile', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAppProfileExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - try { - $gapicClient->getAppProfile($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $location = 'location1901043637'; - $serveNodes = 1288838783; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setLocation($location); - $expectedResponse->setServeNodes($serveNodes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $response = $gapicClient->getCluster($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetCluster', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - try { - $gapicClient->getCluster($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $response = $gapicClient->getInstance($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - try { - $gapicClient->getInstance($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAppProfilesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $appProfilesElement = new AppProfile(); - $appProfiles = [ - $appProfilesElement, - ]; - $expectedResponse = new ListAppProfilesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAppProfiles($appProfiles); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $response = $gapicClient->listAppProfiles($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAppProfiles()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListAppProfiles', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAppProfilesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - try { - $gapicClient->listAppProfiles($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listClustersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = 'nextPageToken-1530815211'; - $expectedResponse = new ListClustersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $response = $gapicClient->listClusters($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listClustersExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - try { - $gapicClient->listClusters($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listHotTabletsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $hotTabletsElement = new HotTablet(); - $hotTablets = [ - $hotTabletsElement, - ]; - $expectedResponse = new ListHotTabletsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setHotTablets($hotTablets); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $response = $gapicClient->listHotTablets($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getHotTablets()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListHotTablets', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listHotTabletsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - try { - $gapicClient->listHotTablets($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = 'nextPageToken-1530815211'; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listInstances($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listInstances($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function partialUpdateClusterTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/partialUpdateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $location = 'location1901043637'; - $serveNodes = 1288838783; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setLocation($location); - $expectedResponse->setServeNodes($serveNodes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/partialUpdateClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterServeNodes = 1434304124; - $cluster->setServeNodes($clusterServeNodes); - $updateMask = new FieldMask(); - $response = $gapicClient->partialUpdateCluster($cluster, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/PartialUpdateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/partialUpdateClusterTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function partialUpdateClusterExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/partialUpdateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterServeNodes = 1434304124; - $cluster->setServeNodes($clusterServeNodes); - $updateMask = new FieldMask(); - $response = $gapicClient->partialUpdateCluster($cluster, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/partialUpdateClusterTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function partialUpdateInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/partialUpdateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/partialUpdateInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $instance = new Instance(); - $instanceName = 'instanceName-737857344'; - $instance->setName($instanceName); - $instanceDisplayName = 'instanceDisplayName1824500376'; - $instance->setDisplayName($instanceDisplayName); - $instanceType = Type::TYPE_UNSPECIFIED; - $instance->setType($instanceType); - $labelsValue = 'labelsValue950036658'; - $instanceLabels = [ - 'labelsKey' => $labelsValue, - ]; - $instance->setLabels($instanceLabels); - $updateMask = new FieldMask(); - $response = $gapicClient->partialUpdateInstance($instance, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/PartialUpdateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/partialUpdateInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function partialUpdateInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/partialUpdateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $instance = new Instance(); - $instanceName = 'instanceName-737857344'; - $instance->setName($instanceName); - $instanceDisplayName = 'instanceDisplayName1824500376'; - $instance->setDisplayName($instanceDisplayName); - $instanceType = Type::TYPE_UNSPECIFIED; - $instance->setType($instanceType); - $labelsValue = 'labelsValue950036658'; - $instanceLabels = [ - 'labelsKey' => $labelsValue, - ]; - $instance->setLabels($instanceLabels); - $updateMask = new FieldMask(); - $response = $gapicClient->partialUpdateInstance($instance, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/partialUpdateInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateAppProfileTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAppProfileTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $description = 'description-1724546052'; - $expectedResponse = new AppProfile(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateAppProfileTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $appProfile = new AppProfile(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateAppProfile($appProfile, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateAppProfile', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getAppProfile(); - $this->assertProtobufEquals($appProfile, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAppProfileTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateAppProfileExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAppProfileTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $appProfile = new AppProfile(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateAppProfile($appProfile, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAppProfileTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateClusterTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $location2 = 'location21541837352'; - $serveNodes2 = 1623486220; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setLocation($location2); - $expectedResponse->setServeNodes($serveNodes2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $serveNodes = 1288838783; - $response = $gapicClient->updateCluster($name, $serveNodes); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualApiRequestObject->getServeNodes(); - $this->assertProtobufEquals($serveNodes, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateClusterExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $serveNodes = 1288838783; - $response = $gapicClient->updateCluster($name, $serveNodes); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName2 = 'displayName21615000987'; - $satisfiesPzs2 = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName2); - $expectedResponse->setSatisfiesPzs($satisfiesPzs2); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $type = Type::TYPE_UNSPECIFIED; - $labelsValue = 'labelsValue950036658'; - $labels = [ - 'labelsKey' => $labelsValue, - ]; - $response = $gapicClient->updateInstance($name, $displayName, $type, $labels); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getDisplayName(); - $this->assertProtobufEquals($displayName, $actualValue); - $actualValue = $actualRequestObject->getType(); - $this->assertProtobufEquals($type, $actualValue); - $actualValue = $actualRequestObject->getLabels(); - $this->assertProtobufEquals($labels, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateInstanceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $type = Type::TYPE_UNSPECIFIED; - $labelsValue = 'labelsValue950036658'; - $labels = [ - 'labelsKey' => $labelsValue, - ]; - try { - $gapicClient->updateInstance($name, $displayName, $type, $labels); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Bigtable/tests/Unit/Admin/V2/BigtableTableAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/BigtableTableAdminClientTest.php deleted file mode 100644 index cc1e86b5c6f3..000000000000 --- a/Bigtable/tests/Unit/Admin/V2/BigtableTableAdminClientTest.php +++ /dev/null @@ -1,2584 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return BigtableTableAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new BigtableTableAdminClient($options); - } - - /** @test */ - public function checkConsistencyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $consistent = true; - $expectedResponse = new CheckConsistencyResponse(); - $expectedResponse->setConsistent($consistent); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $consistencyToken = 'consistencyToken-1090516718'; - $response = $gapicClient->checkConsistency($formattedName, $consistencyToken); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CheckConsistency', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getConsistencyToken(); - $this->assertProtobufEquals($consistencyToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function checkConsistencyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $consistencyToken = 'consistencyToken-1090516718'; - try { - $gapicClient->checkConsistency($formattedName, $consistencyToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function copyBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/copyBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $sourceTable = 'sourceTable1670858410'; - $sourceBackup2 = 'sourceBackup2889376921'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setSourceTable($sourceTable); - $expectedResponse->setSourceBackup($sourceBackup2); - $expectedResponse->setSizeBytes($sizeBytes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/copyBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $backupId = 'backupId1355353272'; - $formattedSourceBackup = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $expireTime = new Timestamp(); - $response = $gapicClient->copyBackup($formattedParent, $backupId, $formattedSourceBackup, $expireTime); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CopyBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getSourceBackup(); - $this->assertProtobufEquals($formattedSourceBackup, $actualValue); - $actualValue = $actualApiRequestObject->getExpireTime(); - $this->assertProtobufEquals($expireTime, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/copyBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function copyBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/copyBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $backupId = 'backupId1355353272'; - $formattedSourceBackup = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $expireTime = new Timestamp(); - $response = $gapicClient->copyBackup($formattedParent, $backupId, $formattedSourceBackup, $expireTime); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/copyBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createAuthorizedViewTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createAuthorizedViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $deletionProtection = true; - $expectedResponse = new AuthorizedView(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setDeletionProtection($deletionProtection); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createAuthorizedViewTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $authorizedViewId = 'authorizedViewId1171901009'; - $authorizedView = new AuthorizedView(); - $response = $gapicClient->createAuthorizedView($formattedParent, $authorizedViewId, $authorizedView); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CreateAuthorizedView', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getAuthorizedViewId(); - $this->assertProtobufEquals($authorizedViewId, $actualValue); - $actualValue = $actualApiRequestObject->getAuthorizedView(); - $this->assertProtobufEquals($authorizedView, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAuthorizedViewTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createAuthorizedViewExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createAuthorizedViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $authorizedViewId = 'authorizedViewId1171901009'; - $authorizedView = new AuthorizedView(); - $response = $gapicClient->createAuthorizedView($formattedParent, $authorizedViewId, $authorizedView); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAuthorizedViewTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $sourceTable = 'sourceTable1670858410'; - $sourceBackup = 'sourceBackup-258292122'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setSourceTable($sourceTable); - $expectedResponse->setSourceBackup($sourceBackup); - $expectedResponse->setSizeBytes($sizeBytes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupSourceTable = 'backupSourceTable1043210577'; - $backup->setSourceTable($backupSourceTable); - $backupExpireTime = new Timestamp(); - $backup->setExpireTime($backupExpireTime); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupSourceTable = 'backupSourceTable1043210577'; - $backup->setSourceTable($backupSourceTable); - $backupExpireTime = new Timestamp(); - $backup->setExpireTime($backupExpireTime); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTableTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $deletionProtection = true; - $expectedResponse = new Table(); - $expectedResponse->setName($name); - $expectedResponse->setDeletionProtection($deletionProtection); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $tableId = 'tableId-895419604'; - $table = new Table(); - $response = $gapicClient->createTable($formattedParent, $tableId, $table); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CreateTable', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTableId(); - $this->assertProtobufEquals($tableId, $actualValue); - $actualValue = $actualRequestObject->getTable(); - $this->assertProtobufEquals($table, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTableExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $tableId = 'tableId-895419604'; - $table = new Table(); - try { - $gapicClient->createTable($formattedParent, $tableId, $table); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTableFromSnapshotTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTableFromSnapshotTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $deletionProtection = true; - $expectedResponse = new Table(); - $expectedResponse->setName($name); - $expectedResponse->setDeletionProtection($deletionProtection); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTableFromSnapshotTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $tableId = 'tableId-895419604'; - $formattedSourceSnapshot = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $response = $gapicClient->createTableFromSnapshot($formattedParent, $tableId, $formattedSourceSnapshot); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/CreateTableFromSnapshot', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTableId(); - $this->assertProtobufEquals($tableId, $actualValue); - $actualValue = $actualApiRequestObject->getSourceSnapshot(); - $this->assertProtobufEquals($formattedSourceSnapshot, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTableFromSnapshotTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTableFromSnapshotExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTableFromSnapshotTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $tableId = 'tableId-895419604'; - $formattedSourceSnapshot = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $response = $gapicClient->createTableFromSnapshot($formattedParent, $tableId, $formattedSourceSnapshot); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTableFromSnapshotTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteAuthorizedViewTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $gapicClient->deleteAuthorizedView($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteAuthorizedView', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteAuthorizedViewExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - try { - $gapicClient->deleteAuthorizedView($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $gapicClient->deleteBackup($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - try { - $gapicClient->deleteBackup($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteSnapshotTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $gapicClient->deleteSnapshot($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteSnapshot', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteSnapshotExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - try { - $gapicClient->deleteSnapshot($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTableTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $gapicClient->deleteTable($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DeleteTable', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTableExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - try { - $gapicClient->deleteTable($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function dropRowRangeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $gapicClient->dropRowRange($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/DropRowRange', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function dropRowRangeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - try { - $gapicClient->dropRowRange($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateConsistencyTokenTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $consistencyToken = 'consistencyToken-1090516718'; - $expectedResponse = new GenerateConsistencyTokenResponse(); - $expectedResponse->setConsistencyToken($consistencyToken); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $response = $gapicClient->generateConsistencyToken($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GenerateConsistencyToken', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateConsistencyTokenExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - try { - $gapicClient->generateConsistencyToken($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAuthorizedViewTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $deletionProtection = true; - $expectedResponse = new AuthorizedView(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setDeletionProtection($deletionProtection); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $response = $gapicClient->getAuthorizedView($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetAuthorizedView', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAuthorizedViewExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - try { - $gapicClient->getAuthorizedView($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $sourceTable = 'sourceTable1670858410'; - $sourceBackup = 'sourceBackup-258292122'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setSourceTable($sourceTable); - $expectedResponse->setSourceBackup($sourceBackup); - $expectedResponse->setSizeBytes($sizeBytes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $response = $gapicClient->getBackup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - try { - $gapicClient->getBackup($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSnapshotTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $dataSizeBytes = 2110122398; - $description = 'description-1724546052'; - $expectedResponse = new Snapshot(); - $expectedResponse->setName($name2); - $expectedResponse->setDataSizeBytes($dataSizeBytes); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $response = $gapicClient->getSnapshot($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetSnapshot', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSnapshotExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - try { - $gapicClient->getSnapshot($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTableTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $deletionProtection = true; - $expectedResponse = new Table(); - $expectedResponse->setName($name2); - $expectedResponse->setDeletionProtection($deletionProtection); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $response = $gapicClient->getTable($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/GetTable', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTableExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - try { - $gapicClient->getTable($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAuthorizedViewsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $authorizedViewsElement = new AuthorizedView(); - $authorizedViews = [ - $authorizedViewsElement, - ]; - $expectedResponse = new ListAuthorizedViewsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAuthorizedViews($authorizedViews); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $response = $gapicClient->listAuthorizedViews($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAuthorizedViews()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ListAuthorizedViews', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAuthorizedViewsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - try { - $gapicClient->listAuthorizedViews($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; - $expectedResponse = new ListBackupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackups($backups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $response = $gapicClient->listBackups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - try { - $gapicClient->listBackups($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSnapshotsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $snapshotsElement = new Snapshot(); - $snapshots = [ - $snapshotsElement, - ]; - $expectedResponse = new ListSnapshotsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSnapshots($snapshots); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $response = $gapicClient->listSnapshots($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSnapshots()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ListSnapshots', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSnapshotsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - try { - $gapicClient->listSnapshots($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTablesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tablesElement = new Table(); - $tables = [ - $tablesElement, - ]; - $expectedResponse = new ListTablesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTables($tables); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $response = $gapicClient->listTables($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTables()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ListTables', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTablesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - try { - $gapicClient->listTables($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function modifyColumnFamiliesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $deletionProtection = true; - $expectedResponse = new Table(); - $expectedResponse->setName($name2); - $expectedResponse->setDeletionProtection($deletionProtection); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $modifications = []; - $response = $gapicClient->modifyColumnFamilies($formattedName, $modifications); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getModifications(); - $this->assertProtobufEquals($modifications, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function modifyColumnFamiliesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $modifications = []; - try { - $gapicClient->modifyColumnFamilies($formattedName, $modifications); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restoreTableTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreTableTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $deletionProtection = true; - $expectedResponse = new Table(); - $expectedResponse->setName($name); - $expectedResponse->setDeletionProtection($deletionProtection); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreTableTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $tableId = 'tableId-895419604'; - $response = $gapicClient->restoreTable($formattedParent, $tableId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/RestoreTable', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTableId(); - $this->assertProtobufEquals($tableId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreTableTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreTableExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreTableTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $tableId = 'tableId-895419604'; - $response = $gapicClient->restoreTable($formattedParent, $tableId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreTableTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function snapshotTableTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/snapshotTableTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $dataSizeBytes = 2110122398; - $description2 = 'description2568623279'; - $expectedResponse = new Snapshot(); - $expectedResponse->setName($name2); - $expectedResponse->setDataSizeBytes($dataSizeBytes); - $expectedResponse->setDescription($description2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/snapshotTableTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $formattedCluster = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $snapshotId = 'snapshotId-168585866'; - $response = $gapicClient->snapshotTable($formattedName, $formattedCluster, $snapshotId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/SnapshotTable', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($formattedCluster, $actualValue); - $actualValue = $actualApiRequestObject->getSnapshotId(); - $this->assertProtobufEquals($snapshotId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/snapshotTableTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function snapshotTableExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/snapshotTableTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $formattedCluster = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $snapshotId = 'snapshotId-168585866'; - $response = $gapicClient->snapshotTable($formattedName, $formattedCluster, $snapshotId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/snapshotTableTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function undeleteTableTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeleteTableTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $deletionProtection = true; - $expectedResponse = new Table(); - $expectedResponse->setName($name2); - $expectedResponse->setDeletionProtection($deletionProtection); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeleteTableTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $response = $gapicClient->undeleteTable($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/UndeleteTable', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteTableTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeleteTableExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeleteTableTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $response = $gapicClient->undeleteTable($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteTableTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateAuthorizedViewTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAuthorizedViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $etag = 'etag3123477'; - $deletionProtection = true; - $expectedResponse = new AuthorizedView(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setDeletionProtection($deletionProtection); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateAuthorizedViewTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $authorizedView = new AuthorizedView(); - $response = $gapicClient->updateAuthorizedView($authorizedView); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/UpdateAuthorizedView', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getAuthorizedView(); - $this->assertProtobufEquals($authorizedView, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAuthorizedViewTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateAuthorizedViewExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAuthorizedViewTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $authorizedView = new AuthorizedView(); - $response = $gapicClient->updateAuthorizedView($authorizedView); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAuthorizedViewTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $sourceTable = 'sourceTable1670858410'; - $sourceBackup = 'sourceBackup-258292122'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setSourceTable($sourceTable); - $expectedResponse->setSourceBackup($sourceBackup); - $expectedResponse->setSizeBytes($sizeBytes); - $transport->addResponse($expectedResponse); - // Mock request - $backup = new Backup(); - $backupSourceTable = 'backupSourceTable1043210577'; - $backup->setSourceTable($backupSourceTable); - $backupExpireTime = new Timestamp(); - $backup->setExpireTime($backupExpireTime); - $updateMask = new FieldMask(); - $response = $gapicClient->updateBackup($backup, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/UpdateBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateBackupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $backup = new Backup(); - $backupSourceTable = 'backupSourceTable1043210577'; - $backup->setSourceTable($backupSourceTable); - $backupExpireTime = new Timestamp(); - $backup->setExpireTime($backupExpireTime); - $updateMask = new FieldMask(); - try { - $gapicClient->updateBackup($backup, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTableTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTableTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $deletionProtection = true; - $expectedResponse = new Table(); - $expectedResponse->setName($name); - $expectedResponse->setDeletionProtection($deletionProtection); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTableTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $table = new Table(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateTable($table, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.admin.v2.BigtableTableAdmin/UpdateTable', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTable(); - $this->assertProtobufEquals($table, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTableTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTableExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTableTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $table = new Table(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateTable($table, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTableTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php index 0cbd730546e4..be9304349260 100644 --- a/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php +++ b/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Bigtable\Admin\V2\AppProfile; @@ -58,6 +57,7 @@ use Google\Cloud\Iam\V1\SetIamPolicyRequest; use Google\Cloud\Iam\V1\TestIamPermissionsRequest; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -67,8 +67,7 @@ use stdClass; /** - * @group bigtable - * bigtable-admin + * @group admin * * @group gapic */ diff --git a/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php index b57e6f65fd29..1311f7056dbd 100644 --- a/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php +++ b/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Bigtable\Admin\V2\AuthorizedView; @@ -70,6 +69,7 @@ use Google\Cloud\Iam\V1\SetIamPolicyRequest; use Google\Cloud\Iam\V1\TestIamPermissionsRequest; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -80,8 +80,7 @@ use stdClass; /** - * @group bigtable - * bigtable-admin + * @group admin * * @group gapic */ diff --git a/Bigtable/tests/Unit/ChunkFormatterTest.php b/Bigtable/tests/Unit/ChunkFormatterTest.php index f5d8c6f6cae3..a4d1e105e78a 100644 --- a/Bigtable/tests/Unit/ChunkFormatterTest.php +++ b/Bigtable/tests/Unit/ChunkFormatterTest.php @@ -17,9 +17,12 @@ namespace Google\Cloud\Bigtable\Tests\Unit; -use Google\ApiCore\ServerStream; +use Google\ApiCore\CredentialsWrapper; +use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Bigtable\ChunkFormatter; use Google\Cloud\Bigtable\Exception\BigtableDataOperationException; +use Google\Cloud\Bigtable\V2\Client\BigtableClient; +use Google\Cloud\Bigtable\V2\ReadRowsRequest; use Google\Cloud\Bigtable\V2\ReadRowsResponse; use Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk as ReadRowsResponse_CellChunk; use Google\Protobuf\StringValue; @@ -36,17 +39,21 @@ class ChunkFormatterTest extends TestCase use ProphecyTrait; const TABLE_NAME = 'test-table'; - private $serverStream; private $chunkFormatter; + private $gapicClient; + private $readRowsRequest; + private $transport; public function setUp(): void { - $this->serverStream = $this->prophesize(ServerStream::class); + $this->transport = $this->createTransport(); + $this->gapicClient = $this->createClient([ + 'transport' => $this->transport, + ]); + $this->readRowsRequest = new ReadRowsRequest(['table_name' => self::TABLE_NAME]); $this->chunkFormatter = new ChunkFormatter( - function () { - return $this->serverStream->reveal(); - }, - self::TABLE_NAME, + $this->gapicClient, + $this->readRowsRequest, [] ); } @@ -56,12 +63,13 @@ public function testNewRowShouldThrowWhenNoRowKey() $this->expectException(BigtableDataOperationException::class); $this->expectExceptionMessage('A row key must be set.'); + // Add a mock response to our transport $readRowsResponse = new ReadRowsResponse; $chunk = new ReadRowsResponse_CellChunk(); $readRowsResponse->setChunks([$chunk]); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -80,9 +88,11 @@ public function testNewRowShouldGenerateWhenRowKeyIsZero() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + + // Execute the test $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ '0' => [ @@ -108,9 +118,10 @@ public function testNewRowShouldThrowWhenResetIsTrue() $chunk->setRowKey('rk1'); $chunk->setResetRow(true); $readRowsResponse->setChunks([$chunk]); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -123,9 +134,10 @@ public function testNewRowShouldThrowWhenNoFamilyName() $chunk = new ReadRowsResponse_CellChunk(); $chunk->setRowKey('rk1'); $readRowsResponse->setChunks([$chunk]); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -141,9 +153,10 @@ public function testNewRowShouldThrowWhenNoQualifier() $stringValue->setValue('cf1'); $chunk->setFamilyName($stringValue); $readRowsResponse->setChunks([$chunk]); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -164,9 +177,10 @@ public function testNewRowShouldThrowWhenValueSizeAndCommitRow() $chunk->setValueSize(10); $chunk->setCommitRow(true); $readRowsResponse->setChunks([$chunk]); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -198,9 +212,10 @@ public function testNewRowShouldThrowWhenSameRowKeyFollows() $chunk->setQualifier($bytesValue); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -220,9 +235,10 @@ public function testNewRowShouldGenerateNewRow() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ 'rk1' => [ @@ -255,9 +271,10 @@ public function testNewRowShouldGenerateNewRowWithBinaryData() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ 'rk1' => [ @@ -290,9 +307,10 @@ public function testNewRowShouldGenerateNewRowWithBinaryRowKey() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ $data => [ @@ -325,9 +343,10 @@ public function testNewRowShouldGenerateNewRowWithTimeStamp() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ 'rk1' => [ @@ -361,9 +380,10 @@ public function testNewRowShouldGenerateNewRowWithLabels() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ 'rk1' => [ @@ -397,9 +417,10 @@ public function testNewRowShouldThrowWhenPendingRow() $chunk->setValue('Value1'); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -425,9 +446,10 @@ public function testValidateResetWithRowKey() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -453,9 +475,10 @@ public function testValidateResetWithQualifier() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -481,9 +504,10 @@ public function testValidateResetWithValue() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -509,9 +533,10 @@ public function testValidateResetWithTimestampMicro() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -536,9 +561,10 @@ public function testRowInProgressDifferentRowKey() $chunk->setRowKey('rk2'); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -566,9 +592,10 @@ public function testRowInProgressFamilyNameWithouQualifier() $chunk->setFamilyName($stringValue); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -601,9 +628,10 @@ public function testRowInProgressValueSizeAndCommit() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -625,9 +653,10 @@ public function testRowInProgressResetShouldNotGenerateRow() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $this->assertEquals([], $rows); } @@ -657,9 +686,10 @@ public function testRowInProgressTwoFamily() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ 'rk1' => [ @@ -704,9 +734,10 @@ public function testRowInProgressOneFamilyTwoQualifier() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ 'rk1' => [ @@ -750,9 +781,10 @@ public function testRowInProgressWithTimestamp() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ 'rk1' => [ @@ -796,9 +828,10 @@ public function testRowInProgressWithLabels() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ 'rk1' => [ @@ -842,9 +875,10 @@ public function testCellInProgressValueSizeAndCommit() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -871,9 +905,10 @@ public function testCellInProgressValidateResetWithRowKey() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -902,9 +937,10 @@ public function testCellInProgressValidateResetWithQualifier() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -931,9 +967,10 @@ public function testCellInProgressValidateResetWithValue() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -960,9 +997,10 @@ public function testCellInProgressValidateResetWithTimestampMicro() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + iterator_to_array($this->chunkFormatter->readAll()); } @@ -985,9 +1023,10 @@ public function testCellInProgressResetShouldNotGenerateRow() $chunk->setResetRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $this->assertEquals([], $rows); } @@ -1012,9 +1051,10 @@ public function testCellInProgressOneFamilyTwoQualifier() $chunk->setCommitRow(true); $chunks[] = $chunk; $readRowsResponse->setChunks($chunks); - $this->serverStream->readAll()->shouldBeCalled()->willReturn( - $this->arrayAsGenerator([$readRowsResponse]) - ); + + // Add a mock response to our transport + $this->transport->addResponse($readRowsResponse); + $rows = iterator_to_array($this->chunkFormatter->readAll()); $expectedRows = [ 'rk1' => [ @@ -1030,10 +1070,23 @@ public function testCellInProgressOneFamilyTwoQualifier() $this->assertEquals($expectedRows, $rows); } - private function arrayAsGenerator(array $array) + private function createTransport($deserialize = null) { - foreach ($array as $item) { - yield $item; - } + return new MockTransport($deserialize); + } + + /** @return CredentialsWrapper */ + private function createCredentials() + { + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BigtableClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BigtableClient($options); } } diff --git a/Bigtable/tests/Unit/SmartRetriesTest.php b/Bigtable/tests/Unit/SmartRetriesTest.php index 34e0c61cf672..f6c52136da17 100644 --- a/Bigtable/tests/Unit/SmartRetriesTest.php +++ b/Bigtable/tests/Unit/SmartRetriesTest.php @@ -18,14 +18,18 @@ namespace Google\Cloud\Bigtable\Tests\Unit; use Google\ApiCore\ApiException; +use Google\ApiCore\RetrySettings; +use Google\ApiCore\Serializer; use Google\ApiCore\ServerStream; use Google\Cloud\Bigtable\Exception\BigtableDataOperationException; use Google\Cloud\Bigtable\Mutations; use Google\Cloud\Bigtable\Table; -use Google\Cloud\Bigtable\V2\BigtableClient as TableClient; +use Google\Cloud\Bigtable\V2\Client\BigtableClient; +use Google\Cloud\Bigtable\V2\MutateRowsRequest; use Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry as RequestEntry; use Google\Cloud\Bigtable\V2\MutateRowsResponse; use Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry as ResponseEntry; +use Google\Cloud\Bigtable\V2\ReadRowsRequest; use Google\Cloud\Bigtable\V2\RowRange; use Google\Cloud\Bigtable\V2\RowSet; use Google\Cloud\Bigtable\V2\ReadRowsResponse; @@ -72,7 +76,7 @@ public function setUp(): void Code::UNAUTHENTICATED, 'UNAUTHENTICATED' ); - $this->bigtableClient = $this->prophesize(TableClient::class); + $this->bigtableClient = $this->prophesize(BigtableClient::class); $this->serverStream = $this->prophesize(ServerStream::class); $this->options = [ 'appProfileId' => self::APP_PROFILE, @@ -80,6 +84,7 @@ public function setUp(): void ]; $this->table = new Table( $this->bigtableClient->reveal(), + new Serializer(), self::TABLE_NAME, $this->options ); @@ -96,11 +101,13 @@ public function testReadRowsShouldRetryDefaultTimes() ->willThrow( $this->retryingApiException ); - $this->bigtableClient->readRows(self::TABLE_NAME, $expectedArgs) - ->shouldBeCalledTimes(4) - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalledTimes(4) + ->willReturn( + $this->serverStream->reveal() + ); $args = []; $iterator = $this->table->readRows($args); $iterator->getIterator()->current(); @@ -117,12 +124,14 @@ public function testReadRowsShouldRetryForProvidedAttempts() ->willThrow( $this->retryingApiException ); - $this->bigtableClient->readRows(self::TABLE_NAME, $expectedArgs) - ->shouldBeCalledTimes(6) + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalledTimes(6) ->willReturn( $this->serverStream->reveal() ); - $args = ['retries' => 5]; + $args = ['retrySettings' => ['maxRetries' => 5]]; $iterator = $this->table->readRows($args); $iterator->getIterator()->current(); } @@ -142,19 +151,12 @@ public function testReadRowsPartialSuccess() $this->nonRetryingApiException ) ); - $this->bigtableClient->readRows(self::TABLE_NAME, $expectedArgs) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); - $secondCallArgument = [ - 'rows' => (new RowSet)->setRowRanges([(new RowRange)->setStartKeyOpen('rk2')]) - ] + $expectedArgs; - $this->bigtableClient->readRows(self::TABLE_NAME, $secondCallArgument) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->willReturn( + $this->serverStream->reveal() + ); $args = []; $iterator = $this->table->readRows($args); $rows = []; @@ -184,20 +186,26 @@ public function testReadRowsWithRowsLimit() $this->generateRowsResponse(3, 4) ) ); - $this->bigtableClient->readRows(self::TABLE_NAME, $expectedArgs) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); - $secondCallArgument = [ - 'rows' => (new RowSet)->setRowRanges([(new RowRange)->setStartKeyOpen('rk2')]), - 'rowsLimit' => 3 - ] + $expectedArgs; - $this->bigtableClient->readRows(self::TABLE_NAME, $secondCallArgument) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); + + $allowedRowsLimit = ['5' => 1, '3' => 1]; + $this->bigtableClient->readRows( + Argument::that(function ($request) use (&$allowedRowsLimit) { + $rowsLimit = $request->getRowsLimit(); + if (!isset($allowedRowsLimit[$rowsLimit]) || $allowedRowsLimit[$rowsLimit] == 0) { + return false; + } + + // This means that once we have encountered a `rowsLimit` in a request. + // We decrease the number of times the request is allowed with the particular rowsLimit. + $allowedRowsLimit[$rowsLimit] -= 1; + return true; + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); + $iterator = $this->table->readRows($args); $rows = []; foreach ($iterator as $rowKey => $row) { @@ -221,20 +229,26 @@ public function testReadRowsWithRowKeys() $this->generateRowsResponse(3, 4) ) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return iterator_to_array($argument['rows']->getRowKeys()) === ['rk1', 'rk2', 'rk3', 'rk4']; - })) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return iterator_to_array($argument['rows']->getRowKeys()) === ['rk3', 'rk4']; - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return iterator_to_array($request->getRows()->getRowKeys()) === ['rk1', 'rk2', 'rk3', 'rk4']; + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( + $this->serverStream->reveal() + ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return iterator_to_array($request->getRows()->getRowKeys()) === ['rk3', 'rk4']; + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $iterator = $this->table->readRows($args); $rows = []; foreach ($iterator as $rowKey => $row) { @@ -257,17 +271,23 @@ public function testReadRowsRangeStartKeyOpen() $this->generateRowsResponse(8, 9) ) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return $argument['rows']->getRowRanges()[0]->getStartKeyOpen() === 'rk5'; - })) - ->shouldBeCalledTimes(1) + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return $request->getRows()->getRowRanges()[0]->getStartKeyOpen() === 'rk5'; + }), + Argument::type('array') + )->shouldBeCalledTimes(1) ->willReturn( $this->serverStream->reveal() ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return $argument['rows']->getRowRanges()[0]->getStartKeyOpen() === 'rk7'; - })) - ->shouldBeCalled() + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return $request->getRows()->getRowRanges()[0]->getStartKeyOpen() === 'rk7'; + }), + Argument::type('array') + )->shouldBeCalled() ->willReturn( $this->serverStream->reveal() ); @@ -296,20 +316,26 @@ public function testReadRowsRangeStartKeyClosed() $this->generateRowsResponse(7, 9) ) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return $argument['rows']->getRowRanges()[0]->getStartKeyClosed() === 'rk5'; - })) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return $argument['rows']->getRowRanges()[0]->getStartKeyOpen() === 'rk6'; - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return $request->getRows()->getRowRanges()[0]->getStartKeyClosed() === 'rk5'; + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( + $this->serverStream->reveal() + ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return $request->getRows()->getRowRanges()[0]->getStartKeyOpen() === 'rk6'; + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = ['rowRanges' => [ ['startKeyClosed' => 'rk5'] ]]; @@ -335,22 +361,29 @@ public function testReadRowsRangeEndKeyOpen() $this->generateRowsResponse(4, 6) ) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return $argument['rows']->getRowRanges()[0]->getStartKeyOpen() === '' - && $argument['rows']->getRowRanges()[0]->getEndKeyOpen() === 'rk7'; - })) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return $argument['rows']->getRowRanges()[0]->getStartKeyOpen() === 'rk3' - && $argument['rows']->getRowRanges()[0]->getEndKeyOpen() === 'rk7'; - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return $request->getRows()->getRowRanges()[0]->getStartKeyOpen() === '' && + $request->getRows()->getRowRanges()[0]->getEndKeyOpen() === 'rk7'; + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( + $this->serverStream->reveal() + ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return $request->getRows()->getRowRanges()[0]->getStartKeyOpen() === 'rk3' && + $request->getRows()->getRowRanges()[0]->getEndKeyOpen() === 'rk7'; + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); + $args = ['rowRanges' => [ ['endKeyOpen' => 'rk7'] ]]; @@ -376,22 +409,29 @@ public function testReadRowsRangeEndKeyClosed() $this->generateRowsResponse(4, 7) ) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return $argument['rows']->getRowRanges()[0]->getStartKeyOpen() === '' - && $argument['rows']->getRowRanges()[0]->getEndKeyClosed() === 'rk7'; - })) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) { - return $argument['rows']->getRowRanges()[0]->getStartKeyOpen() === 'rk3' - && $argument['rows']->getRowRanges()[0]->getEndKeyClosed() === 'rk7'; - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return $request->getRows()->getRowRanges()[0]->getStartKeyOpen() === '' && + $request->getRows()->getRowRanges()[0]->getEndKeyClosed() === 'rk7'; + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( + $this->serverStream->reveal() + ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) { + return $request->getRows()->getRowRanges()[0]->getStartKeyOpen() === 'rk3' && + $request->getRows()->getRowRanges()[0]->getEndKeyClosed() === 'rk7'; + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); + $args = ['rowRanges' => [ ['endKeyClosed' => 'rk7'] ]]; @@ -422,24 +462,32 @@ public function testReadRowsRangeWithSomeCompletedRange() $this->generateRowsResponse(7, 9) ) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedRows) { - return $argument['rows']->serializeToJsonString() === $expectedRows->serializeToJsonString(); - })) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) use ($expectedRows) { + return $request->getRows()->serializeToJsonString() === $expectedRows->serializeToJsonString(); + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( + $this->serverStream->reveal() + ); + $expectedRows2 = (new RowSet)->setRowRanges([ (new RowRange)->setStartKeyOpen('rk6')->setEndKeyClosed('rk7'), (new RowRange)->setStartKeyClosed('rk8')->setEndKeyClosed('rk9') ]); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedRows2) { - return $argument['rows']->serializeToJsonString() === $expectedRows2->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + + $this->bigtableClient->readRows( + Argument::that(function ($request) use ($expectedRows2) { + return $request->getRows()->serializeToJsonString() === $expectedRows2->serializeToJsonString(); + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); + $args = ['rowRanges' => [ ['startKeyOpen' => 'rk1', 'endKeyClosed' => 'rk3'], ['startKeyClosed' => 'rk5', 'endKeyClosed' => 'rk7'], @@ -467,17 +515,18 @@ public function testReadRowsWithRetryableErrorAfterAllDataReceived() // First Call // Check if the request has expected row range $this->bigtableClient->readRows( - self::TABLE_NAME, - Argument::that(function ($argument) { - $rowRanges = $argument['rows']->getRowRanges(); + Argument::that(function ($request) { + $rowRanges = $request->getRows()->getRowRanges(); if (count($rowRanges) === 0) { return false; } $rowRange = $rowRanges[0]; return $rowRange->getStartKeyClosed() === 'rk1' && $rowRange->getEndKeyClosed() === 'rk3'; - }) - )->shouldBeCalledOnce()->willReturn( + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( $this->serverStream->reveal() ); @@ -485,17 +534,15 @@ public function testReadRowsWithRetryableErrorAfterAllDataReceived() // Check if the request has empty row range and fail the test // as this will result in full table scan $this->bigtableClient->readRows( - self::TABLE_NAME, - Argument::that(function ($argument) { - $rowRanges = $argument['rows']->getRowRanges(); - if (count($rowRanges)) { - return false; - } - return true; - }) - )->will(function ($args) { - self::fail('Full table scan attempted'); - }); + Argument::that(function ($request) { + $rowRanges = $request->getRows()->getRowRanges(); + return !count($rowRanges); + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'rowRanges' => [[ @@ -519,11 +566,13 @@ public function testMutateRowsShouldRetryDefaultNumberOfTimes() ); $mutations = $this->generateMutations(1, 5); $entries = $this->generateEntries(1, 5); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $entries, $this->options) - ->shouldBeCalledTimes(4) - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalledTimes(4) + ->willReturn( + $this->serverStream->reveal() + ); $this->table->mutateRows($mutations); } @@ -539,12 +588,14 @@ public function testMutateRowsRespectRetriesAttempt() ); $mutations = $this->generateMutations(1, 5); $entries = $this->generateEntries(1, 5); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $entries, ['retries' => 5] + $this->options) - ->shouldBeCalledTimes(6) - ->willReturn( - $this->serverStream->reveal() - ); - $this->table->mutateRows($mutations, ['retries' => 5]); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalledTimes(6) + ->willReturn( + $this->serverStream->reveal() + ); + $this->table->mutateRows($mutations, ['retrySettings' => ['maxRetries' => 5]]); } public function testMutateRowsOnlyRetriesFailedEntries() @@ -560,17 +611,25 @@ public function testMutateRowsOnlyRetriesFailedEntries() ) ); $entries = $this->generateEntries(0, 5); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $entries, $this->options) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::that(function ($request) use ($entries) { + return iterator_to_array($request->getEntries()) == $entries; + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( + $this->serverStream->reveal() + ); $entries = $this->generateEntries(2, 3); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $entries, $this->options) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::that(function ($request) use ($entries) { + return iterator_to_array($request->getEntries()) == $entries; + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $mutations = $this->generateMutations(0, 5); $this->table->mutateRows($mutations); } @@ -589,17 +648,25 @@ public function testMutateRowsExceptionShouldAddEntryToPendingMutations() ) ); $entries = $this->generateEntries(0, 5); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $entries, $this->options) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::that(function ($request) use ($entries) { + return iterator_to_array($request->getEntries()) == $entries; + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( + $this->serverStream->reveal() + ); $entries = array_merge($this->generateEntries(1, 2), $this->generateEntries(4, 5)); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $entries, $this->options) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::that(function ($request) use ($entries) { + return iterator_to_array($request->getEntries()) == $entries; + }), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); try { $mutations = $this->generateMutations(0, 5); $this->table->mutateRows($mutations); @@ -630,11 +697,15 @@ public function testMutateRowsShouldNotRetryIfAnyMutationIsNotRetryable() ) ); $entries = $this->generateEntries(0, 7); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $entries, $this->options) - ->shouldBeCalledTimes(1) - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::that(function ($request) use ($entries) { + return iterator_to_array($request->getEntries()) == $entries; + }), + Argument::type('array') + )->shouldBeCalledTimes(1) + ->willReturn( + $this->serverStream->reveal() + ); try { $mutations = $this->generateMutations(0, 7); $this->table->mutateRows($mutations); @@ -667,6 +738,34 @@ public function testMutateRowsShouldNotRetryIfAnyMutationIsNotRetryable() } } + public function testRetrySettingsObject() + { + $this->expectException(ApiException::class); + $this->expectExceptionMessage('DEADLINE_EXCEEDED'); + + $this->serverStream->readAll() + ->shouldBeCalledTimes(5) + ->willThrow( + $this->retryingApiException + ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalledTimes(5) + ->willReturn( + $this->serverStream->reveal() + ); + + $retrySettings = RetrySettings::constructDefault(); + $retrySettings = $retrySettings->with(['maxRetries' => 4]); + + $iterator = $this->table->readRows([ + 'retrySettings' => $retrySettings + ]); + + $iterator->getIterator()->current(); + } + private function generateRowsResponse($from, $to) { $rows = []; diff --git a/Bigtable/tests/Unit/TableTest.php b/Bigtable/tests/Unit/TableTest.php index 600b9af015ac..a34170365850 100644 --- a/Bigtable/tests/Unit/TableTest.php +++ b/Bigtable/tests/Unit/TableTest.php @@ -18,6 +18,7 @@ namespace Google\Cloud\Bigtable\Tests\Unit; use Google\ApiCore\ApiException; +use Google\ApiCore\Serializer; use Google\ApiCore\ServerStream; use Google\Cloud\Bigtable\ChunkFormatter; use Google\Cloud\Bigtable\Exception\BigtableDataOperationException; @@ -25,19 +26,25 @@ use Google\Cloud\Bigtable\Mutations; use Google\Cloud\Bigtable\ReadModifyWriteRowRules; use Google\Cloud\Bigtable\Table; -use Google\Cloud\Bigtable\V2\BigtableClient as TableClient; +use Google\Cloud\Bigtable\V2\Client\BigtableClient; use Google\Cloud\Bigtable\V2\Cell; +use Google\Cloud\Bigtable\V2\CheckAndMutateRowRequest; use Google\Cloud\Bigtable\V2\CheckAndMutateRowResponse; use Google\Cloud\Bigtable\V2\Column; use Google\Cloud\Bigtable\V2\Family; +use Google\Cloud\Bigtable\V2\MutateRowRequest; use Google\Cloud\Bigtable\V2\MutateRowResponse; +use Google\Cloud\Bigtable\V2\MutateRowsRequest; use Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry as RequestEntry; use Google\Cloud\Bigtable\V2\MutateRowsResponse; use Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry as ResponseEntry; +use Google\Cloud\Bigtable\V2\ReadModifyWriteRowRequest; use Google\Cloud\Bigtable\V2\ReadModifyWriteRowResponse; +use Google\Cloud\Bigtable\V2\ReadRowsRequest; use Google\Cloud\Bigtable\V2\Row; use Google\Cloud\Bigtable\V2\RowRange; use Google\Cloud\Bigtable\V2\RowSet; +use Google\Cloud\Bigtable\V2\SampleRowKeysRequest; use Google\Cloud\Bigtable\V2\SampleRowKeysResponse; use Google\Rpc\Code; use InvalidArgumentException; @@ -69,7 +76,7 @@ class TableTest extends TestCase public function setUp(): void { - $this->bigtableClient = $this->prophesize(TableClient::class); + $this->bigtableClient = $this->prophesize(BigtableClient::class); $this->serverStream = $this->prophesize(ServerStream::class); $this->options = [ 'appProfileId' => self::APP_PROFILE, @@ -77,6 +84,7 @@ public function setUp(): void ]; $this->table = new Table( $this->bigtableClient->reveal(), + new Serializer(), self::TABLE_NAME, $this->options ); @@ -117,11 +125,13 @@ public function testMutateRows() ->willReturn( $this->arrayAsGenerator($mutateRowsResponses) ); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, $this->options) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $this->table->mutateRows($this->rowMutations); } @@ -133,13 +143,18 @@ public function testMutateRowsOptionalConfiguration() $this->arrayAsGenerator([]) ); $options = [ - 'key1' => 'value1' + 'transportOptions' => [ + 'key1' => 'value1' + ] ]; - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, $this->options + $options) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); + $this->table->mutateRows($this->rowMutations, $options); } @@ -160,11 +175,14 @@ public function testMutateRowsFailure() ->willReturn( $this->arrayAsGenerator($mutateRowsResponses) ); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, $this->options) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + ) + ->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); try { $this->table->mutateRows($this->rowMutations); $this->fail('Expected exception is not thrown'); @@ -191,11 +209,14 @@ public function testMutateRowsApiExceptionInMutateRows() $this->expectExceptionMessage('unauthenticated'); $apiException = new ApiException('unauthenticated', Code::UNAUTHENTICATED, 'unauthenticated'); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, $this->options) - ->shouldBeCalled() - ->willThrow( - $apiException - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + ) + ->shouldBeCalled() + ->willThrow( + $apiException + ); $this->table->mutateRows($this->rowMutations); } @@ -220,9 +241,11 @@ public function testMutateRowsApiExceptionThrowsErrorInfo() ], ] ); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, $this->options) - ->shouldBeCalled() - ->willThrow($apiException); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willThrow($apiException); try { $this->table->mutateRows($this->rowMutations); $this->fail('Expected an Exception, but no exception was thrown.'); @@ -252,11 +275,13 @@ public function testMutateRowsApiExceptionInReadAll() ->willThrow( $apiException ); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, $this->options) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $this->table->mutateRows($this->rowMutations); } @@ -274,11 +299,13 @@ public function testUpsert() ->willReturn( $this->arrayAsGenerator($mutateRowsResponses) ); - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, $this->options) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $rows = [ 'rk1' => [ 'cf1' => [ @@ -308,13 +335,17 @@ public function testUpsertOptionalConfiguration() $this->arrayAsGenerator([]) ); $options = [ - 'key1' => 'value1' + 'transportOptions' => [ + 'key1' => 'value1' + ] ]; - $this->bigtableClient->mutateRows(self::TABLE_NAME, $this->entries, $this->options + $options) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->mutateRows( + Argument::type(MutateRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $rows = [ 'rk1' => [ 'cf1' => [ @@ -340,11 +371,13 @@ public function testMutateRow() { $mutations = (new Mutations) ->upsert('cf1', 'cq1', 'value1'); - $this->bigtableClient->mutateRow(self::TABLE_NAME, 'r1', $mutations->toProto(), $this->options) - ->shouldBeCalled() - ->willReturn( - new MutateRowResponse - ); + $this->bigtableClient->mutateRow( + Argument::type(MutateRowRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + new MutateRowResponse + ); $this->table->mutateRow('r1', $mutations); } @@ -356,11 +389,13 @@ public function testReadRowsNoArg() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, $expectedArgs) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = []; $iterator = $this->table->readRows($args); $this->assertInstanceOf(ChunkFormatter::class, $iterator); @@ -379,13 +414,13 @@ public function testReadRow() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedArgs) { - return $argument['rows']->serializeToJsonString() === $expectedArgs['rows']->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $row = $this->table->readRow('rk1'); $this->assertNull($row); } @@ -404,14 +439,13 @@ public function testReadRowWithFilter() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedArgs) { - return $argument['rows']->serializeToJsonString() === $expectedArgs['rows']->serializeToJsonString() - && $argument['filter']->serializeToJsonString() === $expectedArgs['filter']->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'filter' => $rowFilter ]; @@ -431,13 +465,13 @@ public function testReadRowsWithMultipleRowKeys() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedArgs) { - return $argument['rows']->serializeToJsonString() === $expectedArgs['rows']->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'rowKeys' => ['rk1', 'rk2'] ]; @@ -459,14 +493,13 @@ public function testReadRowsWithRowLimit() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedArgs) { - return $argument['rows']->serializeToJsonString() === $expectedArgs['rows']->serializeToJsonString() - && $argument['rowsLimit'] === $expectedArgs['rowsLimit']; - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'rowKeys' => ['rk1', 'rk2'], 'rowsLimit' => 10 @@ -491,13 +524,13 @@ public function testReadRowsWithRowRangeKeysOpen() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedArgs) { - return $argument['rows']->serializeToJsonString() === $expectedArgs['rows']->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'rowRanges' =>[ [ @@ -526,13 +559,13 @@ public function testReadRowsWithRowRangeKeysClosed() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedArgs) { - return $argument['rows']->serializeToJsonString() === $expectedArgs['rows']->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'rowRanges' =>[ [ @@ -561,13 +594,13 @@ public function testReadRowsWithRowRangeKeysOpenClosed() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedArgs) { - return $argument['rows']->serializeToJsonString() === $expectedArgs['rows']->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'rowRanges' =>[ [ @@ -596,13 +629,13 @@ public function testReadRowsWithRowRangeKeysClosedOpen() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedArgs) { - return $argument['rows']->serializeToJsonString() === $expectedArgs['rows']->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'rowRanges' =>[ [ @@ -636,13 +669,13 @@ public function testReadRowsWithRowRangeKeysMultipleRowRanges() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, Argument::that(function ($argument) use ($expectedArgs) { - return $argument['rows']->serializeToJsonString() === $expectedArgs['rows']->serializeToJsonString(); - })) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'rowRanges' =>[ [ @@ -676,11 +709,13 @@ public function testReadRowsWithKeyAndRanges() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, $expectedArgs) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'rowKeys' => ['rk1'], 'rowRanges' => [ @@ -706,11 +741,13 @@ public function testReadRowsWithFilter() ->willReturn( $this->arrayAsGenerator([]) ); - $this->bigtableClient->readRows(self::TABLE_NAME, $expectedArgs) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->readRows( + Argument::type(ReadRowsRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $args = [ 'filter' => $rowFilter ]; @@ -742,12 +779,9 @@ public function testReadModifyWriteRowAppend() ->append('cf1', 'cq1', 'v1'); $this->bigtableClient ->readModifyWriteRow( - self::TABLE_NAME, - 'rk1', - $readModifyWriteRowRules->toProto(), - $this->options - ) - ->shouldBeCalled() + Argument::type(ReadModifyWriteRowRequest::class), + Argument::type('array') + )->shouldBeCalled() ->willReturn( $readModifyWriteRowResponse ); @@ -790,12 +824,9 @@ public function testReadModifyWriteRowIncrement() ->increment('cf1', 'cq1', 5); $this->bigtableClient ->readModifyWriteRow( - self::TABLE_NAME, - 'rk1', - $readModifyWriteRowRules->toProto(), - $this->options - ) - ->shouldBeCalled() + Argument::type(ReadModifyWriteRowRequest::class), + Argument::type('array') + )->shouldBeCalled() ->willReturn( $readModifyWriteRowResponse ); @@ -826,11 +857,13 @@ public function testSampleRowKeys() ->willReturn( $this->arrayAsGenerator($sampleRowKeyResponses) ); - $this->bigtableClient->sampleRowKeys(self::TABLE_NAME, $this->options) - ->shouldBeCalled() - ->willReturn( - $this->serverStream->reveal() - ); + $this->bigtableClient->sampleRowKeys( + Argument::type(SampleRowKeysRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + $this->serverStream->reveal() + ); $rowKeyStream = $this->table->sampleRowKeys(); $rowKeys = iterator_to_array($rowKeyStream); $expectedRowKeys = [ @@ -885,11 +918,13 @@ public function testCheckAndMutateRowWithTrueMutations() 'trueMutations' => $mutations->toProto() ]; $rowKey = 'rk1'; - $this->bigtableClient->checkAndMutateRow(self::TABLE_NAME, $rowKey, $expectedArgs) - ->shouldBeCalled() - ->willReturn( - (new CheckAndMutateRowResponse)->setPredicateMatched(true) - ); + $this->bigtableClient->checkAndMutateRow( + Argument::type(CheckAndMutateRowRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + (new CheckAndMutateRowResponse)->setPredicateMatched(true) + ); $result = $this->table->checkAndMutateRow($rowKey, ['trueMutations' => $mutations]); $this->assertTrue($result); } @@ -901,11 +936,13 @@ public function testCheckAndMutateRowWithFalseMutations() 'falseMutations' => $mutations->toProto() ]; $rowKey = 'rk1'; - $this->bigtableClient->checkAndMutateRow(self::TABLE_NAME, $rowKey, $expectedArgs) - ->shouldBeCalled() - ->willReturn( - (new CheckAndMutateRowResponse)->setPredicateMatched(false) - ); + $this->bigtableClient->checkAndMutateRow( + Argument::type(CheckAndMutateRowRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + (new CheckAndMutateRowResponse)->setPredicateMatched(false) + ); $result = $this->table->checkAndMutateRow($rowKey, ['falseMutations' => $mutations]); $this->assertFalse($result); } @@ -919,11 +956,13 @@ public function testCheckAndMutateRowWithPredicateFilter() 'trueMutations' => $mutations->toProto() ]; $rowKey = 'rk1'; - $this->bigtableClient->checkAndMutateRow(self::TABLE_NAME, $rowKey, $expectedArgs) - ->shouldBeCalled() - ->willReturn( - (new CheckAndMutateRowResponse)->setPredicateMatched(false) - ); + $this->bigtableClient->checkAndMutateRow( + Argument::type(CheckAndMutateRowRequest::class), + Argument::type('array') + )->shouldBeCalled() + ->willReturn( + (new CheckAndMutateRowResponse)->setPredicateMatched(false) + ); $result = $this->table->checkAndMutateRow( $rowKey, [ diff --git a/Bigtable/tests/Unit/V2/BigtableClientTest.php b/Bigtable/tests/Unit/V2/BigtableClientTest.php deleted file mode 100644 index 98e28eb6097f..000000000000 --- a/Bigtable/tests/Unit/V2/BigtableClientTest.php +++ /dev/null @@ -1,696 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return BigtableClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new BigtableClient($options); - } - - /** @test */ - public function checkAndMutateRowTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $predicateMatched = true; - $expectedResponse = new CheckAndMutateRowResponse(); - $expectedResponse->setPredicateMatched($predicateMatched); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $rowKey = '122'; - $response = $gapicClient->checkAndMutateRow($formattedTableName, $rowKey); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.v2.Bigtable/CheckAndMutateRow', $actualFuncCall); - $actualValue = $actualRequestObject->getTableName(); - $this->assertProtobufEquals($formattedTableName, $actualValue); - $actualValue = $actualRequestObject->getRowKey(); - $this->assertProtobufEquals($rowKey, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function checkAndMutateRowExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $rowKey = '122'; - try { - $gapicClient->checkAndMutateRow($formattedTableName, $rowKey); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateInitialChangeStreamPartitionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GenerateInitialChangeStreamPartitionsResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new GenerateInitialChangeStreamPartitionsResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new GenerateInitialChangeStreamPartitionsResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $serverStream = $gapicClient->generateInitialChangeStreamPartitions($formattedTableName); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.v2.Bigtable/GenerateInitialChangeStreamPartitions', $actualFuncCall); - $actualValue = $actualRequestObject->getTableName(); - $this->assertProtobufEquals($formattedTableName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateInitialChangeStreamPartitionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $serverStream = $gapicClient->generateInitialChangeStreamPartitions($formattedTableName); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function mutateRowTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new MutateRowResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $rowKey = '122'; - $mutations = []; - $response = $gapicClient->mutateRow($formattedTableName, $rowKey, $mutations); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.v2.Bigtable/MutateRow', $actualFuncCall); - $actualValue = $actualRequestObject->getTableName(); - $this->assertProtobufEquals($formattedTableName, $actualValue); - $actualValue = $actualRequestObject->getRowKey(); - $this->assertProtobufEquals($rowKey, $actualValue); - $actualValue = $actualRequestObject->getMutations(); - $this->assertProtobufEquals($mutations, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function mutateRowExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $rowKey = '122'; - $mutations = []; - try { - $gapicClient->mutateRow($formattedTableName, $rowKey, $mutations); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function mutateRowsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new MutateRowsResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new MutateRowsResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new MutateRowsResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $entries = []; - $serverStream = $gapicClient->mutateRows($formattedTableName, $entries); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.v2.Bigtable/MutateRows', $actualFuncCall); - $actualValue = $actualRequestObject->getTableName(); - $this->assertProtobufEquals($formattedTableName, $actualValue); - $actualValue = $actualRequestObject->getEntries(); - $this->assertProtobufEquals($entries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function mutateRowsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $entries = []; - $serverStream = $gapicClient->mutateRows($formattedTableName, $entries); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pingAndWarmTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new PingAndWarmResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $response = $gapicClient->pingAndWarm($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.v2.Bigtable/PingAndWarm', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pingAndWarmExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - try { - $gapicClient->pingAndWarm($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readChangeStreamTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReadChangeStreamResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new ReadChangeStreamResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new ReadChangeStreamResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $serverStream = $gapicClient->readChangeStream($formattedTableName); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.v2.Bigtable/ReadChangeStream', $actualFuncCall); - $actualValue = $actualRequestObject->getTableName(); - $this->assertProtobufEquals($formattedTableName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readChangeStreamExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $serverStream = $gapicClient->readChangeStream($formattedTableName); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readModifyWriteRowTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReadModifyWriteRowResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $rowKey = '122'; - $rules = []; - $response = $gapicClient->readModifyWriteRow($formattedTableName, $rowKey, $rules); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.v2.Bigtable/ReadModifyWriteRow', $actualFuncCall); - $actualValue = $actualRequestObject->getTableName(); - $this->assertProtobufEquals($formattedTableName, $actualValue); - $actualValue = $actualRequestObject->getRowKey(); - $this->assertProtobufEquals($rowKey, $actualValue); - $actualValue = $actualRequestObject->getRules(); - $this->assertProtobufEquals($rules, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readModifyWriteRowExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $rowKey = '122'; - $rules = []; - try { - $gapicClient->readModifyWriteRow($formattedTableName, $rowKey, $rules); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readRowsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $lastScannedRowKey = '-126'; - $expectedResponse = new ReadRowsResponse(); - $expectedResponse->setLastScannedRowKey($lastScannedRowKey); - $transport->addResponse($expectedResponse); - $lastScannedRowKey2 = '-75'; - $expectedResponse2 = new ReadRowsResponse(); - $expectedResponse2->setLastScannedRowKey($lastScannedRowKey2); - $transport->addResponse($expectedResponse2); - $lastScannedRowKey3 = '-74'; - $expectedResponse3 = new ReadRowsResponse(); - $expectedResponse3->setLastScannedRowKey($lastScannedRowKey3); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $serverStream = $gapicClient->readRows($formattedTableName); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.v2.Bigtable/ReadRows', $actualFuncCall); - $actualValue = $actualRequestObject->getTableName(); - $this->assertProtobufEquals($formattedTableName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readRowsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $serverStream = $gapicClient->readRows($formattedTableName); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function sampleRowKeysTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $rowKey = '122'; - $offsetBytes = 889884095; - $expectedResponse = new SampleRowKeysResponse(); - $expectedResponse->setRowKey($rowKey); - $expectedResponse->setOffsetBytes($offsetBytes); - $transport->addResponse($expectedResponse); - $rowKey2 = '-83'; - $offsetBytes2 = 480126386; - $expectedResponse2 = new SampleRowKeysResponse(); - $expectedResponse2->setRowKey($rowKey2); - $expectedResponse2->setOffsetBytes($offsetBytes2); - $transport->addResponse($expectedResponse2); - $rowKey3 = '-82'; - $offsetBytes3 = 480126387; - $expectedResponse3 = new SampleRowKeysResponse(); - $expectedResponse3->setRowKey($rowKey3); - $expectedResponse3->setOffsetBytes($offsetBytes3); - $transport->addResponse($expectedResponse3); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $serverStream = $gapicClient->sampleRowKeys($formattedTableName); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.bigtable.v2.Bigtable/SampleRowKeys', $actualFuncCall); - $actualValue = $actualRequestObject->getTableName(); - $this->assertProtobufEquals($formattedTableName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function sampleRowKeysExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $serverStream = $gapicClient->sampleRowKeys($formattedTableName); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Bigtable/tests/Unit/bootstrap.php b/Bigtable/tests/Unit/bootstrap.php new file mode 100644 index 000000000000..743a917983d8 --- /dev/null +++ b/Bigtable/tests/Unit/bootstrap.php @@ -0,0 +1,10 @@ +.google.cloud.binaryauthorization.v1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $evaluation_mode = 0; + protected $evaluation_mode = 0; /** * Optional. The resource names of the attestors that must attest to * a container image, in the format `projects/*/attestors/*`. Each @@ -43,7 +43,7 @@ class AdmissionRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $enforcement_mode = 0; + protected $enforcement_mode = 0; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/AdmissionRule/EnforcementMode.php b/BinaryAuthorization/src/V1/AdmissionRule/EnforcementMode.php index 577a398fc23c..c31a2c7c0a6d 100644 --- a/BinaryAuthorization/src/V1/AdmissionRule/EnforcementMode.php +++ b/BinaryAuthorization/src/V1/AdmissionRule/EnforcementMode.php @@ -61,6 +61,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EnforcementMode::class, \Google\Cloud\BinaryAuthorization\V1\AdmissionRule_EnforcementMode::class); diff --git a/BinaryAuthorization/src/V1/AdmissionRule/EvaluationMode.php b/BinaryAuthorization/src/V1/AdmissionRule/EvaluationMode.php index 81cc9a636e88..737802146bf5 100644 --- a/BinaryAuthorization/src/V1/AdmissionRule/EvaluationMode.php +++ b/BinaryAuthorization/src/V1/AdmissionRule/EvaluationMode.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EvaluationMode::class, \Google\Cloud\BinaryAuthorization\V1\AdmissionRule_EvaluationMode::class); diff --git a/BinaryAuthorization/src/V1/AdmissionWhitelistPattern.php b/BinaryAuthorization/src/V1/AdmissionWhitelistPattern.php index 91fd429c2b03..7d0e33969045 100644 --- a/BinaryAuthorization/src/V1/AdmissionWhitelistPattern.php +++ b/BinaryAuthorization/src/V1/AdmissionWhitelistPattern.php @@ -24,7 +24,7 @@ class AdmissionWhitelistPattern extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name_pattern = 1; */ - private $name_pattern = ''; + protected $name_pattern = ''; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/Attestor.php b/BinaryAuthorization/src/V1/Attestor.php index 65b2704c97e5..823512f34ddc 100644 --- a/BinaryAuthorization/src/V1/Attestor.php +++ b/BinaryAuthorization/src/V1/Attestor.php @@ -23,20 +23,20 @@ class Attestor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. A descriptive comment. This field may be updated. * The field may be displayed in chooser dialogs. * * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. Time when the attestor was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; protected $attestor_type; /** diff --git a/BinaryAuthorization/src/V1/AttestorPublicKey.php b/BinaryAuthorization/src/V1/AttestorPublicKey.php index 52c44140174b..e667ea8a3f9c 100644 --- a/BinaryAuthorization/src/V1/AttestorPublicKey.php +++ b/BinaryAuthorization/src/V1/AttestorPublicKey.php @@ -21,7 +21,7 @@ class AttestorPublicKey extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $comment = ''; + protected $comment = ''; /** * The ID of this public key. * Signatures verified by BinAuthz must include the ID of the public key that @@ -33,7 +33,7 @@ class AttestorPublicKey extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 2; */ - private $id = ''; + protected $id = ''; protected $public_key; /** diff --git a/BinaryAuthorization/src/V1/BinauthzManagementServiceV1GrpcClient.php b/BinaryAuthorization/src/V1/BinauthzManagementServiceV1GrpcClient.php deleted file mode 100644 index a03bef983328..000000000000 --- a/BinaryAuthorization/src/V1/BinauthzManagementServiceV1GrpcClient.php +++ /dev/null @@ -1,165 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetPolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1.Policy], and returns a copy of the - * new [policy][google.cloud.binaryauthorization.v1.Policy]. A policy is always updated as a whole, to avoid race - * conditions with concurrent policy enforcement (or management!) - * requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT - * if the request is malformed. - * @param \Google\Cloud\BinaryAuthorization\V1\UpdatePolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdatePolicy(\Google\Cloud\BinaryAuthorization\V1\UpdatePolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdatePolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1.Attestor], and returns a copy of the new - * [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the project does not exist, - * INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1.Attestor] already exists. - * @param \Google\Cloud\BinaryAuthorization\V1\CreateAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateAttestor(\Google\Cloud\BinaryAuthorization\V1\CreateAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1\GetAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetAttestor(\Google\Cloud\BinaryAuthorization\V1\GetAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Updates an [attestor][google.cloud.binaryauthorization.v1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1\UpdateAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateAttestor(\Google\Cloud\BinaryAuthorization\V1\UpdateAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdateAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Lists [attestors][google.cloud.binaryauthorization.v1.Attestor]. - * Returns INVALID_ARGUMENT if the project does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1\ListAttestorsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListAttestors(\Google\Cloud\BinaryAuthorization\V1\ListAttestorsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/ListAttestors', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\ListAttestorsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1\DeleteAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteAttestor(\Google\Cloud\BinaryAuthorization\V1\DeleteAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/DeleteAttestor', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1/Client/BinauthzManagementServiceV1Client.php b/BinaryAuthorization/src/V1/Client/BinauthzManagementServiceV1Client.php index 1d90e15c6f2a..cdc693cc4c4b 100644 --- a/BinaryAuthorization/src/V1/Client/BinauthzManagementServiceV1Client.php +++ b/BinaryAuthorization/src/V1/Client/BinauthzManagementServiceV1Client.php @@ -1,6 +1,6 @@ [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/binauthz_management_service_v1_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/binauthz_management_service_v1_rest_client_config.php', ], ], ]; diff --git a/BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php b/BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php index 72a928dd6e0f..00cb8a0fb7ce 100644 --- a/BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php +++ b/BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php @@ -1,6 +1,6 @@ startApiCall('ValidateAttestationOccurrence', $request, $callOptions)->wait(); } } diff --git a/BinaryAuthorization/src/V1/CreateAttestorRequest.php b/BinaryAuthorization/src/V1/CreateAttestorRequest.php index b1e152f2c0e5..60d6da8c9ebf 100644 --- a/BinaryAuthorization/src/V1/CreateAttestorRequest.php +++ b/BinaryAuthorization/src/V1/CreateAttestorRequest.php @@ -20,13 +20,13 @@ class CreateAttestorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The [attestors][google.cloud.binaryauthorization.v1.Attestor] ID. * * Generated from protobuf field string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestor_id = ''; + protected $attestor_id = ''; /** * Required. The initial [attestor][google.cloud.binaryauthorization.v1.Attestor] value. The service will * overwrite the [attestor name][google.cloud.binaryauthorization.v1.Attestor.name] field with the resource name, @@ -34,7 +34,7 @@ class CreateAttestorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestor = null; + protected $attestor = null; /** * @param string $parent Required. The parent of this [attestor][google.cloud.binaryauthorization.v1.Attestor]. Please see diff --git a/BinaryAuthorization/src/V1/DeleteAttestorRequest.php b/BinaryAuthorization/src/V1/DeleteAttestorRequest.php index 5ca51bdbdf3b..b0df352faa1d 100644 --- a/BinaryAuthorization/src/V1/DeleteAttestorRequest.php +++ b/BinaryAuthorization/src/V1/DeleteAttestorRequest.php @@ -21,7 +21,7 @@ class DeleteAttestorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the [attestors][google.cloud.binaryauthorization.v1.Attestor] to delete, in the format diff --git a/BinaryAuthorization/src/V1/GetAttestorRequest.php b/BinaryAuthorization/src/V1/GetAttestorRequest.php index 78b587a54fca..1eca782c6323 100644 --- a/BinaryAuthorization/src/V1/GetAttestorRequest.php +++ b/BinaryAuthorization/src/V1/GetAttestorRequest.php @@ -21,7 +21,7 @@ class GetAttestorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the [attestor][google.cloud.binaryauthorization.v1.Attestor] to retrieve, in the format diff --git a/BinaryAuthorization/src/V1/GetPolicyRequest.php b/BinaryAuthorization/src/V1/GetPolicyRequest.php index 1a9f15fa322f..be8fcb28d126 100644 --- a/BinaryAuthorization/src/V1/GetPolicyRequest.php +++ b/BinaryAuthorization/src/V1/GetPolicyRequest.php @@ -21,7 +21,7 @@ class GetPolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the [policy][google.cloud.binaryauthorization.v1.Policy] to retrieve, diff --git a/BinaryAuthorization/src/V1/GetSystemPolicyRequest.php b/BinaryAuthorization/src/V1/GetSystemPolicyRequest.php index b55d89db71e5..6a2924097b64 100644 --- a/BinaryAuthorization/src/V1/GetSystemPolicyRequest.php +++ b/BinaryAuthorization/src/V1/GetSystemPolicyRequest.php @@ -21,7 +21,7 @@ class GetSystemPolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name, in the format `locations/*/policy`. diff --git a/BinaryAuthorization/src/V1/ListAttestorsRequest.php b/BinaryAuthorization/src/V1/ListAttestorsRequest.php index ad1a0f910876..0ec66e3b59bb 100644 --- a/BinaryAuthorization/src/V1/ListAttestorsRequest.php +++ b/BinaryAuthorization/src/V1/ListAttestorsRequest.php @@ -21,14 +21,14 @@ class ListAttestorsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Requested page size. The server may return fewer results than requested. If * unspecified, the server will pick an appropriate default. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A token identifying a page of results the server should return. Typically, * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1.ListAttestorsResponse.next_page_token] returned @@ -36,7 +36,7 @@ class ListAttestorsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The resource name of the project associated with the diff --git a/BinaryAuthorization/src/V1/ListAttestorsResponse.php b/BinaryAuthorization/src/V1/ListAttestorsResponse.php index ff8e3b0d18a7..190c546198a4 100644 --- a/BinaryAuthorization/src/V1/ListAttestorsResponse.php +++ b/BinaryAuthorization/src/V1/ListAttestorsResponse.php @@ -28,7 +28,7 @@ class ListAttestorsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/PkixPublicKey.php b/BinaryAuthorization/src/V1/PkixPublicKey.php index 61a460c84bf2..47ab5f4c9428 100644 --- a/BinaryAuthorization/src/V1/PkixPublicKey.php +++ b/BinaryAuthorization/src/V1/PkixPublicKey.php @@ -24,7 +24,7 @@ class PkixPublicKey extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string public_key_pem = 1; */ - private $public_key_pem = ''; + protected $public_key_pem = ''; /** * The signature algorithm used to verify a message against a signature using * this key. @@ -34,7 +34,7 @@ class PkixPublicKey extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; */ - private $signature_algorithm = 0; + protected $signature_algorithm = 0; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/PkixPublicKey/SignatureAlgorithm.php b/BinaryAuthorization/src/V1/PkixPublicKey/SignatureAlgorithm.php index 9e645d939452..ba315daf9ec3 100644 --- a/BinaryAuthorization/src/V1/PkixPublicKey/SignatureAlgorithm.php +++ b/BinaryAuthorization/src/V1/PkixPublicKey/SignatureAlgorithm.php @@ -148,6 +148,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SignatureAlgorithm::class, \Google\Cloud\BinaryAuthorization\V1\PkixPublicKey_SignatureAlgorithm::class); diff --git a/BinaryAuthorization/src/V1/Policy.php b/BinaryAuthorization/src/V1/Policy.php index 1b8e1fd2ec45..c7d740cd0928 100644 --- a/BinaryAuthorization/src/V1/Policy.php +++ b/BinaryAuthorization/src/V1/Policy.php @@ -21,13 +21,13 @@ class Policy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Optional. A descriptive comment. * * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. Controls the evaluation of a Google-maintained global admission * policy for common system-level images. Images not covered by the global @@ -36,7 +36,7 @@ class Policy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $global_policy_evaluation_mode = 0; + protected $global_policy_evaluation_mode = 0; /** * Optional. Admission policy allowlisting. A matching admission request will * always be permitted. This feature is typically used to exclude Google or @@ -87,13 +87,13 @@ class Policy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $default_admission_rule = null; + protected $default_admission_rule = null; /** * Output only. Time when the policy was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/Policy/GlobalPolicyEvaluationMode.php b/BinaryAuthorization/src/V1/Policy/GlobalPolicyEvaluationMode.php index 5239abed7073..7b0089d49505 100644 --- a/BinaryAuthorization/src/V1/Policy/GlobalPolicyEvaluationMode.php +++ b/BinaryAuthorization/src/V1/Policy/GlobalPolicyEvaluationMode.php @@ -57,6 +57,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GlobalPolicyEvaluationMode::class, \Google\Cloud\BinaryAuthorization\V1\Policy_GlobalPolicyEvaluationMode::class); diff --git a/BinaryAuthorization/src/V1/SystemPolicyV1GrpcClient.php b/BinaryAuthorization/src/V1/SystemPolicyV1GrpcClient.php deleted file mode 100644 index 163b4269b9fc..000000000000 --- a/BinaryAuthorization/src/V1/SystemPolicyV1GrpcClient.php +++ /dev/null @@ -1,50 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1.SystemPolicyV1/GetSystemPolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Policy', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1/UpdateAttestorRequest.php b/BinaryAuthorization/src/V1/UpdateAttestorRequest.php index 9184fac9800f..370dfb0587a8 100644 --- a/BinaryAuthorization/src/V1/UpdateAttestorRequest.php +++ b/BinaryAuthorization/src/V1/UpdateAttestorRequest.php @@ -22,7 +22,7 @@ class UpdateAttestorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestor = null; + protected $attestor = null; /** * @param \Google\Cloud\BinaryAuthorization\V1\Attestor $attestor Required. The updated [attestor][google.cloud.binaryauthorization.v1.Attestor] value. The service will diff --git a/BinaryAuthorization/src/V1/UpdatePolicyRequest.php b/BinaryAuthorization/src/V1/UpdatePolicyRequest.php index 53df72dd97df..839ecddda32e 100644 --- a/BinaryAuthorization/src/V1/UpdatePolicyRequest.php +++ b/BinaryAuthorization/src/V1/UpdatePolicyRequest.php @@ -22,7 +22,7 @@ class UpdatePolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $policy = null; + protected $policy = null; /** * @param \Google\Cloud\BinaryAuthorization\V1\Policy $policy Required. A new or updated [policy][google.cloud.binaryauthorization.v1.Policy] value. The service will diff --git a/BinaryAuthorization/src/V1/UserOwnedGrafeasNote.php b/BinaryAuthorization/src/V1/UserOwnedGrafeasNote.php index ee5382aa9117..13b690e61359 100644 --- a/BinaryAuthorization/src/V1/UserOwnedGrafeasNote.php +++ b/BinaryAuthorization/src/V1/UserOwnedGrafeasNote.php @@ -26,7 +26,7 @@ class UserOwnedGrafeasNote extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $note_reference = ''; + protected $note_reference = ''; /** * Optional. Public keys that verify attestations signed by this * attestor. This field may be updated. @@ -51,7 +51,7 @@ class UserOwnedGrafeasNote extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $delegation_service_account_email = ''; + protected $delegation_service_account_email = ''; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceRequest.php b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceRequest.php index 4d6ac93e53b4..5f9e80630122 100644 --- a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceRequest.php +++ b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceRequest.php @@ -23,7 +23,7 @@ class ValidateAttestationOccurrenceRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string attestor = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestor = ''; + protected $attestor = ''; /** * Required. An [AttestationOccurrence][grafeas.v1.AttestationOccurrence] to * be checked that it can be verified by the Attestor. It does not have to be @@ -32,21 +32,21 @@ class ValidateAttestationOccurrenceRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .grafeas.v1.AttestationOccurrence attestation = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestation = null; + protected $attestation = null; /** * Required. The resource name of the [Note][grafeas.v1.Note] to which the * containing [Occurrence][grafeas.v1.Occurrence] is associated. * * Generated from protobuf field string occurrence_note = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $occurrence_note = ''; + protected $occurrence_note = ''; /** * Required. The URI of the artifact (e.g. container image) that is the * subject of the containing [Occurrence][grafeas.v1.Occurrence]. * * Generated from protobuf field string occurrence_resource_uri = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $occurrence_resource_uri = ''; + protected $occurrence_resource_uri = ''; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse.php b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse.php index 55034a8bd8ec..e2ab9e3c1582 100644 --- a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse.php +++ b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse.php @@ -21,13 +21,13 @@ class ValidateAttestationOccurrenceResponse extends \Google\Protobuf\Internal\Me * * Generated from protobuf field .google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceResponse.Result result = 1; */ - private $result = 0; + protected $result = 0; /** * The reason for denial if the Attestation couldn't be validated. * * Generated from protobuf field string denial_reason = 2; */ - private $denial_reason = ''; + protected $denial_reason = ''; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse/Result.php b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse/Result.php index d8e6ba122e86..f1e6c83601bb 100644 --- a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse/Result.php +++ b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse/Result.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Result::class, \Google\Cloud\BinaryAuthorization\V1\ValidateAttestationOccurrenceResponse_Result::class); diff --git a/BinaryAuthorization/src/V1/ValidationHelperV1GrpcClient.php b/BinaryAuthorization/src/V1/ValidationHelperV1GrpcClient.php deleted file mode 100644 index 24a2d1b80d65..000000000000 --- a/BinaryAuthorization/src/V1/ValidationHelperV1GrpcClient.php +++ /dev/null @@ -1,51 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\ValidateAttestationOccurrenceResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1beta1/AdmissionRule.php b/BinaryAuthorization/src/V1beta1/AdmissionRule.php deleted file mode 100644 index 9f6c3d5ae6cb..000000000000 --- a/BinaryAuthorization/src/V1beta1/AdmissionRule.php +++ /dev/null @@ -1,164 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AdmissionRule - */ -class AdmissionRule extends \Google\Protobuf\Internal\Message -{ - /** - * Required. How this admission rule will be evaluated. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $evaluation_mode = 0; - /** - * Optional. The resource names of the attestors that must attest to - * a container image, in the format `projects/*/attestors/*`. Each - * attestor must exist before a policy can reference it. To add an attestor - * to a policy the principal issuing the policy change request must be able - * to read the attestor resource. - * Note: this field must be non-empty when the evaluation_mode field specifies - * REQUIRE_ATTESTATION, otherwise it must be empty. - * - * Generated from protobuf field repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $require_attestations_by; - /** - * Required. The action when a pod creation is denied by the admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $enforcement_mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $evaluation_mode - * Required. How this admission rule will be evaluated. - * @type array|\Google\Protobuf\Internal\RepeatedField $require_attestations_by - * Optional. The resource names of the attestors that must attest to - * a container image, in the format `projects/*/attestors/*`. Each - * attestor must exist before a policy can reference it. To add an attestor - * to a policy the principal issuing the policy change request must be able - * to read the attestor resource. - * Note: this field must be non-empty when the evaluation_mode field specifies - * REQUIRE_ATTESTATION, otherwise it must be empty. - * @type int $enforcement_mode - * Required. The action when a pod creation is denied by the admission rule. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. How this admission rule will be evaluated. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getEvaluationMode() - { - return $this->evaluation_mode; - } - - /** - * Required. How this admission rule will be evaluated. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setEvaluationMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule\EvaluationMode::class); - $this->evaluation_mode = $var; - - return $this; - } - - /** - * Optional. The resource names of the attestors that must attest to - * a container image, in the format `projects/*/attestors/*`. Each - * attestor must exist before a policy can reference it. To add an attestor - * to a policy the principal issuing the policy change request must be able - * to read the attestor resource. - * Note: this field must be non-empty when the evaluation_mode field specifies - * REQUIRE_ATTESTATION, otherwise it must be empty. - * - * Generated from protobuf field repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRequireAttestationsBy() - { - return $this->require_attestations_by; - } - - /** - * Optional. The resource names of the attestors that must attest to - * a container image, in the format `projects/*/attestors/*`. Each - * attestor must exist before a policy can reference it. To add an attestor - * to a policy the principal issuing the policy change request must be able - * to read the attestor resource. - * Note: this field must be non-empty when the evaluation_mode field specifies - * REQUIRE_ATTESTATION, otherwise it must be empty. - * - * Generated from protobuf field repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRequireAttestationsBy($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->require_attestations_by = $arr; - - return $this; - } - - /** - * Required. The action when a pod creation is denied by the admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getEnforcementMode() - { - return $this->enforcement_mode; - } - - /** - * Required. The action when a pod creation is denied by the admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setEnforcementMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule\EnforcementMode::class); - $this->enforcement_mode = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/AdmissionRule/EnforcementMode.php b/BinaryAuthorization/src/V1beta1/AdmissionRule/EnforcementMode.php deleted file mode 100644 index fea0acc3f238..000000000000 --- a/BinaryAuthorization/src/V1beta1/AdmissionRule/EnforcementMode.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode - */ -class EnforcementMode -{ - /** - * Do not use. - * - * Generated from protobuf enum ENFORCEMENT_MODE_UNSPECIFIED = 0; - */ - const ENFORCEMENT_MODE_UNSPECIFIED = 0; - /** - * Enforce the admission rule by blocking the pod creation. - * - * Generated from protobuf enum ENFORCED_BLOCK_AND_AUDIT_LOG = 1; - */ - const ENFORCED_BLOCK_AND_AUDIT_LOG = 1; - /** - * Dryrun mode: Audit logging only. This will allow the pod creation as if - * the admission request had specified break-glass. - * - * Generated from protobuf enum DRYRUN_AUDIT_LOG_ONLY = 2; - */ - const DRYRUN_AUDIT_LOG_ONLY = 2; - - private static $valueToName = [ - self::ENFORCEMENT_MODE_UNSPECIFIED => 'ENFORCEMENT_MODE_UNSPECIFIED', - self::ENFORCED_BLOCK_AND_AUDIT_LOG => 'ENFORCED_BLOCK_AND_AUDIT_LOG', - self::DRYRUN_AUDIT_LOG_ONLY => 'DRYRUN_AUDIT_LOG_ONLY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EnforcementMode::class, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule_EnforcementMode::class); - diff --git a/BinaryAuthorization/src/V1beta1/AdmissionRule/EvaluationMode.php b/BinaryAuthorization/src/V1beta1/AdmissionRule/EvaluationMode.php deleted file mode 100644 index 1b585c0c332a..000000000000 --- a/BinaryAuthorization/src/V1beta1/AdmissionRule/EvaluationMode.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode - */ -class EvaluationMode -{ - /** - * Do not use. - * - * Generated from protobuf enum EVALUATION_MODE_UNSPECIFIED = 0; - */ - const EVALUATION_MODE_UNSPECIFIED = 0; - /** - * This rule allows all all pod creations. - * - * Generated from protobuf enum ALWAYS_ALLOW = 1; - */ - const ALWAYS_ALLOW = 1; - /** - * This rule allows a pod creation if all the attestors listed in - * `require_attestations_by` have valid attestations for all of the - * images in the pod spec. - * - * Generated from protobuf enum REQUIRE_ATTESTATION = 2; - */ - const REQUIRE_ATTESTATION = 2; - /** - * This rule denies all pod creations. - * - * Generated from protobuf enum ALWAYS_DENY = 3; - */ - const ALWAYS_DENY = 3; - - private static $valueToName = [ - self::EVALUATION_MODE_UNSPECIFIED => 'EVALUATION_MODE_UNSPECIFIED', - self::ALWAYS_ALLOW => 'ALWAYS_ALLOW', - self::REQUIRE_ATTESTATION => 'REQUIRE_ATTESTATION', - self::ALWAYS_DENY => 'ALWAYS_DENY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EvaluationMode::class, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule_EvaluationMode::class); - diff --git a/BinaryAuthorization/src/V1beta1/AdmissionRule_EnforcementMode.php b/BinaryAuthorization/src/V1beta1/AdmissionRule_EnforcementMode.php deleted file mode 100644 index 29eb7262eaff..000000000000 --- a/BinaryAuthorization/src/V1beta1/AdmissionRule_EnforcementMode.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - */ -class AdmissionWhitelistPattern extends \Google\Protobuf\Internal\Message -{ - /** - * An image name pattern to allowlist, in the form `registry/path/to/image`. - * This supports a trailing `*` as a wildcard, but this is allowed only in - * text after the `registry/` part. `*` wildcard does not match `/`, i.e., - * `gcr.io/nginx*` matches `gcr.io/nginx@latest`, but it does not match - * `gcr.io/nginx/image`. This also supports a trailing `**` wildcard which - * matches subdirectories, i.e., `gcr.io/nginx**` matches - * `gcr.io/nginx/image`. - * - * Generated from protobuf field string name_pattern = 1; - */ - private $name_pattern = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name_pattern - * An image name pattern to allowlist, in the form `registry/path/to/image`. - * This supports a trailing `*` as a wildcard, but this is allowed only in - * text after the `registry/` part. `*` wildcard does not match `/`, i.e., - * `gcr.io/nginx*` matches `gcr.io/nginx@latest`, but it does not match - * `gcr.io/nginx/image`. This also supports a trailing `**` wildcard which - * matches subdirectories, i.e., `gcr.io/nginx**` matches - * `gcr.io/nginx/image`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * An image name pattern to allowlist, in the form `registry/path/to/image`. - * This supports a trailing `*` as a wildcard, but this is allowed only in - * text after the `registry/` part. `*` wildcard does not match `/`, i.e., - * `gcr.io/nginx*` matches `gcr.io/nginx@latest`, but it does not match - * `gcr.io/nginx/image`. This also supports a trailing `**` wildcard which - * matches subdirectories, i.e., `gcr.io/nginx**` matches - * `gcr.io/nginx/image`. - * - * Generated from protobuf field string name_pattern = 1; - * @return string - */ - public function getNamePattern() - { - return $this->name_pattern; - } - - /** - * An image name pattern to allowlist, in the form `registry/path/to/image`. - * This supports a trailing `*` as a wildcard, but this is allowed only in - * text after the `registry/` part. `*` wildcard does not match `/`, i.e., - * `gcr.io/nginx*` matches `gcr.io/nginx@latest`, but it does not match - * `gcr.io/nginx/image`. This also supports a trailing `**` wildcard which - * matches subdirectories, i.e., `gcr.io/nginx**` matches - * `gcr.io/nginx/image`. - * - * Generated from protobuf field string name_pattern = 1; - * @param string $var - * @return $this - */ - public function setNamePattern($var) - { - GPBUtil::checkString($var, True); - $this->name_pattern = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/Attestor.php b/BinaryAuthorization/src/V1beta1/Attestor.php deleted file mode 100644 index fe72b883c8ea..000000000000 --- a/BinaryAuthorization/src/V1beta1/Attestor.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.Attestor - */ -class Attestor extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name, in the format: - * `projects/*/attestors/*`. This field may not be updated. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Optional. A descriptive comment. This field may be updated. - * The field may be displayed in chooser dialogs. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $description = ''; - /** - * Output only. Time when the attestor was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - protected $attestor_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name, in the format: - * `projects/*/attestors/*`. This field may not be updated. - * @type string $description - * Optional. A descriptive comment. This field may be updated. - * The field may be displayed in chooser dialogs. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\UserOwnedDrydockNote $user_owned_drydock_note - * A Drydock ATTESTATION_AUTHORITY Note, created by the user. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Time when the attestor was last updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name, in the format: - * `projects/*/attestors/*`. This field may not be updated. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name, in the format: - * `projects/*/attestors/*`. This field may not be updated. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A descriptive comment. This field may be updated. - * The field may be displayed in chooser dialogs. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. A descriptive comment. This field may be updated. - * The field may be displayed in chooser dialogs. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * A Drydock ATTESTATION_AUTHORITY Note, created by the user. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\UserOwnedDrydockNote|null - */ - public function getUserOwnedDrydockNote() - { - return $this->readOneof(3); - } - - public function hasUserOwnedDrydockNote() - { - return $this->hasOneof(3); - } - - /** - * A Drydock ATTESTATION_AUTHORITY Note, created by the user. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\UserOwnedDrydockNote $var - * @return $this - */ - public function setUserOwnedDrydockNote($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\UserOwnedDrydockNote::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Output only. Time when the attestor was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. Time when the attestor was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * @return string - */ - public function getAttestorType() - { - return $this->whichOneof("attestor_type"); - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/AttestorPublicKey.php b/BinaryAuthorization/src/V1beta1/AttestorPublicKey.php deleted file mode 100644 index c1f753e8348e..000000000000 --- a/BinaryAuthorization/src/V1beta1/AttestorPublicKey.php +++ /dev/null @@ -1,234 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AttestorPublicKey - */ -class AttestorPublicKey extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A descriptive comment. This field may be updated. - * - * Generated from protobuf field string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $comment = ''; - /** - * The ID of this public key. - * Signatures verified by BinAuthz must include the ID of the public key that - * can be used to verify them, and that ID must match the contents of this - * field exactly. - * Additional restrictions on this field can be imposed based on which public - * key type is encapsulated. See the documentation on `public_key` cases below - * for details. - * - * Generated from protobuf field string id = 2; - */ - private $id = ''; - protected $public_key; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $comment - * Optional. A descriptive comment. This field may be updated. - * @type string $id - * The ID of this public key. - * Signatures verified by BinAuthz must include the ID of the public key that - * can be used to verify them, and that ID must match the contents of this - * field exactly. - * Additional restrictions on this field can be imposed based on which public - * key type is encapsulated. See the documentation on `public_key` cases below - * for details. - * @type string $ascii_armored_pgp_public_key - * ASCII-armored representation of a PGP public key, as the entire output by - * the command `gpg --export --armor foo@example.com` (either LF or CRLF - * line endings). - * When using this field, `id` should be left blank. The BinAuthz API - * handlers will calculate the ID and fill it in automatically. BinAuthz - * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as - * upper-case hex. If `id` is provided by the caller, it will be - * overwritten by the API-calculated ID. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey $pkix_public_key - * A raw PKIX SubjectPublicKeyInfo format public key. - * NOTE: `id` may be explicitly provided by the caller when using this - * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left - * blank, a default one will be computed based on the digest of the DER - * encoding of the public key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A descriptive comment. This field may be updated. - * - * Generated from protobuf field string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getComment() - { - return $this->comment; - } - - /** - * Optional. A descriptive comment. This field may be updated. - * - * Generated from protobuf field string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setComment($var) - { - GPBUtil::checkString($var, True); - $this->comment = $var; - - return $this; - } - - /** - * The ID of this public key. - * Signatures verified by BinAuthz must include the ID of the public key that - * can be used to verify them, and that ID must match the contents of this - * field exactly. - * Additional restrictions on this field can be imposed based on which public - * key type is encapsulated. See the documentation on `public_key` cases below - * for details. - * - * Generated from protobuf field string id = 2; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The ID of this public key. - * Signatures verified by BinAuthz must include the ID of the public key that - * can be used to verify them, and that ID must match the contents of this - * field exactly. - * Additional restrictions on this field can be imposed based on which public - * key type is encapsulated. See the documentation on `public_key` cases below - * for details. - * - * Generated from protobuf field string id = 2; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * ASCII-armored representation of a PGP public key, as the entire output by - * the command `gpg --export --armor foo@example.com` (either LF or CRLF - * line endings). - * When using this field, `id` should be left blank. The BinAuthz API - * handlers will calculate the ID and fill it in automatically. BinAuthz - * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as - * upper-case hex. If `id` is provided by the caller, it will be - * overwritten by the API-calculated ID. - * - * Generated from protobuf field string ascii_armored_pgp_public_key = 3; - * @return string - */ - public function getAsciiArmoredPgpPublicKey() - { - return $this->readOneof(3); - } - - public function hasAsciiArmoredPgpPublicKey() - { - return $this->hasOneof(3); - } - - /** - * ASCII-armored representation of a PGP public key, as the entire output by - * the command `gpg --export --armor foo@example.com` (either LF or CRLF - * line endings). - * When using this field, `id` should be left blank. The BinAuthz API - * handlers will calculate the ID and fill it in automatically. BinAuthz - * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as - * upper-case hex. If `id` is provided by the caller, it will be - * overwritten by the API-calculated ID. - * - * Generated from protobuf field string ascii_armored_pgp_public_key = 3; - * @param string $var - * @return $this - */ - public function setAsciiArmoredPgpPublicKey($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * A raw PKIX SubjectPublicKeyInfo format public key. - * NOTE: `id` may be explicitly provided by the caller when using this - * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left - * blank, a default one will be computed based on the digest of the DER - * encoding of the public key. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey|null - */ - public function getPkixPublicKey() - { - return $this->readOneof(5); - } - - public function hasPkixPublicKey() - { - return $this->hasOneof(5); - } - - /** - * A raw PKIX SubjectPublicKeyInfo format public key. - * NOTE: `id` may be explicitly provided by the caller when using this - * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left - * blank, a default one will be computed based on the digest of the DER - * encoding of the public key. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey $var - * @return $this - */ - public function setPkixPublicKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getPublicKey() - { - return $this->whichOneof("public_key"); - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1Client.php b/BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1Client.php deleted file mode 100644 index a3f0ddbd3567..000000000000 --- a/BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1Client.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetPolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a copy of the - * new [policy][google.cloud.binaryauthorization.v1beta1.Policy]. A policy is always updated as a whole, to avoid race - * conditions with concurrent policy enforcement (or management!) - * requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT - * if the request is malformed. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\UpdatePolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdatePolicy(\Google\Cloud\BinaryAuthorization\V1beta1\UpdatePolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdatePolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of the new - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the project does not exist, - * INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\CreateAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateAttestor(\Google\Cloud\BinaryAuthorization\V1beta1\CreateAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/CreateAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\GetAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetAttestor(\Google\Cloud\BinaryAuthorization\V1beta1\GetAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\UpdateAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateAttestor(\Google\Cloud\BinaryAuthorization\V1beta1\UpdateAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdateAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns INVALID_ARGUMENT if the project does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\ListAttestorsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListAttestors(\Google\Cloud\BinaryAuthorization\V1beta1\ListAttestorsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/ListAttestors', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\ListAttestorsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\DeleteAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteAttestor(\Google\Cloud\BinaryAuthorization\V1beta1\DeleteAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/DeleteAttestor', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent.php deleted file mode 100644 index 7361b19f9337..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - */ -class ContinuousValidationEvent extends \Google\Protobuf\Internal\Message -{ - protected $event_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent $pod_event - * Pod event. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ConfigErrorEvent $config_error_event - * Config error event. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * Pod event. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent|null - */ - public function getPodEvent() - { - return $this->readOneof(1); - } - - public function hasPodEvent() - { - return $this->hasOneof(1); - } - - /** - * Pod event. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent $var - * @return $this - */ - public function setPodEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Config error event. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ConfigErrorEvent config_error_event = 4; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ConfigErrorEvent|null - */ - public function getConfigErrorEvent() - { - return $this->readOneof(4); - } - - public function hasConfigErrorEvent() - { - return $this->hasOneof(4); - } - - /** - * Config error event. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ConfigErrorEvent config_error_event = 4; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ConfigErrorEvent $var - * @return $this - */ - public function setConfigErrorEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ConfigErrorEvent::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getEventType() - { - return $this->whichOneof("event_type"); - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ConfigErrorEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ConfigErrorEvent.php deleted file mode 100644 index b66077cf4c6e..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ConfigErrorEvent.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ConfigErrorEvent - */ -class ConfigErrorEvent extends \Google\Protobuf\Internal\Message -{ - /** - * A description of the issue. - * - * Generated from protobuf field string description = 1; - */ - private $description = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $description - * A description of the issue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * A description of the issue. - * - * Generated from protobuf field string description = 1; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * A description of the issue. - * - * Generated from protobuf field string description = 1; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConfigErrorEvent::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ConfigErrorEvent::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent.php deleted file mode 100644 index c052b30161e5..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent.php +++ /dev/null @@ -1,294 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent - */ -class ContinuousValidationPodEvent extends \Google\Protobuf\Internal\Message -{ - /** - * The k8s namespace of the Pod. - * - * Generated from protobuf field string pod_namespace = 7; - */ - private $pod_namespace = ''; - /** - * The name of the Pod. - * - * Generated from protobuf field string pod = 1; - */ - private $pod = ''; - /** - * The name of the policy. - * - * Generated from protobuf field string policy_name = 8; - */ - private $policy_name = ''; - /** - * Deploy time of the Pod from k8s. - * - * Generated from protobuf field .google.protobuf.Timestamp deploy_time = 2; - */ - private $deploy_time = null; - /** - * Termination time of the Pod from k8s, or nothing if still running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - */ - private $end_time = null; - /** - * Auditing verdict for this Pod. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - */ - private $verdict = 0; - /** - * List of images with auditing details. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - */ - private $images; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $pod_namespace - * The k8s namespace of the Pod. - * @type string $pod - * The name of the Pod. - * @type string $policy_name - * The name of the policy. - * @type \Google\Protobuf\Timestamp $deploy_time - * Deploy time of the Pod from k8s. - * @type \Google\Protobuf\Timestamp $end_time - * Termination time of the Pod from k8s, or nothing if still running. - * @type int $verdict - * Auditing verdict for this Pod. - * @type array<\Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails>|\Google\Protobuf\Internal\RepeatedField $images - * List of images with auditing details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * The k8s namespace of the Pod. - * - * Generated from protobuf field string pod_namespace = 7; - * @return string - */ - public function getPodNamespace() - { - return $this->pod_namespace; - } - - /** - * The k8s namespace of the Pod. - * - * Generated from protobuf field string pod_namespace = 7; - * @param string $var - * @return $this - */ - public function setPodNamespace($var) - { - GPBUtil::checkString($var, True); - $this->pod_namespace = $var; - - return $this; - } - - /** - * The name of the Pod. - * - * Generated from protobuf field string pod = 1; - * @return string - */ - public function getPod() - { - return $this->pod; - } - - /** - * The name of the Pod. - * - * Generated from protobuf field string pod = 1; - * @param string $var - * @return $this - */ - public function setPod($var) - { - GPBUtil::checkString($var, True); - $this->pod = $var; - - return $this; - } - - /** - * The name of the policy. - * - * Generated from protobuf field string policy_name = 8; - * @return string - */ - public function getPolicyName() - { - return $this->policy_name; - } - - /** - * The name of the policy. - * - * Generated from protobuf field string policy_name = 8; - * @param string $var - * @return $this - */ - public function setPolicyName($var) - { - GPBUtil::checkString($var, True); - $this->policy_name = $var; - - return $this; - } - - /** - * Deploy time of the Pod from k8s. - * - * Generated from protobuf field .google.protobuf.Timestamp deploy_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeployTime() - { - return $this->deploy_time; - } - - public function hasDeployTime() - { - return isset($this->deploy_time); - } - - public function clearDeployTime() - { - unset($this->deploy_time); - } - - /** - * Deploy time of the Pod from k8s. - * - * Generated from protobuf field .google.protobuf.Timestamp deploy_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeployTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->deploy_time = $var; - - return $this; - } - - /** - * Termination time of the Pod from k8s, or nothing if still running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Termination time of the Pod from k8s, or nothing if still running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Auditing verdict for this Pod. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * @return int - */ - public function getVerdict() - { - return $this->verdict; - } - - /** - * Auditing verdict for this Pod. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * @param int $var - * @return $this - */ - public function setVerdict($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\PolicyConformanceVerdict::class); - $this->verdict = $var; - - return $this; - } - - /** - * List of images with auditing details. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * List of images with auditing details. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails::class); - $this->images = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ContinuousValidationPodEvent::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails.php deleted file mode 100644 index cca70edc106e..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails - */ -class ImageDetails extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the image. - * - * Generated from protobuf field string image = 1; - */ - private $image = ''; - /** - * The name of the container. - * - * Generated from protobuf field string container_name = 5; - */ - private $container_name = ''; - /** - * The container type that this image belongs to. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType container_type = 6; - */ - private $container_type = 0; - /** - * The result of the audit for this image. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - */ - private $result = 0; - /** - * Description of the above result. - * - * Generated from protobuf field string description = 3; - */ - private $description = ''; - /** - * List of check results. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult check_results = 4; - */ - private $check_results; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $image - * The name of the image. - * @type string $container_name - * The name of the container. - * @type int $container_type - * The container type that this image belongs to. - * @type int $result - * The result of the audit for this image. - * @type string $description - * Description of the above result. - * @type array<\Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult>|\Google\Protobuf\Internal\RepeatedField $check_results - * List of check results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * The name of the image. - * - * Generated from protobuf field string image = 1; - * @return string - */ - public function getImage() - { - return $this->image; - } - - /** - * The name of the image. - * - * Generated from protobuf field string image = 1; - * @param string $var - * @return $this - */ - public function setImage($var) - { - GPBUtil::checkString($var, True); - $this->image = $var; - - return $this; - } - - /** - * The name of the container. - * - * Generated from protobuf field string container_name = 5; - * @return string - */ - public function getContainerName() - { - return $this->container_name; - } - - /** - * The name of the container. - * - * Generated from protobuf field string container_name = 5; - * @param string $var - * @return $this - */ - public function setContainerName($var) - { - GPBUtil::checkString($var, True); - $this->container_name = $var; - - return $this; - } - - /** - * The container type that this image belongs to. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType container_type = 6; - * @return int - */ - public function getContainerType() - { - return $this->container_type; - } - - /** - * The container type that this image belongs to. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType container_type = 6; - * @param int $var - * @return $this - */ - public function setContainerType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\ContainerType::class); - $this->container_type = $var; - - return $this; - } - - /** - * The result of the audit for this image. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * @return int - */ - public function getResult() - { - return $this->result; - } - - /** - * The result of the audit for this image. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * @param int $var - * @return $this - */ - public function setResult($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\AuditResult::class); - $this->result = $var; - - return $this; - } - - /** - * Description of the above result. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Description of the above result. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * List of check results. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult check_results = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCheckResults() - { - return $this->check_results; - } - - /** - * List of check results. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult check_results = 4; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCheckResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult::class); - $this->check_results = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ImageDetails::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/AuditResult.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/AuditResult.php deleted file mode 100644 index c87330832026..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/AuditResult.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult - */ -class AuditResult -{ - /** - * Unspecified result. This is an error. - * - * Generated from protobuf enum AUDIT_RESULT_UNSPECIFIED = 0; - */ - const AUDIT_RESULT_UNSPECIFIED = 0; - /** - * Image is allowed. - * - * Generated from protobuf enum ALLOW = 1; - */ - const ALLOW = 1; - /** - * Image is denied. - * - * Generated from protobuf enum DENY = 2; - */ - const DENY = 2; - - private static $valueToName = [ - self::AUDIT_RESULT_UNSPECIFIED => 'AUDIT_RESULT_UNSPECIFIED', - self::ALLOW => 'ALLOW', - self::DENY => 'DENY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AuditResult::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_AuditResult::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult.php deleted file mode 100644 index c57aa6d6f897..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult.php +++ /dev/null @@ -1,316 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult - */ -class CheckResult extends \Google\Protobuf\Internal\Message -{ - /** - * The index of the check set. - * - * Generated from protobuf field string check_set_index = 1; - */ - private $check_set_index = ''; - /** - * The name of the check set. - * - * Generated from protobuf field string check_set_name = 2; - */ - private $check_set_name = ''; - /** - * The scope of the check set. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckSetScope check_set_scope = 3; - */ - private $check_set_scope = null; - /** - * The index of the check. - * - * Generated from protobuf field string check_index = 4; - */ - private $check_index = ''; - /** - * The name of the check. - * - * Generated from protobuf field string check_name = 5; - */ - private $check_name = ''; - /** - * The type of the check. - * - * Generated from protobuf field string check_type = 6; - */ - private $check_type = ''; - /** - * The verdict of this check. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckVerdict verdict = 7; - */ - private $verdict = 0; - /** - * User-friendly explanation of this check result. - * - * Generated from protobuf field string explanation = 8; - */ - private $explanation = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $check_set_index - * The index of the check set. - * @type string $check_set_name - * The name of the check set. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckSetScope $check_set_scope - * The scope of the check set. - * @type string $check_index - * The index of the check. - * @type string $check_name - * The name of the check. - * @type string $check_type - * The type of the check. - * @type int $verdict - * The verdict of this check. - * @type string $explanation - * User-friendly explanation of this check result. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * The index of the check set. - * - * Generated from protobuf field string check_set_index = 1; - * @return string - */ - public function getCheckSetIndex() - { - return $this->check_set_index; - } - - /** - * The index of the check set. - * - * Generated from protobuf field string check_set_index = 1; - * @param string $var - * @return $this - */ - public function setCheckSetIndex($var) - { - GPBUtil::checkString($var, True); - $this->check_set_index = $var; - - return $this; - } - - /** - * The name of the check set. - * - * Generated from protobuf field string check_set_name = 2; - * @return string - */ - public function getCheckSetName() - { - return $this->check_set_name; - } - - /** - * The name of the check set. - * - * Generated from protobuf field string check_set_name = 2; - * @param string $var - * @return $this - */ - public function setCheckSetName($var) - { - GPBUtil::checkString($var, True); - $this->check_set_name = $var; - - return $this; - } - - /** - * The scope of the check set. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckSetScope check_set_scope = 3; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckSetScope|null - */ - public function getCheckSetScope() - { - return $this->check_set_scope; - } - - public function hasCheckSetScope() - { - return isset($this->check_set_scope); - } - - public function clearCheckSetScope() - { - unset($this->check_set_scope); - } - - /** - * The scope of the check set. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckSetScope check_set_scope = 3; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckSetScope $var - * @return $this - */ - public function setCheckSetScope($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckSetScope::class); - $this->check_set_scope = $var; - - return $this; - } - - /** - * The index of the check. - * - * Generated from protobuf field string check_index = 4; - * @return string - */ - public function getCheckIndex() - { - return $this->check_index; - } - - /** - * The index of the check. - * - * Generated from protobuf field string check_index = 4; - * @param string $var - * @return $this - */ - public function setCheckIndex($var) - { - GPBUtil::checkString($var, True); - $this->check_index = $var; - - return $this; - } - - /** - * The name of the check. - * - * Generated from protobuf field string check_name = 5; - * @return string - */ - public function getCheckName() - { - return $this->check_name; - } - - /** - * The name of the check. - * - * Generated from protobuf field string check_name = 5; - * @param string $var - * @return $this - */ - public function setCheckName($var) - { - GPBUtil::checkString($var, True); - $this->check_name = $var; - - return $this; - } - - /** - * The type of the check. - * - * Generated from protobuf field string check_type = 6; - * @return string - */ - public function getCheckType() - { - return $this->check_type; - } - - /** - * The type of the check. - * - * Generated from protobuf field string check_type = 6; - * @param string $var - * @return $this - */ - public function setCheckType($var) - { - GPBUtil::checkString($var, True); - $this->check_type = $var; - - return $this; - } - - /** - * The verdict of this check. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckVerdict verdict = 7; - * @return int - */ - public function getVerdict() - { - return $this->verdict; - } - - /** - * The verdict of this check. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckVerdict verdict = 7; - * @param int $var - * @return $this - */ - public function setVerdict($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckVerdict::class); - $this->verdict = $var; - - return $this; - } - - /** - * User-friendly explanation of this check result. - * - * Generated from protobuf field string explanation = 8; - * @return string - */ - public function getExplanation() - { - return $this->explanation; - } - - /** - * User-friendly explanation of this check result. - * - * Generated from protobuf field string explanation = 8; - * @param string $var - * @return $this - */ - public function setExplanation($var) - { - GPBUtil::checkString($var, True); - $this->explanation = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CheckResult::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_CheckResult::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckSetScope.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckSetScope.php deleted file mode 100644 index abaf652bfbbf..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckSetScope.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckSetScope - */ -class CheckSetScope extends \Google\Protobuf\Internal\Message -{ - protected $scope; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kubernetes_service_account - * Matches a single Kubernetes service account, e.g. - * 'my-namespace:my-service-account'. - * `kubernetes_service_account` scope is always more specific than - * `kubernetes_namespace` scope for the same namespace. - * @type string $kubernetes_namespace - * Matches all Kubernetes service accounts in the provided - * namespace, unless a more specific `kubernetes_service_account` - * scope already matched. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * Matches a single Kubernetes service account, e.g. - * 'my-namespace:my-service-account'. - * `kubernetes_service_account` scope is always more specific than - * `kubernetes_namespace` scope for the same namespace. - * - * Generated from protobuf field string kubernetes_service_account = 1; - * @return string - */ - public function getKubernetesServiceAccount() - { - return $this->readOneof(1); - } - - public function hasKubernetesServiceAccount() - { - return $this->hasOneof(1); - } - - /** - * Matches a single Kubernetes service account, e.g. - * 'my-namespace:my-service-account'. - * `kubernetes_service_account` scope is always more specific than - * `kubernetes_namespace` scope for the same namespace. - * - * Generated from protobuf field string kubernetes_service_account = 1; - * @param string $var - * @return $this - */ - public function setKubernetesServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Matches all Kubernetes service accounts in the provided - * namespace, unless a more specific `kubernetes_service_account` - * scope already matched. - * - * Generated from protobuf field string kubernetes_namespace = 2; - * @return string - */ - public function getKubernetesNamespace() - { - return $this->readOneof(2); - } - - public function hasKubernetesNamespace() - { - return $this->hasOneof(2); - } - - /** - * Matches all Kubernetes service accounts in the provided - * namespace, unless a more specific `kubernetes_service_account` - * scope already matched. - * - * Generated from protobuf field string kubernetes_namespace = 2; - * @param string $var - * @return $this - */ - public function setKubernetesNamespace($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getScope() - { - return $this->whichOneof("scope"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CheckSetScope::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_CheckResult_CheckSetScope::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckVerdict.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckVerdict.php deleted file mode 100644 index d73e2891fac3..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckVerdict.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckVerdict - */ -class CheckVerdict -{ - /** - * We should always have a verdict. This is an error. - * - * Generated from protobuf enum CHECK_VERDICT_UNSPECIFIED = 0; - */ - const CHECK_VERDICT_UNSPECIFIED = 0; - /** - * The check was successfully evaluated and the image did not satisfy - * the check. - * - * Generated from protobuf enum NON_CONFORMANT = 1; - */ - const NON_CONFORMANT = 1; - - private static $valueToName = [ - self::CHECK_VERDICT_UNSPECIFIED => 'CHECK_VERDICT_UNSPECIFIED', - self::NON_CONFORMANT => 'NON_CONFORMANT', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CheckVerdict::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_CheckResult_CheckVerdict::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/ContainerType.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/ContainerType.php deleted file mode 100644 index 09be48268bbd..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/ContainerType.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType - */ -class ContainerType -{ - /** - * The container type should always be specified. This is an error. - * - * Generated from protobuf enum CONTAINER_TYPE_UNSPECIFIED = 0; - */ - const CONTAINER_TYPE_UNSPECIFIED = 0; - /** - * A regular deployment. - * - * Generated from protobuf enum CONTAINER = 1; - */ - const CONTAINER = 1; - /** - * Init container defined as specified at - * https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ - * - * Generated from protobuf enum INIT_CONTAINER = 2; - */ - const INIT_CONTAINER = 2; - /** - * Ephemeral container defined as specified at - * https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/ - * - * Generated from protobuf enum EPHEMERAL_CONTAINER = 3; - */ - const EPHEMERAL_CONTAINER = 3; - - private static $valueToName = [ - self::CONTAINER_TYPE_UNSPECIFIED => 'CONTAINER_TYPE_UNSPECIFIED', - self::CONTAINER => 'CONTAINER', - self::INIT_CONTAINER => 'INIT_CONTAINER', - self::EPHEMERAL_CONTAINER => 'EPHEMERAL_CONTAINER', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ContainerType::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_ContainerType::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/PolicyConformanceVerdict.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/PolicyConformanceVerdict.php deleted file mode 100644 index 9bcad8735d3a..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/PolicyConformanceVerdict.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict - */ -class PolicyConformanceVerdict -{ - /** - * We should always have a verdict. This is an error. - * - * Generated from protobuf enum POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0; - */ - const POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0; - /** - * The pod violates the policy. - * - * Generated from protobuf enum VIOLATES_POLICY = 1; - */ - const VIOLATES_POLICY = 1; - - private static $valueToName = [ - self::POLICY_CONFORMANCE_VERDICT_UNSPECIFIED => 'POLICY_CONFORMANCE_VERDICT_UNSPECIFIED', - self::VIOLATES_POLICY => 'VIOLATES_POLICY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PolicyConformanceVerdict::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_PolicyConformanceVerdict::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/UnsupportedPolicyEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/UnsupportedPolicyEvent.php deleted file mode 100644 index 6db02f08ee10..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/UnsupportedPolicyEvent.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent - */ -class UnsupportedPolicyEvent extends \Google\Protobuf\Internal\Message -{ - /** - * A description of the unsupported policy. - * - * Generated from protobuf field string description = 1; - */ - private $description = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $description - * A description of the unsupported policy. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * A description of the unsupported policy. - * - * Generated from protobuf field string description = 1; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * A description of the unsupported policy. - * - * Generated from protobuf field string description = 1; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UnsupportedPolicyEvent::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_UnsupportedPolicyEvent::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent.php deleted file mode 100644 index 06e14e09573b..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest - */ -class CreateAttestorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * - * Generated from protobuf field string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $attestor_id = ''; - /** - * Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $attestor = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * @type string $attestor_id - * Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\Attestor $attestor - * Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * - * Generated from protobuf field string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getAttestorId() - { - return $this->attestor_id; - } - - /** - * Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * - * Generated from protobuf field string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setAttestorId($var) - { - GPBUtil::checkString($var, True); - $this->attestor_id = $var; - - return $this; - } - - /** - * Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Attestor|null - */ - public function getAttestor() - { - return $this->attestor; - } - - public function hasAttestor() - { - return isset($this->attestor); - } - - public function clearAttestor() - { - unset($this->attestor); - } - - /** - * Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\Attestor $var - * @return $this - */ - public function setAttestor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\Attestor::class); - $this->attestor = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/DeleteAttestorRequest.php b/BinaryAuthorization/src/V1beta1/DeleteAttestorRequest.php deleted file mode 100644 index cbdf6884d271..000000000000 --- a/BinaryAuthorization/src/V1beta1/DeleteAttestorRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest - */ -class DeleteAttestorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/Gapic/BinauthzManagementServiceV1Beta1GapicClient.php b/BinaryAuthorization/src/V1beta1/Gapic/BinauthzManagementServiceV1Beta1GapicClient.php deleted file mode 100644 index 15eac26d62dd..000000000000 --- a/BinaryAuthorization/src/V1beta1/Gapic/BinauthzManagementServiceV1Beta1GapicClient.php +++ /dev/null @@ -1,744 +0,0 @@ -projectName('[PROJECT]'); - * $attestorId = 'attestor_id'; - * $attestor = new Attestor(); - * $response = $binauthzManagementServiceV1Beta1Client->createAttestor($formattedParent, $attestorId, $attestor); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class BinauthzManagementServiceV1Beta1GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'binaryauthorization.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'binaryauthorization.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $attestorNameTemplate; - - private static $locationPolicyNameTemplate; - - private static $policyNameTemplate; - - private static $projectNameTemplate; - - private static $projectPolicyNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/binauthz_management_service_v1_beta1_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/binauthz_management_service_v1_beta1_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/binauthz_management_service_v1_beta1_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/binauthz_management_service_v1_beta1_rest_client_config.php', - ], - ], - ]; - } - - private static function getAttestorNameTemplate() - { - if (self::$attestorNameTemplate == null) { - self::$attestorNameTemplate = new PathTemplate('projects/{project}/attestors/{attestor}'); - } - - return self::$attestorNameTemplate; - } - - private static function getLocationPolicyNameTemplate() - { - if (self::$locationPolicyNameTemplate == null) { - self::$locationPolicyNameTemplate = new PathTemplate('locations/{location}/policy'); - } - - return self::$locationPolicyNameTemplate; - } - - private static function getPolicyNameTemplate() - { - if (self::$policyNameTemplate == null) { - self::$policyNameTemplate = new PathTemplate('projects/{project}/policy'); - } - - return self::$policyNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectPolicyNameTemplate() - { - if (self::$projectPolicyNameTemplate == null) { - self::$projectPolicyNameTemplate = new PathTemplate('projects/{project}/policy'); - } - - return self::$projectPolicyNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'attestor' => self::getAttestorNameTemplate(), - 'locationPolicy' => self::getLocationPolicyNameTemplate(), - 'policy' => self::getPolicyNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectPolicy' => self::getProjectPolicyNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a attestor - * resource. - * - * @param string $project - * @param string $attestor - * - * @return string The formatted attestor resource. - * - * @experimental - */ - public static function attestorName($project, $attestor) - { - return self::getAttestorNameTemplate()->render([ - 'project' => $project, - 'attestor' => $attestor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * location_policy resource. - * - * @param string $location - * - * @return string The formatted location_policy resource. - * - * @experimental - */ - public static function locationPolicyName($location) - { - return self::getLocationPolicyNameTemplate()->render([ - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a policy - * resource. - * - * @param string $project - * - * @return string The formatted policy resource. - * - * @experimental - */ - public static function policyName($project) - { - return self::getPolicyNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - * - * @experimental - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_policy resource. - * - * @param string $project - * - * @return string The formatted project_policy resource. - * - * @experimental - */ - public static function projectPolicyName($project) - { - return self::getProjectPolicyNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - attestor: projects/{project}/attestors/{attestor} - * - locationPolicy: locations/{location}/policy - * - policy: projects/{project}/policy - * - project: projects/{project} - * - projectPolicy: projects/{project}/policy - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'binaryauthorization.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of the new - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the project does not exist, - * INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedParent = $binauthzManagementServiceV1Beta1Client->projectName('[PROJECT]'); - * $attestorId = 'attestor_id'; - * $attestor = new Attestor(); - * $response = $binauthzManagementServiceV1Beta1Client->createAttestor($formattedParent, $attestorId, $attestor); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $parent Required. The parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * @param string $attestorId Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * @param Attestor $attestor Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Attestor - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createAttestor($parent, $attestorId, $attestor, array $optionalArgs = []) - { - $request = new CreateAttestorRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAttestorId($attestorId); - $request->setAttestor($attestor); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateAttestor', Attestor::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedName = $binauthzManagementServiceV1Beta1Client->attestorName('[PROJECT]', '[ATTESTOR]'); - * $binauthzManagementServiceV1Beta1Client->deleteAttestor($formattedName); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $name Required. The name of the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteAttestor($name, array $optionalArgs = []) - { - $request = new DeleteAttestorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteAttestor', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedName = $binauthzManagementServiceV1Beta1Client->attestorName('[PROJECT]', '[ATTESTOR]'); - * $response = $binauthzManagementServiceV1Beta1Client->getAttestor($formattedName); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $name Required. The name of the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Attestor - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getAttestor($name, array $optionalArgs = []) - { - $request = new GetAttestorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetAttestor', Attestor::class, $optionalArgs, $request)->wait(); - } - - /** - * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must attest to - * a container image, before the project is allowed to deploy that - * image. There is at most one policy per project. All image admission - * requests are permitted if a project has no policy. - * - * Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this project. Returns a default - * [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not have one. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedName = $binauthzManagementServiceV1Beta1Client->policyName('[PROJECT]'); - * $response = $binauthzManagementServiceV1Beta1Client->getPolicy($formattedName); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getPolicy($name, array $optionalArgs = []) - { - $request = new GetPolicyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns INVALID_ARGUMENT if the project does not exist. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedParent = $binauthzManagementServiceV1Beta1Client->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $binauthzManagementServiceV1Beta1Client->listAttestors($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $binauthzManagementServiceV1Beta1Client->listAttestors($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listAttestors($parent, array $optionalArgs = []) - { - $request = new ListAttestorsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListAttestors', $optionalArgs, ListAttestorsResponse::class, $request); - } - - /** - * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $attestor = new Attestor(); - * $response = $binauthzManagementServiceV1Beta1Client->updateAttestor($attestor); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param Attestor $attestor Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Attestor - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateAttestor($attestor, array $optionalArgs = []) - { - $request = new UpdateAttestorRequest(); - $requestParamHeaders = []; - $request->setAttestor($attestor); - $requestParamHeaders['attestor.name'] = $attestor->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateAttestor', Attestor::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a copy of the - * new [policy][google.cloud.binaryauthorization.v1beta1.Policy]. A policy is always updated as a whole, to avoid race - * conditions with concurrent policy enforcement (or management!) - * requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT - * if the request is malformed. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $policy = new Policy(); - * $response = $binauthzManagementServiceV1Beta1Client->updatePolicy($policy); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param Policy $policy Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updatePolicy($policy, array $optionalArgs = []) - { - $request = new UpdatePolicyRequest(); - $requestParamHeaders = []; - $request->setPolicy($policy); - $requestParamHeaders['policy.name'] = $policy->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdatePolicy', Policy::class, $optionalArgs, $request)->wait(); - } -} diff --git a/BinaryAuthorization/src/V1beta1/Gapic/SystemPolicyV1Beta1GapicClient.php b/BinaryAuthorization/src/V1beta1/Gapic/SystemPolicyV1Beta1GapicClient.php deleted file mode 100644 index 05e5ee6f3739..000000000000 --- a/BinaryAuthorization/src/V1beta1/Gapic/SystemPolicyV1Beta1GapicClient.php +++ /dev/null @@ -1,360 +0,0 @@ -policyName('[PROJECT]'); - * $response = $systemPolicyV1Beta1Client->getSystemPolicy($formattedName); - * } finally { - * $systemPolicyV1Beta1Client->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class SystemPolicyV1Beta1GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'binaryauthorization.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'binaryauthorization.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationPolicyNameTemplate; - - private static $policyNameTemplate; - - private static $projectPolicyNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/system_policy_v1_beta1_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/system_policy_v1_beta1_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/system_policy_v1_beta1_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/system_policy_v1_beta1_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationPolicyNameTemplate() - { - if (self::$locationPolicyNameTemplate == null) { - self::$locationPolicyNameTemplate = new PathTemplate('locations/{location}/policy'); - } - - return self::$locationPolicyNameTemplate; - } - - private static function getPolicyNameTemplate() - { - if (self::$policyNameTemplate == null) { - self::$policyNameTemplate = new PathTemplate('projects/{project}/policy'); - } - - return self::$policyNameTemplate; - } - - private static function getProjectPolicyNameTemplate() - { - if (self::$projectPolicyNameTemplate == null) { - self::$projectPolicyNameTemplate = new PathTemplate('projects/{project}/policy'); - } - - return self::$projectPolicyNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'locationPolicy' => self::getLocationPolicyNameTemplate(), - 'policy' => self::getPolicyNameTemplate(), - 'projectPolicy' => self::getProjectPolicyNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * location_policy resource. - * - * @param string $location - * - * @return string The formatted location_policy resource. - * - * @experimental - */ - public static function locationPolicyName($location) - { - return self::getLocationPolicyNameTemplate()->render([ - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a policy - * resource. - * - * @param string $project - * - * @return string The formatted policy resource. - * - * @experimental - */ - public static function policyName($project) - { - return self::getPolicyNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_policy resource. - * - * @param string $project - * - * @return string The formatted project_policy resource. - * - * @experimental - */ - public static function projectPolicyName($project) - { - return self::getProjectPolicyNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - locationPolicy: locations/{location}/policy - * - policy: projects/{project}/policy - * - projectPolicy: projects/{project}/policy - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'binaryauthorization.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Gets the current system policy in the specified location. - * - * Sample code: - * ``` - * $systemPolicyV1Beta1Client = new SystemPolicyV1Beta1Client(); - * try { - * $formattedName = $systemPolicyV1Beta1Client->policyName('[PROJECT]'); - * $response = $systemPolicyV1Beta1Client->getSystemPolicy($formattedName); - * } finally { - * $systemPolicyV1Beta1Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getSystemPolicy($name, array $optionalArgs = []) - { - $request = new GetSystemPolicyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetSystemPolicy', Policy::class, $optionalArgs, $request)->wait(); - } -} diff --git a/BinaryAuthorization/src/V1beta1/GetAttestorRequest.php b/BinaryAuthorization/src/V1beta1/GetAttestorRequest.php deleted file mode 100644 index a7c7d02e6983..000000000000 --- a/BinaryAuthorization/src/V1beta1/GetAttestorRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.GetAttestorRequest - */ -class GetAttestorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/GetPolicyRequest.php b/BinaryAuthorization/src/V1beta1/GetPolicyRequest.php deleted file mode 100644 index 8e81f9fc6e62..000000000000 --- a/BinaryAuthorization/src/V1beta1/GetPolicyRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.GetPolicyRequest - */ -class GetPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/GetSystemPolicyRequest.php b/BinaryAuthorization/src/V1beta1/GetSystemPolicyRequest.php deleted file mode 100644 index 66206a20df47..000000000000 --- a/BinaryAuthorization/src/V1beta1/GetSystemPolicyRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest - */ -class GetSystemPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/ListAttestorsRequest.php b/BinaryAuthorization/src/V1beta1/ListAttestorsRequest.php deleted file mode 100644 index 6c475f380eda..000000000000 --- a/BinaryAuthorization/src/V1beta1/ListAttestorsRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest - */ -class ListAttestorsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Requested page size. The server may return fewer results than requested. If - * unspecified, the server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * A token identifying a page of results the server should return. Typically, - * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token] returned - * from the previous call to the `ListAttestors` method. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * @type int $page_size - * Requested page size. The server may return fewer results than requested. If - * unspecified, the server will pick an appropriate default. - * @type string $page_token - * A token identifying a page of results the server should return. Typically, - * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token] returned - * from the previous call to the `ListAttestors` method. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Requested page size. The server may return fewer results than requested. If - * unspecified, the server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Requested page size. The server may return fewer results than requested. If - * unspecified, the server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying a page of results the server should return. Typically, - * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token] returned - * from the previous call to the `ListAttestors` method. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. Typically, - * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token] returned - * from the previous call to the `ListAttestors` method. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/ListAttestorsResponse.php b/BinaryAuthorization/src/V1beta1/ListAttestorsResponse.php deleted file mode 100644 index 0dc1f9f78a01..000000000000 --- a/BinaryAuthorization/src/V1beta1/ListAttestorsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse - */ -class ListAttestorsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - private $attestors; - /** - * A token to retrieve the next page of results. Pass this value in the - * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token] field in the subsequent call to the - * `ListAttestors` method to retrieve the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\BinaryAuthorization\V1beta1\Attestor>|\Google\Protobuf\Internal\RepeatedField $attestors - * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * @type string $next_page_token - * A token to retrieve the next page of results. Pass this value in the - * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token] field in the subsequent call to the - * `ListAttestors` method to retrieve the next page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAttestors() - { - return $this->attestors; - } - - /** - * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\Attestor>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAttestors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\Attestor::class); - $this->attestors = $arr; - - return $this; - } - - /** - * A token to retrieve the next page of results. Pass this value in the - * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token] field in the subsequent call to the - * `ListAttestors` method to retrieve the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve the next page of results. Pass this value in the - * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token] field in the subsequent call to the - * `ListAttestors` method to retrieve the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/PkixPublicKey.php b/BinaryAuthorization/src/V1beta1/PkixPublicKey.php deleted file mode 100644 index b23c4ed1fb7c..000000000000 --- a/BinaryAuthorization/src/V1beta1/PkixPublicKey.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.PkixPublicKey - */ -class PkixPublicKey extends \Google\Protobuf\Internal\Message -{ - /** - * A PEM-encoded public key, as described in - * https://tools.ietf.org/html/rfc7468#section-13 - * - * Generated from protobuf field string public_key_pem = 1; - */ - private $public_key_pem = ''; - /** - * The signature algorithm used to verify a message against a signature using - * this key. - * These signature algorithm must match the structure and any object - * identifiers encoded in `public_key_pem` (i.e. this algorithm must match - * that of the public key). - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - */ - private $signature_algorithm = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $public_key_pem - * A PEM-encoded public key, as described in - * https://tools.ietf.org/html/rfc7468#section-13 - * @type int $signature_algorithm - * The signature algorithm used to verify a message against a signature using - * this key. - * These signature algorithm must match the structure and any object - * identifiers encoded in `public_key_pem` (i.e. this algorithm must match - * that of the public key). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * A PEM-encoded public key, as described in - * https://tools.ietf.org/html/rfc7468#section-13 - * - * Generated from protobuf field string public_key_pem = 1; - * @return string - */ - public function getPublicKeyPem() - { - return $this->public_key_pem; - } - - /** - * A PEM-encoded public key, as described in - * https://tools.ietf.org/html/rfc7468#section-13 - * - * Generated from protobuf field string public_key_pem = 1; - * @param string $var - * @return $this - */ - public function setPublicKeyPem($var) - { - GPBUtil::checkString($var, True); - $this->public_key_pem = $var; - - return $this; - } - - /** - * The signature algorithm used to verify a message against a signature using - * this key. - * These signature algorithm must match the structure and any object - * identifiers encoded in `public_key_pem` (i.e. this algorithm must match - * that of the public key). - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * @return int - */ - public function getSignatureAlgorithm() - { - return $this->signature_algorithm; - } - - /** - * The signature algorithm used to verify a message against a signature using - * this key. - * These signature algorithm must match the structure and any object - * identifiers encoded in `public_key_pem` (i.e. this algorithm must match - * that of the public key). - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * @param int $var - * @return $this - */ - public function setSignatureAlgorithm($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey\SignatureAlgorithm::class); - $this->signature_algorithm = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/PkixPublicKey/SignatureAlgorithm.php b/BinaryAuthorization/src/V1beta1/PkixPublicKey/SignatureAlgorithm.php deleted file mode 100644 index a4456d1db983..000000000000 --- a/BinaryAuthorization/src/V1beta1/PkixPublicKey/SignatureAlgorithm.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm - */ -class SignatureAlgorithm -{ - /** - * Not specified. - * - * Generated from protobuf enum SIGNATURE_ALGORITHM_UNSPECIFIED = 0; - */ - const SIGNATURE_ALGORITHM_UNSPECIFIED = 0; - /** - * RSASSA-PSS 2048 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_PSS_2048_SHA256 = 1; - */ - const RSA_PSS_2048_SHA256 = 1; - /** - * RSASSA-PSS 3072 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_PSS_3072_SHA256 = 2; - */ - const RSA_PSS_3072_SHA256 = 2; - /** - * RSASSA-PSS 4096 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_PSS_4096_SHA256 = 3; - */ - const RSA_PSS_4096_SHA256 = 3; - /** - * RSASSA-PSS 4096 bit key with a SHA512 digest. - * - * Generated from protobuf enum RSA_PSS_4096_SHA512 = 4; - */ - const RSA_PSS_4096_SHA512 = 4; - /** - * RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest. - * - * Generated from protobuf enum RSA_SIGN_PKCS1_2048_SHA256 = 5; - */ - const RSA_SIGN_PKCS1_2048_SHA256 = 5; - /** - * RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest. - * - * Generated from protobuf enum RSA_SIGN_PKCS1_3072_SHA256 = 6; - */ - const RSA_SIGN_PKCS1_3072_SHA256 = 6; - /** - * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest. - * - * Generated from protobuf enum RSA_SIGN_PKCS1_4096_SHA256 = 7; - */ - const RSA_SIGN_PKCS1_4096_SHA256 = 7; - /** - * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest. - * - * Generated from protobuf enum RSA_SIGN_PKCS1_4096_SHA512 = 8; - */ - const RSA_SIGN_PKCS1_4096_SHA512 = 8; - /** - * ECDSA on the NIST P-256 curve with a SHA256 digest. - * - * Generated from protobuf enum ECDSA_P256_SHA256 = 9; - */ - const ECDSA_P256_SHA256 = 9; - /** - * ECDSA on the NIST P-256 curve with a SHA256 digest. - * - * Generated from protobuf enum EC_SIGN_P256_SHA256 = 9; - */ - const EC_SIGN_P256_SHA256 = 9; - /** - * ECDSA on the NIST P-384 curve with a SHA384 digest. - * - * Generated from protobuf enum ECDSA_P384_SHA384 = 10; - */ - const ECDSA_P384_SHA384 = 10; - /** - * ECDSA on the NIST P-384 curve with a SHA384 digest. - * - * Generated from protobuf enum EC_SIGN_P384_SHA384 = 10; - */ - const EC_SIGN_P384_SHA384 = 10; - /** - * ECDSA on the NIST P-521 curve with a SHA512 digest. - * - * Generated from protobuf enum ECDSA_P521_SHA512 = 11; - */ - const ECDSA_P521_SHA512 = 11; - /** - * ECDSA on the NIST P-521 curve with a SHA512 digest. - * - * Generated from protobuf enum EC_SIGN_P521_SHA512 = 11; - */ - const EC_SIGN_P521_SHA512 = 11; - - private static $valueToName = [ - self::SIGNATURE_ALGORITHM_UNSPECIFIED => 'SIGNATURE_ALGORITHM_UNSPECIFIED', - self::RSA_PSS_2048_SHA256 => 'RSA_PSS_2048_SHA256', - self::RSA_PSS_3072_SHA256 => 'RSA_PSS_3072_SHA256', - self::RSA_PSS_4096_SHA256 => 'RSA_PSS_4096_SHA256', - self::RSA_PSS_4096_SHA512 => 'RSA_PSS_4096_SHA512', - self::RSA_SIGN_PKCS1_2048_SHA256 => 'RSA_SIGN_PKCS1_2048_SHA256', - self::RSA_SIGN_PKCS1_3072_SHA256 => 'RSA_SIGN_PKCS1_3072_SHA256', - self::RSA_SIGN_PKCS1_4096_SHA256 => 'RSA_SIGN_PKCS1_4096_SHA256', - self::RSA_SIGN_PKCS1_4096_SHA512 => 'RSA_SIGN_PKCS1_4096_SHA512', - self::ECDSA_P256_SHA256 => 'ECDSA_P256_SHA256', - self::EC_SIGN_P256_SHA256 => 'EC_SIGN_P256_SHA256', - self::ECDSA_P384_SHA384 => 'ECDSA_P384_SHA384', - self::EC_SIGN_P384_SHA384 => 'EC_SIGN_P384_SHA384', - self::ECDSA_P521_SHA512 => 'ECDSA_P521_SHA512', - self::EC_SIGN_P521_SHA512 => 'EC_SIGN_P521_SHA512', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SignatureAlgorithm::class, \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey_SignatureAlgorithm::class); - diff --git a/BinaryAuthorization/src/V1beta1/PkixPublicKey_SignatureAlgorithm.php b/BinaryAuthorization/src/V1beta1/PkixPublicKey_SignatureAlgorithm.php deleted file mode 100644 index 641df7f153d9..000000000000 --- a/BinaryAuthorization/src/V1beta1/PkixPublicKey_SignatureAlgorithm.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.Policy - */ -class Policy extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name, in the format `projects/*/policy`. There is - * at most one policy per project. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Optional. A descriptive comment. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $description = ''; - /** - * Optional. Controls the evaluation of a Google-maintained global admission - * policy for common system-level images. Images not covered by the global - * policy will be subject to the project admission policy. This setting - * has no effect when specified inside a global admission policy. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $global_policy_evaluation_mode = 0; - /** - * Optional. Admission policy allowlisting. A matching admission request will - * always be permitted. This feature is typically used to exclude Google or - * third-party infrastructure images from Binary Authorization policies. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $admission_whitelist_patterns; - /** - * Optional. Per-cluster admission rules. Cluster spec format: - * `location.clusterId`. There can be at most one admission rule per cluster - * spec. - * A `location` is either a compute zone (e.g. us-central1-a) or a region - * (e.g. us-central1). - * For `clusterId` syntax restrictions see - * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters. - * - * Generated from protobuf field map cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $cluster_admission_rules; - /** - * Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: - * `[a-z.-]+`, e.g. `some-namespace` - * - * Generated from protobuf field map kubernetes_namespace_admission_rules = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $kubernetes_namespace_admission_rules; - /** - * Optional. Per-kubernetes-service-account admission rules. Service account - * spec format: `namespace:serviceaccount`. e.g. `test-ns:default` - * - * Generated from protobuf field map kubernetes_service_account_admission_rules = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $kubernetes_service_account_admission_rules; - /** - * Optional. Per-istio-service-identity admission rules. Istio service - * identity spec format: - * `spiffe:///ns//sa/` or - * `/ns//sa/` - * e.g. `spiffe://example.com/ns/test-ns/sa/default` - * - * Generated from protobuf field map istio_service_identity_admission_rules = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $istio_service_identity_admission_rules; - /** - * Required. Default admission rule for a cluster without a per-cluster, per- - * kubernetes-service-account, or per-istio-service-identity admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $default_admission_rule = null; - /** - * Output only. Time when the policy was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name, in the format `projects/*/policy`. There is - * at most one policy per project. - * @type string $description - * Optional. A descriptive comment. - * @type int $global_policy_evaluation_mode - * Optional. Controls the evaluation of a Google-maintained global admission - * policy for common system-level images. Images not covered by the global - * policy will be subject to the project admission policy. This setting - * has no effect when specified inside a global admission policy. - * @type array<\Google\Cloud\BinaryAuthorization\V1beta1\AdmissionWhitelistPattern>|\Google\Protobuf\Internal\RepeatedField $admission_whitelist_patterns - * Optional. Admission policy allowlisting. A matching admission request will - * always be permitted. This feature is typically used to exclude Google or - * third-party infrastructure images from Binary Authorization policies. - * @type array|\Google\Protobuf\Internal\MapField $cluster_admission_rules - * Optional. Per-cluster admission rules. Cluster spec format: - * `location.clusterId`. There can be at most one admission rule per cluster - * spec. - * A `location` is either a compute zone (e.g. us-central1-a) or a region - * (e.g. us-central1). - * For `clusterId` syntax restrictions see - * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters. - * @type array|\Google\Protobuf\Internal\MapField $kubernetes_namespace_admission_rules - * Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: - * `[a-z.-]+`, e.g. `some-namespace` - * @type array|\Google\Protobuf\Internal\MapField $kubernetes_service_account_admission_rules - * Optional. Per-kubernetes-service-account admission rules. Service account - * spec format: `namespace:serviceaccount`. e.g. `test-ns:default` - * @type array|\Google\Protobuf\Internal\MapField $istio_service_identity_admission_rules - * Optional. Per-istio-service-identity admission rules. Istio service - * identity spec format: - * `spiffe:///ns//sa/` or - * `/ns//sa/` - * e.g. `spiffe://example.com/ns/test-ns/sa/default` - * @type \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule $default_admission_rule - * Required. Default admission rule for a cluster without a per-cluster, per- - * kubernetes-service-account, or per-istio-service-identity admission rule. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Time when the policy was last updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name, in the format `projects/*/policy`. There is - * at most one policy per project. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name, in the format `projects/*/policy`. There is - * at most one policy per project. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A descriptive comment. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. A descriptive comment. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Optional. Controls the evaluation of a Google-maintained global admission - * policy for common system-level images. Images not covered by the global - * policy will be subject to the project admission policy. This setting - * has no effect when specified inside a global admission policy. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getGlobalPolicyEvaluationMode() - { - return $this->global_policy_evaluation_mode; - } - - /** - * Optional. Controls the evaluation of a Google-maintained global admission - * policy for common system-level images. Images not covered by the global - * policy will be subject to the project admission policy. This setting - * has no effect when specified inside a global admission policy. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setGlobalPolicyEvaluationMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\Policy\GlobalPolicyEvaluationMode::class); - $this->global_policy_evaluation_mode = $var; - - return $this; - } - - /** - * Optional. Admission policy allowlisting. A matching admission request will - * always be permitted. This feature is typically used to exclude Google or - * third-party infrastructure images from Binary Authorization policies. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAdmissionWhitelistPatterns() - { - return $this->admission_whitelist_patterns; - } - - /** - * Optional. Admission policy allowlisting. A matching admission request will - * always be permitted. This feature is typically used to exclude Google or - * third-party infrastructure images from Binary Authorization policies. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\AdmissionWhitelistPattern>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAdmissionWhitelistPatterns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionWhitelistPattern::class); - $this->admission_whitelist_patterns = $arr; - - return $this; - } - - /** - * Optional. Per-cluster admission rules. Cluster spec format: - * `location.clusterId`. There can be at most one admission rule per cluster - * spec. - * A `location` is either a compute zone (e.g. us-central1-a) or a region - * (e.g. us-central1). - * For `clusterId` syntax restrictions see - * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters. - * - * Generated from protobuf field map cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getClusterAdmissionRules() - { - return $this->cluster_admission_rules; - } - - /** - * Optional. Per-cluster admission rules. Cluster spec format: - * `location.clusterId`. There can be at most one admission rule per cluster - * spec. - * A `location` is either a compute zone (e.g. us-central1-a) or a region - * (e.g. us-central1). - * For `clusterId` syntax restrictions see - * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters. - * - * Generated from protobuf field map cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setClusterAdmissionRules($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->cluster_admission_rules = $arr; - - return $this; - } - - /** - * Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: - * `[a-z.-]+`, e.g. `some-namespace` - * - * Generated from protobuf field map kubernetes_namespace_admission_rules = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getKubernetesNamespaceAdmissionRules() - { - return $this->kubernetes_namespace_admission_rules; - } - - /** - * Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: - * `[a-z.-]+`, e.g. `some-namespace` - * - * Generated from protobuf field map kubernetes_namespace_admission_rules = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setKubernetesNamespaceAdmissionRules($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->kubernetes_namespace_admission_rules = $arr; - - return $this; - } - - /** - * Optional. Per-kubernetes-service-account admission rules. Service account - * spec format: `namespace:serviceaccount`. e.g. `test-ns:default` - * - * Generated from protobuf field map kubernetes_service_account_admission_rules = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getKubernetesServiceAccountAdmissionRules() - { - return $this->kubernetes_service_account_admission_rules; - } - - /** - * Optional. Per-kubernetes-service-account admission rules. Service account - * spec format: `namespace:serviceaccount`. e.g. `test-ns:default` - * - * Generated from protobuf field map kubernetes_service_account_admission_rules = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setKubernetesServiceAccountAdmissionRules($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->kubernetes_service_account_admission_rules = $arr; - - return $this; - } - - /** - * Optional. Per-istio-service-identity admission rules. Istio service - * identity spec format: - * `spiffe:///ns//sa/` or - * `/ns//sa/` - * e.g. `spiffe://example.com/ns/test-ns/sa/default` - * - * Generated from protobuf field map istio_service_identity_admission_rules = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getIstioServiceIdentityAdmissionRules() - { - return $this->istio_service_identity_admission_rules; - } - - /** - * Optional. Per-istio-service-identity admission rules. Istio service - * identity spec format: - * `spiffe:///ns//sa/` or - * `/ns//sa/` - * e.g. `spiffe://example.com/ns/test-ns/sa/default` - * - * Generated from protobuf field map istio_service_identity_admission_rules = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setIstioServiceIdentityAdmissionRules($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->istio_service_identity_admission_rules = $arr; - - return $this; - } - - /** - * Required. Default admission rule for a cluster without a per-cluster, per- - * kubernetes-service-account, or per-istio-service-identity admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule|null - */ - public function getDefaultAdmissionRule() - { - return $this->default_admission_rule; - } - - public function hasDefaultAdmissionRule() - { - return isset($this->default_admission_rule); - } - - public function clearDefaultAdmissionRule() - { - unset($this->default_admission_rule); - } - - /** - * Required. Default admission rule for a cluster without a per-cluster, per- - * kubernetes-service-account, or per-istio-service-identity admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule $var - * @return $this - */ - public function setDefaultAdmissionRule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->default_admission_rule = $var; - - return $this; - } - - /** - * Output only. Time when the policy was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. Time when the policy was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/Policy/GlobalPolicyEvaluationMode.php b/BinaryAuthorization/src/V1beta1/Policy/GlobalPolicyEvaluationMode.php deleted file mode 100644 index 6ac8131c3b64..000000000000 --- a/BinaryAuthorization/src/V1beta1/Policy/GlobalPolicyEvaluationMode.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode - */ -class GlobalPolicyEvaluationMode -{ - /** - * Not specified: DISABLE is assumed. - * - * Generated from protobuf enum GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED = 0; - */ - const GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED = 0; - /** - * Enables system policy evaluation. - * - * Generated from protobuf enum ENABLE = 1; - */ - const ENABLE = 1; - /** - * Disables system policy evaluation. - * - * Generated from protobuf enum DISABLE = 2; - */ - const DISABLE = 2; - - private static $valueToName = [ - self::GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED => 'GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED', - self::ENABLE => 'ENABLE', - self::DISABLE => 'DISABLE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GlobalPolicyEvaluationMode::class, \Google\Cloud\BinaryAuthorization\V1beta1\Policy_GlobalPolicyEvaluationMode::class); - diff --git a/BinaryAuthorization/src/V1beta1/Policy_GlobalPolicyEvaluationMode.php b/BinaryAuthorization/src/V1beta1/Policy_GlobalPolicyEvaluationMode.php deleted file mode 100644 index 78e55714bf13..000000000000 --- a/BinaryAuthorization/src/V1beta1/Policy_GlobalPolicyEvaluationMode.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1/GetSystemPolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Policy', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1beta1/UpdateAttestorRequest.php b/BinaryAuthorization/src/V1beta1/UpdateAttestorRequest.php deleted file mode 100644 index 4de3e647283a..000000000000 --- a/BinaryAuthorization/src/V1beta1/UpdateAttestorRequest.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest - */ -class UpdateAttestorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $attestor = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\BinaryAuthorization\V1beta1\Attestor $attestor - * Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Attestor|null - */ - public function getAttestor() - { - return $this->attestor; - } - - public function hasAttestor() - { - return isset($this->attestor); - } - - public function clearAttestor() - { - unset($this->attestor); - } - - /** - * Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\Attestor $var - * @return $this - */ - public function setAttestor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\Attestor::class); - $this->attestor = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/UpdatePolicyRequest.php b/BinaryAuthorization/src/V1beta1/UpdatePolicyRequest.php deleted file mode 100644 index 9a9104fe02c9..000000000000 --- a/BinaryAuthorization/src/V1beta1/UpdatePolicyRequest.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest - */ -class UpdatePolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $policy = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\BinaryAuthorization\V1beta1\Policy $policy - * Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Policy|null - */ - public function getPolicy() - { - return $this->policy; - } - - public function hasPolicy() - { - return isset($this->policy); - } - - public function clearPolicy() - { - unset($this->policy); - } - - /** - * Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\Policy $var - * @return $this - */ - public function setPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\Policy::class); - $this->policy = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/UserOwnedDrydockNote.php b/BinaryAuthorization/src/V1beta1/UserOwnedDrydockNote.php deleted file mode 100644 index 301f786bba07..000000000000 --- a/BinaryAuthorization/src/V1beta1/UserOwnedDrydockNote.php +++ /dev/null @@ -1,208 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - */ -class UserOwnedDrydockNote extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note, - * created by the user, in the format: `projects/*/notes/*` (or the legacy - * `providers/*/notes/*`). This field may not be updated. - * An attestation by this attestor is stored as a Drydock - * ATTESTATION_AUTHORITY Occurrence that names a container image and that - * links to this Note. Drydock is an external dependency. - * - * Generated from protobuf field string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $note_reference = ''; - /** - * Optional. Public keys that verify attestations signed by this - * attestor. This field may be updated. - * If this field is non-empty, one of the specified public keys must - * verify that an attestation was signed by this attestor for the - * image specified in the admission request. - * If this field is empty, this attestor always returns that no - * valid attestations exist. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $public_keys; - /** - * Output only. This field will contain the service account email address - * that this Attestor will use as the principal when querying Container - * Analysis. Attestor administrators must grant this service account the - * IAM role needed to read attestations from the [note_reference][Note] in - * Container Analysis (`containeranalysis.notes.occurrences.viewer`). - * This email address is fixed for the lifetime of the Attestor, but callers - * should not make any other assumptions about the service account email; - * future versions may use an email based on a different naming pattern. - * - * Generated from protobuf field string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $delegation_service_account_email = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $note_reference - * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note, - * created by the user, in the format: `projects/*/notes/*` (or the legacy - * `providers/*/notes/*`). This field may not be updated. - * An attestation by this attestor is stored as a Drydock - * ATTESTATION_AUTHORITY Occurrence that names a container image and that - * links to this Note. Drydock is an external dependency. - * @type array<\Google\Cloud\BinaryAuthorization\V1beta1\AttestorPublicKey>|\Google\Protobuf\Internal\RepeatedField $public_keys - * Optional. Public keys that verify attestations signed by this - * attestor. This field may be updated. - * If this field is non-empty, one of the specified public keys must - * verify that an attestation was signed by this attestor for the - * image specified in the admission request. - * If this field is empty, this attestor always returns that no - * valid attestations exist. - * @type string $delegation_service_account_email - * Output only. This field will contain the service account email address - * that this Attestor will use as the principal when querying Container - * Analysis. Attestor administrators must grant this service account the - * IAM role needed to read attestations from the [note_reference][Note] in - * Container Analysis (`containeranalysis.notes.occurrences.viewer`). - * This email address is fixed for the lifetime of the Attestor, but callers - * should not make any other assumptions about the service account email; - * future versions may use an email based on a different naming pattern. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note, - * created by the user, in the format: `projects/*/notes/*` (or the legacy - * `providers/*/notes/*`). This field may not be updated. - * An attestation by this attestor is stored as a Drydock - * ATTESTATION_AUTHORITY Occurrence that names a container image and that - * links to this Note. Drydock is an external dependency. - * - * Generated from protobuf field string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getNoteReference() - { - return $this->note_reference; - } - - /** - * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note, - * created by the user, in the format: `projects/*/notes/*` (or the legacy - * `providers/*/notes/*`). This field may not be updated. - * An attestation by this attestor is stored as a Drydock - * ATTESTATION_AUTHORITY Occurrence that names a container image and that - * links to this Note. Drydock is an external dependency. - * - * Generated from protobuf field string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setNoteReference($var) - { - GPBUtil::checkString($var, True); - $this->note_reference = $var; - - return $this; - } - - /** - * Optional. Public keys that verify attestations signed by this - * attestor. This field may be updated. - * If this field is non-empty, one of the specified public keys must - * verify that an attestation was signed by this attestor for the - * image specified in the admission request. - * If this field is empty, this attestor always returns that no - * valid attestations exist. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPublicKeys() - { - return $this->public_keys; - } - - /** - * Optional. Public keys that verify attestations signed by this - * attestor. This field may be updated. - * If this field is non-empty, one of the specified public keys must - * verify that an attestation was signed by this attestor for the - * image specified in the admission request. - * If this field is empty, this attestor always returns that no - * valid attestations exist. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\AttestorPublicKey>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPublicKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AttestorPublicKey::class); - $this->public_keys = $arr; - - return $this; - } - - /** - * Output only. This field will contain the service account email address - * that this Attestor will use as the principal when querying Container - * Analysis. Attestor administrators must grant this service account the - * IAM role needed to read attestations from the [note_reference][Note] in - * Container Analysis (`containeranalysis.notes.occurrences.viewer`). - * This email address is fixed for the lifetime of the Attestor, but callers - * should not make any other assumptions about the service account email; - * future versions may use an email based on a different naming pattern. - * - * Generated from protobuf field string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDelegationServiceAccountEmail() - { - return $this->delegation_service_account_email; - } - - /** - * Output only. This field will contain the service account email address - * that this Attestor will use as the principal when querying Container - * Analysis. Attestor administrators must grant this service account the - * IAM role needed to read attestations from the [note_reference][Note] in - * Container Analysis (`containeranalysis.notes.occurrences.viewer`). - * This email address is fixed for the lifetime of the Attestor, but callers - * should not make any other assumptions about the service account email; - * future versions may use an email based on a different naming pattern. - * - * Generated from protobuf field string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDelegationServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->delegation_service_account_email = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/gapic_metadata.json b/BinaryAuthorization/src/V1beta1/gapic_metadata.json deleted file mode 100644 index 5d3b03e24f02..000000000000 --- a/BinaryAuthorization/src/V1beta1/gapic_metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.binaryauthorization.v1beta1", - "libraryPackage": "Google\\Cloud\\BinaryAuthorization\\V1beta1", - "services": { - "BinauthzManagementServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "BinauthzManagementServiceV1Beta1GapicClient", - "rpcs": { - "CreateAttestor": { - "methods": [ - "createAttestor" - ] - }, - "DeleteAttestor": { - "methods": [ - "deleteAttestor" - ] - }, - "GetAttestor": { - "methods": [ - "getAttestor" - ] - }, - "GetPolicy": { - "methods": [ - "getPolicy" - ] - }, - "ListAttestors": { - "methods": [ - "listAttestors" - ] - }, - "UpdateAttestor": { - "methods": [ - "updateAttestor" - ] - }, - "UpdatePolicy": { - "methods": [ - "updatePolicy" - ] - } - } - } - } - }, - "SystemPolicyV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "SystemPolicyV1Beta1GapicClient", - "rpcs": { - "GetSystemPolicy": { - "methods": [ - "getSystemPolicy" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_client_config.json b/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_client_config.json deleted file mode 100644 index 1b94a90e3501..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_client_config.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "interfaces": { - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateAttestor": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteAttestor": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetAttestor": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetPolicy": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListAttestors": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateAttestor": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdatePolicy": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_descriptor_config.php b/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_descriptor_config.php deleted file mode 100644 index 3243955d9de4..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_descriptor_config.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1' => [ - 'ListAttestors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getAttestors', - ], - ], - ], - ], -]; diff --git a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_rest_client_config.php b/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_rest_client_config.php deleted file mode 100644 index 58ec7a48b19d..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_rest_client_config.php +++ /dev/null @@ -1,171 +0,0 @@ - [ - 'google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1' => [ - 'CreateAttestor' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*}/attestors', - 'body' => 'attestor', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'attestor_id', - ], - ], - 'DeleteAttestor' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/attestors/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetAttestor' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/attestors/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/policy}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListAttestors' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*}/attestors', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateAttestor' => [ - 'method' => 'put', - 'uriTemplate' => '/v1beta1/{attestor.name=projects/*/attestors/*}', - 'body' => 'attestor', - 'placeholders' => [ - 'attestor.name' => [ - 'getters' => [ - 'getAttestor', - 'getName', - ], - ], - ], - ], - 'UpdatePolicy' => [ - 'method' => 'put', - 'uriTemplate' => '/v1beta1/{policy.name=projects/*/policy}', - 'body' => 'policy', - 'placeholders' => [ - 'policy.name' => [ - 'getters' => [ - 'getPolicy', - 'getName', - ], - ], - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_client_config.json b/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_client_config.json deleted file mode 100644 index 6be9cf016171..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_client_config.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "interfaces": { - "google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1": { - "retry_codes": { - "no_retry_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - } - }, - "methods": { - "GetSystemPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_descriptor_config.php b/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_descriptor_config.php deleted file mode 100644 index 8bcc1b01afcb..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_descriptor_config.php +++ /dev/null @@ -1,27 +0,0 @@ - [ - 'google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1' => [], - ], -]; diff --git a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_rest_client_config.php b/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_rest_client_config.php deleted file mode 100644 index 644b70f64222..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_rest_client_config.php +++ /dev/null @@ -1,97 +0,0 @@ - [ - 'google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1' => [ - 'GetSystemPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=locations/*/policy}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/BinaryAuthorization/tests/Unit/V1/Client/BinauthzManagementServiceV1ClientTest.php b/BinaryAuthorization/tests/Unit/V1/Client/BinauthzManagementServiceV1ClientTest.php index a6db174eb6b9..d01a40d7f08b 100644 --- a/BinaryAuthorization/tests/Unit/V1/Client/BinauthzManagementServiceV1ClientTest.php +++ b/BinaryAuthorization/tests/Unit/V1/Client/BinauthzManagementServiceV1ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return BinauthzManagementServiceV1Client */ @@ -103,7 +105,10 @@ public function createAttestorTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getAttestorId(); @@ -124,12 +129,15 @@ public function createAttestorExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); @@ -167,14 +175,16 @@ public function deleteAttestorTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $request = (new DeleteAttestorRequest()) - ->setName($formattedName); + $request = (new DeleteAttestorRequest())->setName($formattedName); $gapicClient->deleteAttestor($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/DeleteAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/DeleteAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -191,17 +201,19 @@ public function deleteAttestorExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $request = (new DeleteAttestorRequest()) - ->setName($formattedName); + $request = (new DeleteAttestorRequest())->setName($formattedName); try { $gapicClient->deleteAttestor($request); // If the $gapicClient method call did not throw, fail the test @@ -232,15 +244,17 @@ public function getAttestorTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $request = (new GetAttestorRequest()) - ->setName($formattedName); + $request = (new GetAttestorRequest())->setName($formattedName); $response = $gapicClient->getAttestor($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -257,17 +271,19 @@ public function getAttestorExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $request = (new GetAttestorRequest()) - ->setName($formattedName); + $request = (new GetAttestorRequest())->setName($formattedName); try { $gapicClient->getAttestor($request); // If the $gapicClient method call did not throw, fail the test @@ -298,15 +314,17 @@ public function getPolicyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]'); - $request = (new GetPolicyRequest()) - ->setName($formattedName); + $request = (new GetPolicyRequest())->setName($formattedName); $response = $gapicClient->getPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetPolicy', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetPolicy', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -323,17 +341,19 @@ public function getPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]'); - $request = (new GetPolicyRequest()) - ->setName($formattedName); + $request = (new GetPolicyRequest())->setName($formattedName); try { $gapicClient->getPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -358,17 +378,14 @@ public function listAttestorsTest() // Mock response $nextPageToken = ''; $attestorsElement = new Attestor(); - $attestors = [ - $attestorsElement, - ]; + $attestors = [$attestorsElement]; $expectedResponse = new ListAttestorsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAttestors($attestors); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListAttestorsRequest()) - ->setParent($formattedParent); + $request = (new ListAttestorsRequest())->setParent($formattedParent); $response = $gapicClient->listAttestors($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -378,7 +395,10 @@ public function listAttestorsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/ListAttestors', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/ListAttestors', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -395,17 +415,19 @@ public function listAttestorsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListAttestorsRequest()) - ->setParent($formattedParent); + $request = (new ListAttestorsRequest())->setParent($formattedParent); try { $gapicClient->listAttestors($request); // If the $gapicClient method call did not throw, fail the test @@ -438,15 +460,17 @@ public function updateAttestorTest() $attestor = new Attestor(); $attestorName = 'attestorName-125367661'; $attestor->setName($attestorName); - $request = (new UpdateAttestorRequest()) - ->setAttestor($attestor); + $request = (new UpdateAttestorRequest())->setAttestor($attestor); $response = $gapicClient->updateAttestor($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdateAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdateAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getAttestor(); $this->assertProtobufEquals($attestor, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -463,19 +487,21 @@ public function updateAttestorExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $attestor = new Attestor(); $attestorName = 'attestorName-125367661'; $attestor->setName($attestorName); - $request = (new UpdateAttestorRequest()) - ->setAttestor($attestor); + $request = (new UpdateAttestorRequest())->setAttestor($attestor); try { $gapicClient->updateAttestor($request); // If the $gapicClient method call did not throw, fail the test @@ -512,15 +538,17 @@ public function updatePolicyTest() $defaultAdmissionRuleEnforcementMode = EnforcementMode::ENFORCEMENT_MODE_UNSPECIFIED; $policyDefaultAdmissionRule->setEnforcementMode($defaultAdmissionRuleEnforcementMode); $policy->setDefaultAdmissionRule($policyDefaultAdmissionRule); - $request = (new UpdatePolicyRequest()) - ->setPolicy($policy); + $request = (new UpdatePolicyRequest())->setPolicy($policy); $response = $gapicClient->updatePolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdatePolicy', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdatePolicy', + $actualFuncCall + ); $actualValue = $actualRequestObject->getPolicy(); $this->assertProtobufEquals($policy, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -537,12 +565,15 @@ public function updatePolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $policy = new Policy(); @@ -552,8 +583,7 @@ public function updatePolicyExceptionTest() $defaultAdmissionRuleEnforcementMode = EnforcementMode::ENFORCEMENT_MODE_UNSPECIFIED; $policyDefaultAdmissionRule->setEnforcementMode($defaultAdmissionRuleEnforcementMode); $policy->setDefaultAdmissionRule($policyDefaultAdmissionRule); - $request = (new UpdatePolicyRequest()) - ->setPolicy($policy); + $request = (new UpdatePolicyRequest())->setPolicy($policy); try { $gapicClient->updatePolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -598,7 +628,10 @@ public function createAttestorAsyncTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getAttestorId(); diff --git a/BinaryAuthorization/tests/Unit/V1/Client/SystemPolicyV1ClientTest.php b/BinaryAuthorization/tests/Unit/V1/Client/SystemPolicyV1ClientTest.php index 49dbadcfc2f2..b1a97bf31a6d 100644 --- a/BinaryAuthorization/tests/Unit/V1/Client/SystemPolicyV1ClientTest.php +++ b/BinaryAuthorization/tests/Unit/V1/Client/SystemPolicyV1ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return SystemPolicyV1Client */ @@ -77,8 +79,7 @@ public function getSystemPolicyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]'); - $request = (new GetSystemPolicyRequest()) - ->setName($formattedName); + $request = (new GetSystemPolicyRequest())->setName($formattedName); $response = $gapicClient->getSystemPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -102,17 +103,19 @@ public function getSystemPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]'); - $request = (new GetSystemPolicyRequest()) - ->setName($formattedName); + $request = (new GetSystemPolicyRequest())->setName($formattedName); try { $gapicClient->getSystemPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -143,8 +146,7 @@ public function getSystemPolicyAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]'); - $request = (new GetSystemPolicyRequest()) - ->setName($formattedName); + $request = (new GetSystemPolicyRequest())->setName($formattedName); $response = $gapicClient->getSystemPolicyAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/BinaryAuthorization/tests/Unit/V1/Client/ValidationHelperV1ClientTest.php b/BinaryAuthorization/tests/Unit/V1/Client/ValidationHelperV1ClientTest.php index ecc74efa7cad..fbe61fc1ebc9 100644 --- a/BinaryAuthorization/tests/Unit/V1/Client/ValidationHelperV1ClientTest.php +++ b/BinaryAuthorization/tests/Unit/V1/Client/ValidationHelperV1ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ValidationHelperV1Client */ @@ -90,7 +92,10 @@ public function validateAttestationOccurrenceTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', + $actualFuncCall + ); $actualValue = $actualRequestObject->getAttestor(); $this->assertProtobufEquals($attestor, $actualValue); $actualValue = $actualRequestObject->getAttestation(); @@ -113,12 +118,15 @@ public function validateAttestationOccurrenceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $attestor = 'attestor542920680'; @@ -172,7 +180,10 @@ public function validateAttestationOccurrenceAsyncTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', + $actualFuncCall + ); $actualValue = $actualRequestObject->getAttestor(); $this->assertProtobufEquals($attestor, $actualValue); $actualValue = $actualRequestObject->getAttestation(); diff --git a/BinaryAuthorization/tests/Unit/V1beta1/BinauthzManagementServiceV1Beta1ClientTest.php b/BinaryAuthorization/tests/Unit/V1beta1/BinauthzManagementServiceV1Beta1ClientTest.php deleted file mode 100644 index 5e9ce17ffd76..000000000000 --- a/BinaryAuthorization/tests/Unit/V1beta1/BinauthzManagementServiceV1Beta1ClientTest.php +++ /dev/null @@ -1,530 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return BinauthzManagementServiceV1Beta1Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new BinauthzManagementServiceV1Beta1Client($options); - } - - /** @test */ - public function createAttestorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Attestor(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $attestorId = 'attestorId-696764206'; - $attestor = new Attestor(); - $attestorName = 'attestorName-125367661'; - $attestor->setName($attestorName); - $response = $gapicClient->createAttestor($formattedParent, $attestorId, $attestor); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/CreateAttestor', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getAttestorId(); - $this->assertProtobufEquals($attestorId, $actualValue); - $actualValue = $actualRequestObject->getAttestor(); - $this->assertProtobufEquals($attestor, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createAttestorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $attestorId = 'attestorId-696764206'; - $attestor = new Attestor(); - $attestorName = 'attestorName-125367661'; - $attestor->setName($attestorName); - try { - $gapicClient->createAttestor($formattedParent, $attestorId, $attestor); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteAttestorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $gapicClient->deleteAttestor($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/DeleteAttestor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteAttestorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - try { - $gapicClient->deleteAttestor($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAttestorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Attestor(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $response = $gapicClient->getAttestor($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetAttestor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAttestorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - try { - $gapicClient->getAttestor($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]'); - $response = $gapicClient->getPolicy($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]'); - try { - $gapicClient->getPolicy($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAttestorsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $attestorsElement = new Attestor(); - $attestors = [ - $attestorsElement, - ]; - $expectedResponse = new ListAttestorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAttestors($attestors); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listAttestors($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAttestors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/ListAttestors', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAttestorsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listAttestors($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateAttestorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Attestor(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $attestor = new Attestor(); - $attestorName = 'attestorName-125367661'; - $attestor->setName($attestorName); - $response = $gapicClient->updateAttestor($attestor); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdateAttestor', $actualFuncCall); - $actualValue = $actualRequestObject->getAttestor(); - $this->assertProtobufEquals($attestor, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateAttestorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $attestor = new Attestor(); - $attestorName = 'attestorName-125367661'; - $attestor->setName($attestorName); - try { - $gapicClient->updateAttestor($attestor); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updatePolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $policy = new Policy(); - $policyDefaultAdmissionRule = new AdmissionRule(); - $defaultAdmissionRuleEvaluationMode = EvaluationMode::EVALUATION_MODE_UNSPECIFIED; - $policyDefaultAdmissionRule->setEvaluationMode($defaultAdmissionRuleEvaluationMode); - $defaultAdmissionRuleEnforcementMode = EnforcementMode::ENFORCEMENT_MODE_UNSPECIFIED; - $policyDefaultAdmissionRule->setEnforcementMode($defaultAdmissionRuleEnforcementMode); - $policy->setDefaultAdmissionRule($policyDefaultAdmissionRule); - $response = $gapicClient->updatePolicy($policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdatePolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updatePolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $policy = new Policy(); - $policyDefaultAdmissionRule = new AdmissionRule(); - $defaultAdmissionRuleEvaluationMode = EvaluationMode::EVALUATION_MODE_UNSPECIFIED; - $policyDefaultAdmissionRule->setEvaluationMode($defaultAdmissionRuleEvaluationMode); - $defaultAdmissionRuleEnforcementMode = EnforcementMode::ENFORCEMENT_MODE_UNSPECIFIED; - $policyDefaultAdmissionRule->setEnforcementMode($defaultAdmissionRuleEnforcementMode); - $policy->setDefaultAdmissionRule($policyDefaultAdmissionRule); - try { - $gapicClient->updatePolicy($policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/BinaryAuthorization/tests/Unit/V1beta1/SystemPolicyV1Beta1ClientTest.php b/BinaryAuthorization/tests/Unit/V1beta1/SystemPolicyV1Beta1ClientTest.php deleted file mode 100644 index afc19a6790a8..000000000000 --- a/BinaryAuthorization/tests/Unit/V1beta1/SystemPolicyV1Beta1ClientTest.php +++ /dev/null @@ -1,123 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SystemPolicyV1Beta1Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SystemPolicyV1Beta1Client($options); - } - - /** @test */ - public function getSystemPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]'); - $response = $gapicClient->getSystemPolicy($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1/GetSystemPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSystemPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]'); - try { - $gapicClient->getSystemPolicy($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Build/.OwlBot.yaml b/Build/.OwlBot.yaml index 8d979b80a8f0..bc7eeb8c4ad0 100644 --- a/Build/.OwlBot.yaml +++ b/Build/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/devtools/cloudbuild/(v1|v2)/.*-php/(.*) + - source: /google/devtools/cloudbuild/(v2)/.*-php/(.*) dest: /owl-bot-staging/Build/$1/$2 api-name: Build diff --git a/Build/.repo-metadata.json b/Build/.repo-metadata.json deleted file mode 100644 index 25996b7cb1d6..000000000000 --- a/Build/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-build", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-build/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudbuild" -} diff --git a/Build/README.md b/Build/README.md index 6644f633363a..4388a0c81f1c 100644 --- a/Build/README.md +++ b/Build/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/Build/VERSION b/Build/VERSION index 2a0970ca757c..7eb3095a3295 100644 --- a/Build/VERSION +++ b/Build/VERSION @@ -1 +1 @@ -0.16.1 +0.16.3 diff --git a/Build/composer.json b/Build/composer.json index 73fdbb94c81d..2351b6a392e1 100644 --- a/Build/composer.json +++ b/Build/composer.json @@ -25,7 +25,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Build/metadata/V1/Cloudbuild.php b/Build/metadata/V1/Cloudbuild.php deleted file mode 100644 index 0207fb8ecb26187d616d410057064b97e98afc3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27111 zcmdU2YiwJ|bq*;@mWGlnU%zPWdRM;t@_N10nqGSo?vs>giEBwz_^{)x5tgE^B-Rwk z@RD+zjnE=!fu#T1v?&@iL7JvX(H}*dCN0wTM}s0LuxNoI0Sa`{0x4P`zyj^RKHxv? zch1b*2TA#oau6i@V@+PpoS8Xu<~+W0=IXUKn>$VM)ZCI)w_4@4wK=zOf3Ce_%{5z% zcB9g$&24nHwyf4%rLo(r)~r@+Zf-FhNwrke>rnT2@ zG-~#IrPk&z&&{>0cBfT;mFGkZ;Uqi!b>?wVW@2X$PiRjqn^xIWjbR&6t7?UeVbjn;5om)q^;Mq~5-aJ_Pt z61Sn2mTPp{)%y0}L#;IG+pSK$j!t*7O*$FF@zW8L#g6Pd_|Q&Q>~DIv*&c#HPFLQR z)v|r}5W^O#IF{}5ZnJ-1J`gXyQB~rf+}w1e{W|o+1xG$fTAvet{9Z`JhSLnjIoUp@ zHA&3XB(c5Avu6~!a`h^F{ z3*y;;ffa>=$H&Clauk}FI}hU{VoYiaUS}l!ypqHNBrBG)nvFbLGxLLxn94(^m$xnX z#F!Ri8=cBst1XvK-y0jm4LPD=2(c}VC{zUxIAYuq({ci(EvsGGv0Bkltb0112$+a( z0GI}mS0aVWUgn@i!&d>wC5!k7``Eo-l8)B46}|I9xM z3*j=2SkNsY#&I#x0$WQgZoD_fDG}LdmFtxq`H*FB`9tVE-Y##;XDl9gb`l1^vAbJs zm+YM~Gj9S<)vS)v9MEL4THmu;?NZCywmumh$J22mFQ)9yhTX2Vq4{A7qZ4x@7b5Z3 z0vPWuCYJYhPuFpRW?vRY?^Bx1UF*JL*pwLEE7v-f6pBRn!=aRL*=F7lr+j<6TCP{O z=s+Gqy3B8f#hBW(>ku?4ttFe~g2#`cvGvy0PhOe&4U z3XS$*v$~BPk*d*1ib%6#@06fb;R{4bE+g?f&jrkZY-qk&uG3*1F~1QKr;5#5qr7Qt zuHSF(H0tZ+%3T_p&stT9&Kn}K1q)i*Dcd`itu`=7Ws%KY<__Icm3#LHQ(Z0ZS@mSA zUEL~I+CP0${aQ#EnyYKg-Je>Pe(#8wU`v>9Tg@(M!~R?KJ#6&|6d44u+}gGwc=S!_ zI97zvt7Kv6FtHZCSH=n3YP6t*sVRPj6V$rjY``mvO09@zwpBs&P@)0Gx!pB!bgxnC zz`ax2@RyAI{t!g+TWjy@#e(x+=UM;4AfM)R%_fVZI!FFPRoi;gV4BfT1;4<1m`P_ zO)ENsN29WNRLscc&aZaV0LMp3o5J;{#dR1Ta*sMWZhDtJ;t&uRchNDHrJ#F-oFrLxIpy z2=Ymo4Xmbs3&Av?+Q5ZDPrZ2|C+-ioE%rNCYu)k^v@5`Tzlg+5c7UNhE~ywy>eH+^E*;Gh7>N^$pu&otV#@QH#Rq78 zDHZEZH_7*NVn!+|Pe6GZ^ps#j6dFw#Pn_XV2C^+#*#(ixQ7oZE(bZX(=2~~8a*pNm zm4NxPeD(=a$c;c4Wk;Xn9fHl5et;dFW4eK-g}nwN?b!VD-0h`-rUNO4m(0PEgT zm(7#1H9U~x%&5n7VPS9D-GdpYp3%OTr5guqqFEd95T1f1c>?9X*Lrf}< z0_gNsBYK6WFc@pEOIIX=eoSok4?^OoqRxA6eNrP6OJcm)0v=m!-)Em-I(~Ja-BZ+J z>#DPPU5x9`MpT?!&tWc`5SLTMDI5(Hd)hwF}ajT)I@a zy`JuxJD`yDVt%?m=Y5U z$+d;_3hl{J`Yrvj^-K<5CKA8+LGshVSmk->9Kz=8`FGW){drdGc)5tw0%-mXiIizCxQ&#pjvb}C7`QMTFwSh_c9Z?YM zc9TbkBA7kkTi|w`C=<_LdrVwK|s#PB{|{S$O|Ay+GKoa0s!k#0FsQ8a?Cy(7gK)D^&85+ zy4h<&xcs3Qzh`bhK2^Mf;KGUjcEmV2lLS8*F`pYruKPoMPxy1=R((@Coup15+S*(d zr&%{U2{N6;HLi$JK4q-oBk`vLB!a1!e={Oxy1g=lc4y#xH)?wpMWT$yYiv<&dXO3R z!GXq-IO&k{0-XeB2ZzTwCqH0(Tp%^ucV2EtJi$bRf=1s2HC}1l_Je^(_+-5qz{hUx z#oW-&^~q-M+!4pRet?Sg*p3hTZATDj;L>8_u_%Q5#JJ{-M@dCS;!g#vg5XT^vmtSW zJ{Sp~uMo7`)Fnp$W83co<0s9lV%+%&PRm+$EiE%6`Q>E%>NQyZqhe%r@hXfxtQsC( zy&Ru8V*WZDE$s%r4V+!VYCxp{G_)Y$w5E8#nq+_MF7=ULj8_p%)oax{AYM(oz*C`tc?$CY1*Du4ev0@{+h{^9CsXcP~j2 zyD7CVjZW~V^bEg9UX6@ypgDV)1txegQ)z1hPcIXUNxE3LWWr1En)nC(B#;kZ0-C+R zH~}j|oi2S@j5W(G3lR_FYn-Vy4xg#T$(DLqD))i(GDRC?RV7mVv!u=Gsap48&c;1jp(K-C)5n4>_n5*A@hV@Qm6|km*fvLWbU! zZ%_>eI@n*>xDM1-1?kAU5<15Gi^N|H(1bd)&v7U7&%Yk!#&C;c8s<$gO0krMtio{$rMg29Zhj@~ww9bX z0CmaMR?C4^Sn}l3uOSDbiM0v2lpF|z6IaFfrd5$e0;CzHgToayjGR|&QT3*2gb6dF z0szv0>`K$q5L|AqQQ#s3eqz2Q#&t)E;TKW)kk4e-y25=gdzsk|d&5-AFoi_4$H#;9 z=(Kcp_D!DyE=PX;LGoGg^ugsTL`y~!NNj^z%i5B*2&P6>MKBCPoDIfkFgNn6q>sm? zD(vIj7E$EecRCwL^g%-b_^~Zys95l&X1@9$85b`dJWCKpcNi|!TT0V%$jz9iPKe_@ z)Xi^U>-`TJ1h^)O&noJ z0dEyfx(lM56K5AzvPED+vTP@pUeD$;1)xglJUmf2pi7y;axn!pa8k^qGKExe;YPYp z0;qH|or5}%Emo4LnIl0v_5BGk$$CnftyJ_w z=?~6Rb1@I$?EH=4<`eK?CjgVqXym+&I<^|=ahbgciXuGcE-A*ONJnL^I4D&H0bYgx z1OIQ^N)@KW6e@y|W7S9D93~s=Vy|-_MPpG+-?KJ$8jZV}$dgPYC-ve7$Bn?N~GY3AkP7P%&rKYEs0~`R*9bL$e5C4!L>hNn|pRa zs4G)Ng8$I?U)l+rrp>BN$oeL#3Mfrp>`rLNgxebdj)7M|`{gwtv(@c-12&DwxPeS564>D*% zqDZKQwhbkVBv;GWo#%K$L2(DoMw%9udns&(!;uqT4SkUOa%kW>%xC%lr|QrHH&vhZ zjYOYj8dUY+tG#_Mj_YUfqv}&?MojaDm9$n?0ROwc{IYc&fdnWnfyX_?RsVj zskcP{cK?RjZNCv-M9B!_F^U0kgcd_$NjPdrKRbdVQ{NO6KN17-gVJv4g&h1nhZCtO zBp*8Mozkv_64FicH^Sn0k3v9XG$w1SrL17q9}~w^1VtvM-D=c0lA4YOp~*eOV+%48 zgRvnpJ(brK6pfoLG2PV;8et*3x(Y3kFD+*B$rPpasJ45?d7NI8PeVu@%y&OU3N}|t ze@tZzvDJlKCRK#1oG)e9R&LLPQxoDS`9O%T%rzlgCD(@?Q(^@Es+0q8r@MNbBz@dV z?^_`_>Mk%>@Ly*DhO6*7d9vt2gYn208j`4Xl;iL&2K%jE--!%N*!&e-!O(zR*PQhg z40px@oBjjgyMwM^n7`P)%q1OiW>Uuj4L)+yRZ| z1)=laEjSp|Lt5kPqE$mM;BBwb&7bJbd>2zGHgV^&?^K4~X=q1BXi2gTA+)e_kq*xY zi3s~HtEqkwh;zHm{82;&wz|Y>MVwX+KDw-}NVARxaXuQ|C}uIwQDQ(^~`ST-FG%DVXIt;+uFxIv8} z3cJfdc4>Qq-J}uY=fnwbnX#U`wB`fFV|wm+xFh;5jatDuacc8Eys&DetCsmVsZhX+ z2b4NfIo-H{B;-jdhO^tytyDCoCr7T=bbP4Etu(gtnv9y<84zgz5)_D=B>ZrpvsNJVTC@Gs6nDF?X&>A9D9FY3jNPWI(5>s4$qT`K7PImHV>J z(o?xVjYg4pP!*r56K{&gH?6HQ(D@Rks*5L`YmrE7#=75O3#xkak!djl#Y8EjZ!1e6Ex!5Bs^Nh<@e(1%u(c&eOJPi z_)QD3TFe(pt4Z9&gR6u2Bv)3lw@NG7EP|wvxr7W-uhep}RW6-eh1YjISzIZgD{7(g z1%8%Y!?ZzJf4zPkSNA?GB3?;Cg_*8J^D_W}+e&&Vxo{gaz&g7BCw(WN9>RSGLqe3AB=;CKbng6!StV=6^3^L3C?>g}mVsq2ebi28ZVHoK>-^dzNw|lz**_r;Z63u*FS_BXqf( zgRMyXq?T}`zGHOpJcZvl)#qMll{hs@ca-6mE+Svykf8(nDCU#m+yT>&u7mlxBk;T= zBH0D0J4N*p{#Kcc@tua<=AvMB$bh+yA@QP%iALC+>&E6}xk_Lz2Jr1Ygy!?@B1ghHgyC*J``3gHpbh5N>G zpH6*|s~}3|e}u)EgO>kM5k<0Q5B?VyZNR;tf-wolvka$(E_W!1$Mk+H6XK&PlU74h z&55%O4m|tOl%hN|&7yc*(v%nYA?@T}xeQ=Y9hw2=7siBet%!5pJQG|!PJugg%<~owWY${uyHBu0m;z5QFnQ$>a}IXEbB|t| z9Apf2ePlty8^rwS`266D<@~nfTS1)GQcZqVY45TIw&mrLAkYN$=5!>;3AlM#qS}bk zQGkFNZ|P^rs~9M$oax~)GLCKqw6EA`f{Tqd0?-#2Mqn<<0u?ZGHG8hOrmETT6C*M7 z6PGhRw)8hJ~>@}MB98?u-)kCtvu9O(bK{XBOX^USl13e|buxGn}QTe&VFgq^X zb~#)n1m-Grn)z2pP`%#ETH~geQq*KaWiJDvpVn)@0Jx3rXhmQVu2f zrL4qN{Z1hexV3C)y_i}7zA76^&)EMcZ2m(?oRJ`ywvA|UXEij z6(^js!xeR95!qs2lqN+a2z7U7AYG#;kfvqP;{!o{lLWTL|E-}3v)SGf@K`!PJ3&BH+JX{jy7r-Wo?zj(s40Ij!M+{P#Osq=YIo_?> zHie+H=<$OV`*loAVm-YR>)HfbcW@=NOGa)&7jh$ave&vf$jw0${ggOOpqxwI!3rNi z%mxMo&-9F~;J`P<6Wpd-Ia77h!BL#*4-a+FTj# z9Wie==i=Av7x#_Nh5?nRvS%ZvmwtfvuN!Js4OIVY{(k8F1zBMUiIYUOKc-3yY4pC>*UZa&at0C?x8EZO&Ug47VfqDhfr8WXuDT$V^G^e*oIXcv+k9a#?%^#ut^35h ztL95XFi&@T1m1lYwIoR{kCsU~BPe|KHr65*ptApEApV^sfw|;Vgd^TTQh`t6rul4N zrm$kSp@tK(mqi?W#f`~i}%JFu51Rj1f?7LZ`z+)pQb?32ts*C353jub3ZLR8K zehVkp@Tf2aE;Hx0O!Hs?R1NKf#-qVIKJ7t9uczZ-G~1tsg>&CWEyW0WiGa3$s{NtZ z^_O7Rsa|%$1z?Vqjrm}XIW>snIJ^@xB-b9M@HERHtjw%yKZ3HECdwOWj1&L^%j>>R;5p49lijjF&Fb0q|hg|_SQ!n~3vh_6_$le-=zysOa zMf2&jK9JZfemQfD-lh3Vo?PMH21Y?ASmSD^&5ske(}(@=Wre<4BV`X0nf zYVTR7emN8$mWi%HTaLfZ#y}B_`K}}!xphLl9CskM#>;l<8@l*Nn({ZpRJ+|L zn`^wP5Ay+0R^MKl-@&hU?K5N!Z=t6PoaQfun46z6Umk*+`w5kDOK`&Zo!4aVcL%gL z{@woA>3*f|02Aljo&nxa7g3yq~qDe#2zF5ag^# zDxADXcpf8*{=`MHGuQKN+LHEMO<*=kMLSr)-&%`Jyrk`Ik^$q`Q%Lh3{_a^W!24tX-Qu59Phf z>!Ej&{J{AYZ{y!?c>b8mJZJ+6-HUskH8);$sWdmf8Xj3%Nc~}Wc8UMAN^F4uVflad zEMqq>zZX6wf4n3A-pZXj{L3Bu$(0YnQTbCM!5tF`{wa~bPsz2wY9Tj(a$m%?U2ANV zYx62WjD)uOwEsc!_8_nGd)W!fT$<{-i+bZ9Xm;Iy0qwWNQ?i2Pp|1`xp6W}z0yKxI z(gzUR9O^wJ{oXYu=i<_wR|PP5qCR1mEit!!*Fw2cw-RG$gEc#4DO z?$7T!eJ}>DOyYH@Ev`4hKuvL;W#*x8iMcW8NT|ZdAt{Mr@TrAQ`|}n3t{M3dLly_S z`_yMl?{zAW^L_>0w;p~s%7y)1>EYW|pv3=z#AhB_z~Nq+Gv4VlyS}_fc|{!;fKlOv zVcakK^Uh7fs)b*iZ};~%#z4E>xbmFy7ga9FzYpa3b3#bg;m;lQ`BOsNQvS)GeX%dZ F{{vS8pSS=3 diff --git a/Build/owlbot.py b/Build/owlbot.py index 88e8de7294a3..51aabb022dc9 100644 --- a/Build/owlbot.py +++ b/Build/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,14 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php", - src / "**/*GrpcClient.php", - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -48,28 +41,16 @@ + "\n", '') -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/Build/src/V1/ApprovalConfig.php b/Build/src/V1/ApprovalConfig.php deleted file mode 100644 index aaf7390e1e4d..000000000000 --- a/Build/src/V1/ApprovalConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.devtools.cloudbuild.v1.ApprovalConfig - */ -class ApprovalConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Whether or not approval is needed. If this is set on a build, it will - * become pending when created, and will need to be explicitly approved - * to start. - * - * Generated from protobuf field bool approval_required = 1; - */ - private $approval_required = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $approval_required - * Whether or not approval is needed. If this is set on a build, it will - * become pending when created, and will need to be explicitly approved - * to start. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Whether or not approval is needed. If this is set on a build, it will - * become pending when created, and will need to be explicitly approved - * to start. - * - * Generated from protobuf field bool approval_required = 1; - * @return bool - */ - public function getApprovalRequired() - { - return $this->approval_required; - } - - /** - * Whether or not approval is needed. If this is set on a build, it will - * become pending when created, and will need to be explicitly approved - * to start. - * - * Generated from protobuf field bool approval_required = 1; - * @param bool $var - * @return $this - */ - public function setApprovalRequired($var) - { - GPBUtil::checkBool($var); - $this->approval_required = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ApprovalResult.php b/Build/src/V1/ApprovalResult.php deleted file mode 100644 index 0addccd1b0b3..000000000000 --- a/Build/src/V1/ApprovalResult.php +++ /dev/null @@ -1,230 +0,0 @@ -google.devtools.cloudbuild.v1.ApprovalResult - */ -class ApprovalResult extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Email of the user that called the ApproveBuild API to - * approve or reject a build at the time that the API was called. - * - * Generated from protobuf field string approver_account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $approver_account = ''; - /** - * Output only. The time when the approval decision was made. - * - * Generated from protobuf field .google.protobuf.Timestamp approval_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $approval_time = null; - /** - * Required. The decision of this manual approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult.Decision decision = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $decision = 0; - /** - * Optional. An optional comment for this manual approval result. - * - * Generated from protobuf field string comment = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $comment = ''; - /** - * Optional. An optional URL tied to this manual approval result. This field - * is essentially the same as comment, except that it will be rendered by the - * UI differently. An example use case is a link to an external job that - * approved this Build. - * - * Generated from protobuf field string url = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $url = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $approver_account - * Output only. Email of the user that called the ApproveBuild API to - * approve or reject a build at the time that the API was called. - * @type \Google\Protobuf\Timestamp $approval_time - * Output only. The time when the approval decision was made. - * @type int $decision - * Required. The decision of this manual approval. - * @type string $comment - * Optional. An optional comment for this manual approval result. - * @type string $url - * Optional. An optional URL tied to this manual approval result. This field - * is essentially the same as comment, except that it will be rendered by the - * UI differently. An example use case is a link to an external job that - * approved this Build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Email of the user that called the ApproveBuild API to - * approve or reject a build at the time that the API was called. - * - * Generated from protobuf field string approver_account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApproverAccount() - { - return $this->approver_account; - } - - /** - * Output only. Email of the user that called the ApproveBuild API to - * approve or reject a build at the time that the API was called. - * - * Generated from protobuf field string approver_account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApproverAccount($var) - { - GPBUtil::checkString($var, True); - $this->approver_account = $var; - - return $this; - } - - /** - * Output only. The time when the approval decision was made. - * - * Generated from protobuf field .google.protobuf.Timestamp approval_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getApprovalTime() - { - return $this->approval_time; - } - - public function hasApprovalTime() - { - return isset($this->approval_time); - } - - public function clearApprovalTime() - { - unset($this->approval_time); - } - - /** - * Output only. The time when the approval decision was made. - * - * Generated from protobuf field .google.protobuf.Timestamp approval_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setApprovalTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->approval_time = $var; - - return $this; - } - - /** - * Required. The decision of this manual approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult.Decision decision = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getDecision() - { - return $this->decision; - } - - /** - * Required. The decision of this manual approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult.Decision decision = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setDecision($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\ApprovalResult\Decision::class); - $this->decision = $var; - - return $this; - } - - /** - * Optional. An optional comment for this manual approval result. - * - * Generated from protobuf field string comment = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getComment() - { - return $this->comment; - } - - /** - * Optional. An optional comment for this manual approval result. - * - * Generated from protobuf field string comment = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setComment($var) - { - GPBUtil::checkString($var, True); - $this->comment = $var; - - return $this; - } - - /** - * Optional. An optional URL tied to this manual approval result. This field - * is essentially the same as comment, except that it will be rendered by the - * UI differently. An example use case is a link to an external job that - * approved this Build. - * - * Generated from protobuf field string url = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Optional. An optional URL tied to this manual approval result. This field - * is essentially the same as comment, except that it will be rendered by the - * UI differently. An example use case is a link to an external job that - * approved this Build. - * - * Generated from protobuf field string url = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setUrl($var) - { - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ApprovalResult/Decision.php b/Build/src/V1/ApprovalResult/Decision.php deleted file mode 100644 index 51d66ca94131..000000000000 --- a/Build/src/V1/ApprovalResult/Decision.php +++ /dev/null @@ -1,63 +0,0 @@ -google.devtools.cloudbuild.v1.ApprovalResult.Decision - */ -class Decision -{ - /** - * Default enum type. This should not be used. - * - * Generated from protobuf enum DECISION_UNSPECIFIED = 0; - */ - const DECISION_UNSPECIFIED = 0; - /** - * Build is approved. - * - * Generated from protobuf enum APPROVED = 1; - */ - const APPROVED = 1; - /** - * Build is rejected. - * - * Generated from protobuf enum REJECTED = 2; - */ - const REJECTED = 2; - - private static $valueToName = [ - self::DECISION_UNSPECIFIED => 'DECISION_UNSPECIFIED', - self::APPROVED => 'APPROVED', - self::REJECTED => 'REJECTED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/ApproveBuildRequest.php b/Build/src/V1/ApproveBuildRequest.php deleted file mode 100644 index 35a51341dcfd..000000000000 --- a/Build/src/V1/ApproveBuildRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.devtools.cloudbuild.v1.ApproveBuildRequest - */ -class ApproveBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Approval decision and metadata. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult approval_result = 2; - */ - private $approval_result = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * @type \Google\Cloud\Build\V1\ApprovalResult $approval_result - * Approval decision and metadata. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Approval decision and metadata. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult approval_result = 2; - * @return \Google\Cloud\Build\V1\ApprovalResult|null - */ - public function getApprovalResult() - { - return $this->approval_result; - } - - public function hasApprovalResult() - { - return isset($this->approval_result); - } - - public function clearApprovalResult() - { - unset($this->approval_result); - } - - /** - * Approval decision and metadata. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult approval_result = 2; - * @param \Google\Cloud\Build\V1\ApprovalResult $var - * @return $this - */ - public function setApprovalResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\ApprovalResult::class); - $this->approval_result = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ArtifactResult.php b/Build/src/V1/ArtifactResult.php deleted file mode 100644 index 98a3180c76b9..000000000000 --- a/Build/src/V1/ArtifactResult.php +++ /dev/null @@ -1,110 +0,0 @@ -google.devtools.cloudbuild.v1.ArtifactResult - */ -class ArtifactResult extends \Google\Protobuf\Internal\Message -{ - /** - * The path of an artifact in a Cloud Storage bucket, with the - * generation number. For example, - * `gs://mybucket/path/to/output.jar#generation`. - * - * Generated from protobuf field string location = 1; - */ - private $location = ''; - /** - * The file hash of the artifact. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.FileHashes file_hash = 2; - */ - private $file_hash; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $location - * The path of an artifact in a Cloud Storage bucket, with the - * generation number. For example, - * `gs://mybucket/path/to/output.jar#generation`. - * @type array<\Google\Cloud\Build\V1\FileHashes>|\Google\Protobuf\Internal\RepeatedField $file_hash - * The file hash of the artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The path of an artifact in a Cloud Storage bucket, with the - * generation number. For example, - * `gs://mybucket/path/to/output.jar#generation`. - * - * Generated from protobuf field string location = 1; - * @return string - */ - public function getLocation() - { - return $this->location; - } - - /** - * The path of an artifact in a Cloud Storage bucket, with the - * generation number. For example, - * `gs://mybucket/path/to/output.jar#generation`. - * - * Generated from protobuf field string location = 1; - * @param string $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkString($var, True); - $this->location = $var; - - return $this; - } - - /** - * The file hash of the artifact. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.FileHashes file_hash = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFileHash() - { - return $this->file_hash; - } - - /** - * The file hash of the artifact. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.FileHashes file_hash = 2; - * @param array<\Google\Cloud\Build\V1\FileHashes>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFileHash($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hash = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/Artifacts.php b/Build/src/V1/Artifacts.php deleted file mode 100644 index 223f22f97f4c..000000000000 --- a/Build/src/V1/Artifacts.php +++ /dev/null @@ -1,314 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts - */ -class Artifacts extends \Google\Protobuf\Internal\Message -{ - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images will be pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the Build resource's - * results field. - * If any of the images fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated string images = 1; - */ - private $images; - /** - * A list of objects to be uploaded to Cloud Storage upon successful - * completion of all build steps. - * Files in the workspace matching specified paths globs will be uploaded to - * the specified Cloud Storage location using the builder service account's - * credentials. - * The location and generation of the uploaded objects will be stored in the - * Build resource's results field. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects objects = 2; - */ - private $objects = null; - /** - * A list of Maven artifacts to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Artifacts in the workspace matching specified paths globs will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any artifacts fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.MavenArtifact maven_artifacts = 3; - */ - private $maven_artifacts; - /** - * A list of Python packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * The build service account credentials will be used to perform the upload. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.PythonPackage python_packages = 5; - */ - private $python_packages; - /** - * A list of npm packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Npm packages in the specified paths will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any packages fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.NpmPackage npm_packages = 6; - */ - private $npm_packages; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $images - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images will be pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the Build resource's - * results field. - * If any of the images fail to be pushed, the build is marked FAILURE. - * @type \Google\Cloud\Build\V1\Artifacts\ArtifactObjects $objects - * A list of objects to be uploaded to Cloud Storage upon successful - * completion of all build steps. - * Files in the workspace matching specified paths globs will be uploaded to - * the specified Cloud Storage location using the builder service account's - * credentials. - * The location and generation of the uploaded objects will be stored in the - * Build resource's results field. - * If any objects fail to be pushed, the build is marked FAILURE. - * @type array<\Google\Cloud\Build\V1\Artifacts\MavenArtifact>|\Google\Protobuf\Internal\RepeatedField $maven_artifacts - * A list of Maven artifacts to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Artifacts in the workspace matching specified paths globs will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any artifacts fail to be pushed, the build is marked FAILURE. - * @type array<\Google\Cloud\Build\V1\Artifacts\PythonPackage>|\Google\Protobuf\Internal\RepeatedField $python_packages - * A list of Python packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * The build service account credentials will be used to perform the upload. - * If any objects fail to be pushed, the build is marked FAILURE. - * @type array<\Google\Cloud\Build\V1\Artifacts\NpmPackage>|\Google\Protobuf\Internal\RepeatedField $npm_packages - * A list of npm packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Npm packages in the specified paths will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any packages fail to be pushed, the build is marked FAILURE. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images will be pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the Build resource's - * results field. - * If any of the images fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated string images = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images will be pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the Build resource's - * results field. - * If any of the images fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated string images = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->images = $arr; - - return $this; - } - - /** - * A list of objects to be uploaded to Cloud Storage upon successful - * completion of all build steps. - * Files in the workspace matching specified paths globs will be uploaded to - * the specified Cloud Storage location using the builder service account's - * credentials. - * The location and generation of the uploaded objects will be stored in the - * Build resource's results field. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects objects = 2; - * @return \Google\Cloud\Build\V1\Artifacts\ArtifactObjects|null - */ - public function getObjects() - { - return $this->objects; - } - - public function hasObjects() - { - return isset($this->objects); - } - - public function clearObjects() - { - unset($this->objects); - } - - /** - * A list of objects to be uploaded to Cloud Storage upon successful - * completion of all build steps. - * Files in the workspace matching specified paths globs will be uploaded to - * the specified Cloud Storage location using the builder service account's - * credentials. - * The location and generation of the uploaded objects will be stored in the - * Build resource's results field. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects objects = 2; - * @param \Google\Cloud\Build\V1\Artifacts\ArtifactObjects $var - * @return $this - */ - public function setObjects($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Artifacts\ArtifactObjects::class); - $this->objects = $var; - - return $this; - } - - /** - * A list of Maven artifacts to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Artifacts in the workspace matching specified paths globs will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any artifacts fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.MavenArtifact maven_artifacts = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMavenArtifacts() - { - return $this->maven_artifacts; - } - - /** - * A list of Maven artifacts to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Artifacts in the workspace matching specified paths globs will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any artifacts fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.MavenArtifact maven_artifacts = 3; - * @param array<\Google\Cloud\Build\V1\Artifacts\MavenArtifact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMavenArtifacts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Artifacts\MavenArtifact::class); - $this->maven_artifacts = $arr; - - return $this; - } - - /** - * A list of Python packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * The build service account credentials will be used to perform the upload. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.PythonPackage python_packages = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPythonPackages() - { - return $this->python_packages; - } - - /** - * A list of Python packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * The build service account credentials will be used to perform the upload. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.PythonPackage python_packages = 5; - * @param array<\Google\Cloud\Build\V1\Artifacts\PythonPackage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPythonPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Artifacts\PythonPackage::class); - $this->python_packages = $arr; - - return $this; - } - - /** - * A list of npm packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Npm packages in the specified paths will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any packages fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.NpmPackage npm_packages = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNpmPackages() - { - return $this->npm_packages; - } - - /** - * A list of npm packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Npm packages in the specified paths will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any packages fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.NpmPackage npm_packages = 6; - * @param array<\Google\Cloud\Build\V1\Artifacts\NpmPackage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNpmPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Artifacts\NpmPackage::class); - $this->npm_packages = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/Artifacts/ArtifactObjects.php b/Build/src/V1/Artifacts/ArtifactObjects.php deleted file mode 100644 index a5516b008805..000000000000 --- a/Build/src/V1/Artifacts/ArtifactObjects.php +++ /dev/null @@ -1,163 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects - */ -class ArtifactObjects extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage bucket and optional object path, in the form - * "gs://bucket/path/to/somewhere/". (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Files in the workspace matching any path pattern will be uploaded to - * Cloud Storage with this location as a prefix. - * - * Generated from protobuf field string location = 1; - */ - private $location = ''; - /** - * Path globs used to match files in the build's workspace. - * - * Generated from protobuf field repeated string paths = 2; - */ - private $paths; - /** - * Output only. Stores timing information for pushing all artifact objects. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $location - * Cloud Storage bucket and optional object path, in the form - * "gs://bucket/path/to/somewhere/". (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Files in the workspace matching any path pattern will be uploaded to - * Cloud Storage with this location as a prefix. - * @type array|\Google\Protobuf\Internal\RepeatedField $paths - * Path globs used to match files in the build's workspace. - * @type \Google\Cloud\Build\V1\TimeSpan $timing - * Output only. Stores timing information for pushing all artifact objects. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage bucket and optional object path, in the form - * "gs://bucket/path/to/somewhere/". (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Files in the workspace matching any path pattern will be uploaded to - * Cloud Storage with this location as a prefix. - * - * Generated from protobuf field string location = 1; - * @return string - */ - public function getLocation() - { - return $this->location; - } - - /** - * Cloud Storage bucket and optional object path, in the form - * "gs://bucket/path/to/somewhere/". (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Files in the workspace matching any path pattern will be uploaded to - * Cloud Storage with this location as a prefix. - * - * Generated from protobuf field string location = 1; - * @param string $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkString($var, True); - $this->location = $var; - - return $this; - } - - /** - * Path globs used to match files in the build's workspace. - * - * Generated from protobuf field repeated string paths = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Path globs used to match files in the build's workspace. - * - * Generated from protobuf field repeated string paths = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPaths($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->paths = $arr; - - return $this; - } - - /** - * Output only. Stores timing information for pushing all artifact objects. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getTiming() - { - return $this->timing; - } - - public function hasTiming() - { - return isset($this->timing); - } - - public function clearTiming() - { - unset($this->timing); - } - - /** - * Output only. Stores timing information for pushing all artifact objects. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->timing = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Artifacts/MavenArtifact.php b/Build/src/V1/Artifacts/MavenArtifact.php deleted file mode 100644 index b4508ad7b346..000000000000 --- a/Build/src/V1/Artifacts/MavenArtifact.php +++ /dev/null @@ -1,249 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts.MavenArtifact - */ -class MavenArtifact extends \Google\Protobuf\Internal\Message -{ - /** - * Artifact Registry repository, in the form - * "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" - * Artifact in the workspace specified by path will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - */ - private $repository = ''; - /** - * Path to an artifact in the build's workspace to be uploaded to - * Artifact Registry. - * This can be either an absolute path, - * e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar - * or a relative path from /workspace, - * e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. - * - * Generated from protobuf field string path = 2; - */ - private $path = ''; - /** - * Maven `artifactId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string artifact_id = 3; - */ - private $artifact_id = ''; - /** - * Maven `groupId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string group_id = 4; - */ - private $group_id = ''; - /** - * Maven `version` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string version = 5; - */ - private $version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repository - * Artifact Registry repository, in the form - * "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" - * Artifact in the workspace specified by path will be uploaded to - * Artifact Registry with this location as a prefix. - * @type string $path - * Path to an artifact in the build's workspace to be uploaded to - * Artifact Registry. - * This can be either an absolute path, - * e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar - * or a relative path from /workspace, - * e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. - * @type string $artifact_id - * Maven `artifactId` value used when uploading the artifact to Artifact - * Registry. - * @type string $group_id - * Maven `groupId` value used when uploading the artifact to Artifact - * Registry. - * @type string $version - * Maven `version` value used when uploading the artifact to Artifact - * Registry. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" - * Artifact in the workspace specified by path will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @return string - */ - public function getRepository() - { - return $this->repository; - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" - * Artifact in the workspace specified by path will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->repository = $var; - - return $this; - } - - /** - * Path to an artifact in the build's workspace to be uploaded to - * Artifact Registry. - * This can be either an absolute path, - * e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar - * or a relative path from /workspace, - * e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. - * - * Generated from protobuf field string path = 2; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Path to an artifact in the build's workspace to be uploaded to - * Artifact Registry. - * This can be either an absolute path, - * e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar - * or a relative path from /workspace, - * e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. - * - * Generated from protobuf field string path = 2; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * Maven `artifactId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string artifact_id = 3; - * @return string - */ - public function getArtifactId() - { - return $this->artifact_id; - } - - /** - * Maven `artifactId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string artifact_id = 3; - * @param string $var - * @return $this - */ - public function setArtifactId($var) - { - GPBUtil::checkString($var, True); - $this->artifact_id = $var; - - return $this; - } - - /** - * Maven `groupId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string group_id = 4; - * @return string - */ - public function getGroupId() - { - return $this->group_id; - } - - /** - * Maven `groupId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string group_id = 4; - * @param string $var - * @return $this - */ - public function setGroupId($var) - { - GPBUtil::checkString($var, True); - $this->group_id = $var; - - return $this; - } - - /** - * Maven `version` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string version = 5; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Maven `version` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string version = 5; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Artifacts/NpmPackage.php b/Build/src/V1/Artifacts/NpmPackage.php deleted file mode 100644 index 650dbc018b24..000000000000 --- a/Build/src/V1/Artifacts/NpmPackage.php +++ /dev/null @@ -1,119 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts.NpmPackage - */ -class NpmPackage extends \Google\Protobuf\Internal\Message -{ - /** - * Artifact Registry repository, in the form - * "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY" - * Npm package in the workspace specified by path will be zipped and - * uploaded to Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - */ - private $repository = ''; - /** - * Path to the package.json. - * e.g. workspace/path/to/package - * - * Generated from protobuf field string package_path = 2; - */ - private $package_path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repository - * Artifact Registry repository, in the form - * "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY" - * Npm package in the workspace specified by path will be zipped and - * uploaded to Artifact Registry with this location as a prefix. - * @type string $package_path - * Path to the package.json. - * e.g. workspace/path/to/package - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY" - * Npm package in the workspace specified by path will be zipped and - * uploaded to Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @return string - */ - public function getRepository() - { - return $this->repository; - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY" - * Npm package in the workspace specified by path will be zipped and - * uploaded to Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->repository = $var; - - return $this; - } - - /** - * Path to the package.json. - * e.g. workspace/path/to/package - * - * Generated from protobuf field string package_path = 2; - * @return string - */ - public function getPackagePath() - { - return $this->package_path; - } - - /** - * Path to the package.json. - * e.g. workspace/path/to/package - * - * Generated from protobuf field string package_path = 2; - * @param string $var - * @return $this - */ - public function setPackagePath($var) - { - GPBUtil::checkString($var, True); - $this->package_path = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Artifacts/PythonPackage.php b/Build/src/V1/Artifacts/PythonPackage.php deleted file mode 100644 index 7f5c0cebb993..000000000000 --- a/Build/src/V1/Artifacts/PythonPackage.php +++ /dev/null @@ -1,124 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts.PythonPackage - */ -class PythonPackage extends \Google\Protobuf\Internal\Message -{ - /** - * Artifact Registry repository, in the form - * "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" - * Files in the workspace matching any path pattern will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - */ - private $repository = ''; - /** - * Path globs used to match files in the build's workspace. For Python/ - * Twine, this is usually `dist/*`, and sometimes additionally an `.asc` - * file. - * - * Generated from protobuf field repeated string paths = 2; - */ - private $paths; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repository - * Artifact Registry repository, in the form - * "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" - * Files in the workspace matching any path pattern will be uploaded to - * Artifact Registry with this location as a prefix. - * @type array|\Google\Protobuf\Internal\RepeatedField $paths - * Path globs used to match files in the build's workspace. For Python/ - * Twine, this is usually `dist/*`, and sometimes additionally an `.asc` - * file. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" - * Files in the workspace matching any path pattern will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @return string - */ - public function getRepository() - { - return $this->repository; - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" - * Files in the workspace matching any path pattern will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->repository = $var; - - return $this; - } - - /** - * Path globs used to match files in the build's workspace. For Python/ - * Twine, this is usually `dist/*`, and sometimes additionally an `.asc` - * file. - * - * Generated from protobuf field repeated string paths = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Path globs used to match files in the build's workspace. For Python/ - * Twine, this is usually `dist/*`, and sometimes additionally an `.asc` - * file. - * - * Generated from protobuf field repeated string paths = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPaths($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->paths = $arr; - - return $this; - } - -} - - diff --git a/Build/src/V1/Build.php b/Build/src/V1/Build.php deleted file mode 100644 index b85782191e74..000000000000 --- a/Build/src/V1/Build.php +++ /dev/null @@ -1,1316 +0,0 @@ -google.devtools.cloudbuild.v1.Build - */ -class Build extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The 'Build' name with format: - * `projects/{project}/locations/{location}/builds/{build}`, where {build} - * is a unique identifier generated by the service. - * - * Generated from protobuf field string name = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Output only. Unique identifier of the build. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $id = ''; - /** - * Output only. ID of the project. - * - * Generated from protobuf field string project_id = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $project_id = ''; - /** - * Output only. Status of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status = 0; - /** - * Output only. Customer-readable message about the current status. - * - * Generated from protobuf field string status_detail = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status_detail = ''; - /** - * The location of the source files to build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Source source = 3; - */ - private $source = null; - /** - * Required. The operations to be performed on the workspace. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildStep steps = 11; - */ - private $steps; - /** - * Output only. Results of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Results results = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $results = null; - /** - * Output only. Time at which the request to create the build was received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. Time at which execution of the build was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. Time at which execution of the build was finished. - * The difference between finish_time and start_time is the duration of the - * build's execution. - * - * Generated from protobuf field .google.protobuf.Timestamp finish_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $finish_time = null; - /** - * Amount of time that this build should be allowed to run, to second - * granularity. If this amount of time elapses, work on the build will cease - * and the build status will be `TIMEOUT`. - * `timeout` starts ticking from `startTime`. - * Default time is 60 minutes. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 12; - */ - private $timeout = null; - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images are pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the `Build` resource's - * results field. - * If any of the images fail to be pushed, the build status is marked - * `FAILURE`. - * - * Generated from protobuf field repeated string images = 13; - */ - private $images; - /** - * TTL in queue for this build. If provided and the build is enqueued longer - * than this value, the build will expire and the build status will be - * `EXPIRED`. - * The TTL starts ticking from create_time. - * - * Generated from protobuf field .google.protobuf.Duration queue_ttl = 40; - */ - private $queue_ttl = null; - /** - * Artifacts produced by the build that should be uploaded upon - * successful completion of all build steps. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts artifacts = 37; - */ - private $artifacts = null; - /** - * Cloud Storage bucket where logs should be written (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - * - * Generated from protobuf field string logs_bucket = 19; - */ - private $logs_bucket = ''; - /** - * Output only. A permanent fixed identifier for source. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.SourceProvenance source_provenance = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $source_provenance = null; - /** - * Output only. The ID of the `BuildTrigger` that triggered this build, if it - * was triggered automatically. - * - * Generated from protobuf field string build_trigger_id = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $build_trigger_id = ''; - /** - * Special options for this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions options = 23; - */ - private $options = null; - /** - * Output only. URL to logs for this build in Google Cloud Console. - * - * Generated from protobuf field string log_url = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $log_url = ''; - /** - * Substitutions data for `Build` resource. - * - * Generated from protobuf field map substitutions = 29; - */ - private $substitutions; - /** - * Tags for annotation of a `Build`. These are not docker tags. - * - * Generated from protobuf field repeated string tags = 31; - */ - private $tags; - /** - * Secrets to decrypt using Cloud Key Management Service. - * Note: Secret Manager is the recommended technique - * for managing sensitive data with Cloud Build. Use `available_secrets` to - * configure builds to access secrets from Secret Manager. For instructions, - * see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Secret secrets = 32; - */ - private $secrets; - /** - * Output only. Stores timing information for phases of the build. Valid keys - * are: - * * BUILD: time to execute all build steps. - * * PUSH: time to push all artifacts including docker images and non docker - * artifacts. - * * FETCHSOURCE: time to fetch source. - * * SETUPBUILD: time to set up build. - * If the build does not specify source or images, - * these keys will not be included. - * - * Generated from protobuf field map timing = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $timing; - /** - * Output only. Describes this build's approval configuration, status, - * and result. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval approval = 44 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $approval = null; - /** - * IAM service account whose credentials will be used at build runtime. - * Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * ACCOUNT can be email address or uniqueId of the service account. - * - * Generated from protobuf field string service_account = 42 [(.google.api.resource_reference) = { - */ - private $service_account = ''; - /** - * Secrets and secret environment variables. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Secrets available_secrets = 47; - */ - private $available_secrets = null; - /** - * Output only. Non-fatal problems encountered during the execution of the - * build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build.Warning warnings = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $warnings; - /** - * Output only. Contains information about the build when status=FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo failure_info = 51 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $failure_info = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The 'Build' name with format: - * `projects/{project}/locations/{location}/builds/{build}`, where {build} - * is a unique identifier generated by the service. - * @type string $id - * Output only. Unique identifier of the build. - * @type string $project_id - * Output only. ID of the project. - * @type int $status - * Output only. Status of the build. - * @type string $status_detail - * Output only. Customer-readable message about the current status. - * @type \Google\Cloud\Build\V1\Source $source - * The location of the source files to build. - * @type array<\Google\Cloud\Build\V1\BuildStep>|\Google\Protobuf\Internal\RepeatedField $steps - * Required. The operations to be performed on the workspace. - * @type \Google\Cloud\Build\V1\Results $results - * Output only. Results of the build. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Time at which the request to create the build was received. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. Time at which execution of the build was started. - * @type \Google\Protobuf\Timestamp $finish_time - * Output only. Time at which execution of the build was finished. - * The difference between finish_time and start_time is the duration of the - * build's execution. - * @type \Google\Protobuf\Duration $timeout - * Amount of time that this build should be allowed to run, to second - * granularity. If this amount of time elapses, work on the build will cease - * and the build status will be `TIMEOUT`. - * `timeout` starts ticking from `startTime`. - * Default time is 60 minutes. - * @type array|\Google\Protobuf\Internal\RepeatedField $images - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images are pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the `Build` resource's - * results field. - * If any of the images fail to be pushed, the build status is marked - * `FAILURE`. - * @type \Google\Protobuf\Duration $queue_ttl - * TTL in queue for this build. If provided and the build is enqueued longer - * than this value, the build will expire and the build status will be - * `EXPIRED`. - * The TTL starts ticking from create_time. - * @type \Google\Cloud\Build\V1\Artifacts $artifacts - * Artifacts produced by the build that should be uploaded upon - * successful completion of all build steps. - * @type string $logs_bucket - * Cloud Storage bucket where logs should be written (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - * @type \Google\Cloud\Build\V1\SourceProvenance $source_provenance - * Output only. A permanent fixed identifier for source. - * @type string $build_trigger_id - * Output only. The ID of the `BuildTrigger` that triggered this build, if it - * was triggered automatically. - * @type \Google\Cloud\Build\V1\BuildOptions $options - * Special options for this build. - * @type string $log_url - * Output only. URL to logs for this build in Google Cloud Console. - * @type array|\Google\Protobuf\Internal\MapField $substitutions - * Substitutions data for `Build` resource. - * @type array|\Google\Protobuf\Internal\RepeatedField $tags - * Tags for annotation of a `Build`. These are not docker tags. - * @type array<\Google\Cloud\Build\V1\Secret>|\Google\Protobuf\Internal\RepeatedField $secrets - * Secrets to decrypt using Cloud Key Management Service. - * Note: Secret Manager is the recommended technique - * for managing sensitive data with Cloud Build. Use `available_secrets` to - * configure builds to access secrets from Secret Manager. For instructions, - * see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets - * @type array|\Google\Protobuf\Internal\MapField $timing - * Output only. Stores timing information for phases of the build. Valid keys - * are: - * * BUILD: time to execute all build steps. - * * PUSH: time to push all artifacts including docker images and non docker - * artifacts. - * * FETCHSOURCE: time to fetch source. - * * SETUPBUILD: time to set up build. - * If the build does not specify source or images, - * these keys will not be included. - * @type \Google\Cloud\Build\V1\BuildApproval $approval - * Output only. Describes this build's approval configuration, status, - * and result. - * @type string $service_account - * IAM service account whose credentials will be used at build runtime. - * Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * ACCOUNT can be email address or uniqueId of the service account. - * @type \Google\Cloud\Build\V1\Secrets $available_secrets - * Secrets and secret environment variables. - * @type array<\Google\Cloud\Build\V1\Build\Warning>|\Google\Protobuf\Internal\RepeatedField $warnings - * Output only. Non-fatal problems encountered during the execution of the - * build. - * @type \Google\Cloud\Build\V1\Build\FailureInfo $failure_info - * Output only. Contains information about the build when status=FAILURE. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The 'Build' name with format: - * `projects/{project}/locations/{location}/builds/{build}`, where {build} - * is a unique identifier generated by the service. - * - * Generated from protobuf field string name = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The 'Build' name with format: - * `projects/{project}/locations/{location}/builds/{build}`, where {build} - * is a unique identifier generated by the service. - * - * Generated from protobuf field string name = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Unique identifier of the build. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Output only. Unique identifier of the build. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Output only. ID of the project. - * - * Generated from protobuf field string project_id = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Output only. ID of the project. - * - * Generated from protobuf field string project_id = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Output only. Status of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getStatus() - { - return $this->status; - } - - /** - * Output only. Status of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Build\Status::class); - $this->status = $var; - - return $this; - } - - /** - * Output only. Customer-readable message about the current status. - * - * Generated from protobuf field string status_detail = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusDetail() - { - return $this->status_detail; - } - - /** - * Output only. Customer-readable message about the current status. - * - * Generated from protobuf field string status_detail = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusDetail($var) - { - GPBUtil::checkString($var, True); - $this->status_detail = $var; - - return $this; - } - - /** - * The location of the source files to build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Source source = 3; - * @return \Google\Cloud\Build\V1\Source|null - */ - public function getSource() - { - return $this->source; - } - - public function hasSource() - { - return isset($this->source); - } - - public function clearSource() - { - unset($this->source); - } - - /** - * The location of the source files to build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Source source = 3; - * @param \Google\Cloud\Build\V1\Source $var - * @return $this - */ - public function setSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Source::class); - $this->source = $var; - - return $this; - } - - /** - * Required. The operations to be performed on the workspace. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildStep steps = 11; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSteps() - { - return $this->steps; - } - - /** - * Required. The operations to be performed on the workspace. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildStep steps = 11; - * @param array<\Google\Cloud\Build\V1\BuildStep>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSteps($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\BuildStep::class); - $this->steps = $arr; - - return $this; - } - - /** - * Output only. Results of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Results results = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\Results|null - */ - public function getResults() - { - return $this->results; - } - - public function hasResults() - { - return isset($this->results); - } - - public function clearResults() - { - unset($this->results); - } - - /** - * Output only. Results of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Results results = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\Results $var - * @return $this - */ - public function setResults($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Results::class); - $this->results = $var; - - return $this; - } - - /** - * Output only. Time at which the request to create the build was received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Time at which the request to create the build was received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Time at which execution of the build was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. Time at which execution of the build was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. Time at which execution of the build was finished. - * The difference between finish_time and start_time is the duration of the - * build's execution. - * - * Generated from protobuf field .google.protobuf.Timestamp finish_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getFinishTime() - { - return $this->finish_time; - } - - public function hasFinishTime() - { - return isset($this->finish_time); - } - - public function clearFinishTime() - { - unset($this->finish_time); - } - - /** - * Output only. Time at which execution of the build was finished. - * The difference between finish_time and start_time is the duration of the - * build's execution. - * - * Generated from protobuf field .google.protobuf.Timestamp finish_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setFinishTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->finish_time = $var; - - return $this; - } - - /** - * Amount of time that this build should be allowed to run, to second - * granularity. If this amount of time elapses, work on the build will cease - * and the build status will be `TIMEOUT`. - * `timeout` starts ticking from `startTime`. - * Default time is 60 minutes. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 12; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Amount of time that this build should be allowed to run, to second - * granularity. If this amount of time elapses, work on the build will cease - * and the build status will be `TIMEOUT`. - * `timeout` starts ticking from `startTime`. - * Default time is 60 minutes. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 12; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images are pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the `Build` resource's - * results field. - * If any of the images fail to be pushed, the build status is marked - * `FAILURE`. - * - * Generated from protobuf field repeated string images = 13; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images are pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the `Build` resource's - * results field. - * If any of the images fail to be pushed, the build status is marked - * `FAILURE`. - * - * Generated from protobuf field repeated string images = 13; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->images = $arr; - - return $this; - } - - /** - * TTL in queue for this build. If provided and the build is enqueued longer - * than this value, the build will expire and the build status will be - * `EXPIRED`. - * The TTL starts ticking from create_time. - * - * Generated from protobuf field .google.protobuf.Duration queue_ttl = 40; - * @return \Google\Protobuf\Duration|null - */ - public function getQueueTtl() - { - return $this->queue_ttl; - } - - public function hasQueueTtl() - { - return isset($this->queue_ttl); - } - - public function clearQueueTtl() - { - unset($this->queue_ttl); - } - - /** - * TTL in queue for this build. If provided and the build is enqueued longer - * than this value, the build will expire and the build status will be - * `EXPIRED`. - * The TTL starts ticking from create_time. - * - * Generated from protobuf field .google.protobuf.Duration queue_ttl = 40; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setQueueTtl($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->queue_ttl = $var; - - return $this; - } - - /** - * Artifacts produced by the build that should be uploaded upon - * successful completion of all build steps. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts artifacts = 37; - * @return \Google\Cloud\Build\V1\Artifacts|null - */ - public function getArtifacts() - { - return $this->artifacts; - } - - public function hasArtifacts() - { - return isset($this->artifacts); - } - - public function clearArtifacts() - { - unset($this->artifacts); - } - - /** - * Artifacts produced by the build that should be uploaded upon - * successful completion of all build steps. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts artifacts = 37; - * @param \Google\Cloud\Build\V1\Artifacts $var - * @return $this - */ - public function setArtifacts($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Artifacts::class); - $this->artifacts = $var; - - return $this; - } - - /** - * Cloud Storage bucket where logs should be written (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - * - * Generated from protobuf field string logs_bucket = 19; - * @return string - */ - public function getLogsBucket() - { - return $this->logs_bucket; - } - - /** - * Cloud Storage bucket where logs should be written (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - * - * Generated from protobuf field string logs_bucket = 19; - * @param string $var - * @return $this - */ - public function setLogsBucket($var) - { - GPBUtil::checkString($var, True); - $this->logs_bucket = $var; - - return $this; - } - - /** - * Output only. A permanent fixed identifier for source. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.SourceProvenance source_provenance = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\SourceProvenance|null - */ - public function getSourceProvenance() - { - return $this->source_provenance; - } - - public function hasSourceProvenance() - { - return isset($this->source_provenance); - } - - public function clearSourceProvenance() - { - unset($this->source_provenance); - } - - /** - * Output only. A permanent fixed identifier for source. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.SourceProvenance source_provenance = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\SourceProvenance $var - * @return $this - */ - public function setSourceProvenance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\SourceProvenance::class); - $this->source_provenance = $var; - - return $this; - } - - /** - * Output only. The ID of the `BuildTrigger` that triggered this build, if it - * was triggered automatically. - * - * Generated from protobuf field string build_trigger_id = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getBuildTriggerId() - { - return $this->build_trigger_id; - } - - /** - * Output only. The ID of the `BuildTrigger` that triggered this build, if it - * was triggered automatically. - * - * Generated from protobuf field string build_trigger_id = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setBuildTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->build_trigger_id = $var; - - return $this; - } - - /** - * Special options for this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions options = 23; - * @return \Google\Cloud\Build\V1\BuildOptions|null - */ - public function getOptions() - { - return $this->options; - } - - public function hasOptions() - { - return isset($this->options); - } - - public function clearOptions() - { - unset($this->options); - } - - /** - * Special options for this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions options = 23; - * @param \Google\Cloud\Build\V1\BuildOptions $var - * @return $this - */ - public function setOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildOptions::class); - $this->options = $var; - - return $this; - } - - /** - * Output only. URL to logs for this build in Google Cloud Console. - * - * Generated from protobuf field string log_url = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLogUrl() - { - return $this->log_url; - } - - /** - * Output only. URL to logs for this build in Google Cloud Console. - * - * Generated from protobuf field string log_url = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLogUrl($var) - { - GPBUtil::checkString($var, True); - $this->log_url = $var; - - return $this; - } - - /** - * Substitutions data for `Build` resource. - * - * Generated from protobuf field map substitutions = 29; - * @return \Google\Protobuf\Internal\MapField - */ - public function getSubstitutions() - { - return $this->substitutions; - } - - /** - * Substitutions data for `Build` resource. - * - * Generated from protobuf field map substitutions = 29; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setSubstitutions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->substitutions = $arr; - - return $this; - } - - /** - * Tags for annotation of a `Build`. These are not docker tags. - * - * Generated from protobuf field repeated string tags = 31; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTags() - { - return $this->tags; - } - - /** - * Tags for annotation of a `Build`. These are not docker tags. - * - * Generated from protobuf field repeated string tags = 31; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->tags = $arr; - - return $this; - } - - /** - * Secrets to decrypt using Cloud Key Management Service. - * Note: Secret Manager is the recommended technique - * for managing sensitive data with Cloud Build. Use `available_secrets` to - * configure builds to access secrets from Secret Manager. For instructions, - * see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Secret secrets = 32; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecrets() - { - return $this->secrets; - } - - /** - * Secrets to decrypt using Cloud Key Management Service. - * Note: Secret Manager is the recommended technique - * for managing sensitive data with Cloud Build. Use `available_secrets` to - * configure builds to access secrets from Secret Manager. For instructions, - * see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Secret secrets = 32; - * @param array<\Google\Cloud\Build\V1\Secret>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecrets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Secret::class); - $this->secrets = $arr; - - return $this; - } - - /** - * Output only. Stores timing information for phases of the build. Valid keys - * are: - * * BUILD: time to execute all build steps. - * * PUSH: time to push all artifacts including docker images and non docker - * artifacts. - * * FETCHSOURCE: time to fetch source. - * * SETUPBUILD: time to set up build. - * If the build does not specify source or images, - * these keys will not be included. - * - * Generated from protobuf field map timing = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getTiming() - { - return $this->timing; - } - - /** - * Output only. Stores timing information for phases of the build. Valid keys - * are: - * * BUILD: time to execute all build steps. - * * PUSH: time to push all artifacts including docker images and non docker - * artifacts. - * * FETCHSOURCE: time to fetch source. - * * SETUPBUILD: time to set up build. - * If the build does not specify source or images, - * these keys will not be included. - * - * Generated from protobuf field map timing = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setTiming($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\TimeSpan::class); - $this->timing = $arr; - - return $this; - } - - /** - * Output only. Describes this build's approval configuration, status, - * and result. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval approval = 44 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\BuildApproval|null - */ - public function getApproval() - { - return $this->approval; - } - - public function hasApproval() - { - return isset($this->approval); - } - - public function clearApproval() - { - unset($this->approval); - } - - /** - * Output only. Describes this build's approval configuration, status, - * and result. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval approval = 44 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\BuildApproval $var - * @return $this - */ - public function setApproval($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildApproval::class); - $this->approval = $var; - - return $this; - } - - /** - * IAM service account whose credentials will be used at build runtime. - * Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * ACCOUNT can be email address or uniqueId of the service account. - * - * Generated from protobuf field string service_account = 42 [(.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * IAM service account whose credentials will be used at build runtime. - * Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * ACCOUNT can be email address or uniqueId of the service account. - * - * Generated from protobuf field string service_account = 42 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Secrets and secret environment variables. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Secrets available_secrets = 47; - * @return \Google\Cloud\Build\V1\Secrets|null - */ - public function getAvailableSecrets() - { - return $this->available_secrets; - } - - public function hasAvailableSecrets() - { - return isset($this->available_secrets); - } - - public function clearAvailableSecrets() - { - unset($this->available_secrets); - } - - /** - * Secrets and secret environment variables. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Secrets available_secrets = 47; - * @param \Google\Cloud\Build\V1\Secrets $var - * @return $this - */ - public function setAvailableSecrets($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Secrets::class); - $this->available_secrets = $var; - - return $this; - } - - /** - * Output only. Non-fatal problems encountered during the execution of the - * build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build.Warning warnings = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWarnings() - { - return $this->warnings; - } - - /** - * Output only. Non-fatal problems encountered during the execution of the - * build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build.Warning warnings = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Build\V1\Build\Warning>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWarnings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Build\Warning::class); - $this->warnings = $arr; - - return $this; - } - - /** - * Output only. Contains information about the build when status=FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo failure_info = 51 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\Build\FailureInfo|null - */ - public function getFailureInfo() - { - return $this->failure_info; - } - - public function hasFailureInfo() - { - return isset($this->failure_info); - } - - public function clearFailureInfo() - { - unset($this->failure_info); - } - - /** - * Output only. Contains information about the build when status=FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo failure_info = 51 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\Build\FailureInfo $var - * @return $this - */ - public function setFailureInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Build\FailureInfo::class); - $this->failure_info = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Build/FailureInfo.php b/Build/src/V1/Build/FailureInfo.php deleted file mode 100644 index e2ad8511dea7..000000000000 --- a/Build/src/V1/Build/FailureInfo.php +++ /dev/null @@ -1,102 +0,0 @@ -google.devtools.cloudbuild.v1.Build.FailureInfo - */ -class FailureInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the failure. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType type = 1; - */ - private $type = 0; - /** - * Explains the failure issue in more detail using hard-coded text. - * - * Generated from protobuf field string detail = 2; - */ - private $detail = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * The name of the failure. - * @type string $detail - * Explains the failure issue in more detail using hard-coded text. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the failure. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The name of the failure. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Build\FailureInfo\FailureType::class); - $this->type = $var; - - return $this; - } - - /** - * Explains the failure issue in more detail using hard-coded text. - * - * Generated from protobuf field string detail = 2; - * @return string - */ - public function getDetail() - { - return $this->detail; - } - - /** - * Explains the failure issue in more detail using hard-coded text. - * - * Generated from protobuf field string detail = 2; - * @param string $var - * @return $this - */ - public function setDetail($var) - { - GPBUtil::checkString($var, True); - $this->detail = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Build/FailureInfo/FailureType.php b/Build/src/V1/Build/FailureInfo/FailureType.php deleted file mode 100644 index 0916da414ae6..000000000000 --- a/Build/src/V1/Build/FailureInfo/FailureType.php +++ /dev/null @@ -1,91 +0,0 @@ -google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType - */ -class FailureType -{ - /** - * Type unspecified - * - * Generated from protobuf enum FAILURE_TYPE_UNSPECIFIED = 0; - */ - const FAILURE_TYPE_UNSPECIFIED = 0; - /** - * Unable to push the image to the repository. - * - * Generated from protobuf enum PUSH_FAILED = 1; - */ - const PUSH_FAILED = 1; - /** - * Final image not found. - * - * Generated from protobuf enum PUSH_IMAGE_NOT_FOUND = 2; - */ - const PUSH_IMAGE_NOT_FOUND = 2; - /** - * Unauthorized push of the final image. - * - * Generated from protobuf enum PUSH_NOT_AUTHORIZED = 3; - */ - const PUSH_NOT_AUTHORIZED = 3; - /** - * Backend logging failures. Should retry. - * - * Generated from protobuf enum LOGGING_FAILURE = 4; - */ - const LOGGING_FAILURE = 4; - /** - * A build step has failed. - * - * Generated from protobuf enum USER_BUILD_STEP = 5; - */ - const USER_BUILD_STEP = 5; - /** - * The source fetching has failed. - * - * Generated from protobuf enum FETCH_SOURCE_FAILED = 6; - */ - const FETCH_SOURCE_FAILED = 6; - - private static $valueToName = [ - self::FAILURE_TYPE_UNSPECIFIED => 'FAILURE_TYPE_UNSPECIFIED', - self::PUSH_FAILED => 'PUSH_FAILED', - self::PUSH_IMAGE_NOT_FOUND => 'PUSH_IMAGE_NOT_FOUND', - self::PUSH_NOT_AUTHORIZED => 'PUSH_NOT_AUTHORIZED', - self::LOGGING_FAILURE => 'LOGGING_FAILURE', - self::USER_BUILD_STEP => 'USER_BUILD_STEP', - self::FETCH_SOURCE_FAILED => 'FETCH_SOURCE_FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/Build/Status.php b/Build/src/V1/Build/Status.php deleted file mode 100644 index 66a1fe3deeb1..000000000000 --- a/Build/src/V1/Build/Status.php +++ /dev/null @@ -1,112 +0,0 @@ -google.devtools.cloudbuild.v1.Build.Status - */ -class Status -{ - /** - * Status of the build is unknown. - * - * Generated from protobuf enum STATUS_UNKNOWN = 0; - */ - const STATUS_UNKNOWN = 0; - /** - * Build has been created and is pending execution and queuing. It has not - * been queued. - * - * Generated from protobuf enum PENDING = 10; - */ - const PENDING = 10; - /** - * Build or step is queued; work has not yet begun. - * - * Generated from protobuf enum QUEUED = 1; - */ - const QUEUED = 1; - /** - * Build or step is being executed. - * - * Generated from protobuf enum WORKING = 2; - */ - const WORKING = 2; - /** - * Build or step finished successfully. - * - * Generated from protobuf enum SUCCESS = 3; - */ - const SUCCESS = 3; - /** - * Build or step failed to complete successfully. - * - * Generated from protobuf enum FAILURE = 4; - */ - const FAILURE = 4; - /** - * Build or step failed due to an internal cause. - * - * Generated from protobuf enum INTERNAL_ERROR = 5; - */ - const INTERNAL_ERROR = 5; - /** - * Build or step took longer than was allowed. - * - * Generated from protobuf enum TIMEOUT = 6; - */ - const TIMEOUT = 6; - /** - * Build or step was canceled by a user. - * - * Generated from protobuf enum CANCELLED = 7; - */ - const CANCELLED = 7; - /** - * Build was enqueued for longer than the value of `queue_ttl`. - * - * Generated from protobuf enum EXPIRED = 9; - */ - const EXPIRED = 9; - - private static $valueToName = [ - self::STATUS_UNKNOWN => 'STATUS_UNKNOWN', - self::PENDING => 'PENDING', - self::QUEUED => 'QUEUED', - self::WORKING => 'WORKING', - self::SUCCESS => 'SUCCESS', - self::FAILURE => 'FAILURE', - self::INTERNAL_ERROR => 'INTERNAL_ERROR', - self::TIMEOUT => 'TIMEOUT', - self::CANCELLED => 'CANCELLED', - self::EXPIRED => 'EXPIRED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/Build/Warning.php b/Build/src/V1/Build/Warning.php deleted file mode 100644 index 055fbba3d104..000000000000 --- a/Build/src/V1/Build/Warning.php +++ /dev/null @@ -1,102 +0,0 @@ -google.devtools.cloudbuild.v1.Build.Warning - */ -class Warning extends \Google\Protobuf\Internal\Message -{ - /** - * Explanation of the warning generated. - * - * Generated from protobuf field string text = 1; - */ - private $text = ''; - /** - * The priority for this warning. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Warning.Priority priority = 2; - */ - private $priority = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * Explanation of the warning generated. - * @type int $priority - * The priority for this warning. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Explanation of the warning generated. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Explanation of the warning generated. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * The priority for this warning. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Warning.Priority priority = 2; - * @return int - */ - public function getPriority() - { - return $this->priority; - } - - /** - * The priority for this warning. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Warning.Priority priority = 2; - * @param int $var - * @return $this - */ - public function setPriority($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Build\Warning\Priority::class); - $this->priority = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Build/Warning/Priority.php b/Build/src/V1/Build/Warning/Priority.php deleted file mode 100644 index 597add0d8783..000000000000 --- a/Build/src/V1/Build/Warning/Priority.php +++ /dev/null @@ -1,69 +0,0 @@ -google.devtools.cloudbuild.v1.Build.Warning.Priority - */ -class Priority -{ - /** - * Should not be used. - * - * Generated from protobuf enum PRIORITY_UNSPECIFIED = 0; - */ - const PRIORITY_UNSPECIFIED = 0; - /** - * e.g. deprecation warnings and alternative feature highlights. - * - * Generated from protobuf enum INFO = 1; - */ - const INFO = 1; - /** - * e.g. automated detection of possible issues with the build. - * - * Generated from protobuf enum WARNING = 2; - */ - const WARNING = 2; - /** - * e.g. alerts that a feature used in the build is pending removal - * - * Generated from protobuf enum ALERT = 3; - */ - const ALERT = 3; - - private static $valueToName = [ - self::PRIORITY_UNSPECIFIED => 'PRIORITY_UNSPECIFIED', - self::INFO => 'INFO', - self::WARNING => 'WARNING', - self::ALERT => 'ALERT', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildApproval.php b/Build/src/V1/BuildApproval.php deleted file mode 100644 index e7cca0b668dd..000000000000 --- a/Build/src/V1/BuildApproval.php +++ /dev/null @@ -1,156 +0,0 @@ -google.devtools.cloudbuild.v1.BuildApproval - */ -class BuildApproval extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The state of this build's approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Configuration for manual approval of this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalConfig config = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $config = null; - /** - * Output only. Result of manual approval for this Build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $result = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Output only. The state of this build's approval. - * @type \Google\Cloud\Build\V1\ApprovalConfig $config - * Output only. Configuration for manual approval of this build. - * @type \Google\Cloud\Build\V1\ApprovalResult $result - * Output only. Result of manual approval for this Build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The state of this build's approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of this build's approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildApproval\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Configuration for manual approval of this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalConfig config = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\ApprovalConfig|null - */ - public function getConfig() - { - return $this->config; - } - - public function hasConfig() - { - return isset($this->config); - } - - public function clearConfig() - { - unset($this->config); - } - - /** - * Output only. Configuration for manual approval of this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalConfig config = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\ApprovalConfig $var - * @return $this - */ - public function setConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\ApprovalConfig::class); - $this->config = $var; - - return $this; - } - - /** - * Output only. Result of manual approval for this Build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\ApprovalResult|null - */ - public function getResult() - { - return $this->result; - } - - public function hasResult() - { - return isset($this->result); - } - - public function clearResult() - { - unset($this->result); - } - - /** - * Output only. Result of manual approval for this Build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\ApprovalResult $var - * @return $this - */ - public function setResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\ApprovalResult::class); - $this->result = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/BuildApproval/State.php b/Build/src/V1/BuildApproval/State.php deleted file mode 100644 index 1719145811fc..000000000000 --- a/Build/src/V1/BuildApproval/State.php +++ /dev/null @@ -1,76 +0,0 @@ -google.devtools.cloudbuild.v1.BuildApproval.State - */ -class State -{ - /** - * Default enum type. This should not be used. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Build approval is pending. - * - * Generated from protobuf enum PENDING = 1; - */ - const PENDING = 1; - /** - * Build approval has been approved. - * - * Generated from protobuf enum APPROVED = 2; - */ - const APPROVED = 2; - /** - * Build approval has been rejected. - * - * Generated from protobuf enum REJECTED = 3; - */ - const REJECTED = 3; - /** - * Build was cancelled while it was still pending approval. - * - * Generated from protobuf enum CANCELLED = 5; - */ - const CANCELLED = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::PENDING => 'PENDING', - self::APPROVED => 'APPROVED', - self::REJECTED => 'REJECTED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildOperationMetadata.php b/Build/src/V1/BuildOperationMetadata.php deleted file mode 100644 index 4ba9a7381cbc..000000000000 --- a/Build/src/V1/BuildOperationMetadata.php +++ /dev/null @@ -1,77 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOperationMetadata - */ -class BuildOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The build that the operation is tracking. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 1; - */ - private $build = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\Build $build - * The build that the operation is tracking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The build that the operation is tracking. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 1; - * @return \Google\Cloud\Build\V1\Build|null - */ - public function getBuild() - { - return $this->build; - } - - public function hasBuild() - { - return isset($this->build); - } - - public function clearBuild() - { - unset($this->build); - } - - /** - * The build that the operation is tracking. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 1; - * @param \Google\Cloud\Build\V1\Build $var - * @return $this - */ - public function setBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Build::class); - $this->build = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/BuildOptions.php b/Build/src/V1/BuildOptions.php deleted file mode 100644 index ab0f0a38452c..000000000000 --- a/Build/src/V1/BuildOptions.php +++ /dev/null @@ -1,678 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions - */ -class BuildOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Requested hash for SourceProvenance. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash.HashType source_provenance_hash = 1; - */ - private $source_provenance_hash; - /** - * Requested verifiability options. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.VerifyOption requested_verify_option = 2; - */ - private $requested_verify_option = 0; - /** - * Compute Engine machine type on which to run the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.MachineType machine_type = 3; - */ - private $machine_type = 0; - /** - * Requested disk size for the VM that runs the build. Note that this is *NOT* - * "disk free"; some of the space will be used by the operating system and - * build utilities. Also note that this is the minimum disk size that will be - * allocated for the build -- the build may run with a larger disk than - * requested. At present, the maximum disk size is 2000GB; builds that request - * more than the maximum are rejected with an error. - * - * Generated from protobuf field int64 disk_size_gb = 6; - */ - private $disk_size_gb = 0; - /** - * Option to specify behavior when there is an error in the substitution - * checks. - * NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot - * be overridden in the build configuration file. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption substitution_option = 4; - */ - private $substitution_option = 0; - /** - * Option to specify whether or not to apply bash style string - * operations to the substitutions. - * NOTE: this is always enabled for triggered builds and cannot be - * overridden in the build configuration file. - * - * Generated from protobuf field bool dynamic_substitutions = 17; - */ - private $dynamic_substitutions = false; - /** - * Option to include built-in and custom substitutions as env variables - * for all build steps. - * - * Generated from protobuf field bool automap_substitutions = 22; - */ - private $automap_substitutions = false; - /** - * Option to define build log streaming behavior to Cloud - * Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption log_streaming_option = 5; - */ - private $log_streaming_option = 0; - /** - * This field deprecated; please use `pool.name` instead. - * - * Generated from protobuf field string worker_pool = 7 [deprecated = true]; - * @deprecated - */ - protected $worker_pool = ''; - /** - * Optional. Specification for execution on a `WorkerPool`. - * See [running builds in a private - * pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) - * for more information. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.PoolOption pool = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $pool = null; - /** - * Option to specify the logging mode, which determines if and where build - * logs are stored. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LoggingMode logging = 11; - */ - private $logging = 0; - /** - * A list of global environment variable definitions that will exist for all - * build steps in this build. If a variable is defined in both globally and in - * a build step, the variable will use the build step value. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 12; - */ - private $env; - /** - * A list of global environment variables, which are encrypted using a Cloud - * Key Management Service crypto key. These values must be specified in the - * build's `Secret`. These variables will be available to all build steps - * in this build. - * - * Generated from protobuf field repeated string secret_env = 13; - */ - private $secret_env; - /** - * Global list of volumes to mount for ALL build steps - * Each volume is created as an empty volume prior to starting the build - * process. Upon completion of the build, volumes and their contents are - * discarded. Global volume names and paths cannot conflict with the volumes - * defined a build step. - * Using a global volume in a build with only one step is not valid as - * it is indicative of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 14; - */ - private $volumes; - /** - * Optional. Option to specify how default logs buckets are setup. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.DefaultLogsBucketBehavior default_logs_bucket_behavior = 21 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $default_logs_bucket_behavior = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $source_provenance_hash - * Requested hash for SourceProvenance. - * @type int $requested_verify_option - * Requested verifiability options. - * @type int $machine_type - * Compute Engine machine type on which to run the build. - * @type int|string $disk_size_gb - * Requested disk size for the VM that runs the build. Note that this is *NOT* - * "disk free"; some of the space will be used by the operating system and - * build utilities. Also note that this is the minimum disk size that will be - * allocated for the build -- the build may run with a larger disk than - * requested. At present, the maximum disk size is 2000GB; builds that request - * more than the maximum are rejected with an error. - * @type int $substitution_option - * Option to specify behavior when there is an error in the substitution - * checks. - * NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot - * be overridden in the build configuration file. - * @type bool $dynamic_substitutions - * Option to specify whether or not to apply bash style string - * operations to the substitutions. - * NOTE: this is always enabled for triggered builds and cannot be - * overridden in the build configuration file. - * @type bool $automap_substitutions - * Option to include built-in and custom substitutions as env variables - * for all build steps. - * @type int $log_streaming_option - * Option to define build log streaming behavior to Cloud - * Storage. - * @type string $worker_pool - * This field deprecated; please use `pool.name` instead. - * @type \Google\Cloud\Build\V1\BuildOptions\PoolOption $pool - * Optional. Specification for execution on a `WorkerPool`. - * See [running builds in a private - * pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) - * for more information. - * @type int $logging - * Option to specify the logging mode, which determines if and where build - * logs are stored. - * @type array|\Google\Protobuf\Internal\RepeatedField $env - * A list of global environment variable definitions that will exist for all - * build steps in this build. If a variable is defined in both globally and in - * a build step, the variable will use the build step value. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * @type array|\Google\Protobuf\Internal\RepeatedField $secret_env - * A list of global environment variables, which are encrypted using a Cloud - * Key Management Service crypto key. These values must be specified in the - * build's `Secret`. These variables will be available to all build steps - * in this build. - * @type array<\Google\Cloud\Build\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes - * Global list of volumes to mount for ALL build steps - * Each volume is created as an empty volume prior to starting the build - * process. Upon completion of the build, volumes and their contents are - * discarded. Global volume names and paths cannot conflict with the volumes - * defined a build step. - * Using a global volume in a build with only one step is not valid as - * it is indicative of a build request with an incorrect configuration. - * @type int $default_logs_bucket_behavior - * Optional. Option to specify how default logs buckets are setup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Requested hash for SourceProvenance. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash.HashType source_provenance_hash = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSourceProvenanceHash() - { - return $this->source_provenance_hash; - } - - /** - * Requested hash for SourceProvenance. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash.HashType source_provenance_hash = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSourceProvenanceHash($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Build\V1\Hash\HashType::class); - $this->source_provenance_hash = $arr; - - return $this; - } - - /** - * Requested verifiability options. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.VerifyOption requested_verify_option = 2; - * @return int - */ - public function getRequestedVerifyOption() - { - return $this->requested_verify_option; - } - - /** - * Requested verifiability options. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.VerifyOption requested_verify_option = 2; - * @param int $var - * @return $this - */ - public function setRequestedVerifyOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\VerifyOption::class); - $this->requested_verify_option = $var; - - return $this; - } - - /** - * Compute Engine machine type on which to run the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.MachineType machine_type = 3; - * @return int - */ - public function getMachineType() - { - return $this->machine_type; - } - - /** - * Compute Engine machine type on which to run the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.MachineType machine_type = 3; - * @param int $var - * @return $this - */ - public function setMachineType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\MachineType::class); - $this->machine_type = $var; - - return $this; - } - - /** - * Requested disk size for the VM that runs the build. Note that this is *NOT* - * "disk free"; some of the space will be used by the operating system and - * build utilities. Also note that this is the minimum disk size that will be - * allocated for the build -- the build may run with a larger disk than - * requested. At present, the maximum disk size is 2000GB; builds that request - * more than the maximum are rejected with an error. - * - * Generated from protobuf field int64 disk_size_gb = 6; - * @return int|string - */ - public function getDiskSizeGb() - { - return $this->disk_size_gb; - } - - /** - * Requested disk size for the VM that runs the build. Note that this is *NOT* - * "disk free"; some of the space will be used by the operating system and - * build utilities. Also note that this is the minimum disk size that will be - * allocated for the build -- the build may run with a larger disk than - * requested. At present, the maximum disk size is 2000GB; builds that request - * more than the maximum are rejected with an error. - * - * Generated from protobuf field int64 disk_size_gb = 6; - * @param int|string $var - * @return $this - */ - public function setDiskSizeGb($var) - { - GPBUtil::checkInt64($var); - $this->disk_size_gb = $var; - - return $this; - } - - /** - * Option to specify behavior when there is an error in the substitution - * checks. - * NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot - * be overridden in the build configuration file. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption substitution_option = 4; - * @return int - */ - public function getSubstitutionOption() - { - return $this->substitution_option; - } - - /** - * Option to specify behavior when there is an error in the substitution - * checks. - * NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot - * be overridden in the build configuration file. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption substitution_option = 4; - * @param int $var - * @return $this - */ - public function setSubstitutionOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\SubstitutionOption::class); - $this->substitution_option = $var; - - return $this; - } - - /** - * Option to specify whether or not to apply bash style string - * operations to the substitutions. - * NOTE: this is always enabled for triggered builds and cannot be - * overridden in the build configuration file. - * - * Generated from protobuf field bool dynamic_substitutions = 17; - * @return bool - */ - public function getDynamicSubstitutions() - { - return $this->dynamic_substitutions; - } - - /** - * Option to specify whether or not to apply bash style string - * operations to the substitutions. - * NOTE: this is always enabled for triggered builds and cannot be - * overridden in the build configuration file. - * - * Generated from protobuf field bool dynamic_substitutions = 17; - * @param bool $var - * @return $this - */ - public function setDynamicSubstitutions($var) - { - GPBUtil::checkBool($var); - $this->dynamic_substitutions = $var; - - return $this; - } - - /** - * Option to include built-in and custom substitutions as env variables - * for all build steps. - * - * Generated from protobuf field bool automap_substitutions = 22; - * @return bool - */ - public function getAutomapSubstitutions() - { - return $this->automap_substitutions; - } - - /** - * Option to include built-in and custom substitutions as env variables - * for all build steps. - * - * Generated from protobuf field bool automap_substitutions = 22; - * @param bool $var - * @return $this - */ - public function setAutomapSubstitutions($var) - { - GPBUtil::checkBool($var); - $this->automap_substitutions = $var; - - return $this; - } - - /** - * Option to define build log streaming behavior to Cloud - * Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption log_streaming_option = 5; - * @return int - */ - public function getLogStreamingOption() - { - return $this->log_streaming_option; - } - - /** - * Option to define build log streaming behavior to Cloud - * Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption log_streaming_option = 5; - * @param int $var - * @return $this - */ - public function setLogStreamingOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\LogStreamingOption::class); - $this->log_streaming_option = $var; - - return $this; - } - - /** - * This field deprecated; please use `pool.name` instead. - * - * Generated from protobuf field string worker_pool = 7 [deprecated = true]; - * @return string - * @deprecated - */ - public function getWorkerPool() - { - @trigger_error('worker_pool is deprecated.', E_USER_DEPRECATED); - return $this->worker_pool; - } - - /** - * This field deprecated; please use `pool.name` instead. - * - * Generated from protobuf field string worker_pool = 7 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setWorkerPool($var) - { - @trigger_error('worker_pool is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->worker_pool = $var; - - return $this; - } - - /** - * Optional. Specification for execution on a `WorkerPool`. - * See [running builds in a private - * pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) - * for more information. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.PoolOption pool = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Build\V1\BuildOptions\PoolOption|null - */ - public function getPool() - { - return $this->pool; - } - - public function hasPool() - { - return isset($this->pool); - } - - public function clearPool() - { - unset($this->pool); - } - - /** - * Optional. Specification for execution on a `WorkerPool`. - * See [running builds in a private - * pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) - * for more information. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.PoolOption pool = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Build\V1\BuildOptions\PoolOption $var - * @return $this - */ - public function setPool($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildOptions\PoolOption::class); - $this->pool = $var; - - return $this; - } - - /** - * Option to specify the logging mode, which determines if and where build - * logs are stored. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LoggingMode logging = 11; - * @return int - */ - public function getLogging() - { - return $this->logging; - } - - /** - * Option to specify the logging mode, which determines if and where build - * logs are stored. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LoggingMode logging = 11; - * @param int $var - * @return $this - */ - public function setLogging($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\LoggingMode::class); - $this->logging = $var; - - return $this; - } - - /** - * A list of global environment variable definitions that will exist for all - * build steps in this build. If a variable is defined in both globally and in - * a build step, the variable will use the build step value. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEnv() - { - return $this->env; - } - - /** - * A list of global environment variable definitions that will exist for all - * build steps in this build. If a variable is defined in both globally and in - * a build step, the variable will use the build step value. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 12; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->env = $arr; - - return $this; - } - - /** - * A list of global environment variables, which are encrypted using a Cloud - * Key Management Service crypto key. These values must be specified in the - * build's `Secret`. These variables will be available to all build steps - * in this build. - * - * Generated from protobuf field repeated string secret_env = 13; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecretEnv() - { - return $this->secret_env; - } - - /** - * A list of global environment variables, which are encrypted using a Cloud - * Key Management Service crypto key. These values must be specified in the - * build's `Secret`. These variables will be available to all build steps - * in this build. - * - * Generated from protobuf field repeated string secret_env = 13; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecretEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->secret_env = $arr; - - return $this; - } - - /** - * Global list of volumes to mount for ALL build steps - * Each volume is created as an empty volume prior to starting the build - * process. Upon completion of the build, volumes and their contents are - * discarded. Global volume names and paths cannot conflict with the volumes - * defined a build step. - * Using a global volume in a build with only one step is not valid as - * it is indicative of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * Global list of volumes to mount for ALL build steps - * Each volume is created as an empty volume prior to starting the build - * process. Upon completion of the build, volumes and their contents are - * discarded. Global volume names and paths cannot conflict with the volumes - * defined a build step. - * Using a global volume in a build with only one step is not valid as - * it is indicative of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 14; - * @param array<\Google\Cloud\Build\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Volume::class); - $this->volumes = $arr; - - return $this; - } - - /** - * Optional. Option to specify how default logs buckets are setup. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.DefaultLogsBucketBehavior default_logs_bucket_behavior = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDefaultLogsBucketBehavior() - { - return $this->default_logs_bucket_behavior; - } - - /** - * Optional. Option to specify how default logs buckets are setup. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.DefaultLogsBucketBehavior default_logs_bucket_behavior = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDefaultLogsBucketBehavior($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\DefaultLogsBucketBehavior::class); - $this->default_logs_bucket_behavior = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/BuildOptions/DefaultLogsBucketBehavior.php b/Build/src/V1/BuildOptions/DefaultLogsBucketBehavior.php deleted file mode 100644 index 5287656a30fe..000000000000 --- a/Build/src/V1/BuildOptions/DefaultLogsBucketBehavior.php +++ /dev/null @@ -1,57 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.DefaultLogsBucketBehavior - */ -class DefaultLogsBucketBehavior -{ - /** - * Unspecified. - * - * Generated from protobuf enum DEFAULT_LOGS_BUCKET_BEHAVIOR_UNSPECIFIED = 0; - */ - const DEFAULT_LOGS_BUCKET_BEHAVIOR_UNSPECIFIED = 0; - /** - * Bucket is located in user-owned project in the same region as the - * build. The builder service account must have access to create and write - * to GCS buckets in the build project. - * - * Generated from protobuf enum REGIONAL_USER_OWNED_BUCKET = 1; - */ - const REGIONAL_USER_OWNED_BUCKET = 1; - - private static $valueToName = [ - self::DEFAULT_LOGS_BUCKET_BEHAVIOR_UNSPECIFIED => 'DEFAULT_LOGS_BUCKET_BEHAVIOR_UNSPECIFIED', - self::REGIONAL_USER_OWNED_BUCKET => 'REGIONAL_USER_OWNED_BUCKET', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildOptions/LogStreamingOption.php b/Build/src/V1/BuildOptions/LogStreamingOption.php deleted file mode 100644 index bdc75a019a42..000000000000 --- a/Build/src/V1/BuildOptions/LogStreamingOption.php +++ /dev/null @@ -1,63 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption - */ -class LogStreamingOption -{ - /** - * Service may automatically determine build log streaming behavior. - * - * Generated from protobuf enum STREAM_DEFAULT = 0; - */ - const STREAM_DEFAULT = 0; - /** - * Build logs should be streamed to Cloud Storage. - * - * Generated from protobuf enum STREAM_ON = 1; - */ - const STREAM_ON = 1; - /** - * Build logs should not be streamed to Cloud Storage; they will be - * written when the build is completed. - * - * Generated from protobuf enum STREAM_OFF = 2; - */ - const STREAM_OFF = 2; - - private static $valueToName = [ - self::STREAM_DEFAULT => 'STREAM_DEFAULT', - self::STREAM_ON => 'STREAM_ON', - self::STREAM_OFF => 'STREAM_OFF', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildOptions/LoggingMode.php b/Build/src/V1/BuildOptions/LoggingMode.php deleted file mode 100644 index 410395592eab..000000000000 --- a/Build/src/V1/BuildOptions/LoggingMode.php +++ /dev/null @@ -1,86 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.LoggingMode - */ -class LoggingMode -{ - /** - * The service determines the logging mode. The default is `LEGACY`. Do not - * rely on the default logging behavior as it may change in the future. - * - * Generated from protobuf enum LOGGING_UNSPECIFIED = 0; - */ - const LOGGING_UNSPECIFIED = 0; - /** - * Build logs are stored in Cloud Logging and Cloud Storage. - * - * Generated from protobuf enum LEGACY = 1; - */ - const LEGACY = 1; - /** - * Build logs are stored in Cloud Storage. - * - * Generated from protobuf enum GCS_ONLY = 2; - */ - const GCS_ONLY = 2; - /** - * This option is the same as CLOUD_LOGGING_ONLY. - * - * Generated from protobuf enum STACKDRIVER_ONLY = 3 [deprecated = true]; - */ - const STACKDRIVER_ONLY = 3; - /** - * Build logs are stored in Cloud Logging. Selecting this option will not - * allow [logs - * streaming](https://cloud.google.com/sdk/gcloud/reference/builds/log). - * - * Generated from protobuf enum CLOUD_LOGGING_ONLY = 5; - */ - const CLOUD_LOGGING_ONLY = 5; - /** - * Turn off all logging. No build logs will be captured. - * - * Generated from protobuf enum NONE = 4; - */ - const NONE = 4; - - private static $valueToName = [ - self::LOGGING_UNSPECIFIED => 'LOGGING_UNSPECIFIED', - self::LEGACY => 'LEGACY', - self::GCS_ONLY => 'GCS_ONLY', - self::STACKDRIVER_ONLY => 'STACKDRIVER_ONLY', - self::CLOUD_LOGGING_ONLY => 'CLOUD_LOGGING_ONLY', - self::NONE => 'NONE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildOptions/MachineType.php b/Build/src/V1/BuildOptions/MachineType.php deleted file mode 100644 index 95db95eb6ae8..000000000000 --- a/Build/src/V1/BuildOptions/MachineType.php +++ /dev/null @@ -1,85 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.MachineType - */ -class MachineType -{ - /** - * Standard machine type. - * - * Generated from protobuf enum UNSPECIFIED = 0; - */ - const UNSPECIFIED = 0; - /** - * Highcpu machine with 8 CPUs. - * - * Generated from protobuf enum N1_HIGHCPU_8 = 1; - */ - const N1_HIGHCPU_8 = 1; - /** - * Highcpu machine with 32 CPUs. - * - * Generated from protobuf enum N1_HIGHCPU_32 = 2; - */ - const N1_HIGHCPU_32 = 2; - /** - * Highcpu e2 machine with 8 CPUs. - * - * Generated from protobuf enum E2_HIGHCPU_8 = 5; - */ - const E2_HIGHCPU_8 = 5; - /** - * Highcpu e2 machine with 32 CPUs. - * - * Generated from protobuf enum E2_HIGHCPU_32 = 6; - */ - const E2_HIGHCPU_32 = 6; - /** - * E2 machine with 1 CPU. - * - * Generated from protobuf enum E2_MEDIUM = 7; - */ - const E2_MEDIUM = 7; - - private static $valueToName = [ - self::UNSPECIFIED => 'UNSPECIFIED', - self::N1_HIGHCPU_8 => 'N1_HIGHCPU_8', - self::N1_HIGHCPU_32 => 'N1_HIGHCPU_32', - self::E2_HIGHCPU_8 => 'E2_HIGHCPU_8', - self::E2_HIGHCPU_32 => 'E2_HIGHCPU_32', - self::E2_MEDIUM => 'E2_MEDIUM', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildOptions/PoolOption.php b/Build/src/V1/BuildOptions/PoolOption.php deleted file mode 100644 index 53e03fbf90b2..000000000000 --- a/Build/src/V1/BuildOptions/PoolOption.php +++ /dev/null @@ -1,83 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.PoolOption - */ -class PoolOption extends \Google\Protobuf\Internal\Message -{ - /** - * The `WorkerPool` resource to execute the build on. - * You must have `cloudbuild.workerpools.use` on the project hosting the - * WorkerPool. - * Format projects/{project}/locations/{location}/workerPools/{workerPoolId} - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The `WorkerPool` resource to execute the build on. - * You must have `cloudbuild.workerpools.use` on the project hosting the - * WorkerPool. - * Format projects/{project}/locations/{location}/workerPools/{workerPoolId} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The `WorkerPool` resource to execute the build on. - * You must have `cloudbuild.workerpools.use` on the project hosting the - * WorkerPool. - * Format projects/{project}/locations/{location}/workerPools/{workerPoolId} - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The `WorkerPool` resource to execute the build on. - * You must have `cloudbuild.workerpools.use` on the project hosting the - * WorkerPool. - * Format projects/{project}/locations/{location}/workerPools/{workerPoolId} - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/BuildOptions/SubstitutionOption.php b/Build/src/V1/BuildOptions/SubstitutionOption.php deleted file mode 100644 index c1746a028fde..000000000000 --- a/Build/src/V1/BuildOptions/SubstitutionOption.php +++ /dev/null @@ -1,56 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption - */ -class SubstitutionOption -{ - /** - * Fails the build if error in substitutions checks, like missing - * a substitution in the template or in the map. - * - * Generated from protobuf enum MUST_MATCH = 0; - */ - const MUST_MATCH = 0; - /** - * Do not fail the build if error in substitutions checks. - * - * Generated from protobuf enum ALLOW_LOOSE = 1; - */ - const ALLOW_LOOSE = 1; - - private static $valueToName = [ - self::MUST_MATCH => 'MUST_MATCH', - self::ALLOW_LOOSE => 'ALLOW_LOOSE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildOptions/VerifyOption.php b/Build/src/V1/BuildOptions/VerifyOption.php deleted file mode 100644 index 322bf3106320..000000000000 --- a/Build/src/V1/BuildOptions/VerifyOption.php +++ /dev/null @@ -1,61 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.VerifyOption - */ -class VerifyOption -{ - /** - * Not a verifiable build (the default). - * - * Generated from protobuf enum NOT_VERIFIED = 0; - */ - const NOT_VERIFIED = 0; - /** - * Build must be verified. - * - * Generated from protobuf enum VERIFIED = 1; - */ - const VERIFIED = 1; - - private static $valueToName = [ - self::NOT_VERIFIED => 'NOT_VERIFIED', - self::VERIFIED => 'VERIFIED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildStep.php b/Build/src/V1/BuildStep.php deleted file mode 100644 index 8f1fede51bc7..000000000000 --- a/Build/src/V1/BuildStep.php +++ /dev/null @@ -1,893 +0,0 @@ -google.devtools.cloudbuild.v1.BuildStep - */ -class BuildStep extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the container image that will run this particular - * build step. - * If the image is available in the host's Docker daemon's cache, it - * will be run directly. If not, the host will attempt to pull the image - * first, using the builder service account's credentials if necessary. - * The Docker daemon's cache will already have the latest versions of all of - * the officially supported build steps - * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - * The Docker daemon will also have cached many of the layers for some popular - * images, like "ubuntu", "debian", but they will be refreshed at the time you - * attempt to use them. - * If you built an image in a previous build step, it will be stored in the - * host's Docker daemon's cache and is available to use as the name for a - * later build step. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * A list of environment variable definitions to be used when running a step. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 2; - */ - private $env; - /** - * A list of arguments that will be presented to the step when it is started. - * If the image used to run the step's container has an entrypoint, the `args` - * are used as arguments to that entrypoint. If the image does not define - * an entrypoint, the first element in args is used as the entrypoint, - * and the remainder will be used as arguments. - * - * Generated from protobuf field repeated string args = 3; - */ - private $args; - /** - * Working directory to use when running this step's container. - * If this value is a relative path, it is relative to the build's working - * directory. If this value is absolute, it may be outside the build's working - * directory, in which case the contents of the path may not be persisted - * across build step executions, unless a `volume` for that path is specified. - * If the build specifies a `RepoSource` with `dir` and a step with a `dir`, - * which specifies an absolute path, the `RepoSource` `dir` is ignored for - * the step's execution. - * - * Generated from protobuf field string dir = 4; - */ - private $dir = ''; - /** - * Unique identifier for this build step, used in `wait_for` to - * reference this build step as a dependency. - * - * Generated from protobuf field string id = 5; - */ - private $id = ''; - /** - * The ID(s) of the step(s) that this build step depends on. - * This build step will not start until all the build steps in `wait_for` - * have completed successfully. If `wait_for` is empty, this build step will - * start when all previous build steps in the `Build.Steps` list have - * completed successfully. - * - * Generated from protobuf field repeated string wait_for = 6; - */ - private $wait_for; - /** - * Entrypoint to be used instead of the build step image's default entrypoint. - * If unset, the image's default entrypoint is used. - * - * Generated from protobuf field string entrypoint = 7; - */ - private $entrypoint = ''; - /** - * A list of environment variables which are encrypted using a Cloud Key - * Management Service crypto key. These values must be specified in the - * build's `Secret`. - * - * Generated from protobuf field repeated string secret_env = 8; - */ - private $secret_env; - /** - * List of volumes to mount into the build step. - * Each volume is created as an empty volume prior to execution of the - * build step. Upon completion of the build, volumes and their contents are - * discarded. - * Using a named volume in only one step is not valid as it is indicative - * of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 9; - */ - private $volumes; - /** - * Output only. Stores timing information for executing this build step. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $timing = null; - /** - * Output only. Stores timing information for pulling this build step's - * builder image only. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan pull_timing = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $pull_timing = null; - /** - * Time limit for executing this build step. If not defined, the step has no - * time limit and will be allowed to continue to run until either it completes - * or the build itself times out. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 11; - */ - private $timeout = null; - /** - * Output only. Status of the build step. At this time, build step status is - * only updated on build completion; step status is not updated in real-time - * as the build progresses. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status = 0; - /** - * Allow this build step to fail without failing the entire build. - * If false, the entire build will fail if this step fails. Otherwise, the - * build will succeed, but this step will still have a failure status. - * Error information will be reported in the failure_detail field. - * - * Generated from protobuf field bool allow_failure = 14; - */ - private $allow_failure = false; - /** - * Output only. Return code from running the step. - * - * Generated from protobuf field int32 exit_code = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $exit_code = 0; - /** - * Allow this build step to fail without failing the entire build if and - * only if the exit code is one of the specified codes. If allow_failure - * is also specified, this field will take precedence. - * - * Generated from protobuf field repeated int32 allow_exit_codes = 18; - */ - private $allow_exit_codes; - /** - * A shell script to be executed in the step. - * When script is provided, the user cannot specify the entrypoint or args. - * - * Generated from protobuf field string script = 19; - */ - private $script = ''; - /** - * Option to include built-in and custom substitutions as env variables - * for this build step. This option will override the global option - * in BuildOption. - * - * Generated from protobuf field optional bool automap_substitutions = 20; - */ - private $automap_substitutions = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the container image that will run this particular - * build step. - * If the image is available in the host's Docker daemon's cache, it - * will be run directly. If not, the host will attempt to pull the image - * first, using the builder service account's credentials if necessary. - * The Docker daemon's cache will already have the latest versions of all of - * the officially supported build steps - * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - * The Docker daemon will also have cached many of the layers for some popular - * images, like "ubuntu", "debian", but they will be refreshed at the time you - * attempt to use them. - * If you built an image in a previous build step, it will be stored in the - * host's Docker daemon's cache and is available to use as the name for a - * later build step. - * @type array|\Google\Protobuf\Internal\RepeatedField $env - * A list of environment variable definitions to be used when running a step. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * @type array|\Google\Protobuf\Internal\RepeatedField $args - * A list of arguments that will be presented to the step when it is started. - * If the image used to run the step's container has an entrypoint, the `args` - * are used as arguments to that entrypoint. If the image does not define - * an entrypoint, the first element in args is used as the entrypoint, - * and the remainder will be used as arguments. - * @type string $dir - * Working directory to use when running this step's container. - * If this value is a relative path, it is relative to the build's working - * directory. If this value is absolute, it may be outside the build's working - * directory, in which case the contents of the path may not be persisted - * across build step executions, unless a `volume` for that path is specified. - * If the build specifies a `RepoSource` with `dir` and a step with a `dir`, - * which specifies an absolute path, the `RepoSource` `dir` is ignored for - * the step's execution. - * @type string $id - * Unique identifier for this build step, used in `wait_for` to - * reference this build step as a dependency. - * @type array|\Google\Protobuf\Internal\RepeatedField $wait_for - * The ID(s) of the step(s) that this build step depends on. - * This build step will not start until all the build steps in `wait_for` - * have completed successfully. If `wait_for` is empty, this build step will - * start when all previous build steps in the `Build.Steps` list have - * completed successfully. - * @type string $entrypoint - * Entrypoint to be used instead of the build step image's default entrypoint. - * If unset, the image's default entrypoint is used. - * @type array|\Google\Protobuf\Internal\RepeatedField $secret_env - * A list of environment variables which are encrypted using a Cloud Key - * Management Service crypto key. These values must be specified in the - * build's `Secret`. - * @type array<\Google\Cloud\Build\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes - * List of volumes to mount into the build step. - * Each volume is created as an empty volume prior to execution of the - * build step. Upon completion of the build, volumes and their contents are - * discarded. - * Using a named volume in only one step is not valid as it is indicative - * of a build request with an incorrect configuration. - * @type \Google\Cloud\Build\V1\TimeSpan $timing - * Output only. Stores timing information for executing this build step. - * @type \Google\Cloud\Build\V1\TimeSpan $pull_timing - * Output only. Stores timing information for pulling this build step's - * builder image only. - * @type \Google\Protobuf\Duration $timeout - * Time limit for executing this build step. If not defined, the step has no - * time limit and will be allowed to continue to run until either it completes - * or the build itself times out. - * @type int $status - * Output only. Status of the build step. At this time, build step status is - * only updated on build completion; step status is not updated in real-time - * as the build progresses. - * @type bool $allow_failure - * Allow this build step to fail without failing the entire build. - * If false, the entire build will fail if this step fails. Otherwise, the - * build will succeed, but this step will still have a failure status. - * Error information will be reported in the failure_detail field. - * @type int $exit_code - * Output only. Return code from running the step. - * @type array|\Google\Protobuf\Internal\RepeatedField $allow_exit_codes - * Allow this build step to fail without failing the entire build if and - * only if the exit code is one of the specified codes. If allow_failure - * is also specified, this field will take precedence. - * @type string $script - * A shell script to be executed in the step. - * When script is provided, the user cannot specify the entrypoint or args. - * @type bool $automap_substitutions - * Option to include built-in and custom substitutions as env variables - * for this build step. This option will override the global option - * in BuildOption. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the container image that will run this particular - * build step. - * If the image is available in the host's Docker daemon's cache, it - * will be run directly. If not, the host will attempt to pull the image - * first, using the builder service account's credentials if necessary. - * The Docker daemon's cache will already have the latest versions of all of - * the officially supported build steps - * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - * The Docker daemon will also have cached many of the layers for some popular - * images, like "ubuntu", "debian", but they will be refreshed at the time you - * attempt to use them. - * If you built an image in a previous build step, it will be stored in the - * host's Docker daemon's cache and is available to use as the name for a - * later build step. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the container image that will run this particular - * build step. - * If the image is available in the host's Docker daemon's cache, it - * will be run directly. If not, the host will attempt to pull the image - * first, using the builder service account's credentials if necessary. - * The Docker daemon's cache will already have the latest versions of all of - * the officially supported build steps - * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - * The Docker daemon will also have cached many of the layers for some popular - * images, like "ubuntu", "debian", but they will be refreshed at the time you - * attempt to use them. - * If you built an image in a previous build step, it will be stored in the - * host's Docker daemon's cache and is available to use as the name for a - * later build step. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * A list of environment variable definitions to be used when running a step. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEnv() - { - return $this->env; - } - - /** - * A list of environment variable definitions to be used when running a step. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->env = $arr; - - return $this; - } - - /** - * A list of arguments that will be presented to the step when it is started. - * If the image used to run the step's container has an entrypoint, the `args` - * are used as arguments to that entrypoint. If the image does not define - * an entrypoint, the first element in args is used as the entrypoint, - * and the remainder will be used as arguments. - * - * Generated from protobuf field repeated string args = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getArgs() - { - return $this->args; - } - - /** - * A list of arguments that will be presented to the step when it is started. - * If the image used to run the step's container has an entrypoint, the `args` - * are used as arguments to that entrypoint. If the image does not define - * an entrypoint, the first element in args is used as the entrypoint, - * and the remainder will be used as arguments. - * - * Generated from protobuf field repeated string args = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setArgs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->args = $arr; - - return $this; - } - - /** - * Working directory to use when running this step's container. - * If this value is a relative path, it is relative to the build's working - * directory. If this value is absolute, it may be outside the build's working - * directory, in which case the contents of the path may not be persisted - * across build step executions, unless a `volume` for that path is specified. - * If the build specifies a `RepoSource` with `dir` and a step with a `dir`, - * which specifies an absolute path, the `RepoSource` `dir` is ignored for - * the step's execution. - * - * Generated from protobuf field string dir = 4; - * @return string - */ - public function getDir() - { - return $this->dir; - } - - /** - * Working directory to use when running this step's container. - * If this value is a relative path, it is relative to the build's working - * directory. If this value is absolute, it may be outside the build's working - * directory, in which case the contents of the path may not be persisted - * across build step executions, unless a `volume` for that path is specified. - * If the build specifies a `RepoSource` with `dir` and a step with a `dir`, - * which specifies an absolute path, the `RepoSource` `dir` is ignored for - * the step's execution. - * - * Generated from protobuf field string dir = 4; - * @param string $var - * @return $this - */ - public function setDir($var) - { - GPBUtil::checkString($var, True); - $this->dir = $var; - - return $this; - } - - /** - * Unique identifier for this build step, used in `wait_for` to - * reference this build step as a dependency. - * - * Generated from protobuf field string id = 5; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Unique identifier for this build step, used in `wait_for` to - * reference this build step as a dependency. - * - * Generated from protobuf field string id = 5; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * The ID(s) of the step(s) that this build step depends on. - * This build step will not start until all the build steps in `wait_for` - * have completed successfully. If `wait_for` is empty, this build step will - * start when all previous build steps in the `Build.Steps` list have - * completed successfully. - * - * Generated from protobuf field repeated string wait_for = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWaitFor() - { - return $this->wait_for; - } - - /** - * The ID(s) of the step(s) that this build step depends on. - * This build step will not start until all the build steps in `wait_for` - * have completed successfully. If `wait_for` is empty, this build step will - * start when all previous build steps in the `Build.Steps` list have - * completed successfully. - * - * Generated from protobuf field repeated string wait_for = 6; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWaitFor($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->wait_for = $arr; - - return $this; - } - - /** - * Entrypoint to be used instead of the build step image's default entrypoint. - * If unset, the image's default entrypoint is used. - * - * Generated from protobuf field string entrypoint = 7; - * @return string - */ - public function getEntrypoint() - { - return $this->entrypoint; - } - - /** - * Entrypoint to be used instead of the build step image's default entrypoint. - * If unset, the image's default entrypoint is used. - * - * Generated from protobuf field string entrypoint = 7; - * @param string $var - * @return $this - */ - public function setEntrypoint($var) - { - GPBUtil::checkString($var, True); - $this->entrypoint = $var; - - return $this; - } - - /** - * A list of environment variables which are encrypted using a Cloud Key - * Management Service crypto key. These values must be specified in the - * build's `Secret`. - * - * Generated from protobuf field repeated string secret_env = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecretEnv() - { - return $this->secret_env; - } - - /** - * A list of environment variables which are encrypted using a Cloud Key - * Management Service crypto key. These values must be specified in the - * build's `Secret`. - * - * Generated from protobuf field repeated string secret_env = 8; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecretEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->secret_env = $arr; - - return $this; - } - - /** - * List of volumes to mount into the build step. - * Each volume is created as an empty volume prior to execution of the - * build step. Upon completion of the build, volumes and their contents are - * discarded. - * Using a named volume in only one step is not valid as it is indicative - * of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * List of volumes to mount into the build step. - * Each volume is created as an empty volume prior to execution of the - * build step. Upon completion of the build, volumes and their contents are - * discarded. - * Using a named volume in only one step is not valid as it is indicative - * of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 9; - * @param array<\Google\Cloud\Build\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Volume::class); - $this->volumes = $arr; - - return $this; - } - - /** - * Output only. Stores timing information for executing this build step. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getTiming() - { - return $this->timing; - } - - public function hasTiming() - { - return isset($this->timing); - } - - public function clearTiming() - { - unset($this->timing); - } - - /** - * Output only. Stores timing information for executing this build step. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->timing = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pulling this build step's - * builder image only. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan pull_timing = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPullTiming() - { - return $this->pull_timing; - } - - public function hasPullTiming() - { - return isset($this->pull_timing); - } - - public function clearPullTiming() - { - unset($this->pull_timing); - } - - /** - * Output only. Stores timing information for pulling this build step's - * builder image only. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan pull_timing = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPullTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->pull_timing = $var; - - return $this; - } - - /** - * Time limit for executing this build step. If not defined, the step has no - * time limit and will be allowed to continue to run until either it completes - * or the build itself times out. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 11; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Time limit for executing this build step. If not defined, the step has no - * time limit and will be allowed to continue to run until either it completes - * or the build itself times out. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 11; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * Output only. Status of the build step. At this time, build step status is - * only updated on build completion; step status is not updated in real-time - * as the build progresses. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getStatus() - { - return $this->status; - } - - /** - * Output only. Status of the build step. At this time, build step status is - * only updated on build completion; step status is not updated in real-time - * as the build progresses. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Build\Status::class); - $this->status = $var; - - return $this; - } - - /** - * Allow this build step to fail without failing the entire build. - * If false, the entire build will fail if this step fails. Otherwise, the - * build will succeed, but this step will still have a failure status. - * Error information will be reported in the failure_detail field. - * - * Generated from protobuf field bool allow_failure = 14; - * @return bool - */ - public function getAllowFailure() - { - return $this->allow_failure; - } - - /** - * Allow this build step to fail without failing the entire build. - * If false, the entire build will fail if this step fails. Otherwise, the - * build will succeed, but this step will still have a failure status. - * Error information will be reported in the failure_detail field. - * - * Generated from protobuf field bool allow_failure = 14; - * @param bool $var - * @return $this - */ - public function setAllowFailure($var) - { - GPBUtil::checkBool($var); - $this->allow_failure = $var; - - return $this; - } - - /** - * Output only. Return code from running the step. - * - * Generated from protobuf field int32 exit_code = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getExitCode() - { - return $this->exit_code; - } - - /** - * Output only. Return code from running the step. - * - * Generated from protobuf field int32 exit_code = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setExitCode($var) - { - GPBUtil::checkInt32($var); - $this->exit_code = $var; - - return $this; - } - - /** - * Allow this build step to fail without failing the entire build if and - * only if the exit code is one of the specified codes. If allow_failure - * is also specified, this field will take precedence. - * - * Generated from protobuf field repeated int32 allow_exit_codes = 18; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowExitCodes() - { - return $this->allow_exit_codes; - } - - /** - * Allow this build step to fail without failing the entire build if and - * only if the exit code is one of the specified codes. If allow_failure - * is also specified, this field will take precedence. - * - * Generated from protobuf field repeated int32 allow_exit_codes = 18; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowExitCodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->allow_exit_codes = $arr; - - return $this; - } - - /** - * A shell script to be executed in the step. - * When script is provided, the user cannot specify the entrypoint or args. - * - * Generated from protobuf field string script = 19; - * @return string - */ - public function getScript() - { - return $this->script; - } - - /** - * A shell script to be executed in the step. - * When script is provided, the user cannot specify the entrypoint or args. - * - * Generated from protobuf field string script = 19; - * @param string $var - * @return $this - */ - public function setScript($var) - { - GPBUtil::checkString($var, True); - $this->script = $var; - - return $this; - } - - /** - * Option to include built-in and custom substitutions as env variables - * for this build step. This option will override the global option - * in BuildOption. - * - * Generated from protobuf field optional bool automap_substitutions = 20; - * @return bool - */ - public function getAutomapSubstitutions() - { - return isset($this->automap_substitutions) ? $this->automap_substitutions : false; - } - - public function hasAutomapSubstitutions() - { - return isset($this->automap_substitutions); - } - - public function clearAutomapSubstitutions() - { - unset($this->automap_substitutions); - } - - /** - * Option to include built-in and custom substitutions as env variables - * for this build step. This option will override the global option - * in BuildOption. - * - * Generated from protobuf field optional bool automap_substitutions = 20; - * @param bool $var - * @return $this - */ - public function setAutomapSubstitutions($var) - { - GPBUtil::checkBool($var); - $this->automap_substitutions = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/BuildTrigger.php b/Build/src/V1/BuildTrigger.php deleted file mode 100644 index 88d9556e4ddb..000000000000 --- a/Build/src/V1/BuildTrigger.php +++ /dev/null @@ -1,1026 +0,0 @@ -google.devtools.cloudbuild.v1.BuildTrigger - */ -class BuildTrigger extends \Google\Protobuf\Internal\Message -{ - /** - * The `Trigger` name with format: - * `projects/{project}/locations/{location}/triggers/{trigger}`, where - * {trigger} is a unique identifier generated by the service. - * - * Generated from protobuf field string resource_name = 34; - */ - private $resource_name = ''; - /** - * Output only. Unique identifier of the trigger. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $id = ''; - /** - * Human-readable description of this trigger. - * - * Generated from protobuf field string description = 10; - */ - private $description = ''; - /** - * User-assigned name of the trigger. Must be unique within the project. - * Trigger names must meet the following requirements: - * + They must contain only alphanumeric characters and dashes. - * + They can be 1-64 characters long. - * + They must begin and end with an alphanumeric character. - * - * Generated from protobuf field string name = 21; - */ - private $name = ''; - /** - * Tags for annotation of a `BuildTrigger` - * - * Generated from protobuf field repeated string tags = 19; - */ - private $tags; - /** - * Template describing the types of source changes to trigger a build. - * Branch and tag names in trigger templates are interpreted as regular - * expressions. Any branch or tag change that matches that regular expression - * will trigger a build. - * Mutually exclusive with `github`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource trigger_template = 7; - */ - private $trigger_template = null; - /** - * GitHubEventsConfig describes the configuration of a trigger that creates - * a build whenever a GitHub event is received. - * Mutually exclusive with `trigger_template`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEventsConfig github = 13; - */ - private $github = null; - /** - * PubsubConfig describes the configuration of a trigger that - * creates a build whenever a Pub/Sub message is published. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29; - */ - private $pubsub_config = null; - /** - * WebhookConfig describes the configuration of a trigger that - * creates a build whenever a webhook is sent to a trigger's webhook URL. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig webhook_config = 31; - */ - private $webhook_config = null; - /** - * Output only. Time when the trigger was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * If true, the trigger will never automatically execute a build. - * - * Generated from protobuf field bool disabled = 9; - */ - private $disabled = false; - /** - * Substitutions for Build resource. The keys must match the following - * regular expression: `^_[A-Z0-9_]+$`. - * - * Generated from protobuf field map substitutions = 11; - */ - private $substitutions; - /** - * ignored_files and included_files are file glob matches using - * https://golang.org/pkg/path/filepath/#Match extended with support for "**". - * If ignored_files and changed files are both empty, then they are - * not used to determine whether or not to trigger a build. - * If ignored_files is not empty, then we ignore any files that match - * any of the ignored_file globs. If the change has no files that are - * outside of the ignored_files globs, then we do not trigger a build. - * - * Generated from protobuf field repeated string ignored_files = 15; - */ - private $ignored_files; - /** - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is empty, then as far as this filter is - * concerned, we should trigger the build. - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is not empty, then we make sure that at - * least one of those files matches a included_files glob. If not, - * then we do not trigger a build. - * - * Generated from protobuf field repeated string included_files = 16; - */ - private $included_files; - /** - * Optional. A Common Expression Language string. - * - * Generated from protobuf field string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * The repo and ref of the repository from which to build. This field - * is used only for those triggers that do not respond to SCM events. - * Triggers that respond to such events build source at whatever commit - * caused the event. - * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron - * triggers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitRepoSource source_to_build = 26; - */ - private $source_to_build = null; - /** - * The service account used for all user-controlled operations including - * UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. - * If no service account is set, then the standard Cloud Build service account - * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. - * Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` - * - * Generated from protobuf field string service_account = 33 [(.google.api.resource_reference) = { - */ - private $service_account = ''; - /** - * The configuration of a trigger that creates a build whenever an event from - * Repo API is received. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig repository_event_config = 39; - */ - private $repository_event_config = null; - protected $build_template; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource_name - * The `Trigger` name with format: - * `projects/{project}/locations/{location}/triggers/{trigger}`, where - * {trigger} is a unique identifier generated by the service. - * @type string $id - * Output only. Unique identifier of the trigger. - * @type string $description - * Human-readable description of this trigger. - * @type string $name - * User-assigned name of the trigger. Must be unique within the project. - * Trigger names must meet the following requirements: - * + They must contain only alphanumeric characters and dashes. - * + They can be 1-64 characters long. - * + They must begin and end with an alphanumeric character. - * @type array|\Google\Protobuf\Internal\RepeatedField $tags - * Tags for annotation of a `BuildTrigger` - * @type \Google\Cloud\Build\V1\RepoSource $trigger_template - * Template describing the types of source changes to trigger a build. - * Branch and tag names in trigger templates are interpreted as regular - * expressions. Any branch or tag change that matches that regular expression - * will trigger a build. - * Mutually exclusive with `github`. - * @type \Google\Cloud\Build\V1\GitHubEventsConfig $github - * GitHubEventsConfig describes the configuration of a trigger that creates - * a build whenever a GitHub event is received. - * Mutually exclusive with `trigger_template`. - * @type \Google\Cloud\Build\V1\PubsubConfig $pubsub_config - * PubsubConfig describes the configuration of a trigger that - * creates a build whenever a Pub/Sub message is published. - * @type \Google\Cloud\Build\V1\WebhookConfig $webhook_config - * WebhookConfig describes the configuration of a trigger that - * creates a build whenever a webhook is sent to a trigger's webhook URL. - * @type bool $autodetect - * Autodetect build configuration. The following precedence is used (case - * insensitive): - * 1. cloudbuild.yaml - * 2. cloudbuild.yml - * 3. cloudbuild.json - * 4. Dockerfile - * Currently only available for GitHub App Triggers. - * @type \Google\Cloud\Build\V1\Build $build - * Contents of the build template. - * @type string $filename - * Path, from the source root, to the build configuration file - * (i.e. cloudbuild.yaml). - * @type \Google\Cloud\Build\V1\GitFileSource $git_file_source - * The file source describing the local or remote Build template. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Time when the trigger was created. - * @type bool $disabled - * If true, the trigger will never automatically execute a build. - * @type array|\Google\Protobuf\Internal\MapField $substitutions - * Substitutions for Build resource. The keys must match the following - * regular expression: `^_[A-Z0-9_]+$`. - * @type array|\Google\Protobuf\Internal\RepeatedField $ignored_files - * ignored_files and included_files are file glob matches using - * https://golang.org/pkg/path/filepath/#Match extended with support for "**". - * If ignored_files and changed files are both empty, then they are - * not used to determine whether or not to trigger a build. - * If ignored_files is not empty, then we ignore any files that match - * any of the ignored_file globs. If the change has no files that are - * outside of the ignored_files globs, then we do not trigger a build. - * @type array|\Google\Protobuf\Internal\RepeatedField $included_files - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is empty, then as far as this filter is - * concerned, we should trigger the build. - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is not empty, then we make sure that at - * least one of those files matches a included_files glob. If not, - * then we do not trigger a build. - * @type string $filter - * Optional. A Common Expression Language string. - * @type \Google\Cloud\Build\V1\GitRepoSource $source_to_build - * The repo and ref of the repository from which to build. This field - * is used only for those triggers that do not respond to SCM events. - * Triggers that respond to such events build source at whatever commit - * caused the event. - * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron - * triggers. - * @type string $service_account - * The service account used for all user-controlled operations including - * UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. - * If no service account is set, then the standard Cloud Build service account - * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. - * Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` - * @type \Google\Cloud\Build\V1\RepositoryEventConfig $repository_event_config - * The configuration of a trigger that creates a build whenever an event from - * Repo API is received. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The `Trigger` name with format: - * `projects/{project}/locations/{location}/triggers/{trigger}`, where - * {trigger} is a unique identifier generated by the service. - * - * Generated from protobuf field string resource_name = 34; - * @return string - */ - public function getResourceName() - { - return $this->resource_name; - } - - /** - * The `Trigger` name with format: - * `projects/{project}/locations/{location}/triggers/{trigger}`, where - * {trigger} is a unique identifier generated by the service. - * - * Generated from protobuf field string resource_name = 34; - * @param string $var - * @return $this - */ - public function setResourceName($var) - { - GPBUtil::checkString($var, True); - $this->resource_name = $var; - - return $this; - } - - /** - * Output only. Unique identifier of the trigger. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Output only. Unique identifier of the trigger. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Human-readable description of this trigger. - * - * Generated from protobuf field string description = 10; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Human-readable description of this trigger. - * - * Generated from protobuf field string description = 10; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * User-assigned name of the trigger. Must be unique within the project. - * Trigger names must meet the following requirements: - * + They must contain only alphanumeric characters and dashes. - * + They can be 1-64 characters long. - * + They must begin and end with an alphanumeric character. - * - * Generated from protobuf field string name = 21; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * User-assigned name of the trigger. Must be unique within the project. - * Trigger names must meet the following requirements: - * + They must contain only alphanumeric characters and dashes. - * + They can be 1-64 characters long. - * + They must begin and end with an alphanumeric character. - * - * Generated from protobuf field string name = 21; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Tags for annotation of a `BuildTrigger` - * - * Generated from protobuf field repeated string tags = 19; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTags() - { - return $this->tags; - } - - /** - * Tags for annotation of a `BuildTrigger` - * - * Generated from protobuf field repeated string tags = 19; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->tags = $arr; - - return $this; - } - - /** - * Template describing the types of source changes to trigger a build. - * Branch and tag names in trigger templates are interpreted as regular - * expressions. Any branch or tag change that matches that regular expression - * will trigger a build. - * Mutually exclusive with `github`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource trigger_template = 7; - * @return \Google\Cloud\Build\V1\RepoSource|null - */ - public function getTriggerTemplate() - { - return $this->trigger_template; - } - - public function hasTriggerTemplate() - { - return isset($this->trigger_template); - } - - public function clearTriggerTemplate() - { - unset($this->trigger_template); - } - - /** - * Template describing the types of source changes to trigger a build. - * Branch and tag names in trigger templates are interpreted as regular - * expressions. Any branch or tag change that matches that regular expression - * will trigger a build. - * Mutually exclusive with `github`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource trigger_template = 7; - * @param \Google\Cloud\Build\V1\RepoSource $var - * @return $this - */ - public function setTriggerTemplate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepoSource::class); - $this->trigger_template = $var; - - return $this; - } - - /** - * GitHubEventsConfig describes the configuration of a trigger that creates - * a build whenever a GitHub event is received. - * Mutually exclusive with `trigger_template`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEventsConfig github = 13; - * @return \Google\Cloud\Build\V1\GitHubEventsConfig|null - */ - public function getGithub() - { - return $this->github; - } - - public function hasGithub() - { - return isset($this->github); - } - - public function clearGithub() - { - unset($this->github); - } - - /** - * GitHubEventsConfig describes the configuration of a trigger that creates - * a build whenever a GitHub event is received. - * Mutually exclusive with `trigger_template`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEventsConfig github = 13; - * @param \Google\Cloud\Build\V1\GitHubEventsConfig $var - * @return $this - */ - public function setGithub($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitHubEventsConfig::class); - $this->github = $var; - - return $this; - } - - /** - * PubsubConfig describes the configuration of a trigger that - * creates a build whenever a Pub/Sub message is published. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29; - * @return \Google\Cloud\Build\V1\PubsubConfig|null - */ - public function getPubsubConfig() - { - return $this->pubsub_config; - } - - public function hasPubsubConfig() - { - return isset($this->pubsub_config); - } - - public function clearPubsubConfig() - { - unset($this->pubsub_config); - } - - /** - * PubsubConfig describes the configuration of a trigger that - * creates a build whenever a Pub/Sub message is published. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29; - * @param \Google\Cloud\Build\V1\PubsubConfig $var - * @return $this - */ - public function setPubsubConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PubsubConfig::class); - $this->pubsub_config = $var; - - return $this; - } - - /** - * WebhookConfig describes the configuration of a trigger that - * creates a build whenever a webhook is sent to a trigger's webhook URL. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig webhook_config = 31; - * @return \Google\Cloud\Build\V1\WebhookConfig|null - */ - public function getWebhookConfig() - { - return $this->webhook_config; - } - - public function hasWebhookConfig() - { - return isset($this->webhook_config); - } - - public function clearWebhookConfig() - { - unset($this->webhook_config); - } - - /** - * WebhookConfig describes the configuration of a trigger that - * creates a build whenever a webhook is sent to a trigger's webhook URL. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig webhook_config = 31; - * @param \Google\Cloud\Build\V1\WebhookConfig $var - * @return $this - */ - public function setWebhookConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\WebhookConfig::class); - $this->webhook_config = $var; - - return $this; - } - - /** - * Autodetect build configuration. The following precedence is used (case - * insensitive): - * 1. cloudbuild.yaml - * 2. cloudbuild.yml - * 3. cloudbuild.json - * 4. Dockerfile - * Currently only available for GitHub App Triggers. - * - * Generated from protobuf field bool autodetect = 18; - * @return bool - */ - public function getAutodetect() - { - return $this->readOneof(18); - } - - public function hasAutodetect() - { - return $this->hasOneof(18); - } - - /** - * Autodetect build configuration. The following precedence is used (case - * insensitive): - * 1. cloudbuild.yaml - * 2. cloudbuild.yml - * 3. cloudbuild.json - * 4. Dockerfile - * Currently only available for GitHub App Triggers. - * - * Generated from protobuf field bool autodetect = 18; - * @param bool $var - * @return $this - */ - public function setAutodetect($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(18, $var); - - return $this; - } - - /** - * Contents of the build template. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 4; - * @return \Google\Cloud\Build\V1\Build|null - */ - public function getBuild() - { - return $this->readOneof(4); - } - - public function hasBuild() - { - return $this->hasOneof(4); - } - - /** - * Contents of the build template. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 4; - * @param \Google\Cloud\Build\V1\Build $var - * @return $this - */ - public function setBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Build::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Path, from the source root, to the build configuration file - * (i.e. cloudbuild.yaml). - * - * Generated from protobuf field string filename = 8; - * @return string - */ - public function getFilename() - { - return $this->readOneof(8); - } - - public function hasFilename() - { - return $this->hasOneof(8); - } - - /** - * Path, from the source root, to the build configuration file - * (i.e. cloudbuild.yaml). - * - * Generated from protobuf field string filename = 8; - * @param string $var - * @return $this - */ - public function setFilename($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * The file source describing the local or remote Build template. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource git_file_source = 24; - * @return \Google\Cloud\Build\V1\GitFileSource|null - */ - public function getGitFileSource() - { - return $this->readOneof(24); - } - - public function hasGitFileSource() - { - return $this->hasOneof(24); - } - - /** - * The file source describing the local or remote Build template. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource git_file_source = 24; - * @param \Google\Cloud\Build\V1\GitFileSource $var - * @return $this - */ - public function setGitFileSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitFileSource::class); - $this->writeOneof(24, $var); - - return $this; - } - - /** - * Output only. Time when the trigger was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Time when the trigger was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * If true, the trigger will never automatically execute a build. - * - * Generated from protobuf field bool disabled = 9; - * @return bool - */ - public function getDisabled() - { - return $this->disabled; - } - - /** - * If true, the trigger will never automatically execute a build. - * - * Generated from protobuf field bool disabled = 9; - * @param bool $var - * @return $this - */ - public function setDisabled($var) - { - GPBUtil::checkBool($var); - $this->disabled = $var; - - return $this; - } - - /** - * Substitutions for Build resource. The keys must match the following - * regular expression: `^_[A-Z0-9_]+$`. - * - * Generated from protobuf field map substitutions = 11; - * @return \Google\Protobuf\Internal\MapField - */ - public function getSubstitutions() - { - return $this->substitutions; - } - - /** - * Substitutions for Build resource. The keys must match the following - * regular expression: `^_[A-Z0-9_]+$`. - * - * Generated from protobuf field map substitutions = 11; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setSubstitutions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->substitutions = $arr; - - return $this; - } - - /** - * ignored_files and included_files are file glob matches using - * https://golang.org/pkg/path/filepath/#Match extended with support for "**". - * If ignored_files and changed files are both empty, then they are - * not used to determine whether or not to trigger a build. - * If ignored_files is not empty, then we ignore any files that match - * any of the ignored_file globs. If the change has no files that are - * outside of the ignored_files globs, then we do not trigger a build. - * - * Generated from protobuf field repeated string ignored_files = 15; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIgnoredFiles() - { - return $this->ignored_files; - } - - /** - * ignored_files and included_files are file glob matches using - * https://golang.org/pkg/path/filepath/#Match extended with support for "**". - * If ignored_files and changed files are both empty, then they are - * not used to determine whether or not to trigger a build. - * If ignored_files is not empty, then we ignore any files that match - * any of the ignored_file globs. If the change has no files that are - * outside of the ignored_files globs, then we do not trigger a build. - * - * Generated from protobuf field repeated string ignored_files = 15; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIgnoredFiles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ignored_files = $arr; - - return $this; - } - - /** - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is empty, then as far as this filter is - * concerned, we should trigger the build. - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is not empty, then we make sure that at - * least one of those files matches a included_files glob. If not, - * then we do not trigger a build. - * - * Generated from protobuf field repeated string included_files = 16; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIncludedFiles() - { - return $this->included_files; - } - - /** - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is empty, then as far as this filter is - * concerned, we should trigger the build. - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is not empty, then we make sure that at - * least one of those files matches a included_files glob. If not, - * then we do not trigger a build. - * - * Generated from protobuf field repeated string included_files = 16; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIncludedFiles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->included_files = $arr; - - return $this; - } - - /** - * Optional. A Common Expression Language string. - * - * Generated from protobuf field string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. A Common Expression Language string. - * - * Generated from protobuf field string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The repo and ref of the repository from which to build. This field - * is used only for those triggers that do not respond to SCM events. - * Triggers that respond to such events build source at whatever commit - * caused the event. - * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron - * triggers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitRepoSource source_to_build = 26; - * @return \Google\Cloud\Build\V1\GitRepoSource|null - */ - public function getSourceToBuild() - { - return $this->source_to_build; - } - - public function hasSourceToBuild() - { - return isset($this->source_to_build); - } - - public function clearSourceToBuild() - { - unset($this->source_to_build); - } - - /** - * The repo and ref of the repository from which to build. This field - * is used only for those triggers that do not respond to SCM events. - * Triggers that respond to such events build source at whatever commit - * caused the event. - * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron - * triggers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitRepoSource source_to_build = 26; - * @param \Google\Cloud\Build\V1\GitRepoSource $var - * @return $this - */ - public function setSourceToBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitRepoSource::class); - $this->source_to_build = $var; - - return $this; - } - - /** - * The service account used for all user-controlled operations including - * UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. - * If no service account is set, then the standard Cloud Build service account - * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. - * Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` - * - * Generated from protobuf field string service_account = 33 [(.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * The service account used for all user-controlled operations including - * UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. - * If no service account is set, then the standard Cloud Build service account - * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. - * Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` - * - * Generated from protobuf field string service_account = 33 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * The configuration of a trigger that creates a build whenever an event from - * Repo API is received. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig repository_event_config = 39; - * @return \Google\Cloud\Build\V1\RepositoryEventConfig|null - */ - public function getRepositoryEventConfig() - { - return $this->repository_event_config; - } - - public function hasRepositoryEventConfig() - { - return isset($this->repository_event_config); - } - - public function clearRepositoryEventConfig() - { - unset($this->repository_event_config); - } - - /** - * The configuration of a trigger that creates a build whenever an event from - * Repo API is received. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig repository_event_config = 39; - * @param \Google\Cloud\Build\V1\RepositoryEventConfig $var - * @return $this - */ - public function setRepositoryEventConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepositoryEventConfig::class); - $this->repository_event_config = $var; - - return $this; - } - - /** - * @return string - */ - public function getBuildTemplate() - { - return $this->whichOneof("build_template"); - } - -} - diff --git a/Build/src/V1/BuiltImage.php b/Build/src/V1/BuiltImage.php deleted file mode 100644 index 31607e2e6e78..000000000000 --- a/Build/src/V1/BuiltImage.php +++ /dev/null @@ -1,149 +0,0 @@ -google.devtools.cloudbuild.v1.BuiltImage - */ -class BuiltImage extends \Google\Protobuf\Internal\Message -{ - /** - * Name used to push the container image to Google Container Registry, as - * presented to `docker push`. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Docker Registry 2.0 digest. - * - * Generated from protobuf field string digest = 3; - */ - private $digest = ''; - /** - * Output only. Stores timing information for pushing the specified image. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $push_timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name used to push the container image to Google Container Registry, as - * presented to `docker push`. - * @type string $digest - * Docker Registry 2.0 digest. - * @type \Google\Cloud\Build\V1\TimeSpan $push_timing - * Output only. Stores timing information for pushing the specified image. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Name used to push the container image to Google Container Registry, as - * presented to `docker push`. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name used to push the container image to Google Container Registry, as - * presented to `docker push`. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Docker Registry 2.0 digest. - * - * Generated from protobuf field string digest = 3; - * @return string - */ - public function getDigest() - { - return $this->digest; - } - - /** - * Docker Registry 2.0 digest. - * - * Generated from protobuf field string digest = 3; - * @param string $var - * @return $this - */ - public function setDigest($var) - { - GPBUtil::checkString($var, True); - $this->digest = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pushing the specified image. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPushTiming() - { - return $this->push_timing; - } - - public function hasPushTiming() - { - return isset($this->push_timing); - } - - public function clearPushTiming() - { - unset($this->push_timing); - } - - /** - * Output only. Stores timing information for pushing the specified image. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPushTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->push_timing = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CancelBuildRequest.php b/Build/src/V1/CancelBuildRequest.php deleted file mode 100644 index 60a55c83b240..000000000000 --- a/Build/src/V1/CancelBuildRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.CancelBuildRequest - */ -class CancelBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @type string $project_id - * Required. ID of the project. - * @type string $id - * Required. ID of the build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CloudBuildClient.php b/Build/src/V1/CloudBuildClient.php deleted file mode 100644 index f5ea759ea154..000000000000 --- a/Build/src/V1/CloudBuildClient.php +++ /dev/null @@ -1,34 +0,0 @@ -google.devtools.cloudbuild.v1.CreateBuildRequest - */ -class CreateBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. Build resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $build = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * @type string $project_id - * Required. ID of the project. - * @type \Google\Cloud\Build\V1\Build $build - * Required. Build resource to create. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. Build resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\Build|null - */ - public function getBuild() - { - return $this->build; - } - - public function hasBuild() - { - return isset($this->build); - } - - public function clearBuild() - { - unset($this->build); - } - - /** - * Required. Build resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\Build $var - * @return $this - */ - public function setBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Build::class); - $this->build = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CreateBuildTriggerRequest.php b/Build/src/V1/CreateBuildTriggerRequest.php deleted file mode 100644 index 15fed4962d3d..000000000000 --- a/Build/src/V1/CreateBuildTriggerRequest.php +++ /dev/null @@ -1,149 +0,0 @@ -google.devtools.cloudbuild.v1.CreateBuildTriggerRequest - */ -class CreateBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 3 [(.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. ID of the project for which to configure automatic builds. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. `BuildTrigger` to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * @type string $project_id - * Required. ID of the project for which to configure automatic builds. - * @type \Google\Cloud\Build\V1\BuildTrigger $trigger - * Required. `BuildTrigger` to create. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 3 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. ID of the project for which to configure automatic builds. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project for which to configure automatic builds. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. `BuildTrigger` to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\BuildTrigger|null - */ - public function getTrigger() - { - return $this->trigger; - } - - public function hasTrigger() - { - return isset($this->trigger); - } - - public function clearTrigger() - { - unset($this->trigger); - } - - /** - * Required. `BuildTrigger` to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\BuildTrigger $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildTrigger::class); - $this->trigger = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CreateWorkerPoolOperationMetadata.php b/Build/src/V1/CreateWorkerPoolOperationMetadata.php deleted file mode 100644 index aa01956699e4..000000000000 --- a/Build/src/V1/CreateWorkerPoolOperationMetadata.php +++ /dev/null @@ -1,163 +0,0 @@ -google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata - */ -class CreateWorkerPoolOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the `WorkerPool` to create. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - */ - private $worker_pool = ''; - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - */ - private $create_time = null; - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - */ - private $complete_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $worker_pool - * The resource name of the `WorkerPool` to create. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * @type \Google\Protobuf\Timestamp $create_time - * Time the operation was created. - * @type \Google\Protobuf\Timestamp $complete_time - * Time the operation was completed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the `WorkerPool` to create. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - /** - * The resource name of the `WorkerPool` to create. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkString($var, True); - $this->worker_pool = $var; - - return $this; - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCompleteTime() - { - return $this->complete_time; - } - - public function hasCompleteTime() - { - return isset($this->complete_time); - } - - public function clearCompleteTime() - { - unset($this->complete_time); - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCompleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->complete_time = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CreateWorkerPoolRequest.php b/Build/src/V1/CreateWorkerPoolRequest.php deleted file mode 100644 index 3f7f3326373c..000000000000 --- a/Build/src/V1/CreateWorkerPoolRequest.php +++ /dev/null @@ -1,199 +0,0 @@ -google.devtools.cloudbuild.v1.CreateWorkerPoolRequest - */ -class CreateWorkerPoolRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. `WorkerPool` resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $worker_pool = null; - /** - * Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * - * Generated from protobuf field string worker_pool_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - */ - private $worker_pool_id = ''; - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - */ - private $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * @type \Google\Cloud\Build\V1\WorkerPool $worker_pool - * Required. `WorkerPool` resource to create. - * @type string $worker_pool_id - * Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * @type bool $validate_only - * If set, validate the request and preview the response, but do not actually - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. `WorkerPool` resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\WorkerPool|null - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - public function hasWorkerPool() - { - return isset($this->worker_pool); - } - - public function clearWorkerPool() - { - unset($this->worker_pool); - } - - /** - * Required. `WorkerPool` resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\WorkerPool $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\WorkerPool::class); - $this->worker_pool = $var; - - return $this; - } - - /** - * Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * - * Generated from protobuf field string worker_pool_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getWorkerPoolId() - { - return $this->worker_pool_id; - } - - /** - * Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * - * Generated from protobuf field string worker_pool_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setWorkerPoolId($var) - { - GPBUtil::checkString($var, True); - $this->worker_pool_id = $var; - - return $this; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/DeleteBuildTriggerRequest.php b/Build/src/V1/DeleteBuildTriggerRequest.php deleted file mode 100644 index 2fb63fedc9bc..000000000000 --- a/Build/src/V1/DeleteBuildTriggerRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest - */ -class DeleteBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the `BuildTrigger` to delete. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type string $project_id - * Required. ID of the project that owns the trigger. - * @type string $trigger_id - * Required. ID of the `BuildTrigger` to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the `BuildTrigger` to delete. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTriggerId() - { - return $this->trigger_id; - } - - /** - * Required. ID of the `BuildTrigger` to delete. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->trigger_id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/DeleteWorkerPoolOperationMetadata.php b/Build/src/V1/DeleteWorkerPoolOperationMetadata.php deleted file mode 100644 index 88c128334bd7..000000000000 --- a/Build/src/V1/DeleteWorkerPoolOperationMetadata.php +++ /dev/null @@ -1,163 +0,0 @@ -google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata - */ -class DeleteWorkerPoolOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the `WorkerPool` being deleted. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - */ - private $worker_pool = ''; - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - */ - private $create_time = null; - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - */ - private $complete_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $worker_pool - * The resource name of the `WorkerPool` being deleted. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * @type \Google\Protobuf\Timestamp $create_time - * Time the operation was created. - * @type \Google\Protobuf\Timestamp $complete_time - * Time the operation was completed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the `WorkerPool` being deleted. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - /** - * The resource name of the `WorkerPool` being deleted. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkString($var, True); - $this->worker_pool = $var; - - return $this; - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCompleteTime() - { - return $this->complete_time; - } - - public function hasCompleteTime() - { - return isset($this->complete_time); - } - - public function clearCompleteTime() - { - unset($this->complete_time); - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCompleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->complete_time = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/DeleteWorkerPoolRequest.php b/Build/src/V1/DeleteWorkerPoolRequest.php deleted file mode 100644 index 053ab7401b92..000000000000 --- a/Build/src/V1/DeleteWorkerPoolRequest.php +++ /dev/null @@ -1,189 +0,0 @@ -google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest - */ -class DeleteWorkerPoolRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $etag = ''; - /** - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * - * Generated from protobuf field bool allow_missing = 3; - */ - private $allow_missing = false; - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - */ - private $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @type string $etag - * Optional. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * @type bool $allow_missing - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * @type bool $validate_only - * If set, validate the request and preview the response, but do not actually - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * - * Generated from protobuf field bool allow_missing = 3; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * - * Generated from protobuf field bool allow_missing = 3; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/FileHashes.php b/Build/src/V1/FileHashes.php deleted file mode 100644 index 044ed6721551..000000000000 --- a/Build/src/V1/FileHashes.php +++ /dev/null @@ -1,68 +0,0 @@ -google.devtools.cloudbuild.v1.FileHashes - */ -class FileHashes extends \Google\Protobuf\Internal\Message -{ - /** - * Collection of file hashes. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash file_hash = 1; - */ - private $file_hash; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\Hash>|\Google\Protobuf\Internal\RepeatedField $file_hash - * Collection of file hashes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Collection of file hashes. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash file_hash = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFileHash() - { - return $this->file_hash; - } - - /** - * Collection of file hashes. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash file_hash = 1; - * @param array<\Google\Cloud\Build\V1\Hash>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFileHash($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Hash::class); - $this->file_hash = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/Gapic/CloudBuildGapicClient.php b/Build/src/V1/Gapic/CloudBuildGapicClient.php deleted file mode 100644 index c1c1bbf135a8..000000000000 --- a/Build/src/V1/Gapic/CloudBuildGapicClient.php +++ /dev/null @@ -1,2136 +0,0 @@ -approveBuild($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudBuildClient->approveBuild($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'approveBuild'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated This class will be removed in the next major version update. - */ -class CloudBuildGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.devtools.cloudbuild.v1.CloudBuild'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudbuild.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudbuild.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $buildNameTemplate; - - private static $buildTriggerNameTemplate; - - private static $cryptoKeyNameTemplate; - - private static $githubEnterpriseConfigNameTemplate; - - private static $locationNameTemplate; - - private static $networkNameTemplate; - - private static $projectNameTemplate; - - private static $projectBuildNameTemplate; - - private static $projectConfigNameTemplate; - - private static $projectLocationBuildNameTemplate; - - private static $projectLocationConfigNameTemplate; - - private static $projectLocationTriggerNameTemplate; - - private static $projectTriggerNameTemplate; - - private static $repositoryNameTemplate; - - private static $secretVersionNameTemplate; - - private static $serviceAccountNameTemplate; - - private static $subscriptionNameTemplate; - - private static $topicNameTemplate; - - private static $workerPoolNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_build_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_build_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_build_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_build_rest_client_config.php', - ], - ], - ]; - } - - private static function getBuildNameTemplate() - { - if (self::$buildNameTemplate == null) { - self::$buildNameTemplate = new PathTemplate('projects/{project}/builds/{build}'); - } - - return self::$buildNameTemplate; - } - - private static function getBuildTriggerNameTemplate() - { - if (self::$buildTriggerNameTemplate == null) { - self::$buildTriggerNameTemplate = new PathTemplate('projects/{project}/triggers/{trigger}'); - } - - return self::$buildTriggerNameTemplate; - } - - private static function getCryptoKeyNameTemplate() - { - if (self::$cryptoKeyNameTemplate == null) { - self::$cryptoKeyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}'); - } - - return self::$cryptoKeyNameTemplate; - } - - private static function getGithubEnterpriseConfigNameTemplate() - { - if (self::$githubEnterpriseConfigNameTemplate == null) { - self::$githubEnterpriseConfigNameTemplate = new PathTemplate('projects/{project}/githubEnterpriseConfigs/{config}'); - } - - return self::$githubEnterpriseConfigNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectBuildNameTemplate() - { - if (self::$projectBuildNameTemplate == null) { - self::$projectBuildNameTemplate = new PathTemplate('projects/{project}/builds/{build}'); - } - - return self::$projectBuildNameTemplate; - } - - private static function getProjectConfigNameTemplate() - { - if (self::$projectConfigNameTemplate == null) { - self::$projectConfigNameTemplate = new PathTemplate('projects/{project}/githubEnterpriseConfigs/{config}'); - } - - return self::$projectConfigNameTemplate; - } - - private static function getProjectLocationBuildNameTemplate() - { - if (self::$projectLocationBuildNameTemplate == null) { - self::$projectLocationBuildNameTemplate = new PathTemplate('projects/{project}/locations/{location}/builds/{build}'); - } - - return self::$projectLocationBuildNameTemplate; - } - - private static function getProjectLocationConfigNameTemplate() - { - if (self::$projectLocationConfigNameTemplate == null) { - self::$projectLocationConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/githubEnterpriseConfigs/{config}'); - } - - return self::$projectLocationConfigNameTemplate; - } - - private static function getProjectLocationTriggerNameTemplate() - { - if (self::$projectLocationTriggerNameTemplate == null) { - self::$projectLocationTriggerNameTemplate = new PathTemplate('projects/{project}/locations/{location}/triggers/{trigger}'); - } - - return self::$projectLocationTriggerNameTemplate; - } - - private static function getProjectTriggerNameTemplate() - { - if (self::$projectTriggerNameTemplate == null) { - self::$projectTriggerNameTemplate = new PathTemplate('projects/{project}/triggers/{trigger}'); - } - - return self::$projectTriggerNameTemplate; - } - - private static function getRepositoryNameTemplate() - { - if (self::$repositoryNameTemplate == null) { - self::$repositoryNameTemplate = new PathTemplate('projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}'); - } - - return self::$repositoryNameTemplate; - } - - private static function getSecretVersionNameTemplate() - { - if (self::$secretVersionNameTemplate == null) { - self::$secretVersionNameTemplate = new PathTemplate('projects/{project}/secrets/{secret}/versions/{version}'); - } - - return self::$secretVersionNameTemplate; - } - - private static function getServiceAccountNameTemplate() - { - if (self::$serviceAccountNameTemplate == null) { - self::$serviceAccountNameTemplate = new PathTemplate('projects/{project}/serviceAccounts/{service_account}'); - } - - return self::$serviceAccountNameTemplate; - } - - private static function getSubscriptionNameTemplate() - { - if (self::$subscriptionNameTemplate == null) { - self::$subscriptionNameTemplate = new PathTemplate('projects/{project}/subscriptions/{subscription}'); - } - - return self::$subscriptionNameTemplate; - } - - private static function getTopicNameTemplate() - { - if (self::$topicNameTemplate == null) { - self::$topicNameTemplate = new PathTemplate('projects/{project}/topics/{topic}'); - } - - return self::$topicNameTemplate; - } - - private static function getWorkerPoolNameTemplate() - { - if (self::$workerPoolNameTemplate == null) { - self::$workerPoolNameTemplate = new PathTemplate('projects/{project}/locations/{location}/workerPools/{worker_pool}'); - } - - return self::$workerPoolNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'build' => self::getBuildNameTemplate(), - 'buildTrigger' => self::getBuildTriggerNameTemplate(), - 'cryptoKey' => self::getCryptoKeyNameTemplate(), - 'githubEnterpriseConfig' => self::getGithubEnterpriseConfigNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectBuild' => self::getProjectBuildNameTemplate(), - 'projectConfig' => self::getProjectConfigNameTemplate(), - 'projectLocationBuild' => self::getProjectLocationBuildNameTemplate(), - 'projectLocationConfig' => self::getProjectLocationConfigNameTemplate(), - 'projectLocationTrigger' => self::getProjectLocationTriggerNameTemplate(), - 'projectTrigger' => self::getProjectTriggerNameTemplate(), - 'repository' => self::getRepositoryNameTemplate(), - 'secretVersion' => self::getSecretVersionNameTemplate(), - 'serviceAccount' => self::getServiceAccountNameTemplate(), - 'subscription' => self::getSubscriptionNameTemplate(), - 'topic' => self::getTopicNameTemplate(), - 'workerPool' => self::getWorkerPoolNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a build - * resource. - * - * @param string $project - * @param string $build - * - * @return string The formatted build resource. - */ - public static function buildName($project, $build) - { - return self::getBuildNameTemplate()->render([ - 'project' => $project, - 'build' => $build, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * build_trigger resource. - * - * @param string $project - * @param string $trigger - * - * @return string The formatted build_trigger resource. - */ - public static function buildTriggerName($project, $trigger) - { - return self::getBuildTriggerNameTemplate()->render([ - 'project' => $project, - 'trigger' => $trigger, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a crypto_key - * resource. - * - * @param string $project - * @param string $location - * @param string $keyring - * @param string $key - * - * @return string The formatted crypto_key resource. - */ - public static function cryptoKeyName($project, $location, $keyring, $key) - { - return self::getCryptoKeyNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'keyring' => $keyring, - 'key' => $key, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * github_enterprise_config resource. - * - * @param string $project - * @param string $config - * - * @return string The formatted github_enterprise_config resource. - */ - public static function githubEnterpriseConfigName($project, $config) - { - return self::getGithubEnterpriseConfigNameTemplate()->render([ - 'project' => $project, - 'config' => $config, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_build resource. - * - * @param string $project - * @param string $build - * - * @return string The formatted project_build resource. - */ - public static function projectBuildName($project, $build) - { - return self::getProjectBuildNameTemplate()->render([ - 'project' => $project, - 'build' => $build, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_config resource. - * - * @param string $project - * @param string $config - * - * @return string The formatted project_config resource. - */ - public static function projectConfigName($project, $config) - { - return self::getProjectConfigNameTemplate()->render([ - 'project' => $project, - 'config' => $config, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_build resource. - * - * @param string $project - * @param string $location - * @param string $build - * - * @return string The formatted project_location_build resource. - */ - public static function projectLocationBuildName($project, $location, $build) - { - return self::getProjectLocationBuildNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'build' => $build, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_config resource. - * - * @param string $project - * @param string $location - * @param string $config - * - * @return string The formatted project_location_config resource. - */ - public static function projectLocationConfigName($project, $location, $config) - { - return self::getProjectLocationConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'config' => $config, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_trigger resource. - * - * @param string $project - * @param string $location - * @param string $trigger - * - * @return string The formatted project_location_trigger resource. - */ - public static function projectLocationTriggerName($project, $location, $trigger) - { - return self::getProjectLocationTriggerNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'trigger' => $trigger, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_trigger resource. - * - * @param string $project - * @param string $trigger - * - * @return string The formatted project_trigger resource. - */ - public static function projectTriggerName($project, $trigger) - { - return self::getProjectTriggerNameTemplate()->render([ - 'project' => $project, - 'trigger' => $trigger, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a repository - * resource. - * - * @param string $project - * @param string $location - * @param string $connection - * @param string $repository - * - * @return string The formatted repository resource. - */ - public static function repositoryName($project, $location, $connection, $repository) - { - return self::getRepositoryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'connection' => $connection, - 'repository' => $repository, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * secret_version resource. - * - * @param string $project - * @param string $secret - * @param string $version - * - * @return string The formatted secret_version resource. - */ - public static function secretVersionName($project, $secret, $version) - { - return self::getSecretVersionNameTemplate()->render([ - 'project' => $project, - 'secret' => $secret, - 'version' => $version, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * service_account resource. - * - * @param string $project - * @param string $serviceAccount - * - * @return string The formatted service_account resource. - */ - public static function serviceAccountName($project, $serviceAccount) - { - return self::getServiceAccountNameTemplate()->render([ - 'project' => $project, - 'service_account' => $serviceAccount, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subscription - * resource. - * - * @param string $project - * @param string $subscription - * - * @return string The formatted subscription resource. - */ - public static function subscriptionName($project, $subscription) - { - return self::getSubscriptionNameTemplate()->render([ - 'project' => $project, - 'subscription' => $subscription, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a topic - * resource. - * - * @param string $project - * @param string $topic - * - * @return string The formatted topic resource. - */ - public static function topicName($project, $topic) - { - return self::getTopicNameTemplate()->render([ - 'project' => $project, - 'topic' => $topic, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a worker_pool - * resource. - * - * @param string $project - * @param string $location - * @param string $workerPool - * - * @return string The formatted worker_pool resource. - */ - public static function workerPoolName($project, $location, $workerPool) - { - return self::getWorkerPoolNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'worker_pool' => $workerPool, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - build: projects/{project}/builds/{build} - * - buildTrigger: projects/{project}/triggers/{trigger} - * - cryptoKey: projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key} - * - githubEnterpriseConfig: projects/{project}/githubEnterpriseConfigs/{config} - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - project: projects/{project} - * - projectBuild: projects/{project}/builds/{build} - * - projectConfig: projects/{project}/githubEnterpriseConfigs/{config} - * - projectLocationBuild: projects/{project}/locations/{location}/builds/{build} - * - projectLocationConfig: projects/{project}/locations/{location}/githubEnterpriseConfigs/{config} - * - projectLocationTrigger: projects/{project}/locations/{location}/triggers/{trigger} - * - projectTrigger: projects/{project}/triggers/{trigger} - * - repository: projects/{project}/locations/{location}/connections/{connection}/repositories/{repository} - * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} - * - serviceAccount: projects/{project}/serviceAccounts/{service_account} - * - subscription: projects/{project}/subscriptions/{subscription} - * - topic: projects/{project}/topics/{topic} - * - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudbuild.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Approves or rejects a pending build. - * - * If approved, the returned LRO will be analogous to the LRO returned from - * a CreateBuild call. - * - * If rejected, the returned LRO will be immediately done. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $name = 'name'; - * $operationResponse = $cloudBuildClient->approveBuild($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudBuildClient->approveBuild($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'approveBuild'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * @param array $optionalArgs { - * Optional. - * - * @type ApprovalResult $approvalResult - * Approval decision and metadata. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function approveBuild($name, array $optionalArgs = []) - { - $request = new ApproveBuildRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['location'] = $name; - if (isset($optionalArgs['approvalResult'])) { - $request->setApprovalResult($optionalArgs['approvalResult']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ApproveBuild', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Cancels a build in progress. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $id = 'id'; - * $response = $cloudBuildClient->cancelBuild($projectId, $id); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param string $id Required. ID of the build. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V1\Build - * - * @throws ApiException if the remote call fails - */ - public function cancelBuild($projectId, $id, array $optionalArgs = []) - { - $request = new CancelBuildRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setId($id); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CancelBuild', Build::class, $optionalArgs, $request)->wait(); - } - - /** - * Starts a build with the specified configuration. - * - * This method returns a long-running `Operation`, which includes the build - * ID. Pass the build ID to `GetBuild` to determine the build status (such as - * `SUCCESS` or `FAILURE`). - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $build = new Build(); - * $operationResponse = $cloudBuildClient->createBuild($projectId, $build); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudBuildClient->createBuild($projectId, $build); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'createBuild'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param Build $build Required. Build resource to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createBuild($projectId, $build, array $optionalArgs = []) - { - $request = new CreateBuildRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setBuild($build); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['location'] = $optionalArgs['parent']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBuild', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new `BuildTrigger`. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $trigger = new BuildTrigger(); - * $response = $cloudBuildClient->createBuildTrigger($projectId, $trigger); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project for which to configure automatic builds. - * @param BuildTrigger $trigger Required. `BuildTrigger` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V1\BuildTrigger - * - * @throws ApiException if the remote call fails - */ - public function createBuildTrigger($projectId, $trigger, array $optionalArgs = []) - { - $request = new CreateBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTrigger($trigger); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['location'] = $optionalArgs['parent']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateBuildTrigger', BuildTrigger::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a `WorkerPool`. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $formattedParent = $cloudBuildClient->locationName('[PROJECT]', '[LOCATION]'); - * $workerPool = new WorkerPool(); - * $workerPoolId = 'worker_pool_id'; - * $operationResponse = $cloudBuildClient->createWorkerPool($formattedParent, $workerPool, $workerPoolId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudBuildClient->createWorkerPool($formattedParent, $workerPool, $workerPoolId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'createWorkerPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * @param WorkerPool $workerPool Required. `WorkerPool` resource to create. - * @param string $workerPoolId Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * If set, validate the request and preview the response, but do not actually - * post it. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createWorkerPool($parent, $workerPool, $workerPoolId, array $optionalArgs = []) - { - $request = new CreateWorkerPoolRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setWorkerPool($workerPool); - $request->setWorkerPoolId($workerPoolId); - $requestParamHeaders['location'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateWorkerPool', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a `BuildTrigger` by its project ID and trigger ID. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $triggerId = 'trigger_id'; - * $cloudBuildClient->deleteBuildTrigger($projectId, $triggerId); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project that owns the trigger. - * @param string $triggerId Required. ID of the `BuildTrigger` to delete. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteBuildTrigger($projectId, $triggerId, array $optionalArgs = []) - { - $request = new DeleteBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTriggerId($triggerId); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteBuildTrigger', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a `WorkerPool`. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $formattedName = $cloudBuildClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - * $operationResponse = $cloudBuildClient->deleteWorkerPool($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudBuildClient->deleteWorkerPool($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'deleteWorkerPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * @type bool $allowMissing - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * @type bool $validateOnly - * If set, validate the request and preview the response, but do not actually - * post it. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteWorkerPool($name, array $optionalArgs = []) - { - $request = new DeleteWorkerPoolRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['location'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteWorkerPool', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Returns information about a previously requested build. - * - * The `Build` that is returned includes its status (such as `SUCCESS`, - * `FAILURE`, or `WORKING`), and timing information. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $id = 'id'; - * $response = $cloudBuildClient->getBuild($projectId, $id); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param string $id Required. ID of the build. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V1\Build - * - * @throws ApiException if the remote call fails - */ - public function getBuild($projectId, $id, array $optionalArgs = []) - { - $request = new GetBuildRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setId($id); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBuild', Build::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns information about a `BuildTrigger`. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $triggerId = 'trigger_id'; - * $response = $cloudBuildClient->getBuildTrigger($projectId, $triggerId); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project that owns the trigger. - * @param string $triggerId Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V1\BuildTrigger - * - * @throws ApiException if the remote call fails - */ - public function getBuildTrigger($projectId, $triggerId, array $optionalArgs = []) - { - $request = new GetBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTriggerId($triggerId); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBuildTrigger', BuildTrigger::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns details of a `WorkerPool`. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $formattedName = $cloudBuildClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - * $response = $cloudBuildClient->getWorkerPool($formattedName); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V1\WorkerPool - * - * @throws ApiException if the remote call fails - */ - public function getWorkerPool($name, array $optionalArgs = []) - { - $request = new GetWorkerPoolRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['location'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetWorkerPool', WorkerPool::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists existing `BuildTrigger`s. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * // Iterate over pages of elements - * $pagedResponse = $cloudBuildClient->listBuildTriggers($projectId); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudBuildClient->listBuildTriggers($projectId); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project for which to list BuildTriggers. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listBuildTriggers($projectId, array $optionalArgs = []) - { - $request = new ListBuildTriggersRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['location'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBuildTriggers', $optionalArgs, ListBuildTriggersResponse::class, $request); - } - - /** - * Lists previously requested builds. - * - * Previously requested builds may still be in-progress, or may have finished - * successfully or unsuccessfully. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * // Iterate over pages of elements - * $pagedResponse = $cloudBuildClient->listBuilds($projectId); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudBuildClient->listBuilds($projectId); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * The raw filter text to constrain the results. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listBuilds($projectId, array $optionalArgs = []) - { - $request = new ListBuildsRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['location'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBuilds', $optionalArgs, ListBuildsResponse::class, $request); - } - - /** - * Lists `WorkerPool`s. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $formattedParent = $cloudBuildClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudBuildClient->listWorkerPools($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudBuildClient->listWorkerPools($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listWorkerPools($parent, array $optionalArgs = []) - { - $request = new ListWorkerPoolsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['location'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListWorkerPools', $optionalArgs, ListWorkerPoolsResponse::class, $request); - } - - /** - * ReceiveTriggerWebhook [Experimental] is called when the API receives a - * webhook request targeted at a specific trigger. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $response = $cloudBuildClient->receiveTriggerWebhook(); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type HttpBody $body - * HTTP request body. - * @type string $projectId - * Project in which the specified trigger lives - * @type string $trigger - * Name of the trigger to run the payload against - * @type string $secret - * Secret token used for authorization if an OAuth token isn't provided. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V1\ReceiveTriggerWebhookResponse - * - * @throws ApiException if the remote call fails - */ - public function receiveTriggerWebhook(array $optionalArgs = []) - { - $request = new ReceiveTriggerWebhookRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['body'])) { - $request->setBody($optionalArgs['body']); - } - - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['trigger'])) { - $request->setTrigger($optionalArgs['trigger']); - $requestParamHeaders['trigger'] = $optionalArgs['trigger']; - } - - if (isset($optionalArgs['secret'])) { - $request->setSecret($optionalArgs['secret']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ReceiveTriggerWebhook', ReceiveTriggerWebhookResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new build based on the specified build. - * - * This method creates a new build using the original build request, which may - * or may not result in an identical build. - * - * For triggered builds: - * - * * Triggered builds resolve to a precise revision; therefore a retry of a - * triggered build will result in a build that uses the same revision. - * - * For non-triggered builds that specify `RepoSource`: - * - * * If the original build built from the tip of a branch, the retried build - * will build from the tip of that branch, which may not be the same revision - * as the original build. - * * If the original build specified a commit sha or revision ID, the retried - * build will use the identical source. - * - * For builds that specify `StorageSource`: - * - * * If the original build pulled source from Cloud Storage without - * specifying the generation of the object, the new build will use the current - * object, which may be different from the original build source. - * * If the original build pulled source from Cloud Storage and specified the - * generation of the object, the new build will attempt to use the same - * object, which may or may not be available depending on the bucket's - * lifecycle management settings. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $id = 'id'; - * $operationResponse = $cloudBuildClient->retryBuild($projectId, $id); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudBuildClient->retryBuild($projectId, $id); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'retryBuild'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param string $id Required. Build ID of the original build. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function retryBuild($projectId, $id, array $optionalArgs = []) - { - $request = new RetryBuildRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setId($id); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RetryBuild', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Runs a `BuildTrigger` at a particular source revision. - * - * To run a regional or global trigger, use the POST request - * that includes the location endpoint in the path (ex. - * v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The - * POST request that does not include the location endpoint in the path can - * only be used when running global triggers. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $triggerId = 'trigger_id'; - * $operationResponse = $cloudBuildClient->runBuildTrigger($projectId, $triggerId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudBuildClient->runBuildTrigger($projectId, $triggerId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'runBuildTrigger'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param string $triggerId Required. ID of the trigger. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type RepoSource $source - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function runBuildTrigger($projectId, $triggerId, array $optionalArgs = []) - { - $request = new RunBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTriggerId($triggerId); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['source'])) { - $request->setSource($optionalArgs['source']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RunBuildTrigger', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a `BuildTrigger` by its project ID and trigger ID. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $triggerId = 'trigger_id'; - * $trigger = new BuildTrigger(); - * $response = $cloudBuildClient->updateBuildTrigger($projectId, $triggerId, $trigger); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project that owns the trigger. - * @param string $triggerId Required. ID of the `BuildTrigger` to update. - * @param BuildTrigger $trigger Required. `BuildTrigger` to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V1\BuildTrigger - * - * @throws ApiException if the remote call fails - */ - public function updateBuildTrigger($projectId, $triggerId, $trigger, array $optionalArgs = []) - { - $request = new UpdateBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTriggerId($triggerId); - $request->setTrigger($trigger); - $requestParamHeaders['location'] = $trigger->getResourceName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateBuildTrigger', BuildTrigger::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a `WorkerPool`. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $workerPool = new WorkerPool(); - * $operationResponse = $cloudBuildClient->updateWorkerPool($workerPool); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudBuildClient->updateWorkerPool($workerPool); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'updateWorkerPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param WorkerPool $workerPool Required. The `WorkerPool` to update. - * - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * A mask specifying which fields in `worker_pool` to update. - * @type bool $validateOnly - * If set, validate the request and preview the response, but do not actually - * post it. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateWorkerPool($workerPool, array $optionalArgs = []) - { - $request = new UpdateWorkerPoolRequest(); - $requestParamHeaders = []; - $request->setWorkerPool($workerPool); - $requestParamHeaders['location'] = $workerPool->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateWorkerPool', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/Build/src/V1/GetBuildRequest.php b/Build/src/V1/GetBuildRequest.php deleted file mode 100644 index 40a1220b31dc..000000000000 --- a/Build/src/V1/GetBuildRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.GetBuildRequest - */ -class GetBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @type string $project_id - * Required. ID of the project. - * @type string $id - * Required. ID of the build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/GetBuildTriggerRequest.php b/Build/src/V1/GetBuildTriggerRequest.php deleted file mode 100644 index 6074f3599fe7..000000000000 --- a/Build/src/V1/GetBuildTriggerRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.GetBuildTriggerRequest - */ -class GetBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type string $project_id - * Required. ID of the project that owns the trigger. - * @type string $trigger_id - * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTriggerId() - { - return $this->trigger_id; - } - - /** - * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->trigger_id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/GetWorkerPoolRequest.php b/Build/src/V1/GetWorkerPoolRequest.php deleted file mode 100644 index 73a874b21db7..000000000000 --- a/Build/src/V1/GetWorkerPoolRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.devtools.cloudbuild.v1.GetWorkerPoolRequest - */ -class GetWorkerPoolRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/GitFileSource.php b/Build/src/V1/GitFileSource.php deleted file mode 100644 index c4d7280413df..000000000000 --- a/Build/src/V1/GitFileSource.php +++ /dev/null @@ -1,303 +0,0 @@ -google.devtools.cloudbuild.v1.GitFileSource - */ -class GitFileSource extends \Google\Protobuf\Internal\Message -{ - /** - * The path of the file, with the repo root as the root of the path. - * - * Generated from protobuf field string path = 1; - */ - private $path = ''; - /** - * The URI of the repo. - * Either uri or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string uri = 2; - */ - private $uri = ''; - /** - * See RepoType above. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - */ - private $repo_type = 0; - /** - * The branch, tag, arbitrary ref, or SHA version of the repo to use when - * resolving the filename (optional). - * This field respects the same syntax/resolution as described here: - * https://git-scm.com/docs/gitrevisions - * If unspecified, the revision from which the trigger invocation originated - * is assumed to be the revision from which to read the specified path. - * - * Generated from protobuf field string revision = 4; - */ - private $revision = ''; - protected $source; - protected $enterprise_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * The path of the file, with the repo root as the root of the path. - * @type string $uri - * The URI of the repo. - * Either uri or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * @type string $repository - * The fully qualified resource name of the Repos API repository. - * Either URI or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * @type int $repo_type - * See RepoType above. - * @type string $revision - * The branch, tag, arbitrary ref, or SHA version of the repo to use when - * resolving the filename (optional). - * This field respects the same syntax/resolution as described here: - * https://git-scm.com/docs/gitrevisions - * If unspecified, the revision from which the trigger invocation originated - * is assumed to be the revision from which to read the specified path. - * @type string $github_enterprise_config - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The path of the file, with the repo root as the root of the path. - * - * Generated from protobuf field string path = 1; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * The path of the file, with the repo root as the root of the path. - * - * Generated from protobuf field string path = 1; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * The URI of the repo. - * Either uri or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string uri = 2; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * The URI of the repo. - * Either uri or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string uri = 2; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * The fully qualified resource name of the Repos API repository. - * Either URI or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string repository = 7 [(.google.api.resource_reference) = { - * @return string - */ - public function getRepository() - { - return $this->readOneof(7); - } - - public function hasRepository() - { - return $this->hasOneof(7); - } - - /** - * The fully qualified resource name of the Repos API repository. - * Either URI or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string repository = 7 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * See RepoType above. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - * @return int - */ - public function getRepoType() - { - return $this->repo_type; - } - - /** - * See RepoType above. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - * @param int $var - * @return $this - */ - public function setRepoType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\GitFileSource\RepoType::class); - $this->repo_type = $var; - - return $this; - } - - /** - * The branch, tag, arbitrary ref, or SHA version of the repo to use when - * resolving the filename (optional). - * This field respects the same syntax/resolution as described here: - * https://git-scm.com/docs/gitrevisions - * If unspecified, the revision from which the trigger invocation originated - * is assumed to be the revision from which to read the specified path. - * - * Generated from protobuf field string revision = 4; - * @return string - */ - public function getRevision() - { - return $this->revision; - } - - /** - * The branch, tag, arbitrary ref, or SHA version of the repo to use when - * resolving the filename (optional). - * This field respects the same syntax/resolution as described here: - * https://git-scm.com/docs/gitrevisions - * If unspecified, the revision from which the trigger invocation originated - * is assumed to be the revision from which to read the specified path. - * - * Generated from protobuf field string revision = 4; - * @param string $var - * @return $this - */ - public function setRevision($var) - { - GPBUtil::checkString($var, True); - $this->revision = $var; - - return $this; - } - - /** - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * - * Generated from protobuf field string github_enterprise_config = 5 [(.google.api.resource_reference) = { - * @return string - */ - public function getGithubEnterpriseConfig() - { - return $this->readOneof(5); - } - - public function hasGithubEnterpriseConfig() - { - return $this->hasOneof(5); - } - - /** - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * - * Generated from protobuf field string github_enterprise_config = 5 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setGithubEnterpriseConfig($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getEnterpriseConfig() - { - return $this->whichOneof("enterprise_config"); - } - -} - diff --git a/Build/src/V1/GitFileSource/RepoType.php b/Build/src/V1/GitFileSource/RepoType.php deleted file mode 100644 index 9c286c49cb38..000000000000 --- a/Build/src/V1/GitFileSource/RepoType.php +++ /dev/null @@ -1,79 +0,0 @@ -google.devtools.cloudbuild.v1.GitFileSource.RepoType - */ -class RepoType -{ - /** - * The default, unknown repo type. Don't use it, instead use one of - * the other repo types. - * - * Generated from protobuf enum UNKNOWN = 0; - */ - const UNKNOWN = 0; - /** - * A Google Cloud Source Repositories-hosted repo. - * - * Generated from protobuf enum CLOUD_SOURCE_REPOSITORIES = 1; - */ - const CLOUD_SOURCE_REPOSITORIES = 1; - /** - * A GitHub-hosted repo not necessarily on "github.com" (i.e. GitHub - * Enterprise). - * - * Generated from protobuf enum GITHUB = 2; - */ - const GITHUB = 2; - /** - * A Bitbucket Server-hosted repo. - * - * Generated from protobuf enum BITBUCKET_SERVER = 3; - */ - const BITBUCKET_SERVER = 3; - /** - * A GitLab-hosted repo. - * - * Generated from protobuf enum GITLAB = 4; - */ - const GITLAB = 4; - - private static $valueToName = [ - self::UNKNOWN => 'UNKNOWN', - self::CLOUD_SOURCE_REPOSITORIES => 'CLOUD_SOURCE_REPOSITORIES', - self::GITHUB => 'GITHUB', - self::BITBUCKET_SERVER => 'BITBUCKET_SERVER', - self::GITLAB => 'GITLAB', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/GitHubEnterpriseConfig.php b/Build/src/V1/GitHubEnterpriseConfig.php deleted file mode 100644 index 6c9eda79123c..000000000000 --- a/Build/src/V1/GitHubEnterpriseConfig.php +++ /dev/null @@ -1,409 +0,0 @@ -google.devtools.cloudbuild.v1.GitHubEnterpriseConfig - */ -class GitHubEnterpriseConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The full resource name for the GitHubEnterpriseConfig - * For example: - * "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}" - * - * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $name = ''; - /** - * The URL of the github enterprise host the configuration is for. - * - * Generated from protobuf field string host_url = 3; - */ - private $host_url = ''; - /** - * Required. The GitHub app id of the Cloud Build app on the GitHub Enterprise - * server. - * - * Generated from protobuf field int64 app_id = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $app_id = 0; - /** - * Output only. Time when the installation was associated with the project. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * The key that should be attached to webhook calls to the ReceiveWebhook - * endpoint. - * - * Generated from protobuf field string webhook_key = 8; - */ - private $webhook_key = ''; - /** - * Optional. The network to be used when reaching out to the GitHub - * Enterprise server. The VPC network must be enabled for private - * service connection. This should be set if the GitHub Enterprise server is - * hosted on-premises and not reachable by public internet. - * If this field is left empty, no network peering will occur and calls to - * the GitHub Enterprise server will be made over the public internet. - * Must be in the format - * `projects/{project}/global/networks/{network}`, where {project} - * is a project number or id and {network} is the name of a - * VPC network in the project. - * - * Generated from protobuf field string peered_network = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - private $peered_network = ''; - /** - * Names of secrets in Secret Manager. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets secrets = 10; - */ - private $secrets = null; - /** - * Name to display for this config. - * - * Generated from protobuf field string display_name = 11; - */ - private $display_name = ''; - /** - * Optional. SSL certificate to use for requests to GitHub Enterprise. - * - * Generated from protobuf field string ssl_ca = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $ssl_ca = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optional. The full resource name for the GitHubEnterpriseConfig - * For example: - * "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}" - * @type string $host_url - * The URL of the github enterprise host the configuration is for. - * @type int|string $app_id - * Required. The GitHub app id of the Cloud Build app on the GitHub Enterprise - * server. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Time when the installation was associated with the project. - * @type string $webhook_key - * The key that should be attached to webhook calls to the ReceiveWebhook - * endpoint. - * @type string $peered_network - * Optional. The network to be used when reaching out to the GitHub - * Enterprise server. The VPC network must be enabled for private - * service connection. This should be set if the GitHub Enterprise server is - * hosted on-premises and not reachable by public internet. - * If this field is left empty, no network peering will occur and calls to - * the GitHub Enterprise server will be made over the public internet. - * Must be in the format - * `projects/{project}/global/networks/{network}`, where {project} - * is a project number or id and {network} is the name of a - * VPC network in the project. - * @type \Google\Cloud\Build\V1\GitHubEnterpriseSecrets $secrets - * Names of secrets in Secret Manager. - * @type string $display_name - * Name to display for this config. - * @type string $ssl_ca - * Optional. SSL certificate to use for requests to GitHub Enterprise. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The full resource name for the GitHubEnterpriseConfig - * For example: - * "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}" - * - * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optional. The full resource name for the GitHubEnterpriseConfig - * For example: - * "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}" - * - * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The URL of the github enterprise host the configuration is for. - * - * Generated from protobuf field string host_url = 3; - * @return string - */ - public function getHostUrl() - { - return $this->host_url; - } - - /** - * The URL of the github enterprise host the configuration is for. - * - * Generated from protobuf field string host_url = 3; - * @param string $var - * @return $this - */ - public function setHostUrl($var) - { - GPBUtil::checkString($var, True); - $this->host_url = $var; - - return $this; - } - - /** - * Required. The GitHub app id of the Cloud Build app on the GitHub Enterprise - * server. - * - * Generated from protobuf field int64 app_id = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return int|string - */ - public function getAppId() - { - return $this->app_id; - } - - /** - * Required. The GitHub app id of the Cloud Build app on the GitHub Enterprise - * server. - * - * Generated from protobuf field int64 app_id = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param int|string $var - * @return $this - */ - public function setAppId($var) - { - GPBUtil::checkInt64($var); - $this->app_id = $var; - - return $this; - } - - /** - * Output only. Time when the installation was associated with the project. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Time when the installation was associated with the project. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The key that should be attached to webhook calls to the ReceiveWebhook - * endpoint. - * - * Generated from protobuf field string webhook_key = 8; - * @return string - */ - public function getWebhookKey() - { - return $this->webhook_key; - } - - /** - * The key that should be attached to webhook calls to the ReceiveWebhook - * endpoint. - * - * Generated from protobuf field string webhook_key = 8; - * @param string $var - * @return $this - */ - public function setWebhookKey($var) - { - GPBUtil::checkString($var, True); - $this->webhook_key = $var; - - return $this; - } - - /** - * Optional. The network to be used when reaching out to the GitHub - * Enterprise server. The VPC network must be enabled for private - * service connection. This should be set if the GitHub Enterprise server is - * hosted on-premises and not reachable by public internet. - * If this field is left empty, no network peering will occur and calls to - * the GitHub Enterprise server will be made over the public internet. - * Must be in the format - * `projects/{project}/global/networks/{network}`, where {project} - * is a project number or id and {network} is the name of a - * VPC network in the project. - * - * Generated from protobuf field string peered_network = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getPeeredNetwork() - { - return $this->peered_network; - } - - /** - * Optional. The network to be used when reaching out to the GitHub - * Enterprise server. The VPC network must be enabled for private - * service connection. This should be set if the GitHub Enterprise server is - * hosted on-premises and not reachable by public internet. - * If this field is left empty, no network peering will occur and calls to - * the GitHub Enterprise server will be made over the public internet. - * Must be in the format - * `projects/{project}/global/networks/{network}`, where {project} - * is a project number or id and {network} is the name of a - * VPC network in the project. - * - * Generated from protobuf field string peered_network = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setPeeredNetwork($var) - { - GPBUtil::checkString($var, True); - $this->peered_network = $var; - - return $this; - } - - /** - * Names of secrets in Secret Manager. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets secrets = 10; - * @return \Google\Cloud\Build\V1\GitHubEnterpriseSecrets|null - */ - public function getSecrets() - { - return $this->secrets; - } - - public function hasSecrets() - { - return isset($this->secrets); - } - - public function clearSecrets() - { - unset($this->secrets); - } - - /** - * Names of secrets in Secret Manager. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets secrets = 10; - * @param \Google\Cloud\Build\V1\GitHubEnterpriseSecrets $var - * @return $this - */ - public function setSecrets($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitHubEnterpriseSecrets::class); - $this->secrets = $var; - - return $this; - } - - /** - * Name to display for this config. - * - * Generated from protobuf field string display_name = 11; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Name to display for this config. - * - * Generated from protobuf field string display_name = 11; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Optional. SSL certificate to use for requests to GitHub Enterprise. - * - * Generated from protobuf field string ssl_ca = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSslCa() - { - return $this->ssl_ca; - } - - /** - * Optional. SSL certificate to use for requests to GitHub Enterprise. - * - * Generated from protobuf field string ssl_ca = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSslCa($var) - { - GPBUtil::checkString($var, True); - $this->ssl_ca = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/GitHubEnterpriseSecrets.php b/Build/src/V1/GitHubEnterpriseSecrets.php deleted file mode 100644 index 125f001df97f..000000000000 --- a/Build/src/V1/GitHubEnterpriseSecrets.php +++ /dev/null @@ -1,171 +0,0 @@ -/secrets/. - * - * Generated from protobuf message google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets - */ -class GitHubEnterpriseSecrets extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name for the private key secret version. - * - * Generated from protobuf field string private_key_version_name = 5 [(.google.api.resource_reference) = { - */ - private $private_key_version_name = ''; - /** - * The resource name for the webhook secret secret version in Secret Manager. - * - * Generated from protobuf field string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { - */ - private $webhook_secret_version_name = ''; - /** - * The resource name for the OAuth secret secret version in Secret Manager. - * - * Generated from protobuf field string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { - */ - private $oauth_secret_version_name = ''; - /** - * The resource name for the OAuth client ID secret version in Secret Manager. - * - * Generated from protobuf field string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { - */ - private $oauth_client_id_version_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $private_key_version_name - * The resource name for the private key secret version. - * @type string $webhook_secret_version_name - * The resource name for the webhook secret secret version in Secret Manager. - * @type string $oauth_secret_version_name - * The resource name for the OAuth secret secret version in Secret Manager. - * @type string $oauth_client_id_version_name - * The resource name for the OAuth client ID secret version in Secret Manager. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name for the private key secret version. - * - * Generated from protobuf field string private_key_version_name = 5 [(.google.api.resource_reference) = { - * @return string - */ - public function getPrivateKeyVersionName() - { - return $this->private_key_version_name; - } - - /** - * The resource name for the private key secret version. - * - * Generated from protobuf field string private_key_version_name = 5 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setPrivateKeyVersionName($var) - { - GPBUtil::checkString($var, True); - $this->private_key_version_name = $var; - - return $this; - } - - /** - * The resource name for the webhook secret secret version in Secret Manager. - * - * Generated from protobuf field string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { - * @return string - */ - public function getWebhookSecretVersionName() - { - return $this->webhook_secret_version_name; - } - - /** - * The resource name for the webhook secret secret version in Secret Manager. - * - * Generated from protobuf field string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setWebhookSecretVersionName($var) - { - GPBUtil::checkString($var, True); - $this->webhook_secret_version_name = $var; - - return $this; - } - - /** - * The resource name for the OAuth secret secret version in Secret Manager. - * - * Generated from protobuf field string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { - * @return string - */ - public function getOauthSecretVersionName() - { - return $this->oauth_secret_version_name; - } - - /** - * The resource name for the OAuth secret secret version in Secret Manager. - * - * Generated from protobuf field string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setOauthSecretVersionName($var) - { - GPBUtil::checkString($var, True); - $this->oauth_secret_version_name = $var; - - return $this; - } - - /** - * The resource name for the OAuth client ID secret version in Secret Manager. - * - * Generated from protobuf field string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { - * @return string - */ - public function getOauthClientIdVersionName() - { - return $this->oauth_client_id_version_name; - } - - /** - * The resource name for the OAuth client ID secret version in Secret Manager. - * - * Generated from protobuf field string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setOauthClientIdVersionName($var) - { - GPBUtil::checkString($var, True); - $this->oauth_client_id_version_name = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/GitHubEventsConfig.php b/Build/src/V1/GitHubEventsConfig.php deleted file mode 100644 index 3400ef253089..000000000000 --- a/Build/src/V1/GitHubEventsConfig.php +++ /dev/null @@ -1,228 +0,0 @@ -google.devtools.cloudbuild.v1.GitHubEventsConfig - */ -class GitHubEventsConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The installationID that emits the GitHub event. - * - * Generated from protobuf field int64 installation_id = 1 [deprecated = true]; - * @deprecated - */ - protected $installation_id = 0; - /** - * Owner of the repository. For example: The owner for - * https://github.com/googlecloudplatform/cloud-builders is - * "googlecloudplatform". - * - * Generated from protobuf field string owner = 6; - */ - private $owner = ''; - /** - * Name of the repository. For example: The name for - * https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". - * - * Generated from protobuf field string name = 7; - */ - private $name = ''; - protected $event; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $installation_id - * The installationID that emits the GitHub event. - * @type string $owner - * Owner of the repository. For example: The owner for - * https://github.com/googlecloudplatform/cloud-builders is - * "googlecloudplatform". - * @type string $name - * Name of the repository. For example: The name for - * https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". - * @type \Google\Cloud\Build\V1\PullRequestFilter $pull_request - * filter to match changes in pull requests. - * @type \Google\Cloud\Build\V1\PushFilter $push - * filter to match changes in refs like branches, tags. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The installationID that emits the GitHub event. - * - * Generated from protobuf field int64 installation_id = 1 [deprecated = true]; - * @return int|string - * @deprecated - */ - public function getInstallationId() - { - @trigger_error('installation_id is deprecated.', E_USER_DEPRECATED); - return $this->installation_id; - } - - /** - * The installationID that emits the GitHub event. - * - * Generated from protobuf field int64 installation_id = 1 [deprecated = true]; - * @param int|string $var - * @return $this - * @deprecated - */ - public function setInstallationId($var) - { - @trigger_error('installation_id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkInt64($var); - $this->installation_id = $var; - - return $this; - } - - /** - * Owner of the repository. For example: The owner for - * https://github.com/googlecloudplatform/cloud-builders is - * "googlecloudplatform". - * - * Generated from protobuf field string owner = 6; - * @return string - */ - public function getOwner() - { - return $this->owner; - } - - /** - * Owner of the repository. For example: The owner for - * https://github.com/googlecloudplatform/cloud-builders is - * "googlecloudplatform". - * - * Generated from protobuf field string owner = 6; - * @param string $var - * @return $this - */ - public function setOwner($var) - { - GPBUtil::checkString($var, True); - $this->owner = $var; - - return $this; - } - - /** - * Name of the repository. For example: The name for - * https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". - * - * Generated from protobuf field string name = 7; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of the repository. For example: The name for - * https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". - * - * Generated from protobuf field string name = 7; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * filter to match changes in pull requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter pull_request = 4; - * @return \Google\Cloud\Build\V1\PullRequestFilter|null - */ - public function getPullRequest() - { - return $this->readOneof(4); - } - - public function hasPullRequest() - { - return $this->hasOneof(4); - } - - /** - * filter to match changes in pull requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter pull_request = 4; - * @param \Google\Cloud\Build\V1\PullRequestFilter $var - * @return $this - */ - public function setPullRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PullRequestFilter::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * filter to match changes in refs like branches, tags. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PushFilter push = 5; - * @return \Google\Cloud\Build\V1\PushFilter|null - */ - public function getPush() - { - return $this->readOneof(5); - } - - public function hasPush() - { - return $this->hasOneof(5); - } - - /** - * filter to match changes in refs like branches, tags. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PushFilter push = 5; - * @param \Google\Cloud\Build\V1\PushFilter $var - * @return $this - */ - public function setPush($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PushFilter::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getEvent() - { - return $this->whichOneof("event"); - } - -} - diff --git a/Build/src/V1/GitRepoSource.php b/Build/src/V1/GitRepoSource.php deleted file mode 100644 index 265223891fbe..000000000000 --- a/Build/src/V1/GitRepoSource.php +++ /dev/null @@ -1,238 +0,0 @@ -google.devtools.cloudbuild.v1.GitRepoSource - */ -class GitRepoSource extends \Google\Protobuf\Internal\Message -{ - /** - * The URI of the repo (e.g. https://github.com/user/repo.git). - * Either `uri` or `repository` can be specified and is required. - * - * Generated from protobuf field string uri = 1; - */ - private $uri = ''; - /** - * The branch or tag to use. Must start with "refs/" (required). - * - * Generated from protobuf field string ref = 2; - */ - private $ref = ''; - /** - * See RepoType below. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - */ - private $repo_type = 0; - protected $source; - protected $enterprise_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * The URI of the repo (e.g. https://github.com/user/repo.git). - * Either `uri` or `repository` can be specified and is required. - * @type string $repository - * The connected repository resource name, in the format - * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or - * `repository` can be specified and is required. - * @type string $ref - * The branch or tag to use. Must start with "refs/" (required). - * @type int $repo_type - * See RepoType below. - * @type string $github_enterprise_config - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The URI of the repo (e.g. https://github.com/user/repo.git). - * Either `uri` or `repository` can be specified and is required. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * The URI of the repo (e.g. https://github.com/user/repo.git). - * Either `uri` or `repository` can be specified and is required. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * The connected repository resource name, in the format - * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or - * `repository` can be specified and is required. - * - * Generated from protobuf field string repository = 6 [(.google.api.resource_reference) = { - * @return string - */ - public function getRepository() - { - return $this->readOneof(6); - } - - public function hasRepository() - { - return $this->hasOneof(6); - } - - /** - * The connected repository resource name, in the format - * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or - * `repository` can be specified and is required. - * - * Generated from protobuf field string repository = 6 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * The branch or tag to use. Must start with "refs/" (required). - * - * Generated from protobuf field string ref = 2; - * @return string - */ - public function getRef() - { - return $this->ref; - } - - /** - * The branch or tag to use. Must start with "refs/" (required). - * - * Generated from protobuf field string ref = 2; - * @param string $var - * @return $this - */ - public function setRef($var) - { - GPBUtil::checkString($var, True); - $this->ref = $var; - - return $this; - } - - /** - * See RepoType below. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - * @return int - */ - public function getRepoType() - { - return $this->repo_type; - } - - /** - * See RepoType below. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - * @param int $var - * @return $this - */ - public function setRepoType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\GitFileSource\RepoType::class); - $this->repo_type = $var; - - return $this; - } - - /** - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * - * Generated from protobuf field string github_enterprise_config = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getGithubEnterpriseConfig() - { - return $this->readOneof(4); - } - - public function hasGithubEnterpriseConfig() - { - return $this->hasOneof(4); - } - - /** - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * - * Generated from protobuf field string github_enterprise_config = 4 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setGithubEnterpriseConfig($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getEnterpriseConfig() - { - return $this->whichOneof("enterprise_config"); - } - -} - diff --git a/Build/src/V1/GitSource.php b/Build/src/V1/GitSource.php deleted file mode 100644 index a61c0c27a654..000000000000 --- a/Build/src/V1/GitSource.php +++ /dev/null @@ -1,179 +0,0 @@ -google.devtools.cloudbuild.v1.GitSource - */ -class GitSource extends \Google\Protobuf\Internal\Message -{ - /** - * Location of the Git repo to build. - * This will be used as a `git remote`, see - * https://git-scm.com/docs/git-remote. - * - * Generated from protobuf field string url = 1; - */ - private $url = ''; - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 5; - */ - private $dir = ''; - /** - * The revision to fetch from the Git repository such as a branch, a tag, a - * commit SHA, or any Git ref. - * Cloud Build uses `git fetch` to fetch the revision from the Git - * repository; therefore make sure that the string you provide for `revision` - * is parsable by the command. For information on string values accepted by - * `git fetch`, see - * https://git-scm.com/docs/gitrevisions#_specifying_revisions. For - * information on `git fetch`, see https://git-scm.com/docs/git-fetch. - * - * Generated from protobuf field string revision = 6; - */ - private $revision = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $url - * Location of the Git repo to build. - * This will be used as a `git remote`, see - * https://git-scm.com/docs/git-remote. - * @type string $dir - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * @type string $revision - * The revision to fetch from the Git repository such as a branch, a tag, a - * commit SHA, or any Git ref. - * Cloud Build uses `git fetch` to fetch the revision from the Git - * repository; therefore make sure that the string you provide for `revision` - * is parsable by the command. For information on string values accepted by - * `git fetch`, see - * https://git-scm.com/docs/gitrevisions#_specifying_revisions. For - * information on `git fetch`, see https://git-scm.com/docs/git-fetch. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Location of the Git repo to build. - * This will be used as a `git remote`, see - * https://git-scm.com/docs/git-remote. - * - * Generated from protobuf field string url = 1; - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Location of the Git repo to build. - * This will be used as a `git remote`, see - * https://git-scm.com/docs/git-remote. - * - * Generated from protobuf field string url = 1; - * @param string $var - * @return $this - */ - public function setUrl($var) - { - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 5; - * @return string - */ - public function getDir() - { - return $this->dir; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 5; - * @param string $var - * @return $this - */ - public function setDir($var) - { - GPBUtil::checkString($var, True); - $this->dir = $var; - - return $this; - } - - /** - * The revision to fetch from the Git repository such as a branch, a tag, a - * commit SHA, or any Git ref. - * Cloud Build uses `git fetch` to fetch the revision from the Git - * repository; therefore make sure that the string you provide for `revision` - * is parsable by the command. For information on string values accepted by - * `git fetch`, see - * https://git-scm.com/docs/gitrevisions#_specifying_revisions. For - * information on `git fetch`, see https://git-scm.com/docs/git-fetch. - * - * Generated from protobuf field string revision = 6; - * @return string - */ - public function getRevision() - { - return $this->revision; - } - - /** - * The revision to fetch from the Git repository such as a branch, a tag, a - * commit SHA, or any Git ref. - * Cloud Build uses `git fetch` to fetch the revision from the Git - * repository; therefore make sure that the string you provide for `revision` - * is parsable by the command. For information on string values accepted by - * `git fetch`, see - * https://git-scm.com/docs/gitrevisions#_specifying_revisions. For - * information on `git fetch`, see https://git-scm.com/docs/git-fetch. - * - * Generated from protobuf field string revision = 6; - * @param string $var - * @return $this - */ - public function setRevision($var) - { - GPBUtil::checkString($var, True); - $this->revision = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Hash.php b/Build/src/V1/Hash.php deleted file mode 100644 index 90acb2067683..000000000000 --- a/Build/src/V1/Hash.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.cloudbuild.v1.Hash - */ -class Hash extends \Google\Protobuf\Internal\Message -{ - /** - * The type of hash that was performed. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Hash.HashType type = 1; - */ - private $type = 0; - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - */ - private $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * The type of hash that was performed. - * @type string $value - * The hash value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The type of hash that was performed. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Hash.HashType type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The type of hash that was performed. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Hash.HashType type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Hash\HashType::class); - $this->type = $var; - - return $this; - } - - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, False); - $this->value = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Hash/HashType.php b/Build/src/V1/Hash/HashType.php deleted file mode 100644 index dc9e57cde497..000000000000 --- a/Build/src/V1/Hash/HashType.php +++ /dev/null @@ -1,69 +0,0 @@ -google.devtools.cloudbuild.v1.Hash.HashType - */ -class HashType -{ - /** - * No hash requested. - * - * Generated from protobuf enum NONE = 0; - */ - const NONE = 0; - /** - * Use a sha256 hash. - * - * Generated from protobuf enum SHA256 = 1; - */ - const SHA256 = 1; - /** - * Use a md5 hash. - * - * Generated from protobuf enum MD5 = 2; - */ - const MD5 = 2; - /** - * Use a sha512 hash. - * - * Generated from protobuf enum SHA512 = 4; - */ - const SHA512 = 4; - - private static $valueToName = [ - self::NONE => 'NONE', - self::SHA256 => 'SHA256', - self::MD5 => 'MD5', - self::SHA512 => 'SHA512', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/InlineSecret.php b/Build/src/V1/InlineSecret.php deleted file mode 100644 index a53734ea10b1..000000000000 --- a/Build/src/V1/InlineSecret.php +++ /dev/null @@ -1,122 +0,0 @@ -google.devtools.cloudbuild.v1.InlineSecret - */ -class InlineSecret extends \Google\Protobuf\Internal\Message -{ - /** - * Resource name of Cloud KMS crypto key to decrypt the encrypted value. - * In format: projects/*/locations/*/keyRings/*/cryptoKeys/* - * - * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { - */ - private $kms_key_name = ''; - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map env_map = 2; - */ - private $env_map; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key_name - * Resource name of Cloud KMS crypto key to decrypt the encrypted value. - * In format: projects/*/locations/*/keyRings/*/cryptoKeys/* - * @type array|\Google\Protobuf\Internal\MapField $env_map - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Resource name of Cloud KMS crypto key to decrypt the encrypted value. - * In format: projects/*/locations/*/keyRings/*/cryptoKeys/* - * - * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * Resource name of Cloud KMS crypto key to decrypt the encrypted value. - * In format: projects/*/locations/*/keyRings/*/cryptoKeys/* - * - * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map env_map = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getEnvMap() - { - return $this->env_map; - } - - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map env_map = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setEnvMap($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::BYTES); - $this->env_map = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/ListBuildTriggersRequest.php b/Build/src/V1/ListBuildTriggersRequest.php deleted file mode 100644 index 94d313309171..000000000000 --- a/Build/src/V1/ListBuildTriggersRequest.php +++ /dev/null @@ -1,173 +0,0 @@ -google.devtools.cloudbuild.v1.ListBuildTriggersRequest - */ -class ListBuildTriggersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. ID of the project for which to list BuildTriggers. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * Token to provide to skip to a particular spot in the list. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * @type string $project_id - * Required. ID of the project for which to list BuildTriggers. - * @type int $page_size - * Number of results to return in the list. - * @type string $page_token - * Token to provide to skip to a particular spot in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. ID of the project for which to list BuildTriggers. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project for which to list BuildTriggers. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Token to provide to skip to a particular spot in the list. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Token to provide to skip to a particular spot in the list. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListBuildTriggersResponse.php b/Build/src/V1/ListBuildTriggersResponse.php deleted file mode 100644 index 50cb24a199a4..000000000000 --- a/Build/src/V1/ListBuildTriggersResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.cloudbuild.v1.ListBuildTriggersResponse - */ -class ListBuildTriggersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * `BuildTriggers` for the project, sorted by `create_time` descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildTrigger triggers = 1; - */ - private $triggers; - /** - * Token to receive the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\BuildTrigger>|\Google\Protobuf\Internal\RepeatedField $triggers - * `BuildTriggers` for the project, sorted by `create_time` descending. - * @type string $next_page_token - * Token to receive the next page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * `BuildTriggers` for the project, sorted by `create_time` descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildTrigger triggers = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTriggers() - { - return $this->triggers; - } - - /** - * `BuildTriggers` for the project, sorted by `create_time` descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildTrigger triggers = 1; - * @param array<\Google\Cloud\Build\V1\BuildTrigger>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTriggers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\BuildTrigger::class); - $this->triggers = $arr; - - return $this; - } - - /** - * Token to receive the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to receive the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListBuildsRequest.php b/Build/src/V1/ListBuildsRequest.php deleted file mode 100644 index 42f7e195bc96..000000000000 --- a/Build/src/V1/ListBuildsRequest.php +++ /dev/null @@ -1,227 +0,0 @@ -google.devtools.cloudbuild.v1.ListBuildsRequest - */ -class ListBuildsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 9 [(.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The page token for the next page of Builds. - * If unspecified, the first page of results is returned. - * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. - * In this case, the token should be discarded, and pagination should be - * restarted from the first page of results. - * See https://google.aip.dev/158 for more. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - /** - * The raw filter text to constrain the results. - * - * Generated from protobuf field string filter = 8; - */ - private $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * @type string $project_id - * Required. ID of the project. - * @type int $page_size - * Number of results to return in the list. - * @type string $page_token - * The page token for the next page of Builds. - * If unspecified, the first page of results is returned. - * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. - * In this case, the token should be discarded, and pagination should be - * restarted from the first page of results. - * See https://google.aip.dev/158 for more. - * @type string $filter - * The raw filter text to constrain the results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 9 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 9 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The page token for the next page of Builds. - * If unspecified, the first page of results is returned. - * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. - * In this case, the token should be discarded, and pagination should be - * restarted from the first page of results. - * See https://google.aip.dev/158 for more. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token for the next page of Builds. - * If unspecified, the first page of results is returned. - * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. - * In this case, the token should be discarded, and pagination should be - * restarted from the first page of results. - * See https://google.aip.dev/158 for more. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The raw filter text to constrain the results. - * - * Generated from protobuf field string filter = 8; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * The raw filter text to constrain the results. - * - * Generated from protobuf field string filter = 8; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListBuildsResponse.php b/Build/src/V1/ListBuildsResponse.php deleted file mode 100644 index 7a1a3b92d9a1..000000000000 --- a/Build/src/V1/ListBuildsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.cloudbuild.v1.ListBuildsResponse - */ -class ListBuildsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Builds will be sorted by `create_time`, descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build builds = 1; - */ - private $builds; - /** - * Token to receive the next page of results. - * This will be absent if the end of the response list has been reached. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\Build>|\Google\Protobuf\Internal\RepeatedField $builds - * Builds will be sorted by `create_time`, descending. - * @type string $next_page_token - * Token to receive the next page of results. - * This will be absent if the end of the response list has been reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Builds will be sorted by `create_time`, descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build builds = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBuilds() - { - return $this->builds; - } - - /** - * Builds will be sorted by `create_time`, descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build builds = 1; - * @param array<\Google\Cloud\Build\V1\Build>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBuilds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Build::class); - $this->builds = $arr; - - return $this; - } - - /** - * Token to receive the next page of results. - * This will be absent if the end of the response list has been reached. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to receive the next page of results. - * This will be absent if the end of the response list has been reached. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListWorkerPoolsRequest.php b/Build/src/V1/ListWorkerPoolsRequest.php deleted file mode 100644 index 0cedc7751e7d..000000000000 --- a/Build/src/V1/ListWorkerPoolsRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -google.devtools.cloudbuild.v1.ListWorkerPoolsRequest - */ -class ListWorkerPoolsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * The maximum number of `WorkerPool`s to return. The service may return - * fewer than this value. If omitted, the server will use a sensible default. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * A page token, received from a previous `ListWorkerPools` call. Provide this - * to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * @type int $page_size - * The maximum number of `WorkerPool`s to return. The service may return - * fewer than this value. If omitted, the server will use a sensible default. - * @type string $page_token - * A page token, received from a previous `ListWorkerPools` call. Provide this - * to retrieve the subsequent page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of `WorkerPool`s to return. The service may return - * fewer than this value. If omitted, the server will use a sensible default. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of `WorkerPool`s to return. The service may return - * fewer than this value. If omitted, the server will use a sensible default. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token, received from a previous `ListWorkerPools` call. Provide this - * to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, received from a previous `ListWorkerPools` call. Provide this - * to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListWorkerPoolsResponse.php b/Build/src/V1/ListWorkerPoolsResponse.php deleted file mode 100644 index 3cfe5574005e..000000000000 --- a/Build/src/V1/ListWorkerPoolsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.devtools.cloudbuild.v1.ListWorkerPoolsResponse - */ -class ListWorkerPoolsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * `WorkerPools` for the specified project. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.WorkerPool worker_pools = 1; - */ - private $worker_pools; - /** - * Continuation token used to page through large result sets. Provide this - * value in a subsequent ListWorkerPoolsRequest to return the next page of - * results. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\WorkerPool>|\Google\Protobuf\Internal\RepeatedField $worker_pools - * `WorkerPools` for the specified project. - * @type string $next_page_token - * Continuation token used to page through large result sets. Provide this - * value in a subsequent ListWorkerPoolsRequest to return the next page of - * results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * `WorkerPools` for the specified project. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.WorkerPool worker_pools = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWorkerPools() - { - return $this->worker_pools; - } - - /** - * `WorkerPools` for the specified project. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.WorkerPool worker_pools = 1; - * @param array<\Google\Cloud\Build\V1\WorkerPool>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWorkerPools($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\WorkerPool::class); - $this->worker_pools = $arr; - - return $this; - } - - /** - * Continuation token used to page through large result sets. Provide this - * value in a subsequent ListWorkerPoolsRequest to return the next page of - * results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Continuation token used to page through large result sets. Provide this - * value in a subsequent ListWorkerPoolsRequest to return the next page of - * results. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/PrivatePoolV1Config.php b/Build/src/V1/PrivatePoolV1Config.php deleted file mode 100644 index 28516dd12e2b..000000000000 --- a/Build/src/V1/PrivatePoolV1Config.php +++ /dev/null @@ -1,121 +0,0 @@ -google.devtools.cloudbuild.v1.PrivatePoolV1Config - */ -class PrivatePoolV1Config extends \Google\Protobuf\Internal\Message -{ - /** - * Machine configuration for the workers in the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig worker_config = 1; - */ - private $worker_config = null; - /** - * Network configuration for the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig network_config = 2; - */ - private $network_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\PrivatePoolV1Config\WorkerConfig $worker_config - * Machine configuration for the workers in the pool. - * @type \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig $network_config - * Network configuration for the pool. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Machine configuration for the workers in the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig worker_config = 1; - * @return \Google\Cloud\Build\V1\PrivatePoolV1Config\WorkerConfig|null - */ - public function getWorkerConfig() - { - return $this->worker_config; - } - - public function hasWorkerConfig() - { - return isset($this->worker_config); - } - - public function clearWorkerConfig() - { - unset($this->worker_config); - } - - /** - * Machine configuration for the workers in the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig worker_config = 1; - * @param \Google\Cloud\Build\V1\PrivatePoolV1Config\WorkerConfig $var - * @return $this - */ - public function setWorkerConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PrivatePoolV1Config\WorkerConfig::class); - $this->worker_config = $var; - - return $this; - } - - /** - * Network configuration for the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig network_config = 2; - * @return \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * Network configuration for the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig network_config = 2; - * @param \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/PrivatePoolV1Config/NetworkConfig.php b/Build/src/V1/PrivatePoolV1Config/NetworkConfig.php deleted file mode 100644 index bbead095f95e..000000000000 --- a/Build/src/V1/PrivatePoolV1Config/NetworkConfig.php +++ /dev/null @@ -1,192 +0,0 @@ -google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Immutable. The network definition that the workers are peered - * to. If this section is left empty, the workers will be peered to - * `WorkerPool.project_id` on the service producer network. Must be in the - * format `projects/{project}/global/networks/{network}`, where `{project}` - * is a project number, such as `12345`, and `{network}` is the name of a - * VPC network in the project. See - * [Understanding network configuration - * options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) - * - * Generated from protobuf field string peered_network = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $peered_network = ''; - /** - * Option to configure network egress for the workers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption egress_option = 2; - */ - private $egress_option = 0; - /** - * Immutable. Subnet IP range within the peered network. This is specified - * in CIDR notation with a slash and the subnet prefix size. You can - * optionally specify an IP address before the subnet prefix value. e.g. - * `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a - * prefix size of 29 bits. - * `/16` would specify a prefix size of 16 bits, with an automatically - * determined IP within the peered VPC. - * If unspecified, a value of `/24` will be used. - * - * Generated from protobuf field string peered_network_ip_range = 3 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $peered_network_ip_range = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $peered_network - * Required. Immutable. The network definition that the workers are peered - * to. If this section is left empty, the workers will be peered to - * `WorkerPool.project_id` on the service producer network. Must be in the - * format `projects/{project}/global/networks/{network}`, where `{project}` - * is a project number, such as `12345`, and `{network}` is the name of a - * VPC network in the project. See - * [Understanding network configuration - * options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) - * @type int $egress_option - * Option to configure network egress for the workers. - * @type string $peered_network_ip_range - * Immutable. Subnet IP range within the peered network. This is specified - * in CIDR notation with a slash and the subnet prefix size. You can - * optionally specify an IP address before the subnet prefix value. e.g. - * `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a - * prefix size of 29 bits. - * `/16` would specify a prefix size of 16 bits, with an automatically - * determined IP within the peered VPC. - * If unspecified, a value of `/24` will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. Immutable. The network definition that the workers are peered - * to. If this section is left empty, the workers will be peered to - * `WorkerPool.project_id` on the service producer network. Must be in the - * format `projects/{project}/global/networks/{network}`, where `{project}` - * is a project number, such as `12345`, and `{network}` is the name of a - * VPC network in the project. See - * [Understanding network configuration - * options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) - * - * Generated from protobuf field string peered_network = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getPeeredNetwork() - { - return $this->peered_network; - } - - /** - * Required. Immutable. The network definition that the workers are peered - * to. If this section is left empty, the workers will be peered to - * `WorkerPool.project_id` on the service producer network. Must be in the - * format `projects/{project}/global/networks/{network}`, where `{project}` - * is a project number, such as `12345`, and `{network}` is the name of a - * VPC network in the project. See - * [Understanding network configuration - * options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) - * - * Generated from protobuf field string peered_network = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setPeeredNetwork($var) - { - GPBUtil::checkString($var, True); - $this->peered_network = $var; - - return $this; - } - - /** - * Option to configure network egress for the workers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption egress_option = 2; - * @return int - */ - public function getEgressOption() - { - return $this->egress_option; - } - - /** - * Option to configure network egress for the workers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption egress_option = 2; - * @param int $var - * @return $this - */ - public function setEgressOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig\EgressOption::class); - $this->egress_option = $var; - - return $this; - } - - /** - * Immutable. Subnet IP range within the peered network. This is specified - * in CIDR notation with a slash and the subnet prefix size. You can - * optionally specify an IP address before the subnet prefix value. e.g. - * `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a - * prefix size of 29 bits. - * `/16` would specify a prefix size of 16 bits, with an automatically - * determined IP within the peered VPC. - * If unspecified, a value of `/24` will be used. - * - * Generated from protobuf field string peered_network_ip_range = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getPeeredNetworkIpRange() - { - return $this->peered_network_ip_range; - } - - /** - * Immutable. Subnet IP range within the peered network. This is specified - * in CIDR notation with a slash and the subnet prefix size. You can - * optionally specify an IP address before the subnet prefix value. e.g. - * `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a - * prefix size of 29 bits. - * `/16` would specify a prefix size of 16 bits, with an automatically - * determined IP within the peered VPC. - * If unspecified, a value of `/24` will be used. - * - * Generated from protobuf field string peered_network_ip_range = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setPeeredNetworkIpRange($var) - { - GPBUtil::checkString($var, True); - $this->peered_network_ip_range = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/PrivatePoolV1Config/NetworkConfig/EgressOption.php b/Build/src/V1/PrivatePoolV1Config/NetworkConfig/EgressOption.php deleted file mode 100644 index 9a572817a0ff..000000000000 --- a/Build/src/V1/PrivatePoolV1Config/NetworkConfig/EgressOption.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption - */ -class EgressOption -{ - /** - * If set, defaults to PUBLIC_EGRESS. - * - * Generated from protobuf enum EGRESS_OPTION_UNSPECIFIED = 0; - */ - const EGRESS_OPTION_UNSPECIFIED = 0; - /** - * If set, workers are created without any public address, which prevents - * network egress to public IPs unless a network proxy is configured. - * - * Generated from protobuf enum NO_PUBLIC_EGRESS = 1; - */ - const NO_PUBLIC_EGRESS = 1; - /** - * If set, workers are created with a public address which allows for - * public internet egress. - * - * Generated from protobuf enum PUBLIC_EGRESS = 2; - */ - const PUBLIC_EGRESS = 2; - - private static $valueToName = [ - self::EGRESS_OPTION_UNSPECIFIED => 'EGRESS_OPTION_UNSPECIFIED', - self::NO_PUBLIC_EGRESS => 'NO_PUBLIC_EGRESS', - self::PUBLIC_EGRESS => 'PUBLIC_EGRESS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/PrivatePoolV1Config/WorkerConfig.php b/Build/src/V1/PrivatePoolV1Config/WorkerConfig.php deleted file mode 100644 index e85f29d427bb..000000000000 --- a/Build/src/V1/PrivatePoolV1Config/WorkerConfig.php +++ /dev/null @@ -1,131 +0,0 @@ -google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig - */ -class WorkerConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Machine type of a worker, such as `e2-medium`. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * If left blank, Cloud Build will use a sensible default. - * - * Generated from protobuf field string machine_type = 1; - */ - private $machine_type = ''; - /** - * Size of the disk attached to the worker, in GB. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * Specify a value of up to 2000. If `0` is specified, Cloud Build will use - * a standard disk size. - * - * Generated from protobuf field int64 disk_size_gb = 2; - */ - private $disk_size_gb = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $machine_type - * Machine type of a worker, such as `e2-medium`. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * If left blank, Cloud Build will use a sensible default. - * @type int|string $disk_size_gb - * Size of the disk attached to the worker, in GB. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * Specify a value of up to 2000. If `0` is specified, Cloud Build will use - * a standard disk size. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Machine type of a worker, such as `e2-medium`. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * If left blank, Cloud Build will use a sensible default. - * - * Generated from protobuf field string machine_type = 1; - * @return string - */ - public function getMachineType() - { - return $this->machine_type; - } - - /** - * Machine type of a worker, such as `e2-medium`. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * If left blank, Cloud Build will use a sensible default. - * - * Generated from protobuf field string machine_type = 1; - * @param string $var - * @return $this - */ - public function setMachineType($var) - { - GPBUtil::checkString($var, True); - $this->machine_type = $var; - - return $this; - } - - /** - * Size of the disk attached to the worker, in GB. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * Specify a value of up to 2000. If `0` is specified, Cloud Build will use - * a standard disk size. - * - * Generated from protobuf field int64 disk_size_gb = 2; - * @return int|string - */ - public function getDiskSizeGb() - { - return $this->disk_size_gb; - } - - /** - * Size of the disk attached to the worker, in GB. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * Specify a value of up to 2000. If `0` is specified, Cloud Build will use - * a standard disk size. - * - * Generated from protobuf field int64 disk_size_gb = 2; - * @param int|string $var - * @return $this - */ - public function setDiskSizeGb($var) - { - GPBUtil::checkInt64($var); - $this->disk_size_gb = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/PubsubConfig.php b/Build/src/V1/PubsubConfig.php deleted file mode 100644 index 171f27eade61..000000000000 --- a/Build/src/V1/PubsubConfig.php +++ /dev/null @@ -1,182 +0,0 @@ -google.devtools.cloudbuild.v1.PubsubConfig - */ -class PubsubConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Name of the subscription. Format is - * `projects/{project}/subscriptions/{subscription}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $subscription = ''; - /** - * The name of the topic from which this subscription is receiving messages. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 2 [(.google.api.resource_reference) = { - */ - private $topic = ''; - /** - * Service account that will make the push request. - * - * Generated from protobuf field string service_account_email = 3 [(.google.api.resource_reference) = { - */ - private $service_account_email = ''; - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; - */ - private $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Output only. Name of the subscription. Format is - * `projects/{project}/subscriptions/{subscription}`. - * @type string $topic - * The name of the topic from which this subscription is receiving messages. - * Format is `projects/{project}/topics/{topic}`. - * @type string $service_account_email - * Service account that will make the push request. - * @type int $state - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Name of the subscription. Format is - * `projects/{project}/subscriptions/{subscription}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Output only. Name of the subscription. Format is - * `projects/{project}/subscriptions/{subscription}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - - /** - * The name of the topic from which this subscription is receiving messages. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * The name of the topic from which this subscription is receiving messages. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - - /** - * Service account that will make the push request. - * - * Generated from protobuf field string service_account_email = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * Service account that will make the push request. - * - * Generated from protobuf field string service_account_email = 3 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\PubsubConfig\State::class); - $this->state = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/PubsubConfig/State.php b/Build/src/V1/PubsubConfig/State.php deleted file mode 100644 index e77aa0f2ed2a..000000000000 --- a/Build/src/V1/PubsubConfig/State.php +++ /dev/null @@ -1,77 +0,0 @@ -google.devtools.cloudbuild.v1.PubsubConfig.State - */ -class State -{ - /** - * The subscription configuration has not been checked. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The Pub/Sub subscription is properly configured. - * - * Generated from protobuf enum OK = 1; - */ - const OK = 1; - /** - * The subscription has been deleted. - * - * Generated from protobuf enum SUBSCRIPTION_DELETED = 2; - */ - const SUBSCRIPTION_DELETED = 2; - /** - * The topic has been deleted. - * - * Generated from protobuf enum TOPIC_DELETED = 3; - */ - const TOPIC_DELETED = 3; - /** - * Some of the subscription's field are misconfigured. - * - * Generated from protobuf enum SUBSCRIPTION_MISCONFIGURED = 4; - */ - const SUBSCRIPTION_MISCONFIGURED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::OK => 'OK', - self::SUBSCRIPTION_DELETED => 'SUBSCRIPTION_DELETED', - self::TOPIC_DELETED => 'TOPIC_DELETED', - self::SUBSCRIPTION_MISCONFIGURED => 'SUBSCRIPTION_MISCONFIGURED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/PullRequestFilter.php b/Build/src/V1/PullRequestFilter.php deleted file mode 100644 index 3322956db206..000000000000 --- a/Build/src/V1/PullRequestFilter.php +++ /dev/null @@ -1,154 +0,0 @@ -google.devtools.cloudbuild.v1.PullRequestFilter - */ -class PullRequestFilter extends \Google\Protobuf\Internal\Message -{ - /** - * Configure builds to run whether a repository owner or collaborator need to - * comment `/gcbrun`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl comment_control = 5; - */ - private $comment_control = 0; - /** - * If true, branches that do NOT match the git_ref will trigger a build. - * - * Generated from protobuf field bool invert_regex = 6; - */ - private $invert_regex = false; - protected $git_ref; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $branch - * Regex of branches to match. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type int $comment_control - * Configure builds to run whether a repository owner or collaborator need to - * comment `/gcbrun`. - * @type bool $invert_regex - * If true, branches that do NOT match the git_ref will trigger a build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Regex of branches to match. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch = 2; - * @return string - */ - public function getBranch() - { - return $this->readOneof(2); - } - - public function hasBranch() - { - return $this->hasOneof(2); - } - - /** - * Regex of branches to match. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch = 2; - * @param string $var - * @return $this - */ - public function setBranch($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Configure builds to run whether a repository owner or collaborator need to - * comment `/gcbrun`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl comment_control = 5; - * @return int - */ - public function getCommentControl() - { - return $this->comment_control; - } - - /** - * Configure builds to run whether a repository owner or collaborator need to - * comment `/gcbrun`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl comment_control = 5; - * @param int $var - * @return $this - */ - public function setCommentControl($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\PullRequestFilter\CommentControl::class); - $this->comment_control = $var; - - return $this; - } - - /** - * If true, branches that do NOT match the git_ref will trigger a build. - * - * Generated from protobuf field bool invert_regex = 6; - * @return bool - */ - public function getInvertRegex() - { - return $this->invert_regex; - } - - /** - * If true, branches that do NOT match the git_ref will trigger a build. - * - * Generated from protobuf field bool invert_regex = 6; - * @param bool $var - * @return $this - */ - public function setInvertRegex($var) - { - GPBUtil::checkBool($var); - $this->invert_regex = $var; - - return $this; - } - - /** - * @return string - */ - public function getGitRef() - { - return $this->whichOneof("git_ref"); - } - -} - diff --git a/Build/src/V1/PullRequestFilter/CommentControl.php b/Build/src/V1/PullRequestFilter/CommentControl.php deleted file mode 100644 index 792c6e160508..000000000000 --- a/Build/src/V1/PullRequestFilter/CommentControl.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl - */ -class CommentControl -{ - /** - * Do not require comments on Pull Requests before builds are triggered. - * - * Generated from protobuf enum COMMENTS_DISABLED = 0; - */ - const COMMENTS_DISABLED = 0; - /** - * Enforce that repository owners or collaborators must comment on Pull - * Requests before builds are triggered. - * - * Generated from protobuf enum COMMENTS_ENABLED = 1; - */ - const COMMENTS_ENABLED = 1; - /** - * Enforce that repository owners or collaborators must comment on external - * contributors' Pull Requests before builds are triggered. - * - * Generated from protobuf enum COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2; - */ - const COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2; - - private static $valueToName = [ - self::COMMENTS_DISABLED => 'COMMENTS_DISABLED', - self::COMMENTS_ENABLED => 'COMMENTS_ENABLED', - self::COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY => 'COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/PushFilter.php b/Build/src/V1/PushFilter.php deleted file mode 100644 index cb49ff8c7ef5..000000000000 --- a/Build/src/V1/PushFilter.php +++ /dev/null @@ -1,158 +0,0 @@ -google.devtools.cloudbuild.v1.PushFilter - */ -class PushFilter extends \Google\Protobuf\Internal\Message -{ - /** - * When true, only trigger a build if the revision regex does NOT match the - * git_ref regex. - * - * Generated from protobuf field bool invert_regex = 4; - */ - private $invert_regex = false; - protected $git_ref; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $branch - * Regexes matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type string $tag - * Regexes matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type bool $invert_regex - * When true, only trigger a build if the revision regex does NOT match the - * git_ref regex. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Regexes matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch = 2; - * @return string - */ - public function getBranch() - { - return $this->readOneof(2); - } - - public function hasBranch() - { - return $this->hasOneof(2); - } - - /** - * Regexes matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch = 2; - * @param string $var - * @return $this - */ - public function setBranch($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Regexes matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string tag = 3; - * @return string - */ - public function getTag() - { - return $this->readOneof(3); - } - - public function hasTag() - { - return $this->hasOneof(3); - } - - /** - * Regexes matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string tag = 3; - * @param string $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * When true, only trigger a build if the revision regex does NOT match the - * git_ref regex. - * - * Generated from protobuf field bool invert_regex = 4; - * @return bool - */ - public function getInvertRegex() - { - return $this->invert_regex; - } - - /** - * When true, only trigger a build if the revision regex does NOT match the - * git_ref regex. - * - * Generated from protobuf field bool invert_regex = 4; - * @param bool $var - * @return $this - */ - public function setInvertRegex($var) - { - GPBUtil::checkBool($var); - $this->invert_regex = $var; - - return $this; - } - - /** - * @return string - */ - public function getGitRef() - { - return $this->whichOneof("git_ref"); - } - -} - diff --git a/Build/src/V1/ReceiveTriggerWebhookRequest.php b/Build/src/V1/ReceiveTriggerWebhookRequest.php deleted file mode 100644 index afaa1994e219..000000000000 --- a/Build/src/V1/ReceiveTriggerWebhookRequest.php +++ /dev/null @@ -1,218 +0,0 @@ -google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest - */ -class ReceiveTriggerWebhookRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 5; - */ - private $name = ''; - /** - * HTTP request body. - * - * Generated from protobuf field .google.api.HttpBody body = 1; - */ - private $body = null; - /** - * Project in which the specified trigger lives - * - * Generated from protobuf field string project_id = 2; - */ - private $project_id = ''; - /** - * Name of the trigger to run the payload against - * - * Generated from protobuf field string trigger = 3; - */ - private $trigger = ''; - /** - * Secret token used for authorization if an OAuth token isn't provided. - * - * Generated from protobuf field string secret = 4; - */ - private $secret = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type \Google\Api\HttpBody $body - * HTTP request body. - * @type string $project_id - * Project in which the specified trigger lives - * @type string $trigger - * Name of the trigger to run the payload against - * @type string $secret - * Secret token used for authorization if an OAuth token isn't provided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 5; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 5; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * HTTP request body. - * - * Generated from protobuf field .google.api.HttpBody body = 1; - * @return \Google\Api\HttpBody|null - */ - public function getBody() - { - return $this->body; - } - - public function hasBody() - { - return isset($this->body); - } - - public function clearBody() - { - unset($this->body); - } - - /** - * HTTP request body. - * - * Generated from protobuf field .google.api.HttpBody body = 1; - * @param \Google\Api\HttpBody $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkMessage($var, \Google\Api\HttpBody::class); - $this->body = $var; - - return $this; - } - - /** - * Project in which the specified trigger lives - * - * Generated from protobuf field string project_id = 2; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Project in which the specified trigger lives - * - * Generated from protobuf field string project_id = 2; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Name of the trigger to run the payload against - * - * Generated from protobuf field string trigger = 3; - * @return string - */ - public function getTrigger() - { - return $this->trigger; - } - - /** - * Name of the trigger to run the payload against - * - * Generated from protobuf field string trigger = 3; - * @param string $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkString($var, True); - $this->trigger = $var; - - return $this; - } - - /** - * Secret token used for authorization if an OAuth token isn't provided. - * - * Generated from protobuf field string secret = 4; - * @return string - */ - public function getSecret() - { - return $this->secret; - } - - /** - * Secret token used for authorization if an OAuth token isn't provided. - * - * Generated from protobuf field string secret = 4; - * @param string $var - * @return $this - */ - public function setSecret($var) - { - GPBUtil::checkString($var, True); - $this->secret = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ReceiveTriggerWebhookResponse.php b/Build/src/V1/ReceiveTriggerWebhookResponse.php deleted file mode 100644 index b83c62b3d78f..000000000000 --- a/Build/src/V1/ReceiveTriggerWebhookResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse - */ -class ReceiveTriggerWebhookResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - -} - diff --git a/Build/src/V1/RepoSource.php b/Build/src/V1/RepoSource.php deleted file mode 100644 index 2934cfdf9fd8..000000000000 --- a/Build/src/V1/RepoSource.php +++ /dev/null @@ -1,343 +0,0 @@ -google.devtools.cloudbuild.v1.RepoSource - */ -class RepoSource extends \Google\Protobuf\Internal\Message -{ - /** - * ID of the project that owns the Cloud Source Repository. If omitted, the - * project ID requesting the build is assumed. - * - * Generated from protobuf field string project_id = 1; - */ - private $project_id = ''; - /** - * Name of the Cloud Source Repository. - * - * Generated from protobuf field string repo_name = 2; - */ - private $repo_name = ''; - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 7; - */ - private $dir = ''; - /** - * Only trigger a build if the revision regex does NOT match the revision - * regex. - * - * Generated from protobuf field bool invert_regex = 8; - */ - private $invert_regex = false; - /** - * Substitutions to use in a triggered build. - * Should only be used with RunBuildTrigger - * - * Generated from protobuf field map substitutions = 9; - */ - private $substitutions; - protected $revision; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * ID of the project that owns the Cloud Source Repository. If omitted, the - * project ID requesting the build is assumed. - * @type string $repo_name - * Name of the Cloud Source Repository. - * @type string $branch_name - * Regex matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type string $tag_name - * Regex matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type string $commit_sha - * Explicit commit SHA to build. - * @type string $dir - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * @type bool $invert_regex - * Only trigger a build if the revision regex does NOT match the revision - * regex. - * @type array|\Google\Protobuf\Internal\MapField $substitutions - * Substitutions to use in a triggered build. - * Should only be used with RunBuildTrigger - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * ID of the project that owns the Cloud Source Repository. If omitted, the - * project ID requesting the build is assumed. - * - * Generated from protobuf field string project_id = 1; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * ID of the project that owns the Cloud Source Repository. If omitted, the - * project ID requesting the build is assumed. - * - * Generated from protobuf field string project_id = 1; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Name of the Cloud Source Repository. - * - * Generated from protobuf field string repo_name = 2; - * @return string - */ - public function getRepoName() - { - return $this->repo_name; - } - - /** - * Name of the Cloud Source Repository. - * - * Generated from protobuf field string repo_name = 2; - * @param string $var - * @return $this - */ - public function setRepoName($var) - { - GPBUtil::checkString($var, True); - $this->repo_name = $var; - - return $this; - } - - /** - * Regex matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch_name = 3; - * @return string - */ - public function getBranchName() - { - return $this->readOneof(3); - } - - public function hasBranchName() - { - return $this->hasOneof(3); - } - - /** - * Regex matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch_name = 3; - * @param string $var - * @return $this - */ - public function setBranchName($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Regex matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string tag_name = 4; - * @return string - */ - public function getTagName() - { - return $this->readOneof(4); - } - - public function hasTagName() - { - return $this->hasOneof(4); - } - - /** - * Regex matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string tag_name = 4; - * @param string $var - * @return $this - */ - public function setTagName($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Explicit commit SHA to build. - * - * Generated from protobuf field string commit_sha = 5; - * @return string - */ - public function getCommitSha() - { - return $this->readOneof(5); - } - - public function hasCommitSha() - { - return $this->hasOneof(5); - } - - /** - * Explicit commit SHA to build. - * - * Generated from protobuf field string commit_sha = 5; - * @param string $var - * @return $this - */ - public function setCommitSha($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 7; - * @return string - */ - public function getDir() - { - return $this->dir; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 7; - * @param string $var - * @return $this - */ - public function setDir($var) - { - GPBUtil::checkString($var, True); - $this->dir = $var; - - return $this; - } - - /** - * Only trigger a build if the revision regex does NOT match the revision - * regex. - * - * Generated from protobuf field bool invert_regex = 8; - * @return bool - */ - public function getInvertRegex() - { - return $this->invert_regex; - } - - /** - * Only trigger a build if the revision regex does NOT match the revision - * regex. - * - * Generated from protobuf field bool invert_regex = 8; - * @param bool $var - * @return $this - */ - public function setInvertRegex($var) - { - GPBUtil::checkBool($var); - $this->invert_regex = $var; - - return $this; - } - - /** - * Substitutions to use in a triggered build. - * Should only be used with RunBuildTrigger - * - * Generated from protobuf field map substitutions = 9; - * @return \Google\Protobuf\Internal\MapField - */ - public function getSubstitutions() - { - return $this->substitutions; - } - - /** - * Substitutions to use in a triggered build. - * Should only be used with RunBuildTrigger - * - * Generated from protobuf field map substitutions = 9; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setSubstitutions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->substitutions = $arr; - - return $this; - } - - /** - * @return string - */ - public function getRevision() - { - return $this->whichOneof("revision"); - } - -} - diff --git a/Build/src/V1/RepositoryEventConfig.php b/Build/src/V1/RepositoryEventConfig.php deleted file mode 100644 index 65a53c45f77b..000000000000 --- a/Build/src/V1/RepositoryEventConfig.php +++ /dev/null @@ -1,177 +0,0 @@ -google.devtools.cloudbuild.v1.RepositoryEventConfig - */ -class RepositoryEventConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the Repo API resource. - * - * Generated from protobuf field string repository = 1 [(.google.api.resource_reference) = { - */ - private $repository = ''; - /** - * Output only. The type of the SCM vendor the repository points to. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig.RepositoryType repository_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $repository_type = 0; - protected $filter; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repository - * The resource name of the Repo API resource. - * @type int $repository_type - * Output only. The type of the SCM vendor the repository points to. - * @type \Google\Cloud\Build\V1\PullRequestFilter $pull_request - * Filter to match changes in pull requests. - * @type \Google\Cloud\Build\V1\PushFilter $push - * Filter to match changes in refs like branches, tags. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the Repo API resource. - * - * Generated from protobuf field string repository = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getRepository() - { - return $this->repository; - } - - /** - * The resource name of the Repo API resource. - * - * Generated from protobuf field string repository = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->repository = $var; - - return $this; - } - - /** - * Output only. The type of the SCM vendor the repository points to. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig.RepositoryType repository_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRepositoryType() - { - return $this->repository_type; - } - - /** - * Output only. The type of the SCM vendor the repository points to. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig.RepositoryType repository_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRepositoryType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\RepositoryEventConfig\RepositoryType::class); - $this->repository_type = $var; - - return $this; - } - - /** - * Filter to match changes in pull requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter pull_request = 3; - * @return \Google\Cloud\Build\V1\PullRequestFilter|null - */ - public function getPullRequest() - { - return $this->readOneof(3); - } - - public function hasPullRequest() - { - return $this->hasOneof(3); - } - - /** - * Filter to match changes in pull requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter pull_request = 3; - * @param \Google\Cloud\Build\V1\PullRequestFilter $var - * @return $this - */ - public function setPullRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PullRequestFilter::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Filter to match changes in refs like branches, tags. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PushFilter push = 4; - * @return \Google\Cloud\Build\V1\PushFilter|null - */ - public function getPush() - { - return $this->readOneof(4); - } - - public function hasPush() - { - return $this->hasOneof(4); - } - - /** - * Filter to match changes in refs like branches, tags. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PushFilter push = 4; - * @param \Google\Cloud\Build\V1\PushFilter $var - * @return $this - */ - public function setPush($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PushFilter::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getFilter() - { - return $this->whichOneof("filter"); - } - -} - diff --git a/Build/src/V1/RepositoryEventConfig/RepositoryType.php b/Build/src/V1/RepositoryEventConfig/RepositoryType.php deleted file mode 100644 index 4b07027ca872..000000000000 --- a/Build/src/V1/RepositoryEventConfig/RepositoryType.php +++ /dev/null @@ -1,69 +0,0 @@ -google.devtools.cloudbuild.v1.RepositoryEventConfig.RepositoryType - */ -class RepositoryType -{ - /** - * If unspecified, RepositoryType defaults to GITHUB. - * - * Generated from protobuf enum REPOSITORY_TYPE_UNSPECIFIED = 0; - */ - const REPOSITORY_TYPE_UNSPECIFIED = 0; - /** - * The SCM repo is GITHUB. - * - * Generated from protobuf enum GITHUB = 1; - */ - const GITHUB = 1; - /** - * The SCM repo is GITHUB Enterprise. - * - * Generated from protobuf enum GITHUB_ENTERPRISE = 2; - */ - const GITHUB_ENTERPRISE = 2; - /** - * The SCM repo is GITLAB Enterprise. - * - * Generated from protobuf enum GITLAB_ENTERPRISE = 3; - */ - const GITLAB_ENTERPRISE = 3; - - private static $valueToName = [ - self::REPOSITORY_TYPE_UNSPECIFIED => 'REPOSITORY_TYPE_UNSPECIFIED', - self::GITHUB => 'GITHUB', - self::GITHUB_ENTERPRISE => 'GITHUB_ENTERPRISE', - self::GITLAB_ENTERPRISE => 'GITLAB_ENTERPRISE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/Results.php b/Build/src/V1/Results.php deleted file mode 100644 index 2313789d1151..000000000000 --- a/Build/src/V1/Results.php +++ /dev/null @@ -1,377 +0,0 @@ -google.devtools.cloudbuild.v1.Results - */ -class Results extends \Google\Protobuf\Internal\Message -{ - /** - * Container images that were built as a part of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuiltImage images = 2; - */ - private $images; - /** - * List of build step digests, in the order corresponding to build step - * indices. - * - * Generated from protobuf field repeated string build_step_images = 3; - */ - private $build_step_images; - /** - * Path to the artifact manifest for non-container artifacts uploaded to Cloud - * Storage. Only populated when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field string artifact_manifest = 4; - */ - private $artifact_manifest = ''; - /** - * Number of non-container artifacts uploaded to Cloud Storage. Only populated - * when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field int64 num_artifacts = 5; - */ - private $num_artifacts = 0; - /** - * List of build step outputs, produced by builder images, in the order - * corresponding to build step indices. - * [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) - * can produce this output by writing to `$BUILDER_OUTPUT/output`. - * Only the first 4KB of data is stored. - * - * Generated from protobuf field repeated bytes build_step_outputs = 6; - */ - private $build_step_outputs; - /** - * Time to push all non-container artifacts to Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan artifact_timing = 7; - */ - private $artifact_timing = null; - /** - * Python artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedPythonPackage python_packages = 8; - */ - private $python_packages; - /** - * Maven artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedMavenArtifact maven_artifacts = 9; - */ - private $maven_artifacts; - /** - * Npm packages uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedNpmPackage npm_packages = 12; - */ - private $npm_packages; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\BuiltImage>|\Google\Protobuf\Internal\RepeatedField $images - * Container images that were built as a part of the build. - * @type array|\Google\Protobuf\Internal\RepeatedField $build_step_images - * List of build step digests, in the order corresponding to build step - * indices. - * @type string $artifact_manifest - * Path to the artifact manifest for non-container artifacts uploaded to Cloud - * Storage. Only populated when artifacts are uploaded to Cloud Storage. - * @type int|string $num_artifacts - * Number of non-container artifacts uploaded to Cloud Storage. Only populated - * when artifacts are uploaded to Cloud Storage. - * @type array|\Google\Protobuf\Internal\RepeatedField $build_step_outputs - * List of build step outputs, produced by builder images, in the order - * corresponding to build step indices. - * [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) - * can produce this output by writing to `$BUILDER_OUTPUT/output`. - * Only the first 4KB of data is stored. - * @type \Google\Cloud\Build\V1\TimeSpan $artifact_timing - * Time to push all non-container artifacts to Cloud Storage. - * @type array<\Google\Cloud\Build\V1\UploadedPythonPackage>|\Google\Protobuf\Internal\RepeatedField $python_packages - * Python artifacts uploaded to Artifact Registry at the end of the build. - * @type array<\Google\Cloud\Build\V1\UploadedMavenArtifact>|\Google\Protobuf\Internal\RepeatedField $maven_artifacts - * Maven artifacts uploaded to Artifact Registry at the end of the build. - * @type array<\Google\Cloud\Build\V1\UploadedNpmPackage>|\Google\Protobuf\Internal\RepeatedField $npm_packages - * Npm packages uploaded to Artifact Registry at the end of the build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Container images that were built as a part of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuiltImage images = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * Container images that were built as a part of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuiltImage images = 2; - * @param array<\Google\Cloud\Build\V1\BuiltImage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\BuiltImage::class); - $this->images = $arr; - - return $this; - } - - /** - * List of build step digests, in the order corresponding to build step - * indices. - * - * Generated from protobuf field repeated string build_step_images = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBuildStepImages() - { - return $this->build_step_images; - } - - /** - * List of build step digests, in the order corresponding to build step - * indices. - * - * Generated from protobuf field repeated string build_step_images = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBuildStepImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->build_step_images = $arr; - - return $this; - } - - /** - * Path to the artifact manifest for non-container artifacts uploaded to Cloud - * Storage. Only populated when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field string artifact_manifest = 4; - * @return string - */ - public function getArtifactManifest() - { - return $this->artifact_manifest; - } - - /** - * Path to the artifact manifest for non-container artifacts uploaded to Cloud - * Storage. Only populated when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field string artifact_manifest = 4; - * @param string $var - * @return $this - */ - public function setArtifactManifest($var) - { - GPBUtil::checkString($var, True); - $this->artifact_manifest = $var; - - return $this; - } - - /** - * Number of non-container artifacts uploaded to Cloud Storage. Only populated - * when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field int64 num_artifacts = 5; - * @return int|string - */ - public function getNumArtifacts() - { - return $this->num_artifacts; - } - - /** - * Number of non-container artifacts uploaded to Cloud Storage. Only populated - * when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field int64 num_artifacts = 5; - * @param int|string $var - * @return $this - */ - public function setNumArtifacts($var) - { - GPBUtil::checkInt64($var); - $this->num_artifacts = $var; - - return $this; - } - - /** - * List of build step outputs, produced by builder images, in the order - * corresponding to build step indices. - * [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) - * can produce this output by writing to `$BUILDER_OUTPUT/output`. - * Only the first 4KB of data is stored. - * - * Generated from protobuf field repeated bytes build_step_outputs = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBuildStepOutputs() - { - return $this->build_step_outputs; - } - - /** - * List of build step outputs, produced by builder images, in the order - * corresponding to build step indices. - * [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) - * can produce this output by writing to `$BUILDER_OUTPUT/output`. - * Only the first 4KB of data is stored. - * - * Generated from protobuf field repeated bytes build_step_outputs = 6; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBuildStepOutputs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); - $this->build_step_outputs = $arr; - - return $this; - } - - /** - * Time to push all non-container artifacts to Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan artifact_timing = 7; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getArtifactTiming() - { - return $this->artifact_timing; - } - - public function hasArtifactTiming() - { - return isset($this->artifact_timing); - } - - public function clearArtifactTiming() - { - unset($this->artifact_timing); - } - - /** - * Time to push all non-container artifacts to Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan artifact_timing = 7; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setArtifactTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->artifact_timing = $var; - - return $this; - } - - /** - * Python artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedPythonPackage python_packages = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPythonPackages() - { - return $this->python_packages; - } - - /** - * Python artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedPythonPackage python_packages = 8; - * @param array<\Google\Cloud\Build\V1\UploadedPythonPackage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPythonPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\UploadedPythonPackage::class); - $this->python_packages = $arr; - - return $this; - } - - /** - * Maven artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedMavenArtifact maven_artifacts = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMavenArtifacts() - { - return $this->maven_artifacts; - } - - /** - * Maven artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedMavenArtifact maven_artifacts = 9; - * @param array<\Google\Cloud\Build\V1\UploadedMavenArtifact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMavenArtifacts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\UploadedMavenArtifact::class); - $this->maven_artifacts = $arr; - - return $this; - } - - /** - * Npm packages uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedNpmPackage npm_packages = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNpmPackages() - { - return $this->npm_packages; - } - - /** - * Npm packages uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedNpmPackage npm_packages = 12; - * @param array<\Google\Cloud\Build\V1\UploadedNpmPackage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNpmPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\UploadedNpmPackage::class); - $this->npm_packages = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/RetryBuildRequest.php b/Build/src/V1/RetryBuildRequest.php deleted file mode 100644 index 7cb6776d63cc..000000000000 --- a/Build/src/V1/RetryBuildRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.RetryBuildRequest - */ -class RetryBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. Build ID of the original build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @type string $project_id - * Required. ID of the project. - * @type string $id - * Required. Build ID of the original build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. Build ID of the original build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Required. Build ID of the original build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/RunBuildTriggerRequest.php b/Build/src/V1/RunBuildTriggerRequest.php deleted file mode 100644 index 2c6f2ca0fd77..000000000000 --- a/Build/src/V1/RunBuildTriggerRequest.php +++ /dev/null @@ -1,187 +0,0 @@ -google.devtools.cloudbuild.v1.RunBuildTriggerRequest - */ -class RunBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the trigger. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger_id = ''; - /** - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource source = 3; - */ - private $source = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type string $project_id - * Required. ID of the project. - * @type string $trigger_id - * Required. ID of the trigger. - * @type \Google\Cloud\Build\V1\RepoSource $source - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the trigger. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTriggerId() - { - return $this->trigger_id; - } - - /** - * Required. ID of the trigger. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->trigger_id = $var; - - return $this; - } - - /** - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource source = 3; - * @return \Google\Cloud\Build\V1\RepoSource|null - */ - public function getSource() - { - return $this->source; - } - - public function hasSource() - { - return isset($this->source); - } - - public function clearSource() - { - unset($this->source); - } - - /** - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource source = 3; - * @param \Google\Cloud\Build\V1\RepoSource $var - * @return $this - */ - public function setSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepoSource::class); - $this->source = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Secret.php b/Build/src/V1/Secret.php deleted file mode 100644 index 9fd4c09d1699..000000000000 --- a/Build/src/V1/Secret.php +++ /dev/null @@ -1,121 +0,0 @@ -google.devtools.cloudbuild.v1.Secret - */ -class Secret extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud KMS key name to use to decrypt these envs. - * - * Generated from protobuf field string kms_key_name = 1; - */ - private $kms_key_name = ''; - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map secret_env = 3; - */ - private $secret_env; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key_name - * Cloud KMS key name to use to decrypt these envs. - * @type array|\Google\Protobuf\Internal\MapField $secret_env - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Cloud KMS key name to use to decrypt these envs. - * - * Generated from protobuf field string kms_key_name = 1; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * Cloud KMS key name to use to decrypt these envs. - * - * Generated from protobuf field string kms_key_name = 1; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map secret_env = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getSecretEnv() - { - return $this->secret_env; - } - - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map secret_env = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setSecretEnv($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::BYTES); - $this->secret_env = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/SecretManagerSecret.php b/Build/src/V1/SecretManagerSecret.php deleted file mode 100644 index 711adededa11..000000000000 --- a/Build/src/V1/SecretManagerSecret.php +++ /dev/null @@ -1,113 +0,0 @@ -google.devtools.cloudbuild.v1.SecretManagerSecret - */ -class SecretManagerSecret extends \Google\Protobuf\Internal\Message -{ - /** - * Resource name of the SecretVersion. In format: - * projects/*/secrets/*/versions/* - * - * Generated from protobuf field string version_name = 1 [(.google.api.resource_reference) = { - */ - private $version_name = ''; - /** - * Environment variable name to associate with the secret. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. - * - * Generated from protobuf field string env = 2; - */ - private $env = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version_name - * Resource name of the SecretVersion. In format: - * projects/*/secrets/*/versions/* - * @type string $env - * Environment variable name to associate with the secret. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Resource name of the SecretVersion. In format: - * projects/*/secrets/*/versions/* - * - * Generated from protobuf field string version_name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getVersionName() - { - return $this->version_name; - } - - /** - * Resource name of the SecretVersion. In format: - * projects/*/secrets/*/versions/* - * - * Generated from protobuf field string version_name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setVersionName($var) - { - GPBUtil::checkString($var, True); - $this->version_name = $var; - - return $this; - } - - /** - * Environment variable name to associate with the secret. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. - * - * Generated from protobuf field string env = 2; - * @return string - */ - public function getEnv() - { - return $this->env; - } - - /** - * Environment variable name to associate with the secret. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. - * - * Generated from protobuf field string env = 2; - * @param string $var - * @return $this - */ - public function setEnv($var) - { - GPBUtil::checkString($var, True); - $this->env = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Secrets.php b/Build/src/V1/Secrets.php deleted file mode 100644 index b43d3c3f25c2..000000000000 --- a/Build/src/V1/Secrets.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.cloudbuild.v1.Secrets - */ -class Secrets extends \Google\Protobuf\Internal\Message -{ - /** - * Secrets in Secret Manager and associated secret environment variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.SecretManagerSecret secret_manager = 1; - */ - private $secret_manager; - /** - * Secrets encrypted with KMS key and the associated secret environment - * variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.InlineSecret inline = 2; - */ - private $inline; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\SecretManagerSecret>|\Google\Protobuf\Internal\RepeatedField $secret_manager - * Secrets in Secret Manager and associated secret environment variable. - * @type array<\Google\Cloud\Build\V1\InlineSecret>|\Google\Protobuf\Internal\RepeatedField $inline - * Secrets encrypted with KMS key and the associated secret environment - * variable. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Secrets in Secret Manager and associated secret environment variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.SecretManagerSecret secret_manager = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecretManager() - { - return $this->secret_manager; - } - - /** - * Secrets in Secret Manager and associated secret environment variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.SecretManagerSecret secret_manager = 1; - * @param array<\Google\Cloud\Build\V1\SecretManagerSecret>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecretManager($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\SecretManagerSecret::class); - $this->secret_manager = $arr; - - return $this; - } - - /** - * Secrets encrypted with KMS key and the associated secret environment - * variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.InlineSecret inline = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInline() - { - return $this->inline; - } - - /** - * Secrets encrypted with KMS key and the associated secret environment - * variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.InlineSecret inline = 2; - * @param array<\Google\Cloud\Build\V1\InlineSecret>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInline($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\InlineSecret::class); - $this->inline = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/Source.php b/Build/src/V1/Source.php deleted file mode 100644 index 62906bcf427a..000000000000 --- a/Build/src/V1/Source.php +++ /dev/null @@ -1,183 +0,0 @@ -google.devtools.cloudbuild.v1.Source - */ -class Source extends \Google\Protobuf\Internal\Message -{ - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\StorageSource $storage_source - * If provided, get the source from this location in Cloud Storage. - * @type \Google\Cloud\Build\V1\RepoSource $repo_source - * If provided, get the source from this location in a Cloud Source - * Repository. - * @type \Google\Cloud\Build\V1\GitSource $git_source - * If provided, get the source from this Git repository. - * @type \Google\Cloud\Build\V1\StorageSourceManifest $storage_source_manifest - * If provided, get the source from this manifest in Cloud Storage. - * This feature is in Preview; see description - * [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * If provided, get the source from this location in Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource storage_source = 2; - * @return \Google\Cloud\Build\V1\StorageSource|null - */ - public function getStorageSource() - { - return $this->readOneof(2); - } - - public function hasStorageSource() - { - return $this->hasOneof(2); - } - - /** - * If provided, get the source from this location in Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource storage_source = 2; - * @param \Google\Cloud\Build\V1\StorageSource $var - * @return $this - */ - public function setStorageSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * If provided, get the source from this location in a Cloud Source - * Repository. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource repo_source = 3; - * @return \Google\Cloud\Build\V1\RepoSource|null - */ - public function getRepoSource() - { - return $this->readOneof(3); - } - - public function hasRepoSource() - { - return $this->hasOneof(3); - } - - /** - * If provided, get the source from this location in a Cloud Source - * Repository. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource repo_source = 3; - * @param \Google\Cloud\Build\V1\RepoSource $var - * @return $this - */ - public function setRepoSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepoSource::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * If provided, get the source from this Git repository. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitSource git_source = 5; - * @return \Google\Cloud\Build\V1\GitSource|null - */ - public function getGitSource() - { - return $this->readOneof(5); - } - - public function hasGitSource() - { - return $this->hasOneof(5); - } - - /** - * If provided, get the source from this Git repository. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitSource git_source = 5; - * @param \Google\Cloud\Build\V1\GitSource $var - * @return $this - */ - public function setGitSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitSource::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * If provided, get the source from this manifest in Cloud Storage. - * This feature is in Preview; see description - * [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest storage_source_manifest = 8; - * @return \Google\Cloud\Build\V1\StorageSourceManifest|null - */ - public function getStorageSourceManifest() - { - return $this->readOneof(8); - } - - public function hasStorageSourceManifest() - { - return $this->hasOneof(8); - } - - /** - * If provided, get the source from this manifest in Cloud Storage. - * This feature is in Preview; see description - * [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest storage_source_manifest = 8; - * @param \Google\Cloud\Build\V1\StorageSourceManifest $var - * @return $this - */ - public function setStorageSourceManifest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSourceManifest::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/Build/src/V1/SourceProvenance.php b/Build/src/V1/SourceProvenance.php deleted file mode 100644 index 26f8a91c1e55..000000000000 --- a/Build/src/V1/SourceProvenance.php +++ /dev/null @@ -1,244 +0,0 @@ -google.devtools.cloudbuild.v1.SourceProvenance - */ -class SourceProvenance extends \Google\Protobuf\Internal\Message -{ - /** - * A copy of the build's `source.storage_source`, if exists, with any - * generations resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource resolved_storage_source = 3; - */ - private $resolved_storage_source = null; - /** - * A copy of the build's `source.repo_source`, if exists, with any - * revisions resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource resolved_repo_source = 6; - */ - private $resolved_repo_source = null; - /** - * A copy of the build's `source.storage_source_manifest`, if exists, with any - * revisions resolved. - * This feature is in Preview. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest resolved_storage_source_manifest = 9; - */ - private $resolved_storage_source_manifest = null; - /** - * Output only. Hash(es) of the build source, which can be used to verify that - * the original source integrity was maintained in the build. Note that - * `FileHashes` will only be populated if `BuildOptions` has requested a - * `SourceProvenanceHash`. - * The keys to this map are file paths used as build source and the values - * contain the hash values for those files. - * If the build source came in a single package such as a gzipped tarfile - * (`.tar.gz`), the `FileHash` will be for the single path to that file. - * - * Generated from protobuf field map file_hashes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $file_hashes; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\StorageSource $resolved_storage_source - * A copy of the build's `source.storage_source`, if exists, with any - * generations resolved. - * @type \Google\Cloud\Build\V1\RepoSource $resolved_repo_source - * A copy of the build's `source.repo_source`, if exists, with any - * revisions resolved. - * @type \Google\Cloud\Build\V1\StorageSourceManifest $resolved_storage_source_manifest - * A copy of the build's `source.storage_source_manifest`, if exists, with any - * revisions resolved. - * This feature is in Preview. - * @type array|\Google\Protobuf\Internal\MapField $file_hashes - * Output only. Hash(es) of the build source, which can be used to verify that - * the original source integrity was maintained in the build. Note that - * `FileHashes` will only be populated if `BuildOptions` has requested a - * `SourceProvenanceHash`. - * The keys to this map are file paths used as build source and the values - * contain the hash values for those files. - * If the build source came in a single package such as a gzipped tarfile - * (`.tar.gz`), the `FileHash` will be for the single path to that file. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * A copy of the build's `source.storage_source`, if exists, with any - * generations resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource resolved_storage_source = 3; - * @return \Google\Cloud\Build\V1\StorageSource|null - */ - public function getResolvedStorageSource() - { - return $this->resolved_storage_source; - } - - public function hasResolvedStorageSource() - { - return isset($this->resolved_storage_source); - } - - public function clearResolvedStorageSource() - { - unset($this->resolved_storage_source); - } - - /** - * A copy of the build's `source.storage_source`, if exists, with any - * generations resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource resolved_storage_source = 3; - * @param \Google\Cloud\Build\V1\StorageSource $var - * @return $this - */ - public function setResolvedStorageSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSource::class); - $this->resolved_storage_source = $var; - - return $this; - } - - /** - * A copy of the build's `source.repo_source`, if exists, with any - * revisions resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource resolved_repo_source = 6; - * @return \Google\Cloud\Build\V1\RepoSource|null - */ - public function getResolvedRepoSource() - { - return $this->resolved_repo_source; - } - - public function hasResolvedRepoSource() - { - return isset($this->resolved_repo_source); - } - - public function clearResolvedRepoSource() - { - unset($this->resolved_repo_source); - } - - /** - * A copy of the build's `source.repo_source`, if exists, with any - * revisions resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource resolved_repo_source = 6; - * @param \Google\Cloud\Build\V1\RepoSource $var - * @return $this - */ - public function setResolvedRepoSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepoSource::class); - $this->resolved_repo_source = $var; - - return $this; - } - - /** - * A copy of the build's `source.storage_source_manifest`, if exists, with any - * revisions resolved. - * This feature is in Preview. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest resolved_storage_source_manifest = 9; - * @return \Google\Cloud\Build\V1\StorageSourceManifest|null - */ - public function getResolvedStorageSourceManifest() - { - return $this->resolved_storage_source_manifest; - } - - public function hasResolvedStorageSourceManifest() - { - return isset($this->resolved_storage_source_manifest); - } - - public function clearResolvedStorageSourceManifest() - { - unset($this->resolved_storage_source_manifest); - } - - /** - * A copy of the build's `source.storage_source_manifest`, if exists, with any - * revisions resolved. - * This feature is in Preview. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest resolved_storage_source_manifest = 9; - * @param \Google\Cloud\Build\V1\StorageSourceManifest $var - * @return $this - */ - public function setResolvedStorageSourceManifest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSourceManifest::class); - $this->resolved_storage_source_manifest = $var; - - return $this; - } - - /** - * Output only. Hash(es) of the build source, which can be used to verify that - * the original source integrity was maintained in the build. Note that - * `FileHashes` will only be populated if `BuildOptions` has requested a - * `SourceProvenanceHash`. - * The keys to this map are file paths used as build source and the values - * contain the hash values for those files. - * If the build source came in a single package such as a gzipped tarfile - * (`.tar.gz`), the `FileHash` will be for the single path to that file. - * - * Generated from protobuf field map file_hashes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getFileHashes() - { - return $this->file_hashes; - } - - /** - * Output only. Hash(es) of the build source, which can be used to verify that - * the original source integrity was maintained in the build. Note that - * `FileHashes` will only be populated if `BuildOptions` has requested a - * `SourceProvenanceHash`. - * The keys to this map are file paths used as build source and the values - * contain the hash values for those files. - * If the build source came in a single package such as a gzipped tarfile - * (`.tar.gz`), the `FileHash` will be for the single path to that file. - * - * Generated from protobuf field map file_hashes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setFileHashes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hashes = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/StorageSource.php b/Build/src/V1/StorageSource.php deleted file mode 100644 index afc0ea14f43b..000000000000 --- a/Build/src/V1/StorageSource.php +++ /dev/null @@ -1,189 +0,0 @@ -google.devtools.cloudbuild.v1.StorageSource - */ -class StorageSource extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - */ - private $bucket = ''; - /** - * Cloud Storage object containing the source. - * This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) - * containing source to build. - * - * Generated from protobuf field string object = 2; - */ - private $object = ''; - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - */ - private $generation = 0; - /** - * Option to specify the tool to fetch the source file for the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource.SourceFetcher source_fetcher = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $source_fetcher = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bucket - * Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * @type string $object - * Cloud Storage object containing the source. - * This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) - * containing source to build. - * @type int|string $generation - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * @type int $source_fetcher - * Option to specify the tool to fetch the source file for the build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * Cloud Storage object containing the source. - * This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) - * containing source to build. - * - * Generated from protobuf field string object = 2; - * @return string - */ - public function getObject() - { - return $this->object; - } - - /** - * Cloud Storage object containing the source. - * This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) - * containing source to build. - * - * Generated from protobuf field string object = 2; - * @param string $var - * @return $this - */ - public function setObject($var) - { - GPBUtil::checkString($var, True); - $this->object = $var; - - return $this; - } - - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - - /** - * Option to specify the tool to fetch the source file for the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource.SourceFetcher source_fetcher = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSourceFetcher() - { - return $this->source_fetcher; - } - - /** - * Option to specify the tool to fetch the source file for the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource.SourceFetcher source_fetcher = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSourceFetcher($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\StorageSource\SourceFetcher::class); - $this->source_fetcher = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/StorageSource/SourceFetcher.php b/Build/src/V1/StorageSource/SourceFetcher.php deleted file mode 100644 index 5e9c05c7a010..000000000000 --- a/Build/src/V1/StorageSource/SourceFetcher.php +++ /dev/null @@ -1,62 +0,0 @@ -google.devtools.cloudbuild.v1.StorageSource.SourceFetcher - */ -class SourceFetcher -{ - /** - * Unspecified. Defaults to GSUTIL. - * - * Generated from protobuf enum SOURCE_FETCHER_UNSPECIFIED = 0; - */ - const SOURCE_FETCHER_UNSPECIFIED = 0; - /** - * Use the "gsutil" tool to download the source file. - * - * Generated from protobuf enum GSUTIL = 1; - */ - const GSUTIL = 1; - /** - * Use the Cloud Storage Fetcher tool to download the source file. - * - * Generated from protobuf enum GCS_FETCHER = 2; - */ - const GCS_FETCHER = 2; - - private static $valueToName = [ - self::SOURCE_FETCHER_UNSPECIFIED => 'SOURCE_FETCHER_UNSPECIFIED', - self::GSUTIL => 'GSUTIL', - self::GCS_FETCHER => 'GCS_FETCHER', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/StorageSourceManifest.php b/Build/src/V1/StorageSourceManifest.php deleted file mode 100644 index 74cd6e2b6522..000000000000 --- a/Build/src/V1/StorageSourceManifest.php +++ /dev/null @@ -1,153 +0,0 @@ -google.devtools.cloudbuild.v1.StorageSourceManifest - */ -class StorageSourceManifest extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage bucket containing the source manifest (see [Bucket - * Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - */ - private $bucket = ''; - /** - * Cloud Storage object containing the source manifest. - * This object must be a JSON file. - * - * Generated from protobuf field string object = 2; - */ - private $object = ''; - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - */ - private $generation = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bucket - * Cloud Storage bucket containing the source manifest (see [Bucket - * Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * @type string $object - * Cloud Storage object containing the source manifest. - * This object must be a JSON file. - * @type int|string $generation - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage bucket containing the source manifest (see [Bucket - * Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Cloud Storage bucket containing the source manifest (see [Bucket - * Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * Cloud Storage object containing the source manifest. - * This object must be a JSON file. - * - * Generated from protobuf field string object = 2; - * @return string - */ - public function getObject() - { - return $this->object; - } - - /** - * Cloud Storage object containing the source manifest. - * This object must be a JSON file. - * - * Generated from protobuf field string object = 2; - * @param string $var - * @return $this - */ - public function setObject($var) - { - GPBUtil::checkString($var, True); - $this->object = $var; - - return $this; - } - - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/TimeSpan.php b/Build/src/V1/TimeSpan.php deleted file mode 100644 index bb5d10e292a4..000000000000 --- a/Build/src/V1/TimeSpan.php +++ /dev/null @@ -1,121 +0,0 @@ -google.devtools.cloudbuild.v1.TimeSpan - */ -class TimeSpan extends \Google\Protobuf\Internal\Message -{ - /** - * Start of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - private $start_time = null; - /** - * End of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - private $end_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Start of time span. - * @type \Google\Protobuf\Timestamp $end_time - * End of time span. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Start of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Start of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * End of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * End of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UpdateBuildTriggerRequest.php b/Build/src/V1/UpdateBuildTriggerRequest.php deleted file mode 100644 index 4575fec5ff11..000000000000 --- a/Build/src/V1/UpdateBuildTriggerRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest - */ -class UpdateBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the `BuildTrigger` to update. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger_id = ''; - /** - * Required. `BuildTrigger` to update. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger = null; - /** - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. ID of the project that owns the trigger. - * @type string $trigger_id - * Required. ID of the `BuildTrigger` to update. - * @type \Google\Cloud\Build\V1\BuildTrigger $trigger - * Required. `BuildTrigger` to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the `BuildTrigger` to update. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTriggerId() - { - return $this->trigger_id; - } - - /** - * Required. ID of the `BuildTrigger` to update. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->trigger_id = $var; - - return $this; - } - - /** - * Required. `BuildTrigger` to update. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\BuildTrigger|null - */ - public function getTrigger() - { - return $this->trigger; - } - - public function hasTrigger() - { - return isset($this->trigger); - } - - public function clearTrigger() - { - unset($this->trigger); - } - - /** - * Required. `BuildTrigger` to update. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\BuildTrigger $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildTrigger::class); - $this->trigger = $var; - - return $this; - } - - /** - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UpdateWorkerPoolOperationMetadata.php b/Build/src/V1/UpdateWorkerPoolOperationMetadata.php deleted file mode 100644 index ac35538bc7c8..000000000000 --- a/Build/src/V1/UpdateWorkerPoolOperationMetadata.php +++ /dev/null @@ -1,163 +0,0 @@ -google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata - */ -class UpdateWorkerPoolOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the `WorkerPool` being updated. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - */ - private $worker_pool = ''; - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - */ - private $create_time = null; - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - */ - private $complete_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $worker_pool - * The resource name of the `WorkerPool` being updated. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * @type \Google\Protobuf\Timestamp $create_time - * Time the operation was created. - * @type \Google\Protobuf\Timestamp $complete_time - * Time the operation was completed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the `WorkerPool` being updated. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - /** - * The resource name of the `WorkerPool` being updated. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkString($var, True); - $this->worker_pool = $var; - - return $this; - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCompleteTime() - { - return $this->complete_time; - } - - public function hasCompleteTime() - { - return isset($this->complete_time); - } - - public function clearCompleteTime() - { - unset($this->complete_time); - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCompleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->complete_time = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UpdateWorkerPoolRequest.php b/Build/src/V1/UpdateWorkerPoolRequest.php deleted file mode 100644 index e4ff97b5d993..000000000000 --- a/Build/src/V1/UpdateWorkerPoolRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest - */ -class UpdateWorkerPoolRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `WorkerPool` to update. - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $worker_pool = null; - /** - * A mask specifying which fields in `worker_pool` to update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - private $update_mask = null; - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - */ - private $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\WorkerPool $worker_pool - * Required. The `WorkerPool` to update. - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @type \Google\Protobuf\FieldMask $update_mask - * A mask specifying which fields in `worker_pool` to update. - * @type bool $validate_only - * If set, validate the request and preview the response, but do not actually - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `WorkerPool` to update. - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\WorkerPool|null - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - public function hasWorkerPool() - { - return isset($this->worker_pool); - } - - public function clearWorkerPool() - { - unset($this->worker_pool); - } - - /** - * Required. The `WorkerPool` to update. - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\WorkerPool $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\WorkerPool::class); - $this->worker_pool = $var; - - return $this; - } - - /** - * A mask specifying which fields in `worker_pool` to update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * A mask specifying which fields in `worker_pool` to update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UploadedMavenArtifact.php b/Build/src/V1/UploadedMavenArtifact.php deleted file mode 100644 index 4f3afc223d21..000000000000 --- a/Build/src/V1/UploadedMavenArtifact.php +++ /dev/null @@ -1,155 +0,0 @@ -google.devtools.cloudbuild.v1.UploadedMavenArtifact - */ -class UploadedMavenArtifact extends \Google\Protobuf\Internal\Message -{ - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - */ - private $uri = ''; - /** - * Hash types and values of the Maven Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - */ - private $file_hashes = null; - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $push_timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * URI of the uploaded artifact. - * @type \Google\Cloud\Build\V1\FileHashes $file_hashes - * Hash types and values of the Maven Artifact. - * @type \Google\Cloud\Build\V1\TimeSpan $push_timing - * Output only. Stores timing information for pushing the specified artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Hash types and values of the Maven Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @return \Google\Cloud\Build\V1\FileHashes|null - */ - public function getFileHashes() - { - return $this->file_hashes; - } - - public function hasFileHashes() - { - return isset($this->file_hashes); - } - - public function clearFileHashes() - { - unset($this->file_hashes); - } - - /** - * Hash types and values of the Maven Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @param \Google\Cloud\Build\V1\FileHashes $var - * @return $this - */ - public function setFileHashes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hashes = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPushTiming() - { - return $this->push_timing; - } - - public function hasPushTiming() - { - return isset($this->push_timing); - } - - public function clearPushTiming() - { - unset($this->push_timing); - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPushTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->push_timing = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UploadedNpmPackage.php b/Build/src/V1/UploadedNpmPackage.php deleted file mode 100644 index 042e1f3ee66c..000000000000 --- a/Build/src/V1/UploadedNpmPackage.php +++ /dev/null @@ -1,156 +0,0 @@ -google.devtools.cloudbuild.v1.UploadedNpmPackage - */ -class UploadedNpmPackage extends \Google\Protobuf\Internal\Message -{ - /** - * URI of the uploaded npm package. - * - * Generated from protobuf field string uri = 1; - */ - private $uri = ''; - /** - * Hash types and values of the npm package. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - */ - private $file_hashes = null; - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $push_timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * URI of the uploaded npm package. - * @type \Google\Cloud\Build\V1\FileHashes $file_hashes - * Hash types and values of the npm package. - * @type \Google\Cloud\Build\V1\TimeSpan $push_timing - * Output only. Stores timing information for pushing the specified artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * URI of the uploaded npm package. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * URI of the uploaded npm package. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Hash types and values of the npm package. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @return \Google\Cloud\Build\V1\FileHashes|null - */ - public function getFileHashes() - { - return $this->file_hashes; - } - - public function hasFileHashes() - { - return isset($this->file_hashes); - } - - public function clearFileHashes() - { - unset($this->file_hashes); - } - - /** - * Hash types and values of the npm package. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @param \Google\Cloud\Build\V1\FileHashes $var - * @return $this - */ - public function setFileHashes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hashes = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPushTiming() - { - return $this->push_timing; - } - - public function hasPushTiming() - { - return isset($this->push_timing); - } - - public function clearPushTiming() - { - unset($this->push_timing); - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPushTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->push_timing = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UploadedPythonPackage.php b/Build/src/V1/UploadedPythonPackage.php deleted file mode 100644 index f4b5cce260e1..000000000000 --- a/Build/src/V1/UploadedPythonPackage.php +++ /dev/null @@ -1,155 +0,0 @@ -google.devtools.cloudbuild.v1.UploadedPythonPackage - */ -class UploadedPythonPackage extends \Google\Protobuf\Internal\Message -{ - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - */ - private $uri = ''; - /** - * Hash types and values of the Python Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - */ - private $file_hashes = null; - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $push_timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * URI of the uploaded artifact. - * @type \Google\Cloud\Build\V1\FileHashes $file_hashes - * Hash types and values of the Python Artifact. - * @type \Google\Cloud\Build\V1\TimeSpan $push_timing - * Output only. Stores timing information for pushing the specified artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Hash types and values of the Python Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @return \Google\Cloud\Build\V1\FileHashes|null - */ - public function getFileHashes() - { - return $this->file_hashes; - } - - public function hasFileHashes() - { - return isset($this->file_hashes); - } - - public function clearFileHashes() - { - unset($this->file_hashes); - } - - /** - * Hash types and values of the Python Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @param \Google\Cloud\Build\V1\FileHashes $var - * @return $this - */ - public function setFileHashes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hashes = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPushTiming() - { - return $this->push_timing; - } - - public function hasPushTiming() - { - return isset($this->push_timing); - } - - public function clearPushTiming() - { - unset($this->push_timing); - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPushTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->push_timing = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Volume.php b/Build/src/V1/Volume.php deleted file mode 100644 index 4dba33d5d098..000000000000 --- a/Build/src/V1/Volume.php +++ /dev/null @@ -1,118 +0,0 @@ -google.devtools.cloudbuild.v1.Volume - */ -class Volume extends \Google\Protobuf\Internal\Message -{ - /** - * Name of the volume to mount. - * Volume names must be unique per build step and must be valid names for - * Docker volumes. Each named volume must be used by at least two build steps. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Path at which to mount the volume. - * Paths must be absolute and cannot conflict with other volume paths on the - * same build step or with certain reserved volume paths. - * - * Generated from protobuf field string path = 2; - */ - private $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of the volume to mount. - * Volume names must be unique per build step and must be valid names for - * Docker volumes. Each named volume must be used by at least two build steps. - * @type string $path - * Path at which to mount the volume. - * Paths must be absolute and cannot conflict with other volume paths on the - * same build step or with certain reserved volume paths. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Name of the volume to mount. - * Volume names must be unique per build step and must be valid names for - * Docker volumes. Each named volume must be used by at least two build steps. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of the volume to mount. - * Volume names must be unique per build step and must be valid names for - * Docker volumes. Each named volume must be used by at least two build steps. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Path at which to mount the volume. - * Paths must be absolute and cannot conflict with other volume paths on the - * same build step or with certain reserved volume paths. - * - * Generated from protobuf field string path = 2; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Path at which to mount the volume. - * Paths must be absolute and cannot conflict with other volume paths on the - * same build step or with certain reserved volume paths. - * - * Generated from protobuf field string path = 2; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/WebhookConfig.php b/Build/src/V1/WebhookConfig.php deleted file mode 100644 index 3601262392a2..000000000000 --- a/Build/src/V1/WebhookConfig.php +++ /dev/null @@ -1,114 +0,0 @@ -google.devtools.cloudbuild.v1.WebhookConfig - */ -class WebhookConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig.State state = 4; - */ - private $state = 0; - protected $auth_method; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $secret - * Required. Resource name for the secret required as a URL parameter. - * @type int $state - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name for the secret required as a URL parameter. - * - * Generated from protobuf field string secret = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSecret() - { - return $this->readOneof(3); - } - - public function hasSecret() - { - return $this->hasOneof(3); - } - - /** - * Required. Resource name for the secret required as a URL parameter. - * - * Generated from protobuf field string secret = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSecret($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig.State state = 4; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig.State state = 4; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\WebhookConfig\State::class); - $this->state = $var; - - return $this; - } - - /** - * @return string - */ - public function getAuthMethod() - { - return $this->whichOneof("auth_method"); - } - -} - diff --git a/Build/src/V1/WebhookConfig/State.php b/Build/src/V1/WebhookConfig/State.php deleted file mode 100644 index e1a8182e7fc9..000000000000 --- a/Build/src/V1/WebhookConfig/State.php +++ /dev/null @@ -1,63 +0,0 @@ -google.devtools.cloudbuild.v1.WebhookConfig.State - */ -class State -{ - /** - * The webhook auth configuration not been checked. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The auth configuration is properly setup. - * - * Generated from protobuf enum OK = 1; - */ - const OK = 1; - /** - * The secret provided in auth_method has been deleted. - * - * Generated from protobuf enum SECRET_DELETED = 2; - */ - const SECRET_DELETED = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::OK => 'OK', - self::SECRET_DELETED => 'SECRET_DELETED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/WorkerPool.php b/Build/src/V1/WorkerPool.php deleted file mode 100644 index 302294c0fa87..000000000000 --- a/Build/src/V1/WorkerPool.php +++ /dev/null @@ -1,465 +0,0 @@ -google.devtools.cloudbuild.v1.WorkerPool - */ -class WorkerPool extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the `WorkerPool`, with format - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * The value of `{worker_pool}` is provided by `worker_pool_id` in - * `CreateWorkerPool` request and the value of `{location}` is determined by - * the endpoint accessed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * A user-specified, human-readable name for the `WorkerPool`. If provided, - * this value must be 1-63 characters. - * - * Generated from protobuf field string display_name = 2; - */ - private $display_name = ''; - /** - * Output only. A unique identifier for the `WorkerPool`. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - /** - * User specified annotations. See https://google.aip.dev/128#annotations - * for more details such as format and size limitations. - * - * Generated from protobuf field map annotations = 4; - */ - private $annotations; - /** - * Output only. Time at which the request to create the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. Time at which the request to update the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * Output only. Time at which the request to delete the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $delete_time = null; - /** - * Output only. `WorkerPool` state. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Checksum computed by the server. May be sent on update and - * delete requests to ensure that the client has an up-to-date value before - * proceeding. - * - * Generated from protobuf field string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $etag = ''; - protected $config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the `WorkerPool`, with format - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * The value of `{worker_pool}` is provided by `worker_pool_id` in - * `CreateWorkerPool` request and the value of `{location}` is determined by - * the endpoint accessed. - * @type string $display_name - * A user-specified, human-readable name for the `WorkerPool`. If provided, - * this value must be 1-63 characters. - * @type string $uid - * Output only. A unique identifier for the `WorkerPool`. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * User specified annotations. See https://google.aip.dev/128#annotations - * for more details such as format and size limitations. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Time at which the request to create the `WorkerPool` was - * received. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Time at which the request to update the `WorkerPool` was - * received. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Time at which the request to delete the `WorkerPool` was - * received. - * @type int $state - * Output only. `WorkerPool` state. - * @type \Google\Cloud\Build\V1\PrivatePoolV1Config $private_pool_v1_config - * Legacy Private Pool configuration. - * @type string $etag - * Output only. Checksum computed by the server. May be sent on update and - * delete requests to ensure that the client has an up-to-date value before - * proceeding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the `WorkerPool`, with format - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * The value of `{worker_pool}` is provided by `worker_pool_id` in - * `CreateWorkerPool` request and the value of `{location}` is determined by - * the endpoint accessed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the `WorkerPool`, with format - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * The value of `{worker_pool}` is provided by `worker_pool_id` in - * `CreateWorkerPool` request and the value of `{location}` is determined by - * the endpoint accessed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * A user-specified, human-readable name for the `WorkerPool`. If provided, - * this value must be 1-63 characters. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A user-specified, human-readable name for the `WorkerPool`. If provided, - * this value must be 1-63 characters. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. A unique identifier for the `WorkerPool`. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. A unique identifier for the `WorkerPool`. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * User specified annotations. See https://google.aip.dev/128#annotations - * for more details such as format and size limitations. - * - * Generated from protobuf field map annotations = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * User specified annotations. See https://google.aip.dev/128#annotations - * for more details such as format and size limitations. - * - * Generated from protobuf field map annotations = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. Time at which the request to create the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Time at which the request to create the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Time at which the request to update the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. Time at which the request to update the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. Time at which the request to delete the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Time at which the request to delete the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. `WorkerPool` state. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. `WorkerPool` state. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\WorkerPool\State::class); - $this->state = $var; - - return $this; - } - - /** - * Legacy Private Pool configuration. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config private_pool_v1_config = 12; - * @return \Google\Cloud\Build\V1\PrivatePoolV1Config|null - */ - public function getPrivatePoolV1Config() - { - return $this->readOneof(12); - } - - public function hasPrivatePoolV1Config() - { - return $this->hasOneof(12); - } - - /** - * Legacy Private Pool configuration. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config private_pool_v1_config = 12; - * @param \Google\Cloud\Build\V1\PrivatePoolV1Config $var - * @return $this - */ - public function setPrivatePoolV1Config($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PrivatePoolV1Config::class); - $this->writeOneof(12, $var); - - return $this; - } - - /** - * Output only. Checksum computed by the server. May be sent on update and - * delete requests to ensure that the client has an up-to-date value before - * proceeding. - * - * Generated from protobuf field string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. Checksum computed by the server. May be sent on update and - * delete requests to ensure that the client has an up-to-date value before - * proceeding. - * - * Generated from protobuf field string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * @return string - */ - public function getConfig() - { - return $this->whichOneof("config"); - } - -} - diff --git a/Build/src/V1/WorkerPool/State.php b/Build/src/V1/WorkerPool/State.php deleted file mode 100644 index e06f0e2a8ddb..000000000000 --- a/Build/src/V1/WorkerPool/State.php +++ /dev/null @@ -1,83 +0,0 @@ -google.devtools.cloudbuild.v1.WorkerPool.State - */ -class State -{ - /** - * State of the `WorkerPool` is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * `WorkerPool` is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * `WorkerPool` is running. - * - * Generated from protobuf enum RUNNING = 2; - */ - const RUNNING = 2; - /** - * `WorkerPool` is being deleted: cancelling builds and draining workers. - * - * Generated from protobuf enum DELETING = 3; - */ - const DELETING = 3; - /** - * `WorkerPool` is deleted. - * - * Generated from protobuf enum DELETED = 4; - */ - const DELETED = 4; - /** - * `WorkerPool` is being updated; new builds cannot be run. - * - * Generated from protobuf enum UPDATING = 5; - */ - const UPDATING = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::RUNNING => 'RUNNING', - self::DELETING => 'DELETING', - self::DELETED => 'DELETED', - self::UPDATING => 'UPDATING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/gapic_metadata.json b/Build/src/V1/gapic_metadata.json deleted file mode 100644 index fbef7758f29a..000000000000 --- a/Build/src/V1/gapic_metadata.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.devtools.cloudbuild.v1", - "libraryPackage": "Google\\Cloud\\Build\\V1", - "services": { - "CloudBuild": { - "clients": { - "grpc": { - "libraryClient": "CloudBuildGapicClient", - "rpcs": { - "ApproveBuild": { - "methods": [ - "approveBuild" - ] - }, - "CancelBuild": { - "methods": [ - "cancelBuild" - ] - }, - "CreateBuild": { - "methods": [ - "createBuild" - ] - }, - "CreateBuildTrigger": { - "methods": [ - "createBuildTrigger" - ] - }, - "CreateWorkerPool": { - "methods": [ - "createWorkerPool" - ] - }, - "DeleteBuildTrigger": { - "methods": [ - "deleteBuildTrigger" - ] - }, - "DeleteWorkerPool": { - "methods": [ - "deleteWorkerPool" - ] - }, - "GetBuild": { - "methods": [ - "getBuild" - ] - }, - "GetBuildTrigger": { - "methods": [ - "getBuildTrigger" - ] - }, - "GetWorkerPool": { - "methods": [ - "getWorkerPool" - ] - }, - "ListBuildTriggers": { - "methods": [ - "listBuildTriggers" - ] - }, - "ListBuilds": { - "methods": [ - "listBuilds" - ] - }, - "ListWorkerPools": { - "methods": [ - "listWorkerPools" - ] - }, - "ReceiveTriggerWebhook": { - "methods": [ - "receiveTriggerWebhook" - ] - }, - "RetryBuild": { - "methods": [ - "retryBuild" - ] - }, - "RunBuildTrigger": { - "methods": [ - "runBuildTrigger" - ] - }, - "UpdateBuildTrigger": { - "methods": [ - "updateBuildTrigger" - ] - }, - "UpdateWorkerPool": { - "methods": [ - "updateWorkerPool" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/Build/src/V1/resources/cloud_build_client_config.json b/Build/src/V1/resources/cloud_build_client_config.json deleted file mode 100644 index d76262d160d0..000000000000 --- a/Build/src/V1/resources/cloud_build_client_config.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "interfaces": { - "google.devtools.cloudbuild.v1.CloudBuild": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ApproveBuild": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "CancelBuild": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateBuild": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateWorkerPool": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteWorkerPool": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetBuild": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetWorkerPool": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBuildTriggers": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBuilds": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListWorkerPools": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ReceiveTriggerWebhook": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "RetryBuild": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RunBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateWorkerPool": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/Build/src/V1/resources/cloud_build_descriptor_config.php b/Build/src/V1/resources/cloud_build_descriptor_config.php deleted file mode 100644 index 26adbe6e6ec8..000000000000 --- a/Build/src/V1/resources/cloud_build_descriptor_config.php +++ /dev/null @@ -1,128 +0,0 @@ - [ - 'google.devtools.cloudbuild.v1.CloudBuild' => [ - 'ApproveBuild' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\Build', - 'metadataReturnType' => '\Google\Cloud\Build\V1\BuildOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateBuild' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\Build', - 'metadataReturnType' => '\Google\Cloud\Build\V1\BuildOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateWorkerPool' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\WorkerPool', - 'metadataReturnType' => '\Google\Cloud\Build\V1\CreateWorkerPoolOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteWorkerPool' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Build\V1\DeleteWorkerPoolOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RetryBuild' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\Build', - 'metadataReturnType' => '\Google\Cloud\Build\V1\BuildOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RunBuildTrigger' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\Build', - 'metadataReturnType' => '\Google\Cloud\Build\V1\BuildOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateWorkerPool' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\WorkerPool', - 'metadataReturnType' => '\Google\Cloud\Build\V1\UpdateWorkerPoolOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListBuildTriggers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTriggers', - ], - ], - 'ListBuilds' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBuilds', - ], - ], - 'ListWorkerPools' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getWorkerPools', - ], - ], - ], - ], -]; diff --git a/Build/src/V1/resources/cloud_build_rest_client_config.php b/Build/src/V1/resources/cloud_build_rest_client_config.php deleted file mode 100644 index 66e7b402fee0..000000000000 --- a/Build/src/V1/resources/cloud_build_rest_client_config.php +++ /dev/null @@ -1,465 +0,0 @@ - [ - 'google.devtools.cloudbuild.v1.CloudBuild' => [ - 'ApproveBuild' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/builds/*}:approve', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/builds/*}:approve', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CancelBuild' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/builds/{id}:cancel', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/builds/*}:cancel', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'id' => [ - 'getters' => [ - 'getId', - ], - ], - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'CreateBuild' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/builds', - 'body' => 'build', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/builds', - 'body' => 'build', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'CreateBuildTrigger' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/triggers', - 'body' => 'trigger', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/triggers', - 'body' => 'trigger', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'CreateWorkerPool' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/workerPools', - 'body' => 'worker_pool', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'worker_pool_id', - ], - ], - 'DeleteBuildTrigger' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger_id}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger_id' => [ - 'getters' => [ - 'getTriggerId', - ], - ], - ], - ], - 'DeleteWorkerPool' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/workerPools/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetBuild' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/builds/{id}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/builds/*}', - ], - ], - 'placeholders' => [ - 'id' => [ - 'getters' => [ - 'getId', - ], - ], - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'GetBuildTrigger' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger_id}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger_id' => [ - 'getters' => [ - 'getTriggerId', - ], - ], - ], - ], - 'GetWorkerPool' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/workerPools/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBuildTriggers' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/triggers', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/triggers', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'ListBuilds' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/builds', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/builds', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'ListWorkerPools' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/workerPools', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ReceiveTriggerWebhook' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger}:webhook', - 'body' => 'body', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}:webhook', - 'body' => 'body', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger' => [ - 'getters' => [ - 'getTrigger', - ], - ], - ], - ], - 'RetryBuild' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/builds/{id}:retry', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/builds/*}:retry', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'id' => [ - 'getters' => [ - 'getId', - ], - ], - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'RunBuildTrigger' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger_id}:run', - 'body' => 'source', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}:run', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger_id' => [ - 'getters' => [ - 'getTriggerId', - ], - ], - ], - ], - 'UpdateBuildTrigger' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger_id}', - 'body' => 'trigger', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{trigger.resource_name=projects/*/locations/*/triggers/*}', - 'body' => 'trigger', - ], - ], - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger.resource_name' => [ - 'getters' => [ - 'getTrigger', - 'getResourceName', - ], - ], - 'trigger_id' => [ - 'getters' => [ - 'getTriggerId', - ], - ], - ], - ], - 'UpdateWorkerPool' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}', - 'body' => 'worker_pool', - 'placeholders' => [ - 'worker_pool.name' => [ - 'getters' => [ - 'getWorkerPool', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=operations/**}:cancel', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=operations/**}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], -]; diff --git a/Build/src/V2/BatchCreateRepositoriesRequest.php b/Build/src/V2/BatchCreateRepositoriesRequest.php index 256d779a83ee..e0aa32884db9 100644 --- a/Build/src/V2/BatchCreateRepositoriesRequest.php +++ b/Build/src/V2/BatchCreateRepositoriesRequest.php @@ -23,7 +23,7 @@ class BatchCreateRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The request messages specifying the repositories to create. * diff --git a/Build/src/V2/BitbucketCloudConfig.php b/Build/src/V2/BitbucketCloudConfig.php index d526163a7952..b0c857475261 100644 --- a/Build/src/V2/BitbucketCloudConfig.php +++ b/Build/src/V2/BitbucketCloudConfig.php @@ -21,14 +21,14 @@ class BitbucketCloudConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $workspace = ''; + protected $workspace = ''; /** * Required. SecretManager resource containing the webhook secret used to * verify webhook events, formatted as `projects/*/secrets/*/versions/*`. * * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $webhook_secret_secret_version = ''; + protected $webhook_secret_secret_version = ''; /** * Required. An access token with the `repository` access. It can be either a * workspace, project or repository access token. It's recommended to use a @@ -36,7 +36,7 @@ class BitbucketCloudConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $read_authorizer_credential = null; + protected $read_authorizer_credential = null; /** * Required. An access token with the `webhook`, `repository`, * `repository:admin` and `pullrequest` scope access. It can be either a @@ -45,7 +45,7 @@ class BitbucketCloudConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $authorizer_credential = null; + protected $authorizer_credential = null; /** * Constructor. diff --git a/Build/src/V2/BitbucketDataCenterConfig.php b/Build/src/V2/BitbucketDataCenterConfig.php index f35711f64d18..5927ea5a1b98 100644 --- a/Build/src/V2/BitbucketDataCenterConfig.php +++ b/Build/src/V2/BitbucketDataCenterConfig.php @@ -21,7 +21,7 @@ class BitbucketDataCenterConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $host_uri = ''; + protected $host_uri = ''; /** * Required. Immutable. SecretManager resource containing the webhook secret * used to verify webhook events, formatted as @@ -29,19 +29,19 @@ class BitbucketDataCenterConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $webhook_secret_secret_version = ''; + protected $webhook_secret_secret_version = ''; /** * Required. A http access token with the `REPO_READ` access. * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $read_authorizer_credential = null; + protected $read_authorizer_credential = null; /** * Required. A http access token with the `REPO_ADMIN` scope access. * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $authorizer_credential = null; + protected $authorizer_credential = null; /** * Optional. Configuration for using Service Directory to privately connect to * a Bitbucket Data Center. This should only be set if the Bitbucket Data @@ -51,20 +51,20 @@ class BitbucketDataCenterConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_directory_config = null; + protected $service_directory_config = null; /** * Optional. SSL certificate to use for requests to the Bitbucket Data Center. * * Generated from protobuf field string ssl_ca = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $ssl_ca = ''; + protected $ssl_ca = ''; /** * Output only. Version of the Bitbucket Data Center running on the * `host_uri`. * * Generated from protobuf field string server_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $server_version = ''; + protected $server_version = ''; /** * Constructor. diff --git a/Build/src/V2/Client/RepositoryManagerClient.php b/Build/src/V2/Client/RepositoryManagerClient.php index 74d4a3da2fbf..81c5204ea7c9 100644 --- a/Build/src/V2/Client/RepositoryManagerClient.php +++ b/Build/src/V2/Client/RepositoryManagerClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a connection * resource. @@ -217,8 +236,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted repository resource. */ - public static function repositoryName(string $project, string $location, string $connection, string $repository): string - { + public static function repositoryName( + string $project, + string $location, + string $connection, + string $repository + ): string { return self::getPathTemplate('repository')->render([ 'project' => $project, 'location' => $location, @@ -389,8 +412,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function batchCreateRepositories(BatchCreateRepositoriesRequest $request, array $callOptions = []): OperationResponse - { + public function batchCreateRepositories( + BatchCreateRepositoriesRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('BatchCreateRepositories', $request, $callOptions)->wait(); } @@ -547,8 +572,10 @@ public function fetchGitRefs(FetchGitRefsRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function fetchLinkableRepositories(FetchLinkableRepositoriesRequest $request, array $callOptions = []): PagedListResponse - { + public function fetchLinkableRepositories( + FetchLinkableRepositoriesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('FetchLinkableRepositories', $request, $callOptions); } @@ -600,8 +627,10 @@ public function fetchReadToken(FetchReadTokenRequest $request, array $callOption * * @throws ApiException Thrown if the API call fails. */ - public function fetchReadWriteToken(FetchReadWriteTokenRequest $request, array $callOptions = []): FetchReadWriteTokenResponse - { + public function fetchReadWriteToken( + FetchReadWriteTokenRequest $request, + array $callOptions = [] + ): FetchReadWriteTokenResponse { return $this->startApiCall('FetchReadWriteToken', $request, $callOptions)->wait(); } @@ -819,8 +848,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/Build/src/V2/Connection.php b/Build/src/V2/Connection.php index ece4f99a1a1f..af1a1dcd99fb 100644 --- a/Build/src/V2/Connection.php +++ b/Build/src/V2/Connection.php @@ -22,25 +22,25 @@ class Connection extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. Server assigned timestamp for when the connection was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Server assigned timestamp for when the connection was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Installation state of the Connection. * * Generated from protobuf field .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $installation_state = null; + protected $installation_state = null; /** * If disabled is set to true, functionality is disabled for this connection. * Repository based API methods and webhooks processing for repositories in @@ -48,14 +48,14 @@ class Connection extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disabled = 13; */ - private $disabled = false; + protected $disabled = false; /** * Output only. Set to true when the connection is being set up or updated in * the background. * * Generated from protobuf field bool reconciling = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $reconciling = false; + protected $reconciling = false; /** * Allows clients to store small amounts of arbitrary data. * @@ -69,7 +69,7 @@ class Connection extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 16; */ - private $etag = ''; + protected $etag = ''; protected $connection_config; /** diff --git a/Build/src/V2/CreateConnectionRequest.php b/Build/src/V2/CreateConnectionRequest.php index baf6736e2b37..4ba96b1380b1 100644 --- a/Build/src/V2/CreateConnectionRequest.php +++ b/Build/src/V2/CreateConnectionRequest.php @@ -21,13 +21,13 @@ class CreateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Connection to create. * * Generated from protobuf field .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $connection = null; + protected $connection = null; /** * Required. The ID to use for the Connection, which will become the final * component of the Connection's resource name. Names must be unique @@ -36,7 +36,7 @@ class CreateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $connection_id = ''; + protected $connection_id = ''; /** * @param string $parent Required. Project and location where the connection will be created. diff --git a/Build/src/V2/CreateRepositoryRequest.php b/Build/src/V2/CreateRepositoryRequest.php index 27e44315aa9b..5dbc70bca90c 100644 --- a/Build/src/V2/CreateRepositoryRequest.php +++ b/Build/src/V2/CreateRepositoryRequest.php @@ -22,13 +22,13 @@ class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The repository to create. * * Generated from protobuf field .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository = null; + protected $repository = null; /** * Required. The ID to use for the repository, which will become the final * component of the repository's resource name. This ID should be unique in @@ -37,7 +37,7 @@ class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository_id = ''; + protected $repository_id = ''; /** * @param string $parent Required. The connection to contain the repository. If the request is part diff --git a/Build/src/V2/DeleteConnectionRequest.php b/Build/src/V2/DeleteConnectionRequest.php index e054f29cf7e3..d76949b9bafc 100644 --- a/Build/src/V2/DeleteConnectionRequest.php +++ b/Build/src/V2/DeleteConnectionRequest.php @@ -21,7 +21,7 @@ class DeleteConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * The current etag of the connection. * If an etag is provided and does not match the current etag of the @@ -29,13 +29,13 @@ class DeleteConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 2; */ - private $etag = ''; + protected $etag = ''; /** * If set, validate the request, but do not actually post it. * * Generated from protobuf field bool validate_only = 3; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $name Required. The name of the Connection to delete. diff --git a/Build/src/V2/DeleteRepositoryRequest.php b/Build/src/V2/DeleteRepositoryRequest.php index 1bb8842af7c3..c12878d13cb8 100644 --- a/Build/src/V2/DeleteRepositoryRequest.php +++ b/Build/src/V2/DeleteRepositoryRequest.php @@ -21,7 +21,7 @@ class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * The current etag of the repository. * If an etag is provided and does not match the current etag of the @@ -29,13 +29,13 @@ class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 2; */ - private $etag = ''; + protected $etag = ''; /** * If set, validate the request, but do not actually post it. * * Generated from protobuf field bool validate_only = 3; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $name Required. The name of the Repository to delete. diff --git a/Build/src/V2/FetchGitRefsRequest.php b/Build/src/V2/FetchGitRefsRequest.php index 918f9febd952..4f5bff6c029f 100644 --- a/Build/src/V2/FetchGitRefsRequest.php +++ b/Build/src/V2/FetchGitRefsRequest.php @@ -21,13 +21,13 @@ class FetchGitRefsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $repository = ''; + protected $repository = ''; /** * Type of refs to fetch * * Generated from protobuf field .google.devtools.cloudbuild.v2.FetchGitRefsRequest.RefType ref_type = 2; */ - private $ref_type = 0; + protected $ref_type = 0; /** * @param string $repository Required. The resource name of the repository in the format diff --git a/Build/src/V2/FetchLinkableRepositoriesRequest.php b/Build/src/V2/FetchLinkableRepositoriesRequest.php index 1fce8d912d43..677401c74cc3 100644 --- a/Build/src/V2/FetchLinkableRepositoriesRequest.php +++ b/Build/src/V2/FetchLinkableRepositoriesRequest.php @@ -21,19 +21,19 @@ class FetchLinkableRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $connection = ''; + protected $connection = ''; /** * Number of results to return in the list. Default to 20. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page start. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Constructor. diff --git a/Build/src/V2/FetchLinkableRepositoriesResponse.php b/Build/src/V2/FetchLinkableRepositoriesResponse.php index 67b41d3daa80..cab0cfef5019 100644 --- a/Build/src/V2/FetchLinkableRepositoriesResponse.php +++ b/Build/src/V2/FetchLinkableRepositoriesResponse.php @@ -26,7 +26,7 @@ class FetchLinkableRepositoriesResponse extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Build/src/V2/FetchReadTokenRequest.php b/Build/src/V2/FetchReadTokenRequest.php index ebd949ec1c8d..ab9057b88e0a 100644 --- a/Build/src/V2/FetchReadTokenRequest.php +++ b/Build/src/V2/FetchReadTokenRequest.php @@ -21,7 +21,7 @@ class FetchReadTokenRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $repository = ''; + protected $repository = ''; /** * @param string $repository Required. The resource name of the repository in the format diff --git a/Build/src/V2/FetchReadTokenResponse.php b/Build/src/V2/FetchReadTokenResponse.php index fc8190cc7f39..3302adc79daf 100644 --- a/Build/src/V2/FetchReadTokenResponse.php +++ b/Build/src/V2/FetchReadTokenResponse.php @@ -20,13 +20,13 @@ class FetchReadTokenResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string token = 1; */ - private $token = ''; + protected $token = ''; /** * Expiration timestamp. Can be empty if unknown or non-expiring. * * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; */ - private $expiration_time = null; + protected $expiration_time = null; /** * Constructor. diff --git a/Build/src/V2/FetchReadWriteTokenRequest.php b/Build/src/V2/FetchReadWriteTokenRequest.php index 7d0ba66e6169..5c24c1711c42 100644 --- a/Build/src/V2/FetchReadWriteTokenRequest.php +++ b/Build/src/V2/FetchReadWriteTokenRequest.php @@ -21,7 +21,7 @@ class FetchReadWriteTokenRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $repository = ''; + protected $repository = ''; /** * @param string $repository Required. The resource name of the repository in the format diff --git a/Build/src/V2/FetchReadWriteTokenResponse.php b/Build/src/V2/FetchReadWriteTokenResponse.php index 18a87ed5c448..c38b59dc84b1 100644 --- a/Build/src/V2/FetchReadWriteTokenResponse.php +++ b/Build/src/V2/FetchReadWriteTokenResponse.php @@ -20,13 +20,13 @@ class FetchReadWriteTokenResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string token = 1; */ - private $token = ''; + protected $token = ''; /** * Expiration timestamp. Can be empty if unknown or non-expiring. * * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; */ - private $expiration_time = null; + protected $expiration_time = null; /** * Constructor. diff --git a/Build/src/V2/Gapic/RepositoryManagerGapicClient.php b/Build/src/V2/Gapic/RepositoryManagerGapicClient.php deleted file mode 100644 index 7d58b5efa2c1..000000000000 --- a/Build/src/V2/Gapic/RepositoryManagerGapicClient.php +++ /dev/null @@ -1,1516 +0,0 @@ -connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $requests = []; - * $operationResponse = $repositoryManagerClient->batchCreateRepositories($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $repositoryManagerClient->batchCreateRepositories($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'batchCreateRepositories'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Build\V2\Client\RepositoryManagerClient}. - */ -class RepositoryManagerGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.devtools.cloudbuild.v2.RepositoryManager'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudbuild.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudbuild.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $connectionNameTemplate; - - private static $locationNameTemplate; - - private static $repositoryNameTemplate; - - private static $secretVersionNameTemplate; - - private static $serviceNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/repository_manager_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/repository_manager_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/repository_manager_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/repository_manager_rest_client_config.php', - ], - ], - ]; - } - - private static function getConnectionNameTemplate() - { - if (self::$connectionNameTemplate == null) { - self::$connectionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/connections/{connection}'); - } - - return self::$connectionNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getRepositoryNameTemplate() - { - if (self::$repositoryNameTemplate == null) { - self::$repositoryNameTemplate = new PathTemplate('projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}'); - } - - return self::$repositoryNameTemplate; - } - - private static function getSecretVersionNameTemplate() - { - if (self::$secretVersionNameTemplate == null) { - self::$secretVersionNameTemplate = new PathTemplate('projects/{project}/secrets/{secret}/versions/{version}'); - } - - return self::$secretVersionNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'connection' => self::getConnectionNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'repository' => self::getRepositoryNameTemplate(), - 'secretVersion' => self::getSecretVersionNameTemplate(), - 'service' => self::getServiceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a connection - * resource. - * - * @param string $project - * @param string $location - * @param string $connection - * - * @return string The formatted connection resource. - */ - public static function connectionName($project, $location, $connection) - { - return self::getConnectionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'connection' => $connection, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a repository - * resource. - * - * @param string $project - * @param string $location - * @param string $connection - * @param string $repository - * - * @return string The formatted repository resource. - */ - public static function repositoryName($project, $location, $connection, $repository) - { - return self::getRepositoryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'connection' => $connection, - 'repository' => $repository, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * secret_version resource. - * - * @param string $project - * @param string $secret - * @param string $version - * - * @return string The formatted secret_version resource. - */ - public static function secretVersionName($project, $secret, $version) - { - return self::getSecretVersionNameTemplate()->render([ - 'project' => $project, - 'secret' => $secret, - 'version' => $version, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName($project, $location, $namespace, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - connection: projects/{project}/locations/{location}/connections/{connection} - * - location: projects/{project}/locations/{location} - * - repository: projects/{project}/locations/{location}/connections/{connection}/repositories/{repository} - * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudbuild.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates multiple repositories inside a connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $requests = []; - * $operationResponse = $repositoryManagerClient->batchCreateRepositories($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $repositoryManagerClient->batchCreateRepositories($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'batchCreateRepositories'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. The connection to contain all the repositories being created. - * Format: projects/*/locations/*/connections/* - * The parent field in the CreateRepositoryRequest messages - * must either be empty or match this field. - * @param CreateRepositoryRequest[] $requests Required. The request messages specifying the repositories to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchCreateRepositories($parent, $requests, array $optionalArgs = []) - { - $request = new BatchCreateRepositoriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRequests($requests); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchCreateRepositories', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a Connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->locationName('[PROJECT]', '[LOCATION]'); - * $connection = new Connection(); - * $connectionId = 'connection_id'; - * $operationResponse = $repositoryManagerClient->createConnection($formattedParent, $connection, $connectionId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $repositoryManagerClient->createConnection($formattedParent, $connection, $connectionId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'createConnection'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. Project and location where the connection will be created. - * Format: `projects/*/locations/*`. - * @param Connection $connection Required. The Connection to create. - * @param string $connectionId Required. The ID to use for the Connection, which will become the final - * component of the Connection's resource name. Names must be unique - * per-project per-location. Allows alphanumeric characters and any of - * -._~%!$&'()*+,;=@. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createConnection($parent, $connection, $connectionId, array $optionalArgs = []) - { - $request = new CreateConnectionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setConnection($connection); - $request->setConnectionId($connectionId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a Repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $repository = new Repository(); - * $repositoryId = 'repository_id'; - * $operationResponse = $repositoryManagerClient->createRepository($formattedParent, $repository, $repositoryId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $repositoryManagerClient->createRepository($formattedParent, $repository, $repositoryId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'createRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. The connection to contain the repository. If the request is part - * of a BatchCreateRepositoriesRequest, this field should be empty or match - * the parent specified there. - * @param Repository $repository Required. The repository to create. - * @param string $repositoryId Required. The ID to use for the repository, which will become the final - * component of the repository's resource name. This ID should be unique in - * the connection. Allows alphanumeric characters and any of - * -._~%!$&'()*+,;=@. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createRepository($parent, $repository, $repositoryId, array $optionalArgs = []) - { - $request = new CreateRepositoryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRepository($repository); - $request->setRepositoryId($repositoryId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateRepository', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedName = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $operationResponse = $repositoryManagerClient->deleteConnection($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $repositoryManagerClient->deleteConnection($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'deleteConnection'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Connection to delete. - * Format: `projects/*/locations/*/connections/*`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * The current etag of the connection. - * If an etag is provided and does not match the current etag of the - * connection, deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * If set, validate the request, but do not actually post it. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteConnection($name, array $optionalArgs = []) - { - $request = new DeleteConnectionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedName = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $operationResponse = $repositoryManagerClient->deleteRepository($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $repositoryManagerClient->deleteRepository($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'deleteRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Repository to delete. - * Format: `projects/*/locations/*/connections/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * The current etag of the repository. - * If an etag is provided and does not match the current etag of the - * repository, deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * If set, validate the request, but do not actually post it. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteRepository($name, array $optionalArgs = []) - { - $request = new DeleteRepositoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteRepository', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Fetch the list of branches or tags for a given repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedRepository = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $response = $repositoryManagerClient->fetchGitRefs($formattedRepository); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $repository Required. The resource name of the repository in the format - * `projects/*/locations/*/connections/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $refType - * Type of refs to fetch - * For allowed values, use constants defined on {@see \Google\Cloud\Build\V2\FetchGitRefsRequest\RefType} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V2\FetchGitRefsResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchGitRefs($repository, array $optionalArgs = []) - { - $request = new FetchGitRefsRequest(); - $requestParamHeaders = []; - $request->setRepository($repository); - $requestParamHeaders['repository'] = $repository; - if (isset($optionalArgs['refType'])) { - $request->setRefType($optionalArgs['refType']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('FetchGitRefs', FetchGitRefsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * FetchLinkableRepositories get repositories from SCM that are - * accessible and could be added to the connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedConnection = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * // Iterate over pages of elements - * $pagedResponse = $repositoryManagerClient->fetchLinkableRepositories($formattedConnection); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $repositoryManagerClient->fetchLinkableRepositories($formattedConnection); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $connection Required. The name of the Connection. - * Format: `projects/*/locations/*/connections/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchLinkableRepositories($connection, array $optionalArgs = []) - { - $request = new FetchLinkableRepositoriesRequest(); - $requestParamHeaders = []; - $request->setConnection($connection); - $requestParamHeaders['connection'] = $connection; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('FetchLinkableRepositories', $optionalArgs, FetchLinkableRepositoriesResponse::class, $request); - } - - /** - * Fetches read token of a given repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedRepository = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $response = $repositoryManagerClient->fetchReadToken($formattedRepository); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $repository Required. The resource name of the repository in the format - * `projects/*/locations/*/connections/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V2\FetchReadTokenResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchReadToken($repository, array $optionalArgs = []) - { - $request = new FetchReadTokenRequest(); - $requestParamHeaders = []; - $request->setRepository($repository); - $requestParamHeaders['repository'] = $repository; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('FetchReadToken', FetchReadTokenResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Fetches read/write token of a given repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedRepository = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $response = $repositoryManagerClient->fetchReadWriteToken($formattedRepository); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $repository Required. The resource name of the repository in the format - * `projects/*/locations/*/connections/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V2\FetchReadWriteTokenResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchReadWriteToken($repository, array $optionalArgs = []) - { - $request = new FetchReadWriteTokenRequest(); - $requestParamHeaders = []; - $request->setRepository($repository); - $requestParamHeaders['repository'] = $repository; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('FetchReadWriteToken', FetchReadWriteTokenResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedName = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $response = $repositoryManagerClient->getConnection($formattedName); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Connection to retrieve. - * Format: `projects/*/locations/*/connections/*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V2\Connection - * - * @throws ApiException if the remote call fails - */ - public function getConnection($name, array $optionalArgs = []) - { - $request = new GetConnectionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetConnection', Connection::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedName = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $response = $repositoryManagerClient->getRepository($formattedName); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Repository to retrieve. - * Format: `projects/*/locations/*/connections/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V2\Repository - * - * @throws ApiException if the remote call fails - */ - public function getRepository($name, array $optionalArgs = []) - { - $request = new GetRepositoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetRepository', Repository::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists Connections in a given project and location. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $repositoryManagerClient->listConnections($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $repositoryManagerClient->listConnections($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of Connections. - * Format: `projects/*/locations/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listConnections($parent, array $optionalArgs = []) - { - $request = new ListConnectionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListConnections', $optionalArgs, ListConnectionsResponse::class, $request); - } - - /** - * Lists Repositories in a given connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * // Iterate over pages of elements - * $pagedResponse = $repositoryManagerClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $repositoryManagerClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of Repositories. - * Format: `projects/*/locations/*/connections/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * A filter expression that filters resources listed in the response. - * Expressions must follow API improvement proposal - * [AIP-160](https://google.aip.dev/160). e.g. - * `remote_uri:"https://github.com*"`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listRepositories($parent, array $optionalArgs = []) - { - $request = new ListRepositoriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListRepositories', $optionalArgs, ListRepositoriesResponse::class, $request); - } - - /** - * Updates a single connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $connection = new Connection(); - * $operationResponse = $repositoryManagerClient->updateConnection($connection); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $repositoryManagerClient->updateConnection($connection); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'updateConnection'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param Connection $connection Required. The Connection to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * The list of fields to be updated. - * @type bool $allowMissing - * If set to true, and the connection is not found a new connection - * will be created. In this situation `update_mask` is ignored. - * The creation will succeed only if the input connection has all the - * necessary information (e.g a github_config with both user_oauth_token and - * installation_id properties). - * @type string $etag - * The current etag of the connection. - * If an etag is provided and does not match the current etag of the - * connection, update will be blocked and an ABORTED error will be returned. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateConnection($connection, array $optionalArgs = []) - { - $request = new UpdateConnectionRequest(); - $requestParamHeaders = []; - $request->setConnection($connection); - $requestParamHeaders['connection.name'] = $connection->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $resource = 'resource'; - * $response = $repositoryManagerClient->getIamPolicy($resource); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $repositoryManagerClient->setIamPolicy($resource, $policy); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $repositoryManagerClient->testIamPermissions($resource, $permissions); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/Build/src/V2/GetConnectionRequest.php b/Build/src/V2/GetConnectionRequest.php index 9f3a2ecfe864..a5fb8449f96a 100644 --- a/Build/src/V2/GetConnectionRequest.php +++ b/Build/src/V2/GetConnectionRequest.php @@ -21,7 +21,7 @@ class GetConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Connection to retrieve. diff --git a/Build/src/V2/GetRepositoryRequest.php b/Build/src/V2/GetRepositoryRequest.php index 9775609531fa..2b71cd243f1f 100644 --- a/Build/src/V2/GetRepositoryRequest.php +++ b/Build/src/V2/GetRepositoryRequest.php @@ -21,7 +21,7 @@ class GetRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Repository to retrieve. diff --git a/Build/src/V2/GitHubConfig.php b/Build/src/V2/GitHubConfig.php index ceaf4c2599bb..d1435a9df8ea 100644 --- a/Build/src/V2/GitHubConfig.php +++ b/Build/src/V2/GitHubConfig.php @@ -22,13 +22,13 @@ class GitHubConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; */ - private $authorizer_credential = null; + protected $authorizer_credential = null; /** * GitHub App installation id. * * Generated from protobuf field int64 app_installation_id = 2; */ - private $app_installation_id = 0; + protected $app_installation_id = 0; /** * Constructor. diff --git a/Build/src/V2/GitHubEnterpriseConfig.php b/Build/src/V2/GitHubEnterpriseConfig.php index 27124ed5cc1a..333e58603534 100644 --- a/Build/src/V2/GitHubEnterpriseConfig.php +++ b/Build/src/V2/GitHubEnterpriseConfig.php @@ -20,45 +20,45 @@ class GitHubEnterpriseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $host_uri = ''; + protected $host_uri = ''; /** * Required. API Key used for authentication of webhook events. * * Generated from protobuf field string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; */ - private $api_key = ''; + protected $api_key = ''; /** * Id of the GitHub App created from the manifest. * * Generated from protobuf field int64 app_id = 2; */ - private $app_id = 0; + protected $app_id = 0; /** * The URL-friendly name of the GitHub App. * * Generated from protobuf field string app_slug = 13; */ - private $app_slug = ''; + protected $app_slug = ''; /** * SecretManager resource containing the private key of the GitHub App, * formatted as `projects/*/secrets/*/versions/*`. * * Generated from protobuf field string private_key_secret_version = 4 [(.google.api.resource_reference) = { */ - private $private_key_secret_version = ''; + protected $private_key_secret_version = ''; /** * SecretManager resource containing the webhook secret of the GitHub App, * formatted as `projects/*/secrets/*/versions/*`. * * Generated from protobuf field string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { */ - private $webhook_secret_secret_version = ''; + protected $webhook_secret_secret_version = ''; /** * ID of the installation of the GitHub App. * * Generated from protobuf field int64 app_installation_id = 9; */ - private $app_installation_id = 0; + protected $app_installation_id = 0; /** * Configuration for using Service Directory to privately connect to a GitHub * Enterprise server. This should only be set if the GitHub Enterprise server @@ -68,19 +68,19 @@ class GitHubEnterpriseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; */ - private $service_directory_config = null; + protected $service_directory_config = null; /** * SSL certificate to use for requests to GitHub Enterprise. * * Generated from protobuf field string ssl_ca = 11; */ - private $ssl_ca = ''; + protected $ssl_ca = ''; /** * Output only. GitHub Enterprise version installed at the host_uri. * * Generated from protobuf field string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $server_version = ''; + protected $server_version = ''; /** * Constructor. diff --git a/Build/src/V2/GitLabConfig.php b/Build/src/V2/GitLabConfig.php index 15ebcfc89562..078b133eccbc 100644 --- a/Build/src/V2/GitLabConfig.php +++ b/Build/src/V2/GitLabConfig.php @@ -22,7 +22,7 @@ class GitLabConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string host_uri = 1; */ - private $host_uri = ''; + protected $host_uri = ''; /** * Required. Immutable. SecretManager resource containing the webhook secret * of a GitLab Enterprise project, formatted as @@ -30,20 +30,20 @@ class GitLabConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $webhook_secret_secret_version = ''; + protected $webhook_secret_secret_version = ''; /** * Required. A GitLab personal access token with the minimum `read_api` scope * access. * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $read_authorizer_credential = null; + protected $read_authorizer_credential = null; /** * Required. A GitLab personal access token with the `api` scope access. * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $authorizer_credential = null; + protected $authorizer_credential = null; /** * Configuration for using Service Directory to privately connect to a GitLab * Enterprise server. This should only be set if the GitLab Enterprise server @@ -53,20 +53,20 @@ class GitLabConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 5; */ - private $service_directory_config = null; + protected $service_directory_config = null; /** * SSL certificate to use for requests to GitLab Enterprise. * * Generated from protobuf field string ssl_ca = 6; */ - private $ssl_ca = ''; + protected $ssl_ca = ''; /** * Output only. Version of the GitLab Enterprise server running on the * `host_uri`. * * Generated from protobuf field string server_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $server_version = ''; + protected $server_version = ''; /** * Constructor. diff --git a/Build/src/V2/InstallationState.php b/Build/src/V2/InstallationState.php index d0754dabd95b..b1ae1f2c68e8 100644 --- a/Build/src/V2/InstallationState.php +++ b/Build/src/V2/InstallationState.php @@ -22,21 +22,21 @@ class InstallationState extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $stage = 0; + protected $stage = 0; /** * Output only. Message of what the user should do next to continue the * installation. Empty string if the installation is already complete. * * Generated from protobuf field string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $message = ''; + protected $message = ''; /** * Output only. Link to follow for next action. Empty string if the * installation is already complete. * * Generated from protobuf field string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $action_uri = ''; + protected $action_uri = ''; /** * Constructor. diff --git a/Build/src/V2/ListConnectionsRequest.php b/Build/src/V2/ListConnectionsRequest.php index d768d13cf5b9..d074735f716d 100644 --- a/Build/src/V2/ListConnectionsRequest.php +++ b/Build/src/V2/ListConnectionsRequest.php @@ -21,19 +21,19 @@ class ListConnectionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Number of results to return in the list. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page start. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The parent, which owns this collection of Connections. diff --git a/Build/src/V2/ListConnectionsResponse.php b/Build/src/V2/ListConnectionsResponse.php index dbcd4275d0be..9d9a916d3a00 100644 --- a/Build/src/V2/ListConnectionsResponse.php +++ b/Build/src/V2/ListConnectionsResponse.php @@ -26,7 +26,7 @@ class ListConnectionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Build/src/V2/ListRepositoriesRequest.php b/Build/src/V2/ListRepositoriesRequest.php index 61d2d1b2b0a3..b348f630d745 100644 --- a/Build/src/V2/ListRepositoriesRequest.php +++ b/Build/src/V2/ListRepositoriesRequest.php @@ -21,19 +21,19 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Number of results to return in the list. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page start. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * A filter expression that filters resources listed in the response. * Expressions must follow API improvement proposal @@ -42,7 +42,7 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The parent, which owns this collection of Repositories. diff --git a/Build/src/V2/ListRepositoriesResponse.php b/Build/src/V2/ListRepositoriesResponse.php index 069a03c900ef..54490f450841 100644 --- a/Build/src/V2/ListRepositoriesResponse.php +++ b/Build/src/V2/ListRepositoriesResponse.php @@ -26,7 +26,7 @@ class ListRepositoriesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Build/src/V2/OAuthCredential.php b/Build/src/V2/OAuthCredential.php index aebdcc892fa1..02ae959dbbb1 100644 --- a/Build/src/V2/OAuthCredential.php +++ b/Build/src/V2/OAuthCredential.php @@ -22,13 +22,13 @@ class OAuthCredential extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { */ - private $oauth_token_secret_version = ''; + protected $oauth_token_secret_version = ''; /** * Output only. The username associated to this token. * * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $username = ''; + protected $username = ''; /** * Constructor. diff --git a/Build/src/V2/OperationMetadata.php b/Build/src/V2/OperationMetadata.php index 7e57729c84e5..42a4e11540ab 100644 --- a/Build/src/V2/OperationMetadata.php +++ b/Build/src/V2/OperationMetadata.php @@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $status_message = ''; + protected $status_message = ''; /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -54,13 +54,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Constructor. diff --git a/Build/src/V2/ProcessWebhookRequest.php b/Build/src/V2/ProcessWebhookRequest.php index f261ce1eb267..cf013c817200 100644 --- a/Build/src/V2/ProcessWebhookRequest.php +++ b/Build/src/V2/ProcessWebhookRequest.php @@ -21,20 +21,20 @@ class ProcessWebhookRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * HTTP request body. * * Generated from protobuf field .google.api.HttpBody body = 2; */ - private $body = null; + protected $body = null; /** * Arbitrary additional key to find the maching repository for a webhook event * if needed. * * Generated from protobuf field string webhook_key = 3; */ - private $webhook_key = ''; + protected $webhook_key = ''; /** * Constructor. diff --git a/Build/src/V2/Repository.php b/Build/src/V2/Repository.php index d85a44b1b761..6099cdddc399 100644 --- a/Build/src/V2/Repository.php +++ b/Build/src/V2/Repository.php @@ -21,25 +21,25 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Required. Git Clone HTTPS URI. * * Generated from protobuf field string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $remote_uri = ''; + protected $remote_uri = ''; /** * Output only. Server assigned timestamp for when the connection was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Server assigned timestamp for when the connection was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Allows clients to store small amounts of arbitrary data. * @@ -53,13 +53,13 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 7; */ - private $etag = ''; + protected $etag = ''; /** * Output only. External ID of the webhook created for the repository. * * Generated from protobuf field string webhook_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $webhook_id = ''; + protected $webhook_id = ''; /** * Constructor. diff --git a/Build/src/V2/RepositoryManagerClient.php b/Build/src/V2/RepositoryManagerClient.php deleted file mode 100644 index cbbd8a468d36..000000000000 --- a/Build/src/V2/RepositoryManagerClient.php +++ /dev/null @@ -1,34 +0,0 @@ -.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -42,25 +42,25 @@ class RunWorkflowCustomOperationMetadata extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field bool requested_cancellation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. ID of the pipeline run created by RunWorkflow. * * Generated from protobuf field string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $pipeline_run_id = ''; + protected $pipeline_run_id = ''; /** * Constructor. diff --git a/Build/src/V2/ServiceDirectoryConfig.php b/Build/src/V2/ServiceDirectoryConfig.php index 7a177ccd6632..319cc1be7884 100644 --- a/Build/src/V2/ServiceDirectoryConfig.php +++ b/Build/src/V2/ServiceDirectoryConfig.php @@ -23,7 +23,7 @@ class ServiceDirectoryConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Constructor. diff --git a/Build/src/V2/UpdateConnectionRequest.php b/Build/src/V2/UpdateConnectionRequest.php index 40ee2ccbd838..9249d61cca33 100644 --- a/Build/src/V2/UpdateConnectionRequest.php +++ b/Build/src/V2/UpdateConnectionRequest.php @@ -20,13 +20,13 @@ class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $connection = null; + protected $connection = null; /** * The list of fields to be updated. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * If set to true, and the connection is not found a new connection * will be created. In this situation `update_mask` is ignored. @@ -36,7 +36,7 @@ class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool allow_missing = 3; */ - private $allow_missing = false; + protected $allow_missing = false; /** * The current etag of the connection. * If an etag is provided and does not match the current etag of the @@ -44,7 +44,7 @@ class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 4; */ - private $etag = ''; + protected $etag = ''; /** * @param \Google\Cloud\Build\V2\Connection $connection Required. The Connection to update. diff --git a/Build/src/V2/UserCredential.php b/Build/src/V2/UserCredential.php index 3ad6bc625158..c19841970419 100644 --- a/Build/src/V2/UserCredential.php +++ b/Build/src/V2/UserCredential.php @@ -23,13 +23,13 @@ class UserCredential extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string user_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $user_token_secret_version = ''; + protected $user_token_secret_version = ''; /** * Output only. The username associated to this token. * * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $username = ''; + protected $username = ''; /** * Constructor. diff --git a/Build/tests/Unit/V1/CloudBuildClientTest.php b/Build/tests/Unit/V1/CloudBuildClientTest.php deleted file mode 100644 index 9e662952ff00..000000000000 --- a/Build/tests/Unit/V1/CloudBuildClientTest.php +++ /dev/null @@ -1,1768 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudBuildClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudBuildClient($options); - } - - /** @test */ - public function approveBuildTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/approveBuildTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $id = 'id3355'; - $projectId = 'projectId-1969970175'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/approveBuildTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->approveBuild($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/ApproveBuild', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/approveBuildTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function approveBuildExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/approveBuildTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->approveBuild($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/approveBuildTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function cancelBuildTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $id2 = 'id23227150'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id2); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - $response = $gapicClient->cancelBuild($projectId, $id); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/CancelBuild', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getId(); - $this->assertProtobufEquals($id, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelBuildExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - try { - $gapicClient->cancelBuild($projectId, $id); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBuildTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBuildTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBuildTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $build = new Build(); - $response = $gapicClient->createBuild($projectId, $build); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/CreateBuild', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getBuild(); - $this->assertProtobufEquals($build, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBuildTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBuildExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBuildTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $build = new Build(); - $response = $gapicClient->createBuild($projectId, $build); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBuildTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBuildTriggerTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $resourceName = 'resourceName979421212'; - $id = 'id3355'; - $description = 'description-1724546052'; - $name = 'name3373707'; - $autodetect = true; - $disabled = true; - $filter = 'filter-1274492040'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new BuildTrigger(); - $expectedResponse->setResourceName($resourceName); - $expectedResponse->setId($id); - $expectedResponse->setDescription($description); - $expectedResponse->setName($name); - $expectedResponse->setAutodetect($autodetect); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setFilter($filter); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $trigger = new BuildTrigger(); - $response = $gapicClient->createBuildTrigger($projectId, $trigger); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/CreateBuildTrigger', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTrigger(); - $this->assertProtobufEquals($trigger, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBuildTriggerExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $trigger = new BuildTrigger(); - try { - $gapicClient->createBuildTrigger($projectId, $trigger); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createWorkerPoolTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $etag = 'etag3123477'; - $expectedResponse = new WorkerPool(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createWorkerPoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $workerPool = new WorkerPool(); - $workerPoolId = 'workerPoolId-300928931'; - $response = $gapicClient->createWorkerPool($formattedParent, $workerPool, $workerPoolId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/CreateWorkerPool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getWorkerPool(); - $this->assertProtobufEquals($workerPool, $actualValue); - $actualValue = $actualApiRequestObject->getWorkerPoolId(); - $this->assertProtobufEquals($workerPoolId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkerPoolTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createWorkerPoolExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $workerPool = new WorkerPool(); - $workerPoolId = 'workerPoolId-300928931'; - $response = $gapicClient->createWorkerPool($formattedParent, $workerPool, $workerPoolId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkerPoolTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBuildTriggerTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $gapicClient->deleteBuildTrigger($projectId, $triggerId); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/DeleteBuildTrigger', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTriggerId(); - $this->assertProtobufEquals($triggerId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBuildTriggerExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - try { - $gapicClient->deleteBuildTrigger($projectId, $triggerId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteWorkerPoolTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteWorkerPoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - $response = $gapicClient->deleteWorkerPool($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/DeleteWorkerPool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteWorkerPoolTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteWorkerPoolExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - $response = $gapicClient->deleteWorkerPool($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteWorkerPoolTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getBuildTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $id2 = 'id23227150'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id2); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - $response = $gapicClient->getBuild($projectId, $id); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/GetBuild', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getId(); - $this->assertProtobufEquals($id, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBuildExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - try { - $gapicClient->getBuild($projectId, $id); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBuildTriggerTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $resourceName = 'resourceName979421212'; - $id = 'id3355'; - $description = 'description-1724546052'; - $name2 = 'name2-1052831874'; - $autodetect = true; - $disabled = true; - $filter = 'filter-1274492040'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new BuildTrigger(); - $expectedResponse->setResourceName($resourceName); - $expectedResponse->setId($id); - $expectedResponse->setDescription($description); - $expectedResponse->setName($name2); - $expectedResponse->setAutodetect($autodetect); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setFilter($filter); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $response = $gapicClient->getBuildTrigger($projectId, $triggerId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/GetBuildTrigger', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTriggerId(); - $this->assertProtobufEquals($triggerId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBuildTriggerExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - try { - $gapicClient->getBuildTrigger($projectId, $triggerId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkerPoolTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $etag = 'etag3123477'; - $expectedResponse = new WorkerPool(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - $response = $gapicClient->getWorkerPool($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/GetWorkerPool', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkerPoolExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - try { - $gapicClient->getWorkerPool($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBuildTriggersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $triggersElement = new BuildTrigger(); - $triggers = [ - $triggersElement, - ]; - $expectedResponse = new ListBuildTriggersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTriggers($triggers); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $response = $gapicClient->listBuildTriggers($projectId); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTriggers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/ListBuildTriggers', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBuildTriggersExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - try { - $gapicClient->listBuildTriggers($projectId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBuildsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $buildsElement = new Build(); - $builds = [ - $buildsElement, - ]; - $expectedResponse = new ListBuildsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBuilds($builds); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $response = $gapicClient->listBuilds($projectId); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBuilds()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/ListBuilds', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBuildsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - try { - $gapicClient->listBuilds($projectId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkerPoolsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workerPoolsElement = new WorkerPool(); - $workerPools = [ - $workerPoolsElement, - ]; - $expectedResponse = new ListWorkerPoolsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkerPools($workerPools); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listWorkerPools($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkerPools()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/ListWorkerPools', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkerPoolsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listWorkerPools($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function receiveTriggerWebhookTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReceiveTriggerWebhookResponse(); - $transport->addResponse($expectedResponse); - $response = $gapicClient->receiveTriggerWebhook(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/ReceiveTriggerWebhook', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function receiveTriggerWebhookExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->receiveTriggerWebhook(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function retryBuildTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/retryBuildTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $id2 = 'id23227150'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id2); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/retryBuildTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - $response = $gapicClient->retryBuild($projectId, $id); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/RetryBuild', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getId(); - $this->assertProtobufEquals($id, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/retryBuildTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function retryBuildExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/retryBuildTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - $response = $gapicClient->retryBuild($projectId, $id); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/retryBuildTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function runBuildTriggerTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/runBuildTriggerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/runBuildTriggerTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $response = $gapicClient->runBuildTrigger($projectId, $triggerId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/RunBuildTrigger', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getTriggerId(); - $this->assertProtobufEquals($triggerId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/runBuildTriggerTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function runBuildTriggerExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/runBuildTriggerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $response = $gapicClient->runBuildTrigger($projectId, $triggerId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/runBuildTriggerTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateBuildTriggerTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $resourceName = 'resourceName979421212'; - $id = 'id3355'; - $description = 'description-1724546052'; - $name = 'name3373707'; - $autodetect = true; - $disabled = true; - $filter = 'filter-1274492040'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new BuildTrigger(); - $expectedResponse->setResourceName($resourceName); - $expectedResponse->setId($id); - $expectedResponse->setDescription($description); - $expectedResponse->setName($name); - $expectedResponse->setAutodetect($autodetect); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setFilter($filter); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $trigger = new BuildTrigger(); - $response = $gapicClient->updateBuildTrigger($projectId, $triggerId, $trigger); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/UpdateBuildTrigger', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTriggerId(); - $this->assertProtobufEquals($triggerId, $actualValue); - $actualValue = $actualRequestObject->getTrigger(); - $this->assertProtobufEquals($trigger, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateBuildTriggerExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $trigger = new BuildTrigger(); - try { - $gapicClient->updateBuildTrigger($projectId, $triggerId, $trigger); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateWorkerPoolTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $etag = 'etag3123477'; - $expectedResponse = new WorkerPool(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateWorkerPoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $workerPool = new WorkerPool(); - $response = $gapicClient->updateWorkerPool($workerPool); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/UpdateWorkerPool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getWorkerPool(); - $this->assertProtobufEquals($workerPool, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateWorkerPoolTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateWorkerPoolExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $workerPool = new WorkerPool(); - $response = $gapicClient->updateWorkerPool($workerPool); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateWorkerPoolTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/Build/tests/Unit/V2/Client/RepositoryManagerClientTest.php b/Build/tests/Unit/V2/Client/RepositoryManagerClientTest.php index 7a961ee47ae1..3c52394f96be 100644 --- a/Build/tests/Unit/V2/Client/RepositoryManagerClientTest.php +++ b/Build/tests/Unit/V2/Client/RepositoryManagerClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return RepositoryManagerClient */ @@ -123,9 +125,7 @@ public function batchCreateRepositoriesTest() // Mock request $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); $requests = []; - $request = (new BatchCreateRepositoriesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateRepositoriesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateRepositories($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -135,7 +135,10 @@ public function batchCreateRepositoriesTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getRequests(); @@ -183,19 +186,20 @@ public function batchCreateRepositoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); $requests = []; - $request = (new BatchCreateRepositoriesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateRepositoriesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateRepositories($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -322,12 +326,15 @@ public function createConnectionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -465,12 +472,15 @@ public function createRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); @@ -535,8 +545,7 @@ public function deleteConnectionTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new DeleteConnectionRequest()) - ->setName($formattedName); + $request = (new DeleteConnectionRequest())->setName($formattedName); $response = $gapicClient->deleteConnection($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -592,17 +601,19 @@ public function deleteConnectionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new DeleteConnectionRequest()) - ->setName($formattedName); + $request = (new DeleteConnectionRequest())->setName($formattedName); $response = $gapicClient->deleteConnection($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -656,8 +667,7 @@ public function deleteRepositoryTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); $response = $gapicClient->deleteRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -713,17 +723,19 @@ public function deleteRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); $response = $gapicClient->deleteRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -759,8 +771,7 @@ public function fetchGitRefsTest() $transport->addResponse($expectedResponse); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchGitRefsRequest()) - ->setRepository($formattedRepository); + $request = (new FetchGitRefsRequest())->setRepository($formattedRepository); $response = $gapicClient->fetchGitRefs($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -784,17 +795,19 @@ public function fetchGitRefsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchGitRefsRequest()) - ->setRepository($formattedRepository); + $request = (new FetchGitRefsRequest())->setRepository($formattedRepository); try { $gapicClient->fetchGitRefs($request); // If the $gapicClient method call did not throw, fail the test @@ -819,17 +832,14 @@ public function fetchLinkableRepositoriesTest() // Mock response $nextPageToken = ''; $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; + $repositories = [$repositoriesElement]; $expectedResponse = new FetchLinkableRepositoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRepositories($repositories); $transport->addResponse($expectedResponse); // Mock request $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new FetchLinkableRepositoriesRequest()) - ->setConnection($formattedConnection); + $request = (new FetchLinkableRepositoriesRequest())->setConnection($formattedConnection); $response = $gapicClient->fetchLinkableRepositories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -839,7 +849,10 @@ public function fetchLinkableRepositoriesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchLinkableRepositories', $actualFuncCall); + $this->assertSame( + '/google.devtools.cloudbuild.v2.RepositoryManager/FetchLinkableRepositories', + $actualFuncCall + ); $actualValue = $actualRequestObject->getConnection(); $this->assertProtobufEquals($formattedConnection, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -856,17 +869,19 @@ public function fetchLinkableRepositoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new FetchLinkableRepositoriesRequest()) - ->setConnection($formattedConnection); + $request = (new FetchLinkableRepositoriesRequest())->setConnection($formattedConnection); try { $gapicClient->fetchLinkableRepositories($request); // If the $gapicClient method call did not throw, fail the test @@ -895,8 +910,7 @@ public function fetchReadTokenTest() $transport->addResponse($expectedResponse); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchReadTokenRequest()) - ->setRepository($formattedRepository); + $request = (new FetchReadTokenRequest())->setRepository($formattedRepository); $response = $gapicClient->fetchReadToken($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -920,17 +934,19 @@ public function fetchReadTokenExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchReadTokenRequest()) - ->setRepository($formattedRepository); + $request = (new FetchReadTokenRequest())->setRepository($formattedRepository); try { $gapicClient->fetchReadToken($request); // If the $gapicClient method call did not throw, fail the test @@ -959,8 +975,7 @@ public function fetchReadWriteTokenTest() $transport->addResponse($expectedResponse); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchReadWriteTokenRequest()) - ->setRepository($formattedRepository); + $request = (new FetchReadWriteTokenRequest())->setRepository($formattedRepository); $response = $gapicClient->fetchReadWriteToken($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -984,17 +999,19 @@ public function fetchReadWriteTokenExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchReadWriteTokenRequest()) - ->setRepository($formattedRepository); + $request = (new FetchReadWriteTokenRequest())->setRepository($formattedRepository); try { $gapicClient->fetchReadWriteToken($request); // If the $gapicClient method call did not throw, fail the test @@ -1029,8 +1046,7 @@ public function getConnectionTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new GetConnectionRequest()) - ->setName($formattedName); + $request = (new GetConnectionRequest())->setName($formattedName); $response = $gapicClient->getConnection($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1054,17 +1070,19 @@ public function getConnectionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new GetConnectionRequest()) - ->setName($formattedName); + $request = (new GetConnectionRequest())->setName($formattedName); try { $gapicClient->getConnection($request); // If the $gapicClient method call did not throw, fail the test @@ -1099,8 +1117,7 @@ public function getRepositoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); $response = $gapicClient->getRepository($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1124,17 +1141,19 @@ public function getRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); try { $gapicClient->getRepository($request); // If the $gapicClient method call did not throw, fail the test @@ -1159,17 +1178,14 @@ public function listConnectionsTest() // Mock response $nextPageToken = ''; $connectionsElement = new Connection(); - $connections = [ - $connectionsElement, - ]; + $connections = [$connectionsElement]; $expectedResponse = new ListConnectionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setConnections($connections); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListConnectionsRequest()) - ->setParent($formattedParent); + $request = (new ListConnectionsRequest())->setParent($formattedParent); $response = $gapicClient->listConnections($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1196,17 +1212,19 @@ public function listConnectionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListConnectionsRequest()) - ->setParent($formattedParent); + $request = (new ListConnectionsRequest())->setParent($formattedParent); try { $gapicClient->listConnections($request); // If the $gapicClient method call did not throw, fail the test @@ -1231,17 +1249,14 @@ public function listRepositoriesTest() // Mock response $nextPageToken = ''; $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; + $repositories = [$repositoriesElement]; $expectedResponse = new ListRepositoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRepositories($repositories); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); $response = $gapicClient->listRepositories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1268,17 +1283,19 @@ public function listRepositoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); try { $gapicClient->listRepositories($request); // If the $gapicClient method call did not throw, fail the test @@ -1331,8 +1348,7 @@ public function updateConnectionTest() $operationsTransport->addResponse($completeOperation); // Mock request $connection = new Connection(); - $request = (new UpdateConnectionRequest()) - ->setConnection($connection); + $request = (new UpdateConnectionRequest())->setConnection($connection); $response = $gapicClient->updateConnection($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1388,17 +1404,19 @@ public function updateConnectionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $connection = new Connection(); - $request = (new UpdateConnectionRequest()) - ->setConnection($connection); + $request = (new UpdateConnectionRequest())->setConnection($connection); $response = $gapicClient->updateConnection($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1438,8 +1456,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1463,17 +1480,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1505,9 +1524,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1533,19 +1550,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1573,9 +1591,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1601,19 +1617,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1659,9 +1676,7 @@ public function batchCreateRepositoriesAsyncTest() // Mock request $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); $requests = []; - $request = (new BatchCreateRepositoriesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateRepositoriesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateRepositoriesAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1671,7 +1686,10 @@ public function batchCreateRepositoriesAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getRequests(); diff --git a/Build/tests/Unit/V2/RepositoryManagerClientTest.php b/Build/tests/Unit/V2/RepositoryManagerClientTest.php deleted file mode 100644 index 0cec252fb6b8..000000000000 --- a/Build/tests/Unit/V2/RepositoryManagerClientTest.php +++ /dev/null @@ -1,1530 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RepositoryManagerClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RepositoryManagerClient($options); - } - - /** @test */ - public function batchCreateRepositoriesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchCreateRepositoriesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchCreateRepositoriesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchCreateRepositoriesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $requests = []; - $response = $gapicClient->batchCreateRepositories($formattedParent, $requests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateRepositoriesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchCreateRepositoriesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchCreateRepositoriesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $requests = []; - $response = $gapicClient->batchCreateRepositories($formattedParent, $requests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateRepositoriesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createConnectionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $disabled = true; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Connection(); - $expectedResponse->setName($name); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createConnectionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - $connectionId = 'connectionId-513204708'; - $response = $gapicClient->createConnection($formattedParent, $connection, $connectionId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/CreateConnection', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getConnection(); - $this->assertProtobufEquals($connection, $actualValue); - $actualValue = $actualApiRequestObject->getConnectionId(); - $this->assertProtobufEquals($connectionId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConnectionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createConnectionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - $connectionId = 'connectionId-513204708'; - $response = $gapicClient->createConnection($formattedParent, $connection, $connectionId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConnectionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createRepositoryTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $remoteUri = 'remoteUri1041652211'; - $etag = 'etag3123477'; - $webhookId = 'webhookId311874531'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name); - $expectedResponse->setRemoteUri($remoteUri); - $expectedResponse->setEtag($etag); - $expectedResponse->setWebhookId($webhookId); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createRepositoryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $repository = new Repository(); - $repositoryRemoteUri = 'repositoryRemoteUri792690460'; - $repository->setRemoteUri($repositoryRemoteUri); - $repositoryId = 'repositoryId1101683248'; - $response = $gapicClient->createRepository($formattedParent, $repository, $repositoryId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/CreateRepository', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRepository(); - $this->assertProtobufEquals($repository, $actualValue); - $actualValue = $actualApiRequestObject->getRepositoryId(); - $this->assertProtobufEquals($repositoryId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRepositoryTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createRepositoryExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $repository = new Repository(); - $repositoryRemoteUri = 'repositoryRemoteUri792690460'; - $repository->setRemoteUri($repositoryRemoteUri); - $repositoryId = 'repositoryId1101683248'; - $response = $gapicClient->createRepository($formattedParent, $repository, $repositoryId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRepositoryTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteConnectionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteConnectionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->deleteConnection($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/DeleteConnection', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteConnectionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteConnectionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->deleteConnection($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteConnectionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteRepositoryTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteRepositoryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->deleteRepository($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/DeleteRepository', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteRepositoryExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->deleteRepository($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function fetchGitRefsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FetchGitRefsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->fetchGitRefs($formattedRepository); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchGitRefs', $actualFuncCall); - $actualValue = $actualRequestObject->getRepository(); - $this->assertProtobufEquals($formattedRepository, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchGitRefsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - try { - $gapicClient->fetchGitRefs($formattedRepository); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchLinkableRepositoriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; - $expectedResponse = new FetchLinkableRepositoriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRepositories($repositories); - $transport->addResponse($expectedResponse); - // Mock request - $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->fetchLinkableRepositories($formattedConnection); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRepositories()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchLinkableRepositories', $actualFuncCall); - $actualValue = $actualRequestObject->getConnection(); - $this->assertProtobufEquals($formattedConnection, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchLinkableRepositoriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->fetchLinkableRepositories($formattedConnection); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchReadTokenTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $token = 'token110541305'; - $expectedResponse = new FetchReadTokenResponse(); - $expectedResponse->setToken($token); - $transport->addResponse($expectedResponse); - // Mock request - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->fetchReadToken($formattedRepository); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchReadToken', $actualFuncCall); - $actualValue = $actualRequestObject->getRepository(); - $this->assertProtobufEquals($formattedRepository, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchReadTokenExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - try { - $gapicClient->fetchReadToken($formattedRepository); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchReadWriteTokenTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $token = 'token110541305'; - $expectedResponse = new FetchReadWriteTokenResponse(); - $expectedResponse->setToken($token); - $transport->addResponse($expectedResponse); - // Mock request - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->fetchReadWriteToken($formattedRepository); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchReadWriteToken', $actualFuncCall); - $actualValue = $actualRequestObject->getRepository(); - $this->assertProtobufEquals($formattedRepository, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchReadWriteTokenExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - try { - $gapicClient->fetchReadWriteToken($formattedRepository); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $disabled = true; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Connection(); - $expectedResponse->setName($name2); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->getConnection($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/GetConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConnectionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->getConnection($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $remoteUri = 'remoteUri1041652211'; - $etag = 'etag3123477'; - $webhookId = 'webhookId311874531'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name2); - $expectedResponse->setRemoteUri($remoteUri); - $expectedResponse->setEtag($etag); - $expectedResponse->setWebhookId($webhookId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->getRepository($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/GetRepository', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRepositoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - try { - $gapicClient->getRepository($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConnectionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $connectionsElement = new Connection(); - $connections = [ - $connectionsElement, - ]; - $expectedResponse = new ListConnectionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConnections($connections); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listConnections($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getConnections()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/ListConnections', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConnectionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listConnections($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRepositoriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; - $expectedResponse = new ListRepositoriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRepositories($repositories); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->listRepositories($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRepositories()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/ListRepositories', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRepositoriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->listRepositories($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateConnectionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $disabled = true; - $reconciling = false; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Connection(); - $expectedResponse->setName($name); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateConnectionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $connection = new Connection(); - $response = $gapicClient->updateConnection($connection); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/UpdateConnection', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getConnection(); - $this->assertProtobufEquals($connection, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateConnectionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateConnectionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $connection = new Connection(); - $response = $gapicClient->updateConnection($connection); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateConnectionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 751aceb2c074..0d850631d167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,3023 @@ # Changelog +## 0.248.0 + +
google/cloud-backupdr 0.1.0 + + + +### Features + +* Introduce BackupDr ([#7364](https://github.com/googleapis/google-cloud-php/issues/7364)) ([0378468](https://github.com/googleapis/google-cloud-php/commit/037846841d186199014aac43004aa395e9e6d3e2)) + +
+ +
google/cloud-batch 0.16.10 + + + +### Documentation + +* Documentation improvements ([#7369](https://github.com/googleapis/google-cloud-php/issues/7369)) ([dab2c39](https://github.com/googleapis/google-cloud-php/commit/dab2c3977edd8e720eade07c06c5c912f441c2b2)) + +
+ +
google/cloud-bigquery 1.30.3 + + + +### Bug Fixes + +* **BigQuery:** do not retry status code 499 (client canceled) ([cd4fdc3](https://github.com/googleapis/google-cloud-php/commit/cd4fdc396906dffd8f62a64f95a3ef6ecee74340)) + +
+ +
google/cloud-bigtable 2.0.0-RC1 + + + +### âš  BREAKING CHANGES + +* Upgrade Bigtable to 2.0.0-RC1 ([#7317](https://github.com/googleapis/google-cloud-php/issues/7317)) + +### Features + +* Upgrade Bigtable to 2.0.0-RC1 ([#7317](https://github.com/googleapis/google-cloud-php/issues/7317)) ([446c61f](https://github.com/googleapis/google-cloud-php/commit/446c61fa5b51248621cfed90a3831f01689e8258)) + +
+ +
google/cloud-container 1.31.0 + + + +### Features + +* A new method_signature `parent` is added to method `ListOperations` in service `ClusterManager` ([#7383](https://github.com/googleapis/google-cloud-php/issues/7383)) ([6383f83](https://github.com/googleapis/google-cloud-php/commit/6383f834747250b325b671de5b254fce234c46a9)) + +
+ +
google/cloud-core 1.59.0 + + + +### âš  BREAKING CHANGES + +* Upgrade Bigtable to 2.0.0-RC1 ([#7317](https://github.com/googleapis/google-cloud-php/issues/7317)) + +### Features + +* Upgrade Bigtable to 2.0.0-RC1 ([#7317](https://github.com/googleapis/google-cloud-php/issues/7317)) ([446c61f](https://github.com/googleapis/google-cloud-php/commit/446c61fa5b51248621cfed90a3831f01689e8258)) + +
+ +
google/maps-routeoptimization 0.1.0 + + + +### Features + +* Introduce Maps RouteOptimization ([#7365](https://github.com/googleapis/google-cloud-php/issues/7365)) ([7b748a6](https://github.com/googleapis/google-cloud-php/commit/7b748a642474f04942a86c87e2a70d9abe201591)) + +
+ +
google/cloud-networkservices 0.1.0 + + + +### Features + +* Introduce NetworkServices ([#7370](https://github.com/googleapis/google-cloud-php/issues/7370)) ([f702871](https://github.com/googleapis/google-cloud-php/commit/f7028712e4319b947415a51701238a76a54e03fc)) + +
+ +
google/cloud-pubsub 2.2.1 + + + +### Bug Fixes + +* Pubsub version constant ([#7362](https://github.com/googleapis/google-cloud-php/issues/7362)) ([ffcadde](https://github.com/googleapis/google-cloud-php/commit/ffcadde3f3d88b3ef2b41f48d385dbed89679591)) + +
+ +
google/cloud-redis-cluster 0.3.0 + + + +### Features + +* Add persistence support ([b01e8dc](https://github.com/googleapis/google-cloud-php/commit/b01e8dcd3a229b0f5f0d8aa6ec60257444859b75)) +* Add support for different node types ([#7368](https://github.com/googleapis/google-cloud-php/issues/7368)) ([b01e8dc](https://github.com/googleapis/google-cloud-php/commit/b01e8dcd3a229b0f5f0d8aa6ec60257444859b75)) +* Get details of certificate authority from redis cluster ([b01e8dc](https://github.com/googleapis/google-cloud-php/commit/b01e8dcd3a229b0f5f0d8aa6ec60257444859b75)) + + +### Documentation + +* Size_gb field shows the size of the cluster rounded up to the next integer, precise_size_gb field will show the exact size of the cluster ([b01e8dc](https://github.com/googleapis/google-cloud-php/commit/b01e8dcd3a229b0f5f0d8aa6ec60257444859b75)) + +
+ +
google/cloud-resource-settings 1.2.6 + + + +### Documentation + +* Resource Settings is deprecated. As of November 7, 2023, no organizations will be onboarded for any of the enabled settings, and the service will be shut down on October 1, 2024 ([#7358](https://github.com/googleapis/google-cloud-php/issues/7358)) ([7a1be5a](https://github.com/googleapis/google-cloud-php/commit/7a1be5ac80750b82bb62102b17cd438ea8790ddc)) + +
+ +
google/cloud-retail 1.7.0 + + + +### Features + +* Add page_categories to control condition ([c5ea1f3](https://github.com/googleapis/google-cloud-php/commit/c5ea1f329305a41613b074232a753a1160ed52a0)) +* Add product purge API ([c5ea1f3](https://github.com/googleapis/google-cloud-php/commit/c5ea1f329305a41613b074232a753a1160ed52a0)) +* Allow to skip denylist postfiltering in recommendations ([c5ea1f3](https://github.com/googleapis/google-cloud-php/commit/c5ea1f329305a41613b074232a753a1160ed52a0)) +* Support attribute suggestion in autocomplete ([c5ea1f3](https://github.com/googleapis/google-cloud-php/commit/c5ea1f329305a41613b074232a753a1160ed52a0)) +* Support frequent bought together model config ([c5ea1f3](https://github.com/googleapis/google-cloud-php/commit/c5ea1f329305a41613b074232a753a1160ed52a0)) +* Support merged facets ([#7382](https://github.com/googleapis/google-cloud-php/issues/7382)) ([c5ea1f3](https://github.com/googleapis/google-cloud-php/commit/c5ea1f329305a41613b074232a753a1160ed52a0)) + + +### Documentation + +* Keep the API doc up-to-date with recent changes ([c5ea1f3](https://github.com/googleapis/google-cloud-php/commit/c5ea1f329305a41613b074232a753a1160ed52a0)) + +
+ +
google/cloud-securitycentermanagement 0.3.2 + + + +### Documentation + +* Minor docs formatting in `UpdateSecurityCenterServiceRequest.validate_only` ([#7379](https://github.com/googleapis/google-cloud-php/issues/7379)) ([343a465](https://github.com/googleapis/google-cloud-php/commit/343a465e600bd06fd6da4a76877f6ad38de82545)) + +
+ +
google/shopping-merchant-accounts 0.1.0 + + + +### Features + +* introduce Shopping Merchant APIs for LFP, Notifications, Accounts, Datasources, Products, Promotions ([#7367](https://github.com/googleapis/google-cloud-php/issues/7367)) ([2c700e7](https://github.com/googleapis/google-cloud-php/commit/2c700e77f2073e8646d20a4424ba5f3234a4982b)) + + +### Documentation + +* Format comments in ListUsersRequest ([#7384](https://github.com/googleapis/google-cloud-php/issues/7384)) ([bb67e02](https://github.com/googleapis/google-cloud-php/commit/bb67e02426312f6c05722219b8d75c7e49eee261)) + +
+ +
google/shopping-merchant-datasources 0.1.0 + + + +### Features + +* introduce Shopping Merchant APIs for LFP, Notifications, Accounts, Datasources, Products, Promotions ([#7367](https://github.com/googleapis/google-cloud-php/issues/7367)) ([2c700e7](https://github.com/googleapis/google-cloud-php/commit/2c700e77f2073e8646d20a4424ba5f3234a4982b)) + +
+ +
google/shopping-merchant-inventories 0.5.0 + + + +### âš  BREAKING CHANGES + +* Remove deprecated client surfaces ([#7366](https://github.com/googleapis/google-cloud-php/issues/7366)) + +### Bug Fixes + +* Remove deprecated client surfaces ([#7366](https://github.com/googleapis/google-cloud-php/issues/7366)) ([19d35b2](https://github.com/googleapis/google-cloud-php/commit/19d35b20e244875ea49f898fabb8c987a40c66c2)) + +
+ +
google/shopping-merchant-lfp 0.1.0 + + + +### Features + +* introduce Shopping Merchant APIs for LFP, Notifications, Accounts, Datasources, Products, Promotions ([#7367](https://github.com/googleapis/google-cloud-php/issues/7367)) ([2c700e7](https://github.com/googleapis/google-cloud-php/commit/2c700e77f2073e8646d20a4424ba5f3234a4982b)) + +
+ +
google/shopping-merchant-notifications 0.1.0 + + + +### Features + +* introduce Shopping Merchant APIs for LFP, Notifications, Accounts, Datasources, Products, Promotions ([#7367](https://github.com/googleapis/google-cloud-php/issues/7367)) ([2c700e7](https://github.com/googleapis/google-cloud-php/commit/2c700e77f2073e8646d20a4424ba5f3234a4982b)) + +
+ +
google/shopping-merchant-products 0.1.0 + + + +### Features + +* introduce Shopping Merchant APIs for LFP, Notifications, Accounts, Datasources, Products, Promotions ([#7367](https://github.com/googleapis/google-cloud-php/issues/7367)) ([2c700e7](https://github.com/googleapis/google-cloud-php/commit/2c700e77f2073e8646d20a4424ba5f3234a4982b)) + +
+ +
google/shopping-merchant-promotions 0.1.0 + + + +### Features + +* introduce Shopping Merchant APIs for LFP, Notifications, Accounts, Datasources, Products, Promotions ([#7367](https://github.com/googleapis/google-cloud-php/issues/7367)) ([2c700e7](https://github.com/googleapis/google-cloud-php/commit/2c700e77f2073e8646d20a4424ba5f3234a4982b)) + +
+ +
google/cloud-sql-admin 0.18.0 + + + +### Features + +* Support for CLUSTER_MAINTENANCE and SELF_SERVICE_MAINTENANCE operation types ([#7363](https://github.com/googleapis/google-cloud-php/issues/7363)) ([23415ce](https://github.com/googleapis/google-cloud-php/commit/23415ce49ac44aa961bed5af7a6dfec7daa55a3c)) +* Support for MySQL 8.4 ([23415ce](https://github.com/googleapis/google-cloud-php/commit/23415ce49ac44aa961bed5af7a6dfec7daa55a3c)) + + +### Documentation + +* Various updates and clarifications to the documentation ([23415ce](https://github.com/googleapis/google-cloud-php/commit/23415ce49ac44aa961bed5af7a6dfec7daa55a3c)) + +
+ +## 0.247.0 + +
google/cloud-access-approval 1.2.5 + + + +
+ +
google/access-context-manager 0.5.5 + + + +
+ +
google/cloud-advisorynotifications 0.8.3 + + + +
+ +
google/cloud-ai-platform 0.39.0 + + + +### âš  BREAKING CHANGES + +* An existing message `Segment` is removed +* An existing message `GroundingAttribution` is removed +* An existing field `grounding_attributions` is removed from message `.google.cloud.aiplatform.v1beta1.GroundingMetadata` +* An existing field `disable_attribution` is removed from message `.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval` + +### Features + +* Add dataplex_config to MetadataStore ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add direct_notebook_source to NotebookExecutionJob ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add encryption_spec to FeatureOnlineStore ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add encryption_spec to NotebookRuntimeTemplate ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add encryption_spec, service_account, disable_container_logging to DeploymentResourcePool ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add idle_shutdown_config, encryption_spec, satisfies_pzs, satisfies_pzi to NotebookRuntime ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add INVALID_SPARSE_DIMENSIONS, INVALID_SPARSE_EMBEDDING, INVALID_EMBEDDING to NearestNeighborSearchOperationMetadata.RecordError ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add model_reference to Dataset ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add model_reference to DatasetVersion ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add more fields in FindNeighborsRequest.Query ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add RaySpec to PersistentResource ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add sparse_distance to FindNeighborsResponse.Neighbor ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add sparse_embedding to IndexDatapoint ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add sparse_vectors_count to IndexStats ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add struct_value to FeatureValue ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add tool_config to GenerateContentRequest ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add UpdateNotebookRuntimeTemplate to NotebookService ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add valid_sparse_record_count, invalid_sparse_record_count to NearestNeighborSearchOperationMetadata.ContentValidationStats ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* Add ValueType.STRUCT to Feature ([#7351](https://github.com/googleapis/google-cloud-php/issues/7351)) ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) + + +### Bug Fixes + +* An existing field `disable_attribution` is removed from message `.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval` ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* An existing field `grounding_attributions` is removed from message `.google.cloud.aiplatform.v1beta1.GroundingMetadata` ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* An existing message `GroundingAttribution` is removed ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* An existing message `Segment` is removed ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) + + +### Documentation + +* A comment for enum value `EMBEDDING_SIZE_MISMATCH` in enum `RecordErrorType` is changed ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* A comment for field `exec` in message `.google.cloud.aiplatform.v1beta1.Probe` is changed ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* A comment for field `feature_vector` in message `.google.cloud.aiplatform.v1beta1.IndexDatapoint` is changed ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) +* A comment for field `vectors_count` in message `.google.cloud.aiplatform.v1beta1.IndexStats` is changed ([e81f6dc](https://github.com/googleapis/google-cloud-php/commit/e81f6dc8e27a8cd4d969b6f38d432b658a4b8518)) + +
+ +
google/cloud-alloydb 0.10.3 + + + +
+ +
google/analytics-admin 0.22.5 + + + +
+ +
google/analytics-data 0.17.1 + + + +
+ +
google/cloud-api-gateway 1.3.5 + + + +
+ +
google/cloud-api-keys 0.4.5 + + + +
+ +
google/cloud-apigee-connect 1.2.5 + + + +
+ +
google/cloud-apigee-registry 0.5.5 + + + +
+ +
google/cloud-appengine-admin 1.3.5 + + + +
+ +
google/cloud-apphub 0.1.3 + + + +
+ +
google/apps-chat 0.1.3 + + + +
+ +
google/apps-events-subscriptions 0.1.3 + + + +
+ +
google/apps-meet 0.2.3 + + + +
+ +
google/cloud-artifact-registry 0.6.5 + + + +
+ +
google/cloud-asset 1.16.3 + + + +
+ +
google/cloud-assured-workloads 0.11.5 + + + +
+ +
google/cloud-automl 1.6.5 + + + +
+ +
google/cloud-bare-metal-solution 0.6.5 + + + +
+ +
google/cloud-batch 0.16.9 + + + +
+ +
google/cloud-beyondcorp-appconnections 0.4.5 + + + +
+ +
google/cloud-beyondcorp-appconnectors 0.4.5 + + + +
+ +
google/cloud-beyondcorp-appgateways 0.4.5 + + + +
+ +
google/cloud-beyondcorp-clientconnectorservices 0.4.5 + + + +
+ +
google/cloud-beyondcorp-clientgateways 0.4.5 + + + +
+ +
google/cloud-bigquery-analyticshub 0.5.3 + + + +
+ +
google/cloud-bigquery-connection 1.5.5 + + + +
+ +
google/cloud-bigquery-data-exchange 0.4.5 + + + +
+ +
google/cloud-bigquery-datapolicies 0.5.5 + + + +
+ +
google/cloud-bigquerydatatransfer 1.8.5 + + + +### Documentation + +* Update OAuth links in `CreateTransferConfigRequest` and `UpdateTransferConfigRequest` ([#7349](https://github.com/googleapis/google-cloud-php/issues/7349)) ([42677a2](https://github.com/googleapis/google-cloud-php/commit/42677a2d20e019203bd62d03c888ca0d154ef848)) + +
+ +
google/cloud-bigquery-migration 0.4.5 + + + +
+ +
google/cloud-bigquery-reservation 1.3.5 + + + +
+ +
google/cloud-bigquery-storage 1.10.4 + + + +
+ +
google/cloud-bigtable 1.32.1 + + + +
+ +
google/cloud-billing 1.9.7 + + + +
+ +
google/cloud-billing-budgets 1.4.5 + + + +
+ +
google/cloud-binary-authorization 0.8.7 + + + +
+ +
google/cloud-build 0.16.3 + + + +
+ +
google/cloud-certificate-manager 0.7.3 + + + +
+ +
google/cloud-channel 1.9.5 + + + +
+ +
google/cloud-commerce-consumer-procurement 0.2.5 + + + +
+ +
google/cloud-compute 1.18.1 + + + +
+ +
google/cloud-confidentialcomputing 0.8.3 + + + +
+ +
google/cloud-config 0.5.2 + + + +
+ +
google/cloud-contact-center-insights 1.9.5 + + + +
+ +
google/cloud-container 1.30.3 + + + +
+ +
google/cloud-container-analysis 0.5.7 + + + +
+ +
google/cloud-cloudcontrolspartner 0.1.3 + + + +
+ +
google/cloud-core 1.58.2 + + + +
+ +
google/cloud-data-catalog 1.10.3 + + + +
+ +
google/cloud-datacatalog-lineage 0.5.5 + + + +
+ +
google/cloud-data-fusion 0.6.5 + + + +
+ +
google/cloud-datalabeling 0.5.5 + + + +
+ +
google/cloud-dataflow 0.6.4 + + + +
+ +
google/cloud-dataform 0.4.5 + + + +
+ +
google/cloud-dataplex 0.16.1 + + + +
+ +
google/cloud-dataproc 3.13.4 + + + +
+ +
google/cloud-dataproc-metastore 0.11.5 + + + +
+ +
google/cloud-datastore 1.29.1 + + + +
+ +
google/cloud-datastore-admin 0.8.5 + + + +
+ +
google/cloud-datastream 1.5.5 + + + +
+ +
google/cloud-debugger 1.8.7 + + + +
+ +
google/cloud-deploy 0.19.1 + + + +
+ +
google/cloud-developerconnect 0.1.1 + + + +
+ +
google/cloud-dialogflow 1.12.3 + + + +
+ +
google/cloud-dialogflow-cx 0.3.4 + + + +
+ +
google/cloud-discoveryengine 0.11.3 + + + +
+ +
google/cloud-dlp 1.15.1 + + + +
+ +
google/cloud-dms 1.5.5 + + + +
+ +
google/cloud-document-ai 1.13.0 + + + +### Features + +* Make Layout Parser generally available in V1 ([#7350](https://github.com/googleapis/google-cloud-php/issues/7350)) ([c396919](https://github.com/googleapis/google-cloud-php/commit/c3969193b69760d37e87c1749d6029fc782fbc00)) + +
+ +
google/cloud-domains 0.5.5 + + + +
+ +
google/cloud-edgenetwork 0.3.6 + + + +
+ +
google/cloud-error-reporting 0.22.6 + + + +
+ +
google/cloud-essential-contacts 0.4.5 + + + +
+ +
google/cloud-eventarc 1.3.5 + + + +
+ +
google/cloud-eventarc-publishing 0.6.4 + + + +
+ +
google/cloud-filestore 1.5.7 + + + +
+ +
google/cloud-firestore 1.43.3 + + + +
+ +
google/cloud-functions 1.6.5 + + + +
+ +
google/cloud-gsuite-addons 0.3.5 + + + +
+ +
google/cloud-game-servers 1.2.6 + + + +
+ +
google/cloud-gke-backup 0.8.1 + + + +
+ +
google/cloud-gke-connect-gateway 0.4.4 + + + +
+ +
google/cloud-gke-hub 0.9.5 + + + +
+ +
google/cloud-gke-multi-cloud 0.6.1 + + + +
+ +
google/grafeas 0.10.3 + + + +
+ +
google/cloud-iam 0.5.5 + + + +
+ +
google/cloud-iam-credentials 1.2.5 + + + +
+ +
google/cloud-iap 1.4.5 + + + +
+ +
google/cloud-ids 0.5.5 + + + +
+ +
google/cloud-iot 1.7.5 + + + +
+ +
google/cloud-kms 1.22.1 + + + +
+ +
google/cloud-kms-inventory 0.4.5 + + + +
+ +
google/cloud-language 0.32.6 + + + +
+ +
google/cloud-life-sciences 0.6.5 + + + +
+ +
google/cloud-logging 1.30.2 + + + +
+ +
google/longrunning 0.4.3 + + + +
+ +
google/cloud-managed-identities 1.3.5 + + + +
+ +
google/maps-fleetengine 0.1.2 + + + +
+ +
google/maps-fleetengine-delivery 0.1.1 + + + +
+ +
google/cloud-media-translation 0.4.4 + + + +
+ +
google/cloud-memcache 1.3.5 + + + +
+ +
google/cloud-migrationcenter 0.4.5 + + + +
+ +
google/cloud-monitoring 1.10.3 + + + +
+ +
google/cloud-netapp 0.3.1 + + + +
+ +
google/cloud-network-connectivity 1.5.5 + + + +
+ +
google/cloud-network-management 1.7.3 + + + +
+ +
google/cloud-network-security 0.6.5 + + + +
+ +
google/cloud-notebooks 0.7.5 + + + +
+ +
google/cloud-optimization 0.6.5 + + + +
+ +
google/cloud-orchestration-airflow 1.6.4 + + + +
+ +
google/cloud-org-policy 0.6.5 + + + +
+ +
google/cloud-osconfig 1.3.5 + + + +
+ +
google/cloud-oslogin 1.9.5 + + + +
+ +
google/cloud-parallelstore 0.3.1 + + + +
+ +
google/cloud-policysimulator 0.2.5 + + + +
+ +
google/cloud-policy-troubleshooter 1.3.4 + + + +
+ +
google/cloud-policytroubleshooter-iam 0.2.5 + + + +
+ +
google/cloud-private-catalog 0.4.4 + + + +
+ +
google/cloud-profiler 1.4.3 + + + +
+ +
google/cloud-pubsub 2.2.0 + + + +### Features + +* Add service_account_email for export subscriptions ([#7353](https://github.com/googleapis/google-cloud-php/issues/7353)) ([f86b038](https://github.com/googleapis/google-cloud-php/commit/f86b038cbcd587411c598d6c15ebecda2190fa09)) + +
+ +
google/cloud-quotas 0.2.3 + + + +
+ +
google/cloud-rapidmigrationassessment 0.3.5 + + + +
+ +
google/cloud-recaptcha-enterprise 1.12.2 + + + +
+ +
google/cloud-recommendations-ai 0.7.5 + + + +
+ +
google/cloud-recommender 1.11.5 + + + +
+ +
google/cloud-redis 1.9.5 + + + +
+ +
google/cloud-redis-cluster 0.2.5 + + + +
+ +
google/cloud-resource-manager 0.8.5 + + + +
+ +
google/cloud-resource-settings 1.2.5 + + + +
+ +
google/cloud-retail 1.6.4 + + + +
+ +
google/cloud-run 0.9.3 + + + +
+ +
google/cloud-scheduler 1.10.5 + + + +
+ +
google/cloud-secret-manager 1.15.2 + + + +
+ +
google/cloud-securesourcemanager 0.2.5 + + + +
+ +
google/cloud-security-center 1.28.2 + + + +
+ +
google/cloud-securitycentermanagement 0.3.1 + + + +
+ +
google/cloud-security-private-ca 1.7.3 + + + +
+ +
google/cloud-security-public-ca 0.4.1 + + + +
+ +
google/cloud-service-control 1.4.4 + + + +
+ +
google/cloud-service-directory 1.3.6 + + + +
+ +
google/cloud-servicehealth 0.1.6 + + + +
+ +
google/cloud-service-management 1.3.5 + + + +
+ +
google/cloud-service-usage 1.3.4 + + + +
+ +
google/cloud-shell 1.3.5 + + + +
+ +
google/shopping-css 0.2.7 + + + +
+ +
google/shopping-merchant-conversions 0.1.2 + + + +
+ +
google/shopping-merchant-inventories 0.4.5 + + + +
+ +
google/shopping-merchant-quota 0.1.3 + + + +
+ +
google/shopping-merchant-reports 0.8.1 + + + +
+ +
google/cloud-spanner 1.79.0 + + + +### Features + +* **spanner:** Add PG.OID type support for parameterized queries ([#6788](https://github.com/googleapis/google-cloud-php/issues/6788)) ([273683d](https://github.com/googleapis/google-cloud-php/commit/273683d22dce24ac7500e9744d939832ed337bb2)) + +
+ +
google/cloud-speech 1.18.3 + + + +
+ +
google/cloud-sql-admin 0.17.1 + + + +
+ +
google/cloud-storage-control 0.2.1 + + + +
+ +
google/cloud-storageinsights 0.3.5 + + + +
+ +
google/cloud-storage-transfer 1.4.5 + + + +
+ +
google/cloud-support 0.2.5 + + + +
+ +
google/cloud-talent 1.3.5 + + + +
+ +
google/cloud-tasks 1.14.6 + + + +
+ +
google/cloud-telcoautomation 0.2.5 + + + +
+ +
google/cloud-text-to-speech 1.8.5 + + + +
+ +
google/cloud-tpu 1.4.5 + + + +
+ +
google/cloud-trace 1.8.6 + + + +
+ +
google/cloud-translate 1.17.7 + + + +
+ +
google/cloud-videointelligence 1.15.5 + + + +
+ +
google/cloud-video-live-stream 0.7.5 + + + +
+ +
google/cloud-video-stitcher 0.9.1 + + + +
+ +
google/cloud-video-transcoder 0.10.5 + + + +
+ +
google/cloud-vision 1.9.4 + + + +
+ +
google/cloud-vm-migration 0.6.5 + + + +
+ +
google/cloud-vmware-engine 0.5.6 + + + +
+ +
google/cloud-vpc-access 1.3.5 + + + +
+ +
google/cloud-web-risk 1.5.5 + + + +
+ +
google/cloud-web-security-scanner 0.8.5 + + + +
+ +
google/cloud-workflows 0.5.5 + + + +
+ +## 0.246.0 + +
google/cloud-bigtable 1.32.0 + + + +### Features + +* Add String type with Utf8Raw encoding to Bigtable API ([#7338](https://github.com/googleapis/google-cloud-php/issues/7338)) ([cece74c](https://github.com/googleapis/google-cloud-php/commit/cece74ca6c68e1c8d4323fb13184743be096af46)) + +
+ +
google/cloud-datastore 1.29.0 + + + +### Features + +* New PropertyMask field which allows partial commits, lookups, and query results ([#7321](https://github.com/googleapis/google-cloud-php/issues/7321)) ([ab2938c](https://github.com/googleapis/google-cloud-php/commit/ab2938c9047c9daa7b59b2a5076b4c9c22b49f62)) + +
+ +
google/cloud-developerconnect 0.1.0 + + + +### Features + +* Introduce DeveloperConnect ([#7340](https://github.com/googleapis/google-cloud-php/issues/7340)) ([4210698](https://github.com/googleapis/google-cloud-php/commit/4210698578efbddde023b0477b5f9c554030872b)) + +
+ +
google/cloud-dlp 1.15.0 + + + +### Features + +* Add secrets discovery support ([#7336](https://github.com/googleapis/google-cloud-php/issues/7336)) ([6178651](https://github.com/googleapis/google-cloud-php/commit/6178651cff02c004ea73af3b1e45ab4ceebd354c)) + + +### Documentation + +* Updated method documentation ([6178651](https://github.com/googleapis/google-cloud-php/commit/6178651cff02c004ea73af3b1e45ab4ceebd354c)) + +
+ +
google/cloud-gke-backup 0.8.0 + + + +### Features + +* Add fine-grained restore ([#7320](https://github.com/googleapis/google-cloud-php/issues/7320)) ([0547cb0](https://github.com/googleapis/google-cloud-php/commit/0547cb09d5aa66753338b3ded3b17ecb5f552b38)) +* Add gitops ([0547cb0](https://github.com/googleapis/google-cloud-php/commit/0547cb09d5aa66753338b3ded3b17ecb5f552b38)) +* Add restore order ([0547cb0](https://github.com/googleapis/google-cloud-php/commit/0547cb09d5aa66753338b3ded3b17ecb5f552b38)) +* Add strict-permissive mode ([0547cb0](https://github.com/googleapis/google-cloud-php/commit/0547cb09d5aa66753338b3ded3b17ecb5f552b38)) +* Add volume restore flexibility ([0547cb0](https://github.com/googleapis/google-cloud-php/commit/0547cb09d5aa66753338b3ded3b17ecb5f552b38)) + + +### Documentation + +* Update duration comment to include new validation from smart scheduling ([0547cb0](https://github.com/googleapis/google-cloud-php/commit/0547cb09d5aa66753338b3ded3b17ecb5f552b38)) + +
+ +
google/maps-fleetengine 0.1.1 + + + +
+ +
google/cloud-securitycentermanagement 0.3.0 + + + +### Features + +* Adding support for new Security Center Management Apis ([#7331](https://github.com/googleapis/google-cloud-php/issues/7331)) ([7e98d79](https://github.com/googleapis/google-cloud-php/commit/7e98d791ebc58e66bc81f569f65409394faed6e6)) + + +### Documentation + +* Update comment formatting throughout API ([7e98d79](https://github.com/googleapis/google-cloud-php/commit/7e98d791ebc58e66bc81f569f65409394faed6e6)) + +
+ +
google/cloud-security-public-ca 0.4.0 + + + +### Features + +* Add V1 for SecurityPublicCA ([#7319](https://github.com/googleapis/google-cloud-php/issues/7319)) ([85befc4](https://github.com/googleapis/google-cloud-php/commit/85befc48e9b31055659089903e13f882752fd746)) + +
+ +
google/shopping-merchant-conversions 0.1.1 + + + +### Documentation + +* A comment for message `MerchantCenterDestination` is changed ([d9446a3](https://github.com/googleapis/google-cloud-php/commit/d9446a3c0382d10e0737f998114d671ec8696a4a)) +* Change in wording : website -> online store ([#7326](https://github.com/googleapis/google-cloud-php/issues/7326)) ([d9446a3](https://github.com/googleapis/google-cloud-php/commit/d9446a3c0382d10e0737f998114d671ec8696a4a)) + +
+ +
google/shopping-merchant-inventories 0.4.4 + + + +### Documentation + +* A comment for field `availability` in message `.google.shopping.merchant.inventories.v1beta.LocalInventory` is changed ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) +* A comment for field `availability` in message `.google.shopping.merchant.inventories.v1beta.RegionalInventory` is changed ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) +* A comment for field `custom_attributes` in message `.google.shopping.merchant.inventories.v1beta.LocalInventory` is changed ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) +* A comment for field `custom_attributes` in message `.google.shopping.merchant.inventories.v1beta.RegionalInventory` is changed ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) +* A comment for field `pickup_method` in message `.google.shopping.merchant.inventories.v1beta.LocalInventory` is changed ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) +* A comment for field `pickup_sla` in message `.google.shopping.merchant.inventories.v1beta.LocalInventory` is changed ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) +* A comment for field `store_code` in message `.google.shopping.merchant.inventories.v1beta.LocalInventory` is changed ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) +* A comment for message `LocalInventory` is changed ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) +* A comment for message `RegionalInventory` is changed ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) +* Change in wording : feed specification -> data specification ([#7324](https://github.com/googleapis/google-cloud-php/issues/7324)) ([70dd5f3](https://github.com/googleapis/google-cloud-php/commit/70dd5f3d94fd536d7d0a32f02b1735219a760412)) + +
+ +
google/shopping-merchant-reports 0.8.0 + + + +### Features + +* Add `effectiveness` field to `price_insights_product_view` table in Reports sub-API ([e5e739c](https://github.com/googleapis/google-cloud-php/commit/e5e739c4f718c5ff29194ecd6b312909676130d1)) +* Add `non_product_performance_view` table to Reports sub-API ([#7325](https://github.com/googleapis/google-cloud-php/issues/7325)) ([e5e739c](https://github.com/googleapis/google-cloud-php/commit/e5e739c4f718c5ff29194ecd6b312909676130d1)) + +
+ +
google/cloud-spanner 1.78.0 + + + +### Features + +* Add field lock_hint in spanner.proto ([73a3212](https://github.com/googleapis/google-cloud-php/commit/73a3212654717f9ef6837cc13e0fc4a3a261afc7)) +* Add field order_by in spanner.proto ([#7339](https://github.com/googleapis/google-cloud-php/issues/7339)) ([73a3212](https://github.com/googleapis/google-cloud-php/commit/73a3212654717f9ef6837cc13e0fc4a3a261afc7)) + + +### Bug Fixes + +* Only override metadata for PartialResultSet when it is present in the response ([#7334](https://github.com/googleapis/google-cloud-php/issues/7334)) ([c2078a6](https://github.com/googleapis/google-cloud-php/commit/c2078a6cd435ee954a8e74c9964601c36252c447)) + +
+ +
google/cloud-video-stitcher 0.9.0 + + + +### Features + +* Add apis for Create, Read, Update, Delete for VODConfigs ([#7332](https://github.com/googleapis/google-cloud-php/issues/7332)) ([2758508](https://github.com/googleapis/google-cloud-php/commit/27585082a65d77ea24187ee4140be0a041981b05)) +* Added adtracking to Livesession ([2758508](https://github.com/googleapis/google-cloud-php/commit/27585082a65d77ea24187ee4140be0a041981b05)) +* Added fetchoptions with custom headers for Live and VODConfigs ([2758508](https://github.com/googleapis/google-cloud-php/commit/27585082a65d77ea24187ee4140be0a041981b05)) +* Added targetting parameter support to Livesession ([2758508](https://github.com/googleapis/google-cloud-php/commit/27585082a65d77ea24187ee4140be0a041981b05)) +* Added token config for MediaCdnKey ([2758508](https://github.com/googleapis/google-cloud-php/commit/27585082a65d77ea24187ee4140be0a041981b05)) +* Allowed usage for VODConfigs in VODSession ([2758508](https://github.com/googleapis/google-cloud-php/commit/27585082a65d77ea24187ee4140be0a041981b05)) + + +### Documentation + +* Added apis for Create, Read, Update, Delete For VODConfigs. Added vodConfig usage in VODSession. Added TokenConfig for MediaCdnKey. Added targeting_parameter and ad_tracking for Livesession. Added FetchOptions for Live and VOD configs. ([2758508](https://github.com/googleapis/google-cloud-php/commit/27585082a65d77ea24187ee4140be0a041981b05)) + +
+ +## 0.245.0 + +
google/analytics-data 0.17.0 + + + +### Features + +* Add `CreateReportTask`, `QueryReportTask`, `GetReportTask`, `ListReportTasks` methods to the Data API v1alpha ([#7295](https://github.com/googleapis/google-cloud-php/issues/7295)) ([bd673bd](https://github.com/googleapis/google-cloud-php/commit/bd673bdbebdabe81a64b09b217b0c28574ff01a4)) +* Add `ReportTask`, `Metric`, `OrderBy`, `Cohort`, `CohortsRange`, `CohortReportSettings`, `ResponseMetaData`, `MetricAggregation`, `RestrictedMetricType` types to the Data API v1alpha ([bd673bd](https://github.com/googleapis/google-cloud-php/commit/bd673bdbebdabe81a64b09b217b0c28574ff01a4)) + +
+ +
google/apps-chat 0.1.2 + + + +### Documentation + +* Update Chat API comments ([#7306](https://github.com/googleapis/google-cloud-php/issues/7306)) ([2a4604b](https://github.com/googleapis/google-cloud-php/commit/2a4604bc6b6b90f4e71e671a995a878549a8280c)) + +
+ +
google/cloud-batch 0.16.8 + + + +### Documentation + +* Refine description for field `task_execution` ([#7307](https://github.com/googleapis/google-cloud-php/issues/7307)) ([b6f2ed0](https://github.com/googleapis/google-cloud-php/commit/b6f2ed0f0abf75960ccd8e0069af13fbdd3ddfcf)) + +
+ +
google/cloud-compute 1.18.0 + + + +### Features + +* Update Compute Engine API to revision 20240430 ([#900](https://github.com/googleapis/google-cloud-php/issues/900)) ([#7297](https://github.com/googleapis/google-cloud-php/issues/7297)) ([78afc83](https://github.com/googleapis/google-cloud-php/commit/78afc833723c57614ee8288806938bf79c4f0958)) + +
+ +
google/cloud-deploy 0.19.0 + + + +### Features + +* Add Skaffold verbose support to Execution Environment properties ([#7315](https://github.com/googleapis/google-cloud-php/issues/7315)) ([578a61a](https://github.com/googleapis/google-cloud-php/commit/578a61ab7da6786a13698a58dd7332bc6779b792)) + +
+ +
google/cloud-dlp 1.14.0 + + + +### Features + +* Add field to InspectJobs num_rows_processed for BigQuery inspect jobs ([d905def](https://github.com/googleapis/google-cloud-php/commit/d905defec82c6b71d773ce24bd4e9edb8bbd3888)) +* Add new countries for supported detectors ([d905def](https://github.com/googleapis/google-cloud-php/commit/d905defec82c6b71d773ce24bd4e9edb8bbd3888)) +* Add RPCs for deleting TableDataProfiles ([#7294](https://github.com/googleapis/google-cloud-php/issues/7294)) ([d905def](https://github.com/googleapis/google-cloud-php/commit/d905defec82c6b71d773ce24bd4e9edb8bbd3888)) +* Add RPCs for enabling discovery of Cloud SQL ([d905def](https://github.com/googleapis/google-cloud-php/commit/d905defec82c6b71d773ce24bd4e9edb8bbd3888)) + + +### Documentation + +* Updated method documentation ([d905def](https://github.com/googleapis/google-cloud-php/commit/d905defec82c6b71d773ce24bd4e9edb8bbd3888)) + +
+ +
google/cloud-document-ai 1.12.2 + + + +### Documentation + +* Clarify the unavailability of some features ([#7312](https://github.com/googleapis/google-cloud-php/issues/7312)) ([e2cee2d](https://github.com/googleapis/google-cloud-php/commit/e2cee2d72b86ed4c4e55ffa27be692eed19ab02f)) +* Updated comments ([#7301](https://github.com/googleapis/google-cloud-php/issues/7301)) ([22def9f](https://github.com/googleapis/google-cloud-php/commit/22def9f04c3c10604a44afea5dd3e8e55979e7eb)) + +
+ +
google/geo-common-protos 0.1.0 + + + +### Features + +* Add fleetengine, fleetengine delivery, and geo common ([#7309](https://github.com/googleapis/google-cloud-php/issues/7309)) ([749fc97](https://github.com/googleapis/google-cloud-php/commit/749fc97dce4aaeee3ed0358ec0400aa1087f7d10)) + +
+ +
google/cloud-gke-multi-cloud 0.6.0 + + + +### Features + +* Option to ignore_errors while deleting Azure clusters / nodepools ([#7304](https://github.com/googleapis/google-cloud-php/issues/7304)) ([401a5b5](https://github.com/googleapis/google-cloud-php/commit/401a5b5bb8e8569248d87907fe1f4317dd187035)) + +
+ +
google/cloud-kms 1.22.0 + + + +### Features + +* Add client library for KMS Autokey service, which enables automated KMS key provision and management ([#7290](https://github.com/googleapis/google-cloud-php/issues/7290)) ([3c0f6e6](https://github.com/googleapis/google-cloud-php/commit/3c0f6e66f4b005817fa7760244dec6fb2063cd2f)) + +
+ +
google/maps-fleetengine 0.1.0 + + + +### Features + +* Add fleetengine, fleetengine delivery, and geo common ([#7309](https://github.com/googleapis/google-cloud-php/issues/7309)) ([749fc97](https://github.com/googleapis/google-cloud-php/commit/749fc97dce4aaeee3ed0358ec0400aa1087f7d10)) + +
+ +
google/maps-fleetengine-delivery 0.1.0 + + + +### Features + +* Add fleetengine, fleetengine delivery, and geo common ([#7309](https://github.com/googleapis/google-cloud-php/issues/7309)) ([749fc97](https://github.com/googleapis/google-cloud-php/commit/749fc97dce4aaeee3ed0358ec0400aa1087f7d10)) + +
+ +
google/cloud-netapp 0.3.0 + + + +### Features + +* Add a new Service Level FLEX ([#7318](https://github.com/googleapis/google-cloud-php/issues/7318)) ([5241ec9](https://github.com/googleapis/google-cloud-php/commit/5241ec9ad1eacfb5b472ce56087cc552de238ded)) +* Add backup chain bytes to BackupConfig in Volume ([5241ec9](https://github.com/googleapis/google-cloud-php/commit/5241ec9ad1eacfb5b472ce56087cc552de238ded)) +* Add Location metadata support ([5241ec9](https://github.com/googleapis/google-cloud-php/commit/5241ec9ad1eacfb5b472ce56087cc552de238ded)) +* Add Tiering Policy to Volume ([5241ec9](https://github.com/googleapis/google-cloud-php/commit/5241ec9ad1eacfb5b472ce56087cc552de238ded)) + +
+ +
google/cloud-parallelstore 0.3.0 + + + +### âš  BREAKING CHANGES + +* An existing field `end_time` is removed from message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` +* An existing field `source` is removed from message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` +* An existing field `destination` is removed from message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` +* An existing field `create_time` is removed from message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` ([#7314](https://github.com/googleapis/google-cloud-php/issues/7314)) +* An existing field `destination_path` is renamed to `destination_parallelstore` in message `.google.cloud.parallelstore.v1beta.ImportDataRequest` +* An existing field `source_path` is renamed to `source_parallelstore` in message `.google.cloud.parallelstore.v1beta.ExportDataRequest` +* An existing field `destination_gcs_uri` is renamed to `destination_gcs_bucket` in message `.google.cloud.parallelstore.v1beta.ExportDataRequest` +* An existing field `source_gcs_uri` is renamed to `source_gcs_bucket` in message `.google.cloud.parallelstore.v1beta.ImportDataRequest` ([#7302](https://github.com/googleapis/google-cloud-php/issues/7302)) + +### Features + +* A new field `api_version` is added to message `.google.cloud.parallelstore.v1beta.ExportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `api_version` is added to message `.google.cloud.parallelstore.v1beta.ImportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `create_time` is added to message `.google.cloud.parallelstore.v1beta.ExportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `create_time` is added to message `.google.cloud.parallelstore.v1beta.ImportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `destination_gcs_bucket` is added to message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `destination_parallelstore` is added to message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `end_time` is added to message `.google.cloud.parallelstore.v1beta.ExportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `end_time` is added to message `.google.cloud.parallelstore.v1beta.ImportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `requested_cancellation` is added to message `.google.cloud.parallelstore.v1beta.ExportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `requested_cancellation` is added to message `.google.cloud.parallelstore.v1beta.ImportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `source_gcs_bucket` is added to message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `source_parallelstore` is added to message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `status_message` is added to message `.google.cloud.parallelstore.v1beta.ExportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `status_message` is added to message `.google.cloud.parallelstore.v1beta.ImportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `target` is added to message `.google.cloud.parallelstore.v1beta.ExportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `target` is added to message `.google.cloud.parallelstore.v1beta.ImportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `verb` is added to message `.google.cloud.parallelstore.v1beta.ExportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new field `verb` is added to message `.google.cloud.parallelstore.v1beta.ImportDataMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A new message `DestinationGcsBucket` is added ([0f600d2](https://github.com/googleapis/google-cloud-php/commit/0f600d27c9331d40a463b971b2fea8f26e14f56e)) +* A new message `DestinationParallelstore` is added ([0f600d2](https://github.com/googleapis/google-cloud-php/commit/0f600d27c9331d40a463b971b2fea8f26e14f56e)) +* A new message `SourceGcsBucket` is added ([0f600d2](https://github.com/googleapis/google-cloud-php/commit/0f600d27c9331d40a463b971b2fea8f26e14f56e)) +* A new message `SourceParallelstore` is added ([0f600d2](https://github.com/googleapis/google-cloud-php/commit/0f600d27c9331d40a463b971b2fea8f26e14f56e)) + + +### Bug Fixes + +* An existing field `create_time` is removed from message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` ([#7314](https://github.com/googleapis/google-cloud-php/issues/7314)) ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* An existing field `destination_gcs_uri` is renamed to `destination_gcs_bucket` in message `.google.cloud.parallelstore.v1beta.ExportDataRequest` ([0f600d2](https://github.com/googleapis/google-cloud-php/commit/0f600d27c9331d40a463b971b2fea8f26e14f56e)) +* An existing field `destination_path` is renamed to `destination_parallelstore` in message `.google.cloud.parallelstore.v1beta.ImportDataRequest` ([0f600d2](https://github.com/googleapis/google-cloud-php/commit/0f600d27c9331d40a463b971b2fea8f26e14f56e)) +* An existing field `destination` is removed from message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* An existing field `end_time` is removed from message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* An existing field `source_gcs_uri` is renamed to `source_gcs_bucket` in message `.google.cloud.parallelstore.v1beta.ImportDataRequest` ([#7302](https://github.com/googleapis/google-cloud-php/issues/7302)) ([0f600d2](https://github.com/googleapis/google-cloud-php/commit/0f600d27c9331d40a463b971b2fea8f26e14f56e)) +* An existing field `source_path` is renamed to `source_parallelstore` in message `.google.cloud.parallelstore.v1beta.ExportDataRequest` ([0f600d2](https://github.com/googleapis/google-cloud-php/commit/0f600d27c9331d40a463b971b2fea8f26e14f56e)) +* An existing field `source` is removed from message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) + + +### Documentation + +* A comment for field `counters` in message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` is changed ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) +* A comment for field `transfer_type` in message `.google.cloud.parallelstore.v1beta.TransferOperationMetadata` is changed ([2c7a6b5](https://github.com/googleapis/google-cloud-php/commit/2c7a6b52c5cd5b56b9843ab3776cc88639c2df1e)) + +
+ +
google/cloud-service-directory 1.3.5 + + + +### Documentation + +* Add maximum page_size to ListEndpoint API documentation ([de11deb](https://github.com/googleapis/google-cloud-php/commit/de11deb965acbebffe8660a60fd146d0dae74543)) +* Add maximum page_size to ListNamespace API documentation ([#7316](https://github.com/googleapis/google-cloud-php/issues/7316)) ([de11deb](https://github.com/googleapis/google-cloud-php/commit/de11deb965acbebffe8660a60fd146d0dae74543)) +* Add maximum page_size to ListService API documentation ([de11deb](https://github.com/googleapis/google-cloud-php/commit/de11deb965acbebffe8660a60fd146d0dae74543)) + +
+ +
google/shopping-css 0.2.6 + + + +### Bug Fixes + +* **deps:** Update dependency google/shopping-common-protos to ^0.4.0 ([#7287](https://github.com/googleapis/google-cloud-php/issues/7287)) ([9b1f2b9](https://github.com/googleapis/google-cloud-php/commit/9b1f2b9839604eae79bcf54b1088ed61d0942434)) + +
+ +
google/shopping-merchant-inventories 0.4.3 + + + +### Bug Fixes + +* **deps:** Update dependency google/shopping-common-protos to ^0.4.0 ([#7287](https://github.com/googleapis/google-cloud-php/issues/7287)) ([9b1f2b9](https://github.com/googleapis/google-cloud-php/commit/9b1f2b9839604eae79bcf54b1088ed61d0942434)) + +
+ +
google/shopping-merchant-reports 0.7.3 + + + +### Bug Fixes + +* **deps:** Update dependency google/shopping-common-protos to ^0.4.0 ([#7287](https://github.com/googleapis/google-cloud-php/issues/7287)) ([9b1f2b9](https://github.com/googleapis/google-cloud-php/commit/9b1f2b9839604eae79bcf54b1088ed61d0942434)) + +
+ +
google/cloud-spanner 1.77.0 + + + +### Features + +* Add support for multi region encryption config ([#7285](https://github.com/googleapis/google-cloud-php/issues/7285)) ([9ee6613](https://github.com/googleapis/google-cloud-php/commit/9ee6613a3384590043ddf8b7cdde25514ed11b65)) + + +### Documentation + +* Fix linting for several doc comments ([9ee6613](https://github.com/googleapis/google-cloud-php/commit/9ee6613a3384590043ddf8b7cdde25514ed11b65)) + +
+ +
google/cloud-storage 1.42.0 + + + +### Features + +* **Storage:** Enable hierarchical namespace ([#7292](https://github.com/googleapis/google-cloud-php/issues/7292)) ([c6f645f](https://github.com/googleapis/google-cloud-php/commit/c6f645f3c6171fb385d996eda68ef909943e8a99)) +* **Storage:** Update Service Definition to enable hierarchical namespace ([#7291](https://github.com/googleapis/google-cloud-php/issues/7291)) ([9ad2e3d](https://github.com/googleapis/google-cloud-php/commit/9ad2e3d7fd8358ef7f9d8ca9c6c4db68dbcadb78)) + +
+ +
google/cloud-storage-control 0.2.0 + + + +### Features + +* A new resource pattern value `projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}` added to the resource definition `storage.googleapis.com/ManagedFolder` ([5cd68b2](https://github.com/googleapis/google-cloud-php/commit/5cd68b2cdec40101a2654511d8958ee1339b8507)) + + +### Bug Fixes + +* An existing resource pattern value `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder=**}` to resource definition `storage.googleapis.com/ManagedFolder` is removed ([#7286](https://github.com/googleapis/google-cloud-php/issues/7286)) ([5cd68b2](https://github.com/googleapis/google-cloud-php/commit/5cd68b2cdec40101a2654511d8958ee1339b8507)) + +
+ +## 0.244.0 + +
google/cloud-access-approval 1.2.4 + + + +
+ +
google/access-context-manager 0.5.4 + + + +
+ +
google/cloud-advisorynotifications 0.8.2 + + + +
+ +
google/cloud-ai-platform 0.38.0 + + + +### Features + +* A new field `deploy_task_name` is added to message `.google.cloud.aiplatform.v1.PublisherModel` ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A new field `private_service_connect_config` is added to message `.google.cloud.aiplatform.v1.Endpoint` ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A new field `search_entry_point` is added to message `.google.cloud.aiplatform.v1.GroundingMetadata` ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A new message `SearchEntryPoint` is added ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A new value `INVALID_TOKEN_VALUE` is added to enum `RecordErrorType` ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A new value `TPU_V5_LITEPOD` is added to enum `AcceleratorType` ([#7275](https://github.com/googleapis/google-cloud-php/issues/7275)) ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) + + +### Documentation + +* A comment for field `base_model` in message `.google.cloud.aiplatform.v1.TuningJob` is changed ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A comment for field `epoch_count` in message `.google.cloud.aiplatform.v1.SupervisedHyperParameters` is changed ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A comment for field `learning_rate_multiplier` in message `.google.cloud.aiplatform.v1.SupervisedHyperParameters` is changed ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A comment for field `name` in message `.google.cloud.aiplatform.v1.NotebookRuntimeTemplate` is changed ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A comment for field `parent` in message `.google.cloud.aiplatform.v1.CreateFeatureGroupRequest` is changed ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A comment for field `training_dataset_uri` in message `.google.cloud.aiplatform.v1.SupervisedTuningSpec` is changed ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A comment for field `tuned_model_display_name` in message `.google.cloud.aiplatform.v1.TuningJob` is changed ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) +* A comment for field `validation_dataset_uri` in message `.google.cloud.aiplatform.v1.SupervisedTuningSpec` is changed ([63ace28](https://github.com/googleapis/google-cloud-php/commit/63ace28b2b1e86203c6ca376c0467ffa5ac975cd)) + +
+ +
google/cloud-alloydb 0.10.2 + + + +
+ +
google/analytics-admin 0.22.4 + + + +
+ +
google/analytics-data 0.16.4 + + + +
+ +
google/cloud-api-gateway 1.3.4 + + + +
+ +
google/cloud-api-keys 0.4.4 + + + +
+ +
google/cloud-apigee-connect 1.2.4 + + + +
+ +
google/cloud-apigee-registry 0.5.4 + + + +
+ +
google/cloud-appengine-admin 1.3.4 + + + +
+ +
google/cloud-apphub 0.1.2 + + + +
+ +
google/apps-chat 0.1.1 + + + +
+ +
google/apps-events-subscriptions 0.1.2 + + + +
+ +
google/apps-meet 0.2.2 + + + +
+ +
google/cloud-artifact-registry 0.6.4 + + + +
+ +
google/cloud-asset 1.16.2 + + + +
+ +
google/cloud-assured-workloads 0.11.4 + + + +
+ +
google/cloud-automl 1.6.4 + + + +
+ +
google/cloud-bare-metal-solution 0.6.4 + + + +
+ +
google/cloud-batch 0.16.7 + + + +### Documentation + +* Update description on allowed_locations in LocationPolicy field ([#7270](https://github.com/googleapis/google-cloud-php/issues/7270)) ([f7c3fd6](https://github.com/googleapis/google-cloud-php/commit/f7c3fd6dac581b5a91f54d2e66fcbc5c8bef5812)) + +
+ +
google/cloud-beyondcorp-appconnections 0.4.4 + + + +
+ +
google/cloud-beyondcorp-appconnectors 0.4.4 + + + +
+ +
google/cloud-beyondcorp-appgateways 0.4.4 + + + +
+ +
google/cloud-beyondcorp-clientconnectorservices 0.4.4 + + + +
+ +
google/cloud-beyondcorp-clientgateways 0.4.4 + + + +
+ +
google/cloud-bigquery 1.30.2 + + + +
+ +
google/cloud-bigquery-analyticshub 0.5.2 + + + +
+ +
google/cloud-bigquery-connection 1.5.4 + + + +
+ +
google/cloud-bigquery-data-exchange 0.4.4 + + + +
+ +
google/cloud-bigquery-datapolicies 0.5.4 + + + +
+ +
google/cloud-bigquerydatatransfer 1.8.4 + + + +
+ +
google/cloud-bigquery-migration 0.4.4 + + + +
+ +
google/cloud-bigquery-reservation 1.3.4 + + + +
+ +
google/cloud-bigquery-storage 1.10.3 + + + +
+ +
google/cloud-bigtable 1.31.1 + + + +
+ +
google/cloud-billing 1.9.6 + + + +
+ +
google/cloud-billing-budgets 1.4.4 + + + +
+ +
google/cloud-binary-authorization 0.8.6 + + + +
+ +
google/cloud-build 0.16.2 + + + +
+ +
google/cloud-certificate-manager 0.7.2 + + + +
+ +
google/cloud-channel 1.9.4 + + + +
+ +
google/cloud-commerce-consumer-procurement 0.2.4 + + + +
+ +
google/cloud-common-protos 0.5.2 + + + +
+ +
google/cloud-compute 1.17.0 + + + +### Features + +* Update Compute Engine API to revision 20240421 ([#899](https://github.com/googleapis/google-cloud-php/issues/899)) ([#7268](https://github.com/googleapis/google-cloud-php/issues/7268)) ([1841c79](https://github.com/googleapis/google-cloud-php/commit/1841c79f63399cc8270b8c77f65a36d754801db1)) + +
+ +
google/cloud-confidentialcomputing 0.8.2 + + + +
+ +
google/cloud-config 0.5.1 + + + +
+ +
google/cloud-contact-center-insights 1.9.4 + + + +
+ +
google/cloud-container 1.30.2 + + + +
+ +
google/cloud-container-analysis 0.5.6 + + + +
+ +
google/cloud-cloudcontrolspartner 0.1.2 + + + +
+ +
google/cloud-core 1.58.1 + + + +
+ +
google/cloud-data-catalog 1.10.2 + + + +
+ +
google/cloud-datacatalog-lineage 0.5.4 + + + +
+ +
google/cloud-data-fusion 0.6.4 + + + +
+ +
google/cloud-datalabeling 0.5.4 + + + +
+ +
google/cloud-dataflow 0.6.3 + + + +
+ +
google/cloud-dataform 0.4.4 + + + +
+ +
google/cloud-dataplex 0.16.0 + + + +### âš  BREAKING CHANGES + +* An existing field `entry` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` +* An existing field `display_name` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` +* An existing field `entry_type` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` +* An existing field `modify_time` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` +* An existing field `fully_qualified_name` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` +* An existing field `description` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` +* An existing field `relative_resource` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` + +### Features + +* Updated client libraries for Dataplex Catalog: removed deprecated fields, updated comments ([#7282](https://github.com/googleapis/google-cloud-php/issues/7282)) ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) + + +### Bug Fixes + +* An existing field `description` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) +* An existing field `display_name` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) +* An existing field `entry_type` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) +* An existing field `entry` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) +* An existing field `fully_qualified_name` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) +* An existing field `modify_time` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) +* An existing field `relative_resource` is removed from message `.google.cloud.dataplex.v1.SearchEntriesResult` ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) + + +### Documentation + +* A comment for field `aspects` in message `.google.cloud.dataplex.v1.Entry` is changed ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) +* A comment for field `filter` in message `.google.cloud.dataplex.v1.ListEntriesRequest` is changed ([9bd3610](https://github.com/googleapis/google-cloud-php/commit/9bd36100a76d7d3f0d187e14ad4b2ccc25d3b459)) + +
+ +
google/cloud-dataproc 3.13.3 + + + +
+ +
google/cloud-dataproc-metastore 0.11.4 + + + +
+ +
google/cloud-datastore 1.28.2 + + + +
+ +
google/cloud-datastore-admin 0.8.4 + + + +
+ +
google/cloud-datastream 1.5.4 + + + +
+ +
google/cloud-debugger 1.8.6 + + + +
+ +
google/cloud-deploy 0.18.1 + + + +### Documentation + +* Small corrections to Cloud Deploy API documentation ([#7278](https://github.com/googleapis/google-cloud-php/issues/7278)) ([1c9455b](https://github.com/googleapis/google-cloud-php/commit/1c9455b413e25660122fceab2da35d3bf9b50483)) + +
+ +
google/cloud-dialogflow 1.12.2 + + + +
+ +
google/cloud-dialogflow-cx 0.3.3 + + + +
+ +
google/cloud-discoveryengine 0.11.2 + + + +
+ +
google/cloud-dlp 1.13.2 + + + +
+ +
google/cloud-dms 1.5.4 + + + +
+ +
google/cloud-document-ai 1.12.1 + + + +
+ +
google/cloud-domains 0.5.4 + + + +
+ +
google/cloud-edgenetwork 0.3.5 + + + +
+ +
google/cloud-error-reporting 0.22.5 + + + +
+ +
google/cloud-essential-contacts 0.4.4 + + + +
+ +
google/cloud-eventarc 1.3.4 + + + +
+ +
google/cloud-eventarc-publishing 0.6.3 + + + +
+ +
google/cloud-filestore 1.5.6 + + + +
+ +
google/cloud-firestore 1.43.2 + + + +
+ +
google/cloud-functions 1.6.4 + + + +
+ +
google/cloud-gsuite-addons 0.3.4 + + + +
+ +
google/cloud-game-servers 1.2.5 + + + +
+ +
google/cloud-gke-backup 0.7.2 + + + +
+ +
google/cloud-gke-connect-gateway 0.4.3 + + + +
+ +
google/cloud-gke-hub 0.9.4 + + + +
+ +
google/cloud-gke-multi-cloud 0.5.4 + + + +
+ +
google/grafeas 0.10.2 + + + +
+ +
google/cloud-iam 0.5.4 + + + +
+ +
google/cloud-iam-credentials 1.2.4 + + + +
+ +
google/cloud-iap 1.4.4 + + + +
+ +
google/cloud-ids 0.5.4 + + + +
+ +
google/cloud-iot 1.7.4 + + + +
+ +
google/cloud-kms 1.21.4 + + + +
+ +
google/cloud-kms-inventory 0.4.4 + + + +
+ +
google/cloud-language 0.32.5 + + + +
+ +
google/cloud-life-sciences 0.6.4 + + + +
+ +
google/cloud-logging 1.30.1 + + + +
+ +
google/longrunning 0.4.2 + + + +
+ +
google/cloud-managed-identities 1.3.4 + + + +
+ +
google/cloud-media-translation 0.4.3 + + + +
+ +
google/cloud-memcache 1.3.4 + + + +
+ +
google/cloud-migrationcenter 0.4.4 + + + +
+ +
google/cloud-monitoring 1.10.2 + + + +
+ +
google/cloud-netapp 0.2.6 + + + +
+ +
google/cloud-network-connectivity 1.5.4 + + + +
+ +
google/cloud-network-management 1.7.2 + + + +
+ +
google/cloud-network-security 0.6.4 + + + +
+ +
google/cloud-notebooks 0.7.4 + + + +
+ +
google/cloud-optimization 0.6.4 + + + +
+ +
google/cloud-orchestration-airflow 1.6.3 + + + +
+ +
google/cloud-org-policy 0.6.4 + + + +
+ +
google/cloud-osconfig 1.3.4 + + + +
+ +
google/cloud-oslogin 1.9.4 + + + +
+ +
google/cloud-parallelstore 0.2.0 + + + +### Features + +* **parallelstore/v1beta:** Add ImportData and ExportData RPCs ([#7267](https://github.com/googleapis/google-cloud-php/issues/7267)) ([6c54a89](https://github.com/googleapis/google-cloud-php/commit/6c54a89e5107311b8c375c8699dee92f95fae09d)) + + +### Documentation + +* Fix typo in Instance.reserved_ip_range field doc ([6c54a89](https://github.com/googleapis/google-cloud-php/commit/6c54a89e5107311b8c375c8699dee92f95fae09d)) + +
+ +
google/cloud-policysimulator 0.2.4 + + + +
+ +
google/cloud-policy-troubleshooter 1.3.3 + + + +
+ +
google/cloud-policytroubleshooter-iam 0.2.4 + + + +
+ +
google/cloud-private-catalog 0.4.3 + + + +
+ +
google/cloud-profiler 1.4.2 + + + +
+ +
google/cloud-pubsub 2.1.2 + + + +
+ +
google/cloud-quotas 0.2.2 + + + +
+ +
google/cloud-rapidmigrationassessment 0.3.4 + + + +
+ +
google/cloud-recaptcha-enterprise 1.12.1 + + + +
+ +
google/cloud-recommendations-ai 0.7.4 + + + +
+ +
google/cloud-recommender 1.11.4 + + + +
+ +
google/cloud-redis 1.9.4 + + + +
+ +
google/cloud-redis-cluster 0.2.4 + + + +
+ +
google/cloud-resource-manager 0.8.4 + + + +
+ +
google/cloud-resource-settings 1.2.4 + + + +
+ +
google/cloud-retail 1.6.3 + + + +
+ +
google/cloud-run 0.9.2 + + + +
+ +
google/cloud-scheduler 1.10.4 + + + +
+ +
google/cloud-secret-manager 1.15.1 + + + +
+ +
google/cloud-securesourcemanager 0.2.4 + + + +
+ +
google/cloud-security-center 1.28.1 + + + +
+ +
google/cloud-securitycentermanagement 0.2.7 + + + +
+ +
google/cloud-security-private-ca 1.7.2 + + + +
+ +
google/cloud-security-public-ca 0.3.4 + + + +
+ +
google/cloud-service-control 1.4.3 + + + +
+ +
google/cloud-service-directory 1.3.4 + + + +
+ +
google/cloud-servicehealth 0.1.5 + + + +
+ +
google/cloud-service-management 1.3.4 + + + +
+ +
google/cloud-service-usage 1.3.3 + + + +
+ +
google/cloud-shell 1.3.4 + + + +
+ +
google/shopping-common-protos 0.4.0 + + + +### Features + +* Add `Weight` to common types for Shopping APIs to be used for accounts bundle ([#7266](https://github.com/googleapis/google-cloud-php/issues/7266)) ([45225ba](https://github.com/googleapis/google-cloud-php/commit/45225ba9261d735d8d8f271d0ae07e79afee845d)) + + +### Documentation + +* A comment for field `amount_micros` in message `.google.shopping.type.Price` is changed ([45225ba](https://github.com/googleapis/google-cloud-php/commit/45225ba9261d735d8d8f271d0ae07e79afee845d)) + +
+ +
google/shopping-css 0.2.5 + + + +
+ +
google/shopping-merchant-conversions 0.1.0 + + + +### Features + +* Introduce ShoppingMerchantConversions ([#7269](https://github.com/googleapis/google-cloud-php/issues/7269)) ([4a435ea](https://github.com/googleapis/google-cloud-php/commit/4a435ea14eef0314511ff03ba26ae21139f6da1a)) + +
+ +
google/shopping-merchant-inventories 0.4.2 + + + +
+ +
google/shopping-merchant-quota 0.1.2 + + + +
+ +
google/shopping-merchant-reports 0.7.2 + + + +
+ +
google/cloud-spanner 1.76.1 + + + +### Bug Fixes + +* **Spanner:** Cast fields in the ResultStats object back to int ([#7284](https://github.com/googleapis/google-cloud-php/issues/7284)) ([e71ee22](https://github.com/googleapis/google-cloud-php/commit/e71ee2264e02cb98ecd0d10d1aa58b691bd15c81)) + +
+ +
google/cloud-speech 1.18.2 + + + +
+ +
google/cloud-sql-admin 0.17.0 + + + +### Features + +* BackupConfiguration resource now includes transactional log storage location ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* DatabaseInstance resource now includes disaster recovery replica information and Gemini configuration ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* Databsae instance settings now includes a flag to enable Vertex AI integration ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* ImportContext now includes options for importing data from SQL statements ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* Operation resource now includes context for acquire SSRS lease operations ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* Support for additional error types in external sync settings ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* Support for additional SQL operations related to SSRS leases and old primary reconfiguration ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* Support for migration type and PostgreSQL parallel level in the VerifyExternalSyncSettings call ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* Support for setting the migration type when starting an external sync ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* Support for several newer releases of MySQL 8.0 ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) +* Support for the AcquireSsrsLease and ReleaseSsrsLease RPCs ([#7273](https://github.com/googleapis/google-cloud-php/issues/7273)) ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) + + +### Documentation + +* Note that `ssl_mode` is now used by all databases including SQL Server ([e48698d](https://github.com/googleapis/google-cloud-php/commit/e48698dd2626b37f55be4ef674636326754a980c)) + +
+ +
google/cloud-storage 1.41.4 + + + +
+ +
google/cloud-storage-control 0.1.1 + + + +
+ +
google/cloud-storageinsights 0.3.4 + + + +
+ +
google/cloud-storage-transfer 1.4.4 + + + +
+ +
google/cloud-support 0.2.4 + + + +
+ +
google/cloud-talent 1.3.4 + + + +
+ +
google/cloud-tasks 1.14.5 + + + +
+ +
google/cloud-telcoautomation 0.2.4 + + + +
+ +
google/cloud-text-to-speech 1.8.4 + + + +
+ +
google/cloud-tpu 1.4.4 + + + +
+ +
google/cloud-trace 1.8.5 + + + +
+ +
google/cloud-translate 1.17.6 + + + +
+ +
google/cloud-videointelligence 1.15.4 + + + +
+ +
google/cloud-video-live-stream 0.7.4 + + + +
+ +
google/cloud-video-stitcher 0.8.4 + + + +
+ +
google/cloud-video-transcoder 0.10.4 + + + +
+ +
google/cloud-vision 1.9.3 + + + +
+ +
google/cloud-vm-migration 0.6.4 + + + +
+ +
google/cloud-vmware-engine 0.5.5 + + + +
+ +
google/cloud-vpc-access 1.3.4 + + + +
+ +
google/cloud-web-risk 1.5.4 + + + +
+ +
google/cloud-web-security-scanner 0.8.4 + + + +
+ +
google/cloud-workflows 0.5.4 + + + +
+ ## 0.243.0
google/cloud-compute 1.16.2 diff --git a/CertificateManager/.repo-metadata.json b/CertificateManager/.repo-metadata.json deleted file mode 100644 index 9aec0a7b61b4..000000000000 --- a/CertificateManager/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-certificate-manager", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-certificate-manager/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "certificatemanager" -} diff --git a/CertificateManager/VERSION b/CertificateManager/VERSION index 39e898a4f952..f38fc5393ff6 100644 --- a/CertificateManager/VERSION +++ b/CertificateManager/VERSION @@ -1 +1 @@ -0.7.1 +0.7.3 diff --git a/CertificateManager/composer.json b/CertificateManager/composer.json index fea87043d30b..cb5467c4abac 100644 --- a/CertificateManager/composer.json +++ b/CertificateManager/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Channel/.repo-metadata.json b/Channel/.repo-metadata.json deleted file mode 100644 index ef0ee1643472..000000000000 --- a/Channel/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-channel", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-channel/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudchannel" -} diff --git a/Channel/VERSION b/Channel/VERSION index 77fee73a8cf9..158c74729336 100644 --- a/Channel/VERSION +++ b/Channel/VERSION @@ -1 +1 @@ -1.9.3 +1.9.5 diff --git a/Channel/composer.json b/Channel/composer.json index c4e1c07f8bd7..351ba5809120 100644 --- a/Channel/composer.json +++ b/Channel/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/common-protos": "^3.2||^4.0" }, "require-dev": { diff --git a/CommerceConsumerProcurement/.repo-metadata.json b/CommerceConsumerProcurement/.repo-metadata.json deleted file mode 100644 index 422db80fb92d..000000000000 --- a/CommerceConsumerProcurement/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-commerce-consumer-procurement", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-commerce-consumer-procurement/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudcommerceconsumerprocurement" -} diff --git a/CommerceConsumerProcurement/VERSION b/CommerceConsumerProcurement/VERSION index 7179039691ce..3a4036fb450f 100644 --- a/CommerceConsumerProcurement/VERSION +++ b/CommerceConsumerProcurement/VERSION @@ -1 +1 @@ -0.2.3 +0.2.5 diff --git a/CommerceConsumerProcurement/composer.json b/CommerceConsumerProcurement/composer.json index 2e5f04bd428f..9561e1743764 100644 --- a/CommerceConsumerProcurement/composer.json +++ b/CommerceConsumerProcurement/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/CommerceConsumerProcurement/src/V1/Client/ConsumerProcurementServiceClient.php b/CommerceConsumerProcurement/src/V1/Client/ConsumerProcurementServiceClient.php index 0d87495237ad..2f4a7bcd0694 100644 --- a/CommerceConsumerProcurement/src/V1/Client/ConsumerProcurementServiceClient.php +++ b/CommerceConsumerProcurement/src/V1/Client/ConsumerProcurementServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -39,6 +38,7 @@ use Google\Cloud\Commerce\Consumer\Procurement\V1\ListOrdersRequest; use Google\Cloud\Commerce\Consumer\Procurement\V1\Order; use Google\Cloud\Commerce\Consumer\Procurement\V1\PlaceOrderRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -146,6 +146,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * billing_account resource. diff --git a/CommerceConsumerProcurement/tests/Unit/V1/Client/ConsumerProcurementServiceClientTest.php b/CommerceConsumerProcurement/tests/Unit/V1/Client/ConsumerProcurementServiceClientTest.php index f9e8abec2b4e..4ef5135d492f 100644 --- a/CommerceConsumerProcurement/tests/Unit/V1/Client/ConsumerProcurementServiceClientTest.php +++ b/CommerceConsumerProcurement/tests/Unit/V1/Client/ConsumerProcurementServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Commerce\Consumer\Procurement\V1\Client\ConsumerProcurementServiceClient; @@ -33,6 +32,7 @@ use Google\Cloud\Commerce\Consumer\Procurement\V1\ListOrdersResponse; use Google\Cloud\Commerce\Consumer\Procurement\V1\Order; use Google\Cloud\Commerce\Consumer\Procurement\V1\PlaceOrderRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/CommonProtos/.repo-metadata.json b/CommonProtos/.repo-metadata.json deleted file mode 100644 index 27347d016dc9..000000000000 --- a/CommonProtos/.repo-metadata.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-common-protos", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-common-protos/latest", - "library_type": "CORE" -} diff --git a/CommonProtos/VERSION b/CommonProtos/VERSION index 4b9fcbec101a..cb0c939a936f 100644 --- a/CommonProtos/VERSION +++ b/CommonProtos/VERSION @@ -1 +1 @@ -0.5.1 +0.5.2 diff --git a/Compute/.repo-metadata.json b/Compute/.repo-metadata.json deleted file mode 100644 index e0bf60be695d..000000000000 --- a/Compute/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-compute", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-compute/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "compute" -} diff --git a/Compute/VERSION b/Compute/VERSION index 4a02d2c3170b..ec6d649be650 100644 --- a/Compute/VERSION +++ b/Compute/VERSION @@ -1 +1 @@ -1.16.2 +1.18.1 diff --git a/Compute/composer.json b/Compute/composer.json index f19c3c4d0e9f..5fb726dd4aaf 100644 --- a/Compute/composer.json +++ b/Compute/composer.json @@ -5,7 +5,7 @@ "minimum-stability": "stable", "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Compute/metadata/V1/Compute.php b/Compute/metadata/V1/Compute.php index b68815909706962ca230c559e36e95eebe21fcb1..b0aa8f042ee2cda06ea4797f5d36e7f341013519 100644 GIT binary patch delta 145 zcmcb4MPtKNjSafYOy^H+)@NSzmGRl;TR+rUm=3c{cR0o*Jz4Ir1G5U3>}18iqP+2r z#__(c?v4VNJ1%-P$Np`P{mTf%Oxt7sGRMtid^Ua0G?sM6tJ_tkvt$Yj>2bxVhdBm$ uIy(8d#(M^YnZ-}vx0FSSW#P9uw(UKuSb&%nh}nRc9f&!$_pIVPTMqy)Z9BjK delta 94 zcmdmRRpaIrjSafYOg~R<)@NSzmGQvlTR+rUnC7xfU-+9*da~SKhvt^Q?Ja*9ftYD~ u%U|Z$nT*?}Kbppp&bV~D*L0Rl;r1u1Sb&%nh}nRc9f&!$KUu|jrXB!=eJ)b~ diff --git a/Compute/src/V1/AccessConfig.php b/Compute/src/V1/AccessConfig.php index f533645730be..6b7446e80b9c 100644 --- a/Compute/src/V1/AccessConfig.php +++ b/Compute/src/V1/AccessConfig.php @@ -53,7 +53,7 @@ class AccessConfig extends \Google\Protobuf\Internal\Message */ private $network_tier = null; /** - * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range. + * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be created for first IP in associated external IPv6 range. * * Generated from protobuf field optional string public_ptr_domain_name = 316599167; */ @@ -98,7 +98,7 @@ class AccessConfig extends \Google\Protobuf\Internal\Message * This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. * Check the NetworkTier enum for the list of possible values. * @type string $public_ptr_domain_name - * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range. + * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be created for first IP in associated external IPv6 range. * @type string $security_policy * [Output Only] The resource URL for the security policy associated with this access config. * @type bool $set_public_ptr @@ -332,7 +332,7 @@ public function setNetworkTier($var) } /** - * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range. + * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be created for first IP in associated external IPv6 range. * * Generated from protobuf field optional string public_ptr_domain_name = 316599167; * @return string @@ -353,7 +353,7 @@ public function clearPublicPtrDomainName() } /** - * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range. + * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be created for first IP in associated external IPv6 range. * * Generated from protobuf field optional string public_ptr_domain_name = 316599167; * @param string $var diff --git a/Compute/src/V1/Client/AddressesClient.php b/Compute/src/V1/Client/AddressesClient.php index 4c13d632b254..f3b0d61a8a78 100644 --- a/Compute/src/V1/Client/AddressesClient.php +++ b/Compute/src/V1/Client/AddressesClient.php @@ -149,6 +149,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/AutoscalersClient.php b/Compute/src/V1/Client/AutoscalersClient.php index 6e2fb6238518..afdd473b7bc0 100644 --- a/Compute/src/V1/Client/AutoscalersClient.php +++ b/Compute/src/V1/Client/AutoscalersClient.php @@ -149,6 +149,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/BackendBucketsClient.php b/Compute/src/V1/Client/BackendBucketsClient.php index b11c594acbc4..9c3841a880be 100644 --- a/Compute/src/V1/Client/BackendBucketsClient.php +++ b/Compute/src/V1/Client/BackendBucketsClient.php @@ -160,6 +160,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/BackendServicesClient.php b/Compute/src/V1/Client/BackendServicesClient.php index 9c308b500c61..98fa41276321 100644 --- a/Compute/src/V1/Client/BackendServicesClient.php +++ b/Compute/src/V1/Client/BackendServicesClient.php @@ -169,6 +169,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/DisksClient.php b/Compute/src/V1/Client/DisksClient.php index fa9e7d1bff02..079515d22a10 100644 --- a/Compute/src/V1/Client/DisksClient.php +++ b/Compute/src/V1/Client/DisksClient.php @@ -173,6 +173,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/ExternalVpnGatewaysClient.php b/Compute/src/V1/Client/ExternalVpnGatewaysClient.php index a78dea2ffce5..f018d02312fe 100644 --- a/Compute/src/V1/Client/ExternalVpnGatewaysClient.php +++ b/Compute/src/V1/Client/ExternalVpnGatewaysClient.php @@ -147,6 +147,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/FirewallPoliciesClient.php b/Compute/src/V1/Client/FirewallPoliciesClient.php index 15538477a9de..3b2181313b2f 100644 --- a/Compute/src/V1/Client/FirewallPoliciesClient.php +++ b/Compute/src/V1/Client/FirewallPoliciesClient.php @@ -174,6 +174,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ]; } diff --git a/Compute/src/V1/Client/FirewallsClient.php b/Compute/src/V1/Client/FirewallsClient.php index e9bd6402834f..7aa437492d68 100644 --- a/Compute/src/V1/Client/FirewallsClient.php +++ b/Compute/src/V1/Client/FirewallsClient.php @@ -146,6 +146,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/ForwardingRulesClient.php b/Compute/src/V1/Client/ForwardingRulesClient.php index 0a57dc9da2c5..8a8eee0ab094 100644 --- a/Compute/src/V1/Client/ForwardingRulesClient.php +++ b/Compute/src/V1/Client/ForwardingRulesClient.php @@ -151,6 +151,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/GlobalAddressesClient.php b/Compute/src/V1/Client/GlobalAddressesClient.php index f320067e3e6c..5d82e1b1ded7 100644 --- a/Compute/src/V1/Client/GlobalAddressesClient.php +++ b/Compute/src/V1/Client/GlobalAddressesClient.php @@ -146,6 +146,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/GlobalForwardingRulesClient.php b/Compute/src/V1/Client/GlobalForwardingRulesClient.php index b540552dd865..0b3d6c051a7b 100644 --- a/Compute/src/V1/Client/GlobalForwardingRulesClient.php +++ b/Compute/src/V1/Client/GlobalForwardingRulesClient.php @@ -148,6 +148,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/GlobalNetworkEndpointGroupsClient.php b/Compute/src/V1/Client/GlobalNetworkEndpointGroupsClient.php index a5b161020f30..bf45142b9de7 100644 --- a/Compute/src/V1/Client/GlobalNetworkEndpointGroupsClient.php +++ b/Compute/src/V1/Client/GlobalNetworkEndpointGroupsClient.php @@ -148,6 +148,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php b/Compute/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php index 3d8bf036459f..4c4a7f51a953 100644 --- a/Compute/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php +++ b/Compute/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php @@ -144,6 +144,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/HealthChecksClient.php b/Compute/src/V1/Client/HealthChecksClient.php index b77833615c89..922be56acc3e 100644 --- a/Compute/src/V1/Client/HealthChecksClient.php +++ b/Compute/src/V1/Client/HealthChecksClient.php @@ -148,6 +148,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/ImagesClient.php b/Compute/src/V1/Client/ImagesClient.php index fd8e47a03eb4..0185978c85c1 100644 --- a/Compute/src/V1/Client/ImagesClient.php +++ b/Compute/src/V1/Client/ImagesClient.php @@ -158,6 +158,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php b/Compute/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php index a5bb6788c7ce..a9a0cd25131c 100644 --- a/Compute/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php +++ b/Compute/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php @@ -145,6 +145,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/InstanceGroupManagersClient.php b/Compute/src/V1/Client/InstanceGroupManagersClient.php index 2981a3fb7585..3bc618a75b98 100644 --- a/Compute/src/V1/Client/InstanceGroupManagersClient.php +++ b/Compute/src/V1/Client/InstanceGroupManagersClient.php @@ -175,6 +175,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/InstanceGroupsClient.php b/Compute/src/V1/Client/InstanceGroupsClient.php index f16ad4e32e5c..b625b1f2a05d 100644 --- a/Compute/src/V1/Client/InstanceGroupsClient.php +++ b/Compute/src/V1/Client/InstanceGroupsClient.php @@ -153,6 +153,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/InstanceSettingsServiceClient.php b/Compute/src/V1/Client/InstanceSettingsServiceClient.php index 57b78ebc80e5..0d37239ad68e 100644 --- a/Compute/src/V1/Client/InstanceSettingsServiceClient.php +++ b/Compute/src/V1/Client/InstanceSettingsServiceClient.php @@ -138,6 +138,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/InstanceTemplatesClient.php b/Compute/src/V1/Client/InstanceTemplatesClient.php index 46e805993660..ac0ef31754a5 100644 --- a/Compute/src/V1/Client/InstanceTemplatesClient.php +++ b/Compute/src/V1/Client/InstanceTemplatesClient.php @@ -152,6 +152,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/InstancesClient.php b/Compute/src/V1/Client/InstancesClient.php index a64052a89195..0b4536062c9b 100644 --- a/Compute/src/V1/Client/InstancesClient.php +++ b/Compute/src/V1/Client/InstancesClient.php @@ -239,6 +239,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/InstantSnapshotsClient.php b/Compute/src/V1/Client/InstantSnapshotsClient.php index 1c5d71f0b965..d7f8080a02e7 100644 --- a/Compute/src/V1/Client/InstantSnapshotsClient.php +++ b/Compute/src/V1/Client/InstantSnapshotsClient.php @@ -155,6 +155,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/InterconnectAttachmentsClient.php b/Compute/src/V1/Client/InterconnectAttachmentsClient.php index ceb7a6025538..9e74a892491b 100644 --- a/Compute/src/V1/Client/InterconnectAttachmentsClient.php +++ b/Compute/src/V1/Client/InterconnectAttachmentsClient.php @@ -149,6 +149,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/InterconnectsClient.php b/Compute/src/V1/Client/InterconnectsClient.php index 9130d1e3c4b1..8242fd8c963a 100644 --- a/Compute/src/V1/Client/InterconnectsClient.php +++ b/Compute/src/V1/Client/InterconnectsClient.php @@ -152,6 +152,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/LicensesClient.php b/Compute/src/V1/Client/LicensesClient.php index 742d34f1f73e..3c1f0b40d082 100644 --- a/Compute/src/V1/Client/LicensesClient.php +++ b/Compute/src/V1/Client/LicensesClient.php @@ -150,6 +150,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/MachineImagesClient.php b/Compute/src/V1/Client/MachineImagesClient.php index e00295f9bdc6..98483ad18ed2 100644 --- a/Compute/src/V1/Client/MachineImagesClient.php +++ b/Compute/src/V1/Client/MachineImagesClient.php @@ -150,6 +150,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/NetworkAttachmentsClient.php b/Compute/src/V1/Client/NetworkAttachmentsClient.php index 31afa702f873..f1c0b2dc866a 100644 --- a/Compute/src/V1/Client/NetworkAttachmentsClient.php +++ b/Compute/src/V1/Client/NetworkAttachmentsClient.php @@ -155,6 +155,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/NetworkEdgeSecurityServicesClient.php b/Compute/src/V1/Client/NetworkEdgeSecurityServicesClient.php index f535e617cf73..a4ec845ffe51 100644 --- a/Compute/src/V1/Client/NetworkEdgeSecurityServicesClient.php +++ b/Compute/src/V1/Client/NetworkEdgeSecurityServicesClient.php @@ -145,6 +145,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/NetworkEndpointGroupsClient.php b/Compute/src/V1/Client/NetworkEndpointGroupsClient.php index f76cee0f73f5..d7021b16e707 100644 --- a/Compute/src/V1/Client/NetworkEndpointGroupsClient.php +++ b/Compute/src/V1/Client/NetworkEndpointGroupsClient.php @@ -154,6 +154,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/NetworkFirewallPoliciesClient.php b/Compute/src/V1/Client/NetworkFirewallPoliciesClient.php index c3feeef644b4..5191530d1e96 100644 --- a/Compute/src/V1/Client/NetworkFirewallPoliciesClient.php +++ b/Compute/src/V1/Client/NetworkFirewallPoliciesClient.php @@ -170,6 +170,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/NetworksClient.php b/Compute/src/V1/Client/NetworksClient.php index 6a7143814753..274b2d9c3f28 100644 --- a/Compute/src/V1/Client/NetworksClient.php +++ b/Compute/src/V1/Client/NetworksClient.php @@ -157,6 +157,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/NodeGroupsClient.php b/Compute/src/V1/Client/NodeGroupsClient.php index 1e40c4c59cd5..0cb2d5e8c1c8 100644 --- a/Compute/src/V1/Client/NodeGroupsClient.php +++ b/Compute/src/V1/Client/NodeGroupsClient.php @@ -167,6 +167,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/NodeTemplatesClient.php b/Compute/src/V1/Client/NodeTemplatesClient.php index 405ac3d1006b..a65c3352a865 100644 --- a/Compute/src/V1/Client/NodeTemplatesClient.php +++ b/Compute/src/V1/Client/NodeTemplatesClient.php @@ -153,6 +153,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/PacketMirroringsClient.php b/Compute/src/V1/Client/PacketMirroringsClient.php index 2f58d920ef8c..a81618df35d8 100644 --- a/Compute/src/V1/Client/PacketMirroringsClient.php +++ b/Compute/src/V1/Client/PacketMirroringsClient.php @@ -150,6 +150,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/ProjectsClient.php b/Compute/src/V1/Client/ProjectsClient.php index f58e0dbffb8b..4c1f6e2bd00c 100644 --- a/Compute/src/V1/Client/ProjectsClient.php +++ b/Compute/src/V1/Client/ProjectsClient.php @@ -162,6 +162,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/PublicAdvertisedPrefixesClient.php b/Compute/src/V1/Client/PublicAdvertisedPrefixesClient.php index 94fd6452c59a..fb96aae7016a 100644 --- a/Compute/src/V1/Client/PublicAdvertisedPrefixesClient.php +++ b/Compute/src/V1/Client/PublicAdvertisedPrefixesClient.php @@ -148,6 +148,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/PublicDelegatedPrefixesClient.php b/Compute/src/V1/Client/PublicDelegatedPrefixesClient.php index 50170d8b584a..12c4cfa060e6 100644 --- a/Compute/src/V1/Client/PublicDelegatedPrefixesClient.php +++ b/Compute/src/V1/Client/PublicDelegatedPrefixesClient.php @@ -151,6 +151,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionAutoscalersClient.php b/Compute/src/V1/Client/RegionAutoscalersClient.php index 5913b2d2c56d..64aebe0ab1b0 100644 --- a/Compute/src/V1/Client/RegionAutoscalersClient.php +++ b/Compute/src/V1/Client/RegionAutoscalersClient.php @@ -147,6 +147,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionBackendServicesClient.php b/Compute/src/V1/Client/RegionBackendServicesClient.php index a2b886035294..e829aa69a9e9 100644 --- a/Compute/src/V1/Client/RegionBackendServicesClient.php +++ b/Compute/src/V1/Client/RegionBackendServicesClient.php @@ -162,6 +162,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionCommitmentsClient.php b/Compute/src/V1/Client/RegionCommitmentsClient.php index 7bc009a23d5f..41ec92c154fe 100644 --- a/Compute/src/V1/Client/RegionCommitmentsClient.php +++ b/Compute/src/V1/Client/RegionCommitmentsClient.php @@ -145,6 +145,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionDisksClient.php b/Compute/src/V1/Client/RegionDisksClient.php index c3f8c08a62f7..b7507dc2b688 100644 --- a/Compute/src/V1/Client/RegionDisksClient.php +++ b/Compute/src/V1/Client/RegionDisksClient.php @@ -171,6 +171,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionHealthCheckServicesClient.php b/Compute/src/V1/Client/RegionHealthCheckServicesClient.php index 73d00c933699..8ae34ddefb72 100644 --- a/Compute/src/V1/Client/RegionHealthCheckServicesClient.php +++ b/Compute/src/V1/Client/RegionHealthCheckServicesClient.php @@ -145,6 +145,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionHealthChecksClient.php b/Compute/src/V1/Client/RegionHealthChecksClient.php index ce7e536c45ba..9e34718e9249 100644 --- a/Compute/src/V1/Client/RegionHealthChecksClient.php +++ b/Compute/src/V1/Client/RegionHealthChecksClient.php @@ -147,6 +147,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionInstanceGroupManagersClient.php b/Compute/src/V1/Client/RegionInstanceGroupManagersClient.php index 36f54abcb0bd..e58d4a4457ee 100644 --- a/Compute/src/V1/Client/RegionInstanceGroupManagersClient.php +++ b/Compute/src/V1/Client/RegionInstanceGroupManagersClient.php @@ -173,6 +173,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionInstanceGroupsClient.php b/Compute/src/V1/Client/RegionInstanceGroupsClient.php index 1310135cbab0..b370cb6cd540 100644 --- a/Compute/src/V1/Client/RegionInstanceGroupsClient.php +++ b/Compute/src/V1/Client/RegionInstanceGroupsClient.php @@ -143,6 +143,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionInstanceTemplatesClient.php b/Compute/src/V1/Client/RegionInstanceTemplatesClient.php index 6c311d35be58..15a1e23cabba 100644 --- a/Compute/src/V1/Client/RegionInstanceTemplatesClient.php +++ b/Compute/src/V1/Client/RegionInstanceTemplatesClient.php @@ -143,6 +143,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionInstancesClient.php b/Compute/src/V1/Client/RegionInstancesClient.php index e06dd9aa7930..11fed84940a0 100644 --- a/Compute/src/V1/Client/RegionInstancesClient.php +++ b/Compute/src/V1/Client/RegionInstancesClient.php @@ -135,6 +135,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionInstantSnapshotsClient.php b/Compute/src/V1/Client/RegionInstantSnapshotsClient.php index 2abae1233e2b..4532eff547c5 100644 --- a/Compute/src/V1/Client/RegionInstantSnapshotsClient.php +++ b/Compute/src/V1/Client/RegionInstantSnapshotsClient.php @@ -153,6 +153,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionNetworkEndpointGroupsClient.php b/Compute/src/V1/Client/RegionNetworkEndpointGroupsClient.php index e5727481fc3d..ea1603f569da 100644 --- a/Compute/src/V1/Client/RegionNetworkEndpointGroupsClient.php +++ b/Compute/src/V1/Client/RegionNetworkEndpointGroupsClient.php @@ -149,6 +149,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionNetworkFirewallPoliciesClient.php b/Compute/src/V1/Client/RegionNetworkFirewallPoliciesClient.php index 61587e52da6e..91628aa6c00c 100644 --- a/Compute/src/V1/Client/RegionNetworkFirewallPoliciesClient.php +++ b/Compute/src/V1/Client/RegionNetworkFirewallPoliciesClient.php @@ -174,6 +174,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionNotificationEndpointsClient.php b/Compute/src/V1/Client/RegionNotificationEndpointsClient.php index 8b02f44bfef5..c9c9c5d6f5ee 100644 --- a/Compute/src/V1/Client/RegionNotificationEndpointsClient.php +++ b/Compute/src/V1/Client/RegionNotificationEndpointsClient.php @@ -143,6 +143,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionSecurityPoliciesClient.php b/Compute/src/V1/Client/RegionSecurityPoliciesClient.php index b25152cd021b..45ff79e42c90 100644 --- a/Compute/src/V1/Client/RegionSecurityPoliciesClient.php +++ b/Compute/src/V1/Client/RegionSecurityPoliciesClient.php @@ -154,6 +154,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionSslCertificatesClient.php b/Compute/src/V1/Client/RegionSslCertificatesClient.php index 47f0a4339c8a..c82732a00cb1 100644 --- a/Compute/src/V1/Client/RegionSslCertificatesClient.php +++ b/Compute/src/V1/Client/RegionSslCertificatesClient.php @@ -143,6 +143,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionSslPoliciesClient.php b/Compute/src/V1/Client/RegionSslPoliciesClient.php index c06c4118c4a0..4efc84c2edb1 100644 --- a/Compute/src/V1/Client/RegionSslPoliciesClient.php +++ b/Compute/src/V1/Client/RegionSslPoliciesClient.php @@ -148,6 +148,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionTargetHttpProxiesClient.php b/Compute/src/V1/Client/RegionTargetHttpProxiesClient.php index 1d5114eac0b8..44354946778f 100644 --- a/Compute/src/V1/Client/RegionTargetHttpProxiesClient.php +++ b/Compute/src/V1/Client/RegionTargetHttpProxiesClient.php @@ -145,6 +145,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionTargetHttpsProxiesClient.php b/Compute/src/V1/Client/RegionTargetHttpsProxiesClient.php index 9d9789004718..3848490518af 100644 --- a/Compute/src/V1/Client/RegionTargetHttpsProxiesClient.php +++ b/Compute/src/V1/Client/RegionTargetHttpsProxiesClient.php @@ -149,6 +149,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionTargetTcpProxiesClient.php b/Compute/src/V1/Client/RegionTargetTcpProxiesClient.php index 794d3d042fc3..246f95019da1 100644 --- a/Compute/src/V1/Client/RegionTargetTcpProxiesClient.php +++ b/Compute/src/V1/Client/RegionTargetTcpProxiesClient.php @@ -143,6 +143,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RegionUrlMapsClient.php b/Compute/src/V1/Client/RegionUrlMapsClient.php index c32882775c0a..398af0cda22b 100644 --- a/Compute/src/V1/Client/RegionUrlMapsClient.php +++ b/Compute/src/V1/Client/RegionUrlMapsClient.php @@ -150,6 +150,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/ReservationsClient.php b/Compute/src/V1/Client/ReservationsClient.php index 8097ea103f97..8be4f534058c 100644 --- a/Compute/src/V1/Client/ReservationsClient.php +++ b/Compute/src/V1/Client/ReservationsClient.php @@ -157,6 +157,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/ResourcePoliciesClient.php b/Compute/src/V1/Client/ResourcePoliciesClient.php index a3e2e1b49a2c..0e2dec87469a 100644 --- a/Compute/src/V1/Client/ResourcePoliciesClient.php +++ b/Compute/src/V1/Client/ResourcePoliciesClient.php @@ -155,6 +155,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RoutersClient.php b/Compute/src/V1/Client/RoutersClient.php index 90c3f4c51228..8e2910b96af6 100644 --- a/Compute/src/V1/Client/RoutersClient.php +++ b/Compute/src/V1/Client/RoutersClient.php @@ -160,6 +160,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/RoutesClient.php b/Compute/src/V1/Client/RoutesClient.php index 54b3ac6abfa1..072d8fb91517 100644 --- a/Compute/src/V1/Client/RoutesClient.php +++ b/Compute/src/V1/Client/RoutesClient.php @@ -142,6 +142,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/SecurityPoliciesClient.php b/Compute/src/V1/Client/SecurityPoliciesClient.php index 21aeb29e6e53..cd6ae0277a55 100644 --- a/Compute/src/V1/Client/SecurityPoliciesClient.php +++ b/Compute/src/V1/Client/SecurityPoliciesClient.php @@ -160,6 +160,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/ServiceAttachmentsClient.php b/Compute/src/V1/Client/ServiceAttachmentsClient.php index a18d832105bb..bc00f30f7da2 100644 --- a/Compute/src/V1/Client/ServiceAttachmentsClient.php +++ b/Compute/src/V1/Client/ServiceAttachmentsClient.php @@ -155,6 +155,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/SnapshotSettingsServiceClient.php b/Compute/src/V1/Client/SnapshotSettingsServiceClient.php index a4184857f310..adf412a9b092 100644 --- a/Compute/src/V1/Client/SnapshotSettingsServiceClient.php +++ b/Compute/src/V1/Client/SnapshotSettingsServiceClient.php @@ -137,6 +137,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/SnapshotsClient.php b/Compute/src/V1/Client/SnapshotsClient.php index d639ccdca5c8..4995465e8d0e 100644 --- a/Compute/src/V1/Client/SnapshotsClient.php +++ b/Compute/src/V1/Client/SnapshotsClient.php @@ -152,6 +152,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/SslCertificatesClient.php b/Compute/src/V1/Client/SslCertificatesClient.php index 4b705db636a7..9562fd895b03 100644 --- a/Compute/src/V1/Client/SslCertificatesClient.php +++ b/Compute/src/V1/Client/SslCertificatesClient.php @@ -144,6 +144,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/SslPoliciesClient.php b/Compute/src/V1/Client/SslPoliciesClient.php index cfbf83d5946c..72e57a799f36 100644 --- a/Compute/src/V1/Client/SslPoliciesClient.php +++ b/Compute/src/V1/Client/SslPoliciesClient.php @@ -149,6 +149,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/StoragePoolsClient.php b/Compute/src/V1/Client/StoragePoolsClient.php index 735007a9e3c6..b29af1e95197 100644 --- a/Compute/src/V1/Client/StoragePoolsClient.php +++ b/Compute/src/V1/Client/StoragePoolsClient.php @@ -159,6 +159,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/SubnetworksClient.php b/Compute/src/V1/Client/SubnetworksClient.php index de1765330fb0..e9c14cd67fee 100644 --- a/Compute/src/V1/Client/SubnetworksClient.php +++ b/Compute/src/V1/Client/SubnetworksClient.php @@ -161,6 +161,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/TargetGrpcProxiesClient.php b/Compute/src/V1/Client/TargetGrpcProxiesClient.php index 048efa419b3b..e1de89d88596 100644 --- a/Compute/src/V1/Client/TargetGrpcProxiesClient.php +++ b/Compute/src/V1/Client/TargetGrpcProxiesClient.php @@ -144,6 +144,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/TargetHttpProxiesClient.php b/Compute/src/V1/Client/TargetHttpProxiesClient.php index 04f961ac7fcf..fad727fe4e86 100644 --- a/Compute/src/V1/Client/TargetHttpProxiesClient.php +++ b/Compute/src/V1/Client/TargetHttpProxiesClient.php @@ -148,6 +148,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/TargetHttpsProxiesClient.php b/Compute/src/V1/Client/TargetHttpsProxiesClient.php index c95f0c4ed7e0..0fd497aa35c4 100644 --- a/Compute/src/V1/Client/TargetHttpsProxiesClient.php +++ b/Compute/src/V1/Client/TargetHttpsProxiesClient.php @@ -156,6 +156,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/TargetInstancesClient.php b/Compute/src/V1/Client/TargetInstancesClient.php index 4451b9625f56..85447f521ed7 100644 --- a/Compute/src/V1/Client/TargetInstancesClient.php +++ b/Compute/src/V1/Client/TargetInstancesClient.php @@ -147,6 +147,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Client/TargetPoolsClient.php b/Compute/src/V1/Client/TargetPoolsClient.php index e5c24c2f1798..ce732c9dd633 100644 --- a/Compute/src/V1/Client/TargetPoolsClient.php +++ b/Compute/src/V1/Client/TargetPoolsClient.php @@ -160,6 +160,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/TargetSslProxiesClient.php b/Compute/src/V1/Client/TargetSslProxiesClient.php index 86b46aafb42d..89161f52e106 100644 --- a/Compute/src/V1/Client/TargetSslProxiesClient.php +++ b/Compute/src/V1/Client/TargetSslProxiesClient.php @@ -152,6 +152,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/TargetTcpProxiesClient.php b/Compute/src/V1/Client/TargetTcpProxiesClient.php index 8fa2766f31db..c4920600a5d7 100644 --- a/Compute/src/V1/Client/TargetTcpProxiesClient.php +++ b/Compute/src/V1/Client/TargetTcpProxiesClient.php @@ -148,6 +148,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/TargetVpnGatewaysClient.php b/Compute/src/V1/Client/TargetVpnGatewaysClient.php index cff46f2d46e3..7b8a6283b772 100644 --- a/Compute/src/V1/Client/TargetVpnGatewaysClient.php +++ b/Compute/src/V1/Client/TargetVpnGatewaysClient.php @@ -147,6 +147,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/UrlMapsClient.php b/Compute/src/V1/Client/UrlMapsClient.php index 69d7d80e693a..52ca9f05cea4 100644 --- a/Compute/src/V1/Client/UrlMapsClient.php +++ b/Compute/src/V1/Client/UrlMapsClient.php @@ -153,6 +153,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Client/VpnGatewaysClient.php b/Compute/src/V1/Client/VpnGatewaysClient.php index 94f752985825..4f76c5719732 100644 --- a/Compute/src/V1/Client/VpnGatewaysClient.php +++ b/Compute/src/V1/Client/VpnGatewaysClient.php @@ -153,6 +153,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Client/VpnTunnelsClient.php b/Compute/src/V1/Client/VpnTunnelsClient.php index a9cd4395ba42..0dd62b4ed84d 100644 --- a/Compute/src/V1/Client/VpnTunnelsClient.php +++ b/Compute/src/V1/Client/VpnTunnelsClient.php @@ -147,6 +147,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Commitment/Type.php b/Compute/src/V1/Commitment/Type.php index 622892c7f02e..ff94574567b5 100644 --- a/Compute/src/V1/Commitment/Type.php +++ b/Compute/src/V1/Commitment/Type.php @@ -27,6 +27,10 @@ class Type * Generated from protobuf enum ACCELERATOR_OPTIMIZED_A3 = 158574526; */ const ACCELERATOR_OPTIMIZED_A3 = 158574526; + /** + * Generated from protobuf enum ACCELERATOR_OPTIMIZED_A3_MEGA = 156517459; + */ + const ACCELERATOR_OPTIMIZED_A3_MEGA = 156517459; /** * Generated from protobuf enum COMPUTE_OPTIMIZED = 158349023; */ @@ -96,6 +100,7 @@ class Type self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', self::ACCELERATOR_OPTIMIZED => 'ACCELERATOR_OPTIMIZED', self::ACCELERATOR_OPTIMIZED_A3 => 'ACCELERATOR_OPTIMIZED_A3', + self::ACCELERATOR_OPTIMIZED_A3_MEGA => 'ACCELERATOR_OPTIMIZED_A3_MEGA', self::COMPUTE_OPTIMIZED => 'COMPUTE_OPTIMIZED', self::COMPUTE_OPTIMIZED_C2D => 'COMPUTE_OPTIMIZED_C2D', self::COMPUTE_OPTIMIZED_C3 => 'COMPUTE_OPTIMIZED_C3', diff --git a/Compute/src/V1/Enums/Commitment/Type.php b/Compute/src/V1/Enums/Commitment/Type.php index fc7ba84f86e5..7b8735a1caea 100644 --- a/Compute/src/V1/Enums/Commitment/Type.php +++ b/Compute/src/V1/Enums/Commitment/Type.php @@ -36,6 +36,8 @@ class Type const ACCELERATOR_OPTIMIZED_A3 = 'ACCELERATOR_OPTIMIZED_A3'; + const ACCELERATOR_OPTIMIZED_A3_MEGA = 'ACCELERATOR_OPTIMIZED_A3_MEGA'; + const COMPUTE_OPTIMIZED = 'COMPUTE_OPTIMIZED'; const COMPUTE_OPTIMIZED_C2D = 'COMPUTE_OPTIMIZED_C2D'; diff --git a/Compute/src/V1/Enums/Quota/Metric.php b/Compute/src/V1/Enums/Quota/Metric.php index 9b8224d9ad53..5d6672ce8812 100644 --- a/Compute/src/V1/Enums/Quota/Metric.php +++ b/Compute/src/V1/Enums/Quota/Metric.php @@ -352,6 +352,8 @@ class Metric const URL_MAPS = 'URL_MAPS'; + const VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES = 'VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES'; + const VPN_GATEWAYS = 'VPN_GATEWAYS'; const VPN_TUNNELS = 'VPN_TUNNELS'; diff --git a/Compute/src/V1/Gapic/AddressesGapicClient.php b/Compute/src/V1/Gapic/AddressesGapicClient.php index 26dc0894cc10..a023f8eb24e2 100644 --- a/Compute/src/V1/Gapic/AddressesGapicClient.php +++ b/Compute/src/V1/Gapic/AddressesGapicClient.php @@ -169,6 +169,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/AutoscalersGapicClient.php b/Compute/src/V1/Gapic/AutoscalersGapicClient.php index 1ab3e83cec6a..0ed125649ae5 100644 --- a/Compute/src/V1/Gapic/AutoscalersGapicClient.php +++ b/Compute/src/V1/Gapic/AutoscalersGapicClient.php @@ -167,6 +167,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/BackendBucketsGapicClient.php b/Compute/src/V1/Gapic/BackendBucketsGapicClient.php index d8817d9e8b38..da6197c3d896 100644 --- a/Compute/src/V1/Gapic/BackendBucketsGapicClient.php +++ b/Compute/src/V1/Gapic/BackendBucketsGapicClient.php @@ -189,6 +189,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/BackendServicesGapicClient.php b/Compute/src/V1/Gapic/BackendServicesGapicClient.php index eeae7860c0c4..47af2d7356a9 100644 --- a/Compute/src/V1/Gapic/BackendServicesGapicClient.php +++ b/Compute/src/V1/Gapic/BackendServicesGapicClient.php @@ -197,6 +197,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/DisksGapicClient.php b/Compute/src/V1/Gapic/DisksGapicClient.php index 374a754b6d7c..20369504ee2d 100644 --- a/Compute/src/V1/Gapic/DisksGapicClient.php +++ b/Compute/src/V1/Gapic/DisksGapicClient.php @@ -204,6 +204,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/ExternalVpnGatewaysGapicClient.php b/Compute/src/V1/Gapic/ExternalVpnGatewaysGapicClient.php index e1899d075d3d..1a6ab8785768 100644 --- a/Compute/src/V1/Gapic/ExternalVpnGatewaysGapicClient.php +++ b/Compute/src/V1/Gapic/ExternalVpnGatewaysGapicClient.php @@ -179,6 +179,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/FirewallPoliciesGapicClient.php b/Compute/src/V1/Gapic/FirewallPoliciesGapicClient.php index a9dc5c389be2..c240731dc0bd 100644 --- a/Compute/src/V1/Gapic/FirewallPoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/FirewallPoliciesGapicClient.php @@ -194,6 +194,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/FirewallsGapicClient.php b/Compute/src/V1/Gapic/FirewallsGapicClient.php index 50db3376fcb9..a66d582ffadd 100644 --- a/Compute/src/V1/Gapic/FirewallsGapicClient.php +++ b/Compute/src/V1/Gapic/FirewallsGapicClient.php @@ -176,6 +176,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/ForwardingRulesGapicClient.php b/Compute/src/V1/Gapic/ForwardingRulesGapicClient.php index ba6238a4ba16..026f0e1b90a5 100644 --- a/Compute/src/V1/Gapic/ForwardingRulesGapicClient.php +++ b/Compute/src/V1/Gapic/ForwardingRulesGapicClient.php @@ -170,6 +170,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/GlobalAddressesGapicClient.php b/Compute/src/V1/Gapic/GlobalAddressesGapicClient.php index 0aeab6639071..099fa9936a72 100644 --- a/Compute/src/V1/Gapic/GlobalAddressesGapicClient.php +++ b/Compute/src/V1/Gapic/GlobalAddressesGapicClient.php @@ -178,6 +178,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/GlobalForwardingRulesGapicClient.php b/Compute/src/V1/Gapic/GlobalForwardingRulesGapicClient.php index b5375b8849b2..ae7f8584a7fe 100644 --- a/Compute/src/V1/Gapic/GlobalForwardingRulesGapicClient.php +++ b/Compute/src/V1/Gapic/GlobalForwardingRulesGapicClient.php @@ -179,6 +179,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php b/Compute/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php index 6cbbb1b17cdd..7ad43c65e519 100644 --- a/Compute/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php +++ b/Compute/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php @@ -181,6 +181,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/GlobalPublicDelegatedPrefixesGapicClient.php b/Compute/src/V1/Gapic/GlobalPublicDelegatedPrefixesGapicClient.php index 83b1f37132ad..b956cacc1b98 100644 --- a/Compute/src/V1/Gapic/GlobalPublicDelegatedPrefixesGapicClient.php +++ b/Compute/src/V1/Gapic/GlobalPublicDelegatedPrefixesGapicClient.php @@ -175,6 +175,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/HealthChecksGapicClient.php b/Compute/src/V1/Gapic/HealthChecksGapicClient.php index 4ba7c1d136d7..15469ca0f1e1 100644 --- a/Compute/src/V1/Gapic/HealthChecksGapicClient.php +++ b/Compute/src/V1/Gapic/HealthChecksGapicClient.php @@ -166,6 +166,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/ImagesGapicClient.php b/Compute/src/V1/Gapic/ImagesGapicClient.php index ba3273bb8a2d..51a90bcbf7d9 100644 --- a/Compute/src/V1/Gapic/ImagesGapicClient.php +++ b/Compute/src/V1/Gapic/ImagesGapicClient.php @@ -187,6 +187,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/InstanceGroupManagerResizeRequestsGapicClient.php b/Compute/src/V1/Gapic/InstanceGroupManagerResizeRequestsGapicClient.php index d7307c0349a5..34ac2edc71fc 100644 --- a/Compute/src/V1/Gapic/InstanceGroupManagerResizeRequestsGapicClient.php +++ b/Compute/src/V1/Gapic/InstanceGroupManagerResizeRequestsGapicClient.php @@ -178,6 +178,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/InstanceGroupManagersGapicClient.php b/Compute/src/V1/Gapic/InstanceGroupManagersGapicClient.php index 8aeff5f389ba..2a5d06996ac3 100644 --- a/Compute/src/V1/Gapic/InstanceGroupManagersGapicClient.php +++ b/Compute/src/V1/Gapic/InstanceGroupManagersGapicClient.php @@ -207,6 +207,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/InstanceGroupsGapicClient.php b/Compute/src/V1/Gapic/InstanceGroupsGapicClient.php index 9e000769d686..4e7425353d58 100644 --- a/Compute/src/V1/Gapic/InstanceGroupsGapicClient.php +++ b/Compute/src/V1/Gapic/InstanceGroupsGapicClient.php @@ -188,6 +188,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/InstanceSettingsServiceGapicClient.php b/Compute/src/V1/Gapic/InstanceSettingsServiceGapicClient.php index 157f523700e0..8b1d4e31b062 100644 --- a/Compute/src/V1/Gapic/InstanceSettingsServiceGapicClient.php +++ b/Compute/src/V1/Gapic/InstanceSettingsServiceGapicClient.php @@ -149,6 +149,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/InstanceTemplatesGapicClient.php b/Compute/src/V1/Gapic/InstanceTemplatesGapicClient.php index 81f7afe088a3..9f5ff323ea71 100644 --- a/Compute/src/V1/Gapic/InstanceTemplatesGapicClient.php +++ b/Compute/src/V1/Gapic/InstanceTemplatesGapicClient.php @@ -171,6 +171,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/InstancesGapicClient.php b/Compute/src/V1/Gapic/InstancesGapicClient.php index 1af5015ffd2b..ab125d0822e2 100644 --- a/Compute/src/V1/Gapic/InstancesGapicClient.php +++ b/Compute/src/V1/Gapic/InstancesGapicClient.php @@ -254,6 +254,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/InstantSnapshotsGapicClient.php b/Compute/src/V1/Gapic/InstantSnapshotsGapicClient.php index 48a1ded61a8c..5632a3246af3 100644 --- a/Compute/src/V1/Gapic/InstantSnapshotsGapicClient.php +++ b/Compute/src/V1/Gapic/InstantSnapshotsGapicClient.php @@ -174,6 +174,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/InterconnectAttachmentsGapicClient.php b/Compute/src/V1/Gapic/InterconnectAttachmentsGapicClient.php index 96e952630038..9e12bca5b457 100644 --- a/Compute/src/V1/Gapic/InterconnectAttachmentsGapicClient.php +++ b/Compute/src/V1/Gapic/InterconnectAttachmentsGapicClient.php @@ -168,6 +168,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/InterconnectsGapicClient.php b/Compute/src/V1/Gapic/InterconnectsGapicClient.php index b824e7948e65..6f08a9710cea 100644 --- a/Compute/src/V1/Gapic/InterconnectsGapicClient.php +++ b/Compute/src/V1/Gapic/InterconnectsGapicClient.php @@ -181,6 +181,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/LicensesGapicClient.php b/Compute/src/V1/Gapic/LicensesGapicClient.php index 60bff9c05234..af45b7ca6c01 100644 --- a/Compute/src/V1/Gapic/LicensesGapicClient.php +++ b/Compute/src/V1/Gapic/LicensesGapicClient.php @@ -181,6 +181,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/MachineImagesGapicClient.php b/Compute/src/V1/Gapic/MachineImagesGapicClient.php index e78745f76f15..62cd1623e166 100644 --- a/Compute/src/V1/Gapic/MachineImagesGapicClient.php +++ b/Compute/src/V1/Gapic/MachineImagesGapicClient.php @@ -181,6 +181,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/NetworkAttachmentsGapicClient.php b/Compute/src/V1/Gapic/NetworkAttachmentsGapicClient.php index 27c7ab952b79..5c358d33206d 100644 --- a/Compute/src/V1/Gapic/NetworkAttachmentsGapicClient.php +++ b/Compute/src/V1/Gapic/NetworkAttachmentsGapicClient.php @@ -173,6 +173,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/NetworkEdgeSecurityServicesGapicClient.php b/Compute/src/V1/Gapic/NetworkEdgeSecurityServicesGapicClient.php index 6ba6cd90f7b2..45d9a54b62b7 100644 --- a/Compute/src/V1/Gapic/NetworkEdgeSecurityServicesGapicClient.php +++ b/Compute/src/V1/Gapic/NetworkEdgeSecurityServicesGapicClient.php @@ -164,6 +164,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php b/Compute/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php index 5dce57a897b4..d43db0847f3f 100644 --- a/Compute/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php +++ b/Compute/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php @@ -175,6 +175,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/NetworkFirewallPoliciesGapicClient.php b/Compute/src/V1/Gapic/NetworkFirewallPoliciesGapicClient.php index 650cde5f3143..d6834dabb5e9 100644 --- a/Compute/src/V1/Gapic/NetworkFirewallPoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/NetworkFirewallPoliciesGapicClient.php @@ -193,6 +193,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/NetworksGapicClient.php b/Compute/src/V1/Gapic/NetworksGapicClient.php index 2583b6e89cb0..97d449b9fde5 100644 --- a/Compute/src/V1/Gapic/NetworksGapicClient.php +++ b/Compute/src/V1/Gapic/NetworksGapicClient.php @@ -187,6 +187,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/NodeGroupsGapicClient.php b/Compute/src/V1/Gapic/NodeGroupsGapicClient.php index dd49c8526e12..15c895434dab 100644 --- a/Compute/src/V1/Gapic/NodeGroupsGapicClient.php +++ b/Compute/src/V1/Gapic/NodeGroupsGapicClient.php @@ -199,6 +199,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/NodeTemplatesGapicClient.php b/Compute/src/V1/Gapic/NodeTemplatesGapicClient.php index 613693403dd0..ca0c4237762e 100644 --- a/Compute/src/V1/Gapic/NodeTemplatesGapicClient.php +++ b/Compute/src/V1/Gapic/NodeTemplatesGapicClient.php @@ -172,6 +172,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/PacketMirroringsGapicClient.php b/Compute/src/V1/Gapic/PacketMirroringsGapicClient.php index a707e04b3cdb..dcee15e8049b 100644 --- a/Compute/src/V1/Gapic/PacketMirroringsGapicClient.php +++ b/Compute/src/V1/Gapic/PacketMirroringsGapicClient.php @@ -169,6 +169,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/ProjectsGapicClient.php b/Compute/src/V1/Gapic/ProjectsGapicClient.php index 568e922e68d7..3999253f880d 100644 --- a/Compute/src/V1/Gapic/ProjectsGapicClient.php +++ b/Compute/src/V1/Gapic/ProjectsGapicClient.php @@ -193,6 +193,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/PublicAdvertisedPrefixesGapicClient.php b/Compute/src/V1/Gapic/PublicAdvertisedPrefixesGapicClient.php index a0d317b2cc01..6bb97aafacb9 100644 --- a/Compute/src/V1/Gapic/PublicAdvertisedPrefixesGapicClient.php +++ b/Compute/src/V1/Gapic/PublicAdvertisedPrefixesGapicClient.php @@ -177,6 +177,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/PublicDelegatedPrefixesGapicClient.php b/Compute/src/V1/Gapic/PublicDelegatedPrefixesGapicClient.php index 29a2e5204f3f..3e51016aae73 100644 --- a/Compute/src/V1/Gapic/PublicDelegatedPrefixesGapicClient.php +++ b/Compute/src/V1/Gapic/PublicDelegatedPrefixesGapicClient.php @@ -168,6 +168,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionAutoscalersGapicClient.php b/Compute/src/V1/Gapic/RegionAutoscalersGapicClient.php index 285a50300a7d..8c9555122037 100644 --- a/Compute/src/V1/Gapic/RegionAutoscalersGapicClient.php +++ b/Compute/src/V1/Gapic/RegionAutoscalersGapicClient.php @@ -178,6 +178,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionBackendServicesGapicClient.php b/Compute/src/V1/Gapic/RegionBackendServicesGapicClient.php index 6c7aaa14dcc9..16934d2cffeb 100644 --- a/Compute/src/V1/Gapic/RegionBackendServicesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionBackendServicesGapicClient.php @@ -192,6 +192,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionCommitmentsGapicClient.php b/Compute/src/V1/Gapic/RegionCommitmentsGapicClient.php index ea61622c1899..922ffe941e22 100644 --- a/Compute/src/V1/Gapic/RegionCommitmentsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionCommitmentsGapicClient.php @@ -165,6 +165,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionDisksGapicClient.php b/Compute/src/V1/Gapic/RegionDisksGapicClient.php index b3ce941640f9..bbb617537635 100644 --- a/Compute/src/V1/Gapic/RegionDisksGapicClient.php +++ b/Compute/src/V1/Gapic/RegionDisksGapicClient.php @@ -202,6 +202,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionHealthCheckServicesGapicClient.php b/Compute/src/V1/Gapic/RegionHealthCheckServicesGapicClient.php index 6ce8c691a7a0..8d06871eba2c 100644 --- a/Compute/src/V1/Gapic/RegionHealthCheckServicesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionHealthCheckServicesGapicClient.php @@ -177,6 +177,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionHealthChecksGapicClient.php b/Compute/src/V1/Gapic/RegionHealthChecksGapicClient.php index 72fbf60e014e..cac401baa6ce 100644 --- a/Compute/src/V1/Gapic/RegionHealthChecksGapicClient.php +++ b/Compute/src/V1/Gapic/RegionHealthChecksGapicClient.php @@ -178,6 +178,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionInstanceGroupManagersGapicClient.php b/Compute/src/V1/Gapic/RegionInstanceGroupManagersGapicClient.php index 766fc83576ea..e0e271d35a9a 100644 --- a/Compute/src/V1/Gapic/RegionInstanceGroupManagersGapicClient.php +++ b/Compute/src/V1/Gapic/RegionInstanceGroupManagersGapicClient.php @@ -205,6 +205,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionInstanceGroupsGapicClient.php b/Compute/src/V1/Gapic/RegionInstanceGroupsGapicClient.php index 93e22e770287..48c3ac6cc19d 100644 --- a/Compute/src/V1/Gapic/RegionInstanceGroupsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionInstanceGroupsGapicClient.php @@ -156,6 +156,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php b/Compute/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php index db057b0616c4..3a4944021a14 100644 --- a/Compute/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php @@ -176,6 +176,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionInstancesGapicClient.php b/Compute/src/V1/Gapic/RegionInstancesGapicClient.php index ba80351938a2..43397204426c 100644 --- a/Compute/src/V1/Gapic/RegionInstancesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionInstancesGapicClient.php @@ -172,6 +172,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionInstantSnapshotsGapicClient.php b/Compute/src/V1/Gapic/RegionInstantSnapshotsGapicClient.php index 8267898300e4..516c991e25a6 100644 --- a/Compute/src/V1/Gapic/RegionInstantSnapshotsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionInstantSnapshotsGapicClient.php @@ -185,6 +185,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php b/Compute/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php index 87cc5ce9144e..ba21ae58f492 100644 --- a/Compute/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php @@ -183,6 +183,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionNetworkFirewallPoliciesGapicClient.php b/Compute/src/V1/Gapic/RegionNetworkFirewallPoliciesGapicClient.php index 92877cd2ced4..382d81ac47fa 100644 --- a/Compute/src/V1/Gapic/RegionNetworkFirewallPoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionNetworkFirewallPoliciesGapicClient.php @@ -197,6 +197,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionNotificationEndpointsGapicClient.php b/Compute/src/V1/Gapic/RegionNotificationEndpointsGapicClient.php index bf26e3d7cc5b..7d5ec2383192 100644 --- a/Compute/src/V1/Gapic/RegionNotificationEndpointsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionNotificationEndpointsGapicClient.php @@ -176,6 +176,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php b/Compute/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php index 39b05acc2758..16c1e3357193 100644 --- a/Compute/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php @@ -183,6 +183,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionSslCertificatesGapicClient.php b/Compute/src/V1/Gapic/RegionSslCertificatesGapicClient.php index 532e07ce4f55..4b4d18d95f4a 100644 --- a/Compute/src/V1/Gapic/RegionSslCertificatesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionSslCertificatesGapicClient.php @@ -176,6 +176,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionSslPoliciesGapicClient.php b/Compute/src/V1/Gapic/RegionSslPoliciesGapicClient.php index 7156b1910194..023e25f4c3ba 100644 --- a/Compute/src/V1/Gapic/RegionSslPoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionSslPoliciesGapicClient.php @@ -179,6 +179,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php b/Compute/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php index e15d31bdf5c4..cb4cfe783db3 100644 --- a/Compute/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php @@ -178,6 +178,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php b/Compute/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php index 6e463fc60e39..4575ac37e659 100644 --- a/Compute/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php @@ -181,6 +181,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionTargetTcpProxiesGapicClient.php b/Compute/src/V1/Gapic/RegionTargetTcpProxiesGapicClient.php index e3039ed1e240..788b69ef6cd1 100644 --- a/Compute/src/V1/Gapic/RegionTargetTcpProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionTargetTcpProxiesGapicClient.php @@ -176,6 +176,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RegionUrlMapsGapicClient.php b/Compute/src/V1/Gapic/RegionUrlMapsGapicClient.php index 0c364bf3dd48..09918e9d2624 100644 --- a/Compute/src/V1/Gapic/RegionUrlMapsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionUrlMapsGapicClient.php @@ -181,6 +181,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/ReservationsGapicClient.php b/Compute/src/V1/Gapic/ReservationsGapicClient.php index 9c7b98f6ecb4..622478427e73 100644 --- a/Compute/src/V1/Gapic/ReservationsGapicClient.php +++ b/Compute/src/V1/Gapic/ReservationsGapicClient.php @@ -175,6 +175,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/ResourcePoliciesGapicClient.php b/Compute/src/V1/Gapic/ResourcePoliciesGapicClient.php index 7b10ad95435b..8071da9b826a 100644 --- a/Compute/src/V1/Gapic/ResourcePoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/ResourcePoliciesGapicClient.php @@ -173,6 +173,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RoutersGapicClient.php b/Compute/src/V1/Gapic/RoutersGapicClient.php index 4d1f43b9c51f..284bd17f7d54 100644 --- a/Compute/src/V1/Gapic/RoutersGapicClient.php +++ b/Compute/src/V1/Gapic/RoutersGapicClient.php @@ -175,6 +175,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/RoutesGapicClient.php b/Compute/src/V1/Gapic/RoutesGapicClient.php index 9abc2ee3296c..4e86bf44da83 100644 --- a/Compute/src/V1/Gapic/RoutesGapicClient.php +++ b/Compute/src/V1/Gapic/RoutesGapicClient.php @@ -174,6 +174,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/SecurityPoliciesGapicClient.php b/Compute/src/V1/Gapic/SecurityPoliciesGapicClient.php index 24384d5900cc..fd747d5ff98f 100644 --- a/Compute/src/V1/Gapic/SecurityPoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/SecurityPoliciesGapicClient.php @@ -187,6 +187,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/ServiceAttachmentsGapicClient.php b/Compute/src/V1/Gapic/ServiceAttachmentsGapicClient.php index feaf2207ae5a..e503e067ba9c 100644 --- a/Compute/src/V1/Gapic/ServiceAttachmentsGapicClient.php +++ b/Compute/src/V1/Gapic/ServiceAttachmentsGapicClient.php @@ -173,6 +173,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/SnapshotSettingsServiceGapicClient.php b/Compute/src/V1/Gapic/SnapshotSettingsServiceGapicClient.php index 80b65db1d1bd..67196ae79857 100644 --- a/Compute/src/V1/Gapic/SnapshotSettingsServiceGapicClient.php +++ b/Compute/src/V1/Gapic/SnapshotSettingsServiceGapicClient.php @@ -147,6 +147,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/SnapshotsGapicClient.php b/Compute/src/V1/Gapic/SnapshotsGapicClient.php index 104e740b3599..18f7d198b22c 100644 --- a/Compute/src/V1/Gapic/SnapshotsGapicClient.php +++ b/Compute/src/V1/Gapic/SnapshotsGapicClient.php @@ -183,6 +183,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/SslCertificatesGapicClient.php b/Compute/src/V1/Gapic/SslCertificatesGapicClient.php index d08981566e50..6830cd88ab2d 100644 --- a/Compute/src/V1/Gapic/SslCertificatesGapicClient.php +++ b/Compute/src/V1/Gapic/SslCertificatesGapicClient.php @@ -164,6 +164,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/SslPoliciesGapicClient.php b/Compute/src/V1/Gapic/SslPoliciesGapicClient.php index e44ab3b4e348..da7636fe1c52 100644 --- a/Compute/src/V1/Gapic/SslPoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/SslPoliciesGapicClient.php @@ -167,6 +167,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/StoragePoolsGapicClient.php b/Compute/src/V1/Gapic/StoragePoolsGapicClient.php index 11e57ad5c6f9..bfcb752f50c3 100644 --- a/Compute/src/V1/Gapic/StoragePoolsGapicClient.php +++ b/Compute/src/V1/Gapic/StoragePoolsGapicClient.php @@ -175,6 +175,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/SubnetworksGapicClient.php b/Compute/src/V1/Gapic/SubnetworksGapicClient.php index be5a134a07a7..9f448fe76996 100644 --- a/Compute/src/V1/Gapic/SubnetworksGapicClient.php +++ b/Compute/src/V1/Gapic/SubnetworksGapicClient.php @@ -179,6 +179,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/TargetGrpcProxiesGapicClient.php b/Compute/src/V1/Gapic/TargetGrpcProxiesGapicClient.php index 78593305e124..343d45ac5520 100644 --- a/Compute/src/V1/Gapic/TargetGrpcProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetGrpcProxiesGapicClient.php @@ -175,6 +175,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/TargetHttpProxiesGapicClient.php b/Compute/src/V1/Gapic/TargetHttpProxiesGapicClient.php index f9fc97e0d106..aa610ad143e9 100644 --- a/Compute/src/V1/Gapic/TargetHttpProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetHttpProxiesGapicClient.php @@ -167,6 +167,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/TargetHttpsProxiesGapicClient.php b/Compute/src/V1/Gapic/TargetHttpsProxiesGapicClient.php index 3ec2f5e9136e..6617725e820c 100644 --- a/Compute/src/V1/Gapic/TargetHttpsProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetHttpsProxiesGapicClient.php @@ -175,6 +175,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/TargetInstancesGapicClient.php b/Compute/src/V1/Gapic/TargetInstancesGapicClient.php index e430dab5b810..7c57d1419c4f 100644 --- a/Compute/src/V1/Gapic/TargetInstancesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetInstancesGapicClient.php @@ -167,6 +167,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/TargetPoolsGapicClient.php b/Compute/src/V1/Gapic/TargetPoolsGapicClient.php index 18dee55fab28..a4ccc5de71dc 100644 --- a/Compute/src/V1/Gapic/TargetPoolsGapicClient.php +++ b/Compute/src/V1/Gapic/TargetPoolsGapicClient.php @@ -194,6 +194,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/TargetSslProxiesGapicClient.php b/Compute/src/V1/Gapic/TargetSslProxiesGapicClient.php index 2e1605393fbc..1c4ab27ed15d 100644 --- a/Compute/src/V1/Gapic/TargetSslProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetSslProxiesGapicClient.php @@ -184,6 +184,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/TargetTcpProxiesGapicClient.php b/Compute/src/V1/Gapic/TargetTcpProxiesGapicClient.php index ed249633a9fa..b2e76f34ec01 100644 --- a/Compute/src/V1/Gapic/TargetTcpProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetTcpProxiesGapicClient.php @@ -168,6 +168,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/TargetVpnGatewaysGapicClient.php b/Compute/src/V1/Gapic/TargetVpnGatewaysGapicClient.php index 44221fa37066..1d44d6ca2788 100644 --- a/Compute/src/V1/Gapic/TargetVpnGatewaysGapicClient.php +++ b/Compute/src/V1/Gapic/TargetVpnGatewaysGapicClient.php @@ -167,6 +167,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/UrlMapsGapicClient.php b/Compute/src/V1/Gapic/UrlMapsGapicClient.php index ef967b8ea33c..6ae3a001a96d 100644 --- a/Compute/src/V1/Gapic/UrlMapsGapicClient.php +++ b/Compute/src/V1/Gapic/UrlMapsGapicClient.php @@ -171,6 +171,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/VpnGatewaysGapicClient.php b/Compute/src/V1/Gapic/VpnGatewaysGapicClient.php index 9a03f8fc1ab4..94b7c418f9af 100644 --- a/Compute/src/V1/Gapic/VpnGatewaysGapicClient.php +++ b/Compute/src/V1/Gapic/VpnGatewaysGapicClient.php @@ -172,6 +172,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/Gapic/VpnTunnelsGapicClient.php b/Compute/src/V1/Gapic/VpnTunnelsGapicClient.php index ed3057ab32e4..51f56846d73c 100644 --- a/Compute/src/V1/Gapic/VpnTunnelsGapicClient.php +++ b/Compute/src/V1/Gapic/VpnTunnelsGapicClient.php @@ -167,6 +167,9 @@ private function getDefaultOperationDescriptor() 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ]; } diff --git a/Compute/src/V1/HTTP2HealthCheck.php b/Compute/src/V1/HTTP2HealthCheck.php index 514bede2137b..d69cf3a5286b 100644 --- a/Compute/src/V1/HTTP2HealthCheck.php +++ b/Compute/src/V1/HTTP2HealthCheck.php @@ -47,7 +47,7 @@ class HTTP2HealthCheck extends \Google\Protobuf\Internal\Message */ private $proxy_header = null; /** - * The request path of the HTTP/2 health check request. The default value is /. + * The request path of the HTTP/2 health check request. The default value is /. Must comply with RFC3986. * * Generated from protobuf field optional string request_path = 229403605; */ @@ -78,7 +78,7 @@ class HTTP2HealthCheck extends \Google\Protobuf\Internal\Message * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. * Check the ProxyHeader enum for the list of possible values. * @type string $request_path - * The request path of the HTTP/2 health check request. The default value is /. + * The request path of the HTTP/2 health check request. The default value is /. Must comply with RFC3986. * @type string $response * Creates a content-based HTTP/2 health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http * } @@ -273,7 +273,7 @@ public function setProxyHeader($var) } /** - * The request path of the HTTP/2 health check request. The default value is /. + * The request path of the HTTP/2 health check request. The default value is /. Must comply with RFC3986. * * Generated from protobuf field optional string request_path = 229403605; * @return string @@ -294,7 +294,7 @@ public function clearRequestPath() } /** - * The request path of the HTTP/2 health check request. The default value is /. + * The request path of the HTTP/2 health check request. The default value is /. Must comply with RFC3986. * * Generated from protobuf field optional string request_path = 229403605; * @param string $var diff --git a/Compute/src/V1/HTTPHealthCheck.php b/Compute/src/V1/HTTPHealthCheck.php index f6ab5276d172..e84764b88d43 100644 --- a/Compute/src/V1/HTTPHealthCheck.php +++ b/Compute/src/V1/HTTPHealthCheck.php @@ -47,7 +47,7 @@ class HTTPHealthCheck extends \Google\Protobuf\Internal\Message */ private $proxy_header = null; /** - * The request path of the HTTP health check request. The default value is /. + * The request path of the HTTP health check request. The default value is /. Must comply with RFC3986. * * Generated from protobuf field optional string request_path = 229403605; */ @@ -78,7 +78,7 @@ class HTTPHealthCheck extends \Google\Protobuf\Internal\Message * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. * Check the ProxyHeader enum for the list of possible values. * @type string $request_path - * The request path of the HTTP health check request. The default value is /. + * The request path of the HTTP health check request. The default value is /. Must comply with RFC3986. * @type string $response * Creates a content-based HTTP health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http * } @@ -273,7 +273,7 @@ public function setProxyHeader($var) } /** - * The request path of the HTTP health check request. The default value is /. + * The request path of the HTTP health check request. The default value is /. Must comply with RFC3986. * * Generated from protobuf field optional string request_path = 229403605; * @return string @@ -294,7 +294,7 @@ public function clearRequestPath() } /** - * The request path of the HTTP health check request. The default value is /. + * The request path of the HTTP health check request. The default value is /. Must comply with RFC3986. * * Generated from protobuf field optional string request_path = 229403605; * @param string $var diff --git a/Compute/src/V1/HTTPSHealthCheck.php b/Compute/src/V1/HTTPSHealthCheck.php index d0eec15c9a7f..4c11a2e56dbc 100644 --- a/Compute/src/V1/HTTPSHealthCheck.php +++ b/Compute/src/V1/HTTPSHealthCheck.php @@ -47,7 +47,7 @@ class HTTPSHealthCheck extends \Google\Protobuf\Internal\Message */ private $proxy_header = null; /** - * The request path of the HTTPS health check request. The default value is /. + * The request path of the HTTPS health check request. The default value is /. Must comply with RFC3986. * * Generated from protobuf field optional string request_path = 229403605; */ @@ -78,7 +78,7 @@ class HTTPSHealthCheck extends \Google\Protobuf\Internal\Message * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. * Check the ProxyHeader enum for the list of possible values. * @type string $request_path - * The request path of the HTTPS health check request. The default value is /. + * The request path of the HTTPS health check request. The default value is /. Must comply with RFC3986. * @type string $response * Creates a content-based HTTPS health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http * } @@ -273,7 +273,7 @@ public function setProxyHeader($var) } /** - * The request path of the HTTPS health check request. The default value is /. + * The request path of the HTTPS health check request. The default value is /. Must comply with RFC3986. * * Generated from protobuf field optional string request_path = 229403605; * @return string @@ -294,7 +294,7 @@ public function clearRequestPath() } /** - * The request path of the HTTPS health check request. The default value is /. + * The request path of the HTTPS health check request. The default value is /. Must comply with RFC3986. * * Generated from protobuf field optional string request_path = 229403605; * @param string $var diff --git a/Compute/src/V1/Quota/Metric.php b/Compute/src/V1/Quota/Metric.php index d69373cdc67c..da9d1b39b1cc 100644 --- a/Compute/src/V1/Quota/Metric.php +++ b/Compute/src/V1/Quota/Metric.php @@ -663,6 +663,10 @@ class Metric * Generated from protobuf enum URL_MAPS = 378660743; */ const URL_MAPS = 378660743; + /** + * Generated from protobuf enum VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES = 128400161; + */ + const VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES = 128400161; /** * Generated from protobuf enum VPN_GATEWAYS = 35620282; */ @@ -838,6 +842,7 @@ class Metric self::TPU_LITE_PODSLICE_V5 => 'TPU_LITE_PODSLICE_V5', self::TPU_PODSLICE_V4 => 'TPU_PODSLICE_V4', self::URL_MAPS => 'URL_MAPS', + self::VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES => 'VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES', self::VPN_GATEWAYS => 'VPN_GATEWAYS', self::VPN_TUNNELS => 'VPN_TUNNELS', self::XPN_SERVICE_PROJECTS => 'XPN_SERVICE_PROJECTS', diff --git a/Compute/src/V1/SnapshotSettingsStorageLocationSettings.php b/Compute/src/V1/SnapshotSettingsStorageLocationSettings.php index 299ced29ddc6..49f29bb769f9 100644 --- a/Compute/src/V1/SnapshotSettingsStorageLocationSettings.php +++ b/Compute/src/V1/SnapshotSettingsStorageLocationSettings.php @@ -15,7 +15,7 @@ class SnapshotSettingsStorageLocationSettings extends \Google\Protobuf\Internal\Message { /** - * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations. + * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are Cloud Storage bucket locations. Only one location can be specified. * * Generated from protobuf field map locations = 413423454; */ @@ -35,7 +35,7 @@ class SnapshotSettingsStorageLocationSettings extends \Google\Protobuf\Internal\ * Optional. Data for populating the Message object. * * @type array|\Google\Protobuf\Internal\MapField $locations - * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations. + * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are Cloud Storage bucket locations. Only one location can be specified. * @type string $policy * The chosen location policy. * Check the Policy enum for the list of possible values. @@ -47,7 +47,7 @@ public function __construct($data = NULL) { } /** - * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations. + * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are Cloud Storage bucket locations. Only one location can be specified. * * Generated from protobuf field map locations = 413423454; * @return \Google\Protobuf\Internal\MapField @@ -58,7 +58,7 @@ public function getLocations() } /** - * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations. + * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are Cloud Storage bucket locations. Only one location can be specified. * * Generated from protobuf field map locations = 413423454; * @param array|\Google\Protobuf\Internal\MapField $var diff --git a/Compute/src/V1/SnapshotSettingsStorageLocationSettings/Policy.php b/Compute/src/V1/SnapshotSettingsStorageLocationSettings/Policy.php index 670867f834a2..3235b9efc754 100644 --- a/Compute/src/V1/SnapshotSettingsStorageLocationSettings/Policy.php +++ b/Compute/src/V1/SnapshotSettingsStorageLocationSettings/Policy.php @@ -26,7 +26,7 @@ class Policy */ const LOCAL_REGION = 403535464; /** - * Store snapshot to the nearest multi region GCS bucket, relative to the originating disk. No additional parameters are needed. + * Store snapshot in the nearest multi region Cloud Storage bucket, relative to the originating disk. No additional parameters are needed. * * Generated from protobuf enum NEAREST_MULTI_REGION = 212467515; */ diff --git a/Compute/src/V1/SnapshotSettingsStorageLocationSettingsStorageLocationPreference.php b/Compute/src/V1/SnapshotSettingsStorageLocationSettingsStorageLocationPreference.php index 329a40fd915e..b427ce2d026a 100644 --- a/Compute/src/V1/SnapshotSettingsStorageLocationSettingsStorageLocationPreference.php +++ b/Compute/src/V1/SnapshotSettingsStorageLocationSettingsStorageLocationPreference.php @@ -16,7 +16,7 @@ class SnapshotSettingsStorageLocationSettingsStorageLocationPreference extends \Google\Protobuf\Internal\Message { /** - * Name of the location. It should be one of the GCS buckets. + * Name of the location. It should be one of the Cloud Storage buckets. Only one location can be specified. * * Generated from protobuf field optional string name = 3373707; */ @@ -29,7 +29,7 @@ class SnapshotSettingsStorageLocationSettingsStorageLocationPreference extends \ * Optional. Data for populating the Message object. * * @type string $name - * Name of the location. It should be one of the GCS buckets. + * Name of the location. It should be one of the Cloud Storage buckets. Only one location can be specified. * } */ public function __construct($data = NULL) { @@ -38,7 +38,7 @@ public function __construct($data = NULL) { } /** - * Name of the location. It should be one of the GCS buckets. + * Name of the location. It should be one of the Cloud Storage buckets. Only one location can be specified. * * Generated from protobuf field optional string name = 3373707; * @return string @@ -59,7 +59,7 @@ public function clearName() } /** - * Name of the location. It should be one of the GCS buckets. + * Name of the location. It should be one of the Cloud Storage buckets. Only one location can be specified. * * Generated from protobuf field optional string name = 3373707; * @param string $var diff --git a/Compute/src/V1/resources/addresses_descriptor_config.php b/Compute/src/V1/resources/addresses_descriptor_config.php index cf895a421fd7..770b9fb89555 100644 --- a/Compute/src/V1/resources/addresses_descriptor_config.php +++ b/Compute/src/V1/resources/addresses_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/autoscalers_descriptor_config.php b/Compute/src/V1/resources/autoscalers_descriptor_config.php index 30caf9dea66b..23d5073171c9 100644 --- a/Compute/src/V1/resources/autoscalers_descriptor_config.php +++ b/Compute/src/V1/resources/autoscalers_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -139,6 +148,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/backend_buckets_descriptor_config.php b/Compute/src/V1/resources/backend_buckets_descriptor_config.php index 9237c8896ade..59279f0d4a76 100644 --- a/Compute/src/V1/resources/backend_buckets_descriptor_config.php +++ b/Compute/src/V1/resources/backend_buckets_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -98,6 +104,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -129,6 +138,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -185,6 +200,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -216,6 +234,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/backend_services_descriptor_config.php b/Compute/src/V1/resources/backend_services_descriptor_config.php index 8db30677d7df..7d65359274b6 100644 --- a/Compute/src/V1/resources/backend_services_descriptor_config.php +++ b/Compute/src/V1/resources/backend_services_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -98,6 +104,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -129,6 +138,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -185,6 +200,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -216,6 +234,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -247,6 +268,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/disks_descriptor_config.php b/Compute/src/V1/resources/disks_descriptor_config.php index c2fc76cfa137..fc3ca3530192 100644 --- a/Compute/src/V1/resources/disks_descriptor_config.php +++ b/Compute/src/V1/resources/disks_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -215,6 +230,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -253,6 +271,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -291,6 +312,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -329,6 +353,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -367,6 +394,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -405,6 +435,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -437,6 +470,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/external_vpn_gateways_descriptor_config.php b/Compute/src/V1/resources/external_vpn_gateways_descriptor_config.php index 3bd841dcee34..a14c455bc34a 100644 --- a/Compute/src/V1/resources/external_vpn_gateways_descriptor_config.php +++ b/Compute/src/V1/resources/external_vpn_gateways_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/firewall_policies_descriptor_config.php b/Compute/src/V1/resources/firewall_policies_descriptor_config.php index 92a75582f239..aaaf945f35a5 100644 --- a/Compute/src/V1/resources/firewall_policies_descriptor_config.php +++ b/Compute/src/V1/resources/firewall_policies_descriptor_config.php @@ -34,6 +34,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -57,6 +60,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -80,6 +86,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -103,6 +112,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -126,6 +138,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -141,6 +156,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -164,6 +182,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -187,6 +208,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -210,6 +234,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -233,6 +260,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/firewalls_descriptor_config.php b/Compute/src/V1/resources/firewalls_descriptor_config.php index 14eacf72717c..4af7d11e0bfe 100644 --- a/Compute/src/V1/resources/firewalls_descriptor_config.php +++ b/Compute/src/V1/resources/firewalls_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/forwarding_rules_descriptor_config.php b/Compute/src/V1/resources/forwarding_rules_descriptor_config.php index a23f06fb52d6..4a9f264a3a97 100644 --- a/Compute/src/V1/resources/forwarding_rules_descriptor_config.php +++ b/Compute/src/V1/resources/forwarding_rules_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/global_addresses_descriptor_config.php b/Compute/src/V1/resources/global_addresses_descriptor_config.php index 916970994782..72a77f6a669f 100644 --- a/Compute/src/V1/resources/global_addresses_descriptor_config.php +++ b/Compute/src/V1/resources/global_addresses_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/global_forwarding_rules_descriptor_config.php b/Compute/src/V1/resources/global_forwarding_rules_descriptor_config.php index 54ef535e9a3f..724058404fe7 100644 --- a/Compute/src/V1/resources/global_forwarding_rules_descriptor_config.php +++ b/Compute/src/V1/resources/global_forwarding_rules_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/global_network_endpoint_groups_descriptor_config.php b/Compute/src/V1/resources/global_network_endpoint_groups_descriptor_config.php index 372207bde932..130d7819d751 100644 --- a/Compute/src/V1/resources/global_network_endpoint_groups_descriptor_config.php +++ b/Compute/src/V1/resources/global_network_endpoint_groups_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -98,6 +104,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -129,6 +138,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/global_public_delegated_prefixes_descriptor_config.php b/Compute/src/V1/resources/global_public_delegated_prefixes_descriptor_config.php index cf495d4a42c9..f78135a5ee81 100644 --- a/Compute/src/V1/resources/global_public_delegated_prefixes_descriptor_config.php +++ b/Compute/src/V1/resources/global_public_delegated_prefixes_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/health_checks_descriptor_config.php b/Compute/src/V1/resources/health_checks_descriptor_config.php index e46c9fe2f1d3..a0fd850e2053 100644 --- a/Compute/src/V1/resources/health_checks_descriptor_config.php +++ b/Compute/src/V1/resources/health_checks_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/images_descriptor_config.php b/Compute/src/V1/resources/images_descriptor_config.php index 09907c4e560c..9708adbf2d3c 100644 --- a/Compute/src/V1/resources/images_descriptor_config.php +++ b/Compute/src/V1/resources/images_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -98,6 +104,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/instance_group_manager_resize_requests_descriptor_config.php b/Compute/src/V1/resources/instance_group_manager_resize_requests_descriptor_config.php index 9ce287748ff4..4e85142dbebd 100644 --- a/Compute/src/V1/resources/instance_group_manager_resize_requests_descriptor_config.php +++ b/Compute/src/V1/resources/instance_group_manager_resize_requests_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -81,6 +84,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -125,6 +131,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/instance_group_managers_descriptor_config.php b/Compute/src/V1/resources/instance_group_managers_descriptor_config.php index 686b12da840d..33fc55d40ac4 100644 --- a/Compute/src/V1/resources/instance_group_managers_descriptor_config.php +++ b/Compute/src/V1/resources/instance_group_managers_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -151,6 +160,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -189,6 +201,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -227,6 +242,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -265,6 +283,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -297,6 +318,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -335,6 +359,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -373,6 +400,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -411,6 +441,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -449,6 +482,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -487,6 +523,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -525,6 +564,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/instance_groups_descriptor_config.php b/Compute/src/V1/resources/instance_groups_descriptor_config.php index 622893f89b23..4971e26329c1 100644 --- a/Compute/src/V1/resources/instance_groups_descriptor_config.php +++ b/Compute/src/V1/resources/instance_groups_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/instance_settings_service_descriptor_config.php b/Compute/src/V1/resources/instance_settings_service_descriptor_config.php index cae400c3f45a..3b1b2ec098d5 100644 --- a/Compute/src/V1/resources/instance_settings_service_descriptor_config.php +++ b/Compute/src/V1/resources/instance_settings_service_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/instance_templates_descriptor_config.php b/Compute/src/V1/resources/instance_templates_descriptor_config.php index 0eb625709786..d20cb8a9da62 100644 --- a/Compute/src/V1/resources/instance_templates_descriptor_config.php +++ b/Compute/src/V1/resources/instance_templates_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/instances_descriptor_config.php b/Compute/src/V1/resources/instances_descriptor_config.php index 5e27cabd0e41..de73c3da9eb1 100644 --- a/Compute/src/V1/resources/instances_descriptor_config.php +++ b/Compute/src/V1/resources/instances_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -151,6 +160,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -221,6 +236,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -259,6 +277,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -297,6 +318,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -329,6 +353,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -367,6 +394,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -405,6 +435,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -443,6 +476,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -481,6 +517,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -519,6 +558,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -557,6 +599,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -595,6 +640,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -633,6 +681,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -671,6 +722,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -709,6 +763,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -747,6 +804,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -785,6 +845,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -823,6 +886,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -861,6 +927,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -899,6 +968,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -937,6 +1009,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -975,6 +1050,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -1013,6 +1091,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -1051,6 +1132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -1089,6 +1173,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -1127,6 +1214,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -1165,6 +1255,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -1203,6 +1296,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -1241,6 +1337,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -1279,6 +1378,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -1317,6 +1419,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/instant_snapshots_descriptor_config.php b/Compute/src/V1/resources/instant_snapshots_descriptor_config.php index 5c5bfc230eef..001b345b90c5 100644 --- a/Compute/src/V1/resources/instant_snapshots_descriptor_config.php +++ b/Compute/src/V1/resources/instant_snapshots_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/interconnect_attachments_descriptor_config.php b/Compute/src/V1/resources/interconnect_attachments_descriptor_config.php index 4f59112fa0ec..a14d1e3b3c4e 100644 --- a/Compute/src/V1/resources/interconnect_attachments_descriptor_config.php +++ b/Compute/src/V1/resources/interconnect_attachments_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/interconnects_descriptor_config.php b/Compute/src/V1/resources/interconnects_descriptor_config.php index 6b82b8b622dc..f44a2fd970d2 100644 --- a/Compute/src/V1/resources/interconnects_descriptor_config.php +++ b/Compute/src/V1/resources/interconnects_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/licenses_descriptor_config.php b/Compute/src/V1/resources/licenses_descriptor_config.php index d988b8f7417a..a20691939db9 100644 --- a/Compute/src/V1/resources/licenses_descriptor_config.php +++ b/Compute/src/V1/resources/licenses_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/machine_images_descriptor_config.php b/Compute/src/V1/resources/machine_images_descriptor_config.php index df87e80c4b78..e19f7bc45e45 100644 --- a/Compute/src/V1/resources/machine_images_descriptor_config.php +++ b/Compute/src/V1/resources/machine_images_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/network_attachments_descriptor_config.php b/Compute/src/V1/resources/network_attachments_descriptor_config.php index 2c2982395377..314008e1bd10 100644 --- a/Compute/src/V1/resources/network_attachments_descriptor_config.php +++ b/Compute/src/V1/resources/network_attachments_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/network_edge_security_services_descriptor_config.php b/Compute/src/V1/resources/network_edge_security_services_descriptor_config.php index 66671178a7d4..8ec1dc25a869 100644 --- a/Compute/src/V1/resources/network_edge_security_services_descriptor_config.php +++ b/Compute/src/V1/resources/network_edge_security_services_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/network_endpoint_groups_descriptor_config.php b/Compute/src/V1/resources/network_endpoint_groups_descriptor_config.php index 437a3994dd91..35c568f36371 100644 --- a/Compute/src/V1/resources/network_endpoint_groups_descriptor_config.php +++ b/Compute/src/V1/resources/network_endpoint_groups_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -151,6 +160,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/network_firewall_policies_descriptor_config.php b/Compute/src/V1/resources/network_firewall_policies_descriptor_config.php index 03212e133d1e..9e42e56c0426 100644 --- a/Compute/src/V1/resources/network_firewall_policies_descriptor_config.php +++ b/Compute/src/V1/resources/network_firewall_policies_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -98,6 +104,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -129,6 +138,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -160,6 +172,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -185,6 +200,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -216,6 +234,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -247,6 +268,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -278,6 +302,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/networks_descriptor_config.php b/Compute/src/V1/resources/networks_descriptor_config.php index 6e6526774c45..ed750c089341 100644 --- a/Compute/src/V1/resources/networks_descriptor_config.php +++ b/Compute/src/V1/resources/networks_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -98,6 +104,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -185,6 +200,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -216,6 +234,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/node_groups_descriptor_config.php b/Compute/src/V1/resources/node_groups_descriptor_config.php index 67f298062854..31aa831596c4 100644 --- a/Compute/src/V1/resources/node_groups_descriptor_config.php +++ b/Compute/src/V1/resources/node_groups_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -151,6 +160,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -221,6 +236,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -259,6 +277,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -297,6 +318,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/node_templates_descriptor_config.php b/Compute/src/V1/resources/node_templates_descriptor_config.php index aada90a1d2bd..7b35cdfe1204 100644 --- a/Compute/src/V1/resources/node_templates_descriptor_config.php +++ b/Compute/src/V1/resources/node_templates_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/packet_mirrorings_descriptor_config.php b/Compute/src/V1/resources/packet_mirrorings_descriptor_config.php index 8e5276480ae2..119da9930576 100644 --- a/Compute/src/V1/resources/packet_mirrorings_descriptor_config.php +++ b/Compute/src/V1/resources/packet_mirrorings_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/projects_descriptor_config.php b/Compute/src/V1/resources/projects_descriptor_config.php index e2efb3491193..b2c2dd588fc4 100644 --- a/Compute/src/V1/resources/projects_descriptor_config.php +++ b/Compute/src/V1/resources/projects_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -61,6 +64,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -86,6 +92,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -111,6 +120,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -136,6 +148,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -161,6 +176,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -186,6 +204,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -211,6 +232,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -236,6 +260,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -261,6 +288,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/public_advertised_prefixes_descriptor_config.php b/Compute/src/V1/resources/public_advertised_prefixes_descriptor_config.php index 4d238b93cd73..3a29eaa67167 100644 --- a/Compute/src/V1/resources/public_advertised_prefixes_descriptor_config.php +++ b/Compute/src/V1/resources/public_advertised_prefixes_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -98,6 +104,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/public_delegated_prefixes_descriptor_config.php b/Compute/src/V1/resources/public_delegated_prefixes_descriptor_config.php index 9aa9e516d86b..6c885df5ceff 100644 --- a/Compute/src/V1/resources/public_delegated_prefixes_descriptor_config.php +++ b/Compute/src/V1/resources/public_delegated_prefixes_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_autoscalers_descriptor_config.php b/Compute/src/V1/resources/region_autoscalers_descriptor_config.php index 9e56a76ba767..8bcae074d7eb 100644 --- a/Compute/src/V1/resources/region_autoscalers_descriptor_config.php +++ b/Compute/src/V1/resources/region_autoscalers_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -139,6 +148,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_backend_services_descriptor_config.php b/Compute/src/V1/resources/region_backend_services_descriptor_config.php index 8cf59faa6aa7..73f393fbaf28 100644 --- a/Compute/src/V1/resources/region_backend_services_descriptor_config.php +++ b/Compute/src/V1/resources/region_backend_services_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_commitments_descriptor_config.php b/Compute/src/V1/resources/region_commitments_descriptor_config.php index d301f8eaa33c..c29f72994964 100644 --- a/Compute/src/V1/resources/region_commitments_descriptor_config.php +++ b/Compute/src/V1/resources/region_commitments_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -69,6 +72,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_disks_descriptor_config.php b/Compute/src/V1/resources/region_disks_descriptor_config.php index 0e2e95ba6b3a..876f682e86d7 100644 --- a/Compute/src/V1/resources/region_disks_descriptor_config.php +++ b/Compute/src/V1/resources/region_disks_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -215,6 +230,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -253,6 +271,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -291,6 +312,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -329,6 +353,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -367,6 +394,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -405,6 +435,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -437,6 +470,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_health_check_services_descriptor_config.php b/Compute/src/V1/resources/region_health_check_services_descriptor_config.php index 06e06df7d0b7..3462ddb4e619 100644 --- a/Compute/src/V1/resources/region_health_check_services_descriptor_config.php +++ b/Compute/src/V1/resources/region_health_check_services_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_health_checks_descriptor_config.php b/Compute/src/V1/resources/region_health_checks_descriptor_config.php index 8c4c1fdd3d13..889a9bc7f3e1 100644 --- a/Compute/src/V1/resources/region_health_checks_descriptor_config.php +++ b/Compute/src/V1/resources/region_health_checks_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_instance_group_managers_descriptor_config.php b/Compute/src/V1/resources/region_instance_group_managers_descriptor_config.php index ffbe58f22d12..058ebada3bf1 100644 --- a/Compute/src/V1/resources/region_instance_group_managers_descriptor_config.php +++ b/Compute/src/V1/resources/region_instance_group_managers_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -151,6 +160,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -189,6 +201,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -227,6 +242,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -265,6 +283,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -297,6 +318,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -335,6 +359,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -373,6 +400,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -411,6 +441,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -449,6 +482,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -487,6 +523,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -525,6 +564,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_instance_groups_descriptor_config.php b/Compute/src/V1/resources/region_instance_groups_descriptor_config.php index 5af30f171591..54377f6ec294 100644 --- a/Compute/src/V1/resources/region_instance_groups_descriptor_config.php +++ b/Compute/src/V1/resources/region_instance_groups_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_instance_templates_descriptor_config.php b/Compute/src/V1/resources/region_instance_templates_descriptor_config.php index 41b569be292c..28b4c2fe5034 100644 --- a/Compute/src/V1/resources/region_instance_templates_descriptor_config.php +++ b/Compute/src/V1/resources/region_instance_templates_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_instances_descriptor_config.php b/Compute/src/V1/resources/region_instances_descriptor_config.php index 55eb355aa382..14cb3a0cca34 100644 --- a/Compute/src/V1/resources/region_instances_descriptor_config.php +++ b/Compute/src/V1/resources/region_instances_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_instant_snapshots_descriptor_config.php b/Compute/src/V1/resources/region_instant_snapshots_descriptor_config.php index f5acc7ccfd38..99cd88b469a9 100644 --- a/Compute/src/V1/resources/region_instant_snapshots_descriptor_config.php +++ b/Compute/src/V1/resources/region_instant_snapshots_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_network_endpoint_groups_descriptor_config.php b/Compute/src/V1/resources/region_network_endpoint_groups_descriptor_config.php index 48a384a5e3ee..0b3fe884695a 100644 --- a/Compute/src/V1/resources/region_network_endpoint_groups_descriptor_config.php +++ b/Compute/src/V1/resources/region_network_endpoint_groups_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -151,6 +160,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_network_firewall_policies_descriptor_config.php b/Compute/src/V1/resources/region_network_firewall_policies_descriptor_config.php index b81470041d5f..4ba5f1a4f437 100644 --- a/Compute/src/V1/resources/region_network_firewall_policies_descriptor_config.php +++ b/Compute/src/V1/resources/region_network_firewall_policies_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -151,6 +160,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -189,6 +201,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -221,6 +236,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -259,6 +277,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -297,6 +318,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -335,6 +359,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_notification_endpoints_descriptor_config.php b/Compute/src/V1/resources/region_notification_endpoints_descriptor_config.php index a89277a203c8..561ebd7d00b8 100644 --- a/Compute/src/V1/resources/region_notification_endpoints_descriptor_config.php +++ b/Compute/src/V1/resources/region_notification_endpoints_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_security_policies_descriptor_config.php b/Compute/src/V1/resources/region_security_policies_descriptor_config.php index 86b26739f51b..cc87fae1d103 100644 --- a/Compute/src/V1/resources/region_security_policies_descriptor_config.php +++ b/Compute/src/V1/resources/region_security_policies_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -221,6 +236,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_ssl_certificates_descriptor_config.php b/Compute/src/V1/resources/region_ssl_certificates_descriptor_config.php index 05d610ccb8d5..27ff6d120dcd 100644 --- a/Compute/src/V1/resources/region_ssl_certificates_descriptor_config.php +++ b/Compute/src/V1/resources/region_ssl_certificates_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_ssl_policies_descriptor_config.php b/Compute/src/V1/resources/region_ssl_policies_descriptor_config.php index d724a43f0c70..eed895c8ca94 100644 --- a/Compute/src/V1/resources/region_ssl_policies_descriptor_config.php +++ b/Compute/src/V1/resources/region_ssl_policies_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_target_http_proxies_descriptor_config.php b/Compute/src/V1/resources/region_target_http_proxies_descriptor_config.php index 45894ab5584a..1386c983a7b8 100644 --- a/Compute/src/V1/resources/region_target_http_proxies_descriptor_config.php +++ b/Compute/src/V1/resources/region_target_http_proxies_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_target_https_proxies_descriptor_config.php b/Compute/src/V1/resources/region_target_https_proxies_descriptor_config.php index 7c892dab8056..a06fb9935fbd 100644 --- a/Compute/src/V1/resources/region_target_https_proxies_descriptor_config.php +++ b/Compute/src/V1/resources/region_target_https_proxies_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_target_tcp_proxies_descriptor_config.php b/Compute/src/V1/resources/region_target_tcp_proxies_descriptor_config.php index b8dc8befd70a..c2711f770616 100644 --- a/Compute/src/V1/resources/region_target_tcp_proxies_descriptor_config.php +++ b/Compute/src/V1/resources/region_target_tcp_proxies_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/region_url_maps_descriptor_config.php b/Compute/src/V1/resources/region_url_maps_descriptor_config.php index 8859e43452ef..c458fcc1915b 100644 --- a/Compute/src/V1/resources/region_url_maps_descriptor_config.php +++ b/Compute/src/V1/resources/region_url_maps_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/reservations_descriptor_config.php b/Compute/src/V1/resources/reservations_descriptor_config.php index d9e947351539..85d670ccae7d 100644 --- a/Compute/src/V1/resources/reservations_descriptor_config.php +++ b/Compute/src/V1/resources/reservations_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/resource_policies_descriptor_config.php b/Compute/src/V1/resources/resource_policies_descriptor_config.php index 2ca924d67c27..2abd5f7285cc 100644 --- a/Compute/src/V1/resources/resource_policies_descriptor_config.php +++ b/Compute/src/V1/resources/resource_policies_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/routers_descriptor_config.php b/Compute/src/V1/resources/routers_descriptor_config.php index 25bc2008eb2b..4ec0c414cfab 100644 --- a/Compute/src/V1/resources/routers_descriptor_config.php +++ b/Compute/src/V1/resources/routers_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/routes_descriptor_config.php b/Compute/src/V1/resources/routes_descriptor_config.php index 3178689ce144..c097a74408e9 100644 --- a/Compute/src/V1/resources/routes_descriptor_config.php +++ b/Compute/src/V1/resources/routes_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/security_policies_descriptor_config.php b/Compute/src/V1/resources/security_policies_descriptor_config.php index 46e5ff1db4a0..d105487f6450 100644 --- a/Compute/src/V1/resources/security_policies_descriptor_config.php +++ b/Compute/src/V1/resources/security_policies_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -98,6 +104,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -185,6 +200,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -216,6 +234,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/service_attachments_descriptor_config.php b/Compute/src/V1/resources/service_attachments_descriptor_config.php index f5c3cb903abb..b48c6847b5c7 100644 --- a/Compute/src/V1/resources/service_attachments_descriptor_config.php +++ b/Compute/src/V1/resources/service_attachments_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/snapshot_settings_service_descriptor_config.php b/Compute/src/V1/resources/snapshot_settings_service_descriptor_config.php index 324adf409a87..7e19b14c49cb 100644 --- a/Compute/src/V1/resources/snapshot_settings_service_descriptor_config.php +++ b/Compute/src/V1/resources/snapshot_settings_service_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/snapshots_descriptor_config.php b/Compute/src/V1/resources/snapshots_descriptor_config.php index c101c42e1240..26efa8ddb4a0 100644 --- a/Compute/src/V1/resources/snapshots_descriptor_config.php +++ b/Compute/src/V1/resources/snapshots_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/ssl_certificates_descriptor_config.php b/Compute/src/V1/resources/ssl_certificates_descriptor_config.php index 0d7a08d10736..f242d93b154a 100644 --- a/Compute/src/V1/resources/ssl_certificates_descriptor_config.php +++ b/Compute/src/V1/resources/ssl_certificates_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/ssl_policies_descriptor_config.php b/Compute/src/V1/resources/ssl_policies_descriptor_config.php index 69792fd30a86..4bc452fdb8bc 100644 --- a/Compute/src/V1/resources/ssl_policies_descriptor_config.php +++ b/Compute/src/V1/resources/ssl_policies_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/storage_pools_descriptor_config.php b/Compute/src/V1/resources/storage_pools_descriptor_config.php index b7262f08f7d9..db8772bff3b1 100644 --- a/Compute/src/V1/resources/storage_pools_descriptor_config.php +++ b/Compute/src/V1/resources/storage_pools_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/subnetworks_descriptor_config.php b/Compute/src/V1/resources/subnetworks_descriptor_config.php index f78e4e18f1db..4779c99369ac 100644 --- a/Compute/src/V1/resources/subnetworks_descriptor_config.php +++ b/Compute/src/V1/resources/subnetworks_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -145,6 +154,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/target_grpc_proxies_descriptor_config.php b/Compute/src/V1/resources/target_grpc_proxies_descriptor_config.php index 254183f84e52..572c7b9826c1 100644 --- a/Compute/src/V1/resources/target_grpc_proxies_descriptor_config.php +++ b/Compute/src/V1/resources/target_grpc_proxies_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/target_http_proxies_descriptor_config.php b/Compute/src/V1/resources/target_http_proxies_descriptor_config.php index cf0edd6501da..f262f3a1ad71 100644 --- a/Compute/src/V1/resources/target_http_proxies_descriptor_config.php +++ b/Compute/src/V1/resources/target_http_proxies_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/target_https_proxies_descriptor_config.php b/Compute/src/V1/resources/target_https_proxies_descriptor_config.php index 8e90fe47911b..c41c2bff80e8 100644 --- a/Compute/src/V1/resources/target_https_proxies_descriptor_config.php +++ b/Compute/src/V1/resources/target_https_proxies_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -185,6 +200,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -216,6 +234,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -247,6 +268,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/target_instances_descriptor_config.php b/Compute/src/V1/resources/target_instances_descriptor_config.php index fb28638269c3..e660a2d8fff9 100644 --- a/Compute/src/V1/resources/target_instances_descriptor_config.php +++ b/Compute/src/V1/resources/target_instances_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/target_pools_descriptor_config.php b/Compute/src/V1/resources/target_pools_descriptor_config.php index 223636d00cc1..0d2f84c88b9f 100644 --- a/Compute/src/V1/resources/target_pools_descriptor_config.php +++ b/Compute/src/V1/resources/target_pools_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -113,6 +119,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -151,6 +160,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -183,6 +195,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -221,6 +236,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -259,6 +277,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -297,6 +318,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/target_ssl_proxies_descriptor_config.php b/Compute/src/V1/resources/target_ssl_proxies_descriptor_config.php index c4e8dbaa6f77..8675cbb00e7b 100644 --- a/Compute/src/V1/resources/target_ssl_proxies_descriptor_config.php +++ b/Compute/src/V1/resources/target_ssl_proxies_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -185,6 +200,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -216,6 +234,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/target_tcp_proxies_descriptor_config.php b/Compute/src/V1/resources/target_tcp_proxies_descriptor_config.php index 9464ee53f3d4..16a5ca2e702e 100644 --- a/Compute/src/V1/resources/target_tcp_proxies_descriptor_config.php +++ b/Compute/src/V1/resources/target_tcp_proxies_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/target_vpn_gateways_descriptor_config.php b/Compute/src/V1/resources/target_vpn_gateways_descriptor_config.php index 7285dc4c336d..e144f721f311 100644 --- a/Compute/src/V1/resources/target_vpn_gateways_descriptor_config.php +++ b/Compute/src/V1/resources/target_vpn_gateways_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/url_maps_descriptor_config.php b/Compute/src/V1/resources/url_maps_descriptor_config.php index 307ae7b17e48..979eaf979d89 100644 --- a/Compute/src/V1/resources/url_maps_descriptor_config.php +++ b/Compute/src/V1/resources/url_maps_descriptor_config.php @@ -36,6 +36,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -67,6 +70,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -92,6 +98,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -123,6 +132,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -154,6 +166,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/vpn_gateways_descriptor_config.php b/Compute/src/V1/resources/vpn_gateways_descriptor_config.php index 18b6b1fd11a6..a6db1e9d8370 100644 --- a/Compute/src/V1/resources/vpn_gateways_descriptor_config.php +++ b/Compute/src/V1/resources/vpn_gateways_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/Compute/src/V1/resources/vpn_tunnels_descriptor_config.php b/Compute/src/V1/resources/vpn_tunnels_descriptor_config.php index 738677fc5452..a9b34aff641b 100644 --- a/Compute/src/V1/resources/vpn_tunnels_descriptor_config.php +++ b/Compute/src/V1/resources/vpn_tunnels_descriptor_config.php @@ -37,6 +37,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -75,6 +78,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, @@ -107,6 +113,9 @@ 'operationNameMethod' => 'getName', 'operationStatusMethod' => 'getStatus', 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', ], 'responseType' => 'Google\Cloud\Compute\V1\Operation', 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, diff --git a/ConfidentialComputing/.repo-metadata.json b/ConfidentialComputing/.repo-metadata.json deleted file mode 100644 index c822b09407aa..000000000000 --- a/ConfidentialComputing/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-confidentialcomputing", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-confidentialcomputing/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "confidentialcomputing" -} diff --git a/ConfidentialComputing/VERSION b/ConfidentialComputing/VERSION index 6f4eebdf6f68..ee94dd834b53 100644 --- a/ConfidentialComputing/VERSION +++ b/ConfidentialComputing/VERSION @@ -1 +1 @@ -0.8.1 +0.8.3 diff --git a/ConfidentialComputing/composer.json b/ConfidentialComputing/composer.json index dbc6eeeb4f18..583eaa30e409 100644 --- a/ConfidentialComputing/composer.json +++ b/ConfidentialComputing/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Config/.repo-metadata.json b/Config/.repo-metadata.json deleted file mode 100644 index 52969d4fe36c..000000000000 --- a/Config/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-config", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-config/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "config" -} diff --git a/Config/VERSION b/Config/VERSION index 8f0916f768f0..cb0c939a936f 100644 --- a/Config/VERSION +++ b/Config/VERSION @@ -1 +1 @@ -0.5.0 +0.5.2 diff --git a/Config/composer.json b/Config/composer.json index dd922d657dbd..e8623757e047 100644 --- a/Config/composer.json +++ b/Config/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/common-protos": " ^4.4" }, "require-dev": { diff --git a/Config/src/V1/Client/ConfigClient.php b/Config/src/V1/Client/ConfigClient.php index 1f968019050e..756c455eb237 100644 --- a/Config/src/V1/Client/ConfigClient.php +++ b/Config/src/V1/Client/ConfigClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -74,6 +73,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -197,6 +197,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a deployment * resource. diff --git a/Config/tests/Unit/V1/Client/ConfigClientTest.php b/Config/tests/Unit/V1/Client/ConfigClientTest.php index e0098efe69a6..2f456cf9ce07 100644 --- a/Config/tests/Unit/V1/Client/ConfigClientTest.php +++ b/Config/tests/Unit/V1/Client/ConfigClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Config\V1\Client\ConfigClient; @@ -73,6 +72,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/ContactCenterInsights/.repo-metadata.json b/ContactCenterInsights/.repo-metadata.json deleted file mode 100644 index 0e3708bbb6ff..000000000000 --- a/ContactCenterInsights/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-contact-center-insights", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "contactcenterinsights" -} diff --git a/ContactCenterInsights/VERSION b/ContactCenterInsights/VERSION index 77fee73a8cf9..158c74729336 100644 --- a/ContactCenterInsights/VERSION +++ b/ContactCenterInsights/VERSION @@ -1 +1 @@ -1.9.3 +1.9.5 diff --git a/ContactCenterInsights/composer.json b/ContactCenterInsights/composer.json index 575776a53a7d..05d58dbce191 100644 --- a/ContactCenterInsights/composer.json +++ b/ContactCenterInsights/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Container/.repo-metadata.json b/Container/.repo-metadata.json deleted file mode 100644 index a8ec44bd63af..000000000000 --- a/Container/.repo-metadata.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-container", - "release_level": "stable", - "codeowner_team": "@googleapis/cicd", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-container/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "container" -} diff --git a/Container/VERSION b/Container/VERSION index 7f3c3affd72c..34aae156b192 100644 --- a/Container/VERSION +++ b/Container/VERSION @@ -1 +1 @@ -1.30.1 +1.31.0 diff --git a/Container/composer.json b/Container/composer.json index 478edf1bcd0c..d775c0388796 100644 --- a/Container/composer.json +++ b/Container/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Container/metadata/V1/ClusterService.php b/Container/metadata/V1/ClusterService.php index 5b45309427cd9a9d9c3ae3f031a2ceaec5902acd..1d3d9cc9b87b5a3dee74ad52691272ca255b4110 100644 GIT binary patch delta 1709 zcmb_cU2NM_6yCL+Ho5t!bK5R%({^b$pruvS6==GFswG)Os&&w%YvE-wu6>(YYaL@d z5i9Bn45q!bOk6;#CZzQN7!sNQvre1f1s-{TN5q6+65?$V8bXtx5?njU(k$iYfj8^i z?|k2Pj?X#2U1b0Gfc>b6W412YVJ;1rmpJmQ=VB{527U8|9M+{AHU%~Ydi}$XlJMmS zx#Nyii1|YnLHtk}=rvUtH_j|83>^=m;a$d6}Rl|lN(ogDN z=qJyOL?JDv9Jg_y|DeBmuDh5vOft}(%5!kVCuyJgQgM8Ho{i61e3cGYeElL&^4V+U= z%Qz)UvW!i$Qh?J?|8RnQ91v3F8cMl?lcmILIWOU+mEPL7SQy>$oow_(hS2K(?v=4& zsdK9AXiEiaK5wYjDN)HU(gs$G`tDm136h2O)MMO5*HlA-JS6zTOg{h#U2n|3o|cw*mmEyffS0tph;)aoKrEK zza>++;EadY**Df5(EAapu)Yn!oC8GSN68l>=l3Of7!qs9>LM!1#{0n)aytGQNR!7$ zALCI7!t_(e)7i=F_*9x_i9UJ-d`I>icsqhpuvyD1SUg#n#S8QY$?k-|(b`FVQMlld zQnb`3a`nIo<}HS_99)Z_9oLp~*0ztLYo_jRG=v6nXeR2&@HH|$=ezB953UEh#$lU+ zP1T^QOy%{?>p zAajNxBg=1sY4X+bLFjX##i2BdZ?{pod|nq$sMT7O_~= zWzm%LIu_~Ll`nzdp#$b~54!!s>Q9LKhJkJ5>v!78txMD3dlKLHGKvDwn@Sv>8J~JO z%LkDkHXfNyrYF+J`H=nl#vKp%#J>IhLm_a7v~Hdx#`WFg#mfN}qd}tI=&?WF9F6=1 DEQCk% delta 278 zcmV+x0qOqxsRQ+!1F#PS0``)#5d=j60-gesSOuGt#|DG5SO>HL0i?4H3AYBb1`zN8 z15FASlOPQklM)gh6+#mV5nps@a%Ev;b6;>}a$jR_a%HoT5)B8l9UO!a0+}1Lqb=AB zlfOF0ld3x_0iKiAJG=oklSzghldwD(lh{120hN=7J(iPVK3xKi0h7T#jsqf?AG6s% znGLhOO*#PuLLv$vUz6WRAG63$Vh8~WvnyC`1e4cXn6t56FD3%|0h8i`lmSeWcZ5u{ z%!C^c0n3xoptional int64 threads_per_core = 1; */ private $threads_per_core = null; + /** + * Whether or not to enable nested virtualization (defaults to false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 2; + */ + private $enable_nested_virtualization = null; /** * Constructor. @@ -34,6 +40,8 @@ class AdvancedMachineFeatures extends \Google\Protobuf\Internal\Message * The number of threads per physical core. To disable simultaneous * multithreading (SMT) set this to 1. If unset, the maximum number of threads * supported per core by the underlying processor is assumed. + * @type bool $enable_nested_virtualization + * Whether or not to enable nested virtualization (defaults to false). * } */ public function __construct($data = NULL) { @@ -81,5 +89,41 @@ public function setThreadsPerCore($var) return $this; } + /** + * Whether or not to enable nested virtualization (defaults to false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 2; + * @return bool + */ + public function getEnableNestedVirtualization() + { + return isset($this->enable_nested_virtualization) ? $this->enable_nested_virtualization : false; + } + + public function hasEnableNestedVirtualization() + { + return isset($this->enable_nested_virtualization); + } + + public function clearEnableNestedVirtualization() + { + unset($this->enable_nested_virtualization); + } + + /** + * Whether or not to enable nested virtualization (defaults to false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 2; + * @param bool $var + * @return $this + */ + public function setEnableNestedVirtualization($var) + { + GPBUtil::checkBool($var); + $this->enable_nested_virtualization = $var; + + return $this; + } + } diff --git a/Container/src/V1/Cluster.php b/Container/src/V1/Cluster.php index d49351ecef09..21e28bdd7446 100644 --- a/Container/src/V1/Cluster.php +++ b/Container/src/V1/Cluster.php @@ -543,6 +543,18 @@ class Cluster extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.EnterpriseConfig enterprise_config = 149; */ private $enterprise_config = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 152 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $satisfies_pzs = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 153 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $satisfies_pzi = null; /** * Constructor. @@ -803,6 +815,10 @@ class Cluster extends \Google\Protobuf\Internal\Message * Beta APIs Config * @type \Google\Cloud\Container\V1\EnterpriseConfig $enterprise_config * GKE Enterprise Configuration. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. * } */ public function __construct($data = NULL) { @@ -3160,5 +3176,77 @@ public function setEnterpriseConfig($var) return $this; } + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 152 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 152 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 153 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 153 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + } diff --git a/Container/src/V1/ClusterUpdate.php b/Container/src/V1/ClusterUpdate.php index fafade884efd..293cc070cb3a 100644 --- a/Container/src/V1/ClusterUpdate.php +++ b/Container/src/V1/ClusterUpdate.php @@ -169,7 +169,12 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message */ private $desired_vertical_pod_autoscaling = null; /** - * The desired private cluster configuration. + * The desired private cluster configuration. master_global_access_config is + * the only field that can be changed via this field. + * See also + * [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint] + * for modifying other fields within + * [PrivateClusterConfig][google.container.v1.PrivateClusterConfig]. * * Generated from protobuf field .google.container.v1.PrivateClusterConfig desired_private_cluster_config = 25; */ @@ -364,6 +369,12 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.K8sBetaAPIConfig desired_k8s_beta_apis = 131; */ private $desired_k8s_beta_apis = null; + /** + * The desired containerd config for the cluster. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig desired_containerd_config = 134; + */ + private $desired_containerd_config = null; /** * Enable/Disable Multi-Networking for the cluster * @@ -389,6 +400,19 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool desired_enable_cilium_clusterwide_network_policy = 138; */ private $desired_enable_cilium_clusterwide_network_policy = null; + /** + * The desired node kubelet config for the cluster. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig desired_node_kubelet_config = 141; + */ + private $desired_node_kubelet_config = null; + /** + * The desired node kubelet config for all auto-provisioned node pools + * in autopilot clusters and node auto-provisioning enabled clusters. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig desired_node_pool_auto_config_kubelet_config = 142; + */ + private $desired_node_pool_auto_config_kubelet_config = null; /** * Constructor. @@ -472,7 +496,12 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Container\V1\VerticalPodAutoscaling $desired_vertical_pod_autoscaling * Cluster-level Vertical Pod Autoscaling configuration. * @type \Google\Cloud\Container\V1\PrivateClusterConfig $desired_private_cluster_config - * The desired private cluster configuration. + * The desired private cluster configuration. master_global_access_config is + * the only field that can be changed via this field. + * See also + * [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint] + * for modifying other fields within + * [PrivateClusterConfig][google.container.v1.PrivateClusterConfig]. * @type \Google\Cloud\Container\V1\IntraNodeVisibilityConfig $desired_intra_node_visibility_config * The desired config of Intra-node visibility. * @type \Google\Cloud\Container\V1\DefaultSnatStatus $desired_default_snat_status @@ -547,6 +576,8 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * The desired workload policy configuration for the autopilot cluster. * @type \Google\Cloud\Container\V1\K8sBetaAPIConfig $desired_k8s_beta_apis * Desired Beta APIs to be enabled for cluster. + * @type \Google\Cloud\Container\V1\ContainerdConfig $desired_containerd_config + * The desired containerd config for the cluster. * @type bool $desired_enable_multi_networking * Enable/Disable Multi-Networking for the cluster * @type \Google\Cloud\Container\V1\ResourceManagerTags $desired_node_pool_auto_config_resource_manager_tags @@ -556,6 +587,11 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * Specify the details of in-transit encryption. * @type bool $desired_enable_cilium_clusterwide_network_policy * Enable/Disable Cilium Clusterwide Network Policy for the cluster. + * @type \Google\Cloud\Container\V1\NodeKubeletConfig $desired_node_kubelet_config + * The desired node kubelet config for the cluster. + * @type \Google\Cloud\Container\V1\NodeKubeletConfig $desired_node_pool_auto_config_kubelet_config + * The desired node kubelet config for all auto-provisioned node pools + * in autopilot clusters and node auto-provisioning enabled clusters. * } */ public function __construct($data = NULL) { @@ -1262,7 +1298,12 @@ public function setDesiredVerticalPodAutoscaling($var) } /** - * The desired private cluster configuration. + * The desired private cluster configuration. master_global_access_config is + * the only field that can be changed via this field. + * See also + * [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint] + * for modifying other fields within + * [PrivateClusterConfig][google.container.v1.PrivateClusterConfig]. * * Generated from protobuf field .google.container.v1.PrivateClusterConfig desired_private_cluster_config = 25; * @return \Google\Cloud\Container\V1\PrivateClusterConfig|null @@ -1283,7 +1324,12 @@ public function clearDesiredPrivateClusterConfig() } /** - * The desired private cluster configuration. + * The desired private cluster configuration. master_global_access_config is + * the only field that can be changed via this field. + * See also + * [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint] + * for modifying other fields within + * [PrivateClusterConfig][google.container.v1.PrivateClusterConfig]. * * Generated from protobuf field .google.container.v1.PrivateClusterConfig desired_private_cluster_config = 25; * @param \Google\Cloud\Container\V1\PrivateClusterConfig $var @@ -2323,6 +2369,42 @@ public function setDesiredK8SBetaApis($var) return $this; } + /** + * The desired containerd config for the cluster. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig desired_containerd_config = 134; + * @return \Google\Cloud\Container\V1\ContainerdConfig|null + */ + public function getDesiredContainerdConfig() + { + return $this->desired_containerd_config; + } + + public function hasDesiredContainerdConfig() + { + return isset($this->desired_containerd_config); + } + + public function clearDesiredContainerdConfig() + { + unset($this->desired_containerd_config); + } + + /** + * The desired containerd config for the cluster. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig desired_containerd_config = 134; + * @param \Google\Cloud\Container\V1\ContainerdConfig $var + * @return $this + */ + public function setDesiredContainerdConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ContainerdConfig::class); + $this->desired_containerd_config = $var; + + return $this; + } + /** * Enable/Disable Multi-Networking for the cluster * @@ -2469,5 +2551,79 @@ public function setDesiredEnableCiliumClusterwideNetworkPolicy($var) return $this; } + /** + * The desired node kubelet config for the cluster. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig desired_node_kubelet_config = 141; + * @return \Google\Cloud\Container\V1\NodeKubeletConfig|null + */ + public function getDesiredNodeKubeletConfig() + { + return $this->desired_node_kubelet_config; + } + + public function hasDesiredNodeKubeletConfig() + { + return isset($this->desired_node_kubelet_config); + } + + public function clearDesiredNodeKubeletConfig() + { + unset($this->desired_node_kubelet_config); + } + + /** + * The desired node kubelet config for the cluster. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig desired_node_kubelet_config = 141; + * @param \Google\Cloud\Container\V1\NodeKubeletConfig $var + * @return $this + */ + public function setDesiredNodeKubeletConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NodeKubeletConfig::class); + $this->desired_node_kubelet_config = $var; + + return $this; + } + + /** + * The desired node kubelet config for all auto-provisioned node pools + * in autopilot clusters and node auto-provisioning enabled clusters. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig desired_node_pool_auto_config_kubelet_config = 142; + * @return \Google\Cloud\Container\V1\NodeKubeletConfig|null + */ + public function getDesiredNodePoolAutoConfigKubeletConfig() + { + return $this->desired_node_pool_auto_config_kubelet_config; + } + + public function hasDesiredNodePoolAutoConfigKubeletConfig() + { + return isset($this->desired_node_pool_auto_config_kubelet_config); + } + + public function clearDesiredNodePoolAutoConfigKubeletConfig() + { + unset($this->desired_node_pool_auto_config_kubelet_config); + } + + /** + * The desired node kubelet config for all auto-provisioned node pools + * in autopilot clusters and node auto-provisioning enabled clusters. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig desired_node_pool_auto_config_kubelet_config = 142; + * @param \Google\Cloud\Container\V1\NodeKubeletConfig $var + * @return $this + */ + public function setDesiredNodePoolAutoConfigKubeletConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NodeKubeletConfig::class); + $this->desired_node_pool_auto_config_kubelet_config = $var; + + return $this; + } + } diff --git a/Container/src/V1/ContainerdConfig.php b/Container/src/V1/ContainerdConfig.php new file mode 100644 index 000000000000..364fbee8cbc9 --- /dev/null +++ b/Container/src/V1/ContainerdConfig.php @@ -0,0 +1,81 @@ +google.container.v1.ContainerdConfig + */ +class ContainerdConfig extends \Google\Protobuf\Internal\Message +{ + /** + * PrivateRegistryAccessConfig is used to configure access configuration + * for private container registries. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig private_registry_access_config = 1; + */ + private $private_registry_access_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig $private_registry_access_config + * PrivateRegistryAccessConfig is used to configure access configuration + * for private container registries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * PrivateRegistryAccessConfig is used to configure access configuration + * for private container registries. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig private_registry_access_config = 1; + * @return \Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig|null + */ + public function getPrivateRegistryAccessConfig() + { + return $this->private_registry_access_config; + } + + public function hasPrivateRegistryAccessConfig() + { + return isset($this->private_registry_access_config); + } + + public function clearPrivateRegistryAccessConfig() + { + unset($this->private_registry_access_config); + } + + /** + * PrivateRegistryAccessConfig is used to configure access configuration + * for private container registries. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig private_registry_access_config = 1; + * @param \Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig $var + * @return $this + */ + public function setPrivateRegistryAccessConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig::class); + $this->private_registry_access_config = $var; + + return $this; + } + +} + diff --git a/Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig.php b/Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig.php new file mode 100644 index 000000000000..f3d5d3a0aea7 --- /dev/null +++ b/Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig.php @@ -0,0 +1,105 @@ +google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig + */ +class PrivateRegistryAccessConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Private registry access is enabled. + * + * Generated from protobuf field bool enabled = 1; + */ + private $enabled = false; + /** + * Private registry access configuration. + * + * Generated from protobuf field repeated .google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig certificate_authority_domain_config = 2; + */ + private $certificate_authority_domain_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Private registry access is enabled. + * @type array<\Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig\CertificateAuthorityDomainConfig>|\Google\Protobuf\Internal\RepeatedField $certificate_authority_domain_config + * Private registry access configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Private registry access is enabled. + * + * Generated from protobuf field bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Private registry access is enabled. + * + * Generated from protobuf field bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * Private registry access configuration. + * + * Generated from protobuf field repeated .google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig certificate_authority_domain_config = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCertificateAuthorityDomainConfig() + { + return $this->certificate_authority_domain_config; + } + + /** + * Private registry access configuration. + * + * Generated from protobuf field repeated .google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig certificate_authority_domain_config = 2; + * @param array<\Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig\CertificateAuthorityDomainConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCertificateAuthorityDomainConfig($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig\CertificateAuthorityDomainConfig::class); + $this->certificate_authority_domain_config = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrivateRegistryAccessConfig::class, \Google\Cloud\Container\V1\ContainerdConfig_PrivateRegistryAccessConfig::class); + diff --git a/Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig/CertificateAuthorityDomainConfig.php b/Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig/CertificateAuthorityDomainConfig.php new file mode 100644 index 000000000000..9e22533515ee --- /dev/null +++ b/Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig/CertificateAuthorityDomainConfig.php @@ -0,0 +1,133 @@ +google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig + */ +class CertificateAuthorityDomainConfig extends \Google\Protobuf\Internal\Message +{ + /** + * List of fully qualified domain names (FQDN). + * Specifying port is supported. + * Wilcards are NOT supported. + * Examples: + * - my.customdomain.com + * - 10.0.1.2:5000 + * + * Generated from protobuf field repeated string fqdns = 1; + */ + private $fqdns; + protected $certificate_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $fqdns + * List of fully qualified domain names (FQDN). + * Specifying port is supported. + * Wilcards are NOT supported. + * Examples: + * - my.customdomain.com + * - 10.0.1.2:5000 + * @type \Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig\CertificateAuthorityDomainConfig\GCPSecretManagerCertificateConfig $gcp_secret_manager_certificate_config + * Google Secret Manager (GCP) certificate configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * List of fully qualified domain names (FQDN). + * Specifying port is supported. + * Wilcards are NOT supported. + * Examples: + * - my.customdomain.com + * - 10.0.1.2:5000 + * + * Generated from protobuf field repeated string fqdns = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFqdns() + { + return $this->fqdns; + } + + /** + * List of fully qualified domain names (FQDN). + * Specifying port is supported. + * Wilcards are NOT supported. + * Examples: + * - my.customdomain.com + * - 10.0.1.2:5000 + * + * Generated from protobuf field repeated string fqdns = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFqdns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->fqdns = $arr; + + return $this; + } + + /** + * Google Secret Manager (GCP) certificate configuration. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig.GCPSecretManagerCertificateConfig gcp_secret_manager_certificate_config = 2; + * @return \Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig\CertificateAuthorityDomainConfig\GCPSecretManagerCertificateConfig|null + */ + public function getGcpSecretManagerCertificateConfig() + { + return $this->readOneof(2); + } + + public function hasGcpSecretManagerCertificateConfig() + { + return $this->hasOneof(2); + } + + /** + * Google Secret Manager (GCP) certificate configuration. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig.GCPSecretManagerCertificateConfig gcp_secret_manager_certificate_config = 2; + * @param \Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig\CertificateAuthorityDomainConfig\GCPSecretManagerCertificateConfig $var + * @return $this + */ + public function setGcpSecretManagerCertificateConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ContainerdConfig\PrivateRegistryAccessConfig\CertificateAuthorityDomainConfig\GCPSecretManagerCertificateConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getCertificateConfig() + { + return $this->whichOneof("certificate_config"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CertificateAuthorityDomainConfig::class, \Google\Cloud\Container\V1\ContainerdConfig_PrivateRegistryAccessConfig_CertificateAuthorityDomainConfig::class); + diff --git a/Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig/CertificateAuthorityDomainConfig/GCPSecretManagerCertificateConfig.php b/Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig/CertificateAuthorityDomainConfig/GCPSecretManagerCertificateConfig.php new file mode 100644 index 000000000000..56f0b109db32 --- /dev/null +++ b/Container/src/V1/ContainerdConfig/PrivateRegistryAccessConfig/CertificateAuthorityDomainConfig/GCPSecretManagerCertificateConfig.php @@ -0,0 +1,79 @@ +google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig.GCPSecretManagerCertificateConfig + */ +class GCPSecretManagerCertificateConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Secret URI, in the form + * "projects/$PROJECT_ID/secrets/$SECRET_NAME/versions/$VERSION". + * Version can be fixed (e.g. "2") or "latest" + * + * Generated from protobuf field string secret_uri = 1; + */ + private $secret_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $secret_uri + * Secret URI, in the form + * "projects/$PROJECT_ID/secrets/$SECRET_NAME/versions/$VERSION". + * Version can be fixed (e.g. "2") or "latest" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Secret URI, in the form + * "projects/$PROJECT_ID/secrets/$SECRET_NAME/versions/$VERSION". + * Version can be fixed (e.g. "2") or "latest" + * + * Generated from protobuf field string secret_uri = 1; + * @return string + */ + public function getSecretUri() + { + return $this->secret_uri; + } + + /** + * Secret URI, in the form + * "projects/$PROJECT_ID/secrets/$SECRET_NAME/versions/$VERSION". + * Version can be fixed (e.g. "2") or "latest" + * + * Generated from protobuf field string secret_uri = 1; + * @param string $var + * @return $this + */ + public function setSecretUri($var) + { + GPBUtil::checkString($var, True); + $this->secret_uri = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GCPSecretManagerCertificateConfig::class, \Google\Cloud\Container\V1\ContainerdConfig_PrivateRegistryAccessConfig_CertificateAuthorityDomainConfig_GCPSecretManagerCertificateConfig::class); + diff --git a/Container/src/V1/DNSConfig.php b/Container/src/V1/DNSConfig.php index 75df21a17c3e..d47492e08354 100644 --- a/Container/src/V1/DNSConfig.php +++ b/Container/src/V1/DNSConfig.php @@ -33,6 +33,12 @@ class DNSConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field string cluster_dns_domain = 3; */ private $cluster_dns_domain = ''; + /** + * Optional. The domain used in Additive VPC scope. + * + * Generated from protobuf field string additive_vpc_scope_dns_domain = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $additive_vpc_scope_dns_domain = ''; /** * Constructor. @@ -46,6 +52,8 @@ class DNSConfig extends \Google\Protobuf\Internal\Message * cluster_dns_scope indicates the scope of access to cluster DNS records. * @type string $cluster_dns_domain * cluster_dns_domain is the suffix used for all cluster service records. + * @type string $additive_vpc_scope_dns_domain + * Optional. The domain used in Additive VPC scope. * } */ public function __construct($data = NULL) { @@ -131,5 +139,31 @@ public function setClusterDnsDomain($var) return $this; } + /** + * Optional. The domain used in Additive VPC scope. + * + * Generated from protobuf field string additive_vpc_scope_dns_domain = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAdditiveVpcScopeDnsDomain() + { + return $this->additive_vpc_scope_dns_domain; + } + + /** + * Optional. The domain used in Additive VPC scope. + * + * Generated from protobuf field string additive_vpc_scope_dns_domain = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAdditiveVpcScopeDnsDomain($var) + { + GPBUtil::checkString($var, True); + $this->additive_vpc_scope_dns_domain = $var; + + return $this; + } + } diff --git a/Container/src/V1/GPUSharingConfig/GPUSharingStrategy.php b/Container/src/V1/GPUSharingConfig/GPUSharingStrategy.php index b7c519c60962..5f02af567fdb 100644 --- a/Container/src/V1/GPUSharingConfig/GPUSharingStrategy.php +++ b/Container/src/V1/GPUSharingConfig/GPUSharingStrategy.php @@ -25,10 +25,17 @@ class GPUSharingStrategy * Generated from protobuf enum TIME_SHARING = 1; */ const TIME_SHARING = 1; + /** + * GPUs are shared between containers with NVIDIA MPS. + * + * Generated from protobuf enum MPS = 2; + */ + const MPS = 2; private static $valueToName = [ self::GPU_SHARING_STRATEGY_UNSPECIFIED => 'GPU_SHARING_STRATEGY_UNSPECIFIED', self::TIME_SHARING => 'TIME_SHARING', + self::MPS => 'MPS', ]; public static function name($value) diff --git a/Container/src/V1/Gapic/ClusterManagerGapicClient.php b/Container/src/V1/Gapic/ClusterManagerGapicClient.php index 536476a3a37e..7e777cde9e2b 100644 --- a/Container/src/V1/Gapic/ClusterManagerGapicClient.php +++ b/Container/src/V1/Gapic/ClusterManagerGapicClient.php @@ -33,6 +33,7 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\Container\V1\AcceleratorConfig; use Google\Cloud\Container\V1\AddonsConfig; use Google\Cloud\Container\V1\CancelOperationRequest; use Google\Cloud\Container\V1\CheckAutopilotCompatibilityRequest; @@ -42,6 +43,7 @@ use Google\Cloud\Container\V1\CompleteIPRotationRequest; use Google\Cloud\Container\V1\CompleteNodePoolUpgradeRequest; use Google\Cloud\Container\V1\ConfidentialNodes; +use Google\Cloud\Container\V1\ContainerdConfig; use Google\Cloud\Container\V1\CreateClusterRequest; use Google\Cloud\Container\V1\CreateNodePoolRequest; use Google\Cloud\Container\V1\DeleteClusterRequest; @@ -2811,6 +2813,10 @@ public function updateMaster($masterVersion, array $optionalArgs = []) * Google Compute Engine resources. * @type WindowsNodeConfig $windowsNodeConfig * Parameters that can be configured on Windows nodes. + * @type AcceleratorConfig[] $accelerators + * A list of hardware accelerators to be attached to each node. + * See https://cloud.google.com/compute/docs/gpus for more information about + * support for GPUs. * @type string $machineType * Optional. The desired [Google Compute Engine machine * type](https://cloud.google.com/compute/docs/machine-types) for nodes in the @@ -2830,6 +2836,10 @@ public function updateMaster($masterVersion, array $optionalArgs = []) * Desired resource manager tag keys and values to be attached to the nodes * for managing Compute Engine firewalls using Network Firewall Policies. * Existing tags will be replaced with new values. + * @type ContainerdConfig $containerdConfig + * The desired containerd config for nodes in the node pool. + * Initiates an upgrade operation that recreates the nodes with the new + * config. * @type QueuedProvisioning $queuedProvisioning * Specifies the configuration of queued provisioning. * @type RetrySettings|array $retrySettings @@ -2941,6 +2951,10 @@ public function updateNodePool($nodeVersion, $imageType, array $optionalArgs = [ $request->setWindowsNodeConfig($optionalArgs['windowsNodeConfig']); } + if (isset($optionalArgs['accelerators'])) { + $request->setAccelerators($optionalArgs['accelerators']); + } + if (isset($optionalArgs['machineType'])) { $request->setMachineType($optionalArgs['machineType']); } @@ -2957,6 +2971,10 @@ public function updateNodePool($nodeVersion, $imageType, array $optionalArgs = [ $request->setResourceManagerTags($optionalArgs['resourceManagerTags']); } + if (isset($optionalArgs['containerdConfig'])) { + $request->setContainerdConfig($optionalArgs['containerdConfig']); + } + if (isset($optionalArgs['queuedProvisioning'])) { $request->setQueuedProvisioning($optionalArgs['queuedProvisioning']); } diff --git a/Container/src/V1/LinuxNodeConfig.php b/Container/src/V1/LinuxNodeConfig.php index a369164109ff..d42dad43c5f3 100644 --- a/Container/src/V1/LinuxNodeConfig.php +++ b/Container/src/V1/LinuxNodeConfig.php @@ -40,6 +40,12 @@ class LinuxNodeConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.LinuxNodeConfig.CgroupMode cgroup_mode = 2; */ private $cgroup_mode = 0; + /** + * Optional. Amounts for 2M and 1G hugepages + * + * Generated from protobuf field optional .google.container.v1.LinuxNodeConfig.HugepagesConfig hugepages = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $hugepages = null; /** * Constructor. @@ -64,6 +70,8 @@ class LinuxNodeConfig extends \Google\Protobuf\Internal\Message * net.ipv4.tcp_tw_reuse * @type int $cgroup_mode * cgroup_mode specifies the cgroup mode to be used on the node. + * @type \Google\Cloud\Container\V1\LinuxNodeConfig\HugepagesConfig $hugepages + * Optional. Amounts for 2M and 1G hugepages * } */ public function __construct($data = NULL) { @@ -149,5 +157,41 @@ public function setCgroupMode($var) return $this; } + /** + * Optional. Amounts for 2M and 1G hugepages + * + * Generated from protobuf field optional .google.container.v1.LinuxNodeConfig.HugepagesConfig hugepages = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Container\V1\LinuxNodeConfig\HugepagesConfig|null + */ + public function getHugepages() + { + return $this->hugepages; + } + + public function hasHugepages() + { + return isset($this->hugepages); + } + + public function clearHugepages() + { + unset($this->hugepages); + } + + /** + * Optional. Amounts for 2M and 1G hugepages + * + * Generated from protobuf field optional .google.container.v1.LinuxNodeConfig.HugepagesConfig hugepages = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Container\V1\LinuxNodeConfig\HugepagesConfig $var + * @return $this + */ + public function setHugepages($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\LinuxNodeConfig\HugepagesConfig::class); + $this->hugepages = $var; + + return $this; + } + } diff --git a/Container/src/V1/LinuxNodeConfig/HugepagesConfig.php b/Container/src/V1/LinuxNodeConfig/HugepagesConfig.php new file mode 100644 index 000000000000..b9e8aa04233a --- /dev/null +++ b/Container/src/V1/LinuxNodeConfig/HugepagesConfig.php @@ -0,0 +1,124 @@ +google.container.v1.LinuxNodeConfig.HugepagesConfig + */ +class HugepagesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Amount of 2M hugepages + * + * Generated from protobuf field optional int32 hugepage_size2m = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $hugepage_size2m = null; + /** + * Optional. Amount of 1G hugepages + * + * Generated from protobuf field optional int32 hugepage_size1g = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $hugepage_size1g = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $hugepage_size2m + * Optional. Amount of 2M hugepages + * @type int $hugepage_size1g + * Optional. Amount of 1G hugepages + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Amount of 2M hugepages + * + * Generated from protobuf field optional int32 hugepage_size2m = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getHugepageSize2M() + { + return isset($this->hugepage_size2m) ? $this->hugepage_size2m : 0; + } + + public function hasHugepageSize2M() + { + return isset($this->hugepage_size2m); + } + + public function clearHugepageSize2M() + { + unset($this->hugepage_size2m); + } + + /** + * Optional. Amount of 2M hugepages + * + * Generated from protobuf field optional int32 hugepage_size2m = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setHugepageSize2M($var) + { + GPBUtil::checkInt32($var); + $this->hugepage_size2m = $var; + + return $this; + } + + /** + * Optional. Amount of 1G hugepages + * + * Generated from protobuf field optional int32 hugepage_size1g = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getHugepageSize1G() + { + return isset($this->hugepage_size1g) ? $this->hugepage_size1g : 0; + } + + public function hasHugepageSize1G() + { + return isset($this->hugepage_size1g); + } + + public function clearHugepageSize1G() + { + unset($this->hugepage_size1g); + } + + /** + * Optional. Amount of 1G hugepages + * + * Generated from protobuf field optional int32 hugepage_size1g = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setHugepageSize1G($var) + { + GPBUtil::checkInt32($var); + $this->hugepage_size1g = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HugepagesConfig::class, \Google\Cloud\Container\V1\LinuxNodeConfig_HugepagesConfig::class); + diff --git a/Container/src/V1/ListOperationsRequest.php b/Container/src/V1/ListOperationsRequest.php index 3ab9f1742290..fb70e15fab8e 100644 --- a/Container/src/V1/ListOperationsRequest.php +++ b/Container/src/V1/ListOperationsRequest.php @@ -63,6 +63,21 @@ public static function build(string $projectId, string $zone): self ->setZone($zone); } + /** + * @param string $parent The parent (project and location) where the operations will be listed. + * Specified in the format `projects/*/locations/*`. + * Location "-" matches all zones and all regions. + * + * @return \Google\Cloud\Container\V1\ListOperationsRequest + * + * @experimental + */ + public static function buildFromParent(string $parent): self + { + return (new self()) + ->setParent($parent); + } + /** * Constructor. * diff --git a/Container/src/V1/MonitoringComponentConfig/Component.php b/Container/src/V1/MonitoringComponentConfig/Component.php index afcbfb191c68..0882617a731d 100644 --- a/Container/src/V1/MonitoringComponentConfig/Component.php +++ b/Container/src/V1/MonitoringComponentConfig/Component.php @@ -79,6 +79,18 @@ class Component * Generated from protobuf enum STATEFULSET = 12; */ const STATEFULSET = 12; + /** + * CADVISOR + * + * Generated from protobuf enum CADVISOR = 13; + */ + const CADVISOR = 13; + /** + * KUBELET + * + * Generated from protobuf enum KUBELET = 14; + */ + const KUBELET = 14; private static $valueToName = [ self::COMPONENT_UNSPECIFIED => 'COMPONENT_UNSPECIFIED', @@ -92,6 +104,8 @@ class Component self::DAEMONSET => 'DAEMONSET', self::DEPLOYMENT => 'DEPLOYMENT', self::STATEFULSET => 'STATEFULSET', + self::CADVISOR => 'CADVISOR', + self::KUBELET => 'KUBELET', ]; public static function name($value) diff --git a/Container/src/V1/NetworkConfig.php b/Container/src/V1/NetworkConfig.php index 318e9bb254c5..48ea018b3dac 100644 --- a/Container/src/V1/NetworkConfig.php +++ b/Container/src/V1/NetworkConfig.php @@ -110,6 +110,7 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message private $enable_fqdn_network_policy = null; /** * Specify the details of in-transit encryption. + * Now named inter-node transparent encryption. * * Generated from protobuf field optional .google.container.v1.InTransitEncryptionConfig in_transit_encryption_config = 20; */ @@ -170,6 +171,7 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message * Whether FQDN Network Policy is enabled on this cluster. * @type int $in_transit_encryption_config * Specify the details of in-transit encryption. + * Now named inter-node transparent encryption. * @type bool $enable_cilium_clusterwide_network_policy * Whether CiliumClusterwideNetworkPolicy is enabled on this cluster. * } @@ -609,6 +611,7 @@ public function setEnableFqdnNetworkPolicy($var) /** * Specify the details of in-transit encryption. + * Now named inter-node transparent encryption. * * Generated from protobuf field optional .google.container.v1.InTransitEncryptionConfig in_transit_encryption_config = 20; * @return int @@ -630,6 +633,7 @@ public function clearInTransitEncryptionConfig() /** * Specify the details of in-transit encryption. + * Now named inter-node transparent encryption. * * Generated from protobuf field optional .google.container.v1.InTransitEncryptionConfig in_transit_encryption_config = 20; * @param int $var diff --git a/Container/src/V1/NodeConfig.php b/Container/src/V1/NodeConfig.php index 679d8545f32a..867619014af8 100644 --- a/Container/src/V1/NodeConfig.php +++ b/Container/src/V1/NodeConfig.php @@ -313,6 +313,12 @@ class NodeConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.SoleTenantConfig sole_tenant_config = 42; */ private $sole_tenant_config = null; + /** + * Parameters for containerd customization. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig containerd_config = 43; + */ + private $containerd_config = null; /** * A map of resource manager tag keys and values to be attached to the nodes. * @@ -502,6 +508,8 @@ class NodeConfig extends \Google\Protobuf\Internal\Message * If unspecified, ephemeral storage is backed by the boot disk. * @type \Google\Cloud\Container\V1\SoleTenantConfig $sole_tenant_config * Parameters for node pools to be backed by shared sole tenant node groups. + * @type \Google\Cloud\Container\V1\ContainerdConfig $containerd_config + * Parameters for containerd customization. * @type \Google\Cloud\Container\V1\ResourceManagerTags $resource_manager_tags * A map of resource manager tag keys and values to be attached to the nodes. * @type bool $enable_confidential_storage @@ -1741,6 +1749,42 @@ public function setSoleTenantConfig($var) return $this; } + /** + * Parameters for containerd customization. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig containerd_config = 43; + * @return \Google\Cloud\Container\V1\ContainerdConfig|null + */ + public function getContainerdConfig() + { + return $this->containerd_config; + } + + public function hasContainerdConfig() + { + return isset($this->containerd_config); + } + + public function clearContainerdConfig() + { + unset($this->containerd_config); + } + + /** + * Parameters for containerd customization. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig containerd_config = 43; + * @param \Google\Cloud\Container\V1\ContainerdConfig $var + * @return $this + */ + public function setContainerdConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ContainerdConfig::class); + $this->containerd_config = $var; + + return $this; + } + /** * A map of resource manager tag keys and values to be attached to the nodes. * diff --git a/Container/src/V1/NodeConfigDefaults.php b/Container/src/V1/NodeConfigDefaults.php index 4780dc6ffa96..7dc29c1760c6 100644 --- a/Container/src/V1/NodeConfigDefaults.php +++ b/Container/src/V1/NodeConfigDefaults.php @@ -27,6 +27,19 @@ class NodeConfigDefaults extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.NodePoolLoggingConfig logging_config = 3; */ private $logging_config = null; + /** + * Parameters for containerd customization. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig containerd_config = 4; + */ + private $containerd_config = null; + /** + * NodeKubeletConfig controls the defaults for new node-pools. + * Currently only `insecure_kubelet_readonly_port_enabled` can be set here. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig node_kubelet_config = 6; + */ + private $node_kubelet_config = null; /** * Constructor. @@ -38,6 +51,11 @@ class NodeConfigDefaults extends \Google\Protobuf\Internal\Message * GCFS (Google Container File System, also known as Riptide) options. * @type \Google\Cloud\Container\V1\NodePoolLoggingConfig $logging_config * Logging configuration for node pools. + * @type \Google\Cloud\Container\V1\ContainerdConfig $containerd_config + * Parameters for containerd customization. + * @type \Google\Cloud\Container\V1\NodeKubeletConfig $node_kubelet_config + * NodeKubeletConfig controls the defaults for new node-pools. + * Currently only `insecure_kubelet_readonly_port_enabled` can be set here. * } */ public function __construct($data = NULL) { @@ -117,5 +135,79 @@ public function setLoggingConfig($var) return $this; } + /** + * Parameters for containerd customization. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig containerd_config = 4; + * @return \Google\Cloud\Container\V1\ContainerdConfig|null + */ + public function getContainerdConfig() + { + return $this->containerd_config; + } + + public function hasContainerdConfig() + { + return isset($this->containerd_config); + } + + public function clearContainerdConfig() + { + unset($this->containerd_config); + } + + /** + * Parameters for containerd customization. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig containerd_config = 4; + * @param \Google\Cloud\Container\V1\ContainerdConfig $var + * @return $this + */ + public function setContainerdConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ContainerdConfig::class); + $this->containerd_config = $var; + + return $this; + } + + /** + * NodeKubeletConfig controls the defaults for new node-pools. + * Currently only `insecure_kubelet_readonly_port_enabled` can be set here. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig node_kubelet_config = 6; + * @return \Google\Cloud\Container\V1\NodeKubeletConfig|null + */ + public function getNodeKubeletConfig() + { + return $this->node_kubelet_config; + } + + public function hasNodeKubeletConfig() + { + return isset($this->node_kubelet_config); + } + + public function clearNodeKubeletConfig() + { + unset($this->node_kubelet_config); + } + + /** + * NodeKubeletConfig controls the defaults for new node-pools. + * Currently only `insecure_kubelet_readonly_port_enabled` can be set here. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig node_kubelet_config = 6; + * @param \Google\Cloud\Container\V1\NodeKubeletConfig $var + * @return $this + */ + public function setNodeKubeletConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NodeKubeletConfig::class); + $this->node_kubelet_config = $var; + + return $this; + } + } diff --git a/Container/src/V1/NodePoolAutoConfig.php b/Container/src/V1/NodePoolAutoConfig.php index 8686148420c3..08bab92e1010 100644 --- a/Container/src/V1/NodePoolAutoConfig.php +++ b/Container/src/V1/NodePoolAutoConfig.php @@ -32,6 +32,13 @@ class NodePoolAutoConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.ResourceManagerTags resource_manager_tags = 2; */ private $resource_manager_tags = null; + /** + * NodeKubeletConfig controls the defaults for autoprovisioned node-pools. + * Currently only `insecure_kubelet_readonly_port_enabled` can be set here. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig node_kubelet_config = 3; + */ + private $node_kubelet_config = null; /** * Constructor. @@ -47,6 +54,9 @@ class NodePoolAutoConfig extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Container\V1\ResourceManagerTags $resource_manager_tags * Resource manager tag keys and values to be attached to the nodes * for managing Compute Engine firewalls using Network Firewall Policies. + * @type \Google\Cloud\Container\V1\NodeKubeletConfig $node_kubelet_config + * NodeKubeletConfig controls the defaults for autoprovisioned node-pools. + * Currently only `insecure_kubelet_readonly_port_enabled` can be set here. * } */ public function __construct($data = NULL) { @@ -134,5 +144,43 @@ public function setResourceManagerTags($var) return $this; } + /** + * NodeKubeletConfig controls the defaults for autoprovisioned node-pools. + * Currently only `insecure_kubelet_readonly_port_enabled` can be set here. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig node_kubelet_config = 3; + * @return \Google\Cloud\Container\V1\NodeKubeletConfig|null + */ + public function getNodeKubeletConfig() + { + return $this->node_kubelet_config; + } + + public function hasNodeKubeletConfig() + { + return isset($this->node_kubelet_config); + } + + public function clearNodeKubeletConfig() + { + unset($this->node_kubelet_config); + } + + /** + * NodeKubeletConfig controls the defaults for autoprovisioned node-pools. + * Currently only `insecure_kubelet_readonly_port_enabled` can be set here. + * + * Generated from protobuf field .google.container.v1.NodeKubeletConfig node_kubelet_config = 3; + * @param \Google\Cloud\Container\V1\NodeKubeletConfig $var + * @return $this + */ + public function setNodeKubeletConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NodeKubeletConfig::class); + $this->node_kubelet_config = $var; + + return $this; + } + } diff --git a/Container/src/V1/SecurityPostureConfig/Mode.php b/Container/src/V1/SecurityPostureConfig/Mode.php index 4175f3bae536..ee855449d84f 100644 --- a/Container/src/V1/SecurityPostureConfig/Mode.php +++ b/Container/src/V1/SecurityPostureConfig/Mode.php @@ -31,11 +31,18 @@ class Mode * Generated from protobuf enum BASIC = 2; */ const BASIC = 2; + /** + * Applies the Security Posture off cluster Enterprise level features. + * + * Generated from protobuf enum ENTERPRISE = 3; + */ + const ENTERPRISE = 3; private static $valueToName = [ self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', self::DISABLED => 'DISABLED', self::BASIC => 'BASIC', + self::ENTERPRISE => 'ENTERPRISE', ]; public static function name($value) diff --git a/Container/src/V1/UpdateNodePoolRequest.php b/Container/src/V1/UpdateNodePoolRequest.php index f7634379bcc4..64e098bd3f2c 100644 --- a/Container/src/V1/UpdateNodePoolRequest.php +++ b/Container/src/V1/UpdateNodePoolRequest.php @@ -196,6 +196,14 @@ class UpdateNodePoolRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.WindowsNodeConfig windows_node_config = 34; */ private $windows_node_config = null; + /** + * A list of hardware accelerators to be attached to each node. + * See https://cloud.google.com/compute/docs/gpus for more information about + * support for GPUs. + * + * Generated from protobuf field repeated .google.container.v1.AcceleratorConfig accelerators = 35; + */ + private $accelerators; /** * Optional. The desired [Google Compute Engine machine * type](https://cloud.google.com/compute/docs/machine-types) for nodes in the @@ -231,6 +239,14 @@ class UpdateNodePoolRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.ResourceManagerTags resource_manager_tags = 39; */ private $resource_manager_tags = null; + /** + * The desired containerd config for nodes in the node pool. + * Initiates an upgrade operation that recreates the nodes with the new + * config. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig containerd_config = 40; + */ + private $containerd_config = null; /** * Specifies the configuration of queued provisioning. * @@ -325,6 +341,10 @@ class UpdateNodePoolRequest extends \Google\Protobuf\Internal\Message * Google Compute Engine resources. * @type \Google\Cloud\Container\V1\WindowsNodeConfig $windows_node_config * Parameters that can be configured on Windows nodes. + * @type array<\Google\Cloud\Container\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $accelerators + * A list of hardware accelerators to be attached to each node. + * See https://cloud.google.com/compute/docs/gpus for more information about + * support for GPUs. * @type string $machine_type * Optional. The desired [Google Compute Engine machine * type](https://cloud.google.com/compute/docs/machine-types) for nodes in the @@ -344,6 +364,10 @@ class UpdateNodePoolRequest extends \Google\Protobuf\Internal\Message * Desired resource manager tag keys and values to be attached to the nodes * for managing Compute Engine firewalls using Network Firewall Policies. * Existing tags will be replaced with new values. + * @type \Google\Cloud\Container\V1\ContainerdConfig $containerd_config + * The desired containerd config for nodes in the node pool. + * Initiates an upgrade operation that recreates the nodes with the new + * config. * @type \Google\Cloud\Container\V1\NodePool\QueuedProvisioning $queued_provisioning * Specifies the configuration of queued provisioning. * } @@ -1209,6 +1233,36 @@ public function setWindowsNodeConfig($var) return $this; } + /** + * A list of hardware accelerators to be attached to each node. + * See https://cloud.google.com/compute/docs/gpus for more information about + * support for GPUs. + * + * Generated from protobuf field repeated .google.container.v1.AcceleratorConfig accelerators = 35; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccelerators() + { + return $this->accelerators; + } + + /** + * A list of hardware accelerators to be attached to each node. + * See https://cloud.google.com/compute/docs/gpus for more information about + * support for GPUs. + * + * Generated from protobuf field repeated .google.container.v1.AcceleratorConfig accelerators = 35; + * @param array<\Google\Cloud\Container\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\AcceleratorConfig::class); + $this->accelerators = $arr; + + return $this; + } + /** * Optional. The desired [Google Compute Engine machine * type](https://cloud.google.com/compute/docs/machine-types) for nodes in the @@ -1345,6 +1399,46 @@ public function setResourceManagerTags($var) return $this; } + /** + * The desired containerd config for nodes in the node pool. + * Initiates an upgrade operation that recreates the nodes with the new + * config. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig containerd_config = 40; + * @return \Google\Cloud\Container\V1\ContainerdConfig|null + */ + public function getContainerdConfig() + { + return $this->containerd_config; + } + + public function hasContainerdConfig() + { + return isset($this->containerd_config); + } + + public function clearContainerdConfig() + { + unset($this->containerd_config); + } + + /** + * The desired containerd config for nodes in the node pool. + * Initiates an upgrade operation that recreates the nodes with the new + * config. + * + * Generated from protobuf field .google.container.v1.ContainerdConfig containerd_config = 40; + * @param \Google\Cloud\Container\V1\ContainerdConfig $var + * @return $this + */ + public function setContainerdConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ContainerdConfig::class); + $this->containerd_config = $var; + + return $this; + } + /** * Specifies the configuration of queued provisioning. * diff --git a/Container/tests/Unit/V1/Client/ClusterManagerClientTest.php b/Container/tests/Unit/V1/Client/ClusterManagerClientTest.php index 793bc0ac34d3..4197afa1a6e5 100644 --- a/Container/tests/Unit/V1/Client/ClusterManagerClientTest.php +++ b/Container/tests/Unit/V1/Client/ClusterManagerClientTest.php @@ -685,6 +685,8 @@ public function getClusterTest() $tpuIpv4CidrBlock = 'tpuIpv4CidrBlock1137906646'; $id = 'id3355'; $etag = 'etag3123477'; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new Cluster(); $expectedResponse->setName($name2); $expectedResponse->setDescription($description); @@ -713,6 +715,8 @@ public function getClusterTest() $expectedResponse->setTpuIpv4CidrBlock($tpuIpv4CidrBlock); $expectedResponse->setId($id); $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); $request = new GetClusterRequest(); $response = $gapicClient->getCluster($request); diff --git a/Container/tests/Unit/V1/ClusterManagerClientTest.php b/Container/tests/Unit/V1/ClusterManagerClientTest.php index 1689208db7a5..e7fcf8407318 100644 --- a/Container/tests/Unit/V1/ClusterManagerClientTest.php +++ b/Container/tests/Unit/V1/ClusterManagerClientTest.php @@ -632,6 +632,8 @@ public function getClusterTest() $tpuIpv4CidrBlock = 'tpuIpv4CidrBlock1137906646'; $id = 'id3355'; $etag = 'etag3123477'; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new Cluster(); $expectedResponse->setName($name2); $expectedResponse->setDescription($description); @@ -660,6 +662,8 @@ public function getClusterTest() $expectedResponse->setTpuIpv4CidrBlock($tpuIpv4CidrBlock); $expectedResponse->setId($id); $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); $response = $gapicClient->getCluster(); $this->assertEquals($expectedResponse, $response); diff --git a/ContainerAnalysis/.repo-metadata.json b/ContainerAnalysis/.repo-metadata.json deleted file mode 100644 index 03bdf31523d5..000000000000 --- a/ContainerAnalysis/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-container-analysis", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-container-analysis/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "containeranalysis" -} diff --git a/ContainerAnalysis/VERSION b/ContainerAnalysis/VERSION index d1d899fa33a0..d3532a107eeb 100644 --- a/ContainerAnalysis/VERSION +++ b/ContainerAnalysis/VERSION @@ -1 +1 @@ -0.5.5 +0.5.7 diff --git a/ContainerAnalysis/composer.json b/ContainerAnalysis/composer.json index 3c360d28ca14..ef1b9f9f4874 100644 --- a/ContainerAnalysis/composer.json +++ b/ContainerAnalysis/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/grafeas": "^0.10.0" }, "require-dev": { diff --git a/ControlsPartner/.repo-metadata.json b/ControlsPartner/.repo-metadata.json deleted file mode 100644 index 4583d66d8043..000000000000 --- a/ControlsPartner/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-cloudcontrolspartner", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-cloudcontrolspartner/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudcontrolspartner" -} diff --git a/ControlsPartner/VERSION b/ControlsPartner/VERSION index 17e51c385ea3..b1e80bb2480a 100644 --- a/ControlsPartner/VERSION +++ b/ControlsPartner/VERSION @@ -1 +1 @@ -0.1.1 +0.1.3 diff --git a/ControlsPartner/composer.json b/ControlsPartner/composer.json index 7b993d587a57..ab34bfb90549 100644 --- a/ControlsPartner/composer.json +++ b/ControlsPartner/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Core/.repo-metadata.json b/Core/.repo-metadata.json deleted file mode 100644 index 9f0a1e0ee999..000000000000 --- a/Core/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-core", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-core/latest", - "library_type": "CORE", - "api_shortname": "" -} diff --git a/Core/VERSION b/Core/VERSION index 79f82f6b8e0c..bb120e876c62 100644 --- a/Core/VERSION +++ b/Core/VERSION @@ -1 +1 @@ -1.58.0 +1.59.0 diff --git a/Core/composer.json b/Core/composer.json index 9dcd7f30dd64..f84a2979e013 100644 --- a/Core/composer.json +++ b/Core/composer.json @@ -12,7 +12,7 @@ "guzzlehttp/psr7": "^2.6", "monolog/monolog": "^2.9|^3.0", "psr/http-message": "^1.0|^2.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Core/snippet-bootstrap.php b/Core/snippet-bootstrap.php index b53df247d3c9..156f1a322227 100644 --- a/Core/snippet-bootstrap.php +++ b/Core/snippet-bootstrap.php @@ -1,7 +1,14 @@ register(new MessageAwareArrayComparator()); \SebastianBergmann\Comparator\Factory::getInstance()->register(new ProtobufMessageComparator()); \SebastianBergmann\Comparator\Factory::getInstance()->register(new ProtobufGPBEmptyComparator()); + +// Make sure that while testing we bypass the `final` keyword for the GAPIC client. +// Only run this if the individual component has the helper package installed +if (class_exists(BypassFinals::class)) { + BypassFinals::enable(); +} diff --git a/DataCatalog/.repo-metadata.json b/DataCatalog/.repo-metadata.json deleted file mode 100644 index c45edeff7132..000000000000 --- a/DataCatalog/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-data-catalog", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-data-catalog/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "datacatalog" -} diff --git a/DataCatalog/VERSION b/DataCatalog/VERSION index 4dae2985b58c..587c5f0c7309 100644 --- a/DataCatalog/VERSION +++ b/DataCatalog/VERSION @@ -1 +1 @@ -1.10.1 +1.10.3 diff --git a/DataCatalog/composer.json b/DataCatalog/composer.json index 4460cc0144fe..66d08774c922 100644 --- a/DataCatalog/composer.json +++ b/DataCatalog/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/DataCatalogLineage/.repo-metadata.json b/DataCatalogLineage/.repo-metadata.json deleted file mode 100644 index 50eda5f4ab77..000000000000 --- a/DataCatalogLineage/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-datacatalog-lineage", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datacatalog-lineage/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "datalineage" -} diff --git a/DataCatalogLineage/VERSION b/DataCatalogLineage/VERSION index be14282b7fff..d1d899fa33a0 100644 --- a/DataCatalogLineage/VERSION +++ b/DataCatalogLineage/VERSION @@ -1 +1 @@ -0.5.3 +0.5.5 diff --git a/DataCatalogLineage/composer.json b/DataCatalogLineage/composer.json index 6756fb1d7953..19def98b6145 100644 --- a/DataCatalogLineage/composer.json +++ b/DataCatalogLineage/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/DataFusion/.repo-metadata.json b/DataFusion/.repo-metadata.json deleted file mode 100644 index 8809869971c0..000000000000 --- a/DataFusion/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-data-fusion", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-data-fusion/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "datafusion" -} diff --git a/DataFusion/README.md b/DataFusion/README.md index e3df73bb21bb..450c83b2a85f 100644 --- a/DataFusion/README.md +++ b/DataFusion/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/DataFusion/VERSION b/DataFusion/VERSION index 844f6a91acb9..ef5e4454454d 100644 --- a/DataFusion/VERSION +++ b/DataFusion/VERSION @@ -1 +1 @@ -0.6.3 +0.6.5 diff --git a/DataFusion/composer.json b/DataFusion/composer.json index e00062bc33da..0e93270df727 100644 --- a/DataFusion/composer.json +++ b/DataFusion/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/DataFusion/owlbot.py b/DataFusion/owlbot.py index 70be311fb188..f16bc3b648bc 100644 --- a/DataFusion/owlbot.py +++ b/DataFusion/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -47,32 +41,6 @@ + "\n", '') -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) - # format generated clients subprocess.run([ 'npm', @@ -81,8 +49,8 @@ '--package=@prettier/plugin-php@^0.16', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', - '--print-width=80']) + '--print-width=120']) diff --git a/DataFusion/src/V1/Accelerator.php b/DataFusion/src/V1/Accelerator.php index 7d5ff4d4e17d..5c6aafdf7d6c 100644 --- a/DataFusion/src/V1/Accelerator.php +++ b/DataFusion/src/V1/Accelerator.php @@ -20,13 +20,13 @@ class Accelerator extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.datafusion.v1.Accelerator.AcceleratorType accelerator_type = 1; */ - private $accelerator_type = 0; + protected $accelerator_type = 0; /** * The state of the accelerator * * Generated from protobuf field .google.cloud.datafusion.v1.Accelerator.State state = 2; */ - private $state = 0; + protected $state = 0; /** * Constructor. diff --git a/DataFusion/src/V1/Client/DataFusionClient.php b/DataFusion/src/V1/Client/DataFusionClient.php index 412deff52520..85c30581700d 100644 --- a/DataFusion/src/V1/Client/DataFusionClient.php +++ b/DataFusion/src/V1/Client/DataFusionClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a crypto_key * resource. @@ -401,8 +420,10 @@ public function getInstance(GetInstanceRequest $request, array $callOptions = [] * * @throws ApiException Thrown if the API call fails. */ - public function listAvailableVersions(ListAvailableVersionsRequest $request, array $callOptions = []): PagedListResponse - { + public function listAvailableVersions( + ListAvailableVersionsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListAvailableVersions', $request, $callOptions); } diff --git a/DataFusion/src/V1/CreateInstanceRequest.php b/DataFusion/src/V1/CreateInstanceRequest.php index a24b04e5e3a0..ba09ee2de958 100644 --- a/DataFusion/src/V1/CreateInstanceRequest.php +++ b/DataFusion/src/V1/CreateInstanceRequest.php @@ -21,19 +21,19 @@ class CreateInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The name of the instance to create. * * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance_id = ''; + protected $instance_id = ''; /** * An instance resource. * * Generated from protobuf field .google.cloud.datafusion.v1.Instance instance = 3; */ - private $instance = null; + protected $instance = null; /** * @param string $parent Required. The instance's project and location in the format diff --git a/DataFusion/src/V1/CryptoKeyConfig.php b/DataFusion/src/V1/CryptoKeyConfig.php index d6a6c33bfba3..8b36d565ce86 100644 --- a/DataFusion/src/V1/CryptoKeyConfig.php +++ b/DataFusion/src/V1/CryptoKeyConfig.php @@ -23,7 +23,7 @@ class CryptoKeyConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key_reference = 1 [(.google.api.resource_reference) = { */ - private $key_reference = ''; + protected $key_reference = ''; /** * Constructor. diff --git a/DataFusion/src/V1/DataFusionClient.php b/DataFusion/src/V1/DataFusionClient.php deleted file mode 100644 index 0fa786d4e3f7..000000000000 --- a/DataFusion/src/V1/DataFusionClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.datafusion.v1.DataFusion/ListAvailableVersions', - $argument, - ['\Google\Cloud\DataFusion\V1\ListAvailableVersionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists Data Fusion instances in the specified project and location. - * @param \Google\Cloud\DataFusion\V1\ListInstancesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListInstances(\Google\Cloud\DataFusion\V1\ListInstancesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.datafusion.v1.DataFusion/ListInstances', - $argument, - ['\Google\Cloud\DataFusion\V1\ListInstancesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Data Fusion instance. - * @param \Google\Cloud\DataFusion\V1\GetInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetInstance(\Google\Cloud\DataFusion\V1\GetInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.datafusion.v1.DataFusion/GetInstance', - $argument, - ['\Google\Cloud\DataFusion\V1\Instance', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Data Fusion instance in the specified project and location. - * @param \Google\Cloud\DataFusion\V1\CreateInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateInstance(\Google\Cloud\DataFusion\V1\CreateInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.datafusion.v1.DataFusion/CreateInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Date Fusion instance. - * @param \Google\Cloud\DataFusion\V1\DeleteInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteInstance(\Google\Cloud\DataFusion\V1\DeleteInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.datafusion.v1.DataFusion/DeleteInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a single Data Fusion instance. - * @param \Google\Cloud\DataFusion\V1\UpdateInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateInstance(\Google\Cloud\DataFusion\V1\UpdateInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.datafusion.v1.DataFusion/UpdateInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Restart a single Data Fusion instance. - * At the end of an operation instance is fully restarted. - * @param \Google\Cloud\DataFusion\V1\RestartInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestartInstance(\Google\Cloud\DataFusion\V1\RestartInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.datafusion.v1.DataFusion/RestartInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataFusion/src/V1/DeleteInstanceRequest.php b/DataFusion/src/V1/DeleteInstanceRequest.php index 41eb160a0659..323b13f57fd0 100644 --- a/DataFusion/src/V1/DeleteInstanceRequest.php +++ b/DataFusion/src/V1/DeleteInstanceRequest.php @@ -21,7 +21,7 @@ class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The instance resource name in the format diff --git a/DataFusion/src/V1/Gapic/DataFusionGapicClient.php b/DataFusion/src/V1/Gapic/DataFusionGapicClient.php deleted file mode 100644 index 8ed2351b03c7..000000000000 --- a/DataFusion/src/V1/Gapic/DataFusionGapicClient.php +++ /dev/null @@ -1,961 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $instanceId = 'instance_id'; - * $operationResponse = $dataFusionClient->createInstance($formattedParent, $instanceId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataFusionClient->createInstance($formattedParent, $instanceId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataFusionClient->resumeOperation($operationName, 'createInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataFusionClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\DataFusion\V1\Client\DataFusionClient}. - */ -class DataFusionGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.datafusion.v1.DataFusion'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'datafusion.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'datafusion.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $cryptoKeyNameTemplate; - - private static $instanceNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/data_fusion_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/data_fusion_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/data_fusion_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/data_fusion_rest_client_config.php', - ], - ], - ]; - } - - private static function getCryptoKeyNameTemplate() - { - if (self::$cryptoKeyNameTemplate == null) { - self::$cryptoKeyNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' - ); - } - - return self::$cryptoKeyNameTemplate; - } - - private static function getInstanceNameTemplate() - { - if (self::$instanceNameTemplate == null) { - self::$instanceNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ); - } - - return self::$instanceNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'cryptoKey' => self::getCryptoKeyNameTemplate(), - 'instance' => self::getInstanceNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a crypto_key - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * - * @return string The formatted crypto_key resource. - */ - public static function cryptoKeyName( - $project, - $location, - $keyRing, - $cryptoKey - ) { - return self::getCryptoKeyNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $location - * @param string $instance - * - * @return string The formatted instance resource. - */ - public static function instanceName($project, $location, $instance) - { - return self::getInstanceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'instance' => $instance, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} - * - instance: projects/{project}/locations/{location}/instances/{instance} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'datafusion.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a new Data Fusion instance in the specified project and location. - * - * Sample code: - * ``` - * $dataFusionClient = new DataFusionClient(); - * try { - * $formattedParent = $dataFusionClient->locationName('[PROJECT]', '[LOCATION]'); - * $instanceId = 'instance_id'; - * $operationResponse = $dataFusionClient->createInstance($formattedParent, $instanceId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataFusionClient->createInstance($formattedParent, $instanceId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataFusionClient->resumeOperation($operationName, 'createInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataFusionClient->close(); - * } - * ``` - * - * @param string $parent Required. The instance's project and location in the format - * projects/{project}/locations/{location}. - * @param string $instanceId Required. The name of the instance to create. - * @param array $optionalArgs { - * Optional. - * - * @type Instance $instance - * An instance resource. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createInstance( - $parent, - $instanceId, - array $optionalArgs = [] - ) { - $request = new CreateInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['instance'])) { - $request->setInstance($optionalArgs['instance']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateInstance', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Date Fusion instance. - * - * Sample code: - * ``` - * $dataFusionClient = new DataFusionClient(); - * try { - * $formattedName = $dataFusionClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - * $operationResponse = $dataFusionClient->deleteInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataFusionClient->deleteInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataFusionClient->resumeOperation($operationName, 'deleteInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataFusionClient->close(); - * } - * ``` - * - * @param string $name Required. The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteInstance($name, array $optionalArgs = []) - { - $request = new DeleteInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteInstance', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets details of a single Data Fusion instance. - * - * Sample code: - * ``` - * $dataFusionClient = new DataFusionClient(); - * try { - * $formattedName = $dataFusionClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - * $response = $dataFusionClient->getInstance($formattedName); - * } finally { - * $dataFusionClient->close(); - * } - * ``` - * - * @param string $name Required. The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance}. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DataFusion\V1\Instance - * - * @throws ApiException if the remote call fails - */ - public function getInstance($name, array $optionalArgs = []) - { - $request = new GetInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetInstance', - Instance::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists possible versions for Data Fusion instances in the specified project - * and location. - * - * Sample code: - * ``` - * $dataFusionClient = new DataFusionClient(); - * try { - * $formattedParent = $dataFusionClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataFusionClient->listAvailableVersions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataFusionClient->listAvailableVersions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataFusionClient->close(); - * } - * ``` - * - * @param string $parent Required. The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type bool $latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAvailableVersions($parent, array $optionalArgs = []) - { - $request = new ListAvailableVersionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['latestPatchOnly'])) { - $request->setLatestPatchOnly($optionalArgs['latestPatchOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListAvailableVersions', - $optionalArgs, - ListAvailableVersionsResponse::class, - $request - ); - } - - /** - * Lists Data Fusion instances in the specified project and location. - * - * Sample code: - * ``` - * $dataFusionClient = new DataFusionClient(); - * try { - * $formattedParent = $dataFusionClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataFusionClient->listInstances($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataFusionClient->listInstances($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataFusionClient->close(); - * } - * ``` - * - * @param string $parent Required. The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * List filter. - * @type string $orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listInstances($parent, array $optionalArgs = []) - { - $request = new ListInstancesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListInstances', - $optionalArgs, - ListInstancesResponse::class, - $request - ); - } - - /** - * Restart a single Data Fusion instance. - * At the end of an operation instance is fully restarted. - * - * Sample code: - * ``` - * $dataFusionClient = new DataFusionClient(); - * try { - * $formattedName = $dataFusionClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - * $operationResponse = $dataFusionClient->restartInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataFusionClient->restartInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataFusionClient->resumeOperation($operationName, 'restartInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataFusionClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the Data Fusion instance which need to be restarted in the form of - * projects/{project}/locations/{location}/instances/{instance} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function restartInstance($name, array $optionalArgs = []) - { - $request = new RestartInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'RestartInstance', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a single Data Fusion instance. - * - * Sample code: - * ``` - * $dataFusionClient = new DataFusionClient(); - * try { - * $instance = new Instance(); - * $operationResponse = $dataFusionClient->updateInstance($instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataFusionClient->updateInstance($instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataFusionClient->resumeOperation($operationName, 'updateInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataFusionClient->close(); - * } - * ``` - * - * @param Instance $instance Required. The instance resource that replaces the resource on the server. Currently, - * Data Fusion only allows replacing labels, options, and stack driver - * settings. All other fields will be ignored. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields that the update will overwrite - * in an instance resource. The fields specified in the update_mask are - * relative to the resource, not the full request. - * A field will be overwritten if it is in the mask. - * If the user does not provide a mask, all the supported fields (labels, - * options, and version currently) will be overwritten. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateInstance($instance, array $optionalArgs = []) - { - $request = new UpdateInstanceRequest(); - $requestParamHeaders = []; - $request->setInstance($instance); - $requestParamHeaders['instance.name'] = $instance->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateInstance', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } -} diff --git a/DataFusion/src/V1/GetInstanceRequest.php b/DataFusion/src/V1/GetInstanceRequest.php index 8dc7dee0ed17..834a6a4a0037 100644 --- a/DataFusion/src/V1/GetInstanceRequest.php +++ b/DataFusion/src/V1/GetInstanceRequest.php @@ -21,7 +21,7 @@ class GetInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/DataFusion/src/V1/Instance.php b/DataFusion/src/V1/Instance.php index 7bc0227ca85a..9cf4529e3785 100644 --- a/DataFusion/src/V1/Instance.php +++ b/DataFusion/src/V1/Instance.php @@ -21,31 +21,31 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * A description of this instance. * * Generated from protobuf field string description = 2; */ - private $description = ''; + protected $description = ''; /** * Required. Instance type. * * Generated from protobuf field .google.cloud.datafusion.v1.Instance.Type type = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $type = 0; + protected $type = 0; /** * Option to enable Stackdriver Logging. * * Generated from protobuf field bool enable_stackdriver_logging = 4; */ - private $enable_stackdriver_logging = false; + protected $enable_stackdriver_logging = false; /** * Option to enable Stackdriver Monitoring. * * Generated from protobuf field bool enable_stackdriver_monitoring = 5; */ - private $enable_stackdriver_monitoring = false; + protected $enable_stackdriver_monitoring = false; /** * Specifies whether the Data Fusion instance should be private. If set to * true, all Data Fusion nodes will have private IP addresses and will not be @@ -53,14 +53,14 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool private_instance = 6; */ - private $private_instance = false; + protected $private_instance = false; /** * Network configuration options. These are required when a private Data * Fusion instance is to be created. * * Generated from protobuf field .google.cloud.datafusion.v1.NetworkConfig network_config = 7; */ - private $network_config = null; + protected $network_config = null; /** * The resource labels for instance to use to annotate any related underlying * resources such as Compute Engine VMs. The character '=' is not allowed to @@ -81,45 +81,45 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the instance was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. The current state of this Data Fusion instance. * * Generated from protobuf field .google.cloud.datafusion.v1.Instance.State state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information about the current state of this Data * Fusion instance if available. * * Generated from protobuf field string state_message = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_message = ''; + protected $state_message = ''; /** * Output only. Endpoint on which the Data Fusion UI is accessible. * * Generated from protobuf field string service_endpoint = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service_endpoint = ''; + protected $service_endpoint = ''; /** * Name of the zone in which the Data Fusion instance will be created. Only * DEVELOPER instances use this field. * * Generated from protobuf field string zone = 15; */ - private $zone = ''; + protected $zone = ''; /** * Current version of the Data Fusion. Only specifiable in Update. * * Generated from protobuf field string version = 16; */ - private $version = ''; + protected $version = ''; /** * Output only. Deprecated. Use tenant_project_id instead to extract the tenant project ID. * @@ -132,7 +132,7 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 18; */ - private $display_name = ''; + protected $display_name = ''; /** * Available versions that the instance can be upgraded to using * UpdateInstanceRequest. @@ -145,13 +145,13 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string api_endpoint = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_endpoint = ''; + protected $api_endpoint = ''; /** * Output only. Cloud Storage bucket generated by Data Fusion in the customer project. * * Generated from protobuf field string gcs_bucket = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $gcs_bucket = ''; + protected $gcs_bucket = ''; /** * List of accelerators enabled for this CDF instance. * @@ -163,13 +163,13 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string p4_service_account = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $p4_service_account = ''; + protected $p4_service_account = ''; /** * Output only. The name of the tenant project. * * Generated from protobuf field string tenant_project_id = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $tenant_project_id = ''; + protected $tenant_project_id = ''; /** * User-managed service account to set on Dataproc when Cloud Data Fusion * creates Dataproc to run data processing pipelines. @@ -178,20 +178,20 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dataproc_service_account = 25; */ - private $dataproc_service_account = ''; + protected $dataproc_service_account = ''; /** * Option to enable granular role-based access control. * * Generated from protobuf field bool enable_rbac = 27; */ - private $enable_rbac = false; + protected $enable_rbac = false; /** * The crypto key configuration. This field is used by the Customer-Managed * Encryption Keys (CMEK) feature. * * Generated from protobuf field .google.cloud.datafusion.v1.CryptoKeyConfig crypto_key_config = 28; */ - private $crypto_key_config = null; + protected $crypto_key_config = null; /** * Output only. If the instance state is DISABLED, the reason for disabling the instance. * diff --git a/DataFusion/src/V1/ListAvailableVersionsRequest.php b/DataFusion/src/V1/ListAvailableVersionsRequest.php index 1d58816f2f8e..8ae1ae0e0a4c 100644 --- a/DataFusion/src/V1/ListAvailableVersionsRequest.php +++ b/DataFusion/src/V1/ListAvailableVersionsRequest.php @@ -21,20 +21,20 @@ class ListAvailableVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of items to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value to use if there are additional * results to retrieve for this list request. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Whether or not to return the latest patch of every available minor version. * If true, only the latest patch will be returned. Ex. if allowed versions is @@ -42,7 +42,7 @@ class ListAvailableVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool latest_patch_only = 4; */ - private $latest_patch_only = false; + protected $latest_patch_only = false; /** * @param string $parent Required. The project and location for which to retrieve instance information diff --git a/DataFusion/src/V1/ListAvailableVersionsResponse.php b/DataFusion/src/V1/ListAvailableVersionsResponse.php index cb1abbf26fc8..84d6591cac2d 100644 --- a/DataFusion/src/V1/ListAvailableVersionsResponse.php +++ b/DataFusion/src/V1/ListAvailableVersionsResponse.php @@ -27,7 +27,7 @@ class ListAvailableVersionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/DataFusion/src/V1/ListInstancesRequest.php b/DataFusion/src/V1/ListInstancesRequest.php index 37dea8a632d7..ba894d09f34a 100644 --- a/DataFusion/src/V1/ListInstancesRequest.php +++ b/DataFusion/src/V1/ListInstancesRequest.php @@ -23,32 +23,32 @@ class ListInstancesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of items to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value to use if there are additional * results to retrieve for this list request. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * List filter. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * Sort results. Supported values are "name", "name desc", or "" (unsorted). * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * Constructor. diff --git a/DataFusion/src/V1/ListInstancesResponse.php b/DataFusion/src/V1/ListInstancesResponse.php index 7908b0518f2b..95f50a1e2b08 100644 --- a/DataFusion/src/V1/ListInstancesResponse.php +++ b/DataFusion/src/V1/ListInstancesResponse.php @@ -27,7 +27,7 @@ class ListInstancesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/DataFusion/src/V1/NetworkConfig.php b/DataFusion/src/V1/NetworkConfig.php index 890dac8096e8..6a65391a768e 100644 --- a/DataFusion/src/V1/NetworkConfig.php +++ b/DataFusion/src/V1/NetworkConfig.php @@ -28,7 +28,7 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 1; */ - private $network = ''; + protected $network = ''; /** * The IP range in CIDR notation to use for the managed Data Fusion instance * nodes. This range must not overlap with any other ranges used in the @@ -36,7 +36,7 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string ip_allocation = 2; */ - private $ip_allocation = ''; + protected $ip_allocation = ''; /** * Constructor. diff --git a/DataFusion/src/V1/OperationMetadata.php b/DataFusion/src/V1/OperationMetadata.php index 2399455b1f86..6e092c20d7a7 100644 --- a/DataFusion/src/V1/OperationMetadata.php +++ b/DataFusion/src/V1/OperationMetadata.php @@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; */ - private $create_time = null; + protected $create_time = null; /** * The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - private $end_time = null; + protected $end_time = null; /** * Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3; */ - private $target = ''; + protected $target = ''; /** * Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4; */ - private $verb = ''; + protected $verb = ''; /** * Human-readable status of the operation if any. * * Generated from protobuf field string status_detail = 5; */ - private $status_detail = ''; + protected $status_detail = ''; /** * Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -53,13 +53,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * API version used to start the operation. * * Generated from protobuf field string api_version = 7; */ - private $api_version = ''; + protected $api_version = ''; /** * Map to hold any additional status info for the operation * If there is an accelerator being enabled/disabled/deleted, this will be diff --git a/DataFusion/src/V1/RestartInstanceRequest.php b/DataFusion/src/V1/RestartInstanceRequest.php index cf317c82931d..907af0135078 100644 --- a/DataFusion/src/V1/RestartInstanceRequest.php +++ b/DataFusion/src/V1/RestartInstanceRequest.php @@ -21,7 +21,7 @@ class RestartInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/DataFusion/src/V1/UpdateInstanceRequest.php b/DataFusion/src/V1/UpdateInstanceRequest.php index 2962cebafac8..bfa27509b610 100644 --- a/DataFusion/src/V1/UpdateInstanceRequest.php +++ b/DataFusion/src/V1/UpdateInstanceRequest.php @@ -24,7 +24,7 @@ class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.datafusion.v1.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance = null; + protected $instance = null; /** * Field mask is used to specify the fields that the update will overwrite * in an instance resource. The fields specified in the update_mask are @@ -35,7 +35,7 @@ class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\DataFusion\V1\Instance $instance Required. The instance resource that replaces the resource on the server. Currently, diff --git a/DataFusion/src/V1/Version.php b/DataFusion/src/V1/Version.php index ea0524cc6e58..96841661c8c1 100644 --- a/DataFusion/src/V1/Version.php +++ b/DataFusion/src/V1/Version.php @@ -21,13 +21,13 @@ class Version extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version_number = 1; */ - private $version_number = ''; + protected $version_number = ''; /** * Whether this is currently the default version for Cloud Data Fusion * * Generated from protobuf field bool default_version = 2; */ - private $default_version = false; + protected $default_version = false; /** * Represents a list of available feature names for a given version. * @@ -39,7 +39,7 @@ class Version extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.datafusion.v1.Version.Type type = 4; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/DataFusion/tests/Unit/V1/Client/DataFusionClientTest.php b/DataFusion/tests/Unit/V1/Client/DataFusionClientTest.php index 2330c41f6fd9..9be470a733fd 100644 --- a/DataFusion/tests/Unit/V1/Client/DataFusionClientTest.php +++ b/DataFusion/tests/Unit/V1/Client/DataFusionClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DataFusionClient */ @@ -141,9 +143,7 @@ public function createInstanceTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $instanceId = 'instanceId-2101995259'; - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId); + $request = (new CreateInstanceRequest())->setParent($formattedParent)->setInstanceId($instanceId); $response = $gapicClient->createInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -201,19 +201,20 @@ public function createInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $instanceId = 'instanceId-2101995259'; - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId); + $request = (new CreateInstanceRequest())->setParent($formattedParent)->setInstanceId($instanceId); $response = $gapicClient->createInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -267,8 +268,7 @@ public function deleteInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); + $request = (new DeleteInstanceRequest())->setName($formattedName); $response = $gapicClient->deleteInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -324,17 +324,19 @@ public function deleteInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); + $request = (new DeleteInstanceRequest())->setName($formattedName); $response = $gapicClient->deleteInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -404,8 +406,7 @@ public function getInstanceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); + $request = (new GetInstanceRequest())->setName($formattedName); $response = $gapicClient->getInstance($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -429,17 +430,19 @@ public function getInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); + $request = (new GetInstanceRequest())->setName($formattedName); try { $gapicClient->getInstance($request); // If the $gapicClient method call did not throw, fail the test @@ -464,17 +467,14 @@ public function listAvailableVersionsTest() // Mock response $nextPageToken = ''; $availableVersionsElement = new Version(); - $availableVersions = [ - $availableVersionsElement, - ]; + $availableVersions = [$availableVersionsElement]; $expectedResponse = new ListAvailableVersionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAvailableVersions($availableVersions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListAvailableVersionsRequest()) - ->setParent($formattedParent); + $request = (new ListAvailableVersionsRequest())->setParent($formattedParent); $response = $gapicClient->listAvailableVersions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -501,17 +501,19 @@ public function listAvailableVersionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListAvailableVersionsRequest()) - ->setParent($formattedParent); + $request = (new ListAvailableVersionsRequest())->setParent($formattedParent); try { $gapicClient->listAvailableVersions($request); // If the $gapicClient method call did not throw, fail the test @@ -536,17 +538,14 @@ public function listInstancesTest() // Mock response $nextPageToken = ''; $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; + $instances = [$instancesElement]; $expectedResponse = new ListInstancesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setInstances($instances); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); + $request = (new ListInstancesRequest())->setParent($formattedParent); $response = $gapicClient->listInstances($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -573,17 +572,19 @@ public function listInstancesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); + $request = (new ListInstancesRequest())->setParent($formattedParent); try { $gapicClient->listInstances($request); // If the $gapicClient method call did not throw, fail the test @@ -662,8 +663,7 @@ public function restartInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new RestartInstanceRequest()) - ->setName($formattedName); + $request = (new RestartInstanceRequest())->setName($formattedName); $response = $gapicClient->restartInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -719,17 +719,19 @@ public function restartInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new RestartInstanceRequest()) - ->setName($formattedName); + $request = (new RestartInstanceRequest())->setName($formattedName); $response = $gapicClient->restartInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -819,8 +821,7 @@ public function updateInstanceTest() $instance = new Instance(); $instanceType = Type::TYPE_UNSPECIFIED; $instance->setType($instanceType); - $request = (new UpdateInstanceRequest()) - ->setInstance($instance); + $request = (new UpdateInstanceRequest())->setInstance($instance); $response = $gapicClient->updateInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -876,19 +877,21 @@ public function updateInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $instance = new Instance(); $instanceType = Type::TYPE_UNSPECIFIED; $instance->setType($instanceType); - $request = (new UpdateInstanceRequest()) - ->setInstance($instance); + $request = (new UpdateInstanceRequest())->setInstance($instance); $response = $gapicClient->updateInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -977,9 +980,7 @@ public function createInstanceAsyncTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $instanceId = 'instanceId-2101995259'; - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId); + $request = (new CreateInstanceRequest())->setParent($formattedParent)->setInstanceId($instanceId); $response = $gapicClient->createInstanceAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/DataFusion/tests/Unit/V1/DataFusionClientTest.php b/DataFusion/tests/Unit/V1/DataFusionClientTest.php deleted file mode 100644 index 76f61787e25a..000000000000 --- a/DataFusion/tests/Unit/V1/DataFusionClientTest.php +++ /dev/null @@ -1,876 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataFusionClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataFusionClient($options); - } - - /** @test */ - public function createInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $enableStackdriverLogging = true; - $enableStackdriverMonitoring = false; - $privateInstance = false; - $stateMessage = 'stateMessage29641305'; - $serviceEndpoint = 'serviceEndpoint-676052001'; - $zone = 'zone3744684'; - $version = 'version351608024'; - $serviceAccount = 'serviceAccount-1948028253'; - $displayName = 'displayName1615086568'; - $apiEndpoint = 'apiEndpoint-1381395942'; - $gcsBucket = 'gcsBucket-1720393710'; - $p4ServiceAccount = 'p4ServiceAccount-1554461144'; - $tenantProjectId = 'tenantProjectId-2129337674'; - $dataprocServiceAccount = 'dataprocServiceAccount-493324700'; - $enableRbac = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEnableStackdriverLogging($enableStackdriverLogging); - $expectedResponse->setEnableStackdriverMonitoring($enableStackdriverMonitoring); - $expectedResponse->setPrivateInstance($privateInstance); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setServiceEndpoint($serviceEndpoint); - $expectedResponse->setZone($zone); - $expectedResponse->setVersion($version); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setApiEndpoint($apiEndpoint); - $expectedResponse->setGcsBucket($gcsBucket); - $expectedResponse->setP4ServiceAccount($p4ServiceAccount); - $expectedResponse->setTenantProjectId($tenantProjectId); - $expectedResponse->setDataprocServiceAccount($dataprocServiceAccount); - $expectedResponse->setEnableRbac($enableRbac); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $response = $gapicClient->createInstance($formattedParent, $instanceId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datafusion.v1.DataFusion/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $response = $gapicClient->createInstance($formattedParent, $instanceId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $response = $gapicClient->deleteInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datafusion.v1.DataFusion/DeleteInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $response = $gapicClient->deleteInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $enableStackdriverLogging = true; - $enableStackdriverMonitoring = false; - $privateInstance = false; - $stateMessage = 'stateMessage29641305'; - $serviceEndpoint = 'serviceEndpoint-676052001'; - $zone = 'zone3744684'; - $version = 'version351608024'; - $serviceAccount = 'serviceAccount-1948028253'; - $displayName = 'displayName1615086568'; - $apiEndpoint = 'apiEndpoint-1381395942'; - $gcsBucket = 'gcsBucket-1720393710'; - $p4ServiceAccount = 'p4ServiceAccount-1554461144'; - $tenantProjectId = 'tenantProjectId-2129337674'; - $dataprocServiceAccount = 'dataprocServiceAccount-493324700'; - $enableRbac = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setEnableStackdriverLogging($enableStackdriverLogging); - $expectedResponse->setEnableStackdriverMonitoring($enableStackdriverMonitoring); - $expectedResponse->setPrivateInstance($privateInstance); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setServiceEndpoint($serviceEndpoint); - $expectedResponse->setZone($zone); - $expectedResponse->setVersion($version); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setApiEndpoint($apiEndpoint); - $expectedResponse->setGcsBucket($gcsBucket); - $expectedResponse->setP4ServiceAccount($p4ServiceAccount); - $expectedResponse->setTenantProjectId($tenantProjectId); - $expectedResponse->setDataprocServiceAccount($dataprocServiceAccount); - $expectedResponse->setEnableRbac($enableRbac); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $response = $gapicClient->getInstance($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datafusion.v1.DataFusion/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - try { - $gapicClient->getInstance($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAvailableVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $availableVersionsElement = new Version(); - $availableVersions = [ - $availableVersionsElement, - ]; - $expectedResponse = new ListAvailableVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAvailableVersions($availableVersions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listAvailableVersions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAvailableVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datafusion.v1.DataFusion/ListAvailableVersions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAvailableVersionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listAvailableVersions($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInstances($instances); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listInstances($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datafusion.v1.DataFusion/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listInstances($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restartInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restartInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $enableStackdriverLogging = true; - $enableStackdriverMonitoring = false; - $privateInstance = false; - $stateMessage = 'stateMessage29641305'; - $serviceEndpoint = 'serviceEndpoint-676052001'; - $zone = 'zone3744684'; - $version = 'version351608024'; - $serviceAccount = 'serviceAccount-1948028253'; - $displayName = 'displayName1615086568'; - $apiEndpoint = 'apiEndpoint-1381395942'; - $gcsBucket = 'gcsBucket-1720393710'; - $p4ServiceAccount = 'p4ServiceAccount-1554461144'; - $tenantProjectId = 'tenantProjectId-2129337674'; - $dataprocServiceAccount = 'dataprocServiceAccount-493324700'; - $enableRbac = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setEnableStackdriverLogging($enableStackdriverLogging); - $expectedResponse->setEnableStackdriverMonitoring($enableStackdriverMonitoring); - $expectedResponse->setPrivateInstance($privateInstance); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setServiceEndpoint($serviceEndpoint); - $expectedResponse->setZone($zone); - $expectedResponse->setVersion($version); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setApiEndpoint($apiEndpoint); - $expectedResponse->setGcsBucket($gcsBucket); - $expectedResponse->setP4ServiceAccount($p4ServiceAccount); - $expectedResponse->setTenantProjectId($tenantProjectId); - $expectedResponse->setDataprocServiceAccount($dataprocServiceAccount); - $expectedResponse->setEnableRbac($enableRbac); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restartInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $response = $gapicClient->restartInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datafusion.v1.DataFusion/RestartInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restartInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restartInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $response = $gapicClient->restartInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $enableStackdriverLogging = true; - $enableStackdriverMonitoring = false; - $privateInstance = false; - $stateMessage = 'stateMessage29641305'; - $serviceEndpoint = 'serviceEndpoint-676052001'; - $zone = 'zone3744684'; - $version = 'version351608024'; - $serviceAccount = 'serviceAccount-1948028253'; - $displayName = 'displayName1615086568'; - $apiEndpoint = 'apiEndpoint-1381395942'; - $gcsBucket = 'gcsBucket-1720393710'; - $p4ServiceAccount = 'p4ServiceAccount-1554461144'; - $tenantProjectId = 'tenantProjectId-2129337674'; - $dataprocServiceAccount = 'dataprocServiceAccount-493324700'; - $enableRbac = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEnableStackdriverLogging($enableStackdriverLogging); - $expectedResponse->setEnableStackdriverMonitoring($enableStackdriverMonitoring); - $expectedResponse->setPrivateInstance($privateInstance); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setServiceEndpoint($serviceEndpoint); - $expectedResponse->setZone($zone); - $expectedResponse->setVersion($version); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setApiEndpoint($apiEndpoint); - $expectedResponse->setGcsBucket($gcsBucket); - $expectedResponse->setP4ServiceAccount($p4ServiceAccount); - $expectedResponse->setTenantProjectId($tenantProjectId); - $expectedResponse->setDataprocServiceAccount($dataprocServiceAccount); - $expectedResponse->setEnableRbac($enableRbac); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $instance = new Instance(); - $instanceType = Type::TYPE_UNSPECIFIED; - $instance->setType($instanceType); - $response = $gapicClient->updateInstance($instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datafusion.v1.DataFusion/UpdateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $instance = new Instance(); - $instanceType = Type::TYPE_UNSPECIFIED; - $instance->setType($instanceType); - $response = $gapicClient->updateInstance($instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/DataLabeling/.repo-metadata.json b/DataLabeling/.repo-metadata.json deleted file mode 100644 index 03e7212145e2..000000000000 --- a/DataLabeling/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-datalabeling", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datalabeling/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "datalabeling" -} diff --git a/DataLabeling/VERSION b/DataLabeling/VERSION index be14282b7fff..d1d899fa33a0 100644 --- a/DataLabeling/VERSION +++ b/DataLabeling/VERSION @@ -1 +1 @@ -0.5.3 +0.5.5 diff --git a/DataLabeling/composer.json b/DataLabeling/composer.json index b96890094814..7be9eca437a1 100644 --- a/DataLabeling/composer.json +++ b/DataLabeling/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Dataflow/.repo-metadata.json b/Dataflow/.repo-metadata.json deleted file mode 100644 index 5687ff3882b3..000000000000 --- a/Dataflow/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-dataflow", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataflow/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "dataflow" -} diff --git a/Dataflow/VERSION b/Dataflow/VERSION index b6160487433b..d2b13eb644d6 100644 --- a/Dataflow/VERSION +++ b/Dataflow/VERSION @@ -1 +1 @@ -0.6.2 +0.6.4 diff --git a/Dataflow/composer.json b/Dataflow/composer.json index ab3330728750..8f5a7419d84b 100644 --- a/Dataflow/composer.json +++ b/Dataflow/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Dataform/.repo-metadata.json b/Dataform/.repo-metadata.json deleted file mode 100644 index f3f7ad44048a..000000000000 --- a/Dataform/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-dataform", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataform/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/dataform/docs", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "dataform" -} diff --git a/Dataform/VERSION b/Dataform/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/Dataform/VERSION +++ b/Dataform/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/Dataform/composer.json b/Dataform/composer.json index b8ace8ff49aa..7ccbe5e90714 100644 --- a/Dataform/composer.json +++ b/Dataform/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Dataplex/.repo-metadata.json b/Dataplex/.repo-metadata.json deleted file mode 100644 index 33578b3f8e93..000000000000 --- a/Dataplex/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-dataplex", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataplex/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "dataplex" -} diff --git a/Dataplex/README.md b/Dataplex/README.md index fb895ef7e6a2..5aa7ef97753e 100644 --- a/Dataplex/README.md +++ b/Dataplex/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/Dataplex/VERSION b/Dataplex/VERSION index e815b861f023..2a0970ca757c 100644 --- a/Dataplex/VERSION +++ b/Dataplex/VERSION @@ -1 +1 @@ -0.15.1 +0.16.1 diff --git a/Dataplex/composer.json b/Dataplex/composer.json index a3195ea7f02d..84b1d073af29 100644 --- a/Dataplex/composer.json +++ b/Dataplex/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Dataplex/metadata/V1/Catalog.php b/Dataplex/metadata/V1/Catalog.php index 1f1ca35e5621..cf7ececbce98 100644 --- a/Dataplex/metadata/V1/Catalog.php +++ b/Dataplex/metadata/V1/Catalog.php @@ -26,7 +26,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -¢p +În &google/cloud/dataplex/v1/catalog.protogoogle.cloud.dataplex.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/cloud/dataplex/v1/service.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"Ó AspectType8 @@ -297,16 +297,8 @@ public static function initOnce() { page_token ( BàA order_by ( BàA -scope ( BàA"Ê -SearchEntriesResult -entry ( B - display_name ( B - -entry_type ( B3 - modify_time ( 2.google.protobuf.TimestampB -fully_qualified_name ( B - description ( B -relative_resource ( B +scope ( BàA"ö +SearchEntriesResult linked_resource ( 7 dataplex_entry ( 2.google.cloud.dataplex.v1.EntryH snippets ( 26.google.cloud.dataplex.v1.SearchEntriesResult.SnippetsC diff --git a/Dataplex/metadata/V1/DataQuality.php b/Dataplex/metadata/V1/DataQuality.php index b56b8520e8f38a8ab5117ec24a0d99884c5e2197..a0ce2465cea50134879bb5a477c98a8eacb3e842 100644 GIT binary patch delta 156 zcmdm~aZ_`{OeU7^%3Ru$|1(K$-p0hs!T5FZ5w0srLJC~MiN(dKMJ1W}dGSU0K9y8;4)IJ3P1`xgS42eY~w-T@#I8wwL)b8}^KbZKvHUvh7EUt@1| rZgdz8AOR=?B9a1=n;icW5)ldwQ&CJ`K~qyjQdCJ#P7n#RnjJj>5fmGj delta 36 ucmV+<0NekEKG!|4y8;5#H?zG0`xgS~2D7>v-T?z5{{fS@9RIV*9X$aj)(?^Z diff --git a/Dataplex/owlbot.py b/Dataplex/owlbot.py index 5bc5a75e58bf..90ac3ac53e11 100644 --- a/Dataplex/owlbot.py +++ b/Dataplex/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -47,32 +41,6 @@ + "\n", '') -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) - # format generated clients subprocess.run([ 'npm', @@ -81,8 +49,8 @@ '--package=@prettier/plugin-php@^0.16', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', - '--print-width=80']) + '--print-width=120']) diff --git a/Dataplex/src/V1/Action.php b/Dataplex/src/V1/Action.php index 3ce67f3d3604..a7fcaca2fc61 100644 --- a/Dataplex/src/V1/Action.php +++ b/Dataplex/src/V1/Action.php @@ -20,19 +20,19 @@ class Action extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Action.Category category = 1; */ - private $category = 0; + protected $category = 0; /** * Detailed description of the issue requiring action. * * Generated from protobuf field string issue = 2; */ - private $issue = ''; + protected $issue = ''; /** * The time that the issue was detected. * * Generated from protobuf field .google.protobuf.Timestamp detect_time = 4; */ - private $detect_time = null; + protected $detect_time = null; /** * Output only. The relative resource name of the action, of the form: * `projects/{project}/locations/{location}/lakes/{lake}/actions/{action}` @@ -41,28 +41,28 @@ class Action extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. The relative resource name of the lake, of the form: * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. * * Generated from protobuf field string lake = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $lake = ''; + protected $lake = ''; /** * Output only. The relative resource name of the zone, of the form: * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. * * Generated from protobuf field string zone = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $zone = ''; + protected $zone = ''; /** * Output only. The relative resource name of the asset, of the form: * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. * * Generated from protobuf field string asset = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $asset = ''; + protected $asset = ''; /** * The list of data locations associated with this action. Cloud Storage * locations are represented as URI paths(E.g. diff --git a/Dataplex/src/V1/Action/FailedSecurityPolicyApply.php b/Dataplex/src/V1/Action/FailedSecurityPolicyApply.php index 4a68cd4c89ce..a94c94d636b6 100644 --- a/Dataplex/src/V1/Action/FailedSecurityPolicyApply.php +++ b/Dataplex/src/V1/Action/FailedSecurityPolicyApply.php @@ -24,7 +24,7 @@ class FailedSecurityPolicyApply extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string asset = 1; */ - private $asset = ''; + protected $asset = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Action/IncompatibleDataSchema.php b/Dataplex/src/V1/Action/IncompatibleDataSchema.php index b182a4293e64..6586606cc65b 100644 --- a/Dataplex/src/V1/Action/IncompatibleDataSchema.php +++ b/Dataplex/src/V1/Action/IncompatibleDataSchema.php @@ -20,21 +20,21 @@ class IncompatibleDataSchema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table = 1; */ - private $table = ''; + protected $table = ''; /** * The existing and expected schema of the table. The schema is provided as * a JSON formatted structure listing columns and data types. * * Generated from protobuf field string existing_schema = 2; */ - private $existing_schema = ''; + protected $existing_schema = ''; /** * The new and incompatible schema within the table. The schema is provided * as a JSON formatted structured listing columns and data types. * * Generated from protobuf field string new_schema = 3; */ - private $new_schema = ''; + protected $new_schema = ''; /** * The list of data locations sampled and used for format/schema * inference. @@ -47,7 +47,7 @@ class IncompatibleDataSchema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange schema_change = 5; */ - private $schema_change = 0; + protected $schema_change = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Action/InvalidDataFormat.php b/Dataplex/src/V1/Action/InvalidDataFormat.php index a0c6811732ca..d22fb2bc716a 100644 --- a/Dataplex/src/V1/Action/InvalidDataFormat.php +++ b/Dataplex/src/V1/Action/InvalidDataFormat.php @@ -27,13 +27,13 @@ class InvalidDataFormat extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string expected_format = 2; */ - private $expected_format = ''; + protected $expected_format = ''; /** * The new unexpected data format within the entity. * * Generated from protobuf field string new_format = 3; */ - private $new_format = ''; + protected $new_format = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Action/InvalidDataPartition.php b/Dataplex/src/V1/Action/InvalidDataPartition.php index 7feec4b28c41..79ae3dcaee7d 100644 --- a/Dataplex/src/V1/Action/InvalidDataPartition.php +++ b/Dataplex/src/V1/Action/InvalidDataPartition.php @@ -20,7 +20,7 @@ class InvalidDataPartition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure expected_structure = 1; */ - private $expected_structure = 0; + protected $expected_structure = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Aspect.php b/Dataplex/src/V1/Aspect.php index 132357c5198b..f4bf896cbff4 100644 --- a/Dataplex/src/V1/Aspect.php +++ b/Dataplex/src/V1/Aspect.php @@ -20,25 +20,25 @@ class Aspect extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string aspect_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $aspect_type = ''; + protected $aspect_type = ''; /** * Output only. The path in the entry under which the aspect is attached. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $path = ''; + protected $path = ''; /** * Output only. The time when the Aspect was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the Aspect was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Required. The content of the aspect, according to its aspect type schema. * This will replace `content`. @@ -46,11 +46,11 @@ class Aspect extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Struct data = 8 [(.google.api.field_behavior) = REQUIRED]; */ - private $data = null; + protected $data = null; /** * Generated from protobuf field .google.cloud.dataplex.v1.AspectSource aspect_source = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $aspect_source = null; + protected $aspect_source = null; /** * Constructor. diff --git a/Dataplex/src/V1/AspectSource.php b/Dataplex/src/V1/AspectSource.php index 0422a25db5ba..65fc88f959c5 100644 --- a/Dataplex/src/V1/AspectSource.php +++ b/Dataplex/src/V1/AspectSource.php @@ -21,13 +21,13 @@ class AspectSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 10; */ - private $create_time = null; + protected $create_time = null; /** * The update time of the aspect in the source system. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/Dataplex/src/V1/AspectType.php b/Dataplex/src/V1/AspectType.php index edb8b471d574..40dd2a9326b1 100644 --- a/Dataplex/src/V1/AspectType.php +++ b/Dataplex/src/V1/AspectType.php @@ -22,7 +22,7 @@ class AspectType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the AspectType. This * ID will be different if the AspectType is deleted and re-created with the @@ -30,31 +30,31 @@ class AspectType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the AspectType was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the AspectType was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Description of the AspectType. * * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. User-defined labels for the AspectType. * @@ -68,26 +68,26 @@ class AspectType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 8; */ - private $etag = ''; + protected $etag = ''; /** * Immutable. Authorization defined for this type. * * Generated from protobuf field .google.cloud.dataplex.v1.AspectType.Authorization authorization = 52 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $authorization = null; + protected $authorization = null; /** * Required. MetadataTemplate of the aspect. * * Generated from protobuf field .google.cloud.dataplex.v1.AspectType.MetadataTemplate metadata_template = 53 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_template = null; + protected $metadata_template = null; /** * Output only. Denotes the transfer status of the Aspect Type. It is * unspecified for Aspect Types created from Dataplex API. * * Generated from protobuf field .google.cloud.dataplex.v1.TransferStatus transfer_status = 202 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $transfer_status = 0; + protected $transfer_status = 0; /** * Constructor. diff --git a/Dataplex/src/V1/AspectType/Authorization.php b/Dataplex/src/V1/AspectType/Authorization.php index 7172ca76cc61..ee7f50c39035 100644 --- a/Dataplex/src/V1/AspectType/Authorization.php +++ b/Dataplex/src/V1/AspectType/Authorization.php @@ -22,7 +22,7 @@ class Authorization extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string alternate_use_permission = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $alternate_use_permission = ''; + protected $alternate_use_permission = ''; /** * Constructor. diff --git a/Dataplex/src/V1/AspectType/MetadataTemplate.php b/Dataplex/src/V1/AspectType/MetadataTemplate.php index dddceb96391c..e631c9330608 100644 --- a/Dataplex/src/V1/AspectType/MetadataTemplate.php +++ b/Dataplex/src/V1/AspectType/MetadataTemplate.php @@ -25,13 +25,13 @@ class MetadataTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 index = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $index = 0; + protected $index = 0; /** * Required. The name of the field. * * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The datatype of this field. The following values are supported: * Primitive types (string, integer, boolean, double, datetime); datetime @@ -41,7 +41,7 @@ class MetadataTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type = 5 [(.google.api.field_behavior) = REQUIRED]; */ - private $type = ''; + protected $type = ''; /** * Optional. Field definition, needs to be specified if the type is record. * Defines the nested fields. @@ -65,7 +65,7 @@ class MetadataTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.AspectType.MetadataTemplate map_items = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $map_items = null; + protected $map_items = null; /** * Optional. array_items needs to be set if the type is array. array_items * can refer to a primitive field or a complex (record only) field. To @@ -75,7 +75,7 @@ class MetadataTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.AspectType.MetadataTemplate array_items = 11 [(.google.api.field_behavior) = OPTIONAL]; */ - private $array_items = null; + protected $array_items = null; /** * Optional. Id can be used if this definition of the field needs to be * reused later. Id needs to be unique across the entire template. Id can @@ -83,7 +83,7 @@ class MetadataTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type_id = 12 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type_id = ''; + protected $type_id = ''; /** * Optional. A reference to another field definition (instead of an inline * definition). The value must be equal to the value of an id field defined @@ -92,19 +92,19 @@ class MetadataTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type_ref = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type_ref = ''; + protected $type_ref = ''; /** * Optional. Specifies the constraints on this field. * * Generated from protobuf field .google.cloud.dataplex.v1.AspectType.MetadataTemplate.Constraints constraints = 50 [(.google.api.field_behavior) = OPTIONAL]; */ - private $constraints = null; + protected $constraints = null; /** * Optional. Specifies annotations on this field. * * Generated from protobuf field .google.cloud.dataplex.v1.AspectType.MetadataTemplate.Annotations annotations = 51 [(.google.api.field_behavior) = OPTIONAL]; */ - private $annotations = null; + protected $annotations = null; /** * Constructor. diff --git a/Dataplex/src/V1/AspectType/MetadataTemplate/Annotations.php b/Dataplex/src/V1/AspectType/MetadataTemplate/Annotations.php index e2fd2c221e22..e63de64648ae 100644 --- a/Dataplex/src/V1/AspectType/MetadataTemplate/Annotations.php +++ b/Dataplex/src/V1/AspectType/MetadataTemplate/Annotations.php @@ -21,26 +21,26 @@ class Annotations extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string deprecated = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $deprecated = ''; + protected $deprecated = ''; /** * Optional. Specify a displayname for a field. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. Specify a description for a field * * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. Specify a display order for a field. Display order can be * used to reorder where a field is rendered * * Generated from protobuf field int32 display_order = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_order = 0; + protected $display_order = 0; /** * Optional. String Type annotations can be used to specify special * meaning to string fields. The following values are supported: richText: @@ -49,7 +49,7 @@ class Annotations extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string string_type = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $string_type = ''; + protected $string_type = ''; /** * Optional. Suggested hints for string fields. These can be used to * suggest values to users, through an UI for example. diff --git a/Dataplex/src/V1/AspectType/MetadataTemplate/Constraints.php b/Dataplex/src/V1/AspectType/MetadataTemplate/Constraints.php index 028898c12956..1af617b6bd14 100644 --- a/Dataplex/src/V1/AspectType/MetadataTemplate/Constraints.php +++ b/Dataplex/src/V1/AspectType/MetadataTemplate/Constraints.php @@ -20,7 +20,7 @@ class Constraints extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool required = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $required = false; + protected $required = false; /** * Constructor. diff --git a/Dataplex/src/V1/AspectType/MetadataTemplate/EnumValue.php b/Dataplex/src/V1/AspectType/MetadataTemplate/EnumValue.php index db2ce2fdd928..619144388291 100644 --- a/Dataplex/src/V1/AspectType/MetadataTemplate/EnumValue.php +++ b/Dataplex/src/V1/AspectType/MetadataTemplate/EnumValue.php @@ -20,21 +20,21 @@ class EnumValue extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 index = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $index = 0; + protected $index = 0; /** * Required. Name of the enumvalue. This is the actual value that the * aspect will contain. * * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. Optional deprecation message to be set if an enum value needs * to be deprecated. * * Generated from protobuf field string deprecated = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $deprecated = ''; + protected $deprecated = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Asset.php b/Dataplex/src/V1/Asset.php index b3efdc08003d..86dcebf8476a 100644 --- a/Dataplex/src/V1/Asset.php +++ b/Dataplex/src/V1/Asset.php @@ -22,13 +22,13 @@ class Asset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. System generated globally unique ID for the asset. This ID * will be different if the asset is deleted and re-created with the same @@ -36,19 +36,19 @@ class Asset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the asset was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the asset was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. User defined labels for the asset. * @@ -60,32 +60,32 @@ class Asset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. Current state of the asset. * * Generated from protobuf field .google.cloud.dataplex.v1.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Required. Specification of the resource that is referenced by this asset. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.ResourceSpec resource_spec = 100 [(.google.api.field_behavior) = REQUIRED]; */ - private $resource_spec = null; + protected $resource_spec = null; /** * Output only. Status of the resource referenced by this asset. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.ResourceStatus resource_status = 101 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $resource_status = null; + protected $resource_status = null; /** * Output only. Status of the security policy applied to resource referenced * by this asset. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.SecurityStatus security_status = 103 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $security_status = null; + protected $security_status = null; /** * Optional. Specification of the discovery feature applied to data referenced * by this asset. When this spec is left unset, the asset will use the spec @@ -93,14 +93,14 @@ class Asset extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.DiscoverySpec discovery_spec = 106 [(.google.api.field_behavior) = OPTIONAL]; */ - private $discovery_spec = null; + protected $discovery_spec = null; /** * Output only. Status of the discovery feature applied to data referenced by * this asset. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.DiscoveryStatus discovery_status = 107 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $discovery_status = null; + protected $discovery_status = null; /** * Constructor. diff --git a/Dataplex/src/V1/Asset/DiscoverySpec.php b/Dataplex/src/V1/Asset/DiscoverySpec.php index 1858d5219e2c..966ff1c57d4a 100644 --- a/Dataplex/src/V1/Asset/DiscoverySpec.php +++ b/Dataplex/src/V1/Asset/DiscoverySpec.php @@ -20,7 +20,7 @@ class DiscoverySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enabled = false; + protected $enabled = false; /** * Optional. The list of patterns to apply for selecting data to include * during discovery if only a subset of the data should considered. For @@ -45,13 +45,13 @@ class DiscoverySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions csv_options = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $csv_options = null; + protected $csv_options = null; /** * Optional. Configuration for Json data. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions json_options = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $json_options = null; + protected $json_options = null; protected $trigger; /** diff --git a/Dataplex/src/V1/Asset/DiscoverySpec/CsvOptions.php b/Dataplex/src/V1/Asset/DiscoverySpec/CsvOptions.php index 0643550f2067..79bb36e267c9 100644 --- a/Dataplex/src/V1/Asset/DiscoverySpec/CsvOptions.php +++ b/Dataplex/src/V1/Asset/DiscoverySpec/CsvOptions.php @@ -21,27 +21,27 @@ class CsvOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 header_rows = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $header_rows = 0; + protected $header_rows = 0; /** * Optional. The delimiter being used to separate values. This defaults to * ','. * * Generated from protobuf field string delimiter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $delimiter = ''; + protected $delimiter = ''; /** * Optional. The character encoding of the data. The default is UTF-8. * * Generated from protobuf field string encoding = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $encoding = ''; + protected $encoding = ''; /** * Optional. Whether to disable the inference of data type for CSV data. * If true, all columns will be registered as strings. * * Generated from protobuf field bool disable_type_inference = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_type_inference = false; + protected $disable_type_inference = false; /** * Constructor. diff --git a/Dataplex/src/V1/Asset/DiscoverySpec/JsonOptions.php b/Dataplex/src/V1/Asset/DiscoverySpec/JsonOptions.php index 0e510f4e0a56..292bde759d42 100644 --- a/Dataplex/src/V1/Asset/DiscoverySpec/JsonOptions.php +++ b/Dataplex/src/V1/Asset/DiscoverySpec/JsonOptions.php @@ -20,7 +20,7 @@ class JsonOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string encoding = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $encoding = ''; + protected $encoding = ''; /** * Optional. Whether to disable the inference of data type for Json data. * If true, all columns will be registered as their primitive types @@ -28,7 +28,7 @@ class JsonOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_type_inference = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_type_inference = false; + protected $disable_type_inference = false; /** * Constructor. diff --git a/Dataplex/src/V1/Asset/DiscoveryStatus.php b/Dataplex/src/V1/Asset/DiscoveryStatus.php index 9cad920d26b3..feb86a2817e4 100644 --- a/Dataplex/src/V1/Asset/DiscoveryStatus.php +++ b/Dataplex/src/V1/Asset/DiscoveryStatus.php @@ -20,37 +20,37 @@ class DiscoveryStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.DiscoveryStatus.State state = 1; */ - private $state = 0; + protected $state = 0; /** * Additional information about the current state. * * Generated from protobuf field string message = 2; */ - private $message = ''; + protected $message = ''; /** * Last update time of the status. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3; */ - private $update_time = null; + protected $update_time = null; /** * The start time of the last discovery run. * * Generated from protobuf field .google.protobuf.Timestamp last_run_time = 4; */ - private $last_run_time = null; + protected $last_run_time = null; /** * Data Stats of the asset reported by discovery. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats stats = 6; */ - private $stats = null; + protected $stats = null; /** * The duration of the last discovery run. * * Generated from protobuf field .google.protobuf.Duration last_run_duration = 7; */ - private $last_run_duration = null; + protected $last_run_duration = null; /** * Constructor. diff --git a/Dataplex/src/V1/Asset/DiscoveryStatus/Stats.php b/Dataplex/src/V1/Asset/DiscoveryStatus/Stats.php index 2979683371c0..c081745fefc5 100644 --- a/Dataplex/src/V1/Asset/DiscoveryStatus/Stats.php +++ b/Dataplex/src/V1/Asset/DiscoveryStatus/Stats.php @@ -20,25 +20,25 @@ class Stats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 data_items = 1; */ - private $data_items = 0; + protected $data_items = 0; /** * The number of stored data bytes within the referenced resource. * * Generated from protobuf field int64 data_size = 2; */ - private $data_size = 0; + protected $data_size = 0; /** * The count of table entities within the referenced resource. * * Generated from protobuf field int64 tables = 3; */ - private $tables = 0; + protected $tables = 0; /** * The count of fileset entities within the referenced resource. * * Generated from protobuf field int64 filesets = 4; */ - private $filesets = 0; + protected $filesets = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Asset/ResourceSpec.php b/Dataplex/src/V1/Asset/ResourceSpec.php index 99832e949acf..9f59eed2da6b 100644 --- a/Dataplex/src/V1/Asset/ResourceSpec.php +++ b/Dataplex/src/V1/Asset/ResourceSpec.php @@ -23,20 +23,20 @@ class ResourceSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Required. Immutable. Type of resource. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.ResourceSpec.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $type = 0; + protected $type = 0; /** * Optional. Determines how read permissions are handled for each asset and * their associated tables. Only available to storage buckets assets. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.ResourceSpec.AccessMode read_access_mode = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $read_access_mode = 0; + protected $read_access_mode = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Asset/ResourceStatus.php b/Dataplex/src/V1/Asset/ResourceStatus.php index e240d32759ff..f2b956094514 100644 --- a/Dataplex/src/V1/Asset/ResourceStatus.php +++ b/Dataplex/src/V1/Asset/ResourceStatus.php @@ -20,25 +20,25 @@ class ResourceStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.ResourceStatus.State state = 1; */ - private $state = 0; + protected $state = 0; /** * Additional information about the current state. * * Generated from protobuf field string message = 2; */ - private $message = ''; + protected $message = ''; /** * Last update time of the status. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Service account associated with the BigQuery Connection. * * Generated from protobuf field string managed_access_identity = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $managed_access_identity = ''; + protected $managed_access_identity = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Asset/SecurityStatus.php b/Dataplex/src/V1/Asset/SecurityStatus.php index 5eebcf10965c..694530a11b1c 100644 --- a/Dataplex/src/V1/Asset/SecurityStatus.php +++ b/Dataplex/src/V1/Asset/SecurityStatus.php @@ -22,19 +22,19 @@ class SecurityStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Asset.SecurityStatus.State state = 1; */ - private $state = 0; + protected $state = 0; /** * Additional information about the current state. * * Generated from protobuf field string message = 2; */ - private $message = ''; + protected $message = ''; /** * Last update time of the status. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/Dataplex/src/V1/AssetStatus.php b/Dataplex/src/V1/AssetStatus.php index b01df51f6493..0ac2ee4ec6d3 100644 --- a/Dataplex/src/V1/AssetStatus.php +++ b/Dataplex/src/V1/AssetStatus.php @@ -20,20 +20,20 @@ class AssetStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; */ - private $update_time = null; + protected $update_time = null; /** * Number of active assets. * * Generated from protobuf field int32 active_assets = 2; */ - private $active_assets = 0; + protected $active_assets = 0; /** * Number of assets that are in process of updating the security policy on * attached resources. * * Generated from protobuf field int32 security_policy_applying_assets = 3; */ - private $security_policy_applying_assets = 0; + protected $security_policy_applying_assets = 0; /** * Constructor. diff --git a/Dataplex/src/V1/CancelJobRequest.php b/Dataplex/src/V1/CancelJobRequest.php index d3805d6621e6..39eaf72e4716 100644 --- a/Dataplex/src/V1/CancelJobRequest.php +++ b/Dataplex/src/V1/CancelJobRequest.php @@ -21,7 +21,7 @@ class CancelJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the job: diff --git a/Dataplex/src/V1/CatalogServiceClient.php b/Dataplex/src/V1/CatalogServiceClient.php deleted file mode 100644 index 422fdb41c9df..000000000000 --- a/Dataplex/src/V1/CatalogServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a aspect_type * resource. @@ -1045,8 +1064,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } diff --git a/Dataplex/src/V1/Client/ContentServiceClient.php b/Dataplex/src/V1/Client/ContentServiceClient.php index 99441a944034..88e6e19da0ec 100644 --- a/Dataplex/src/V1/Client/ContentServiceClient.php +++ b/Dataplex/src/V1/Client/ContentServiceClient.php @@ -1,6 +1,6 @@ startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } diff --git a/Dataplex/src/V1/Client/DataScanServiceClient.php b/Dataplex/src/V1/Client/DataScanServiceClient.php index 0491f2e2808b..d7aea8c542ca 100644 --- a/Dataplex/src/V1/Client/DataScanServiceClient.php +++ b/Dataplex/src/V1/Client/DataScanServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a data_scan * resource. @@ -218,8 +237,13 @@ public static function dataScanJobName(string $project, string $location, string * * @return string The formatted entity resource. */ - public static function entityName(string $project, string $location, string $lake, string $zone, string $entity): string - { + public static function entityName( + string $project, + string $location, + string $lake, + string $zone, + string $entity + ): string { return self::getPathTemplate('entity')->render([ 'project' => $project, 'location' => $location, @@ -419,8 +443,10 @@ public function deleteDataScan(DeleteDataScanRequest $request, array $callOption * * @throws ApiException Thrown if the API call fails. */ - public function generateDataQualityRules(GenerateDataQualityRulesRequest $request, array $callOptions = []): GenerateDataQualityRulesResponse - { + public function generateDataQualityRules( + GenerateDataQualityRulesRequest $request, + array $callOptions = [] + ): GenerateDataQualityRulesResponse { return $this->startApiCall('GenerateDataQualityRules', $request, $callOptions)->wait(); } @@ -664,8 +690,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } diff --git a/Dataplex/src/V1/Client/DataTaxonomyServiceClient.php b/Dataplex/src/V1/Client/DataTaxonomyServiceClient.php index aa54e31cac82..c9691942bfb4 100644 --- a/Dataplex/src/V1/Client/DataTaxonomyServiceClient.php +++ b/Dataplex/src/V1/Client/DataTaxonomyServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * data_attribute resource. @@ -187,8 +206,12 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted data_attribute resource. */ - public static function dataAttributeName(string $project, string $location, string $dataTaxonomy, string $dataAttributeId): string - { + public static function dataAttributeName( + string $project, + string $location, + string $dataTaxonomy, + string $dataAttributeId + ): string { return self::getPathTemplate('dataAttribute')->render([ 'project' => $project, 'location' => $location, @@ -207,8 +230,11 @@ public static function dataAttributeName(string $project, string $location, stri * * @return string The formatted data_attribute_binding resource. */ - public static function dataAttributeBindingName(string $project, string $location, string $dataAttributeBindingId): string - { + public static function dataAttributeBindingName( + string $project, + string $location, + string $dataAttributeBindingId + ): string { return self::getPathTemplate('dataAttributeBinding')->render([ 'project' => $project, 'location' => $location, @@ -400,8 +426,10 @@ public function createDataAttribute(CreateDataAttributeRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function createDataAttributeBinding(CreateDataAttributeBindingRequest $request, array $callOptions = []): OperationResponse - { + public function createDataAttributeBinding( + CreateDataAttributeBindingRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateDataAttributeBinding', $request, $callOptions)->wait(); } @@ -483,8 +511,10 @@ public function deleteDataAttribute(DeleteDataAttributeRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function deleteDataAttributeBinding(DeleteDataAttributeBindingRequest $request, array $callOptions = []): OperationResponse - { + public function deleteDataAttributeBinding( + DeleteDataAttributeBindingRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteDataAttributeBinding', $request, $callOptions)->wait(); } @@ -564,8 +594,10 @@ public function getDataAttribute(GetDataAttributeRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function getDataAttributeBinding(GetDataAttributeBindingRequest $request, array $callOptions = []): DataAttributeBinding - { + public function getDataAttributeBinding( + GetDataAttributeBindingRequest $request, + array $callOptions = [] + ): DataAttributeBinding { return $this->startApiCall('GetDataAttributeBinding', $request, $callOptions)->wait(); } @@ -617,8 +649,10 @@ public function getDataTaxonomy(GetDataTaxonomyRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function listDataAttributeBindings(ListDataAttributeBindingsRequest $request, array $callOptions = []): PagedListResponse - { + public function listDataAttributeBindings( + ListDataAttributeBindingsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListDataAttributeBindings', $request, $callOptions); } @@ -725,8 +759,10 @@ public function updateDataAttribute(UpdateDataAttributeRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function updateDataAttributeBinding(UpdateDataAttributeBindingRequest $request, array $callOptions = []): OperationResponse - { + public function updateDataAttributeBinding( + UpdateDataAttributeBindingRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateDataAttributeBinding', $request, $callOptions)->wait(); } @@ -842,8 +878,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } diff --git a/Dataplex/src/V1/Client/DataplexServiceClient.php b/Dataplex/src/V1/Client/DataplexServiceClient.php index e1182f4d3bf3..60cb0c5845a3 100644 --- a/Dataplex/src/V1/Client/DataplexServiceClient.php +++ b/Dataplex/src/V1/Client/DataplexServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a asset * resource. @@ -231,8 +250,13 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted asset resource. */ - public static function assetName(string $project, string $location, string $lake, string $zone, string $asset): string - { + public static function assetName( + string $project, + string $location, + string $lake, + string $zone, + string $asset + ): string { return self::getPathTemplate('asset')->render([ 'project' => $project, 'location' => $location, @@ -1410,8 +1434,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } diff --git a/Dataplex/src/V1/Client/MetadataServiceClient.php b/Dataplex/src/V1/Client/MetadataServiceClient.php index a61bf9ea91cc..69088348a127 100644 --- a/Dataplex/src/V1/Client/MetadataServiceClient.php +++ b/Dataplex/src/V1/Client/MetadataServiceClient.php @@ -1,6 +1,6 @@ render([ 'project' => $project, 'location' => $location, @@ -165,8 +168,14 @@ public static function entityName(string $project, string $location, string $lak * * @return string The formatted partition resource. */ - public static function partitionName(string $project, string $location, string $lake, string $zone, string $entity, string $partition): string - { + public static function partitionName( + string $project, + string $location, + string $lake, + string $zone, + string $entity, + string $partition + ): string { return self::getPathTemplate('partition')->render([ 'project' => $project, 'location' => $location, @@ -609,8 +618,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } diff --git a/Dataplex/src/V1/Content.php b/Dataplex/src/V1/Content.php index e797080e0175..bdf804b99374 100644 --- a/Dataplex/src/V1/Content.php +++ b/Dataplex/src/V1/Content.php @@ -21,7 +21,7 @@ class Content extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the content. This ID * will be different if the content is deleted and re-created with the same @@ -29,7 +29,7 @@ class Content extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Required. The path for the Content file, represented as directory * structure. Unique within a lake. Limited to alphanumerics, hyphens, @@ -37,19 +37,19 @@ class Content extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string path = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Output only. Content creation time. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the content was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. User defined labels for the content. * @@ -61,7 +61,7 @@ class Content extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; protected $data; protected $content; diff --git a/Dataplex/src/V1/Content/Notebook.php b/Dataplex/src/V1/Content/Notebook.php index c4e76cef92b4..4c3eaf0f41dd 100644 --- a/Dataplex/src/V1/Content/Notebook.php +++ b/Dataplex/src/V1/Content/Notebook.php @@ -20,7 +20,7 @@ class Notebook extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Content.Notebook.KernelType kernel_type = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $kernel_type = 0; + protected $kernel_type = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Content/SqlScript.php b/Dataplex/src/V1/Content/SqlScript.php index 7d2d6592b950..d69b01d4e3b8 100644 --- a/Dataplex/src/V1/Content/SqlScript.php +++ b/Dataplex/src/V1/Content/SqlScript.php @@ -20,7 +20,7 @@ class SqlScript extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Content.SqlScript.QueryEngine engine = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $engine = 0; + protected $engine = 0; /** * Constructor. diff --git a/Dataplex/src/V1/ContentServiceClient.php b/Dataplex/src/V1/ContentServiceClient.php deleted file mode 100644 index bb88da5fb161..000000000000 --- a/Dataplex/src/V1/ContentServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.dataplex.v1.ContentService/CreateContent', - $argument, - ['\Google\Cloud\Dataplex\V1\Content', 'decode'], - $metadata, $options); - } - - /** - * Update a content. Only supports full resource update. - * @param \Google\Cloud\Dataplex\V1\UpdateContentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateContent(\Google\Cloud\Dataplex\V1\UpdateContentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.ContentService/UpdateContent', - $argument, - ['\Google\Cloud\Dataplex\V1\Content', 'decode'], - $metadata, $options); - } - - /** - * Delete a content. - * @param \Google\Cloud\Dataplex\V1\DeleteContentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteContent(\Google\Cloud\Dataplex\V1\DeleteContentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.ContentService/DeleteContent', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Get a content resource. - * @param \Google\Cloud\Dataplex\V1\GetContentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetContent(\Google\Cloud\Dataplex\V1\GetContentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.ContentService/GetContent', - $argument, - ['\Google\Cloud\Dataplex\V1\Content', 'decode'], - $metadata, $options); - } - - /** - * Gets the access control policy for a contentitem resource. A `NOT_FOUND` - * error is returned if the resource does not exist. An empty policy is - * returned if the resource exists but does not have a policy set on it. - * - * Caller must have Google IAM `dataplex.content.getIamPolicy` permission - * on the resource. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.ContentService/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Sets the access control policy on the specified contentitem resource. - * Replaces any existing policy. - * - * Caller must have Google IAM `dataplex.content.setIamPolicy` permission - * on the resource. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.ContentService/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Returns the caller's permissions on a resource. - * If the resource does not exist, an empty set of - * permissions is returned (a `NOT_FOUND` error is not returned). - * - * A caller is not required to have Google IAM permission to make this - * request. - * - * Note: This operation is designed to be used for building permission-aware - * UIs and command-line tools, not for authorization checking. This operation - * may "fail open" without warning. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.ContentService/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - - /** - * List content. - * @param \Google\Cloud\Dataplex\V1\ListContentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListContent(\Google\Cloud\Dataplex\V1\ListContentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.ContentService/ListContent', - $argument, - ['\Google\Cloud\Dataplex\V1\ListContentResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataplex/src/V1/CreateAspectTypeRequest.php b/Dataplex/src/V1/CreateAspectTypeRequest.php index 453a45a4ecad..265c62c444db 100644 --- a/Dataplex/src/V1/CreateAspectTypeRequest.php +++ b/Dataplex/src/V1/CreateAspectTypeRequest.php @@ -22,26 +22,26 @@ class CreateAspectTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. AspectType identifier. * * Generated from protobuf field string aspect_type_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $aspect_type_id = ''; + protected $aspect_type_id = ''; /** * Required. AspectType Resource * * Generated from protobuf field .google.cloud.dataplex.v1.AspectType aspect_type = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $aspect_type = null; + protected $aspect_type = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the AspectType, of the form: diff --git a/Dataplex/src/V1/CreateAssetRequest.php b/Dataplex/src/V1/CreateAssetRequest.php index de09d7f7f192..7738558c8804 100644 --- a/Dataplex/src/V1/CreateAssetRequest.php +++ b/Dataplex/src/V1/CreateAssetRequest.php @@ -21,7 +21,7 @@ class CreateAssetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Asset identifier. * This ID will be used to generate names such as table names when publishing @@ -34,20 +34,20 @@ class CreateAssetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string asset_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $asset_id = ''; + protected $asset_id = ''; /** * Required. Asset resource. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset asset = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $asset = null; + protected $asset = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent zone: diff --git a/Dataplex/src/V1/CreateContentRequest.php b/Dataplex/src/V1/CreateContentRequest.php index c78d47175cbd..b9f40119a99d 100644 --- a/Dataplex/src/V1/CreateContentRequest.php +++ b/Dataplex/src/V1/CreateContentRequest.php @@ -21,20 +21,20 @@ class CreateContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Content resource. * * Generated from protobuf field .google.cloud.dataplex.v1.Content content = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $content = null; + protected $content = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent lake: diff --git a/Dataplex/src/V1/CreateDataAttributeBindingRequest.php b/Dataplex/src/V1/CreateDataAttributeBindingRequest.php index 953828d2798e..02408fcac3c9 100644 --- a/Dataplex/src/V1/CreateDataAttributeBindingRequest.php +++ b/Dataplex/src/V1/CreateDataAttributeBindingRequest.php @@ -21,7 +21,7 @@ class CreateDataAttributeBindingRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. DataAttributeBinding identifier. * * Must contain only lowercase letters, numbers and hyphens. @@ -32,20 +32,20 @@ class CreateDataAttributeBindingRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string data_attribute_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_attribute_binding_id = ''; + protected $data_attribute_binding_id = ''; /** * Required. DataAttributeBinding resource. * * Generated from protobuf field .google.cloud.dataplex.v1.DataAttributeBinding data_attribute_binding = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_attribute_binding = null; + protected $data_attribute_binding = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent data taxonomy diff --git a/Dataplex/src/V1/CreateDataAttributeRequest.php b/Dataplex/src/V1/CreateDataAttributeRequest.php index 31cffa385553..62977dd678c9 100644 --- a/Dataplex/src/V1/CreateDataAttributeRequest.php +++ b/Dataplex/src/V1/CreateDataAttributeRequest.php @@ -21,7 +21,7 @@ class CreateDataAttributeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. DataAttribute identifier. * * Must contain only lowercase letters, numbers and hyphens. @@ -32,20 +32,20 @@ class CreateDataAttributeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_attribute_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_attribute_id = ''; + protected $data_attribute_id = ''; /** * Required. DataAttribute resource. * * Generated from protobuf field .google.cloud.dataplex.v1.DataAttribute data_attribute = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_attribute = null; + protected $data_attribute = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent data taxonomy diff --git a/Dataplex/src/V1/CreateDataScanRequest.php b/Dataplex/src/V1/CreateDataScanRequest.php index 400f8a418587..ff546cc358c2 100644 --- a/Dataplex/src/V1/CreateDataScanRequest.php +++ b/Dataplex/src/V1/CreateDataScanRequest.php @@ -23,13 +23,13 @@ class CreateDataScanRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. DataScan resource. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScan data_scan = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_scan = null; + protected $data_scan = null; /** * Required. DataScan identifier. * * Must contain only lowercase letters, numbers and hyphens. @@ -40,14 +40,14 @@ class CreateDataScanRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_scan_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_scan_id = ''; + protected $data_scan_id = ''; /** * Optional. Only validate the request, but do not perform mutations. * The default is `false`. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent location: diff --git a/Dataplex/src/V1/CreateDataTaxonomyRequest.php b/Dataplex/src/V1/CreateDataTaxonomyRequest.php index 17bd5dd341cc..6576b106053c 100644 --- a/Dataplex/src/V1/CreateDataTaxonomyRequest.php +++ b/Dataplex/src/V1/CreateDataTaxonomyRequest.php @@ -22,7 +22,7 @@ class CreateDataTaxonomyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. DataTaxonomy identifier. * * Must contain only lowercase letters, numbers and hyphens. @@ -33,20 +33,20 @@ class CreateDataTaxonomyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_taxonomy_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_taxonomy_id = ''; + protected $data_taxonomy_id = ''; /** * Required. DataTaxonomy resource. * * Generated from protobuf field .google.cloud.dataplex.v1.DataTaxonomy data_taxonomy = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_taxonomy = null; + protected $data_taxonomy = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the data taxonomy location, of the form: diff --git a/Dataplex/src/V1/CreateEntityRequest.php b/Dataplex/src/V1/CreateEntityRequest.php index 4ee2541cd0e9..a20402edd79a 100644 --- a/Dataplex/src/V1/CreateEntityRequest.php +++ b/Dataplex/src/V1/CreateEntityRequest.php @@ -21,20 +21,20 @@ class CreateEntityRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Entity resource. * * Generated from protobuf field .google.cloud.dataplex.v1.Entity entity = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $entity = null; + protected $entity = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent zone: diff --git a/Dataplex/src/V1/CreateEntryGroupRequest.php b/Dataplex/src/V1/CreateEntryGroupRequest.php index 2b653eeaddab..ddda7b08816b 100644 --- a/Dataplex/src/V1/CreateEntryGroupRequest.php +++ b/Dataplex/src/V1/CreateEntryGroupRequest.php @@ -22,26 +22,26 @@ class CreateEntryGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. EntryGroup identifier. * * Generated from protobuf field string entry_group_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $entry_group_id = ''; + protected $entry_group_id = ''; /** * Required. EntryGroup Resource * * Generated from protobuf field .google.cloud.dataplex.v1.EntryGroup entry_group = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $entry_group = null; + protected $entry_group = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the entryGroup, of the form: diff --git a/Dataplex/src/V1/CreateEntryRequest.php b/Dataplex/src/V1/CreateEntryRequest.php index 217dcc7d1567..0d76b839f4bd 100644 --- a/Dataplex/src/V1/CreateEntryRequest.php +++ b/Dataplex/src/V1/CreateEntryRequest.php @@ -19,7 +19,7 @@ class CreateEntryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Entry identifier. It has to be unique within an Entry Group. * Entries corresponding to Google Cloud resources use Entry ID format based @@ -39,13 +39,13 @@ class CreateEntryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entry_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $entry_id = ''; + protected $entry_id = ''; /** * Required. Entry resource. * * Generated from protobuf field .google.cloud.dataplex.v1.Entry entry = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $entry = null; + protected $entry = null; /** * @param string $parent Required. The resource name of the parent Entry Group: diff --git a/Dataplex/src/V1/CreateEntryTypeRequest.php b/Dataplex/src/V1/CreateEntryTypeRequest.php index 0975199846e7..86b2c2c7f620 100644 --- a/Dataplex/src/V1/CreateEntryTypeRequest.php +++ b/Dataplex/src/V1/CreateEntryTypeRequest.php @@ -22,26 +22,26 @@ class CreateEntryTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. EntryType identifier. * * Generated from protobuf field string entry_type_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $entry_type_id = ''; + protected $entry_type_id = ''; /** * Required. EntryType Resource * * Generated from protobuf field .google.cloud.dataplex.v1.EntryType entry_type = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $entry_type = null; + protected $entry_type = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the EntryType, of the form: diff --git a/Dataplex/src/V1/CreateEnvironmentRequest.php b/Dataplex/src/V1/CreateEnvironmentRequest.php index 5bbfe4dd81ba..9c62503fb5e7 100644 --- a/Dataplex/src/V1/CreateEnvironmentRequest.php +++ b/Dataplex/src/V1/CreateEnvironmentRequest.php @@ -21,7 +21,7 @@ class CreateEnvironmentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Environment identifier. * * Must contain only lowercase letters, numbers and hyphens. @@ -32,20 +32,20 @@ class CreateEnvironmentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $environment_id = ''; + protected $environment_id = ''; /** * Required. Environment resource. * * Generated from protobuf field .google.cloud.dataplex.v1.Environment environment = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $environment = null; + protected $environment = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent lake: diff --git a/Dataplex/src/V1/CreateLakeRequest.php b/Dataplex/src/V1/CreateLakeRequest.php index 15240cbb5ca1..0a4f55da6883 100644 --- a/Dataplex/src/V1/CreateLakeRequest.php +++ b/Dataplex/src/V1/CreateLakeRequest.php @@ -22,7 +22,7 @@ class CreateLakeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Lake identifier. * This ID will be used to generate names such as database and dataset names @@ -35,20 +35,20 @@ class CreateLakeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string lake_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $lake_id = ''; + protected $lake_id = ''; /** * Required. Lake resource * * Generated from protobuf field .google.cloud.dataplex.v1.Lake lake = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $lake = null; + protected $lake = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the lake location, of the form: diff --git a/Dataplex/src/V1/CreatePartitionRequest.php b/Dataplex/src/V1/CreatePartitionRequest.php index 28ac54a412a2..103aa8f21d19 100644 --- a/Dataplex/src/V1/CreatePartitionRequest.php +++ b/Dataplex/src/V1/CreatePartitionRequest.php @@ -21,20 +21,20 @@ class CreatePartitionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Partition resource. * * Generated from protobuf field .google.cloud.dataplex.v1.Partition partition = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $partition = null; + protected $partition = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent zone: diff --git a/Dataplex/src/V1/CreateTaskRequest.php b/Dataplex/src/V1/CreateTaskRequest.php index 0fc3aee98594..5fb51f83898d 100644 --- a/Dataplex/src/V1/CreateTaskRequest.php +++ b/Dataplex/src/V1/CreateTaskRequest.php @@ -21,26 +21,26 @@ class CreateTaskRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Task identifier. * * Generated from protobuf field string task_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $task_id = ''; + protected $task_id = ''; /** * Required. Task resource. * * Generated from protobuf field .google.cloud.dataplex.v1.Task task = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $task = null; + protected $task = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent lake: diff --git a/Dataplex/src/V1/CreateZoneRequest.php b/Dataplex/src/V1/CreateZoneRequest.php index 30d96f8bd8bc..6ef76089afec 100644 --- a/Dataplex/src/V1/CreateZoneRequest.php +++ b/Dataplex/src/V1/CreateZoneRequest.php @@ -21,7 +21,7 @@ class CreateZoneRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Zone identifier. * This ID will be used to generate names such as database and dataset names @@ -35,20 +35,20 @@ class CreateZoneRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string zone_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $zone_id = ''; + protected $zone_id = ''; /** * Required. Zone resource. * * Generated from protobuf field .google.cloud.dataplex.v1.Zone zone = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $zone = null; + protected $zone = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The resource name of the parent lake: diff --git a/Dataplex/src/V1/DataAttribute.php b/Dataplex/src/V1/DataAttribute.php index 8e0af3732fa1..6e3eca726f5e 100644 --- a/Dataplex/src/V1/DataAttribute.php +++ b/Dataplex/src/V1/DataAttribute.php @@ -30,7 +30,7 @@ class DataAttribute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the DataAttribute. * This ID will be different if the DataAttribute is deleted and re-created @@ -38,31 +38,31 @@ class DataAttribute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the DataAttribute was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the DataAttribute was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Description of the DataAttribute. * * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. User-defined labels for the DataAttribute. * @@ -77,13 +77,13 @@ class DataAttribute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent_id = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $parent_id = ''; + protected $parent_id = ''; /** * Output only. The number of child attributes present for this attribute. * * Generated from protobuf field int32 attribute_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $attribute_count = 0; + protected $attribute_count = 0; /** * This checksum is computed by the server based on the value of other * fields, and may be sent on update and delete requests to ensure the @@ -91,21 +91,21 @@ class DataAttribute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 10; */ - private $etag = ''; + protected $etag = ''; /** * Optional. Specified when applied to a resource (eg: Cloud Storage bucket, * BigQuery dataset, BigQuery table). * * Generated from protobuf field .google.cloud.dataplex.v1.ResourceAccessSpec resource_access_spec = 100 [(.google.api.field_behavior) = OPTIONAL]; */ - private $resource_access_spec = null; + protected $resource_access_spec = null; /** * Optional. Specified when applied to data stored on the resource (eg: rows, * columns in BigQuery Tables). * * Generated from protobuf field .google.cloud.dataplex.v1.DataAccessSpec data_access_spec = 101 [(.google.api.field_behavior) = OPTIONAL]; */ - private $data_access_spec = null; + protected $data_access_spec = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataAttributeBinding.php b/Dataplex/src/V1/DataAttributeBinding.php index b529283ddb54..0b04d11921e0 100644 --- a/Dataplex/src/V1/DataAttributeBinding.php +++ b/Dataplex/src/V1/DataAttributeBinding.php @@ -23,7 +23,7 @@ class DataAttributeBinding extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the * DataAttributeBinding. This ID will be different if the DataAttributeBinding @@ -31,31 +31,31 @@ class DataAttributeBinding extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the DataAttributeBinding was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the DataAttributeBinding was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Description of the DataAttributeBinding. * * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. User-defined labels for the DataAttributeBinding. * @@ -71,7 +71,7 @@ class DataAttributeBinding extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 8; */ - private $etag = ''; + protected $etag = ''; /** * Optional. List of attributes to be associated with the resource, provided * in the form: diff --git a/Dataplex/src/V1/DataAttributeBinding/Path.php b/Dataplex/src/V1/DataAttributeBinding/Path.php index 2f97f8e5a999..9c16b4ce141a 100644 --- a/Dataplex/src/V1/DataAttributeBinding/Path.php +++ b/Dataplex/src/V1/DataAttributeBinding/Path.php @@ -23,7 +23,7 @@ class Path extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. List of attributes to be associated with the path of the * resource, provided in the form: diff --git a/Dataplex/src/V1/DataProfileResult.php b/Dataplex/src/V1/DataProfileResult.php index 84a5b3bbb42a..ec707235fd6c 100644 --- a/Dataplex/src/V1/DataProfileResult.php +++ b/Dataplex/src/V1/DataProfileResult.php @@ -21,25 +21,25 @@ class DataProfileResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 row_count = 3; */ - private $row_count = 0; + protected $row_count = 0; /** * The profile information per field. * * Generated from protobuf field .google.cloud.dataplex.v1.DataProfileResult.Profile profile = 4; */ - private $profile = null; + protected $profile = null; /** * The data scanned for this result. * * Generated from protobuf field .google.cloud.dataplex.v1.ScannedData scanned_data = 5; */ - private $scanned_data = null; + protected $scanned_data = null; /** * Output only. The result of post scan actions. * * Generated from protobuf field .google.cloud.dataplex.v1.DataProfileResult.PostScanActionsResult post_scan_actions_result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $post_scan_actions_result = null; + protected $post_scan_actions_result = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileResult/PostScanActionsResult.php b/Dataplex/src/V1/DataProfileResult/PostScanActionsResult.php index c291011064d7..89b4ec492e8d 100644 --- a/Dataplex/src/V1/DataProfileResult/PostScanActionsResult.php +++ b/Dataplex/src/V1/DataProfileResult/PostScanActionsResult.php @@ -20,7 +20,7 @@ class PostScanActionsResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataProfileResult.PostScanActionsResult.BigQueryExportResult bigquery_export_result = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $bigquery_export_result = null; + protected $bigquery_export_result = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileResult/PostScanActionsResult/BigQueryExportResult.php b/Dataplex/src/V1/DataProfileResult/PostScanActionsResult/BigQueryExportResult.php index 805c20fce5ac..ac445920ba80 100644 --- a/Dataplex/src/V1/DataProfileResult/PostScanActionsResult/BigQueryExportResult.php +++ b/Dataplex/src/V1/DataProfileResult/PostScanActionsResult/BigQueryExportResult.php @@ -20,13 +20,13 @@ class BigQueryExportResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataProfileResult.PostScanActionsResult.BigQueryExportResult.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information about the BigQuery exporting. * * Generated from protobuf field string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $message = ''; + protected $message = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileResult/Profile/Field.php b/Dataplex/src/V1/DataProfileResult/Profile/Field.php index c155eff6ca68..a1661157cb77 100644 --- a/Dataplex/src/V1/DataProfileResult/Profile/Field.php +++ b/Dataplex/src/V1/DataProfileResult/Profile/Field.php @@ -20,7 +20,7 @@ class Field extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The data type retrieved from the schema of the data source. For * instance, for a BigQuery native table, it is the [BigQuery Table @@ -30,7 +30,7 @@ class Field extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type = 2; */ - private $type = ''; + protected $type = ''; /** * The mode of the field. Possible values include: * * REQUIRED, if it is a required field. @@ -39,13 +39,13 @@ class Field extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string mode = 3; */ - private $mode = ''; + protected $mode = ''; /** * Profile information for the corresponding field. * * Generated from protobuf field .google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo profile = 4; */ - private $profile = null; + protected $profile = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo.php b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo.php index 0aafe1a26fbc..f3578fb41226 100644 --- a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo.php +++ b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo.php @@ -20,7 +20,7 @@ class ProfileInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double null_ratio = 2; */ - private $null_ratio = 0.0; + protected $null_ratio = 0.0; /** * Ratio of rows with distinct values against total scanned rows. * Not available for complex non-groupable field type RECORD and fields @@ -28,7 +28,7 @@ class ProfileInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double distinct_ratio = 3; */ - private $distinct_ratio = 0.0; + protected $distinct_ratio = 0.0; /** * The list of top N non-null values, frequency and ratio with which * they occur in the scanned data. N is 10 or equal to the number of diff --git a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/DoubleFieldInfo.php b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/DoubleFieldInfo.php index b86406b122b9..e0a4897a890c 100644 --- a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/DoubleFieldInfo.php +++ b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/DoubleFieldInfo.php @@ -21,21 +21,21 @@ class DoubleFieldInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double average = 1; */ - private $average = 0.0; + protected $average = 0.0; /** * Standard deviation of non-null values in the scanned data. NaN, if * the field has a NaN. * * Generated from protobuf field double standard_deviation = 3; */ - private $standard_deviation = 0.0; + protected $standard_deviation = 0.0; /** * Minimum of non-null values in the scanned data. NaN, if the field * has a NaN. * * Generated from protobuf field double min = 4; */ - private $min = 0.0; + protected $min = 0.0; /** * A quartile divides the number of data points into four parts, or * quarters, of more-or-less equal size. Three main quartiles used @@ -58,7 +58,7 @@ class DoubleFieldInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double max = 5; */ - private $max = 0.0; + protected $max = 0.0; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/IntegerFieldInfo.php b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/IntegerFieldInfo.php index f8d667f543be..09f5bf4c2d16 100644 --- a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/IntegerFieldInfo.php +++ b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/IntegerFieldInfo.php @@ -21,21 +21,21 @@ class IntegerFieldInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double average = 1; */ - private $average = 0.0; + protected $average = 0.0; /** * Standard deviation of non-null values in the scanned data. NaN, if * the field has a NaN. * * Generated from protobuf field double standard_deviation = 3; */ - private $standard_deviation = 0.0; + protected $standard_deviation = 0.0; /** * Minimum of non-null values in the scanned data. NaN, if the field * has a NaN. * * Generated from protobuf field int64 min = 4; */ - private $min = 0; + protected $min = 0; /** * A quartile divides the number of data points into four parts, or * quarters, of more-or-less equal size. Three main quartiles used @@ -59,7 +59,7 @@ class IntegerFieldInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 max = 5; */ - private $max = 0; + protected $max = 0; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/StringFieldInfo.php b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/StringFieldInfo.php index 504677034368..d3d59838ee44 100644 --- a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/StringFieldInfo.php +++ b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/StringFieldInfo.php @@ -20,19 +20,19 @@ class StringFieldInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 min_length = 1; */ - private $min_length = 0; + protected $min_length = 0; /** * Maximum length of non-null values in the scanned data. * * Generated from protobuf field int64 max_length = 2; */ - private $max_length = 0; + protected $max_length = 0; /** * Average length of non-null values in the scanned data. * * Generated from protobuf field double average_length = 3; */ - private $average_length = 0.0; + protected $average_length = 0.0; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/TopNValue.php b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/TopNValue.php index 1f0c6478449f..9192590259cd 100644 --- a/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/TopNValue.php +++ b/Dataplex/src/V1/DataProfileResult/Profile/Field/ProfileInfo/TopNValue.php @@ -20,20 +20,20 @@ class TopNValue extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string value = 1; */ - private $value = ''; + protected $value = ''; /** * Count of the corresponding value in the scanned data. * * Generated from protobuf field int64 count = 2; */ - private $count = 0; + protected $count = 0; /** * Ratio of the corresponding value in the field against the total * number of rows in the scanned data. * * Generated from protobuf field double ratio = 3; */ - private $ratio = 0.0; + protected $ratio = 0.0; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileSpec.php b/Dataplex/src/V1/DataProfileSpec.php index b194a40163de..9451a8623510 100644 --- a/Dataplex/src/V1/DataProfileSpec.php +++ b/Dataplex/src/V1/DataProfileSpec.php @@ -25,7 +25,7 @@ class DataProfileSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float sampling_percent = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $sampling_percent = 0.0; + protected $sampling_percent = 0.0; /** * Optional. A filter applied to all rows in a single DataScan job. * The filter needs to be a valid SQL expression for a WHERE clause in @@ -34,13 +34,13 @@ class DataProfileSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string row_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $row_filter = ''; + protected $row_filter = ''; /** * Optional. Actions to take upon job completion.. * * Generated from protobuf field .google.cloud.dataplex.v1.DataProfileSpec.PostScanActions post_scan_actions = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $post_scan_actions = null; + protected $post_scan_actions = null; /** * Optional. The fields to include in data profile. * If not specified, all fields at the time of profile scan job execution are @@ -48,7 +48,7 @@ class DataProfileSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataProfileSpec.SelectedFields include_fields = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $include_fields = null; + protected $include_fields = null; /** * Optional. The fields to exclude from data profile. * If specified, the fields will be excluded from data profile, regardless of @@ -56,7 +56,7 @@ class DataProfileSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataProfileSpec.SelectedFields exclude_fields = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $exclude_fields = null; + protected $exclude_fields = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileSpec/PostScanActions.php b/Dataplex/src/V1/DataProfileSpec/PostScanActions.php index d02c5a6a0049..b536c31d398c 100644 --- a/Dataplex/src/V1/DataProfileSpec/PostScanActions.php +++ b/Dataplex/src/V1/DataProfileSpec/PostScanActions.php @@ -21,7 +21,7 @@ class PostScanActions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataProfileSpec.PostScanActions.BigQueryExport bigquery_export = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $bigquery_export = null; + protected $bigquery_export = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataProfileSpec/PostScanActions/BigQueryExport.php b/Dataplex/src/V1/DataProfileSpec/PostScanActions/BigQueryExport.php index dfae3f999dae..090380811fd6 100644 --- a/Dataplex/src/V1/DataProfileSpec/PostScanActions/BigQueryExport.php +++ b/Dataplex/src/V1/DataProfileSpec/PostScanActions/BigQueryExport.php @@ -22,7 +22,7 @@ class BigQueryExport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string results_table = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $results_table = ''; + protected $results_table = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityColumnResult.php b/Dataplex/src/V1/DataQualityColumnResult.php index f5ba17c1a185..7ae5f505d5b6 100644 --- a/Dataplex/src/V1/DataQualityColumnResult.php +++ b/Dataplex/src/V1/DataQualityColumnResult.php @@ -21,7 +21,7 @@ class DataQualityColumnResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string column = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $column = ''; + protected $column = ''; /** * Output only. The column-level data quality score for this data scan job if * and only if the 'column' field is set. @@ -30,7 +30,7 @@ class DataQualityColumnResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $score = null; + protected $score = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityDimension.php b/Dataplex/src/V1/DataQualityDimension.php index cce04568241c..dbc14cbdc2de 100644 --- a/Dataplex/src/V1/DataQualityDimension.php +++ b/Dataplex/src/V1/DataQualityDimension.php @@ -23,7 +23,7 @@ class DataQualityDimension extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityDimensionResult.php b/Dataplex/src/V1/DataQualityDimensionResult.php index 4cdc351a4c8a..5f9a689db9f9 100644 --- a/Dataplex/src/V1/DataQualityDimensionResult.php +++ b/Dataplex/src/V1/DataQualityDimensionResult.php @@ -21,13 +21,13 @@ class DataQualityDimensionResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityDimension dimension = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $dimension = null; + protected $dimension = null; /** * Whether the dimension passed or failed. * * Generated from protobuf field bool passed = 3; */ - private $passed = false; + protected $passed = false; /** * Output only. The dimension-level data quality score for this data scan job * if and only if the 'dimension' field is set. @@ -36,7 +36,7 @@ class DataQualityDimensionResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional float score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $score = null; + protected $score = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityResult.php b/Dataplex/src/V1/DataQualityResult.php index 1ec7cb1cff3c..8daeb1cb9bca 100644 --- a/Dataplex/src/V1/DataQualityResult.php +++ b/Dataplex/src/V1/DataQualityResult.php @@ -20,14 +20,14 @@ class DataQualityResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool passed = 5; */ - private $passed = false; + protected $passed = false; /** * Output only. The overall data quality score. * The score ranges between [0, 100] (up to two decimal points). * * Generated from protobuf field optional float score = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $score = null; + protected $score = null; /** * A list of results at the dimension level. * A dimension will have a corresponding `DataQualityDimensionResult` if and @@ -55,19 +55,19 @@ class DataQualityResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 row_count = 4; */ - private $row_count = 0; + protected $row_count = 0; /** * The data scanned for this result. * * Generated from protobuf field .google.cloud.dataplex.v1.ScannedData scanned_data = 7; */ - private $scanned_data = null; + protected $scanned_data = null; /** * Output only. The result of post scan actions. * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityResult.PostScanActionsResult post_scan_actions_result = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $post_scan_actions_result = null; + protected $post_scan_actions_result = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityResult/PostScanActionsResult.php b/Dataplex/src/V1/DataQualityResult/PostScanActionsResult.php index ffebae7e1d0f..c3ee72329d79 100644 --- a/Dataplex/src/V1/DataQualityResult/PostScanActionsResult.php +++ b/Dataplex/src/V1/DataQualityResult/PostScanActionsResult.php @@ -20,7 +20,7 @@ class PostScanActionsResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityResult.PostScanActionsResult.BigQueryExportResult bigquery_export_result = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $bigquery_export_result = null; + protected $bigquery_export_result = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityResult/PostScanActionsResult/BigQueryExportResult.php b/Dataplex/src/V1/DataQualityResult/PostScanActionsResult/BigQueryExportResult.php index 2a52177f232d..14e1895c32d6 100644 --- a/Dataplex/src/V1/DataQualityResult/PostScanActionsResult/BigQueryExportResult.php +++ b/Dataplex/src/V1/DataQualityResult/PostScanActionsResult/BigQueryExportResult.php @@ -20,13 +20,13 @@ class BigQueryExportResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityResult.PostScanActionsResult.BigQueryExportResult.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information about the BigQuery exporting. * * Generated from protobuf field string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $message = ''; + protected $message = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityRule.php b/Dataplex/src/V1/DataQualityRule.php index 2bdc8fcf9ab3..e280573c33cc 100644 --- a/Dataplex/src/V1/DataQualityRule.php +++ b/Dataplex/src/V1/DataQualityRule.php @@ -20,7 +20,7 @@ class DataQualityRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string column = 500 [(.google.api.field_behavior) = OPTIONAL]; */ - private $column = ''; + protected $column = ''; /** * Optional. Rows with `null` values will automatically fail a rule, unless * `ignore_null` is `true`. In that case, such `null` rows are trivially @@ -33,7 +33,7 @@ class DataQualityRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool ignore_null = 501 [(.google.api.field_behavior) = OPTIONAL]; */ - private $ignore_null = false; + protected $ignore_null = false; /** * Required. The dimension a rule belongs to. Results are also aggregated at * the dimension level. Supported dimensions are **["COMPLETENESS", @@ -41,7 +41,7 @@ class DataQualityRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dimension = 502 [(.google.api.field_behavior) = REQUIRED]; */ - private $dimension = ''; + protected $dimension = ''; /** * Optional. The minimum ratio of **passing_rows / total_rows** required to * pass this rule, with a range of [0.0, 1.0]. @@ -50,7 +50,7 @@ class DataQualityRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double threshold = 503 [(.google.api.field_behavior) = OPTIONAL]; */ - private $threshold = 0.0; + protected $threshold = 0.0; /** * Optional. A mutable name for the rule. * * The name must contain only letters (a-z, A-Z), numbers (0-9), or @@ -61,14 +61,14 @@ class DataQualityRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 504 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Optional. Description of the rule. * * The maximum length is 1,024 characters. * * Generated from protobuf field string description = 505 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; protected $rule_type; /** @@ -99,6 +99,9 @@ class DataQualityRule extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Dataplex\V1\DataQualityRule\TableConditionExpectation $table_condition_expectation * Aggregate rule which evaluates whether the provided expression is true * for a table. + * @type \Google\Cloud\Dataplex\V1\DataQualityRule\SqlAssertion $sql_assertion + * Aggregate rule which evaluates the number of rows returned for the + * provided statement. * @type string $column * Optional. The unnested column which this rule is evaluated against. * @type bool $ignore_null @@ -396,6 +399,39 @@ public function setTableConditionExpectation($var) return $this; } + /** + * Aggregate rule which evaluates the number of rows returned for the + * provided statement. + * + * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityRule.SqlAssertion sql_assertion = 202; + * @return \Google\Cloud\Dataplex\V1\DataQualityRule\SqlAssertion|null + */ + public function getSqlAssertion() + { + return $this->readOneof(202); + } + + public function hasSqlAssertion() + { + return $this->hasOneof(202); + } + + /** + * Aggregate rule which evaluates the number of rows returned for the + * provided statement. + * + * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityRule.SqlAssertion sql_assertion = 202; + * @param \Google\Cloud\Dataplex\V1\DataQualityRule\SqlAssertion $var + * @return $this + */ + public function setSqlAssertion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dataplex\V1\DataQualityRule\SqlAssertion::class); + $this->writeOneof(202, $var); + + return $this; + } + /** * Optional. The unnested column which this rule is evaluated against. * diff --git a/Dataplex/src/V1/DataQualityRule/RangeExpectation.php b/Dataplex/src/V1/DataQualityRule/RangeExpectation.php index 81475158069d..570a61d51fb1 100644 --- a/Dataplex/src/V1/DataQualityRule/RangeExpectation.php +++ b/Dataplex/src/V1/DataQualityRule/RangeExpectation.php @@ -22,7 +22,7 @@ class RangeExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string min_value = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $min_value = ''; + protected $min_value = ''; /** * Optional. The maximum column value allowed for a row to pass this * validation. At least one of `min_value` and `max_value` need to be @@ -30,7 +30,7 @@ class RangeExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string max_value = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_value = ''; + protected $max_value = ''; /** * Optional. Whether each value needs to be strictly greater than ('>') the * minimum, or if equality is allowed. @@ -38,7 +38,7 @@ class RangeExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool strict_min_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $strict_min_enabled = false; + protected $strict_min_enabled = false; /** * Optional. Whether each value needs to be strictly lesser than ('<') the * maximum, or if equality is allowed. @@ -46,7 +46,7 @@ class RangeExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool strict_max_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $strict_max_enabled = false; + protected $strict_max_enabled = false; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityRule/RegexExpectation.php b/Dataplex/src/V1/DataQualityRule/RegexExpectation.php index 562b2f15f334..748fbbeb1178 100644 --- a/Dataplex/src/V1/DataQualityRule/RegexExpectation.php +++ b/Dataplex/src/V1/DataQualityRule/RegexExpectation.php @@ -20,7 +20,7 @@ class RegexExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string regex = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $regex = ''; + protected $regex = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityRule/RowConditionExpectation.php b/Dataplex/src/V1/DataQualityRule/RowConditionExpectation.php index 3249b031bd69..662e538be19d 100644 --- a/Dataplex/src/V1/DataQualityRule/RowConditionExpectation.php +++ b/Dataplex/src/V1/DataQualityRule/RowConditionExpectation.php @@ -23,7 +23,7 @@ class RowConditionExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string sql_expression = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $sql_expression = ''; + protected $sql_expression = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityRule/SqlAssertion.php b/Dataplex/src/V1/DataQualityRule/SqlAssertion.php new file mode 100644 index 000000000000..ee9606c88a33 --- /dev/null +++ b/Dataplex/src/V1/DataQualityRule/SqlAssertion.php @@ -0,0 +1,75 @@ +google.cloud.dataplex.v1.DataQualityRule.SqlAssertion + */ +class SqlAssertion extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The SQL statement. + * + * Generated from protobuf field string sql_statement = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sql_statement = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $sql_statement + * Optional. The SQL statement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dataplex\V1\DataQuality::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The SQL statement. + * + * Generated from protobuf field string sql_statement = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSqlStatement() + { + return $this->sql_statement; + } + + /** + * Optional. The SQL statement. + * + * Generated from protobuf field string sql_statement = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSqlStatement($var) + { + GPBUtil::checkString($var, True); + $this->sql_statement = $var; + + return $this; + } + +} + + diff --git a/Dataplex/src/V1/DataQualityRule/StatisticRangeExpectation.php b/Dataplex/src/V1/DataQualityRule/StatisticRangeExpectation.php index 9fb6441370ae..d4ba4ec8f3bf 100644 --- a/Dataplex/src/V1/DataQualityRule/StatisticRangeExpectation.php +++ b/Dataplex/src/V1/DataQualityRule/StatisticRangeExpectation.php @@ -21,7 +21,7 @@ class StatisticRangeExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityRule.StatisticRangeExpectation.ColumnStatistic statistic = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $statistic = 0; + protected $statistic = 0; /** * Optional. The minimum column statistic value allowed for a row to pass * this validation. @@ -29,7 +29,7 @@ class StatisticRangeExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string min_value = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $min_value = ''; + protected $min_value = ''; /** * Optional. The maximum column statistic value allowed for a row to pass * this validation. @@ -37,7 +37,7 @@ class StatisticRangeExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string max_value = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_value = ''; + protected $max_value = ''; /** * Optional. Whether column statistic needs to be strictly greater than * ('>') the minimum, or if equality is allowed. @@ -45,7 +45,7 @@ class StatisticRangeExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool strict_min_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $strict_min_enabled = false; + protected $strict_min_enabled = false; /** * Optional. Whether column statistic needs to be strictly lesser than ('<') * the maximum, or if equality is allowed. @@ -53,7 +53,7 @@ class StatisticRangeExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool strict_max_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $strict_max_enabled = false; + protected $strict_max_enabled = false; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityRule/TableConditionExpectation.php b/Dataplex/src/V1/DataQualityRule/TableConditionExpectation.php index b8038647b83f..7acd5213bab8 100644 --- a/Dataplex/src/V1/DataQualityRule/TableConditionExpectation.php +++ b/Dataplex/src/V1/DataQualityRule/TableConditionExpectation.php @@ -23,7 +23,7 @@ class TableConditionExpectation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string sql_expression = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $sql_expression = ''; + protected $sql_expression = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualityRuleResult.php b/Dataplex/src/V1/DataQualityRuleResult.php index c9d438e3b7f4..99064fea716c 100644 --- a/Dataplex/src/V1/DataQualityRuleResult.php +++ b/Dataplex/src/V1/DataQualityRuleResult.php @@ -20,13 +20,13 @@ class DataQualityRuleResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityRule rule = 1; */ - private $rule = null; + protected $rule = null; /** * Whether the rule passed or failed. * * Generated from protobuf field bool passed = 7; */ - private $passed = false; + protected $passed = false; /** * The number of rows a rule was evaluated against. * This field is only valid for row-level type rules. @@ -38,34 +38,42 @@ class DataQualityRuleResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 evaluated_count = 9; */ - private $evaluated_count = 0; + protected $evaluated_count = 0; /** * The number of rows which passed a rule evaluation. * This field is only valid for row-level type rules. * * Generated from protobuf field int64 passed_count = 8; */ - private $passed_count = 0; + protected $passed_count = 0; /** * The number of rows with null values in the specified column. * * Generated from protobuf field int64 null_count = 5; */ - private $null_count = 0; + protected $null_count = 0; /** * The ratio of **passed_count / evaluated_count**. * This field is only valid for row-level type rules. * * Generated from protobuf field double pass_ratio = 6; */ - private $pass_ratio = 0.0; + protected $pass_ratio = 0.0; /** * The query to find rows that did not pass this rule. * This field is only valid for row-level type rules. * * Generated from protobuf field string failing_rows_query = 10; */ - private $failing_rows_query = ''; + protected $failing_rows_query = ''; + /** + * Output only. The number of rows returned by the sql statement in the + * SqlAssertion rule. + * This field is only valid for SqlAssertion rules. + * + * Generated from protobuf field int64 assertion_row_count = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $assertion_row_count = 0; /** * Constructor. @@ -96,6 +104,10 @@ class DataQualityRuleResult extends \Google\Protobuf\Internal\Message * @type string $failing_rows_query * The query to find rows that did not pass this rule. * This field is only valid for row-level type rules. + * @type int|string $assertion_row_count + * Output only. The number of rows returned by the sql statement in the + * SqlAssertion rule. + * This field is only valid for SqlAssertion rules. * } */ public function __construct($data = NULL) { @@ -313,5 +325,35 @@ public function setFailingRowsQuery($var) return $this; } + /** + * Output only. The number of rows returned by the sql statement in the + * SqlAssertion rule. + * This field is only valid for SqlAssertion rules. + * + * Generated from protobuf field int64 assertion_row_count = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getAssertionRowCount() + { + return $this->assertion_row_count; + } + + /** + * Output only. The number of rows returned by the sql statement in the + * SqlAssertion rule. + * This field is only valid for SqlAssertion rules. + * + * Generated from protobuf field int64 assertion_row_count = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setAssertionRowCount($var) + { + GPBUtil::checkInt64($var); + $this->assertion_row_count = $var; + + return $this; + } + } diff --git a/Dataplex/src/V1/DataQualityScanRuleResult.php b/Dataplex/src/V1/DataQualityScanRuleResult.php index e59fb96f94a9..92c79c3b1cd7 100644 --- a/Dataplex/src/V1/DataQualityScanRuleResult.php +++ b/Dataplex/src/V1/DataQualityScanRuleResult.php @@ -21,75 +21,82 @@ class DataQualityScanRuleResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string job_id = 1; */ - private $job_id = ''; + protected $job_id = ''; /** * The data source of the data scan (e.g. BigQuery table name). * * Generated from protobuf field string data_source = 2; */ - private $data_source = ''; + protected $data_source = ''; /** * The column which this rule is evaluated against. * * Generated from protobuf field string column = 3; */ - private $column = ''; + protected $column = ''; /** * The name of the data quality rule. * * Generated from protobuf field string rule_name = 4; */ - private $rule_name = ''; + protected $rule_name = ''; /** * The type of the data quality rule. * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityScanRuleResult.RuleType rule_type = 5; */ - private $rule_type = 0; + protected $rule_type = 0; /** * The evaluation type of the data quality rule. * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityScanRuleResult.EvaluationType evalution_type = 6; */ - private $evalution_type = 0; + protected $evalution_type = 0; /** * The dimension of the data quality rule. * * Generated from protobuf field string rule_dimension = 7; */ - private $rule_dimension = ''; + protected $rule_dimension = ''; /** * The passing threshold ([0.0, 100.0]) of the data quality rule. * * Generated from protobuf field double threshold_percent = 8; */ - private $threshold_percent = 0.0; + protected $threshold_percent = 0.0; /** * The result of the data quality rule. * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualityScanRuleResult.Result result = 9; */ - private $result = 0; + protected $result = 0; /** * The number of rows evaluated against the data quality rule. * This field is only valid for rules of PER_ROW evaluation type. * * Generated from protobuf field int64 evaluated_row_count = 10; */ - private $evaluated_row_count = 0; + protected $evaluated_row_count = 0; /** * The number of rows which passed a rule evaluation. * This field is only valid for rules of PER_ROW evaluation type. * * Generated from protobuf field int64 passed_row_count = 11; */ - private $passed_row_count = 0; + protected $passed_row_count = 0; /** * The number of rows with null values in the specified column. * * Generated from protobuf field int64 null_row_count = 12; */ - private $null_row_count = 0; + protected $null_row_count = 0; + /** + * The number of rows returned by the sql statement in the SqlAssertion rule. + * This field is only valid for SqlAssertion rules. + * + * Generated from protobuf field int64 assertion_row_count = 13; + */ + protected $assertion_row_count = 0; /** * Constructor. @@ -123,6 +130,9 @@ class DataQualityScanRuleResult extends \Google\Protobuf\Internal\Message * This field is only valid for rules of PER_ROW evaluation type. * @type int|string $null_row_count * The number of rows with null values in the specified column. + * @type int|string $assertion_row_count + * The number of rows returned by the sql statement in the SqlAssertion rule. + * This field is only valid for SqlAssertion rules. * } */ public function __construct($data = NULL) { @@ -446,5 +456,33 @@ public function setNullRowCount($var) return $this; } + /** + * The number of rows returned by the sql statement in the SqlAssertion rule. + * This field is only valid for SqlAssertion rules. + * + * Generated from protobuf field int64 assertion_row_count = 13; + * @return int|string + */ + public function getAssertionRowCount() + { + return $this->assertion_row_count; + } + + /** + * The number of rows returned by the sql statement in the SqlAssertion rule. + * This field is only valid for SqlAssertion rules. + * + * Generated from protobuf field int64 assertion_row_count = 13; + * @param int|string $var + * @return $this + */ + public function setAssertionRowCount($var) + { + GPBUtil::checkInt64($var); + $this->assertion_row_count = $var; + + return $this; + } + } diff --git a/Dataplex/src/V1/DataQualityScanRuleResult/RuleType.php b/Dataplex/src/V1/DataQualityScanRuleResult/RuleType.php index bc63f6c601a9..51434ffb5c35 100644 --- a/Dataplex/src/V1/DataQualityScanRuleResult/RuleType.php +++ b/Dataplex/src/V1/DataQualityScanRuleResult/RuleType.php @@ -75,6 +75,13 @@ class RuleType * Generated from protobuf enum UNIQUENESS_EXPECTATION = 8; */ const UNIQUENESS_EXPECTATION = 8; + /** + * Please see + * https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#sqlAssertion. + * + * Generated from protobuf enum SQL_ASSERTION = 9; + */ + const SQL_ASSERTION = 9; private static $valueToName = [ self::RULE_TYPE_UNSPECIFIED => 'RULE_TYPE_UNSPECIFIED', @@ -86,6 +93,7 @@ class RuleType self::STATISTIC_RANGE_EXPECTATION => 'STATISTIC_RANGE_EXPECTATION', self::TABLE_CONDITION_EXPECTATION => 'TABLE_CONDITION_EXPECTATION', self::UNIQUENESS_EXPECTATION => 'UNIQUENESS_EXPECTATION', + self::SQL_ASSERTION => 'SQL_ASSERTION', ]; public static function name($value) diff --git a/Dataplex/src/V1/DataQualitySpec.php b/Dataplex/src/V1/DataQualitySpec.php index 5dae25dd1260..45b23f54b8df 100644 --- a/Dataplex/src/V1/DataQualitySpec.php +++ b/Dataplex/src/V1/DataQualitySpec.php @@ -32,7 +32,7 @@ class DataQualitySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float sampling_percent = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $sampling_percent = 0.0; + protected $sampling_percent = 0.0; /** * Optional. A filter applied to all rows in a single DataScan job. * The filter needs to be a valid SQL expression for a WHERE clause in @@ -41,13 +41,13 @@ class DataQualitySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string row_filter = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $row_filter = ''; + protected $row_filter = ''; /** * Optional. Actions to take upon job completion. * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualitySpec.PostScanActions post_scan_actions = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $post_scan_actions = null; + protected $post_scan_actions = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualitySpec/PostScanActions.php b/Dataplex/src/V1/DataQualitySpec/PostScanActions.php index 2fffc09bcf86..2ddacb016fdb 100644 --- a/Dataplex/src/V1/DataQualitySpec/PostScanActions.php +++ b/Dataplex/src/V1/DataQualitySpec/PostScanActions.php @@ -21,14 +21,14 @@ class PostScanActions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.BigQueryExport bigquery_export = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $bigquery_export = null; + protected $bigquery_export = null; /** * Optional. If set, results will be sent to the provided notification * receipts upon triggers. * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.NotificationReport notification_report = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $notification_report = null; + protected $notification_report = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualitySpec/PostScanActions/BigQueryExport.php b/Dataplex/src/V1/DataQualitySpec/PostScanActions/BigQueryExport.php index ee11f56273a1..bae3c68fa220 100644 --- a/Dataplex/src/V1/DataQualitySpec/PostScanActions/BigQueryExport.php +++ b/Dataplex/src/V1/DataQualitySpec/PostScanActions/BigQueryExport.php @@ -22,7 +22,7 @@ class BigQueryExport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string results_table = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $results_table = ''; + protected $results_table = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualitySpec/PostScanActions/NotificationReport.php b/Dataplex/src/V1/DataQualitySpec/PostScanActions/NotificationReport.php index bb15dc2513c4..3eb0b270a18b 100644 --- a/Dataplex/src/V1/DataQualitySpec/PostScanActions/NotificationReport.php +++ b/Dataplex/src/V1/DataQualitySpec/PostScanActions/NotificationReport.php @@ -20,25 +20,25 @@ class NotificationReport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.Recipients recipients = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $recipients = null; + protected $recipients = null; /** * Optional. If set, report will be sent when score threshold is met. * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.ScoreThresholdTrigger score_threshold_trigger = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $score_threshold_trigger = null; + protected $score_threshold_trigger = null; /** * Optional. If set, report will be sent when a scan job fails. * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.JobFailureTrigger job_failure_trigger = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $job_failure_trigger = null; + protected $job_failure_trigger = null; /** * Optional. If set, report will be sent when a scan job ends. * * Generated from protobuf field .google.cloud.dataplex.v1.DataQualitySpec.PostScanActions.JobEndTrigger job_end_trigger = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $job_end_trigger = null; + protected $job_end_trigger = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataQualitySpec/PostScanActions/ScoreThresholdTrigger.php b/Dataplex/src/V1/DataQualitySpec/PostScanActions/ScoreThresholdTrigger.php index a33e5582bf74..e5bf8ca9e339 100644 --- a/Dataplex/src/V1/DataQualitySpec/PostScanActions/ScoreThresholdTrigger.php +++ b/Dataplex/src/V1/DataQualitySpec/PostScanActions/ScoreThresholdTrigger.php @@ -21,7 +21,7 @@ class ScoreThresholdTrigger extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float score_threshold = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $score_threshold = 0.0; + protected $score_threshold = 0.0; /** * Constructor. diff --git a/Dataplex/src/V1/DataScan.php b/Dataplex/src/V1/DataScan.php index 7748c7b9fa6d..8f54f065081e 100644 --- a/Dataplex/src/V1/DataScan.php +++ b/Dataplex/src/V1/DataScan.php @@ -30,28 +30,28 @@ class DataScan extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the scan. This ID will * be different if the scan is deleted and re-created with the same name. * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Optional. Description of the scan. * * Must be between 1-1024 characters. * * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User friendly display name. * * Must be between 1-256 characters. * * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. User-defined labels for the scan. * @@ -63,44 +63,44 @@ class DataScan extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The time when the scan was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the scan was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Required. The data source for DataScan. * * Generated from protobuf field .google.cloud.dataplex.v1.DataSource data = 9 [(.google.api.field_behavior) = REQUIRED]; */ - private $data = null; + protected $data = null; /** * Optional. DataScan execution settings. * If not specified, the fields in it will use their default values. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScan.ExecutionSpec execution_spec = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $execution_spec = null; + protected $execution_spec = null; /** * Output only. Status of the data scan execution. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScan.ExecutionStatus execution_status = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $execution_status = null; + protected $execution_status = null; /** * Output only. The type of DataScan. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanType type = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $type = 0; + protected $type = 0; protected $spec; protected $result; diff --git a/Dataplex/src/V1/DataScan/ExecutionSpec.php b/Dataplex/src/V1/DataScan/ExecutionSpec.php index e130c3a72760..23b07287ab58 100644 --- a/Dataplex/src/V1/DataScan/ExecutionSpec.php +++ b/Dataplex/src/V1/DataScan/ExecutionSpec.php @@ -22,7 +22,7 @@ class ExecutionSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Trigger trigger = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $trigger = null; + protected $trigger = null; protected $incremental; /** diff --git a/Dataplex/src/V1/DataScan/ExecutionStatus.php b/Dataplex/src/V1/DataScan/ExecutionStatus.php index c5e6a6c8b911..db12d99a61b7 100644 --- a/Dataplex/src/V1/DataScan/ExecutionStatus.php +++ b/Dataplex/src/V1/DataScan/ExecutionStatus.php @@ -20,13 +20,13 @@ class ExecutionStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp latest_job_start_time = 4; */ - private $latest_job_start_time = null; + protected $latest_job_start_time = null; /** * The time when the latest DataScanJob ended. * * Generated from protobuf field .google.protobuf.Timestamp latest_job_end_time = 5; */ - private $latest_job_end_time = null; + protected $latest_job_end_time = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataScanEvent.php b/Dataplex/src/V1/DataScanEvent.php index 8b5791975788..d4263d16f7ac 100644 --- a/Dataplex/src/V1/DataScanEvent.php +++ b/Dataplex/src/V1/DataScanEvent.php @@ -22,73 +22,73 @@ class DataScanEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_source = 1; */ - private $data_source = ''; + protected $data_source = ''; /** * The identifier of the specific data scan job this log entry is for. * * Generated from protobuf field string job_id = 2; */ - private $job_id = ''; + protected $job_id = ''; /** * The time when the data scan job was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 12; */ - private $create_time = null; + protected $create_time = null; /** * The time when the data scan job started to run. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; */ - private $start_time = null; + protected $start_time = null; /** * The time when the data scan job finished. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4; */ - private $end_time = null; + protected $end_time = null; /** * The type of the data scan. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanEvent.ScanType type = 5; */ - private $type = 0; + protected $type = 0; /** * The status of the data scan job. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanEvent.State state = 6; */ - private $state = 0; + protected $state = 0; /** * The message describing the data scan job event. * * Generated from protobuf field string message = 7; */ - private $message = ''; + protected $message = ''; /** * A version identifier of the spec which was used to execute this job. * * Generated from protobuf field string spec_version = 8; */ - private $spec_version = ''; + protected $spec_version = ''; /** * The trigger type of the data scan job. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanEvent.Trigger trigger = 9; */ - private $trigger = 0; + protected $trigger = 0; /** * The scope of the data scan (e.g. full, incremental). * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanEvent.Scope scope = 10; */ - private $scope = 0; + protected $scope = 0; /** * The result of post scan actions. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanEvent.PostScanActionsResult post_scan_actions_result = 11; */ - private $post_scan_actions_result = null; + protected $post_scan_actions_result = null; protected $result; protected $appliedConfigs; diff --git a/Dataplex/src/V1/DataScanEvent/DataProfileAppliedConfigs.php b/Dataplex/src/V1/DataScanEvent/DataProfileAppliedConfigs.php index 4f097a735e2e..746ad86d8326 100644 --- a/Dataplex/src/V1/DataScanEvent/DataProfileAppliedConfigs.php +++ b/Dataplex/src/V1/DataScanEvent/DataProfileAppliedConfigs.php @@ -22,20 +22,20 @@ class DataProfileAppliedConfigs extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float sampling_percent = 1; */ - private $sampling_percent = 0.0; + protected $sampling_percent = 0.0; /** * Boolean indicating whether a row filter was applied in the DataScan job. * * Generated from protobuf field bool row_filter_applied = 2; */ - private $row_filter_applied = false; + protected $row_filter_applied = false; /** * Boolean indicating whether a column filter was applied in the DataScan * job. * * Generated from protobuf field bool column_filter_applied = 3; */ - private $column_filter_applied = false; + protected $column_filter_applied = false; /** * Constructor. diff --git a/Dataplex/src/V1/DataScanEvent/DataProfileResult.php b/Dataplex/src/V1/DataScanEvent/DataProfileResult.php index 1a459dd64d4a..8fbd7fe620ae 100644 --- a/Dataplex/src/V1/DataScanEvent/DataProfileResult.php +++ b/Dataplex/src/V1/DataScanEvent/DataProfileResult.php @@ -20,7 +20,7 @@ class DataProfileResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 row_count = 1; */ - private $row_count = 0; + protected $row_count = 0; /** * Constructor. diff --git a/Dataplex/src/V1/DataScanEvent/DataQualityAppliedConfigs.php b/Dataplex/src/V1/DataScanEvent/DataQualityAppliedConfigs.php index 21e2cf3972c1..13f5117f82fa 100644 --- a/Dataplex/src/V1/DataScanEvent/DataQualityAppliedConfigs.php +++ b/Dataplex/src/V1/DataScanEvent/DataQualityAppliedConfigs.php @@ -22,13 +22,13 @@ class DataQualityAppliedConfigs extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float sampling_percent = 1; */ - private $sampling_percent = 0.0; + protected $sampling_percent = 0.0; /** * Boolean indicating whether a row filter was applied in the DataScan job. * * Generated from protobuf field bool row_filter_applied = 2; */ - private $row_filter_applied = false; + protected $row_filter_applied = false; /** * Constructor. diff --git a/Dataplex/src/V1/DataScanEvent/DataQualityResult.php b/Dataplex/src/V1/DataScanEvent/DataQualityResult.php index 3ffe5d213dc2..a5ca5137ebbb 100644 --- a/Dataplex/src/V1/DataScanEvent/DataQualityResult.php +++ b/Dataplex/src/V1/DataScanEvent/DataQualityResult.php @@ -20,13 +20,13 @@ class DataQualityResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 row_count = 1; */ - private $row_count = 0; + protected $row_count = 0; /** * Whether the data quality result was `pass` or not. * * Generated from protobuf field bool passed = 2; */ - private $passed = false; + protected $passed = false; /** * The result of each dimension for data quality result. * The key of the map is the name of the dimension. @@ -43,7 +43,7 @@ class DataQualityResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float score = 4; */ - private $score = 0.0; + protected $score = 0.0; /** * The score of each dimension for data quality result. * The key of the map is the name of the dimension. diff --git a/Dataplex/src/V1/DataScanEvent/PostScanActionsResult.php b/Dataplex/src/V1/DataScanEvent/PostScanActionsResult.php index cb5205dc0152..3003061e96b2 100644 --- a/Dataplex/src/V1/DataScanEvent/PostScanActionsResult.php +++ b/Dataplex/src/V1/DataScanEvent/PostScanActionsResult.php @@ -20,7 +20,7 @@ class PostScanActionsResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanEvent.PostScanActionsResult.BigQueryExportResult bigquery_export_result = 1; */ - private $bigquery_export_result = null; + protected $bigquery_export_result = null; /** * Constructor. diff --git a/Dataplex/src/V1/DataScanEvent/PostScanActionsResult/BigQueryExportResult.php b/Dataplex/src/V1/DataScanEvent/PostScanActionsResult/BigQueryExportResult.php index f97f25eb8c8f..96680bbad1c3 100644 --- a/Dataplex/src/V1/DataScanEvent/PostScanActionsResult/BigQueryExportResult.php +++ b/Dataplex/src/V1/DataScanEvent/PostScanActionsResult/BigQueryExportResult.php @@ -20,13 +20,13 @@ class BigQueryExportResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanEvent.PostScanActionsResult.BigQueryExportResult.State state = 1; */ - private $state = 0; + protected $state = 0; /** * Additional information about the BigQuery exporting. * * Generated from protobuf field string message = 2; */ - private $message = ''; + protected $message = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DataScanJob.php b/Dataplex/src/V1/DataScanJob.php index 137e35f8e5c4..c9d59028ed9e 100644 --- a/Dataplex/src/V1/DataScanJob.php +++ b/Dataplex/src/V1/DataScanJob.php @@ -23,43 +23,43 @@ class DataScanJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the DataScanJob. * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the DataScanJob was started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The time when the DataScanJob ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Execution state for the DataScanJob. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanJob.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information about the current state. * * Generated from protobuf field string message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $message = ''; + protected $message = ''; /** * Output only. The type of the parent DataScan. * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanType type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $type = 0; + protected $type = 0; protected $spec; protected $result; diff --git a/Dataplex/src/V1/DataScanServiceClient.php b/Dataplex/src/V1/DataScanServiceClient.php deleted file mode 100644 index f250f4c3e491..000000000000 --- a/Dataplex/src/V1/DataScanServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.dataplex.v1.DataScanService/CreateDataScan', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a DataScan resource. - * @param \Google\Cloud\Dataplex\V1\UpdateDataScanRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateDataScan(\Google\Cloud\Dataplex\V1\UpdateDataScanRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataScanService/UpdateDataScan', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a DataScan resource. - * @param \Google\Cloud\Dataplex\V1\DeleteDataScanRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteDataScan(\Google\Cloud\Dataplex\V1\DeleteDataScanRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataScanService/DeleteDataScan', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets a DataScan resource. - * @param \Google\Cloud\Dataplex\V1\GetDataScanRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetDataScan(\Google\Cloud\Dataplex\V1\GetDataScanRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataScanService/GetDataScan', - $argument, - ['\Google\Cloud\Dataplex\V1\DataScan', 'decode'], - $metadata, $options); - } - - /** - * Lists DataScans. - * @param \Google\Cloud\Dataplex\V1\ListDataScansRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListDataScans(\Google\Cloud\Dataplex\V1\ListDataScansRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataScanService/ListDataScans', - $argument, - ['\Google\Cloud\Dataplex\V1\ListDataScansResponse', 'decode'], - $metadata, $options); - } - - /** - * Runs an on-demand execution of a DataScan - * @param \Google\Cloud\Dataplex\V1\RunDataScanRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RunDataScan(\Google\Cloud\Dataplex\V1\RunDataScanRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataScanService/RunDataScan', - $argument, - ['\Google\Cloud\Dataplex\V1\RunDataScanResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a DataScanJob resource. - * @param \Google\Cloud\Dataplex\V1\GetDataScanJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetDataScanJob(\Google\Cloud\Dataplex\V1\GetDataScanJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataScanService/GetDataScanJob', - $argument, - ['\Google\Cloud\Dataplex\V1\DataScanJob', 'decode'], - $metadata, $options); - } - - /** - * Lists DataScanJobs under the given DataScan. - * @param \Google\Cloud\Dataplex\V1\ListDataScanJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListDataScanJobs(\Google\Cloud\Dataplex\V1\ListDataScanJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataScanService/ListDataScanJobs', - $argument, - ['\Google\Cloud\Dataplex\V1\ListDataScanJobsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataplex/src/V1/DataTaxonomy.php b/Dataplex/src/V1/DataTaxonomy.php index 29a7d44d0409..5fb5f3a7c589 100644 --- a/Dataplex/src/V1/DataTaxonomy.php +++ b/Dataplex/src/V1/DataTaxonomy.php @@ -23,7 +23,7 @@ class DataTaxonomy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the dataTaxonomy. This * ID will be different if the DataTaxonomy is deleted and re-created with the @@ -31,31 +31,31 @@ class DataTaxonomy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the DataTaxonomy was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the DataTaxonomy was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Description of the DataTaxonomy. * * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. User-defined labels for the DataTaxonomy. * @@ -67,7 +67,7 @@ class DataTaxonomy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 attribute_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $attribute_count = 0; + protected $attribute_count = 0; /** * This checksum is computed by the server based on the value of other * fields, and may be sent on update and delete requests to ensure the @@ -75,13 +75,13 @@ class DataTaxonomy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 10; */ - private $etag = ''; + protected $etag = ''; /** * Output only. The number of classes in the DataTaxonomy. * * Generated from protobuf field int32 class_count = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $class_count = 0; + protected $class_count = 0; /** * Constructor. diff --git a/Dataplex/src/V1/DataTaxonomyServiceClient.php b/Dataplex/src/V1/DataTaxonomyServiceClient.php deleted file mode 100644 index 298809e1b993..000000000000 --- a/Dataplex/src/V1/DataTaxonomyServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.dataplex.v1.DataplexService/CreateLake', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a lake resource. - * @param \Google\Cloud\Dataplex\V1\UpdateLakeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateLake(\Google\Cloud\Dataplex\V1\UpdateLakeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/UpdateLake', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a lake resource. All zones within the lake must be deleted before - * the lake can be deleted. - * @param \Google\Cloud\Dataplex\V1\DeleteLakeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteLake(\Google\Cloud\Dataplex\V1\DeleteLakeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/DeleteLake', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists lake resources in a project and location. - * @param \Google\Cloud\Dataplex\V1\ListLakesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListLakes(\Google\Cloud\Dataplex\V1\ListLakesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListLakes', - $argument, - ['\Google\Cloud\Dataplex\V1\ListLakesResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a lake resource. - * @param \Google\Cloud\Dataplex\V1\GetLakeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetLake(\Google\Cloud\Dataplex\V1\GetLakeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/GetLake', - $argument, - ['\Google\Cloud\Dataplex\V1\Lake', 'decode'], - $metadata, $options); - } - - /** - * Lists action resources in a lake. - * @param \Google\Cloud\Dataplex\V1\ListLakeActionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListLakeActions(\Google\Cloud\Dataplex\V1\ListLakeActionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListLakeActions', - $argument, - ['\Google\Cloud\Dataplex\V1\ListActionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates a zone resource within a lake. - * @param \Google\Cloud\Dataplex\V1\CreateZoneRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateZone(\Google\Cloud\Dataplex\V1\CreateZoneRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/CreateZone', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a zone resource. - * @param \Google\Cloud\Dataplex\V1\UpdateZoneRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateZone(\Google\Cloud\Dataplex\V1\UpdateZoneRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/UpdateZone', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a zone resource. All assets within a zone must be deleted before - * the zone can be deleted. - * @param \Google\Cloud\Dataplex\V1\DeleteZoneRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteZone(\Google\Cloud\Dataplex\V1\DeleteZoneRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/DeleteZone', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists zone resources in a lake. - * @param \Google\Cloud\Dataplex\V1\ListZonesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListZones(\Google\Cloud\Dataplex\V1\ListZonesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListZones', - $argument, - ['\Google\Cloud\Dataplex\V1\ListZonesResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a zone resource. - * @param \Google\Cloud\Dataplex\V1\GetZoneRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetZone(\Google\Cloud\Dataplex\V1\GetZoneRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/GetZone', - $argument, - ['\Google\Cloud\Dataplex\V1\Zone', 'decode'], - $metadata, $options); - } - - /** - * Lists action resources in a zone. - * @param \Google\Cloud\Dataplex\V1\ListZoneActionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListZoneActions(\Google\Cloud\Dataplex\V1\ListZoneActionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListZoneActions', - $argument, - ['\Google\Cloud\Dataplex\V1\ListActionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates an asset resource. - * @param \Google\Cloud\Dataplex\V1\CreateAssetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateAsset(\Google\Cloud\Dataplex\V1\CreateAssetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/CreateAsset', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates an asset resource. - * @param \Google\Cloud\Dataplex\V1\UpdateAssetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateAsset(\Google\Cloud\Dataplex\V1\UpdateAssetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/UpdateAsset', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes an asset resource. The referenced storage resource is detached - * (default) or deleted based on the associated Lifecycle policy. - * @param \Google\Cloud\Dataplex\V1\DeleteAssetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteAsset(\Google\Cloud\Dataplex\V1\DeleteAssetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/DeleteAsset', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists asset resources in a zone. - * @param \Google\Cloud\Dataplex\V1\ListAssetsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListAssets(\Google\Cloud\Dataplex\V1\ListAssetsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListAssets', - $argument, - ['\Google\Cloud\Dataplex\V1\ListAssetsResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves an asset resource. - * @param \Google\Cloud\Dataplex\V1\GetAssetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetAsset(\Google\Cloud\Dataplex\V1\GetAssetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/GetAsset', - $argument, - ['\Google\Cloud\Dataplex\V1\Asset', 'decode'], - $metadata, $options); - } - - /** - * Lists action resources in an asset. - * @param \Google\Cloud\Dataplex\V1\ListAssetActionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListAssetActions(\Google\Cloud\Dataplex\V1\ListAssetActionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListAssetActions', - $argument, - ['\Google\Cloud\Dataplex\V1\ListActionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates a task resource within a lake. - * @param \Google\Cloud\Dataplex\V1\CreateTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTask(\Google\Cloud\Dataplex\V1\CreateTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/CreateTask', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Update the task resource. - * @param \Google\Cloud\Dataplex\V1\UpdateTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTask(\Google\Cloud\Dataplex\V1\UpdateTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/UpdateTask', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Delete the task resource. - * @param \Google\Cloud\Dataplex\V1\DeleteTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTask(\Google\Cloud\Dataplex\V1\DeleteTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/DeleteTask', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists tasks under the given lake. - * @param \Google\Cloud\Dataplex\V1\ListTasksRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTasks(\Google\Cloud\Dataplex\V1\ListTasksRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListTasks', - $argument, - ['\Google\Cloud\Dataplex\V1\ListTasksResponse', 'decode'], - $metadata, $options); - } - - /** - * Get task resource. - * @param \Google\Cloud\Dataplex\V1\GetTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTask(\Google\Cloud\Dataplex\V1\GetTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/GetTask', - $argument, - ['\Google\Cloud\Dataplex\V1\Task', 'decode'], - $metadata, $options); - } - - /** - * Lists Jobs under the given task. - * @param \Google\Cloud\Dataplex\V1\ListJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListJobs(\Google\Cloud\Dataplex\V1\ListJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListJobs', - $argument, - ['\Google\Cloud\Dataplex\V1\ListJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Run an on demand execution of a Task. - * @param \Google\Cloud\Dataplex\V1\RunTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RunTask(\Google\Cloud\Dataplex\V1\RunTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/RunTask', - $argument, - ['\Google\Cloud\Dataplex\V1\RunTaskResponse', 'decode'], - $metadata, $options); - } - - /** - * Get job resource. - * @param \Google\Cloud\Dataplex\V1\GetJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetJob(\Google\Cloud\Dataplex\V1\GetJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/GetJob', - $argument, - ['\Google\Cloud\Dataplex\V1\Job', 'decode'], - $metadata, $options); - } - - /** - * Cancel jobs running for the task resource. - * @param \Google\Cloud\Dataplex\V1\CancelJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelJob(\Google\Cloud\Dataplex\V1\CancelJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/CancelJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Create an environment resource. - * @param \Google\Cloud\Dataplex\V1\CreateEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateEnvironment(\Google\Cloud\Dataplex\V1\CreateEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/CreateEnvironment', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Update the environment resource. - * @param \Google\Cloud\Dataplex\V1\UpdateEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateEnvironment(\Google\Cloud\Dataplex\V1\UpdateEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/UpdateEnvironment', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Delete the environment resource. All the child resources must have been - * deleted before environment deletion can be initiated. - * @param \Google\Cloud\Dataplex\V1\DeleteEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteEnvironment(\Google\Cloud\Dataplex\V1\DeleteEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/DeleteEnvironment', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists environments under the given lake. - * @param \Google\Cloud\Dataplex\V1\ListEnvironmentsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListEnvironments(\Google\Cloud\Dataplex\V1\ListEnvironmentsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListEnvironments', - $argument, - ['\Google\Cloud\Dataplex\V1\ListEnvironmentsResponse', 'decode'], - $metadata, $options); - } - - /** - * Get environment resource. - * @param \Google\Cloud\Dataplex\V1\GetEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetEnvironment(\Google\Cloud\Dataplex\V1\GetEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/GetEnvironment', - $argument, - ['\Google\Cloud\Dataplex\V1\Environment', 'decode'], - $metadata, $options); - } - - /** - * Lists session resources in an environment. - * @param \Google\Cloud\Dataplex\V1\ListSessionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListSessions(\Google\Cloud\Dataplex\V1\ListSessionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.DataplexService/ListSessions', - $argument, - ['\Google\Cloud\Dataplex\V1\ListSessionsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataplex/src/V1/DeleteAspectTypeRequest.php b/Dataplex/src/V1/DeleteAspectTypeRequest.php index 218b3b697deb..c4a2135e2ac5 100644 --- a/Dataplex/src/V1/DeleteAspectTypeRequest.php +++ b/Dataplex/src/V1/DeleteAspectTypeRequest.php @@ -21,14 +21,14 @@ class DeleteAspectTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. If the client provided etag value does not match the current etag * value, the DeleteAspectTypeRequest method returns an ABORTED error response * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the AspectType: diff --git a/Dataplex/src/V1/DeleteAssetRequest.php b/Dataplex/src/V1/DeleteAssetRequest.php index 0782d7805e34..52cbcfe8c9d8 100644 --- a/Dataplex/src/V1/DeleteAssetRequest.php +++ b/Dataplex/src/V1/DeleteAssetRequest.php @@ -21,7 +21,7 @@ class DeleteAssetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the asset: diff --git a/Dataplex/src/V1/DeleteContentRequest.php b/Dataplex/src/V1/DeleteContentRequest.php index 6e4d6cbb6448..132887e9d3a5 100644 --- a/Dataplex/src/V1/DeleteContentRequest.php +++ b/Dataplex/src/V1/DeleteContentRequest.php @@ -21,7 +21,7 @@ class DeleteContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the content: diff --git a/Dataplex/src/V1/DeleteDataAttributeBindingRequest.php b/Dataplex/src/V1/DeleteDataAttributeBindingRequest.php index 5ecd79e1a11a..4efe4d2724c9 100644 --- a/Dataplex/src/V1/DeleteDataAttributeBindingRequest.php +++ b/Dataplex/src/V1/DeleteDataAttributeBindingRequest.php @@ -21,7 +21,7 @@ class DeleteDataAttributeBindingRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. If the client provided etag value does not match the current etag * value, the DeleteDataAttributeBindingRequest method returns an ABORTED @@ -30,7 +30,7 @@ class DeleteDataAttributeBindingRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the DataAttributeBinding: diff --git a/Dataplex/src/V1/DeleteDataAttributeRequest.php b/Dataplex/src/V1/DeleteDataAttributeRequest.php index 5dc4074b90ee..819df2652cfd 100644 --- a/Dataplex/src/V1/DeleteDataAttributeRequest.php +++ b/Dataplex/src/V1/DeleteDataAttributeRequest.php @@ -21,14 +21,14 @@ class DeleteDataAttributeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. If the client provided etag value does not match the current etag * value, the DeleteDataAttribute method returns an ABORTED error response. * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the DataAttribute: diff --git a/Dataplex/src/V1/DeleteDataScanRequest.php b/Dataplex/src/V1/DeleteDataScanRequest.php index c33c65582d04..613ef402d4ea 100644 --- a/Dataplex/src/V1/DeleteDataScanRequest.php +++ b/Dataplex/src/V1/DeleteDataScanRequest.php @@ -23,7 +23,7 @@ class DeleteDataScanRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the dataScan: diff --git a/Dataplex/src/V1/DeleteDataTaxonomyRequest.php b/Dataplex/src/V1/DeleteDataTaxonomyRequest.php index 7f22eef17525..a06802b72d28 100644 --- a/Dataplex/src/V1/DeleteDataTaxonomyRequest.php +++ b/Dataplex/src/V1/DeleteDataTaxonomyRequest.php @@ -21,14 +21,14 @@ class DeleteDataTaxonomyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. If the client provided etag value does not match the current etag * value,the DeleteDataTaxonomy method returns an ABORTED error. * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the DataTaxonomy: diff --git a/Dataplex/src/V1/DeleteEntityRequest.php b/Dataplex/src/V1/DeleteEntityRequest.php index 1591c9c130cc..60803562a44c 100644 --- a/Dataplex/src/V1/DeleteEntityRequest.php +++ b/Dataplex/src/V1/DeleteEntityRequest.php @@ -21,14 +21,14 @@ class DeleteEntityRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The etag associated with the entity, which can be retrieved with * a [GetEntity][] request. * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the entity: diff --git a/Dataplex/src/V1/DeleteEntryGroupRequest.php b/Dataplex/src/V1/DeleteEntryGroupRequest.php index 8618b1c73000..00b6cc153273 100644 --- a/Dataplex/src/V1/DeleteEntryGroupRequest.php +++ b/Dataplex/src/V1/DeleteEntryGroupRequest.php @@ -21,14 +21,14 @@ class DeleteEntryGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. If the client provided etag value does not match the current etag * value, the DeleteEntryGroupRequest method returns an ABORTED error response * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the EntryGroup: diff --git a/Dataplex/src/V1/DeleteEntryRequest.php b/Dataplex/src/V1/DeleteEntryRequest.php index e2ff8af36a44..5ad5bed0d9f4 100644 --- a/Dataplex/src/V1/DeleteEntryRequest.php +++ b/Dataplex/src/V1/DeleteEntryRequest.php @@ -19,7 +19,7 @@ class DeleteEntryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Entry: diff --git a/Dataplex/src/V1/DeleteEntryTypeRequest.php b/Dataplex/src/V1/DeleteEntryTypeRequest.php index 1237f1ce4a4d..5e44ac6568ba 100644 --- a/Dataplex/src/V1/DeleteEntryTypeRequest.php +++ b/Dataplex/src/V1/DeleteEntryTypeRequest.php @@ -21,14 +21,14 @@ class DeleteEntryTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. If the client provided etag value does not match the current etag * value, the DeleteEntryTypeRequest method returns an ABORTED error response * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The resource name of the EntryType: diff --git a/Dataplex/src/V1/DeleteEnvironmentRequest.php b/Dataplex/src/V1/DeleteEnvironmentRequest.php index c037eac7313e..39a9ffc44d4a 100644 --- a/Dataplex/src/V1/DeleteEnvironmentRequest.php +++ b/Dataplex/src/V1/DeleteEnvironmentRequest.php @@ -21,7 +21,7 @@ class DeleteEnvironmentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the environment: diff --git a/Dataplex/src/V1/DeleteLakeRequest.php b/Dataplex/src/V1/DeleteLakeRequest.php index b36023123595..7290cc2f7e49 100644 --- a/Dataplex/src/V1/DeleteLakeRequest.php +++ b/Dataplex/src/V1/DeleteLakeRequest.php @@ -21,7 +21,7 @@ class DeleteLakeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the lake: diff --git a/Dataplex/src/V1/DeletePartitionRequest.php b/Dataplex/src/V1/DeletePartitionRequest.php index ce7ba37f85a7..4b9c452fa696 100644 --- a/Dataplex/src/V1/DeletePartitionRequest.php +++ b/Dataplex/src/V1/DeletePartitionRequest.php @@ -24,7 +24,7 @@ class DeletePartitionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The etag associated with the partition. * diff --git a/Dataplex/src/V1/DeleteTaskRequest.php b/Dataplex/src/V1/DeleteTaskRequest.php index d9aed9611c7c..29666656ccad 100644 --- a/Dataplex/src/V1/DeleteTaskRequest.php +++ b/Dataplex/src/V1/DeleteTaskRequest.php @@ -21,7 +21,7 @@ class DeleteTaskRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the task: diff --git a/Dataplex/src/V1/DeleteZoneRequest.php b/Dataplex/src/V1/DeleteZoneRequest.php index 03178a63e234..d22235aebd9b 100644 --- a/Dataplex/src/V1/DeleteZoneRequest.php +++ b/Dataplex/src/V1/DeleteZoneRequest.php @@ -21,7 +21,7 @@ class DeleteZoneRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the zone: diff --git a/Dataplex/src/V1/DiscoveryEvent.php b/Dataplex/src/V1/DiscoveryEvent.php index 2ec934269166..c72a91aa4b02 100644 --- a/Dataplex/src/V1/DiscoveryEvent.php +++ b/Dataplex/src/V1/DiscoveryEvent.php @@ -20,37 +20,37 @@ class DiscoveryEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * The id of the associated lake. * * Generated from protobuf field string lake_id = 2; */ - private $lake_id = ''; + protected $lake_id = ''; /** * The id of the associated zone. * * Generated from protobuf field string zone_id = 3; */ - private $zone_id = ''; + protected $zone_id = ''; /** * The id of the associated asset. * * Generated from protobuf field string asset_id = 4; */ - private $asset_id = ''; + protected $asset_id = ''; /** * The data location associated with the event. * * Generated from protobuf field string data_location = 5; */ - private $data_location = ''; + protected $data_location = ''; /** * The type of the event being logged. * * Generated from protobuf field .google.cloud.dataplex.v1.DiscoveryEvent.EventType type = 10; */ - private $type = 0; + protected $type = 0; protected $details; /** diff --git a/Dataplex/src/V1/DiscoveryEvent/ActionDetails.php b/Dataplex/src/V1/DiscoveryEvent/ActionDetails.php index 069acbed2ebd..7ed35c18f327 100644 --- a/Dataplex/src/V1/DiscoveryEvent/ActionDetails.php +++ b/Dataplex/src/V1/DiscoveryEvent/ActionDetails.php @@ -21,7 +21,7 @@ class ActionDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type = 1; */ - private $type = ''; + protected $type = ''; /** * Constructor. diff --git a/Dataplex/src/V1/DiscoveryEvent/EntityDetails.php b/Dataplex/src/V1/DiscoveryEvent/EntityDetails.php index d0ecc5a7f14b..9a1d1e6a2d30 100644 --- a/Dataplex/src/V1/DiscoveryEvent/EntityDetails.php +++ b/Dataplex/src/V1/DiscoveryEvent/EntityDetails.php @@ -21,13 +21,13 @@ class EntityDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity = 1; */ - private $entity = ''; + protected $entity = ''; /** * The type of the entity resource. * * Generated from protobuf field .google.cloud.dataplex.v1.DiscoveryEvent.EntityType type = 2; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Dataplex/src/V1/DiscoveryEvent/PartitionDetails.php b/Dataplex/src/V1/DiscoveryEvent/PartitionDetails.php index 19ed280be0a5..717f389ae12a 100644 --- a/Dataplex/src/V1/DiscoveryEvent/PartitionDetails.php +++ b/Dataplex/src/V1/DiscoveryEvent/PartitionDetails.php @@ -21,20 +21,20 @@ class PartitionDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string partition = 1; */ - private $partition = ''; + protected $partition = ''; /** * The name to the containing entity resource. * The name is the fully-qualified resource name. * * Generated from protobuf field string entity = 2; */ - private $entity = ''; + protected $entity = ''; /** * The type of the containing entity resource. * * Generated from protobuf field .google.cloud.dataplex.v1.DiscoveryEvent.EntityType type = 3; */ - private $type = 0; + protected $type = 0; /** * The locations of the data items (e.g., a Cloud Storage objects) sampled * for metadata inference. diff --git a/Dataplex/src/V1/Entity.php b/Dataplex/src/V1/Entity.php index 4b34c31d810d..452871e6f7eb 100644 --- a/Dataplex/src/V1/Entity.php +++ b/Dataplex/src/V1/Entity.php @@ -21,32 +21,32 @@ class Entity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Display name must be shorter than or equal to 256 characters. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. User friendly longer description text. Must be shorter than or * equal to 1024 characters. * * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. The time when the entity was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the entity was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Required. A user-provided entity ID. It is mutable, and will be used as the * published table name. Specifying a new ID in an update entity @@ -56,20 +56,20 @@ class Entity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 7 [(.google.api.field_behavior) = REQUIRED]; */ - private $id = ''; + protected $id = ''; /** * Optional. The etag associated with the entity, which can be retrieved with * a [GetEntity][] request. Required for update and delete requests. * * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Required. Immutable. The type of entity. * * Generated from protobuf field .google.cloud.dataplex.v1.Entity.Type type = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $type = 0; + protected $type = 0; /** * Required. Immutable. The ID of the asset associated with the storage * location containing the entity data. The entity must be with in the same @@ -77,7 +77,7 @@ class Entity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string asset = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $asset = ''; + protected $asset = ''; /** * Required. Immutable. The storage path of the entity data. * For Cloud Storage data, this is the fully-qualified path to the entity, @@ -87,7 +87,7 @@ class Entity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_path = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $data_path = ''; + protected $data_path = ''; /** * Optional. The set of items within the data path constituting the data in * the entity, represented as a glob path. Example: @@ -95,46 +95,46 @@ class Entity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_path_pattern = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $data_path_pattern = ''; + protected $data_path_pattern = ''; /** * Output only. The name of the associated Data Catalog entry. * * Generated from protobuf field string catalog_entry = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $catalog_entry = ''; + protected $catalog_entry = ''; /** * Required. Immutable. Identifies the storage system of the entity data. * * Generated from protobuf field .google.cloud.dataplex.v1.StorageSystem system = 15 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $system = 0; + protected $system = 0; /** * Required. Identifies the storage format of the entity data. * It does not apply to entities with data stored in BigQuery. * * Generated from protobuf field .google.cloud.dataplex.v1.StorageFormat format = 16 [(.google.api.field_behavior) = REQUIRED]; */ - private $format = null; + protected $format = null; /** * Output only. Metadata stores that the entity is compatible with. * * Generated from protobuf field .google.cloud.dataplex.v1.Entity.CompatibilityStatus compatibility = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $compatibility = null; + protected $compatibility = null; /** * Output only. Identifies the access mechanism to the entity. Not user * settable. * * Generated from protobuf field .google.cloud.dataplex.v1.StorageAccess access = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $access = null; + protected $access = null; /** * Output only. System generated unique ID for the Entity. This ID will be * different if the Entity is deleted and re-created with the same name. * * Generated from protobuf field string uid = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Required. The description of the data structure and layout. * The schema is not included in list responses. It is only included in @@ -142,7 +142,7 @@ class Entity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Schema schema = 50 [(.google.api.field_behavior) = REQUIRED]; */ - private $schema = null; + protected $schema = null; /** * Constructor. diff --git a/Dataplex/src/V1/Entity/CompatibilityStatus.php b/Dataplex/src/V1/Entity/CompatibilityStatus.php index fe7a4328520c..89484db0b927 100644 --- a/Dataplex/src/V1/Entity/CompatibilityStatus.php +++ b/Dataplex/src/V1/Entity/CompatibilityStatus.php @@ -20,13 +20,13 @@ class CompatibilityStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility hive_metastore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $hive_metastore = null; + protected $hive_metastore = null; /** * Output only. Whether this entity is compatible with BigQuery. * * Generated from protobuf field .google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility bigquery = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $bigquery = null; + protected $bigquery = null; /** * Constructor. diff --git a/Dataplex/src/V1/Entity/CompatibilityStatus/Compatibility.php b/Dataplex/src/V1/Entity/CompatibilityStatus/Compatibility.php index d9b6e9f593e7..a9c220bc6b9f 100644 --- a/Dataplex/src/V1/Entity/CompatibilityStatus/Compatibility.php +++ b/Dataplex/src/V1/Entity/CompatibilityStatus/Compatibility.php @@ -21,14 +21,14 @@ class Compatibility extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool compatible = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $compatible = false; + protected $compatible = false; /** * Output only. Provides additional detail if the entity is incompatible * with the metadata store. * * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $reason = ''; + protected $reason = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Entry.php b/Dataplex/src/V1/Entry.php index 4880792df5f1..dca2b1ddd162 100644 --- a/Dataplex/src/V1/Entry.php +++ b/Dataplex/src/V1/Entry.php @@ -22,30 +22,33 @@ class Entry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ - private $name = ''; + protected $name = ''; /** * Required. Immutable. The resource name of the EntryType used to create this * Entry. * * Generated from protobuf field string entry_type = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $entry_type = ''; + protected $entry_type = ''; /** * Output only. The time when the Entry was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the Entry was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** - * Optional. The Aspects attached to the Entry. The key is either the resource - * name of the aspect type (if the aspect is attached directly to the entry) - * or "aspectType@path" if the aspect is attached to an entry's path. + * Optional. The Aspects attached to the Entry. + * The format for the key can be one of the following: + * 1. {projectId}.{locationId}.{aspectTypeId} (if the aspect is attached + * directly to the entry) + * 2. {projectId}.{locationId}.{aspectTypeId}@{path} (if the aspect is + * attached to an entry's path) * * Generated from protobuf field map aspects = 9 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -55,20 +58,20 @@ class Entry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent_entry = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; */ - private $parent_entry = ''; + protected $parent_entry = ''; /** * Optional. A name for the entry that can reference it in an external system. * The maximum size of the field is 4000 characters. * * Generated from protobuf field string fully_qualified_name = 12 [(.google.api.field_behavior) = OPTIONAL]; */ - private $fully_qualified_name = ''; + protected $fully_qualified_name = ''; /** * Optional. Source system related information for an entry. * * Generated from protobuf field .google.cloud.dataplex.v1.EntrySource entry_source = 15 [(.google.api.field_behavior) = OPTIONAL]; */ - private $entry_source = null; + protected $entry_source = null; /** * Constructor. @@ -87,9 +90,12 @@ class Entry extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $update_time * Output only. The time when the Entry was last updated. * @type array|\Google\Protobuf\Internal\MapField $aspects - * Optional. The Aspects attached to the Entry. The key is either the resource - * name of the aspect type (if the aspect is attached directly to the entry) - * or "aspectType@path" if the aspect is attached to an entry's path. + * Optional. The Aspects attached to the Entry. + * The format for the key can be one of the following: + * 1. {projectId}.{locationId}.{aspectTypeId} (if the aspect is attached + * directly to the entry) + * 2. {projectId}.{locationId}.{aspectTypeId}@{path} (if the aspect is + * attached to an entry's path) * @type string $parent_entry * Optional. Immutable. The resource name of the parent entry. * @type string $fully_qualified_name @@ -233,9 +239,12 @@ public function setUpdateTime($var) } /** - * Optional. The Aspects attached to the Entry. The key is either the resource - * name of the aspect type (if the aspect is attached directly to the entry) - * or "aspectType@path" if the aspect is attached to an entry's path. + * Optional. The Aspects attached to the Entry. + * The format for the key can be one of the following: + * 1. {projectId}.{locationId}.{aspectTypeId} (if the aspect is attached + * directly to the entry) + * 2. {projectId}.{locationId}.{aspectTypeId}@{path} (if the aspect is + * attached to an entry's path) * * Generated from protobuf field map aspects = 9 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Internal\MapField @@ -246,9 +255,12 @@ public function getAspects() } /** - * Optional. The Aspects attached to the Entry. The key is either the resource - * name of the aspect type (if the aspect is attached directly to the entry) - * or "aspectType@path" if the aspect is attached to an entry's path. + * Optional. The Aspects attached to the Entry. + * The format for the key can be one of the following: + * 1. {projectId}.{locationId}.{aspectTypeId} (if the aspect is attached + * directly to the entry) + * 2. {projectId}.{locationId}.{aspectTypeId}@{path} (if the aspect is + * attached to an entry's path) * * Generated from protobuf field map aspects = 9 [(.google.api.field_behavior) = OPTIONAL]; * @param array|\Google\Protobuf\Internal\MapField $var diff --git a/Dataplex/src/V1/EntryGroup.php b/Dataplex/src/V1/EntryGroup.php index a3de54e62380..58bc94c0a32a 100644 --- a/Dataplex/src/V1/EntryGroup.php +++ b/Dataplex/src/V1/EntryGroup.php @@ -21,7 +21,7 @@ class EntryGroup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the EntryGroup. This * ID will be different if the EntryGroup is deleted and re-created with the @@ -29,31 +29,31 @@ class EntryGroup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the EntryGroup was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the EntryGroup was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Description of the EntryGroup. * * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. User-defined labels for the EntryGroup. * @@ -67,14 +67,14 @@ class EntryGroup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 8; */ - private $etag = ''; + protected $etag = ''; /** * Output only. Denotes the transfer status of the Entry Group. It is * unspecified for Entry Group created from Dataplex API. * * Generated from protobuf field .google.cloud.dataplex.v1.TransferStatus transfer_status = 202 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $transfer_status = 0; + protected $transfer_status = 0; /** * Constructor. diff --git a/Dataplex/src/V1/EntrySource.php b/Dataplex/src/V1/EntrySource.php index 0ff9e7101d27..6560291d3978 100644 --- a/Dataplex/src/V1/EntrySource.php +++ b/Dataplex/src/V1/EntrySource.php @@ -22,35 +22,35 @@ class EntrySource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string resource = 1; */ - private $resource = ''; + protected $resource = ''; /** * The name of the source system. * The maximum size of the field is 64 characters. * * Generated from protobuf field string system = 2; */ - private $system = ''; + protected $system = ''; /** * The platform containing the source system. * The maximum size of the field is 64 characters. * * Generated from protobuf field string platform = 3; */ - private $platform = ''; + protected $platform = ''; /** * User friendly display name. * The maximum size of the field is 500 characters. * * Generated from protobuf field string display_name = 5; */ - private $display_name = ''; + protected $display_name = ''; /** * Description of the Entry. * The maximum size of the field is 2000 characters. * * Generated from protobuf field string description = 6; */ - private $description = ''; + protected $description = ''; /** * User-defined labels. * The maximum size of keys and values is 128 characters each. @@ -69,13 +69,13 @@ class EntrySource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 10; */ - private $create_time = null; + protected $create_time = null; /** * The update time of the resource in the source system. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/Dataplex/src/V1/EntrySource/Ancestor.php b/Dataplex/src/V1/EntrySource/Ancestor.php index 8afd82f38d4d..8a0f14ad87c8 100644 --- a/Dataplex/src/V1/EntrySource/Ancestor.php +++ b/Dataplex/src/V1/EntrySource/Ancestor.php @@ -21,13 +21,13 @@ class Ancestor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Optional. The type of the ancestor resource. * * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type = ''; + protected $type = ''; /** * Constructor. diff --git a/Dataplex/src/V1/EntryType.php b/Dataplex/src/V1/EntryType.php index f463fc9f6063..a5a4dcc45944 100644 --- a/Dataplex/src/V1/EntryType.php +++ b/Dataplex/src/V1/EntryType.php @@ -21,7 +21,7 @@ class EntryType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the EntryType. This ID * will be different if the EntryType is deleted and re-created with the same @@ -29,31 +29,31 @@ class EntryType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the EntryType was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the EntryType was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Description of the EntryType. * * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. User-defined labels for the EntryType. * @@ -67,7 +67,7 @@ class EntryType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Optional. Indicates the class this Entry Type belongs to, for example, * TABLE, DATABASE, MODEL. @@ -80,14 +80,14 @@ class EntryType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string platform = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $platform = ''; + protected $platform = ''; /** * Optional. The system that Entries of this type belongs to. Examples include * CloudSQL, MariaDB etc * * Generated from protobuf field string system = 11 [(.google.api.field_behavior) = OPTIONAL]; */ - private $system = ''; + protected $system = ''; /** * AspectInfo for the entry type. * @@ -99,7 +99,7 @@ class EntryType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.EntryType.Authorization authorization = 51 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $authorization = null; + protected $authorization = null; /** * Constructor. diff --git a/Dataplex/src/V1/EntryType/AspectInfo.php b/Dataplex/src/V1/EntryType/AspectInfo.php index f93014965665..9603cce0ee3f 100644 --- a/Dataplex/src/V1/EntryType/AspectInfo.php +++ b/Dataplex/src/V1/EntryType/AspectInfo.php @@ -18,7 +18,7 @@ class AspectInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type = 1 [(.google.api.resource_reference) = { */ - private $type = ''; + protected $type = ''; /** * Constructor. diff --git a/Dataplex/src/V1/EntryType/Authorization.php b/Dataplex/src/V1/EntryType/Authorization.php index 93244f824324..f22c593acd7a 100644 --- a/Dataplex/src/V1/EntryType/Authorization.php +++ b/Dataplex/src/V1/EntryType/Authorization.php @@ -22,7 +22,7 @@ class Authorization extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string alternate_use_permission = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $alternate_use_permission = ''; + protected $alternate_use_permission = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Environment.php b/Dataplex/src/V1/Environment.php index c2a8c20ee637..3236d2eab3a1 100644 --- a/Dataplex/src/V1/Environment.php +++ b/Dataplex/src/V1/Environment.php @@ -22,13 +22,13 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. System generated globally unique ID for the environment. This * ID will be different if the environment is deleted and re-created with the @@ -36,19 +36,19 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. Environment creation time. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the environment was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. User defined labels for the environment. * @@ -60,38 +60,38 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. Current state of the environment. * * Generated from protobuf field .google.cloud.dataplex.v1.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Required. Infrastructure specification for the Environment. * * Generated from protobuf field .google.cloud.dataplex.v1.Environment.InfrastructureSpec infrastructure_spec = 100 [(.google.api.field_behavior) = REQUIRED]; */ - private $infrastructure_spec = null; + protected $infrastructure_spec = null; /** * Optional. Configuration for sessions created for this environment. * * Generated from protobuf field .google.cloud.dataplex.v1.Environment.SessionSpec session_spec = 101 [(.google.api.field_behavior) = OPTIONAL]; */ - private $session_spec = null; + protected $session_spec = null; /** * Output only. Status of sessions created for this environment. * * Generated from protobuf field .google.cloud.dataplex.v1.Environment.SessionStatus session_status = 102 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $session_status = null; + protected $session_status = null; /** * Output only. URI Endpoints to access sessions associated with the * Environment. * * Generated from protobuf field .google.cloud.dataplex.v1.Environment.Endpoints endpoints = 200 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $endpoints = null; + protected $endpoints = null; /** * Constructor. diff --git a/Dataplex/src/V1/Environment/Endpoints.php b/Dataplex/src/V1/Environment/Endpoints.php index cd302666254f..660fcf43ea80 100644 --- a/Dataplex/src/V1/Environment/Endpoints.php +++ b/Dataplex/src/V1/Environment/Endpoints.php @@ -20,13 +20,13 @@ class Endpoints extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string notebooks = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $notebooks = ''; + protected $notebooks = ''; /** * Output only. URI to serve SQL APIs * * Generated from protobuf field string sql = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $sql = ''; + protected $sql = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Environment/InfrastructureSpec/ComputeResources.php b/Dataplex/src/V1/Environment/InfrastructureSpec/ComputeResources.php index 83c12b261db6..d964b33e6e7e 100644 --- a/Dataplex/src/V1/Environment/InfrastructureSpec/ComputeResources.php +++ b/Dataplex/src/V1/Environment/InfrastructureSpec/ComputeResources.php @@ -20,21 +20,21 @@ class ComputeResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 disk_size_gb = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disk_size_gb = 0; + protected $disk_size_gb = 0; /** * Optional. Total number of nodes in the sessions created for this * environment. * * Generated from protobuf field int32 node_count = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $node_count = 0; + protected $node_count = 0; /** * Optional. Max configurable nodes. * If max_node_count > node_count, then auto-scaling is enabled. * * Generated from protobuf field int32 max_node_count = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_node_count = 0; + protected $max_node_count = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Environment/InfrastructureSpec/OsImageRuntime.php b/Dataplex/src/V1/Environment/InfrastructureSpec/OsImageRuntime.php index acf87877be81..61406f7b9111 100644 --- a/Dataplex/src/V1/Environment/InfrastructureSpec/OsImageRuntime.php +++ b/Dataplex/src/V1/Environment/InfrastructureSpec/OsImageRuntime.php @@ -20,7 +20,7 @@ class OsImageRuntime extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string image_version = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $image_version = ''; + protected $image_version = ''; /** * Optional. List of Java jars to be included in the runtime environment. * Valid input includes Cloud Storage URIs to Jar binaries. diff --git a/Dataplex/src/V1/Environment/SessionSpec.php b/Dataplex/src/V1/Environment/SessionSpec.php index d8c6ba641a85..18a1f2a5af75 100644 --- a/Dataplex/src/V1/Environment/SessionSpec.php +++ b/Dataplex/src/V1/Environment/SessionSpec.php @@ -21,7 +21,7 @@ class SessionSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration max_idle_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_idle_duration = null; + protected $max_idle_duration = null; /** * Optional. If True, this causes sessions to be pre-created and available * for faster startup to enable interactive exploration use-cases. This @@ -31,7 +31,7 @@ class SessionSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_fast_startup = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_fast_startup = false; + protected $enable_fast_startup = false; /** * Constructor. diff --git a/Dataplex/src/V1/Environment/SessionStatus.php b/Dataplex/src/V1/Environment/SessionStatus.php index de4191190851..632129d14139 100644 --- a/Dataplex/src/V1/Environment/SessionStatus.php +++ b/Dataplex/src/V1/Environment/SessionStatus.php @@ -21,7 +21,7 @@ class SessionStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool active = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $active = false; + protected $active = false; /** * Constructor. diff --git a/Dataplex/src/V1/Gapic/CatalogServiceGapicClient.php b/Dataplex/src/V1/Gapic/CatalogServiceGapicClient.php deleted file mode 100644 index ecd726ce8d78..000000000000 --- a/Dataplex/src/V1/Gapic/CatalogServiceGapicClient.php +++ /dev/null @@ -1,2607 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $aspectTypeId = 'aspect_type_id'; - * $aspectType = new AspectType(); - * $operationResponse = $catalogServiceClient->createAspectType($formattedParent, $aspectTypeId, $aspectType); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->createAspectType($formattedParent, $aspectTypeId, $aspectType); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'createAspectType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataplex\V1\Client\CatalogServiceClient}. - */ -class CatalogServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dataplex.v1.CatalogService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataplex.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataplex.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $aspectTypeNameTemplate; - - private static $entryNameTemplate; - - private static $entryGroupNameTemplate; - - private static $entryTypeNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/catalog_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/catalog_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/catalog_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/catalog_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getAspectTypeNameTemplate() - { - if (self::$aspectTypeNameTemplate == null) { - self::$aspectTypeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/aspectTypes/{aspect_type}' - ); - } - - return self::$aspectTypeNameTemplate; - } - - private static function getEntryNameTemplate() - { - if (self::$entryNameTemplate == null) { - self::$entryNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}' - ); - } - - return self::$entryNameTemplate; - } - - private static function getEntryGroupNameTemplate() - { - if (self::$entryGroupNameTemplate == null) { - self::$entryGroupNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/entryGroups/{entry_group}' - ); - } - - return self::$entryGroupNameTemplate; - } - - private static function getEntryTypeNameTemplate() - { - if (self::$entryTypeNameTemplate == null) { - self::$entryTypeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/entryTypes/{entry_type}' - ); - } - - return self::$entryTypeNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'aspectType' => self::getAspectTypeNameTemplate(), - 'entry' => self::getEntryNameTemplate(), - 'entryGroup' => self::getEntryGroupNameTemplate(), - 'entryType' => self::getEntryTypeNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a aspect_type - * resource. - * - * @param string $project - * @param string $location - * @param string $aspectType - * - * @return string The formatted aspect_type resource. - */ - public static function aspectTypeName($project, $location, $aspectType) - { - return self::getAspectTypeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'aspect_type' => $aspectType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a entry - * resource. - * - * @param string $project - * @param string $location - * @param string $entryGroup - * @param string $entry - * - * @return string The formatted entry resource. - */ - public static function entryName($project, $location, $entryGroup, $entry) - { - return self::getEntryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'entry_group' => $entryGroup, - 'entry' => $entry, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a entry_group - * resource. - * - * @param string $project - * @param string $location - * @param string $entryGroup - * - * @return string The formatted entry_group resource. - */ - public static function entryGroupName($project, $location, $entryGroup) - { - return self::getEntryGroupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'entry_group' => $entryGroup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a entry_type - * resource. - * - * @param string $project - * @param string $location - * @param string $entryType - * - * @return string The formatted entry_type resource. - */ - public static function entryTypeName($project, $location, $entryType) - { - return self::getEntryTypeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'entry_type' => $entryType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - aspectType: projects/{project}/locations/{location}/aspectTypes/{aspect_type} - * - entry: projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry} - * - entryGroup: projects/{project}/locations/{location}/entryGroups/{entry_group} - * - entryType: projects/{project}/locations/{location}/entryTypes/{entry_type} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataplex.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates an AspectType - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $aspectTypeId = 'aspect_type_id'; - * $aspectType = new AspectType(); - * $operationResponse = $catalogServiceClient->createAspectType($formattedParent, $aspectTypeId, $aspectType); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->createAspectType($formattedParent, $aspectTypeId, $aspectType); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'createAspectType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the AspectType, of the form: - * projects/{project_number}/locations/{location_id} - * where `location_id` refers to a GCP region. - * @param string $aspectTypeId Required. AspectType identifier. - * @param AspectType $aspectType Required. AspectType Resource - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createAspectType( - $parent, - $aspectTypeId, - $aspectType, - array $optionalArgs = [] - ) { - $request = new CreateAspectTypeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAspectTypeId($aspectTypeId); - $request->setAspectType($aspectType); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateAspectType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates an Entry. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - * $entryId = 'entry_id'; - * $entry = new Entry(); - * $response = $catalogServiceClient->createEntry($formattedParent, $entryId, $entry); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent Entry Group: - * `projects/{project}/locations/{location}/entryGroups/{entry_group}`. - * @param string $entryId Required. Entry identifier. It has to be unique within an Entry Group. - * - * Entries corresponding to Google Cloud resources use Entry ID format based - * on Full Resource Names - * (https://cloud.google.com/apis/design/resource_names#full_resource_name). - * The format is a Full Resource Name of the resource without the - * prefix double slashes in the API Service Name part of Full Resource Name. - * This allows retrieval of entries using their associated resource name. - * - * For example if the Full Resource Name of a resource is - * `//library.googleapis.com/shelves/shelf1/books/book2`, - * then the suggested entry_id is - * `library.googleapis.com/shelves/shelf1/books/book2`. - * - * It is also suggested to follow the same convention for entries - * corresponding to resources from other providers or systems than Google - * Cloud. - * - * The maximum size of the field is 4000 characters. - * @param Entry $entry Required. Entry resource. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Entry - * - * @throws ApiException if the remote call fails - */ - public function createEntry( - $parent, - $entryId, - $entry, - array $optionalArgs = [] - ) { - $request = new CreateEntryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntryId($entryId); - $request->setEntry($entry); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateEntry', - Entry::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates an EntryGroup - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $entryGroupId = 'entry_group_id'; - * $entryGroup = new EntryGroup(); - * $operationResponse = $catalogServiceClient->createEntryGroup($formattedParent, $entryGroupId, $entryGroup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->createEntryGroup($formattedParent, $entryGroupId, $entryGroup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'createEntryGroup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the entryGroup, of the form: - * projects/{project_number}/locations/{location_id} - * where `location_id` refers to a GCP region. - * @param string $entryGroupId Required. EntryGroup identifier. - * @param EntryGroup $entryGroup Required. EntryGroup Resource - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createEntryGroup( - $parent, - $entryGroupId, - $entryGroup, - array $optionalArgs = [] - ) { - $request = new CreateEntryGroupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntryGroupId($entryGroupId); - $request->setEntryGroup($entryGroup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateEntryGroup', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates an EntryType - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $entryTypeId = 'entry_type_id'; - * $entryType = new EntryType(); - * $operationResponse = $catalogServiceClient->createEntryType($formattedParent, $entryTypeId, $entryType); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->createEntryType($formattedParent, $entryTypeId, $entryType); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'createEntryType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the EntryType, of the form: - * projects/{project_number}/locations/{location_id} - * where `location_id` refers to a GCP region. - * @param string $entryTypeId Required. EntryType identifier. - * @param EntryType $entryType Required. EntryType Resource - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createEntryType( - $parent, - $entryTypeId, - $entryType, - array $optionalArgs = [] - ) { - $request = new CreateEntryTypeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntryTypeId($entryTypeId); - $request->setEntryType($entryType); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateEntryType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a AspectType resource. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - * $operationResponse = $catalogServiceClient->deleteAspectType($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->deleteAspectType($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'deleteAspectType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the AspectType: - * `projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. If the client provided etag value does not match the current etag - * value, the DeleteAspectTypeRequest method returns an ABORTED error response - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteAspectType($name, array $optionalArgs = []) - { - $request = new DeleteAspectTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteAspectType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes an Entry. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - * $response = $catalogServiceClient->deleteEntry($formattedName); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Entry: - * `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Entry - * - * @throws ApiException if the remote call fails - */ - public function deleteEntry($name, array $optionalArgs = []) - { - $request = new DeleteEntryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteEntry', - Entry::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a EntryGroup resource. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - * $operationResponse = $catalogServiceClient->deleteEntryGroup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->deleteEntryGroup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'deleteEntryGroup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the EntryGroup: - * `projects/{project_number}/locations/{location_id}/entryGroups/{entry_group_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. If the client provided etag value does not match the current etag - * value, the DeleteEntryGroupRequest method returns an ABORTED error response - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteEntryGroup($name, array $optionalArgs = []) - { - $request = new DeleteEntryGroupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteEntryGroup', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a EntryType resource. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - * $operationResponse = $catalogServiceClient->deleteEntryType($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->deleteEntryType($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'deleteEntryType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the EntryType: - * `projects/{project_number}/locations/{location_id}/entryTypes/{entry_type_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. If the client provided etag value does not match the current etag - * value, the DeleteEntryTypeRequest method returns an ABORTED error response - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteEntryType($name, array $optionalArgs = []) - { - $request = new DeleteEntryTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteEntryType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Retrieves a AspectType resource. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - * $response = $catalogServiceClient->getAspectType($formattedName); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the AspectType: - * `projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\AspectType - * - * @throws ApiException if the remote call fails - */ - public function getAspectType($name, array $optionalArgs = []) - { - $request = new GetAspectTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetAspectType', - AspectType::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a single entry. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - * $response = $catalogServiceClient->getEntry($formattedName); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Entry: - * `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. View for controlling which parts of an entry are to be returned. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataplex\V1\EntryView} - * @type string[] $aspectTypes - * Optional. Limits the aspects returned to the provided aspect types. - * Only works if the CUSTOM view is selected. - * @type string[] $paths - * Optional. Limits the aspects returned to those associated with the provided - * paths within the Entry. Only works if the CUSTOM view is selected. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Entry - * - * @throws ApiException if the remote call fails - */ - public function getEntry($name, array $optionalArgs = []) - { - $request = new GetEntryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['aspectTypes'])) { - $request->setAspectTypes($optionalArgs['aspectTypes']); - } - - if (isset($optionalArgs['paths'])) { - $request->setPaths($optionalArgs['paths']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetEntry', - Entry::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a EntryGroup resource. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - * $response = $catalogServiceClient->getEntryGroup($formattedName); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the EntryGroup: - * `projects/{project_number}/locations/{location_id}/entryGroups/{entry_group_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\EntryGroup - * - * @throws ApiException if the remote call fails - */ - public function getEntryGroup($name, array $optionalArgs = []) - { - $request = new GetEntryGroupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetEntryGroup', - EntryGroup::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a EntryType resource. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - * $response = $catalogServiceClient->getEntryType($formattedName); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the EntryType: - * `projects/{project_number}/locations/{location_id}/entryTypes/{entry_type_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\EntryType - * - * @throws ApiException if the remote call fails - */ - public function getEntryType($name, array $optionalArgs = []) - { - $request = new GetEntryTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetEntryType', - EntryType::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists AspectType resources in a project and location. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $catalogServiceClient->listAspectTypes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $catalogServiceClient->listAspectTypes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the AspectType location, of the form: - * `projects/{project_number}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. Filters are case-sensitive. - * The following formats are supported: - * - * labels.key1 = "value1" - * labels:key1 - * name = "value" - * These restrictions can be coinjoined with AND, OR and NOT conjunctions. - * @type string $orderBy - * Optional. Order by fields (`name` or `create_time`) for the result. - * If not specified, the ordering is undefined. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAspectTypes($parent, array $optionalArgs = []) - { - $request = new ListAspectTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListAspectTypes', - $optionalArgs, - ListAspectTypesResponse::class, - $request - ); - } - - /** - * Lists entries within an entry group. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - * // Iterate over pages of elements - * $pagedResponse = $catalogServiceClient->listEntries($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $catalogServiceClient->listEntries($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent Entry Group: - * `projects/{project}/locations/{location}/entryGroups/{entry_group}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. A filter on the entries to return. - * Filters are case-sensitive. - * The request can be filtered by the following fields: - * entry_type, display_name. - * The comparison operators are =, !=, <, >, <=, >= (strings are compared - * according to lexical order) - * The logical operators AND, OR, NOT can be used - * in the filter. Example filter expressions: - * "display_name=AnExampleDisplayName" - * "entry_type=projects/example-project/locations/global/entryTypes/example-entry_type" - * "entry_type=projects/a* OR "entry_type=projects/k*" - * "NOT display_name=AnotherExampleDisplayName" - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEntries($parent, array $optionalArgs = []) - { - $request = new ListEntriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListEntries', - $optionalArgs, - ListEntriesResponse::class, - $request - ); - } - - /** - * Lists EntryGroup resources in a project and location. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $catalogServiceClient->listEntryGroups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $catalogServiceClient->listEntryGroups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the entryGroup location, of the form: - * `projects/{project_number}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * @type string $orderBy - * Optional. Order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEntryGroups($parent, array $optionalArgs = []) - { - $request = new ListEntryGroupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListEntryGroups', - $optionalArgs, - ListEntryGroupsResponse::class, - $request - ); - } - - /** - * Lists EntryType resources in a project and location. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $catalogServiceClient->listEntryTypes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $catalogServiceClient->listEntryTypes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the EntryType location, of the form: - * `projects/{project_number}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. Filters are case-sensitive. - * The following formats are supported: - * - * labels.key1 = "value1" - * labels:key1 - * name = "value" - * These restrictions can be coinjoined with AND, OR and NOT conjunctions. - * @type string $orderBy - * Optional. Order by fields (`name` or `create_time`) for the result. - * If not specified, the ordering is undefined. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEntryTypes($parent, array $optionalArgs = []) - { - $request = new ListEntryTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListEntryTypes', - $optionalArgs, - ListEntryTypesResponse::class, - $request - ); - } - - /** - * Looks up a single entry. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $name = 'name'; - * $formattedEntry = $catalogServiceClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - * $response = $catalogServiceClient->lookupEntry($name, $formattedEntry); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The project to which the request should be attributed in the - * following form: `projects/{project}/locations/{location}`. - * @param string $entry Required. The resource name of the Entry: - * `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. View for controlling which parts of an entry are to be returned. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataplex\V1\EntryView} - * @type string[] $aspectTypes - * Optional. Limits the aspects returned to the provided aspect types. - * Only works if the CUSTOM view is selected. - * @type string[] $paths - * Optional. Limits the aspects returned to those associated with the provided - * paths within the Entry. Only works if the CUSTOM view is selected. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Entry - * - * @throws ApiException if the remote call fails - */ - public function lookupEntry($name, $entry, array $optionalArgs = []) - { - $request = new LookupEntryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setEntry($entry); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['aspectTypes'])) { - $request->setAspectTypes($optionalArgs['aspectTypes']); - } - - if (isset($optionalArgs['paths'])) { - $request->setPaths($optionalArgs['paths']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'LookupEntry', - Entry::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Searches for entries matching given query and scope. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $name = 'name'; - * $query = 'query'; - * // Iterate over pages of elements - * $pagedResponse = $catalogServiceClient->searchEntries($name, $query); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $catalogServiceClient->searchEntries($name, $query); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The project to which the request should be attributed in the - * following form: `projects/{project}/locations/{location}`. - * @param string $query Required. The query against which entries in scope should be matched. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * Optional. Ordering of the results. Supported options to be added later. - * @type string $scope - * Optional. The scope under which the search should be operating. Should - * either be organizations/ or projects/. If left - * unspecified, it will default to the organization where the project provided - * in `name` is located. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function searchEntries($name, $query, array $optionalArgs = []) - { - $request = new SearchEntriesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setQuery($query); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['scope'])) { - $request->setScope($optionalArgs['scope']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'SearchEntries', - $optionalArgs, - SearchEntriesResponse::class, - $request - ); - } - - /** - * Updates a AspectType resource. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $aspectType = new AspectType(); - * $updateMask = new FieldMask(); - * $operationResponse = $catalogServiceClient->updateAspectType($aspectType, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->updateAspectType($aspectType, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'updateAspectType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param AspectType $aspectType Required. AspectType Resource - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateAspectType( - $aspectType, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateAspectTypeRequest(); - $requestParamHeaders = []; - $request->setAspectType($aspectType); - $request->setUpdateMask($updateMask); - $requestParamHeaders['aspect_type.name'] = $aspectType->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateAspectType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates an Entry. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $entry = new Entry(); - * $response = $catalogServiceClient->updateEntry($entry); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param Entry $entry Required. Entry resource. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Mask of fields to update. To update Aspects, the update_mask must - * contain the value "aspects". - * - * If the update_mask is empty, all modifiable fields present in the request - * will be updated. - * @type bool $allowMissing - * Optional. If set to true and the entry does not exist, it will be created. - * @type bool $deleteMissingAspects - * Optional. If set to true and the aspect_keys specify aspect ranges, any - * existing aspects from that range not provided in the request will be - * deleted. - * @type string[] $aspectKeys - * Optional. The map keys of the Aspects which should be modified. Supports - * the following syntaxes: - * * - matches aspect on given type and empty path - * * @path - matches aspect on given type and specified - * path - * * * - matches aspects on given type for all paths - * * *@path - matches aspects of all types on the given path - * - * Existing aspects matching the syntax will not be removed unless - * `delete_missing_aspects` is set to true. - * - * If this field is left empty, it will be treated as specifying exactly those - * Aspects present in the request. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Entry - * - * @throws ApiException if the remote call fails - */ - public function updateEntry($entry, array $optionalArgs = []) - { - $request = new UpdateEntryRequest(); - $requestParamHeaders = []; - $request->setEntry($entry); - $requestParamHeaders['entry.name'] = $entry->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['deleteMissingAspects'])) { - $request->setDeleteMissingAspects( - $optionalArgs['deleteMissingAspects'] - ); - } - - if (isset($optionalArgs['aspectKeys'])) { - $request->setAspectKeys($optionalArgs['aspectKeys']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateEntry', - Entry::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a EntryGroup resource. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $entryGroup = new EntryGroup(); - * $updateMask = new FieldMask(); - * $operationResponse = $catalogServiceClient->updateEntryGroup($entryGroup, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->updateEntryGroup($entryGroup, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'updateEntryGroup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param EntryGroup $entryGroup Required. EntryGroup Resource - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateEntryGroup( - $entryGroup, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateEntryGroupRequest(); - $requestParamHeaders = []; - $request->setEntryGroup($entryGroup); - $request->setUpdateMask($updateMask); - $requestParamHeaders['entry_group.name'] = $entryGroup->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateEntryGroup', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a EntryType resource. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $entryType = new EntryType(); - * $updateMask = new FieldMask(); - * $operationResponse = $catalogServiceClient->updateEntryType($entryType, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->updateEntryType($entryType, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'updateEntryType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param EntryType $entryType Required. EntryType Resource - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateEntryType( - $entryType, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateEntryTypeRequest(); - $requestParamHeaders = []; - $request->setEntryType($entryType); - $request->setUpdateMask($updateMask); - $requestParamHeaders['entry_type.name'] = $entryType->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateEntryType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $resource = 'resource'; - * $response = $catalogServiceClient->getIamPolicy($resource); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $catalogServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $catalogServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $response = $catalogServiceClient->getLocation(); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $catalogServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $catalogServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } -} diff --git a/Dataplex/src/V1/Gapic/ContentServiceGapicClient.php b/Dataplex/src/V1/Gapic/ContentServiceGapicClient.php deleted file mode 100644 index 3afeff4b114a..000000000000 --- a/Dataplex/src/V1/Gapic/ContentServiceGapicClient.php +++ /dev/null @@ -1,972 +0,0 @@ -lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * $content = new Content(); - * $response = $contentServiceClient->createContent($formattedParent, $content); - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataplex\V1\Client\ContentServiceClient}. - */ -class ContentServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dataplex.v1.ContentService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataplex.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataplex.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $contentNameTemplate; - - private static $lakeNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/content_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/content_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/content_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/content_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getContentNameTemplate() - { - if (self::$contentNameTemplate == null) { - self::$contentNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/content/{content}' - ); - } - - return self::$contentNameTemplate; - } - - private static function getLakeNameTemplate() - { - if (self::$lakeNameTemplate == null) { - self::$lakeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}' - ); - } - - return self::$lakeNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'content' => self::getContentNameTemplate(), - 'lake' => self::getLakeNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a content - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $content - * - * @return string The formatted content resource. - */ - public static function contentName($project, $location, $lake, $content) - { - return self::getContentNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'content' => $content, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a lake - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * - * @return string The formatted lake resource. - */ - public static function lakeName($project, $location, $lake) - { - return self::getLakeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - content: projects/{project}/locations/{location}/lakes/{lake}/content/{content} - * - lake: projects/{project}/locations/{location}/lakes/{lake} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataplex.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Create a content. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * $formattedParent = $contentServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * $content = new Content(); - * $response = $contentServiceClient->createContent($formattedParent, $content); - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent lake: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id} - * @param Content $content Required. Content resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Content - * - * @throws ApiException if the remote call fails - */ - public function createContent($parent, $content, array $optionalArgs = []) - { - $request = new CreateContentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setContent($content); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateContent', - Content::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Delete a content. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * $formattedName = $contentServiceClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - * $contentServiceClient->deleteContent($formattedName); - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the content: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteContent($name, array $optionalArgs = []) - { - $request = new DeleteContentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteContent', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Get a content resource. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * $formattedName = $contentServiceClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - * $response = $contentServiceClient->getContent($formattedName); - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the content: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. Specify content view to make a partial request. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataplex\V1\GetContentRequest\ContentView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Content - * - * @throws ApiException if the remote call fails - */ - public function getContent($name, array $optionalArgs = []) - { - $request = new GetContentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetContent', - Content::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets the access control policy for a contentitem resource. A `NOT_FOUND` - * error is returned if the resource does not exist. An empty policy is - * returned if the resource exists but does not have a policy set on it. - * - * Caller must have Google IAM `dataplex.content.getIamPolicy` permission - * on the resource. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * $resource = 'resource'; - * $response = $contentServiceClient->getIamPolicy($resource); - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * List content. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * $formattedParent = $contentServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * // Iterate over pages of elements - * $pagedResponse = $contentServiceClient->listContent($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $contentServiceClient->listContent($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent lake: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id} - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. Filters are case-sensitive. - * The following formats are supported: - * - * labels.key1 = "value1" - * labels:key1 - * type = "NOTEBOOK" - * type = "SQL_SCRIPT" - * - * These restrictions can be coinjoined with AND, OR and NOT conjunctions. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listContent($parent, array $optionalArgs = []) - { - $request = new ListContentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListContent', - $optionalArgs, - ListContentResponse::class, - $request - ); - } - - /** - * Sets the access control policy on the specified contentitem resource. - * Replaces any existing policy. - * - * Caller must have Google IAM `dataplex.content.setIamPolicy` permission - * on the resource. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $contentServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Returns the caller's permissions on a resource. - * If the resource does not exist, an empty set of - * permissions is returned (a `NOT_FOUND` error is not returned). - * - * A caller is not required to have Google IAM permission to make this - * request. - * - * Note: This operation is designed to be used for building permission-aware - * UIs and command-line tools, not for authorization checking. This operation - * may "fail open" without warning. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $contentServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Update a content. Only supports full resource update. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $content = new Content(); - * $response = $contentServiceClient->updateContent($updateMask, $content); - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param Content $content Required. Update description. - * Only fields specified in `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Content - * - * @throws ApiException if the remote call fails - */ - public function updateContent( - $updateMask, - $content, - array $optionalArgs = [] - ) { - $request = new UpdateContentRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setContent($content); - $requestParamHeaders['content.name'] = $content->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateContent', - Content::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * $response = $contentServiceClient->getLocation(); - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $contentServiceClient = new ContentServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $contentServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $contentServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $contentServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } -} diff --git a/Dataplex/src/V1/Gapic/DataScanServiceGapicClient.php b/Dataplex/src/V1/Gapic/DataScanServiceGapicClient.php deleted file mode 100644 index 4a895f38ccf0..000000000000 --- a/Dataplex/src/V1/Gapic/DataScanServiceGapicClient.php +++ /dev/null @@ -1,1483 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $dataScan = new DataScan(); - * $dataScanId = 'data_scan_id'; - * $operationResponse = $dataScanServiceClient->createDataScan($formattedParent, $dataScan, $dataScanId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataScanServiceClient->createDataScan($formattedParent, $dataScan, $dataScanId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataScanServiceClient->resumeOperation($operationName, 'createDataScan'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataplex\V1\Client\DataScanServiceClient}. - */ -class DataScanServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dataplex.v1.DataScanService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataplex.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataplex.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $dataScanNameTemplate; - - private static $dataScanJobNameTemplate; - - private static $entityNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/data_scan_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/data_scan_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/data_scan_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/data_scan_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getDataScanNameTemplate() - { - if (self::$dataScanNameTemplate == null) { - self::$dataScanNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/dataScans/{dataScan}' - ); - } - - return self::$dataScanNameTemplate; - } - - private static function getDataScanJobNameTemplate() - { - if (self::$dataScanJobNameTemplate == null) { - self::$dataScanJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/dataScans/{dataScan}/jobs/{job}' - ); - } - - return self::$dataScanJobNameTemplate; - } - - private static function getEntityNameTemplate() - { - if (self::$entityNameTemplate == null) { - self::$entityNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}' - ); - } - - return self::$entityNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'dataScan' => self::getDataScanNameTemplate(), - 'dataScanJob' => self::getDataScanJobNameTemplate(), - 'entity' => self::getEntityNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a data_scan - * resource. - * - * @param string $project - * @param string $location - * @param string $dataScan - * - * @return string The formatted data_scan resource. - */ - public static function dataScanName($project, $location, $dataScan) - { - return self::getDataScanNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataScan' => $dataScan, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * data_scan_job resource. - * - * @param string $project - * @param string $location - * @param string $dataScan - * @param string $job - * - * @return string The formatted data_scan_job resource. - */ - public static function dataScanJobName($project, $location, $dataScan, $job) - { - return self::getDataScanJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataScan' => $dataScan, - 'job' => $job, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a entity - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $zone - * @param string $entity - * - * @return string The formatted entity resource. - */ - public static function entityName( - $project, - $location, - $lake, - $zone, - $entity - ) { - return self::getEntityNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'zone' => $zone, - 'entity' => $entity, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - dataScan: projects/{project}/locations/{location}/dataScans/{dataScan} - * - dataScanJob: projects/{project}/locations/{location}/dataScans/{dataScan}/jobs/{job} - * - entity: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataplex.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a DataScan resource. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $formattedParent = $dataScanServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $dataScan = new DataScan(); - * $dataScanId = 'data_scan_id'; - * $operationResponse = $dataScanServiceClient->createDataScan($formattedParent, $dataScan, $dataScanId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataScanServiceClient->createDataScan($formattedParent, $dataScan, $dataScanId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataScanServiceClient->resumeOperation($operationName, 'createDataScan'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent location: - * `projects/{project}/locations/{location_id}` - * where `project` refers to a *project_id* or *project_number* and - * `location_id` refers to a GCP region. - * @param DataScan $dataScan Required. DataScan resource. - * @param string $dataScanId Required. DataScan identifier. - * - * * Must contain only lowercase letters, numbers and hyphens. - * * Must start with a letter. - * * Must end with a number or a letter. - * * Must be between 1-63 characters. - * * Must be unique within the customer project / location. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is `false`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDataScan( - $parent, - $dataScan, - $dataScanId, - array $optionalArgs = [] - ) { - $request = new CreateDataScanRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDataScan($dataScan); - $request->setDataScanId($dataScanId); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateDataScan', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a DataScan resource. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $formattedName = $dataScanServiceClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - * $operationResponse = $dataScanServiceClient->deleteDataScan($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataScanServiceClient->deleteDataScan($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataScanServiceClient->resumeOperation($operationName, 'deleteDataScan'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the dataScan: - * `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}` - * where `project` refers to a *project_id* or *project_number* and - * `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDataScan($name, array $optionalArgs = []) - { - $request = new DeleteDataScanRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDataScan', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Generates recommended DataQualityRule from a data profiling DataScan. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $name = 'name'; - * $response = $dataScanServiceClient->generateDataQualityRules($name); - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name should be either - * * the name of a datascan with at least one successful completed data - * profiling job, or - * * the name of a successful completed data profiling datascan job. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\GenerateDataQualityRulesResponse - * - * @throws ApiException if the remote call fails - */ - public function generateDataQualityRules($name, array $optionalArgs = []) - { - $request = new GenerateDataQualityRulesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GenerateDataQualityRules', - GenerateDataQualityRulesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a DataScan resource. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $formattedName = $dataScanServiceClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - * $response = $dataScanServiceClient->getDataScan($formattedName); - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the dataScan: - * `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}` - * where `project` refers to a *project_id* or *project_number* and - * `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. Select the DataScan view to return. Defaults to `BASIC`. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataplex\V1\GetDataScanRequest\DataScanView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\DataScan - * - * @throws ApiException if the remote call fails - */ - public function getDataScan($name, array $optionalArgs = []) - { - $request = new GetDataScanRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDataScan', - DataScan::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a DataScanJob resource. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $formattedName = $dataScanServiceClient->dataScanJobName('[PROJECT]', '[LOCATION]', '[DATASCAN]', '[JOB]'); - * $response = $dataScanServiceClient->getDataScanJob($formattedName); - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the DataScanJob: - * `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{data_scan_job_id}` - * where `project` refers to a *project_id* or *project_number* and - * `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. Select the DataScanJob view to return. Defaults to `BASIC`. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataplex\V1\GetDataScanJobRequest\DataScanJobView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\DataScanJob - * - * @throws ApiException if the remote call fails - */ - public function getDataScanJob($name, array $optionalArgs = []) - { - $request = new GetDataScanJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDataScanJob', - DataScanJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists DataScanJobs under the given DataScan. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $formattedParent = $dataScanServiceClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - * // Iterate over pages of elements - * $pagedResponse = $dataScanServiceClient->listDataScanJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataScanServiceClient->listDataScanJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent environment: - * `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}` - * where `project` refers to a *project_id* or *project_number* and - * `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. An expression for filtering the results of the ListDataScanJobs - * request. - * - * If unspecified, all datascan jobs will be returned. Multiple filters can be - * applied (with `AND`, `OR` logical operators). Filters are case-sensitive. - * - * Allowed fields are: - * - * - `start_time` - * - `end_time` - * - * `start_time` and `end_time` expect RFC-3339 formatted strings (e.g. - * 2018-10-08T18:30:00-07:00). - * - * For instance, 'start_time > 2018-10-08T00:00:00.123456789Z AND end_time < - * 2018-10-09T00:00:00.123456789Z' limits results to DataScanJobs between - * specified start and end times. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDataScanJobs($parent, array $optionalArgs = []) - { - $request = new ListDataScanJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDataScanJobs', - $optionalArgs, - ListDataScanJobsResponse::class, - $request - ); - } - - /** - * Lists DataScans. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $formattedParent = $dataScanServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataScanServiceClient->listDataScans($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataScanServiceClient->listDataScans($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent location: - * `projects/{project}/locations/{location_id}` - * where `project` refers to a *project_id* or *project_number* and - * `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * @type string $orderBy - * Optional. Order by fields (`name` or `create_time`) for the result. - * If not specified, the ordering is undefined. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDataScans($parent, array $optionalArgs = []) - { - $request = new ListDataScansRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDataScans', - $optionalArgs, - ListDataScansResponse::class, - $request - ); - } - - /** - * Runs an on-demand execution of a DataScan - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $formattedName = $dataScanServiceClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - * $response = $dataScanServiceClient->runDataScan($formattedName); - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the DataScan: - * `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`. - * where `project` refers to a *project_id* or *project_number* and - * `location_id` refers to a GCP region. - * - * Only **OnDemand** data scans are allowed. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\RunDataScanResponse - * - * @throws ApiException if the remote call fails - */ - public function runDataScan($name, array $optionalArgs = []) - { - $request = new RunDataScanRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'RunDataScan', - RunDataScanResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a DataScan resource. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $dataScan = new DataScan(); - * $updateMask = new FieldMask(); - * $operationResponse = $dataScanServiceClient->updateDataScan($dataScan, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataScanServiceClient->updateDataScan($dataScan, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataScanServiceClient->resumeOperation($operationName, 'updateDataScan'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param DataScan $dataScan Required. DataScan resource to be updated. - * - * Only fields specified in `update_mask` are updated. - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is `false`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateDataScan( - $dataScan, - $updateMask, - array $optionalArgs = [] - ) { - $request = new UpdateDataScanRequest(); - $requestParamHeaders = []; - $request->setDataScan($dataScan); - $request->setUpdateMask($updateMask); - $requestParamHeaders['data_scan.name'] = $dataScan->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateDataScan', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $resource = 'resource'; - * $response = $dataScanServiceClient->getIamPolicy($resource); - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataScanServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataScanServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * $response = $dataScanServiceClient->getLocation(); - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataScanServiceClient = new DataScanServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataScanServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataScanServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataScanServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } -} diff --git a/Dataplex/src/V1/Gapic/DataTaxonomyServiceGapicClient.php b/Dataplex/src/V1/Gapic/DataTaxonomyServiceGapicClient.php deleted file mode 100644 index 45e0047b01d6..000000000000 --- a/Dataplex/src/V1/Gapic/DataTaxonomyServiceGapicClient.php +++ /dev/null @@ -1,2028 +0,0 @@ -dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - * $dataAttributeId = 'data_attribute_id'; - * $dataAttribute = new DataAttribute(); - * $operationResponse = $dataTaxonomyServiceClient->createDataAttribute($formattedParent, $dataAttributeId, $dataAttribute); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->createDataAttribute($formattedParent, $dataAttributeId, $dataAttribute); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'createDataAttribute'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataplex\V1\Client\DataTaxonomyServiceClient}. - */ -class DataTaxonomyServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dataplex.v1.DataTaxonomyService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataplex.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataplex.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $dataAttributeNameTemplate; - - private static $dataAttributeBindingNameTemplate; - - private static $dataTaxonomyNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/data_taxonomy_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/data_taxonomy_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/data_taxonomy_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/data_taxonomy_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getDataAttributeNameTemplate() - { - if (self::$dataAttributeNameTemplate == null) { - self::$dataAttributeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id}' - ); - } - - return self::$dataAttributeNameTemplate; - } - - private static function getDataAttributeBindingNameTemplate() - { - if (self::$dataAttributeBindingNameTemplate == null) { - self::$dataAttributeBindingNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/dataAttributeBindings/{data_attribute_binding_id}' - ); - } - - return self::$dataAttributeBindingNameTemplate; - } - - private static function getDataTaxonomyNameTemplate() - { - if (self::$dataTaxonomyNameTemplate == null) { - self::$dataTaxonomyNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/dataTaxonomies/{data_taxonomy_id}' - ); - } - - return self::$dataTaxonomyNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'dataAttribute' => self::getDataAttributeNameTemplate(), - 'dataAttributeBinding' => self::getDataAttributeBindingNameTemplate(), - 'dataTaxonomy' => self::getDataTaxonomyNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * data_attribute resource. - * - * @param string $project - * @param string $location - * @param string $dataTaxonomy - * @param string $dataAttributeId - * - * @return string The formatted data_attribute resource. - */ - public static function dataAttributeName( - $project, - $location, - $dataTaxonomy, - $dataAttributeId - ) { - return self::getDataAttributeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'dataTaxonomy' => $dataTaxonomy, - 'data_attribute_id' => $dataAttributeId, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * data_attribute_binding resource. - * - * @param string $project - * @param string $location - * @param string $dataAttributeBindingId - * - * @return string The formatted data_attribute_binding resource. - */ - public static function dataAttributeBindingName( - $project, - $location, - $dataAttributeBindingId - ) { - return self::getDataAttributeBindingNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'data_attribute_binding_id' => $dataAttributeBindingId, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * data_taxonomy resource. - * - * @param string $project - * @param string $location - * @param string $dataTaxonomyId - * - * @return string The formatted data_taxonomy resource. - */ - public static function dataTaxonomyName( - $project, - $location, - $dataTaxonomyId - ) { - return self::getDataTaxonomyNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'data_taxonomy_id' => $dataTaxonomyId, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - dataAttribute: projects/{project}/locations/{location}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id} - * - dataAttributeBinding: projects/{project}/locations/{location}/dataAttributeBindings/{data_attribute_binding_id} - * - dataTaxonomy: projects/{project}/locations/{location}/dataTaxonomies/{data_taxonomy_id} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataplex.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Create a DataAttribute resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedParent = $dataTaxonomyServiceClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - * $dataAttributeId = 'data_attribute_id'; - * $dataAttribute = new DataAttribute(); - * $operationResponse = $dataTaxonomyServiceClient->createDataAttribute($formattedParent, $dataAttributeId, $dataAttribute); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->createDataAttribute($formattedParent, $dataAttributeId, $dataAttribute); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'createDataAttribute'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent data taxonomy - * projects/{project_number}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id} - * @param string $dataAttributeId Required. DataAttribute identifier. - * * Must contain only lowercase letters, numbers and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the DataTaxonomy. - * @param DataAttribute $dataAttribute Required. DataAttribute resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDataAttribute( - $parent, - $dataAttributeId, - $dataAttribute, - array $optionalArgs = [] - ) { - $request = new CreateDataAttributeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDataAttributeId($dataAttributeId); - $request->setDataAttribute($dataAttribute); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateDataAttribute', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Create a DataAttributeBinding resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedParent = $dataTaxonomyServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $dataAttributeBindingId = 'data_attribute_binding_id'; - * $dataAttributeBinding = new DataAttributeBinding(); - * $operationResponse = $dataTaxonomyServiceClient->createDataAttributeBinding($formattedParent, $dataAttributeBindingId, $dataAttributeBinding); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->createDataAttributeBinding($formattedParent, $dataAttributeBindingId, $dataAttributeBinding); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'createDataAttributeBinding'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent data taxonomy - * projects/{project_number}/locations/{location_id} - * @param string $dataAttributeBindingId Required. DataAttributeBinding identifier. - * * Must contain only lowercase letters, numbers and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the Location. - * @param DataAttributeBinding $dataAttributeBinding Required. DataAttributeBinding resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDataAttributeBinding( - $parent, - $dataAttributeBindingId, - $dataAttributeBinding, - array $optionalArgs = [] - ) { - $request = new CreateDataAttributeBindingRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDataAttributeBindingId($dataAttributeBindingId); - $request->setDataAttributeBinding($dataAttributeBinding); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateDataAttributeBinding', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Create a DataTaxonomy resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedParent = $dataTaxonomyServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $dataTaxonomyId = 'data_taxonomy_id'; - * $dataTaxonomy = new DataTaxonomy(); - * $operationResponse = $dataTaxonomyServiceClient->createDataTaxonomy($formattedParent, $dataTaxonomyId, $dataTaxonomy); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->createDataTaxonomy($formattedParent, $dataTaxonomyId, $dataTaxonomy); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'createDataTaxonomy'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the data taxonomy location, of the form: - * projects/{project_number}/locations/{location_id} - * where `location_id` refers to a GCP region. - * @param string $dataTaxonomyId Required. DataTaxonomy identifier. - * * Must contain only lowercase letters, numbers and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the Project. - * @param DataTaxonomy $dataTaxonomy Required. DataTaxonomy resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDataTaxonomy( - $parent, - $dataTaxonomyId, - $dataTaxonomy, - array $optionalArgs = [] - ) { - $request = new CreateDataTaxonomyRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDataTaxonomyId($dataTaxonomyId); - $request->setDataTaxonomy($dataTaxonomy); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateDataTaxonomy', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a Data Attribute resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedName = $dataTaxonomyServiceClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - * $operationResponse = $dataTaxonomyServiceClient->deleteDataAttribute($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->deleteDataAttribute($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'deleteDataAttribute'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the DataAttribute: - * projects/{project_number}/locations/{location_id}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id} - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. If the client provided etag value does not match the current etag - * value, the DeleteDataAttribute method returns an ABORTED error response. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDataAttribute($name, array $optionalArgs = []) - { - $request = new DeleteDataAttributeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDataAttribute', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a DataAttributeBinding resource. All attributes within the - * DataAttributeBinding must be deleted before the DataAttributeBinding can be - * deleted. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedName = $dataTaxonomyServiceClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); - * $etag = 'etag'; - * $operationResponse = $dataTaxonomyServiceClient->deleteDataAttributeBinding($formattedName, $etag); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->deleteDataAttributeBinding($formattedName, $etag); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'deleteDataAttributeBinding'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the DataAttributeBinding: - * projects/{project_number}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id} - * @param string $etag Required. If the client provided etag value does not match the current etag - * value, the DeleteDataAttributeBindingRequest method returns an ABORTED - * error response. Etags must be used when calling the - * DeleteDataAttributeBinding. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDataAttributeBinding( - $name, - $etag, - array $optionalArgs = [] - ) { - $request = new DeleteDataAttributeBindingRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setEtag($etag); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDataAttributeBinding', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a DataTaxonomy resource. All attributes within the DataTaxonomy - * must be deleted before the DataTaxonomy can be deleted. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedName = $dataTaxonomyServiceClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - * $operationResponse = $dataTaxonomyServiceClient->deleteDataTaxonomy($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->deleteDataTaxonomy($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'deleteDataTaxonomy'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the DataTaxonomy: - * projects/{project_number}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id} - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. If the client provided etag value does not match the current etag - * value,the DeleteDataTaxonomy method returns an ABORTED error. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDataTaxonomy($name, array $optionalArgs = []) - { - $request = new DeleteDataTaxonomyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDataTaxonomy', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Retrieves a Data Attribute resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedName = $dataTaxonomyServiceClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - * $response = $dataTaxonomyServiceClient->getDataAttribute($formattedName); - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the dataAttribute: - * projects/{project_number}/locations/{location_id}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\DataAttribute - * - * @throws ApiException if the remote call fails - */ - public function getDataAttribute($name, array $optionalArgs = []) - { - $request = new GetDataAttributeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDataAttribute', - DataAttribute::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a DataAttributeBinding resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedName = $dataTaxonomyServiceClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); - * $response = $dataTaxonomyServiceClient->getDataAttributeBinding($formattedName); - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the DataAttributeBinding: - * projects/{project_number}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\DataAttributeBinding - * - * @throws ApiException if the remote call fails - */ - public function getDataAttributeBinding($name, array $optionalArgs = []) - { - $request = new GetDataAttributeBindingRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDataAttributeBinding', - DataAttributeBinding::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a DataTaxonomy resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedName = $dataTaxonomyServiceClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - * $response = $dataTaxonomyServiceClient->getDataTaxonomy($formattedName); - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the DataTaxonomy: - * projects/{project_number}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\DataTaxonomy - * - * @throws ApiException if the remote call fails - */ - public function getDataTaxonomy($name, array $optionalArgs = []) - { - $request = new GetDataTaxonomyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDataTaxonomy', - DataTaxonomy::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists DataAttributeBinding resources in a project and location. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedParent = $dataTaxonomyServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataTaxonomyServiceClient->listDataAttributeBindings($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataTaxonomyServiceClient->listDataAttributeBindings($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the Location: - * projects/{project_number}/locations/{location_id} - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * Filter using resource: filter=resource:"resource-name" - * Filter using attribute: filter=attributes:"attribute-name" - * Filter using attribute in paths list: - * filter=paths.attributes:"attribute-name" - * @type string $orderBy - * Optional. Order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDataAttributeBindings($parent, array $optionalArgs = []) - { - $request = new ListDataAttributeBindingsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDataAttributeBindings', - $optionalArgs, - ListDataAttributeBindingsResponse::class, - $request - ); - } - - /** - * Lists Data Attribute resources in a DataTaxonomy. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedParent = $dataTaxonomyServiceClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - * // Iterate over pages of elements - * $pagedResponse = $dataTaxonomyServiceClient->listDataAttributes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataTaxonomyServiceClient->listDataAttributes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the DataTaxonomy: - * projects/{project_number}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id} - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * @type string $orderBy - * Optional. Order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDataAttributes($parent, array $optionalArgs = []) - { - $request = new ListDataAttributesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDataAttributes', - $optionalArgs, - ListDataAttributesResponse::class, - $request - ); - } - - /** - * Lists DataTaxonomy resources in a project and location. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $formattedParent = $dataTaxonomyServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataTaxonomyServiceClient->listDataTaxonomies($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataTaxonomyServiceClient->listDataTaxonomies($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the DataTaxonomy location, of the form: - * projects/{project_number}/locations/{location_id} - * where `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * @type string $orderBy - * Optional. Order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDataTaxonomies($parent, array $optionalArgs = []) - { - $request = new ListDataTaxonomiesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDataTaxonomies', - $optionalArgs, - ListDataTaxonomiesResponse::class, - $request - ); - } - - /** - * Updates a DataAttribute resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $dataAttribute = new DataAttribute(); - * $operationResponse = $dataTaxonomyServiceClient->updateDataAttribute($updateMask, $dataAttribute); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->updateDataAttribute($updateMask, $dataAttribute); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'updateDataAttribute'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param DataAttribute $dataAttribute Required. Only fields specified in `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateDataAttribute( - $updateMask, - $dataAttribute, - array $optionalArgs = [] - ) { - $request = new UpdateDataAttributeRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setDataAttribute($dataAttribute); - $requestParamHeaders['data_attribute.name'] = $dataAttribute->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateDataAttribute', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a DataAttributeBinding resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $dataAttributeBinding = new DataAttributeBinding(); - * $operationResponse = $dataTaxonomyServiceClient->updateDataAttributeBinding($updateMask, $dataAttributeBinding); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->updateDataAttributeBinding($updateMask, $dataAttributeBinding); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'updateDataAttributeBinding'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param DataAttributeBinding $dataAttributeBinding Required. Only fields specified in `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateDataAttributeBinding( - $updateMask, - $dataAttributeBinding, - array $optionalArgs = [] - ) { - $request = new UpdateDataAttributeBindingRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setDataAttributeBinding($dataAttributeBinding); - $requestParamHeaders[ - 'data_attribute_binding.name' - ] = $dataAttributeBinding->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateDataAttributeBinding', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a DataTaxonomy resource. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $dataTaxonomy = new DataTaxonomy(); - * $operationResponse = $dataTaxonomyServiceClient->updateDataTaxonomy($updateMask, $dataTaxonomy); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataTaxonomyServiceClient->updateDataTaxonomy($updateMask, $dataTaxonomy); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataTaxonomyServiceClient->resumeOperation($operationName, 'updateDataTaxonomy'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param DataTaxonomy $dataTaxonomy Required. Only fields specified in `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateDataTaxonomy( - $updateMask, - $dataTaxonomy, - array $optionalArgs = [] - ) { - $request = new UpdateDataTaxonomyRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setDataTaxonomy($dataTaxonomy); - $requestParamHeaders['data_taxonomy.name'] = $dataTaxonomy->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateDataTaxonomy', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $resource = 'resource'; - * $response = $dataTaxonomyServiceClient->getIamPolicy($resource); - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataTaxonomyServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataTaxonomyServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * $response = $dataTaxonomyServiceClient->getLocation(); - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataTaxonomyServiceClient = new DataTaxonomyServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataTaxonomyServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataTaxonomyServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataTaxonomyServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } -} diff --git a/Dataplex/src/V1/Gapic/DataplexServiceGapicClient.php b/Dataplex/src/V1/Gapic/DataplexServiceGapicClient.php deleted file mode 100644 index 9317059bcbd6..000000000000 --- a/Dataplex/src/V1/Gapic/DataplexServiceGapicClient.php +++ /dev/null @@ -1,3463 +0,0 @@ -jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - * $dataplexServiceClient->cancelJob($formattedName); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataplex\V1\Client\DataplexServiceClient}. - */ -class DataplexServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dataplex.v1.DataplexService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataplex.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataplex.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $assetNameTemplate; - - private static $environmentNameTemplate; - - private static $jobNameTemplate; - - private static $lakeNameTemplate; - - private static $locationNameTemplate; - - private static $taskNameTemplate; - - private static $zoneNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/dataplex_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/dataplex_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/dataplex_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/dataplex_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getAssetNameTemplate() - { - if (self::$assetNameTemplate == null) { - self::$assetNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}' - ); - } - - return self::$assetNameTemplate; - } - - private static function getEnvironmentNameTemplate() - { - if (self::$environmentNameTemplate == null) { - self::$environmentNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}' - ); - } - - return self::$environmentNameTemplate; - } - - private static function getJobNameTemplate() - { - if (self::$jobNameTemplate == null) { - self::$jobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}/jobs/{job}' - ); - } - - return self::$jobNameTemplate; - } - - private static function getLakeNameTemplate() - { - if (self::$lakeNameTemplate == null) { - self::$lakeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}' - ); - } - - return self::$lakeNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getTaskNameTemplate() - { - if (self::$taskNameTemplate == null) { - self::$taskNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}' - ); - } - - return self::$taskNameTemplate; - } - - private static function getZoneNameTemplate() - { - if (self::$zoneNameTemplate == null) { - self::$zoneNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}' - ); - } - - return self::$zoneNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'asset' => self::getAssetNameTemplate(), - 'environment' => self::getEnvironmentNameTemplate(), - 'job' => self::getJobNameTemplate(), - 'lake' => self::getLakeNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'task' => self::getTaskNameTemplate(), - 'zone' => self::getZoneNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a asset - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $zone - * @param string $asset - * - * @return string The formatted asset resource. - */ - public static function assetName($project, $location, $lake, $zone, $asset) - { - return self::getAssetNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'zone' => $zone, - 'asset' => $asset, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a environment - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $environment - * - * @return string The formatted environment resource. - */ - public static function environmentName( - $project, - $location, - $lake, - $environment - ) { - return self::getEnvironmentNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'environment' => $environment, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a job - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $task - * @param string $job - * - * @return string The formatted job resource. - */ - public static function jobName($project, $location, $lake, $task, $job) - { - return self::getJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'task' => $task, - 'job' => $job, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a lake - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * - * @return string The formatted lake resource. - */ - public static function lakeName($project, $location, $lake) - { - return self::getLakeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a task - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $task - * - * @return string The formatted task resource. - */ - public static function taskName($project, $location, $lake, $task) - { - return self::getTaskNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'task' => $task, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a zone - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $zone - * - * @return string The formatted zone resource. - */ - public static function zoneName($project, $location, $lake, $zone) - { - return self::getZoneNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'zone' => $zone, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - asset: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset} - * - environment: projects/{project}/locations/{location}/lakes/{lake}/environments/{environment} - * - job: projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}/jobs/{job} - * - lake: projects/{project}/locations/{location}/lakes/{lake} - * - location: projects/{project}/locations/{location} - * - task: projects/{project}/locations/{location}/lakes/{lake}/tasks/{task} - * - zone: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataplex.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Cancel jobs running for the task resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - * $dataplexServiceClient->cancelJob($formattedName); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the job: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}/job/{job_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function cancelJob($name, array $optionalArgs = []) - { - $request = new CancelJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelJob', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates an asset resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - * $assetId = 'asset_id'; - * $asset = new Asset(); - * $operationResponse = $dataplexServiceClient->createAsset($formattedParent, $assetId, $asset); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->createAsset($formattedParent, $assetId, $asset); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'createAsset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. - * @param string $assetId Required. Asset identifier. - * This ID will be used to generate names such as table names when publishing - * metadata to Hive Metastore and BigQuery. - * * Must contain only lowercase letters, numbers and hyphens. - * * Must start with a letter. - * * Must end with a number or a letter. - * * Must be between 1-63 characters. - * * Must be unique within the zone. - * @param Asset $asset Required. Asset resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createAsset( - $parent, - $assetId, - $asset, - array $optionalArgs = [] - ) { - $request = new CreateAssetRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAssetId($assetId); - $request->setAsset($asset); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateAsset', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Create an environment resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * $environmentId = 'environment_id'; - * $environment = new Environment(); - * $operationResponse = $dataplexServiceClient->createEnvironment($formattedParent, $environmentId, $environment); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->createEnvironment($formattedParent, $environmentId, $environment); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'createEnvironment'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent lake: - * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. - * @param string $environmentId Required. Environment identifier. - * * Must contain only lowercase letters, numbers and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the lake. - * @param Environment $environment Required. Environment resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createEnvironment( - $parent, - $environmentId, - $environment, - array $optionalArgs = [] - ) { - $request = new CreateEnvironmentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEnvironmentId($environmentId); - $request->setEnvironment($environment); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateEnvironment', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a lake resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $lakeId = 'lake_id'; - * $lake = new Lake(); - * $operationResponse = $dataplexServiceClient->createLake($formattedParent, $lakeId, $lake); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->createLake($formattedParent, $lakeId, $lake); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'createLake'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the lake location, of the form: - * projects/{project_number}/locations/{location_id} - * where `location_id` refers to a GCP region. - * @param string $lakeId Required. Lake identifier. - * This ID will be used to generate names such as database and dataset names - * when publishing metadata to Hive Metastore and BigQuery. - * * Must contain only lowercase letters, numbers and hyphens. - * * Must start with a letter. - * * Must end with a number or a letter. - * * Must be between 1-63 characters. - * * Must be unique within the customer project / location. - * @param Lake $lake Required. Lake resource - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createLake( - $parent, - $lakeId, - $lake, - array $optionalArgs = [] - ) { - $request = new CreateLakeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setLakeId($lakeId); - $request->setLake($lake); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateLake', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a task resource within a lake. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * $taskId = 'task_id'; - * $task = new Task(); - * $operationResponse = $dataplexServiceClient->createTask($formattedParent, $taskId, $task); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->createTask($formattedParent, $taskId, $task); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'createTask'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * @param string $taskId Required. Task identifier. - * @param Task $task Required. Task resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTask( - $parent, - $taskId, - $task, - array $optionalArgs = [] - ) { - $request = new CreateTaskRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTaskId($taskId); - $request->setTask($task); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateTask', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a zone resource within a lake. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * $zoneId = 'zone_id'; - * $zone = new Zone(); - * $operationResponse = $dataplexServiceClient->createZone($formattedParent, $zoneId, $zone); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->createZone($formattedParent, $zoneId, $zone); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'createZone'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * @param string $zoneId Required. Zone identifier. - * This ID will be used to generate names such as database and dataset names - * when publishing metadata to Hive Metastore and BigQuery. - * * Must contain only lowercase letters, numbers and hyphens. - * * Must start with a letter. - * * Must end with a number or a letter. - * * Must be between 1-63 characters. - * * Must be unique across all lakes from all locations in a project. - * * Must not be one of the reserved IDs (i.e. "default", "global-temp") - * @param Zone $zone Required. Zone resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createZone( - $parent, - $zoneId, - $zone, - array $optionalArgs = [] - ) { - $request = new CreateZoneRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setZoneId($zoneId); - $request->setZone($zone); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateZone', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes an asset resource. The referenced storage resource is detached - * (default) or deleted based on the associated Lifecycle policy. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - * $operationResponse = $dataplexServiceClient->deleteAsset($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->deleteAsset($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'deleteAsset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the asset: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteAsset($name, array $optionalArgs = []) - { - $request = new DeleteAssetRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteAsset', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Delete the environment resource. All the child resources must have been - * deleted before environment deletion can be initiated. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - * $operationResponse = $dataplexServiceClient->deleteEnvironment($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->deleteEnvironment($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'deleteEnvironment'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the environment: - * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteEnvironment($name, array $optionalArgs = []) - { - $request = new DeleteEnvironmentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteEnvironment', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a lake resource. All zones within the lake must be deleted before - * the lake can be deleted. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * $operationResponse = $dataplexServiceClient->deleteLake($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->deleteLake($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'deleteLake'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteLake($name, array $optionalArgs = []) - { - $request = new DeleteLakeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteLake', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Delete the task resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - * $operationResponse = $dataplexServiceClient->deleteTask($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->deleteTask($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'deleteTask'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the task: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTask($name, array $optionalArgs = []) - { - $request = new DeleteTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteTask', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a zone resource. All assets within a zone must be deleted before - * the zone can be deleted. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - * $operationResponse = $dataplexServiceClient->deleteZone($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->deleteZone($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'deleteZone'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteZone($name, array $optionalArgs = []) - { - $request = new DeleteZoneRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteZone', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Retrieves an asset resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - * $response = $dataplexServiceClient->getAsset($formattedName); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the asset: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Asset - * - * @throws ApiException if the remote call fails - */ - public function getAsset($name, array $optionalArgs = []) - { - $request = new GetAssetRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetAsset', - Asset::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Get environment resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - * $response = $dataplexServiceClient->getEnvironment($formattedName); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the environment: - * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Environment - * - * @throws ApiException if the remote call fails - */ - public function getEnvironment($name, array $optionalArgs = []) - { - $request = new GetEnvironmentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetEnvironment', - Environment::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Get job resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - * $response = $dataplexServiceClient->getJob($formattedName); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the job: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Job - * - * @throws ApiException if the remote call fails - */ - public function getJob($name, array $optionalArgs = []) - { - $request = new GetJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetJob', - Job::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a lake resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * $response = $dataplexServiceClient->getLake($formattedName); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Lake - * - * @throws ApiException if the remote call fails - */ - public function getLake($name, array $optionalArgs = []) - { - $request = new GetLakeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLake', - Lake::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Get task resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - * $response = $dataplexServiceClient->getTask($formattedName); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the task: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Task - * - * @throws ApiException if the remote call fails - */ - public function getTask($name, array $optionalArgs = []) - { - $request = new GetTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTask', - Task::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Retrieves a zone resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - * $response = $dataplexServiceClient->getZone($formattedName); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Zone - * - * @throws ApiException if the remote call fails - */ - public function getZone($name, array $optionalArgs = []) - { - $request = new GetZoneRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetZone', - Zone::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists action resources in an asset. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listAssetActions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listAssetActions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent asset: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAssetActions($parent, array $optionalArgs = []) - { - $request = new ListAssetActionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListAssetActions', - $optionalArgs, - ListActionsResponse::class, - $request - ); - } - - /** - * Lists asset resources in a zone. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listAssets($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listAssets($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * @type string $orderBy - * Optional. Order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAssets($parent, array $optionalArgs = []) - { - $request = new ListAssetsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListAssets', - $optionalArgs, - ListAssetsResponse::class, - $request - ); - } - - /** - * Lists environments under the given lake. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listEnvironments($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listEnvironments($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent lake: - * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * @type string $orderBy - * Optional. Order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEnvironments($parent, array $optionalArgs = []) - { - $request = new ListEnvironmentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListEnvironments', - $optionalArgs, - ListEnvironmentsResponse::class, - $request - ); - } - - /** - * Lists Jobs under the given task. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent environment: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listJobs($parent, array $optionalArgs = []) - { - $request = new ListJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListJobs', - $optionalArgs, - ListJobsResponse::class, - $request - ); - } - - /** - * Lists action resources in a lake. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listLakeActions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listLakeActions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLakeActions($parent, array $optionalArgs = []) - { - $request = new ListLakeActionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLakeActions', - $optionalArgs, - ListActionsResponse::class, - $request - ); - } - - /** - * Lists lake resources in a project and location. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listLakes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listLakes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the lake location, of the form: - * `projects/{project_number}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * @type string $orderBy - * Optional. Order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLakes($parent, array $optionalArgs = []) - { - $request = new ListLakesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLakes', - $optionalArgs, - ListLakesResponse::class, - $request - ); - } - - /** - * Lists session resources in an environment. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listSessions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listSessions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent environment: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. The following `mode` filter is supported to - * return only the sessions belonging to the requester when the mode is USER - * and return sessions of all the users when the mode is ADMIN. When no filter - * is sent default to USER mode. NOTE: When the mode is ADMIN, the requester - * should have `dataplex.environments.listAllSessions` permission to list all - * sessions, in absence of the permission, the request fails. - * - * mode = ADMIN | USER - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSessions($parent, array $optionalArgs = []) - { - $request = new ListSessionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListSessions', - $optionalArgs, - ListSessionsResponse::class, - $request - ); - } - - /** - * Lists tasks under the given lake. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listTasks($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listTasks($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * @type string $orderBy - * Optional. Order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTasks($parent, array $optionalArgs = []) - { - $request = new ListTasksRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTasks', - $optionalArgs, - ListTasksResponse::class, - $request - ); - } - - /** - * Lists action resources in a zone. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listZoneActions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listZoneActions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listZoneActions($parent, array $optionalArgs = []) - { - $request = new ListZoneActionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListZoneActions', - $optionalArgs, - ListActionsResponse::class, - $request - ); - } - - /** - * Lists zone resources in a lake. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedParent = $dataplexServiceClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listZones($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listZones($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter request. - * @type string $orderBy - * Optional. Order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listZones($parent, array $optionalArgs = []) - { - $request = new ListZonesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListZones', - $optionalArgs, - ListZonesResponse::class, - $request - ); - } - - /** - * Run an on demand execution of a Task. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $formattedName = $dataplexServiceClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - * $response = $dataplexServiceClient->runTask($formattedName); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the task: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type array $labels - * Optional. User-defined labels for the task. If the map is left empty, the - * task will run with existing labels from task definition. If the map - * contains an entry with a new key, the same will be added to existing set of - * labels. If the map contains an entry with an existing label key in task - * definition, the task will run with new label value for that entry. Clearing - * an existing label will require label value to be explicitly set to a hyphen - * "-". The label value cannot be empty. - * @type array $args - * Optional. Execution spec arguments. If the map is left empty, the task will - * run with existing execution spec args from task definition. If the map - * contains an entry with a new key, the same will be added to existing set of - * args. If the map contains an entry with an existing arg key in task - * definition, the task will run with new arg value for that entry. Clearing - * an existing arg will require arg value to be explicitly set to a hyphen - * "-". The arg value cannot be empty. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\RunTaskResponse - * - * @throws ApiException if the remote call fails - */ - public function runTask($name, array $optionalArgs = []) - { - $request = new RunTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['labels'])) { - $request->setLabels($optionalArgs['labels']); - } - - if (isset($optionalArgs['args'])) { - $request->setArgs($optionalArgs['args']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'RunTask', - RunTaskResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates an asset resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $asset = new Asset(); - * $operationResponse = $dataplexServiceClient->updateAsset($updateMask, $asset); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->updateAsset($updateMask, $asset); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'updateAsset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param Asset $asset Required. Update description. - * Only fields specified in `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateAsset($updateMask, $asset, array $optionalArgs = []) - { - $request = new UpdateAssetRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setAsset($asset); - $requestParamHeaders['asset.name'] = $asset->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateAsset', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Update the environment resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $environment = new Environment(); - * $operationResponse = $dataplexServiceClient->updateEnvironment($updateMask, $environment); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->updateEnvironment($updateMask, $environment); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'updateEnvironment'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param Environment $environment Required. Update description. - * Only fields specified in `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateEnvironment( - $updateMask, - $environment, - array $optionalArgs = [] - ) { - $request = new UpdateEnvironmentRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setEnvironment($environment); - $requestParamHeaders['environment.name'] = $environment->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateEnvironment', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a lake resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $lake = new Lake(); - * $operationResponse = $dataplexServiceClient->updateLake($updateMask, $lake); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->updateLake($updateMask, $lake); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'updateLake'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param Lake $lake Required. Update description. - * Only fields specified in `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateLake($updateMask, $lake, array $optionalArgs = []) - { - $request = new UpdateLakeRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setLake($lake); - $requestParamHeaders['lake.name'] = $lake->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateLake', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Update the task resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $task = new Task(); - * $operationResponse = $dataplexServiceClient->updateTask($updateMask, $task); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->updateTask($updateMask, $task); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'updateTask'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param Task $task Required. Update description. - * Only fields specified in `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateTask($updateMask, $task, array $optionalArgs = []) - { - $request = new UpdateTaskRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setTask($task); - $requestParamHeaders['task.name'] = $task->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateTask', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a zone resource. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $updateMask = new FieldMask(); - * $zone = new Zone(); - * $operationResponse = $dataplexServiceClient->updateZone($updateMask, $zone); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataplexServiceClient->updateZone($updateMask, $zone); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataplexServiceClient->resumeOperation($operationName, 'updateZone'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Mask of fields to update. - * @param Zone $zone Required. Update description. - * Only fields specified in `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateZone($updateMask, $zone, array $optionalArgs = []) - { - $request = new UpdateZoneRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setZone($zone); - $requestParamHeaders['zone.name'] = $zone->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateZone', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $resource = 'resource'; - * $response = $dataplexServiceClient->getIamPolicy($resource); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataplexServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataplexServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * $response = $dataplexServiceClient->getLocation(); - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataplexServiceClient = new DataplexServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataplexServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataplexServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataplexServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } -} diff --git a/Dataplex/src/V1/Gapic/MetadataServiceGapicClient.php b/Dataplex/src/V1/Gapic/MetadataServiceGapicClient.php deleted file mode 100644 index da0e79a37708..000000000000 --- a/Dataplex/src/V1/Gapic/MetadataServiceGapicClient.php +++ /dev/null @@ -1,1307 +0,0 @@ -zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - * $entity = new Entity(); - * $response = $metadataServiceClient->createEntity($formattedParent, $entity); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataplex\V1\Client\MetadataServiceClient}. - */ -class MetadataServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dataplex.v1.MetadataService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataplex.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataplex.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $entityNameTemplate; - - private static $partitionNameTemplate; - - private static $zoneNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/metadata_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/metadata_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/metadata_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/metadata_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEntityNameTemplate() - { - if (self::$entityNameTemplate == null) { - self::$entityNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}' - ); - } - - return self::$entityNameTemplate; - } - - private static function getPartitionNameTemplate() - { - if (self::$partitionNameTemplate == null) { - self::$partitionNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}/partitions/{partition}' - ); - } - - return self::$partitionNameTemplate; - } - - private static function getZoneNameTemplate() - { - if (self::$zoneNameTemplate == null) { - self::$zoneNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}' - ); - } - - return self::$zoneNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'entity' => self::getEntityNameTemplate(), - 'partition' => self::getPartitionNameTemplate(), - 'zone' => self::getZoneNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a entity - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $zone - * @param string $entity - * - * @return string The formatted entity resource. - */ - public static function entityName( - $project, - $location, - $lake, - $zone, - $entity - ) { - return self::getEntityNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'zone' => $zone, - 'entity' => $entity, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a partition - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $zone - * @param string $entity - * @param string $partition - * - * @return string The formatted partition resource. - */ - public static function partitionName( - $project, - $location, - $lake, - $zone, - $entity, - $partition - ) { - return self::getPartitionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'zone' => $zone, - 'entity' => $entity, - 'partition' => $partition, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a zone - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * @param string $zone - * - * @return string The formatted zone resource. - */ - public static function zoneName($project, $location, $lake, $zone) - { - return self::getZoneNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - 'zone' => $zone, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - entity: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity} - * - partition: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}/partitions/{partition} - * - zone: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataplex.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Create a metadata entity. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - * $entity = new Entity(); - * $response = $metadataServiceClient->createEntity($formattedParent, $entity); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. - * @param Entity $entity Required. Entity resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Entity - * - * @throws ApiException if the remote call fails - */ - public function createEntity($parent, $entity, array $optionalArgs = []) - { - $request = new CreateEntityRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntity($entity); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateEntity', - Entity::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Create a metadata partition. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - * $partition = new Partition(); - * $response = $metadataServiceClient->createPartition($formattedParent, $partition); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. - * @param Partition $partition Required. Partition resource. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Partition - * - * @throws ApiException if the remote call fails - */ - public function createPartition( - $parent, - $partition, - array $optionalArgs = [] - ) { - $request = new CreatePartitionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPartition($partition); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreatePartition', - Partition::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Delete a metadata entity. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - * $etag = 'etag'; - * $metadataServiceClient->deleteEntity($formattedName, $etag); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the entity: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. - * @param string $etag Required. The etag associated with the entity, which can be retrieved with - * a [GetEntity][] request. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteEntity($name, $etag, array $optionalArgs = []) - { - $request = new DeleteEntityRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setEtag($etag); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteEntity', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Delete a metadata partition. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - * $metadataServiceClient->deletePartition($formattedName); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the partition. - * format: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`. - * The {partition_value_path} segment consists of an ordered sequence of - * partition values separated by "/". All values must be provided. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. The etag associated with the partition. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deletePartition($name, array $optionalArgs = []) - { - $request = new DeletePartitionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeletePartition', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Get a metadata entity. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - * $response = $metadataServiceClient->getEntity($formattedName); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the entity: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}.` - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. Used to select the subset of entity information to return. - * Defaults to `BASIC`. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataplex\V1\GetEntityRequest\EntityView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Entity - * - * @throws ApiException if the remote call fails - */ - public function getEntity($name, array $optionalArgs = []) - { - $request = new GetEntityRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetEntity', - Entity::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Get a metadata partition of an entity. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedName = $metadataServiceClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - * $response = $metadataServiceClient->getPartition($formattedName); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the partition: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`. - * The {partition_value_path} segment consists of an ordered sequence of - * partition values separated by "/". All values must be provided. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Partition - * - * @throws ApiException if the remote call fails - */ - public function getPartition($name, array $optionalArgs = []) - { - $request = new GetPartitionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetPartition', - Partition::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * List metadata entities in a zone. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - * $view = EntityView::ENTITY_VIEW_UNSPECIFIED; - * // Iterate over pages of elements - * $pagedResponse = $metadataServiceClient->listEntities($formattedParent, $view); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metadataServiceClient->listEntities($formattedParent, $view); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. - * @param int $view Required. Specify the entity view to make a partial list request. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataplex\V1\ListEntitiesRequest\EntityView} - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The following filter parameters can be added to the URL to limit - * the entities returned by the API: - * - * - Entity ID: ?filter="id=entityID" - * - Asset ID: ?filter="asset=assetID" - * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter="hive_compatible=true" - * - Is BigQuery compatible: ?filter="bigquery_compatible=true" - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEntities($parent, $view, array $optionalArgs = []) - { - $request = new ListEntitiesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setView($view); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListEntities', - $optionalArgs, - ListEntitiesResponse::class, - $request - ); - } - - /** - * List metadata partitions of an entity. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $formattedParent = $metadataServiceClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - * // Iterate over pages of elements - * $pagedResponse = $metadataServiceClient->listPartitions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metadataServiceClient->listPartitions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent entity: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter the partitions returned to the caller using a key value - * pair expression. Supported operators and syntax: - * - * - logic operators: AND, OR - * - comparison operators: <, >, >=, <= ,=, != - * - LIKE operators: - * - The right hand of a LIKE operator supports "." and - * "*" for wildcard searches, for example "value1 LIKE ".*oo.*" - * - parenthetical grouping: ( ) - * - * Sample filter expression: `?filter="key1 < value1 OR key2 > value2" - * - * **Notes:** - * - * - Keys to the left of operators are case insensitive. - * - Partition results are sorted first by creation time, then by - * lexicographic order. - * - Up to 20 key value filter pairs are allowed, but due to performance - * considerations, only the first 10 will be used as a filter. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listPartitions($parent, array $optionalArgs = []) - { - $request = new ListPartitionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListPartitions', - $optionalArgs, - ListPartitionsResponse::class, - $request - ); - } - - /** - * Update a metadata entity. Only supports full resource update. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $entity = new Entity(); - * $response = $metadataServiceClient->updateEntity($entity); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param Entity $entity Required. Update description. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Only validate the request, but do not perform mutations. - * The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataplex\V1\Entity - * - * @throws ApiException if the remote call fails - */ - public function updateEntity($entity, array $optionalArgs = []) - { - $request = new UpdateEntityRequest(); - $requestParamHeaders = []; - $request->setEntity($entity); - $requestParamHeaders['entity.name'] = $entity->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateEntity', - Entity::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $resource = 'resource'; - * $response = $metadataServiceClient->getIamPolicy($resource); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $metadataServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $metadataServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * $response = $metadataServiceClient->getLocation(); - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $metadataServiceClient = new MetadataServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $metadataServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metadataServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metadataServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } -} diff --git a/Dataplex/src/V1/GenerateDataQualityRulesRequest.php b/Dataplex/src/V1/GenerateDataQualityRulesRequest.php index 49729952d38d..1d3444f890b8 100644 --- a/Dataplex/src/V1/GenerateDataQualityRulesRequest.php +++ b/Dataplex/src/V1/GenerateDataQualityRulesRequest.php @@ -23,7 +23,7 @@ class GenerateDataQualityRulesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name should be either diff --git a/Dataplex/src/V1/GetAspectTypeRequest.php b/Dataplex/src/V1/GetAspectTypeRequest.php index cd01cedde144..9a15da81e83a 100644 --- a/Dataplex/src/V1/GetAspectTypeRequest.php +++ b/Dataplex/src/V1/GetAspectTypeRequest.php @@ -21,7 +21,7 @@ class GetAspectTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the AspectType: diff --git a/Dataplex/src/V1/GetAssetRequest.php b/Dataplex/src/V1/GetAssetRequest.php index 243939efed6e..a130f8dfdf58 100644 --- a/Dataplex/src/V1/GetAssetRequest.php +++ b/Dataplex/src/V1/GetAssetRequest.php @@ -21,7 +21,7 @@ class GetAssetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the asset: diff --git a/Dataplex/src/V1/GetContentRequest.php b/Dataplex/src/V1/GetContentRequest.php index 51a9a13e3233..f22038fef6a4 100644 --- a/Dataplex/src/V1/GetContentRequest.php +++ b/Dataplex/src/V1/GetContentRequest.php @@ -21,13 +21,13 @@ class GetContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Specify content view to make a partial request. * * Generated from protobuf field .google.cloud.dataplex.v1.GetContentRequest.ContentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $name Required. The resource name of the content: diff --git a/Dataplex/src/V1/GetDataAttributeBindingRequest.php b/Dataplex/src/V1/GetDataAttributeBindingRequest.php index d70d81c88317..9da780a77c99 100644 --- a/Dataplex/src/V1/GetDataAttributeBindingRequest.php +++ b/Dataplex/src/V1/GetDataAttributeBindingRequest.php @@ -21,7 +21,7 @@ class GetDataAttributeBindingRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the DataAttributeBinding: diff --git a/Dataplex/src/V1/GetDataAttributeRequest.php b/Dataplex/src/V1/GetDataAttributeRequest.php index 3b2615420fb7..9d7f615635de 100644 --- a/Dataplex/src/V1/GetDataAttributeRequest.php +++ b/Dataplex/src/V1/GetDataAttributeRequest.php @@ -21,7 +21,7 @@ class GetDataAttributeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the dataAttribute: diff --git a/Dataplex/src/V1/GetDataScanJobRequest.php b/Dataplex/src/V1/GetDataScanJobRequest.php index 7089d0d0f793..6ae5f004f3c9 100644 --- a/Dataplex/src/V1/GetDataScanJobRequest.php +++ b/Dataplex/src/V1/GetDataScanJobRequest.php @@ -23,13 +23,13 @@ class GetDataScanJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Select the DataScanJob view to return. Defaults to `BASIC`. * * Generated from protobuf field .google.cloud.dataplex.v1.GetDataScanJobRequest.DataScanJobView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $name Required. The resource name of the DataScanJob: diff --git a/Dataplex/src/V1/GetDataScanRequest.php b/Dataplex/src/V1/GetDataScanRequest.php index f938ea71b5d7..c3c75f71a955 100644 --- a/Dataplex/src/V1/GetDataScanRequest.php +++ b/Dataplex/src/V1/GetDataScanRequest.php @@ -23,13 +23,13 @@ class GetDataScanRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Select the DataScan view to return. Defaults to `BASIC`. * * Generated from protobuf field .google.cloud.dataplex.v1.GetDataScanRequest.DataScanView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $name Required. The resource name of the dataScan: diff --git a/Dataplex/src/V1/GetDataTaxonomyRequest.php b/Dataplex/src/V1/GetDataTaxonomyRequest.php index af4e456b2b3d..08d9be6edded 100644 --- a/Dataplex/src/V1/GetDataTaxonomyRequest.php +++ b/Dataplex/src/V1/GetDataTaxonomyRequest.php @@ -21,7 +21,7 @@ class GetDataTaxonomyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the DataTaxonomy: diff --git a/Dataplex/src/V1/GetEntityRequest.php b/Dataplex/src/V1/GetEntityRequest.php index 818c3dfe61ec..ea9917eb51b9 100644 --- a/Dataplex/src/V1/GetEntityRequest.php +++ b/Dataplex/src/V1/GetEntityRequest.php @@ -21,14 +21,14 @@ class GetEntityRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Used to select the subset of entity information to return. * Defaults to `BASIC`. * * Generated from protobuf field .google.cloud.dataplex.v1.GetEntityRequest.EntityView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $name Required. The resource name of the entity: diff --git a/Dataplex/src/V1/GetEntryGroupRequest.php b/Dataplex/src/V1/GetEntryGroupRequest.php index 533ef42d55aa..282518503945 100644 --- a/Dataplex/src/V1/GetEntryGroupRequest.php +++ b/Dataplex/src/V1/GetEntryGroupRequest.php @@ -21,7 +21,7 @@ class GetEntryGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the EntryGroup: diff --git a/Dataplex/src/V1/GetEntryRequest.php b/Dataplex/src/V1/GetEntryRequest.php index d17e13150707..49581bf69832 100644 --- a/Dataplex/src/V1/GetEntryRequest.php +++ b/Dataplex/src/V1/GetEntryRequest.php @@ -19,13 +19,13 @@ class GetEntryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. View for controlling which parts of an entry are to be returned. * * Generated from protobuf field .google.cloud.dataplex.v1.EntryView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * Optional. Limits the aspects returned to the provided aspect types. * Only works if the CUSTOM view is selected. diff --git a/Dataplex/src/V1/GetEntryTypeRequest.php b/Dataplex/src/V1/GetEntryTypeRequest.php index e86292258813..93096ecfa34b 100644 --- a/Dataplex/src/V1/GetEntryTypeRequest.php +++ b/Dataplex/src/V1/GetEntryTypeRequest.php @@ -21,7 +21,7 @@ class GetEntryTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the EntryType: diff --git a/Dataplex/src/V1/GetEnvironmentRequest.php b/Dataplex/src/V1/GetEnvironmentRequest.php index b82b005e013b..ac5c5f444540 100644 --- a/Dataplex/src/V1/GetEnvironmentRequest.php +++ b/Dataplex/src/V1/GetEnvironmentRequest.php @@ -21,7 +21,7 @@ class GetEnvironmentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the environment: diff --git a/Dataplex/src/V1/GetJobRequest.php b/Dataplex/src/V1/GetJobRequest.php index 0534232ce2d0..bd2193f0bdc7 100644 --- a/Dataplex/src/V1/GetJobRequest.php +++ b/Dataplex/src/V1/GetJobRequest.php @@ -21,7 +21,7 @@ class GetJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the job: diff --git a/Dataplex/src/V1/GetLakeRequest.php b/Dataplex/src/V1/GetLakeRequest.php index dc01336e005c..0258ba185430 100644 --- a/Dataplex/src/V1/GetLakeRequest.php +++ b/Dataplex/src/V1/GetLakeRequest.php @@ -21,7 +21,7 @@ class GetLakeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the lake: diff --git a/Dataplex/src/V1/GetPartitionRequest.php b/Dataplex/src/V1/GetPartitionRequest.php index 31931dac218c..43b96cbd181b 100644 --- a/Dataplex/src/V1/GetPartitionRequest.php +++ b/Dataplex/src/V1/GetPartitionRequest.php @@ -23,7 +23,7 @@ class GetPartitionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the partition: diff --git a/Dataplex/src/V1/GetTaskRequest.php b/Dataplex/src/V1/GetTaskRequest.php index cf522d451683..47d121f37e2d 100644 --- a/Dataplex/src/V1/GetTaskRequest.php +++ b/Dataplex/src/V1/GetTaskRequest.php @@ -21,7 +21,7 @@ class GetTaskRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the task: diff --git a/Dataplex/src/V1/GetZoneRequest.php b/Dataplex/src/V1/GetZoneRequest.php index 5f284f920e4f..916e309dabbe 100644 --- a/Dataplex/src/V1/GetZoneRequest.php +++ b/Dataplex/src/V1/GetZoneRequest.php @@ -21,7 +21,7 @@ class GetZoneRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the zone: diff --git a/Dataplex/src/V1/GovernanceEvent.php b/Dataplex/src/V1/GovernanceEvent.php index c0d4f04e90c7..62efaeb04fad 100644 --- a/Dataplex/src/V1/GovernanceEvent.php +++ b/Dataplex/src/V1/GovernanceEvent.php @@ -20,20 +20,20 @@ class GovernanceEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * The type of the event. * * Generated from protobuf field .google.cloud.dataplex.v1.GovernanceEvent.EventType event_type = 2; */ - private $event_type = 0; + protected $event_type = 0; /** * Entity resource information if the log event is associated with a * specific entity. * * Generated from protobuf field optional .google.cloud.dataplex.v1.GovernanceEvent.Entity entity = 3; */ - private $entity = null; + protected $entity = null; /** * Constructor. diff --git a/Dataplex/src/V1/GovernanceEvent/Entity.php b/Dataplex/src/V1/GovernanceEvent/Entity.php index ca61a9ee4394..4cf0a075036d 100644 --- a/Dataplex/src/V1/GovernanceEvent/Entity.php +++ b/Dataplex/src/V1/GovernanceEvent/Entity.php @@ -22,13 +22,13 @@ class Entity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entity = 1 [(.google.api.resource_reference) = { */ - private $entity = ''; + protected $entity = ''; /** * Type of entity. * * Generated from protobuf field .google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType entity_type = 2; */ - private $entity_type = 0; + protected $entity_type = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Job.php b/Dataplex/src/V1/Job.php index ec043f9818e8..d01c70cc3595 100644 --- a/Dataplex/src/V1/Job.php +++ b/Dataplex/src/V1/Job.php @@ -21,57 +21,57 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the job. * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the job was started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The time when the job ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Execution state for the job. * * Generated from protobuf field .google.cloud.dataplex.v1.Job.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The number of times the job has been retried (excluding the * initial attempt). * * Generated from protobuf field uint32 retry_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $retry_count = 0; + protected $retry_count = 0; /** * Output only. The underlying service running a job. * * Generated from protobuf field .google.cloud.dataplex.v1.Job.Service service = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service = 0; + protected $service = 0; /** * Output only. The full resource name for the job run under a particular * service. * * Generated from protobuf field string service_job = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service_job = ''; + protected $service_job = ''; /** * Output only. Additional information about the current state. * * Generated from protobuf field string message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $message = ''; + protected $message = ''; /** * Output only. User-defined labels for the task. * @@ -83,13 +83,13 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Job.Trigger trigger = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $trigger = 0; + protected $trigger = 0; /** * Output only. Spec related to how a task is executed. * * Generated from protobuf field .google.cloud.dataplex.v1.Task.ExecutionSpec execution_spec = 100 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $execution_spec = null; + protected $execution_spec = null; /** * Constructor. diff --git a/Dataplex/src/V1/JobEvent.php b/Dataplex/src/V1/JobEvent.php index e5a534820295..63a1762204e0 100644 --- a/Dataplex/src/V1/JobEvent.php +++ b/Dataplex/src/V1/JobEvent.php @@ -21,61 +21,61 @@ class JobEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * The unique id identifying the job. * * Generated from protobuf field string job_id = 2; */ - private $job_id = ''; + protected $job_id = ''; /** * The time when the job started running. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; */ - private $start_time = null; + protected $start_time = null; /** * The time when the job ended running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4; */ - private $end_time = null; + protected $end_time = null; /** * The job state on completion. * * Generated from protobuf field .google.cloud.dataplex.v1.JobEvent.State state = 5; */ - private $state = 0; + protected $state = 0; /** * The number of retries. * * Generated from protobuf field int32 retries = 6; */ - private $retries = 0; + protected $retries = 0; /** * The type of the job. * * Generated from protobuf field .google.cloud.dataplex.v1.JobEvent.Type type = 7; */ - private $type = 0; + protected $type = 0; /** * The service used to execute the job. * * Generated from protobuf field .google.cloud.dataplex.v1.JobEvent.Service service = 8; */ - private $service = 0; + protected $service = 0; /** * The reference to the job within the service. * * Generated from protobuf field string service_job = 9; */ - private $service_job = ''; + protected $service_job = ''; /** * Job execution trigger. * * Generated from protobuf field .google.cloud.dataplex.v1.JobEvent.ExecutionTrigger execution_trigger = 11; */ - private $execution_trigger = 0; + protected $execution_trigger = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Lake.php b/Dataplex/src/V1/Lake.php index 5d53904b84c9..29862ba39797 100644 --- a/Dataplex/src/V1/Lake.php +++ b/Dataplex/src/V1/Lake.php @@ -28,32 +28,32 @@ class Lake extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. System generated globally unique ID for the lake. This ID will * be different if the lake is deleted and re-created with the same name. * * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the lake was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the lake was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. User-defined labels for the lake. * @@ -65,13 +65,13 @@ class Lake extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. Current state of the lake. * * Generated from protobuf field .google.cloud.dataplex.v1.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Service account associated with this lake. This service * account must be authorized to access or operate on resources managed by the @@ -79,26 +79,26 @@ class Lake extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service_account = ''; + protected $service_account = ''; /** * Optional. Settings to manage lake and Dataproc Metastore service instance * association. * * Generated from protobuf field .google.cloud.dataplex.v1.Lake.Metastore metastore = 102 [(.google.api.field_behavior) = OPTIONAL]; */ - private $metastore = null; + protected $metastore = null; /** * Output only. Aggregated status of the underlying assets of the lake. * * Generated from protobuf field .google.cloud.dataplex.v1.AssetStatus asset_status = 103 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $asset_status = null; + protected $asset_status = null; /** * Output only. Metastore status of the lake. * * Generated from protobuf field .google.cloud.dataplex.v1.Lake.MetastoreStatus metastore_status = 104 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metastore_status = null; + protected $metastore_status = null; /** * Constructor. diff --git a/Dataplex/src/V1/Lake/Metastore.php b/Dataplex/src/V1/Lake/Metastore.php index 3a3698d59016..569122b9c51b 100644 --- a/Dataplex/src/V1/Lake/Metastore.php +++ b/Dataplex/src/V1/Lake/Metastore.php @@ -23,7 +23,7 @@ class Metastore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service = ''; + protected $service = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Lake/MetastoreStatus.php b/Dataplex/src/V1/Lake/MetastoreStatus.php index 78646a9e9d6d..0b85a17b518c 100644 --- a/Dataplex/src/V1/Lake/MetastoreStatus.php +++ b/Dataplex/src/V1/Lake/MetastoreStatus.php @@ -20,25 +20,25 @@ class MetastoreStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Lake.MetastoreStatus.State state = 1; */ - private $state = 0; + protected $state = 0; /** * Additional information about the current status. * * Generated from protobuf field string message = 2; */ - private $message = ''; + protected $message = ''; /** * Last update time of the metastore status of the lake. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3; */ - private $update_time = null; + protected $update_time = null; /** * The URI of the endpoint used to access the Metastore service. * * Generated from protobuf field string endpoint = 4; */ - private $endpoint = ''; + protected $endpoint = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListActionsResponse.php b/Dataplex/src/V1/ListActionsResponse.php index f4b2844e8ce0..fe396fe3f398 100644 --- a/Dataplex/src/V1/ListActionsResponse.php +++ b/Dataplex/src/V1/ListActionsResponse.php @@ -27,7 +27,7 @@ class ListActionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListAspectTypesRequest.php b/Dataplex/src/V1/ListAspectTypesRequest.php index 19345ca8e1e6..a11659483447 100644 --- a/Dataplex/src/V1/ListAspectTypesRequest.php +++ b/Dataplex/src/V1/ListAspectTypesRequest.php @@ -22,7 +22,7 @@ class ListAspectTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of AspectTypes to return. The service may return * fewer than this value. If unspecified, at most 10 AspectTypes will be @@ -31,7 +31,7 @@ class ListAspectTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListAspectTypes` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -40,7 +40,7 @@ class ListAspectTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. Filters are case-sensitive. * The following formats are supported: @@ -51,14 +51,14 @@ class ListAspectTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields (`name` or `create_time`) for the result. * If not specified, the ordering is undefined. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the AspectType location, of the form: diff --git a/Dataplex/src/V1/ListAspectTypesResponse.php b/Dataplex/src/V1/ListAspectTypesResponse.php index e5753130df5e..c5c8db54c1b0 100644 --- a/Dataplex/src/V1/ListAspectTypesResponse.php +++ b/Dataplex/src/V1/ListAspectTypesResponse.php @@ -27,7 +27,7 @@ class ListAspectTypesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Dataplex/src/V1/ListAssetActionsRequest.php b/Dataplex/src/V1/ListAssetActionsRequest.php index 9193526cf8ea..ac5d5fa802be 100644 --- a/Dataplex/src/V1/ListAssetActionsRequest.php +++ b/Dataplex/src/V1/ListAssetActionsRequest.php @@ -21,7 +21,7 @@ class ListAssetActionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of actions to return. The service may return fewer * than this value. If unspecified, at most 10 actions will be returned. The @@ -29,7 +29,7 @@ class ListAssetActionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListAssetActions` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -38,7 +38,7 @@ class ListAssetActionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The resource name of the parent asset: diff --git a/Dataplex/src/V1/ListAssetsRequest.php b/Dataplex/src/V1/ListAssetsRequest.php index 791fc4534e37..7509ce399872 100644 --- a/Dataplex/src/V1/ListAssetsRequest.php +++ b/Dataplex/src/V1/ListAssetsRequest.php @@ -21,7 +21,7 @@ class ListAssetsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of asset to return. The service may return fewer * than this value. If unspecified, at most 10 assets will be returned. The @@ -29,7 +29,7 @@ class ListAssetsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListAssets` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters @@ -38,19 +38,19 @@ class ListAssetsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the parent zone: diff --git a/Dataplex/src/V1/ListAssetsResponse.php b/Dataplex/src/V1/ListAssetsResponse.php index 072b6685bcbe..44d12c30ab42 100644 --- a/Dataplex/src/V1/ListAssetsResponse.php +++ b/Dataplex/src/V1/ListAssetsResponse.php @@ -27,7 +27,7 @@ class ListAssetsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListContentRequest.php b/Dataplex/src/V1/ListContentRequest.php index 7cf1b9bcf9fb..df25d8b1b3b8 100644 --- a/Dataplex/src/V1/ListContentRequest.php +++ b/Dataplex/src/V1/ListContentRequest.php @@ -21,7 +21,7 @@ class ListContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of content to return. The service may return fewer * than this value. If unspecified, at most 10 content will be returned. The @@ -29,7 +29,7 @@ class ListContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListContent` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters @@ -38,7 +38,7 @@ class ListContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. Filters are case-sensitive. * The following formats are supported: @@ -50,7 +50,7 @@ class ListContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The resource name of the parent lake: diff --git a/Dataplex/src/V1/ListContentResponse.php b/Dataplex/src/V1/ListContentResponse.php index 279931aab66f..b66d35eec61d 100644 --- a/Dataplex/src/V1/ListContentResponse.php +++ b/Dataplex/src/V1/ListContentResponse.php @@ -27,7 +27,7 @@ class ListContentResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListDataAttributeBindingsRequest.php b/Dataplex/src/V1/ListDataAttributeBindingsRequest.php index 42914ae1fb15..8e0d0c433968 100644 --- a/Dataplex/src/V1/ListDataAttributeBindingsRequest.php +++ b/Dataplex/src/V1/ListDataAttributeBindingsRequest.php @@ -21,7 +21,7 @@ class ListDataAttributeBindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of DataAttributeBindings to return. The service * may return fewer than this value. If unspecified, at most 10 @@ -30,7 +30,7 @@ class ListDataAttributeBindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListDataAttributeBindings` * call. Provide this to retrieve the subsequent page. When paginating, all @@ -39,7 +39,7 @@ class ListDataAttributeBindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * Filter using resource: filter=resource:"resource-name" @@ -49,13 +49,13 @@ class ListDataAttributeBindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the Location: diff --git a/Dataplex/src/V1/ListDataAttributeBindingsResponse.php b/Dataplex/src/V1/ListDataAttributeBindingsResponse.php index 70ca51a66516..f4d75e557b7c 100644 --- a/Dataplex/src/V1/ListDataAttributeBindingsResponse.php +++ b/Dataplex/src/V1/ListDataAttributeBindingsResponse.php @@ -27,7 +27,7 @@ class ListDataAttributeBindingsResponse extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Dataplex/src/V1/ListDataAttributesRequest.php b/Dataplex/src/V1/ListDataAttributesRequest.php index 961e7284cb22..94503d7719b2 100644 --- a/Dataplex/src/V1/ListDataAttributesRequest.php +++ b/Dataplex/src/V1/ListDataAttributesRequest.php @@ -21,7 +21,7 @@ class ListDataAttributesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of DataAttributes to return. The service may * return fewer than this value. If unspecified, at most 10 dataAttributes @@ -30,7 +30,7 @@ class ListDataAttributesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListDataAttributes` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -39,19 +39,19 @@ class ListDataAttributesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the DataTaxonomy: diff --git a/Dataplex/src/V1/ListDataAttributesResponse.php b/Dataplex/src/V1/ListDataAttributesResponse.php index e8473aea337a..393dea1f5b47 100644 --- a/Dataplex/src/V1/ListDataAttributesResponse.php +++ b/Dataplex/src/V1/ListDataAttributesResponse.php @@ -27,7 +27,7 @@ class ListDataAttributesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Dataplex/src/V1/ListDataScanJobsRequest.php b/Dataplex/src/V1/ListDataScanJobsRequest.php index 131bbac0cd11..aec91a29af33 100644 --- a/Dataplex/src/V1/ListDataScanJobsRequest.php +++ b/Dataplex/src/V1/ListDataScanJobsRequest.php @@ -23,7 +23,7 @@ class ListDataScanJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of DataScanJobs to return. The service may return * fewer than this value. If unspecified, at most 10 DataScanJobs will be @@ -32,7 +32,7 @@ class ListDataScanJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListDataScanJobs` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -41,7 +41,7 @@ class ListDataScanJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. An expression for filtering the results of the ListDataScanJobs * request. @@ -58,7 +58,7 @@ class ListDataScanJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The resource name of the parent environment: diff --git a/Dataplex/src/V1/ListDataScanJobsResponse.php b/Dataplex/src/V1/ListDataScanJobsResponse.php index 856081f24040..0768d4f37321 100644 --- a/Dataplex/src/V1/ListDataScanJobsResponse.php +++ b/Dataplex/src/V1/ListDataScanJobsResponse.php @@ -27,7 +27,7 @@ class ListDataScanJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListDataScansRequest.php b/Dataplex/src/V1/ListDataScansRequest.php index 2437b3a184d2..f17be758d891 100644 --- a/Dataplex/src/V1/ListDataScansRequest.php +++ b/Dataplex/src/V1/ListDataScansRequest.php @@ -23,7 +23,7 @@ class ListDataScansRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of dataScans to return. The service may return * fewer than this value. If unspecified, at most 500 scans will be returned. @@ -31,7 +31,7 @@ class ListDataScansRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListDataScans` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters @@ -40,20 +40,20 @@ class ListDataScansRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields (`name` or `create_time`) for the result. * If not specified, the ordering is undefined. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the parent location: diff --git a/Dataplex/src/V1/ListDataScansResponse.php b/Dataplex/src/V1/ListDataScansResponse.php index 0b722f40129e..5dd91ea1531c 100644 --- a/Dataplex/src/V1/ListDataScansResponse.php +++ b/Dataplex/src/V1/ListDataScansResponse.php @@ -27,7 +27,7 @@ class ListDataScansResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Dataplex/src/V1/ListDataTaxonomiesRequest.php b/Dataplex/src/V1/ListDataTaxonomiesRequest.php index 4d0ab2fe2944..655454555997 100644 --- a/Dataplex/src/V1/ListDataTaxonomiesRequest.php +++ b/Dataplex/src/V1/ListDataTaxonomiesRequest.php @@ -22,7 +22,7 @@ class ListDataTaxonomiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of DataTaxonomies to return. The service may * return fewer than this value. If unspecified, at most 10 DataTaxonomies @@ -31,7 +31,7 @@ class ListDataTaxonomiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous ` ListDataTaxonomies` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -40,19 +40,19 @@ class ListDataTaxonomiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the DataTaxonomy location, of the form: diff --git a/Dataplex/src/V1/ListDataTaxonomiesResponse.php b/Dataplex/src/V1/ListDataTaxonomiesResponse.php index a926da769422..afec40a23ba1 100644 --- a/Dataplex/src/V1/ListDataTaxonomiesResponse.php +++ b/Dataplex/src/V1/ListDataTaxonomiesResponse.php @@ -27,7 +27,7 @@ class ListDataTaxonomiesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Dataplex/src/V1/ListEntitiesRequest.php b/Dataplex/src/V1/ListEntitiesRequest.php index 58c20227d18b..307bb3a83e46 100644 --- a/Dataplex/src/V1/ListEntitiesRequest.php +++ b/Dataplex/src/V1/ListEntitiesRequest.php @@ -21,13 +21,13 @@ class ListEntitiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Specify the entity view to make a partial list request. * * Generated from protobuf field .google.cloud.dataplex.v1.ListEntitiesRequest.EntityView view = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $view = 0; + protected $view = 0; /** * Optional. Maximum number of entities to return. The service may return * fewer than this value. If unspecified, 100 entities will be returned by @@ -36,7 +36,7 @@ class ListEntitiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListEntities` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters @@ -45,7 +45,7 @@ class ListEntitiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The following filter parameters can be added to the URL to limit * the entities returned by the API: @@ -57,7 +57,7 @@ class ListEntitiesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The resource name of the parent zone: diff --git a/Dataplex/src/V1/ListEntitiesResponse.php b/Dataplex/src/V1/ListEntitiesResponse.php index da47103372e3..a7fa7797c537 100644 --- a/Dataplex/src/V1/ListEntitiesResponse.php +++ b/Dataplex/src/V1/ListEntitiesResponse.php @@ -27,7 +27,7 @@ class ListEntitiesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListEntriesRequest.php b/Dataplex/src/V1/ListEntriesRequest.php index a6e10d77dd62..025edaca17f7 100644 --- a/Dataplex/src/V1/ListEntriesRequest.php +++ b/Dataplex/src/V1/ListEntriesRequest.php @@ -19,34 +19,36 @@ class ListEntriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. The pagination token returned by a previous request. * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. A filter on the entries to return. * Filters are case-sensitive. * The request can be filtered by the following fields: - * entry_type, display_name. + * entry_type, entry_source.display_name. * The comparison operators are =, !=, <, >, <=, >= (strings are compared * according to lexical order) * The logical operators AND, OR, NOT can be used - * in the filter. Example filter expressions: - * "display_name=AnExampleDisplayName" + * in the filter. Wildcard "*" can be used, but for entry_type the full + * project id or number needs to be provided. Example filter expressions: + * "entry_source.display_name=AnExampleDisplayName" * "entry_type=projects/example-project/locations/global/entryTypes/example-entry_type" - * "entry_type=projects/a* OR "entry_type=projects/k*" - * "NOT display_name=AnotherExampleDisplayName" + * "entry_type=projects/example-project/locations/us/entryTypes/a* OR + * entry_type=projects/another-project/locations/*" + * "NOT entry_source.display_name=AnotherExampleDisplayName" * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The resource name of the parent Entry Group: @@ -79,15 +81,17 @@ public static function build(string $parent): self * Optional. A filter on the entries to return. * Filters are case-sensitive. * The request can be filtered by the following fields: - * entry_type, display_name. + * entry_type, entry_source.display_name. * The comparison operators are =, !=, <, >, <=, >= (strings are compared * according to lexical order) * The logical operators AND, OR, NOT can be used - * in the filter. Example filter expressions: - * "display_name=AnExampleDisplayName" + * in the filter. Wildcard "*" can be used, but for entry_type the full + * project id or number needs to be provided. Example filter expressions: + * "entry_source.display_name=AnExampleDisplayName" * "entry_type=projects/example-project/locations/global/entryTypes/example-entry_type" - * "entry_type=projects/a* OR "entry_type=projects/k*" - * "NOT display_name=AnotherExampleDisplayName" + * "entry_type=projects/example-project/locations/us/entryTypes/a* OR + * entry_type=projects/another-project/locations/*" + * "NOT entry_source.display_name=AnotherExampleDisplayName" * } */ public function __construct($data = NULL) { @@ -175,15 +179,17 @@ public function setPageToken($var) * Optional. A filter on the entries to return. * Filters are case-sensitive. * The request can be filtered by the following fields: - * entry_type, display_name. + * entry_type, entry_source.display_name. * The comparison operators are =, !=, <, >, <=, >= (strings are compared * according to lexical order) * The logical operators AND, OR, NOT can be used - * in the filter. Example filter expressions: - * "display_name=AnExampleDisplayName" + * in the filter. Wildcard "*" can be used, but for entry_type the full + * project id or number needs to be provided. Example filter expressions: + * "entry_source.display_name=AnExampleDisplayName" * "entry_type=projects/example-project/locations/global/entryTypes/example-entry_type" - * "entry_type=projects/a* OR "entry_type=projects/k*" - * "NOT display_name=AnotherExampleDisplayName" + * "entry_type=projects/example-project/locations/us/entryTypes/a* OR + * entry_type=projects/another-project/locations/*" + * "NOT entry_source.display_name=AnotherExampleDisplayName" * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -197,15 +203,17 @@ public function getFilter() * Optional. A filter on the entries to return. * Filters are case-sensitive. * The request can be filtered by the following fields: - * entry_type, display_name. + * entry_type, entry_source.display_name. * The comparison operators are =, !=, <, >, <=, >= (strings are compared * according to lexical order) * The logical operators AND, OR, NOT can be used - * in the filter. Example filter expressions: - * "display_name=AnExampleDisplayName" + * in the filter. Wildcard "*" can be used, but for entry_type the full + * project id or number needs to be provided. Example filter expressions: + * "entry_source.display_name=AnExampleDisplayName" * "entry_type=projects/example-project/locations/global/entryTypes/example-entry_type" - * "entry_type=projects/a* OR "entry_type=projects/k*" - * "NOT display_name=AnotherExampleDisplayName" + * "entry_type=projects/example-project/locations/us/entryTypes/a* OR + * entry_type=projects/another-project/locations/*" + * "NOT entry_source.display_name=AnotherExampleDisplayName" * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Dataplex/src/V1/ListEntriesResponse.php b/Dataplex/src/V1/ListEntriesResponse.php index 53dfecef1601..0c6c72207eb5 100644 --- a/Dataplex/src/V1/ListEntriesResponse.php +++ b/Dataplex/src/V1/ListEntriesResponse.php @@ -24,7 +24,7 @@ class ListEntriesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListEntryGroupsRequest.php b/Dataplex/src/V1/ListEntryGroupsRequest.php index 45195472e8e2..6df7e43a8757 100644 --- a/Dataplex/src/V1/ListEntryGroupsRequest.php +++ b/Dataplex/src/V1/ListEntryGroupsRequest.php @@ -22,7 +22,7 @@ class ListEntryGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of EntryGroups to return. The service may return * fewer than this value. If unspecified, at most 10 EntryGroups will be @@ -31,7 +31,7 @@ class ListEntryGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListEntryGroups` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -40,19 +40,19 @@ class ListEntryGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the entryGroup location, of the form: diff --git a/Dataplex/src/V1/ListEntryGroupsResponse.php b/Dataplex/src/V1/ListEntryGroupsResponse.php index ada4bc4e9207..fc870fdfad86 100644 --- a/Dataplex/src/V1/ListEntryGroupsResponse.php +++ b/Dataplex/src/V1/ListEntryGroupsResponse.php @@ -27,7 +27,7 @@ class ListEntryGroupsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Dataplex/src/V1/ListEntryTypesRequest.php b/Dataplex/src/V1/ListEntryTypesRequest.php index 556b207b19d6..17dea956eb5f 100644 --- a/Dataplex/src/V1/ListEntryTypesRequest.php +++ b/Dataplex/src/V1/ListEntryTypesRequest.php @@ -22,7 +22,7 @@ class ListEntryTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of EntryTypes to return. The service may return * fewer than this value. If unspecified, at most 10 EntryTypes will be @@ -31,7 +31,7 @@ class ListEntryTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListEntryTypes` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -40,7 +40,7 @@ class ListEntryTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. Filters are case-sensitive. * The following formats are supported: @@ -51,14 +51,14 @@ class ListEntryTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields (`name` or `create_time`) for the result. * If not specified, the ordering is undefined. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the EntryType location, of the form: diff --git a/Dataplex/src/V1/ListEntryTypesResponse.php b/Dataplex/src/V1/ListEntryTypesResponse.php index 67d748fecd34..eb0289be361a 100644 --- a/Dataplex/src/V1/ListEntryTypesResponse.php +++ b/Dataplex/src/V1/ListEntryTypesResponse.php @@ -27,7 +27,7 @@ class ListEntryTypesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Dataplex/src/V1/ListEnvironmentsRequest.php b/Dataplex/src/V1/ListEnvironmentsRequest.php index 0393ee1890c6..cee8197a07b9 100644 --- a/Dataplex/src/V1/ListEnvironmentsRequest.php +++ b/Dataplex/src/V1/ListEnvironmentsRequest.php @@ -21,7 +21,7 @@ class ListEnvironmentsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of environments to return. The service may return * fewer than this value. If unspecified, at most 10 environments will be @@ -30,7 +30,7 @@ class ListEnvironmentsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListEnvironments` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -39,19 +39,19 @@ class ListEnvironmentsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the parent lake: diff --git a/Dataplex/src/V1/ListEnvironmentsResponse.php b/Dataplex/src/V1/ListEnvironmentsResponse.php index f54cdac977d6..ffc31f6b154e 100644 --- a/Dataplex/src/V1/ListEnvironmentsResponse.php +++ b/Dataplex/src/V1/ListEnvironmentsResponse.php @@ -27,7 +27,7 @@ class ListEnvironmentsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListJobsRequest.php b/Dataplex/src/V1/ListJobsRequest.php index 85827747f431..0e4b9990461a 100644 --- a/Dataplex/src/V1/ListJobsRequest.php +++ b/Dataplex/src/V1/ListJobsRequest.php @@ -21,7 +21,7 @@ class ListJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of jobs to return. The service may return fewer * than this value. If unspecified, at most 10 jobs will be returned. The @@ -29,7 +29,7 @@ class ListJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListJobs` call. Provide this * to retrieve the subsequent page. When paginating, all other parameters @@ -38,7 +38,7 @@ class ListJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The resource name of the parent environment: diff --git a/Dataplex/src/V1/ListJobsResponse.php b/Dataplex/src/V1/ListJobsResponse.php index 4fa90941aa34..30ca6bba5fe7 100644 --- a/Dataplex/src/V1/ListJobsResponse.php +++ b/Dataplex/src/V1/ListJobsResponse.php @@ -27,7 +27,7 @@ class ListJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListLakeActionsRequest.php b/Dataplex/src/V1/ListLakeActionsRequest.php index 2af735e922f4..d73c320fe476 100644 --- a/Dataplex/src/V1/ListLakeActionsRequest.php +++ b/Dataplex/src/V1/ListLakeActionsRequest.php @@ -21,7 +21,7 @@ class ListLakeActionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of actions to return. The service may return fewer * than this value. If unspecified, at most 10 actions will be returned. The @@ -29,7 +29,7 @@ class ListLakeActionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListLakeActions` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -38,7 +38,7 @@ class ListLakeActionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The resource name of the parent lake: diff --git a/Dataplex/src/V1/ListLakesRequest.php b/Dataplex/src/V1/ListLakesRequest.php index 9a228675eb6d..0e9ac3478e75 100644 --- a/Dataplex/src/V1/ListLakesRequest.php +++ b/Dataplex/src/V1/ListLakesRequest.php @@ -22,7 +22,7 @@ class ListLakesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of Lakes to return. The service may return fewer * than this value. If unspecified, at most 10 lakes will be returned. The @@ -30,7 +30,7 @@ class ListLakesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListLakes` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters @@ -38,19 +38,19 @@ class ListLakesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the lake location, of the form: diff --git a/Dataplex/src/V1/ListLakesResponse.php b/Dataplex/src/V1/ListLakesResponse.php index 194f0fde8a82..8cd74bcf1dc4 100644 --- a/Dataplex/src/V1/ListLakesResponse.php +++ b/Dataplex/src/V1/ListLakesResponse.php @@ -27,7 +27,7 @@ class ListLakesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Dataplex/src/V1/ListPartitionsRequest.php b/Dataplex/src/V1/ListPartitionsRequest.php index edeb6283fd54..4c40edf47281 100644 --- a/Dataplex/src/V1/ListPartitionsRequest.php +++ b/Dataplex/src/V1/ListPartitionsRequest.php @@ -21,7 +21,7 @@ class ListPartitionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of partitions to return. The service may return * fewer than this value. If unspecified, 100 partitions will be returned by @@ -30,7 +30,7 @@ class ListPartitionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListPartitions` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -39,7 +39,7 @@ class ListPartitionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter the partitions returned to the caller using a key value * pair expression. Supported operators and syntax: @@ -59,7 +59,7 @@ class ListPartitionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The resource name of the parent entity: diff --git a/Dataplex/src/V1/ListPartitionsResponse.php b/Dataplex/src/V1/ListPartitionsResponse.php index 3437cf0991f9..06a68cc7020c 100644 --- a/Dataplex/src/V1/ListPartitionsResponse.php +++ b/Dataplex/src/V1/ListPartitionsResponse.php @@ -27,7 +27,7 @@ class ListPartitionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListSessionsRequest.php b/Dataplex/src/V1/ListSessionsRequest.php index 659427f6ad5d..be94f5019e56 100644 --- a/Dataplex/src/V1/ListSessionsRequest.php +++ b/Dataplex/src/V1/ListSessionsRequest.php @@ -21,7 +21,7 @@ class ListSessionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of sessions to return. The service may return * fewer than this value. If unspecified, at most 10 sessions will be @@ -30,7 +30,7 @@ class ListSessionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListSessions` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters @@ -39,7 +39,7 @@ class ListSessionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. The following `mode` filter is supported to * return only the sessions belonging to the requester when the mode is USER @@ -51,7 +51,7 @@ class ListSessionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The resource name of the parent environment: diff --git a/Dataplex/src/V1/ListSessionsResponse.php b/Dataplex/src/V1/ListSessionsResponse.php index f6da66353436..2563a5529f20 100644 --- a/Dataplex/src/V1/ListSessionsResponse.php +++ b/Dataplex/src/V1/ListSessionsResponse.php @@ -27,7 +27,7 @@ class ListSessionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/ListTasksRequest.php b/Dataplex/src/V1/ListTasksRequest.php index b04532928546..cf55741d71e1 100644 --- a/Dataplex/src/V1/ListTasksRequest.php +++ b/Dataplex/src/V1/ListTasksRequest.php @@ -21,7 +21,7 @@ class ListTasksRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of tasks to return. The service may return fewer * than this value. If unspecified, at most 10 tasks will be returned. The @@ -29,7 +29,7 @@ class ListTasksRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListZones` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters @@ -37,19 +37,19 @@ class ListTasksRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the parent lake: diff --git a/Dataplex/src/V1/ListTasksResponse.php b/Dataplex/src/V1/ListTasksResponse.php index 0154bab140f4..1adb1c8897d6 100644 --- a/Dataplex/src/V1/ListTasksResponse.php +++ b/Dataplex/src/V1/ListTasksResponse.php @@ -27,7 +27,7 @@ class ListTasksResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Dataplex/src/V1/ListZoneActionsRequest.php b/Dataplex/src/V1/ListZoneActionsRequest.php index 649f77b606ce..5a9b823e9b99 100644 --- a/Dataplex/src/V1/ListZoneActionsRequest.php +++ b/Dataplex/src/V1/ListZoneActionsRequest.php @@ -21,7 +21,7 @@ class ListZoneActionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of actions to return. The service may return fewer * than this value. If unspecified, at most 10 actions will be returned. The @@ -29,7 +29,7 @@ class ListZoneActionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListZoneActions` call. * Provide this to retrieve the subsequent page. When paginating, all other @@ -38,7 +38,7 @@ class ListZoneActionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The resource name of the parent zone: diff --git a/Dataplex/src/V1/ListZonesRequest.php b/Dataplex/src/V1/ListZonesRequest.php index 3a08a6f50df3..7357a9f6e6c2 100644 --- a/Dataplex/src/V1/ListZonesRequest.php +++ b/Dataplex/src/V1/ListZonesRequest.php @@ -21,7 +21,7 @@ class ListZonesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of zones to return. The service may return fewer * than this value. If unspecified, at most 10 zones will be returned. The @@ -29,7 +29,7 @@ class ListZonesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListZones` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters @@ -37,19 +37,19 @@ class ListZonesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The resource name of the parent lake: diff --git a/Dataplex/src/V1/ListZonesResponse.php b/Dataplex/src/V1/ListZonesResponse.php index 41fdc22df075..93963cfdc21b 100644 --- a/Dataplex/src/V1/ListZonesResponse.php +++ b/Dataplex/src/V1/ListZonesResponse.php @@ -27,7 +27,7 @@ class ListZonesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataplex/src/V1/LookupEntryRequest.php b/Dataplex/src/V1/LookupEntryRequest.php index 7b091a5c1e93..c472298bbafb 100644 --- a/Dataplex/src/V1/LookupEntryRequest.php +++ b/Dataplex/src/V1/LookupEntryRequest.php @@ -19,13 +19,13 @@ class LookupEntryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. View for controlling which parts of an entry are to be returned. * * Generated from protobuf field .google.cloud.dataplex.v1.EntryView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * Optional. Limits the aspects returned to the provided aspect types. * Only works if the CUSTOM view is selected. @@ -46,7 +46,7 @@ class LookupEntryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entry = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $entry = ''; + protected $entry = ''; /** * Constructor. diff --git a/Dataplex/src/V1/MetadataServiceClient.php b/Dataplex/src/V1/MetadataServiceClient.php deleted file mode 100644 index b0199592a24f..000000000000 --- a/Dataplex/src/V1/MetadataServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.dataplex.v1.MetadataService/CreateEntity', - $argument, - ['\Google\Cloud\Dataplex\V1\Entity', 'decode'], - $metadata, $options); - } - - /** - * Update a metadata entity. Only supports full resource update. - * @param \Google\Cloud\Dataplex\V1\UpdateEntityRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateEntity(\Google\Cloud\Dataplex\V1\UpdateEntityRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.MetadataService/UpdateEntity', - $argument, - ['\Google\Cloud\Dataplex\V1\Entity', 'decode'], - $metadata, $options); - } - - /** - * Delete a metadata entity. - * @param \Google\Cloud\Dataplex\V1\DeleteEntityRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteEntity(\Google\Cloud\Dataplex\V1\DeleteEntityRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.MetadataService/DeleteEntity', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Get a metadata entity. - * @param \Google\Cloud\Dataplex\V1\GetEntityRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetEntity(\Google\Cloud\Dataplex\V1\GetEntityRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.MetadataService/GetEntity', - $argument, - ['\Google\Cloud\Dataplex\V1\Entity', 'decode'], - $metadata, $options); - } - - /** - * List metadata entities in a zone. - * @param \Google\Cloud\Dataplex\V1\ListEntitiesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListEntities(\Google\Cloud\Dataplex\V1\ListEntitiesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.MetadataService/ListEntities', - $argument, - ['\Google\Cloud\Dataplex\V1\ListEntitiesResponse', 'decode'], - $metadata, $options); - } - - /** - * Create a metadata partition. - * @param \Google\Cloud\Dataplex\V1\CreatePartitionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreatePartition(\Google\Cloud\Dataplex\V1\CreatePartitionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.MetadataService/CreatePartition', - $argument, - ['\Google\Cloud\Dataplex\V1\Partition', 'decode'], - $metadata, $options); - } - - /** - * Delete a metadata partition. - * @param \Google\Cloud\Dataplex\V1\DeletePartitionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeletePartition(\Google\Cloud\Dataplex\V1\DeletePartitionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.MetadataService/DeletePartition', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Get a metadata partition of an entity. - * @param \Google\Cloud\Dataplex\V1\GetPartitionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetPartition(\Google\Cloud\Dataplex\V1\GetPartitionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.MetadataService/GetPartition', - $argument, - ['\Google\Cloud\Dataplex\V1\Partition', 'decode'], - $metadata, $options); - } - - /** - * List metadata partitions of an entity. - * @param \Google\Cloud\Dataplex\V1\ListPartitionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPartitions(\Google\Cloud\Dataplex\V1\ListPartitionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.dataplex.v1.MetadataService/ListPartitions', - $argument, - ['\Google\Cloud\Dataplex\V1\ListPartitionsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataplex/src/V1/OperationMetadata.php b/Dataplex/src/V1/OperationMetadata.php index d74556e75389..a324fa95f4c8 100644 --- a/Dataplex/src/V1/OperationMetadata.php +++ b/Dataplex/src/V1/OperationMetadata.php @@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $status_message = ''; + protected $status_message = ''; /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -54,13 +54,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Partition.php b/Dataplex/src/V1/Partition.php index faa0c3bea140..57cd119f1bb7 100644 --- a/Dataplex/src/V1/Partition.php +++ b/Dataplex/src/V1/Partition.php @@ -24,7 +24,7 @@ class Partition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. Immutable. The set of values representing the partition, which * correspond to the partition schema defined in the parent entity. @@ -39,7 +39,7 @@ class Partition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $location = ''; + protected $location = ''; /** * Optional. The etag for this partition. * diff --git a/Dataplex/src/V1/RunDataScanRequest.php b/Dataplex/src/V1/RunDataScanRequest.php index 39b96cdc168e..1b01b86683b5 100644 --- a/Dataplex/src/V1/RunDataScanRequest.php +++ b/Dataplex/src/V1/RunDataScanRequest.php @@ -24,7 +24,7 @@ class RunDataScanRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the DataScan: diff --git a/Dataplex/src/V1/RunDataScanResponse.php b/Dataplex/src/V1/RunDataScanResponse.php index d84ef82b5f22..5bdc7ae1f097 100644 --- a/Dataplex/src/V1/RunDataScanResponse.php +++ b/Dataplex/src/V1/RunDataScanResponse.php @@ -20,7 +20,7 @@ class RunDataScanResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataScanJob job = 1; */ - private $job = null; + protected $job = null; /** * Constructor. diff --git a/Dataplex/src/V1/RunTaskRequest.php b/Dataplex/src/V1/RunTaskRequest.php index 4626c54fdec7..ce2348d52af6 100644 --- a/Dataplex/src/V1/RunTaskRequest.php +++ b/Dataplex/src/V1/RunTaskRequest.php @@ -19,7 +19,7 @@ class RunTaskRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. User-defined labels for the task. If the map is left empty, the * task will run with existing labels from task definition. If the map diff --git a/Dataplex/src/V1/RunTaskResponse.php b/Dataplex/src/V1/RunTaskResponse.php index ced15d5d8a8d..c13e5017fcc3 100644 --- a/Dataplex/src/V1/RunTaskResponse.php +++ b/Dataplex/src/V1/RunTaskResponse.php @@ -18,7 +18,7 @@ class RunTaskResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Job job = 1; */ - private $job = null; + protected $job = null; /** * Constructor. diff --git a/Dataplex/src/V1/ScannedData/IncrementalField.php b/Dataplex/src/V1/ScannedData/IncrementalField.php index 6f2576263242..e5a4909c0a4a 100644 --- a/Dataplex/src/V1/ScannedData/IncrementalField.php +++ b/Dataplex/src/V1/ScannedData/IncrementalField.php @@ -21,19 +21,19 @@ class IncrementalField extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string field = 1; */ - private $field = ''; + protected $field = ''; /** * Value that marks the start of the range. * * Generated from protobuf field string start = 2; */ - private $start = ''; + protected $start = ''; /** * Value that marks the end of the range. * * Generated from protobuf field string end = 3; */ - private $end = ''; + protected $end = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Schema.php b/Dataplex/src/V1/Schema.php index ce6e5cc211ff..40081aed1552 100644 --- a/Dataplex/src/V1/Schema.php +++ b/Dataplex/src/V1/Schema.php @@ -30,7 +30,7 @@ class Schema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool user_managed = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $user_managed = false; + protected $user_managed = false; /** * Optional. The sequence of fields describing data in table entities. * **Note:** BigQuery SchemaFields are immutable. @@ -51,7 +51,7 @@ class Schema extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Schema.PartitionStyle partition_style = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $partition_style = 0; + protected $partition_style = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Schema/PartitionField.php b/Dataplex/src/V1/Schema/PartitionField.php index 30605a2a8ef5..8045fbaa5315 100644 --- a/Dataplex/src/V1/Schema/PartitionField.php +++ b/Dataplex/src/V1/Schema/PartitionField.php @@ -25,13 +25,13 @@ class PartitionField extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. Immutable. The type of field. * * Generated from protobuf field .google.cloud.dataplex.v1.Schema.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Schema/SchemaField.php b/Dataplex/src/V1/Schema/SchemaField.php index 219c077e914e..83c464d5d61a 100644 --- a/Dataplex/src/V1/Schema/SchemaField.php +++ b/Dataplex/src/V1/Schema/SchemaField.php @@ -22,26 +22,26 @@ class SchemaField extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. User friendly field description. Must be less than or equal to * 1024 characters. * * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Required. The type of field. * * Generated from protobuf field .google.cloud.dataplex.v1.Schema.Type type = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $type = 0; + protected $type = 0; /** * Required. Additional field semantics. * * Generated from protobuf field .google.cloud.dataplex.v1.Schema.Mode mode = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $mode = 0; + protected $mode = 0; /** * Optional. Any nested field for complex types. * diff --git a/Dataplex/src/V1/SearchEntriesRequest.php b/Dataplex/src/V1/SearchEntriesRequest.php index 71acd59dd1e3..fc19ada6019b 100644 --- a/Dataplex/src/V1/SearchEntriesRequest.php +++ b/Dataplex/src/V1/SearchEntriesRequest.php @@ -19,29 +19,29 @@ class SearchEntriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The query against which entries in scope should be matched. * * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $query = ''; + protected $query = ''; /** * Optional. Pagination. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Ordering of the results. Supported options to be added later. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * Optional. The scope under which the search should be operating. Should * either be organizations/ or projects/. If left @@ -50,7 +50,7 @@ class SearchEntriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string scope = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $scope = ''; + protected $scope = ''; /** * @param string $name Required. The project to which the request should be attributed in the diff --git a/Dataplex/src/V1/SearchEntriesResponse.php b/Dataplex/src/V1/SearchEntriesResponse.php index d35eed831a78..6c428f353aaa 100644 --- a/Dataplex/src/V1/SearchEntriesResponse.php +++ b/Dataplex/src/V1/SearchEntriesResponse.php @@ -25,13 +25,13 @@ class SearchEntriesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 total_size = 2; */ - private $total_size = 0; + protected $total_size = 0; /** * Pagination token. * * Generated from protobuf field string next_page_token = 3; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Unreachable locations. Search results don't include data from those * locations. diff --git a/Dataplex/src/V1/SearchEntriesResult.php b/Dataplex/src/V1/SearchEntriesResult.php index cb03bb6f617e..2466072d3f0a 100644 --- a/Dataplex/src/V1/SearchEntriesResult.php +++ b/Dataplex/src/V1/SearchEntriesResult.php @@ -15,73 +15,24 @@ */ class SearchEntriesResult extends \Google\Protobuf\Internal\Message { - /** - * Resource name of the entry. - * - * Generated from protobuf field string entry = 1 [deprecated = true]; - * @deprecated - */ - protected $entry = ''; - /** - * Display name. - * - * Generated from protobuf field string display_name = 2 [deprecated = true]; - * @deprecated - */ - protected $display_name = ''; - /** - * The entry type. - * - * Generated from protobuf field string entry_type = 3 [deprecated = true]; - * @deprecated - */ - protected $entry_type = ''; - /** - * The last modification timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp modify_time = 4 [deprecated = true]; - * @deprecated - */ - protected $modify_time = null; - /** - * Fully qualified name. - * - * Generated from protobuf field string fully_qualified_name = 5 [deprecated = true]; - * @deprecated - */ - protected $fully_qualified_name = ''; - /** - * Entry description. - * - * Generated from protobuf field string description = 6 [deprecated = true]; - * @deprecated - */ - protected $description = ''; - /** - * Relative resource name. - * - * Generated from protobuf field string relative_resource = 7 [deprecated = true]; - * @deprecated - */ - protected $relative_resource = ''; /** * Linked resource name. * * Generated from protobuf field string linked_resource = 8; */ - private $linked_resource = ''; + protected $linked_resource = ''; /** * Entry format of the result. * * Generated from protobuf field .google.cloud.dataplex.v1.Entry dataplex_entry = 9; */ - private $dataplex_entry = null; + protected $dataplex_entry = null; /** * Snippets. * * Generated from protobuf field .google.cloud.dataplex.v1.SearchEntriesResult.Snippets snippets = 12; */ - private $snippets = null; + protected $snippets = null; /** * Constructor. @@ -89,20 +40,6 @@ class SearchEntriesResult extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type string $entry - * Resource name of the entry. - * @type string $display_name - * Display name. - * @type string $entry_type - * The entry type. - * @type \Google\Protobuf\Timestamp $modify_time - * The last modification timestamp. - * @type string $fully_qualified_name - * Fully qualified name. - * @type string $description - * Entry description. - * @type string $relative_resource - * Relative resource name. * @type string $linked_resource * Linked resource name. * @type \Google\Cloud\Dataplex\V1\Entry $dataplex_entry @@ -116,228 +53,6 @@ public function __construct($data = NULL) { parent::__construct($data); } - /** - * Resource name of the entry. - * - * Generated from protobuf field string entry = 1 [deprecated = true]; - * @return string - * @deprecated - */ - public function getEntry() - { - @trigger_error('entry is deprecated.', E_USER_DEPRECATED); - return $this->entry; - } - - /** - * Resource name of the entry. - * - * Generated from protobuf field string entry = 1 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setEntry($var) - { - @trigger_error('entry is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->entry = $var; - - return $this; - } - - /** - * Display name. - * - * Generated from protobuf field string display_name = 2 [deprecated = true]; - * @return string - * @deprecated - */ - public function getDisplayName() - { - @trigger_error('display_name is deprecated.', E_USER_DEPRECATED); - return $this->display_name; - } - - /** - * Display name. - * - * Generated from protobuf field string display_name = 2 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setDisplayName($var) - { - @trigger_error('display_name is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The entry type. - * - * Generated from protobuf field string entry_type = 3 [deprecated = true]; - * @return string - * @deprecated - */ - public function getEntryType() - { - @trigger_error('entry_type is deprecated.', E_USER_DEPRECATED); - return $this->entry_type; - } - - /** - * The entry type. - * - * Generated from protobuf field string entry_type = 3 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setEntryType($var) - { - @trigger_error('entry_type is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->entry_type = $var; - - return $this; - } - - /** - * The last modification timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp modify_time = 4 [deprecated = true]; - * @return \Google\Protobuf\Timestamp|null - * @deprecated - */ - public function getModifyTime() - { - @trigger_error('modify_time is deprecated.', E_USER_DEPRECATED); - return $this->modify_time; - } - - public function hasModifyTime() - { - @trigger_error('modify_time is deprecated.', E_USER_DEPRECATED); - return isset($this->modify_time); - } - - public function clearModifyTime() - { - @trigger_error('modify_time is deprecated.', E_USER_DEPRECATED); - unset($this->modify_time); - } - - /** - * The last modification timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp modify_time = 4 [deprecated = true]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - * @deprecated - */ - public function setModifyTime($var) - { - @trigger_error('modify_time is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->modify_time = $var; - - return $this; - } - - /** - * Fully qualified name. - * - * Generated from protobuf field string fully_qualified_name = 5 [deprecated = true]; - * @return string - * @deprecated - */ - public function getFullyQualifiedName() - { - @trigger_error('fully_qualified_name is deprecated.', E_USER_DEPRECATED); - return $this->fully_qualified_name; - } - - /** - * Fully qualified name. - * - * Generated from protobuf field string fully_qualified_name = 5 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setFullyQualifiedName($var) - { - @trigger_error('fully_qualified_name is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->fully_qualified_name = $var; - - return $this; - } - - /** - * Entry description. - * - * Generated from protobuf field string description = 6 [deprecated = true]; - * @return string - * @deprecated - */ - public function getDescription() - { - @trigger_error('description is deprecated.', E_USER_DEPRECATED); - return $this->description; - } - - /** - * Entry description. - * - * Generated from protobuf field string description = 6 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setDescription($var) - { - @trigger_error('description is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Relative resource name. - * - * Generated from protobuf field string relative_resource = 7 [deprecated = true]; - * @return string - * @deprecated - */ - public function getRelativeResource() - { - @trigger_error('relative_resource is deprecated.', E_USER_DEPRECATED); - return $this->relative_resource; - } - - /** - * Relative resource name. - * - * Generated from protobuf field string relative_resource = 7 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setRelativeResource($var) - { - @trigger_error('relative_resource is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->relative_resource = $var; - - return $this; - } - /** * Linked resource name. * diff --git a/Dataplex/src/V1/SearchEntriesResult/Snippets.php b/Dataplex/src/V1/SearchEntriesResult/Snippets.php index 7458cb4662ab..ead8618f3fa1 100644 --- a/Dataplex/src/V1/SearchEntriesResult/Snippets.php +++ b/Dataplex/src/V1/SearchEntriesResult/Snippets.php @@ -21,7 +21,7 @@ class Snippets extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Entry dataplex_entry = 1; */ - private $dataplex_entry = null; + protected $dataplex_entry = null; /** * Constructor. diff --git a/Dataplex/src/V1/Session.php b/Dataplex/src/V1/Session.php index c1bb4e56cd07..e97bb288861b 100644 --- a/Dataplex/src/V1/Session.php +++ b/Dataplex/src/V1/Session.php @@ -21,25 +21,25 @@ class Session extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. Email of user running the session. * * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $user_id = ''; + protected $user_id = ''; /** * Output only. Session start time. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. State of Session * * Generated from protobuf field .google.cloud.dataplex.v1.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Constructor. diff --git a/Dataplex/src/V1/SessionEvent.php b/Dataplex/src/V1/SessionEvent.php index d6d9acc1d001..7caa11fbef96 100644 --- a/Dataplex/src/V1/SessionEvent.php +++ b/Dataplex/src/V1/SessionEvent.php @@ -21,45 +21,45 @@ class SessionEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * The information about the user that created the session. It will be the * email address of the user. * * Generated from protobuf field string user_id = 2; */ - private $user_id = ''; + protected $user_id = ''; /** * Unique identifier for the session. * * Generated from protobuf field string session_id = 3; */ - private $session_id = ''; + protected $session_id = ''; /** * The type of the event. * * Generated from protobuf field .google.cloud.dataplex.v1.SessionEvent.EventType type = 4; */ - private $type = 0; + protected $type = 0; /** * The status of the event. * * Generated from protobuf field bool event_succeeded = 6; */ - private $event_succeeded = false; + protected $event_succeeded = false; /** * If the session is associated with an environment with fast startup enabled, * and was created before being assigned to a user. * * Generated from protobuf field bool fast_startup_enabled = 7; */ - private $fast_startup_enabled = false; + protected $fast_startup_enabled = false; /** * The idle duration of a warm pooled session before it is assigned to user. * * Generated from protobuf field .google.protobuf.Duration unassigned_duration = 8; */ - private $unassigned_duration = null; + protected $unassigned_duration = null; protected $detail; /** diff --git a/Dataplex/src/V1/SessionEvent/QueryDetail.php b/Dataplex/src/V1/SessionEvent/QueryDetail.php index be129d8589ca..078cbd8fbfbb 100644 --- a/Dataplex/src/V1/SessionEvent/QueryDetail.php +++ b/Dataplex/src/V1/SessionEvent/QueryDetail.php @@ -20,37 +20,37 @@ class QueryDetail extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string query_id = 1; */ - private $query_id = ''; + protected $query_id = ''; /** * The query text executed. * * Generated from protobuf field string query_text = 2; */ - private $query_text = ''; + protected $query_text = ''; /** * Query Execution engine. * * Generated from protobuf field .google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine engine = 3; */ - private $engine = 0; + protected $engine = 0; /** * Time taken for execution of the query. * * Generated from protobuf field .google.protobuf.Duration duration = 4; */ - private $duration = null; + protected $duration = null; /** * The size of results the query produced. * * Generated from protobuf field int64 result_size_bytes = 5; */ - private $result_size_bytes = 0; + protected $result_size_bytes = 0; /** * The data processed by the query. * * Generated from protobuf field int64 data_processed_bytes = 6; */ - private $data_processed_bytes = 0; + protected $data_processed_bytes = 0; /** * Constructor. diff --git a/Dataplex/src/V1/StorageAccess.php b/Dataplex/src/V1/StorageAccess.php index dbb441785ac2..45665e6e1936 100644 --- a/Dataplex/src/V1/StorageAccess.php +++ b/Dataplex/src/V1/StorageAccess.php @@ -21,7 +21,7 @@ class StorageAccess extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.StorageAccess.AccessMode read = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $read = 0; + protected $read = 0; /** * Constructor. diff --git a/Dataplex/src/V1/StorageFormat.php b/Dataplex/src/V1/StorageFormat.php index 5b961bdf883d..8b8964f3d7a6 100644 --- a/Dataplex/src/V1/StorageFormat.php +++ b/Dataplex/src/V1/StorageFormat.php @@ -21,14 +21,14 @@ class StorageFormat extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.StorageFormat.Format format = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $format = 0; + protected $format = 0; /** * Optional. The compression type associated with the stored data. * If unspecified, the data is uncompressed. * * Generated from protobuf field .google.cloud.dataplex.v1.StorageFormat.CompressionFormat compression_format = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $compression_format = 0; + protected $compression_format = 0; /** * Required. The mime type descriptor for the data. Must match the pattern * {type}/{subtype}. Supported values: @@ -49,7 +49,7 @@ class StorageFormat extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string mime_type = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $mime_type = ''; + protected $mime_type = ''; protected $options; /** diff --git a/Dataplex/src/V1/StorageFormat/CsvOptions.php b/Dataplex/src/V1/StorageFormat/CsvOptions.php index ade7b10569a9..669d4d77248b 100644 --- a/Dataplex/src/V1/StorageFormat/CsvOptions.php +++ b/Dataplex/src/V1/StorageFormat/CsvOptions.php @@ -21,20 +21,20 @@ class CsvOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string encoding = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $encoding = ''; + protected $encoding = ''; /** * Optional. The number of rows to interpret as header rows that should be * skipped when reading data rows. Defaults to 0. * * Generated from protobuf field int32 header_rows = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $header_rows = 0; + protected $header_rows = 0; /** * Optional. The delimiter used to separate values. Defaults to ','. * * Generated from protobuf field string delimiter = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $delimiter = ''; + protected $delimiter = ''; /** * Optional. The character used to quote column values. Accepts '"' * (double quotation mark) or ''' (single quotation mark). Defaults to @@ -42,7 +42,7 @@ class CsvOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $quote = ''; + protected $quote = ''; /** * Constructor. diff --git a/Dataplex/src/V1/StorageFormat/IcebergOptions.php b/Dataplex/src/V1/StorageFormat/IcebergOptions.php index 4c2d1e58a2c1..df58ed5f7adf 100644 --- a/Dataplex/src/V1/StorageFormat/IcebergOptions.php +++ b/Dataplex/src/V1/StorageFormat/IcebergOptions.php @@ -21,7 +21,7 @@ class IcebergOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_location = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $metadata_location = ''; + protected $metadata_location = ''; /** * Constructor. diff --git a/Dataplex/src/V1/StorageFormat/JsonOptions.php b/Dataplex/src/V1/StorageFormat/JsonOptions.php index 1ae403af7efb..873a8bfcba90 100644 --- a/Dataplex/src/V1/StorageFormat/JsonOptions.php +++ b/Dataplex/src/V1/StorageFormat/JsonOptions.php @@ -21,7 +21,7 @@ class JsonOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string encoding = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $encoding = ''; + protected $encoding = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Task.php b/Dataplex/src/V1/Task.php index 705de0159ab9..59b952e8fcd2 100644 --- a/Dataplex/src/V1/Task.php +++ b/Dataplex/src/V1/Task.php @@ -22,44 +22,44 @@ class Task extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Output only. System generated globally unique ID for the task. This ID will * be different if the task is deleted and re-created with the same name. * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the task was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the task was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. Description of the task. * * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. Current state of the task. * * Generated from protobuf field .google.cloud.dataplex.v1.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Optional. User-defined labels for the task. * @@ -71,19 +71,19 @@ class Task extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Task.TriggerSpec trigger_spec = 100 [(.google.api.field_behavior) = REQUIRED]; */ - private $trigger_spec = null; + protected $trigger_spec = null; /** * Required. Spec related to how a task is executed. * * Generated from protobuf field .google.cloud.dataplex.v1.Task.ExecutionSpec execution_spec = 101 [(.google.api.field_behavior) = REQUIRED]; */ - private $execution_spec = null; + protected $execution_spec = null; /** * Output only. Status of the latest task executions. * * Generated from protobuf field .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $execution_status = null; + protected $execution_status = null; protected $config; /** diff --git a/Dataplex/src/V1/Task/ExecutionSpec.php b/Dataplex/src/V1/Task/ExecutionSpec.php index 86e3f849cddf..69718bfbea89 100644 --- a/Dataplex/src/V1/Task/ExecutionSpec.php +++ b/Dataplex/src/V1/Task/ExecutionSpec.php @@ -39,7 +39,7 @@ class ExecutionSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = REQUIRED]; */ - private $service_account = ''; + protected $service_account = ''; /** * Optional. The project in which jobs are run. By default, the project * containing the Lake is used. If a project is provided, the @@ -48,20 +48,20 @@ class ExecutionSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $project = ''; + protected $project = ''; /** * Optional. The maximum duration after which the job execution is expired. * * Generated from protobuf field .google.protobuf.Duration max_job_execution_lifetime = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_job_execution_lifetime = null; + protected $max_job_execution_lifetime = null; /** * Optional. The Cloud KMS key to use for encryption, of the form: * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`. * * Generated from protobuf field string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $kms_key = ''; + protected $kms_key = ''; /** * Constructor. diff --git a/Dataplex/src/V1/Task/ExecutionStatus.php b/Dataplex/src/V1/Task/ExecutionStatus.php index c4e6c457f5f2..ae725816ac96 100644 --- a/Dataplex/src/V1/Task/ExecutionStatus.php +++ b/Dataplex/src/V1/Task/ExecutionStatus.php @@ -20,13 +20,13 @@ class ExecutionStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. latest job execution * * Generated from protobuf field .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $latest_job = null; + protected $latest_job = null; /** * Constructor. diff --git a/Dataplex/src/V1/Task/InfrastructureSpec/BatchComputeResources.php b/Dataplex/src/V1/Task/InfrastructureSpec/BatchComputeResources.php index 49bc8e44a1f5..005396f36b46 100644 --- a/Dataplex/src/V1/Task/InfrastructureSpec/BatchComputeResources.php +++ b/Dataplex/src/V1/Task/InfrastructureSpec/BatchComputeResources.php @@ -21,7 +21,7 @@ class BatchComputeResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 executors_count = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $executors_count = 0; + protected $executors_count = 0; /** * Optional. Max configurable executors. * If max_executors_count > executors_count, then auto-scaling is enabled. @@ -29,7 +29,7 @@ class BatchComputeResources extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 max_executors_count = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_executors_count = 0; + protected $max_executors_count = 0; /** * Constructor. diff --git a/Dataplex/src/V1/Task/InfrastructureSpec/ContainerImageRuntime.php b/Dataplex/src/V1/Task/InfrastructureSpec/ContainerImageRuntime.php index 4e0fc60ef251..6c2638338b07 100644 --- a/Dataplex/src/V1/Task/InfrastructureSpec/ContainerImageRuntime.php +++ b/Dataplex/src/V1/Task/InfrastructureSpec/ContainerImageRuntime.php @@ -20,7 +20,7 @@ class ContainerImageRuntime extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string image = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $image = ''; + protected $image = ''; /** * Optional. A list of Java JARS to add to the classpath. * Valid input includes Cloud Storage URIs to Jar binaries. diff --git a/Dataplex/src/V1/Task/NotebookTaskConfig.php b/Dataplex/src/V1/Task/NotebookTaskConfig.php index 1282bdd8ff07..be3fe0cc67b2 100644 --- a/Dataplex/src/V1/Task/NotebookTaskConfig.php +++ b/Dataplex/src/V1/Task/NotebookTaskConfig.php @@ -23,13 +23,13 @@ class NotebookTaskConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string notebook = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $notebook = ''; + protected $notebook = ''; /** * Optional. Infrastructure specification for the execution. * * Generated from protobuf field .google.cloud.dataplex.v1.Task.InfrastructureSpec infrastructure_spec = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $infrastructure_spec = null; + protected $infrastructure_spec = null; /** * Optional. Cloud Storage URIs of files to be placed in the working * directory of each executor. diff --git a/Dataplex/src/V1/Task/SparkTaskConfig.php b/Dataplex/src/V1/Task/SparkTaskConfig.php index 58ff8a680220..48452cd818c0 100644 --- a/Dataplex/src/V1/Task/SparkTaskConfig.php +++ b/Dataplex/src/V1/Task/SparkTaskConfig.php @@ -35,7 +35,7 @@ class SparkTaskConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Task.InfrastructureSpec infrastructure_spec = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $infrastructure_spec = null; + protected $infrastructure_spec = null; protected $driver; /** diff --git a/Dataplex/src/V1/Task/TriggerSpec.php b/Dataplex/src/V1/Task/TriggerSpec.php index b1e6e5f3891a..7c043f61276a 100644 --- a/Dataplex/src/V1/Task/TriggerSpec.php +++ b/Dataplex/src/V1/Task/TriggerSpec.php @@ -20,7 +20,7 @@ class TriggerSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Task.TriggerSpec.Type type = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $type = 0; + protected $type = 0; /** * Optional. The first run of the task will be after this time. * If not specified, the task will run shortly after being submitted if @@ -28,7 +28,7 @@ class TriggerSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $start_time = null; + protected $start_time = null; /** * Optional. Prevent the task from executing. * This does not cancel already running tasks. It is intended to temporarily @@ -36,14 +36,14 @@ class TriggerSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disabled = false; + protected $disabled = false; /** * Optional. Number of retry attempts before aborting. * Set to zero to never attempt to retry a failed task. * * Generated from protobuf field int32 max_retries = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $max_retries = 0; + protected $max_retries = 0; protected $trigger; /** diff --git a/Dataplex/src/V1/Trigger/Schedule.php b/Dataplex/src/V1/Trigger/Schedule.php index aa49d2441f40..a683546e4f3b 100644 --- a/Dataplex/src/V1/Trigger/Schedule.php +++ b/Dataplex/src/V1/Trigger/Schedule.php @@ -29,7 +29,7 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string cron = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $cron = ''; + protected $cron = ''; /** * Constructor. diff --git a/Dataplex/src/V1/UpdateAspectTypeRequest.php b/Dataplex/src/V1/UpdateAspectTypeRequest.php index 2317a394bfad..7dcae0b28c53 100644 --- a/Dataplex/src/V1/UpdateAspectTypeRequest.php +++ b/Dataplex/src/V1/UpdateAspectTypeRequest.php @@ -20,20 +20,20 @@ class UpdateAspectTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.AspectType aspect_type = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $aspect_type = null; + protected $aspect_type = null; /** * Required. Mask of fields to update. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\AspectType $aspectType Required. AspectType Resource diff --git a/Dataplex/src/V1/UpdateAssetRequest.php b/Dataplex/src/V1/UpdateAssetRequest.php index 901852467a12..f421fa15d2da 100644 --- a/Dataplex/src/V1/UpdateAssetRequest.php +++ b/Dataplex/src/V1/UpdateAssetRequest.php @@ -20,21 +20,21 @@ class UpdateAssetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. Update description. * Only fields specified in `update_mask` are updated. * * Generated from protobuf field .google.cloud.dataplex.v1.Asset asset = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $asset = null; + protected $asset = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\Asset $asset Required. Update description. diff --git a/Dataplex/src/V1/UpdateContentRequest.php b/Dataplex/src/V1/UpdateContentRequest.php index d14f1b4c9b15..8cfa2d28aa8c 100644 --- a/Dataplex/src/V1/UpdateContentRequest.php +++ b/Dataplex/src/V1/UpdateContentRequest.php @@ -20,21 +20,21 @@ class UpdateContentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. Update description. * Only fields specified in `update_mask` are updated. * * Generated from protobuf field .google.cloud.dataplex.v1.Content content = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $content = null; + protected $content = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\Content $content Required. Update description. diff --git a/Dataplex/src/V1/UpdateDataAttributeBindingRequest.php b/Dataplex/src/V1/UpdateDataAttributeBindingRequest.php index 3621277ad634..5287c980b60d 100644 --- a/Dataplex/src/V1/UpdateDataAttributeBindingRequest.php +++ b/Dataplex/src/V1/UpdateDataAttributeBindingRequest.php @@ -20,20 +20,20 @@ class UpdateDataAttributeBindingRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. Only fields specified in `update_mask` are updated. * * Generated from protobuf field .google.cloud.dataplex.v1.DataAttributeBinding data_attribute_binding = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_attribute_binding = null; + protected $data_attribute_binding = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\DataAttributeBinding $dataAttributeBinding Required. Only fields specified in `update_mask` are updated. diff --git a/Dataplex/src/V1/UpdateDataAttributeRequest.php b/Dataplex/src/V1/UpdateDataAttributeRequest.php index 67f08312d8a4..c9f4468b8962 100644 --- a/Dataplex/src/V1/UpdateDataAttributeRequest.php +++ b/Dataplex/src/V1/UpdateDataAttributeRequest.php @@ -20,20 +20,20 @@ class UpdateDataAttributeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. Only fields specified in `update_mask` are updated. * * Generated from protobuf field .google.cloud.dataplex.v1.DataAttribute data_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_attribute = null; + protected $data_attribute = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\DataAttribute $dataAttribute Required. Only fields specified in `update_mask` are updated. diff --git a/Dataplex/src/V1/UpdateDataScanRequest.php b/Dataplex/src/V1/UpdateDataScanRequest.php index b79dcb34a6c4..5604a49c4fcd 100644 --- a/Dataplex/src/V1/UpdateDataScanRequest.php +++ b/Dataplex/src/V1/UpdateDataScanRequest.php @@ -21,20 +21,20 @@ class UpdateDataScanRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.DataScan data_scan = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_scan = null; + protected $data_scan = null; /** * Required. Mask of fields to update. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is `false`. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\DataScan $dataScan Required. DataScan resource to be updated. diff --git a/Dataplex/src/V1/UpdateDataTaxonomyRequest.php b/Dataplex/src/V1/UpdateDataTaxonomyRequest.php index 6595d76bcdf6..ccd50e68d9f3 100644 --- a/Dataplex/src/V1/UpdateDataTaxonomyRequest.php +++ b/Dataplex/src/V1/UpdateDataTaxonomyRequest.php @@ -20,20 +20,20 @@ class UpdateDataTaxonomyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. Only fields specified in `update_mask` are updated. * * Generated from protobuf field .google.cloud.dataplex.v1.DataTaxonomy data_taxonomy = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_taxonomy = null; + protected $data_taxonomy = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\DataTaxonomy $dataTaxonomy Required. Only fields specified in `update_mask` are updated. diff --git a/Dataplex/src/V1/UpdateEntityRequest.php b/Dataplex/src/V1/UpdateEntityRequest.php index b4fdb5f8d7c6..5f94268620ee 100644 --- a/Dataplex/src/V1/UpdateEntityRequest.php +++ b/Dataplex/src/V1/UpdateEntityRequest.php @@ -23,14 +23,14 @@ class UpdateEntityRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Entity entity = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $entity = null; + protected $entity = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * Constructor. diff --git a/Dataplex/src/V1/UpdateEntryGroupRequest.php b/Dataplex/src/V1/UpdateEntryGroupRequest.php index 5c7bee9b4d36..16978408b1f5 100644 --- a/Dataplex/src/V1/UpdateEntryGroupRequest.php +++ b/Dataplex/src/V1/UpdateEntryGroupRequest.php @@ -20,20 +20,20 @@ class UpdateEntryGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.EntryGroup entry_group = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $entry_group = null; + protected $entry_group = null; /** * Required. Mask of fields to update. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\EntryGroup $entryGroup Required. EntryGroup Resource diff --git a/Dataplex/src/V1/UpdateEntryRequest.php b/Dataplex/src/V1/UpdateEntryRequest.php index 23bfe2e7fc4e..e1e12c835e8a 100644 --- a/Dataplex/src/V1/UpdateEntryRequest.php +++ b/Dataplex/src/V1/UpdateEntryRequest.php @@ -18,7 +18,7 @@ class UpdateEntryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Entry entry = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $entry = null; + protected $entry = null; /** * Optional. Mask of fields to update. To update Aspects, the update_mask must * contain the value "aspects". @@ -27,13 +27,13 @@ class UpdateEntryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * Optional. If set to true and the entry does not exist, it will be created. * * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_missing = false; + protected $allow_missing = false; /** * Optional. If set to true and the aspect_keys specify aspect ranges, any * existing aspects from that range not provided in the request will be @@ -41,7 +41,7 @@ class UpdateEntryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool delete_missing_aspects = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $delete_missing_aspects = false; + protected $delete_missing_aspects = false; /** * Optional. The map keys of the Aspects which should be modified. Supports * the following syntaxes: diff --git a/Dataplex/src/V1/UpdateEntryTypeRequest.php b/Dataplex/src/V1/UpdateEntryTypeRequest.php index 957af13d669c..5bf45c876e45 100644 --- a/Dataplex/src/V1/UpdateEntryTypeRequest.php +++ b/Dataplex/src/V1/UpdateEntryTypeRequest.php @@ -20,20 +20,20 @@ class UpdateEntryTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.EntryType entry_type = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $entry_type = null; + protected $entry_type = null; /** * Required. Mask of fields to update. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\EntryType $entryType Required. EntryType Resource diff --git a/Dataplex/src/V1/UpdateEnvironmentRequest.php b/Dataplex/src/V1/UpdateEnvironmentRequest.php index e9bec357b114..18909b9f1a6f 100644 --- a/Dataplex/src/V1/UpdateEnvironmentRequest.php +++ b/Dataplex/src/V1/UpdateEnvironmentRequest.php @@ -20,21 +20,21 @@ class UpdateEnvironmentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. Update description. * Only fields specified in `update_mask` are updated. * * Generated from protobuf field .google.cloud.dataplex.v1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $environment = null; + protected $environment = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\Environment $environment Required. Update description. diff --git a/Dataplex/src/V1/UpdateLakeRequest.php b/Dataplex/src/V1/UpdateLakeRequest.php index 412d933530ff..c5c44f9d47d7 100644 --- a/Dataplex/src/V1/UpdateLakeRequest.php +++ b/Dataplex/src/V1/UpdateLakeRequest.php @@ -20,21 +20,21 @@ class UpdateLakeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. Update description. * Only fields specified in `update_mask` are updated. * * Generated from protobuf field .google.cloud.dataplex.v1.Lake lake = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $lake = null; + protected $lake = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\Lake $lake Required. Update description. diff --git a/Dataplex/src/V1/UpdateTaskRequest.php b/Dataplex/src/V1/UpdateTaskRequest.php index 31aa144d717e..5d56568c9c29 100644 --- a/Dataplex/src/V1/UpdateTaskRequest.php +++ b/Dataplex/src/V1/UpdateTaskRequest.php @@ -20,21 +20,21 @@ class UpdateTaskRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. Update description. * Only fields specified in `update_mask` are updated. * * Generated from protobuf field .google.cloud.dataplex.v1.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $task = null; + protected $task = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\Task $task Required. Update description. diff --git a/Dataplex/src/V1/UpdateZoneRequest.php b/Dataplex/src/V1/UpdateZoneRequest.php index f2cfe8f16494..9b7a5d586fa7 100644 --- a/Dataplex/src/V1/UpdateZoneRequest.php +++ b/Dataplex/src/V1/UpdateZoneRequest.php @@ -20,21 +20,21 @@ class UpdateZoneRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. Update description. * Only fields specified in `update_mask` are updated. * * Generated from protobuf field .google.cloud.dataplex.v1.Zone zone = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $zone = null; + protected $zone = null; /** * Optional. Only validate the request, but do not perform mutations. * The default is false. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Dataplex\V1\Zone $zone Required. Update description. diff --git a/Dataplex/src/V1/Zone.php b/Dataplex/src/V1/Zone.php index e8856865c5b4..271b517cd808 100644 --- a/Dataplex/src/V1/Zone.php +++ b/Dataplex/src/V1/Zone.php @@ -24,32 +24,32 @@ class Zone extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. User friendly display name. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. System generated globally unique ID for the zone. This ID will * be different if the zone is deleted and re-created with the same name. * * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The time when the zone was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the zone was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. User defined labels for the zone. * @@ -61,39 +61,39 @@ class Zone extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. Current state of the zone. * * Generated from protobuf field .google.cloud.dataplex.v1.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Required. Immutable. The type of the zone. * * Generated from protobuf field .google.cloud.dataplex.v1.Zone.Type type = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $type = 0; + protected $type = 0; /** * Optional. Specification of the discovery feature applied to data in this * zone. * * Generated from protobuf field .google.cloud.dataplex.v1.Zone.DiscoverySpec discovery_spec = 103 [(.google.api.field_behavior) = OPTIONAL]; */ - private $discovery_spec = null; + protected $discovery_spec = null; /** * Required. Specification of the resources that are referenced by the assets * within this zone. * * Generated from protobuf field .google.cloud.dataplex.v1.Zone.ResourceSpec resource_spec = 104 [(.google.api.field_behavior) = REQUIRED]; */ - private $resource_spec = null; + protected $resource_spec = null; /** * Output only. Aggregated status of the underlying assets of the zone. * * Generated from protobuf field .google.cloud.dataplex.v1.AssetStatus asset_status = 105 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $asset_status = null; + protected $asset_status = null; /** * Constructor. diff --git a/Dataplex/src/V1/Zone/DiscoverySpec.php b/Dataplex/src/V1/Zone/DiscoverySpec.php index f25c70230ed0..8e58d69a9bf3 100644 --- a/Dataplex/src/V1/Zone/DiscoverySpec.php +++ b/Dataplex/src/V1/Zone/DiscoverySpec.php @@ -20,7 +20,7 @@ class DiscoverySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $enabled = false; + protected $enabled = false; /** * Optional. The list of patterns to apply for selecting data to include * during discovery if only a subset of the data should considered. For @@ -45,13 +45,13 @@ class DiscoverySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions csv_options = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $csv_options = null; + protected $csv_options = null; /** * Optional. Configuration for Json data. * * Generated from protobuf field .google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions json_options = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $json_options = null; + protected $json_options = null; protected $trigger; /** diff --git a/Dataplex/src/V1/Zone/DiscoverySpec/CsvOptions.php b/Dataplex/src/V1/Zone/DiscoverySpec/CsvOptions.php index b5c67e4331e8..ced1354282bd 100644 --- a/Dataplex/src/V1/Zone/DiscoverySpec/CsvOptions.php +++ b/Dataplex/src/V1/Zone/DiscoverySpec/CsvOptions.php @@ -21,27 +21,27 @@ class CsvOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 header_rows = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $header_rows = 0; + protected $header_rows = 0; /** * Optional. The delimiter being used to separate values. This defaults to * ','. * * Generated from protobuf field string delimiter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $delimiter = ''; + protected $delimiter = ''; /** * Optional. The character encoding of the data. The default is UTF-8. * * Generated from protobuf field string encoding = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $encoding = ''; + protected $encoding = ''; /** * Optional. Whether to disable the inference of data type for CSV data. * If true, all columns will be registered as strings. * * Generated from protobuf field bool disable_type_inference = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_type_inference = false; + protected $disable_type_inference = false; /** * Constructor. diff --git a/Dataplex/src/V1/Zone/DiscoverySpec/JsonOptions.php b/Dataplex/src/V1/Zone/DiscoverySpec/JsonOptions.php index 83b0b86f881a..d85bc3a5c12c 100644 --- a/Dataplex/src/V1/Zone/DiscoverySpec/JsonOptions.php +++ b/Dataplex/src/V1/Zone/DiscoverySpec/JsonOptions.php @@ -20,7 +20,7 @@ class JsonOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string encoding = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $encoding = ''; + protected $encoding = ''; /** * Optional. Whether to disable the inference of data type for Json data. * If true, all columns will be registered as their primitive types @@ -28,7 +28,7 @@ class JsonOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_type_inference = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_type_inference = false; + protected $disable_type_inference = false; /** * Constructor. diff --git a/Dataplex/src/V1/Zone/ResourceSpec.php b/Dataplex/src/V1/Zone/ResourceSpec.php index aff77fb78052..dca8cb8e63bd 100644 --- a/Dataplex/src/V1/Zone/ResourceSpec.php +++ b/Dataplex/src/V1/Zone/ResourceSpec.php @@ -21,7 +21,7 @@ class ResourceSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType location_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $location_type = 0; + protected $location_type = 0; /** * Constructor. diff --git a/Dataplex/tests/Unit/V1/CatalogServiceClientTest.php b/Dataplex/tests/Unit/V1/CatalogServiceClientTest.php deleted file mode 100644 index 2bbcc68fc578..000000000000 --- a/Dataplex/tests/Unit/V1/CatalogServiceClientTest.php +++ /dev/null @@ -1,2476 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CatalogServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CatalogServiceClient($options); - } - - /** @test */ - public function createAspectTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createAspectTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new AspectType(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createAspectTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $aspectTypeId = 'aspectTypeId-688405671'; - $aspectType = new AspectType(); - $aspectTypeMetadataTemplate = new MetadataTemplate(); - $metadataTemplateName = 'metadataTemplateName393703156'; - $aspectTypeMetadataTemplate->setName($metadataTemplateName); - $metadataTemplateType = 'metadataTemplateType393905059'; - $aspectTypeMetadataTemplate->setType($metadataTemplateType); - $aspectType->setMetadataTemplate($aspectTypeMetadataTemplate); - $response = $gapicClient->createAspectType($formattedParent, $aspectTypeId, $aspectType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/CreateAspectType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getAspectTypeId(); - $this->assertProtobufEquals($aspectTypeId, $actualValue); - $actualValue = $actualApiRequestObject->getAspectType(); - $this->assertProtobufEquals($aspectType, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAspectTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createAspectTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createAspectTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $aspectTypeId = 'aspectTypeId-688405671'; - $aspectType = new AspectType(); - $aspectTypeMetadataTemplate = new MetadataTemplate(); - $metadataTemplateName = 'metadataTemplateName393703156'; - $aspectTypeMetadataTemplate->setName($metadataTemplateName); - $metadataTemplateType = 'metadataTemplateType393905059'; - $aspectTypeMetadataTemplate->setType($metadataTemplateType); - $aspectType->setMetadataTemplate($aspectTypeMetadataTemplate); - $response = $gapicClient->createAspectType($formattedParent, $aspectTypeId, $aspectType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAspectTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEntryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $entryType = 'entryType-1965312281'; - $parentEntry = 'parentEntry1393020061'; - $fullyQualifiedName = 'fullyQualifiedName338146659'; - $expectedResponse = new Entry(); - $expectedResponse->setName($name); - $expectedResponse->setEntryType($entryType); - $expectedResponse->setParentEntry($parentEntry); - $expectedResponse->setFullyQualifiedName($fullyQualifiedName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $entryId = 'entryId-2093663224'; - $entry = new Entry(); - $entryEntryType = 'entryEntryType884603514'; - $entry->setEntryType($entryEntryType); - $response = $gapicClient->createEntry($formattedParent, $entryId, $entry); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/CreateEntry', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEntryId(); - $this->assertProtobufEquals($entryId, $actualValue); - $actualValue = $actualRequestObject->getEntry(); - $this->assertProtobufEquals($entry, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createEntryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $entryId = 'entryId-2093663224'; - $entry = new Entry(); - $entryEntryType = 'entryEntryType884603514'; - $entry->setEntryType($entryEntryType); - try { - $gapicClient->createEntry($formattedParent, $entryId, $entry); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createEntryGroupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEntryGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new EntryGroup(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createEntryGroupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $entryGroupId = 'entryGroupId-43122680'; - $entryGroup = new EntryGroup(); - $response = $gapicClient->createEntryGroup($formattedParent, $entryGroupId, $entryGroup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/CreateEntryGroup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getEntryGroupId(); - $this->assertProtobufEquals($entryGroupId, $actualValue); - $actualValue = $actualApiRequestObject->getEntryGroup(); - $this->assertProtobufEquals($entryGroup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEntryGroupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEntryGroupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEntryGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $entryGroupId = 'entryGroupId-43122680'; - $entryGroup = new EntryGroup(); - $response = $gapicClient->createEntryGroup($formattedParent, $entryGroupId, $entryGroup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEntryGroupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEntryTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEntryTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $platform = 'platform1874684019'; - $system = 'system-887328209'; - $expectedResponse = new EntryType(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setPlatform($platform); - $expectedResponse->setSystem($system); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createEntryTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $entryTypeId = 'entryTypeId376110451'; - $entryType = new EntryType(); - $response = $gapicClient->createEntryType($formattedParent, $entryTypeId, $entryType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/CreateEntryType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getEntryTypeId(); - $this->assertProtobufEquals($entryTypeId, $actualValue); - $actualValue = $actualApiRequestObject->getEntryType(); - $this->assertProtobufEquals($entryType, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEntryTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEntryTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEntryTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $entryTypeId = 'entryTypeId376110451'; - $entryType = new EntryType(); - $response = $gapicClient->createEntryType($formattedParent, $entryTypeId, $entryType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEntryTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteAspectTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteAspectTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteAspectTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - $response = $gapicClient->deleteAspectType($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/DeleteAspectType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteAspectTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteAspectTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteAspectTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - $response = $gapicClient->deleteAspectType($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteAspectTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEntryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $entryType = 'entryType-1965312281'; - $parentEntry = 'parentEntry1393020061'; - $fullyQualifiedName = 'fullyQualifiedName338146659'; - $expectedResponse = new Entry(); - $expectedResponse->setName($name2); - $expectedResponse->setEntryType($entryType); - $expectedResponse->setParentEntry($parentEntry); - $expectedResponse->setFullyQualifiedName($fullyQualifiedName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - $response = $gapicClient->deleteEntry($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/DeleteEntry', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEntryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - try { - $gapicClient->deleteEntry($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEntryGroupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEntryGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteEntryGroupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $response = $gapicClient->deleteEntryGroup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/DeleteEntryGroup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEntryGroupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEntryGroupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEntryGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $response = $gapicClient->deleteEntryGroup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEntryGroupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEntryTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEntryTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteEntryTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - $response = $gapicClient->deleteEntryType($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/DeleteEntryType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEntryTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEntryTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEntryTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - $response = $gapicClient->deleteEntryType($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEntryTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getAspectTypeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new AspectType(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - $response = $gapicClient->getAspectType($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/GetAspectType', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAspectTypeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - try { - $gapicClient->getAspectType($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $entryType = 'entryType-1965312281'; - $parentEntry = 'parentEntry1393020061'; - $fullyQualifiedName = 'fullyQualifiedName338146659'; - $expectedResponse = new Entry(); - $expectedResponse->setName($name2); - $expectedResponse->setEntryType($entryType); - $expectedResponse->setParentEntry($parentEntry); - $expectedResponse->setFullyQualifiedName($fullyQualifiedName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - $response = $gapicClient->getEntry($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/GetEntry', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - try { - $gapicClient->getEntry($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntryGroupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new EntryGroup(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $response = $gapicClient->getEntryGroup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/GetEntryGroup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntryGroupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - try { - $gapicClient->getEntryGroup($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntryTypeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $platform = 'platform1874684019'; - $system = 'system-887328209'; - $expectedResponse = new EntryType(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setPlatform($platform); - $expectedResponse->setSystem($system); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - $response = $gapicClient->getEntryType($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/GetEntryType', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntryTypeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - try { - $gapicClient->getEntryType($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAspectTypesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $aspectTypesElement = new AspectType(); - $aspectTypes = [ - $aspectTypesElement, - ]; - $expectedResponse = new ListAspectTypesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAspectTypes($aspectTypes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listAspectTypes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAspectTypes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/ListAspectTypes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAspectTypesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listAspectTypes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $entriesElement = new Entry(); - $entries = [ - $entriesElement, - ]; - $expectedResponse = new ListEntriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEntries($entries); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $response = $gapicClient->listEntries($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEntries()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/ListEntries', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - try { - $gapicClient->listEntries($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntryGroupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $entryGroupsElement = new EntryGroup(); - $entryGroups = [ - $entryGroupsElement, - ]; - $expectedResponse = new ListEntryGroupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEntryGroups($entryGroups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listEntryGroups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEntryGroups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/ListEntryGroups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntryGroupsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listEntryGroups($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntryTypesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $entryTypesElement = new EntryType(); - $entryTypes = [ - $entryTypesElement, - ]; - $expectedResponse = new ListEntryTypesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEntryTypes($entryTypes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listEntryTypes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEntryTypes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/ListEntryTypes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntryTypesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listEntryTypes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function lookupEntryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $entryType = 'entryType-1965312281'; - $parentEntry = 'parentEntry1393020061'; - $fullyQualifiedName = 'fullyQualifiedName338146659'; - $expectedResponse = new Entry(); - $expectedResponse->setName($name2); - $expectedResponse->setEntryType($entryType); - $expectedResponse->setParentEntry($parentEntry); - $expectedResponse->setFullyQualifiedName($fullyQualifiedName); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $formattedEntry = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - $response = $gapicClient->lookupEntry($name, $formattedEntry); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/LookupEntry', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getEntry(); - $this->assertProtobufEquals($formattedEntry, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function lookupEntryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $formattedEntry = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - try { - $gapicClient->lookupEntry($name, $formattedEntry); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchEntriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $totalSize = 705419236; - $nextPageToken = ''; - $resultsElement = new SearchEntriesResult(); - $results = [ - $resultsElement, - ]; - $expectedResponse = new SearchEntriesResponse(); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setResults($results); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $query = 'query107944136'; - $response = $gapicClient->searchEntries($name, $query); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getResults()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/SearchEntries', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchEntriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $query = 'query107944136'; - try { - $gapicClient->searchEntries($name, $query); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateAspectTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAspectTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new AspectType(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateAspectTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $aspectType = new AspectType(); - $aspectTypeMetadataTemplate = new MetadataTemplate(); - $metadataTemplateName = 'metadataTemplateName393703156'; - $aspectTypeMetadataTemplate->setName($metadataTemplateName); - $metadataTemplateType = 'metadataTemplateType393905059'; - $aspectTypeMetadataTemplate->setType($metadataTemplateType); - $aspectType->setMetadataTemplate($aspectTypeMetadataTemplate); - $updateMask = new FieldMask(); - $response = $gapicClient->updateAspectType($aspectType, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/UpdateAspectType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getAspectType(); - $this->assertProtobufEquals($aspectType, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAspectTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateAspectTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAspectTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $aspectType = new AspectType(); - $aspectTypeMetadataTemplate = new MetadataTemplate(); - $metadataTemplateName = 'metadataTemplateName393703156'; - $aspectTypeMetadataTemplate->setName($metadataTemplateName); - $metadataTemplateType = 'metadataTemplateType393905059'; - $aspectTypeMetadataTemplate->setType($metadataTemplateType); - $aspectType->setMetadataTemplate($aspectTypeMetadataTemplate); - $updateMask = new FieldMask(); - $response = $gapicClient->updateAspectType($aspectType, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAspectTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateEntryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $entryType = 'entryType-1965312281'; - $parentEntry = 'parentEntry1393020061'; - $fullyQualifiedName = 'fullyQualifiedName338146659'; - $expectedResponse = new Entry(); - $expectedResponse->setName($name); - $expectedResponse->setEntryType($entryType); - $expectedResponse->setParentEntry($parentEntry); - $expectedResponse->setFullyQualifiedName($fullyQualifiedName); - $transport->addResponse($expectedResponse); - // Mock request - $entry = new Entry(); - $entryEntryType = 'entryEntryType884603514'; - $entry->setEntryType($entryEntryType); - $response = $gapicClient->updateEntry($entry); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/UpdateEntry', $actualFuncCall); - $actualValue = $actualRequestObject->getEntry(); - $this->assertProtobufEquals($entry, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEntryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $entry = new Entry(); - $entryEntryType = 'entryEntryType884603514'; - $entry->setEntryType($entryEntryType); - try { - $gapicClient->updateEntry($entry); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEntryGroupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateEntryGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new EntryGroup(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateEntryGroupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $entryGroup = new EntryGroup(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateEntryGroup($entryGroup, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/UpdateEntryGroup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEntryGroup(); - $this->assertProtobufEquals($entryGroup, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateEntryGroupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateEntryGroupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateEntryGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $entryGroup = new EntryGroup(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateEntryGroup($entryGroup, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateEntryGroupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateEntryTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateEntryTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $platform = 'platform1874684019'; - $system = 'system-887328209'; - $expectedResponse = new EntryType(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setPlatform($platform); - $expectedResponse->setSystem($system); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateEntryTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $entryType = new EntryType(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateEntryType($entryType, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.CatalogService/UpdateEntryType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEntryType(); - $this->assertProtobufEquals($entryType, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateEntryTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateEntryTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateEntryTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $entryType = new EntryType(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateEntryType($entryType, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateEntryTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataplex/tests/Unit/V1/Client/CatalogServiceClientTest.php b/Dataplex/tests/Unit/V1/Client/CatalogServiceClientTest.php index d823861a7735..192de6baf6d0 100644 --- a/Dataplex/tests/Unit/V1/Client/CatalogServiceClientTest.php +++ b/Dataplex/tests/Unit/V1/Client/CatalogServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Dataplex\V1\AspectType; @@ -70,6 +69,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -94,7 +94,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return CatalogServiceClient */ @@ -218,12 +220,15 @@ public function createAspectTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -317,12 +322,15 @@ public function createEntryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); @@ -453,12 +461,15 @@ public function createEntryGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -600,12 +611,15 @@ public function createEntryTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -668,8 +682,7 @@ public function deleteAspectTypeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - $request = (new DeleteAspectTypeRequest()) - ->setName($formattedName); + $request = (new DeleteAspectTypeRequest())->setName($formattedName); $response = $gapicClient->deleteAspectType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -725,17 +738,19 @@ public function deleteAspectTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - $request = (new DeleteAspectTypeRequest()) - ->setName($formattedName); + $request = (new DeleteAspectTypeRequest())->setName($formattedName); $response = $gapicClient->deleteAspectType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -779,8 +794,7 @@ public function deleteEntryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - $request = (new DeleteEntryRequest()) - ->setName($formattedName); + $request = (new DeleteEntryRequest())->setName($formattedName); $response = $gapicClient->deleteEntry($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -804,17 +818,19 @@ public function deleteEntryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - $request = (new DeleteEntryRequest()) - ->setName($formattedName); + $request = (new DeleteEntryRequest())->setName($formattedName); try { $gapicClient->deleteEntry($request); // If the $gapicClient method call did not throw, fail the test @@ -859,8 +875,7 @@ public function deleteEntryGroupTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $request = (new DeleteEntryGroupRequest()) - ->setName($formattedName); + $request = (new DeleteEntryGroupRequest())->setName($formattedName); $response = $gapicClient->deleteEntryGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -916,17 +931,19 @@ public function deleteEntryGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $request = (new DeleteEntryGroupRequest()) - ->setName($formattedName); + $request = (new DeleteEntryGroupRequest())->setName($formattedName); $response = $gapicClient->deleteEntryGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -980,8 +997,7 @@ public function deleteEntryTypeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - $request = (new DeleteEntryTypeRequest()) - ->setName($formattedName); + $request = (new DeleteEntryTypeRequest())->setName($formattedName); $response = $gapicClient->deleteEntryType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1037,17 +1053,19 @@ public function deleteEntryTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - $request = (new DeleteEntryTypeRequest()) - ->setName($formattedName); + $request = (new DeleteEntryTypeRequest())->setName($formattedName); $response = $gapicClient->deleteEntryType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1093,8 +1111,7 @@ public function getAspectTypeTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - $request = (new GetAspectTypeRequest()) - ->setName($formattedName); + $request = (new GetAspectTypeRequest())->setName($formattedName); $response = $gapicClient->getAspectType($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1118,17 +1135,19 @@ public function getAspectTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]'); - $request = (new GetAspectTypeRequest()) - ->setName($formattedName); + $request = (new GetAspectTypeRequest())->setName($formattedName); try { $gapicClient->getAspectType($request); // If the $gapicClient method call did not throw, fail the test @@ -1163,8 +1182,7 @@ public function getEntryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - $request = (new GetEntryRequest()) - ->setName($formattedName); + $request = (new GetEntryRequest())->setName($formattedName); $response = $gapicClient->getEntry($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1188,17 +1206,19 @@ public function getEntryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - $request = (new GetEntryRequest()) - ->setName($formattedName); + $request = (new GetEntryRequest())->setName($formattedName); try { $gapicClient->getEntry($request); // If the $gapicClient method call did not throw, fail the test @@ -1235,8 +1255,7 @@ public function getEntryGroupTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $request = (new GetEntryGroupRequest()) - ->setName($formattedName); + $request = (new GetEntryGroupRequest())->setName($formattedName); $response = $gapicClient->getEntryGroup($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1260,17 +1279,19 @@ public function getEntryGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $request = (new GetEntryGroupRequest()) - ->setName($formattedName); + $request = (new GetEntryGroupRequest())->setName($formattedName); try { $gapicClient->getEntryGroup($request); // If the $gapicClient method call did not throw, fail the test @@ -1311,8 +1332,7 @@ public function getEntryTypeTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - $request = (new GetEntryTypeRequest()) - ->setName($formattedName); + $request = (new GetEntryTypeRequest())->setName($formattedName); $response = $gapicClient->getEntryType($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1336,17 +1356,19 @@ public function getEntryTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]'); - $request = (new GetEntryTypeRequest()) - ->setName($formattedName); + $request = (new GetEntryTypeRequest())->setName($formattedName); try { $gapicClient->getEntryType($request); // If the $gapicClient method call did not throw, fail the test @@ -1371,17 +1393,14 @@ public function listAspectTypesTest() // Mock response $nextPageToken = ''; $aspectTypesElement = new AspectType(); - $aspectTypes = [ - $aspectTypesElement, - ]; + $aspectTypes = [$aspectTypesElement]; $expectedResponse = new ListAspectTypesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAspectTypes($aspectTypes); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListAspectTypesRequest()) - ->setParent($formattedParent); + $request = (new ListAspectTypesRequest())->setParent($formattedParent); $response = $gapicClient->listAspectTypes($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1408,17 +1427,19 @@ public function listAspectTypesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListAspectTypesRequest()) - ->setParent($formattedParent); + $request = (new ListAspectTypesRequest())->setParent($formattedParent); try { $gapicClient->listAspectTypes($request); // If the $gapicClient method call did not throw, fail the test @@ -1443,17 +1464,14 @@ public function listEntriesTest() // Mock response $nextPageToken = ''; $entriesElement = new Entry(); - $entries = [ - $entriesElement, - ]; + $entries = [$entriesElement]; $expectedResponse = new ListEntriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setEntries($entries); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $request = (new ListEntriesRequest()) - ->setParent($formattedParent); + $request = (new ListEntriesRequest())->setParent($formattedParent); $response = $gapicClient->listEntries($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1480,17 +1498,19 @@ public function listEntriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); - $request = (new ListEntriesRequest()) - ->setParent($formattedParent); + $request = (new ListEntriesRequest())->setParent($formattedParent); try { $gapicClient->listEntries($request); // If the $gapicClient method call did not throw, fail the test @@ -1515,17 +1535,14 @@ public function listEntryGroupsTest() // Mock response $nextPageToken = ''; $entryGroupsElement = new EntryGroup(); - $entryGroups = [ - $entryGroupsElement, - ]; + $entryGroups = [$entryGroupsElement]; $expectedResponse = new ListEntryGroupsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setEntryGroups($entryGroups); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEntryGroupsRequest()) - ->setParent($formattedParent); + $request = (new ListEntryGroupsRequest())->setParent($formattedParent); $response = $gapicClient->listEntryGroups($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1552,17 +1569,19 @@ public function listEntryGroupsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEntryGroupsRequest()) - ->setParent($formattedParent); + $request = (new ListEntryGroupsRequest())->setParent($formattedParent); try { $gapicClient->listEntryGroups($request); // If the $gapicClient method call did not throw, fail the test @@ -1587,17 +1606,14 @@ public function listEntryTypesTest() // Mock response $nextPageToken = ''; $entryTypesElement = new EntryType(); - $entryTypes = [ - $entryTypesElement, - ]; + $entryTypes = [$entryTypesElement]; $expectedResponse = new ListEntryTypesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setEntryTypes($entryTypes); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEntryTypesRequest()) - ->setParent($formattedParent); + $request = (new ListEntryTypesRequest())->setParent($formattedParent); $response = $gapicClient->listEntryTypes($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1624,17 +1640,19 @@ public function listEntryTypesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEntryTypesRequest()) - ->setParent($formattedParent); + $request = (new ListEntryTypesRequest())->setParent($formattedParent); try { $gapicClient->listEntryTypes($request); // If the $gapicClient method call did not throw, fail the test @@ -1670,9 +1688,7 @@ public function lookupEntryTest() // Mock request $name = 'name3373707'; $formattedEntry = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - $request = (new LookupEntryRequest()) - ->setName($name) - ->setEntry($formattedEntry); + $request = (new LookupEntryRequest())->setName($name)->setEntry($formattedEntry); $response = $gapicClient->lookupEntry($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1698,19 +1714,20 @@ public function lookupEntryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; $formattedEntry = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); - $request = (new LookupEntryRequest()) - ->setName($name) - ->setEntry($formattedEntry); + $request = (new LookupEntryRequest())->setName($name)->setEntry($formattedEntry); try { $gapicClient->lookupEntry($request); // If the $gapicClient method call did not throw, fail the test @@ -1736,9 +1753,7 @@ public function searchEntriesTest() $totalSize = 705419236; $nextPageToken = ''; $resultsElement = new SearchEntriesResult(); - $results = [ - $resultsElement, - ]; + $results = [$resultsElement]; $expectedResponse = new SearchEntriesResponse(); $expectedResponse->setTotalSize($totalSize); $expectedResponse->setNextPageToken($nextPageToken); @@ -1747,9 +1762,7 @@ public function searchEntriesTest() // Mock request $name = 'name3373707'; $query = 'query107944136'; - $request = (new SearchEntriesRequest()) - ->setName($name) - ->setQuery($query); + $request = (new SearchEntriesRequest())->setName($name)->setQuery($query); $response = $gapicClient->searchEntries($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1778,19 +1791,20 @@ public function searchEntriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; $query = 'query107944136'; - $request = (new SearchEntriesRequest()) - ->setName($name) - ->setQuery($query); + $request = (new SearchEntriesRequest())->setName($name)->setQuery($query); try { $gapicClient->searchEntries($request); // If the $gapicClient method call did not throw, fail the test @@ -1852,9 +1866,7 @@ public function updateAspectTypeTest() $aspectTypeMetadataTemplate->setType($metadataTemplateType); $aspectType->setMetadataTemplate($aspectTypeMetadataTemplate); $updateMask = new FieldMask(); - $request = (new UpdateAspectTypeRequest()) - ->setAspectType($aspectType) - ->setUpdateMask($updateMask); + $request = (new UpdateAspectTypeRequest())->setAspectType($aspectType)->setUpdateMask($updateMask); $response = $gapicClient->updateAspectType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1912,12 +1924,15 @@ public function updateAspectTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $aspectType = new AspectType(); @@ -1928,9 +1943,7 @@ public function updateAspectTypeExceptionTest() $aspectTypeMetadataTemplate->setType($metadataTemplateType); $aspectType->setMetadataTemplate($aspectTypeMetadataTemplate); $updateMask = new FieldMask(); - $request = (new UpdateAspectTypeRequest()) - ->setAspectType($aspectType) - ->setUpdateMask($updateMask); + $request = (new UpdateAspectTypeRequest())->setAspectType($aspectType)->setUpdateMask($updateMask); $response = $gapicClient->updateAspectType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1976,8 +1989,7 @@ public function updateEntryTest() $entry = new Entry(); $entryEntryType = 'entryEntryType884603514'; $entry->setEntryType($entryEntryType); - $request = (new UpdateEntryRequest()) - ->setEntry($entry); + $request = (new UpdateEntryRequest())->setEntry($entry); $response = $gapicClient->updateEntry($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2001,19 +2013,21 @@ public function updateEntryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $entry = new Entry(); $entryEntryType = 'entryEntryType884603514'; $entry->setEntryType($entryEntryType); - $request = (new UpdateEntryRequest()) - ->setEntry($entry); + $request = (new UpdateEntryRequest())->setEntry($entry); try { $gapicClient->updateEntry($request); // If the $gapicClient method call did not throw, fail the test @@ -2069,9 +2083,7 @@ public function updateEntryGroupTest() // Mock request $entryGroup = new EntryGroup(); $updateMask = new FieldMask(); - $request = (new UpdateEntryGroupRequest()) - ->setEntryGroup($entryGroup) - ->setUpdateMask($updateMask); + $request = (new UpdateEntryGroupRequest())->setEntryGroup($entryGroup)->setUpdateMask($updateMask); $response = $gapicClient->updateEntryGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2129,19 +2141,20 @@ public function updateEntryGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $entryGroup = new EntryGroup(); $updateMask = new FieldMask(); - $request = (new UpdateEntryGroupRequest()) - ->setEntryGroup($entryGroup) - ->setUpdateMask($updateMask); + $request = (new UpdateEntryGroupRequest())->setEntryGroup($entryGroup)->setUpdateMask($updateMask); $response = $gapicClient->updateEntryGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2210,9 +2223,7 @@ public function updateEntryTypeTest() // Mock request $entryType = new EntryType(); $updateMask = new FieldMask(); - $request = (new UpdateEntryTypeRequest()) - ->setEntryType($entryType) - ->setUpdateMask($updateMask); + $request = (new UpdateEntryTypeRequest())->setEntryType($entryType)->setUpdateMask($updateMask); $response = $gapicClient->updateEntryType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2270,19 +2281,20 @@ public function updateEntryTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $entryType = new EntryType(); $updateMask = new FieldMask(); - $request = (new UpdateEntryTypeRequest()) - ->setEntryType($entryType) - ->setUpdateMask($updateMask); + $request = (new UpdateEntryTypeRequest())->setEntryType($entryType)->setUpdateMask($updateMask); $response = $gapicClient->updateEntryType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2322,8 +2334,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2347,17 +2358,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2389,9 +2402,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2417,19 +2428,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2457,9 +2469,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2485,19 +2495,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2550,12 +2561,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -2582,9 +2596,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -2614,12 +2626,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { diff --git a/Dataplex/tests/Unit/V1/Client/ContentServiceClientTest.php b/Dataplex/tests/Unit/V1/Client/ContentServiceClientTest.php index 79ac7237e538..c9a24b07fff2 100644 --- a/Dataplex/tests/Unit/V1/Client/ContentServiceClientTest.php +++ b/Dataplex/tests/Unit/V1/Client/ContentServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ContentServiceClient */ @@ -104,9 +106,7 @@ public function createContentTest() $content->setPath($contentPath); $contentDataText = 'contentDataText-82259056'; $content->setDataText($contentDataText); - $request = (new CreateContentRequest()) - ->setParent($formattedParent) - ->setContent($content); + $request = (new CreateContentRequest())->setParent($formattedParent)->setContent($content); $response = $gapicClient->createContent($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -132,12 +132,15 @@ public function createContentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); @@ -146,9 +149,7 @@ public function createContentExceptionTest() $content->setPath($contentPath); $contentDataText = 'contentDataText-82259056'; $content->setDataText($contentDataText); - $request = (new CreateContentRequest()) - ->setParent($formattedParent) - ->setContent($content); + $request = (new CreateContentRequest())->setParent($formattedParent)->setContent($content); try { $gapicClient->createContent($request); // If the $gapicClient method call did not throw, fail the test @@ -175,8 +176,7 @@ public function deleteContentTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - $request = (new DeleteContentRequest()) - ->setName($formattedName); + $request = (new DeleteContentRequest())->setName($formattedName); $gapicClient->deleteContent($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -199,17 +199,19 @@ public function deleteContentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - $request = (new DeleteContentRequest()) - ->setName($formattedName); + $request = (new DeleteContentRequest())->setName($formattedName); try { $gapicClient->deleteContent($request); // If the $gapicClient method call did not throw, fail the test @@ -246,8 +248,7 @@ public function getContentTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - $request = (new GetContentRequest()) - ->setName($formattedName); + $request = (new GetContentRequest())->setName($formattedName); $response = $gapicClient->getContent($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -271,17 +272,19 @@ public function getContentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - $request = (new GetContentRequest()) - ->setName($formattedName); + $request = (new GetContentRequest())->setName($formattedName); try { $gapicClient->getContent($request); // If the $gapicClient method call did not throw, fail the test @@ -312,8 +315,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -337,17 +339,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -372,17 +376,14 @@ public function listContentTest() // Mock response $nextPageToken = ''; $contentElement = new Content(); - $content = [ - $contentElement, - ]; + $content = [$contentElement]; $expectedResponse = new ListContentResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setContent($content); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListContentRequest()) - ->setParent($formattedParent); + $request = (new ListContentRequest())->setParent($formattedParent); $response = $gapicClient->listContent($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -409,17 +410,19 @@ public function listContentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListContentRequest()) - ->setParent($formattedParent); + $request = (new ListContentRequest())->setParent($formattedParent); try { $gapicClient->listContent($request); // If the $gapicClient method call did not throw, fail the test @@ -451,9 +454,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -479,19 +480,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -519,9 +521,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -547,19 +547,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -601,9 +602,7 @@ public function updateContentTest() $content->setPath($contentPath); $contentDataText = 'contentDataText-82259056'; $content->setDataText($contentDataText); - $request = (new UpdateContentRequest()) - ->setUpdateMask($updateMask) - ->setContent($content); + $request = (new UpdateContentRequest())->setUpdateMask($updateMask)->setContent($content); $response = $gapicClient->updateContent($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -629,12 +628,15 @@ public function updateContentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -643,9 +645,7 @@ public function updateContentExceptionTest() $content->setPath($contentPath); $contentDataText = 'contentDataText-82259056'; $content->setDataText($contentDataText); - $request = (new UpdateContentRequest()) - ->setUpdateMask($updateMask) - ->setContent($content); + $request = (new UpdateContentRequest())->setUpdateMask($updateMask)->setContent($content); try { $gapicClient->updateContent($request); // If the $gapicClient method call did not throw, fail the test @@ -698,12 +698,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -730,9 +733,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -762,12 +763,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -811,9 +815,7 @@ public function createContentAsyncTest() $content->setPath($contentPath); $contentDataText = 'contentDataText-82259056'; $content->setDataText($contentDataText); - $request = (new CreateContentRequest()) - ->setParent($formattedParent) - ->setContent($content); + $request = (new CreateContentRequest())->setParent($formattedParent)->setContent($content); $response = $gapicClient->createContentAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/Dataplex/tests/Unit/V1/Client/DataScanServiceClientTest.php b/Dataplex/tests/Unit/V1/Client/DataScanServiceClientTest.php index 54d3fa066acc..6fa6771eea7c 100644 --- a/Dataplex/tests/Unit/V1/Client/DataScanServiceClientTest.php +++ b/Dataplex/tests/Unit/V1/Client/DataScanServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DataScanServiceClient */ @@ -195,12 +197,15 @@ public function createDataScanExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -265,8 +270,7 @@ public function deleteDataScanTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $request = (new DeleteDataScanRequest()) - ->setName($formattedName); + $request = (new DeleteDataScanRequest())->setName($formattedName); $response = $gapicClient->deleteDataScan($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -322,17 +326,19 @@ public function deleteDataScanExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $request = (new DeleteDataScanRequest()) - ->setName($formattedName); + $request = (new DeleteDataScanRequest())->setName($formattedName); $response = $gapicClient->deleteDataScan($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -368,8 +374,7 @@ public function generateDataQualityRulesTest() $transport->addResponse($expectedResponse); // Mock request $name = 'name3373707'; - $request = (new GenerateDataQualityRulesRequest()) - ->setName($name); + $request = (new GenerateDataQualityRulesRequest())->setName($name); $response = $gapicClient->generateDataQualityRules($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -393,17 +398,19 @@ public function generateDataQualityRulesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new GenerateDataQualityRulesRequest()) - ->setName($name); + $request = (new GenerateDataQualityRulesRequest())->setName($name); try { $gapicClient->generateDataQualityRules($request); // If the $gapicClient method call did not throw, fail the test @@ -438,8 +445,7 @@ public function getDataScanTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $request = (new GetDataScanRequest()) - ->setName($formattedName); + $request = (new GetDataScanRequest())->setName($formattedName); $response = $gapicClient->getDataScan($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -463,17 +469,19 @@ public function getDataScanExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $request = (new GetDataScanRequest()) - ->setName($formattedName); + $request = (new GetDataScanRequest())->setName($formattedName); try { $gapicClient->getDataScan($request); // If the $gapicClient method call did not throw, fail the test @@ -506,8 +514,7 @@ public function getDataScanJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->dataScanJobName('[PROJECT]', '[LOCATION]', '[DATASCAN]', '[JOB]'); - $request = (new GetDataScanJobRequest()) - ->setName($formattedName); + $request = (new GetDataScanJobRequest())->setName($formattedName); $response = $gapicClient->getDataScanJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -531,17 +538,19 @@ public function getDataScanJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dataScanJobName('[PROJECT]', '[LOCATION]', '[DATASCAN]', '[JOB]'); - $request = (new GetDataScanJobRequest()) - ->setName($formattedName); + $request = (new GetDataScanJobRequest())->setName($formattedName); try { $gapicClient->getDataScanJob($request); // If the $gapicClient method call did not throw, fail the test @@ -566,17 +575,14 @@ public function listDataScanJobsTest() // Mock response $nextPageToken = ''; $dataScanJobsElement = new DataScanJob(); - $dataScanJobs = [ - $dataScanJobsElement, - ]; + $dataScanJobs = [$dataScanJobsElement]; $expectedResponse = new ListDataScanJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDataScanJobs($dataScanJobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $request = (new ListDataScanJobsRequest()) - ->setParent($formattedParent); + $request = (new ListDataScanJobsRequest())->setParent($formattedParent); $response = $gapicClient->listDataScanJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -603,17 +609,19 @@ public function listDataScanJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $request = (new ListDataScanJobsRequest()) - ->setParent($formattedParent); + $request = (new ListDataScanJobsRequest())->setParent($formattedParent); try { $gapicClient->listDataScanJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -638,17 +646,14 @@ public function listDataScansTest() // Mock response $nextPageToken = ''; $dataScansElement = new DataScan(); - $dataScans = [ - $dataScansElement, - ]; + $dataScans = [$dataScansElement]; $expectedResponse = new ListDataScansResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDataScans($dataScans); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDataScansRequest()) - ->setParent($formattedParent); + $request = (new ListDataScansRequest())->setParent($formattedParent); $response = $gapicClient->listDataScans($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -675,17 +680,19 @@ public function listDataScansExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDataScansRequest()) - ->setParent($formattedParent); + $request = (new ListDataScansRequest())->setParent($formattedParent); try { $gapicClient->listDataScans($request); // If the $gapicClient method call did not throw, fail the test @@ -712,8 +719,7 @@ public function runDataScanTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $request = (new RunDataScanRequest()) - ->setName($formattedName); + $request = (new RunDataScanRequest())->setName($formattedName); $response = $gapicClient->runDataScan($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -737,17 +743,19 @@ public function runDataScanExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $request = (new RunDataScanRequest()) - ->setName($formattedName); + $request = (new RunDataScanRequest())->setName($formattedName); try { $gapicClient->runDataScan($request); // If the $gapicClient method call did not throw, fail the test @@ -803,9 +811,7 @@ public function updateDataScanTest() $dataScanData = new DataSource(); $dataScan->setData($dataScanData); $updateMask = new FieldMask(); - $request = (new UpdateDataScanRequest()) - ->setDataScan($dataScan) - ->setUpdateMask($updateMask); + $request = (new UpdateDataScanRequest())->setDataScan($dataScan)->setUpdateMask($updateMask); $response = $gapicClient->updateDataScan($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -863,21 +869,22 @@ public function updateDataScanExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $dataScan = new DataScan(); $dataScanData = new DataSource(); $dataScan->setData($dataScanData); $updateMask = new FieldMask(); - $request = (new UpdateDataScanRequest()) - ->setDataScan($dataScan) - ->setUpdateMask($updateMask); + $request = (new UpdateDataScanRequest())->setDataScan($dataScan)->setUpdateMask($updateMask); $response = $gapicClient->updateDataScan($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -917,8 +924,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -942,17 +948,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -984,9 +992,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1012,19 +1018,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1052,9 +1059,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1080,19 +1085,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1145,12 +1151,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1177,9 +1186,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1209,12 +1216,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { diff --git a/Dataplex/tests/Unit/V1/Client/DataTaxonomyServiceClientTest.php b/Dataplex/tests/Unit/V1/Client/DataTaxonomyServiceClientTest.php index f5ad2c3769c3..8db7a6ff2bf6 100644 --- a/Dataplex/tests/Unit/V1/Client/DataTaxonomyServiceClientTest.php +++ b/Dataplex/tests/Unit/V1/Client/DataTaxonomyServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DataTaxonomyServiceClient */ @@ -204,12 +206,15 @@ public function createDataAttributeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); @@ -299,7 +304,10 @@ public function createDataAttributeBindingTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/CreateDataAttributeBinding', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.dataplex.v1.DataTaxonomyService/CreateDataAttributeBinding', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getDataAttributeBindingId(); @@ -349,12 +357,15 @@ public function createDataAttributeBindingExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -496,12 +507,15 @@ public function createDataTaxonomyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -563,9 +577,13 @@ public function deleteDataAttributeTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - $request = (new DeleteDataAttributeRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->dataAttributeName( + '[PROJECT]', + '[LOCATION]', + '[DATATAXONOMY]', + '[DATA_ATTRIBUTE_ID]' + ); + $request = (new DeleteDataAttributeRequest())->setName($formattedName); $response = $gapicClient->deleteDataAttribute($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -621,17 +639,24 @@ public function deleteDataAttributeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - $request = (new DeleteDataAttributeRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->dataAttributeName( + '[PROJECT]', + '[LOCATION]', + '[DATATAXONOMY]', + '[DATA_ATTRIBUTE_ID]' + ); + $request = (new DeleteDataAttributeRequest())->setName($formattedName); $response = $gapicClient->deleteDataAttribute($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -684,11 +709,13 @@ public function deleteDataAttributeBindingTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); + $formattedName = $gapicClient->dataAttributeBindingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_ATTRIBUTE_BINDING_ID]' + ); $etag = 'etag3123477'; - $request = (new DeleteDataAttributeBindingRequest()) - ->setName($formattedName) - ->setEtag($etag); + $request = (new DeleteDataAttributeBindingRequest())->setName($formattedName)->setEtag($etag); $response = $gapicClient->deleteDataAttributeBinding($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -698,7 +725,10 @@ public function deleteDataAttributeBindingTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/DeleteDataAttributeBinding', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.dataplex.v1.DataTaxonomyService/DeleteDataAttributeBinding', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $actualValue = $actualApiRequestObject->getEtag(); @@ -746,19 +776,24 @@ public function deleteDataAttributeBindingExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); + $formattedName = $gapicClient->dataAttributeBindingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_ATTRIBUTE_BINDING_ID]' + ); $etag = 'etag3123477'; - $request = (new DeleteDataAttributeBindingRequest()) - ->setName($formattedName) - ->setEtag($etag); + $request = (new DeleteDataAttributeBindingRequest())->setName($formattedName)->setEtag($etag); $response = $gapicClient->deleteDataAttributeBinding($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -812,8 +847,7 @@ public function deleteDataTaxonomyTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $request = (new DeleteDataTaxonomyRequest()) - ->setName($formattedName); + $request = (new DeleteDataTaxonomyRequest())->setName($formattedName); $response = $gapicClient->deleteDataTaxonomy($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -869,17 +903,19 @@ public function deleteDataTaxonomyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $request = (new DeleteDataTaxonomyRequest()) - ->setName($formattedName); + $request = (new DeleteDataTaxonomyRequest())->setName($formattedName); $response = $gapicClient->deleteDataTaxonomy($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -928,9 +964,13 @@ public function getDataAttributeTest() $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - $request = (new GetDataAttributeRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->dataAttributeName( + '[PROJECT]', + '[LOCATION]', + '[DATATAXONOMY]', + '[DATA_ATTRIBUTE_ID]' + ); + $request = (new GetDataAttributeRequest())->setName($formattedName); $response = $gapicClient->getDataAttribute($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -954,17 +994,24 @@ public function getDataAttributeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - $request = (new GetDataAttributeRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->dataAttributeName( + '[PROJECT]', + '[LOCATION]', + '[DATATAXONOMY]', + '[DATA_ATTRIBUTE_ID]' + ); + $request = (new GetDataAttributeRequest())->setName($formattedName); try { $gapicClient->getDataAttribute($request); // If the $gapicClient method call did not throw, fail the test @@ -1002,9 +1049,12 @@ public function getDataAttributeBindingTest() $expectedResponse->setResource($resource); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); - $request = (new GetDataAttributeBindingRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->dataAttributeBindingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_ATTRIBUTE_BINDING_ID]' + ); + $request = (new GetDataAttributeBindingRequest())->setName($formattedName); $response = $gapicClient->getDataAttributeBinding($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1028,17 +1078,23 @@ public function getDataAttributeBindingExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); - $request = (new GetDataAttributeBindingRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->dataAttributeBindingName( + '[PROJECT]', + '[LOCATION]', + '[DATA_ATTRIBUTE_BINDING_ID]' + ); + $request = (new GetDataAttributeBindingRequest())->setName($formattedName); try { $gapicClient->getDataAttributeBinding($request); // If the $gapicClient method call did not throw, fail the test @@ -1079,8 +1135,7 @@ public function getDataTaxonomyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $request = (new GetDataTaxonomyRequest()) - ->setName($formattedName); + $request = (new GetDataTaxonomyRequest())->setName($formattedName); $response = $gapicClient->getDataTaxonomy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1104,17 +1159,19 @@ public function getDataTaxonomyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $request = (new GetDataTaxonomyRequest()) - ->setName($formattedName); + $request = (new GetDataTaxonomyRequest())->setName($formattedName); try { $gapicClient->getDataTaxonomy($request); // If the $gapicClient method call did not throw, fail the test @@ -1139,17 +1196,14 @@ public function listDataAttributeBindingsTest() // Mock response $nextPageToken = ''; $dataAttributeBindingsElement = new DataAttributeBinding(); - $dataAttributeBindings = [ - $dataAttributeBindingsElement, - ]; + $dataAttributeBindings = [$dataAttributeBindingsElement]; $expectedResponse = new ListDataAttributeBindingsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDataAttributeBindings($dataAttributeBindings); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDataAttributeBindingsRequest()) - ->setParent($formattedParent); + $request = (new ListDataAttributeBindingsRequest())->setParent($formattedParent); $response = $gapicClient->listDataAttributeBindings($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1176,17 +1230,19 @@ public function listDataAttributeBindingsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDataAttributeBindingsRequest()) - ->setParent($formattedParent); + $request = (new ListDataAttributeBindingsRequest())->setParent($formattedParent); try { $gapicClient->listDataAttributeBindings($request); // If the $gapicClient method call did not throw, fail the test @@ -1211,17 +1267,14 @@ public function listDataAttributesTest() // Mock response $nextPageToken = ''; $dataAttributesElement = new DataAttribute(); - $dataAttributes = [ - $dataAttributesElement, - ]; + $dataAttributes = [$dataAttributesElement]; $expectedResponse = new ListDataAttributesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDataAttributes($dataAttributes); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $request = (new ListDataAttributesRequest()) - ->setParent($formattedParent); + $request = (new ListDataAttributesRequest())->setParent($formattedParent); $response = $gapicClient->listDataAttributes($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1248,17 +1301,19 @@ public function listDataAttributesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $request = (new ListDataAttributesRequest()) - ->setParent($formattedParent); + $request = (new ListDataAttributesRequest())->setParent($formattedParent); try { $gapicClient->listDataAttributes($request); // If the $gapicClient method call did not throw, fail the test @@ -1283,17 +1338,14 @@ public function listDataTaxonomiesTest() // Mock response $nextPageToken = ''; $dataTaxonomiesElement = new DataTaxonomy(); - $dataTaxonomies = [ - $dataTaxonomiesElement, - ]; + $dataTaxonomies = [$dataTaxonomiesElement]; $expectedResponse = new ListDataTaxonomiesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDataTaxonomies($dataTaxonomies); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDataTaxonomiesRequest()) - ->setParent($formattedParent); + $request = (new ListDataTaxonomiesRequest())->setParent($formattedParent); $response = $gapicClient->listDataTaxonomies($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1320,17 +1372,19 @@ public function listDataTaxonomiesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDataTaxonomiesRequest()) - ->setParent($formattedParent); + $request = (new ListDataTaxonomiesRequest())->setParent($formattedParent); try { $gapicClient->listDataTaxonomies($request); // If the $gapicClient method call did not throw, fail the test @@ -1390,9 +1444,7 @@ public function updateDataAttributeTest() // Mock request $updateMask = new FieldMask(); $dataAttribute = new DataAttribute(); - $request = (new UpdateDataAttributeRequest()) - ->setUpdateMask($updateMask) - ->setDataAttribute($dataAttribute); + $request = (new UpdateDataAttributeRequest())->setUpdateMask($updateMask)->setDataAttribute($dataAttribute); $response = $gapicClient->updateDataAttribute($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1450,19 +1502,20 @@ public function updateDataAttributeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $dataAttribute = new DataAttribute(); - $request = (new UpdateDataAttributeRequest()) - ->setUpdateMask($updateMask) - ->setDataAttribute($dataAttribute); + $request = (new UpdateDataAttributeRequest())->setUpdateMask($updateMask)->setDataAttribute($dataAttribute); $response = $gapicClient->updateDataAttribute($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1541,7 +1594,10 @@ public function updateDataAttributeBindingTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/UpdateDataAttributeBinding', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.dataplex.v1.DataTaxonomyService/UpdateDataAttributeBinding', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getUpdateMask(); $this->assertProtobufEquals($updateMask, $actualValue); $actualValue = $actualApiRequestObject->getDataAttributeBinding(); @@ -1589,12 +1645,15 @@ public function updateDataAttributeBindingExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -1670,9 +1729,7 @@ public function updateDataTaxonomyTest() // Mock request $updateMask = new FieldMask(); $dataTaxonomy = new DataTaxonomy(); - $request = (new UpdateDataTaxonomyRequest()) - ->setUpdateMask($updateMask) - ->setDataTaxonomy($dataTaxonomy); + $request = (new UpdateDataTaxonomyRequest())->setUpdateMask($updateMask)->setDataTaxonomy($dataTaxonomy); $response = $gapicClient->updateDataTaxonomy($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1730,19 +1787,20 @@ public function updateDataTaxonomyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $dataTaxonomy = new DataTaxonomy(); - $request = (new UpdateDataTaxonomyRequest()) - ->setUpdateMask($updateMask) - ->setDataTaxonomy($dataTaxonomy); + $request = (new UpdateDataTaxonomyRequest())->setUpdateMask($updateMask)->setDataTaxonomy($dataTaxonomy); $response = $gapicClient->updateDataTaxonomy($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1782,8 +1840,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1807,17 +1864,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1849,9 +1908,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1877,19 +1934,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1917,9 +1975,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1945,19 +2001,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2010,12 +2067,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -2042,9 +2102,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -2074,12 +2132,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { diff --git a/Dataplex/tests/Unit/V1/Client/DataplexServiceClientTest.php b/Dataplex/tests/Unit/V1/Client/DataplexServiceClientTest.php index 6e788afea844..33f46d132813 100644 --- a/Dataplex/tests/Unit/V1/Client/DataplexServiceClientTest.php +++ b/Dataplex/tests/Unit/V1/Client/DataplexServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DataplexServiceClient */ @@ -143,8 +145,7 @@ public function cancelJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - $request = (new CancelJobRequest()) - ->setName($formattedName); + $request = (new CancelJobRequest())->setName($formattedName); $gapicClient->cancelJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -167,17 +168,19 @@ public function cancelJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - $request = (new CancelJobRequest()) - ->setName($formattedName); + $request = (new CancelJobRequest())->setName($formattedName); try { $gapicClient->cancelJob($request); // If the $gapicClient method call did not throw, fail the test @@ -299,12 +302,15 @@ public function createAssetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); @@ -450,12 +456,15 @@ public function createEnvironmentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); @@ -599,12 +608,15 @@ public function createLakeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -748,12 +760,15 @@ public function createTaskExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); @@ -903,12 +918,15 @@ public function createZoneExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); @@ -977,8 +995,7 @@ public function deleteAssetTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $request = (new DeleteAssetRequest()) - ->setName($formattedName); + $request = (new DeleteAssetRequest())->setName($formattedName); $response = $gapicClient->deleteAsset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1034,17 +1051,19 @@ public function deleteAssetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $request = (new DeleteAssetRequest()) - ->setName($formattedName); + $request = (new DeleteAssetRequest())->setName($formattedName); $response = $gapicClient->deleteAsset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1098,8 +1117,7 @@ public function deleteEnvironmentTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $request = (new DeleteEnvironmentRequest()) - ->setName($formattedName); + $request = (new DeleteEnvironmentRequest())->setName($formattedName); $response = $gapicClient->deleteEnvironment($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1155,17 +1173,19 @@ public function deleteEnvironmentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $request = (new DeleteEnvironmentRequest()) - ->setName($formattedName); + $request = (new DeleteEnvironmentRequest())->setName($formattedName); $response = $gapicClient->deleteEnvironment($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1219,8 +1239,7 @@ public function deleteLakeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new DeleteLakeRequest()) - ->setName($formattedName); + $request = (new DeleteLakeRequest())->setName($formattedName); $response = $gapicClient->deleteLake($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1276,17 +1295,19 @@ public function deleteLakeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new DeleteLakeRequest()) - ->setName($formattedName); + $request = (new DeleteLakeRequest())->setName($formattedName); $response = $gapicClient->deleteLake($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1340,8 +1361,7 @@ public function deleteTaskTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $request = (new DeleteTaskRequest()) - ->setName($formattedName); + $request = (new DeleteTaskRequest())->setName($formattedName); $response = $gapicClient->deleteTask($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1397,17 +1417,19 @@ public function deleteTaskExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $request = (new DeleteTaskRequest()) - ->setName($formattedName); + $request = (new DeleteTaskRequest())->setName($formattedName); $response = $gapicClient->deleteTask($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1461,8 +1483,7 @@ public function deleteZoneTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $request = (new DeleteZoneRequest()) - ->setName($formattedName); + $request = (new DeleteZoneRequest())->setName($formattedName); $response = $gapicClient->deleteZone($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1518,17 +1539,19 @@ public function deleteZoneExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $request = (new DeleteZoneRequest()) - ->setName($formattedName); + $request = (new DeleteZoneRequest())->setName($formattedName); $response = $gapicClient->deleteZone($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1572,8 +1595,7 @@ public function getAssetTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $request = (new GetAssetRequest()) - ->setName($formattedName); + $request = (new GetAssetRequest())->setName($formattedName); $response = $gapicClient->getAsset($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1597,17 +1619,19 @@ public function getAssetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $request = (new GetAssetRequest()) - ->setName($formattedName); + $request = (new GetAssetRequest())->setName($formattedName); try { $gapicClient->getAsset($request); // If the $gapicClient method call did not throw, fail the test @@ -1642,8 +1666,7 @@ public function getEnvironmentTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $request = (new GetEnvironmentRequest()) - ->setName($formattedName); + $request = (new GetEnvironmentRequest())->setName($formattedName); $response = $gapicClient->getEnvironment($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1667,17 +1690,19 @@ public function getEnvironmentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $request = (new GetEnvironmentRequest()) - ->setName($formattedName); + $request = (new GetEnvironmentRequest())->setName($formattedName); try { $gapicClient->getEnvironment($request); // If the $gapicClient method call did not throw, fail the test @@ -1714,8 +1739,7 @@ public function getJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - $request = (new GetJobRequest()) - ->setName($formattedName); + $request = (new GetJobRequest())->setName($formattedName); $response = $gapicClient->getJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1739,17 +1763,19 @@ public function getJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - $request = (new GetJobRequest()) - ->setName($formattedName); + $request = (new GetJobRequest())->setName($formattedName); try { $gapicClient->getJob($request); // If the $gapicClient method call did not throw, fail the test @@ -1786,8 +1812,7 @@ public function getLakeTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new GetLakeRequest()) - ->setName($formattedName); + $request = (new GetLakeRequest())->setName($formattedName); $response = $gapicClient->getLake($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1811,17 +1836,19 @@ public function getLakeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new GetLakeRequest()) - ->setName($formattedName); + $request = (new GetLakeRequest())->setName($formattedName); try { $gapicClient->getLake($request); // If the $gapicClient method call did not throw, fail the test @@ -1856,8 +1883,7 @@ public function getTaskTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $request = (new GetTaskRequest()) - ->setName($formattedName); + $request = (new GetTaskRequest())->setName($formattedName); $response = $gapicClient->getTask($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1881,17 +1907,19 @@ public function getTaskExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $request = (new GetTaskRequest()) - ->setName($formattedName); + $request = (new GetTaskRequest())->setName($formattedName); try { $gapicClient->getTask($request); // If the $gapicClient method call did not throw, fail the test @@ -1926,8 +1954,7 @@ public function getZoneTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $request = (new GetZoneRequest()) - ->setName($formattedName); + $request = (new GetZoneRequest())->setName($formattedName); $response = $gapicClient->getZone($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1951,17 +1978,19 @@ public function getZoneExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $request = (new GetZoneRequest()) - ->setName($formattedName); + $request = (new GetZoneRequest())->setName($formattedName); try { $gapicClient->getZone($request); // If the $gapicClient method call did not throw, fail the test @@ -1986,17 +2015,14 @@ public function listAssetActionsTest() // Mock response $nextPageToken = ''; $actionsElement = new Action(); - $actions = [ - $actionsElement, - ]; + $actions = [$actionsElement]; $expectedResponse = new ListActionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setActions($actions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $request = (new ListAssetActionsRequest()) - ->setParent($formattedParent); + $request = (new ListAssetActionsRequest())->setParent($formattedParent); $response = $gapicClient->listAssetActions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2023,17 +2049,19 @@ public function listAssetActionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $request = (new ListAssetActionsRequest()) - ->setParent($formattedParent); + $request = (new ListAssetActionsRequest())->setParent($formattedParent); try { $gapicClient->listAssetActions($request); // If the $gapicClient method call did not throw, fail the test @@ -2058,17 +2086,14 @@ public function listAssetsTest() // Mock response $nextPageToken = ''; $assetsElement = new Asset(); - $assets = [ - $assetsElement, - ]; + $assets = [$assetsElement]; $expectedResponse = new ListAssetsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAssets($assets); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $request = (new ListAssetsRequest()) - ->setParent($formattedParent); + $request = (new ListAssetsRequest())->setParent($formattedParent); $response = $gapicClient->listAssets($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2095,17 +2120,19 @@ public function listAssetsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $request = (new ListAssetsRequest()) - ->setParent($formattedParent); + $request = (new ListAssetsRequest())->setParent($formattedParent); try { $gapicClient->listAssets($request); // If the $gapicClient method call did not throw, fail the test @@ -2130,17 +2157,14 @@ public function listEnvironmentsTest() // Mock response $nextPageToken = ''; $environmentsElement = new Environment(); - $environments = [ - $environmentsElement, - ]; + $environments = [$environmentsElement]; $expectedResponse = new ListEnvironmentsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setEnvironments($environments); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListEnvironmentsRequest()) - ->setParent($formattedParent); + $request = (new ListEnvironmentsRequest())->setParent($formattedParent); $response = $gapicClient->listEnvironments($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2167,17 +2191,19 @@ public function listEnvironmentsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListEnvironmentsRequest()) - ->setParent($formattedParent); + $request = (new ListEnvironmentsRequest())->setParent($formattedParent); try { $gapicClient->listEnvironments($request); // If the $gapicClient method call did not throw, fail the test @@ -2202,17 +2228,14 @@ public function listJobsTest() // Mock response $nextPageToken = ''; $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; + $jobs = [$jobsElement]; $expectedResponse = new ListJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setJobs($jobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $request = (new ListJobsRequest()) - ->setParent($formattedParent); + $request = (new ListJobsRequest())->setParent($formattedParent); $response = $gapicClient->listJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2239,17 +2262,19 @@ public function listJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $request = (new ListJobsRequest()) - ->setParent($formattedParent); + $request = (new ListJobsRequest())->setParent($formattedParent); try { $gapicClient->listJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -2274,17 +2299,14 @@ public function listLakeActionsTest() // Mock response $nextPageToken = ''; $actionsElement = new Action(); - $actions = [ - $actionsElement, - ]; + $actions = [$actionsElement]; $expectedResponse = new ListActionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setActions($actions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListLakeActionsRequest()) - ->setParent($formattedParent); + $request = (new ListLakeActionsRequest())->setParent($formattedParent); $response = $gapicClient->listLakeActions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2311,17 +2333,19 @@ public function listLakeActionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListLakeActionsRequest()) - ->setParent($formattedParent); + $request = (new ListLakeActionsRequest())->setParent($formattedParent); try { $gapicClient->listLakeActions($request); // If the $gapicClient method call did not throw, fail the test @@ -2346,17 +2370,14 @@ public function listLakesTest() // Mock response $nextPageToken = ''; $lakesElement = new Lake(); - $lakes = [ - $lakesElement, - ]; + $lakes = [$lakesElement]; $expectedResponse = new ListLakesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLakes($lakes); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListLakesRequest()) - ->setParent($formattedParent); + $request = (new ListLakesRequest())->setParent($formattedParent); $response = $gapicClient->listLakes($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2383,17 +2404,19 @@ public function listLakesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListLakesRequest()) - ->setParent($formattedParent); + $request = (new ListLakesRequest())->setParent($formattedParent); try { $gapicClient->listLakes($request); // If the $gapicClient method call did not throw, fail the test @@ -2418,17 +2441,14 @@ public function listSessionsTest() // Mock response $nextPageToken = ''; $sessionsElement = new Session(); - $sessions = [ - $sessionsElement, - ]; + $sessions = [$sessionsElement]; $expectedResponse = new ListSessionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSessions($sessions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $request = (new ListSessionsRequest()) - ->setParent($formattedParent); + $request = (new ListSessionsRequest())->setParent($formattedParent); $response = $gapicClient->listSessions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2455,17 +2475,19 @@ public function listSessionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $request = (new ListSessionsRequest()) - ->setParent($formattedParent); + $request = (new ListSessionsRequest())->setParent($formattedParent); try { $gapicClient->listSessions($request); // If the $gapicClient method call did not throw, fail the test @@ -2490,17 +2512,14 @@ public function listTasksTest() // Mock response $nextPageToken = ''; $tasksElement = new Task(); - $tasks = [ - $tasksElement, - ]; + $tasks = [$tasksElement]; $expectedResponse = new ListTasksResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTasks($tasks); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListTasksRequest()) - ->setParent($formattedParent); + $request = (new ListTasksRequest())->setParent($formattedParent); $response = $gapicClient->listTasks($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2527,17 +2546,19 @@ public function listTasksExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListTasksRequest()) - ->setParent($formattedParent); + $request = (new ListTasksRequest())->setParent($formattedParent); try { $gapicClient->listTasks($request); // If the $gapicClient method call did not throw, fail the test @@ -2562,17 +2583,14 @@ public function listZoneActionsTest() // Mock response $nextPageToken = ''; $actionsElement = new Action(); - $actions = [ - $actionsElement, - ]; + $actions = [$actionsElement]; $expectedResponse = new ListActionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setActions($actions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $request = (new ListZoneActionsRequest()) - ->setParent($formattedParent); + $request = (new ListZoneActionsRequest())->setParent($formattedParent); $response = $gapicClient->listZoneActions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2599,17 +2617,19 @@ public function listZoneActionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $request = (new ListZoneActionsRequest()) - ->setParent($formattedParent); + $request = (new ListZoneActionsRequest())->setParent($formattedParent); try { $gapicClient->listZoneActions($request); // If the $gapicClient method call did not throw, fail the test @@ -2634,17 +2654,14 @@ public function listZonesTest() // Mock response $nextPageToken = ''; $zonesElement = new Zone(); - $zones = [ - $zonesElement, - ]; + $zones = [$zonesElement]; $expectedResponse = new ListZonesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setZones($zones); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListZonesRequest()) - ->setParent($formattedParent); + $request = (new ListZonesRequest())->setParent($formattedParent); $response = $gapicClient->listZones($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2671,17 +2688,19 @@ public function listZonesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $request = (new ListZonesRequest()) - ->setParent($formattedParent); + $request = (new ListZonesRequest())->setParent($formattedParent); try { $gapicClient->listZones($request); // If the $gapicClient method call did not throw, fail the test @@ -2708,8 +2727,7 @@ public function runTaskTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $request = (new RunTaskRequest()) - ->setName($formattedName); + $request = (new RunTaskRequest())->setName($formattedName); $response = $gapicClient->runTask($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2733,17 +2751,19 @@ public function runTaskExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $request = (new RunTaskRequest()) - ->setName($formattedName); + $request = (new RunTaskRequest())->setName($formattedName); try { $gapicClient->runTask($request); // If the $gapicClient method call did not throw, fail the test @@ -2801,9 +2821,7 @@ public function updateAssetTest() $resourceSpecType = Type::TYPE_UNSPECIFIED; $assetResourceSpec->setType($resourceSpecType); $asset->setResourceSpec($assetResourceSpec); - $request = (new UpdateAssetRequest()) - ->setUpdateMask($updateMask) - ->setAsset($asset); + $request = (new UpdateAssetRequest())->setUpdateMask($updateMask)->setAsset($asset); $response = $gapicClient->updateAsset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2861,12 +2879,15 @@ public function updateAssetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -2875,9 +2896,7 @@ public function updateAssetExceptionTest() $resourceSpecType = Type::TYPE_UNSPECIFIED; $assetResourceSpec->setType($resourceSpecType); $asset->setResourceSpec($assetResourceSpec); - $request = (new UpdateAssetRequest()) - ->setUpdateMask($updateMask) - ->setAsset($asset); + $request = (new UpdateAssetRequest())->setUpdateMask($updateMask)->setAsset($asset); $response = $gapicClient->updateAsset($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2946,9 +2965,7 @@ public function updateEnvironmentTest() $infrastructureSpecOsImage->setImageVersion($osImageImageVersion); $environmentInfrastructureSpec->setOsImage($infrastructureSpecOsImage); $environment->setInfrastructureSpec($environmentInfrastructureSpec); - $request = (new UpdateEnvironmentRequest()) - ->setUpdateMask($updateMask) - ->setEnvironment($environment); + $request = (new UpdateEnvironmentRequest())->setUpdateMask($updateMask)->setEnvironment($environment); $response = $gapicClient->updateEnvironment($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3006,12 +3023,15 @@ public function updateEnvironmentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -3022,9 +3042,7 @@ public function updateEnvironmentExceptionTest() $infrastructureSpecOsImage->setImageVersion($osImageImageVersion); $environmentInfrastructureSpec->setOsImage($infrastructureSpecOsImage); $environment->setInfrastructureSpec($environmentInfrastructureSpec); - $request = (new UpdateEnvironmentRequest()) - ->setUpdateMask($updateMask) - ->setEnvironment($environment); + $request = (new UpdateEnvironmentRequest())->setUpdateMask($updateMask)->setEnvironment($environment); $response = $gapicClient->updateEnvironment($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3089,9 +3107,7 @@ public function updateLakeTest() // Mock request $updateMask = new FieldMask(); $lake = new Lake(); - $request = (new UpdateLakeRequest()) - ->setUpdateMask($updateMask) - ->setLake($lake); + $request = (new UpdateLakeRequest())->setUpdateMask($updateMask)->setLake($lake); $response = $gapicClient->updateLake($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3149,19 +3165,20 @@ public function updateLakeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $lake = new Lake(); - $request = (new UpdateLakeRequest()) - ->setUpdateMask($updateMask) - ->setLake($lake); + $request = (new UpdateLakeRequest())->setUpdateMask($updateMask)->setLake($lake); $response = $gapicClient->updateLake($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3232,9 +3249,7 @@ public function updateTaskTest() $executionSpecServiceAccount = 'executionSpecServiceAccount-1249728629'; $taskExecutionSpec->setServiceAccount($executionSpecServiceAccount); $task->setExecutionSpec($taskExecutionSpec); - $request = (new UpdateTaskRequest()) - ->setUpdateMask($updateMask) - ->setTask($task); + $request = (new UpdateTaskRequest())->setUpdateMask($updateMask)->setTask($task); $response = $gapicClient->updateTask($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3292,12 +3307,15 @@ public function updateTaskExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -3310,9 +3328,7 @@ public function updateTaskExceptionTest() $executionSpecServiceAccount = 'executionSpecServiceAccount-1249728629'; $taskExecutionSpec->setServiceAccount($executionSpecServiceAccount); $task->setExecutionSpec($taskExecutionSpec); - $request = (new UpdateTaskRequest()) - ->setUpdateMask($updateMask) - ->setTask($task); + $request = (new UpdateTaskRequest())->setUpdateMask($updateMask)->setTask($task); $response = $gapicClient->updateTask($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3381,9 +3397,7 @@ public function updateZoneTest() $resourceSpecLocationType = LocationType::LOCATION_TYPE_UNSPECIFIED; $zoneResourceSpec->setLocationType($resourceSpecLocationType); $zone->setResourceSpec($zoneResourceSpec); - $request = (new UpdateZoneRequest()) - ->setUpdateMask($updateMask) - ->setZone($zone); + $request = (new UpdateZoneRequest())->setUpdateMask($updateMask)->setZone($zone); $response = $gapicClient->updateZone($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3441,12 +3455,15 @@ public function updateZoneExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -3457,9 +3474,7 @@ public function updateZoneExceptionTest() $resourceSpecLocationType = LocationType::LOCATION_TYPE_UNSPECIFIED; $zoneResourceSpec->setLocationType($resourceSpecLocationType); $zone->setResourceSpec($zoneResourceSpec); - $request = (new UpdateZoneRequest()) - ->setUpdateMask($updateMask) - ->setZone($zone); + $request = (new UpdateZoneRequest())->setUpdateMask($updateMask)->setZone($zone); $response = $gapicClient->updateZone($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3499,8 +3514,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3524,17 +3538,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -3566,9 +3582,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3594,19 +3608,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -3634,9 +3649,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3662,19 +3675,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -3727,12 +3741,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -3759,9 +3776,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -3791,12 +3806,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -3825,8 +3843,7 @@ public function cancelJobAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - $request = (new CancelJobRequest()) - ->setName($formattedName); + $request = (new CancelJobRequest())->setName($formattedName); $gapicClient->cancelJobAsync($request)->wait(); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); diff --git a/Dataplex/tests/Unit/V1/Client/MetadataServiceClientTest.php b/Dataplex/tests/Unit/V1/Client/MetadataServiceClientTest.php index cc460c9d5df6..e44e6f279c1c 100644 --- a/Dataplex/tests/Unit/V1/Client/MetadataServiceClientTest.php +++ b/Dataplex/tests/Unit/V1/Client/MetadataServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return MetadataServiceClient */ @@ -138,9 +140,7 @@ public function createEntityTest() $schemaUserManaged = false; $entitySchema->setUserManaged($schemaUserManaged); $entity->setSchema($entitySchema); - $request = (new CreateEntityRequest()) - ->setParent($formattedParent) - ->setEntity($entity); + $request = (new CreateEntityRequest())->setParent($formattedParent)->setEntity($entity); $response = $gapicClient->createEntity($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -166,12 +166,15 @@ public function createEntityExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); @@ -194,9 +197,7 @@ public function createEntityExceptionTest() $schemaUserManaged = false; $entitySchema->setUserManaged($schemaUserManaged); $entity->setSchema($entitySchema); - $request = (new CreateEntityRequest()) - ->setParent($formattedParent) - ->setEntity($entity); + $request = (new CreateEntityRequest())->setParent($formattedParent)->setEntity($entity); try { $gapicClient->createEntity($request); // If the $gapicClient method call did not throw, fail the test @@ -234,9 +235,7 @@ public function createPartitionTest() $partition->setValues($partitionValues); $partitionLocation = 'partitionLocation-1757508417'; $partition->setLocation($partitionLocation); - $request = (new CreatePartitionRequest()) - ->setParent($formattedParent) - ->setPartition($partition); + $request = (new CreatePartitionRequest())->setParent($formattedParent)->setPartition($partition); $response = $gapicClient->createPartition($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -262,12 +261,15 @@ public function createPartitionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); @@ -276,9 +278,7 @@ public function createPartitionExceptionTest() $partition->setValues($partitionValues); $partitionLocation = 'partitionLocation-1757508417'; $partition->setLocation($partitionLocation); - $request = (new CreatePartitionRequest()) - ->setParent($formattedParent) - ->setPartition($partition); + $request = (new CreatePartitionRequest())->setParent($formattedParent)->setPartition($partition); try { $gapicClient->createPartition($request); // If the $gapicClient method call did not throw, fail the test @@ -306,9 +306,7 @@ public function deleteEntityTest() // Mock request $formattedName = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); $etag = 'etag3123477'; - $request = (new DeleteEntityRequest()) - ->setName($formattedName) - ->setEtag($etag); + $request = (new DeleteEntityRequest())->setName($formattedName)->setEtag($etag); $gapicClient->deleteEntity($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -333,19 +331,20 @@ public function deleteEntityExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); $etag = 'etag3123477'; - $request = (new DeleteEntityRequest()) - ->setName($formattedName) - ->setEtag($etag); + $request = (new DeleteEntityRequest())->setName($formattedName)->setEtag($etag); try { $gapicClient->deleteEntity($request); // If the $gapicClient method call did not throw, fail the test @@ -371,9 +370,15 @@ public function deletePartitionTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - $request = (new DeletePartitionRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->partitionName( + '[PROJECT]', + '[LOCATION]', + '[LAKE]', + '[ZONE]', + '[ENTITY]', + '[PARTITION]' + ); + $request = (new DeletePartitionRequest())->setName($formattedName); $gapicClient->deletePartition($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -396,17 +401,26 @@ public function deletePartitionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - $request = (new DeletePartitionRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->partitionName( + '[PROJECT]', + '[LOCATION]', + '[LAKE]', + '[ZONE]', + '[ENTITY]', + '[PARTITION]' + ); + $request = (new DeletePartitionRequest())->setName($formattedName); try { $gapicClient->deletePartition($request); // If the $gapicClient method call did not throw, fail the test @@ -453,8 +467,7 @@ public function getEntityTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $request = (new GetEntityRequest()) - ->setName($formattedName); + $request = (new GetEntityRequest())->setName($formattedName); $response = $gapicClient->getEntity($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -478,17 +491,19 @@ public function getEntityExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $request = (new GetEntityRequest()) - ->setName($formattedName); + $request = (new GetEntityRequest())->setName($formattedName); try { $gapicClient->getEntity($request); // If the $gapicClient method call did not throw, fail the test @@ -520,9 +535,15 @@ public function getPartitionTest() $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - $request = (new GetPartitionRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->partitionName( + '[PROJECT]', + '[LOCATION]', + '[LAKE]', + '[ZONE]', + '[ENTITY]', + '[PARTITION]' + ); + $request = (new GetPartitionRequest())->setName($formattedName); $response = $gapicClient->getPartition($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -546,17 +567,26 @@ public function getPartitionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - $request = (new GetPartitionRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->partitionName( + '[PROJECT]', + '[LOCATION]', + '[LAKE]', + '[ZONE]', + '[ENTITY]', + '[PARTITION]' + ); + $request = (new GetPartitionRequest())->setName($formattedName); try { $gapicClient->getPartition($request); // If the $gapicClient method call did not throw, fail the test @@ -581,9 +611,7 @@ public function listEntitiesTest() // Mock response $nextPageToken = ''; $entitiesElement = new Entity(); - $entities = [ - $entitiesElement, - ]; + $entities = [$entitiesElement]; $expectedResponse = new ListEntitiesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setEntities($entities); @@ -591,9 +619,7 @@ public function listEntitiesTest() // Mock request $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); $view = EntityView::ENTITY_VIEW_UNSPECIFIED; - $request = (new ListEntitiesRequest()) - ->setParent($formattedParent) - ->setView($view); + $request = (new ListEntitiesRequest())->setParent($formattedParent)->setView($view); $response = $gapicClient->listEntities($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -622,19 +648,20 @@ public function listEntitiesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); $view = EntityView::ENTITY_VIEW_UNSPECIFIED; - $request = (new ListEntitiesRequest()) - ->setParent($formattedParent) - ->setView($view); + $request = (new ListEntitiesRequest())->setParent($formattedParent)->setView($view); try { $gapicClient->listEntities($request); // If the $gapicClient method call did not throw, fail the test @@ -659,17 +686,14 @@ public function listPartitionsTest() // Mock response $nextPageToken = ''; $partitionsElement = new Partition(); - $partitions = [ - $partitionsElement, - ]; + $partitions = [$partitionsElement]; $expectedResponse = new ListPartitionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setPartitions($partitions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $request = (new ListPartitionsRequest()) - ->setParent($formattedParent); + $request = (new ListPartitionsRequest())->setParent($formattedParent); $response = $gapicClient->listPartitions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -696,17 +720,19 @@ public function listPartitionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $request = (new ListPartitionsRequest()) - ->setParent($formattedParent); + $request = (new ListPartitionsRequest())->setParent($formattedParent); try { $gapicClient->listPartitions($request); // If the $gapicClient method call did not throw, fail the test @@ -771,8 +797,7 @@ public function updateEntityTest() $schemaUserManaged = false; $entitySchema->setUserManaged($schemaUserManaged); $entity->setSchema($entitySchema); - $request = (new UpdateEntityRequest()) - ->setEntity($entity); + $request = (new UpdateEntityRequest())->setEntity($entity); $response = $gapicClient->updateEntity($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -796,12 +821,15 @@ public function updateEntityExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $entity = new Entity(); @@ -823,8 +851,7 @@ public function updateEntityExceptionTest() $schemaUserManaged = false; $entitySchema->setUserManaged($schemaUserManaged); $entity->setSchema($entitySchema); - $request = (new UpdateEntityRequest()) - ->setEntity($entity); + $request = (new UpdateEntityRequest())->setEntity($entity); try { $gapicClient->updateEntity($request); // If the $gapicClient method call did not throw, fail the test @@ -855,8 +882,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -880,17 +906,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -922,9 +950,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -950,19 +976,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -990,9 +1017,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1018,19 +1043,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1083,12 +1109,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1115,9 +1144,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1147,12 +1174,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1220,9 +1250,7 @@ public function createEntityAsyncTest() $schemaUserManaged = false; $entitySchema->setUserManaged($schemaUserManaged); $entity->setSchema($entitySchema); - $request = (new CreateEntityRequest()) - ->setParent($formattedParent) - ->setEntity($entity); + $request = (new CreateEntityRequest())->setParent($formattedParent)->setEntity($entity); $response = $gapicClient->createEntityAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/Dataplex/tests/Unit/V1/ContentServiceClientTest.php b/Dataplex/tests/Unit/V1/ContentServiceClientTest.php deleted file mode 100644 index a1cf20e8f0c2..000000000000 --- a/Dataplex/tests/Unit/V1/ContentServiceClientTest.php +++ /dev/null @@ -1,731 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ContentServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ContentServiceClient($options); - } - - /** @test */ - public function createContentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $path = 'path3433509'; - $description = 'description-1724546052'; - $dataText = 'dataText-363378526'; - $expectedResponse = new Content(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setPath($path); - $expectedResponse->setDescription($description); - $expectedResponse->setDataText($dataText); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $content = new Content(); - $contentPath = 'contentPath-389273538'; - $content->setPath($contentPath); - $contentDataText = 'contentDataText-82259056'; - $content->setDataText($contentDataText); - $response = $gapicClient->createContent($formattedParent, $content); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.ContentService/CreateContent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getContent(); - $this->assertProtobufEquals($content, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createContentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $content = new Content(); - $contentPath = 'contentPath-389273538'; - $content->setPath($contentPath); - $contentDataText = 'contentDataText-82259056'; - $content->setDataText($contentDataText); - try { - $gapicClient->createContent($formattedParent, $content); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteContentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - $gapicClient->deleteContent($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.ContentService/DeleteContent', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteContentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - try { - $gapicClient->deleteContent($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getContentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $path = 'path3433509'; - $description = 'description-1724546052'; - $dataText = 'dataText-363378526'; - $expectedResponse = new Content(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setPath($path); - $expectedResponse->setDescription($description); - $expectedResponse->setDataText($dataText); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - $response = $gapicClient->getContent($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.ContentService/GetContent', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getContentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->contentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[CONTENT]'); - try { - $gapicClient->getContent($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.ContentService/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listContentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $contentElement = new Content(); - $content = [ - $contentElement, - ]; - $expectedResponse = new ListContentResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setContent($content); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $response = $gapicClient->listContent($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getContent()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.ContentService/ListContent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listContentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - try { - $gapicClient->listContent($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.ContentService/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.ContentService/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateContentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $path = 'path3433509'; - $description = 'description-1724546052'; - $dataText = 'dataText-363378526'; - $expectedResponse = new Content(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setPath($path); - $expectedResponse->setDescription($description); - $expectedResponse->setDataText($dataText); - $transport->addResponse($expectedResponse); - // Mock request - $updateMask = new FieldMask(); - $content = new Content(); - $contentPath = 'contentPath-389273538'; - $content->setPath($contentPath); - $contentDataText = 'contentDataText-82259056'; - $content->setDataText($contentDataText); - $response = $gapicClient->updateContent($updateMask, $content); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.ContentService/UpdateContent', $actualFuncCall); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualRequestObject->getContent(); - $this->assertProtobufEquals($content, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateContentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $content = new Content(); - $contentPath = 'contentPath-389273538'; - $content->setPath($contentPath); - $contentDataText = 'contentDataText-82259056'; - $content->setDataText($contentDataText); - try { - $gapicClient->updateContent($updateMask, $content); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataplex/tests/Unit/V1/DataScanServiceClientTest.php b/Dataplex/tests/Unit/V1/DataScanServiceClientTest.php deleted file mode 100644 index 315f2c3f80c4..000000000000 --- a/Dataplex/tests/Unit/V1/DataScanServiceClientTest.php +++ /dev/null @@ -1,1156 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataScanServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataScanServiceClient($options); - } - - /** @test */ - public function createDataScanTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDataScanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new DataScan(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDataScanTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataScan = new DataScan(); - $dataScanData = new DataSource(); - $dataScan->setData($dataScanData); - $dataScanId = 'dataScanId1236798088'; - $response = $gapicClient->createDataScan($formattedParent, $dataScan, $dataScanId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataScanService/CreateDataScan', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDataScan(); - $this->assertProtobufEquals($dataScan, $actualValue); - $actualValue = $actualApiRequestObject->getDataScanId(); - $this->assertProtobufEquals($dataScanId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDataScanTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDataScanExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDataScanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataScan = new DataScan(); - $dataScanData = new DataSource(); - $dataScan->setData($dataScanData); - $dataScanId = 'dataScanId1236798088'; - $response = $gapicClient->createDataScan($formattedParent, $dataScan, $dataScanId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDataScanTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataScanTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataScanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDataScanTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $response = $gapicClient->deleteDataScan($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataScanService/DeleteDataScan', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataScanTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataScanExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataScanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $response = $gapicClient->deleteDataScan($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataScanTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function generateDataQualityRulesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GenerateDataQualityRulesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->generateDataQualityRules($name); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataScanService/GenerateDataQualityRules', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateDataQualityRulesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $gapicClient->generateDataQualityRules($name); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataScanTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new DataScan(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $response = $gapicClient->getDataScan($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataScanService/GetDataScan', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataScanExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - try { - $gapicClient->getDataScan($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataScanJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $message = 'message954925063'; - $expectedResponse = new DataScanJob(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setMessage($message); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->dataScanJobName('[PROJECT]', '[LOCATION]', '[DATASCAN]', '[JOB]'); - $response = $gapicClient->getDataScanJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataScanService/GetDataScanJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataScanJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataScanJobName('[PROJECT]', '[LOCATION]', '[DATASCAN]', '[JOB]'); - try { - $gapicClient->getDataScanJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataScanJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $dataScanJobsElement = new DataScanJob(); - $dataScanJobs = [ - $dataScanJobsElement, - ]; - $expectedResponse = new ListDataScanJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDataScanJobs($dataScanJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $response = $gapicClient->listDataScanJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDataScanJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataScanService/ListDataScanJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataScanJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - try { - $gapicClient->listDataScanJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataScansTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $dataScansElement = new DataScan(); - $dataScans = [ - $dataScansElement, - ]; - $expectedResponse = new ListDataScansResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDataScans($dataScans); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listDataScans($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDataScans()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataScanService/ListDataScans', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataScansExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listDataScans($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runDataScanTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RunDataScanResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - $response = $gapicClient->runDataScan($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataScanService/RunDataScan', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runDataScanExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataScanName('[PROJECT]', '[LOCATION]', '[DATASCAN]'); - try { - $gapicClient->runDataScan($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDataScanTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataScanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new DataScan(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateDataScanTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $dataScan = new DataScan(); - $dataScanData = new DataSource(); - $dataScan->setData($dataScanData); - $updateMask = new FieldMask(); - $response = $gapicClient->updateDataScan($dataScan, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataScanService/UpdateDataScan', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getDataScan(); - $this->assertProtobufEquals($dataScan, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataScanTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDataScanExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataScanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $dataScan = new DataScan(); - $dataScanData = new DataSource(); - $dataScan->setData($dataScanData); - $updateMask = new FieldMask(); - $response = $gapicClient->updateDataScan($dataScan, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataScanTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataplex/tests/Unit/V1/DataTaxonomyServiceClientTest.php b/Dataplex/tests/Unit/V1/DataTaxonomyServiceClientTest.php deleted file mode 100644 index 8031c614b69c..000000000000 --- a/Dataplex/tests/Unit/V1/DataTaxonomyServiceClientTest.php +++ /dev/null @@ -1,1977 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataTaxonomyServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataTaxonomyServiceClient($options); - } - - /** @test */ - public function createDataAttributeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDataAttributeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $parentId = 'parentId2070327504'; - $attributeCount = 688916052; - $etag = 'etag3123477'; - $expectedResponse = new DataAttribute(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setParentId($parentId); - $expectedResponse->setAttributeCount($attributeCount); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDataAttributeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $dataAttributeId = 'dataAttributeId-1927466989'; - $dataAttribute = new DataAttribute(); - $response = $gapicClient->createDataAttribute($formattedParent, $dataAttributeId, $dataAttribute); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/CreateDataAttribute', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDataAttributeId(); - $this->assertProtobufEquals($dataAttributeId, $actualValue); - $actualValue = $actualApiRequestObject->getDataAttribute(); - $this->assertProtobufEquals($dataAttribute, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDataAttributeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDataAttributeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDataAttributeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $dataAttributeId = 'dataAttributeId-1927466989'; - $dataAttribute = new DataAttribute(); - $response = $gapicClient->createDataAttribute($formattedParent, $dataAttributeId, $dataAttribute); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDataAttributeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDataAttributeBindingTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDataAttributeBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $resource = 'resource-341064690'; - $expectedResponse = new DataAttributeBinding(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setResource($resource); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDataAttributeBindingTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataAttributeBindingId = 'dataAttributeBindingId863052813'; - $dataAttributeBinding = new DataAttributeBinding(); - $response = $gapicClient->createDataAttributeBinding($formattedParent, $dataAttributeBindingId, $dataAttributeBinding); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/CreateDataAttributeBinding', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDataAttributeBindingId(); - $this->assertProtobufEquals($dataAttributeBindingId, $actualValue); - $actualValue = $actualApiRequestObject->getDataAttributeBinding(); - $this->assertProtobufEquals($dataAttributeBinding, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDataAttributeBindingTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDataAttributeBindingExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDataAttributeBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataAttributeBindingId = 'dataAttributeBindingId863052813'; - $dataAttributeBinding = new DataAttributeBinding(); - $response = $gapicClient->createDataAttributeBinding($formattedParent, $dataAttributeBindingId, $dataAttributeBinding); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDataAttributeBindingTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDataTaxonomyTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDataTaxonomyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $attributeCount = 688916052; - $etag = 'etag3123477'; - $classCount = 424516728; - $expectedResponse = new DataTaxonomy(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setAttributeCount($attributeCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setClassCount($classCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDataTaxonomyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataTaxonomyId = 'dataTaxonomyId-857059404'; - $dataTaxonomy = new DataTaxonomy(); - $response = $gapicClient->createDataTaxonomy($formattedParent, $dataTaxonomyId, $dataTaxonomy); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/CreateDataTaxonomy', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDataTaxonomyId(); - $this->assertProtobufEquals($dataTaxonomyId, $actualValue); - $actualValue = $actualApiRequestObject->getDataTaxonomy(); - $this->assertProtobufEquals($dataTaxonomy, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDataTaxonomyTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDataTaxonomyExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDataTaxonomyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $dataTaxonomyId = 'dataTaxonomyId-857059404'; - $dataTaxonomy = new DataTaxonomy(); - $response = $gapicClient->createDataTaxonomy($formattedParent, $dataTaxonomyId, $dataTaxonomy); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDataTaxonomyTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataAttributeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataAttributeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDataAttributeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - $response = $gapicClient->deleteDataAttribute($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/DeleteDataAttribute', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataAttributeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataAttributeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataAttributeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - $response = $gapicClient->deleteDataAttribute($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataAttributeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataAttributeBindingTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataAttributeBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDataAttributeBindingTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); - $etag = 'etag3123477'; - $response = $gapicClient->deleteDataAttributeBinding($formattedName, $etag); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/DeleteDataAttributeBinding', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataAttributeBindingTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataAttributeBindingExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataAttributeBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); - $etag = 'etag3123477'; - $response = $gapicClient->deleteDataAttributeBinding($formattedName, $etag); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataAttributeBindingTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataTaxonomyTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataTaxonomyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDataTaxonomyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $response = $gapicClient->deleteDataTaxonomy($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/DeleteDataTaxonomy', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataTaxonomyTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDataTaxonomyExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDataTaxonomyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $response = $gapicClient->deleteDataTaxonomy($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDataTaxonomyTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getDataAttributeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $parentId = 'parentId2070327504'; - $attributeCount = 688916052; - $etag = 'etag3123477'; - $expectedResponse = new DataAttribute(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setParentId($parentId); - $expectedResponse->setAttributeCount($attributeCount); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - $response = $gapicClient->getDataAttribute($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/GetDataAttribute', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataAttributeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataAttributeName('[PROJECT]', '[LOCATION]', '[DATATAXONOMY]', '[DATA_ATTRIBUTE_ID]'); - try { - $gapicClient->getDataAttribute($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataAttributeBindingTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $resource = 'resource-341064690'; - $expectedResponse = new DataAttributeBinding(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setResource($resource); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); - $response = $gapicClient->getDataAttributeBinding($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/GetDataAttributeBinding', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataAttributeBindingExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataAttributeBindingName('[PROJECT]', '[LOCATION]', '[DATA_ATTRIBUTE_BINDING_ID]'); - try { - $gapicClient->getDataAttributeBinding($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataTaxonomyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $attributeCount = 688916052; - $etag = 'etag3123477'; - $classCount = 424516728; - $expectedResponse = new DataTaxonomy(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setAttributeCount($attributeCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setClassCount($classCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $response = $gapicClient->getDataTaxonomy($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/GetDataTaxonomy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataTaxonomyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - try { - $gapicClient->getDataTaxonomy($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataAttributeBindingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $dataAttributeBindingsElement = new DataAttributeBinding(); - $dataAttributeBindings = [ - $dataAttributeBindingsElement, - ]; - $expectedResponse = new ListDataAttributeBindingsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDataAttributeBindings($dataAttributeBindings); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listDataAttributeBindings($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDataAttributeBindings()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/ListDataAttributeBindings', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataAttributeBindingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listDataAttributeBindings($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataAttributesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $dataAttributesElement = new DataAttribute(); - $dataAttributes = [ - $dataAttributesElement, - ]; - $expectedResponse = new ListDataAttributesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDataAttributes($dataAttributes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - $response = $gapicClient->listDataAttributes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDataAttributes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/ListDataAttributes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataAttributesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->dataTaxonomyName('[PROJECT]', '[LOCATION]', '[DATA_TAXONOMY_ID]'); - try { - $gapicClient->listDataAttributes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataTaxonomiesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $dataTaxonomiesElement = new DataTaxonomy(); - $dataTaxonomies = [ - $dataTaxonomiesElement, - ]; - $expectedResponse = new ListDataTaxonomiesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDataTaxonomies($dataTaxonomies); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listDataTaxonomies($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDataTaxonomies()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/ListDataTaxonomies', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataTaxonomiesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listDataTaxonomies($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDataAttributeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataAttributeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $parentId = 'parentId2070327504'; - $attributeCount = 688916052; - $etag = 'etag3123477'; - $expectedResponse = new DataAttribute(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setParentId($parentId); - $expectedResponse->setAttributeCount($attributeCount); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateDataAttributeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $dataAttribute = new DataAttribute(); - $response = $gapicClient->updateDataAttribute($updateMask, $dataAttribute); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/UpdateDataAttribute', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getDataAttribute(); - $this->assertProtobufEquals($dataAttribute, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataAttributeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDataAttributeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataAttributeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $dataAttribute = new DataAttribute(); - $response = $gapicClient->updateDataAttribute($updateMask, $dataAttribute); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataAttributeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDataAttributeBindingTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataAttributeBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $resource = 'resource-341064690'; - $expectedResponse = new DataAttributeBinding(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $expectedResponse->setResource($resource); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateDataAttributeBindingTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $dataAttributeBinding = new DataAttributeBinding(); - $response = $gapicClient->updateDataAttributeBinding($updateMask, $dataAttributeBinding); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/UpdateDataAttributeBinding', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getDataAttributeBinding(); - $this->assertProtobufEquals($dataAttributeBinding, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataAttributeBindingTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDataAttributeBindingExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataAttributeBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $dataAttributeBinding = new DataAttributeBinding(); - $response = $gapicClient->updateDataAttributeBinding($updateMask, $dataAttributeBinding); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataAttributeBindingTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDataTaxonomyTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataTaxonomyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $attributeCount = 688916052; - $etag = 'etag3123477'; - $classCount = 424516728; - $expectedResponse = new DataTaxonomy(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setAttributeCount($attributeCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setClassCount($classCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateDataTaxonomyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $dataTaxonomy = new DataTaxonomy(); - $response = $gapicClient->updateDataTaxonomy($updateMask, $dataTaxonomy); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataTaxonomyService/UpdateDataTaxonomy', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getDataTaxonomy(); - $this->assertProtobufEquals($dataTaxonomy, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataTaxonomyTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDataTaxonomyExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataTaxonomyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $dataTaxonomy = new DataTaxonomy(); - $response = $gapicClient->updateDataTaxonomy($updateMask, $dataTaxonomy); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataTaxonomyTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataplex/tests/Unit/V1/DataplexServiceClientTest.php b/Dataplex/tests/Unit/V1/DataplexServiceClientTest.php deleted file mode 100644 index 3dcc40910f75..000000000000 --- a/Dataplex/tests/Unit/V1/DataplexServiceClientTest.php +++ /dev/null @@ -1,3594 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataplexServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataplexServiceClient($options); - } - - /** @test */ - public function cancelJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - $gapicClient->cancelJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/CancelJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - try { - $gapicClient->cancelJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createAssetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createAssetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $expectedResponse = new Asset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createAssetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $assetId = 'assetId-373202742'; - $asset = new Asset(); - $assetResourceSpec = new ResourceSpec(); - $resourceSpecType = Type::TYPE_UNSPECIFIED; - $assetResourceSpec->setType($resourceSpecType); - $asset->setResourceSpec($assetResourceSpec); - $response = $gapicClient->createAsset($formattedParent, $assetId, $asset); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/CreateAsset', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getAssetId(); - $this->assertProtobufEquals($assetId, $actualValue); - $actualValue = $actualApiRequestObject->getAsset(); - $this->assertProtobufEquals($asset, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAssetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createAssetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createAssetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $assetId = 'assetId-373202742'; - $asset = new Asset(); - $assetResourceSpec = new ResourceSpec(); - $resourceSpecType = Type::TYPE_UNSPECIFIED; - $assetResourceSpec->setType($resourceSpecType); - $asset->setResourceSpec($assetResourceSpec); - $response = $gapicClient->createAsset($formattedParent, $assetId, $asset); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAssetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEnvironmentTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $expectedResponse = new Environment(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createEnvironmentTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $environmentId = 'environmentId608412359'; - $environment = new Environment(); - $environmentInfrastructureSpec = new InfrastructureSpec(); - $infrastructureSpecOsImage = new OsImageRuntime(); - $osImageImageVersion = 'osImageImageVersion-831593868'; - $infrastructureSpecOsImage->setImageVersion($osImageImageVersion); - $environmentInfrastructureSpec->setOsImage($infrastructureSpecOsImage); - $environment->setInfrastructureSpec($environmentInfrastructureSpec); - $response = $gapicClient->createEnvironment($formattedParent, $environmentId, $environment); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/CreateEnvironment', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getEnvironmentId(); - $this->assertProtobufEquals($environmentId, $actualValue); - $actualValue = $actualApiRequestObject->getEnvironment(); - $this->assertProtobufEquals($environment, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEnvironmentTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEnvironmentExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $environmentId = 'environmentId608412359'; - $environment = new Environment(); - $environmentInfrastructureSpec = new InfrastructureSpec(); - $infrastructureSpecOsImage = new OsImageRuntime(); - $osImageImageVersion = 'osImageImageVersion-831593868'; - $infrastructureSpecOsImage->setImageVersion($osImageImageVersion); - $environmentInfrastructureSpec->setOsImage($infrastructureSpecOsImage); - $environment->setInfrastructureSpec($environmentInfrastructureSpec); - $response = $gapicClient->createEnvironment($formattedParent, $environmentId, $environment); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEnvironmentTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createLakeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createLakeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Lake(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createLakeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $lakeId = 'lakeId-54902325'; - $lake = new Lake(); - $response = $gapicClient->createLake($formattedParent, $lakeId, $lake); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/CreateLake', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getLakeId(); - $this->assertProtobufEquals($lakeId, $actualValue); - $actualValue = $actualApiRequestObject->getLake(); - $this->assertProtobufEquals($lake, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createLakeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createLakeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createLakeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $lakeId = 'lakeId-54902325'; - $lake = new Lake(); - $response = $gapicClient->createLake($formattedParent, $lakeId, $lake); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createLakeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTaskTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTaskTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Task(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTaskTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $taskId = 'taskId-1537240555'; - $task = new Task(); - $taskTriggerSpec = new TriggerSpec(); - $triggerSpecType = \Google\Cloud\Dataplex\V1\Task\TriggerSpec\Type::TYPE_UNSPECIFIED; - $taskTriggerSpec->setType($triggerSpecType); - $task->setTriggerSpec($taskTriggerSpec); - $taskExecutionSpec = new ExecutionSpec(); - $executionSpecServiceAccount = 'executionSpecServiceAccount-1249728629'; - $taskExecutionSpec->setServiceAccount($executionSpecServiceAccount); - $task->setExecutionSpec($taskExecutionSpec); - $response = $gapicClient->createTask($formattedParent, $taskId, $task); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/CreateTask', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTaskId(); - $this->assertProtobufEquals($taskId, $actualValue); - $actualValue = $actualApiRequestObject->getTask(); - $this->assertProtobufEquals($task, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTaskTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTaskExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTaskTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $taskId = 'taskId-1537240555'; - $task = new Task(); - $taskTriggerSpec = new TriggerSpec(); - $triggerSpecType = \Google\Cloud\Dataplex\V1\Task\TriggerSpec\Type::TYPE_UNSPECIFIED; - $taskTriggerSpec->setType($triggerSpecType); - $task->setTriggerSpec($taskTriggerSpec); - $taskExecutionSpec = new ExecutionSpec(); - $executionSpecServiceAccount = 'executionSpecServiceAccount-1249728629'; - $taskExecutionSpec->setServiceAccount($executionSpecServiceAccount); - $task->setExecutionSpec($taskExecutionSpec); - $response = $gapicClient->createTask($formattedParent, $taskId, $task); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTaskTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createZoneTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createZoneTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $expectedResponse = new Zone(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createZoneTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $zoneId = 'zoneId-111174002'; - $zone = new Zone(); - $zoneType = \Google\Cloud\Dataplex\V1\Zone\Type::TYPE_UNSPECIFIED; - $zone->setType($zoneType); - $zoneResourceSpec = new \Google\Cloud\Dataplex\V1\Zone\ResourceSpec(); - $resourceSpecLocationType = LocationType::LOCATION_TYPE_UNSPECIFIED; - $zoneResourceSpec->setLocationType($resourceSpecLocationType); - $zone->setResourceSpec($zoneResourceSpec); - $response = $gapicClient->createZone($formattedParent, $zoneId, $zone); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/CreateZone', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getZoneId(); - $this->assertProtobufEquals($zoneId, $actualValue); - $actualValue = $actualApiRequestObject->getZone(); - $this->assertProtobufEquals($zone, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createZoneTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createZoneExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createZoneTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $zoneId = 'zoneId-111174002'; - $zone = new Zone(); - $zoneType = \Google\Cloud\Dataplex\V1\Zone\Type::TYPE_UNSPECIFIED; - $zone->setType($zoneType); - $zoneResourceSpec = new \Google\Cloud\Dataplex\V1\Zone\ResourceSpec(); - $resourceSpecLocationType = LocationType::LOCATION_TYPE_UNSPECIFIED; - $zoneResourceSpec->setLocationType($resourceSpecLocationType); - $zone->setResourceSpec($zoneResourceSpec); - $response = $gapicClient->createZone($formattedParent, $zoneId, $zone); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createZoneTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteAssetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteAssetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteAssetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $response = $gapicClient->deleteAsset($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/DeleteAsset', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteAssetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteAssetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteAssetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $response = $gapicClient->deleteAsset($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteAssetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEnvironmentTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteEnvironmentTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $response = $gapicClient->deleteEnvironment($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/DeleteEnvironment', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEnvironmentTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEnvironmentExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $response = $gapicClient->deleteEnvironment($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEnvironmentTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteLakeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteLakeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteLakeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $response = $gapicClient->deleteLake($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/DeleteLake', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteLakeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteLakeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteLakeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $response = $gapicClient->deleteLake($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteLakeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTaskTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTaskTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTaskTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $response = $gapicClient->deleteTask($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/DeleteTask', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTaskTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTaskExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTaskTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $response = $gapicClient->deleteTask($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTaskTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteZoneTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteZoneTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteZoneTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $response = $gapicClient->deleteZone($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/DeleteZone', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteZoneTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteZoneExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteZoneTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $response = $gapicClient->deleteZone($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteZoneTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getAssetTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $expectedResponse = new Asset(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $response = $gapicClient->getAsset($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/GetAsset', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAssetExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - try { - $gapicClient->getAsset($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEnvironmentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $expectedResponse = new Environment(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $response = $gapicClient->getEnvironment($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/GetEnvironment', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEnvironmentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - try { - $gapicClient->getEnvironment($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $retryCount = 928040776; - $serviceJob = 'serviceJob-1928057037'; - $message = 'message954925063'; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setRetryCount($retryCount); - $expectedResponse->setServiceJob($serviceJob); - $expectedResponse->setMessage($message); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - $response = $gapicClient->getJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/GetJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]'); - try { - $gapicClient->getJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLakeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Lake(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $response = $gapicClient->getLake($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/GetLake', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLakeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - try { - $gapicClient->getLake($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $response = $gapicClient->getTask($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/GetTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - try { - $gapicClient->getTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getZoneTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $expectedResponse = new Zone(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $response = $gapicClient->getZone($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/GetZone', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getZoneExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - try { - $gapicClient->getZone($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAssetActionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $actionsElement = new Action(); - $actions = [ - $actionsElement, - ]; - $expectedResponse = new ListActionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setActions($actions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - $response = $gapicClient->listAssetActions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getActions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListAssetActions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAssetActionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->assetName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ASSET]'); - try { - $gapicClient->listAssetActions($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAssetsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $assetsElement = new Asset(); - $assets = [ - $assetsElement, - ]; - $expectedResponse = new ListAssetsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAssets($assets); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $response = $gapicClient->listAssets($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAssets()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListAssets', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAssetsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - try { - $gapicClient->listAssets($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEnvironmentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $environmentsElement = new Environment(); - $environments = [ - $environmentsElement, - ]; - $expectedResponse = new ListEnvironmentsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEnvironments($environments); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $response = $gapicClient->listEnvironments($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEnvironments()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListEnvironments', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEnvironmentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - try { - $gapicClient->listEnvironments($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; - $expectedResponse = new ListJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobs($jobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $response = $gapicClient->listJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - try { - $gapicClient->listJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLakeActionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $actionsElement = new Action(); - $actions = [ - $actionsElement, - ]; - $expectedResponse = new ListActionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setActions($actions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $response = $gapicClient->listLakeActions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getActions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListLakeActions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLakeActionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - try { - $gapicClient->listLakeActions($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLakesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $lakesElement = new Lake(); - $lakes = [ - $lakesElement, - ]; - $expectedResponse = new ListLakesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLakes($lakes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listLakes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLakes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListLakes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLakesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listLakes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSessionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $sessionsElement = new Session(); - $sessions = [ - $sessionsElement, - ]; - $expectedResponse = new ListSessionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSessions($sessions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - $response = $gapicClient->listSessions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSessions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListSessions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSessionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->environmentName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ENVIRONMENT]'); - try { - $gapicClient->listSessions($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tasksElement = new Task(); - $tasks = [ - $tasksElement, - ]; - $expectedResponse = new ListTasksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTasks($tasks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $response = $gapicClient->listTasks($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListTasks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - try { - $gapicClient->listTasks($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listZoneActionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $actionsElement = new Action(); - $actions = [ - $actionsElement, - ]; - $expectedResponse = new ListActionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setActions($actions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $response = $gapicClient->listZoneActions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getActions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListZoneActions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listZoneActionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - try { - $gapicClient->listZoneActions($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listZonesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $zonesElement = new Zone(); - $zones = [ - $zonesElement, - ]; - $expectedResponse = new ListZonesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setZones($zones); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - $response = $gapicClient->listZones($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getZones()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/ListZones', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listZonesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->lakeName('[PROJECT]', '[LOCATION]', '[LAKE]'); - try { - $gapicClient->listZones($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RunTaskResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - $response = $gapicClient->runTask($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/RunTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]'); - try { - $gapicClient->runTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateAssetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAssetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $expectedResponse = new Asset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateAssetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $asset = new Asset(); - $assetResourceSpec = new ResourceSpec(); - $resourceSpecType = Type::TYPE_UNSPECIFIED; - $assetResourceSpec->setType($resourceSpecType); - $asset->setResourceSpec($assetResourceSpec); - $response = $gapicClient->updateAsset($updateMask, $asset); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/UpdateAsset', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getAsset(); - $this->assertProtobufEquals($asset, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAssetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateAssetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAssetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $asset = new Asset(); - $assetResourceSpec = new ResourceSpec(); - $resourceSpecType = Type::TYPE_UNSPECIFIED; - $assetResourceSpec->setType($resourceSpecType); - $asset->setResourceSpec($assetResourceSpec); - $response = $gapicClient->updateAsset($updateMask, $asset); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAssetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateEnvironmentTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $expectedResponse = new Environment(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateEnvironmentTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $environment = new Environment(); - $environmentInfrastructureSpec = new InfrastructureSpec(); - $infrastructureSpecOsImage = new OsImageRuntime(); - $osImageImageVersion = 'osImageImageVersion-831593868'; - $infrastructureSpecOsImage->setImageVersion($osImageImageVersion); - $environmentInfrastructureSpec->setOsImage($infrastructureSpecOsImage); - $environment->setInfrastructureSpec($environmentInfrastructureSpec); - $response = $gapicClient->updateEnvironment($updateMask, $environment); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/UpdateEnvironment', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getEnvironment(); - $this->assertProtobufEquals($environment, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateEnvironmentTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateEnvironmentExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $environment = new Environment(); - $environmentInfrastructureSpec = new InfrastructureSpec(); - $infrastructureSpecOsImage = new OsImageRuntime(); - $osImageImageVersion = 'osImageImageVersion-831593868'; - $infrastructureSpecOsImage->setImageVersion($osImageImageVersion); - $environmentInfrastructureSpec->setOsImage($infrastructureSpecOsImage); - $environment->setInfrastructureSpec($environmentInfrastructureSpec); - $response = $gapicClient->updateEnvironment($updateMask, $environment); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateEnvironmentTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateLakeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateLakeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Lake(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateLakeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $lake = new Lake(); - $response = $gapicClient->updateLake($updateMask, $lake); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/UpdateLake', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getLake(); - $this->assertProtobufEquals($lake, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateLakeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateLakeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateLakeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $lake = new Lake(); - $response = $gapicClient->updateLake($updateMask, $lake); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateLakeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTaskTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTaskTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Task(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTaskTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $task = new Task(); - $taskTriggerSpec = new TriggerSpec(); - $triggerSpecType = \Google\Cloud\Dataplex\V1\Task\TriggerSpec\Type::TYPE_UNSPECIFIED; - $taskTriggerSpec->setType($triggerSpecType); - $task->setTriggerSpec($taskTriggerSpec); - $taskExecutionSpec = new ExecutionSpec(); - $executionSpecServiceAccount = 'executionSpecServiceAccount-1249728629'; - $taskExecutionSpec->setServiceAccount($executionSpecServiceAccount); - $task->setExecutionSpec($taskExecutionSpec); - $response = $gapicClient->updateTask($updateMask, $task); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/UpdateTask', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getTask(); - $this->assertProtobufEquals($task, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTaskTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTaskExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTaskTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $task = new Task(); - $taskTriggerSpec = new TriggerSpec(); - $triggerSpecType = \Google\Cloud\Dataplex\V1\Task\TriggerSpec\Type::TYPE_UNSPECIFIED; - $taskTriggerSpec->setType($triggerSpecType); - $task->setTriggerSpec($taskTriggerSpec); - $taskExecutionSpec = new ExecutionSpec(); - $executionSpecServiceAccount = 'executionSpecServiceAccount-1249728629'; - $taskExecutionSpec->setServiceAccount($executionSpecServiceAccount); - $task->setExecutionSpec($taskExecutionSpec); - $response = $gapicClient->updateTask($updateMask, $task); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTaskTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateZoneTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateZoneTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $expectedResponse = new Zone(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateZoneTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $zone = new Zone(); - $zoneType = \Google\Cloud\Dataplex\V1\Zone\Type::TYPE_UNSPECIFIED; - $zone->setType($zoneType); - $zoneResourceSpec = new \Google\Cloud\Dataplex\V1\Zone\ResourceSpec(); - $resourceSpecLocationType = LocationType::LOCATION_TYPE_UNSPECIFIED; - $zoneResourceSpec->setLocationType($resourceSpecLocationType); - $zone->setResourceSpec($zoneResourceSpec); - $response = $gapicClient->updateZone($updateMask, $zone); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.DataplexService/UpdateZone', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getZone(); - $this->assertProtobufEquals($zone, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateZoneTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateZoneExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateZoneTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $zone = new Zone(); - $zoneType = \Google\Cloud\Dataplex\V1\Zone\Type::TYPE_UNSPECIFIED; - $zone->setType($zoneType); - $zoneResourceSpec = new \Google\Cloud\Dataplex\V1\Zone\ResourceSpec(); - $resourceSpecLocationType = LocationType::LOCATION_TYPE_UNSPECIFIED; - $zoneResourceSpec->setLocationType($resourceSpecLocationType); - $zone->setResourceSpec($zoneResourceSpec); - $response = $gapicClient->updateZone($updateMask, $zone); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateZoneTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataplex/tests/Unit/V1/MetadataServiceClientTest.php b/Dataplex/tests/Unit/V1/MetadataServiceClientTest.php deleted file mode 100644 index 8fb703ddc68f..000000000000 --- a/Dataplex/tests/Unit/V1/MetadataServiceClientTest.php +++ /dev/null @@ -1,1092 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return MetadataServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new MetadataServiceClient($options); - } - - /** @test */ - public function createEntityTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $id = 'id3355'; - $etag = 'etag3123477'; - $asset = 'asset93121264'; - $dataPath = 'dataPath-363501670'; - $dataPathPattern = 'dataPathPattern-594427925'; - $catalogEntry = 'catalogEntry-1234004788'; - $uid = 'uid115792'; - $expectedResponse = new Entity(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setId($id); - $expectedResponse->setEtag($etag); - $expectedResponse->setAsset($asset); - $expectedResponse->setDataPath($dataPath); - $expectedResponse->setDataPathPattern($dataPathPattern); - $expectedResponse->setCatalogEntry($catalogEntry); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $entity = new Entity(); - $entityId = 'entityId-2102099874'; - $entity->setId($entityId); - $entityType = Type::TYPE_UNSPECIFIED; - $entity->setType($entityType); - $entityAsset = 'entityAsset1253969101'; - $entity->setAsset($entityAsset); - $entityDataPath = 'entityDataPath1530173426'; - $entity->setDataPath($entityDataPath); - $entitySystem = StorageSystem::STORAGE_SYSTEM_UNSPECIFIED; - $entity->setSystem($entitySystem); - $entityFormat = new StorageFormat(); - $formatMimeType = 'formatMimeType-1419746651'; - $entityFormat->setMimeType($formatMimeType); - $entity->setFormat($entityFormat); - $entitySchema = new Schema(); - $schemaUserManaged = false; - $entitySchema->setUserManaged($schemaUserManaged); - $entity->setSchema($entitySchema); - $response = $gapicClient->createEntity($formattedParent, $entity); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.MetadataService/CreateEntity', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEntity(); - $this->assertProtobufEquals($entity, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createEntityExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $entity = new Entity(); - $entityId = 'entityId-2102099874'; - $entity->setId($entityId); - $entityType = Type::TYPE_UNSPECIFIED; - $entity->setType($entityType); - $entityAsset = 'entityAsset1253969101'; - $entity->setAsset($entityAsset); - $entityDataPath = 'entityDataPath1530173426'; - $entity->setDataPath($entityDataPath); - $entitySystem = StorageSystem::STORAGE_SYSTEM_UNSPECIFIED; - $entity->setSystem($entitySystem); - $entityFormat = new StorageFormat(); - $formatMimeType = 'formatMimeType-1419746651'; - $entityFormat->setMimeType($formatMimeType); - $entity->setFormat($entityFormat); - $entitySchema = new Schema(); - $schemaUserManaged = false; - $entitySchema->setUserManaged($schemaUserManaged); - $entity->setSchema($entitySchema); - try { - $gapicClient->createEntity($formattedParent, $entity); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createPartitionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $location = 'location1901043637'; - $etag = 'etag3123477'; - $expectedResponse = new Partition(); - $expectedResponse->setName($name); - $expectedResponse->setLocation($location); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $partition = new Partition(); - $partitionValues = []; - $partition->setValues($partitionValues); - $partitionLocation = 'partitionLocation-1757508417'; - $partition->setLocation($partitionLocation); - $response = $gapicClient->createPartition($formattedParent, $partition); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.MetadataService/CreatePartition', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPartition(); - $this->assertProtobufEquals($partition, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createPartitionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $partition = new Partition(); - $partitionValues = []; - $partition->setValues($partitionValues); - $partitionLocation = 'partitionLocation-1757508417'; - $partition->setLocation($partitionLocation); - try { - $gapicClient->createPartition($formattedParent, $partition); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEntityTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $etag = 'etag3123477'; - $gapicClient->deleteEntity($formattedName, $etag); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.MetadataService/DeleteEntity', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEntityExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $etag = 'etag3123477'; - try { - $gapicClient->deleteEntity($formattedName, $etag); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deletePartitionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - $gapicClient->deletePartition($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.MetadataService/DeletePartition', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deletePartitionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - try { - $gapicClient->deletePartition($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntityTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $id = 'id3355'; - $etag = 'etag3123477'; - $asset = 'asset93121264'; - $dataPath = 'dataPath-363501670'; - $dataPathPattern = 'dataPathPattern-594427925'; - $catalogEntry = 'catalogEntry-1234004788'; - $uid = 'uid115792'; - $expectedResponse = new Entity(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setId($id); - $expectedResponse->setEtag($etag); - $expectedResponse->setAsset($asset); - $expectedResponse->setDataPath($dataPath); - $expectedResponse->setDataPathPattern($dataPathPattern); - $expectedResponse->setCatalogEntry($catalogEntry); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $response = $gapicClient->getEntity($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.MetadataService/GetEntity', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEntityExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - try { - $gapicClient->getEntity($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPartitionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $location = 'location1901043637'; - $etag = 'etag3123477'; - $expectedResponse = new Partition(); - $expectedResponse->setName($name2); - $expectedResponse->setLocation($location); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - $response = $gapicClient->getPartition($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.MetadataService/GetPartition', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPartitionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->partitionName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]', '[PARTITION]'); - try { - $gapicClient->getPartition($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntitiesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $entitiesElement = new Entity(); - $entities = [ - $entitiesElement, - ]; - $expectedResponse = new ListEntitiesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEntities($entities); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $view = EntityView::ENTITY_VIEW_UNSPECIFIED; - $response = $gapicClient->listEntities($formattedParent, $view); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEntities()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.MetadataService/ListEntities', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getView(); - $this->assertProtobufEquals($view, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEntitiesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]'); - $view = EntityView::ENTITY_VIEW_UNSPECIFIED; - try { - $gapicClient->listEntities($formattedParent, $view); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPartitionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $partitionsElement = new Partition(); - $partitions = [ - $partitionsElement, - ]; - $expectedResponse = new ListPartitionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPartitions($partitions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - $response = $gapicClient->listPartitions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPartitions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.MetadataService/ListPartitions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPartitionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->entityName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]', '[ENTITY]'); - try { - $gapicClient->listPartitions($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEntityTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $id = 'id3355'; - $etag = 'etag3123477'; - $asset = 'asset93121264'; - $dataPath = 'dataPath-363501670'; - $dataPathPattern = 'dataPathPattern-594427925'; - $catalogEntry = 'catalogEntry-1234004788'; - $uid = 'uid115792'; - $expectedResponse = new Entity(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setId($id); - $expectedResponse->setEtag($etag); - $expectedResponse->setAsset($asset); - $expectedResponse->setDataPath($dataPath); - $expectedResponse->setDataPathPattern($dataPathPattern); - $expectedResponse->setCatalogEntry($catalogEntry); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $entity = new Entity(); - $entityId = 'entityId-2102099874'; - $entity->setId($entityId); - $entityType = Type::TYPE_UNSPECIFIED; - $entity->setType($entityType); - $entityAsset = 'entityAsset1253969101'; - $entity->setAsset($entityAsset); - $entityDataPath = 'entityDataPath1530173426'; - $entity->setDataPath($entityDataPath); - $entitySystem = StorageSystem::STORAGE_SYSTEM_UNSPECIFIED; - $entity->setSystem($entitySystem); - $entityFormat = new StorageFormat(); - $formatMimeType = 'formatMimeType-1419746651'; - $entityFormat->setMimeType($formatMimeType); - $entity->setFormat($entityFormat); - $entitySchema = new Schema(); - $schemaUserManaged = false; - $entitySchema->setUserManaged($schemaUserManaged); - $entity->setSchema($entitySchema); - $response = $gapicClient->updateEntity($entity); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataplex.v1.MetadataService/UpdateEntity', $actualFuncCall); - $actualValue = $actualRequestObject->getEntity(); - $this->assertProtobufEquals($entity, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEntityExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $entity = new Entity(); - $entityId = 'entityId-2102099874'; - $entity->setId($entityId); - $entityType = Type::TYPE_UNSPECIFIED; - $entity->setType($entityType); - $entityAsset = 'entityAsset1253969101'; - $entity->setAsset($entityAsset); - $entityDataPath = 'entityDataPath1530173426'; - $entity->setDataPath($entityDataPath); - $entitySystem = StorageSystem::STORAGE_SYSTEM_UNSPECIFIED; - $entity->setSystem($entitySystem); - $entityFormat = new StorageFormat(); - $formatMimeType = 'formatMimeType-1419746651'; - $entityFormat->setMimeType($formatMimeType); - $entity->setFormat($entityFormat); - $entitySchema = new Schema(); - $schemaUserManaged = false; - $entitySchema->setUserManaged($schemaUserManaged); - $entity->setSchema($entitySchema); - try { - $gapicClient->updateEntity($entity); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataproc/.repo-metadata.json b/Dataproc/.repo-metadata.json deleted file mode 100644 index 6826b7072607..000000000000 --- a/Dataproc/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-dataproc", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataproc/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "dataproc" -} diff --git a/Dataproc/VERSION b/Dataproc/VERSION index 3e388a4ac94a..0d9339e0fad0 100644 --- a/Dataproc/VERSION +++ b/Dataproc/VERSION @@ -1 +1 @@ -3.13.2 +3.13.4 diff --git a/Dataproc/composer.json b/Dataproc/composer.json index a6d3394d391e..5ea018abcfe9 100644 --- a/Dataproc/composer.json +++ b/Dataproc/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/DataprocMetastore/.OwlBot.yaml b/DataprocMetastore/.OwlBot.yaml index f02ac808c178..4483418334b9 100644 --- a/DataprocMetastore/.OwlBot.yaml +++ b/DataprocMetastore/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/metastore/(.*)/.*-php/(.*) + - source: /google/cloud/metastore/(v1)/.*-php/(.*) dest: /owl-bot-staging/DataprocMetastore/$1/$2 api-name: DataprocMetastore diff --git a/DataprocMetastore/.repo-metadata.json b/DataprocMetastore/.repo-metadata.json deleted file mode 100644 index 054f4de57ac8..000000000000 --- a/DataprocMetastore/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-dataproc-metastore", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataproc-metastore/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "metastore" -} diff --git a/DataprocMetastore/README.md b/DataprocMetastore/README.md index 736ce753e089..21262c935be7 100644 --- a/DataprocMetastore/README.md +++ b/DataprocMetastore/README.md @@ -31,9 +31,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/DataprocMetastore/VERSION b/DataprocMetastore/VERSION index 1a96df19c09a..62d5dbdf3c7a 100644 --- a/DataprocMetastore/VERSION +++ b/DataprocMetastore/VERSION @@ -1 +1 @@ -0.11.3 +0.11.5 diff --git a/DataprocMetastore/composer.json b/DataprocMetastore/composer.json index debbb7382f64..16a5727bc66e 100644 --- a/DataprocMetastore/composer.json +++ b/DataprocMetastore/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/DataprocMetastore/metadata/V1Alpha/Metastore.php b/DataprocMetastore/metadata/V1Alpha/Metastore.php deleted file mode 100644 index f9a994e923079509884445abc6bc578df8e8b461..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17839 zcmcg!TWlLwdJaiTmX0h+KJtZ;;)EW1*OxkEEaytcn~bE9M4KWNl6LAqC^00Dq^U>_ zGc&ZUrfQ26#R6^LcDu+HMGGu8KyN78*P{E-Vu2O`ilXg9fjsTQq7O#j+NZQY`=8s~ zNO?%fu3tf1dm=?)Cx~aFi zySn!z!&oEK(c8rC>J5@!+g#d!@lD;)x7HY!t!2t(i#}yswjSJ6DVN&_HCnoDr`>PR zXDAK-y1jbKXrygNci_LvhFvo{hGXb0<5xhYJLzq`WfP$8AG_V_G#tb1q$xqE(;!!` zr8!SJ_Hx$*9o$LFb!}3$fJ(OV9fw#Qy|uMM?1p7@LDo$en#=7F$5keMa`l>+ma;Rp z(^vT#bGg1n-bp)FkN9U#r!C_2tj=w=Zpz@m{j@beYiifnQac@!YQgN-xtu4H$Ko); z<(5G@&S*5N25B{y$gcj#Fs;!@%S0H?(2FdXogJ&!=@^}ztx}ho>u5r{dk31++FfUV z_yxP9OyCXO-a7(q)c}Kc^mg|Mv>#h~7epRmORM``vbCb`o7;~GIb^xax?lf}A#7P~ zHeJ(Q1!uqN8XGmeE9lG5V<vKmqa(l%9A$isv@L23&XnqGaD%+GB#lKX3ltd>h#Cl{j2(F^DyT&6@bCp+Xn4N87 zCpDIiU7cFICAQ=+6=&9g*o~LVjCB1ad>Wmg5jYhCCX-8vpQ&T`O*GZ82xNg8l_eEt z?B^wWDM!Y&V@j2vRJ|_5Zb6k8j%pc=xAZz`*{Kuh#4u6_ZDb0JO6xe*K7I$C>=5U% zY3-#>GBLglVtk{f(W^9F^&BGB4#s6?;8C{7N8^{#Dbi_nO|bl0&oWXIQV9us3Z3Yh zmXn%Diq6oNmKi?2&%9AeHHxylM9;`*6K(~Je|pKa?qBsJwtb^*=mmSb$| z4X3u#u-RHpd0*$y3CAE-YMM=cW7x^7K!ZO*XQ;u@qzbvvAv-)?rjo#G2&16}LuqNA z6QpNJ}w7de$!`-aOx6&(1ERMCt@T12-=t+A_jI;54F1J23Cx1%`A?JaZi zWlqh#XA_+!orbmFrD;jJ=oz-+H=_7zE+O|%&QU{2VcwG6S;j8X3Wb?-UU(Bt)19nS zd10wc zCu4qbYx2m_ms?vd?21ooj-I(%gXpDI%K8sFQs%llM-7i)) zwdMS3UR#-c34*}Ha#>TW`QqAa3?nqIE?4spwAnaLB2>8#LyIf)y96+w6n_KZ2}*c> zbA=O*(Z5!-g2vd4<4H88mCL2_>`CP|I>DUu44SRxwQ^{7;JKnb& zl{d@ziZ+{2@+cX!Kl~b6D8oEzMXN2ZtHq*L2yp}nmerzKe#oT(k(UY}jiRAb{@ukF z(95uRb%}DSKHLne1ti#bSox>`T&5sDZPKaAv+82JV0~J-sGN%+ax`t*bzix{>kw(gMV3;4r=p+QxdW$q! z#+^|9K8BJ(Li`XVTlyZU$vVdd)23Nd9c=-SJokt!yls|4=RZNX|0!&*&w+0F9cXIt za@3@hA9J&J&PQUY27Gxa7H&q)dz3o}q5m$pBKZY(rT1_z96d(cKMp*AXFli2wq0{`vGV$s>>u<&9VyZr101NZjGV`-3+Qa42idt@vrK4=>{=k_%>PXc zDjq?AKS0Rt)kWzkg5EXOSzSUG59zEbE&=qG;r5Ez64MY~@r5Fp@L4FDT!JYQ->5K! zd~SEBI=+vWb!%c_EAH~p2xU$?ph$jDS(`xGulOnnJUXA9x;}E0or1tEKXWTJ5j33fh{wOlvK0;k%Vm5nTAsVrX90D*b&4v{tOVp-Hhu zp3nwV?s{abms~YQ#eF0Q77cL8KbHqn=b+i z2=S{{$$t{Y`DW0R_KVfBTB~fROeO&S_($ed8*uc0e*?fzcwA7+YZ?HbE(w1ywlo9B z9s<~Hn@!SE{v6P{f?+!%D%fT6X%Bn=zl+AZx&=7D=rpeWOpSk|DmWTXJO|AzoDpyZ z(gZa|?IDKGBgCFN<{s&YiiLeKhsL*!7989Q17;7;q6yP#602679y+~7q`IWG z-VQ)%LRZn)tMa!ofKJ%qp3uK!cy#rHnuR86aE!wQq56;GJLshNf+>G$acB*3dSGmE z>uPF@*PlTvojnH4zaa7bvG zN8CJW&_0E@nvN-d4P7O*(qKL6y4D9F*UB>2x`v0ZY+tC0{ay?$3|zf%wRK-p%xmG1 zn_|(sj^=m|Q3@O{s8i`KcLM$=6gqsXp!_??%>8gM|Ko2N)Ks*X@pTX(_bi~9&;a44 zLqiQ*s}ar$wzLQM; zA77{={VLC_?qY@i!1V}TuSvIwM2R_v5%UzB27|kBQt2jd1>8icDY8&h0Ee98?h)j7 zEX8vrguLLkTg>uaYDnEg7(GFAJn{#Ze?)a09{B$&hR*VySvr^0d>Wk#qXFAy3+fw* z*h2;5re}WnXXq*-v>wl24(Zm94Go3cYAUv<$wR627(#h%4bQAYTPrT2Qx5CLGN}=hJF2#EP|Y6I25UXkn%R?UzT0;#L>^ zh8D21690EK&_x&RUYEktz%z77&OL_YRk{|{T7{Vh@6CyG$obpoOyK-hJg3;Hn2@(I z7~luEh1?|Ddava$-t}%`i3PEQ+>Je*SZi1Zq7#@hx81#bHzORW;-b80Z(})GZc_la>Y8$uoitzbcUdoSL)c=kpP#&dMLt zGauNdDsAejrri4HpfG3%0FQ5x8oR>jHUx17kkt88H#*00I*1TA#RxaR#FYzZVc<%+ z&Xq4>=(0*1XK&N_!GLs{=O7c@lZ1U`w%aEbm~Km){jtsVWK*`Tpl?MijSI2(58vX~ zZve?_P&wFf7yb!YjK9&xk?53vw2*r~@~kIFB-Fa}wJPe#&;Rx3-;3YEH{I7IKI3)f z9T#@I?z<{=-Mb=%p;AR2On@V=H+f^_+K29Xl@GsG*`?wB)lxe=WUbz9uImT*HvtI? zzz{f6bAjP<%@<@e_g(SMxEWIUgVfxo!((eKw1%os=+X%;bm`cpBaYyt{pzd#Qz*)_+@ax_+9C^huw~Y_!K0O zB97SLD`kJM3dl6vMui2+LiqZ-xI|HdYs8WIe+K3=9}&#{5zKeVJM|Ti))DOXnuuxb zAUt#<^tX(050vL&2e~lVgntT390UwSD{&B&G>-@+{?qeP;zCGUH^QNDd$HoVPiXLv zA##A}^{erJ;F@p{0>F{y;=%Dls_uJ1)o~u9$4!a$odf&Ue3Kna)fw)Uc`I8@EiO; z8QnGIIJ=e;Hv#Z}L;K`MJfk(?A3dZds0+TB0`AUrpB6^9gMWj2ry<}3M_$tn5l9`p z6Xm{rbiy4gETC*C>z)@vlwgf?bZE_9zkZOjf@l&AE`T^r2k@8Z(mXI+N)=(_Kjb?b zBISaO9%`8))|4er5hFy_PyL`4Rlyf=c)h3}zKO2W2M`UZjxRwSrDsAhM^s9{Iz~`R zyI+2)n!k*r3(o{yaO8U>&mhfayzo?mA$LZR+Z1(Zv$DuE?de7PAKdbS27Z7uLp?&Gg1XAE8eniMvO45pn&A3Us z-p$x2AM(CS0wVBE^p45OO*SeEE9(2fj&A+7yYO!PtN5#H{5Lwpk97Ecr2~GZgZ9e;@#)~Hst@tz0e*h~PmAop1#;lUKLB#(zNr8Y zy+2@%>a*WU!*32?FJVdGB|pMTjqnZ|eE|O*)W?C!F>hUQe@x*9|D6xt&w|iH6QeQU QCqdXq{?i=?=m4Sr17tNMI{*Lx diff --git a/DataprocMetastore/metadata/V1Alpha/MetastoreFederation.php b/DataprocMetastore/metadata/V1Alpha/MetastoreFederation.php deleted file mode 100644 index aecfb10338b92b16a42435d444a263dc28f74c31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4900 zcmb_g&uyW9N{ znnt;B>aB-fs{R8#R9t%KwTGU{scLUXl{oa&KcVWOZ}!LR#&%>oZBEY2yf<&Y_q}i4 z&PVsGEel=ZRzHOo$9YvZy;i=9UBz)t8|SxgD!R3$#3OPWx5!?aX$bx<2pLKjJC>qi zZnaum2h*0~Dved&VWUJGHpr;&u<`h&NE|L9r0R;}aCByc`bE2lgFnk_>YBX${dZOoD=GIE6xdrr5x%R25VmyoHk z)?izowb$=zAxFhli&An0Dtn%ih*0VZ`uRM%bLf(0F9fE7uLc5D10hs{++65du{2N& z!m&ULau*X5Z9*iu88Rtca5k~P4(Sq33E|XG2@2O=3fJp#;`1g=e7NXbxX70(DDpfe zsSPJ1(W8?=$X!TaxFR|aUExMq3KsA`O(GO47kdgFA!?XqIA(sTn0h0o*;{B@wK0gZ zOl-3gFf+ZF3lAH3fw%;keqxm(R-Oeq8d{}Bvsyuuy3)kDlRd(vV4K^~HU}h9h(j0F zd_&1_?H%?sI=YQ*2LvaZj!*I_Vw;Nk3>z((Qo_kj`a6kZ>{JY#P~~@mP0ym^;My{Q z;<9IJ*`v|UDYlH#L}GFF7>u1*yfMaRo5U`_G>2w@-gig(DMl&7__h>qm0 zqv<3h(Q-z5SncPz}d%(F8mTC50(sFwENqT*fy?7a={bR9b z(5cP3SeN8S4>qe(sj^a$%9*#=XpY*W`fK-s+NP96#1_# ztx5j6BkUAPOSRfYEt4)h{Y&hiOEk$L+)(X~0G&iWW(|8ED&r|uT_?XA{@TmyrW#yU z`Q7N}UcODQcUT(#v&a9zpiJ*6A+kgrv5(OS8jI}iSOM-Q7Vi$@L9btda;^?ucoog; z8(=S>+`3d3H|rZUNv=Ps4geOw6RT^|#{ewASFEf)d?eML0JO7+_2+6EC7C+Or1&2g zG`prbZVZ}J!=HJe_3RRwv=kfEGt`Us-iQ-_i|?`{AwP?zEFiJ$Ks)5CN}8~oVdoI? z$6XUDHA{rU7b1pz8%?$~9a3TYq1Ap$yi7<&OPC{D0vM+VL8s~Gmyu!#08kIpehviZ_$(HHFgz)3rFK-l~4goQo! zn+cTZElYMNn!OfL_~)ZTC;CHyei-oIGq1$E`+BzE!X10 zPW*%l_2DS;hst9iAs6ho08MXs4~M4LVnk?O{vXiHCNK#*S)x8ZBI}FyVrIwdgweUO z51fCXgXk5L;o$UIj0nzG08Ry+3AqCG=)WBZ{ud*A2nr?2W+B0o(V@t#y%MwC=zS$5 zeblP`CJI}wYdM8{{`vFgJ(GFGbGL#QpX-*cxNXz!7GE%khaN8~o&!D{irE1wS|wmq znNRKqMo~FI!`Lz72c$g2*7vGpHJ9iStY&l4$MyXy^rQA#@Q#vrb|Ia-rVe;=@mB^< KBYS8Mp??7jQE?~$ diff --git a/DataprocMetastore/metadata/V1Beta/Metastore.php b/DataprocMetastore/metadata/V1Beta/Metastore.php deleted file mode 100644 index fcb0d46fe424f218e3de0dc671cbea25468717d5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17717 zcmcg!OKclSdLEM2t0YlUNwzuic!qAztRHKWW6jG$+wrtSO6HmpH6-O3FN7tUWJ&Ib z?B;Yg?NJN`*+qaL$sv#3MHWF21ewDoL6S>ONft=9u)&JN3{HmI_?{*(`(Z%!{F^Hu(q?K;$r=3S6-L*`|Y?|$Kqqnm| ztaQ`tboDl|GU;@_oZcwc(uI7nb^%Cjvu8C)F1>4-yKRzfw#{BE+aZo-JEldlk8d>K zv-cpwI3r|e9b$L2CP}YtF0aFomgZ>NYmCYE3T3iQpE4%f4{j{O=UWIh+nQ~s-7nBn zl!kxZUZbry)3&2I@ZX!dUDplW(Y3bz3n0;*^p4iH2~Zy%yVEn8j&2%hN>DbM4}chYiMn^Y;FknN)35X;co+j(L)ExikpZo<%9ZkIT&D(REUSH!fGoxYR4 z%-5L99a`j_v}5&%fA)0RB2LdTZn1S!1_$n^?LJCVyZW|j7$((%Y1p}(CzHqGD8iMt zP7G%_npK^&Tg&8;_E<_+R zmy`*-uGxFXpsnd(?~c~#9)tE1OY4HjLu_enze~3B+P=B-gpeba%dGqQ&*{RJ)mFQt0eoN-^2 z+@+iu*N7=qf>QOm5Vr+YVlb*@G}_i0q;028r4s`PA#{-`F`|OuSo`<`G-eRziD~Vn z#+Ve}04cs!)97`YsCo_&O9#`kGw>+8!AIj)(G)RST@$Rn-m~=7xYR)cPoYy?({fT1 z@Mr{oghptrCMg7eCYP>BUG%r*j9g@u(s1o8qG`qfHqW-TU6Pvg<~omNHOtX=w5C(v zZQ5)pQ{LAfqEn7etkg7{`}!li594_&}<4>&>_1#Ql^r?D%xPEu~1T)-~=Tu zA>7d@D?@_>S%0D%E%QlghVgqlVrlCh;U|m^&!R+6Z>45EVO!`mcf}pe08Mou6x2aA z`eWVMPtCEJK8%`4tbE<&pb7?jH>zmHB5k7Cq~3g_83t*m=7Di?>AeWXa%U@?dW92n zw<)7JVl=J&E=@+#H5b@=vk`0yE*_X-h`)jG6eZl+%yYsK z`d7YCDlj&qcmj2n)2^0K9637 z#jDGdQ|;kqSS=vI`orqSCEzj%DQS~VRhf{<5zax{_<7QF z?CewV=^)!So4jz#K9wI2vNlh4Fiw0rSjK49hmNge2B7FEM?5)pxmi*o`xpXmN zPRfqC*azqo{fx7L+Tz03>g(t=sm`#WPy)q5bBB|}+i3C;w3T&prw-K-bL`2bb8;l)+%p(-0{QL2pMF(yzY zvj<%5!cN~u3w_lTu++nGe$hl{`g080cs^+3Q3XJlC0`n|`uk}1kd7{(^N=n!%f*da zeX~-ol~>Ar;&bg@rMOyy$U2TrtyMNxAUZ!m$J?q*=+x8sNR!5b^ghI<%p9qC-(iV(K{w)FQe$f2RKio4fPWfhGEiN#~u zrt*_GnhsWJ>u910I8Cnuwh!8%J``n&0R~i5M$N<2d33tjgM{3vTP8F>c0G`27Jm|h zB1aJ5y9n96hER!!byrvibrD@SqJyfs1kgf;+bCv8OhGvBi$OBSvluk73{xb&R$&VH z+!lN6)($06A1o)))Z=c`&4J4A$Iwi;mMkGe^Zkx#bu@=bkzBeNVKpHhnUcA?%IK9l zXu|yiFQPN0@>+ehTv=CZhpVenVNG43)fIT}x2ok0@ZLX;p+#Ap9PUA&iDCr}O@(#x zIqfs$o=1gv$+WJ6?9jzP(c!fWtzM^_ z8fE2EE`n{43#3@yb>x8qv&#Nx!#pHw0i4oYOUtW?Fa*IJbXW+2=DNwHNU9rX9P%W` zIw*cH0Lhxf11R#6T#D+YLW=QVfyFQ4UKLLDgd0B9vu=%6uF1&aA~b_v_3l2f4lbUG zVTjQZX5iXBhh{he3k4S6vlRDXI(iM@2ii9B%HiDz8}QFu?UH7O%?iOXrrh*Ir4I*h zIFwpM%LWZeWou)DcWkUHTUjX-^3avV16^5ywsWg$u|)f|+^@%;slO6K+m|{=H7`M} z;_YqGx*Vg4VP_sxyWGWq1D%yVsO!w>4wexbm(P?xOn6SoeH|;%*?`~b2J4yJtWCFt z;dTjduXiAnJAfr|W9CiIQ1;K8n@AGZ{;8P^ZvR}8jA#FN3t?$;bsA|nLczW2*rt|H zwoYI$o{6vyAA0ANLWx<-@-z!oato9nokF9_T63@0eQ_wNKNt-d_3p}G#62_$Aml6d zZ$bghie4L1>|>p^JRDMvN+hDY=Xod;$Z5`)0C)oPyp5G8YK%-m$QKD^MVl~=@Xyp||lHi^jbrK<`7XQl>k)S|C5nE{q3QKPO{G{_y}VI+2<6^)p_~t3lDLAV zbpt{%#mH?qcoqd|6mA`0k|_!fRbT+YJ>{XL^r*nJSgjPl_loivn(~jOnYFk9Kp#Y| zdbRlNFqAigCJUd|Dr&vDt}>AT+v6XZORd9U{?Dl~L0s$^aGnMy4S@B*f+6-P_tD%Mk;;;~dOv`d2~9dOF*lByvQHhZ zmSf6aK?6zcGgyJTPIWirR9WU!SMcDq>`Qg7AH>kPzN;5bw&v@9dG$MN|0^2R;e75P zN`cP>RVqE@PQdkqJ_qj&lz#`2xeNB^fASrJN{W^+zLp{6nfK95Xn^q0K|uws)CfoY zOAwShYJWkG=dXR%&i(e}YxlYDpTywI1H6h?e6BY^*%L@nwCsT#bpc1#j4#!To}&4{ zVuka(kH$o~3Bi!!gi$~+mv+efR7A7jE1XpN$a?`Fky?r@4wb)#vpVh@L4GIFJJ&(T z1#)fy%X_E6R1;zG1kLlHA6)%0wQ+RJ|IZjY%{yf2SyJ(7bSB*T@0e{UY9uC)KlHLP zzsNIi@eo>%=PgI{<|l=L!c8=lT9o0TqhPUqokwaHItX?$GPB+YFpy&D%KDKmxj!NdWZa`JlL#T(M zT@9G%g5B#<6dHJjZo9c>j6Ck;BcRAI@8AVEamcuM3oQgrX2o*~l8X6wFAovDxx94HsH&ZY^s zm-nUTpJUiQyHqXurwNvu5-4_+p1WxFzR`SSnTFY;;D78g(|Sy~iq0P5DDnpgX7`#+ zxQ50!jw=K$eB2|}zT5*j_X+$DqY>!-tbJeOpuCGtho%t=g5yYVIZ$dHE_~@b;C<`{ z9E)Shug1_+!Lm#%&v5}<^dJIm22qDRe(H?i!f!xi0FdTf`N4a{iL&xX^i&6SsYd&_ znkjew1?UU<0Knbbq|UBlx_v;L0U{0l)Q!w>oDM?4Eiu9kFLC8OI@folT;;}}97EP$i#D|tiZ!Ut?~mAhZ5?Aq_4l~MydVx8XAtg8nY^4D|#a==kK z3yhZQJuhRp?}m29&5O$K#=cZ@-UaCF^Dj8NbkeH7QeWkozh?7WW%7S08=2&{l%e-1 zC*cqLJy1aavWQecVDx}0_`Q>=U|!1JjLdrK>7q5Km zk4}Dp2HT>rG+BsOe-oDwX>f%&O7+hHbrvI{*WZKHs@^%Sz^sNh*DE53b%OBEwb0)( zsBI}Pzyfk%ED8SA8vKVBq``9`Rb30mLb6nGy(Tnvz?j&_=nm`f zzu|&!u*Jtwr`*Be1M2O!f_mdTh7Oc0ORV{Vq6%7nIh8#pa+}`5%y7^v6~4 zLQ|CN!QlhS{sWL5Y6d|&w9sFvNtrM?#Kg4lk#ftmk0G=G1u(s6MaBPV3|>?4ut$6& zB9{8bO2G%IWI09!(5A=^_k-EtHqNLmc;Vs}_;Hqc{3BgepYeVCu0^X1C*h6H( z1uHCql$15s^B^p+zBoFNX0Kj7$XP*bh(?qDg|a(Ex47N~)SKQrUxr(o^uqk}`(t+FIIXM4-Z!)J z-aTu}LRa_|Vh~$#NsDjp@a`7jE!%WW)ztZ>*KQM=SIw@a>BKJZd}W<~xL)U_%4+>G zxH_h1tE9+xOtYgCLDfyKC3K0aIId|EVf$tip5qsCo3!XunrRgLNf0uWE^#bHCHzXY z^Z=||imNnM{CJHrjn|-W{dkSXH%sumh>)r)j>EHoWfm6gA|8I0*VHwYcU+iD<*#av ztQnfCDZ2IvEOUu(E4o7<&VJjrXQ(tko;s`>Dw(~`2QjJbRm%iemiQ>aDn$xVYOESA zu?TP3okY-^@{IM*5pxioT; zgUJ!IW%T*iOrv9ahM^gq#<~>}^bl|{7C;T8uI28GJ~eaop?jb>&yL_**Pw@7rE3lL z^+`K_R|_dBwpxsl%h1-dj6;-B*U+~Y(Ve6AGrkyj7JMZrFeNAiN|2ig11pvWVnGQO z=s@mLVxUb~BsW7Eg$Cyn26o7maA-ap8m2y>`IXRIkE<@2tm>iBh0w@XDQIwk(7J|$ zk=(JtAmc7nFSLl3!z|pWM1ev6=W&E$)xu}cF)D;vj^}14N~u?38o!MuRhxh;%hWeJ z1|yRTxk8Xv5C!rou-a3v6!r2fkkHU8HJX=%#&xAhbSHa^Pr)>|qiF`0u@GloSo8fP z!?kztS#*4x*bZn-HXSdd(LlJVsLzPek{KbK?6^PE{n2MC1u>ZDJHe#q(MgDGnLuyZ zv$gE;Xyz0yqcl}ll058$+luZ5wVWu9-QjW?nm%Az3C}dXoAjID zF4iS^^WjESDz7fDN|nrO_#`?}u1R8j_2Ei}!w8Lw<@)MlDKkb#Hmj9jBt`#Kq&3O6 zJBBAvTB_C7YngQM>0e?8U11dt!G=zE3UGiBV$R_E&=yaL>N>)1_|y}0Qw?@0VK;j0 z32nBogK7Mym;Zx9nf_HmW{D=ko9GnFMRs?r0QOT0OG8-DAGW{QrT} z52-}FdPwlJK|XfnM3z(#Cm_K|&j6WJx0I$%AobMjME(&vyFwD+McBQYBuFVlZY0X) ze}%=BeL0S^io*V&c#&8Ltc+4-$VL%IFKxyrOIy87(#rzMjqD_CR z*uSE97omHa&$K~%4?D9AN;lZBMz8UpbYmvwyJ)6DbmEfz*&e;Dl=umB81&r2Hway* zz?TT3ZavvUb~o!cX;_$Llc?P(T#Ye+tOtfNJYUgv!2rReMQzO3m9=zyH}>;!W?{M8uB z^tU4(24ufOl>5bK!HE-Lfqe($zvEtrOM6ahLU;%};B>@XDRJoM>`U=dP>~yPJ0~8Y zF?}q={81`cOlSoD8gS`v>Y=#wJB*0S_x}Sf(+NPrb1PLGAC9$!yNuAWSz&aR>_O&l zI5G4K$WUbZ9Y#dv3qa<5bguuX?tdEM!;>e`EpstLM#mwy_Cm~dqf3;K?9sXGH?gqg zx|UNEgy+wn_YDe)=WYeJI`fvUxNXz!mOkasWjN49O*6O&O4$LbS*5onRqn%kflt&$ za5(Ik@gy6;9ByqJu&+M8y;9AAE46Z+VsE5$M D8bD+< diff --git a/DataprocMetastore/owlbot.py b/DataprocMetastore/owlbot.py index 1681b97bf6c0..7d16d1233b7a 100644 --- a/DataprocMetastore/owlbot.py +++ b/DataprocMetastore/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,34 +32,25 @@ php.owlbot_main(src=src, dest=dest) -# Change the wording for the deprecation warning. +# remove class_alias code s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/DataprocMetastore/src/V1/AlterMetadataResourceLocationRequest.php b/DataprocMetastore/src/V1/AlterMetadataResourceLocationRequest.php index affcd033b6e2..1ac3c96a5ae9 100644 --- a/DataprocMetastore/src/V1/AlterMetadataResourceLocationRequest.php +++ b/DataprocMetastore/src/V1/AlterMetadataResourceLocationRequest.php @@ -23,7 +23,7 @@ class AlterMetadataResourceLocationRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Required. The relative metadata resource name in the following format. * `databases/{database_id}` @@ -34,13 +34,13 @@ class AlterMetadataResourceLocationRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $resource_name = ''; + protected $resource_name = ''; /** * Required. The new location URI for the metadata resource. * * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $location_uri = ''; + protected $location_uri = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/AuxiliaryVersionConfig.php b/DataprocMetastore/src/V1/AuxiliaryVersionConfig.php index 67f9b93ccd0a..f140b4c76616 100644 --- a/DataprocMetastore/src/V1/AuxiliaryVersionConfig.php +++ b/DataprocMetastore/src/V1/AuxiliaryVersionConfig.php @@ -21,7 +21,7 @@ class AuxiliaryVersionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1; */ - private $version = ''; + protected $version = ''; /** * A mapping of Hive metastore configuration key-value pairs to apply to the * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to @@ -38,7 +38,7 @@ class AuxiliaryVersionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $network_config = null; + protected $network_config = null; /** * Constructor. diff --git a/DataprocMetastore/src/V1/BackendMetastore.php b/DataprocMetastore/src/V1/BackendMetastore.php index b3c3eeaeda9c..ec94c364d40e 100644 --- a/DataprocMetastore/src/V1/BackendMetastore.php +++ b/DataprocMetastore/src/V1/BackendMetastore.php @@ -26,13 +26,13 @@ class BackendMetastore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The type of the backend metastore. * * Generated from protobuf field .google.cloud.metastore.v1.BackendMetastore.MetastoreType metastore_type = 2; */ - private $metastore_type = 0; + protected $metastore_type = 0; /** * Constructor. diff --git a/DataprocMetastore/src/V1/BackendMetastore/MetastoreType.php b/DataprocMetastore/src/V1/BackendMetastore/MetastoreType.php index afb63721d036..3ba00a37be90 100644 --- a/DataprocMetastore/src/V1/BackendMetastore/MetastoreType.php +++ b/DataprocMetastore/src/V1/BackendMetastore/MetastoreType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MetastoreType::class, \Google\Cloud\Metastore\V1\BackendMetastore_MetastoreType::class); diff --git a/DataprocMetastore/src/V1/BackendMetastore_MetastoreType.php b/DataprocMetastore/src/V1/BackendMetastore_MetastoreType.php deleted file mode 100644 index 3518a6ccf192..000000000000 --- a/DataprocMetastore/src/V1/BackendMetastore_MetastoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. The time when the backup was started. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the backup finished creating. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The current state of the backup. * * Generated from protobuf field .google.cloud.metastore.v1.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The revision of the service at the time of backup. * * Generated from protobuf field .google.cloud.metastore.v1.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service_revision = null; + protected $service_revision = null; /** * The description of the backup. * * Generated from protobuf field string description = 6; */ - private $description = ''; + protected $description = ''; /** * Output only. Services that are restoring from the backup. * diff --git a/DataprocMetastore/src/V1/Backup/State.php b/DataprocMetastore/src/V1/Backup/State.php index 22fbd2881e27..45636635b4ae 100644 --- a/DataprocMetastore/src/V1/Backup/State.php +++ b/DataprocMetastore/src/V1/Backup/State.php @@ -80,6 +80,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\Backup_State::class); diff --git a/DataprocMetastore/src/V1/Backup_State.php b/DataprocMetastore/src/V1/Backup_State.php deleted file mode 100644 index 7462ccdc0ed1..000000000000 --- a/DataprocMetastore/src/V1/Backup_State.php +++ /dev/null @@ -1,16 +0,0 @@ -descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a backup * resource. @@ -247,8 +266,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted metadata_import resource. */ - public static function metadataImportName(string $project, string $location, string $service, string $metadataImport): string - { + public static function metadataImportName( + string $project, + string $location, + string $service, + string $metadataImport + ): string { return self::getPathTemplate('metadataImport')->render([ 'project' => $project, 'location' => $location, @@ -438,8 +461,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function alterMetadataResourceLocation(AlterMetadataResourceLocationRequest $request, array $callOptions = []): OperationResponse - { + public function alterMetadataResourceLocation( + AlterMetadataResourceLocationRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('AlterMetadataResourceLocation', $request, $callOptions)->wait(); } @@ -491,8 +516,10 @@ public function createBackup(CreateBackupRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function createMetadataImport(CreateMetadataImportRequest $request, array $callOptions = []): OperationResponse - { + public function createMetadataImport( + CreateMetadataImportRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateMetadataImport', $request, $callOptions)->wait(); } @@ -859,8 +886,10 @@ public function restoreService(RestoreServiceRequest $request, array $callOption * * @throws ApiException Thrown if the API call fails. */ - public function updateMetadataImport(UpdateMetadataImportRequest $request, array $callOptions = []): OperationResponse - { + public function updateMetadataImport( + UpdateMetadataImportRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateMetadataImport', $request, $callOptions)->wait(); } @@ -1026,8 +1055,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/DataprocMetastore/src/V1/Client/DataprocMetastoreFederationClient.php b/DataprocMetastore/src/V1/Client/DataprocMetastoreFederationClient.php index bd8f5d296fcd..ac90828d88a2 100644 --- a/DataprocMetastore/src/V1/Client/DataprocMetastoreFederationClient.php +++ b/DataprocMetastore/src/V1/Client/DataprocMetastoreFederationClient.php @@ -1,6 +1,6 @@ [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', ], ], ]; @@ -159,12 +158,33 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a federation * resource. @@ -574,8 +594,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/DataprocMetastore/src/V1/CreateBackupRequest.php b/DataprocMetastore/src/V1/CreateBackupRequest.php index 17fcc678aac9..f94f371f109b 100644 --- a/DataprocMetastore/src/V1/CreateBackupRequest.php +++ b/DataprocMetastore/src/V1/CreateBackupRequest.php @@ -23,7 +23,7 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The ID of the backup, which is used as the final component of the * backup's name. @@ -33,14 +33,14 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $backup_id = ''; + protected $backup_id = ''; /** * Required. The backup to create. The `name` field is ignored. The ID of the * created backup must be provided in the request's `backup_id` field. * * Generated from protobuf field .google.cloud.metastore.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $backup = null; + protected $backup = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -55,7 +55,7 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The relative resource name of the service in which to create a diff --git a/DataprocMetastore/src/V1/CreateFederationRequest.php b/DataprocMetastore/src/V1/CreateFederationRequest.php index 0d8c855ff915..3b708f708665 100644 --- a/DataprocMetastore/src/V1/CreateFederationRequest.php +++ b/DataprocMetastore/src/V1/CreateFederationRequest.php @@ -22,7 +22,7 @@ class CreateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The ID of the metastore federation, which is used as the final * component of the metastore federation's name. @@ -32,7 +32,7 @@ class CreateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $federation_id = ''; + protected $federation_id = ''; /** * Required. The Metastore Federation to create. The `name` field is * ignored. The ID of the created metastore federation must be @@ -40,7 +40,7 @@ class CreateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $federation = null; + protected $federation = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -55,7 +55,7 @@ class CreateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The relative resource name of the location in which to create a diff --git a/DataprocMetastore/src/V1/CreateMetadataImportRequest.php b/DataprocMetastore/src/V1/CreateMetadataImportRequest.php index 0684c436278d..abffe4c45a8b 100644 --- a/DataprocMetastore/src/V1/CreateMetadataImportRequest.php +++ b/DataprocMetastore/src/V1/CreateMetadataImportRequest.php @@ -23,7 +23,7 @@ class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The ID of the metadata import, which is used as the final * component of the metadata import's name. @@ -33,7 +33,7 @@ class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_import_id = ''; + protected $metadata_import_id = ''; /** * Required. The metadata import to create. The `name` field is ignored. The * ID of the created metadata import must be provided in the request's @@ -41,7 +41,7 @@ class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_import = null; + protected $metadata_import = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -56,7 +56,7 @@ class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The relative resource name of the service in which to create a diff --git a/DataprocMetastore/src/V1/CreateServiceRequest.php b/DataprocMetastore/src/V1/CreateServiceRequest.php index ad624625ef70..b762fd7142f0 100644 --- a/DataprocMetastore/src/V1/CreateServiceRequest.php +++ b/DataprocMetastore/src/V1/CreateServiceRequest.php @@ -23,7 +23,7 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The ID of the metastore service, which is used as the final * component of the metastore service's name. @@ -33,7 +33,7 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $service_id = ''; + protected $service_id = ''; /** * Required. The Metastore service to create. The `name` field is * ignored. The ID of the created metastore service must be provided in @@ -41,7 +41,7 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $service = null; + protected $service = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -56,7 +56,7 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The relative resource name of the location in which to create a diff --git a/DataprocMetastore/src/V1/DatabaseDumpSpec/Type.php b/DataprocMetastore/src/V1/DatabaseDumpSpec/Type.php index 2fdb77518f4a..2a7e906d9329 100644 --- a/DataprocMetastore/src/V1/DatabaseDumpSpec/Type.php +++ b/DataprocMetastore/src/V1/DatabaseDumpSpec/Type.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Metastore\V1\DatabaseDumpSpec_Type::class); diff --git a/DataprocMetastore/src/V1/DatabaseDumpSpec_Type.php b/DataprocMetastore/src/V1/DatabaseDumpSpec_Type.php deleted file mode 100644 index 70a010b32128..000000000000 --- a/DataprocMetastore/src/V1/DatabaseDumpSpec_Type.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/ListFederations', - $argument, - ['\Google\Cloud\Metastore\V1\ListFederationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single federation. - * @param \Google\Cloud\Metastore\V1\GetFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFederation(\Google\Cloud\Metastore\V1\GetFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/GetFederation', - $argument, - ['\Google\Cloud\Metastore\V1\Federation', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore federation in a project and location. - * @param \Google\Cloud\Metastore\V1\CreateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateFederation(\Google\Cloud\Metastore\V1\CreateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the fields of a federation. - * @param \Google\Cloud\Metastore\V1\UpdateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateFederation(\Google\Cloud\Metastore\V1\UpdateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/UpdateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single federation. - * @param \Google\Cloud\Metastore\V1\DeleteFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFederation(\Google\Cloud\Metastore\V1\DeleteFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/DeleteFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1/DataprocMetastoreGrpcClient.php b/DataprocMetastore/src/V1/DataprocMetastoreGrpcClient.php deleted file mode 100644 index acae6de26be3..000000000000 --- a/DataprocMetastore/src/V1/DataprocMetastoreGrpcClient.php +++ /dev/null @@ -1,277 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/ListServices', - $argument, - ['\Google\Cloud\Metastore\V1\ListServicesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single service. - * @param \Google\Cloud\Metastore\V1\GetServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetService(\Google\Cloud\Metastore\V1\GetServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/GetService', - $argument, - ['\Google\Cloud\Metastore\V1\Service', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore service in a project and location. - * @param \Google\Cloud\Metastore\V1\CreateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateService(\Google\Cloud\Metastore\V1\CreateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/CreateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single service. - * @param \Google\Cloud\Metastore\V1\UpdateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateService(\Google\Cloud\Metastore\V1\UpdateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/UpdateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single service. - * @param \Google\Cloud\Metastore\V1\DeleteServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteService(\Google\Cloud\Metastore\V1\DeleteServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/DeleteService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists imports in a service. - * @param \Google\Cloud\Metastore\V1\ListMetadataImportsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMetadataImports(\Google\Cloud\Metastore\V1\ListMetadataImportsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/ListMetadataImports', - $argument, - ['\Google\Cloud\Metastore\V1\ListMetadataImportsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single import. - * @param \Google\Cloud\Metastore\V1\GetMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMetadataImport(\Google\Cloud\Metastore\V1\GetMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/GetMetadataImport', - $argument, - ['\Google\Cloud\Metastore\V1\MetadataImport', 'decode'], - $metadata, $options); - } - - /** - * Creates a new MetadataImport in a given project and location. - * @param \Google\Cloud\Metastore\V1\CreateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateMetadataImport(\Google\Cloud\Metastore\V1\CreateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/CreateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * @param \Google\Cloud\Metastore\V1\UpdateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateMetadataImport(\Google\Cloud\Metastore\V1\UpdateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/UpdateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Exports metadata from a service. - * @param \Google\Cloud\Metastore\V1\ExportMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportMetadata(\Google\Cloud\Metastore\V1\ExportMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/ExportMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Restores a service from a backup. - * @param \Google\Cloud\Metastore\V1\RestoreServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestoreService(\Google\Cloud\Metastore\V1\RestoreServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/RestoreService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists backups in a service. - * @param \Google\Cloud\Metastore\V1\ListBackupsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListBackups(\Google\Cloud\Metastore\V1\ListBackupsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/ListBackups', - $argument, - ['\Google\Cloud\Metastore\V1\ListBackupsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single backup. - * @param \Google\Cloud\Metastore\V1\GetBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetBackup(\Google\Cloud\Metastore\V1\GetBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/GetBackup', - $argument, - ['\Google\Cloud\Metastore\V1\Backup', 'decode'], - $metadata, $options); - } - - /** - * Creates a new backup in a given project and location. - * @param \Google\Cloud\Metastore\V1\CreateBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBackup(\Google\Cloud\Metastore\V1\CreateBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/CreateBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single backup. - * @param \Google\Cloud\Metastore\V1\DeleteBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteBackup(\Google\Cloud\Metastore\V1\DeleteBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/DeleteBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1/DeleteBackupRequest.php b/DataprocMetastore/src/V1/DeleteBackupRequest.php index 003d2ad64149..5b641755320f 100644 --- a/DataprocMetastore/src/V1/DeleteBackupRequest.php +++ b/DataprocMetastore/src/V1/DeleteBackupRequest.php @@ -23,7 +23,7 @@ class DeleteBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -38,7 +38,7 @@ class DeleteBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The relative resource name of the backup to delete, in the diff --git a/DataprocMetastore/src/V1/DeleteFederationRequest.php b/DataprocMetastore/src/V1/DeleteFederationRequest.php index 86c453e4495c..5492072ac7b1 100644 --- a/DataprocMetastore/src/V1/DeleteFederationRequest.php +++ b/DataprocMetastore/src/V1/DeleteFederationRequest.php @@ -22,7 +22,7 @@ class DeleteFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -37,7 +37,7 @@ class DeleteFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The relative resource name of the metastore federation to delete, diff --git a/DataprocMetastore/src/V1/DeleteServiceRequest.php b/DataprocMetastore/src/V1/DeleteServiceRequest.php index 0c0af0792bac..971257d0b8fa 100644 --- a/DataprocMetastore/src/V1/DeleteServiceRequest.php +++ b/DataprocMetastore/src/V1/DeleteServiceRequest.php @@ -23,7 +23,7 @@ class DeleteServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -38,7 +38,7 @@ class DeleteServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The relative resource name of the metastore service to delete, in diff --git a/DataprocMetastore/src/V1/EncryptionConfig.php b/DataprocMetastore/src/V1/EncryptionConfig.php index 41fd063d7461..d88c0dcc6ac4 100644 --- a/DataprocMetastore/src/V1/EncryptionConfig.php +++ b/DataprocMetastore/src/V1/EncryptionConfig.php @@ -22,7 +22,7 @@ class EncryptionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key = 1; */ - private $kms_key = ''; + protected $kms_key = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/ExportMetadataRequest.php b/DataprocMetastore/src/V1/ExportMetadataRequest.php index 6fe65734dbe3..68b1e61c213a 100644 --- a/DataprocMetastore/src/V1/ExportMetadataRequest.php +++ b/DataprocMetastore/src/V1/ExportMetadataRequest.php @@ -23,7 +23,7 @@ class ExportMetadataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -38,14 +38,14 @@ class ExportMetadataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. The type of the database dump. If unspecified, defaults to * `MYSQL`. * * Generated from protobuf field .google.cloud.metastore.v1.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $database_dump_type = 0; + protected $database_dump_type = 0; protected $destination; /** diff --git a/DataprocMetastore/src/V1/Federation.php b/DataprocMetastore/src/V1/Federation.php index 1c71ce9344e1..d4f3fbfa8951 100644 --- a/DataprocMetastore/src/V1/Federation.php +++ b/DataprocMetastore/src/V1/Federation.php @@ -22,19 +22,19 @@ class Federation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. The time when the metastore federation was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the metastore federation was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * User-defined labels for the metastore federation. * @@ -47,7 +47,7 @@ class Federation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $version = ''; + protected $version = ''; /** * A map from `BackendMetastore` rank to `BackendMetastore`s from which the * federation service serves metadata at query time. The map key represents @@ -64,27 +64,27 @@ class Federation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $endpoint_uri = ''; + protected $endpoint_uri = ''; /** * Output only. The current state of the federation. * * Generated from protobuf field .google.cloud.metastore.v1.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information about the current state of the * metastore federation, if available. * * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_message = ''; + protected $state_message = ''; /** * Output only. The globally unique resource identifier of the metastore * federation. * * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/Federation/State.php b/DataprocMetastore/src/V1/Federation/State.php index b1fe841ab588..5da5230e50fb 100644 --- a/DataprocMetastore/src/V1/Federation/State.php +++ b/DataprocMetastore/src/V1/Federation/State.php @@ -82,6 +82,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\Federation_State::class); diff --git a/DataprocMetastore/src/V1/Federation_State.php b/DataprocMetastore/src/V1/Federation_State.php deleted file mode 100644 index 7bfea1ad897a..000000000000 --- a/DataprocMetastore/src/V1/Federation_State.php +++ /dev/null @@ -1,16 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Metastore\V1\Client\DataprocMetastoreFederationClient}. - */ -class DataprocMetastoreFederationGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1.DataprocMetastoreFederation'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $federationNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_federation_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', - ], - ], - ]; - } - - private static function getFederationNameTemplate() - { - if (self::$federationNameTemplate == null) { - self::$federationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/federations/{federation}'); - } - - return self::$federationNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'federation' => self::getFederationNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a federation - * resource. - * - * @param string $project - * @param string $location - * @param string $federation - * - * @return string The formatted federation resource. - */ - public static function federationName($project, $location, $federation) - { - return self::getFederationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'federation' => $federation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - federation: projects/{project}/locations/{location}/federations/{federation} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'metastore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a metastore federation in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $federationId Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Federation $federation Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createFederation($parent, $federationId, $federation, array $optionalArgs = []) - { - $request = new CreateFederationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFederationId($federationId); - $request->setFederation($federation); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'deleteFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to delete, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFederation($name, array $optionalArgs = []) - { - $request = new DeleteFederationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the details of a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $response = $dataprocMetastoreFederationClient->getFederation($formattedName); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1\Federation - * - * @throws ApiException if the remote call fails - */ - public function getFederation($name, array $optionalArgs = []) - { - $request = new GetFederationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetFederation', Federation::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists federations in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listFederations($parent, array $optionalArgs = []) - { - $request = new ListFederationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFederations', $optionalArgs, ListFederationsResponse::class, $request); - } - - /** - * Updates the fields of a federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $updateMask = new FieldMask(); - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'updateFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Federation $federation Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateFederation($updateMask, $federation, array $optionalArgs = []) - { - $request = new UpdateFederationRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setFederation($federation); - $requestParamHeaders['federation.name'] = $federation->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $response = $dataprocMetastoreFederationClient->getLocation(); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreFederationClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreFederationClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreFederationClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/DataprocMetastore/src/V1/Gapic/DataprocMetastoreGapicClient.php b/DataprocMetastore/src/V1/Gapic/DataprocMetastoreGapicClient.php deleted file mode 100644 index c4af9dedf73e..000000000000 --- a/DataprocMetastore/src/V1/Gapic/DataprocMetastoreGapicClient.php +++ /dev/null @@ -1,2249 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Metastore\V1\Client\DataprocMetastoreClient}. - */ -class DataprocMetastoreGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1.DataprocMetastore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $backupNameTemplate; - - private static $locationNameTemplate; - - private static $metadataImportNameTemplate; - - private static $networkNameTemplate; - - private static $serviceNameTemplate; - - private static $subnetworkNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_rest_client_config.php', - ], - ], - ]; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getMetadataImportNameTemplate() - { - if (self::$metadataImportNameTemplate == null) { - self::$metadataImportNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import}'); - } - - return self::$metadataImportNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getSubnetworkNameTemplate() - { - if (self::$subnetworkNameTemplate == null) { - self::$subnetworkNameTemplate = new PathTemplate('projects/{project}/regions/{region}/subnetworks/{subnetwork}'); - } - - return self::$subnetworkNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'backup' => self::getBackupNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'metadataImport' => self::getMetadataImportNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'service' => self::getServiceNameTemplate(), - 'subnetwork' => self::getSubnetworkNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $backup - * - * @return string The formatted backup resource. - */ - public static function backupName($project, $location, $service, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * metadata_import resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $metadataImport - * - * @return string The formatted metadata_import resource. - */ - public static function metadataImportName($project, $location, $service, $metadataImport) - { - return self::getMetadataImportNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'metadata_import' => $metadataImport, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName($project, $location, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subnetwork - * resource. - * - * @param string $project - * @param string $region - * @param string $subnetwork - * - * @return string The formatted subnetwork resource. - */ - public static function subnetworkName($project, $region, $subnetwork) - { - return self::getSubnetworkNameTemplate()->render([ - 'project' => $project, - 'region' => $region, - 'subnetwork' => $subnetwork, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - backup: projects/{project}/locations/{location}/services/{service}/backups/{backup} - * - location: projects/{project}/locations/{location} - * - metadataImport: projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import} - * - network: projects/{project}/global/networks/{network} - * - service: projects/{project}/locations/{location}/services/{service} - * - subnetwork: projects/{project}/regions/{region}/subnetworks/{subnetwork} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'metastore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $resourceName Required. The relative metadata resource name in the following format. - * - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @param string $locationUri Required. The new location URI for the metadata resource. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function alterMetadataResourceLocation($service, $resourceName, $locationUri, array $optionalArgs = []) - { - $request = new AlterMetadataResourceLocationRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setResourceName($resourceName); - $request->setLocationUri($locationUri); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('AlterMetadataResourceLocation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new backup in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * backup of the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $backupId Required. The ID of the backup, which is used as the final component of the - * backup's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param Backup $backup Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new MetadataImport in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $metadataImportId = 'metadata_import_id'; - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $metadataImportId Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param MetadataImport $metadataImport Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createMetadataImport($parent, $metadataImportId, $metadataImport, array $optionalArgs = []) - { - $request = new CreateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMetadataImportId($metadataImportId); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a metastore service in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * $serviceId = 'service_id'; - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $serviceId Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Service $service Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createService($parent, $serviceId, $service, array $optionalArgs = []) - { - $request = new CreateServiceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setServiceId($serviceId); - $request->setService($service); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to delete, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to delete, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteService($name, array $optionalArgs = []) - { - $request = new DeleteServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Exports metadata from a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'exportMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * export, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $destinationGcsFolder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $databaseDumpType - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1\DatabaseDumpSpec\Type} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function exportMetadata($service, array $optionalArgs = []) - { - $request = new ExportMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['destinationGcsFolder'])) { - $request->setDestinationGcsFolder($optionalArgs['destinationGcsFolder']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['databaseDumpType'])) { - $request->setDatabaseDumpType($optionalArgs['databaseDumpType']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets details of a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $response = $dataprocMetastoreClient->getBackup($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to retrieve, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1\Backup - * - * @throws ApiException if the remote call fails - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single import. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - * $response = $dataprocMetastoreClient->getMetadataImport($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1\MetadataImport - * - * @throws ApiException if the remote call fails - */ - public function getMetadataImport($name, array $optionalArgs = []) - { - $request = new GetMetadataImportRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetMetadataImport', MetadataImport::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the details of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $response = $dataprocMetastoreClient->getService($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1\Service - * - * @throws ApiException if the remote call fails - */ - public function getService($name, array $optionalArgs = []) - { - $request = new GetServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists backups in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose backups to - * list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists imports in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listMetadataImports($parent, array $optionalArgs = []) - { - $request = new ListMetadataImportsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMetadataImports', $optionalArgs, ListMetadataImportsResponse::class, $request); - } - - /** - * Lists services in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore services - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listServices($parent, array $optionalArgs = []) - { - $request = new ListServicesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); - } - - /** - * Move a table to another database. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $tableName = 'table_name'; - * $dbName = 'db_name'; - * $destinationDbName = 'destination_db_name'; - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'moveTableToDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $tableName Required. The name of the table to be moved. - * @param string $dbName Required. The name of the database where the table resides. - * @param string $destinationDbName Required. The name of the database where the table should be moved. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function moveTableToDatabase($service, $tableName, $dbName, $destinationDbName, array $optionalArgs = []) - { - $request = new MoveTableToDatabaseRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setTableName($tableName); - $request->setDbName($dbName); - $request->setDestinationDbName($destinationDbName); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('MoveTableToDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Query DPMS metadata. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $query = 'query'; - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'queryMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $query Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function queryMetadata($service, $query, array $optionalArgs = []) - { - $request = new QueryMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setQuery($query); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('QueryMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Restores a service from a backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $formattedBackup = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'restoreService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * restore, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $backup Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $restoreType - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1\Restore\RestoreType} - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function restoreService($service, $backup, array $optionalArgs = []) - { - $request = new RestoreServiceRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setBackup($backup); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['restoreType'])) { - $request->setRestoreType($optionalArgs['restoreType']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param MetadataImport $metadataImport Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateMetadataImport($updateMask, $metadataImport, array $optionalArgs = []) - { - $request = new UpdateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['metadata_import.name'] = $metadataImport->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Service $service Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateService($updateMask, $service, array $optionalArgs = []) - { - $request = new UpdateServiceRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setService($service); - $requestParamHeaders['service.name'] = $service->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $response = $dataprocMetastoreClient->getLocation(); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/DataprocMetastore/src/V1/GetBackupRequest.php b/DataprocMetastore/src/V1/GetBackupRequest.php index e87bf62fd7d7..01791735196a 100644 --- a/DataprocMetastore/src/V1/GetBackupRequest.php +++ b/DataprocMetastore/src/V1/GetBackupRequest.php @@ -23,7 +23,7 @@ class GetBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The relative resource name of the backup to retrieve, in the diff --git a/DataprocMetastore/src/V1/GetFederationRequest.php b/DataprocMetastore/src/V1/GetFederationRequest.php index 1dea2ac3c850..d0676d640ec1 100644 --- a/DataprocMetastore/src/V1/GetFederationRequest.php +++ b/DataprocMetastore/src/V1/GetFederationRequest.php @@ -22,7 +22,7 @@ class GetFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The relative resource name of the metastore federation to diff --git a/DataprocMetastore/src/V1/GetMetadataImportRequest.php b/DataprocMetastore/src/V1/GetMetadataImportRequest.php index 846571ef9058..461911cb0d1c 100644 --- a/DataprocMetastore/src/V1/GetMetadataImportRequest.php +++ b/DataprocMetastore/src/V1/GetMetadataImportRequest.php @@ -23,7 +23,7 @@ class GetMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The relative resource name of the metadata import to retrieve, in diff --git a/DataprocMetastore/src/V1/GetServiceRequest.php b/DataprocMetastore/src/V1/GetServiceRequest.php index a9c900447330..23a082ef5699 100644 --- a/DataprocMetastore/src/V1/GetServiceRequest.php +++ b/DataprocMetastore/src/V1/GetServiceRequest.php @@ -23,7 +23,7 @@ class GetServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The relative resource name of the metastore service to retrieve, diff --git a/DataprocMetastore/src/V1/HiveMetastoreConfig.php b/DataprocMetastore/src/V1/HiveMetastoreConfig.php index 78fa67778875..9325b320e61a 100644 --- a/DataprocMetastore/src/V1/HiveMetastoreConfig.php +++ b/DataprocMetastore/src/V1/HiveMetastoreConfig.php @@ -21,7 +21,7 @@ class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $version = ''; + protected $version = ''; /** * A mapping of Hive metastore configuration key-value pairs to apply to the * Hive metastore (configured in `hive-site.xml`). The mappings @@ -41,14 +41,14 @@ class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.KerberosConfig kerberos_config = 3; */ - private $kerberos_config = null; + protected $kerberos_config = null; /** * The protocol to use for the metastore service endpoint. If unspecified, * defaults to `THRIFT`. * * Generated from protobuf field .google.cloud.metastore.v1.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; */ - private $endpoint_protocol = 0; + protected $endpoint_protocol = 0; /** * A mapping of Hive metastore version to the auxiliary version * configuration. When specified, a secondary Hive metastore service is diff --git a/DataprocMetastore/src/V1/HiveMetastoreConfig/EndpointProtocol.php b/DataprocMetastore/src/V1/HiveMetastoreConfig/EndpointProtocol.php index 7546b641a643..e7bc7e788fb9 100644 --- a/DataprocMetastore/src/V1/HiveMetastoreConfig/EndpointProtocol.php +++ b/DataprocMetastore/src/V1/HiveMetastoreConfig/EndpointProtocol.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EndpointProtocol::class, \Google\Cloud\Metastore\V1\HiveMetastoreConfig_EndpointProtocol::class); diff --git a/DataprocMetastore/src/V1/KerberosConfig.php b/DataprocMetastore/src/V1/KerberosConfig.php index 14d8d3a63852..df4b6eb6fc32 100644 --- a/DataprocMetastore/src/V1/KerberosConfig.php +++ b/DataprocMetastore/src/V1/KerberosConfig.php @@ -21,7 +21,7 @@ class KerberosConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Secret keytab = 1; */ - private $keytab = null; + protected $keytab = null; /** * A Kerberos principal that exists in the both the keytab the KDC * to authenticate as. A typical principal is of the form @@ -29,7 +29,7 @@ class KerberosConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string principal = 2; */ - private $principal = ''; + protected $principal = ''; /** * A Cloud Storage URI that specifies the path to a * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, @@ -37,7 +37,7 @@ class KerberosConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string krb5_config_gcs_uri = 3; */ - private $krb5_config_gcs_uri = ''; + protected $krb5_config_gcs_uri = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/ListBackupsRequest.php b/DataprocMetastore/src/V1/ListBackupsRequest.php index b372b70a917b..b73891dd55c0 100644 --- a/DataprocMetastore/src/V1/ListBackupsRequest.php +++ b/DataprocMetastore/src/V1/ListBackupsRequest.php @@ -23,7 +23,7 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of backups to return. The response may contain * less than the maximum number. If unspecified, no more than 500 backups are @@ -31,7 +31,7 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous * [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups] @@ -43,13 +43,13 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter to apply to list results. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Specify the ordering of results as described in [Sorting * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). @@ -57,7 +57,7 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The relative resource name of the service whose backups to diff --git a/DataprocMetastore/src/V1/ListBackupsResponse.php b/DataprocMetastore/src/V1/ListBackupsResponse.php index 4f16d1261b13..d4c62d5e2a3e 100644 --- a/DataprocMetastore/src/V1/ListBackupsResponse.php +++ b/DataprocMetastore/src/V1/ListBackupsResponse.php @@ -28,7 +28,7 @@ class ListBackupsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/DataprocMetastore/src/V1/ListFederationsRequest.php b/DataprocMetastore/src/V1/ListFederationsRequest.php index 8bcb97d635e0..0113d75b1995 100644 --- a/DataprocMetastore/src/V1/ListFederationsRequest.php +++ b/DataprocMetastore/src/V1/ListFederationsRequest.php @@ -22,7 +22,7 @@ class ListFederationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of federations to return. The response may * contain less than the maximum number. If unspecified, no more than 500 @@ -31,7 +31,7 @@ class ListFederationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous ListFederationServices * call. Provide this token to retrieve the subsequent page. @@ -42,13 +42,13 @@ class ListFederationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter to apply to list results. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Specify the ordering of results as described in [Sorting * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). @@ -56,7 +56,7 @@ class ListFederationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The relative resource name of the location of metastore diff --git a/DataprocMetastore/src/V1/ListFederationsResponse.php b/DataprocMetastore/src/V1/ListFederationsResponse.php index e93b6d6a82d8..6b9e36e583ce 100644 --- a/DataprocMetastore/src/V1/ListFederationsResponse.php +++ b/DataprocMetastore/src/V1/ListFederationsResponse.php @@ -27,7 +27,7 @@ class ListFederationsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/DataprocMetastore/src/V1/ListMetadataImportsRequest.php b/DataprocMetastore/src/V1/ListMetadataImportsRequest.php index 894d0ba2c557..582bf2479535 100644 --- a/DataprocMetastore/src/V1/ListMetadataImportsRequest.php +++ b/DataprocMetastore/src/V1/ListMetadataImportsRequest.php @@ -23,7 +23,7 @@ class ListMetadataImportsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of imports to return. The response may contain * less than the maximum number. If unspecified, no more than 500 imports are @@ -31,7 +31,7 @@ class ListMetadataImportsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous * [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices] @@ -43,13 +43,13 @@ class ListMetadataImportsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter to apply to list results. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Specify the ordering of results as described in [Sorting * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). @@ -57,7 +57,7 @@ class ListMetadataImportsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The relative resource name of the service whose metadata imports diff --git a/DataprocMetastore/src/V1/ListMetadataImportsResponse.php b/DataprocMetastore/src/V1/ListMetadataImportsResponse.php index a3dbd6b563b4..361360dd7312 100644 --- a/DataprocMetastore/src/V1/ListMetadataImportsResponse.php +++ b/DataprocMetastore/src/V1/ListMetadataImportsResponse.php @@ -28,7 +28,7 @@ class ListMetadataImportsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/DataprocMetastore/src/V1/ListServicesRequest.php b/DataprocMetastore/src/V1/ListServicesRequest.php index 163ff6277be1..3821776ec78d 100644 --- a/DataprocMetastore/src/V1/ListServicesRequest.php +++ b/DataprocMetastore/src/V1/ListServicesRequest.php @@ -23,7 +23,7 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of services to return. The response may * contain less than the maximum number. If unspecified, no more than 500 @@ -32,7 +32,7 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous * [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices] @@ -44,13 +44,13 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter to apply to list results. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Specify the ordering of results as described in [Sorting * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). @@ -58,7 +58,7 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The relative resource name of the location of metastore services diff --git a/DataprocMetastore/src/V1/ListServicesResponse.php b/DataprocMetastore/src/V1/ListServicesResponse.php index 5555877b7cbb..40a31f47a158 100644 --- a/DataprocMetastore/src/V1/ListServicesResponse.php +++ b/DataprocMetastore/src/V1/ListServicesResponse.php @@ -28,7 +28,7 @@ class ListServicesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/DataprocMetastore/src/V1/LocationMetadata/HiveMetastoreVersion.php b/DataprocMetastore/src/V1/LocationMetadata/HiveMetastoreVersion.php index 0b2dd521741f..8e4fd426d2bc 100644 --- a/DataprocMetastore/src/V1/LocationMetadata/HiveMetastoreVersion.php +++ b/DataprocMetastore/src/V1/LocationMetadata/HiveMetastoreVersion.php @@ -20,14 +20,14 @@ class HiveMetastoreVersion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1; */ - private $version = ''; + protected $version = ''; /** * Whether `version` will be chosen by the server if a metastore service is * created with a `HiveMetastoreConfig` that omits the `version`. * * Generated from protobuf field bool is_default = 2; */ - private $is_default = false; + protected $is_default = false; /** * Constructor. @@ -103,6 +103,4 @@ public function setIsDefault($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HiveMetastoreVersion::class, \Google\Cloud\Metastore\V1\LocationMetadata_HiveMetastoreVersion::class); diff --git a/DataprocMetastore/src/V1/LocationMetadata_HiveMetastoreVersion.php b/DataprocMetastore/src/V1/LocationMetadata_HiveMetastoreVersion.php deleted file mode 100644 index 994176f24a38..000000000000 --- a/DataprocMetastore/src/V1/LocationMetadata_HiveMetastoreVersion.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.protobuf.Int32Value hour_of_day = 1; */ - private $hour_of_day = null; + protected $hour_of_day = null; /** * The day of week, when the window starts. * * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; */ - private $day_of_week = 0; + protected $day_of_week = 0; /** * Constructor. @@ -75,7 +75,7 @@ public function clearHourOfDay() * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; * @return int|null */ - public function getHourOfDayValue() + public function getHourOfDayUnwrapped() { return $this->readWrapperValue("hour_of_day"); } @@ -104,7 +104,7 @@ public function setHourOfDay($var) * @param int|null $var * @return $this */ - public function setHourOfDayValue($var) + public function setHourOfDayUnwrapped($var) { $this->writeWrapperValue("hour_of_day", $var); return $this;} diff --git a/DataprocMetastore/src/V1/MetadataExport.php b/DataprocMetastore/src/V1/MetadataExport.php index db491f3ba2c2..b8d76e8d94d4 100644 --- a/DataprocMetastore/src/V1/MetadataExport.php +++ b/DataprocMetastore/src/V1/MetadataExport.php @@ -20,25 +20,25 @@ class MetadataExport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The time when the export ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The current state of the export. * * Generated from protobuf field .google.cloud.metastore.v1.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The type of the database dump. * * Generated from protobuf field .google.cloud.metastore.v1.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $database_dump_type = 0; + protected $database_dump_type = 0; protected $destination; /** diff --git a/DataprocMetastore/src/V1/MetadataExport/State.php b/DataprocMetastore/src/V1/MetadataExport/State.php index 9edc49059ec8..c11f67106efb 100644 --- a/DataprocMetastore/src/V1/MetadataExport/State.php +++ b/DataprocMetastore/src/V1/MetadataExport/State.php @@ -73,6 +73,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\MetadataExport_State::class); diff --git a/DataprocMetastore/src/V1/MetadataExport_State.php b/DataprocMetastore/src/V1/MetadataExport_State.php deleted file mode 100644 index 63f4f02e36c9..000000000000 --- a/DataprocMetastore/src/V1/MetadataExport_State.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * The description of the metadata import. * * Generated from protobuf field string description = 2; */ - private $description = ''; + protected $description = ''; /** * Output only. The time when the metadata import was started. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the metadata import was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. The time when the metadata import finished. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The current state of the metadata import. * * Generated from protobuf field .google.cloud.metastore.v1.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; protected $metadata; /** diff --git a/DataprocMetastore/src/V1/MetadataImport/DatabaseDump.php b/DataprocMetastore/src/V1/MetadataImport/DatabaseDump.php index af4f7b1256ca..d7ffcbed89bb 100644 --- a/DataprocMetastore/src/V1/MetadataImport/DatabaseDump.php +++ b/DataprocMetastore/src/V1/MetadataImport/DatabaseDump.php @@ -29,7 +29,7 @@ class DatabaseDump extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string gcs_uri = 2; */ - private $gcs_uri = ''; + protected $gcs_uri = ''; /** * The name of the source database. * @@ -43,7 +43,7 @@ class DatabaseDump extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type = 0; + protected $type = 0; /** * Constructor. @@ -186,6 +186,4 @@ public function setType($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseDump::class, \Google\Cloud\Metastore\V1\MetadataImport_DatabaseDump::class); diff --git a/DataprocMetastore/src/V1/MetadataImport/DatabaseDump/DatabaseType.php b/DataprocMetastore/src/V1/MetadataImport/DatabaseDump/DatabaseType.php index c5d6380893d5..71bbe9170c24 100644 --- a/DataprocMetastore/src/V1/MetadataImport/DatabaseDump/DatabaseType.php +++ b/DataprocMetastore/src/V1/MetadataImport/DatabaseDump/DatabaseType.php @@ -52,6 +52,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1\MetadataImport_DatabaseDump_DatabaseType::class); diff --git a/DataprocMetastore/src/V1/MetadataImport/State.php b/DataprocMetastore/src/V1/MetadataImport/State.php index 627621ca37c4..92f4ca27323a 100644 --- a/DataprocMetastore/src/V1/MetadataImport/State.php +++ b/DataprocMetastore/src/V1/MetadataImport/State.php @@ -74,6 +74,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\MetadataImport_State::class); diff --git a/DataprocMetastore/src/V1/MetadataImport_DatabaseDump.php b/DataprocMetastore/src/V1/MetadataImport_DatabaseDump.php deleted file mode 100644 index 1bb1a36d043c..000000000000 --- a/DataprocMetastore/src/V1/MetadataImport_DatabaseDump.php +++ /dev/null @@ -1,16 +0,0 @@ -string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Required. The name of the table to be moved. * * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $table_name = ''; + protected $table_name = ''; /** * Required. The name of the database where the table resides. * * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $db_name = ''; + protected $db_name = ''; /** * Required. The name of the database where the table should be moved. * * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $destination_db_name = ''; + protected $destination_db_name = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/NetworkConfig/Consumer.php b/DataprocMetastore/src/V1/NetworkConfig/Consumer.php index 16fdd15d68a7..453cd57831fb 100644 --- a/DataprocMetastore/src/V1/NetworkConfig/Consumer.php +++ b/DataprocMetastore/src/V1/NetworkConfig/Consumer.php @@ -22,14 +22,14 @@ class Consumer extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $endpoint_uri = ''; + protected $endpoint_uri = ''; /** * Output only. The location of the endpoint URI. Format: * `projects/{project}/locations/{location}`. * * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $endpoint_location = ''; + protected $endpoint_location = ''; protected $vpc_resource; /** @@ -168,6 +168,4 @@ public function getVpcResource() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Consumer::class, \Google\Cloud\Metastore\V1\NetworkConfig_Consumer::class); diff --git a/DataprocMetastore/src/V1/NetworkConfig_Consumer.php b/DataprocMetastore/src/V1/NetworkConfig_Consumer.php deleted file mode 100644 index 61b9d2e4b17d..000000000000 --- a/DataprocMetastore/src/V1/NetworkConfig_Consumer.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $status_message = ''; + protected $status_message = ''; /** * Output only. Identifies whether the caller has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -54,13 +54,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/QueryMetadataRequest.php b/DataprocMetastore/src/V1/QueryMetadataRequest.php index 036b4b547420..337201d6f6da 100644 --- a/DataprocMetastore/src/V1/QueryMetadataRequest.php +++ b/DataprocMetastore/src/V1/QueryMetadataRequest.php @@ -23,14 +23,14 @@ class QueryMetadataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Required. A read-only SQL query to execute against the metadata database. * The query cannot change or mutate the data. * * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $query = ''; + protected $query = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/QueryMetadataResponse.php b/DataprocMetastore/src/V1/QueryMetadataResponse.php index a8f1723f7d6d..11e35e46da09 100644 --- a/DataprocMetastore/src/V1/QueryMetadataResponse.php +++ b/DataprocMetastore/src/V1/QueryMetadataResponse.php @@ -24,7 +24,7 @@ class QueryMetadataResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string result_manifest_uri = 1; */ - private $result_manifest_uri = ''; + protected $result_manifest_uri = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/Restore.php b/DataprocMetastore/src/V1/Restore.php index d2dde8afcb9f..40f6b3f7dfa7 100644 --- a/DataprocMetastore/src/V1/Restore.php +++ b/DataprocMetastore/src/V1/Restore.php @@ -20,19 +20,19 @@ class Restore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The time when the restore ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The current state of the restore. * * Generated from protobuf field .google.cloud.metastore.v1.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The relative resource name of the metastore service backup to * restore from, in the following form: @@ -40,20 +40,20 @@ class Restore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $backup = ''; + protected $backup = ''; /** * Output only. The type of restore. * * Generated from protobuf field .google.cloud.metastore.v1.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $type = 0; + protected $type = 0; /** * Output only. The restore details containing the revision of the service to * be restored to, in format of JSON. * * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $details = ''; + protected $details = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/Restore/RestoreType.php b/DataprocMetastore/src/V1/Restore/RestoreType.php index 1dbf9a631af0..44eac3e4e89d 100644 --- a/DataprocMetastore/src/V1/Restore/RestoreType.php +++ b/DataprocMetastore/src/V1/Restore/RestoreType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestoreType::class, \Google\Cloud\Metastore\V1\Restore_RestoreType::class); diff --git a/DataprocMetastore/src/V1/Restore/State.php b/DataprocMetastore/src/V1/Restore/State.php index e00016549808..bf986d929626 100644 --- a/DataprocMetastore/src/V1/Restore/State.php +++ b/DataprocMetastore/src/V1/Restore/State.php @@ -73,6 +73,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\Restore_State::class); diff --git a/DataprocMetastore/src/V1/RestoreServiceRequest.php b/DataprocMetastore/src/V1/RestoreServiceRequest.php index e659f8a96f64..b55b901f0c82 100644 --- a/DataprocMetastore/src/V1/RestoreServiceRequest.php +++ b/DataprocMetastore/src/V1/RestoreServiceRequest.php @@ -22,7 +22,7 @@ class RestoreServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Required. The relative resource name of the metastore service backup to * restore from, in the following form: @@ -30,13 +30,13 @@ class RestoreServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $backup = ''; + protected $backup = ''; /** * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. * * Generated from protobuf field .google.cloud.metastore.v1.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $restore_type = 0; + protected $restore_type = 0; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -51,7 +51,7 @@ class RestoreServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $service Required. The relative resource name of the metastore service to run diff --git a/DataprocMetastore/src/V1/Restore_RestoreType.php b/DataprocMetastore/src/V1/Restore_RestoreType.php deleted file mode 100644 index 27fe199ac673..000000000000 --- a/DataprocMetastore/src/V1/Restore_RestoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. The time when the metastore service was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the metastore service was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * User-defined labels for the metastore service. * @@ -48,45 +48,45 @@ class Service extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $network = ''; + protected $network = ''; /** * Output only. The URI of the endpoint used to access the metastore service. * * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $endpoint_uri = ''; + protected $endpoint_uri = ''; /** * The TCP port at which the metastore service is reached. Default: 9083. * * Generated from protobuf field int32 port = 9; */ - private $port = 0; + protected $port = 0; /** * Output only. The current state of the metastore service. * * Generated from protobuf field .google.cloud.metastore.v1.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information about the current state of the * metastore service, if available. * * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_message = ''; + protected $state_message = ''; /** * Output only. A Cloud Storage URI (starting with `gs://`) that specifies * where artifacts related to the metastore service are stored. * * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $artifact_gcs_uri = ''; + protected $artifact_gcs_uri = ''; /** * The tier of the service. * * Generated from protobuf field .google.cloud.metastore.v1.Service.Tier tier = 13; */ - private $tier = 0; + protected $tier = 0; /** * The one hour maintenance window of the metastore service. This specifies * when the service can be restarted for maintenance purposes in UTC time. @@ -95,60 +95,60 @@ class Service extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.MaintenanceWindow maintenance_window = 15; */ - private $maintenance_window = null; + protected $maintenance_window = null; /** * Output only. The globally unique resource identifier of the metastore * service. * * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The metadata management activities of the metastore service. * * Generated from protobuf field .google.cloud.metastore.v1.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata_management_activity = null; + protected $metadata_management_activity = null; /** * Immutable. The release channel of the service. * If unspecified, defaults to `STABLE`. * * Generated from protobuf field .google.cloud.metastore.v1.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $release_channel = 0; + protected $release_channel = 0; /** * Immutable. Information used to configure the Dataproc Metastore service to * encrypt customer data at rest. Cannot be updated. * * Generated from protobuf field .google.cloud.metastore.v1.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $encryption_config = null; + protected $encryption_config = null; /** * The configuration specifying the network settings for the * Dataproc Metastore service. * * Generated from protobuf field .google.cloud.metastore.v1.NetworkConfig network_config = 21; */ - private $network_config = null; + protected $network_config = null; /** * Immutable. The database type that the Metastore service stores its data. * * Generated from protobuf field .google.cloud.metastore.v1.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $database_type = 0; + protected $database_type = 0; /** * The configuration specifying telemetry settings for the Dataproc Metastore * service. If unspecified defaults to `JSON`. * * Generated from protobuf field .google.cloud.metastore.v1.TelemetryConfig telemetry_config = 23; */ - private $telemetry_config = null; + protected $telemetry_config = null; /** * Scaling configuration of the metastore service. * * Generated from protobuf field .google.cloud.metastore.v1.ScalingConfig scaling_config = 24; */ - private $scaling_config = null; + protected $scaling_config = null; protected $metastore_config; /** diff --git a/DataprocMetastore/src/V1/Service/DatabaseType.php b/DataprocMetastore/src/V1/Service/DatabaseType.php index 825ddf6b0f47..6787a36a639c 100644 --- a/DataprocMetastore/src/V1/Service/DatabaseType.php +++ b/DataprocMetastore/src/V1/Service/DatabaseType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1\Service_DatabaseType::class); diff --git a/DataprocMetastore/src/V1/Service/ReleaseChannel.php b/DataprocMetastore/src/V1/Service/ReleaseChannel.php index 5f79d822e3bc..0128ee6e06f6 100644 --- a/DataprocMetastore/src/V1/Service/ReleaseChannel.php +++ b/DataprocMetastore/src/V1/Service/ReleaseChannel.php @@ -64,6 +64,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReleaseChannel::class, \Google\Cloud\Metastore\V1\Service_ReleaseChannel::class); diff --git a/DataprocMetastore/src/V1/Service/State.php b/DataprocMetastore/src/V1/Service/State.php index 335f72a766a0..23b211c337f4 100644 --- a/DataprocMetastore/src/V1/Service/State.php +++ b/DataprocMetastore/src/V1/Service/State.php @@ -97,6 +97,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\Service_State::class); diff --git a/DataprocMetastore/src/V1/Service/Tier.php b/DataprocMetastore/src/V1/Service/Tier.php index 6603ae6a7018..ec3684080fef 100644 --- a/DataprocMetastore/src/V1/Service/Tier.php +++ b/DataprocMetastore/src/V1/Service/Tier.php @@ -61,6 +61,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Tier::class, \Google\Cloud\Metastore\V1\Service_Tier::class); diff --git a/DataprocMetastore/src/V1/Service_DatabaseType.php b/DataprocMetastore/src/V1/Service_DatabaseType.php deleted file mode 100644 index 9c1862ff86e4..000000000000 --- a/DataprocMetastore/src/V1/Service_DatabaseType.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.cloud.metastore.v1.TelemetryConfig.LogFormat log_format = 1; */ - private $log_format = 0; + protected $log_format = 0; /** * Constructor. diff --git a/DataprocMetastore/src/V1/TelemetryConfig/LogFormat.php b/DataprocMetastore/src/V1/TelemetryConfig/LogFormat.php index 071414412d7d..c13084d10f0e 100644 --- a/DataprocMetastore/src/V1/TelemetryConfig/LogFormat.php +++ b/DataprocMetastore/src/V1/TelemetryConfig/LogFormat.php @@ -57,6 +57,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LogFormat::class, \Google\Cloud\Metastore\V1\TelemetryConfig_LogFormat::class); diff --git a/DataprocMetastore/src/V1/TelemetryConfig_LogFormat.php b/DataprocMetastore/src/V1/TelemetryConfig_LogFormat.php deleted file mode 100644 index bdf4a24eb0f3..000000000000 --- a/DataprocMetastore/src/V1/TelemetryConfig_LogFormat.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The metastore federation to update. The server only merges fields * in the service if they are specified in `update_mask`. @@ -32,7 +32,7 @@ class UpdateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $federation = null; + protected $federation = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -47,7 +47,7 @@ class UpdateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\Metastore\V1\Federation $federation Required. The metastore federation to update. The server only merges fields diff --git a/DataprocMetastore/src/V1/UpdateMetadataImportRequest.php b/DataprocMetastore/src/V1/UpdateMetadataImportRequest.php index 397fbcf178ca..0779fd76ed43 100644 --- a/DataprocMetastore/src/V1/UpdateMetadataImportRequest.php +++ b/DataprocMetastore/src/V1/UpdateMetadataImportRequest.php @@ -24,7 +24,7 @@ class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The metadata import to update. The server only merges fields * in the import if they are specified in `update_mask`. @@ -33,7 +33,7 @@ class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_import = null; + protected $metadata_import = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -48,7 +48,7 @@ class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\Metastore\V1\MetadataImport $metadataImport Required. The metadata import to update. The server only merges fields diff --git a/DataprocMetastore/src/V1/UpdateServiceRequest.php b/DataprocMetastore/src/V1/UpdateServiceRequest.php index d72f4db8e444..c5723944ac75 100644 --- a/DataprocMetastore/src/V1/UpdateServiceRequest.php +++ b/DataprocMetastore/src/V1/UpdateServiceRequest.php @@ -24,7 +24,7 @@ class UpdateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The metastore service to update. The server only merges fields * in the service if they are specified in `update_mask`. @@ -33,7 +33,7 @@ class UpdateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $service = null; + protected $service = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -48,7 +48,7 @@ class UpdateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\Metastore\V1\Service $service Required. The metastore service to update. The server only merges fields diff --git a/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationRequest.php b/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationRequest.php deleted file mode 100644 index 390e7546d29c..000000000000 --- a/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationRequest.php +++ /dev/null @@ -1,164 +0,0 @@ -google.cloud.metastore.v1alpha.AlterMetadataResourceLocationRequest - */ -class AlterMetadataResourceLocationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $resource_name = ''; - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $location_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $resource_name - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @type string $location_uri - * Required. The new location URI for the metadata resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getResourceName() - { - return $this->resource_name; - } - - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setResourceName($var) - { - GPBUtil::checkString($var, True); - $this->resource_name = $var; - - return $this; - } - - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLocationUri() - { - return $this->location_uri; - } - - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLocationUri($var) - { - GPBUtil::checkString($var, True); - $this->location_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationResponse.php b/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationResponse.php deleted file mode 100644 index 3ee73fba1b82..000000000000 --- a/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.metastore.v1alpha.AlterMetadataResourceLocationResponse - */ -class AlterMetadataResourceLocationResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php b/DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php deleted file mode 100644 index aa05e45a591c..000000000000 --- a/DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php +++ /dev/null @@ -1,169 +0,0 @@ -google.cloud.metastore.v1alpha.AuxiliaryVersionConfig - */ -class AuxiliaryVersionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - */ - private $version = ''; - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - */ - private $config_overrides; - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $network_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * @type array|\Google\Protobuf\Internal\MapField $config_overrides - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * @type \Google\Cloud\Metastore\V1alpha\NetworkConfig $network_config - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getConfigOverrides() - { - return $this->config_overrides; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setConfigOverrides($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->config_overrides = $arr; - - return $this; - } - - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1alpha\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1alpha\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/BackendMetastore.php b/DataprocMetastore/src/V1alpha/BackendMetastore.php deleted file mode 100644 index d8054fdee8f2..000000000000 --- a/DataprocMetastore/src/V1alpha/BackendMetastore.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.metastore.v1alpha.BackendMetastore - */ -class BackendMetastore extends \Google\Protobuf\Internal\Message -{ - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.BackendMetastore.MetastoreType metastore_type = 2; - */ - private $metastore_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * @type int $metastore_type - * The type of the backend metastore. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.BackendMetastore.MetastoreType metastore_type = 2; - * @return int - */ - public function getMetastoreType() - { - return $this->metastore_type; - } - - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.BackendMetastore.MetastoreType metastore_type = 2; - * @param int $var - * @return $this - */ - public function setMetastoreType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\BackendMetastore\MetastoreType::class); - $this->metastore_type = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/BackendMetastore/MetastoreType.php b/DataprocMetastore/src/V1alpha/BackendMetastore/MetastoreType.php deleted file mode 100644 index 1c3e2acf3e60..000000000000 --- a/DataprocMetastore/src/V1alpha/BackendMetastore/MetastoreType.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.metastore.v1alpha.BackendMetastore.MetastoreType - */ -class MetastoreType -{ - /** - * The metastore type is not set. - * - * Generated from protobuf enum METASTORE_TYPE_UNSPECIFIED = 0; - */ - const METASTORE_TYPE_UNSPECIFIED = 0; - /** - * The backend metastore is Dataplex. - * - * Generated from protobuf enum DATAPLEX = 1; - */ - const DATAPLEX = 1; - /** - * The backend metastore is BigQuery. - * - * Generated from protobuf enum BIGQUERY = 2; - */ - const BIGQUERY = 2; - /** - * The backend metastore is Dataproc Metastore. - * - * Generated from protobuf enum DATAPROC_METASTORE = 3; - */ - const DATAPROC_METASTORE = 3; - - private static $valueToName = [ - self::METASTORE_TYPE_UNSPECIFIED => 'METASTORE_TYPE_UNSPECIFIED', - self::DATAPLEX => 'DATAPLEX', - self::BIGQUERY => 'BIGQUERY', - self::DATAPROC_METASTORE => 'DATAPROC_METASTORE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MetastoreType::class, \Google\Cloud\Metastore\V1alpha\BackendMetastore_MetastoreType::class); - diff --git a/DataprocMetastore/src/V1alpha/BackendMetastore_MetastoreType.php b/DataprocMetastore/src/V1alpha/BackendMetastore_MetastoreType.php deleted file mode 100644 index 4b4a8d510fb7..000000000000 --- a/DataprocMetastore/src/V1alpha/BackendMetastore_MetastoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.Backup - */ -class Backup extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $service_revision = null; - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - */ - private $description = ''; - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $restoring_services; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the backup was started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the backup finished creating. - * @type int $state - * Output only. The current state of the backup. - * @type \Google\Cloud\Metastore\V1alpha\Service $service_revision - * Output only. The revision of the service at the time of backup. - * @type string $description - * The description of the backup. - * @type array|\Google\Protobuf\Internal\RepeatedField $restoring_services - * Output only. Services that are restoring from the backup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Backup\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1alpha\Service|null - */ - public function getServiceRevision() - { - return $this->service_revision; - } - - public function hasServiceRevision() - { - return isset($this->service_revision); - } - - public function clearServiceRevision() - { - unset($this->service_revision); - } - - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1alpha\Service $var - * @return $this - */ - public function setServiceRevision($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Service::class); - $this->service_revision = $var; - - return $this; - } - - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestoringServices() - { - return $this->restoring_services; - } - - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestoringServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->restoring_services = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Backup/State.php b/DataprocMetastore/src/V1alpha/Backup/State.php deleted file mode 100644 index d5770f420c45..000000000000 --- a/DataprocMetastore/src/V1alpha/Backup/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.metastore.v1alpha.Backup.State - */ -class State -{ - /** - * The state of the backup is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The backup is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The backup is being deleted. - * - * Generated from protobuf enum DELETING = 2; - */ - const DELETING = 2; - /** - * The backup is active and ready to use. - * - * Generated from protobuf enum ACTIVE = 3; - */ - const ACTIVE = 3; - /** - * The backup failed. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * The backup is being restored. - * - * Generated from protobuf enum RESTORING = 5; - */ - const RESTORING = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::ACTIVE => 'ACTIVE', - self::FAILED => 'FAILED', - self::RESTORING => 'RESTORING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\Backup_State::class); - diff --git a/DataprocMetastore/src/V1alpha/Backup_State.php b/DataprocMetastore/src/V1alpha/Backup_State.php deleted file mode 100644 index a4605ecd27d9..000000000000 --- a/DataprocMetastore/src/V1alpha/Backup_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.CreateBackupRequest - */ -class CreateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $backup_id = ''; - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $backup = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $backup_id - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @type \Google\Cloud\Metastore\V1alpha\Backup $backup - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBackupId() - { - return $this->backup_id; - } - - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBackupId($var) - { - GPBUtil::checkString($var, True); - $this->backup_id = $var; - - return $this; - } - - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Backup::class); - $this->backup = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/CreateFederationRequest.php b/DataprocMetastore/src/V1alpha/CreateFederationRequest.php deleted file mode 100644 index e234f75d1699..000000000000 --- a/DataprocMetastore/src/V1alpha/CreateFederationRequest.php +++ /dev/null @@ -1,247 +0,0 @@ -google.cloud.metastore.v1alpha.CreateFederationRequest - */ -class CreateFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation_id = ''; - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type string $federation_id - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @type \Google\Cloud\Metastore\V1alpha\Federation $federation - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFederationId() - { - return $this->federation_id; - } - - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFederationId($var) - { - GPBUtil::checkString($var, True); - $this->federation_id = $var; - - return $this; - } - - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Federation|null - */ - public function getFederation() - { - return $this->federation; - } - - public function hasFederation() - { - return isset($this->federation); - } - - public function clearFederation() - { - unset($this->federation); - } - - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Federation $var - * @return $this - */ - public function setFederation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Federation::class); - $this->federation = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php b/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php deleted file mode 100644 index 517bdd1f0d8b..000000000000 --- a/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php +++ /dev/null @@ -1,248 +0,0 @@ -google.cloud.metastore.v1alpha.CreateMetadataImportRequest - */ -class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import_id = ''; - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $metadata_import_id - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @type \Google\Cloud\Metastore\V1alpha\MetadataImport $metadata_import - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getMetadataImportId() - { - return $this->metadata_import_id; - } - - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setMetadataImportId($var) - { - GPBUtil::checkString($var, True); - $this->metadata_import_id = $var; - - return $this; - } - - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\MetadataImport|null - */ - public function getMetadataImport() - { - return $this->metadata_import; - } - - public function hasMetadataImport() - { - return isset($this->metadata_import); - } - - public function clearMetadataImport() - { - unset($this->metadata_import); - } - - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\MetadataImport $var - * @return $this - */ - public function setMetadataImport($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataImport::class); - $this->metadata_import = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/CreateServiceRequest.php b/DataprocMetastore/src/V1alpha/CreateServiceRequest.php deleted file mode 100644 index 5bebc1180c80..000000000000 --- a/DataprocMetastore/src/V1alpha/CreateServiceRequest.php +++ /dev/null @@ -1,248 +0,0 @@ -google.cloud.metastore.v1alpha.CreateServiceRequest - */ -class CreateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service_id = ''; - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type string $service_id - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @type \Google\Cloud\Metastore\V1alpha\Service $service - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getServiceId() - { - return $this->service_id; - } - - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setServiceId($var) - { - GPBUtil::checkString($var, True); - $this->service_id = $var; - - return $this; - } - - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DataCatalogConfig.php b/DataprocMetastore/src/V1alpha/DataCatalogConfig.php deleted file mode 100644 index 9472d9fff569..000000000000 --- a/DataprocMetastore/src/V1alpha/DataCatalogConfig.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.metastore.v1alpha.DataCatalogConfig - */ -class DataCatalogConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - */ - private $enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $enabled - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - * @return bool - */ - public function getEnabled() - { - return $this->enabled; - } - - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec.php b/DataprocMetastore/src/V1alpha/DatabaseDumpSpec.php deleted file mode 100644 index 775ad2d5ca0c..000000000000 --- a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.metastore.v1alpha.DatabaseDumpSpec - */ -class DatabaseDumpSpec extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php b/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php deleted file mode 100644 index 290359f1c193..000000000000 --- a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type - */ -class Type -{ - /** - * The type of the database dump is unknown. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * Database dump is a MySQL dump file. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - /** - * Database dump contains Avro files. - * - * Generated from protobuf enum AVRO = 2; - */ - const AVRO = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - self::AVRO => 'AVRO', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec_Type::class); - diff --git a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec_Type.php b/DataprocMetastore/src/V1alpha/DatabaseDumpSpec_Type.php deleted file mode 100644 index 32604ee347fc..000000000000 --- a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec_Type.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.DataplexConfig - */ -class DataplexConfig extends \Google\Protobuf\Internal\Message -{ - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - */ - private $lake_resources; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $lake_resources - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLakeResources() - { - return $this->lake_resources; - } - - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLakeResources($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Lake::class); - $this->lake_resources = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DataprocMetastoreClient.php b/DataprocMetastore/src/V1alpha/DataprocMetastoreClient.php deleted file mode 100644 index b3160ce7f200..000000000000 --- a/DataprocMetastore/src/V1alpha/DataprocMetastoreClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/ListFederations', - $argument, - ['\Google\Cloud\Metastore\V1alpha\ListFederationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single federation. - * @param \Google\Cloud\Metastore\V1alpha\GetFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFederation(\Google\Cloud\Metastore\V1alpha\GetFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/GetFederation', - $argument, - ['\Google\Cloud\Metastore\V1alpha\Federation', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore federation in a project and location. - * @param \Google\Cloud\Metastore\V1alpha\CreateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateFederation(\Google\Cloud\Metastore\V1alpha\CreateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/CreateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the fields of a federation. - * @param \Google\Cloud\Metastore\V1alpha\UpdateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateFederation(\Google\Cloud\Metastore\V1alpha\UpdateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/UpdateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single federation. - * @param \Google\Cloud\Metastore\V1alpha\DeleteFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFederation(\Google\Cloud\Metastore\V1alpha\DeleteFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/DeleteFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php b/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php deleted file mode 100644 index 0824aa45094b..000000000000 --- a/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php +++ /dev/null @@ -1,340 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/ListServices', - $argument, - ['\Google\Cloud\Metastore\V1alpha\ListServicesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single service. - * @param \Google\Cloud\Metastore\V1alpha\GetServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetService(\Google\Cloud\Metastore\V1alpha\GetServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/GetService', - $argument, - ['\Google\Cloud\Metastore\V1alpha\Service', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore service in a project and location. - * @param \Google\Cloud\Metastore\V1alpha\CreateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateService(\Google\Cloud\Metastore\V1alpha\CreateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single service. - * @param \Google\Cloud\Metastore\V1alpha\UpdateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateService(\Google\Cloud\Metastore\V1alpha\UpdateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/UpdateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single service. - * @param \Google\Cloud\Metastore\V1alpha\DeleteServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteService(\Google\Cloud\Metastore\V1alpha\DeleteServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/DeleteService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists imports in a service. - * @param \Google\Cloud\Metastore\V1alpha\ListMetadataImportsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMetadataImports(\Google\Cloud\Metastore\V1alpha\ListMetadataImportsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/ListMetadataImports', - $argument, - ['\Google\Cloud\Metastore\V1alpha\ListMetadataImportsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single import. - * @param \Google\Cloud\Metastore\V1alpha\GetMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMetadataImport(\Google\Cloud\Metastore\V1alpha\GetMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/GetMetadataImport', - $argument, - ['\Google\Cloud\Metastore\V1alpha\MetadataImport', 'decode'], - $metadata, $options); - } - - /** - * Creates a new MetadataImport in a given project and location. - * @param \Google\Cloud\Metastore\V1alpha\CreateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateMetadataImport(\Google\Cloud\Metastore\V1alpha\CreateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * @param \Google\Cloud\Metastore\V1alpha\UpdateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateMetadataImport(\Google\Cloud\Metastore\V1alpha\UpdateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/UpdateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Exports metadata from a service. - * @param \Google\Cloud\Metastore\V1alpha\ExportMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportMetadata(\Google\Cloud\Metastore\V1alpha\ExportMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/ExportMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Restores a service from a backup. - * @param \Google\Cloud\Metastore\V1alpha\RestoreServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestoreService(\Google\Cloud\Metastore\V1alpha\RestoreServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/RestoreService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists backups in a service. - * @param \Google\Cloud\Metastore\V1alpha\ListBackupsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListBackups(\Google\Cloud\Metastore\V1alpha\ListBackupsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/ListBackups', - $argument, - ['\Google\Cloud\Metastore\V1alpha\ListBackupsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single backup. - * @param \Google\Cloud\Metastore\V1alpha\GetBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetBackup(\Google\Cloud\Metastore\V1alpha\GetBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/GetBackup', - $argument, - ['\Google\Cloud\Metastore\V1alpha\Backup', 'decode'], - $metadata, $options); - } - - /** - * Creates a new backup in a given project and location. - * @param \Google\Cloud\Metastore\V1alpha\CreateBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBackup(\Google\Cloud\Metastore\V1alpha\CreateBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single backup. - * @param \Google\Cloud\Metastore\V1alpha\DeleteBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteBackup(\Google\Cloud\Metastore\V1alpha\DeleteBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/DeleteBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Removes the attached IAM policies for a resource - * @param \Google\Cloud\Metastore\V1alpha\RemoveIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RemoveIamPolicy(\Google\Cloud\Metastore\V1alpha\RemoveIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/RemoveIamPolicy', - $argument, - ['\Google\Cloud\Metastore\V1alpha\RemoveIamPolicyResponse', 'decode'], - $metadata, $options); - } - - /** - * Query DPMS metadata. - * @param \Google\Cloud\Metastore\V1alpha\QueryMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function QueryMetadata(\Google\Cloud\Metastore\V1alpha\QueryMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/QueryMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Move a table to another database. - * @param \Google\Cloud\Metastore\V1alpha\MoveTableToDatabaseRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MoveTableToDatabase(\Google\Cloud\Metastore\V1alpha\MoveTableToDatabaseRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/MoveTableToDatabase', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * @param \Google\Cloud\Metastore\V1alpha\AlterMetadataResourceLocationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AlterMetadataResourceLocation(\Google\Cloud\Metastore\V1alpha\AlterMetadataResourceLocationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/AlterMetadataResourceLocation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1alpha/DeleteBackupRequest.php b/DataprocMetastore/src/V1alpha/DeleteBackupRequest.php deleted file mode 100644 index 3c5c9c41c12c..000000000000 --- a/DataprocMetastore/src/V1alpha/DeleteBackupRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.metastore.v1alpha.DeleteBackupRequest - */ -class DeleteBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DeleteFederationRequest.php b/DataprocMetastore/src/V1alpha/DeleteFederationRequest.php deleted file mode 100644 index e25fec4d5c2e..000000000000 --- a/DataprocMetastore/src/V1alpha/DeleteFederationRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.cloud.metastore.v1alpha.DeleteFederationRequest - */ -class DeleteFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DeleteServiceRequest.php b/DataprocMetastore/src/V1alpha/DeleteServiceRequest.php deleted file mode 100644 index e4f3574afa35..000000000000 --- a/DataprocMetastore/src/V1alpha/DeleteServiceRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.metastore.v1alpha.DeleteServiceRequest - */ -class DeleteServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/EncryptionConfig.php b/DataprocMetastore/src/V1alpha/EncryptionConfig.php deleted file mode 100644 index 5d796e484eb4..000000000000 --- a/DataprocMetastore/src/V1alpha/EncryptionConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1alpha.EncryptionConfig - */ -class EncryptionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - */ - private $kms_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - * @return string - */ - public function getKmsKey() - { - return $this->kms_key; - } - - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - * @param string $var - * @return $this - */ - public function setKmsKey($var) - { - GPBUtil::checkString($var, True); - $this->kms_key = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ErrorDetails.php b/DataprocMetastore/src/V1alpha/ErrorDetails.php deleted file mode 100644 index 3181286b80d7..000000000000 --- a/DataprocMetastore/src/V1alpha/ErrorDetails.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1alpha.ErrorDetails - */ -class ErrorDetails extends \Google\Protobuf\Internal\Message -{ - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - */ - private $details; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $details - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDetails() - { - return $this->details; - } - - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDetails($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->details = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php b/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php deleted file mode 100644 index 59014ad675a1..000000000000 --- a/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php +++ /dev/null @@ -1,232 +0,0 @@ -google.cloud.metastore.v1alpha.ExportMetadataRequest - */ -class ExportMetadataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $database_dump_type = 0; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $destination_gcs_folder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $service - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $database_dump_type - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * - * Generated from protobuf field string destination_gcs_folder = 2; - * @return string - */ - public function getDestinationGcsFolder() - { - return $this->readOneof(2); - } - - public function hasDestinationGcsFolder() - { - return $this->hasOneof(2); - } - - /** - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * - * Generated from protobuf field string destination_gcs_folder = 2; - * @param string $var - * @return $this - */ - public function setDestinationGcsFolder($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDatabaseDumpType() - { - return $this->database_dump_type; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDatabaseDumpType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec\Type::class); - $this->database_dump_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Federation.php b/DataprocMetastore/src/V1alpha/Federation.php deleted file mode 100644 index 6880ed15c734..000000000000 --- a/DataprocMetastore/src/V1alpha/Federation.php +++ /dev/null @@ -1,433 +0,0 @@ -google.cloud.metastore.v1alpha.Federation - */ -class Federation extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $version = ''; - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - */ - private $backend_metastores; - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state_message = ''; - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metastore federation was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metastore federation was last updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * User-defined labels for the metastore federation. - * @type string $version - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * @type array|\Google\Protobuf\Internal\MapField $backend_metastores - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * @type string $endpoint_uri - * Output only. The federation endpoint. - * @type int $state - * Output only. The current state of the federation. - * @type string $state_message - * Output only. Additional information about the current state of the - * metastore federation, if available. - * @type string $uid - * Output only. The globally unique resource identifier of the metastore - * federation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getBackendMetastores() - { - return $this->backend_metastores; - } - - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setBackendMetastores($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\BackendMetastore::class); - $this->backend_metastores = $arr; - - return $this; - } - - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Federation\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Federation/State.php b/DataprocMetastore/src/V1alpha/Federation/State.php deleted file mode 100644 index 8282624f193d..000000000000 --- a/DataprocMetastore/src/V1alpha/Federation/State.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.metastore.v1alpha.Federation.State - */ -class State -{ - /** - * The state of the metastore federation is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metastore federation is in the process of being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The metastore federation is running and ready to serve queries. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The metastore federation is being updated. It remains usable but cannot - * accept additional update requests or be deleted at this time. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The metastore federation is undergoing deletion. It cannot be used. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The metastore federation has encountered an error and cannot be used. The - * metastore federation should be deleted. - * - * Generated from protobuf enum ERROR = 5; - */ - const ERROR = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\Federation_State::class); - diff --git a/DataprocMetastore/src/V1alpha/Federation_State.php b/DataprocMetastore/src/V1alpha/Federation_State.php deleted file mode 100644 index e4a593fbe602..000000000000 --- a/DataprocMetastore/src/V1alpha/Federation_State.php +++ /dev/null @@ -1,16 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class DataprocMetastoreFederationGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1alpha.DataprocMetastoreFederation'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $federationNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_federation_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', - ], - ], - ]; - } - - private static function getFederationNameTemplate() - { - if (self::$federationNameTemplate == null) { - self::$federationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/federations/{federation}'); - } - - return self::$federationNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'federation' => self::getFederationNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a federation - * resource. - * - * @param string $project - * @param string $location - * @param string $federation - * - * @return string The formatted federation resource. - * - * @experimental - */ - public static function federationName($project, $location, $federation) - { - return self::getFederationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'federation' => $federation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - federation: projects/{project}/locations/{location}/federations/{federation} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'metastore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a metastore federation in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $federationId Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Federation $federation Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createFederation($parent, $federationId, $federation, array $optionalArgs = []) - { - $request = new CreateFederationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFederationId($federationId); - $request->setFederation($federation); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'deleteFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to delete, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteFederation($name, array $optionalArgs = []) - { - $request = new DeleteFederationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the details of a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $response = $dataprocMetastoreFederationClient->getFederation($formattedName); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1alpha\Federation - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getFederation($name, array $optionalArgs = []) - { - $request = new GetFederationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetFederation', Federation::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists federations in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listFederations($parent, array $optionalArgs = []) - { - $request = new ListFederationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFederations', $optionalArgs, ListFederationsResponse::class, $request); - } - - /** - * Updates the fields of a federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $updateMask = new FieldMask(); - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'updateFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Federation $federation Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateFederation($updateMask, $federation, array $optionalArgs = []) - { - $request = new UpdateFederationRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setFederation($federation); - $requestParamHeaders['federation.name'] = $federation->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $response = $dataprocMetastoreFederationClient->getLocation(); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreFederationClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreFederationClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreFederationClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php b/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php deleted file mode 100644 index b44f0b156981..000000000000 --- a/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php +++ /dev/null @@ -1,2408 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class DataprocMetastoreGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1alpha.DataprocMetastore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $backupNameTemplate; - - private static $lakeNameTemplate; - - private static $locationNameTemplate; - - private static $metadataImportNameTemplate; - - private static $networkNameTemplate; - - private static $serviceNameTemplate; - - private static $subnetworkNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_rest_client_config.php', - ], - ], - ]; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getLakeNameTemplate() - { - if (self::$lakeNameTemplate == null) { - self::$lakeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/lakes/{lake}'); - } - - return self::$lakeNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getMetadataImportNameTemplate() - { - if (self::$metadataImportNameTemplate == null) { - self::$metadataImportNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import}'); - } - - return self::$metadataImportNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getSubnetworkNameTemplate() - { - if (self::$subnetworkNameTemplate == null) { - self::$subnetworkNameTemplate = new PathTemplate('projects/{project}/regions/{region}/subnetworks/{subnetwork}'); - } - - return self::$subnetworkNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'backup' => self::getBackupNameTemplate(), - 'lake' => self::getLakeNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'metadataImport' => self::getMetadataImportNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'service' => self::getServiceNameTemplate(), - 'subnetwork' => self::getSubnetworkNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $backup - * - * @return string The formatted backup resource. - * - * @experimental - */ - public static function backupName($project, $location, $service, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a lake - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * - * @return string The formatted lake resource. - * - * @experimental - */ - public static function lakeName($project, $location, $lake) - { - return self::getLakeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * metadata_import resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $metadataImport - * - * @return string The formatted metadata_import resource. - * - * @experimental - */ - public static function metadataImportName($project, $location, $service, $metadataImport) - { - return self::getMetadataImportNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'metadata_import' => $metadataImport, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - * - * @experimental - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - * - * @experimental - */ - public static function serviceName($project, $location, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subnetwork - * resource. - * - * @param string $project - * @param string $region - * @param string $subnetwork - * - * @return string The formatted subnetwork resource. - * - * @experimental - */ - public static function subnetworkName($project, $region, $subnetwork) - { - return self::getSubnetworkNameTemplate()->render([ - 'project' => $project, - 'region' => $region, - 'subnetwork' => $subnetwork, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - backup: projects/{project}/locations/{location}/services/{service}/backups/{backup} - * - lake: projects/{project}/locations/{location}/lakes/{lake} - * - location: projects/{project}/locations/{location} - * - metadataImport: projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import} - * - network: projects/{project}/global/networks/{network} - * - service: projects/{project}/locations/{location}/services/{service} - * - subnetwork: projects/{project}/regions/{region}/subnetworks/{subnetwork} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'metastore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $resourceName Required. The relative metadata resource name in the following format. - * - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @param string $locationUri Required. The new location URI for the metadata resource. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function alterMetadataResourceLocation($service, $resourceName, $locationUri, array $optionalArgs = []) - { - $request = new AlterMetadataResourceLocationRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setResourceName($resourceName); - $request->setLocationUri($locationUri); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('AlterMetadataResourceLocation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new backup in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * backup of the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $backupId Required. The ID of the backup, which is used as the final component of the - * backup's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param Backup $backup Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new MetadataImport in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $metadataImportId = 'metadata_import_id'; - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $metadataImportId Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param MetadataImport $metadataImport Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createMetadataImport($parent, $metadataImportId, $metadataImport, array $optionalArgs = []) - { - $request = new CreateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMetadataImportId($metadataImportId); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a metastore service in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * $serviceId = 'service_id'; - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $serviceId Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Service $service Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createService($parent, $serviceId, $service, array $optionalArgs = []) - { - $request = new CreateServiceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setServiceId($serviceId); - $request->setService($service); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to delete, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to delete, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteService($name, array $optionalArgs = []) - { - $request = new DeleteServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Exports metadata from a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'exportMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * export, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $destinationGcsFolder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $databaseDumpType - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec\Type} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function exportMetadata($service, array $optionalArgs = []) - { - $request = new ExportMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['destinationGcsFolder'])) { - $request->setDestinationGcsFolder($optionalArgs['destinationGcsFolder']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['databaseDumpType'])) { - $request->setDatabaseDumpType($optionalArgs['databaseDumpType']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets details of a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $response = $dataprocMetastoreClient->getBackup($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to retrieve, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1alpha\Backup - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single import. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - * $response = $dataprocMetastoreClient->getMetadataImport($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1alpha\MetadataImport - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getMetadataImport($name, array $optionalArgs = []) - { - $request = new GetMetadataImportRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetMetadataImport', MetadataImport::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the details of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $response = $dataprocMetastoreClient->getService($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1alpha\Service - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getService($name, array $optionalArgs = []) - { - $request = new GetServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists backups in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose backups to - * list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists imports in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listMetadataImports($parent, array $optionalArgs = []) - { - $request = new ListMetadataImportsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMetadataImports', $optionalArgs, ListMetadataImportsResponse::class, $request); - } - - /** - * Lists services in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore services - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listServices($parent, array $optionalArgs = []) - { - $request = new ListServicesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); - } - - /** - * Move a table to another database. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $tableName = 'table_name'; - * $dbName = 'db_name'; - * $destinationDbName = 'destination_db_name'; - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'moveTableToDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $tableName Required. The name of the table to be moved. - * @param string $dbName Required. The name of the database where the table resides. - * @param string $destinationDbName Required. The name of the database where the table should be moved. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function moveTableToDatabase($service, $tableName, $dbName, $destinationDbName, array $optionalArgs = []) - { - $request = new MoveTableToDatabaseRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setTableName($tableName); - $request->setDbName($dbName); - $request->setDestinationDbName($destinationDbName); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('MoveTableToDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Query DPMS metadata. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $query = 'query'; - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'queryMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $query Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function queryMetadata($service, $query, array $optionalArgs = []) - { - $request = new QueryMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setQuery($query); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('QueryMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Removes the attached IAM policies for a resource - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->removeIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $asynchronous - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1alpha\RemoveIamPolicyResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function removeIamPolicy($resource, array $optionalArgs = []) - { - $request = new RemoveIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['asynchronous'])) { - $request->setAsynchronous($optionalArgs['asynchronous']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RemoveIamPolicy', RemoveIamPolicyResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Restores a service from a backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $formattedBackup = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'restoreService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * restore, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $backup Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $restoreType - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1alpha\Restore\RestoreType} - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restoreService($service, $backup, array $optionalArgs = []) - { - $request = new RestoreServiceRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setBackup($backup); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['restoreType'])) { - $request->setRestoreType($optionalArgs['restoreType']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param MetadataImport $metadataImport Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateMetadataImport($updateMask, $metadataImport, array $optionalArgs = []) - { - $request = new UpdateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['metadata_import.name'] = $metadataImport->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Service $service Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateService($updateMask, $service, array $optionalArgs = []) - { - $request = new UpdateServiceRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setService($service); - $requestParamHeaders['service.name'] = $service->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $response = $dataprocMetastoreClient->getLocation(); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/DataprocMetastore/src/V1alpha/GetBackupRequest.php b/DataprocMetastore/src/V1alpha/GetBackupRequest.php deleted file mode 100644 index 66676653d764..000000000000 --- a/DataprocMetastore/src/V1alpha/GetBackupRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1alpha.GetBackupRequest - */ -class GetBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/GetFederationRequest.php b/DataprocMetastore/src/V1alpha/GetFederationRequest.php deleted file mode 100644 index 5603b5c3301d..000000000000 --- a/DataprocMetastore/src/V1alpha/GetFederationRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1alpha.GetFederationRequest - */ -class GetFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/GetMetadataImportRequest.php b/DataprocMetastore/src/V1alpha/GetMetadataImportRequest.php deleted file mode 100644 index 1091e94c3527..000000000000 --- a/DataprocMetastore/src/V1alpha/GetMetadataImportRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1alpha.GetMetadataImportRequest - */ -class GetMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/GetServiceRequest.php b/DataprocMetastore/src/V1alpha/GetServiceRequest.php deleted file mode 100644 index 9d9e528cb81e..000000000000 --- a/DataprocMetastore/src/V1alpha/GetServiceRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1alpha.GetServiceRequest - */ -class GetServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php deleted file mode 100644 index ce72c2d916b6..000000000000 --- a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php +++ /dev/null @@ -1,278 +0,0 @@ -google.cloud.metastore.v1alpha.HiveMetastoreConfig - */ -class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $version = ''; - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - */ - private $config_overrides; - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.KerberosConfig kerberos_config = 3; - */ - private $kerberos_config = null; - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - */ - private $endpoint_protocol = 0; - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - */ - private $auxiliary_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * Immutable. The Hive metastore schema version. - * @type array|\Google\Protobuf\Internal\MapField $config_overrides - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * @type \Google\Cloud\Metastore\V1alpha\KerberosConfig $kerberos_config - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * @type int $endpoint_protocol - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * @type array|\Google\Protobuf\Internal\MapField $auxiliary_versions - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getConfigOverrides() - { - return $this->config_overrides; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setConfigOverrides($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->config_overrides = $arr; - - return $this; - } - - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.KerberosConfig kerberos_config = 3; - * @return \Google\Cloud\Metastore\V1alpha\KerberosConfig|null - */ - public function getKerberosConfig() - { - return $this->kerberos_config; - } - - public function hasKerberosConfig() - { - return isset($this->kerberos_config); - } - - public function clearKerberosConfig() - { - unset($this->kerberos_config); - } - - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.KerberosConfig kerberos_config = 3; - * @param \Google\Cloud\Metastore\V1alpha\KerberosConfig $var - * @return $this - */ - public function setKerberosConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\KerberosConfig::class); - $this->kerberos_config = $var; - - return $this; - } - - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - * @return int - */ - public function getEndpointProtocol() - { - return $this->endpoint_protocol; - } - - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - * @param int $var - * @return $this - */ - public function setEndpointProtocol($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig\EndpointProtocol::class); - $this->endpoint_protocol = $var; - - return $this; - } - - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAuxiliaryVersions() - { - return $this->auxiliary_versions; - } - - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAuxiliaryVersions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\AuxiliaryVersionConfig::class); - $this->auxiliary_versions = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php deleted file mode 100644 index 4b93919c49c6..000000000000 --- a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol - */ -class EndpointProtocol -{ - /** - * The protocol is not set. - * - * Generated from protobuf enum ENDPOINT_PROTOCOL_UNSPECIFIED = 0; - */ - const ENDPOINT_PROTOCOL_UNSPECIFIED = 0; - /** - * Use the legacy Apache Thrift protocol for the metastore service endpoint. - * - * Generated from protobuf enum THRIFT = 1; - */ - const THRIFT = 1; - /** - * Use the modernized gRPC protocol for the metastore service endpoint. - * - * Generated from protobuf enum GRPC = 2; - */ - const GRPC = 2; - - private static $valueToName = [ - self::ENDPOINT_PROTOCOL_UNSPECIFIED => 'ENDPOINT_PROTOCOL_UNSPECIFIED', - self::THRIFT => 'THRIFT', - self::GRPC => 'GRPC', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EndpointProtocol::class, \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig_EndpointProtocol::class); - diff --git a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php deleted file mode 100644 index cfb1ce7c78e4..000000000000 --- a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.KerberosConfig - */ -class KerberosConfig extends \Google\Protobuf\Internal\Message -{ - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Secret keytab = 1; - */ - private $keytab = null; - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - */ - private $principal = ''; - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - */ - private $krb5_config_gcs_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1alpha\Secret $keytab - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * @type string $principal - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * @type string $krb5_config_gcs_uri - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Secret keytab = 1; - * @return \Google\Cloud\Metastore\V1alpha\Secret|null - */ - public function getKeytab() - { - return $this->keytab; - } - - public function hasKeytab() - { - return isset($this->keytab); - } - - public function clearKeytab() - { - unset($this->keytab); - } - - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Secret keytab = 1; - * @param \Google\Cloud\Metastore\V1alpha\Secret $var - * @return $this - */ - public function setKeytab($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Secret::class); - $this->keytab = $var; - - return $this; - } - - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - * @return string - */ - public function getPrincipal() - { - return $this->principal; - } - - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - * @param string $var - * @return $this - */ - public function setPrincipal($var) - { - GPBUtil::checkString($var, True); - $this->principal = $var; - - return $this; - } - - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - * @return string - */ - public function getKrb5ConfigGcsUri() - { - return $this->krb5_config_gcs_uri; - } - - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - * @param string $var - * @return $this - */ - public function setKrb5ConfigGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->krb5_config_gcs_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Lake.php b/DataprocMetastore/src/V1alpha/Lake.php deleted file mode 100644 index fdc707844623..000000000000 --- a/DataprocMetastore/src/V1alpha/Lake.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1alpha.Lake - */ -class Lake extends \Google\Protobuf\Internal\Message -{ - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListBackupsRequest.php b/DataprocMetastore/src/V1alpha/ListBackupsRequest.php deleted file mode 100644 index 14f48867331b..000000000000 --- a/DataprocMetastore/src/V1alpha/ListBackupsRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.cloud.metastore.v1alpha.ListBackupsRequest - */ -class ListBackupsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @type int $page_size - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListBackupsResponse.php b/DataprocMetastore/src/V1alpha/ListBackupsResponse.php deleted file mode 100644 index 732b3ae64f15..000000000000 --- a/DataprocMetastore/src/V1alpha/ListBackupsResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1alpha.ListBackupsResponse - */ -class ListBackupsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Backup backups = 1; - */ - private $backups; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\Backup>|\Google\Protobuf\Internal\RepeatedField $backups - * The backups of the specified service. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Backup backups = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBackups() - { - return $this->backups; - } - - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Backup backups = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\Backup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBackups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Backup::class); - $this->backups = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListFederationsRequest.php b/DataprocMetastore/src/V1alpha/ListFederationsRequest.php deleted file mode 100644 index 1b41fd48ba9e..000000000000 --- a/DataprocMetastore/src/V1alpha/ListFederationsRequest.php +++ /dev/null @@ -1,251 +0,0 @@ -google.cloud.metastore.v1alpha.ListFederationsRequest - */ -class ListFederationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type int $page_size - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListFederationsResponse.php b/DataprocMetastore/src/V1alpha/ListFederationsResponse.php deleted file mode 100644 index b07375b142ad..000000000000 --- a/DataprocMetastore/src/V1alpha/ListFederationsResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.metastore.v1alpha.ListFederationsResponse - */ -class ListFederationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Federation federations = 1; - */ - private $federations; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\Federation>|\Google\Protobuf\Internal\RepeatedField $federations - * The services in the specified location. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Federation federations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFederations() - { - return $this->federations; - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Federation federations = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\Federation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFederations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Federation::class); - $this->federations = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListMetadataImportsRequest.php b/DataprocMetastore/src/V1alpha/ListMetadataImportsRequest.php deleted file mode 100644 index 6efc93b0c345..000000000000 --- a/DataprocMetastore/src/V1alpha/ListMetadataImportsRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.cloud.metastore.v1alpha.ListMetadataImportsRequest - */ -class ListMetadataImportsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @type int $page_size - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListMetadataImportsResponse.php b/DataprocMetastore/src/V1alpha/ListMetadataImportsResponse.php deleted file mode 100644 index ea117bfee1dc..000000000000 --- a/DataprocMetastore/src/V1alpha/ListMetadataImportsResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1alpha.ListMetadataImportsResponse - */ -class ListMetadataImportsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataImport metadata_imports = 1; - */ - private $metadata_imports; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\MetadataImport>|\Google\Protobuf\Internal\RepeatedField $metadata_imports - * The imports in the specified service. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataImport metadata_imports = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetadataImports() - { - return $this->metadata_imports; - } - - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataImport metadata_imports = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\MetadataImport>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetadataImports($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\MetadataImport::class); - $this->metadata_imports = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListServicesRequest.php b/DataprocMetastore/src/V1alpha/ListServicesRequest.php deleted file mode 100644 index 552b8f043611..000000000000 --- a/DataprocMetastore/src/V1alpha/ListServicesRequest.php +++ /dev/null @@ -1,256 +0,0 @@ -google.cloud.metastore.v1alpha.ListServicesRequest - */ -class ListServicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type int $page_size - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListServicesResponse.php b/DataprocMetastore/src/V1alpha/ListServicesResponse.php deleted file mode 100644 index 651fe3fe9e72..000000000000 --- a/DataprocMetastore/src/V1alpha/ListServicesResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1alpha.ListServicesResponse - */ -class ListServicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Service services = 1; - */ - private $services; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\Service>|\Google\Protobuf\Internal\RepeatedField $services - * The services in the specified location. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Service services = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServices() - { - return $this->services; - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Service services = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\Service>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Service::class); - $this->services = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/LocationMetadata.php b/DataprocMetastore/src/V1alpha/LocationMetadata.php deleted file mode 100644 index 068677258a75..000000000000 --- a/DataprocMetastore/src/V1alpha/LocationMetadata.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1alpha.LocationMetadata - */ -class LocationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - */ - private $supported_hive_metastore_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\LocationMetadata\HiveMetastoreVersion>|\Google\Protobuf\Internal\RepeatedField $supported_hive_metastore_versions - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedHiveMetastoreVersions() - { - return $this->supported_hive_metastore_versions; - } - - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\LocationMetadata\HiveMetastoreVersion>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedHiveMetastoreVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\LocationMetadata\HiveMetastoreVersion::class); - $this->supported_hive_metastore_versions = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/LocationMetadata/HiveMetastoreVersion.php b/DataprocMetastore/src/V1alpha/LocationMetadata/HiveMetastoreVersion.php deleted file mode 100644 index 5259ba3115e4..000000000000 --- a/DataprocMetastore/src/V1alpha/LocationMetadata/HiveMetastoreVersion.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.metastore.v1alpha.LocationMetadata.HiveMetastoreVersion - */ -class HiveMetastoreVersion extends \Google\Protobuf\Internal\Message -{ - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - */ - private $version = ''; - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - */ - private $is_default = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * The semantic version of the Hive Metastore software. - * @type bool $is_default - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - * @return bool - */ - public function getIsDefault() - { - return $this->is_default; - } - - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - * @param bool $var - * @return $this - */ - public function setIsDefault($var) - { - GPBUtil::checkBool($var); - $this->is_default = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HiveMetastoreVersion::class, \Google\Cloud\Metastore\V1alpha\LocationMetadata_HiveMetastoreVersion::class); - diff --git a/DataprocMetastore/src/V1alpha/LocationMetadata_HiveMetastoreVersion.php b/DataprocMetastore/src/V1alpha/LocationMetadata_HiveMetastoreVersion.php deleted file mode 100644 index 765412c896b6..000000000000 --- a/DataprocMetastore/src/V1alpha/LocationMetadata_HiveMetastoreVersion.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.MaintenanceWindow - */ -class MaintenanceWindow extends \Google\Protobuf\Internal\Message -{ - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - */ - private $hour_of_day = null; - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - */ - private $day_of_week = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Int32Value $hour_of_day - * The hour of day (0-23) when the window starts. - * @type int $day_of_week - * The day of week, when the window starts. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @return \Google\Protobuf\Int32Value|null - */ - public function getHourOfDay() - { - return $this->hour_of_day; - } - - public function hasHourOfDay() - { - return isset($this->hour_of_day); - } - - public function clearHourOfDay() - { - unset($this->hour_of_day); - } - - /** - * Returns the unboxed value from getHourOfDay() - - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @return int|null - */ - public function getHourOfDayValue() - { - return $this->readWrapperValue("hour_of_day"); - } - - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @param \Google\Protobuf\Int32Value $var - * @return $this - */ - public function setHourOfDay($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); - $this->hour_of_day = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. - - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @param int|null $var - * @return $this - */ - public function setHourOfDayValue($var) - { - $this->writeWrapperValue("hour_of_day", $var); - return $this;} - - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - * @return int - */ - public function getDayOfWeek() - { - return $this->day_of_week; - } - - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - * @param int $var - * @return $this - */ - public function setDayOfWeek($var) - { - GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); - $this->day_of_week = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MetadataExport.php b/DataprocMetastore/src/V1alpha/MetadataExport.php deleted file mode 100644 index 12d8b2f0890e..000000000000 --- a/DataprocMetastore/src/V1alpha/MetadataExport.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataExport - */ -class MetadataExport extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $database_dump_type = 0; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $destination_gcs_uri - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time when the export started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the export ended. - * @type int $state - * Output only. The current state of the export. - * @type int $database_dump_type - * Output only. The type of the database dump. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * - * Generated from protobuf field string destination_gcs_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDestinationGcsUri() - { - return $this->readOneof(4); - } - - public function hasDestinationGcsUri() - { - return $this->hasOneof(4); - } - - /** - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * - * Generated from protobuf field string destination_gcs_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDestinationGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\MetadataExport\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getDatabaseDumpType() - { - return $this->database_dump_type; - } - - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDatabaseDumpType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec\Type::class); - $this->database_dump_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MetadataExport/State.php b/DataprocMetastore/src/V1alpha/MetadataExport/State.php deleted file mode 100644 index 5c68430d9e47..000000000000 --- a/DataprocMetastore/src/V1alpha/MetadataExport/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataExport.State - */ -class State -{ - /** - * The state of the metadata export is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata export is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata export completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata export failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The metadata export is cancelled. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\MetadataExport_State::class); - diff --git a/DataprocMetastore/src/V1alpha/MetadataExport_State.php b/DataprocMetastore/src/V1alpha/MetadataExport_State.php deleted file mode 100644 index 14491f90cb0a..000000000000 --- a/DataprocMetastore/src/V1alpha/MetadataExport_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataImport - */ -class MetadataImport extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - */ - private $description = ''; - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - protected $metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump $database_dump - * Immutable. A database dump from a pre-existing metastore's database. - * @type string $name - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * @type string $description - * The description of the metadata import. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metadata import was started. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metadata import was last updated. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the metadata import finished. - * @type int $state - * Output only. The current state of the metadata import. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. A database dump from a pre-existing metastore's database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump database_dump = 6 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump|null - */ - public function getDatabaseDump() - { - return $this->readOneof(6); - } - - public function hasDatabaseDump() - { - return $this->hasOneof(6); - } - - /** - * Immutable. A database dump from a pre-existing metastore's database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump database_dump = 6 [(.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump $var - * @return $this - */ - public function setDatabaseDump($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\MetadataImport\State::class); - $this->state = $var; - - return $this; - } - - /** - * @return string - */ - public function getMetadata() - { - return $this->whichOneof("metadata"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump.php b/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump.php deleted file mode 100644 index 9d58308fa408..000000000000 --- a/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump.php +++ /dev/null @@ -1,191 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump - */ -class DatabaseDump extends \Google\Protobuf\Internal\Message -{ - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @deprecated - */ - protected $database_type = 0; - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - */ - private $gcs_uri = ''; - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @deprecated - */ - protected $source_database = ''; - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $database_type - * The type of the database. - * @type string $gcs_uri - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * @type string $source_database - * The name of the source database. - * @type int $type - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @return int - * @deprecated - */ - public function getDatabaseType() - { - @trigger_error('database_type is deprecated.', E_USER_DEPRECATED); - return $this->database_type; - } - - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @param int $var - * @return $this - * @deprecated - */ - public function setDatabaseType($var) - { - @trigger_error('database_type is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump\DatabaseType::class); - $this->database_type = $var; - - return $this; - } - - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - * @return string - */ - public function getGcsUri() - { - return $this->gcs_uri; - } - - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - * @param string $var - * @return $this - */ - public function setGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->gcs_uri = $var; - - return $this; - } - - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @return string - * @deprecated - */ - public function getSourceDatabase() - { - @trigger_error('source_database is deprecated.', E_USER_DEPRECATED); - return $this->source_database; - } - - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setSourceDatabase($var) - { - @trigger_error('source_database is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->source_database = $var; - - return $this; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec\Type::class); - $this->type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseDump::class, \Google\Cloud\Metastore\V1alpha\MetadataImport_DatabaseDump::class); - diff --git a/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump/DatabaseType.php b/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump/DatabaseType.php deleted file mode 100644 index be296436de3e..000000000000 --- a/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump/DatabaseType.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump.DatabaseType - */ -class DatabaseType -{ - /** - * The type of the source database is unknown. - * - * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; - */ - const DATABASE_TYPE_UNSPECIFIED = 0; - /** - * The type of the source database is MySQL. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - - private static $valueToName = [ - self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1alpha\MetadataImport_DatabaseDump_DatabaseType::class); - diff --git a/DataprocMetastore/src/V1alpha/MetadataImport/State.php b/DataprocMetastore/src/V1alpha/MetadataImport/State.php deleted file mode 100644 index 7064408075c1..000000000000 --- a/DataprocMetastore/src/V1alpha/MetadataImport/State.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataImport.State - */ -class State -{ - /** - * The state of the metadata import is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata import is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata import completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata import is being updated. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The metadata import failed, and attempted metadata changes were rolled - * back. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::UPDATING => 'UPDATING', - self::FAILED => 'FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\MetadataImport_State::class); - diff --git a/DataprocMetastore/src/V1alpha/MetadataImport_DatabaseDump.php b/DataprocMetastore/src/V1alpha/MetadataImport_DatabaseDump.php deleted file mode 100644 index 41d5f644b162..000000000000 --- a/DataprocMetastore/src/V1alpha/MetadataImport_DatabaseDump.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataIntegration - */ -class MetadataIntegration extends \Google\Protobuf\Internal\Message -{ - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataCatalogConfig data_catalog_config = 1; - */ - private $data_catalog_config = null; - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataplexConfig dataplex_config = 2; - */ - private $dataplex_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1alpha\DataCatalogConfig $data_catalog_config - * The integration config for the Data Catalog service. - * @type \Google\Cloud\Metastore\V1alpha\DataplexConfig $dataplex_config - * The integration config for the Dataplex service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataCatalogConfig data_catalog_config = 1; - * @return \Google\Cloud\Metastore\V1alpha\DataCatalogConfig|null - */ - public function getDataCatalogConfig() - { - return $this->data_catalog_config; - } - - public function hasDataCatalogConfig() - { - return isset($this->data_catalog_config); - } - - public function clearDataCatalogConfig() - { - unset($this->data_catalog_config); - } - - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataCatalogConfig data_catalog_config = 1; - * @param \Google\Cloud\Metastore\V1alpha\DataCatalogConfig $var - * @return $this - */ - public function setDataCatalogConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\DataCatalogConfig::class); - $this->data_catalog_config = $var; - - return $this; - } - - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataplexConfig dataplex_config = 2; - * @return \Google\Cloud\Metastore\V1alpha\DataplexConfig|null - */ - public function getDataplexConfig() - { - return $this->dataplex_config; - } - - public function hasDataplexConfig() - { - return isset($this->dataplex_config); - } - - public function clearDataplexConfig() - { - unset($this->dataplex_config); - } - - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataplexConfig dataplex_config = 2; - * @param \Google\Cloud\Metastore\V1alpha\DataplexConfig $var - * @return $this - */ - public function setDataplexConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\DataplexConfig::class); - $this->dataplex_config = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MetadataManagementActivity.php b/DataprocMetastore/src/V1alpha/MetadataManagementActivity.php deleted file mode 100644 index 3af658f899ef..000000000000 --- a/DataprocMetastore/src/V1alpha/MetadataManagementActivity.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataManagementActivity - */ -class MetadataManagementActivity extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata_exports; - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $restores; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\MetadataExport>|\Google\Protobuf\Internal\RepeatedField $metadata_exports - * Output only. The latest metadata exports of the metastore service. - * @type array<\Google\Cloud\Metastore\V1alpha\Restore>|\Google\Protobuf\Internal\RepeatedField $restores - * Output only. The latest restores of the metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetadataExports() - { - return $this->metadata_exports; - } - - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Metastore\V1alpha\MetadataExport>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetadataExports($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\MetadataExport::class); - $this->metadata_exports = $arr; - - return $this; - } - - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestores() - { - return $this->restores; - } - - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Metastore\V1alpha\Restore>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestores($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Restore::class); - $this->restores = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MoveTableToDatabaseRequest.php b/DataprocMetastore/src/V1alpha/MoveTableToDatabaseRequest.php deleted file mode 100644 index 71b9a52f0b35..000000000000 --- a/DataprocMetastore/src/V1alpha/MoveTableToDatabaseRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.metastore.v1alpha.MoveTableToDatabaseRequest - */ -class MoveTableToDatabaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $table_name = ''; - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $db_name = ''; - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $destination_db_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $table_name - * Required. The name of the table to be moved. - * @type string $db_name - * Required. The name of the database where the table resides. - * @type string $destination_db_name - * Required. The name of the database where the table should be moved. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTableName() - { - return $this->table_name; - } - - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTableName($var) - { - GPBUtil::checkString($var, True); - $this->table_name = $var; - - return $this; - } - - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDbName() - { - return $this->db_name; - } - - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDbName($var) - { - GPBUtil::checkString($var, True); - $this->db_name = $var; - - return $this; - } - - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDestinationDbName() - { - return $this->destination_db_name; - } - - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDestinationDbName($var) - { - GPBUtil::checkString($var, True); - $this->destination_db_name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MoveTableToDatabaseResponse.php b/DataprocMetastore/src/V1alpha/MoveTableToDatabaseResponse.php deleted file mode 100644 index de287eda072c..000000000000 --- a/DataprocMetastore/src/V1alpha/MoveTableToDatabaseResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.metastore.v1alpha.MoveTableToDatabaseResponse - */ -class MoveTableToDatabaseResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/NetworkConfig.php b/DataprocMetastore/src/V1alpha/NetworkConfig.php deleted file mode 100644 index 8273ed5a2750..000000000000 --- a/DataprocMetastore/src/V1alpha/NetworkConfig.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.metastore.v1alpha.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $consumers; - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - */ - private $custom_routes_enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\NetworkConfig\Consumer>|\Google\Protobuf\Internal\RepeatedField $consumers - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * @type bool $custom_routes_enabled - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConsumers() - { - return $this->consumers; - } - - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param array<\Google\Cloud\Metastore\V1alpha\NetworkConfig\Consumer>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConsumers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\NetworkConfig\Consumer::class); - $this->consumers = $arr; - - return $this; - } - - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - * @return bool - */ - public function getCustomRoutesEnabled() - { - return $this->custom_routes_enabled; - } - - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - * @param bool $var - * @return $this - */ - public function setCustomRoutesEnabled($var) - { - GPBUtil::checkBool($var); - $this->custom_routes_enabled = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php b/DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php deleted file mode 100644 index 5a9ecbaa8d48..000000000000 --- a/DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php +++ /dev/null @@ -1,173 +0,0 @@ -google.cloud.metastore.v1alpha.NetworkConfig.Consumer - */ -class Consumer extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $endpoint_location = ''; - protected $vpc_resource; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subnetwork - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * @type string $endpoint_uri - * Output only. The URI of the endpoint used to access the metastore - * service. - * @type string $endpoint_location - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnetwork = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getSubnetwork() - { - return $this->readOneof(1); - } - - public function hasSubnetwork() - { - return $this->hasOneof(1); - } - - /** - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnetwork = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubnetwork($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getEndpointLocation() - { - return $this->endpoint_location; - } - - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEndpointLocation($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_location = $var; - - return $this; - } - - /** - * @return string - */ - public function getVpcResource() - { - return $this->whichOneof("vpc_resource"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Consumer::class, \Google\Cloud\Metastore\V1alpha\NetworkConfig_Consumer::class); - diff --git a/DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php b/DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php deleted file mode 100644 index 68e992af58b2..000000000000 --- a/DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status_message = ''; - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/QueryMetadataRequest.php b/DataprocMetastore/src/V1alpha/QueryMetadataRequest.php deleted file mode 100644 index 11ed978485e2..000000000000 --- a/DataprocMetastore/src/V1alpha/QueryMetadataRequest.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.metastore.v1alpha.QueryMetadataRequest - */ -class QueryMetadataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $query = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $query - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/QueryMetadataResponse.php b/DataprocMetastore/src/V1alpha/QueryMetadataResponse.php deleted file mode 100644 index 0b7fd913f3df..000000000000 --- a/DataprocMetastore/src/V1alpha/QueryMetadataResponse.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.metastore.v1alpha.QueryMetadataResponse - */ -class QueryMetadataResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - */ - private $result_manifest_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $result_manifest_uri - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - * @return string - */ - public function getResultManifestUri() - { - return $this->result_manifest_uri; - } - - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - * @param string $var - * @return $this - */ - public function setResultManifestUri($var) - { - GPBUtil::checkString($var, True); - $this->result_manifest_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/RemoveIamPolicyRequest.php b/DataprocMetastore/src/V1alpha/RemoveIamPolicyRequest.php deleted file mode 100644 index b641adc29789..000000000000 --- a/DataprocMetastore/src/V1alpha/RemoveIamPolicyRequest.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.metastore.v1alpha.RemoveIamPolicyRequest - */ -class RemoveIamPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $resource = ''; - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $asynchronous = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * @type bool $asynchronous - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAsynchronous() - { - return $this->asynchronous; - } - - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAsynchronous($var) - { - GPBUtil::checkBool($var); - $this->asynchronous = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/RemoveIamPolicyResponse.php b/DataprocMetastore/src/V1alpha/RemoveIamPolicyResponse.php deleted file mode 100644 index a523f5966552..000000000000 --- a/DataprocMetastore/src/V1alpha/RemoveIamPolicyResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.metastore.v1alpha.RemoveIamPolicyResponse - */ -class RemoveIamPolicyResponse extends \Google\Protobuf\Internal\Message -{ - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - */ - private $success = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $success - * True if the policy is successfully removed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - * @return bool - */ - public function getSuccess() - { - return $this->success; - } - - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - * @param bool $var - * @return $this - */ - public function setSuccess($var) - { - GPBUtil::checkBool($var); - $this->success = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Restore.php b/DataprocMetastore/src/V1alpha/Restore.php deleted file mode 100644 index bc8db5447dff..000000000000 --- a/DataprocMetastore/src/V1alpha/Restore.php +++ /dev/null @@ -1,269 +0,0 @@ -google.cloud.metastore.v1alpha.Restore - */ -class Restore extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $backup = ''; - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $type = 0; - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $details = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time when the restore started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the restore ended. - * @type int $state - * Output only. The current state of the restore. - * @type string $backup - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type int $type - * Output only. The type of restore. - * @type string $details - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Restore\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Restore\RestoreType::class); - $this->type = $var; - - return $this; - } - - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDetails() - { - return $this->details; - } - - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkString($var, True); - $this->details = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Restore/RestoreType.php b/DataprocMetastore/src/V1alpha/Restore/RestoreType.php deleted file mode 100644 index ac00e6c12f01..000000000000 --- a/DataprocMetastore/src/V1alpha/Restore/RestoreType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1alpha.Restore.RestoreType - */ -class RestoreType -{ - /** - * The restore type is unknown. - * - * Generated from protobuf enum RESTORE_TYPE_UNSPECIFIED = 0; - */ - const RESTORE_TYPE_UNSPECIFIED = 0; - /** - * The service's metadata and configuration are restored. - * - * Generated from protobuf enum FULL = 1; - */ - const FULL = 1; - /** - * Only the service's metadata is restored. - * - * Generated from protobuf enum METADATA_ONLY = 2; - */ - const METADATA_ONLY = 2; - - private static $valueToName = [ - self::RESTORE_TYPE_UNSPECIFIED => 'RESTORE_TYPE_UNSPECIFIED', - self::FULL => 'FULL', - self::METADATA_ONLY => 'METADATA_ONLY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestoreType::class, \Google\Cloud\Metastore\V1alpha\Restore_RestoreType::class); - diff --git a/DataprocMetastore/src/V1alpha/Restore/State.php b/DataprocMetastore/src/V1alpha/Restore/State.php deleted file mode 100644 index f5225dc2cc66..000000000000 --- a/DataprocMetastore/src/V1alpha/Restore/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.metastore.v1alpha.Restore.State - */ -class State -{ - /** - * The state of the metadata restore is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata restore is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata restore completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata restore failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The metadata restore is cancelled. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\Restore_State::class); - diff --git a/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php b/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php deleted file mode 100644 index fc6247c733ed..000000000000 --- a/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.metastore.v1alpha.RestoreServiceRequest - */ -class RestoreServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $backup = ''; - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $restore_type = 0; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $backup - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type int $restore_type - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getRestoreType() - { - return $this->restore_type; - } - - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setRestoreType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Restore\RestoreType::class); - $this->restore_type = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Restore_RestoreType.php b/DataprocMetastore/src/V1alpha/Restore_RestoreType.php deleted file mode 100644 index 8774d40fa47a..000000000000 --- a/DataprocMetastore/src/V1alpha/Restore_RestoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.ScalingConfig - */ -class ScalingConfig extends \Google\Protobuf\Internal\Message -{ - protected $scaling_model; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $instance_size - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * @type float $scaling_factor - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig.InstanceSize instance_size = 1; - * @return int - */ - public function getInstanceSize() - { - return $this->readOneof(1); - } - - public function hasInstanceSize() - { - return $this->hasOneof(1); - } - - /** - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig.InstanceSize instance_size = 1; - * @param int $var - * @return $this - */ - public function setInstanceSize($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\ScalingConfig\InstanceSize::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * - * Generated from protobuf field float scaling_factor = 2; - * @return float - */ - public function getScalingFactor() - { - return $this->readOneof(2); - } - - public function hasScalingFactor() - { - return $this->hasOneof(2); - } - - /** - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * - * Generated from protobuf field float scaling_factor = 2; - * @param float $var - * @return $this - */ - public function setScalingFactor($var) - { - GPBUtil::checkFloat($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getScalingModel() - { - return $this->whichOneof("scaling_model"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ScalingConfig/InstanceSize.php b/DataprocMetastore/src/V1alpha/ScalingConfig/InstanceSize.php deleted file mode 100644 index 1b7ccfc5dfe0..000000000000 --- a/DataprocMetastore/src/V1alpha/ScalingConfig/InstanceSize.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.metastore.v1alpha.ScalingConfig.InstanceSize - */ -class InstanceSize -{ - /** - * Unspecified instance size - * - * Generated from protobuf enum INSTANCE_SIZE_UNSPECIFIED = 0; - */ - const INSTANCE_SIZE_UNSPECIFIED = 0; - /** - * Extra small instance size, maps to a scaling factor of 0.1. - * - * Generated from protobuf enum EXTRA_SMALL = 1; - */ - const EXTRA_SMALL = 1; - /** - * Small instance size, maps to a scaling factor of 0.5. - * - * Generated from protobuf enum SMALL = 2; - */ - const SMALL = 2; - /** - * Medium instance size, maps to a scaling factor of 1.0. - * - * Generated from protobuf enum MEDIUM = 3; - */ - const MEDIUM = 3; - /** - * Large instance size, maps to a scaling factor of 3.0. - * - * Generated from protobuf enum LARGE = 4; - */ - const LARGE = 4; - /** - * Extra large instance size, maps to a scaling factor of 6.0. - * - * Generated from protobuf enum EXTRA_LARGE = 5; - */ - const EXTRA_LARGE = 5; - - private static $valueToName = [ - self::INSTANCE_SIZE_UNSPECIFIED => 'INSTANCE_SIZE_UNSPECIFIED', - self::EXTRA_SMALL => 'EXTRA_SMALL', - self::SMALL => 'SMALL', - self::MEDIUM => 'MEDIUM', - self::LARGE => 'LARGE', - self::EXTRA_LARGE => 'EXTRA_LARGE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstanceSize::class, \Google\Cloud\Metastore\V1alpha\ScalingConfig_InstanceSize::class); - diff --git a/DataprocMetastore/src/V1alpha/ScalingConfig_InstanceSize.php b/DataprocMetastore/src/V1alpha/ScalingConfig_InstanceSize.php deleted file mode 100644 index 86bcc8b924f7..000000000000 --- a/DataprocMetastore/src/V1alpha/ScalingConfig_InstanceSize.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.Secret - */ -class Secret extends \Google\Protobuf\Internal\Message -{ - protected $value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $cloud_secret - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * - * Generated from protobuf field string cloud_secret = 2; - * @return string - */ - public function getCloudSecret() - { - return $this->readOneof(2); - } - - public function hasCloudSecret() - { - return $this->hasOneof(2); - } - - /** - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * - * Generated from protobuf field string cloud_secret = 2; - * @param string $var - * @return $this - */ - public function setCloudSecret($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getValue() - { - return $this->whichOneof("value"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Service.php b/DataprocMetastore/src/V1alpha/Service.php deleted file mode 100644 index f5fc3e4e1d72..000000000000 --- a/DataprocMetastore/src/V1alpha/Service.php +++ /dev/null @@ -1,942 +0,0 @@ -google.cloud.metastore.v1alpha.Service - */ -class Service extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - */ - private $network = ''; - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - */ - private $port = 0; - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state_message = ''; - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $artifact_gcs_uri = ''; - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.Tier tier = 13; - */ - private $tier = 0; - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataIntegration metadata_integration = 14; - */ - private $metadata_integration = null; - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MaintenanceWindow maintenance_window = 15; - */ - private $maintenance_window = null; - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata_management_activity = null; - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $release_channel = 0; - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $encryption_config = null; - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 21; - */ - private $network_config = null; - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $database_type = 0; - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig telemetry_config = 23; - */ - private $telemetry_config = null; - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig scaling_config = 24; - */ - private $scaling_config = null; - protected $metastore_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig $hive_metastore_config - * Configuration information specific to running Hive metastore - * software as the metastore service. - * @type string $name - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metastore service was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metastore service was last updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * User-defined labels for the metastore service. - * @type string $network - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * @type string $endpoint_uri - * Output only. The URI of the endpoint used to access the metastore service. - * @type int $port - * The TCP port at which the metastore service is reached. Default: 9083. - * @type int $state - * Output only. The current state of the metastore service. - * @type string $state_message - * Output only. Additional information about the current state of the - * metastore service, if available. - * @type string $artifact_gcs_uri - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * @type int $tier - * The tier of the service. - * @type \Google\Cloud\Metastore\V1alpha\MetadataIntegration $metadata_integration - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * @type \Google\Cloud\Metastore\V1alpha\MaintenanceWindow $maintenance_window - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * @type string $uid - * Output only. The globally unique resource identifier of the metastore - * service. - * @type \Google\Cloud\Metastore\V1alpha\MetadataManagementActivity $metadata_management_activity - * Output only. The metadata management activities of the metastore service. - * @type int $release_channel - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * @type \Google\Cloud\Metastore\V1alpha\EncryptionConfig $encryption_config - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * @type \Google\Cloud\Metastore\V1alpha\NetworkConfig $network_config - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * @type int $database_type - * Immutable. The database type that the Metastore service stores its data. - * @type \Google\Cloud\Metastore\V1alpha\TelemetryConfig $telemetry_config - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * @type \Google\Cloud\Metastore\V1alpha\ScalingConfig $scaling_config - * Scaling configuration of the metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Configuration information specific to running Hive metastore - * software as the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig hive_metastore_config = 5; - * @return \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig|null - */ - public function getHiveMetastoreConfig() - { - return $this->readOneof(5); - } - - public function hasHiveMetastoreConfig() - { - return $this->hasOneof(5); - } - - /** - * Configuration information specific to running Hive metastore - * software as the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig hive_metastore_config = 5; - * @param \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig $var - * @return $this - */ - public function setHiveMetastoreConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Service\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getArtifactGcsUri() - { - return $this->artifact_gcs_uri; - } - - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setArtifactGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->artifact_gcs_uri = $var; - - return $this; - } - - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.Tier tier = 13; - * @return int - */ - public function getTier() - { - return $this->tier; - } - - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.Tier tier = 13; - * @param int $var - * @return $this - */ - public function setTier($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Service\Tier::class); - $this->tier = $var; - - return $this; - } - - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataIntegration metadata_integration = 14; - * @return \Google\Cloud\Metastore\V1alpha\MetadataIntegration|null - */ - public function getMetadataIntegration() - { - return $this->metadata_integration; - } - - public function hasMetadataIntegration() - { - return isset($this->metadata_integration); - } - - public function clearMetadataIntegration() - { - unset($this->metadata_integration); - } - - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataIntegration metadata_integration = 14; - * @param \Google\Cloud\Metastore\V1alpha\MetadataIntegration $var - * @return $this - */ - public function setMetadataIntegration($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataIntegration::class); - $this->metadata_integration = $var; - - return $this; - } - - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MaintenanceWindow maintenance_window = 15; - * @return \Google\Cloud\Metastore\V1alpha\MaintenanceWindow|null - */ - public function getMaintenanceWindow() - { - return $this->maintenance_window; - } - - public function hasMaintenanceWindow() - { - return isset($this->maintenance_window); - } - - public function clearMaintenanceWindow() - { - unset($this->maintenance_window); - } - - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MaintenanceWindow maintenance_window = 15; - * @param \Google\Cloud\Metastore\V1alpha\MaintenanceWindow $var - * @return $this - */ - public function setMaintenanceWindow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MaintenanceWindow::class); - $this->maintenance_window = $var; - - return $this; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1alpha\MetadataManagementActivity|null - */ - public function getMetadataManagementActivity() - { - return $this->metadata_management_activity; - } - - public function hasMetadataManagementActivity() - { - return isset($this->metadata_management_activity); - } - - public function clearMetadataManagementActivity() - { - unset($this->metadata_management_activity); - } - - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1alpha\MetadataManagementActivity $var - * @return $this - */ - public function setMetadataManagementActivity($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataManagementActivity::class); - $this->metadata_management_activity = $var; - - return $this; - } - - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getReleaseChannel() - { - return $this->release_channel; - } - - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setReleaseChannel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Service\ReleaseChannel::class); - $this->release_channel = $var; - - return $this; - } - - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\Metastore\V1alpha\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\Metastore\V1alpha\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 21; - * @return \Google\Cloud\Metastore\V1alpha\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 21; - * @param \Google\Cloud\Metastore\V1alpha\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getDatabaseType() - { - return $this->database_type; - } - - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setDatabaseType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Service\DatabaseType::class); - $this->database_type = $var; - - return $this; - } - - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig telemetry_config = 23; - * @return \Google\Cloud\Metastore\V1alpha\TelemetryConfig|null - */ - public function getTelemetryConfig() - { - return $this->telemetry_config; - } - - public function hasTelemetryConfig() - { - return isset($this->telemetry_config); - } - - public function clearTelemetryConfig() - { - unset($this->telemetry_config); - } - - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig telemetry_config = 23; - * @param \Google\Cloud\Metastore\V1alpha\TelemetryConfig $var - * @return $this - */ - public function setTelemetryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\TelemetryConfig::class); - $this->telemetry_config = $var; - - return $this; - } - - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig scaling_config = 24; - * @return \Google\Cloud\Metastore\V1alpha\ScalingConfig|null - */ - public function getScalingConfig() - { - return $this->scaling_config; - } - - public function hasScalingConfig() - { - return isset($this->scaling_config); - } - - public function clearScalingConfig() - { - unset($this->scaling_config); - } - - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig scaling_config = 24; - * @param \Google\Cloud\Metastore\V1alpha\ScalingConfig $var - * @return $this - */ - public function setScalingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\ScalingConfig::class); - $this->scaling_config = $var; - - return $this; - } - - /** - * @return string - */ - public function getMetastoreConfig() - { - return $this->whichOneof("metastore_config"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Service/DatabaseType.php b/DataprocMetastore/src/V1alpha/Service/DatabaseType.php deleted file mode 100644 index af3d2b8bc594..000000000000 --- a/DataprocMetastore/src/V1alpha/Service/DatabaseType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1alpha.Service.DatabaseType - */ -class DatabaseType -{ - /** - * The DATABASE_TYPE is not set. - * - * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; - */ - const DATABASE_TYPE_UNSPECIFIED = 0; - /** - * MySQL is used to persist the metastore data. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - /** - * Spanner is used to persist the metastore data. - * - * Generated from protobuf enum SPANNER = 2; - */ - const SPANNER = 2; - - private static $valueToName = [ - self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - self::SPANNER => 'SPANNER', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1alpha\Service_DatabaseType::class); - diff --git a/DataprocMetastore/src/V1alpha/Service/ReleaseChannel.php b/DataprocMetastore/src/V1alpha/Service/ReleaseChannel.php deleted file mode 100644 index 5bc9f8664adb..000000000000 --- a/DataprocMetastore/src/V1alpha/Service/ReleaseChannel.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.metastore.v1alpha.Service.ReleaseChannel - */ -class ReleaseChannel -{ - /** - * Release channel is not specified. - * - * Generated from protobuf enum RELEASE_CHANNEL_UNSPECIFIED = 0; - */ - const RELEASE_CHANNEL_UNSPECIFIED = 0; - /** - * The `CANARY` release channel contains the newest features, which may be - * unstable and subject to unresolved issues with no known workarounds. - * Services using the `CANARY` release channel are not subject to any SLAs. - * - * Generated from protobuf enum CANARY = 1; - */ - const CANARY = 1; - /** - * The `STABLE` release channel contains features that are considered stable - * and have been validated for production use. - * - * Generated from protobuf enum STABLE = 2; - */ - const STABLE = 2; - - private static $valueToName = [ - self::RELEASE_CHANNEL_UNSPECIFIED => 'RELEASE_CHANNEL_UNSPECIFIED', - self::CANARY => 'CANARY', - self::STABLE => 'STABLE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReleaseChannel::class, \Google\Cloud\Metastore\V1alpha\Service_ReleaseChannel::class); - diff --git a/DataprocMetastore/src/V1alpha/Service/State.php b/DataprocMetastore/src/V1alpha/Service/State.php deleted file mode 100644 index ccf6ccae3a0e..000000000000 --- a/DataprocMetastore/src/V1alpha/Service/State.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.metastore.v1alpha.Service.State - */ -class State -{ - /** - * The state of the metastore service is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metastore service is in the process of being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The metastore service is running and ready to serve queries. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The metastore service is entering suspension. Its query-serving - * availability may cease unexpectedly. - * - * Generated from protobuf enum SUSPENDING = 3; - */ - const SUSPENDING = 3; - /** - * The metastore service is suspended and unable to serve queries. - * - * Generated from protobuf enum SUSPENDED = 4; - */ - const SUSPENDED = 4; - /** - * The metastore service is being updated. It remains usable but cannot - * accept additional update requests or be deleted at this time. - * - * Generated from protobuf enum UPDATING = 5; - */ - const UPDATING = 5; - /** - * The metastore service is undergoing deletion. It cannot be used. - * - * Generated from protobuf enum DELETING = 6; - */ - const DELETING = 6; - /** - * The metastore service has encountered an error and cannot be used. The - * metastore service should be deleted. - * - * Generated from protobuf enum ERROR = 7; - */ - const ERROR = 7; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::SUSPENDING => 'SUSPENDING', - self::SUSPENDED => 'SUSPENDED', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\Service_State::class); - diff --git a/DataprocMetastore/src/V1alpha/Service/Tier.php b/DataprocMetastore/src/V1alpha/Service/Tier.php deleted file mode 100644 index 83e8f852b49e..000000000000 --- a/DataprocMetastore/src/V1alpha/Service/Tier.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.metastore.v1alpha.Service.Tier - */ -class Tier -{ - /** - * The tier is not set. - * - * Generated from protobuf enum TIER_UNSPECIFIED = 0; - */ - const TIER_UNSPECIFIED = 0; - /** - * The developer tier provides limited scalability and no fault tolerance. - * Good for low-cost proof-of-concept. - * - * Generated from protobuf enum DEVELOPER = 1; - */ - const DEVELOPER = 1; - /** - * The enterprise tier provides multi-zone high availability, and sufficient - * scalability for enterprise-level Dataproc Metastore workloads. - * - * Generated from protobuf enum ENTERPRISE = 3; - */ - const ENTERPRISE = 3; - - private static $valueToName = [ - self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', - self::DEVELOPER => 'DEVELOPER', - self::ENTERPRISE => 'ENTERPRISE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Tier::class, \Google\Cloud\Metastore\V1alpha\Service_Tier::class); - diff --git a/DataprocMetastore/src/V1alpha/Service_DatabaseType.php b/DataprocMetastore/src/V1alpha/Service_DatabaseType.php deleted file mode 100644 index 6abe29c080db..000000000000 --- a/DataprocMetastore/src/V1alpha/Service_DatabaseType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.TelemetryConfig - */ -class TelemetryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig.LogFormat log_format = 1; - */ - private $log_format = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $log_format - * The output format of the Dataproc Metastore service's logs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig.LogFormat log_format = 1; - * @return int - */ - public function getLogFormat() - { - return $this->log_format; - } - - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig.LogFormat log_format = 1; - * @param int $var - * @return $this - */ - public function setLogFormat($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\TelemetryConfig\LogFormat::class); - $this->log_format = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/TelemetryConfig/LogFormat.php b/DataprocMetastore/src/V1alpha/TelemetryConfig/LogFormat.php deleted file mode 100644 index e1ea20ce4cc9..000000000000 --- a/DataprocMetastore/src/V1alpha/TelemetryConfig/LogFormat.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.metastore.v1alpha.TelemetryConfig.LogFormat - */ -class LogFormat -{ - /** - * The LOG_FORMAT is not set. - * - * Generated from protobuf enum LOG_FORMAT_UNSPECIFIED = 0; - */ - const LOG_FORMAT_UNSPECIFIED = 0; - /** - * Logging output uses the legacy `textPayload` format. - * - * Generated from protobuf enum LEGACY = 1; - */ - const LEGACY = 1; - /** - * Logging output uses the `jsonPayload` format. - * - * Generated from protobuf enum JSON = 2; - */ - const JSON = 2; - - private static $valueToName = [ - self::LOG_FORMAT_UNSPECIFIED => 'LOG_FORMAT_UNSPECIFIED', - self::LEGACY => 'LEGACY', - self::JSON => 'JSON', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LogFormat::class, \Google\Cloud\Metastore\V1alpha\TelemetryConfig_LogFormat::class); - diff --git a/DataprocMetastore/src/V1alpha/TelemetryConfig_LogFormat.php b/DataprocMetastore/src/V1alpha/TelemetryConfig_LogFormat.php deleted file mode 100644 index 0dae8f5193c6..000000000000 --- a/DataprocMetastore/src/V1alpha/TelemetryConfig_LogFormat.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.UpdateFederationRequest - */ -class UpdateFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1alpha\Federation $federation - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Federation|null - */ - public function getFederation() - { - return $this->federation; - } - - public function hasFederation() - { - return isset($this->federation); - } - - public function clearFederation() - { - unset($this->federation); - } - - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Federation $var - * @return $this - */ - public function setFederation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Federation::class); - $this->federation = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/UpdateMetadataImportRequest.php b/DataprocMetastore/src/V1alpha/UpdateMetadataImportRequest.php deleted file mode 100644 index 79a863ac58e9..000000000000 --- a/DataprocMetastore/src/V1alpha/UpdateMetadataImportRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.metastore.v1alpha.UpdateMetadataImportRequest - */ -class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1alpha\MetadataImport $metadata_import - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\MetadataImport|null - */ - public function getMetadataImport() - { - return $this->metadata_import; - } - - public function hasMetadataImport() - { - return isset($this->metadata_import); - } - - public function clearMetadataImport() - { - unset($this->metadata_import); - } - - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\MetadataImport $var - * @return $this - */ - public function setMetadataImport($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataImport::class); - $this->metadata_import = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/UpdateServiceRequest.php b/DataprocMetastore/src/V1alpha/UpdateServiceRequest.php deleted file mode 100644 index 7d81f4d579db..000000000000 --- a/DataprocMetastore/src/V1alpha/UpdateServiceRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.metastore.v1alpha.UpdateServiceRequest - */ -class UpdateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1alpha\Service $service - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/gapic_metadata.json b/DataprocMetastore/src/V1alpha/gapic_metadata.json deleted file mode 100644 index 1276f9994a16..000000000000 --- a/DataprocMetastore/src/V1alpha/gapic_metadata.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.metastore.v1alpha", - "libraryPackage": "Google\\Cloud\\Metastore\\V1alpha", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreGapicClient", - "rpcs": { - "AlterMetadataResourceLocation": { - "methods": [ - "alterMetadataResourceLocation" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "CreateMetadataImport": { - "methods": [ - "createMetadataImport" - ] - }, - "CreateService": { - "methods": [ - "createService" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "DeleteService": { - "methods": [ - "deleteService" - ] - }, - "ExportMetadata": { - "methods": [ - "exportMetadata" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetMetadataImport": { - "methods": [ - "getMetadataImport" - ] - }, - "GetService": { - "methods": [ - "getService" - ] - }, - "ListBackups": { - "methods": [ - "listBackups" - ] - }, - "ListMetadataImports": { - "methods": [ - "listMetadataImports" - ] - }, - "ListServices": { - "methods": [ - "listServices" - ] - }, - "MoveTableToDatabase": { - "methods": [ - "moveTableToDatabase" - ] - }, - "QueryMetadata": { - "methods": [ - "queryMetadata" - ] - }, - "RemoveIamPolicy": { - "methods": [ - "removeIamPolicy" - ] - }, - "RestoreService": { - "methods": [ - "restoreService" - ] - }, - "UpdateMetadataImport": { - "methods": [ - "updateMetadataImport" - ] - }, - "UpdateService": { - "methods": [ - "updateService" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - }, - "DataprocMetastoreFederation": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreFederationGapicClient", - "rpcs": { - "CreateFederation": { - "methods": [ - "createFederation" - ] - }, - "DeleteFederation": { - "methods": [ - "deleteFederation" - ] - }, - "GetFederation": { - "methods": [ - "getFederation" - ] - }, - "ListFederations": { - "methods": [ - "listFederations" - ] - }, - "UpdateFederation": { - "methods": [ - "updateFederation" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_client_config.json b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_client_config.json deleted file mode 100644 index 2355e4bd3525..000000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_client_config.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "interfaces": { - "google.cloud.metastore.v1alpha.DataprocMetastore": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "AlterMetadataResourceLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ExportMetadata": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetService": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListMetadataImports": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListServices": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "MoveTableToDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "QueryMetadata": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RemoveIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RestoreService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_descriptor_config.php b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_descriptor_config.php deleted file mode 100644 index 6bb0b1c9e93b..000000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_descriptor_config.php +++ /dev/null @@ -1,201 +0,0 @@ - [ - 'google.cloud.metastore.v1alpha.DataprocMetastore' => [ - 'AlterMetadataResourceLocation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\AlterMetadataResourceLocationResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Backup', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateMetadataImport' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MetadataImport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Service', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ExportMetadata' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MetadataExport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'MoveTableToDatabase' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MoveTableToDatabaseResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'QueryMetadata' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\QueryMetadataResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RestoreService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Restore', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateMetadataImport' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MetadataImport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Service', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListBackups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackups', - ], - ], - 'ListMetadataImports' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMetadataImports', - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - ], - ], -]; diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_client_config.json b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_client_config.json deleted file mode 100644 index 360aa62b94ff..000000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_client_config.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "interfaces": { - "google.cloud.metastore.v1alpha.DataprocMetastoreFederation": { - "retry_codes": { - "no_retry_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - } - }, - "methods": { - "CreateFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListFederations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_descriptor_config.php b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_descriptor_config.php deleted file mode 100644 index 11f1cbce2581..000000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_descriptor_config.php +++ /dev/null @@ -1,91 +0,0 @@ - [ - 'google.cloud.metastore.v1alpha.DataprocMetastoreFederation' => [ - 'CreateFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Federation', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Federation', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListFederations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFederations', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - ], - ], -]; diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_rest_client_config.php b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_rest_client_config.php deleted file mode 100644 index 6265cadd23a0..000000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_rest_client_config.php +++ /dev/null @@ -1,263 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.metastore.v1alpha.DataprocMetastoreFederation' => [ - 'CreateFederation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/federations', - 'body' => 'federation', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'federation_id', - ], - ], - 'DeleteFederation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/federations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFederation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/federations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListFederations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/federations', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateFederation' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{federation.name=projects/*/locations/*/federations/*}', - 'body' => 'federation', - 'placeholders' => [ - 'federation.name' => [ - 'getters' => [ - 'getFederation', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php deleted file mode 100644 index cc57a96689a2..000000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php +++ /dev/null @@ -1,436 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.metastore.v1alpha.DataprocMetastore' => [ - 'AlterMetadataResourceLocation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:alterLocation', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'CreateBackup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/services/*}/backups', - 'body' => 'backup', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_id', - ], - ], - 'CreateMetadataImport' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/services/*}/metadataImports', - 'body' => 'metadata_import', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'metadata_import_id', - ], - ], - 'CreateService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/services', - 'body' => 'service', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'service_id', - ], - ], - 'DeleteBackup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteService' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ExportMetadata' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:exportMetadata', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'GetBackup' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetMetadataImport' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*/metadataImports/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetService' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBackups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/services/*}/backups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListMetadataImports' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/services/*}/metadataImports', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListServices' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/services', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'MoveTableToDatabase' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:moveTableToDatabase', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'QueryMetadata' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:queryMetadata', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'RemoveIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/**}:removeIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'RestoreService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:restore', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'UpdateMetadataImport' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{metadata_import.name=projects/*/locations/*/services/*/metadataImports/*}', - 'body' => 'metadata_import', - 'placeholders' => [ - 'metadata_import.name' => [ - 'getters' => [ - 'getMetadataImport', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateService' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{service.name=projects/*/locations/*/services/*}', - 'body' => 'service', - 'placeholders' => [ - 'service.name' => [ - 'getters' => [ - 'getService', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationRequest.php b/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationRequest.php deleted file mode 100644 index e341494d7603..000000000000 --- a/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationRequest.php +++ /dev/null @@ -1,164 +0,0 @@ -google.cloud.metastore.v1beta.AlterMetadataResourceLocationRequest - */ -class AlterMetadataResourceLocationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $resource_name = ''; - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $location_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $resource_name - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @type string $location_uri - * Required. The new location URI for the metadata resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getResourceName() - { - return $this->resource_name; - } - - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setResourceName($var) - { - GPBUtil::checkString($var, True); - $this->resource_name = $var; - - return $this; - } - - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLocationUri() - { - return $this->location_uri; - } - - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLocationUri($var) - { - GPBUtil::checkString($var, True); - $this->location_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationResponse.php b/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationResponse.php deleted file mode 100644 index 03eec5061def..000000000000 --- a/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.metastore.v1beta.AlterMetadataResourceLocationResponse - */ -class AlterMetadataResourceLocationResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1beta/AuxiliaryVersionConfig.php b/DataprocMetastore/src/V1beta/AuxiliaryVersionConfig.php deleted file mode 100644 index 10820cee527a..000000000000 --- a/DataprocMetastore/src/V1beta/AuxiliaryVersionConfig.php +++ /dev/null @@ -1,169 +0,0 @@ -google.cloud.metastore.v1beta.AuxiliaryVersionConfig - */ -class AuxiliaryVersionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - */ - private $version = ''; - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - */ - private $config_overrides; - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $network_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * @type array|\Google\Protobuf\Internal\MapField $config_overrides - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * @type \Google\Cloud\Metastore\V1beta\NetworkConfig $network_config - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getConfigOverrides() - { - return $this->config_overrides; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setConfigOverrides($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->config_overrides = $arr; - - return $this; - } - - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1beta\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1beta\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/BackendMetastore.php b/DataprocMetastore/src/V1beta/BackendMetastore.php deleted file mode 100644 index 52d4d6a684b9..000000000000 --- a/DataprocMetastore/src/V1beta/BackendMetastore.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.metastore.v1beta.BackendMetastore - */ -class BackendMetastore extends \Google\Protobuf\Internal\Message -{ - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.BackendMetastore.MetastoreType metastore_type = 2; - */ - private $metastore_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * @type int $metastore_type - * The type of the backend metastore. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.BackendMetastore.MetastoreType metastore_type = 2; - * @return int - */ - public function getMetastoreType() - { - return $this->metastore_type; - } - - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.BackendMetastore.MetastoreType metastore_type = 2; - * @param int $var - * @return $this - */ - public function setMetastoreType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\BackendMetastore\MetastoreType::class); - $this->metastore_type = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/BackendMetastore/MetastoreType.php b/DataprocMetastore/src/V1beta/BackendMetastore/MetastoreType.php deleted file mode 100644 index 4f52e47ec7df..000000000000 --- a/DataprocMetastore/src/V1beta/BackendMetastore/MetastoreType.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.metastore.v1beta.BackendMetastore.MetastoreType - */ -class MetastoreType -{ - /** - * The metastore type is not set. - * - * Generated from protobuf enum METASTORE_TYPE_UNSPECIFIED = 0; - */ - const METASTORE_TYPE_UNSPECIFIED = 0; - /** - * The backend metastore is Dataplex. - * - * Generated from protobuf enum DATAPLEX = 1; - */ - const DATAPLEX = 1; - /** - * The backend metastore is BigQuery. - * - * Generated from protobuf enum BIGQUERY = 2; - */ - const BIGQUERY = 2; - /** - * The backend metastore is Dataproc Metastore. - * - * Generated from protobuf enum DATAPROC_METASTORE = 3; - */ - const DATAPROC_METASTORE = 3; - - private static $valueToName = [ - self::METASTORE_TYPE_UNSPECIFIED => 'METASTORE_TYPE_UNSPECIFIED', - self::DATAPLEX => 'DATAPLEX', - self::BIGQUERY => 'BIGQUERY', - self::DATAPROC_METASTORE => 'DATAPROC_METASTORE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MetastoreType::class, \Google\Cloud\Metastore\V1beta\BackendMetastore_MetastoreType::class); - diff --git a/DataprocMetastore/src/V1beta/BackendMetastore_MetastoreType.php b/DataprocMetastore/src/V1beta/BackendMetastore_MetastoreType.php deleted file mode 100644 index ca05921efe5b..000000000000 --- a/DataprocMetastore/src/V1beta/BackendMetastore_MetastoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.Backup - */ -class Backup extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $service_revision = null; - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - */ - private $description = ''; - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $restoring_services; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the backup was started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the backup finished creating. - * @type int $state - * Output only. The current state of the backup. - * @type \Google\Cloud\Metastore\V1beta\Service $service_revision - * Output only. The revision of the service at the time of backup. - * @type string $description - * The description of the backup. - * @type array|\Google\Protobuf\Internal\RepeatedField $restoring_services - * Output only. Services that are restoring from the backup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Backup\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1beta\Service|null - */ - public function getServiceRevision() - { - return $this->service_revision; - } - - public function hasServiceRevision() - { - return isset($this->service_revision); - } - - public function clearServiceRevision() - { - unset($this->service_revision); - } - - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1beta\Service $var - * @return $this - */ - public function setServiceRevision($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Service::class); - $this->service_revision = $var; - - return $this; - } - - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestoringServices() - { - return $this->restoring_services; - } - - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestoringServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->restoring_services = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Backup/State.php b/DataprocMetastore/src/V1beta/Backup/State.php deleted file mode 100644 index b66b7d93284c..000000000000 --- a/DataprocMetastore/src/V1beta/Backup/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.metastore.v1beta.Backup.State - */ -class State -{ - /** - * The state of the backup is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The backup is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The backup is being deleted. - * - * Generated from protobuf enum DELETING = 2; - */ - const DELETING = 2; - /** - * The backup is active and ready to use. - * - * Generated from protobuf enum ACTIVE = 3; - */ - const ACTIVE = 3; - /** - * The backup failed. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * The backup is being restored. - * - * Generated from protobuf enum RESTORING = 5; - */ - const RESTORING = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::ACTIVE => 'ACTIVE', - self::FAILED => 'FAILED', - self::RESTORING => 'RESTORING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\Backup_State::class); - diff --git a/DataprocMetastore/src/V1beta/Backup_State.php b/DataprocMetastore/src/V1beta/Backup_State.php deleted file mode 100644 index 7975aac93c14..000000000000 --- a/DataprocMetastore/src/V1beta/Backup_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.CreateBackupRequest - */ -class CreateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $backup_id = ''; - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $backup = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $backup_id - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @type \Google\Cloud\Metastore\V1beta\Backup $backup - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBackupId() - { - return $this->backup_id; - } - - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBackupId($var) - { - GPBUtil::checkString($var, True); - $this->backup_id = $var; - - return $this; - } - - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Backup::class); - $this->backup = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/CreateFederationRequest.php b/DataprocMetastore/src/V1beta/CreateFederationRequest.php deleted file mode 100644 index 2d8cda1c1bc5..000000000000 --- a/DataprocMetastore/src/V1beta/CreateFederationRequest.php +++ /dev/null @@ -1,247 +0,0 @@ -google.cloud.metastore.v1beta.CreateFederationRequest - */ -class CreateFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation_id = ''; - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type string $federation_id - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @type \Google\Cloud\Metastore\V1beta\Federation $federation - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFederationId() - { - return $this->federation_id; - } - - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFederationId($var) - { - GPBUtil::checkString($var, True); - $this->federation_id = $var; - - return $this; - } - - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Federation|null - */ - public function getFederation() - { - return $this->federation; - } - - public function hasFederation() - { - return isset($this->federation); - } - - public function clearFederation() - { - unset($this->federation); - } - - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Federation $var - * @return $this - */ - public function setFederation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Federation::class); - $this->federation = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/CreateMetadataImportRequest.php b/DataprocMetastore/src/V1beta/CreateMetadataImportRequest.php deleted file mode 100644 index 93e9965ead57..000000000000 --- a/DataprocMetastore/src/V1beta/CreateMetadataImportRequest.php +++ /dev/null @@ -1,248 +0,0 @@ -google.cloud.metastore.v1beta.CreateMetadataImportRequest - */ -class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import_id = ''; - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $metadata_import_id - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @type \Google\Cloud\Metastore\V1beta\MetadataImport $metadata_import - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getMetadataImportId() - { - return $this->metadata_import_id; - } - - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setMetadataImportId($var) - { - GPBUtil::checkString($var, True); - $this->metadata_import_id = $var; - - return $this; - } - - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\MetadataImport|null - */ - public function getMetadataImport() - { - return $this->metadata_import; - } - - public function hasMetadataImport() - { - return isset($this->metadata_import); - } - - public function clearMetadataImport() - { - unset($this->metadata_import); - } - - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\MetadataImport $var - * @return $this - */ - public function setMetadataImport($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataImport::class); - $this->metadata_import = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/CreateServiceRequest.php b/DataprocMetastore/src/V1beta/CreateServiceRequest.php deleted file mode 100644 index de19e88b9554..000000000000 --- a/DataprocMetastore/src/V1beta/CreateServiceRequest.php +++ /dev/null @@ -1,248 +0,0 @@ -google.cloud.metastore.v1beta.CreateServiceRequest - */ -class CreateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service_id = ''; - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type string $service_id - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @type \Google\Cloud\Metastore\V1beta\Service $service - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getServiceId() - { - return $this->service_id; - } - - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setServiceId($var) - { - GPBUtil::checkString($var, True); - $this->service_id = $var; - - return $this; - } - - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DataCatalogConfig.php b/DataprocMetastore/src/V1beta/DataCatalogConfig.php deleted file mode 100644 index 25b5be738fee..000000000000 --- a/DataprocMetastore/src/V1beta/DataCatalogConfig.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.metastore.v1beta.DataCatalogConfig - */ -class DataCatalogConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - */ - private $enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $enabled - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - * @return bool - */ - public function getEnabled() - { - return $this->enabled; - } - - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DatabaseDumpSpec.php b/DataprocMetastore/src/V1beta/DatabaseDumpSpec.php deleted file mode 100644 index 3f8713173032..000000000000 --- a/DataprocMetastore/src/V1beta/DatabaseDumpSpec.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.metastore.v1beta.DatabaseDumpSpec - */ -class DatabaseDumpSpec extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1beta/DatabaseDumpSpec/Type.php b/DataprocMetastore/src/V1beta/DatabaseDumpSpec/Type.php deleted file mode 100644 index 47888ab7a90a..000000000000 --- a/DataprocMetastore/src/V1beta/DatabaseDumpSpec/Type.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1beta.DatabaseDumpSpec.Type - */ -class Type -{ - /** - * The type of the database dump is unknown. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * Database dump is a MySQL dump file. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - /** - * Database dump contains Avro files. - * - * Generated from protobuf enum AVRO = 2; - */ - const AVRO = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - self::AVRO => 'AVRO', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec_Type::class); - diff --git a/DataprocMetastore/src/V1beta/DatabaseDumpSpec_Type.php b/DataprocMetastore/src/V1beta/DatabaseDumpSpec_Type.php deleted file mode 100644 index 4bbc8bd1eb28..000000000000 --- a/DataprocMetastore/src/V1beta/DatabaseDumpSpec_Type.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.DataplexConfig - */ -class DataplexConfig extends \Google\Protobuf\Internal\Message -{ - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - */ - private $lake_resources; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $lake_resources - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLakeResources() - { - return $this->lake_resources; - } - - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLakeResources($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Lake::class); - $this->lake_resources = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DataprocMetastoreClient.php b/DataprocMetastore/src/V1beta/DataprocMetastoreClient.php deleted file mode 100644 index d25109200e3e..000000000000 --- a/DataprocMetastore/src/V1beta/DataprocMetastoreClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/ListFederations', - $argument, - ['\Google\Cloud\Metastore\V1beta\ListFederationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single federation. - * @param \Google\Cloud\Metastore\V1beta\GetFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFederation(\Google\Cloud\Metastore\V1beta\GetFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/GetFederation', - $argument, - ['\Google\Cloud\Metastore\V1beta\Federation', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore federation in a project and location. - * @param \Google\Cloud\Metastore\V1beta\CreateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateFederation(\Google\Cloud\Metastore\V1beta\CreateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/CreateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the fields of a federation. - * @param \Google\Cloud\Metastore\V1beta\UpdateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateFederation(\Google\Cloud\Metastore\V1beta\UpdateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/UpdateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single federation. - * @param \Google\Cloud\Metastore\V1beta\DeleteFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFederation(\Google\Cloud\Metastore\V1beta\DeleteFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/DeleteFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1beta/DataprocMetastoreGrpcClient.php b/DataprocMetastore/src/V1beta/DataprocMetastoreGrpcClient.php deleted file mode 100644 index 4dcc144746e9..000000000000 --- a/DataprocMetastore/src/V1beta/DataprocMetastoreGrpcClient.php +++ /dev/null @@ -1,340 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/ListServices', - $argument, - ['\Google\Cloud\Metastore\V1beta\ListServicesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single service. - * @param \Google\Cloud\Metastore\V1beta\GetServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetService(\Google\Cloud\Metastore\V1beta\GetServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/GetService', - $argument, - ['\Google\Cloud\Metastore\V1beta\Service', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore service in a project and location. - * @param \Google\Cloud\Metastore\V1beta\CreateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateService(\Google\Cloud\Metastore\V1beta\CreateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/CreateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single service. - * @param \Google\Cloud\Metastore\V1beta\UpdateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateService(\Google\Cloud\Metastore\V1beta\UpdateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/UpdateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single service. - * @param \Google\Cloud\Metastore\V1beta\DeleteServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteService(\Google\Cloud\Metastore\V1beta\DeleteServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/DeleteService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists imports in a service. - * @param \Google\Cloud\Metastore\V1beta\ListMetadataImportsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMetadataImports(\Google\Cloud\Metastore\V1beta\ListMetadataImportsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/ListMetadataImports', - $argument, - ['\Google\Cloud\Metastore\V1beta\ListMetadataImportsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single import. - * @param \Google\Cloud\Metastore\V1beta\GetMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMetadataImport(\Google\Cloud\Metastore\V1beta\GetMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/GetMetadataImport', - $argument, - ['\Google\Cloud\Metastore\V1beta\MetadataImport', 'decode'], - $metadata, $options); - } - - /** - * Creates a new MetadataImport in a given project and location. - * @param \Google\Cloud\Metastore\V1beta\CreateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateMetadataImport(\Google\Cloud\Metastore\V1beta\CreateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/CreateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * @param \Google\Cloud\Metastore\V1beta\UpdateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateMetadataImport(\Google\Cloud\Metastore\V1beta\UpdateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/UpdateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Exports metadata from a service. - * @param \Google\Cloud\Metastore\V1beta\ExportMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportMetadata(\Google\Cloud\Metastore\V1beta\ExportMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/ExportMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Restores a service from a backup. - * @param \Google\Cloud\Metastore\V1beta\RestoreServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestoreService(\Google\Cloud\Metastore\V1beta\RestoreServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/RestoreService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists backups in a service. - * @param \Google\Cloud\Metastore\V1beta\ListBackupsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListBackups(\Google\Cloud\Metastore\V1beta\ListBackupsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/ListBackups', - $argument, - ['\Google\Cloud\Metastore\V1beta\ListBackupsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single backup. - * @param \Google\Cloud\Metastore\V1beta\GetBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetBackup(\Google\Cloud\Metastore\V1beta\GetBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/GetBackup', - $argument, - ['\Google\Cloud\Metastore\V1beta\Backup', 'decode'], - $metadata, $options); - } - - /** - * Creates a new backup in a given project and location. - * @param \Google\Cloud\Metastore\V1beta\CreateBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBackup(\Google\Cloud\Metastore\V1beta\CreateBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/CreateBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single backup. - * @param \Google\Cloud\Metastore\V1beta\DeleteBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteBackup(\Google\Cloud\Metastore\V1beta\DeleteBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/DeleteBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Removes the attached IAM policies for a resource - * @param \Google\Cloud\Metastore\V1beta\RemoveIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RemoveIamPolicy(\Google\Cloud\Metastore\V1beta\RemoveIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/RemoveIamPolicy', - $argument, - ['\Google\Cloud\Metastore\V1beta\RemoveIamPolicyResponse', 'decode'], - $metadata, $options); - } - - /** - * Query DPMS metadata. - * @param \Google\Cloud\Metastore\V1beta\QueryMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function QueryMetadata(\Google\Cloud\Metastore\V1beta\QueryMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/QueryMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Move a table to another database. - * @param \Google\Cloud\Metastore\V1beta\MoveTableToDatabaseRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MoveTableToDatabase(\Google\Cloud\Metastore\V1beta\MoveTableToDatabaseRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/MoveTableToDatabase', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * @param \Google\Cloud\Metastore\V1beta\AlterMetadataResourceLocationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AlterMetadataResourceLocation(\Google\Cloud\Metastore\V1beta\AlterMetadataResourceLocationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/AlterMetadataResourceLocation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1beta/DeleteBackupRequest.php b/DataprocMetastore/src/V1beta/DeleteBackupRequest.php deleted file mode 100644 index 7f8e47145af3..000000000000 --- a/DataprocMetastore/src/V1beta/DeleteBackupRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.metastore.v1beta.DeleteBackupRequest - */ -class DeleteBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DeleteFederationRequest.php b/DataprocMetastore/src/V1beta/DeleteFederationRequest.php deleted file mode 100644 index 695a5cc635ec..000000000000 --- a/DataprocMetastore/src/V1beta/DeleteFederationRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.cloud.metastore.v1beta.DeleteFederationRequest - */ -class DeleteFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DeleteServiceRequest.php b/DataprocMetastore/src/V1beta/DeleteServiceRequest.php deleted file mode 100644 index a9795f11a70a..000000000000 --- a/DataprocMetastore/src/V1beta/DeleteServiceRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.metastore.v1beta.DeleteServiceRequest - */ -class DeleteServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/EncryptionConfig.php b/DataprocMetastore/src/V1beta/EncryptionConfig.php deleted file mode 100644 index 21205e790c3f..000000000000 --- a/DataprocMetastore/src/V1beta/EncryptionConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1beta.EncryptionConfig - */ -class EncryptionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - */ - private $kms_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - * @return string - */ - public function getKmsKey() - { - return $this->kms_key; - } - - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - * @param string $var - * @return $this - */ - public function setKmsKey($var) - { - GPBUtil::checkString($var, True); - $this->kms_key = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ErrorDetails.php b/DataprocMetastore/src/V1beta/ErrorDetails.php deleted file mode 100644 index f92d367a604b..000000000000 --- a/DataprocMetastore/src/V1beta/ErrorDetails.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1beta.ErrorDetails - */ -class ErrorDetails extends \Google\Protobuf\Internal\Message -{ - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - */ - private $details; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $details - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDetails() - { - return $this->details; - } - - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDetails($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->details = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ExportMetadataRequest.php b/DataprocMetastore/src/V1beta/ExportMetadataRequest.php deleted file mode 100644 index 1a4845eb5ba6..000000000000 --- a/DataprocMetastore/src/V1beta/ExportMetadataRequest.php +++ /dev/null @@ -1,232 +0,0 @@ -google.cloud.metastore.v1beta.ExportMetadataRequest - */ -class ExportMetadataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $database_dump_type = 0; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $destination_gcs_folder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $service - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $database_dump_type - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * - * Generated from protobuf field string destination_gcs_folder = 2; - * @return string - */ - public function getDestinationGcsFolder() - { - return $this->readOneof(2); - } - - public function hasDestinationGcsFolder() - { - return $this->hasOneof(2); - } - - /** - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * - * Generated from protobuf field string destination_gcs_folder = 2; - * @param string $var - * @return $this - */ - public function setDestinationGcsFolder($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDatabaseDumpType() - { - return $this->database_dump_type; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDatabaseDumpType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec\Type::class); - $this->database_dump_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/Federation.php b/DataprocMetastore/src/V1beta/Federation.php deleted file mode 100644 index 8aab89740111..000000000000 --- a/DataprocMetastore/src/V1beta/Federation.php +++ /dev/null @@ -1,433 +0,0 @@ -google.cloud.metastore.v1beta.Federation - */ -class Federation extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $version = ''; - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - */ - private $backend_metastores; - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state_message = ''; - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metastore federation was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metastore federation was last updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * User-defined labels for the metastore federation. - * @type string $version - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * @type array|\Google\Protobuf\Internal\MapField $backend_metastores - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * @type string $endpoint_uri - * Output only. The federation endpoint. - * @type int $state - * Output only. The current state of the federation. - * @type string $state_message - * Output only. Additional information about the current state of the - * metastore federation, if available. - * @type string $uid - * Output only. The globally unique resource identifier of the metastore - * federation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getBackendMetastores() - { - return $this->backend_metastores; - } - - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setBackendMetastores($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\BackendMetastore::class); - $this->backend_metastores = $arr; - - return $this; - } - - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Federation\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Federation/State.php b/DataprocMetastore/src/V1beta/Federation/State.php deleted file mode 100644 index ece483cad3f2..000000000000 --- a/DataprocMetastore/src/V1beta/Federation/State.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.metastore.v1beta.Federation.State - */ -class State -{ - /** - * The state of the metastore federation is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metastore federation is in the process of being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The metastore federation is running and ready to serve queries. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The metastore federation is being updated. It remains usable but cannot - * accept additional update requests or be deleted at this time. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The metastore federation is undergoing deletion. It cannot be used. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The metastore federation has encountered an error and cannot be used. The - * metastore federation should be deleted. - * - * Generated from protobuf enum ERROR = 5; - */ - const ERROR = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\Federation_State::class); - diff --git a/DataprocMetastore/src/V1beta/Federation_State.php b/DataprocMetastore/src/V1beta/Federation_State.php deleted file mode 100644 index 55898347c3eb..000000000000 --- a/DataprocMetastore/src/V1beta/Federation_State.php +++ /dev/null @@ -1,16 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class DataprocMetastoreFederationGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1beta.DataprocMetastoreFederation'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $federationNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_federation_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', - ], - ], - ]; - } - - private static function getFederationNameTemplate() - { - if (self::$federationNameTemplate == null) { - self::$federationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/federations/{federation}'); - } - - return self::$federationNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'federation' => self::getFederationNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a federation - * resource. - * - * @param string $project - * @param string $location - * @param string $federation - * - * @return string The formatted federation resource. - * - * @experimental - */ - public static function federationName($project, $location, $federation) - { - return self::getFederationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'federation' => $federation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - federation: projects/{project}/locations/{location}/federations/{federation} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'metastore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a metastore federation in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $federationId Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Federation $federation Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createFederation($parent, $federationId, $federation, array $optionalArgs = []) - { - $request = new CreateFederationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFederationId($federationId); - $request->setFederation($federation); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'deleteFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to delete, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteFederation($name, array $optionalArgs = []) - { - $request = new DeleteFederationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the details of a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $response = $dataprocMetastoreFederationClient->getFederation($formattedName); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1beta\Federation - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getFederation($name, array $optionalArgs = []) - { - $request = new GetFederationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetFederation', Federation::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists federations in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listFederations($parent, array $optionalArgs = []) - { - $request = new ListFederationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFederations', $optionalArgs, ListFederationsResponse::class, $request); - } - - /** - * Updates the fields of a federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $updateMask = new FieldMask(); - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'updateFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Federation $federation Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateFederation($updateMask, $federation, array $optionalArgs = []) - { - $request = new UpdateFederationRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setFederation($federation); - $requestParamHeaders['federation.name'] = $federation->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $response = $dataprocMetastoreFederationClient->getLocation(); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreFederationClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreFederationClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreFederationClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/DataprocMetastore/src/V1beta/Gapic/DataprocMetastoreGapicClient.php b/DataprocMetastore/src/V1beta/Gapic/DataprocMetastoreGapicClient.php deleted file mode 100644 index a8d70fca27c5..000000000000 --- a/DataprocMetastore/src/V1beta/Gapic/DataprocMetastoreGapicClient.php +++ /dev/null @@ -1,2408 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class DataprocMetastoreGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1beta.DataprocMetastore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $backupNameTemplate; - - private static $lakeNameTemplate; - - private static $locationNameTemplate; - - private static $metadataImportNameTemplate; - - private static $networkNameTemplate; - - private static $serviceNameTemplate; - - private static $subnetworkNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_rest_client_config.php', - ], - ], - ]; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getLakeNameTemplate() - { - if (self::$lakeNameTemplate == null) { - self::$lakeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/lakes/{lake}'); - } - - return self::$lakeNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getMetadataImportNameTemplate() - { - if (self::$metadataImportNameTemplate == null) { - self::$metadataImportNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import}'); - } - - return self::$metadataImportNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getSubnetworkNameTemplate() - { - if (self::$subnetworkNameTemplate == null) { - self::$subnetworkNameTemplate = new PathTemplate('projects/{project}/regions/{region}/subnetworks/{subnetwork}'); - } - - return self::$subnetworkNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'backup' => self::getBackupNameTemplate(), - 'lake' => self::getLakeNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'metadataImport' => self::getMetadataImportNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'service' => self::getServiceNameTemplate(), - 'subnetwork' => self::getSubnetworkNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $backup - * - * @return string The formatted backup resource. - * - * @experimental - */ - public static function backupName($project, $location, $service, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a lake - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * - * @return string The formatted lake resource. - * - * @experimental - */ - public static function lakeName($project, $location, $lake) - { - return self::getLakeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * metadata_import resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $metadataImport - * - * @return string The formatted metadata_import resource. - * - * @experimental - */ - public static function metadataImportName($project, $location, $service, $metadataImport) - { - return self::getMetadataImportNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'metadata_import' => $metadataImport, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - * - * @experimental - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - * - * @experimental - */ - public static function serviceName($project, $location, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subnetwork - * resource. - * - * @param string $project - * @param string $region - * @param string $subnetwork - * - * @return string The formatted subnetwork resource. - * - * @experimental - */ - public static function subnetworkName($project, $region, $subnetwork) - { - return self::getSubnetworkNameTemplate()->render([ - 'project' => $project, - 'region' => $region, - 'subnetwork' => $subnetwork, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - backup: projects/{project}/locations/{location}/services/{service}/backups/{backup} - * - lake: projects/{project}/locations/{location}/lakes/{lake} - * - location: projects/{project}/locations/{location} - * - metadataImport: projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import} - * - network: projects/{project}/global/networks/{network} - * - service: projects/{project}/locations/{location}/services/{service} - * - subnetwork: projects/{project}/regions/{region}/subnetworks/{subnetwork} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'metastore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $resourceName Required. The relative metadata resource name in the following format. - * - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @param string $locationUri Required. The new location URI for the metadata resource. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function alterMetadataResourceLocation($service, $resourceName, $locationUri, array $optionalArgs = []) - { - $request = new AlterMetadataResourceLocationRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setResourceName($resourceName); - $request->setLocationUri($locationUri); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('AlterMetadataResourceLocation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new backup in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * backup of the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $backupId Required. The ID of the backup, which is used as the final component of the - * backup's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param Backup $backup Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new MetadataImport in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $metadataImportId = 'metadata_import_id'; - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $metadataImportId Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param MetadataImport $metadataImport Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createMetadataImport($parent, $metadataImportId, $metadataImport, array $optionalArgs = []) - { - $request = new CreateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMetadataImportId($metadataImportId); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a metastore service in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * $serviceId = 'service_id'; - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $serviceId Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Service $service Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createService($parent, $serviceId, $service, array $optionalArgs = []) - { - $request = new CreateServiceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setServiceId($serviceId); - $request->setService($service); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to delete, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to delete, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteService($name, array $optionalArgs = []) - { - $request = new DeleteServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Exports metadata from a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'exportMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * export, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $destinationGcsFolder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $databaseDumpType - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec\Type} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function exportMetadata($service, array $optionalArgs = []) - { - $request = new ExportMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['destinationGcsFolder'])) { - $request->setDestinationGcsFolder($optionalArgs['destinationGcsFolder']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['databaseDumpType'])) { - $request->setDatabaseDumpType($optionalArgs['databaseDumpType']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets details of a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $response = $dataprocMetastoreClient->getBackup($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to retrieve, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1beta\Backup - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single import. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - * $response = $dataprocMetastoreClient->getMetadataImport($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1beta\MetadataImport - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getMetadataImport($name, array $optionalArgs = []) - { - $request = new GetMetadataImportRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetMetadataImport', MetadataImport::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the details of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $response = $dataprocMetastoreClient->getService($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1beta\Service - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getService($name, array $optionalArgs = []) - { - $request = new GetServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists backups in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose backups to - * list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists imports in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listMetadataImports($parent, array $optionalArgs = []) - { - $request = new ListMetadataImportsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMetadataImports', $optionalArgs, ListMetadataImportsResponse::class, $request); - } - - /** - * Lists services in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore services - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listServices($parent, array $optionalArgs = []) - { - $request = new ListServicesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); - } - - /** - * Move a table to another database. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $tableName = 'table_name'; - * $dbName = 'db_name'; - * $destinationDbName = 'destination_db_name'; - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'moveTableToDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $tableName Required. The name of the table to be moved. - * @param string $dbName Required. The name of the database where the table resides. - * @param string $destinationDbName Required. The name of the database where the table should be moved. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function moveTableToDatabase($service, $tableName, $dbName, $destinationDbName, array $optionalArgs = []) - { - $request = new MoveTableToDatabaseRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setTableName($tableName); - $request->setDbName($dbName); - $request->setDestinationDbName($destinationDbName); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('MoveTableToDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Query DPMS metadata. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $query = 'query'; - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'queryMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $query Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function queryMetadata($service, $query, array $optionalArgs = []) - { - $request = new QueryMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setQuery($query); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('QueryMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Removes the attached IAM policies for a resource - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->removeIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $asynchronous - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Metastore\V1beta\RemoveIamPolicyResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function removeIamPolicy($resource, array $optionalArgs = []) - { - $request = new RemoveIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['asynchronous'])) { - $request->setAsynchronous($optionalArgs['asynchronous']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RemoveIamPolicy', RemoveIamPolicyResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Restores a service from a backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $formattedBackup = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'restoreService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * restore, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $backup Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $restoreType - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1beta\Restore\RestoreType} - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restoreService($service, $backup, array $optionalArgs = []) - { - $request = new RestoreServiceRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setBackup($backup); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['restoreType'])) { - $request->setRestoreType($optionalArgs['restoreType']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param MetadataImport $metadataImport Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateMetadataImport($updateMask, $metadataImport, array $optionalArgs = []) - { - $request = new UpdateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['metadata_import.name'] = $metadataImport->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Service $service Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateService($updateMask, $service, array $optionalArgs = []) - { - $request = new UpdateServiceRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setService($service); - $requestParamHeaders['service.name'] = $service->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $response = $dataprocMetastoreClient->getLocation(); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/DataprocMetastore/src/V1beta/GetBackupRequest.php b/DataprocMetastore/src/V1beta/GetBackupRequest.php deleted file mode 100644 index 2cd6732ac3cf..000000000000 --- a/DataprocMetastore/src/V1beta/GetBackupRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1beta.GetBackupRequest - */ -class GetBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/GetFederationRequest.php b/DataprocMetastore/src/V1beta/GetFederationRequest.php deleted file mode 100644 index 2f01ea139e86..000000000000 --- a/DataprocMetastore/src/V1beta/GetFederationRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1beta.GetFederationRequest - */ -class GetFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/GetMetadataImportRequest.php b/DataprocMetastore/src/V1beta/GetMetadataImportRequest.php deleted file mode 100644 index bc05ebda0300..000000000000 --- a/DataprocMetastore/src/V1beta/GetMetadataImportRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1beta.GetMetadataImportRequest - */ -class GetMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/GetServiceRequest.php b/DataprocMetastore/src/V1beta/GetServiceRequest.php deleted file mode 100644 index 38396ecf47c2..000000000000 --- a/DataprocMetastore/src/V1beta/GetServiceRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1beta.GetServiceRequest - */ -class GetServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/HiveMetastoreConfig.php b/DataprocMetastore/src/V1beta/HiveMetastoreConfig.php deleted file mode 100644 index 0e2f8307ee49..000000000000 --- a/DataprocMetastore/src/V1beta/HiveMetastoreConfig.php +++ /dev/null @@ -1,278 +0,0 @@ -google.cloud.metastore.v1beta.HiveMetastoreConfig - */ -class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $version = ''; - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - */ - private $config_overrides; - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.KerberosConfig kerberos_config = 3; - */ - private $kerberos_config = null; - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - */ - private $endpoint_protocol = 0; - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - */ - private $auxiliary_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * Immutable. The Hive metastore schema version. - * @type array|\Google\Protobuf\Internal\MapField $config_overrides - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * @type \Google\Cloud\Metastore\V1beta\KerberosConfig $kerberos_config - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * @type int $endpoint_protocol - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * @type array|\Google\Protobuf\Internal\MapField $auxiliary_versions - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getConfigOverrides() - { - return $this->config_overrides; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setConfigOverrides($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->config_overrides = $arr; - - return $this; - } - - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.KerberosConfig kerberos_config = 3; - * @return \Google\Cloud\Metastore\V1beta\KerberosConfig|null - */ - public function getKerberosConfig() - { - return $this->kerberos_config; - } - - public function hasKerberosConfig() - { - return isset($this->kerberos_config); - } - - public function clearKerberosConfig() - { - unset($this->kerberos_config); - } - - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.KerberosConfig kerberos_config = 3; - * @param \Google\Cloud\Metastore\V1beta\KerberosConfig $var - * @return $this - */ - public function setKerberosConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\KerberosConfig::class); - $this->kerberos_config = $var; - - return $this; - } - - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - * @return int - */ - public function getEndpointProtocol() - { - return $this->endpoint_protocol; - } - - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - * @param int $var - * @return $this - */ - public function setEndpointProtocol($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig\EndpointProtocol::class); - $this->endpoint_protocol = $var; - - return $this; - } - - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAuxiliaryVersions() - { - return $this->auxiliary_versions; - } - - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAuxiliaryVersions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\AuxiliaryVersionConfig::class); - $this->auxiliary_versions = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/HiveMetastoreConfig/EndpointProtocol.php b/DataprocMetastore/src/V1beta/HiveMetastoreConfig/EndpointProtocol.php deleted file mode 100644 index 2098fa3fe11e..000000000000 --- a/DataprocMetastore/src/V1beta/HiveMetastoreConfig/EndpointProtocol.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1beta.HiveMetastoreConfig.EndpointProtocol - */ -class EndpointProtocol -{ - /** - * The protocol is not set. - * - * Generated from protobuf enum ENDPOINT_PROTOCOL_UNSPECIFIED = 0; - */ - const ENDPOINT_PROTOCOL_UNSPECIFIED = 0; - /** - * Use the legacy Apache Thrift protocol for the metastore service endpoint. - * - * Generated from protobuf enum THRIFT = 1; - */ - const THRIFT = 1; - /** - * Use the modernized gRPC protocol for the metastore service endpoint. - * - * Generated from protobuf enum GRPC = 2; - */ - const GRPC = 2; - - private static $valueToName = [ - self::ENDPOINT_PROTOCOL_UNSPECIFIED => 'ENDPOINT_PROTOCOL_UNSPECIFIED', - self::THRIFT => 'THRIFT', - self::GRPC => 'GRPC', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EndpointProtocol::class, \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig_EndpointProtocol::class); - diff --git a/DataprocMetastore/src/V1beta/HiveMetastoreConfig_EndpointProtocol.php b/DataprocMetastore/src/V1beta/HiveMetastoreConfig_EndpointProtocol.php deleted file mode 100644 index 2cee82220a45..000000000000 --- a/DataprocMetastore/src/V1beta/HiveMetastoreConfig_EndpointProtocol.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.KerberosConfig - */ -class KerberosConfig extends \Google\Protobuf\Internal\Message -{ - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Secret keytab = 1; - */ - private $keytab = null; - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - */ - private $principal = ''; - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - */ - private $krb5_config_gcs_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1beta\Secret $keytab - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * @type string $principal - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * @type string $krb5_config_gcs_uri - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Secret keytab = 1; - * @return \Google\Cloud\Metastore\V1beta\Secret|null - */ - public function getKeytab() - { - return $this->keytab; - } - - public function hasKeytab() - { - return isset($this->keytab); - } - - public function clearKeytab() - { - unset($this->keytab); - } - - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Secret keytab = 1; - * @param \Google\Cloud\Metastore\V1beta\Secret $var - * @return $this - */ - public function setKeytab($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Secret::class); - $this->keytab = $var; - - return $this; - } - - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - * @return string - */ - public function getPrincipal() - { - return $this->principal; - } - - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - * @param string $var - * @return $this - */ - public function setPrincipal($var) - { - GPBUtil::checkString($var, True); - $this->principal = $var; - - return $this; - } - - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - * @return string - */ - public function getKrb5ConfigGcsUri() - { - return $this->krb5_config_gcs_uri; - } - - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - * @param string $var - * @return $this - */ - public function setKrb5ConfigGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->krb5_config_gcs_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Lake.php b/DataprocMetastore/src/V1beta/Lake.php deleted file mode 100644 index cb26f5fd0f18..000000000000 --- a/DataprocMetastore/src/V1beta/Lake.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1beta.Lake - */ -class Lake extends \Google\Protobuf\Internal\Message -{ - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListBackupsRequest.php b/DataprocMetastore/src/V1beta/ListBackupsRequest.php deleted file mode 100644 index d5be288debd7..000000000000 --- a/DataprocMetastore/src/V1beta/ListBackupsRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.cloud.metastore.v1beta.ListBackupsRequest - */ -class ListBackupsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @type int $page_size - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListBackupsResponse.php b/DataprocMetastore/src/V1beta/ListBackupsResponse.php deleted file mode 100644 index e5217feacd91..000000000000 --- a/DataprocMetastore/src/V1beta/ListBackupsResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1beta.ListBackupsResponse - */ -class ListBackupsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Backup backups = 1; - */ - private $backups; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\Backup>|\Google\Protobuf\Internal\RepeatedField $backups - * The backups of the specified service. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Backup backups = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBackups() - { - return $this->backups; - } - - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Backup backups = 1; - * @param array<\Google\Cloud\Metastore\V1beta\Backup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBackups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Backup::class); - $this->backups = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListFederationsRequest.php b/DataprocMetastore/src/V1beta/ListFederationsRequest.php deleted file mode 100644 index c32639650266..000000000000 --- a/DataprocMetastore/src/V1beta/ListFederationsRequest.php +++ /dev/null @@ -1,251 +0,0 @@ -google.cloud.metastore.v1beta.ListFederationsRequest - */ -class ListFederationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type int $page_size - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListFederationsResponse.php b/DataprocMetastore/src/V1beta/ListFederationsResponse.php deleted file mode 100644 index 4bd38b11e0d0..000000000000 --- a/DataprocMetastore/src/V1beta/ListFederationsResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.metastore.v1beta.ListFederationsResponse - */ -class ListFederationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Federation federations = 1; - */ - private $federations; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\Federation>|\Google\Protobuf\Internal\RepeatedField $federations - * The services in the specified location. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Federation federations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFederations() - { - return $this->federations; - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Federation federations = 1; - * @param array<\Google\Cloud\Metastore\V1beta\Federation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFederations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Federation::class); - $this->federations = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListMetadataImportsRequest.php b/DataprocMetastore/src/V1beta/ListMetadataImportsRequest.php deleted file mode 100644 index 1b6130e54d50..000000000000 --- a/DataprocMetastore/src/V1beta/ListMetadataImportsRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.cloud.metastore.v1beta.ListMetadataImportsRequest - */ -class ListMetadataImportsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @type int $page_size - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListMetadataImportsResponse.php b/DataprocMetastore/src/V1beta/ListMetadataImportsResponse.php deleted file mode 100644 index f57bc3e48b06..000000000000 --- a/DataprocMetastore/src/V1beta/ListMetadataImportsResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1beta.ListMetadataImportsResponse - */ -class ListMetadataImportsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataImport metadata_imports = 1; - */ - private $metadata_imports; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\MetadataImport>|\Google\Protobuf\Internal\RepeatedField $metadata_imports - * The imports in the specified service. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataImport metadata_imports = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetadataImports() - { - return $this->metadata_imports; - } - - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataImport metadata_imports = 1; - * @param array<\Google\Cloud\Metastore\V1beta\MetadataImport>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetadataImports($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\MetadataImport::class); - $this->metadata_imports = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListServicesRequest.php b/DataprocMetastore/src/V1beta/ListServicesRequest.php deleted file mode 100644 index c5c917d6ac0c..000000000000 --- a/DataprocMetastore/src/V1beta/ListServicesRequest.php +++ /dev/null @@ -1,256 +0,0 @@ -google.cloud.metastore.v1beta.ListServicesRequest - */ -class ListServicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type int $page_size - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListServicesResponse.php b/DataprocMetastore/src/V1beta/ListServicesResponse.php deleted file mode 100644 index b267f025110f..000000000000 --- a/DataprocMetastore/src/V1beta/ListServicesResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1beta.ListServicesResponse - */ -class ListServicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Service services = 1; - */ - private $services; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\Service>|\Google\Protobuf\Internal\RepeatedField $services - * The services in the specified location. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Service services = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServices() - { - return $this->services; - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Service services = 1; - * @param array<\Google\Cloud\Metastore\V1beta\Service>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Service::class); - $this->services = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/LocationMetadata.php b/DataprocMetastore/src/V1beta/LocationMetadata.php deleted file mode 100644 index 2399c3c3e4ec..000000000000 --- a/DataprocMetastore/src/V1beta/LocationMetadata.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1beta.LocationMetadata - */ -class LocationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - */ - private $supported_hive_metastore_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\LocationMetadata\HiveMetastoreVersion>|\Google\Protobuf\Internal\RepeatedField $supported_hive_metastore_versions - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedHiveMetastoreVersions() - { - return $this->supported_hive_metastore_versions; - } - - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - * @param array<\Google\Cloud\Metastore\V1beta\LocationMetadata\HiveMetastoreVersion>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedHiveMetastoreVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\LocationMetadata\HiveMetastoreVersion::class); - $this->supported_hive_metastore_versions = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/LocationMetadata/HiveMetastoreVersion.php b/DataprocMetastore/src/V1beta/LocationMetadata/HiveMetastoreVersion.php deleted file mode 100644 index 326093d14c41..000000000000 --- a/DataprocMetastore/src/V1beta/LocationMetadata/HiveMetastoreVersion.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.metastore.v1beta.LocationMetadata.HiveMetastoreVersion - */ -class HiveMetastoreVersion extends \Google\Protobuf\Internal\Message -{ - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - */ - private $version = ''; - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - */ - private $is_default = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * The semantic version of the Hive Metastore software. - * @type bool $is_default - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - * @return bool - */ - public function getIsDefault() - { - return $this->is_default; - } - - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - * @param bool $var - * @return $this - */ - public function setIsDefault($var) - { - GPBUtil::checkBool($var); - $this->is_default = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HiveMetastoreVersion::class, \Google\Cloud\Metastore\V1beta\LocationMetadata_HiveMetastoreVersion::class); - diff --git a/DataprocMetastore/src/V1beta/LocationMetadata_HiveMetastoreVersion.php b/DataprocMetastore/src/V1beta/LocationMetadata_HiveMetastoreVersion.php deleted file mode 100644 index bfa27f7269b0..000000000000 --- a/DataprocMetastore/src/V1beta/LocationMetadata_HiveMetastoreVersion.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.MaintenanceWindow - */ -class MaintenanceWindow extends \Google\Protobuf\Internal\Message -{ - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - */ - private $hour_of_day = null; - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - */ - private $day_of_week = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Int32Value $hour_of_day - * The hour of day (0-23) when the window starts. - * @type int $day_of_week - * The day of week, when the window starts. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @return \Google\Protobuf\Int32Value|null - */ - public function getHourOfDay() - { - return $this->hour_of_day; - } - - public function hasHourOfDay() - { - return isset($this->hour_of_day); - } - - public function clearHourOfDay() - { - unset($this->hour_of_day); - } - - /** - * Returns the unboxed value from getHourOfDay() - - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @return int|null - */ - public function getHourOfDayValue() - { - return $this->readWrapperValue("hour_of_day"); - } - - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @param \Google\Protobuf\Int32Value $var - * @return $this - */ - public function setHourOfDay($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); - $this->hour_of_day = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. - - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @param int|null $var - * @return $this - */ - public function setHourOfDayValue($var) - { - $this->writeWrapperValue("hour_of_day", $var); - return $this;} - - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - * @return int - */ - public function getDayOfWeek() - { - return $this->day_of_week; - } - - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - * @param int $var - * @return $this - */ - public function setDayOfWeek($var) - { - GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); - $this->day_of_week = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/MetadataExport.php b/DataprocMetastore/src/V1beta/MetadataExport.php deleted file mode 100644 index 592291091265..000000000000 --- a/DataprocMetastore/src/V1beta/MetadataExport.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.metastore.v1beta.MetadataExport - */ -class MetadataExport extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $database_dump_type = 0; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $destination_gcs_uri - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time when the export started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the export ended. - * @type int $state - * Output only. The current state of the export. - * @type int $database_dump_type - * Output only. The type of the database dump. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * - * Generated from protobuf field string destination_gcs_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDestinationGcsUri() - { - return $this->readOneof(4); - } - - public function hasDestinationGcsUri() - { - return $this->hasOneof(4); - } - - /** - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * - * Generated from protobuf field string destination_gcs_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDestinationGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\MetadataExport\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getDatabaseDumpType() - { - return $this->database_dump_type; - } - - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDatabaseDumpType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec\Type::class); - $this->database_dump_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/MetadataExport/State.php b/DataprocMetastore/src/V1beta/MetadataExport/State.php deleted file mode 100644 index 92bac47ffdc6..000000000000 --- a/DataprocMetastore/src/V1beta/MetadataExport/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.metastore.v1beta.MetadataExport.State - */ -class State -{ - /** - * The state of the metadata export is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata export is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata export completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata export failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The metadata export is cancelled. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\MetadataExport_State::class); - diff --git a/DataprocMetastore/src/V1beta/MetadataExport_State.php b/DataprocMetastore/src/V1beta/MetadataExport_State.php deleted file mode 100644 index 91b41b8b7405..000000000000 --- a/DataprocMetastore/src/V1beta/MetadataExport_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.MetadataImport - */ -class MetadataImport extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - */ - private $description = ''; - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - protected $metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump $database_dump - * Immutable. A database dump from a pre-existing metastore's database. - * @type string $name - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * @type string $description - * The description of the metadata import. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metadata import was started. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metadata import was last updated. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the metadata import finished. - * @type int $state - * Output only. The current state of the metadata import. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. A database dump from a pre-existing metastore's database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump database_dump = 6 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump|null - */ - public function getDatabaseDump() - { - return $this->readOneof(6); - } - - public function hasDatabaseDump() - { - return $this->hasOneof(6); - } - - /** - * Immutable. A database dump from a pre-existing metastore's database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump database_dump = 6 [(.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump $var - * @return $this - */ - public function setDatabaseDump($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\MetadataImport\State::class); - $this->state = $var; - - return $this; - } - - /** - * @return string - */ - public function getMetadata() - { - return $this->whichOneof("metadata"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump.php b/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump.php deleted file mode 100644 index 75c8013c2684..000000000000 --- a/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump.php +++ /dev/null @@ -1,191 +0,0 @@ -google.cloud.metastore.v1beta.MetadataImport.DatabaseDump - */ -class DatabaseDump extends \Google\Protobuf\Internal\Message -{ - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @deprecated - */ - protected $database_type = 0; - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - */ - private $gcs_uri = ''; - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @deprecated - */ - protected $source_database = ''; - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $database_type - * The type of the database. - * @type string $gcs_uri - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * @type string $source_database - * The name of the source database. - * @type int $type - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @return int - * @deprecated - */ - public function getDatabaseType() - { - @trigger_error('database_type is deprecated.', E_USER_DEPRECATED); - return $this->database_type; - } - - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @param int $var - * @return $this - * @deprecated - */ - public function setDatabaseType($var) - { - @trigger_error('database_type is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump\DatabaseType::class); - $this->database_type = $var; - - return $this; - } - - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - * @return string - */ - public function getGcsUri() - { - return $this->gcs_uri; - } - - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - * @param string $var - * @return $this - */ - public function setGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->gcs_uri = $var; - - return $this; - } - - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @return string - * @deprecated - */ - public function getSourceDatabase() - { - @trigger_error('source_database is deprecated.', E_USER_DEPRECATED); - return $this->source_database; - } - - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setSourceDatabase($var) - { - @trigger_error('source_database is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->source_database = $var; - - return $this; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec\Type::class); - $this->type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseDump::class, \Google\Cloud\Metastore\V1beta\MetadataImport_DatabaseDump::class); - diff --git a/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump/DatabaseType.php b/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump/DatabaseType.php deleted file mode 100644 index d217a3fd64c5..000000000000 --- a/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump/DatabaseType.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.metastore.v1beta.MetadataImport.DatabaseDump.DatabaseType - */ -class DatabaseType -{ - /** - * The type of the source database is unknown. - * - * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; - */ - const DATABASE_TYPE_UNSPECIFIED = 0; - /** - * The type of the source database is MySQL. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - - private static $valueToName = [ - self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1beta\MetadataImport_DatabaseDump_DatabaseType::class); - diff --git a/DataprocMetastore/src/V1beta/MetadataImport/State.php b/DataprocMetastore/src/V1beta/MetadataImport/State.php deleted file mode 100644 index 317ecb495509..000000000000 --- a/DataprocMetastore/src/V1beta/MetadataImport/State.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.metastore.v1beta.MetadataImport.State - */ -class State -{ - /** - * The state of the metadata import is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata import is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata import completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata import is being updated. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The metadata import failed, and attempted metadata changes were rolled - * back. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::UPDATING => 'UPDATING', - self::FAILED => 'FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\MetadataImport_State::class); - diff --git a/DataprocMetastore/src/V1beta/MetadataImport_DatabaseDump.php b/DataprocMetastore/src/V1beta/MetadataImport_DatabaseDump.php deleted file mode 100644 index 244f5c88e38e..000000000000 --- a/DataprocMetastore/src/V1beta/MetadataImport_DatabaseDump.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.MetadataIntegration - */ -class MetadataIntegration extends \Google\Protobuf\Internal\Message -{ - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataCatalogConfig data_catalog_config = 1; - */ - private $data_catalog_config = null; - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataplexConfig dataplex_config = 2; - */ - private $dataplex_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1beta\DataCatalogConfig $data_catalog_config - * The integration config for the Data Catalog service. - * @type \Google\Cloud\Metastore\V1beta\DataplexConfig $dataplex_config - * The integration config for the Dataplex service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataCatalogConfig data_catalog_config = 1; - * @return \Google\Cloud\Metastore\V1beta\DataCatalogConfig|null - */ - public function getDataCatalogConfig() - { - return $this->data_catalog_config; - } - - public function hasDataCatalogConfig() - { - return isset($this->data_catalog_config); - } - - public function clearDataCatalogConfig() - { - unset($this->data_catalog_config); - } - - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataCatalogConfig data_catalog_config = 1; - * @param \Google\Cloud\Metastore\V1beta\DataCatalogConfig $var - * @return $this - */ - public function setDataCatalogConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\DataCatalogConfig::class); - $this->data_catalog_config = $var; - - return $this; - } - - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataplexConfig dataplex_config = 2; - * @return \Google\Cloud\Metastore\V1beta\DataplexConfig|null - */ - public function getDataplexConfig() - { - return $this->dataplex_config; - } - - public function hasDataplexConfig() - { - return isset($this->dataplex_config); - } - - public function clearDataplexConfig() - { - unset($this->dataplex_config); - } - - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataplexConfig dataplex_config = 2; - * @param \Google\Cloud\Metastore\V1beta\DataplexConfig $var - * @return $this - */ - public function setDataplexConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\DataplexConfig::class); - $this->dataplex_config = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/MetadataManagementActivity.php b/DataprocMetastore/src/V1beta/MetadataManagementActivity.php deleted file mode 100644 index 379ac929fda8..000000000000 --- a/DataprocMetastore/src/V1beta/MetadataManagementActivity.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.metastore.v1beta.MetadataManagementActivity - */ -class MetadataManagementActivity extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata_exports; - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $restores; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\MetadataExport>|\Google\Protobuf\Internal\RepeatedField $metadata_exports - * Output only. The latest metadata exports of the metastore service. - * @type array<\Google\Cloud\Metastore\V1beta\Restore>|\Google\Protobuf\Internal\RepeatedField $restores - * Output only. The latest restores of the metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetadataExports() - { - return $this->metadata_exports; - } - - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Metastore\V1beta\MetadataExport>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetadataExports($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\MetadataExport::class); - $this->metadata_exports = $arr; - - return $this; - } - - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestores() - { - return $this->restores; - } - - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Metastore\V1beta\Restore>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestores($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Restore::class); - $this->restores = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/MoveTableToDatabaseRequest.php b/DataprocMetastore/src/V1beta/MoveTableToDatabaseRequest.php deleted file mode 100644 index da536eb4a649..000000000000 --- a/DataprocMetastore/src/V1beta/MoveTableToDatabaseRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.metastore.v1beta.MoveTableToDatabaseRequest - */ -class MoveTableToDatabaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $table_name = ''; - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $db_name = ''; - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $destination_db_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $table_name - * Required. The name of the table to be moved. - * @type string $db_name - * Required. The name of the database where the table resides. - * @type string $destination_db_name - * Required. The name of the database where the table should be moved. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTableName() - { - return $this->table_name; - } - - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTableName($var) - { - GPBUtil::checkString($var, True); - $this->table_name = $var; - - return $this; - } - - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDbName() - { - return $this->db_name; - } - - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDbName($var) - { - GPBUtil::checkString($var, True); - $this->db_name = $var; - - return $this; - } - - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDestinationDbName() - { - return $this->destination_db_name; - } - - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDestinationDbName($var) - { - GPBUtil::checkString($var, True); - $this->destination_db_name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/MoveTableToDatabaseResponse.php b/DataprocMetastore/src/V1beta/MoveTableToDatabaseResponse.php deleted file mode 100644 index d37cfad3e623..000000000000 --- a/DataprocMetastore/src/V1beta/MoveTableToDatabaseResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.metastore.v1beta.MoveTableToDatabaseResponse - */ -class MoveTableToDatabaseResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1beta/NetworkConfig.php b/DataprocMetastore/src/V1beta/NetworkConfig.php deleted file mode 100644 index 731fe07d5d2a..000000000000 --- a/DataprocMetastore/src/V1beta/NetworkConfig.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.metastore.v1beta.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $consumers; - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - */ - private $custom_routes_enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\NetworkConfig\Consumer>|\Google\Protobuf\Internal\RepeatedField $consumers - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * @type bool $custom_routes_enabled - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConsumers() - { - return $this->consumers; - } - - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param array<\Google\Cloud\Metastore\V1beta\NetworkConfig\Consumer>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConsumers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\NetworkConfig\Consumer::class); - $this->consumers = $arr; - - return $this; - } - - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - * @return bool - */ - public function getCustomRoutesEnabled() - { - return $this->custom_routes_enabled; - } - - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - * @param bool $var - * @return $this - */ - public function setCustomRoutesEnabled($var) - { - GPBUtil::checkBool($var); - $this->custom_routes_enabled = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/NetworkConfig/Consumer.php b/DataprocMetastore/src/V1beta/NetworkConfig/Consumer.php deleted file mode 100644 index 96995a720317..000000000000 --- a/DataprocMetastore/src/V1beta/NetworkConfig/Consumer.php +++ /dev/null @@ -1,173 +0,0 @@ -google.cloud.metastore.v1beta.NetworkConfig.Consumer - */ -class Consumer extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $endpoint_location = ''; - protected $vpc_resource; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subnetwork - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * @type string $endpoint_uri - * Output only. The URI of the endpoint used to access the metastore - * service. - * @type string $endpoint_location - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnetwork = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getSubnetwork() - { - return $this->readOneof(1); - } - - public function hasSubnetwork() - { - return $this->hasOneof(1); - } - - /** - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnetwork = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubnetwork($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getEndpointLocation() - { - return $this->endpoint_location; - } - - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEndpointLocation($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_location = $var; - - return $this; - } - - /** - * @return string - */ - public function getVpcResource() - { - return $this->whichOneof("vpc_resource"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Consumer::class, \Google\Cloud\Metastore\V1beta\NetworkConfig_Consumer::class); - diff --git a/DataprocMetastore/src/V1beta/NetworkConfig_Consumer.php b/DataprocMetastore/src/V1beta/NetworkConfig_Consumer.php deleted file mode 100644 index 8695cc88bcae..000000000000 --- a/DataprocMetastore/src/V1beta/NetworkConfig_Consumer.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status_message = ''; - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/QueryMetadataRequest.php b/DataprocMetastore/src/V1beta/QueryMetadataRequest.php deleted file mode 100644 index c5b323e5513d..000000000000 --- a/DataprocMetastore/src/V1beta/QueryMetadataRequest.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.metastore.v1beta.QueryMetadataRequest - */ -class QueryMetadataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $query = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $query - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/QueryMetadataResponse.php b/DataprocMetastore/src/V1beta/QueryMetadataResponse.php deleted file mode 100644 index 4670e0d803df..000000000000 --- a/DataprocMetastore/src/V1beta/QueryMetadataResponse.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.metastore.v1beta.QueryMetadataResponse - */ -class QueryMetadataResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - */ - private $result_manifest_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $result_manifest_uri - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - * @return string - */ - public function getResultManifestUri() - { - return $this->result_manifest_uri; - } - - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - * @param string $var - * @return $this - */ - public function setResultManifestUri($var) - { - GPBUtil::checkString($var, True); - $this->result_manifest_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/RemoveIamPolicyRequest.php b/DataprocMetastore/src/V1beta/RemoveIamPolicyRequest.php deleted file mode 100644 index 2718519aea43..000000000000 --- a/DataprocMetastore/src/V1beta/RemoveIamPolicyRequest.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.metastore.v1beta.RemoveIamPolicyRequest - */ -class RemoveIamPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $resource = ''; - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $asynchronous = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * @type bool $asynchronous - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAsynchronous() - { - return $this->asynchronous; - } - - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAsynchronous($var) - { - GPBUtil::checkBool($var); - $this->asynchronous = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/RemoveIamPolicyResponse.php b/DataprocMetastore/src/V1beta/RemoveIamPolicyResponse.php deleted file mode 100644 index 05886a2c33d2..000000000000 --- a/DataprocMetastore/src/V1beta/RemoveIamPolicyResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.metastore.v1beta.RemoveIamPolicyResponse - */ -class RemoveIamPolicyResponse extends \Google\Protobuf\Internal\Message -{ - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - */ - private $success = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $success - * True if the policy is successfully removed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - * @return bool - */ - public function getSuccess() - { - return $this->success; - } - - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - * @param bool $var - * @return $this - */ - public function setSuccess($var) - { - GPBUtil::checkBool($var); - $this->success = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Restore.php b/DataprocMetastore/src/V1beta/Restore.php deleted file mode 100644 index 0db4bba98f8c..000000000000 --- a/DataprocMetastore/src/V1beta/Restore.php +++ /dev/null @@ -1,269 +0,0 @@ -google.cloud.metastore.v1beta.Restore - */ -class Restore extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $backup = ''; - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $type = 0; - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $details = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time when the restore started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the restore ended. - * @type int $state - * Output only. The current state of the restore. - * @type string $backup - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type int $type - * Output only. The type of restore. - * @type string $details - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Restore\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Restore\RestoreType::class); - $this->type = $var; - - return $this; - } - - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDetails() - { - return $this->details; - } - - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkString($var, True); - $this->details = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Restore/RestoreType.php b/DataprocMetastore/src/V1beta/Restore/RestoreType.php deleted file mode 100644 index 72d5ccd06ea4..000000000000 --- a/DataprocMetastore/src/V1beta/Restore/RestoreType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1beta.Restore.RestoreType - */ -class RestoreType -{ - /** - * The restore type is unknown. - * - * Generated from protobuf enum RESTORE_TYPE_UNSPECIFIED = 0; - */ - const RESTORE_TYPE_UNSPECIFIED = 0; - /** - * The service's metadata and configuration are restored. - * - * Generated from protobuf enum FULL = 1; - */ - const FULL = 1; - /** - * Only the service's metadata is restored. - * - * Generated from protobuf enum METADATA_ONLY = 2; - */ - const METADATA_ONLY = 2; - - private static $valueToName = [ - self::RESTORE_TYPE_UNSPECIFIED => 'RESTORE_TYPE_UNSPECIFIED', - self::FULL => 'FULL', - self::METADATA_ONLY => 'METADATA_ONLY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestoreType::class, \Google\Cloud\Metastore\V1beta\Restore_RestoreType::class); - diff --git a/DataprocMetastore/src/V1beta/Restore/State.php b/DataprocMetastore/src/V1beta/Restore/State.php deleted file mode 100644 index 9d8d0bc75bfa..000000000000 --- a/DataprocMetastore/src/V1beta/Restore/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.metastore.v1beta.Restore.State - */ -class State -{ - /** - * The state of the metadata restore is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata restore is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata restore completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata restore failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The metadata restore is cancelled. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\Restore_State::class); - diff --git a/DataprocMetastore/src/V1beta/RestoreServiceRequest.php b/DataprocMetastore/src/V1beta/RestoreServiceRequest.php deleted file mode 100644 index 042ed64e9569..000000000000 --- a/DataprocMetastore/src/V1beta/RestoreServiceRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.metastore.v1beta.RestoreServiceRequest - */ -class RestoreServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $backup = ''; - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $restore_type = 0; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $backup - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type int $restore_type - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getRestoreType() - { - return $this->restore_type; - } - - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setRestoreType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Restore\RestoreType::class); - $this->restore_type = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Restore_RestoreType.php b/DataprocMetastore/src/V1beta/Restore_RestoreType.php deleted file mode 100644 index 6dceae9293e8..000000000000 --- a/DataprocMetastore/src/V1beta/Restore_RestoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.ScalingConfig - */ -class ScalingConfig extends \Google\Protobuf\Internal\Message -{ - protected $scaling_model; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $instance_size - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * @type float $scaling_factor - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig.InstanceSize instance_size = 1; - * @return int - */ - public function getInstanceSize() - { - return $this->readOneof(1); - } - - public function hasInstanceSize() - { - return $this->hasOneof(1); - } - - /** - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig.InstanceSize instance_size = 1; - * @param int $var - * @return $this - */ - public function setInstanceSize($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\ScalingConfig\InstanceSize::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * - * Generated from protobuf field float scaling_factor = 2; - * @return float - */ - public function getScalingFactor() - { - return $this->readOneof(2); - } - - public function hasScalingFactor() - { - return $this->hasOneof(2); - } - - /** - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * - * Generated from protobuf field float scaling_factor = 2; - * @param float $var - * @return $this - */ - public function setScalingFactor($var) - { - GPBUtil::checkFloat($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getScalingModel() - { - return $this->whichOneof("scaling_model"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/ScalingConfig/InstanceSize.php b/DataprocMetastore/src/V1beta/ScalingConfig/InstanceSize.php deleted file mode 100644 index 5b62c489ed94..000000000000 --- a/DataprocMetastore/src/V1beta/ScalingConfig/InstanceSize.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.metastore.v1beta.ScalingConfig.InstanceSize - */ -class InstanceSize -{ - /** - * Unspecified instance size - * - * Generated from protobuf enum INSTANCE_SIZE_UNSPECIFIED = 0; - */ - const INSTANCE_SIZE_UNSPECIFIED = 0; - /** - * Extra small instance size, maps to a scaling factor of 0.1. - * - * Generated from protobuf enum EXTRA_SMALL = 1; - */ - const EXTRA_SMALL = 1; - /** - * Small instance size, maps to a scaling factor of 0.5. - * - * Generated from protobuf enum SMALL = 2; - */ - const SMALL = 2; - /** - * Medium instance size, maps to a scaling factor of 1.0. - * - * Generated from protobuf enum MEDIUM = 3; - */ - const MEDIUM = 3; - /** - * Large instance size, maps to a scaling factor of 3.0. - * - * Generated from protobuf enum LARGE = 4; - */ - const LARGE = 4; - /** - * Extra large instance size, maps to a scaling factor of 6.0. - * - * Generated from protobuf enum EXTRA_LARGE = 5; - */ - const EXTRA_LARGE = 5; - - private static $valueToName = [ - self::INSTANCE_SIZE_UNSPECIFIED => 'INSTANCE_SIZE_UNSPECIFIED', - self::EXTRA_SMALL => 'EXTRA_SMALL', - self::SMALL => 'SMALL', - self::MEDIUM => 'MEDIUM', - self::LARGE => 'LARGE', - self::EXTRA_LARGE => 'EXTRA_LARGE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstanceSize::class, \Google\Cloud\Metastore\V1beta\ScalingConfig_InstanceSize::class); - diff --git a/DataprocMetastore/src/V1beta/ScalingConfig_InstanceSize.php b/DataprocMetastore/src/V1beta/ScalingConfig_InstanceSize.php deleted file mode 100644 index 3fe30aa634cc..000000000000 --- a/DataprocMetastore/src/V1beta/ScalingConfig_InstanceSize.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.Secret - */ -class Secret extends \Google\Protobuf\Internal\Message -{ - protected $value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $cloud_secret - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * - * Generated from protobuf field string cloud_secret = 2; - * @return string - */ - public function getCloudSecret() - { - return $this->readOneof(2); - } - - public function hasCloudSecret() - { - return $this->hasOneof(2); - } - - /** - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * - * Generated from protobuf field string cloud_secret = 2; - * @param string $var - * @return $this - */ - public function setCloudSecret($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getValue() - { - return $this->whichOneof("value"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/Service.php b/DataprocMetastore/src/V1beta/Service.php deleted file mode 100644 index e96c0eb1bb5a..000000000000 --- a/DataprocMetastore/src/V1beta/Service.php +++ /dev/null @@ -1,942 +0,0 @@ -google.cloud.metastore.v1beta.Service - */ -class Service extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - */ - private $network = ''; - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - */ - private $port = 0; - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state_message = ''; - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $artifact_gcs_uri = ''; - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.Tier tier = 13; - */ - private $tier = 0; - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataIntegration metadata_integration = 14; - */ - private $metadata_integration = null; - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MaintenanceWindow maintenance_window = 15; - */ - private $maintenance_window = null; - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata_management_activity = null; - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $release_channel = 0; - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $encryption_config = null; - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 21; - */ - private $network_config = null; - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $database_type = 0; - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig telemetry_config = 23; - */ - private $telemetry_config = null; - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig scaling_config = 24; - */ - private $scaling_config = null; - protected $metastore_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig $hive_metastore_config - * Configuration information specific to running Hive metastore - * software as the metastore service. - * @type string $name - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metastore service was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metastore service was last updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * User-defined labels for the metastore service. - * @type string $network - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * @type string $endpoint_uri - * Output only. The URI of the endpoint used to access the metastore service. - * @type int $port - * The TCP port at which the metastore service is reached. Default: 9083. - * @type int $state - * Output only. The current state of the metastore service. - * @type string $state_message - * Output only. Additional information about the current state of the - * metastore service, if available. - * @type string $artifact_gcs_uri - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * @type int $tier - * The tier of the service. - * @type \Google\Cloud\Metastore\V1beta\MetadataIntegration $metadata_integration - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * @type \Google\Cloud\Metastore\V1beta\MaintenanceWindow $maintenance_window - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * @type string $uid - * Output only. The globally unique resource identifier of the metastore - * service. - * @type \Google\Cloud\Metastore\V1beta\MetadataManagementActivity $metadata_management_activity - * Output only. The metadata management activities of the metastore service. - * @type int $release_channel - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * @type \Google\Cloud\Metastore\V1beta\EncryptionConfig $encryption_config - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * @type \Google\Cloud\Metastore\V1beta\NetworkConfig $network_config - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * @type int $database_type - * Immutable. The database type that the Metastore service stores its data. - * @type \Google\Cloud\Metastore\V1beta\TelemetryConfig $telemetry_config - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * @type \Google\Cloud\Metastore\V1beta\ScalingConfig $scaling_config - * Scaling configuration of the metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Configuration information specific to running Hive metastore - * software as the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig hive_metastore_config = 5; - * @return \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig|null - */ - public function getHiveMetastoreConfig() - { - return $this->readOneof(5); - } - - public function hasHiveMetastoreConfig() - { - return $this->hasOneof(5); - } - - /** - * Configuration information specific to running Hive metastore - * software as the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig hive_metastore_config = 5; - * @param \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig $var - * @return $this - */ - public function setHiveMetastoreConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Service\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getArtifactGcsUri() - { - return $this->artifact_gcs_uri; - } - - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setArtifactGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->artifact_gcs_uri = $var; - - return $this; - } - - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.Tier tier = 13; - * @return int - */ - public function getTier() - { - return $this->tier; - } - - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.Tier tier = 13; - * @param int $var - * @return $this - */ - public function setTier($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Service\Tier::class); - $this->tier = $var; - - return $this; - } - - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataIntegration metadata_integration = 14; - * @return \Google\Cloud\Metastore\V1beta\MetadataIntegration|null - */ - public function getMetadataIntegration() - { - return $this->metadata_integration; - } - - public function hasMetadataIntegration() - { - return isset($this->metadata_integration); - } - - public function clearMetadataIntegration() - { - unset($this->metadata_integration); - } - - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataIntegration metadata_integration = 14; - * @param \Google\Cloud\Metastore\V1beta\MetadataIntegration $var - * @return $this - */ - public function setMetadataIntegration($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataIntegration::class); - $this->metadata_integration = $var; - - return $this; - } - - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MaintenanceWindow maintenance_window = 15; - * @return \Google\Cloud\Metastore\V1beta\MaintenanceWindow|null - */ - public function getMaintenanceWindow() - { - return $this->maintenance_window; - } - - public function hasMaintenanceWindow() - { - return isset($this->maintenance_window); - } - - public function clearMaintenanceWindow() - { - unset($this->maintenance_window); - } - - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MaintenanceWindow maintenance_window = 15; - * @param \Google\Cloud\Metastore\V1beta\MaintenanceWindow $var - * @return $this - */ - public function setMaintenanceWindow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MaintenanceWindow::class); - $this->maintenance_window = $var; - - return $this; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1beta\MetadataManagementActivity|null - */ - public function getMetadataManagementActivity() - { - return $this->metadata_management_activity; - } - - public function hasMetadataManagementActivity() - { - return isset($this->metadata_management_activity); - } - - public function clearMetadataManagementActivity() - { - unset($this->metadata_management_activity); - } - - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1beta\MetadataManagementActivity $var - * @return $this - */ - public function setMetadataManagementActivity($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataManagementActivity::class); - $this->metadata_management_activity = $var; - - return $this; - } - - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getReleaseChannel() - { - return $this->release_channel; - } - - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setReleaseChannel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Service\ReleaseChannel::class); - $this->release_channel = $var; - - return $this; - } - - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\Metastore\V1beta\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\Metastore\V1beta\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 21; - * @return \Google\Cloud\Metastore\V1beta\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 21; - * @param \Google\Cloud\Metastore\V1beta\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getDatabaseType() - { - return $this->database_type; - } - - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setDatabaseType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Service\DatabaseType::class); - $this->database_type = $var; - - return $this; - } - - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig telemetry_config = 23; - * @return \Google\Cloud\Metastore\V1beta\TelemetryConfig|null - */ - public function getTelemetryConfig() - { - return $this->telemetry_config; - } - - public function hasTelemetryConfig() - { - return isset($this->telemetry_config); - } - - public function clearTelemetryConfig() - { - unset($this->telemetry_config); - } - - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig telemetry_config = 23; - * @param \Google\Cloud\Metastore\V1beta\TelemetryConfig $var - * @return $this - */ - public function setTelemetryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\TelemetryConfig::class); - $this->telemetry_config = $var; - - return $this; - } - - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig scaling_config = 24; - * @return \Google\Cloud\Metastore\V1beta\ScalingConfig|null - */ - public function getScalingConfig() - { - return $this->scaling_config; - } - - public function hasScalingConfig() - { - return isset($this->scaling_config); - } - - public function clearScalingConfig() - { - unset($this->scaling_config); - } - - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig scaling_config = 24; - * @param \Google\Cloud\Metastore\V1beta\ScalingConfig $var - * @return $this - */ - public function setScalingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\ScalingConfig::class); - $this->scaling_config = $var; - - return $this; - } - - /** - * @return string - */ - public function getMetastoreConfig() - { - return $this->whichOneof("metastore_config"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/Service/DatabaseType.php b/DataprocMetastore/src/V1beta/Service/DatabaseType.php deleted file mode 100644 index d4c91edc9267..000000000000 --- a/DataprocMetastore/src/V1beta/Service/DatabaseType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1beta.Service.DatabaseType - */ -class DatabaseType -{ - /** - * The DATABASE_TYPE is not set. - * - * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; - */ - const DATABASE_TYPE_UNSPECIFIED = 0; - /** - * MySQL is used to persist the metastore data. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - /** - * Spanner is used to persist the metastore data. - * - * Generated from protobuf enum SPANNER = 2; - */ - const SPANNER = 2; - - private static $valueToName = [ - self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - self::SPANNER => 'SPANNER', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1beta\Service_DatabaseType::class); - diff --git a/DataprocMetastore/src/V1beta/Service/ReleaseChannel.php b/DataprocMetastore/src/V1beta/Service/ReleaseChannel.php deleted file mode 100644 index 1faf78badb2d..000000000000 --- a/DataprocMetastore/src/V1beta/Service/ReleaseChannel.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.metastore.v1beta.Service.ReleaseChannel - */ -class ReleaseChannel -{ - /** - * Release channel is not specified. - * - * Generated from protobuf enum RELEASE_CHANNEL_UNSPECIFIED = 0; - */ - const RELEASE_CHANNEL_UNSPECIFIED = 0; - /** - * The `CANARY` release channel contains the newest features, which may be - * unstable and subject to unresolved issues with no known workarounds. - * Services using the `CANARY` release channel are not subject to any SLAs. - * - * Generated from protobuf enum CANARY = 1; - */ - const CANARY = 1; - /** - * The `STABLE` release channel contains features that are considered stable - * and have been validated for production use. - * - * Generated from protobuf enum STABLE = 2; - */ - const STABLE = 2; - - private static $valueToName = [ - self::RELEASE_CHANNEL_UNSPECIFIED => 'RELEASE_CHANNEL_UNSPECIFIED', - self::CANARY => 'CANARY', - self::STABLE => 'STABLE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReleaseChannel::class, \Google\Cloud\Metastore\V1beta\Service_ReleaseChannel::class); - diff --git a/DataprocMetastore/src/V1beta/Service/State.php b/DataprocMetastore/src/V1beta/Service/State.php deleted file mode 100644 index fb8f23bdab4f..000000000000 --- a/DataprocMetastore/src/V1beta/Service/State.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.metastore.v1beta.Service.State - */ -class State -{ - /** - * The state of the metastore service is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metastore service is in the process of being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The metastore service is running and ready to serve queries. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The metastore service is entering suspension. Its query-serving - * availability may cease unexpectedly. - * - * Generated from protobuf enum SUSPENDING = 3; - */ - const SUSPENDING = 3; - /** - * The metastore service is suspended and unable to serve queries. - * - * Generated from protobuf enum SUSPENDED = 4; - */ - const SUSPENDED = 4; - /** - * The metastore service is being updated. It remains usable but cannot - * accept additional update requests or be deleted at this time. - * - * Generated from protobuf enum UPDATING = 5; - */ - const UPDATING = 5; - /** - * The metastore service is undergoing deletion. It cannot be used. - * - * Generated from protobuf enum DELETING = 6; - */ - const DELETING = 6; - /** - * The metastore service has encountered an error and cannot be used. The - * metastore service should be deleted. - * - * Generated from protobuf enum ERROR = 7; - */ - const ERROR = 7; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::SUSPENDING => 'SUSPENDING', - self::SUSPENDED => 'SUSPENDED', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\Service_State::class); - diff --git a/DataprocMetastore/src/V1beta/Service/Tier.php b/DataprocMetastore/src/V1beta/Service/Tier.php deleted file mode 100644 index efef7c59b6c1..000000000000 --- a/DataprocMetastore/src/V1beta/Service/Tier.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.metastore.v1beta.Service.Tier - */ -class Tier -{ - /** - * The tier is not set. - * - * Generated from protobuf enum TIER_UNSPECIFIED = 0; - */ - const TIER_UNSPECIFIED = 0; - /** - * The developer tier provides limited scalability and no fault tolerance. - * Good for low-cost proof-of-concept. - * - * Generated from protobuf enum DEVELOPER = 1; - */ - const DEVELOPER = 1; - /** - * The enterprise tier provides multi-zone high availability, and sufficient - * scalability for enterprise-level Dataproc Metastore workloads. - * - * Generated from protobuf enum ENTERPRISE = 3; - */ - const ENTERPRISE = 3; - - private static $valueToName = [ - self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', - self::DEVELOPER => 'DEVELOPER', - self::ENTERPRISE => 'ENTERPRISE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Tier::class, \Google\Cloud\Metastore\V1beta\Service_Tier::class); - diff --git a/DataprocMetastore/src/V1beta/Service_DatabaseType.php b/DataprocMetastore/src/V1beta/Service_DatabaseType.php deleted file mode 100644 index 03bd8f546940..000000000000 --- a/DataprocMetastore/src/V1beta/Service_DatabaseType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.TelemetryConfig - */ -class TelemetryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig.LogFormat log_format = 1; - */ - private $log_format = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $log_format - * The output format of the Dataproc Metastore service's logs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig.LogFormat log_format = 1; - * @return int - */ - public function getLogFormat() - { - return $this->log_format; - } - - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig.LogFormat log_format = 1; - * @param int $var - * @return $this - */ - public function setLogFormat($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\TelemetryConfig\LogFormat::class); - $this->log_format = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/TelemetryConfig/LogFormat.php b/DataprocMetastore/src/V1beta/TelemetryConfig/LogFormat.php deleted file mode 100644 index 31a5ac103767..000000000000 --- a/DataprocMetastore/src/V1beta/TelemetryConfig/LogFormat.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.metastore.v1beta.TelemetryConfig.LogFormat - */ -class LogFormat -{ - /** - * The LOG_FORMAT is not set. - * - * Generated from protobuf enum LOG_FORMAT_UNSPECIFIED = 0; - */ - const LOG_FORMAT_UNSPECIFIED = 0; - /** - * Logging output uses the legacy `textPayload` format. - * - * Generated from protobuf enum LEGACY = 1; - */ - const LEGACY = 1; - /** - * Logging output uses the `jsonPayload` format. - * - * Generated from protobuf enum JSON = 2; - */ - const JSON = 2; - - private static $valueToName = [ - self::LOG_FORMAT_UNSPECIFIED => 'LOG_FORMAT_UNSPECIFIED', - self::LEGACY => 'LEGACY', - self::JSON => 'JSON', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LogFormat::class, \Google\Cloud\Metastore\V1beta\TelemetryConfig_LogFormat::class); - diff --git a/DataprocMetastore/src/V1beta/TelemetryConfig_LogFormat.php b/DataprocMetastore/src/V1beta/TelemetryConfig_LogFormat.php deleted file mode 100644 index 86b110a5203b..000000000000 --- a/DataprocMetastore/src/V1beta/TelemetryConfig_LogFormat.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.UpdateFederationRequest - */ -class UpdateFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1beta\Federation $federation - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Federation|null - */ - public function getFederation() - { - return $this->federation; - } - - public function hasFederation() - { - return isset($this->federation); - } - - public function clearFederation() - { - unset($this->federation); - } - - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Federation $var - * @return $this - */ - public function setFederation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Federation::class); - $this->federation = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/UpdateMetadataImportRequest.php b/DataprocMetastore/src/V1beta/UpdateMetadataImportRequest.php deleted file mode 100644 index 40838f60202e..000000000000 --- a/DataprocMetastore/src/V1beta/UpdateMetadataImportRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.metastore.v1beta.UpdateMetadataImportRequest - */ -class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1beta\MetadataImport $metadata_import - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\MetadataImport|null - */ - public function getMetadataImport() - { - return $this->metadata_import; - } - - public function hasMetadataImport() - { - return isset($this->metadata_import); - } - - public function clearMetadataImport() - { - unset($this->metadata_import); - } - - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\MetadataImport $var - * @return $this - */ - public function setMetadataImport($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataImport::class); - $this->metadata_import = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/UpdateServiceRequest.php b/DataprocMetastore/src/V1beta/UpdateServiceRequest.php deleted file mode 100644 index cd0652cd46ff..000000000000 --- a/DataprocMetastore/src/V1beta/UpdateServiceRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.metastore.v1beta.UpdateServiceRequest - */ -class UpdateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1beta\Service $service - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/gapic_metadata.json b/DataprocMetastore/src/V1beta/gapic_metadata.json deleted file mode 100644 index 1e01d02ccb35..000000000000 --- a/DataprocMetastore/src/V1beta/gapic_metadata.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.metastore.v1beta", - "libraryPackage": "Google\\Cloud\\Metastore\\V1beta", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreGapicClient", - "rpcs": { - "AlterMetadataResourceLocation": { - "methods": [ - "alterMetadataResourceLocation" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "CreateMetadataImport": { - "methods": [ - "createMetadataImport" - ] - }, - "CreateService": { - "methods": [ - "createService" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "DeleteService": { - "methods": [ - "deleteService" - ] - }, - "ExportMetadata": { - "methods": [ - "exportMetadata" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetMetadataImport": { - "methods": [ - "getMetadataImport" - ] - }, - "GetService": { - "methods": [ - "getService" - ] - }, - "ListBackups": { - "methods": [ - "listBackups" - ] - }, - "ListMetadataImports": { - "methods": [ - "listMetadataImports" - ] - }, - "ListServices": { - "methods": [ - "listServices" - ] - }, - "MoveTableToDatabase": { - "methods": [ - "moveTableToDatabase" - ] - }, - "QueryMetadata": { - "methods": [ - "queryMetadata" - ] - }, - "RemoveIamPolicy": { - "methods": [ - "removeIamPolicy" - ] - }, - "RestoreService": { - "methods": [ - "restoreService" - ] - }, - "UpdateMetadataImport": { - "methods": [ - "updateMetadataImport" - ] - }, - "UpdateService": { - "methods": [ - "updateService" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - }, - "DataprocMetastoreFederation": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreFederationGapicClient", - "rpcs": { - "CreateFederation": { - "methods": [ - "createFederation" - ] - }, - "DeleteFederation": { - "methods": [ - "deleteFederation" - ] - }, - "GetFederation": { - "methods": [ - "getFederation" - ] - }, - "ListFederations": { - "methods": [ - "listFederations" - ] - }, - "UpdateFederation": { - "methods": [ - "updateFederation" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_client_config.json b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_client_config.json deleted file mode 100644 index f641af0265f2..000000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_client_config.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "interfaces": { - "google.cloud.metastore.v1beta.DataprocMetastore": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "AlterMetadataResourceLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ExportMetadata": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetService": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListMetadataImports": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListServices": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "MoveTableToDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "QueryMetadata": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RemoveIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RestoreService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_descriptor_config.php b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_descriptor_config.php deleted file mode 100644 index 9a06002101d9..000000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_descriptor_config.php +++ /dev/null @@ -1,201 +0,0 @@ - [ - 'google.cloud.metastore.v1beta.DataprocMetastore' => [ - 'AlterMetadataResourceLocation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\AlterMetadataResourceLocationResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Backup', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateMetadataImport' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\MetadataImport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Service', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ExportMetadata' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\MetadataExport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'MoveTableToDatabase' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\MoveTableToDatabaseResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'QueryMetadata' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\QueryMetadataResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RestoreService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Restore', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateMetadataImport' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\MetadataImport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Service', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListBackups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackups', - ], - ], - 'ListMetadataImports' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMetadataImports', - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - ], - ], -]; diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_client_config.json b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_client_config.json deleted file mode 100644 index 79bcf744ef44..000000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_client_config.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "interfaces": { - "google.cloud.metastore.v1beta.DataprocMetastoreFederation": { - "retry_codes": { - "no_retry_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - } - }, - "methods": { - "CreateFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListFederations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_descriptor_config.php b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_descriptor_config.php deleted file mode 100644 index c96ae408bbb7..000000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_descriptor_config.php +++ /dev/null @@ -1,91 +0,0 @@ - [ - 'google.cloud.metastore.v1beta.DataprocMetastoreFederation' => [ - 'CreateFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Federation', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Federation', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListFederations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFederations', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - ], - ], -]; diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_rest_client_config.php b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_rest_client_config.php deleted file mode 100644 index 687939a6e5a4..000000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_rest_client_config.php +++ /dev/null @@ -1,263 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.metastore.v1beta.DataprocMetastoreFederation' => [ - 'CreateFederation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/federations', - 'body' => 'federation', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'federation_id', - ], - ], - 'DeleteFederation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/federations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFederation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/federations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListFederations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/federations', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateFederation' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{federation.name=projects/*/locations/*/federations/*}', - 'body' => 'federation', - 'placeholders' => [ - 'federation.name' => [ - 'getters' => [ - 'getFederation', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_rest_client_config.php b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_rest_client_config.php deleted file mode 100644 index 848d3380831f..000000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_rest_client_config.php +++ /dev/null @@ -1,436 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.metastore.v1beta.DataprocMetastore' => [ - 'AlterMetadataResourceLocation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:alterLocation', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'CreateBackup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/services/*}/backups', - 'body' => 'backup', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_id', - ], - ], - 'CreateMetadataImport' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/services/*}/metadataImports', - 'body' => 'metadata_import', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'metadata_import_id', - ], - ], - 'CreateService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/services', - 'body' => 'service', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'service_id', - ], - ], - 'DeleteBackup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteService' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ExportMetadata' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:exportMetadata', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'GetBackup' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetMetadataImport' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*/metadataImports/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetService' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBackups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/services/*}/backups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListMetadataImports' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/services/*}/metadataImports', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListServices' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/services', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'MoveTableToDatabase' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:moveTableToDatabase', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'QueryMetadata' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:queryMetadata', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'RemoveIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/**}:removeIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'RestoreService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:restore', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'UpdateMetadataImport' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{metadata_import.name=projects/*/locations/*/services/*/metadataImports/*}', - 'body' => 'metadata_import', - 'placeholders' => [ - 'metadata_import.name' => [ - 'getters' => [ - 'getMetadataImport', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateService' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{service.name=projects/*/locations/*/services/*}', - 'body' => 'service', - 'placeholders' => [ - 'service.name' => [ - 'getters' => [ - 'getService', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreClientTest.php b/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreClientTest.php index 21615b12619a..426a23703d91 100644 --- a/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreClientTest.php +++ b/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DataprocMetastoreClient */ @@ -148,7 +150,10 @@ public function alterMetadataResourceLocationTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getService(); $this->assertProtobufEquals($formattedService, $actualValue); $actualValue = $actualApiRequestObject->getResourceName(); @@ -198,12 +203,15 @@ public function alterMetadataResourceLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); @@ -335,12 +343,15 @@ public function createBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); @@ -472,12 +483,15 @@ public function createMetadataImportExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); @@ -619,12 +633,15 @@ public function createServiceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -687,8 +704,7 @@ public function deleteBackupTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); + $request = (new DeleteBackupRequest())->setName($formattedName); $response = $gapicClient->deleteBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -744,17 +760,19 @@ public function deleteBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); + $request = (new DeleteBackupRequest())->setName($formattedName); $response = $gapicClient->deleteBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -808,8 +826,7 @@ public function deleteServiceTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); + $request = (new DeleteServiceRequest())->setName($formattedName); $response = $gapicClient->deleteService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -865,17 +882,19 @@ public function deleteServiceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); + $request = (new DeleteServiceRequest())->setName($formattedName); $response = $gapicClient->deleteService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -931,8 +950,7 @@ public function exportMetadataTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ExportMetadataRequest()) - ->setService($formattedService); + $request = (new ExportMetadataRequest())->setService($formattedService); $response = $gapicClient->exportMetadata($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -988,17 +1006,19 @@ public function exportMetadataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ExportMetadataRequest()) - ->setService($formattedService); + $request = (new ExportMetadataRequest())->setService($formattedService); $response = $gapicClient->exportMetadata($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1038,8 +1058,7 @@ public function getBackupTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); + $request = (new GetBackupRequest())->setName($formattedName); $response = $gapicClient->getBackup($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1063,17 +1082,19 @@ public function getBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); + $request = (new GetBackupRequest())->setName($formattedName); try { $gapicClient->getBackup($request); // If the $gapicClient method call did not throw, fail the test @@ -1104,8 +1125,7 @@ public function getMetadataImportTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $request = (new GetMetadataImportRequest()) - ->setName($formattedName); + $request = (new GetMetadataImportRequest())->setName($formattedName); $response = $gapicClient->getMetadataImport($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1129,17 +1149,19 @@ public function getMetadataImportExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $request = (new GetMetadataImportRequest()) - ->setName($formattedName); + $request = (new GetMetadataImportRequest())->setName($formattedName); try { $gapicClient->getMetadataImport($request); // If the $gapicClient method call did not throw, fail the test @@ -1180,8 +1202,7 @@ public function getServiceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); + $request = (new GetServiceRequest())->setName($formattedName); $response = $gapicClient->getService($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1205,17 +1226,19 @@ public function getServiceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); + $request = (new GetServiceRequest())->setName($formattedName); try { $gapicClient->getService($request); // If the $gapicClient method call did not throw, fail the test @@ -1240,17 +1263,14 @@ public function listBackupsTest() // Mock response $nextPageToken = ''; $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; + $backups = [$backupsElement]; $expectedResponse = new ListBackupsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setBackups($backups); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); + $request = (new ListBackupsRequest())->setParent($formattedParent); $response = $gapicClient->listBackups($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1277,17 +1297,19 @@ public function listBackupsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); + $request = (new ListBackupsRequest())->setParent($formattedParent); try { $gapicClient->listBackups($request); // If the $gapicClient method call did not throw, fail the test @@ -1312,17 +1334,14 @@ public function listMetadataImportsTest() // Mock response $nextPageToken = ''; $metadataImportsElement = new MetadataImport(); - $metadataImports = [ - $metadataImportsElement, - ]; + $metadataImports = [$metadataImportsElement]; $expectedResponse = new ListMetadataImportsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMetadataImports($metadataImports); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListMetadataImportsRequest()) - ->setParent($formattedParent); + $request = (new ListMetadataImportsRequest())->setParent($formattedParent); $response = $gapicClient->listMetadataImports($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1349,17 +1368,19 @@ public function listMetadataImportsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListMetadataImportsRequest()) - ->setParent($formattedParent); + $request = (new ListMetadataImportsRequest())->setParent($formattedParent); try { $gapicClient->listMetadataImports($request); // If the $gapicClient method call did not throw, fail the test @@ -1384,17 +1405,14 @@ public function listServicesTest() // Mock response $nextPageToken = ''; $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; + $services = [$servicesElement]; $expectedResponse = new ListServicesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setServices($services); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListServicesRequest()) - ->setParent($formattedParent); + $request = (new ListServicesRequest())->setParent($formattedParent); $response = $gapicClient->listServices($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1421,17 +1439,19 @@ public function listServicesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListServicesRequest()) - ->setParent($formattedParent); + $request = (new ListServicesRequest())->setParent($formattedParent); try { $gapicClient->listServices($request); // If the $gapicClient method call did not throw, fail the test @@ -1545,12 +1565,15 @@ public function moveTableToDatabaseExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); @@ -1618,9 +1641,7 @@ public function queryMetadataTest() // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); $query = 'query107944136'; - $request = (new QueryMetadataRequest()) - ->setService($formattedService) - ->setQuery($query); + $request = (new QueryMetadataRequest())->setService($formattedService)->setQuery($query); $response = $gapicClient->queryMetadata($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1678,19 +1699,20 @@ public function queryMetadataExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); $query = 'query107944136'; - $request = (new QueryMetadataRequest()) - ->setService($formattedService) - ->setQuery($query); + $request = (new QueryMetadataRequest())->setService($formattedService)->setQuery($query); $response = $gapicClient->queryMetadata($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1749,9 +1771,7 @@ public function restoreServiceTest() // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new RestoreServiceRequest()) - ->setService($formattedService) - ->setBackup($formattedBackup); + $request = (new RestoreServiceRequest())->setService($formattedService)->setBackup($formattedBackup); $response = $gapicClient->restoreService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1809,19 +1829,20 @@ public function restoreServiceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new RestoreServiceRequest()) - ->setService($formattedService) - ->setBackup($formattedBackup); + $request = (new RestoreServiceRequest())->setService($formattedService)->setBackup($formattedBackup); $response = $gapicClient->restoreService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1880,9 +1901,7 @@ public function updateMetadataImportTest() // Mock request $updateMask = new FieldMask(); $metadataImport = new MetadataImport(); - $request = (new UpdateMetadataImportRequest()) - ->setUpdateMask($updateMask) - ->setMetadataImport($metadataImport); + $request = (new UpdateMetadataImportRequest())->setUpdateMask($updateMask)->setMetadataImport($metadataImport); $response = $gapicClient->updateMetadataImport($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1940,19 +1959,20 @@ public function updateMetadataImportExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $metadataImport = new MetadataImport(); - $request = (new UpdateMetadataImportRequest()) - ->setUpdateMask($updateMask) - ->setMetadataImport($metadataImport); + $request = (new UpdateMetadataImportRequest())->setUpdateMask($updateMask)->setMetadataImport($metadataImport); $response = $gapicClient->updateMetadataImport($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2021,9 +2041,7 @@ public function updateServiceTest() // Mock request $updateMask = new FieldMask(); $service = new Service(); - $request = (new UpdateServiceRequest()) - ->setUpdateMask($updateMask) - ->setService($service); + $request = (new UpdateServiceRequest())->setUpdateMask($updateMask)->setService($service); $response = $gapicClient->updateService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2081,19 +2099,20 @@ public function updateServiceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $service = new Service(); - $request = (new UpdateServiceRequest()) - ->setUpdateMask($updateMask) - ->setService($service); + $request = (new UpdateServiceRequest())->setUpdateMask($updateMask)->setService($service); $response = $gapicClient->updateService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2155,12 +2174,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -2187,9 +2209,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -2219,12 +2239,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -2257,8 +2280,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2282,17 +2304,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2324,9 +2348,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2352,19 +2374,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2392,9 +2415,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2420,19 +2441,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2492,7 +2514,10 @@ public function alterMetadataResourceLocationAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getService(); $this->assertProtobufEquals($formattedService, $actualValue); $actualValue = $actualApiRequestObject->getResourceName(); diff --git a/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreFederationClientTest.php b/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreFederationClientTest.php index 0c81a2c672e1..19d1472beb79 100644 --- a/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreFederationClientTest.php +++ b/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreFederationClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DataprocMetastoreFederationClient */ @@ -136,7 +138,10 @@ public function createFederationTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getFederationId(); @@ -186,12 +191,15 @@ public function createFederationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -254,8 +262,7 @@ public function deleteFederationTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $request = (new DeleteFederationRequest()) - ->setName($formattedName); + $request = (new DeleteFederationRequest())->setName($formattedName); $response = $gapicClient->deleteFederation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -265,7 +272,10 @@ public function deleteFederationTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/DeleteFederation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastoreFederation/DeleteFederation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -311,17 +321,19 @@ public function deleteFederationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $request = (new DeleteFederationRequest()) - ->setName($formattedName); + $request = (new DeleteFederationRequest())->setName($formattedName); $response = $gapicClient->deleteFederation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -367,8 +379,7 @@ public function getFederationTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $request = (new GetFederationRequest()) - ->setName($formattedName); + $request = (new GetFederationRequest())->setName($formattedName); $response = $gapicClient->getFederation($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -392,17 +403,19 @@ public function getFederationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $request = (new GetFederationRequest()) - ->setName($formattedName); + $request = (new GetFederationRequest())->setName($formattedName); try { $gapicClient->getFederation($request); // If the $gapicClient method call did not throw, fail the test @@ -427,17 +440,14 @@ public function listFederationsTest() // Mock response $nextPageToken = ''; $federationsElement = new Federation(); - $federations = [ - $federationsElement, - ]; + $federations = [$federationsElement]; $expectedResponse = new ListFederationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFederations($federations); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFederationsRequest()) - ->setParent($formattedParent); + $request = (new ListFederationsRequest())->setParent($formattedParent); $response = $gapicClient->listFederations($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -464,17 +474,19 @@ public function listFederationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFederationsRequest()) - ->setParent($formattedParent); + $request = (new ListFederationsRequest())->setParent($formattedParent); try { $gapicClient->listFederations($request); // If the $gapicClient method call did not throw, fail the test @@ -530,9 +542,7 @@ public function updateFederationTest() // Mock request $updateMask = new FieldMask(); $federation = new Federation(); - $request = (new UpdateFederationRequest()) - ->setUpdateMask($updateMask) - ->setFederation($federation); + $request = (new UpdateFederationRequest())->setUpdateMask($updateMask)->setFederation($federation); $response = $gapicClient->updateFederation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -542,7 +552,10 @@ public function updateFederationTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/UpdateFederation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastoreFederation/UpdateFederation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getUpdateMask(); $this->assertProtobufEquals($updateMask, $actualValue); $actualValue = $actualApiRequestObject->getFederation(); @@ -590,19 +603,20 @@ public function updateFederationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $federation = new Federation(); - $request = (new UpdateFederationRequest()) - ->setUpdateMask($updateMask) - ->setFederation($federation); + $request = (new UpdateFederationRequest())->setUpdateMask($updateMask)->setFederation($federation); $response = $gapicClient->updateFederation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -664,12 +678,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -696,9 +713,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -728,12 +743,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -766,8 +784,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -791,17 +808,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -833,9 +852,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -861,19 +878,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -901,9 +919,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -929,19 +945,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1011,7 +1028,10 @@ public function createFederationAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getFederationId(); diff --git a/DataprocMetastore/tests/Unit/V1/DataprocMetastoreClientTest.php b/DataprocMetastore/tests/Unit/V1/DataprocMetastoreClientTest.php deleted file mode 100644 index f4e4eb67f183..000000000000 --- a/DataprocMetastore/tests/Unit/V1/DataprocMetastoreClientTest.php +++ /dev/null @@ -1,2303 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreClient($options); - } - - /** @test */ - public function alterMetadataResourceLocationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AlterMetadataResourceLocationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/alterMetadataResourceLocationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getResourceName(); - $this->assertProtobufEquals($resourceName, $actualValue); - $actualValue = $actualApiRequestObject->getLocationUri(); - $this->assertProtobufEquals($locationUri, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function alterMetadataResourceLocationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/CreateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImportId(); - $this->assertProtobufEquals($metadataImportId, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/CreateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/DeleteBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/DeleteService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $destinationGcsUri = 'destinationGcsUri1386421523'; - $expectedResponse = new MetadataExport(); - $expectedResponse->setDestinationGcsUri($destinationGcsUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/ExportMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->getBackup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - try { - $gapicClient->getBackup($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataImportTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $response = $gapicClient->getMetadataImport($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/GetMetadataImport', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataImportExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - try { - $gapicClient->getMetadataImport($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->getService($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->getService($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; - $expectedResponse = new ListBackupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackups($backups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listBackups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listBackups($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataImportsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metadataImportsElement = new MetadataImport(); - $metadataImports = [ - $metadataImportsElement, - ]; - $expectedResponse = new ListMetadataImportsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetadataImports($metadataImports); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listMetadataImports($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetadataImports()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/ListMetadataImports', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataImportsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listMetadataImports($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listServices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listServices($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function moveTableToDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new MoveTableToDatabaseResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveTableToDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/MoveTableToDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getTableName(); - $this->assertProtobufEquals($tableName, $actualValue); - $actualValue = $actualApiRequestObject->getDbName(); - $this->assertProtobufEquals($dbName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationDbName(); - $this->assertProtobufEquals($destinationDbName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function moveTableToDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $resultManifestUri = 'resultManifestUri-1050940354'; - $expectedResponse = new QueryMetadataResponse(); - $expectedResponse->setResultManifestUri($resultManifestUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/queryMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/QueryMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $backup2 = 'backup22121930997'; - $details = 'details1557721666'; - $expectedResponse = new Restore(); - $expectedResponse->setBackup($backup2); - $expectedResponse->setDetails($details); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/RestoreService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($formattedBackup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/UpdateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/UpdateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1/DataprocMetastoreFederationClientTest.php b/DataprocMetastore/tests/Unit/V1/DataprocMetastoreFederationClientTest.php deleted file mode 100644 index 7c43e2e769c0..000000000000 --- a/DataprocMetastore/tests/Unit/V1/DataprocMetastoreFederationClientTest.php +++ /dev/null @@ -1,901 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreFederationClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreFederationClient($options); - } - - /** @test */ - public function createFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFederationId(); - $this->assertProtobufEquals($federationId, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/DeleteFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFederationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name2); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->getFederation($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/GetFederation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFederationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - try { - $gapicClient->getFederation($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFederationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $federationsElement = new Federation(); - $federations = [ - $federationsElement, - ]; - $expectedResponse = new ListFederationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFederations($federations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listFederations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFederations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/ListFederations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFederationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listFederations($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/UpdateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreClientTest.php b/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreClientTest.php deleted file mode 100644 index 1015aadf95a3..000000000000 --- a/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreClientTest.php +++ /dev/null @@ -1,2364 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreClient($options); - } - - /** @test */ - public function alterMetadataResourceLocationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AlterMetadataResourceLocationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/alterMetadataResourceLocationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getResourceName(); - $this->assertProtobufEquals($resourceName, $actualValue); - $actualValue = $actualApiRequestObject->getLocationUri(); - $this->assertProtobufEquals($locationUri, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function alterMetadataResourceLocationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImportId(); - $this->assertProtobufEquals($metadataImportId, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/DeleteBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/DeleteService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $destinationGcsUri = 'destinationGcsUri1386421523'; - $expectedResponse = new MetadataExport(); - $expectedResponse->setDestinationGcsUri($destinationGcsUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/ExportMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->getBackup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - try { - $gapicClient->getBackup($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataImportTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $response = $gapicClient->getMetadataImport($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/GetMetadataImport', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataImportExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - try { - $gapicClient->getMetadataImport($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->getService($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->getService($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; - $expectedResponse = new ListBackupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackups($backups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listBackups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listBackups($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataImportsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metadataImportsElement = new MetadataImport(); - $metadataImports = [ - $metadataImportsElement, - ]; - $expectedResponse = new ListMetadataImportsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetadataImports($metadataImports); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listMetadataImports($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetadataImports()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/ListMetadataImports', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataImportsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listMetadataImports($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listServices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listServices($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function moveTableToDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new MoveTableToDatabaseResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveTableToDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/MoveTableToDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getTableName(); - $this->assertProtobufEquals($tableName, $actualValue); - $actualValue = $actualApiRequestObject->getDbName(); - $this->assertProtobufEquals($dbName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationDbName(); - $this->assertProtobufEquals($destinationDbName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function moveTableToDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $resultManifestUri = 'resultManifestUri-1050940354'; - $expectedResponse = new QueryMetadataResponse(); - $expectedResponse->setResultManifestUri($resultManifestUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/queryMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/QueryMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function removeIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $success = false; - $expectedResponse = new RemoveIamPolicyResponse(); - $expectedResponse->setSuccess($success); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->removeIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/RemoveIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->removeIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restoreServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $backup2 = 'backup22121930997'; - $details = 'details1557721666'; - $expectedResponse = new Restore(); - $expectedResponse->setBackup($backup2); - $expectedResponse->setDetails($details); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/RestoreService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($formattedBackup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/UpdateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/UpdateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreFederationClientTest.php b/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreFederationClientTest.php deleted file mode 100644 index 5f9c90c3141e..000000000000 --- a/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreFederationClientTest.php +++ /dev/null @@ -1,901 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreFederationClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreFederationClient($options); - } - - /** @test */ - public function createFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFederationId(); - $this->assertProtobufEquals($federationId, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/DeleteFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFederationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name2); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->getFederation($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/GetFederation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFederationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - try { - $gapicClient->getFederation($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFederationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $federationsElement = new Federation(); - $federations = [ - $federationsElement, - ]; - $expectedResponse = new ListFederationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFederations($federations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listFederations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFederations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/ListFederations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFederationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listFederations($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/UpdateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreClientTest.php b/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreClientTest.php deleted file mode 100644 index 4cf24f594708..000000000000 --- a/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreClientTest.php +++ /dev/null @@ -1,2364 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreClient($options); - } - - /** @test */ - public function alterMetadataResourceLocationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AlterMetadataResourceLocationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/alterMetadataResourceLocationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getResourceName(); - $this->assertProtobufEquals($resourceName, $actualValue); - $actualValue = $actualApiRequestObject->getLocationUri(); - $this->assertProtobufEquals($locationUri, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function alterMetadataResourceLocationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/CreateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImportId(); - $this->assertProtobufEquals($metadataImportId, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/CreateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/DeleteBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/DeleteService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $destinationGcsUri = 'destinationGcsUri1386421523'; - $expectedResponse = new MetadataExport(); - $expectedResponse->setDestinationGcsUri($destinationGcsUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/ExportMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->getBackup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - try { - $gapicClient->getBackup($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataImportTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $response = $gapicClient->getMetadataImport($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/GetMetadataImport', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataImportExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - try { - $gapicClient->getMetadataImport($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->getService($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->getService($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; - $expectedResponse = new ListBackupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackups($backups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listBackups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listBackups($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataImportsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metadataImportsElement = new MetadataImport(); - $metadataImports = [ - $metadataImportsElement, - ]; - $expectedResponse = new ListMetadataImportsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetadataImports($metadataImports); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listMetadataImports($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetadataImports()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/ListMetadataImports', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataImportsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listMetadataImports($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listServices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listServices($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function moveTableToDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new MoveTableToDatabaseResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveTableToDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/MoveTableToDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getTableName(); - $this->assertProtobufEquals($tableName, $actualValue); - $actualValue = $actualApiRequestObject->getDbName(); - $this->assertProtobufEquals($dbName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationDbName(); - $this->assertProtobufEquals($destinationDbName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function moveTableToDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $resultManifestUri = 'resultManifestUri-1050940354'; - $expectedResponse = new QueryMetadataResponse(); - $expectedResponse->setResultManifestUri($resultManifestUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/queryMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/QueryMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function removeIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $success = false; - $expectedResponse = new RemoveIamPolicyResponse(); - $expectedResponse->setSuccess($success); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->removeIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/RemoveIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->removeIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restoreServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $backup2 = 'backup22121930997'; - $details = 'details1557721666'; - $expectedResponse = new Restore(); - $expectedResponse->setBackup($backup2); - $expectedResponse->setDetails($details); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/RestoreService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($formattedBackup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/UpdateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/UpdateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreFederationClientTest.php b/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreFederationClientTest.php deleted file mode 100644 index 12be1a4f8d8e..000000000000 --- a/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreFederationClientTest.php +++ /dev/null @@ -1,901 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreFederationClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreFederationClient($options); - } - - /** @test */ - public function createFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFederationId(); - $this->assertProtobufEquals($federationId, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/DeleteFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFederationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name2); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->getFederation($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/GetFederation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFederationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - try { - $gapicClient->getFederation($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFederationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $federationsElement = new Federation(); - $federations = [ - $federationsElement, - ]; - $expectedResponse = new ListFederationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFederations($federations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listFederations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFederations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/ListFederations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFederationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listFederations($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/UpdateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Datastore/.repo-metadata.json b/Datastore/.repo-metadata.json deleted file mode 100644 index de16111c67ec..000000000000 --- a/Datastore/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-datastore", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datastore/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "datastore" -} diff --git a/Datastore/VERSION b/Datastore/VERSION index 450a687b2dae..83cf0d951b0c 100644 --- a/Datastore/VERSION +++ b/Datastore/VERSION @@ -1 +1 @@ -1.28.1 +1.29.1 diff --git a/Datastore/composer.json b/Datastore/composer.json index fcc0640abdf8..0a7e29192c10 100644 --- a/Datastore/composer.json +++ b/Datastore/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^8.0", "google/cloud-core": "^1.52.7", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Datastore/metadata/V1/Datastore.php b/Datastore/metadata/V1/Datastore.php index dd57a6eaac78db3f47f6554f30fb69293eeada39..143a3d0d1483efd5f5bd8476729790666b583905 100644 GIT binary patch delta 210 zcmdmN(O|XV12fBBLoVgX8(2gp#`A9$XHjEhyffL3b+M?B1s88YQGP*cQAuTdZenq^ z1giq$WJWego&cz*FHmsuL)KSJvza%aWfNo+!O+2lMaSm5>|fX!ziht5&(Da(5>6~y iCO;JTDksZ@VzCe}7i&RcNk*{*qXM%A=jN+|aa;gVyhI!T delta 70 zcmV-M0J;BwIIUHg3J+3slYI%S cleY(9vr-822LZaXMi37HlaCSgv!fDS3S|ozv;Y7A diff --git a/Datastore/src/DatastoreClient.php b/Datastore/src/DatastoreClient.php index 45b3e055c4d8..aadf0835d40a 100644 --- a/Datastore/src/DatastoreClient.php +++ b/Datastore/src/DatastoreClient.php @@ -92,7 +92,7 @@ class DatastoreClient use ClientTrait; use DatastoreTrait; - const VERSION = '1.28.1'; + const VERSION = '1.29.1'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/datastore'; diff --git a/Datastore/src/V1/Gapic/DatastoreGapicClient.php b/Datastore/src/V1/Gapic/DatastoreGapicClient.php index 569641761270..bf7597e3a4ec 100644 --- a/Datastore/src/V1/Gapic/DatastoreGapicClient.php +++ b/Datastore/src/V1/Gapic/DatastoreGapicClient.php @@ -47,6 +47,7 @@ use Google\Cloud\Datastore\V1\LookupResponse; use Google\Cloud\Datastore\V1\Mutation; use Google\Cloud\Datastore\V1\PartitionId; +use Google\Cloud\Datastore\V1\PropertyMask; use Google\Cloud\Datastore\V1\Query; use Google\Cloud\Datastore\V1\ReadOptions; use Google\Cloud\Datastore\V1\ReserveIdsRequest; @@ -414,6 +415,13 @@ public function commit($projectId, $mode, $mutations, array $optionalArgs = []) * database. * @type ReadOptions $readOptions * The options for this lookup request. + * @type PropertyMask $propertyMask + * The properties to return. Defaults to returning all properties. + * + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * + * The entity's key is always returned. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -440,6 +448,10 @@ public function lookup($projectId, $keys, array $optionalArgs = []) $request->setReadOptions($optionalArgs['readOptions']); } + if (isset($optionalArgs['propertyMask'])) { + $request->setPropertyMask($optionalArgs['propertyMask']); + } + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall('Lookup', LookupResponse::class, $optionalArgs, $request)->wait(); @@ -669,6 +681,12 @@ public function runAggregationQuery($projectId, array $optionalArgs = []) * The query to run. * @type GqlQuery $gqlQuery * The GQL query to run. This query must be a non-aggregation query. + * @type PropertyMask $propertyMask + * The properties to return. + * This field must not be set for a projection query. + * + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. * @type ExplainOptions $explainOptions * Optional. Explain options for the query. If set, additional query * statistics will be returned. If not, only query results will be returned. @@ -706,6 +724,10 @@ public function runQuery($projectId, $partitionId, array $optionalArgs = []) $request->setGqlQuery($optionalArgs['gqlQuery']); } + if (isset($optionalArgs['propertyMask'])) { + $request->setPropertyMask($optionalArgs['propertyMask']); + } + if (isset($optionalArgs['explainOptions'])) { $request->setExplainOptions($optionalArgs['explainOptions']); } diff --git a/Datastore/src/V1/LookupRequest.php b/Datastore/src/V1/LookupRequest.php index 8cf7654fe0c5..e714464e4d5f 100644 --- a/Datastore/src/V1/LookupRequest.php +++ b/Datastore/src/V1/LookupRequest.php @@ -41,6 +41,15 @@ class LookupRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.datastore.v1.Key keys = 3 [(.google.api.field_behavior) = REQUIRED]; */ private $keys; + /** + * The properties to return. Defaults to returning all properties. + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * The entity's key is always returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 5; + */ + private $property_mask = null; /** * @param string $projectId Required. The ID of the project against which to make the request. @@ -75,6 +84,11 @@ public static function build(string $projectId, \Google\Cloud\Datastore\V1\ReadO * The options for this lookup request. * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys * Required. Keys of entities to look up. + * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask + * The properties to return. Defaults to returning all properties. + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * The entity's key is always returned. * } */ public function __construct($data = NULL) { @@ -200,5 +214,47 @@ public function setKeys($var) return $this; } + /** + * The properties to return. Defaults to returning all properties. + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * The entity's key is always returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 5; + * @return \Google\Cloud\Datastore\V1\PropertyMask|null + */ + public function getPropertyMask() + { + return $this->property_mask; + } + + public function hasPropertyMask() + { + return isset($this->property_mask); + } + + public function clearPropertyMask() + { + unset($this->property_mask); + } + + /** + * The properties to return. Defaults to returning all properties. + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * The entity's key is always returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 5; + * @param \Google\Cloud\Datastore\V1\PropertyMask $var + * @return $this + */ + public function setPropertyMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyMask::class); + $this->property_mask = $var; + + return $this; + } + } diff --git a/Datastore/src/V1/Mutation.php b/Datastore/src/V1/Mutation.php index b0c00ef5b2a3..22be69b75280 100644 --- a/Datastore/src/V1/Mutation.php +++ b/Datastore/src/V1/Mutation.php @@ -15,6 +15,18 @@ */ class Mutation extends \Google\Protobuf\Internal\Message { + /** + * The properties to write in this mutation. + * None of the properties in the mask may have a reserved name, except for + * `__key__`. + * This field is ignored for `delete`. + * If the entity already exists, only properties referenced in the mask are + * updated, others are left untouched. + * Properties referenced in the mask but not in the entity are deleted. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; + */ + private $property_mask = null; protected $operation; protected $conflict_detection_strategy; @@ -44,6 +56,14 @@ class Mutation extends \Google\Protobuf\Internal\Message * The update time of the entity that this mutation is being applied * to. If this does not match the current update time on the server, the * mutation conflicts. + * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask + * The properties to write in this mutation. + * None of the properties in the mask may have a reserved name, except for + * `__key__`. + * This field is ignored for `delete`. + * If the entity already exists, only properties referenced in the mask are + * updated, others are left untouched. + * Properties referenced in the mask but not in the entity are deleted. * } */ public function __construct($data = NULL) { @@ -253,6 +273,54 @@ public function setUpdateTime($var) return $this; } + /** + * The properties to write in this mutation. + * None of the properties in the mask may have a reserved name, except for + * `__key__`. + * This field is ignored for `delete`. + * If the entity already exists, only properties referenced in the mask are + * updated, others are left untouched. + * Properties referenced in the mask but not in the entity are deleted. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; + * @return \Google\Cloud\Datastore\V1\PropertyMask|null + */ + public function getPropertyMask() + { + return $this->property_mask; + } + + public function hasPropertyMask() + { + return isset($this->property_mask); + } + + public function clearPropertyMask() + { + unset($this->property_mask); + } + + /** + * The properties to write in this mutation. + * None of the properties in the mask may have a reserved name, except for + * `__key__`. + * This field is ignored for `delete`. + * If the entity already exists, only properties referenced in the mask are + * updated, others are left untouched. + * Properties referenced in the mask but not in the entity are deleted. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; + * @param \Google\Cloud\Datastore\V1\PropertyMask $var + * @return $this + */ + public function setPropertyMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyMask::class); + $this->property_mask = $var; + + return $this; + } + /** * @return string */ diff --git a/Datastore/src/V1/PropertyMask.php b/Datastore/src/V1/PropertyMask.php new file mode 100644 index 000000000000..1768924cdfb4 --- /dev/null +++ b/Datastore/src/V1/PropertyMask.php @@ -0,0 +1,96 @@ +google.datastore.v1.PropertyMask + */ +class PropertyMask extends \Google\Protobuf\Internal\Message +{ + /** + * The paths to the properties covered by this mask. + * A path is a list of property names separated by dots (`.`), for example + * `foo.bar` means the property `bar` inside the entity property `foo` inside + * the entity associated with this path. + * If a property name contains a dot `.` or a backslash `\`, then that + * name must be escaped. + * A path must not be empty, and may not reference a value inside an + * [array value][google.datastore.v1.Value.array_value]. + * + * Generated from protobuf field repeated string paths = 1; + */ + private $paths; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $paths + * The paths to the properties covered by this mask. + * A path is a list of property names separated by dots (`.`), for example + * `foo.bar` means the property `bar` inside the entity property `foo` inside + * the entity associated with this path. + * If a property name contains a dot `.` or a backslash `\`, then that + * name must be escaped. + * A path must not be empty, and may not reference a value inside an + * [array value][google.datastore.v1.Value.array_value]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The paths to the properties covered by this mask. + * A path is a list of property names separated by dots (`.`), for example + * `foo.bar` means the property `bar` inside the entity property `foo` inside + * the entity associated with this path. + * If a property name contains a dot `.` or a backslash `\`, then that + * name must be escaped. + * A path must not be empty, and may not reference a value inside an + * [array value][google.datastore.v1.Value.array_value]. + * + * Generated from protobuf field repeated string paths = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPaths() + { + return $this->paths; + } + + /** + * The paths to the properties covered by this mask. + * A path is a list of property names separated by dots (`.`), for example + * `foo.bar` means the property `bar` inside the entity property `foo` inside + * the entity associated with this path. + * If a property name contains a dot `.` or a backslash `\`, then that + * name must be escaped. + * A path must not be empty, and may not reference a value inside an + * [array value][google.datastore.v1.Value.array_value]. + * + * Generated from protobuf field repeated string paths = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPaths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->paths = $arr; + + return $this; + } + +} + diff --git a/Datastore/src/V1/RunQueryRequest.php b/Datastore/src/V1/RunQueryRequest.php index d7e47465a55c..2d1f158a209c 100644 --- a/Datastore/src/V1/RunQueryRequest.php +++ b/Datastore/src/V1/RunQueryRequest.php @@ -44,6 +44,15 @@ class RunQueryRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; */ private $read_options = null; + /** + * The properties to return. + * This field must not be set for a projection query. + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 10; + */ + private $property_mask = null; /** * Optional. Explain options for the query. If set, additional query * statistics will be returned. If not, only query results will be returned. @@ -76,6 +85,11 @@ class RunQueryRequest extends \Google\Protobuf\Internal\Message * The query to run. * @type \Google\Cloud\Datastore\V1\GqlQuery $gql_query * The GQL query to run. This query must be a non-aggregation query. + * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask + * The properties to return. + * This field must not be set for a projection query. + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. * @type \Google\Cloud\Datastore\V1\ExplainOptions $explain_options * Optional. Explain options for the query. If set, additional query * statistics will be returned. If not, only query results will be returned. @@ -282,6 +296,48 @@ public function setGqlQuery($var) return $this; } + /** + * The properties to return. + * This field must not be set for a projection query. + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 10; + * @return \Google\Cloud\Datastore\V1\PropertyMask|null + */ + public function getPropertyMask() + { + return $this->property_mask; + } + + public function hasPropertyMask() + { + return isset($this->property_mask); + } + + public function clearPropertyMask() + { + unset($this->property_mask); + } + + /** + * The properties to return. + * This field must not be set for a projection query. + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 10; + * @param \Google\Cloud\Datastore\V1\PropertyMask $var + * @return $this + */ + public function setPropertyMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyMask::class); + $this->property_mask = $var; + + return $this; + } + /** * Optional. Explain options for the query. If set, additional query * statistics will be returned. If not, only query results will be returned. diff --git a/DatastoreAdmin/.repo-metadata.json b/DatastoreAdmin/.repo-metadata.json deleted file mode 100644 index 8c0aa2718e70..000000000000 --- a/DatastoreAdmin/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-datastore-admin", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datastore-admin/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "datastore" -} diff --git a/DatastoreAdmin/VERSION b/DatastoreAdmin/VERSION index ee94dd834b53..7ada0d303f3e 100644 --- a/DatastoreAdmin/VERSION +++ b/DatastoreAdmin/VERSION @@ -1 +1 @@ -0.8.3 +0.8.5 diff --git a/DatastoreAdmin/composer.json b/DatastoreAdmin/composer.json index 6cadcd2785f4..6940beae9d28 100644 --- a/DatastoreAdmin/composer.json +++ b/DatastoreAdmin/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Datastream/.repo-metadata.json b/Datastream/.repo-metadata.json deleted file mode 100644 index 9cac206d613a..000000000000 --- a/Datastream/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-datastream", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-datastream/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "datastream" -} diff --git a/Datastream/VERSION b/Datastream/VERSION index 8af85beb5159..9075be495155 100644 --- a/Datastream/VERSION +++ b/Datastream/VERSION @@ -1 +1 @@ -1.5.3 +1.5.5 diff --git a/Datastream/composer.json b/Datastream/composer.json index e5cc4e621f74..04cf3f055627 100644 --- a/Datastream/composer.json +++ b/Datastream/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Debugger/.repo-metadata.json b/Debugger/.repo-metadata.json deleted file mode 100644 index 8a3cfa65a596..000000000000 --- a/Debugger/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-debugger", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-debugger/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "clouddebugger" -} diff --git a/Debugger/VERSION b/Debugger/VERSION index 8decb929b986..88d3ee7900c2 100644 --- a/Debugger/VERSION +++ b/Debugger/VERSION @@ -1 +1 @@ -1.8.5 +1.8.7 diff --git a/Debugger/composer.json b/Debugger/composer.json index 721bbfdcff2c..5154bb0bc6d4 100644 --- a/Debugger/composer.json +++ b/Debugger/composer.json @@ -7,7 +7,7 @@ "php": "^8.0", "google/cloud-core": "^1.52.7", "google/cloud-logging": "^1.16", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/cloud-common-protos": "~0.5", "psr/log": "^2.0||^3.0" }, diff --git a/Debugger/src/DebuggerClient.php b/Debugger/src/DebuggerClient.php index 54db26e5d2ce..51996b78ab93 100644 --- a/Debugger/src/DebuggerClient.php +++ b/Debugger/src/DebuggerClient.php @@ -40,7 +40,7 @@ class DebuggerClient { use ClientTrait; - const VERSION = '1.8.5'; + const VERSION = '1.8.7'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/cloud-platform'; const READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/debugger.readonly'; diff --git a/Deploy/.repo-metadata.json b/Deploy/.repo-metadata.json deleted file mode 100644 index 345064d310b5..000000000000 --- a/Deploy/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-deploy", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-deploy/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "clouddeploy" -} diff --git a/Deploy/README.md b/Deploy/README.md index 754ac32e2ded..4d855f340168 100644 --- a/Deploy/README.md +++ b/Deploy/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/Deploy/VERSION b/Deploy/VERSION index 66333910a4be..41915c799477 100644 --- a/Deploy/VERSION +++ b/Deploy/VERSION @@ -1 +1 @@ -0.18.0 +0.19.1 diff --git a/Deploy/composer.json b/Deploy/composer.json index e8c8a4cb6239..647156dacf14 100644 --- a/Deploy/composer.json +++ b/Deploy/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Deploy/metadata/V1/CloudDeploy.php b/Deploy/metadata/V1/CloudDeploy.php index 0aaa65011208c3d243fe9d10bcaa5b03ec5aa56b..84e15015363046e44b6729f0f325bcafe6701b22 100644 GIT binary patch delta 133 zcmZp>#JcESaPHppKk7!U&$yaB*MjBmRgjQUz{qzp}?rYu~}cSi%~g| zi_1Mb)j6lMxFoem$dZda8N!rc1ghb5(s*{H7_n+$Gnn^{9>4LOD?Y5)ZC=hqT-Cq0+^1?(aOi$ E0hN9vssI20 diff --git a/Deploy/owlbot.py b/Deploy/owlbot.py index 74abe132d7d4..e0dc2824d259 100644 --- a/Deploy/owlbot.py +++ b/Deploy/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -47,26 +41,6 @@ + "\n", '') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) - # format generated clients subprocess.run([ 'npm', @@ -75,8 +49,8 @@ '--package=@prettier/plugin-php@^0.16', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', - '--print-width=80']) + '--print-width=120']) diff --git a/Deploy/src/V1/AbandonReleaseRequest.php b/Deploy/src/V1/AbandonReleaseRequest.php index 06ff87a323c3..0b9a4e24b06f 100644 --- a/Deploy/src/V1/AbandonReleaseRequest.php +++ b/Deploy/src/V1/AbandonReleaseRequest.php @@ -21,7 +21,7 @@ class AbandonReleaseRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the Release. Format is diff --git a/Deploy/src/V1/AdvanceChildRolloutJobRun.php b/Deploy/src/V1/AdvanceChildRolloutJobRun.php index 9f2a7ad1a456..b864bc78b9ed 100644 --- a/Deploy/src/V1/AdvanceChildRolloutJobRun.php +++ b/Deploy/src/V1/AdvanceChildRolloutJobRun.php @@ -18,17 +18,17 @@ class AdvanceChildRolloutJobRun extends \Google\Protobuf\Internal\Message { /** * Output only. Name of the `ChildRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rollout = ''; + protected $rollout = ''; /** * Output only. the ID of the ChildRollout's Phase. * * Generated from protobuf field string rollout_phase_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rollout_phase_id = ''; + protected $rollout_phase_id = ''; /** * Constructor. @@ -38,7 +38,7 @@ class AdvanceChildRolloutJobRun extends \Google\Protobuf\Internal\Message * * @type string $rollout * Output only. Name of the `ChildRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @type string $rollout_phase_id * Output only. the ID of the ChildRollout's Phase. * } @@ -50,7 +50,7 @@ public function __construct($data = NULL) { /** * Output only. Name of the `ChildRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -62,7 +62,7 @@ public function getRollout() /** * Output only. Name of the `ChildRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var diff --git a/Deploy/src/V1/AdvanceRolloutOperation.php b/Deploy/src/V1/AdvanceRolloutOperation.php index dc15bae113da..8c8cd04062da 100644 --- a/Deploy/src/V1/AdvanceRolloutOperation.php +++ b/Deploy/src/V1/AdvanceRolloutOperation.php @@ -20,25 +20,25 @@ class AdvanceRolloutOperation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source_phase = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $source_phase = ''; + protected $source_phase = ''; /** * Output only. How long the operation will be paused. * * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $wait = null; + protected $wait = null; /** * Output only. The name of the rollout that initiates the `AutomationRun`. * * Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rollout = ''; + protected $rollout = ''; /** * Output only. The phase the rollout will be advanced to. * * Generated from protobuf field string destination_phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $destination_phase = ''; + protected $destination_phase = ''; /** * Constructor. diff --git a/Deploy/src/V1/AdvanceRolloutRequest.php b/Deploy/src/V1/AdvanceRolloutRequest.php index 9631871c44e8..f8c39a9f3dba 100644 --- a/Deploy/src/V1/AdvanceRolloutRequest.php +++ b/Deploy/src/V1/AdvanceRolloutRequest.php @@ -21,13 +21,13 @@ class AdvanceRolloutRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The phase ID to advance the `Rollout` to. * * Generated from protobuf field string phase_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $phase_id = ''; + protected $phase_id = ''; /** * @param string $name Required. Name of the Rollout. Format is diff --git a/Deploy/src/V1/AdvanceRolloutRule.php b/Deploy/src/V1/AdvanceRolloutRule.php index 0ac9ab030b72..798428be12f8 100644 --- a/Deploy/src/V1/AdvanceRolloutRule.php +++ b/Deploy/src/V1/AdvanceRolloutRule.php @@ -18,11 +18,12 @@ class AdvanceRolloutRule extends \Google\Protobuf\Internal\Message { /** * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $id = ''; + protected $id = ''; /** * Optional. Proceeds only after phase name matched any one in the list. * This value must consist of lower-case letters, numbers, and hyphens, @@ -38,13 +39,13 @@ class AdvanceRolloutRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration wait = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $wait = null; + protected $wait = null; /** * Output only. Information around the state of the Automation rule. * * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $condition = null; + protected $condition = null; /** * Constructor. @@ -54,7 +55,8 @@ class AdvanceRolloutRule extends \Google\Protobuf\Internal\Message * * @type string $id * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * @type array|\Google\Protobuf\Internal\RepeatedField $source_phases * Optional. Proceeds only after phase name matched any one in the list. * This value must consist of lower-case letters, numbers, and hyphens, @@ -74,7 +76,8 @@ public function __construct($data = NULL) { /** * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -86,7 +89,8 @@ public function getId() /** * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/Deploy/src/V1/AnthosCluster.php b/Deploy/src/V1/AnthosCluster.php index 97dd7cb2b432..4a94f019e63a 100644 --- a/Deploy/src/V1/AnthosCluster.php +++ b/Deploy/src/V1/AnthosCluster.php @@ -16,13 +16,13 @@ class AnthosCluster extends \Google\Protobuf\Internal\Message { /** - * Membership of the GKE Hub-registered cluster to which to apply the Skaffold - * configuration. Format is + * Optional. Membership of the GKE Hub-registered cluster to which to apply + * the Skaffold configuration. Format is * `projects/{project}/locations/{location}/memberships/{membership_name}`. * - * Generated from protobuf field string membership = 1 [(.google.api.resource_reference) = { + * Generated from protobuf field string membership = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $membership = ''; + protected $membership = ''; /** * Constructor. @@ -31,8 +31,8 @@ class AnthosCluster extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $membership - * Membership of the GKE Hub-registered cluster to which to apply the Skaffold - * configuration. Format is + * Optional. Membership of the GKE Hub-registered cluster to which to apply + * the Skaffold configuration. Format is * `projects/{project}/locations/{location}/memberships/{membership_name}`. * } */ @@ -42,11 +42,11 @@ public function __construct($data = NULL) { } /** - * Membership of the GKE Hub-registered cluster to which to apply the Skaffold - * configuration. Format is + * Optional. Membership of the GKE Hub-registered cluster to which to apply + * the Skaffold configuration. Format is * `projects/{project}/locations/{location}/memberships/{membership_name}`. * - * Generated from protobuf field string membership = 1 [(.google.api.resource_reference) = { + * Generated from protobuf field string membership = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @return string */ public function getMembership() @@ -55,11 +55,11 @@ public function getMembership() } /** - * Membership of the GKE Hub-registered cluster to which to apply the Skaffold - * configuration. Format is + * Optional. Membership of the GKE Hub-registered cluster to which to apply + * the Skaffold configuration. Format is * `projects/{project}/locations/{location}/memberships/{membership_name}`. * - * Generated from protobuf field string membership = 1 [(.google.api.resource_reference) = { + * Generated from protobuf field string membership = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/Deploy/src/V1/ApproveRolloutRequest.php b/Deploy/src/V1/ApproveRolloutRequest.php index 7758dadfa7c7..4f881df0b1c2 100644 --- a/Deploy/src/V1/ApproveRolloutRequest.php +++ b/Deploy/src/V1/ApproveRolloutRequest.php @@ -21,13 +21,13 @@ class ApproveRolloutRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. True = approve; false = reject * * Generated from protobuf field bool approved = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $approved = false; + protected $approved = false; /** * @param string $name Required. Name of the Rollout. Format is diff --git a/Deploy/src/V1/Automation.php b/Deploy/src/V1/Automation.php index ddc39053eba6..443645ba2bbd 100644 --- a/Deploy/src/V1/Automation.php +++ b/Deploy/src/V1/Automation.php @@ -26,31 +26,31 @@ class Automation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Unique identifier of the `Automation`. * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Optional. Description of the `Automation`. Max length is 255 characters. * * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. Time at which the automation was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time at which the automation was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. User annotations. These attributes can only be set and used by * the user, and not by Cloud Deploy. Annotations must meet the following @@ -93,26 +93,26 @@ class Automation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Optional. When Suspended, automation is deactivated from execution. * * Generated from protobuf field bool suspended = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $suspended = false; + protected $suspended = false; /** * Required. Email address of the user-managed IAM service account that * creates Cloud Deploy release and rollout resources. * * Generated from protobuf field string service_account = 10 [(.google.api.field_behavior) = REQUIRED]; */ - private $service_account = ''; + protected $service_account = ''; /** * Required. Selected resources to which the automation will be applied. * * Generated from protobuf field .google.cloud.deploy.v1.AutomationResourceSelector selector = 11 [(.google.api.field_behavior) = REQUIRED]; */ - private $selector = null; + protected $selector = null; /** * Required. List of Automation rules associated with the Automation resource. * Must have at least one rule and limited to 250 rules per Delivery Pipeline. diff --git a/Deploy/src/V1/AutomationEvent.php b/Deploy/src/V1/AutomationEvent.php index 78bb08011c48..b12f4851332d 100644 --- a/Deploy/src/V1/AutomationEvent.php +++ b/Deploy/src/V1/AutomationEvent.php @@ -22,25 +22,25 @@ class AutomationEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * The name of the `AutomationRun`. * * Generated from protobuf field string automation = 2; */ - private $automation = ''; + protected $automation = ''; /** * Unique identifier of the `DeliveryPipeline`. * * Generated from protobuf field string pipeline_uid = 3; */ - private $pipeline_uid = ''; + protected $pipeline_uid = ''; /** * Type of this notification, e.g. for a Pub/Sub failure. * * Generated from protobuf field .google.cloud.deploy.v1.Type type = 4; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Deploy/src/V1/AutomationRolloutMetadata.php b/Deploy/src/V1/AutomationRolloutMetadata.php index 0854ad8aed52..94653278f9de 100644 --- a/Deploy/src/V1/AutomationRolloutMetadata.php +++ b/Deploy/src/V1/AutomationRolloutMetadata.php @@ -22,7 +22,7 @@ class AutomationRolloutMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string promote_automation_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $promote_automation_run = ''; + protected $promote_automation_run = ''; /** * Output only. The IDs of the AutomationRuns initiated by an advance rollout * rule. diff --git a/Deploy/src/V1/AutomationRuleCondition.php b/Deploy/src/V1/AutomationRuleCondition.php index 5a291f07751e..2dac2539cdf3 100644 --- a/Deploy/src/V1/AutomationRuleCondition.php +++ b/Deploy/src/V1/AutomationRuleCondition.php @@ -21,7 +21,7 @@ class AutomationRuleCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $targets_present_condition = null; + protected $targets_present_condition = null; /** * Constructor. diff --git a/Deploy/src/V1/AutomationRun.php b/Deploy/src/V1/AutomationRun.php index fadd5c720cd9..3db70ad3d274 100644 --- a/Deploy/src/V1/AutomationRun.php +++ b/Deploy/src/V1/AutomationRun.php @@ -23,19 +23,19 @@ class AutomationRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Time at which the `AutomationRun` was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time at which the automationRun was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. The weak etag of the `AutomationRun` resource. * This checksum is computed by the server based on the value of other @@ -44,21 +44,21 @@ class AutomationRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $etag = ''; + protected $etag = ''; /** * Output only. Email address of the user-managed IAM service account that * performs the operations against Cloud Deploy resources. * * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service_account = ''; + protected $service_account = ''; /** * Output only. Snapshot of the Automation taken at AutomationRun creation * time. * * Generated from protobuf field .google.cloud.deploy.v1.Automation automation_snapshot = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $automation_snapshot = null; + protected $automation_snapshot = null; /** * Output only. The ID of the target that represents the promotion stage that * initiates the `AutomationRun`. The value of this field is the last segment @@ -66,46 +66,46 @@ class AutomationRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string target_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target_id = ''; + protected $target_id = ''; /** * Output only. Current state of the `AutomationRun`. * * Generated from protobuf field .google.cloud.deploy.v1.AutomationRun.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Explains the current state of the `AutomationRun`. Present * only when an explanation is needed. * * Generated from protobuf field string state_description = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_description = ''; + protected $state_description = ''; /** * Output only. Time the `AutomationRun` expires. An `AutomationRun` expires * after 14 days from its creation date. * * Generated from protobuf field .google.protobuf.Timestamp expire_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $expire_time = null; + protected $expire_time = null; /** * Output only. The ID of the automation rule that initiated the operation. * * Generated from protobuf field string rule_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rule_id = ''; + protected $rule_id = ''; /** * Output only. The ID of the automation that initiated the operation. * * Generated from protobuf field string automation_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $automation_id = ''; + protected $automation_id = ''; /** * Output only. Earliest time the `AutomationRun` will attempt to resume. * Wait-time is configured by `wait` in automation rule. * * Generated from protobuf field .google.protobuf.Timestamp wait_until_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $wait_until_time = null; + protected $wait_until_time = null; protected $operation; /** diff --git a/Deploy/src/V1/AutomationRunEvent.php b/Deploy/src/V1/AutomationRunEvent.php index c81ff9cee813..409f23c5f943 100644 --- a/Deploy/src/V1/AutomationRunEvent.php +++ b/Deploy/src/V1/AutomationRunEvent.php @@ -22,43 +22,43 @@ class AutomationRunEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * The name of the `AutomationRun`. * * Generated from protobuf field string automation_run = 2; */ - private $automation_run = ''; + protected $automation_run = ''; /** * Unique identifier of the `DeliveryPipeline`. * * Generated from protobuf field string pipeline_uid = 3; */ - private $pipeline_uid = ''; + protected $pipeline_uid = ''; /** * Identifier of the `Automation`. * * Generated from protobuf field string automation_id = 4; */ - private $automation_id = ''; + protected $automation_id = ''; /** * Identifier of the `Automation` rule. * * Generated from protobuf field string rule_id = 5; */ - private $rule_id = ''; + protected $rule_id = ''; /** * ID of the `Target` to which the `AutomationRun` is created. * * Generated from protobuf field string destination_target_id = 6; */ - private $destination_target_id = ''; + protected $destination_target_id = ''; /** * Type of this notification, e.g. for a Pub/Sub failure. * * Generated from protobuf field .google.cloud.deploy.v1.Type type = 7; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Deploy/src/V1/BuildArtifact.php b/Deploy/src/V1/BuildArtifact.php index 9bccc560123b..23cd5da0a754 100644 --- a/Deploy/src/V1/BuildArtifact.php +++ b/Deploy/src/V1/BuildArtifact.php @@ -20,7 +20,7 @@ class BuildArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string image = 3; */ - private $image = ''; + protected $image = ''; /** * Image tag to use. This will generally be the full path to an image, such * as "gcr.io/my-project/busybox:1.2.3" or @@ -28,7 +28,7 @@ class BuildArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tag = 2; */ - private $tag = ''; + protected $tag = ''; /** * Constructor. diff --git a/Deploy/src/V1/Canary.php b/Deploy/src/V1/Canary.php index ee4070befe3d..929faf223233 100644 --- a/Deploy/src/V1/Canary.php +++ b/Deploy/src/V1/Canary.php @@ -22,7 +22,7 @@ class Canary extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.RuntimeConfig runtime_config = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $runtime_config = null; + protected $runtime_config = null; protected $mode; /** diff --git a/Deploy/src/V1/CanaryDeployment.php b/Deploy/src/V1/CanaryDeployment.php index 43798d288ba7..7d2b36b630b6 100644 --- a/Deploy/src/V1/CanaryDeployment.php +++ b/Deploy/src/V1/CanaryDeployment.php @@ -28,21 +28,21 @@ class CanaryDeployment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool verify = 2; */ - private $verify = false; + protected $verify = false; /** * Optional. Configuration for the predeploy job of the first phase. If this * is not configured, there will be no predeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $predeploy = null; + protected $predeploy = null; /** * Optional. Configuration for the postdeploy job of the last phase. If this * is not configured, there will be no postdeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $postdeploy = null; + protected $postdeploy = null; /** * Constructor. diff --git a/Deploy/src/V1/CancelAutomationRunRequest.php b/Deploy/src/V1/CancelAutomationRunRequest.php index f5f914a02594..9b97433df290 100644 --- a/Deploy/src/V1/CancelAutomationRunRequest.php +++ b/Deploy/src/V1/CancelAutomationRunRequest.php @@ -21,7 +21,7 @@ class CancelAutomationRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `AutomationRun`. Format is diff --git a/Deploy/src/V1/CancelRolloutRequest.php b/Deploy/src/V1/CancelRolloutRequest.php index b8d2ff53ad15..3ae1d6f52a6f 100644 --- a/Deploy/src/V1/CancelRolloutRequest.php +++ b/Deploy/src/V1/CancelRolloutRequest.php @@ -21,7 +21,7 @@ class CancelRolloutRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the Rollout. Format is diff --git a/Deploy/src/V1/Client/CloudDeployClient.php b/Deploy/src/V1/Client/CloudDeployClient.php index 4c8585ac7303..6bb7d99f935d 100644 --- a/Deploy/src/V1/Client/CloudDeployClient.php +++ b/Deploy/src/V1/Client/CloudDeployClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a automation * resource. @@ -252,8 +271,12 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted automation resource. */ - public static function automationName(string $project, string $location, string $deliveryPipeline, string $automation): string - { + public static function automationName( + string $project, + string $location, + string $deliveryPipeline, + string $automation + ): string { return self::getPathTemplate('automation')->render([ 'project' => $project, 'location' => $location, @@ -273,8 +296,12 @@ public static function automationName(string $project, string $location, string * * @return string The formatted automation_run resource. */ - public static function automationRunName(string $project, string $location, string $deliveryPipeline, string $automationRun): string - { + public static function automationRunName( + string $project, + string $location, + string $deliveryPipeline, + string $automationRun + ): string { return self::getPathTemplate('automationRun')->render([ 'project' => $project, 'location' => $location, @@ -408,8 +435,14 @@ public static function jobName(string $project, string $location, string $job): * * @return string The formatted job_run resource. */ - public static function jobRunName(string $project, string $location, string $deliveryPipeline, string $release, string $rollout, string $jobRun): string - { + public static function jobRunName( + string $project, + string $location, + string $deliveryPipeline, + string $release, + string $rollout, + string $jobRun + ): string { return self::getPathTemplate('jobRun')->render([ 'project' => $project, 'location' => $location, @@ -467,8 +500,12 @@ public static function membershipName(string $project, string $location, string * * @return string The formatted release resource. */ - public static function releaseName(string $project, string $location, string $deliveryPipeline, string $release): string - { + public static function releaseName( + string $project, + string $location, + string $deliveryPipeline, + string $release + ): string { return self::getPathTemplate('release')->render([ 'project' => $project, 'location' => $location, @@ -488,8 +525,12 @@ public static function releaseName(string $project, string $location, string $de * * @return string The formatted repository resource. */ - public static function repositoryName(string $project, string $location, string $connection, string $repository): string - { + public static function repositoryName( + string $project, + string $location, + string $connection, + string $repository + ): string { return self::getPathTemplate('repository')->render([ 'project' => $project, 'location' => $location, @@ -510,8 +551,13 @@ public static function repositoryName(string $project, string $location, string * * @return string The formatted rollout resource. */ - public static function rolloutName(string $project, string $location, string $deliveryPipeline, string $release, string $rollout): string - { + public static function rolloutName( + string $project, + string $location, + string $deliveryPipeline, + string $release, + string $rollout + ): string { return self::getPathTemplate('rollout')->render([ 'project' => $project, 'location' => $location, @@ -792,8 +838,10 @@ public function approveRollout(ApproveRolloutRequest $request, array $callOption * * @throws ApiException Thrown if the API call fails. */ - public function cancelAutomationRun(CancelAutomationRunRequest $request, array $callOptions = []): CancelAutomationRunResponse - { + public function cancelAutomationRun( + CancelAutomationRunRequest $request, + array $callOptions = [] + ): CancelAutomationRunResponse { return $this->startApiCall('CancelAutomationRun', $request, $callOptions)->wait(); } @@ -870,8 +918,10 @@ public function createAutomation(CreateAutomationRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function createCustomTargetType(CreateCustomTargetTypeRequest $request, array $callOptions = []): OperationResponse - { + public function createCustomTargetType( + CreateCustomTargetTypeRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateCustomTargetType', $request, $callOptions)->wait(); } @@ -896,8 +946,10 @@ public function createCustomTargetType(CreateCustomTargetTypeRequest $request, a * * @throws ApiException Thrown if the API call fails. */ - public function createDeliveryPipeline(CreateDeliveryPipelineRequest $request, array $callOptions = []): OperationResponse - { + public function createDeliveryPipeline( + CreateDeliveryPipelineRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateDeliveryPipeline', $request, $callOptions)->wait(); } @@ -1026,8 +1078,10 @@ public function deleteAutomation(DeleteAutomationRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function deleteCustomTargetType(DeleteCustomTargetTypeRequest $request, array $callOptions = []): OperationResponse - { + public function deleteCustomTargetType( + DeleteCustomTargetTypeRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteCustomTargetType', $request, $callOptions)->wait(); } @@ -1052,8 +1106,10 @@ public function deleteCustomTargetType(DeleteCustomTargetTypeRequest $request, a * * @throws ApiException Thrown if the API call fails. */ - public function deleteDeliveryPipeline(DeleteDeliveryPipelineRequest $request, array $callOptions = []): OperationResponse - { + public function deleteDeliveryPipeline( + DeleteDeliveryPipelineRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteDeliveryPipeline', $request, $callOptions)->wait(); } @@ -1416,8 +1472,10 @@ public function listAutomations(ListAutomationsRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function listCustomTargetTypes(ListCustomTargetTypesRequest $request, array $callOptions = []): PagedListResponse - { + public function listCustomTargetTypes( + ListCustomTargetTypesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListCustomTargetTypes', $request, $callOptions); } @@ -1442,8 +1500,10 @@ public function listCustomTargetTypes(ListCustomTargetTypesRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function listDeliveryPipelines(ListDeliveryPipelinesRequest $request, array $callOptions = []): PagedListResponse - { + public function listDeliveryPipelines( + ListDeliveryPipelinesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListDeliveryPipelines', $request, $callOptions); } @@ -1676,8 +1736,10 @@ public function updateAutomation(UpdateAutomationRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function updateCustomTargetType(UpdateCustomTargetTypeRequest $request, array $callOptions = []): OperationResponse - { + public function updateCustomTargetType( + UpdateCustomTargetTypeRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateCustomTargetType', $request, $callOptions)->wait(); } @@ -1702,8 +1764,10 @@ public function updateCustomTargetType(UpdateCustomTargetTypeRequest $request, a * * @throws ApiException Thrown if the API call fails. */ - public function updateDeliveryPipeline(UpdateDeliveryPipelineRequest $request, array $callOptions = []): OperationResponse - { + public function updateDeliveryPipeline( + UpdateDeliveryPipelineRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateDeliveryPipeline', $request, $callOptions)->wait(); } @@ -1869,8 +1933,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/Deploy/src/V1/CloudDeployClient.php b/Deploy/src/V1/CloudDeployClient.php deleted file mode 100644 index 36d1b9c3e597..000000000000 --- a/Deploy/src/V1/CloudDeployClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListDeliveryPipelines', - $argument, - ['\Google\Cloud\Deploy\V1\ListDeliveryPipelinesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single DeliveryPipeline. - * @param \Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetDeliveryPipeline(\Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetDeliveryPipeline', - $argument, - ['\Google\Cloud\Deploy\V1\DeliveryPipeline', 'decode'], - $metadata, $options); - } - - /** - * Creates a new DeliveryPipeline in a given project and location. - * @param \Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateDeliveryPipeline(\Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateDeliveryPipeline', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single DeliveryPipeline. - * @param \Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateDeliveryPipeline(\Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/UpdateDeliveryPipeline', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single DeliveryPipeline. - * @param \Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteDeliveryPipeline(\Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/DeleteDeliveryPipeline', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists Targets in a given project and location. - * @param \Google\Cloud\Deploy\V1\ListTargetsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTargets(\Google\Cloud\Deploy\V1\ListTargetsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListTargets', - $argument, - ['\Google\Cloud\Deploy\V1\ListTargetsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Target. - * @param \Google\Cloud\Deploy\V1\GetTargetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTarget(\Google\Cloud\Deploy\V1\GetTargetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetTarget', - $argument, - ['\Google\Cloud\Deploy\V1\Target', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Target in a given project and location. - * @param \Google\Cloud\Deploy\V1\CreateTargetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTarget(\Google\Cloud\Deploy\V1\CreateTargetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateTarget', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single Target. - * @param \Google\Cloud\Deploy\V1\UpdateTargetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTarget(\Google\Cloud\Deploy\V1\UpdateTargetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/UpdateTarget', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Target. - * @param \Google\Cloud\Deploy\V1\DeleteTargetRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTarget(\Google\Cloud\Deploy\V1\DeleteTargetRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/DeleteTarget', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists Releases in a given project and location. - * @param \Google\Cloud\Deploy\V1\ListReleasesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListReleases(\Google\Cloud\Deploy\V1\ListReleasesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListReleases', - $argument, - ['\Google\Cloud\Deploy\V1\ListReleasesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Release. - * @param \Google\Cloud\Deploy\V1\GetReleaseRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetRelease(\Google\Cloud\Deploy\V1\GetReleaseRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetRelease', - $argument, - ['\Google\Cloud\Deploy\V1\Release', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Release in a given project and location. - * @param \Google\Cloud\Deploy\V1\CreateReleaseRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateRelease(\Google\Cloud\Deploy\V1\CreateReleaseRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateRelease', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Abandons a Release in the Delivery Pipeline. - * @param \Google\Cloud\Deploy\V1\AbandonReleaseRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AbandonRelease(\Google\Cloud\Deploy\V1\AbandonReleaseRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/AbandonRelease', - $argument, - ['\Google\Cloud\Deploy\V1\AbandonReleaseResponse', 'decode'], - $metadata, $options); - } - - /** - * Approves a Rollout. - * @param \Google\Cloud\Deploy\V1\ApproveRolloutRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ApproveRollout(\Google\Cloud\Deploy\V1\ApproveRolloutRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ApproveRollout', - $argument, - ['\Google\Cloud\Deploy\V1\ApproveRolloutResponse', 'decode'], - $metadata, $options); - } - - /** - * Advances a Rollout in a given project and location. - * @param \Google\Cloud\Deploy\V1\AdvanceRolloutRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AdvanceRollout(\Google\Cloud\Deploy\V1\AdvanceRolloutRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/AdvanceRollout', - $argument, - ['\Google\Cloud\Deploy\V1\AdvanceRolloutResponse', 'decode'], - $metadata, $options); - } - - /** - * Cancels a Rollout in a given project and location. - * @param \Google\Cloud\Deploy\V1\CancelRolloutRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelRollout(\Google\Cloud\Deploy\V1\CancelRolloutRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CancelRollout', - $argument, - ['\Google\Cloud\Deploy\V1\CancelRolloutResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists Rollouts in a given project and location. - * @param \Google\Cloud\Deploy\V1\ListRolloutsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListRollouts(\Google\Cloud\Deploy\V1\ListRolloutsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListRollouts', - $argument, - ['\Google\Cloud\Deploy\V1\ListRolloutsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Rollout. - * @param \Google\Cloud\Deploy\V1\GetRolloutRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetRollout(\Google\Cloud\Deploy\V1\GetRolloutRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetRollout', - $argument, - ['\Google\Cloud\Deploy\V1\Rollout', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Rollout in a given project and location. - * @param \Google\Cloud\Deploy\V1\CreateRolloutRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateRollout(\Google\Cloud\Deploy\V1\CreateRolloutRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateRollout', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Ignores the specified Job in a Rollout. - * @param \Google\Cloud\Deploy\V1\IgnoreJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function IgnoreJob(\Google\Cloud\Deploy\V1\IgnoreJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/IgnoreJob', - $argument, - ['\Google\Cloud\Deploy\V1\IgnoreJobResponse', 'decode'], - $metadata, $options); - } - - /** - * Retries the specified Job in a Rollout. - * @param \Google\Cloud\Deploy\V1\RetryJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RetryJob(\Google\Cloud\Deploy\V1\RetryJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/RetryJob', - $argument, - ['\Google\Cloud\Deploy\V1\RetryJobResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists JobRuns in a given project and location. - * @param \Google\Cloud\Deploy\V1\ListJobRunsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListJobRuns(\Google\Cloud\Deploy\V1\ListJobRunsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListJobRuns', - $argument, - ['\Google\Cloud\Deploy\V1\ListJobRunsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single JobRun. - * @param \Google\Cloud\Deploy\V1\GetJobRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetJobRun(\Google\Cloud\Deploy\V1\GetJobRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetJobRun', - $argument, - ['\Google\Cloud\Deploy\V1\JobRun', 'decode'], - $metadata, $options); - } - - /** - * Terminates a Job Run in a given project and location. - * @param \Google\Cloud\Deploy\V1\TerminateJobRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TerminateJobRun(\Google\Cloud\Deploy\V1\TerminateJobRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/TerminateJobRun', - $argument, - ['\Google\Cloud\Deploy\V1\TerminateJobRunResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the configuration for a location. - * @param \Google\Cloud\Deploy\V1\GetConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetConfig(\Google\Cloud\Deploy\V1\GetConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetConfig', - $argument, - ['\Google\Cloud\Deploy\V1\Config', 'decode'], - $metadata, $options); - } - -} diff --git a/Deploy/src/V1/CloudRunConfig.php b/Deploy/src/V1/CloudRunConfig.php index 9af7174bba20..030fbfbdf261 100644 --- a/Deploy/src/V1/CloudRunConfig.php +++ b/Deploy/src/V1/CloudRunConfig.php @@ -23,7 +23,7 @@ class CloudRunConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool automatic_traffic_control = 1; */ - private $automatic_traffic_control = false; + protected $automatic_traffic_control = false; /** * Optional. A list of tags that are added to the canary revision while the * canary phase is in progress. diff --git a/Deploy/src/V1/CloudRunLocation.php b/Deploy/src/V1/CloudRunLocation.php index b94327544b9e..ff0ebad3a710 100644 --- a/Deploy/src/V1/CloudRunLocation.php +++ b/Deploy/src/V1/CloudRunLocation.php @@ -21,7 +21,7 @@ class CloudRunLocation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Deploy/src/V1/CloudRunMetadata.php b/Deploy/src/V1/CloudRunMetadata.php index a47e5956a683..ce57bad75b8c 100644 --- a/Deploy/src/V1/CloudRunMetadata.php +++ b/Deploy/src/V1/CloudRunMetadata.php @@ -22,7 +22,7 @@ class CloudRunMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Output only. The Cloud Run Service urls that are associated with a * `Rollout`. @@ -35,7 +35,7 @@ class CloudRunMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string revision = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $revision = ''; + protected $revision = ''; /** * Output only. The name of the Cloud Run job that is associated with a * `Rollout`. Format is @@ -43,7 +43,7 @@ class CloudRunMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $job = ''; + protected $job = ''; /** * Constructor. diff --git a/Deploy/src/V1/CloudRunRenderMetadata.php b/Deploy/src/V1/CloudRunRenderMetadata.php index 6471fb97e238..8695f4611f63 100644 --- a/Deploy/src/V1/CloudRunRenderMetadata.php +++ b/Deploy/src/V1/CloudRunRenderMetadata.php @@ -22,7 +22,7 @@ class CloudRunRenderMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Constructor. diff --git a/Deploy/src/V1/Config.php b/Deploy/src/V1/Config.php index 578e07f66e11..d3401ecb99a3 100644 --- a/Deploy/src/V1/Config.php +++ b/Deploy/src/V1/Config.php @@ -20,7 +20,7 @@ class Config extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * All supported versions of Skaffold. * @@ -33,7 +33,7 @@ class Config extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string default_skaffold_version = 3; */ - private $default_skaffold_version = ''; + protected $default_skaffold_version = ''; /** * Constructor. diff --git a/Deploy/src/V1/CreateAutomationRequest.php b/Deploy/src/V1/CreateAutomationRequest.php index b6e89528f70f..be5a7c0be40e 100644 --- a/Deploy/src/V1/CreateAutomationRequest.php +++ b/Deploy/src/V1/CreateAutomationRequest.php @@ -22,19 +22,19 @@ class CreateAutomationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. ID of the `Automation`. * * Generated from protobuf field string automation_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $automation_id = ''; + protected $automation_id = ''; /** * Required. The `Automation` to create. * * Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $automation = null; + protected $automation = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -50,14 +50,14 @@ class CreateAutomationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The parent collection in which the `Automation` should be diff --git a/Deploy/src/V1/CreateChildRolloutJobRun.php b/Deploy/src/V1/CreateChildRolloutJobRun.php index 89484e5f5401..2207026b617e 100644 --- a/Deploy/src/V1/CreateChildRolloutJobRun.php +++ b/Deploy/src/V1/CreateChildRolloutJobRun.php @@ -18,17 +18,17 @@ class CreateChildRolloutJobRun extends \Google\Protobuf\Internal\Message { /** * Output only. Name of the `ChildRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rollout = ''; + protected $rollout = ''; /** * Output only. The ID of the childRollout Phase initiated by this JobRun. * * Generated from protobuf field string rollout_phase_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rollout_phase_id = ''; + protected $rollout_phase_id = ''; /** * Constructor. @@ -38,7 +38,7 @@ class CreateChildRolloutJobRun extends \Google\Protobuf\Internal\Message * * @type string $rollout * Output only. Name of the `ChildRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @type string $rollout_phase_id * Output only. The ID of the childRollout Phase initiated by this JobRun. * } @@ -50,7 +50,7 @@ public function __construct($data = NULL) { /** * Output only. Name of the `ChildRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -62,7 +62,7 @@ public function getRollout() /** * Output only. Name of the `ChildRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var diff --git a/Deploy/src/V1/CreateCustomTargetTypeRequest.php b/Deploy/src/V1/CreateCustomTargetTypeRequest.php index ab0600295264..8a960ab99c5c 100644 --- a/Deploy/src/V1/CreateCustomTargetTypeRequest.php +++ b/Deploy/src/V1/CreateCustomTargetTypeRequest.php @@ -22,19 +22,19 @@ class CreateCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. ID of the `CustomTargetType`. * * Generated from protobuf field string custom_target_type_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $custom_target_type_id = ''; + protected $custom_target_type_id = ''; /** * Required. The `CustomTargetType` to create. * * Generated from protobuf field .google.cloud.deploy.v1.CustomTargetType custom_target_type = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $custom_target_type = null; + protected $custom_target_type = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -50,14 +50,14 @@ class CreateCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The parent collection in which the `CustomTargetType` should be diff --git a/Deploy/src/V1/CreateDeliveryPipelineRequest.php b/Deploy/src/V1/CreateDeliveryPipelineRequest.php index 5cfb560430c1..48852f0c48dd 100644 --- a/Deploy/src/V1/CreateDeliveryPipelineRequest.php +++ b/Deploy/src/V1/CreateDeliveryPipelineRequest.php @@ -22,19 +22,19 @@ class CreateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. ID of the `DeliveryPipeline`. * * Generated from protobuf field string delivery_pipeline_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $delivery_pipeline_id = ''; + protected $delivery_pipeline_id = ''; /** * Required. The `DeliveryPipeline` to create. * * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $delivery_pipeline = null; + protected $delivery_pipeline = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -50,14 +50,14 @@ class CreateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The parent collection in which the `DeliveryPipeline` should be diff --git a/Deploy/src/V1/CreateReleaseRequest.php b/Deploy/src/V1/CreateReleaseRequest.php index 6d7f011c0768..538162251d06 100644 --- a/Deploy/src/V1/CreateReleaseRequest.php +++ b/Deploy/src/V1/CreateReleaseRequest.php @@ -22,19 +22,19 @@ class CreateReleaseRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. ID of the `Release`. * * Generated from protobuf field string release_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $release_id = ''; + protected $release_id = ''; /** * Required. The `Release` to create. * * Generated from protobuf field .google.cloud.deploy.v1.Release release = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $release = null; + protected $release = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -50,14 +50,14 @@ class CreateReleaseRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The parent collection in which the `Release` should be created. diff --git a/Deploy/src/V1/CreateRolloutRequest.php b/Deploy/src/V1/CreateRolloutRequest.php index 470438383afa..49dc433f36a2 100644 --- a/Deploy/src/V1/CreateRolloutRequest.php +++ b/Deploy/src/V1/CreateRolloutRequest.php @@ -22,19 +22,19 @@ class CreateRolloutRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. ID of the `Rollout`. * * Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $rollout_id = ''; + protected $rollout_id = ''; /** * Required. The `Rollout` to create. * * Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $rollout = null; + protected $rollout = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -50,21 +50,21 @@ class CreateRolloutRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * Optional. The starting phase ID for the `Rollout`. If empty the `Rollout` * will start at the first phase. * * Generated from protobuf field string starting_phase_id = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $starting_phase_id = ''; + protected $starting_phase_id = ''; /** * @param string $parent Required. The parent collection in which the `Rollout` should be created. diff --git a/Deploy/src/V1/CreateTargetRequest.php b/Deploy/src/V1/CreateTargetRequest.php index 043c9785a1eb..9c666d2eca4f 100644 --- a/Deploy/src/V1/CreateTargetRequest.php +++ b/Deploy/src/V1/CreateTargetRequest.php @@ -22,19 +22,19 @@ class CreateTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. ID of the `Target`. * * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_id = ''; + protected $target_id = ''; /** * Required. The `Target` to create. * * Generated from protobuf field .google.cloud.deploy.v1.Target target = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $target = null; + protected $target = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -50,14 +50,14 @@ class CreateTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent Required. The parent collection in which the `Target` should be created. diff --git a/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php b/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php index e656b77ceb69..fb5c4f0b218d 100644 --- a/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php +++ b/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php @@ -25,13 +25,13 @@ class PhaseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string phase_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $phase_id = ''; + protected $phase_id = ''; /** * Required. Percentage deployment for the phase. * * Generated from protobuf field int32 percentage = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $percentage = 0; + protected $percentage = 0; /** * Skaffold profiles to use when rendering the manifest for this phase. * These are in addition to the profiles list specified in the @@ -45,21 +45,21 @@ class PhaseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool verify = 4; */ - private $verify = false; + protected $verify = false; /** * Optional. Configuration for the predeploy job of this phase. If this is * not configured, there will be no predeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $predeploy = null; + protected $predeploy = null; /** * Optional. Configuration for the postdeploy job of this phase. If this is * not configured, there will be no postdeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $postdeploy = null; + protected $postdeploy = null; /** * Constructor. diff --git a/Deploy/src/V1/CustomTarget.php b/Deploy/src/V1/CustomTarget.php index 9fb59e74e1e6..cd56d0f9ff5a 100644 --- a/Deploy/src/V1/CustomTarget.php +++ b/Deploy/src/V1/CustomTarget.php @@ -21,7 +21,7 @@ class CustomTarget extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string custom_target_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $custom_target_type = ''; + protected $custom_target_type = ''; /** * Constructor. diff --git a/Deploy/src/V1/CustomTargetDeployMetadata.php b/Deploy/src/V1/CustomTargetDeployMetadata.php index da03557cbf5b..84f7747119b7 100644 --- a/Deploy/src/V1/CustomTargetDeployMetadata.php +++ b/Deploy/src/V1/CustomTargetDeployMetadata.php @@ -22,7 +22,7 @@ class CustomTargetDeployMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string skip_message = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $skip_message = ''; + protected $skip_message = ''; /** * Constructor. diff --git a/Deploy/src/V1/CustomTargetSkaffoldActions.php b/Deploy/src/V1/CustomTargetSkaffoldActions.php index ce9a6791b22a..bd8698c053a8 100644 --- a/Deploy/src/V1/CustomTargetSkaffoldActions.php +++ b/Deploy/src/V1/CustomTargetSkaffoldActions.php @@ -23,13 +23,13 @@ class CustomTargetSkaffoldActions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string render_action = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $render_action = ''; + protected $render_action = ''; /** * Required. The Skaffold custom action responsible for deploy operations. * * Generated from protobuf field string deploy_action = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deploy_action = ''; + protected $deploy_action = ''; /** * Optional. List of Skaffold modules Cloud Deploy will include in the * Skaffold Config as required before performing diagnose. diff --git a/Deploy/src/V1/CustomTargetType.php b/Deploy/src/V1/CustomTargetType.php index 2371511d3942..8b54d063c81f 100644 --- a/Deploy/src/V1/CustomTargetType.php +++ b/Deploy/src/V1/CustomTargetType.php @@ -20,30 +20,32 @@ class CustomTargetType extends \Google\Protobuf\Internal\Message { /** * Optional. Name of the `CustomTargetType`. Format is - * `projects/{project}/locations/{location}/customTargetTypes/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`. + * The `customTargetType` component must match + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Output only. Resource id of the `CustomTargetType`. * * Generated from protobuf field string custom_target_type_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $custom_target_type_id = ''; + protected $custom_target_type_id = ''; /** * Output only. Unique identifier of the `CustomTargetType`. * * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Optional. Description of the `CustomTargetType`. Max length is 255 * characters. * * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User annotations. These attributes can only be set and used by * the user, and not by Cloud Deploy. See @@ -72,13 +74,13 @@ class CustomTargetType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Most recent time at which the `CustomTargetType` was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the @@ -86,7 +88,7 @@ class CustomTargetType extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; protected $definition; /** @@ -97,7 +99,9 @@ class CustomTargetType extends \Google\Protobuf\Internal\Message * * @type string $name * Optional. Name of the `CustomTargetType`. Format is - * `projects/{project}/locations/{location}/customTargetTypes/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`. + * The `customTargetType` component must match + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * @type string $custom_target_type_id * Output only. Resource id of the `CustomTargetType`. * @type string $uid @@ -140,7 +144,9 @@ public function __construct($data = NULL) { /** * Optional. Name of the `CustomTargetType`. Format is - * `projects/{project}/locations/{location}/customTargetTypes/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`. + * The `customTargetType` component must match + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -152,7 +158,9 @@ public function getName() /** * Optional. Name of the `CustomTargetType`. Format is - * `projects/{project}/locations/{location}/customTargetTypes/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`. + * The `customTargetType` component must match + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Deploy/src/V1/DefaultPool.php b/Deploy/src/V1/DefaultPool.php index 3bebf4096493..8e6bc4524fa3 100644 --- a/Deploy/src/V1/DefaultPool.php +++ b/Deploy/src/V1/DefaultPool.php @@ -22,7 +22,7 @@ class DefaultPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_account = ''; + protected $service_account = ''; /** * Optional. Cloud Storage location where execution outputs should be stored. * This can either be a bucket ("gs://my-bucket") or a path within a bucket @@ -31,7 +31,7 @@ class DefaultPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string artifact_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $artifact_storage = ''; + protected $artifact_storage = ''; /** * Constructor. diff --git a/Deploy/src/V1/DeleteAutomationRequest.php b/Deploy/src/V1/DeleteAutomationRequest.php index 9dc2aca2174b..0dc66a756a74 100644 --- a/Deploy/src/V1/DeleteAutomationRequest.php +++ b/Deploy/src/V1/DeleteAutomationRequest.php @@ -21,7 +21,7 @@ class DeleteAutomationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -37,21 +37,21 @@ class DeleteAutomationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, then deleting an already deleted or non-existing * `Automation` will succeed. * * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_missing = false; + protected $allow_missing = false; /** * Optional. If set, validate the request and verify whether the resource * exists, but do not actually post it. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * Optional. The weak etag of the request. * This checksum is computed by the server based on the value of other @@ -60,7 +60,7 @@ class DeleteAutomationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The name of the `Automation` to delete. Format should be diff --git a/Deploy/src/V1/DeleteCustomTargetTypeRequest.php b/Deploy/src/V1/DeleteCustomTargetTypeRequest.php index cc5fbd850526..47939212ecd7 100644 --- a/Deploy/src/V1/DeleteCustomTargetTypeRequest.php +++ b/Deploy/src/V1/DeleteCustomTargetTypeRequest.php @@ -21,7 +21,7 @@ class DeleteCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -37,21 +37,21 @@ class DeleteCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, then deleting an already deleted or non-existing * `CustomTargetType` will succeed. * * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_missing = false; + protected $allow_missing = false; /** * Optional. If set to true, the request is validated but no actual change is * made. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the @@ -59,7 +59,7 @@ class DeleteCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The name of the `CustomTargetType` to delete. Format must be diff --git a/Deploy/src/V1/DeleteDeliveryPipelineRequest.php b/Deploy/src/V1/DeleteDeliveryPipelineRequest.php index 4dacb328170f..8a5dfba282d3 100644 --- a/Deploy/src/V1/DeleteDeliveryPipelineRequest.php +++ b/Deploy/src/V1/DeleteDeliveryPipelineRequest.php @@ -21,7 +21,7 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -37,21 +37,21 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, then deleting an already deleted or non-existing * `DeliveryPipeline` will succeed. * * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_missing = false; + protected $allow_missing = false; /** * Optional. If set, validate the request and preview the review, but do not * actually post it. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * Optional. If set to true, all child resources under this pipeline will also * be deleted. Otherwise, the request will only work if the pipeline has no @@ -59,7 +59,7 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool force = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $force = false; + protected $force = false; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the @@ -67,7 +67,7 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The name of the `DeliveryPipeline` to delete. Format should be diff --git a/Deploy/src/V1/DeleteTargetRequest.php b/Deploy/src/V1/DeleteTargetRequest.php index 7e2c7858f978..36ef1af47ace 100644 --- a/Deploy/src/V1/DeleteTargetRequest.php +++ b/Deploy/src/V1/DeleteTargetRequest.php @@ -21,7 +21,7 @@ class DeleteTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -37,21 +37,21 @@ class DeleteTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, then deleting an already deleted or non-existing * `Target` will succeed. * * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_missing = false; + protected $allow_missing = false; /** * Optional. If set, validate the request and preview the review, but do not * actually post it. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the @@ -59,7 +59,7 @@ class DeleteTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The name of the `Target` to delete. Format should be diff --git a/Deploy/src/V1/DeliveryPipeline.php b/Deploy/src/V1/DeliveryPipeline.php index 6fdcabce6375..46ae0b0ad9a8 100644 --- a/Deploy/src/V1/DeliveryPipeline.php +++ b/Deploy/src/V1/DeliveryPipeline.php @@ -19,23 +19,25 @@ class DeliveryPipeline extends \Google\Protobuf\Internal\Message { /** * Optional. Name of the `DeliveryPipeline`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`. + * The `deliveryPipeline` component must match + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Output only. Unique identifier of the `DeliveryPipeline`. * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Description of the `DeliveryPipeline`. Max length is 255 characters. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * User annotations. These attributes can only be set and used by the * user, and not by Cloud Deploy. @@ -62,19 +64,19 @@ class DeliveryPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Most recent time at which the pipeline was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Information around the state of the Delivery Pipeline. * * Generated from protobuf field .google.cloud.deploy.v1.PipelineCondition condition = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $condition = null; + protected $condition = null; /** * This checksum is computed by the server based on the value of other * fields, and may be sent on update and delete requests to ensure the @@ -82,14 +84,14 @@ class DeliveryPipeline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 10; */ - private $etag = ''; + protected $etag = ''; /** * When suspended, no new releases or rollouts can be created, * but in-progress ones will complete. * * Generated from protobuf field bool suspended = 12; */ - private $suspended = false; + protected $suspended = false; protected $pipeline; /** @@ -100,7 +102,9 @@ class DeliveryPipeline extends \Google\Protobuf\Internal\Message * * @type string $name * Optional. Name of the `DeliveryPipeline`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`. + * The `deliveryPipeline` component must match + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * @type string $uid * Output only. Unique identifier of the `DeliveryPipeline`. * @type string $description @@ -143,7 +147,9 @@ public function __construct($data = NULL) { /** * Optional. Name of the `DeliveryPipeline`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`. + * The `deliveryPipeline` component must match + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -155,7 +161,9 @@ public function getName() /** * Optional. Name of the `DeliveryPipeline`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`. + * The `deliveryPipeline` component must match + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Deploy/src/V1/DeliveryPipelineNotificationEvent.php b/Deploy/src/V1/DeliveryPipelineNotificationEvent.php index d982f32c9a5f..835a16910e9e 100644 --- a/Deploy/src/V1/DeliveryPipelineNotificationEvent.php +++ b/Deploy/src/V1/DeliveryPipelineNotificationEvent.php @@ -22,25 +22,25 @@ class DeliveryPipelineNotificationEvent extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * Unique identifier of the `DeliveryPipeline`. * * Generated from protobuf field string pipeline_uid = 4; */ - private $pipeline_uid = ''; + protected $pipeline_uid = ''; /** * The name of the `Delivery Pipeline`. * * Generated from protobuf field string delivery_pipeline = 2; */ - private $delivery_pipeline = ''; + protected $delivery_pipeline = ''; /** * Type of this notification, e.g. for a Pub/Sub failure. * * Generated from protobuf field .google.cloud.deploy.v1.Type type = 3; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Deploy/src/V1/DeployArtifact.php b/Deploy/src/V1/DeployArtifact.php index d79a9f4b984c..f7b78f40dd51 100644 --- a/Deploy/src/V1/DeployArtifact.php +++ b/Deploy/src/V1/DeployArtifact.php @@ -21,7 +21,7 @@ class DeployArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string artifact_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $artifact_uri = ''; + protected $artifact_uri = ''; /** * Output only. File paths of the manifests applied during the deploy * operation relative to the URI. diff --git a/Deploy/src/V1/DeployJobRun.php b/Deploy/src/V1/DeployJobRun.php index c309be058cc1..87d81854fcbb 100644 --- a/Deploy/src/V1/DeployJobRun.php +++ b/Deploy/src/V1/DeployJobRun.php @@ -22,32 +22,32 @@ class DeployJobRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $build = ''; + protected $build = ''; /** * Output only. The reason the deploy failed. This will always be unspecified * while the deploy is in progress or if it succeeded. * * Generated from protobuf field .google.cloud.deploy.v1.DeployJobRun.FailureCause failure_cause = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_cause = 0; + protected $failure_cause = 0; /** * Output only. Additional information about the deploy failure, if available. * * Generated from protobuf field string failure_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_message = ''; + protected $failure_message = ''; /** * Output only. Metadata containing information about the deploy job run. * * Generated from protobuf field .google.cloud.deploy.v1.DeployJobRunMetadata metadata = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata = null; + protected $metadata = null; /** * Output only. The artifact of a deploy job run, if available. * * Generated from protobuf field .google.cloud.deploy.v1.DeployArtifact artifact = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $artifact = null; + protected $artifact = null; /** * Constructor. diff --git a/Deploy/src/V1/DeployJobRunMetadata.php b/Deploy/src/V1/DeployJobRunMetadata.php index 05ca7225981c..b1a4c47c9cbd 100644 --- a/Deploy/src/V1/DeployJobRunMetadata.php +++ b/Deploy/src/V1/DeployJobRunMetadata.php @@ -22,19 +22,19 @@ class DeployJobRunMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.CloudRunMetadata cloud_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $cloud_run = null; + protected $cloud_run = null; /** * Output only. Custom Target metadata associated with a `DeployJobRun`. * * Generated from protobuf field .google.cloud.deploy.v1.CustomTargetDeployMetadata custom_target = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $custom_target = null; + protected $custom_target = null; /** * Output only. Custom metadata provided by user-defined deploy operation. * * Generated from protobuf field .google.cloud.deploy.v1.CustomMetadata custom = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $custom = null; + protected $custom = null; /** * Constructor. diff --git a/Deploy/src/V1/DeploymentJobs.php b/Deploy/src/V1/DeploymentJobs.php index 561b42520eed..a4335b13b770 100644 --- a/Deploy/src/V1/DeploymentJobs.php +++ b/Deploy/src/V1/DeploymentJobs.php @@ -20,25 +20,25 @@ class DeploymentJobs extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.Job deploy_job = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $deploy_job = null; + protected $deploy_job = null; /** * Output only. The verify Job. Runs after a deploy if the deploy succeeds. * * Generated from protobuf field .google.cloud.deploy.v1.Job verify_job = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verify_job = null; + protected $verify_job = null; /** * Output only. The predeploy Job, which is the first job on the phase. * * Generated from protobuf field .google.cloud.deploy.v1.Job predeploy_job = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $predeploy_job = null; + protected $predeploy_job = null; /** * Output only. The postdeploy Job, which is the last job on the phase. * * Generated from protobuf field .google.cloud.deploy.v1.Job postdeploy_job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $postdeploy_job = null; + protected $postdeploy_job = null; /** * Constructor. diff --git a/Deploy/src/V1/ExecutionConfig.php b/Deploy/src/V1/ExecutionConfig.php index f6432a4c6396..3596cd3fcfa4 100644 --- a/Deploy/src/V1/ExecutionConfig.php +++ b/Deploy/src/V1/ExecutionConfig.php @@ -29,7 +29,7 @@ class ExecutionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_pool = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $worker_pool = ''; + protected $worker_pool = ''; /** * Optional. Google service account to use for execution. If unspecified, * the project execution service account @@ -37,7 +37,7 @@ class ExecutionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_account = ''; + protected $service_account = ''; /** * Optional. Cloud Storage location in which to store execution outputs. This * can either be a bucket ("gs://my-bucket") or a path within a bucket @@ -46,7 +46,7 @@ class ExecutionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string artifact_storage = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $artifact_storage = ''; + protected $artifact_storage = ''; /** * Optional. Execution timeout for a Cloud Build Execution. This must be * between 10m and 24h in seconds format. If unspecified, a default timeout of @@ -54,7 +54,14 @@ class ExecutionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration execution_timeout = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $execution_timeout = null; + protected $execution_timeout = null; + /** + * Optional. If true, additional logging will be enabled when running builds + * in this execution environment. + * + * Generated from protobuf field bool verbose = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $verbose = false; protected $execution_environment; /** @@ -87,6 +94,9 @@ class ExecutionConfig extends \Google\Protobuf\Internal\Message * Optional. Execution timeout for a Cloud Build Execution. This must be * between 10m and 24h in seconds format. If unspecified, a default timeout of * 1h is used. + * @type bool $verbose + * Optional. If true, additional logging will be enabled when running builds + * in this execution environment. * } */ public function __construct($data = NULL) { @@ -316,6 +326,34 @@ public function setExecutionTimeout($var) return $this; } + /** + * Optional. If true, additional logging will be enabled when running builds + * in this execution environment. + * + * Generated from protobuf field bool verbose = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getVerbose() + { + return $this->verbose; + } + + /** + * Optional. If true, additional logging will be enabled when running builds + * in this execution environment. + * + * Generated from protobuf field bool verbose = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setVerbose($var) + { + GPBUtil::checkBool($var); + $this->verbose = $var; + + return $this; + } + /** * @return string */ diff --git a/Deploy/src/V1/Gapic/CloudDeployGapicClient.php b/Deploy/src/V1/Gapic/CloudDeployGapicClient.php deleted file mode 100644 index f8135096c136..000000000000 --- a/Deploy/src/V1/Gapic/CloudDeployGapicClient.php +++ /dev/null @@ -1,4577 +0,0 @@ -releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - * $response = $cloudDeployClient->abandonRelease($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Deploy\V1\Client\CloudDeployClient}. - */ -class CloudDeployGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.deploy.v1.CloudDeploy'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'clouddeploy.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'clouddeploy.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $automationNameTemplate; - - private static $automationRunNameTemplate; - - private static $buildNameTemplate; - - private static $clusterNameTemplate; - - private static $configNameTemplate; - - private static $customTargetTypeNameTemplate; - - private static $deliveryPipelineNameTemplate; - - private static $jobNameTemplate; - - private static $jobRunNameTemplate; - - private static $locationNameTemplate; - - private static $membershipNameTemplate; - - private static $releaseNameTemplate; - - private static $repositoryNameTemplate; - - private static $rolloutNameTemplate; - - private static $serviceNameTemplate; - - private static $targetNameTemplate; - - private static $workerPoolNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/cloud_deploy_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/cloud_deploy_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/cloud_deploy_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/cloud_deploy_rest_client_config.php', - ], - ], - ]; - } - - private static function getAutomationNameTemplate() - { - if (self::$automationNameTemplate == null) { - self::$automationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}' - ); - } - - return self::$automationNameTemplate; - } - - private static function getAutomationRunNameTemplate() - { - if (self::$automationRunNameTemplate == null) { - self::$automationRunNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}' - ); - } - - return self::$automationRunNameTemplate; - } - - private static function getBuildNameTemplate() - { - if (self::$buildNameTemplate == null) { - self::$buildNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/builds/{build}' - ); - } - - return self::$buildNameTemplate; - } - - private static function getClusterNameTemplate() - { - if (self::$clusterNameTemplate == null) { - self::$clusterNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}' - ); - } - - return self::$clusterNameTemplate; - } - - private static function getConfigNameTemplate() - { - if (self::$configNameTemplate == null) { - self::$configNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/config' - ); - } - - return self::$configNameTemplate; - } - - private static function getCustomTargetTypeNameTemplate() - { - if (self::$customTargetTypeNameTemplate == null) { - self::$customTargetTypeNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}' - ); - } - - return self::$customTargetTypeNameTemplate; - } - - private static function getDeliveryPipelineNameTemplate() - { - if (self::$deliveryPipelineNameTemplate == null) { - self::$deliveryPipelineNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}' - ); - } - - return self::$deliveryPipelineNameTemplate; - } - - private static function getJobNameTemplate() - { - if (self::$jobNameTemplate == null) { - self::$jobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}' - ); - } - - return self::$jobNameTemplate; - } - - private static function getJobRunNameTemplate() - { - if (self::$jobRunNameTemplate == null) { - self::$jobRunNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}' - ); - } - - return self::$jobRunNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getMembershipNameTemplate() - { - if (self::$membershipNameTemplate == null) { - self::$membershipNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/memberships/{membership}' - ); - } - - return self::$membershipNameTemplate; - } - - private static function getReleaseNameTemplate() - { - if (self::$releaseNameTemplate == null) { - self::$releaseNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}' - ); - } - - return self::$releaseNameTemplate; - } - - private static function getRepositoryNameTemplate() - { - if (self::$repositoryNameTemplate == null) { - self::$repositoryNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}' - ); - } - - return self::$repositoryNameTemplate; - } - - private static function getRolloutNameTemplate() - { - if (self::$rolloutNameTemplate == null) { - self::$rolloutNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}' - ); - } - - return self::$rolloutNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ); - } - - return self::$serviceNameTemplate; - } - - private static function getTargetNameTemplate() - { - if (self::$targetNameTemplate == null) { - self::$targetNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/targets/{target}' - ); - } - - return self::$targetNameTemplate; - } - - private static function getWorkerPoolNameTemplate() - { - if (self::$workerPoolNameTemplate == null) { - self::$workerPoolNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ); - } - - return self::$workerPoolNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'automation' => self::getAutomationNameTemplate(), - 'automationRun' => self::getAutomationRunNameTemplate(), - 'build' => self::getBuildNameTemplate(), - 'cluster' => self::getClusterNameTemplate(), - 'config' => self::getConfigNameTemplate(), - 'customTargetType' => self::getCustomTargetTypeNameTemplate(), - 'deliveryPipeline' => self::getDeliveryPipelineNameTemplate(), - 'job' => self::getJobNameTemplate(), - 'jobRun' => self::getJobRunNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'membership' => self::getMembershipNameTemplate(), - 'release' => self::getReleaseNameTemplate(), - 'repository' => self::getRepositoryNameTemplate(), - 'rollout' => self::getRolloutNameTemplate(), - 'service' => self::getServiceNameTemplate(), - 'target' => self::getTargetNameTemplate(), - 'workerPool' => self::getWorkerPoolNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a automation - * resource. - * - * @param string $project - * @param string $location - * @param string $deliveryPipeline - * @param string $automation - * - * @return string The formatted automation resource. - */ - public static function automationName( - $project, - $location, - $deliveryPipeline, - $automation - ) { - return self::getAutomationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'delivery_pipeline' => $deliveryPipeline, - 'automation' => $automation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * automation_run resource. - * - * @param string $project - * @param string $location - * @param string $deliveryPipeline - * @param string $automationRun - * - * @return string The formatted automation_run resource. - */ - public static function automationRunName( - $project, - $location, - $deliveryPipeline, - $automationRun - ) { - return self::getAutomationRunNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'delivery_pipeline' => $deliveryPipeline, - 'automation_run' => $automationRun, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a build - * resource. - * - * @param string $project - * @param string $location - * @param string $build - * - * @return string The formatted build resource. - */ - public static function buildName($project, $location, $build) - { - return self::getBuildNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'build' => $build, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cluster - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * - * @return string The formatted cluster resource. - */ - public static function clusterName($project, $location, $cluster) - { - return self::getClusterNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a config - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted config resource. - */ - public static function configName($project, $location) - { - return self::getConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * custom_target_type resource. - * - * @param string $project - * @param string $location - * @param string $customTargetType - * - * @return string The formatted custom_target_type resource. - */ - public static function customTargetTypeName( - $project, - $location, - $customTargetType - ) { - return self::getCustomTargetTypeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'custom_target_type' => $customTargetType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * delivery_pipeline resource. - * - * @param string $project - * @param string $location - * @param string $deliveryPipeline - * - * @return string The formatted delivery_pipeline resource. - */ - public static function deliveryPipelineName( - $project, - $location, - $deliveryPipeline - ) { - return self::getDeliveryPipelineNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'delivery_pipeline' => $deliveryPipeline, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a job - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * - * @return string The formatted job resource. - */ - public static function jobName($project, $location, $job) - { - return self::getJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a job_run - * resource. - * - * @param string $project - * @param string $location - * @param string $deliveryPipeline - * @param string $release - * @param string $rollout - * @param string $jobRun - * - * @return string The formatted job_run resource. - */ - public static function jobRunName( - $project, - $location, - $deliveryPipeline, - $release, - $rollout, - $jobRun - ) { - return self::getJobRunNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'delivery_pipeline' => $deliveryPipeline, - 'release' => $release, - 'rollout' => $rollout, - 'job_run' => $jobRun, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a membership - * resource. - * - * @param string $project - * @param string $location - * @param string $membership - * - * @return string The formatted membership resource. - */ - public static function membershipName($project, $location, $membership) - { - return self::getMembershipNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'membership' => $membership, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a release - * resource. - * - * @param string $project - * @param string $location - * @param string $deliveryPipeline - * @param string $release - * - * @return string The formatted release resource. - */ - public static function releaseName( - $project, - $location, - $deliveryPipeline, - $release - ) { - return self::getReleaseNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'delivery_pipeline' => $deliveryPipeline, - 'release' => $release, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a repository - * resource. - * - * @param string $project - * @param string $location - * @param string $connection - * @param string $repository - * - * @return string The formatted repository resource. - */ - public static function repositoryName( - $project, - $location, - $connection, - $repository - ) { - return self::getRepositoryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'connection' => $connection, - 'repository' => $repository, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a rollout - * resource. - * - * @param string $project - * @param string $location - * @param string $deliveryPipeline - * @param string $release - * @param string $rollout - * - * @return string The formatted rollout resource. - */ - public static function rolloutName( - $project, - $location, - $deliveryPipeline, - $release, - $rollout - ) { - return self::getRolloutNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'delivery_pipeline' => $deliveryPipeline, - 'release' => $release, - 'rollout' => $rollout, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName($project, $location, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a target - * resource. - * - * @param string $project - * @param string $location - * @param string $target - * - * @return string The formatted target resource. - */ - public static function targetName($project, $location, $target) - { - return self::getTargetNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'target' => $target, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a worker_pool - * resource. - * - * @param string $project - * @param string $location - * @param string $workerPool - * - * @return string The formatted worker_pool resource. - */ - public static function workerPoolName($project, $location, $workerPool) - { - return self::getWorkerPoolNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'worker_pool' => $workerPool, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - automation: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation} - * - automationRun: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run} - * - build: projects/{project}/locations/{location}/builds/{build} - * - cluster: projects/{project}/locations/{location}/clusters/{cluster} - * - config: projects/{project}/locations/{location}/config - * - customTargetType: projects/{project}/locations/{location}/customTargetTypes/{custom_target_type} - * - deliveryPipeline: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline} - * - job: projects/{project}/locations/{location}/jobs/{job} - * - jobRun: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run} - * - location: projects/{project}/locations/{location} - * - membership: projects/{project}/locations/{location}/memberships/{membership} - * - release: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release} - * - repository: projects/{project}/locations/{location}/connections/{connection}/repositories/{repository} - * - rollout: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout} - * - service: projects/{project}/locations/{location}/services/{service} - * - target: projects/{project}/locations/{location}/targets/{target} - * - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'clouddeploy.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Abandons a Release in the Delivery Pipeline. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - * $response = $cloudDeployClient->abandonRelease($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the Release. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\AbandonReleaseResponse - * - * @throws ApiException if the remote call fails - */ - public function abandonRelease($name, array $optionalArgs = []) - { - $request = new AbandonReleaseRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'AbandonRelease', - AbandonReleaseResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Advances a Rollout in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - * $phaseId = 'phase_id'; - * $response = $cloudDeployClient->advanceRollout($formattedName, $phaseId); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the Rollout. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. - * @param string $phaseId Required. The phase ID to advance the `Rollout` to. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\AdvanceRolloutResponse - * - * @throws ApiException if the remote call fails - */ - public function advanceRollout($name, $phaseId, array $optionalArgs = []) - { - $request = new AdvanceRolloutRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setPhaseId($phaseId); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'AdvanceRollout', - AdvanceRolloutResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Approves a Rollout. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - * $approved = false; - * $response = $cloudDeployClient->approveRollout($formattedName, $approved); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the Rollout. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. - * @param bool $approved Required. True = approve; false = reject - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\ApproveRolloutResponse - * - * @throws ApiException if the remote call fails - */ - public function approveRollout($name, $approved, array $optionalArgs = []) - { - $request = new ApproveRolloutRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setApproved($approved); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ApproveRollout', - ApproveRolloutResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Cancels an AutomationRun. The `state` of the `AutomationRun` after - * cancelling is `CANCELLED`. `CancelAutomationRun` can be called on - * AutomationRun in the state `IN_PROGRESS` and `PENDING`; AutomationRun - * in a different state returns an `FAILED_PRECONDITION` error. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - * $response = $cloudDeployClient->cancelAutomationRun($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `AutomationRun`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\CancelAutomationRunResponse - * - * @throws ApiException if the remote call fails - */ - public function cancelAutomationRun($name, array $optionalArgs = []) - { - $request = new CancelAutomationRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelAutomationRun', - CancelAutomationRunResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Cancels a Rollout in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - * $response = $cloudDeployClient->cancelRollout($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the Rollout. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\CancelRolloutResponse - * - * @throws ApiException if the remote call fails - */ - public function cancelRollout($name, array $optionalArgs = []) - { - $request = new CancelRolloutRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelRollout', - CancelRolloutResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a new Automation in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - * $automationId = 'automation_id'; - * $automation = new Automation(); - * $operationResponse = $cloudDeployClient->createAutomation($formattedParent, $automationId, $automation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->createAutomation($formattedParent, $automationId, $automation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createAutomation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection in which the `Automation` should be - * created. Format should be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. - * @param string $automationId Required. ID of the `Automation`. - * @param Automation $automation Required. The `Automation` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createAutomation( - $parent, - $automationId, - $automation, - array $optionalArgs = [] - ) { - $request = new CreateAutomationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAutomationId($automationId); - $request->setAutomation($automation); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateAutomation', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new CustomTargetType in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); - * $customTargetTypeId = 'custom_target_type_id'; - * $customTargetType = new CustomTargetType(); - * $operationResponse = $cloudDeployClient->createCustomTargetType($formattedParent, $customTargetTypeId, $customTargetType); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->createCustomTargetType($formattedParent, $customTargetTypeId, $customTargetType); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createCustomTargetType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection in which the `CustomTargetType` should be - * created. Format should be - * `projects/{project_id}/locations/{location_name}`. - * @param string $customTargetTypeId Required. ID of the `CustomTargetType`. - * @param CustomTargetType $customTargetType Required. The `CustomTargetType` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createCustomTargetType( - $parent, - $customTargetTypeId, - $customTargetType, - array $optionalArgs = [] - ) { - $request = new CreateCustomTargetTypeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCustomTargetTypeId($customTargetTypeId); - $request->setCustomTargetType($customTargetType); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateCustomTargetType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new DeliveryPipeline in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); - * $deliveryPipelineId = 'delivery_pipeline_id'; - * $deliveryPipeline = new DeliveryPipeline(); - * $operationResponse = $cloudDeployClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createDeliveryPipeline'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection in which the `DeliveryPipeline` should be - * created. Format should be - * `projects/{project_id}/locations/{location_name}`. - * @param string $deliveryPipelineId Required. ID of the `DeliveryPipeline`. - * @param DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDeliveryPipeline( - $parent, - $deliveryPipelineId, - $deliveryPipeline, - array $optionalArgs = [] - ) { - $request = new CreateDeliveryPipelineRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDeliveryPipelineId($deliveryPipelineId); - $request->setDeliveryPipeline($deliveryPipeline); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateDeliveryPipeline', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new Release in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - * $releaseId = 'release_id'; - * $release = new Release(); - * $operationResponse = $cloudDeployClient->createRelease($formattedParent, $releaseId, $release); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->createRelease($formattedParent, $releaseId, $release); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createRelease'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection in which the `Release` should be created. - * Format should be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. - * @param string $releaseId Required. ID of the `Release`. - * @param Release $release Required. The `Release` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createRelease( - $parent, - $releaseId, - $release, - array $optionalArgs = [] - ) { - $request = new CreateReleaseRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setReleaseId($releaseId); - $request->setRelease($release); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateRelease', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new Rollout in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - * $rolloutId = 'rollout_id'; - * $rollout = new Rollout(); - * $operationResponse = $cloudDeployClient->createRollout($formattedParent, $rolloutId, $rollout); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->createRollout($formattedParent, $rolloutId, $rollout); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createRollout'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection in which the `Rollout` should be created. - * Format should be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. - * @param string $rolloutId Required. ID of the `Rollout`. - * @param Rollout $rollout Required. The `Rollout` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type string $startingPhaseId - * Optional. The starting phase ID for the `Rollout`. If empty the `Rollout` - * will start at the first phase. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createRollout( - $parent, - $rolloutId, - $rollout, - array $optionalArgs = [] - ) { - $request = new CreateRolloutRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRolloutId($rolloutId); - $request->setRollout($rollout); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['startingPhaseId'])) { - $request->setStartingPhaseId($optionalArgs['startingPhaseId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateRollout', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new Target in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); - * $targetId = 'target_id'; - * $target = new Target(); - * $operationResponse = $cloudDeployClient->createTarget($formattedParent, $targetId, $target); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->createTarget($formattedParent, $targetId, $target); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createTarget'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection in which the `Target` should be created. - * Format should be - * `projects/{project_id}/locations/{location_name}`. - * @param string $targetId Required. ID of the `Target`. - * @param Target $target Required. The `Target` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTarget( - $parent, - $targetId, - $target, - array $optionalArgs = [] - ) { - $request = new CreateTargetRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTargetId($targetId); - $request->setTarget($target); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateTarget', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Automation resource. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - * $operationResponse = $cloudDeployClient->deleteAutomation($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->deleteAutomation($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteAutomation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the `Automation` to delete. Format should be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $allowMissing - * Optional. If set to true, then deleting an already deleted or non-existing - * `Automation` will succeed. - * @type bool $validateOnly - * Optional. If set, validate the request and verify whether the resource - * exists, but do not actually post it. - * @type string $etag - * Optional. The weak etag of the request. - * This checksum is computed by the server based on the value of other - * fields, and may be sent on update and delete requests to ensure the - * client has an up-to-date value before proceeding. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteAutomation($name, array $optionalArgs = []) - { - $request = new DeleteAutomationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteAutomation', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single CustomTargetType. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - * $operationResponse = $cloudDeployClient->deleteCustomTargetType($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->deleteCustomTargetType($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteCustomTargetType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the `CustomTargetType` to delete. Format must be - * `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $allowMissing - * Optional. If set to true, then deleting an already deleted or non-existing - * `CustomTargetType` will succeed. - * @type bool $validateOnly - * Optional. If set to true, the request is validated but no actual change is - * made. - * @type string $etag - * Optional. This checksum is computed by the server based on the value of - * other fields, and may be sent on update and delete requests to ensure the - * client has an up-to-date value before proceeding. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteCustomTargetType($name, array $optionalArgs = []) - { - $request = new DeleteCustomTargetTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteCustomTargetType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single DeliveryPipeline. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteDeliveryPipeline'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the `DeliveryPipeline` to delete. Format should be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $allowMissing - * Optional. If set to true, then deleting an already deleted or non-existing - * `DeliveryPipeline` will succeed. - * @type bool $validateOnly - * Optional. If set, validate the request and preview the review, but do not - * actually post it. - * @type bool $force - * Optional. If set to true, all child resources under this pipeline will also - * be deleted. Otherwise, the request will only work if the pipeline has no - * child resources. - * @type string $etag - * Optional. This checksum is computed by the server based on the value of - * other fields, and may be sent on update and delete requests to ensure the - * client has an up-to-date value before proceeding. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDeliveryPipeline($name, array $optionalArgs = []) - { - $request = new DeleteDeliveryPipelineRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDeliveryPipeline', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Target. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - * $operationResponse = $cloudDeployClient->deleteTarget($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->deleteTarget($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteTarget'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the `Target` to delete. Format should be - * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $allowMissing - * Optional. If set to true, then deleting an already deleted or non-existing - * `Target` will succeed. - * @type bool $validateOnly - * Optional. If set, validate the request and preview the review, but do not - * actually post it. - * @type string $etag - * Optional. This checksum is computed by the server based on the value of - * other fields, and may be sent on update and delete requests to ensure the - * client has an up-to-date value before proceeding. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTarget($name, array $optionalArgs = []) - { - $request = new DeleteTargetRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteTarget', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets details of a single Automation. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - * $response = $cloudDeployClient->getAutomation($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `Automation`. Format must be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\Automation - * - * @throws ApiException if the remote call fails - */ - public function getAutomation($name, array $optionalArgs = []) - { - $request = new GetAutomationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetAutomation', - Automation::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single AutomationRun. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - * $response = $cloudDeployClient->getAutomationRun($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `AutomationRun`. Format must be - * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\AutomationRun - * - * @throws ApiException if the remote call fails - */ - public function getAutomationRun($name, array $optionalArgs = []) - { - $request = new GetAutomationRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetAutomationRun', - AutomationRun::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets the configuration for a location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->configName('[PROJECT]', '[LOCATION]'); - * $response = $cloudDeployClient->getConfig($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of requested configuration. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\Config - * - * @throws ApiException if the remote call fails - */ - public function getConfig($name, array $optionalArgs = []) - { - $request = new GetConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetConfig', - Config::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single CustomTargetType. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - * $response = $cloudDeployClient->getCustomTargetType($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `CustomTargetType`. Format must be - * `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\CustomTargetType - * - * @throws ApiException if the remote call fails - */ - public function getCustomTargetType($name, array $optionalArgs = []) - { - $request = new GetCustomTargetTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetCustomTargetType', - CustomTargetType::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single DeliveryPipeline. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - * $response = $cloudDeployClient->getDeliveryPipeline($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `DeliveryPipeline`. Format must be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\DeliveryPipeline - * - * @throws ApiException if the remote call fails - */ - public function getDeliveryPipeline($name, array $optionalArgs = []) - { - $request = new GetDeliveryPipelineRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDeliveryPipeline', - DeliveryPipeline::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single JobRun. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - * $response = $cloudDeployClient->getJobRun($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `JobRun`. Format must be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\JobRun - * - * @throws ApiException if the remote call fails - */ - public function getJobRun($name, array $optionalArgs = []) - { - $request = new GetJobRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetJobRun', - JobRun::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single Release. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - * $response = $cloudDeployClient->getRelease($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `Release`. Format must be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\Release - * - * @throws ApiException if the remote call fails - */ - public function getRelease($name, array $optionalArgs = []) - { - $request = new GetReleaseRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetRelease', - Release::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single Rollout. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - * $response = $cloudDeployClient->getRollout($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `Rollout`. Format must be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\Rollout - * - * @throws ApiException if the remote call fails - */ - public function getRollout($name, array $optionalArgs = []) - { - $request = new GetRolloutRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetRollout', - Rollout::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single Target. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - * $response = $cloudDeployClient->getTarget($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `Target`. Format must be - * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\Target - * - * @throws ApiException if the remote call fails - */ - public function getTarget($name, array $optionalArgs = []) - { - $request = new GetTargetRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTarget', - Target::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Ignores the specified Job in a Rollout. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedRollout = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - * $phaseId = 'phase_id'; - * $jobId = 'job_id'; - * $response = $cloudDeployClient->ignoreJob($formattedRollout, $phaseId, $jobId); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $rollout Required. Name of the Rollout. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. - * @param string $phaseId Required. The phase ID the Job to ignore belongs to. - * @param string $jobId Required. The job ID for the Job to ignore. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\IgnoreJobResponse - * - * @throws ApiException if the remote call fails - */ - public function ignoreJob( - $rollout, - $phaseId, - $jobId, - array $optionalArgs = [] - ) { - $request = new IgnoreJobRequest(); - $requestParamHeaders = []; - $request->setRollout($rollout); - $request->setPhaseId($phaseId); - $request->setJobId($jobId); - $requestParamHeaders['rollout'] = $rollout; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'IgnoreJob', - IgnoreJobResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists AutomationRuns in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudDeployClient->listAutomationRuns($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudDeployClient->listAutomationRuns($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent `Delivery Pipeline`, which owns this collection of - * automationRuns. Format must be - * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Filter automationRuns to be returned. All fields can be used in the - * filter. - * @type string $orderBy - * Field to sort by. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAutomationRuns($parent, array $optionalArgs = []) - { - $request = new ListAutomationRunsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListAutomationRuns', - $optionalArgs, - ListAutomationRunsResponse::class, - $request - ); - } - - /** - * Lists Automations in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudDeployClient->listAutomations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudDeployClient->listAutomations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent `Delivery Pipeline`, which owns this collection of - * automations. Format must be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Filter automations to be returned. All fields can be used in the - * filter. - * @type string $orderBy - * Field to sort by. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAutomations($parent, array $optionalArgs = []) - { - $request = new ListAutomationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListAutomations', - $optionalArgs, - ListAutomationsResponse::class, - $request - ); - } - - /** - * Lists CustomTargetTypes in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudDeployClient->listCustomTargetTypes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudDeployClient->listCustomTargetTypes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent that owns this collection of custom target types. - * Format must be `projects/{project_id}/locations/{location_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter custom target types to be returned. See - * https://google.aip.dev/160 for more details. - * @type string $orderBy - * Optional. Field to sort by. See https://google.aip.dev/132#ordering for - * more details. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listCustomTargetTypes($parent, array $optionalArgs = []) - { - $request = new ListCustomTargetTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListCustomTargetTypes', - $optionalArgs, - ListCustomTargetTypesResponse::class, - $request - ); - } - - /** - * Lists DeliveryPipelines in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudDeployClient->listDeliveryPipelines($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudDeployClient->listDeliveryPipelines($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of pipelines. Format must - * be `projects/{project_id}/locations/{location_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Filter pipelines to be returned. See https://google.aip.dev/160 for more - * details. - * @type string $orderBy - * Field to sort by. See https://google.aip.dev/132#ordering for more details. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDeliveryPipelines($parent, array $optionalArgs = []) - { - $request = new ListDeliveryPipelinesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDeliveryPipelines', - $optionalArgs, - ListDeliveryPipelinesResponse::class, - $request - ); - } - - /** - * Lists JobRuns in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudDeployClient->listJobRuns($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudDeployClient->listJobRuns($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The `Rollout` which owns this collection of `JobRun` objects. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter results to be returned. See https://google.aip.dev/160 for - * more details. - * @type string $orderBy - * Optional. Field to sort by. See https://google.aip.dev/132#ordering for - * more details. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listJobRuns($parent, array $optionalArgs = []) - { - $request = new ListJobRunsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListJobRuns', - $optionalArgs, - ListJobRunsResponse::class, - $request - ); - } - - /** - * Lists Releases in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudDeployClient->listReleases($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudDeployClient->listReleases($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The `DeliveryPipeline` which owns this collection of `Release` - * objects. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter releases to be returned. See https://google.aip.dev/160 - * for more details. - * @type string $orderBy - * Optional. Field to sort by. See https://google.aip.dev/132#ordering for - * more details. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listReleases($parent, array $optionalArgs = []) - { - $request = new ListReleasesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListReleases', - $optionalArgs, - ListReleasesResponse::class, - $request - ); - } - - /** - * Lists Rollouts in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudDeployClient->listRollouts($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudDeployClient->listRollouts($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The `Release` which owns this collection of `Rollout` objects. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 - * for more details. - * @type string $orderBy - * Optional. Field to sort by. See https://google.aip.dev/132#ordering for - * more details. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listRollouts($parent, array $optionalArgs = []) - { - $request = new ListRolloutsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListRollouts', - $optionalArgs, - ListRolloutsResponse::class, - $request - ); - } - - /** - * Lists Targets in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudDeployClient->listTargets($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudDeployClient->listTargets($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of targets. Format must be - * `projects/{project_id}/locations/{location_name}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter targets to be returned. See https://google.aip.dev/160 for - * more details. - * @type string $orderBy - * Optional. Field to sort by. See https://google.aip.dev/132#ordering for - * more details. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTargets($parent, array $optionalArgs = []) - { - $request = new ListTargetsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTargets', - $optionalArgs, - ListTargetsResponse::class, - $request - ); - } - - /** - * Retries the specified Job in a Rollout. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedRollout = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - * $phaseId = 'phase_id'; - * $jobId = 'job_id'; - * $response = $cloudDeployClient->retryJob($formattedRollout, $phaseId, $jobId); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $rollout Required. Name of the Rollout. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. - * @param string $phaseId Required. The phase ID the Job to retry belongs to. - * @param string $jobId Required. The job ID for the Job to retry. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\RetryJobResponse - * - * @throws ApiException if the remote call fails - */ - public function retryJob( - $rollout, - $phaseId, - $jobId, - array $optionalArgs = [] - ) { - $request = new RetryJobRequest(); - $requestParamHeaders = []; - $request->setRollout($rollout); - $request->setPhaseId($phaseId); - $request->setJobId($jobId); - $requestParamHeaders['rollout'] = $rollout; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'RetryJob', - RetryJobResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a `Rollout` to roll back the specified target. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - * $targetId = 'target_id'; - * $rolloutId = 'rollout_id'; - * $response = $cloudDeployClient->rollbackTarget($formattedName, $targetId, $rolloutId); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. The `DeliveryPipeline` for which the rollback `Rollout` should be - * created. Format should be - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. - * @param string $targetId Required. ID of the `Target` that is being rolled back. - * @param string $rolloutId Required. ID of the rollback `Rollout` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $releaseId - * Optional. ID of the `Release` to roll back to. If this isn't specified, the - * previous successful `Rollout` to the specified target will be used to - * determine the `Release`. - * @type string $rolloutToRollBack - * Optional. If provided, this must be the latest `Rollout` that is on the - * `Target`. - * @type RollbackTargetConfig $rollbackConfig - * Optional. Configs for the rollback `Rollout`. - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with a `RollbackTargetResponse`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\RollbackTargetResponse - * - * @throws ApiException if the remote call fails - */ - public function rollbackTarget( - $name, - $targetId, - $rolloutId, - array $optionalArgs = [] - ) { - $request = new RollbackTargetRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setTargetId($targetId); - $request->setRolloutId($rolloutId); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['releaseId'])) { - $request->setReleaseId($optionalArgs['releaseId']); - } - - if (isset($optionalArgs['rolloutToRollBack'])) { - $request->setRolloutToRollBack($optionalArgs['rolloutToRollBack']); - } - - if (isset($optionalArgs['rollbackConfig'])) { - $request->setRollbackConfig($optionalArgs['rollbackConfig']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'RollbackTarget', - RollbackTargetResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Terminates a Job Run in a given project and location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $formattedName = $cloudDeployClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - * $response = $cloudDeployClient->terminateJobRun($formattedName); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the `JobRun`. Format must be - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Deploy\V1\TerminateJobRunResponse - * - * @throws ApiException if the remote call fails - */ - public function terminateJobRun($name, array $optionalArgs = []) - { - $request = new TerminateJobRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TerminateJobRun', - TerminateJobRunResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates the parameters of a single Automation resource. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $updateMask = new FieldMask(); - * $automation = new Automation(); - * $operationResponse = $cloudDeployClient->updateAutomation($updateMask, $automation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->updateAutomation($updateMask, $automation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateAutomation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the - * `Automation` resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it's in the mask. If the - * user doesn't provide a mask then all fields are overwritten. - * @param Automation $automation Required. The `Automation` to update. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $allowMissing - * Optional. If set to true, updating a `Automation` that does not exist will - * result in the creation of a new `Automation`. - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateAutomation( - $updateMask, - $automation, - array $optionalArgs = [] - ) { - $request = new UpdateAutomationRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setAutomation($automation); - $requestParamHeaders['automation.name'] = $automation->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateAutomation', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates a single CustomTargetType. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $updateMask = new FieldMask(); - * $customTargetType = new CustomTargetType(); - * $operationResponse = $cloudDeployClient->updateCustomTargetType($updateMask, $customTargetType); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->updateCustomTargetType($updateMask, $customTargetType); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateCustomTargetType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the - * `CustomTargetType` resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it's in the mask. If the - * user doesn't provide a mask then all fields are overwritten. - * @param CustomTargetType $customTargetType Required. The `CustomTargetType` to update. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $allowMissing - * Optional. If set to true, updating a `CustomTargetType` that does not exist - * will result in the creation of a new `CustomTargetType`. - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateCustomTargetType( - $updateMask, - $customTargetType, - array $optionalArgs = [] - ) { - $request = new UpdateCustomTargetTypeRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setCustomTargetType($customTargetType); - $requestParamHeaders[ - 'custom_target_type.name' - ] = $customTargetType->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateCustomTargetType', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates the parameters of a single DeliveryPipeline. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $updateMask = new FieldMask(); - * $deliveryPipeline = new DeliveryPipeline(); - * $operationResponse = $cloudDeployClient->updateDeliveryPipeline($updateMask, $deliveryPipeline); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->updateDeliveryPipeline($updateMask, $deliveryPipeline); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateDeliveryPipeline'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the - * `DeliveryPipeline` resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it's in the mask. If the - * user doesn't provide a mask then all fields are overwritten. - * @param DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to update. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $allowMissing - * Optional. If set to true, updating a `DeliveryPipeline` that does not exist - * will result in the creation of a new `DeliveryPipeline`. - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateDeliveryPipeline( - $updateMask, - $deliveryPipeline, - array $optionalArgs = [] - ) { - $request = new UpdateDeliveryPipelineRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setDeliveryPipeline($deliveryPipeline); - $requestParamHeaders[ - 'delivery_pipeline.name' - ] = $deliveryPipeline->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateDeliveryPipeline', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates the parameters of a single Target. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $updateMask = new FieldMask(); - * $target = new Target(); - * $operationResponse = $cloudDeployClient->updateTarget($updateMask, $target); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->updateTarget($updateMask, $target); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateTarget'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the - * Target resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it's in the mask. If the - * user doesn't provide a mask then all fields are overwritten. - * @param Target $target Required. The `Target` to update. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server knows to ignore the - * request if it has already been completed. The server guarantees that for - * at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type bool $allowMissing - * Optional. If set to true, updating a `Target` that does not exist will - * result in the creation of a new `Target`. - * @type bool $validateOnly - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateTarget($updateMask, $target, array $optionalArgs = []) - { - $request = new UpdateTargetRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setTarget($target); - $requestParamHeaders['target.name'] = $target->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateTarget', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $response = $cloudDeployClient->getLocation(); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $cloudDeployClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudDeployClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $resource = 'resource'; - * $response = $cloudDeployClient->getIamPolicy($resource); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $cloudDeployClient->setIamPolicy($resource, $policy); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $cloudDeployClient = new CloudDeployClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $cloudDeployClient->testIamPermissions($resource, $permissions); - * } finally { - * $cloudDeployClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/Deploy/src/V1/GetAutomationRequest.php b/Deploy/src/V1/GetAutomationRequest.php index fdea3420dc9e..f124bb5f99e0 100644 --- a/Deploy/src/V1/GetAutomationRequest.php +++ b/Deploy/src/V1/GetAutomationRequest.php @@ -21,7 +21,7 @@ class GetAutomationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `Automation`. Format must be diff --git a/Deploy/src/V1/GetAutomationRunRequest.php b/Deploy/src/V1/GetAutomationRunRequest.php index d249b14ceb1a..015abd5ea426 100644 --- a/Deploy/src/V1/GetAutomationRunRequest.php +++ b/Deploy/src/V1/GetAutomationRunRequest.php @@ -21,7 +21,7 @@ class GetAutomationRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `AutomationRun`. Format must be diff --git a/Deploy/src/V1/GetConfigRequest.php b/Deploy/src/V1/GetConfigRequest.php index ea1950297147..affb901f5728 100644 --- a/Deploy/src/V1/GetConfigRequest.php +++ b/Deploy/src/V1/GetConfigRequest.php @@ -20,7 +20,7 @@ class GetConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of requested configuration. Please see diff --git a/Deploy/src/V1/GetCustomTargetTypeRequest.php b/Deploy/src/V1/GetCustomTargetTypeRequest.php index ac2e47d24ba2..6ebe118b5a26 100644 --- a/Deploy/src/V1/GetCustomTargetTypeRequest.php +++ b/Deploy/src/V1/GetCustomTargetTypeRequest.php @@ -21,7 +21,7 @@ class GetCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `CustomTargetType`. Format must be diff --git a/Deploy/src/V1/GetDeliveryPipelineRequest.php b/Deploy/src/V1/GetDeliveryPipelineRequest.php index 3e22baeb615b..739f790fa5f3 100644 --- a/Deploy/src/V1/GetDeliveryPipelineRequest.php +++ b/Deploy/src/V1/GetDeliveryPipelineRequest.php @@ -21,7 +21,7 @@ class GetDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `DeliveryPipeline`. Format must be diff --git a/Deploy/src/V1/GetJobRunRequest.php b/Deploy/src/V1/GetJobRunRequest.php index 1f4e58266c18..8e935669dd16 100644 --- a/Deploy/src/V1/GetJobRunRequest.php +++ b/Deploy/src/V1/GetJobRunRequest.php @@ -21,7 +21,7 @@ class GetJobRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `JobRun`. Format must be diff --git a/Deploy/src/V1/GetReleaseRequest.php b/Deploy/src/V1/GetReleaseRequest.php index ebb3240557cc..ee0d72b371ac 100644 --- a/Deploy/src/V1/GetReleaseRequest.php +++ b/Deploy/src/V1/GetReleaseRequest.php @@ -21,7 +21,7 @@ class GetReleaseRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `Release`. Format must be diff --git a/Deploy/src/V1/GetRolloutRequest.php b/Deploy/src/V1/GetRolloutRequest.php index 536e7371abe8..9ff5d3af52af 100644 --- a/Deploy/src/V1/GetRolloutRequest.php +++ b/Deploy/src/V1/GetRolloutRequest.php @@ -21,7 +21,7 @@ class GetRolloutRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `Rollout`. Format must be diff --git a/Deploy/src/V1/GetTargetRequest.php b/Deploy/src/V1/GetTargetRequest.php index ec237d10e015..e88f8c170dd1 100644 --- a/Deploy/src/V1/GetTargetRequest.php +++ b/Deploy/src/V1/GetTargetRequest.php @@ -21,7 +21,7 @@ class GetTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `Target`. Format must be diff --git a/Deploy/src/V1/GkeCluster.php b/Deploy/src/V1/GkeCluster.php index f740425b9e3b..0f11f604a390 100644 --- a/Deploy/src/V1/GkeCluster.php +++ b/Deploy/src/V1/GkeCluster.php @@ -16,12 +16,12 @@ class GkeCluster extends \Google\Protobuf\Internal\Message { /** - * Information specifying a GKE Cluster. Format is + * Optional. Information specifying a GKE Cluster. Format is * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`. * - * Generated from protobuf field string cluster = 1 [(.google.api.resource_reference) = { + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $cluster = ''; + protected $cluster = ''; /** * Optional. If true, `cluster` is accessed using the private IP address of * the control plane endpoint. Otherwise, the default IP address of the @@ -33,7 +33,7 @@ class GkeCluster extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool internal_ip = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $internal_ip = false; + protected $internal_ip = false; /** * Constructor. @@ -42,7 +42,7 @@ class GkeCluster extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $cluster - * Information specifying a GKE Cluster. Format is + * Optional. Information specifying a GKE Cluster. Format is * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`. * @type bool $internal_ip * Optional. If true, `cluster` is accessed using the private IP address of @@ -60,10 +60,10 @@ public function __construct($data = NULL) { } /** - * Information specifying a GKE Cluster. Format is + * Optional. Information specifying a GKE Cluster. Format is * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`. * - * Generated from protobuf field string cluster = 1 [(.google.api.resource_reference) = { + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @return string */ public function getCluster() @@ -72,10 +72,10 @@ public function getCluster() } /** - * Information specifying a GKE Cluster. Format is + * Optional. Information specifying a GKE Cluster. Format is * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`. * - * Generated from protobuf field string cluster = 1 [(.google.api.resource_reference) = { + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/Deploy/src/V1/IgnoreJobRequest.php b/Deploy/src/V1/IgnoreJobRequest.php index 0a4ea21c773f..094701d85774 100644 --- a/Deploy/src/V1/IgnoreJobRequest.php +++ b/Deploy/src/V1/IgnoreJobRequest.php @@ -21,19 +21,19 @@ class IgnoreJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $rollout = ''; + protected $rollout = ''; /** * Required. The phase ID the Job to ignore belongs to. * * Generated from protobuf field string phase_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $phase_id = ''; + protected $phase_id = ''; /** * Required. The job ID for the Job to ignore. * * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $job_id = ''; + protected $job_id = ''; /** * @param string $rollout Required. Name of the Rollout. Format is diff --git a/Deploy/src/V1/Job.php b/Deploy/src/V1/Job.php index 73f7c9ba2357..894b8658f331 100644 --- a/Deploy/src/V1/Job.php +++ b/Deploy/src/V1/Job.php @@ -20,27 +20,27 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $id = ''; + protected $id = ''; /** * Output only. The current state of the Job. * * Generated from protobuf field .google.cloud.deploy.v1.Job.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information on why the Job was skipped, if * available. * * Generated from protobuf field string skip_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $skip_message = ''; + protected $skip_message = ''; /** * Output only. The name of the `JobRun` responsible for the most recent * invocation of this Job. * * Generated from protobuf field string job_run = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $job_run = ''; + protected $job_run = ''; protected $job_type; /** diff --git a/Deploy/src/V1/JobRun.php b/Deploy/src/V1/JobRun.php index 81075e3d4705..2a9a5fa9bc5e 100644 --- a/Deploy/src/V1/JobRun.php +++ b/Deploy/src/V1/JobRun.php @@ -22,49 +22,49 @@ class JobRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Output only. Unique identifier of the `JobRun`. * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. ID of the `Rollout` phase this `JobRun` belongs in. * * Generated from protobuf field string phase_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $phase_id = ''; + protected $phase_id = ''; /** * Output only. ID of the `Rollout` job this `JobRun` corresponds to. * * Generated from protobuf field string job_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $job_id = ''; + protected $job_id = ''; /** * Output only. Time at which the `JobRun` was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time at which the `JobRun` was started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. Time at which the `JobRun` ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The current state of the `JobRun`. * * Generated from protobuf field .google.cloud.deploy.v1.JobRun.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the @@ -72,7 +72,7 @@ class JobRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $etag = ''; + protected $etag = ''; protected $job_run; /** diff --git a/Deploy/src/V1/JobRunNotificationEvent.php b/Deploy/src/V1/JobRunNotificationEvent.php index d83c49258583..74416dde71d6 100644 --- a/Deploy/src/V1/JobRunNotificationEvent.php +++ b/Deploy/src/V1/JobRunNotificationEvent.php @@ -22,55 +22,55 @@ class JobRunNotificationEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * The name of the `JobRun`. * * Generated from protobuf field string job_run = 2; */ - private $job_run = ''; + protected $job_run = ''; /** * Unique identifier of the `DeliveryPipeline`. * * Generated from protobuf field string pipeline_uid = 3; */ - private $pipeline_uid = ''; + protected $pipeline_uid = ''; /** * Unique identifier of the `Release`. * * Generated from protobuf field string release_uid = 4; */ - private $release_uid = ''; + protected $release_uid = ''; /** * The name of the `Release`. * * Generated from protobuf field string release = 8; */ - private $release = ''; + protected $release = ''; /** * Unique identifier of the `Rollout`. * * Generated from protobuf field string rollout_uid = 5; */ - private $rollout_uid = ''; + protected $rollout_uid = ''; /** * The name of the `Rollout`. * * Generated from protobuf field string rollout = 9; */ - private $rollout = ''; + protected $rollout = ''; /** * ID of the `Target`. * * Generated from protobuf field string target_id = 6; */ - private $target_id = ''; + protected $target_id = ''; /** * Type of this notification, e.g. for a Pub/Sub failure. * * Generated from protobuf field .google.cloud.deploy.v1.Type type = 7; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Deploy/src/V1/KubernetesConfig/GatewayServiceMesh.php b/Deploy/src/V1/KubernetesConfig/GatewayServiceMesh.php index 0fb2e6896efd..7baf6775224c 100644 --- a/Deploy/src/V1/KubernetesConfig/GatewayServiceMesh.php +++ b/Deploy/src/V1/KubernetesConfig/GatewayServiceMesh.php @@ -20,20 +20,20 @@ class GatewayServiceMesh extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string http_route = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $http_route = ''; + protected $http_route = ''; /** * Required. Name of the Kubernetes Service. * * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $service = ''; + protected $service = ''; /** * Required. Name of the Kubernetes Deployment whose traffic is managed by * the specified HTTPRoute and Service. * * Generated from protobuf field string deployment = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployment = ''; + protected $deployment = ''; /** * Optional. The time to wait for route updates to propagate. The maximum * configurable time is 3 hours, in seconds format. If unspecified, there is @@ -41,7 +41,7 @@ class GatewayServiceMesh extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration route_update_wait_time = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $route_update_wait_time = null; + protected $route_update_wait_time = null; /** * Optional. The amount of time to migrate traffic back from the canary * Service to the original Service during the stable phase deployment. If @@ -50,7 +50,7 @@ class GatewayServiceMesh extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration stable_cutback_duration = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $stable_cutback_duration = null; + protected $stable_cutback_duration = null; /** * Constructor. diff --git a/Deploy/src/V1/KubernetesConfig/ServiceNetworking.php b/Deploy/src/V1/KubernetesConfig/ServiceNetworking.php index 538d4e39b8f5..1313dae9edc2 100644 --- a/Deploy/src/V1/KubernetesConfig/ServiceNetworking.php +++ b/Deploy/src/V1/KubernetesConfig/ServiceNetworking.php @@ -20,14 +20,14 @@ class ServiceNetworking extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $service = ''; + protected $service = ''; /** * Required. Name of the Kubernetes Deployment whose traffic is managed by * the specified Service. * * Generated from protobuf field string deployment = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $deployment = ''; + protected $deployment = ''; /** * Optional. Whether to disable Pod overprovisioning. If Pod * overprovisioning is disabled then Cloud Deploy will limit the number of @@ -36,7 +36,7 @@ class ServiceNetworking extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_pod_overprovisioning = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_pod_overprovisioning = false; + protected $disable_pod_overprovisioning = false; /** * Constructor. diff --git a/Deploy/src/V1/ListAutomationRunsRequest.php b/Deploy/src/V1/ListAutomationRunsRequest.php index a3ae72348594..de808a00b4a8 100644 --- a/Deploy/src/V1/ListAutomationRunsRequest.php +++ b/Deploy/src/V1/ListAutomationRunsRequest.php @@ -22,7 +22,7 @@ class ListAutomationRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of automationRuns to return. The service may return * fewer than this value. If unspecified, at most 50 automationRuns will @@ -31,7 +31,7 @@ class ListAutomationRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous `ListAutomationRuns` call. * Provide this to retrieve the subsequent page. @@ -40,20 +40,20 @@ class ListAutomationRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Filter automationRuns to be returned. All fields can be used in the * filter. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * Field to sort by. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent `Delivery Pipeline`, which owns this collection of diff --git a/Deploy/src/V1/ListAutomationRunsResponse.php b/Deploy/src/V1/ListAutomationRunsResponse.php index 22af1ab166a8..9a672c0fe1de 100644 --- a/Deploy/src/V1/ListAutomationRunsResponse.php +++ b/Deploy/src/V1/ListAutomationRunsResponse.php @@ -27,7 +27,7 @@ class ListAutomationRunsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Deploy/src/V1/ListAutomationsRequest.php b/Deploy/src/V1/ListAutomationsRequest.php index ea78b76f57e4..beacb32f80d0 100644 --- a/Deploy/src/V1/ListAutomationsRequest.php +++ b/Deploy/src/V1/ListAutomationsRequest.php @@ -22,7 +22,7 @@ class ListAutomationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of automations to return. The service may return * fewer than this value. If unspecified, at most 50 automations will @@ -31,7 +31,7 @@ class ListAutomationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous `ListAutomations` call. * Provide this to retrieve the subsequent page. @@ -40,20 +40,20 @@ class ListAutomationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Filter automations to be returned. All fields can be used in the * filter. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * Field to sort by. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent `Delivery Pipeline`, which owns this collection of diff --git a/Deploy/src/V1/ListAutomationsResponse.php b/Deploy/src/V1/ListAutomationsResponse.php index 2324679b199a..c14853d6404e 100644 --- a/Deploy/src/V1/ListAutomationsResponse.php +++ b/Deploy/src/V1/ListAutomationsResponse.php @@ -27,7 +27,7 @@ class ListAutomationsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Deploy/src/V1/ListCustomTargetTypesRequest.php b/Deploy/src/V1/ListCustomTargetTypesRequest.php index e3fc24453112..375fe11940d1 100644 --- a/Deploy/src/V1/ListCustomTargetTypesRequest.php +++ b/Deploy/src/V1/ListCustomTargetTypesRequest.php @@ -21,7 +21,7 @@ class ListCustomTargetTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of `CustomTargetType` objects to return. The * service may return fewer than this value. If unspecified, at most 50 @@ -30,7 +30,7 @@ class ListCustomTargetTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous `ListCustomTargetTypes` * call. Provide this to retrieve the subsequent page. @@ -39,21 +39,21 @@ class ListCustomTargetTypesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter custom target types to be returned. See * https://google.aip.dev/160 for more details. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Field to sort by. See https://google.aip.dev/132#ordering for * more details. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent that owns this collection of custom target types. diff --git a/Deploy/src/V1/ListCustomTargetTypesResponse.php b/Deploy/src/V1/ListCustomTargetTypesResponse.php index c563126a42f5..0b7aed0e438f 100644 --- a/Deploy/src/V1/ListCustomTargetTypesResponse.php +++ b/Deploy/src/V1/ListCustomTargetTypesResponse.php @@ -27,7 +27,7 @@ class ListCustomTargetTypesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Deploy/src/V1/ListDeliveryPipelinesRequest.php b/Deploy/src/V1/ListDeliveryPipelinesRequest.php index ef072380dab0..5718d4cb4190 100644 --- a/Deploy/src/V1/ListDeliveryPipelinesRequest.php +++ b/Deploy/src/V1/ListDeliveryPipelinesRequest.php @@ -21,7 +21,7 @@ class ListDeliveryPipelinesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of pipelines to return. The service may return * fewer than this value. If unspecified, at most 50 pipelines will @@ -30,7 +30,7 @@ class ListDeliveryPipelinesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A page token, received from a previous `ListDeliveryPipelines` call. * Provide this to retrieve the subsequent page. @@ -39,20 +39,20 @@ class ListDeliveryPipelinesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Filter pipelines to be returned. See https://google.aip.dev/160 for more * details. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * Field to sort by. See https://google.aip.dev/132#ordering for more details. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of pipelines. Format must diff --git a/Deploy/src/V1/ListDeliveryPipelinesResponse.php b/Deploy/src/V1/ListDeliveryPipelinesResponse.php index ab3b6f0a737e..aade7781c825 100644 --- a/Deploy/src/V1/ListDeliveryPipelinesResponse.php +++ b/Deploy/src/V1/ListDeliveryPipelinesResponse.php @@ -27,7 +27,7 @@ class ListDeliveryPipelinesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Deploy/src/V1/ListJobRunsRequest.php b/Deploy/src/V1/ListJobRunsRequest.php index c6c362305fc1..de678b046e48 100644 --- a/Deploy/src/V1/ListJobRunsRequest.php +++ b/Deploy/src/V1/ListJobRunsRequest.php @@ -20,7 +20,7 @@ class ListJobRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of `JobRun` objects to return. The service may * return fewer than this value. If unspecified, at most 50 `JobRun` objects @@ -29,7 +29,7 @@ class ListJobRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous `ListJobRuns` call. * Provide this to retrieve the subsequent page. @@ -38,21 +38,21 @@ class ListJobRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter results to be returned. See https://google.aip.dev/160 for * more details. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Field to sort by. See https://google.aip.dev/132#ordering for * more details. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The `Rollout` which owns this collection of `JobRun` objects. Please see diff --git a/Deploy/src/V1/ListJobRunsResponse.php b/Deploy/src/V1/ListJobRunsResponse.php index 0596be48edbf..c62986ce2dbe 100644 --- a/Deploy/src/V1/ListJobRunsResponse.php +++ b/Deploy/src/V1/ListJobRunsResponse.php @@ -27,7 +27,7 @@ class ListJobRunsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached * diff --git a/Deploy/src/V1/ListReleasesRequest.php b/Deploy/src/V1/ListReleasesRequest.php index 25c4de06de60..a133cfc5e498 100644 --- a/Deploy/src/V1/ListReleasesRequest.php +++ b/Deploy/src/V1/ListReleasesRequest.php @@ -21,7 +21,7 @@ class ListReleasesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of `Release` objects to return. The service * may return fewer than this value. If unspecified, at most 50 `Release` @@ -30,7 +30,7 @@ class ListReleasesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous `ListReleases` call. * Provide this to retrieve the subsequent page. @@ -39,21 +39,21 @@ class ListReleasesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter releases to be returned. See https://google.aip.dev/160 * for more details. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Field to sort by. See https://google.aip.dev/132#ordering for * more details. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The `DeliveryPipeline` which owns this collection of `Release` diff --git a/Deploy/src/V1/ListReleasesResponse.php b/Deploy/src/V1/ListReleasesResponse.php index ee6fe0f5a05f..72798b69fe4c 100644 --- a/Deploy/src/V1/ListReleasesResponse.php +++ b/Deploy/src/V1/ListReleasesResponse.php @@ -27,7 +27,7 @@ class ListReleasesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Deploy/src/V1/ListRolloutsRequest.php b/Deploy/src/V1/ListRolloutsRequest.php index 9b2536e10068..6209b04be8b5 100644 --- a/Deploy/src/V1/ListRolloutsRequest.php +++ b/Deploy/src/V1/ListRolloutsRequest.php @@ -20,7 +20,7 @@ class ListRolloutsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of `Rollout` objects to return. The service * may return fewer than this value. If unspecified, at most 50 `Rollout` @@ -29,7 +29,7 @@ class ListRolloutsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous `ListRollouts` call. * Provide this to retrieve the subsequent page. @@ -38,21 +38,21 @@ class ListRolloutsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 * for more details. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Field to sort by. See https://google.aip.dev/132#ordering for * more details. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The `Release` which owns this collection of `Rollout` objects. Please see diff --git a/Deploy/src/V1/ListRolloutsResponse.php b/Deploy/src/V1/ListRolloutsResponse.php index 28ded1c2b0bf..fc25e3092666 100644 --- a/Deploy/src/V1/ListRolloutsResponse.php +++ b/Deploy/src/V1/ListRolloutsResponse.php @@ -27,7 +27,7 @@ class ListRolloutsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Deploy/src/V1/ListTargetsRequest.php b/Deploy/src/V1/ListTargetsRequest.php index e4add9f854e2..2aa7809d0875 100644 --- a/Deploy/src/V1/ListTargetsRequest.php +++ b/Deploy/src/V1/ListTargetsRequest.php @@ -21,7 +21,7 @@ class ListTargetsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of `Target` objects to return. The service may * return fewer than this value. If unspecified, at most 50 `Target` objects @@ -30,7 +30,7 @@ class ListTargetsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous `ListTargets` call. * Provide this to retrieve the subsequent page. @@ -39,21 +39,21 @@ class ListTargetsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Filter targets to be returned. See https://google.aip.dev/160 for * more details. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Field to sort by. See https://google.aip.dev/132#ordering for * more details. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of targets. Format must be diff --git a/Deploy/src/V1/ListTargetsResponse.php b/Deploy/src/V1/ListTargetsResponse.php index 329dc1ba9c44..4c648ae25fd5 100644 --- a/Deploy/src/V1/ListTargetsResponse.php +++ b/Deploy/src/V1/ListTargetsResponse.php @@ -27,7 +27,7 @@ class ListTargetsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Deploy/src/V1/Metadata.php b/Deploy/src/V1/Metadata.php index 67ec6af8409a..f9940ac35423 100644 --- a/Deploy/src/V1/Metadata.php +++ b/Deploy/src/V1/Metadata.php @@ -21,20 +21,20 @@ class Metadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.CloudRunMetadata cloud_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $cloud_run = null; + protected $cloud_run = null; /** * Output only. AutomationRolloutMetadata contains the information about the * interactions between Automation service and this rollout. * * Generated from protobuf field .google.cloud.deploy.v1.AutomationRolloutMetadata automation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $automation = null; + protected $automation = null; /** * Output only. Custom metadata provided by user-defined `Rollout` operations. * * Generated from protobuf field .google.cloud.deploy.v1.CustomMetadata custom = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $custom = null; + protected $custom = null; /** * Constructor. diff --git a/Deploy/src/V1/OperationMetadata.php b/Deploy/src/V1/OperationMetadata.php index fe004de04da3..2565328b1fe3 100644 --- a/Deploy/src/V1/OperationMetadata.php +++ b/Deploy/src/V1/OperationMetadata.php @@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $status_message = ''; + protected $status_message = ''; /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -54,13 +54,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Constructor. diff --git a/Deploy/src/V1/Phase.php b/Deploy/src/V1/Phase.php index 8afc379e9d21..d4eb8041827c 100644 --- a/Deploy/src/V1/Phase.php +++ b/Deploy/src/V1/Phase.php @@ -21,20 +21,20 @@ class Phase extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $id = ''; + protected $id = ''; /** * Output only. Current state of the Phase. * * Generated from protobuf field .google.cloud.deploy.v1.Phase.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information on why the Phase was skipped, if * available. * * Generated from protobuf field string skip_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $skip_message = ''; + protected $skip_message = ''; protected $jobs; /** diff --git a/Deploy/src/V1/PipelineCondition.php b/Deploy/src/V1/PipelineCondition.php index 97eb349ce5c9..9b2a718bb204 100644 --- a/Deploy/src/V1/PipelineCondition.php +++ b/Deploy/src/V1/PipelineCondition.php @@ -20,20 +20,20 @@ class PipelineCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.PipelineReadyCondition pipeline_ready_condition = 1; */ - private $pipeline_ready_condition = null; + protected $pipeline_ready_condition = null; /** * Details around targets enumerated in the pipeline. * * Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 3; */ - private $targets_present_condition = null; + protected $targets_present_condition = null; /** * Details on the whether the targets enumerated in the pipeline are of the * same type. * * Generated from protobuf field .google.cloud.deploy.v1.TargetsTypeCondition targets_type_condition = 4; */ - private $targets_type_condition = null; + protected $targets_type_condition = null; /** * Constructor. diff --git a/Deploy/src/V1/PipelineReadyCondition.php b/Deploy/src/V1/PipelineReadyCondition.php index bd5afe48fa9f..5ed4775bcce0 100644 --- a/Deploy/src/V1/PipelineReadyCondition.php +++ b/Deploy/src/V1/PipelineReadyCondition.php @@ -24,13 +24,13 @@ class PipelineReadyCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool status = 3; */ - private $status = false; + protected $status = false; /** * Last time the condition was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/Deploy/src/V1/PostdeployJobRun.php b/Deploy/src/V1/PostdeployJobRun.php index e6e0cc7de825..1f75d56505ec 100644 --- a/Deploy/src/V1/PostdeployJobRun.php +++ b/Deploy/src/V1/PostdeployJobRun.php @@ -22,21 +22,21 @@ class PostdeployJobRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $build = ''; + protected $build = ''; /** * Output only. The reason the postdeploy failed. This will always be * unspecified while the postdeploy is in progress or if it succeeded. * * Generated from protobuf field .google.cloud.deploy.v1.PostdeployJobRun.FailureCause failure_cause = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_cause = 0; + protected $failure_cause = 0; /** * Output only. Additional information about the postdeploy failure, if * available. * * Generated from protobuf field string failure_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_message = ''; + protected $failure_message = ''; /** * Constructor. diff --git a/Deploy/src/V1/PredeployJobRun.php b/Deploy/src/V1/PredeployJobRun.php index 70920ef199fd..ad155d70502c 100644 --- a/Deploy/src/V1/PredeployJobRun.php +++ b/Deploy/src/V1/PredeployJobRun.php @@ -22,21 +22,21 @@ class PredeployJobRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $build = ''; + protected $build = ''; /** * Output only. The reason the predeploy failed. This will always be * unspecified while the predeploy is in progress or if it succeeded. * * Generated from protobuf field .google.cloud.deploy.v1.PredeployJobRun.FailureCause failure_cause = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_cause = 0; + protected $failure_cause = 0; /** * Output only. Additional information about the predeploy failure, if * available. * * Generated from protobuf field string failure_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_message = ''; + protected $failure_message = ''; /** * Constructor. diff --git a/Deploy/src/V1/PrivatePool.php b/Deploy/src/V1/PrivatePool.php index 843bf8f19acc..b7a8ae63ba44 100644 --- a/Deploy/src/V1/PrivatePool.php +++ b/Deploy/src/V1/PrivatePool.php @@ -21,7 +21,7 @@ class PrivatePool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_pool = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $worker_pool = ''; + protected $worker_pool = ''; /** * Optional. Google service account to use for execution. If unspecified, * the project execution service account @@ -29,7 +29,7 @@ class PrivatePool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_account = ''; + protected $service_account = ''; /** * Optional. Cloud Storage location where execution outputs should be stored. * This can either be a bucket ("gs://my-bucket") or a path within a bucket @@ -38,7 +38,7 @@ class PrivatePool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string artifact_storage = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $artifact_storage = ''; + protected $artifact_storage = ''; /** * Constructor. diff --git a/Deploy/src/V1/PromoteReleaseOperation.php b/Deploy/src/V1/PromoteReleaseOperation.php index dbdc97d94eb2..5dec2ed45fe3 100644 --- a/Deploy/src/V1/PromoteReleaseOperation.php +++ b/Deploy/src/V1/PromoteReleaseOperation.php @@ -22,25 +22,25 @@ class PromoteReleaseOperation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string target_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target_id = ''; + protected $target_id = ''; /** * Output only. How long the operation will be paused. * * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $wait = null; + protected $wait = null; /** * Output only. The name of the rollout that initiates the `AutomationRun`. * * Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rollout = ''; + protected $rollout = ''; /** * Output only. The starting phase of the rollout created by this operation. * * Generated from protobuf field string phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $phase = ''; + protected $phase = ''; /** * Constructor. diff --git a/Deploy/src/V1/PromoteReleaseRule.php b/Deploy/src/V1/PromoteReleaseRule.php index 9d30291eefdc..5f7bb10e599e 100644 --- a/Deploy/src/V1/PromoteReleaseRule.php +++ b/Deploy/src/V1/PromoteReleaseRule.php @@ -18,18 +18,19 @@ class PromoteReleaseRule extends \Google\Protobuf\Internal\Message { /** * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $id = ''; + protected $id = ''; /** * Optional. How long the release need to be paused until being promoted to * the next target. * * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $wait = null; + protected $wait = null; /** * Optional. The ID of the stage in the pipeline to which this `Release` is * deploying. If unspecified, default it to the next stage in the promotion @@ -41,20 +42,20 @@ class PromoteReleaseRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string destination_target_id = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $destination_target_id = ''; + protected $destination_target_id = ''; /** * Output only. Information around the state of the Automation rule. * * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $condition = null; + protected $condition = null; /** * Optional. The starting phase of the rollout created by this operation. * Default to the first phase. * * Generated from protobuf field string destination_phase = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $destination_phase = ''; + protected $destination_phase = ''; /** * Constructor. @@ -64,7 +65,8 @@ class PromoteReleaseRule extends \Google\Protobuf\Internal\Message * * @type string $id * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * @type \Google\Protobuf\Duration $wait * Optional. How long the release need to be paused until being promoted to * the next target. @@ -90,7 +92,8 @@ public function __construct($data = NULL) { /** * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -102,7 +105,8 @@ public function getId() /** * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/Deploy/src/V1/Release.php b/Deploy/src/V1/Release.php index ed82e52c8a5d..2842c336a4e7 100644 --- a/Deploy/src/V1/Release.php +++ b/Deploy/src/V1/Release.php @@ -19,23 +19,24 @@ class Release extends \Google\Protobuf\Internal\Message { /** * Optional. Name of the `Release`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. + * The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Output only. Unique identifier of the `Release`. * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Description of the `Release`. Max length is 255 characters. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * User annotations. These attributes can only be set and used by the * user, and not by Cloud Deploy. See https://google.aip.dev/128#annotations @@ -63,37 +64,37 @@ class Release extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool abandoned = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $abandoned = false; + protected $abandoned = false; /** * Output only. Time at which the `Release` was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time at which the render began. * * Generated from protobuf field .google.protobuf.Timestamp render_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $render_start_time = null; + protected $render_start_time = null; /** * Output only. Time at which the render completed. * * Generated from protobuf field .google.protobuf.Timestamp render_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $render_end_time = null; + protected $render_end_time = null; /** * Cloud Storage URI of tar.gz archive containing Skaffold configuration. * * Generated from protobuf field string skaffold_config_uri = 17; */ - private $skaffold_config_uri = ''; + protected $skaffold_config_uri = ''; /** * Filepath of the Skaffold config inside of the config URI. * * Generated from protobuf field string skaffold_config_path = 9; */ - private $skaffold_config_path = ''; + protected $skaffold_config_path = ''; /** * List of artifacts to pass through to Skaffold command. * @@ -106,7 +107,7 @@ class Release extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline_snapshot = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $delivery_pipeline_snapshot = null; + protected $delivery_pipeline_snapshot = null; /** * Output only. Snapshot of the targets taken at release creation time. * @@ -125,7 +126,7 @@ class Release extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState render_state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $render_state = 0; + protected $render_state = 0; /** * This checksum is computed by the server based on the value of other * fields, and may be sent on update and delete requests to ensure the @@ -133,7 +134,7 @@ class Release extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 16; */ - private $etag = ''; + protected $etag = ''; /** * The Skaffold version to use when operating on this release, such as * "1.20.0". Not all versions are valid; Cloud Deploy supports a specific set @@ -142,7 +143,7 @@ class Release extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string skaffold_version = 19; */ - private $skaffold_version = ''; + protected $skaffold_version = ''; /** * Output only. Map from target ID to the target artifacts created * during the render operation. @@ -162,7 +163,7 @@ class Release extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.Release.ReleaseCondition condition = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $condition = null; + protected $condition = null; /** * Optional. The deploy parameters to use for all targets in this release. * @@ -178,7 +179,8 @@ class Release extends \Google\Protobuf\Internal\Message * * @type string $name * Optional. Name of the `Release`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. + * The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * @type string $uid * Output only. Unique identifier of the `Release`. * @type string $description @@ -249,7 +251,8 @@ public function __construct($data = NULL) { /** * Optional. Name of the `Release`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. + * The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -261,7 +264,8 @@ public function getName() /** * Optional. Name of the `Release`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. + * The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Deploy/src/V1/Release/ReleaseCondition.php b/Deploy/src/V1/Release/ReleaseCondition.php index 9c838755a6d0..15897e2b2142 100644 --- a/Deploy/src/V1/Release/ReleaseCondition.php +++ b/Deploy/src/V1/Release/ReleaseCondition.php @@ -20,14 +20,14 @@ class ReleaseCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.Release.ReleaseReadyCondition release_ready_condition = 1; */ - private $release_ready_condition = null; + protected $release_ready_condition = null; /** * Details around the support state of the release's Skaffold * version. * * Generated from protobuf field .google.cloud.deploy.v1.Release.SkaffoldSupportedCondition skaffold_supported_condition = 2; */ - private $skaffold_supported_condition = null; + protected $skaffold_supported_condition = null; /** * Constructor. diff --git a/Deploy/src/V1/Release/ReleaseReadyCondition.php b/Deploy/src/V1/Release/ReleaseReadyCondition.php index ebc7d6060ccc..be7fbf10f02c 100644 --- a/Deploy/src/V1/Release/ReleaseReadyCondition.php +++ b/Deploy/src/V1/Release/ReleaseReadyCondition.php @@ -25,7 +25,7 @@ class ReleaseReadyCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool status = 1; */ - private $status = false; + protected $status = false; /** * Constructor. diff --git a/Deploy/src/V1/Release/SkaffoldSupportedCondition.php b/Deploy/src/V1/Release/SkaffoldSupportedCondition.php index 3e5424d9a5c9..f223cf99d5e5 100644 --- a/Deploy/src/V1/Release/SkaffoldSupportedCondition.php +++ b/Deploy/src/V1/Release/SkaffoldSupportedCondition.php @@ -21,27 +21,27 @@ class SkaffoldSupportedCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool status = 1; */ - private $status = false; + protected $status = false; /** * The Skaffold support state for this release's version of Skaffold. * * Generated from protobuf field .google.cloud.deploy.v1.SkaffoldSupportState skaffold_support_state = 2; */ - private $skaffold_support_state = 0; + protected $skaffold_support_state = 0; /** * The time at which this release's version of Skaffold will enter * maintenance mode. * * Generated from protobuf field .google.protobuf.Timestamp maintenance_mode_time = 3; */ - private $maintenance_mode_time = null; + protected $maintenance_mode_time = null; /** * The time at which this release's version of Skaffold will no longer be * supported. * * Generated from protobuf field .google.protobuf.Timestamp support_expiration_time = 4; */ - private $support_expiration_time = null; + protected $support_expiration_time = null; /** * Constructor. diff --git a/Deploy/src/V1/Release/TargetRender.php b/Deploy/src/V1/Release/TargetRender.php index bde25523fca5..f7594f1bde85 100644 --- a/Deploy/src/V1/Release/TargetRender.php +++ b/Deploy/src/V1/Release/TargetRender.php @@ -22,33 +22,33 @@ class TargetRender extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string rendering_build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $rendering_build = ''; + protected $rendering_build = ''; /** * Output only. Current state of the render operation for this Target. * * Generated from protobuf field .google.cloud.deploy.v1.Release.TargetRender.TargetRenderState rendering_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rendering_state = 0; + protected $rendering_state = 0; /** * Output only. Metadata related to the `Release` render for this Target. * * Generated from protobuf field .google.cloud.deploy.v1.RenderMetadata metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata = null; + protected $metadata = null; /** * Output only. Reason this render failed. This will always be unspecified * while the render in progress. * * Generated from protobuf field .google.cloud.deploy.v1.Release.TargetRender.FailureCause failure_cause = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_cause = 0; + protected $failure_cause = 0; /** * Output only. Additional information about the render failure, if * available. * * Generated from protobuf field string failure_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_message = ''; + protected $failure_message = ''; /** * Constructor. diff --git a/Deploy/src/V1/ReleaseNotificationEvent.php b/Deploy/src/V1/ReleaseNotificationEvent.php index 81a79b826379..564707b255ce 100644 --- a/Deploy/src/V1/ReleaseNotificationEvent.php +++ b/Deploy/src/V1/ReleaseNotificationEvent.php @@ -22,31 +22,31 @@ class ReleaseNotificationEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * Unique identifier of the `DeliveryPipeline`. * * Generated from protobuf field string pipeline_uid = 4; */ - private $pipeline_uid = ''; + protected $pipeline_uid = ''; /** * Unique identifier of the `Release`. * * Generated from protobuf field string release_uid = 5; */ - private $release_uid = ''; + protected $release_uid = ''; /** * The name of the `Release`. * * Generated from protobuf field string release = 2; */ - private $release = ''; + protected $release = ''; /** * Type of this notification, e.g. for a Pub/Sub failure. * * Generated from protobuf field .google.cloud.deploy.v1.Type type = 3; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Deploy/src/V1/ReleaseRenderEvent.php b/Deploy/src/V1/ReleaseRenderEvent.php index 50aedff24f50..59933d460f13 100644 --- a/Deploy/src/V1/ReleaseRenderEvent.php +++ b/Deploy/src/V1/ReleaseRenderEvent.php @@ -22,13 +22,13 @@ class ReleaseRenderEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * Unique identifier of the `DeliveryPipeline`. * * Generated from protobuf field string pipeline_uid = 4; */ - private $pipeline_uid = ''; + protected $pipeline_uid = ''; /** * The name of the release. * release_uid is not in this log message because we write some of these log @@ -36,19 +36,19 @@ class ReleaseRenderEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string release = 2; */ - private $release = ''; + protected $release = ''; /** * Type of this notification, e.g. for a release render state change event. * * Generated from protobuf field .google.cloud.deploy.v1.Type type = 5; */ - private $type = 0; + protected $type = 0; /** * The state of the release render. * * Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState release_render_state = 3; */ - private $release_render_state = 0; + protected $release_render_state = 0; /** * Constructor. diff --git a/Deploy/src/V1/RenderMetadata.php b/Deploy/src/V1/RenderMetadata.php index dbb4fc56490e..a4ef9c53a1d1 100644 --- a/Deploy/src/V1/RenderMetadata.php +++ b/Deploy/src/V1/RenderMetadata.php @@ -20,13 +20,13 @@ class RenderMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.CloudRunRenderMetadata cloud_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $cloud_run = null; + protected $cloud_run = null; /** * Output only. Custom metadata provided by user-defined render operation. * * Generated from protobuf field .google.cloud.deploy.v1.CustomMetadata custom = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $custom = null; + protected $custom = null; /** * Constructor. diff --git a/Deploy/src/V1/RepairRolloutOperation.php b/Deploy/src/V1/RepairRolloutOperation.php index a991aef6f780..cbc9fa6ba97a 100644 --- a/Deploy/src/V1/RepairRolloutOperation.php +++ b/Deploy/src/V1/RepairRolloutOperation.php @@ -20,13 +20,13 @@ class RepairRolloutOperation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rollout = ''; + protected $rollout = ''; /** * Output only. The index of the current repair action in the repair sequence. * * Generated from protobuf field int64 current_repair_mode_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $current_repair_mode_index = 0; + protected $current_repair_mode_index = 0; /** * Output only. Records of the repair attempts. Each repair phase may have * multiple retry attempts or single rollback attempt. diff --git a/Deploy/src/V1/RepairRolloutRule.php b/Deploy/src/V1/RepairRolloutRule.php index 91d287c89e3e..44a01f3f4736 100644 --- a/Deploy/src/V1/RepairRolloutRule.php +++ b/Deploy/src/V1/RepairRolloutRule.php @@ -18,11 +18,12 @@ class RepairRolloutRule extends \Google\Protobuf\Internal\Message { /** * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $id = ''; + protected $id = ''; /** * Optional. Phases within which jobs are subject to automatic repair actions * on failure. Proceeds only after phase name matched any one in the list, or @@ -57,7 +58,7 @@ class RepairRolloutRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $condition = null; + protected $condition = null; /** * Constructor. @@ -67,7 +68,8 @@ class RepairRolloutRule extends \Google\Protobuf\Internal\Message * * @type string $id * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * @type array|\Google\Protobuf\Internal\RepeatedField $source_phases * Optional. Phases within which jobs are subject to automatic repair actions * on failure. Proceeds only after phase name matched any one in the list, or @@ -96,7 +98,8 @@ public function __construct($data = NULL) { /** * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -108,7 +111,8 @@ public function getId() /** * Required. ID of the rule. This id must be unique in the `Automation` - * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * resource to which this rule belongs. The format is + * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. * * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/Deploy/src/V1/Retry.php b/Deploy/src/V1/Retry.php index 2c1715d4f415..75f2e79026fd 100644 --- a/Deploy/src/V1/Retry.php +++ b/Deploy/src/V1/Retry.php @@ -21,21 +21,21 @@ class Retry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 attempts = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $attempts = 0; + protected $attempts = 0; /** * Optional. How long to wait for the first retry. Default is 0, and the * maximum value is 14d. * * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $wait = null; + protected $wait = null; /** * Optional. The pattern of how wait time will be increased. Default is * linear. Backoff mode will be ignored if `wait` is 0. * * Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $backoff_mode = 0; + protected $backoff_mode = 0; /** * Constructor. diff --git a/Deploy/src/V1/RetryAttempt.php b/Deploy/src/V1/RetryAttempt.php index f82a36fb3a83..469c65d247e7 100644 --- a/Deploy/src/V1/RetryAttempt.php +++ b/Deploy/src/V1/RetryAttempt.php @@ -20,25 +20,25 @@ class RetryAttempt extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 attempt = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $attempt = 0; + protected $attempt = 0; /** * Output only. How long the operation will be paused. * * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $wait = null; + protected $wait = null; /** * Output only. Valid state of this retry action. * * Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Description of the state of the Retry. * * Generated from protobuf field string state_desc = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_desc = ''; + protected $state_desc = ''; /** * Constructor. diff --git a/Deploy/src/V1/RetryJobRequest.php b/Deploy/src/V1/RetryJobRequest.php index 584ac5d52b23..eb2ecc465174 100644 --- a/Deploy/src/V1/RetryJobRequest.php +++ b/Deploy/src/V1/RetryJobRequest.php @@ -21,19 +21,19 @@ class RetryJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $rollout = ''; + protected $rollout = ''; /** * Required. The phase ID the Job to retry belongs to. * * Generated from protobuf field string phase_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $phase_id = ''; + protected $phase_id = ''; /** * Required. The job ID for the Job to retry. * * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $job_id = ''; + protected $job_id = ''; /** * @param string $rollout Required. Name of the Rollout. Format is diff --git a/Deploy/src/V1/RetryPhase.php b/Deploy/src/V1/RetryPhase.php index 581451ee680a..0eb3f79d6b1d 100644 --- a/Deploy/src/V1/RetryPhase.php +++ b/Deploy/src/V1/RetryPhase.php @@ -21,26 +21,26 @@ class RetryPhase extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 total_attempts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $total_attempts = 0; + protected $total_attempts = 0; /** * Output only. The pattern of how the wait time of the retry attempt is * calculated. * * Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $backoff_mode = 0; + protected $backoff_mode = 0; /** * Output only. The phase ID of the phase that includes the job being retried. * * Generated from protobuf field string phase_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $phase_id = ''; + protected $phase_id = ''; /** * Output only. The job ID for the Job to retry. * * Generated from protobuf field string job_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $job_id = ''; + protected $job_id = ''; /** * Output only. Detail of a retry action. * diff --git a/Deploy/src/V1/Rollback.php b/Deploy/src/V1/Rollback.php index 91deb3d77b35..62a577b8775e 100644 --- a/Deploy/src/V1/Rollback.php +++ b/Deploy/src/V1/Rollback.php @@ -21,7 +21,7 @@ class Rollback extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $destination_phase = ''; + protected $destination_phase = ''; /** * Constructor. diff --git a/Deploy/src/V1/RollbackAttempt.php b/Deploy/src/V1/RollbackAttempt.php index ad08b378c1be..6cf2b0dae8d7 100644 --- a/Deploy/src/V1/RollbackAttempt.php +++ b/Deploy/src/V1/RollbackAttempt.php @@ -20,25 +20,25 @@ class RollbackAttempt extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $destination_phase = ''; + protected $destination_phase = ''; /** * Output only. ID of the rollback `Rollout` to create. * * Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rollout_id = ''; + protected $rollout_id = ''; /** * Output only. Valid state of this rollback action. * * Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Description of the state of the Rollback. * * Generated from protobuf field string state_desc = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_desc = ''; + protected $state_desc = ''; /** * Constructor. diff --git a/Deploy/src/V1/RollbackTargetConfig.php b/Deploy/src/V1/RollbackTargetConfig.php index 2d2e4d089290..0993a0b5efbe 100644 --- a/Deploy/src/V1/RollbackTargetConfig.php +++ b/Deploy/src/V1/RollbackTargetConfig.php @@ -20,14 +20,14 @@ class RollbackTargetConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $rollout = null; + protected $rollout = null; /** * Optional. The starting phase ID for the `Rollout`. If unspecified, the * `Rollout` will start in the stable phase. * * Generated from protobuf field string starting_phase_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $starting_phase_id = ''; + protected $starting_phase_id = ''; /** * Constructor. diff --git a/Deploy/src/V1/RollbackTargetRequest.php b/Deploy/src/V1/RollbackTargetRequest.php index 5e46e61fd554..2d634cbd0e5e 100644 --- a/Deploy/src/V1/RollbackTargetRequest.php +++ b/Deploy/src/V1/RollbackTargetRequest.php @@ -22,19 +22,19 @@ class RollbackTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. ID of the `Target` that is being rolled back. * * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_id = ''; + protected $target_id = ''; /** * Required. ID of the rollback `Rollout` to create. * * Generated from protobuf field string rollout_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $rollout_id = ''; + protected $rollout_id = ''; /** * Optional. ID of the `Release` to roll back to. If this isn't specified, the * previous successful `Rollout` to the specified target will be used to @@ -42,27 +42,27 @@ class RollbackTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string release_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $release_id = ''; + protected $release_id = ''; /** * Optional. If provided, this must be the latest `Rollout` that is on the * `Target`. * * Generated from protobuf field string rollout_to_roll_back = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $rollout_to_roll_back = ''; + protected $rollout_to_roll_back = ''; /** * Optional. Configs for the rollback `Rollout`. * * Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $rollback_config = null; + protected $rollback_config = null; /** * Optional. If set to true, the request is validated and the user is provided * with a `RollbackTargetResponse`. * * Generated from protobuf field bool validate_only = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $name Required. The `DeliveryPipeline` for which the rollback `Rollout` should be diff --git a/Deploy/src/V1/RollbackTargetResponse.php b/Deploy/src/V1/RollbackTargetResponse.php index 4096fbe0bad5..0c2baf18351b 100644 --- a/Deploy/src/V1/RollbackTargetResponse.php +++ b/Deploy/src/V1/RollbackTargetResponse.php @@ -20,7 +20,7 @@ class RollbackTargetResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 1; */ - private $rollback_config = null; + protected $rollback_config = null; /** * Constructor. diff --git a/Deploy/src/V1/Rollout.php b/Deploy/src/V1/Rollout.php index 349bb81594ce..4a50ee1c678b 100644 --- a/Deploy/src/V1/Rollout.php +++ b/Deploy/src/V1/Rollout.php @@ -18,24 +18,25 @@ class Rollout extends \Google\Protobuf\Internal\Message { /** * Optional. Name of the `Rollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. + * The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Output only. Unique identifier of the `Rollout`. * * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Description of the `Rollout` for user purposes. Max length is 255 * characters. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * User annotations. These attributes can only be set and used by the * user, and not by Cloud Deploy. See https://google.aip.dev/128#annotations @@ -63,56 +64,56 @@ class Rollout extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time at which the `Rollout` was approved. * * Generated from protobuf field .google.protobuf.Timestamp approve_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $approve_time = null; + protected $approve_time = null; /** * Output only. Time at which the `Rollout` was enqueued. * * Generated from protobuf field .google.protobuf.Timestamp enqueue_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $enqueue_time = null; + protected $enqueue_time = null; /** * Output only. Time at which the `Rollout` started deploying. * * Generated from protobuf field .google.protobuf.Timestamp deploy_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $deploy_start_time = null; + protected $deploy_start_time = null; /** * Output only. Time at which the `Rollout` finished deploying. * * Generated from protobuf field .google.protobuf.Timestamp deploy_end_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $deploy_end_time = null; + protected $deploy_end_time = null; /** * Required. The ID of Target to which this `Rollout` is deploying. * * Generated from protobuf field string target_id = 18 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_id = ''; + protected $target_id = ''; /** * Output only. Approval state of the `Rollout`. * * Generated from protobuf field .google.cloud.deploy.v1.Rollout.ApprovalState approval_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $approval_state = 0; + protected $approval_state = 0; /** * Output only. Current state of the `Rollout`. * * Generated from protobuf field .google.cloud.deploy.v1.Rollout.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information about the rollout failure, if * available. * * Generated from protobuf field string failure_reason = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_reason = ''; + protected $failure_reason = ''; /** * Output only. The resource name of the Cloud Build `Build` object that is * used to deploy the Rollout. Format is @@ -120,7 +121,7 @@ class Rollout extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string deploying_build = 17 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $deploying_build = ''; + protected $deploying_build = ''; /** * This checksum is computed by the server based on the value of other * fields, and may be sent on update and delete requests to ensure the @@ -128,14 +129,14 @@ class Rollout extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 16; */ - private $etag = ''; + protected $etag = ''; /** * Output only. The reason this rollout failed. This will always be * unspecified while the rollout is in progress. * * Generated from protobuf field .google.cloud.deploy.v1.Rollout.FailureCause deploy_failure_cause = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $deploy_failure_cause = 0; + protected $deploy_failure_cause = 0; /** * Output only. The phases that represent the workflows of this `Rollout`. * @@ -147,21 +148,21 @@ class Rollout extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.Metadata metadata = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata = null; + protected $metadata = null; /** * Output only. Name of the `ControllerRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string controller_rollout = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $controller_rollout = ''; + protected $controller_rollout = ''; /** * Output only. Name of the `Rollout` that is rolled back by this `Rollout`. * Empty if this `Rollout` wasn't created as a rollback. * * Generated from protobuf field string rollback_of_rollout = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $rollback_of_rollout = ''; + protected $rollback_of_rollout = ''; /** * Output only. Names of `Rollouts` that rolled back this `Rollout`. * @@ -177,7 +178,8 @@ class Rollout extends \Google\Protobuf\Internal\Message * * @type string $name * Optional. Name of the `Rollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. + * The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * @type string $uid * Output only. Unique identifier of the `Rollout`. * @type string $description @@ -233,7 +235,7 @@ class Rollout extends \Google\Protobuf\Internal\Message * Output only. Metadata contains information about the rollout. * @type string $controller_rollout * Output only. Name of the `ControllerRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @type string $rollback_of_rollout * Output only. Name of the `Rollout` that is rolled back by this `Rollout`. * Empty if this `Rollout` wasn't created as a rollback. @@ -248,7 +250,8 @@ public function __construct($data = NULL) { /** * Optional. Name of the `Rollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. + * The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -260,7 +263,8 @@ public function getName() /** * Optional. Name of the `Rollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. + * The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -838,7 +842,7 @@ public function setMetadata($var) /** * Output only. Name of the `ControllerRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string controller_rollout = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -850,7 +854,7 @@ public function getControllerRollout() /** * Output only. Name of the `ControllerRollout`. Format is - * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string controller_rollout = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var diff --git a/Deploy/src/V1/RolloutNotificationEvent.php b/Deploy/src/V1/RolloutNotificationEvent.php index 8fc158fbc53c..98651e6feff8 100644 --- a/Deploy/src/V1/RolloutNotificationEvent.php +++ b/Deploy/src/V1/RolloutNotificationEvent.php @@ -22,49 +22,49 @@ class RolloutNotificationEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * Unique identifier of the `DeliveryPipeline`. * * Generated from protobuf field string pipeline_uid = 2; */ - private $pipeline_uid = ''; + protected $pipeline_uid = ''; /** * Unique identifier of the `Release`. * * Generated from protobuf field string release_uid = 3; */ - private $release_uid = ''; + protected $release_uid = ''; /** * The name of the `Release`. * * Generated from protobuf field string release = 7; */ - private $release = ''; + protected $release = ''; /** * Unique identifier of the `Rollout`. * * Generated from protobuf field string rollout_uid = 8; */ - private $rollout_uid = ''; + protected $rollout_uid = ''; /** * The name of the `Rollout`. * * Generated from protobuf field string rollout = 4; */ - private $rollout = ''; + protected $rollout = ''; /** * ID of the `Target` that the rollout is deployed to. * * Generated from protobuf field string target_id = 6; */ - private $target_id = ''; + protected $target_id = ''; /** * Type of this notification, e.g. for a Pub/Sub failure. * * Generated from protobuf field .google.cloud.deploy.v1.Type type = 5; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Deploy/src/V1/RolloutUpdateEvent.php b/Deploy/src/V1/RolloutUpdateEvent.php index a54242de7979..6595c48a0d0f 100644 --- a/Deploy/src/V1/RolloutUpdateEvent.php +++ b/Deploy/src/V1/RolloutUpdateEvent.php @@ -21,25 +21,25 @@ class RolloutUpdateEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 6; */ - private $message = ''; + protected $message = ''; /** * Unique identifier of the pipeline. * * Generated from protobuf field string pipeline_uid = 1; */ - private $pipeline_uid = ''; + protected $pipeline_uid = ''; /** * Unique identifier of the release. * * Generated from protobuf field string release_uid = 2; */ - private $release_uid = ''; + protected $release_uid = ''; /** * The name of the `Release`. * * Generated from protobuf field string release = 8; */ - private $release = ''; + protected $release = ''; /** * The name of the rollout. * rollout_uid is not in this log message because we write some of these log @@ -47,25 +47,25 @@ class RolloutUpdateEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string rollout = 3; */ - private $rollout = ''; + protected $rollout = ''; /** * ID of the target. * * Generated from protobuf field string target_id = 4; */ - private $target_id = ''; + protected $target_id = ''; /** * Type of this notification, e.g. for a rollout update event. * * Generated from protobuf field .google.cloud.deploy.v1.Type type = 7; */ - private $type = 0; + protected $type = 0; /** * The type of the rollout update. * * Generated from protobuf field .google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType rollout_update_type = 5; */ - private $rollout_update_type = 0; + protected $rollout_update_type = 0; /** * Constructor. diff --git a/Deploy/src/V1/SkaffoldModules/SkaffoldGCBRepoSource.php b/Deploy/src/V1/SkaffoldModules/SkaffoldGCBRepoSource.php index 0f4734229729..6e127f43b50e 100644 --- a/Deploy/src/V1/SkaffoldModules/SkaffoldGCBRepoSource.php +++ b/Deploy/src/V1/SkaffoldModules/SkaffoldGCBRepoSource.php @@ -22,20 +22,20 @@ class SkaffoldGCBRepoSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $repository = ''; + protected $repository = ''; /** * Optional. Relative path from the repository root to the Skaffold Config * file. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $path = ''; + protected $path = ''; /** * Optional. Branch or tag to use when cloning the repository. * * Generated from protobuf field string ref = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $ref = ''; + protected $ref = ''; /** * Constructor. diff --git a/Deploy/src/V1/SkaffoldModules/SkaffoldGCSSource.php b/Deploy/src/V1/SkaffoldModules/SkaffoldGCSSource.php index ba9ad170c5d2..d1698a009cd5 100644 --- a/Deploy/src/V1/SkaffoldModules/SkaffoldGCSSource.php +++ b/Deploy/src/V1/SkaffoldModules/SkaffoldGCSSource.php @@ -22,13 +22,13 @@ class SkaffoldGCSSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $source = ''; + protected $source = ''; /** * Optional. Relative path from the source to the Skaffold file. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $path = ''; + protected $path = ''; /** * Constructor. diff --git a/Deploy/src/V1/SkaffoldModules/SkaffoldGitSource.php b/Deploy/src/V1/SkaffoldModules/SkaffoldGitSource.php index 53ae74f44aca..7d4206aada60 100644 --- a/Deploy/src/V1/SkaffoldModules/SkaffoldGitSource.php +++ b/Deploy/src/V1/SkaffoldModules/SkaffoldGitSource.php @@ -20,19 +20,19 @@ class SkaffoldGitSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repo = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $repo = ''; + protected $repo = ''; /** * Optional. Relative path from the repository root to the Skaffold file. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $path = ''; + protected $path = ''; /** * Optional. Git branch or tag to use when cloning the repository. * * Generated from protobuf field string ref = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $ref = ''; + protected $ref = ''; /** * Constructor. diff --git a/Deploy/src/V1/SkaffoldVersion.php b/Deploy/src/V1/SkaffoldVersion.php index ed1fc72debb4..025ceb464b68 100644 --- a/Deploy/src/V1/SkaffoldVersion.php +++ b/Deploy/src/V1/SkaffoldVersion.php @@ -20,25 +20,25 @@ class SkaffoldVersion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1; */ - private $version = ''; + protected $version = ''; /** * The time at which this version of Skaffold will enter maintenance mode. * * Generated from protobuf field .google.protobuf.Timestamp maintenance_mode_time = 3; */ - private $maintenance_mode_time = null; + protected $maintenance_mode_time = null; /** * The time at which this version of Skaffold will no longer be supported. * * Generated from protobuf field .google.protobuf.Timestamp support_expiration_time = 4; */ - private $support_expiration_time = null; + protected $support_expiration_time = null; /** * Date when this version is expected to no longer be supported. * * Generated from protobuf field .google.type.Date support_end_date = 2; */ - private $support_end_date = null; + protected $support_end_date = null; /** * Constructor. diff --git a/Deploy/src/V1/Stage.php b/Deploy/src/V1/Stage.php index be722b86cb7b..ffd1b986043b 100644 --- a/Deploy/src/V1/Stage.php +++ b/Deploy/src/V1/Stage.php @@ -25,7 +25,7 @@ class Stage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string target_id = 1; */ - private $target_id = ''; + protected $target_id = ''; /** * Skaffold profiles to use when rendering the manifest for this stage's * `Target`. @@ -38,7 +38,7 @@ class Stage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.deploy.v1.Strategy strategy = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $strategy = null; + protected $strategy = null; /** * Optional. The deploy parameters to use for the target in this stage. * diff --git a/Deploy/src/V1/Standard.php b/Deploy/src/V1/Standard.php index f031263eaf22..5dfce8ecc950 100644 --- a/Deploy/src/V1/Standard.php +++ b/Deploy/src/V1/Standard.php @@ -20,21 +20,21 @@ class Standard extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool verify = 1; */ - private $verify = false; + protected $verify = false; /** * Optional. Configuration for the predeploy job. If this is not configured, * predeploy job will not be present. * * Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $predeploy = null; + protected $predeploy = null; /** * Optional. Configuration for the postdeploy job. If this is not configured, * postdeploy job will not be present. * * Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $postdeploy = null; + protected $postdeploy = null; /** * Constructor. diff --git a/Deploy/src/V1/Target.php b/Deploy/src/V1/Target.php index bcaef82d2ce9..8e17d8f3b811 100644 --- a/Deploy/src/V1/Target.php +++ b/Deploy/src/V1/Target.php @@ -19,29 +19,30 @@ class Target extends \Google\Protobuf\Internal\Message { /** * Optional. Name of the `Target`. Format is - * `projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/targets/{target}`. + * The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Output only. Resource id of the `Target`. * * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target_id = ''; + protected $target_id = ''; /** * Output only. Unique identifier of the `Target`. * * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Optional. Description of the `Target`. Max length is 255 characters. * * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. User annotations. These attributes can only be set and used by * the user, and not by Cloud Deploy. See @@ -70,19 +71,19 @@ class Target extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool require_approval = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $require_approval = false; + protected $require_approval = false; /** * Output only. Time at which the `Target` was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Most recent time at which the `Target` was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the @@ -90,7 +91,7 @@ class Target extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 12 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Configurations for all execution that relates to this `Target`. * Each `ExecutionEnvironmentUsage` value may only be used in a single @@ -119,7 +120,8 @@ class Target extends \Google\Protobuf\Internal\Message * * @type string $name * Optional. Name of the `Target`. Format is - * `projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/targets/{target}`. + * The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * @type string $target_id * Output only. Resource id of the `Target`. * @type string $uid @@ -180,7 +182,8 @@ public function __construct($data = NULL) { /** * Optional. Name of the `Target`. Format is - * `projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/targets/{target}`. + * The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -192,7 +195,8 @@ public function getName() /** * Optional. Name of the `Target`. Format is - * `projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}`. + * `projects/{project}/locations/{location}/targets/{target}`. + * The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Deploy/src/V1/TargetArtifact.php b/Deploy/src/V1/TargetArtifact.php index 8170412afdcc..dcca9ff5bfa5 100644 --- a/Deploy/src/V1/TargetArtifact.php +++ b/Deploy/src/V1/TargetArtifact.php @@ -21,13 +21,13 @@ class TargetArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string skaffold_config_path = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $skaffold_config_path = ''; + protected $skaffold_config_path = ''; /** * Output only. File path of the rendered manifest relative to the URI. * * Generated from protobuf field string manifest_path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $manifest_path = ''; + protected $manifest_path = ''; /** * Output only. Map from the phase ID to the phase artifacts for the `Target`. * diff --git a/Deploy/src/V1/TargetArtifact/PhaseArtifact.php b/Deploy/src/V1/TargetArtifact/PhaseArtifact.php index 7d9c36f11774..b5b18b9643ff 100644 --- a/Deploy/src/V1/TargetArtifact/PhaseArtifact.php +++ b/Deploy/src/V1/TargetArtifact/PhaseArtifact.php @@ -21,20 +21,20 @@ class PhaseArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string skaffold_config_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $skaffold_config_path = ''; + protected $skaffold_config_path = ''; /** * Output only. File path of the rendered manifest relative to the URI. * * Generated from protobuf field string manifest_path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $manifest_path = ''; + protected $manifest_path = ''; /** * Output only. File path of the directory of rendered job manifests * relative to the URI. This is only set if it is applicable. * * Generated from protobuf field string job_manifests_path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $job_manifests_path = ''; + protected $job_manifests_path = ''; /** * Constructor. diff --git a/Deploy/src/V1/TargetAttribute.php b/Deploy/src/V1/TargetAttribute.php index aa202d0f74eb..2ad745bdf87b 100644 --- a/Deploy/src/V1/TargetAttribute.php +++ b/Deploy/src/V1/TargetAttribute.php @@ -24,7 +24,7 @@ class TargetAttribute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * Target labels. * diff --git a/Deploy/src/V1/TargetNotificationEvent.php b/Deploy/src/V1/TargetNotificationEvent.php index 93cf6eeecc79..60f2044019f6 100644 --- a/Deploy/src/V1/TargetNotificationEvent.php +++ b/Deploy/src/V1/TargetNotificationEvent.php @@ -22,19 +22,19 @@ class TargetNotificationEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1; */ - private $message = ''; + protected $message = ''; /** * The name of the `Target`. * * Generated from protobuf field string target = 2; */ - private $target = ''; + protected $target = ''; /** * Type of this notification, e.g. for a Pub/Sub failure. * * Generated from protobuf field .google.cloud.deploy.v1.Type type = 3; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Deploy/src/V1/TargetsPresentCondition.php b/Deploy/src/V1/TargetsPresentCondition.php index 7cf53d127686..7dba90cabb9d 100644 --- a/Deploy/src/V1/TargetsPresentCondition.php +++ b/Deploy/src/V1/TargetsPresentCondition.php @@ -21,7 +21,7 @@ class TargetsPresentCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool status = 1; */ - private $status = false; + protected $status = false; /** * The list of Target names that do not exist. For example, * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. @@ -34,7 +34,7 @@ class TargetsPresentCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/Deploy/src/V1/TargetsTypeCondition.php b/Deploy/src/V1/TargetsTypeCondition.php index 90e650b8d96e..34705dbf6df7 100644 --- a/Deploy/src/V1/TargetsTypeCondition.php +++ b/Deploy/src/V1/TargetsTypeCondition.php @@ -23,13 +23,13 @@ class TargetsTypeCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool status = 1; */ - private $status = false; + protected $status = false; /** * Human readable error message. * * Generated from protobuf field string error_details = 2; */ - private $error_details = ''; + protected $error_details = ''; /** * Constructor. diff --git a/Deploy/src/V1/TerminateJobRunRequest.php b/Deploy/src/V1/TerminateJobRunRequest.php index 0f065707dcfe..4264a7361286 100644 --- a/Deploy/src/V1/TerminateJobRunRequest.php +++ b/Deploy/src/V1/TerminateJobRunRequest.php @@ -21,7 +21,7 @@ class TerminateJobRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the `JobRun`. Format must be diff --git a/Deploy/src/V1/UpdateAutomationRequest.php b/Deploy/src/V1/UpdateAutomationRequest.php index 375d3d5ce93e..0e0955a6a129 100644 --- a/Deploy/src/V1/UpdateAutomationRequest.php +++ b/Deploy/src/V1/UpdateAutomationRequest.php @@ -24,13 +24,13 @@ class UpdateAutomationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The `Automation` to update. * * Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $automation = null; + protected $automation = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -46,21 +46,21 @@ class UpdateAutomationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, updating a `Automation` that does not exist will * result in the creation of a new `Automation`. * * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_missing = false; + protected $allow_missing = false; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Deploy\V1\Automation $automation Required. The `Automation` to update. diff --git a/Deploy/src/V1/UpdateCustomTargetTypeRequest.php b/Deploy/src/V1/UpdateCustomTargetTypeRequest.php index 0dafd5aee52d..f6bcbf1d6395 100644 --- a/Deploy/src/V1/UpdateCustomTargetTypeRequest.php +++ b/Deploy/src/V1/UpdateCustomTargetTypeRequest.php @@ -24,13 +24,13 @@ class UpdateCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The `CustomTargetType` to update. * * Generated from protobuf field .google.cloud.deploy.v1.CustomTargetType custom_target_type = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $custom_target_type = null; + protected $custom_target_type = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -46,21 +46,21 @@ class UpdateCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, updating a `CustomTargetType` that does not exist * will result in the creation of a new `CustomTargetType`. * * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_missing = false; + protected $allow_missing = false; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Deploy\V1\CustomTargetType $customTargetType Required. The `CustomTargetType` to update. diff --git a/Deploy/src/V1/UpdateDeliveryPipelineRequest.php b/Deploy/src/V1/UpdateDeliveryPipelineRequest.php index 1d69916211f5..dea1172e93e5 100644 --- a/Deploy/src/V1/UpdateDeliveryPipelineRequest.php +++ b/Deploy/src/V1/UpdateDeliveryPipelineRequest.php @@ -24,13 +24,13 @@ class UpdateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The `DeliveryPipeline` to update. * * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $delivery_pipeline = null; + protected $delivery_pipeline = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -46,21 +46,21 @@ class UpdateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, updating a `DeliveryPipeline` that does not exist * will result in the creation of a new `DeliveryPipeline`. * * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_missing = false; + protected $allow_missing = false; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Deploy\V1\DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to update. diff --git a/Deploy/src/V1/UpdateTargetRequest.php b/Deploy/src/V1/UpdateTargetRequest.php index d50f7101103c..7823d7339fdd 100644 --- a/Deploy/src/V1/UpdateTargetRequest.php +++ b/Deploy/src/V1/UpdateTargetRequest.php @@ -24,13 +24,13 @@ class UpdateTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The `Target` to update. * * Generated from protobuf field .google.cloud.deploy.v1.Target target = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $target = null; + protected $target = null; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -46,21 +46,21 @@ class UpdateTargetRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. If set to true, updating a `Target` that does not exist will * result in the creation of a new `Target`. * * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $allow_missing = false; + protected $allow_missing = false; /** * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $validate_only = false; + protected $validate_only = false; /** * @param \Google\Cloud\Deploy\V1\Target $target Required. The `Target` to update. diff --git a/Deploy/src/V1/VerifyJobRun.php b/Deploy/src/V1/VerifyJobRun.php index a3442a60bc4d..71c2c05ff0a9 100644 --- a/Deploy/src/V1/VerifyJobRun.php +++ b/Deploy/src/V1/VerifyJobRun.php @@ -22,34 +22,34 @@ class VerifyJobRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $build = ''; + protected $build = ''; /** * Output only. URI of a directory containing the verify artifacts. This * contains the Skaffold event log. * * Generated from protobuf field string artifact_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $artifact_uri = ''; + protected $artifact_uri = ''; /** * Output only. File path of the Skaffold event log relative to the artifact * URI. * * Generated from protobuf field string event_log_path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $event_log_path = ''; + protected $event_log_path = ''; /** * Output only. The reason the verify failed. This will always be unspecified * while the verify is in progress or if it succeeded. * * Generated from protobuf field .google.cloud.deploy.v1.VerifyJobRun.FailureCause failure_cause = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_cause = 0; + protected $failure_cause = 0; /** * Output only. Additional information about the verify failure, if available. * * Generated from protobuf field string failure_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_message = ''; + protected $failure_message = ''; /** * Constructor. diff --git a/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php b/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php index 045098db6bae..f0572c7f722d 100644 --- a/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php +++ b/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return CloudDeployClient */ @@ -153,8 +155,7 @@ public function abandonReleaseTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $request = (new AbandonReleaseRequest()) - ->setName($formattedName); + $request = (new AbandonReleaseRequest())->setName($formattedName); $response = $gapicClient->abandonRelease($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -178,17 +179,19 @@ public function abandonReleaseExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $request = (new AbandonReleaseRequest()) - ->setName($formattedName); + $request = (new AbandonReleaseRequest())->setName($formattedName); try { $gapicClient->abandonRelease($request); // If the $gapicClient method call did not throw, fail the test @@ -214,11 +217,15 @@ public function advanceRolloutTest() $expectedResponse = new AdvanceRolloutResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $formattedName = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); $phaseId = 'phaseId-1676299681'; - $request = (new AdvanceRolloutRequest()) - ->setName($formattedName) - ->setPhaseId($phaseId); + $request = (new AdvanceRolloutRequest())->setName($formattedName)->setPhaseId($phaseId); $response = $gapicClient->advanceRollout($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -244,19 +251,26 @@ public function advanceRolloutExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $formattedName = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); $phaseId = 'phaseId-1676299681'; - $request = (new AdvanceRolloutRequest()) - ->setName($formattedName) - ->setPhaseId($phaseId); + $request = (new AdvanceRolloutRequest())->setName($formattedName)->setPhaseId($phaseId); try { $gapicClient->advanceRollout($request); // If the $gapicClient method call did not throw, fail the test @@ -282,11 +296,15 @@ public function approveRolloutTest() $expectedResponse = new ApproveRolloutResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $formattedName = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); $approved = false; - $request = (new ApproveRolloutRequest()) - ->setName($formattedName) - ->setApproved($approved); + $request = (new ApproveRolloutRequest())->setName($formattedName)->setApproved($approved); $response = $gapicClient->approveRollout($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -312,19 +330,26 @@ public function approveRolloutExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $formattedName = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); $approved = false; - $request = (new ApproveRolloutRequest()) - ->setName($formattedName) - ->setApproved($approved); + $request = (new ApproveRolloutRequest())->setName($formattedName)->setApproved($approved); try { $gapicClient->approveRollout($request); // If the $gapicClient method call did not throw, fail the test @@ -350,9 +375,13 @@ public function cancelAutomationRunTest() $expectedResponse = new CancelAutomationRunResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - $request = (new CancelAutomationRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->automationRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[AUTOMATION_RUN]' + ); + $request = (new CancelAutomationRunRequest())->setName($formattedName); $response = $gapicClient->cancelAutomationRun($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -376,17 +405,24 @@ public function cancelAutomationRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - $request = (new CancelAutomationRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->automationRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[AUTOMATION_RUN]' + ); + $request = (new CancelAutomationRunRequest())->setName($formattedName); try { $gapicClient->cancelAutomationRun($request); // If the $gapicClient method call did not throw, fail the test @@ -412,9 +448,14 @@ public function cancelRolloutTest() $expectedResponse = new CancelRolloutResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $request = (new CancelRolloutRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); + $request = (new CancelRolloutRequest())->setName($formattedName); $response = $gapicClient->cancelRollout($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -438,17 +479,25 @@ public function cancelRolloutExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $request = (new CancelRolloutRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); + $request = (new CancelRolloutRequest())->setName($formattedName); try { $gapicClient->cancelRollout($request); // If the $gapicClient method call did not throw, fail the test @@ -576,12 +625,15 @@ public function createAutomationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); @@ -725,12 +777,15 @@ public function createCustomTargetTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -868,12 +923,15 @@ public function createDeliveryPipelineExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -1017,12 +1075,15 @@ public function createReleaseExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); @@ -1170,12 +1231,15 @@ public function createRolloutExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); @@ -1317,12 +1381,15 @@ public function createTargetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -1385,8 +1452,7 @@ public function deleteAutomationTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - $request = (new DeleteAutomationRequest()) - ->setName($formattedName); + $request = (new DeleteAutomationRequest())->setName($formattedName); $response = $gapicClient->deleteAutomation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1442,17 +1508,19 @@ public function deleteAutomationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - $request = (new DeleteAutomationRequest()) - ->setName($formattedName); + $request = (new DeleteAutomationRequest())->setName($formattedName); $response = $gapicClient->deleteAutomation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1506,8 +1574,7 @@ public function deleteCustomTargetTypeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - $request = (new DeleteCustomTargetTypeRequest()) - ->setName($formattedName); + $request = (new DeleteCustomTargetTypeRequest())->setName($formattedName); $response = $gapicClient->deleteCustomTargetType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1563,17 +1630,19 @@ public function deleteCustomTargetTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - $request = (new DeleteCustomTargetTypeRequest()) - ->setName($formattedName); + $request = (new DeleteCustomTargetTypeRequest())->setName($formattedName); $response = $gapicClient->deleteCustomTargetType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1627,8 +1696,7 @@ public function deleteDeliveryPipelineTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new DeleteDeliveryPipelineRequest()) - ->setName($formattedName); + $request = (new DeleteDeliveryPipelineRequest())->setName($formattedName); $response = $gapicClient->deleteDeliveryPipeline($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1684,17 +1752,19 @@ public function deleteDeliveryPipelineExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new DeleteDeliveryPipelineRequest()) - ->setName($formattedName); + $request = (new DeleteDeliveryPipelineRequest())->setName($formattedName); $response = $gapicClient->deleteDeliveryPipeline($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1748,8 +1818,7 @@ public function deleteTargetTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $request = (new DeleteTargetRequest()) - ->setName($formattedName); + $request = (new DeleteTargetRequest())->setName($formattedName); $response = $gapicClient->deleteTarget($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1805,17 +1874,19 @@ public function deleteTargetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $request = (new DeleteTargetRequest()) - ->setName($formattedName); + $request = (new DeleteTargetRequest())->setName($formattedName); $response = $gapicClient->deleteTarget($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1863,8 +1934,7 @@ public function getAutomationTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - $request = (new GetAutomationRequest()) - ->setName($formattedName); + $request = (new GetAutomationRequest())->setName($formattedName); $response = $gapicClient->getAutomation($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1888,17 +1958,19 @@ public function getAutomationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - $request = (new GetAutomationRequest()) - ->setName($formattedName); + $request = (new GetAutomationRequest())->setName($formattedName); try { $gapicClient->getAutomation($request); // If the $gapicClient method call did not throw, fail the test @@ -1938,9 +2010,13 @@ public function getAutomationRunTest() $expectedResponse->setAutomationId($automationId); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - $request = (new GetAutomationRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->automationRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[AUTOMATION_RUN]' + ); + $request = (new GetAutomationRunRequest())->setName($formattedName); $response = $gapicClient->getAutomationRun($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1964,17 +2040,24 @@ public function getAutomationRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - $request = (new GetAutomationRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->automationRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[AUTOMATION_RUN]' + ); + $request = (new GetAutomationRunRequest())->setName($formattedName); try { $gapicClient->getAutomationRun($request); // If the $gapicClient method call did not throw, fail the test @@ -2005,8 +2088,7 @@ public function getConfigTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]'); - $request = (new GetConfigRequest()) - ->setName($formattedName); + $request = (new GetConfigRequest())->setName($formattedName); $response = $gapicClient->getConfig($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2030,17 +2112,19 @@ public function getConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]'); - $request = (new GetConfigRequest()) - ->setName($formattedName); + $request = (new GetConfigRequest())->setName($formattedName); try { $gapicClient->getConfig($request); // If the $gapicClient method call did not throw, fail the test @@ -2077,8 +2161,7 @@ public function getCustomTargetTypeTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - $request = (new GetCustomTargetTypeRequest()) - ->setName($formattedName); + $request = (new GetCustomTargetTypeRequest())->setName($formattedName); $response = $gapicClient->getCustomTargetType($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2102,17 +2185,19 @@ public function getCustomTargetTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - $request = (new GetCustomTargetTypeRequest()) - ->setName($formattedName); + $request = (new GetCustomTargetTypeRequest())->setName($formattedName); try { $gapicClient->getCustomTargetType($request); // If the $gapicClient method call did not throw, fail the test @@ -2149,8 +2234,7 @@ public function getDeliveryPipelineTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new GetDeliveryPipelineRequest()) - ->setName($formattedName); + $request = (new GetDeliveryPipelineRequest())->setName($formattedName); $response = $gapicClient->getDeliveryPipeline($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2174,17 +2258,19 @@ public function getDeliveryPipelineExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new GetDeliveryPipelineRequest()) - ->setName($formattedName); + $request = (new GetDeliveryPipelineRequest())->setName($formattedName); try { $gapicClient->getDeliveryPipeline($request); // If the $gapicClient method call did not throw, fail the test @@ -2220,9 +2306,15 @@ public function getJobRunTest() $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - $request = (new GetJobRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->jobRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]', + '[JOB_RUN]' + ); + $request = (new GetJobRunRequest())->setName($formattedName); $response = $gapicClient->getJobRun($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2246,17 +2338,26 @@ public function getJobRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - $request = (new GetJobRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->jobRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]', + '[JOB_RUN]' + ); + $request = (new GetJobRunRequest())->setName($formattedName); try { $gapicClient->getJobRun($request); // If the $gapicClient method call did not throw, fail the test @@ -2299,8 +2400,7 @@ public function getReleaseTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $request = (new GetReleaseRequest()) - ->setName($formattedName); + $request = (new GetReleaseRequest())->setName($formattedName); $response = $gapicClient->getRelease($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2324,17 +2424,19 @@ public function getReleaseExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $request = (new GetReleaseRequest()) - ->setName($formattedName); + $request = (new GetReleaseRequest())->setName($formattedName); try { $gapicClient->getRelease($request); // If the $gapicClient method call did not throw, fail the test @@ -2378,9 +2480,14 @@ public function getRolloutTest() $expectedResponse->setRollbackOfRollout($rollbackOfRollout); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $request = (new GetRolloutRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); + $request = (new GetRolloutRequest())->setName($formattedName); $response = $gapicClient->getRollout($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2404,17 +2511,25 @@ public function getRolloutExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $request = (new GetRolloutRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); + $request = (new GetRolloutRequest())->setName($formattedName); try { $gapicClient->getRollout($request); // If the $gapicClient method call did not throw, fail the test @@ -2453,8 +2568,7 @@ public function getTargetTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $request = (new GetTargetRequest()) - ->setName($formattedName); + $request = (new GetTargetRequest())->setName($formattedName); $response = $gapicClient->getTarget($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2478,17 +2592,19 @@ public function getTargetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $request = (new GetTargetRequest()) - ->setName($formattedName); + $request = (new GetTargetRequest())->setName($formattedName); try { $gapicClient->getTarget($request); // If the $gapicClient method call did not throw, fail the test @@ -2514,7 +2630,13 @@ public function ignoreJobTest() $expectedResponse = new IgnoreJobResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $formattedRollout = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); $phaseId = 'phaseId-1676299681'; $jobId = 'jobId-1154752291'; $request = (new IgnoreJobRequest()) @@ -2548,15 +2670,24 @@ public function ignoreJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $formattedRollout = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); $phaseId = 'phaseId-1676299681'; $jobId = 'jobId-1154752291'; $request = (new IgnoreJobRequest()) @@ -2587,17 +2718,14 @@ public function listAutomationRunsTest() // Mock response $nextPageToken = ''; $automationRunsElement = new AutomationRun(); - $automationRuns = [ - $automationRunsElement, - ]; + $automationRuns = [$automationRunsElement]; $expectedResponse = new ListAutomationRunsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAutomationRuns($automationRuns); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new ListAutomationRunsRequest()) - ->setParent($formattedParent); + $request = (new ListAutomationRunsRequest())->setParent($formattedParent); $response = $gapicClient->listAutomationRuns($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2624,17 +2752,19 @@ public function listAutomationRunsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new ListAutomationRunsRequest()) - ->setParent($formattedParent); + $request = (new ListAutomationRunsRequest())->setParent($formattedParent); try { $gapicClient->listAutomationRuns($request); // If the $gapicClient method call did not throw, fail the test @@ -2659,17 +2789,14 @@ public function listAutomationsTest() // Mock response $nextPageToken = ''; $automationsElement = new Automation(); - $automations = [ - $automationsElement, - ]; + $automations = [$automationsElement]; $expectedResponse = new ListAutomationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAutomations($automations); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new ListAutomationsRequest()) - ->setParent($formattedParent); + $request = (new ListAutomationsRequest())->setParent($formattedParent); $response = $gapicClient->listAutomations($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2696,17 +2823,19 @@ public function listAutomationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new ListAutomationsRequest()) - ->setParent($formattedParent); + $request = (new ListAutomationsRequest())->setParent($formattedParent); try { $gapicClient->listAutomations($request); // If the $gapicClient method call did not throw, fail the test @@ -2731,17 +2860,14 @@ public function listCustomTargetTypesTest() // Mock response $nextPageToken = ''; $customTargetTypesElement = new CustomTargetType(); - $customTargetTypes = [ - $customTargetTypesElement, - ]; + $customTargetTypes = [$customTargetTypesElement]; $expectedResponse = new ListCustomTargetTypesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCustomTargetTypes($customTargetTypes); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListCustomTargetTypesRequest()) - ->setParent($formattedParent); + $request = (new ListCustomTargetTypesRequest())->setParent($formattedParent); $response = $gapicClient->listCustomTargetTypes($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2768,17 +2894,19 @@ public function listCustomTargetTypesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListCustomTargetTypesRequest()) - ->setParent($formattedParent); + $request = (new ListCustomTargetTypesRequest())->setParent($formattedParent); try { $gapicClient->listCustomTargetTypes($request); // If the $gapicClient method call did not throw, fail the test @@ -2803,17 +2931,14 @@ public function listDeliveryPipelinesTest() // Mock response $nextPageToken = ''; $deliveryPipelinesElement = new DeliveryPipeline(); - $deliveryPipelines = [ - $deliveryPipelinesElement, - ]; + $deliveryPipelines = [$deliveryPipelinesElement]; $expectedResponse = new ListDeliveryPipelinesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDeliveryPipelines($deliveryPipelines); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDeliveryPipelinesRequest()) - ->setParent($formattedParent); + $request = (new ListDeliveryPipelinesRequest())->setParent($formattedParent); $response = $gapicClient->listDeliveryPipelines($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2840,17 +2965,19 @@ public function listDeliveryPipelinesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListDeliveryPipelinesRequest()) - ->setParent($formattedParent); + $request = (new ListDeliveryPipelinesRequest())->setParent($formattedParent); try { $gapicClient->listDeliveryPipelines($request); // If the $gapicClient method call did not throw, fail the test @@ -2875,17 +3002,20 @@ public function listJobRunsTest() // Mock response $nextPageToken = ''; $jobRunsElement = new JobRun(); - $jobRuns = [ - $jobRunsElement, - ]; + $jobRuns = [$jobRunsElement]; $expectedResponse = new ListJobRunsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setJobRuns($jobRuns); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $request = (new ListJobRunsRequest()) - ->setParent($formattedParent); + $formattedParent = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); + $request = (new ListJobRunsRequest())->setParent($formattedParent); $response = $gapicClient->listJobRuns($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2912,17 +3042,25 @@ public function listJobRunsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $request = (new ListJobRunsRequest()) - ->setParent($formattedParent); + $formattedParent = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); + $request = (new ListJobRunsRequest())->setParent($formattedParent); try { $gapicClient->listJobRuns($request); // If the $gapicClient method call did not throw, fail the test @@ -2947,17 +3085,14 @@ public function listReleasesTest() // Mock response $nextPageToken = ''; $releasesElement = new Release(); - $releases = [ - $releasesElement, - ]; + $releases = [$releasesElement]; $expectedResponse = new ListReleasesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setReleases($releases); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new ListReleasesRequest()) - ->setParent($formattedParent); + $request = (new ListReleasesRequest())->setParent($formattedParent); $response = $gapicClient->listReleases($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2984,17 +3119,19 @@ public function listReleasesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new ListReleasesRequest()) - ->setParent($formattedParent); + $request = (new ListReleasesRequest())->setParent($formattedParent); try { $gapicClient->listReleases($request); // If the $gapicClient method call did not throw, fail the test @@ -3019,17 +3156,14 @@ public function listRolloutsTest() // Mock response $nextPageToken = ''; $rolloutsElement = new Rollout(); - $rollouts = [ - $rolloutsElement, - ]; + $rollouts = [$rolloutsElement]; $expectedResponse = new ListRolloutsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRollouts($rollouts); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $request = (new ListRolloutsRequest()) - ->setParent($formattedParent); + $request = (new ListRolloutsRequest())->setParent($formattedParent); $response = $gapicClient->listRollouts($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3056,17 +3190,19 @@ public function listRolloutsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $request = (new ListRolloutsRequest()) - ->setParent($formattedParent); + $request = (new ListRolloutsRequest())->setParent($formattedParent); try { $gapicClient->listRollouts($request); // If the $gapicClient method call did not throw, fail the test @@ -3091,17 +3227,14 @@ public function listTargetsTest() // Mock response $nextPageToken = ''; $targetsElement = new Target(); - $targets = [ - $targetsElement, - ]; + $targets = [$targetsElement]; $expectedResponse = new ListTargetsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTargets($targets); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListTargetsRequest()) - ->setParent($formattedParent); + $request = (new ListTargetsRequest())->setParent($formattedParent); $response = $gapicClient->listTargets($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3128,17 +3261,19 @@ public function listTargetsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListTargetsRequest()) - ->setParent($formattedParent); + $request = (new ListTargetsRequest())->setParent($formattedParent); try { $gapicClient->listTargets($request); // If the $gapicClient method call did not throw, fail the test @@ -3164,7 +3299,13 @@ public function retryJobTest() $expectedResponse = new RetryJobResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $formattedRollout = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); $phaseId = 'phaseId-1676299681'; $jobId = 'jobId-1154752291'; $request = (new RetryJobRequest()) @@ -3198,15 +3339,24 @@ public function retryJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $formattedRollout = $gapicClient->rolloutName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]' + ); $phaseId = 'phaseId-1676299681'; $jobId = 'jobId-1154752291'; $request = (new RetryJobRequest()) @@ -3272,12 +3422,15 @@ public function rollbackTargetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); @@ -3312,9 +3465,15 @@ public function terminateJobRunTest() $expectedResponse = new TerminateJobRunResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - $request = (new TerminateJobRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->jobRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]', + '[JOB_RUN]' + ); + $request = (new TerminateJobRunRequest())->setName($formattedName); $response = $gapicClient->terminateJobRun($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3338,17 +3497,26 @@ public function terminateJobRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - $request = (new TerminateJobRunRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->jobRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[RELEASE]', + '[ROLLOUT]', + '[JOB_RUN]' + ); + $request = (new TerminateJobRunRequest())->setName($formattedName); try { $gapicClient->terminateJobRun($request); // If the $gapicClient method call did not throw, fail the test @@ -3412,9 +3580,7 @@ public function updateAutomationTest() $automation->setSelector($automationSelector); $automationRules = []; $automation->setRules($automationRules); - $request = (new UpdateAutomationRequest()) - ->setUpdateMask($updateMask) - ->setAutomation($automation); + $request = (new UpdateAutomationRequest())->setUpdateMask($updateMask)->setAutomation($automation); $response = $gapicClient->updateAutomation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3472,12 +3638,15 @@ public function updateAutomationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -3488,9 +3657,7 @@ public function updateAutomationExceptionTest() $automation->setSelector($automationSelector); $automationRules = []; $automation->setRules($automationRules); - $request = (new UpdateAutomationRequest()) - ->setUpdateMask($updateMask) - ->setAutomation($automation); + $request = (new UpdateAutomationRequest())->setUpdateMask($updateMask)->setAutomation($automation); $response = $gapicClient->updateAutomation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3615,12 +3782,15 @@ public function updateCustomTargetTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -3752,12 +3922,15 @@ public function updateDeliveryPipelineExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); @@ -3831,9 +4004,7 @@ public function updateTargetTest() // Mock request $updateMask = new FieldMask(); $target = new Target(); - $request = (new UpdateTargetRequest()) - ->setUpdateMask($updateMask) - ->setTarget($target); + $request = (new UpdateTargetRequest())->setUpdateMask($updateMask)->setTarget($target); $response = $gapicClient->updateTarget($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3891,19 +4062,20 @@ public function updateTargetExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $target = new Target(); - $request = (new UpdateTargetRequest()) - ->setUpdateMask($updateMask) - ->setTarget($target); + $request = (new UpdateTargetRequest())->setUpdateMask($updateMask)->setTarget($target); $response = $gapicClient->updateTarget($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3965,12 +4137,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -3997,9 +4172,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -4029,12 +4202,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -4067,8 +4243,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -4092,17 +4267,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -4134,9 +4311,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -4162,19 +4337,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -4202,9 +4378,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -4230,19 +4404,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -4269,8 +4444,7 @@ public function abandonReleaseAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $request = (new AbandonReleaseRequest()) - ->setName($formattedName); + $request = (new AbandonReleaseRequest())->setName($formattedName); $response = $gapicClient->abandonReleaseAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/Deploy/tests/Unit/V1/CloudDeployClientTest.php b/Deploy/tests/Unit/V1/CloudDeployClientTest.php deleted file mode 100644 index 3cd55d0cd3c8..000000000000 --- a/Deploy/tests/Unit/V1/CloudDeployClientTest.php +++ /dev/null @@ -1,3985 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudDeployClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudDeployClient($options); - } - - /** @test */ - public function abandonReleaseTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AbandonReleaseResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $response = $gapicClient->abandonRelease($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/AbandonRelease', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function abandonReleaseExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - try { - $gapicClient->abandonRelease($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function advanceRolloutTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AdvanceRolloutResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $phaseId = 'phaseId-1676299681'; - $response = $gapicClient->advanceRollout($formattedName, $phaseId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/AdvanceRollout', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getPhaseId(); - $this->assertProtobufEquals($phaseId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function advanceRolloutExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $phaseId = 'phaseId-1676299681'; - try { - $gapicClient->advanceRollout($formattedName, $phaseId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function approveRolloutTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ApproveRolloutResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $approved = false; - $response = $gapicClient->approveRollout($formattedName, $approved); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ApproveRollout', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getApproved(); - $this->assertProtobufEquals($approved, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function approveRolloutExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $approved = false; - try { - $gapicClient->approveRollout($formattedName, $approved); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelAutomationRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new CancelAutomationRunResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - $response = $gapicClient->cancelAutomationRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CancelAutomationRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelAutomationRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - try { - $gapicClient->cancelAutomationRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelRolloutTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new CancelRolloutResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $response = $gapicClient->cancelRollout($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CancelRollout', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelRolloutExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - try { - $gapicClient->cancelRollout($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createAutomationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createAutomationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $suspended = false; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Automation(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setSuspended($suspended); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createAutomationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $automationId = 'automationId1989390659'; - $automation = new Automation(); - $automationServiceAccount = 'automationServiceAccount-192216401'; - $automation->setServiceAccount($automationServiceAccount); - $automationSelector = new AutomationResourceSelector(); - $automation->setSelector($automationSelector); - $automationRules = []; - $automation->setRules($automationRules); - $response = $gapicClient->createAutomation($formattedParent, $automationId, $automation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateAutomation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getAutomationId(); - $this->assertProtobufEquals($automationId, $actualValue); - $actualValue = $actualApiRequestObject->getAutomation(); - $this->assertProtobufEquals($automation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAutomationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createAutomationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createAutomationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $automationId = 'automationId1989390659'; - $automation = new Automation(); - $automationServiceAccount = 'automationServiceAccount-192216401'; - $automation->setServiceAccount($automationServiceAccount); - $automationSelector = new AutomationResourceSelector(); - $automation->setSelector($automationSelector); - $automationRules = []; - $automation->setRules($automationRules); - $response = $gapicClient->createAutomation($formattedParent, $automationId, $automation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createAutomationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createCustomTargetTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createCustomTargetTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $customTargetTypeId2 = 'customTargetTypeId2-1392620077'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new CustomTargetType(); - $expectedResponse->setName($name); - $expectedResponse->setCustomTargetTypeId($customTargetTypeId2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createCustomTargetTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $customTargetTypeId = 'customTargetTypeId-2048374240'; - $customTargetType = new CustomTargetType(); - $response = $gapicClient->createCustomTargetType($formattedParent, $customTargetTypeId, $customTargetType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateCustomTargetType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getCustomTargetTypeId(); - $this->assertProtobufEquals($customTargetTypeId, $actualValue); - $actualValue = $actualApiRequestObject->getCustomTargetType(); - $this->assertProtobufEquals($customTargetType, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createCustomTargetTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createCustomTargetTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createCustomTargetTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $customTargetTypeId = 'customTargetTypeId-2048374240'; - $customTargetType = new CustomTargetType(); - $response = $gapicClient->createCustomTargetType($formattedParent, $customTargetTypeId, $customTargetType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createCustomTargetTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDeliveryPipelineTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDeliveryPipelineTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $suspended = false; - $expectedResponse = new DeliveryPipeline(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setSuspended($suspended); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDeliveryPipelineTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $deliveryPipelineId = 'deliveryPipelineId1972590605'; - $deliveryPipeline = new DeliveryPipeline(); - $response = $gapicClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateDeliveryPipeline', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDeliveryPipelineId(); - $this->assertProtobufEquals($deliveryPipelineId, $actualValue); - $actualValue = $actualApiRequestObject->getDeliveryPipeline(); - $this->assertProtobufEquals($deliveryPipeline, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDeliveryPipelineTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDeliveryPipelineExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDeliveryPipelineTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $deliveryPipelineId = 'deliveryPipelineId1972590605'; - $deliveryPipeline = new DeliveryPipeline(); - $response = $gapicClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDeliveryPipelineTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createReleaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createReleaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $abandoned = true; - $skaffoldConfigUri = 'skaffoldConfigUri-860592176'; - $skaffoldConfigPath = 'skaffoldConfigPath-908718527'; - $etag = 'etag3123477'; - $skaffoldVersion = 'skaffoldVersion-1146663017'; - $expectedResponse = new Release(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setAbandoned($abandoned); - $expectedResponse->setSkaffoldConfigUri($skaffoldConfigUri); - $expectedResponse->setSkaffoldConfigPath($skaffoldConfigPath); - $expectedResponse->setEtag($etag); - $expectedResponse->setSkaffoldVersion($skaffoldVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createReleaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $releaseId = 'releaseId-1517127597'; - $release = new Release(); - $response = $gapicClient->createRelease($formattedParent, $releaseId, $release); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateRelease', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getReleaseId(); - $this->assertProtobufEquals($releaseId, $actualValue); - $actualValue = $actualApiRequestObject->getRelease(); - $this->assertProtobufEquals($release, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createReleaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createReleaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createReleaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $releaseId = 'releaseId-1517127597'; - $release = new Release(); - $response = $gapicClient->createRelease($formattedParent, $releaseId, $release); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createReleaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createRolloutTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createRolloutTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $targetId = 'targetId-815576439'; - $failureReason = 'failureReason1743941273'; - $deployingBuild = 'deployingBuild931623626'; - $etag = 'etag3123477'; - $controllerRollout = 'controllerRollout-146558962'; - $rollbackOfRollout = 'rollbackOfRollout-1880699004'; - $expectedResponse = new Rollout(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setTargetId($targetId); - $expectedResponse->setFailureReason($failureReason); - $expectedResponse->setDeployingBuild($deployingBuild); - $expectedResponse->setEtag($etag); - $expectedResponse->setControllerRollout($controllerRollout); - $expectedResponse->setRollbackOfRollout($rollbackOfRollout); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createRolloutTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $rolloutId = 'rolloutId-91142551'; - $rollout = new Rollout(); - $rolloutTargetId = 'rolloutTargetId509050717'; - $rollout->setTargetId($rolloutTargetId); - $response = $gapicClient->createRollout($formattedParent, $rolloutId, $rollout); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateRollout', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRolloutId(); - $this->assertProtobufEquals($rolloutId, $actualValue); - $actualValue = $actualApiRequestObject->getRollout(); - $this->assertProtobufEquals($rollout, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRolloutTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createRolloutExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createRolloutTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $rolloutId = 'rolloutId-91142551'; - $rollout = new Rollout(); - $rolloutTargetId = 'rolloutTargetId509050717'; - $rollout->setTargetId($rolloutTargetId); - $response = $gapicClient->createRollout($formattedParent, $rolloutId, $rollout); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRolloutTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTargetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTargetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $targetId2 = 'targetId2-2084907012'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $requireApproval = false; - $etag = 'etag3123477'; - $expectedResponse = new Target(); - $expectedResponse->setName($name); - $expectedResponse->setTargetId($targetId2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setRequireApproval($requireApproval); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTargetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $targetId = 'targetId-815576439'; - $target = new Target(); - $response = $gapicClient->createTarget($formattedParent, $targetId, $target); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateTarget', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTargetId(); - $this->assertProtobufEquals($targetId, $actualValue); - $actualValue = $actualApiRequestObject->getTarget(); - $this->assertProtobufEquals($target, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTargetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTargetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTargetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $targetId = 'targetId-815576439'; - $target = new Target(); - $response = $gapicClient->createTarget($formattedParent, $targetId, $target); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTargetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteAutomationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteAutomationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteAutomationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - $response = $gapicClient->deleteAutomation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteAutomation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteAutomationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteAutomationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteAutomationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - $response = $gapicClient->deleteAutomation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteAutomationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteCustomTargetTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteCustomTargetTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteCustomTargetTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - $response = $gapicClient->deleteCustomTargetType($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteCustomTargetType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteCustomTargetTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteCustomTargetTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteCustomTargetTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - $response = $gapicClient->deleteCustomTargetType($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteCustomTargetTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDeliveryPipelineTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDeliveryPipelineTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $response = $gapicClient->deleteDeliveryPipeline($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteDeliveryPipeline', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDeliveryPipelineExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $response = $gapicClient->deleteDeliveryPipeline($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTargetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTargetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $response = $gapicClient->deleteTarget($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteTarget', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTargetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $response = $gapicClient->deleteTarget($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getAutomationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $suspended = false; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Automation(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setSuspended($suspended); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - $response = $gapicClient->getAutomation($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetAutomation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAutomationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); - try { - $gapicClient->getAutomation($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAutomationRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $serviceAccount = 'serviceAccount-1948028253'; - $targetId = 'targetId-815576439'; - $stateDescription = 'stateDescription1692226894'; - $ruleId = 'ruleId1548659006'; - $automationId = 'automationId1989390659'; - $expectedResponse = new AutomationRun(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setTargetId($targetId); - $expectedResponse->setStateDescription($stateDescription); - $expectedResponse->setRuleId($ruleId); - $expectedResponse->setAutomationId($automationId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - $response = $gapicClient->getAutomationRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetAutomationRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAutomationRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); - try { - $gapicClient->getAutomationRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $defaultSkaffoldVersion = 'defaultSkaffoldVersion1930298837'; - $expectedResponse = new Config(); - $expectedResponse->setName($name2); - $expectedResponse->setDefaultSkaffoldVersion($defaultSkaffoldVersion); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->getConfig($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->getConfig($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCustomTargetTypeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $customTargetTypeId = 'customTargetTypeId-2048374240'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new CustomTargetType(); - $expectedResponse->setName($name2); - $expectedResponse->setCustomTargetTypeId($customTargetTypeId); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - $response = $gapicClient->getCustomTargetType($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetCustomTargetType', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCustomTargetTypeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]'); - try { - $gapicClient->getCustomTargetType($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDeliveryPipelineTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $suspended = false; - $expectedResponse = new DeliveryPipeline(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setSuspended($suspended); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $response = $gapicClient->getDeliveryPipeline($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetDeliveryPipeline', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDeliveryPipelineExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - try { - $gapicClient->getDeliveryPipeline($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $phaseId = 'phaseId-1676299681'; - $jobId = 'jobId-1154752291'; - $etag = 'etag3123477'; - $expectedResponse = new JobRun(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setPhaseId($phaseId); - $expectedResponse->setJobId($jobId); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - $response = $gapicClient->getJobRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetJobRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - try { - $gapicClient->getJobRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getReleaseTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $abandoned = true; - $skaffoldConfigUri = 'skaffoldConfigUri-860592176'; - $skaffoldConfigPath = 'skaffoldConfigPath-908718527'; - $etag = 'etag3123477'; - $skaffoldVersion = 'skaffoldVersion-1146663017'; - $expectedResponse = new Release(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setAbandoned($abandoned); - $expectedResponse->setSkaffoldConfigUri($skaffoldConfigUri); - $expectedResponse->setSkaffoldConfigPath($skaffoldConfigPath); - $expectedResponse->setEtag($etag); - $expectedResponse->setSkaffoldVersion($skaffoldVersion); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $response = $gapicClient->getRelease($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetRelease', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getReleaseExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - try { - $gapicClient->getRelease($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRolloutTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $targetId = 'targetId-815576439'; - $failureReason = 'failureReason1743941273'; - $deployingBuild = 'deployingBuild931623626'; - $etag = 'etag3123477'; - $controllerRollout = 'controllerRollout-146558962'; - $rollbackOfRollout = 'rollbackOfRollout-1880699004'; - $expectedResponse = new Rollout(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setTargetId($targetId); - $expectedResponse->setFailureReason($failureReason); - $expectedResponse->setDeployingBuild($deployingBuild); - $expectedResponse->setEtag($etag); - $expectedResponse->setControllerRollout($controllerRollout); - $expectedResponse->setRollbackOfRollout($rollbackOfRollout); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $response = $gapicClient->getRollout($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetRollout', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRolloutExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - try { - $gapicClient->getRollout($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTargetTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $targetId = 'targetId-815576439'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $requireApproval = false; - $etag = 'etag3123477'; - $expectedResponse = new Target(); - $expectedResponse->setName($name2); - $expectedResponse->setTargetId($targetId); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setRequireApproval($requireApproval); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $response = $gapicClient->getTarget($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetTarget', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTargetExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - try { - $gapicClient->getTarget($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function ignoreJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new IgnoreJobResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $phaseId = 'phaseId-1676299681'; - $jobId = 'jobId-1154752291'; - $response = $gapicClient->ignoreJob($formattedRollout, $phaseId, $jobId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/IgnoreJob', $actualFuncCall); - $actualValue = $actualRequestObject->getRollout(); - $this->assertProtobufEquals($formattedRollout, $actualValue); - $actualValue = $actualRequestObject->getPhaseId(); - $this->assertProtobufEquals($phaseId, $actualValue); - $actualValue = $actualRequestObject->getJobId(); - $this->assertProtobufEquals($jobId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function ignoreJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $phaseId = 'phaseId-1676299681'; - $jobId = 'jobId-1154752291'; - try { - $gapicClient->ignoreJob($formattedRollout, $phaseId, $jobId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAutomationRunsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $automationRunsElement = new AutomationRun(); - $automationRuns = [ - $automationRunsElement, - ]; - $expectedResponse = new ListAutomationRunsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAutomationRuns($automationRuns); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $response = $gapicClient->listAutomationRuns($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAutomationRuns()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListAutomationRuns', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAutomationRunsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - try { - $gapicClient->listAutomationRuns($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAutomationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $automationsElement = new Automation(); - $automations = [ - $automationsElement, - ]; - $expectedResponse = new ListAutomationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAutomations($automations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $response = $gapicClient->listAutomations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAutomations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListAutomations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAutomationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - try { - $gapicClient->listAutomations($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCustomTargetTypesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $customTargetTypesElement = new CustomTargetType(); - $customTargetTypes = [ - $customTargetTypesElement, - ]; - $expectedResponse = new ListCustomTargetTypesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCustomTargetTypes($customTargetTypes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listCustomTargetTypes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCustomTargetTypes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListCustomTargetTypes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCustomTargetTypesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listCustomTargetTypes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDeliveryPipelinesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $deliveryPipelinesElement = new DeliveryPipeline(); - $deliveryPipelines = [ - $deliveryPipelinesElement, - ]; - $expectedResponse = new ListDeliveryPipelinesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDeliveryPipelines($deliveryPipelines); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listDeliveryPipelines($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDeliveryPipelines()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListDeliveryPipelines', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDeliveryPipelinesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listDeliveryPipelines($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobRunsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobRunsElement = new JobRun(); - $jobRuns = [ - $jobRunsElement, - ]; - $expectedResponse = new ListJobRunsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobRuns($jobRuns); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $response = $gapicClient->listJobRuns($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobRuns()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListJobRuns', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobRunsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - try { - $gapicClient->listJobRuns($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listReleasesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $releasesElement = new Release(); - $releases = [ - $releasesElement, - ]; - $expectedResponse = new ListReleasesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setReleases($releases); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $response = $gapicClient->listReleases($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getReleases()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListReleases', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listReleasesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - try { - $gapicClient->listReleases($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRolloutsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $rolloutsElement = new Rollout(); - $rollouts = [ - $rolloutsElement, - ]; - $expectedResponse = new ListRolloutsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRollouts($rollouts); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - $response = $gapicClient->listRollouts($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRollouts()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListRollouts', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRolloutsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); - try { - $gapicClient->listRollouts($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTargetsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $targetsElement = new Target(); - $targets = [ - $targetsElement, - ]; - $expectedResponse = new ListTargetsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTargets($targets); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listTargets($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTargets()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListTargets', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTargetsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listTargets($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function retryJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RetryJobResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $phaseId = 'phaseId-1676299681'; - $jobId = 'jobId-1154752291'; - $response = $gapicClient->retryJob($formattedRollout, $phaseId, $jobId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/RetryJob', $actualFuncCall); - $actualValue = $actualRequestObject->getRollout(); - $this->assertProtobufEquals($formattedRollout, $actualValue); - $actualValue = $actualRequestObject->getPhaseId(); - $this->assertProtobufEquals($phaseId, $actualValue); - $actualValue = $actualRequestObject->getJobId(); - $this->assertProtobufEquals($jobId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function retryJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $phaseId = 'phaseId-1676299681'; - $jobId = 'jobId-1154752291'; - try { - $gapicClient->retryJob($formattedRollout, $phaseId, $jobId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackTargetTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RollbackTargetResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $targetId = 'targetId-815576439'; - $rolloutId = 'rolloutId-91142551'; - $response = $gapicClient->rollbackTarget($formattedName, $targetId, $rolloutId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/RollbackTarget', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getTargetId(); - $this->assertProtobufEquals($targetId, $actualValue); - $actualValue = $actualRequestObject->getRolloutId(); - $this->assertProtobufEquals($rolloutId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackTargetExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $targetId = 'targetId-815576439'; - $rolloutId = 'rolloutId-91142551'; - try { - $gapicClient->rollbackTarget($formattedName, $targetId, $rolloutId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function terminateJobRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TerminateJobRunResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - $response = $gapicClient->terminateJobRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/TerminateJobRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function terminateJobRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]'); - try { - $gapicClient->terminateJobRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateAutomationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAutomationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $suspended = false; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Automation(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setSuspended($suspended); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateAutomationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $automation = new Automation(); - $automationServiceAccount = 'automationServiceAccount-192216401'; - $automation->setServiceAccount($automationServiceAccount); - $automationSelector = new AutomationResourceSelector(); - $automation->setSelector($automationSelector); - $automationRules = []; - $automation->setRules($automationRules); - $response = $gapicClient->updateAutomation($updateMask, $automation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/UpdateAutomation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getAutomation(); - $this->assertProtobufEquals($automation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAutomationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateAutomationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateAutomationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $automation = new Automation(); - $automationServiceAccount = 'automationServiceAccount-192216401'; - $automation->setServiceAccount($automationServiceAccount); - $automationSelector = new AutomationResourceSelector(); - $automation->setSelector($automationSelector); - $automationRules = []; - $automation->setRules($automationRules); - $response = $gapicClient->updateAutomation($updateMask, $automation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateAutomationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateCustomTargetTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateCustomTargetTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $customTargetTypeId = 'customTargetTypeId-2048374240'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new CustomTargetType(); - $expectedResponse->setName($name); - $expectedResponse->setCustomTargetTypeId($customTargetTypeId); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateCustomTargetTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $customTargetType = new CustomTargetType(); - $response = $gapicClient->updateCustomTargetType($updateMask, $customTargetType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/UpdateCustomTargetType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getCustomTargetType(); - $this->assertProtobufEquals($customTargetType, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateCustomTargetTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateCustomTargetTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateCustomTargetTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $customTargetType = new CustomTargetType(); - $response = $gapicClient->updateCustomTargetType($updateMask, $customTargetType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateCustomTargetTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDeliveryPipelineTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDeliveryPipelineTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $suspended = false; - $expectedResponse = new DeliveryPipeline(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setSuspended($suspended); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateDeliveryPipelineTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $deliveryPipeline = new DeliveryPipeline(); - $response = $gapicClient->updateDeliveryPipeline($updateMask, $deliveryPipeline); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/UpdateDeliveryPipeline', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getDeliveryPipeline(); - $this->assertProtobufEquals($deliveryPipeline, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDeliveryPipelineTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDeliveryPipelineExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDeliveryPipelineTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $deliveryPipeline = new DeliveryPipeline(); - $response = $gapicClient->updateDeliveryPipeline($updateMask, $deliveryPipeline); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDeliveryPipelineTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTargetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTargetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $targetId = 'targetId-815576439'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $requireApproval = false; - $etag = 'etag3123477'; - $expectedResponse = new Target(); - $expectedResponse->setName($name); - $expectedResponse->setTargetId($targetId); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setRequireApproval($requireApproval); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTargetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $target = new Target(); - $response = $gapicClient->updateTarget($updateMask, $target); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/UpdateTarget', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getTarget(); - $this->assertProtobufEquals($target, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTargetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTargetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTargetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $target = new Target(); - $response = $gapicClient->updateTarget($updateMask, $target); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTargetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/DeveloperConnect/.OwlBot.yaml b/DeveloperConnect/.OwlBot.yaml new file mode 100644 index 000000000000..489be50f440a --- /dev/null +++ b/DeveloperConnect/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/cloud/developerconnect/(v1)/.*-php/(.*) + dest: /owl-bot-staging/DeveloperConnect/$1/$2 +api-name: DeveloperConnect diff --git a/DeveloperConnect/.gitattributes b/DeveloperConnect/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/DeveloperConnect/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/DeveloperConnect/.github/pull_request_template.md b/DeveloperConnect/.github/pull_request_template.md new file mode 100644 index 000000000000..1ab8180a0c39 --- /dev/null +++ b/DeveloperConnect/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `DeveloperConnect/src`, and tests in `DeveloperConnect/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/DeveloperConnect/CONTRIBUTING.md b/DeveloperConnect/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/DeveloperConnect/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/DeveloperConnect/LICENSE b/DeveloperConnect/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/DeveloperConnect/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/DeveloperConnect/README.md b/DeveloperConnect/README.md new file mode 100644 index 000000000000..60fe21d00c03 --- /dev/null +++ b/DeveloperConnect/README.md @@ -0,0 +1,45 @@ +# Google Cloud Developer Connect for PHP + +> Idiomatic PHP client for [Google Cloud Developer Connect](https://cloud.google.com/developer-connect). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-developerconnect/v/stable)](https://packagist.org/packages/google/cloud-developerconnect) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-developerconnect.svg)](https://packagist.org/packages/google/cloud-developerconnect) + +* [API documentation](https://cloud.google.com/php/docs/reference/cloud-developerconnect/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/cloud-developerconnect +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/google-cloud-php-developerconnect/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://cloud.google.com/developer-connect/docs/overview). diff --git a/DeveloperConnect/VERSION b/DeveloperConnect/VERSION new file mode 100644 index 000000000000..17e51c385ea3 --- /dev/null +++ b/DeveloperConnect/VERSION @@ -0,0 +1 @@ +0.1.1 diff --git a/DeveloperConnect/composer.json b/DeveloperConnect/composer.json new file mode 100644 index 000000000000..2f72f0bd1fdd --- /dev/null +++ b/DeveloperConnect/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/cloud-developerconnect", + "description": "Google Cloud Developer Connect Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Cloud\\DeveloperConnect\\": "src", + "GPBMetadata\\Google\\Cloud\\Developerconnect\\": "metadata" + } + }, + "extra": { + "component": { + "id": "cloud-developerconnect", + "path": "DeveloperConnect", + "target": "googleapis/google-cloud-php-developerconnect" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/DeveloperConnect/metadata/V1/DeveloperConnect.php b/DeveloperConnect/metadata/V1/DeveloperConnect.php new file mode 100644 index 0000000000000000000000000000000000000000..be6683bdc38fa9bb811a4a5be6d0349bab5422fc GIT binary patch literal 11671 zcmcgyU2Ggz74Gadj(wdU`{r-EX`5jZ(bP(JWd};SZQ6|2YsZpfFY9#*#bTM=y}KT~ zo*8CllbXm<1rlu$f(ImC5J(^-B#?OH0U`0g3s8`d-~r(mD#TM?D)E325{Pqu=4WSS zvtv7HUgDjZbLX7z{M_%Hxv#utZCU8DyhIFQYc6Ta&0X2uBC=(huGunsa>6sR>Tc%-p27#i9g%v8!cBi4Ven887*@4 zd6}r0+cqF4VT!4)&pgomaSW^X;ht2YbUD2v zU*$TMN--sG%C6lf;kV1OP29e1yv+2b3+(xSZ6?5{TKcAH7$!x*G@Mc?uqjw#m|(f5 z6T>~2%%VE_QP)xa`>trFf@FgL%*w`8;4C^ zEYiNf(!LN)`@+51`~|VLX6aBIXh8A2&tD4N=+LNXG)35m2QJ1Q&>=X)&8I>)Z4m+D z)@5<47r41dYY}&IWN}u5AbpF3I#S&9ikW|t>$d~$5>I%_`%k!@Pxu4Mhhqqdf&__& zm(aYU7egO6u7R#@hdFp?(KdPmIA5UPvB|vB(0Y@3FIf{v+t|p z_!DTdWfQ304XQ*g!&c6FD|;Fi{HUQ)St`}HpwbGdY-*`C=@CzAGM&^NG}hCar03+G zl(S&=4NtkDVN(dOE37clis9P3RCNj05!MYzfL@Qev_b19$&E2xu8&@NIV8JIML8hn z(0E&Sv}TXAbH`z=asIL#nzRWxt)=&%UgXBTJ6ZfXn$&{Qnwwyz-5mY?kZGaP9I_95 z47*@Ahu~ez#}dw=Y+rBZPOvMJ;J?3r53pZi;hF>b?AaL&zN_z_yR&2v!T(q^&CwlenaV_V@w#IL(}VZ zb*a+WSY5AH%FBz(m4&G%@Ogx*mDPpi)ul$cR#EGfhFYyoN#W}o>y=t#P2H&9p31WD@-7ZPoVMg+MVi3rCymr%I`DiM7VB1#voCCG|OVaaVkv`hSv~)?`|2^gfzD}tcgwVaQrQitL2an+z_3IKnjMYxnhNq|Uyx^NsBboD#ahxHp*>z@Q5Z4kugT^{~5BP2XyF_(2?KVV0bC+#zymTp0 zIWEL>cPvPFf>qeM0+YZ3x;tDO9XA0EkP@d2@}}DeDatYvbe!xPurIc@XiW$0vsWjS z&!DqQBm|>};;n&g)%RTbil_V+%!EjW?IcjnTm4b^D34ACP&FVQ{Q8r@73hV07@40A zh$3}&246zR=21o0=LrRSjpXe$7<7RBL}#qQG50!z}(OSiHcepgQ zkusPauoP+?AvKWZxc z2cW{gmC)>{jUfgq){n}Fi`{7G0%L}24cm|B2DB*Kdowux$dKaI_*Qe*W67`G(Iyrd~7NvI_JOjBYB~X z&PQJ;JPo4_-jy(;@O5;WylLrt#+Q^!nvcp1I+rXl9cFV3E=5O|m?3~L3|GSwpGS?d@@omn!`~$U>!6e2frbat+GvnQ zEnNs3mwyqR2>-?iWni16n9vatpDeR2hyHSRE!s8%eO7*!L1(--)kwz&=`j@=m{*P4 zq|;y;P<>9#rI@QGC|Cex>tF^a3IhR8X?Wt8!|yjF~!=O%?M`s7s5srpfq=vCio-7k4h6eQ9kDo?U3*LuM(PCmCpQj_! z6r5t59uW~6MLxwiG$zR{QEu(4V(|2pKmX&~nOR(kUi@dM>Fdn%B^V8(#sef++9i35MF<ZDR=u!R2&hDS#{X$+6b zq%{29RED1qSu8$i(IFGF_x4i!>3{W9Q(GBPl4aC1;j43F}O=D;ztq*_-_*Xju5jM zr=Teh=@0XV=}?vR@P6i5cvQE3&trUp9VUKdbU|RmXHd)w=M?ZHN(*nkBkik6Nyv(Q zPwBEOPbdVbHumKBE_LEA6in*Bpyk7rltD8@-ot6}sLKe{y8CK~*0A8I<649%q>7n69v(yV#$U^z z90LXlMYPYvYD#MoWIaIUkFtaSqZJ3EidT;SMuNWhZ8(tN0RbJAgFl&GbNakzaEb;Y z{2DkK$i6cJhu&A8PACl5XfsB;Ocn%9{DsGsFn|g*B)<-1e#FOvKdFT+*R`Bdv3URf zeF2nzUVxrD;HPX~u;Bbt$Fz6m|Cd2m-~i4@Oy|!<`^hThmR0GED(83JX*4*@(=~$= zyMjL#L5c7|UUAuKz8tm4YW^@2>s^16k(bz^-a?rk>McZdDcqfX&wFH39Q+MV{+4-T zvk6CkKge9>3zbT2rBW%nRH+0{soMuSdJ!aiaAb*}+<@;a{Exk&IN{-6@jf%|HOClD hzy6$my7C%7yc;^}OFwMtt%P&F>`8tecMt6$^ncBIj4=QJ literal 0 HcmV?d00001 diff --git a/DeveloperConnect/owlbot.py b/DeveloperConnect/owlbot.py new file mode 100644 index 000000000000..a7e4d1eae140 --- /dev/null +++ b/DeveloperConnect/owlbot.py @@ -0,0 +1,62 @@ +# Copyright 2023 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/DeveloperConnect").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main( + src=src, + dest=dest, + copy_excludes=[ + src / "**/[A-Z]*_*.php", + ] +) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/DeveloperConnect/phpunit.xml.dist b/DeveloperConnect/phpunit.xml.dist new file mode 100644 index 000000000000..4089d5d9147a --- /dev/null +++ b/DeveloperConnect/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/create_connection.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/create_connection.php new file mode 100644 index 000000000000..cbb5d8f4c53d --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/create_connection.php @@ -0,0 +1,90 @@ +setParent($formattedParent) + ->setConnectionId($connectionId) + ->setConnection($connection); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->createConnection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Connection $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = DeveloperConnectClient::locationName('[PROJECT]', '[LOCATION]'); + $connectionId = '[CONNECTION_ID]'; + + create_connection_sample($formattedParent, $connectionId); +} +// [END developerconnect_v1_generated_DeveloperConnect_CreateConnection_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/create_git_repository_link.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/create_git_repository_link.php new file mode 100644 index 000000000000..d9585bf6051d --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/create_git_repository_link.php @@ -0,0 +1,109 @@ +setCloneUri($gitRepositoryLinkCloneUri); + $request = (new CreateGitRepositoryLinkRequest()) + ->setParent($formattedParent) + ->setGitRepositoryLink($gitRepositoryLink) + ->setGitRepositoryLinkId($gitRepositoryLinkId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->createGitRepositoryLink($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var GitRepositoryLink $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = DeveloperConnectClient::connectionName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]' + ); + $gitRepositoryLinkCloneUri = '[CLONE_URI]'; + $gitRepositoryLinkId = '[GIT_REPOSITORY_LINK_ID]'; + + create_git_repository_link_sample( + $formattedParent, + $gitRepositoryLinkCloneUri, + $gitRepositoryLinkId + ); +} +// [END developerconnect_v1_generated_DeveloperConnect_CreateGitRepositoryLink_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/delete_connection.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/delete_connection.php new file mode 100644 index 000000000000..14d6dfc8decf --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/delete_connection.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->deleteConnection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = DeveloperConnectClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + + delete_connection_sample($formattedName); +} +// [END developerconnect_v1_generated_DeveloperConnect_DeleteConnection_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/delete_git_repository_link.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/delete_git_repository_link.php new file mode 100644 index 000000000000..fa1acf4d24bd --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/delete_git_repository_link.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->deleteGitRepositoryLink($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + + delete_git_repository_link_sample($formattedName); +} +// [END developerconnect_v1_generated_DeveloperConnect_DeleteGitRepositoryLink_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php new file mode 100644 index 000000000000..a2ba9bab4bc6 --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php @@ -0,0 +1,79 @@ +setConnection($formattedConnection); + + // Call the API and handle any network failures. + try { + /** @var FetchGitHubInstallationsResponse $response */ + $response = $developerConnectClient->fetchGitHubInstallations($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 +{ + $formattedConnection = DeveloperConnectClient::connectionName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]' + ); + + fetch_git_hub_installations_sample($formattedConnection); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchGitHubInstallations_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_git_refs.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_git_refs.php new file mode 100644 index 000000000000..797f6186828f --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_git_refs.php @@ -0,0 +1,85 @@ +setGitRepositoryLink($formattedGitRepositoryLink) + ->setRefType($refType); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $developerConnectClient->fetchGitRefs($request); + + /** @var string $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element); + } + } 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 +{ + $formattedGitRepositoryLink = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $refType = RefType::REF_TYPE_UNSPECIFIED; + + fetch_git_refs_sample($formattedGitRepositoryLink, $refType); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchGitRefs_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php new file mode 100644 index 000000000000..a59f7407e797 --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php @@ -0,0 +1,82 @@ +setConnection($formattedConnection); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $developerConnectClient->fetchLinkableGitRepositories($request); + + /** @var LinkableGitRepository $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedConnection = DeveloperConnectClient::connectionName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]' + ); + + fetch_linkable_git_repositories_sample($formattedConnection); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchLinkableGitRepositories_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_read_token.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_read_token.php new file mode 100644 index 000000000000..024d996d0cbf --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_read_token.php @@ -0,0 +1,77 @@ +setGitRepositoryLink($formattedGitRepositoryLink); + + // Call the API and handle any network failures. + try { + /** @var FetchReadTokenResponse $response */ + $response = $developerConnectClient->fetchReadToken($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 +{ + $formattedGitRepositoryLink = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + + fetch_read_token_sample($formattedGitRepositoryLink); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchReadToken_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_read_write_token.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_read_write_token.php new file mode 100644 index 000000000000..dbf90ac3ed8d --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/fetch_read_write_token.php @@ -0,0 +1,77 @@ +setGitRepositoryLink($formattedGitRepositoryLink); + + // Call the API and handle any network failures. + try { + /** @var FetchReadWriteTokenResponse $response */ + $response = $developerConnectClient->fetchReadWriteToken($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 +{ + $formattedGitRepositoryLink = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + + fetch_read_write_token_sample($formattedGitRepositoryLink); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchReadWriteToken_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/get_connection.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/get_connection.php new file mode 100644 index 000000000000..62f8dad3980c --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/get_connection.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Connection $response */ + $response = $developerConnectClient->getConnection($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 = DeveloperConnectClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + + get_connection_sample($formattedName); +} +// [END developerconnect_v1_generated_DeveloperConnect_GetConnection_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/get_git_repository_link.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/get_git_repository_link.php new file mode 100644 index 000000000000..7bc8921ff003 --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/get_git_repository_link.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var GitRepositoryLink $response */ + $response = $developerConnectClient->getGitRepositoryLink($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 = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + + get_git_repository_link_sample($formattedName); +} +// [END developerconnect_v1_generated_DeveloperConnect_GetGitRepositoryLink_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/get_location.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/get_location.php new file mode 100644 index 000000000000..bbbaa9a5f5b4 --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END developerconnect_v1_generated_DeveloperConnect_GetLocation_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/list_connections.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/list_connections.php new file mode 100644 index 000000000000..f3da4ef4ae9a --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/list_connections.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $developerConnectClient->listConnections($request); + + /** @var Connection $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = DeveloperConnectClient::locationName('[PROJECT]', '[LOCATION]'); + + list_connections_sample($formattedParent); +} +// [END developerconnect_v1_generated_DeveloperConnect_ListConnections_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/list_git_repository_links.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/list_git_repository_links.php new file mode 100644 index 000000000000..ec2696944caf --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/list_git_repository_links.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $developerConnectClient->listGitRepositoryLinks($request); + + /** @var GitRepositoryLink $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = DeveloperConnectClient::connectionName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]' + ); + + list_git_repository_links_sample($formattedParent); +} +// [END developerconnect_v1_generated_DeveloperConnect_ListGitRepositoryLinks_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/list_locations.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/list_locations.php new file mode 100644 index 000000000000..4cd5195a5ff9 --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END developerconnect_v1_generated_DeveloperConnect_ListLocations_sync] diff --git a/DeveloperConnect/samples/V1/DeveloperConnectClient/update_connection.php b/DeveloperConnect/samples/V1/DeveloperConnectClient/update_connection.php new file mode 100644 index 000000000000..99ac0c315fba --- /dev/null +++ b/DeveloperConnect/samples/V1/DeveloperConnectClient/update_connection.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setConnection($connection); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->updateConnection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Connection $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END developerconnect_v1_generated_DeveloperConnect_UpdateConnection_sync] diff --git a/DeveloperConnect/src/V1/Client/DeveloperConnectClient.php b/DeveloperConnect/src/V1/Client/DeveloperConnectClient.php new file mode 100644 index 000000000000..9831de633cf9 --- /dev/null +++ b/DeveloperConnect/src/V1/Client/DeveloperConnectClient.php @@ -0,0 +1,811 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/developer_connect_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/developer_connect_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/developer_connect_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/developer_connect_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a connection + * resource. + * + * @param string $project + * @param string $location + * @param string $connection + * + * @return string The formatted connection resource. + */ + public static function connectionName(string $project, string $location, string $connection): string + { + return self::getPathTemplate('connection')->render([ + 'project' => $project, + 'location' => $location, + 'connection' => $connection, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * git_repository_link resource. + * + * @param string $project + * @param string $location + * @param string $connection + * @param string $gitRepositoryLink + * + * @return string The formatted git_repository_link resource. + */ + public static function gitRepositoryLinkName( + string $project, + string $location, + string $connection, + string $gitRepositoryLink + ): string { + return self::getPathTemplate('gitRepositoryLink')->render([ + 'project' => $project, + 'location' => $location, + 'connection' => $connection, + 'git_repository_link' => $gitRepositoryLink, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * secret_version resource. + * + * @param string $project + * @param string $secret + * @param string $secretVersion + * + * @return string The formatted secret_version resource. + */ + public static function secretVersionName(string $project, string $secret, string $secretVersion): string + { + return self::getPathTemplate('secretVersion')->render([ + 'project' => $project, + 'secret' => $secret, + 'secret_version' => $secretVersion, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - connection: projects/{project}/locations/{location}/connections/{connection} + * - gitRepositoryLink: projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link} + * - location: projects/{project}/locations/{location} + * - secretVersion: projects/{project}/secrets/{secret}/versions/{secret_version} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'developerconnect.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new Connection in a given project and location. + * + * The async variant is {@see DeveloperConnectClient::createConnectionAsync()} . + * + * @example samples/V1/DeveloperConnectClient/create_connection.php + * + * @param CreateConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConnection(CreateConnectionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConnection', $request, $callOptions)->wait(); + } + + /** + * Creates a GitRepositoryLink. Upon linking a Git Repository, Developer + * Connect will configure the Git Repository to send webhook events to + * Developer Connect. Connections that use Firebase GitHub Application will + * have events forwarded to the Firebase service. All other Connections will + * have events forwarded to Cloud Build. + * + * The async variant is + * {@see DeveloperConnectClient::createGitRepositoryLinkAsync()} . + * + * @example samples/V1/DeveloperConnectClient/create_git_repository_link.php + * + * @param CreateGitRepositoryLinkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createGitRepositoryLink( + CreateGitRepositoryLinkRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateGitRepositoryLink', $request, $callOptions)->wait(); + } + + /** + * Deletes a single Connection. + * + * The async variant is {@see DeveloperConnectClient::deleteConnectionAsync()} . + * + * @example samples/V1/DeveloperConnectClient/delete_connection.php + * + * @param DeleteConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConnection(DeleteConnectionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteConnection', $request, $callOptions)->wait(); + } + + /** + * Deletes a single GitRepositoryLink. + * + * The async variant is + * {@see DeveloperConnectClient::deleteGitRepositoryLinkAsync()} . + * + * @example samples/V1/DeveloperConnectClient/delete_git_repository_link.php + * + * @param DeleteGitRepositoryLinkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteGitRepositoryLink( + DeleteGitRepositoryLinkRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteGitRepositoryLink', $request, $callOptions)->wait(); + } + + /** + * FetchGitHubInstallations returns the list of GitHub Installations that + * are available to be added to a Connection. + * For github.com, only installations accessible to the authorizer token + * are returned. For GitHub Enterprise, all installations are returned. + * + * The async variant is + * {@see DeveloperConnectClient::fetchGitHubInstallationsAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php + * + * @param FetchGitHubInstallationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FetchGitHubInstallationsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchGitHubInstallations( + FetchGitHubInstallationsRequest $request, + array $callOptions = [] + ): FetchGitHubInstallationsResponse { + return $this->startApiCall('FetchGitHubInstallations', $request, $callOptions)->wait(); + } + + /** + * Fetch the list of branches or tags for a given repository. + * + * The async variant is {@see DeveloperConnectClient::fetchGitRefsAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_git_refs.php + * + * @param FetchGitRefsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchGitRefs(FetchGitRefsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('FetchGitRefs', $request, $callOptions); + } + + /** + * FetchLinkableGitRepositories returns a list of git repositories from an SCM + * that are available to be added to a Connection. + * + * The async variant is + * {@see DeveloperConnectClient::fetchLinkableGitRepositoriesAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php + * + * @param FetchLinkableGitRepositoriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchLinkableGitRepositories( + FetchLinkableGitRepositoriesRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('FetchLinkableGitRepositories', $request, $callOptions); + } + + /** + * Fetches read token of a given gitRepositoryLink. + * + * The async variant is {@see DeveloperConnectClient::fetchReadTokenAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_read_token.php + * + * @param FetchReadTokenRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FetchReadTokenResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchReadToken(FetchReadTokenRequest $request, array $callOptions = []): FetchReadTokenResponse + { + return $this->startApiCall('FetchReadToken', $request, $callOptions)->wait(); + } + + /** + * Fetches read/write token of a given gitRepositoryLink. + * + * The async variant is {@see DeveloperConnectClient::fetchReadWriteTokenAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_read_write_token.php + * + * @param FetchReadWriteTokenRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FetchReadWriteTokenResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchReadWriteToken( + FetchReadWriteTokenRequest $request, + array $callOptions = [] + ): FetchReadWriteTokenResponse { + return $this->startApiCall('FetchReadWriteToken', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Connection. + * + * The async variant is {@see DeveloperConnectClient::getConnectionAsync()} . + * + * @example samples/V1/DeveloperConnectClient/get_connection.php + * + * @param GetConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Connection + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConnection(GetConnectionRequest $request, array $callOptions = []): Connection + { + return $this->startApiCall('GetConnection', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single GitRepositoryLink. + * + * The async variant is {@see DeveloperConnectClient::getGitRepositoryLinkAsync()} + * . + * + * @example samples/V1/DeveloperConnectClient/get_git_repository_link.php + * + * @param GetGitRepositoryLinkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GitRepositoryLink + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGitRepositoryLink( + GetGitRepositoryLinkRequest $request, + array $callOptions = [] + ): GitRepositoryLink { + return $this->startApiCall('GetGitRepositoryLink', $request, $callOptions)->wait(); + } + + /** + * Lists Connections in a given project and location. + * + * The async variant is {@see DeveloperConnectClient::listConnectionsAsync()} . + * + * @example samples/V1/DeveloperConnectClient/list_connections.php + * + * @param ListConnectionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConnections(ListConnectionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConnections', $request, $callOptions); + } + + /** + * Lists GitRepositoryLinks in a given project, location, and connection. + * + * The async variant is + * {@see DeveloperConnectClient::listGitRepositoryLinksAsync()} . + * + * @example samples/V1/DeveloperConnectClient/list_git_repository_links.php + * + * @param ListGitRepositoryLinksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGitRepositoryLinks( + ListGitRepositoryLinksRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListGitRepositoryLinks', $request, $callOptions); + } + + /** + * Updates the parameters of a single Connection. + * + * The async variant is {@see DeveloperConnectClient::updateConnectionAsync()} . + * + * @example samples/V1/DeveloperConnectClient/update_connection.php + * + * @param UpdateConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateConnection(UpdateConnectionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateConnection', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see DeveloperConnectClient::getLocationAsync()} . + * + * @example samples/V1/DeveloperConnectClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see DeveloperConnectClient::listLocationsAsync()} . + * + * @example samples/V1/DeveloperConnectClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/DeveloperConnect/src/V1/Connection.php b/DeveloperConnect/src/V1/Connection.php new file mode 100644 index 000000000000..4ecfb1749656 --- /dev/null +++ b/DeveloperConnect/src/V1/Connection.php @@ -0,0 +1,517 @@ +google.cloud.developerconnect.v1.Connection + */ +class Connection extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the connection, in the format + * `projects/{project}/locations/{location}/connections/{connection_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. Installation state of the Connection. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState installation_state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $installation_state = null; + /** + * Optional. If disabled is set to true, functionality is disabled for this + * connection. Repository based API methods and webhooks processing for + * repositories in this connection will be disabled. + * + * Generated from protobuf field bool disabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disabled = false; + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + protected $uid = ''; + protected $connection_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DeveloperConnect\V1\GitHubConfig $github_config + * Configuration for connections to github.com. + * @type string $name + * Identifier. The resource name of the connection, in the format + * `projects/{project}/locations/{location}/connections/{connection_id}`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. [Output only] Create timestamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. [Output only] Update timestamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. [Output only] Delete timestamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels as key value pairs + * @type \Google\Cloud\DeveloperConnect\V1\InstallationState $installation_state + * Output only. Installation state of the Connection. + * @type bool $disabled + * Optional. If disabled is set to true, functionality is disabled for this + * connection. Repository based API methods and webhooks processing for + * repositories in this connection will be disabled. + * @type bool $reconciling + * Output only. Set to true when the connection is being set up or updated in + * the background. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Allows clients to store small amounts of arbitrary data. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type string $uid + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Configuration for connections to github.com. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig github_config = 5; + * @return \Google\Cloud\DeveloperConnect\V1\GitHubConfig|null + */ + public function getGithubConfig() + { + return $this->readOneof(5); + } + + public function hasGithubConfig() + { + return $this->hasOneof(5); + } + + /** + * Configuration for connections to github.com. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig github_config = 5; + * @param \Google\Cloud\DeveloperConnect\V1\GitHubConfig $var + * @return $this + */ + public function setGithubConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitHubConfig::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Identifier. The resource name of the connection, in the format + * `projects/{project}/locations/{location}/connections/{connection_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the connection, in the format + * `projects/{project}/locations/{location}/connections/{connection_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Installation state of the Connection. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState installation_state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\DeveloperConnect\V1\InstallationState|null + */ + public function getInstallationState() + { + return $this->installation_state; + } + + public function hasInstallationState() + { + return isset($this->installation_state); + } + + public function clearInstallationState() + { + unset($this->installation_state); + } + + /** + * Output only. Installation state of the Connection. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState installation_state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\DeveloperConnect\V1\InstallationState $var + * @return $this + */ + public function setInstallationState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\InstallationState::class); + $this->installation_state = $var; + + return $this; + } + + /** + * Optional. If disabled is set to true, functionality is disabled for this + * connection. Repository based API methods and webhooks processing for + * repositories in this connection will be disabled. + * + * Generated from protobuf field bool disabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * Optional. If disabled is set to true, functionality is disabled for this + * connection. Repository based API methods and webhooks processing for + * repositories in this connection will be disabled. + * + * Generated from protobuf field bool disabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * @return string + */ + public function getConnectionConfig() + { + return $this->whichOneof("connection_config"); + } + +} + diff --git a/DeveloperConnect/src/V1/CreateConnectionRequest.php b/DeveloperConnect/src/V1/CreateConnectionRequest.php new file mode 100644 index 000000000000..f83aa98c54af --- /dev/null +++ b/DeveloperConnect/src/V1/CreateConnectionRequest.php @@ -0,0 +1,281 @@ +google.cloud.developerconnect.v1.CreateConnectionRequest + */ +class CreateConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * + * Generated from protobuf field string connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $connection_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $connection = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see DeveloperConnectClient::locationName()} for help formatting this field. + * @param \Google\Cloud\DeveloperConnect\V1\Connection $connection Required. The resource being created + * @param string $connectionId Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * + * @return \Google\Cloud\DeveloperConnect\V1\CreateConnectionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DeveloperConnect\V1\Connection $connection, string $connectionId): self + { + return (new self()) + ->setParent($parent) + ->setConnection($connection) + ->setConnectionId($connectionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $connection_id + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * @type \Google\Cloud\DeveloperConnect\V1\Connection $connection + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * + * Generated from protobuf field string connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConnectionId() + { + return $this->connection_id; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * + * Generated from protobuf field string connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConnectionId($var) + { + GPBUtil::checkString($var, True); + $this->connection_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\Connection|null + */ + public function getConnection() + { + return $this->connection; + } + + public function hasConnection() + { + return isset($this->connection); + } + + public function clearConnection() + { + unset($this->connection); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\Connection $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\Connection::class); + $this->connection = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/CreateGitRepositoryLinkRequest.php b/DeveloperConnect/src/V1/CreateGitRepositoryLinkRequest.php new file mode 100644 index 000000000000..0debd2162d11 --- /dev/null +++ b/DeveloperConnect/src/V1/CreateGitRepositoryLinkRequest.php @@ -0,0 +1,286 @@ +google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest + */ +class CreateGitRepositoryLinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $git_repository_link = null; + /** + * Required. The ID to use for the repository, which will become the final + * component of the repository's resource name. This ID should be unique in + * the connection. Allows alphanumeric characters and any of + * -._~%!$&'()*+,;=@. + * + * Generated from protobuf field string git_repository_link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $git_repository_link_id = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * @param \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink $gitRepositoryLink Required. The resource being created + * @param string $gitRepositoryLinkId Required. The ID to use for the repository, which will become the final + * component of the repository's resource name. This ID should be unique in + * the connection. Allows alphanumeric characters and any of + * -._~%!$&'()*+,;=@. + * + * @return \Google\Cloud\DeveloperConnect\V1\CreateGitRepositoryLinkRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink $gitRepositoryLink, string $gitRepositoryLinkId): self + { + return (new self()) + ->setParent($parent) + ->setGitRepositoryLink($gitRepositoryLink) + ->setGitRepositoryLinkId($gitRepositoryLinkId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink $git_repository_link + * Required. The resource being created + * @type string $git_repository_link_id + * Required. The ID to use for the repository, which will become the final + * component of the repository's resource name. This ID should be unique in + * the connection. Allows alphanumeric characters and any of + * -._~%!$&'()*+,;=@. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink|null + */ + public function getGitRepositoryLink() + { + return $this->git_repository_link; + } + + public function hasGitRepositoryLink() + { + return isset($this->git_repository_link); + } + + public function clearGitRepositoryLink() + { + unset($this->git_repository_link); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink $var + * @return $this + */ + public function setGitRepositoryLink($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink::class); + $this->git_repository_link = $var; + + return $this; + } + + /** + * Required. The ID to use for the repository, which will become the final + * component of the repository's resource name. This ID should be unique in + * the connection. Allows alphanumeric characters and any of + * -._~%!$&'()*+,;=@. + * + * Generated from protobuf field string git_repository_link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGitRepositoryLinkId() + { + return $this->git_repository_link_id; + } + + /** + * Required. The ID to use for the repository, which will become the final + * component of the repository's resource name. This ID should be unique in + * the connection. Allows alphanumeric characters and any of + * -._~%!$&'()*+,;=@. + * + * Generated from protobuf field string git_repository_link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGitRepositoryLinkId($var) + { + GPBUtil::checkString($var, True); + $this->git_repository_link_id = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/DeleteConnectionRequest.php b/DeveloperConnect/src/V1/DeleteConnectionRequest.php new file mode 100644 index 000000000000..c7ddb931ee20 --- /dev/null +++ b/DeveloperConnect/src/V1/DeleteConnectionRequest.php @@ -0,0 +1,231 @@ +google.cloud.developerconnect.v1.DeleteConnectionRequest + */ +class DeleteConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. The current etag of the Connection. + * If an etag is provided and does not match the current etag of the + * Connection, deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\DeleteConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * @type string $etag + * Optional. The current etag of the Connection. + * If an etag is provided and does not match the current etag of the + * Connection, deletion will be blocked and an ABORTED error will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The current etag of the Connection. + * If an etag is provided and does not match the current etag of the + * Connection, deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Connection. + * If an etag is provided and does not match the current etag of the + * Connection, deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/DeleteGitRepositoryLinkRequest.php b/DeveloperConnect/src/V1/DeleteGitRepositoryLinkRequest.php new file mode 100644 index 000000000000..cc28fc5e1e60 --- /dev/null +++ b/DeveloperConnect/src/V1/DeleteGitRepositoryLinkRequest.php @@ -0,0 +1,231 @@ +google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest + */ +class DeleteGitRepositoryLinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\DeleteGitRepositoryLinkRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchGitHubInstallationsRequest.php b/DeveloperConnect/src/V1/FetchGitHubInstallationsRequest.php new file mode 100644 index 000000000000..1aa23cd4b8ac --- /dev/null +++ b/DeveloperConnect/src/V1/FetchGitHubInstallationsRequest.php @@ -0,0 +1,86 @@ +google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest + */ +class FetchGitHubInstallationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $connection = ''; + + /** + * @param string $connection Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. Please see + * {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsRequest + * + * @experimental + */ + public static function build(string $connection): self + { + return (new self()) + ->setConnection($connection); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connection + * Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConnection() + { + return $this->connection; + } + + /** + * Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkString($var, True); + $this->connection = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchGitHubInstallationsResponse.php b/DeveloperConnect/src/V1/FetchGitHubInstallationsResponse.php new file mode 100644 index 000000000000..54ca9a068f86 --- /dev/null +++ b/DeveloperConnect/src/V1/FetchGitHubInstallationsResponse.php @@ -0,0 +1,71 @@ +google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse + */ +class FetchGitHubInstallationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of installations available to the OAuth user (for github.com) + * or all the installations (for GitHub enterprise). + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation installations = 1; + */ + private $installations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsResponse\Installation>|\Google\Protobuf\Internal\RepeatedField $installations + * List of installations available to the OAuth user (for github.com) + * or all the installations (for GitHub enterprise). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * List of installations available to the OAuth user (for github.com) + * or all the installations (for GitHub enterprise). + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation installations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstallations() + { + return $this->installations; + } + + /** + * List of installations available to the OAuth user (for github.com) + * or all the installations (for GitHub enterprise). + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation installations = 1; + * @param array<\Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsResponse\Installation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstallations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsResponse\Installation::class); + $this->installations = $arr; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchGitHubInstallationsResponse/Installation.php b/DeveloperConnect/src/V1/FetchGitHubInstallationsResponse/Installation.php new file mode 100644 index 000000000000..1913767f9f21 --- /dev/null +++ b/DeveloperConnect/src/V1/FetchGitHubInstallationsResponse/Installation.php @@ -0,0 +1,136 @@ +google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation + */ +class Installation extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the installation in GitHub. + * + * Generated from protobuf field int64 id = 1; + */ + protected $id = 0; + /** + * Name of the GitHub user or organization that owns this installation. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * Either "user" or "organization". + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $id + * ID of the installation in GitHub. + * @type string $name + * Name of the GitHub user or organization that owns this installation. + * @type string $type + * Either "user" or "organization". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * ID of the installation in GitHub. + * + * Generated from protobuf field int64 id = 1; + * @return int|string + */ + public function getId() + { + return $this->id; + } + + /** + * ID of the installation in GitHub. + * + * Generated from protobuf field int64 id = 1; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkInt64($var); + $this->id = $var; + + return $this; + } + + /** + * Name of the GitHub user or organization that owns this installation. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the GitHub user or organization that owns this installation. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Either "user" or "organization". + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Either "user" or "organization". + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + + diff --git a/DeveloperConnect/src/V1/FetchGitRefsRequest.php b/DeveloperConnect/src/V1/FetchGitRefsRequest.php new file mode 100644 index 000000000000..844c9cfd91e0 --- /dev/null +++ b/DeveloperConnect/src/V1/FetchGitRefsRequest.php @@ -0,0 +1,191 @@ +google.cloud.developerconnect.v1.FetchGitRefsRequest + */ +class FetchGitRefsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $git_repository_link = ''; + /** + * Required. Type of refs to fetch. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType ref_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ref_type = 0; + /** + * Optional. Number of results to return in the list. Default to 20. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $gitRepositoryLink Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. Please see + * {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * @param int $refType Required. Type of refs to fetch. + * For allowed values, use constants defined on {@see \Google\Cloud\DeveloperConnect\V1\FetchGitRefsRequest\RefType} + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchGitRefsRequest + * + * @experimental + */ + public static function build(string $gitRepositoryLink, int $refType): self + { + return (new self()) + ->setGitRepositoryLink($gitRepositoryLink) + ->setRefType($refType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $git_repository_link + * Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * @type int $ref_type + * Required. Type of refs to fetch. + * @type int $page_size + * Optional. Number of results to return in the list. Default to 20. + * @type string $page_token + * Optional. Page start. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getGitRepositoryLink() + { + return $this->git_repository_link; + } + + /** + * Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setGitRepositoryLink($var) + { + GPBUtil::checkString($var, True); + $this->git_repository_link = $var; + + return $this; + } + + /** + * Required. Type of refs to fetch. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType ref_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getRefType() + { + return $this->ref_type; + } + + /** + * Required. Type of refs to fetch. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType ref_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setRefType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DeveloperConnect\V1\FetchGitRefsRequest\RefType::class); + $this->ref_type = $var; + + return $this; + } + + /** + * Optional. Number of results to return in the list. Default to 20. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Number of results to return in the list. Default to 20. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchGitRefsRequest/RefType.php b/DeveloperConnect/src/V1/FetchGitRefsRequest/RefType.php new file mode 100644 index 000000000000..d70d5a891cb4 --- /dev/null +++ b/DeveloperConnect/src/V1/FetchGitRefsRequest/RefType.php @@ -0,0 +1,62 @@ +google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType + */ +class RefType +{ + /** + * No type specified. + * + * Generated from protobuf enum REF_TYPE_UNSPECIFIED = 0; + */ + const REF_TYPE_UNSPECIFIED = 0; + /** + * To fetch tags. + * + * Generated from protobuf enum TAG = 1; + */ + const TAG = 1; + /** + * To fetch branches. + * + * Generated from protobuf enum BRANCH = 2; + */ + const BRANCH = 2; + + private static $valueToName = [ + self::REF_TYPE_UNSPECIFIED => 'REF_TYPE_UNSPECIFIED', + self::TAG => 'TAG', + self::BRANCH => 'BRANCH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DeveloperConnect/src/V1/FetchGitRefsResponse.php b/DeveloperConnect/src/V1/FetchGitRefsResponse.php new file mode 100644 index 000000000000..f5b0f6fc7010 --- /dev/null +++ b/DeveloperConnect/src/V1/FetchGitRefsResponse.php @@ -0,0 +1,101 @@ +google.cloud.developerconnect.v1.FetchGitRefsResponse + */ +class FetchGitRefsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the refs fetched. + * + * Generated from protobuf field repeated string ref_names = 1; + */ + private $ref_names; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $ref_names + * Name of the refs fetched. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Name of the refs fetched. + * + * Generated from protobuf field repeated string ref_names = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRefNames() + { + return $this->ref_names; + } + + /** + * Name of the refs fetched. + * + * Generated from protobuf field repeated string ref_names = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRefNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ref_names = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchLinkableGitRepositoriesRequest.php b/DeveloperConnect/src/V1/FetchLinkableGitRepositoriesRequest.php new file mode 100644 index 000000000000..8c48c66680d7 --- /dev/null +++ b/DeveloperConnect/src/V1/FetchLinkableGitRepositoriesRequest.php @@ -0,0 +1,154 @@ +google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest + */ +class FetchLinkableGitRepositoriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $connection = ''; + /** + * Optional. Number of results to return in the list. Defaults to 20. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $connection Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. Please see + * {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchLinkableGitRepositoriesRequest + * + * @experimental + */ + public static function build(string $connection): self + { + return (new self()) + ->setConnection($connection); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connection + * Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. + * @type int $page_size + * Optional. Number of results to return in the list. Defaults to 20. + * @type string $page_token + * Optional. Page start. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConnection() + { + return $this->connection; + } + + /** + * Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkString($var, True); + $this->connection = $var; + + return $this; + } + + /** + * Optional. Number of results to return in the list. Defaults to 20. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Number of results to return in the list. Defaults to 20. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchLinkableGitRepositoriesResponse.php b/DeveloperConnect/src/V1/FetchLinkableGitRepositoriesResponse.php new file mode 100644 index 000000000000..6e18a006bc3a --- /dev/null +++ b/DeveloperConnect/src/V1/FetchLinkableGitRepositoriesResponse.php @@ -0,0 +1,101 @@ +google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse + */ +class FetchLinkableGitRepositoriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The git repositories that can be linked to the connection. + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.LinkableGitRepository linkable_git_repositories = 1; + */ + private $linkable_git_repositories; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DeveloperConnect\V1\LinkableGitRepository>|\Google\Protobuf\Internal\RepeatedField $linkable_git_repositories + * The git repositories that can be linked to the connection. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The git repositories that can be linked to the connection. + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.LinkableGitRepository linkable_git_repositories = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinkableGitRepositories() + { + return $this->linkable_git_repositories; + } + + /** + * The git repositories that can be linked to the connection. + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.LinkableGitRepository linkable_git_repositories = 1; + * @param array<\Google\Cloud\DeveloperConnect\V1\LinkableGitRepository>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinkableGitRepositories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DeveloperConnect\V1\LinkableGitRepository::class); + $this->linkable_git_repositories = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchReadTokenRequest.php b/DeveloperConnect/src/V1/FetchReadTokenRequest.php new file mode 100644 index 000000000000..e7c3e184650d --- /dev/null +++ b/DeveloperConnect/src/V1/FetchReadTokenRequest.php @@ -0,0 +1,86 @@ +google.cloud.developerconnect.v1.FetchReadTokenRequest + */ +class FetchReadTokenRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $git_repository_link = ''; + + /** + * @param string $gitRepositoryLink Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. Please see + * {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchReadTokenRequest + * + * @experimental + */ + public static function build(string $gitRepositoryLink): self + { + return (new self()) + ->setGitRepositoryLink($gitRepositoryLink); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $git_repository_link + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getGitRepositoryLink() + { + return $this->git_repository_link; + } + + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setGitRepositoryLink($var) + { + GPBUtil::checkString($var, True); + $this->git_repository_link = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchReadTokenResponse.php b/DeveloperConnect/src/V1/FetchReadTokenResponse.php new file mode 100644 index 000000000000..b627d6e31329 --- /dev/null +++ b/DeveloperConnect/src/V1/FetchReadTokenResponse.php @@ -0,0 +1,153 @@ +google.cloud.developerconnect.v1.FetchReadTokenResponse + */ +class FetchReadTokenResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The token content. + * + * Generated from protobuf field string token = 1; + */ + protected $token = ''; + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + */ + protected $expiration_time = null; + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + */ + protected $git_username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $token + * The token content. + * @type \Google\Protobuf\Timestamp $expiration_time + * Expiration timestamp. Can be empty if unknown or non-expiring. + * @type string $git_username + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The token content. + * + * Generated from protobuf field string token = 1; + * @return string + */ + public function getToken() + { + return $this->token; + } + + /** + * The token content. + * + * Generated from protobuf field string token = 1; + * @param string $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkString($var, True); + $this->token = $var; + + return $this; + } + + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpirationTime() + { + return $this->expiration_time; + } + + public function hasExpirationTime() + { + return isset($this->expiration_time); + } + + public function clearExpirationTime() + { + unset($this->expiration_time); + } + + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpirationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expiration_time = $var; + + return $this; + } + + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + * @return string + */ + public function getGitUsername() + { + return $this->git_username; + } + + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + * @param string $var + * @return $this + */ + public function setGitUsername($var) + { + GPBUtil::checkString($var, True); + $this->git_username = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchReadWriteTokenRequest.php b/DeveloperConnect/src/V1/FetchReadWriteTokenRequest.php new file mode 100644 index 000000000000..f08f600078b9 --- /dev/null +++ b/DeveloperConnect/src/V1/FetchReadWriteTokenRequest.php @@ -0,0 +1,86 @@ +google.cloud.developerconnect.v1.FetchReadWriteTokenRequest + */ +class FetchReadWriteTokenRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $git_repository_link = ''; + + /** + * @param string $gitRepositoryLink Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. Please see + * {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchReadWriteTokenRequest + * + * @experimental + */ + public static function build(string $gitRepositoryLink): self + { + return (new self()) + ->setGitRepositoryLink($gitRepositoryLink); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $git_repository_link + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getGitRepositoryLink() + { + return $this->git_repository_link; + } + + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setGitRepositoryLink($var) + { + GPBUtil::checkString($var, True); + $this->git_repository_link = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/FetchReadWriteTokenResponse.php b/DeveloperConnect/src/V1/FetchReadWriteTokenResponse.php new file mode 100644 index 000000000000..55723d37de4a --- /dev/null +++ b/DeveloperConnect/src/V1/FetchReadWriteTokenResponse.php @@ -0,0 +1,153 @@ +google.cloud.developerconnect.v1.FetchReadWriteTokenResponse + */ +class FetchReadWriteTokenResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The token content. + * + * Generated from protobuf field string token = 1; + */ + protected $token = ''; + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + */ + protected $expiration_time = null; + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + */ + protected $git_username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $token + * The token content. + * @type \Google\Protobuf\Timestamp $expiration_time + * Expiration timestamp. Can be empty if unknown or non-expiring. + * @type string $git_username + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The token content. + * + * Generated from protobuf field string token = 1; + * @return string + */ + public function getToken() + { + return $this->token; + } + + /** + * The token content. + * + * Generated from protobuf field string token = 1; + * @param string $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkString($var, True); + $this->token = $var; + + return $this; + } + + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpirationTime() + { + return $this->expiration_time; + } + + public function hasExpirationTime() + { + return isset($this->expiration_time); + } + + public function clearExpirationTime() + { + unset($this->expiration_time); + } + + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpirationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expiration_time = $var; + + return $this; + } + + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + * @return string + */ + public function getGitUsername() + { + return $this->git_username; + } + + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + * @param string $var + * @return $this + */ + public function setGitUsername($var) + { + GPBUtil::checkString($var, True); + $this->git_username = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/GetConnectionRequest.php b/DeveloperConnect/src/V1/GetConnectionRequest.php new file mode 100644 index 000000000000..7fc40faa567e --- /dev/null +++ b/DeveloperConnect/src/V1/GetConnectionRequest.php @@ -0,0 +1,81 @@ +google.cloud.developerconnect.v1.GetConnectionRequest + */ +class GetConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\GetConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/GetGitRepositoryLinkRequest.php b/DeveloperConnect/src/V1/GetGitRepositoryLinkRequest.php new file mode 100644 index 000000000000..a5f01241c7fa --- /dev/null +++ b/DeveloperConnect/src/V1/GetGitRepositoryLinkRequest.php @@ -0,0 +1,81 @@ +google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest + */ +class GetGitRepositoryLinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\GetGitRepositoryLinkRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/GitHubConfig.php b/DeveloperConnect/src/V1/GitHubConfig.php new file mode 100644 index 000000000000..90397b298efe --- /dev/null +++ b/DeveloperConnect/src/V1/GitHubConfig.php @@ -0,0 +1,195 @@ +google.cloud.developerconnect.v1.GitHubConfig + */ +class GitHubConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The GitHub Application that was installed to the + * GitHub user or organization. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig.GitHubApp github_app = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $github_app = 0; + /** + * Optional. OAuth credential of the account that authorized the GitHub App. + * It is recommended to use a robot account instead of a human user account. + * The OAuth token must be tied to the GitHub App of this config. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.OAuthCredential authorizer_credential = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $authorizer_credential = null; + /** + * Optional. GitHub App installation id. + * + * Generated from protobuf field int64 app_installation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_installation_id = 0; + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubConfig. + * + * Generated from protobuf field string installation_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $installation_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $github_app + * Required. Immutable. The GitHub Application that was installed to the + * GitHub user or organization. + * @type \Google\Cloud\DeveloperConnect\V1\OAuthCredential $authorizer_credential + * Optional. OAuth credential of the account that authorized the GitHub App. + * It is recommended to use a robot account instead of a human user account. + * The OAuth token must be tied to the GitHub App of this config. + * @type int|string $app_installation_id + * Optional. GitHub App installation id. + * @type string $installation_uri + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubConfig. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The GitHub Application that was installed to the + * GitHub user or organization. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig.GitHubApp github_app = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getGithubApp() + { + return $this->github_app; + } + + /** + * Required. Immutable. The GitHub Application that was installed to the + * GitHub user or organization. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig.GitHubApp github_app = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setGithubApp($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DeveloperConnect\V1\GitHubConfig\GitHubApp::class); + $this->github_app = $var; + + return $this; + } + + /** + * Optional. OAuth credential of the account that authorized the GitHub App. + * It is recommended to use a robot account instead of a human user account. + * The OAuth token must be tied to the GitHub App of this config. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.OAuthCredential authorizer_credential = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DeveloperConnect\V1\OAuthCredential|null + */ + public function getAuthorizerCredential() + { + return $this->authorizer_credential; + } + + public function hasAuthorizerCredential() + { + return isset($this->authorizer_credential); + } + + public function clearAuthorizerCredential() + { + unset($this->authorizer_credential); + } + + /** + * Optional. OAuth credential of the account that authorized the GitHub App. + * It is recommended to use a robot account instead of a human user account. + * The OAuth token must be tied to the GitHub App of this config. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.OAuthCredential authorizer_credential = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DeveloperConnect\V1\OAuthCredential $var + * @return $this + */ + public function setAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\OAuthCredential::class); + $this->authorizer_credential = $var; + + return $this; + } + + /** + * Optional. GitHub App installation id. + * + * Generated from protobuf field int64 app_installation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getAppInstallationId() + { + return $this->app_installation_id; + } + + /** + * Optional. GitHub App installation id. + * + * Generated from protobuf field int64 app_installation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setAppInstallationId($var) + { + GPBUtil::checkInt64($var); + $this->app_installation_id = $var; + + return $this; + } + + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubConfig. + * + * Generated from protobuf field string installation_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getInstallationUri() + { + return $this->installation_uri; + } + + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubConfig. + * + * Generated from protobuf field string installation_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setInstallationUri($var) + { + GPBUtil::checkString($var, True); + $this->installation_uri = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/GitHubConfig/GitHubApp.php b/DeveloperConnect/src/V1/GitHubConfig/GitHubApp.php new file mode 100644 index 000000000000..1ddd8d1f0e06 --- /dev/null +++ b/DeveloperConnect/src/V1/GitHubConfig/GitHubApp.php @@ -0,0 +1,63 @@ +google.cloud.developerconnect.v1.GitHubConfig.GitHubApp + */ +class GitHubApp +{ + /** + * GitHub App not specified. + * + * Generated from protobuf enum GIT_HUB_APP_UNSPECIFIED = 0; + */ + const GIT_HUB_APP_UNSPECIFIED = 0; + /** + * The Developer Connect GitHub Application. + * + * Generated from protobuf enum DEVELOPER_CONNECT = 1; + */ + const DEVELOPER_CONNECT = 1; + /** + * The Firebase GitHub Application. + * + * Generated from protobuf enum FIREBASE = 2; + */ + const FIREBASE = 2; + + private static $valueToName = [ + self::GIT_HUB_APP_UNSPECIFIED => 'GIT_HUB_APP_UNSPECIFIED', + self::DEVELOPER_CONNECT => 'DEVELOPER_CONNECT', + self::FIREBASE => 'FIREBASE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DeveloperConnect/src/V1/GitRepositoryLink.php b/DeveloperConnect/src/V1/GitRepositoryLink.php new file mode 100644 index 000000000000..028d0e8e9227 --- /dev/null +++ b/DeveloperConnect/src/V1/GitRepositoryLink.php @@ -0,0 +1,423 @@ +google.cloud.developerconnect.v1.GitRepositoryLink + */ +class GitRepositoryLink extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Resource name of the repository, in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. Git Clone URI. + * + * Generated from protobuf field string clone_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $clone_uri = ''; + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + protected $uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Resource name of the repository, in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * @type string $clone_uri + * Required. Git Clone URI. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. [Output only] Create timestamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. [Output only] Update timestamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. [Output only] Delete timestamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels as key value pairs + * @type string $etag + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type bool $reconciling + * Output only. Set to true when the connection is being set up or updated in + * the background. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Allows clients to store small amounts of arbitrary data. + * @type string $uid + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Resource name of the repository, in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Resource name of the repository, in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Git Clone URI. + * + * Generated from protobuf field string clone_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCloneUri() + { + return $this->clone_uri; + } + + /** + * Required. Git Clone URI. + * + * Generated from protobuf field string clone_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCloneUri($var) + { + GPBUtil::checkString($var, True); + $this->clone_uri = $var; + + return $this; + } + + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/InstallationState.php b/DeveloperConnect/src/V1/InstallationState.php new file mode 100644 index 000000000000..d386e6ed3283 --- /dev/null +++ b/DeveloperConnect/src/V1/InstallationState.php @@ -0,0 +1,145 @@ +google.cloud.developerconnect.v1.InstallationState + */ +class InstallationState extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Current step of the installation process. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $stage = 0; + /** + * Output only. Message of what the user should do next to continue the + * installation. Empty string if the installation is already complete. + * + * Generated from protobuf field string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $message = ''; + /** + * Output only. Link to follow for next action. Empty string if the + * installation is already complete. + * + * Generated from protobuf field string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $action_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $stage + * Output only. Current step of the installation process. + * @type string $message + * Output only. Message of what the user should do next to continue the + * installation. Empty string if the installation is already complete. + * @type string $action_uri + * Output only. Link to follow for next action. Empty string if the + * installation is already complete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Current step of the installation process. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStage() + { + return $this->stage; + } + + /** + * Output only. Current step of the installation process. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStage($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DeveloperConnect\V1\InstallationState\Stage::class); + $this->stage = $var; + + return $this; + } + + /** + * Output only. Message of what the user should do next to continue the + * installation. Empty string if the installation is already complete. + * + * Generated from protobuf field string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Output only. Message of what the user should do next to continue the + * installation. Empty string if the installation is already complete. + * + * Generated from protobuf field string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * Output only. Link to follow for next action. Empty string if the + * installation is already complete. + * + * Generated from protobuf field string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getActionUri() + { + return $this->action_uri; + } + + /** + * Output only. Link to follow for next action. Empty string if the + * installation is already complete. + * + * Generated from protobuf field string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setActionUri($var) + { + GPBUtil::checkString($var, True); + $this->action_uri = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/InstallationState/Stage.php b/DeveloperConnect/src/V1/InstallationState/Stage.php new file mode 100644 index 000000000000..7e94f1b2a813 --- /dev/null +++ b/DeveloperConnect/src/V1/InstallationState/Stage.php @@ -0,0 +1,77 @@ +google.cloud.developerconnect.v1.InstallationState.Stage + */ +class Stage +{ + /** + * No stage specified. + * + * Generated from protobuf enum STAGE_UNSPECIFIED = 0; + */ + const STAGE_UNSPECIFIED = 0; + /** + * Only for GitHub Enterprise. An App creation has been requested. + * The user needs to confirm the creation in their GitHub enterprise host. + * + * Generated from protobuf enum PENDING_CREATE_APP = 1; + */ + const PENDING_CREATE_APP = 1; + /** + * User needs to authorize the GitHub (or Enterprise) App via OAuth. + * + * Generated from protobuf enum PENDING_USER_OAUTH = 2; + */ + const PENDING_USER_OAUTH = 2; + /** + * User needs to follow the link to install the GitHub (or Enterprise) App. + * + * Generated from protobuf enum PENDING_INSTALL_APP = 3; + */ + const PENDING_INSTALL_APP = 3; + /** + * Installation process has been completed. + * + * Generated from protobuf enum COMPLETE = 10; + */ + const COMPLETE = 10; + + private static $valueToName = [ + self::STAGE_UNSPECIFIED => 'STAGE_UNSPECIFIED', + self::PENDING_CREATE_APP => 'PENDING_CREATE_APP', + self::PENDING_USER_OAUTH => 'PENDING_USER_OAUTH', + self::PENDING_INSTALL_APP => 'PENDING_INSTALL_APP', + self::COMPLETE => 'COMPLETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DeveloperConnect/src/V1/LinkableGitRepository.php b/DeveloperConnect/src/V1/LinkableGitRepository.php new file mode 100644 index 000000000000..800ae7c1241a --- /dev/null +++ b/DeveloperConnect/src/V1/LinkableGitRepository.php @@ -0,0 +1,68 @@ +google.cloud.developerconnect.v1.LinkableGitRepository + */ +class LinkableGitRepository extends \Google\Protobuf\Internal\Message +{ + /** + * The clone uri of the repository. + * + * Generated from protobuf field string clone_uri = 1; + */ + protected $clone_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $clone_uri + * The clone uri of the repository. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The clone uri of the repository. + * + * Generated from protobuf field string clone_uri = 1; + * @return string + */ + public function getCloneUri() + { + return $this->clone_uri; + } + + /** + * The clone uri of the repository. + * + * Generated from protobuf field string clone_uri = 1; + * @param string $var + * @return $this + */ + public function setCloneUri($var) + { + GPBUtil::checkString($var, True); + $this->clone_uri = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/ListConnectionsRequest.php b/DeveloperConnect/src/V1/ListConnectionsRequest.php new file mode 100644 index 000000000000..d89bfd8b485b --- /dev/null +++ b/DeveloperConnect/src/V1/ListConnectionsRequest.php @@ -0,0 +1,221 @@ +google.cloud.developerconnect.v1.ListConnectionsRequest + */ +class ListConnectionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListConnectionsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListConnectionsRequest + * Please see {@see DeveloperConnectClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\ListConnectionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListConnectionsRequest + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results + * @type string $order_by + * Optional. Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListConnectionsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListConnectionsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/ListConnectionsResponse.php b/DeveloperConnect/src/V1/ListConnectionsResponse.php new file mode 100644 index 000000000000..cfbb687e8868 --- /dev/null +++ b/DeveloperConnect/src/V1/ListConnectionsResponse.php @@ -0,0 +1,135 @@ +google.cloud.developerconnect.v1.ListConnectionsResponse + */ +class ListConnectionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Connection + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.Connection connections = 1; + */ + private $connections; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DeveloperConnect\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections + * The list of Connection + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The list of Connection + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.Connection connections = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnections() + { + return $this->connections; + } + + /** + * The list of Connection + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.Connection connections = 1; + * @param array<\Google\Cloud\DeveloperConnect\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DeveloperConnect\V1\Connection::class); + $this->connections = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/ListGitRepositoryLinksRequest.php b/DeveloperConnect/src/V1/ListGitRepositoryLinksRequest.php new file mode 100644 index 000000000000..181e7f962415 --- /dev/null +++ b/DeveloperConnect/src/V1/ListGitRepositoryLinksRequest.php @@ -0,0 +1,221 @@ +google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest + */ +class ListGitRepositoryLinksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListGitRepositoryLinksRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListGitRepositoryLinksRequest + * Please see {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\ListGitRepositoryLinksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListGitRepositoryLinksRequest + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results + * @type string $order_by + * Optional. Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListGitRepositoryLinksRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListGitRepositoryLinksRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/ListGitRepositoryLinksResponse.php b/DeveloperConnect/src/V1/ListGitRepositoryLinksResponse.php new file mode 100644 index 000000000000..523f56db1fbc --- /dev/null +++ b/DeveloperConnect/src/V1/ListGitRepositoryLinksResponse.php @@ -0,0 +1,135 @@ +google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse + */ +class ListGitRepositoryLinksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of GitRepositoryLinks + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_links = 1; + */ + private $git_repository_links; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DeveloperConnect\V1\GitRepositoryLink>|\Google\Protobuf\Internal\RepeatedField $git_repository_links + * The list of GitRepositoryLinks + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The list of GitRepositoryLinks + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_links = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGitRepositoryLinks() + { + return $this->git_repository_links; + } + + /** + * The list of GitRepositoryLinks + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_links = 1; + * @param array<\Google\Cloud\DeveloperConnect\V1\GitRepositoryLink>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGitRepositoryLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink::class); + $this->git_repository_links = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/OAuthCredential.php b/DeveloperConnect/src/V1/OAuthCredential.php new file mode 100644 index 000000000000..9b16b9fb193a --- /dev/null +++ b/DeveloperConnect/src/V1/OAuthCredential.php @@ -0,0 +1,106 @@ +google.cloud.developerconnect.v1.OAuthCredential + */ +class OAuthCredential extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A SecretManager resource containing the OAuth token that + * authorizes the connection. Format: `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string oauth_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $oauth_token_secret_version = ''; + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $oauth_token_secret_version + * Required. A SecretManager resource containing the OAuth token that + * authorizes the connection. Format: `projects/*/secrets/*/versions/*`. + * @type string $username + * Output only. The username associated with this token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. A SecretManager resource containing the OAuth token that + * authorizes the connection. Format: `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string oauth_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getOauthTokenSecretVersion() + { + return $this->oauth_token_secret_version; + } + + /** + * Required. A SecretManager resource containing the OAuth token that + * authorizes the connection. Format: `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string oauth_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setOauthTokenSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->oauth_token_secret_version = $var; + + return $this; + } + + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/OperationMetadata.php b/DeveloperConnect/src/V1/OperationMetadata.php new file mode 100644 index 000000000000..97c6dd80fd06 --- /dev/null +++ b/DeveloperConnect/src/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.developerconnect.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/UpdateConnectionRequest.php b/DeveloperConnect/src/V1/UpdateConnectionRequest.php new file mode 100644 index 000000000000..3c303ba1de8c --- /dev/null +++ b/DeveloperConnect/src/V1/UpdateConnectionRequest.php @@ -0,0 +1,314 @@ +google.cloud.developerconnect.v1.UpdateConnectionRequest + */ +class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $connection = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set to true, and the connection is not found a new connection + * will be created. In this situation `update_mask` is ignored. + * The creation will succeed only if the input connection has all the + * necessary information (e.g a github_config with both user_oauth_token and + * installation_id properties). + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\DeveloperConnect\V1\Connection $connection Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\DeveloperConnect\V1\UpdateConnectionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\DeveloperConnect\V1\Connection $connection, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setConnection($connection) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\DeveloperConnect\V1\Connection $connection + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allow_missing + * Optional. If set to true, and the connection is not found a new connection + * will be created. In this situation `update_mask` is ignored. + * The creation will succeed only if the input connection has all the + * necessary information (e.g a github_config with both user_oauth_token and + * installation_id properties). + * @type bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\Connection|null + */ + public function getConnection() + { + return $this->connection; + } + + public function hasConnection() + { + return isset($this->connection); + } + + public function clearConnection() + { + unset($this->connection); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\Connection $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\Connection::class); + $this->connection = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, and the connection is not found a new connection + * will be created. In this situation `update_mask` is ignored. + * The creation will succeed only if the input connection has all the + * necessary information (e.g a github_config with both user_oauth_token and + * installation_id properties). + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, and the connection is not found a new connection + * will be created. In this situation `update_mask` is ignored. + * The creation will succeed only if the input connection has all the + * necessary information (e.g a github_config with both user_oauth_token and + * installation_id properties). + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/DeveloperConnect/src/V1/gapic_metadata.json b/DeveloperConnect/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..5608238a31fe --- /dev/null +++ b/DeveloperConnect/src/V1/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.developerconnect.v1", + "libraryPackage": "Google\\Cloud\\DeveloperConnect\\V1", + "services": { + "DeveloperConnect": { + "clients": { + "grpc": { + "libraryClient": "DeveloperConnectGapicClient", + "rpcs": { + "CreateConnection": { + "methods": [ + "createConnection" + ] + }, + "CreateGitRepositoryLink": { + "methods": [ + "createGitRepositoryLink" + ] + }, + "DeleteConnection": { + "methods": [ + "deleteConnection" + ] + }, + "DeleteGitRepositoryLink": { + "methods": [ + "deleteGitRepositoryLink" + ] + }, + "FetchGitHubInstallations": { + "methods": [ + "fetchGitHubInstallations" + ] + }, + "FetchGitRefs": { + "methods": [ + "fetchGitRefs" + ] + }, + "FetchLinkableGitRepositories": { + "methods": [ + "fetchLinkableGitRepositories" + ] + }, + "FetchReadToken": { + "methods": [ + "fetchReadToken" + ] + }, + "FetchReadWriteToken": { + "methods": [ + "fetchReadWriteToken" + ] + }, + "GetConnection": { + "methods": [ + "getConnection" + ] + }, + "GetGitRepositoryLink": { + "methods": [ + "getGitRepositoryLink" + ] + }, + "ListConnections": { + "methods": [ + "listConnections" + ] + }, + "ListGitRepositoryLinks": { + "methods": [ + "listGitRepositoryLinks" + ] + }, + "UpdateConnection": { + "methods": [ + "updateConnection" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/DeveloperConnect/src/V1/resources/developer_connect_client_config.json b/DeveloperConnect/src/V1/resources/developer_connect_client_config.json new file mode 100644 index 000000000000..06fd6f7d2aec --- /dev/null +++ b/DeveloperConnect/src/V1/resources/developer_connect_client_config.json @@ -0,0 +1,114 @@ +{ + "interfaces": { + "google.cloud.developerconnect.v1.DeveloperConnect": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateGitRepositoryLink": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteGitRepositoryLink": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FetchGitHubInstallations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FetchGitRefs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "FetchLinkableGitRepositories": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FetchReadToken": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FetchReadWriteToken": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetGitRepositoryLink": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConnections": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListGitRepositoryLinks": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/DeveloperConnect/src/V1/resources/developer_connect_descriptor_config.php b/DeveloperConnect/src/V1/resources/developer_connect_descriptor_config.php new file mode 100644 index 000000000000..798b2cd088fb --- /dev/null +++ b/DeveloperConnect/src/V1/resources/developer_connect_descriptor_config.php @@ -0,0 +1,304 @@ + [ + 'google.cloud.developerconnect.v1.DeveloperConnect' => [ + 'CreateConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DeveloperConnect\V1\Connection', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateGitRepositoryLink' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DeveloperConnect\V1\GitRepositoryLink', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteGitRepositoryLink' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DeveloperConnect\V1\Connection', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'connection.name', + 'fieldAccessors' => [ + 'getConnection', + 'getName', + ], + ], + ], + ], + 'FetchGitHubInstallations' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'connection', + 'fieldAccessors' => [ + 'getConnection', + ], + ], + ], + ], + 'FetchGitRefs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRefNames', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchGitRefsResponse', + 'headerParams' => [ + [ + 'keyName' => 'git_repository_link', + 'fieldAccessors' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'FetchLinkableGitRepositories' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLinkableGitRepositories', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchLinkableGitRepositoriesResponse', + 'headerParams' => [ + [ + 'keyName' => 'connection', + 'fieldAccessors' => [ + 'getConnection', + ], + ], + ], + ], + 'FetchReadToken' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchReadTokenResponse', + 'headerParams' => [ + [ + 'keyName' => 'git_repository_link', + 'fieldAccessors' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'FetchReadWriteToken' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchReadWriteTokenResponse', + 'headerParams' => [ + [ + 'keyName' => 'git_repository_link', + 'fieldAccessors' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'GetConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\Connection', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetGitRepositoryLink' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\GitRepositoryLink', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConnections', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\ListConnectionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListGitRepositoryLinks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGitRepositoryLinks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\ListGitRepositoryLinksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'connection' => 'projects/{project}/locations/{location}/connections/{connection}', + 'gitRepositoryLink' => 'projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}', + 'location' => 'projects/{project}/locations/{location}', + 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{secret_version}', + ], + ], + ], +]; diff --git a/DeveloperConnect/src/V1/resources/developer_connect_rest_client_config.php b/DeveloperConnect/src/V1/resources/developer_connect_rest_client_config.php new file mode 100644 index 000000000000..d9554a9a05f1 --- /dev/null +++ b/DeveloperConnect/src/V1/resources/developer_connect_rest_client_config.php @@ -0,0 +1,269 @@ + [ + 'google.cloud.developerconnect.v1.DeveloperConnect' => [ + 'CreateConnection' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/connections', + 'body' => 'connection', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'connection_id', + ], + ], + 'CreateGitRepositoryLink' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/connections/*}/gitRepositoryLinks', + 'body' => 'git_repository_link', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'git_repository_link_id', + ], + ], + 'DeleteConnection' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteGitRepositoryLink' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FetchGitHubInstallations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{connection=projects/*/locations/*/connections/*}:fetchGitHubInstallations', + 'placeholders' => [ + 'connection' => [ + 'getters' => [ + 'getConnection', + ], + ], + ], + ], + 'FetchGitRefs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{git_repository_link=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchGitRefs', + 'placeholders' => [ + 'git_repository_link' => [ + 'getters' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'FetchLinkableGitRepositories' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{connection=projects/*/locations/*/connections/*}:fetchLinkableGitRepositories', + 'placeholders' => [ + 'connection' => [ + 'getters' => [ + 'getConnection', + ], + ], + ], + ], + 'FetchReadToken' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{git_repository_link=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchReadToken', + 'body' => '*', + 'placeholders' => [ + 'git_repository_link' => [ + 'getters' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'FetchReadWriteToken' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{git_repository_link=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchReadWriteToken', + 'body' => '*', + 'placeholders' => [ + 'git_repository_link' => [ + 'getters' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'GetConnection' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGitRepositoryLink' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConnections' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/connections', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListGitRepositoryLinks' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/connections/*}/gitRepositoryLinks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateConnection' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{connection.name=projects/*/locations/*/connections/*}', + 'body' => 'connection', + 'placeholders' => [ + 'connection.name' => [ + 'getters' => [ + 'getConnection', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/DeveloperConnect/tests/Unit/V1/Client/DeveloperConnectClientTest.php b/DeveloperConnect/tests/Unit/V1/Client/DeveloperConnectClientTest.php new file mode 100644 index 000000000000..196bff7e617b --- /dev/null +++ b/DeveloperConnect/tests/Unit/V1/Client/DeveloperConnectClientTest.php @@ -0,0 +1,1676 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return DeveloperConnectClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DeveloperConnectClient($options); + } + + /** @test */ + public function createConnectionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $disabled = true; + $reconciling = false; + $etag = 'etag3123477'; + $uid = 'uid115792'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connectionId = 'connectionId-513204708'; + $connection = new Connection(); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnectionId($connectionId) + ->setConnection($connection); + $response = $gapicClient->createConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/CreateConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getConnectionId(); + $this->assertProtobufEquals($connectionId, $actualValue); + $actualValue = $actualApiRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConnectionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConnectionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connectionId = 'connectionId-513204708'; + $connection = new Connection(); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnectionId($connectionId) + ->setConnection($connection); + $response = $gapicClient->createConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConnectionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createGitRepositoryLinkTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGitRepositoryLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $cloneUri = 'cloneUri-625288310'; + $etag = 'etag3123477'; + $reconciling = false; + $uid = 'uid115792'; + $expectedResponse = new GitRepositoryLink(); + $expectedResponse->setName($name); + $expectedResponse->setCloneUri($cloneUri); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createGitRepositoryLinkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $gitRepositoryLink = new GitRepositoryLink(); + $gitRepositoryLinkCloneUri = 'gitRepositoryLinkCloneUri754275269'; + $gitRepositoryLink->setCloneUri($gitRepositoryLinkCloneUri); + $gitRepositoryLinkId = 'gitRepositoryLinkId1580978456'; + $request = (new CreateGitRepositoryLinkRequest()) + ->setParent($formattedParent) + ->setGitRepositoryLink($gitRepositoryLink) + ->setGitRepositoryLinkId($gitRepositoryLinkId); + $response = $gapicClient->createGitRepositoryLink($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.developerconnect.v1.DeveloperConnect/CreateGitRepositoryLink', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getGitRepositoryLink(); + $this->assertProtobufEquals($gitRepositoryLink, $actualValue); + $actualValue = $actualApiRequestObject->getGitRepositoryLinkId(); + $this->assertProtobufEquals($gitRepositoryLinkId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGitRepositoryLinkTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createGitRepositoryLinkExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGitRepositoryLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $gitRepositoryLink = new GitRepositoryLink(); + $gitRepositoryLinkCloneUri = 'gitRepositoryLinkCloneUri754275269'; + $gitRepositoryLink->setCloneUri($gitRepositoryLinkCloneUri); + $gitRepositoryLinkId = 'gitRepositoryLinkId1580978456'; + $request = (new CreateGitRepositoryLinkRequest()) + ->setParent($formattedParent) + ->setGitRepositoryLink($gitRepositoryLink) + ->setGitRepositoryLinkId($gitRepositoryLinkId); + $response = $gapicClient->createGitRepositoryLink($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGitRepositoryLinkTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConnectionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new DeleteConnectionRequest())->setName($formattedName); + $response = $gapicClient->deleteConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/DeleteConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConnectionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConnectionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new DeleteConnectionRequest())->setName($formattedName); + $response = $gapicClient->deleteConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConnectionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteGitRepositoryLinkTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteGitRepositoryLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteGitRepositoryLinkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $request = (new DeleteGitRepositoryLinkRequest())->setName($formattedName); + $response = $gapicClient->deleteGitRepositoryLink($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.developerconnect.v1.DeveloperConnect/DeleteGitRepositoryLink', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteGitRepositoryLinkTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteGitRepositoryLinkExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteGitRepositoryLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $request = (new DeleteGitRepositoryLinkRequest())->setName($formattedName); + $response = $gapicClient->deleteGitRepositoryLink($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteGitRepositoryLinkTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function fetchGitHubInstallationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new FetchGitHubInstallationsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new FetchGitHubInstallationsRequest())->setConnection($formattedConnection); + $response = $gapicClient->fetchGitHubInstallations($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.developerconnect.v1.DeveloperConnect/FetchGitHubInstallations', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($formattedConnection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchGitHubInstallationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new FetchGitHubInstallationsRequest())->setConnection($formattedConnection); + try { + $gapicClient->fetchGitHubInstallations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchGitRefsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $refNamesElement = 'refNamesElement2048025177'; + $refNames = [$refNamesElement]; + $expectedResponse = new FetchGitRefsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRefNames($refNames); + $transport->addResponse($expectedResponse); + // Mock request + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $refType = RefType::REF_TYPE_UNSPECIFIED; + $request = (new FetchGitRefsRequest())->setGitRepositoryLink($formattedGitRepositoryLink)->setRefType($refType); + $response = $gapicClient->fetchGitRefs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRefNames()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/FetchGitRefs', $actualFuncCall); + $actualValue = $actualRequestObject->getGitRepositoryLink(); + $this->assertProtobufEquals($formattedGitRepositoryLink, $actualValue); + $actualValue = $actualRequestObject->getRefType(); + $this->assertProtobufEquals($refType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchGitRefsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $refType = RefType::REF_TYPE_UNSPECIFIED; + $request = (new FetchGitRefsRequest())->setGitRepositoryLink($formattedGitRepositoryLink)->setRefType($refType); + try { + $gapicClient->fetchGitRefs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchLinkableGitRepositoriesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $linkableGitRepositoriesElement = new LinkableGitRepository(); + $linkableGitRepositories = [$linkableGitRepositoriesElement]; + $expectedResponse = new FetchLinkableGitRepositoriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLinkableGitRepositories($linkableGitRepositories); + $transport->addResponse($expectedResponse); + // Mock request + $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new FetchLinkableGitRepositoriesRequest())->setConnection($formattedConnection); + $response = $gapicClient->fetchLinkableGitRepositories($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLinkableGitRepositories()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.developerconnect.v1.DeveloperConnect/FetchLinkableGitRepositories', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($formattedConnection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchLinkableGitRepositoriesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new FetchLinkableGitRepositoriesRequest())->setConnection($formattedConnection); + try { + $gapicClient->fetchLinkableGitRepositories($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchReadTokenTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $token = 'token110541305'; + $gitUsername = 'gitUsername-786639197'; + $expectedResponse = new FetchReadTokenResponse(); + $expectedResponse->setToken($token); + $expectedResponse->setGitUsername($gitUsername); + $transport->addResponse($expectedResponse); + // Mock request + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $request = (new FetchReadTokenRequest())->setGitRepositoryLink($formattedGitRepositoryLink); + $response = $gapicClient->fetchReadToken($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/FetchReadToken', $actualFuncCall); + $actualValue = $actualRequestObject->getGitRepositoryLink(); + $this->assertProtobufEquals($formattedGitRepositoryLink, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchReadTokenExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $request = (new FetchReadTokenRequest())->setGitRepositoryLink($formattedGitRepositoryLink); + try { + $gapicClient->fetchReadToken($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchReadWriteTokenTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $token = 'token110541305'; + $gitUsername = 'gitUsername-786639197'; + $expectedResponse = new FetchReadWriteTokenResponse(); + $expectedResponse->setToken($token); + $expectedResponse->setGitUsername($gitUsername); + $transport->addResponse($expectedResponse); + // Mock request + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $request = (new FetchReadWriteTokenRequest())->setGitRepositoryLink($formattedGitRepositoryLink); + $response = $gapicClient->fetchReadWriteToken($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/FetchReadWriteToken', $actualFuncCall); + $actualValue = $actualRequestObject->getGitRepositoryLink(); + $this->assertProtobufEquals($formattedGitRepositoryLink, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchReadWriteTokenExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $request = (new FetchReadWriteTokenRequest())->setGitRepositoryLink($formattedGitRepositoryLink); + try { + $gapicClient->fetchReadWriteToken($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $disabled = true; + $reconciling = false; + $etag = 'etag3123477'; + $uid = 'uid115792'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new GetConnectionRequest())->setName($formattedName); + $response = $gapicClient->getConnection($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/GetConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new GetConnectionRequest())->setName($formattedName); + try { + $gapicClient->getConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGitRepositoryLinkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $cloneUri = 'cloneUri-625288310'; + $etag = 'etag3123477'; + $reconciling = false; + $uid = 'uid115792'; + $expectedResponse = new GitRepositoryLink(); + $expectedResponse->setName($name2); + $expectedResponse->setCloneUri($cloneUri); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $request = (new GetGitRepositoryLinkRequest())->setName($formattedName); + $response = $gapicClient->getGitRepositoryLink($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/GetGitRepositoryLink', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGitRepositoryLinkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $request = (new GetGitRepositoryLinkRequest())->setName($formattedName); + try { + $gapicClient->getGitRepositoryLink($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $connectionsElement = new Connection(); + $connections = [$connectionsElement]; + $expectedResponse = new ListConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConnections($connections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConnectionsRequest())->setParent($formattedParent); + $response = $gapicClient->listConnections($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/ListConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConnectionsRequest())->setParent($formattedParent); + try { + $gapicClient->listConnections($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGitRepositoryLinksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $gitRepositoryLinksElement = new GitRepositoryLink(); + $gitRepositoryLinks = [$gitRepositoryLinksElement]; + $expectedResponse = new ListGitRepositoryLinksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGitRepositoryLinks($gitRepositoryLinks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new ListGitRepositoryLinksRequest())->setParent($formattedParent); + $response = $gapicClient->listGitRepositoryLinks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGitRepositoryLinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/ListGitRepositoryLinks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGitRepositoryLinksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new ListGitRepositoryLinksRequest())->setParent($formattedParent); + try { + $gapicClient->listGitRepositoryLinks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateConnectionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $disabled = true; + $reconciling = false; + $etag = 'etag3123477'; + $uid = 'uid115792'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $connection = new Connection(); + $request = (new UpdateConnectionRequest())->setUpdateMask($updateMask)->setConnection($connection); + $response = $gapicClient->updateConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/UpdateConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateConnectionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateConnectionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $connection = new Connection(); + $request = (new UpdateConnectionRequest())->setUpdateMask($updateMask)->setConnection($connection); + $response = $gapicClient->updateConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateConnectionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [$locationsElement]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConnectionAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $disabled = true; + $reconciling = false; + $etag = 'etag3123477'; + $uid = 'uid115792'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connectionId = 'connectionId-513204708'; + $connection = new Connection(); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnectionId($connectionId) + ->setConnection($connection); + $response = $gapicClient->createConnectionAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/CreateConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getConnectionId(); + $this->assertProtobufEquals($connectionId, $actualValue); + $actualValue = $actualApiRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConnectionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/Dialogflow/.repo-metadata.json b/Dialogflow/.repo-metadata.json deleted file mode 100644 index 48e8e03f96f9..000000000000 --- a/Dialogflow/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-dialogflow", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dialogflow/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "dialogflow" -} diff --git a/Dialogflow/VERSION b/Dialogflow/VERSION index f8f4f03b3dcc..81f363239f55 100644 --- a/Dialogflow/VERSION +++ b/Dialogflow/VERSION @@ -1 +1 @@ -1.12.1 +1.12.3 diff --git a/Dialogflow/composer.json b/Dialogflow/composer.json index 196c03988ff7..33cfdea3f675 100644 --- a/Dialogflow/composer.json +++ b/Dialogflow/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/DialogflowCx/.repo-metadata.json b/DialogflowCx/.repo-metadata.json deleted file mode 100644 index 45b32b0b95d3..000000000000 --- a/DialogflowCx/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-dialogflow-cx", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "dialogflow" -} diff --git a/DialogflowCx/VERSION b/DialogflowCx/VERSION index d15723fbe8de..42045acae20f 100644 --- a/DialogflowCx/VERSION +++ b/DialogflowCx/VERSION @@ -1 +1 @@ -0.3.2 +0.3.4 diff --git a/DialogflowCx/composer.json b/DialogflowCx/composer.json index 30b708619001..2496585a86f2 100644 --- a/DialogflowCx/composer.json +++ b/DialogflowCx/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/DialogflowCx/src/V3/Client/AgentsClient.php b/DialogflowCx/src/V3/Client/AgentsClient.php index d4a8b03c89ae..e0d1a4da8944 100644 --- a/DialogflowCx/src/V3/Client/AgentsClient.php +++ b/DialogflowCx/src/V3/Client/AgentsClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -53,6 +52,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use Google\Protobuf\Struct; use GuzzleHttp\Promise\PromiseInterface; @@ -164,6 +164,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a agent * resource. diff --git a/DialogflowCx/src/V3/Client/EntityTypesClient.php b/DialogflowCx/src/V3/Client/EntityTypesClient.php index 7080d82bd42d..57afbb660299 100644 --- a/DialogflowCx/src/V3/Client/EntityTypesClient.php +++ b/DialogflowCx/src/V3/Client/EntityTypesClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -46,6 +45,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -152,6 +152,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a agent * resource. diff --git a/DialogflowCx/src/V3/Client/EnvironmentsClient.php b/DialogflowCx/src/V3/Client/EnvironmentsClient.php index 6b7fa9d2dd74..e8ead5abb135 100644 --- a/DialogflowCx/src/V3/Client/EnvironmentsClient.php +++ b/DialogflowCx/src/V3/Client/EnvironmentsClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -52,6 +51,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use Google\Protobuf\Struct; use GuzzleHttp\Promise\PromiseInterface; @@ -162,6 +162,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a agent * resource. diff --git a/DialogflowCx/src/V3/Client/FlowsClient.php b/DialogflowCx/src/V3/Client/FlowsClient.php index 56d729704c95..f6d1974f7d3a 100644 --- a/DialogflowCx/src/V3/Client/FlowsClient.php +++ b/DialogflowCx/src/V3/Client/FlowsClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -52,6 +51,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use Google\Protobuf\Struct; use GuzzleHttp\Promise\PromiseInterface; @@ -162,6 +162,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a agent * resource. diff --git a/DialogflowCx/src/V3/Client/IntentsClient.php b/DialogflowCx/src/V3/Client/IntentsClient.php index 0363a64a9589..b3878433f39a 100644 --- a/DialogflowCx/src/V3/Client/IntentsClient.php +++ b/DialogflowCx/src/V3/Client/IntentsClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -50,6 +49,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -156,6 +156,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a agent * resource. diff --git a/DialogflowCx/src/V3/Client/TestCasesClient.php b/DialogflowCx/src/V3/Client/TestCasesClient.php index aced424625d3..08dfcf67129a 100644 --- a/DialogflowCx/src/V3/Client/TestCasesClient.php +++ b/DialogflowCx/src/V3/Client/TestCasesClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -61,6 +60,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -173,6 +173,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a agent * resource. diff --git a/DialogflowCx/src/V3/Client/VersionsClient.php b/DialogflowCx/src/V3/Client/VersionsClient.php index d87262632fd0..799b5072c5b5 100644 --- a/DialogflowCx/src/V3/Client/VersionsClient.php +++ b/DialogflowCx/src/V3/Client/VersionsClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -48,6 +47,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use Google\Protobuf\Struct; use GuzzleHttp\Promise\PromiseInterface; @@ -155,6 +155,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a flow * resource. diff --git a/DialogflowCx/tests/Unit/V3/Client/AgentsClientTest.php b/DialogflowCx/tests/Unit/V3/Client/AgentsClientTest.php index 9707ce135d4f..1b25561cc68a 100644 --- a/DialogflowCx/tests/Unit/V3/Client/AgentsClientTest.php +++ b/DialogflowCx/tests/Unit/V3/Client/AgentsClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Dialogflow\Cx\V3\Agent; @@ -48,6 +47,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DialogflowCx/tests/Unit/V3/Client/EntityTypesClientTest.php b/DialogflowCx/tests/Unit/V3/Client/EntityTypesClientTest.php index 5e0ad9cc880f..4dc2c0ad5179 100644 --- a/DialogflowCx/tests/Unit/V3/Client/EntityTypesClientTest.php +++ b/DialogflowCx/tests/Unit/V3/Client/EntityTypesClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Dialogflow\Cx\V3\Client\EntityTypesClient; @@ -45,6 +44,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DialogflowCx/tests/Unit/V3/Client/EnvironmentsClientTest.php b/DialogflowCx/tests/Unit/V3/Client/EnvironmentsClientTest.php index 6dde3e39f8f9..acc1c85095aa 100644 --- a/DialogflowCx/tests/Unit/V3/Client/EnvironmentsClientTest.php +++ b/DialogflowCx/tests/Unit/V3/Client/EnvironmentsClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Dialogflow\Cx\V3\Client\EnvironmentsClient; @@ -48,6 +47,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DialogflowCx/tests/Unit/V3/Client/FlowsClientTest.php b/DialogflowCx/tests/Unit/V3/Client/FlowsClientTest.php index 722f13118178..e1d37e2a1369 100644 --- a/DialogflowCx/tests/Unit/V3/Client/FlowsClientTest.php +++ b/DialogflowCx/tests/Unit/V3/Client/FlowsClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Dialogflow\Cx\V3\Client\FlowsClient; @@ -47,6 +46,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DialogflowCx/tests/Unit/V3/Client/IntentsClientTest.php b/DialogflowCx/tests/Unit/V3/Client/IntentsClientTest.php index 2b55dc9486ea..fc264b5c4ca5 100644 --- a/DialogflowCx/tests/Unit/V3/Client/IntentsClientTest.php +++ b/DialogflowCx/tests/Unit/V3/Client/IntentsClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Dialogflow\Cx\V3\Client\IntentsClient; @@ -43,6 +42,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DialogflowCx/tests/Unit/V3/Client/TestCasesClientTest.php b/DialogflowCx/tests/Unit/V3/Client/TestCasesClientTest.php index dafed7bde7e6..dfb0a0cb402f 100644 --- a/DialogflowCx/tests/Unit/V3/Client/TestCasesClientTest.php +++ b/DialogflowCx/tests/Unit/V3/Client/TestCasesClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Dialogflow\Cx\V3\BatchDeleteTestCasesRequest; @@ -53,6 +52,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DialogflowCx/tests/Unit/V3/Client/VersionsClientTest.php b/DialogflowCx/tests/Unit/V3/Client/VersionsClientTest.php index 886f7af0a9e3..26780cab9844 100644 --- a/DialogflowCx/tests/Unit/V3/Client/VersionsClientTest.php +++ b/DialogflowCx/tests/Unit/V3/Client/VersionsClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Dialogflow\Cx\V3\Client\VersionsClient; @@ -42,6 +41,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/.repo-metadata.json b/DiscoveryEngine/.repo-metadata.json deleted file mode 100644 index 32e4fb95f2ec..000000000000 --- a/DiscoveryEngine/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-discoveryengine", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-discoveryengine/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "discoveryengine" -} diff --git a/DiscoveryEngine/VERSION b/DiscoveryEngine/VERSION index af88ba824866..1a96df19c09a 100644 --- a/DiscoveryEngine/VERSION +++ b/DiscoveryEngine/VERSION @@ -1 +1 @@ -0.11.1 +0.11.3 diff --git a/DiscoveryEngine/composer.json b/DiscoveryEngine/composer.json index db14e06c264b..00325a56de6c 100644 --- a/DiscoveryEngine/composer.json +++ b/DiscoveryEngine/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/DiscoveryEngine/metadata/V1/Answer.php b/DiscoveryEngine/metadata/V1/Answer.php new file mode 100644 index 0000000000000000000000000000000000000000..5be4009e530414db29329bb1fd9e9a98ca628b3d GIT binary patch literal 5112 zcmcIo&2!tv6*ozJ@zIv$O={Dq6T^xV%QFgCF&$5aik(6v#4wRbnxK>@VF!i46@`QX zP<*IST^)MpOs9wb5uNEFozCQxf1t-+dhV?~Hh)46ZQt$!5G7F+6}!3!T3K>w*$*Pp#C9s2DU>>2P-Ah34Vd+IWT}@?$f|CEh^XB zYfout_RY}j)j3A5$}oDhlNi0Nl~n+1Xa<3-ax8cbGX8nd&d|2xAT&e#ci#>S+p$C2 z9NND`dmhWX<}jdm^z7c<$gx7(b!2v+$h=hr81yl>PWV-^e`67;Ot#_N$6OqoKfOiBF~O&{1_OoLpRbuxld+LUZ36 zf0q0I?I(8ZZMEM|ox6@yTuR-+obv$wc@LH^!$ERa>{d8ql~asW4pyYwF`VhyB|r9$ z;IDKie#P00oG1m{3Gv$)xs<*Q6HCR0#Xr9eGlIk9228PBC}!l$QhqJ>4|STn2h)rw zw3x-U`SRP!1&S&HO3~RN@(L70su>~uGA!m8E~!G^vRQ(-PEeeZb4!Ktk0yn!#s`T8 z;8QFH6f-3#PIHu%Nl`k5e(?AsR8QhFr8+>7V9va|NGhi+) zpuY3v)k*P1z;pr9;TYt{P_Pg#qy}S4agJ*&C5Q=?lr(7=S90VLTw|qqNRxBWz>3`0Olf6GGgJc;B9%q2#}^0nACxfU!KbpZfRBElVwIL zb~PC6ZpV7T+;=OHmJ(WAAJV&U^~CAxFdHi>TtRNZbHHDFmnvgi%?!(5E~IM&7O+5`aNt@#4XgC~ zIhf*wTTSjemc#Sq@}%BlhmSA4e%y@VbrL541~lArqrqNs3)W!PuXBl3 zVu382u7m%xusLuwaM*Pm-vpw)`Q!y%bwWi&7Xo+}@cD^bL9{_zFI8Gv&7?QW7s&=f-C79Lxy9FMbHqqV4bX4S(jO|779jIi1%b z+!nnZ|Ng`3Z}GH9u71{xOdNvoA{4${WuKQRJPWt-P&kW zw~ehvYeVfeTFr&2%5QSts=v;`n-???!cJmgQ}a2s!l3j#emW`*T|re`OCFC(tRd2I zY(R09JsSc0aa0N@vJbx}O3&k`qj+qBE8@%Ji2Q0&AvnDmqA~*S_{WP$k6u{1mH?Y&aD8beWA`)#js%d9FeJUETv+{@R z^;$!(wlJ%oIF-sNph{(HWoHImAG+^6Nar5QVrVonV`6uJZH<{P@ttA{bOc8L{{^;Bjhp}g literal 0 HcmV?d00001 diff --git a/DiscoveryEngine/metadata/V1/Common.php b/DiscoveryEngine/metadata/V1/Common.php index f75a7503f7096f81d3da5e57b4e8b73421187700..6efb461445e1814826c46e3d8f1ca4d65f1c5449 100644 GIT binary patch delta 418 zcmZ1|+$Xs~nu%$-$Yxn43#R%EF5ckO#G>Sk(Bf3*#Nt#Tc`oT-SH~b{kND7F*LY_~ zAQ9>p9N_Bg>E`L`BETRd#U+NW0Kykw#3tty)6ycN3b_BGS_nHfg}api}FkJ zQZn<>o%8e3GSh{;fl4&g(osc=^{e3`@yTF?wXYn@C&#cW@&_g6Wh1n^gS3kjA&UVu zgZPuraH&>$&Ng}00ET@i2wiq diff --git a/DiscoveryEngine/metadata/V1/Control.php b/DiscoveryEngine/metadata/V1/Control.php new file mode 100644 index 0000000000000000000000000000000000000000..940ff56533a75c63d8991a5f4abc0f1f7a48b563 GIT binary patch literal 2887 zcmbtW-EJF26edoS#*?46%Z+OZbx14frpcNF5YmPe*>M^o(Ihw_QqfAQ_3qdiSkEjo zyOvDxTkrsgOCEzuZn)qDxb7ox17~J-*ZIYX$W1nz^L^*ccfK=wKKndAjnQMgOBfM; zLPFdb;^dUzSnz}gJi?u{+a&@AydTqu2pi+p0p342#yhROV=6JhC-2Ld@?I8T$djyNAtJB=JK(@!efb;%+Mvw{@Px zJz3vGD2RM1@wOpDZxDu`IPF9vq*QNe&$6_N zj&^a))aW>uirm79NXgmk7z>i5f^F)$6~U-@a<34r5mWaiB~jQUr~ZI);W*<{jY+P9 zwn^5>8>6o4lDp0Oea>#4zR>lUf+-TeA772t{aAZJGxZx`Scv@+%vmesQDQwsKi@}d zw{oTR$b{S4#P$Uf+k^G$!;H_5XQ*?^75j4}8~`l@gw=&2M~cPbk+e2<)#E`WV300eawr=Lf`7DLvt{9;r;< znozZ>t*})amB;LhXlCF?DXC21san~x5bCB;Hq$ z^BdLtT)8;5ir2odR?!?`p@~*>{~5jf6GC^htHSycEp#}SiKkA_S!GtEZ=|8Vx0(vv z(AY2DvG&nomqyTyobIls`y?;@ItQtiXgV+~pbNe>x+h3T1qq4*%bM}i8#A^u{8>&p zWSkBAGOrTdlJh9T7n~2!9d&b?_BN;gYRp&<(E?0L9Qi{}|4X%{to~K9R?vHJTl0Xb zPm3ps7*N*p0?xX$=h0AV-|5(C=+C0$QL1|5CBv9h?f}oy#@fX5A7!Xx05xYJttzU4 z%Bdt?;7cMabKvf!4SO;Z@kMa@wItgBvtGc*CLcgqnb8xnGLZxNYi73kBbq{Sgnl&!cqmhZ$LP&iJJqceGHJM7y58+sUH&#&X;+pq&xZ3=22eW68d1mVY5-P+Hg;N3xgx;Z?dORJ>mf@1DwIT{BcxQvTAkU?O5VbzM8;WXt}jEt9<5T*wqYRC~|i z)Hkopt(Jdvz;8W%Y1IQS!nSvzb#Z6&(wkpO_gZ^L+Xp8*?bkc|yLIKl& ztA*Xl7r-68McOCpzvmHdwj++0L=)q}miV@`Y-k)u^El20BF8yd@63Ye3IFJ6u{5lj U4eZRqcI~pJBh5-RLL-F!1td_>_y7O^ literal 0 HcmV?d00001 diff --git a/DiscoveryEngine/metadata/V1/ControlService.php b/DiscoveryEngine/metadata/V1/ControlService.php new file mode 100644 index 000000000000..466b78fa7df1 --- /dev/null +++ b/DiscoveryEngine/metadata/V1/ControlService.php @@ -0,0 +1,64 @@ +internalAddGeneratedFile( + ' +‰ +5google/cloud/discoveryengine/v1/control_service.protogoogle.cloud.discoveryengine.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto-google/cloud/discoveryengine/v1/control.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"¯ +CreateControlRequest> +parent ( B.àAúA(&discoveryengine.googleapis.com/Control> +control ( 2(.google.cloud.discoveryengine.v1.ControlBàA + +control_id ( BàA"Œ +UpdateControlRequest> +control ( 2(.google.cloud.discoveryengine.v1.ControlBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"T +DeleteControlRequest< +name ( B.àAúA( +&discoveryengine.googleapis.com/Control"Q +GetControlRequest< +name ( B.àAúA( +&discoveryengine.googleapis.com/Control"› +ListControlsRequest> +parent ( B.àAúA(&discoveryengine.googleapis.com/Control + page_size (BàA + +page_token ( BàA +filter ( BàA"k +ListControlsResponse: +controls ( 2(.google.cloud.discoveryengine.v1.Control +next_page_token ( 2å +ControlServiceÿ + CreateControl5.google.cloud.discoveryengine.v1.CreateControlRequest(.google.cloud.discoveryengine.v1.Control"ŒÚAparent,control,control_id‚Óä“é"9/v1/{parent=projects/*/locations/*/dataStores/*}/controls:controlZR"G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/controls:controlZO"D/v1/{parent=projects/*/locations/*/collections/*/engines/*}/controls:control½ + DeleteControl5.google.cloud.discoveryengine.v1.DeleteControlRequest.google.protobuf.Empty"ÜÚAname‚Óä“Î*9/v1/{name=projects/*/locations/*/dataStores/*/controls/*}ZI*G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}ZF*D/v1/{name=projects/*/locations/*/collections/*/engines/*/controls/*}‘ + UpdateControl5.google.cloud.discoveryengine.v1.UpdateControlRequest(.google.cloud.discoveryengine.v1.Control"žÚAcontrol,update_mask‚Óä“2A/v1/{control.name=projects/*/locations/*/dataStores/*/controls/*}:controlZZ2O/v1/{control.name=projects/*/locations/*/collections/*/dataStores/*/controls/*}:controlZW2L/v1/{control.name=projects/*/locations/*/collections/*/engines/*/controls/*}:controlÉ + +GetControl2.google.cloud.discoveryengine.v1.GetControlRequest(.google.cloud.discoveryengine.v1.Control"ÜÚAname‚Óä“Î9/v1/{name=projects/*/locations/*/dataStores/*/controls/*}ZIG/v1/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}ZFD/v1/{name=projects/*/locations/*/collections/*/engines/*/controls/*}Ü + ListControls4.google.cloud.discoveryengine.v1.ListControlsRequest5.google.cloud.discoveryengine.v1.ListControlsResponse"ÞÚAparent‚Óä“Î9/v1/{parent=projects/*/locations/*/dataStores/*}/controlsZIG/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/controlsZFD/v1/{parent=projects/*/locations/*/collections/*/engines/*}/controlsRÊAdiscoveryengine.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB† +#com.google.cloud.discoveryengine.v1BControlServiceProtoPZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb¢DISCOVERYENGINEªGoogle.Cloud.DiscoveryEngine.V1ÊGoogle\\Cloud\\DiscoveryEngine\\V1ê"Google::Cloud::DiscoveryEngine::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/DiscoveryEngine/metadata/V1/ConversationalSearchService.php b/DiscoveryEngine/metadata/V1/ConversationalSearchService.php index 0b644cdc5ec4be69e5fbeb9b1c486c31fd8328d9..88351832b322ea3026a5fa2af05c2750a3f27a86 100644 GIT binary patch literal 13510 zcmd5@+ixRR8DBe_-Q>$&lGAkSb(hvm+udxMb%@)lt@i>>;?0`PCfPViwW+C@*eA}g z&WxEEXPcHh6bZ@`5~@H*K!KKvL?s@0?;k)PDpVvMNes%Bvaf0=t)fyOyM0A1asRz)q)*uu)}Eo!Sp)mC#0oOEuEk>6l}y&oR3p)9<6K#zy4~HL>l!T=XX%c*rx|8mKcb zeM>@KJL~*3Ey?)|wJ-E63-#JLCD&TfR?@o_d%uURT*bFk>u&SC+(9l~)1*73ibdD@ zuVY-9aP5^@?*;fM4|9D8DCAK=Bwk>lBVHGk;(IgEha?xZqG9M_mMub2RPLN+Uu-k; z&2LHjl?%>#cAC;iCJ79dtAKN^IGrKeD@$E?z?R;gu^6dYyYJ`#$BCWdF9`b#Q&n7RZ{ z)+;Up3892ogkY36o z$lF>eGQfqIIZVZ2DnJsRS@aSLgd52moInz8hKmexi7o|7 zR2ZqEl=-r{Max#?cx(WVy4Wex+;4a-4=0#4z;GSBpQf?{3$?$U_<=-JVC(*A1$*N#hq~sYGG-;(QNQ@-T z2MV{!RySCJu+1(lVU1ZPuaGddRLi!7mdW&fB~S=qxs*3X!*-=1$UW zwn+LDS8!>@N^R&!XPadWw;Cz6SX2lkg6)DD+k)CN_Byr6#_*QjNyb+Oj z7BiK-&tv-zoH1#c^^bX;+gVp3;<`wKH+rGJDk$Q~E#9U$oJ8@IFNu~FSqV zBn~GFQY6SZF`#6RT1$z&0VNtymITWXL4YvLR&_LZZ1MD>hQ)`)IIy%hlK5gTP;u*6 z_mbpCI16K{wXYX;OhY%SR({tg(g@46L*xvc;zdQpqSd02*NTx7`1x@39Dql!n6s&_ zZk0umHWWP%<4v_vzwU4V#+!n=4ZwuJ_Me?tgzeQ{PTY)o{1zk4Prd^q7`w4t6^uk4 z%Jz-X3a9O0tm%bvwMg>?O*YirFNerE7?-wMR`pVqMaBZtfQWiAh-f7pvu0i`^0Lvy zF$8lTEN7Y543XRgcvLRY(aI$)i_*KyX2eQSB2K`=a$(uHmq%Bmd#Y};nwAx0STZ8H z8%Mqs3PlwduA%fGoD|w%{L$`3-j6;4;5i^h=L(h#yN(qM&pra@@@?2fe|!p!sAls; zI4K zZsBaKfGWUDR5S|JT{M3j@ogK@=&GNjO!0LO`+3PdgUr!9zlJl)ovMCU2qWUr_9rUL z9AhWAN8dUIkygTC6FuZWB?7?g)M4r(NK-aXcQmzddD7=>9~`TD0M zW!jY}D+D5Mhk$tG6#2lyDFGAno1eOvA|*#J!|8f}vDW5gwpK)3H5?R~!qCWRIPT;q z9vP!oVXX1ooo~MaqqXfq9#-gg$b18aU8f<>!60{7=@J(YQ|ICF0FU6i8xA!)?4EM= zI1FlR{1koXD4c0gwS5CyU!L6a{8j_;D)2eIw`SVv#dDhTi}R1?*aeEqidQzT!nhCv zhafwq%0^HYtJ*~H`cl6oz~PDD!c)!1A$X{jV0##1_A690ey0+peoNAbMSKnUDYxM$ z`%T7SbnVVcI={Y@T}jVnu4mHoqesYtFqWF%NUvs7tC`ed{`Pu$_0DJri@?az@=`vv zlzkz+n$M=wH#18M^4oCq2_XEGzQZ#MLQAXF-3p6P!kp!5*$O`k$3zs6=`DAmLoCSi zwI)*Nb0To3(?MdTBbbU3H1BEcm1P*k>4gy0>6|b7=De49zl^2r69LX7h$!C=!MGS% zN&XJm`=3@_>lp(vqk0`h6Emth(L97jt=loUJr1STU|bBP>IAvsgFeoo?|4*z_CAKn z>?_HipdqsgS`z(#oITxzaleGp*OD+~i5ZGBaq3vBEr(5sKcXWzmn8CLT(&sk+M2wB zoix@dtU>clLP>BX-)x(7p6Jy;Z*RU^V4-|B{9%gU)lcyZ@%7(-{6_e-u(H7J`Cnz1 zI#;p#{t7MF*7W3b*%0}Q{mt4EJ}PGaVCr}8OYr}Lr2K#;LzA1E%6cF*d_JL!OxU!k zE7~t8t6kC-k1+%ZO@1)|q;bAZlEG-V8p=nz8*3^*L(M!Orub7{e7TBV4=dOB!Nr13 zlyu^+d-G}tqeMleO=P(Roto)es=0@^- zAl40g9JGUTPm`@O&HoD{m%I{|u}gyAbN<*|lHj+e(Ap#FqWb1d34S;9T(hquM&2BN z5z%(=Hj6wJ2)k#s1NhV3ZIV#G9p(uCFs!U_kH&6$k4^b8LgCXTon-21xdkl;ckp^j z6%V{&HC0ev>Vj-*_}eo1vhrfjOkAC`<3K(R!?4?5l9@oH-L;N#I&P4aLtobZXNb)4 zvvr&#oL&J7Q=tZ?kKpPULN;)^?o2#-pX-}m!^v!54EAt&l z=BMc*--IA}7h(7H@g2bKTkpW$sucamXVmY9CIz%T81=zsW-_?l^Pkapb;Yg? zZzh&IrsjvM74kLOFC;`!)QO~i+D%pA5+=V517H}=%EwO|h6eZpkwX>ii3)(aYb!aP^O2t;n1IXJ2Hk&l;LpM>kjY?(7nv8F}1743A zj{~6!k9|Nw;v0D6iSIysNxyikH?@Wmq)3HK{=Fm`gFhlgmyc7Pd>(@namXjk492PF}OUIdFX~B z<8lIO3P~gqa3?J{lsrFzL%<>g6gG zkM}Bb&>h@$0=J*xc>fN#&fFK(YUaigYsHz0d-LVYHRJvO$0XpcSqGVU!TmLp-TvXf zBBPPTm_bQ+{PO=P+rL}n7FPQ@^|e1**N(y;2DRsp%84}}8`!`|p0Z7Bu5r#~(@RHN zr*{6Zu5|VecKgHb<8QnBy}kYJpVp0D;haw4oOs77NA4Dm>M>V&baHMJtLw4NE65%Mo{LjX7c literal 0 HcmV?d00001 diff --git a/DiscoveryEngine/metadata/V1/Engine.php b/DiscoveryEngine/metadata/V1/Engine.php index cfcf58661c9776ec30ab8df5b25aef83a65af54b..dc42397e8e7ea4843f5c59771367f157e6b859be 100644 GIT binary patch delta 63 zcmca4a#m!+Z6?MQlkYI?W_-MP26GOJstOm6bAE1aex7rFURq|lkO&t~a(-?>VqRr@ TUSe*l1fv3@2Ipoy4izQ<@H7;c delta 68 zcmX>ra!F*vZ6?OGlkYI?W_+=E26GOJmL?aEbAE1aex7rFURq|lkR%sRa(-?>VqRr@ YUSe*l1fv3@2B#DA14q`)nj9)j0Adjq761SM diff --git a/DiscoveryEngine/metadata/V1/GroundedGenerationService.php b/DiscoveryEngine/metadata/V1/GroundedGenerationService.php new file mode 100644 index 0000000000000000000000000000000000000000..ef9d4069acf95f805b9e619f88b9d143048686c3 GIT binary patch literal 2654 zcmbtW&u<$=6vj3V&7?`Ag%-z1&EOW*jp!PuQb8LG_*a~$%@2|i39z(U?~d&uo1JBL z)*)26aN>$MazNt9f5C-AkH8g)11J6jPQ0C2uj4pY8sUpqyYGGPd*8hG=Dq)+-}liS z+#(*~mLLx9oM6!>*yl_zo4L3XcDsaQn;rSoC0xh2v4gjFp5kU>^XZ%58nBSt#K1kq zdM+v1E(@KKLj#))2tOfSk9wpuD3^Mig`Ptkv!`NF=9vNE18NgpMnlN6j!58JHo>jk z+7=O(V+pI>lECeH1l(?n1Gf*#YY5q{6$H2y2Z(b4{Cx$Fo*@iBKkT^F#(}T|{N1I2 zNj)m4< zwJ(sd>eF`B^H`(;^8&*d_efk^FHCY;k+fBD zP_K6}19^rIKA`c5RUIcepmiwwVj^iI@ICbBJgWZhde@c}gf3e~Ki4w)pqzg_j$!!} z`YMuMbxJ<=EJYu>k-lap7C1IoI^)S>72{8(7b6Z*DTl%nq}BVxK1?Ls_ld17Bh99& zh)mIk7=7kCxfD(nQyVXRn@ZJgqF2pHi^7i?baNbTk9--DKxn&YQOyVlZQ9K1(w@Yd ztv&jyn*O)?4w}$Nr2;AhIt-{%!muvAwH#Wsyx^E{)3!W^!ZabdG%%diDk$5vY!T!# zI8&Tk)pdn5^(gcNdL7)f$7o?hH2^tsF9Yn{>cdNM##5I{evals7=)&4b%-0}vXasI z6_H{Q^-loli3DnTf}iBe=*GEM+8oLpk`pDZHjlCc%MD{)jP!e{!VejAYn&$Zp%1fy zXn8arguc(XFk!xPB0^bre2Rw^1q}|Rz7LB&@4<;Anmh2QqC&Muc23n=g7BFS!6d-P`H{VFBE!Y3i6eJ z0*UGcDk-UD3Z-NdMKY_sg>s`(u%kXPITSSI#L3No@3oC|)D71WG7}Cpgsz!!pKfS8t!6kK?`nTUGB1 z;Ri;kbbNdqQ%?qi6^g#vOdj~ICAy3s)xJxkJ1{gZ%d&QRs@n3R-%WkCr3UzLguo!` zv55@`xPTnzlJGlg6K{S>-)L;^*LMz@d!IJ9TbtX>pVP}NxdTCA!w#f3hC5JGE?4?N z`T5YI9j{5FJxSTLVNv=gT~IKFA#n`j9FSoglshwW7khXwx$)jsE614)W$Jb!E!7rr IicS&w585<>rvLx| literal 0 HcmV?d00001 diff --git a/DiscoveryEngine/metadata/V1/Grounding.php b/DiscoveryEngine/metadata/V1/Grounding.php new file mode 100644 index 000000000000..25019b5ab18a --- /dev/null +++ b/DiscoveryEngine/metadata/V1/Grounding.php @@ -0,0 +1,45 @@ +internalAddGeneratedFile( + ' +ö +/google/cloud/discoveryengine/v1/grounding.protogoogle.cloud.discoveryengine.v1google/api/resource.proto"© + GroundingFact + fact_text ( R + +attributes ( 2>.google.cloud.discoveryengine.v1.GroundingFact.AttributesEntry1 +AttributesEntry +key (  +value ( :8"Î + FactChunk + +chunk_text (  +source (  +index (W +source_metadata ( 2>.google.cloud.discoveryengine.v1.FactChunk.SourceMetadataEntry5 +SourceMetadataEntry +key (  +value ( :8B +#com.google.cloud.discoveryengine.v1BGroundingProtoPZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb¢DISCOVERYENGINEªGoogle.Cloud.DiscoveryEngine.V1ÊGoogle\\Cloud\\DiscoveryEngine\\V1ê"Google::Cloud::DiscoveryEngine::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/DiscoveryEngine/metadata/V1/Project.php b/DiscoveryEngine/metadata/V1/Project.php new file mode 100644 index 0000000000000000000000000000000000000000..6ad84e8d39bca3f22f929946789a8448373f3aa9 GIT binary patch literal 1876 zcmbVN-EP}96rSz6U77SJ!V09mDVr9n3#`)IwZNb>D{MEIUhfs^Xz$Ykf3|G!(t|hVj&(M zVs*f9B83uEM0h-(Oqj$}%n}|kX=Ci|;@<8M`(Af=7hF>@mz249D#SEm4voY-bV8m| zv0(C$#Zw+LXVGu~@pnd*ogpI>lNn1BLK*J#TRTjVkSG##GLWFHK?3h%kYK;Di4cuQ zn&Q3zLvIm=FPV=cPI0P;g5^F>M?B_=lZgKT6>Z@OiBbl>XKg3*m?|z}tQ~e^%IXiX z!PK_*69Eit;UX=Fsss=cbYsP2OrpSJDV01?LiWMbb*D@%snk35hj~~H$0xXMa&+A@ zNp4{!=j>#3j3rZZ8EmJK*^0U2` zbPPG%r6RNB{D>KikAC4fY0WTPaj_$+lEKp% zX~*?4oUA;q*?C3yGitK?w7;1nWlK8QbhgpiXzsqR#jt_4uUluIReaTY zfvQ^C3=$~SuRq@Wss!wThOiv8LMUa4GIUfgqQm+Tt%i(7&}fXu<%>KvUZbjsbqlQx zhRvZrdes~B{dRY|>w7o9u`G0b=z)E~-TlV+GSH#KPY;%@=m*n|PjqiBZ%)tY+?l26uSe(zp%1Q-XW{?= literal 0 HcmV?d00001 diff --git a/DiscoveryEngine/metadata/V1/ProjectService.php b/DiscoveryEngine/metadata/V1/ProjectService.php new file mode 100644 index 000000000000..7330a9a5783d --- /dev/null +++ b/DiscoveryEngine/metadata/V1/ProjectService.php @@ -0,0 +1,42 @@ +internalAddGeneratedFile( + ' +À +5google/cloud/discoveryengine/v1/project_service.protogoogle.cloud.discoveryengine.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto-google/cloud/discoveryengine/v1/project.proto#google/longrunning/operations.proto"  +ProvisionProjectRequest< +name ( B.àAúA( +&discoveryengine.googleapis.com/Project" +accept_data_use_terms (BàA# +data_use_terms_version ( BàA" +ProvisionProjectMetadata2ì +ProjectService… +ProvisionProject8.google.cloud.discoveryengine.v1.ProvisionProjectRequest.google.longrunning.Operation"—ÊAc +\'google.cloud.discoveryengine.v1.Project8google.cloud.discoveryengine.v1.ProvisionProjectMetadataÚAname‚Óä“$"/v1/{name=projects/*}:provision:*RÊAdiscoveryengine.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB† +#com.google.cloud.discoveryengine.v1BProjectServiceProtoPZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb¢DISCOVERYENGINEªGoogle.Cloud.DiscoveryEngine.V1ÊGoogle\\Cloud\\DiscoveryEngine\\V1ê"Google::Cloud::DiscoveryEngine::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/DiscoveryEngine/metadata/V1/RankService.php b/DiscoveryEngine/metadata/V1/RankService.php new file mode 100644 index 000000000000..9b9c7cdccf17 --- /dev/null +++ b/DiscoveryEngine/metadata/V1/RankService.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' +ï +2google/cloud/discoveryengine/v1/rank_service.protogoogle.cloud.discoveryengine.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"J + RankingRecord + +id (  +title (  +content (  +score ("ÿ + RankRequestL +ranking_config ( B4àAúA. +,discoveryengine.googleapis.com/RankingConfig +model (  +top_n ( +query ( D +records ( 2..google.cloud.discoveryengine.v1.RankingRecordBàA) +!ignore_record_details_in_response (Q + user_labels ( 2<.google.cloud.discoveryengine.v1.RankRequest.UserLabelsEntry1 +UserLabelsEntry +key (  +value ( :8"O + RankResponse? +records ( 2..google.cloud.discoveryengine.v1.RankingRecord2• + RankService± +Rank,.google.cloud.discoveryengine.v1.RankRequest-.google.cloud.discoveryengine.v1.RankResponse"L‚Óä“F"A/v1/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank:*RÊAdiscoveryengine.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBƒ +#com.google.cloud.discoveryengine.v1BRankServiceProtoPZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb¢DISCOVERYENGINEªGoogle.Cloud.DiscoveryEngine.V1ÊGoogle\\Cloud\\DiscoveryEngine\\V1ê"Google::Cloud::DiscoveryEngine::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/DiscoveryEngine/metadata/V1/Session.php b/DiscoveryEngine/metadata/V1/Session.php new file mode 100644 index 0000000000000000000000000000000000000000..4ab8e1f029084ee6cfb5bb87f59642d3ca9b2620 GIT binary patch literal 1993 zcmbtVPjAym6enp@=yX+zrA46^hVrKYQClf+aVaQi+-wdcAqkasWhrv(Nji(`F*D=t z7L-rIZIAm=_Ob`Qz@GaN_OkoNW2ev-wTN6Y9=-Q_e}2Dt@A=DkKSp>#Eg;U>n74sLe_*lDx|cfeJ!g!{zC6UHVXvHXxFffZ2U zvqQp<0SGWWQCPOC-O<< zA=a46_Fl}O1KT)HtE-v<4RKqMBs}s$w?Tx@X)GD*KKB?*i zT!g#jP1C#}7c;{$`^w9>iIx*V_%IeE3D}SZau2`l5XLT=th4~8#u!^ z?S9wUY3;V0#>y4rI$CPAhuvPM*>n2+m4f}LcwGCth#p)3pL5-VKK)93DXb6KX=;Vc zhY`afxXX`IOAW3*OaKD6>O2(cW10^YS^4{sXj?I|j0GMCZ3B)>~d&(p`#p{h$f2XtO^nP~Q%~sp_vv|9it{^jA zL1rUgK~B2I%)RPgxrLi;sgpIOZCuz>$Hg@bW7{c?ZJz?N?Y-(~0SJ=p$@*;mJ=Qzm Vvz4Jn3-!-g7pbKl>QgjD=zkS9qgVg{ literal 0 HcmV?d00001 diff --git a/DiscoveryEngine/metadata/V1/SiteSearchEngine.php b/DiscoveryEngine/metadata/V1/SiteSearchEngine.php index 1c43d2aaa01b3237a1174b1d2704ddc4127c49d9..ea682ab9f66bcb69af9482af464050b80a44ef83 100644 GIT binary patch delta 48 zcmca6_C;*N3MQsT!Og3fHZU?x)<3MQt<0-IMcZD3^j!7(|8<;Z3`Rx>sLps5N$ diff --git a/DiscoveryEngine/metadata/V1/UserEvent.php b/DiscoveryEngine/metadata/V1/UserEvent.php index 57cb4bf0501d1d16f17e69119d16112e34efba62..83e21dbfd707a4a2c66f326d3a6d31f0561ab99e 100644 GIT binary patch delta 101 zcmdljxm#+3EHl$3;mPvM_n3BZO#aX8ByPpUmYSEInU^XdtiY(j>7@0`F-DzBb@Db& vc|}*SgpeZ_S4v_@VtjE)eo?A~2w0i!FGnpd4WKFo4xm&pNM^GGOEm`o9hM$! delta 26 icmdljwOew7EHl$(p~>>h_n3CGPyWyBwD}-Q6$b!-dkKjE diff --git a/DiscoveryEngine/metadata/V1/UserEventService.php b/DiscoveryEngine/metadata/V1/UserEventService.php index b6b2576738ee803d07f11da0221d442cc0d54460..f5a9196b186a1c694aeb93c64f6ff02c41185e60 100644 GIT binary patch delta 112 zcmV-$0FVEy7=;H`AN5VPz9SOEdYlSKuj6%rE)3wLs9bY)**b9ruK7y}>yCH`A!53}q8SOEdDlSKujll}#}7OMyf5LI(!az%D!Zgf*+a&~EB nWfH8D&jxl2wE=?DK7E{m*gjvrs)?$lyER> zF#g$W$n3<-_;PXy+bzb+ll|G>>I&&_aYIzZrzDmnO0X(0YH%Bg>p@J>gPEcSwrH|7 dhYizO=E;>Dj~KU3j^XUoBT0M7=BJ$3I04>rKzslI delta 75 zcmV-R0JQ(^D7z=HOahaI0!{?eAqp^&OE8lM13{B!10eyRvxoyi0|AYb%Ldv6r2+~V hlWqtYlfehllfei(0{;S&{s`g$hm+w6iL;mr)(O<>8+rf$ diff --git a/DiscoveryEngine/metadata/V1Beta/Common.php b/DiscoveryEngine/metadata/V1Beta/Common.php index 3b157a327cc809345bb5be16c0a13c02dd2785e1..c0135c9238e677f3c200edc36e1c72f34d7cf387 100644 GIT binary patch delta 153 zcmeAZ`ysYLnTe%Ch|6H2x54IcreLP}3@+Z_)Wo9XjL_m#=fvVvA$cz8U{}W=XOH;M zVAptOM<5aE7aZW~?CIv|>LS1(B*i6$t^mRpV8kZp6yzTs>?**d70<;5u_+`owMa;s NOB|$Y^L`e8HUQ+HDggih delta 25 gcmew%)+e?>nTchdAeX^JZ-dR@OuMOahV0B3Lq7ytkO diff --git a/DiscoveryEngine/metadata/V1Beta/Control.php b/DiscoveryEngine/metadata/V1Beta/Control.php new file mode 100644 index 0000000000000000000000000000000000000000..333723bb6bb59f8a225fe324a177dc97d0e7a268 GIT binary patch literal 2968 zcmbtW&2k$>5XN%sSmU20%SBNY#bBpmC4^OMF0jT>lBF0Q5-YNC71UO3jdn-!z-njN znN^htdJ5ivBPX6C7Y@7t2TpkePV~&|uKX7x2VcBicYodU_1ClC7hlDvG1|cUG@=QS zG{C(vmZucQ376dGA?~I9K25OChcOFjVq@Go#4iqyal3VJ{1K!Io+dtZ@PP9{Nb7#c z)1V$O;qwtq#xxqRh}K72Jt|4v=aEc!XlrzYA~K{RCO*aco#t~02#6%^z6Nsl6p-6G z59FR~H6d;XAwMKS;5`F~ULg!WaoP)+kA)->em!8qV-b^#gzP6c*)HyrP*BLd9NSML zUoswHm2epOwDt%aOcnbe=D@@*&Rgp!a)223Ad)nRNa(hx@DmnGo^&A8aRyWtl&Uwi zM_E|~$NIQtdUTviP3~fur1Wfcj1wx;B-+t^D}YJy*YTJmqdOyP@F{>vTc}C&Yr?Zt*3}qP~W*K@zKw@>7(_jMD zUzboBR3Ct@d1O6D%Ri>DW*+EpC@Lj9Ut8Y(%$}iby8y9YDuiPIu#V6@0(&r`o+|4l zBpT4l{5yfF@pV;x)kfuMg;lgLB4J7^b9k;+wk(ADX&8D#BK=cnf3CJvWvE;vTQ))< zf<)?ubkg#6H9ucYlC9#kR;(vziAI5mR&duwum6tF?d%G%I%uWGxsaY>fJc=@ojo&` z`d(`)fQHWh`aP?QR{Jc3$>fl?HRR`c``4*TjYmU*m;s@{JVAF78nA@=MWbbnx^pAc zZiaCdSBxVbjfW!d7QF-RQHD|A-b1(4EpNu%od2t_VBJS6ut{-9#-9F{8dF*Qt7JV! zAHc27eWpG|o}kHyMFY?0QJ)Pw76`3H9Xk*6S`|D@)vP=@j%no<;H+(L&BVh|mU#?` z%|$4!8f&9+DyZiZK}BT=RKK>pJsTP&iGTWypnH&NHR0owFQ}+2=r? zD{bs+2We|xVz+V!+16InHV*Q29_406bLuoroC{V{dDb_jhX&4ZG@j#J0CXG^*jt22 bNdD<&;XIxgD|g2Ez18*UNaM{WXoAqcT|4rL literal 0 HcmV?d00001 diff --git a/DiscoveryEngine/metadata/V1Beta/ControlService.php b/DiscoveryEngine/metadata/V1Beta/ControlService.php new file mode 100644 index 000000000000..535ca94676e0 --- /dev/null +++ b/DiscoveryEngine/metadata/V1Beta/ControlService.php @@ -0,0 +1,64 @@ +internalAddGeneratedFile( + ' +• +9google/cloud/discoveryengine/v1beta/control_service.proto#google.cloud.discoveryengine.v1betagoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto1google/cloud/discoveryengine/v1beta/control.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"³ +CreateControlRequest> +parent ( B.àAúA(&discoveryengine.googleapis.com/ControlB +control ( 2,.google.cloud.discoveryengine.v1beta.ControlBàA + +control_id ( BàA" +UpdateControlRequestB +control ( 2,.google.cloud.discoveryengine.v1beta.ControlBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"T +DeleteControlRequest< +name ( B.àAúA( +&discoveryengine.googleapis.com/Control"Q +GetControlRequest< +name ( B.àAúA( +&discoveryengine.googleapis.com/Control"› +ListControlsRequest> +parent ( B.àAúA(&discoveryengine.googleapis.com/Control + page_size (BàA + +page_token ( BàA +filter ( BàA"o +ListControlsResponse> +controls ( 2,.google.cloud.discoveryengine.v1beta.Control +next_page_token ( 2Å +ControlService“ + CreateControl9.google.cloud.discoveryengine.v1beta.CreateControlRequest,.google.cloud.discoveryengine.v1beta.Control"˜ÚAparent,control,control_id‚Óä“õ"=/v1beta/{parent=projects/*/locations/*/dataStores/*}/controls:controlZV"K/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/controls:controlZS"H/v1beta/{parent=projects/*/locations/*/collections/*/engines/*}/controls:controlÍ + DeleteControl9.google.cloud.discoveryengine.v1beta.DeleteControlRequest.google.protobuf.Empty"èÚAname‚Óä“Ú*=/v1beta/{name=projects/*/locations/*/dataStores/*/controls/*}ZM*K/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}ZJ*H/v1beta/{name=projects/*/locations/*/collections/*/engines/*/controls/*}¥ + UpdateControl9.google.cloud.discoveryengine.v1beta.UpdateControlRequest,.google.cloud.discoveryengine.v1beta.Control"ªÚAcontrol,update_mask‚Óä“2E/v1beta/{control.name=projects/*/locations/*/dataStores/*/controls/*}:controlZ^2S/v1beta/{control.name=projects/*/locations/*/collections/*/dataStores/*/controls/*}:controlZ[2P/v1beta/{control.name=projects/*/locations/*/collections/*/engines/*/controls/*}:controlÝ + +GetControl6.google.cloud.discoveryengine.v1beta.GetControlRequest,.google.cloud.discoveryengine.v1beta.Control"èÚAname‚Óä“Ú=/v1beta/{name=projects/*/locations/*/dataStores/*/controls/*}ZMK/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}ZJH/v1beta/{name=projects/*/locations/*/collections/*/engines/*/controls/*}ð + ListControls8.google.cloud.discoveryengine.v1beta.ListControlsRequest9.google.cloud.discoveryengine.v1beta.ListControlsResponse"êÚAparent‚Óä“Ú=/v1beta/{parent=projects/*/locations/*/dataStores/*}/controlsZMK/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/controlsZJH/v1beta/{parent=projects/*/locations/*/collections/*/engines/*}/controlsRÊAdiscoveryengine.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBš +\'com.google.cloud.discoveryengine.v1betaBControlServiceProtoPZQcloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb¢DISCOVERYENGINEª#Google.Cloud.DiscoveryEngine.V1BetaÊ#Google\\Cloud\\DiscoveryEngine\\V1betaê&Google::Cloud::DiscoveryEngine::V1betabproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/DiscoveryEngine/metadata/V1Beta/ConversationalSearchService.php b/DiscoveryEngine/metadata/V1Beta/ConversationalSearchService.php index 9b0d05a51f50893449dff387989282ce8b172b07..e479f8875b1f1f329791a056ba7db9896c8311c8 100644 GIT binary patch delta 228 zcmeClIhVU(0}IQAWG?r~4_Q?v<|}Xh&C<`o^j~&!4{sDRQxnVP7Xqb>T0$CJ(wXUb z`9-PmIr-)BMX5QdWr=wu@yYplC8>EO66^|$8XO)B9gK{VV})Flo#eP=;_;}LI>9%2 ziO?&?Uz7WV=SvGkaS5a(mL$d(mw+rNE=Wx-2AasM!EH48qrBSWdJaBb7odDFNIDoO yyID_U7dzwH$uFfR$p}et2_@zgm!}rR7nY_LRmPX(XQ$>#FasULxw%?qq9gz_vrjYt delta 74 zcmV-Q0JZ-G>Q>`W)ga$bl>wl*{*GLDM*le1~Qv zWr^VF08}k&PQ|LwQqp`>x|MKjhMOuz%c=!=h((&y%ib|gsmRm#pom)nELSK0niARx z^E-@2(-u7q&lpcF>msWQkbg5B((;{eY_%%Kn8C}6aFJZ^u_)swU$L@i_H??cQ3n{; zTxBJ5+(UofMu)FNHGNl^8wFF1D@-*MQ+M7geS`@!(=vBO)twK@PX%$|y-iUis1zRj zxPk7~$f$SFy5#tF12>wtTVMQTYk%AO=+mqI6*#!f4Cpztj`J3}12#z%o(Bb{+qR17Z5a(rHzaPXbfN9t1lp>b1JFybQ!NkwpRdG#1tKWoU}0}5B9cv-u( z-l?%|AgAe|@$EOtu3{{-#GKdG3$#nQVXm}OGC8P8e%02g{B(ZOSDAjAH~L~^8f$< literal 0 HcmV?d00001 diff --git a/DiscoveryEngine/metadata/V1Beta/Engine.php b/DiscoveryEngine/metadata/V1Beta/Engine.php index 4d779d8a90e9517eb5648bc310417e6fa0ef769b..5ef3bad18614284670cfcd14690b183ed6ebb519 100644 GIT binary patch delta 53 zcmZ21I!|=Nb0+3Dd|Z=bm{lk9GcRCl-@Ji&0*jyu7mss(Zf<^_bADc0X1b8b3lOaR!X5PARr delta 59 zcmbOyx>$6>b0+4Gd|Z=bm{lk9GcRE5*}Q>y0*jy~7mss(Zf<^_bADc0X1b8%internalAddGeneratedFile( ' -‹ +š 3google/cloud/discoveryengine/v1beta/grounding.proto#google.cloud.discoveryengine.v1betagoogle/api/resource.proto"­ GroundingFact fact_text ( V @@ -26,11 +26,12 @@ public static function initOnce() { attributes ( 2B.google.cloud.discoveryengine.v1beta.GroundingFact.AttributesEntry1 AttributesEntry key (  -value ( :8"à +value ( :8"Ò FactChunk chunk_text (  -source ( [ +source (  +index ([ source_metadata ( 2B.google.cloud.discoveryengine.v1beta.FactChunk.SourceMetadataEntry5 SourceMetadataEntry key (  diff --git a/DiscoveryEngine/metadata/V1Beta/Project.php b/DiscoveryEngine/metadata/V1Beta/Project.php new file mode 100644 index 0000000000000000000000000000000000000000..f6f9670e1424c2371a10e3fba1c38c56ec45436f GIT binary patch literal 1925 zcmbVN(Qex|6rJU|MVPE@gcV5rGOj5a7g(jG?L((D3v5gA3@nZpdj(nuFldT)xXGeM z(FU?2U$OT+>~VjvU)Wddb^VH6ijtEh*_u@^63BDUz4z#l_vK!CoT5$KVF{B&u?UY( zusUWql|l(BVmzKtCQM=~W+{)EbTIZ0aqn=51HU``3_>$8my~&UD#SEqE{(-JawDEm zv0(CqB~zX-cd6j~`u`*fUv0Ml zw}TLkNtWThAw+Kxh9{kmV@`3Vh=SKco{f0I6(=$O2|C-w6B1_(VlQJS^Mooc608Fb z6UrKovEkI%hp7N1c5zu6WK{x$3A>46G9hv3vy4ifDk1v-^}H!lOG))g<8hHz)A0#z zm>NCrQjxn@$vHcp9b?JVTqZkt-J0NZ`4wIvTr=h2K4)>%V#j2`h4j3$uFgpQE%b;L zfArc>OF4!d{-+|d^y-Ycj8DGeg=ozvT57Zp-fAqn(migWUslle|2CDqX+oUbht35b zI>v|f`vosaxhso)jVbG&7F)SR;UBxIY{~#0{8dA@3ftN1=!W+2Mg>+XHZ0?ar^1s2N&TCG>z?|RYECCm64_PK3VK9&|1W33>T1zxcR<_2d`1h z{>KeBCfdl(!Y3`Wg%JLnH#tpX{}Fw1Ub<3PdlglGU?+u!U!&TB#PiZOUw*J;p7o;Q?Y(QhM2{|>0b@n5 ze&&GF+|tW77*Jo%nftc*I&J-Ip>PX8*D0g5RxrU!iGJnHx5jLR^L47JxHK4`jAAxi zC^H@JTw3|ny5n~T?Za2W(d(es0bzf$Haq#aaPo2C_~p0=^10)faq&lq3X7?7HdYKS zgt?*z)H~~uq4T_)&+{%2dY%D}Z-PcjJlk5{S)ZGG``k6Jz0c_tSA32%7x5`NMd)uu CvwGA3 literal 0 HcmV?d00001 diff --git a/DiscoveryEngine/metadata/V1Beta/ProjectService.php b/DiscoveryEngine/metadata/V1Beta/ProjectService.php new file mode 100644 index 000000000000..4ac09bda9a2e --- /dev/null +++ b/DiscoveryEngine/metadata/V1Beta/ProjectService.php @@ -0,0 +1,42 @@ +internalAddGeneratedFile( + ' +ð +9google/cloud/discoveryengine/v1beta/project_service.proto#google.cloud.discoveryengine.v1betagoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto1google/cloud/discoveryengine/v1beta/project.proto#google/longrunning/operations.proto"  +ProvisionProjectRequest< +name ( B.àAúA( +&discoveryengine.googleapis.com/Project" +accept_data_use_terms (BàA# +data_use_terms_version ( BàA" +ProvisionProjectMetadata2ü +ProjectService• +ProvisionProject<.google.cloud.discoveryengine.v1beta.ProvisionProjectRequest.google.longrunning.Operation"£ÊAk ++google.cloud.discoveryengine.v1beta.ProjectinternalAddGeneratedFile( ' -™ +£ + 6google/cloud/discoveryengine/v1beta/rank_service.proto#google.cloud.discoveryengine.v1betagoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"J RankingRecord id (  title (  content (  -score ("ý +score ("‡ RankRequestL ranking_config ( B4àAúA. ,discoveryengine.googleapis.com/RankingConfig @@ -35,7 +36,11 @@ public static function initOnce() { top_n ( query ( H records ( 22.google.cloud.discoveryengine.v1beta.RankingRecordBàA) -!ignore_record_details_in_response ("S +!ignore_record_details_in_response (U + user_labels ( 2@.google.cloud.discoveryengine.v1beta.RankRequest.UserLabelsEntry1 +UserLabelsEntry +key (  +value ( :8"S RankResponseC records ( 22.google.cloud.discoveryengine.v1beta.RankingRecord2¡ RankService½ diff --git a/DiscoveryEngine/metadata/V1Beta/SearchTuningService.php b/DiscoveryEngine/metadata/V1Beta/SearchTuningService.php index 2bcf5b08ec26512aa9d9c780ae1f76d5cb2a0b7f..a6d04d920111e890408ff8735d452af83f7ed178 100644 GIT binary patch delta 355 zcmaDZenV!%OC~|*(&Cc*+>p||%)E5p{FKz3$%af?o6j)GF*2PJp8SS+52Nkmcg!ln z$zXNyC18c|xnPwGS>{W{bBX(87MDPb0UJ;plv-GtT3j;u1go2#QWBR0rhIWheqM2^ zkQ)~p*q~wwMg?XKZX>hF4>(kXFXeSBt$1giq02Iu4gwr<8# zoByz}Gl~caadAOp^AdAYq4LZe>zUTEZr;L?!ze2BhLKAE-7S;vai~k83qn00WeakT k5~eJ~`AX4Em!C{#3Ka^Te2mkLS055WkRaHsz;&Dv06y$|m;e9( delta 73 zcmca1^IUwxOQy|^%#4gI8~M5HCo{6DOw5;_+{#kTXb$2`PGK!(+_8Bsn?B>@d+gne c+csx$urp3>n>RA;WMo`5Ih*CAhzu8hQGR|&d`f<9VrE`^X;G#G*Jdr&EH(g? CxezJ< delta 25 hcmdlaK1F=P1}4Von>RA;WMu4_oXv7_a}a9+8vual30D9B diff --git a/DiscoveryEngine/metadata/V1Beta/UserEvent.php b/DiscoveryEngine/metadata/V1Beta/UserEvent.php index f9e1caffff9eb371951da57668f5717b970a457b..b984df5cbb08f6c4548deadff57e016e21a84aba 100644 GIT binary patch delta 101 zcmbOrH9>lVCNtA4k;&T3ub3WjOcrNx61U=FOU+Bq%uAIJR$$cNbkh3e7^BXmI{6!? vyrL^uLdcPeD)B(ph!Wd{cU%Jm)_ delta 26 icmbOrJwa-NCNtA);mO*}ub3XQPZno!+I*8`I|l%A3kbLX diff --git a/DiscoveryEngine/metadata/V1Beta/UserEventService.php b/DiscoveryEngine/metadata/V1Beta/UserEventService.php index 9bd6d82f7b2eb8d71f874a91bfc85c8a6814d858..a248da787007679bb0172ae0634a26538a5a6426 100644 GIT binary patch delta 122 zcmV-=0EPdR8S)vh`U3>55eht$(F7!sZy2*W1S$am%adgVs1*_u3JZ5~X>?^@VRLzI zV;BP<0VoKQ4FMRsLwbW>$=c4=c}5`+Vj-v)gPg#v=p8Z`U3>e5DGk#(F7!sZy2*W1S$amwv%NAsFNZFyBFIC3J_IuWpYJ! xWo~p+WpZ|DV`UP&0+aLxeG9z-g45)a0=5AnMU&A7CzA#UE0fL#VzYP%dIa>YArSxo diff --git a/DiscoveryEngine/samples/V1/ControlServiceClient/create_control.php b/DiscoveryEngine/samples/V1/ControlServiceClient/create_control.php new file mode 100644 index 000000000000..f8040aef302b --- /dev/null +++ b/DiscoveryEngine/samples/V1/ControlServiceClient/create_control.php @@ -0,0 +1,105 @@ +setDisplayName($controlDisplayName) + ->setSolutionType($controlSolutionType); + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + + // Call the API and handle any network failures. + try { + /** @var Control $response */ + $response = $controlServiceClient->createControl($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 +{ + $formattedParent = ControlServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $controlDisplayName = '[DISPLAY_NAME]'; + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $controlId = '[CONTROL_ID]'; + + create_control_sample($formattedParent, $controlDisplayName, $controlSolutionType, $controlId); +} +// [END discoveryengine_v1_generated_ControlService_CreateControl_sync] diff --git a/DiscoveryEngine/samples/V1/ControlServiceClient/delete_control.php b/DiscoveryEngine/samples/V1/ControlServiceClient/delete_control.php new file mode 100644 index 000000000000..b2fe1eb0338f --- /dev/null +++ b/DiscoveryEngine/samples/V1/ControlServiceClient/delete_control.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $controlServiceClient->deleteControl($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = ControlServiceClient::controlName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[CONTROL]' + ); + + delete_control_sample($formattedName); +} +// [END discoveryengine_v1_generated_ControlService_DeleteControl_sync] diff --git a/DiscoveryEngine/samples/V1/ControlServiceClient/get_control.php b/DiscoveryEngine/samples/V1/ControlServiceClient/get_control.php new file mode 100644 index 000000000000..1fd670cdf4bf --- /dev/null +++ b/DiscoveryEngine/samples/V1/ControlServiceClient/get_control.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Control $response */ + $response = $controlServiceClient->getControl($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 = ControlServiceClient::controlName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[CONTROL]' + ); + + get_control_sample($formattedName); +} +// [END discoveryengine_v1_generated_ControlService_GetControl_sync] diff --git a/DiscoveryEngine/samples/V1/ControlServiceClient/list_controls.php b/DiscoveryEngine/samples/V1/ControlServiceClient/list_controls.php new file mode 100644 index 000000000000..f76992244237 --- /dev/null +++ b/DiscoveryEngine/samples/V1/ControlServiceClient/list_controls.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $controlServiceClient->listControls($request); + + /** @var Control $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ControlServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + + list_controls_sample($formattedParent); +} +// [END discoveryengine_v1_generated_ControlService_ListControls_sync] diff --git a/DiscoveryEngine/samples/V1/ControlServiceClient/update_control.php b/DiscoveryEngine/samples/V1/ControlServiceClient/update_control.php new file mode 100644 index 000000000000..83411860c378 --- /dev/null +++ b/DiscoveryEngine/samples/V1/ControlServiceClient/update_control.php @@ -0,0 +1,86 @@ +setDisplayName($controlDisplayName) + ->setSolutionType($controlSolutionType); + $request = (new UpdateControlRequest()) + ->setControl($control); + + // Call the API and handle any network failures. + try { + /** @var Control $response */ + $response = $controlServiceClient->updateControl($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 +{ + $controlDisplayName = '[DISPLAY_NAME]'; + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + + update_control_sample($controlDisplayName, $controlSolutionType); +} +// [END discoveryengine_v1_generated_ControlService_UpdateControl_sync] diff --git a/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/answer_query.php b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/answer_query.php new file mode 100644 index 000000000000..0ecbc54e367d --- /dev/null +++ b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/answer_query.php @@ -0,0 +1,84 @@ +setServingConfig($formattedServingConfig) + ->setQuery($query); + + // Call the API and handle any network failures. + try { + /** @var AnswerQueryResponse $response */ + $response = $conversationalSearchServiceClient->answerQuery($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 +{ + $formattedServingConfig = ConversationalSearchServiceClient::servingConfigName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[SERVING_CONFIG]' + ); + + answer_query_sample($formattedServingConfig); +} +// [END discoveryengine_v1_generated_ConversationalSearchService_AnswerQuery_sync] diff --git a/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/create_session.php b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/create_session.php new file mode 100644 index 000000000000..a50e3e1dccd7 --- /dev/null +++ b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/create_session.php @@ -0,0 +1,81 @@ +setParent($formattedParent) + ->setSession($session); + + // Call the API and handle any network failures. + try { + /** @var Session $response */ + $response = $conversationalSearchServiceClient->createSession($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 +{ + $formattedParent = ConversationalSearchServiceClient::dataStoreName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]' + ); + + create_session_sample($formattedParent); +} +// [END discoveryengine_v1_generated_ConversationalSearchService_CreateSession_sync] diff --git a/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/delete_session.php b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/delete_session.php new file mode 100644 index 000000000000..2c268c483569 --- /dev/null +++ b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/delete_session.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $conversationalSearchServiceClient->deleteSession($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = ConversationalSearchServiceClient::sessionName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[SESSION]' + ); + + delete_session_sample($formattedName); +} +// [END discoveryengine_v1_generated_ConversationalSearchService_DeleteSession_sync] diff --git a/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/get_answer.php b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/get_answer.php new file mode 100644 index 000000000000..f38958ac3713 --- /dev/null +++ b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/get_answer.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Answer $response */ + $response = $conversationalSearchServiceClient->getAnswer($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 = ConversationalSearchServiceClient::answerName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[SESSION]', + '[ANSWER]' + ); + + get_answer_sample($formattedName); +} +// [END discoveryengine_v1_generated_ConversationalSearchService_GetAnswer_sync] diff --git a/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/get_session.php b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/get_session.php new file mode 100644 index 000000000000..814cf2271df2 --- /dev/null +++ b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/get_session.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Session $response */ + $response = $conversationalSearchServiceClient->getSession($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 = ConversationalSearchServiceClient::sessionName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[SESSION]' + ); + + get_session_sample($formattedName); +} +// [END discoveryengine_v1_generated_ConversationalSearchService_GetSession_sync] diff --git a/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/list_sessions.php b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/list_sessions.php new file mode 100644 index 000000000000..e46fe456fff6 --- /dev/null +++ b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/list_sessions.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationalSearchServiceClient->listSessions($request); + + /** @var Session $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ConversationalSearchServiceClient::dataStoreName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]' + ); + + list_sessions_sample($formattedParent); +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ListSessions_sync] diff --git a/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/update_session.php b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/update_session.php new file mode 100644 index 000000000000..39815db255b1 --- /dev/null +++ b/DiscoveryEngine/samples/V1/ConversationalSearchServiceClient/update_session.php @@ -0,0 +1,63 @@ +setSession($session); + + // Call the API and handle any network failures. + try { + /** @var Session $response */ + $response = $conversationalSearchServiceClient->updateSession($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_UpdateSession_sync] diff --git a/DiscoveryEngine/samples/V1/DocumentServiceClient/create_document.php b/DiscoveryEngine/samples/V1/DocumentServiceClient/create_document.php index 370b946c1b49..410d9909f14a 100644 --- a/DiscoveryEngine/samples/V1/DocumentServiceClient/create_document.php +++ b/DiscoveryEngine/samples/V1/DocumentServiceClient/create_document.php @@ -35,7 +35,7 @@ * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Please see * {@see DocumentServiceClient::branchName()} for help formatting this field. * @param string $documentId The ID to use for the - * [Document][google.cloud.discoveryengine.v1.Document], which will become the + * [Document][google.cloud.discoveryengine.v1.Document], which becomes the * final component of the * [Document.name][google.cloud.discoveryengine.v1.Document.name]. * diff --git a/DiscoveryEngine/samples/V1/DocumentServiceClient/import_documents.php b/DiscoveryEngine/samples/V1/DocumentServiceClient/import_documents.php index 5956048420f9..a7f00b698e52 100644 --- a/DiscoveryEngine/samples/V1/DocumentServiceClient/import_documents.php +++ b/DiscoveryEngine/samples/V1/DocumentServiceClient/import_documents.php @@ -33,7 +33,7 @@ /** * Bulk import of multiple * [Document][google.cloud.discoveryengine.v1.Document]s. Request processing - * may be synchronous. Non-existing items will be created. + * may be synchronous. Non-existing items are created. * * Note: It is possible for a subset of the * [Document][google.cloud.discoveryengine.v1.Document]s to be successfully diff --git a/DiscoveryEngine/samples/V1/GroundedGenerationServiceClient/check_grounding.php b/DiscoveryEngine/samples/V1/GroundedGenerationServiceClient/check_grounding.php new file mode 100644 index 000000000000..0ce05015a4f6 --- /dev/null +++ b/DiscoveryEngine/samples/V1/GroundedGenerationServiceClient/check_grounding.php @@ -0,0 +1,76 @@ +setGroundingConfig($formattedGroundingConfig); + + // Call the API and handle any network failures. + try { + /** @var CheckGroundingResponse $response */ + $response = $groundedGenerationServiceClient->checkGrounding($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 +{ + $formattedGroundingConfig = GroundedGenerationServiceClient::groundingConfigName( + '[PROJECT]', + '[LOCATION]', + '[GROUNDING_CONFIG]' + ); + + check_grounding_sample($formattedGroundingConfig); +} +// [END discoveryengine_v1_generated_GroundedGenerationService_CheckGrounding_sync] diff --git a/DiscoveryEngine/samples/V1/ProjectServiceClient/provision_project.php b/DiscoveryEngine/samples/V1/ProjectServiceClient/provision_project.php new file mode 100644 index 000000000000..deda6d674ee8 --- /dev/null +++ b/DiscoveryEngine/samples/V1/ProjectServiceClient/provision_project.php @@ -0,0 +1,105 @@ +setName($formattedName) + ->setAcceptDataUseTerms($acceptDataUseTerms) + ->setDataUseTermsVersion($dataUseTermsVersion); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectServiceClient->provisionProject($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = ProjectServiceClient::projectName('[PROJECT]'); + $acceptDataUseTerms = false; + $dataUseTermsVersion = '[DATA_USE_TERMS_VERSION]'; + + provision_project_sample($formattedName, $acceptDataUseTerms, $dataUseTermsVersion); +} +// [END discoveryengine_v1_generated_ProjectService_ProvisionProject_sync] diff --git a/DiscoveryEngine/samples/V1/RankServiceClient/rank.php b/DiscoveryEngine/samples/V1/RankServiceClient/rank.php new file mode 100644 index 000000000000..c827628b944d --- /dev/null +++ b/DiscoveryEngine/samples/V1/RankServiceClient/rank.php @@ -0,0 +1,79 @@ +setRankingConfig($formattedRankingConfig) + ->setRecords($records); + + // Call the API and handle any network failures. + try { + /** @var RankResponse $response */ + $response = $rankServiceClient->rank($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 +{ + $formattedRankingConfig = RankServiceClient::rankingConfigName( + '[PROJECT]', + '[LOCATION]', + '[RANKING_CONFIG]' + ); + + rank_sample($formattedRankingConfig); +} +// [END discoveryengine_v1_generated_RankService_Rank_sync] diff --git a/DiscoveryEngine/samples/V1/RecommendationServiceClient/recommend.php b/DiscoveryEngine/samples/V1/RecommendationServiceClient/recommend.php index 0a7bee7714a3..c94fe9495c59 100644 --- a/DiscoveryEngine/samples/V1/RecommendationServiceClient/recommend.php +++ b/DiscoveryEngine/samples/V1/RecommendationServiceClient/recommend.php @@ -37,7 +37,7 @@ * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` diff --git a/DiscoveryEngine/samples/V1/SchemaServiceClient/create_schema.php b/DiscoveryEngine/samples/V1/SchemaServiceClient/create_schema.php index 7923a6496b81..591cbf4c3ac9 100644 --- a/DiscoveryEngine/samples/V1/SchemaServiceClient/create_schema.php +++ b/DiscoveryEngine/samples/V1/SchemaServiceClient/create_schema.php @@ -37,8 +37,8 @@ * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. Please see * {@see SchemaServiceClient::dataStoreName()} for help formatting this field. * @param string $schemaId The ID to use for the - * [Schema][google.cloud.discoveryengine.v1.Schema], which will become the - * final component of the + * [Schema][google.cloud.discoveryengine.v1.Schema], which becomes the final + * component of the * [Schema.name][google.cloud.discoveryengine.v1.Schema.name]. * * This field should conform to diff --git a/DiscoveryEngine/samples/V1/UserEventServiceClient/import_user_events.php b/DiscoveryEngine/samples/V1/UserEventServiceClient/import_user_events.php index 61007e1abc33..91dbf133d395 100644 --- a/DiscoveryEngine/samples/V1/UserEventServiceClient/import_user_events.php +++ b/DiscoveryEngine/samples/V1/UserEventServiceClient/import_user_events.php @@ -31,7 +31,7 @@ use Google\Rpc\Status; /** - * Bulk import of User events. Request processing might be + * Bulk import of user events. Request processing might be * synchronous. Events that already exist are skipped. * Use this method for backfilling historical user events. * diff --git a/DiscoveryEngine/samples/V1/UserEventServiceClient/write_user_event.php b/DiscoveryEngine/samples/V1/UserEventServiceClient/write_user_event.php index ba88a4876777..d31df0a2a1f4 100644 --- a/DiscoveryEngine/samples/V1/UserEventServiceClient/write_user_event.php +++ b/DiscoveryEngine/samples/V1/UserEventServiceClient/write_user_event.php @@ -31,8 +31,16 @@ /** * Writes a single user event. * - * @param string $formattedParent The parent DataStore resource name, such as - * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. Please see + * @param string $formattedParent The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1.DataStore] level, the format + * is: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1.DataStore], the format is: + * `projects/{project}/locations/{location}`. Please see * {@see UserEventServiceClient::dataStoreName()} for help formatting this field. * @param string $userEventEventType User event type. Allowed values are: * diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/create_control.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/create_control.php new file mode 100644 index 000000000000..3fe97bee0d8a --- /dev/null +++ b/DiscoveryEngine/samples/V1beta/ControlServiceClient/create_control.php @@ -0,0 +1,105 @@ +setDisplayName($controlDisplayName) + ->setSolutionType($controlSolutionType); + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + + // Call the API and handle any network failures. + try { + /** @var Control $response */ + $response = $controlServiceClient->createControl($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 +{ + $formattedParent = ControlServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $controlDisplayName = '[DISPLAY_NAME]'; + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $controlId = '[CONTROL_ID]'; + + create_control_sample($formattedParent, $controlDisplayName, $controlSolutionType, $controlId); +} +// [END discoveryengine_v1beta_generated_ControlService_CreateControl_sync] diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/delete_control.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/delete_control.php new file mode 100644 index 000000000000..953459e4d83a --- /dev/null +++ b/DiscoveryEngine/samples/V1beta/ControlServiceClient/delete_control.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $controlServiceClient->deleteControl($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = ControlServiceClient::controlName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[CONTROL]' + ); + + delete_control_sample($formattedName); +} +// [END discoveryengine_v1beta_generated_ControlService_DeleteControl_sync] diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/get_control.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/get_control.php new file mode 100644 index 000000000000..5bdc58d7726f --- /dev/null +++ b/DiscoveryEngine/samples/V1beta/ControlServiceClient/get_control.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Control $response */ + $response = $controlServiceClient->getControl($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 = ControlServiceClient::controlName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[CONTROL]' + ); + + get_control_sample($formattedName); +} +// [END discoveryengine_v1beta_generated_ControlService_GetControl_sync] diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/list_controls.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/list_controls.php new file mode 100644 index 000000000000..ec2817819bc0 --- /dev/null +++ b/DiscoveryEngine/samples/V1beta/ControlServiceClient/list_controls.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $controlServiceClient->listControls($request); + + /** @var Control $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ControlServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + + list_controls_sample($formattedParent); +} +// [END discoveryengine_v1beta_generated_ControlService_ListControls_sync] diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/update_control.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/update_control.php new file mode 100644 index 000000000000..3d2de009bf3e --- /dev/null +++ b/DiscoveryEngine/samples/V1beta/ControlServiceClient/update_control.php @@ -0,0 +1,86 @@ +setDisplayName($controlDisplayName) + ->setSolutionType($controlSolutionType); + $request = (new UpdateControlRequest()) + ->setControl($control); + + // Call the API and handle any network failures. + try { + /** @var Control $response */ + $response = $controlServiceClient->updateControl($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 +{ + $controlDisplayName = '[DISPLAY_NAME]'; + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + + update_control_sample($controlDisplayName, $controlSolutionType); +} +// [END discoveryengine_v1beta_generated_ControlService_UpdateControl_sync] diff --git a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/create_document.php b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/create_document.php index a8e46998d290..58d799a693af 100644 --- a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/create_document.php +++ b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/create_document.php @@ -35,8 +35,8 @@ * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Please see * {@see DocumentServiceClient::branchName()} for help formatting this field. * @param string $documentId The ID to use for the - * [Document][google.cloud.discoveryengine.v1beta.Document], which will become - * the final component of the + * [Document][google.cloud.discoveryengine.v1beta.Document], which becomes the + * final component of the * [Document.name][google.cloud.discoveryengine.v1beta.Document.name]. * * If the caller does not have permission to create the diff --git a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/import_documents.php b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/import_documents.php index a7878c9ca678..b21f21799c1c 100644 --- a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/import_documents.php +++ b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/import_documents.php @@ -33,7 +33,7 @@ /** * Bulk import of multiple * [Document][google.cloud.discoveryengine.v1beta.Document]s. Request - * processing may be synchronous. Non-existing items will be created. + * processing may be synchronous. Non-existing items are created. * * Note: It is possible for a subset of the * [Document][google.cloud.discoveryengine.v1beta.Document]s to be diff --git a/DiscoveryEngine/samples/V1beta/ProjectServiceClient/provision_project.php b/DiscoveryEngine/samples/V1beta/ProjectServiceClient/provision_project.php new file mode 100644 index 000000000000..39a6d52bb9d0 --- /dev/null +++ b/DiscoveryEngine/samples/V1beta/ProjectServiceClient/provision_project.php @@ -0,0 +1,105 @@ +setName($formattedName) + ->setAcceptDataUseTerms($acceptDataUseTerms) + ->setDataUseTermsVersion($dataUseTermsVersion); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectServiceClient->provisionProject($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = ProjectServiceClient::projectName('[PROJECT]'); + $acceptDataUseTerms = false; + $dataUseTermsVersion = '[DATA_USE_TERMS_VERSION]'; + + provision_project_sample($formattedName, $acceptDataUseTerms, $dataUseTermsVersion); +} +// [END discoveryengine_v1beta_generated_ProjectService_ProvisionProject_sync] diff --git a/DiscoveryEngine/samples/V1beta/RecommendationServiceClient/recommend.php b/DiscoveryEngine/samples/V1beta/RecommendationServiceClient/recommend.php index 9d954083ab48..cfa16acd342a 100644 --- a/DiscoveryEngine/samples/V1beta/RecommendationServiceClient/recommend.php +++ b/DiscoveryEngine/samples/V1beta/RecommendationServiceClient/recommend.php @@ -38,7 +38,7 @@ * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` diff --git a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/create_schema.php b/DiscoveryEngine/samples/V1beta/SchemaServiceClient/create_schema.php index 8b59f61f95ab..05e7e5bc25c7 100644 --- a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/create_schema.php +++ b/DiscoveryEngine/samples/V1beta/SchemaServiceClient/create_schema.php @@ -37,7 +37,7 @@ * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. Please see * {@see SchemaServiceClient::dataStoreName()} for help formatting this field. * @param string $schemaId The ID to use for the - * [Schema][google.cloud.discoveryengine.v1beta.Schema], which will become the + * [Schema][google.cloud.discoveryengine.v1beta.Schema], which becomes the * final component of the * [Schema.name][google.cloud.discoveryengine.v1beta.Schema.name]. * diff --git a/DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/list_custom_models.php b/DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/list_custom_models.php new file mode 100644 index 000000000000..b9d1061cf6aa --- /dev/null +++ b/DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/list_custom_models.php @@ -0,0 +1,78 @@ +setDataStore($formattedDataStore); + + // Call the API and handle any network failures. + try { + /** @var ListCustomModelsResponse $response */ + $response = $searchTuningServiceClient->listCustomModels($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 +{ + $formattedDataStore = SearchTuningServiceClient::dataStoreName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]' + ); + + list_custom_models_sample($formattedDataStore); +} +// [END discoveryengine_v1beta_generated_SearchTuningService_ListCustomModels_sync] diff --git a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/import_user_events.php b/DiscoveryEngine/samples/V1beta/UserEventServiceClient/import_user_events.php index e038496755cd..d12089a8d5ac 100644 --- a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/import_user_events.php +++ b/DiscoveryEngine/samples/V1beta/UserEventServiceClient/import_user_events.php @@ -31,7 +31,7 @@ use Google\Rpc\Status; /** - * Bulk import of User events. Request processing might be + * Bulk import of user events. Request processing might be * synchronous. Events that already exist are skipped. * Use this method for backfilling historical user events. * diff --git a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/write_user_event.php b/DiscoveryEngine/samples/V1beta/UserEventServiceClient/write_user_event.php index eaf89dfa96f2..a055f58cbc69 100644 --- a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/write_user_event.php +++ b/DiscoveryEngine/samples/V1beta/UserEventServiceClient/write_user_event.php @@ -31,8 +31,16 @@ /** * Writes a single user event. * - * @param string $formattedParent The parent DataStore resource name, such as - * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. Please see + * @param string $formattedParent The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore] level, the + * format is: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1beta.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore], the format is: + * `projects/{project}/locations/{location}`. Please see * {@see UserEventServiceClient::dataStoreName()} for help formatting this field. * @param string $userEventEventType User event type. Allowed values are: * diff --git a/DiscoveryEngine/src/V1/Answer.php b/DiscoveryEngine/src/V1/Answer.php new file mode 100644 index 000000000000..d015ad6155f4 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer.php @@ -0,0 +1,445 @@ +google.cloud.discoveryengine.v1.Answer + */ +class Answer extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Fully qualified name + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * The state of the answer generation. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.State state = 2; + */ + protected $state = 0; + /** + * The textual answer. + * + * Generated from protobuf field string answer_text = 3; + */ + protected $answer_text = ''; + /** + * Citations. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Citation citations = 4; + */ + private $citations; + /** + * References. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Reference references = 5; + */ + private $references; + /** + * Suggested related questions. + * + * Generated from protobuf field repeated string related_questions = 6; + */ + private $related_questions; + /** + * Answer generation steps. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step steps = 7; + */ + private $steps; + /** + * Query understanding information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo query_understanding_info = 10; + */ + protected $query_understanding_info = null; + /** + * Additional answer-skipped reasons. This provides the reason for ignored + * cases. If nothing is skipped, this field is not set. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.AnswerSkippedReason answer_skipped_reasons = 11; + */ + private $answer_skipped_reasons; + /** + * Output only. Answer creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Answer completed timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp complete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $complete_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. Fully qualified name + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` + * @type int $state + * The state of the answer generation. + * @type string $answer_text + * The textual answer. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\Citation>|\Google\Protobuf\Internal\RepeatedField $citations + * Citations. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\Reference>|\Google\Protobuf\Internal\RepeatedField $references + * References. + * @type array|\Google\Protobuf\Internal\RepeatedField $related_questions + * Suggested related questions. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step>|\Google\Protobuf\Internal\RepeatedField $steps + * Answer generation steps. + * @type \Google\Cloud\DiscoveryEngine\V1\Answer\QueryUnderstandingInfo $query_understanding_info + * Query understanding information. + * @type array|\Google\Protobuf\Internal\RepeatedField $answer_skipped_reasons + * Additional answer-skipped reasons. This provides the reason for ignored + * cases. If nothing is skipped, this field is not set. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Answer creation timestamp. + * @type \Google\Protobuf\Timestamp $complete_time + * Output only. Answer completed timestamp. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. Fully qualified name + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Fully qualified name + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The state of the answer generation. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the answer generation. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\Answer\State::class); + $this->state = $var; + + return $this; + } + + /** + * The textual answer. + * + * Generated from protobuf field string answer_text = 3; + * @return string + */ + public function getAnswerText() + { + return $this->answer_text; + } + + /** + * The textual answer. + * + * Generated from protobuf field string answer_text = 3; + * @param string $var + * @return $this + */ + public function setAnswerText($var) + { + GPBUtil::checkString($var, True); + $this->answer_text = $var; + + return $this; + } + + /** + * Citations. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Citation citations = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCitations() + { + return $this->citations; + } + + /** + * Citations. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Citation citations = 4; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\Citation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCitations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\Citation::class); + $this->citations = $arr; + + return $this; + } + + /** + * References. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Reference references = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReferences() + { + return $this->references; + } + + /** + * References. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Reference references = 5; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\Reference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReferences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\Reference::class); + $this->references = $arr; + + return $this; + } + + /** + * Suggested related questions. + * + * Generated from protobuf field repeated string related_questions = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelatedQuestions() + { + return $this->related_questions; + } + + /** + * Suggested related questions. + * + * Generated from protobuf field repeated string related_questions = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelatedQuestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->related_questions = $arr; + + return $this; + } + + /** + * Answer generation steps. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step steps = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSteps() + { + return $this->steps; + } + + /** + * Answer generation steps. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step steps = 7; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSteps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\Step::class); + $this->steps = $arr; + + return $this; + } + + /** + * Query understanding information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo query_understanding_info = 10; + * @return \Google\Cloud\DiscoveryEngine\V1\Answer\QueryUnderstandingInfo|null + */ + public function getQueryUnderstandingInfo() + { + return $this->query_understanding_info; + } + + public function hasQueryUnderstandingInfo() + { + return isset($this->query_understanding_info); + } + + public function clearQueryUnderstandingInfo() + { + unset($this->query_understanding_info); + } + + /** + * Query understanding information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo query_understanding_info = 10; + * @param \Google\Cloud\DiscoveryEngine\V1\Answer\QueryUnderstandingInfo $var + * @return $this + */ + public function setQueryUnderstandingInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Answer\QueryUnderstandingInfo::class); + $this->query_understanding_info = $var; + + return $this; + } + + /** + * Additional answer-skipped reasons. This provides the reason for ignored + * cases. If nothing is skipped, this field is not set. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.AnswerSkippedReason answer_skipped_reasons = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnswerSkippedReasons() + { + return $this->answer_skipped_reasons; + } + + /** + * Additional answer-skipped reasons. This provides the reason for ignored + * cases. If nothing is skipped, this field is not set. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.AnswerSkippedReason answer_skipped_reasons = 11; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnswerSkippedReasons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\DiscoveryEngine\V1\Answer\AnswerSkippedReason::class); + $this->answer_skipped_reasons = $arr; + + return $this; + } + + /** + * Output only. Answer creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Answer creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Answer completed timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp complete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCompleteTime() + { + return $this->complete_time; + } + + public function hasCompleteTime() + { + return isset($this->complete_time); + } + + public function clearCompleteTime() + { + unset($this->complete_time); + } + + /** + * Output only. Answer completed timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp complete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCompleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->complete_time = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/Answer/AnswerSkippedReason.php b/DiscoveryEngine/src/V1/Answer/AnswerSkippedReason.php new file mode 100644 index 000000000000..2831e28d3e75 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/AnswerSkippedReason.php @@ -0,0 +1,79 @@ +google.cloud.discoveryengine.v1.Answer.AnswerSkippedReason + */ +class AnswerSkippedReason +{ + /** + * Default value. The answer skipped reason is not specified. + * + * Generated from protobuf enum ANSWER_SKIPPED_REASON_UNSPECIFIED = 0; + */ + const ANSWER_SKIPPED_REASON_UNSPECIFIED = 0; + /** + * The adversarial query ignored case. + * + * Generated from protobuf enum ADVERSARIAL_QUERY_IGNORED = 1; + */ + const ADVERSARIAL_QUERY_IGNORED = 1; + /** + * The non-answer seeking query ignored case. + * + * Generated from protobuf enum NON_ANSWER_SEEKING_QUERY_IGNORED = 2; + */ + const NON_ANSWER_SEEKING_QUERY_IGNORED = 2; + /** + * The out-of-domain query ignored case. + * Google skips the answer if there are no high-relevance search results. + * + * Generated from protobuf enum OUT_OF_DOMAIN_QUERY_IGNORED = 3; + */ + const OUT_OF_DOMAIN_QUERY_IGNORED = 3; + /** + * The potential policy violation case. + * Google skips the answer if there is a potential policy violation + * detected. This includes content that may be violent or toxic. + * + * Generated from protobuf enum POTENTIAL_POLICY_VIOLATION = 4; + */ + const POTENTIAL_POLICY_VIOLATION = 4; + + private static $valueToName = [ + self::ANSWER_SKIPPED_REASON_UNSPECIFIED => 'ANSWER_SKIPPED_REASON_UNSPECIFIED', + self::ADVERSARIAL_QUERY_IGNORED => 'ADVERSARIAL_QUERY_IGNORED', + self::NON_ANSWER_SEEKING_QUERY_IGNORED => 'NON_ANSWER_SEEKING_QUERY_IGNORED', + self::OUT_OF_DOMAIN_QUERY_IGNORED => 'OUT_OF_DOMAIN_QUERY_IGNORED', + self::POTENTIAL_POLICY_VIOLATION => 'POTENTIAL_POLICY_VIOLATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Citation.php b/DiscoveryEngine/src/V1/Answer/Citation.php new file mode 100644 index 000000000000..fd8913ea931c --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Citation.php @@ -0,0 +1,140 @@ +google.cloud.discoveryengine.v1.Answer.Citation + */ +class Citation extends \Google\Protobuf\Internal\Message +{ + /** + * Index indicates the start of the segment, measured in bytes (UTF-8 + * unicode). + * + * Generated from protobuf field int64 start_index = 1; + */ + protected $start_index = 0; + /** + * End of the attributed segment, exclusive. + * + * Generated from protobuf field int64 end_index = 2; + */ + protected $end_index = 0; + /** + * Citation sources for the attributed segment. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 3; + */ + private $sources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $start_index + * Index indicates the start of the segment, measured in bytes (UTF-8 + * unicode). + * @type int|string $end_index + * End of the attributed segment, exclusive. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\CitationSource>|\Google\Protobuf\Internal\RepeatedField $sources + * Citation sources for the attributed segment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Index indicates the start of the segment, measured in bytes (UTF-8 + * unicode). + * + * Generated from protobuf field int64 start_index = 1; + * @return int|string + */ + public function getStartIndex() + { + return $this->start_index; + } + + /** + * Index indicates the start of the segment, measured in bytes (UTF-8 + * unicode). + * + * Generated from protobuf field int64 start_index = 1; + * @param int|string $var + * @return $this + */ + public function setStartIndex($var) + { + GPBUtil::checkInt64($var); + $this->start_index = $var; + + return $this; + } + + /** + * End of the attributed segment, exclusive. + * + * Generated from protobuf field int64 end_index = 2; + * @return int|string + */ + public function getEndIndex() + { + return $this->end_index; + } + + /** + * End of the attributed segment, exclusive. + * + * Generated from protobuf field int64 end_index = 2; + * @param int|string $var + * @return $this + */ + public function setEndIndex($var) + { + GPBUtil::checkInt64($var); + $this->end_index = $var; + + return $this; + } + + /** + * Citation sources for the attributed segment. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSources() + { + return $this->sources; + } + + /** + * Citation sources for the attributed segment. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 3; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\CitationSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\CitationSource::class); + $this->sources = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/CitationSource.php b/DiscoveryEngine/src/V1/Answer/CitationSource.php new file mode 100644 index 000000000000..b21003e4a139 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/CitationSource.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.Answer.CitationSource + */ +class CitationSource extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the citation source. + * + * Generated from protobuf field string reference_id = 1; + */ + protected $reference_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reference_id + * ID of the citation source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * ID of the citation source. + * + * Generated from protobuf field string reference_id = 1; + * @return string + */ + public function getReferenceId() + { + return $this->reference_id; + } + + /** + * ID of the citation source. + * + * Generated from protobuf field string reference_id = 1; + * @param string $var + * @return $this + */ + public function setReferenceId($var) + { + GPBUtil::checkString($var, True); + $this->reference_id = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo.php b/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo.php new file mode 100644 index 000000000000..435c1af240cd --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo + */ +class QueryUnderstandingInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Query classification information. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo query_classification_info = 1; + */ + private $query_classification_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\QueryUnderstandingInfo\QueryClassificationInfo>|\Google\Protobuf\Internal\RepeatedField $query_classification_info + * Query classification information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Query classification information. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo query_classification_info = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryClassificationInfo() + { + return $this->query_classification_info; + } + + /** + * Query classification information. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo query_classification_info = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\QueryUnderstandingInfo\QueryClassificationInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryClassificationInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\QueryUnderstandingInfo\QueryClassificationInfo::class); + $this->query_classification_info = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo.php b/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo.php new file mode 100644 index 000000000000..126b078520f2 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo.php @@ -0,0 +1,102 @@ +google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo + */ +class QueryClassificationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Query classification type. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo.Type type = 1; + */ + protected $type = 0; + /** + * Classification output. + * + * Generated from protobuf field bool positive = 2; + */ + protected $positive = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Query classification type. + * @type bool $positive + * Classification output. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Query classification type. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Query classification type. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\Answer\QueryUnderstandingInfo\QueryClassificationInfo\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Classification output. + * + * Generated from protobuf field bool positive = 2; + * @return bool + */ + public function getPositive() + { + return $this->positive; + } + + /** + * Classification output. + * + * Generated from protobuf field bool positive = 2; + * @param bool $var + * @return $this + */ + public function setPositive($var) + { + GPBUtil::checkBool($var); + $this->positive = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo/Type.php b/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo/Type.php new file mode 100644 index 000000000000..adc0e5e76096 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo/Type.php @@ -0,0 +1,62 @@ +google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo.Type + */ +class Type +{ + /** + * Unspecified query classification type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Adversarial query classification type. + * + * Generated from protobuf enum ADVERSARIAL_QUERY = 1; + */ + const ADVERSARIAL_QUERY = 1; + /** + * Non-answer-seeking query classification type. + * + * Generated from protobuf enum NON_ANSWER_SEEKING_QUERY = 2; + */ + const NON_ANSWER_SEEKING_QUERY = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ADVERSARIAL_QUERY => 'ADVERSARIAL_QUERY', + self::NON_ANSWER_SEEKING_QUERY => 'NON_ANSWER_SEEKING_QUERY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Reference.php b/DiscoveryEngine/src/V1/Answer/Reference.php new file mode 100644 index 000000000000..97c9fbcaf51e --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Reference.php @@ -0,0 +1,109 @@ +google.cloud.discoveryengine.v1.Answer.Reference + */ +class Reference extends \Google\Protobuf\Internal\Message +{ + protected $content; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\UnstructuredDocumentInfo $unstructured_document_info + * Unstructured document information. + * @type \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\ChunkInfo $chunk_info + * Chunk information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Unstructured document information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo unstructured_document_info = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\UnstructuredDocumentInfo|null + */ + public function getUnstructuredDocumentInfo() + { + return $this->readOneof(1); + } + + public function hasUnstructuredDocumentInfo() + { + return $this->hasOneof(1); + } + + /** + * Unstructured document information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo unstructured_document_info = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\UnstructuredDocumentInfo $var + * @return $this + */ + public function setUnstructuredDocumentInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\UnstructuredDocumentInfo::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Chunk information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo chunk_info = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\ChunkInfo|null + */ + public function getChunkInfo() + { + return $this->readOneof(2); + } + + public function hasChunkInfo() + { + return $this->hasOneof(2); + } + + /** + * Chunk information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo chunk_info = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\ChunkInfo $var + * @return $this + */ + public function setChunkInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\ChunkInfo::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->whichOneof("content"); + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Reference/ChunkInfo.php b/DiscoveryEngine/src/V1/Answer/Reference/ChunkInfo.php new file mode 100644 index 000000000000..c9ff4ce71e61 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Reference/ChunkInfo.php @@ -0,0 +1,190 @@ +google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo + */ +class ChunkInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Chunk resource name. + * + * Generated from protobuf field string chunk = 1 [(.google.api.resource_reference) = { + */ + protected $chunk = ''; + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 2; + */ + protected $content = ''; + /** + * Relevance score. + * + * Generated from protobuf field optional float relevance_score = 3; + */ + protected $relevance_score = null; + /** + * Document metadata. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo.DocumentMetadata document_metadata = 4; + */ + protected $document_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $chunk + * Chunk resource name. + * @type string $content + * Chunk textual content. + * @type float $relevance_score + * Relevance score. + * @type \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\ChunkInfo\DocumentMetadata $document_metadata + * Document metadata. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Chunk resource name. + * + * Generated from protobuf field string chunk = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getChunk() + { + return $this->chunk; + } + + /** + * Chunk resource name. + * + * Generated from protobuf field string chunk = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setChunk($var) + { + GPBUtil::checkString($var, True); + $this->chunk = $var; + + return $this; + } + + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 2; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Relevance score. + * + * Generated from protobuf field optional float relevance_score = 3; + * @return float + */ + public function getRelevanceScore() + { + return isset($this->relevance_score) ? $this->relevance_score : 0.0; + } + + public function hasRelevanceScore() + { + return isset($this->relevance_score); + } + + public function clearRelevanceScore() + { + unset($this->relevance_score); + } + + /** + * Relevance score. + * + * Generated from protobuf field optional float relevance_score = 3; + * @param float $var + * @return $this + */ + public function setRelevanceScore($var) + { + GPBUtil::checkFloat($var); + $this->relevance_score = $var; + + return $this; + } + + /** + * Document metadata. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo.DocumentMetadata document_metadata = 4; + * @return \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\ChunkInfo\DocumentMetadata|null + */ + public function getDocumentMetadata() + { + return $this->document_metadata; + } + + public function hasDocumentMetadata() + { + return isset($this->document_metadata); + } + + public function clearDocumentMetadata() + { + unset($this->document_metadata); + } + + /** + * Document metadata. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo.DocumentMetadata document_metadata = 4; + * @param \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\ChunkInfo\DocumentMetadata $var + * @return $this + */ + public function setDocumentMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\ChunkInfo\DocumentMetadata::class); + $this->document_metadata = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Reference/ChunkInfo/DocumentMetadata.php b/DiscoveryEngine/src/V1/Answer/Reference/ChunkInfo/DocumentMetadata.php new file mode 100644 index 000000000000..74e3fd5eb6b4 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Reference/ChunkInfo/DocumentMetadata.php @@ -0,0 +1,218 @@ +google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo.DocumentMetadata + */ +class DocumentMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Document resource name. + * + * Generated from protobuf field string document = 1 [(.google.api.resource_reference) = { + */ + protected $document = ''; + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * Title. + * + * Generated from protobuf field string title = 3; + */ + protected $title = ''; + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 4; + */ + protected $page_identifier = ''; + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + */ + protected $struct_data = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $document + * Document resource name. + * @type string $uri + * URI for the document. + * @type string $title + * Title. + * @type string $page_identifier + * Page identifier. + * @type \Google\Protobuf\Struct $struct_data + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Document resource name. + * + * Generated from protobuf field string document = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getDocument() + { + return $this->document; + } + + /** + * Document resource name. + * + * Generated from protobuf field string document = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkString($var, True); + $this->document = $var; + + return $this; + } + + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Title. + * + * Generated from protobuf field string title = 3; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Title. + * + * Generated from protobuf field string title = 3; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 4; + * @return string + */ + public function getPageIdentifier() + { + return $this->page_identifier; + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 4; + * @param string $var + * @return $this + */ + public function setPageIdentifier($var) + { + GPBUtil::checkString($var, True); + $this->page_identifier = $var; + + return $this; + } + + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getStructData() + { + return $this->struct_data; + } + + public function hasStructData() + { + return isset($this->struct_data); + } + + public function clearStructData() + { + unset($this->struct_data); + } + + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setStructData($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->struct_data = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Reference/UnstructuredDocumentInfo.php b/DiscoveryEngine/src/V1/Answer/Reference/UnstructuredDocumentInfo.php new file mode 100644 index 000000000000..7fb3b4c15587 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Reference/UnstructuredDocumentInfo.php @@ -0,0 +1,218 @@ +google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo + */ +class UnstructuredDocumentInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Document resource name. + * + * Generated from protobuf field string document = 1 [(.google.api.resource_reference) = { + */ + protected $document = ''; + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * Title. + * + * Generated from protobuf field string title = 3; + */ + protected $title = ''; + /** + * List of cited chunk contents derived from document content. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo.ChunkContent chunk_contents = 4; + */ + private $chunk_contents; + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + */ + protected $struct_data = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $document + * Document resource name. + * @type string $uri + * URI for the document. + * @type string $title + * Title. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\Reference\UnstructuredDocumentInfo\ChunkContent>|\Google\Protobuf\Internal\RepeatedField $chunk_contents + * List of cited chunk contents derived from document content. + * @type \Google\Protobuf\Struct $struct_data + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Document resource name. + * + * Generated from protobuf field string document = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getDocument() + { + return $this->document; + } + + /** + * Document resource name. + * + * Generated from protobuf field string document = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkString($var, True); + $this->document = $var; + + return $this; + } + + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Title. + * + * Generated from protobuf field string title = 3; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Title. + * + * Generated from protobuf field string title = 3; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * List of cited chunk contents derived from document content. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo.ChunkContent chunk_contents = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChunkContents() + { + return $this->chunk_contents; + } + + /** + * List of cited chunk contents derived from document content. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo.ChunkContent chunk_contents = 4; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\Reference\UnstructuredDocumentInfo\ChunkContent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChunkContents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\Reference\UnstructuredDocumentInfo\ChunkContent::class); + $this->chunk_contents = $arr; + + return $this; + } + + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getStructData() + { + return $this->struct_data; + } + + public function hasStructData() + { + return isset($this->struct_data); + } + + public function clearStructData() + { + unset($this->struct_data); + } + + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setStructData($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->struct_data = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Reference/UnstructuredDocumentInfo/ChunkContent.php b/DiscoveryEngine/src/V1/Answer/Reference/UnstructuredDocumentInfo/ChunkContent.php new file mode 100644 index 000000000000..7c751ed1c5e8 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Reference/UnstructuredDocumentInfo/ChunkContent.php @@ -0,0 +1,102 @@ +google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo.ChunkContent + */ +class ChunkContent extends \Google\Protobuf\Internal\Message +{ + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 1; + */ + protected $content = ''; + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 2; + */ + protected $page_identifier = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * Chunk textual content. + * @type string $page_identifier + * Page identifier. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 1; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 1; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 2; + * @return string + */ + public function getPageIdentifier() + { + return $this->page_identifier; + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 2; + * @param string $var + * @return $this + */ + public function setPageIdentifier($var) + { + GPBUtil::checkString($var, True); + $this->page_identifier = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/State.php b/DiscoveryEngine/src/V1/Answer/State.php new file mode 100644 index 000000000000..6ca566b78136 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/State.php @@ -0,0 +1,69 @@ +google.cloud.discoveryengine.v1.Answer.State + */ +class State +{ + /** + * Unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Answer generation is currently in progress. + * + * Generated from protobuf enum IN_PROGRESS = 1; + */ + const IN_PROGRESS = 1; + /** + * Answer generation currently failed. + * + * Generated from protobuf enum FAILED = 2; + */ + const FAILED = 2; + /** + * Answer generation has succeeded. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::FAILED => 'FAILED', + self::SUCCEEDED => 'SUCCEEDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Step.php b/DiscoveryEngine/src/V1/Answer/Step.php new file mode 100644 index 000000000000..68634c39897f --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Step.php @@ -0,0 +1,170 @@ +google.cloud.discoveryengine.v1.Answer.Step + */ +class Step extends \Google\Protobuf\Internal\Message +{ + /** + * The state of the step. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Step.State state = 1; + */ + protected $state = 0; + /** + * The description of the step. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * The thought of the step. + * + * Generated from protobuf field string thought = 3; + */ + protected $thought = ''; + /** + * Actions. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action actions = 4; + */ + private $actions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The state of the step. + * @type string $description + * The description of the step. + * @type string $thought + * The thought of the step. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action>|\Google\Protobuf\Internal\RepeatedField $actions + * Actions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * The state of the step. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Step.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the step. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Step.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\Answer\Step\State::class); + $this->state = $var; + + return $this; + } + + /** + * The description of the step. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * The description of the step. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The thought of the step. + * + * Generated from protobuf field string thought = 3; + * @return string + */ + public function getThought() + { + return $this->thought; + } + + /** + * The thought of the step. + * + * Generated from protobuf field string thought = 3; + * @param string $var + * @return $this + */ + public function setThought($var) + { + GPBUtil::checkString($var, True); + $this->thought = $var; + + return $this; + } + + /** + * Actions. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action actions = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActions() + { + return $this->actions; + } + + /** + * Actions. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action actions = 4; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action::class); + $this->actions = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Step/Action.php b/DiscoveryEngine/src/V1/Answer/Step/Action.php new file mode 100644 index 000000000000..b5900efabf9e --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Step/Action.php @@ -0,0 +1,120 @@ +google.cloud.discoveryengine.v1.Answer.Step.Action + */ +class Action extends \Google\Protobuf\Internal\Message +{ + /** + * Observation. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation observation = 3; + */ + protected $observation = null; + protected $action; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\SearchAction $search_action + * Search action. + * @type \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation $observation + * Observation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Search action. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Step.Action.SearchAction search_action = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\SearchAction|null + */ + public function getSearchAction() + { + return $this->readOneof(2); + } + + public function hasSearchAction() + { + return $this->hasOneof(2); + } + + /** + * Search action. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Step.Action.SearchAction search_action = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\SearchAction $var + * @return $this + */ + public function setSearchAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\SearchAction::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Observation. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation observation = 3; + * @return \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation|null + */ + public function getObservation() + { + return $this->observation; + } + + public function hasObservation() + { + return isset($this->observation); + } + + public function clearObservation() + { + unset($this->observation); + } + + /** + * Observation. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation observation = 3; + * @param \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation $var + * @return $this + */ + public function setObservation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation::class); + $this->observation = $var; + + return $this; + } + + /** + * @return string + */ + public function getAction() + { + return $this->whichOneof("action"); + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Step/Action/Observation.php b/DiscoveryEngine/src/V1/Answer/Step/Action/Observation.php new file mode 100644 index 000000000000..43e13119e0a3 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Step/Action/Observation.php @@ -0,0 +1,72 @@ +google.cloud.discoveryengine.v1.Answer.Step.Action.Observation + */ +class Observation extends \Google\Protobuf\Internal\Message +{ + /** + * Search results observed by the search action, it can be snippets info + * or chunk info, depending on the citation type set by the user. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult search_results = 2; + */ + private $search_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation\SearchResult>|\Google\Protobuf\Internal\RepeatedField $search_results + * Search results observed by the search action, it can be snippets info + * or chunk info, depending on the citation type set by the user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Search results observed by the search action, it can be snippets info + * or chunk info, depending on the citation type set by the user. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult search_results = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSearchResults() + { + return $this->search_results; + } + + /** + * Search results observed by the search action, it can be snippets info + * or chunk info, depending on the citation type set by the user. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult search_results = 2; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation\SearchResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSearchResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation\SearchResult::class); + $this->search_results = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult.php b/DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult.php new file mode 100644 index 000000000000..7244593e987a --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult.php @@ -0,0 +1,210 @@ +google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult + */ +class SearchResult extends \Google\Protobuf\Internal\Message +{ + /** + * Document resource name. + * + * Generated from protobuf field string document = 1; + */ + protected $document = ''; + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * Title. + * + * Generated from protobuf field string title = 3; + */ + protected $title = ''; + /** + * If citation_type is DOCUMENT_LEVEL_CITATION, populate document + * level snippets. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.SnippetInfo snippet_info = 4; + */ + private $snippet_info; + /** + * If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, + * populate chunk info. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.ChunkInfo chunk_info = 5; + */ + private $chunk_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $document + * Document resource name. + * @type string $uri + * URI for the document. + * @type string $title + * Title. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation\SearchResult\SnippetInfo>|\Google\Protobuf\Internal\RepeatedField $snippet_info + * If citation_type is DOCUMENT_LEVEL_CITATION, populate document + * level snippets. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation\SearchResult\ChunkInfo>|\Google\Protobuf\Internal\RepeatedField $chunk_info + * If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, + * populate chunk info. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Document resource name. + * + * Generated from protobuf field string document = 1; + * @return string + */ + public function getDocument() + { + return $this->document; + } + + /** + * Document resource name. + * + * Generated from protobuf field string document = 1; + * @param string $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkString($var, True); + $this->document = $var; + + return $this; + } + + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Title. + * + * Generated from protobuf field string title = 3; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Title. + * + * Generated from protobuf field string title = 3; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * If citation_type is DOCUMENT_LEVEL_CITATION, populate document + * level snippets. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.SnippetInfo snippet_info = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSnippetInfo() + { + return $this->snippet_info; + } + + /** + * If citation_type is DOCUMENT_LEVEL_CITATION, populate document + * level snippets. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.SnippetInfo snippet_info = 4; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation\SearchResult\SnippetInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSnippetInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation\SearchResult\SnippetInfo::class); + $this->snippet_info = $arr; + + return $this; + } + + /** + * If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, + * populate chunk info. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.ChunkInfo chunk_info = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChunkInfo() + { + return $this->chunk_info; + } + + /** + * If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, + * populate chunk info. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.ChunkInfo chunk_info = 5; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation\SearchResult\ChunkInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChunkInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Answer\Step\Action\Observation\SearchResult\ChunkInfo::class); + $this->chunk_info = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult/ChunkInfo.php b/DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult/ChunkInfo.php new file mode 100644 index 000000000000..ee87db5479d8 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult/ChunkInfo.php @@ -0,0 +1,146 @@ +google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.ChunkInfo + */ +class ChunkInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Chunk resource name. + * + * Generated from protobuf field string chunk = 1; + */ + protected $chunk = ''; + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 2; + */ + protected $content = ''; + /** + * Relevance score. + * + * Generated from protobuf field optional float relevance_score = 3; + */ + protected $relevance_score = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $chunk + * Chunk resource name. + * @type string $content + * Chunk textual content. + * @type float $relevance_score + * Relevance score. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Chunk resource name. + * + * Generated from protobuf field string chunk = 1; + * @return string + */ + public function getChunk() + { + return $this->chunk; + } + + /** + * Chunk resource name. + * + * Generated from protobuf field string chunk = 1; + * @param string $var + * @return $this + */ + public function setChunk($var) + { + GPBUtil::checkString($var, True); + $this->chunk = $var; + + return $this; + } + + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 2; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Relevance score. + * + * Generated from protobuf field optional float relevance_score = 3; + * @return float + */ + public function getRelevanceScore() + { + return isset($this->relevance_score) ? $this->relevance_score : 0.0; + } + + public function hasRelevanceScore() + { + return isset($this->relevance_score); + } + + public function clearRelevanceScore() + { + unset($this->relevance_score); + } + + /** + * Relevance score. + * + * Generated from protobuf field optional float relevance_score = 3; + * @param float $var + * @return $this + */ + public function setRelevanceScore($var) + { + GPBUtil::checkFloat($var); + $this->relevance_score = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult/SnippetInfo.php b/DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult/SnippetInfo.php new file mode 100644 index 000000000000..3acbbb0f66c1 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Step/Action/Observation/SearchResult/SnippetInfo.php @@ -0,0 +1,102 @@ +google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.SnippetInfo + */ +class SnippetInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Snippet content. + * + * Generated from protobuf field string snippet = 1; + */ + protected $snippet = ''; + /** + * Status of the snippet defined by the search team. + * + * Generated from protobuf field string snippet_status = 2; + */ + protected $snippet_status = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $snippet + * Snippet content. + * @type string $snippet_status + * Status of the snippet defined by the search team. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * Snippet content. + * + * Generated from protobuf field string snippet = 1; + * @return string + */ + public function getSnippet() + { + return $this->snippet; + } + + /** + * Snippet content. + * + * Generated from protobuf field string snippet = 1; + * @param string $var + * @return $this + */ + public function setSnippet($var) + { + GPBUtil::checkString($var, True); + $this->snippet = $var; + + return $this; + } + + /** + * Status of the snippet defined by the search team. + * + * Generated from protobuf field string snippet_status = 2; + * @return string + */ + public function getSnippetStatus() + { + return $this->snippet_status; + } + + /** + * Status of the snippet defined by the search team. + * + * Generated from protobuf field string snippet_status = 2; + * @param string $var + * @return $this + */ + public function setSnippetStatus($var) + { + GPBUtil::checkString($var, True); + $this->snippet_status = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Step/Action/SearchAction.php b/DiscoveryEngine/src/V1/Answer/Step/Action/SearchAction.php new file mode 100644 index 000000000000..d3af5899c355 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Step/Action/SearchAction.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.Answer.Step.Action.SearchAction + */ +class SearchAction extends \Google\Protobuf\Internal\Message +{ + /** + * The query to search. + * + * Generated from protobuf field string query = 1; + */ + protected $query = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query + * The query to search. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Answer::initOnce(); + parent::__construct($data); + } + + /** + * The query to search. + * + * Generated from protobuf field string query = 1; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * The query to search. + * + * Generated from protobuf field string query = 1; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Answer/Step/State.php b/DiscoveryEngine/src/V1/Answer/Step/State.php new file mode 100644 index 000000000000..7cf4f0e088e1 --- /dev/null +++ b/DiscoveryEngine/src/V1/Answer/Step/State.php @@ -0,0 +1,69 @@ +google.cloud.discoveryengine.v1.Answer.Step.State + */ +class State +{ + /** + * Unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Step is currently in progress. + * + * Generated from protobuf enum IN_PROGRESS = 1; + */ + const IN_PROGRESS = 1; + /** + * Step currently failed. + * + * Generated from protobuf enum FAILED = 2; + */ + const FAILED = 2; + /** + * Step has succeeded. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::FAILED => 'FAILED', + self::SUCCEEDED => 'SUCCEEDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest.php b/DiscoveryEngine/src/V1/AnswerQueryRequest.php new file mode 100644 index 000000000000..fb0beb327b52 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest.php @@ -0,0 +1,519 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest + */ +class AnswerQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Search serving config, such as + * `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + * or + * `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. + * This field is used to identify the serving configuration name, set + * of models used to make the search. + * + * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $serving_config = ''; + /** + * Required. Current user query. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Query query = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = null; + /** + * The session resource name. Not required. + * When session field is not set, the API is in sessionless mode. + * We support auto session mode: users can use the wildcard symbol `-` as + * session ID. A new ID will be automatically generated and assigned. + * + * Generated from protobuf field string session = 3 [(.google.api.resource_reference) = { + */ + protected $session = ''; + /** + * Model specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec safety_spec = 4; + */ + protected $safety_spec = null; + /** + * Related questions specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5; + */ + protected $related_questions_spec = null; + /** + * Answer generation specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7; + */ + protected $answer_generation_spec = null; + /** + * Search specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec search_spec = 8; + */ + protected $search_spec = null; + /** + * Query understanding specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9; + */ + protected $query_understanding_spec = null; + /** + * Asynchronous mode control. + * If enabled, the response will be returned with answer/session resource + * name without final answer. The API users need to do the polling to get + * the latest status of answer/session by calling + * [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer] + * or + * [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession] + * method. + * + * Generated from protobuf field bool asynchronous_mode = 10; + */ + protected $asynchronous_mode = false; + /** + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * This field should NOT have a fixed value such as `unknown_visitor`. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * + * Generated from protobuf field string user_pseudo_id = 12; + */ + protected $user_pseudo_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $serving_config + * Required. The resource name of the Search serving config, such as + * `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + * or + * `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. + * This field is used to identify the serving configuration name, set + * of models used to make the search. + * @type \Google\Cloud\DiscoveryEngine\V1\Query $query + * Required. Current user query. + * @type string $session + * The session resource name. Not required. + * When session field is not set, the API is in sessionless mode. + * We support auto session mode: users can use the wildcard symbol `-` as + * session ID. A new ID will be automatically generated and assigned. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SafetySpec $safety_spec + * Model specification. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\RelatedQuestionsSpec $related_questions_spec + * Related questions specification. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec $answer_generation_spec + * Answer generation specification. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec $search_spec + * Search specification. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec $query_understanding_spec + * Query understanding specification. + * @type bool $asynchronous_mode + * Asynchronous mode control. + * If enabled, the response will be returned with answer/session resource + * name without final answer. The API users need to do the polling to get + * the latest status of answer/session by calling + * [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer] + * or + * [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession] + * method. + * @type string $user_pseudo_id + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * This field should NOT have a fixed value such as `unknown_visitor`. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Search serving config, such as + * `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + * or + * `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. + * This field is used to identify the serving configuration name, set + * of models used to make the search. + * + * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getServingConfig() + { + return $this->serving_config; + } + + /** + * Required. The resource name of the Search serving config, such as + * `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + * or + * `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. + * This field is used to identify the serving configuration name, set + * of models used to make the search. + * + * Generated from protobuf field string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServingConfig($var) + { + GPBUtil::checkString($var, True); + $this->serving_config = $var; + + return $this; + } + + /** + * Required. Current user query. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Query query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DiscoveryEngine\V1\Query|null + */ + public function getQuery() + { + return $this->query; + } + + public function hasQuery() + { + return isset($this->query); + } + + public function clearQuery() + { + unset($this->query); + } + + /** + * Required. Current user query. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Query query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DiscoveryEngine\V1\Query $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Query::class); + $this->query = $var; + + return $this; + } + + /** + * The session resource name. Not required. + * When session field is not set, the API is in sessionless mode. + * We support auto session mode: users can use the wildcard symbol `-` as + * session ID. A new ID will be automatically generated and assigned. + * + * Generated from protobuf field string session = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getSession() + { + return $this->session; + } + + /** + * The session resource name. Not required. + * When session field is not set, the API is in sessionless mode. + * We support auto session mode: users can use the wildcard symbol `-` as + * session ID. A new ID will be automatically generated and assigned. + * + * Generated from protobuf field string session = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkString($var, True); + $this->session = $var; + + return $this; + } + + /** + * Model specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec safety_spec = 4; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SafetySpec|null + */ + public function getSafetySpec() + { + return $this->safety_spec; + } + + public function hasSafetySpec() + { + return isset($this->safety_spec); + } + + public function clearSafetySpec() + { + unset($this->safety_spec); + } + + /** + * Model specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec safety_spec = 4; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SafetySpec $var + * @return $this + */ + public function setSafetySpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SafetySpec::class); + $this->safety_spec = $var; + + return $this; + } + + /** + * Related questions specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\RelatedQuestionsSpec|null + */ + public function getRelatedQuestionsSpec() + { + return $this->related_questions_spec; + } + + public function hasRelatedQuestionsSpec() + { + return isset($this->related_questions_spec); + } + + public function clearRelatedQuestionsSpec() + { + unset($this->related_questions_spec); + } + + /** + * Related questions specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\RelatedQuestionsSpec $var + * @return $this + */ + public function setRelatedQuestionsSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\RelatedQuestionsSpec::class); + $this->related_questions_spec = $var; + + return $this; + } + + /** + * Answer generation specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec|null + */ + public function getAnswerGenerationSpec() + { + return $this->answer_generation_spec; + } + + public function hasAnswerGenerationSpec() + { + return isset($this->answer_generation_spec); + } + + public function clearAnswerGenerationSpec() + { + unset($this->answer_generation_spec); + } + + /** + * Answer generation specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec $var + * @return $this + */ + public function setAnswerGenerationSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec::class); + $this->answer_generation_spec = $var; + + return $this; + } + + /** + * Search specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec search_spec = 8; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec|null + */ + public function getSearchSpec() + { + return $this->search_spec; + } + + public function hasSearchSpec() + { + return isset($this->search_spec); + } + + public function clearSearchSpec() + { + unset($this->search_spec); + } + + /** + * Search specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec search_spec = 8; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec $var + * @return $this + */ + public function setSearchSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec::class); + $this->search_spec = $var; + + return $this; + } + + /** + * Query understanding specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec|null + */ + public function getQueryUnderstandingSpec() + { + return $this->query_understanding_spec; + } + + public function hasQueryUnderstandingSpec() + { + return isset($this->query_understanding_spec); + } + + public function clearQueryUnderstandingSpec() + { + unset($this->query_understanding_spec); + } + + /** + * Query understanding specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec $var + * @return $this + */ + public function setQueryUnderstandingSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec::class); + $this->query_understanding_spec = $var; + + return $this; + } + + /** + * Asynchronous mode control. + * If enabled, the response will be returned with answer/session resource + * name without final answer. The API users need to do the polling to get + * the latest status of answer/session by calling + * [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer] + * or + * [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession] + * method. + * + * Generated from protobuf field bool asynchronous_mode = 10; + * @return bool + */ + public function getAsynchronousMode() + { + return $this->asynchronous_mode; + } + + /** + * Asynchronous mode control. + * If enabled, the response will be returned with answer/session resource + * name without final answer. The API users need to do the polling to get + * the latest status of answer/session by calling + * [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer] + * or + * [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession] + * method. + * + * Generated from protobuf field bool asynchronous_mode = 10; + * @param bool $var + * @return $this + */ + public function setAsynchronousMode($var) + { + GPBUtil::checkBool($var); + $this->asynchronous_mode = $var; + + return $this; + } + + /** + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * This field should NOT have a fixed value such as `unknown_visitor`. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * + * Generated from protobuf field string user_pseudo_id = 12; + * @return string + */ + public function getUserPseudoId() + { + return $this->user_pseudo_id; + } + + /** + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * This field should NOT have a fixed value such as `unknown_visitor`. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * + * Generated from protobuf field string user_pseudo_id = 12; + * @param string $var + * @return $this + */ + public function setUserPseudoId($var) + { + GPBUtil::checkString($var, True); + $this->user_pseudo_id = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec.php new file mode 100644 index 000000000000..0bd500071a5d --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec.php @@ -0,0 +1,382 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec + */ +class AnswerGenerationSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Answer generation model specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.ModelSpec model_spec = 1; + */ + protected $model_spec = null; + /** + * Answer generation prompt specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.PromptSpec prompt_spec = 2; + */ + protected $prompt_spec = null; + /** + * Specifies whether to include citation metadata in the answer. The default + * value is `false`. + * + * Generated from protobuf field bool include_citations = 3; + */ + protected $include_citations = false; + /** + * Language code for Answer. Use language tags defined by + * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * Note: This is an experimental feature. + * + * Generated from protobuf field string answer_language_code = 4; + */ + protected $answer_language_code = ''; + /** + * Specifies whether to filter out adversarial queries. The default value + * is `false`. + * Google employs search-query classification to detect adversarial + * queries. No answer is returned if the search query is classified as an + * adversarial query. For example, a user might ask a question regarding + * negative comments about the company or submit a query designed to + * generate unsafe, policy-violating output. If this field is set to + * `true`, we skip generating answers for adversarial queries and return + * fallback messages instead. + * + * Generated from protobuf field bool ignore_adversarial_query = 5; + */ + protected $ignore_adversarial_query = false; + /** + * Specifies whether to filter out queries that are not answer-seeking. + * The default value is `false`. + * Google employs search-query classification to detect answer-seeking + * queries. No answer is returned if the search query is classified as a + * non-answer seeking query. If this field is set to `true`, we skip + * generating answers for non-answer seeking queries and return + * fallback messages instead. + * + * Generated from protobuf field bool ignore_non_answer_seeking_query = 6; + */ + protected $ignore_non_answer_seeking_query = false; + /** + * Specifies whether to filter out queries that have low relevance. + * If this field is set to `false`, all search results are used regardless + * of relevance to generate answers. If set to `true` or unset, the behavior + * will be determined automatically by the service. + * + * Generated from protobuf field optional bool ignore_low_relevant_content = 7; + */ + protected $ignore_low_relevant_content = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\ModelSpec $model_spec + * Answer generation model specification. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\PromptSpec $prompt_spec + * Answer generation prompt specification. + * @type bool $include_citations + * Specifies whether to include citation metadata in the answer. The default + * value is `false`. + * @type string $answer_language_code + * Language code for Answer. Use language tags defined by + * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * Note: This is an experimental feature. + * @type bool $ignore_adversarial_query + * Specifies whether to filter out adversarial queries. The default value + * is `false`. + * Google employs search-query classification to detect adversarial + * queries. No answer is returned if the search query is classified as an + * adversarial query. For example, a user might ask a question regarding + * negative comments about the company or submit a query designed to + * generate unsafe, policy-violating output. If this field is set to + * `true`, we skip generating answers for adversarial queries and return + * fallback messages instead. + * @type bool $ignore_non_answer_seeking_query + * Specifies whether to filter out queries that are not answer-seeking. + * The default value is `false`. + * Google employs search-query classification to detect answer-seeking + * queries. No answer is returned if the search query is classified as a + * non-answer seeking query. If this field is set to `true`, we skip + * generating answers for non-answer seeking queries and return + * fallback messages instead. + * @type bool $ignore_low_relevant_content + * Specifies whether to filter out queries that have low relevance. + * If this field is set to `false`, all search results are used regardless + * of relevance to generate answers. If set to `true` or unset, the behavior + * will be determined automatically by the service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Answer generation model specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.ModelSpec model_spec = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\ModelSpec|null + */ + public function getModelSpec() + { + return $this->model_spec; + } + + public function hasModelSpec() + { + return isset($this->model_spec); + } + + public function clearModelSpec() + { + unset($this->model_spec); + } + + /** + * Answer generation model specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.ModelSpec model_spec = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\ModelSpec $var + * @return $this + */ + public function setModelSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\ModelSpec::class); + $this->model_spec = $var; + + return $this; + } + + /** + * Answer generation prompt specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.PromptSpec prompt_spec = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\PromptSpec|null + */ + public function getPromptSpec() + { + return $this->prompt_spec; + } + + public function hasPromptSpec() + { + return isset($this->prompt_spec); + } + + public function clearPromptSpec() + { + unset($this->prompt_spec); + } + + /** + * Answer generation prompt specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.PromptSpec prompt_spec = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\PromptSpec $var + * @return $this + */ + public function setPromptSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\PromptSpec::class); + $this->prompt_spec = $var; + + return $this; + } + + /** + * Specifies whether to include citation metadata in the answer. The default + * value is `false`. + * + * Generated from protobuf field bool include_citations = 3; + * @return bool + */ + public function getIncludeCitations() + { + return $this->include_citations; + } + + /** + * Specifies whether to include citation metadata in the answer. The default + * value is `false`. + * + * Generated from protobuf field bool include_citations = 3; + * @param bool $var + * @return $this + */ + public function setIncludeCitations($var) + { + GPBUtil::checkBool($var); + $this->include_citations = $var; + + return $this; + } + + /** + * Language code for Answer. Use language tags defined by + * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * Note: This is an experimental feature. + * + * Generated from protobuf field string answer_language_code = 4; + * @return string + */ + public function getAnswerLanguageCode() + { + return $this->answer_language_code; + } + + /** + * Language code for Answer. Use language tags defined by + * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * Note: This is an experimental feature. + * + * Generated from protobuf field string answer_language_code = 4; + * @param string $var + * @return $this + */ + public function setAnswerLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->answer_language_code = $var; + + return $this; + } + + /** + * Specifies whether to filter out adversarial queries. The default value + * is `false`. + * Google employs search-query classification to detect adversarial + * queries. No answer is returned if the search query is classified as an + * adversarial query. For example, a user might ask a question regarding + * negative comments about the company or submit a query designed to + * generate unsafe, policy-violating output. If this field is set to + * `true`, we skip generating answers for adversarial queries and return + * fallback messages instead. + * + * Generated from protobuf field bool ignore_adversarial_query = 5; + * @return bool + */ + public function getIgnoreAdversarialQuery() + { + return $this->ignore_adversarial_query; + } + + /** + * Specifies whether to filter out adversarial queries. The default value + * is `false`. + * Google employs search-query classification to detect adversarial + * queries. No answer is returned if the search query is classified as an + * adversarial query. For example, a user might ask a question regarding + * negative comments about the company or submit a query designed to + * generate unsafe, policy-violating output. If this field is set to + * `true`, we skip generating answers for adversarial queries and return + * fallback messages instead. + * + * Generated from protobuf field bool ignore_adversarial_query = 5; + * @param bool $var + * @return $this + */ + public function setIgnoreAdversarialQuery($var) + { + GPBUtil::checkBool($var); + $this->ignore_adversarial_query = $var; + + return $this; + } + + /** + * Specifies whether to filter out queries that are not answer-seeking. + * The default value is `false`. + * Google employs search-query classification to detect answer-seeking + * queries. No answer is returned if the search query is classified as a + * non-answer seeking query. If this field is set to `true`, we skip + * generating answers for non-answer seeking queries and return + * fallback messages instead. + * + * Generated from protobuf field bool ignore_non_answer_seeking_query = 6; + * @return bool + */ + public function getIgnoreNonAnswerSeekingQuery() + { + return $this->ignore_non_answer_seeking_query; + } + + /** + * Specifies whether to filter out queries that are not answer-seeking. + * The default value is `false`. + * Google employs search-query classification to detect answer-seeking + * queries. No answer is returned if the search query is classified as a + * non-answer seeking query. If this field is set to `true`, we skip + * generating answers for non-answer seeking queries and return + * fallback messages instead. + * + * Generated from protobuf field bool ignore_non_answer_seeking_query = 6; + * @param bool $var + * @return $this + */ + public function setIgnoreNonAnswerSeekingQuery($var) + { + GPBUtil::checkBool($var); + $this->ignore_non_answer_seeking_query = $var; + + return $this; + } + + /** + * Specifies whether to filter out queries that have low relevance. + * If this field is set to `false`, all search results are used regardless + * of relevance to generate answers. If set to `true` or unset, the behavior + * will be determined automatically by the service. + * + * Generated from protobuf field optional bool ignore_low_relevant_content = 7; + * @return bool + */ + public function getIgnoreLowRelevantContent() + { + return isset($this->ignore_low_relevant_content) ? $this->ignore_low_relevant_content : false; + } + + public function hasIgnoreLowRelevantContent() + { + return isset($this->ignore_low_relevant_content); + } + + public function clearIgnoreLowRelevantContent() + { + unset($this->ignore_low_relevant_content); + } + + /** + * Specifies whether to filter out queries that have low relevance. + * If this field is set to `false`, all search results are used regardless + * of relevance to generate answers. If set to `true` or unset, the behavior + * will be determined automatically by the service. + * + * Generated from protobuf field optional bool ignore_low_relevant_content = 7; + * @param bool $var + * @return $this + */ + public function setIgnoreLowRelevantContent($var) + { + GPBUtil::checkBool($var); + $this->ignore_low_relevant_content = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec/ModelSpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec/ModelSpec.php new file mode 100644 index 000000000000..0bbb1be7a964 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec/ModelSpec.php @@ -0,0 +1,72 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.ModelSpec + */ +class ModelSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Model version. If not set, it will use the default stable model. + * Allowed values are: stable, preview. + * + * Generated from protobuf field string model_version = 1; + */ + protected $model_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model_version + * Model version. If not set, it will use the default stable model. + * Allowed values are: stable, preview. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Model version. If not set, it will use the default stable model. + * Allowed values are: stable, preview. + * + * Generated from protobuf field string model_version = 1; + * @return string + */ + public function getModelVersion() + { + return $this->model_version; + } + + /** + * Model version. If not set, it will use the default stable model. + * Allowed values are: stable, preview. + * + * Generated from protobuf field string model_version = 1; + * @param string $var + * @return $this + */ + public function setModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->model_version = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec/PromptSpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec/PromptSpec.php new file mode 100644 index 000000000000..758aae9a0fad --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec/PromptSpec.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.PromptSpec + */ +class PromptSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Customized preamble. + * + * Generated from protobuf field string preamble = 1; + */ + protected $preamble = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $preamble + * Customized preamble. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Customized preamble. + * + * Generated from protobuf field string preamble = 1; + * @return string + */ + public function getPreamble() + { + return $this->preamble; + } + + /** + * Customized preamble. + * + * Generated from protobuf field string preamble = 1; + * @param string $var + * @return $this + */ + public function setPreamble($var) + { + GPBUtil::checkString($var, True); + $this->preamble = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec.php new file mode 100644 index 000000000000..97fc5ba96639 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec.php @@ -0,0 +1,122 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec + */ +class QueryUnderstandingSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Query classification specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec query_classification_spec = 1; + */ + protected $query_classification_spec = null; + /** + * Query rephraser specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec query_rephraser_spec = 2; + */ + protected $query_rephraser_spec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec\QueryClassificationSpec $query_classification_spec + * Query classification specification. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec\QueryRephraserSpec $query_rephraser_spec + * Query rephraser specification. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Query classification specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec query_classification_spec = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec\QueryClassificationSpec|null + */ + public function getQueryClassificationSpec() + { + return $this->query_classification_spec; + } + + public function hasQueryClassificationSpec() + { + return isset($this->query_classification_spec); + } + + public function clearQueryClassificationSpec() + { + unset($this->query_classification_spec); + } + + /** + * Query classification specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec query_classification_spec = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec\QueryClassificationSpec $var + * @return $this + */ + public function setQueryClassificationSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec\QueryClassificationSpec::class); + $this->query_classification_spec = $var; + + return $this; + } + + /** + * Query rephraser specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec query_rephraser_spec = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec\QueryRephraserSpec|null + */ + public function getQueryRephraserSpec() + { + return $this->query_rephraser_spec; + } + + public function hasQueryRephraserSpec() + { + return isset($this->query_rephraser_spec); + } + + public function clearQueryRephraserSpec() + { + unset($this->query_rephraser_spec); + } + + /** + * Query rephraser specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec query_rephraser_spec = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec\QueryRephraserSpec $var + * @return $this + */ + public function setQueryRephraserSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec\QueryRephraserSpec::class); + $this->query_rephraser_spec = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec.php new file mode 100644 index 000000000000..8874265c1b57 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec + */ +class QueryClassificationSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Enabled query classification types. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec.Type types = 1; + */ + private $types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $types + * Enabled query classification types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Enabled query classification types. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec.Type types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTypes() + { + return $this->types; + } + + /** + * Enabled query classification types. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec.Type types = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec\QueryClassificationSpec\Type::class); + $this->types = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec/Type.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec/Type.php new file mode 100644 index 000000000000..999036f847d0 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec/Type.php @@ -0,0 +1,62 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec.Type + */ +class Type +{ + /** + * Unspecified query classification type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Adversarial query classification type. + * + * Generated from protobuf enum ADVERSARIAL_QUERY = 1; + */ + const ADVERSARIAL_QUERY = 1; + /** + * Non-answer-seeking query classification type. + * + * Generated from protobuf enum NON_ANSWER_SEEKING_QUERY = 2; + */ + const NON_ANSWER_SEEKING_QUERY = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ADVERSARIAL_QUERY => 'ADVERSARIAL_QUERY', + self::NON_ANSWER_SEEKING_QUERY => 'NON_ANSWER_SEEKING_QUERY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryRephraserSpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryRephraserSpec.php new file mode 100644 index 000000000000..8a27216065ec --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryRephraserSpec.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec + */ +class QueryRephraserSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Disable query rephraser. + * + * Generated from protobuf field bool disable = 1; + */ + protected $disable = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $disable + * Disable query rephraser. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Disable query rephraser. + * + * Generated from protobuf field bool disable = 1; + * @return bool + */ + public function getDisable() + { + return $this->disable; + } + + /** + * Disable query rephraser. + * + * Generated from protobuf field bool disable = 1; + * @param bool $var + * @return $this + */ + public function setDisable($var) + { + GPBUtil::checkBool($var); + $this->disable = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/RelatedQuestionsSpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/RelatedQuestionsSpec.php new file mode 100644 index 000000000000..3ea8e46d04d0 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/RelatedQuestionsSpec.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.RelatedQuestionsSpec + */ +class RelatedQuestionsSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Enable related questions feature if true. + * + * Generated from protobuf field bool enable = 1; + */ + protected $enable = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable + * Enable related questions feature if true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Enable related questions feature if true. + * + * Generated from protobuf field bool enable = 1; + * @return bool + */ + public function getEnable() + { + return $this->enable; + } + + /** + * Enable related questions feature if true. + * + * Generated from protobuf field bool enable = 1; + * @param bool $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkBool($var); + $this->enable = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SafetySpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SafetySpec.php new file mode 100644 index 000000000000..1f3e7fdccf3f --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SafetySpec.php @@ -0,0 +1,72 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec + */ +class SafetySpec extends \Google\Protobuf\Internal\Message +{ + /** + * Enable the safety filtering on the answer response. It is false by + * default. + * + * Generated from protobuf field bool enable = 1; + */ + protected $enable = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable + * Enable the safety filtering on the answer response. It is false by + * default. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Enable the safety filtering on the answer response. It is false by + * default. + * + * Generated from protobuf field bool enable = 1; + * @return bool + */ + public function getEnable() + { + return $this->enable; + } + + /** + * Enable the safety filtering on the answer response. It is false by + * default. + * + * Generated from protobuf field bool enable = 1; + * @param bool $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkBool($var); + $this->enable = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec.php new file mode 100644 index 000000000000..d10a87a1e87e --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec.php @@ -0,0 +1,109 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec + */ +class SearchSpec extends \Google\Protobuf\Internal\Message +{ + protected $input; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchParams $search_params + * Search parameters. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList $search_result_list + * Search result list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Search parameters. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchParams search_params = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchParams|null + */ + public function getSearchParams() + { + return $this->readOneof(1); + } + + public function hasSearchParams() + { + return $this->hasOneof(1); + } + + /** + * Search parameters. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchParams search_params = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchParams $var + * @return $this + */ + public function setSearchParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchParams::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Search result list. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList search_result_list = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList|null + */ + public function getSearchResultList() + { + return $this->readOneof(2); + } + + public function hasSearchResultList() + { + return $this->hasOneof(2); + } + + /** + * Search result list. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList search_result_list = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList $var + * @return $this + */ + public function setSearchResultList($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getInput() + { + return $this->whichOneof("input"); + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchParams.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchParams.php new file mode 100644 index 000000000000..63c432286a67 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchParams.php @@ -0,0 +1,310 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchParams + */ +class SearchParams extends \Google\Protobuf\Internal\Message +{ + /** + * Number of search results to return. + * The default value is 10. + * + * Generated from protobuf field int32 max_return_results = 1; + */ + protected $max_return_results = 0; + /** + * The filter syntax consists of an expression language for constructing + * a predicate from one or more fields of the documents being filtered. + * Filter expression is case-sensitive. This will be used to filter + * search results which may affect the Answer response. + * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * Filtering in Vertex AI Search is done by mapping the LHS filter key + * to a key property defined in the Vertex AI Search backend -- this + * mapping is defined by the customer in their schema. For example a + * media customers might have a field 'name' in their schema. In this + * case the filter would look like this: filter --> name:'ANY("king + * kong")' + * For more information about filtering including syntax and filter + * operators, see + * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * Boost specification to boost certain documents in search results which + * may affect the answer query response. For more information on boosting, + * see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 3; + */ + protected $boost_spec = null; + /** + * The order in which documents are returned. Documents can be ordered + * by a field in an [Document][google.cloud.discoveryengine.v1.Document] + * object. Leave it unset if ordered by relevance. `order_by` expression + * is case-sensitive. For more information on ordering, see + * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) + * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * + * Generated from protobuf field string order_by = 4; + */ + protected $order_by = ''; + /** + * Specs defining dataStores to filter on in a search call and + * configurations for those dataStores. This is only considered for + * engines with multiple dataStores use case. For single dataStore within + * an engine, they should use the specs at the top level. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec data_store_specs = 7; + */ + private $data_store_specs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_return_results + * Number of search results to return. + * The default value is 10. + * @type string $filter + * The filter syntax consists of an expression language for constructing + * a predicate from one or more fields of the documents being filtered. + * Filter expression is case-sensitive. This will be used to filter + * search results which may affect the Answer response. + * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * Filtering in Vertex AI Search is done by mapping the LHS filter key + * to a key property defined in the Vertex AI Search backend -- this + * mapping is defined by the customer in their schema. For example a + * media customers might have a field 'name' in their schema. In this + * case the filter would look like this: filter --> name:'ANY("king + * kong")' + * For more information about filtering including syntax and filter + * operators, see + * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + * @type \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec $boost_spec + * Boost specification to boost certain documents in search results which + * may affect the answer query response. For more information on boosting, + * see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * @type string $order_by + * The order in which documents are returned. Documents can be ordered + * by a field in an [Document][google.cloud.discoveryengine.v1.Document] + * object. Leave it unset if ordered by relevance. `order_by` expression + * is case-sensitive. For more information on ordering, see + * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) + * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * @type array<\Google\Cloud\DiscoveryEngine\V1\SearchRequest\DataStoreSpec>|\Google\Protobuf\Internal\RepeatedField $data_store_specs + * Specs defining dataStores to filter on in a search call and + * configurations for those dataStores. This is only considered for + * engines with multiple dataStores use case. For single dataStore within + * an engine, they should use the specs at the top level. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Number of search results to return. + * The default value is 10. + * + * Generated from protobuf field int32 max_return_results = 1; + * @return int + */ + public function getMaxReturnResults() + { + return $this->max_return_results; + } + + /** + * Number of search results to return. + * The default value is 10. + * + * Generated from protobuf field int32 max_return_results = 1; + * @param int $var + * @return $this + */ + public function setMaxReturnResults($var) + { + GPBUtil::checkInt32($var); + $this->max_return_results = $var; + + return $this; + } + + /** + * The filter syntax consists of an expression language for constructing + * a predicate from one or more fields of the documents being filtered. + * Filter expression is case-sensitive. This will be used to filter + * search results which may affect the Answer response. + * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * Filtering in Vertex AI Search is done by mapping the LHS filter key + * to a key property defined in the Vertex AI Search backend -- this + * mapping is defined by the customer in their schema. For example a + * media customers might have a field 'name' in their schema. In this + * case the filter would look like this: filter --> name:'ANY("king + * kong")' + * For more information about filtering including syntax and filter + * operators, see + * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter syntax consists of an expression language for constructing + * a predicate from one or more fields of the documents being filtered. + * Filter expression is case-sensitive. This will be used to filter + * search results which may affect the Answer response. + * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * Filtering in Vertex AI Search is done by mapping the LHS filter key + * to a key property defined in the Vertex AI Search backend -- this + * mapping is defined by the customer in their schema. For example a + * media customers might have a field 'name' in their schema. In this + * case the filter would look like this: filter --> name:'ANY("king + * kong")' + * For more information about filtering including syntax and filter + * operators, see + * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Boost specification to boost certain documents in search results which + * may affect the answer query response. For more information on boosting, + * see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 3; + * @return \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec|null + */ + public function getBoostSpec() + { + return $this->boost_spec; + } + + public function hasBoostSpec() + { + return isset($this->boost_spec); + } + + public function clearBoostSpec() + { + unset($this->boost_spec); + } + + /** + * Boost specification to boost certain documents in search results which + * may affect the answer query response. For more information on boosting, + * see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 3; + * @param \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec $var + * @return $this + */ + public function setBoostSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec::class); + $this->boost_spec = $var; + + return $this; + } + + /** + * The order in which documents are returned. Documents can be ordered + * by a field in an [Document][google.cloud.discoveryengine.v1.Document] + * object. Leave it unset if ordered by relevance. `order_by` expression + * is case-sensitive. For more information on ordering, see + * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) + * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * + * Generated from protobuf field string order_by = 4; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * The order in which documents are returned. Documents can be ordered + * by a field in an [Document][google.cloud.discoveryengine.v1.Document] + * object. Leave it unset if ordered by relevance. `order_by` expression + * is case-sensitive. For more information on ordering, see + * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) + * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * + * Generated from protobuf field string order_by = 4; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Specs defining dataStores to filter on in a search call and + * configurations for those dataStores. This is only considered for + * engines with multiple dataStores use case. For single dataStore within + * an engine, they should use the specs at the top level. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec data_store_specs = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataStoreSpecs() + { + return $this->data_store_specs; + } + + /** + * Specs defining dataStores to filter on in a search call and + * configurations for those dataStores. This is only considered for + * engines with multiple dataStores use case. For single dataStore within + * an engine, they should use the specs at the top level. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec data_store_specs = 7; + * @param array<\Google\Cloud\DiscoveryEngine\V1\SearchRequest\DataStoreSpec>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataStoreSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\SearchRequest\DataStoreSpec::class); + $this->data_store_specs = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList.php new file mode 100644 index 000000000000..fbae8a1f757a --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList + */ +class SearchResultList extends \Google\Protobuf\Internal\Message +{ + /** + * Search results. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult search_results = 1; + */ + private $search_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult>|\Google\Protobuf\Internal\RepeatedField $search_results + * Search results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Search results. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult search_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSearchResults() + { + return $this->search_results; + } + + /** + * Search results. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult search_results = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSearchResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult::class); + $this->search_results = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult.php new file mode 100644 index 000000000000..bc72f2679af0 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult.php @@ -0,0 +1,109 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult + */ +class SearchResult extends \Google\Protobuf\Internal\Message +{ + protected $content; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo $unstructured_document_info + * Unstructured document information. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\ChunkInfo $chunk_info + * Chunk information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Unstructured document information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo unstructured_document_info = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo|null + */ + public function getUnstructuredDocumentInfo() + { + return $this->readOneof(1); + } + + public function hasUnstructuredDocumentInfo() + { + return $this->hasOneof(1); + } + + /** + * Unstructured document information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo unstructured_document_info = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo $var + * @return $this + */ + public function setUnstructuredDocumentInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Chunk information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo chunk_info = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\ChunkInfo|null + */ + public function getChunkInfo() + { + return $this->readOneof(2); + } + + public function hasChunkInfo() + { + return $this->hasOneof(2); + } + + /** + * Chunk information. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo chunk_info = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\ChunkInfo $var + * @return $this + */ + public function setChunkInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\ChunkInfo::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->whichOneof("content"); + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo.php new file mode 100644 index 000000000000..b35fda5b1b26 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo.php @@ -0,0 +1,102 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo + */ +class ChunkInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Chunk resource name. + * + * Generated from protobuf field string chunk = 1 [(.google.api.resource_reference) = { + */ + protected $chunk = ''; + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 2; + */ + protected $content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $chunk + * Chunk resource name. + * @type string $content + * Chunk textual content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Chunk resource name. + * + * Generated from protobuf field string chunk = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getChunk() + { + return $this->chunk; + } + + /** + * Chunk resource name. + * + * Generated from protobuf field string chunk = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setChunk($var) + { + GPBUtil::checkString($var, True); + $this->chunk = $var; + + return $this; + } + + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 2; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Chunk textual content. + * + * Generated from protobuf field string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo.php new file mode 100644 index 000000000000..532d17bbfe72 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo.php @@ -0,0 +1,238 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo + */ +class UnstructuredDocumentInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Document resource name. + * + * Generated from protobuf field string document = 1 [(.google.api.resource_reference) = { + */ + protected $document = ''; + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * Title. + * + * Generated from protobuf field string title = 3; + */ + protected $title = ''; + /** + * List of document contexts. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext document_contexts = 4; + */ + private $document_contexts; + /** + * List of extractive segments. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveSegment extractive_segments = 5; + */ + private $extractive_segments; + /** + * List of extractive answers. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer extractive_answers = 6; + */ + private $extractive_answers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $document + * Document resource name. + * @type string $uri + * URI for the document. + * @type string $title + * Title. + * @type array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\DocumentContext>|\Google\Protobuf\Internal\RepeatedField $document_contexts + * List of document contexts. + * @type array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveSegment>|\Google\Protobuf\Internal\RepeatedField $extractive_segments + * List of extractive segments. + * @type array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveAnswer>|\Google\Protobuf\Internal\RepeatedField $extractive_answers + * List of extractive answers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Document resource name. + * + * Generated from protobuf field string document = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getDocument() + { + return $this->document; + } + + /** + * Document resource name. + * + * Generated from protobuf field string document = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkString($var, True); + $this->document = $var; + + return $this; + } + + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * URI for the document. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Title. + * + * Generated from protobuf field string title = 3; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Title. + * + * Generated from protobuf field string title = 3; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * List of document contexts. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext document_contexts = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDocumentContexts() + { + return $this->document_contexts; + } + + /** + * List of document contexts. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext document_contexts = 4; + * @param array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\DocumentContext>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDocumentContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\DocumentContext::class); + $this->document_contexts = $arr; + + return $this; + } + + /** + * List of extractive segments. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveSegment extractive_segments = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtractiveSegments() + { + return $this->extractive_segments; + } + + /** + * List of extractive segments. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveSegment extractive_segments = 5; + * @param array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtractiveSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveSegment::class); + $this->extractive_segments = $arr; + + return $this; + } + + /** + * List of extractive answers. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer extractive_answers = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtractiveAnswers() + { + return $this->extractive_answers; + } + + /** + * List of extractive answers. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer extractive_answers = 6; + * @param array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtractiveAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveAnswer::class); + $this->extractive_answers = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/DocumentContext.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/DocumentContext.php new file mode 100644 index 000000000000..6c15269c9a25 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/DocumentContext.php @@ -0,0 +1,102 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext + */ +class DocumentContext extends \Google\Protobuf\Internal\Message +{ + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 1; + */ + protected $page_identifier = ''; + /** + * Document content. + * + * Generated from protobuf field string content = 2; + */ + protected $content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $page_identifier + * Page identifier. + * @type string $content + * Document content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 1; + * @return string + */ + public function getPageIdentifier() + { + return $this->page_identifier; + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 1; + * @param string $var + * @return $this + */ + public function setPageIdentifier($var) + { + GPBUtil::checkString($var, True); + $this->page_identifier = $var; + + return $this; + } + + /** + * Document content. + * + * Generated from protobuf field string content = 2; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Document content. + * + * Generated from protobuf field string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveAnswer.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveAnswer.php new file mode 100644 index 000000000000..065171d95ee5 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveAnswer.php @@ -0,0 +1,103 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer + */ +class ExtractiveAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 1; + */ + protected $page_identifier = ''; + /** + * Extractive answer content. + * + * Generated from protobuf field string content = 2; + */ + protected $content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $page_identifier + * Page identifier. + * @type string $content + * Extractive answer content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 1; + * @return string + */ + public function getPageIdentifier() + { + return $this->page_identifier; + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 1; + * @param string $var + * @return $this + */ + public function setPageIdentifier($var) + { + GPBUtil::checkString($var, True); + $this->page_identifier = $var; + + return $this; + } + + /** + * Extractive answer content. + * + * Generated from protobuf field string content = 2; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Extractive answer content. + * + * Generated from protobuf field string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveSegment.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveSegment.php new file mode 100644 index 000000000000..4857b57330d6 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveSegment.php @@ -0,0 +1,103 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveSegment + */ +class ExtractiveSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 1; + */ + protected $page_identifier = ''; + /** + * Extractive segment content. + * + * Generated from protobuf field string content = 2; + */ + protected $content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $page_identifier + * Page identifier. + * @type string $content + * Extractive segment content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 1; + * @return string + */ + public function getPageIdentifier() + { + return $this->page_identifier; + } + + /** + * Page identifier. + * + * Generated from protobuf field string page_identifier = 1; + * @param string $var + * @return $this + */ + public function setPageIdentifier($var) + { + GPBUtil::checkString($var, True); + $this->page_identifier = $var; + + return $this; + } + + /** + * Extractive segment content. + * + * Generated from protobuf field string content = 2; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Extractive segment content. + * + * Generated from protobuf field string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryResponse.php b/DiscoveryEngine/src/V1/AnswerQueryResponse.php new file mode 100644 index 000000000000..c27780c98d7c --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryResponse.php @@ -0,0 +1,189 @@ +google.cloud.discoveryengine.v1.AnswerQueryResponse + */ +class AnswerQueryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Answer resource object. + * If [AnswerQueryRequest.StepSpec.max_step_count][] is greater than 1, + * use [Answer.name][google.cloud.discoveryengine.v1.Answer.name] to fetch + * answer information using + * [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer] + * API. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer answer = 1; + */ + protected $answer = null; + /** + * Session resource object. + * It will be only available when session field is set and valid in the + * [AnswerQueryRequest][google.cloud.discoveryengine.v1.AnswerQueryRequest] + * request. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session session = 2; + */ + protected $session = null; + /** + * A global unique ID used for logging. + * + * Generated from protobuf field string answer_query_token = 3; + */ + protected $answer_query_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\Answer $answer + * Answer resource object. + * If [AnswerQueryRequest.StepSpec.max_step_count][] is greater than 1, + * use [Answer.name][google.cloud.discoveryengine.v1.Answer.name] to fetch + * answer information using + * [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer] + * API. + * @type \Google\Cloud\DiscoveryEngine\V1\Session $session + * Session resource object. + * It will be only available when session field is set and valid in the + * [AnswerQueryRequest][google.cloud.discoveryengine.v1.AnswerQueryRequest] + * request. + * @type string $answer_query_token + * A global unique ID used for logging. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Answer resource object. + * If [AnswerQueryRequest.StepSpec.max_step_count][] is greater than 1, + * use [Answer.name][google.cloud.discoveryengine.v1.Answer.name] to fetch + * answer information using + * [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer] + * API. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer answer = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\Answer|null + */ + public function getAnswer() + { + return $this->answer; + } + + public function hasAnswer() + { + return isset($this->answer); + } + + public function clearAnswer() + { + unset($this->answer); + } + + /** + * Answer resource object. + * If [AnswerQueryRequest.StepSpec.max_step_count][] is greater than 1, + * use [Answer.name][google.cloud.discoveryengine.v1.Answer.name] to fetch + * answer information using + * [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer] + * API. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Answer answer = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\Answer $var + * @return $this + */ + public function setAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Answer::class); + $this->answer = $var; + + return $this; + } + + /** + * Session resource object. + * It will be only available when session field is set and valid in the + * [AnswerQueryRequest][google.cloud.discoveryengine.v1.AnswerQueryRequest] + * request. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session session = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\Session|null + */ + public function getSession() + { + return $this->session; + } + + public function hasSession() + { + return isset($this->session); + } + + public function clearSession() + { + unset($this->session); + } + + /** + * Session resource object. + * It will be only available when session field is set and valid in the + * [AnswerQueryRequest][google.cloud.discoveryengine.v1.AnswerQueryRequest] + * request. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session session = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\Session $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Session::class); + $this->session = $var; + + return $this; + } + + /** + * A global unique ID used for logging. + * + * Generated from protobuf field string answer_query_token = 3; + * @return string + */ + public function getAnswerQueryToken() + { + return $this->answer_query_token; + } + + /** + * A global unique ID used for logging. + * + * Generated from protobuf field string answer_query_token = 3; + * @param string $var + * @return $this + */ + public function setAnswerQueryToken($var) + { + GPBUtil::checkString($var, True); + $this->answer_query_token = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/CheckGroundingRequest.php b/DiscoveryEngine/src/V1/CheckGroundingRequest.php new file mode 100644 index 000000000000..70f17bf4b7a6 --- /dev/null +++ b/DiscoveryEngine/src/V1/CheckGroundingRequest.php @@ -0,0 +1,279 @@ +google.cloud.discoveryengine.v1.CheckGroundingRequest + */ +class CheckGroundingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the grounding config, such as + * `projects/*/locations/global/groundingConfigs/default_grounding_config`. + * + * Generated from protobuf field string grounding_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $grounding_config = ''; + /** + * Answer candidate to check. Can have a maximum length of 1024 characters. + * + * Generated from protobuf field string answer_candidate = 2; + */ + protected $answer_candidate = ''; + /** + * List of facts for the grounding check. + * We support up to 200 facts. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundingFact facts = 3; + */ + private $facts; + /** + * Configuration of the grounding check. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.CheckGroundingSpec grounding_spec = 4; + */ + protected $grounding_spec = null; + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 5; + */ + private $user_labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $grounding_config + * Required. The resource name of the grounding config, such as + * `projects/*/locations/global/groundingConfigs/default_grounding_config`. + * @type string $answer_candidate + * Answer candidate to check. Can have a maximum length of 1024 characters. + * @type array<\Google\Cloud\DiscoveryEngine\V1\GroundingFact>|\Google\Protobuf\Internal\RepeatedField $facts + * List of facts for the grounding check. + * We support up to 200 facts. + * @type \Google\Cloud\DiscoveryEngine\V1\CheckGroundingSpec $grounding_spec + * Configuration of the grounding check. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the grounding config, such as + * `projects/*/locations/global/groundingConfigs/default_grounding_config`. + * + * Generated from protobuf field string grounding_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getGroundingConfig() + { + return $this->grounding_config; + } + + /** + * Required. The resource name of the grounding config, such as + * `projects/*/locations/global/groundingConfigs/default_grounding_config`. + * + * Generated from protobuf field string grounding_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setGroundingConfig($var) + { + GPBUtil::checkString($var, True); + $this->grounding_config = $var; + + return $this; + } + + /** + * Answer candidate to check. Can have a maximum length of 1024 characters. + * + * Generated from protobuf field string answer_candidate = 2; + * @return string + */ + public function getAnswerCandidate() + { + return $this->answer_candidate; + } + + /** + * Answer candidate to check. Can have a maximum length of 1024 characters. + * + * Generated from protobuf field string answer_candidate = 2; + * @param string $var + * @return $this + */ + public function setAnswerCandidate($var) + { + GPBUtil::checkString($var, True); + $this->answer_candidate = $var; + + return $this; + } + + /** + * List of facts for the grounding check. + * We support up to 200 facts. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundingFact facts = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacts() + { + return $this->facts; + } + + /** + * List of facts for the grounding check. + * We support up to 200 facts. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundingFact facts = 3; + * @param array<\Google\Cloud\DiscoveryEngine\V1\GroundingFact>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GroundingFact::class); + $this->facts = $arr; + + return $this; + } + + /** + * Configuration of the grounding check. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.CheckGroundingSpec grounding_spec = 4; + * @return \Google\Cloud\DiscoveryEngine\V1\CheckGroundingSpec|null + */ + public function getGroundingSpec() + { + return $this->grounding_spec; + } + + public function hasGroundingSpec() + { + return isset($this->grounding_spec); + } + + public function clearGroundingSpec() + { + unset($this->grounding_spec); + } + + /** + * Configuration of the grounding check. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.CheckGroundingSpec grounding_spec = 4; + * @param \Google\Cloud\DiscoveryEngine\V1\CheckGroundingSpec $var + * @return $this + */ + public function setGroundingSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\CheckGroundingSpec::class); + $this->grounding_spec = $var; + + return $this; + } + + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/CheckGroundingResponse.php b/DiscoveryEngine/src/V1/CheckGroundingResponse.php new file mode 100644 index 000000000000..96ad7b0e3b7b --- /dev/null +++ b/DiscoveryEngine/src/V1/CheckGroundingResponse.php @@ -0,0 +1,159 @@ +google.cloud.discoveryengine.v1.CheckGroundingResponse + */ +class CheckGroundingResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The support score for the input answer candidate. + * Higher the score, higher is the fraction of claims that are supported by + * the provided facts. This is always set when a response is returned. + * + * Generated from protobuf field optional float support_score = 1; + */ + protected $support_score = null; + /** + * List of facts cited across all claims in the answer candidate. + * These are derived from the facts supplied in the request. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.FactChunk cited_chunks = 3; + */ + private $cited_chunks; + /** + * Claim texts and citation info across all claims in the answer candidate. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim claims = 4; + */ + private $claims; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $support_score + * The support score for the input answer candidate. + * Higher the score, higher is the fraction of claims that are supported by + * the provided facts. This is always set when a response is returned. + * @type array<\Google\Cloud\DiscoveryEngine\V1\FactChunk>|\Google\Protobuf\Internal\RepeatedField $cited_chunks + * List of facts cited across all claims in the answer candidate. + * These are derived from the facts supplied in the request. + * @type array<\Google\Cloud\DiscoveryEngine\V1\CheckGroundingResponse\Claim>|\Google\Protobuf\Internal\RepeatedField $claims + * Claim texts and citation info across all claims in the answer candidate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * The support score for the input answer candidate. + * Higher the score, higher is the fraction of claims that are supported by + * the provided facts. This is always set when a response is returned. + * + * Generated from protobuf field optional float support_score = 1; + * @return float + */ + public function getSupportScore() + { + return isset($this->support_score) ? $this->support_score : 0.0; + } + + public function hasSupportScore() + { + return isset($this->support_score); + } + + public function clearSupportScore() + { + unset($this->support_score); + } + + /** + * The support score for the input answer candidate. + * Higher the score, higher is the fraction of claims that are supported by + * the provided facts. This is always set when a response is returned. + * + * Generated from protobuf field optional float support_score = 1; + * @param float $var + * @return $this + */ + public function setSupportScore($var) + { + GPBUtil::checkFloat($var); + $this->support_score = $var; + + return $this; + } + + /** + * List of facts cited across all claims in the answer candidate. + * These are derived from the facts supplied in the request. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.FactChunk cited_chunks = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCitedChunks() + { + return $this->cited_chunks; + } + + /** + * List of facts cited across all claims in the answer candidate. + * These are derived from the facts supplied in the request. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.FactChunk cited_chunks = 3; + * @param array<\Google\Cloud\DiscoveryEngine\V1\FactChunk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCitedChunks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\FactChunk::class); + $this->cited_chunks = $arr; + + return $this; + } + + /** + * Claim texts and citation info across all claims in the answer candidate. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim claims = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClaims() + { + return $this->claims; + } + + /** + * Claim texts and citation info across all claims in the answer candidate. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim claims = 4; + * @param array<\Google\Cloud\DiscoveryEngine\V1\CheckGroundingResponse\Claim>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClaims($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\CheckGroundingResponse\Claim::class); + $this->claims = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/CheckGroundingResponse/Claim.php b/DiscoveryEngine/src/V1/CheckGroundingResponse/Claim.php new file mode 100644 index 000000000000..fb621ee4eb30 --- /dev/null +++ b/DiscoveryEngine/src/V1/CheckGroundingResponse/Claim.php @@ -0,0 +1,290 @@ +google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim + */ +class Claim extends \Google\Protobuf\Internal\Message +{ + /** + * Position indicating the start of the claim in the answer candidate, + * measured in bytes. + * + * Generated from protobuf field optional int32 start_pos = 1; + */ + protected $start_pos = null; + /** + * Position indicating the end of the claim in the answer candidate, + * exclusive. + * + * Generated from protobuf field optional int32 end_pos = 2; + */ + protected $end_pos = null; + /** + * Text for the claim in the answer candidate. Always provided regardless of + * whether citations or anti-citations are found. + * + * Generated from protobuf field string claim_text = 3; + */ + protected $claim_text = ''; + /** + * A list of indices (into 'cited_chunks') specifying the citations + * associated with the claim. For instance [1,3,4] means that + * cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited + * supporting for the claim. A citation to a fact indicates that the claim + * is supported by the fact. + * + * Generated from protobuf field repeated int32 citation_indices = 4; + */ + private $citation_indices; + /** + * Indicates that this claim required grounding check. When the system + * decided this claim doesn't require attribution/grounding check, this + * field will be set to false. In that case, no grounding check was done for + * the claim and therefore + * [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices], + * and + * [anti_citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.anti_citation_indices] + * should not be returned. + * + * Generated from protobuf field optional bool grounding_check_required = 6; + */ + protected $grounding_check_required = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start_pos + * Position indicating the start of the claim in the answer candidate, + * measured in bytes. + * @type int $end_pos + * Position indicating the end of the claim in the answer candidate, + * exclusive. + * @type string $claim_text + * Text for the claim in the answer candidate. Always provided regardless of + * whether citations or anti-citations are found. + * @type array|\Google\Protobuf\Internal\RepeatedField $citation_indices + * A list of indices (into 'cited_chunks') specifying the citations + * associated with the claim. For instance [1,3,4] means that + * cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited + * supporting for the claim. A citation to a fact indicates that the claim + * is supported by the fact. + * @type bool $grounding_check_required + * Indicates that this claim required grounding check. When the system + * decided this claim doesn't require attribution/grounding check, this + * field will be set to false. In that case, no grounding check was done for + * the claim and therefore + * [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices], + * and + * [anti_citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.anti_citation_indices] + * should not be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Position indicating the start of the claim in the answer candidate, + * measured in bytes. + * + * Generated from protobuf field optional int32 start_pos = 1; + * @return int + */ + public function getStartPos() + { + return isset($this->start_pos) ? $this->start_pos : 0; + } + + public function hasStartPos() + { + return isset($this->start_pos); + } + + public function clearStartPos() + { + unset($this->start_pos); + } + + /** + * Position indicating the start of the claim in the answer candidate, + * measured in bytes. + * + * Generated from protobuf field optional int32 start_pos = 1; + * @param int $var + * @return $this + */ + public function setStartPos($var) + { + GPBUtil::checkInt32($var); + $this->start_pos = $var; + + return $this; + } + + /** + * Position indicating the end of the claim in the answer candidate, + * exclusive. + * + * Generated from protobuf field optional int32 end_pos = 2; + * @return int + */ + public function getEndPos() + { + return isset($this->end_pos) ? $this->end_pos : 0; + } + + public function hasEndPos() + { + return isset($this->end_pos); + } + + public function clearEndPos() + { + unset($this->end_pos); + } + + /** + * Position indicating the end of the claim in the answer candidate, + * exclusive. + * + * Generated from protobuf field optional int32 end_pos = 2; + * @param int $var + * @return $this + */ + public function setEndPos($var) + { + GPBUtil::checkInt32($var); + $this->end_pos = $var; + + return $this; + } + + /** + * Text for the claim in the answer candidate. Always provided regardless of + * whether citations or anti-citations are found. + * + * Generated from protobuf field string claim_text = 3; + * @return string + */ + public function getClaimText() + { + return $this->claim_text; + } + + /** + * Text for the claim in the answer candidate. Always provided regardless of + * whether citations or anti-citations are found. + * + * Generated from protobuf field string claim_text = 3; + * @param string $var + * @return $this + */ + public function setClaimText($var) + { + GPBUtil::checkString($var, True); + $this->claim_text = $var; + + return $this; + } + + /** + * A list of indices (into 'cited_chunks') specifying the citations + * associated with the claim. For instance [1,3,4] means that + * cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited + * supporting for the claim. A citation to a fact indicates that the claim + * is supported by the fact. + * + * Generated from protobuf field repeated int32 citation_indices = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCitationIndices() + { + return $this->citation_indices; + } + + /** + * A list of indices (into 'cited_chunks') specifying the citations + * associated with the claim. For instance [1,3,4] means that + * cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited + * supporting for the claim. A citation to a fact indicates that the claim + * is supported by the fact. + * + * Generated from protobuf field repeated int32 citation_indices = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCitationIndices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->citation_indices = $arr; + + return $this; + } + + /** + * Indicates that this claim required grounding check. When the system + * decided this claim doesn't require attribution/grounding check, this + * field will be set to false. In that case, no grounding check was done for + * the claim and therefore + * [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices], + * and + * [anti_citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.anti_citation_indices] + * should not be returned. + * + * Generated from protobuf field optional bool grounding_check_required = 6; + * @return bool + */ + public function getGroundingCheckRequired() + { + return isset($this->grounding_check_required) ? $this->grounding_check_required : false; + } + + public function hasGroundingCheckRequired() + { + return isset($this->grounding_check_required); + } + + public function clearGroundingCheckRequired() + { + unset($this->grounding_check_required); + } + + /** + * Indicates that this claim required grounding check. When the system + * decided this claim doesn't require attribution/grounding check, this + * field will be set to false. In that case, no grounding check was done for + * the claim and therefore + * [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices], + * and + * [anti_citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.anti_citation_indices] + * should not be returned. + * + * Generated from protobuf field optional bool grounding_check_required = 6; + * @param bool $var + * @return $this + */ + public function setGroundingCheckRequired($var) + { + GPBUtil::checkBool($var); + $this->grounding_check_required = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/CheckGroundingSpec.php b/DiscoveryEngine/src/V1/CheckGroundingSpec.php new file mode 100644 index 000000000000..87d16aeca1df --- /dev/null +++ b/DiscoveryEngine/src/V1/CheckGroundingSpec.php @@ -0,0 +1,93 @@ +google.cloud.discoveryengine.v1.CheckGroundingSpec + */ +class CheckGroundingSpec extends \Google\Protobuf\Internal\Message +{ + /** + * The threshold (in [0,1]) used for determining whether a fact must be + * cited for a claim in the answer candidate. Choosing a higher threshold + * will lead to fewer but very strong citations, while choosing a lower + * threshold may lead to more but somewhat weaker citations. If unset, the + * threshold will default to 0.6. + * + * Generated from protobuf field optional double citation_threshold = 1; + */ + protected $citation_threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $citation_threshold + * The threshold (in [0,1]) used for determining whether a fact must be + * cited for a claim in the answer candidate. Choosing a higher threshold + * will lead to fewer but very strong citations, while choosing a lower + * threshold may lead to more but somewhat weaker citations. If unset, the + * threshold will default to 0.6. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * The threshold (in [0,1]) used for determining whether a fact must be + * cited for a claim in the answer candidate. Choosing a higher threshold + * will lead to fewer but very strong citations, while choosing a lower + * threshold may lead to more but somewhat weaker citations. If unset, the + * threshold will default to 0.6. + * + * Generated from protobuf field optional double citation_threshold = 1; + * @return float + */ + public function getCitationThreshold() + { + return isset($this->citation_threshold) ? $this->citation_threshold : 0.0; + } + + public function hasCitationThreshold() + { + return isset($this->citation_threshold); + } + + public function clearCitationThreshold() + { + unset($this->citation_threshold); + } + + /** + * The threshold (in [0,1]) used for determining whether a fact must be + * cited for a claim in the answer candidate. Choosing a higher threshold + * will lead to fewer but very strong citations, while choosing a lower + * threshold may lead to more but somewhat weaker citations. If unset, the + * threshold will default to 0.6. + * + * Generated from protobuf field optional double citation_threshold = 1; + * @param float $var + * @return $this + */ + public function setCitationThreshold($var) + { + GPBUtil::checkDouble($var); + $this->citation_threshold = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/Client/CompletionServiceClient.php b/DiscoveryEngine/src/V1/Client/CompletionServiceClient.php index 575d4c8d8424..8f1d678a1b75 100644 --- a/DiscoveryEngine/src/V1/Client/CompletionServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/CompletionServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\ResourceHelperTrait; use Google\ApiCore\RetrySettings; @@ -38,6 +37,7 @@ use Google\Cloud\DiscoveryEngine\V1\CompleteQueryResponse; use Google\Cloud\DiscoveryEngine\V1\ImportSuggestionDenyListEntriesRequest; use Google\Cloud\DiscoveryEngine\V1\PurgeSuggestionDenyListEntriesRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -135,6 +135,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a data_store * resource. diff --git a/DiscoveryEngine/src/V1/Client/ControlServiceClient.php b/DiscoveryEngine/src/V1/Client/ControlServiceClient.php new file mode 100644 index 000000000000..d523e97742e3 --- /dev/null +++ b/DiscoveryEngine/src/V1/Client/ControlServiceClient.php @@ -0,0 +1,538 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/control_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/control_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/control_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/control_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a control + * resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $control + * + * @return string The formatted control resource. + */ + public static function controlName(string $project, string $location, string $dataStore, string $control): string + { + return self::getPathTemplate('control')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'control' => $control, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_store + * resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted data_store resource. + */ + public static function dataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('dataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a engine + * resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * + * @return string The formatted engine resource. + */ + public static function engineName(string $project, string $location, string $collection, string $engine): string + { + return self::getPathTemplate('engine')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * + * @return string The formatted project_location_collection_data_store resource. + */ + public static function projectLocationCollectionDataStoreName( + string $project, + string $location, + string $collection, + string $dataStore + ): string { + return self::getPathTemplate('projectLocationCollectionDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store_control resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * @param string $control + * + * @return string The formatted project_location_collection_data_store_control resource. + */ + public static function projectLocationCollectionDataStoreControlName( + string $project, + string $location, + string $collection, + string $dataStore, + string $control + ): string { + return self::getPathTemplate('projectLocationCollectionDataStoreControl')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + 'control' => $control, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_engine_control resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * @param string $control + * + * @return string The formatted project_location_collection_engine_control resource. + */ + public static function projectLocationCollectionEngineControlName( + string $project, + string $location, + string $collection, + string $engine, + string $control + ): string { + return self::getPathTemplate('projectLocationCollectionEngineControl')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + 'control' => $control, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted project_location_data_store resource. + */ + public static function projectLocationDataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('projectLocationDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store_control resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $control + * + * @return string The formatted project_location_data_store_control resource. + */ + public static function projectLocationDataStoreControlName( + string $project, + string $location, + string $dataStore, + string $control + ): string { + return self::getPathTemplate('projectLocationDataStoreControl')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'control' => $control, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - control: projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control} + * - dataStore: projects/{project}/locations/{location}/dataStores/{data_store} + * - engine: projects/{project}/locations/{location}/collections/{collection}/engines/{engine} + * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} + * - projectLocationCollectionDataStoreControl: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/controls/{control} + * - projectLocationCollectionEngineControl: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/controls/{control} + * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} + * - projectLocationDataStoreControl: projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'discoveryengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Control. + * + * By default 1000 controls are allowed for a data store. + * A request can be submitted to adjust this limit. + * If the [Control][google.cloud.discoveryengine.v1.Control] to create already + * exists, an ALREADY_EXISTS error is returned. + * + * The async variant is {@see ControlServiceClient::createControlAsync()} . + * + * @example samples/V1/ControlServiceClient/create_control.php + * + * @param CreateControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Control + * + * @throws ApiException Thrown if the API call fails. + */ + public function createControl(CreateControlRequest $request, array $callOptions = []): Control + { + return $this->startApiCall('CreateControl', $request, $callOptions)->wait(); + } + + /** + * Deletes a Control. + * + * If the [Control][google.cloud.discoveryengine.v1.Control] to delete does + * not exist, a NOT_FOUND error is returned. + * + * The async variant is {@see ControlServiceClient::deleteControlAsync()} . + * + * @example samples/V1/ControlServiceClient/delete_control.php + * + * @param DeleteControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteControl(DeleteControlRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteControl', $request, $callOptions)->wait(); + } + + /** + * Gets a Control. + * + * The async variant is {@see ControlServiceClient::getControlAsync()} . + * + * @example samples/V1/ControlServiceClient/get_control.php + * + * @param GetControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Control + * + * @throws ApiException Thrown if the API call fails. + */ + public function getControl(GetControlRequest $request, array $callOptions = []): Control + { + return $this->startApiCall('GetControl', $request, $callOptions)->wait(); + } + + /** + * Lists all Controls by their parent + * [DataStore][google.cloud.discoveryengine.v1.DataStore]. + * + * The async variant is {@see ControlServiceClient::listControlsAsync()} . + * + * @example samples/V1/ControlServiceClient/list_controls.php + * + * @param ListControlsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listControls(ListControlsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListControls', $request, $callOptions); + } + + /** + * Updates a Control. + * + * [Control][google.cloud.discoveryengine.v1.Control] action type cannot be + * changed. If the [Control][google.cloud.discoveryengine.v1.Control] to + * update does not exist, a NOT_FOUND error is returned. + * + * The async variant is {@see ControlServiceClient::updateControlAsync()} . + * + * @example samples/V1/ControlServiceClient/update_control.php + * + * @param UpdateControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Control + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateControl(UpdateControlRequest $request, array $callOptions = []): Control + { + return $this->startApiCall('UpdateControl', $request, $callOptions)->wait(); + } +} diff --git a/DiscoveryEngine/src/V1/Client/ConversationalSearchServiceClient.php b/DiscoveryEngine/src/V1/Client/ConversationalSearchServiceClient.php index 7e31a11b56ec..f46a96a4c66d 100644 --- a/DiscoveryEngine/src/V1/Client/ConversationalSearchServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/ConversationalSearchServiceClient.php @@ -33,14 +33,24 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\DiscoveryEngine\V1\Answer; +use Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest; +use Google\Cloud\DiscoveryEngine\V1\AnswerQueryResponse; use Google\Cloud\DiscoveryEngine\V1\Conversation; use Google\Cloud\DiscoveryEngine\V1\ConverseConversationRequest; use Google\Cloud\DiscoveryEngine\V1\ConverseConversationResponse; use Google\Cloud\DiscoveryEngine\V1\CreateConversationRequest; +use Google\Cloud\DiscoveryEngine\V1\CreateSessionRequest; use Google\Cloud\DiscoveryEngine\V1\DeleteConversationRequest; +use Google\Cloud\DiscoveryEngine\V1\DeleteSessionRequest; +use Google\Cloud\DiscoveryEngine\V1\GetAnswerRequest; use Google\Cloud\DiscoveryEngine\V1\GetConversationRequest; +use Google\Cloud\DiscoveryEngine\V1\GetSessionRequest; use Google\Cloud\DiscoveryEngine\V1\ListConversationsRequest; +use Google\Cloud\DiscoveryEngine\V1\ListSessionsRequest; +use Google\Cloud\DiscoveryEngine\V1\Session; use Google\Cloud\DiscoveryEngine\V1\UpdateConversationRequest; +use Google\Cloud\DiscoveryEngine\V1\UpdateSessionRequest; use GuzzleHttp\Promise\PromiseInterface; /** @@ -54,12 +64,19 @@ * name, and additionally a parseName method to extract the individual identifiers * contained within formatted names that are returned by the API. * + * @method PromiseInterface answerQueryAsync(AnswerQueryRequest $request, array $optionalArgs = []) * @method PromiseInterface converseConversationAsync(ConverseConversationRequest $request, array $optionalArgs = []) * @method PromiseInterface createConversationAsync(CreateConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSessionAsync(CreateSessionRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteConversationAsync(DeleteConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSessionAsync(DeleteSessionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAnswerAsync(GetAnswerRequest $request, array $optionalArgs = []) * @method PromiseInterface getConversationAsync(GetConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSessionAsync(GetSessionRequest $request, array $optionalArgs = []) * @method PromiseInterface listConversationsAsync(ListConversationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSessionsAsync(ListSessionsRequest $request, array $optionalArgs = []) * @method PromiseInterface updateConversationAsync(UpdateConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSessionAsync(UpdateSessionRequest $request, array $optionalArgs = []) */ final class ConversationalSearchServiceClient { @@ -108,6 +125,65 @@ private static function getClientDefaults() ]; } + /** + * Formats a string containing the fully-qualified path to represent a answer + * resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $session + * @param string $answer + * + * @return string The formatted answer resource. + */ + public static function answerName( + string $project, + string $location, + string $dataStore, + string $session, + string $answer + ): string { + return self::getPathTemplate('answer')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'session' => $session, + 'answer' => $answer, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a chunk + * resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $branch + * @param string $document + * @param string $chunk + * + * @return string The formatted chunk resource. + */ + public static function chunkName( + string $project, + string $location, + string $dataStore, + string $branch, + string $document, + string $chunk + ): string { + return self::getPathTemplate('chunk')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'branch' => $branch, + 'document' => $document, + 'chunk' => $chunk, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a conversation * resource. @@ -236,6 +312,40 @@ public static function projectLocationCollectionDataStoreBranchDocumentName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store_branch_document_chunk resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * @param string $branch + * @param string $document + * @param string $chunk + * + * @return string The formatted project_location_collection_data_store_branch_document_chunk resource. + */ + public static function projectLocationCollectionDataStoreBranchDocumentChunkName( + string $project, + string $location, + string $collection, + string $dataStore, + string $branch, + string $document, + string $chunk + ): string { + return self::getPathTemplate('projectLocationCollectionDataStoreBranchDocumentChunk')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + 'branch' => $branch, + 'document' => $document, + 'chunk' => $chunk, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_data_store_conversation resource. @@ -292,6 +402,65 @@ public static function projectLocationCollectionDataStoreServingConfigName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store_session resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * @param string $session + * + * @return string The formatted project_location_collection_data_store_session resource. + */ + public static function projectLocationCollectionDataStoreSessionName( + string $project, + string $location, + string $collection, + string $dataStore, + string $session + ): string { + return self::getPathTemplate('projectLocationCollectionDataStoreSession')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store_session_answer resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * @param string $session + * @param string $answer + * + * @return string The formatted project_location_collection_data_store_session_answer resource. + */ + public static function projectLocationCollectionDataStoreSessionAnswerName( + string $project, + string $location, + string $collection, + string $dataStore, + string $session, + string $answer + ): string { + return self::getPathTemplate('projectLocationCollectionDataStoreSessionAnswer')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + 'session' => $session, + 'answer' => $answer, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_engine_conversation resource. @@ -348,6 +517,65 @@ public static function projectLocationCollectionEngineServingConfigName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_engine_session resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * @param string $session + * + * @return string The formatted project_location_collection_engine_session resource. + */ + public static function projectLocationCollectionEngineSessionName( + string $project, + string $location, + string $collection, + string $engine, + string $session + ): string { + return self::getPathTemplate('projectLocationCollectionEngineSession')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_engine_session_answer resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * @param string $session + * @param string $answer + * + * @return string The formatted project_location_collection_engine_session_answer resource. + */ + public static function projectLocationCollectionEngineSessionAnswerName( + string $project, + string $location, + string $collection, + string $engine, + string $session, + string $answer + ): string { + return self::getPathTemplate('projectLocationCollectionEngineSessionAnswer')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + 'session' => $session, + 'answer' => $answer, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_data_store resource. @@ -395,6 +623,37 @@ public static function projectLocationDataStoreBranchDocumentName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store_branch_document_chunk resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $branch + * @param string $document + * @param string $chunk + * + * @return string The formatted project_location_data_store_branch_document_chunk resource. + */ + public static function projectLocationDataStoreBranchDocumentChunkName( + string $project, + string $location, + string $dataStore, + string $branch, + string $document, + string $chunk + ): string { + return self::getPathTemplate('projectLocationDataStoreBranchDocumentChunk')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'branch' => $branch, + 'document' => $document, + 'chunk' => $chunk, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_data_store_conversation resource. @@ -445,6 +704,59 @@ public static function projectLocationDataStoreServingConfigName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store_session resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $session + * + * @return string The formatted project_location_data_store_session resource. + */ + public static function projectLocationDataStoreSessionName( + string $project, + string $location, + string $dataStore, + string $session + ): string { + return self::getPathTemplate('projectLocationDataStoreSession')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store_session_answer resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $session + * @param string $answer + * + * @return string The formatted project_location_data_store_session_answer resource. + */ + public static function projectLocationDataStoreSessionAnswerName( + string $project, + string $location, + string $dataStore, + string $session, + string $answer + ): string { + return self::getPathTemplate('projectLocationDataStoreSessionAnswer')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'session' => $session, + 'answer' => $answer, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * serving_config resource. @@ -470,24 +782,56 @@ public static function servingConfigName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $location, string $dataStore, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'session' => $session, + ]); + } + /** * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - answer: projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer} + * - chunk: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk} * - conversation: projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation} * - dataStore: projects/{project}/locations/{location}/dataStores/{data_store} * - document: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document} * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} * - projectLocationCollectionDataStoreBranchDocument: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document} + * - projectLocationCollectionDataStoreBranchDocumentChunk: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk} * - projectLocationCollectionDataStoreConversation: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation} * - projectLocationCollectionDataStoreServingConfig: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config} + * - projectLocationCollectionDataStoreSession: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session} + * - projectLocationCollectionDataStoreSessionAnswer: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer} * - projectLocationCollectionEngineConversation: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation} * - projectLocationCollectionEngineServingConfig: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config} + * - projectLocationCollectionEngineSession: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session} + * - projectLocationCollectionEngineSessionAnswer: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer} * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} * - projectLocationDataStoreBranchDocument: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document} + * - projectLocationDataStoreBranchDocumentChunk: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk} * - projectLocationDataStoreConversation: projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation} * - projectLocationDataStoreServingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config} + * - projectLocationDataStoreSession: projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session} + * - projectLocationDataStoreSessionAnswer: projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer} * - servingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config} + * - session: projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session} * * The optional $template argument can be supplied to specify a particular pattern, * and must match one of the templates listed above. If no $template argument is @@ -578,6 +922,33 @@ public function __call($method, $args) return call_user_func_array([$this, 'startAsyncCall'], $args); } + /** + * Answer query method. + * + * The async variant is + * {@see ConversationalSearchServiceClient::answerQueryAsync()} . + * + * @example samples/V1/ConversationalSearchServiceClient/answer_query.php + * + * @param AnswerQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnswerQueryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function answerQuery(AnswerQueryRequest $request, array $callOptions = []): AnswerQueryResponse + { + return $this->startApiCall('AnswerQuery', $request, $callOptions)->wait(); + } + /** * Converses a conversation. * @@ -637,6 +1008,36 @@ public function createConversation(CreateConversationRequest $request, array $ca return $this->startApiCall('CreateConversation', $request, $callOptions)->wait(); } + /** + * Creates a Session. + * + * If the [Session][google.cloud.discoveryengine.v1.Session] to create already + * exists, an ALREADY_EXISTS error is returned. + * + * The async variant is + * {@see ConversationalSearchServiceClient::createSessionAsync()} . + * + * @example samples/V1/ConversationalSearchServiceClient/create_session.php + * + * @param CreateSessionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Session + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSession(CreateSessionRequest $request, array $callOptions = []): Session + { + return $this->startApiCall('CreateSession', $request, $callOptions)->wait(); + } + /** * Deletes a Conversation. * @@ -665,6 +1066,61 @@ public function deleteConversation(DeleteConversationRequest $request, array $ca $this->startApiCall('DeleteConversation', $request, $callOptions)->wait(); } + /** + * Deletes a Session. + * + * If the [Session][google.cloud.discoveryengine.v1.Session] to delete does + * not exist, a NOT_FOUND error is returned. + * + * The async variant is + * {@see ConversationalSearchServiceClient::deleteSessionAsync()} . + * + * @example samples/V1/ConversationalSearchServiceClient/delete_session.php + * + * @param DeleteSessionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSession(DeleteSessionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSession', $request, $callOptions)->wait(); + } + + /** + * Gets a Answer. + * + * The async variant is {@see ConversationalSearchServiceClient::getAnswerAsync()} + * . + * + * @example samples/V1/ConversationalSearchServiceClient/get_answer.php + * + * @param GetAnswerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Answer + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAnswer(GetAnswerRequest $request, array $callOptions = []): Answer + { + return $this->startApiCall('GetAnswer', $request, $callOptions)->wait(); + } + /** * Gets a Conversation. * @@ -692,6 +1148,33 @@ public function getConversation(GetConversationRequest $request, array $callOpti return $this->startApiCall('GetConversation', $request, $callOptions)->wait(); } + /** + * Gets a Session. + * + * The async variant is {@see ConversationalSearchServiceClient::getSessionAsync()} + * . + * + * @example samples/V1/ConversationalSearchServiceClient/get_session.php + * + * @param GetSessionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Session + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSession(GetSessionRequest $request, array $callOptions = []): Session + { + return $this->startApiCall('GetSession', $request, $callOptions)->wait(); + } + /** * Lists all Conversations by their parent * [DataStore][google.cloud.discoveryengine.v1.DataStore]. @@ -720,6 +1203,34 @@ public function listConversations(ListConversationsRequest $request, array $call return $this->startApiCall('ListConversations', $request, $callOptions); } + /** + * Lists all Sessions by their parent + * [DataStore][google.cloud.discoveryengine.v1.DataStore]. + * + * The async variant is + * {@see ConversationalSearchServiceClient::listSessionsAsync()} . + * + * @example samples/V1/ConversationalSearchServiceClient/list_sessions.php + * + * @param ListSessionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSessions(ListSessionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSessions', $request, $callOptions); + } + /** * Updates a Conversation. * @@ -751,4 +1262,35 @@ public function updateConversation(UpdateConversationRequest $request, array $ca { return $this->startApiCall('UpdateConversation', $request, $callOptions)->wait(); } + + /** + * Updates a Session. + * + * [Session][google.cloud.discoveryengine.v1.Session] action type cannot be + * changed. If the [Session][google.cloud.discoveryengine.v1.Session] to + * update does not exist, a NOT_FOUND error is returned. + * + * The async variant is + * {@see ConversationalSearchServiceClient::updateSessionAsync()} . + * + * @example samples/V1/ConversationalSearchServiceClient/update_session.php + * + * @param UpdateSessionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Session + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSession(UpdateSessionRequest $request, array $callOptions = []): Session + { + return $this->startApiCall('UpdateSession', $request, $callOptions)->wait(); + } } diff --git a/DiscoveryEngine/src/V1/Client/DataStoreServiceClient.php b/DiscoveryEngine/src/V1/Client/DataStoreServiceClient.php index 0b53c5d90acf..6009714e4cee 100644 --- a/DiscoveryEngine/src/V1/Client/DataStoreServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/DataStoreServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -41,6 +40,7 @@ use Google\Cloud\DiscoveryEngine\V1\GetDataStoreRequest; use Google\Cloud\DiscoveryEngine\V1\ListDataStoresRequest; use Google\Cloud\DiscoveryEngine\V1\UpdateDataStoreRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -141,6 +141,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a collection * resource. @@ -179,6 +198,25 @@ public static function dataStoreName(string $project, string $location, string $ ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * document_processing_config resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted document_processing_config resource. + */ + public static function documentProcessingConfigName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('documentProcessingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_data_store resource. @@ -204,6 +242,31 @@ public static function projectLocationCollectionDataStoreName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store_documentProcessingConfig resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * + * @return string The formatted project_location_collection_data_store_documentProcessingConfig resource. + */ + public static function projectLocationCollectionDataStoreDocumentProcessingConfigName( + string $project, + string $location, + string $collection, + string $dataStore + ): string { + return self::getPathTemplate('projectLocationCollectionDataStoreDocumentProcessingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_data_store_schema resource. @@ -251,6 +314,28 @@ public static function projectLocationDataStoreName(string $project, string $loc ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store_documentProcessingConfig resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted project_location_data_store_documentProcessingConfig resource. + */ + public static function projectLocationDataStoreDocumentProcessingConfigName( + string $project, + string $location, + string $dataStore + ): string { + return self::getPathTemplate('projectLocationDataStoreDocumentProcessingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_data_store_schema resource. @@ -303,9 +388,12 @@ public static function schemaName(string $project, string $location, string $dat * Template: Pattern * - collection: projects/{project}/locations/{location}/collections/{collection} * - dataStore: projects/{project}/locations/{location}/dataStores/{data_store} + * - documentProcessingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/documentProcessingConfig * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} + * - projectLocationCollectionDataStoreDocumentProcessingConfig: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/documentProcessingConfig * - projectLocationCollectionDataStoreSchema: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema} * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} + * - projectLocationDataStoreDocumentProcessingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/documentProcessingConfig * - projectLocationDataStoreSchema: projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema} * - schema: projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema} * diff --git a/DiscoveryEngine/src/V1/Client/DocumentServiceClient.php b/DiscoveryEngine/src/V1/Client/DocumentServiceClient.php index 258c76aaa53d..2e68356ee697 100644 --- a/DiscoveryEngine/src/V1/Client/DocumentServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/DocumentServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -43,6 +42,7 @@ use Google\Cloud\DiscoveryEngine\V1\ListDocumentsRequest; use Google\Cloud\DiscoveryEngine\V1\PurgeDocumentsRequest; use Google\Cloud\DiscoveryEngine\V1\UpdateDocumentRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -145,6 +145,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a branch * resource. @@ -508,7 +527,7 @@ public function getDocument(GetDocumentRequest $request, array $callOptions = [] /** * Bulk import of multiple * [Document][google.cloud.discoveryengine.v1.Document]s. Request processing - * may be synchronous. Non-existing items will be created. + * may be synchronous. Non-existing items are created. * * Note: It is possible for a subset of the * [Document][google.cloud.discoveryengine.v1.Document]s to be successfully diff --git a/DiscoveryEngine/src/V1/Client/EngineServiceClient.php b/DiscoveryEngine/src/V1/Client/EngineServiceClient.php index 425030aeca11..990f2790f9ea 100644 --- a/DiscoveryEngine/src/V1/Client/EngineServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/EngineServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -41,6 +40,7 @@ use Google\Cloud\DiscoveryEngine\V1\GetEngineRequest; use Google\Cloud\DiscoveryEngine\V1\ListEnginesRequest; use Google\Cloud\DiscoveryEngine\V1\UpdateEngineRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -141,6 +141,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a collection * resource. diff --git a/DiscoveryEngine/src/V1/Client/GroundedGenerationServiceClient.php b/DiscoveryEngine/src/V1/Client/GroundedGenerationServiceClient.php new file mode 100644 index 000000000000..85d09fe3c447 --- /dev/null +++ b/DiscoveryEngine/src/V1/Client/GroundedGenerationServiceClient.php @@ -0,0 +1,239 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/grounded_generation_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/grounded_generation_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/grounded_generation_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/grounded_generation_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * grounding_config resource. + * + * @param string $project + * @param string $location + * @param string $groundingConfig + * + * @return string The formatted grounding_config resource. + */ + public static function groundingConfigName(string $project, string $location, string $groundingConfig): string + { + return self::getPathTemplate('groundingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'grounding_config' => $groundingConfig, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - groundingConfig: projects/{project}/locations/{location}/groundingConfigs/{grounding_config} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'discoveryengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Performs a grounding check. + * + * The async variant is + * {@see GroundedGenerationServiceClient::checkGroundingAsync()} . + * + * @example samples/V1/GroundedGenerationServiceClient/check_grounding.php + * + * @param CheckGroundingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CheckGroundingResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function checkGrounding(CheckGroundingRequest $request, array $callOptions = []): CheckGroundingResponse + { + return $this->startApiCall('CheckGrounding', $request, $callOptions)->wait(); + } +} diff --git a/DiscoveryEngine/src/V1/Client/ProjectServiceClient.php b/DiscoveryEngine/src/V1/Client/ProjectServiceClient.php new file mode 100644 index 000000000000..823048011f72 --- /dev/null +++ b/DiscoveryEngine/src/V1/Client/ProjectServiceClient.php @@ -0,0 +1,295 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/project_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/project_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/project_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/project_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - project: projects/{project} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'discoveryengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Provisions the project resource. During the + * process, related systems will get prepared and initialized. + * + * Caller must read the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms), and optionally + * specify in request to provide consent to that service terms. + * + * The async variant is {@see ProjectServiceClient::provisionProjectAsync()} . + * + * @example samples/V1/ProjectServiceClient/provision_project.php + * + * @param ProvisionProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function provisionProject(ProvisionProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ProvisionProject', $request, $callOptions)->wait(); + } +} diff --git a/DiscoveryEngine/src/V1/Client/RankServiceClient.php b/DiscoveryEngine/src/V1/Client/RankServiceClient.php new file mode 100644 index 000000000000..c6e880be9f01 --- /dev/null +++ b/DiscoveryEngine/src/V1/Client/RankServiceClient.php @@ -0,0 +1,237 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/rank_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/rank_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/rank_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/rank_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * ranking_config resource. + * + * @param string $project + * @param string $location + * @param string $rankingConfig + * + * @return string The formatted ranking_config resource. + */ + public static function rankingConfigName(string $project, string $location, string $rankingConfig): string + { + return self::getPathTemplate('rankingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'ranking_config' => $rankingConfig, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - rankingConfig: projects/{project}/locations/{location}/rankingConfigs/{ranking_config} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'discoveryengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Ranks a list of text records based on the given input query. + * + * The async variant is {@see RankServiceClient::rankAsync()} . + * + * @example samples/V1/RankServiceClient/rank.php + * + * @param RankRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RankResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function rank(RankRequest $request, array $callOptions = []): RankResponse + { + return $this->startApiCall('Rank', $request, $callOptions)->wait(); + } +} diff --git a/DiscoveryEngine/src/V1/Client/RecommendationServiceClient.php b/DiscoveryEngine/src/V1/Client/RecommendationServiceClient.php index 08cff979e4c7..463a8cf4b7ca 100644 --- a/DiscoveryEngine/src/V1/Client/RecommendationServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/RecommendationServiceClient.php @@ -95,6 +95,25 @@ private static function getClientDefaults() ]; } + /** + * Formats a string containing the fully-qualified path to represent a data_store + * resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted data_store resource. + */ + public static function dataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('dataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a document * resource. @@ -123,6 +142,52 @@ public static function documentName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a engine + * resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * + * @return string The formatted engine resource. + */ + public static function engineName(string $project, string $location, string $collection, string $engine): string + { + return self::getPathTemplate('engine')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * + * @return string The formatted project_location_collection_data_store resource. + */ + public static function projectLocationCollectionDataStoreName( + string $project, + string $location, + string $collection, + string $dataStore + ): string { + return self::getPathTemplate('projectLocationCollectionDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_data_store_branch_document resource. @@ -210,6 +275,25 @@ public static function projectLocationCollectionEngineServingConfigName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted project_location_data_store resource. + */ + public static function projectLocationDataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('projectLocationDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_data_store_branch_document resource. @@ -292,10 +376,14 @@ public static function servingConfigName( * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - dataStore: projects/{project}/locations/{location}/dataStores/{data_store} * - document: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document} + * - engine: projects/{project}/locations/{location}/collections/{collection}/engines/{engine} + * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} * - projectLocationCollectionDataStoreBranchDocument: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document} * - projectLocationCollectionDataStoreServingConfig: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config} * - projectLocationCollectionEngineServingConfig: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config} + * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} * - projectLocationDataStoreBranchDocument: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document} * - projectLocationDataStoreServingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config} * - servingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config} diff --git a/DiscoveryEngine/src/V1/Client/SchemaServiceClient.php b/DiscoveryEngine/src/V1/Client/SchemaServiceClient.php index 429a2e82a6c8..50450a57322d 100644 --- a/DiscoveryEngine/src/V1/Client/SchemaServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/SchemaServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -41,6 +40,7 @@ use Google\Cloud\DiscoveryEngine\V1\ListSchemasRequest; use Google\Cloud\DiscoveryEngine\V1\Schema; use Google\Cloud\DiscoveryEngine\V1\UpdateSchemaRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -140,6 +140,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a data_store * resource. diff --git a/DiscoveryEngine/src/V1/Client/SiteSearchEngineServiceClient.php b/DiscoveryEngine/src/V1/Client/SiteSearchEngineServiceClient.php index 4f4fabada7bb..8352c0540ac4 100644 --- a/DiscoveryEngine/src/V1/Client/SiteSearchEngineServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/SiteSearchEngineServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -49,6 +48,7 @@ use Google\Cloud\DiscoveryEngine\V1\SiteSearchEngine; use Google\Cloud\DiscoveryEngine\V1\TargetSite; use Google\Cloud\DiscoveryEngine\V1\UpdateTargetSiteRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -156,6 +156,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_data_store_siteSearchEngine resource. diff --git a/DiscoveryEngine/src/V1/Client/UserEventServiceClient.php b/DiscoveryEngine/src/V1/Client/UserEventServiceClient.php index dabde3b727ca..cdb8e6d36f83 100644 --- a/DiscoveryEngine/src/V1/Client/UserEventServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/UserEventServiceClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\ResourceHelperTrait; use Google\ApiCore\RetrySettings; @@ -39,6 +38,7 @@ use Google\Cloud\DiscoveryEngine\V1\ImportUserEventsRequest; use Google\Cloud\DiscoveryEngine\V1\UserEvent; use Google\Cloud\DiscoveryEngine\V1\WriteUserEventRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -136,6 +136,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a data_store * resource. @@ -183,6 +202,27 @@ public static function documentName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a engine + * resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * + * @return string The formatted engine resource. + */ + public static function engineName(string $project, string $location, string $collection, string $engine): string + { + return self::getPathTemplate('engine')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_data_store resource. @@ -292,6 +332,7 @@ public static function projectLocationDataStoreBranchDocumentName( * Template: Pattern * - dataStore: projects/{project}/locations/{location}/dataStores/{data_store} * - document: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document} + * - engine: projects/{project}/locations/{location}/collections/{collection}/engines/{engine} * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} * - projectLocationCollectionDataStoreBranchDocument: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document} * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} @@ -418,7 +459,7 @@ public function collectUserEvent(CollectUserEventRequest $request, array $callOp } /** - * Bulk import of User events. Request processing might be + * Bulk import of user events. Request processing might be * synchronous. Events that already exist are skipped. * Use this method for backfilling historical user events. * diff --git a/DiscoveryEngine/src/V1/Condition.php b/DiscoveryEngine/src/V1/Condition.php new file mode 100644 index 000000000000..acaf131b3572 --- /dev/null +++ b/DiscoveryEngine/src/V1/Condition.php @@ -0,0 +1,113 @@ +google.cloud.discoveryengine.v1.Condition + */ +class Condition extends \Google\Protobuf\Internal\Message +{ + /** + * Search only + * A list of terms to match the query on. + * Maximum of 10 query terms. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Condition.QueryTerm query_terms = 2; + */ + private $query_terms; + /** + * Range of time(s) specifying when condition is active. + * Maximum of 10 time ranges. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Condition.TimeRange active_time_range = 3; + */ + private $active_time_range; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\Condition\QueryTerm>|\Google\Protobuf\Internal\RepeatedField $query_terms + * Search only + * A list of terms to match the query on. + * Maximum of 10 query terms. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Condition\TimeRange>|\Google\Protobuf\Internal\RepeatedField $active_time_range + * Range of time(s) specifying when condition is active. + * Maximum of 10 time ranges. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Control::initOnce(); + parent::__construct($data); + } + + /** + * Search only + * A list of terms to match the query on. + * Maximum of 10 query terms. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Condition.QueryTerm query_terms = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryTerms() + { + return $this->query_terms; + } + + /** + * Search only + * A list of terms to match the query on. + * Maximum of 10 query terms. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Condition.QueryTerm query_terms = 2; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Condition\QueryTerm>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Condition\QueryTerm::class); + $this->query_terms = $arr; + + return $this; + } + + /** + * Range of time(s) specifying when condition is active. + * Maximum of 10 time ranges. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Condition.TimeRange active_time_range = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActiveTimeRange() + { + return $this->active_time_range; + } + + /** + * Range of time(s) specifying when condition is active. + * Maximum of 10 time ranges. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Condition.TimeRange active_time_range = 3; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Condition\TimeRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActiveTimeRange($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Condition\TimeRange::class); + $this->active_time_range = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/Condition/QueryTerm.php b/DiscoveryEngine/src/V1/Condition/QueryTerm.php new file mode 100644 index 000000000000..9f24b0dc4f61 --- /dev/null +++ b/DiscoveryEngine/src/V1/Condition/QueryTerm.php @@ -0,0 +1,118 @@ +google.cloud.discoveryengine.v1.Condition.QueryTerm + */ +class QueryTerm extends \Google\Protobuf\Internal\Message +{ + /** + * The specific query value to match against + * Must be lowercase, must be UTF-8. + * Can have at most 3 space separated terms if full_match is true. + * Cannot be an empty string. + * Maximum length of 5000 characters. + * + * Generated from protobuf field string value = 1; + */ + protected $value = ''; + /** + * Whether the search query needs to exactly match the query term. + * + * Generated from protobuf field bool full_match = 2; + */ + protected $full_match = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The specific query value to match against + * Must be lowercase, must be UTF-8. + * Can have at most 3 space separated terms if full_match is true. + * Cannot be an empty string. + * Maximum length of 5000 characters. + * @type bool $full_match + * Whether the search query needs to exactly match the query term. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Control::initOnce(); + parent::__construct($data); + } + + /** + * The specific query value to match against + * Must be lowercase, must be UTF-8. + * Can have at most 3 space separated terms if full_match is true. + * Cannot be an empty string. + * Maximum length of 5000 characters. + * + * Generated from protobuf field string value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The specific query value to match against + * Must be lowercase, must be UTF-8. + * Can have at most 3 space separated terms if full_match is true. + * Cannot be an empty string. + * Maximum length of 5000 characters. + * + * Generated from protobuf field string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Whether the search query needs to exactly match the query term. + * + * Generated from protobuf field bool full_match = 2; + * @return bool + */ + public function getFullMatch() + { + return $this->full_match; + } + + /** + * Whether the search query needs to exactly match the query term. + * + * Generated from protobuf field bool full_match = 2; + * @param bool $var + * @return $this + */ + public function setFullMatch($var) + { + GPBUtil::checkBool($var); + $this->full_match = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Condition/TimeRange.php b/DiscoveryEngine/src/V1/Condition/TimeRange.php new file mode 100644 index 000000000000..bdff1cde4c2e --- /dev/null +++ b/DiscoveryEngine/src/V1/Condition/TimeRange.php @@ -0,0 +1,134 @@ +google.cloud.discoveryengine.v1.Condition.TimeRange + */ +class TimeRange extends \Google\Protobuf\Internal\Message +{ + /** + * Start of time range. + * Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * End of time range. + * Range is inclusive. + * Must be in the future. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Start of time range. + * Range is inclusive. + * @type \Google\Protobuf\Timestamp $end_time + * End of time range. + * Range is inclusive. + * Must be in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Control::initOnce(); + parent::__construct($data); + } + + /** + * Start of time range. + * Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start of time range. + * Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * End of time range. + * Range is inclusive. + * Must be in the future. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * End of time range. + * Range is inclusive. + * Must be in the future. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Control.php b/DiscoveryEngine/src/V1/Control.php new file mode 100644 index 000000000000..3e1f922dce18 --- /dev/null +++ b/DiscoveryEngine/src/V1/Control.php @@ -0,0 +1,443 @@ +google.cloud.discoveryengine.v1.Control + */ +class Control extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/dataStore/*/controls/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Required. Human readable name. The identifier used in UI views. + * Must be UTF-8 encoded string. Length limit is 128 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. List of all [ServingConfig][] ids this control is attached to. + * May take up to 10 minutes to update after changes. + * + * Generated from protobuf field repeated string associated_serving_config_ids = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $associated_serving_config_ids; + /** + * Required. Immutable. What solution the control belongs to. + * Must be compatible with vertical of resource. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SolutionType solution_type = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $solution_type = 0; + /** + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only applies to + * [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. + * Currently only allow one use case per control. + * Must be set when solution_type is + * [SolutionType.SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchUseCase use_cases = 8; + */ + private $use_cases; + /** + * Determines when the associated action will trigger. + * Omit to always apply the action. + * Currently only a single condition may be specified. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Condition conditions = 5; + */ + private $conditions; + protected $action; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\Control\BoostAction $boost_action + * Defines a boost-type control + * @type \Google\Cloud\DiscoveryEngine\V1\Control\FilterAction $filter_action + * Defines a filter-type control + * Currently not supported by Recommendation + * @type \Google\Cloud\DiscoveryEngine\V1\Control\RedirectAction $redirect_action + * Defines a redirect-type control. + * @type \Google\Cloud\DiscoveryEngine\V1\Control\SynonymsAction $synonyms_action + * Treats a group of terms as synonyms of one another. + * @type string $name + * Immutable. Fully qualified name + * `projects/*/locations/global/dataStore/*/controls/*` + * @type string $display_name + * Required. Human readable name. The identifier used in UI views. + * Must be UTF-8 encoded string. Length limit is 128 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * @type array|\Google\Protobuf\Internal\RepeatedField $associated_serving_config_ids + * Output only. List of all [ServingConfig][] ids this control is attached to. + * May take up to 10 minutes to update after changes. + * @type int $solution_type + * Required. Immutable. What solution the control belongs to. + * Must be compatible with vertical of resource. + * Otherwise an INVALID ARGUMENT error is thrown. + * @type array|\Google\Protobuf\Internal\RepeatedField $use_cases + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only applies to + * [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. + * Currently only allow one use case per control. + * Must be set when solution_type is + * [SolutionType.SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Determines when the associated action will trigger. + * Omit to always apply the action. + * Currently only a single condition may be specified. + * Otherwise an INVALID ARGUMENT error is thrown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Control::initOnce(); + parent::__construct($data); + } + + /** + * Defines a boost-type control + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control.BoostAction boost_action = 6; + * @return \Google\Cloud\DiscoveryEngine\V1\Control\BoostAction|null + */ + public function getBoostAction() + { + return $this->readOneof(6); + } + + public function hasBoostAction() + { + return $this->hasOneof(6); + } + + /** + * Defines a boost-type control + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control.BoostAction boost_action = 6; + * @param \Google\Cloud\DiscoveryEngine\V1\Control\BoostAction $var + * @return $this + */ + public function setBoostAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Control\BoostAction::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Defines a filter-type control + * Currently not supported by Recommendation + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control.FilterAction filter_action = 7; + * @return \Google\Cloud\DiscoveryEngine\V1\Control\FilterAction|null + */ + public function getFilterAction() + { + return $this->readOneof(7); + } + + public function hasFilterAction() + { + return $this->hasOneof(7); + } + + /** + * Defines a filter-type control + * Currently not supported by Recommendation + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control.FilterAction filter_action = 7; + * @param \Google\Cloud\DiscoveryEngine\V1\Control\FilterAction $var + * @return $this + */ + public function setFilterAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Control\FilterAction::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Defines a redirect-type control. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control.RedirectAction redirect_action = 9; + * @return \Google\Cloud\DiscoveryEngine\V1\Control\RedirectAction|null + */ + public function getRedirectAction() + { + return $this->readOneof(9); + } + + public function hasRedirectAction() + { + return $this->hasOneof(9); + } + + /** + * Defines a redirect-type control. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control.RedirectAction redirect_action = 9; + * @param \Google\Cloud\DiscoveryEngine\V1\Control\RedirectAction $var + * @return $this + */ + public function setRedirectAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Control\RedirectAction::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Treats a group of terms as synonyms of one another. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control.SynonymsAction synonyms_action = 10; + * @return \Google\Cloud\DiscoveryEngine\V1\Control\SynonymsAction|null + */ + public function getSynonymsAction() + { + return $this->readOneof(10); + } + + public function hasSynonymsAction() + { + return $this->hasOneof(10); + } + + /** + * Treats a group of terms as synonyms of one another. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control.SynonymsAction synonyms_action = 10; + * @param \Google\Cloud\DiscoveryEngine\V1\Control\SynonymsAction $var + * @return $this + */ + public function setSynonymsAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Control\SynonymsAction::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/dataStore/*/controls/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/dataStore/*/controls/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Human readable name. The identifier used in UI views. + * Must be UTF-8 encoded string. Length limit is 128 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Human readable name. The identifier used in UI views. + * Must be UTF-8 encoded string. Length limit is 128 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. List of all [ServingConfig][] ids this control is attached to. + * May take up to 10 minutes to update after changes. + * + * Generated from protobuf field repeated string associated_serving_config_ids = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssociatedServingConfigIds() + { + return $this->associated_serving_config_ids; + } + + /** + * Output only. List of all [ServingConfig][] ids this control is attached to. + * May take up to 10 minutes to update after changes. + * + * Generated from protobuf field repeated string associated_serving_config_ids = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssociatedServingConfigIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->associated_serving_config_ids = $arr; + + return $this; + } + + /** + * Required. Immutable. What solution the control belongs to. + * Must be compatible with vertical of resource. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SolutionType solution_type = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getSolutionType() + { + return $this->solution_type; + } + + /** + * Required. Immutable. What solution the control belongs to. + * Must be compatible with vertical of resource. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SolutionType solution_type = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setSolutionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\SolutionType::class); + $this->solution_type = $var; + + return $this; + } + + /** + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only applies to + * [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. + * Currently only allow one use case per control. + * Must be set when solution_type is + * [SolutionType.SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchUseCase use_cases = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUseCases() + { + return $this->use_cases; + } + + /** + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only applies to + * [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. + * Currently only allow one use case per control. + * Must be set when solution_type is + * [SolutionType.SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchUseCase use_cases = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUseCases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\DiscoveryEngine\V1\SearchUseCase::class); + $this->use_cases = $arr; + + return $this; + } + + /** + * Determines when the associated action will trigger. + * Omit to always apply the action. + * Currently only a single condition may be specified. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Condition conditions = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Determines when the associated action will trigger. + * Omit to always apply the action. + * Currently only a single condition may be specified. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Condition conditions = 5; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * @return string + */ + public function getAction() + { + return $this->whichOneof("action"); + } + +} + diff --git a/DiscoveryEngine/src/V1/Control/BoostAction.php b/DiscoveryEngine/src/V1/Control/BoostAction.php new file mode 100644 index 000000000000..53fc5bd38390 --- /dev/null +++ b/DiscoveryEngine/src/V1/Control/BoostAction.php @@ -0,0 +1,168 @@ +google.cloud.discoveryengine.v1.Control.BoostAction + */ +class BoostAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Strength of the boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0 (No-op). + * + * Generated from protobuf field float boost = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $boost = 0.0; + /** + * Required. Specifies which products to apply the boost to. + * If no filter is provided all products will be boosted (No-op). + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Required. Specifies which data store's documents can be boosted by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $data_store = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $boost + * Required. Strength of the boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0 (No-op). + * @type string $filter + * Required. Specifies which products to apply the boost to. + * If no filter is provided all products will be boosted (No-op). + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * @type string $data_store + * Required. Specifies which data store's documents can be boosted by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Control::initOnce(); + parent::__construct($data); + } + + /** + * Required. Strength of the boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0 (No-op). + * + * Generated from protobuf field float boost = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getBoost() + { + return $this->boost; + } + + /** + * Required. Strength of the boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0 (No-op). + * + * Generated from protobuf field float boost = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setBoost($var) + { + GPBUtil::checkFloat($var); + $this->boost = $var; + + return $this; + } + + /** + * Required. Specifies which products to apply the boost to. + * If no filter is provided all products will be boosted (No-op). + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. Specifies which products to apply the boost to. + * If no filter is provided all products will be boosted (No-op). + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Required. Specifies which data store's documents can be boosted by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDataStore() + { + return $this->data_store; + } + + /** + * Required. Specifies which data store's documents can be boosted by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataStore($var) + { + GPBUtil::checkString($var, True); + $this->data_store = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Control/FilterAction.php b/DiscoveryEngine/src/V1/Control/FilterAction.php new file mode 100644 index 000000000000..ec03e754cc07 --- /dev/null +++ b/DiscoveryEngine/src/V1/Control/FilterAction.php @@ -0,0 +1,131 @@ +google.cloud.discoveryengine.v1.Control.FilterAction + */ +class FilterAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A filter to apply on the matching condition results. + * Required + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. Otherwise an INVALID + * ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Required. Specifies which data store's documents can be filtered by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $data_store = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filter + * Required. A filter to apply on the matching condition results. + * Required + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. Otherwise an INVALID + * ARGUMENT error is thrown. + * @type string $data_store + * Required. Specifies which data store's documents can be filtered by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Control::initOnce(); + parent::__construct($data); + } + + /** + * Required. A filter to apply on the matching condition results. + * Required + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. Otherwise an INVALID + * ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. A filter to apply on the matching condition results. + * Required + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. Otherwise an INVALID + * ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Required. Specifies which data store's documents can be filtered by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDataStore() + { + return $this->data_store; + } + + /** + * Required. Specifies which data store's documents can be filtered by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataStore($var) + { + GPBUtil::checkString($var, True); + $this->data_store = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Control/RedirectAction.php b/DiscoveryEngine/src/V1/Control/RedirectAction.php new file mode 100644 index 000000000000..3b4116479b05 --- /dev/null +++ b/DiscoveryEngine/src/V1/Control/RedirectAction.php @@ -0,0 +1,80 @@ +google.cloud.discoveryengine.v1.Control.RedirectAction + */ +class RedirectAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URI to which the shopper will be redirected. + * Required. + * URI must have length equal or less than 2000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string redirect_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $redirect_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $redirect_uri + * Required. The URI to which the shopper will be redirected. + * Required. + * URI must have length equal or less than 2000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Control::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URI to which the shopper will be redirected. + * Required. + * URI must have length equal or less than 2000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string redirect_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRedirectUri() + { + return $this->redirect_uri; + } + + /** + * Required. The URI to which the shopper will be redirected. + * Required. + * URI must have length equal or less than 2000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string redirect_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRedirectUri($var) + { + GPBUtil::checkString($var, True); + $this->redirect_uri = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Control/SynonymsAction.php b/DiscoveryEngine/src/V1/Control/SynonymsAction.php new file mode 100644 index 000000000000..67c9674745da --- /dev/null +++ b/DiscoveryEngine/src/V1/Control/SynonymsAction.php @@ -0,0 +1,82 @@ +google.cloud.discoveryengine.v1.Control.SynonymsAction + */ +class SynonymsAction extends \Google\Protobuf\Internal\Message +{ + /** + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is + * thrown. + * + * Generated from protobuf field repeated string synonyms = 1; + */ + private $synonyms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $synonyms + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is + * thrown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Control::initOnce(); + parent::__construct($data); + } + + /** + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is + * thrown. + * + * Generated from protobuf field repeated string synonyms = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is + * thrown. + * + * Generated from protobuf field repeated string synonyms = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Conversation.php b/DiscoveryEngine/src/V1/Conversation.php index 37f527d15623..2a217e603795 100644 --- a/DiscoveryEngine/src/V1/Conversation.php +++ b/DiscoveryEngine/src/V1/Conversation.php @@ -17,9 +17,9 @@ class Conversation extends \Google\Protobuf\Internal\Message { /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` + * `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` * or - * `project/*/locations/global/collections/{collection}/engines/*/conversations/*`. + * `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ @@ -63,9 +63,9 @@ class Conversation extends \Google\Protobuf\Internal\Message * * @type string $name * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` + * `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` * or - * `project/*/locations/global/collections/{collection}/engines/*/conversations/*`. + * `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. * @type int $state * The state of the Conversation. * @type string $user_pseudo_id @@ -85,9 +85,9 @@ public function __construct($data = NULL) { /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` + * `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` * or - * `project/*/locations/global/collections/{collection}/engines/*/conversations/*`. + * `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; * @return string @@ -99,9 +99,9 @@ public function getName() /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` + * `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` * or - * `project/*/locations/global/collections/{collection}/engines/*/conversations/*`. + * `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; * @param string $var diff --git a/DiscoveryEngine/src/V1/CreateControlRequest.php b/DiscoveryEngine/src/V1/CreateControlRequest.php new file mode 100644 index 000000000000..98ecea4bb311 --- /dev/null +++ b/DiscoveryEngine/src/V1/CreateControlRequest.php @@ -0,0 +1,194 @@ +google.cloud.discoveryengine.v1.CreateControlRequest + */ +class CreateControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Control to create. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control = null; + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * + * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control_id = ''; + + /** + * @param string $parent Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. Please see + * {@see ControlServiceClient::dataStoreName()} for help formatting this field. + * @param \Google\Cloud\DiscoveryEngine\V1\Control $control Required. The Control to create. + * @param string $controlId Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * + * @return \Google\Cloud\DiscoveryEngine\V1\CreateControlRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1\Control $control, string $controlId): self + { + return (new self()) + ->setParent($parent) + ->setControl($control) + ->setControlId($controlId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * @type \Google\Cloud\DiscoveryEngine\V1\Control $control + * Required. The Control to create. + * @type string $control_id + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Control to create. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DiscoveryEngine\V1\Control|null + */ + public function getControl() + { + return $this->control; + } + + public function hasControl() + { + return isset($this->control); + } + + public function clearControl() + { + unset($this->control); + } + + /** + * Required. The Control to create. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DiscoveryEngine\V1\Control $var + * @return $this + */ + public function setControl($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Control::class); + $this->control = $var; + + return $this; + } + + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * + * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getControlId() + { + return $this->control_id; + } + + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * + * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setControlId($var) + { + GPBUtil::checkString($var, True); + $this->control_id = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/CreateDocumentRequest.php b/DiscoveryEngine/src/V1/CreateDocumentRequest.php index 82088e790bb0..d189b13266d5 100644 --- a/DiscoveryEngine/src/V1/CreateDocumentRequest.php +++ b/DiscoveryEngine/src/V1/CreateDocumentRequest.php @@ -33,7 +33,7 @@ class CreateDocumentRequest extends \Google\Protobuf\Internal\Message protected $document = null; /** * Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1.Document], which will become the + * [Document][google.cloud.discoveryengine.v1.Document], which becomes the * final component of the * [Document.name][google.cloud.discoveryengine.v1.Document.name]. * If the caller does not have permission to create the @@ -58,7 +58,7 @@ class CreateDocumentRequest extends \Google\Protobuf\Internal\Message * @param \Google\Cloud\DiscoveryEngine\V1\Document $document Required. The [Document][google.cloud.discoveryengine.v1.Document] to * create. * @param string $documentId Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1.Document], which will become the + * [Document][google.cloud.discoveryengine.v1.Document], which becomes the * final component of the * [Document.name][google.cloud.discoveryengine.v1.Document.name]. * @@ -101,7 +101,7 @@ public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1\Do * create. * @type string $document_id * Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1.Document], which will become the + * [Document][google.cloud.discoveryengine.v1.Document], which becomes the * final component of the * [Document.name][google.cloud.discoveryengine.v1.Document.name]. * If the caller does not have permission to create the @@ -189,7 +189,7 @@ public function setDocument($var) /** * Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1.Document], which will become the + * [Document][google.cloud.discoveryengine.v1.Document], which becomes the * final component of the * [Document.name][google.cloud.discoveryengine.v1.Document.name]. * If the caller does not have permission to create the @@ -213,7 +213,7 @@ public function getDocumentId() /** * Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1.Document], which will become the + * [Document][google.cloud.discoveryengine.v1.Document], which becomes the * final component of the * [Document.name][google.cloud.discoveryengine.v1.Document.name]. * If the caller does not have permission to create the diff --git a/DiscoveryEngine/src/V1/CreateSchemaRequest.php b/DiscoveryEngine/src/V1/CreateSchemaRequest.php index 53ae57f984be..75b11e40f16a 100644 --- a/DiscoveryEngine/src/V1/CreateSchemaRequest.php +++ b/DiscoveryEngine/src/V1/CreateSchemaRequest.php @@ -32,8 +32,8 @@ class CreateSchemaRequest extends \Google\Protobuf\Internal\Message protected $schema = null; /** * Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1.Schema], which will become the - * final component of the + * [Schema][google.cloud.discoveryengine.v1.Schema], which becomes the final + * component of the * [Schema.name][google.cloud.discoveryengine.v1.Schema.name]. * This field should conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length @@ -49,8 +49,8 @@ class CreateSchemaRequest extends \Google\Protobuf\Internal\Message * {@see SchemaServiceClient::dataStoreName()} for help formatting this field. * @param \Google\Cloud\DiscoveryEngine\V1\Schema $schema Required. The [Schema][google.cloud.discoveryengine.v1.Schema] to create. * @param string $schemaId Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1.Schema], which will become the - * final component of the + * [Schema][google.cloud.discoveryengine.v1.Schema], which becomes the final + * component of the * [Schema.name][google.cloud.discoveryengine.v1.Schema.name]. * * This field should conform to @@ -82,8 +82,8 @@ public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1\Sc * Required. The [Schema][google.cloud.discoveryengine.v1.Schema] to create. * @type string $schema_id * Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1.Schema], which will become the - * final component of the + * [Schema][google.cloud.discoveryengine.v1.Schema], which becomes the final + * component of the * [Schema.name][google.cloud.discoveryengine.v1.Schema.name]. * This field should conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length @@ -161,8 +161,8 @@ public function setSchema($var) /** * Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1.Schema], which will become the - * final component of the + * [Schema][google.cloud.discoveryengine.v1.Schema], which becomes the final + * component of the * [Schema.name][google.cloud.discoveryengine.v1.Schema.name]. * This field should conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length @@ -178,8 +178,8 @@ public function getSchemaId() /** * Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1.Schema], which will become the - * final component of the + * [Schema][google.cloud.discoveryengine.v1.Schema], which becomes the final + * component of the * [Schema.name][google.cloud.discoveryengine.v1.Schema.name]. * This field should conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length diff --git a/DiscoveryEngine/src/V1/CreateSessionRequest.php b/DiscoveryEngine/src/V1/CreateSessionRequest.php new file mode 100644 index 000000000000..068ad30fa60c --- /dev/null +++ b/DiscoveryEngine/src/V1/CreateSessionRequest.php @@ -0,0 +1,132 @@ +google.cloud.discoveryengine.v1.CreateSessionRequest + */ +class CreateSessionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The session to create. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $session = null; + + /** + * @param string $parent Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field. + * @param \Google\Cloud\DiscoveryEngine\V1\Session $session Required. The session to create. + * + * @return \Google\Cloud\DiscoveryEngine\V1\CreateSessionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1\Session $session): self + { + return (new self()) + ->setParent($parent) + ->setSession($session); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @type \Google\Cloud\DiscoveryEngine\V1\Session $session + * Required. The session to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The session to create. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DiscoveryEngine\V1\Session|null + */ + public function getSession() + { + return $this->session; + } + + public function hasSession() + { + return isset($this->session); + } + + public function clearSession() + { + unset($this->session); + } + + /** + * Required. The session to create. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DiscoveryEngine\V1\Session $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Session::class); + $this->session = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/DataStore.php b/DiscoveryEngine/src/V1/DataStore.php index 387f2238977b..73c19db07f00 100644 --- a/DiscoveryEngine/src/V1/DataStore.php +++ b/DiscoveryEngine/src/V1/DataStore.php @@ -72,6 +72,12 @@ class DataStore extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $create_time = null; + /** + * Configuration for Document understanding and enrichment. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig document_processing_config = 27; + */ + protected $document_processing_config = null; /** * The start schema to use for this * [DataStore][google.cloud.discoveryengine.v1.DataStore] when provisioning @@ -125,6 +131,8 @@ class DataStore extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $create_time * Output only. Timestamp the * [DataStore][google.cloud.discoveryengine.v1.DataStore] was created at. + * @type \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig $document_processing_config + * Configuration for Document understanding and enrichment. * @type \Google\Cloud\DiscoveryEngine\V1\Schema $starting_schema * The start schema to use for this * [DataStore][google.cloud.discoveryengine.v1.DataStore] when provisioning @@ -367,6 +375,42 @@ public function setCreateTime($var) return $this; } + /** + * Configuration for Document understanding and enrichment. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig document_processing_config = 27; + * @return \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig|null + */ + public function getDocumentProcessingConfig() + { + return $this->document_processing_config; + } + + public function hasDocumentProcessingConfig() + { + return isset($this->document_processing_config); + } + + public function clearDocumentProcessingConfig() + { + unset($this->document_processing_config); + } + + /** + * Configuration for Document understanding and enrichment. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig document_processing_config = 27; + * @param \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig $var + * @return $this + */ + public function setDocumentProcessingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig::class); + $this->document_processing_config = $var; + + return $this; + } + /** * The start schema to use for this * [DataStore][google.cloud.discoveryengine.v1.DataStore] when provisioning diff --git a/DiscoveryEngine/src/V1/DeleteControlRequest.php b/DiscoveryEngine/src/V1/DeleteControlRequest.php new file mode 100644 index 000000000000..e8a08f540dff --- /dev/null +++ b/DiscoveryEngine/src/V1/DeleteControlRequest.php @@ -0,0 +1,86 @@ +google.cloud.discoveryengine.v1.DeleteControlRequest + */ +class DeleteControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * Please see {@see ControlServiceClient::controlName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1\DeleteControlRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/DeleteSessionRequest.php b/DiscoveryEngine/src/V1/DeleteSessionRequest.php new file mode 100644 index 000000000000..248bc92618cc --- /dev/null +++ b/DiscoveryEngine/src/V1/DeleteSessionRequest.php @@ -0,0 +1,86 @@ +google.cloud.discoveryengine.v1.DeleteSessionRequest + */ +class DeleteSessionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Session to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Session to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * Please see {@see ConversationalSearchServiceClient::sessionName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1\DeleteSessionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Session to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Session to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Session to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/DocumentInfo.php b/DiscoveryEngine/src/V1/DocumentInfo.php index e9156ee0276b..2484b108f2a4 100644 --- a/DiscoveryEngine/src/V1/DocumentInfo.php +++ b/DiscoveryEngine/src/V1/DocumentInfo.php @@ -17,7 +17,7 @@ class DocumentInfo extends \Google\Protobuf\Internal\Message { /** * Quantity of the Document associated with the user event. Defaults to 1. - * For example, this field will be 2 if two quantities of the same Document + * For example, this field is 2 if two quantities of the same Document * are involved in a `add-to-cart` event. * Required for events of the following event types: * * `add-to-cart` @@ -52,7 +52,7 @@ class DocumentInfo extends \Google\Protobuf\Internal\Message * allowed for website data stores. * @type int $quantity * Quantity of the Document associated with the user event. Defaults to 1. - * For example, this field will be 2 if two quantities of the same Document + * For example, this field is 2 if two quantities of the same Document * are involved in a `add-to-cart` event. * Required for events of the following event types: * * `add-to-cart` @@ -168,7 +168,7 @@ public function setUri($var) /** * Quantity of the Document associated with the user event. Defaults to 1. - * For example, this field will be 2 if two quantities of the same Document + * For example, this field is 2 if two quantities of the same Document * are involved in a `add-to-cart` event. * Required for events of the following event types: * * `add-to-cart` @@ -194,7 +194,7 @@ public function clearQuantity() /** * Quantity of the Document associated with the user event. Defaults to 1. - * For example, this field will be 2 if two quantities of the same Document + * For example, this field is 2 if two quantities of the same Document * are involved in a `add-to-cart` event. * Required for events of the following event types: * * `add-to-cart` diff --git a/DiscoveryEngine/src/V1/DocumentProcessingConfig.php b/DiscoveryEngine/src/V1/DocumentProcessingConfig.php new file mode 100644 index 000000000000..864bb4b5c7c6 --- /dev/null +++ b/DiscoveryEngine/src/V1/DocumentProcessingConfig.php @@ -0,0 +1,198 @@ +google.cloud.discoveryengine.v1.DocumentProcessingConfig + */ +class DocumentProcessingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The full resource name of the Document Processing Config. + * Format: + * `projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Configurations for default Document parser. + * If not specified, we will configure it as default DigitalParsingConfig, and + * the default parsing config will be applied to all file types for Document + * parsing. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig default_parsing_config = 4; + */ + protected $default_parsing_config = null; + /** + * Map from file type to override the default parsing configuration based on + * the file type. Supported keys: + * * `pdf`: Override parsing config for PDF files, either digital parsing, ocr + * parsing or layout parsing is supported. + * * `html`: Override parsing config for HTML files, only digital parsing and + * or layout parsing are supported. + * * `docx`: Override parsing config for DOCX files, only digital parsing and + * or layout parsing are supported. + * + * Generated from protobuf field map parsing_config_overrides = 5; + */ + private $parsing_config_overrides; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The full resource name of the Document Processing Config. + * Format: + * `projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig`. + * @type \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig $default_parsing_config + * Configurations for default Document parser. + * If not specified, we will configure it as default DigitalParsingConfig, and + * the default parsing config will be applied to all file types for Document + * parsing. + * @type array|\Google\Protobuf\Internal\MapField $parsing_config_overrides + * Map from file type to override the default parsing configuration based on + * the file type. Supported keys: + * * `pdf`: Override parsing config for PDF files, either digital parsing, ocr + * parsing or layout parsing is supported. + * * `html`: Override parsing config for HTML files, only digital parsing and + * or layout parsing are supported. + * * `docx`: Override parsing config for DOCX files, only digital parsing and + * or layout parsing are supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\DocumentProcessingConfig::initOnce(); + parent::__construct($data); + } + + /** + * The full resource name of the Document Processing Config. + * Format: + * `projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The full resource name of the Document Processing Config. + * Format: + * `projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Configurations for default Document parser. + * If not specified, we will configure it as default DigitalParsingConfig, and + * the default parsing config will be applied to all file types for Document + * parsing. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig default_parsing_config = 4; + * @return \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig|null + */ + public function getDefaultParsingConfig() + { + return $this->default_parsing_config; + } + + public function hasDefaultParsingConfig() + { + return isset($this->default_parsing_config); + } + + public function clearDefaultParsingConfig() + { + unset($this->default_parsing_config); + } + + /** + * Configurations for default Document parser. + * If not specified, we will configure it as default DigitalParsingConfig, and + * the default parsing config will be applied to all file types for Document + * parsing. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig default_parsing_config = 4; + * @param \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig $var + * @return $this + */ + public function setDefaultParsingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig::class); + $this->default_parsing_config = $var; + + return $this; + } + + /** + * Map from file type to override the default parsing configuration based on + * the file type. Supported keys: + * * `pdf`: Override parsing config for PDF files, either digital parsing, ocr + * parsing or layout parsing is supported. + * * `html`: Override parsing config for HTML files, only digital parsing and + * or layout parsing are supported. + * * `docx`: Override parsing config for DOCX files, only digital parsing and + * or layout parsing are supported. + * + * Generated from protobuf field map parsing_config_overrides = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParsingConfigOverrides() + { + return $this->parsing_config_overrides; + } + + /** + * Map from file type to override the default parsing configuration based on + * the file type. Supported keys: + * * `pdf`: Override parsing config for PDF files, either digital parsing, ocr + * parsing or layout parsing is supported. + * * `html`: Override parsing config for HTML files, only digital parsing and + * or layout parsing are supported. + * * `docx`: Override parsing config for DOCX files, only digital parsing and + * or layout parsing are supported. + * + * Generated from protobuf field map parsing_config_overrides = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParsingConfigOverrides($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig::class); + $this->parsing_config_overrides = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig.php b/DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig.php new file mode 100644 index 000000000000..eb2cc5e967ce --- /dev/null +++ b/DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig.php @@ -0,0 +1,112 @@ +google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig + */ +class ParsingConfig extends \Google\Protobuf\Internal\Message +{ + protected $type_dedicated_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig\DigitalParsingConfig $digital_parsing_config + * Configurations applied to digital parser. + * @type \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig\OcrParsingConfig $ocr_parsing_config + * Configurations applied to OCR parser. Currently it only applies to + * PDFs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\DocumentProcessingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Configurations applied to digital parser. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.DigitalParsingConfig digital_parsing_config = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig\DigitalParsingConfig|null + */ + public function getDigitalParsingConfig() + { + return $this->readOneof(1); + } + + public function hasDigitalParsingConfig() + { + return $this->hasOneof(1); + } + + /** + * Configurations applied to digital parser. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.DigitalParsingConfig digital_parsing_config = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig\DigitalParsingConfig $var + * @return $this + */ + public function setDigitalParsingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig\DigitalParsingConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Configurations applied to OCR parser. Currently it only applies to + * PDFs. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.OcrParsingConfig ocr_parsing_config = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig\OcrParsingConfig|null + */ + public function getOcrParsingConfig() + { + return $this->readOneof(2); + } + + public function hasOcrParsingConfig() + { + return $this->hasOneof(2); + } + + /** + * Configurations applied to OCR parser. Currently it only applies to + * PDFs. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.OcrParsingConfig ocr_parsing_config = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig\OcrParsingConfig $var + * @return $this + */ + public function setOcrParsingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig\ParsingConfig\OcrParsingConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getTypeDedicatedConfig() + { + return $this->whichOneof("type_dedicated_config"); + } + +} + + diff --git a/DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig/DigitalParsingConfig.php b/DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig/DigitalParsingConfig.php new file mode 100644 index 000000000000..2678652787cc --- /dev/null +++ b/DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig/DigitalParsingConfig.php @@ -0,0 +1,34 @@ +google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.DigitalParsingConfig + */ +class DigitalParsingConfig extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\DocumentProcessingConfig::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig/OcrParsingConfig.php b/DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig/OcrParsingConfig.php new file mode 100644 index 000000000000..c83c15b830c3 --- /dev/null +++ b/DiscoveryEngine/src/V1/DocumentProcessingConfig/ParsingConfig/OcrParsingConfig.php @@ -0,0 +1,115 @@ +google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.OcrParsingConfig + */ +class OcrParsingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * [DEPRECATED] This field is deprecated. To use the additional enhanced + * document elements processing, please switch to `layout_parsing_config`. + * + * Generated from protobuf field repeated string enhanced_document_elements = 1 [deprecated = true]; + * @deprecated + */ + private $enhanced_document_elements; + /** + * If true, will use native text instead of OCR text on pages containing + * native text. + * + * Generated from protobuf field bool use_native_text = 2; + */ + protected $use_native_text = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $enhanced_document_elements + * [DEPRECATED] This field is deprecated. To use the additional enhanced + * document elements processing, please switch to `layout_parsing_config`. + * @type bool $use_native_text + * If true, will use native text instead of OCR text on pages containing + * native text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\DocumentProcessingConfig::initOnce(); + parent::__construct($data); + } + + /** + * [DEPRECATED] This field is deprecated. To use the additional enhanced + * document elements processing, please switch to `layout_parsing_config`. + * + * Generated from protobuf field repeated string enhanced_document_elements = 1 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getEnhancedDocumentElements() + { + @trigger_error('enhanced_document_elements is deprecated.', E_USER_DEPRECATED); + return $this->enhanced_document_elements; + } + + /** + * [DEPRECATED] This field is deprecated. To use the additional enhanced + * document elements processing, please switch to `layout_parsing_config`. + * + * Generated from protobuf field repeated string enhanced_document_elements = 1 [deprecated = true]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setEnhancedDocumentElements($var) + { + @trigger_error('enhanced_document_elements is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->enhanced_document_elements = $arr; + + return $this; + } + + /** + * If true, will use native text instead of OCR text on pages containing + * native text. + * + * Generated from protobuf field bool use_native_text = 2; + * @return bool + */ + public function getUseNativeText() + { + return $this->use_native_text; + } + + /** + * If true, will use native text instead of OCR text on pages containing + * native text. + * + * Generated from protobuf field bool use_native_text = 2; + * @param bool $var + * @return $this + */ + public function setUseNativeText($var) + { + GPBUtil::checkBool($var); + $this->use_native_text = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Engine.php b/DiscoveryEngine/src/V1/Engine.php index 7e19a11401d5..b5d7db997a93 100644 --- a/DiscoveryEngine/src/V1/Engine.php +++ b/DiscoveryEngine/src/V1/Engine.php @@ -78,7 +78,7 @@ class Engine extends \Google\Protobuf\Internal\Message * The restriction of the Engine industry vertical is based on * [DataStore][google.cloud.discoveryengine.v1.DataStore]: If unspecified, * default to `GENERIC`. Vertical on Engine has to match vertical of the - * DataStore liniked to the engine. + * DataStore linked to the engine. * * Generated from protobuf field .google.cloud.discoveryengine.v1.IndustryVertical industry_vertical = 16; */ @@ -149,7 +149,7 @@ class Engine extends \Google\Protobuf\Internal\Message * The restriction of the Engine industry vertical is based on * [DataStore][google.cloud.discoveryengine.v1.DataStore]: If unspecified, * default to `GENERIC`. Vertical on Engine has to match vertical of the - * DataStore liniked to the engine. + * DataStore linked to the engine. * @type \Google\Cloud\DiscoveryEngine\V1\Engine\CommonConfig $common_config * Common config spec that specifies the metadata of the engine. * } @@ -489,7 +489,7 @@ public function setSolutionType($var) * The restriction of the Engine industry vertical is based on * [DataStore][google.cloud.discoveryengine.v1.DataStore]: If unspecified, * default to `GENERIC`. Vertical on Engine has to match vertical of the - * DataStore liniked to the engine. + * DataStore linked to the engine. * * Generated from protobuf field .google.cloud.discoveryengine.v1.IndustryVertical industry_vertical = 16; * @return int @@ -504,7 +504,7 @@ public function getIndustryVertical() * The restriction of the Engine industry vertical is based on * [DataStore][google.cloud.discoveryengine.v1.DataStore]: If unspecified, * default to `GENERIC`. Vertical on Engine has to match vertical of the - * DataStore liniked to the engine. + * DataStore linked to the engine. * * Generated from protobuf field .google.cloud.discoveryengine.v1.IndustryVertical industry_vertical = 16; * @param int $var diff --git a/DiscoveryEngine/src/V1/Engine/CommonConfig.php b/DiscoveryEngine/src/V1/Engine/CommonConfig.php index 4de53c05935b..eeb5c06a5d35 100644 --- a/DiscoveryEngine/src/V1/Engine/CommonConfig.php +++ b/DiscoveryEngine/src/V1/Engine/CommonConfig.php @@ -16,10 +16,10 @@ class CommonConfig extends \Google\Protobuf\Internal\Message { /** - * Immutable. The name of the company, business or entity that is associated - * with the engine. Setting this may help improve LLM related features. + * The name of the company, business or entity that is associated with the + * engine. Setting this may help improve LLM related features. * - * Generated from protobuf field string company_name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * Generated from protobuf field string company_name = 1; */ protected $company_name = ''; @@ -30,8 +30,8 @@ class CommonConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $company_name - * Immutable. The name of the company, business or entity that is associated - * with the engine. Setting this may help improve LLM related features. + * The name of the company, business or entity that is associated with the + * engine. Setting this may help improve LLM related features. * } */ public function __construct($data = NULL) { @@ -40,10 +40,10 @@ public function __construct($data = NULL) { } /** - * Immutable. The name of the company, business or entity that is associated - * with the engine. Setting this may help improve LLM related features. + * The name of the company, business or entity that is associated with the + * engine. Setting this may help improve LLM related features. * - * Generated from protobuf field string company_name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * Generated from protobuf field string company_name = 1; * @return string */ public function getCompanyName() @@ -52,10 +52,10 @@ public function getCompanyName() } /** - * Immutable. The name of the company, business or entity that is associated - * with the engine. Setting this may help improve LLM related features. + * The name of the company, business or entity that is associated with the + * engine. Setting this may help improve LLM related features. * - * Generated from protobuf field string company_name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * Generated from protobuf field string company_name = 1; * @param string $var * @return $this */ diff --git a/DiscoveryEngine/src/V1/FactChunk.php b/DiscoveryEngine/src/V1/FactChunk.php new file mode 100644 index 000000000000..5707d7e2e864 --- /dev/null +++ b/DiscoveryEngine/src/V1/FactChunk.php @@ -0,0 +1,181 @@ +google.cloud.discoveryengine.v1.FactChunk + */ +class FactChunk extends \Google\Protobuf\Internal\Message +{ + /** + * Text content of the fact chunk. Can be at most 10K characters long. + * + * Generated from protobuf field string chunk_text = 1; + */ + protected $chunk_text = ''; + /** + * Source from which this fact chunk was retrieved. If it was retrieved + * from the GroundingFacts provided in the request then this field will + * contain the index of the specific fact from which this chunk was + * retrieved. + * + * Generated from protobuf field string source = 2; + */ + protected $source = ''; + /** + * The index of this chunk. Currently, only used for the streaming mode. + * + * Generated from protobuf field int32 index = 4; + */ + protected $index = 0; + /** + * More fine-grained information for the source reference. + * + * Generated from protobuf field map source_metadata = 3; + */ + private $source_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $chunk_text + * Text content of the fact chunk. Can be at most 10K characters long. + * @type string $source + * Source from which this fact chunk was retrieved. If it was retrieved + * from the GroundingFacts provided in the request then this field will + * contain the index of the specific fact from which this chunk was + * retrieved. + * @type int $index + * The index of this chunk. Currently, only used for the streaming mode. + * @type array|\Google\Protobuf\Internal\MapField $source_metadata + * More fine-grained information for the source reference. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Grounding::initOnce(); + parent::__construct($data); + } + + /** + * Text content of the fact chunk. Can be at most 10K characters long. + * + * Generated from protobuf field string chunk_text = 1; + * @return string + */ + public function getChunkText() + { + return $this->chunk_text; + } + + /** + * Text content of the fact chunk. Can be at most 10K characters long. + * + * Generated from protobuf field string chunk_text = 1; + * @param string $var + * @return $this + */ + public function setChunkText($var) + { + GPBUtil::checkString($var, True); + $this->chunk_text = $var; + + return $this; + } + + /** + * Source from which this fact chunk was retrieved. If it was retrieved + * from the GroundingFacts provided in the request then this field will + * contain the index of the specific fact from which this chunk was + * retrieved. + * + * Generated from protobuf field string source = 2; + * @return string + */ + public function getSource() + { + return $this->source; + } + + /** + * Source from which this fact chunk was retrieved. If it was retrieved + * from the GroundingFacts provided in the request then this field will + * contain the index of the specific fact from which this chunk was + * retrieved. + * + * Generated from protobuf field string source = 2; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * The index of this chunk. Currently, only used for the streaming mode. + * + * Generated from protobuf field int32 index = 4; + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * The index of this chunk. Currently, only used for the streaming mode. + * + * Generated from protobuf field int32 index = 4; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * More fine-grained information for the source reference. + * + * Generated from protobuf field map source_metadata = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getSourceMetadata() + { + return $this->source_metadata; + } + + /** + * More fine-grained information for the source reference. + * + * Generated from protobuf field map source_metadata = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setSourceMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_metadata = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/FirestoreSource.php b/DiscoveryEngine/src/V1/FirestoreSource.php index 361f4b02a1f7..19aec3390a81 100644 --- a/DiscoveryEngine/src/V1/FirestoreSource.php +++ b/DiscoveryEngine/src/V1/FirestoreSource.php @@ -31,8 +31,8 @@ class FirestoreSource extends \Google\Protobuf\Internal\Message */ protected $database_id = ''; /** - * Required. The Firestore collection to copy the data from with a length - * limit of 1,500 characters. + * Required. The Firestore collection (or entity) to copy the data from with a + * length limit of 1,500 characters. * * Generated from protobuf field string collection_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ @@ -62,8 +62,8 @@ class FirestoreSource extends \Google\Protobuf\Internal\Message * Required. The Firestore database to copy the data from with a length limit * of 256 characters. * @type string $collection_id - * Required. The Firestore collection to copy the data from with a length - * limit of 1,500 characters. + * Required. The Firestore collection (or entity) to copy the data from with a + * length limit of 1,500 characters. * @type string $gcs_staging_dir * Intermediate Cloud Storage directory used for the import with a length * limit of 2,000 characters. Can be specified if one wants to have the @@ -136,8 +136,8 @@ public function setDatabaseId($var) } /** - * Required. The Firestore collection to copy the data from with a length - * limit of 1,500 characters. + * Required. The Firestore collection (or entity) to copy the data from with a + * length limit of 1,500 characters. * * Generated from protobuf field string collection_id = 3 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -148,8 +148,8 @@ public function getCollectionId() } /** - * Required. The Firestore collection to copy the data from with a length - * limit of 1,500 characters. + * Required. The Firestore collection (or entity) to copy the data from with a + * length limit of 1,500 characters. * * Generated from protobuf field string collection_id = 3 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/DiscoveryEngine/src/V1/GcsSource.php b/DiscoveryEngine/src/V1/GcsSource.php index 29b8a73ad4f4..38121444def8 100644 --- a/DiscoveryEngine/src/V1/GcsSource.php +++ b/DiscoveryEngine/src/V1/GcsSource.php @@ -16,7 +16,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message { /** - * Required. Cloud Storage URIs to input files. URI can be up to + * Required. Cloud Storage URIs to input files. Each URI can be up to * 2000 characters long. URIs can match the full object path (for example, * `gs://bucket/directory/object.json`) or a pattern matching one or more * files, such as `gs://bucket/directory/*.json`. @@ -44,7 +44,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message * [Schema][google.cloud.discoveryengine.v1.Schema] of the * data store. Each entry after the header is imported as a Document. * This can only be used by the GENERIC Data Store vertical. - * Supported values for user even imports: + * Supported values for user event imports: * * `user_event` (default): One JSON * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per line. * @@ -59,7 +59,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type array|\Google\Protobuf\Internal\RepeatedField $input_uris - * Required. Cloud Storage URIs to input files. URI can be up to + * Required. Cloud Storage URIs to input files. Each URI can be up to * 2000 characters long. URIs can match the full object path (for example, * `gs://bucket/directory/object.json`) or a pattern matching one or more * files, such as `gs://bucket/directory/*.json`. @@ -83,7 +83,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message * [Schema][google.cloud.discoveryengine.v1.Schema] of the * data store. Each entry after the header is imported as a Document. * This can only be used by the GENERIC Data Store vertical. - * Supported values for user even imports: + * Supported values for user event imports: * * `user_event` (default): One JSON * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per line. * } @@ -94,7 +94,7 @@ public function __construct($data = NULL) { } /** - * Required. Cloud Storage URIs to input files. URI can be up to + * Required. Cloud Storage URIs to input files. Each URI can be up to * 2000 characters long. URIs can match the full object path (for example, * `gs://bucket/directory/object.json`) or a pattern matching one or more * files, such as `gs://bucket/directory/*.json`. @@ -111,7 +111,7 @@ public function getInputUris() } /** - * Required. Cloud Storage URIs to input files. URI can be up to + * Required. Cloud Storage URIs to input files. Each URI can be up to * 2000 characters long. URIs can match the full object path (for example, * `gs://bucket/directory/object.json`) or a pattern matching one or more * files, such as `gs://bucket/directory/*.json`. @@ -148,7 +148,7 @@ public function setInputUris($var) * [Schema][google.cloud.discoveryengine.v1.Schema] of the * data store. Each entry after the header is imported as a Document. * This can only be used by the GENERIC Data Store vertical. - * Supported values for user even imports: + * Supported values for user event imports: * * `user_event` (default): One JSON * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per line. * @@ -177,7 +177,7 @@ public function getDataSchema() * [Schema][google.cloud.discoveryengine.v1.Schema] of the * data store. Each entry after the header is imported as a Document. * This can only be used by the GENERIC Data Store vertical. - * Supported values for user even imports: + * Supported values for user event imports: * * `user_event` (default): One JSON * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per line. * diff --git a/DiscoveryEngine/src/V1/GetAnswerRequest.php b/DiscoveryEngine/src/V1/GetAnswerRequest.php new file mode 100644 index 000000000000..15f35eb2bc75 --- /dev/null +++ b/DiscoveryEngine/src/V1/GetAnswerRequest.php @@ -0,0 +1,86 @@ +google.cloud.discoveryengine.v1.GetAnswerRequest + */ +class GetAnswerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Answer to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Answer to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * Please see {@see ConversationalSearchServiceClient::answerName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1\GetAnswerRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Answer to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Answer to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Answer to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/GetControlRequest.php b/DiscoveryEngine/src/V1/GetControlRequest.php new file mode 100644 index 000000000000..083e30a65dfc --- /dev/null +++ b/DiscoveryEngine/src/V1/GetControlRequest.php @@ -0,0 +1,86 @@ +google.cloud.discoveryengine.v1.GetControlRequest + */ +class GetControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * Please see {@see ControlServiceClient::controlName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1\GetControlRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/GetSessionRequest.php b/DiscoveryEngine/src/V1/GetSessionRequest.php new file mode 100644 index 000000000000..dd3fa5c5da5f --- /dev/null +++ b/DiscoveryEngine/src/V1/GetSessionRequest.php @@ -0,0 +1,86 @@ +google.cloud.discoveryengine.v1.GetSessionRequest + */ +class GetSessionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Session to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Session to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * Please see {@see ConversationalSearchServiceClient::sessionName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1\GetSessionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Session to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Session to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Session to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/GroundingFact.php b/DiscoveryEngine/src/V1/GroundingFact.php new file mode 100644 index 000000000000..b640640efa03 --- /dev/null +++ b/DiscoveryEngine/src/V1/GroundingFact.php @@ -0,0 +1,109 @@ +google.cloud.discoveryengine.v1.GroundingFact + */ +class GroundingFact extends \Google\Protobuf\Internal\Message +{ + /** + * Text content of the fact. Can be at most 10K characters long. + * + * Generated from protobuf field string fact_text = 1; + */ + protected $fact_text = ''; + /** + * Attributes associated with the fact. + * Common attributes include `source` (indicating where the fact was sourced + * from), `author` (indicating the author of the fact), and so on. + * + * Generated from protobuf field map attributes = 2; + */ + private $attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fact_text + * Text content of the fact. Can be at most 10K characters long. + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Attributes associated with the fact. + * Common attributes include `source` (indicating where the fact was sourced + * from), `author` (indicating the author of the fact), and so on. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Grounding::initOnce(); + parent::__construct($data); + } + + /** + * Text content of the fact. Can be at most 10K characters long. + * + * Generated from protobuf field string fact_text = 1; + * @return string + */ + public function getFactText() + { + return $this->fact_text; + } + + /** + * Text content of the fact. Can be at most 10K characters long. + * + * Generated from protobuf field string fact_text = 1; + * @param string $var + * @return $this + */ + public function setFactText($var) + { + GPBUtil::checkString($var, True); + $this->fact_text = $var; + + return $this; + } + + /** + * Attributes associated with the fact. + * Common attributes include `source` (indicating where the fact was sourced + * from), `author` (indicating the author of the fact), and so on. + * + * Generated from protobuf field map attributes = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Attributes associated with the fact. + * Common attributes include `source` (indicating where the fact was sourced + * from), `author` (indicating the author of the fact), and so on. + * + * Generated from protobuf field map attributes = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->attributes = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/ListControlsRequest.php b/DiscoveryEngine/src/V1/ListControlsRequest.php new file mode 100644 index 000000000000..c980c9323f2d --- /dev/null +++ b/DiscoveryEngine/src/V1/ListControlsRequest.php @@ -0,0 +1,218 @@ +google.cloud.discoveryengine.v1.ListControlsRequest + */ +class ListControlsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.discoveryengine.v1.ListControlsRequest.filter] is + * unset. Currently this field is unsupported. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. Please see + * {@see ControlServiceClient::dataStoreName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1\ListControlsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * @type int $page_size + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * @type string $filter + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.discoveryengine.v1.ListControlsRequest.filter] is + * unset. Currently this field is unsupported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.discoveryengine.v1.ListControlsRequest.filter] is + * unset. Currently this field is unsupported. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.discoveryengine.v1.ListControlsRequest.filter] is + * unset. Currently this field is unsupported. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/ListControlsResponse.php b/DiscoveryEngine/src/V1/ListControlsResponse.php new file mode 100644 index 000000000000..f0bbd9ba3e7e --- /dev/null +++ b/DiscoveryEngine/src/V1/ListControlsResponse.php @@ -0,0 +1,101 @@ +google.cloud.discoveryengine.v1.ListControlsResponse + */ +class ListControlsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All the Controls for a given data store. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Control controls = 1; + */ + private $controls; + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\Control>|\Google\Protobuf\Internal\RepeatedField $controls + * All the Controls for a given data store. + * @type string $next_page_token + * Pagination token, if not returned indicates the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * All the Controls for a given data store. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Control controls = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getControls() + { + return $this->controls; + } + + /** + * All the Controls for a given data store. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Control controls = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Control>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setControls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Control::class); + $this->controls = $arr; + + return $this; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/ListDataStoresRequest.php b/DiscoveryEngine/src/V1/ListDataStoresRequest.php index 27449b1351a6..dc3e12ae5200 100644 --- a/DiscoveryEngine/src/V1/ListDataStoresRequest.php +++ b/DiscoveryEngine/src/V1/ListDataStoresRequest.php @@ -52,8 +52,8 @@ class ListDataStoresRequest extends \Google\Protobuf\Internal\Message */ protected $page_token = ''; /** - * Filter by solution type. For example: filter = - * 'solution_type:SOLUTION_TYPE_SEARCH' + * Filter by solution type . + * For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` * * Generated from protobuf field string filter = 4; */ @@ -108,8 +108,8 @@ public static function build(string $parent): self * must match the call that provided the page token. Otherwise, an * INVALID_ARGUMENT error is returned. * @type string $filter - * Filter by solution type. For example: filter = - * 'solution_type:SOLUTION_TYPE_SEARCH' + * Filter by solution type . + * For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` * } */ public function __construct($data = NULL) { @@ -228,8 +228,8 @@ public function setPageToken($var) } /** - * Filter by solution type. For example: filter = - * 'solution_type:SOLUTION_TYPE_SEARCH' + * Filter by solution type . + * For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` * * Generated from protobuf field string filter = 4; * @return string @@ -240,8 +240,8 @@ public function getFilter() } /** - * Filter by solution type. For example: filter = - * 'solution_type:SOLUTION_TYPE_SEARCH' + * Filter by solution type . + * For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` * * Generated from protobuf field string filter = 4; * @param string $var diff --git a/DiscoveryEngine/src/V1/ListDocumentsRequest.php b/DiscoveryEngine/src/V1/ListDocumentsRequest.php index 11df71d42554..42d68af993e2 100644 --- a/DiscoveryEngine/src/V1/ListDocumentsRequest.php +++ b/DiscoveryEngine/src/V1/ListDocumentsRequest.php @@ -33,7 +33,7 @@ class ListDocumentsRequest extends \Google\Protobuf\Internal\Message /** * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to * return. If unspecified, defaults to 100. The maximum allowed value is 1000. - * Values above 1000 will be coerced to 1000. + * Values above 1000 are set to 1000. * If this field is negative, an `INVALID_ARGUMENT` error is returned. * * Generated from protobuf field int32 page_size = 2; @@ -94,7 +94,7 @@ public static function build(string $parent): self * @type int $page_size * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to * return. If unspecified, defaults to 100. The maximum allowed value is 1000. - * Values above 1000 will be coerced to 1000. + * Values above 1000 are set to 1000. * If this field is negative, an `INVALID_ARGUMENT` error is returned. * @type string $page_token * A page token @@ -156,7 +156,7 @@ public function setParent($var) /** * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to * return. If unspecified, defaults to 100. The maximum allowed value is 1000. - * Values above 1000 will be coerced to 1000. + * Values above 1000 are set to 1000. * If this field is negative, an `INVALID_ARGUMENT` error is returned. * * Generated from protobuf field int32 page_size = 2; @@ -170,7 +170,7 @@ public function getPageSize() /** * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to * return. If unspecified, defaults to 100. The maximum allowed value is 1000. - * Values above 1000 will be coerced to 1000. + * Values above 1000 are set to 1000. * If this field is negative, an `INVALID_ARGUMENT` error is returned. * * Generated from protobuf field int32 page_size = 2; diff --git a/DiscoveryEngine/src/V1/ListSchemasRequest.php b/DiscoveryEngine/src/V1/ListSchemasRequest.php index d627a855cfeb..4a3e130261ec 100644 --- a/DiscoveryEngine/src/V1/ListSchemasRequest.php +++ b/DiscoveryEngine/src/V1/ListSchemasRequest.php @@ -28,8 +28,8 @@ class ListSchemasRequest extends \Google\Protobuf\Internal\Message * The maximum number of [Schema][google.cloud.discoveryengine.v1.Schema]s to * return. The service may return fewer than this value. * If unspecified, at most 100 - * [Schema][google.cloud.discoveryengine.v1.Schema]s will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * [Schema][google.cloud.discoveryengine.v1.Schema]s are returned. + * The maximum value is 1000; values above 1000 are set to 1000. * * Generated from protobuf field int32 page_size = 2; */ @@ -74,8 +74,8 @@ public static function build(string $parent): self * The maximum number of [Schema][google.cloud.discoveryengine.v1.Schema]s to * return. The service may return fewer than this value. * If unspecified, at most 100 - * [Schema][google.cloud.discoveryengine.v1.Schema]s will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * [Schema][google.cloud.discoveryengine.v1.Schema]s are returned. + * The maximum value is 1000; values above 1000 are set to 1000. * @type string $page_token * A page token, received from a previous * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1.SchemaService.ListSchemas] @@ -122,8 +122,8 @@ public function setParent($var) * The maximum number of [Schema][google.cloud.discoveryengine.v1.Schema]s to * return. The service may return fewer than this value. * If unspecified, at most 100 - * [Schema][google.cloud.discoveryengine.v1.Schema]s will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * [Schema][google.cloud.discoveryengine.v1.Schema]s are returned. + * The maximum value is 1000; values above 1000 are set to 1000. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -137,8 +137,8 @@ public function getPageSize() * The maximum number of [Schema][google.cloud.discoveryengine.v1.Schema]s to * return. The service may return fewer than this value. * If unspecified, at most 100 - * [Schema][google.cloud.discoveryengine.v1.Schema]s will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * [Schema][google.cloud.discoveryengine.v1.Schema]s are returned. + * The maximum value is 1000; values above 1000 are set to 1000. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/DiscoveryEngine/src/V1/ListSessionsRequest.php b/DiscoveryEngine/src/V1/ListSessionsRequest.php new file mode 100644 index 000000000000..ce9a4ffb95c8 --- /dev/null +++ b/DiscoveryEngine/src/V1/ListSessionsRequest.php @@ -0,0 +1,274 @@ +google.cloud.discoveryengine.v1.ListSessionsRequest + */ +class ListSessionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token, received from a previous `ListSessions` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * A filter to apply on the list results. The supported features are: + * user_pseudo_id, state. + * Example: + * "user_pseudo_id = some_id" + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `update_time` + * * `create_time` + * * `session_name` + * Example: + * "update_time desc" + * "create_time" + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1\ListSessionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @type int $page_size + * Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * @type string $page_token + * A page token, received from a previous `ListSessions` call. + * Provide this to retrieve the subsequent page. + * @type string $filter + * A filter to apply on the list results. The supported features are: + * user_pseudo_id, state. + * Example: + * "user_pseudo_id = some_id" + * @type string $order_by + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `update_time` + * * `create_time` + * * `session_name` + * Example: + * "update_time desc" + * "create_time" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, received from a previous `ListSessions` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListSessions` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * A filter to apply on the list results. The supported features are: + * user_pseudo_id, state. + * Example: + * "user_pseudo_id = some_id" + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A filter to apply on the list results. The supported features are: + * user_pseudo_id, state. + * Example: + * "user_pseudo_id = some_id" + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `update_time` + * * `create_time` + * * `session_name` + * Example: + * "update_time desc" + * "create_time" + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `update_time` + * * `create_time` + * * `session_name` + * Example: + * "update_time desc" + * "create_time" + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/ListSessionsResponse.php b/DiscoveryEngine/src/V1/ListSessionsResponse.php new file mode 100644 index 000000000000..118e667831b1 --- /dev/null +++ b/DiscoveryEngine/src/V1/ListSessionsResponse.php @@ -0,0 +1,101 @@ +google.cloud.discoveryengine.v1.ListSessionsResponse + */ +class ListSessionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All the Sessions for a given data store. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Session sessions = 1; + */ + private $sessions; + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\Session>|\Google\Protobuf\Internal\RepeatedField $sessions + * All the Sessions for a given data store. + * @type string $next_page_token + * Pagination token, if not returned indicates the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * All the Sessions for a given data store. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Session sessions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSessions() + { + return $this->sessions; + } + + /** + * All the Sessions for a given data store. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Session sessions = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Session>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSessions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Session::class); + $this->sessions = $arr; + + return $this; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/Project.php b/DiscoveryEngine/src/V1/Project.php new file mode 100644 index 000000000000..bb68bc5df75e --- /dev/null +++ b/DiscoveryEngine/src/V1/Project.php @@ -0,0 +1,213 @@ +google.cloud.discoveryengine.v1.Project + */ +class Project extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Full resource name of the project, for example + * `projects/{project_number}`. + * Note that when making requests, project number and project id are both + * acceptable, but the server will always respond in project number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The timestamp when this project is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when this project is successfully provisioned. + * Empty value means this project is still provisioning and is not ready for + * use. + * + * Generated from protobuf field .google.protobuf.Timestamp provision_completion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $provision_completion_time = null; + /** + * Output only. A map of terms of services. The key is the `id` of + * [ServiceTerms][google.cloud.discoveryengine.v1.Project.ServiceTerms]. + * + * Generated from protobuf field map service_terms_map = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $service_terms_map; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Full resource name of the project, for example + * `projects/{project_number}`. + * Note that when making requests, project number and project id are both + * acceptable, but the server will always respond in project number. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when this project is created. + * @type \Google\Protobuf\Timestamp $provision_completion_time + * Output only. The timestamp when this project is successfully provisioned. + * Empty value means this project is still provisioning and is not ready for + * use. + * @type array|\Google\Protobuf\Internal\MapField $service_terms_map + * Output only. A map of terms of services. The key is the `id` of + * [ServiceTerms][google.cloud.discoveryengine.v1.Project.ServiceTerms]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Project::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Full resource name of the project, for example + * `projects/{project_number}`. + * Note that when making requests, project number and project id are both + * acceptable, but the server will always respond in project number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Full resource name of the project, for example + * `projects/{project_number}`. + * Note that when making requests, project number and project id are both + * acceptable, but the server will always respond in project number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The timestamp when this project is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when this project is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when this project is successfully provisioned. + * Empty value means this project is still provisioning and is not ready for + * use. + * + * Generated from protobuf field .google.protobuf.Timestamp provision_completion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getProvisionCompletionTime() + { + return $this->provision_completion_time; + } + + public function hasProvisionCompletionTime() + { + return isset($this->provision_completion_time); + } + + public function clearProvisionCompletionTime() + { + unset($this->provision_completion_time); + } + + /** + * Output only. The timestamp when this project is successfully provisioned. + * Empty value means this project is still provisioning and is not ready for + * use. + * + * Generated from protobuf field .google.protobuf.Timestamp provision_completion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setProvisionCompletionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->provision_completion_time = $var; + + return $this; + } + + /** + * Output only. A map of terms of services. The key is the `id` of + * [ServiceTerms][google.cloud.discoveryengine.v1.Project.ServiceTerms]. + * + * Generated from protobuf field map service_terms_map = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getServiceTermsMap() + { + return $this->service_terms_map; + } + + /** + * Output only. A map of terms of services. The key is the `id` of + * [ServiceTerms][google.cloud.discoveryengine.v1.Project.ServiceTerms]. + * + * Generated from protobuf field map service_terms_map = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setServiceTermsMap($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Project\ServiceTerms::class); + $this->service_terms_map = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/Project/ServiceTerms.php b/DiscoveryEngine/src/V1/Project/ServiceTerms.php new file mode 100644 index 000000000000..ddd7a44c991f --- /dev/null +++ b/DiscoveryEngine/src/V1/Project/ServiceTerms.php @@ -0,0 +1,264 @@ +google.cloud.discoveryengine.v1.Project.ServiceTerms + */ +class ServiceTerms extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of this terms of service. + * Available terms: + * * `GA_DATA_USE_TERMS`: [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). When using this as + * `id`, the acceptable + * [version][google.cloud.discoveryengine.v1.Project.ServiceTerms.version] + * to provide is `2022-11-23`. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * The version string of the terms of service. + * For acceptable values, see the comments for + * [id][google.cloud.discoveryengine.v1.Project.ServiceTerms.id] above. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * Whether the project has accepted/rejected the service terms or it is + * still pending. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Project.ServiceTerms.State state = 4; + */ + protected $state = 0; + /** + * The last time when the project agreed to the terms of service. + * + * Generated from protobuf field .google.protobuf.Timestamp accept_time = 5; + */ + protected $accept_time = null; + /** + * The last time when the project declined or revoked the agreement to terms + * of service. + * + * Generated from protobuf field .google.protobuf.Timestamp decline_time = 6; + */ + protected $decline_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The unique identifier of this terms of service. + * Available terms: + * * `GA_DATA_USE_TERMS`: [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). When using this as + * `id`, the acceptable + * [version][google.cloud.discoveryengine.v1.Project.ServiceTerms.version] + * to provide is `2022-11-23`. + * @type string $version + * The version string of the terms of service. + * For acceptable values, see the comments for + * [id][google.cloud.discoveryengine.v1.Project.ServiceTerms.id] above. + * @type int $state + * Whether the project has accepted/rejected the service terms or it is + * still pending. + * @type \Google\Protobuf\Timestamp $accept_time + * The last time when the project agreed to the terms of service. + * @type \Google\Protobuf\Timestamp $decline_time + * The last time when the project declined or revoked the agreement to terms + * of service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Project::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of this terms of service. + * Available terms: + * * `GA_DATA_USE_TERMS`: [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). When using this as + * `id`, the acceptable + * [version][google.cloud.discoveryengine.v1.Project.ServiceTerms.version] + * to provide is `2022-11-23`. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The unique identifier of this terms of service. + * Available terms: + * * `GA_DATA_USE_TERMS`: [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). When using this as + * `id`, the acceptable + * [version][google.cloud.discoveryengine.v1.Project.ServiceTerms.version] + * to provide is `2022-11-23`. + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The version string of the terms of service. + * For acceptable values, see the comments for + * [id][google.cloud.discoveryengine.v1.Project.ServiceTerms.id] above. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The version string of the terms of service. + * For acceptable values, see the comments for + * [id][google.cloud.discoveryengine.v1.Project.ServiceTerms.id] above. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Whether the project has accepted/rejected the service terms or it is + * still pending. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Project.ServiceTerms.State state = 4; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Whether the project has accepted/rejected the service terms or it is + * still pending. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Project.ServiceTerms.State state = 4; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\Project\ServiceTerms\State::class); + $this->state = $var; + + return $this; + } + + /** + * The last time when the project agreed to the terms of service. + * + * Generated from protobuf field .google.protobuf.Timestamp accept_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAcceptTime() + { + return $this->accept_time; + } + + public function hasAcceptTime() + { + return isset($this->accept_time); + } + + public function clearAcceptTime() + { + unset($this->accept_time); + } + + /** + * The last time when the project agreed to the terms of service. + * + * Generated from protobuf field .google.protobuf.Timestamp accept_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAcceptTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->accept_time = $var; + + return $this; + } + + /** + * The last time when the project declined or revoked the agreement to terms + * of service. + * + * Generated from protobuf field .google.protobuf.Timestamp decline_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeclineTime() + { + return $this->decline_time; + } + + public function hasDeclineTime() + { + return isset($this->decline_time); + } + + public function clearDeclineTime() + { + unset($this->decline_time); + } + + /** + * The last time when the project declined or revoked the agreement to terms + * of service. + * + * Generated from protobuf field .google.protobuf.Timestamp decline_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeclineTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->decline_time = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/Project/ServiceTerms/State.php b/DiscoveryEngine/src/V1/Project/ServiceTerms/State.php new file mode 100644 index 000000000000..a41802e86321 --- /dev/null +++ b/DiscoveryEngine/src/V1/Project/ServiceTerms/State.php @@ -0,0 +1,69 @@ +google.cloud.discoveryengine.v1.Project.ServiceTerms.State + */ +class State +{ + /** + * The default value of the enum. This value is not actually used. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The project has given consent to the terms of service. + * + * Generated from protobuf enum TERMS_ACCEPTED = 1; + */ + const TERMS_ACCEPTED = 1; + /** + * The project is pending to review and accept the terms of service. + * + * Generated from protobuf enum TERMS_PENDING = 2; + */ + const TERMS_PENDING = 2; + /** + * The project has declined or revoked the agreement to terms of service. + * + * Generated from protobuf enum TERMS_DECLINED = 3; + */ + const TERMS_DECLINED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::TERMS_ACCEPTED => 'TERMS_ACCEPTED', + self::TERMS_PENDING => 'TERMS_PENDING', + self::TERMS_DECLINED => 'TERMS_DECLINED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DiscoveryEngine/src/V1/ProvisionProjectMetadata.php b/DiscoveryEngine/src/V1/ProvisionProjectMetadata.php new file mode 100644 index 000000000000..95f9296757ae --- /dev/null +++ b/DiscoveryEngine/src/V1/ProvisionProjectMetadata.php @@ -0,0 +1,33 @@ +google.cloud.discoveryengine.v1.ProvisionProjectMetadata + */ +class ProvisionProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ProjectService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/DiscoveryEngine/src/V1/ProvisionProjectRequest.php b/DiscoveryEngine/src/V1/ProvisionProjectRequest.php new file mode 100644 index 000000000000..51a94f5db321 --- /dev/null +++ b/DiscoveryEngine/src/V1/ProvisionProjectRequest.php @@ -0,0 +1,181 @@ +google.cloud.discoveryengine.v1.ProvisionProjectRequest + */ +class ProvisionProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1.Project], such as + * `projects/{project_id_or_number}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Set to `true` to specify that caller has read and would like to + * give consent to the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). + * + * Generated from protobuf field bool accept_data_use_terms = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $accept_data_use_terms = false; + /** + * Required. The version of the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms) that caller has read + * and would like to give consent to. + * Acceptable version is `2022-11-23`, and this may change over time. + * + * Generated from protobuf field string data_use_terms_version = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_use_terms_version = ''; + + /** + * @param string $name Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1.Project], such as + * `projects/{project_id_or_number}`. Please see + * {@see ProjectServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1\ProvisionProjectRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1.Project], such as + * `projects/{project_id_or_number}`. + * @type bool $accept_data_use_terms + * Required. Set to `true` to specify that caller has read and would like to + * give consent to the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). + * @type string $data_use_terms_version + * Required. The version of the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms) that caller has read + * and would like to give consent to. + * Acceptable version is `2022-11-23`, and this may change over time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ProjectService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1.Project], such as + * `projects/{project_id_or_number}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1.Project], such as + * `projects/{project_id_or_number}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Set to `true` to specify that caller has read and would like to + * give consent to the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). + * + * Generated from protobuf field bool accept_data_use_terms = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getAcceptDataUseTerms() + { + return $this->accept_data_use_terms; + } + + /** + * Required. Set to `true` to specify that caller has read and would like to + * give consent to the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). + * + * Generated from protobuf field bool accept_data_use_terms = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setAcceptDataUseTerms($var) + { + GPBUtil::checkBool($var); + $this->accept_data_use_terms = $var; + + return $this; + } + + /** + * Required. The version of the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms) that caller has read + * and would like to give consent to. + * Acceptable version is `2022-11-23`, and this may change over time. + * + * Generated from protobuf field string data_use_terms_version = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataUseTermsVersion() + { + return $this->data_use_terms_version; + } + + /** + * Required. The version of the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms) that caller has read + * and would like to give consent to. + * Acceptable version is `2022-11-23`, and this may change over time. + * + * Generated from protobuf field string data_use_terms_version = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataUseTermsVersion($var) + { + GPBUtil::checkString($var, True); + $this->data_use_terms_version = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/Query.php b/DiscoveryEngine/src/V1/Query.php new file mode 100644 index 000000000000..e6c4300bb212 --- /dev/null +++ b/DiscoveryEngine/src/V1/Query.php @@ -0,0 +1,109 @@ +google.cloud.discoveryengine.v1.Query + */ +class Query extends \Google\Protobuf\Internal\Message +{ + /** + * Unique Id for the query. + * + * Generated from protobuf field string query_id = 1; + */ + protected $query_id = ''; + protected $content; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Plain text. + * @type string $query_id + * Unique Id for the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Session::initOnce(); + parent::__construct($data); + } + + /** + * Plain text. + * + * Generated from protobuf field string text = 2; + * @return string + */ + public function getText() + { + return $this->readOneof(2); + } + + public function hasText() + { + return $this->hasOneof(2); + } + + /** + * Plain text. + * + * Generated from protobuf field string text = 2; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Unique Id for the query. + * + * Generated from protobuf field string query_id = 1; + * @return string + */ + public function getQueryId() + { + return $this->query_id; + } + + /** + * Unique Id for the query. + * + * Generated from protobuf field string query_id = 1; + * @param string $var + * @return $this + */ + public function setQueryId($var) + { + GPBUtil::checkString($var, True); + $this->query_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->whichOneof("content"); + } + +} + diff --git a/DiscoveryEngine/src/V1/RankRequest.php b/DiscoveryEngine/src/V1/RankRequest.php new file mode 100644 index 000000000000..2a243f093ecb --- /dev/null +++ b/DiscoveryEngine/src/V1/RankRequest.php @@ -0,0 +1,352 @@ +google.cloud.discoveryengine.v1.RankRequest + */ +class RankRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the rank service config, such as + * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + * + * Generated from protobuf field string ranking_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $ranking_config = ''; + /** + * The identifier of the model to use. It is one of: + * * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input + * token size 512. + * It is set to `semantic-ranker-512@latest` by default if unspecified. + * + * Generated from protobuf field string model = 2; + */ + protected $model = ''; + /** + * The number of results to return. If this is unset or no bigger than zero, + * returns all results. + * + * Generated from protobuf field int32 top_n = 3; + */ + protected $top_n = 0; + /** + * The query to use. + * + * Generated from protobuf field string query = 4; + */ + protected $query = ''; + /** + * Required. A list of records to rank. At most 200 records to rank. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + private $records; + /** + * If true, the response will contain only record ID and score. By default, it + * is false, the response will contain record details. + * + * Generated from protobuf field bool ignore_record_details_in_response = 6; + */ + protected $ignore_record_details_in_response = false; + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 7; + */ + private $user_labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ranking_config + * Required. The resource name of the rank service config, such as + * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + * @type string $model + * The identifier of the model to use. It is one of: + * * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input + * token size 512. + * It is set to `semantic-ranker-512@latest` by default if unspecified. + * @type int $top_n + * The number of results to return. If this is unset or no bigger than zero, + * returns all results. + * @type string $query + * The query to use. + * @type array<\Google\Cloud\DiscoveryEngine\V1\RankingRecord>|\Google\Protobuf\Internal\RepeatedField $records + * Required. A list of records to rank. At most 200 records to rank. + * @type bool $ignore_record_details_in_response + * If true, the response will contain only record ID and score. By default, it + * is false, the response will contain record details. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\RankService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the rank service config, such as + * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + * + * Generated from protobuf field string ranking_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getRankingConfig() + { + return $this->ranking_config; + } + + /** + * Required. The resource name of the rank service config, such as + * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + * + * Generated from protobuf field string ranking_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRankingConfig($var) + { + GPBUtil::checkString($var, True); + $this->ranking_config = $var; + + return $this; + } + + /** + * The identifier of the model to use. It is one of: + * * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input + * token size 512. + * It is set to `semantic-ranker-512@latest` by default if unspecified. + * + * Generated from protobuf field string model = 2; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * The identifier of the model to use. It is one of: + * * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input + * token size 512. + * It is set to `semantic-ranker-512@latest` by default if unspecified. + * + * Generated from protobuf field string model = 2; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * The number of results to return. If this is unset or no bigger than zero, + * returns all results. + * + * Generated from protobuf field int32 top_n = 3; + * @return int + */ + public function getTopN() + { + return $this->top_n; + } + + /** + * The number of results to return. If this is unset or no bigger than zero, + * returns all results. + * + * Generated from protobuf field int32 top_n = 3; + * @param int $var + * @return $this + */ + public function setTopN($var) + { + GPBUtil::checkInt32($var); + $this->top_n = $var; + + return $this; + } + + /** + * The query to use. + * + * Generated from protobuf field string query = 4; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * The query to use. + * + * Generated from protobuf field string query = 4; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Required. A list of records to rank. At most 200 records to rank. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRecords() + { + return $this->records; + } + + /** + * Required. A list of records to rank. At most 200 records to rank. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\DiscoveryEngine\V1\RankingRecord>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRecords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\RankingRecord::class); + $this->records = $arr; + + return $this; + } + + /** + * If true, the response will contain only record ID and score. By default, it + * is false, the response will contain record details. + * + * Generated from protobuf field bool ignore_record_details_in_response = 6; + * @return bool + */ + public function getIgnoreRecordDetailsInResponse() + { + return $this->ignore_record_details_in_response; + } + + /** + * If true, the response will contain only record ID and score. By default, it + * is false, the response will contain record details. + * + * Generated from protobuf field bool ignore_record_details_in_response = 6; + * @param bool $var + * @return $this + */ + public function setIgnoreRecordDetailsInResponse($var) + { + GPBUtil::checkBool($var); + $this->ignore_record_details_in_response = $var; + + return $this; + } + + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 7; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/RankResponse.php b/DiscoveryEngine/src/V1/RankResponse.php new file mode 100644 index 000000000000..d03a029e4612 --- /dev/null +++ b/DiscoveryEngine/src/V1/RankResponse.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.RankResponse + */ +class RankResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of records sorted by descending score. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.RankingRecord records = 5; + */ + private $records; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\RankingRecord>|\Google\Protobuf\Internal\RepeatedField $records + * A list of records sorted by descending score. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\RankService::initOnce(); + parent::__construct($data); + } + + /** + * A list of records sorted by descending score. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.RankingRecord records = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRecords() + { + return $this->records; + } + + /** + * A list of records sorted by descending score. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.RankingRecord records = 5; + * @param array<\Google\Cloud\DiscoveryEngine\V1\RankingRecord>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRecords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\RankingRecord::class); + $this->records = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/RankingRecord.php b/DiscoveryEngine/src/V1/RankingRecord.php new file mode 100644 index 000000000000..5c907094e8d2 --- /dev/null +++ b/DiscoveryEngine/src/V1/RankingRecord.php @@ -0,0 +1,202 @@ +google.cloud.discoveryengine.v1.RankingRecord + */ +class RankingRecord extends \Google\Protobuf\Internal\Message +{ + /** + * The unique ID to represent the record. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * The title of the record. Empty by default. + * At least one of + * [title][google.cloud.discoveryengine.v1.RankingRecord.title] or + * [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be + * set otherwise an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field string title = 2; + */ + protected $title = ''; + /** + * The content of the record. Empty by default. + * At least one of + * [title][google.cloud.discoveryengine.v1.RankingRecord.title] or + * [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be + * set otherwise an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field string content = 3; + */ + protected $content = ''; + /** + * The score of this record based on the given query and selected model. + * + * Generated from protobuf field float score = 4; + */ + protected $score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The unique ID to represent the record. + * @type string $title + * The title of the record. Empty by default. + * At least one of + * [title][google.cloud.discoveryengine.v1.RankingRecord.title] or + * [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be + * set otherwise an INVALID_ARGUMENT error is thrown. + * @type string $content + * The content of the record. Empty by default. + * At least one of + * [title][google.cloud.discoveryengine.v1.RankingRecord.title] or + * [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be + * set otherwise an INVALID_ARGUMENT error is thrown. + * @type float $score + * The score of this record based on the given query and selected model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\RankService::initOnce(); + parent::__construct($data); + } + + /** + * The unique ID to represent the record. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The unique ID to represent the record. + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The title of the record. Empty by default. + * At least one of + * [title][google.cloud.discoveryengine.v1.RankingRecord.title] or + * [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be + * set otherwise an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field string title = 2; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The title of the record. Empty by default. + * At least one of + * [title][google.cloud.discoveryengine.v1.RankingRecord.title] or + * [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be + * set otherwise an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field string title = 2; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The content of the record. Empty by default. + * At least one of + * [title][google.cloud.discoveryengine.v1.RankingRecord.title] or + * [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be + * set otherwise an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field string content = 3; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * The content of the record. Empty by default. + * At least one of + * [title][google.cloud.discoveryengine.v1.RankingRecord.title] or + * [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be + * set otherwise an INVALID_ARGUMENT error is thrown. + * + * Generated from protobuf field string content = 3; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * The score of this record based on the given query and selected model. + * + * Generated from protobuf field float score = 4; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * The score of this record based on the given query and selected model. + * + * Generated from protobuf field float score = 4; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/RecommendRequest.php b/DiscoveryEngine/src/V1/RecommendRequest.php index 60a6de5550df..9e45b718daf4 100644 --- a/DiscoveryEngine/src/V1/RecommendRequest.php +++ b/DiscoveryEngine/src/V1/RecommendRequest.php @@ -20,7 +20,7 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` @@ -53,9 +53,9 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message protected $user_event = null; /** * Maximum number of results to return. Set this property - * to the number of recommendation results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * to the number of recommendation results needed. If zero, the service + * chooses a reasonable default. The maximum allowed value is 100. Values + * above 100 are set to 100. * * Generated from protobuf field int32 page_size = 3; */ @@ -73,21 +73,21 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie")) * * (available: true) AND * (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) - * If your filter blocks all results, the API will return generic + * If your filter blocks all results, the API returns generic * (unfiltered) popular Documents. If you only want results strictly matching - * the filters, set `strictFiltering` to True in + * the filters, set `strictFiltering` to `true` in * [RecommendRequest.params][google.cloud.discoveryengine.v1.RecommendRequest.params] * to receive empty results instead. - * Note that the API will never return + * Note that the API never returns * [Document][google.cloud.discoveryengine.v1.Document]s with `storageStatus` - * of `EXPIRED` or `DELETED` regardless of filter choices. + * as `EXPIRED` or `DELETED` regardless of filter choices. * * Generated from protobuf field string filter = 4; */ protected $filter = ''; /** - * Use validate only mode for this recommendation query. If set to true, a - * fake model will be used that returns arbitrary Document IDs. + * Use validate only mode for this recommendation query. If set to `true`, a + * fake model is used that returns arbitrary Document IDs. * Note that the validate only mode should only be used for testing the API, * or if the model is not ready. * @@ -97,16 +97,17 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message /** * Additional domain specific parameters for the recommendations. * Allowed values: - * * `returnDocument`: Boolean. If set to true, the associated Document - * object will be returned in + * * `returnDocument`: Boolean. If set to `true`, the associated Document + * object is returned in * [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1.RecommendResponse.RecommendationResult.document]. - * * `returnScore`: Boolean. If set to true, the recommendation 'score' - * corresponding to each returned Document will be set in + * * `returnScore`: Boolean. If set to true, the recommendation score + * corresponding to each returned Document is set in * [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1.RecommendResponse.RecommendationResult.metadata]. - * The given 'score' indicates the probability of a Document conversion - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular Documents instead of empty if + * The given score indicates the probability of a Document conversion given + * the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to `false`, the + * service + * returns generic (unfiltered) popular Documents instead of empty if * your filter blocks all recommendation results. * * `diversityLevel`: String. Default empty. If set to be non-empty, then * it needs to be one of: @@ -156,7 +157,7 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` @@ -181,9 +182,9 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * unset. * @type int $page_size * Maximum number of results to return. Set this property - * to the number of recommendation results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * to the number of recommendation results needed. If zero, the service + * chooses a reasonable default. The maximum allowed value is 100. Values + * above 100 are set to 100. * @type string $filter * Filter for restricting recommendation results with a length limit of 5,000 * characters. Currently, only filter expressions on the `filter_tags` @@ -197,32 +198,33 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie")) * * (available: true) AND * (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) - * If your filter blocks all results, the API will return generic + * If your filter blocks all results, the API returns generic * (unfiltered) popular Documents. If you only want results strictly matching - * the filters, set `strictFiltering` to True in + * the filters, set `strictFiltering` to `true` in * [RecommendRequest.params][google.cloud.discoveryengine.v1.RecommendRequest.params] * to receive empty results instead. - * Note that the API will never return + * Note that the API never returns * [Document][google.cloud.discoveryengine.v1.Document]s with `storageStatus` - * of `EXPIRED` or `DELETED` regardless of filter choices. + * as `EXPIRED` or `DELETED` regardless of filter choices. * @type bool $validate_only - * Use validate only mode for this recommendation query. If set to true, a - * fake model will be used that returns arbitrary Document IDs. + * Use validate only mode for this recommendation query. If set to `true`, a + * fake model is used that returns arbitrary Document IDs. * Note that the validate only mode should only be used for testing the API, * or if the model is not ready. * @type array|\Google\Protobuf\Internal\MapField $params * Additional domain specific parameters for the recommendations. * Allowed values: - * * `returnDocument`: Boolean. If set to true, the associated Document - * object will be returned in + * * `returnDocument`: Boolean. If set to `true`, the associated Document + * object is returned in * [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1.RecommendResponse.RecommendationResult.document]. - * * `returnScore`: Boolean. If set to true, the recommendation 'score' - * corresponding to each returned Document will be set in + * * `returnScore`: Boolean. If set to true, the recommendation score + * corresponding to each returned Document is set in * [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1.RecommendResponse.RecommendationResult.metadata]. - * The given 'score' indicates the probability of a Document conversion - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular Documents instead of empty if + * The given score indicates the probability of a Document conversion given + * the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to `false`, the + * service + * returns generic (unfiltered) popular Documents instead of empty if * your filter blocks all recommendation results. * * `diversityLevel`: String. Default empty. If set to be non-empty, then * it needs to be one of: @@ -264,7 +266,7 @@ public function __construct($data = NULL) { * `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` @@ -285,7 +287,7 @@ public function getServingConfig() * `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` @@ -371,9 +373,9 @@ public function setUserEvent($var) /** * Maximum number of results to return. Set this property - * to the number of recommendation results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * to the number of recommendation results needed. If zero, the service + * chooses a reasonable default. The maximum allowed value is 100. Values + * above 100 are set to 100. * * Generated from protobuf field int32 page_size = 3; * @return int @@ -385,9 +387,9 @@ public function getPageSize() /** * Maximum number of results to return. Set this property - * to the number of recommendation results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * to the number of recommendation results needed. If zero, the service + * chooses a reasonable default. The maximum allowed value is 100. Values + * above 100 are set to 100. * * Generated from protobuf field int32 page_size = 3; * @param int $var @@ -414,14 +416,14 @@ public function setPageSize($var) * * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie")) * * (available: true) AND * (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) - * If your filter blocks all results, the API will return generic + * If your filter blocks all results, the API returns generic * (unfiltered) popular Documents. If you only want results strictly matching - * the filters, set `strictFiltering` to True in + * the filters, set `strictFiltering` to `true` in * [RecommendRequest.params][google.cloud.discoveryengine.v1.RecommendRequest.params] * to receive empty results instead. - * Note that the API will never return + * Note that the API never returns * [Document][google.cloud.discoveryengine.v1.Document]s with `storageStatus` - * of `EXPIRED` or `DELETED` regardless of filter choices. + * as `EXPIRED` or `DELETED` regardless of filter choices. * * Generated from protobuf field string filter = 4; * @return string @@ -444,14 +446,14 @@ public function getFilter() * * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie")) * * (available: true) AND * (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) - * If your filter blocks all results, the API will return generic + * If your filter blocks all results, the API returns generic * (unfiltered) popular Documents. If you only want results strictly matching - * the filters, set `strictFiltering` to True in + * the filters, set `strictFiltering` to `true` in * [RecommendRequest.params][google.cloud.discoveryengine.v1.RecommendRequest.params] * to receive empty results instead. - * Note that the API will never return + * Note that the API never returns * [Document][google.cloud.discoveryengine.v1.Document]s with `storageStatus` - * of `EXPIRED` or `DELETED` regardless of filter choices. + * as `EXPIRED` or `DELETED` regardless of filter choices. * * Generated from protobuf field string filter = 4; * @param string $var @@ -466,8 +468,8 @@ public function setFilter($var) } /** - * Use validate only mode for this recommendation query. If set to true, a - * fake model will be used that returns arbitrary Document IDs. + * Use validate only mode for this recommendation query. If set to `true`, a + * fake model is used that returns arbitrary Document IDs. * Note that the validate only mode should only be used for testing the API, * or if the model is not ready. * @@ -480,8 +482,8 @@ public function getValidateOnly() } /** - * Use validate only mode for this recommendation query. If set to true, a - * fake model will be used that returns arbitrary Document IDs. + * Use validate only mode for this recommendation query. If set to `true`, a + * fake model is used that returns arbitrary Document IDs. * Note that the validate only mode should only be used for testing the API, * or if the model is not ready. * @@ -500,16 +502,17 @@ public function setValidateOnly($var) /** * Additional domain specific parameters for the recommendations. * Allowed values: - * * `returnDocument`: Boolean. If set to true, the associated Document - * object will be returned in + * * `returnDocument`: Boolean. If set to `true`, the associated Document + * object is returned in * [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1.RecommendResponse.RecommendationResult.document]. - * * `returnScore`: Boolean. If set to true, the recommendation 'score' - * corresponding to each returned Document will be set in + * * `returnScore`: Boolean. If set to true, the recommendation score + * corresponding to each returned Document is set in * [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1.RecommendResponse.RecommendationResult.metadata]. - * The given 'score' indicates the probability of a Document conversion - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular Documents instead of empty if + * The given score indicates the probability of a Document conversion given + * the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to `false`, the + * service + * returns generic (unfiltered) popular Documents instead of empty if * your filter blocks all recommendation results. * * `diversityLevel`: String. Default empty. If set to be non-empty, then * it needs to be one of: @@ -535,16 +538,17 @@ public function getParams() /** * Additional domain specific parameters for the recommendations. * Allowed values: - * * `returnDocument`: Boolean. If set to true, the associated Document - * object will be returned in + * * `returnDocument`: Boolean. If set to `true`, the associated Document + * object is returned in * [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1.RecommendResponse.RecommendationResult.document]. - * * `returnScore`: Boolean. If set to true, the recommendation 'score' - * corresponding to each returned Document will be set in + * * `returnScore`: Boolean. If set to true, the recommendation score + * corresponding to each returned Document is set in * [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1.RecommendResponse.RecommendationResult.metadata]. - * The given 'score' indicates the probability of a Document conversion - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular Documents instead of empty if + * The given score indicates the probability of a Document conversion given + * the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to `false`, the + * service + * returns generic (unfiltered) popular Documents instead of empty if * your filter blocks all recommendation results. * * `diversityLevel`: String. Default empty. If set to be non-empty, then * it needs to be one of: diff --git a/DiscoveryEngine/src/V1/RecommendResponse/RecommendationResult.php b/DiscoveryEngine/src/V1/RecommendResponse/RecommendationResult.php index 998dd2b90468..fa8719e71aca 100644 --- a/DiscoveryEngine/src/V1/RecommendResponse/RecommendationResult.php +++ b/DiscoveryEngine/src/V1/RecommendResponse/RecommendationResult.php @@ -30,7 +30,7 @@ class RecommendationResult extends \Google\Protobuf\Internal\Message */ protected $document = null; /** - * Additional Document metadata / annotations. + * Additional Document metadata or annotations. * Possible values: * * `score`: Recommendation score in double value. Is set if * `returnScore` is set to true in @@ -52,7 +52,7 @@ class RecommendationResult extends \Google\Protobuf\Internal\Message * Set if `returnDocument` is set to true in * [RecommendRequest.params][google.cloud.discoveryengine.v1.RecommendRequest.params]. * @type array|\Google\Protobuf\Internal\MapField $metadata - * Additional Document metadata / annotations. + * Additional Document metadata or annotations. * Possible values: * * `score`: Recommendation score in double value. Is set if * `returnScore` is set to true in @@ -129,7 +129,7 @@ public function setDocument($var) } /** - * Additional Document metadata / annotations. + * Additional Document metadata or annotations. * Possible values: * * `score`: Recommendation score in double value. Is set if * `returnScore` is set to true in @@ -144,7 +144,7 @@ public function getMetadata() } /** - * Additional Document metadata / annotations. + * Additional Document metadata or annotations. * Possible values: * * `score`: Recommendation score in double value. Is set if * `returnScore` is set to true in diff --git a/DiscoveryEngine/src/V1/SearchRequest.php b/DiscoveryEngine/src/V1/SearchRequest.php index 891ac3eb8723..a941a9fbb1bd 100644 --- a/DiscoveryEngine/src/V1/SearchRequest.php +++ b/DiscoveryEngine/src/V1/SearchRequest.php @@ -86,7 +86,10 @@ class SearchRequest extends \Google\Protobuf\Internal\Message */ protected $offset = 0; /** - * A list of data store specs to apply on a search call. + * Specs defining dataStores to filter on in a search call and configurations + * for those dataStores. This is only considered for engines with multiple + * dataStores use case. For single dataStore within an engine, they should + * use the specs at the top level. * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec data_store_specs = 32; */ @@ -127,7 +130,8 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * The order in which documents are returned. Documents can be ordered by * a field in an [Document][google.cloud.discoveryengine.v1.Document] object. * Leave it unset if ordered by relevance. `order_by` expression is - * case-sensitive. For more information on ordering, see + * case-sensitive. + * For more information on ordering for retail search, see * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. * @@ -154,7 +158,7 @@ class SearchRequest extends \Google\Protobuf\Internal\Message /** * Boost specification to boost certain documents. * For more information on boosting, see - * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) * * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; */ @@ -164,15 +168,13 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * For public website search only, supported values are: * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. - * Example: - * user_country_code: "au" + * For example, `user_country_code: "au"` * For available codes see [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * Example: - * search_type: 1 + * For example, `search_type: 1` * * Generated from protobuf field map params = 11; */ @@ -288,7 +290,10 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * unset. * If this field is negative, an `INVALID_ARGUMENT` is returned. * @type array<\Google\Cloud\DiscoveryEngine\V1\SearchRequest\DataStoreSpec>|\Google\Protobuf\Internal\RepeatedField $data_store_specs - * A list of data store specs to apply on a search call. + * Specs defining dataStores to filter on in a search call and configurations + * for those dataStores. This is only considered for engines with multiple + * dataStores use case. For single dataStore within an engine, they should + * use the specs at the top level. * @type string $filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the documents being filtered. Filter @@ -317,7 +322,8 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * The order in which documents are returned. Documents can be ordered by * a field in an [Document][google.cloud.discoveryengine.v1.Document] object. * Leave it unset if ordered by relevance. `order_by` expression is - * case-sensitive. For more information on ordering, see + * case-sensitive. + * For more information on ordering for retail search, see * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. * @type \Google\Cloud\DiscoveryEngine\V1\UserInfo $user_info @@ -332,21 +338,19 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec $boost_spec * Boost specification to boost certain documents. * For more information on boosting, see - * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) * @type array|\Google\Protobuf\Internal\MapField $params * Additional search parameters. * For public website search only, supported values are: * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. - * Example: - * user_country_code: "au" + * For example, `user_country_code: "au"` * For available codes see [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * Example: - * search_type: 1 + * For example, `search_type: 1` * @type \Google\Cloud\DiscoveryEngine\V1\SearchRequest\QueryExpansionSpec $query_expansion_spec * The query expansion specification that specifies the conditions under which * query expansion occurs. @@ -638,7 +642,10 @@ public function setOffset($var) } /** - * A list of data store specs to apply on a search call. + * Specs defining dataStores to filter on in a search call and configurations + * for those dataStores. This is only considered for engines with multiple + * dataStores use case. For single dataStore within an engine, they should + * use the specs at the top level. * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec data_store_specs = 32; * @return \Google\Protobuf\Internal\RepeatedField @@ -649,7 +656,10 @@ public function getDataStoreSpecs() } /** - * A list of data store specs to apply on a search call. + * Specs defining dataStores to filter on in a search call and configurations + * for those dataStores. This is only considered for engines with multiple + * dataStores use case. For single dataStore within an engine, they should + * use the specs at the top level. * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec data_store_specs = 32; * @param array<\Google\Cloud\DiscoveryEngine\V1\SearchRequest\DataStoreSpec>|\Google\Protobuf\Internal\RepeatedField $var @@ -759,7 +769,8 @@ public function setCanonicalFilter($var) * The order in which documents are returned. Documents can be ordered by * a field in an [Document][google.cloud.discoveryengine.v1.Document] object. * Leave it unset if ordered by relevance. `order_by` expression is - * case-sensitive. For more information on ordering, see + * case-sensitive. + * For more information on ordering for retail search, see * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. * @@ -775,7 +786,8 @@ public function getOrderBy() * The order in which documents are returned. Documents can be ordered by * a field in an [Document][google.cloud.discoveryengine.v1.Document] object. * Leave it unset if ordered by relevance. `order_by` expression is - * case-sensitive. For more information on ordering, see + * case-sensitive. + * For more information on ordering for retail search, see * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. * @@ -866,7 +878,7 @@ public function setFacetSpecs($var) /** * Boost specification to boost certain documents. * For more information on boosting, see - * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) * * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; * @return \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec|null @@ -889,7 +901,7 @@ public function clearBoostSpec() /** * Boost specification to boost certain documents. * For more information on boosting, see - * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) * * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; * @param \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec $var @@ -908,15 +920,13 @@ public function setBoostSpec($var) * For public website search only, supported values are: * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. - * Example: - * user_country_code: "au" + * For example, `user_country_code: "au"` * For available codes see [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * Example: - * search_type: 1 + * For example, `search_type: 1` * * Generated from protobuf field map params = 11; * @return \Google\Protobuf\Internal\MapField @@ -931,15 +941,13 @@ public function getParams() * For public website search only, supported values are: * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. - * Example: - * user_country_code: "au" + * For example, `user_country_code: "au"` * For available codes see [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * Example: - * search_type: 1 + * For example, `search_type: 1` * * Generated from protobuf field map params = 11; * @param array|\Google\Protobuf\Internal\MapField $var diff --git a/DiscoveryEngine/src/V1/SearchRequest/DataStoreSpec.php b/DiscoveryEngine/src/V1/SearchRequest/DataStoreSpec.php index 3cc0381b4bf9..ff68448289ac 100644 --- a/DiscoveryEngine/src/V1/SearchRequest/DataStoreSpec.php +++ b/DiscoveryEngine/src/V1/SearchRequest/DataStoreSpec.php @@ -9,7 +9,9 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A struct to define data stores to filter on in a search call. + * A struct to define data stores to filter on in a search call and + * configurations for those data stores. A maximum of 1 DataStoreSpec per + * data_store is allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. * * Generated from protobuf message google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec */ diff --git a/DiscoveryEngine/src/V1/SearchRequest/FacetSpec.php b/DiscoveryEngine/src/V1/SearchRequest/FacetSpec.php index 6589ebb53cbf..8063f6467656 100644 --- a/DiscoveryEngine/src/V1/SearchRequest/FacetSpec.php +++ b/DiscoveryEngine/src/V1/SearchRequest/FacetSpec.php @@ -22,7 +22,7 @@ class FacetSpec extends \Google\Protobuf\Internal\Message */ protected $facet_key = null; /** - * Maximum of facet values that should be returned for this facet. If + * Maximum facet values that are returned for this facet. If * unspecified, defaults to 20. The maximum allowed value is 300. Values * above 300 are coerced to 300. * If this field is negative, an `INVALID_ARGUMENT` is returned. @@ -94,7 +94,7 @@ class FacetSpec extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DiscoveryEngine\V1\SearchRequest\FacetSpec\FacetKey $facet_key * Required. The facet key specification. * @type int $limit - * Maximum of facet values that should be returned for this facet. If + * Maximum facet values that are returned for this facet. If * unspecified, defaults to 20. The maximum allowed value is 300. Values * above 300 are coerced to 300. * If this field is negative, an `INVALID_ARGUMENT` is returned. @@ -188,7 +188,7 @@ public function setFacetKey($var) } /** - * Maximum of facet values that should be returned for this facet. If + * Maximum facet values that are returned for this facet. If * unspecified, defaults to 20. The maximum allowed value is 300. Values * above 300 are coerced to 300. * If this field is negative, an `INVALID_ARGUMENT` is returned. @@ -202,7 +202,7 @@ public function getLimit() } /** - * Maximum of facet values that should be returned for this facet. If + * Maximum facet values that are returned for this facet. If * unspecified, defaults to 20. The maximum allowed value is 300. Values * above 300 are coerced to 300. * If this field is negative, an `INVALID_ARGUMENT` is returned. diff --git a/DiscoveryEngine/src/V1/SearchRequest/FacetSpec/FacetKey.php b/DiscoveryEngine/src/V1/SearchRequest/FacetSpec/FacetKey.php index 5dd094abf2a7..bcbe8c31acec 100644 --- a/DiscoveryEngine/src/V1/SearchRequest/FacetSpec/FacetKey.php +++ b/DiscoveryEngine/src/V1/SearchRequest/FacetSpec/FacetKey.php @@ -53,7 +53,7 @@ class FacetKey extends \Google\Protobuf\Internal\Message */ private $prefixes; /** - * Only get facet values that contains the given strings. For example, + * Only get facet values that contain the given strings. For example, * suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". @@ -116,7 +116,7 @@ class FacetKey extends \Google\Protobuf\Internal\Message * "category" facet only contains "Action > 2022" and "Action > 2021". * Only supported on textual fields. Maximum is 10. * @type array|\Google\Protobuf\Internal\RepeatedField $contains - * Only get facet values that contains the given strings. For example, + * Only get facet values that contain the given strings. For example, * suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". @@ -276,7 +276,7 @@ public function setPrefixes($var) } /** - * Only get facet values that contains the given strings. For example, + * Only get facet values that contain the given strings. For example, * suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". @@ -291,7 +291,7 @@ public function getContains() } /** - * Only get facet values that contains the given strings. For example, + * Only get facet values that contain the given strings. For example, * suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". diff --git a/DiscoveryEngine/src/V1/SearchRequest/SpellCorrectionSpec.php b/DiscoveryEngine/src/V1/SearchRequest/SpellCorrectionSpec.php index d845679e3907..622ad565c9dc 100644 --- a/DiscoveryEngine/src/V1/SearchRequest/SpellCorrectionSpec.php +++ b/DiscoveryEngine/src/V1/SearchRequest/SpellCorrectionSpec.php @@ -16,8 +16,8 @@ class SpellCorrectionSpec extends \Google\Protobuf\Internal\Message { /** - * The mode under which spell correction should take effect to - * replace the original search query. Default to + * The mode under which spell correction + * replaces the original search query. Defaults to * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. * * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; @@ -31,8 +31,8 @@ class SpellCorrectionSpec extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $mode - * The mode under which spell correction should take effect to - * replace the original search query. Default to + * The mode under which spell correction + * replaces the original search query. Defaults to * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. * } */ @@ -42,8 +42,8 @@ public function __construct($data = NULL) { } /** - * The mode under which spell correction should take effect to - * replace the original search query. Default to + * The mode under which spell correction + * replaces the original search query. Defaults to * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. * * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; @@ -55,8 +55,8 @@ public function getMode() } /** - * The mode under which spell correction should take effect to - * replace the original search query. Default to + * The mode under which spell correction + * replaces the original search query. Defaults to * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. * * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; diff --git a/DiscoveryEngine/src/V1/SearchRequest/SpellCorrectionSpec/Mode.php b/DiscoveryEngine/src/V1/SearchRequest/SpellCorrectionSpec/Mode.php index 4fee90010c4d..d3eb833b1536 100644 --- a/DiscoveryEngine/src/V1/SearchRequest/SpellCorrectionSpec/Mode.php +++ b/DiscoveryEngine/src/V1/SearchRequest/SpellCorrectionSpec/Mode.php @@ -22,10 +22,10 @@ class Mode */ const MODE_UNSPECIFIED = 0; /** - * Search API will try to find a spell suggestion if there - * is any and put in the + * Search API tries to find a spelling suggestion. If a suggestion is + * found, it is put in the * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1.SearchResponse.corrected_query]. - * The spell suggestion will not be used as the search query. + * The spelling suggestion won't be used as the search query. * * Generated from protobuf enum SUGGESTION_ONLY = 1; */ diff --git a/DiscoveryEngine/src/V1/SearchResponse/Facet.php b/DiscoveryEngine/src/V1/SearchResponse/Facet.php index d57671e24b3d..3e84dbe49ee4 100644 --- a/DiscoveryEngine/src/V1/SearchResponse/Facet.php +++ b/DiscoveryEngine/src/V1/SearchResponse/Facet.php @@ -16,7 +16,7 @@ class Facet extends \Google\Protobuf\Internal\Message { /** - * The key for this facet. E.g., "colors" or "price". It matches + * The key for this facet. For example, `"colors"` or `"price"`. It matches * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]. * * Generated from protobuf field string key = 1; @@ -42,7 +42,7 @@ class Facet extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $key - * The key for this facet. E.g., "colors" or "price". It matches + * The key for this facet. For example, `"colors"` or `"price"`. It matches * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]. * @type array<\Google\Cloud\DiscoveryEngine\V1\SearchResponse\Facet\FacetValue>|\Google\Protobuf\Internal\RepeatedField $values * The facet values for this field. @@ -56,7 +56,7 @@ public function __construct($data = NULL) { } /** - * The key for this facet. E.g., "colors" or "price". It matches + * The key for this facet. For example, `"colors"` or `"price"`. It matches * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]. * * Generated from protobuf field string key = 1; @@ -68,7 +68,7 @@ public function getKey() } /** - * The key for this facet. E.g., "colors" or "price". It matches + * The key for this facet. For example, `"colors"` or `"price"`. It matches * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]. * * Generated from protobuf field string key = 1; diff --git a/DiscoveryEngine/src/V1/SearchResponse/SearchResult.php b/DiscoveryEngine/src/V1/SearchResponse/SearchResult.php index 13b3b7004bd2..6cdb6ffed0a5 100644 --- a/DiscoveryEngine/src/V1/SearchResponse/SearchResult.php +++ b/DiscoveryEngine/src/V1/SearchResponse/SearchResult.php @@ -24,7 +24,7 @@ class SearchResult extends \Google\Protobuf\Internal\Message protected $id = ''; /** * The document data snippet in the search response. Only fields that are - * marked as retrievable are populated. + * marked as `retrievable` are populated. * * Generated from protobuf field .google.cloud.discoveryengine.v1.Document document = 2; */ @@ -41,7 +41,7 @@ class SearchResult extends \Google\Protobuf\Internal\Message * searched [Document][google.cloud.discoveryengine.v1.Document]. * @type \Google\Cloud\DiscoveryEngine\V1\Document $document * The document data snippet in the search response. Only fields that are - * marked as retrievable are populated. + * marked as `retrievable` are populated. * } */ public function __construct($data = NULL) { @@ -79,7 +79,7 @@ public function setId($var) /** * The document data snippet in the search response. Only fields that are - * marked as retrievable are populated. + * marked as `retrievable` are populated. * * Generated from protobuf field .google.cloud.discoveryengine.v1.Document document = 2; * @return \Google\Cloud\DiscoveryEngine\V1\Document|null @@ -101,7 +101,7 @@ public function clearDocument() /** * The document data snippet in the search response. Only fields that are - * marked as retrievable are populated. + * marked as `retrievable` are populated. * * Generated from protobuf field .google.cloud.discoveryengine.v1.Document document = 2; * @param \Google\Cloud\DiscoveryEngine\V1\Document $var diff --git a/DiscoveryEngine/src/V1/SearchResponse/Summary.php b/DiscoveryEngine/src/V1/SearchResponse/Summary.php index 2f56583e2850..96f36103e851 100644 --- a/DiscoveryEngine/src/V1/SearchResponse/Summary.php +++ b/DiscoveryEngine/src/V1/SearchResponse/Summary.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Summary of the top N search result specified by the summary spec. + * Summary of the top N search results specified by the summary spec. * * Generated from protobuf message google.cloud.discoveryengine.v1.SearchResponse.Summary */ diff --git a/DiscoveryEngine/src/V1/SearchUseCase.php b/DiscoveryEngine/src/V1/SearchUseCase.php new file mode 100644 index 000000000000..0392f3a7d88a --- /dev/null +++ b/DiscoveryEngine/src/V1/SearchUseCase.php @@ -0,0 +1,65 @@ +google.cloud.discoveryengine.v1.SearchUseCase + */ +class SearchUseCase +{ + /** + * Value used when unset. Will not occur in CSS. + * + * Generated from protobuf enum SEARCH_USE_CASE_UNSPECIFIED = 0; + */ + const SEARCH_USE_CASE_UNSPECIFIED = 0; + /** + * Search use case. Expects the traffic has a non-empty + * [query][google.cloud.discoveryengine.v1.SearchRequest.query]. + * + * Generated from protobuf enum SEARCH_USE_CASE_SEARCH = 1; + */ + const SEARCH_USE_CASE_SEARCH = 1; + /** + * Browse use case. Expects the traffic has an empty + * [query][google.cloud.discoveryengine.v1.SearchRequest.query]. + * + * Generated from protobuf enum SEARCH_USE_CASE_BROWSE = 2; + */ + const SEARCH_USE_CASE_BROWSE = 2; + + private static $valueToName = [ + self::SEARCH_USE_CASE_UNSPECIFIED => 'SEARCH_USE_CASE_UNSPECIFIED', + self::SEARCH_USE_CASE_SEARCH => 'SEARCH_USE_CASE_SEARCH', + self::SEARCH_USE_CASE_BROWSE => 'SEARCH_USE_CASE_BROWSE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/DiscoveryEngine/src/V1/Session.php b/DiscoveryEngine/src/V1/Session.php new file mode 100644 index 000000000000..293964b9117a --- /dev/null +++ b/DiscoveryEngine/src/V1/Session.php @@ -0,0 +1,261 @@ +google.cloud.discoveryengine.v1.Session + */ +class Session extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Fully qualified name + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * The state of the session. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session.State state = 2; + */ + protected $state = 0; + /** + * A unique identifier for tracking users. + * + * Generated from protobuf field string user_pseudo_id = 3; + */ + protected $user_pseudo_id = ''; + /** + * Turns. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Session.Turn turns = 4; + */ + private $turns; + /** + * Output only. The time the session started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. The time the session finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. Fully qualified name + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` + * @type int $state + * The state of the session. + * @type string $user_pseudo_id + * A unique identifier for tracking users. + * @type array<\Google\Cloud\DiscoveryEngine\V1\Session\Turn>|\Google\Protobuf\Internal\RepeatedField $turns + * Turns. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The time the session started. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the session finished. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Session::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. Fully qualified name + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Fully qualified name + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The state of the session. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the session. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\Session\State::class); + $this->state = $var; + + return $this; + } + + /** + * A unique identifier for tracking users. + * + * Generated from protobuf field string user_pseudo_id = 3; + * @return string + */ + public function getUserPseudoId() + { + return $this->user_pseudo_id; + } + + /** + * A unique identifier for tracking users. + * + * Generated from protobuf field string user_pseudo_id = 3; + * @param string $var + * @return $this + */ + public function setUserPseudoId($var) + { + GPBUtil::checkString($var, True); + $this->user_pseudo_id = $var; + + return $this; + } + + /** + * Turns. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Session.Turn turns = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTurns() + { + return $this->turns; + } + + /** + * Turns. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.Session.Turn turns = 4; + * @param array<\Google\Cloud\DiscoveryEngine\V1\Session\Turn>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTurns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\Session\Turn::class); + $this->turns = $arr; + + return $this; + } + + /** + * Output only. The time the session started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The time the session started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The time the session finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the session finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/Session/State.php b/DiscoveryEngine/src/V1/Session/State.php new file mode 100644 index 000000000000..7990b51b3c52 --- /dev/null +++ b/DiscoveryEngine/src/V1/Session/State.php @@ -0,0 +1,55 @@ +google.cloud.discoveryengine.v1.Session.State + */ +class State +{ + /** + * State is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The session is currently open. + * + * Generated from protobuf enum IN_PROGRESS = 1; + */ + const IN_PROGRESS = 1; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::IN_PROGRESS => 'IN_PROGRESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DiscoveryEngine/src/V1/Session/Turn.php b/DiscoveryEngine/src/V1/Session/Turn.php new file mode 100644 index 000000000000..c23d2946e607 --- /dev/null +++ b/DiscoveryEngine/src/V1/Session/Turn.php @@ -0,0 +1,121 @@ +google.cloud.discoveryengine.v1.Session.Turn + */ +class Turn extends \Google\Protobuf\Internal\Message +{ + /** + * The user query. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Query query = 1; + */ + protected $query = null; + /** + * The resource name of the answer to the user query. + * Only set if the answer generation (/answer API call) happened in this + * turn. + * + * Generated from protobuf field string answer = 2 [(.google.api.resource_reference) = { + */ + protected $answer = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\Query $query + * The user query. + * @type string $answer + * The resource name of the answer to the user query. + * Only set if the answer generation (/answer API call) happened in this + * turn. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\Session::initOnce(); + parent::__construct($data); + } + + /** + * The user query. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Query query = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\Query|null + */ + public function getQuery() + { + return $this->query; + } + + public function hasQuery() + { + return isset($this->query); + } + + public function clearQuery() + { + unset($this->query); + } + + /** + * The user query. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Query query = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\Query $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Query::class); + $this->query = $var; + + return $this; + } + + /** + * The resource name of the answer to the user query. + * Only set if the answer generation (/answer API call) happened in this + * turn. + * + * Generated from protobuf field string answer = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswer() + { + return $this->answer; + } + + /** + * The resource name of the answer to the user query. + * Only set if the answer generation (/answer API call) happened in this + * turn. + * + * Generated from protobuf field string answer = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswer($var) + { + GPBUtil::checkString($var, True); + $this->answer = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/TargetSite.php b/DiscoveryEngine/src/V1/TargetSite.php index f991ccb6758e..f6fcbb604bcf 100644 --- a/DiscoveryEngine/src/V1/TargetSite.php +++ b/DiscoveryEngine/src/V1/TargetSite.php @@ -54,6 +54,12 @@ class TargetSite extends \Google\Protobuf\Internal\Message * Generated from protobuf field string generated_uri_pattern = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $generated_uri_pattern = ''; + /** + * Output only. Root domain of the provided_uri_pattern. + * + * Generated from protobuf field string root_domain_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $root_domain_uri = ''; /** * Output only. Site ownership and validity verification status. * @@ -104,6 +110,8 @@ class TargetSite extends \Google\Protobuf\Internal\Message * generate the URI pattern to be used by the search engine. * @type string $generated_uri_pattern * Output only. This is system-generated based on the provided_uri_pattern. + * @type string $root_domain_uri + * Output only. Root domain of the provided_uri_pattern. * @type \Google\Cloud\DiscoveryEngine\V1\SiteVerificationInfo $site_verification_info * Output only. Site ownership and validity verification status. * @type int $indexing_status @@ -267,6 +275,32 @@ public function setGeneratedUriPattern($var) return $this; } + /** + * Output only. Root domain of the provided_uri_pattern. + * + * Generated from protobuf field string root_domain_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRootDomainUri() + { + return $this->root_domain_uri; + } + + /** + * Output only. Root domain of the provided_uri_pattern. + * + * Generated from protobuf field string root_domain_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRootDomainUri($var) + { + GPBUtil::checkString($var, True); + $this->root_domain_uri = $var; + + return $this; + } + /** * Output only. Site ownership and validity verification status. * diff --git a/DiscoveryEngine/src/V1/UpdateControlRequest.php b/DiscoveryEngine/src/V1/UpdateControlRequest.php new file mode 100644 index 000000000000..52b645c0a237 --- /dev/null +++ b/DiscoveryEngine/src/V1/UpdateControlRequest.php @@ -0,0 +1,163 @@ +google.cloud.discoveryengine.v1.UpdateControlRequest + */ +class UpdateControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Control to update. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control = null; + /** + * Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1.Control] to update. The following + * are NOT supported: + * * [Control.name][google.cloud.discoveryengine.v1.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1.Control.solution_type] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\DiscoveryEngine\V1\Control $control Required. The Control to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1.Control] to update. The following + * are NOT supported: + * + * * [Control.name][google.cloud.discoveryengine.v1.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1.Control.solution_type] + * + * If not set or empty, all supported fields are updated. + * + * @return \Google\Cloud\DiscoveryEngine\V1\UpdateControlRequest + * + * @experimental + */ + public static function build(\Google\Cloud\DiscoveryEngine\V1\Control $control, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setControl($control) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\Control $control + * Required. The Control to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1.Control] to update. The following + * are NOT supported: + * * [Control.name][google.cloud.discoveryengine.v1.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1.Control.solution_type] + * If not set or empty, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Control to update. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DiscoveryEngine\V1\Control|null + */ + public function getControl() + { + return $this->control; + } + + public function hasControl() + { + return isset($this->control); + } + + public function clearControl() + { + unset($this->control); + } + + /** + * Required. The Control to update. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DiscoveryEngine\V1\Control $var + * @return $this + */ + public function setControl($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Control::class); + $this->control = $var; + + return $this; + } + + /** + * Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1.Control] to update. The following + * are NOT supported: + * * [Control.name][google.cloud.discoveryengine.v1.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1.Control.solution_type] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1.Control] to update. The following + * are NOT supported: + * * [Control.name][google.cloud.discoveryengine.v1.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1.Control.solution_type] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/UpdateDocumentRequest.php b/DiscoveryEngine/src/V1/UpdateDocumentRequest.php index 055a7081b703..e7a11d150d48 100644 --- a/DiscoveryEngine/src/V1/UpdateDocumentRequest.php +++ b/DiscoveryEngine/src/V1/UpdateDocumentRequest.php @@ -31,16 +31,16 @@ class UpdateDocumentRequest extends \Google\Protobuf\Internal\Message */ protected $document = null; /** - * If set to true, and the + * If set to `true` and the * [Document][google.cloud.discoveryengine.v1.Document] is not found, a new - * [Document][google.cloud.discoveryengine.v1.Document] will be created. + * [Document][google.cloud.discoveryengine.v1.Document] is be created. * * Generated from protobuf field bool allow_missing = 2; */ protected $allow_missing = false; /** * Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; */ @@ -58,7 +58,7 @@ class UpdateDocumentRequest extends \Google\Protobuf\Internal\Message * [allow_missing][google.cloud.discoveryengine.v1.UpdateDocumentRequest.allow_missing] * is not set, a `NOT_FOUND` error is returned. * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * * @return \Google\Cloud\DiscoveryEngine\V1\UpdateDocumentRequest * @@ -87,12 +87,12 @@ public static function build(\Google\Cloud\DiscoveryEngine\V1\Document $document * [allow_missing][google.cloud.discoveryengine.v1.UpdateDocumentRequest.allow_missing] * is not set, a `NOT_FOUND` error is returned. * @type bool $allow_missing - * If set to true, and the + * If set to `true` and the * [Document][google.cloud.discoveryengine.v1.Document] is not found, a new - * [Document][google.cloud.discoveryengine.v1.Document] will be created. + * [Document][google.cloud.discoveryengine.v1.Document] is be created. * @type \Google\Protobuf\FieldMask $update_mask * Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * } */ public function __construct($data = NULL) { @@ -151,9 +151,9 @@ public function setDocument($var) } /** - * If set to true, and the + * If set to `true` and the * [Document][google.cloud.discoveryengine.v1.Document] is not found, a new - * [Document][google.cloud.discoveryengine.v1.Document] will be created. + * [Document][google.cloud.discoveryengine.v1.Document] is be created. * * Generated from protobuf field bool allow_missing = 2; * @return bool @@ -164,9 +164,9 @@ public function getAllowMissing() } /** - * If set to true, and the + * If set to `true` and the * [Document][google.cloud.discoveryengine.v1.Document] is not found, a new - * [Document][google.cloud.discoveryengine.v1.Document] will be created. + * [Document][google.cloud.discoveryengine.v1.Document] is be created. * * Generated from protobuf field bool allow_missing = 2; * @param bool $var @@ -182,7 +182,7 @@ public function setAllowMissing($var) /** * Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; * @return \Google\Protobuf\FieldMask|null @@ -204,7 +204,7 @@ public function clearUpdateMask() /** * Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; * @param \Google\Protobuf\FieldMask $var diff --git a/DiscoveryEngine/src/V1/UpdateSchemaRequest.php b/DiscoveryEngine/src/V1/UpdateSchemaRequest.php index 1c39456ca86b..f6d44496c191 100644 --- a/DiscoveryEngine/src/V1/UpdateSchemaRequest.php +++ b/DiscoveryEngine/src/V1/UpdateSchemaRequest.php @@ -25,7 +25,7 @@ class UpdateSchemaRequest extends \Google\Protobuf\Internal\Message protected $schema = null; /** * If set to true, and the [Schema][google.cloud.discoveryengine.v1.Schema] is - * not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] will be + * not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] is * created. In this situation, `update_mask` is ignored. * * Generated from protobuf field bool allow_missing = 3; @@ -42,7 +42,7 @@ class UpdateSchemaRequest extends \Google\Protobuf\Internal\Message * Required. The [Schema][google.cloud.discoveryengine.v1.Schema] to update. * @type bool $allow_missing * If set to true, and the [Schema][google.cloud.discoveryengine.v1.Schema] is - * not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] will be + * not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] is * created. In this situation, `update_mask` is ignored. * } */ @@ -89,7 +89,7 @@ public function setSchema($var) /** * If set to true, and the [Schema][google.cloud.discoveryengine.v1.Schema] is - * not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] will be + * not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] is * created. In this situation, `update_mask` is ignored. * * Generated from protobuf field bool allow_missing = 3; @@ -102,7 +102,7 @@ public function getAllowMissing() /** * If set to true, and the [Schema][google.cloud.discoveryengine.v1.Schema] is - * not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] will be + * not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] is * created. In this situation, `update_mask` is ignored. * * Generated from protobuf field bool allow_missing = 3; diff --git a/DiscoveryEngine/src/V1/UpdateSessionRequest.php b/DiscoveryEngine/src/V1/UpdateSessionRequest.php new file mode 100644 index 000000000000..a5e5d5fc46aa --- /dev/null +++ b/DiscoveryEngine/src/V1/UpdateSessionRequest.php @@ -0,0 +1,158 @@ +google.cloud.discoveryengine.v1.UpdateSessionRequest + */ +class UpdateSessionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Session to update. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $session = null; + /** + * Indicates which fields in the provided + * [Session][google.cloud.discoveryengine.v1.Session] to update. The following + * are NOT supported: + * * [Session.name][google.cloud.discoveryengine.v1.Session.name] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\DiscoveryEngine\V1\Session $session Required. The Session to update. + * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided + * [Session][google.cloud.discoveryengine.v1.Session] to update. The following + * are NOT supported: + * + * * [Session.name][google.cloud.discoveryengine.v1.Session.name] + * + * If not set or empty, all supported fields are updated. + * + * @return \Google\Cloud\DiscoveryEngine\V1\UpdateSessionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\DiscoveryEngine\V1\Session $session, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSession($session) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\Session $session + * Required. The Session to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Indicates which fields in the provided + * [Session][google.cloud.discoveryengine.v1.Session] to update. The following + * are NOT supported: + * * [Session.name][google.cloud.discoveryengine.v1.Session.name] + * If not set or empty, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Session to update. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DiscoveryEngine\V1\Session|null + */ + public function getSession() + { + return $this->session; + } + + public function hasSession() + { + return isset($this->session); + } + + public function clearSession() + { + unset($this->session); + } + + /** + * Required. The Session to update. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DiscoveryEngine\V1\Session $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\Session::class); + $this->session = $var; + + return $this; + } + + /** + * Indicates which fields in the provided + * [Session][google.cloud.discoveryengine.v1.Session] to update. The following + * are NOT supported: + * * [Session.name][google.cloud.discoveryengine.v1.Session.name] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Indicates which fields in the provided + * [Session][google.cloud.discoveryengine.v1.Session] to update. The following + * are NOT supported: + * * [Session.name][google.cloud.discoveryengine.v1.Session.name] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/UserEvent.php b/DiscoveryEngine/src/V1/UserEvent.php index c28628645192..e149133811d6 100644 --- a/DiscoveryEngine/src/V1/UserEvent.php +++ b/DiscoveryEngine/src/V1/UserEvent.php @@ -10,7 +10,7 @@ /** * UserEvent captures all metadata information Discovery Engine API needs to - * know about how end users interact with customers' website. + * know about how end users interact with your website. * * Generated from protobuf message google.cloud.discoveryengine.v1.UserEvent */ @@ -52,6 +52,31 @@ class UserEvent extends \Google\Protobuf\Internal\Message * Generated from protobuf field string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ protected $user_pseudo_id = ''; + /** + * The [Engine][google.cloud.discoveryengine.v1.Engine] resource name, in the + * form of + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + * Optional. Only required for + * [Engine][google.cloud.discoveryengine.v1.Engine] produced user events. For + * example, user events from blended search. + * + * Generated from protobuf field string engine = 19 [(.google.api.resource_reference) = { + */ + protected $engine = ''; + /** + * The [DataStore][google.cloud.discoveryengine.v1.DataStore] resource full + * name, of the form + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + * Optional. Only required for user events whose data store can't by + * determined by + * [UserEvent.engine][google.cloud.discoveryengine.v1.UserEvent.engine] or + * [UserEvent.documents][google.cloud.discoveryengine.v1.UserEvent.documents]. + * If data store is set in the parent of write/import/collect user event + * requests, this field can be omitted. + * + * Generated from protobuf field string data_store = 20 [(.google.api.resource_reference) = { + */ + protected $data_store = ''; /** * Only required for * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents] @@ -195,7 +220,7 @@ class UserEvent extends \Google\Protobuf\Internal\Message /** * A list of identifiers for the independent experiment groups this user event * belongs to. This is used to distinguish between user events associated with - * different experiment setups on the customer end. + * different experiment setups. * * Generated from protobuf field repeated string tag_ids = 15; */ @@ -275,6 +300,23 @@ class UserEvent extends \Google\Protobuf\Internal\Message * Analytics [Client * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) * for this field. + * @type string $engine + * The [Engine][google.cloud.discoveryengine.v1.Engine] resource name, in the + * form of + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + * Optional. Only required for + * [Engine][google.cloud.discoveryengine.v1.Engine] produced user events. For + * example, user events from blended search. + * @type string $data_store + * The [DataStore][google.cloud.discoveryengine.v1.DataStore] resource full + * name, of the form + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + * Optional. Only required for user events whose data store can't by + * determined by + * [UserEvent.engine][google.cloud.discoveryengine.v1.UserEvent.engine] or + * [UserEvent.documents][google.cloud.discoveryengine.v1.UserEvent.documents]. + * If data store is set in the parent of write/import/collect user event + * requests, this field can be omitted. * @type \Google\Protobuf\Timestamp $event_time * Only required for * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents] @@ -370,7 +412,7 @@ class UserEvent extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\RepeatedField $tag_ids * A list of identifiers for the independent experiment groups this user event * belongs to. This is used to distinguish between user events associated with - * different experiment setups on the customer end. + * different experiment setups. * @type array|\Google\Protobuf\Internal\RepeatedField $promotion_ids * The promotion IDs if this is an event associated with promotions. * Currently, this field is restricted to at most one ID. @@ -506,6 +548,84 @@ public function setUserPseudoId($var) return $this; } + /** + * The [Engine][google.cloud.discoveryengine.v1.Engine] resource name, in the + * form of + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + * Optional. Only required for + * [Engine][google.cloud.discoveryengine.v1.Engine] produced user events. For + * example, user events from blended search. + * + * Generated from protobuf field string engine = 19 [(.google.api.resource_reference) = { + * @return string + */ + public function getEngine() + { + return $this->engine; + } + + /** + * The [Engine][google.cloud.discoveryengine.v1.Engine] resource name, in the + * form of + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + * Optional. Only required for + * [Engine][google.cloud.discoveryengine.v1.Engine] produced user events. For + * example, user events from blended search. + * + * Generated from protobuf field string engine = 19 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEngine($var) + { + GPBUtil::checkString($var, True); + $this->engine = $var; + + return $this; + } + + /** + * The [DataStore][google.cloud.discoveryengine.v1.DataStore] resource full + * name, of the form + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + * Optional. Only required for user events whose data store can't by + * determined by + * [UserEvent.engine][google.cloud.discoveryengine.v1.UserEvent.engine] or + * [UserEvent.documents][google.cloud.discoveryengine.v1.UserEvent.documents]. + * If data store is set in the parent of write/import/collect user event + * requests, this field can be omitted. + * + * Generated from protobuf field string data_store = 20 [(.google.api.resource_reference) = { + * @return string + */ + public function getDataStore() + { + return $this->data_store; + } + + /** + * The [DataStore][google.cloud.discoveryengine.v1.DataStore] resource full + * name, of the form + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + * Optional. Only required for user events whose data store can't by + * determined by + * [UserEvent.engine][google.cloud.discoveryengine.v1.UserEvent.engine] or + * [UserEvent.documents][google.cloud.discoveryengine.v1.UserEvent.documents]. + * If data store is set in the parent of write/import/collect user event + * requests, this field can be omitted. + * + * Generated from protobuf field string data_store = 20 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataStore($var) + { + GPBUtil::checkString($var, True); + $this->data_store = $var; + + return $this; + } + /** * Only required for * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents] @@ -1027,7 +1147,7 @@ public function setTransactionInfo($var) /** * A list of identifiers for the independent experiment groups this user event * belongs to. This is used to distinguish between user events associated with - * different experiment setups on the customer end. + * different experiment setups. * * Generated from protobuf field repeated string tag_ids = 15; * @return \Google\Protobuf\Internal\RepeatedField @@ -1040,7 +1160,7 @@ public function getTagIds() /** * A list of identifiers for the independent experiment groups this user event * belongs to. This is used to distinguish between user events associated with - * different experiment setups on the customer end. + * different experiment setups. * * Generated from protobuf field repeated string tag_ids = 15; * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/DiscoveryEngine/src/V1/WriteUserEventRequest.php b/DiscoveryEngine/src/V1/WriteUserEventRequest.php index f83195066deb..c3694fc7145a 100644 --- a/DiscoveryEngine/src/V1/WriteUserEventRequest.php +++ b/DiscoveryEngine/src/V1/WriteUserEventRequest.php @@ -16,8 +16,16 @@ class WriteUserEventRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The parent DataStore resource name, such as + * Required. The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1.DataStore] level, the format + * is: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1.DataStore], the format is: + * `projects/{project}/locations/{location}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -28,6 +36,13 @@ class WriteUserEventRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional .google.cloud.discoveryengine.v1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; */ protected $user_event = null; + /** + * If set to true, the user event is written asynchronously after + * validation, and the API responds without waiting for the write. + * + * Generated from protobuf field bool write_async = 3; + */ + protected $write_async = false; /** * Constructor. @@ -36,10 +51,21 @@ class WriteUserEventRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The parent DataStore resource name, such as + * Required. The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1.DataStore] level, the format + * is: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1.DataStore], the format is: + * `projects/{project}/locations/{location}`. * @type \Google\Cloud\DiscoveryEngine\V1\UserEvent $user_event * Required. User event to write. + * @type bool $write_async + * If set to true, the user event is written asynchronously after + * validation, and the API responds without waiting for the write. * } */ public function __construct($data = NULL) { @@ -48,8 +74,16 @@ public function __construct($data = NULL) { } /** - * Required. The parent DataStore resource name, such as + * Required. The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1.DataStore] level, the format + * is: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1.DataStore], the format is: + * `projects/{project}/locations/{location}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -60,8 +94,16 @@ public function getParent() } /** - * Required. The parent DataStore resource name, such as + * Required. The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1.DataStore] level, the format + * is: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1.DataStore], the format is: + * `projects/{project}/locations/{location}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -111,5 +153,33 @@ public function setUserEvent($var) return $this; } + /** + * If set to true, the user event is written asynchronously after + * validation, and the API responds without waiting for the write. + * + * Generated from protobuf field bool write_async = 3; + * @return bool + */ + public function getWriteAsync() + { + return $this->write_async; + } + + /** + * If set to true, the user event is written asynchronously after + * validation, and the API responds without waiting for the write. + * + * Generated from protobuf field bool write_async = 3; + * @param bool $var + * @return $this + */ + public function setWriteAsync($var) + { + GPBUtil::checkBool($var); + $this->write_async = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1/gapic_metadata.json b/DiscoveryEngine/src/V1/gapic_metadata.json index d41389e464c8..335b9e1831da 100644 --- a/DiscoveryEngine/src/V1/gapic_metadata.json +++ b/DiscoveryEngine/src/V1/gapic_metadata.json @@ -29,6 +29,40 @@ } } }, + "ControlService": { + "clients": { + "grpc": { + "libraryClient": "ControlServiceGapicClient", + "rpcs": { + "CreateControl": { + "methods": [ + "createControl" + ] + }, + "DeleteControl": { + "methods": [ + "deleteControl" + ] + }, + "GetControl": { + "methods": [ + "getControl" + ] + }, + "ListControls": { + "methods": [ + "listControls" + ] + }, + "UpdateControl": { + "methods": [ + "updateControl" + ] + } + } + } + } + }, "SearchService": { "clients": { "grpc": { @@ -48,6 +82,11 @@ "grpc": { "libraryClient": "ConversationalSearchServiceGapicClient", "rpcs": { + "AnswerQuery": { + "methods": [ + "answerQuery" + ] + }, "ConverseConversation": { "methods": [ "converseConversation" @@ -58,25 +97,55 @@ "createConversation" ] }, + "CreateSession": { + "methods": [ + "createSession" + ] + }, "DeleteConversation": { "methods": [ "deleteConversation" ] }, + "DeleteSession": { + "methods": [ + "deleteSession" + ] + }, + "GetAnswer": { + "methods": [ + "getAnswer" + ] + }, "GetConversation": { "methods": [ "getConversation" ] }, + "GetSession": { + "methods": [ + "getSession" + ] + }, "ListConversations": { "methods": [ "listConversations" ] }, + "ListSessions": { + "methods": [ + "listSessions" + ] + }, "UpdateConversation": { "methods": [ "updateConversation" ] + }, + "UpdateSession": { + "methods": [ + "updateSession" + ] } } } @@ -194,6 +263,48 @@ } } }, + "GroundedGenerationService": { + "clients": { + "grpc": { + "libraryClient": "GroundedGenerationServiceGapicClient", + "rpcs": { + "CheckGrounding": { + "methods": [ + "checkGrounding" + ] + } + } + } + } + }, + "ProjectService": { + "clients": { + "grpc": { + "libraryClient": "ProjectServiceGapicClient", + "rpcs": { + "ProvisionProject": { + "methods": [ + "provisionProject" + ] + } + } + } + } + }, + "RankService": { + "clients": { + "grpc": { + "libraryClient": "RankServiceGapicClient", + "rpcs": { + "Rank": { + "methods": [ + "rank" + ] + } + } + } + } + }, "RecommendationService": { "clients": { "grpc": { diff --git a/DiscoveryEngine/src/V1/resources/completion_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/completion_service_rest_client_config.php index 6b9858e46dc9..22950780b83b 100644 --- a/DiscoveryEngine/src/V1/resources/completion_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/completion_service_rest_client_config.php @@ -80,6 +80,30 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1/resources/control_service_client_config.json b/DiscoveryEngine/src/V1/resources/control_service_client_config.json new file mode 100644 index 000000000000..33605a623944 --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/control_service_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1.ControlService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "CreateControl": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "DeleteControl": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "GetControl": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "ListControls": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "UpdateControl": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + } + } + } + } +} diff --git a/DiscoveryEngine/src/V1/resources/control_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/control_service_descriptor_config.php new file mode 100644 index 000000000000..700f71e26f1b --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/control_service_descriptor_config.php @@ -0,0 +1,107 @@ + [ + 'google.cloud.discoveryengine.v1.ControlService' => [ + 'CreateControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\Control', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\Control', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListControls' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getControls', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\ListControlsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\Control', + 'headerParams' => [ + [ + 'keyName' => 'control.name', + 'fieldAccessors' => [ + 'getControl', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'control' => 'projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control}', + 'dataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', + 'engine' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}', + 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', + 'projectLocationCollectionDataStoreControl' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/controls/{control}', + 'projectLocationCollectionEngineControl' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/controls/{control}', + 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', + 'projectLocationDataStoreControl' => 'projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control}', + ], + ], + ], +]; diff --git a/DiscoveryEngine/src/V1/resources/control_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/control_service_rest_client_config.php new file mode 100644 index 000000000000..9e195e14c0a3 --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/control_service_rest_client_config.php @@ -0,0 +1,314 @@ + [ + 'google.cloud.discoveryengine.v1.ControlService' => [ + 'CreateControl' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/dataStores/*}/controls', + 'body' => 'control', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/controls', + 'body' => 'control', + 'queryParams' => [ + 'control_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/collections/*/engines/*}/controls', + 'body' => 'control', + 'queryParams' => [ + 'control_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'control_id', + ], + ], + 'DeleteControl' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/controls/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*/controls/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetControl' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/controls/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*/controls/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListControls' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/dataStores/*}/controls', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/controls', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/collections/*/engines/*}/controls', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateControl' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{control.name=projects/*/locations/*/dataStores/*/controls/*}', + 'body' => 'control', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{control.name=projects/*/locations/*/collections/*/dataStores/*/controls/*}', + 'body' => 'control', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{control.name=projects/*/locations/*/collections/*/engines/*/controls/*}', + 'body' => 'control', + ], + ], + 'placeholders' => [ + 'control.name' => [ + 'getters' => [ + 'getControl', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/DiscoveryEngine/src/V1/resources/conversational_search_service_client_config.json b/DiscoveryEngine/src/V1/resources/conversational_search_service_client_config.json index 4ec412b58543..adf744b2626c 100644 --- a/DiscoveryEngine/src/V1/resources/conversational_search_service_client_config.json +++ b/DiscoveryEngine/src/V1/resources/conversational_search_service_client_config.json @@ -28,6 +28,11 @@ } }, "methods": { + "AnswerQuery": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, "ConverseConversation": { "timeout_millis": 30000, "retry_codes_name": "retry_policy_2_codes", @@ -38,25 +43,55 @@ "retry_codes_name": "retry_policy_2_codes", "retry_params_name": "retry_policy_2_params" }, + "CreateSession": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, "DeleteConversation": { "timeout_millis": 30000, "retry_codes_name": "retry_policy_2_codes", "retry_params_name": "retry_policy_2_params" }, + "DeleteSession": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "GetAnswer": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, "GetConversation": { "timeout_millis": 30000, "retry_codes_name": "retry_policy_2_codes", "retry_params_name": "retry_policy_2_params" }, + "GetSession": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, "ListConversations": { "timeout_millis": 30000, "retry_codes_name": "retry_policy_2_codes", "retry_params_name": "retry_policy_2_params" }, + "ListSessions": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, "UpdateConversation": { "timeout_millis": 30000, "retry_codes_name": "retry_policy_2_codes", "retry_params_name": "retry_policy_2_params" + }, + "UpdateSession": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" } } } diff --git a/DiscoveryEngine/src/V1/resources/conversational_search_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/conversational_search_service_descriptor_config.php index fa82542ea810..09ebae4664d4 100644 --- a/DiscoveryEngine/src/V1/resources/conversational_search_service_descriptor_config.php +++ b/DiscoveryEngine/src/V1/resources/conversational_search_service_descriptor_config.php @@ -23,6 +23,18 @@ return [ 'interfaces' => [ 'google.cloud.discoveryengine.v1.ConversationalSearchService' => [ + 'AnswerQuery' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\AnswerQueryResponse', + 'headerParams' => [ + [ + 'keyName' => 'serving_config', + 'fieldAccessors' => [ + 'getServingConfig', + ], + ], + ], + ], 'ConverseConversation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\ConverseConversationResponse', @@ -47,6 +59,18 @@ ], ], ], + 'CreateSession' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\Session', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'DeleteConversation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Protobuf\GPBEmpty', @@ -59,6 +83,30 @@ ], ], ], + 'DeleteSession' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAnswer' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\Answer', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetConversation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\Conversation', @@ -71,6 +119,18 @@ ], ], ], + 'GetSession' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\Session', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'ListConversations' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -91,6 +151,26 @@ ], ], ], + 'ListSessions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSessions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\ListSessionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'UpdateConversation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\Conversation', @@ -104,21 +184,45 @@ ], ], ], + 'UpdateSession' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\Session', + 'headerParams' => [ + [ + 'keyName' => 'session.name', + 'fieldAccessors' => [ + 'getSession', + 'getName', + ], + ], + ], + ], 'templateMap' => [ + 'answer' => 'projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}', + 'chunk' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}', 'conversation' => 'projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}', 'dataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', 'document' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}', 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', 'projectLocationCollectionDataStoreBranchDocument' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}', + 'projectLocationCollectionDataStoreBranchDocumentChunk' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}', 'projectLocationCollectionDataStoreConversation' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}', 'projectLocationCollectionDataStoreServingConfig' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}', + 'projectLocationCollectionDataStoreSession' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}', + 'projectLocationCollectionDataStoreSessionAnswer' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}', 'projectLocationCollectionEngineConversation' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}', 'projectLocationCollectionEngineServingConfig' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}', + 'projectLocationCollectionEngineSession' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}', + 'projectLocationCollectionEngineSessionAnswer' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}', 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', 'projectLocationDataStoreBranchDocument' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}', + 'projectLocationDataStoreBranchDocumentChunk' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}', 'projectLocationDataStoreConversation' => 'projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}', 'projectLocationDataStoreServingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}', + 'projectLocationDataStoreSession' => 'projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}', + 'projectLocationDataStoreSessionAnswer' => 'projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}', 'servingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}', + 'session' => 'projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}', ], ], ], diff --git a/DiscoveryEngine/src/V1/resources/conversational_search_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/conversational_search_service_rest_client_config.php index 8c4fc636e456..d2bd41a33ce6 100644 --- a/DiscoveryEngine/src/V1/resources/conversational_search_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/conversational_search_service_rest_client_config.php @@ -23,6 +23,30 @@ return [ 'interfaces' => [ 'google.cloud.discoveryengine.v1.ConversationalSearchService' => [ + 'AnswerQuery' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:answer', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:answer', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:answer', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'serving_config' => [ + 'getters' => [ + 'getServingConfig', + ], + ], + ], + ], 'ConverseConversation' => [ 'method' => 'post', 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}:converse', @@ -71,6 +95,30 @@ ], ], ], + 'CreateSession' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/dataStores/*}/sessions', + 'body' => 'session', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessions', + 'body' => 'session', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions', + 'body' => 'session', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'DeleteConversation' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}', @@ -92,6 +140,48 @@ ], ], ], + 'DeleteSession' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAnswer' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/sessions/*/answers/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*/answers/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*/answers/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetConversation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}', @@ -113,6 +203,27 @@ ], ], ], + 'GetSession' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'ListConversations' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/dataStores/*}/conversations', @@ -134,6 +245,27 @@ ], ], ], + 'ListSessions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/dataStores/*}/sessions', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessions', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'UpdateConversation' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{conversation.name=projects/*/locations/*/dataStores/*/conversations/*}', @@ -159,8 +291,57 @@ ], ], ], + 'UpdateSession' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{session.name=projects/*/locations/*/dataStores/*/sessions/*}', + 'body' => 'session', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{session.name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}', + 'body' => 'session', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{session.name=projects/*/locations/*/collections/*/engines/*/sessions/*}', + 'body' => 'session', + ], + ], + 'placeholders' => [ + 'session.name' => [ + 'getters' => [ + 'getSession', + 'getName', + ], + ], + ], + ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1/resources/data_store_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/data_store_service_descriptor_config.php index dff90f8a0b30..b065b9584949 100644 --- a/DiscoveryEngine/src/V1/resources/data_store_service_descriptor_config.php +++ b/DiscoveryEngine/src/V1/resources/data_store_service_descriptor_config.php @@ -109,9 +109,12 @@ 'templateMap' => [ 'collection' => 'projects/{project}/locations/{location}/collections/{collection}', 'dataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', + 'documentProcessingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/documentProcessingConfig', 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', + 'projectLocationCollectionDataStoreDocumentProcessingConfig' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/documentProcessingConfig', 'projectLocationCollectionDataStoreSchema' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}', 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', + 'projectLocationDataStoreDocumentProcessingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/documentProcessingConfig', 'projectLocationDataStoreSchema' => 'projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}', 'schema' => 'projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}', ], diff --git a/DiscoveryEngine/src/V1/resources/data_store_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/data_store_service_rest_client_config.php index 9776ad0cc278..965a30c026b3 100644 --- a/DiscoveryEngine/src/V1/resources/data_store_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/data_store_service_rest_client_config.php @@ -121,6 +121,30 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1/resources/document_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/document_service_rest_client_config.php index f7db09107acb..9b514246633a 100644 --- a/DiscoveryEngine/src/V1/resources/document_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/document_service_rest_client_config.php @@ -159,6 +159,30 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1/resources/engine_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/engine_service_rest_client_config.php index 16e20b986339..81022f6ae720 100644 --- a/DiscoveryEngine/src/V1/resources/engine_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/engine_service_rest_client_config.php @@ -86,6 +86,30 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1/resources/grounded_generation_service_client_config.json b/DiscoveryEngine/src/V1/resources/grounded_generation_service_client_config.json new file mode 100644 index 000000000000..7ee5457d398f --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/grounded_generation_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1.GroundedGenerationService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 5000, + "initial_rpc_timeout_millis": 5000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000, + "total_timeout_millis": 5000 + } + }, + "methods": { + "CheckGrounding": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/DiscoveryEngine/src/V1/resources/grounded_generation_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/grounded_generation_service_descriptor_config.php new file mode 100644 index 000000000000..4049f6280469 --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/grounded_generation_service_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.cloud.discoveryengine.v1.GroundedGenerationService' => [ + 'CheckGrounding' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\CheckGroundingResponse', + 'headerParams' => [ + [ + 'keyName' => 'grounding_config', + 'fieldAccessors' => [ + 'getGroundingConfig', + ], + ], + ], + ], + 'templateMap' => [ + 'groundingConfig' => 'projects/{project}/locations/{location}/groundingConfigs/{grounding_config}', + ], + ], + ], +]; diff --git a/DiscoveryEngine/src/V1/resources/grounded_generation_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/grounded_generation_service_rest_client_config.php new file mode 100644 index 000000000000..fef1e9b8b780 --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/grounded_generation_service_rest_client_config.php @@ -0,0 +1,205 @@ + [ + 'google.cloud.discoveryengine.v1.GroundedGenerationService' => [ + 'CheckGrounding' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{grounding_config=projects/*/locations/*/groundingConfigs/*}:check', + 'body' => '*', + 'placeholders' => [ + 'grounding_config' => [ + 'getters' => [ + 'getGroundingConfig', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/DiscoveryEngine/src/V1/resources/project_service_client_config.json b/DiscoveryEngine/src/V1/resources/project_service_client_config.json new file mode 100644 index 000000000000..f839e50fb937 --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/project_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1.ProjectService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "ProvisionProject": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + } + } + } + } +} diff --git a/DiscoveryEngine/src/V1/resources/project_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/project_service_descriptor_config.php new file mode 100644 index 000000000000..c9c26b083790 --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/project_service_descriptor_config.php @@ -0,0 +1,50 @@ + [ + 'google.cloud.discoveryengine.v1.ProjectService' => [ + 'ProvisionProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DiscoveryEngine\V1\Project', + 'metadataReturnType' => '\Google\Cloud\DiscoveryEngine\V1\ProvisionProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/DiscoveryEngine/src/V1/resources/project_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/project_service_rest_client_config.php new file mode 100644 index 000000000000..64dd692a8a98 --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/project_service_rest_client_config.php @@ -0,0 +1,205 @@ + [ + 'google.cloud.discoveryengine.v1.ProjectService' => [ + 'ProvisionProject' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*}:provision', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/DiscoveryEngine/src/V1/resources/rank_service_client_config.json b/DiscoveryEngine/src/V1/resources/rank_service_client_config.json new file mode 100644 index 000000000000..3f12f3704101 --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/rank_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1.RankService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "Rank": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + } + } + } + } +} diff --git a/DiscoveryEngine/src/V1/resources/rank_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/rank_service_descriptor_config.php new file mode 100644 index 000000000000..8bd837aebc52 --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/rank_service_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.cloud.discoveryengine.v1.RankService' => [ + 'Rank' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\RankResponse', + 'headerParams' => [ + [ + 'keyName' => 'ranking_config', + 'fieldAccessors' => [ + 'getRankingConfig', + ], + ], + ], + ], + 'templateMap' => [ + 'rankingConfig' => 'projects/{project}/locations/{location}/rankingConfigs/{ranking_config}', + ], + ], + ], +]; diff --git a/DiscoveryEngine/src/V1/resources/rank_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/rank_service_rest_client_config.php new file mode 100644 index 000000000000..f1fcc383aa1b --- /dev/null +++ b/DiscoveryEngine/src/V1/resources/rank_service_rest_client_config.php @@ -0,0 +1,205 @@ + [ + 'google.cloud.discoveryengine.v1.RankService' => [ + 'Rank' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank', + 'body' => '*', + 'placeholders' => [ + 'ranking_config' => [ + 'getters' => [ + 'getRankingConfig', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/DiscoveryEngine/src/V1/resources/recommendation_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/recommendation_service_descriptor_config.php index 463f52dd0264..06583f9a1429 100644 --- a/DiscoveryEngine/src/V1/resources/recommendation_service_descriptor_config.php +++ b/DiscoveryEngine/src/V1/resources/recommendation_service_descriptor_config.php @@ -36,10 +36,14 @@ ], ], 'templateMap' => [ + 'dataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', 'document' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}', + 'engine' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}', + 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', 'projectLocationCollectionDataStoreBranchDocument' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}', 'projectLocationCollectionDataStoreServingConfig' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}', 'projectLocationCollectionEngineServingConfig' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}', + 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', 'projectLocationDataStoreBranchDocument' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}', 'projectLocationDataStoreServingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}', 'servingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}', diff --git a/DiscoveryEngine/src/V1/resources/recommendation_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/recommendation_service_rest_client_config.php index c0c54df4f420..78aace460236 100644 --- a/DiscoveryEngine/src/V1/resources/recommendation_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/recommendation_service_rest_client_config.php @@ -49,6 +49,30 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1/resources/schema_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/schema_service_rest_client_config.php index 2c993d0fdda4..5154565aade9 100644 --- a/DiscoveryEngine/src/V1/resources/schema_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/schema_service_rest_client_config.php @@ -121,6 +121,30 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1/resources/search_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/search_service_rest_client_config.php index a7c365492eff..11cee7d770af 100644 --- a/DiscoveryEngine/src/V1/resources/search_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/search_service_rest_client_config.php @@ -49,6 +49,30 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1/resources/site_search_engine_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/site_search_engine_service_rest_client_config.php index ffb91db39940..93525742defa 100644 --- a/DiscoveryEngine/src/V1/resources/site_search_engine_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/site_search_engine_service_rest_client_config.php @@ -231,6 +231,30 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1/resources/user_event_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/user_event_service_descriptor_config.php index 8fbb8bc7adbc..1610d39d63da 100644 --- a/DiscoveryEngine/src/V1/resources/user_event_service_descriptor_config.php +++ b/DiscoveryEngine/src/V1/resources/user_event_service_descriptor_config.php @@ -69,6 +69,7 @@ 'templateMap' => [ 'dataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', 'document' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}', + 'engine' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}', 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', 'projectLocationCollectionDataStoreBranchDocument' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}', 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', diff --git a/DiscoveryEngine/src/V1/resources/user_event_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/user_event_service_rest_client_config.php index 5f219ac9cece..f9cfde4c9245 100644 --- a/DiscoveryEngine/src/V1/resources/user_event_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/user_event_service_rest_client_config.php @@ -69,6 +69,11 @@ 'uriTemplate' => '/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:write', 'body' => 'user_event', ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/userEvents:write', + 'body' => 'user_event', + ], ], 'placeholders' => [ 'parent' => [ @@ -80,6 +85,30 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/Answer.php b/DiscoveryEngine/src/V1beta/Answer.php index 23bdd8e6585f..72054a5d1a67 100644 --- a/DiscoveryEngine/src/V1beta/Answer.php +++ b/DiscoveryEngine/src/V1beta/Answer.php @@ -17,7 +17,7 @@ class Answer extends \Google\Protobuf\Internal\Message { /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ @@ -92,7 +92,7 @@ class Answer extends \Google\Protobuf\Internal\Message * * @type string $name * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` * @type int $state * The state of the answer generation. * @type string $answer_text @@ -123,7 +123,7 @@ public function __construct($data = NULL) { /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; * @return string @@ -135,7 +135,7 @@ public function getName() /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; * @param string $var diff --git a/DiscoveryEngine/src/V1beta/Answer/Reference/ChunkInfo/DocumentMetadata.php b/DiscoveryEngine/src/V1beta/Answer/Reference/ChunkInfo/DocumentMetadata.php index 006d9fbc795d..56a3a562a7bb 100644 --- a/DiscoveryEngine/src/V1beta/Answer/Reference/ChunkInfo/DocumentMetadata.php +++ b/DiscoveryEngine/src/V1beta/Answer/Reference/ChunkInfo/DocumentMetadata.php @@ -39,6 +39,13 @@ class DocumentMetadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field string page_identifier = 4; */ protected $page_identifier = ''; + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + */ + protected $struct_data = null; /** * Constructor. @@ -54,6 +61,9 @@ class DocumentMetadata extends \Google\Protobuf\Internal\Message * Title. * @type string $page_identifier * Page identifier. + * @type \Google\Protobuf\Struct $struct_data + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. * } */ public function __construct($data = NULL) { @@ -165,6 +175,44 @@ public function setPageIdentifier($var) return $this; } + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getStructData() + { + return $this->struct_data; + } + + public function hasStructData() + { + return isset($this->struct_data); + } + + public function clearStructData() + { + unset($this->struct_data); + } + + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setStructData($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->struct_data = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/Answer/Reference/UnstructuredDocumentInfo.php b/DiscoveryEngine/src/V1beta/Answer/Reference/UnstructuredDocumentInfo.php index 649c7fb6cc3d..93469abf6b26 100644 --- a/DiscoveryEngine/src/V1beta/Answer/Reference/UnstructuredDocumentInfo.php +++ b/DiscoveryEngine/src/V1beta/Answer/Reference/UnstructuredDocumentInfo.php @@ -39,6 +39,13 @@ class UnstructuredDocumentInfo extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Answer.Reference.UnstructuredDocumentInfo.ChunkContent chunk_contents = 4; */ private $chunk_contents; + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + */ + protected $struct_data = null; /** * Constructor. @@ -54,6 +61,9 @@ class UnstructuredDocumentInfo extends \Google\Protobuf\Internal\Message * Title. * @type array<\Google\Cloud\DiscoveryEngine\V1beta\Answer\Reference\UnstructuredDocumentInfo\ChunkContent>|\Google\Protobuf\Internal\RepeatedField $chunk_contents * List of cited chunk contents derived from document content. + * @type \Google\Protobuf\Struct $struct_data + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. * } */ public function __construct($data = NULL) { @@ -165,6 +175,44 @@ public function setChunkContents($var) return $this; } + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getStructData() + { + return $this->struct_data; + } + + public function hasStructData() + { + return isset($this->struct_data); + } + + public function clearStructData() + { + unset($this->struct_data); + } + + /** + * The structured JSON metadata for the document. + * It is populated from the struct data from the Chunk in search result. + * + * Generated from protobuf field .google.protobuf.Struct struct_data = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setStructData($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->struct_data = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/AnswerQueryRequest.php b/DiscoveryEngine/src/V1beta/AnswerQueryRequest.php index fe1906cf535e..0aa0b6246e84 100644 --- a/DiscoveryEngine/src/V1beta/AnswerQueryRequest.php +++ b/DiscoveryEngine/src/V1beta/AnswerQueryRequest.php @@ -37,8 +37,8 @@ class AnswerQueryRequest extends \Google\Protobuf\Internal\Message /** * The session resource name. Not required. * When session field is not set, the API is in sessionless mode. - * We support auto session mode: users can use the wildcard symbol “-†as - * session id. A new id will be automatically generated and assigned. + * We support auto session mode: users can use the wildcard symbol `-` as + * session ID. A new ID will be automatically generated and assigned. * * Generated from protobuf field string session = 3 [(.google.api.resource_reference) = { */ @@ -117,8 +117,8 @@ class AnswerQueryRequest extends \Google\Protobuf\Internal\Message * @type string $session * The session resource name. Not required. * When session field is not set, the API is in sessionless mode. - * We support auto session mode: users can use the wildcard symbol “-†as - * session id. A new id will be automatically generated and assigned. + * We support auto session mode: users can use the wildcard symbol `-` as + * session ID. A new ID will be automatically generated and assigned. * @type \Google\Cloud\DiscoveryEngine\V1beta\AnswerQueryRequest\SafetySpec $safety_spec * Model specification. * @type \Google\Cloud\DiscoveryEngine\V1beta\AnswerQueryRequest\RelatedQuestionsSpec $related_questions_spec @@ -228,8 +228,8 @@ public function setQuery($var) /** * The session resource name. Not required. * When session field is not set, the API is in sessionless mode. - * We support auto session mode: users can use the wildcard symbol “-†as - * session id. A new id will be automatically generated and assigned. + * We support auto session mode: users can use the wildcard symbol `-` as + * session ID. A new ID will be automatically generated and assigned. * * Generated from protobuf field string session = 3 [(.google.api.resource_reference) = { * @return string @@ -242,8 +242,8 @@ public function getSession() /** * The session resource name. Not required. * When session field is not set, the API is in sessionless mode. - * We support auto session mode: users can use the wildcard symbol “-†as - * session id. A new id will be automatically generated and assigned. + * We support auto session mode: users can use the wildcard symbol `-` as + * session ID. A new ID will be automatically generated and assigned. * * Generated from protobuf field string session = 3 [(.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1beta/AnswerQueryRequest/AnswerGenerationSpec.php b/DiscoveryEngine/src/V1beta/AnswerQueryRequest/AnswerGenerationSpec.php index 1a18bc0799e5..29fcb539875e 100644 --- a/DiscoveryEngine/src/V1beta/AnswerQueryRequest/AnswerGenerationSpec.php +++ b/DiscoveryEngine/src/V1beta/AnswerQueryRequest/AnswerGenerationSpec.php @@ -68,6 +68,15 @@ class AnswerGenerationSpec extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool ignore_non_answer_seeking_query = 6; */ protected $ignore_non_answer_seeking_query = false; + /** + * Specifies whether to filter out queries that have low relevance. + * If this field is set to `false`, all search results are used regardless + * of relevance to generate answers. If set to `true` or unset, the behavior + * will be determined automatically by the service. + * + * Generated from protobuf field optional bool ignore_low_relevant_content = 7; + */ + protected $ignore_low_relevant_content = null; /** * Constructor. @@ -104,6 +113,11 @@ class AnswerGenerationSpec extends \Google\Protobuf\Internal\Message * non-answer seeking query. If this field is set to `true`, we skip * generating answers for non-answer seeking queries and return * fallback messages instead. + * @type bool $ignore_low_relevant_content + * Specifies whether to filter out queries that have low relevance. + * If this field is set to `false`, all search results are used regardless + * of relevance to generate answers. If set to `true` or unset, the behavior + * will be determined automatically by the service. * } */ public function __construct($data = NULL) { @@ -321,6 +335,48 @@ public function setIgnoreNonAnswerSeekingQuery($var) return $this; } + /** + * Specifies whether to filter out queries that have low relevance. + * If this field is set to `false`, all search results are used regardless + * of relevance to generate answers. If set to `true` or unset, the behavior + * will be determined automatically by the service. + * + * Generated from protobuf field optional bool ignore_low_relevant_content = 7; + * @return bool + */ + public function getIgnoreLowRelevantContent() + { + return isset($this->ignore_low_relevant_content) ? $this->ignore_low_relevant_content : false; + } + + public function hasIgnoreLowRelevantContent() + { + return isset($this->ignore_low_relevant_content); + } + + public function clearIgnoreLowRelevantContent() + { + unset($this->ignore_low_relevant_content); + } + + /** + * Specifies whether to filter out queries that have low relevance. + * If this field is set to `false`, all search results are used regardless + * of relevance to generate answers. If set to `true` or unset, the behavior + * will be determined automatically by the service. + * + * Generated from protobuf field optional bool ignore_low_relevant_content = 7; + * @param bool $var + * @return $this + */ + public function setIgnoreLowRelevantContent($var) + { + GPBUtil::checkBool($var); + $this->ignore_low_relevant_content = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/AnswerQueryRequest/QueryUnderstandingSpec/QueryRephraserSpec.php b/DiscoveryEngine/src/V1beta/AnswerQueryRequest/QueryUnderstandingSpec/QueryRephraserSpec.php index 1913fdd4765e..c64a0cc76309 100644 --- a/DiscoveryEngine/src/V1beta/AnswerQueryRequest/QueryUnderstandingSpec/QueryRephraserSpec.php +++ b/DiscoveryEngine/src/V1beta/AnswerQueryRequest/QueryUnderstandingSpec/QueryRephraserSpec.php @@ -23,7 +23,7 @@ class QueryRephraserSpec extends \Google\Protobuf\Internal\Message protected $disable = false; /** * Max rephrase steps. - * The max number is 10 steps. + * The max number is 5 steps. * If not set or set to < 1, it will be set to 1 by default. * * Generated from protobuf field int32 max_rephrase_steps = 2; @@ -40,7 +40,7 @@ class QueryRephraserSpec extends \Google\Protobuf\Internal\Message * Disable query rephraser. * @type int $max_rephrase_steps * Max rephrase steps. - * The max number is 10 steps. + * The max number is 5 steps. * If not set or set to < 1, it will be set to 1 by default. * } */ @@ -77,7 +77,7 @@ public function setDisable($var) /** * Max rephrase steps. - * The max number is 10 steps. + * The max number is 5 steps. * If not set or set to < 1, it will be set to 1 by default. * * Generated from protobuf field int32 max_rephrase_steps = 2; @@ -90,7 +90,7 @@ public function getMaxRephraseSteps() /** * Max rephrase steps. - * The max number is 10 steps. + * The max number is 5 steps. * If not set or set to < 1, it will be set to 1 by default. * * Generated from protobuf field int32 max_rephrase_steps = 2; diff --git a/DiscoveryEngine/src/V1beta/AnswerQueryRequest/SearchSpec/SearchParams.php b/DiscoveryEngine/src/V1beta/AnswerQueryRequest/SearchSpec/SearchParams.php index b77dfa282013..03c49f67a266 100644 --- a/DiscoveryEngine/src/V1beta/AnswerQueryRequest/SearchSpec/SearchParams.php +++ b/DiscoveryEngine/src/V1beta/AnswerQueryRequest/SearchSpec/SearchParams.php @@ -61,6 +61,15 @@ class SearchParams extends \Google\Protobuf\Internal\Message * Generated from protobuf field string order_by = 4; */ protected $order_by = ''; + /** + * Specs defining dataStores to filter on in a search call and + * configurations for those dataStores. This is only considered for + * engines with multiple dataStores use case. For single dataStore within + * an engine, they should use the specs at the top level. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchRequest.DataStoreSpec data_store_specs = 7; + */ + private $data_store_specs; /** * Constructor. @@ -98,6 +107,11 @@ class SearchParams extends \Google\Protobuf\Internal\Message * case-sensitive. For more information on ordering, see * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * @type array<\Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\DataStoreSpec>|\Google\Protobuf\Internal\RepeatedField $data_store_specs + * Specs defining dataStores to filter on in a search call and + * configurations for those dataStores. This is only considered for + * engines with multiple dataStores use case. For single dataStore within + * an engine, they should use the specs at the top level. * } */ public function __construct($data = NULL) { @@ -263,6 +277,38 @@ public function setOrderBy($var) return $this; } + /** + * Specs defining dataStores to filter on in a search call and + * configurations for those dataStores. This is only considered for + * engines with multiple dataStores use case. For single dataStore within + * an engine, they should use the specs at the top level. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchRequest.DataStoreSpec data_store_specs = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataStoreSpecs() + { + return $this->data_store_specs; + } + + /** + * Specs defining dataStores to filter on in a search call and + * configurations for those dataStores. This is only considered for + * engines with multiple dataStores use case. For single dataStore within + * an engine, they should use the specs at the top level. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchRequest.DataStoreSpec data_store_specs = 7; + * @param array<\Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\DataStoreSpec>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataStoreSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\DataStoreSpec::class); + $this->data_store_specs = $arr; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/AnswerQueryResponse.php b/DiscoveryEngine/src/V1beta/AnswerQueryResponse.php index 5cf9da1982b3..3d61a995d7b2 100644 --- a/DiscoveryEngine/src/V1beta/AnswerQueryResponse.php +++ b/DiscoveryEngine/src/V1beta/AnswerQueryResponse.php @@ -37,6 +37,12 @@ class AnswerQueryResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Session session = 2; */ protected $session = null; + /** + * A global unique ID used for logging. + * + * Generated from protobuf field string answer_query_token = 3; + */ + protected $answer_query_token = ''; /** * Constructor. @@ -56,6 +62,8 @@ class AnswerQueryResponse extends \Google\Protobuf\Internal\Message * It will be only available when session field is set and valid in the * [AnswerQueryRequest][google.cloud.discoveryengine.v1beta.AnswerQueryRequest] * request. + * @type string $answer_query_token + * A global unique ID used for logging. * } */ public function __construct($data = NULL) { @@ -151,5 +159,31 @@ public function setSession($var) return $this; } + /** + * A global unique ID used for logging. + * + * Generated from protobuf field string answer_query_token = 3; + * @return string + */ + public function getAnswerQueryToken() + { + return $this->answer_query_token; + } + + /** + * A global unique ID used for logging. + * + * Generated from protobuf field string answer_query_token = 3; + * @param string $var + * @return $this + */ + public function setAnswerQueryToken($var) + { + GPBUtil::checkString($var, True); + $this->answer_query_token = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/CheckGroundingRequest.php b/DiscoveryEngine/src/V1beta/CheckGroundingRequest.php index 0356839a0351..9e7866de7a60 100644 --- a/DiscoveryEngine/src/V1beta/CheckGroundingRequest.php +++ b/DiscoveryEngine/src/V1beta/CheckGroundingRequest.php @@ -25,7 +25,7 @@ class CheckGroundingRequest extends \Google\Protobuf\Internal\Message */ protected $grounding_config = ''; /** - * Answer candidate to check. + * Answer candidate to check. Can have a maximum length of 1024 characters. * * Generated from protobuf field string answer_candidate = 2; */ @@ -43,6 +43,26 @@ class CheckGroundingRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.discoveryengine.v1beta.CheckGroundingSpec grounding_spec = 4; */ protected $grounding_spec = null; + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 5; + */ + private $user_labels; /** * Constructor. @@ -54,12 +74,28 @@ class CheckGroundingRequest extends \Google\Protobuf\Internal\Message * Required. The resource name of the grounding config, such as * `projects/*/locations/global/groundingConfigs/default_grounding_config`. * @type string $answer_candidate - * Answer candidate to check. + * Answer candidate to check. Can have a maximum length of 1024 characters. * @type array<\Google\Cloud\DiscoveryEngine\V1beta\GroundingFact>|\Google\Protobuf\Internal\RepeatedField $facts * List of facts for the grounding check. * We support up to 200 facts. * @type \Google\Cloud\DiscoveryEngine\V1beta\CheckGroundingSpec $grounding_spec * Configuration of the grounding check. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. * } */ public function __construct($data = NULL) { @@ -96,7 +132,7 @@ public function setGroundingConfig($var) } /** - * Answer candidate to check. + * Answer candidate to check. Can have a maximum length of 1024 characters. * * Generated from protobuf field string answer_candidate = 2; * @return string @@ -107,7 +143,7 @@ public function getAnswerCandidate() } /** - * Answer candidate to check. + * Answer candidate to check. Can have a maximum length of 1024 characters. * * Generated from protobuf field string answer_candidate = 2; * @param string $var @@ -185,5 +221,59 @@ public function setGroundingSpec($var) return $this; } + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/CheckGroundingResponse/Claim.php b/DiscoveryEngine/src/V1beta/CheckGroundingResponse/Claim.php index 1fdd0edfc232..222acc3d71a3 100644 --- a/DiscoveryEngine/src/V1beta/CheckGroundingResponse/Claim.php +++ b/DiscoveryEngine/src/V1beta/CheckGroundingResponse/Claim.php @@ -46,6 +46,19 @@ class Claim extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated int32 citation_indices = 4; */ private $citation_indices; + /** + * Indicates that this claim required grounding check. When the system + * decided this claim doesn't require attribution/grounding check, this + * field will be set to false. In that case, no grounding check was done for + * the claim and therefore + * [citation_indices][google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim.citation_indices], + * and + * [anti_citation_indices][google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim.anti_citation_indices] + * should not be returned. + * + * Generated from protobuf field optional bool grounding_check_required = 6; + */ + protected $grounding_check_required = null; /** * Constructor. @@ -68,6 +81,15 @@ class Claim extends \Google\Protobuf\Internal\Message * cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited * supporting for the claim. A citation to a fact indicates that the claim * is supported by the fact. + * @type bool $grounding_check_required + * Indicates that this claim required grounding check. When the system + * decided this claim doesn't require attribution/grounding check, this + * field will be set to false. In that case, no grounding check was done for + * the claim and therefore + * [citation_indices][google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim.citation_indices], + * and + * [anti_citation_indices][google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim.anti_citation_indices] + * should not be returned. * } */ public function __construct($data = NULL) { @@ -213,6 +235,56 @@ public function setCitationIndices($var) return $this; } + /** + * Indicates that this claim required grounding check. When the system + * decided this claim doesn't require attribution/grounding check, this + * field will be set to false. In that case, no grounding check was done for + * the claim and therefore + * [citation_indices][google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim.citation_indices], + * and + * [anti_citation_indices][google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim.anti_citation_indices] + * should not be returned. + * + * Generated from protobuf field optional bool grounding_check_required = 6; + * @return bool + */ + public function getGroundingCheckRequired() + { + return isset($this->grounding_check_required) ? $this->grounding_check_required : false; + } + + public function hasGroundingCheckRequired() + { + return isset($this->grounding_check_required); + } + + public function clearGroundingCheckRequired() + { + unset($this->grounding_check_required); + } + + /** + * Indicates that this claim required grounding check. When the system + * decided this claim doesn't require attribution/grounding check, this + * field will be set to false. In that case, no grounding check was done for + * the claim and therefore + * [citation_indices][google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim.citation_indices], + * and + * [anti_citation_indices][google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim.anti_citation_indices] + * should not be returned. + * + * Generated from protobuf field optional bool grounding_check_required = 6; + * @param bool $var + * @return $this + */ + public function setGroundingCheckRequired($var) + { + GPBUtil::checkBool($var); + $this->grounding_check_required = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/Client/CompletionServiceClient.php b/DiscoveryEngine/src/V1beta/Client/CompletionServiceClient.php index 21a3fe75d070..ec8e0f75a5d9 100644 --- a/DiscoveryEngine/src/V1beta/Client/CompletionServiceClient.php +++ b/DiscoveryEngine/src/V1beta/Client/CompletionServiceClient.php @@ -29,7 +29,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\ResourceHelperTrait; use Google\ApiCore\RetrySettings; @@ -40,6 +39,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\CompleteQueryResponse; use Google\Cloud\DiscoveryEngine\V1beta\ImportSuggestionDenyListEntriesRequest; use Google\Cloud\DiscoveryEngine\V1beta\PurgeSuggestionDenyListEntriesRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -143,6 +143,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a data_store * resource. diff --git a/DiscoveryEngine/src/V1beta/Client/ControlServiceClient.php b/DiscoveryEngine/src/V1beta/Client/ControlServiceClient.php new file mode 100644 index 000000000000..66295141017d --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Client/ControlServiceClient.php @@ -0,0 +1,572 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/control_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/control_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/control_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/control_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a control + * resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $control + * + * @return string The formatted control resource. + * + * @experimental + */ + public static function controlName(string $project, string $location, string $dataStore, string $control): string + { + return self::getPathTemplate('control')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'control' => $control, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_store + * resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted data_store resource. + * + * @experimental + */ + public static function dataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('dataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a engine + * resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * + * @return string The formatted engine resource. + * + * @experimental + */ + public static function engineName(string $project, string $location, string $collection, string $engine): string + { + return self::getPathTemplate('engine')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * + * @return string The formatted project_location_collection_data_store resource. + * + * @experimental + */ + public static function projectLocationCollectionDataStoreName( + string $project, + string $location, + string $collection, + string $dataStore + ): string { + return self::getPathTemplate('projectLocationCollectionDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store_control resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * @param string $control + * + * @return string The formatted project_location_collection_data_store_control resource. + * + * @experimental + */ + public static function projectLocationCollectionDataStoreControlName( + string $project, + string $location, + string $collection, + string $dataStore, + string $control + ): string { + return self::getPathTemplate('projectLocationCollectionDataStoreControl')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + 'control' => $control, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_engine_control resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * @param string $control + * + * @return string The formatted project_location_collection_engine_control resource. + * + * @experimental + */ + public static function projectLocationCollectionEngineControlName( + string $project, + string $location, + string $collection, + string $engine, + string $control + ): string { + return self::getPathTemplate('projectLocationCollectionEngineControl')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + 'control' => $control, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted project_location_data_store resource. + * + * @experimental + */ + public static function projectLocationDataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('projectLocationDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store_control resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $control + * + * @return string The formatted project_location_data_store_control resource. + * + * @experimental + */ + public static function projectLocationDataStoreControlName( + string $project, + string $location, + string $dataStore, + string $control + ): string { + return self::getPathTemplate('projectLocationDataStoreControl')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'control' => $control, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - control: projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control} + * - dataStore: projects/{project}/locations/{location}/dataStores/{data_store} + * - engine: projects/{project}/locations/{location}/collections/{collection}/engines/{engine} + * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} + * - projectLocationCollectionDataStoreControl: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/controls/{control} + * - projectLocationCollectionEngineControl: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/controls/{control} + * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} + * - projectLocationDataStoreControl: projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'discoveryengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Control. + * + * By default 1000 controls are allowed for a data store. + * A request can be submitted to adjust this limit. + * If the [Control][google.cloud.discoveryengine.v1beta.Control] to create + * already exists, an ALREADY_EXISTS error is returned. + * + * The async variant is {@see ControlServiceClient::createControlAsync()} . + * + * @example samples/V1beta/ControlServiceClient/create_control.php + * + * @param CreateControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Control + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createControl(CreateControlRequest $request, array $callOptions = []): Control + { + return $this->startApiCall('CreateControl', $request, $callOptions)->wait(); + } + + /** + * Deletes a Control. + * + * If the [Control][google.cloud.discoveryengine.v1beta.Control] to delete + * does not exist, a NOT_FOUND error is returned. + * + * The async variant is {@see ControlServiceClient::deleteControlAsync()} . + * + * @example samples/V1beta/ControlServiceClient/delete_control.php + * + * @param DeleteControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteControl(DeleteControlRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteControl', $request, $callOptions)->wait(); + } + + /** + * Gets a Control. + * + * The async variant is {@see ControlServiceClient::getControlAsync()} . + * + * @example samples/V1beta/ControlServiceClient/get_control.php + * + * @param GetControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Control + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getControl(GetControlRequest $request, array $callOptions = []): Control + { + return $this->startApiCall('GetControl', $request, $callOptions)->wait(); + } + + /** + * Lists all Controls by their parent + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore]. + * + * The async variant is {@see ControlServiceClient::listControlsAsync()} . + * + * @example samples/V1beta/ControlServiceClient/list_controls.php + * + * @param ListControlsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listControls(ListControlsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListControls', $request, $callOptions); + } + + /** + * Updates a Control. + * + * [Control][google.cloud.discoveryengine.v1beta.Control] action type cannot + * be changed. If the [Control][google.cloud.discoveryengine.v1beta.Control] + * to update does not exist, a NOT_FOUND error is returned. + * + * The async variant is {@see ControlServiceClient::updateControlAsync()} . + * + * @example samples/V1beta/ControlServiceClient/update_control.php + * + * @param UpdateControlRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Control + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateControl(UpdateControlRequest $request, array $callOptions = []): Control + { + return $this->startApiCall('UpdateControl', $request, $callOptions)->wait(); + } +} diff --git a/DiscoveryEngine/src/V1beta/Client/DataStoreServiceClient.php b/DiscoveryEngine/src/V1beta/Client/DataStoreServiceClient.php index d7d833b31852..726e28dc4d90 100644 --- a/DiscoveryEngine/src/V1beta/Client/DataStoreServiceClient.php +++ b/DiscoveryEngine/src/V1beta/Client/DataStoreServiceClient.php @@ -29,7 +29,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -43,6 +42,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\GetDataStoreRequest; use Google\Cloud\DiscoveryEngine\V1beta\ListDataStoresRequest; use Google\Cloud\DiscoveryEngine\V1beta\UpdateDataStoreRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -149,6 +149,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a collection * resource. diff --git a/DiscoveryEngine/src/V1beta/Client/DocumentServiceClient.php b/DiscoveryEngine/src/V1beta/Client/DocumentServiceClient.php index e403e742c8a8..10a9d4ff2433 100644 --- a/DiscoveryEngine/src/V1beta/Client/DocumentServiceClient.php +++ b/DiscoveryEngine/src/V1beta/Client/DocumentServiceClient.php @@ -29,7 +29,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -45,6 +44,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\ListDocumentsRequest; use Google\Cloud\DiscoveryEngine\V1beta\PurgeDocumentsRequest; use Google\Cloud\DiscoveryEngine\V1beta\UpdateDocumentRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -154,6 +154,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a branch * resource. @@ -541,7 +560,7 @@ public function getDocument(GetDocumentRequest $request, array $callOptions = [] /** * Bulk import of multiple * [Document][google.cloud.discoveryengine.v1beta.Document]s. Request - * processing may be synchronous. Non-existing items will be created. + * processing may be synchronous. Non-existing items are created. * * Note: It is possible for a subset of the * [Document][google.cloud.discoveryengine.v1beta.Document]s to be diff --git a/DiscoveryEngine/src/V1beta/Client/EngineServiceClient.php b/DiscoveryEngine/src/V1beta/Client/EngineServiceClient.php index e79ca683dc05..4e3d8f3aa556 100644 --- a/DiscoveryEngine/src/V1beta/Client/EngineServiceClient.php +++ b/DiscoveryEngine/src/V1beta/Client/EngineServiceClient.php @@ -29,7 +29,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -46,6 +45,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\ResumeEngineRequest; use Google\Cloud\DiscoveryEngine\V1beta\TuneEngineRequest; use Google\Cloud\DiscoveryEngine\V1beta\UpdateEngineRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -155,6 +155,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a collection * resource. diff --git a/DiscoveryEngine/src/V1beta/Client/ProjectServiceClient.php b/DiscoveryEngine/src/V1beta/Client/ProjectServiceClient.php new file mode 100644 index 000000000000..57d627162a28 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Client/ProjectServiceClient.php @@ -0,0 +1,311 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/project_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/project_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/project_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/project_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + * + * @experimental + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + * + * @experimental + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + * + * @experimental + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - project: projects/{project} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'discoveryengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Provisions the project resource. During the + * process, related systems will get prepared and initialized. + * + * Caller must read the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms), and optionally + * specify in request to provide consent to that service terms. + * + * The async variant is {@see ProjectServiceClient::provisionProjectAsync()} . + * + * @example samples/V1beta/ProjectServiceClient/provision_project.php + * + * @param ProvisionProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function provisionProject(ProvisionProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ProvisionProject', $request, $callOptions)->wait(); + } +} diff --git a/DiscoveryEngine/src/V1beta/Client/RecommendationServiceClient.php b/DiscoveryEngine/src/V1beta/Client/RecommendationServiceClient.php index bfef121a399b..e74869c81c95 100644 --- a/DiscoveryEngine/src/V1beta/Client/RecommendationServiceClient.php +++ b/DiscoveryEngine/src/V1beta/Client/RecommendationServiceClient.php @@ -99,6 +99,27 @@ private static function getClientDefaults() ]; } + /** + * Formats a string containing the fully-qualified path to represent a data_store + * resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted data_store resource. + * + * @experimental + */ + public static function dataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('dataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a document * resource. @@ -129,6 +150,56 @@ public static function documentName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a engine + * resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * + * @return string The formatted engine resource. + * + * @experimental + */ + public static function engineName(string $project, string $location, string $collection, string $engine): string + { + return self::getPathTemplate('engine')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * + * @return string The formatted project_location_collection_data_store resource. + * + * @experimental + */ + public static function projectLocationCollectionDataStoreName( + string $project, + string $location, + string $collection, + string $dataStore + ): string { + return self::getPathTemplate('projectLocationCollectionDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_data_store_branch_document resource. @@ -222,6 +293,27 @@ public static function projectLocationCollectionEngineServingConfigName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted project_location_data_store resource. + * + * @experimental + */ + public static function projectLocationDataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('projectLocationDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_data_store_branch_document resource. @@ -310,10 +402,14 @@ public static function servingConfigName( * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - dataStore: projects/{project}/locations/{location}/dataStores/{data_store} * - document: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document} + * - engine: projects/{project}/locations/{location}/collections/{collection}/engines/{engine} + * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} * - projectLocationCollectionDataStoreBranchDocument: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document} * - projectLocationCollectionDataStoreServingConfig: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config} * - projectLocationCollectionEngineServingConfig: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config} + * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} * - projectLocationDataStoreBranchDocument: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document} * - projectLocationDataStoreServingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config} * - servingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config} diff --git a/DiscoveryEngine/src/V1beta/Client/SchemaServiceClient.php b/DiscoveryEngine/src/V1beta/Client/SchemaServiceClient.php index 512c034eb285..524a942150ad 100644 --- a/DiscoveryEngine/src/V1beta/Client/SchemaServiceClient.php +++ b/DiscoveryEngine/src/V1beta/Client/SchemaServiceClient.php @@ -29,7 +29,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -43,6 +42,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\ListSchemasRequest; use Google\Cloud\DiscoveryEngine\V1beta\Schema; use Google\Cloud\DiscoveryEngine\V1beta\UpdateSchemaRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -148,6 +148,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a data_store * resource. diff --git a/DiscoveryEngine/src/V1beta/Client/SearchTuningServiceClient.php b/DiscoveryEngine/src/V1beta/Client/SearchTuningServiceClient.php index 1aba3b43056f..820a8254ff3d 100644 --- a/DiscoveryEngine/src/V1beta/Client/SearchTuningServiceClient.php +++ b/DiscoveryEngine/src/V1beta/Client/SearchTuningServiceClient.php @@ -29,14 +29,16 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\ResourceHelperTrait; use Google\ApiCore\RetrySettings; use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\DiscoveryEngine\V1beta\ListCustomModelsRequest; +use Google\Cloud\DiscoveryEngine\V1beta\ListCustomModelsResponse; use Google\Cloud\DiscoveryEngine\V1beta\TrainCustomModelRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -53,6 +55,7 @@ * * @experimental * + * @method PromiseInterface listCustomModelsAsync(ListCustomModelsRequest $request, array $optionalArgs = []) * @method PromiseInterface trainCustomModelAsync(TrainCustomModelRequest $request, array $optionalArgs = []) */ final class SearchTuningServiceClient @@ -138,6 +141,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a data_store * resource. @@ -309,6 +331,36 @@ public function __call($method, $args) return call_user_func_array([$this, 'startAsyncCall'], $args); } + /** + * Gets a list of all the custom models. + * + * The async variant is {@see SearchTuningServiceClient::listCustomModelsAsync()} . + * + * @example samples/V1beta/SearchTuningServiceClient/list_custom_models.php + * + * @param ListCustomModelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListCustomModelsResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listCustomModels( + ListCustomModelsRequest $request, + array $callOptions = [] + ): ListCustomModelsResponse { + return $this->startApiCall('ListCustomModels', $request, $callOptions)->wait(); + } + /** * Trains a custom model. * diff --git a/DiscoveryEngine/src/V1beta/Client/SiteSearchEngineServiceClient.php b/DiscoveryEngine/src/V1beta/Client/SiteSearchEngineServiceClient.php index 72fc2c5f8ac7..688ff13687ec 100644 --- a/DiscoveryEngine/src/V1beta/Client/SiteSearchEngineServiceClient.php +++ b/DiscoveryEngine/src/V1beta/Client/SiteSearchEngineServiceClient.php @@ -29,7 +29,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -51,6 +50,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\SiteSearchEngine; use Google\Cloud\DiscoveryEngine\V1beta\TargetSite; use Google\Cloud\DiscoveryEngine\V1beta\UpdateTargetSiteRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -164,6 +164,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_data_store_siteSearchEngine resource. diff --git a/DiscoveryEngine/src/V1beta/Client/UserEventServiceClient.php b/DiscoveryEngine/src/V1beta/Client/UserEventServiceClient.php index 4a7a098f29a2..f129c02efce8 100644 --- a/DiscoveryEngine/src/V1beta/Client/UserEventServiceClient.php +++ b/DiscoveryEngine/src/V1beta/Client/UserEventServiceClient.php @@ -29,7 +29,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\ResourceHelperTrait; use Google\ApiCore\RetrySettings; @@ -41,6 +40,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\ImportUserEventsRequest; use Google\Cloud\DiscoveryEngine\V1beta\UserEvent; use Google\Cloud\DiscoveryEngine\V1beta\WriteUserEventRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -144,6 +144,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a data_store * resource. @@ -195,6 +214,29 @@ public static function documentName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a engine + * resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * + * @return string The formatted engine resource. + * + * @experimental + */ + public static function engineName(string $project, string $location, string $collection, string $engine): string + { + return self::getPathTemplate('engine')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_collection_data_store resource. @@ -312,6 +354,7 @@ public static function projectLocationDataStoreBranchDocumentName( * Template: Pattern * - dataStore: projects/{project}/locations/{location}/dataStores/{data_store} * - document: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document} + * - engine: projects/{project}/locations/{location}/collections/{collection}/engines/{engine} * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} * - projectLocationCollectionDataStoreBranchDocument: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document} * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} @@ -444,7 +487,7 @@ public function collectUserEvent(CollectUserEventRequest $request, array $callOp } /** - * Bulk import of User events. Request processing might be + * Bulk import of user events. Request processing might be * synchronous. Events that already exist are skipped. * Use this method for backfilling historical user events. * diff --git a/DiscoveryEngine/src/V1beta/Condition.php b/DiscoveryEngine/src/V1beta/Condition.php new file mode 100644 index 000000000000..4858c778ffd5 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Condition.php @@ -0,0 +1,113 @@ +google.cloud.discoveryengine.v1beta.Condition + */ +class Condition extends \Google\Protobuf\Internal\Message +{ + /** + * Search only + * A list of terms to match the query on. + * Maximum of 10 query terms. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Condition.QueryTerm query_terms = 2; + */ + private $query_terms; + /** + * Range of time(s) specifying when condition is active. + * Maximum of 10 time ranges. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Condition.TimeRange active_time_range = 3; + */ + private $active_time_range; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1beta\Condition\QueryTerm>|\Google\Protobuf\Internal\RepeatedField $query_terms + * Search only + * A list of terms to match the query on. + * Maximum of 10 query terms. + * @type array<\Google\Cloud\DiscoveryEngine\V1beta\Condition\TimeRange>|\Google\Protobuf\Internal\RepeatedField $active_time_range + * Range of time(s) specifying when condition is active. + * Maximum of 10 time ranges. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Control::initOnce(); + parent::__construct($data); + } + + /** + * Search only + * A list of terms to match the query on. + * Maximum of 10 query terms. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Condition.QueryTerm query_terms = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryTerms() + { + return $this->query_terms; + } + + /** + * Search only + * A list of terms to match the query on. + * Maximum of 10 query terms. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Condition.QueryTerm query_terms = 2; + * @param array<\Google\Cloud\DiscoveryEngine\V1beta\Condition\QueryTerm>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\Condition\QueryTerm::class); + $this->query_terms = $arr; + + return $this; + } + + /** + * Range of time(s) specifying when condition is active. + * Maximum of 10 time ranges. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Condition.TimeRange active_time_range = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActiveTimeRange() + { + return $this->active_time_range; + } + + /** + * Range of time(s) specifying when condition is active. + * Maximum of 10 time ranges. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Condition.TimeRange active_time_range = 3; + * @param array<\Google\Cloud\DiscoveryEngine\V1beta\Condition\TimeRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActiveTimeRange($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\Condition\TimeRange::class); + $this->active_time_range = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/Condition/QueryTerm.php b/DiscoveryEngine/src/V1beta/Condition/QueryTerm.php new file mode 100644 index 000000000000..b523cb578b81 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Condition/QueryTerm.php @@ -0,0 +1,118 @@ +google.cloud.discoveryengine.v1beta.Condition.QueryTerm + */ +class QueryTerm extends \Google\Protobuf\Internal\Message +{ + /** + * The specific query value to match against + * Must be lowercase, must be UTF-8. + * Can have at most 3 space separated terms if full_match is true. + * Cannot be an empty string. + * Maximum length of 5000 characters. + * + * Generated from protobuf field string value = 1; + */ + protected $value = ''; + /** + * Whether the search query needs to exactly match the query term. + * + * Generated from protobuf field bool full_match = 2; + */ + protected $full_match = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The specific query value to match against + * Must be lowercase, must be UTF-8. + * Can have at most 3 space separated terms if full_match is true. + * Cannot be an empty string. + * Maximum length of 5000 characters. + * @type bool $full_match + * Whether the search query needs to exactly match the query term. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Control::initOnce(); + parent::__construct($data); + } + + /** + * The specific query value to match against + * Must be lowercase, must be UTF-8. + * Can have at most 3 space separated terms if full_match is true. + * Cannot be an empty string. + * Maximum length of 5000 characters. + * + * Generated from protobuf field string value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The specific query value to match against + * Must be lowercase, must be UTF-8. + * Can have at most 3 space separated terms if full_match is true. + * Cannot be an empty string. + * Maximum length of 5000 characters. + * + * Generated from protobuf field string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Whether the search query needs to exactly match the query term. + * + * Generated from protobuf field bool full_match = 2; + * @return bool + */ + public function getFullMatch() + { + return $this->full_match; + } + + /** + * Whether the search query needs to exactly match the query term. + * + * Generated from protobuf field bool full_match = 2; + * @param bool $var + * @return $this + */ + public function setFullMatch($var) + { + GPBUtil::checkBool($var); + $this->full_match = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1beta/Condition/TimeRange.php b/DiscoveryEngine/src/V1beta/Condition/TimeRange.php new file mode 100644 index 000000000000..cd71e07854c2 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Condition/TimeRange.php @@ -0,0 +1,134 @@ +google.cloud.discoveryengine.v1beta.Condition.TimeRange + */ +class TimeRange extends \Google\Protobuf\Internal\Message +{ + /** + * Start of time range. + * Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * End of time range. + * Range is inclusive. + * Must be in the future. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Start of time range. + * Range is inclusive. + * @type \Google\Protobuf\Timestamp $end_time + * End of time range. + * Range is inclusive. + * Must be in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Control::initOnce(); + parent::__construct($data); + } + + /** + * Start of time range. + * Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start of time range. + * Range is inclusive. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * End of time range. + * Range is inclusive. + * Must be in the future. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * End of time range. + * Range is inclusive. + * Must be in the future. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1beta/Control.php b/DiscoveryEngine/src/V1beta/Control.php new file mode 100644 index 000000000000..80c0c28037a9 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Control.php @@ -0,0 +1,448 @@ +google.cloud.discoveryengine.v1beta.Control + */ +class Control extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/dataStore/*/controls/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Required. Human readable name. The identifier used in UI views. + * Must be UTF-8 encoded string. Length limit is 128 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. List of all + * [ServingConfig][google.cloud.discoveryengine.v1beta.ServingConfig] ids this + * control is attached to. May take up to 10 minutes to update after changes. + * + * Generated from protobuf field repeated string associated_serving_config_ids = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $associated_serving_config_ids; + /** + * Required. Immutable. What solution the control belongs to. + * Must be compatible with vertical of resource. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.SolutionType solution_type = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $solution_type = 0; + /** + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only applies to + * [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH]. + * Currently only allow one use case per control. + * Must be set when solution_type is + * [SolutionType.SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchUseCase use_cases = 8; + */ + private $use_cases; + /** + * Determines when the associated action will trigger. + * Omit to always apply the action. + * Currently only a single condition may be specified. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Condition conditions = 5; + */ + private $conditions; + protected $action; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1beta\Control\BoostAction $boost_action + * Defines a boost-type control + * @type \Google\Cloud\DiscoveryEngine\V1beta\Control\FilterAction $filter_action + * Defines a filter-type control + * Currently not supported by Recommendation + * @type \Google\Cloud\DiscoveryEngine\V1beta\Control\RedirectAction $redirect_action + * Defines a redirect-type control. + * @type \Google\Cloud\DiscoveryEngine\V1beta\Control\SynonymsAction $synonyms_action + * Treats a group of terms as synonyms of one another. + * @type string $name + * Immutable. Fully qualified name + * `projects/*/locations/global/dataStore/*/controls/*` + * @type string $display_name + * Required. Human readable name. The identifier used in UI views. + * Must be UTF-8 encoded string. Length limit is 128 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * @type array|\Google\Protobuf\Internal\RepeatedField $associated_serving_config_ids + * Output only. List of all + * [ServingConfig][google.cloud.discoveryengine.v1beta.ServingConfig] ids this + * control is attached to. May take up to 10 minutes to update after changes. + * @type int $solution_type + * Required. Immutable. What solution the control belongs to. + * Must be compatible with vertical of resource. + * Otherwise an INVALID ARGUMENT error is thrown. + * @type array|\Google\Protobuf\Internal\RepeatedField $use_cases + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only applies to + * [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH]. + * Currently only allow one use case per control. + * Must be set when solution_type is + * [SolutionType.SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH]. + * @type array<\Google\Cloud\DiscoveryEngine\V1beta\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Determines when the associated action will trigger. + * Omit to always apply the action. + * Currently only a single condition may be specified. + * Otherwise an INVALID ARGUMENT error is thrown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Control::initOnce(); + parent::__construct($data); + } + + /** + * Defines a boost-type control + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control.BoostAction boost_action = 6; + * @return \Google\Cloud\DiscoveryEngine\V1beta\Control\BoostAction|null + */ + public function getBoostAction() + { + return $this->readOneof(6); + } + + public function hasBoostAction() + { + return $this->hasOneof(6); + } + + /** + * Defines a boost-type control + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control.BoostAction boost_action = 6; + * @param \Google\Cloud\DiscoveryEngine\V1beta\Control\BoostAction $var + * @return $this + */ + public function setBoostAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\Control\BoostAction::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Defines a filter-type control + * Currently not supported by Recommendation + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control.FilterAction filter_action = 7; + * @return \Google\Cloud\DiscoveryEngine\V1beta\Control\FilterAction|null + */ + public function getFilterAction() + { + return $this->readOneof(7); + } + + public function hasFilterAction() + { + return $this->hasOneof(7); + } + + /** + * Defines a filter-type control + * Currently not supported by Recommendation + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control.FilterAction filter_action = 7; + * @param \Google\Cloud\DiscoveryEngine\V1beta\Control\FilterAction $var + * @return $this + */ + public function setFilterAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\Control\FilterAction::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Defines a redirect-type control. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control.RedirectAction redirect_action = 9; + * @return \Google\Cloud\DiscoveryEngine\V1beta\Control\RedirectAction|null + */ + public function getRedirectAction() + { + return $this->readOneof(9); + } + + public function hasRedirectAction() + { + return $this->hasOneof(9); + } + + /** + * Defines a redirect-type control. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control.RedirectAction redirect_action = 9; + * @param \Google\Cloud\DiscoveryEngine\V1beta\Control\RedirectAction $var + * @return $this + */ + public function setRedirectAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\Control\RedirectAction::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Treats a group of terms as synonyms of one another. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control.SynonymsAction synonyms_action = 10; + * @return \Google\Cloud\DiscoveryEngine\V1beta\Control\SynonymsAction|null + */ + public function getSynonymsAction() + { + return $this->readOneof(10); + } + + public function hasSynonymsAction() + { + return $this->hasOneof(10); + } + + /** + * Treats a group of terms as synonyms of one another. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control.SynonymsAction synonyms_action = 10; + * @param \Google\Cloud\DiscoveryEngine\V1beta\Control\SynonymsAction $var + * @return $this + */ + public function setSynonymsAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\Control\SynonymsAction::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/dataStore/*/controls/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Fully qualified name + * `projects/*/locations/global/dataStore/*/controls/*` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Human readable name. The identifier used in UI views. + * Must be UTF-8 encoded string. Length limit is 128 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Human readable name. The identifier used in UI views. + * Must be UTF-8 encoded string. Length limit is 128 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. List of all + * [ServingConfig][google.cloud.discoveryengine.v1beta.ServingConfig] ids this + * control is attached to. May take up to 10 minutes to update after changes. + * + * Generated from protobuf field repeated string associated_serving_config_ids = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssociatedServingConfigIds() + { + return $this->associated_serving_config_ids; + } + + /** + * Output only. List of all + * [ServingConfig][google.cloud.discoveryengine.v1beta.ServingConfig] ids this + * control is attached to. May take up to 10 minutes to update after changes. + * + * Generated from protobuf field repeated string associated_serving_config_ids = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssociatedServingConfigIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->associated_serving_config_ids = $arr; + + return $this; + } + + /** + * Required. Immutable. What solution the control belongs to. + * Must be compatible with vertical of resource. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.SolutionType solution_type = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getSolutionType() + { + return $this->solution_type; + } + + /** + * Required. Immutable. What solution the control belongs to. + * Must be compatible with vertical of resource. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.SolutionType solution_type = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setSolutionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1beta\SolutionType::class); + $this->solution_type = $var; + + return $this; + } + + /** + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only applies to + * [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH]. + * Currently only allow one use case per control. + * Must be set when solution_type is + * [SolutionType.SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchUseCase use_cases = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUseCases() + { + return $this->use_cases; + } + + /** + * Specifies the use case for the control. + * Affects what condition fields can be set. + * Only applies to + * [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH]. + * Currently only allow one use case per control. + * Must be set when solution_type is + * [SolutionType.SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH]. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchUseCase use_cases = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUseCases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\DiscoveryEngine\V1beta\SearchUseCase::class); + $this->use_cases = $arr; + + return $this; + } + + /** + * Determines when the associated action will trigger. + * Omit to always apply the action. + * Currently only a single condition may be specified. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Condition conditions = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Determines when the associated action will trigger. + * Omit to always apply the action. + * Currently only a single condition may be specified. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Condition conditions = 5; + * @param array<\Google\Cloud\DiscoveryEngine\V1beta\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * @return string + */ + public function getAction() + { + return $this->whichOneof("action"); + } + +} + diff --git a/DiscoveryEngine/src/V1beta/Control/BoostAction.php b/DiscoveryEngine/src/V1beta/Control/BoostAction.php new file mode 100644 index 000000000000..0f7d8300659a --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Control/BoostAction.php @@ -0,0 +1,168 @@ +google.cloud.discoveryengine.v1beta.Control.BoostAction + */ +class BoostAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Strength of the boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0 (No-op). + * + * Generated from protobuf field float boost = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $boost = 0.0; + /** + * Required. Specifies which products to apply the boost to. + * If no filter is provided all products will be boosted (No-op). + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Required. Specifies which data store's documents can be boosted by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $data_store = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $boost + * Required. Strength of the boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0 (No-op). + * @type string $filter + * Required. Specifies which products to apply the boost to. + * If no filter is provided all products will be boosted (No-op). + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * @type string $data_store + * Required. Specifies which data store's documents can be boosted by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Control::initOnce(); + parent::__construct($data); + } + + /** + * Required. Strength of the boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0 (No-op). + * + * Generated from protobuf field float boost = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getBoost() + { + return $this->boost; + } + + /** + * Required. Strength of the boost, which should be in [-1, 1]. Negative + * boost means demotion. Default is 0.0 (No-op). + * + * Generated from protobuf field float boost = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setBoost($var) + { + GPBUtil::checkFloat($var); + $this->boost = $var; + + return $this; + } + + /** + * Required. Specifies which products to apply the boost to. + * If no filter is provided all products will be boosted (No-op). + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. Specifies which products to apply the boost to. + * If no filter is provided all products will be boosted (No-op). + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Required. Specifies which data store's documents can be boosted by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDataStore() + { + return $this->data_store; + } + + /** + * Required. Specifies which data store's documents can be boosted by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataStore($var) + { + GPBUtil::checkString($var, True); + $this->data_store = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1beta/Control/FilterAction.php b/DiscoveryEngine/src/V1beta/Control/FilterAction.php new file mode 100644 index 000000000000..1d07fe3fd72e --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Control/FilterAction.php @@ -0,0 +1,131 @@ +google.cloud.discoveryengine.v1beta.Control.FilterAction + */ +class FilterAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A filter to apply on the matching condition results. + * Required + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. Otherwise an INVALID + * ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Required. Specifies which data store's documents can be filtered by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $data_store = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filter + * Required. A filter to apply on the matching condition results. + * Required + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. Otherwise an INVALID + * ARGUMENT error is thrown. + * @type string $data_store + * Required. Specifies which data store's documents can be filtered by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Control::initOnce(); + parent::__construct($data); + } + + /** + * Required. A filter to apply on the matching condition results. + * Required + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. Otherwise an INVALID + * ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. A filter to apply on the matching condition results. + * Required + * Syntax documentation: + * https://cloud.google.com/retail/docs/filter-and-order + * Maximum length is 5000 characters. Otherwise an INVALID + * ARGUMENT error is thrown. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Required. Specifies which data store's documents can be filtered by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDataStore() + { + return $this->data_store; + } + + /** + * Required. Specifies which data store's documents can be filtered by this + * control. Full data store name e.g. + * projects/123/locations/global/collections/default_collection/dataStores/default_data_store + * + * Generated from protobuf field string data_store = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataStore($var) + { + GPBUtil::checkString($var, True); + $this->data_store = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1beta/Control/RedirectAction.php b/DiscoveryEngine/src/V1beta/Control/RedirectAction.php new file mode 100644 index 000000000000..39740c0c51b6 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Control/RedirectAction.php @@ -0,0 +1,80 @@ +google.cloud.discoveryengine.v1beta.Control.RedirectAction + */ +class RedirectAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URI to which the shopper will be redirected. + * Required. + * URI must have length equal or less than 2000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string redirect_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $redirect_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $redirect_uri + * Required. The URI to which the shopper will be redirected. + * Required. + * URI must have length equal or less than 2000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Control::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URI to which the shopper will be redirected. + * Required. + * URI must have length equal or less than 2000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string redirect_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRedirectUri() + { + return $this->redirect_uri; + } + + /** + * Required. The URI to which the shopper will be redirected. + * Required. + * URI must have length equal or less than 2000 characters. + * Otherwise an INVALID ARGUMENT error is thrown. + * + * Generated from protobuf field string redirect_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRedirectUri($var) + { + GPBUtil::checkString($var, True); + $this->redirect_uri = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1beta/Control/SynonymsAction.php b/DiscoveryEngine/src/V1beta/Control/SynonymsAction.php new file mode 100644 index 000000000000..82f45ee05491 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Control/SynonymsAction.php @@ -0,0 +1,82 @@ +google.cloud.discoveryengine.v1beta.Control.SynonymsAction + */ +class SynonymsAction extends \Google\Protobuf\Internal\Message +{ + /** + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is + * thrown. + * + * Generated from protobuf field repeated string synonyms = 1; + */ + private $synonyms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $synonyms + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is + * thrown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Control::initOnce(); + parent::__construct($data); + } + + /** + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is + * thrown. + * + * Generated from protobuf field repeated string synonyms = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Defines a set of synonyms. + * Can specify up to 100 synonyms. + * Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is + * thrown. + * + * Generated from protobuf field repeated string synonyms = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1beta/Conversation.php b/DiscoveryEngine/src/V1beta/Conversation.php index d8c2abd97ebb..45569a362720 100644 --- a/DiscoveryEngine/src/V1beta/Conversation.php +++ b/DiscoveryEngine/src/V1beta/Conversation.php @@ -17,9 +17,9 @@ class Conversation extends \Google\Protobuf\Internal\Message { /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` + * `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` * or - * `project/*/locations/global/collections/{collection}/engines/*/conversations/*`. + * `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ @@ -63,9 +63,9 @@ class Conversation extends \Google\Protobuf\Internal\Message * * @type string $name * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` + * `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` * or - * `project/*/locations/global/collections/{collection}/engines/*/conversations/*`. + * `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. * @type int $state * The state of the Conversation. * @type string $user_pseudo_id @@ -85,9 +85,9 @@ public function __construct($data = NULL) { /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` + * `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` * or - * `project/*/locations/global/collections/{collection}/engines/*/conversations/*`. + * `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; * @return string @@ -99,9 +99,9 @@ public function getName() /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` + * `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` * or - * `project/*/locations/global/collections/{collection}/engines/*/conversations/*`. + * `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; * @param string $var diff --git a/DiscoveryEngine/src/V1beta/CreateControlRequest.php b/DiscoveryEngine/src/V1beta/CreateControlRequest.php new file mode 100644 index 000000000000..888cc3cbc56e --- /dev/null +++ b/DiscoveryEngine/src/V1beta/CreateControlRequest.php @@ -0,0 +1,194 @@ +google.cloud.discoveryengine.v1beta.CreateControlRequest + */ +class CreateControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Control to create. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control = null; + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * + * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control_id = ''; + + /** + * @param string $parent Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. Please see + * {@see ControlServiceClient::dataStoreName()} for help formatting this field. + * @param \Google\Cloud\DiscoveryEngine\V1beta\Control $control Required. The Control to create. + * @param string $controlId Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * + * @return \Google\Cloud\DiscoveryEngine\V1beta\CreateControlRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1beta\Control $control, string $controlId): self + { + return (new self()) + ->setParent($parent) + ->setControl($control) + ->setControlId($controlId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * @type \Google\Cloud\DiscoveryEngine\V1beta\Control $control + * Required. The Control to create. + * @type string $control_id + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Control to create. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DiscoveryEngine\V1beta\Control|null + */ + public function getControl() + { + return $this->control; + } + + public function hasControl() + { + return isset($this->control); + } + + public function clearControl() + { + unset($this->control); + } + + /** + * Required. The Control to create. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DiscoveryEngine\V1beta\Control $var + * @return $this + */ + public function setControl($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\Control::class); + $this->control = $var; + + return $this; + } + + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * + * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getControlId() + { + return $this->control_id; + } + + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value must be within 1-63 characters. + * Valid characters are /[a-z][0-9]-_/. + * + * Generated from protobuf field string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setControlId($var) + { + GPBUtil::checkString($var, True); + $this->control_id = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/CreateDocumentRequest.php b/DiscoveryEngine/src/V1beta/CreateDocumentRequest.php index c3ff577a2b3d..a01c3853729a 100644 --- a/DiscoveryEngine/src/V1beta/CreateDocumentRequest.php +++ b/DiscoveryEngine/src/V1beta/CreateDocumentRequest.php @@ -33,8 +33,8 @@ class CreateDocumentRequest extends \Google\Protobuf\Internal\Message protected $document = null; /** * Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1beta.Document], which will become - * the final component of the + * [Document][google.cloud.discoveryengine.v1beta.Document], which becomes the + * final component of the * [Document.name][google.cloud.discoveryengine.v1beta.Document.name]. * If the caller does not have permission to create the * [Document][google.cloud.discoveryengine.v1beta.Document], regardless of @@ -58,8 +58,8 @@ class CreateDocumentRequest extends \Google\Protobuf\Internal\Message * @param \Google\Cloud\DiscoveryEngine\V1beta\Document $document Required. The [Document][google.cloud.discoveryengine.v1beta.Document] to * create. * @param string $documentId Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1beta.Document], which will become - * the final component of the + * [Document][google.cloud.discoveryengine.v1beta.Document], which becomes the + * final component of the * [Document.name][google.cloud.discoveryengine.v1beta.Document.name]. * * If the caller does not have permission to create the @@ -101,8 +101,8 @@ public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1bet * create. * @type string $document_id * Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1beta.Document], which will become - * the final component of the + * [Document][google.cloud.discoveryengine.v1beta.Document], which becomes the + * final component of the * [Document.name][google.cloud.discoveryengine.v1beta.Document.name]. * If the caller does not have permission to create the * [Document][google.cloud.discoveryengine.v1beta.Document], regardless of @@ -189,8 +189,8 @@ public function setDocument($var) /** * Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1beta.Document], which will become - * the final component of the + * [Document][google.cloud.discoveryengine.v1beta.Document], which becomes the + * final component of the * [Document.name][google.cloud.discoveryengine.v1beta.Document.name]. * If the caller does not have permission to create the * [Document][google.cloud.discoveryengine.v1beta.Document], regardless of @@ -213,8 +213,8 @@ public function getDocumentId() /** * Required. The ID to use for the - * [Document][google.cloud.discoveryengine.v1beta.Document], which will become - * the final component of the + * [Document][google.cloud.discoveryengine.v1beta.Document], which becomes the + * final component of the * [Document.name][google.cloud.discoveryengine.v1beta.Document.name]. * If the caller does not have permission to create the * [Document][google.cloud.discoveryengine.v1beta.Document], regardless of diff --git a/DiscoveryEngine/src/V1beta/CreateSchemaRequest.php b/DiscoveryEngine/src/V1beta/CreateSchemaRequest.php index 2433a108c8b0..6e9203379e20 100644 --- a/DiscoveryEngine/src/V1beta/CreateSchemaRequest.php +++ b/DiscoveryEngine/src/V1beta/CreateSchemaRequest.php @@ -33,7 +33,7 @@ class CreateSchemaRequest extends \Google\Protobuf\Internal\Message protected $schema = null; /** * Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1beta.Schema], which will become the + * [Schema][google.cloud.discoveryengine.v1beta.Schema], which becomes the * final component of the * [Schema.name][google.cloud.discoveryengine.v1beta.Schema.name]. * This field should conform to @@ -51,7 +51,7 @@ class CreateSchemaRequest extends \Google\Protobuf\Internal\Message * @param \Google\Cloud\DiscoveryEngine\V1beta\Schema $schema Required. The [Schema][google.cloud.discoveryengine.v1beta.Schema] to * create. * @param string $schemaId Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1beta.Schema], which will become the + * [Schema][google.cloud.discoveryengine.v1beta.Schema], which becomes the * final component of the * [Schema.name][google.cloud.discoveryengine.v1beta.Schema.name]. * @@ -85,7 +85,7 @@ public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1bet * create. * @type string $schema_id * Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1beta.Schema], which will become the + * [Schema][google.cloud.discoveryengine.v1beta.Schema], which becomes the * final component of the * [Schema.name][google.cloud.discoveryengine.v1beta.Schema.name]. * This field should conform to @@ -166,7 +166,7 @@ public function setSchema($var) /** * Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1beta.Schema], which will become the + * [Schema][google.cloud.discoveryengine.v1beta.Schema], which becomes the * final component of the * [Schema.name][google.cloud.discoveryengine.v1beta.Schema.name]. * This field should conform to @@ -183,7 +183,7 @@ public function getSchemaId() /** * Required. The ID to use for the - * [Schema][google.cloud.discoveryengine.v1beta.Schema], which will become the + * [Schema][google.cloud.discoveryengine.v1beta.Schema], which becomes the * final component of the * [Schema.name][google.cloud.discoveryengine.v1beta.Schema.name]. * This field should conform to diff --git a/DiscoveryEngine/src/V1beta/CustomTuningModel.php b/DiscoveryEngine/src/V1beta/CustomTuningModel.php new file mode 100644 index 000000000000..2aa38393e8b7 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/CustomTuningModel.php @@ -0,0 +1,269 @@ +google.cloud.discoveryengine.v1beta.CustomTuningModel + */ +class CustomTuningModel extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The fully qualified resource name of the model. + * Format: + * `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}` + * model must be an alpha-numerical string with limit of 40 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The display name of the model. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * The version of the model. + * + * Generated from protobuf field int64 model_version = 3; + */ + protected $model_version = 0; + /** + * The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.CustomTuningModel.ModelState model_state = 4; + */ + protected $model_state = 0; + /** + * Timestamp the Model was created at. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + */ + protected $create_time = null; + /** + * Timestamp the model training was initiated. + * + * Generated from protobuf field .google.protobuf.Timestamp training_start_time = 6; + */ + protected $training_start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The fully qualified resource name of the model. + * Format: + * `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}` + * model must be an alpha-numerical string with limit of 40 characters. + * @type string $display_name + * The display name of the model. + * @type int|string $model_version + * The version of the model. + * @type int $model_state + * The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp the Model was created at. + * @type \Google\Protobuf\Timestamp $training_start_time + * Timestamp the model training was initiated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\CustomTuningModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The fully qualified resource name of the model. + * Format: + * `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}` + * model must be an alpha-numerical string with limit of 40 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The fully qualified resource name of the model. + * Format: + * `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}` + * model must be an alpha-numerical string with limit of 40 characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The display name of the model. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the model. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The version of the model. + * + * Generated from protobuf field int64 model_version = 3; + * @return int|string + */ + public function getModelVersion() + { + return $this->model_version; + } + + /** + * The version of the model. + * + * Generated from protobuf field int64 model_version = 3; + * @param int|string $var + * @return $this + */ + public function setModelVersion($var) + { + GPBUtil::checkInt64($var); + $this->model_version = $var; + + return $this; + } + + /** + * The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.CustomTuningModel.ModelState model_state = 4; + * @return int + */ + public function getModelState() + { + return $this->model_state; + } + + /** + * The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.CustomTuningModel.ModelState model_state = 4; + * @param int $var + * @return $this + */ + public function setModelState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1beta\CustomTuningModel\ModelState::class); + $this->model_state = $var; + + return $this; + } + + /** + * Timestamp the Model was created at. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp the Model was created at. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Timestamp the model training was initiated. + * + * Generated from protobuf field .google.protobuf.Timestamp training_start_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTrainingStartTime() + { + return $this->training_start_time; + } + + public function hasTrainingStartTime() + { + return isset($this->training_start_time); + } + + public function clearTrainingStartTime() + { + unset($this->training_start_time); + } + + /** + * Timestamp the model training was initiated. + * + * Generated from protobuf field .google.protobuf.Timestamp training_start_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTrainingStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->training_start_time = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/CustomTuningModel/ModelState.php b/DiscoveryEngine/src/V1beta/CustomTuningModel/ModelState.php new file mode 100644 index 000000000000..a37b2f894427 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/CustomTuningModel/ModelState.php @@ -0,0 +1,83 @@ +google.cloud.discoveryengine.v1beta.CustomTuningModel.ModelState + */ +class ModelState +{ + /** + * Default value. + * + * Generated from protobuf enum MODEL_STATE_UNSPECIFIED = 0; + */ + const MODEL_STATE_UNSPECIFIED = 0; + /** + * The model is in a paused training state. + * + * Generated from protobuf enum TRAINING_PAUSED = 1; + */ + const TRAINING_PAUSED = 1; + /** + * The model is currently training. + * + * Generated from protobuf enum TRAINING = 2; + */ + const TRAINING = 2; + /** + * The model has successfully completed training. + * + * Generated from protobuf enum TRAINING_COMPLETE = 3; + */ + const TRAINING_COMPLETE = 3; + /** + * The model is ready for serving. + * + * Generated from protobuf enum READY_FOR_SERVING = 4; + */ + const READY_FOR_SERVING = 4; + /** + * The model training failed. + * + * Generated from protobuf enum TRAINING_FAILED = 5; + */ + const TRAINING_FAILED = 5; + + private static $valueToName = [ + self::MODEL_STATE_UNSPECIFIED => 'MODEL_STATE_UNSPECIFIED', + self::TRAINING_PAUSED => 'TRAINING_PAUSED', + self::TRAINING => 'TRAINING', + self::TRAINING_COMPLETE => 'TRAINING_COMPLETE', + self::READY_FOR_SERVING => 'READY_FOR_SERVING', + self::TRAINING_FAILED => 'TRAINING_FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DiscoveryEngine/src/V1beta/DeleteControlRequest.php b/DiscoveryEngine/src/V1beta/DeleteControlRequest.php new file mode 100644 index 000000000000..33e5fead7e5a --- /dev/null +++ b/DiscoveryEngine/src/V1beta/DeleteControlRequest.php @@ -0,0 +1,86 @@ +google.cloud.discoveryengine.v1beta.DeleteControlRequest + */ +class DeleteControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * Please see {@see ControlServiceClient::controlName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1beta\DeleteControlRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Control to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/DocumentInfo.php b/DiscoveryEngine/src/V1beta/DocumentInfo.php index b1ebb5f48f29..4fbf5fff556d 100644 --- a/DiscoveryEngine/src/V1beta/DocumentInfo.php +++ b/DiscoveryEngine/src/V1beta/DocumentInfo.php @@ -17,7 +17,7 @@ class DocumentInfo extends \Google\Protobuf\Internal\Message { /** * Quantity of the Document associated with the user event. Defaults to 1. - * For example, this field will be 2 if two quantities of the same Document + * For example, this field is 2 if two quantities of the same Document * are involved in a `add-to-cart` event. * Required for events of the following event types: * * `add-to-cart` @@ -52,7 +52,7 @@ class DocumentInfo extends \Google\Protobuf\Internal\Message * allowed for website data stores. * @type int $quantity * Quantity of the Document associated with the user event. Defaults to 1. - * For example, this field will be 2 if two quantities of the same Document + * For example, this field is 2 if two quantities of the same Document * are involved in a `add-to-cart` event. * Required for events of the following event types: * * `add-to-cart` @@ -168,7 +168,7 @@ public function setUri($var) /** * Quantity of the Document associated with the user event. Defaults to 1. - * For example, this field will be 2 if two quantities of the same Document + * For example, this field is 2 if two quantities of the same Document * are involved in a `add-to-cart` event. * Required for events of the following event types: * * `add-to-cart` @@ -194,7 +194,7 @@ public function clearQuantity() /** * Quantity of the Document associated with the user event. Defaults to 1. - * For example, this field will be 2 if two quantities of the same Document + * For example, this field is 2 if two quantities of the same Document * are involved in a `add-to-cart` event. * Required for events of the following event types: * * `add-to-cart` diff --git a/DiscoveryEngine/src/V1beta/Engine.php b/DiscoveryEngine/src/V1beta/Engine.php index ca84494153cf..7c0781d60d8d 100644 --- a/DiscoveryEngine/src/V1beta/Engine.php +++ b/DiscoveryEngine/src/V1beta/Engine.php @@ -80,7 +80,7 @@ class Engine extends \Google\Protobuf\Internal\Message * The restriction of the Engine industry vertical is based on * [DataStore][google.cloud.discoveryengine.v1beta.DataStore]: If unspecified, * default to `GENERIC`. Vertical on Engine has to match vertical of the - * DataStore liniked to the engine. + * DataStore linked to the engine. * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.IndustryVertical industry_vertical = 16; */ @@ -156,7 +156,7 @@ class Engine extends \Google\Protobuf\Internal\Message * The restriction of the Engine industry vertical is based on * [DataStore][google.cloud.discoveryengine.v1beta.DataStore]: If unspecified, * default to `GENERIC`. Vertical on Engine has to match vertical of the - * DataStore liniked to the engine. + * DataStore linked to the engine. * @type \Google\Cloud\DiscoveryEngine\V1beta\Engine\CommonConfig $common_config * Common config spec that specifies the metadata of the engine. * } @@ -506,7 +506,7 @@ public function setSolutionType($var) * The restriction of the Engine industry vertical is based on * [DataStore][google.cloud.discoveryengine.v1beta.DataStore]: If unspecified, * default to `GENERIC`. Vertical on Engine has to match vertical of the - * DataStore liniked to the engine. + * DataStore linked to the engine. * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.IndustryVertical industry_vertical = 16; * @return int @@ -521,7 +521,7 @@ public function getIndustryVertical() * The restriction of the Engine industry vertical is based on * [DataStore][google.cloud.discoveryengine.v1beta.DataStore]: If unspecified, * default to `GENERIC`. Vertical on Engine has to match vertical of the - * DataStore liniked to the engine. + * DataStore linked to the engine. * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.IndustryVertical industry_vertical = 16; * @param int $var diff --git a/DiscoveryEngine/src/V1beta/Engine/CommonConfig.php b/DiscoveryEngine/src/V1beta/Engine/CommonConfig.php index 2ae81f8e75fc..eb89d466d8bc 100644 --- a/DiscoveryEngine/src/V1beta/Engine/CommonConfig.php +++ b/DiscoveryEngine/src/V1beta/Engine/CommonConfig.php @@ -16,10 +16,10 @@ class CommonConfig extends \Google\Protobuf\Internal\Message { /** - * Immutable. The name of the company, business or entity that is associated - * with the engine. Setting this may help improve LLM related features. + * The name of the company, business or entity that is associated with the + * engine. Setting this may help improve LLM related features. * - * Generated from protobuf field string company_name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * Generated from protobuf field string company_name = 1; */ protected $company_name = ''; @@ -30,8 +30,8 @@ class CommonConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $company_name - * Immutable. The name of the company, business or entity that is associated - * with the engine. Setting this may help improve LLM related features. + * The name of the company, business or entity that is associated with the + * engine. Setting this may help improve LLM related features. * } */ public function __construct($data = NULL) { @@ -40,10 +40,10 @@ public function __construct($data = NULL) { } /** - * Immutable. The name of the company, business or entity that is associated - * with the engine. Setting this may help improve LLM related features. + * The name of the company, business or entity that is associated with the + * engine. Setting this may help improve LLM related features. * - * Generated from protobuf field string company_name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * Generated from protobuf field string company_name = 1; * @return string */ public function getCompanyName() @@ -52,10 +52,10 @@ public function getCompanyName() } /** - * Immutable. The name of the company, business or entity that is associated - * with the engine. Setting this may help improve LLM related features. + * The name of the company, business or entity that is associated with the + * engine. Setting this may help improve LLM related features. * - * Generated from protobuf field string company_name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * Generated from protobuf field string company_name = 1; * @param string $var * @return $this */ diff --git a/DiscoveryEngine/src/V1beta/FactChunk.php b/DiscoveryEngine/src/V1beta/FactChunk.php index e3f5d819aea5..5ce9ca58d125 100644 --- a/DiscoveryEngine/src/V1beta/FactChunk.php +++ b/DiscoveryEngine/src/V1beta/FactChunk.php @@ -30,6 +30,12 @@ class FactChunk extends \Google\Protobuf\Internal\Message * Generated from protobuf field string source = 2; */ protected $source = ''; + /** + * The index of this chunk. Currently, only used for the streaming mode. + * + * Generated from protobuf field int32 index = 4; + */ + protected $index = 0; /** * More fine-grained information for the source reference. * @@ -50,6 +56,8 @@ class FactChunk extends \Google\Protobuf\Internal\Message * from the GroundingFacts provided in the request then this field will * contain the index of the specific fact from which this chunk was * retrieved. + * @type int $index + * The index of this chunk. Currently, only used for the streaming mode. * @type array|\Google\Protobuf\Internal\MapField $source_metadata * More fine-grained information for the source reference. * } @@ -117,6 +125,32 @@ public function setSource($var) return $this; } + /** + * The index of this chunk. Currently, only used for the streaming mode. + * + * Generated from protobuf field int32 index = 4; + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * The index of this chunk. Currently, only used for the streaming mode. + * + * Generated from protobuf field int32 index = 4; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + /** * More fine-grained information for the source reference. * diff --git a/DiscoveryEngine/src/V1beta/FirestoreSource.php b/DiscoveryEngine/src/V1beta/FirestoreSource.php index 11818fe19a66..9bd5228207f6 100644 --- a/DiscoveryEngine/src/V1beta/FirestoreSource.php +++ b/DiscoveryEngine/src/V1beta/FirestoreSource.php @@ -31,8 +31,8 @@ class FirestoreSource extends \Google\Protobuf\Internal\Message */ protected $database_id = ''; /** - * Required. The Firestore collection to copy the data from with a length - * limit of 1,500 characters. + * Required. The Firestore collection (or entity) to copy the data from with a + * length limit of 1,500 characters. * * Generated from protobuf field string collection_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ @@ -62,8 +62,8 @@ class FirestoreSource extends \Google\Protobuf\Internal\Message * Required. The Firestore database to copy the data from with a length limit * of 256 characters. * @type string $collection_id - * Required. The Firestore collection to copy the data from with a length - * limit of 1,500 characters. + * Required. The Firestore collection (or entity) to copy the data from with a + * length limit of 1,500 characters. * @type string $gcs_staging_dir * Intermediate Cloud Storage directory used for the import with a length * limit of 2,000 characters. Can be specified if one wants to have the @@ -136,8 +136,8 @@ public function setDatabaseId($var) } /** - * Required. The Firestore collection to copy the data from with a length - * limit of 1,500 characters. + * Required. The Firestore collection (or entity) to copy the data from with a + * length limit of 1,500 characters. * * Generated from protobuf field string collection_id = 3 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -148,8 +148,8 @@ public function getCollectionId() } /** - * Required. The Firestore collection to copy the data from with a length - * limit of 1,500 characters. + * Required. The Firestore collection (or entity) to copy the data from with a + * length limit of 1,500 characters. * * Generated from protobuf field string collection_id = 3 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/DiscoveryEngine/src/V1beta/GcsSource.php b/DiscoveryEngine/src/V1beta/GcsSource.php index 496120307c45..cbccd3b01fd0 100644 --- a/DiscoveryEngine/src/V1beta/GcsSource.php +++ b/DiscoveryEngine/src/V1beta/GcsSource.php @@ -16,7 +16,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message { /** - * Required. Cloud Storage URIs to input files. URI can be up to + * Required. Cloud Storage URIs to input files. Each URI can be up to * 2000 characters long. URIs can match the full object path (for example, * `gs://bucket/directory/object.json`) or a pattern matching one or more * files, such as `gs://bucket/directory/*.json`. @@ -45,7 +45,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message * [Schema][google.cloud.discoveryengine.v1beta.Schema] of the * data store. Each entry after the header is imported as a Document. * This can only be used by the GENERIC Data Store vertical. - * Supported values for user even imports: + * Supported values for user event imports: * * `user_event` (default): One JSON * [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent] per line. * @@ -60,7 +60,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type array|\Google\Protobuf\Internal\RepeatedField $input_uris - * Required. Cloud Storage URIs to input files. URI can be up to + * Required. Cloud Storage URIs to input files. Each URI can be up to * 2000 characters long. URIs can match the full object path (for example, * `gs://bucket/directory/object.json`) or a pattern matching one or more * files, such as `gs://bucket/directory/*.json`. @@ -85,7 +85,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message * [Schema][google.cloud.discoveryengine.v1beta.Schema] of the * data store. Each entry after the header is imported as a Document. * This can only be used by the GENERIC Data Store vertical. - * Supported values for user even imports: + * Supported values for user event imports: * * `user_event` (default): One JSON * [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent] per line. * } @@ -96,7 +96,7 @@ public function __construct($data = NULL) { } /** - * Required. Cloud Storage URIs to input files. URI can be up to + * Required. Cloud Storage URIs to input files. Each URI can be up to * 2000 characters long. URIs can match the full object path (for example, * `gs://bucket/directory/object.json`) or a pattern matching one or more * files, such as `gs://bucket/directory/*.json`. @@ -113,7 +113,7 @@ public function getInputUris() } /** - * Required. Cloud Storage URIs to input files. URI can be up to + * Required. Cloud Storage URIs to input files. Each URI can be up to * 2000 characters long. URIs can match the full object path (for example, * `gs://bucket/directory/object.json`) or a pattern matching one or more * files, such as `gs://bucket/directory/*.json`. @@ -151,7 +151,7 @@ public function setInputUris($var) * [Schema][google.cloud.discoveryengine.v1beta.Schema] of the * data store. Each entry after the header is imported as a Document. * This can only be used by the GENERIC Data Store vertical. - * Supported values for user even imports: + * Supported values for user event imports: * * `user_event` (default): One JSON * [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent] per line. * @@ -181,7 +181,7 @@ public function getDataSchema() * [Schema][google.cloud.discoveryengine.v1beta.Schema] of the * data store. Each entry after the header is imported as a Document. * This can only be used by the GENERIC Data Store vertical. - * Supported values for user even imports: + * Supported values for user event imports: * * `user_event` (default): One JSON * [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent] per line. * diff --git a/DiscoveryEngine/src/V1beta/GetControlRequest.php b/DiscoveryEngine/src/V1beta/GetControlRequest.php new file mode 100644 index 000000000000..d3c7964fc2f3 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/GetControlRequest.php @@ -0,0 +1,86 @@ +google.cloud.discoveryengine.v1beta.GetControlRequest + */ +class GetControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * Please see {@see ControlServiceClient::controlName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1beta\GetControlRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Control to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/ListControlsRequest.php b/DiscoveryEngine/src/V1beta/ListControlsRequest.php new file mode 100644 index 000000000000..4bacc6c23131 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/ListControlsRequest.php @@ -0,0 +1,218 @@ +google.cloud.discoveryengine.v1beta.ListControlsRequest + */ +class ListControlsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.discoveryengine.v1beta.ListControlsRequest.filter] is + * unset. Currently this field is unsupported. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. Please see + * {@see ControlServiceClient::dataStoreName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1beta\ListControlsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * @type int $page_size + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * @type string $filter + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.discoveryengine.v1beta.ListControlsRequest.filter] is + * unset. Currently this field is unsupported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * or + * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.discoveryengine.v1beta.ListControlsRequest.filter] is + * unset. Currently this field is unsupported. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * [filter][google.cloud.discoveryengine.v1beta.ListControlsRequest.filter] is + * unset. Currently this field is unsupported. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/ListControlsResponse.php b/DiscoveryEngine/src/V1beta/ListControlsResponse.php new file mode 100644 index 000000000000..a27000867a72 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/ListControlsResponse.php @@ -0,0 +1,101 @@ +google.cloud.discoveryengine.v1beta.ListControlsResponse + */ +class ListControlsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All the Controls for a given data store. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Control controls = 1; + */ + private $controls; + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1beta\Control>|\Google\Protobuf\Internal\RepeatedField $controls + * All the Controls for a given data store. + * @type string $next_page_token + * Pagination token, if not returned indicates the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * All the Controls for a given data store. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Control controls = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getControls() + { + return $this->controls; + } + + /** + * All the Controls for a given data store. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.Control controls = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1beta\Control>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setControls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\Control::class); + $this->controls = $arr; + + return $this; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token, if not returned indicates the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/ListCustomModelsRequest.php b/DiscoveryEngine/src/V1beta/ListCustomModelsRequest.php new file mode 100644 index 000000000000..409b681ca842 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/ListCustomModelsRequest.php @@ -0,0 +1,81 @@ +google.cloud.discoveryengine.v1beta.ListCustomModelsRequest + */ +class ListCustomModelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the parent Data Store, such as + * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + * This field is used to identify the data store where to fetch the models + * from. + * + * Generated from protobuf field string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $data_store = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $data_store + * Required. The resource name of the parent Data Store, such as + * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + * This field is used to identify the data store where to fetch the models + * from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\SearchTuningService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the parent Data Store, such as + * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + * This field is used to identify the data store where to fetch the models + * from. + * + * Generated from protobuf field string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDataStore() + { + return $this->data_store; + } + + /** + * Required. The resource name of the parent Data Store, such as + * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + * This field is used to identify the data store where to fetch the models + * from. + * + * Generated from protobuf field string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataStore($var) + { + GPBUtil::checkString($var, True); + $this->data_store = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/ListCustomModelsResponse.php b/DiscoveryEngine/src/V1beta/ListCustomModelsResponse.php new file mode 100644 index 000000000000..1aad66067280 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/ListCustomModelsResponse.php @@ -0,0 +1,69 @@ +google.cloud.discoveryengine.v1beta.ListCustomModelsResponse + */ +class ListCustomModelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of custom tuning models. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.CustomTuningModel models = 1; + */ + private $models; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1beta\CustomTuningModel>|\Google\Protobuf\Internal\RepeatedField $models + * List of custom tuning models. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\SearchTuningService::initOnce(); + parent::__construct($data); + } + + /** + * List of custom tuning models. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.CustomTuningModel models = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModels() + { + return $this->models; + } + + /** + * List of custom tuning models. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.CustomTuningModel models = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1beta\CustomTuningModel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\CustomTuningModel::class); + $this->models = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/ListDataStoresRequest.php b/DiscoveryEngine/src/V1beta/ListDataStoresRequest.php index 39dd831d0f20..80247f2792cd 100644 --- a/DiscoveryEngine/src/V1beta/ListDataStoresRequest.php +++ b/DiscoveryEngine/src/V1beta/ListDataStoresRequest.php @@ -53,8 +53,8 @@ class ListDataStoresRequest extends \Google\Protobuf\Internal\Message */ protected $page_token = ''; /** - * Filter by solution type. For example: filter = - * 'solution_type:SOLUTION_TYPE_SEARCH' + * Filter by solution type . + * For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` * * Generated from protobuf field string filter = 4; */ @@ -110,8 +110,8 @@ public static function build(string $parent): self * must match the call that provided the page token. Otherwise, an * INVALID_ARGUMENT error is returned. * @type string $filter - * Filter by solution type. For example: filter = - * 'solution_type:SOLUTION_TYPE_SEARCH' + * Filter by solution type . + * For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` * } */ public function __construct($data = NULL) { @@ -232,8 +232,8 @@ public function setPageToken($var) } /** - * Filter by solution type. For example: filter = - * 'solution_type:SOLUTION_TYPE_SEARCH' + * Filter by solution type . + * For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` * * Generated from protobuf field string filter = 4; * @return string @@ -244,8 +244,8 @@ public function getFilter() } /** - * Filter by solution type. For example: filter = - * 'solution_type:SOLUTION_TYPE_SEARCH' + * Filter by solution type . + * For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` * * Generated from protobuf field string filter = 4; * @param string $var diff --git a/DiscoveryEngine/src/V1beta/ListDocumentsRequest.php b/DiscoveryEngine/src/V1beta/ListDocumentsRequest.php index 2257b17f5bff..c7e88d10d26a 100644 --- a/DiscoveryEngine/src/V1beta/ListDocumentsRequest.php +++ b/DiscoveryEngine/src/V1beta/ListDocumentsRequest.php @@ -33,7 +33,7 @@ class ListDocumentsRequest extends \Google\Protobuf\Internal\Message /** * Maximum number of [Document][google.cloud.discoveryengine.v1beta.Document]s * to return. If unspecified, defaults to 100. The maximum allowed value is - * 1000. Values above 1000 will be coerced to 1000. + * 1000. Values above 1000 are set to 1000. * If this field is negative, an `INVALID_ARGUMENT` error is returned. * * Generated from protobuf field int32 page_size = 2; @@ -94,7 +94,7 @@ public static function build(string $parent): self * @type int $page_size * Maximum number of [Document][google.cloud.discoveryengine.v1beta.Document]s * to return. If unspecified, defaults to 100. The maximum allowed value is - * 1000. Values above 1000 will be coerced to 1000. + * 1000. Values above 1000 are set to 1000. * If this field is negative, an `INVALID_ARGUMENT` error is returned. * @type string $page_token * A page token @@ -156,7 +156,7 @@ public function setParent($var) /** * Maximum number of [Document][google.cloud.discoveryengine.v1beta.Document]s * to return. If unspecified, defaults to 100. The maximum allowed value is - * 1000. Values above 1000 will be coerced to 1000. + * 1000. Values above 1000 are set to 1000. * If this field is negative, an `INVALID_ARGUMENT` error is returned. * * Generated from protobuf field int32 page_size = 2; @@ -170,7 +170,7 @@ public function getPageSize() /** * Maximum number of [Document][google.cloud.discoveryengine.v1beta.Document]s * to return. If unspecified, defaults to 100. The maximum allowed value is - * 1000. Values above 1000 will be coerced to 1000. + * 1000. Values above 1000 are set to 1000. * If this field is negative, an `INVALID_ARGUMENT` error is returned. * * Generated from protobuf field int32 page_size = 2; diff --git a/DiscoveryEngine/src/V1beta/ListSchemasRequest.php b/DiscoveryEngine/src/V1beta/ListSchemasRequest.php index d1de3973ccbd..f22fd559254c 100644 --- a/DiscoveryEngine/src/V1beta/ListSchemasRequest.php +++ b/DiscoveryEngine/src/V1beta/ListSchemasRequest.php @@ -28,8 +28,8 @@ class ListSchemasRequest extends \Google\Protobuf\Internal\Message * The maximum number of [Schema][google.cloud.discoveryengine.v1beta.Schema]s * to return. The service may return fewer than this value. * If unspecified, at most 100 - * [Schema][google.cloud.discoveryengine.v1beta.Schema]s will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * [Schema][google.cloud.discoveryengine.v1beta.Schema]s are returned. + * The maximum value is 1000; values above 1000 are set to 1000. * * Generated from protobuf field int32 page_size = 2; */ @@ -74,8 +74,8 @@ public static function build(string $parent): self * The maximum number of [Schema][google.cloud.discoveryengine.v1beta.Schema]s * to return. The service may return fewer than this value. * If unspecified, at most 100 - * [Schema][google.cloud.discoveryengine.v1beta.Schema]s will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * [Schema][google.cloud.discoveryengine.v1beta.Schema]s are returned. + * The maximum value is 1000; values above 1000 are set to 1000. * @type string $page_token * A page token, received from a previous * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1beta.SchemaService.ListSchemas] @@ -122,8 +122,8 @@ public function setParent($var) * The maximum number of [Schema][google.cloud.discoveryengine.v1beta.Schema]s * to return. The service may return fewer than this value. * If unspecified, at most 100 - * [Schema][google.cloud.discoveryengine.v1beta.Schema]s will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * [Schema][google.cloud.discoveryengine.v1beta.Schema]s are returned. + * The maximum value is 1000; values above 1000 are set to 1000. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -137,8 +137,8 @@ public function getPageSize() * The maximum number of [Schema][google.cloud.discoveryengine.v1beta.Schema]s * to return. The service may return fewer than this value. * If unspecified, at most 100 - * [Schema][google.cloud.discoveryengine.v1beta.Schema]s will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * [Schema][google.cloud.discoveryengine.v1beta.Schema]s are returned. + * The maximum value is 1000; values above 1000 are set to 1000. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/DiscoveryEngine/src/V1beta/Project.php b/DiscoveryEngine/src/V1beta/Project.php new file mode 100644 index 000000000000..93dcf38a2db0 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Project.php @@ -0,0 +1,213 @@ +google.cloud.discoveryengine.v1beta.Project + */ +class Project extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Full resource name of the project, for example + * `projects/{project_number}`. + * Note that when making requests, project number and project id are both + * acceptable, but the server will always respond in project number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The timestamp when this project is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when this project is successfully provisioned. + * Empty value means this project is still provisioning and is not ready for + * use. + * + * Generated from protobuf field .google.protobuf.Timestamp provision_completion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $provision_completion_time = null; + /** + * Output only. A map of terms of services. The key is the `id` of + * [ServiceTerms][google.cloud.discoveryengine.v1beta.Project.ServiceTerms]. + * + * Generated from protobuf field map service_terms_map = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $service_terms_map; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Full resource name of the project, for example + * `projects/{project_number}`. + * Note that when making requests, project number and project id are both + * acceptable, but the server will always respond in project number. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when this project is created. + * @type \Google\Protobuf\Timestamp $provision_completion_time + * Output only. The timestamp when this project is successfully provisioned. + * Empty value means this project is still provisioning and is not ready for + * use. + * @type array|\Google\Protobuf\Internal\MapField $service_terms_map + * Output only. A map of terms of services. The key is the `id` of + * [ServiceTerms][google.cloud.discoveryengine.v1beta.Project.ServiceTerms]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Project::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Full resource name of the project, for example + * `projects/{project_number}`. + * Note that when making requests, project number and project id are both + * acceptable, but the server will always respond in project number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Full resource name of the project, for example + * `projects/{project_number}`. + * Note that when making requests, project number and project id are both + * acceptable, but the server will always respond in project number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The timestamp when this project is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when this project is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when this project is successfully provisioned. + * Empty value means this project is still provisioning and is not ready for + * use. + * + * Generated from protobuf field .google.protobuf.Timestamp provision_completion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getProvisionCompletionTime() + { + return $this->provision_completion_time; + } + + public function hasProvisionCompletionTime() + { + return isset($this->provision_completion_time); + } + + public function clearProvisionCompletionTime() + { + unset($this->provision_completion_time); + } + + /** + * Output only. The timestamp when this project is successfully provisioned. + * Empty value means this project is still provisioning and is not ready for + * use. + * + * Generated from protobuf field .google.protobuf.Timestamp provision_completion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setProvisionCompletionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->provision_completion_time = $var; + + return $this; + } + + /** + * Output only. A map of terms of services. The key is the `id` of + * [ServiceTerms][google.cloud.discoveryengine.v1beta.Project.ServiceTerms]. + * + * Generated from protobuf field map service_terms_map = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getServiceTermsMap() + { + return $this->service_terms_map; + } + + /** + * Output only. A map of terms of services. The key is the `id` of + * [ServiceTerms][google.cloud.discoveryengine.v1beta.Project.ServiceTerms]. + * + * Generated from protobuf field map service_terms_map = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setServiceTermsMap($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\Project\ServiceTerms::class); + $this->service_terms_map = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/Project/ServiceTerms.php b/DiscoveryEngine/src/V1beta/Project/ServiceTerms.php new file mode 100644 index 000000000000..78898046044f --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Project/ServiceTerms.php @@ -0,0 +1,264 @@ +google.cloud.discoveryengine.v1beta.Project.ServiceTerms + */ +class ServiceTerms extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of this terms of service. + * Available terms: + * * `GA_DATA_USE_TERMS`: [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). When using this as + * `id`, the acceptable + * [version][google.cloud.discoveryengine.v1beta.Project.ServiceTerms.version] + * to provide is `2022-11-23`. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * The version string of the terms of service. + * For acceptable values, see the comments for + * [id][google.cloud.discoveryengine.v1beta.Project.ServiceTerms.id] above. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * Whether the project has accepted/rejected the service terms or it is + * still pending. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Project.ServiceTerms.State state = 4; + */ + protected $state = 0; + /** + * The last time when the project agreed to the terms of service. + * + * Generated from protobuf field .google.protobuf.Timestamp accept_time = 5; + */ + protected $accept_time = null; + /** + * The last time when the project declined or revoked the agreement to terms + * of service. + * + * Generated from protobuf field .google.protobuf.Timestamp decline_time = 6; + */ + protected $decline_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The unique identifier of this terms of service. + * Available terms: + * * `GA_DATA_USE_TERMS`: [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). When using this as + * `id`, the acceptable + * [version][google.cloud.discoveryengine.v1beta.Project.ServiceTerms.version] + * to provide is `2022-11-23`. + * @type string $version + * The version string of the terms of service. + * For acceptable values, see the comments for + * [id][google.cloud.discoveryengine.v1beta.Project.ServiceTerms.id] above. + * @type int $state + * Whether the project has accepted/rejected the service terms or it is + * still pending. + * @type \Google\Protobuf\Timestamp $accept_time + * The last time when the project agreed to the terms of service. + * @type \Google\Protobuf\Timestamp $decline_time + * The last time when the project declined or revoked the agreement to terms + * of service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Project::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of this terms of service. + * Available terms: + * * `GA_DATA_USE_TERMS`: [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). When using this as + * `id`, the acceptable + * [version][google.cloud.discoveryengine.v1beta.Project.ServiceTerms.version] + * to provide is `2022-11-23`. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The unique identifier of this terms of service. + * Available terms: + * * `GA_DATA_USE_TERMS`: [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). When using this as + * `id`, the acceptable + * [version][google.cloud.discoveryengine.v1beta.Project.ServiceTerms.version] + * to provide is `2022-11-23`. + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The version string of the terms of service. + * For acceptable values, see the comments for + * [id][google.cloud.discoveryengine.v1beta.Project.ServiceTerms.id] above. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The version string of the terms of service. + * For acceptable values, see the comments for + * [id][google.cloud.discoveryengine.v1beta.Project.ServiceTerms.id] above. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Whether the project has accepted/rejected the service terms or it is + * still pending. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Project.ServiceTerms.State state = 4; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Whether the project has accepted/rejected the service terms or it is + * still pending. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Project.ServiceTerms.State state = 4; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1beta\Project\ServiceTerms\State::class); + $this->state = $var; + + return $this; + } + + /** + * The last time when the project agreed to the terms of service. + * + * Generated from protobuf field .google.protobuf.Timestamp accept_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAcceptTime() + { + return $this->accept_time; + } + + public function hasAcceptTime() + { + return isset($this->accept_time); + } + + public function clearAcceptTime() + { + unset($this->accept_time); + } + + /** + * The last time when the project agreed to the terms of service. + * + * Generated from protobuf field .google.protobuf.Timestamp accept_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAcceptTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->accept_time = $var; + + return $this; + } + + /** + * The last time when the project declined or revoked the agreement to terms + * of service. + * + * Generated from protobuf field .google.protobuf.Timestamp decline_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeclineTime() + { + return $this->decline_time; + } + + public function hasDeclineTime() + { + return isset($this->decline_time); + } + + public function clearDeclineTime() + { + unset($this->decline_time); + } + + /** + * The last time when the project declined or revoked the agreement to terms + * of service. + * + * Generated from protobuf field .google.protobuf.Timestamp decline_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeclineTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->decline_time = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1beta/Project/ServiceTerms/State.php b/DiscoveryEngine/src/V1beta/Project/ServiceTerms/State.php new file mode 100644 index 000000000000..ed1e9fe64ac3 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/Project/ServiceTerms/State.php @@ -0,0 +1,69 @@ +google.cloud.discoveryengine.v1beta.Project.ServiceTerms.State + */ +class State +{ + /** + * The default value of the enum. This value is not actually used. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The project has given consent to the terms of service. + * + * Generated from protobuf enum TERMS_ACCEPTED = 1; + */ + const TERMS_ACCEPTED = 1; + /** + * The project is pending to review and accept the terms of service. + * + * Generated from protobuf enum TERMS_PENDING = 2; + */ + const TERMS_PENDING = 2; + /** + * The project has declined or revoked the agreement to terms of service. + * + * Generated from protobuf enum TERMS_DECLINED = 3; + */ + const TERMS_DECLINED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::TERMS_ACCEPTED => 'TERMS_ACCEPTED', + self::TERMS_PENDING => 'TERMS_PENDING', + self::TERMS_DECLINED => 'TERMS_DECLINED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/DiscoveryEngine/src/V1beta/ProvisionProjectMetadata.php b/DiscoveryEngine/src/V1beta/ProvisionProjectMetadata.php new file mode 100644 index 000000000000..4cd0d36f3454 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/ProvisionProjectMetadata.php @@ -0,0 +1,33 @@ +google.cloud.discoveryengine.v1beta.ProvisionProjectMetadata + */ +class ProvisionProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\ProjectService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/DiscoveryEngine/src/V1beta/ProvisionProjectRequest.php b/DiscoveryEngine/src/V1beta/ProvisionProjectRequest.php new file mode 100644 index 000000000000..b78f3a4eb854 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/ProvisionProjectRequest.php @@ -0,0 +1,181 @@ +google.cloud.discoveryengine.v1beta.ProvisionProjectRequest + */ +class ProvisionProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1beta.Project], such as + * `projects/{project_id_or_number}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Set to `true` to specify that caller has read and would like to + * give consent to the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). + * + * Generated from protobuf field bool accept_data_use_terms = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $accept_data_use_terms = false; + /** + * Required. The version of the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms) that caller has read + * and would like to give consent to. + * Acceptable version is `2022-11-23`, and this may change over time. + * + * Generated from protobuf field string data_use_terms_version = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_use_terms_version = ''; + + /** + * @param string $name Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1beta.Project], such as + * `projects/{project_id_or_number}`. Please see + * {@see ProjectServiceClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\DiscoveryEngine\V1beta\ProvisionProjectRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1beta.Project], such as + * `projects/{project_id_or_number}`. + * @type bool $accept_data_use_terms + * Required. Set to `true` to specify that caller has read and would like to + * give consent to the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). + * @type string $data_use_terms_version + * Required. The version of the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms) that caller has read + * and would like to give consent to. + * Acceptable version is `2022-11-23`, and this may change over time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\ProjectService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1beta.Project], such as + * `projects/{project_id_or_number}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Full resource name of a + * [Project][google.cloud.discoveryengine.v1beta.Project], such as + * `projects/{project_id_or_number}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Set to `true` to specify that caller has read and would like to + * give consent to the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). + * + * Generated from protobuf field bool accept_data_use_terms = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getAcceptDataUseTerms() + { + return $this->accept_data_use_terms; + } + + /** + * Required. Set to `true` to specify that caller has read and would like to + * give consent to the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms). + * + * Generated from protobuf field bool accept_data_use_terms = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setAcceptDataUseTerms($var) + { + GPBUtil::checkBool($var); + $this->accept_data_use_terms = $var; + + return $this; + } + + /** + * Required. The version of the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms) that caller has read + * and would like to give consent to. + * Acceptable version is `2022-11-23`, and this may change over time. + * + * Generated from protobuf field string data_use_terms_version = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataUseTermsVersion() + { + return $this->data_use_terms_version; + } + + /** + * Required. The version of the [Terms for data + * use](https://cloud.google.com/retail/data-use-terms) that caller has read + * and would like to give consent to. + * Acceptable version is `2022-11-23`, and this may change over time. + * + * Generated from protobuf field string data_use_terms_version = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataUseTermsVersion($var) + { + GPBUtil::checkString($var, True); + $this->data_use_terms_version = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/RankRequest.php b/DiscoveryEngine/src/V1beta/RankRequest.php index 2cc6bb409339..0c3c2d1458cf 100644 --- a/DiscoveryEngine/src/V1beta/RankRequest.php +++ b/DiscoveryEngine/src/V1beta/RankRequest.php @@ -59,6 +59,26 @@ class RankRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool ignore_record_details_in_response = 6; */ protected $ignore_record_details_in_response = false; + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 7; + */ + private $user_labels; /** * Constructor. @@ -84,6 +104,22 @@ class RankRequest extends \Google\Protobuf\Internal\Message * @type bool $ignore_record_details_in_response * If true, the response will contain only record ID and score. By default, it * is false, the response will contain record details. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. * } */ public function __construct($data = NULL) { @@ -259,5 +295,59 @@ public function setIgnoreRecordDetailsInResponse($var) return $this; } + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 7; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/RecommendRequest.php b/DiscoveryEngine/src/V1beta/RecommendRequest.php index ea146a0ce30c..332187566fea 100644 --- a/DiscoveryEngine/src/V1beta/RecommendRequest.php +++ b/DiscoveryEngine/src/V1beta/RecommendRequest.php @@ -21,7 +21,7 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` @@ -54,9 +54,9 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message protected $user_event = null; /** * Maximum number of results to return. Set this property - * to the number of recommendation results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * to the number of recommendation results needed. If zero, the service + * chooses a reasonable default. The maximum allowed value is 100. Values + * above 100 are set to 100. * * Generated from protobuf field int32 page_size = 3; */ @@ -74,21 +74,21 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie")) * * (available: true) AND * (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) - * If your filter blocks all results, the API will return generic + * If your filter blocks all results, the API returns generic * (unfiltered) popular Documents. If you only want results strictly matching - * the filters, set `strictFiltering` to True in + * the filters, set `strictFiltering` to `true` in * [RecommendRequest.params][google.cloud.discoveryengine.v1beta.RecommendRequest.params] * to receive empty results instead. - * Note that the API will never return + * Note that the API never returns * [Document][google.cloud.discoveryengine.v1beta.Document]s with - * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices. + * `storageStatus` as `EXPIRED` or `DELETED` regardless of filter choices. * * Generated from protobuf field string filter = 4; */ protected $filter = ''; /** - * Use validate only mode for this recommendation query. If set to true, a - * fake model will be used that returns arbitrary Document IDs. + * Use validate only mode for this recommendation query. If set to `true`, a + * fake model is used that returns arbitrary Document IDs. * Note that the validate only mode should only be used for testing the API, * or if the model is not ready. * @@ -98,16 +98,17 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message /** * Additional domain specific parameters for the recommendations. * Allowed values: - * * `returnDocument`: Boolean. If set to true, the associated Document - * object will be returned in + * * `returnDocument`: Boolean. If set to `true`, the associated Document + * object is returned in * [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.document]. - * * `returnScore`: Boolean. If set to true, the recommendation 'score' - * corresponding to each returned Document will be set in + * * `returnScore`: Boolean. If set to true, the recommendation score + * corresponding to each returned Document is set in * [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.metadata]. - * The given 'score' indicates the probability of a Document conversion - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular Documents instead of empty if + * The given score indicates the probability of a Document conversion given + * the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to `false`, the + * service + * returns generic (unfiltered) popular Documents instead of empty if * your filter blocks all recommendation results. * * `diversityLevel`: String. Default empty. If set to be non-empty, then * it needs to be one of: @@ -158,7 +159,7 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` @@ -183,9 +184,9 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * unset. * @type int $page_size * Maximum number of results to return. Set this property - * to the number of recommendation results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * to the number of recommendation results needed. If zero, the service + * chooses a reasonable default. The maximum allowed value is 100. Values + * above 100 are set to 100. * @type string $filter * Filter for restricting recommendation results with a length limit of 5,000 * characters. Currently, only filter expressions on the `filter_tags` @@ -199,32 +200,33 @@ class RecommendRequest extends \Google\Protobuf\Internal\Message * * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie")) * * (available: true) AND * (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) - * If your filter blocks all results, the API will return generic + * If your filter blocks all results, the API returns generic * (unfiltered) popular Documents. If you only want results strictly matching - * the filters, set `strictFiltering` to True in + * the filters, set `strictFiltering` to `true` in * [RecommendRequest.params][google.cloud.discoveryengine.v1beta.RecommendRequest.params] * to receive empty results instead. - * Note that the API will never return + * Note that the API never returns * [Document][google.cloud.discoveryengine.v1beta.Document]s with - * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices. + * `storageStatus` as `EXPIRED` or `DELETED` regardless of filter choices. * @type bool $validate_only - * Use validate only mode for this recommendation query. If set to true, a - * fake model will be used that returns arbitrary Document IDs. + * Use validate only mode for this recommendation query. If set to `true`, a + * fake model is used that returns arbitrary Document IDs. * Note that the validate only mode should only be used for testing the API, * or if the model is not ready. * @type array|\Google\Protobuf\Internal\MapField $params * Additional domain specific parameters for the recommendations. * Allowed values: - * * `returnDocument`: Boolean. If set to true, the associated Document - * object will be returned in + * * `returnDocument`: Boolean. If set to `true`, the associated Document + * object is returned in * [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.document]. - * * `returnScore`: Boolean. If set to true, the recommendation 'score' - * corresponding to each returned Document will be set in + * * `returnScore`: Boolean. If set to true, the recommendation score + * corresponding to each returned Document is set in * [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.metadata]. - * The given 'score' indicates the probability of a Document conversion - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular Documents instead of empty if + * The given score indicates the probability of a Document conversion given + * the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to `false`, the + * service + * returns generic (unfiltered) popular Documents instead of empty if * your filter blocks all recommendation results. * * `diversityLevel`: String. Default empty. If set to be non-empty, then * it needs to be one of: @@ -267,7 +269,7 @@ public function __construct($data = NULL) { * `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` @@ -289,7 +291,7 @@ public function getServingConfig() * `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` * One default serving config is created along with your recommendation engine - * creation. The engine ID will be used as the ID of the default serving + * creation. The engine ID is used as the ID of the default serving * config. For example, for Engine * `projects/*/locations/global/collections/*/engines/my-engine`, you can use * `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` @@ -375,9 +377,9 @@ public function setUserEvent($var) /** * Maximum number of results to return. Set this property - * to the number of recommendation results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * to the number of recommendation results needed. If zero, the service + * chooses a reasonable default. The maximum allowed value is 100. Values + * above 100 are set to 100. * * Generated from protobuf field int32 page_size = 3; * @return int @@ -389,9 +391,9 @@ public function getPageSize() /** * Maximum number of results to return. Set this property - * to the number of recommendation results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * to the number of recommendation results needed. If zero, the service + * chooses a reasonable default. The maximum allowed value is 100. Values + * above 100 are set to 100. * * Generated from protobuf field int32 page_size = 3; * @param int $var @@ -418,14 +420,14 @@ public function setPageSize($var) * * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie")) * * (available: true) AND * (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) - * If your filter blocks all results, the API will return generic + * If your filter blocks all results, the API returns generic * (unfiltered) popular Documents. If you only want results strictly matching - * the filters, set `strictFiltering` to True in + * the filters, set `strictFiltering` to `true` in * [RecommendRequest.params][google.cloud.discoveryengine.v1beta.RecommendRequest.params] * to receive empty results instead. - * Note that the API will never return + * Note that the API never returns * [Document][google.cloud.discoveryengine.v1beta.Document]s with - * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices. + * `storageStatus` as `EXPIRED` or `DELETED` regardless of filter choices. * * Generated from protobuf field string filter = 4; * @return string @@ -448,14 +450,14 @@ public function getFilter() * * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie")) * * (available: true) AND * (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) - * If your filter blocks all results, the API will return generic + * If your filter blocks all results, the API returns generic * (unfiltered) popular Documents. If you only want results strictly matching - * the filters, set `strictFiltering` to True in + * the filters, set `strictFiltering` to `true` in * [RecommendRequest.params][google.cloud.discoveryengine.v1beta.RecommendRequest.params] * to receive empty results instead. - * Note that the API will never return + * Note that the API never returns * [Document][google.cloud.discoveryengine.v1beta.Document]s with - * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices. + * `storageStatus` as `EXPIRED` or `DELETED` regardless of filter choices. * * Generated from protobuf field string filter = 4; * @param string $var @@ -470,8 +472,8 @@ public function setFilter($var) } /** - * Use validate only mode for this recommendation query. If set to true, a - * fake model will be used that returns arbitrary Document IDs. + * Use validate only mode for this recommendation query. If set to `true`, a + * fake model is used that returns arbitrary Document IDs. * Note that the validate only mode should only be used for testing the API, * or if the model is not ready. * @@ -484,8 +486,8 @@ public function getValidateOnly() } /** - * Use validate only mode for this recommendation query. If set to true, a - * fake model will be used that returns arbitrary Document IDs. + * Use validate only mode for this recommendation query. If set to `true`, a + * fake model is used that returns arbitrary Document IDs. * Note that the validate only mode should only be used for testing the API, * or if the model is not ready. * @@ -504,16 +506,17 @@ public function setValidateOnly($var) /** * Additional domain specific parameters for the recommendations. * Allowed values: - * * `returnDocument`: Boolean. If set to true, the associated Document - * object will be returned in + * * `returnDocument`: Boolean. If set to `true`, the associated Document + * object is returned in * [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.document]. - * * `returnScore`: Boolean. If set to true, the recommendation 'score' - * corresponding to each returned Document will be set in + * * `returnScore`: Boolean. If set to true, the recommendation score + * corresponding to each returned Document is set in * [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.metadata]. - * The given 'score' indicates the probability of a Document conversion - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular Documents instead of empty if + * The given score indicates the probability of a Document conversion given + * the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to `false`, the + * service + * returns generic (unfiltered) popular Documents instead of empty if * your filter blocks all recommendation results. * * `diversityLevel`: String. Default empty. If set to be non-empty, then * it needs to be one of: @@ -539,16 +542,17 @@ public function getParams() /** * Additional domain specific parameters for the recommendations. * Allowed values: - * * `returnDocument`: Boolean. If set to true, the associated Document - * object will be returned in + * * `returnDocument`: Boolean. If set to `true`, the associated Document + * object is returned in * [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.document]. - * * `returnScore`: Boolean. If set to true, the recommendation 'score' - * corresponding to each returned Document will be set in + * * `returnScore`: Boolean. If set to true, the recommendation score + * corresponding to each returned Document is set in * [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.metadata]. - * The given 'score' indicates the probability of a Document conversion - * given the user's context and history. - * * `strictFiltering`: Boolean. True by default. If set to false, the service - * will return generic (unfiltered) popular Documents instead of empty if + * The given score indicates the probability of a Document conversion given + * the user's context and history. + * * `strictFiltering`: Boolean. True by default. If set to `false`, the + * service + * returns generic (unfiltered) popular Documents instead of empty if * your filter blocks all recommendation results. * * `diversityLevel`: String. Default empty. If set to be non-empty, then * it needs to be one of: diff --git a/DiscoveryEngine/src/V1beta/RecommendResponse/RecommendationResult.php b/DiscoveryEngine/src/V1beta/RecommendResponse/RecommendationResult.php index 1f9f2f67608b..b543288369ab 100644 --- a/DiscoveryEngine/src/V1beta/RecommendResponse/RecommendationResult.php +++ b/DiscoveryEngine/src/V1beta/RecommendResponse/RecommendationResult.php @@ -30,7 +30,7 @@ class RecommendationResult extends \Google\Protobuf\Internal\Message */ protected $document = null; /** - * Additional Document metadata / annotations. + * Additional Document metadata or annotations. * Possible values: * * `score`: Recommendation score in double value. Is set if * `returnScore` is set to true in @@ -52,7 +52,7 @@ class RecommendationResult extends \Google\Protobuf\Internal\Message * Set if `returnDocument` is set to true in * [RecommendRequest.params][google.cloud.discoveryengine.v1beta.RecommendRequest.params]. * @type array|\Google\Protobuf\Internal\MapField $metadata - * Additional Document metadata / annotations. + * Additional Document metadata or annotations. * Possible values: * * `score`: Recommendation score in double value. Is set if * `returnScore` is set to true in @@ -129,7 +129,7 @@ public function setDocument($var) } /** - * Additional Document metadata / annotations. + * Additional Document metadata or annotations. * Possible values: * * `score`: Recommendation score in double value. Is set if * `returnScore` is set to true in @@ -144,7 +144,7 @@ public function getMetadata() } /** - * Additional Document metadata / annotations. + * Additional Document metadata or annotations. * Possible values: * * `score`: Recommendation score in double value. Is set if * `returnScore` is set to true in diff --git a/DiscoveryEngine/src/V1beta/SearchRequest.php b/DiscoveryEngine/src/V1beta/SearchRequest.php index b2f9b1b1acc3..e7283f2c198b 100644 --- a/DiscoveryEngine/src/V1beta/SearchRequest.php +++ b/DiscoveryEngine/src/V1beta/SearchRequest.php @@ -86,7 +86,10 @@ class SearchRequest extends \Google\Protobuf\Internal\Message */ protected $offset = 0; /** - * A list of data store specs to apply on a search call. + * Specs defining dataStores to filter on in a search call and configurations + * for those dataStores. This is only considered for engines with multiple + * dataStores use case. For single dataStore within an engine, they should + * use the specs at the top level. * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchRequest.DataStoreSpec data_store_specs = 32; */ @@ -127,7 +130,8 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * The order in which documents are returned. Documents can be ordered by * a field in an [Document][google.cloud.discoveryengine.v1beta.Document] * object. Leave it unset if ordered by relevance. `order_by` expression is - * case-sensitive. For more information on ordering, see + * case-sensitive. + * For more information on ordering for retail search, see * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. * @@ -154,7 +158,7 @@ class SearchRequest extends \Google\Protobuf\Internal\Message /** * Boost specification to boost certain documents. * For more information on boosting, see - * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10; */ @@ -164,15 +168,13 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * For public website search only, supported values are: * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. - * Example: - * user_country_code: "au" + * For example, `user_country_code: "au"` * For available codes see [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * Example: - * search_type: 1 + * For example, `search_type: 1` * * Generated from protobuf field map params = 11; */ @@ -326,7 +328,10 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * is unset. * If this field is negative, an `INVALID_ARGUMENT` is returned. * @type array<\Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\DataStoreSpec>|\Google\Protobuf\Internal\RepeatedField $data_store_specs - * A list of data store specs to apply on a search call. + * Specs defining dataStores to filter on in a search call and configurations + * for those dataStores. This is only considered for engines with multiple + * dataStores use case. For single dataStore within an engine, they should + * use the specs at the top level. * @type string $filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the documents being filtered. Filter @@ -355,7 +360,8 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * The order in which documents are returned. Documents can be ordered by * a field in an [Document][google.cloud.discoveryengine.v1beta.Document] * object. Leave it unset if ordered by relevance. `order_by` expression is - * case-sensitive. For more information on ordering, see + * case-sensitive. + * For more information on ordering for retail search, see * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. * @type \Google\Cloud\DiscoveryEngine\V1beta\UserInfo $user_info @@ -370,21 +376,19 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\BoostSpec $boost_spec * Boost specification to boost certain documents. * For more information on boosting, see - * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) * @type array|\Google\Protobuf\Internal\MapField $params * Additional search parameters. * For public website search only, supported values are: * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. - * Example: - * user_country_code: "au" + * For example, `user_country_code: "au"` * For available codes see [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * Example: - * search_type: 1 + * For example, `search_type: 1` * @type \Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\QueryExpansionSpec $query_expansion_spec * The query expansion specification that specifies the conditions under which * query expansion occurs. @@ -706,7 +710,10 @@ public function setOffset($var) } /** - * A list of data store specs to apply on a search call. + * Specs defining dataStores to filter on in a search call and configurations + * for those dataStores. This is only considered for engines with multiple + * dataStores use case. For single dataStore within an engine, they should + * use the specs at the top level. * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchRequest.DataStoreSpec data_store_specs = 32; * @return \Google\Protobuf\Internal\RepeatedField @@ -717,7 +724,10 @@ public function getDataStoreSpecs() } /** - * A list of data store specs to apply on a search call. + * Specs defining dataStores to filter on in a search call and configurations + * for those dataStores. This is only considered for engines with multiple + * dataStores use case. For single dataStore within an engine, they should + * use the specs at the top level. * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchRequest.DataStoreSpec data_store_specs = 32; * @param array<\Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\DataStoreSpec>|\Google\Protobuf\Internal\RepeatedField $var @@ -827,7 +837,8 @@ public function setCanonicalFilter($var) * The order in which documents are returned. Documents can be ordered by * a field in an [Document][google.cloud.discoveryengine.v1beta.Document] * object. Leave it unset if ordered by relevance. `order_by` expression is - * case-sensitive. For more information on ordering, see + * case-sensitive. + * For more information on ordering for retail search, see * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. * @@ -843,7 +854,8 @@ public function getOrderBy() * The order in which documents are returned. Documents can be ordered by * a field in an [Document][google.cloud.discoveryengine.v1beta.Document] * object. Leave it unset if ordered by relevance. `order_by` expression is - * case-sensitive. For more information on ordering, see + * case-sensitive. + * For more information on ordering for retail search, see * [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. * @@ -934,7 +946,7 @@ public function setFacetSpecs($var) /** * Boost specification to boost certain documents. * For more information on boosting, see - * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10; * @return \Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\BoostSpec|null @@ -957,7 +969,7 @@ public function clearBoostSpec() /** * Boost specification to boost certain documents. * For more information on boosting, see - * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10; * @param \Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\BoostSpec $var @@ -976,15 +988,13 @@ public function setBoostSpec($var) * For public website search only, supported values are: * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. - * Example: - * user_country_code: "au" + * For example, `user_country_code: "au"` * For available codes see [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * Example: - * search_type: 1 + * For example, `search_type: 1` * * Generated from protobuf field map params = 11; * @return \Google\Protobuf\Internal\MapField @@ -999,15 +1009,13 @@ public function getParams() * For public website search only, supported values are: * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. - * Example: - * user_country_code: "au" + * For example, `user_country_code: "au"` * For available codes see [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * Example: - * search_type: 1 + * For example, `search_type: 1` * * Generated from protobuf field map params = 11; * @param array|\Google\Protobuf\Internal\MapField $var diff --git a/DiscoveryEngine/src/V1beta/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php b/DiscoveryEngine/src/V1beta/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php index c42c8cf684b8..c2d9fedd1e00 100644 --- a/DiscoveryEngine/src/V1beta/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php +++ b/DiscoveryEngine/src/V1beta/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php @@ -35,7 +35,7 @@ class AttributeType * specified. The value must be formatted as an XSD `dayTimeDuration` * value (a restricted subset of an ISO 8601 duration value). The * pattern for this is: `[nD][T[nH][nM][nS]]`. - * E.g. `5D`, `3DT12H30M`, `T24H`. + * For example, `5D`, `3DT12H30M`, `T24H`. * * Generated from protobuf enum FRESHNESS = 2; */ diff --git a/DiscoveryEngine/src/V1beta/SearchRequest/ContentSearchSpec/SummarySpec.php b/DiscoveryEngine/src/V1beta/SearchRequest/ContentSearchSpec/SummarySpec.php index dab93e47d9a9..8f0ea5c1237d 100644 --- a/DiscoveryEngine/src/V1beta/SearchRequest/ContentSearchSpec/SummarySpec.php +++ b/DiscoveryEngine/src/V1beta/SearchRequest/ContentSearchSpec/SummarySpec.php @@ -20,7 +20,10 @@ class SummarySpec extends \Google\Protobuf\Internal\Message * The number of top results to generate the summary from. If the number * of results returned is less than `summaryResultCount`, the summary is * generated from all of the results. - * At most 10 results can be used to generate a summary. + * At most 10 results for documents mode, or 50 for chunks mode, can be + * used to generate a summary. The chunks mode is used when + * [SearchRequest.ContentSearchSpec.search_result_mode][] is set to + * [CHUNKS][SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS]. * * Generated from protobuf field int32 summary_result_count = 1; */ @@ -116,7 +119,10 @@ class SummarySpec extends \Google\Protobuf\Internal\Message * The number of top results to generate the summary from. If the number * of results returned is less than `summaryResultCount`, the summary is * generated from all of the results. - * At most 10 results can be used to generate a summary. + * At most 10 results for documents mode, or 50 for chunks mode, can be + * used to generate a summary. The chunks mode is used when + * [SearchRequest.ContentSearchSpec.search_result_mode][] is set to + * [CHUNKS][SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS]. * @type bool $include_citations * Specifies whether to include citations in the summary. The default * value is `false`. @@ -180,7 +186,10 @@ public function __construct($data = NULL) { * The number of top results to generate the summary from. If the number * of results returned is less than `summaryResultCount`, the summary is * generated from all of the results. - * At most 10 results can be used to generate a summary. + * At most 10 results for documents mode, or 50 for chunks mode, can be + * used to generate a summary. The chunks mode is used when + * [SearchRequest.ContentSearchSpec.search_result_mode][] is set to + * [CHUNKS][SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS]. * * Generated from protobuf field int32 summary_result_count = 1; * @return int @@ -194,7 +203,10 @@ public function getSummaryResultCount() * The number of top results to generate the summary from. If the number * of results returned is less than `summaryResultCount`, the summary is * generated from all of the results. - * At most 10 results can be used to generate a summary. + * At most 10 results for documents mode, or 50 for chunks mode, can be + * used to generate a summary. The chunks mode is used when + * [SearchRequest.ContentSearchSpec.search_result_mode][] is set to + * [CHUNKS][SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS]. * * Generated from protobuf field int32 summary_result_count = 1; * @param int $var diff --git a/DiscoveryEngine/src/V1beta/SearchRequest/DataStoreSpec.php b/DiscoveryEngine/src/V1beta/SearchRequest/DataStoreSpec.php index fb6997a48612..7682110a1012 100644 --- a/DiscoveryEngine/src/V1beta/SearchRequest/DataStoreSpec.php +++ b/DiscoveryEngine/src/V1beta/SearchRequest/DataStoreSpec.php @@ -9,7 +9,9 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A struct to define data stores to filter on in a search call. + * A struct to define data stores to filter on in a search call and + * configurations for those data stores. A maximum of 1 DataStoreSpec per + * data_store is allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. * * Generated from protobuf message google.cloud.discoveryengine.v1beta.SearchRequest.DataStoreSpec */ diff --git a/DiscoveryEngine/src/V1beta/SearchRequest/FacetSpec.php b/DiscoveryEngine/src/V1beta/SearchRequest/FacetSpec.php index b9bccac24e5e..8f4043868e2e 100644 --- a/DiscoveryEngine/src/V1beta/SearchRequest/FacetSpec.php +++ b/DiscoveryEngine/src/V1beta/SearchRequest/FacetSpec.php @@ -22,7 +22,7 @@ class FacetSpec extends \Google\Protobuf\Internal\Message */ protected $facet_key = null; /** - * Maximum of facet values that should be returned for this facet. If + * Maximum facet values that are returned for this facet. If * unspecified, defaults to 20. The maximum allowed value is 300. Values * above 300 are coerced to 300. * If this field is negative, an `INVALID_ARGUMENT` is returned. @@ -94,7 +94,7 @@ class FacetSpec extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DiscoveryEngine\V1beta\SearchRequest\FacetSpec\FacetKey $facet_key * Required. The facet key specification. * @type int $limit - * Maximum of facet values that should be returned for this facet. If + * Maximum facet values that are returned for this facet. If * unspecified, defaults to 20. The maximum allowed value is 300. Values * above 300 are coerced to 300. * If this field is negative, an `INVALID_ARGUMENT` is returned. @@ -188,7 +188,7 @@ public function setFacetKey($var) } /** - * Maximum of facet values that should be returned for this facet. If + * Maximum facet values that are returned for this facet. If * unspecified, defaults to 20. The maximum allowed value is 300. Values * above 300 are coerced to 300. * If this field is negative, an `INVALID_ARGUMENT` is returned. @@ -202,7 +202,7 @@ public function getLimit() } /** - * Maximum of facet values that should be returned for this facet. If + * Maximum facet values that are returned for this facet. If * unspecified, defaults to 20. The maximum allowed value is 300. Values * above 300 are coerced to 300. * If this field is negative, an `INVALID_ARGUMENT` is returned. diff --git a/DiscoveryEngine/src/V1beta/SearchRequest/FacetSpec/FacetKey.php b/DiscoveryEngine/src/V1beta/SearchRequest/FacetSpec/FacetKey.php index 2c22cd2d327a..cf19c735df27 100644 --- a/DiscoveryEngine/src/V1beta/SearchRequest/FacetSpec/FacetKey.php +++ b/DiscoveryEngine/src/V1beta/SearchRequest/FacetSpec/FacetKey.php @@ -53,7 +53,7 @@ class FacetKey extends \Google\Protobuf\Internal\Message */ private $prefixes; /** - * Only get facet values that contains the given strings. For example, + * Only get facet values that contain the given strings. For example, * suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". @@ -116,7 +116,7 @@ class FacetKey extends \Google\Protobuf\Internal\Message * "category" facet only contains "Action > 2022" and "Action > 2021". * Only supported on textual fields. Maximum is 10. * @type array|\Google\Protobuf\Internal\RepeatedField $contains - * Only get facet values that contains the given strings. For example, + * Only get facet values that contain the given strings. For example, * suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". @@ -276,7 +276,7 @@ public function setPrefixes($var) } /** - * Only get facet values that contains the given strings. For example, + * Only get facet values that contain the given strings. For example, * suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". @@ -291,7 +291,7 @@ public function getContains() } /** - * Only get facet values that contains the given strings. For example, + * Only get facet values that contain the given strings. For example, * suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". diff --git a/DiscoveryEngine/src/V1beta/SearchRequest/SpellCorrectionSpec.php b/DiscoveryEngine/src/V1beta/SearchRequest/SpellCorrectionSpec.php index a9d063e6f598..2fe848a052b7 100644 --- a/DiscoveryEngine/src/V1beta/SearchRequest/SpellCorrectionSpec.php +++ b/DiscoveryEngine/src/V1beta/SearchRequest/SpellCorrectionSpec.php @@ -16,8 +16,8 @@ class SpellCorrectionSpec extends \Google\Protobuf\Internal\Message { /** - * The mode under which spell correction should take effect to - * replace the original search query. Default to + * The mode under which spell correction + * replaces the original search query. Defaults to * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1; @@ -31,8 +31,8 @@ class SpellCorrectionSpec extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $mode - * The mode under which spell correction should take effect to - * replace the original search query. Default to + * The mode under which spell correction + * replaces the original search query. Defaults to * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. * } */ @@ -42,8 +42,8 @@ public function __construct($data = NULL) { } /** - * The mode under which spell correction should take effect to - * replace the original search query. Default to + * The mode under which spell correction + * replaces the original search query. Defaults to * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1; @@ -55,8 +55,8 @@ public function getMode() } /** - * The mode under which spell correction should take effect to - * replace the original search query. Default to + * The mode under which spell correction + * replaces the original search query. Defaults to * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1; diff --git a/DiscoveryEngine/src/V1beta/SearchRequest/SpellCorrectionSpec/Mode.php b/DiscoveryEngine/src/V1beta/SearchRequest/SpellCorrectionSpec/Mode.php index 8297f114d490..b88e38c01d0b 100644 --- a/DiscoveryEngine/src/V1beta/SearchRequest/SpellCorrectionSpec/Mode.php +++ b/DiscoveryEngine/src/V1beta/SearchRequest/SpellCorrectionSpec/Mode.php @@ -22,10 +22,10 @@ class Mode */ const MODE_UNSPECIFIED = 0; /** - * Search API will try to find a spell suggestion if there - * is any and put in the + * Search API tries to find a spelling suggestion. If a suggestion is + * found, it is put in the * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1beta.SearchResponse.corrected_query]. - * The spell suggestion will not be used as the search query. + * The spelling suggestion won't be used as the search query. * * Generated from protobuf enum SUGGESTION_ONLY = 1; */ diff --git a/DiscoveryEngine/src/V1beta/SearchResponse.php b/DiscoveryEngine/src/V1beta/SearchResponse.php index 1e67a1346e68..f8f96066b7f7 100644 --- a/DiscoveryEngine/src/V1beta/SearchResponse.php +++ b/DiscoveryEngine/src/V1beta/SearchResponse.php @@ -99,9 +99,6 @@ class SearchResponse extends \Google\Protobuf\Internal\Message */ private $applied_controls; /** - * Debug information specifically related to forward geocoding issues arising - * from Geolocation Search. - * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; */ private $geo_search_debug_info; @@ -160,8 +157,6 @@ class SearchResponse extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\RepeatedField $applied_controls * Controls applied as part of the Control service. * @type array<\Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\GeoSearchDebugInfo>|\Google\Protobuf\Internal\RepeatedField $geo_search_debug_info - * Debug information specifically related to forward geocoding issues arising - * from Geolocation Search. * @type \Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\QueryExpansionInfo $query_expansion_info * Query expansion information for the returned results. * } @@ -494,9 +489,6 @@ public function setAppliedControls($var) } /** - * Debug information specifically related to forward geocoding issues arising - * from Geolocation Search. - * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; * @return \Google\Protobuf\Internal\RepeatedField */ @@ -506,9 +498,6 @@ public function getGeoSearchDebugInfo() } /** - * Debug information specifically related to forward geocoding issues arising - * from Geolocation Search. - * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1beta.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; * @param array<\Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\GeoSearchDebugInfo>|\Google\Protobuf\Internal\RepeatedField $var * @return $this diff --git a/DiscoveryEngine/src/V1beta/SearchResponse/Facet.php b/DiscoveryEngine/src/V1beta/SearchResponse/Facet.php index ec096c76d86f..9b549fb22fdc 100644 --- a/DiscoveryEngine/src/V1beta/SearchResponse/Facet.php +++ b/DiscoveryEngine/src/V1beta/SearchResponse/Facet.php @@ -16,7 +16,7 @@ class Facet extends \Google\Protobuf\Internal\Message { /** - * The key for this facet. E.g., "colors" or "price". It matches + * The key for this facet. For example, `"colors"` or `"price"`. It matches * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.key]. * * Generated from protobuf field string key = 1; @@ -42,7 +42,7 @@ class Facet extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $key - * The key for this facet. E.g., "colors" or "price". It matches + * The key for this facet. For example, `"colors"` or `"price"`. It matches * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.key]. * @type array<\Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\Facet\FacetValue>|\Google\Protobuf\Internal\RepeatedField $values * The facet values for this field. @@ -56,7 +56,7 @@ public function __construct($data = NULL) { } /** - * The key for this facet. E.g., "colors" or "price". It matches + * The key for this facet. For example, `"colors"` or `"price"`. It matches * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.key]. * * Generated from protobuf field string key = 1; @@ -68,7 +68,7 @@ public function getKey() } /** - * The key for this facet. E.g., "colors" or "price". It matches + * The key for this facet. For example, `"colors"` or `"price"`. It matches * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.key]. * * Generated from protobuf field string key = 1; diff --git a/DiscoveryEngine/src/V1beta/SearchResponse/GuidedSearchResult/RefinementAttribute.php b/DiscoveryEngine/src/V1beta/SearchResponse/GuidedSearchResult/RefinementAttribute.php index ae150056ed8c..53bd506300eb 100644 --- a/DiscoveryEngine/src/V1beta/SearchResponse/GuidedSearchResult/RefinementAttribute.php +++ b/DiscoveryEngine/src/V1beta/SearchResponse/GuidedSearchResult/RefinementAttribute.php @@ -16,13 +16,13 @@ class RefinementAttribute extends \Google\Protobuf\Internal\Message { /** - * Attribute key used to refine the results e.g. 'movie_type'. + * Attribute key used to refine the results. For example, `"movie_type"`. * * Generated from protobuf field string attribute_key = 1; */ protected $attribute_key = ''; /** - * Attribute value used to refine the results e.g. 'drama'. + * Attribute value used to refine the results. For example, `"drama"`. * * Generated from protobuf field string attribute_value = 2; */ @@ -35,9 +35,9 @@ class RefinementAttribute extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $attribute_key - * Attribute key used to refine the results e.g. 'movie_type'. + * Attribute key used to refine the results. For example, `"movie_type"`. * @type string $attribute_value - * Attribute value used to refine the results e.g. 'drama'. + * Attribute value used to refine the results. For example, `"drama"`. * } */ public function __construct($data = NULL) { @@ -46,7 +46,7 @@ public function __construct($data = NULL) { } /** - * Attribute key used to refine the results e.g. 'movie_type'. + * Attribute key used to refine the results. For example, `"movie_type"`. * * Generated from protobuf field string attribute_key = 1; * @return string @@ -57,7 +57,7 @@ public function getAttributeKey() } /** - * Attribute key used to refine the results e.g. 'movie_type'. + * Attribute key used to refine the results. For example, `"movie_type"`. * * Generated from protobuf field string attribute_key = 1; * @param string $var @@ -72,7 +72,7 @@ public function setAttributeKey($var) } /** - * Attribute value used to refine the results e.g. 'drama'. + * Attribute value used to refine the results. For example, `"drama"`. * * Generated from protobuf field string attribute_value = 2; * @return string @@ -83,7 +83,7 @@ public function getAttributeValue() } /** - * Attribute value used to refine the results e.g. 'drama'. + * Attribute value used to refine the results. For example, `"drama"`. * * Generated from protobuf field string attribute_value = 2; * @param string $var diff --git a/DiscoveryEngine/src/V1beta/SearchResponse/SearchResult.php b/DiscoveryEngine/src/V1beta/SearchResponse/SearchResult.php index 219a3c173c54..44d3bffb514e 100644 --- a/DiscoveryEngine/src/V1beta/SearchResponse/SearchResult.php +++ b/DiscoveryEngine/src/V1beta/SearchResponse/SearchResult.php @@ -24,7 +24,7 @@ class SearchResult extends \Google\Protobuf\Internal\Message protected $id = ''; /** * The document data snippet in the search response. Only fields that are - * marked as retrievable are populated. + * marked as `retrievable` are populated. * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Document document = 2; */ @@ -47,7 +47,7 @@ class SearchResult extends \Google\Protobuf\Internal\Message * searched [Document][google.cloud.discoveryengine.v1beta.Document]. * @type \Google\Cloud\DiscoveryEngine\V1beta\Document $document * The document data snippet in the search response. Only fields that are - * marked as retrievable are populated. + * marked as `retrievable` are populated. * @type array|\Google\Protobuf\Internal\MapField $model_scores * Google provided available scores. * } @@ -87,7 +87,7 @@ public function setId($var) /** * The document data snippet in the search response. Only fields that are - * marked as retrievable are populated. + * marked as `retrievable` are populated. * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Document document = 2; * @return \Google\Cloud\DiscoveryEngine\V1beta\Document|null @@ -109,7 +109,7 @@ public function clearDocument() /** * The document data snippet in the search response. Only fields that are - * marked as retrievable are populated. + * marked as `retrievable` are populated. * * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Document document = 2; * @param \Google\Cloud\DiscoveryEngine\V1beta\Document $var diff --git a/DiscoveryEngine/src/V1beta/SearchResponse/Summary.php b/DiscoveryEngine/src/V1beta/SearchResponse/Summary.php index 9d0ae92747f6..0865287791cf 100644 --- a/DiscoveryEngine/src/V1beta/SearchResponse/Summary.php +++ b/DiscoveryEngine/src/V1beta/SearchResponse/Summary.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Summary of the top N search result specified by the summary spec. + * Summary of the top N search results specified by the summary spec. * * Generated from protobuf message google.cloud.discoveryengine.v1beta.SearchResponse.Summary */ diff --git a/DiscoveryEngine/src/V1beta/SearchUseCase.php b/DiscoveryEngine/src/V1beta/SearchUseCase.php new file mode 100644 index 000000000000..9a48affbe322 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/SearchUseCase.php @@ -0,0 +1,65 @@ +google.cloud.discoveryengine.v1beta.SearchUseCase + */ +class SearchUseCase +{ + /** + * Value used when unset. Will not occur in CSS. + * + * Generated from protobuf enum SEARCH_USE_CASE_UNSPECIFIED = 0; + */ + const SEARCH_USE_CASE_UNSPECIFIED = 0; + /** + * Search use case. Expects the traffic has a non-empty + * [query][google.cloud.discoveryengine.v1beta.SearchRequest.query]. + * + * Generated from protobuf enum SEARCH_USE_CASE_SEARCH = 1; + */ + const SEARCH_USE_CASE_SEARCH = 1; + /** + * Browse use case. Expects the traffic has an empty + * [query][google.cloud.discoveryengine.v1beta.SearchRequest.query]. + * + * Generated from protobuf enum SEARCH_USE_CASE_BROWSE = 2; + */ + const SEARCH_USE_CASE_BROWSE = 2; + + private static $valueToName = [ + self::SEARCH_USE_CASE_UNSPECIFIED => 'SEARCH_USE_CASE_UNSPECIFIED', + self::SEARCH_USE_CASE_SEARCH => 'SEARCH_USE_CASE_SEARCH', + self::SEARCH_USE_CASE_BROWSE => 'SEARCH_USE_CASE_BROWSE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/DiscoveryEngine/src/V1beta/Session.php b/DiscoveryEngine/src/V1beta/Session.php index df40eb9f8f52..215efdc8a2a8 100644 --- a/DiscoveryEngine/src/V1beta/Session.php +++ b/DiscoveryEngine/src/V1beta/Session.php @@ -17,7 +17,7 @@ class Session extends \Google\Protobuf\Internal\Message { /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*` + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ @@ -61,7 +61,7 @@ class Session extends \Google\Protobuf\Internal\Message * * @type string $name * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*` + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` * @type int $state * The state of the session. * @type string $user_pseudo_id @@ -81,7 +81,7 @@ public function __construct($data = NULL) { /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*` + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; * @return string @@ -93,7 +93,7 @@ public function getName() /** * Immutable. Fully qualified name - * `project/*/locations/global/collections/{collection}/engines/{engine}/sessions/*` + * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; * @param string $var diff --git a/DiscoveryEngine/src/V1beta/Session/Turn.php b/DiscoveryEngine/src/V1beta/Session/Turn.php index 7cbb8b7cc0e3..fad44e96167a 100644 --- a/DiscoveryEngine/src/V1beta/Session/Turn.php +++ b/DiscoveryEngine/src/V1beta/Session/Turn.php @@ -24,6 +24,8 @@ class Turn extends \Google\Protobuf\Internal\Message protected $query = null; /** * The resource name of the answer to the user query. + * Only set if the answer generation (/answer API call) happened in this + * turn. * * Generated from protobuf field string answer = 2 [(.google.api.resource_reference) = { */ @@ -39,6 +41,8 @@ class Turn extends \Google\Protobuf\Internal\Message * The user query. * @type string $answer * The resource name of the answer to the user query. + * Only set if the answer generation (/answer API call) happened in this + * turn. * } */ public function __construct($data = NULL) { @@ -84,6 +88,8 @@ public function setQuery($var) /** * The resource name of the answer to the user query. + * Only set if the answer generation (/answer API call) happened in this + * turn. * * Generated from protobuf field string answer = 2 [(.google.api.resource_reference) = { * @return string @@ -95,6 +101,8 @@ public function getAnswer() /** * The resource name of the answer to the user query. + * Only set if the answer generation (/answer API call) happened in this + * turn. * * Generated from protobuf field string answer = 2 [(.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1beta/TargetSite.php b/DiscoveryEngine/src/V1beta/TargetSite.php index 0a00be7eaf55..f3888b6e71a1 100644 --- a/DiscoveryEngine/src/V1beta/TargetSite.php +++ b/DiscoveryEngine/src/V1beta/TargetSite.php @@ -54,6 +54,12 @@ class TargetSite extends \Google\Protobuf\Internal\Message * Generated from protobuf field string generated_uri_pattern = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $generated_uri_pattern = ''; + /** + * Output only. Root domain of the provided_uri_pattern. + * + * Generated from protobuf field string root_domain_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $root_domain_uri = ''; /** * Output only. Site ownership and validity verification status. * @@ -104,6 +110,8 @@ class TargetSite extends \Google\Protobuf\Internal\Message * generate the URI pattern to be used by the search engine. * @type string $generated_uri_pattern * Output only. This is system-generated based on the provided_uri_pattern. + * @type string $root_domain_uri + * Output only. Root domain of the provided_uri_pattern. * @type \Google\Cloud\DiscoveryEngine\V1beta\SiteVerificationInfo $site_verification_info * Output only. Site ownership and validity verification status. * @type int $indexing_status @@ -267,6 +275,32 @@ public function setGeneratedUriPattern($var) return $this; } + /** + * Output only. Root domain of the provided_uri_pattern. + * + * Generated from protobuf field string root_domain_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRootDomainUri() + { + return $this->root_domain_uri; + } + + /** + * Output only. Root domain of the provided_uri_pattern. + * + * Generated from protobuf field string root_domain_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRootDomainUri($var) + { + GPBUtil::checkString($var, True); + $this->root_domain_uri = $var; + + return $this; + } + /** * Output only. Site ownership and validity verification status. * diff --git a/DiscoveryEngine/src/V1beta/TrainCustomModelRequest.php b/DiscoveryEngine/src/V1beta/TrainCustomModelRequest.php index 1280b7c8d19d..df170efde63a 100644 --- a/DiscoveryEngine/src/V1beta/TrainCustomModelRequest.php +++ b/DiscoveryEngine/src/V1beta/TrainCustomModelRequest.php @@ -39,6 +39,12 @@ class TrainCustomModelRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.discoveryengine.v1beta.ImportErrorConfig error_config = 4; */ protected $error_config = null; + /** + * If not provided, a UUID will be generated. + * + * Generated from protobuf field string model_id = 5; + */ + protected $model_id = ''; protected $training_input; /** @@ -59,6 +65,8 @@ class TrainCustomModelRequest extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DiscoveryEngine\V1beta\ImportErrorConfig $error_config * The desired location of errors incurred during the data ingestion and * training. + * @type string $model_id + * If not provided, a UUID will be generated. * } */ public function __construct($data = NULL) { @@ -193,6 +201,32 @@ public function setErrorConfig($var) return $this; } + /** + * If not provided, a UUID will be generated. + * + * Generated from protobuf field string model_id = 5; + * @return string + */ + public function getModelId() + { + return $this->model_id; + } + + /** + * If not provided, a UUID will be generated. + * + * Generated from protobuf field string model_id = 5; + * @param string $var + * @return $this + */ + public function setModelId($var) + { + GPBUtil::checkString($var, True); + $this->model_id = $var; + + return $this; + } + /** * @return string */ diff --git a/DiscoveryEngine/src/V1beta/TrainCustomModelResponse.php b/DiscoveryEngine/src/V1beta/TrainCustomModelResponse.php index fa87d6899ca2..aad2ff8a5bb6 100644 --- a/DiscoveryEngine/src/V1beta/TrainCustomModelResponse.php +++ b/DiscoveryEngine/src/V1beta/TrainCustomModelResponse.php @@ -48,6 +48,12 @@ class TrainCustomModelResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field map metrics = 4; */ private $metrics; + /** + * Fully qualified name of the CustomTuningModel. + * + * Generated from protobuf field string model_name = 5; + */ + protected $model_name = ''; /** * Constructor. @@ -70,6 +76,8 @@ class TrainCustomModelResponse extends \Google\Protobuf\Internal\Message * * **ready**: The model is ready for serving. * @type array|\Google\Protobuf\Internal\MapField $metrics * The metrics of the trained model. + * @type string $model_name + * Fully qualified name of the CustomTuningModel. * } */ public function __construct($data = NULL) { @@ -205,5 +213,31 @@ public function setMetrics($var) return $this; } + /** + * Fully qualified name of the CustomTuningModel. + * + * Generated from protobuf field string model_name = 5; + * @return string + */ + public function getModelName() + { + return $this->model_name; + } + + /** + * Fully qualified name of the CustomTuningModel. + * + * Generated from protobuf field string model_name = 5; + * @param string $var + * @return $this + */ + public function setModelName($var) + { + GPBUtil::checkString($var, True); + $this->model_name = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/UpdateControlRequest.php b/DiscoveryEngine/src/V1beta/UpdateControlRequest.php new file mode 100644 index 000000000000..745d5555b539 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/UpdateControlRequest.php @@ -0,0 +1,163 @@ +google.cloud.discoveryengine.v1beta.UpdateControlRequest + */ +class UpdateControlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Control to update. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $control = null; + /** + * Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1beta.Control] to update. The + * following are NOT supported: + * * [Control.name][google.cloud.discoveryengine.v1beta.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1beta.Control.solution_type] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\DiscoveryEngine\V1beta\Control $control Required. The Control to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1beta.Control] to update. The + * following are NOT supported: + * + * * [Control.name][google.cloud.discoveryengine.v1beta.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1beta.Control.solution_type] + * + * If not set or empty, all supported fields are updated. + * + * @return \Google\Cloud\DiscoveryEngine\V1beta\UpdateControlRequest + * + * @experimental + */ + public static function build(\Google\Cloud\DiscoveryEngine\V1beta\Control $control, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setControl($control) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1beta\Control $control + * Required. The Control to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1beta.Control] to update. The + * following are NOT supported: + * * [Control.name][google.cloud.discoveryengine.v1beta.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1beta.Control.solution_type] + * If not set or empty, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\ControlService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Control to update. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DiscoveryEngine\V1beta\Control|null + */ + public function getControl() + { + return $this->control; + } + + public function hasControl() + { + return isset($this->control); + } + + public function clearControl() + { + unset($this->control); + } + + /** + * Required. The Control to update. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DiscoveryEngine\V1beta\Control $var + * @return $this + */ + public function setControl($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\Control::class); + $this->control = $var; + + return $this; + } + + /** + * Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1beta.Control] to update. The + * following are NOT supported: + * * [Control.name][google.cloud.discoveryengine.v1beta.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1beta.Control.solution_type] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Indicates which fields in the provided + * [Control][google.cloud.discoveryengine.v1beta.Control] to update. The + * following are NOT supported: + * * [Control.name][google.cloud.discoveryengine.v1beta.Control.name] + * * [Control.solution_type][google.cloud.discoveryengine.v1beta.Control.solution_type] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1beta/UpdateDocumentRequest.php b/DiscoveryEngine/src/V1beta/UpdateDocumentRequest.php index 2e3d2735260d..b53210b2ff9e 100644 --- a/DiscoveryEngine/src/V1beta/UpdateDocumentRequest.php +++ b/DiscoveryEngine/src/V1beta/UpdateDocumentRequest.php @@ -31,17 +31,16 @@ class UpdateDocumentRequest extends \Google\Protobuf\Internal\Message */ protected $document = null; /** - * If set to true, and the + * If set to `true` and the * [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a - * new [Document][google.cloud.discoveryengine.v1beta.Document] will be - * created. + * new [Document][google.cloud.discoveryengine.v1beta.Document] is be created. * * Generated from protobuf field bool allow_missing = 2; */ protected $allow_missing = false; /** * Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; */ @@ -59,7 +58,7 @@ class UpdateDocumentRequest extends \Google\Protobuf\Internal\Message * [allow_missing][google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing] * is not set, a `NOT_FOUND` error is returned. * @param \Google\Protobuf\FieldMask $updateMask Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * * @return \Google\Cloud\DiscoveryEngine\V1beta\UpdateDocumentRequest * @@ -88,13 +87,12 @@ public static function build(\Google\Cloud\DiscoveryEngine\V1beta\Document $docu * [allow_missing][google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing] * is not set, a `NOT_FOUND` error is returned. * @type bool $allow_missing - * If set to true, and the + * If set to `true` and the * [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a - * new [Document][google.cloud.discoveryengine.v1beta.Document] will be - * created. + * new [Document][google.cloud.discoveryengine.v1beta.Document] is be created. * @type \Google\Protobuf\FieldMask $update_mask * Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * } */ public function __construct($data = NULL) { @@ -153,10 +151,9 @@ public function setDocument($var) } /** - * If set to true, and the + * If set to `true` and the * [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a - * new [Document][google.cloud.discoveryengine.v1beta.Document] will be - * created. + * new [Document][google.cloud.discoveryengine.v1beta.Document] is be created. * * Generated from protobuf field bool allow_missing = 2; * @return bool @@ -167,10 +164,9 @@ public function getAllowMissing() } /** - * If set to true, and the + * If set to `true` and the * [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a - * new [Document][google.cloud.discoveryengine.v1beta.Document] will be - * created. + * new [Document][google.cloud.discoveryengine.v1beta.Document] is be created. * * Generated from protobuf field bool allow_missing = 2; * @param bool $var @@ -186,7 +182,7 @@ public function setAllowMissing($var) /** * Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; * @return \Google\Protobuf\FieldMask|null @@ -208,7 +204,7 @@ public function clearUpdateMask() /** * Indicates which fields in the provided imported 'document' to update. If - * not set, will by default update all fields. + * not set, by default updates all fields. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; * @param \Google\Protobuf\FieldMask $var diff --git a/DiscoveryEngine/src/V1beta/UpdateSchemaRequest.php b/DiscoveryEngine/src/V1beta/UpdateSchemaRequest.php index 86c984cde2e3..cc520d5300aa 100644 --- a/DiscoveryEngine/src/V1beta/UpdateSchemaRequest.php +++ b/DiscoveryEngine/src/V1beta/UpdateSchemaRequest.php @@ -27,8 +27,8 @@ class UpdateSchemaRequest extends \Google\Protobuf\Internal\Message /** * If set to true, and the * [Schema][google.cloud.discoveryengine.v1beta.Schema] is not found, a new - * [Schema][google.cloud.discoveryengine.v1beta.Schema] will be created. In - * this situation, `update_mask` is ignored. + * [Schema][google.cloud.discoveryengine.v1beta.Schema] is created. In this + * situation, `update_mask` is ignored. * * Generated from protobuf field bool allow_missing = 3; */ @@ -46,8 +46,8 @@ class UpdateSchemaRequest extends \Google\Protobuf\Internal\Message * @type bool $allow_missing * If set to true, and the * [Schema][google.cloud.discoveryengine.v1beta.Schema] is not found, a new - * [Schema][google.cloud.discoveryengine.v1beta.Schema] will be created. In - * this situation, `update_mask` is ignored. + * [Schema][google.cloud.discoveryengine.v1beta.Schema] is created. In this + * situation, `update_mask` is ignored. * } */ public function __construct($data = NULL) { @@ -96,8 +96,8 @@ public function setSchema($var) /** * If set to true, and the * [Schema][google.cloud.discoveryengine.v1beta.Schema] is not found, a new - * [Schema][google.cloud.discoveryengine.v1beta.Schema] will be created. In - * this situation, `update_mask` is ignored. + * [Schema][google.cloud.discoveryengine.v1beta.Schema] is created. In this + * situation, `update_mask` is ignored. * * Generated from protobuf field bool allow_missing = 3; * @return bool @@ -110,8 +110,8 @@ public function getAllowMissing() /** * If set to true, and the * [Schema][google.cloud.discoveryengine.v1beta.Schema] is not found, a new - * [Schema][google.cloud.discoveryengine.v1beta.Schema] will be created. In - * this situation, `update_mask` is ignored. + * [Schema][google.cloud.discoveryengine.v1beta.Schema] is created. In this + * situation, `update_mask` is ignored. * * Generated from protobuf field bool allow_missing = 3; * @param bool $var diff --git a/DiscoveryEngine/src/V1beta/UserEvent.php b/DiscoveryEngine/src/V1beta/UserEvent.php index 7a0bb3a092a6..e5efe7ef42f8 100644 --- a/DiscoveryEngine/src/V1beta/UserEvent.php +++ b/DiscoveryEngine/src/V1beta/UserEvent.php @@ -10,7 +10,7 @@ /** * UserEvent captures all metadata information Discovery Engine API needs to - * know about how end users interact with customers' website. + * know about how end users interact with your website. * * Generated from protobuf message google.cloud.discoveryengine.v1beta.UserEvent */ @@ -52,6 +52,31 @@ class UserEvent extends \Google\Protobuf\Internal\Message * Generated from protobuf field string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ protected $user_pseudo_id = ''; + /** + * The [Engine][google.cloud.discoveryengine.v1beta.Engine] resource name, in + * the form of + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + * Optional. Only required for + * [Engine][google.cloud.discoveryengine.v1beta.Engine] produced user events. + * For example, user events from blended search. + * + * Generated from protobuf field string engine = 19 [(.google.api.resource_reference) = { + */ + protected $engine = ''; + /** + * The [DataStore][google.cloud.discoveryengine.v1beta.DataStore] resource + * full name, of the form + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + * Optional. Only required for user events whose data store can't by + * determined by + * [UserEvent.engine][google.cloud.discoveryengine.v1beta.UserEvent.engine] or + * [UserEvent.documents][google.cloud.discoveryengine.v1beta.UserEvent.documents]. + * If data store is set in the parent of write/import/collect user event + * requests, this field can be omitted. + * + * Generated from protobuf field string data_store = 20 [(.google.api.resource_reference) = { + */ + protected $data_store = ''; /** * Only required for * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1beta.UserEventService.ImportUserEvents] @@ -195,7 +220,7 @@ class UserEvent extends \Google\Protobuf\Internal\Message /** * A list of identifiers for the independent experiment groups this user event * belongs to. This is used to distinguish between user events associated with - * different experiment setups on the customer end. + * different experiment setups. * * Generated from protobuf field repeated string tag_ids = 15; */ @@ -275,6 +300,23 @@ class UserEvent extends \Google\Protobuf\Internal\Message * Analytics [Client * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) * for this field. + * @type string $engine + * The [Engine][google.cloud.discoveryengine.v1beta.Engine] resource name, in + * the form of + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + * Optional. Only required for + * [Engine][google.cloud.discoveryengine.v1beta.Engine] produced user events. + * For example, user events from blended search. + * @type string $data_store + * The [DataStore][google.cloud.discoveryengine.v1beta.DataStore] resource + * full name, of the form + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + * Optional. Only required for user events whose data store can't by + * determined by + * [UserEvent.engine][google.cloud.discoveryengine.v1beta.UserEvent.engine] or + * [UserEvent.documents][google.cloud.discoveryengine.v1beta.UserEvent.documents]. + * If data store is set in the parent of write/import/collect user event + * requests, this field can be omitted. * @type \Google\Protobuf\Timestamp $event_time * Only required for * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1beta.UserEventService.ImportUserEvents] @@ -370,7 +412,7 @@ class UserEvent extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\RepeatedField $tag_ids * A list of identifiers for the independent experiment groups this user event * belongs to. This is used to distinguish between user events associated with - * different experiment setups on the customer end. + * different experiment setups. * @type array|\Google\Protobuf\Internal\RepeatedField $promotion_ids * The promotion IDs if this is an event associated with promotions. * Currently, this field is restricted to at most one ID. @@ -506,6 +548,84 @@ public function setUserPseudoId($var) return $this; } + /** + * The [Engine][google.cloud.discoveryengine.v1beta.Engine] resource name, in + * the form of + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + * Optional. Only required for + * [Engine][google.cloud.discoveryengine.v1beta.Engine] produced user events. + * For example, user events from blended search. + * + * Generated from protobuf field string engine = 19 [(.google.api.resource_reference) = { + * @return string + */ + public function getEngine() + { + return $this->engine; + } + + /** + * The [Engine][google.cloud.discoveryengine.v1beta.Engine] resource name, in + * the form of + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + * Optional. Only required for + * [Engine][google.cloud.discoveryengine.v1beta.Engine] produced user events. + * For example, user events from blended search. + * + * Generated from protobuf field string engine = 19 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEngine($var) + { + GPBUtil::checkString($var, True); + $this->engine = $var; + + return $this; + } + + /** + * The [DataStore][google.cloud.discoveryengine.v1beta.DataStore] resource + * full name, of the form + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + * Optional. Only required for user events whose data store can't by + * determined by + * [UserEvent.engine][google.cloud.discoveryengine.v1beta.UserEvent.engine] or + * [UserEvent.documents][google.cloud.discoveryengine.v1beta.UserEvent.documents]. + * If data store is set in the parent of write/import/collect user event + * requests, this field can be omitted. + * + * Generated from protobuf field string data_store = 20 [(.google.api.resource_reference) = { + * @return string + */ + public function getDataStore() + { + return $this->data_store; + } + + /** + * The [DataStore][google.cloud.discoveryengine.v1beta.DataStore] resource + * full name, of the form + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + * Optional. Only required for user events whose data store can't by + * determined by + * [UserEvent.engine][google.cloud.discoveryengine.v1beta.UserEvent.engine] or + * [UserEvent.documents][google.cloud.discoveryengine.v1beta.UserEvent.documents]. + * If data store is set in the parent of write/import/collect user event + * requests, this field can be omitted. + * + * Generated from protobuf field string data_store = 20 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataStore($var) + { + GPBUtil::checkString($var, True); + $this->data_store = $var; + + return $this; + } + /** * Only required for * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1beta.UserEventService.ImportUserEvents] @@ -1027,7 +1147,7 @@ public function setTransactionInfo($var) /** * A list of identifiers for the independent experiment groups this user event * belongs to. This is used to distinguish between user events associated with - * different experiment setups on the customer end. + * different experiment setups. * * Generated from protobuf field repeated string tag_ids = 15; * @return \Google\Protobuf\Internal\RepeatedField @@ -1040,7 +1160,7 @@ public function getTagIds() /** * A list of identifiers for the independent experiment groups this user event * belongs to. This is used to distinguish between user events associated with - * different experiment setups on the customer end. + * different experiment setups. * * Generated from protobuf field repeated string tag_ids = 15; * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/DiscoveryEngine/src/V1beta/WriteUserEventRequest.php b/DiscoveryEngine/src/V1beta/WriteUserEventRequest.php index 0160c406ea4a..241cdc2c3d6e 100644 --- a/DiscoveryEngine/src/V1beta/WriteUserEventRequest.php +++ b/DiscoveryEngine/src/V1beta/WriteUserEventRequest.php @@ -16,8 +16,16 @@ class WriteUserEventRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The parent DataStore resource name, such as + * Required. The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore] level, the + * format is: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1beta.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore], the format is: + * `projects/{project}/locations/{location}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -28,6 +36,13 @@ class WriteUserEventRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional .google.cloud.discoveryengine.v1beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; */ protected $user_event = null; + /** + * If set to true, the user event is written asynchronously after + * validation, and the API responds without waiting for the write. + * + * Generated from protobuf field bool write_async = 3; + */ + protected $write_async = false; /** * Constructor. @@ -36,10 +51,21 @@ class WriteUserEventRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The parent DataStore resource name, such as + * Required. The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore] level, the + * format is: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1beta.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore], the format is: + * `projects/{project}/locations/{location}`. * @type \Google\Cloud\DiscoveryEngine\V1beta\UserEvent $user_event * Required. User event to write. + * @type bool $write_async + * If set to true, the user event is written asynchronously after + * validation, and the API responds without waiting for the write. * } */ public function __construct($data = NULL) { @@ -48,8 +74,16 @@ public function __construct($data = NULL) { } /** - * Required. The parent DataStore resource name, such as + * Required. The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore] level, the + * format is: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1beta.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore], the format is: + * `projects/{project}/locations/{location}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -60,8 +94,16 @@ public function getParent() } /** - * Required. The parent DataStore resource name, such as + * Required. The parent resource name. + * If the write user event action is applied in + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore] level, the + * format is: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * If the write user event action is applied in [Location][] level, for + * example, the event with + * [Document][google.cloud.discoveryengine.v1beta.Document] across multiple + * [DataStore][google.cloud.discoveryengine.v1beta.DataStore], the format is: + * `projects/{project}/locations/{location}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -111,5 +153,33 @@ public function setUserEvent($var) return $this; } + /** + * If set to true, the user event is written asynchronously after + * validation, and the API responds without waiting for the write. + * + * Generated from protobuf field bool write_async = 3; + * @return bool + */ + public function getWriteAsync() + { + return $this->write_async; + } + + /** + * If set to true, the user event is written asynchronously after + * validation, and the API responds without waiting for the write. + * + * Generated from protobuf field bool write_async = 3; + * @param bool $var + * @return $this + */ + public function setWriteAsync($var) + { + GPBUtil::checkBool($var); + $this->write_async = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1beta/gapic_metadata.json b/DiscoveryEngine/src/V1beta/gapic_metadata.json index e094dec882e0..8785ed2c1406 100644 --- a/DiscoveryEngine/src/V1beta/gapic_metadata.json +++ b/DiscoveryEngine/src/V1beta/gapic_metadata.json @@ -29,6 +29,40 @@ } } }, + "ControlService": { + "clients": { + "grpc": { + "libraryClient": "ControlServiceGapicClient", + "rpcs": { + "CreateControl": { + "methods": [ + "createControl" + ] + }, + "DeleteControl": { + "methods": [ + "deleteControl" + ] + }, + "GetControl": { + "methods": [ + "getControl" + ] + }, + "ListControls": { + "methods": [ + "listControls" + ] + }, + "UpdateControl": { + "methods": [ + "updateControl" + ] + } + } + } + } + }, "SearchService": { "clients": { "grpc": { @@ -258,6 +292,20 @@ } } }, + "ProjectService": { + "clients": { + "grpc": { + "libraryClient": "ProjectServiceGapicClient", + "rpcs": { + "ProvisionProject": { + "methods": [ + "provisionProject" + ] + } + } + } + } + }, "RankService": { "clients": { "grpc": { @@ -325,6 +373,11 @@ "grpc": { "libraryClient": "SearchTuningServiceGapicClient", "rpcs": { + "ListCustomModels": { + "methods": [ + "listCustomModels" + ] + }, "TrainCustomModel": { "methods": [ "trainCustomModel" diff --git a/DiscoveryEngine/src/V1beta/resources/completion_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/completion_service_rest_client_config.php index 4eb0fc578bb1..bbec991cbfb1 100644 --- a/DiscoveryEngine/src/V1beta/resources/completion_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/completion_service_rest_client_config.php @@ -80,6 +80,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/control_service_client_config.json b/DiscoveryEngine/src/V1beta/resources/control_service_client_config.json new file mode 100644 index 000000000000..afd29ab17b6a --- /dev/null +++ b/DiscoveryEngine/src/V1beta/resources/control_service_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1beta.ControlService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "CreateControl": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "DeleteControl": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "GetControl": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "ListControls": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "UpdateControl": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + } + } + } + } +} diff --git a/DiscoveryEngine/src/V1beta/resources/control_service_descriptor_config.php b/DiscoveryEngine/src/V1beta/resources/control_service_descriptor_config.php new file mode 100644 index 000000000000..f143aa1d4bec --- /dev/null +++ b/DiscoveryEngine/src/V1beta/resources/control_service_descriptor_config.php @@ -0,0 +1,107 @@ + [ + 'google.cloud.discoveryengine.v1beta.ControlService' => [ + 'CreateControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1beta\Control', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1beta\Control', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListControls' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getControls', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1beta\ListControlsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateControl' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1beta\Control', + 'headerParams' => [ + [ + 'keyName' => 'control.name', + 'fieldAccessors' => [ + 'getControl', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'control' => 'projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control}', + 'dataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', + 'engine' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}', + 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', + 'projectLocationCollectionDataStoreControl' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/controls/{control}', + 'projectLocationCollectionEngineControl' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/controls/{control}', + 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', + 'projectLocationDataStoreControl' => 'projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control}', + ], + ], + ], +]; diff --git a/DiscoveryEngine/src/V1beta/resources/control_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/control_service_rest_client_config.php new file mode 100644 index 000000000000..9c9822c3a603 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/resources/control_service_rest_client_config.php @@ -0,0 +1,301 @@ + [ + 'google.cloud.discoveryengine.v1beta.ControlService' => [ + 'CreateControl' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/dataStores/*}/controls', + 'body' => 'control', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/controls', + 'body' => 'control', + 'queryParams' => [ + 'control_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/collections/*/engines/*}/controls', + 'body' => 'control', + 'queryParams' => [ + 'control_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'control_id', + ], + ], + 'DeleteControl' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/controls/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/controls/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetControl' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/controls/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/controls/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListControls' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/dataStores/*}/controls', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/controls', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/collections/*/engines/*}/controls', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateControl' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta/{control.name=projects/*/locations/*/dataStores/*/controls/*}', + 'body' => 'control', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta/{control.name=projects/*/locations/*/collections/*/dataStores/*/controls/*}', + 'body' => 'control', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta/{control.name=projects/*/locations/*/collections/*/engines/*/controls/*}', + 'body' => 'control', + ], + ], + 'placeholders' => [ + 'control.name' => [ + 'getters' => [ + 'getControl', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/DiscoveryEngine/src/V1beta/resources/conversational_search_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/conversational_search_service_rest_client_config.php index 20ac75a47360..d1856ef38d49 100644 --- a/DiscoveryEngine/src/V1beta/resources/conversational_search_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/conversational_search_service_rest_client_config.php @@ -318,6 +318,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/data_store_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/data_store_service_rest_client_config.php index c975924a1762..496962e0ebf1 100644 --- a/DiscoveryEngine/src/V1beta/resources/data_store_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/data_store_service_rest_client_config.php @@ -121,6 +121,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/document_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/document_service_rest_client_config.php index 8cc929b2bd24..0c878b9ad749 100644 --- a/DiscoveryEngine/src/V1beta/resources/document_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/document_service_rest_client_config.php @@ -159,6 +159,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/engine_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/engine_service_rest_client_config.php index 912b5384b6da..98f66f96d0a6 100644 --- a/DiscoveryEngine/src/V1beta/resources/engine_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/engine_service_rest_client_config.php @@ -122,6 +122,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/grounded_generation_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/grounded_generation_service_rest_client_config.php index 5434dbaa465c..4d0a28e548bd 100644 --- a/DiscoveryEngine/src/V1beta/resources/grounded_generation_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/grounded_generation_service_rest_client_config.php @@ -37,6 +37,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/project_service_client_config.json b/DiscoveryEngine/src/V1beta/resources/project_service_client_config.json new file mode 100644 index 000000000000..aa5f2cd6311f --- /dev/null +++ b/DiscoveryEngine/src/V1beta/resources/project_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1beta.ProjectService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "ProvisionProject": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + } + } + } + } +} diff --git a/DiscoveryEngine/src/V1beta/resources/project_service_descriptor_config.php b/DiscoveryEngine/src/V1beta/resources/project_service_descriptor_config.php new file mode 100644 index 000000000000..56752d493e4c --- /dev/null +++ b/DiscoveryEngine/src/V1beta/resources/project_service_descriptor_config.php @@ -0,0 +1,50 @@ + [ + 'google.cloud.discoveryengine.v1beta.ProjectService' => [ + 'ProvisionProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DiscoveryEngine\V1beta\Project', + 'metadataReturnType' => '\Google\Cloud\DiscoveryEngine\V1beta\ProvisionProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/DiscoveryEngine/src/V1beta/resources/project_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/project_service_rest_client_config.php new file mode 100644 index 000000000000..ce0774ace3a1 --- /dev/null +++ b/DiscoveryEngine/src/V1beta/resources/project_service_rest_client_config.php @@ -0,0 +1,192 @@ + [ + 'google.cloud.discoveryengine.v1beta.ProjectService' => [ + 'ProvisionProject' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*}:provision', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/DiscoveryEngine/src/V1beta/resources/rank_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/rank_service_rest_client_config.php index d1fb2b57af1d..eb11212d16b9 100644 --- a/DiscoveryEngine/src/V1beta/resources/rank_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/rank_service_rest_client_config.php @@ -37,6 +37,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/recommendation_service_descriptor_config.php b/DiscoveryEngine/src/V1beta/resources/recommendation_service_descriptor_config.php index 16943254074a..9a9c94142881 100644 --- a/DiscoveryEngine/src/V1beta/resources/recommendation_service_descriptor_config.php +++ b/DiscoveryEngine/src/V1beta/resources/recommendation_service_descriptor_config.php @@ -36,10 +36,14 @@ ], ], 'templateMap' => [ + 'dataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', 'document' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}', + 'engine' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}', + 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', 'projectLocationCollectionDataStoreBranchDocument' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}', 'projectLocationCollectionDataStoreServingConfig' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}', 'projectLocationCollectionEngineServingConfig' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}', + 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', 'projectLocationDataStoreBranchDocument' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}', 'projectLocationDataStoreServingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}', 'servingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}', diff --git a/DiscoveryEngine/src/V1beta/resources/recommendation_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/recommendation_service_rest_client_config.php index f1659c9d6283..ee7dbb9f3745 100644 --- a/DiscoveryEngine/src/V1beta/resources/recommendation_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/recommendation_service_rest_client_config.php @@ -49,6 +49,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/schema_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/schema_service_rest_client_config.php index d31a6cca3f49..4d21b360dfaa 100644 --- a/DiscoveryEngine/src/V1beta/resources/schema_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/schema_service_rest_client_config.php @@ -121,6 +121,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/search_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/search_service_rest_client_config.php index 2697aaedd145..95636d0e6ebb 100644 --- a/DiscoveryEngine/src/V1beta/resources/search_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/search_service_rest_client_config.php @@ -49,6 +49,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/search_tuning_service_client_config.json b/DiscoveryEngine/src/V1beta/resources/search_tuning_service_client_config.json index 38f897b9d2b5..8b641eb9ee4d 100644 --- a/DiscoveryEngine/src/V1beta/resources/search_tuning_service_client_config.json +++ b/DiscoveryEngine/src/V1beta/resources/search_tuning_service_client_config.json @@ -16,6 +16,11 @@ } }, "methods": { + "ListCustomModels": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "TrainCustomModel": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/DiscoveryEngine/src/V1beta/resources/search_tuning_service_descriptor_config.php b/DiscoveryEngine/src/V1beta/resources/search_tuning_service_descriptor_config.php index f299636d2ed1..b1853e298598 100644 --- a/DiscoveryEngine/src/V1beta/resources/search_tuning_service_descriptor_config.php +++ b/DiscoveryEngine/src/V1beta/resources/search_tuning_service_descriptor_config.php @@ -42,6 +42,18 @@ ], ], ], + 'ListCustomModels' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1beta\ListCustomModelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'data_store', + 'fieldAccessors' => [ + 'getDataStore', + ], + ], + ], + ], 'templateMap' => [ 'dataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', diff --git a/DiscoveryEngine/src/V1beta/resources/search_tuning_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/search_tuning_service_rest_client_config.php index 1d840bc5cbe1..c3805d2e45b1 100644 --- a/DiscoveryEngine/src/V1beta/resources/search_tuning_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/search_tuning_service_rest_client_config.php @@ -23,6 +23,17 @@ return [ 'interfaces' => [ 'google.cloud.discoveryengine.v1beta.SearchTuningService' => [ + 'ListCustomModels' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{data_store=projects/*/locations/*/collections/*/dataStores/*}/customModels', + 'placeholders' => [ + 'data_store' => [ + 'getters' => [ + 'getDataStore', + ], + ], + ], + ], 'TrainCustomModel' => [ 'method' => 'post', 'uriTemplate' => '/v1beta/{data_store=projects/*/locations/*/collections/*/dataStores/*}:trainCustomModel', @@ -37,6 +48,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/serving_config_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/serving_config_service_rest_client_config.php index 8d4f817eea64..76e47fbeb6c5 100644 --- a/DiscoveryEngine/src/V1beta/resources/serving_config_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/serving_config_service_rest_client_config.php @@ -92,6 +92,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/site_search_engine_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/site_search_engine_service_rest_client_config.php index 4b661385a6bf..1af6f9ee4de2 100644 --- a/DiscoveryEngine/src/V1beta/resources/site_search_engine_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/site_search_engine_service_rest_client_config.php @@ -231,6 +231,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/src/V1beta/resources/user_event_service_descriptor_config.php b/DiscoveryEngine/src/V1beta/resources/user_event_service_descriptor_config.php index 535ecc8a474b..fb0e96272997 100644 --- a/DiscoveryEngine/src/V1beta/resources/user_event_service_descriptor_config.php +++ b/DiscoveryEngine/src/V1beta/resources/user_event_service_descriptor_config.php @@ -69,6 +69,7 @@ 'templateMap' => [ 'dataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', 'document' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}', + 'engine' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}', 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', 'projectLocationCollectionDataStoreBranchDocument' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}', 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', diff --git a/DiscoveryEngine/src/V1beta/resources/user_event_service_rest_client_config.php b/DiscoveryEngine/src/V1beta/resources/user_event_service_rest_client_config.php index 18e119a11b38..a3988060f61e 100644 --- a/DiscoveryEngine/src/V1beta/resources/user_event_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1beta/resources/user_event_service_rest_client_config.php @@ -69,6 +69,11 @@ 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:write', 'body' => 'user_event', ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/userEvents:write', + 'body' => 'user_event', + ], ], 'placeholders' => [ 'parent' => [ @@ -80,6 +85,25 @@ ], ], 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', diff --git a/DiscoveryEngine/tests/Unit/V1/Client/CompletionServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/CompletionServiceClientTest.php index d0f2b537648a..b4cb0bad4bc0 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/CompletionServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/CompletionServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1\Client\CompletionServiceClient; @@ -34,6 +33,7 @@ use Google\Cloud\DiscoveryEngine\V1\ImportSuggestionDenyListEntriesResponse; use Google\Cloud\DiscoveryEngine\V1\PurgeSuggestionDenyListEntriesRequest; use Google\Cloud\DiscoveryEngine\V1\PurgeSuggestionDenyListEntriesResponse; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1/Client/ControlServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/ControlServiceClientTest.php new file mode 100644 index 000000000000..034cb4964742 --- /dev/null +++ b/DiscoveryEngine/tests/Unit/V1/Client/ControlServiceClientTest.php @@ -0,0 +1,478 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ControlServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ControlServiceClient($options); + } + + /** @test */ + public function createControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $controlId = 'controlId637416253'; + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + $response = $gapicClient->createControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ControlService/CreateControl', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getControl(); + $this->assertProtobufEquals($control, $actualValue); + $actualValue = $actualRequestObject->getControlId(); + $this->assertProtobufEquals($controlId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createControlExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $controlId = 'controlId637416253'; + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + try { + $gapicClient->createControl($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[CONTROL]'); + $request = (new DeleteControlRequest())->setName($formattedName); + $gapicClient->deleteControl($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ControlService/DeleteControl', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteControlExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[CONTROL]'); + $request = (new DeleteControlRequest())->setName($formattedName); + try { + $gapicClient->deleteControl($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[CONTROL]'); + $request = (new GetControlRequest())->setName($formattedName); + $response = $gapicClient->getControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ControlService/GetControl', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getControlExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[CONTROL]'); + $request = (new GetControlRequest())->setName($formattedName); + try { + $gapicClient->getControl($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listControlsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $controlsElement = new Control(); + $controls = [$controlsElement]; + $expectedResponse = new ListControlsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setControls($controls); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $request = (new ListControlsRequest())->setParent($formattedParent); + $response = $gapicClient->listControls($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getControls()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ControlService/ListControls', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listControlsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $request = (new ListControlsRequest())->setParent($formattedParent); + try { + $gapicClient->listControls($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $request = (new UpdateControlRequest())->setControl($control); + $response = $gapicClient->updateControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ControlService/UpdateControl', $actualFuncCall); + $actualValue = $actualRequestObject->getControl(); + $this->assertProtobufEquals($control, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateControlExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $request = (new UpdateControlRequest())->setControl($control); + try { + $gapicClient->updateControl($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createControlAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $controlId = 'controlId637416253'; + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + $response = $gapicClient->createControlAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ControlService/CreateControl', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getControl(); + $this->assertProtobufEquals($control, $actualValue); + $actualValue = $actualRequestObject->getControlId(); + $this->assertProtobufEquals($controlId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/DiscoveryEngine/tests/Unit/V1/Client/ConversationalSearchServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/ConversationalSearchServiceClientTest.php index aec2cfe901d9..6903d961f7a5 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/ConversationalSearchServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/ConversationalSearchServiceClientTest.php @@ -26,17 +26,29 @@ use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; +use Google\Cloud\DiscoveryEngine\V1\Answer; +use Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest; +use Google\Cloud\DiscoveryEngine\V1\AnswerQueryResponse; use Google\Cloud\DiscoveryEngine\V1\Client\ConversationalSearchServiceClient; use Google\Cloud\DiscoveryEngine\V1\Conversation; use Google\Cloud\DiscoveryEngine\V1\ConverseConversationRequest; use Google\Cloud\DiscoveryEngine\V1\ConverseConversationResponse; use Google\Cloud\DiscoveryEngine\V1\CreateConversationRequest; +use Google\Cloud\DiscoveryEngine\V1\CreateSessionRequest; use Google\Cloud\DiscoveryEngine\V1\DeleteConversationRequest; +use Google\Cloud\DiscoveryEngine\V1\DeleteSessionRequest; +use Google\Cloud\DiscoveryEngine\V1\GetAnswerRequest; use Google\Cloud\DiscoveryEngine\V1\GetConversationRequest; +use Google\Cloud\DiscoveryEngine\V1\GetSessionRequest; use Google\Cloud\DiscoveryEngine\V1\ListConversationsRequest; use Google\Cloud\DiscoveryEngine\V1\ListConversationsResponse; +use Google\Cloud\DiscoveryEngine\V1\ListSessionsRequest; +use Google\Cloud\DiscoveryEngine\V1\ListSessionsResponse; +use Google\Cloud\DiscoveryEngine\V1\Query; +use Google\Cloud\DiscoveryEngine\V1\Session; use Google\Cloud\DiscoveryEngine\V1\TextInput; use Google\Cloud\DiscoveryEngine\V1\UpdateConversationRequest; +use Google\Cloud\DiscoveryEngine\V1\UpdateSessionRequest; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; @@ -71,6 +83,85 @@ private function createClient(array $options = []) return new ConversationalSearchServiceClient($options); } + /** @test */ + public function answerQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $answerQueryToken = 'answerQueryToken886927553'; + $expectedResponse = new AnswerQueryResponse(); + $expectedResponse->setAnswerQueryToken($answerQueryToken); + $transport->addResponse($expectedResponse); + // Mock request + $formattedServingConfig = $gapicClient->servingConfigName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[SERVING_CONFIG]' + ); + $query = new Query(); + $request = (new AnswerQueryRequest())->setServingConfig($formattedServingConfig)->setQuery($query); + $response = $gapicClient->answerQuery($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ConversationalSearchService/AnswerQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getServingConfig(); + $this->assertProtobufEquals($formattedServingConfig, $actualValue); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function answerQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedServingConfig = $gapicClient->servingConfigName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[SERVING_CONFIG]' + ); + $query = new Query(); + $request = (new AnswerQueryRequest())->setServingConfig($formattedServingConfig)->setQuery($query); + try { + $gapicClient->answerQuery($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function converseConversationTest() { @@ -215,6 +306,80 @@ public function createConversationExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function createSessionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $userPseudoId = 'userPseudoId-1850666040'; + $expectedResponse = new Session(); + $expectedResponse->setName($name); + $expectedResponse->setUserPseudoId($userPseudoId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $session = new Session(); + $request = (new CreateSessionRequest())->setParent($formattedParent)->setSession($session); + $response = $gapicClient->createSession($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.discoveryengine.v1.ConversationalSearchService/CreateSession', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSession(); + $this->assertProtobufEquals($session, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSessionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $session = new Session(); + $request = (new CreateSessionRequest())->setParent($formattedParent)->setSession($session); + try { + $gapicClient->createSession($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function deleteConversationTest() { @@ -280,6 +445,138 @@ public function deleteConversationExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function deleteSessionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->sessionName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[SESSION]'); + $request = (new DeleteSessionRequest())->setName($formattedName); + $gapicClient->deleteSession($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.discoveryengine.v1.ConversationalSearchService/DeleteSession', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSessionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->sessionName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[SESSION]'); + $request = (new DeleteSessionRequest())->setName($formattedName); + try { + $gapicClient->deleteSession($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAnswerTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $answerText = 'answerText-311499506'; + $expectedResponse = new Answer(); + $expectedResponse->setName($name2); + $expectedResponse->setAnswerText($answerText); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->answerName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[SESSION]', '[ANSWER]'); + $request = (new GetAnswerRequest())->setName($formattedName); + $response = $gapicClient->getAnswer($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ConversationalSearchService/GetAnswer', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAnswerExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->answerName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[SESSION]', '[ANSWER]'); + $request = (new GetAnswerRequest())->setName($formattedName); + try { + $gapicClient->getAnswer($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getConversationTest() { @@ -350,6 +647,73 @@ public function getConversationExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getSessionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $userPseudoId = 'userPseudoId-1850666040'; + $expectedResponse = new Session(); + $expectedResponse->setName($name2); + $expectedResponse->setUserPseudoId($userPseudoId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->sessionName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[SESSION]'); + $request = (new GetSessionRequest())->setName($formattedName); + $response = $gapicClient->getSession($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ConversationalSearchService/GetSession', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSessionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->sessionName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[SESSION]'); + $request = (new GetSessionRequest())->setName($formattedName); + try { + $gapicClient->getSession($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listConversationsTest() { @@ -424,6 +788,77 @@ public function listConversationsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listSessionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $sessionsElement = new Session(); + $sessions = [$sessionsElement]; + $expectedResponse = new ListSessionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSessions($sessions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $request = (new ListSessionsRequest())->setParent($formattedParent); + $response = $gapicClient->listSessions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSessions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ConversationalSearchService/ListSessions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSessionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $request = (new ListSessionsRequest())->setParent($formattedParent); + try { + $gapicClient->listSessions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function updateConversationTest() { @@ -495,7 +930,7 @@ public function updateConversationExceptionTest() } /** @test */ - public function converseConversationAsyncTest() + public function updateSessionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -503,24 +938,98 @@ public function converseConversationAsyncTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $expectedResponse = new ConverseConversationResponse(); + $name = 'name3373707'; + $userPseudoId = 'userPseudoId-1850666040'; + $expectedResponse = new Session(); + $expectedResponse->setName($name); + $expectedResponse->setUserPseudoId($userPseudoId); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[CONVERSATION]'); - $query = new TextInput(); - $request = (new ConverseConversationRequest())->setName($formattedName)->setQuery($query); - $response = $gapicClient->converseConversationAsync($request)->wait(); + $session = new Session(); + $request = (new UpdateSessionRequest())->setSession($session); + $response = $gapicClient->updateSession($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.discoveryengine.v1.ConversationalSearchService/ConverseConversation', + '/google.cloud.discoveryengine.v1.ConversationalSearchService/UpdateSession', $actualFuncCall ); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getSession(); + $this->assertProtobufEquals($session, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSessionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $session = new Session(); + $request = (new UpdateSessionRequest())->setSession($session); + try { + $gapicClient->updateSession($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function answerQueryAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $answerQueryToken = 'answerQueryToken886927553'; + $expectedResponse = new AnswerQueryResponse(); + $expectedResponse->setAnswerQueryToken($answerQueryToken); + $transport->addResponse($expectedResponse); + // Mock request + $formattedServingConfig = $gapicClient->servingConfigName( + '[PROJECT]', + '[LOCATION]', + '[DATA_STORE]', + '[SERVING_CONFIG]' + ); + $query = new Query(); + $request = (new AnswerQueryRequest())->setServingConfig($formattedServingConfig)->setQuery($query); + $response = $gapicClient->answerQueryAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ConversationalSearchService/AnswerQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getServingConfig(); + $this->assertProtobufEquals($formattedServingConfig, $actualValue); $actualValue = $actualRequestObject->getQuery(); $this->assertProtobufEquals($query, $actualValue); $this->assertTrue($transport->isExhausted()); diff --git a/DiscoveryEngine/tests/Unit/V1/Client/DataStoreServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/DataStoreServiceClientTest.php index 65a46e0ab1a9..3d77697c7801 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/DataStoreServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/DataStoreServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1\Client\DataStoreServiceClient; @@ -35,6 +34,7 @@ use Google\Cloud\DiscoveryEngine\V1\ListDataStoresRequest; use Google\Cloud\DiscoveryEngine\V1\ListDataStoresResponse; use Google\Cloud\DiscoveryEngine\V1\UpdateDataStoreRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1/Client/DocumentServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/DocumentServiceClientTest.php index d7ab61894e83..1b7ece406457 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/DocumentServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/DocumentServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1\Client\DocumentServiceClient; @@ -39,6 +38,7 @@ use Google\Cloud\DiscoveryEngine\V1\PurgeDocumentsRequest; use Google\Cloud\DiscoveryEngine\V1\PurgeDocumentsResponse; use Google\Cloud\DiscoveryEngine\V1\UpdateDocumentRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1/Client/EngineServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/EngineServiceClientTest.php index 3685f7d67432..36b41762afc7 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/EngineServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/EngineServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1\Client\EngineServiceClient; @@ -36,6 +35,7 @@ use Google\Cloud\DiscoveryEngine\V1\ListEnginesResponse; use Google\Cloud\DiscoveryEngine\V1\SolutionType; use Google\Cloud\DiscoveryEngine\V1\UpdateEngineRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1/Client/GroundedGenerationServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/GroundedGenerationServiceClientTest.php new file mode 100644 index 000000000000..fce50c2ed29f --- /dev/null +++ b/DiscoveryEngine/tests/Unit/V1/Client/GroundedGenerationServiceClientTest.php @@ -0,0 +1,157 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return GroundedGenerationServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GroundedGenerationServiceClient($options); + } + + /** @test */ + public function checkGroundingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $supportScore = -13206883; + $expectedResponse = new CheckGroundingResponse(); + $expectedResponse->setSupportScore($supportScore); + $transport->addResponse($expectedResponse); + // Mock request + $formattedGroundingConfig = $gapicClient->groundingConfigName('[PROJECT]', '[LOCATION]', '[GROUNDING_CONFIG]'); + $request = (new CheckGroundingRequest())->setGroundingConfig($formattedGroundingConfig); + $response = $gapicClient->checkGrounding($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.GroundedGenerationService/CheckGrounding', $actualFuncCall); + $actualValue = $actualRequestObject->getGroundingConfig(); + $this->assertProtobufEquals($formattedGroundingConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function checkGroundingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedGroundingConfig = $gapicClient->groundingConfigName('[PROJECT]', '[LOCATION]', '[GROUNDING_CONFIG]'); + $request = (new CheckGroundingRequest())->setGroundingConfig($formattedGroundingConfig); + try { + $gapicClient->checkGrounding($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function checkGroundingAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $supportScore = -13206883; + $expectedResponse = new CheckGroundingResponse(); + $expectedResponse->setSupportScore($supportScore); + $transport->addResponse($expectedResponse); + // Mock request + $formattedGroundingConfig = $gapicClient->groundingConfigName('[PROJECT]', '[LOCATION]', '[GROUNDING_CONFIG]'); + $request = (new CheckGroundingRequest())->setGroundingConfig($formattedGroundingConfig); + $response = $gapicClient->checkGroundingAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.GroundedGenerationService/CheckGrounding', $actualFuncCall); + $actualValue = $actualRequestObject->getGroundingConfig(); + $this->assertProtobufEquals($formattedGroundingConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/DiscoveryEngine/tests/Unit/V1/Client/ProjectServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/ProjectServiceClientTest.php new file mode 100644 index 000000000000..b67d72d9176f --- /dev/null +++ b/DiscoveryEngine/tests/Unit/V1/Client/ProjectServiceClientTest.php @@ -0,0 +1,280 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ProjectServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProjectServiceClient($options); + } + + /** @test */ + public function provisionProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/provisionProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/provisionProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $acceptDataUseTerms = false; + $dataUseTermsVersion = 'dataUseTermsVersion1209366547'; + $request = (new ProvisionProjectRequest()) + ->setName($formattedName) + ->setAcceptDataUseTerms($acceptDataUseTerms) + ->setDataUseTermsVersion($dataUseTermsVersion); + $response = $gapicClient->provisionProject($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ProjectService/ProvisionProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getAcceptDataUseTerms(); + $this->assertProtobufEquals($acceptDataUseTerms, $actualValue); + $actualValue = $actualApiRequestObject->getDataUseTermsVersion(); + $this->assertProtobufEquals($dataUseTermsVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/provisionProjectTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function provisionProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/provisionProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $acceptDataUseTerms = false; + $dataUseTermsVersion = 'dataUseTermsVersion1209366547'; + $request = (new ProvisionProjectRequest()) + ->setName($formattedName) + ->setAcceptDataUseTerms($acceptDataUseTerms) + ->setDataUseTermsVersion($dataUseTermsVersion); + $response = $gapicClient->provisionProject($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/provisionProjectTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function provisionProjectAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/provisionProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/provisionProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $acceptDataUseTerms = false; + $dataUseTermsVersion = 'dataUseTermsVersion1209366547'; + $request = (new ProvisionProjectRequest()) + ->setName($formattedName) + ->setAcceptDataUseTerms($acceptDataUseTerms) + ->setDataUseTermsVersion($dataUseTermsVersion); + $response = $gapicClient->provisionProjectAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.ProjectService/ProvisionProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getAcceptDataUseTerms(); + $this->assertProtobufEquals($acceptDataUseTerms, $actualValue); + $actualValue = $actualApiRequestObject->getDataUseTermsVersion(); + $this->assertProtobufEquals($dataUseTermsVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/provisionProjectTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/DiscoveryEngine/tests/Unit/V1/Client/RankServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/RankServiceClientTest.php new file mode 100644 index 000000000000..2e3ca29b0188 --- /dev/null +++ b/DiscoveryEngine/tests/Unit/V1/Client/RankServiceClientTest.php @@ -0,0 +1,160 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return RankServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RankServiceClient($options); + } + + /** @test */ + public function rankTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RankResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedRankingConfig = $gapicClient->rankingConfigName('[PROJECT]', '[LOCATION]', '[RANKING_CONFIG]'); + $records = []; + $request = (new RankRequest())->setRankingConfig($formattedRankingConfig)->setRecords($records); + $response = $gapicClient->rank($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.RankService/Rank', $actualFuncCall); + $actualValue = $actualRequestObject->getRankingConfig(); + $this->assertProtobufEquals($formattedRankingConfig, $actualValue); + $actualValue = $actualRequestObject->getRecords(); + $this->assertProtobufEquals($records, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rankExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedRankingConfig = $gapicClient->rankingConfigName('[PROJECT]', '[LOCATION]', '[RANKING_CONFIG]'); + $records = []; + $request = (new RankRequest())->setRankingConfig($formattedRankingConfig)->setRecords($records); + try { + $gapicClient->rank($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rankAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RankResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedRankingConfig = $gapicClient->rankingConfigName('[PROJECT]', '[LOCATION]', '[RANKING_CONFIG]'); + $records = []; + $request = (new RankRequest())->setRankingConfig($formattedRankingConfig)->setRecords($records); + $response = $gapicClient->rankAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1.RankService/Rank', $actualFuncCall); + $actualValue = $actualRequestObject->getRankingConfig(); + $this->assertProtobufEquals($formattedRankingConfig, $actualValue); + $actualValue = $actualRequestObject->getRecords(); + $this->assertProtobufEquals($records, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/DiscoveryEngine/tests/Unit/V1/Client/SchemaServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/SchemaServiceClientTest.php index c4a65a5f8eb2..ef306fecce58 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/SchemaServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/SchemaServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1\Client\SchemaServiceClient; @@ -35,6 +34,7 @@ use Google\Cloud\DiscoveryEngine\V1\ListSchemasResponse; use Google\Cloud\DiscoveryEngine\V1\Schema; use Google\Cloud\DiscoveryEngine\V1\UpdateSchemaRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1/Client/SiteSearchEngineServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/SiteSearchEngineServiceClientTest.php index 2bfd7b8b5570..145a2e54f5b3 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/SiteSearchEngineServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/SiteSearchEngineServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1\BatchCreateTargetSitesRequest; @@ -49,6 +48,7 @@ use Google\Cloud\DiscoveryEngine\V1\SiteSearchEngine; use Google\Cloud\DiscoveryEngine\V1\TargetSite; use Google\Cloud\DiscoveryEngine\V1\UpdateTargetSiteRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -365,11 +365,13 @@ public function createTargetSiteTest() $providedUriPattern = 'providedUriPattern437506913'; $exactMatch = false; $generatedUriPattern = 'generatedUriPattern-1580317427'; + $rootDomainUri = 'rootDomainUri-789734674'; $expectedResponse = new TargetSite(); $expectedResponse->setName($name); $expectedResponse->setProvidedUriPattern($providedUriPattern); $expectedResponse->setExactMatch($exactMatch); $expectedResponse->setGeneratedUriPattern($generatedUriPattern); + $expectedResponse->setRootDomainUri($rootDomainUri); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -1013,11 +1015,13 @@ public function getTargetSiteTest() $providedUriPattern = 'providedUriPattern437506913'; $exactMatch = false; $generatedUriPattern = 'generatedUriPattern-1580317427'; + $rootDomainUri = 'rootDomainUri-789734674'; $expectedResponse = new TargetSite(); $expectedResponse->setName($name2); $expectedResponse->setProvidedUriPattern($providedUriPattern); $expectedResponse->setExactMatch($exactMatch); $expectedResponse->setGeneratedUriPattern($generatedUriPattern); + $expectedResponse->setRootDomainUri($rootDomainUri); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->targetSiteName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[TARGET_SITE]'); @@ -1295,11 +1299,13 @@ public function updateTargetSiteTest() $providedUriPattern = 'providedUriPattern437506913'; $exactMatch = false; $generatedUriPattern = 'generatedUriPattern-1580317427'; + $rootDomainUri = 'rootDomainUri-789734674'; $expectedResponse = new TargetSite(); $expectedResponse->setName($name); $expectedResponse->setProvidedUriPattern($providedUriPattern); $expectedResponse->setExactMatch($exactMatch); $expectedResponse->setGeneratedUriPattern($generatedUriPattern); + $expectedResponse->setRootDomainUri($rootDomainUri); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); diff --git a/DiscoveryEngine/tests/Unit/V1/Client/UserEventServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/UserEventServiceClientTest.php index 2760c583dca4..14348b87e534 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/UserEventServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/UserEventServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Api\HttpBody; @@ -34,6 +33,7 @@ use Google\Cloud\DiscoveryEngine\V1\ImportUserEventsResponse; use Google\Cloud\DiscoveryEngine\V1\UserEvent; use Google\Cloud\DiscoveryEngine\V1\WriteUserEventRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -278,6 +278,8 @@ public function writeUserEventTest() // Mock response $eventType = 'eventType984376767'; $userPseudoId = 'userPseudoId-1850666040'; + $engine = 'engine-1298662846'; + $dataStore = 'dataStore1619682316'; $directUserRequest = false; $sessionId = 'sessionId1661853540'; $attributionToken = 'attributionToken-729411015'; @@ -285,6 +287,8 @@ public function writeUserEventTest() $expectedResponse = new UserEvent(); $expectedResponse->setEventType($eventType); $expectedResponse->setUserPseudoId($userPseudoId); + $expectedResponse->setEngine($engine); + $expectedResponse->setDataStore($dataStore); $expectedResponse->setDirectUserRequest($directUserRequest); $expectedResponse->setSessionId($sessionId); $expectedResponse->setAttributionToken($attributionToken); diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/CompletionServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/CompletionServiceClientTest.php index 5165fe07b9da..5c406405b79f 100644 --- a/DiscoveryEngine/tests/Unit/V1beta/Client/CompletionServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/CompletionServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1beta\Client\CompletionServiceClient; @@ -34,6 +33,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\ImportSuggestionDenyListEntriesResponse; use Google\Cloud\DiscoveryEngine\V1beta\PurgeSuggestionDenyListEntriesRequest; use Google\Cloud\DiscoveryEngine\V1beta\PurgeSuggestionDenyListEntriesResponse; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/ControlServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/ControlServiceClientTest.php new file mode 100644 index 000000000000..99f3f95fdf1e --- /dev/null +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/ControlServiceClientTest.php @@ -0,0 +1,478 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ControlServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ControlServiceClient($options); + } + + /** @test */ + public function createControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $controlId = 'controlId637416253'; + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + $response = $gapicClient->createControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.ControlService/CreateControl', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getControl(); + $this->assertProtobufEquals($control, $actualValue); + $actualValue = $actualRequestObject->getControlId(); + $this->assertProtobufEquals($controlId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createControlExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $controlId = 'controlId637416253'; + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + try { + $gapicClient->createControl($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[CONTROL]'); + $request = (new DeleteControlRequest())->setName($formattedName); + $gapicClient->deleteControl($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.ControlService/DeleteControl', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteControlExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[CONTROL]'); + $request = (new DeleteControlRequest())->setName($formattedName); + try { + $gapicClient->deleteControl($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[CONTROL]'); + $request = (new GetControlRequest())->setName($formattedName); + $response = $gapicClient->getControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.ControlService/GetControl', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getControlExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->controlName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[CONTROL]'); + $request = (new GetControlRequest())->setName($formattedName); + try { + $gapicClient->getControl($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listControlsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $controlsElement = new Control(); + $controls = [$controlsElement]; + $expectedResponse = new ListControlsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setControls($controls); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $request = (new ListControlsRequest())->setParent($formattedParent); + $response = $gapicClient->listControls($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getControls()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.ControlService/ListControls', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listControlsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $request = (new ListControlsRequest())->setParent($formattedParent); + try { + $gapicClient->listControls($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateControlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $request = (new UpdateControlRequest())->setControl($control); + $response = $gapicClient->updateControl($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.ControlService/UpdateControl', $actualFuncCall); + $actualValue = $actualRequestObject->getControl(); + $this->assertProtobufEquals($control, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateControlExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $request = (new UpdateControlRequest())->setControl($control); + try { + $gapicClient->updateControl($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createControlAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Control(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $control = new Control(); + $controlDisplayName = 'controlDisplayName-1438249776'; + $control->setDisplayName($controlDisplayName); + $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; + $control->setSolutionType($controlSolutionType); + $controlId = 'controlId637416253'; + $request = (new CreateControlRequest()) + ->setParent($formattedParent) + ->setControl($control) + ->setControlId($controlId); + $response = $gapicClient->createControlAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.ControlService/CreateControl', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getControl(); + $this->assertProtobufEquals($control, $actualValue); + $actualValue = $actualRequestObject->getControlId(); + $this->assertProtobufEquals($controlId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/ConversationalSearchServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/ConversationalSearchServiceClientTest.php index d25fe7427d9f..e0122a775b3b 100644 --- a/DiscoveryEngine/tests/Unit/V1beta/Client/ConversationalSearchServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/ConversationalSearchServiceClientTest.php @@ -92,7 +92,9 @@ public function answerQueryTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response + $answerQueryToken = 'answerQueryToken886927553'; $expectedResponse = new AnswerQueryResponse(); + $expectedResponse->setAnswerQueryToken($answerQueryToken); $transport->addResponse($expectedResponse); // Mock request $formattedServingConfig = $gapicClient->servingConfigName( @@ -1018,7 +1020,9 @@ public function answerQueryAsyncTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response + $answerQueryToken = 'answerQueryToken886927553'; $expectedResponse = new AnswerQueryResponse(); + $expectedResponse->setAnswerQueryToken($answerQueryToken); $transport->addResponse($expectedResponse); // Mock request $formattedServingConfig = $gapicClient->servingConfigName( diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/DataStoreServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/DataStoreServiceClientTest.php index 3de6f5bd02aa..b5e31e2e2fbb 100644 --- a/DiscoveryEngine/tests/Unit/V1beta/Client/DataStoreServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/DataStoreServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1beta\Client\DataStoreServiceClient; @@ -35,6 +34,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\ListDataStoresRequest; use Google\Cloud\DiscoveryEngine\V1beta\ListDataStoresResponse; use Google\Cloud\DiscoveryEngine\V1beta\UpdateDataStoreRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/DocumentServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/DocumentServiceClientTest.php index 567eacf9e98e..fdedafdb3fc8 100644 --- a/DiscoveryEngine/tests/Unit/V1beta/Client/DocumentServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/DocumentServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1beta\Client\DocumentServiceClient; @@ -39,6 +38,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\PurgeDocumentsRequest; use Google\Cloud\DiscoveryEngine\V1beta\PurgeDocumentsResponse; use Google\Cloud\DiscoveryEngine\V1beta\UpdateDocumentRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/EngineServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/EngineServiceClientTest.php index b7ac06033c55..f0de60095118 100644 --- a/DiscoveryEngine/tests/Unit/V1beta/Client/EngineServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/EngineServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1beta\Client\EngineServiceClient; @@ -40,6 +39,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\TuneEngineRequest; use Google\Cloud\DiscoveryEngine\V1beta\TuneEngineResponse; use Google\Cloud\DiscoveryEngine\V1beta\UpdateEngineRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/ProjectServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/ProjectServiceClientTest.php new file mode 100644 index 000000000000..76c46d924b05 --- /dev/null +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/ProjectServiceClientTest.php @@ -0,0 +1,280 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ProjectServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProjectServiceClient($options); + } + + /** @test */ + public function provisionProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/provisionProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/provisionProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $acceptDataUseTerms = false; + $dataUseTermsVersion = 'dataUseTermsVersion1209366547'; + $request = (new ProvisionProjectRequest()) + ->setName($formattedName) + ->setAcceptDataUseTerms($acceptDataUseTerms) + ->setDataUseTermsVersion($dataUseTermsVersion); + $response = $gapicClient->provisionProject($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.ProjectService/ProvisionProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getAcceptDataUseTerms(); + $this->assertProtobufEquals($acceptDataUseTerms, $actualValue); + $actualValue = $actualApiRequestObject->getDataUseTermsVersion(); + $this->assertProtobufEquals($dataUseTermsVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/provisionProjectTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function provisionProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/provisionProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $acceptDataUseTerms = false; + $dataUseTermsVersion = 'dataUseTermsVersion1209366547'; + $request = (new ProvisionProjectRequest()) + ->setName($formattedName) + ->setAcceptDataUseTerms($acceptDataUseTerms) + ->setDataUseTermsVersion($dataUseTermsVersion); + $response = $gapicClient->provisionProject($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/provisionProjectTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function provisionProjectAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/provisionProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/provisionProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $acceptDataUseTerms = false; + $dataUseTermsVersion = 'dataUseTermsVersion1209366547'; + $request = (new ProvisionProjectRequest()) + ->setName($formattedName) + ->setAcceptDataUseTerms($acceptDataUseTerms) + ->setDataUseTermsVersion($dataUseTermsVersion); + $response = $gapicClient->provisionProjectAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.ProjectService/ProvisionProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getAcceptDataUseTerms(); + $this->assertProtobufEquals($acceptDataUseTerms, $actualValue); + $actualValue = $actualApiRequestObject->getDataUseTermsVersion(); + $this->assertProtobufEquals($dataUseTermsVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/provisionProjectTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/SchemaServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/SchemaServiceClientTest.php index bbab542ccb72..93186dcfd002 100644 --- a/DiscoveryEngine/tests/Unit/V1beta/Client/SchemaServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/SchemaServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1beta\Client\SchemaServiceClient; @@ -35,6 +34,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\ListSchemasResponse; use Google\Cloud\DiscoveryEngine\V1beta\Schema; use Google\Cloud\DiscoveryEngine\V1beta\UpdateSchemaRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/SearchTuningServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/SearchTuningServiceClientTest.php index 5d2545431d7c..9dab759e9b6a 100644 --- a/DiscoveryEngine/tests/Unit/V1beta/Client/SearchTuningServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/SearchTuningServiceClientTest.php @@ -24,12 +24,14 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1beta\Client\SearchTuningServiceClient; +use Google\Cloud\DiscoveryEngine\V1beta\ListCustomModelsRequest; +use Google\Cloud\DiscoveryEngine\V1beta\ListCustomModelsResponse; use Google\Cloud\DiscoveryEngine\V1beta\TrainCustomModelRequest; use Google\Cloud\DiscoveryEngine\V1beta\TrainCustomModelResponse; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -66,6 +68,69 @@ private function createClient(array $options = []) return new SearchTuningServiceClient($options); } + /** @test */ + public function listCustomModelsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListCustomModelsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedDataStore = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $request = (new ListCustomModelsRequest())->setDataStore($formattedDataStore); + $response = $gapicClient->listCustomModels($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.SearchTuningService/ListCustomModels', $actualFuncCall); + $actualValue = $actualRequestObject->getDataStore(); + $this->assertProtobufEquals($formattedDataStore, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCustomModelsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedDataStore = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); + $request = (new ListCustomModelsRequest())->setDataStore($formattedDataStore); + try { + $gapicClient->listCustomModels($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function trainCustomModelTest() { @@ -88,8 +153,10 @@ public function trainCustomModelTest() $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $modelStatus = 'modelStatus12165576'; + $modelName = 'modelName2104871393'; $expectedResponse = new TrainCustomModelResponse(); $expectedResponse->setModelStatus($modelStatus); + $expectedResponse->setModelName($modelName); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -194,70 +261,28 @@ public function trainCustomModelExceptionTest() } /** @test */ - public function trainCustomModelAsyncTest() + public function listCustomModelsAsyncTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/trainCustomModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $modelStatus = 'modelStatus12165576'; - $expectedResponse = new TrainCustomModelResponse(); - $expectedResponse->setModelStatus($modelStatus); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/trainCustomModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); + $expectedResponse = new ListCustomModelsResponse(); + $transport->addResponse($expectedResponse); // Mock request $formattedDataStore = $gapicClient->dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - $request = (new TrainCustomModelRequest())->setDataStore($formattedDataStore); - $response = $gapicClient->trainCustomModelAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame( - '/google.cloud.discoveryengine.v1beta.SearchTuningService/TrainCustomModel', - $actualApiFuncCall - ); - $actualValue = $actualApiRequestObject->getDataStore(); + $request = (new ListCustomModelsRequest())->setDataStore($formattedDataStore); + $response = $gapicClient->listCustomModelsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.discoveryengine.v1beta.SearchTuningService/ListCustomModels', $actualFuncCall); + $actualValue = $actualRequestObject->getDataStore(); $this->assertProtobufEquals($formattedDataStore, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/trainCustomModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } } diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/SiteSearchEngineServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/SiteSearchEngineServiceClientTest.php index 7b0a010dba77..4658ab1723ff 100644 --- a/DiscoveryEngine/tests/Unit/V1beta/Client/SiteSearchEngineServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/SiteSearchEngineServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1beta\BatchCreateTargetSitesRequest; @@ -49,6 +48,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\SiteSearchEngine; use Google\Cloud\DiscoveryEngine\V1beta\TargetSite; use Google\Cloud\DiscoveryEngine\V1beta\UpdateTargetSiteRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -365,11 +365,13 @@ public function createTargetSiteTest() $providedUriPattern = 'providedUriPattern437506913'; $exactMatch = false; $generatedUriPattern = 'generatedUriPattern-1580317427'; + $rootDomainUri = 'rootDomainUri-789734674'; $expectedResponse = new TargetSite(); $expectedResponse->setName($name); $expectedResponse->setProvidedUriPattern($providedUriPattern); $expectedResponse->setExactMatch($exactMatch); $expectedResponse->setGeneratedUriPattern($generatedUriPattern); + $expectedResponse->setRootDomainUri($rootDomainUri); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -1013,11 +1015,13 @@ public function getTargetSiteTest() $providedUriPattern = 'providedUriPattern437506913'; $exactMatch = false; $generatedUriPattern = 'generatedUriPattern-1580317427'; + $rootDomainUri = 'rootDomainUri-789734674'; $expectedResponse = new TargetSite(); $expectedResponse->setName($name2); $expectedResponse->setProvidedUriPattern($providedUriPattern); $expectedResponse->setExactMatch($exactMatch); $expectedResponse->setGeneratedUriPattern($generatedUriPattern); + $expectedResponse->setRootDomainUri($rootDomainUri); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->targetSiteName('[PROJECT]', '[LOCATION]', '[DATA_STORE]', '[TARGET_SITE]'); @@ -1304,11 +1308,13 @@ public function updateTargetSiteTest() $providedUriPattern = 'providedUriPattern437506913'; $exactMatch = false; $generatedUriPattern = 'generatedUriPattern-1580317427'; + $rootDomainUri = 'rootDomainUri-789734674'; $expectedResponse = new TargetSite(); $expectedResponse->setName($name); $expectedResponse->setProvidedUriPattern($providedUriPattern); $expectedResponse->setExactMatch($exactMatch); $expectedResponse->setGeneratedUriPattern($generatedUriPattern); + $expectedResponse->setRootDomainUri($rootDomainUri); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); diff --git a/DiscoveryEngine/tests/Unit/V1beta/Client/UserEventServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1beta/Client/UserEventServiceClientTest.php index 8574c7779b97..4496bf3a5288 100644 --- a/DiscoveryEngine/tests/Unit/V1beta/Client/UserEventServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1beta/Client/UserEventServiceClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Api\HttpBody; @@ -34,6 +33,7 @@ use Google\Cloud\DiscoveryEngine\V1beta\ImportUserEventsResponse; use Google\Cloud\DiscoveryEngine\V1beta\UserEvent; use Google\Cloud\DiscoveryEngine\V1beta\WriteUserEventRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -278,6 +278,8 @@ public function writeUserEventTest() // Mock response $eventType = 'eventType984376767'; $userPseudoId = 'userPseudoId-1850666040'; + $engine = 'engine-1298662846'; + $dataStore = 'dataStore1619682316'; $directUserRequest = false; $sessionId = 'sessionId1661853540'; $attributionToken = 'attributionToken-729411015'; @@ -285,6 +287,8 @@ public function writeUserEventTest() $expectedResponse = new UserEvent(); $expectedResponse->setEventType($eventType); $expectedResponse->setUserPseudoId($userPseudoId); + $expectedResponse->setEngine($engine); + $expectedResponse->setDataStore($dataStore); $expectedResponse->setDirectUserRequest($directUserRequest); $expectedResponse->setSessionId($sessionId); $expectedResponse->setAttributionToken($attributionToken); diff --git a/Dlp/.repo-metadata.json b/Dlp/.repo-metadata.json deleted file mode 100644 index 25719c82290e..000000000000 --- a/Dlp/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-dlp", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dlp/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "dlp" -} diff --git a/Dlp/VERSION b/Dlp/VERSION index b50dd27dd92e..ace44233b4aa 100644 --- a/Dlp/VERSION +++ b/Dlp/VERSION @@ -1 +1 @@ -1.13.1 +1.15.1 diff --git a/Dlp/composer.json b/Dlp/composer.json index 59c7e4db212a..06a108aeea32 100644 --- a/Dlp/composer.json +++ b/Dlp/composer.json @@ -5,7 +5,7 @@ "minimum-stability": "stable", "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Dlp/metadata/V2/Dlp.php b/Dlp/metadata/V2/Dlp.php index 20ae8e5572b255f4b8d0ad5a0afb52c4e0fb5080..ede415345d0961fc7dfba3e707f918f7c41c385c 100644 GIT binary patch delta 4087 zcmb_fTWs6b84fAQv5zmJPJEFsN@Uh{64kL=BbUNk(@-+&FxJJ9WE*xjFsw}5N@Ph9 z<+a(CxlIu?D>gXkfp_UkGYkWUuFIAP>45d2&W06ehZSk|GPrw4mJS2f4cOiatX=jW zQWPmU9xz~!{LlIS|NF1s;cG8DfBly8=hvK$@4x9RU3YHyoEuK$CAWBQ>D&Am!`vfx z9(l353*qd_vRueLr^)$3E~RRkI`4J)nSG8@yzf;PbG!8C{T_yW+eJPN%(z<+66VBs zP>@atQSLDkee_RMHX+Oj6UP%tkPVaJ!LK(WR2QF0BqV_wBySAnn;Oy1sfoBCMMdra z={#_VDoxD=#R*AQ8Y)E&ysNOEF{E|v%kB6C;!>I1%Dk+d&B#Tiu&5TjEV-)qhC@`G zIGY(uYpL8<)WW%>etLWd9!D*jnkuM8&D3!C8Iqst-kC7OrBiDWhP}#?pI!cC8$O2I zMdjIyDi_oRwV-BGs@FkYFZoEm!{v^fvg13tyr`X=ywYBJ>B?iyrgvD>VL~96)`a@X z$A@b|!2Ag1vh(R;I+xY(48n_QRxK#>Q%))KWltw(d}L#-!P1|(EFEq@JIgotZ-S#r zjHcbE)0v`LfJjj)m&vFpYSYUQ;Zkqkvx=t1RV}wtNU5R9A*3aU>T<;;wV*))Kfmew zqL9hN==Ycc;oFonxI2To=gVS9i(#xPKcC<1owO_2@)WE`bqhK^zJR)Fty_?=gxu+D zDzh?AQ@^M_Pi|lCCEO)vtlBV~sDLR5Ims(U2s_KqLP}~-$EgKX!$(nl`IhEo{EmH% zBZK6{_3nW!Hu;ws)K+VSyz+{FwH>vjvszJsPB4IZSr~!_402miz?~QR3gmsL$0jc) zE2}J<+D>|l??#>5W}LskpiUFZs#(2CPH_i9Fp;OB&T@Jl!UB6i$6bNNZK&RaYJjYW zO+*GpL%bV#OmU^EULBo&&Tl$U_gMN+d7jK(v-R*P#8nKa*~N5LHIm#iB9MFiUUK!5 zhLQ4ET3SP9V4|);T`_nXxr*oVpziQH$dyYyRCRTGRWl_?(BZSFrP?Ik1Gt5x5EK%k zEJnv+x5!h`#H1LKo|eQhZU^SkZXq0&6H}9uv3OD(lWVRgI0iR}$Q7AQoD6d;ZbJ2w zu|#q_E+#k!f0;q8rbjyxJb?I$A-EcwiiboZ{H}F%2nDtr$jRABQLctTMbx(+^=xw= zq6&)~%fIOaU*@VaOEX?sC?R8?;5_QkQcFGRvLY|%=FXd^-w>0uNiq@Tdgc-Nxsxo>U{fC2lJqW-|1(b!5-ACS5t~6#rU)k=G@eU zE{Y4$agp|y$Z;^ZyK00_x4%11bdei%fF3bY$awSL?SJV3&fb6k&yDv&McW z56&O-TAz57F8|75_#1ot)}b-a6R34uEm~5tu{yHb`sCLc)E-W2wi_CCvS3|-o!5|8 z7FAhGe^u2tjLVo`x{;{7m^-6ptsO%%U0(jyVqy62GRT`yl|pLCGOfE>wZ8vPu1=$l znvh^(^FY8VK8zYum4q3KizF^~Aq&H+*SZ23)VT%f!%dLLMSrz&>juBG~s|&aRHwdp@QVp zcYL-!Nl>Zb^l?d7mb_FS$2==5iu439vKzOD4DI%NkllqLBN)Mmn#lx52{f75}m zd13_wbmF$48s-ent-C9@D0@vHkBLb(Q5etCz&2sPn@U8@m1N3kWtrT4Y0nAMdlfFY z+=JZ9%JZ@XL(}I;pFS4Y(+xeQzuIJjhrK(AJK$S2%~`=bgne0lVGDzHLz``3(1~bl zCJOA?2@j>3LxU(8!0ELe?bWHb!kjFvGCah~rR3+3&*)|H+gphe^X?P%><<|-`oUa( zAM%_0DNjoYDJX@dgR*#1H9&7p)3|d9S~77oEnMBl6SDUe5()Q_x56!tXyO>`Gvics?2+fB$zo z8#qLM@P{_C_E8gjw%&Y#nPb}VTMXiAcRVK7lV0-F{W{w~lh}R#fE6(x+Z1qKfghFP zpx^2b-6y$qe{ZiP(?*#9ew{(hRV;wXl^fn_5p~gRb8*xj$m4j}MBit#JsdcXZ!pMR zvu*JKa`s={cKB!h(r<&WnY)xfwkgyZap>5on-BlkPHz9B#U28Fz#z|-g-nj!>3oRv z^c_D}dzbv=vmWNKX}aAO!KkKF(%h5y3&eA8|Guq9_%*0e?fTVgv_(p;ZTh+Dyal$+ l+mFF)Eln7ump`s8y}d4iy)FkwD)w7!(4j8BSYwz*_CF&@V4wg1 delta 175 zcmV;g08szKwgj4o1hB3I1M&O=v#|ug9R#EV3K)~YA{eucB18cJ#goz_fwONUkp%&V zvjHj*0Rr*_lN2jglY1-SlWZ(|lk+TZlW#3Fv$HM5VF728dXHVRY>+$w0^R|Ws*$?0 zrjkkovtXY>B?|5g3K2tZY;|pJlO4Spv&O{u0|BJ7zsMy4vp>qp1+&xFI0ylKlMUcn dvyI@{0RuAPVzbfW$uGBv69HKPw>udD2m(s(NA3Us diff --git a/Dlp/metadata/V2/Storage.php b/Dlp/metadata/V2/Storage.php index b0e44d618339e32ec1d3110b9092ac244c737a25..54322abd217f78acd1fafae8298baff681c16b6c 100644 GIT binary patch delta 77 zcmX?M&|tX1m5Jr8Hka~5Z{^K7Opk<&&A9kN5|eULgHqE{i&FEFQ-y@MxKa{J5{pwy d;xkhu7!?>bIE4hbI7&dOKq5?=Jw^XB0RXZ!7e4?1 delta 25 hcmZoLJYlfGm5F7mHka~5Z{^K7Opk;%w~78@0swMi2@n7P diff --git a/Dlp/samples/V2/DlpServiceClient/create_connection.php b/Dlp/samples/V2/DlpServiceClient/create_connection.php new file mode 100644 index 000000000000..abbf09650f9a --- /dev/null +++ b/Dlp/samples/V2/DlpServiceClient/create_connection.php @@ -0,0 +1,78 @@ +setState($connectionState); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnection($connection); + + // Call the API and handle any network failures. + try { + /** @var Connection $response */ + $response = $dlpServiceClient->createConnection($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 +{ + $formattedParent = DlpServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + + create_connection_sample($formattedParent, $connectionState); +} +// [END dlp_v2_generated_DlpService_CreateConnection_sync] diff --git a/Dlp/samples/V2/DlpServiceClient/delete_connection.php b/Dlp/samples/V2/DlpServiceClient/delete_connection.php new file mode 100644 index 000000000000..13dbad8fcf6d --- /dev/null +++ b/Dlp/samples/V2/DlpServiceClient/delete_connection.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $dlpServiceClient->deleteConnection($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = DlpServiceClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + + delete_connection_sample($formattedName); +} +// [END dlp_v2_generated_DlpService_DeleteConnection_sync] diff --git a/Dlp/samples/V2/DlpServiceClient/delete_table_data_profile.php b/Dlp/samples/V2/DlpServiceClient/delete_table_data_profile.php new file mode 100644 index 000000000000..05e273d94ca0 --- /dev/null +++ b/Dlp/samples/V2/DlpServiceClient/delete_table_data_profile.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $dlpServiceClient->deleteTableDataProfile($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = DlpServiceClient::tableDataProfileName( + '[ORGANIZATION]', + '[LOCATION]', + '[TABLE_DATA_PROFILE]' + ); + + delete_table_data_profile_sample($formattedName); +} +// [END dlp_v2_generated_DlpService_DeleteTableDataProfile_sync] diff --git a/Dlp/samples/V2/DlpServiceClient/get_connection.php b/Dlp/samples/V2/DlpServiceClient/get_connection.php new file mode 100644 index 000000000000..e5af3e946341 --- /dev/null +++ b/Dlp/samples/V2/DlpServiceClient/get_connection.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Connection $response */ + $response = $dlpServiceClient->getConnection($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 = DlpServiceClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + + get_connection_sample($formattedName); +} +// [END dlp_v2_generated_DlpService_GetConnection_sync] diff --git a/Dlp/samples/V2/DlpServiceClient/list_column_data_profiles.php b/Dlp/samples/V2/DlpServiceClient/list_column_data_profiles.php index e42af50fd299..a285f12d5096 100644 --- a/Dlp/samples/V2/DlpServiceClient/list_column_data_profiles.php +++ b/Dlp/samples/V2/DlpServiceClient/list_column_data_profiles.php @@ -30,7 +30,7 @@ use Google\Cloud\Dlp\V2\ListColumnDataProfilesRequest; /** - * Lists data profiles for an organization. + * Lists column data profiles for an organization. * * @param string $formattedParent Resource name of the organization or project, for * example `organizations/433245324/locations/europe` or diff --git a/Dlp/samples/V2/DlpServiceClient/list_connections.php b/Dlp/samples/V2/DlpServiceClient/list_connections.php new file mode 100644 index 000000000000..31cee6928593 --- /dev/null +++ b/Dlp/samples/V2/DlpServiceClient/list_connections.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dlpServiceClient->listConnections($request); + + /** @var Connection $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = DlpServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_connections_sample($formattedParent); +} +// [END dlp_v2_generated_DlpService_ListConnections_sync] diff --git a/Dlp/samples/V2/DlpServiceClient/list_project_data_profiles.php b/Dlp/samples/V2/DlpServiceClient/list_project_data_profiles.php index fe0be1f3bc16..d5548dedc860 100644 --- a/Dlp/samples/V2/DlpServiceClient/list_project_data_profiles.php +++ b/Dlp/samples/V2/DlpServiceClient/list_project_data_profiles.php @@ -30,7 +30,7 @@ use Google\Cloud\Dlp\V2\ProjectDataProfile; /** - * Lists data profiles for an organization. + * Lists project data profiles for an organization. * * @param string $formattedParent organizations/{org_id}/locations/{loc_id} * Please see {@see DlpServiceClient::organizationLocationName()} for help formatting this field. diff --git a/Dlp/samples/V2/DlpServiceClient/list_table_data_profiles.php b/Dlp/samples/V2/DlpServiceClient/list_table_data_profiles.php index a26f7fe7e268..256859c421db 100644 --- a/Dlp/samples/V2/DlpServiceClient/list_table_data_profiles.php +++ b/Dlp/samples/V2/DlpServiceClient/list_table_data_profiles.php @@ -30,7 +30,7 @@ use Google\Cloud\Dlp\V2\TableDataProfile; /** - * Lists data profiles for an organization. + * Lists table data profiles for an organization. * * @param string $formattedParent Resource name of the organization or project, for * example `organizations/433245324/locations/europe` or diff --git a/Dlp/samples/V2/DlpServiceClient/search_connections.php b/Dlp/samples/V2/DlpServiceClient/search_connections.php new file mode 100644 index 000000000000..8156bf13200e --- /dev/null +++ b/Dlp/samples/V2/DlpServiceClient/search_connections.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dlpServiceClient->searchConnections($request); + + /** @var Connection $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = DlpServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + search_connections_sample($formattedParent); +} +// [END dlp_v2_generated_DlpService_SearchConnections_sync] diff --git a/Dlp/samples/V2/DlpServiceClient/update_connection.php b/Dlp/samples/V2/DlpServiceClient/update_connection.php new file mode 100644 index 000000000000..05f37b598201 --- /dev/null +++ b/Dlp/samples/V2/DlpServiceClient/update_connection.php @@ -0,0 +1,78 @@ +setState($connectionState); + $request = (new UpdateConnectionRequest()) + ->setName($formattedName) + ->setConnection($connection); + + // Call the API and handle any network failures. + try { + /** @var Connection $response */ + $response = $dlpServiceClient->updateConnection($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 = DlpServiceClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + + update_connection_sample($formattedName, $connectionState); +} +// [END dlp_v2_generated_DlpService_UpdateConnection_sync] diff --git a/Dlp/src/V2/AllOtherDatabaseResources.php b/Dlp/src/V2/AllOtherDatabaseResources.php new file mode 100644 index 000000000000..77c9979299d6 --- /dev/null +++ b/Dlp/src/V2/AllOtherDatabaseResources.php @@ -0,0 +1,33 @@ +google.privacy.dlp.v2.AllOtherDatabaseResources + */ +class AllOtherDatabaseResources extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Dlp/src/V2/Client/DlpServiceClient.php b/Dlp/src/V2/Client/DlpServiceClient.php index bb3285d36325..2e7b307d088b 100644 --- a/Dlp/src/V2/Client/DlpServiceClient.php +++ b/Dlp/src/V2/Client/DlpServiceClient.php @@ -36,6 +36,8 @@ use Google\Cloud\Dlp\V2\ActivateJobTriggerRequest; use Google\Cloud\Dlp\V2\CancelDlpJobRequest; use Google\Cloud\Dlp\V2\ColumnDataProfile; +use Google\Cloud\Dlp\V2\Connection; +use Google\Cloud\Dlp\V2\CreateConnectionRequest; use Google\Cloud\Dlp\V2\CreateDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\CreateDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\CreateDlpJobRequest; @@ -45,16 +47,19 @@ use Google\Cloud\Dlp\V2\DeidentifyContentRequest; use Google\Cloud\Dlp\V2\DeidentifyContentResponse; use Google\Cloud\Dlp\V2\DeidentifyTemplate; +use Google\Cloud\Dlp\V2\DeleteConnectionRequest; use Google\Cloud\Dlp\V2\DeleteDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\DeleteDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\DeleteDlpJobRequest; use Google\Cloud\Dlp\V2\DeleteInspectTemplateRequest; use Google\Cloud\Dlp\V2\DeleteJobTriggerRequest; use Google\Cloud\Dlp\V2\DeleteStoredInfoTypeRequest; +use Google\Cloud\Dlp\V2\DeleteTableDataProfileRequest; use Google\Cloud\Dlp\V2\DiscoveryConfig; use Google\Cloud\Dlp\V2\DlpJob; use Google\Cloud\Dlp\V2\FinishDlpJobRequest; use Google\Cloud\Dlp\V2\GetColumnDataProfileRequest; +use Google\Cloud\Dlp\V2\GetConnectionRequest; use Google\Cloud\Dlp\V2\GetDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\GetDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\GetDlpJobRequest; @@ -71,6 +76,7 @@ use Google\Cloud\Dlp\V2\InspectTemplate; use Google\Cloud\Dlp\V2\JobTrigger; use Google\Cloud\Dlp\V2\ListColumnDataProfilesRequest; +use Google\Cloud\Dlp\V2\ListConnectionsRequest; use Google\Cloud\Dlp\V2\ListDeidentifyTemplatesRequest; use Google\Cloud\Dlp\V2\ListDiscoveryConfigsRequest; use Google\Cloud\Dlp\V2\ListDlpJobsRequest; @@ -86,8 +92,10 @@ use Google\Cloud\Dlp\V2\RedactImageResponse; use Google\Cloud\Dlp\V2\ReidentifyContentRequest; use Google\Cloud\Dlp\V2\ReidentifyContentResponse; +use Google\Cloud\Dlp\V2\SearchConnectionsRequest; use Google\Cloud\Dlp\V2\StoredInfoType; use Google\Cloud\Dlp\V2\TableDataProfile; +use Google\Cloud\Dlp\V2\UpdateConnectionRequest; use Google\Cloud\Dlp\V2\UpdateDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\UpdateDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\UpdateInspectTemplateRequest; @@ -116,6 +124,7 @@ * * @method PromiseInterface activateJobTriggerAsync(ActivateJobTriggerRequest $request, array $optionalArgs = []) * @method PromiseInterface cancelDlpJobAsync(CancelDlpJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface createConnectionAsync(CreateConnectionRequest $request, array $optionalArgs = []) * @method PromiseInterface createDeidentifyTemplateAsync(CreateDeidentifyTemplateRequest $request, array $optionalArgs = []) * @method PromiseInterface createDiscoveryConfigAsync(CreateDiscoveryConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface createDlpJobAsync(CreateDlpJobRequest $request, array $optionalArgs = []) @@ -123,14 +132,17 @@ * @method PromiseInterface createJobTriggerAsync(CreateJobTriggerRequest $request, array $optionalArgs = []) * @method PromiseInterface createStoredInfoTypeAsync(CreateStoredInfoTypeRequest $request, array $optionalArgs = []) * @method PromiseInterface deidentifyContentAsync(DeidentifyContentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConnectionAsync(DeleteConnectionRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteDeidentifyTemplateAsync(DeleteDeidentifyTemplateRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteDiscoveryConfigAsync(DeleteDiscoveryConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteDlpJobAsync(DeleteDlpJobRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteInspectTemplateAsync(DeleteInspectTemplateRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteJobTriggerAsync(DeleteJobTriggerRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteStoredInfoTypeAsync(DeleteStoredInfoTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteTableDataProfileAsync(DeleteTableDataProfileRequest $request, array $optionalArgs = []) * @method PromiseInterface finishDlpJobAsync(FinishDlpJobRequest $request, array $optionalArgs = []) * @method PromiseInterface getColumnDataProfileAsync(GetColumnDataProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConnectionAsync(GetConnectionRequest $request, array $optionalArgs = []) * @method PromiseInterface getDeidentifyTemplateAsync(GetDeidentifyTemplateRequest $request, array $optionalArgs = []) * @method PromiseInterface getDiscoveryConfigAsync(GetDiscoveryConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface getDlpJobAsync(GetDlpJobRequest $request, array $optionalArgs = []) @@ -143,6 +155,7 @@ * @method PromiseInterface hybridInspectJobTriggerAsync(HybridInspectJobTriggerRequest $request, array $optionalArgs = []) * @method PromiseInterface inspectContentAsync(InspectContentRequest $request, array $optionalArgs = []) * @method PromiseInterface listColumnDataProfilesAsync(ListColumnDataProfilesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConnectionsAsync(ListConnectionsRequest $request, array $optionalArgs = []) * @method PromiseInterface listDeidentifyTemplatesAsync(ListDeidentifyTemplatesRequest $request, array $optionalArgs = []) * @method PromiseInterface listDiscoveryConfigsAsync(ListDiscoveryConfigsRequest $request, array $optionalArgs = []) * @method PromiseInterface listDlpJobsAsync(ListDlpJobsRequest $request, array $optionalArgs = []) @@ -154,6 +167,8 @@ * @method PromiseInterface listTableDataProfilesAsync(ListTableDataProfilesRequest $request, array $optionalArgs = []) * @method PromiseInterface redactImageAsync(RedactImageRequest $request, array $optionalArgs = []) * @method PromiseInterface reidentifyContentAsync(ReidentifyContentRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchConnectionsAsync(SearchConnectionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateConnectionAsync(UpdateConnectionRequest $request, array $optionalArgs = []) * @method PromiseInterface updateDeidentifyTemplateAsync(UpdateDeidentifyTemplateRequest $request, array $optionalArgs = []) * @method PromiseInterface updateDiscoveryConfigAsync(UpdateDiscoveryConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface updateInspectTemplateAsync(UpdateInspectTemplateRequest $request, array $optionalArgs = []) @@ -227,6 +242,25 @@ public static function columnDataProfileName(string $organization, string $locat ]); } + /** + * Formats a string containing the fully-qualified path to represent a connection + * resource. + * + * @param string $project + * @param string $location + * @param string $connection + * + * @return string The formatted connection resource. + */ + public static function connectionName(string $project, string $location, string $connection): string + { + return self::getPathTemplate('connection')->render([ + 'project' => $project, + 'location' => $location, + 'connection' => $connection, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * deidentify_template resource. @@ -840,6 +874,7 @@ public static function tableDataProfileName(string $organization, string $locati * The following name formats are supported: * Template: Pattern * - columnDataProfile: organizations/{organization}/locations/{location}/columnDataProfiles/{column_data_profile} + * - connection: projects/{project}/locations/{location}/connections/{connection} * - deidentifyTemplate: organizations/{organization}/deidentifyTemplates/{deidentify_template} * - discoveryConfig: projects/{project}/locations/{location}/discoveryConfigs/{discovery_config} * - dlpJob: projects/{project}/dlpJobs/{dlp_job} @@ -1022,6 +1057,32 @@ public function cancelDlpJob(CancelDlpJobRequest $request, array $callOptions = $this->startApiCall('CancelDlpJob', $request, $callOptions)->wait(); } + /** + * Create a Connection to an external data source. + * + * The async variant is {@see DlpServiceClient::createConnectionAsync()} . + * + * @example samples/V2/DlpServiceClient/create_connection.php + * + * @param CreateConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Connection + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConnection(CreateConnectionRequest $request, array $callOptions = []): Connection + { + return $this->startApiCall('CreateConnection', $request, $callOptions)->wait(); + } + /** * Creates a DeidentifyTemplate for reusing frequently used configuration * for de-identifying content, images, and storage. @@ -1236,6 +1297,30 @@ public function deidentifyContent(DeidentifyContentRequest $request, array $call return $this->startApiCall('DeidentifyContent', $request, $callOptions)->wait(); } + /** + * Delete a Connection. + * + * The async variant is {@see DlpServiceClient::deleteConnectionAsync()} . + * + * @example samples/V2/DlpServiceClient/delete_connection.php + * + * @param DeleteConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConnection(DeleteConnectionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteConnection', $request, $callOptions)->wait(); + } + /** * Deletes a DeidentifyTemplate. * See @@ -1399,6 +1484,31 @@ public function deleteStoredInfoType(DeleteStoredInfoTypeRequest $request, array $this->startApiCall('DeleteStoredInfoType', $request, $callOptions)->wait(); } + /** + * Delete a TableDataProfile. Will not prevent the profile from being + * regenerated if the table is still included in a discovery configuration. + * + * The async variant is {@see DlpServiceClient::deleteTableDataProfileAsync()} . + * + * @example samples/V2/DlpServiceClient/delete_table_data_profile.php + * + * @param DeleteTableDataProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTableDataProfile(DeleteTableDataProfileRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteTableDataProfile', $request, $callOptions)->wait(); + } + /** * Finish a running hybrid DlpJob. Triggers the finalization steps and running * of any enabled actions that have not yet run. @@ -1450,6 +1560,32 @@ public function getColumnDataProfile(GetColumnDataProfileRequest $request, array return $this->startApiCall('GetColumnDataProfile', $request, $callOptions)->wait(); } + /** + * Get a Connection by name. + * + * The async variant is {@see DlpServiceClient::getConnectionAsync()} . + * + * @example samples/V2/DlpServiceClient/get_connection.php + * + * @param GetConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Connection + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConnection(GetConnectionRequest $request, array $callOptions = []): Connection + { + return $this->startApiCall('GetConnection', $request, $callOptions)->wait(); + } + /** * Gets a DeidentifyTemplate. * See @@ -1768,7 +1904,7 @@ public function inspectContent(InspectContentRequest $request, array $callOption } /** - * Lists data profiles for an organization. + * Lists column data profiles for an organization. * * The async variant is {@see DlpServiceClient::listColumnDataProfilesAsync()} . * @@ -1793,6 +1929,32 @@ public function listColumnDataProfiles(ListColumnDataProfilesRequest $request, a return $this->startApiCall('ListColumnDataProfiles', $request, $callOptions); } + /** + * Lists Connections in a parent. + * + * The async variant is {@see DlpServiceClient::listConnectionsAsync()} . + * + * @example samples/V2/DlpServiceClient/list_connections.php + * + * @param ListConnectionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConnections(ListConnectionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConnections', $request, $callOptions); + } + /** * Lists DeidentifyTemplates. * See @@ -1967,7 +2129,7 @@ public function listJobTriggers(ListJobTriggersRequest $request, array $callOpti } /** - * Lists data profiles for an organization. + * Lists project data profiles for an organization. * * The async variant is {@see DlpServiceClient::listProjectDataProfilesAsync()} . * @@ -2022,7 +2184,7 @@ public function listStoredInfoTypes(ListStoredInfoTypesRequest $request, array $ } /** - * Lists data profiles for an organization. + * Lists table data profiles for an organization. * * The async variant is {@see DlpServiceClient::listTableDataProfilesAsync()} . * @@ -2110,6 +2272,58 @@ public function reidentifyContent(ReidentifyContentRequest $request, array $call return $this->startApiCall('ReidentifyContent', $request, $callOptions)->wait(); } + /** + * Searches for Connections in a parent. + * + * The async variant is {@see DlpServiceClient::searchConnectionsAsync()} . + * + * @example samples/V2/DlpServiceClient/search_connections.php + * + * @param SearchConnectionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchConnections(SearchConnectionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchConnections', $request, $callOptions); + } + + /** + * Update a Connection. + * + * The async variant is {@see DlpServiceClient::updateConnectionAsync()} . + * + * @example samples/V2/DlpServiceClient/update_connection.php + * + * @param UpdateConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Connection + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateConnection(UpdateConnectionRequest $request, array $callOptions = []): Connection + { + return $this->startApiCall('UpdateConnection', $request, $callOptions)->wait(); + } + /** * Updates the DeidentifyTemplate. * See diff --git a/Dlp/src/V2/CloudSqlDiscoveryTarget.php b/Dlp/src/V2/CloudSqlDiscoveryTarget.php new file mode 100644 index 000000000000..16069108161d --- /dev/null +++ b/Dlp/src/V2/CloudSqlDiscoveryTarget.php @@ -0,0 +1,210 @@ +google.privacy.dlp.v2.CloudSqlDiscoveryTarget + */ +class CloudSqlDiscoveryTarget extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The tables the discovery cadence applies to. The first target + * with a matching filter will be the one to apply to a table. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlFilter filter = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $filter = null; + /** + * In addition to matching the filter, these conditions must be true + * before a profile is generated. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlConditions conditions = 2; + */ + private $conditions = null; + protected $cadence; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dlp\V2\DiscoveryCloudSqlFilter $filter + * Required. The tables the discovery cadence applies to. The first target + * with a matching filter will be the one to apply to a table. + * @type \Google\Cloud\Dlp\V2\DiscoveryCloudSqlConditions $conditions + * In addition to matching the filter, these conditions must be true + * before a profile is generated. + * @type \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence $generation_cadence + * How often and when to update profiles. New tables that match both the + * filter and conditions are scanned as quickly as possible depending on + * system capacity. + * @type \Google\Cloud\Dlp\V2\Disabled $disabled + * Disable profiling for database resources that match this filter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. The tables the discovery cadence applies to. The first target + * with a matching filter will be the one to apply to a table. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlFilter filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dlp\V2\DiscoveryCloudSqlFilter|null + */ + public function getFilter() + { + return $this->filter; + } + + public function hasFilter() + { + return isset($this->filter); + } + + public function clearFilter() + { + unset($this->filter); + } + + /** + * Required. The tables the discovery cadence applies to. The first target + * with a matching filter will be the one to apply to a table. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlFilter filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dlp\V2\DiscoveryCloudSqlFilter $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlFilter::class); + $this->filter = $var; + + return $this; + } + + /** + * In addition to matching the filter, these conditions must be true + * before a profile is generated. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlConditions conditions = 2; + * @return \Google\Cloud\Dlp\V2\DiscoveryCloudSqlConditions|null + */ + public function getConditions() + { + return $this->conditions; + } + + public function hasConditions() + { + return isset($this->conditions); + } + + public function clearConditions() + { + unset($this->conditions); + } + + /** + * In addition to matching the filter, these conditions must be true + * before a profile is generated. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlConditions conditions = 2; + * @param \Google\Cloud\Dlp\V2\DiscoveryCloudSqlConditions $var + * @return $this + */ + public function setConditions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlConditions::class); + $this->conditions = $var; + + return $this; + } + + /** + * How often and when to update profiles. New tables that match both the + * filter and conditions are scanned as quickly as possible depending on + * system capacity. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence generation_cadence = 3; + * @return \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence|null + */ + public function getGenerationCadence() + { + return $this->readOneof(3); + } + + public function hasGenerationCadence() + { + return $this->hasOneof(3); + } + + /** + * How often and when to update profiles. New tables that match both the + * filter and conditions are scanned as quickly as possible depending on + * system capacity. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence generation_cadence = 3; + * @param \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence $var + * @return $this + */ + public function setGenerationCadence($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Disable profiling for database resources that match this filter. + * + * Generated from protobuf field .google.privacy.dlp.v2.Disabled disabled = 4; + * @return \Google\Cloud\Dlp\V2\Disabled|null + */ + public function getDisabled() + { + return $this->readOneof(4); + } + + public function hasDisabled() + { + return $this->hasOneof(4); + } + + /** + * Disable profiling for database resources that match this filter. + * + * Generated from protobuf field .google.privacy.dlp.v2.Disabled disabled = 4; + * @param \Google\Cloud\Dlp\V2\Disabled $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Disabled::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getCadence() + { + return $this->whichOneof("cadence"); + } + +} + diff --git a/Dlp/src/V2/CloudSqlIamCredential.php b/Dlp/src/V2/CloudSqlIamCredential.php new file mode 100644 index 000000000000..bd753580e0b9 --- /dev/null +++ b/Dlp/src/V2/CloudSqlIamCredential.php @@ -0,0 +1,36 @@ +google.privacy.dlp.v2.CloudSqlIamCredential + */ +class CloudSqlIamCredential extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Dlp/src/V2/CloudSqlProperties.php b/Dlp/src/V2/CloudSqlProperties.php new file mode 100644 index 000000000000..0e00cbbe9948 --- /dev/null +++ b/Dlp/src/V2/CloudSqlProperties.php @@ -0,0 +1,250 @@ +google.privacy.dlp.v2.CloudSqlProperties + */ +class CloudSqlProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Immutable. The Cloud SQL instance for which the connection is + * defined. Only one connection per instance is allowed. This can only be set + * at creation time, and cannot be updated. + * It is an error to use a connection_name from different project or region + * than the one that holds the connection. + * For example, a Connection resource for Cloud SQL connection_name + * `project-id:us-central1:sql-instance` + * must be created under the parent + * `projects/project-id/locations/us-central1` + * + * Generated from protobuf field string connection_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + private $connection_name = ''; + /** + * Required. DLP will limit its connections to max_connections. + * Must be 2 or greater. + * + * Generated from protobuf field int32 max_connections = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $max_connections = 0; + /** + * Required. The database engine used by the Cloud SQL instance that this + * connection configures. + * + * Generated from protobuf field .google.privacy.dlp.v2.CloudSqlProperties.DatabaseEngine database_engine = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + private $database_engine = 0; + protected $credential; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connection_name + * Optional. Immutable. The Cloud SQL instance for which the connection is + * defined. Only one connection per instance is allowed. This can only be set + * at creation time, and cannot be updated. + * It is an error to use a connection_name from different project or region + * than the one that holds the connection. + * For example, a Connection resource for Cloud SQL connection_name + * `project-id:us-central1:sql-instance` + * must be created under the parent + * `projects/project-id/locations/us-central1` + * @type \Google\Cloud\Dlp\V2\SecretManagerCredential $username_password + * A username and password stored in Secret Manager. + * @type \Google\Cloud\Dlp\V2\CloudSqlIamCredential $cloud_sql_iam + * Built-in IAM authentication (must be configured in Cloud SQL). + * @type int $max_connections + * Required. DLP will limit its connections to max_connections. + * Must be 2 or greater. + * @type int $database_engine + * Required. The database engine used by the Cloud SQL instance that this + * connection configures. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Immutable. The Cloud SQL instance for which the connection is + * defined. Only one connection per instance is allowed. This can only be set + * at creation time, and cannot be updated. + * It is an error to use a connection_name from different project or region + * than the one that holds the connection. + * For example, a Connection resource for Cloud SQL connection_name + * `project-id:us-central1:sql-instance` + * must be created under the parent + * `projects/project-id/locations/us-central1` + * + * Generated from protobuf field string connection_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getConnectionName() + { + return $this->connection_name; + } + + /** + * Optional. Immutable. The Cloud SQL instance for which the connection is + * defined. Only one connection per instance is allowed. This can only be set + * at creation time, and cannot be updated. + * It is an error to use a connection_name from different project or region + * than the one that holds the connection. + * For example, a Connection resource for Cloud SQL connection_name + * `project-id:us-central1:sql-instance` + * must be created under the parent + * `projects/project-id/locations/us-central1` + * + * Generated from protobuf field string connection_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setConnectionName($var) + { + GPBUtil::checkString($var, True); + $this->connection_name = $var; + + return $this; + } + + /** + * A username and password stored in Secret Manager. + * + * Generated from protobuf field .google.privacy.dlp.v2.SecretManagerCredential username_password = 2; + * @return \Google\Cloud\Dlp\V2\SecretManagerCredential|null + */ + public function getUsernamePassword() + { + return $this->readOneof(2); + } + + public function hasUsernamePassword() + { + return $this->hasOneof(2); + } + + /** + * A username and password stored in Secret Manager. + * + * Generated from protobuf field .google.privacy.dlp.v2.SecretManagerCredential username_password = 2; + * @param \Google\Cloud\Dlp\V2\SecretManagerCredential $var + * @return $this + */ + public function setUsernamePassword($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\SecretManagerCredential::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Built-in IAM authentication (must be configured in Cloud SQL). + * + * Generated from protobuf field .google.privacy.dlp.v2.CloudSqlIamCredential cloud_sql_iam = 3; + * @return \Google\Cloud\Dlp\V2\CloudSqlIamCredential|null + */ + public function getCloudSqlIam() + { + return $this->readOneof(3); + } + + public function hasCloudSqlIam() + { + return $this->hasOneof(3); + } + + /** + * Built-in IAM authentication (must be configured in Cloud SQL). + * + * Generated from protobuf field .google.privacy.dlp.v2.CloudSqlIamCredential cloud_sql_iam = 3; + * @param \Google\Cloud\Dlp\V2\CloudSqlIamCredential $var + * @return $this + */ + public function setCloudSqlIam($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudSqlIamCredential::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. DLP will limit its connections to max_connections. + * Must be 2 or greater. + * + * Generated from protobuf field int32 max_connections = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMaxConnections() + { + return $this->max_connections; + } + + /** + * Required. DLP will limit its connections to max_connections. + * Must be 2 or greater. + * + * Generated from protobuf field int32 max_connections = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMaxConnections($var) + { + GPBUtil::checkInt32($var); + $this->max_connections = $var; + + return $this; + } + + /** + * Required. The database engine used by the Cloud SQL instance that this + * connection configures. + * + * Generated from protobuf field .google.privacy.dlp.v2.CloudSqlProperties.DatabaseEngine database_engine = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDatabaseEngine() + { + return $this->database_engine; + } + + /** + * Required. The database engine used by the Cloud SQL instance that this + * connection configures. + * + * Generated from protobuf field .google.privacy.dlp.v2.CloudSqlProperties.DatabaseEngine database_engine = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDatabaseEngine($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\CloudSqlProperties\DatabaseEngine::class); + $this->database_engine = $var; + + return $this; + } + + /** + * @return string + */ + public function getCredential() + { + return $this->whichOneof("credential"); + } + +} + diff --git a/Dlp/src/V2/CloudSqlProperties/DatabaseEngine.php b/Dlp/src/V2/CloudSqlProperties/DatabaseEngine.php new file mode 100644 index 000000000000..c21e1f3d23c8 --- /dev/null +++ b/Dlp/src/V2/CloudSqlProperties/DatabaseEngine.php @@ -0,0 +1,65 @@ +google.privacy.dlp.v2.CloudSqlProperties.DatabaseEngine + */ +class DatabaseEngine +{ + /** + * An engine that is not currently supported by Sensitive Data Protection. + * + * Generated from protobuf enum DATABASE_ENGINE_UNKNOWN = 0; + */ + const DATABASE_ENGINE_UNKNOWN = 0; + /** + * Cloud SQL for MySQL instance. + * + * Generated from protobuf enum DATABASE_ENGINE_MYSQL = 1; + */ + const DATABASE_ENGINE_MYSQL = 1; + /** + * Cloud SQL for PostgreSQL instance. + * + * Generated from protobuf enum DATABASE_ENGINE_POSTGRES = 2; + */ + const DATABASE_ENGINE_POSTGRES = 2; + + private static $valueToName = [ + self::DATABASE_ENGINE_UNKNOWN => 'DATABASE_ENGINE_UNKNOWN', + self::DATABASE_ENGINE_MYSQL => 'DATABASE_ENGINE_MYSQL', + self::DATABASE_ENGINE_POSTGRES => 'DATABASE_ENGINE_POSTGRES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatabaseEngine::class, \Google\Cloud\Dlp\V2\CloudSqlProperties_DatabaseEngine::class); + diff --git a/Dlp/src/V2/ColumnDataProfile/ColumnDataType.php b/Dlp/src/V2/ColumnDataProfile/ColumnDataType.php index 2688d3a1aa3a..83faea00b595 100644 --- a/Dlp/src/V2/ColumnDataProfile/ColumnDataType.php +++ b/Dlp/src/V2/ColumnDataProfile/ColumnDataType.php @@ -104,6 +104,30 @@ class ColumnDataType * Generated from protobuf enum TYPE_JSON = 14; */ const TYPE_JSON = 14; + /** + * Interval type. + * + * Generated from protobuf enum TYPE_INTERVAL = 15; + */ + const TYPE_INTERVAL = 15; + /** + * `Range` type. + * + * Generated from protobuf enum TYPE_RANGE_DATE = 16; + */ + const TYPE_RANGE_DATE = 16; + /** + * `Range` type. + * + * Generated from protobuf enum TYPE_RANGE_DATETIME = 17; + */ + const TYPE_RANGE_DATETIME = 17; + /** + * `Range` type. + * + * Generated from protobuf enum TYPE_RANGE_TIMESTAMP = 18; + */ + const TYPE_RANGE_TIMESTAMP = 18; private static $valueToName = [ self::COLUMN_DATA_TYPE_UNSPECIFIED => 'COLUMN_DATA_TYPE_UNSPECIFIED', @@ -121,6 +145,10 @@ class ColumnDataType self::TYPE_RECORD => 'TYPE_RECORD', self::TYPE_BIGNUMERIC => 'TYPE_BIGNUMERIC', self::TYPE_JSON => 'TYPE_JSON', + self::TYPE_INTERVAL => 'TYPE_INTERVAL', + self::TYPE_RANGE_DATE => 'TYPE_RANGE_DATE', + self::TYPE_RANGE_DATETIME => 'TYPE_RANGE_DATETIME', + self::TYPE_RANGE_TIMESTAMP => 'TYPE_RANGE_TIMESTAMP', ]; public static function name($value) diff --git a/Dlp/src/V2/Connection.php b/Dlp/src/V2/Connection.php new file mode 100644 index 000000000000..43fb43a43d20 --- /dev/null +++ b/Dlp/src/V2/Connection.php @@ -0,0 +1,186 @@ +google.privacy.dlp.v2.Connection + */ +class Connection extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the connection: + * `projects/{project}/locations/{location}/connections/{name}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $name = ''; + /** + * Required. The connection's state in its lifecycle. + * + * Generated from protobuf field .google.privacy.dlp.v2.ConnectionState state = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $state = 0; + /** + * Output only. Set if status == ERROR, to provide additional details. Will + * store the last 10 errors sorted with the most recent first. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.Error errors = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $errors; + protected $properties; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Name of the connection: + * `projects/{project}/locations/{location}/connections/{name}`. + * @type int $state + * Required. The connection's state in its lifecycle. + * @type array<\Google\Cloud\Dlp\V2\Error>|\Google\Protobuf\Internal\RepeatedField $errors + * Output only. Set if status == ERROR, to provide additional details. Will + * store the last 10 errors sorted with the most recent first. + * @type \Google\Cloud\Dlp\V2\CloudSqlProperties $cloud_sql + * Connect to a Cloud SQL instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the connection: + * `projects/{project}/locations/{location}/connections/{name}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Name of the connection: + * `projects/{project}/locations/{location}/connections/{name}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The connection's state in its lifecycle. + * + * Generated from protobuf field .google.privacy.dlp.v2.ConnectionState state = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Required. The connection's state in its lifecycle. + * + * Generated from protobuf field .google.privacy.dlp.v2.ConnectionState state = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\ConnectionState::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Set if status == ERROR, to provide additional details. Will + * store the last 10 errors sorted with the most recent first. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.Error errors = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Output only. Set if status == ERROR, to provide additional details. Will + * store the last 10 errors sorted with the most recent first. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.Error errors = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Dlp\V2\Error>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\Error::class); + $this->errors = $arr; + + return $this; + } + + /** + * Connect to a Cloud SQL instance. + * + * Generated from protobuf field .google.privacy.dlp.v2.CloudSqlProperties cloud_sql = 4; + * @return \Google\Cloud\Dlp\V2\CloudSqlProperties|null + */ + public function getCloudSql() + { + return $this->readOneof(4); + } + + public function hasCloudSql() + { + return $this->hasOneof(4); + } + + /** + * Connect to a Cloud SQL instance. + * + * Generated from protobuf field .google.privacy.dlp.v2.CloudSqlProperties cloud_sql = 4; + * @param \Google\Cloud\Dlp\V2\CloudSqlProperties $var + * @return $this + */ + public function setCloudSql($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudSqlProperties::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getProperties() + { + return $this->whichOneof("properties"); + } + +} + diff --git a/Dlp/src/V2/ConnectionState.php b/Dlp/src/V2/ConnectionState.php new file mode 100644 index 000000000000..84cec3815510 --- /dev/null +++ b/Dlp/src/V2/ConnectionState.php @@ -0,0 +1,75 @@ +google.privacy.dlp.v2.ConnectionState + */ +class ConnectionState +{ + /** + * Unused + * + * Generated from protobuf enum CONNECTION_STATE_UNSPECIFIED = 0; + */ + const CONNECTION_STATE_UNSPECIFIED = 0; + /** + * DLP automatically created this connection during an initial scan, and it is + * awaiting full configuration by a user. + * + * Generated from protobuf enum MISSING_CREDENTIALS = 1; + */ + const MISSING_CREDENTIALS = 1; + /** + * A configured connection that has not encountered any errors. + * + * Generated from protobuf enum AVAILABLE = 2; + */ + const AVAILABLE = 2; + /** + * A configured connection that encountered errors during its last use. It + * will not be used again until it is set to AVAILABLE. + * If the resolution requires external action, then the client must send a + * request to set the status to AVAILABLE when the connection is ready for + * use. If the resolution doesn't require external action, then any changes to + * the connection properties will automatically mark it as AVAILABLE. + * + * Generated from protobuf enum ERROR = 3; + */ + const ERROR = 3; + + private static $valueToName = [ + self::CONNECTION_STATE_UNSPECIFIED => 'CONNECTION_STATE_UNSPECIFIED', + self::MISSING_CREDENTIALS => 'MISSING_CREDENTIALS', + self::AVAILABLE => 'AVAILABLE', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/Dlp/src/V2/CreateConnectionRequest.php b/Dlp/src/V2/CreateConnectionRequest.php new file mode 100644 index 000000000000..81398dd6d830 --- /dev/null +++ b/Dlp/src/V2/CreateConnectionRequest.php @@ -0,0 +1,132 @@ +google.privacy.dlp.v2.CreateConnectionRequest + */ +class CreateConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent resource name in the format: + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. The connection resource. + * + * Generated from protobuf field .google.privacy.dlp.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $connection = null; + + /** + * @param string $parent Required. Parent resource name in the format: + * `projects/{project}/locations/{location}`. Please see + * {@see DlpServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Dlp\V2\Connection $connection Required. The connection resource. + * + * @return \Google\Cloud\Dlp\V2\CreateConnectionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dlp\V2\Connection $connection): self + { + return (new self()) + ->setParent($parent) + ->setConnection($connection); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent resource name in the format: + * `projects/{project}/locations/{location}`. + * @type \Google\Cloud\Dlp\V2\Connection $connection + * Required. The connection resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent resource name in the format: + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent resource name in the format: + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The connection resource. + * + * Generated from protobuf field .google.privacy.dlp.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dlp\V2\Connection|null + */ + public function getConnection() + { + return $this->connection; + } + + public function hasConnection() + { + return isset($this->connection); + } + + public function clearConnection() + { + unset($this->connection); + } + + /** + * Required. The connection resource. + * + * Generated from protobuf field .google.privacy.dlp.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dlp\V2\Connection $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Connection::class); + $this->connection = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/DataProfileAction/EventType.php b/Dlp/src/V2/DataProfileAction/EventType.php index 1babed97ae5d..0c49c9ad18c9 100644 --- a/Dlp/src/V2/DataProfileAction/EventType.php +++ b/Dlp/src/V2/DataProfileAction/EventType.php @@ -26,13 +26,9 @@ class EventType */ const NEW_PROFILE = 1; /** - * Changed one of the following profile metrics: - * * Table data risk score - * * Table sensitivity score - * * Table resource visibility - * * Table encryption type - * * Table predicted infoTypes - * * Table other infoTypes + * One of the following profile metrics changed: Data risk score, + * Sensitivity score, Resource visibility, Encryption type, Predicted + * infoTypes, Other infoTypes * * Generated from protobuf enum CHANGED_PROFILE = 2; */ diff --git a/Dlp/src/V2/DataProfileAction/Export.php b/Dlp/src/V2/DataProfileAction/Export.php index 6a682f018cef..685e22531e42 100644 --- a/Dlp/src/V2/DataProfileAction/Export.php +++ b/Dlp/src/V2/DataProfileAction/Export.php @@ -18,8 +18,14 @@ class Export extends \Google\Protobuf\Internal\Message { /** * Store all table and column profiles in an existing table or a new table - * in an existing dataset. Each re-generation will result in a new row in - * BigQuery. + * in an existing dataset. Each re-generation will result in new rows in + * BigQuery. Data is inserted using [streaming + * insert](https://cloud.google.com/blog/products/bigquery/life-of-a-bigquery-streaming-insert) + * and so data may be in the buffer for a period of time after the profile + * has finished. The Pub/Sub notification is sent before the streaming + * buffer is guaranteed to be written, so data may not be instantly + * visible to queries by the time your topic receives the Pub/Sub + * notification. * * Generated from protobuf field .google.privacy.dlp.v2.BigQueryTable profile_table = 1; */ @@ -33,8 +39,14 @@ class Export extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\Dlp\V2\BigQueryTable $profile_table * Store all table and column profiles in an existing table or a new table - * in an existing dataset. Each re-generation will result in a new row in - * BigQuery. + * in an existing dataset. Each re-generation will result in new rows in + * BigQuery. Data is inserted using [streaming + * insert](https://cloud.google.com/blog/products/bigquery/life-of-a-bigquery-streaming-insert) + * and so data may be in the buffer for a period of time after the profile + * has finished. The Pub/Sub notification is sent before the streaming + * buffer is guaranteed to be written, so data may not be instantly + * visible to queries by the time your topic receives the Pub/Sub + * notification. * } */ public function __construct($data = NULL) { @@ -44,8 +56,14 @@ public function __construct($data = NULL) { /** * Store all table and column profiles in an existing table or a new table - * in an existing dataset. Each re-generation will result in a new row in - * BigQuery. + * in an existing dataset. Each re-generation will result in new rows in + * BigQuery. Data is inserted using [streaming + * insert](https://cloud.google.com/blog/products/bigquery/life-of-a-bigquery-streaming-insert) + * and so data may be in the buffer for a period of time after the profile + * has finished. The Pub/Sub notification is sent before the streaming + * buffer is guaranteed to be written, so data may not be instantly + * visible to queries by the time your topic receives the Pub/Sub + * notification. * * Generated from protobuf field .google.privacy.dlp.v2.BigQueryTable profile_table = 1; * @return \Google\Cloud\Dlp\V2\BigQueryTable|null @@ -67,8 +85,14 @@ public function clearProfileTable() /** * Store all table and column profiles in an existing table or a new table - * in an existing dataset. Each re-generation will result in a new row in - * BigQuery. + * in an existing dataset. Each re-generation will result in new rows in + * BigQuery. Data is inserted using [streaming + * insert](https://cloud.google.com/blog/products/bigquery/life-of-a-bigquery-streaming-insert) + * and so data may be in the buffer for a period of time after the profile + * has finished. The Pub/Sub notification is sent before the streaming + * buffer is guaranteed to be written, so data may not be instantly + * visible to queries by the time your topic receives the Pub/Sub + * notification. * * Generated from protobuf field .google.privacy.dlp.v2.BigQueryTable profile_table = 1; * @param \Google\Cloud\Dlp\V2\BigQueryTable $var diff --git a/Dlp/src/V2/DataProfileAction/PubSubNotification/DetailLevel.php b/Dlp/src/V2/DataProfileAction/PubSubNotification/DetailLevel.php index c5bfd5a9b631..3367ba04d4e6 100644 --- a/Dlp/src/V2/DataProfileAction/PubSubNotification/DetailLevel.php +++ b/Dlp/src/V2/DataProfileAction/PubSubNotification/DetailLevel.php @@ -26,7 +26,7 @@ class DetailLevel */ const TABLE_PROFILE = 1; /** - * The resource name of the table. + * The name of the profiled resource. * * Generated from protobuf enum RESOURCE_NAME = 2; */ diff --git a/Dlp/src/V2/DatabaseResourceCollection.php b/Dlp/src/V2/DatabaseResourceCollection.php new file mode 100644 index 000000000000..61a1ce7130dd --- /dev/null +++ b/Dlp/src/V2/DatabaseResourceCollection.php @@ -0,0 +1,76 @@ +google.privacy.dlp.v2.DatabaseResourceCollection + */ +class DatabaseResourceCollection extends \Google\Protobuf\Internal\Message +{ + protected $pattern; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dlp\V2\DatabaseResourceRegexes $include_regexes + * A collection of regular expressions to match a database resource against. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * A collection of regular expressions to match a database resource against. + * + * Generated from protobuf field .google.privacy.dlp.v2.DatabaseResourceRegexes include_regexes = 1; + * @return \Google\Cloud\Dlp\V2\DatabaseResourceRegexes|null + */ + public function getIncludeRegexes() + { + return $this->readOneof(1); + } + + public function hasIncludeRegexes() + { + return $this->hasOneof(1); + } + + /** + * A collection of regular expressions to match a database resource against. + * + * Generated from protobuf field .google.privacy.dlp.v2.DatabaseResourceRegexes include_regexes = 1; + * @param \Google\Cloud\Dlp\V2\DatabaseResourceRegexes $var + * @return $this + */ + public function setIncludeRegexes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DatabaseResourceRegexes::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getPattern() + { + return $this->whichOneof("pattern"); + } + +} + diff --git a/Dlp/src/V2/DatabaseResourceReference.php b/Dlp/src/V2/DatabaseResourceReference.php new file mode 100644 index 000000000000..6c7574dd66a1 --- /dev/null +++ b/Dlp/src/V2/DatabaseResourceReference.php @@ -0,0 +1,181 @@ +google.privacy.dlp.v2.DatabaseResourceReference + */ +class DatabaseResourceReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. If within a project-level config, then this must match the + * config's project ID. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $project_id = ''; + /** + * Required. The instance where this resource is located. For example: Cloud + * SQL instance ID. + * + * Generated from protobuf field string instance = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instance = ''; + /** + * Required. Name of a database within the instance. + * + * Generated from protobuf field string database = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $database = ''; + /** + * Required. Name of a database resource, for example, a table within the + * database. + * + * Generated from protobuf field string database_resource = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $database_resource = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. If within a project-level config, then this must match the + * config's project ID. + * @type string $instance + * Required. The instance where this resource is located. For example: Cloud + * SQL instance ID. + * @type string $database + * Required. Name of a database within the instance. + * @type string $database_resource + * Required. Name of a database resource, for example, a table within the + * database. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. If within a project-level config, then this must match the + * config's project ID. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. If within a project-level config, then this must match the + * config's project ID. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Required. The instance where this resource is located. For example: Cloud + * SQL instance ID. + * + * Generated from protobuf field string instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Required. The instance where this resource is located. For example: Cloud + * SQL instance ID. + * + * Generated from protobuf field string instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Required. Name of a database within the instance. + * + * Generated from protobuf field string database = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Required. Name of a database within the instance. + * + * Generated from protobuf field string database = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * Required. Name of a database resource, for example, a table within the + * database. + * + * Generated from protobuf field string database_resource = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabaseResource() + { + return $this->database_resource; + } + + /** + * Required. Name of a database resource, for example, a table within the + * database. + * + * Generated from protobuf field string database_resource = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabaseResource($var) + { + GPBUtil::checkString($var, True); + $this->database_resource = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/DatabaseResourceRegex.php b/Dlp/src/V2/DatabaseResourceRegex.php new file mode 100644 index 000000000000..6425a372eda7 --- /dev/null +++ b/Dlp/src/V2/DatabaseResourceRegex.php @@ -0,0 +1,188 @@ +google.privacy.dlp.v2.DatabaseResourceRegex + */ +class DatabaseResourceRegex extends \Google\Protobuf\Internal\Message +{ + /** + * For organizations, if unset, will match all projects. Has no effect + * for configurations created within a project. + * + * Generated from protobuf field string project_id_regex = 1; + */ + private $project_id_regex = ''; + /** + * Regex to test the instance name against. If empty, all instances match. + * + * Generated from protobuf field string instance_regex = 2; + */ + private $instance_regex = ''; + /** + * Regex to test the database name against. If empty, all databases match. + * + * Generated from protobuf field string database_regex = 3; + */ + private $database_regex = ''; + /** + * Regex to test the database resource's name against. An example of a + * database resource name is a table's name. Other database resource names + * like view names could be included in the future. If empty, all database + * resources match. + * + * Generated from protobuf field string database_resource_name_regex = 4; + */ + private $database_resource_name_regex = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id_regex + * For organizations, if unset, will match all projects. Has no effect + * for configurations created within a project. + * @type string $instance_regex + * Regex to test the instance name against. If empty, all instances match. + * @type string $database_regex + * Regex to test the database name against. If empty, all databases match. + * @type string $database_resource_name_regex + * Regex to test the database resource's name against. An example of a + * database resource name is a table's name. Other database resource names + * like view names could be included in the future. If empty, all database + * resources match. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * For organizations, if unset, will match all projects. Has no effect + * for configurations created within a project. + * + * Generated from protobuf field string project_id_regex = 1; + * @return string + */ + public function getProjectIdRegex() + { + return $this->project_id_regex; + } + + /** + * For organizations, if unset, will match all projects. Has no effect + * for configurations created within a project. + * + * Generated from protobuf field string project_id_regex = 1; + * @param string $var + * @return $this + */ + public function setProjectIdRegex($var) + { + GPBUtil::checkString($var, True); + $this->project_id_regex = $var; + + return $this; + } + + /** + * Regex to test the instance name against. If empty, all instances match. + * + * Generated from protobuf field string instance_regex = 2; + * @return string + */ + public function getInstanceRegex() + { + return $this->instance_regex; + } + + /** + * Regex to test the instance name against. If empty, all instances match. + * + * Generated from protobuf field string instance_regex = 2; + * @param string $var + * @return $this + */ + public function setInstanceRegex($var) + { + GPBUtil::checkString($var, True); + $this->instance_regex = $var; + + return $this; + } + + /** + * Regex to test the database name against. If empty, all databases match. + * + * Generated from protobuf field string database_regex = 3; + * @return string + */ + public function getDatabaseRegex() + { + return $this->database_regex; + } + + /** + * Regex to test the database name against. If empty, all databases match. + * + * Generated from protobuf field string database_regex = 3; + * @param string $var + * @return $this + */ + public function setDatabaseRegex($var) + { + GPBUtil::checkString($var, True); + $this->database_regex = $var; + + return $this; + } + + /** + * Regex to test the database resource's name against. An example of a + * database resource name is a table's name. Other database resource names + * like view names could be included in the future. If empty, all database + * resources match. + * + * Generated from protobuf field string database_resource_name_regex = 4; + * @return string + */ + public function getDatabaseResourceNameRegex() + { + return $this->database_resource_name_regex; + } + + /** + * Regex to test the database resource's name against. An example of a + * database resource name is a table's name. Other database resource names + * like view names could be included in the future. If empty, all database + * resources match. + * + * Generated from protobuf field string database_resource_name_regex = 4; + * @param string $var + * @return $this + */ + public function setDatabaseResourceNameRegex($var) + { + GPBUtil::checkString($var, True); + $this->database_resource_name_regex = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/DatabaseResourceRegexes.php b/Dlp/src/V2/DatabaseResourceRegexes.php new file mode 100644 index 000000000000..c9a5d6122541 --- /dev/null +++ b/Dlp/src/V2/DatabaseResourceRegexes.php @@ -0,0 +1,80 @@ +google.privacy.dlp.v2.DatabaseResourceRegexes + */ +class DatabaseResourceRegexes extends \Google\Protobuf\Internal\Message +{ + /** + * A group of regular expression patterns to match against one or more + * database resources. + * Maximum of 100 entries. The sum of all regular expression's length can't + * exceed 10 KiB. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DatabaseResourceRegex patterns = 1; + */ + private $patterns; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dlp\V2\DatabaseResourceRegex>|\Google\Protobuf\Internal\RepeatedField $patterns + * A group of regular expression patterns to match against one or more + * database resources. + * Maximum of 100 entries. The sum of all regular expression's length can't + * exceed 10 KiB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * A group of regular expression patterns to match against one or more + * database resources. + * Maximum of 100 entries. The sum of all regular expression's length can't + * exceed 10 KiB. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DatabaseResourceRegex patterns = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPatterns() + { + return $this->patterns; + } + + /** + * A group of regular expression patterns to match against one or more + * database resources. + * Maximum of 100 entries. The sum of all regular expression's length can't + * exceed 10 KiB. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DatabaseResourceRegex patterns = 1; + * @param array<\Google\Cloud\Dlp\V2\DatabaseResourceRegex>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPatterns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\DatabaseResourceRegex::class); + $this->patterns = $arr; + + return $this; + } + +} + diff --git a/Dlp/src/V2/DeleteConnectionRequest.php b/Dlp/src/V2/DeleteConnectionRequest.php new file mode 100644 index 000000000000..eb78e2f95805 --- /dev/null +++ b/Dlp/src/V2/DeleteConnectionRequest.php @@ -0,0 +1,86 @@ +google.privacy.dlp.v2.DeleteConnectionRequest + */ +class DeleteConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the Connection to be deleted, in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. Resource name of the Connection to be deleted, in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. Please see + * {@see DlpServiceClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\Dlp\V2\DeleteConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the Connection to be deleted, in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the Connection to be deleted, in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the Connection to be deleted, in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/DeleteTableDataProfileRequest.php b/Dlp/src/V2/DeleteTableDataProfileRequest.php new file mode 100644 index 000000000000..f49b35b95b61 --- /dev/null +++ b/Dlp/src/V2/DeleteTableDataProfileRequest.php @@ -0,0 +1,81 @@ +google.privacy.dlp.v2.DeleteTableDataProfileRequest + */ +class DeleteTableDataProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the table data profile. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. Resource name of the table data profile. Please see + * {@see DlpServiceClient::tableDataProfileName()} for help formatting this field. + * + * @return \Google\Cloud\Dlp\V2\DeleteTableDataProfileRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the table data profile. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the table data profile. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the table data profile. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/DiscoveryBigQueryFilter.php b/Dlp/src/V2/DiscoveryBigQueryFilter.php index 72be4db89f46..a87ee0ec1d3b 100644 --- a/Dlp/src/V2/DiscoveryBigQueryFilter.php +++ b/Dlp/src/V2/DiscoveryBigQueryFilter.php @@ -35,6 +35,10 @@ class DiscoveryBigQueryFilter extends \Google\Protobuf\Internal\Message * anything above it will apply first. Should only appear once in a * configuration. If none is specified, a default one will be added * automatically. + * @type \Google\Cloud\Dlp\V2\TableReference $table_reference + * The table to scan. Discovery configurations including this can only + * include one DiscoveryTarget (the DiscoveryTarget with this + * TableReference). * } */ public function __construct($data = NULL) { @@ -116,6 +120,41 @@ public function setOtherTables($var) return $this; } + /** + * The table to scan. Discovery configurations including this can only + * include one DiscoveryTarget (the DiscoveryTarget with this + * TableReference). + * + * Generated from protobuf field .google.privacy.dlp.v2.TableReference table_reference = 3; + * @return \Google\Cloud\Dlp\V2\TableReference|null + */ + public function getTableReference() + { + return $this->readOneof(3); + } + + public function hasTableReference() + { + return $this->hasOneof(3); + } + + /** + * The table to scan. Discovery configurations including this can only + * include one DiscoveryTarget (the DiscoveryTarget with this + * TableReference). + * + * Generated from protobuf field .google.privacy.dlp.v2.TableReference table_reference = 3; + * @param \Google\Cloud\Dlp\V2\TableReference $var + * @return $this + */ + public function setTableReference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\TableReference::class); + $this->writeOneof(3, $var); + + return $this; + } + /** * @return string */ diff --git a/Dlp/src/V2/DiscoveryCloudSqlConditions.php b/Dlp/src/V2/DiscoveryCloudSqlConditions.php new file mode 100644 index 000000000000..0697e79227ac --- /dev/null +++ b/Dlp/src/V2/DiscoveryCloudSqlConditions.php @@ -0,0 +1,114 @@ +google.privacy.dlp.v2.DiscoveryCloudSqlConditions + */ +class DiscoveryCloudSqlConditions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Database engines that should be profiled. + * Optional. Defaults to ALL_SUPPORTED_DATABASE_ENGINES if unspecified. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DiscoveryCloudSqlConditions.DatabaseEngine database_engines = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $database_engines; + /** + * Data profiles will only be generated for the database resource types + * specified in this field. + * If not specified, defaults to [DATABASE_RESOURCE_TYPE_ALL_SUPPORTED_TYPES]. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DiscoveryCloudSqlConditions.DatabaseResourceType types = 3; + */ + private $types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $database_engines + * Optional. Database engines that should be profiled. + * Optional. Defaults to ALL_SUPPORTED_DATABASE_ENGINES if unspecified. + * @type array|\Google\Protobuf\Internal\RepeatedField $types + * Data profiles will only be generated for the database resource types + * specified in this field. + * If not specified, defaults to [DATABASE_RESOURCE_TYPE_ALL_SUPPORTED_TYPES]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Database engines that should be profiled. + * Optional. Defaults to ALL_SUPPORTED_DATABASE_ENGINES if unspecified. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DiscoveryCloudSqlConditions.DatabaseEngine database_engines = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatabaseEngines() + { + return $this->database_engines; + } + + /** + * Optional. Database engines that should be profiled. + * Optional. Defaults to ALL_SUPPORTED_DATABASE_ENGINES if unspecified. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DiscoveryCloudSqlConditions.DatabaseEngine database_engines = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatabaseEngines($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlConditions\DatabaseEngine::class); + $this->database_engines = $arr; + + return $this; + } + + /** + * Data profiles will only be generated for the database resource types + * specified in this field. + * If not specified, defaults to [DATABASE_RESOURCE_TYPE_ALL_SUPPORTED_TYPES]. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DiscoveryCloudSqlConditions.DatabaseResourceType types = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTypes() + { + return $this->types; + } + + /** + * Data profiles will only be generated for the database resource types + * specified in this field. + * If not specified, defaults to [DATABASE_RESOURCE_TYPE_ALL_SUPPORTED_TYPES]. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DiscoveryCloudSqlConditions.DatabaseResourceType types = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlConditions\DatabaseResourceType::class); + $this->types = $arr; + + return $this; + } + +} + diff --git a/Dlp/src/V2/DiscoveryCloudSqlConditions/DatabaseEngine.php b/Dlp/src/V2/DiscoveryCloudSqlConditions/DatabaseEngine.php new file mode 100644 index 000000000000..8438c6877e4a --- /dev/null +++ b/Dlp/src/V2/DiscoveryCloudSqlConditions/DatabaseEngine.php @@ -0,0 +1,71 @@ +google.privacy.dlp.v2.DiscoveryCloudSqlConditions.DatabaseEngine + */ +class DatabaseEngine +{ + /** + * Unused. + * + * Generated from protobuf enum DATABASE_ENGINE_UNSPECIFIED = 0; + */ + const DATABASE_ENGINE_UNSPECIFIED = 0; + /** + * Include all supported database engines. + * + * Generated from protobuf enum ALL_SUPPORTED_DATABASE_ENGINES = 1; + */ + const ALL_SUPPORTED_DATABASE_ENGINES = 1; + /** + * MySQL database. + * + * Generated from protobuf enum MYSQL = 2; + */ + const MYSQL = 2; + /** + * PostgreSQL database. + * + * Generated from protobuf enum POSTGRES = 3; + */ + const POSTGRES = 3; + + private static $valueToName = [ + self::DATABASE_ENGINE_UNSPECIFIED => 'DATABASE_ENGINE_UNSPECIFIED', + self::ALL_SUPPORTED_DATABASE_ENGINES => 'ALL_SUPPORTED_DATABASE_ENGINES', + self::MYSQL => 'MYSQL', + self::POSTGRES => 'POSTGRES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatabaseEngine::class, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlConditions_DatabaseEngine::class); + diff --git a/Dlp/src/V2/DiscoveryCloudSqlConditions/DatabaseResourceType.php b/Dlp/src/V2/DiscoveryCloudSqlConditions/DatabaseResourceType.php new file mode 100644 index 000000000000..50969361416d --- /dev/null +++ b/Dlp/src/V2/DiscoveryCloudSqlConditions/DatabaseResourceType.php @@ -0,0 +1,64 @@ +google.privacy.dlp.v2.DiscoveryCloudSqlConditions.DatabaseResourceType + */ +class DatabaseResourceType +{ + /** + * Unused. + * + * Generated from protobuf enum DATABASE_RESOURCE_TYPE_UNSPECIFIED = 0; + */ + const DATABASE_RESOURCE_TYPE_UNSPECIFIED = 0; + /** + * Includes database resource types that become supported at a later time. + * + * Generated from protobuf enum DATABASE_RESOURCE_TYPE_ALL_SUPPORTED_TYPES = 1; + */ + const DATABASE_RESOURCE_TYPE_ALL_SUPPORTED_TYPES = 1; + /** + * Tables. + * + * Generated from protobuf enum DATABASE_RESOURCE_TYPE_TABLE = 2; + */ + const DATABASE_RESOURCE_TYPE_TABLE = 2; + + private static $valueToName = [ + self::DATABASE_RESOURCE_TYPE_UNSPECIFIED => 'DATABASE_RESOURCE_TYPE_UNSPECIFIED', + self::DATABASE_RESOURCE_TYPE_ALL_SUPPORTED_TYPES => 'DATABASE_RESOURCE_TYPE_ALL_SUPPORTED_TYPES', + self::DATABASE_RESOURCE_TYPE_TABLE => 'DATABASE_RESOURCE_TYPE_TABLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatabaseResourceType::class, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlConditions_DatabaseResourceType::class); + diff --git a/Dlp/src/V2/DiscoveryCloudSqlFilter.php b/Dlp/src/V2/DiscoveryCloudSqlFilter.php new file mode 100644 index 000000000000..c2d34c2f8649 --- /dev/null +++ b/Dlp/src/V2/DiscoveryCloudSqlFilter.php @@ -0,0 +1,155 @@ +google.privacy.dlp.v2.DiscoveryCloudSqlFilter + */ +class DiscoveryCloudSqlFilter extends \Google\Protobuf\Internal\Message +{ + protected $filter; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dlp\V2\DatabaseResourceCollection $collection + * A specific set of database resources for this filter to apply to. + * @type \Google\Cloud\Dlp\V2\AllOtherDatabaseResources $others + * Catch-all. This should always be the last target in the list because + * anything above it will apply first. Should only appear once in a + * configuration. If none is specified, a default one will be added + * automatically. + * @type \Google\Cloud\Dlp\V2\DatabaseResourceReference $database_resource_reference + * The database resource to scan. Targets including this can only include + * one target (the target with this database resource reference). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * A specific set of database resources for this filter to apply to. + * + * Generated from protobuf field .google.privacy.dlp.v2.DatabaseResourceCollection collection = 1; + * @return \Google\Cloud\Dlp\V2\DatabaseResourceCollection|null + */ + public function getCollection() + { + return $this->readOneof(1); + } + + public function hasCollection() + { + return $this->hasOneof(1); + } + + /** + * A specific set of database resources for this filter to apply to. + * + * Generated from protobuf field .google.privacy.dlp.v2.DatabaseResourceCollection collection = 1; + * @param \Google\Cloud\Dlp\V2\DatabaseResourceCollection $var + * @return $this + */ + public function setCollection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DatabaseResourceCollection::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Catch-all. This should always be the last target in the list because + * anything above it will apply first. Should only appear once in a + * configuration. If none is specified, a default one will be added + * automatically. + * + * Generated from protobuf field .google.privacy.dlp.v2.AllOtherDatabaseResources others = 2; + * @return \Google\Cloud\Dlp\V2\AllOtherDatabaseResources|null + */ + public function getOthers() + { + return $this->readOneof(2); + } + + public function hasOthers() + { + return $this->hasOneof(2); + } + + /** + * Catch-all. This should always be the last target in the list because + * anything above it will apply first. Should only appear once in a + * configuration. If none is specified, a default one will be added + * automatically. + * + * Generated from protobuf field .google.privacy.dlp.v2.AllOtherDatabaseResources others = 2; + * @param \Google\Cloud\Dlp\V2\AllOtherDatabaseResources $var + * @return $this + */ + public function setOthers($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\AllOtherDatabaseResources::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The database resource to scan. Targets including this can only include + * one target (the target with this database resource reference). + * + * Generated from protobuf field .google.privacy.dlp.v2.DatabaseResourceReference database_resource_reference = 3; + * @return \Google\Cloud\Dlp\V2\DatabaseResourceReference|null + */ + public function getDatabaseResourceReference() + { + return $this->readOneof(3); + } + + public function hasDatabaseResourceReference() + { + return $this->hasOneof(3); + } + + /** + * The database resource to scan. Targets including this can only include + * one target (the target with this database resource reference). + * + * Generated from protobuf field .google.privacy.dlp.v2.DatabaseResourceReference database_resource_reference = 3; + * @param \Google\Cloud\Dlp\V2\DatabaseResourceReference $var + * @return $this + */ + public function setDatabaseResourceReference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DatabaseResourceReference::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getFilter() + { + return $this->whichOneof("filter"); + } + +} + diff --git a/Dlp/src/V2/DiscoveryCloudSqlGenerationCadence.php b/Dlp/src/V2/DiscoveryCloudSqlGenerationCadence.php new file mode 100644 index 000000000000..5fc3081fab3c --- /dev/null +++ b/Dlp/src/V2/DiscoveryCloudSqlGenerationCadence.php @@ -0,0 +1,125 @@ +google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence + */ +class DiscoveryCloudSqlGenerationCadence extends \Google\Protobuf\Internal\Message +{ + /** + * When to reprofile if the schema has changed. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence.SchemaModifiedCadence schema_modified_cadence = 1; + */ + private $schema_modified_cadence = null; + /** + * Data changes (non-schema changes) in Cloud SQL tables can't trigger + * reprofiling. If you set this field, profiles are refreshed at this + * frequency regardless of whether the underlying tables have changed. + * Defaults to never. + * + * Generated from protobuf field .google.privacy.dlp.v2.DataProfileUpdateFrequency refresh_frequency = 2; + */ + private $refresh_frequency = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence\SchemaModifiedCadence $schema_modified_cadence + * When to reprofile if the schema has changed. + * @type int $refresh_frequency + * Data changes (non-schema changes) in Cloud SQL tables can't trigger + * reprofiling. If you set this field, profiles are refreshed at this + * frequency regardless of whether the underlying tables have changed. + * Defaults to never. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * When to reprofile if the schema has changed. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence.SchemaModifiedCadence schema_modified_cadence = 1; + * @return \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence\SchemaModifiedCadence|null + */ + public function getSchemaModifiedCadence() + { + return $this->schema_modified_cadence; + } + + public function hasSchemaModifiedCadence() + { + return isset($this->schema_modified_cadence); + } + + public function clearSchemaModifiedCadence() + { + unset($this->schema_modified_cadence); + } + + /** + * When to reprofile if the schema has changed. + * + * Generated from protobuf field .google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence.SchemaModifiedCadence schema_modified_cadence = 1; + * @param \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence\SchemaModifiedCadence $var + * @return $this + */ + public function setSchemaModifiedCadence($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence\SchemaModifiedCadence::class); + $this->schema_modified_cadence = $var; + + return $this; + } + + /** + * Data changes (non-schema changes) in Cloud SQL tables can't trigger + * reprofiling. If you set this field, profiles are refreshed at this + * frequency regardless of whether the underlying tables have changed. + * Defaults to never. + * + * Generated from protobuf field .google.privacy.dlp.v2.DataProfileUpdateFrequency refresh_frequency = 2; + * @return int + */ + public function getRefreshFrequency() + { + return $this->refresh_frequency; + } + + /** + * Data changes (non-schema changes) in Cloud SQL tables can't trigger + * reprofiling. If you set this field, profiles are refreshed at this + * frequency regardless of whether the underlying tables have changed. + * Defaults to never. + * + * Generated from protobuf field .google.privacy.dlp.v2.DataProfileUpdateFrequency refresh_frequency = 2; + * @param int $var + * @return $this + */ + public function setRefreshFrequency($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\DataProfileUpdateFrequency::class); + $this->refresh_frequency = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/DiscoveryCloudSqlGenerationCadence/SchemaModifiedCadence.php b/Dlp/src/V2/DiscoveryCloudSqlGenerationCadence/SchemaModifiedCadence.php new file mode 100644 index 000000000000..ede3a084bdf9 --- /dev/null +++ b/Dlp/src/V2/DiscoveryCloudSqlGenerationCadence/SchemaModifiedCadence.php @@ -0,0 +1,112 @@ +google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence.SchemaModifiedCadence + */ +class SchemaModifiedCadence extends \Google\Protobuf\Internal\Message +{ + /** + * The types of schema modifications to consider. + * Defaults to NEW_COLUMNS. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence.SchemaModifiedCadence.CloudSqlSchemaModification types = 1; + */ + private $types; + /** + * Frequency to regenerate data profiles when the schema is modified. + * Defaults to monthly. + * + * Generated from protobuf field .google.privacy.dlp.v2.DataProfileUpdateFrequency frequency = 2; + */ + private $frequency = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $types + * The types of schema modifications to consider. + * Defaults to NEW_COLUMNS. + * @type int $frequency + * Frequency to regenerate data profiles when the schema is modified. + * Defaults to monthly. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * The types of schema modifications to consider. + * Defaults to NEW_COLUMNS. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence.SchemaModifiedCadence.CloudSqlSchemaModification types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTypes() + { + return $this->types; + } + + /** + * The types of schema modifications to consider. + * Defaults to NEW_COLUMNS. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence.SchemaModifiedCadence.CloudSqlSchemaModification types = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence\SchemaModifiedCadence\CloudSqlSchemaModification::class); + $this->types = $arr; + + return $this; + } + + /** + * Frequency to regenerate data profiles when the schema is modified. + * Defaults to monthly. + * + * Generated from protobuf field .google.privacy.dlp.v2.DataProfileUpdateFrequency frequency = 2; + * @return int + */ + public function getFrequency() + { + return $this->frequency; + } + + /** + * Frequency to regenerate data profiles when the schema is modified. + * Defaults to monthly. + * + * Generated from protobuf field .google.privacy.dlp.v2.DataProfileUpdateFrequency frequency = 2; + * @param int $var + * @return $this + */ + public function setFrequency($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\DataProfileUpdateFrequency::class); + $this->frequency = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SchemaModifiedCadence::class, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence_SchemaModifiedCadence::class); + diff --git a/Dlp/src/V2/DiscoveryCloudSqlGenerationCadence/SchemaModifiedCadence/CloudSqlSchemaModification.php b/Dlp/src/V2/DiscoveryCloudSqlGenerationCadence/SchemaModifiedCadence/CloudSqlSchemaModification.php new file mode 100644 index 000000000000..38682145dfb2 --- /dev/null +++ b/Dlp/src/V2/DiscoveryCloudSqlGenerationCadence/SchemaModifiedCadence/CloudSqlSchemaModification.php @@ -0,0 +1,64 @@ +google.privacy.dlp.v2.DiscoveryCloudSqlGenerationCadence.SchemaModifiedCadence.CloudSqlSchemaModification + */ +class CloudSqlSchemaModification +{ + /** + * Unused. + * + * Generated from protobuf enum SQL_SCHEMA_MODIFICATION_UNSPECIFIED = 0; + */ + const SQL_SCHEMA_MODIFICATION_UNSPECIFIED = 0; + /** + * New columns have appeared. + * + * Generated from protobuf enum NEW_COLUMNS = 1; + */ + const NEW_COLUMNS = 1; + /** + * Columns have been removed from the table. + * + * Generated from protobuf enum REMOVED_COLUMNS = 2; + */ + const REMOVED_COLUMNS = 2; + + private static $valueToName = [ + self::SQL_SCHEMA_MODIFICATION_UNSPECIFIED => 'SQL_SCHEMA_MODIFICATION_UNSPECIFIED', + self::NEW_COLUMNS => 'NEW_COLUMNS', + self::REMOVED_COLUMNS => 'REMOVED_COLUMNS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CloudSqlSchemaModification::class, \Google\Cloud\Dlp\V2\DiscoveryCloudSqlGenerationCadence_SchemaModifiedCadence_CloudSqlSchemaModification::class); + diff --git a/Dlp/src/V2/DiscoveryTarget.php b/Dlp/src/V2/DiscoveryTarget.php index b1231e0b30ad..b9b4cc728e9b 100644 --- a/Dlp/src/V2/DiscoveryTarget.php +++ b/Dlp/src/V2/DiscoveryTarget.php @@ -26,6 +26,13 @@ class DiscoveryTarget extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Dlp\V2\BigQueryDiscoveryTarget $big_query_target * BigQuery target for Discovery. The first target to match a table will be * the one applied. + * @type \Google\Cloud\Dlp\V2\CloudSqlDiscoveryTarget $cloud_sql_target + * Cloud SQL target for Discovery. The first target to match a table will be + * the one applied. + * @type \Google\Cloud\Dlp\V2\SecretsDiscoveryTarget $secrets_target + * Discovery target that looks for credentials and secrets stored in cloud + * resource metadata and reports them as vulnerabilities to Security Command + * Center. Only one target of this type is allowed. * } */ public function __construct($data = NULL) { @@ -66,6 +73,74 @@ public function setBigQueryTarget($var) return $this; } + /** + * Cloud SQL target for Discovery. The first target to match a table will be + * the one applied. + * + * Generated from protobuf field .google.privacy.dlp.v2.CloudSqlDiscoveryTarget cloud_sql_target = 2; + * @return \Google\Cloud\Dlp\V2\CloudSqlDiscoveryTarget|null + */ + public function getCloudSqlTarget() + { + return $this->readOneof(2); + } + + public function hasCloudSqlTarget() + { + return $this->hasOneof(2); + } + + /** + * Cloud SQL target for Discovery. The first target to match a table will be + * the one applied. + * + * Generated from protobuf field .google.privacy.dlp.v2.CloudSqlDiscoveryTarget cloud_sql_target = 2; + * @param \Google\Cloud\Dlp\V2\CloudSqlDiscoveryTarget $var + * @return $this + */ + public function setCloudSqlTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudSqlDiscoveryTarget::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Discovery target that looks for credentials and secrets stored in cloud + * resource metadata and reports them as vulnerabilities to Security Command + * Center. Only one target of this type is allowed. + * + * Generated from protobuf field .google.privacy.dlp.v2.SecretsDiscoveryTarget secrets_target = 3; + * @return \Google\Cloud\Dlp\V2\SecretsDiscoveryTarget|null + */ + public function getSecretsTarget() + { + return $this->readOneof(3); + } + + public function hasSecretsTarget() + { + return $this->hasOneof(3); + } + + /** + * Discovery target that looks for credentials and secrets stored in cloud + * resource metadata and reports them as vulnerabilities to Security Command + * Center. Only one target of this type is allowed. + * + * Generated from protobuf field .google.privacy.dlp.v2.SecretsDiscoveryTarget secrets_target = 3; + * @param \Google\Cloud\Dlp\V2\SecretsDiscoveryTarget $var + * @return $this + */ + public function setSecretsTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\SecretsDiscoveryTarget::class); + $this->writeOneof(3, $var); + + return $this; + } + /** * @return string */ diff --git a/Dlp/src/V2/Gapic/DlpServiceGapicClient.php b/Dlp/src/V2/Gapic/DlpServiceGapicClient.php index 5e7c3648823e..540d4d85394b 100644 --- a/Dlp/src/V2/Gapic/DlpServiceGapicClient.php +++ b/Dlp/src/V2/Gapic/DlpServiceGapicClient.php @@ -37,7 +37,9 @@ use Google\Cloud\Dlp\V2\ByteContentItem; use Google\Cloud\Dlp\V2\CancelDlpJobRequest; use Google\Cloud\Dlp\V2\ColumnDataProfile; +use Google\Cloud\Dlp\V2\Connection; use Google\Cloud\Dlp\V2\ContentItem; +use Google\Cloud\Dlp\V2\CreateConnectionRequest; use Google\Cloud\Dlp\V2\CreateDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\CreateDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\CreateDlpJobRequest; @@ -48,17 +50,20 @@ use Google\Cloud\Dlp\V2\DeidentifyContentRequest; use Google\Cloud\Dlp\V2\DeidentifyContentResponse; use Google\Cloud\Dlp\V2\DeidentifyTemplate; +use Google\Cloud\Dlp\V2\DeleteConnectionRequest; use Google\Cloud\Dlp\V2\DeleteDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\DeleteDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\DeleteDlpJobRequest; use Google\Cloud\Dlp\V2\DeleteInspectTemplateRequest; use Google\Cloud\Dlp\V2\DeleteJobTriggerRequest; use Google\Cloud\Dlp\V2\DeleteStoredInfoTypeRequest; +use Google\Cloud\Dlp\V2\DeleteTableDataProfileRequest; use Google\Cloud\Dlp\V2\DiscoveryConfig; use Google\Cloud\Dlp\V2\DlpJob; use Google\Cloud\Dlp\V2\DlpJobType; use Google\Cloud\Dlp\V2\FinishDlpJobRequest; use Google\Cloud\Dlp\V2\GetColumnDataProfileRequest; +use Google\Cloud\Dlp\V2\GetConnectionRequest; use Google\Cloud\Dlp\V2\GetDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\GetDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\GetDlpJobRequest; @@ -79,6 +84,8 @@ use Google\Cloud\Dlp\V2\JobTrigger; use Google\Cloud\Dlp\V2\ListColumnDataProfilesRequest; use Google\Cloud\Dlp\V2\ListColumnDataProfilesResponse; +use Google\Cloud\Dlp\V2\ListConnectionsRequest; +use Google\Cloud\Dlp\V2\ListConnectionsResponse; use Google\Cloud\Dlp\V2\ListDeidentifyTemplatesRequest; use Google\Cloud\Dlp\V2\ListDeidentifyTemplatesResponse; use Google\Cloud\Dlp\V2\ListDiscoveryConfigsRequest; @@ -104,9 +111,12 @@ use Google\Cloud\Dlp\V2\ReidentifyContentRequest; use Google\Cloud\Dlp\V2\ReidentifyContentResponse; use Google\Cloud\Dlp\V2\RiskAnalysisJobConfig; +use Google\Cloud\Dlp\V2\SearchConnectionsRequest; +use Google\Cloud\Dlp\V2\SearchConnectionsResponse; use Google\Cloud\Dlp\V2\StoredInfoType; use Google\Cloud\Dlp\V2\StoredInfoTypeConfig; use Google\Cloud\Dlp\V2\TableDataProfile; +use Google\Cloud\Dlp\V2\UpdateConnectionRequest; use Google\Cloud\Dlp\V2\UpdateDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\UpdateDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\UpdateInspectTemplateRequest; @@ -176,6 +186,8 @@ class DlpServiceGapicClient private static $columnDataProfileNameTemplate; + private static $connectionNameTemplate; + private static $deidentifyTemplateNameTemplate; private static $discoveryConfigNameTemplate; @@ -282,6 +294,17 @@ private static function getColumnDataProfileNameTemplate() return self::$columnDataProfileNameTemplate; } + private static function getConnectionNameTemplate() + { + if (self::$connectionNameTemplate == null) { + self::$connectionNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/connections/{connection}' + ); + } + + return self::$connectionNameTemplate; + } + private static function getDeidentifyTemplateNameTemplate() { if (self::$deidentifyTemplateNameTemplate == null) { @@ -659,6 +682,7 @@ private static function getPathTemplateMap() if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ 'columnDataProfile' => self::getColumnDataProfileNameTemplate(), + 'connection' => self::getConnectionNameTemplate(), 'deidentifyTemplate' => self::getDeidentifyTemplateNameTemplate(), 'discoveryConfig' => self::getDiscoveryConfigNameTemplate(), 'dlpJob' => self::getDlpJobNameTemplate(), @@ -721,6 +745,25 @@ public static function columnDataProfileName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a connection + * resource. + * + * @param string $project + * @param string $location + * @param string $connection + * + * @return string The formatted connection resource. + */ + public static function connectionName($project, $location, $connection) + { + return self::getConnectionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'connection' => $connection, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * deidentify_template resource. @@ -1413,6 +1456,7 @@ public static function tableDataProfileName( * The following name formats are supported: * Template: Pattern * - columnDataProfile: organizations/{organization}/locations/{location}/columnDataProfiles/{column_data_profile} + * - connection: projects/{project}/locations/{location}/connections/{connection} * - deidentifyTemplate: organizations/{organization}/deidentifyTemplates/{deidentify_template} * - discoveryConfig: projects/{project}/locations/{location}/discoveryConfigs/{discovery_config} * - dlpJob: projects/{project}/dlpJobs/{dlp_job} @@ -1650,6 +1694,61 @@ public function cancelDlpJob($name, array $optionalArgs = []) )->wait(); } + /** + * Create a Connection to an external data source. + * + * Sample code: + * ``` + * $dlpServiceClient = new DlpServiceClient(); + * try { + * $formattedParent = $dlpServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $connection = new Connection(); + * $response = $dlpServiceClient->createConnection($formattedParent, $connection); + * } finally { + * $dlpServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent resource name in the format: + * `projects/{project}/locations/{location}`. + * @param Connection $connection Required. The connection resource. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Dlp\V2\Connection + * + * @throws ApiException if the remote call fails + */ + public function createConnection( + $parent, + $connection, + array $optionalArgs = [] + ) { + $request = new CreateConnectionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setConnection($connection); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'CreateConnection', + Connection::class, + $optionalArgs, + $request + )->wait(); + } + /** * Creates a DeidentifyTemplate for reusing frequently used configuration * for de-identifying content, images, and storage. @@ -2320,6 +2419,53 @@ public function deidentifyContent(array $optionalArgs = []) )->wait(); } + /** + * Delete a Connection. + * + * Sample code: + * ``` + * $dlpServiceClient = new DlpServiceClient(); + * try { + * $formattedName = $dlpServiceClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + * $dlpServiceClient->deleteConnection($formattedName); + * } finally { + * $dlpServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the Connection to be deleted, in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteConnection($name, array $optionalArgs = []) + { + $request = new DeleteConnectionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'DeleteConnection', + GPBEmpty::class, + $optionalArgs, + $request + )->wait(); + } + /** * Deletes a DeidentifyTemplate. * See @@ -2624,6 +2770,53 @@ public function deleteStoredInfoType($name, array $optionalArgs = []) )->wait(); } + /** + * Delete a TableDataProfile. Will not prevent the profile from being + * regenerated if the table is still included in a discovery configuration. + * + * Sample code: + * ``` + * $dlpServiceClient = new DlpServiceClient(); + * try { + * $formattedName = $dlpServiceClient->tableDataProfileName('[ORGANIZATION]', '[LOCATION]', '[TABLE_DATA_PROFILE]'); + * $dlpServiceClient->deleteTableDataProfile($formattedName); + * } finally { + * $dlpServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the table data profile. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteTableDataProfile($name, array $optionalArgs = []) + { + $request = new DeleteTableDataProfileRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'DeleteTableDataProfile', + GPBEmpty::class, + $optionalArgs, + $request + )->wait(); + } + /** * Finish a running hybrid DlpJob. Triggers the finalization steps and running * of any enabled actions that have not yet run. @@ -2720,6 +2913,55 @@ public function getColumnDataProfile($name, array $optionalArgs = []) )->wait(); } + /** + * Get a Connection by name. + * + * Sample code: + * ``` + * $dlpServiceClient = new DlpServiceClient(); + * try { + * $formattedName = $dlpServiceClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + * $response = $dlpServiceClient->getConnection($formattedName); + * } finally { + * $dlpServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Dlp\V2\Connection + * + * @throws ApiException if the remote call fails + */ + public function getConnection($name, array $optionalArgs = []) + { + $request = new GetConnectionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetConnection', + Connection::class, + $optionalArgs, + $request + )->wait(); + } + /** * Gets a DeidentifyTemplate. * See @@ -3353,7 +3595,7 @@ public function inspectContent(array $optionalArgs = []) } /** - * Lists data profiles for an organization. + * Lists column data profiles for an organization. * * Sample code: * ``` @@ -3490,6 +3732,90 @@ public function listColumnDataProfiles($parent, array $optionalArgs = []) ); } + /** + * Lists Connections in a parent. + * + * Sample code: + * ``` + * $dlpServiceClient = new DlpServiceClient(); + * try { + * $formattedParent = $dlpServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $dlpServiceClient->listConnections($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $dlpServiceClient->listConnections($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $dlpServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent name, for example: + * `projects/project-id/locations/global`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Supported field/value: `state` - MISSING|AVAILABLE|ERROR + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listConnections($parent, array $optionalArgs = []) + { + $request = new ListConnectionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListConnections', + $optionalArgs, + ListConnectionsResponse::class, + $request + ); + } + /** * Lists DeidentifyTemplates. * See @@ -4237,7 +4563,7 @@ public function listJobTriggers($parent, array $optionalArgs = []) } /** - * Lists data profiles for an organization. + * Lists project data profiles for an organization. * * Sample code: * ``` @@ -4287,7 +4613,7 @@ public function listJobTriggers($parent, array $optionalArgs = []) * * Supported fields are: * - * - `project_id`: GCP project ID + * - `project_id`: Google Cloud project ID * - `sensitivity_level`: How sensitive the data in a project is, at most. * - `data_risk_level`: How much risk is associated with this data. * - `profile_last_generated`: When the profile was last updated in epoch @@ -4481,7 +4807,7 @@ public function listStoredInfoTypes($parent, array $optionalArgs = []) } /** - * Lists data profiles for an organization. + * Lists table data profiles for an organization. * * Sample code: * ``` @@ -4534,7 +4860,7 @@ public function listStoredInfoTypes($parent, array $optionalArgs = []) * * Supported fields are: * - * - `project_id`: The GCP project ID. + * - `project_id`: The Google Cloud project ID. * - `dataset_id`: The ID of a BigQuery dataset. * - `table_id`: The ID of a BigQuery table. * - `sensitivity_level`: How sensitive the data in a table is, at most. @@ -4554,7 +4880,7 @@ public function listStoredInfoTypes($parent, array $optionalArgs = []) * sequence of restrictions implicitly uses `AND`. * * A restriction has the form of `{field} {operator} {value}`. * * Supported fields/values: - * - `project_id` - The GCP project ID. + * - `project_id` - The Google Cloud project ID. * - `dataset_id` - The BigQuery dataset ID. * - `table_id` - The ID of the BigQuery table. * - `sensitivity_level` - HIGH|MODERATE|LOW @@ -4849,6 +5175,151 @@ public function reidentifyContent($parent, array $optionalArgs = []) )->wait(); } + /** + * Searches for Connections in a parent. + * + * Sample code: + * ``` + * $dlpServiceClient = new DlpServiceClient(); + * try { + * $formattedParent = $dlpServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $dlpServiceClient->searchConnections($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $dlpServiceClient->searchConnections($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $dlpServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent name, typically an organization, without location. + * For example: `organizations/12345678`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Supported field/value: - `state` - MISSING|AVAILABLE|ERROR + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function searchConnections($parent, array $optionalArgs = []) + { + $request = new SearchConnectionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'SearchConnections', + $optionalArgs, + SearchConnectionsResponse::class, + $request + ); + } + + /** + * Update a Connection. + * + * Sample code: + * ``` + * $dlpServiceClient = new DlpServiceClient(); + * try { + * $formattedName = $dlpServiceClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + * $connection = new Connection(); + * $response = $dlpServiceClient->updateConnection($formattedName, $connection); + * } finally { + * $dlpServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * @param Connection $connection Required. The connection with new values for the relevant fields. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Mask to control which fields get updated. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Dlp\V2\Connection + * + * @throws ApiException if the remote call fails + */ + public function updateConnection( + $name, + $connection, + array $optionalArgs = [] + ) { + $request = new UpdateConnectionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setConnection($connection); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'UpdateConnection', + Connection::class, + $optionalArgs, + $request + )->wait(); + } + /** * Updates the DeidentifyTemplate. * See diff --git a/Dlp/src/V2/GetConnectionRequest.php b/Dlp/src/V2/GetConnectionRequest.php new file mode 100644 index 000000000000..fc462f1ea7a2 --- /dev/null +++ b/Dlp/src/V2/GetConnectionRequest.php @@ -0,0 +1,86 @@ +google.privacy.dlp.v2.GetConnectionRequest + */ +class GetConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. Please see + * {@see DlpServiceClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\Dlp\V2\GetConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/InfoTypeCategory/LocationCategory.php b/Dlp/src/V2/InfoTypeCategory/LocationCategory.php index 20769afaf042..5d6155f21604 100644 --- a/Dlp/src/V2/InfoTypeCategory/LocationCategory.php +++ b/Dlp/src/V2/InfoTypeCategory/LocationCategory.php @@ -39,6 +39,12 @@ class LocationCategory * Generated from protobuf enum AUSTRALIA = 3; */ const AUSTRALIA = 3; + /** + * The infoType is typically used in Azerbaijan. + * + * Generated from protobuf enum AZERBAIJAN = 48; + */ + const AZERBAIJAN = 48; /** * The infoType is typically used in Belgium. * @@ -147,6 +153,12 @@ class LocationCategory * Generated from protobuf enum JAPAN = 20; */ const JAPAN = 20; + /** + * The infoType is typically used in Kazakhstan. + * + * Generated from protobuf enum KAZAKHSTAN = 47; + */ + const KAZAKHSTAN = 47; /** * The infoType is typically used in Korea. * @@ -201,6 +213,12 @@ class LocationCategory * Generated from protobuf enum PORTUGAL = 28; */ const PORTUGAL = 28; + /** + * The infoType is typically used in Russia. + * + * Generated from protobuf enum RUSSIA = 44; + */ + const RUSSIA = 44; /** * The infoType is typically used in Singapore. * @@ -249,6 +267,12 @@ class LocationCategory * Generated from protobuf enum TURKEY = 35; */ const TURKEY = 35; + /** + * The infoType is typically used in Ukraine. + * + * Generated from protobuf enum UKRAINE = 45; + */ + const UKRAINE = 45; /** * The infoType is typically used in the United Kingdom. * @@ -267,6 +291,12 @@ class LocationCategory * Generated from protobuf enum URUGUAY = 38; */ const URUGUAY = 38; + /** + * The infoType is typically used in Uzbekistan. + * + * Generated from protobuf enum UZBEKISTAN = 46; + */ + const UZBEKISTAN = 46; /** * The infoType is typically used in Venezuela. * @@ -285,6 +315,7 @@ class LocationCategory self::PBGLOBAL => 'GLOBAL', self::ARGENTINA => 'ARGENTINA', self::AUSTRALIA => 'AUSTRALIA', + self::AZERBAIJAN => 'AZERBAIJAN', self::BELGIUM => 'BELGIUM', self::BRAZIL => 'BRAZIL', self::CANADA => 'CANADA', @@ -303,6 +334,7 @@ class LocationCategory self::ISRAEL => 'ISRAEL', self::ITALY => 'ITALY', self::JAPAN => 'JAPAN', + self::KAZAKHSTAN => 'KAZAKHSTAN', self::KOREA => 'KOREA', self::MEXICO => 'MEXICO', self::THE_NETHERLANDS => 'THE_NETHERLANDS', @@ -312,6 +344,7 @@ class LocationCategory self::PERU => 'PERU', self::POLAND => 'POLAND', self::PORTUGAL => 'PORTUGAL', + self::RUSSIA => 'RUSSIA', self::SINGAPORE => 'SINGAPORE', self::SOUTH_AFRICA => 'SOUTH_AFRICA', self::SPAIN => 'SPAIN', @@ -320,9 +353,11 @@ class LocationCategory self::TAIWAN => 'TAIWAN', self::THAILAND => 'THAILAND', self::TURKEY => 'TURKEY', + self::UKRAINE => 'UKRAINE', self::UNITED_KINGDOM => 'UNITED_KINGDOM', self::UNITED_STATES => 'UNITED_STATES', self::URUGUAY => 'URUGUAY', + self::UZBEKISTAN => 'UZBEKISTAN', self::VENEZUELA => 'VENEZUELA', self::INTERNAL => 'INTERNAL', ]; diff --git a/Dlp/src/V2/InspectDataSourceDetails/Result.php b/Dlp/src/V2/InspectDataSourceDetails/Result.php index 2d16ce81fdd8..0660fbd48891 100644 --- a/Dlp/src/V2/InspectDataSourceDetails/Result.php +++ b/Dlp/src/V2/InspectDataSourceDetails/Result.php @@ -34,6 +34,13 @@ class Result extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.privacy.dlp.v2.InfoTypeStats info_type_stats = 3; */ private $info_type_stats; + /** + * Number of rows scanned after sampling and time filtering (applicable for + * row based stores such as BigQuery). + * + * Generated from protobuf field int64 num_rows_processed = 5; + */ + private $num_rows_processed = 0; /** * Statistics related to the processing of hybrid inspect. * @@ -54,6 +61,9 @@ class Result extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\Dlp\V2\InfoTypeStats>|\Google\Protobuf\Internal\RepeatedField $info_type_stats * Statistics of how many instances of each info type were found during * inspect job. + * @type int|string $num_rows_processed + * Number of rows scanned after sampling and time filtering (applicable for + * row based stores such as BigQuery). * @type \Google\Cloud\Dlp\V2\HybridInspectStatistics $hybrid_stats * Statistics related to the processing of hybrid inspect. * } @@ -143,6 +153,34 @@ public function setInfoTypeStats($var) return $this; } + /** + * Number of rows scanned after sampling and time filtering (applicable for + * row based stores such as BigQuery). + * + * Generated from protobuf field int64 num_rows_processed = 5; + * @return int|string + */ + public function getNumRowsProcessed() + { + return $this->num_rows_processed; + } + + /** + * Number of rows scanned after sampling and time filtering (applicable for + * row based stores such as BigQuery). + * + * Generated from protobuf field int64 num_rows_processed = 5; + * @param int|string $var + * @return $this + */ + public function setNumRowsProcessed($var) + { + GPBUtil::checkInt64($var); + $this->num_rows_processed = $var; + + return $this; + } + /** * Statistics related to the processing of hybrid inspect. * diff --git a/Dlp/src/V2/JobTrigger.php b/Dlp/src/V2/JobTrigger.php index 3c0eff6a6e34..a6bacf9daa9d 100644 --- a/Dlp/src/V2/JobTrigger.php +++ b/Dlp/src/V2/JobTrigger.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Contains a configuration to make dlp api calls on a repeating basis. + * Contains a configuration to make API calls on a repeating basis. * See * https://cloud.google.com/sensitive-data-protection/docs/concepts-job-triggers * to learn more. diff --git a/Dlp/src/V2/ListConnectionsRequest.php b/Dlp/src/V2/ListConnectionsRequest.php new file mode 100644 index 000000000000..e6370d01f268 --- /dev/null +++ b/Dlp/src/V2/ListConnectionsRequest.php @@ -0,0 +1,192 @@ +google.privacy.dlp.v2.ListConnectionsRequest + */ +class ListConnectionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent name, for example: + * `projects/project-id/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Optional. Number of results per page, max 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_size = 0; + /** + * Optional. Page token from a previous page to return the next set of + * results. If set, all other request fields must match the original request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_token = ''; + /** + * Optional. Supported field/value: `state` - MISSING|AVAILABLE|ERROR + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter = ''; + + /** + * @param string $parent Required. Parent name, for example: + * `projects/project-id/locations/global`. Please see + * {@see DlpServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Dlp\V2\ListConnectionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent name, for example: + * `projects/project-id/locations/global`. + * @type int $page_size + * Optional. Number of results per page, max 1000. + * @type string $page_token + * Optional. Page token from a previous page to return the next set of + * results. If set, all other request fields must match the original request. + * @type string $filter + * Optional. Supported field/value: `state` - MISSING|AVAILABLE|ERROR + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent name, for example: + * `projects/project-id/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent name, for example: + * `projects/project-id/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Number of results per page, max 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Number of results per page, max 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Page token from a previous page to return the next set of + * results. If set, all other request fields must match the original request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Page token from a previous page to return the next set of + * results. If set, all other request fields must match the original request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Supported field/value: `state` - MISSING|AVAILABLE|ERROR + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Supported field/value: `state` - MISSING|AVAILABLE|ERROR + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/ListConnectionsResponse.php b/Dlp/src/V2/ListConnectionsResponse.php new file mode 100644 index 000000000000..4c13dd6c2506 --- /dev/null +++ b/Dlp/src/V2/ListConnectionsResponse.php @@ -0,0 +1,105 @@ +google.privacy.dlp.v2.ListConnectionsResponse + */ +class ListConnectionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of connections. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.Connection connections = 1; + */ + private $connections; + /** + * Token to retrieve the next page of results. An empty value means there are + * no more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dlp\V2\Connection>|\Google\Protobuf\Internal\RepeatedField $connections + * List of connections. + * @type string $next_page_token + * Token to retrieve the next page of results. An empty value means there are + * no more results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.Connection connections = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnections() + { + return $this->connections; + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.Connection connections = 1; + * @param array<\Google\Cloud\Dlp\V2\Connection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\Connection::class); + $this->connections = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results. An empty value means there are + * no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results. An empty value means there are + * no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/ListProjectDataProfilesRequest.php b/Dlp/src/V2/ListProjectDataProfilesRequest.php index 605a6205ec87..8e9ca36d5673 100644 --- a/Dlp/src/V2/ListProjectDataProfilesRequest.php +++ b/Dlp/src/V2/ListProjectDataProfilesRequest.php @@ -43,7 +43,7 @@ class ListProjectDataProfilesRequest extends \Google\Protobuf\Internal\Message * * `project_id` * * `sensitivity_level desc` * Supported fields are: - * - `project_id`: GCP project ID + * - `project_id`: Google Cloud project ID * - `sensitivity_level`: How sensitive the data in a project is, at most. * - `data_risk_level`: How much risk is associated with this data. * - `profile_last_generated`: When the profile was last updated in epoch @@ -110,7 +110,7 @@ public static function build(string $parent): self * * `project_id` * * `sensitivity_level desc` * Supported fields are: - * - `project_id`: GCP project ID + * - `project_id`: Google Cloud project ID * - `sensitivity_level`: How sensitive the data in a project is, at most. * - `data_risk_level`: How much risk is associated with this data. * - `profile_last_generated`: When the profile was last updated in epoch @@ -228,7 +228,7 @@ public function setPageSize($var) * * `project_id` * * `sensitivity_level desc` * Supported fields are: - * - `project_id`: GCP project ID + * - `project_id`: Google Cloud project ID * - `sensitivity_level`: How sensitive the data in a project is, at most. * - `data_risk_level`: How much risk is associated with this data. * - `profile_last_generated`: When the profile was last updated in epoch @@ -251,7 +251,7 @@ public function getOrderBy() * * `project_id` * * `sensitivity_level desc` * Supported fields are: - * - `project_id`: GCP project ID + * - `project_id`: Google Cloud project ID * - `sensitivity_level`: How sensitive the data in a project is, at most. * - `data_risk_level`: How much risk is associated with this data. * - `profile_last_generated`: When the profile was last updated in epoch diff --git a/Dlp/src/V2/ListTableDataProfilesRequest.php b/Dlp/src/V2/ListTableDataProfilesRequest.php index 4091b09ffe6c..6d12a494d45f 100644 --- a/Dlp/src/V2/ListTableDataProfilesRequest.php +++ b/Dlp/src/V2/ListTableDataProfilesRequest.php @@ -46,7 +46,7 @@ class ListTableDataProfilesRequest extends \Google\Protobuf\Internal\Message * * `table_id` * * `sensitivity_level desc` * Supported fields are: - * - `project_id`: The GCP project ID. + * - `project_id`: The Google Cloud project ID. * - `dataset_id`: The ID of a BigQuery dataset. * - `table_id`: The ID of a BigQuery table. * - `sensitivity_level`: How sensitive the data in a table is, at most. @@ -68,7 +68,7 @@ class ListTableDataProfilesRequest extends \Google\Protobuf\Internal\Message * sequence of restrictions implicitly uses `AND`. * * A restriction has the form of `{field} {operator} {value}`. * * Supported fields/values: - * - `project_id` - The GCP project ID. + * - `project_id` - The Google Cloud project ID. * - `dataset_id` - The BigQuery dataset ID. * - `table_id` - The ID of the BigQuery table. * - `sensitivity_level` - HIGH|MODERATE|LOW @@ -128,7 +128,7 @@ public static function build(string $parent): self * * `table_id` * * `sensitivity_level desc` * Supported fields are: - * - `project_id`: The GCP project ID. + * - `project_id`: The Google Cloud project ID. * - `dataset_id`: The ID of a BigQuery dataset. * - `table_id`: The ID of a BigQuery table. * - `sensitivity_level`: How sensitive the data in a table is, at most. @@ -146,7 +146,7 @@ public static function build(string $parent): self * sequence of restrictions implicitly uses `AND`. * * A restriction has the form of `{field} {operator} {value}`. * * Supported fields/values: - * - `project_id` - The GCP project ID. + * - `project_id` - The Google Cloud project ID. * - `dataset_id` - The BigQuery dataset ID. * - `table_id` - The ID of the BigQuery table. * - `sensitivity_level` - HIGH|MODERATE|LOW @@ -261,7 +261,7 @@ public function setPageSize($var) * * `table_id` * * `sensitivity_level desc` * Supported fields are: - * - `project_id`: The GCP project ID. + * - `project_id`: The Google Cloud project ID. * - `dataset_id`: The ID of a BigQuery dataset. * - `table_id`: The ID of a BigQuery table. * - `sensitivity_level`: How sensitive the data in a table is, at most. @@ -290,7 +290,7 @@ public function getOrderBy() * * `table_id` * * `sensitivity_level desc` * Supported fields are: - * - `project_id`: The GCP project ID. + * - `project_id`: The Google Cloud project ID. * - `dataset_id`: The ID of a BigQuery dataset. * - `table_id`: The ID of a BigQuery table. * - `sensitivity_level`: How sensitive the data in a table is, at most. @@ -321,7 +321,7 @@ public function setOrderBy($var) * sequence of restrictions implicitly uses `AND`. * * A restriction has the form of `{field} {operator} {value}`. * * Supported fields/values: - * - `project_id` - The GCP project ID. + * - `project_id` - The Google Cloud project ID. * - `dataset_id` - The BigQuery dataset ID. * - `table_id` - The ID of the BigQuery table. * - `sensitivity_level` - HIGH|MODERATE|LOW @@ -352,7 +352,7 @@ public function getFilter() * sequence of restrictions implicitly uses `AND`. * * A restriction has the form of `{field} {operator} {value}`. * * Supported fields/values: - * - `project_id` - The GCP project ID. + * - `project_id` - The Google Cloud project ID. * - `dataset_id` - The BigQuery dataset ID. * - `table_id` - The ID of the BigQuery table. * - `sensitivity_level` - HIGH|MODERATE|LOW diff --git a/Dlp/src/V2/ResourceVisibility.php b/Dlp/src/V2/ResourceVisibility.php index 5094fa621fd7..091e4e5299f2 100644 --- a/Dlp/src/V2/ResourceVisibility.php +++ b/Dlp/src/V2/ResourceVisibility.php @@ -26,6 +26,14 @@ class ResourceVisibility * Generated from protobuf enum RESOURCE_VISIBILITY_PUBLIC = 10; */ const RESOURCE_VISIBILITY_PUBLIC = 10; + /** + * May contain public items. + * For example, if a Cloud Storage bucket has uniform bucket level access + * disabled, some objects inside it may be public. + * + * Generated from protobuf enum RESOURCE_VISIBILITY_INCONCLUSIVE = 15; + */ + const RESOURCE_VISIBILITY_INCONCLUSIVE = 15; /** * Visible only to specific users. * @@ -36,6 +44,7 @@ class ResourceVisibility private static $valueToName = [ self::RESOURCE_VISIBILITY_UNSPECIFIED => 'RESOURCE_VISIBILITY_UNSPECIFIED', self::RESOURCE_VISIBILITY_PUBLIC => 'RESOURCE_VISIBILITY_PUBLIC', + self::RESOURCE_VISIBILITY_INCONCLUSIVE => 'RESOURCE_VISIBILITY_INCONCLUSIVE', self::RESOURCE_VISIBILITY_RESTRICTED => 'RESOURCE_VISIBILITY_RESTRICTED', ]; diff --git a/Dlp/src/V2/SearchConnectionsRequest.php b/Dlp/src/V2/SearchConnectionsRequest.php new file mode 100644 index 000000000000..0a7adbc09c6b --- /dev/null +++ b/Dlp/src/V2/SearchConnectionsRequest.php @@ -0,0 +1,192 @@ +google.privacy.dlp.v2.SearchConnectionsRequest + */ +class SearchConnectionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent name, typically an organization, without location. + * For example: `organizations/12345678`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Optional. Number of results per page, max 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_size = 0; + /** + * Optional. Page token from a previous page to return the next set of + * results. If set, all other request fields must match the original request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_token = ''; + /** + * Optional. Supported field/value: - `state` - MISSING|AVAILABLE|ERROR + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter = ''; + + /** + * @param string $parent Required. Parent name, typically an organization, without location. + * For example: `organizations/12345678`. Please see + * {@see DlpServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Dlp\V2\SearchConnectionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent name, typically an organization, without location. + * For example: `organizations/12345678`. + * @type int $page_size + * Optional. Number of results per page, max 1000. + * @type string $page_token + * Optional. Page token from a previous page to return the next set of + * results. If set, all other request fields must match the original request. + * @type string $filter + * Optional. Supported field/value: - `state` - MISSING|AVAILABLE|ERROR + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent name, typically an organization, without location. + * For example: `organizations/12345678`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent name, typically an organization, without location. + * For example: `organizations/12345678`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Number of results per page, max 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Number of results per page, max 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Page token from a previous page to return the next set of + * results. If set, all other request fields must match the original request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Page token from a previous page to return the next set of + * results. If set, all other request fields must match the original request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Supported field/value: - `state` - MISSING|AVAILABLE|ERROR + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Supported field/value: - `state` - MISSING|AVAILABLE|ERROR + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/SearchConnectionsResponse.php b/Dlp/src/V2/SearchConnectionsResponse.php new file mode 100644 index 000000000000..18736b747d98 --- /dev/null +++ b/Dlp/src/V2/SearchConnectionsResponse.php @@ -0,0 +1,113 @@ +google.privacy.dlp.v2.SearchConnectionsResponse + */ +class SearchConnectionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of connections that match the search query. Note that only a subset + * of the fields will be populated, and only "name" is guaranteed to be set. + * For full details of a Connection, call GetConnection with the name. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.Connection connections = 1; + */ + private $connections; + /** + * Token to retrieve the next page of results. An empty value means there are + * no more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dlp\V2\Connection>|\Google\Protobuf\Internal\RepeatedField $connections + * List of connections that match the search query. Note that only a subset + * of the fields will be populated, and only "name" is guaranteed to be set. + * For full details of a Connection, call GetConnection with the name. + * @type string $next_page_token + * Token to retrieve the next page of results. An empty value means there are + * no more results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * List of connections that match the search query. Note that only a subset + * of the fields will be populated, and only "name" is guaranteed to be set. + * For full details of a Connection, call GetConnection with the name. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.Connection connections = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnections() + { + return $this->connections; + } + + /** + * List of connections that match the search query. Note that only a subset + * of the fields will be populated, and only "name" is guaranteed to be set. + * For full details of a Connection, call GetConnection with the name. + * + * Generated from protobuf field repeated .google.privacy.dlp.v2.Connection connections = 1; + * @param array<\Google\Cloud\Dlp\V2\Connection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\Connection::class); + $this->connections = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results. An empty value means there are + * no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results. An empty value means there are + * no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/SecretManagerCredential.php b/Dlp/src/V2/SecretManagerCredential.php new file mode 100644 index 000000000000..680f67db3e63 --- /dev/null +++ b/Dlp/src/V2/SecretManagerCredential.php @@ -0,0 +1,108 @@ +google.privacy.dlp.v2.SecretManagerCredential + */ +class SecretManagerCredential extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The username. + * + * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $username = ''; + /** + * Required. The name of the Secret Manager resource that stores the password, + * in the form `projects/project-id/secrets/secret-name/versions/version`. + * + * Generated from protobuf field string password_secret_version_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $password_secret_version_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $username + * Required. The username. + * @type string $password_secret_version_name + * Required. The name of the Secret Manager resource that stores the password, + * in the form `projects/project-id/secrets/secret-name/versions/version`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. The username. + * + * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Required. The username. + * + * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + + /** + * Required. The name of the Secret Manager resource that stores the password, + * in the form `projects/project-id/secrets/secret-name/versions/version`. + * + * Generated from protobuf field string password_secret_version_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPasswordSecretVersionName() + { + return $this->password_secret_version_name; + } + + /** + * Required. The name of the Secret Manager resource that stores the password, + * in the form `projects/project-id/secrets/secret-name/versions/version`. + * + * Generated from protobuf field string password_secret_version_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPasswordSecretVersionName($var) + { + GPBUtil::checkString($var, True); + $this->password_secret_version_name = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/SecretsDiscoveryTarget.php b/Dlp/src/V2/SecretsDiscoveryTarget.php new file mode 100644 index 000000000000..1e5a804a0f78 --- /dev/null +++ b/Dlp/src/V2/SecretsDiscoveryTarget.php @@ -0,0 +1,41 @@ +google.privacy.dlp.v2.SecretsDiscoveryTarget + */ +class SecretsDiscoveryTarget extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Dlp/src/V2/StorageConfig/TimespanConfig.php b/Dlp/src/V2/StorageConfig/TimespanConfig.php index 5732359228ac..26986cae0ae9 100644 --- a/Dlp/src/V2/StorageConfig/TimespanConfig.php +++ b/Dlp/src/V2/StorageConfig/TimespanConfig.php @@ -69,6 +69,14 @@ class TimespanConfig extends \Google\Protobuf\Internal\Message * since the last time the JobTrigger executed. This will be based on the * time of the execution of the last run of the JobTrigger or the timespan * end_time used in the last run of the JobTrigger. + * **For BigQuery** + * Inspect jobs triggered by automatic population will scan data that is at + * least three hours old when the job starts. This is because streaming + * buffer rows are not read during inspection and reading up to the current + * timestamp will result in skipped rows. + * See the [known + * issue](https://cloud.google.com/sensitive-data-protection/docs/known-issues#recently-streamed-data) + * related to this operation. * * Generated from protobuf field bool enable_auto_population_of_timespan_config = 4; */ @@ -121,6 +129,14 @@ class TimespanConfig extends \Google\Protobuf\Internal\Message * since the last time the JobTrigger executed. This will be based on the * time of the execution of the last run of the JobTrigger or the timespan * end_time used in the last run of the JobTrigger. + * **For BigQuery** + * Inspect jobs triggered by automatic population will scan data that is at + * least three hours old when the job starts. This is because streaming + * buffer rows are not read during inspection and reading up to the current + * timestamp will result in skipped rows. + * See the [known + * issue](https://cloud.google.com/sensitive-data-protection/docs/known-issues#recently-streamed-data) + * related to this operation. * } */ public function __construct($data = NULL) { @@ -300,6 +316,14 @@ public function setTimestampField($var) * since the last time the JobTrigger executed. This will be based on the * time of the execution of the last run of the JobTrigger or the timespan * end_time used in the last run of the JobTrigger. + * **For BigQuery** + * Inspect jobs triggered by automatic population will scan data that is at + * least three hours old when the job starts. This is because streaming + * buffer rows are not read during inspection and reading up to the current + * timestamp will result in skipped rows. + * See the [known + * issue](https://cloud.google.com/sensitive-data-protection/docs/known-issues#recently-streamed-data) + * related to this operation. * * Generated from protobuf field bool enable_auto_population_of_timespan_config = 4; * @return bool @@ -315,6 +339,14 @@ public function getEnableAutoPopulationOfTimespanConfig() * since the last time the JobTrigger executed. This will be based on the * time of the execution of the last run of the JobTrigger or the timespan * end_time used in the last run of the JobTrigger. + * **For BigQuery** + * Inspect jobs triggered by automatic population will scan data that is at + * least three hours old when the job starts. This is because streaming + * buffer rows are not read during inspection and reading up to the current + * timestamp will result in skipped rows. + * See the [known + * issue](https://cloud.google.com/sensitive-data-protection/docs/known-issues#recently-streamed-data) + * related to this operation. * * Generated from protobuf field bool enable_auto_population_of_timespan_config = 4; * @param bool $var diff --git a/Dlp/src/V2/TableReference.php b/Dlp/src/V2/TableReference.php new file mode 100644 index 000000000000..ac8f92322b63 --- /dev/null +++ b/Dlp/src/V2/TableReference.php @@ -0,0 +1,102 @@ +google.privacy.dlp.v2.TableReference + */ +class TableReference extends \Google\Protobuf\Internal\Message +{ + /** + * Dataset ID of the table. + * + * Generated from protobuf field string dataset_id = 1; + */ + private $dataset_id = ''; + /** + * Name of the table. + * + * Generated from protobuf field string table_id = 2; + */ + private $table_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset_id + * Dataset ID of the table. + * @type string $table_id + * Name of the table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Dataset ID of the table. + * + * Generated from protobuf field string dataset_id = 1; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Dataset ID of the table. + * + * Generated from protobuf field string dataset_id = 1; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * Name of the table. + * + * Generated from protobuf field string table_id = 2; + * @return string + */ + public function getTableId() + { + return $this->table_id; + } + + /** + * Name of the table. + * + * Generated from protobuf field string table_id = 2; + * @param string $var + * @return $this + */ + public function setTableId($var) + { + GPBUtil::checkString($var, True); + $this->table_id = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/UpdateConnectionRequest.php b/Dlp/src/V2/UpdateConnectionRequest.php new file mode 100644 index 000000000000..f78d2bae87af --- /dev/null +++ b/Dlp/src/V2/UpdateConnectionRequest.php @@ -0,0 +1,174 @@ +google.privacy.dlp.v2.UpdateConnectionRequest + */ +class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + /** + * Required. The connection with new values for the relevant fields. + * + * Generated from protobuf field .google.privacy.dlp.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $connection = null; + /** + * Optional. Mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $update_mask = null; + + /** + * @param string $name Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. Please see + * {@see DlpServiceClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\Dlp\V2\UpdateConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * @type \Google\Cloud\Dlp\V2\Connection $connection + * Required. The connection with new values for the relevant fields. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name in the format: + * `projects/{project}/locations/{location}/connections/{connection}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The connection with new values for the relevant fields. + * + * Generated from protobuf field .google.privacy.dlp.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dlp\V2\Connection|null + */ + public function getConnection() + { + return $this->connection; + } + + public function hasConnection() + { + return isset($this->connection); + } + + public function clearConnection() + { + unset($this->connection); + } + + /** + * Required. The connection with new values for the relevant fields. + * + * Generated from protobuf field .google.privacy.dlp.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dlp\V2\Connection $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Connection::class); + $this->connection = $var; + + return $this; + } + + /** + * Optional. Mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/Dlp/src/V2/gapic_metadata.json b/Dlp/src/V2/gapic_metadata.json index 7635b41e01ba..57d81805f598 100644 --- a/Dlp/src/V2/gapic_metadata.json +++ b/Dlp/src/V2/gapic_metadata.json @@ -20,6 +20,11 @@ "cancelDlpJob" ] }, + "CreateConnection": { + "methods": [ + "createConnection" + ] + }, "CreateDeidentifyTemplate": { "methods": [ "createDeidentifyTemplate" @@ -55,6 +60,11 @@ "deidentifyContent" ] }, + "DeleteConnection": { + "methods": [ + "deleteConnection" + ] + }, "DeleteDeidentifyTemplate": { "methods": [ "deleteDeidentifyTemplate" @@ -85,6 +95,11 @@ "deleteStoredInfoType" ] }, + "DeleteTableDataProfile": { + "methods": [ + "deleteTableDataProfile" + ] + }, "FinishDlpJob": { "methods": [ "finishDlpJob" @@ -95,6 +110,11 @@ "getColumnDataProfile" ] }, + "GetConnection": { + "methods": [ + "getConnection" + ] + }, "GetDeidentifyTemplate": { "methods": [ "getDeidentifyTemplate" @@ -155,6 +175,11 @@ "listColumnDataProfiles" ] }, + "ListConnections": { + "methods": [ + "listConnections" + ] + }, "ListDeidentifyTemplates": { "methods": [ "listDeidentifyTemplates" @@ -210,6 +235,16 @@ "reidentifyContent" ] }, + "SearchConnections": { + "methods": [ + "searchConnections" + ] + }, + "UpdateConnection": { + "methods": [ + "updateConnection" + ] + }, "UpdateDeidentifyTemplate": { "methods": [ "updateDeidentifyTemplate" diff --git a/Dlp/src/V2/resources/dlp_service_client_config.json b/Dlp/src/V2/resources/dlp_service_client_config.json index 983ae181e6b0..78363c7bd2aa 100644 --- a/Dlp/src/V2/resources/dlp_service_client_config.json +++ b/Dlp/src/V2/resources/dlp_service_client_config.json @@ -49,6 +49,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "CreateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "CreateDeidentifyTemplate": { "timeout_millis": 300000, "retry_codes_name": "no_retry_1_codes", @@ -84,6 +89,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "DeleteConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "DeleteDeidentifyTemplate": { "timeout_millis": 300000, "retry_codes_name": "retry_policy_1_codes", @@ -114,6 +124,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "DeleteTableDataProfile": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "FinishDlpJob": { "timeout_millis": 300000, "retry_codes_name": "no_retry_1_codes", @@ -124,6 +139,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetDeidentifyTemplate": { "timeout_millis": 300000, "retry_codes_name": "retry_policy_1_codes", @@ -184,6 +204,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListConnections": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "ListDeidentifyTemplates": { "timeout_millis": 300000, "retry_codes_name": "retry_policy_1_codes", @@ -239,6 +264,16 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "SearchConnections": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "UpdateDeidentifyTemplate": { "timeout_millis": 300000, "retry_codes_name": "no_retry_1_codes", diff --git a/Dlp/src/V2/resources/dlp_service_descriptor_config.php b/Dlp/src/V2/resources/dlp_service_descriptor_config.php index 515aea5bc9a7..0ce9d36ad4b5 100644 --- a/Dlp/src/V2/resources/dlp_service_descriptor_config.php +++ b/Dlp/src/V2/resources/dlp_service_descriptor_config.php @@ -47,6 +47,18 @@ ], ], ], + 'CreateConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dlp\V2\Connection', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateDeidentifyTemplate' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Dlp\V2\DeidentifyTemplate', @@ -131,6 +143,18 @@ ], ], ], + 'DeleteConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteDeidentifyTemplate' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Protobuf\GPBEmpty', @@ -203,6 +227,18 @@ ], ], ], + 'DeleteTableDataProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'FinishDlpJob' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Protobuf\GPBEmpty', @@ -227,6 +263,18 @@ ], ], ], + 'GetConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dlp\V2\Connection', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetDeidentifyTemplate' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Dlp\V2\DeidentifyTemplate', @@ -379,6 +427,26 @@ ], ], ], + 'ListConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConnections', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dlp\V2\ListConnectionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListDeidentifyTemplates' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -575,6 +643,38 @@ ], ], ], + 'SearchConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConnections', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dlp\V2\SearchConnectionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dlp\V2\Connection', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'UpdateDeidentifyTemplate' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Dlp\V2\DeidentifyTemplate', @@ -637,6 +737,7 @@ ], 'templateMap' => [ 'columnDataProfile' => 'organizations/{organization}/locations/{location}/columnDataProfiles/{column_data_profile}', + 'connection' => 'projects/{project}/locations/{location}/connections/{connection}', 'deidentifyTemplate' => 'organizations/{organization}/deidentifyTemplates/{deidentify_template}', 'discoveryConfig' => 'projects/{project}/locations/{location}/discoveryConfigs/{discovery_config}', 'dlpJob' => 'projects/{project}/dlpJobs/{dlp_job}', diff --git a/Dlp/src/V2/resources/dlp_service_rest_client_config.php b/Dlp/src/V2/resources/dlp_service_rest_client_config.php index fe53b1b2fad3..e2def05b8c3b 100644 --- a/Dlp/src/V2/resources/dlp_service_rest_client_config.php +++ b/Dlp/src/V2/resources/dlp_service_rest_client_config.php @@ -61,6 +61,18 @@ ], ], ], + 'CreateConnection' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/connections', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'CreateDeidentifyTemplate' => [ 'method' => 'post', 'uriTemplate' => '/v2/{parent=organizations/*}/deidentifyTemplates', @@ -229,6 +241,17 @@ ], ], ], + 'DeleteConnection' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/connections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteDeidentifyTemplate' => [ 'method' => 'delete', 'uriTemplate' => '/v2/{name=organizations/*/deidentifyTemplates/*}', @@ -359,6 +382,23 @@ ], ], ], + 'DeleteTableDataProfile' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/tableDataProfiles/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/tableDataProfiles/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'FinishDlpJob' => [ 'method' => 'post', 'uriTemplate' => '/v2/{name=projects/*/locations/*/dlpJobs/*}:finish', @@ -388,6 +428,17 @@ ], ], ], + 'GetConnection' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/connections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetDeidentifyTemplate' => [ 'method' => 'get', 'uriTemplate' => '/v2/{name=organizations/*/deidentifyTemplates/*}', @@ -612,6 +663,17 @@ ], ], ], + 'ListConnections' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/connections', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListDeidentifyTemplates' => [ 'method' => 'get', 'uriTemplate' => '/v2/{parent=organizations/*}/deidentifyTemplates', @@ -835,6 +897,35 @@ ], ], ], + 'SearchConnections' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/connections:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*}/connections:search', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateConnection' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/connections/*}', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'UpdateDeidentifyTemplate' => [ 'method' => 'patch', 'uriTemplate' => '/v2/{name=organizations/*/deidentifyTemplates/*}', diff --git a/Dlp/tests/Unit/V2/Client/DlpServiceClientTest.php b/Dlp/tests/Unit/V2/Client/DlpServiceClientTest.php index 6707ab648596..165f09aa9468 100644 --- a/Dlp/tests/Unit/V2/Client/DlpServiceClientTest.php +++ b/Dlp/tests/Unit/V2/Client/DlpServiceClientTest.php @@ -30,6 +30,9 @@ use Google\Cloud\Dlp\V2\CancelDlpJobRequest; use Google\Cloud\Dlp\V2\Client\DlpServiceClient; use Google\Cloud\Dlp\V2\ColumnDataProfile; +use Google\Cloud\Dlp\V2\Connection; +use Google\Cloud\Dlp\V2\ConnectionState; +use Google\Cloud\Dlp\V2\CreateConnectionRequest; use Google\Cloud\Dlp\V2\CreateDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\CreateDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\CreateDlpJobRequest; @@ -39,17 +42,20 @@ use Google\Cloud\Dlp\V2\DeidentifyContentRequest; use Google\Cloud\Dlp\V2\DeidentifyContentResponse; use Google\Cloud\Dlp\V2\DeidentifyTemplate; +use Google\Cloud\Dlp\V2\DeleteConnectionRequest; use Google\Cloud\Dlp\V2\DeleteDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\DeleteDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\DeleteDlpJobRequest; use Google\Cloud\Dlp\V2\DeleteInspectTemplateRequest; use Google\Cloud\Dlp\V2\DeleteJobTriggerRequest; use Google\Cloud\Dlp\V2\DeleteStoredInfoTypeRequest; +use Google\Cloud\Dlp\V2\DeleteTableDataProfileRequest; use Google\Cloud\Dlp\V2\DiscoveryConfig; use Google\Cloud\Dlp\V2\DiscoveryConfig\Status; use Google\Cloud\Dlp\V2\DlpJob; use Google\Cloud\Dlp\V2\FinishDlpJobRequest; use Google\Cloud\Dlp\V2\GetColumnDataProfileRequest; +use Google\Cloud\Dlp\V2\GetConnectionRequest; use Google\Cloud\Dlp\V2\GetDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\GetDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\GetDlpJobRequest; @@ -67,6 +73,8 @@ use Google\Cloud\Dlp\V2\JobTrigger; use Google\Cloud\Dlp\V2\ListColumnDataProfilesRequest; use Google\Cloud\Dlp\V2\ListColumnDataProfilesResponse; +use Google\Cloud\Dlp\V2\ListConnectionsRequest; +use Google\Cloud\Dlp\V2\ListConnectionsResponse; use Google\Cloud\Dlp\V2\ListDeidentifyTemplatesRequest; use Google\Cloud\Dlp\V2\ListDeidentifyTemplatesResponse; use Google\Cloud\Dlp\V2\ListDiscoveryConfigsRequest; @@ -90,9 +98,12 @@ use Google\Cloud\Dlp\V2\RedactImageResponse; use Google\Cloud\Dlp\V2\ReidentifyContentRequest; use Google\Cloud\Dlp\V2\ReidentifyContentResponse; +use Google\Cloud\Dlp\V2\SearchConnectionsRequest; +use Google\Cloud\Dlp\V2\SearchConnectionsResponse; use Google\Cloud\Dlp\V2\StoredInfoType; use Google\Cloud\Dlp\V2\StoredInfoTypeConfig; use Google\Cloud\Dlp\V2\TableDataProfile; +use Google\Cloud\Dlp\V2\UpdateConnectionRequest; use Google\Cloud\Dlp\V2\UpdateDeidentifyTemplateRequest; use Google\Cloud\Dlp\V2\UpdateDiscoveryConfigRequest; use Google\Cloud\Dlp\V2\UpdateInspectTemplateRequest; @@ -257,6 +268,80 @@ public function cancelDlpJobExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function createConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + $connection->setState($connectionState); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnection($connection); + $response = $gapicClient->createConnection($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/CreateConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + $connection->setState($connectionState); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnection($connection); + try { + $gapicClient->createConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function createDeidentifyTemplateTest() { @@ -749,6 +834,67 @@ public function deidentifyContentExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function deleteConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new DeleteConnectionRequest()) + ->setName($formattedName); + $gapicClient->deleteConnection($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/DeleteConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new DeleteConnectionRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function deleteDeidentifyTemplateTest() { @@ -1115,6 +1261,67 @@ public function deleteStoredInfoTypeExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function deleteTableDataProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tableDataProfileName('[ORGANIZATION]', '[LOCATION]', '[TABLE_DATA_PROFILE]'); + $request = (new DeleteTableDataProfileRequest()) + ->setName($formattedName); + $gapicClient->deleteTableDataProfile($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/DeleteTableDataProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTableDataProfileExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableDataProfileName('[ORGANIZATION]', '[LOCATION]', '[TABLE_DATA_PROFILE]'); + $request = (new DeleteTableDataProfileRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteTableDataProfile($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function finishDlpJobTest() { @@ -1256,6 +1463,70 @@ public function getColumnDataProfileExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new GetConnectionRequest()) + ->setName($formattedName); + $response = $gapicClient->getConnection($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/GetConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new GetConnectionRequest()) + ->setName($formattedName); + try { + $gapicClient->getConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getDeidentifyTemplateTest() { @@ -2056,6 +2327,78 @@ public function listColumnDataProfilesExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $connectionsElement = new Connection(); + $connections = [ + $connectionsElement, + ]; + $expectedResponse = new ListConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConnections($connections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConnectionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listConnections($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/ListConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConnectionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listConnections($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listDeidentifyTemplatesTest() { @@ -2806,6 +3149,152 @@ public function reidentifyContentExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function searchConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $connectionsElement = new Connection(); + $connections = [ + $connectionsElement, + ]; + $expectedResponse = new SearchConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConnections($connections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new SearchConnectionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->searchConnections($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/SearchConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new SearchConnectionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->searchConnections($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + $connection->setState($connectionState); + $request = (new UpdateConnectionRequest()) + ->setName($formattedName) + ->setConnection($connection); + $response = $gapicClient->updateConnection($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/UpdateConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + $connection->setState($connectionState); + $request = (new UpdateConnectionRequest()) + ->setName($formattedName) + ->setConnection($connection); + try { + $gapicClient->updateConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function updateDeidentifyTemplateTest() { diff --git a/Dlp/tests/Unit/V2/DlpServiceClientTest.php b/Dlp/tests/Unit/V2/DlpServiceClientTest.php index b2979244f6ca..aea29b7e536b 100644 --- a/Dlp/tests/Unit/V2/DlpServiceClientTest.php +++ b/Dlp/tests/Unit/V2/DlpServiceClientTest.php @@ -27,6 +27,8 @@ use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Dlp\V2\ColumnDataProfile; +use Google\Cloud\Dlp\V2\Connection; +use Google\Cloud\Dlp\V2\ConnectionState; use Google\Cloud\Dlp\V2\DeidentifyContentResponse; use Google\Cloud\Dlp\V2\DeidentifyTemplate; use Google\Cloud\Dlp\V2\DiscoveryConfig; @@ -38,6 +40,7 @@ use Google\Cloud\Dlp\V2\InspectTemplate; use Google\Cloud\Dlp\V2\JobTrigger; use Google\Cloud\Dlp\V2\ListColumnDataProfilesResponse; +use Google\Cloud\Dlp\V2\ListConnectionsResponse; use Google\Cloud\Dlp\V2\ListDeidentifyTemplatesResponse; use Google\Cloud\Dlp\V2\ListDiscoveryConfigsResponse; use Google\Cloud\Dlp\V2\ListDlpJobsResponse; @@ -50,6 +53,7 @@ use Google\Cloud\Dlp\V2\ProjectDataProfile; use Google\Cloud\Dlp\V2\RedactImageResponse; use Google\Cloud\Dlp\V2\ReidentifyContentResponse; +use Google\Cloud\Dlp\V2\SearchConnectionsResponse; use Google\Cloud\Dlp\V2\StoredInfoType; use Google\Cloud\Dlp\V2\StoredInfoTypeConfig; use Google\Cloud\Dlp\V2\TableDataProfile; @@ -204,6 +208,74 @@ public function cancelDlpJobExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function createConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + $connection->setState($connectionState); + $response = $gapicClient->createConnection($formattedParent, $connection); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/CreateConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + $connection->setState($connectionState); + try { + $gapicClient->createConnection($formattedParent, $connection); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function createDeidentifyTemplateTest() { @@ -660,6 +732,63 @@ public function deidentifyContentExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function deleteConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $gapicClient->deleteConnection($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/DeleteConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $gapicClient->deleteConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function deleteDeidentifyTemplateTest() { @@ -1002,6 +1131,63 @@ public function deleteStoredInfoTypeExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function deleteTableDataProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tableDataProfileName('[ORGANIZATION]', '[LOCATION]', '[TABLE_DATA_PROFILE]'); + $gapicClient->deleteTableDataProfile($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/DeleteTableDataProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTableDataProfileExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tableDataProfileName('[ORGANIZATION]', '[LOCATION]', '[TABLE_DATA_PROFILE]'); + try { + $gapicClient->deleteTableDataProfile($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function finishDlpJobTest() { @@ -1135,6 +1321,66 @@ public function getColumnDataProfileExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $response = $gapicClient->getConnection($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/GetConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $gapicClient->getConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getDeidentifyTemplateTest() { @@ -1889,6 +2135,74 @@ public function listColumnDataProfilesExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $connectionsElement = new Connection(); + $connections = [ + $connectionsElement, + ]; + $expectedResponse = new ListConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConnections($connections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listConnections($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/ListConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listConnections($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listDeidentifyTemplatesTest() { @@ -2599,6 +2913,142 @@ public function reidentifyContentExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function searchConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $connectionsElement = new Connection(); + $connections = [ + $connectionsElement, + ]; + $expectedResponse = new SearchConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConnections($connections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->searchConnections($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/SearchConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->searchConnections($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + $connection->setState($connectionState); + $response = $gapicClient->updateConnection($formattedName, $connection); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.privacy.dlp.v2.DlpService/UpdateConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $connectionState = ConnectionState::CONNECTION_STATE_UNSPECIFIED; + $connection->setState($connectionState); + try { + $gapicClient->updateConnection($formattedName, $connection); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function updateDeidentifyTemplateTest() { diff --git a/Dms/.repo-metadata.json b/Dms/.repo-metadata.json deleted file mode 100644 index 54aa50ae2465..000000000000 --- a/Dms/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-dms", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dms/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "datamigration" -} diff --git a/Dms/VERSION b/Dms/VERSION index 8af85beb5159..9075be495155 100644 --- a/Dms/VERSION +++ b/Dms/VERSION @@ -1 +1 @@ -1.5.3 +1.5.5 diff --git a/Dms/composer.json b/Dms/composer.json index 448bc358a929..6e9612ed4f7e 100644 --- a/Dms/composer.json +++ b/Dms/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/DocumentAi/.repo-metadata.json b/DocumentAi/.repo-metadata.json deleted file mode 100644 index 9bbe2f363515..000000000000 --- a/DocumentAi/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-document-ai", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-document-ai/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "documentai" -} diff --git a/DocumentAi/VERSION b/DocumentAi/VERSION index 0eed1a29efd6..feaae22bac7e 100644 --- a/DocumentAi/VERSION +++ b/DocumentAi/VERSION @@ -1 +1 @@ -1.12.0 +1.13.0 diff --git a/DocumentAi/composer.json b/DocumentAi/composer.json index 2fda0e751122..8a563398b7ec 100644 --- a/DocumentAi/composer.json +++ b/DocumentAi/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/DocumentAi/metadata/V1/Document.php b/DocumentAi/metadata/V1/Document.php index a1af7ec3b38716dff1149cdd795502064e71ff16..152f7b5e639f008facefe03c4ed44df177e352e0 100644 GIT binary patch delta 1867 zcmb7^L2DC16vy2po0^x{#3|BcMJU!{v?T|rUc^hQHPliq+b_P>hHrtc+hoI zx36lmy-I3TNqn#NF4g_SEwTl9n_2Bs>iULbc39ijZg%fvmLEP3qgxmx+fcBM+wKXq z4Y^+<3raEjXtjF~_wG|f6Syr$`DD)Qe5y%!VnD?I%* z&(@#7Y)}yyAp{_R`)13>169H$V2rvp)?3vt703^jlH^t(B_1YJnd7TYlVU=KL@r21 zF4!I~SpTa)Av~#HWO4%8V`|#8Wwh9tG#1uiV?0uNK;U-RnJDKGvpWGQf$9)Nr$^;s z#xk3JgSndUQAR(P_1%@H)j+kV<4DnH-0E~Et@C{SL-YayEn=}E$6D>~czD;)@2$j$ zef#lV%b}O~v}iTxfauA~BXBP`phE^cp}&(JiZ(Y(TsZUqPgWTEyc=O9pFX6Z=5zNJ#lUSKwS`wd}pO==IF2Sk5sKISy zKKX!_^5h0?b|F0I$|Fi;MG%!cvQhGxPI=1i4u95_3}} z7!?>bIGvauIC4zZVu@jNo7~Rg$O_^!PqyST+Wd>fmC;y8ii@{6u_UuNEi<(^zM!gD vLI9|X1FQ;NE>l7fB)8d$Z5b2efz1y&<}+HLt0|V?!K0rSF1NXXi;oEa*vvbX delta 90 zcmV-g0Hyzk8jcyTA_D}X5(+AjODdC41GpaH2nrBTa&Kd0b8~NUR%LQ?X>V>43&O94TXj08cGdkQkM1O-I_vw;So0s)A#BMF}Yv-%1S0^hzH8~^|S diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php index a09cdc4702a2..0160bd39a744 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php @@ -34,7 +34,8 @@ * LRO endpoint to batch process many documents. The output is written * to Cloud Storage as JSON in the [Document] format. * - * @param string $name The resource name of [Processor][google.cloud.documentai.v1.Processor] or + * @param string $name The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/create_processor.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/create_processor.php index 4da1d5d88927..d43b36d2063f 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/create_processor.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/create_processor.php @@ -29,11 +29,12 @@ use Google\Cloud\DocumentAI\V1\Processor; /** - * Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. - * The processor will be at `ENABLED` state by default after its creation. + * Creates a processor from the + * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The + * processor will be at `ENABLED` state by default after its creation. * - * @param string $formattedParent The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * @param string $formattedParent The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` * Please see {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. */ function create_processor_sample(string $formattedParent): void diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php index 6ce9a0bd5bc0..6e97be55dcf5 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php @@ -34,7 +34,9 @@ * Evaluates a ProcessorVersion against annotated documents, producing an * Evaluation. * - * @param string $formattedProcessorVersion The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. + * @param string $formattedProcessorVersion The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * Please see {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. */ diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php index 8289f03e2441..ae701e7f169d 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php @@ -29,7 +29,8 @@ use Google\Cloud\DocumentAI\V1\FetchProcessorTypesResponse; /** - * Fetches processor types. Note that we don't use [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + * Fetches processor types. Note that we don't use + * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] * here, because it isn't paginated. * * @param string $formattedParent The location of processor types to list. diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/get_evaluation.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/get_evaluation.php index 93b7b12e58c2..5a9fd34e7829 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/get_evaluation.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/get_evaluation.php @@ -31,7 +31,8 @@ /** * Retrieves a specific evaluation. * - * @param string $formattedName The resource name of the [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * @param string $formattedName The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` * Please see {@see DocumentProcessorServiceClient::evaluationName()} for help formatting this field. */ diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_evaluations.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_evaluations.php index d9fd83952492..56204bee4cec 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_evaluations.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_evaluations.php @@ -32,7 +32,9 @@ /** * Retrieves a set of evaluations for a given processor version. * - * @param string $formattedParent The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. + * @param string $formattedParent The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * Please see {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. */ diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php index fdbc0e346d93..6f255e825eef 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php @@ -32,8 +32,9 @@ /** * Lists all versions of a processor. * - * @param string $formattedParent The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * @param string $formattedParent The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * Please see {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. */ function list_processor_versions_sample(string $formattedParent): void diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_processors.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_processors.php index 0aa0d1a6308b..8e44cb46fb8e 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_processors.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/list_processors.php @@ -32,8 +32,8 @@ /** * Lists all processors which belong to this project. * - * @param string $formattedParent The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * @param string $formattedParent The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * Please see {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. */ function list_processors_sample(string $formattedParent): void diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/process_document.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/process_document.php index b408215b09af..83301198db37 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/process_document.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/process_document.php @@ -31,11 +31,15 @@ /** * Processes a single document. * - * @param string $name The resource name of the [Processor][google.cloud.documentai.v1.Processor] or + * @param string $name The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use - * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` */ function process_document_sample(string $name): void diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/review_document.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/review_document.php index 432799e813f9..de14acf00be8 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/review_document.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/review_document.php @@ -34,8 +34,9 @@ * Send a document for Human Review. The input document should be processed by * the specified processor. * - * @param string $formattedHumanReviewConfig The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - * reviewed with. Please see + * @param string $formattedHumanReviewConfig The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. Please see * {@see DocumentProcessorServiceClient::humanReviewConfigName()} for help formatting this field. */ function review_document_sample(string $formattedHumanReviewConfig): void diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php index 14dc833f029c..4f6a0333c6bd 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php @@ -31,14 +31,19 @@ use Google\Rpc\Status; /** - * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in - * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and + * Set the default (active) version of a + * [Processor][google.cloud.documentai.v1.Processor] that will be used in + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + * and * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. * - * @param string $formattedProcessor The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version. Please see + * @param string $formattedProcessor The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. Please see * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. - * @param string $formattedDefaultProcessorVersion The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default. - * Format: + * @param string $formattedDefaultProcessorVersion The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` * Please see {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. */ diff --git a/DocumentAi/samples/V1/DocumentProcessorServiceClient/train_processor_version.php b/DocumentAi/samples/V1/DocumentProcessorServiceClient/train_processor_version.php index 001de10572ec..17d67c3e5d87 100644 --- a/DocumentAi/samples/V1/DocumentProcessorServiceClient/train_processor_version.php +++ b/DocumentAi/samples/V1/DocumentProcessorServiceClient/train_processor_version.php @@ -36,8 +36,9 @@ * Operation metadata is returned as * [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. * - * @param string $formattedParent The parent (project, location and processor) to create the new version for. - * Format: `projects/{project}/locations/{location}/processors/{processor}`. Please see + * @param string $formattedParent The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. Please see * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. */ function train_processor_version_sample(string $formattedParent): void diff --git a/DocumentAi/src/V1/BatchProcessMetadata/IndividualProcessStatus.php b/DocumentAi/src/V1/BatchProcessMetadata/IndividualProcessStatus.php index 49e03ee4c83c..c269b8a5cc9d 100644 --- a/DocumentAi/src/V1/BatchProcessMetadata/IndividualProcessStatus.php +++ b/DocumentAi/src/V1/BatchProcessMetadata/IndividualProcessStatus.php @@ -16,8 +16,9 @@ class IndividualProcessStatus extends \Google\Protobuf\Internal\Message { /** - * The source of the document, same as the [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] field in the - * request when the batch process started. + * The source of the document, same as the + * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] + * field in the request when the batch process started. * * Generated from protobuf field string input_gcs_source = 1; */ @@ -30,8 +31,8 @@ class IndividualProcessStatus extends \Google\Protobuf\Internal\Message private $status = null; /** * The Cloud Storage output destination (in the request as - * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) of the processed - * document if it was successful, otherwise empty. + * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + * of the processed document if it was successful, otherwise empty. * * Generated from protobuf field string output_gcs_destination = 3; */ @@ -50,14 +51,15 @@ class IndividualProcessStatus extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $input_gcs_source - * The source of the document, same as the [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] field in the - * request when the batch process started. + * The source of the document, same as the + * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] + * field in the request when the batch process started. * @type \Google\Rpc\Status $status * The status processing the document. * @type string $output_gcs_destination * The Cloud Storage output destination (in the request as - * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) of the processed - * document if it was successful, otherwise empty. + * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + * of the processed document if it was successful, otherwise empty. * @type \Google\Cloud\DocumentAI\V1\HumanReviewStatus $human_review_status * The status of human review on the processed document. * } @@ -68,8 +70,9 @@ public function __construct($data = NULL) { } /** - * The source of the document, same as the [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] field in the - * request when the batch process started. + * The source of the document, same as the + * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] + * field in the request when the batch process started. * * Generated from protobuf field string input_gcs_source = 1; * @return string @@ -80,8 +83,9 @@ public function getInputGcsSource() } /** - * The source of the document, same as the [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] field in the - * request when the batch process started. + * The source of the document, same as the + * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] + * field in the request when the batch process started. * * Generated from protobuf field string input_gcs_source = 1; * @param string $var @@ -133,8 +137,8 @@ public function setStatus($var) /** * The Cloud Storage output destination (in the request as - * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) of the processed - * document if it was successful, otherwise empty. + * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + * of the processed document if it was successful, otherwise empty. * * Generated from protobuf field string output_gcs_destination = 3; * @return string @@ -146,8 +150,8 @@ public function getOutputGcsDestination() /** * The Cloud Storage output destination (in the request as - * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) of the processed - * document if it was successful, otherwise empty. + * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + * of the processed document if it was successful, otherwise empty. * * Generated from protobuf field string output_gcs_destination = 3; * @param string $var diff --git a/DocumentAi/src/V1/BatchProcessRequest.php b/DocumentAi/src/V1/BatchProcessRequest.php index c97e6c96ae63..963bc1d14986 100644 --- a/DocumentAi/src/V1/BatchProcessRequest.php +++ b/DocumentAi/src/V1/BatchProcessRequest.php @@ -17,7 +17,8 @@ class BatchProcessRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + * Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or @@ -67,7 +68,8 @@ class BatchProcessRequest extends \Google\Protobuf\Internal\Message private $labels; /** - * @param string $name Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + * @param string $name Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or @@ -90,7 +92,8 @@ public static function build(string $name): self * Optional. Data for populating the Message object. * * @type string $name - * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + * Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or @@ -122,7 +125,8 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + * Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or @@ -137,7 +141,8 @@ public function getName() } /** - * Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + * Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or diff --git a/DocumentAi/src/V1/Client/DocumentProcessorServiceClient.php b/DocumentAi/src/V1/Client/DocumentProcessorServiceClient.php index 45299e42b25b..ee2355f5ef2e 100644 --- a/DocumentAi/src/V1/Client/DocumentProcessorServiceClient.php +++ b/DocumentAi/src/V1/Client/DocumentProcessorServiceClient.php @@ -436,8 +436,9 @@ public function batchProcessDocuments(BatchProcessRequest $request, array $callO } /** - * Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. - * The processor will be at `ENABLED` state by default after its creation. + * Creates a processor from the + * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The + * processor will be at `ENABLED` state by default after its creation. * * The async variant is * {@see DocumentProcessorServiceClient::createProcessorAsync()} . @@ -629,7 +630,8 @@ public function evaluateProcessorVersion(EvaluateProcessorVersionRequest $reques } /** - * Fetches processor types. Note that we don't use [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + * Fetches processor types. Note that we don't use + * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] * here, because it isn't paginated. * * The async variant is @@ -928,8 +930,10 @@ public function reviewDocument(ReviewDocumentRequest $request, array $callOption } /** - * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in - * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and + * Set the default (active) version of a + * [Processor][google.cloud.documentai.v1.Processor] that will be used in + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + * and * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. * * The async variant is diff --git a/DocumentAi/src/V1/CreateProcessorRequest.php b/DocumentAi/src/V1/CreateProcessorRequest.php index a3e8a6c7c008..c68fac4ebfb3 100644 --- a/DocumentAi/src/V1/CreateProcessorRequest.php +++ b/DocumentAi/src/V1/CreateProcessorRequest.php @@ -10,24 +10,28 @@ /** * Request message for the - * [CreateProcessor][google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor] method. Notice - * this request is sent to a regionalized backend service. If the - * [ProcessorType][google.cloud.documentai.v1.ProcessorType] isn't available in that region, the creation fails. + * [CreateProcessor][google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor] + * method. Notice this request is sent to a regionalized backend service. If the + * [ProcessorType][google.cloud.documentai.v1.ProcessorType] isn't available in + * that region, the creation fails. * * Generated from protobuf message google.cloud.documentai.v1.CreateProcessorRequest */ class CreateProcessorRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ private $parent = ''; /** - * Required. The processor to be created, requires [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] to be set. Also, the [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] * field must be set if the processor is under CMEK. * * Generated from protobuf field .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -35,11 +39,14 @@ class CreateProcessorRequest extends \Google\Protobuf\Internal\Message private $processor = null; /** - * @param string $parent Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * @param string $parent Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` * Please see {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. - * @param \Google\Cloud\DocumentAI\V1\Processor $processor Required. The processor to be created, requires [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] to be set. Also, the [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * @param \Google\Cloud\DocumentAI\V1\Processor $processor Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] * field must be set if the processor is under CMEK. * * @return \Google\Cloud\DocumentAI\V1\CreateProcessorRequest @@ -60,11 +67,14 @@ public static function build(string $parent, \Google\Cloud\DocumentAI\V1\Process * Optional. Data for populating the Message object. * * @type string $parent - * Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` * @type \Google\Cloud\DocumentAI\V1\Processor $processor - * Required. The processor to be created, requires [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] to be set. Also, the [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] * field must be set if the processor is under CMEK. * } */ @@ -74,8 +84,8 @@ public function __construct($data = NULL) { } /** - * Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -86,8 +96,8 @@ public function getParent() } /** - * Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -102,8 +112,11 @@ public function setParent($var) } /** - * Required. The processor to be created, requires [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] to be set. Also, the [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] * field must be set if the processor is under CMEK. * * Generated from protobuf field .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -125,8 +138,11 @@ public function clearProcessor() } /** - * Required. The processor to be created, requires [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] to be set. Also, the [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] * field must be set if the processor is under CMEK. * * Generated from protobuf field .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/DocumentAi/src/V1/DeleteProcessorMetadata.php b/DocumentAi/src/V1/DeleteProcessorMetadata.php index 0c4a43a40dbf..95359c1f8ea2 100644 --- a/DocumentAi/src/V1/DeleteProcessorMetadata.php +++ b/DocumentAi/src/V1/DeleteProcessorMetadata.php @@ -10,7 +10,8 @@ /** * The long-running operation metadata for the - * [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor] method. + * [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor] + * method. * * Generated from protobuf message google.cloud.documentai.v1.DeleteProcessorMetadata */ diff --git a/DocumentAi/src/V1/DeleteProcessorRequest.php b/DocumentAi/src/V1/DeleteProcessorRequest.php index eb2d18fe3429..886e6f7d768b 100644 --- a/DocumentAi/src/V1/DeleteProcessorRequest.php +++ b/DocumentAi/src/V1/DeleteProcessorRequest.php @@ -10,7 +10,8 @@ /** * Request message for the - * [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor] method. + * [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor] + * method. * * Generated from protobuf message google.cloud.documentai.v1.DeleteProcessorRequest */ diff --git a/DocumentAi/src/V1/DisableProcessorMetadata.php b/DocumentAi/src/V1/DisableProcessorMetadata.php index 044c3e9c73b6..775058edf461 100644 --- a/DocumentAi/src/V1/DisableProcessorMetadata.php +++ b/DocumentAi/src/V1/DisableProcessorMetadata.php @@ -10,7 +10,8 @@ /** * The long-running operation metadata for the - * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] method. + * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] + * method. * * Generated from protobuf message google.cloud.documentai.v1.DisableProcessorMetadata */ diff --git a/DocumentAi/src/V1/DisableProcessorRequest.php b/DocumentAi/src/V1/DisableProcessorRequest.php index 575dfe00ec56..55e51e24d0de 100644 --- a/DocumentAi/src/V1/DisableProcessorRequest.php +++ b/DocumentAi/src/V1/DisableProcessorRequest.php @@ -10,7 +10,8 @@ /** * Request message for the - * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] method. + * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] + * method. * * Generated from protobuf message google.cloud.documentai.v1.DisableProcessorRequest */ diff --git a/DocumentAi/src/V1/DisableProcessorResponse.php b/DocumentAi/src/V1/DisableProcessorResponse.php index 5b1db499a5d0..f1f15d776735 100644 --- a/DocumentAi/src/V1/DisableProcessorResponse.php +++ b/DocumentAi/src/V1/DisableProcessorResponse.php @@ -10,8 +10,8 @@ /** * Response message for the - * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] method. - * Intentionally empty proto for adding fields in future. + * [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] + * method. Intentionally empty proto for adding fields in future. * * Generated from protobuf message google.cloud.documentai.v1.DisableProcessorResponse */ diff --git a/DocumentAi/src/V1/Document.php b/DocumentAi/src/V1/Document.php index 1d12d75d8d18..928e7816039e 100644 --- a/DocumentAi/src/V1/Document.php +++ b/DocumentAi/src/V1/Document.php @@ -45,22 +45,25 @@ class Document extends \Google\Protobuf\Internal\Message */ private $pages; /** - * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards, - * entities in this list may cross shard boundaries. + * A list of entities detected on + * [Document.text][google.cloud.documentai.v1.Document.text]. For document + * shards, entities in this list may cross shard boundaries. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity entities = 7; */ private $entities; /** - * Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities]. + * Placeholder. Relationship among + * [Document.entities][google.cloud.documentai.v1.Document.entities]. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; */ private $entity_relations; /** - * Placeholder. A list of text corrections made to [Document.text][google.cloud.documentai.v1.Document.text]. This - * is usually used for annotating corrections to OCR mistakes. Text changes - * for a given revision may not overlap with each other. + * Placeholder. A list of text corrections made to + * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually + * used for annotating corrections to OCR mistakes. Text changes for a given + * revision may not overlap with each other. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; */ @@ -84,6 +87,18 @@ class Document extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; */ private $revisions; + /** + * Parsed layout of the document. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17; + */ + private $document_layout = null; + /** + * Document chunked based on chunking config. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18; + */ + private $chunked_document = null; protected $source; /** @@ -111,14 +126,17 @@ class Document extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\DocumentAI\V1\Document\Page>|\Google\Protobuf\Internal\RepeatedField $pages * Visual page layout for the [Document][google.cloud.documentai.v1.Document]. * @type array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $entities - * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards, - * entities in this list may cross shard boundaries. + * A list of entities detected on + * [Document.text][google.cloud.documentai.v1.Document.text]. For document + * shards, entities in this list may cross shard boundaries. * @type array<\Google\Cloud\DocumentAI\V1\Document\EntityRelation>|\Google\Protobuf\Internal\RepeatedField $entity_relations - * Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities]. + * Placeholder. Relationship among + * [Document.entities][google.cloud.documentai.v1.Document.entities]. * @type array<\Google\Cloud\DocumentAI\V1\Document\TextChange>|\Google\Protobuf\Internal\RepeatedField $text_changes - * Placeholder. A list of text corrections made to [Document.text][google.cloud.documentai.v1.Document.text]. This - * is usually used for annotating corrections to OCR mistakes. Text changes - * for a given revision may not overlap with each other. + * Placeholder. A list of text corrections made to + * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually + * used for annotating corrections to OCR mistakes. Text changes for a given + * revision may not overlap with each other. * @type \Google\Cloud\DocumentAI\V1\Document\ShardInfo $shard_info * Information about the sharding if this document is sharded part of a larger * document. If the document is not sharded, this message is not specified. @@ -126,6 +144,10 @@ class Document extends \Google\Protobuf\Internal\Message * Any error that occurred while processing this document. * @type array<\Google\Cloud\DocumentAI\V1\Document\Revision>|\Google\Protobuf\Internal\RepeatedField $revisions * Placeholder. Revision history of this document. + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout $document_layout + * Parsed layout of the document. + * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument $chunked_document + * Document chunked based on chunking config. * } */ public function __construct($data = NULL) { @@ -316,8 +338,9 @@ public function setPages($var) } /** - * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards, - * entities in this list may cross shard boundaries. + * A list of entities detected on + * [Document.text][google.cloud.documentai.v1.Document.text]. For document + * shards, entities in this list may cross shard boundaries. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity entities = 7; * @return \Google\Protobuf\Internal\RepeatedField @@ -328,8 +351,9 @@ public function getEntities() } /** - * A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards, - * entities in this list may cross shard boundaries. + * A list of entities detected on + * [Document.text][google.cloud.documentai.v1.Document.text]. For document + * shards, entities in this list may cross shard boundaries. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity entities = 7; * @param array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $var @@ -344,7 +368,8 @@ public function setEntities($var) } /** - * Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities]. + * Placeholder. Relationship among + * [Document.entities][google.cloud.documentai.v1.Document.entities]. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; * @return \Google\Protobuf\Internal\RepeatedField @@ -355,7 +380,8 @@ public function getEntityRelations() } /** - * Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities]. + * Placeholder. Relationship among + * [Document.entities][google.cloud.documentai.v1.Document.entities]. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; * @param array<\Google\Cloud\DocumentAI\V1\Document\EntityRelation>|\Google\Protobuf\Internal\RepeatedField $var @@ -370,9 +396,10 @@ public function setEntityRelations($var) } /** - * Placeholder. A list of text corrections made to [Document.text][google.cloud.documentai.v1.Document.text]. This - * is usually used for annotating corrections to OCR mistakes. Text changes - * for a given revision may not overlap with each other. + * Placeholder. A list of text corrections made to + * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually + * used for annotating corrections to OCR mistakes. Text changes for a given + * revision may not overlap with each other. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; * @return \Google\Protobuf\Internal\RepeatedField @@ -383,9 +410,10 @@ public function getTextChanges() } /** - * Placeholder. A list of text corrections made to [Document.text][google.cloud.documentai.v1.Document.text]. This - * is usually used for annotating corrections to OCR mistakes. Text changes - * for a given revision may not overlap with each other. + * Placeholder. A list of text corrections made to + * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually + * used for annotating corrections to OCR mistakes. Text changes for a given + * revision may not overlap with each other. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; * @param array<\Google\Cloud\DocumentAI\V1\Document\TextChange>|\Google\Protobuf\Internal\RepeatedField $var @@ -499,6 +527,78 @@ public function setRevisions($var) return $this; } + /** + * Parsed layout of the document. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout|null + */ + public function getDocumentLayout() + { + return $this->document_layout; + } + + public function hasDocumentLayout() + { + return isset($this->document_layout); + } + + public function clearDocumentLayout() + { + unset($this->document_layout); + } + + /** + * Parsed layout of the document. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout $var + * @return $this + */ + public function setDocumentLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout::class); + $this->document_layout = $var; + + return $this; + } + + /** + * Document chunked based on chunking config. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18; + * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument|null + */ + public function getChunkedDocument() + { + return $this->chunked_document; + } + + public function hasChunkedDocument() + { + return isset($this->chunked_document); + } + + public function clearChunkedDocument() + { + unset($this->chunked_document); + } + + /** + * Document chunked based on chunking config. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18; + * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument $var + * @return $this + */ + public function setChunkedDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument::class); + $this->chunked_document = $var; + + return $this; + } + /** * @return string */ diff --git a/DocumentAi/src/V1/Document/ChunkedDocument.php b/DocumentAi/src/V1/Document/ChunkedDocument.php new file mode 100644 index 000000000000..93c66055751f --- /dev/null +++ b/DocumentAi/src/V1/Document/ChunkedDocument.php @@ -0,0 +1,68 @@ +google.cloud.documentai.v1.Document.ChunkedDocument + */ +class ChunkedDocument extends \Google\Protobuf\Internal\Message +{ + /** + * List of chunks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; + */ + private $chunks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk>|\Google\Protobuf\Internal\RepeatedField $chunks + * List of chunks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * List of chunks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChunks() + { + return $this->chunks; + } + + /** + * List of chunks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChunks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk::class); + $this->chunks = $arr; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/ChunkedDocument/Chunk.php b/DocumentAi/src/V1/Document/ChunkedDocument/Chunk.php new file mode 100644 index 000000000000..afc1f2c765e6 --- /dev/null +++ b/DocumentAi/src/V1/Document/ChunkedDocument/Chunk.php @@ -0,0 +1,248 @@ +google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + */ +class Chunk extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the chunk. + * + * Generated from protobuf field string chunk_id = 1; + */ + private $chunk_id = ''; + /** + * Unused. + * + * Generated from protobuf field repeated string source_block_ids = 2; + */ + private $source_block_ids; + /** + * Text content of the chunk. + * + * Generated from protobuf field string content = 3; + */ + private $content = ''; + /** + * Page span of the chunk. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 4; + */ + private $page_span = null; + /** + * Page headers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader page_headers = 5; + */ + private $page_headers; + /** + * Page footers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter page_footers = 6; + */ + private $page_footers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $chunk_id + * ID of the chunk. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_block_ids + * Unused. + * @type string $content + * Text content of the chunk. + * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span + * Page span of the chunk. + * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageHeader>|\Google\Protobuf\Internal\RepeatedField $page_headers + * Page headers associated with the chunk. + * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageFooter>|\Google\Protobuf\Internal\RepeatedField $page_footers + * Page footers associated with the chunk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * ID of the chunk. + * + * Generated from protobuf field string chunk_id = 1; + * @return string + */ + public function getChunkId() + { + return $this->chunk_id; + } + + /** + * ID of the chunk. + * + * Generated from protobuf field string chunk_id = 1; + * @param string $var + * @return $this + */ + public function setChunkId($var) + { + GPBUtil::checkString($var, True); + $this->chunk_id = $var; + + return $this; + } + + /** + * Unused. + * + * Generated from protobuf field repeated string source_block_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceBlockIds() + { + return $this->source_block_ids; + } + + /** + * Unused. + * + * Generated from protobuf field repeated string source_block_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceBlockIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_block_ids = $arr; + + return $this; + } + + /** + * Text content of the chunk. + * + * Generated from protobuf field string content = 3; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Text content of the chunk. + * + * Generated from protobuf field string content = 3; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Page span of the chunk. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 4; + * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null + */ + public function getPageSpan() + { + return $this->page_span; + } + + public function hasPageSpan() + { + return isset($this->page_span); + } + + public function clearPageSpan() + { + unset($this->page_span); + } + + /** + * Page span of the chunk. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 4; + * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var + * @return $this + */ + public function setPageSpan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); + $this->page_span = $var; + + return $this; + } + + /** + * Page headers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader page_headers = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageHeaders() + { + return $this->page_headers; + } + + /** + * Page headers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader page_headers = 5; + * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageHeader::class); + $this->page_headers = $arr; + + return $this; + } + + /** + * Page footers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter page_footers = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageFooters() + { + return $this->page_footers; + } + + /** + * Page footers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter page_footers = 6; + * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageFooter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageFooters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageFooter::class); + $this->page_footers = $arr; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php b/DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php new file mode 100644 index 000000000000..13b0c3d1b1d2 --- /dev/null +++ b/DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php @@ -0,0 +1,112 @@ +google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + */ +class ChunkPageFooter extends \Google\Protobuf\Internal\Message +{ + /** + * Footer in text format. + * + * Generated from protobuf field string text = 1; + */ + private $text = ''; + /** + * Page span of the footer. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + */ + private $page_span = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Footer in text format. + * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span + * Page span of the footer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Footer in text format. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Footer in text format. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Page span of the footer. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null + */ + public function getPageSpan() + { + return $this->page_span; + } + + public function hasPageSpan() + { + return isset($this->page_span); + } + + public function clearPageSpan() + { + unset($this->page_span); + } + + /** + * Page span of the footer. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var + * @return $this + */ + public function setPageSpan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); + $this->page_span = $var; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php b/DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php new file mode 100644 index 000000000000..8637c32a5b2e --- /dev/null +++ b/DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php @@ -0,0 +1,112 @@ +google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + */ +class ChunkPageHeader extends \Google\Protobuf\Internal\Message +{ + /** + * Header in text format. + * + * Generated from protobuf field string text = 1; + */ + private $text = ''; + /** + * Page span of the header. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + */ + private $page_span = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Header in text format. + * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span + * Page span of the header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Header in text format. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Header in text format. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Page span of the header. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null + */ + public function getPageSpan() + { + return $this->page_span; + } + + public function hasPageSpan() + { + return isset($this->page_span); + } + + public function clearPageSpan() + { + unset($this->page_span); + } + + /** + * Page span of the header. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var + * @return $this + */ + public function setPageSpan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); + $this->page_span = $var; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php b/DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php new file mode 100644 index 000000000000..75a9e0af3172 --- /dev/null +++ b/DocumentAi/src/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php @@ -0,0 +1,102 @@ +google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + */ +class ChunkPageSpan extends \Google\Protobuf\Internal\Message +{ + /** + * Page where chunk starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + */ + private $page_start = 0; + /** + * Page where chunk ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + */ + private $page_end = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_start + * Page where chunk starts in the document. + * @type int $page_end + * Page where chunk ends in the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Page where chunk starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + * @return int + */ + public function getPageStart() + { + return $this->page_start; + } + + /** + * Page where chunk starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + * @param int $var + * @return $this + */ + public function setPageStart($var) + { + GPBUtil::checkInt32($var); + $this->page_start = $var; + + return $this; + } + + /** + * Page where chunk ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + * @return int + */ + public function getPageEnd() + { + return $this->page_end; + } + + /** + * Page where chunk ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + * @param int $var + * @return $this + */ + public function setPageEnd($var) + { + GPBUtil::checkInt32($var); + $this->page_end = $var; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/DocumentLayout.php b/DocumentAi/src/V1/Document/DocumentLayout.php new file mode 100644 index 000000000000..998131971580 --- /dev/null +++ b/DocumentAi/src/V1/Document/DocumentLayout.php @@ -0,0 +1,69 @@ +google.cloud.documentai.v1.Document.DocumentLayout + */ +class DocumentLayout extends \Google\Protobuf\Internal\Message +{ + /** + * List of blocks in the document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + */ + private $blocks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks + * List of blocks in the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * List of blocks in the document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * List of blocks in the document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); + $this->blocks = $arr; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock.php b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock.php new file mode 100644 index 000000000000..91311d4d073d --- /dev/null +++ b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock.php @@ -0,0 +1,221 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + */ +class DocumentLayoutBlock extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the block. + * + * Generated from protobuf field string block_id = 1; + */ + private $block_id = ''; + /** + * Page span of the block. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan page_span = 5; + */ + private $page_span = null; + protected $block; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock $text_block + * Block consisting of text content. + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock $table_block + * Block consisting of table content/structure. + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock $list_block + * Block consisting of list content/structure. + * @type string $block_id + * ID of the block. + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan $page_span + * Page span of the block. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Block consisting of text content. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock text_block = 2; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock|null + */ + public function getTextBlock() + { + return $this->readOneof(2); + } + + public function hasTextBlock() + { + return $this->hasOneof(2); + } + + /** + * Block consisting of text content. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock text_block = 2; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock $var + * @return $this + */ + public function setTextBlock($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Block consisting of table content/structure. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock table_block = 3; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock|null + */ + public function getTableBlock() + { + return $this->readOneof(3); + } + + public function hasTableBlock() + { + return $this->hasOneof(3); + } + + /** + * Block consisting of table content/structure. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock table_block = 3; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock $var + * @return $this + */ + public function setTableBlock($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Block consisting of list content/structure. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock list_block = 4; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock|null + */ + public function getListBlock() + { + return $this->readOneof(4); + } + + public function hasListBlock() + { + return $this->hasOneof(4); + } + + /** + * Block consisting of list content/structure. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock list_block = 4; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock $var + * @return $this + */ + public function setListBlock($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * ID of the block. + * + * Generated from protobuf field string block_id = 1; + * @return string + */ + public function getBlockId() + { + return $this->block_id; + } + + /** + * ID of the block. + * + * Generated from protobuf field string block_id = 1; + * @param string $var + * @return $this + */ + public function setBlockId($var) + { + GPBUtil::checkString($var, True); + $this->block_id = $var; + + return $this; + } + + /** + * Page span of the block. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan page_span = 5; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan|null + */ + public function getPageSpan() + { + return $this->page_span; + } + + public function hasPageSpan() + { + return isset($this->page_span); + } + + public function clearPageSpan() + { + unset($this->page_span); + } + + /** + * Page span of the block. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan page_span = 5; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan $var + * @return $this + */ + public function setPageSpan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan::class); + $this->page_span = $var; + + return $this; + } + + /** + * @return string + */ + public function getBlock() + { + return $this->whichOneof("block"); + } + +} + + diff --git a/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php new file mode 100644 index 000000000000..b6096592d4b3 --- /dev/null +++ b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php @@ -0,0 +1,106 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + */ +class LayoutListBlock extends \Google\Protobuf\Internal\Message +{ + /** + * List entries that constitute a list block. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry list_entries = 1; + */ + private $list_entries; + /** + * Type of the list_entries (if exist). Available options are `ordered` + * and `unordered`. + * + * Generated from protobuf field string type = 2; + */ + private $type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListEntry>|\Google\Protobuf\Internal\RepeatedField $list_entries + * List entries that constitute a list block. + * @type string $type + * Type of the list_entries (if exist). Available options are `ordered` + * and `unordered`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * List entries that constitute a list block. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry list_entries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getListEntries() + { + return $this->list_entries; + } + + /** + * List entries that constitute a list block. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry list_entries = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setListEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListEntry::class); + $this->list_entries = $arr; + + return $this; + } + + /** + * Type of the list_entries (if exist). Available options are `ordered` + * and `unordered`. + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the list_entries (if exist). Available options are `ordered` + * and `unordered`. + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php new file mode 100644 index 000000000000..d725f3d9c738 --- /dev/null +++ b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php @@ -0,0 +1,72 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + */ +class LayoutListEntry extends \Google\Protobuf\Internal\Message +{ + /** + * A list entry is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + */ + private $blocks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks + * A list entry is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * A list entry is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * A list entry is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); + $this->blocks = $arr; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php new file mode 100644 index 000000000000..d4d2bd406272 --- /dev/null +++ b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php @@ -0,0 +1,102 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + */ +class LayoutPageSpan extends \Google\Protobuf\Internal\Message +{ + /** + * Page where block starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + */ + private $page_start = 0; + /** + * Page where block ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + */ + private $page_end = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_start + * Page where block starts in the document. + * @type int $page_end + * Page where block ends in the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Page where block starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + * @return int + */ + public function getPageStart() + { + return $this->page_start; + } + + /** + * Page where block starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + * @param int $var + * @return $this + */ + public function setPageStart($var) + { + GPBUtil::checkInt32($var); + $this->page_start = $var; + + return $this; + } + + /** + * Page where block ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + * @return int + */ + public function getPageEnd() + { + return $this->page_end; + } + + /** + * Page where block ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + * @param int $var + * @return $this + */ + public function setPageEnd($var) + { + GPBUtil::checkInt32($var); + $this->page_end = $var; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php new file mode 100644 index 000000000000..0510351937cb --- /dev/null +++ b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php @@ -0,0 +1,136 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + */ +class LayoutTableBlock extends \Google\Protobuf\Internal\Message +{ + /** + * Header rows at the top of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow header_rows = 1; + */ + private $header_rows; + /** + * Body rows containing main table content. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow body_rows = 2; + */ + private $body_rows; + /** + * Table caption/title. + * + * Generated from protobuf field string caption = 3; + */ + private $caption = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $header_rows + * Header rows at the top of the table. + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $body_rows + * Body rows containing main table content. + * @type string $caption + * Table caption/title. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Header rows at the top of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow header_rows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaderRows() + { + return $this->header_rows; + } + + /** + * Header rows at the top of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow header_rows = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaderRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow::class); + $this->header_rows = $arr; + + return $this; + } + + /** + * Body rows containing main table content. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow body_rows = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBodyRows() + { + return $this->body_rows; + } + + /** + * Body rows containing main table content. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow body_rows = 2; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBodyRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow::class); + $this->body_rows = $arr; + + return $this; + } + + /** + * Table caption/title. + * + * Generated from protobuf field string caption = 3; + * @return string + */ + public function getCaption() + { + return $this->caption; + } + + /** + * Table caption/title. + * + * Generated from protobuf field string caption = 3; + * @param string $var + * @return $this + */ + public function setCaption($var) + { + GPBUtil::checkString($var, True); + $this->caption = $var; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php new file mode 100644 index 000000000000..3deb5e30da5f --- /dev/null +++ b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php @@ -0,0 +1,140 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + */ +class LayoutTableCell extends \Google\Protobuf\Internal\Message +{ + /** + * A table cell is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + */ + private $blocks; + /** + * How many rows this cell spans. + * + * Generated from protobuf field int32 row_span = 2; + */ + private $row_span = 0; + /** + * How many columns this cell spans. + * + * Generated from protobuf field int32 col_span = 3; + */ + private $col_span = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks + * A table cell is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * @type int $row_span + * How many rows this cell spans. + * @type int $col_span + * How many columns this cell spans. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * A table cell is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * A table cell is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); + $this->blocks = $arr; + + return $this; + } + + /** + * How many rows this cell spans. + * + * Generated from protobuf field int32 row_span = 2; + * @return int + */ + public function getRowSpan() + { + return $this->row_span; + } + + /** + * How many rows this cell spans. + * + * Generated from protobuf field int32 row_span = 2; + * @param int $var + * @return $this + */ + public function setRowSpan($var) + { + GPBUtil::checkInt32($var); + $this->row_span = $var; + + return $this; + } + + /** + * How many columns this cell spans. + * + * Generated from protobuf field int32 col_span = 3; + * @return int + */ + public function getColSpan() + { + return $this->col_span; + } + + /** + * How many columns this cell spans. + * + * Generated from protobuf field int32 col_span = 3; + * @param int $var + * @return $this + */ + public function setColSpan($var) + { + GPBUtil::checkInt32($var); + $this->col_span = $var; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php new file mode 100644 index 000000000000..253239c033bd --- /dev/null +++ b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php @@ -0,0 +1,68 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + */ +class LayoutTableRow extends \Google\Protobuf\Internal\Message +{ + /** + * A table row is a list of table cells. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; + */ + private $cells; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell>|\Google\Protobuf\Internal\RepeatedField $cells + * A table row is a list of table cells. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * A table row is a list of table cells. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCells() + { + return $this->cells; + } + + /** + * A table row is a list of table cells. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCells($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell::class); + $this->cells = $arr; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php new file mode 100644 index 000000000000..66ef27c32403 --- /dev/null +++ b/DocumentAi/src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php @@ -0,0 +1,148 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + */ +class LayoutTextBlock extends \Google\Protobuf\Internal\Message +{ + /** + * Text content stored in the block. + * + * Generated from protobuf field string text = 1; + */ + private $text = ''; + /** + * Type of the text in the block. Available options are: `paragraph`, + * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, + * `heading-5`, `header`, `footer`. + * + * Generated from protobuf field string type = 2; + */ + private $type = ''; + /** + * A text block could further have child blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 3; + */ + private $blocks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Text content stored in the block. + * @type string $type + * Type of the text in the block. Available options are: `paragraph`, + * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, + * `heading-5`, `header`, `footer`. + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks + * A text block could further have child blocks. + * Repeated blocks support further hierarchies and nested blocks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Text content stored in the block. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Text content stored in the block. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Type of the text in the block. Available options are: `paragraph`, + * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, + * `heading-5`, `header`, `footer`. + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the text in the block. Available options are: `paragraph`, + * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, + * `heading-5`, `header`, `footer`. + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * A text block could further have child blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * A text block could further have child blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 3; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); + $this->blocks = $arr; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/Document/Entity.php b/DocumentAi/src/V1/Document/Entity.php index 7f9ee563e314..57bd426eb317 100644 --- a/DocumentAi/src/V1/Document/Entity.php +++ b/DocumentAi/src/V1/Document/Entity.php @@ -19,7 +19,8 @@ class Entity extends \Google\Protobuf\Internal\Message { /** * Optional. Provenance of the entity. - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -49,8 +50,8 @@ class Entity extends \Google\Protobuf\Internal\Message */ private $confidence = 0.0; /** - * Optional. Represents the provenance of this entity wrt. the location on the - * page where it was found. + * Optional. Represents the provenance of this entity wrt. the location on + * the page where it was found. * * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -63,8 +64,8 @@ class Entity extends \Google\Protobuf\Internal\Message */ private $id = ''; /** - * Optional. Normalized entity value. Absent if the extracted value could not be - * converted or the type (e.g. address) is not supported for certain + * Optional. Normalized entity value. Absent if the extracted value could + * not be converted or the type (e.g. address) is not supported for certain * parsers. This field is also only populated for certain supported document * types. * @@ -72,8 +73,8 @@ class Entity extends \Google\Protobuf\Internal\Message */ private $normalized_value = null; /** - * Optional. Entities can be nested to form a hierarchical data structure representing - * the content in the document. + * Optional. Entities can be nested to form a hierarchical data structure + * representing the content in the document. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -85,7 +86,8 @@ class Entity extends \Google\Protobuf\Internal\Message */ private $provenance = null; /** - * Optional. Whether the entity will be redacted for de-identification purposes. + * Optional. Whether the entity will be redacted for de-identification + * purposes. * * Generated from protobuf field bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -99,7 +101,8 @@ class Entity extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor * Optional. Provenance of the entity. - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * @type string $type * Required. Entity type from a schema e.g. `Address`. * @type string $mention_text @@ -109,23 +112,24 @@ class Entity extends \Google\Protobuf\Internal\Message * @type float $confidence * Optional. Confidence of detected Schema entity. Range `[0, 1]`. * @type \Google\Cloud\DocumentAI\V1\Document\PageAnchor $page_anchor - * Optional. Represents the provenance of this entity wrt. the location on the - * page where it was found. + * Optional. Represents the provenance of this entity wrt. the location on + * the page where it was found. * @type string $id * Optional. Canonical id. This will be a unique value in the entity list * for this document. * @type \Google\Cloud\DocumentAI\V1\Document\Entity\NormalizedValue $normalized_value - * Optional. Normalized entity value. Absent if the extracted value could not be - * converted or the type (e.g. address) is not supported for certain + * Optional. Normalized entity value. Absent if the extracted value could + * not be converted or the type (e.g. address) is not supported for certain * parsers. This field is also only populated for certain supported document * types. * @type array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $properties - * Optional. Entities can be nested to form a hierarchical data structure representing - * the content in the document. + * Optional. Entities can be nested to form a hierarchical data structure + * representing the content in the document. * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance * Optional. The history of this annotation. * @type bool $redacted - * Optional. Whether the entity will be redacted for de-identification purposes. + * Optional. Whether the entity will be redacted for de-identification + * purposes. * } */ public function __construct($data = NULL) { @@ -135,7 +139,8 @@ public function __construct($data = NULL) { /** * Optional. Provenance of the entity. - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null @@ -157,7 +162,8 @@ public function clearTextAnchor() /** * Optional. Provenance of the entity. - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var @@ -276,8 +282,8 @@ public function setConfidence($var) } /** - * Optional. Represents the provenance of this entity wrt. the location on the - * page where it was found. + * Optional. Represents the provenance of this entity wrt. the location on + * the page where it was found. * * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\DocumentAI\V1\Document\PageAnchor|null @@ -298,8 +304,8 @@ public function clearPageAnchor() } /** - * Optional. Represents the provenance of this entity wrt. the location on the - * page where it was found. + * Optional. Represents the provenance of this entity wrt. the location on + * the page where it was found. * * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\DocumentAI\V1\Document\PageAnchor $var @@ -342,8 +348,8 @@ public function setId($var) } /** - * Optional. Normalized entity value. Absent if the extracted value could not be - * converted or the type (e.g. address) is not supported for certain + * Optional. Normalized entity value. Absent if the extracted value could + * not be converted or the type (e.g. address) is not supported for certain * parsers. This field is also only populated for certain supported document * types. * @@ -366,8 +372,8 @@ public function clearNormalizedValue() } /** - * Optional. Normalized entity value. Absent if the extracted value could not be - * converted or the type (e.g. address) is not supported for certain + * Optional. Normalized entity value. Absent if the extracted value could + * not be converted or the type (e.g. address) is not supported for certain * parsers. This field is also only populated for certain supported document * types. * @@ -384,8 +390,8 @@ public function setNormalizedValue($var) } /** - * Optional. Entities can be nested to form a hierarchical data structure representing - * the content in the document. + * Optional. Entities can be nested to form a hierarchical data structure + * representing the content in the document. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Internal\RepeatedField @@ -396,8 +402,8 @@ public function getProperties() } /** - * Optional. Entities can be nested to form a hierarchical data structure representing - * the content in the document. + * Optional. Entities can be nested to form a hierarchical data structure + * representing the content in the document. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL]; * @param array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $var @@ -448,7 +454,8 @@ public function setProvenance($var) } /** - * Optional. Whether the entity will be redacted for de-identification purposes. + * Optional. Whether the entity will be redacted for de-identification + * purposes. * * Generated from protobuf field bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -459,7 +466,8 @@ public function getRedacted() } /** - * Optional. Whether the entity will be redacted for de-identification purposes. + * Optional. Whether the entity will be redacted for de-identification + * purposes. * * Generated from protobuf field bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/DocumentAi/src/V1/Document/EntityRelation.php b/DocumentAi/src/V1/Document/EntityRelation.php index a9a0a239a4ae..7669e0965bf4 100644 --- a/DocumentAi/src/V1/Document/EntityRelation.php +++ b/DocumentAi/src/V1/Document/EntityRelation.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Relationship between [Entities][google.cloud.documentai.v1.Document.Entity]. + * Relationship between + * [Entities][google.cloud.documentai.v1.Document.Entity]. * * Generated from protobuf message google.cloud.documentai.v1.Document.EntityRelation */ diff --git a/DocumentAi/src/V1/Document/Page.php b/DocumentAi/src/V1/Document/Page.php index d783a0631b05..d9a35c1a6238 100644 --- a/DocumentAi/src/V1/Document/Page.php +++ b/DocumentAi/src/V1/Document/Page.php @@ -16,9 +16,11 @@ class Page extends \Google\Protobuf\Internal\Message { /** - * 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document]. - * Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual - * processing. + * 1-based index for current + * [Page][google.cloud.documentai.v1.Document.Page] in a parent + * [Document][google.cloud.documentai.v1.Document]. Useful when a page is + * taken out of a [Document][google.cloud.documentai.v1.Document] for + * individual processing. * * Generated from protobuf field int32 page_number = 1; */ @@ -136,9 +138,11 @@ class Page extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $page_number - * 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document]. - * Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual - * processing. + * 1-based index for current + * [Page][google.cloud.documentai.v1.Document.Page] in a parent + * [Document][google.cloud.documentai.v1.Document]. Useful when a page is + * taken out of a [Document][google.cloud.documentai.v1.Document] for + * individual processing. * @type \Google\Cloud\DocumentAI\V1\Document\Page\Image $image * Rendered image for this page. This image is preprocessed to remove any * skew, rotation, and distortions such that the annotation bounding boxes @@ -187,9 +191,11 @@ public function __construct($data = NULL) { } /** - * 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document]. - * Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual - * processing. + * 1-based index for current + * [Page][google.cloud.documentai.v1.Document.Page] in a parent + * [Document][google.cloud.documentai.v1.Document]. Useful when a page is + * taken out of a [Document][google.cloud.documentai.v1.Document] for + * individual processing. * * Generated from protobuf field int32 page_number = 1; * @return int @@ -200,9 +206,11 @@ public function getPageNumber() } /** - * 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document]. - * Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual - * processing. + * 1-based index for current + * [Page][google.cloud.documentai.v1.Document.Page] in a parent + * [Document][google.cloud.documentai.v1.Document]. Useful when a page is + * taken out of a [Document][google.cloud.documentai.v1.Document] for + * individual processing. * * Generated from protobuf field int32 page_number = 1; * @param int $var diff --git a/DocumentAi/src/V1/Document/Page/Block.php b/DocumentAi/src/V1/Document/Page/Block.php index 6d7b6e90d732..9db40cafb22a 100644 --- a/DocumentAi/src/V1/Document/Page/Block.php +++ b/DocumentAi/src/V1/Document/Page/Block.php @@ -17,7 +17,8 @@ class Block extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Block][google.cloud.documentai.v1.Document.Page.Block]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; */ @@ -43,7 +44,8 @@ class Block extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Block][google.cloud.documentai.v1.Document.Page.Block]. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages * A list of detected languages together with confidence. * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance @@ -56,7 +58,8 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Block][google.cloud.documentai.v1.Document.Page.Block]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -77,7 +80,8 @@ public function clearLayout() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Block][google.cloud.documentai.v1.Document.Page.Block]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var diff --git a/DocumentAi/src/V1/Document/Page/DetectedBarcode.php b/DocumentAi/src/V1/Document/Page/DetectedBarcode.php index d1ba2db32d1b..e9f2aad81448 100644 --- a/DocumentAi/src/V1/Document/Page/DetectedBarcode.php +++ b/DocumentAi/src/V1/Document/Page/DetectedBarcode.php @@ -16,13 +16,15 @@ class DetectedBarcode extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; */ private $layout = null; /** - * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * Detailed barcode information of the + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. * * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2; */ @@ -35,9 +37,11 @@ class DetectedBarcode extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. * @type \Google\Cloud\DocumentAI\V1\Barcode $barcode - * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * Detailed barcode information of the + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. * } */ public function __construct($data = NULL) { @@ -46,7 +50,8 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -67,7 +72,8 @@ public function clearLayout() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var @@ -82,7 +88,8 @@ public function setLayout($var) } /** - * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * Detailed barcode information of the + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. * * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2; * @return \Google\Cloud\DocumentAI\V1\Barcode|null @@ -103,7 +110,8 @@ public function clearBarcode() } /** - * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * Detailed barcode information of the + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. * * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2; * @param \Google\Cloud\DocumentAI\V1\Barcode $var diff --git a/DocumentAi/src/V1/Document/Page/FormField.php b/DocumentAi/src/V1/Document/Page/FormField.php index 0bc6ad4e5ef1..ebc285d717cc 100644 --- a/DocumentAi/src/V1/Document/Page/FormField.php +++ b/DocumentAi/src/V1/Document/Page/FormField.php @@ -16,14 +16,16 @@ class FormField extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`, - * `Grand total`, `Phone number`, etc. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; */ private $field_name = null; /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; */ @@ -80,10 +82,12 @@ class FormField extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $field_name - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`, - * `Grand total`, `Phone number`, etc. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $field_value - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $name_detected_languages * A list of detected languages for name together with confidence. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $value_detected_languages @@ -112,8 +116,9 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`, - * `Grand total`, `Phone number`, etc. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -134,8 +139,9 @@ public function clearFieldName() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`, - * `Grand total`, `Phone number`, etc. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var @@ -150,7 +156,8 @@ public function setFieldName($var) } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -171,7 +178,8 @@ public function clearFieldValue() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var diff --git a/DocumentAi/src/V1/Document/Page/Layout.php b/DocumentAi/src/V1/Document/Page/Layout.php index dc7aca276aee..96282db495cb 100644 --- a/DocumentAi/src/V1/Document/Page/Layout.php +++ b/DocumentAi/src/V1/Document/Page/Layout.php @@ -16,27 +16,32 @@ class Layout extends \Google\Protobuf\Internal\Message { /** - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; */ private $text_anchor = null; /** - * Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this - * layout is for. e.g. confidence can be for a single token, a table, - * a visual element, etc. depending on context. Range `[0, 1]`. + * Confidence of the current + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within + * context of the object this layout is for. e.g. confidence can be for a + * single token, a table, a visual element, etc. depending on context. + * Range `[0, 1]`. * * Generated from protobuf field float confidence = 2; */ private $confidence = 0.0; /** - * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * The bounding polygon for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. * * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; */ private $bounding_poly = null; /** - * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * Detected orientation for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; */ @@ -49,15 +54,20 @@ class Layout extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * @type float $confidence - * Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this - * layout is for. e.g. confidence can be for a single token, a table, - * a visual element, etc. depending on context. Range `[0, 1]`. + * Confidence of the current + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within + * context of the object this layout is for. e.g. confidence can be for a + * single token, a table, a visual element, etc. depending on context. + * Range `[0, 1]`. * @type \Google\Cloud\DocumentAI\V1\BoundingPoly $bounding_poly - * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * The bounding polygon for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. * @type int $orientation - * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * Detected orientation for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. * } */ public function __construct($data = NULL) { @@ -66,7 +76,8 @@ public function __construct($data = NULL) { } /** - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null @@ -87,7 +98,8 @@ public function clearTextAnchor() } /** - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var @@ -102,9 +114,11 @@ public function setTextAnchor($var) } /** - * Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this - * layout is for. e.g. confidence can be for a single token, a table, - * a visual element, etc. depending on context. Range `[0, 1]`. + * Confidence of the current + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within + * context of the object this layout is for. e.g. confidence can be for a + * single token, a table, a visual element, etc. depending on context. + * Range `[0, 1]`. * * Generated from protobuf field float confidence = 2; * @return float @@ -115,9 +129,11 @@ public function getConfidence() } /** - * Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this - * layout is for. e.g. confidence can be for a single token, a table, - * a visual element, etc. depending on context. Range `[0, 1]`. + * Confidence of the current + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within + * context of the object this layout is for. e.g. confidence can be for a + * single token, a table, a visual element, etc. depending on context. + * Range `[0, 1]`. * * Generated from protobuf field float confidence = 2; * @param float $var @@ -132,7 +148,8 @@ public function setConfidence($var) } /** - * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * The bounding polygon for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. * * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; * @return \Google\Cloud\DocumentAI\V1\BoundingPoly|null @@ -153,7 +170,8 @@ public function clearBoundingPoly() } /** - * The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * The bounding polygon for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. * * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; * @param \Google\Cloud\DocumentAI\V1\BoundingPoly $var @@ -168,7 +186,8 @@ public function setBoundingPoly($var) } /** - * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * Detected orientation for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; * @return int @@ -179,7 +198,8 @@ public function getOrientation() } /** - * Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * Detected orientation for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; * @param int $var diff --git a/DocumentAi/src/V1/Document/Page/Line.php b/DocumentAi/src/V1/Document/Page/Line.php index 7553c0232203..cac636117910 100644 --- a/DocumentAi/src/V1/Document/Page/Line.php +++ b/DocumentAi/src/V1/Document/Page/Line.php @@ -17,7 +17,8 @@ class Line extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Line][google.cloud.documentai.v1.Document.Page.Line]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; */ @@ -43,7 +44,8 @@ class Line extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Line][google.cloud.documentai.v1.Document.Page.Line]. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages * A list of detected languages together with confidence. * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance @@ -56,7 +58,8 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Line][google.cloud.documentai.v1.Document.Page.Line]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -77,7 +80,8 @@ public function clearLayout() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Line][google.cloud.documentai.v1.Document.Page.Line]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var diff --git a/DocumentAi/src/V1/Document/Page/Paragraph.php b/DocumentAi/src/V1/Document/Page/Paragraph.php index 2d11cc1b091c..c22535ac9486 100644 --- a/DocumentAi/src/V1/Document/Page/Paragraph.php +++ b/DocumentAi/src/V1/Document/Page/Paragraph.php @@ -16,7 +16,8 @@ class Paragraph extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; */ @@ -42,7 +43,8 @@ class Paragraph extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages * A list of detected languages together with confidence. * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance @@ -55,7 +57,8 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -76,7 +79,8 @@ public function clearLayout() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var diff --git a/DocumentAi/src/V1/Document/Page/Symbol.php b/DocumentAi/src/V1/Document/Page/Symbol.php index 2b4815fefcb5..a2bc27bfde2a 100644 --- a/DocumentAi/src/V1/Document/Page/Symbol.php +++ b/DocumentAi/src/V1/Document/Page/Symbol.php @@ -16,7 +16,8 @@ class Symbol extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; */ @@ -35,7 +36,8 @@ class Symbol extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages * A list of detected languages together with confidence. * } @@ -46,7 +48,8 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -67,7 +70,8 @@ public function clearLayout() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var diff --git a/DocumentAi/src/V1/Document/Page/Table.php b/DocumentAi/src/V1/Document/Page/Table.php index c73fb0b00828..3e9e5a4c50d4 100644 --- a/DocumentAi/src/V1/Document/Page/Table.php +++ b/DocumentAi/src/V1/Document/Page/Table.php @@ -16,7 +16,8 @@ class Table extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Table][google.cloud.documentai.v1.Document.Page.Table]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; */ @@ -54,7 +55,8 @@ class Table extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Table][google.cloud.documentai.v1.Document.Page.Table]. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $header_rows * Header rows of the table. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $body_rows @@ -71,7 +73,8 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Table][google.cloud.documentai.v1.Document.Page.Table]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -92,7 +95,8 @@ public function clearLayout() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Table][google.cloud.documentai.v1.Document.Page.Table]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var diff --git a/DocumentAi/src/V1/Document/Page/Table/TableCell.php b/DocumentAi/src/V1/Document/Page/Table/TableCell.php index 696a1a17ad88..0339697c8857 100644 --- a/DocumentAi/src/V1/Document/Page/Table/TableCell.php +++ b/DocumentAi/src/V1/Document/Page/Table/TableCell.php @@ -16,7 +16,8 @@ class TableCell extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; */ @@ -47,7 +48,8 @@ class TableCell extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. * @type int $row_span * How many rows this cell spans. * @type int $col_span @@ -62,7 +64,8 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -83,7 +86,8 @@ public function clearLayout() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var diff --git a/DocumentAi/src/V1/Document/Page/Token.php b/DocumentAi/src/V1/Document/Page/Token.php index 2f93fe847d26..9c3e222bb6da 100644 --- a/DocumentAi/src/V1/Document/Page/Token.php +++ b/DocumentAi/src/V1/Document/Page/Token.php @@ -16,13 +16,15 @@ class Token extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Token][google.cloud.documentai.v1.Document.Page.Token]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; */ private $layout = null; /** - * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token]. + * Detected break at the end of a + * [Token][google.cloud.documentai.v1.Document.Page.Token]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; */ @@ -54,9 +56,11 @@ class Token extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Token][google.cloud.documentai.v1.Document.Page.Token]. * @type \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak $detected_break - * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token]. + * Detected break at the end of a + * [Token][google.cloud.documentai.v1.Document.Page.Token]. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages * A list of detected languages together with confidence. * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance @@ -71,7 +75,8 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Token][google.cloud.documentai.v1.Document.Page.Token]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -92,7 +97,8 @@ public function clearLayout() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Token][google.cloud.documentai.v1.Document.Page.Token]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var @@ -107,7 +113,8 @@ public function setLayout($var) } /** - * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token]. + * Detected break at the end of a + * [Token][google.cloud.documentai.v1.Document.Page.Token]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak|null @@ -128,7 +135,8 @@ public function clearDetectedBreak() } /** - * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token]. + * Detected break at the end of a + * [Token][google.cloud.documentai.v1.Document.Page.Token]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak $var diff --git a/DocumentAi/src/V1/Document/Page/Token/DetectedBreak.php b/DocumentAi/src/V1/Document/Page/Token/DetectedBreak.php index f74d6c371237..826b142db9d3 100644 --- a/DocumentAi/src/V1/Document/Page/Token/DetectedBreak.php +++ b/DocumentAi/src/V1/Document/Page/Token/DetectedBreak.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token]. + * Detected break at the end of a + * [Token][google.cloud.documentai.v1.Document.Page.Token]. * * Generated from protobuf message google.cloud.documentai.v1.Document.Page.Token.DetectedBreak */ diff --git a/DocumentAi/src/V1/Document/Page/Token/StyleInfo.php b/DocumentAi/src/V1/Document/Page/Token/StyleInfo.php index 4e3fa356cff6..64987a93044e 100644 --- a/DocumentAi/src/V1/Document/Page/Token/StyleInfo.php +++ b/DocumentAi/src/V1/Document/Page/Token/StyleInfo.php @@ -22,8 +22,9 @@ class StyleInfo extends \Google\Protobuf\Internal\Message */ private $font_size = 0; /** - * Font size in pixels, equal to _unrounded [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ * - * _resolution_ ÷ `72.0`. + * Font size in pixels, equal to _unrounded + * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ + * * _resolution_ ÷ `72.0`. * * Generated from protobuf field double pixel_font_size = 2; */ @@ -41,8 +42,9 @@ class StyleInfo extends \Google\Protobuf\Internal\Message */ private $font_type = ''; /** - * Whether the text is bold (equivalent to [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] is at least - * `700`). + * Whether the text is bold (equivalent to + * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] + * is at least `700`). * * Generated from protobuf field bool bold = 5; */ @@ -60,25 +62,25 @@ class StyleInfo extends \Google\Protobuf\Internal\Message */ private $underlined = false; /** - * Whether the text is strikethrough. + * Whether the text is strikethrough. This feature is not supported yet. * * Generated from protobuf field bool strikeout = 8; */ private $strikeout = false; /** - * Whether the text is a subscript. + * Whether the text is a subscript. This feature is not supported yet. * * Generated from protobuf field bool subscript = 9; */ private $subscript = false; /** - * Whether the text is a superscript. + * Whether the text is a superscript. This feature is not supported yet. * * Generated from protobuf field bool superscript = 10; */ private $superscript = false; /** - * Whether the text is in small caps. + * Whether the text is in small caps. This feature is not supported yet. * * Generated from protobuf field bool smallcaps = 11; */ @@ -118,27 +120,29 @@ class StyleInfo extends \Google\Protobuf\Internal\Message * @type int $font_size * Font size in points (`1` point is `¹â„₇₂` inches). * @type float $pixel_font_size - * Font size in pixels, equal to _unrounded [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ * - * _resolution_ ÷ `72.0`. + * Font size in pixels, equal to _unrounded + * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ + * * _resolution_ ÷ `72.0`. * @type float $letter_spacing * Letter spacing in points. * @type string $font_type * Name or style of the font. * @type bool $bold - * Whether the text is bold (equivalent to [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] is at least - * `700`). + * Whether the text is bold (equivalent to + * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] + * is at least `700`). * @type bool $italic * Whether the text is italic. * @type bool $underlined * Whether the text is underlined. * @type bool $strikeout - * Whether the text is strikethrough. + * Whether the text is strikethrough. This feature is not supported yet. * @type bool $subscript - * Whether the text is a subscript. + * Whether the text is a subscript. This feature is not supported yet. * @type bool $superscript - * Whether the text is a superscript. + * Whether the text is a superscript. This feature is not supported yet. * @type bool $smallcaps - * Whether the text is in small caps. + * Whether the text is in small caps. This feature is not supported yet. * @type int $font_weight * TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). * Normal is `400`, bold is `700`. @@ -182,8 +186,9 @@ public function setFontSize($var) } /** - * Font size in pixels, equal to _unrounded [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ * - * _resolution_ ÷ `72.0`. + * Font size in pixels, equal to _unrounded + * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ + * * _resolution_ ÷ `72.0`. * * Generated from protobuf field double pixel_font_size = 2; * @return float @@ -194,8 +199,9 @@ public function getPixelFontSize() } /** - * Font size in pixels, equal to _unrounded [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ * - * _resolution_ ÷ `72.0`. + * Font size in pixels, equal to _unrounded + * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ + * * _resolution_ ÷ `72.0`. * * Generated from protobuf field double pixel_font_size = 2; * @param float $var @@ -262,8 +268,9 @@ public function setFontType($var) } /** - * Whether the text is bold (equivalent to [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] is at least - * `700`). + * Whether the text is bold (equivalent to + * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] + * is at least `700`). * * Generated from protobuf field bool bold = 5; * @return bool @@ -274,8 +281,9 @@ public function getBold() } /** - * Whether the text is bold (equivalent to [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] is at least - * `700`). + * Whether the text is bold (equivalent to + * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] + * is at least `700`). * * Generated from protobuf field bool bold = 5; * @param bool $var @@ -342,7 +350,7 @@ public function setUnderlined($var) } /** - * Whether the text is strikethrough. + * Whether the text is strikethrough. This feature is not supported yet. * * Generated from protobuf field bool strikeout = 8; * @return bool @@ -353,7 +361,7 @@ public function getStrikeout() } /** - * Whether the text is strikethrough. + * Whether the text is strikethrough. This feature is not supported yet. * * Generated from protobuf field bool strikeout = 8; * @param bool $var @@ -368,7 +376,7 @@ public function setStrikeout($var) } /** - * Whether the text is a subscript. + * Whether the text is a subscript. This feature is not supported yet. * * Generated from protobuf field bool subscript = 9; * @return bool @@ -379,7 +387,7 @@ public function getSubscript() } /** - * Whether the text is a subscript. + * Whether the text is a subscript. This feature is not supported yet. * * Generated from protobuf field bool subscript = 9; * @param bool $var @@ -394,7 +402,7 @@ public function setSubscript($var) } /** - * Whether the text is a superscript. + * Whether the text is a superscript. This feature is not supported yet. * * Generated from protobuf field bool superscript = 10; * @return bool @@ -405,7 +413,7 @@ public function getSuperscript() } /** - * Whether the text is a superscript. + * Whether the text is a superscript. This feature is not supported yet. * * Generated from protobuf field bool superscript = 10; * @param bool $var @@ -420,7 +428,7 @@ public function setSuperscript($var) } /** - * Whether the text is in small caps. + * Whether the text is in small caps. This feature is not supported yet. * * Generated from protobuf field bool smallcaps = 11; * @return bool @@ -431,7 +439,7 @@ public function getSmallcaps() } /** - * Whether the text is in small caps. + * Whether the text is in small caps. This feature is not supported yet. * * Generated from protobuf field bool smallcaps = 11; * @param bool $var diff --git a/DocumentAi/src/V1/Document/Page/VisualElement.php b/DocumentAi/src/V1/Document/Page/VisualElement.php index 68c3c902cee7..848278991249 100644 --- a/DocumentAi/src/V1/Document/Page/VisualElement.php +++ b/DocumentAi/src/V1/Document/Page/VisualElement.php @@ -17,13 +17,15 @@ class VisualElement extends \Google\Protobuf\Internal\Message { /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; */ private $layout = null; /** - * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * Type of the + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. * * Generated from protobuf field string type = 2; */ @@ -42,9 +44,11 @@ class VisualElement extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. * @type string $type - * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * Type of the + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages * A list of detected languages together with confidence. * } @@ -55,7 +59,8 @@ public function __construct($data = NULL) { } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null @@ -76,7 +81,8 @@ public function clearLayout() } /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var @@ -91,7 +97,8 @@ public function setLayout($var) } /** - * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * Type of the + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. * * Generated from protobuf field string type = 2; * @return string @@ -102,7 +109,8 @@ public function getType() } /** - * Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * Type of the + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. * * Generated from protobuf field string type = 2; * @param string $var diff --git a/DocumentAi/src/V1/Document/PageAnchor.php b/DocumentAi/src/V1/Document/PageAnchor.php index 416be7aac5d0..c6524ec14f53 100644 --- a/DocumentAi/src/V1/Document/PageAnchor.php +++ b/DocumentAi/src/V1/Document/PageAnchor.php @@ -9,9 +9,10 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Referencing the visual context of the entity in the [Document.pages][google.cloud.documentai.v1.Document.pages]. - * Page anchors can be cross-page, consist of multiple bounding polygons and - * optionally reference specific layout element types. + * Referencing the visual context of the entity in the + * [Document.pages][google.cloud.documentai.v1.Document.pages]. Page anchors + * can be cross-page, consist of multiple bounding polygons and optionally + * reference specific layout element types. * * Generated from protobuf message google.cloud.documentai.v1.Document.PageAnchor */ diff --git a/DocumentAi/src/V1/Document/PageAnchor/PageRef.php b/DocumentAi/src/V1/Document/PageAnchor/PageRef.php index c0e7c2c2845e..f824b299a264 100644 --- a/DocumentAi/src/V1/Document/PageAnchor/PageRef.php +++ b/DocumentAi/src/V1/Document/PageAnchor/PageRef.php @@ -16,7 +16,9 @@ class PageRef extends \Google\Protobuf\Internal\Message { /** - * Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using + * Required. Index into the + * [Document.pages][google.cloud.documentai.v1.Document.pages] element, + * for example using * `[Document.pages][page_refs.page]` to locate the related page element. * This field is skipped when its value is the default `0`. See * https://developers.google.com/protocol-buffers/docs/proto3#json. @@ -25,28 +27,32 @@ class PageRef extends \Google\Protobuf\Internal\Message */ private $page = 0; /** - * Optional. The type of the layout element that is being referenced if any. + * Optional. The type of the layout element that is being referenced if + * any. * * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType layout_type = 2 [(.google.api.field_behavior) = OPTIONAL]; */ private $layout_type = 0; /** - * Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead. + * Optional. Deprecated. Use + * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + * instead. * * Generated from protobuf field string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * @deprecated */ protected $layout_id = ''; /** - * Optional. Identifies the bounding polygon of a layout element on the page. - * If `layout_type` is set, the bounding polygon must be exactly the same - * to the layout element it's referring to. + * Optional. Identifies the bounding polygon of a layout element on the + * page. If `layout_type` is set, the bounding polygon must be exactly the + * same to the layout element it's referring to. * * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 4 [(.google.api.field_behavior) = OPTIONAL]; */ private $bounding_poly = null; /** - * Optional. Confidence of detected page element, if applicable. Range `[0, 1]`. + * Optional. Confidence of detected page element, if applicable. Range + * `[0, 1]`. * * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -59,20 +65,26 @@ class PageRef extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $page - * Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using + * Required. Index into the + * [Document.pages][google.cloud.documentai.v1.Document.pages] element, + * for example using * `[Document.pages][page_refs.page]` to locate the related page element. * This field is skipped when its value is the default `0`. See * https://developers.google.com/protocol-buffers/docs/proto3#json. * @type int $layout_type - * Optional. The type of the layout element that is being referenced if any. + * Optional. The type of the layout element that is being referenced if + * any. * @type string $layout_id - * Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead. + * Optional. Deprecated. Use + * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + * instead. * @type \Google\Cloud\DocumentAI\V1\BoundingPoly $bounding_poly - * Optional. Identifies the bounding polygon of a layout element on the page. - * If `layout_type` is set, the bounding polygon must be exactly the same - * to the layout element it's referring to. + * Optional. Identifies the bounding polygon of a layout element on the + * page. If `layout_type` is set, the bounding polygon must be exactly the + * same to the layout element it's referring to. * @type float $confidence - * Optional. Confidence of detected page element, if applicable. Range `[0, 1]`. + * Optional. Confidence of detected page element, if applicable. Range + * `[0, 1]`. * } */ public function __construct($data = NULL) { @@ -81,7 +93,9 @@ public function __construct($data = NULL) { } /** - * Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using + * Required. Index into the + * [Document.pages][google.cloud.documentai.v1.Document.pages] element, + * for example using * `[Document.pages][page_refs.page]` to locate the related page element. * This field is skipped when its value is the default `0`. See * https://developers.google.com/protocol-buffers/docs/proto3#json. @@ -95,7 +109,9 @@ public function getPage() } /** - * Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using + * Required. Index into the + * [Document.pages][google.cloud.documentai.v1.Document.pages] element, + * for example using * `[Document.pages][page_refs.page]` to locate the related page element. * This field is skipped when its value is the default `0`. See * https://developers.google.com/protocol-buffers/docs/proto3#json. @@ -113,7 +129,8 @@ public function setPage($var) } /** - * Optional. The type of the layout element that is being referenced if any. + * Optional. The type of the layout element that is being referenced if + * any. * * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType layout_type = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -124,7 +141,8 @@ public function getLayoutType() } /** - * Optional. The type of the layout element that is being referenced if any. + * Optional. The type of the layout element that is being referenced if + * any. * * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType layout_type = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -139,7 +157,9 @@ public function setLayoutType($var) } /** - * Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead. + * Optional. Deprecated. Use + * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + * instead. * * Generated from protobuf field string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * @return string @@ -152,7 +172,9 @@ public function getLayoutId() } /** - * Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead. + * Optional. Deprecated. Use + * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + * instead. * * Generated from protobuf field string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -169,9 +191,9 @@ public function setLayoutId($var) } /** - * Optional. Identifies the bounding polygon of a layout element on the page. - * If `layout_type` is set, the bounding polygon must be exactly the same - * to the layout element it's referring to. + * Optional. Identifies the bounding polygon of a layout element on the + * page. If `layout_type` is set, the bounding polygon must be exactly the + * same to the layout element it's referring to. * * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\DocumentAI\V1\BoundingPoly|null @@ -192,9 +214,9 @@ public function clearBoundingPoly() } /** - * Optional. Identifies the bounding polygon of a layout element on the page. - * If `layout_type` is set, the bounding polygon must be exactly the same - * to the layout element it's referring to. + * Optional. Identifies the bounding polygon of a layout element on the + * page. If `layout_type` is set, the bounding polygon must be exactly the + * same to the layout element it's referring to. * * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\DocumentAI\V1\BoundingPoly $var @@ -209,7 +231,8 @@ public function setBoundingPoly($var) } /** - * Optional. Confidence of detected page element, if applicable. Range `[0, 1]`. + * Optional. Confidence of detected page element, if applicable. Range + * `[0, 1]`. * * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return float @@ -220,7 +243,8 @@ public function getConfidence() } /** - * Optional. Confidence of detected page element, if applicable. Range `[0, 1]`. + * Optional. Confidence of detected page element, if applicable. Range + * `[0, 1]`. * * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param float $var diff --git a/DocumentAi/src/V1/Document/PageAnchor/PageRef/LayoutType.php b/DocumentAi/src/V1/Document/PageAnchor/PageRef/LayoutType.php index 57636ed532aa..221ebd633975 100644 --- a/DocumentAi/src/V1/Document/PageAnchor/PageRef/LayoutType.php +++ b/DocumentAi/src/V1/Document/PageAnchor/PageRef/LayoutType.php @@ -20,43 +20,56 @@ class LayoutType */ const LAYOUT_TYPE_UNSPECIFIED = 0; /** - * References a [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] element. + * References a + * [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] + * element. * * Generated from protobuf enum BLOCK = 1; */ const BLOCK = 1; /** - * References a [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] element. + * References a + * [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] + * element. * * Generated from protobuf enum PARAGRAPH = 2; */ const PARAGRAPH = 2; /** - * References a [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. + * References a + * [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. * * Generated from protobuf enum LINE = 3; */ const LINE = 3; /** - * References a [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] element. + * References a + * [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] + * element. * * Generated from protobuf enum TOKEN = 4; */ const TOKEN = 4; /** - * References a [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] element. + * References a + * [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] + * element. * * Generated from protobuf enum VISUAL_ELEMENT = 5; */ const VISUAL_ELEMENT = 5; /** - * Refrrences a [Page.tables][google.cloud.documentai.v1.Document.Page.tables] element. + * Refrrences a + * [Page.tables][google.cloud.documentai.v1.Document.Page.tables] + * element. * * Generated from protobuf enum TABLE = 6; */ const TABLE = 6; /** - * References a [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] element. + * References a + * [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] + * element. * * Generated from protobuf enum FORM_FIELD = 7; */ diff --git a/DocumentAi/src/V1/Document/ShardInfo.php b/DocumentAi/src/V1/Document/ShardInfo.php index ceb0ffbd1b07..5468362e5902 100644 --- a/DocumentAi/src/V1/Document/ShardInfo.php +++ b/DocumentAi/src/V1/Document/ShardInfo.php @@ -30,7 +30,8 @@ class ShardInfo extends \Google\Protobuf\Internal\Message */ private $shard_count = 0; /** - * The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall + * The index of the first character in + * [Document.text][google.cloud.documentai.v1.Document.text] in the overall * document global text. * * Generated from protobuf field int64 text_offset = 3; @@ -48,7 +49,8 @@ class ShardInfo extends \Google\Protobuf\Internal\Message * @type int|string $shard_count * Total number of shards. * @type int|string $text_offset - * The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall + * The index of the first character in + * [Document.text][google.cloud.documentai.v1.Document.text] in the overall * document global text. * } */ @@ -110,7 +112,8 @@ public function setShardCount($var) } /** - * The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall + * The index of the first character in + * [Document.text][google.cloud.documentai.v1.Document.text] in the overall * document global text. * * Generated from protobuf field int64 text_offset = 3; @@ -122,7 +125,8 @@ public function getTextOffset() } /** - * The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall + * The index of the first character in + * [Document.text][google.cloud.documentai.v1.Document.text] in the overall * document global text. * * Generated from protobuf field int64 text_offset = 3; diff --git a/DocumentAi/src/V1/Document/Style.php b/DocumentAi/src/V1/Document/Style.php index 6375ff7fccbe..ffbf6a13ecb1 100644 --- a/DocumentAi/src/V1/Document/Style.php +++ b/DocumentAi/src/V1/Document/Style.php @@ -17,7 +17,8 @@ class Style extends \Google\Protobuf\Internal\Message { /** - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; */ @@ -78,7 +79,8 @@ class Style extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * @type \Google\Type\Color $color * Text color. * @type \Google\Type\Color $background_color @@ -107,7 +109,8 @@ public function __construct($data = NULL) { } /** - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null @@ -128,7 +131,8 @@ public function clearTextAnchor() } /** - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var diff --git a/DocumentAi/src/V1/Document/TextAnchor.php b/DocumentAi/src/V1/Document/TextAnchor.php index b7c04a37cd21..5655e0477ede 100644 --- a/DocumentAi/src/V1/Document/TextAnchor.php +++ b/DocumentAi/src/V1/Document/TextAnchor.php @@ -9,14 +9,16 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Text reference indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + * Text reference indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf message google.cloud.documentai.v1.Document.TextAnchor */ class TextAnchor extends \Google\Protobuf\Internal\Message { /** - * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text]. + * The text segments from the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; */ @@ -37,7 +39,8 @@ class TextAnchor extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type array<\Google\Cloud\DocumentAI\V1\Document\TextAnchor\TextSegment>|\Google\Protobuf\Internal\RepeatedField $text_segments - * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text]. + * The text segments from the + * [Document.text][google.cloud.documentai.v1.Document.text]. * @type string $content * Contains the content of the text span so that users do * not have to look it up in the text_segments. It is always @@ -50,7 +53,8 @@ public function __construct($data = NULL) { } /** - * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text]. + * The text segments from the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -61,7 +65,8 @@ public function getTextSegments() } /** - * The text segments from the [Document.text][google.cloud.documentai.v1.Document.text]. + * The text segments from the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; * @param array<\Google\Cloud\DocumentAI\V1\Document\TextAnchor\TextSegment>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/DocumentAi/src/V1/Document/TextAnchor/TextSegment.php b/DocumentAi/src/V1/Document/TextAnchor/TextSegment.php index eec03dab8f9a..0af2a77b2bc1 100644 --- a/DocumentAi/src/V1/Document/TextAnchor/TextSegment.php +++ b/DocumentAi/src/V1/Document/TextAnchor/TextSegment.php @@ -9,22 +9,27 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A text segment in the [Document.text][google.cloud.documentai.v1.Document.text]. The indices may be out of bounds - * which indicate that the text extends into another document shard for - * large sharded documents. See [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset] + * A text segment in the + * [Document.text][google.cloud.documentai.v1.Document.text]. The indices + * may be out of bounds which indicate that the text extends into another + * document shard for large sharded documents. See + * [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset] * * Generated from protobuf message google.cloud.documentai.v1.Document.TextAnchor.TextSegment */ class TextSegment extends \Google\Protobuf\Internal\Message { /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text]. + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * start UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field int64 start_index = 1; */ private $start_index = 0; /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * half open end UTF-8 char index in the * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field int64 end_index = 2; @@ -38,9 +43,12 @@ class TextSegment extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $start_index - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text]. + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * start UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. * @type int|string $end_index - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * half open end UTF-8 char index in the * [Document.text][google.cloud.documentai.v1.Document.text]. * } */ @@ -50,7 +58,9 @@ public function __construct($data = NULL) { } /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text]. + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * start UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field int64 start_index = 1; * @return int|string @@ -61,7 +71,9 @@ public function getStartIndex() } /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text]. + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * start UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field int64 start_index = 1; * @param int|string $var @@ -76,7 +88,8 @@ public function setStartIndex($var) } /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * half open end UTF-8 char index in the * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field int64 end_index = 2; @@ -88,7 +101,8 @@ public function getEndIndex() } /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * half open end UTF-8 char index in the * [Document.text][google.cloud.documentai.v1.Document.text]. * * Generated from protobuf field int64 end_index = 2; diff --git a/DocumentAi/src/V1/Document/TextChange.php b/DocumentAi/src/V1/Document/TextChange.php index 691263416988..ad2ef3ef1be5 100644 --- a/DocumentAi/src/V1/Document/TextChange.php +++ b/DocumentAi/src/V1/Document/TextChange.php @@ -17,8 +17,9 @@ class TextChange extends \Google\Protobuf\Internal\Message { /** * Provenance of the correction. - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. There can only be a - * single `TextAnchor.text_segments` element. If the start and + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. There can + * only be a single `TextAnchor.text_segments` element. If the start and * end index of the text segment are the same, the text change is inserted * before that index. * @@ -47,8 +48,9 @@ class TextChange extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor * Provenance of the correction. - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. There can only be a - * single `TextAnchor.text_segments` element. If the start and + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. There can + * only be a single `TextAnchor.text_segments` element. If the start and * end index of the text segment are the same, the text change is inserted * before that index. * @type string $changed_text @@ -64,8 +66,9 @@ public function __construct($data = NULL) { /** * Provenance of the correction. - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. There can only be a - * single `TextAnchor.text_segments` element. If the start and + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. There can + * only be a single `TextAnchor.text_segments` element. If the start and * end index of the text segment are the same, the text change is inserted * before that index. * @@ -89,8 +92,9 @@ public function clearTextAnchor() /** * Provenance of the correction. - * Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. There can only be a - * single `TextAnchor.text_segments` element. If the start and + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. There can + * only be a single `TextAnchor.text_segments` element. If the start and * end index of the text segment are the same, the text change is inserted * before that index. * diff --git a/DocumentAi/src/V1/EnableProcessorMetadata.php b/DocumentAi/src/V1/EnableProcessorMetadata.php index 4321d7eb4090..8883938b22c3 100644 --- a/DocumentAi/src/V1/EnableProcessorMetadata.php +++ b/DocumentAi/src/V1/EnableProcessorMetadata.php @@ -10,7 +10,8 @@ /** * The long-running operation metadata for the - * [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] method. + * [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] + * method. * * Generated from protobuf message google.cloud.documentai.v1.EnableProcessorMetadata */ diff --git a/DocumentAi/src/V1/EnableProcessorRequest.php b/DocumentAi/src/V1/EnableProcessorRequest.php index 797214123655..69f0290c3ae4 100644 --- a/DocumentAi/src/V1/EnableProcessorRequest.php +++ b/DocumentAi/src/V1/EnableProcessorRequest.php @@ -10,7 +10,8 @@ /** * Request message for the - * [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] method. + * [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] + * method. * * Generated from protobuf message google.cloud.documentai.v1.EnableProcessorRequest */ diff --git a/DocumentAi/src/V1/EnableProcessorResponse.php b/DocumentAi/src/V1/EnableProcessorResponse.php index fb2ad3323e41..573c89ac5fa2 100644 --- a/DocumentAi/src/V1/EnableProcessorResponse.php +++ b/DocumentAi/src/V1/EnableProcessorResponse.php @@ -10,8 +10,8 @@ /** * Response message for the - * [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] method. - * Intentionally empty proto for adding fields in future. + * [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] + * method. Intentionally empty proto for adding fields in future. * * Generated from protobuf message google.cloud.documentai.v1.EnableProcessorResponse */ diff --git a/DocumentAi/src/V1/EvaluateProcessorVersionRequest.php b/DocumentAi/src/V1/EvaluateProcessorVersionRequest.php index a7f5d5e64ecd..bd08972c749c 100644 --- a/DocumentAi/src/V1/EvaluateProcessorVersionRequest.php +++ b/DocumentAi/src/V1/EvaluateProcessorVersionRequest.php @@ -9,29 +9,35 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Evaluates the given [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] against the supplied documents. + * Evaluates the given + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] against the + * supplied documents. * * Generated from protobuf message google.cloud.documentai.v1.EvaluateProcessorVersionRequest */ class EvaluateProcessorVersionRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * Generated from protobuf field string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ private $processor_version = ''; /** - * Optional. The documents used in the evaluation. If unspecified, use the processor's - * dataset as evaluation input. + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. * * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; */ private $evaluation_documents = null; /** - * @param string $processorVersion Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. + * @param string $processorVersion Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * Please see {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. * @@ -52,11 +58,13 @@ public static function build(string $processorVersion): self * Optional. Data for populating the Message object. * * @type string $processor_version - * Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @type \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $evaluation_documents - * Optional. The documents used in the evaluation. If unspecified, use the processor's - * dataset as evaluation input. + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. * } */ public function __construct($data = NULL) { @@ -65,7 +73,9 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * Generated from protobuf field string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -77,7 +87,9 @@ public function getProcessorVersion() } /** - * Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * Generated from protobuf field string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -93,8 +105,8 @@ public function setProcessorVersion($var) } /** - * Optional. The documents used in the evaluation. If unspecified, use the processor's - * dataset as evaluation input. + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. * * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig|null @@ -115,8 +127,8 @@ public function clearEvaluationDocuments() } /** - * Optional. The documents used in the evaluation. If unspecified, use the processor's - * dataset as evaluation input. + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. * * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $var diff --git a/DocumentAi/src/V1/FetchProcessorTypesRequest.php b/DocumentAi/src/V1/FetchProcessorTypesRequest.php index 47792e9acdf2..679b71159dac 100644 --- a/DocumentAi/src/V1/FetchProcessorTypesRequest.php +++ b/DocumentAi/src/V1/FetchProcessorTypesRequest.php @@ -10,8 +10,9 @@ /** * Request message for the - * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes] method. - * Some processor types may require the project be added to an allowlist. + * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes] + * method. Some processor types may require the project be added to an + * allowlist. * * Generated from protobuf message google.cloud.documentai.v1.FetchProcessorTypesRequest */ diff --git a/DocumentAi/src/V1/FetchProcessorTypesResponse.php b/DocumentAi/src/V1/FetchProcessorTypesResponse.php index 812b11f22a0f..dd5747eca369 100644 --- a/DocumentAi/src/V1/FetchProcessorTypesResponse.php +++ b/DocumentAi/src/V1/FetchProcessorTypesResponse.php @@ -10,7 +10,8 @@ /** * Response message for the - * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes] method. + * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes] + * method. * * Generated from protobuf message google.cloud.documentai.v1.FetchProcessorTypesResponse */ diff --git a/DocumentAi/src/V1/Gapic/DocumentProcessorServiceGapicClient.php b/DocumentAi/src/V1/Gapic/DocumentProcessorServiceGapicClient.php index 38e3a24c9cea..27f2ccb8a23a 100644 --- a/DocumentAi/src/V1/Gapic/DocumentProcessorServiceGapicClient.php +++ b/DocumentAi/src/V1/Gapic/DocumentProcessorServiceGapicClient.php @@ -611,7 +611,8 @@ public function __construct(array $options = []) * } * ``` * - * @param string $name Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + * @param string $name Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or @@ -692,8 +693,9 @@ public function batchProcessDocuments($name, array $optionalArgs = []) } /** - * Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. - * The processor will be at `ENABLED` state by default after its creation. + * Creates a processor from the + * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The + * processor will be at `ENABLED` state by default after its creation. * * Sample code: * ``` @@ -707,10 +709,13 @@ public function batchProcessDocuments($name, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` - * @param Processor $processor Required. The processor to be created, requires [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] to be set. Also, the [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * @param string $parent Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + * @param Processor $processor Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] * field must be set if the processor is under CMEK. * @param array $optionalArgs { * Optional. @@ -1152,14 +1157,16 @@ public function enableProcessor($name, array $optionalArgs = []) * } * ``` * - * @param string $processorVersion Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to evaluate. + * @param string $processorVersion Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param array $optionalArgs { * Optional. * * @type BatchDocumentsInputConfig $evaluationDocuments - * Optional. The documents used in the evaluation. If unspecified, use the processor's - * dataset as evaluation input. + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1199,7 +1206,8 @@ public function evaluateProcessorVersion( } /** - * Fetches processor types. Note that we don't use [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + * Fetches processor types. Note that we don't use + * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] * here, because it isn't paginated. * * Sample code: @@ -1262,7 +1270,8 @@ public function fetchProcessorTypes($parent, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The resource name of the [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * @param string $name Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` * @param array $optionalArgs { * Optional. @@ -1467,7 +1476,9 @@ public function getProcessorVersion($name, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. + * @param string $parent Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param array $optionalArgs { * Optional. @@ -1623,8 +1634,9 @@ public function listProcessorTypes($parent, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * @param string $parent Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * @param array $optionalArgs { * Optional. * @@ -1701,8 +1713,8 @@ public function listProcessorVersions($parent, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * @param string $parent Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @param array $optionalArgs { * Optional. * @@ -1767,11 +1779,15 @@ public function listProcessors($parent, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or + * @param string $name Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use - * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param array $optionalArgs { * Optional. @@ -1786,7 +1802,8 @@ public function listProcessors($parent, array $optionalArgs = []) * Whether human review should be skipped for this request. Default to * `false`. * @type FieldMask $fieldMask - * Specifies which fields to include in the [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] * output. Only supports top-level document and pages field, so it must be in * the form of `{document_field_name}` or `pages.{page_field_name}`. * @type ProcessOptions $processOptions @@ -1896,8 +1913,9 @@ public function processDocument($name, array $optionalArgs = []) * } * ``` * - * @param string $humanReviewConfig Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - * reviewed with. + * @param string $humanReviewConfig Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. * @param array $optionalArgs { * Optional. * @@ -1959,8 +1977,10 @@ public function reviewDocument($humanReviewConfig, array $optionalArgs = []) } /** - * Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in - * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and + * Set the default (active) version of a + * [Processor][google.cloud.documentai.v1.Processor] that will be used in + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + * and * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. * * Sample code: @@ -2000,9 +2020,12 @@ public function reviewDocument($humanReviewConfig, array $optionalArgs = []) * } * ``` * - * @param string $processor Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version. - * @param string $defaultProcessorVersion Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default. - * Format: + * @param string $processor Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. + * @param string $defaultProcessorVersion Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` * @param array $optionalArgs { * Optional. @@ -2083,8 +2106,9 @@ public function setDefaultProcessorVersion( * } * ``` * - * @param string $parent Required. The parent (project, location and processor) to create the new version for. - * Format: `projects/{project}/locations/{location}/processors/{processor}`. + * @param string $parent Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. * @param ProcessorVersion $processorVersion Required. The processor version to be created. * @param array $optionalArgs { * Optional. @@ -2096,10 +2120,11 @@ public function setDefaultProcessorVersion( * @type DocumentSchema $documentSchema * Optional. The schema the processor version will be trained with. * @type InputData $inputData - * Optional. The input data used to train the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * @type string $baseProcessorVersion - * Optional. The processor version to use as a base for training. This processor version - * must be a child of `parent`. Format: + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an diff --git a/DocumentAi/src/V1/GetEvaluationRequest.php b/DocumentAi/src/V1/GetEvaluationRequest.php index f29706db5760..3f6b6397979c 100644 --- a/DocumentAi/src/V1/GetEvaluationRequest.php +++ b/DocumentAi/src/V1/GetEvaluationRequest.php @@ -16,7 +16,8 @@ class GetEvaluationRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -24,7 +25,8 @@ class GetEvaluationRequest extends \Google\Protobuf\Internal\Message private $name = ''; /** - * @param string $name Required. The resource name of the [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * @param string $name Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` * Please see {@see DocumentProcessorServiceClient::evaluationName()} for help formatting this field. * @@ -45,7 +47,8 @@ public static function build(string $name): self * Optional. Data for populating the Message object. * * @type string $name - * Required. The resource name of the [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` * } */ @@ -55,7 +58,8 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of the [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -67,7 +71,8 @@ public function getName() } /** - * Required. The resource name of the [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { diff --git a/DocumentAi/src/V1/GetProcessorRequest.php b/DocumentAi/src/V1/GetProcessorRequest.php index b30cc50bfae5..a436dc92b9f1 100644 --- a/DocumentAi/src/V1/GetProcessorRequest.php +++ b/DocumentAi/src/V1/GetProcessorRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Request message for the [GetProcessor][google.cloud.documentai.v1.DocumentProcessorService.GetProcessor] + * Request message for the + * [GetProcessor][google.cloud.documentai.v1.DocumentProcessorService.GetProcessor] * method. * * Generated from protobuf message google.cloud.documentai.v1.GetProcessorRequest diff --git a/DocumentAi/src/V1/GetProcessorTypeRequest.php b/DocumentAi/src/V1/GetProcessorTypeRequest.php index 3291e6d676c4..c93b93eddb47 100644 --- a/DocumentAi/src/V1/GetProcessorTypeRequest.php +++ b/DocumentAi/src/V1/GetProcessorTypeRequest.php @@ -10,7 +10,8 @@ /** * Request message for the - * [GetProcessorType][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType] method. + * [GetProcessorType][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType] + * method. * * Generated from protobuf message google.cloud.documentai.v1.GetProcessorTypeRequest */ diff --git a/DocumentAi/src/V1/GetProcessorVersionRequest.php b/DocumentAi/src/V1/GetProcessorVersionRequest.php index 6e00df63688e..8596ab9e93dd 100644 --- a/DocumentAi/src/V1/GetProcessorVersionRequest.php +++ b/DocumentAi/src/V1/GetProcessorVersionRequest.php @@ -10,7 +10,8 @@ /** * Request message for the - * [GetProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion] method. + * [GetProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion] + * method. * * Generated from protobuf message google.cloud.documentai.v1.GetProcessorVersionRequest */ diff --git a/DocumentAi/src/V1/HumanReviewStatus.php b/DocumentAi/src/V1/HumanReviewStatus.php index 7c05ed063c39..d40f6f0f9913 100644 --- a/DocumentAi/src/V1/HumanReviewStatus.php +++ b/DocumentAi/src/V1/HumanReviewStatus.php @@ -29,9 +29,11 @@ class HumanReviewStatus extends \Google\Protobuf\Internal\Message private $state_message = ''; /** * The name of the operation triggered by the processed document. This field - * is populated only when the [state][google.cloud.documentai.v1.HumanReviewStatus.state] is `HUMAN_REVIEW_IN_PROGRESS`. It has - * the same response type and metadata as the long-running operation returned - * by [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. + * is populated only when the + * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is + * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + * the long-running operation returned by + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. * * Generated from protobuf field string human_review_operation = 3; */ @@ -49,9 +51,11 @@ class HumanReviewStatus extends \Google\Protobuf\Internal\Message * A message providing more details about the human review state. * @type string $human_review_operation * The name of the operation triggered by the processed document. This field - * is populated only when the [state][google.cloud.documentai.v1.HumanReviewStatus.state] is `HUMAN_REVIEW_IN_PROGRESS`. It has - * the same response type and metadata as the long-running operation returned - * by [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. + * is populated only when the + * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is + * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + * the long-running operation returned by + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. * } */ public function __construct($data = NULL) { @@ -113,9 +117,11 @@ public function setStateMessage($var) /** * The name of the operation triggered by the processed document. This field - * is populated only when the [state][google.cloud.documentai.v1.HumanReviewStatus.state] is `HUMAN_REVIEW_IN_PROGRESS`. It has - * the same response type and metadata as the long-running operation returned - * by [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. + * is populated only when the + * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is + * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + * the long-running operation returned by + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. * * Generated from protobuf field string human_review_operation = 3; * @return string @@ -127,9 +133,11 @@ public function getHumanReviewOperation() /** * The name of the operation triggered by the processed document. This field - * is populated only when the [state][google.cloud.documentai.v1.HumanReviewStatus.state] is `HUMAN_REVIEW_IN_PROGRESS`. It has - * the same response type and metadata as the long-running operation returned - * by [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. + * is populated only when the + * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is + * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + * the long-running operation returned by + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. * * Generated from protobuf field string human_review_operation = 3; * @param string $var diff --git a/DocumentAi/src/V1/HumanReviewStatus/State.php b/DocumentAi/src/V1/HumanReviewStatus/State.php index 5da0162c4568..2cb38208abcf 100644 --- a/DocumentAi/src/V1/HumanReviewStatus/State.php +++ b/DocumentAi/src/V1/HumanReviewStatus/State.php @@ -41,7 +41,8 @@ class State const IN_PROGRESS = 3; /** * Some error happened during triggering human review, see the - * [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message] for details. + * [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message] + * for details. * * Generated from protobuf enum ERROR = 4; */ diff --git a/DocumentAi/src/V1/ListEvaluationsRequest.php b/DocumentAi/src/V1/ListEvaluationsRequest.php index ad9d039a546b..3ca00303ab73 100644 --- a/DocumentAi/src/V1/ListEvaluationsRequest.php +++ b/DocumentAi/src/V1/ListEvaluationsRequest.php @@ -9,14 +9,17 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Retrieves a list of evaluations for a given [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Retrieves a list of evaluations for a given + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * * Generated from protobuf message google.cloud.documentai.v1.ListEvaluationsRequest */ class ListEvaluationsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -39,7 +42,9 @@ class ListEvaluationsRequest extends \Google\Protobuf\Internal\Message private $page_token = ''; /** - * @param string $parent Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. + * @param string $parent Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * Please see {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. * @@ -60,7 +65,9 @@ public static function build(string $parent): self * Optional. Data for populating the Message object. * * @type string $parent - * Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @type int $page_size * The standard list page size. @@ -77,7 +84,9 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -89,7 +98,9 @@ public function getParent() } /** - * Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list evaluations for. + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { diff --git a/DocumentAi/src/V1/ListProcessorTypesRequest.php b/DocumentAi/src/V1/ListProcessorTypesRequest.php index 4687d456a055..f6a6ff74339f 100644 --- a/DocumentAi/src/V1/ListProcessorTypesRequest.php +++ b/DocumentAi/src/V1/ListProcessorTypesRequest.php @@ -10,8 +10,9 @@ /** * Request message for the - * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] method. - * Some processor types may require the project be added to an allowlist. + * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + * method. Some processor types may require the project be added to an + * allowlist. * * Generated from protobuf message google.cloud.documentai.v1.ListProcessorTypesRequest */ diff --git a/DocumentAi/src/V1/ListProcessorTypesResponse.php b/DocumentAi/src/V1/ListProcessorTypesResponse.php index 1b5c2fca8332..cad6cb143783 100644 --- a/DocumentAi/src/V1/ListProcessorTypesResponse.php +++ b/DocumentAi/src/V1/ListProcessorTypesResponse.php @@ -10,7 +10,8 @@ /** * Response message for the - * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] method. + * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + * method. * * Generated from protobuf message google.cloud.documentai.v1.ListProcessorTypesResponse */ diff --git a/DocumentAi/src/V1/ListProcessorVersionsRequest.php b/DocumentAi/src/V1/ListProcessorVersionsRequest.php index 91005ac879f7..0855408ca8f3 100644 --- a/DocumentAi/src/V1/ListProcessorVersionsRequest.php +++ b/DocumentAi/src/V1/ListProcessorVersionsRequest.php @@ -16,8 +16,9 @@ class ListProcessorVersionsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -39,8 +40,9 @@ class ListProcessorVersionsRequest extends \Google\Protobuf\Internal\Message private $page_token = ''; /** - * @param string $parent Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * @param string $parent Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * Please see {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. * * @return \Google\Cloud\DocumentAI\V1\ListProcessorVersionsRequest @@ -60,8 +62,9 @@ public static function build(string $parent): self * Optional. Data for populating the Message object. * * @type string $parent - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * @type int $page_size * The maximum number of processor versions to return. * If unspecified, at most `10` processor versions will be returned. @@ -77,8 +80,9 @@ public function __construct($data = NULL) { } /** - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -89,8 +93,9 @@ public function getParent() } /** - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DocumentAi/src/V1/ListProcessorsRequest.php b/DocumentAi/src/V1/ListProcessorsRequest.php index 4b0946a0f25f..ed6ea01b0f2c 100644 --- a/DocumentAi/src/V1/ListProcessorsRequest.php +++ b/DocumentAi/src/V1/ListProcessorsRequest.php @@ -16,8 +16,8 @@ class ListProcessorsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -39,8 +39,8 @@ class ListProcessorsRequest extends \Google\Protobuf\Internal\Message private $page_token = ''; /** - * @param string $parent Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * @param string $parent Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * Please see {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. * * @return \Google\Cloud\DocumentAI\V1\ListProcessorsRequest @@ -60,8 +60,8 @@ public static function build(string $parent): self * Optional. Data for populating the Message object. * * @type string $parent - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @type int $page_size * The maximum number of processors to return. * If unspecified, at most `50` processors will be returned. @@ -77,8 +77,8 @@ public function __construct($data = NULL) { } /** - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -89,8 +89,8 @@ public function getParent() } /** - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DocumentAi/src/V1/ListProcessorsResponse.php b/DocumentAi/src/V1/ListProcessorsResponse.php index 626893ecbab0..bd8c34e6e2f1 100644 --- a/DocumentAi/src/V1/ListProcessorsResponse.php +++ b/DocumentAi/src/V1/ListProcessorsResponse.php @@ -10,7 +10,8 @@ /** * Response message for the - * [ListProcessors][google.cloud.documentai.v1.DocumentProcessorService.ListProcessors] method. + * [ListProcessors][google.cloud.documentai.v1.DocumentProcessorService.ListProcessors] + * method. * * Generated from protobuf message google.cloud.documentai.v1.ListProcessorsResponse */ diff --git a/DocumentAi/src/V1/OcrConfig.php b/DocumentAi/src/V1/OcrConfig.php index 30f924135328..aa89f0c91389 100644 --- a/DocumentAi/src/V1/OcrConfig.php +++ b/DocumentAi/src/V1/OcrConfig.php @@ -55,7 +55,9 @@ class OcrConfig extends \Google\Protobuf\Internal\Message private $enable_symbol = false; /** * Turn on font identification model and return font style information. - * Deprecated, use [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] instead. + * Deprecated, use + * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] + * instead. * * Generated from protobuf field bool compute_style_info = 8 [deprecated = true]; * @deprecated @@ -101,7 +103,9 @@ class OcrConfig extends \Google\Protobuf\Internal\Message * Includes symbol level OCR information if set to true. * @type bool $compute_style_info * Turn on font identification model and return font style information. - * Deprecated, use [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] instead. + * Deprecated, use + * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] + * instead. * @type bool $disable_character_boxes_detection * Turn off character box detector in OCR engine. Character box detection is * enabled by default in OCR 2.0 (and later) processors. @@ -272,7 +276,9 @@ public function setEnableSymbol($var) /** * Turn on font identification model and return font style information. - * Deprecated, use [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] instead. + * Deprecated, use + * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] + * instead. * * Generated from protobuf field bool compute_style_info = 8 [deprecated = true]; * @return bool @@ -286,7 +292,9 @@ public function getComputeStyleInfo() /** * Turn on font identification model and return font style information. - * Deprecated, use [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] instead. + * Deprecated, use + * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] + * instead. * * Generated from protobuf field bool compute_style_info = 8 [deprecated = true]; * @param bool $var diff --git a/DocumentAi/src/V1/ProcessOptions.php b/DocumentAi/src/V1/ProcessOptions.php index f5261cb564e1..8a043b1dcc4e 100644 --- a/DocumentAi/src/V1/ProcessOptions.php +++ b/DocumentAi/src/V1/ProcessOptions.php @@ -23,9 +23,18 @@ class ProcessOptions extends \Google\Protobuf\Internal\Message */ private $ocr_config = null; /** - * Optional. Override the schema of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will return an Invalid - * Argument error if this field is set when the underlying - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't support schema override. + * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig layout_config = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $layout_config = null; + /** + * Optional. Override the schema of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will + * return an Invalid Argument error if this field is set when the underlying + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't + * support schema override. * * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema schema_override = 8 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -48,10 +57,15 @@ class ProcessOptions extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DocumentAI\V1\OcrConfig $ocr_config * Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. * Returns error if set on other processor types. + * @type \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig $layout_config + * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. + * Returns error if set on other processor types. * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $schema_override - * Optional. Override the schema of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will return an Invalid - * Argument error if this field is set when the underlying - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't support schema override. + * Optional. Override the schema of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will + * return an Invalid Argument error if this field is set when the underlying + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't + * support schema override. * } */ public function __construct($data = NULL) { @@ -193,9 +207,49 @@ public function setOcrConfig($var) } /** - * Optional. Override the schema of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will return an Invalid - * Argument error if this field is set when the underlying - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't support schema override. + * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig layout_config = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig|null + */ + public function getLayoutConfig() + { + return $this->layout_config; + } + + public function hasLayoutConfig() + { + return isset($this->layout_config); + } + + public function clearLayoutConfig() + { + unset($this->layout_config); + } + + /** + * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig layout_config = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig $var + * @return $this + */ + public function setLayoutConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig::class); + $this->layout_config = $var; + + return $this; + } + + /** + * Optional. Override the schema of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will + * return an Invalid Argument error if this field is set when the underlying + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't + * support schema override. * * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema schema_override = 8 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\DocumentAI\V1\DocumentSchema|null @@ -216,9 +270,11 @@ public function clearSchemaOverride() } /** - * Optional. Override the schema of the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will return an Invalid - * Argument error if this field is set when the underlying - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't support schema override. + * Optional. Override the schema of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will + * return an Invalid Argument error if this field is set when the underlying + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't + * support schema override. * * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema schema_override = 8 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\DocumentAI\V1\DocumentSchema $var diff --git a/DocumentAi/src/V1/ProcessOptions/LayoutConfig.php b/DocumentAi/src/V1/ProcessOptions/LayoutConfig.php new file mode 100644 index 000000000000..0a3dc30126c3 --- /dev/null +++ b/DocumentAi/src/V1/ProcessOptions/LayoutConfig.php @@ -0,0 +1,78 @@ +google.cloud.documentai.v1.ProcessOptions.LayoutConfig + */ +class LayoutConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Config for chunking in layout parser processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig chunking_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $chunking_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig $chunking_config + * Optional. Config for chunking in layout parser processor. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Config for chunking in layout parser processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig chunking_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig|null + */ + public function getChunkingConfig() + { + return $this->chunking_config; + } + + public function hasChunkingConfig() + { + return isset($this->chunking_config); + } + + public function clearChunkingConfig() + { + unset($this->chunking_config); + } + + /** + * Optional. Config for chunking in layout parser processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig chunking_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig $var + * @return $this + */ + public function setChunkingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig::class); + $this->chunking_config = $var; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php b/DocumentAi/src/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php new file mode 100644 index 000000000000..d25d4d23d93b --- /dev/null +++ b/DocumentAi/src/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php @@ -0,0 +1,106 @@ +google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + */ +class ChunkingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The chunk sizes to use when splitting documents, in order of + * level. + * + * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $chunk_size = 0; + /** + * Optional. Whether or not to include ancestor headings when splitting. + * + * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $include_ancestor_headings = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $chunk_size + * Optional. The chunk sizes to use when splitting documents, in order of + * level. + * @type bool $include_ancestor_headings + * Optional. Whether or not to include ancestor headings when splitting. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The chunk sizes to use when splitting documents, in order of + * level. + * + * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getChunkSize() + { + return $this->chunk_size; + } + + /** + * Optional. The chunk sizes to use when splitting documents, in order of + * level. + * + * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setChunkSize($var) + { + GPBUtil::checkInt32($var); + $this->chunk_size = $var; + + return $this; + } + + /** + * Optional. Whether or not to include ancestor headings when splitting. + * + * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIncludeAncestorHeadings() + { + return $this->include_ancestor_headings; + } + + /** + * Optional. Whether or not to include ancestor headings when splitting. + * + * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIncludeAncestorHeadings($var) + { + GPBUtil::checkBool($var); + $this->include_ancestor_headings = $var; + + return $this; + } + +} + + diff --git a/DocumentAi/src/V1/ProcessRequest.php b/DocumentAi/src/V1/ProcessRequest.php index 77b8d1de93dc..80d84227d6ab 100644 --- a/DocumentAi/src/V1/ProcessRequest.php +++ b/DocumentAi/src/V1/ProcessRequest.php @@ -10,18 +10,23 @@ /** * Request message for the - * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] method. + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + * method. * * Generated from protobuf message google.cloud.documentai.v1.ProcessRequest */ class ProcessRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use - * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -35,7 +40,8 @@ class ProcessRequest extends \Google\Protobuf\Internal\Message */ private $skip_human_review = false; /** - * Specifies which fields to include in the [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] * output. Only supports top-level document and pages field, so it must be in * the form of `{document_field_name}` or `pages.{page_field_name}`. * @@ -61,11 +67,15 @@ class ProcessRequest extends \Google\Protobuf\Internal\Message protected $source; /** - * @param string $name Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or + * @param string $name Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use - * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * @return \Google\Cloud\DocumentAI\V1\ProcessRequest @@ -91,17 +101,22 @@ public static function build(string $name): self * @type \Google\Cloud\DocumentAI\V1\GcsDocument $gcs_document * A raw document on Google Cloud Storage. * @type string $name - * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use - * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @type bool $skip_human_review * Whether human review should be skipped for this request. Default to * `false`. * @type \Google\Protobuf\FieldMask $field_mask - * Specifies which fields to include in the [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] * output. Only supports top-level document and pages field, so it must be in * the form of `{document_field_name}` or `pages.{page_field_name}`. * @type \Google\Cloud\DocumentAI\V1\ProcessOptions $process_options @@ -213,11 +228,15 @@ public function setGcsDocument($var) } /** - * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use - * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -229,11 +248,15 @@ public function getName() } /** - * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use - * its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -277,7 +300,8 @@ public function setSkipHumanReview($var) } /** - * Specifies which fields to include in the [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] * output. Only supports top-level document and pages field, so it must be in * the form of `{document_field_name}` or `pages.{page_field_name}`. * @@ -300,7 +324,8 @@ public function clearFieldMask() } /** - * Specifies which fields to include in the [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] * output. Only supports top-level document and pages field, so it must be in * the form of `{document_field_name}` or `pages.{page_field_name}`. * diff --git a/DocumentAi/src/V1/ProcessResponse.php b/DocumentAi/src/V1/ProcessResponse.php index 297d6a35b52d..bf2379e49104 100644 --- a/DocumentAi/src/V1/ProcessResponse.php +++ b/DocumentAi/src/V1/ProcessResponse.php @@ -10,7 +10,8 @@ /** * Response message for the - * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] method. + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + * method. * * Generated from protobuf message google.cloud.documentai.v1.ProcessResponse */ diff --git a/DocumentAi/src/V1/Processor.php b/DocumentAi/src/V1/Processor.php index 3c4ff0be7656..63b353aa3bcc 100644 --- a/DocumentAi/src/V1/Processor.php +++ b/DocumentAi/src/V1/Processor.php @@ -56,7 +56,8 @@ class Processor extends \Google\Protobuf\Internal\Message */ private $processor_version_aliases; /** - * Output only. Immutable. The http endpoint that can be called to invoke processing. + * Output only. Immutable. The http endpoint that can be called to invoke + * processing. * * Generated from protobuf field string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ @@ -74,6 +75,18 @@ class Processor extends \Google\Protobuf\Internal\Message * Generated from protobuf field string kms_key_name = 8; */ private $kms_key_name = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $satisfies_pzs = false; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $satisfies_pzi = false; /** * Constructor. @@ -97,12 +110,17 @@ class Processor extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\DocumentAI\V1\ProcessorVersionAlias>|\Google\Protobuf\Internal\RepeatedField $processor_version_aliases * Output only. The processor version aliases. * @type string $process_endpoint - * Output only. Immutable. The http endpoint that can be called to invoke processing. + * Output only. Immutable. The http endpoint that can be called to invoke + * processing. * @type \Google\Protobuf\Timestamp $create_time * The time the processor was created. * @type string $kms_key_name * The [KMS key](https://cloud.google.com/security-key-management) used for * encryption and decryption in CMEK scenarios. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. * } */ public function __construct($data = NULL) { @@ -273,7 +291,8 @@ public function setProcessorVersionAliases($var) } /** - * Output only. Immutable. The http endpoint that can be called to invoke processing. + * Output only. Immutable. The http endpoint that can be called to invoke + * processing. * * Generated from protobuf field string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; * @return string @@ -284,7 +303,8 @@ public function getProcessEndpoint() } /** - * Output only. Immutable. The http endpoint that can be called to invoke processing. + * Output only. Immutable. The http endpoint that can be called to invoke + * processing. * * Generated from protobuf field string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; * @param string $var @@ -362,5 +382,57 @@ public function setKmsKeyName($var) return $this; } + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return $this->satisfies_pzi; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + } diff --git a/DocumentAi/src/V1/ProcessorVersion.php b/DocumentAi/src/V1/ProcessorVersion.php index f743ace094d3..c272716b922f 100644 --- a/DocumentAi/src/V1/ProcessorVersion.php +++ b/DocumentAi/src/V1/ProcessorVersion.php @@ -19,11 +19,11 @@ class ProcessorVersion extends \Google\Protobuf\Internal\Message { /** - * The resource name of the processor version. + * Identifier. The resource name of the processor version. * Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` * - * Generated from protobuf field string name = 1; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ private $name = ''; /** @@ -39,9 +39,9 @@ class ProcessorVersion extends \Google\Protobuf\Internal\Message */ private $document_schema = null; /** - * The state of the processor version. + * Output only. The state of the processor version. * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $state = 0; /** @@ -86,6 +86,18 @@ class ProcessorVersion extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.ModelType model_type = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $model_type = 0; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $satisfies_pzs = false; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $satisfies_pzi = false; /** * Constructor. @@ -94,7 +106,7 @@ class ProcessorVersion extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * The resource name of the processor version. + * Identifier. The resource name of the processor version. * Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` * @type string $display_name @@ -102,7 +114,7 @@ class ProcessorVersion extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $document_schema * The schema of the processor version. Describes the output. * @type int $state - * The state of the processor version. + * Output only. The state of the processor version. * @type \Google\Protobuf\Timestamp $create_time * The time the processor version was created. * @type \Google\Cloud\DocumentAI\V1\EvaluationReference $latest_evaluation @@ -117,6 +129,10 @@ class ProcessorVersion extends \Google\Protobuf\Internal\Message * If set, information about the eventual deprecation of this version. * @type int $model_type * Output only. The model type of this processor version. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. * } */ public function __construct($data = NULL) { @@ -125,11 +141,11 @@ public function __construct($data = NULL) { } /** - * The resource name of the processor version. + * Identifier. The resource name of the processor version. * Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` * - * Generated from protobuf field string name = 1; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @return string */ public function getName() @@ -138,11 +154,11 @@ public function getName() } /** - * The resource name of the processor version. + * Identifier. The resource name of the processor version. * Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` * - * Generated from protobuf field string name = 1; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @param string $var * @return $this */ @@ -217,9 +233,9 @@ public function setDocumentSchema($var) } /** - * The state of the processor version. + * Output only. The state of the processor version. * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int */ public function getState() @@ -228,9 +244,9 @@ public function getState() } /** - * The state of the processor version. + * Output only. The state of the processor version. * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6; + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var * @return $this */ @@ -454,5 +470,57 @@ public function setModelType($var) return $this; } + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return $this->satisfies_pzi; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + } diff --git a/DocumentAi/src/V1/ReviewDocumentOperationMetadata.php b/DocumentAi/src/V1/ReviewDocumentOperationMetadata.php index 7f22bdf322c6..5be3e52f8db9 100644 --- a/DocumentAi/src/V1/ReviewDocumentOperationMetadata.php +++ b/DocumentAi/src/V1/ReviewDocumentOperationMetadata.php @@ -10,7 +10,8 @@ /** * The long-running operation metadata for the - * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] method. + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] + * method. * * Generated from protobuf message google.cloud.documentai.v1.ReviewDocumentOperationMetadata */ diff --git a/DocumentAi/src/V1/ReviewDocumentRequest.php b/DocumentAi/src/V1/ReviewDocumentRequest.php index ca1664b39c8e..e91cdc317a00 100644 --- a/DocumentAi/src/V1/ReviewDocumentRequest.php +++ b/DocumentAi/src/V1/ReviewDocumentRequest.php @@ -10,15 +10,17 @@ /** * Request message for the - * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] method. + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] + * method. * * Generated from protobuf message google.cloud.documentai.v1.ReviewDocumentRequest */ class ReviewDocumentRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - * reviewed with. + * Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. * * Generated from protobuf field string human_review_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -44,8 +46,9 @@ class ReviewDocumentRequest extends \Google\Protobuf\Internal\Message protected $source; /** - * @param string $humanReviewConfig Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - * reviewed with. Please see + * @param string $humanReviewConfig Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. Please see * {@see DocumentProcessorServiceClient::humanReviewConfigName()} for help formatting this field. * * @return \Google\Cloud\DocumentAI\V1\ReviewDocumentRequest @@ -67,8 +70,9 @@ public static function build(string $humanReviewConfig): self * @type \Google\Cloud\DocumentAI\V1\Document $inline_document * An inline document proto. * @type string $human_review_config - * Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - * reviewed with. + * Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. * @type bool $enable_schema_validation * Whether the validation should be performed on the ad-hoc review request. * @type int $priority @@ -114,8 +118,9 @@ public function setInlineDocument($var) } /** - * Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - * reviewed with. + * Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. * * Generated from protobuf field string human_review_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -126,8 +131,9 @@ public function getHumanReviewConfig() } /** - * Required. The resource name of the [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be - * reviewed with. + * Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. * * Generated from protobuf field string human_review_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DocumentAi/src/V1/ReviewDocumentResponse.php b/DocumentAi/src/V1/ReviewDocumentResponse.php index 076819827de5..e6ab07dbc3c3 100644 --- a/DocumentAi/src/V1/ReviewDocumentResponse.php +++ b/DocumentAi/src/V1/ReviewDocumentResponse.php @@ -10,7 +10,8 @@ /** * Response message for the - * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] method. + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] + * method. * * Generated from protobuf message google.cloud.documentai.v1.ReviewDocumentResponse */ diff --git a/DocumentAi/src/V1/SetDefaultProcessorVersionRequest.php b/DocumentAi/src/V1/SetDefaultProcessorVersionRequest.php index 14de7ad1d620..7f3deceb62b8 100644 --- a/DocumentAi/src/V1/SetDefaultProcessorVersionRequest.php +++ b/DocumentAi/src/V1/SetDefaultProcessorVersionRequest.php @@ -18,14 +18,17 @@ class SetDefaultProcessorVersionRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version. + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. * * Generated from protobuf field string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ private $processor = ''; /** - * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default. - * Format: + * Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` * * Generated from protobuf field string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -39,10 +42,13 @@ class SetDefaultProcessorVersionRequest extends \Google\Protobuf\Internal\Messag * Optional. Data for populating the Message object. * * @type string $processor - * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version. + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. * @type string $default_processor_version - * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default. - * Format: + * Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` * } */ @@ -52,7 +58,9 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version. + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. * * Generated from protobuf field string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -63,7 +71,9 @@ public function getProcessor() } /** - * Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version. + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. * * Generated from protobuf field string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -78,8 +88,9 @@ public function setProcessor($var) } /** - * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default. - * Format: + * Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` * * Generated from protobuf field string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -91,8 +102,9 @@ public function getDefaultProcessorVersion() } /** - * Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default. - * Format: + * Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` * * Generated from protobuf field string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { diff --git a/DocumentAi/src/V1/TrainProcessorVersionRequest.php b/DocumentAi/src/V1/TrainProcessorVersionRequest.php index 7c79a6bd7bb9..c41e756c0948 100644 --- a/DocumentAi/src/V1/TrainProcessorVersionRequest.php +++ b/DocumentAi/src/V1/TrainProcessorVersionRequest.php @@ -18,8 +18,9 @@ class TrainProcessorVersionRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The parent (project, location and processor) to create the new version for. - * Format: `projects/{project}/locations/{location}/processors/{processor}`. + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -37,14 +38,15 @@ class TrainProcessorVersionRequest extends \Google\Protobuf\Internal\Message */ private $document_schema = null; /** - * Optional. The input data used to train the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; */ private $input_data = null; /** - * Optional. The processor version to use as a base for training. This processor version - * must be a child of `parent`. Format: + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. * * Generated from protobuf field string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; @@ -53,8 +55,9 @@ class TrainProcessorVersionRequest extends \Google\Protobuf\Internal\Message protected $processor_flags; /** - * @param string $parent Required. The parent (project, location and processor) to create the new version for. - * Format: `projects/{project}/locations/{location}/processors/{processor}`. Please see + * @param string $parent Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. Please see * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion $processorVersion Required. The processor version to be created. * @@ -80,17 +83,19 @@ public static function build(string $parent, \Google\Cloud\DocumentAI\V1\Process * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\FoundationModelTuningOptions $foundation_model_tuning_options * Options to control foundation model tuning of a processor. * @type string $parent - * Required. The parent (project, location and processor) to create the new version for. - * Format: `projects/{project}/locations/{location}/processors/{processor}`. + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion $processor_version * Required. The processor version to be created. * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $document_schema * Optional. The schema the processor version will be trained with. * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData $input_data - * Optional. The input data used to train the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * @type string $base_processor_version - * Optional. The processor version to use as a base for training. This processor version - * must be a child of `parent`. Format: + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. * } */ @@ -162,8 +167,9 @@ public function setFoundationModelTuningOptions($var) } /** - * Required. The parent (project, location and processor) to create the new version for. - * Format: `projects/{project}/locations/{location}/processors/{processor}`. + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -174,8 +180,9 @@ public function getParent() } /** - * Required. The parent (project, location and processor) to create the new version for. - * Format: `projects/{project}/locations/{location}/processors/{processor}`. + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -262,7 +269,8 @@ public function setDocumentSchema($var) } /** - * Optional. The input data used to train the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData|null @@ -283,7 +291,8 @@ public function clearInputData() } /** - * Optional. The input data used to train the [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData $var @@ -298,8 +307,8 @@ public function setInputData($var) } /** - * Optional. The processor version to use as a base for training. This processor version - * must be a child of `parent`. Format: + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. * * Generated from protobuf field string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; @@ -311,8 +320,8 @@ public function getBaseProcessorVersion() } /** - * Optional. The processor version to use as a base for training. This processor version - * must be a child of `parent`. Format: + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. * * Generated from protobuf field string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/DocumentAi/src/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php b/DocumentAi/src/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php index 4bf65b9547f3..8572dd583155 100644 --- a/DocumentAi/src/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php +++ b/DocumentAi/src/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php @@ -16,16 +16,16 @@ class FoundationModelTuningOptions extends \Google\Protobuf\Internal\Message { /** - * Optional. The number of steps to run for model tuning. Valid values are between - * 1 and 400. If not provided, recommended steps will be used. + * Optional. The number of steps to run for model tuning. Valid values are + * between 1 and 400. If not provided, recommended steps will be used. * * Generated from protobuf field int32 train_steps = 2 [(.google.api.field_behavior) = OPTIONAL]; */ private $train_steps = 0; /** - * Optional. The multiplier to apply to the recommended learning rate. Valid values - * are between 0.1 and 10. If not provided, recommended learning rate will - * be used. + * Optional. The multiplier to apply to the recommended learning rate. Valid + * values are between 0.1 and 10. If not provided, recommended learning rate + * will be used. * * Generated from protobuf field float learning_rate_multiplier = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -38,12 +38,12 @@ class FoundationModelTuningOptions extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $train_steps - * Optional. The number of steps to run for model tuning. Valid values are between - * 1 and 400. If not provided, recommended steps will be used. + * Optional. The number of steps to run for model tuning. Valid values are + * between 1 and 400. If not provided, recommended steps will be used. * @type float $learning_rate_multiplier - * Optional. The multiplier to apply to the recommended learning rate. Valid values - * are between 0.1 and 10. If not provided, recommended learning rate will - * be used. + * Optional. The multiplier to apply to the recommended learning rate. Valid + * values are between 0.1 and 10. If not provided, recommended learning rate + * will be used. * } */ public function __construct($data = NULL) { @@ -52,8 +52,8 @@ public function __construct($data = NULL) { } /** - * Optional. The number of steps to run for model tuning. Valid values are between - * 1 and 400. If not provided, recommended steps will be used. + * Optional. The number of steps to run for model tuning. Valid values are + * between 1 and 400. If not provided, recommended steps will be used. * * Generated from protobuf field int32 train_steps = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -64,8 +64,8 @@ public function getTrainSteps() } /** - * Optional. The number of steps to run for model tuning. Valid values are between - * 1 and 400. If not provided, recommended steps will be used. + * Optional. The number of steps to run for model tuning. Valid values are + * between 1 and 400. If not provided, recommended steps will be used. * * Generated from protobuf field int32 train_steps = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -80,9 +80,9 @@ public function setTrainSteps($var) } /** - * Optional. The multiplier to apply to the recommended learning rate. Valid values - * are between 0.1 and 10. If not provided, recommended learning rate will - * be used. + * Optional. The multiplier to apply to the recommended learning rate. Valid + * values are between 0.1 and 10. If not provided, recommended learning rate + * will be used. * * Generated from protobuf field float learning_rate_multiplier = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return float @@ -93,9 +93,9 @@ public function getLearningRateMultiplier() } /** - * Optional. The multiplier to apply to the recommended learning rate. Valid values - * are between 0.1 and 10. If not provided, recommended learning rate will - * be used. + * Optional. The multiplier to apply to the recommended learning rate. Valid + * values are between 0.1 and 10. If not provided, recommended learning rate + * will be used. * * Generated from protobuf field float learning_rate_multiplier = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param float $var diff --git a/DocumentAi/src/V1/TrainProcessorVersionRequest/InputData.php b/DocumentAi/src/V1/TrainProcessorVersionRequest/InputData.php index 856f8daaf9ed..c82fa1453462 100644 --- a/DocumentAi/src/V1/TrainProcessorVersionRequest/InputData.php +++ b/DocumentAi/src/V1/TrainProcessorVersionRequest/InputData.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The input data used to train a new [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * The input data used to train a new + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. * * Generated from protobuf message google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData */ diff --git a/DocumentAi/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php b/DocumentAi/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php index dca152cb8451..5c883050f60a 100644 --- a/DocumentAi/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php +++ b/DocumentAi/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php @@ -244,6 +244,8 @@ public function createProcessorTest() $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; $processEndpoint = 'processEndpoint-178717339'; $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new Processor(); $expectedResponse->setName($name); $expectedResponse->setType($type); @@ -251,6 +253,8 @@ public function createProcessorTest() $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); $expectedResponse->setProcessEndpoint($processEndpoint); $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -1182,6 +1186,8 @@ public function getProcessorTest() $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; $processEndpoint = 'processEndpoint-178717339'; $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new Processor(); $expectedResponse->setName($name2); $expectedResponse->setType($type); @@ -1189,6 +1195,8 @@ public function getProcessorTest() $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); $expectedResponse->setProcessEndpoint($processEndpoint); $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); @@ -1325,12 +1333,16 @@ public function getProcessorVersionTest() $kmsKeyName = 'kmsKeyName2094986649'; $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; $googleManaged = false; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new ProcessorVersion(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setKmsKeyName($kmsKeyName); $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); $expectedResponse->setGoogleManaged($googleManaged); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); diff --git a/DocumentAi/tests/Unit/V1/DocumentProcessorServiceClientTest.php b/DocumentAi/tests/Unit/V1/DocumentProcessorServiceClientTest.php index 5468691c2f78..b941841b6838 100644 --- a/DocumentAi/tests/Unit/V1/DocumentProcessorServiceClientTest.php +++ b/DocumentAi/tests/Unit/V1/DocumentProcessorServiceClientTest.php @@ -216,6 +216,8 @@ public function createProcessorTest() $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; $processEndpoint = 'processEndpoint-178717339'; $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new Processor(); $expectedResponse->setName($name); $expectedResponse->setType($type); @@ -223,6 +225,8 @@ public function createProcessorTest() $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); $expectedResponse->setProcessEndpoint($processEndpoint); $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -1116,6 +1120,8 @@ public function getProcessorTest() $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; $processEndpoint = 'processEndpoint-178717339'; $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new Processor(); $expectedResponse->setName($name2); $expectedResponse->setType($type); @@ -1123,6 +1129,8 @@ public function getProcessorTest() $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); $expectedResponse->setProcessEndpoint($processEndpoint); $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); @@ -1251,12 +1259,16 @@ public function getProcessorVersionTest() $kmsKeyName = 'kmsKeyName2094986649'; $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; $googleManaged = false; + $satisfiesPzs = false; + $satisfiesPzi = false; $expectedResponse = new ProcessorVersion(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setKmsKeyName($kmsKeyName); $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); $expectedResponse->setGoogleManaged($googleManaged); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); diff --git a/Domains/.repo-metadata.json b/Domains/.repo-metadata.json deleted file mode 100644 index c69ab8fac391..000000000000 --- a/Domains/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-domains", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-domains/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "domains" -} diff --git a/Domains/VERSION b/Domains/VERSION index be14282b7fff..d1d899fa33a0 100644 --- a/Domains/VERSION +++ b/Domains/VERSION @@ -1 +1 @@ -0.5.3 +0.5.5 diff --git a/Domains/composer.json b/Domains/composer.json index 8a90b8a01d81..9e4e979f080b 100644 --- a/Domains/composer.json +++ b/Domains/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Domains/src/V1/Client/DomainsClient.php b/Domains/src/V1/Client/DomainsClient.php index fb9328f6ca4f..d248b8ad719c 100644 --- a/Domains/src/V1/Client/DomainsClient.php +++ b/Domains/src/V1/Client/DomainsClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -55,6 +54,7 @@ use Google\Cloud\Domains\V1\SearchDomainsResponse; use Google\Cloud\Domains\V1\TransferDomainRequest; use Google\Cloud\Domains\V1\UpdateRegistrationRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -164,6 +164,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. diff --git a/Domains/tests/Unit/V1/Client/DomainsClientTest.php b/Domains/tests/Unit/V1/Client/DomainsClientTest.php index 18bf51522718..760bf5ae0ea6 100644 --- a/Domains/tests/Unit/V1/Client/DomainsClientTest.php +++ b/Domains/tests/Unit/V1/Client/DomainsClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Domains\V1\AuthorizationCode; @@ -52,6 +51,7 @@ use Google\Cloud\Domains\V1\SearchDomainsResponse; use Google\Cloud\Domains\V1\TransferDomainRequest; use Google\Cloud\Domains\V1\UpdateRegistrationRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/EdgeNetwork/.repo-metadata.json b/EdgeNetwork/.repo-metadata.json deleted file mode 100644 index a59a390fe889..000000000000 --- a/EdgeNetwork/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-edgenetwork", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-edgenetwork/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "edgenetwork" -} diff --git a/EdgeNetwork/VERSION b/EdgeNetwork/VERSION index 42045acae20f..449d7e73a966 100644 --- a/EdgeNetwork/VERSION +++ b/EdgeNetwork/VERSION @@ -1 +1 @@ -0.3.4 +0.3.6 diff --git a/EdgeNetwork/composer.json b/EdgeNetwork/composer.json index f451170ef5c9..b7034f4d2f02 100644 --- a/EdgeNetwork/composer.json +++ b/EdgeNetwork/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/EdgeNetwork/src/V1/Client/EdgeNetworkClient.php b/EdgeNetwork/src/V1/Client/EdgeNetworkClient.php index 6e68131e6af4..8644dbd0d123 100644 --- a/EdgeNetwork/src/V1/Client/EdgeNetworkClient.php +++ b/EdgeNetwork/src/V1/Client/EdgeNetworkClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -74,6 +73,7 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -199,6 +199,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a interconnect * resource. diff --git a/EdgeNetwork/tests/Unit/V1/Client/EdgeNetworkClientTest.php b/EdgeNetwork/tests/Unit/V1/Client/EdgeNetworkClientTest.php index b3985cb127a0..6051d25f95de 100644 --- a/EdgeNetwork/tests/Unit/V1/Client/EdgeNetworkClientTest.php +++ b/EdgeNetwork/tests/Unit/V1/Client/EdgeNetworkClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient; @@ -74,6 +73,7 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/ErrorReporting/.repo-metadata.json b/ErrorReporting/.repo-metadata.json deleted file mode 100644 index d88da01f8369..000000000000 --- a/ErrorReporting/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-error-reporting", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-error-reporting/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "clouderrorreporting" -} diff --git a/ErrorReporting/VERSION b/ErrorReporting/VERSION index 4240544f330c..18fb7feceb3c 100644 --- a/ErrorReporting/VERSION +++ b/ErrorReporting/VERSION @@ -1 +1 @@ -0.22.4 +0.22.6 diff --git a/ErrorReporting/composer.json b/ErrorReporting/composer.json index e90b8094a600..4ca07fcd0c65 100644 --- a/ErrorReporting/composer.json +++ b/ErrorReporting/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^8.0", "google/cloud-logging": "^1.29", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/EssentialContacts/.repo-metadata.json b/EssentialContacts/.repo-metadata.json deleted file mode 100644 index a1281ebab45e..000000000000 --- a/EssentialContacts/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-essential-contacts", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-essential-contacts/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "essentialcontacts" -} diff --git a/EssentialContacts/README.md b/EssentialContacts/README.md index a1ea945b53a9..c992cdebfaff 100644 --- a/EssentialContacts/README.md +++ b/EssentialContacts/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/EssentialContacts/VERSION b/EssentialContacts/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/EssentialContacts/VERSION +++ b/EssentialContacts/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/EssentialContacts/composer.json b/EssentialContacts/composer.json index 29d3f61f39cb..52d226235a2b 100644 --- a/EssentialContacts/composer.json +++ b/EssentialContacts/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/EssentialContacts/owlbot.py b/EssentialContacts/owlbot.py index 87283d223625..ac492678ceca 100644 --- a/EssentialContacts/owlbot.py +++ b/EssentialContacts/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,34 +32,25 @@ php.owlbot_main(src=src, dest=dest) -# Change the wording for the deprecation warning. +# remove class_alias code s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/EssentialContacts/src/V1/Client/EssentialContactsServiceClient.php b/EssentialContacts/src/V1/Client/EssentialContactsServiceClient.php index cba8798b43b9..b9a6ddbf1f35 100644 --- a/EssentialContacts/src/V1/Client/EssentialContactsServiceClient.php +++ b/EssentialContacts/src/V1/Client/EssentialContactsServiceClient.php @@ -1,6 +1,6 @@ [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/essential_contacts_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/essential_contacts_service_rest_client_config.php', ], ], ]; diff --git a/EssentialContacts/src/V1/ComputeContactsRequest.php b/EssentialContacts/src/V1/ComputeContactsRequest.php index 5693b0e7bae3..a00eed430a0d 100644 --- a/EssentialContacts/src/V1/ComputeContactsRequest.php +++ b/EssentialContacts/src/V1/ComputeContactsRequest.php @@ -22,7 +22,7 @@ class ComputeContactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The categories of notifications to compute contacts for. If ALL is included * in this list, contacts subscribed to any notification category will be @@ -39,7 +39,7 @@ class ComputeContactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. If present, retrieves the next batch of results from the * preceding call to this method. `page_token` must be the value of @@ -48,7 +48,7 @@ class ComputeContactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Constructor. diff --git a/EssentialContacts/src/V1/ComputeContactsResponse.php b/EssentialContacts/src/V1/ComputeContactsResponse.php index f3b72a17e8c8..3bd97e666fdd 100644 --- a/EssentialContacts/src/V1/ComputeContactsResponse.php +++ b/EssentialContacts/src/V1/ComputeContactsResponse.php @@ -31,7 +31,7 @@ class ComputeContactsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/EssentialContacts/src/V1/Contact.php b/EssentialContacts/src/V1/Contact.php index 96038a7147c5..c0a08d7aeb7f 100644 --- a/EssentialContacts/src/V1/Contact.php +++ b/EssentialContacts/src/V1/Contact.php @@ -21,14 +21,14 @@ class Contact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The email address to send notifications to. The email address * does not need to be a Google Account. * * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $email = ''; + protected $email = ''; /** * Required. The categories of notifications that the contact will receive * communications for. @@ -44,14 +44,14 @@ class Contact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string language_tag = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $language_tag = ''; + protected $language_tag = ''; /** * The validity of the contact. A contact is considered valid if it is the * correct recipient for notifications for a particular resource. * * Generated from protobuf field .google.cloud.essentialcontacts.v1.ValidationState validation_state = 8; */ - private $validation_state = 0; + protected $validation_state = 0; /** * The last time the validation_state was updated, either manually or * automatically. A contact is considered stale if its validation state was @@ -59,7 +59,7 @@ class Contact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp validate_time = 9; */ - private $validate_time = null; + protected $validate_time = null; /** * Constructor. diff --git a/EssentialContacts/src/V1/CreateContactRequest.php b/EssentialContacts/src/V1/CreateContactRequest.php index 6c985b032229..aa04a1644f45 100644 --- a/EssentialContacts/src/V1/CreateContactRequest.php +++ b/EssentialContacts/src/V1/CreateContactRequest.php @@ -22,14 +22,14 @@ class CreateContactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The contact to create. Must specify an email address and language * tag. * * Generated from protobuf field .google.cloud.essentialcontacts.v1.Contact contact = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $contact = null; + protected $contact = null; /** * @param string $parent Required. The resource to save this contact for. diff --git a/EssentialContacts/src/V1/DeleteContactRequest.php b/EssentialContacts/src/V1/DeleteContactRequest.php index a33fc9f8375c..f07753c9588d 100644 --- a/EssentialContacts/src/V1/DeleteContactRequest.php +++ b/EssentialContacts/src/V1/DeleteContactRequest.php @@ -23,7 +23,7 @@ class DeleteContactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the contact to delete. diff --git a/EssentialContacts/src/V1/EssentialContactsServiceClient.php b/EssentialContacts/src/V1/EssentialContactsServiceClient.php deleted file mode 100644 index 387279b3275b..000000000000 --- a/EssentialContacts/src/V1/EssentialContactsServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.essentialcontacts.v1.EssentialContactsService/CreateContact', - $argument, - ['\Google\Cloud\EssentialContacts\V1\Contact', 'decode'], - $metadata, $options); - } - - /** - * Updates a contact. - * Note: A contact's email address cannot be changed. - * @param \Google\Cloud\EssentialContacts\V1\UpdateContactRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateContact(\Google\Cloud\EssentialContacts\V1\UpdateContactRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.essentialcontacts.v1.EssentialContactsService/UpdateContact', - $argument, - ['\Google\Cloud\EssentialContacts\V1\Contact', 'decode'], - $metadata, $options); - } - - /** - * Lists the contacts that have been set on a resource. - * @param \Google\Cloud\EssentialContacts\V1\ListContactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListContacts(\Google\Cloud\EssentialContacts\V1\ListContactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.essentialcontacts.v1.EssentialContactsService/ListContacts', - $argument, - ['\Google\Cloud\EssentialContacts\V1\ListContactsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a single contact. - * @param \Google\Cloud\EssentialContacts\V1\GetContactRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetContact(\Google\Cloud\EssentialContacts\V1\GetContactRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.essentialcontacts.v1.EssentialContactsService/GetContact', - $argument, - ['\Google\Cloud\EssentialContacts\V1\Contact', 'decode'], - $metadata, $options); - } - - /** - * Deletes a contact. - * @param \Google\Cloud\EssentialContacts\V1\DeleteContactRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteContact(\Google\Cloud\EssentialContacts\V1\DeleteContactRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.essentialcontacts.v1.EssentialContactsService/DeleteContact', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Lists all contacts for the resource that are subscribed to the - * specified notification categories, including contacts inherited from - * any parent resources. - * @param \Google\Cloud\EssentialContacts\V1\ComputeContactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ComputeContacts(\Google\Cloud\EssentialContacts\V1\ComputeContactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.essentialcontacts.v1.EssentialContactsService/ComputeContacts', - $argument, - ['\Google\Cloud\EssentialContacts\V1\ComputeContactsResponse', 'decode'], - $metadata, $options); - } - - /** - * Allows a contact admin to send a test message to contact to verify that it - * has been configured correctly. - * @param \Google\Cloud\EssentialContacts\V1\SendTestMessageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SendTestMessage(\Google\Cloud\EssentialContacts\V1\SendTestMessageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.essentialcontacts.v1.EssentialContactsService/SendTestMessage', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/EssentialContacts/src/V1/Gapic/EssentialContactsServiceGapicClient.php b/EssentialContacts/src/V1/Gapic/EssentialContactsServiceGapicClient.php deleted file mode 100644 index 5920dc108fd3..000000000000 --- a/EssentialContacts/src/V1/Gapic/EssentialContactsServiceGapicClient.php +++ /dev/null @@ -1,829 +0,0 @@ -projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $essentialContactsServiceClient->computeContacts($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $essentialContactsServiceClient->computeContacts($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $essentialContactsServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\EssentialContacts\V1\Client\EssentialContactsServiceClient}. - */ -class EssentialContactsServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.essentialcontacts.v1.EssentialContactsService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'essentialcontacts.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'essentialcontacts.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $contactNameTemplate; - - private static $folderNameTemplate; - - private static $folderContactNameTemplate; - - private static $organizationNameTemplate; - - private static $organizationContactNameTemplate; - - private static $projectNameTemplate; - - private static $projectContactNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/essential_contacts_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/essential_contacts_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/essential_contacts_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/essential_contacts_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getContactNameTemplate() - { - if (self::$contactNameTemplate == null) { - self::$contactNameTemplate = new PathTemplate('projects/{project}/contacts/{contact}'); - } - - return self::$contactNameTemplate; - } - - private static function getFolderNameTemplate() - { - if (self::$folderNameTemplate == null) { - self::$folderNameTemplate = new PathTemplate('folders/{folder}'); - } - - return self::$folderNameTemplate; - } - - private static function getFolderContactNameTemplate() - { - if (self::$folderContactNameTemplate == null) { - self::$folderContactNameTemplate = new PathTemplate('folders/{folder}/contacts/{contact}'); - } - - return self::$folderContactNameTemplate; - } - - private static function getOrganizationNameTemplate() - { - if (self::$organizationNameTemplate == null) { - self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); - } - - return self::$organizationNameTemplate; - } - - private static function getOrganizationContactNameTemplate() - { - if (self::$organizationContactNameTemplate == null) { - self::$organizationContactNameTemplate = new PathTemplate('organizations/{organization}/contacts/{contact}'); - } - - return self::$organizationContactNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectContactNameTemplate() - { - if (self::$projectContactNameTemplate == null) { - self::$projectContactNameTemplate = new PathTemplate('projects/{project}/contacts/{contact}'); - } - - return self::$projectContactNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'contact' => self::getContactNameTemplate(), - 'folder' => self::getFolderNameTemplate(), - 'folderContact' => self::getFolderContactNameTemplate(), - 'organization' => self::getOrganizationNameTemplate(), - 'organizationContact' => self::getOrganizationContactNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectContact' => self::getProjectContactNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a contact - * resource. - * - * @param string $project - * @param string $contact - * - * @return string The formatted contact resource. - */ - public static function contactName($project, $contact) - { - return self::getContactNameTemplate()->render([ - 'project' => $project, - 'contact' => $contact, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a folder - * resource. - * - * @param string $folder - * - * @return string The formatted folder resource. - */ - public static function folderName($folder) - { - return self::getFolderNameTemplate()->render([ - 'folder' => $folder, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_contact resource. - * - * @param string $folder - * @param string $contact - * - * @return string The formatted folder_contact resource. - */ - public static function folderContactName($folder, $contact) - { - return self::getFolderContactNameTemplate()->render([ - 'folder' => $folder, - 'contact' => $contact, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a organization - * resource. - * - * @param string $organization - * - * @return string The formatted organization resource. - */ - public static function organizationName($organization) - { - return self::getOrganizationNameTemplate()->render([ - 'organization' => $organization, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_contact resource. - * - * @param string $organization - * @param string $contact - * - * @return string The formatted organization_contact resource. - */ - public static function organizationContactName($organization, $contact) - { - return self::getOrganizationContactNameTemplate()->render([ - 'organization' => $organization, - 'contact' => $contact, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_contact resource. - * - * @param string $project - * @param string $contact - * - * @return string The formatted project_contact resource. - */ - public static function projectContactName($project, $contact) - { - return self::getProjectContactNameTemplate()->render([ - 'project' => $project, - 'contact' => $contact, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - contact: projects/{project}/contacts/{contact} - * - folder: folders/{folder} - * - folderContact: folders/{folder}/contacts/{contact} - * - organization: organizations/{organization} - * - organizationContact: organizations/{organization}/contacts/{contact} - * - project: projects/{project} - * - projectContact: projects/{project}/contacts/{contact} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'essentialcontacts.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Lists all contacts for the resource that are subscribed to the - * specified notification categories, including contacts inherited from - * any parent resources. - * - * Sample code: - * ``` - * $essentialContactsServiceClient = new EssentialContactsServiceClient(); - * try { - * $formattedParent = $essentialContactsServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $essentialContactsServiceClient->computeContacts($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $essentialContactsServiceClient->computeContacts($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $essentialContactsServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the resource to compute contacts for. - * Format: organizations/{organization_id}, - * folders/{folder_id} or projects/{project_id} - * @param array $optionalArgs { - * Optional. - * - * @type int[] $notificationCategories - * The categories of notifications to compute contacts for. If ALL is included - * in this list, contacts subscribed to any notification category will be - * returned. - * For allowed values, use constants defined on {@see \Google\Cloud\EssentialContacts\V1\NotificationCategory} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function computeContacts($parent, array $optionalArgs = []) - { - $request = new ComputeContactsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['notificationCategories'])) { - $request->setNotificationCategories($optionalArgs['notificationCategories']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ComputeContacts', $optionalArgs, ComputeContactsResponse::class, $request); - } - - /** - * Adds a new contact for a resource. - * - * Sample code: - * ``` - * $essentialContactsServiceClient = new EssentialContactsServiceClient(); - * try { - * $formattedParent = $essentialContactsServiceClient->projectName('[PROJECT]'); - * $contact = new Contact(); - * $response = $essentialContactsServiceClient->createContact($formattedParent, $contact); - * } finally { - * $essentialContactsServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource to save this contact for. - * Format: organizations/{organization_id}, folders/{folder_id} or - * projects/{project_id} - * @param Contact $contact Required. The contact to create. Must specify an email address and language - * tag. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\EssentialContacts\V1\Contact - * - * @throws ApiException if the remote call fails - */ - public function createContact($parent, $contact, array $optionalArgs = []) - { - $request = new CreateContactRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setContact($contact); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateContact', Contact::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a contact. - * - * Sample code: - * ``` - * $essentialContactsServiceClient = new EssentialContactsServiceClient(); - * try { - * $formattedName = $essentialContactsServiceClient->contactName('[PROJECT]', '[CONTACT]'); - * $essentialContactsServiceClient->deleteContact($formattedName); - * } finally { - * $essentialContactsServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the contact to delete. - * Format: organizations/{organization_id}/contacts/{contact_id}, - * folders/{folder_id}/contacts/{contact_id} or - * projects/{project_id}/contacts/{contact_id} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteContact($name, array $optionalArgs = []) - { - $request = new DeleteContactRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteContact', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a single contact. - * - * Sample code: - * ``` - * $essentialContactsServiceClient = new EssentialContactsServiceClient(); - * try { - * $formattedName = $essentialContactsServiceClient->contactName('[PROJECT]', '[CONTACT]'); - * $response = $essentialContactsServiceClient->getContact($formattedName); - * } finally { - * $essentialContactsServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the contact to retrieve. - * Format: organizations/{organization_id}/contacts/{contact_id}, - * folders/{folder_id}/contacts/{contact_id} or - * projects/{project_id}/contacts/{contact_id} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\EssentialContacts\V1\Contact - * - * @throws ApiException if the remote call fails - */ - public function getContact($name, array $optionalArgs = []) - { - $request = new GetContactRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetContact', Contact::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists the contacts that have been set on a resource. - * - * Sample code: - * ``` - * $essentialContactsServiceClient = new EssentialContactsServiceClient(); - * try { - * $formattedParent = $essentialContactsServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $essentialContactsServiceClient->listContacts($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $essentialContactsServiceClient->listContacts($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $essentialContactsServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name. - * Format: organizations/{organization_id}, folders/{folder_id} or - * projects/{project_id} - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listContacts($parent, array $optionalArgs = []) - { - $request = new ListContactsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListContacts', $optionalArgs, ListContactsResponse::class, $request); - } - - /** - * Allows a contact admin to send a test message to contact to verify that it - * has been configured correctly. - * - * Sample code: - * ``` - * $essentialContactsServiceClient = new EssentialContactsServiceClient(); - * try { - * $formattedContacts = [ - * $essentialContactsServiceClient->contactName('[PROJECT]', '[CONTACT]'), - * ]; - * $formattedResource = $essentialContactsServiceClient->projectName('[PROJECT]'); - * $notificationCategory = NotificationCategory::NOTIFICATION_CATEGORY_UNSPECIFIED; - * $essentialContactsServiceClient->sendTestMessage($formattedContacts, $formattedResource, $notificationCategory); - * } finally { - * $essentialContactsServiceClient->close(); - * } - * ``` - * - * @param string[] $contacts Required. The list of names of the contacts to send a test message to. - * Format: organizations/{organization_id}/contacts/{contact_id}, - * folders/{folder_id}/contacts/{contact_id} or - * projects/{project_id}/contacts/{contact_id} - * @param string $resource Required. The name of the resource to send the test message for. All - * contacts must either be set directly on this resource or inherited from - * another resource that is an ancestor of this one. Format: - * organizations/{organization_id}, folders/{folder_id} or - * projects/{project_id} - * @param int $notificationCategory Required. The notification category to send the test message for. All - * contacts must be subscribed to this category. - * For allowed values, use constants defined on {@see \Google\Cloud\EssentialContacts\V1\NotificationCategory} - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function sendTestMessage($contacts, $resource, $notificationCategory, array $optionalArgs = []) - { - $request = new SendTestMessageRequest(); - $requestParamHeaders = []; - $request->setContacts($contacts); - $request->setResource($resource); - $request->setNotificationCategory($notificationCategory); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SendTestMessage', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a contact. - * Note: A contact's email address cannot be changed. - * - * Sample code: - * ``` - * $essentialContactsServiceClient = new EssentialContactsServiceClient(); - * try { - * $contact = new Contact(); - * $response = $essentialContactsServiceClient->updateContact($contact); - * } finally { - * $essentialContactsServiceClient->close(); - * } - * ``` - * - * @param Contact $contact Required. The contact resource to replace the existing saved contact. Note: - * the email address of the contact cannot be modified. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. The update mask applied to the resource. For the `FieldMask` - * definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\EssentialContacts\V1\Contact - * - * @throws ApiException if the remote call fails - */ - public function updateContact($contact, array $optionalArgs = []) - { - $request = new UpdateContactRequest(); - $requestParamHeaders = []; - $request->setContact($contact); - $requestParamHeaders['contact.name'] = $contact->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateContact', Contact::class, $optionalArgs, $request)->wait(); - } -} diff --git a/EssentialContacts/src/V1/GetContactRequest.php b/EssentialContacts/src/V1/GetContactRequest.php index e95874e58c94..dbdbff500ad2 100644 --- a/EssentialContacts/src/V1/GetContactRequest.php +++ b/EssentialContacts/src/V1/GetContactRequest.php @@ -23,7 +23,7 @@ class GetContactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the contact to retrieve. diff --git a/EssentialContacts/src/V1/ListContactsRequest.php b/EssentialContacts/src/V1/ListContactsRequest.php index 11bb0290cbbf..4cb6c56e7bb4 100644 --- a/EssentialContacts/src/V1/ListContactsRequest.php +++ b/EssentialContacts/src/V1/ListContactsRequest.php @@ -22,7 +22,7 @@ class ListContactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `next_page_token` in the @@ -31,7 +31,7 @@ class ListContactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. If present, retrieves the next batch of results from the * preceding call to this method. `page_token` must be the value of @@ -40,7 +40,7 @@ class ListContactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The parent resource name. diff --git a/EssentialContacts/src/V1/ListContactsResponse.php b/EssentialContacts/src/V1/ListContactsResponse.php index 35d0b8a48210..7d094531e0d4 100644 --- a/EssentialContacts/src/V1/ListContactsResponse.php +++ b/EssentialContacts/src/V1/ListContactsResponse.php @@ -29,7 +29,7 @@ class ListContactsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/EssentialContacts/src/V1/SendTestMessageRequest.php b/EssentialContacts/src/V1/SendTestMessageRequest.php index 6eb343d8e77c..e756f41f0c33 100644 --- a/EssentialContacts/src/V1/SendTestMessageRequest.php +++ b/EssentialContacts/src/V1/SendTestMessageRequest.php @@ -33,14 +33,14 @@ class SendTestMessageRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string resource = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $resource = ''; + protected $resource = ''; /** * Required. The notification category to send the test message for. All * contacts must be subscribed to this category. * * Generated from protobuf field .google.cloud.essentialcontacts.v1.NotificationCategory notification_category = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $notification_category = 0; + protected $notification_category = 0; /** * Constructor. diff --git a/EssentialContacts/src/V1/UpdateContactRequest.php b/EssentialContacts/src/V1/UpdateContactRequest.php index d72808e8c35e..33f95f31b4a2 100644 --- a/EssentialContacts/src/V1/UpdateContactRequest.php +++ b/EssentialContacts/src/V1/UpdateContactRequest.php @@ -21,7 +21,7 @@ class UpdateContactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.essentialcontacts.v1.Contact contact = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $contact = null; + protected $contact = null; /** * Optional. The update mask applied to the resource. For the `FieldMask` * definition, see @@ -29,7 +29,7 @@ class UpdateContactRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\EssentialContacts\V1\Contact $contact Required. The contact resource to replace the existing saved contact. Note: diff --git a/EssentialContacts/tests/Unit/V1/Client/EssentialContactsServiceClientTest.php b/EssentialContacts/tests/Unit/V1/Client/EssentialContactsServiceClientTest.php index 5fca404df55e..778a6dce89e0 100644 --- a/EssentialContacts/tests/Unit/V1/Client/EssentialContactsServiceClientTest.php +++ b/EssentialContacts/tests/Unit/V1/Client/EssentialContactsServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return EssentialContactsServiceClient */ @@ -81,17 +83,14 @@ public function computeContactsTest() // Mock response $nextPageToken = ''; $contactsElement = new Contact(); - $contacts = [ - $contactsElement, - ]; + $contacts = [$contactsElement]; $expectedResponse = new ComputeContactsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setContacts($contacts); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ComputeContactsRequest()) - ->setParent($formattedParent); + $request = (new ComputeContactsRequest())->setParent($formattedParent); $response = $gapicClient->computeContacts($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -101,7 +100,10 @@ public function computeContactsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/ComputeContacts', $actualFuncCall); + $this->assertSame( + '/google.cloud.essentialcontacts.v1.EssentialContactsService/ComputeContacts', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -118,17 +120,19 @@ public function computeContactsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ComputeContactsRequest()) - ->setParent($formattedParent); + $request = (new ComputeContactsRequest())->setParent($formattedParent); try { $gapicClient->computeContacts($request); // If the $gapicClient method call did not throw, fail the test @@ -168,9 +172,7 @@ public function createContactTest() $contact->setNotificationCategorySubscriptions($contactNotificationCategorySubscriptions); $contactLanguageTag = 'contactLanguageTag229803234'; $contact->setLanguageTag($contactLanguageTag); - $request = (new CreateContactRequest()) - ->setParent($formattedParent) - ->setContact($contact); + $request = (new CreateContactRequest())->setParent($formattedParent)->setContact($contact); $response = $gapicClient->createContact($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -196,12 +198,15 @@ public function createContactExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); @@ -212,9 +217,7 @@ public function createContactExceptionTest() $contact->setNotificationCategorySubscriptions($contactNotificationCategorySubscriptions); $contactLanguageTag = 'contactLanguageTag229803234'; $contact->setLanguageTag($contactLanguageTag); - $request = (new CreateContactRequest()) - ->setParent($formattedParent) - ->setContact($contact); + $request = (new CreateContactRequest())->setParent($formattedParent)->setContact($contact); try { $gapicClient->createContact($request); // If the $gapicClient method call did not throw, fail the test @@ -241,8 +244,7 @@ public function deleteContactTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->contactName('[PROJECT]', '[CONTACT]'); - $request = (new DeleteContactRequest()) - ->setName($formattedName); + $request = (new DeleteContactRequest())->setName($formattedName); $gapicClient->deleteContact($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -265,17 +267,19 @@ public function deleteContactExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->contactName('[PROJECT]', '[CONTACT]'); - $request = (new DeleteContactRequest()) - ->setName($formattedName); + $request = (new DeleteContactRequest())->setName($formattedName); try { $gapicClient->deleteContact($request); // If the $gapicClient method call did not throw, fail the test @@ -308,8 +312,7 @@ public function getContactTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->contactName('[PROJECT]', '[CONTACT]'); - $request = (new GetContactRequest()) - ->setName($formattedName); + $request = (new GetContactRequest())->setName($formattedName); $response = $gapicClient->getContact($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -333,17 +336,19 @@ public function getContactExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->contactName('[PROJECT]', '[CONTACT]'); - $request = (new GetContactRequest()) - ->setName($formattedName); + $request = (new GetContactRequest())->setName($formattedName); try { $gapicClient->getContact($request); // If the $gapicClient method call did not throw, fail the test @@ -368,17 +373,14 @@ public function listContactsTest() // Mock response $nextPageToken = ''; $contactsElement = new Contact(); - $contacts = [ - $contactsElement, - ]; + $contacts = [$contactsElement]; $expectedResponse = new ListContactsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setContacts($contacts); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListContactsRequest()) - ->setParent($formattedParent); + $request = (new ListContactsRequest())->setParent($formattedParent); $response = $gapicClient->listContacts($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -405,17 +407,19 @@ public function listContactsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListContactsRequest()) - ->setParent($formattedParent); + $request = (new ListContactsRequest())->setParent($formattedParent); try { $gapicClient->listContacts($request); // If the $gapicClient method call did not throw, fail the test @@ -441,9 +445,7 @@ public function sendTestMessageTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedContacts = [ - $gapicClient->contactName('[PROJECT]', '[CONTACT]'), - ]; + $formattedContacts = [$gapicClient->contactName('[PROJECT]', '[CONTACT]')]; $formattedResource = $gapicClient->projectName('[PROJECT]'); $notificationCategory = NotificationCategory::NOTIFICATION_CATEGORY_UNSPECIFIED; $request = (new SendTestMessageRequest()) @@ -455,7 +457,10 @@ public function sendTestMessageTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/SendTestMessage', $actualFuncCall); + $this->assertSame( + '/google.cloud.essentialcontacts.v1.EssentialContactsService/SendTestMessage', + $actualFuncCall + ); $actualValue = $actualRequestObject->getContacts(); $this->assertProtobufEquals($formattedContacts, $actualValue); $actualValue = $actualRequestObject->getResource(); @@ -476,17 +481,18 @@ public function sendTestMessageExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedContacts = [ - $gapicClient->contactName('[PROJECT]', '[CONTACT]'), - ]; + $formattedContacts = [$gapicClient->contactName('[PROJECT]', '[CONTACT]')]; $formattedResource = $gapicClient->projectName('[PROJECT]'); $notificationCategory = NotificationCategory::NOTIFICATION_CATEGORY_UNSPECIFIED; $request = (new SendTestMessageRequest()) @@ -531,8 +537,7 @@ public function updateContactTest() $contact->setNotificationCategorySubscriptions($contactNotificationCategorySubscriptions); $contactLanguageTag = 'contactLanguageTag229803234'; $contact->setLanguageTag($contactLanguageTag); - $request = (new UpdateContactRequest()) - ->setContact($contact); + $request = (new UpdateContactRequest())->setContact($contact); $response = $gapicClient->updateContact($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -556,12 +561,15 @@ public function updateContactExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $contact = new Contact(); @@ -571,8 +579,7 @@ public function updateContactExceptionTest() $contact->setNotificationCategorySubscriptions($contactNotificationCategorySubscriptions); $contactLanguageTag = 'contactLanguageTag229803234'; $contact->setLanguageTag($contactLanguageTag); - $request = (new UpdateContactRequest()) - ->setContact($contact); + $request = (new UpdateContactRequest())->setContact($contact); try { $gapicClient->updateContact($request); // If the $gapicClient method call did not throw, fail the test @@ -597,17 +604,14 @@ public function computeContactsAsyncTest() // Mock response $nextPageToken = ''; $contactsElement = new Contact(); - $contacts = [ - $contactsElement, - ]; + $contacts = [$contactsElement]; $expectedResponse = new ComputeContactsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setContacts($contacts); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ComputeContactsRequest()) - ->setParent($formattedParent); + $request = (new ComputeContactsRequest())->setParent($formattedParent); $response = $gapicClient->computeContactsAsync($request)->wait(); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -617,7 +621,10 @@ public function computeContactsAsyncTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/ComputeContacts', $actualFuncCall); + $this->assertSame( + '/google.cloud.essentialcontacts.v1.EssentialContactsService/ComputeContacts', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); diff --git a/EssentialContacts/tests/Unit/V1/EssentialContactsServiceClientTest.php b/EssentialContacts/tests/Unit/V1/EssentialContactsServiceClientTest.php deleted file mode 100644 index ee25269971f5..000000000000 --- a/EssentialContacts/tests/Unit/V1/EssentialContactsServiceClientTest.php +++ /dev/null @@ -1,547 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return EssentialContactsServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new EssentialContactsServiceClient($options); - } - - /** @test */ - public function computeContactsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $contactsElement = new Contact(); - $contacts = [ - $contactsElement, - ]; - $expectedResponse = new ComputeContactsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setContacts($contacts); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->computeContacts($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getContacts()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/ComputeContacts', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function computeContactsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->computeContacts($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createContactTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $email = 'email96619420'; - $languageTag = 'languageTag-2091510221'; - $expectedResponse = new Contact(); - $expectedResponse->setName($name); - $expectedResponse->setEmail($email); - $expectedResponse->setLanguageTag($languageTag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $contact = new Contact(); - $contactEmail = 'contactEmail1253690204'; - $contact->setEmail($contactEmail); - $contactNotificationCategorySubscriptions = []; - $contact->setNotificationCategorySubscriptions($contactNotificationCategorySubscriptions); - $contactLanguageTag = 'contactLanguageTag229803234'; - $contact->setLanguageTag($contactLanguageTag); - $response = $gapicClient->createContact($formattedParent, $contact); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/CreateContact', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getContact(); - $this->assertProtobufEquals($contact, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createContactExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $contact = new Contact(); - $contactEmail = 'contactEmail1253690204'; - $contact->setEmail($contactEmail); - $contactNotificationCategorySubscriptions = []; - $contact->setNotificationCategorySubscriptions($contactNotificationCategorySubscriptions); - $contactLanguageTag = 'contactLanguageTag229803234'; - $contact->setLanguageTag($contactLanguageTag); - try { - $gapicClient->createContact($formattedParent, $contact); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteContactTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->contactName('[PROJECT]', '[CONTACT]'); - $gapicClient->deleteContact($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/DeleteContact', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteContactExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->contactName('[PROJECT]', '[CONTACT]'); - try { - $gapicClient->deleteContact($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getContactTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $email = 'email96619420'; - $languageTag = 'languageTag-2091510221'; - $expectedResponse = new Contact(); - $expectedResponse->setName($name2); - $expectedResponse->setEmail($email); - $expectedResponse->setLanguageTag($languageTag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->contactName('[PROJECT]', '[CONTACT]'); - $response = $gapicClient->getContact($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/GetContact', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getContactExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->contactName('[PROJECT]', '[CONTACT]'); - try { - $gapicClient->getContact($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listContactsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $contactsElement = new Contact(); - $contacts = [ - $contactsElement, - ]; - $expectedResponse = new ListContactsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setContacts($contacts); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listContacts($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getContacts()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/ListContacts', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listContactsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listContacts($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function sendTestMessageTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedContacts = [ - $gapicClient->contactName('[PROJECT]', '[CONTACT]'), - ]; - $formattedResource = $gapicClient->projectName('[PROJECT]'); - $notificationCategory = NotificationCategory::NOTIFICATION_CATEGORY_UNSPECIFIED; - $gapicClient->sendTestMessage($formattedContacts, $formattedResource, $notificationCategory); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/SendTestMessage', $actualFuncCall); - $actualValue = $actualRequestObject->getContacts(); - $this->assertProtobufEquals($formattedContacts, $actualValue); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($formattedResource, $actualValue); - $actualValue = $actualRequestObject->getNotificationCategory(); - $this->assertProtobufEquals($notificationCategory, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function sendTestMessageExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedContacts = [ - $gapicClient->contactName('[PROJECT]', '[CONTACT]'), - ]; - $formattedResource = $gapicClient->projectName('[PROJECT]'); - $notificationCategory = NotificationCategory::NOTIFICATION_CATEGORY_UNSPECIFIED; - try { - $gapicClient->sendTestMessage($formattedContacts, $formattedResource, $notificationCategory); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateContactTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $email = 'email96619420'; - $languageTag = 'languageTag-2091510221'; - $expectedResponse = new Contact(); - $expectedResponse->setName($name); - $expectedResponse->setEmail($email); - $expectedResponse->setLanguageTag($languageTag); - $transport->addResponse($expectedResponse); - // Mock request - $contact = new Contact(); - $contactEmail = 'contactEmail1253690204'; - $contact->setEmail($contactEmail); - $contactNotificationCategorySubscriptions = []; - $contact->setNotificationCategorySubscriptions($contactNotificationCategorySubscriptions); - $contactLanguageTag = 'contactLanguageTag229803234'; - $contact->setLanguageTag($contactLanguageTag); - $response = $gapicClient->updateContact($contact); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.essentialcontacts.v1.EssentialContactsService/UpdateContact', $actualFuncCall); - $actualValue = $actualRequestObject->getContact(); - $this->assertProtobufEquals($contact, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateContactExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $contact = new Contact(); - $contactEmail = 'contactEmail1253690204'; - $contact->setEmail($contactEmail); - $contactNotificationCategorySubscriptions = []; - $contact->setNotificationCategorySubscriptions($contactNotificationCategorySubscriptions); - $contactLanguageTag = 'contactLanguageTag229803234'; - $contact->setLanguageTag($contactLanguageTag); - try { - $gapicClient->updateContact($contact); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Eventarc/.repo-metadata.json b/Eventarc/.repo-metadata.json deleted file mode 100644 index c49b360f2a23..000000000000 --- a/Eventarc/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-eventarc", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-eventarc/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "eventarc" -} diff --git a/Eventarc/VERSION b/Eventarc/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/Eventarc/VERSION +++ b/Eventarc/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/Eventarc/composer.json b/Eventarc/composer.json index 88294732ad92..9b2e101e7276 100644 --- a/Eventarc/composer.json +++ b/Eventarc/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/EventarcPublishing/.repo-metadata.json b/EventarcPublishing/.repo-metadata.json deleted file mode 100644 index 5291bccbb753..000000000000 --- a/EventarcPublishing/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-eventarc-publishing", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-eventarc-publishing/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "eventarcpublishing" -} diff --git a/EventarcPublishing/VERSION b/EventarcPublishing/VERSION index b6160487433b..d2b13eb644d6 100644 --- a/EventarcPublishing/VERSION +++ b/EventarcPublishing/VERSION @@ -1 +1 @@ -0.6.2 +0.6.4 diff --git a/EventarcPublishing/composer.json b/EventarcPublishing/composer.json index adcacca4ed3d..1277a3ff614b 100644 --- a/EventarcPublishing/composer.json +++ b/EventarcPublishing/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Filestore/.repo-metadata.json b/Filestore/.repo-metadata.json deleted file mode 100644 index 88899ad9387b..000000000000 --- a/Filestore/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-filestore", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-filestore/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "file" -} diff --git a/Filestore/VERSION b/Filestore/VERSION index 9075be495155..f01291b87fd5 100644 --- a/Filestore/VERSION +++ b/Filestore/VERSION @@ -1 +1 @@ -1.5.5 +1.5.7 diff --git a/Filestore/composer.json b/Filestore/composer.json index 15fd1e709589..f32509bd0a93 100644 --- a/Filestore/composer.json +++ b/Filestore/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/cloud-common-protos": "~0.5" }, "require-dev": { diff --git a/Firestore/.repo-metadata.json b/Firestore/.repo-metadata.json deleted file mode 100644 index ab00b37342af..000000000000 --- a/Firestore/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-firestore", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-firestore/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "firestore" -} diff --git a/Firestore/VERSION b/Firestore/VERSION index 3987c472943e..6564ab33a9d4 100644 --- a/Firestore/VERSION +++ b/Firestore/VERSION @@ -1 +1 @@ -1.43.1 +1.43.3 diff --git a/Firestore/composer.json b/Firestore/composer.json index f5b2a2ae3795..7affa72d3681 100644 --- a/Firestore/composer.json +++ b/Firestore/composer.json @@ -7,7 +7,7 @@ "php": "^8.0", "ext-grpc": "*", "google/cloud-core": "^1.52.7", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "ramsey/uuid": "^3.0|^4.0" }, "require-dev": { diff --git a/Firestore/metadata/Admin/V1/FirestoreAdmin.php b/Firestore/metadata/Admin/V1/FirestoreAdmin.php index 74b564b18b30..222bef39e37d 100644 --- a/Firestore/metadata/Admin/V1/FirestoreAdmin.php +++ b/Firestore/metadata/Admin/V1/FirestoreAdmin.php @@ -30,10 +30,11 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -îD -/google/firestore/admin/v1/firestore_admin.protogoogle.firestore.admin.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/firestore/admin/v1/backup.proto(google/firestore/admin/v1/database.proto%google/firestore/admin/v1/field.proto%google/firestore/admin/v1/index.proto)google/firestore/admin/v1/operation.proto(google/firestore/admin/v1/schedule.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"Q +©H +/google/firestore/admin/v1/firestore_admin.protogoogle.firestore.admin.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/firestore/admin/v1/backup.proto(google/firestore/admin/v1/database.proto%google/firestore/admin/v1/field.proto%google/firestore/admin/v1/index.proto)google/firestore/admin/v1/operation.proto(google/firestore/admin/v1/schedule.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"g ListDatabasesRequest9 -parent ( B)àAúA#!firestore.googleapis.com/Database"¨ +parent ( B)àAúA#!firestore.googleapis.com/Database + show_deleted ("¨ CreateDatabaseRequest9 parent ( B)àAúA#!firestore.googleapis.com/Database: database ( 2#.google.firestore.admin.v1.DatabaseBàA @@ -120,7 +121,13 @@ public static function initOnce() { !firestore.googleapis.com/Database collection_ids (  input_uri_prefix (  - namespace_ids ( "I + namespace_ids ( "Ž +BulkDeleteDocumentsRequest7 +name ( B)àAúA# +!firestore.googleapis.com/Database +collection_ids ( BàA + namespace_ids ( BàA" +BulkDeleteDocumentsResponse"I GetBackupRequest5 name ( B\'àAúA! firestore.googleapis.com/Backup"O @@ -137,7 +144,7 @@ public static function initOnce() { parent ( B)àAúA#!firestore.googleapis.com/Database database_id ( BàA7 backup ( B\'àAúA! -firestore.googleapis.com/Backup2Ö# +firestore.googleapis.com/Backup2Ë% FirestoreAdminÛ CreateIndex-.google.firestore.admin.v1.CreateIndexRequest.google.longrunning.Operation"~ÊA IndexIndexOperationMetadataÚA parent,index‚Óä“G">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:index½ @@ -152,7 +159,9 @@ public static function initOnce() { ExportDocuments1.google.firestore.admin.v1.ExportDocumentsRequest.google.longrunning.Operation"xÊA2 ExportDocumentsResponseExportDocumentsMetadataÚAname‚Óä“6"1/v1/{name=projects/*/databases/*}:exportDocuments:*Û ImportDocuments1.google.firestore.admin.v1.ImportDocumentsRequest.google.longrunning.Operation"vÊA0 -google.protobuf.EmptyImportDocumentsMetadataÚAname‚Óä“6"1/v1/{name=projects/*/databases/*}:importDocuments:*Ù +google.protobuf.EmptyImportDocumentsMetadataÚAname‚Óä“6"1/v1/{name=projects/*/databases/*}:importDocuments:*ò +BulkDeleteDocuments5.google.firestore.admin.v1.BulkDeleteDocumentsRequest.google.longrunning.Operation"„ÊA: +BulkDeleteDocumentsResponseBulkDeleteDocumentsMetadataÚAname‚Óä“:"5/v1/{name=projects/*/databases/*}:bulkDeleteDocuments:*Ù CreateDatabase0.google.firestore.admin.v1.CreateDatabaseRequest.google.longrunning.Operation"vÊA" DatabaseCreateDatabaseMetadataÚAparent,database,database_id‚Óä“-"!/v1/{parent=projects/*}/databases:database“ GetDatabase-.google.firestore.admin.v1.GetDatabaseRequest#.google.firestore.admin.v1.Database"0ÚAname‚Óä“#!/v1/{name=projects/*/databases/*}¦ diff --git a/Firestore/metadata/Admin/V1/Operation.php b/Firestore/metadata/Admin/V1/Operation.php index 183d7602733f07a0cd2ad9ec81b1bd703c88f16c..2bba74bd463fcd9fdb5f07d51fe5551371e5605a 100644 GIT binary patch delta 78 zcmV-U0I~n^9g`ujlL7>_8wx3t-2xhsWe>B!0)7Y%p92aTLUn9wL}hGcbY-&&2ucAG k6$%Y*VQpn|aA9L*Uuk4>7zdMq2^Ikelb;J9vpoy61Ma{WRR910 delta 29 lcmbQN_)&JlWG0r$5?q>-?=neEOy%EvfT@mS^8=pE%mAUG3d;Zh diff --git a/Firestore/src/Admin/V1/BulkDeleteDocumentsMetadata.php b/Firestore/src/Admin/V1/BulkDeleteDocumentsMetadata.php new file mode 100644 index 000000000000..af97b8a980e0 --- /dev/null +++ b/Firestore/src/Admin/V1/BulkDeleteDocumentsMetadata.php @@ -0,0 +1,373 @@ +google.firestore.admin.v1.BulkDeleteDocumentsMetadata + */ +class BulkDeleteDocumentsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + private $start_time = null; + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + private $end_time = null; + /** + * The state of the operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + */ + private $operation_state = 0; + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; + */ + private $progress_documents = null; + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + private $progress_bytes = null; + /** + * The ids of the collection groups that are being deleted. + * + * Generated from protobuf field repeated string collection_ids = 6; + */ + private $collection_ids; + /** + * Which namespace ids are being deleted. + * + * Generated from protobuf field repeated string namespace_ids = 7; + */ + private $namespace_ids; + /** + * The timestamp that corresponds to the version of the database that is being + * read to get the list of documents to delete. This time can also be used as + * the timestamp of PITR in case of disaster recovery (subject to PITR window + * limit). + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 8; + */ + private $snapshot_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The time this operation started. + * @type \Google\Protobuf\Timestamp $end_time + * The time this operation completed. Will be unset if operation still in + * progress. + * @type int $operation_state + * The state of the operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents + * The progress, in documents, of this operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes + * The progress, in bytes, of this operation. + * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids + * The ids of the collection groups that are being deleted. + * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids + * Which namespace ids are being deleted. + * @type \Google\Protobuf\Timestamp $snapshot_time + * The timestamp that corresponds to the version of the database that is being + * read to get the list of documents to delete. This time can also be used as + * the timestamp of PITR in case of disaster recovery (subject to PITR window + * limit). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The state of the operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + * @return int + */ + public function getOperationState() + { + return $this->operation_state; + } + + /** + * The state of the operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + * @param int $var + * @return $this + */ + public function setOperationState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class); + $this->operation_state = $var; + + return $this; + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressDocuments() + { + return $this->progress_documents; + } + + public function hasProgressDocuments() + { + return isset($this->progress_documents); + } + + public function clearProgressDocuments() + { + unset($this->progress_documents); + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_documents = $var; + + return $this; + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressBytes() + { + return $this->progress_bytes; + } + + public function hasProgressBytes() + { + return isset($this->progress_bytes); + } + + public function clearProgressBytes() + { + unset($this->progress_bytes); + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressBytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_bytes = $var; + + return $this; + } + + /** + * The ids of the collection groups that are being deleted. + * + * Generated from protobuf field repeated string collection_ids = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionIds() + { + return $this->collection_ids; + } + + /** + * The ids of the collection groups that are being deleted. + * + * Generated from protobuf field repeated string collection_ids = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCollectionIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->collection_ids = $arr; + + return $this; + } + + /** + * Which namespace ids are being deleted. + * + * Generated from protobuf field repeated string namespace_ids = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaceIds() + { + return $this->namespace_ids; + } + + /** + * Which namespace ids are being deleted. + * + * Generated from protobuf field repeated string namespace_ids = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamespaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->namespace_ids = $arr; + + return $this; + } + + /** + * The timestamp that corresponds to the version of the database that is being + * read to get the list of documents to delete. This time can also be used as + * the timestamp of PITR in case of disaster recovery (subject to PITR window + * limit). + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 8; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSnapshotTime() + { + return $this->snapshot_time; + } + + public function hasSnapshotTime() + { + return isset($this->snapshot_time); + } + + public function clearSnapshotTime() + { + unset($this->snapshot_time); + } + + /** + * The timestamp that corresponds to the version of the database that is being + * read to get the list of documents to delete. This time can also be used as + * the timestamp of PITR in case of disaster recovery (subject to PITR window + * limit). + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 8; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSnapshotTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->snapshot_time = $var; + + return $this; + } + +} + diff --git a/Firestore/src/Admin/V1/BulkDeleteDocumentsRequest.php b/Firestore/src/Admin/V1/BulkDeleteDocumentsRequest.php new file mode 100644 index 000000000000..b17510e2e594 --- /dev/null +++ b/Firestore/src/Admin/V1/BulkDeleteDocumentsRequest.php @@ -0,0 +1,193 @@ +google.firestore.admin.v1.BulkDeleteDocumentsRequest + */ +class BulkDeleteDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Database to operate. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + /** + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * Each collection group in this list must be unique. + * + * Generated from protobuf field repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $collection_ids; + /** + * Optional. Namespaces to delete. + * An empty list means all namespaces. This is the recommended + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to delete from them. + * Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $namespace_ids; + + /** + * @param string $name Required. Database to operate. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. Please see + * {@see FirestoreAdminClient::databaseName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Database to operate. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * Each collection group in this list must be unique. + * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids + * Optional. Namespaces to delete. + * An empty list means all namespaces. This is the recommended + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to delete from them. + * Each namespace in this list must be unique. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Database to operate. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Database to operate. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * Each collection group in this list must be unique. + * + * Generated from protobuf field repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionIds() + { + return $this->collection_ids; + } + + /** + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * Each collection group in this list must be unique. + * + * Generated from protobuf field repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCollectionIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->collection_ids = $arr; + + return $this; + } + + /** + * Optional. Namespaces to delete. + * An empty list means all namespaces. This is the recommended + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to delete from them. + * Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaceIds() + { + return $this->namespace_ids; + } + + /** + * Optional. Namespaces to delete. + * An empty list means all namespaces. This is the recommended + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to delete from them. + * Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamespaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->namespace_ids = $arr; + + return $this; + } + +} + diff --git a/Firestore/src/Admin/V1/BulkDeleteDocumentsResponse.php b/Firestore/src/Admin/V1/BulkDeleteDocumentsResponse.php new file mode 100644 index 000000000000..a1d244d022c1 --- /dev/null +++ b/Firestore/src/Admin/V1/BulkDeleteDocumentsResponse.php @@ -0,0 +1,34 @@ +google.firestore.admin.v1.BulkDeleteDocumentsResponse + */ +class BulkDeleteDocumentsResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Firestore/src/Admin/V1/Client/FirestoreAdminClient.php b/Firestore/src/Admin/V1/Client/FirestoreAdminClient.php index 79a6c44df21d..f7390c317a64 100644 --- a/Firestore/src/Admin/V1/Client/FirestoreAdminClient.php +++ b/Firestore/src/Admin/V1/Client/FirestoreAdminClient.php @@ -37,6 +37,7 @@ use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\Firestore\Admin\V1\Backup; use Google\Cloud\Firestore\Admin\V1\BackupSchedule; +use Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsRequest; use Google\Cloud\Firestore\Admin\V1\CreateBackupScheduleRequest; use Google\Cloud\Firestore\Admin\V1\CreateDatabaseRequest; use Google\Cloud\Firestore\Admin\V1\CreateIndexRequest; @@ -110,6 +111,7 @@ * name, and additionally a parseName method to extract the individual identifiers * contained within formatted names that are returned by the API. * + * @method PromiseInterface bulkDeleteDocumentsAsync(BulkDeleteDocumentsRequest $request, array $optionalArgs = []) * @method PromiseInterface createBackupScheduleAsync(CreateBackupScheduleRequest $request, array $optionalArgs = []) * @method PromiseInterface createDatabaseAsync(CreateDatabaseRequest $request, array $optionalArgs = []) * @method PromiseInterface createIndexAsync(CreateIndexRequest $request, array $optionalArgs = []) @@ -465,6 +467,39 @@ public function __call($method, $args) return call_user_func_array([$this, 'startAsyncCall'], $args); } + /** + * Bulk deletes a subset of documents from Google Cloud Firestore. + * Documents created or updated after the underlying system starts to process + * the request will not be deleted. The bulk delete occurs in the background + * and its progress can be monitored and managed via the Operation resource + * that is created. + * + * For more details on bulk delete behavior, refer to: + * https://cloud.google.com/firestore/docs/manage-data/bulk-delete + * + * The async variant is {@see FirestoreAdminClient::bulkDeleteDocumentsAsync()} . + * + * @example samples/V1/FirestoreAdminClient/bulk_delete_documents.php + * + * @param BulkDeleteDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function bulkDeleteDocuments(BulkDeleteDocumentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BulkDeleteDocuments', $request, $callOptions)->wait(); + } + /** * Creates a backup schedule on a database. * At most two backup schedules can be configured on a database, one daily @@ -986,7 +1021,7 @@ public function listIndexes(ListIndexesRequest $request, array $callOptions = [] * * The new database must be in the same cloud region or multi-region location * as the existing backup. This behaves similar to - * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] * except instead of creating a new empty database, a new database is created * with the database type, index configuration, and documents from an existing * backup. diff --git a/Firestore/src/Admin/V1/ExportDocumentsRequest.php b/Firestore/src/Admin/V1/ExportDocumentsRequest.php index e8e2309486da..744a8997ca9e 100644 --- a/Firestore/src/Admin/V1/ExportDocumentsRequest.php +++ b/Firestore/src/Admin/V1/ExportDocumentsRequest.php @@ -24,7 +24,8 @@ class ExportDocumentsRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Which collection ids to export. Unspecified means all collections. + * Which collection ids to export. Unspecified means all collections. Each + * collection id in this list must be unique. * * Generated from protobuf field repeated string collection_ids = 2; */ @@ -90,7 +91,8 @@ public static function build(string $name): self * Required. Database to export. Should be of the form: * `projects/{project_id}/databases/{database_id}`. * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids - * Which collection ids to export. Unspecified means all collections. + * Which collection ids to export. Unspecified means all collections. Each + * collection id in this list must be unique. * @type string $output_uri_prefix * The output URI. Currently only supports Google Cloud Storage URIs of the * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name @@ -150,7 +152,8 @@ public function setName($var) } /** - * Which collection ids to export. Unspecified means all collections. + * Which collection ids to export. Unspecified means all collections. Each + * collection id in this list must be unique. * * Generated from protobuf field repeated string collection_ids = 2; * @return \Google\Protobuf\Internal\RepeatedField @@ -161,7 +164,8 @@ public function getCollectionIds() } /** - * Which collection ids to export. Unspecified means all collections. + * Which collection ids to export. Unspecified means all collections. Each + * collection id in this list must be unique. * * Generated from protobuf field repeated string collection_ids = 2; * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Firestore/src/Admin/V1/Field.php b/Firestore/src/Admin/V1/Field.php index f8fa42a4f0f2..987b3d3b8b6a 100644 --- a/Firestore/src/Admin/V1/Field.php +++ b/Firestore/src/Admin/V1/Field.php @@ -18,23 +18,21 @@ class Field extends \Google\Protobuf\Internal\Message { /** - * Required. A field name of the form + * Required. A field name of the form: * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, + * A field path can be a simple field name, e.g. `address` or a path to fields + * within `map_value` , e.g. `address.city`, * or a special field path. The only valid special field is `*`, which * represents any field. - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that + * Field paths can be quoted using `` ` `` (backtick). The only character that + * must be escaped within a quoted field path is the backtick character + * itself, escaped using a backslash. Special characters in field paths that * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic characters. * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. + * `` `address.city` `` represents a field named `address.city`, not the map + * key `city` in the field `address`. `` `*` `` represents a field named `*`, + * not any field. * A special `Field` contains the default indexing settings for all fields. * This field's resource name is: * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` @@ -69,23 +67,21 @@ class Field extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. A field name of the form + * Required. A field name of the form: * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, + * A field path can be a simple field name, e.g. `address` or a path to fields + * within `map_value` , e.g. `address.city`, * or a special field path. The only valid special field is `*`, which * represents any field. - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that + * Field paths can be quoted using `` ` `` (backtick). The only character that + * must be escaped within a quoted field path is the backtick character + * itself, escaped using a backslash. Special characters in field paths that * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic characters. * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. + * `` `address.city` `` represents a field named `address.city`, not the map + * key `city` in the field `address`. `` `*` `` represents a field named `*`, + * not any field. * A special `Field` contains the default indexing settings for all fields. * This field's resource name is: * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` @@ -108,23 +104,21 @@ public function __construct($data = NULL) { } /** - * Required. A field name of the form + * Required. A field name of the form: * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, + * A field path can be a simple field name, e.g. `address` or a path to fields + * within `map_value` , e.g. `address.city`, * or a special field path. The only valid special field is `*`, which * represents any field. - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that + * Field paths can be quoted using `` ` `` (backtick). The only character that + * must be escaped within a quoted field path is the backtick character + * itself, escaped using a backslash. Special characters in field paths that * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic characters. * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. + * `` `address.city` `` represents a field named `address.city`, not the map + * key `city` in the field `address`. `` `*` `` represents a field named `*`, + * not any field. * A special `Field` contains the default indexing settings for all fields. * This field's resource name is: * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` @@ -140,23 +134,21 @@ public function getName() } /** - * Required. A field name of the form + * Required. A field name of the form: * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, + * A field path can be a simple field name, e.g. `address` or a path to fields + * within `map_value` , e.g. `address.city`, * or a special field path. The only valid special field is `*`, which * represents any field. - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that + * Field paths can be quoted using `` ` `` (backtick). The only character that + * must be escaped within a quoted field path is the backtick character + * itself, escaped using a backslash. Special characters in field paths that * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic characters. * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. + * `` `address.city` `` represents a field named `address.city`, not the map + * key `city` in the field `address`. `` `*` `` represents a field named `*`, + * not any field. * A special `Field` contains the default indexing settings for all fields. * This field's resource name is: * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` diff --git a/Firestore/src/Admin/V1/Field/IndexConfig.php b/Firestore/src/Admin/V1/Field/IndexConfig.php index e4a2d6d3ca44..c02707a43b16 100644 --- a/Firestore/src/Admin/V1/Field/IndexConfig.php +++ b/Firestore/src/Admin/V1/Field/IndexConfig.php @@ -30,8 +30,8 @@ class IndexConfig extends \Google\Protobuf\Internal\Message */ private $uses_ancestor_config = false; /** - * Output only. Specifies the resource name of the `Field` from which this field's - * index configuration is set (when `uses_ancestor_config` is true), + * Output only. Specifies the resource name of the `Field` from which this + * field's index configuration is set (when `uses_ancestor_config` is true), * or from which it *would* be set if this field had no index configuration * (when `uses_ancestor_config` is false). * @@ -62,8 +62,8 @@ class IndexConfig extends \Google\Protobuf\Internal\Message * configuration specified by the `ancestor_field`. * When false, the `Field`'s index configuration is defined explicitly. * @type string $ancestor_field - * Output only. Specifies the resource name of the `Field` from which this field's - * index configuration is set (when `uses_ancestor_config` is true), + * Output only. Specifies the resource name of the `Field` from which this + * field's index configuration is set (when `uses_ancestor_config` is true), * or from which it *would* be set if this field had no index configuration * (when `uses_ancestor_config` is false). * @type bool $reverting @@ -136,8 +136,8 @@ public function setUsesAncestorConfig($var) } /** - * Output only. Specifies the resource name of the `Field` from which this field's - * index configuration is set (when `uses_ancestor_config` is true), + * Output only. Specifies the resource name of the `Field` from which this + * field's index configuration is set (when `uses_ancestor_config` is true), * or from which it *would* be set if this field had no index configuration * (when `uses_ancestor_config` is false). * @@ -150,8 +150,8 @@ public function getAncestorField() } /** - * Output only. Specifies the resource name of the `Field` from which this field's - * index configuration is set (when `uses_ancestor_config` is true), + * Output only. Specifies the resource name of the `Field` from which this + * field's index configuration is set (when `uses_ancestor_config` is true), * or from which it *would* be set if this field had no index configuration * (when `uses_ancestor_config` is false). * diff --git a/Firestore/src/Admin/V1/Field/TtlConfig.php b/Firestore/src/Admin/V1/Field/TtlConfig.php index 17a2f6a8c00f..3d868a9b0f6b 100644 --- a/Firestore/src/Admin/V1/Field/TtlConfig.php +++ b/Firestore/src/Admin/V1/Field/TtlConfig.php @@ -12,8 +12,10 @@ * The TTL (time-to-live) configuration for documents that have this `Field` * set. * Storing a timestamp value into a TTL-enabled field will be treated as - * the document's absolute expiration time. Using any other data type or - * leaving the field absent will disable the TTL for the individual document. + * the document's absolute expiration time. Timestamp values in the past + * indicate that the document is eligible for immediate expiration. Using any + * other data type or leaving the field absent will disable expiration for the + * individual document. * * Generated from protobuf message google.firestore.admin.v1.Field.TtlConfig */ diff --git a/Firestore/src/Admin/V1/Gapic/FirestoreAdminGapicClient.php b/Firestore/src/Admin/V1/Gapic/FirestoreAdminGapicClient.php index cd7cc58d7b65..b5fd39704aef 100644 --- a/Firestore/src/Admin/V1/Gapic/FirestoreAdminGapicClient.php +++ b/Firestore/src/Admin/V1/Gapic/FirestoreAdminGapicClient.php @@ -37,6 +37,7 @@ use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\Firestore\Admin\V1\Backup; use Google\Cloud\Firestore\Admin\V1\BackupSchedule; +use Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsRequest; use Google\Cloud\Firestore\Admin\V1\CreateBackupScheduleRequest; use Google\Cloud\Firestore\Admin\V1\CreateDatabaseRequest; use Google\Cloud\Firestore\Admin\V1\CreateIndexRequest; @@ -113,9 +114,33 @@ * ``` * $firestoreAdminClient = new FirestoreAdminClient(); * try { - * $formattedParent = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); - * $backupSchedule = new BackupSchedule(); - * $response = $firestoreAdminClient->createBackupSchedule($formattedParent, $backupSchedule); + * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); + * $operationResponse = $firestoreAdminClient->bulkDeleteDocuments($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->bulkDeleteDocuments($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'bulkDeleteDocuments'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } * } finally { * $firestoreAdminClient->close(); * } @@ -572,6 +597,102 @@ public function __construct(array $options = []) $this->operationsClient = $this->createOperationsClient($clientOptions); } + /** + * Bulk deletes a subset of documents from Google Cloud Firestore. + * Documents created or updated after the underlying system starts to process + * the request will not be deleted. The bulk delete occurs in the background + * and its progress can be monitored and managed via the Operation resource + * that is created. + * + * For more details on bulk delete behavior, refer to: + * https://cloud.google.com/firestore/docs/manage-data/bulk-delete + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); + * $operationResponse = $firestoreAdminClient->bulkDeleteDocuments($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->bulkDeleteDocuments($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'bulkDeleteDocuments'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Database to operate. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @param array $optionalArgs { + * Optional. + * + * @type string[] $collectionIds + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * + * Each collection group in this list must be unique. + * @type string[] $namespaceIds + * Optional. Namespaces to delete. + * + * An empty list means all namespaces. This is the recommended + * usage for databases that don't use namespaces. + * + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to delete from them. + * + * Each namespace in this list must be unique. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function bulkDeleteDocuments($name, array $optionalArgs = []) + { + $request = new BulkDeleteDocumentsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['collectionIds'])) { + $request->setCollectionIds($optionalArgs['collectionIds']); + } + + if (isset($optionalArgs['namespaceIds'])) { + $request->setNamespaceIds($optionalArgs['namespaceIds']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BulkDeleteDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + /** * Creates a backup schedule on a database. * At most two backup schedules can be configured on a database, one daily @@ -1013,7 +1134,8 @@ public function deleteIndex($name, array $optionalArgs = []) * Optional. * * @type string[] $collectionIds - * Which collection ids to export. Unspecified means all collections. + * Which collection ids to export. Unspecified means all collections. Each + * collection id in this list must be unique. * @type string $outputUriPrefix * The output URI. Currently only supports Google Cloud Storage URIs of the * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name @@ -1326,7 +1448,7 @@ public function getIndex($name, array $optionalArgs = []) * * @type string[] $collectionIds * Which collection ids to import. Unspecified means all collections included - * in the import. + * in the import. Each collection id in this list must be unique. * @type string $inputUriPrefix * Location of the exported files. * This must match the output_uri_prefix of an ExportDocumentsResponse from @@ -1477,6 +1599,8 @@ public function listBackups($parent, array $optionalArgs = []) * @param array $optionalArgs { * Optional. * + * @type bool $showDeleted + * If true, also returns deleted resources. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1493,6 +1617,10 @@ public function listDatabases($parent, array $optionalArgs = []) $requestParamHeaders = []; $request->setParent($parent); $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['showDeleted'])) { + $request->setShowDeleted($optionalArgs['showDeleted']); + } + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall('ListDatabases', ListDatabasesResponse::class, $optionalArgs, $request)->wait(); @@ -1543,7 +1671,8 @@ public function listDatabases($parent, array $optionalArgs = []) * only supports listing fields that have been explicitly overridden. To issue * this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * with a filter that includes `indexConfig.usesAncestorConfig:false` or + * `ttlConfig:*`. * @type int $pageSize * The maximum number of resources contained in the underlying API * response. The API may return fewer values in a page, even if @@ -1666,7 +1795,7 @@ public function listIndexes($parent, array $optionalArgs = []) * * The new database must be in the same cloud region or multi-region location * as the existing backup. This behaves similar to - * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] * except instead of creating a new empty database, a new database is created * with the database type, index configuration, and documents from an existing * backup. diff --git a/Firestore/src/Admin/V1/ImportDocumentsRequest.php b/Firestore/src/Admin/V1/ImportDocumentsRequest.php index 4c0b0b3d2262..0260d6fac862 100644 --- a/Firestore/src/Admin/V1/ImportDocumentsRequest.php +++ b/Firestore/src/Admin/V1/ImportDocumentsRequest.php @@ -25,7 +25,7 @@ class ImportDocumentsRequest extends \Google\Protobuf\Internal\Message private $name = ''; /** * Which collection ids to import. Unspecified means all collections included - * in the import. + * in the import. Each collection id in this list must be unique. * * Generated from protobuf field repeated string collection_ids = 2; */ @@ -77,7 +77,7 @@ public static function build(string $name): self * `projects/{project_id}/databases/{database_id}`. * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids * Which collection ids to import. Unspecified means all collections included - * in the import. + * in the import. Each collection id in this list must be unique. * @type string $input_uri_prefix * Location of the exported files. * This must match the output_uri_prefix of an ExportDocumentsResponse from @@ -127,7 +127,7 @@ public function setName($var) /** * Which collection ids to import. Unspecified means all collections included - * in the import. + * in the import. Each collection id in this list must be unique. * * Generated from protobuf field repeated string collection_ids = 2; * @return \Google\Protobuf\Internal\RepeatedField @@ -139,7 +139,7 @@ public function getCollectionIds() /** * Which collection ids to import. Unspecified means all collections included - * in the import. + * in the import. Each collection id in this list must be unique. * * Generated from protobuf field repeated string collection_ids = 2; * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Firestore/src/Admin/V1/Index/IndexField.php b/Firestore/src/Admin/V1/Index/IndexField.php index eb0bf5d5e28f..8e637c0df9ca 100644 --- a/Firestore/src/Admin/V1/Index/IndexField.php +++ b/Firestore/src/Admin/V1/Index/IndexField.php @@ -43,7 +43,7 @@ class IndexField extends \Google\Protobuf\Internal\Message * @type int $array_config * Indicates that this field supports operations on `array_value`s. * @type \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig $vector_config - * Indicates that this field supports nearest neighbors and distance + * Indicates that this field supports nearest neighbor and distance * operations on vector. * } */ @@ -147,7 +147,7 @@ public function setArrayConfig($var) } /** - * Indicates that this field supports nearest neighbors and distance + * Indicates that this field supports nearest neighbor and distance * operations on vector. * * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig vector_config = 4; @@ -164,7 +164,7 @@ public function hasVectorConfig() } /** - * Indicates that this field supports nearest neighbors and distance + * Indicates that this field supports nearest neighbor and distance * operations on vector. * * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig vector_config = 4; diff --git a/Firestore/src/Admin/V1/ListDatabasesRequest.php b/Firestore/src/Admin/V1/ListDatabasesRequest.php index 06b2fa5e83ff..9f175c6314aa 100644 --- a/Firestore/src/Admin/V1/ListDatabasesRequest.php +++ b/Firestore/src/Admin/V1/ListDatabasesRequest.php @@ -22,6 +22,12 @@ class ListDatabasesRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ private $parent = ''; + /** + * If true, also returns deleted resources. + * + * Generated from protobuf field bool show_deleted = 4; + */ + private $show_deleted = false; /** * @param string $parent Required. A parent name of the form @@ -47,6 +53,8 @@ public static function build(string $parent): self * @type string $parent * Required. A parent name of the form * `projects/{project_id}` + * @type bool $show_deleted + * If true, also returns deleted resources. * } */ public function __construct($data = NULL) { @@ -82,5 +90,31 @@ public function setParent($var) return $this; } + /** + * If true, also returns deleted resources. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, also returns deleted resources. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + } diff --git a/Firestore/src/Admin/V1/ListFieldsRequest.php b/Firestore/src/Admin/V1/ListFieldsRequest.php index e59b35cacea7..fd57e71f5b80 100644 --- a/Firestore/src/Admin/V1/ListFieldsRequest.php +++ b/Firestore/src/Admin/V1/ListFieldsRequest.php @@ -29,7 +29,8 @@ class ListFieldsRequest extends \Google\Protobuf\Internal\Message * only supports listing fields that have been explicitly overridden. To issue * this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * with a filter that includes `indexConfig.usesAncestorConfig:false` or + * `ttlConfig:*`. * * Generated from protobuf field string filter = 2; */ @@ -79,7 +80,8 @@ public static function build(string $parent): self * only supports listing fields that have been explicitly overridden. To issue * this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * with a filter that includes `indexConfig.usesAncestorConfig:false` or + * `ttlConfig:*`. * @type int $page_size * The number of results to return. * @type string $page_token @@ -127,7 +129,8 @@ public function setParent($var) * only supports listing fields that have been explicitly overridden. To issue * this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * with a filter that includes `indexConfig.usesAncestorConfig:false` or + * `ttlConfig:*`. * * Generated from protobuf field string filter = 2; * @return string @@ -143,7 +146,8 @@ public function getFilter() * only supports listing fields that have been explicitly overridden. To issue * this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * with a filter that includes `indexConfig.usesAncestorConfig:false` or + * `ttlConfig:*`. * * Generated from protobuf field string filter = 2; * @param string $var diff --git a/Firestore/src/Admin/V1/gapic_metadata.json b/Firestore/src/Admin/V1/gapic_metadata.json index 7913f82dab9d..9b70c2e17bb1 100644 --- a/Firestore/src/Admin/V1/gapic_metadata.json +++ b/Firestore/src/Admin/V1/gapic_metadata.json @@ -10,6 +10,11 @@ "grpc": { "libraryClient": "FirestoreAdminGapicClient", "rpcs": { + "BulkDeleteDocuments": { + "methods": [ + "bulkDeleteDocuments" + ] + }, "CreateBackupSchedule": { "methods": [ "createBackupSchedule" diff --git a/Firestore/src/Admin/V1/resources/firestore_admin_client_config.json b/Firestore/src/Admin/V1/resources/firestore_admin_client_config.json index ac1c7f2c52aa..d9d11f0e1967 100644 --- a/Firestore/src/Admin/V1/resources/firestore_admin_client_config.json +++ b/Firestore/src/Admin/V1/resources/firestore_admin_client_config.json @@ -40,6 +40,11 @@ } }, "methods": { + "BulkDeleteDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "CreateBackupSchedule": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/Firestore/src/Admin/V1/resources/firestore_admin_descriptor_config.php b/Firestore/src/Admin/V1/resources/firestore_admin_descriptor_config.php index e5992eb3c3f8..8aa9b9991fc1 100644 --- a/Firestore/src/Admin/V1/resources/firestore_admin_descriptor_config.php +++ b/Firestore/src/Admin/V1/resources/firestore_admin_descriptor_config.php @@ -23,6 +23,25 @@ return [ 'interfaces' => [ 'google.firestore.admin.v1.FirestoreAdmin' => [ + 'BulkDeleteDocuments' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsResponse', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'CreateDatabase' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Database', diff --git a/Firestore/src/Admin/V1/resources/firestore_admin_rest_client_config.php b/Firestore/src/Admin/V1/resources/firestore_admin_rest_client_config.php index b2d683f8e599..f5062d72f11e 100644 --- a/Firestore/src/Admin/V1/resources/firestore_admin_rest_client_config.php +++ b/Firestore/src/Admin/V1/resources/firestore_admin_rest_client_config.php @@ -23,6 +23,18 @@ return [ 'interfaces' => [ 'google.firestore.admin.v1.FirestoreAdmin' => [ + 'BulkDeleteDocuments' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/databases/*}:bulkDeleteDocuments', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'CreateBackupSchedule' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/databases/*}/backupSchedules', diff --git a/Firestore/src/FirestoreClient.php b/Firestore/src/FirestoreClient.php index 6a40f213eaa7..6059f17a281f 100644 --- a/Firestore/src/FirestoreClient.php +++ b/Firestore/src/FirestoreClient.php @@ -75,7 +75,7 @@ class FirestoreClient use SnapshotTrait; use ValidateTrait; - const VERSION = '1.43.1'; + const VERSION = '1.43.3'; const DEFAULT_DATABASE = '(default)'; diff --git a/Firestore/tests/Unit/Admin/V1/Client/FirestoreAdminClientTest.php b/Firestore/tests/Unit/Admin/V1/Client/FirestoreAdminClientTest.php index 383f644cb9bb..19b527c00dbf 100644 --- a/Firestore/tests/Unit/Admin/V1/Client/FirestoreAdminClientTest.php +++ b/Firestore/tests/Unit/Admin/V1/Client/FirestoreAdminClientTest.php @@ -29,6 +29,8 @@ use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Firestore\Admin\V1\Backup; use Google\Cloud\Firestore\Admin\V1\BackupSchedule; +use Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsRequest; +use Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsResponse; use Google\Cloud\Firestore\Admin\V1\Client\FirestoreAdminClient; use Google\Cloud\Firestore\Admin\V1\CreateBackupScheduleRequest; use Google\Cloud\Firestore\Admin\V1\CreateDatabaseRequest; @@ -97,6 +99,127 @@ private function createClient(array $options = []) return new FirestoreAdminClient($options); } + /** @test */ + public function bulkDeleteDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/bulkDeleteDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BulkDeleteDocumentsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/bulkDeleteDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new BulkDeleteDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->bulkDeleteDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/BulkDeleteDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function bulkDeleteDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/bulkDeleteDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new BulkDeleteDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->bulkDeleteDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function createBackupScheduleTest() { @@ -2125,35 +2248,66 @@ public function updateFieldExceptionTest() } /** @test */ - public function createBackupScheduleAsyncTest() + public function bulkDeleteDocumentsAsyncTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $name = 'name3373707'; - $expectedResponse = new BackupSchedule(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/bulkDeleteDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BulkDeleteDocumentsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/bulkDeleteDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedParent = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $backupSchedule = new BackupSchedule(); - $request = (new CreateBackupScheduleRequest()) - ->setParent($formattedParent) - ->setBackupSchedule($backupSchedule); - $response = $gapicClient->createBackupScheduleAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateBackupSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getBackupSchedule(); - $this->assertProtobufEquals($backupSchedule, $actualValue); + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new BulkDeleteDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->bulkDeleteDocumentsAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/BulkDeleteDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } } diff --git a/Firestore/tests/Unit/Admin/V1/FirestoreAdminClientTest.php b/Firestore/tests/Unit/Admin/V1/FirestoreAdminClientTest.php index 0799fa4e86eb..9a43bb6970ce 100644 --- a/Firestore/tests/Unit/Admin/V1/FirestoreAdminClientTest.php +++ b/Firestore/tests/Unit/Admin/V1/FirestoreAdminClientTest.php @@ -29,6 +29,7 @@ use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Firestore\Admin\V1\Backup; use Google\Cloud\Firestore\Admin\V1\BackupSchedule; +use Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsResponse; use Google\Cloud\Firestore\Admin\V1\Database; use Google\Cloud\Firestore\Admin\V1\ExportDocumentsResponse; use Google\Cloud\Firestore\Admin\V1\Field; @@ -74,6 +75,123 @@ private function createClient(array $options = []) return new FirestoreAdminClient($options); } + /** @test */ + public function bulkDeleteDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/bulkDeleteDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BulkDeleteDocumentsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/bulkDeleteDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->bulkDeleteDocuments($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/BulkDeleteDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function bulkDeleteDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/bulkDeleteDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->bulkDeleteDocuments($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function createBackupScheduleTest() { diff --git a/Functions/.repo-metadata.json b/Functions/.repo-metadata.json deleted file mode 100644 index 39893bf6ea5d..000000000000 --- a/Functions/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-functions", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-functions/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudfunctions" -} diff --git a/Functions/VERSION b/Functions/VERSION index 266146b87cbc..9f05f9f2ce1c 100644 --- a/Functions/VERSION +++ b/Functions/VERSION @@ -1 +1 @@ -1.6.3 +1.6.5 diff --git a/Functions/composer.json b/Functions/composer.json index 548ac7775d74..c66de7becb4b 100644 --- a/Functions/composer.json +++ b/Functions/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/GSuiteAddOns/.repo-metadata.json b/GSuiteAddOns/.repo-metadata.json deleted file mode 100644 index 566b331b019b..000000000000 --- a/GSuiteAddOns/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-gsuite-addons", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gsuite-addons/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://developers.google.com/workspace/add-ons/overview", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "gsuiteaddons" -} diff --git a/GSuiteAddOns/VERSION b/GSuiteAddOns/VERSION index 1c09c74e221c..c2c0004f0e2a 100644 --- a/GSuiteAddOns/VERSION +++ b/GSuiteAddOns/VERSION @@ -1 +1 @@ -0.3.3 +0.3.5 diff --git a/GSuiteAddOns/composer.json b/GSuiteAddOns/composer.json index e0c07b62defa..c06461719d5d 100644 --- a/GSuiteAddOns/composer.json +++ b/GSuiteAddOns/composer.json @@ -21,7 +21,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Gaming/.repo-metadata.json b/Gaming/.repo-metadata.json deleted file mode 100644 index b401343a62fa..000000000000 --- a/Gaming/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-game-servers", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-game-servers/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "gameservices" -} diff --git a/Gaming/VERSION b/Gaming/VERSION index e8ea05db8142..3c43790f5d82 100644 --- a/Gaming/VERSION +++ b/Gaming/VERSION @@ -1 +1 @@ -1.2.4 +1.2.6 diff --git a/Gaming/composer.json b/Gaming/composer.json index 62413d943a8d..a28366962ae4 100644 --- a/Gaming/composer.json +++ b/Gaming/composer.json @@ -25,7 +25,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/GeoCommonProtos/.OwlBot.yaml b/GeoCommonProtos/.OwlBot.yaml new file mode 100644 index 000000000000..bfe7a4c243e3 --- /dev/null +++ b/GeoCommonProtos/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/geo/type/.*-php/(.*) + dest: /owl-bot-staging/GeoCommonProtos/$1 +api-name: GeoCommonProtos diff --git a/GeoCommonProtos/.gitattributes b/GeoCommonProtos/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/GeoCommonProtos/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/GeoCommonProtos/CONTRIBUTING.md b/GeoCommonProtos/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/GeoCommonProtos/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/GeoCommonProtos/LICENSE b/GeoCommonProtos/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/GeoCommonProtos/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/GeoCommonProtos/README.md b/GeoCommonProtos/README.md new file mode 100644 index 000000000000..48d84efd3466 --- /dev/null +++ b/GeoCommonProtos/README.md @@ -0,0 +1,43 @@ +# Google Geo Common Protos for PHP + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +This repository is a home for the [protocol buffer][protobuf] types which are +shared by multiple Google Geo APIs, generated for PHP. +The protobuf definitions for these generated PHP classes are provided in the +[Googleapis][googleapis] repository. + +## Using these generated classes + +These classes are made available under an Apache license (see `LICENSE`) and +you are free to depend on them within your applications. They are +considered stable and will not change in backwards-incompaible ways. + +They are distributed as the [google/geo-common-protos][packagist-geo-common-protos] +composer package, available on [Packagist][packagist]. + +In order to depend on these classes, add the following line to your +composer.json file in the `requires` section: + +``` + "google/geo-common-protos": "^0.1" +``` + +Or else use composer from the command line: + +```bash +composer require google/geo-common-protos +``` + +## License + +These classes are licensed using the Apache 2.0 software license, a +permissive, copyfree license. You are free to use them in your applications +provided the license terms are honored. + + [protobuf]: https://developers.google.com/protocol-buffers/ + [googleapis]: https://github.com/googleapis/googleapis/ + [packagist-geo-common-protos]: https://packagist.org/packages/google/geo-common-protos/ + [packagist]: https://packagist.org/ diff --git a/GeoCommonProtos/VERSION b/GeoCommonProtos/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/GeoCommonProtos/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/GeoCommonProtos/composer.json b/GeoCommonProtos/composer.json new file mode 100644 index 000000000000..35ad4fe4d6b7 --- /dev/null +++ b/GeoCommonProtos/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/geo-common-protos", + "description": "Google Geo Common Protos for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Geo\\": "src", + "GPBMetadata\\Google\\Geo\\": "metadata" + } + }, + "extra": { + "component": { + "id": "geo-common-protos", + "path": "GeoCommonProtos", + "target": "googleapis/php-geo-common-protos" + } + }, + "require": { + "php": "^8.0", + "google/protobuf": "^4.26.1", + "google/common-protos": "^4.6" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google." + } +} diff --git a/GeoCommonProtos/metadata/Type/Viewport.php b/GeoCommonProtos/metadata/Type/Viewport.php new file mode 100644 index 000000000000..457f841676a4 --- /dev/null +++ b/GeoCommonProtos/metadata/Type/Viewport.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' +û +google/geo/type/viewport.protogoogle.geo.type"O +Viewport +low ( 2.google.type.LatLng! +high ( 2.google.type.LatLngBo +com.google.geo.typeB ViewportProtoPZ@google.golang.org/genproto/googleapis/geo/type/viewport;viewport¢GGTPbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/GeoCommonProtos/owlbot.py b/GeoCommonProtos/owlbot.py new file mode 100644 index 000000000000..642810ae4950 --- /dev/null +++ b/GeoCommonProtos/owlbot.py @@ -0,0 +1,63 @@ +# Copyright 2023 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/GeoCommonProtos").resolve() +dest = Path().resolve() +copy_excludes = [src / "**/[A-Z]*_*.php"] + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +# copy Geo Common Protos +php.owlbot_copy_version( + src=src, + dest=dest, + copy_excludes=copy_excludes, + version_string="type", +) + +# remove class_alias code +s.replace( + "src/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/BaseClient/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=80']) diff --git a/GeoCommonProtos/phpunit.xml.dist b/GeoCommonProtos/phpunit.xml.dist new file mode 100644 index 000000000000..1081fa5e2d18 --- /dev/null +++ b/GeoCommonProtos/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + tests/Unit + + + + + src + + src/V[!a-zA-Z]* + + + + diff --git a/GeoCommonProtos/pull_request_template.md b/GeoCommonProtos/pull_request_template.md new file mode 100644 index 000000000000..e4cddf2bb114 --- /dev/null +++ b/GeoCommonProtos/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `ShoppingMerchantInventories/src`, and tests in `ShoppingMerchantInventories/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/GeoCommonProtos/src/Type/Viewport.php b/GeoCommonProtos/src/Type/Viewport.php new file mode 100644 index 000000000000..c10e8dd98047 --- /dev/null +++ b/GeoCommonProtos/src/Type/Viewport.php @@ -0,0 +1,147 @@ + `high.longitude`, the longitude range is inverted + * (the viewport crosses the 180 degree longitude line). + * - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, + * the viewport includes all longitudes. + * - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, + * the longitude range is empty. + * - If `low.latitude` > `high.latitude`, the latitude range is empty. + * Both `low` and `high` must be populated, and the represented box cannot be + * empty (as specified by the definitions above). An empty viewport will result + * in an error. + * For example, this viewport fully encloses New York City: + * { + * "low": { + * "latitude": 40.477398, + * "longitude": -74.259087 + * }, + * "high": { + * "latitude": 40.91618, + * "longitude": -73.70018 + * } + * } + * + * Generated from protobuf message google.geo.type.Viewport + */ +class Viewport extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The low point of the viewport. + * + * Generated from protobuf field .google.type.LatLng low = 1; + */ + protected $low = null; + /** + * Required. The high point of the viewport. + * + * Generated from protobuf field .google.type.LatLng high = 2; + */ + protected $high = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $low + * Required. The low point of the viewport. + * @type \Google\Type\LatLng $high + * Required. The high point of the viewport. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Geo\Type\Viewport::initOnce(); + parent::__construct($data); + } + + /** + * Required. The low point of the viewport. + * + * Generated from protobuf field .google.type.LatLng low = 1; + * @return \Google\Type\LatLng|null + */ + public function getLow() + { + return $this->low; + } + + public function hasLow() + { + return isset($this->low); + } + + public function clearLow() + { + unset($this->low); + } + + /** + * Required. The low point of the viewport. + * + * Generated from protobuf field .google.type.LatLng low = 1; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setLow($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->low = $var; + + return $this; + } + + /** + * Required. The high point of the viewport. + * + * Generated from protobuf field .google.type.LatLng high = 2; + * @return \Google\Type\LatLng|null + */ + public function getHigh() + { + return $this->high; + } + + public function hasHigh() + { + return isset($this->high); + } + + public function clearHigh() + { + unset($this->high); + } + + /** + * Required. The high point of the viewport. + * + * Generated from protobuf field .google.type.LatLng high = 2; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setHigh($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->high = $var; + + return $this; + } + +} + diff --git a/GeoCommonProtos/tests/Unit/InstantiateClassesTest.php b/GeoCommonProtos/tests/Unit/InstantiateClassesTest.php new file mode 100644 index 000000000000..1acd5f51c5c5 --- /dev/null +++ b/GeoCommonProtos/tests/Unit/InstantiateClassesTest.php @@ -0,0 +1,61 @@ +assertNotNull($instance); + } + + public function classesProvider() + { + $directoryPrefix = __DIR__ . '/../../src'; + $directoryPrefixLength = strlen($directoryPrefix); + $phpFileSuffix = '.php'; + $phpFileSuffixLength = strlen($phpFileSuffix); + $phpFileSuffixRegex = '#.+\.php$#'; + + $dir = new RecursiveDirectoryIterator($directoryPrefix); + $it = new RecursiveIteratorIterator($dir); + $reg = new RegexIterator($it, $phpFileSuffixRegex, RecursiveRegexIterator::GET_MATCH); + foreach ($reg as $files) { + $file = $files[0]; + // Remove prefix and suffix + $trimmedFile = substr($file, $directoryPrefixLength, -$phpFileSuffixLength); + // Prepend standard '\Google\Geo' portion of namespace, then replace '/' with '\' + $fullyQualifiedName = "\\Google\\Geo" . str_replace("/", "\\", $trimmedFile); + yield [$fullyQualifiedName]; + } + } +} diff --git a/GkeBackup/.repo-metadata.json b/GkeBackup/.repo-metadata.json deleted file mode 100644 index 79a3da503afd..000000000000 --- a/GkeBackup/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-gke-backup", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gke-backup/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "gkebackup" -} diff --git a/GkeBackup/VERSION b/GkeBackup/VERSION index 39e898a4f952..6f4eebdf6f68 100644 --- a/GkeBackup/VERSION +++ b/GkeBackup/VERSION @@ -1 +1 @@ -0.7.1 +0.8.1 diff --git a/GkeBackup/composer.json b/GkeBackup/composer.json index 143350f34c46..66087458cfb5 100644 --- a/GkeBackup/composer.json +++ b/GkeBackup/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/GkeBackup/metadata/V1/Backup.php b/GkeBackup/metadata/V1/Backup.php index 29dacb1679325fe492e9c0967c3c3bc950e4d523..269a696537196f79aa63bc3aa7dc8a070b10c6c7 100644 GIT binary patch delta 52 zcmew?Hc@=TNhZd>lTR_NWNPEvT*}Gh24U24=>En>R8mFfv}*e2K-2h4I5?Sx#q0Ng)|7{({t^+|1(Q%(B$@-29YO P33dfW4UWyxTuLkeX*&{f delta 33 pcmbO&`&VYe24=?Q%^R5&7#X*1zQp3i!gy)3ET=Q$<~lA}768>73mX6c diff --git a/GkeBackup/metadata/V1/Common.php b/GkeBackup/metadata/V1/Common.php index ff4432dc491aad17a72e2cedef6e378e15ce631c..033eea30b1d5cefb73dcb3658a53162ea80bc41d 100644 GIT binary patch delta 107 zcmcb^xru9o7ZcMw*3CXl)r?_EAzXZ6`8lPzsUejGsjhjYxk^r4TnG^%X)f_Ff1gla z*Z7dg0N40Xzu*8@XHPdzR~G>WA#pBYcW2l50N0>k&)^VOzmRwr&tPu>#?8l>MHvC% CY##jp delta 20 bcmdnQb%%3<7ZcM7md!p))r^~ESwtBDNh$@? diff --git a/GkeBackup/metadata/V1/Restore.php b/GkeBackup/metadata/V1/Restore.php index 331187846cb456db3c2a96f964761220f3c25493..4db46a950b0d2964c4d991f0fd4d5023288f105f 100644 GIT binary patch delta 972 zcmZ`&J#W)c6vfYuliaklc}1=3(vW^2T7d$JKq?gjNpM4H+LV5Y%_PoiW#QPyPAVb> zMm7fCz=~i)0#(W%03orU4vbk)S0KYLKG2mjsEuF7Kq`l+^`M&F7OZov#+I;mGpyJp&ZzA_NB7n$Td?L?K? z5D)e4!=OieCQo$7tFb%=gFJ3<^1wz|Df2>mJn>PAsD}cixbg9PI0bKm>^hcdw3stt z?ripUS7t&%%uHh6v6^+FH(D-HP(ZlO2on!>0(^_Xn%%5tdY^aC5trCCVjCtqOqlC3S1+I5J5%HhD~x~Vgx(6Qs~-dy`A3m$4SuCz z`nxTb9(P4wCl)cn_aN?($4%4YF!RD;0ku0rHwEcPfJyo(Hc7L|hXkuIx~gpyHGOks zd0j8B>4oyzQfaxcH7w#;NQbozZM~E$X!=gMw7shJu_QbRg=Q{?Ie$X0d=4tUH||9 delta 85 zcmV-b0IL73GR-Bh%K`$oACt`jssjH9vv~vQ0+SyXFq7;D=K{PGv(*Tr1G7dAy95Oy ruK@}dlkf%?vmg{50RexLKNWwI9~LDDLc;+H9b<28lQ9b#lQ|glT6P^R diff --git a/GkeBackup/src/V1/Backup.php b/GkeBackup/src/V1/Backup.php index 14f35f1f0cde..2f34b6feac74 100644 --- a/GkeBackup/src/V1/Backup.php +++ b/GkeBackup/src/V1/Backup.php @@ -207,6 +207,17 @@ class Backup extends \Google\Protobuf\Internal\Message * Generated from protobuf field int64 config_backup_size_bytes = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $config_backup_size_bytes = 0; + /** + * Output only. If false, Backup will fail when Backup for GKE detects + * Kubernetes configuration that is non-standard or + * requires additional setup to restore. + * Inherited from the parent BackupPlan's + * [permissive_mode][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.permissive_mode] + * value. + * + * Generated from protobuf field bool permissive_mode = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $permissive_mode = false; protected $backup_scope; /** @@ -316,6 +327,13 @@ class Backup extends \Google\Protobuf\Internal\Message * Output only. The total number of Kubernetes Pods contained in the Backup. * @type int|string $config_backup_size_bytes * Output only. The size of the config backup in bytes. + * @type bool $permissive_mode + * Output only. If false, Backup will fail when Backup for GKE detects + * Kubernetes configuration that is non-standard or + * requires additional setup to restore. + * Inherited from the parent BackupPlan's + * [permissive_mode][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.permissive_mode] + * value. * } */ public function __construct($data = NULL) { @@ -1204,6 +1222,42 @@ public function setConfigBackupSizeBytes($var) return $this; } + /** + * Output only. If false, Backup will fail when Backup for GKE detects + * Kubernetes configuration that is non-standard or + * requires additional setup to restore. + * Inherited from the parent BackupPlan's + * [permissive_mode][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.permissive_mode] + * value. + * + * Generated from protobuf field bool permissive_mode = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getPermissiveMode() + { + return $this->permissive_mode; + } + + /** + * Output only. If false, Backup will fail when Backup for GKE detects + * Kubernetes configuration that is non-standard or + * requires additional setup to restore. + * Inherited from the parent BackupPlan's + * [permissive_mode][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.permissive_mode] + * value. + * + * Generated from protobuf field bool permissive_mode = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setPermissiveMode($var) + { + GPBUtil::checkBool($var); + $this->permissive_mode = $var; + + return $this; + } + /** * @return string */ diff --git a/GkeBackup/src/V1/BackupPlan/BackupConfig.php b/GkeBackup/src/V1/BackupPlan/BackupConfig.php index 78ecbf783f33..d71282e86a29 100644 --- a/GkeBackup/src/V1/BackupPlan/BackupConfig.php +++ b/GkeBackup/src/V1/BackupPlan/BackupConfig.php @@ -41,6 +41,15 @@ class BackupConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.gkebackup.v1.EncryptionKey encryption_key = 6 [(.google.api.field_behavior) = OPTIONAL]; */ private $encryption_key = null; + /** + * Optional. If false, Backups will fail when Backup for GKE detects + * Kubernetes configuration that is non-standard or + * requires additional setup to restore. + * Default: False + * + * Generated from protobuf field bool permissive_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $permissive_mode = false; protected $backup_scope; /** @@ -69,6 +78,11 @@ class BackupConfig extends \Google\Protobuf\Internal\Message * used to encrypt the "config" portion (the Kubernetes resources) of * Backups created via this plan. * Default (empty): Config backup artifacts will not be encrypted. + * @type bool $permissive_mode + * Optional. If false, Backups will fail when Backup for GKE detects + * Kubernetes configuration that is non-standard or + * requires additional setup to restore. + * Default: False * } */ public function __construct($data = NULL) { @@ -273,6 +287,38 @@ public function setEncryptionKey($var) return $this; } + /** + * Optional. If false, Backups will fail when Backup for GKE detects + * Kubernetes configuration that is non-standard or + * requires additional setup to restore. + * Default: False + * + * Generated from protobuf field bool permissive_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getPermissiveMode() + { + return $this->permissive_mode; + } + + /** + * Optional. If false, Backups will fail when Backup for GKE detects + * Kubernetes configuration that is non-standard or + * requires additional setup to restore. + * Default: False + * + * Generated from protobuf field bool permissive_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setPermissiveMode($var) + { + GPBUtil::checkBool($var); + $this->permissive_mode = $var; + + return $this; + } + /** * @return string */ diff --git a/GkeBackup/src/V1/ExclusionWindow.php b/GkeBackup/src/V1/ExclusionWindow.php index 536795ca6c17..0a1f94d742d0 100644 --- a/GkeBackup/src/V1/ExclusionWindow.php +++ b/GkeBackup/src/V1/ExclusionWindow.php @@ -24,8 +24,10 @@ class ExclusionWindow extends \Google\Protobuf\Internal\Message */ private $start_time = null; /** - * Required. Specifies duration of the window. Restrictions for duration based - * on the recurrence type to allow some time for backup to happen: + * Required. Specifies duration of the window. + * Duration must be >= 5 minutes and < (target RPO - 20 minutes). + * Additional restrictions based on the recurrence type to allow some time for + * backup to happen: * - single_occurrence_date: no restriction, but UI may warn about this when * duration >= target RPO * - daily window: duration < 24 hours @@ -48,8 +50,10 @@ class ExclusionWindow extends \Google\Protobuf\Internal\Message * Required. Specifies the start time of the window using time of the day in * UTC. * @type \Google\Protobuf\Duration $duration - * Required. Specifies duration of the window. Restrictions for duration based - * on the recurrence type to allow some time for backup to happen: + * Required. Specifies duration of the window. + * Duration must be >= 5 minutes and < (target RPO - 20 minutes). + * Additional restrictions based on the recurrence type to allow some time for + * backup to happen: * - single_occurrence_date: no restriction, but UI may warn about this when * duration >= target RPO * - daily window: duration < 24 hours @@ -110,8 +114,10 @@ public function setStartTime($var) } /** - * Required. Specifies duration of the window. Restrictions for duration based - * on the recurrence type to allow some time for backup to happen: + * Required. Specifies duration of the window. + * Duration must be >= 5 minutes and < (target RPO - 20 minutes). + * Additional restrictions based on the recurrence type to allow some time for + * backup to happen: * - single_occurrence_date: no restriction, but UI may warn about this when * duration >= target RPO * - daily window: duration < 24 hours @@ -138,8 +144,10 @@ public function clearDuration() } /** - * Required. Specifies duration of the window. Restrictions for duration based - * on the recurrence type to allow some time for backup to happen: + * Required. Specifies duration of the window. + * Duration must be >= 5 minutes and < (target RPO - 20 minutes). + * Additional restrictions based on the recurrence type to allow some time for + * backup to happen: * - single_occurrence_date: no restriction, but UI may warn about this when * duration >= target RPO * - daily window: duration < 24 hours diff --git a/GkeBackup/src/V1/ResourceSelector.php b/GkeBackup/src/V1/ResourceSelector.php new file mode 100644 index 000000000000..d31e84973d54 --- /dev/null +++ b/GkeBackup/src/V1/ResourceSelector.php @@ -0,0 +1,232 @@ +google.cloud.gkebackup.v1.ResourceSelector + */ +class ResourceSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Selects resources using their Kubernetes GroupKinds. If + * specified, only resources of provided GroupKind will be selected. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $group_kind = null; + /** + * Optional. Selects resources using their resource names. If specified, + * only resources with the provided name will be selected. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $name = ''; + /** + * Optional. Selects resources using their namespaces. This only applies to + * namespace scoped resources and cannot be used for selecting + * cluster scoped resources. If specified, only resources in the provided + * namespace will be selected. If not specified, the filter will apply to + * both cluster scoped and namespace scoped resources (e.g. name or label). + * The [Namespace](https://pkg.go.dev/k8s.io/api/core/v1#Namespace) resource + * itself will be restored if and only if any resources within the namespace + * are restored. + * + * Generated from protobuf field string namespace = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $namespace = ''; + /** + * Optional. Selects resources using Kubernetes + * [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/). + * If specified, a resource will be selected if and only if the resource + * has all of the provided labels and all the label values match. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind $group_kind + * Optional. Selects resources using their Kubernetes GroupKinds. If + * specified, only resources of provided GroupKind will be selected. + * @type string $name + * Optional. Selects resources using their resource names. If specified, + * only resources with the provided name will be selected. + * @type string $namespace + * Optional. Selects resources using their namespaces. This only applies to + * namespace scoped resources and cannot be used for selecting + * cluster scoped resources. If specified, only resources in the provided + * namespace will be selected. If not specified, the filter will apply to + * both cluster scoped and namespace scoped resources (e.g. name or label). + * The [Namespace](https://pkg.go.dev/k8s.io/api/core/v1#Namespace) resource + * itself will be restored if and only if any resources within the namespace + * are restored. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Selects resources using Kubernetes + * [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/). + * If specified, a resource will be selected if and only if the resource + * has all of the provided labels and all the label values match. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkebackup\V1\Restore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Selects resources using their Kubernetes GroupKinds. If + * specified, only resources of provided GroupKind will be selected. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind|null + */ + public function getGroupKind() + { + return $this->group_kind; + } + + public function hasGroupKind() + { + return isset($this->group_kind); + } + + public function clearGroupKind() + { + unset($this->group_kind); + } + + /** + * Optional. Selects resources using their Kubernetes GroupKinds. If + * specified, only resources of provided GroupKind will be selected. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind $var + * @return $this + */ + public function setGroupKind($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind::class); + $this->group_kind = $var; + + return $this; + } + + /** + * Optional. Selects resources using their resource names. If specified, + * only resources with the provided name will be selected. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Selects resources using their resource names. If specified, + * only resources with the provided name will be selected. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Selects resources using their namespaces. This only applies to + * namespace scoped resources and cannot be used for selecting + * cluster scoped resources. If specified, only resources in the provided + * namespace will be selected. If not specified, the filter will apply to + * both cluster scoped and namespace scoped resources (e.g. name or label). + * The [Namespace](https://pkg.go.dev/k8s.io/api/core/v1#Namespace) resource + * itself will be restored if and only if any resources within the namespace + * are restored. + * + * Generated from protobuf field string namespace = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNamespace() + { + return $this->namespace; + } + + /** + * Optional. Selects resources using their namespaces. This only applies to + * namespace scoped resources and cannot be used for selecting + * cluster scoped resources. If specified, only resources in the provided + * namespace will be selected. If not specified, the filter will apply to + * both cluster scoped and namespace scoped resources (e.g. name or label). + * The [Namespace](https://pkg.go.dev/k8s.io/api/core/v1#Namespace) resource + * itself will be restored if and only if any resources within the namespace + * are restored. + * + * Generated from protobuf field string namespace = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNamespace($var) + { + GPBUtil::checkString($var, True); + $this->namespace = $var; + + return $this; + } + + /** + * Optional. Selects resources using Kubernetes + * [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/). + * If specified, a resource will be selected if and only if the resource + * has all of the provided labels and all the label values match. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Selects resources using Kubernetes + * [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/). + * If specified, a resource will be selected if and only if the resource + * has all of the provided labels and all the label values match. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/GkeBackup/src/V1/Restore.php b/GkeBackup/src/V1/Restore.php index 507ac802f4b8..2d71281ee421 100644 --- a/GkeBackup/src/V1/Restore.php +++ b/GkeBackup/src/V1/Restore.php @@ -142,6 +142,26 @@ class Restore extends \Google\Protobuf\Internal\Message * Generated from protobuf field string etag = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $etag = ''; + /** + * Optional. Immutable. Filters resources for `Restore`. If not specified, the + * scope of the restore will remain the same as defined in the `RestorePlan`. + * If this is specified, and no resources are matched by the + * `inclusion_filters` or everyting is excluded by the `exclusion_filters`, + * nothing will be restored. This filter can only be specified if the value of + * [namespaced_resource_restore_mode][google.cloud.gkebackup.v1.RestoreConfig.namespaced_resource_restore_mode] + * is set to `MERGE_SKIP_ON_CONFLICT`, `MERGE_REPLACE_VOLUME_ON_CONFLICT` or + * `MERGE_REPLACE_ON_CONFLICT`. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.Restore.Filter filter = 18 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + private $filter = null; + /** + * Optional. Immutable. Overrides the volume data restore policies selected in + * the Restore Config for override-scoped resources. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.VolumeDataRestorePolicyOverride volume_data_restore_policy_overrides = 19 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + private $volume_data_restore_policy_overrides; /** * Constructor. @@ -207,6 +227,18 @@ class Restore extends \Google\Protobuf\Internal\Message * and systems are expected to put that etag in the request to * `UpdateRestore` or `DeleteRestore` to ensure that their change will be * applied to the same version of the resource. + * @type \Google\Cloud\GkeBackup\V1\Restore\Filter $filter + * Optional. Immutable. Filters resources for `Restore`. If not specified, the + * scope of the restore will remain the same as defined in the `RestorePlan`. + * If this is specified, and no resources are matched by the + * `inclusion_filters` or everyting is excluded by the `exclusion_filters`, + * nothing will be restored. This filter can only be specified if the value of + * [namespaced_resource_restore_mode][google.cloud.gkebackup.v1.RestoreConfig.namespaced_resource_restore_mode] + * is set to `MERGE_SKIP_ON_CONFLICT`, `MERGE_REPLACE_VOLUME_ON_CONFLICT` or + * `MERGE_REPLACE_ON_CONFLICT`. + * @type array<\Google\Cloud\GkeBackup\V1\VolumeDataRestorePolicyOverride>|\Google\Protobuf\Internal\RepeatedField $volume_data_restore_policy_overrides + * Optional. Immutable. Overrides the volume data restore policies selected in + * the Restore Config for override-scoped resources. * } */ public function __construct($data = NULL) { @@ -744,5 +776,83 @@ public function setEtag($var) return $this; } + /** + * Optional. Immutable. Filters resources for `Restore`. If not specified, the + * scope of the restore will remain the same as defined in the `RestorePlan`. + * If this is specified, and no resources are matched by the + * `inclusion_filters` or everyting is excluded by the `exclusion_filters`, + * nothing will be restored. This filter can only be specified if the value of + * [namespaced_resource_restore_mode][google.cloud.gkebackup.v1.RestoreConfig.namespaced_resource_restore_mode] + * is set to `MERGE_SKIP_ON_CONFLICT`, `MERGE_REPLACE_VOLUME_ON_CONFLICT` or + * `MERGE_REPLACE_ON_CONFLICT`. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.Restore.Filter filter = 18 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GkeBackup\V1\Restore\Filter|null + */ + public function getFilter() + { + return $this->filter; + } + + public function hasFilter() + { + return isset($this->filter); + } + + public function clearFilter() + { + unset($this->filter); + } + + /** + * Optional. Immutable. Filters resources for `Restore`. If not specified, the + * scope of the restore will remain the same as defined in the `RestorePlan`. + * If this is specified, and no resources are matched by the + * `inclusion_filters` or everyting is excluded by the `exclusion_filters`, + * nothing will be restored. This filter can only be specified if the value of + * [namespaced_resource_restore_mode][google.cloud.gkebackup.v1.RestoreConfig.namespaced_resource_restore_mode] + * is set to `MERGE_SKIP_ON_CONFLICT`, `MERGE_REPLACE_VOLUME_ON_CONFLICT` or + * `MERGE_REPLACE_ON_CONFLICT`. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.Restore.Filter filter = 18 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GkeBackup\V1\Restore\Filter $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeBackup\V1\Restore\Filter::class); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Immutable. Overrides the volume data restore policies selected in + * the Restore Config for override-scoped resources. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.VolumeDataRestorePolicyOverride volume_data_restore_policy_overrides = 19 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumeDataRestorePolicyOverrides() + { + return $this->volume_data_restore_policy_overrides; + } + + /** + * Optional. Immutable. Overrides the volume data restore policies selected in + * the Restore Config for override-scoped resources. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.VolumeDataRestorePolicyOverride volume_data_restore_policy_overrides = 19 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GkeBackup\V1\VolumeDataRestorePolicyOverride>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumeDataRestorePolicyOverrides($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeBackup\V1\VolumeDataRestorePolicyOverride::class); + $this->volume_data_restore_policy_overrides = $arr; + + return $this; + } + } diff --git a/GkeBackup/src/V1/Restore/Filter.php b/GkeBackup/src/V1/Restore/Filter.php new file mode 100644 index 000000000000..ea224f4519b9 --- /dev/null +++ b/GkeBackup/src/V1/Restore/Filter.php @@ -0,0 +1,126 @@ +google.cloud.gkebackup.v1.Restore.Filter + */ +class Filter extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Selects resources for restoration. If specified, only resources + * which match `inclusion_filters` will be selected for restoration. A + * resource will be selected if it matches any `ResourceSelector` of the + * `inclusion_filters`. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.ResourceSelector inclusion_filters = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $inclusion_filters; + /** + * Optional. Excludes resources from restoration. If specified, + * a resource will not be restored if it matches + * any `ResourceSelector` of the `exclusion_filters`. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.ResourceSelector exclusion_filters = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $exclusion_filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeBackup\V1\ResourceSelector>|\Google\Protobuf\Internal\RepeatedField $inclusion_filters + * Optional. Selects resources for restoration. If specified, only resources + * which match `inclusion_filters` will be selected for restoration. A + * resource will be selected if it matches any `ResourceSelector` of the + * `inclusion_filters`. + * @type array<\Google\Cloud\GkeBackup\V1\ResourceSelector>|\Google\Protobuf\Internal\RepeatedField $exclusion_filters + * Optional. Excludes resources from restoration. If specified, + * a resource will not be restored if it matches + * any `ResourceSelector` of the `exclusion_filters`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkebackup\V1\Restore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Selects resources for restoration. If specified, only resources + * which match `inclusion_filters` will be selected for restoration. A + * resource will be selected if it matches any `ResourceSelector` of the + * `inclusion_filters`. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.ResourceSelector inclusion_filters = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInclusionFilters() + { + return $this->inclusion_filters; + } + + /** + * Optional. Selects resources for restoration. If specified, only resources + * which match `inclusion_filters` will be selected for restoration. A + * resource will be selected if it matches any `ResourceSelector` of the + * `inclusion_filters`. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.ResourceSelector inclusion_filters = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GkeBackup\V1\ResourceSelector>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInclusionFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeBackup\V1\ResourceSelector::class); + $this->inclusion_filters = $arr; + + return $this; + } + + /** + * Optional. Excludes resources from restoration. If specified, + * a resource will not be restored if it matches + * any `ResourceSelector` of the `exclusion_filters`. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.ResourceSelector exclusion_filters = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExclusionFilters() + { + return $this->exclusion_filters; + } + + /** + * Optional. Excludes resources from restoration. If specified, + * a resource will not be restored if it matches + * any `ResourceSelector` of the `exclusion_filters`. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.ResourceSelector exclusion_filters = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GkeBackup\V1\ResourceSelector>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExclusionFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeBackup\V1\ResourceSelector::class); + $this->exclusion_filters = $arr; + + return $this; + } + +} + + diff --git a/GkeBackup/src/V1/RestoreConfig.php b/GkeBackup/src/V1/RestoreConfig.php index 8ed78f7c6f7f..ae1e02288f0f 100644 --- a/GkeBackup/src/V1/RestoreConfig.php +++ b/GkeBackup/src/V1/RestoreConfig.php @@ -70,6 +70,20 @@ class RestoreConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11 [(.google.api.field_behavior) = OPTIONAL]; */ private $transformation_rules; + /** + * Optional. A table that binds volumes by their scope to a restore policy. + * Bindings must have a unique scope. Any volumes not scoped in the bindings + * are subject to the policy defined in volume_data_restore_policy. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicyBinding volume_data_restore_policy_bindings = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $volume_data_restore_policy_bindings; + /** + * Optional. RestoreOrder contains custom ordering to use on a Restore. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.RestoreOrder restore_order = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $restore_order = null; protected $namespaced_resource_restore_scope; /** @@ -125,6 +139,12 @@ class RestoreConfig extends \Google\Protobuf\Internal\Message * executed in order defined - this order matters, as changes made by a rule * may impact the filtering logic of subsequent rules. An empty list means no * transformation will occur. + * @type array<\Google\Cloud\GkeBackup\V1\RestoreConfig\VolumeDataRestorePolicyBinding>|\Google\Protobuf\Internal\RepeatedField $volume_data_restore_policy_bindings + * Optional. A table that binds volumes by their scope to a restore policy. + * Bindings must have a unique scope. Any volumes not scoped in the bindings + * are subject to the policy defined in volume_data_restore_policy. + * @type \Google\Cloud\GkeBackup\V1\RestoreConfig\RestoreOrder $restore_order + * Optional. RestoreOrder contains custom ordering to use on a Restore. * } */ public function __construct($data = NULL) { @@ -503,6 +523,72 @@ public function setTransformationRules($var) return $this; } + /** + * Optional. A table that binds volumes by their scope to a restore policy. + * Bindings must have a unique scope. Any volumes not scoped in the bindings + * are subject to the policy defined in volume_data_restore_policy. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicyBinding volume_data_restore_policy_bindings = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumeDataRestorePolicyBindings() + { + return $this->volume_data_restore_policy_bindings; + } + + /** + * Optional. A table that binds volumes by their scope to a restore policy. + * Bindings must have a unique scope. Any volumes not scoped in the bindings + * are subject to the policy defined in volume_data_restore_policy. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicyBinding volume_data_restore_policy_bindings = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GkeBackup\V1\RestoreConfig\VolumeDataRestorePolicyBinding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumeDataRestorePolicyBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeBackup\V1\RestoreConfig\VolumeDataRestorePolicyBinding::class); + $this->volume_data_restore_policy_bindings = $arr; + + return $this; + } + + /** + * Optional. RestoreOrder contains custom ordering to use on a Restore. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.RestoreOrder restore_order = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GkeBackup\V1\RestoreConfig\RestoreOrder|null + */ + public function getRestoreOrder() + { + return $this->restore_order; + } + + public function hasRestoreOrder() + { + return isset($this->restore_order); + } + + public function clearRestoreOrder() + { + unset($this->restore_order); + } + + /** + * Optional. RestoreOrder contains custom ordering to use on a Restore. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.RestoreOrder restore_order = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GkeBackup\V1\RestoreConfig\RestoreOrder $var + * @return $this + */ + public function setRestoreOrder($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeBackup\V1\RestoreConfig\RestoreOrder::class); + $this->restore_order = $var; + + return $this; + } + /** * @return string */ diff --git a/GkeBackup/src/V1/RestoreConfig/NamespacedResourceRestoreMode.php b/GkeBackup/src/V1/RestoreConfig/NamespacedResourceRestoreMode.php index 6cf09d2dff19..54bc9a892d85 100644 --- a/GkeBackup/src/V1/RestoreConfig/NamespacedResourceRestoreMode.php +++ b/GkeBackup/src/V1/RestoreConfig/NamespacedResourceRestoreMode.php @@ -42,11 +42,56 @@ class NamespacedResourceRestoreMode * Generated from protobuf enum FAIL_ON_CONFLICT = 2; */ const FAIL_ON_CONFLICT = 2; + /** + * This mode merges the backup and the target cluster and skips the + * conflicting resources. If a single resource to restore exists in the + * cluster before restoration, the resource will be skipped, otherwise it + * will be restored. + * + * Generated from protobuf enum MERGE_SKIP_ON_CONFLICT = 3; + */ + const MERGE_SKIP_ON_CONFLICT = 3; + /** + * This mode merges the backup and the target cluster and skips the + * conflicting resources except volume data. If a PVC to restore already + * exists, this mode will restore/reconnect the volume without overwriting + * the PVC. It is similar to MERGE_SKIP_ON_CONFLICT except that it will + * apply the volume data policy for the conflicting PVCs: + * - RESTORE_VOLUME_DATA_FROM_BACKUP: restore data only and respect the + * reclaim policy of the original PV; + * - REUSE_VOLUME_HANDLE_FROM_BACKUP: reconnect and respect the reclaim + * policy of the original PV; + * - NO_VOLUME_DATA_RESTORATION: new provision and respect the reclaim + * policy of the original PV. + * Note that this mode could cause data loss as the original PV can be + * retained or deleted depending on its reclaim policy. + * + * Generated from protobuf enum MERGE_REPLACE_VOLUME_ON_CONFLICT = 4; + */ + const MERGE_REPLACE_VOLUME_ON_CONFLICT = 4; + /** + * This mode merges the backup and the target cluster and replaces the + * conflicting resources with the ones in the backup. If a single resource + * to restore exists in the cluster before restoration, the resource will be + * replaced with the one from the backup. To replace an existing resource, + * the first attempt is to update the resource to match the one from the + * backup; if the update fails, the second attempt is to delete the resource + * and restore it from the backup. + * Note that this mode could cause data loss as it replaces the existing + * resources in the target cluster, and the original PV can be retained or + * deleted depending on its reclaim policy. + * + * Generated from protobuf enum MERGE_REPLACE_ON_CONFLICT = 5; + */ + const MERGE_REPLACE_ON_CONFLICT = 5; private static $valueToName = [ self::NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED => 'NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED', self::DELETE_AND_RESTORE => 'DELETE_AND_RESTORE', self::FAIL_ON_CONFLICT => 'FAIL_ON_CONFLICT', + self::MERGE_SKIP_ON_CONFLICT => 'MERGE_SKIP_ON_CONFLICT', + self::MERGE_REPLACE_VOLUME_ON_CONFLICT => 'MERGE_REPLACE_VOLUME_ON_CONFLICT', + self::MERGE_REPLACE_ON_CONFLICT => 'MERGE_REPLACE_ON_CONFLICT', ]; public static function name($value) diff --git a/GkeBackup/src/V1/RestoreConfig/RestoreOrder.php b/GkeBackup/src/V1/RestoreConfig/RestoreOrder.php new file mode 100644 index 000000000000..5d143f1454a3 --- /dev/null +++ b/GkeBackup/src/V1/RestoreConfig/RestoreOrder.php @@ -0,0 +1,77 @@ +google.cloud.gkebackup.v1.RestoreConfig.RestoreOrder + */ +class RestoreOrder extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Contains a list of group kind dependency pairs provided + * by the customer, that is used by Backup for GKE to + * generate a group kind restore order. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.RestoreConfig.RestoreOrder.GroupKindDependency group_kind_dependencies = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $group_kind_dependencies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeBackup\V1\RestoreConfig\RestoreOrder\GroupKindDependency>|\Google\Protobuf\Internal\RepeatedField $group_kind_dependencies + * Optional. Contains a list of group kind dependency pairs provided + * by the customer, that is used by Backup for GKE to + * generate a group kind restore order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkebackup\V1\Restore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Contains a list of group kind dependency pairs provided + * by the customer, that is used by Backup for GKE to + * generate a group kind restore order. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.RestoreConfig.RestoreOrder.GroupKindDependency group_kind_dependencies = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGroupKindDependencies() + { + return $this->group_kind_dependencies; + } + + /** + * Optional. Contains a list of group kind dependency pairs provided + * by the customer, that is used by Backup for GKE to + * generate a group kind restore order. + * + * Generated from protobuf field repeated .google.cloud.gkebackup.v1.RestoreConfig.RestoreOrder.GroupKindDependency group_kind_dependencies = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GkeBackup\V1\RestoreConfig\RestoreOrder\GroupKindDependency>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGroupKindDependencies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeBackup\V1\RestoreConfig\RestoreOrder\GroupKindDependency::class); + $this->group_kind_dependencies = $arr; + + return $this; + } + +} + + diff --git a/GkeBackup/src/V1/RestoreConfig/RestoreOrder/GroupKindDependency.php b/GkeBackup/src/V1/RestoreConfig/RestoreOrder/GroupKindDependency.php new file mode 100644 index 000000000000..ba8033e276dd --- /dev/null +++ b/GkeBackup/src/V1/RestoreConfig/RestoreOrder/GroupKindDependency.php @@ -0,0 +1,130 @@ +google.cloud.gkebackup.v1.RestoreConfig.RestoreOrder.GroupKindDependency + */ +class GroupKindDependency extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The satisfying group kind must be restored first + * in order to satisfy the dependency. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.GroupKind satisfying = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $satisfying = null; + /** + * Required. The requiring group kind requires that the other + * group kind be restored first. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.GroupKind requiring = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $requiring = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind $satisfying + * Required. The satisfying group kind must be restored first + * in order to satisfy the dependency. + * @type \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind $requiring + * Required. The requiring group kind requires that the other + * group kind be restored first. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkebackup\V1\Restore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The satisfying group kind must be restored first + * in order to satisfy the dependency. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.GroupKind satisfying = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind|null + */ + public function getSatisfying() + { + return $this->satisfying; + } + + public function hasSatisfying() + { + return isset($this->satisfying); + } + + public function clearSatisfying() + { + unset($this->satisfying); + } + + /** + * Required. The satisfying group kind must be restored first + * in order to satisfy the dependency. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.GroupKind satisfying = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind $var + * @return $this + */ + public function setSatisfying($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind::class); + $this->satisfying = $var; + + return $this; + } + + /** + * Required. The requiring group kind requires that the other + * group kind be restored first. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.GroupKind requiring = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind|null + */ + public function getRequiring() + { + return $this->requiring; + } + + public function hasRequiring() + { + return isset($this->requiring); + } + + public function clearRequiring() + { + unset($this->requiring); + } + + /** + * Required. The requiring group kind requires that the other + * group kind be restored first. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.GroupKind requiring = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind $var + * @return $this + */ + public function setRequiring($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeBackup\V1\RestoreConfig\GroupKind::class); + $this->requiring = $var; + + return $this; + } + +} + + diff --git a/GkeBackup/src/V1/RestoreConfig/VolumeDataRestorePolicyBinding.php b/GkeBackup/src/V1/RestoreConfig/VolumeDataRestorePolicyBinding.php new file mode 100644 index 000000000000..8518f2c8ea05 --- /dev/null +++ b/GkeBackup/src/V1/RestoreConfig/VolumeDataRestorePolicyBinding.php @@ -0,0 +1,117 @@ +google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicyBinding + */ +class VolumeDataRestorePolicyBinding extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The VolumeDataRestorePolicy to apply when restoring volumes in + * scope. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $policy = 0; + protected $scope; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $policy + * Required. The VolumeDataRestorePolicy to apply when restoring volumes in + * scope. + * @type int $volume_type + * The volume type, as determined by the PVC's bound PV, + * to apply the policy to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkebackup\V1\Restore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The VolumeDataRestorePolicy to apply when restoring volumes in + * scope. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getPolicy() + { + return $this->policy; + } + + /** + * Required. The VolumeDataRestorePolicy to apply when restoring volumes in + * scope. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeBackup\V1\RestoreConfig\VolumeDataRestorePolicy::class); + $this->policy = $var; + + return $this; + } + + /** + * The volume type, as determined by the PVC's bound PV, + * to apply the policy to. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.VolumeTypeEnum.VolumeType volume_type = 2; + * @return int + */ + public function getVolumeType() + { + return $this->readOneof(2); + } + + public function hasVolumeType() + { + return $this->hasOneof(2); + } + + /** + * The volume type, as determined by the PVC's bound PV, + * to apply the policy to. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.VolumeTypeEnum.VolumeType volume_type = 2; + * @param int $var + * @return $this + */ + public function setVolumeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeBackup\V1\VolumeTypeEnum\VolumeType::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getScope() + { + return $this->whichOneof("scope"); + } + +} + + diff --git a/GkeBackup/src/V1/VolumeDataRestorePolicyOverride.php b/GkeBackup/src/V1/VolumeDataRestorePolicyOverride.php new file mode 100644 index 000000000000..bca55959e4e8 --- /dev/null +++ b/GkeBackup/src/V1/VolumeDataRestorePolicyOverride.php @@ -0,0 +1,113 @@ +google.cloud.gkebackup.v1.VolumeDataRestorePolicyOverride + */ +class VolumeDataRestorePolicyOverride extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The VolumeDataRestorePolicy to apply when restoring volumes in + * scope. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $policy = 0; + protected $scope; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $policy + * Required. The VolumeDataRestorePolicy to apply when restoring volumes in + * scope. + * @type \Google\Cloud\GkeBackup\V1\NamespacedNames $selected_pvcs + * A list of PVCs to apply the policy override to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkebackup\V1\Restore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The VolumeDataRestorePolicy to apply when restoring volumes in + * scope. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getPolicy() + { + return $this->policy; + } + + /** + * Required. The VolumeDataRestorePolicy to apply when restoring volumes in + * scope. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeBackup\V1\RestoreConfig\VolumeDataRestorePolicy::class); + $this->policy = $var; + + return $this; + } + + /** + * A list of PVCs to apply the policy override to. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.NamespacedNames selected_pvcs = 2; + * @return \Google\Cloud\GkeBackup\V1\NamespacedNames|null + */ + public function getSelectedPvcs() + { + return $this->readOneof(2); + } + + public function hasSelectedPvcs() + { + return $this->hasOneof(2); + } + + /** + * A list of PVCs to apply the policy override to. + * + * Generated from protobuf field .google.cloud.gkebackup.v1.NamespacedNames selected_pvcs = 2; + * @param \Google\Cloud\GkeBackup\V1\NamespacedNames $var + * @return $this + */ + public function setSelectedPvcs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeBackup\V1\NamespacedNames::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getScope() + { + return $this->whichOneof("scope"); + } + +} + diff --git a/GkeBackup/src/V1/VolumeTypeEnum.php b/GkeBackup/src/V1/VolumeTypeEnum.php new file mode 100644 index 000000000000..2ca64f837a78 --- /dev/null +++ b/GkeBackup/src/V1/VolumeTypeEnum.php @@ -0,0 +1,33 @@ +google.cloud.gkebackup.v1.VolumeTypeEnum + */ +class VolumeTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkebackup\V1\Common::initOnce(); + parent::__construct($data); + } + +} + diff --git a/GkeBackup/src/V1/VolumeTypeEnum/VolumeType.php b/GkeBackup/src/V1/VolumeTypeEnum/VolumeType.php new file mode 100644 index 000000000000..1c14119fedd0 --- /dev/null +++ b/GkeBackup/src/V1/VolumeTypeEnum/VolumeType.php @@ -0,0 +1,55 @@ +google.cloud.gkebackup.v1.VolumeTypeEnum.VolumeType + */ +class VolumeType +{ + /** + * Default + * + * Generated from protobuf enum VOLUME_TYPE_UNSPECIFIED = 0; + */ + const VOLUME_TYPE_UNSPECIFIED = 0; + /** + * Compute Engine Persistent Disk volume + * + * Generated from protobuf enum GCE_PERSISTENT_DISK = 1; + */ + const GCE_PERSISTENT_DISK = 1; + + private static $valueToName = [ + self::VOLUME_TYPE_UNSPECIFIED => 'VOLUME_TYPE_UNSPECIFIED', + self::GCE_PERSISTENT_DISK => 'GCE_PERSISTENT_DISK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/GkeBackup/tests/Unit/V1/BackupForGKEClientTest.php b/GkeBackup/tests/Unit/V1/BackupForGKEClientTest.php index 38ececbf1574..877edf288ec7 100644 --- a/GkeBackup/tests/Unit/V1/BackupForGKEClientTest.php +++ b/GkeBackup/tests/Unit/V1/BackupForGKEClientTest.php @@ -118,6 +118,7 @@ public function createBackupTest() $description = 'description-1724546052'; $podCount = 977657493; $configBackupSizeBytes = 606785139; + $permissiveMode = false; $expectedResponse = new Backup(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); @@ -135,6 +136,7 @@ public function createBackupTest() $expectedResponse->setDescription($description); $expectedResponse->setPodCount($podCount); $expectedResponse->setConfigBackupSizeBytes($configBackupSizeBytes); + $expectedResponse->setPermissiveMode($permissiveMode); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -1174,6 +1176,7 @@ public function getBackupTest() $description = 'description-1724546052'; $podCount = 977657493; $configBackupSizeBytes = 606785139; + $permissiveMode = false; $expectedResponse = new Backup(); $expectedResponse->setName($name2); $expectedResponse->setUid($uid); @@ -1191,6 +1194,7 @@ public function getBackupTest() $expectedResponse->setDescription($description); $expectedResponse->setPodCount($podCount); $expectedResponse->setConfigBackupSizeBytes($configBackupSizeBytes); + $expectedResponse->setPermissiveMode($permissiveMode); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]', '[BACKUP]'); @@ -2116,6 +2120,7 @@ public function updateBackupTest() $description = 'description-1724546052'; $podCount = 977657493; $configBackupSizeBytes = 606785139; + $permissiveMode = false; $expectedResponse = new Backup(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); @@ -2133,6 +2138,7 @@ public function updateBackupTest() $expectedResponse->setDescription($description); $expectedResponse->setPodCount($podCount); $expectedResponse->setConfigBackupSizeBytes($configBackupSizeBytes); + $expectedResponse->setPermissiveMode($permissiveMode); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); diff --git a/GkeBackup/tests/Unit/V1/Client/BackupForGKEClientTest.php b/GkeBackup/tests/Unit/V1/Client/BackupForGKEClientTest.php index 765151839caf..eb8bda8b99ab 100644 --- a/GkeBackup/tests/Unit/V1/Client/BackupForGKEClientTest.php +++ b/GkeBackup/tests/Unit/V1/Client/BackupForGKEClientTest.php @@ -148,6 +148,7 @@ public function createBackupTest() $description = 'description-1724546052'; $podCount = 977657493; $configBackupSizeBytes = 606785139; + $permissiveMode = false; $expectedResponse = new Backup(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); @@ -165,6 +166,7 @@ public function createBackupTest() $expectedResponse->setDescription($description); $expectedResponse->setPodCount($podCount); $expectedResponse->setConfigBackupSizeBytes($configBackupSizeBytes); + $expectedResponse->setPermissiveMode($permissiveMode); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -1248,6 +1250,7 @@ public function getBackupTest() $description = 'description-1724546052'; $podCount = 977657493; $configBackupSizeBytes = 606785139; + $permissiveMode = false; $expectedResponse = new Backup(); $expectedResponse->setName($name2); $expectedResponse->setUid($uid); @@ -1265,6 +1268,7 @@ public function getBackupTest() $expectedResponse->setDescription($description); $expectedResponse->setPodCount($podCount); $expectedResponse->setConfigBackupSizeBytes($configBackupSizeBytes); + $expectedResponse->setPermissiveMode($permissiveMode); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]', '[BACKUP]'); @@ -2242,6 +2246,7 @@ public function updateBackupTest() $description = 'description-1724546052'; $podCount = 977657493; $configBackupSizeBytes = 606785139; + $permissiveMode = false; $expectedResponse = new Backup(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); @@ -2259,6 +2264,7 @@ public function updateBackupTest() $expectedResponse->setDescription($description); $expectedResponse->setPodCount($podCount); $expectedResponse->setConfigBackupSizeBytes($configBackupSizeBytes); + $expectedResponse->setPermissiveMode($permissiveMode); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -3164,6 +3170,7 @@ public function createBackupAsyncTest() $description = 'description-1724546052'; $podCount = 977657493; $configBackupSizeBytes = 606785139; + $permissiveMode = false; $expectedResponse = new Backup(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); @@ -3181,6 +3188,7 @@ public function createBackupAsyncTest() $expectedResponse->setDescription($description); $expectedResponse->setPodCount($podCount); $expectedResponse->setConfigBackupSizeBytes($configBackupSizeBytes); + $expectedResponse->setPermissiveMode($permissiveMode); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); diff --git a/GkeConnectGateway/.repo-metadata.json b/GkeConnectGateway/.repo-metadata.json deleted file mode 100644 index 028b32f9a922..000000000000 --- a/GkeConnectGateway/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-gke-connect-gateway", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gke-connect-gateway/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "connectgateway" -} diff --git a/GkeConnectGateway/VERSION b/GkeConnectGateway/VERSION index 2b7c5ae01848..6f2743d65dc0 100644 --- a/GkeConnectGateway/VERSION +++ b/GkeConnectGateway/VERSION @@ -1 +1 @@ -0.4.2 +0.4.4 diff --git a/GkeConnectGateway/composer.json b/GkeConnectGateway/composer.json index 31709c45f8f1..fadaa5cb2a23 100644 --- a/GkeConnectGateway/composer.json +++ b/GkeConnectGateway/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/GkeHub/.repo-metadata.json b/GkeHub/.repo-metadata.json deleted file mode 100644 index 6794ef2e9a00..000000000000 --- a/GkeHub/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-gke-hub", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gke-hub/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "gkehub" -} diff --git a/GkeHub/VERSION b/GkeHub/VERSION index 965065db5b84..b0bb878545dc 100644 --- a/GkeHub/VERSION +++ b/GkeHub/VERSION @@ -1 +1 @@ -0.9.3 +0.9.5 diff --git a/GkeHub/composer.json b/GkeHub/composer.json index c0ffeb03649a..df75bb15c6c0 100644 --- a/GkeHub/composer.json +++ b/GkeHub/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/GkeHub/src/V1/Client/GkeHubClient.php b/GkeHub/src/V1/Client/GkeHubClient.php index 23ebe7f8f213..41b3598d13cd 100644 --- a/GkeHub/src/V1/Client/GkeHubClient.php +++ b/GkeHub/src/V1/Client/GkeHubClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -49,6 +48,7 @@ use Google\Cloud\GkeHub\V1\Membership; use Google\Cloud\GkeHub\V1\UpdateFeatureRequest; use Google\Cloud\GkeHub\V1\UpdateMembershipRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -170,6 +170,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a feature * resource. diff --git a/GkeHub/tests/Unit/V1/Client/GkeHubClientTest.php b/GkeHub/tests/Unit/V1/Client/GkeHubClientTest.php index c0a92095d7db..0f0a46f910e3 100644 --- a/GkeHub/tests/Unit/V1/Client/GkeHubClientTest.php +++ b/GkeHub/tests/Unit/V1/Client/GkeHubClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\GkeHub\V1\Client\GkeHubClient; @@ -44,6 +43,7 @@ use Google\Cloud\GkeHub\V1\Membership; use Google\Cloud\GkeHub\V1\UpdateFeatureRequest; use Google\Cloud\GkeHub\V1\UpdateMembershipRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/GkeMultiCloud/.repo-metadata.json b/GkeMultiCloud/.repo-metadata.json deleted file mode 100644 index 0dee1906a179..000000000000 --- a/GkeMultiCloud/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-gke-multi-cloud", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gke-multi-cloud/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "gkemulticloud" -} diff --git a/GkeMultiCloud/VERSION b/GkeMultiCloud/VERSION index be14282b7fff..ee6cdce3c290 100644 --- a/GkeMultiCloud/VERSION +++ b/GkeMultiCloud/VERSION @@ -1 +1 @@ -0.5.3 +0.6.1 diff --git a/GkeMultiCloud/composer.json b/GkeMultiCloud/composer.json index 2b95096ca4bc..66217982e409 100644 --- a/GkeMultiCloud/composer.json +++ b/GkeMultiCloud/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/GkeMultiCloud/metadata/V1/AzureService.php b/GkeMultiCloud/metadata/V1/AzureService.php index 52434bb070ff..b6b507c9edfc 100644 --- a/GkeMultiCloud/metadata/V1/AzureService.php +++ b/GkeMultiCloud/metadata/V1/AzureService.php @@ -26,7 +26,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -¡D +ÙD 1google/cloud/gkemulticloud/v1/azure_service.protogoogle.cloud.gkemulticloud.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto3google/cloud/gkemulticloud/v1/azure_resources.proto4google/cloud/gkemulticloud/v1/common_resources.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"Ý CreateAzureClusterRequestA parent ( B1àAúA+)gkemulticloud.googleapis.com/AzureClusterG @@ -47,13 +47,14 @@ public static function initOnce() { page_token ( "y ListAzureClustersResponseC azure_clusters ( 2+.google.cloud.gkemulticloud.v1.AzureCluster -next_page_token ( "˜ +next_page_token ( "´ DeleteAzureClusterRequest? name ( B1àAúA+ )gkemulticloud.googleapis.com/AzureCluster allow_missing ( validate_only ( -etag ( "ä +etag (  + ignore_errors (BàA"ä CreateAzureNodePoolRequestB parent ( B2àAúA,*gkemulticloud.googleapis.com/AzureNodePoolJ azure_node_pool ( 2,.google.cloud.gkemulticloud.v1.AzureNodePoolBàA @@ -73,13 +74,14 @@ public static function initOnce() { page_token ( "} ListAzureNodePoolsResponseF azure_node_pools ( 2,.google.cloud.gkemulticloud.v1.AzureNodePool -next_page_token ( "š +next_page_token ( "¶ DeleteAzureNodePoolRequest@ name ( B2àAúA, *gkemulticloud.googleapis.com/AzureNodePool validate_only ( allow_missing ( -etag ( "g +etag (  + ignore_errors (BàA"g GetAzureOpenIdConfigRequestH azure_cluster ( B1àAúA+ )gkemulticloud.googleapis.com/AzureCluster"f diff --git a/GkeMultiCloud/samples/V1/AwsClustersClient/create_aws_node_pool.php b/GkeMultiCloud/samples/V1/AwsClustersClient/create_aws_node_pool.php index d51dc8eedd95..ac5ab532d32c 100644 --- a/GkeMultiCloud/samples/V1/AwsClustersClient/create_aws_node_pool.php +++ b/GkeMultiCloud/samples/V1/AwsClustersClient/create_aws_node_pool.php @@ -57,8 +57,8 @@ * You can list all supported versions on a given Google Cloud region by * calling * [GetAwsServerConfig][google.cloud.gkemulticloud.v1.AwsClusters.GetAwsServerConfig]. - * @param string $awsNodePoolConfigIamInstanceProfile The name or ARN of the AWS IAM role assigned to nodes in the - * pool. + * @param string $awsNodePoolConfigIamInstanceProfile The name or ARN of the AWS IAM instance profile to assign to + * nodes in the pool. * @param string $awsNodePoolConfigConfigEncryptionKmsKeyArn The ARN of the AWS KMS key used to encrypt user data. * @param int $awsNodePoolAutoscalingMinNodeCount Minimum number of nodes in the node pool. Must be greater than or * equal to 1 and less than or equal to max_node_count. diff --git a/GkeMultiCloud/samples/V1/AwsClustersClient/update_aws_node_pool.php b/GkeMultiCloud/samples/V1/AwsClustersClient/update_aws_node_pool.php index 1c536991a600..d76e48ceb750 100644 --- a/GkeMultiCloud/samples/V1/AwsClustersClient/update_aws_node_pool.php +++ b/GkeMultiCloud/samples/V1/AwsClustersClient/update_aws_node_pool.php @@ -44,8 +44,8 @@ * You can list all supported versions on a given Google Cloud region by * calling * [GetAwsServerConfig][google.cloud.gkemulticloud.v1.AwsClusters.GetAwsServerConfig]. - * @param string $awsNodePoolConfigIamInstanceProfile The name or ARN of the AWS IAM role assigned to nodes in the - * pool. + * @param string $awsNodePoolConfigIamInstanceProfile The name or ARN of the AWS IAM instance profile to assign to + * nodes in the pool. * @param string $awsNodePoolConfigConfigEncryptionKmsKeyArn The ARN of the AWS KMS key used to encrypt user data. * @param int $awsNodePoolAutoscalingMinNodeCount Minimum number of nodes in the node pool. Must be greater than or * equal to 1 and less than or equal to max_node_count. diff --git a/GkeMultiCloud/samples/V1/AzureClustersClient/get_azure_json_web_keys.php b/GkeMultiCloud/samples/V1/AzureClustersClient/get_azure_json_web_keys.php index 929437f2592a..589225420c35 100644 --- a/GkeMultiCloud/samples/V1/AzureClustersClient/get_azure_json_web_keys.php +++ b/GkeMultiCloud/samples/V1/AzureClustersClient/get_azure_json_web_keys.php @@ -34,7 +34,7 @@ * * @param string $formattedAzureCluster The AzureCluster, which owns the JsonWebKeys. * Format: - * projects//locations//azureClusters/ + * `projects//locations//azureClusters/` * Please see {@see AzureClustersClient::azureClusterName()} for help formatting this field. */ function get_azure_json_web_keys_sample(string $formattedAzureCluster): void diff --git a/GkeMultiCloud/src/V1/AwsNodeConfig.php b/GkeMultiCloud/src/V1/AwsNodeConfig.php index 2f63e3222de7..a27af8a5a10e 100644 --- a/GkeMultiCloud/src/V1/AwsNodeConfig.php +++ b/GkeMultiCloud/src/V1/AwsNodeConfig.php @@ -56,8 +56,8 @@ class AwsNodeConfig extends \Google\Protobuf\Internal\Message */ private $tags; /** - * Required. The name or ARN of the AWS IAM role assigned to nodes in the - * pool. + * Required. The name or ARN of the AWS IAM instance profile to assign to + * nodes in the pool. * * Generated from protobuf field string iam_instance_profile = 6 [(.google.api.field_behavior) = REQUIRED]; */ @@ -148,8 +148,8 @@ class AwsNodeConfig extends \Google\Protobuf\Internal\Message * (.+-=_:@/). Keys can be up to 127 Unicode characters. Values can be up to * 255 Unicode characters. * @type string $iam_instance_profile - * Required. The name or ARN of the AWS IAM role assigned to nodes in the - * pool. + * Required. The name or ARN of the AWS IAM instance profile to assign to + * nodes in the pool. * @type string $image_type * Optional. The OS image type to use on node pool instances. * Can be unspecified, or have a value of `ubuntu`. @@ -344,8 +344,8 @@ public function setTags($var) } /** - * Required. The name or ARN of the AWS IAM role assigned to nodes in the - * pool. + * Required. The name or ARN of the AWS IAM instance profile to assign to + * nodes in the pool. * * Generated from protobuf field string iam_instance_profile = 6 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -356,8 +356,8 @@ public function getIamInstanceProfile() } /** - * Required. The name or ARN of the AWS IAM role assigned to nodes in the - * pool. + * Required. The name or ARN of the AWS IAM instance profile to assign to + * nodes in the pool. * * Generated from protobuf field string iam_instance_profile = 6 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/GkeMultiCloud/src/V1/DeleteAzureClusterRequest.php b/GkeMultiCloud/src/V1/DeleteAzureClusterRequest.php index eff1d4f4c3d4..7db351b4cec9 100644 --- a/GkeMultiCloud/src/V1/DeleteAzureClusterRequest.php +++ b/GkeMultiCloud/src/V1/DeleteAzureClusterRequest.php @@ -52,6 +52,15 @@ class DeleteAzureClusterRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string etag = 4; */ private $etag = ''; + /** + * Optional. If set to true, the deletion of + * [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resource will + * succeed even if errors occur during deleting in cluster resources. Using + * this parameter may result in orphaned resources in the cluster. + * + * Generated from protobuf field bool ignore_errors = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ignore_errors = false; /** * @param string $name Required. The resource name the @@ -101,6 +110,11 @@ public static function build(string $name): self * Allows clients to perform deletions through optimistic concurrency control. * If the provided etag does not match the current etag of the cluster, * the request will fail and an ABORTED error will be returned. + * @type bool $ignore_errors + * Optional. If set to true, the deletion of + * [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resource will + * succeed even if errors occur during deleting in cluster resources. Using + * this parameter may result in orphaned resources in the cluster. * } */ public function __construct($data = NULL) { @@ -238,5 +252,37 @@ public function setEtag($var) return $this; } + /** + * Optional. If set to true, the deletion of + * [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resource will + * succeed even if errors occur during deleting in cluster resources. Using + * this parameter may result in orphaned resources in the cluster. + * + * Generated from protobuf field bool ignore_errors = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIgnoreErrors() + { + return $this->ignore_errors; + } + + /** + * Optional. If set to true, the deletion of + * [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resource will + * succeed even if errors occur during deleting in cluster resources. Using + * this parameter may result in orphaned resources in the cluster. + * + * Generated from protobuf field bool ignore_errors = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIgnoreErrors($var) + { + GPBUtil::checkBool($var); + $this->ignore_errors = $var; + + return $this; + } + } diff --git a/GkeMultiCloud/src/V1/DeleteAzureNodePoolRequest.php b/GkeMultiCloud/src/V1/DeleteAzureNodePoolRequest.php index bfe7dcb68d19..ad078d7dad23 100644 --- a/GkeMultiCloud/src/V1/DeleteAzureNodePoolRequest.php +++ b/GkeMultiCloud/src/V1/DeleteAzureNodePoolRequest.php @@ -54,6 +54,15 @@ class DeleteAzureNodePoolRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string etag = 4; */ private $etag = ''; + /** + * Optional. If set to true, the deletion of + * [AzureNodePool][google.cloud.gkemulticloud.v1.AzureNodePool] resource will + * succeed even if errors occur during deleting in node pool resources. Using + * this parameter may result in orphaned resources in the node pool. + * + * Generated from protobuf field bool ignore_errors = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ignore_errors = false; /** * @param string $name Required. The resource name the @@ -105,6 +114,11 @@ public static function build(string $name): self * Allows clients to perform deletions through optimistic concurrency control. * If the provided ETag does not match the current etag of the node pool, * the request will fail and an ABORTED error will be returned. + * @type bool $ignore_errors + * Optional. If set to true, the deletion of + * [AzureNodePool][google.cloud.gkemulticloud.v1.AzureNodePool] resource will + * succeed even if errors occur during deleting in node pool resources. Using + * this parameter may result in orphaned resources in the node pool. * } */ public function __construct($data = NULL) { @@ -246,5 +260,37 @@ public function setEtag($var) return $this; } + /** + * Optional. If set to true, the deletion of + * [AzureNodePool][google.cloud.gkemulticloud.v1.AzureNodePool] resource will + * succeed even if errors occur during deleting in node pool resources. Using + * this parameter may result in orphaned resources in the node pool. + * + * Generated from protobuf field bool ignore_errors = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIgnoreErrors() + { + return $this->ignore_errors; + } + + /** + * Optional. If set to true, the deletion of + * [AzureNodePool][google.cloud.gkemulticloud.v1.AzureNodePool] resource will + * succeed even if errors occur during deleting in node pool resources. Using + * this parameter may result in orphaned resources in the node pool. + * + * Generated from protobuf field bool ignore_errors = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIgnoreErrors($var) + { + GPBUtil::checkBool($var); + $this->ignore_errors = $var; + + return $this; + } + } diff --git a/GkeMultiCloud/src/V1/Gapic/AzureClustersGapicClient.php b/GkeMultiCloud/src/V1/Gapic/AzureClustersGapicClient.php index a66f1fc6aa42..2ae69c834eee 100644 --- a/GkeMultiCloud/src/V1/Gapic/AzureClustersGapicClient.php +++ b/GkeMultiCloud/src/V1/Gapic/AzureClustersGapicClient.php @@ -1011,6 +1011,11 @@ public function deleteAzureClient($name, array $optionalArgs = []) * * If the provided etag does not match the current etag of the cluster, * the request will fail and an ABORTED error will be returned. + * @type bool $ignoreErrors + * Optional. If set to true, the deletion of + * [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resource will + * succeed even if errors occur during deleting in cluster resources. Using + * this parameter may result in orphaned resources in the cluster. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1039,6 +1044,10 @@ public function deleteAzureCluster($name, array $optionalArgs = []) $request->setEtag($optionalArgs['etag']); } + if (isset($optionalArgs['ignoreErrors'])) { + $request->setIgnoreErrors($optionalArgs['ignoreErrors']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); @@ -1125,6 +1134,11 @@ public function deleteAzureCluster($name, array $optionalArgs = []) * * If the provided ETag does not match the current etag of the node pool, * the request will fail and an ABORTED error will be returned. + * @type bool $ignoreErrors + * Optional. If set to true, the deletion of + * [AzureNodePool][google.cloud.gkemulticloud.v1.AzureNodePool] resource will + * succeed even if errors occur during deleting in node pool resources. Using + * this parameter may result in orphaned resources in the node pool. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1153,6 +1167,10 @@ public function deleteAzureNodePool($name, array $optionalArgs = []) $request->setEtag($optionalArgs['etag']); } + if (isset($optionalArgs['ignoreErrors'])) { + $request->setIgnoreErrors($optionalArgs['ignoreErrors']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); @@ -1458,7 +1476,7 @@ public function getAzureCluster($name, array $optionalArgs = []) * * @param string $azureCluster Required. The AzureCluster, which owns the JsonWebKeys. * Format: - * projects//locations//azureClusters/ + * `projects//locations//azureClusters/` * @param array $optionalArgs { * Optional. * diff --git a/GkeMultiCloud/src/V1/GetAzureJsonWebKeysRequest.php b/GkeMultiCloud/src/V1/GetAzureJsonWebKeysRequest.php index 8e6ec041d75d..175b70d5b9a3 100644 --- a/GkeMultiCloud/src/V1/GetAzureJsonWebKeysRequest.php +++ b/GkeMultiCloud/src/V1/GetAzureJsonWebKeysRequest.php @@ -21,7 +21,7 @@ class GetAzureJsonWebKeysRequest extends \Google\Protobuf\Internal\Message /** * Required. The AzureCluster, which owns the JsonWebKeys. * Format: - * projects//locations//azureClusters/ + * `projects//locations//azureClusters/` * * Generated from protobuf field string azure_cluster = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -30,7 +30,7 @@ class GetAzureJsonWebKeysRequest extends \Google\Protobuf\Internal\Message /** * @param string $azureCluster Required. The AzureCluster, which owns the JsonWebKeys. * Format: - * projects//locations//azureClusters/ + * `projects//locations//azureClusters/` * Please see {@see AzureClustersClient::azureClusterName()} for help formatting this field. * * @return \Google\Cloud\GkeMultiCloud\V1\GetAzureJsonWebKeysRequest @@ -52,7 +52,7 @@ public static function build(string $azureCluster): self * @type string $azure_cluster * Required. The AzureCluster, which owns the JsonWebKeys. * Format: - * projects//locations//azureClusters/ + * `projects//locations//azureClusters/` * } */ public function __construct($data = NULL) { @@ -63,7 +63,7 @@ public function __construct($data = NULL) { /** * Required. The AzureCluster, which owns the JsonWebKeys. * Format: - * projects//locations//azureClusters/ + * `projects//locations//azureClusters/` * * Generated from protobuf field string azure_cluster = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -76,7 +76,7 @@ public function getAzureCluster() /** * Required. The AzureCluster, which owns the JsonWebKeys. * Format: - * projects//locations//azureClusters/ + * `projects//locations//azureClusters/` * * Generated from protobuf field string azure_cluster = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Grafeas/.repo-metadata.json b/Grafeas/.repo-metadata.json deleted file mode 100644 index 057197d52456..000000000000 --- a/Grafeas/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/grafeas", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/grafeas/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "containeranalysis" -} diff --git a/Grafeas/VERSION b/Grafeas/VERSION index 571215736a66..a3f5a8ed4d60 100644 --- a/Grafeas/VERSION +++ b/Grafeas/VERSION @@ -1 +1 @@ -0.10.1 +0.10.3 diff --git a/Grafeas/composer.json b/Grafeas/composer.json index 52f173277a51..41e3973cb5bf 100644 --- a/Grafeas/composer.json +++ b/Grafeas/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Iam/.repo-metadata.json b/Iam/.repo-metadata.json deleted file mode 100644 index 3c33990d70f5..000000000000 --- a/Iam/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-iam", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-iam/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/iam/docs", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "iam" -} diff --git a/Iam/VERSION b/Iam/VERSION index be14282b7fff..d1d899fa33a0 100644 --- a/Iam/VERSION +++ b/Iam/VERSION @@ -1 +1 @@ -0.5.3 +0.5.5 diff --git a/Iam/composer.json b/Iam/composer.json index 3ffbb63b0b35..3f124fbaf833 100644 --- a/Iam/composer.json +++ b/Iam/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/IamCredentials/.repo-metadata.json b/IamCredentials/.repo-metadata.json deleted file mode 100644 index 171c56e882ab..000000000000 --- a/IamCredentials/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-iam-credentials", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-iam-credentials/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "iamcredentials" -} diff --git a/IamCredentials/VERSION b/IamCredentials/VERSION index 0495c4a88cae..c813fe116c9f 100644 --- a/IamCredentials/VERSION +++ b/IamCredentials/VERSION @@ -1 +1 @@ -1.2.3 +1.2.5 diff --git a/IamCredentials/composer.json b/IamCredentials/composer.json index afd298042970..7a55f9454a80 100644 --- a/IamCredentials/composer.json +++ b/IamCredentials/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Iap/.repo-metadata.json b/Iap/.repo-metadata.json deleted file mode 100644 index d726d22796dc..000000000000 --- a/Iap/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-iap", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-iap/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "iap" -} diff --git a/Iap/VERSION b/Iap/VERSION index 428b770e3e23..e516bb9d963a 100644 --- a/Iap/VERSION +++ b/Iap/VERSION @@ -1 +1 @@ -1.4.3 +1.4.5 diff --git a/Iap/composer.json b/Iap/composer.json index 9070f4233367..0bd52f629c06 100644 --- a/Iap/composer.json +++ b/Iap/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Ids/.repo-metadata.json b/Ids/.repo-metadata.json deleted file mode 100644 index e5b7111ece68..000000000000 --- a/Ids/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-ids", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-ids/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "ids" -} diff --git a/Ids/README.md b/Ids/README.md index ccdd27435e2b..09440faf5b8b 100644 --- a/Ids/README.md +++ b/Ids/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/Ids/VERSION b/Ids/VERSION index be14282b7fff..d1d899fa33a0 100644 --- a/Ids/VERSION +++ b/Ids/VERSION @@ -1 +1 @@ -0.5.3 +0.5.5 diff --git a/Ids/composer.json b/Ids/composer.json index f2c7d5f3c99e..4a9267c8f2ff 100644 --- a/Ids/composer.json +++ b/Ids/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Ids/owlbot.py b/Ids/owlbot.py index 0ba12d50ced5..c20d5eeb904a 100644 --- a/Ids/owlbot.py +++ b/Ids/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -47,32 +41,6 @@ + "\n", '') -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) - # format generated clients subprocess.run([ 'npm', @@ -81,8 +49,8 @@ '--package=@prettier/plugin-php@^0.16', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', - '--print-width=80']) + '--print-width=120']) diff --git a/Ids/src/V1/Client/IDSClient.php b/Ids/src/V1/Client/IDSClient.php index 0351ecc04bc0..1588e03eed83 100644 --- a/Ids/src/V1/Client/IDSClient.php +++ b/Ids/src/V1/Client/IDSClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a endpoint * resource. diff --git a/Ids/src/V1/CreateEndpointRequest.php b/Ids/src/V1/CreateEndpointRequest.php index c411fd5848ac..928ba143eaf5 100644 --- a/Ids/src/V1/CreateEndpointRequest.php +++ b/Ids/src/V1/CreateEndpointRequest.php @@ -18,7 +18,7 @@ class CreateEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The endpoint identifier. This will be part of the endpoint's * resource name. @@ -29,13 +29,13 @@ class CreateEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $endpoint_id = ''; + protected $endpoint_id = ''; /** * Required. The endpoint to create. * * Generated from protobuf field .google.cloud.ids.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $endpoint = null; + protected $endpoint = null; /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -51,7 +51,7 @@ class CreateEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The endpoint's parent. Please see diff --git a/Ids/src/V1/DeleteEndpointRequest.php b/Ids/src/V1/DeleteEndpointRequest.php index b2e4ea6e9be8..fa24daaf67d1 100644 --- a/Ids/src/V1/DeleteEndpointRequest.php +++ b/Ids/src/V1/DeleteEndpointRequest.php @@ -18,7 +18,7 @@ class DeleteEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * An optional request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -34,7 +34,7 @@ class DeleteEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The name of the endpoint to delete. Please see diff --git a/Ids/src/V1/Endpoint.php b/Ids/src/V1/Endpoint.php index a59e611439d7..f6410808a084 100644 --- a/Ids/src/V1/Endpoint.php +++ b/Ids/src/V1/Endpoint.php @@ -21,19 +21,19 @@ class Endpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The create time timestamp. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The update time timestamp. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The labels of the endpoint. * @@ -46,43 +46,43 @@ class Endpoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 5 [(.google.api.field_behavior) = REQUIRED]; */ - private $network = ''; + protected $network = ''; /** * Output only. The fully qualified URL of the endpoint's ILB Forwarding Rule. * * Generated from protobuf field string endpoint_forwarding_rule = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $endpoint_forwarding_rule = ''; + protected $endpoint_forwarding_rule = ''; /** * Output only. The IP address of the IDS Endpoint's ILB. * * Generated from protobuf field string endpoint_ip = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $endpoint_ip = ''; + protected $endpoint_ip = ''; /** * User-provided description of the endpoint * * Generated from protobuf field string description = 8; */ - private $description = ''; + protected $description = ''; /** * Required. Lowest threat severity that this endpoint will alert on. * * Generated from protobuf field .google.cloud.ids.v1.Endpoint.Severity severity = 9 [(.google.api.field_behavior) = REQUIRED]; */ - private $severity = 0; + protected $severity = 0; /** * Output only. Current state of the endpoint. * * Generated from protobuf field .google.cloud.ids.v1.Endpoint.State state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Whether the endpoint should report traffic logs in addition to threat logs. * * Generated from protobuf field bool traffic_logs = 13; */ - private $traffic_logs = false; + protected $traffic_logs = false; /** * Constructor. diff --git a/Ids/src/V1/Gapic/IDSGapicClient.php b/Ids/src/V1/Gapic/IDSGapicClient.php deleted file mode 100644 index be0801d4cd0d..000000000000 --- a/Ids/src/V1/Gapic/IDSGapicClient.php +++ /dev/null @@ -1,701 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $endpointId = 'endpoint_id'; - * $endpoint = new Endpoint(); - * $operationResponse = $iDSClient->createEndpoint($formattedParent, $endpointId, $endpoint); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $iDSClient->createEndpoint($formattedParent, $endpointId, $endpoint); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $iDSClient->resumeOperation($operationName, 'createEndpoint'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $iDSClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Ids\V1\Client\IDSClient}. - */ -class IDSGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.ids.v1.IDS'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'ids.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'ids.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $endpointNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/ids_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/ids_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/ids_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . '/../resources/ids_rest_client_config.php', - ], - ], - ]; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ); - } - - return self::$endpointNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'endpoint' => self::getEndpointNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName($project, $location, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - endpoint: projects/{project}/locations/{location}/endpoints/{endpoint} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'ids.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a new Endpoint in a given project and location. - * - * Sample code: - * ``` - * $iDSClient = new IDSClient(); - * try { - * $formattedParent = $iDSClient->locationName('[PROJECT]', '[LOCATION]'); - * $endpointId = 'endpoint_id'; - * $endpoint = new Endpoint(); - * $operationResponse = $iDSClient->createEndpoint($formattedParent, $endpointId, $endpoint); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $iDSClient->createEndpoint($formattedParent, $endpointId, $endpoint); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $iDSClient->resumeOperation($operationName, 'createEndpoint'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $iDSClient->close(); - * } - * ``` - * - * @param string $parent Required. The endpoint's parent. - * @param string $endpointId Required. The endpoint identifier. This will be part of the endpoint's - * resource name. - * This value must start with a lowercase letter followed by up to 62 - * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. - * Values that do not match this pattern will trigger an INVALID_ARGUMENT - * error. - * @param Endpoint $endpoint Required. The endpoint to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * An optional request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createEndpoint( - $parent, - $endpointId, - $endpoint, - array $optionalArgs = [] - ) { - $request = new CreateEndpointRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEndpointId($endpointId); - $request->setEndpoint($endpoint); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateEndpoint', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Endpoint. - * - * Sample code: - * ``` - * $iDSClient = new IDSClient(); - * try { - * $formattedName = $iDSClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $operationResponse = $iDSClient->deleteEndpoint($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $iDSClient->deleteEndpoint($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $iDSClient->resumeOperation($operationName, 'deleteEndpoint'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $iDSClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the endpoint to delete. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * An optional request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteEndpoint($name, array $optionalArgs = []) - { - $request = new DeleteEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteEndpoint', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets details of a single Endpoint. - * - * Sample code: - * ``` - * $iDSClient = new IDSClient(); - * try { - * $formattedName = $iDSClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - * $response = $iDSClient->getEndpoint($formattedName); - * } finally { - * $iDSClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the endpoint to retrieve. - * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Ids\V1\Endpoint - * - * @throws ApiException if the remote call fails - */ - public function getEndpoint($name, array $optionalArgs = []) - { - $request = new GetEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetEndpoint', - Endpoint::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists Endpoints in a given project and location. - * - * Sample code: - * ``` - * $iDSClient = new IDSClient(); - * try { - * $formattedParent = $iDSClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $iDSClient->listEndpoints($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $iDSClient->listEndpoints($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $iDSClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of endpoints. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter expression, following the syntax outlined in - * https://google.aip.dev/160. - * @type string $orderBy - * Optional. One or more fields to compare and use to sort the output. - * See https://google.aip.dev/132#ordering. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEndpoints($parent, array $optionalArgs = []) - { - $request = new ListEndpointsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListEndpoints', - $optionalArgs, - ListEndpointsResponse::class, - $request - ); - } -} diff --git a/Ids/src/V1/GetEndpointRequest.php b/Ids/src/V1/GetEndpointRequest.php index 95095044e893..adf2a00628ad 100644 --- a/Ids/src/V1/GetEndpointRequest.php +++ b/Ids/src/V1/GetEndpointRequest.php @@ -19,7 +19,7 @@ class GetEndpointRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the endpoint to retrieve. diff --git a/Ids/src/V1/IDSClient.php b/Ids/src/V1/IDSClient.php deleted file mode 100644 index ee498ea47b60..000000000000 --- a/Ids/src/V1/IDSClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.ids.v1.IDS/ListEndpoints', - $argument, - ['\Google\Cloud\Ids\V1\ListEndpointsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Endpoint. - * @param \Google\Cloud\Ids\V1\GetEndpointRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetEndpoint(\Google\Cloud\Ids\V1\GetEndpointRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.ids.v1.IDS/GetEndpoint', - $argument, - ['\Google\Cloud\Ids\V1\Endpoint', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Endpoint in a given project and location. - * @param \Google\Cloud\Ids\V1\CreateEndpointRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateEndpoint(\Google\Cloud\Ids\V1\CreateEndpointRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.ids.v1.IDS/CreateEndpoint', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Endpoint. - * @param \Google\Cloud\Ids\V1\DeleteEndpointRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteEndpoint(\Google\Cloud\Ids\V1\DeleteEndpointRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.ids.v1.IDS/DeleteEndpoint', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/Ids/src/V1/ListEndpointsRequest.php b/Ids/src/V1/ListEndpointsRequest.php index 577524d5a60e..e566c2aff1b6 100644 --- a/Ids/src/V1/ListEndpointsRequest.php +++ b/Ids/src/V1/ListEndpointsRequest.php @@ -18,14 +18,14 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of endpoints to return. The service may return fewer * than this value. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A page token, received from a previous `ListEndpoints` call. * Provide this to retrieve the subsequent page. @@ -34,21 +34,21 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter expression, following the syntax outlined in * https://google.aip.dev/160. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. One or more fields to compare and use to sort the output. * See https://google.aip.dev/132#ordering. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of endpoints. Please see diff --git a/Ids/src/V1/ListEndpointsResponse.php b/Ids/src/V1/ListEndpointsResponse.php index 00a81ac7b9b1..c24d54eeef07 100644 --- a/Ids/src/V1/ListEndpointsResponse.php +++ b/Ids/src/V1/ListEndpointsResponse.php @@ -25,7 +25,7 @@ class ListEndpointsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Ids/src/V1/OperationMetadata.php b/Ids/src/V1/OperationMetadata.php index 4ff2fe963e04..50e0d626665f 100644 --- a/Ids/src/V1/OperationMetadata.php +++ b/Ids/src/V1/OperationMetadata.php @@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $status_message = ''; + protected $status_message = ''; /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -53,13 +53,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Constructor. diff --git a/Ids/tests/Unit/V1/Client/IDSClientTest.php b/Ids/tests/Unit/V1/Client/IDSClientTest.php index 15d1d4cd2a76..f050a03d8c0b 100644 --- a/Ids/tests/Unit/V1/Client/IDSClientTest.php +++ b/Ids/tests/Unit/V1/Client/IDSClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return IDSClient */ @@ -182,12 +184,15 @@ public function createEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -254,8 +259,7 @@ public function deleteEndpointTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new DeleteEndpointRequest()) - ->setName($formattedName); + $request = (new DeleteEndpointRequest())->setName($formattedName); $response = $gapicClient->deleteEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -311,17 +315,19 @@ public function deleteEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new DeleteEndpointRequest()) - ->setName($formattedName); + $request = (new DeleteEndpointRequest())->setName($formattedName); $response = $gapicClient->deleteEndpoint($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -369,8 +375,7 @@ public function getEndpointTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new GetEndpointRequest()) - ->setName($formattedName); + $request = (new GetEndpointRequest())->setName($formattedName); $response = $gapicClient->getEndpoint($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -394,17 +399,19 @@ public function getEndpointExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $request = (new GetEndpointRequest()) - ->setName($formattedName); + $request = (new GetEndpointRequest())->setName($formattedName); try { $gapicClient->getEndpoint($request); // If the $gapicClient method call did not throw, fail the test @@ -429,17 +436,14 @@ public function listEndpointsTest() // Mock response $nextPageToken = ''; $endpointsElement = new Endpoint(); - $endpoints = [ - $endpointsElement, - ]; + $endpoints = [$endpointsElement]; $expectedResponse = new ListEndpointsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setEndpoints($endpoints); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEndpointsRequest()) - ->setParent($formattedParent); + $request = (new ListEndpointsRequest())->setParent($formattedParent); $response = $gapicClient->listEndpoints($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -466,17 +470,19 @@ public function listEndpointsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEndpointsRequest()) - ->setParent($formattedParent); + $request = (new ListEndpointsRequest())->setParent($formattedParent); try { $gapicClient->listEndpoints($request); // If the $gapicClient method call did not throw, fail the test diff --git a/Ids/tests/Unit/V1/IDSClientTest.php b/Ids/tests/Unit/V1/IDSClientTest.php deleted file mode 100644 index afb770d2c5dd..000000000000 --- a/Ids/tests/Unit/V1/IDSClientTest.php +++ /dev/null @@ -1,468 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return IDSClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new IDSClient($options); - } - - /** @test */ - public function createEndpointTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointForwardingRule = 'endpointForwardingRule-1878786988'; - $endpointIp = 'endpointIp-1135808495'; - $description = 'description-1724546052'; - $trafficLogs = false; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointForwardingRule($endpointForwardingRule); - $expectedResponse->setEndpointIp($endpointIp); - $expectedResponse->setDescription($description); - $expectedResponse->setTrafficLogs($trafficLogs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createEndpointTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $endpointId = 'endpointId-1135808507'; - $endpoint = new Endpoint(); - $endpointNetwork = 'endpointNetwork1670861529'; - $endpoint->setNetwork($endpointNetwork); - $endpointSeverity = Severity::SEVERITY_UNSPECIFIED; - $endpoint->setSeverity($endpointSeverity); - $response = $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.ids.v1.IDS/CreateEndpoint', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getEndpointId(); - $this->assertProtobufEquals($endpointId, $actualValue); - $actualValue = $actualApiRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEndpointTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEndpointExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $endpointId = 'endpointId-1135808507'; - $endpoint = new Endpoint(); - $endpointNetwork = 'endpointNetwork1670861529'; - $endpoint->setNetwork($endpointNetwork); - $endpointSeverity = Severity::SEVERITY_UNSPECIFIED; - $endpoint->setSeverity($endpointSeverity); - $response = $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEndpointTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEndpointTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteEndpointTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $response = $gapicClient->deleteEndpoint($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.ids.v1.IDS/DeleteEndpoint', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEndpointTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEndpointExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEndpointTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $response = $gapicClient->deleteEndpoint($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEndpointTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $network = 'network1843485230'; - $endpointForwardingRule = 'endpointForwardingRule-1878786988'; - $endpointIp = 'endpointIp-1135808495'; - $description = 'description-1724546052'; - $trafficLogs = false; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name2); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointForwardingRule($endpointForwardingRule); - $expectedResponse->setEndpointIp($endpointIp); - $expectedResponse->setDescription($description); - $expectedResponse->setTrafficLogs($trafficLogs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - $response = $gapicClient->getEndpoint($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.ids.v1.IDS/GetEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[ENDPOINT]'); - try { - $gapicClient->getEndpoint($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $endpointsElement = new Endpoint(); - $endpoints = [ - $endpointsElement, - ]; - $expectedResponse = new ListEndpointsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEndpoints($endpoints); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listEndpoints($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEndpoints()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.ids.v1.IDS/ListEndpoints', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listEndpoints($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Iot/.repo-metadata.json b/Iot/.repo-metadata.json deleted file mode 100644 index 5d3d622631bf..000000000000 --- a/Iot/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-iot", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-iot/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudiot" -} diff --git a/Iot/VERSION b/Iot/VERSION index 661e7aeadf36..6a126f402d53 100644 --- a/Iot/VERSION +++ b/Iot/VERSION @@ -1 +1 @@ -1.7.3 +1.7.5 diff --git a/Iot/composer.json b/Iot/composer.json index d383af3df797..4e82bbfa0d20 100644 --- a/Iot/composer.json +++ b/Iot/composer.json @@ -20,7 +20,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Kms/.repo-metadata.json b/Kms/.repo-metadata.json deleted file mode 100644 index e71c5438fc6b..000000000000 --- a/Kms/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-kms", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-kms/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudkms" -} diff --git a/Kms/VERSION b/Kms/VERSION index bae5c7f667c9..6245beecd39c 100644 --- a/Kms/VERSION +++ b/Kms/VERSION @@ -1 +1 @@ -1.21.3 +1.22.1 diff --git a/Kms/composer.json b/Kms/composer.json index c7cd4d1ddd6a..31b4eabc242c 100644 --- a/Kms/composer.json +++ b/Kms/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Kms/metadata/V1/Autokey.php b/Kms/metadata/V1/Autokey.php new file mode 100644 index 000000000000..70d2bde78227 --- /dev/null +++ b/Kms/metadata/V1/Autokey.php @@ -0,0 +1,61 @@ +internalAddGeneratedFile( + ' +— +!google/cloud/kms/v1/autokey.protogoogle.cloud.kms.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.proto"¨ +CreateKeyHandleRequest9 +parent ( B)àAúA# +!locations.googleapis.com/Location + key_handle_id ( BàA7 + +key_handle ( 2.google.cloud.kms.v1.KeyHandleBàA"N +GetKeyHandleRequest7 +name ( B)àAúA# +!cloudkms.googleapis.com/KeyHandle"ÿ + KeyHandle +name ( BàA: +kms_key ( B)àAúA# +!cloudkms.googleapis.com/CryptoKey# +resource_type_selector ( BàA:~êA{ +!cloudkms.googleapis.com/KeyHandle?projects/{project}/locations/{location}/keyHandles/{key_handle}* +keyHandles2 keyHandle" +CreateKeyHandleMetadata"g +ListKeyHandlesRequest9 +parent ( B)àAúA# +!locations.googleapis.com/Location +filter ( BàA"M +ListKeyHandlesResponse3 + key_handles ( 2.google.cloud.kms.v1.KeyHandle2´ +Autokeyë +CreateKeyHandle+.google.cloud.kms.v1.CreateKeyHandleRequest.google.longrunning.Operation"‹ÊA$ + KeyHandleCreateKeyHandleMetadataÚAparent,key_handle,key_handle_id‚Óä“<"./v1/{parent=projects/*/locations/*}/keyHandles: +key_handle— + GetKeyHandle(.google.cloud.kms.v1.GetKeyHandleRequest.google.cloud.kms.v1.KeyHandle"=ÚAname‚Óä“0./v1/{name=projects/*/locations/*/keyHandles/*}ª +ListKeyHandles*.google.cloud.kms.v1.ListKeyHandlesRequest+.google.cloud.kms.v1.ListKeyHandlesResponse"?ÚAparent‚Óä“0./v1/{parent=projects/*/locations/*}/keyHandlestÊAcloudkms.googleapis.comÒAWhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsBT +com.google.cloud.kms.v1B AutokeyProtoPZ)cloud.google.com/go/kms/apiv1/kmspb;kmspbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/Kms/metadata/V1/AutokeyAdmin.php b/Kms/metadata/V1/AutokeyAdmin.php new file mode 100644 index 000000000000..99612e46685c --- /dev/null +++ b/Kms/metadata/V1/AutokeyAdmin.php @@ -0,0 +1,51 @@ +internalAddGeneratedFile( + ' +  +\'google/cloud/kms/v1/autokey_admin.protogoogle.cloud.kms.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto google/protobuf/field_mask.proto"“ +UpdateAutokeyConfigRequest? +autokey_config ( 2".google.cloud.kms.v1.AutokeyConfigBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"V +GetAutokeyConfigRequest; +name ( B-àAúA\' +%cloudkms.googleapis.com/AutokeyConfig"§ + AutokeyConfig +name ( BàA + key_project ( BàA:iêAf +%cloudkms.googleapis.com/AutokeyConfigfolders/{folder}/autokeyConfig*autokeyConfigs2 autokeyConfig"h +!ShowEffectiveAutokeyConfigRequestC +parent ( B3àAúA- ++cloudresourcemanager.googleapis.com/Project"9 +"ShowEffectiveAutokeyConfigResponse + key_project ( 2È + AutokeyAdminÒ +UpdateAutokeyConfig/.google.cloud.kms.v1.UpdateAutokeyConfigRequest".google.cloud.kms.v1.AutokeyConfig"fÚAautokey_config,update_mask‚Óä“C21/v1/{autokey_config.name=folders/*/autokeyConfig}:autokey_config— +GetAutokeyConfig,.google.cloud.kms.v1.GetAutokeyConfigRequest".google.cloud.kms.v1.AutokeyConfig"1ÚAname‚Óä“$"/v1/{name=folders/*/autokeyConfig}Ò +ShowEffectiveAutokeyConfig6.google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest7.google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse"CÚAparent‚Óä“42/v1/{parent=projects/*}:showEffectiveAutokeyConfigtÊAcloudkms.googleapis.comÒAWhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsBY +com.google.cloud.kms.v1BAutokeyAdminProtoPZ)cloud.google.com/go/kms/apiv1/kmspb;kmspbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/Kms/metadata/V1/Resources.php b/Kms/metadata/V1/Resources.php index fdbabdcdf43d792b9ef2a0ad3195e5a15d6daf5b..01f5d9d435973231a76015aea145ad10d90600c1 100644 GIT binary patch delta 61 zcmeA%UueGJ8xzZY11{x>-pZS0nN!)B8ihBvaJ4ftKHAK~7sV_h%*F5O93SlI?icUs RVq|J+XepqvIaN@d3jj;95eNVP delta 40 wcmZ2z-ebPu8xzYZ11{x>-pZS0nN!)B-Uw}O;c91QJiD2PFN%3{wV)ao03SyT-v9sr diff --git a/Kms/samples/V1/AutokeyAdminClient/get_autokey_config.php b/Kms/samples/V1/AutokeyAdminClient/get_autokey_config.php new file mode 100644 index 000000000000..89599d61f7aa --- /dev/null +++ b/Kms/samples/V1/AutokeyAdminClient/get_autokey_config.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AutokeyConfig $response */ + $response = $autokeyAdminClient->getAutokeyConfig($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 = AutokeyAdminClient::autokeyConfigName('[FOLDER]'); + + get_autokey_config_sample($formattedName); +} +// [END cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync] diff --git a/Kms/samples/V1/AutokeyAdminClient/get_iam_policy.php b/Kms/samples/V1/AutokeyAdminClient/get_iam_policy.php new file mode 100644 index 000000000000..21fc073d8358 --- /dev/null +++ b/Kms/samples/V1/AutokeyAdminClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $autokeyAdminClient->getIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudkms_v1_generated_AutokeyAdmin_GetIamPolicy_sync] diff --git a/Kms/samples/V1/AutokeyAdminClient/get_location.php b/Kms/samples/V1/AutokeyAdminClient/get_location.php new file mode 100644 index 000000000000..6cb25c532205 --- /dev/null +++ b/Kms/samples/V1/AutokeyAdminClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_AutokeyAdmin_GetLocation_sync] diff --git a/Kms/samples/V1/AutokeyAdminClient/list_locations.php b/Kms/samples/V1/AutokeyAdminClient/list_locations.php new file mode 100644 index 000000000000..b8af0822b0d7 --- /dev/null +++ b/Kms/samples/V1/AutokeyAdminClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_AutokeyAdmin_ListLocations_sync] diff --git a/Kms/samples/V1/AutokeyAdminClient/set_iam_policy.php b/Kms/samples/V1/AutokeyAdminClient/set_iam_policy.php new file mode 100644 index 000000000000..1202ce1f6065 --- /dev/null +++ b/Kms/samples/V1/AutokeyAdminClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $autokeyAdminClient->setIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudkms_v1_generated_AutokeyAdmin_SetIamPolicy_sync] diff --git a/Kms/samples/V1/AutokeyAdminClient/show_effective_autokey_config.php b/Kms/samples/V1/AutokeyAdminClient/show_effective_autokey_config.php new file mode 100644 index 000000000000..5beefc9c0980 --- /dev/null +++ b/Kms/samples/V1/AutokeyAdminClient/show_effective_autokey_config.php @@ -0,0 +1,73 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ShowEffectiveAutokeyConfigResponse $response */ + $response = $autokeyAdminClient->showEffectiveAutokeyConfig($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 +{ + $formattedParent = AutokeyAdminClient::projectName('[PROJECT]'); + + show_effective_autokey_config_sample($formattedParent); +} +// [END cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_sync] diff --git a/Kms/samples/V1/AutokeyAdminClient/test_iam_permissions.php b/Kms/samples/V1/AutokeyAdminClient/test_iam_permissions.php new file mode 100644 index 000000000000..7e4fe649a041 --- /dev/null +++ b/Kms/samples/V1/AutokeyAdminClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $autokeyAdminClient->testIamPermissions($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 +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudkms_v1_generated_AutokeyAdmin_TestIamPermissions_sync] diff --git a/Kms/samples/V1/AutokeyAdminClient/update_autokey_config.php b/Kms/samples/V1/AutokeyAdminClient/update_autokey_config.php new file mode 100644 index 000000000000..1eef8f2ebffd --- /dev/null +++ b/Kms/samples/V1/AutokeyAdminClient/update_autokey_config.php @@ -0,0 +1,68 @@ +setAutokeyConfig($autokeyConfig) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var AutokeyConfig $response */ + $response = $autokeyAdminClient->updateAutokeyConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_AutokeyAdmin_UpdateAutokeyConfig_sync] diff --git a/Kms/samples/V1/AutokeyClient/create_key_handle.php b/Kms/samples/V1/AutokeyClient/create_key_handle.php new file mode 100644 index 000000000000..f38155b3ecff --- /dev/null +++ b/Kms/samples/V1/AutokeyClient/create_key_handle.php @@ -0,0 +1,101 @@ +setResourceTypeSelector($keyHandleResourceTypeSelector); + $request = (new CreateKeyHandleRequest()) + ->setParent($formattedParent) + ->setKeyHandle($keyHandle); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autokeyClient->createKeyHandle($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var KeyHandle $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = AutokeyClient::locationName('[PROJECT]', '[LOCATION]'); + $keyHandleResourceTypeSelector = '[RESOURCE_TYPE_SELECTOR]'; + + create_key_handle_sample($formattedParent, $keyHandleResourceTypeSelector); +} +// [END cloudkms_v1_generated_Autokey_CreateKeyHandle_sync] diff --git a/Kms/samples/V1/AutokeyClient/get_iam_policy.php b/Kms/samples/V1/AutokeyClient/get_iam_policy.php new file mode 100644 index 000000000000..d642ccb079f2 --- /dev/null +++ b/Kms/samples/V1/AutokeyClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $autokeyClient->getIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudkms_v1_generated_Autokey_GetIamPolicy_sync] diff --git a/Kms/samples/V1/AutokeyClient/get_key_handle.php b/Kms/samples/V1/AutokeyClient/get_key_handle.php new file mode 100644 index 000000000000..e4e840e7cab7 --- /dev/null +++ b/Kms/samples/V1/AutokeyClient/get_key_handle.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var KeyHandle $response */ + $response = $autokeyClient->getKeyHandle($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 = AutokeyClient::keyHandleName('[PROJECT]', '[LOCATION]', '[KEY_HANDLE]'); + + get_key_handle_sample($formattedName); +} +// [END cloudkms_v1_generated_Autokey_GetKeyHandle_sync] diff --git a/Kms/samples/V1/AutokeyClient/get_location.php b/Kms/samples/V1/AutokeyClient/get_location.php new file mode 100644 index 000000000000..f38158f6bad1 --- /dev/null +++ b/Kms/samples/V1/AutokeyClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_Autokey_GetLocation_sync] diff --git a/Kms/samples/V1/AutokeyClient/list_key_handles.php b/Kms/samples/V1/AutokeyClient/list_key_handles.php new file mode 100644 index 000000000000..fc36755063d5 --- /dev/null +++ b/Kms/samples/V1/AutokeyClient/list_key_handles.php @@ -0,0 +1,73 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ListKeyHandlesResponse $response */ + $response = $autokeyClient->listKeyHandles($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 +{ + $formattedParent = AutokeyClient::locationName('[PROJECT]', '[LOCATION]'); + + list_key_handles_sample($formattedParent); +} +// [END cloudkms_v1_generated_Autokey_ListKeyHandles_sync] diff --git a/Kms/samples/V1/AutokeyClient/list_locations.php b/Kms/samples/V1/AutokeyClient/list_locations.php new file mode 100644 index 000000000000..f717fabf6b9a --- /dev/null +++ b/Kms/samples/V1/AutokeyClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_Autokey_ListLocations_sync] diff --git a/Kms/samples/V1/AutokeyClient/set_iam_policy.php b/Kms/samples/V1/AutokeyClient/set_iam_policy.php new file mode 100644 index 000000000000..db0f0ad6046c --- /dev/null +++ b/Kms/samples/V1/AutokeyClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $autokeyClient->setIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudkms_v1_generated_Autokey_SetIamPolicy_sync] diff --git a/Kms/samples/V1/AutokeyClient/test_iam_permissions.php b/Kms/samples/V1/AutokeyClient/test_iam_permissions.php new file mode 100644 index 000000000000..e3588e89639f --- /dev/null +++ b/Kms/samples/V1/AutokeyClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $autokeyClient->testIamPermissions($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 +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudkms_v1_generated_Autokey_TestIamPermissions_sync] diff --git a/Kms/src/V1/AutokeyAdminClient.php b/Kms/src/V1/AutokeyAdminClient.php new file mode 100644 index 000000000000..318ad3e258a8 --- /dev/null +++ b/Kms/src/V1/AutokeyAdminClient.php @@ -0,0 +1,34 @@ +google.cloud.kms.v1.AutokeyConfig + */ +class AutokeyConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + private $name = ''; + /** + * Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or + * `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new + * [CryptoKey][google.cloud.kms.v1.CryptoKey] when a + * [KeyHandle][google.cloud.kms.v1.KeyHandle] is created. On + * [UpdateAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig], + * the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on + * this key project. Once configured, for Cloud KMS Autokey to function + * properly, this key project must have the Cloud KMS API activated and the + * Cloud KMS Service Agent for this key project must be granted the + * `cloudkms.admin` role (or pertinent permissions). A request with an empty + * key project field will clear the configuration. + * + * Generated from protobuf field string key_project = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $key_project = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * @type string $key_project + * Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or + * `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new + * [CryptoKey][google.cloud.kms.v1.CryptoKey] when a + * [KeyHandle][google.cloud.kms.v1.KeyHandle] is created. On + * [UpdateAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig], + * the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on + * this key project. Once configured, for Cloud KMS Autokey to function + * properly, this key project must have the Cloud KMS API activated and the + * Cloud KMS Service Agent for this key project must be granted the + * `cloudkms.admin` role (or pertinent permissions). A request with an empty + * key project field will clear the configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\AutokeyAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or + * `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new + * [CryptoKey][google.cloud.kms.v1.CryptoKey] when a + * [KeyHandle][google.cloud.kms.v1.KeyHandle] is created. On + * [UpdateAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig], + * the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on + * this key project. Once configured, for Cloud KMS Autokey to function + * properly, this key project must have the Cloud KMS API activated and the + * Cloud KMS Service Agent for this key project must be granted the + * `cloudkms.admin` role (or pertinent permissions). A request with an empty + * key project field will clear the configuration. + * + * Generated from protobuf field string key_project = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKeyProject() + { + return $this->key_project; + } + + /** + * Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or + * `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new + * [CryptoKey][google.cloud.kms.v1.CryptoKey] when a + * [KeyHandle][google.cloud.kms.v1.KeyHandle] is created. On + * [UpdateAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig], + * the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on + * this key project. Once configured, for Cloud KMS Autokey to function + * properly, this key project must have the Cloud KMS API activated and the + * Cloud KMS Service Agent for this key project must be granted the + * `cloudkms.admin` role (or pertinent permissions). A request with an empty + * key project field will clear the configuration. + * + * Generated from protobuf field string key_project = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKeyProject($var) + { + GPBUtil::checkString($var, True); + $this->key_project = $var; + + return $this; + } + +} + diff --git a/Kms/src/V1/Client/AutokeyAdminClient.php b/Kms/src/V1/Client/AutokeyAdminClient.php new file mode 100644 index 000000000000..cc576d9390a6 --- /dev/null +++ b/Kms/src/V1/Client/AutokeyAdminClient.php @@ -0,0 +1,478 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/autokey_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/autokey_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/autokey_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/autokey_admin_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * autokey_config resource. + * + * @param string $folder + * + * @return string The formatted autokey_config resource. + */ + public static function autokeyConfigName(string $folder): string + { + return self::getPathTemplate('autokeyConfig')->render([ + 'folder' => $folder, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - autokeyConfig: folders/{folder}/autokeyConfig + * - project: projects/{project} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudkms.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + * folder. + * + * The async variant is {@see AutokeyAdminClient::getAutokeyConfigAsync()} . + * + * @example samples/V1/AutokeyAdminClient/get_autokey_config.php + * + * @param GetAutokeyConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AutokeyConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAutokeyConfig(GetAutokeyConfigRequest $request, array $callOptions = []): AutokeyConfig + { + return $this->startApiCall('GetAutokeyConfig', $request, $callOptions)->wait(); + } + + /** + * Returns the effective Cloud KMS Autokey configuration for a given project. + * + * The async variant is + * {@see AutokeyAdminClient::showEffectiveAutokeyConfigAsync()} . + * + * @example samples/V1/AutokeyAdminClient/show_effective_autokey_config.php + * + * @param ShowEffectiveAutokeyConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ShowEffectiveAutokeyConfigResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function showEffectiveAutokeyConfig(ShowEffectiveAutokeyConfigRequest $request, array $callOptions = []): ShowEffectiveAutokeyConfigResponse + { + return $this->startApiCall('ShowEffectiveAutokeyConfig', $request, $callOptions)->wait(); + } + + /** + * Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + * folder. The caller must have both `cloudkms.autokeyConfigs.update` + * permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` + * permission on the provided key project. A + * [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's + * descendant projects will use this configuration to determine where to + * create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * The async variant is {@see AutokeyAdminClient::updateAutokeyConfigAsync()} . + * + * @example samples/V1/AutokeyAdminClient/update_autokey_config.php + * + * @param UpdateAutokeyConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AutokeyConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAutokeyConfig(UpdateAutokeyConfigRequest $request, array $callOptions = []): AutokeyConfig + { + return $this->startApiCall('UpdateAutokeyConfig', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AutokeyAdminClient::getLocationAsync()} . + * + * @example samples/V1/AutokeyAdminClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AutokeyAdminClient::listLocationsAsync()} . + * + * @example samples/V1/AutokeyAdminClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see AutokeyAdminClient::getIamPolicyAsync()} . + * + * @example samples/V1/AutokeyAdminClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see AutokeyAdminClient::setIamPolicyAsync()} . + * + * @example samples/V1/AutokeyAdminClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see AutokeyAdminClient::testIamPermissionsAsync()} . + * + * @example samples/V1/AutokeyAdminClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/Kms/src/V1/Client/AutokeyClient.php b/Kms/src/V1/Client/AutokeyClient.php new file mode 100644 index 000000000000..e9d5ec223a2f --- /dev/null +++ b/Kms/src/V1/Client/AutokeyClient.php @@ -0,0 +1,549 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/autokey_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/autokey_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/autokey_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/autokey_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a key_handle + * resource. + * + * @param string $project + * @param string $location + * @param string $keyHandle + * + * @return string The formatted key_handle resource. + */ + public static function keyHandleName(string $project, string $location, string $keyHandle): string + { + return self::getPathTemplate('keyHandle')->render([ + 'project' => $project, + 'location' => $location, + 'key_handle' => $keyHandle, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - keyHandle: projects/{project}/locations/{location}/keyHandles/{key_handle} + * - location: projects/{project}/locations/{location} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudkms.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the + * provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK + * use with the given resource type in the configured key project and the same + * location. [GetOperation][Operations.GetOperation] should be used to resolve + * the resulting long-running operation and get the resulting + * [KeyHandle][google.cloud.kms.v1.KeyHandle] and + * [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * The async variant is {@see AutokeyClient::createKeyHandleAsync()} . + * + * @example samples/V1/AutokeyClient/create_key_handle.php + * + * @param CreateKeyHandleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createKeyHandle(CreateKeyHandleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateKeyHandle', $request, $callOptions)->wait(); + } + + /** + * Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. + * + * The async variant is {@see AutokeyClient::getKeyHandleAsync()} . + * + * @example samples/V1/AutokeyClient/get_key_handle.php + * + * @param GetKeyHandleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KeyHandle + * + * @throws ApiException Thrown if the API call fails. + */ + public function getKeyHandle(GetKeyHandleRequest $request, array $callOptions = []): KeyHandle + { + return $this->startApiCall('GetKeyHandle', $request, $callOptions)->wait(); + } + + /** + * Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. + * + * The async variant is {@see AutokeyClient::listKeyHandlesAsync()} . + * + * @example samples/V1/AutokeyClient/list_key_handles.php + * + * @param ListKeyHandlesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListKeyHandlesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listKeyHandles(ListKeyHandlesRequest $request, array $callOptions = []): ListKeyHandlesResponse + { + return $this->startApiCall('ListKeyHandles', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AutokeyClient::getLocationAsync()} . + * + * @example samples/V1/AutokeyClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AutokeyClient::listLocationsAsync()} . + * + * @example samples/V1/AutokeyClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see AutokeyClient::getIamPolicyAsync()} . + * + * @example samples/V1/AutokeyClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see AutokeyClient::setIamPolicyAsync()} . + * + * @example samples/V1/AutokeyClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see AutokeyClient::testIamPermissionsAsync()} . + * + * @example samples/V1/AutokeyClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/Kms/src/V1/CreateKeyHandleMetadata.php b/Kms/src/V1/CreateKeyHandleMetadata.php new file mode 100644 index 000000000000..c55a5d085cd8 --- /dev/null +++ b/Kms/src/V1/CreateKeyHandleMetadata.php @@ -0,0 +1,35 @@ +google.cloud.kms.v1.CreateKeyHandleMetadata + */ +class CreateKeyHandleMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Autokey::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Kms/src/V1/CreateKeyHandleRequest.php b/Kms/src/V1/CreateKeyHandleRequest.php new file mode 100644 index 000000000000..053bea1af6c9 --- /dev/null +++ b/Kms/src/V1/CreateKeyHandleRequest.php @@ -0,0 +1,184 @@ +google.cloud.kms.v1.CreateKeyHandleRequest + */ +class CreateKeyHandleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource project and location to create the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] in, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Optional. Id of the [KeyHandle][google.cloud.kms.v1.KeyHandle]. Must be + * unique to the resource project and location. If not provided by the caller, + * a new UUID is used. + * + * Generated from protobuf field string key_handle_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $key_handle_id = ''; + /** + * Required. [KeyHandle][google.cloud.kms.v1.KeyHandle] to create. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyHandle key_handle = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $key_handle = null; + + /** + * @param string $parent Required. Name of the resource project and location to create the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] in, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. Please see + * {@see AutokeyClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Kms\V1\KeyHandle $keyHandle Required. [KeyHandle][google.cloud.kms.v1.KeyHandle] to create. + * @param string $keyHandleId Optional. Id of the [KeyHandle][google.cloud.kms.v1.KeyHandle]. Must be + * unique to the resource project and location. If not provided by the caller, + * a new UUID is used. + * + * @return \Google\Cloud\Kms\V1\CreateKeyHandleRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Kms\V1\KeyHandle $keyHandle, string $keyHandleId): self + { + return (new self()) + ->setParent($parent) + ->setKeyHandle($keyHandle) + ->setKeyHandleId($keyHandleId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the resource project and location to create the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] in, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * @type string $key_handle_id + * Optional. Id of the [KeyHandle][google.cloud.kms.v1.KeyHandle]. Must be + * unique to the resource project and location. If not provided by the caller, + * a new UUID is used. + * @type \Google\Cloud\Kms\V1\KeyHandle $key_handle + * Required. [KeyHandle][google.cloud.kms.v1.KeyHandle] to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Autokey::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource project and location to create the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] in, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of the resource project and location to create the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] in, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Id of the [KeyHandle][google.cloud.kms.v1.KeyHandle]. Must be + * unique to the resource project and location. If not provided by the caller, + * a new UUID is used. + * + * Generated from protobuf field string key_handle_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKeyHandleId() + { + return $this->key_handle_id; + } + + /** + * Optional. Id of the [KeyHandle][google.cloud.kms.v1.KeyHandle]. Must be + * unique to the resource project and location. If not provided by the caller, + * a new UUID is used. + * + * Generated from protobuf field string key_handle_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKeyHandleId($var) + { + GPBUtil::checkString($var, True); + $this->key_handle_id = $var; + + return $this; + } + + /** + * Required. [KeyHandle][google.cloud.kms.v1.KeyHandle] to create. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyHandle key_handle = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\KeyHandle|null + */ + public function getKeyHandle() + { + return $this->key_handle; + } + + public function hasKeyHandle() + { + return isset($this->key_handle); + } + + public function clearKeyHandle() + { + unset($this->key_handle); + } + + /** + * Required. [KeyHandle][google.cloud.kms.v1.KeyHandle] to create. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyHandle key_handle = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\KeyHandle $var + * @return $this + */ + public function setKeyHandle($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyHandle::class); + $this->key_handle = $var; + + return $this; + } + +} + diff --git a/Kms/src/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php b/Kms/src/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php index 3b16f37eba2e..4c14db985dfb 100644 --- a/Kms/src/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php +++ b/Kms/src/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php @@ -227,6 +227,12 @@ class CryptoKeyVersionAlgorithm * Generated from protobuf enum EC_SIGN_SECP256K1_SHA256 = 31; */ const EC_SIGN_SECP256K1_SHA256 = 31; + /** + * EdDSA on the Curve25519 in pure mode (taking data as input). + * + * Generated from protobuf enum EC_SIGN_ED25519 = 40; + */ + const EC_SIGN_ED25519 = 40; /** * HMAC-SHA256 signing with a 256 bit key. * @@ -294,6 +300,7 @@ class CryptoKeyVersionAlgorithm self::EC_SIGN_P256_SHA256 => 'EC_SIGN_P256_SHA256', self::EC_SIGN_P384_SHA384 => 'EC_SIGN_P384_SHA384', self::EC_SIGN_SECP256K1_SHA256 => 'EC_SIGN_SECP256K1_SHA256', + self::EC_SIGN_ED25519 => 'EC_SIGN_ED25519', self::HMAC_SHA256 => 'HMAC_SHA256', self::HMAC_SHA1 => 'HMAC_SHA1', self::HMAC_SHA384 => 'HMAC_SHA384', diff --git a/Kms/src/V1/Gapic/AutokeyAdminGapicClient.php b/Kms/src/V1/Gapic/AutokeyAdminGapicClient.php new file mode 100644 index 000000000000..b90ed3be2ddd --- /dev/null +++ b/Kms/src/V1/Gapic/AutokeyAdminGapicClient.php @@ -0,0 +1,710 @@ +autokeyConfigName('[FOLDER]'); + * $response = $autokeyAdminClient->getAutokeyConfig($formattedName); + * } finally { + * $autokeyAdminClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Kms\V1\Client\AutokeyAdminClient}. + */ +class AutokeyAdminGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.kms.v1.AutokeyAdmin'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'cloudkms.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudkms.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloudkms', + ]; + + private static $autokeyConfigNameTemplate; + + private static $projectNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/autokey_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/autokey_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/autokey_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/autokey_admin_rest_client_config.php', + ], + ], + ]; + } + + private static function getAutokeyConfigNameTemplate() + { + if (self::$autokeyConfigNameTemplate == null) { + self::$autokeyConfigNameTemplate = new PathTemplate('folders/{folder}/autokeyConfig'); + } + + return self::$autokeyConfigNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'autokeyConfig' => self::getAutokeyConfigNameTemplate(), + 'project' => self::getProjectNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * autokey_config resource. + * + * @param string $folder + * + * @return string The formatted autokey_config resource. + */ + public static function autokeyConfigName($folder) + { + return self::getAutokeyConfigNameTemplate()->render([ + 'folder' => $folder, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName($project) + { + return self::getProjectNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - autokeyConfig: folders/{folder}/autokeyConfig + * - project: projects/{project} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudkms.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + * folder. + * + * Sample code: + * ``` + * $autokeyAdminClient = new AutokeyAdminClient(); + * try { + * $formattedName = $autokeyAdminClient->autokeyConfigName('[FOLDER]'); + * $response = $autokeyAdminClient->getAutokeyConfig($formattedName); + * } finally { + * $autokeyAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\AutokeyConfig + * + * @throws ApiException if the remote call fails + */ + public function getAutokeyConfig($name, array $optionalArgs = []) + { + $request = new GetAutokeyConfigRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetAutokeyConfig', AutokeyConfig::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the effective Cloud KMS Autokey configuration for a given project. + * + * Sample code: + * ``` + * $autokeyAdminClient = new AutokeyAdminClient(); + * try { + * $formattedParent = $autokeyAdminClient->projectName('[PROJECT]'); + * $response = $autokeyAdminClient->showEffectiveAutokeyConfig($formattedParent); + * } finally { + * $autokeyAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Name of the resource project to the show effective Cloud KMS + * Autokey configuration for. This may be helpful for interrogating the effect + * of nested folder configurations on a given resource project. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\ShowEffectiveAutokeyConfigResponse + * + * @throws ApiException if the remote call fails + */ + public function showEffectiveAutokeyConfig($parent, array $optionalArgs = []) + { + $request = new ShowEffectiveAutokeyConfigRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ShowEffectiveAutokeyConfig', ShowEffectiveAutokeyConfigResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + * folder. The caller must have both `cloudkms.autokeyConfigs.update` + * permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` + * permission on the provided key project. A + * [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's + * descendant projects will use this configuration to determine where to + * create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Sample code: + * ``` + * $autokeyAdminClient = new AutokeyAdminClient(); + * try { + * $autokeyConfig = new AutokeyConfig(); + * $updateMask = new FieldMask(); + * $response = $autokeyAdminClient->updateAutokeyConfig($autokeyConfig, $updateMask); + * } finally { + * $autokeyAdminClient->close(); + * } + * ``` + * + * @param AutokeyConfig $autokeyConfig Required. [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] with values to + * update. + * @param FieldMask $updateMask Required. Masks which fields of the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] to update, e.g. + * `keyProject`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\AutokeyConfig + * + * @throws ApiException if the remote call fails + */ + public function updateAutokeyConfig($autokeyConfig, $updateMask, array $optionalArgs = []) + { + $request = new UpdateAutokeyConfigRequest(); + $requestParamHeaders = []; + $request->setAutokeyConfig($autokeyConfig); + $request->setUpdateMask($updateMask); + $requestParamHeaders['autokey_config.name'] = $autokeyConfig->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateAutokeyConfig', AutokeyConfig::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $autokeyAdminClient = new AutokeyAdminClient(); + * try { + * $response = $autokeyAdminClient->getLocation(); + * } finally { + * $autokeyAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $autokeyAdminClient = new AutokeyAdminClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $autokeyAdminClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $autokeyAdminClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $autokeyAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * Sample code: + * ``` + * $autokeyAdminClient = new AutokeyAdminClient(); + * try { + * $resource = 'resource'; + * $response = $autokeyAdminClient->getIamPolicy($resource); + * } finally { + * $autokeyAdminClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * Sample code: + * ``` + * $autokeyAdminClient = new AutokeyAdminClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $autokeyAdminClient->setIamPolicy($resource, $policy); + * } finally { + * $autokeyAdminClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * Sample code: + * ``` + * $autokeyAdminClient = new AutokeyAdminClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $autokeyAdminClient->testIamPermissions($resource, $permissions); + * } finally { + * $autokeyAdminClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } +} diff --git a/Kms/src/V1/Gapic/AutokeyGapicClient.php b/Kms/src/V1/Gapic/AutokeyGapicClient.php new file mode 100644 index 000000000000..ddd3761fd201 --- /dev/null +++ b/Kms/src/V1/Gapic/AutokeyGapicClient.php @@ -0,0 +1,861 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $keyHandle = new KeyHandle(); + * $operationResponse = $autokeyClient->createKeyHandle($formattedParent, $keyHandle); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $autokeyClient->createKeyHandle($formattedParent, $keyHandle); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $autokeyClient->resumeOperation($operationName, 'createKeyHandle'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $autokeyClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Kms\V1\Client\AutokeyClient}. + */ +class AutokeyGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.kms.v1.Autokey'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'cloudkms.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudkms.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloudkms', + ]; + + private static $cryptoKeyNameTemplate; + + private static $keyHandleNameTemplate; + + private static $locationNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/autokey_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/autokey_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/autokey_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/autokey_rest_client_config.php', + ], + ], + ]; + } + + private static function getCryptoKeyNameTemplate() + { + if (self::$cryptoKeyNameTemplate == null) { + self::$cryptoKeyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'); + } + + return self::$cryptoKeyNameTemplate; + } + + private static function getKeyHandleNameTemplate() + { + if (self::$keyHandleNameTemplate == null) { + self::$keyHandleNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyHandles/{key_handle}'); + } + + return self::$keyHandleNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'cryptoKey' => self::getCryptoKeyNameTemplate(), + 'keyHandle' => self::getKeyHandleNameTemplate(), + 'location' => self::getLocationNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName($project, $location, $keyRing, $cryptoKey) + { + return self::getCryptoKeyNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a key_handle + * resource. + * + * @param string $project + * @param string $location + * @param string $keyHandle + * + * @return string The formatted key_handle resource. + */ + public static function keyHandleName($project, $location, $keyHandle) + { + return self::getKeyHandleNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'key_handle' => $keyHandle, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - keyHandle: projects/{project}/locations/{location}/keyHandles/{key_handle} + * - location: projects/{project}/locations/{location} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudkms.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the + * provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK + * use with the given resource type in the configured key project and the same + * location. [GetOperation][Operations.GetOperation] should be used to resolve + * the resulting long-running operation and get the resulting + * [KeyHandle][google.cloud.kms.v1.KeyHandle] and + * [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Sample code: + * ``` + * $autokeyClient = new AutokeyClient(); + * try { + * $formattedParent = $autokeyClient->locationName('[PROJECT]', '[LOCATION]'); + * $keyHandle = new KeyHandle(); + * $operationResponse = $autokeyClient->createKeyHandle($formattedParent, $keyHandle); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $autokeyClient->createKeyHandle($formattedParent, $keyHandle); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $autokeyClient->resumeOperation($operationName, 'createKeyHandle'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $autokeyClient->close(); + * } + * ``` + * + * @param string $parent Required. Name of the resource project and location to create the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] in, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * @param KeyHandle $keyHandle Required. [KeyHandle][google.cloud.kms.v1.KeyHandle] to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $keyHandleId + * Optional. Id of the [KeyHandle][google.cloud.kms.v1.KeyHandle]. Must be + * unique to the resource project and location. If not provided by the caller, + * a new UUID is used. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createKeyHandle($parent, $keyHandle, array $optionalArgs = []) + { + $request = new CreateKeyHandleRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setKeyHandle($keyHandle); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['keyHandleId'])) { + $request->setKeyHandleId($optionalArgs['keyHandleId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateKeyHandle', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. + * + * Sample code: + * ``` + * $autokeyClient = new AutokeyClient(); + * try { + * $formattedName = $autokeyClient->keyHandleName('[PROJECT]', '[LOCATION]', '[KEY_HANDLE]'); + * $response = $autokeyClient->getKeyHandle($formattedName); + * } finally { + * $autokeyClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] resource, + * e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\KeyHandle + * + * @throws ApiException if the remote call fails + */ + public function getKeyHandle($name, array $optionalArgs = []) + { + $request = new GetKeyHandleRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetKeyHandle', KeyHandle::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. + * + * Sample code: + * ``` + * $autokeyClient = new AutokeyClient(); + * try { + * $formattedParent = $autokeyClient->locationName('[PROJECT]', '[LOCATION]'); + * $response = $autokeyClient->listKeyHandles($formattedParent); + * } finally { + * $autokeyClient->close(); + * } + * ``` + * + * @param string $parent Required. Name of the resource project and location from which to list + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * Optional. Filter to apply when listing + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\ListKeyHandlesResponse + * + * @throws ApiException if the remote call fails + */ + public function listKeyHandles($parent, array $optionalArgs = []) + { + $request = new ListKeyHandlesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ListKeyHandles', ListKeyHandlesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $autokeyClient = new AutokeyClient(); + * try { + * $response = $autokeyClient->getLocation(); + * } finally { + * $autokeyClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $autokeyClient = new AutokeyClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $autokeyClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $autokeyClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $autokeyClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * Sample code: + * ``` + * $autokeyClient = new AutokeyClient(); + * try { + * $resource = 'resource'; + * $response = $autokeyClient->getIamPolicy($resource); + * } finally { + * $autokeyClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * Sample code: + * ``` + * $autokeyClient = new AutokeyClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $autokeyClient->setIamPolicy($resource, $policy); + * } finally { + * $autokeyClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * Sample code: + * ``` + * $autokeyClient = new AutokeyClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $autokeyClient->testIamPermissions($resource, $permissions); + * } finally { + * $autokeyClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } +} diff --git a/Kms/src/V1/GetAutokeyConfigRequest.php b/Kms/src/V1/GetAutokeyConfigRequest.php new file mode 100644 index 000000000000..9a43e3120388 --- /dev/null +++ b/Kms/src/V1/GetAutokeyConfigRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.GetAutokeyConfigRequest + */ +class GetAutokeyConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. Please see + * {@see AutokeyAdminClient::autokeyConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\GetAutokeyConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\AutokeyAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] + * resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Kms/src/V1/GetKeyHandleRequest.php b/Kms/src/V1/GetKeyHandleRequest.php new file mode 100644 index 000000000000..43626a1b8615 --- /dev/null +++ b/Kms/src/V1/GetKeyHandleRequest.php @@ -0,0 +1,91 @@ +google.cloud.kms.v1.GetKeyHandleRequest + */ +class GetKeyHandleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] resource, + * e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] resource, + * e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. Please see + * {@see AutokeyClient::keyHandleName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\GetKeyHandleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] resource, + * e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Autokey::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] resource, + * e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] resource, + * e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Kms/src/V1/KeyHandle.php b/Kms/src/V1/KeyHandle.php new file mode 100644 index 000000000000..5f8696e8b9cb --- /dev/null +++ b/Kms/src/V1/KeyHandle.php @@ -0,0 +1,196 @@ +google.cloud.kms.v1.KeyHandle + */ +class KeyHandle extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] + * resource, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + private $name = ''; + /** + * Output only. Name of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that has + * been provisioned for Customer Managed Encryption Key (CMEK) use in the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] project and location for the + * requested resource type. The [CryptoKey][google.cloud.kms.v1.CryptoKey] + * project will reflect the value configured in the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] on the resource + * project's ancestor folder at the time of the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] creation. If more than one + * ancestor folder has a configured + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig], the nearest of these + * configurations is used. + * + * Generated from protobuf field string kms_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $kms_key = ''; + /** + * Required. Indicates the resource type that the resulting + * [CryptoKey][google.cloud.kms.v1.CryptoKey] is meant to protect, e.g. + * `{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource + * types. + * + * Generated from protobuf field string resource_type_selector = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $resource_type_selector = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] + * resource, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * @type string $kms_key + * Output only. Name of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that has + * been provisioned for Customer Managed Encryption Key (CMEK) use in the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] project and location for the + * requested resource type. The [CryptoKey][google.cloud.kms.v1.CryptoKey] + * project will reflect the value configured in the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] on the resource + * project's ancestor folder at the time of the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] creation. If more than one + * ancestor folder has a configured + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig], the nearest of these + * configurations is used. + * @type string $resource_type_selector + * Required. Indicates the resource type that the resulting + * [CryptoKey][google.cloud.kms.v1.CryptoKey] is meant to protect, e.g. + * `{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource + * types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Autokey::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] + * resource, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] + * resource, e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Name of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that has + * been provisioned for Customer Managed Encryption Key (CMEK) use in the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] project and location for the + * requested resource type. The [CryptoKey][google.cloud.kms.v1.CryptoKey] + * project will reflect the value configured in the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] on the resource + * project's ancestor folder at the time of the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] creation. If more than one + * ancestor folder has a configured + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig], the nearest of these + * configurations is used. + * + * Generated from protobuf field string kms_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getKmsKey() + { + return $this->kms_key; + } + + /** + * Output only. Name of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that has + * been provisioned for Customer Managed Encryption Key (CMEK) use in the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] project and location for the + * requested resource type. The [CryptoKey][google.cloud.kms.v1.CryptoKey] + * project will reflect the value configured in the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] on the resource + * project's ancestor folder at the time of the + * [KeyHandle][google.cloud.kms.v1.KeyHandle] creation. If more than one + * ancestor folder has a configured + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig], the nearest of these + * configurations is used. + * + * Generated from protobuf field string kms_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + + /** + * Required. Indicates the resource type that the resulting + * [CryptoKey][google.cloud.kms.v1.CryptoKey] is meant to protect, e.g. + * `{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource + * types. + * + * Generated from protobuf field string resource_type_selector = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResourceTypeSelector() + { + return $this->resource_type_selector; + } + + /** + * Required. Indicates the resource type that the resulting + * [CryptoKey][google.cloud.kms.v1.CryptoKey] is meant to protect, e.g. + * `{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource + * types. + * + * Generated from protobuf field string resource_type_selector = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResourceTypeSelector($var) + { + GPBUtil::checkString($var, True); + $this->resource_type_selector = $var; + + return $this; + } + +} + diff --git a/Kms/src/V1/ListKeyHandlesRequest.php b/Kms/src/V1/ListKeyHandlesRequest.php new file mode 100644 index 000000000000..701a60e7ca9f --- /dev/null +++ b/Kms/src/V1/ListKeyHandlesRequest.php @@ -0,0 +1,134 @@ +google.cloud.kms.v1.ListKeyHandlesRequest + */ +class ListKeyHandlesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource project and location from which to list + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Optional. Filter to apply when listing + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter = ''; + + /** + * @param string $parent Required. Name of the resource project and location from which to list + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. Please see + * {@see AutokeyClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\ListKeyHandlesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the resource project and location from which to list + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * @type string $filter + * Optional. Filter to apply when listing + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Autokey::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource project and location from which to list + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of the resource project and location from which to list + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `projects/{PROJECT_ID}/locations/{LOCATION}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Filter to apply when listing + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter to apply when listing + * [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. + * `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/Kms/src/V1/ListKeyHandlesResponse.php b/Kms/src/V1/ListKeyHandlesResponse.php new file mode 100644 index 000000000000..1739eef03634 --- /dev/null +++ b/Kms/src/V1/ListKeyHandlesResponse.php @@ -0,0 +1,68 @@ +google.cloud.kms.v1.ListKeyHandlesResponse + */ +class ListKeyHandlesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Resulting [KeyHandles][google.cloud.kms.v1.KeyHandle]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.KeyHandle key_handles = 1; + */ + private $key_handles; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Kms\V1\KeyHandle>|\Google\Protobuf\Internal\RepeatedField $key_handles + * Resulting [KeyHandles][google.cloud.kms.v1.KeyHandle]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Autokey::initOnce(); + parent::__construct($data); + } + + /** + * Resulting [KeyHandles][google.cloud.kms.v1.KeyHandle]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.KeyHandle key_handles = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKeyHandles() + { + return $this->key_handles; + } + + /** + * Resulting [KeyHandles][google.cloud.kms.v1.KeyHandle]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.KeyHandle key_handles = 1; + * @param array<\Google\Cloud\Kms\V1\KeyHandle>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKeyHandles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\KeyHandle::class); + $this->key_handles = $arr; + + return $this; + } + +} + diff --git a/Kms/src/V1/ShowEffectiveAutokeyConfigRequest.php b/Kms/src/V1/ShowEffectiveAutokeyConfigRequest.php new file mode 100644 index 000000000000..bdcca42a2fb2 --- /dev/null +++ b/Kms/src/V1/ShowEffectiveAutokeyConfigRequest.php @@ -0,0 +1,92 @@ +google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest + */ +class ShowEffectiveAutokeyConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource project to the show effective Cloud KMS + * Autokey configuration for. This may be helpful for interrogating the effect + * of nested folder configurations on a given resource project. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + + /** + * @param string $parent Required. Name of the resource project to the show effective Cloud KMS + * Autokey configuration for. This may be helpful for interrogating the effect + * of nested folder configurations on a given resource project. Please see + * {@see AutokeyAdminClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\ShowEffectiveAutokeyConfigRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the resource project to the show effective Cloud KMS + * Autokey configuration for. This may be helpful for interrogating the effect + * of nested folder configurations on a given resource project. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\AutokeyAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource project to the show effective Cloud KMS + * Autokey configuration for. This may be helpful for interrogating the effect + * of nested folder configurations on a given resource project. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of the resource project to the show effective Cloud KMS + * Autokey configuration for. This may be helpful for interrogating the effect + * of nested folder configurations on a given resource project. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/Kms/src/V1/ShowEffectiveAutokeyConfigResponse.php b/Kms/src/V1/ShowEffectiveAutokeyConfigResponse.php new file mode 100644 index 000000000000..d7b9f298d899 --- /dev/null +++ b/Kms/src/V1/ShowEffectiveAutokeyConfigResponse.php @@ -0,0 +1,72 @@ +google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse + */ +class ShowEffectiveAutokeyConfigResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the key project configured in the resource project's folder + * ancestry. + * + * Generated from protobuf field string key_project = 1; + */ + private $key_project = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key_project + * Name of the key project configured in the resource project's folder + * ancestry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\AutokeyAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Name of the key project configured in the resource project's folder + * ancestry. + * + * Generated from protobuf field string key_project = 1; + * @return string + */ + public function getKeyProject() + { + return $this->key_project; + } + + /** + * Name of the key project configured in the resource project's folder + * ancestry. + * + * Generated from protobuf field string key_project = 1; + * @param string $var + * @return $this + */ + public function setKeyProject($var) + { + GPBUtil::checkString($var, True); + $this->key_project = $var; + + return $this; + } + +} + diff --git a/Kms/src/V1/UpdateAutokeyConfigRequest.php b/Kms/src/V1/UpdateAutokeyConfigRequest.php new file mode 100644 index 000000000000..8e303ac3c34f --- /dev/null +++ b/Kms/src/V1/UpdateAutokeyConfigRequest.php @@ -0,0 +1,152 @@ +google.cloud.kms.v1.UpdateAutokeyConfigRequest + */ +class UpdateAutokeyConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] with values to + * update. + * + * Generated from protobuf field .google.cloud.kms.v1.AutokeyConfig autokey_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $autokey_config = null; + /** + * Required. Masks which fields of the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] to update, e.g. + * `keyProject`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $update_mask = null; + + /** + * @param \Google\Cloud\Kms\V1\AutokeyConfig $autokeyConfig Required. [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] with values to + * update. + * @param \Google\Protobuf\FieldMask $updateMask Required. Masks which fields of the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] to update, e.g. + * `keyProject`. + * + * @return \Google\Cloud\Kms\V1\UpdateAutokeyConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Kms\V1\AutokeyConfig $autokeyConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAutokeyConfig($autokeyConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Kms\V1\AutokeyConfig $autokey_config + * Required. [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] with values to + * update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Masks which fields of the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] to update, e.g. + * `keyProject`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\AutokeyAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] with values to + * update. + * + * Generated from protobuf field .google.cloud.kms.v1.AutokeyConfig autokey_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\AutokeyConfig|null + */ + public function getAutokeyConfig() + { + return $this->autokey_config; + } + + public function hasAutokeyConfig() + { + return isset($this->autokey_config); + } + + public function clearAutokeyConfig() + { + unset($this->autokey_config); + } + + /** + * Required. [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] with values to + * update. + * + * Generated from protobuf field .google.cloud.kms.v1.AutokeyConfig autokey_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\AutokeyConfig $var + * @return $this + */ + public function setAutokeyConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\AutokeyConfig::class); + $this->autokey_config = $var; + + return $this; + } + + /** + * Required. Masks which fields of the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] to update, e.g. + * `keyProject`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Masks which fields of the + * [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] to update, e.g. + * `keyProject`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/Kms/src/V1/gapic_metadata.json b/Kms/src/V1/gapic_metadata.json index 6183f09f0105..3682f60f663a 100644 --- a/Kms/src/V1/gapic_metadata.json +++ b/Kms/src/V1/gapic_metadata.json @@ -5,6 +5,104 @@ "protoPackage": "google.cloud.kms.v1", "libraryPackage": "Google\\Cloud\\Kms\\V1", "services": { + "Autokey": { + "clients": { + "grpc": { + "libraryClient": "AutokeyGapicClient", + "rpcs": { + "CreateKeyHandle": { + "methods": [ + "createKeyHandle" + ] + }, + "GetKeyHandle": { + "methods": [ + "getKeyHandle" + ] + }, + "ListKeyHandles": { + "methods": [ + "listKeyHandles" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + }, + "AutokeyAdmin": { + "clients": { + "grpc": { + "libraryClient": "AutokeyAdminGapicClient", + "rpcs": { + "GetAutokeyConfig": { + "methods": [ + "getAutokeyConfig" + ] + }, + "ShowEffectiveAutokeyConfig": { + "methods": [ + "showEffectiveAutokeyConfig" + ] + }, + "UpdateAutokeyConfig": { + "methods": [ + "updateAutokeyConfig" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + }, "EkmService": { "clients": { "grpc": { diff --git a/Kms/src/V1/resources/autokey_admin_client_config.json b/Kms/src/V1/resources/autokey_admin_client_config.json new file mode 100644 index 000000000000..b331d4cc45bf --- /dev/null +++ b/Kms/src/V1/resources/autokey_admin_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.kms.v1.AutokeyAdmin": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetAutokeyConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ShowEffectiveAutokeyConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateAutokeyConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/Kms/src/V1/resources/autokey_admin_descriptor_config.php b/Kms/src/V1/resources/autokey_admin_descriptor_config.php new file mode 100644 index 000000000000..b349e59725fc --- /dev/null +++ b/Kms/src/V1/resources/autokey_admin_descriptor_config.php @@ -0,0 +1,142 @@ + [ + 'google.cloud.kms.v1.AutokeyAdmin' => [ + 'GetAutokeyConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\AutokeyConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ShowEffectiveAutokeyConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\ShowEffectiveAutokeyConfigResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAutokeyConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\AutokeyConfig', + 'headerParams' => [ + [ + 'keyName' => 'autokey_config.name', + 'fieldAccessors' => [ + 'getAutokeyConfig', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'autokeyConfig' => 'folders/{folder}/autokeyConfig', + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/Kms/src/V1/resources/autokey_admin_rest_client_config.php b/Kms/src/V1/resources/autokey_admin_rest_client_config.php new file mode 100644 index 000000000000..2b0b2021b53c --- /dev/null +++ b/Kms/src/V1/resources/autokey_admin_rest_client_config.php @@ -0,0 +1,203 @@ + [ + 'google.cloud.kms.v1.AutokeyAdmin' => [ + 'GetAutokeyConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/autokeyConfig}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ShowEffectiveAutokeyConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*}:showEffectiveAutokeyConfig', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAutokeyConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{autokey_config.name=folders/*/autokeyConfig}', + 'body' => 'autokey_config', + 'placeholders' => [ + 'autokey_config.name' => [ + 'getters' => [ + 'getAutokeyConfig', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/Kms/src/V1/resources/autokey_client_config.json b/Kms/src/V1/resources/autokey_client_config.json new file mode 100644 index 000000000000..77a418964d09 --- /dev/null +++ b/Kms/src/V1/resources/autokey_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.kms.v1.Autokey": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateKeyHandle": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetKeyHandle": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListKeyHandles": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/Kms/src/V1/resources/autokey_descriptor_config.php b/Kms/src/V1/resources/autokey_descriptor_config.php new file mode 100644 index 000000000000..26007ed2e72d --- /dev/null +++ b/Kms/src/V1/resources/autokey_descriptor_config.php @@ -0,0 +1,149 @@ + [ + 'google.cloud.kms.v1.Autokey' => [ + 'CreateKeyHandle' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Kms\V1\KeyHandle', + 'metadataReturnType' => '\Google\Cloud\Kms\V1\CreateKeyHandleMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetKeyHandle' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\KeyHandle', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListKeyHandles' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\ListKeyHandlesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'keyHandle' => 'projects/{project}/locations/{location}/keyHandles/{key_handle}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/Kms/src/V1/resources/autokey_rest_client_config.php b/Kms/src/V1/resources/autokey_rest_client_config.php new file mode 100644 index 000000000000..ac1650bdc846 --- /dev/null +++ b/Kms/src/V1/resources/autokey_rest_client_config.php @@ -0,0 +1,199 @@ + [ + 'google.cloud.kms.v1.Autokey' => [ + 'CreateKeyHandle' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/keyHandles', + 'body' => 'key_handle', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetKeyHandle' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyHandles/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListKeyHandles' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/keyHandles', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/Kms/src/V1/resources/ekm_service_client_config.json b/Kms/src/V1/resources/ekm_service_client_config.json index 529e553828ce..8fd9c3e0bf3c 100644 --- a/Kms/src/V1/resources/ekm_service_client_config.json +++ b/Kms/src/V1/resources/ekm_service_client_config.json @@ -2,83 +2,92 @@ "interfaces": { "google.cloud.kms.v1.EkmService": { "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ] }, "retry_params": { - "default": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 } }, "methods": { "CreateEkmConnection": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetEkmConfig": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "GetEkmConnection": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "ListEkmConnections": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "UpdateEkmConfig": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "UpdateEkmConnection": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "VerifyConnectivity": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "GetLocation": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "ListLocations": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "GetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "SetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "TestIamPermissions": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" } } } diff --git a/Kms/src/V1/resources/ekm_service_rest_client_config.php b/Kms/src/V1/resources/ekm_service_rest_client_config.php index d727cf9dbad7..34f91a604708 100644 --- a/Kms/src/V1/resources/ekm_service_rest_client_config.php +++ b/Kms/src/V1/resources/ekm_service_rest_client_config.php @@ -238,6 +238,19 @@ ], ], ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], ], 'numericEnums' => true, ]; diff --git a/Kms/src/V1/resources/key_management_service_client_config.json b/Kms/src/V1/resources/key_management_service_client_config.json index e29002f9aa07..029ea27c5978 100644 --- a/Kms/src/V1/resources/key_management_service_client_config.json +++ b/Kms/src/V1/resources/key_management_service_client_config.json @@ -2,188 +2,207 @@ "interfaces": { "google.cloud.kms.v1.KeyManagementService": { "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ] }, "retry_params": { - "default": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_1_params": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 } }, "methods": { "AsymmetricDecrypt": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "AsymmetricSign": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "CreateCryptoKey": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "CreateCryptoKeyVersion": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" }, "CreateImportJob": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "CreateKeyRing": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "Decrypt": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "DestroyCryptoKeyVersion": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "Encrypt": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GenerateRandomBytes": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetCryptoKey": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetCryptoKeyVersion": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetImportJob": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetKeyRing": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetPublicKey": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "ImportCryptoKeyVersion": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" }, "ListCryptoKeyVersions": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "ListCryptoKeys": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "ListImportJobs": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "ListKeyRings": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "MacSign": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "MacVerify": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "RawDecrypt": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "RawEncrypt": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "RestoreCryptoKeyVersion": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "UpdateCryptoKey": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "UpdateCryptoKeyPrimaryVersion": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "UpdateCryptoKeyVersion": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetLocation": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "ListLocations": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "GetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "SetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "TestIamPermissions": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" } } } diff --git a/Kms/src/V1/resources/key_management_service_rest_client_config.php b/Kms/src/V1/resources/key_management_service_rest_client_config.php index fb7c434b4e71..eb9b6897bb40 100644 --- a/Kms/src/V1/resources/key_management_service_rest_client_config.php +++ b/Kms/src/V1/resources/key_management_service_rest_client_config.php @@ -491,6 +491,19 @@ ], ], ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], ], 'numericEnums' => true, ]; diff --git a/Kms/tests/Unit/V1/AutokeyAdminClientTest.php b/Kms/tests/Unit/V1/AutokeyAdminClientTest.php new file mode 100644 index 000000000000..5f952526ef62 --- /dev/null +++ b/Kms/tests/Unit/V1/AutokeyAdminClientTest.php @@ -0,0 +1,565 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AutokeyAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AutokeyAdminClient($options); + } + + /** @test */ + public function getAutokeyConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $keyProject = 'keyProject721994041'; + $expectedResponse = new AutokeyConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setKeyProject($keyProject); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->autokeyConfigName('[FOLDER]'); + $response = $gapicClient->getAutokeyConfig($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.AutokeyAdmin/GetAutokeyConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAutokeyConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->autokeyConfigName('[FOLDER]'); + try { + $gapicClient->getAutokeyConfig($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function showEffectiveAutokeyConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $keyProject = 'keyProject721994041'; + $expectedResponse = new ShowEffectiveAutokeyConfigResponse(); + $expectedResponse->setKeyProject($keyProject); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->showEffectiveAutokeyConfig($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.AutokeyAdmin/ShowEffectiveAutokeyConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function showEffectiveAutokeyConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + try { + $gapicClient->showEffectiveAutokeyConfig($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAutokeyConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $keyProject = 'keyProject721994041'; + $expectedResponse = new AutokeyConfig(); + $expectedResponse->setName($name); + $expectedResponse->setKeyProject($keyProject); + $transport->addResponse($expectedResponse); + // Mock request + $autokeyConfig = new AutokeyConfig(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateAutokeyConfig($autokeyConfig, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.AutokeyAdmin/UpdateAutokeyConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getAutokeyConfig(); + $this->assertProtobufEquals($autokeyConfig, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAutokeyConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $autokeyConfig = new AutokeyConfig(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateAutokeyConfig($autokeyConfig, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/Kms/tests/Unit/V1/AutokeyClientTest.php b/Kms/tests/Unit/V1/AutokeyClientTest.php new file mode 100644 index 000000000000..4aac9a38665c --- /dev/null +++ b/Kms/tests/Unit/V1/AutokeyClientTest.php @@ -0,0 +1,633 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AutokeyClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AutokeyClient($options); + } + + /** @test */ + public function createKeyHandleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createKeyHandleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $kmsKey = 'kmsKey-591635343'; + $resourceTypeSelector = 'resourceTypeSelector-455377709'; + $expectedResponse = new KeyHandle(); + $expectedResponse->setName($name); + $expectedResponse->setKmsKey($kmsKey); + $expectedResponse->setResourceTypeSelector($resourceTypeSelector); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createKeyHandleTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $keyHandle = new KeyHandle(); + $keyHandleResourceTypeSelector = 'keyHandleResourceTypeSelector-1310560146'; + $keyHandle->setResourceTypeSelector($keyHandleResourceTypeSelector); + $response = $gapicClient->createKeyHandle($formattedParent, $keyHandle); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.Autokey/CreateKeyHandle', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getKeyHandle(); + $this->assertProtobufEquals($keyHandle, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createKeyHandleTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createKeyHandleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createKeyHandleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $keyHandle = new KeyHandle(); + $keyHandleResourceTypeSelector = 'keyHandleResourceTypeSelector-1310560146'; + $keyHandle->setResourceTypeSelector($keyHandleResourceTypeSelector); + $response = $gapicClient->createKeyHandle($formattedParent, $keyHandle); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createKeyHandleTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getKeyHandleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $resourceTypeSelector = 'resourceTypeSelector-455377709'; + $expectedResponse = new KeyHandle(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $expectedResponse->setResourceTypeSelector($resourceTypeSelector); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyHandleName('[PROJECT]', '[LOCATION]', '[KEY_HANDLE]'); + $response = $gapicClient->getKeyHandle($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.Autokey/GetKeyHandle', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getKeyHandleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->keyHandleName('[PROJECT]', '[LOCATION]', '[KEY_HANDLE]'); + try { + $gapicClient->getKeyHandle($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKeyHandlesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListKeyHandlesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listKeyHandles($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.Autokey/ListKeyHandles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKeyHandlesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listKeyHandles($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/Kms/tests/Unit/V1/Client/AutokeyAdminClientTest.php b/Kms/tests/Unit/V1/Client/AutokeyAdminClientTest.php new file mode 100644 index 000000000000..db3d68a16a74 --- /dev/null +++ b/Kms/tests/Unit/V1/Client/AutokeyAdminClientTest.php @@ -0,0 +1,638 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AutokeyAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AutokeyAdminClient($options); + } + + /** @test */ + public function getAutokeyConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $keyProject = 'keyProject721994041'; + $expectedResponse = new AutokeyConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setKeyProject($keyProject); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->autokeyConfigName('[FOLDER]'); + $request = (new GetAutokeyConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getAutokeyConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.AutokeyAdmin/GetAutokeyConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAutokeyConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->autokeyConfigName('[FOLDER]'); + $request = (new GetAutokeyConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getAutokeyConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function showEffectiveAutokeyConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $keyProject = 'keyProject721994041'; + $expectedResponse = new ShowEffectiveAutokeyConfigResponse(); + $expectedResponse->setKeyProject($keyProject); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ShowEffectiveAutokeyConfigRequest()) + ->setParent($formattedParent); + $response = $gapicClient->showEffectiveAutokeyConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.AutokeyAdmin/ShowEffectiveAutokeyConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function showEffectiveAutokeyConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ShowEffectiveAutokeyConfigRequest()) + ->setParent($formattedParent); + try { + $gapicClient->showEffectiveAutokeyConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAutokeyConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $keyProject = 'keyProject721994041'; + $expectedResponse = new AutokeyConfig(); + $expectedResponse->setName($name); + $expectedResponse->setKeyProject($keyProject); + $transport->addResponse($expectedResponse); + // Mock request + $autokeyConfig = new AutokeyConfig(); + $updateMask = new FieldMask(); + $request = (new UpdateAutokeyConfigRequest()) + ->setAutokeyConfig($autokeyConfig) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateAutokeyConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.AutokeyAdmin/UpdateAutokeyConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getAutokeyConfig(); + $this->assertProtobufEquals($autokeyConfig, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAutokeyConfigExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $autokeyConfig = new AutokeyConfig(); + $updateMask = new FieldMask(); + $request = (new UpdateAutokeyConfigRequest()) + ->setAutokeyConfig($autokeyConfig) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateAutokeyConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAutokeyConfigAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $keyProject = 'keyProject721994041'; + $expectedResponse = new AutokeyConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setKeyProject($keyProject); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->autokeyConfigName('[FOLDER]'); + $request = (new GetAutokeyConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getAutokeyConfigAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.AutokeyAdmin/GetAutokeyConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/Kms/tests/Unit/V1/Client/AutokeyClientTest.php b/Kms/tests/Unit/V1/Client/AutokeyClientTest.php new file mode 100644 index 000000000000..77f6d7184c5d --- /dev/null +++ b/Kms/tests/Unit/V1/Client/AutokeyClientTest.php @@ -0,0 +1,751 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AutokeyClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AutokeyClient($options); + } + + /** @test */ + public function createKeyHandleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createKeyHandleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $kmsKey = 'kmsKey-591635343'; + $resourceTypeSelector = 'resourceTypeSelector-455377709'; + $expectedResponse = new KeyHandle(); + $expectedResponse->setName($name); + $expectedResponse->setKmsKey($kmsKey); + $expectedResponse->setResourceTypeSelector($resourceTypeSelector); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createKeyHandleTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $keyHandle = new KeyHandle(); + $keyHandleResourceTypeSelector = 'keyHandleResourceTypeSelector-1310560146'; + $keyHandle->setResourceTypeSelector($keyHandleResourceTypeSelector); + $request = (new CreateKeyHandleRequest()) + ->setParent($formattedParent) + ->setKeyHandle($keyHandle); + $response = $gapicClient->createKeyHandle($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.Autokey/CreateKeyHandle', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getKeyHandle(); + $this->assertProtobufEquals($keyHandle, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createKeyHandleTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createKeyHandleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createKeyHandleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $keyHandle = new KeyHandle(); + $keyHandleResourceTypeSelector = 'keyHandleResourceTypeSelector-1310560146'; + $keyHandle->setResourceTypeSelector($keyHandleResourceTypeSelector); + $request = (new CreateKeyHandleRequest()) + ->setParent($formattedParent) + ->setKeyHandle($keyHandle); + $response = $gapicClient->createKeyHandle($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createKeyHandleTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getKeyHandleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $resourceTypeSelector = 'resourceTypeSelector-455377709'; + $expectedResponse = new KeyHandle(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $expectedResponse->setResourceTypeSelector($resourceTypeSelector); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyHandleName('[PROJECT]', '[LOCATION]', '[KEY_HANDLE]'); + $request = (new GetKeyHandleRequest()) + ->setName($formattedName); + $response = $gapicClient->getKeyHandle($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.Autokey/GetKeyHandle', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getKeyHandleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->keyHandleName('[PROJECT]', '[LOCATION]', '[KEY_HANDLE]'); + $request = (new GetKeyHandleRequest()) + ->setName($formattedName); + try { + $gapicClient->getKeyHandle($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKeyHandlesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListKeyHandlesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListKeyHandlesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listKeyHandles($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.Autokey/ListKeyHandles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKeyHandlesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListKeyHandlesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listKeyHandles($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createKeyHandleAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createKeyHandleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $kmsKey = 'kmsKey-591635343'; + $resourceTypeSelector = 'resourceTypeSelector-455377709'; + $expectedResponse = new KeyHandle(); + $expectedResponse->setName($name); + $expectedResponse->setKmsKey($kmsKey); + $expectedResponse->setResourceTypeSelector($resourceTypeSelector); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createKeyHandleTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $keyHandle = new KeyHandle(); + $keyHandleResourceTypeSelector = 'keyHandleResourceTypeSelector-1310560146'; + $keyHandle->setResourceTypeSelector($keyHandleResourceTypeSelector); + $request = (new CreateKeyHandleRequest()) + ->setParent($formattedParent) + ->setKeyHandle($keyHandle); + $response = $gapicClient->createKeyHandleAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.Autokey/CreateKeyHandle', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getKeyHandle(); + $this->assertProtobufEquals($keyHandle, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createKeyHandleTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/KmsInventory/.repo-metadata.json b/KmsInventory/.repo-metadata.json deleted file mode 100644 index 4f6544136a04..000000000000 --- a/KmsInventory/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-kms-inventory", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-kms-inventory/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "kmsinventory" -} diff --git a/KmsInventory/VERSION b/KmsInventory/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/KmsInventory/VERSION +++ b/KmsInventory/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/KmsInventory/composer.json b/KmsInventory/composer.json index cbec97a8a670..95657cf0c956 100644 --- a/KmsInventory/composer.json +++ b/KmsInventory/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/cloud-kms": "^1.15" }, "require-dev": { diff --git a/Language/.repo-metadata.json b/Language/.repo-metadata.json deleted file mode 100644 index e762714ee03c..000000000000 --- a/Language/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-language", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-language/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "language" -} diff --git a/Language/VERSION b/Language/VERSION index eb7713622c21..834413416d3d 100644 --- a/Language/VERSION +++ b/Language/VERSION @@ -1 +1 @@ -0.32.4 +0.32.6 diff --git a/Language/composer.json b/Language/composer.json index 131cc446398a..9cd84837ff16 100644 --- a/Language/composer.json +++ b/Language/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^8.0", "google/cloud-core": "^1.52.7", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Language/src/LanguageClient.php b/Language/src/LanguageClient.php index da5050b90376..f5f7dda9cd01 100644 --- a/Language/src/LanguageClient.php +++ b/Language/src/LanguageClient.php @@ -46,7 +46,7 @@ class LanguageClient ClientTrait::jsonDecode insteadof RetryDeciderTrait; } - const VERSION = '0.32.4'; + const VERSION = '0.32.6'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/cloud-platform'; diff --git a/LifeSciences/.repo-metadata.json b/LifeSciences/.repo-metadata.json deleted file mode 100644 index 86afd7e4ad09..000000000000 --- a/LifeSciences/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-life-sciences", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-life-sciences/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "lifesciences" -} diff --git a/LifeSciences/VERSION b/LifeSciences/VERSION index 844f6a91acb9..ef5e4454454d 100644 --- a/LifeSciences/VERSION +++ b/LifeSciences/VERSION @@ -1 +1 @@ -0.6.3 +0.6.5 diff --git a/LifeSciences/composer.json b/LifeSciences/composer.json index 2bfffd652f81..f83e7f80fc0d 100644 --- a/LifeSciences/composer.json +++ b/LifeSciences/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Logging/.repo-metadata.json b/Logging/.repo-metadata.json deleted file mode 100644 index dbff1bb285ba..000000000000 --- a/Logging/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-logging", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-logging/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "logging" -} diff --git a/Logging/VERSION b/Logging/VERSION index 034552a83eeb..d1eaa3ba0b8c 100644 --- a/Logging/VERSION +++ b/Logging/VERSION @@ -1 +1 @@ -1.30.0 +1.30.2 diff --git a/Logging/composer.json b/Logging/composer.json index 5a0414702806..11a78b6f41f3 100644 --- a/Logging/composer.json +++ b/Logging/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^8.0", "google/cloud-core": "^1.58", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Logging/src/LoggingClient.php b/Logging/src/LoggingClient.php index 4279511b1168..4f3f5654878b 100644 --- a/Logging/src/LoggingClient.php +++ b/Logging/src/LoggingClient.php @@ -70,7 +70,7 @@ class LoggingClient use ArrayTrait; use ClientTrait; - const VERSION = '1.30.0'; + const VERSION = '1.30.2'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/logging.admin'; const READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/logging.read'; diff --git a/LongRunning/.repo-metadata.json b/LongRunning/.repo-metadata.json deleted file mode 100644 index 17df35e48efd..000000000000 --- a/LongRunning/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/longrunning", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/longrunning/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "longrunning" -} diff --git a/LongRunning/VERSION b/LongRunning/VERSION index 267577d47e49..17b2ccd9bf90 100644 --- a/LongRunning/VERSION +++ b/LongRunning/VERSION @@ -1 +1 @@ -0.4.1 +0.4.3 diff --git a/LongRunning/composer.json b/LongRunning/composer.json index 55971d8a6ab3..ac162baf4aa5 100644 --- a/LongRunning/composer.json +++ b/LongRunning/composer.json @@ -3,7 +3,7 @@ "description": "Google LongRunning Client for PHP", "license": "Apache-2.0", "minimum-stability": "stable", - "version": "0.4.1", + "version": "0.4.3", "autoload": { "psr-4": { "Google\\ApiCore\\LongRunning\\": "src/ApiCore/LongRunning", @@ -20,7 +20,7 @@ } }, "require-dev": { - "google/gax": "^1.30", + "google/gax": "^1.34.0", "phpunit/phpunit": "^9.0" } } diff --git a/ManagedIdentities/.repo-metadata.json b/ManagedIdentities/.repo-metadata.json deleted file mode 100644 index 981e954e2579..000000000000 --- a/ManagedIdentities/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-managed-identities", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-managed-identities/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "managedidentities" -} diff --git a/ManagedIdentities/VERSION b/ManagedIdentities/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/ManagedIdentities/VERSION +++ b/ManagedIdentities/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/ManagedIdentities/composer.json b/ManagedIdentities/composer.json index 8b13466b1315..92c86a6d0f4d 100644 --- a/ManagedIdentities/composer.json +++ b/ManagedIdentities/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ManagedKafka/.OwlBot.yaml b/ManagedKafka/.OwlBot.yaml new file mode 100644 index 000000000000..291e9a54ebf5 --- /dev/null +++ b/ManagedKafka/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/cloud/managedkafka/(v1)/.*-php/(.*) + dest: /owl-bot-staging/ManagedKafka/$1/$2 +api-name: ManagedKafka diff --git a/ManagedKafka/.gitattributes b/ManagedKafka/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/ManagedKafka/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/ManagedKafka/.github/pull_request_template.md b/ManagedKafka/.github/pull_request_template.md new file mode 100644 index 000000000000..9e726e4417ce --- /dev/null +++ b/ManagedKafka/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `ManagedKafka/src`, and tests in `ManagedKafka/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/ManagedKafka/CONTRIBUTING.md b/ManagedKafka/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/ManagedKafka/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/ManagedKafka/LICENSE b/ManagedKafka/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/ManagedKafka/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/ManagedKafka/README.md b/ManagedKafka/README.md new file mode 100644 index 000000000000..51252e388f14 --- /dev/null +++ b/ManagedKafka/README.md @@ -0,0 +1,45 @@ +# Google Cloud Managed Kafka for PHP + +> Idiomatic PHP client for [Google Cloud Managed Kafka](https://cloud.google.com/managed-kafka). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-managedkafka/v/stable)](https://packagist.org/packages/google/cloud-managedkafka) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-managedkafka.svg)](https://packagist.org/packages/google/cloud-managedkafka) + +* [API documentation](https://cloud.google.com/php/docs/reference/cloud-managedkafka/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/cloud-managedkafka +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/google-cloud-php-managedkafka/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://cloud.google.com/managed-kafka). diff --git a/ManagedKafka/VERSION b/ManagedKafka/VERSION new file mode 100644 index 000000000000..77d6f4ca2371 --- /dev/null +++ b/ManagedKafka/VERSION @@ -0,0 +1 @@ +0.0.0 diff --git a/ManagedKafka/composer.json b/ManagedKafka/composer.json new file mode 100644 index 000000000000..23748456fbe1 --- /dev/null +++ b/ManagedKafka/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/cloud-managedkafka", + "description": "Google Cloud Managed Kafka Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Cloud\\ManagedKafka\\": "src", + "GPBMetadata\\Google\\Cloud\\Managedkafka\\": "metadata" + } + }, + "extra": { + "component": { + "id": "cloud-managedkafka", + "path": "ManagedKafka", + "target": "googleapis/google-cloud-php-managedkafka" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.33.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/ManagedKafka/metadata/V1/ManagedKafka.php b/ManagedKafka/metadata/V1/ManagedKafka.php new file mode 100644 index 000000000000..10674c4cc346 --- /dev/null +++ b/ManagedKafka/metadata/V1/ManagedKafka.php @@ -0,0 +1,125 @@ +internalAddGeneratedFile( + ' +ñ+ +0google/cloud/managedkafka/v1/managed_kafka.protogoogle.cloud.managedkafka.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/field_info.protogoogle/api/resource.proto,google/cloud/managedkafka/v1/resources.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"¯ +ListClustersRequest; +parent ( B+àAúA%#managedkafka.googleapis.com/Cluster + page_size (BàA + +page_token ( BàA +filter ( BàA +order_by ( BàA"} +ListClustersResponse7 +clusters ( 2%.google.cloud.managedkafka.v1.Cluster +next_page_token (  + unreachable ( "N +GetClusterRequest9 +name ( B+àAúA% +#managedkafka.googleapis.com/Cluster"Ê +CreateClusterRequest; +parent ( B+àAúA%#managedkafka.googleapis.com/Cluster + +cluster_id ( BàA; +cluster ( 2%.google.cloud.managedkafka.v1.ClusterBàA + +request_id ( B àAâŒÏ×"ª +UpdateClusterRequest4 + update_mask ( 2.google.protobuf.FieldMaskBàA; +cluster ( 2%.google.cloud.managedkafka.v1.ClusterBàA + +request_id ( B àAâŒÏ×"r +DeleteClusterRequest9 +name ( B+àAúA% +#managedkafka.googleapis.com/Cluster + +request_id ( B àAâŒÏ×" +ListTopicsRequest9 +parent ( B)àAúA#!managedkafka.googleapis.com/Topic + page_size (BàA + +page_token ( BàA"b +ListTopicsResponse3 +topics ( 2#.google.cloud.managedkafka.v1.Topic +next_page_token ( "J +GetTopicRequest7 +name ( B)àAúA# +!managedkafka.googleapis.com/Topic"Ÿ +CreateTopicRequest9 +parent ( B)àAúA#!managedkafka.googleapis.com/Topic +topic_id ( BàA7 +topic ( 2#.google.cloud.managedkafka.v1.TopicBàA"ƒ +UpdateTopicRequest4 + update_mask ( 2.google.protobuf.FieldMaskBàA7 +topic ( 2#.google.cloud.managedkafka.v1.TopicBàA"M +DeleteTopicRequest7 +name ( B)àAúA# +!managedkafka.googleapis.com/Topic" +ListConsumerGroupsRequestA +parent ( B1àAúA+)managedkafka.googleapis.com/ConsumerGroup + page_size (BàA + +page_token ( BàA"{ +ListConsumerGroupsResponseD +consumer_groups ( 2+.google.cloud.managedkafka.v1.ConsumerGroup +next_page_token ( "Z +GetConsumerGroupRequest? +name ( B1àAúA+ +)managedkafka.googleapis.com/ConsumerGroup"œ +UpdateConsumerGroupRequest4 + update_mask ( 2.google.protobuf.FieldMaskBàAH +consumer_group ( 2+.google.cloud.managedkafka.v1.ConsumerGroupBàA"] +DeleteConsumerGroupRequest? +name ( B1àAúA+ +)managedkafka.googleapis.com/ConsumerGroup2² + ManagedKafka´ + ListClusters1.google.cloud.managedkafka.v1.ListClustersRequest2.google.cloud.managedkafka.v1.ListClustersResponse"=ÚAparent‚Óä“.,/v1/{parent=projects/*/locations/*}/clusters¡ + +GetCluster/.google.cloud.managedkafka.v1.GetClusterRequest%.google.cloud.managedkafka.v1.Cluster";ÚAname‚Óä“.,/v1/{name=projects/*/locations/*/clusters/*}Ü + CreateCluster2.google.cloud.managedkafka.v1.CreateClusterRequest.google.longrunning.Operation"xÊA +ClusterOperationMetadataÚAparent,cluster,cluster_id‚Óä“7",/v1/{parent=projects/*/locations/*}/clusters:clusterÞ + UpdateCluster2.google.cloud.managedkafka.v1.UpdateClusterRequest.google.longrunning.Operation"zÊA +ClusterOperationMetadataÚAcluster,update_mask‚Óä“?24/v1/{cluster.name=projects/*/locations/*/clusters/*}:clusterÌ + DeleteCluster2.google.cloud.managedkafka.v1.DeleteClusterRequest.google.longrunning.Operation"hÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“.*,/v1/{name=projects/*/locations/*/clusters/*}· + +ListTopics/.google.cloud.managedkafka.v1.ListTopicsRequest0.google.cloud.managedkafka.v1.ListTopicsResponse"FÚAparent‚Óä“75/v1/{parent=projects/*/locations/*/clusters/*}/topics¤ +GetTopic-.google.cloud.managedkafka.v1.GetTopicRequest#.google.cloud.managedkafka.v1.Topic"DÚAname‚Óä“75/v1/{name=projects/*/locations/*/clusters/*/topics/*} + CreateTopic0.google.cloud.managedkafka.v1.CreateTopicRequest#.google.cloud.managedkafka.v1.Topic"\\ÚAparent,topic,topic_id‚Óä“>"5/v1/{parent=projects/*/locations/*/clusters/*}/topics:topicÄ + UpdateTopic0.google.cloud.managedkafka.v1.UpdateTopicRequest#.google.cloud.managedkafka.v1.Topic"^ÚAtopic,update_mask‚Óä“D2;/v1/{topic.name=projects/*/locations/*/clusters/*/topics/*}:topic + DeleteTopic0.google.cloud.managedkafka.v1.DeleteTopicRequest.google.protobuf.Empty"DÚAname‚Óä“7*5/v1/{name=projects/*/locations/*/clusters/*/topics/*}× +ListConsumerGroups7.google.cloud.managedkafka.v1.ListConsumerGroupsRequest8.google.cloud.managedkafka.v1.ListConsumerGroupsResponse"NÚAparent‚Óä“?=/v1/{parent=projects/*/locations/*/clusters/*}/consumerGroupsÄ +GetConsumerGroup5.google.cloud.managedkafka.v1.GetConsumerGroupRequest+.google.cloud.managedkafka.v1.ConsumerGroup"LÚAname‚Óä“?=/v1/{name=projects/*/locations/*/clusters/*/consumerGroups/*}€ +UpdateConsumerGroup8.google.cloud.managedkafka.v1.UpdateConsumerGroupRequest+.google.cloud.managedkafka.v1.ConsumerGroup"ÚAconsumer_group,update_mask‚Óä“^2L/v1/{consumer_group.name=projects/*/locations/*/clusters/*/consumerGroups/*}:consumer_groupµ +DeleteConsumerGroup8.google.cloud.managedkafka.v1.DeleteConsumerGroupRequest.google.protobuf.Empty"LÚAname‚Óä“?*=/v1/{name=projects/*/locations/*/clusters/*/consumerGroups/*}OÊAmanagedkafka.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBÝ + com.google.cloud.managedkafka.v1BManagedKafkaProtoPZDcloud.google.com/go/managedkafka/apiv1/managedkafkapb;managedkafkapbªGoogle.Cloud.ManagedKafka.V1ÊGoogle\\Cloud\\ManagedKafka\\V1êGoogle::Cloud::ManagedKafka::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/ManagedKafka/metadata/V1/Resources.php b/ManagedKafka/metadata/V1/Resources.php new file mode 100644 index 0000000000000000000000000000000000000000..f98ecbb0893434fb2ce3aaad9375d2157fadc0d0 GIT binary patch literal 3792 zcmbtXOK;mo5RN3vkC7iT+cb(Bw2T}ej_XjhQlJG>H=rI?)!4FND*+k^ASi03Fs4YB zTsl<)0qI}pk0^@#l-`S8(`$}7_SD%WDN~LsJFPAvmou|F-+VJW^YsJgsRQd`jabCh zDCvrwp-7(+(Q$2R>$WL&{9cc^qHYfy!z8XGij@PganKU0m3r$Ys(QBX>O>a%w%s>L zK{su`TNr4T)+gO#t#_;yPPPj!3B){!8wRkn0r4D7Ct|Hx+9y=&YE*02xQ%w1*=X;_ zY_uP5-v`i5&GW>=$QHZ+5r2-~F%4bxs7CScmf@*}Wl%#iji1n;9kHjG9zpGQWqZD* zQ^U4Irf^{CWaEw)*krP|92@=L5u;Nz86*ftyKYh9TAJCe5KngvhuUrvMP<29=om=0 zvT-NemYFkp;zn>rS$^k`J0f*`65m}ET|#}=y3fze42;H4?Q<|w9HYH!5VKn%Pqh=n zc4hh0t5YNYrW%2Id95)VEdxVIwSjZKE{E~%H%17W((R5h+C@ffjJ;w$-iEi=VC#LT zB-{w3B~CmkPCV&kd+mB?OLL4d2?GwUeHwn^jKsJWXyiyBkbj$oxw7ed7;T{h(AOPR zx2>Mh&n<|FjZCq9Tbj1FRMVX@moKGWE6H!K2&*u|c%Mt4`T|>=7ruau?h?#AmF=EO za>Hwp-RNl27-OcDVp_g~853%yE~m8%v!>P|rk9%$Q+WREXq$7PlS0>}J+4!=s5@l4 zCxq`{Mb|KQ4LXbfN%IqIU0^U&ih&~RLDnT5&D1daB4hL1*xl*I4kN8oYYE{2q*;oQ z9H5Ei;%C!ML=GM?6%Op$UC6}T6*7=ICc_|J!V;uUG}8})v>+$HO5}GT&6S0#uzJ)| zT2=K?PFvDJi4S48{>?w_M6=DAb z)|5xB*qVCKP>;&W9;!C8$^0!?Y7qL|c8>!p2_L|$=XWeZxkEfrllkvqQPFkcd7)4p zR#1Xzg}`};49ltuNH?(+hcW+40v5)#LfC~Rjc*jCLy+B@)8UGrEeOsI%pDIrmGPHV zm4(t4=I(1H{kO6XH+jb6=g{aW&DbiMyk%`Gqy^g} z9qgP3!6gpf$()sHPt);+%rQ68rCH<+9s<3b(|K)-iqYrO{o_ZG0_?rhTC^s?VtnzU zjFn#|-Y6ruIW5%!uj~Ik(F&B|hMC9zN1L<3doj)b^M57aDxTT%2gGeL$*BDi+HHU_ zt`VQg(}6kHlGKc%6UXWqtejbo!^L6}D{z_OmzUdkY%+3#SH>D#k52ZE0822t*YhyJ z*i9G~ldCX42>Za(yi4SNPQg-Sspi_ga~>b}AjB9oSq@(E=-i&fV-Uxw1DV)b9HRy7 z112!KcR7qE!p!iIUm*{FO~9RLM4WW{$^Rgv9@33F%&vs+UF|bON1MyhLLg9Fnt0E@ zOv37c!v+M*_bAL~TNf6}O!30jWgF&+)qSsS2kAmJ7n^HdLwG$-F&3NxmgsNXO$}@_gGIc`FhQ9}9g5|@H- zbXgAKt#fEteWV&bsV+WZM-tsFjDY-^T~4FUEE=Wuz1!nKU@I7gVzUzqtD&DWH*v{e Jx*5R;;2)}G%X9z$ literal 0 HcmV?d00001 diff --git a/ManagedKafka/owlbot.py b/ManagedKafka/owlbot.py new file mode 100644 index 000000000000..b4940284bb67 --- /dev/null +++ b/ManagedKafka/owlbot.py @@ -0,0 +1,56 @@ +# Copyright 2023 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/ManagedKafka").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main(src=src, dest=dest) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/ManagedKafka/phpunit.xml.dist b/ManagedKafka/phpunit.xml.dist new file mode 100644 index 000000000000..5924aa644c26 --- /dev/null +++ b/ManagedKafka/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/create_cluster.php b/ManagedKafka/samples/V1/ManagedKafkaClient/create_cluster.php new file mode 100644 index 000000000000..2a7f3f1cc01a --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/create_cluster.php @@ -0,0 +1,138 @@ +setSubnet($clusterGcpConfigAccessConfigNetworkConfigsSubnet); + $clusterGcpConfigAccessConfigNetworkConfigs = [$networkConfig,]; + $clusterGcpConfigAccessConfig = (new AccessConfig()) + ->setNetworkConfigs($clusterGcpConfigAccessConfigNetworkConfigs); + $clusterGcpConfig = (new GcpConfig()) + ->setAccessConfig($clusterGcpConfigAccessConfig); + $clusterCapacityConfig = (new CapacityConfig()) + ->setVcpuCount($clusterCapacityConfigVcpuCount) + ->setMemoryBytes($clusterCapacityConfigMemoryBytes); + $cluster = (new Cluster()) + ->setGcpConfig($clusterGcpConfig) + ->setCapacityConfig($clusterCapacityConfig); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $managedKafkaClient->createCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = ManagedKafkaClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $clusterGcpConfigAccessConfigNetworkConfigsSubnet = '[SUBNET]'; + $clusterCapacityConfigVcpuCount = 0; + $clusterCapacityConfigMemoryBytes = 0; + + create_cluster_sample( + $formattedParent, + $clusterId, + $clusterGcpConfigAccessConfigNetworkConfigsSubnet, + $clusterCapacityConfigVcpuCount, + $clusterCapacityConfigMemoryBytes + ); +} +// [END managedkafka_v1_generated_ManagedKafka_CreateCluster_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/create_topic.php b/ManagedKafka/samples/V1/ManagedKafkaClient/create_topic.php new file mode 100644 index 000000000000..0cc45662eb29 --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/create_topic.php @@ -0,0 +1,95 @@ +setPartitionCount($topicPartitionCount) + ->setReplicationFactor($topicReplicationFactor); + $request = (new CreateTopicRequest()) + ->setParent($formattedParent) + ->setTopicId($topicId) + ->setTopic($topic); + + // Call the API and handle any network failures. + try { + /** @var Topic $response */ + $response = $managedKafkaClient->createTopic($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 +{ + $formattedParent = ManagedKafkaClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $topicId = '[TOPIC_ID]'; + $topicPartitionCount = 0; + $topicReplicationFactor = 0; + + create_topic_sample($formattedParent, $topicId, $topicPartitionCount, $topicReplicationFactor); +} +// [END managedkafka_v1_generated_ManagedKafka_CreateTopic_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/delete_cluster.php b/ManagedKafka/samples/V1/ManagedKafkaClient/delete_cluster.php new file mode 100644 index 000000000000..f028249f7cd8 --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/delete_cluster.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $managedKafkaClient->deleteCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = ManagedKafkaClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + delete_cluster_sample($formattedName); +} +// [END managedkafka_v1_generated_ManagedKafka_DeleteCluster_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/delete_consumer_group.php b/ManagedKafka/samples/V1/ManagedKafkaClient/delete_consumer_group.php new file mode 100644 index 000000000000..d953c6d7c30e --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/delete_consumer_group.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $managedKafkaClient->deleteConsumerGroup($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = ManagedKafkaClient::consumerGroupName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[CONSUMER_GROUP]' + ); + + delete_consumer_group_sample($formattedName); +} +// [END managedkafka_v1_generated_ManagedKafka_DeleteConsumerGroup_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/delete_topic.php b/ManagedKafka/samples/V1/ManagedKafkaClient/delete_topic.php new file mode 100644 index 000000000000..f2e8ee9e3cbf --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/delete_topic.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $managedKafkaClient->deleteTopic($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = ManagedKafkaClient::topicName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[TOPIC]'); + + delete_topic_sample($formattedName); +} +// [END managedkafka_v1_generated_ManagedKafka_DeleteTopic_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/get_cluster.php b/ManagedKafka/samples/V1/ManagedKafkaClient/get_cluster.php new file mode 100644 index 000000000000..5c3fc319d4f9 --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/get_cluster.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Cluster $response */ + $response = $managedKafkaClient->getCluster($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 = ManagedKafkaClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + get_cluster_sample($formattedName); +} +// [END managedkafka_v1_generated_ManagedKafka_GetCluster_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/get_consumer_group.php b/ManagedKafka/samples/V1/ManagedKafkaClient/get_consumer_group.php new file mode 100644 index 000000000000..ebbfda931847 --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/get_consumer_group.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ConsumerGroup $response */ + $response = $managedKafkaClient->getConsumerGroup($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 = ManagedKafkaClient::consumerGroupName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[CONSUMER_GROUP]' + ); + + get_consumer_group_sample($formattedName); +} +// [END managedkafka_v1_generated_ManagedKafka_GetConsumerGroup_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/get_location.php b/ManagedKafka/samples/V1/ManagedKafkaClient/get_location.php new file mode 100644 index 000000000000..54ef42f76ae7 --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END managedkafka_v1_generated_ManagedKafka_GetLocation_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/get_topic.php b/ManagedKafka/samples/V1/ManagedKafkaClient/get_topic.php new file mode 100644 index 000000000000..48c3f4d04e00 --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/get_topic.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Topic $response */ + $response = $managedKafkaClient->getTopic($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 = ManagedKafkaClient::topicName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[TOPIC]'); + + get_topic_sample($formattedName); +} +// [END managedkafka_v1_generated_ManagedKafka_GetTopic_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/list_clusters.php b/ManagedKafka/samples/V1/ManagedKafkaClient/list_clusters.php new file mode 100644 index 000000000000..0a4b0a051a9f --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/list_clusters.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $managedKafkaClient->listClusters($request); + + /** @var Cluster $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ManagedKafkaClient::locationName('[PROJECT]', '[LOCATION]'); + + list_clusters_sample($formattedParent); +} +// [END managedkafka_v1_generated_ManagedKafka_ListClusters_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/list_consumer_groups.php b/ManagedKafka/samples/V1/ManagedKafkaClient/list_consumer_groups.php new file mode 100644 index 000000000000..7ab0b78142b1 --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/list_consumer_groups.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $managedKafkaClient->listConsumerGroups($request); + + /** @var ConsumerGroup $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ManagedKafkaClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + list_consumer_groups_sample($formattedParent); +} +// [END managedkafka_v1_generated_ManagedKafka_ListConsumerGroups_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/list_locations.php b/ManagedKafka/samples/V1/ManagedKafkaClient/list_locations.php new file mode 100644 index 000000000000..c7aec8b4850e --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END managedkafka_v1_generated_ManagedKafka_ListLocations_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/list_topics.php b/ManagedKafka/samples/V1/ManagedKafkaClient/list_topics.php new file mode 100644 index 000000000000..90860be6b9db --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/list_topics.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $managedKafkaClient->listTopics($request); + + /** @var Topic $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ManagedKafkaClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + list_topics_sample($formattedParent); +} +// [END managedkafka_v1_generated_ManagedKafka_ListTopics_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/update_cluster.php b/ManagedKafka/samples/V1/ManagedKafkaClient/update_cluster.php new file mode 100644 index 000000000000..61e3c38aa419 --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/update_cluster.php @@ -0,0 +1,124 @@ +setSubnet($clusterGcpConfigAccessConfigNetworkConfigsSubnet); + $clusterGcpConfigAccessConfigNetworkConfigs = [$networkConfig,]; + $clusterGcpConfigAccessConfig = (new AccessConfig()) + ->setNetworkConfigs($clusterGcpConfigAccessConfigNetworkConfigs); + $clusterGcpConfig = (new GcpConfig()) + ->setAccessConfig($clusterGcpConfigAccessConfig); + $clusterCapacityConfig = (new CapacityConfig()) + ->setVcpuCount($clusterCapacityConfigVcpuCount) + ->setMemoryBytes($clusterCapacityConfigMemoryBytes); + $cluster = (new Cluster()) + ->setGcpConfig($clusterGcpConfig) + ->setCapacityConfig($clusterCapacityConfig); + $request = (new UpdateClusterRequest()) + ->setUpdateMask($updateMask) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $managedKafkaClient->updateCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $clusterGcpConfigAccessConfigNetworkConfigsSubnet = '[SUBNET]'; + $clusterCapacityConfigVcpuCount = 0; + $clusterCapacityConfigMemoryBytes = 0; + + update_cluster_sample( + $clusterGcpConfigAccessConfigNetworkConfigsSubnet, + $clusterCapacityConfigVcpuCount, + $clusterCapacityConfigMemoryBytes + ); +} +// [END managedkafka_v1_generated_ManagedKafka_UpdateCluster_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/update_consumer_group.php b/ManagedKafka/samples/V1/ManagedKafkaClient/update_consumer_group.php new file mode 100644 index 000000000000..91b8e7b0091f --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/update_consumer_group.php @@ -0,0 +1,62 @@ +setUpdateMask($updateMask) + ->setConsumerGroup($consumerGroup); + + // Call the API and handle any network failures. + try { + /** @var ConsumerGroup $response */ + $response = $managedKafkaClient->updateConsumerGroup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END managedkafka_v1_generated_ManagedKafka_UpdateConsumerGroup_sync] diff --git a/ManagedKafka/samples/V1/ManagedKafkaClient/update_topic.php b/ManagedKafka/samples/V1/ManagedKafkaClient/update_topic.php new file mode 100644 index 000000000000..cc41bac1056f --- /dev/null +++ b/ManagedKafka/samples/V1/ManagedKafkaClient/update_topic.php @@ -0,0 +1,82 @@ +setPartitionCount($topicPartitionCount) + ->setReplicationFactor($topicReplicationFactor); + $request = (new UpdateTopicRequest()) + ->setUpdateMask($updateMask) + ->setTopic($topic); + + // Call the API and handle any network failures. + try { + /** @var Topic $response */ + $response = $managedKafkaClient->updateTopic($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 +{ + $topicPartitionCount = 0; + $topicReplicationFactor = 0; + + update_topic_sample($topicPartitionCount, $topicReplicationFactor); +} +// [END managedkafka_v1_generated_ManagedKafka_UpdateTopic_sync] diff --git a/ManagedKafka/src/V1/AccessConfig.php b/ManagedKafka/src/V1/AccessConfig.php new file mode 100644 index 000000000000..7b0b55d42851 --- /dev/null +++ b/ManagedKafka/src/V1/AccessConfig.php @@ -0,0 +1,75 @@ +google.cloud.managedkafka.v1.AccessConfig + */ +class AccessConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Virtual Private Cloud (VPC) networks that must be granted direct + * access to the Kafka cluster. Minimum of 1 network is required. Maximum 10 + * networks can be specified. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.NetworkConfig network_configs = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $network_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ManagedKafka\V1\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $network_configs + * Required. Virtual Private Cloud (VPC) networks that must be granted direct + * access to the Kafka cluster. Minimum of 1 network is required. Maximum 10 + * networks can be specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Virtual Private Cloud (VPC) networks that must be granted direct + * access to the Kafka cluster. Minimum of 1 network is required. Maximum 10 + * networks can be specified. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.NetworkConfig network_configs = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkConfigs() + { + return $this->network_configs; + } + + /** + * Required. Virtual Private Cloud (VPC) networks that must be granted direct + * access to the Kafka cluster. Minimum of 1 network is required. Maximum 10 + * networks can be specified. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.NetworkConfig network_configs = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\ManagedKafka\V1\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ManagedKafka\V1\NetworkConfig::class); + $this->network_configs = $arr; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/CapacityConfig.php b/ManagedKafka/src/V1/CapacityConfig.php new file mode 100644 index 000000000000..491c262bce33 --- /dev/null +++ b/ManagedKafka/src/V1/CapacityConfig.php @@ -0,0 +1,109 @@ +google.cloud.managedkafka.v1.CapacityConfig + */ +class CapacityConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The number of vCPUs to provision for the cluster. Minimum: 3. + * + * Generated from protobuf field int64 vcpu_count = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vcpu_count = 0; + /** + * Required. The memory to provision for the cluster in bytes. + * The CPU:memory ratio (vCPU:GiB) must be between 1:1 and 1:8. + * Minimum: 3221225472 (3 GiB). + * + * Generated from protobuf field int64 memory_bytes = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $memory_bytes = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $vcpu_count + * Required. The number of vCPUs to provision for the cluster. Minimum: 3. + * @type int|string $memory_bytes + * Required. The memory to provision for the cluster in bytes. + * The CPU:memory ratio (vCPU:GiB) must be between 1:1 and 1:8. + * Minimum: 3221225472 (3 GiB). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The number of vCPUs to provision for the cluster. Minimum: 3. + * + * Generated from protobuf field int64 vcpu_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getVcpuCount() + { + return $this->vcpu_count; + } + + /** + * Required. The number of vCPUs to provision for the cluster. Minimum: 3. + * + * Generated from protobuf field int64 vcpu_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setVcpuCount($var) + { + GPBUtil::checkInt64($var); + $this->vcpu_count = $var; + + return $this; + } + + /** + * Required. The memory to provision for the cluster in bytes. + * The CPU:memory ratio (vCPU:GiB) must be between 1:1 and 1:8. + * Minimum: 3221225472 (3 GiB). + * + * Generated from protobuf field int64 memory_bytes = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getMemoryBytes() + { + return $this->memory_bytes; + } + + /** + * Required. The memory to provision for the cluster in bytes. + * The CPU:memory ratio (vCPU:GiB) must be between 1:1 and 1:8. + * Minimum: 3221225472 (3 GiB). + * + * Generated from protobuf field int64 memory_bytes = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setMemoryBytes($var) + { + GPBUtil::checkInt64($var); + $this->memory_bytes = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/Client/ManagedKafkaClient.php b/ManagedKafka/src/V1/Client/ManagedKafkaClient.php new file mode 100644 index 000000000000..7cbb343f0498 --- /dev/null +++ b/ManagedKafka/src/V1/Client/ManagedKafkaClient.php @@ -0,0 +1,802 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/managed_kafka_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/managed_kafka_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/managed_kafka_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/managed_kafka_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted cluster resource. + */ + public static function clusterName(string $project, string $location, string $cluster): string + { + return self::getPathTemplate('cluster')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * consumer_group resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $consumerGroup + * + * @return string The formatted consumer_group resource. + */ + public static function consumerGroupName( + string $project, + string $location, + string $cluster, + string $consumerGroup + ): string { + return self::getPathTemplate('consumerGroup')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'consumer_group' => $consumerGroup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a topic + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $topic + * + * @return string The formatted topic resource. + */ + public static function topicName(string $project, string $location, string $cluster, string $topic): string + { + return self::getPathTemplate('topic')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'topic' => $topic, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - cluster: projects/{project}/locations/{location}/clusters/{cluster} + * - consumerGroup: projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - location: projects/{project}/locations/{location} + * - topic: projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'managedkafka.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new cluster in a given project and location. + * + * The async variant is {@see ManagedKafkaClient::createClusterAsync()} . + * + * @example samples/V1/ManagedKafkaClient/create_cluster.php + * + * @param CreateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createCluster(CreateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateCluster', $request, $callOptions)->wait(); + } + + /** + * Creates a new topic in a given project and location. + * + * The async variant is {@see ManagedKafkaClient::createTopicAsync()} . + * + * @example samples/V1/ManagedKafkaClient/create_topic.php + * + * @param CreateTopicRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Topic + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTopic(CreateTopicRequest $request, array $callOptions = []): Topic + { + return $this->startApiCall('CreateTopic', $request, $callOptions)->wait(); + } + + /** + * Deletes a single cluster. + * + * The async variant is {@see ManagedKafkaClient::deleteClusterAsync()} . + * + * @example samples/V1/ManagedKafkaClient/delete_cluster.php + * + * @param DeleteClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteCluster(DeleteClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteCluster', $request, $callOptions)->wait(); + } + + /** + * Deletes a single consumer group. + * + * The async variant is {@see ManagedKafkaClient::deleteConsumerGroupAsync()} . + * + * @example samples/V1/ManagedKafkaClient/delete_consumer_group.php + * + * @param DeleteConsumerGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConsumerGroup(DeleteConsumerGroupRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteConsumerGroup', $request, $callOptions)->wait(); + } + + /** + * Deletes a single topic. + * + * The async variant is {@see ManagedKafkaClient::deleteTopicAsync()} . + * + * @example samples/V1/ManagedKafkaClient/delete_topic.php + * + * @param DeleteTopicRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTopic(DeleteTopicRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteTopic', $request, $callOptions)->wait(); + } + + /** + * Returns the properties of a single cluster. + * + * The async variant is {@see ManagedKafkaClient::getClusterAsync()} . + * + * @example samples/V1/ManagedKafkaClient/get_cluster.php + * + * @param GetClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Cluster + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCluster(GetClusterRequest $request, array $callOptions = []): Cluster + { + return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); + } + + /** + * Returns the properties of a single consumer group. + * + * The async variant is {@see ManagedKafkaClient::getConsumerGroupAsync()} . + * + * @example samples/V1/ManagedKafkaClient/get_consumer_group.php + * + * @param GetConsumerGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConsumerGroup + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConsumerGroup(GetConsumerGroupRequest $request, array $callOptions = []): ConsumerGroup + { + return $this->startApiCall('GetConsumerGroup', $request, $callOptions)->wait(); + } + + /** + * Returns the properties of a single topic. + * + * The async variant is {@see ManagedKafkaClient::getTopicAsync()} . + * + * @example samples/V1/ManagedKafkaClient/get_topic.php + * + * @param GetTopicRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Topic + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTopic(GetTopicRequest $request, array $callOptions = []): Topic + { + return $this->startApiCall('GetTopic', $request, $callOptions)->wait(); + } + + /** + * Lists the clusters in a given project and location. + * + * The async variant is {@see ManagedKafkaClient::listClustersAsync()} . + * + * @example samples/V1/ManagedKafkaClient/list_clusters.php + * + * @param ListClustersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listClusters(ListClustersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListClusters', $request, $callOptions); + } + + /** + * Lists the consumer groups in a given cluster. + * + * The async variant is {@see ManagedKafkaClient::listConsumerGroupsAsync()} . + * + * @example samples/V1/ManagedKafkaClient/list_consumer_groups.php + * + * @param ListConsumerGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConsumerGroups(ListConsumerGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConsumerGroups', $request, $callOptions); + } + + /** + * Lists the topics in a given cluster. + * + * The async variant is {@see ManagedKafkaClient::listTopicsAsync()} . + * + * @example samples/V1/ManagedKafkaClient/list_topics.php + * + * @param ListTopicsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTopics(ListTopicsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTopics', $request, $callOptions); + } + + /** + * Updates the properties of a single cluster. + * + * The async variant is {@see ManagedKafkaClient::updateClusterAsync()} . + * + * @example samples/V1/ManagedKafkaClient/update_cluster.php + * + * @param UpdateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCluster(UpdateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateCluster', $request, $callOptions)->wait(); + } + + /** + * Updates the properties of a single consumer group. + * + * The async variant is {@see ManagedKafkaClient::updateConsumerGroupAsync()} . + * + * @example samples/V1/ManagedKafkaClient/update_consumer_group.php + * + * @param UpdateConsumerGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConsumerGroup + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateConsumerGroup(UpdateConsumerGroupRequest $request, array $callOptions = []): ConsumerGroup + { + return $this->startApiCall('UpdateConsumerGroup', $request, $callOptions)->wait(); + } + + /** + * Updates the properties of a single topic. + * + * The async variant is {@see ManagedKafkaClient::updateTopicAsync()} . + * + * @example samples/V1/ManagedKafkaClient/update_topic.php + * + * @param UpdateTopicRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Topic + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateTopic(UpdateTopicRequest $request, array $callOptions = []): Topic + { + return $this->startApiCall('UpdateTopic', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ManagedKafkaClient::getLocationAsync()} . + * + * @example samples/V1/ManagedKafkaClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ManagedKafkaClient::listLocationsAsync()} . + * + * @example samples/V1/ManagedKafkaClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/ManagedKafka/src/V1/Cluster.php b/ManagedKafka/src/V1/Cluster.php new file mode 100644 index 000000000000..d3d0d0766e51 --- /dev/null +++ b/ManagedKafka/src/V1/Cluster.php @@ -0,0 +1,360 @@ +google.cloud.managedkafka.v1.Cluster + */ +class Cluster extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the cluster. Structured like: + * projects/{project_number}/locations/{location}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The time when the cluster was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the cluster was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Labels as key value pairs. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. Capacity configuration for the Kafka cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.CapacityConfig capacity_config = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $capacity_config = null; + /** + * Optional. Rebalance configuration for the Kafka cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.RebalanceConfig rebalance_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rebalance_config = null; + /** + * Output only. The current state of the cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Cluster.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + protected $platform_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ManagedKafka\V1\GcpConfig $gcp_config + * Required. Configuration properties for a Kafka cluster deployed to Google + * Cloud Platform. + * @type string $name + * Identifier. The name of the cluster. Structured like: + * projects/{project_number}/locations/{location}/clusters/{cluster_id} + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the cluster was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the cluster was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels as key value pairs. + * @type \Google\Cloud\ManagedKafka\V1\CapacityConfig $capacity_config + * Required. Capacity configuration for the Kafka cluster. + * @type \Google\Cloud\ManagedKafka\V1\RebalanceConfig $rebalance_config + * Optional. Rebalance configuration for the Kafka cluster. + * @type int $state + * Output only. The current state of the cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Configuration properties for a Kafka cluster deployed to Google + * Cloud Platform. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.GcpConfig gcp_config = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ManagedKafka\V1\GcpConfig|null + */ + public function getGcpConfig() + { + return $this->readOneof(9); + } + + public function hasGcpConfig() + { + return $this->hasOneof(9); + } + + /** + * Required. Configuration properties for a Kafka cluster deployed to Google + * Cloud Platform. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.GcpConfig gcp_config = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ManagedKafka\V1\GcpConfig $var + * @return $this + */ + public function setGcpConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ManagedKafka\V1\GcpConfig::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Identifier. The name of the cluster. Structured like: + * projects/{project_number}/locations/{location}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the cluster. Structured like: + * projects/{project_number}/locations/{location}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time when the cluster was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the cluster was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the cluster was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the cluster was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Labels as key value pairs. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels as key value pairs. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. Capacity configuration for the Kafka cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.CapacityConfig capacity_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ManagedKafka\V1\CapacityConfig|null + */ + public function getCapacityConfig() + { + return $this->capacity_config; + } + + public function hasCapacityConfig() + { + return isset($this->capacity_config); + } + + public function clearCapacityConfig() + { + unset($this->capacity_config); + } + + /** + * Required. Capacity configuration for the Kafka cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.CapacityConfig capacity_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ManagedKafka\V1\CapacityConfig $var + * @return $this + */ + public function setCapacityConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ManagedKafka\V1\CapacityConfig::class); + $this->capacity_config = $var; + + return $this; + } + + /** + * Optional. Rebalance configuration for the Kafka cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.RebalanceConfig rebalance_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\ManagedKafka\V1\RebalanceConfig|null + */ + public function getRebalanceConfig() + { + return $this->rebalance_config; + } + + public function hasRebalanceConfig() + { + return isset($this->rebalance_config); + } + + public function clearRebalanceConfig() + { + unset($this->rebalance_config); + } + + /** + * Optional. Rebalance configuration for the Kafka cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.RebalanceConfig rebalance_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\ManagedKafka\V1\RebalanceConfig $var + * @return $this + */ + public function setRebalanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ManagedKafka\V1\RebalanceConfig::class); + $this->rebalance_config = $var; + + return $this; + } + + /** + * Output only. The current state of the cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Cluster.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Cluster.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ManagedKafka\V1\Cluster\State::class); + $this->state = $var; + + return $this; + } + + /** + * @return string + */ + public function getPlatformConfig() + { + return $this->whichOneof("platform_config"); + } + +} + diff --git a/ManagedKafka/src/V1/Cluster/State.php b/ManagedKafka/src/V1/Cluster/State.php new file mode 100644 index 000000000000..7a114858b26e --- /dev/null +++ b/ManagedKafka/src/V1/Cluster/State.php @@ -0,0 +1,69 @@ +google.cloud.managedkafka.v1.Cluster.State + */ +class State +{ + /** + * A state was not specified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The cluster is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The cluster is active. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The cluster is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ManagedKafka/src/V1/ConsumerGroup.php b/ManagedKafka/src/V1/ConsumerGroup.php new file mode 100644 index 000000000000..1dd45cb33745 --- /dev/null +++ b/ManagedKafka/src/V1/ConsumerGroup.php @@ -0,0 +1,117 @@ +google.cloud.managedkafka.v1.ConsumerGroup + */ +class ConsumerGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the consumer group. The `consumer_group` segment is + * used when connecting directly to the cluster. Structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. Metadata for this consumer group for all topics it has metadata + * for. The key of the map is a topic name, structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} + * + * Generated from protobuf field map topics = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $topics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the consumer group. The `consumer_group` segment is + * used when connecting directly to the cluster. Structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group} + * @type array|\Google\Protobuf\Internal\MapField $topics + * Optional. Metadata for this consumer group for all topics it has metadata + * for. The key of the map is a topic name, structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the consumer group. The `consumer_group` segment is + * used when connecting directly to the cluster. Structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the consumer group. The `consumer_group` segment is + * used when connecting directly to the cluster. Structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Metadata for this consumer group for all topics it has metadata + * for. The key of the map is a topic name, structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} + * + * Generated from protobuf field map topics = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTopics() + { + return $this->topics; + } + + /** + * Optional. Metadata for this consumer group for all topics it has metadata + * for. The key of the map is a topic name, structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} + * + * Generated from protobuf field map topics = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTopics($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ManagedKafka\V1\ConsumerTopicMetadata::class); + $this->topics = $arr; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/ConsumerPartitionMetadata.php b/ManagedKafka/src/V1/ConsumerPartitionMetadata.php new file mode 100644 index 000000000000..b90ae90f1ac5 --- /dev/null +++ b/ManagedKafka/src/V1/ConsumerPartitionMetadata.php @@ -0,0 +1,109 @@ +google.cloud.managedkafka.v1.ConsumerPartitionMetadata + */ +class ConsumerPartitionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The offset for this partition, or 0 if no offset has been + * committed. + * + * Generated from protobuf field int64 offset = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $offset = 0; + /** + * Optional. The associated metadata for this partition, or empty if it does + * not exist. + * + * Generated from protobuf field string metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metadata = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $offset + * Required. The offset for this partition, or 0 if no offset has been + * committed. + * @type string $metadata + * Optional. The associated metadata for this partition, or empty if it does + * not exist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The offset for this partition, or 0 if no offset has been + * committed. + * + * Generated from protobuf field int64 offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getOffset() + { + return $this->offset; + } + + /** + * Required. The offset for this partition, or 0 if no offset has been + * committed. + * + * Generated from protobuf field int64 offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt64($var); + $this->offset = $var; + + return $this; + } + + /** + * Optional. The associated metadata for this partition, or empty if it does + * not exist. + * + * Generated from protobuf field string metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Optional. The associated metadata for this partition, or empty if it does + * not exist. + * + * Generated from protobuf field string metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkString($var, True); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/ConsumerTopicMetadata.php b/ManagedKafka/src/V1/ConsumerTopicMetadata.php new file mode 100644 index 000000000000..1bae3f307e4f --- /dev/null +++ b/ManagedKafka/src/V1/ConsumerTopicMetadata.php @@ -0,0 +1,71 @@ +google.cloud.managedkafka.v1.ConsumerTopicMetadata + */ +class ConsumerTopicMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Metadata for this consumer group and topic for all partition + * indexes it has metadata for. + * + * Generated from protobuf field map partitions = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $partitions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $partitions + * Optional. Metadata for this consumer group and topic for all partition + * indexes it has metadata for. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Metadata for this consumer group and topic for all partition + * indexes it has metadata for. + * + * Generated from protobuf field map partitions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getPartitions() + { + return $this->partitions; + } + + /** + * Optional. Metadata for this consumer group and topic for all partition + * indexes it has metadata for. + * + * Generated from protobuf field map partitions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setPartitions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ManagedKafka\V1\ConsumerPartitionMetadata::class); + $this->partitions = $arr; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/CreateClusterRequest.php b/ManagedKafka/src/V1/CreateClusterRequest.php new file mode 100644 index 000000000000..8271e3324f0e --- /dev/null +++ b/ManagedKafka/src/V1/CreateClusterRequest.php @@ -0,0 +1,272 @@ +google.cloud.managedkafka.v1.CreateClusterRequest + */ +class CreateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent region in which to create the cluster. Structured like + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID to use for the cluster, which will become the final + * component of the cluster's name. The ID must be 1-63 characters long, and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with + * RFC 1035. + * This value is structured like: `my-cluster-id`. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. Configuration of the cluster to create. Its `name` field is + * ignored. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The parent region in which to create the cluster. Structured like + * `projects/{project}/locations/{location}`. Please see + * {@see ManagedKafkaClient::locationName()} for help formatting this field. + * @param \Google\Cloud\ManagedKafka\V1\Cluster $cluster Required. Configuration of the cluster to create. Its `name` field is + * ignored. + * @param string $clusterId Required. The ID to use for the cluster, which will become the final + * component of the cluster's name. The ID must be 1-63 characters long, and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with + * RFC 1035. + * + * This value is structured like: `my-cluster-id`. + * + * @return \Google\Cloud\ManagedKafka\V1\CreateClusterRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ManagedKafka\V1\Cluster $cluster, string $clusterId): self + { + return (new self()) + ->setParent($parent) + ->setCluster($cluster) + ->setClusterId($clusterId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent region in which to create the cluster. Structured like + * `projects/{project}/locations/{location}`. + * @type string $cluster_id + * Required. The ID to use for the cluster, which will become the final + * component of the cluster's name. The ID must be 1-63 characters long, and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with + * RFC 1035. + * This value is structured like: `my-cluster-id`. + * @type \Google\Cloud\ManagedKafka\V1\Cluster $cluster + * Required. Configuration of the cluster to create. Its `name` field is + * ignored. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent region in which to create the cluster. Structured like + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent region in which to create the cluster. Structured like + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ID to use for the cluster, which will become the final + * component of the cluster's name. The ID must be 1-63 characters long, and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with + * RFC 1035. + * This value is structured like: `my-cluster-id`. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. The ID to use for the cluster, which will become the final + * component of the cluster's name. The ID must be 1-63 characters long, and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with + * RFC 1035. + * This value is structured like: `my-cluster-id`. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. Configuration of the cluster to create. Its `name` field is + * ignored. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ManagedKafka\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. Configuration of the cluster to create. Its `name` field is + * ignored. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ManagedKafka\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ManagedKafka\V1\Cluster::class); + $this->cluster = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/CreateTopicRequest.php b/ManagedKafka/src/V1/CreateTopicRequest.php new file mode 100644 index 000000000000..49797ac7e3d0 --- /dev/null +++ b/ManagedKafka/src/V1/CreateTopicRequest.php @@ -0,0 +1,189 @@ +google.cloud.managedkafka.v1.CreateTopicRequest + */ +class CreateTopicRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent cluster in which to create the topic. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID to use for the topic, which will become the final + * component of the topic's name. + * This value is structured like: `my-topic-name`. + * + * Generated from protobuf field string topic_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $topic_id = ''; + /** + * Required. Configuration of the topic to create. Its `name` field is + * ignored. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Topic topic = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $topic = null; + + /** + * @param string $parent Required. The parent cluster in which to create the topic. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. Please see + * {@see ManagedKafkaClient::clusterName()} for help formatting this field. + * @param \Google\Cloud\ManagedKafka\V1\Topic $topic Required. Configuration of the topic to create. Its `name` field is + * ignored. + * @param string $topicId Required. The ID to use for the topic, which will become the final + * component of the topic's name. + * + * This value is structured like: `my-topic-name`. + * + * @return \Google\Cloud\ManagedKafka\V1\CreateTopicRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ManagedKafka\V1\Topic $topic, string $topicId): self + { + return (new self()) + ->setParent($parent) + ->setTopic($topic) + ->setTopicId($topicId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent cluster in which to create the topic. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * @type string $topic_id + * Required. The ID to use for the topic, which will become the final + * component of the topic's name. + * This value is structured like: `my-topic-name`. + * @type \Google\Cloud\ManagedKafka\V1\Topic $topic + * Required. Configuration of the topic to create. Its `name` field is + * ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent cluster in which to create the topic. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent cluster in which to create the topic. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The ID to use for the topic, which will become the final + * component of the topic's name. + * This value is structured like: `my-topic-name`. + * + * Generated from protobuf field string topic_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTopicId() + { + return $this->topic_id; + } + + /** + * Required. The ID to use for the topic, which will become the final + * component of the topic's name. + * This value is structured like: `my-topic-name`. + * + * Generated from protobuf field string topic_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTopicId($var) + { + GPBUtil::checkString($var, True); + $this->topic_id = $var; + + return $this; + } + + /** + * Required. Configuration of the topic to create. Its `name` field is + * ignored. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Topic topic = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ManagedKafka\V1\Topic|null + */ + public function getTopic() + { + return $this->topic; + } + + public function hasTopic() + { + return isset($this->topic); + } + + public function clearTopic() + { + unset($this->topic); + } + + /** + * Required. Configuration of the topic to create. Its `name` field is + * ignored. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Topic topic = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ManagedKafka\V1\Topic $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ManagedKafka\V1\Topic::class); + $this->topic = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/DeleteClusterRequest.php b/ManagedKafka/src/V1/DeleteClusterRequest.php new file mode 100644 index 000000000000..d01b80718e76 --- /dev/null +++ b/ManagedKafka/src/V1/DeleteClusterRequest.php @@ -0,0 +1,159 @@ +google.cloud.managedkafka.v1.DeleteClusterRequest + */ +class DeleteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the cluster to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. The name of the cluster to delete. Please see + * {@see ManagedKafkaClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\ManagedKafka\V1\DeleteClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the cluster to delete. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the cluster to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the cluster to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/DeleteConsumerGroupRequest.php b/ManagedKafka/src/V1/DeleteConsumerGroupRequest.php new file mode 100644 index 000000000000..fec2b3a08134 --- /dev/null +++ b/ManagedKafka/src/V1/DeleteConsumerGroupRequest.php @@ -0,0 +1,86 @@ +google.cloud.managedkafka.v1.DeleteConsumerGroupRequest + */ +class DeleteConsumerGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the consumer group to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the consumer group to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. Please see + * {@see ManagedKafkaClient::consumerGroupName()} for help formatting this field. + * + * @return \Google\Cloud\ManagedKafka\V1\DeleteConsumerGroupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the consumer group to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the consumer group to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the consumer group to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/DeleteTopicRequest.php b/ManagedKafka/src/V1/DeleteTopicRequest.php new file mode 100644 index 000000000000..c8f0b94a2ee5 --- /dev/null +++ b/ManagedKafka/src/V1/DeleteTopicRequest.php @@ -0,0 +1,86 @@ +google.cloud.managedkafka.v1.DeleteTopicRequest + */ +class DeleteTopicRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the topic to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the topic to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}`. Please see + * {@see ManagedKafkaClient::topicName()} for help formatting this field. + * + * @return \Google\Cloud\ManagedKafka\V1\DeleteTopicRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the topic to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the topic to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the topic to delete. + * `projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/GcpConfig.php b/ManagedKafka/src/V1/GcpConfig.php new file mode 100644 index 000000000000..375598e9df03 --- /dev/null +++ b/ManagedKafka/src/V1/GcpConfig.php @@ -0,0 +1,132 @@ +google.cloud.managedkafka.v1.GcpConfig + */ +class GcpConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Access configuration for the Kafka cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.AccessConfig access_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $access_config = null; + /** + * Optional. Immutable. The Cloud KMS Key name to use for encryption. The key + * must be located in the same region as the cluster and cannot be changed. + * Structured like: + * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. + * Note that the project component only accepts a project ID, and not a + * project number. + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $kms_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ManagedKafka\V1\AccessConfig $access_config + * Required. Access configuration for the Kafka cluster. + * @type string $kms_key + * Optional. Immutable. The Cloud KMS Key name to use for encryption. The key + * must be located in the same region as the cluster and cannot be changed. + * Structured like: + * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. + * Note that the project component only accepts a project ID, and not a + * project number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Access configuration for the Kafka cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.AccessConfig access_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ManagedKafka\V1\AccessConfig|null + */ + public function getAccessConfig() + { + return $this->access_config; + } + + public function hasAccessConfig() + { + return isset($this->access_config); + } + + public function clearAccessConfig() + { + unset($this->access_config); + } + + /** + * Required. Access configuration for the Kafka cluster. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.AccessConfig access_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ManagedKafka\V1\AccessConfig $var + * @return $this + */ + public function setAccessConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ManagedKafka\V1\AccessConfig::class); + $this->access_config = $var; + + return $this; + } + + /** + * Optional. Immutable. The Cloud KMS Key name to use for encryption. The key + * must be located in the same region as the cluster and cannot be changed. + * Structured like: + * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. + * Note that the project component only accepts a project ID, and not a + * project number. + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getKmsKey() + { + return $this->kms_key; + } + + /** + * Optional. Immutable. The Cloud KMS Key name to use for encryption. The key + * must be located in the same region as the cluster and cannot be changed. + * Structured like: + * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. + * Note that the project component only accepts a project ID, and not a + * project number. + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/GetClusterRequest.php b/ManagedKafka/src/V1/GetClusterRequest.php new file mode 100644 index 000000000000..a0aae7374680 --- /dev/null +++ b/ManagedKafka/src/V1/GetClusterRequest.php @@ -0,0 +1,81 @@ +google.cloud.managedkafka.v1.GetClusterRequest + */ +class GetClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the cluster whose configuration to return. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the cluster whose configuration to return. Please see + * {@see ManagedKafkaClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\ManagedKafka\V1\GetClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the cluster whose configuration to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the cluster whose configuration to return. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the cluster whose configuration to return. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/GetConsumerGroupRequest.php b/ManagedKafka/src/V1/GetConsumerGroupRequest.php new file mode 100644 index 000000000000..05104476d0a0 --- /dev/null +++ b/ManagedKafka/src/V1/GetConsumerGroupRequest.php @@ -0,0 +1,86 @@ +google.cloud.managedkafka.v1.GetConsumerGroupRequest + */ +class GetConsumerGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the consumer group whose configuration to return. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the consumer group whose configuration to return. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. Please see + * {@see ManagedKafkaClient::consumerGroupName()} for help formatting this field. + * + * @return \Google\Cloud\ManagedKafka\V1\GetConsumerGroupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the consumer group whose configuration to return. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the consumer group whose configuration to return. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the consumer group whose configuration to return. + * `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/GetTopicRequest.php b/ManagedKafka/src/V1/GetTopicRequest.php new file mode 100644 index 000000000000..49f1ad997717 --- /dev/null +++ b/ManagedKafka/src/V1/GetTopicRequest.php @@ -0,0 +1,91 @@ +google.cloud.managedkafka.v1.GetTopicRequest + */ +class GetTopicRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the topic whose configuration to return. Structured + * like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the topic whose configuration to return. Structured + * like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}. Please see + * {@see ManagedKafkaClient::topicName()} for help formatting this field. + * + * @return \Google\Cloud\ManagedKafka\V1\GetTopicRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the topic whose configuration to return. Structured + * like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the topic whose configuration to return. Structured + * like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the topic whose configuration to return. Structured + * like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/ListClustersRequest.php b/ManagedKafka/src/V1/ListClustersRequest.php new file mode 100644 index 000000000000..aa5222147449 --- /dev/null +++ b/ManagedKafka/src/V1/ListClustersRequest.php @@ -0,0 +1,242 @@ +google.cloud.managedkafka.v1.ListClustersRequest + */ +class ListClustersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent location whose clusters are to be listed. Structured + * like `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of clusters to return. The service may return + * fewer than this value. If unspecified, server will pick an appropriate + * default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListClusters` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filter expression for the result. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Order by fields for the result. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The parent location whose clusters are to be listed. Structured + * like `projects/{project}/locations/{location}`. Please see + * {@see ManagedKafkaClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\ManagedKafka\V1\ListClustersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent location whose clusters are to be listed. Structured + * like `projects/{project}/locations/{location}`. + * @type int $page_size + * Optional. The maximum number of clusters to return. The service may return + * fewer than this value. If unspecified, server will pick an appropriate + * default. + * @type string $page_token + * Optional. A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListClusters` must match + * the call that provided the page token. + * @type string $filter + * Optional. Filter expression for the result. + * @type string $order_by + * Optional. Order by fields for the result. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent location whose clusters are to be listed. Structured + * like `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent location whose clusters are to be listed. Structured + * like `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of clusters to return. The service may return + * fewer than this value. If unspecified, server will pick an appropriate + * default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of clusters to return. The service may return + * fewer than this value. If unspecified, server will pick an appropriate + * default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListClusters` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListClusters` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filter expression for the result. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter expression for the result. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Order by fields for the result. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Order by fields for the result. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/ListClustersResponse.php b/ManagedKafka/src/V1/ListClustersResponse.php new file mode 100644 index 000000000000..f02d1357fbc3 --- /dev/null +++ b/ManagedKafka/src/V1/ListClustersResponse.php @@ -0,0 +1,139 @@ +google.cloud.managedkafka.v1.ListClustersResponse + */ +class ListClustersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Clusters in the requested parent. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.Cluster clusters = 1; + */ + private $clusters; + /** + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ManagedKafka\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters + * The list of Clusters in the requested parent. + * @type string $next_page_token + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * The list of Clusters in the requested parent. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.Cluster clusters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClusters() + { + return $this->clusters; + } + + /** + * The list of Clusters in the requested parent. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.Cluster clusters = 1; + * @param array<\Google\Cloud\ManagedKafka\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClusters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ManagedKafka\V1\Cluster::class); + $this->clusters = $arr; + + return $this; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/ListConsumerGroupsRequest.php b/ManagedKafka/src/V1/ListConsumerGroupsRequest.php new file mode 100644 index 000000000000..d201e3bc513c --- /dev/null +++ b/ManagedKafka/src/V1/ListConsumerGroupsRequest.php @@ -0,0 +1,179 @@ +google.cloud.managedkafka.v1.ListConsumerGroupsRequest + */ +class ListConsumerGroupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent cluster whose consumer groups are to be listed. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of consumer groups to return. The service may + * return fewer than this value. If unset or zero, all consumer groups for the + * parent is returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListConsumerGroups` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConsumerGroups` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent cluster whose consumer groups are to be listed. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. Please see + * {@see ManagedKafkaClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\ManagedKafka\V1\ListConsumerGroupsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent cluster whose consumer groups are to be listed. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * @type int $page_size + * Optional. The maximum number of consumer groups to return. The service may + * return fewer than this value. If unset or zero, all consumer groups for the + * parent is returned. + * @type string $page_token + * Optional. A page token, received from a previous `ListConsumerGroups` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConsumerGroups` must + * match the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent cluster whose consumer groups are to be listed. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent cluster whose consumer groups are to be listed. + * Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of consumer groups to return. The service may + * return fewer than this value. If unset or zero, all consumer groups for the + * parent is returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of consumer groups to return. The service may + * return fewer than this value. If unset or zero, all consumer groups for the + * parent is returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListConsumerGroups` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConsumerGroups` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListConsumerGroups` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConsumerGroups` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/ListConsumerGroupsResponse.php b/ManagedKafka/src/V1/ListConsumerGroupsResponse.php new file mode 100644 index 000000000000..abcaff0766b1 --- /dev/null +++ b/ManagedKafka/src/V1/ListConsumerGroupsResponse.php @@ -0,0 +1,109 @@ +google.cloud.managedkafka.v1.ListConsumerGroupsResponse + */ +class ListConsumerGroupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of consumer group in the requested parent. The order of the + * consumer groups is unspecified. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.ConsumerGroup consumer_groups = 1; + */ + private $consumer_groups; + /** + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ManagedKafka\V1\ConsumerGroup>|\Google\Protobuf\Internal\RepeatedField $consumer_groups + * The list of consumer group in the requested parent. The order of the + * consumer groups is unspecified. + * @type string $next_page_token + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * The list of consumer group in the requested parent. The order of the + * consumer groups is unspecified. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.ConsumerGroup consumer_groups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConsumerGroups() + { + return $this->consumer_groups; + } + + /** + * The list of consumer group in the requested parent. The order of the + * consumer groups is unspecified. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.ConsumerGroup consumer_groups = 1; + * @param array<\Google\Cloud\ManagedKafka\V1\ConsumerGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConsumerGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ManagedKafka\V1\ConsumerGroup::class); + $this->consumer_groups = $arr; + + return $this; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/ListTopicsRequest.php b/ManagedKafka/src/V1/ListTopicsRequest.php new file mode 100644 index 000000000000..cae01297e741 --- /dev/null +++ b/ManagedKafka/src/V1/ListTopicsRequest.php @@ -0,0 +1,174 @@ +google.cloud.managedkafka.v1.ListTopicsRequest + */ +class ListTopicsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent cluster whose topics are to be listed. Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of topics to return. The service may return + * fewer than this value. If unset or zero, all topics for the parent is + * returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListTopics` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTopics` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent cluster whose topics are to be listed. Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. Please see + * {@see ManagedKafkaClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\ManagedKafka\V1\ListTopicsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent cluster whose topics are to be listed. Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * @type int $page_size + * Optional. The maximum number of topics to return. The service may return + * fewer than this value. If unset or zero, all topics for the parent is + * returned. + * @type string $page_token + * Optional. A page token, received from a previous `ListTopics` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTopics` must match + * the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent cluster whose topics are to be listed. Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent cluster whose topics are to be listed. Structured like + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of topics to return. The service may return + * fewer than this value. If unset or zero, all topics for the parent is + * returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of topics to return. The service may return + * fewer than this value. If unset or zero, all topics for the parent is + * returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListTopics` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTopics` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListTopics` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTopics` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/ListTopicsResponse.php b/ManagedKafka/src/V1/ListTopicsResponse.php new file mode 100644 index 000000000000..c9437db1809b --- /dev/null +++ b/ManagedKafka/src/V1/ListTopicsResponse.php @@ -0,0 +1,109 @@ +google.cloud.managedkafka.v1.ListTopicsResponse + */ +class ListTopicsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of topics in the requested parent. The order of the topics is + * unspecified. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.Topic topics = 1; + */ + private $topics; + /** + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ManagedKafka\V1\Topic>|\Google\Protobuf\Internal\RepeatedField $topics + * The list of topics in the requested parent. The order of the topics is + * unspecified. + * @type string $next_page_token + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * The list of topics in the requested parent. The order of the topics is + * unspecified. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.Topic topics = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTopics() + { + return $this->topics; + } + + /** + * The list of topics in the requested parent. The order of the topics is + * unspecified. + * + * Generated from protobuf field repeated .google.cloud.managedkafka.v1.Topic topics = 1; + * @param array<\Google\Cloud\ManagedKafka\V1\Topic>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTopics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ManagedKafka\V1\Topic::class); + $this->topics = $arr; + + return $this; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page of + * results. If this field is omitted, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/NetworkConfig.php b/ManagedKafka/src/V1/NetworkConfig.php new file mode 100644 index 000000000000..c0efa7fdf8ad --- /dev/null +++ b/ManagedKafka/src/V1/NetworkConfig.php @@ -0,0 +1,96 @@ +google.cloud.managedkafka.v1.NetworkConfig + */ +class NetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the VPC subnet in which to create Private Service Connect + * (PSC) endpoints for the Kafka brokers and bootstrap address. Structured + * like: projects/{project}/regions/{region}/subnetworks/{subnet_id} + * The subnet must be located in the same region as the Kafka cluster. The + * project may differ. Multiple subnets from the same parent network must not + * be specified. + * The CIDR range of the subnet must be within the IPv4 address ranges for + * private networks, as specified in RFC 1918. + * + * Generated from protobuf field string subnet = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnet = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subnet + * Required. Name of the VPC subnet in which to create Private Service Connect + * (PSC) endpoints for the Kafka brokers and bootstrap address. Structured + * like: projects/{project}/regions/{region}/subnetworks/{subnet_id} + * The subnet must be located in the same region as the Kafka cluster. The + * project may differ. Multiple subnets from the same parent network must not + * be specified. + * The CIDR range of the subnet must be within the IPv4 address ranges for + * private networks, as specified in RFC 1918. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the VPC subnet in which to create Private Service Connect + * (PSC) endpoints for the Kafka brokers and bootstrap address. Structured + * like: projects/{project}/regions/{region}/subnetworks/{subnet_id} + * The subnet must be located in the same region as the Kafka cluster. The + * project may differ. Multiple subnets from the same parent network must not + * be specified. + * The CIDR range of the subnet must be within the IPv4 address ranges for + * private networks, as specified in RFC 1918. + * + * Generated from protobuf field string subnet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSubnet() + { + return $this->subnet; + } + + /** + * Required. Name of the VPC subnet in which to create Private Service Connect + * (PSC) endpoints for the Kafka brokers and bootstrap address. Structured + * like: projects/{project}/regions/{region}/subnetworks/{subnet_id} + * The subnet must be located in the same region as the Kafka cluster. The + * project may differ. Multiple subnets from the same parent network must not + * be specified. + * The CIDR range of the subnet must be within the IPv4 address ranges for + * private networks, as specified in RFC 1918. + * + * Generated from protobuf field string subnet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSubnet($var) + { + GPBUtil::checkString($var, True); + $this->subnet = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/OperationMetadata.php b/ManagedKafka/src/V1/OperationMetadata.php new file mode 100644 index 000000000000..ebfd69902bdd --- /dev/null +++ b/ManagedKafka/src/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.managedkafka.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/RebalanceConfig.php b/ManagedKafka/src/V1/RebalanceConfig.php new file mode 100644 index 000000000000..b13164db93f7 --- /dev/null +++ b/ManagedKafka/src/V1/RebalanceConfig.php @@ -0,0 +1,71 @@ +google.cloud.managedkafka.v1.RebalanceConfig + */ +class RebalanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The rebalance behavior for the cluster. + * When not specified, defaults to `NO_REBALANCE`. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.RebalanceConfig.Mode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Optional. The rebalance behavior for the cluster. + * When not specified, defaults to `NO_REBALANCE`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The rebalance behavior for the cluster. + * When not specified, defaults to `NO_REBALANCE`. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.RebalanceConfig.Mode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. The rebalance behavior for the cluster. + * When not specified, defaults to `NO_REBALANCE`. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.RebalanceConfig.Mode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ManagedKafka\V1\RebalanceConfig\Mode::class); + $this->mode = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/RebalanceConfig/Mode.php b/ManagedKafka/src/V1/RebalanceConfig/Mode.php new file mode 100644 index 000000000000..a30fddfc8651 --- /dev/null +++ b/ManagedKafka/src/V1/RebalanceConfig/Mode.php @@ -0,0 +1,63 @@ +google.cloud.managedkafka.v1.RebalanceConfig.Mode + */ +class Mode +{ + /** + * A mode was not specified. Do not use. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Do not rebalance automatically. + * + * Generated from protobuf enum NO_REBALANCE = 1; + */ + const NO_REBALANCE = 1; + /** + * Automatically rebalance topic partitions among brokers when the + * cluster is scaled up. + * + * Generated from protobuf enum AUTO_REBALANCE_ON_SCALE_UP = 2; + */ + const AUTO_REBALANCE_ON_SCALE_UP = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::NO_REBALANCE => 'NO_REBALANCE', + self::AUTO_REBALANCE_ON_SCALE_UP => 'AUTO_REBALANCE_ON_SCALE_UP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ManagedKafka/src/V1/Topic.php b/ManagedKafka/src/V1/Topic.php new file mode 100644 index 000000000000..da04d6f0f968 --- /dev/null +++ b/ManagedKafka/src/V1/Topic.php @@ -0,0 +1,201 @@ +google.cloud.managedkafka.v1.Topic + */ +class Topic extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the topic. The `topic` segment is used when + * connecting directly to the cluster. Structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. The number of partitions this topic has. The partition count can + * only be increased, not decreased. Please note that if partitions are + * increased for a topic that has a key, the partitioning logic or the + * ordering of the messages will be affected. + * + * Generated from protobuf field int32 partition_count = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $partition_count = 0; + /** + * Required. Immutable. The number of replicas of each partition. A + * replication factor of 3 is recommended for high availability. + * + * Generated from protobuf field int32 replication_factor = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $replication_factor = 0; + /** + * Optional. Configurations for the topic that are overridden from the cluster + * defaults. The key of the map is a Kafka topic property name, for example: + * `cleanup.policy`, `compression.type`. + * + * Generated from protobuf field map configs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the topic. The `topic` segment is used when + * connecting directly to the cluster. Structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} + * @type int $partition_count + * Required. The number of partitions this topic has. The partition count can + * only be increased, not decreased. Please note that if partitions are + * increased for a topic that has a key, the partitioning logic or the + * ordering of the messages will be affected. + * @type int $replication_factor + * Required. Immutable. The number of replicas of each partition. A + * replication factor of 3 is recommended for high availability. + * @type array|\Google\Protobuf\Internal\MapField $configs + * Optional. Configurations for the topic that are overridden from the cluster + * defaults. The key of the map is a Kafka topic property name, for example: + * `cleanup.policy`, `compression.type`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the topic. The `topic` segment is used when + * connecting directly to the cluster. Structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the topic. The `topic` segment is used when + * connecting directly to the cluster. Structured like: + * projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The number of partitions this topic has. The partition count can + * only be increased, not decreased. Please note that if partitions are + * increased for a topic that has a key, the partitioning logic or the + * ordering of the messages will be affected. + * + * Generated from protobuf field int32 partition_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getPartitionCount() + { + return $this->partition_count; + } + + /** + * Required. The number of partitions this topic has. The partition count can + * only be increased, not decreased. Please note that if partitions are + * increased for a topic that has a key, the partitioning logic or the + * ordering of the messages will be affected. + * + * Generated from protobuf field int32 partition_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setPartitionCount($var) + { + GPBUtil::checkInt32($var); + $this->partition_count = $var; + + return $this; + } + + /** + * Required. Immutable. The number of replicas of each partition. A + * replication factor of 3 is recommended for high availability. + * + * Generated from protobuf field int32 replication_factor = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getReplicationFactor() + { + return $this->replication_factor; + } + + /** + * Required. Immutable. The number of replicas of each partition. A + * replication factor of 3 is recommended for high availability. + * + * Generated from protobuf field int32 replication_factor = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setReplicationFactor($var) + { + GPBUtil::checkInt32($var); + $this->replication_factor = $var; + + return $this; + } + + /** + * Optional. Configurations for the topic that are overridden from the cluster + * defaults. The key of the map is a Kafka topic property name, for example: + * `cleanup.policy`, `compression.type`. + * + * Generated from protobuf field map configs = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getConfigs() + { + return $this->configs; + } + + /** + * Optional. Configurations for the topic that are overridden from the cluster + * defaults. The key of the map is a Kafka topic property name, for example: + * `cleanup.policy`, `compression.type`. + * + * Generated from protobuf field map configs = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setConfigs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->configs = $arr; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/UpdateClusterRequest.php b/ManagedKafka/src/V1/UpdateClusterRequest.php new file mode 100644 index 000000000000..93b64c314b65 --- /dev/null +++ b/ManagedKafka/src/V1/UpdateClusterRequest.php @@ -0,0 +1,234 @@ +google.cloud.managedkafka.v1.UpdateClusterRequest + */ +class UpdateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * cluster resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The cluster to update. Its `name` field must be populated. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\ManagedKafka\V1\Cluster $cluster Required. The cluster to update. Its `name` field must be populated. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * cluster resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * + * @return \Google\Cloud\ManagedKafka\V1\UpdateClusterRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ManagedKafka\V1\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * cluster resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * @type \Google\Cloud\ManagedKafka\V1\Cluster $cluster + * Required. The cluster to update. Its `name` field must be populated. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * cluster resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * cluster resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The cluster to update. Its `name` field must be populated. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ManagedKafka\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The cluster to update. Its `name` field must be populated. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ManagedKafka\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ManagedKafka\V1\Cluster::class); + $this->cluster = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID to avoid duplication of requests. If a request times out or + * fails, retrying with the same ID allows the server to recognize the + * previous attempt. For at least 60 minutes, the server ignores duplicate + * requests bearing the same ID. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID + * within 60 minutes of the last request, the server checks if an original + * operation with the same request ID was received. If so, the server ignores + * the second request. + * The request ID must be a valid UUID. A zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/UpdateConsumerGroupRequest.php b/ManagedKafka/src/V1/UpdateConsumerGroupRequest.php new file mode 100644 index 000000000000..dcdd3471a832 --- /dev/null +++ b/ManagedKafka/src/V1/UpdateConsumerGroupRequest.php @@ -0,0 +1,156 @@ +google.cloud.managedkafka.v1.UpdateConsumerGroupRequest + */ +class UpdateConsumerGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * ConsumerGroup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. The + * mask is required and a value of * will update all fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The consumer group to update. Its `name` field must be populated. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.ConsumerGroup consumer_group = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $consumer_group = null; + + /** + * @param \Google\Cloud\ManagedKafka\V1\ConsumerGroup $consumerGroup Required. The consumer group to update. Its `name` field must be populated. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * ConsumerGroup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. The + * mask is required and a value of * will update all fields. + * + * @return \Google\Cloud\ManagedKafka\V1\UpdateConsumerGroupRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ManagedKafka\V1\ConsumerGroup $consumerGroup, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setConsumerGroup($consumerGroup) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * ConsumerGroup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. The + * mask is required and a value of * will update all fields. + * @type \Google\Cloud\ManagedKafka\V1\ConsumerGroup $consumer_group + * Required. The consumer group to update. Its `name` field must be populated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * ConsumerGroup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. The + * mask is required and a value of * will update all fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * ConsumerGroup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. The + * mask is required and a value of * will update all fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The consumer group to update. Its `name` field must be populated. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.ConsumerGroup consumer_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ManagedKafka\V1\ConsumerGroup|null + */ + public function getConsumerGroup() + { + return $this->consumer_group; + } + + public function hasConsumerGroup() + { + return isset($this->consumer_group); + } + + public function clearConsumerGroup() + { + unset($this->consumer_group); + } + + /** + * Required. The consumer group to update. Its `name` field must be populated. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.ConsumerGroup consumer_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ManagedKafka\V1\ConsumerGroup $var + * @return $this + */ + public function setConsumerGroup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ManagedKafka\V1\ConsumerGroup::class); + $this->consumer_group = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/UpdateTopicRequest.php b/ManagedKafka/src/V1/UpdateTopicRequest.php new file mode 100644 index 000000000000..3e2a1f8792eb --- /dev/null +++ b/ManagedKafka/src/V1/UpdateTopicRequest.php @@ -0,0 +1,156 @@ +google.cloud.managedkafka.v1.UpdateTopicRequest + */ +class UpdateTopicRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Topic resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The topic to update. Its `name` field must be populated. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Topic topic = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $topic = null; + + /** + * @param \Google\Cloud\ManagedKafka\V1\Topic $topic Required. The topic to update. Its `name` field must be populated. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Topic resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * + * @return \Google\Cloud\ManagedKafka\V1\UpdateTopicRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ManagedKafka\V1\Topic $topic, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setTopic($topic) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * Topic resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * @type \Google\Cloud\ManagedKafka\V1\Topic $topic + * Required. The topic to update. Its `name` field must be populated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Managedkafka\V1\ManagedKafka::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Topic resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Topic resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. The mask is required and a value of * will update all + * fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The topic to update. Its `name` field must be populated. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Topic topic = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ManagedKafka\V1\Topic|null + */ + public function getTopic() + { + return $this->topic; + } + + public function hasTopic() + { + return isset($this->topic); + } + + public function clearTopic() + { + unset($this->topic); + } + + /** + * Required. The topic to update. Its `name` field must be populated. + * + * Generated from protobuf field .google.cloud.managedkafka.v1.Topic topic = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ManagedKafka\V1\Topic $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ManagedKafka\V1\Topic::class); + $this->topic = $var; + + return $this; + } + +} + diff --git a/ManagedKafka/src/V1/gapic_metadata.json b/ManagedKafka/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..52eab10d2dac --- /dev/null +++ b/ManagedKafka/src/V1/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.managedkafka.v1", + "libraryPackage": "Google\\Cloud\\ManagedKafka\\V1", + "services": { + "ManagedKafka": { + "clients": { + "grpc": { + "libraryClient": "ManagedKafkaGapicClient", + "rpcs": { + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "CreateTopic": { + "methods": [ + "createTopic" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "DeleteConsumerGroup": { + "methods": [ + "deleteConsumerGroup" + ] + }, + "DeleteTopic": { + "methods": [ + "deleteTopic" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetConsumerGroup": { + "methods": [ + "getConsumerGroup" + ] + }, + "GetTopic": { + "methods": [ + "getTopic" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "ListConsumerGroups": { + "methods": [ + "listConsumerGroups" + ] + }, + "ListTopics": { + "methods": [ + "listTopics" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateConsumerGroup": { + "methods": [ + "updateConsumerGroup" + ] + }, + "UpdateTopic": { + "methods": [ + "updateTopic" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ManagedKafka/src/V1/resources/managed_kafka_client_config.json b/ManagedKafka/src/V1/resources/managed_kafka_client_config.json new file mode 100644 index 000000000000..8585444e9db2 --- /dev/null +++ b/ManagedKafka/src/V1/resources/managed_kafka_client_config.json @@ -0,0 +1,124 @@ +{ + "interfaces": { + "google.cloud.managedkafka.v1.ManagedKafka": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateTopic": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteConsumerGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTopic": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConsumerGroup": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTopic": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConsumerGroups": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTopics": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateConsumerGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateTopic": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ManagedKafka/src/V1/resources/managed_kafka_descriptor_config.php b/ManagedKafka/src/V1/resources/managed_kafka_descriptor_config.php new file mode 100644 index 000000000000..37b43b976d5a --- /dev/null +++ b/ManagedKafka/src/V1/resources/managed_kafka_descriptor_config.php @@ -0,0 +1,285 @@ + [ + 'google.cloud.managedkafka.v1.ManagedKafka' => [ + 'CreateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ManagedKafka\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\ManagedKafka\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\ManagedKafka\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ManagedKafka\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\ManagedKafka\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'cluster.name', + 'fieldAccessors' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + 'CreateTopic' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ManagedKafka\V1\Topic', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConsumerGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTopic' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ManagedKafka\V1\Cluster', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConsumerGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ManagedKafka\V1\ConsumerGroup', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetTopic' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ManagedKafka\V1\Topic', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListClusters' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getClusters', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ManagedKafka\V1\ListClustersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListConsumerGroups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConsumerGroups', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ManagedKafka\V1\ListConsumerGroupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListTopics' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTopics', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ManagedKafka\V1\ListTopicsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateConsumerGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ManagedKafka\V1\ConsumerGroup', + 'headerParams' => [ + [ + 'keyName' => 'consumer_group.name', + 'fieldAccessors' => [ + 'getConsumerGroup', + 'getName', + ], + ], + ], + ], + 'UpdateTopic' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ManagedKafka\V1\Topic', + 'headerParams' => [ + [ + 'keyName' => 'topic.name', + 'fieldAccessors' => [ + 'getTopic', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', + 'consumerGroup' => 'projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'location' => 'projects/{project}/locations/{location}', + 'topic' => 'projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}', + ], + ], + ], +]; diff --git a/ManagedKafka/src/V1/resources/managed_kafka_rest_client_config.php b/ManagedKafka/src/V1/resources/managed_kafka_rest_client_config.php new file mode 100644 index 000000000000..f6fcea12de47 --- /dev/null +++ b/ManagedKafka/src/V1/resources/managed_kafka_rest_client_config.php @@ -0,0 +1,277 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.managedkafka.v1.ManagedKafka' => [ + 'CreateCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'cluster_id', + ], + ], + 'CreateTopic' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/topics', + 'body' => 'topic', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'topic_id', + ], + ], + 'DeleteCluster' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteConsumerGroup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/consumerGroups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTopic' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/topics/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConsumerGroup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/consumerGroups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTopic' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/topics/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListClusters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListConsumerGroups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/consumerGroups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTopics' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/topics', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{cluster.name=projects/*/locations/*/clusters/*}', + 'body' => 'cluster', + 'placeholders' => [ + 'cluster.name' => [ + 'getters' => [ + 'getCluster', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateConsumerGroup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{consumer_group.name=projects/*/locations/*/clusters/*/consumerGroups/*}', + 'body' => 'consumer_group', + 'placeholders' => [ + 'consumer_group.name' => [ + 'getters' => [ + 'getConsumerGroup', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateTopic' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{topic.name=projects/*/locations/*/clusters/*/topics/*}', + 'body' => 'topic', + 'placeholders' => [ + 'topic.name' => [ + 'getters' => [ + 'getTopic', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ManagedKafka/tests/Unit/V1/Client/ManagedKafkaClientTest.php b/ManagedKafka/tests/Unit/V1/Client/ManagedKafkaClientTest.php new file mode 100644 index 000000000000..0cdbbd8744e2 --- /dev/null +++ b/ManagedKafka/tests/Unit/V1/Client/ManagedKafkaClientTest.php @@ -0,0 +1,1522 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ManagedKafkaClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ManagedKafkaClient($options); + } + + /** @test */ + public function createClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterCapacityConfig = new CapacityConfig(); + $capacityConfigVcpuCount = 1944563327; + $clusterCapacityConfig->setVcpuCount($capacityConfigVcpuCount); + $capacityConfigMemoryBytes = 743041454; + $clusterCapacityConfig->setMemoryBytes($capacityConfigMemoryBytes); + $cluster->setCapacityConfig($clusterCapacityConfig); + $clusterGcpConfig = new GcpConfig(); + $gcpConfigAccessConfig = new AccessConfig(); + $accessConfigNetworkConfigs = []; + $gcpConfigAccessConfig->setNetworkConfigs($accessConfigNetworkConfigs); + $clusterGcpConfig->setAccessConfig($gcpConfigAccessConfig); + $cluster->setGcpConfig($clusterGcpConfig); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterCapacityConfig = new CapacityConfig(); + $capacityConfigVcpuCount = 1944563327; + $clusterCapacityConfig->setVcpuCount($capacityConfigVcpuCount); + $capacityConfigMemoryBytes = 743041454; + $clusterCapacityConfig->setMemoryBytes($capacityConfigMemoryBytes); + $cluster->setCapacityConfig($clusterCapacityConfig); + $clusterGcpConfig = new GcpConfig(); + $gcpConfigAccessConfig = new AccessConfig(); + $accessConfigNetworkConfigs = []; + $gcpConfigAccessConfig->setNetworkConfigs($accessConfigNetworkConfigs); + $clusterGcpConfig->setAccessConfig($gcpConfigAccessConfig); + $cluster->setGcpConfig($clusterGcpConfig); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTopicTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $partitionCount = 1738969222; + $replicationFactor = 1434332894; + $expectedResponse = new Topic(); + $expectedResponse->setName($name); + $expectedResponse->setPartitionCount($partitionCount); + $expectedResponse->setReplicationFactor($replicationFactor); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $topicId = 'topicId-957291989'; + $topic = new Topic(); + $topicPartitionCount = 2129663148; + $topic->setPartitionCount($topicPartitionCount); + $topicReplicationFactor = 1954252084; + $topic->setReplicationFactor($topicReplicationFactor); + $request = (new CreateTopicRequest()) + ->setParent($formattedParent) + ->setTopicId($topicId) + ->setTopic($topic); + $response = $gapicClient->createTopic($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/CreateTopic', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTopicId(); + $this->assertProtobufEquals($topicId, $actualValue); + $actualValue = $actualRequestObject->getTopic(); + $this->assertProtobufEquals($topic, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTopicExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $topicId = 'topicId-957291989'; + $topic = new Topic(); + $topicPartitionCount = 2129663148; + $topic->setPartitionCount($topicPartitionCount); + $topicReplicationFactor = 1954252084; + $topic->setReplicationFactor($topicReplicationFactor); + $request = (new CreateTopicRequest()) + ->setParent($formattedParent) + ->setTopicId($topicId) + ->setTopic($topic); + try { + $gapicClient->createTopic($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest())->setName($formattedName); + $response = $gapicClient->deleteCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/DeleteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest())->setName($formattedName); + $response = $gapicClient->deleteCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConsumerGroupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->consumerGroupName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[CONSUMER_GROUP]'); + $request = (new DeleteConsumerGroupRequest())->setName($formattedName); + $gapicClient->deleteConsumerGroup($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/DeleteConsumerGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConsumerGroupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->consumerGroupName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[CONSUMER_GROUP]'); + $request = (new DeleteConsumerGroupRequest())->setName($formattedName); + try { + $gapicClient->deleteConsumerGroup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTopicTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->topicName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[TOPIC]'); + $request = (new DeleteTopicRequest())->setName($formattedName); + $gapicClient->deleteTopic($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/DeleteTopic', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTopicExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->topicName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[TOPIC]'); + $request = (new DeleteTopicRequest())->setName($formattedName); + try { + $gapicClient->deleteTopic($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest())->setName($formattedName); + $response = $gapicClient->getCluster($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/GetCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest())->setName($formattedName); + try { + $gapicClient->getCluster($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConsumerGroupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new ConsumerGroup(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->consumerGroupName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[CONSUMER_GROUP]'); + $request = (new GetConsumerGroupRequest())->setName($formattedName); + $response = $gapicClient->getConsumerGroup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/GetConsumerGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConsumerGroupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->consumerGroupName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[CONSUMER_GROUP]'); + $request = (new GetConsumerGroupRequest())->setName($formattedName); + try { + $gapicClient->getConsumerGroup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTopicTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $partitionCount = 1738969222; + $replicationFactor = 1434332894; + $expectedResponse = new Topic(); + $expectedResponse->setName($name2); + $expectedResponse->setPartitionCount($partitionCount); + $expectedResponse->setReplicationFactor($replicationFactor); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->topicName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[TOPIC]'); + $request = (new GetTopicRequest())->setName($formattedName); + $response = $gapicClient->getTopic($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/GetTopic', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTopicExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->topicName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[TOPIC]'); + $request = (new GetTopicRequest())->setName($formattedName); + try { + $gapicClient->getTopic($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clustersElement = new Cluster(); + $clusters = [$clustersElement]; + $expectedResponse = new ListClustersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClusters($clusters); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClustersRequest())->setParent($formattedParent); + $response = $gapicClient->listClusters($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/ListClusters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClustersRequest())->setParent($formattedParent); + try { + $gapicClient->listClusters($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConsumerGroupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $consumerGroupsElement = new ConsumerGroup(); + $consumerGroups = [$consumerGroupsElement]; + $expectedResponse = new ListConsumerGroupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConsumerGroups($consumerGroups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListConsumerGroupsRequest())->setParent($formattedParent); + $response = $gapicClient->listConsumerGroups($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConsumerGroups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/ListConsumerGroups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConsumerGroupsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListConsumerGroupsRequest())->setParent($formattedParent); + try { + $gapicClient->listConsumerGroups($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTopicsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $topicsElement = new Topic(); + $topics = [$topicsElement]; + $expectedResponse = new ListTopicsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTopics($topics); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListTopicsRequest())->setParent($formattedParent); + $response = $gapicClient->listTopics($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTopics()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/ListTopics', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTopicsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListTopicsRequest())->setParent($formattedParent); + try { + $gapicClient->listTopics($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $cluster = new Cluster(); + $clusterCapacityConfig = new CapacityConfig(); + $capacityConfigVcpuCount = 1944563327; + $clusterCapacityConfig->setVcpuCount($capacityConfigVcpuCount); + $capacityConfigMemoryBytes = 743041454; + $clusterCapacityConfig->setMemoryBytes($capacityConfigMemoryBytes); + $cluster->setCapacityConfig($clusterCapacityConfig); + $clusterGcpConfig = new GcpConfig(); + $gcpConfigAccessConfig = new AccessConfig(); + $accessConfigNetworkConfigs = []; + $gcpConfigAccessConfig->setNetworkConfigs($accessConfigNetworkConfigs); + $clusterGcpConfig->setAccessConfig($gcpConfigAccessConfig); + $cluster->setGcpConfig($clusterGcpConfig); + $request = (new UpdateClusterRequest())->setUpdateMask($updateMask)->setCluster($cluster); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/UpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $cluster = new Cluster(); + $clusterCapacityConfig = new CapacityConfig(); + $capacityConfigVcpuCount = 1944563327; + $clusterCapacityConfig->setVcpuCount($capacityConfigVcpuCount); + $capacityConfigMemoryBytes = 743041454; + $clusterCapacityConfig->setMemoryBytes($capacityConfigMemoryBytes); + $cluster->setCapacityConfig($clusterCapacityConfig); + $clusterGcpConfig = new GcpConfig(); + $gcpConfigAccessConfig = new AccessConfig(); + $accessConfigNetworkConfigs = []; + $gcpConfigAccessConfig->setNetworkConfigs($accessConfigNetworkConfigs); + $clusterGcpConfig->setAccessConfig($gcpConfigAccessConfig); + $cluster->setGcpConfig($clusterGcpConfig); + $request = (new UpdateClusterRequest())->setUpdateMask($updateMask)->setCluster($cluster); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateConsumerGroupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new ConsumerGroup(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $updateMask = new FieldMask(); + $consumerGroup = new ConsumerGroup(); + $request = (new UpdateConsumerGroupRequest())->setUpdateMask($updateMask)->setConsumerGroup($consumerGroup); + $response = $gapicClient->updateConsumerGroup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/UpdateConsumerGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualRequestObject->getConsumerGroup(); + $this->assertProtobufEquals($consumerGroup, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateConsumerGroupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $consumerGroup = new ConsumerGroup(); + $request = (new UpdateConsumerGroupRequest())->setUpdateMask($updateMask)->setConsumerGroup($consumerGroup); + try { + $gapicClient->updateConsumerGroup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTopicTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $partitionCount = 1738969222; + $replicationFactor = 1434332894; + $expectedResponse = new Topic(); + $expectedResponse->setName($name); + $expectedResponse->setPartitionCount($partitionCount); + $expectedResponse->setReplicationFactor($replicationFactor); + $transport->addResponse($expectedResponse); + // Mock request + $updateMask = new FieldMask(); + $topic = new Topic(); + $topicPartitionCount = 2129663148; + $topic->setPartitionCount($topicPartitionCount); + $topicReplicationFactor = 1954252084; + $topic->setReplicationFactor($topicReplicationFactor); + $request = (new UpdateTopicRequest())->setUpdateMask($updateMask)->setTopic($topic); + $response = $gapicClient->updateTopic($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/UpdateTopic', $actualFuncCall); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualRequestObject->getTopic(); + $this->assertProtobufEquals($topic, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTopicExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $topic = new Topic(); + $topicPartitionCount = 2129663148; + $topic->setPartitionCount($topicPartitionCount); + $topicReplicationFactor = 1954252084; + $topic->setReplicationFactor($topicReplicationFactor); + $request = (new UpdateTopicRequest())->setUpdateMask($updateMask)->setTopic($topic); + try { + $gapicClient->updateTopic($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [$locationsElement]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createClusterAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterCapacityConfig = new CapacityConfig(); + $capacityConfigVcpuCount = 1944563327; + $clusterCapacityConfig->setVcpuCount($capacityConfigVcpuCount); + $capacityConfigMemoryBytes = 743041454; + $clusterCapacityConfig->setMemoryBytes($capacityConfigMemoryBytes); + $cluster->setCapacityConfig($clusterCapacityConfig); + $clusterGcpConfig = new GcpConfig(); + $gcpConfigAccessConfig = new AccessConfig(); + $accessConfigNetworkConfigs = []; + $gcpConfigAccessConfig->setNetworkConfigs($accessConfigNetworkConfigs); + $clusterGcpConfig->setAccessConfig($gcpConfigAccessConfig); + $cluster->setGcpConfig($clusterGcpConfig); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createClusterAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.managedkafka.v1.ManagedKafka/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/MapsFleetEngine/.OwlBot.yaml b/MapsFleetEngine/.OwlBot.yaml new file mode 100644 index 000000000000..fafaf2e07c34 --- /dev/null +++ b/MapsFleetEngine/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/maps/fleetengine/(v1)/.*-php/(.*) + dest: /owl-bot-staging/MapsFleetEngine/$1/$2 +api-name: MapsFleetEngine diff --git a/MapsFleetEngine/.gitattributes b/MapsFleetEngine/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/MapsFleetEngine/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/MapsFleetEngine/.github/pull_request_template.md b/MapsFleetEngine/.github/pull_request_template.md new file mode 100644 index 000000000000..cdd28d9298bc --- /dev/null +++ b/MapsFleetEngine/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `MapsFleetEngine/src`, and tests in `MapsFleetEngine/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/MapsFleetEngine/CONTRIBUTING.md b/MapsFleetEngine/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/MapsFleetEngine/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/MapsFleetEngine/LICENSE b/MapsFleetEngine/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/MapsFleetEngine/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/MapsFleetEngine/README.md b/MapsFleetEngine/README.md new file mode 100644 index 000000000000..e5751c6ee439 --- /dev/null +++ b/MapsFleetEngine/README.md @@ -0,0 +1,45 @@ +# Google Maps FleetEngine for PHP + +> Idiomatic PHP client for [Google Maps FleetEngine](https://developers.google.com/maps/documentation/transportation-logistics/mobility). + +[![Latest Stable Version](https://poser.pugx.org/google/maps-fleetengine/v/stable)](https://packagist.org/packages/google/maps-fleetengine) [![Packagist](https://img.shields.io/packagist/dm/google/maps-fleetengine.svg)](https://packagist.org/packages/google/maps-fleetengine) + +* [API documentation](https://cloud.google.com/php/docs/reference/maps-fleetengine/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/maps-fleetengine +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-maps-fleetengine/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/maps/documentation/transportation-logistics/mobility). diff --git a/MapsFleetEngine/VERSION b/MapsFleetEngine/VERSION new file mode 100644 index 000000000000..d917d3e26adc --- /dev/null +++ b/MapsFleetEngine/VERSION @@ -0,0 +1 @@ +0.1.2 diff --git a/MapsFleetEngine/composer.json b/MapsFleetEngine/composer.json new file mode 100644 index 000000000000..f20c1a194de8 --- /dev/null +++ b/MapsFleetEngine/composer.json @@ -0,0 +1,31 @@ +{ + "name": "google/maps-fleetengine", + "description": "Google Maps FleetEngine Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Maps\\FleetEngine\\": "src", + "GPBMetadata\\Google\\Maps\\Fleetengine\\": "metadata" + } + }, + "extra": { + "component": { + "id": "maps-fleetengine", + "path": "MapsFleetEngine", + "target": "googleapis/php-maps-fleetengine" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0", + "google/geo-common-protos": "^0.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/MapsFleetEngine/metadata/V1/Fleetengine.php b/MapsFleetEngine/metadata/V1/Fleetengine.php new file mode 100644 index 0000000000000000000000000000000000000000..aaab11d355c6c5870967991c761efe1467f808e4 GIT binary patch literal 4553 zcmbVQOLN=S6%I+sk`85&f-D)59T!oYT2>rtL_1A}vfT0kDjZV)h6JU$!x;=nTv3>S z00sc%Q9AwsnJ)StGFf%keSbiw+b+88y8ocNo_p~iWl@wGZ)D=0?>xTqxR2Mrbth|=ll=pLzNP!VF!34w2m=0dM?K5z3x1#n_~)tVYo=`mrf!)(U_6JynQr+6@z-U~ zMs`0i9b2FP+3u5_=R&BH%06`+jQ>!Gy;3M8NJqC}2gI{=t6L*}-!t97@e~v-l?Eh8 zh@@Y3o=0Y>I`d4}34JV;t~q%q1m1{DS{DS51S8KrV182tACmudr*Kww&2HT!mQf++ z`i1FurP4U6v65-fDRg&LPd_^|`*&B8uu~ghAt9;10IHf;6oEc;e*yN?(_NQ%{@tPK zrAxX^J+SP-bPy|muiltZy32-qrFm?=#|37{?^V6 z6+xJku!pvuM3StdurBwEi1}#!S0AqjF}*h_cpq^Xt@DwB0EybO7*XNMb`NqY@rEWg zf#M)P4TIZ&Mc2Z9)=Yy>3#px@N}5l7_X)QJ%Y%5h(6!9O+A7Rn=+=nvbMeO#f+};6 zZW!DDO+h|3(scT)rnv4in0Ki~K828Majg*gSfD-@FqutzP|5teoaU;qie1WF)EFXm zEL(h9m_mFZwiN|L-RB-bPVe`L?~hd^{&Q=v5McLHy@~&v2pfr6EAm>S&hhi;@JjKs zskTq`OXedjNosieZy8utQF*+;eFKZJx+wH7rfQ0#NEpkFy<}emBXgl+G@`pW z#(f2OR}ap$z|mq27OYY70~2t2(wn8tOfZ zL=#GJtV;{`8SWM23=^jZj&W^>yN~Dd_n4wbagD@{QfS!0%i;;GJX%m0+qR5q5XB zIMWt)0IL_o!$Zm>i%Yi~VorVotFf`Mm;CKu?j?Zl5^TcnhweEWzq6@i*1m*!28vo} zc3iJuCA5$*A9mAh)E;C7DQ{pMK?B#A*7h<=ddtloHK1=`0IL;#U}URu6>WLs-Sppy432Vyw^SZU@ivDQf#UEPMKU zEvAgmGvw5<@HMPXiiTNPy&=T$9Q_@vU4cbOd5pk2CglLuuV_fhZj%|GU3NuS_eZX4 zks)E@EQyr6Inp<$MQ*-pHY70&A-($}?(z~|wg&8Q+Qtj$$mc$V%~-!wK4~0p z59^)wgt(UIH8>9LSLN1({NGcRf2Lq7I^|C}w^y?4ML=Ya4NB?{^}gkdjQCK3&lY*8P1TSx3kqCoG+g$YZAll_0hi{0?SB7Ct39qHne z#edSDhTu|(qD!R-c&T)<-@C^Sq%WT(_sAFFE5O8~0giDzFHCtbV3Ogr{sVjf_#eX~ Bk_P|) literal 0 HcmV?d00001 diff --git a/MapsFleetEngine/metadata/V1/Header.php b/MapsFleetEngine/metadata/V1/Header.php new file mode 100644 index 0000000000000000000000000000000000000000..d4a4374673067696175c76d50570b888da532fed GIT binary patch literal 1410 zcma)6-EPxJ6ebBY;j}>3bcI1e8cL-GSR94DbLpb|mH=t2Bm{vhSrhvt9pQM)cpQmE zz1{a%E_oDgcm=L`3dVLxQ(7c)lku7Jedlk^_xMS87{Xn$j{yoQ(Ib=hL>?ju1()3A zKAFVRDGK89dB}Ve1|h9JIp~i_yVV`tQP7CT!bOwJIG_1gozpO?PJKj)!Hfl1UDT?F zNIeBjIROGX$0(#Ol6|YuLrFa_-=<>RlP@kBxEIx zP))GAfkY8d-)>>#3KmK(EahsNGnC8rC6>y)YlgExTB_8S;j~r?!f+6?N>tiS-aQQw& zeN9=eKDuw5lc{kkOJnH09VvuLtDHDHs~Hqi-WzZ&po>!%rSxJCN}*5Xl#983ISu&W zHv(G65KUDvr$IcWu9`mz9a7Sp@COY%!I|gKkU2gsRDtX2>XKH5k`!u-9Omg8iSt$u ziYNJR4qMNi(QB*iygV3M?Pj;rZMVu7v<)aV`v=39z4oA-Q|(-94Z34>&TCfzp4G?o zVRO*6M&-g*6H3eMbl9|B)JL8Ep!XBsIuz>%twF!rQglTqbo)car4Fy!jdG#!B?q^% zmvmk;8pZ5&L{{!i$Mt#a8OP2_Z>lqXR!vkFl%TAg!{^(CoB7yO7($GFF^wpL*u=Oqzz2g7wmZGiGX+gV8v9`3i4YS8jVXzeM#ump@CoJ6IBPa! zOu~@*W}XxwPNtAV#0T6R?)5>EfJowYbG+MEc-Q%hcTbwz2>Fa82_6-B&}W3z7o}rH zeVj-l)v`_#k8&z0Vf2%#V+V(XC7`fZW5bmDk_wJ9z<~Q;Y~mtk7P}q^Rre0QWHijA zP%^kZE+OWGxgALSm_|~>LltUS6OeNOvlC-;_H34phS(@LTGkbkJ6OgkEWVC$3^I-R zcFsFXa54YOnZ4YlGajuVm_O^N<{0z947P#3R*-SsuILZ4#+eI^GtZj!UmALN6afT> zKmy7qxdLZ|>2UmVtLRLO7kN9g|1(6&3?@qt>~J*Q`PsyB3mRt^S-{nma}({G`hNBe_! z)slV>t&R>`j?-&6DBa%!X_@D@^a9$2mzaE;LXzsxeR^s4~mO z>elA9Sr>}f2a<>?6E3ti8gKuz`&KHq9s7G}t($w$%sgo39<*~0nT^w+|t^L0U>P&#g6UNQj=KDNBOX{8n4Ips_Wfl zch(_Px%9}D8%GWZ@jn0;PL&W9`~w`gz@NYY@n&|{S=Z})w7EFD^WK}^d++z&yx9-# zTOA86NgLFlHes|WH4Y`#p^{~r%v4QXYPhWywI$W;TAEJnj3gDerLFB>l)0fjOnF#SULWRU~|qIFDaKcUOZ_XQXRI z>xxpl_o3z&R=(Nn*HIbTO}fu~UI)wQzXZB{=01bxcrVI?dQqmglDy*ULp#c{ zapFBR!4JQ4yYM!e=xOvI5eKj{xrLEn_dy8f(SqvQJXDGeWTc8i+g<+DqqYOxBQYsl zPG-Ddd6@!kWctO5@1v_W?GiXjjJ9$>4lNT()ae_TI@Le{&3b#cOuI{%!VWE(xG2!q zmm}d4LE;4gKSCERoiH9C!ONLkCNeO5CrCrp zm#s7*l^Rr{jptC@rtq3Jf!hwGbv!+dYv^^y)ZxT54KM0ESu?rSNZTWQ$?W(xcp_4d z(53J*UO@9Z+Yk44E8APj?kClfvbVKUEv;9|l~VEYYdDQ=z(TRKncpfZwMwzH^B`ZV zY;7p~xmbEw*)P>9rJc*M)KAbJ_AD6x2IBZK?IDQ0*Bs7Y;rLw?cLfrK_cxJ|cy72x z`iG&{7ygbRyhDktc6e)WUZpq8z0lx<4;Y~y?P#h_dHdqMY8p5-OJIEMQH3`!M==fk zP~g3YXVJ7p+EDQ@0*f-gfWd-z#mvXlNN_StgRiq)sO_%XRp4;eVfc3(QJwMJ{7_d2 zhK|(7Xl}q&$AWp2Lbfjm9MH?hp_h;Dr1%PY!=PU z==jvYw<5WFEZ|2yIeP2Vqo;rT_4U}T)HQw|dEy-;YjA4yG#KWb?42WVNpWOxCVa(Z zZ{npOA$a~tAPQL+P{ZHE(3F2L;H5~MgU7~6Ah!ib340*yd}Kob(@pG z{S53JE^!>)XNCoXxV|;S2{B5hh`^gm-4j6_!rKV7NFHL@7M)X$-8s7lKgLizL^?d; z@CbL-Fg38AN0s0fDyysClc?wHH zR6Yw=l3UO6$n z>mBZ{)!3(Hp&4+Dk8N#p_&Wk@2BjN9Xf;*`p1vI$UoV$_7)x%54+)t~KK+;ZhlG;& z5|PA(5d3K}aAsxsdk7Bx!w-LBYr#TbOCaQ;m?0ji$1s(Zwmv zF#Ul3LZABBALu`HrvK3CW4@yM97)Cmn>fi!u(bEmzN~$F@tt$(p!?h&wy>-ESm#d8 zIR6xLj%)k2W}Dne&~9Uw)9kKenAqhxu2kius>}%`QCKGQz_O`RWYd9WHArZ3FF7_N%!`xo2aEN_XSADg$N3~mrpxr88Xt$c%y9jBf z>Uo?@P|!QX!9OQBF%6CLeAS2lHVjWOEWcH7X#2k9rL6aaT2r=OuJ8^A_i?K+>Kd+e%?gI#ZY zRr$=pt%~ZKR%f^p<=?YcM#Q$fuJ_4RhVt9$(}9p<6aAJ!567!JW`PtYKTw!_Z+j^d zDXWf=bt5)}b-MKQ8r(q?TGdNi*GT(eUL)LlktEfF%F60d@}l>vAHMhF42=SK8>Jz7 z&qe?~#5!xzSch-c|4O4t(nOefG)cM;o8S^#Glk^8`6R<2)WfHSW@5$A*$MK3`3B9B z&ZUqF4m>sq4{zJdhzMwH zB$CpDdId-}^D(QKhv?oY7#KD>{+ay}FjCBqh>v17Qv6ahJ$8+HGj48bi2De>$F6@8 z;tOf4>E(ICat8dX^5d&TO6-&seC zTHw0a@)fF}c(~JrU+f|{8}*$sS{W+SC+hrofq63uC+fcJR}_aI+7OCRV?kFvF>y45 zYqoi2!txgSA)yDuZH%z{w%!}h)+$;Zj)yHhVkAqEhLh=PLW?MK!3y1gehqt_(uEb& z_1HNIwH#+Do;$o~`OkNnsu@IHzCw$zj4HmZv<=tu`|M(Gj_1`rg6%D)CgJoDsAUS3 zxnfJaz=ZKGq2&vtK12IaUKr1w*Jy1RO31{x4X%ubwT5n6LH7i^iVZyjmT}naNo*0Q zr-;!h=6iG#wsc=Hqrt?^Qs|ALglmSQc5nzKnGJOJ5`yAcuwM~YvP*z99R}wKn(P_) zExQVjZtaYotW6Ng?Y+;J(CXm25>6r5cRU_Wnk?ZGvj&{#89F$WeHZ_E9v&^(cVw2I zum7GvbAw}(c7bp>k|knxXH*xMV4lG~5U((Fv6$VtW*EZKG2_8}R%llwE626sg%q2B z0si>E1VY4@Xa~8A7LKF?sd_9aa$T$`4LL6#HPT-&Qz$73$LR#Kh~@>UUOkcpMXo9} zv3PJ)OHYu;`FdS!3MC~k$B&c5+xr90MM)Owhj0MqLA@k2WKqh?VpU2{QON<|k&@HQ z9mEU>mg?17wOme5GIMCUSUs#&1X)O@=&!s~6e>a~edF=3C{r*@=uDj&Y<6wi?TR`y zRHJQRmwAF(n+35_5v4t)R>{ldYW+|VOM)beWl^XrM^d9E6v^Kuhy+468bZA()FBuU zm1Cg*?$4sByac9*rF4=!6{`)f2t=#$zEE$ZQ;+x1G>J1|7n4DYG`dYuIQ{?~bQ`4u zfQC%Gt{&AT;RmI$pRW_!n%j-^MB$$VT8dVpAq!<8MZV(I5^u_yX$N}TF$iZn_SGXB z2n~1k0MVV3-Aljzm`E1O!k-gMd-Txe$pOZf$)PRKGo5d4{~f<>nvl!wYxdASSCcIq|L>!&EXnSbki4epwGGquT6SzQqP>sMkA$KqnPrLOl9Zg?aD#%tA%!wY zAOI*?aru%{D%bpj9FnT7TvMt1fuyp>%^%1ir&LZkCRJPMc>n|?h$7dk3kA${Pd~o? zrf2ZvN9Mi>H|0&zBbMrrro49~JNra7EyFQ1qa*M2TPm2(b!#m44`#X+m?5^uAHgE8<6qO?C*7SO|~7?!Jk{Y zt>``7(bbOr3v}nH+)_I>LGhDwTm7Eq=tfVb0_C1YR_@ANC!KrCG|>I0vTIa@Mg*hL zDE1s;_0&#do!FYCn~q^saB4Q&CXN?J`ex;>SeB~OTk;CGF`GSMJYMR6v!&{d3E!F9q1{hY|51#3w zmUGRfSGpU>b1Po4(bBsEze>aXaR^RY>LQ1wd_0&sSWR3KDv$@$8ml=@hl%UHffg++ zWlvO=m~h!Q!4l;ohT{GqUL#`Uniy#lBkf=zqz^ZoVO8GfH( zTIjtyWTMy#>|-XfC6HXxO@U4^?(QnyIFC*jF(_uZq4Q=qF3?U};!vPTjJxq;5$Z6= z@R8&nBCwpd2yTm_+^Xc~eFU+Tf%Dwqctnn@%x03QkZh;KY+mlt5}Y?x3u!h!i89f( z$$#V~q)PxIAd23MPYnh#Ff9h+=hzbOhb|%PV#<>Li@@S0alQjvKY=N_KMPCmp{4)L z-GZba6FkKTWIKheL0T*-<>0E;x2T(ng;*qtP1;@hbb#fHq{Doi%_LG>o(CH9p7Q8H z`VbZm)g#lu(zHD>9)uxc$-iQIOWPL^d#4zL7U7R!&eXM6eN$ne6A%rLL!DS%9eckmLt~pLFXJaL z-?R+VXtjh24%g9CNH<_vtZ%7Jy>BaB?42z;ejZ_VjxQj=InC%JcT5l7U4o|?>mwc&5u-H{!Gqt!~ckowzZqT+> zN82w`H9T$a!?NDfI{hY5_Ehba;u!2VF5v<*(gm1iV8Bgg3138|FW{of({#XAOzbM? z=5&!6^lS`+@|^D}itGy4LN~jX-a!<{-=oV>6C=qlaeopiA6PG4hbud!7p3yclCoQP zUd(S5lsK>7CGTw8p2DI?`AVYc zhNXLyxH>G>Zn05@O69re5wEu^;Zz0aN)(|sjDzOcoDa?<7Rpso>5~Do((3~fpGBV+ zGD9&^qZ6@k=8T@g>fY#ej^Ya_IO8kL7(VmTlzsp+?%5!|7>p?%9#WLjQ|>967xQaa z4&qOMIfa^dz+E&C?US$rzR)AD9mR*N32GN@jUBwr=nN1z$s(Wp3}#-6{!qFF)7Y^q zc*+x<_>zk{W-=ZCw|Z@jZ==Rq-Ywhk~{S=EV+8! zR)>1UTj7%}?Vz16!ChBSL<6@bSH*E_c;7UXIzEIbgEUPrYmv@k4sQQ59}%z(&pTsa zPeuFQ@ZQKnT4|6}M%JvaV*S=aCNqpf*jDEf345SyB7F|aw6DO^B=$P29l&2~2%?ye zcWelx3V=@|?cLr{W3mmgU0&4#4`yLnY}~lv%|o>Cll<0Bt+-2fy%@}`*oOTua8eoP7?Jr;6c&We8nF&^jYxlr zzA zksptT8Tv;Iao}utN{9n8o7g^y{^+bE$pD zG3{(ReRy~%S{(20P3=4Tc%5wYn-5IvhFXTzUHdu$330_1ay7XIF3FmDCGzc{cGYX7tUs>bT;b~&t`X5_s+9x-iLR*>-qcq%bD*(8|{*HE#xB`o5??h Jy@j^`{|6n*Y<7QHiiCVI3%v1+hfNtiJKRMN=sgd~KllTCc_o z^iI)0uX=5ucXo6FpqrZK31^`pcn1Q0oJrp_biwmAAHVhuPc|m;l$E?!?pyf(6V%L@LULNQrUgS#+|&wh4? z>3J)xO|nlyY4!`Nui!^0h2}oFDeyLgB3RG;Zw-DPb_}-x%e3qGgpfE`EiL_5T;hHW z_ru0iX>}4liEHWOr}>y&aMgd$G%y6Kyy&bpG)j8&v|CwryUTNbwb9Z@STCuKGT!Q*2P0&j-wEHXl@O zP^Vbh`56HOrTG;+iI0w01J$vyn|b~Y2x+aIYnM!r`x16sGS-k1t&ut~u+)+6)iKT| z*W)>6W%pJ*Nc1m`&opyFuz0p{LaDy34hK!VXLp{-_ZTCZ(?bElMMJrsJ?%5uy8Mgw< zVpnNp67)$C|4`2)xm8Fhoo@McW{GtL5S6CQ$d*>{*cqT z$S00sWIA6P5gZ4JgJka81f&CCm>N*uvZMdItxREMvF`(85x;*=}@eHSC<_(ti?=4G&{6$NthvSj1jC@yDue z+LJ+aRHDObWZ%B-<0Qiy|J;Og`X>v&{+?VaSEYX>vo&_#&(qsvzDn==68pm-e|Ge3 zwAc&&4G3 + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/MapsFleetEngine/samples/V1/TripServiceClient/create_trip.php b/MapsFleetEngine/samples/V1/TripServiceClient/create_trip.php new file mode 100644 index 000000000000..f5eeb732199a --- /dev/null +++ b/MapsFleetEngine/samples/V1/TripServiceClient/create_trip.php @@ -0,0 +1,87 @@ +setParent($formattedParent) + ->setTripId($tripId) + ->setTrip($trip); + + // Call the API and handle any network failures. + try { + /** @var Trip $response */ + $response = $tripServiceClient->createTrip($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 +{ + $formattedParent = TripServiceClient::tripName('[PROVIDER]', '[TRIP]'); + $tripId = '[TRIP_ID]'; + + create_trip_sample($formattedParent, $tripId); +} +// [END fleetengine_v1_generated_TripService_CreateTrip_sync] diff --git a/MapsFleetEngine/samples/V1/TripServiceClient/get_trip.php b/MapsFleetEngine/samples/V1/TripServiceClient/get_trip.php new file mode 100644 index 000000000000..8a9dc4e2c9ff --- /dev/null +++ b/MapsFleetEngine/samples/V1/TripServiceClient/get_trip.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Trip $response */ + $response = $tripServiceClient->getTrip($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 = TripServiceClient::tripName('[PROVIDER]', '[TRIP]'); + + get_trip_sample($formattedName); +} +// [END fleetengine_v1_generated_TripService_GetTrip_sync] diff --git a/MapsFleetEngine/samples/V1/TripServiceClient/report_billable_trip.php b/MapsFleetEngine/samples/V1/TripServiceClient/report_billable_trip.php new file mode 100644 index 000000000000..1a87dbda4869 --- /dev/null +++ b/MapsFleetEngine/samples/V1/TripServiceClient/report_billable_trip.php @@ -0,0 +1,76 @@ +setName($name) + ->setCountryCode($countryCode); + + // Call the API and handle any network failures. + try { + $tripServiceClient->reportBillableTrip($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 +{ + $name = '[NAME]'; + $countryCode = '[COUNTRY_CODE]'; + + report_billable_trip_sample($name, $countryCode); +} +// [END fleetengine_v1_generated_TripService_ReportBillableTrip_sync] diff --git a/MapsFleetEngine/samples/V1/TripServiceClient/search_trips.php b/MapsFleetEngine/samples/V1/TripServiceClient/search_trips.php new file mode 100644 index 000000000000..726d56e085b1 --- /dev/null +++ b/MapsFleetEngine/samples/V1/TripServiceClient/search_trips.php @@ -0,0 +1,78 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $tripServiceClient->searchTrips($request); + + /** @var Trip $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $parent = '[PARENT]'; + + search_trips_sample($parent); +} +// [END fleetengine_v1_generated_TripService_SearchTrips_sync] diff --git a/MapsFleetEngine/samples/V1/TripServiceClient/update_trip.php b/MapsFleetEngine/samples/V1/TripServiceClient/update_trip.php new file mode 100644 index 000000000000..82e653ec835f --- /dev/null +++ b/MapsFleetEngine/samples/V1/TripServiceClient/update_trip.php @@ -0,0 +1,78 @@ +setName($name) + ->setTrip($trip) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Trip $response */ + $response = $tripServiceClient->updateTrip($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 +{ + $name = '[NAME]'; + + update_trip_sample($name); +} +// [END fleetengine_v1_generated_TripService_UpdateTrip_sync] diff --git a/MapsFleetEngine/samples/V1/VehicleServiceClient/create_vehicle.php b/MapsFleetEngine/samples/V1/VehicleServiceClient/create_vehicle.php new file mode 100644 index 000000000000..ef62555f9cc2 --- /dev/null +++ b/MapsFleetEngine/samples/V1/VehicleServiceClient/create_vehicle.php @@ -0,0 +1,116 @@ +setVehicleType($vehicleVehicleType); + $request = (new CreateVehicleRequest()) + ->setParent($parent) + ->setVehicleId($vehicleId) + ->setVehicle($vehicle); + + // Call the API and handle any network failures. + try { + /** @var Vehicle $response */ + $response = $vehicleServiceClient->createVehicle($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 +{ + $parent = '[PARENT]'; + $vehicleId = '[VEHICLE_ID]'; + + create_vehicle_sample($parent, $vehicleId); +} +// [END fleetengine_v1_generated_VehicleService_CreateVehicle_sync] diff --git a/MapsFleetEngine/samples/V1/VehicleServiceClient/get_vehicle.php b/MapsFleetEngine/samples/V1/VehicleServiceClient/get_vehicle.php new file mode 100644 index 000000000000..7e0840142f46 --- /dev/null +++ b/MapsFleetEngine/samples/V1/VehicleServiceClient/get_vehicle.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Vehicle $response */ + $response = $vehicleServiceClient->getVehicle($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 = VehicleServiceClient::vehicleName('[PROVIDER]', '[VEHICLE]'); + + get_vehicle_sample($formattedName); +} +// [END fleetengine_v1_generated_VehicleService_GetVehicle_sync] diff --git a/MapsFleetEngine/samples/V1/VehicleServiceClient/list_vehicles.php b/MapsFleetEngine/samples/V1/VehicleServiceClient/list_vehicles.php new file mode 100644 index 000000000000..0d0629cd08e6 --- /dev/null +++ b/MapsFleetEngine/samples/V1/VehicleServiceClient/list_vehicles.php @@ -0,0 +1,85 @@ +setParent($parent) + ->setVehicleTypeCategories($vehicleTypeCategories); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $vehicleServiceClient->listVehicles($request); + + /** @var Vehicle $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $parent = '[PARENT]'; + $vehicleTypeCategoriesElement = Category::UNKNOWN; + + list_vehicles_sample($parent, $vehicleTypeCategoriesElement); +} +// [END fleetengine_v1_generated_VehicleService_ListVehicles_sync] diff --git a/MapsFleetEngine/samples/V1/VehicleServiceClient/search_vehicles.php b/MapsFleetEngine/samples/V1/VehicleServiceClient/search_vehicles.php new file mode 100644 index 000000000000..0671afa2ba59 --- /dev/null +++ b/MapsFleetEngine/samples/V1/VehicleServiceClient/search_vehicles.php @@ -0,0 +1,120 @@ +setPoint($pickupPointPoint); + $tripTypes = [$tripTypesElement,]; + $vehicleTypes = [new VehicleType()]; + $request = (new SearchVehiclesRequest()) + ->setParent($parent) + ->setPickupPoint($pickupPoint) + ->setPickupRadiusMeters($pickupRadiusMeters) + ->setCount($count) + ->setMinimumCapacity($minimumCapacity) + ->setTripTypes($tripTypes) + ->setVehicleTypes($vehicleTypes) + ->setOrderBy($orderBy); + + // Call the API and handle any network failures. + try { + /** @var SearchVehiclesResponse $response */ + $response = $vehicleServiceClient->searchVehicles($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 +{ + $parent = '[PARENT]'; + $pickupRadiusMeters = 0; + $count = 0; + $minimumCapacity = 0; + $tripTypesElement = TripType::UNKNOWN_TRIP_TYPE; + $orderBy = VehicleMatchOrder::UNKNOWN_VEHICLE_MATCH_ORDER; + + search_vehicles_sample( + $parent, + $pickupRadiusMeters, + $count, + $minimumCapacity, + $tripTypesElement, + $orderBy + ); +} +// [END fleetengine_v1_generated_VehicleService_SearchVehicles_sync] diff --git a/MapsFleetEngine/samples/V1/VehicleServiceClient/update_vehicle.php b/MapsFleetEngine/samples/V1/VehicleServiceClient/update_vehicle.php new file mode 100644 index 000000000000..740fb26c6caa --- /dev/null +++ b/MapsFleetEngine/samples/V1/VehicleServiceClient/update_vehicle.php @@ -0,0 +1,98 @@ +setVehicleType($vehicleVehicleType); + $updateMask = new FieldMask(); + $request = (new UpdateVehicleRequest()) + ->setName($name) + ->setVehicle($vehicle) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Vehicle $response */ + $response = $vehicleServiceClient->updateVehicle($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 +{ + $name = '[NAME]'; + + update_vehicle_sample($name); +} +// [END fleetengine_v1_generated_VehicleService_UpdateVehicle_sync] diff --git a/MapsFleetEngine/samples/V1/VehicleServiceClient/update_vehicle_attributes.php b/MapsFleetEngine/samples/V1/VehicleServiceClient/update_vehicle_attributes.php new file mode 100644 index 000000000000..9c8ed7a0c76a --- /dev/null +++ b/MapsFleetEngine/samples/V1/VehicleServiceClient/update_vehicle_attributes.php @@ -0,0 +1,80 @@ +setName($name) + ->setAttributes($attributes); + + // Call the API and handle any network failures. + try { + /** @var UpdateVehicleAttributesResponse $response */ + $response = $vehicleServiceClient->updateVehicleAttributes($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 +{ + $name = '[NAME]'; + + update_vehicle_attributes_sample($name); +} +// [END fleetengine_v1_generated_VehicleService_UpdateVehicleAttributes_sync] diff --git a/MapsFleetEngine/src/V1/BatteryInfo.php b/MapsFleetEngine/src/V1/BatteryInfo.php new file mode 100644 index 000000000000..ae3acb5ba812 --- /dev/null +++ b/MapsFleetEngine/src/V1/BatteryInfo.php @@ -0,0 +1,135 @@ +maps.fleetengine.v1.BatteryInfo + */ +class BatteryInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Status of the battery, whether full or charging etc. + * + * Generated from protobuf field .maps.fleetengine.v1.BatteryStatus battery_status = 1; + */ + protected $battery_status = 0; + /** + * Status of battery power source. + * + * Generated from protobuf field .maps.fleetengine.v1.PowerSource power_source = 2; + */ + protected $power_source = 0; + /** + * Current battery percentage [0-100]. + * + * Generated from protobuf field float battery_percentage = 3; + */ + protected $battery_percentage = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $battery_status + * Status of the battery, whether full or charging etc. + * @type int $power_source + * Status of battery power source. + * @type float $battery_percentage + * Current battery percentage [0-100]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Vehicles::initOnce(); + parent::__construct($data); + } + + /** + * Status of the battery, whether full or charging etc. + * + * Generated from protobuf field .maps.fleetengine.v1.BatteryStatus battery_status = 1; + * @return int + */ + public function getBatteryStatus() + { + return $this->battery_status; + } + + /** + * Status of the battery, whether full or charging etc. + * + * Generated from protobuf field .maps.fleetengine.v1.BatteryStatus battery_status = 1; + * @param int $var + * @return $this + */ + public function setBatteryStatus($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\BatteryStatus::class); + $this->battery_status = $var; + + return $this; + } + + /** + * Status of battery power source. + * + * Generated from protobuf field .maps.fleetengine.v1.PowerSource power_source = 2; + * @return int + */ + public function getPowerSource() + { + return $this->power_source; + } + + /** + * Status of battery power source. + * + * Generated from protobuf field .maps.fleetengine.v1.PowerSource power_source = 2; + * @param int $var + * @return $this + */ + public function setPowerSource($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\PowerSource::class); + $this->power_source = $var; + + return $this; + } + + /** + * Current battery percentage [0-100]. + * + * Generated from protobuf field float battery_percentage = 3; + * @return float + */ + public function getBatteryPercentage() + { + return $this->battery_percentage; + } + + /** + * Current battery percentage [0-100]. + * + * Generated from protobuf field float battery_percentage = 3; + * @param float $var + * @return $this + */ + public function setBatteryPercentage($var) + { + GPBUtil::checkFloat($var); + $this->battery_percentage = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/BatteryStatus.php b/MapsFleetEngine/src/V1/BatteryStatus.php new file mode 100644 index 000000000000..618208d92d46 --- /dev/null +++ b/MapsFleetEngine/src/V1/BatteryStatus.php @@ -0,0 +1,82 @@ +maps.fleetengine.v1.BatteryStatus + */ +class BatteryStatus +{ + /** + * Battery status unknown. + * + * Generated from protobuf enum UNKNOWN_BATTERY_STATUS = 0; + */ + const UNKNOWN_BATTERY_STATUS = 0; + /** + * Battery is being charged. + * + * Generated from protobuf enum BATTERY_STATUS_CHARGING = 1; + */ + const BATTERY_STATUS_CHARGING = 1; + /** + * Battery is discharging. + * + * Generated from protobuf enum BATTERY_STATUS_DISCHARGING = 2; + */ + const BATTERY_STATUS_DISCHARGING = 2; + /** + * Battery is full. + * + * Generated from protobuf enum BATTERY_STATUS_FULL = 3; + */ + const BATTERY_STATUS_FULL = 3; + /** + * Battery is not charging. + * + * Generated from protobuf enum BATTERY_STATUS_NOT_CHARGING = 4; + */ + const BATTERY_STATUS_NOT_CHARGING = 4; + /** + * Battery is low on power. + * + * Generated from protobuf enum BATTERY_STATUS_POWER_LOW = 5; + */ + const BATTERY_STATUS_POWER_LOW = 5; + + private static $valueToName = [ + self::UNKNOWN_BATTERY_STATUS => 'UNKNOWN_BATTERY_STATUS', + self::BATTERY_STATUS_CHARGING => 'BATTERY_STATUS_CHARGING', + self::BATTERY_STATUS_DISCHARGING => 'BATTERY_STATUS_DISCHARGING', + self::BATTERY_STATUS_FULL => 'BATTERY_STATUS_FULL', + self::BATTERY_STATUS_NOT_CHARGING => 'BATTERY_STATUS_NOT_CHARGING', + self::BATTERY_STATUS_POWER_LOW => 'BATTERY_STATUS_POWER_LOW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/BillingPlatformIdentifier.php b/MapsFleetEngine/src/V1/BillingPlatformIdentifier.php new file mode 100644 index 000000000000..6b3b7e454bdd --- /dev/null +++ b/MapsFleetEngine/src/V1/BillingPlatformIdentifier.php @@ -0,0 +1,82 @@ +maps.fleetengine.v1.BillingPlatformIdentifier + */ +class BillingPlatformIdentifier +{ + /** + * Default. Used for unspecified platforms. + * + * Generated from protobuf enum BILLING_PLATFORM_IDENTIFIER_UNSPECIFIED = 0; + */ + const BILLING_PLATFORM_IDENTIFIER_UNSPECIFIED = 0; + /** + * The platform is a client server. + * + * Generated from protobuf enum SERVER = 1; + */ + const SERVER = 1; + /** + * The platform is a web browser. + * + * Generated from protobuf enum WEB = 2; + */ + const WEB = 2; + /** + * The platform is an Android mobile device. + * + * Generated from protobuf enum ANDROID = 3; + */ + const ANDROID = 3; + /** + * The platform is an IOS mobile device. + * + * Generated from protobuf enum IOS = 4; + */ + const IOS = 4; + /** + * Other platforms that are not listed in this enumeration. + * + * Generated from protobuf enum OTHERS = 5; + */ + const OTHERS = 5; + + private static $valueToName = [ + self::BILLING_PLATFORM_IDENTIFIER_UNSPECIFIED => 'BILLING_PLATFORM_IDENTIFIER_UNSPECIFIED', + self::SERVER => 'SERVER', + self::WEB => 'WEB', + self::ANDROID => 'ANDROID', + self::IOS => 'IOS', + self::OTHERS => 'OTHERS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/Client/TripServiceClient.php b/MapsFleetEngine/src/V1/Client/TripServiceClient.php new file mode 100644 index 000000000000..22ab8f6bb049 --- /dev/null +++ b/MapsFleetEngine/src/V1/Client/TripServiceClient.php @@ -0,0 +1,346 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/trip_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/trip_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/trip_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/trip_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a trip + * resource. + * + * @param string $provider + * @param string $trip + * + * @return string The formatted trip resource. + */ + public static function tripName(string $provider, string $trip): string + { + return self::getPathTemplate('trip')->render([ + 'provider' => $provider, + 'trip' => $trip, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - trip: providers/{provider}/trips/{trip} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'fleetengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a trip in the Fleet Engine and returns the new trip. + * + * The async variant is {@see TripServiceClient::createTripAsync()} . + * + * @example samples/V1/TripServiceClient/create_trip.php + * + * @param CreateTripRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Trip + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTrip(CreateTripRequest $request, array $callOptions = []): Trip + { + return $this->startApiCall('CreateTrip', $request, $callOptions)->wait(); + } + + /** + * Get information about a single trip. + * + * The async variant is {@see TripServiceClient::getTripAsync()} . + * + * @example samples/V1/TripServiceClient/get_trip.php + * + * @param GetTripRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Trip + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTrip(GetTripRequest $request, array $callOptions = []): Trip + { + return $this->startApiCall('GetTrip', $request, $callOptions)->wait(); + } + + /** + * Report billable trip usage. + * + * The async variant is {@see TripServiceClient::reportBillableTripAsync()} . + * + * @example samples/V1/TripServiceClient/report_billable_trip.php + * + * @param ReportBillableTripRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function reportBillableTrip(ReportBillableTripRequest $request, array $callOptions = []): void + { + $this->startApiCall('ReportBillableTrip', $request, $callOptions)->wait(); + } + + /** + * Get all the trips for a specific vehicle. + * + * The async variant is {@see TripServiceClient::searchTripsAsync()} . + * + * @example samples/V1/TripServiceClient/search_trips.php + * + * @param SearchTripsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchTrips(SearchTripsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchTrips', $request, $callOptions); + } + + /** + * Updates trip data. + * + * The async variant is {@see TripServiceClient::updateTripAsync()} . + * + * @example samples/V1/TripServiceClient/update_trip.php + * + * @param UpdateTripRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Trip + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateTrip(UpdateTripRequest $request, array $callOptions = []): Trip + { + return $this->startApiCall('UpdateTrip', $request, $callOptions)->wait(); + } +} diff --git a/MapsFleetEngine/src/V1/Client/VehicleServiceClient.php b/MapsFleetEngine/src/V1/Client/VehicleServiceClient.php new file mode 100644 index 000000000000..4d33b5c894e9 --- /dev/null +++ b/MapsFleetEngine/src/V1/Client/VehicleServiceClient.php @@ -0,0 +1,430 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/vehicle_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/vehicle_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/vehicle_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/vehicle_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a vehicle + * resource. + * + * @param string $provider + * @param string $vehicle + * + * @return string The formatted vehicle resource. + */ + public static function vehicleName(string $provider, string $vehicle): string + { + return self::getPathTemplate('vehicle')->render([ + 'provider' => $provider, + 'vehicle' => $vehicle, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - vehicle: providers/{provider}/vehicles/{vehicle} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'fleetengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Instantiates a new vehicle associated with an on-demand rideshare or + * deliveries provider. Each `Vehicle` must have a unique vehicle ID. + * + * The following `Vehicle` fields are required when creating a `Vehicle`: + * + * * `vehicleState` + * * `supportedTripTypes` + * * `maximumCapacity` + * * `vehicleType` + * + * The following `Vehicle` fields are ignored when creating a `Vehicle`: + * + * * `name` + * * `currentTrips` + * * `availableCapacity` + * * `current_route_segment` + * * `current_route_segment_end_point` + * * `current_route_segment_version` + * * `current_route_segment_traffic` + * * `route` + * * `waypoints` + * * `waypoints_version` + * * `remaining_distance_meters` + * * `remaining_time_seconds` + * * `eta_to_next_waypoint` + * * `navigation_status` + * + * All other fields are optional and used if provided. + * + * The async variant is {@see VehicleServiceClient::createVehicleAsync()} . + * + * @example samples/V1/VehicleServiceClient/create_vehicle.php + * + * @param CreateVehicleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Vehicle + * + * @throws ApiException Thrown if the API call fails. + */ + public function createVehicle(CreateVehicleRequest $request, array $callOptions = []): Vehicle + { + return $this->startApiCall('CreateVehicle', $request, $callOptions)->wait(); + } + + /** + * Returns a vehicle from the Fleet Engine. + * + * The async variant is {@see VehicleServiceClient::getVehicleAsync()} . + * + * @example samples/V1/VehicleServiceClient/get_vehicle.php + * + * @param GetVehicleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Vehicle + * + * @throws ApiException Thrown if the API call fails. + */ + public function getVehicle(GetVehicleRequest $request, array $callOptions = []): Vehicle + { + return $this->startApiCall('GetVehicle', $request, $callOptions)->wait(); + } + + /** + * Returns a paginated list of vehicles associated with + * a provider that match the request options. + * + * The async variant is {@see VehicleServiceClient::listVehiclesAsync()} . + * + * @example samples/V1/VehicleServiceClient/list_vehicles.php + * + * @param ListVehiclesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVehicles(ListVehiclesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListVehicles', $request, $callOptions); + } + + /** + * Returns a list of vehicles that match the request options. + * + * The async variant is {@see VehicleServiceClient::searchVehiclesAsync()} . + * + * @example samples/V1/VehicleServiceClient/search_vehicles.php + * + * @param SearchVehiclesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SearchVehiclesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchVehicles(SearchVehiclesRequest $request, array $callOptions = []): SearchVehiclesResponse + { + return $this->startApiCall('SearchVehicles', $request, $callOptions)->wait(); + } + + /** + * Writes updated vehicle data to the Fleet Engine. + * + * When updating a `Vehicle`, the following fields cannot be updated since + * they are managed by the server: + * + * * `currentTrips` + * * `availableCapacity` + * * `current_route_segment_version` + * * `waypoints_version` + * + * The vehicle `name` also cannot be updated. + * + * If the `attributes` field is updated, **all** the vehicle's attributes are + * replaced with the attributes provided in the request. If you want to update + * only some attributes, see the `UpdateVehicleAttributes` method. Likewise, + * the `waypoints` field can be updated, but must contain all the waypoints + * currently on the vehicle, and no other waypoints. + * + * The async variant is {@see VehicleServiceClient::updateVehicleAsync()} . + * + * @example samples/V1/VehicleServiceClient/update_vehicle.php + * + * @param UpdateVehicleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Vehicle + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateVehicle(UpdateVehicleRequest $request, array $callOptions = []): Vehicle + { + return $this->startApiCall('UpdateVehicle', $request, $callOptions)->wait(); + } + + /** + * Partially updates a vehicle's attributes. + * Only the attributes mentioned in the request will be updated, other + * attributes will NOT be altered. Note: this is different in `UpdateVehicle`, + * where the whole `attributes` field will be replaced by the one in + * `UpdateVehicleRequest`, attributes not in the request would be removed. + * + * The async variant is {@see VehicleServiceClient::updateVehicleAttributesAsync()} + * . + * + * @example samples/V1/VehicleServiceClient/update_vehicle_attributes.php + * + * @param UpdateVehicleAttributesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UpdateVehicleAttributesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateVehicleAttributes( + UpdateVehicleAttributesRequest $request, + array $callOptions = [] + ): UpdateVehicleAttributesResponse { + return $this->startApiCall('UpdateVehicleAttributes', $request, $callOptions)->wait(); + } +} diff --git a/MapsFleetEngine/src/V1/ConsumableTrafficPolyline.php b/MapsFleetEngine/src/V1/ConsumableTrafficPolyline.php new file mode 100644 index 000000000000..e9320fa4cdb4 --- /dev/null +++ b/MapsFleetEngine/src/V1/ConsumableTrafficPolyline.php @@ -0,0 +1,117 @@ +maps.fleetengine.v1.ConsumableTrafficPolyline + */ +class ConsumableTrafficPolyline extends \Google\Protobuf\Internal\Message +{ + /** + * Traffic speed along the path from the previous waypoint to the current + * waypoint. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.SpeedReadingInterval speed_reading_interval = 1; + */ + private $speed_reading_interval; + /** + * The path the driver is taking from the previous waypoint to the current + * waypoint. This path has landmarks in it so clients can show traffic markers + * along the path (see `speed_reading_interval`). Decoding is not yet + * supported. + * + * Generated from protobuf field string encoded_path_to_waypoint = 2; + */ + protected $encoded_path_to_waypoint = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\V1\SpeedReadingInterval>|\Google\Protobuf\Internal\RepeatedField $speed_reading_interval + * Traffic speed along the path from the previous waypoint to the current + * waypoint. + * @type string $encoded_path_to_waypoint + * The path the driver is taking from the previous waypoint to the current + * waypoint. This path has landmarks in it so clients can show traffic markers + * along the path (see `speed_reading_interval`). Decoding is not yet + * supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Traffic::initOnce(); + parent::__construct($data); + } + + /** + * Traffic speed along the path from the previous waypoint to the current + * waypoint. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.SpeedReadingInterval speed_reading_interval = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpeedReadingInterval() + { + return $this->speed_reading_interval; + } + + /** + * Traffic speed along the path from the previous waypoint to the current + * waypoint. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.SpeedReadingInterval speed_reading_interval = 1; + * @param array<\Google\Maps\FleetEngine\V1\SpeedReadingInterval>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpeedReadingInterval($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\SpeedReadingInterval::class); + $this->speed_reading_interval = $arr; + + return $this; + } + + /** + * The path the driver is taking from the previous waypoint to the current + * waypoint. This path has landmarks in it so clients can show traffic markers + * along the path (see `speed_reading_interval`). Decoding is not yet + * supported. + * + * Generated from protobuf field string encoded_path_to_waypoint = 2; + * @return string + */ + public function getEncodedPathToWaypoint() + { + return $this->encoded_path_to_waypoint; + } + + /** + * The path the driver is taking from the previous waypoint to the current + * waypoint. This path has landmarks in it so clients can show traffic markers + * along the path (see `speed_reading_interval`). Decoding is not yet + * supported. + * + * Generated from protobuf field string encoded_path_to_waypoint = 2; + * @param string $var + * @return $this + */ + public function setEncodedPathToWaypoint($var) + { + GPBUtil::checkString($var, True); + $this->encoded_path_to_waypoint = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/CreateTripRequest.php b/MapsFleetEngine/src/V1/CreateTripRequest.php new file mode 100644 index 000000000000..d98b71603eaf --- /dev/null +++ b/MapsFleetEngine/src/V1/CreateTripRequest.php @@ -0,0 +1,329 @@ +maps.fleetengine.v1.CreateTripRequest + */ +class CreateTripRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Unique Trip ID. + * Subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string trip_id = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $trip_id = ''; + /** + * Required. Trip entity to create. + * When creating a Trip, the following fields are required: + * * `trip_type` + * * `pickup_point` + * The following fields are used if you provide them: + * * `number_of_passengers` + * * `vehicle_id` + * * `dropoff_point` + * * `intermediate_destinations` + * * `vehicle_waypoints` + * All other Trip fields are ignored. For example, all trips start with a + * `trip_status` of `NEW` even if you pass in a `trip_status` of `CANCELED` in + * the creation request. + * Only `EXCLUSIVE` trips support `intermediate_destinations`. + * When `vehicle_id` is set for a shared trip, you must supply + * the list of `Trip.vehicle_waypoints` to specify the order of the remaining + * waypoints for the vehicle, otherwise the waypoint order will be + * undetermined. + * When you specify `Trip.vehicle_waypoints`, the list must contain all + * the remaining waypoints of the vehicle's trips, with no extra waypoints. + * You must order these waypoints such that for a given trip, the pickup + * point is before intermediate destinations, and all intermediate + * destinations come before the drop-off point. An `EXCLUSIVE` trip's + * waypoints must not interleave with any other trips. + * The `trip_id`, `waypoint_type` and `location` fields are used, and all + * other TripWaypoint fields in `vehicle_waypoints` are ignored. + * + * Generated from protobuf field .maps.fleetengine.v1.Trip trip = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $trip = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $parent + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * @type string $trip_id + * Required. Unique Trip ID. + * Subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * @type \Google\Maps\FleetEngine\V1\Trip $trip + * Required. Trip entity to create. + * When creating a Trip, the following fields are required: + * * `trip_type` + * * `pickup_point` + * The following fields are used if you provide them: + * * `number_of_passengers` + * * `vehicle_id` + * * `dropoff_point` + * * `intermediate_destinations` + * * `vehicle_waypoints` + * All other Trip fields are ignored. For example, all trips start with a + * `trip_status` of `NEW` even if you pass in a `trip_status` of `CANCELED` in + * the creation request. + * Only `EXCLUSIVE` trips support `intermediate_destinations`. + * When `vehicle_id` is set for a shared trip, you must supply + * the list of `Trip.vehicle_waypoints` to specify the order of the remaining + * waypoints for the vehicle, otherwise the waypoint order will be + * undetermined. + * When you specify `Trip.vehicle_waypoints`, the list must contain all + * the remaining waypoints of the vehicle's trips, with no extra waypoints. + * You must order these waypoints such that for a given trip, the pickup + * point is before intermediate destinations, and all intermediate + * destinations come before the drop-off point. An `EXCLUSIVE` trip's + * waypoints must not interleave with any other trips. + * The `trip_id`, `waypoint_type` and `location` fields are used, and all + * other TripWaypoint fields in `vehicle_waypoints` are ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\TripApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Unique Trip ID. + * Subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string trip_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTripId() + { + return $this->trip_id; + } + + /** + * Required. Unique Trip ID. + * Subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string trip_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTripId($var) + { + GPBUtil::checkString($var, True); + $this->trip_id = $var; + + return $this; + } + + /** + * Required. Trip entity to create. + * When creating a Trip, the following fields are required: + * * `trip_type` + * * `pickup_point` + * The following fields are used if you provide them: + * * `number_of_passengers` + * * `vehicle_id` + * * `dropoff_point` + * * `intermediate_destinations` + * * `vehicle_waypoints` + * All other Trip fields are ignored. For example, all trips start with a + * `trip_status` of `NEW` even if you pass in a `trip_status` of `CANCELED` in + * the creation request. + * Only `EXCLUSIVE` trips support `intermediate_destinations`. + * When `vehicle_id` is set for a shared trip, you must supply + * the list of `Trip.vehicle_waypoints` to specify the order of the remaining + * waypoints for the vehicle, otherwise the waypoint order will be + * undetermined. + * When you specify `Trip.vehicle_waypoints`, the list must contain all + * the remaining waypoints of the vehicle's trips, with no extra waypoints. + * You must order these waypoints such that for a given trip, the pickup + * point is before intermediate destinations, and all intermediate + * destinations come before the drop-off point. An `EXCLUSIVE` trip's + * waypoints must not interleave with any other trips. + * The `trip_id`, `waypoint_type` and `location` fields are used, and all + * other TripWaypoint fields in `vehicle_waypoints` are ignored. + * + * Generated from protobuf field .maps.fleetengine.v1.Trip trip = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\V1\Trip|null + */ + public function getTrip() + { + return $this->trip; + } + + public function hasTrip() + { + return isset($this->trip); + } + + public function clearTrip() + { + unset($this->trip); + } + + /** + * Required. Trip entity to create. + * When creating a Trip, the following fields are required: + * * `trip_type` + * * `pickup_point` + * The following fields are used if you provide them: + * * `number_of_passengers` + * * `vehicle_id` + * * `dropoff_point` + * * `intermediate_destinations` + * * `vehicle_waypoints` + * All other Trip fields are ignored. For example, all trips start with a + * `trip_status` of `NEW` even if you pass in a `trip_status` of `CANCELED` in + * the creation request. + * Only `EXCLUSIVE` trips support `intermediate_destinations`. + * When `vehicle_id` is set for a shared trip, you must supply + * the list of `Trip.vehicle_waypoints` to specify the order of the remaining + * waypoints for the vehicle, otherwise the waypoint order will be + * undetermined. + * When you specify `Trip.vehicle_waypoints`, the list must contain all + * the remaining waypoints of the vehicle's trips, with no extra waypoints. + * You must order these waypoints such that for a given trip, the pickup + * point is before intermediate destinations, and all intermediate + * destinations come before the drop-off point. An `EXCLUSIVE` trip's + * waypoints must not interleave with any other trips. + * The `trip_id`, `waypoint_type` and `location` fields are used, and all + * other TripWaypoint fields in `vehicle_waypoints` are ignored. + * + * Generated from protobuf field .maps.fleetengine.v1.Trip trip = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\V1\Trip $var + * @return $this + */ + public function setTrip($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\Trip::class); + $this->trip = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/CreateVehicleRequest.php b/MapsFleetEngine/src/V1/CreateVehicleRequest.php new file mode 100644 index 000000000000..5cb20e991a11 --- /dev/null +++ b/MapsFleetEngine/src/V1/CreateVehicleRequest.php @@ -0,0 +1,313 @@ +maps.fleetengine.v1.CreateVehicleRequest + */ +class CreateVehicleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Unique Vehicle ID. + * Subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string vehicle_id = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vehicle_id = ''; + /** + * Required. The Vehicle entity to create. When creating a Vehicle, the + * following fields are required: + * * `vehicleState` + * * `supportedTripTypes` + * * `maximumCapacity` + * * `vehicleType` + * When creating a Vehicle, the following fields are ignored: + * * `name` + * * `currentTrips` + * * `availableCapacity` + * * `current_route_segment` + * * `current_route_segment_end_point` + * * `current_route_segment_version` + * * `current_route_segment_traffic` + * * `route` + * * `waypoints` + * * `waypoints_version` + * * `remaining_distance_meters` + * * `remaining_time_seconds` + * * `eta_to_next_waypoint` + * * `navigation_status` + * All other fields are optional and used if provided. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle vehicle = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vehicle = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $parent + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * @type string $vehicle_id + * Required. Unique Vehicle ID. + * Subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * @type \Google\Maps\FleetEngine\V1\Vehicle $vehicle + * Required. The Vehicle entity to create. When creating a Vehicle, the + * following fields are required: + * * `vehicleState` + * * `supportedTripTypes` + * * `maximumCapacity` + * * `vehicleType` + * When creating a Vehicle, the following fields are ignored: + * * `name` + * * `currentTrips` + * * `availableCapacity` + * * `current_route_segment` + * * `current_route_segment_end_point` + * * `current_route_segment_version` + * * `current_route_segment_traffic` + * * `route` + * * `waypoints` + * * `waypoints_version` + * * `remaining_distance_meters` + * * `remaining_time_seconds` + * * `eta_to_next_waypoint` + * * `navigation_status` + * All other fields are optional and used if provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Unique Vehicle ID. + * Subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string vehicle_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVehicleId() + { + return $this->vehicle_id; + } + + /** + * Required. Unique Vehicle ID. + * Subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string vehicle_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVehicleId($var) + { + GPBUtil::checkString($var, True); + $this->vehicle_id = $var; + + return $this; + } + + /** + * Required. The Vehicle entity to create. When creating a Vehicle, the + * following fields are required: + * * `vehicleState` + * * `supportedTripTypes` + * * `maximumCapacity` + * * `vehicleType` + * When creating a Vehicle, the following fields are ignored: + * * `name` + * * `currentTrips` + * * `availableCapacity` + * * `current_route_segment` + * * `current_route_segment_end_point` + * * `current_route_segment_version` + * * `current_route_segment_traffic` + * * `route` + * * `waypoints` + * * `waypoints_version` + * * `remaining_distance_meters` + * * `remaining_time_seconds` + * * `eta_to_next_waypoint` + * * `navigation_status` + * All other fields are optional and used if provided. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle vehicle = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\V1\Vehicle|null + */ + public function getVehicle() + { + return $this->vehicle; + } + + public function hasVehicle() + { + return isset($this->vehicle); + } + + public function clearVehicle() + { + unset($this->vehicle); + } + + /** + * Required. The Vehicle entity to create. When creating a Vehicle, the + * following fields are required: + * * `vehicleState` + * * `supportedTripTypes` + * * `maximumCapacity` + * * `vehicleType` + * When creating a Vehicle, the following fields are ignored: + * * `name` + * * `currentTrips` + * * `availableCapacity` + * * `current_route_segment` + * * `current_route_segment_end_point` + * * `current_route_segment_version` + * * `current_route_segment_traffic` + * * `route` + * * `waypoints` + * * `waypoints_version` + * * `remaining_distance_meters` + * * `remaining_time_seconds` + * * `eta_to_next_waypoint` + * * `navigation_status` + * All other fields are optional and used if provided. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle vehicle = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\V1\Vehicle $var + * @return $this + */ + public function setVehicle($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\Vehicle::class); + $this->vehicle = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/DeviceSettings.php b/MapsFleetEngine/src/V1/DeviceSettings.php new file mode 100644 index 000000000000..7cd163b718f0 --- /dev/null +++ b/MapsFleetEngine/src/V1/DeviceSettings.php @@ -0,0 +1,183 @@ +maps.fleetengine.v1.DeviceSettings + */ +class DeviceSettings extends \Google\Protobuf\Internal\Message +{ + /** + * How location features are set to behave on the device when battery saver is + * on. + * + * Generated from protobuf field .maps.fleetengine.v1.LocationPowerSaveMode location_power_save_mode = 1; + */ + protected $location_power_save_mode = 0; + /** + * Whether the device is currently in power save mode. + * + * Generated from protobuf field bool is_power_save_mode = 2; + */ + protected $is_power_save_mode = false; + /** + * Whether the device is in an interactive state. + * + * Generated from protobuf field bool is_interactive = 3; + */ + protected $is_interactive = false; + /** + * Information about the battery state. + * + * Generated from protobuf field .maps.fleetengine.v1.BatteryInfo battery_info = 4; + */ + protected $battery_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $location_power_save_mode + * How location features are set to behave on the device when battery saver is + * on. + * @type bool $is_power_save_mode + * Whether the device is currently in power save mode. + * @type bool $is_interactive + * Whether the device is in an interactive state. + * @type \Google\Maps\FleetEngine\V1\BatteryInfo $battery_info + * Information about the battery state. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Vehicles::initOnce(); + parent::__construct($data); + } + + /** + * How location features are set to behave on the device when battery saver is + * on. + * + * Generated from protobuf field .maps.fleetengine.v1.LocationPowerSaveMode location_power_save_mode = 1; + * @return int + */ + public function getLocationPowerSaveMode() + { + return $this->location_power_save_mode; + } + + /** + * How location features are set to behave on the device when battery saver is + * on. + * + * Generated from protobuf field .maps.fleetengine.v1.LocationPowerSaveMode location_power_save_mode = 1; + * @param int $var + * @return $this + */ + public function setLocationPowerSaveMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\LocationPowerSaveMode::class); + $this->location_power_save_mode = $var; + + return $this; + } + + /** + * Whether the device is currently in power save mode. + * + * Generated from protobuf field bool is_power_save_mode = 2; + * @return bool + */ + public function getIsPowerSaveMode() + { + return $this->is_power_save_mode; + } + + /** + * Whether the device is currently in power save mode. + * + * Generated from protobuf field bool is_power_save_mode = 2; + * @param bool $var + * @return $this + */ + public function setIsPowerSaveMode($var) + { + GPBUtil::checkBool($var); + $this->is_power_save_mode = $var; + + return $this; + } + + /** + * Whether the device is in an interactive state. + * + * Generated from protobuf field bool is_interactive = 3; + * @return bool + */ + public function getIsInteractive() + { + return $this->is_interactive; + } + + /** + * Whether the device is in an interactive state. + * + * Generated from protobuf field bool is_interactive = 3; + * @param bool $var + * @return $this + */ + public function setIsInteractive($var) + { + GPBUtil::checkBool($var); + $this->is_interactive = $var; + + return $this; + } + + /** + * Information about the battery state. + * + * Generated from protobuf field .maps.fleetengine.v1.BatteryInfo battery_info = 4; + * @return \Google\Maps\FleetEngine\V1\BatteryInfo|null + */ + public function getBatteryInfo() + { + return $this->battery_info; + } + + public function hasBatteryInfo() + { + return isset($this->battery_info); + } + + public function clearBatteryInfo() + { + unset($this->battery_info); + } + + /** + * Information about the battery state. + * + * Generated from protobuf field .maps.fleetengine.v1.BatteryInfo battery_info = 4; + * @param \Google\Maps\FleetEngine\V1\BatteryInfo $var + * @return $this + */ + public function setBatteryInfo($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\BatteryInfo::class); + $this->battery_info = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/GetTripRequest.php b/MapsFleetEngine/src/V1/GetTripRequest.php new file mode 100644 index 000000000000..471812e6a653 --- /dev/null +++ b/MapsFleetEngine/src/V1/GetTripRequest.php @@ -0,0 +1,439 @@ +maps.fleetengine.v1.GetTripRequest + */ +class GetTripRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}/trips/{trip}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The subset of Trip fields that should be returned and their interpretation. + * + * Generated from protobuf field .maps.fleetengine.v1.TripView view = 11; + */ + protected $view = 0; + /** + * Indicates the minimum timestamp (exclusive) for which `Trip.route` or + * `Trip.current_route_segment` data are retrieved. If route data are + * unchanged since this timestamp, the route field is not set in the response. + * If a minimum is unspecified, the route data are always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 6; + */ + protected $current_route_segment_version = null; + /** + * Indicates the minimum timestamp (exclusive) for which + * `Trip.remaining_waypoints` are retrieved. If they are unchanged since this + * timestamp, the `remaining_waypoints` are not set in the response. If this + * field is unspecified, `remaining_waypoints` is always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_version = 7; + */ + protected $remaining_waypoints_version = null; + /** + * The returned current route format, `LAT_LNG_LIST_TYPE` (in `Trip.route`), + * or `ENCODED_POLYLINE_TYPE` (in `Trip.current_route_segment`). The default + * is `LAT_LNG_LIST_TYPE`. + * + * Generated from protobuf field .maps.fleetengine.v1.PolylineFormatType route_format_type = 8; + */ + protected $route_format_type = 0; + /** + * Indicates the minimum timestamp (exclusive) for which + * `Trip.current_route_segment_traffic` is retrieved. If traffic data are + * unchanged since this timestamp, the `current_route_segment_traffic` field + * is not set in the response. If a minimum is unspecified, the traffic data + * are always retrieved. Note that traffic is only available for On-Demand + * Rides and Deliveries Solution customers. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_traffic_version = 9; + */ + protected $current_route_segment_traffic_version = null; + /** + * Indicates the minimum timestamp (exclusive) for which + * `Trip.remaining_waypoints.traffic_to_waypoint` and + * `Trip.remaining_waypoints.path_to_waypoint` data are retrieved. If data are + * unchanged since this timestamp, the fields above are + * not set in the response. If `remaining_waypoints_route_version` is + * unspecified, traffic and path are always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_route_version = 10; + */ + protected $remaining_waypoints_route_version = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $name + * Required. Must be in the format `providers/{provider}/trips/{trip}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * @type int $view + * The subset of Trip fields that should be returned and their interpretation. + * @type \Google\Protobuf\Timestamp $current_route_segment_version + * Indicates the minimum timestamp (exclusive) for which `Trip.route` or + * `Trip.current_route_segment` data are retrieved. If route data are + * unchanged since this timestamp, the route field is not set in the response. + * If a minimum is unspecified, the route data are always retrieved. + * @type \Google\Protobuf\Timestamp $remaining_waypoints_version + * Indicates the minimum timestamp (exclusive) for which + * `Trip.remaining_waypoints` are retrieved. If they are unchanged since this + * timestamp, the `remaining_waypoints` are not set in the response. If this + * field is unspecified, `remaining_waypoints` is always retrieved. + * @type int $route_format_type + * The returned current route format, `LAT_LNG_LIST_TYPE` (in `Trip.route`), + * or `ENCODED_POLYLINE_TYPE` (in `Trip.current_route_segment`). The default + * is `LAT_LNG_LIST_TYPE`. + * @type \Google\Protobuf\Timestamp $current_route_segment_traffic_version + * Indicates the minimum timestamp (exclusive) for which + * `Trip.current_route_segment_traffic` is retrieved. If traffic data are + * unchanged since this timestamp, the `current_route_segment_traffic` field + * is not set in the response. If a minimum is unspecified, the traffic data + * are always retrieved. Note that traffic is only available for On-Demand + * Rides and Deliveries Solution customers. + * @type \Google\Protobuf\Timestamp $remaining_waypoints_route_version + * Indicates the minimum timestamp (exclusive) for which + * `Trip.remaining_waypoints.traffic_to_waypoint` and + * `Trip.remaining_waypoints.path_to_waypoint` data are retrieved. If data are + * unchanged since this timestamp, the fields above are + * not set in the response. If `remaining_waypoints_route_version` is + * unspecified, traffic and path are always retrieved. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\TripApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}/trips/{trip}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Must be in the format `providers/{provider}/trips/{trip}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The subset of Trip fields that should be returned and their interpretation. + * + * Generated from protobuf field .maps.fleetengine.v1.TripView view = 11; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The subset of Trip fields that should be returned and their interpretation. + * + * Generated from protobuf field .maps.fleetengine.v1.TripView view = 11; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\TripView::class); + $this->view = $var; + + return $this; + } + + /** + * Indicates the minimum timestamp (exclusive) for which `Trip.route` or + * `Trip.current_route_segment` data are retrieved. If route data are + * unchanged since this timestamp, the route field is not set in the response. + * If a minimum is unspecified, the route data are always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCurrentRouteSegmentVersion() + { + return $this->current_route_segment_version; + } + + public function hasCurrentRouteSegmentVersion() + { + return isset($this->current_route_segment_version); + } + + public function clearCurrentRouteSegmentVersion() + { + unset($this->current_route_segment_version); + } + + /** + * Indicates the minimum timestamp (exclusive) for which `Trip.route` or + * `Trip.current_route_segment` data are retrieved. If route data are + * unchanged since this timestamp, the route field is not set in the response. + * If a minimum is unspecified, the route data are always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCurrentRouteSegmentVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->current_route_segment_version = $var; + + return $this; + } + + /** + * Indicates the minimum timestamp (exclusive) for which + * `Trip.remaining_waypoints` are retrieved. If they are unchanged since this + * timestamp, the `remaining_waypoints` are not set in the response. If this + * field is unspecified, `remaining_waypoints` is always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_version = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRemainingWaypointsVersion() + { + return $this->remaining_waypoints_version; + } + + public function hasRemainingWaypointsVersion() + { + return isset($this->remaining_waypoints_version); + } + + public function clearRemainingWaypointsVersion() + { + unset($this->remaining_waypoints_version); + } + + /** + * Indicates the minimum timestamp (exclusive) for which + * `Trip.remaining_waypoints` are retrieved. If they are unchanged since this + * timestamp, the `remaining_waypoints` are not set in the response. If this + * field is unspecified, `remaining_waypoints` is always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_version = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRemainingWaypointsVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->remaining_waypoints_version = $var; + + return $this; + } + + /** + * The returned current route format, `LAT_LNG_LIST_TYPE` (in `Trip.route`), + * or `ENCODED_POLYLINE_TYPE` (in `Trip.current_route_segment`). The default + * is `LAT_LNG_LIST_TYPE`. + * + * Generated from protobuf field .maps.fleetengine.v1.PolylineFormatType route_format_type = 8; + * @return int + */ + public function getRouteFormatType() + { + return $this->route_format_type; + } + + /** + * The returned current route format, `LAT_LNG_LIST_TYPE` (in `Trip.route`), + * or `ENCODED_POLYLINE_TYPE` (in `Trip.current_route_segment`). The default + * is `LAT_LNG_LIST_TYPE`. + * + * Generated from protobuf field .maps.fleetengine.v1.PolylineFormatType route_format_type = 8; + * @param int $var + * @return $this + */ + public function setRouteFormatType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\PolylineFormatType::class); + $this->route_format_type = $var; + + return $this; + } + + /** + * Indicates the minimum timestamp (exclusive) for which + * `Trip.current_route_segment_traffic` is retrieved. If traffic data are + * unchanged since this timestamp, the `current_route_segment_traffic` field + * is not set in the response. If a minimum is unspecified, the traffic data + * are always retrieved. Note that traffic is only available for On-Demand + * Rides and Deliveries Solution customers. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_traffic_version = 9; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCurrentRouteSegmentTrafficVersion() + { + return $this->current_route_segment_traffic_version; + } + + public function hasCurrentRouteSegmentTrafficVersion() + { + return isset($this->current_route_segment_traffic_version); + } + + public function clearCurrentRouteSegmentTrafficVersion() + { + unset($this->current_route_segment_traffic_version); + } + + /** + * Indicates the minimum timestamp (exclusive) for which + * `Trip.current_route_segment_traffic` is retrieved. If traffic data are + * unchanged since this timestamp, the `current_route_segment_traffic` field + * is not set in the response. If a minimum is unspecified, the traffic data + * are always retrieved. Note that traffic is only available for On-Demand + * Rides and Deliveries Solution customers. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_traffic_version = 9; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCurrentRouteSegmentTrafficVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->current_route_segment_traffic_version = $var; + + return $this; + } + + /** + * Indicates the minimum timestamp (exclusive) for which + * `Trip.remaining_waypoints.traffic_to_waypoint` and + * `Trip.remaining_waypoints.path_to_waypoint` data are retrieved. If data are + * unchanged since this timestamp, the fields above are + * not set in the response. If `remaining_waypoints_route_version` is + * unspecified, traffic and path are always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_route_version = 10; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRemainingWaypointsRouteVersion() + { + return $this->remaining_waypoints_route_version; + } + + public function hasRemainingWaypointsRouteVersion() + { + return isset($this->remaining_waypoints_route_version); + } + + public function clearRemainingWaypointsRouteVersion() + { + unset($this->remaining_waypoints_route_version); + } + + /** + * Indicates the minimum timestamp (exclusive) for which + * `Trip.remaining_waypoints.traffic_to_waypoint` and + * `Trip.remaining_waypoints.path_to_waypoint` data are retrieved. If data are + * unchanged since this timestamp, the fields above are + * not set in the response. If `remaining_waypoints_route_version` is + * unspecified, traffic and path are always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_route_version = 10; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRemainingWaypointsRouteVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->remaining_waypoints_route_version = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/GetVehicleRequest.php b/MapsFleetEngine/src/V1/GetVehicleRequest.php new file mode 100644 index 000000000000..90b14b5176c4 --- /dev/null +++ b/MapsFleetEngine/src/V1/GetVehicleRequest.php @@ -0,0 +1,243 @@ +maps.fleetengine.v1.GetVehicleRequest + */ +class GetVehicleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + */ + protected $header = null; + /** + * Required. Must be in the format + * `providers/{provider}/vehicles/{vehicle}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates the minimum timestamp (exclusive) for which + * `Vehicle.current_route_segment` is retrieved. + * If the route is unchanged since this timestamp, the `current_route_segment` + * field is not set in the response. If a minimum is unspecified, the + * `current_route_segment` is always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 4; + */ + protected $current_route_segment_version = null; + /** + * Indicates the minimum timestamp (exclusive) for which `Vehicle.waypoints` + * data is retrieved. If the waypoints are unchanged since this timestamp, the + * `vehicle.waypoints` data is not set in the response. If this field is + * unspecified, `vehicle.waypoints` is always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp waypoints_version = 5; + */ + protected $waypoints_version = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $name + * Required. Must be in the format + * `providers/{provider}/vehicles/{vehicle}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * @type \Google\Protobuf\Timestamp $current_route_segment_version + * Indicates the minimum timestamp (exclusive) for which + * `Vehicle.current_route_segment` is retrieved. + * If the route is unchanged since this timestamp, the `current_route_segment` + * field is not set in the response. If a minimum is unspecified, the + * `current_route_segment` is always retrieved. + * @type \Google\Protobuf\Timestamp $waypoints_version + * Indicates the minimum timestamp (exclusive) for which `Vehicle.waypoints` + * data is retrieved. If the waypoints are unchanged since this timestamp, the + * `vehicle.waypoints` data is not set in the response. If this field is + * unspecified, `vehicle.waypoints` is always retrieved. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format + * `providers/{provider}/vehicles/{vehicle}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Must be in the format + * `providers/{provider}/vehicles/{vehicle}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Indicates the minimum timestamp (exclusive) for which + * `Vehicle.current_route_segment` is retrieved. + * If the route is unchanged since this timestamp, the `current_route_segment` + * field is not set in the response. If a minimum is unspecified, the + * `current_route_segment` is always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCurrentRouteSegmentVersion() + { + return $this->current_route_segment_version; + } + + public function hasCurrentRouteSegmentVersion() + { + return isset($this->current_route_segment_version); + } + + public function clearCurrentRouteSegmentVersion() + { + unset($this->current_route_segment_version); + } + + /** + * Indicates the minimum timestamp (exclusive) for which + * `Vehicle.current_route_segment` is retrieved. + * If the route is unchanged since this timestamp, the `current_route_segment` + * field is not set in the response. If a minimum is unspecified, the + * `current_route_segment` is always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCurrentRouteSegmentVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->current_route_segment_version = $var; + + return $this; + } + + /** + * Indicates the minimum timestamp (exclusive) for which `Vehicle.waypoints` + * data is retrieved. If the waypoints are unchanged since this timestamp, the + * `vehicle.waypoints` data is not set in the response. If this field is + * unspecified, `vehicle.waypoints` is always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp waypoints_version = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getWaypointsVersion() + { + return $this->waypoints_version; + } + + public function hasWaypointsVersion() + { + return isset($this->waypoints_version); + } + + public function clearWaypointsVersion() + { + unset($this->waypoints_version); + } + + /** + * Indicates the minimum timestamp (exclusive) for which `Vehicle.waypoints` + * data is retrieved. If the waypoints are unchanged since this timestamp, the + * `vehicle.waypoints` data is not set in the response. If this field is + * unspecified, `vehicle.waypoints` is always retrieved. + * + * Generated from protobuf field .google.protobuf.Timestamp waypoints_version = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setWaypointsVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->waypoints_version = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/LicensePlate.php b/MapsFleetEngine/src/V1/LicensePlate.php new file mode 100644 index 000000000000..8d2fe48298c7 --- /dev/null +++ b/MapsFleetEngine/src/V1/LicensePlate.php @@ -0,0 +1,123 @@ +maps.fleetengine.v1.LicensePlate + */ +class LicensePlate extends \Google\Protobuf\Internal\Message +{ + /** + * Required. CLDR Country/Region Code. For example, `US` for United States, + * or `IN` for India. + * + * Generated from protobuf field string country_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $country_code = ''; + /** + * The last digit of the license plate or "-1" to denote no numeric value + * is present in the license plate. + * * "ABC 1234" -> "4" + * * "AB 123 CD" -> "3" + * * "ABCDEF" -> "-1" + * + * Generated from protobuf field string last_character = 2; + */ + protected $last_character = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $country_code + * Required. CLDR Country/Region Code. For example, `US` for United States, + * or `IN` for India. + * @type string $last_character + * The last digit of the license plate or "-1" to denote no numeric value + * is present in the license plate. + * * "ABC 1234" -> "4" + * * "AB 123 CD" -> "3" + * * "ABCDEF" -> "-1" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Vehicles::initOnce(); + parent::__construct($data); + } + + /** + * Required. CLDR Country/Region Code. For example, `US` for United States, + * or `IN` for India. + * + * Generated from protobuf field string country_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCountryCode() + { + return $this->country_code; + } + + /** + * Required. CLDR Country/Region Code. For example, `US` for United States, + * or `IN` for India. + * + * Generated from protobuf field string country_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCountryCode($var) + { + GPBUtil::checkString($var, True); + $this->country_code = $var; + + return $this; + } + + /** + * The last digit of the license plate or "-1" to denote no numeric value + * is present in the license plate. + * * "ABC 1234" -> "4" + * * "AB 123 CD" -> "3" + * * "ABCDEF" -> "-1" + * + * Generated from protobuf field string last_character = 2; + * @return string + */ + public function getLastCharacter() + { + return $this->last_character; + } + + /** + * The last digit of the license plate or "-1" to denote no numeric value + * is present in the license plate. + * * "ABC 1234" -> "4" + * * "AB 123 CD" -> "3" + * * "ABCDEF" -> "-1" + * + * Generated from protobuf field string last_character = 2; + * @param string $var + * @return $this + */ + public function setLastCharacter($var) + { + GPBUtil::checkString($var, True); + $this->last_character = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/ListVehiclesRequest.php b/MapsFleetEngine/src/V1/ListVehiclesRequest.php new file mode 100644 index 000000000000..e9849fa89a77 --- /dev/null +++ b/MapsFleetEngine/src/V1/ListVehiclesRequest.php @@ -0,0 +1,926 @@ +maps.fleetengine.v1.ListVehiclesRequest + */ +class ListVehiclesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 12; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * The maximum number of vehicles to return. + * Default value: 100. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * The value of the `next_page_token` provided by a previous call to + * `ListVehicles` so that you can paginate through groups of vehicles. The + * value is undefined if the filter criteria of the request is not the same as + * the filter criteria for the previous call to `ListVehicles`. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + /** + * Specifies the required minimum capacity of the vehicle. All vehicles + * returned will have a `maximum_capacity` greater than or equal to this + * value. If set, must be greater or equal to 0. + * + * Generated from protobuf field .google.protobuf.Int32Value minimum_capacity = 6; + */ + protected $minimum_capacity = null; + /** + * Restricts the response to vehicles that support at least one of the + * specified trip types. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripType trip_types = 7; + */ + private $trip_types; + /** + * Restricts the response to vehicles that have sent location updates to Fleet + * Engine within the specified duration. Stationary vehicles still + * transmitting their locations are not considered stale. If present, must be + * a valid positive duration. + * + * Generated from protobuf field .google.protobuf.Duration maximum_staleness = 8; + */ + protected $maximum_staleness = null; + /** + * Required. Restricts the response to vehicles with one of the specified type + * categories. `UNKNOWN` is not allowed. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Vehicle.VehicleType.Category vehicle_type_categories = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + private $vehicle_type_categories; + /** + * Callers can form complex logical operations using any combination of the + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attribute_sets` fields. + * `required_attributes` is a list; `required_one_of_attributes` uses a + * message which allows a list of lists. In combination, the two fields allow + * the composition of this expression: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR + * ...) + * AND + * (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR + * ...) + * ``` + * Restricts the response to vehicles with the specified attributes. This + * field is a conjunction/AND operation. A max of 50 required_attributes is + * allowed. This matches the maximum number of attributes allowed on a + * vehicle. Each repeated string should be of the format "key:value". + * + * Generated from protobuf field repeated string required_attributes = 10; + */ + private $required_attributes; + /** + * Restricts the response to vehicles with at least one of the specified + * attributes in each `VehicleAttributeList`. Within each list, a vehicle must + * match at least one of the attributes. This field is an inclusive + * disjunction/OR operation in each `VehicleAttributeList` and a + * conjunction/AND operation across the collection of `VehicleAttributeList`. + * Each repeated string should be of the format + * "key1:value1|key2:value2|key3:value3". + * + * Generated from protobuf field repeated string required_one_of_attributes = 13; + */ + private $required_one_of_attributes; + /** + * `required_one_of_attribute_sets` provides additional functionality. + * Similar to `required_one_of_attributes`, `required_one_of_attribute_sets` + * uses a message which allows a list of lists, allowing expressions such as + * this one: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * ( + * (required_one_of_attribute_sets[0][0] AND + * required_one_of_attribute_sets[0][1] AND + * ...) + * OR + * (required_one_of_attribute_sets[1][0] AND + * required_one_of_attribute_sets[1][1] AND + * ...) + * ) + * ``` + * Restricts the response to vehicles that match all the attributes in a + * `VehicleAttributeList`. Within each list, a vehicle must match all of the + * attributes. This field is a conjunction/AND operation in each + * `VehicleAttributeList` and inclusive disjunction/OR operation across the + * collection of `VehicleAttributeList`. Each repeated string should be of the + * format "key1:value1|key2:value2|key3:value3". + * + * Generated from protobuf field repeated string required_one_of_attribute_sets = 15; + */ + private $required_one_of_attribute_sets; + /** + * Restricts the response to vehicles that have this vehicle state. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleState vehicle_state = 11; + */ + protected $vehicle_state = 0; + /** + * Only return the vehicles with current trip(s). + * + * Generated from protobuf field bool on_trip_only = 14; + */ + protected $on_trip_only = false; + /** + * Optional. A filter query to apply when listing vehicles. See + * http://aip.dev/160 for examples of the filter syntax. + * This field is designed to replace the `required_attributes`, + * `required_one_of_attributes`, and `required_one_of_attributes_sets` fields. + * If a non-empty value is specified here, the following fields must be empty: + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attributes_sets`. + * This filter functions as an AND clause with other constraints, + * such as `vehicle_state` or `on_trip_only`. + * Note that the only queries supported are on vehicle attributes (for + * example, `attributes. = ` or `attributes. = AND + * attributes. = `). The maximum number of restrictions allowed + * in a filter query is 50. + * Also, all attributes are stored as strings, so the only supported + * comparisons against attributes are string comparisons. In order to compare + * against number or boolean values, the values must be explicitly quoted to + * be treated as strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * + * Generated from protobuf field string filter = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. A filter that limits the vehicles returned to those whose last + * known location was in the rectangular area defined by the viewport. + * + * Generated from protobuf field .google.geo.type.Viewport viewport = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $viewport = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $parent + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * @type int $page_size + * The maximum number of vehicles to return. + * Default value: 100. + * @type string $page_token + * The value of the `next_page_token` provided by a previous call to + * `ListVehicles` so that you can paginate through groups of vehicles. The + * value is undefined if the filter criteria of the request is not the same as + * the filter criteria for the previous call to `ListVehicles`. + * @type \Google\Protobuf\Int32Value $minimum_capacity + * Specifies the required minimum capacity of the vehicle. All vehicles + * returned will have a `maximum_capacity` greater than or equal to this + * value. If set, must be greater or equal to 0. + * @type array|\Google\Protobuf\Internal\RepeatedField $trip_types + * Restricts the response to vehicles that support at least one of the + * specified trip types. + * @type \Google\Protobuf\Duration $maximum_staleness + * Restricts the response to vehicles that have sent location updates to Fleet + * Engine within the specified duration. Stationary vehicles still + * transmitting their locations are not considered stale. If present, must be + * a valid positive duration. + * @type array|\Google\Protobuf\Internal\RepeatedField $vehicle_type_categories + * Required. Restricts the response to vehicles with one of the specified type + * categories. `UNKNOWN` is not allowed. + * @type array|\Google\Protobuf\Internal\RepeatedField $required_attributes + * Callers can form complex logical operations using any combination of the + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attribute_sets` fields. + * `required_attributes` is a list; `required_one_of_attributes` uses a + * message which allows a list of lists. In combination, the two fields allow + * the composition of this expression: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR + * ...) + * AND + * (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR + * ...) + * ``` + * Restricts the response to vehicles with the specified attributes. This + * field is a conjunction/AND operation. A max of 50 required_attributes is + * allowed. This matches the maximum number of attributes allowed on a + * vehicle. Each repeated string should be of the format "key:value". + * @type array|\Google\Protobuf\Internal\RepeatedField $required_one_of_attributes + * Restricts the response to vehicles with at least one of the specified + * attributes in each `VehicleAttributeList`. Within each list, a vehicle must + * match at least one of the attributes. This field is an inclusive + * disjunction/OR operation in each `VehicleAttributeList` and a + * conjunction/AND operation across the collection of `VehicleAttributeList`. + * Each repeated string should be of the format + * "key1:value1|key2:value2|key3:value3". + * @type array|\Google\Protobuf\Internal\RepeatedField $required_one_of_attribute_sets + * `required_one_of_attribute_sets` provides additional functionality. + * Similar to `required_one_of_attributes`, `required_one_of_attribute_sets` + * uses a message which allows a list of lists, allowing expressions such as + * this one: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * ( + * (required_one_of_attribute_sets[0][0] AND + * required_one_of_attribute_sets[0][1] AND + * ...) + * OR + * (required_one_of_attribute_sets[1][0] AND + * required_one_of_attribute_sets[1][1] AND + * ...) + * ) + * ``` + * Restricts the response to vehicles that match all the attributes in a + * `VehicleAttributeList`. Within each list, a vehicle must match all of the + * attributes. This field is a conjunction/AND operation in each + * `VehicleAttributeList` and inclusive disjunction/OR operation across the + * collection of `VehicleAttributeList`. Each repeated string should be of the + * format "key1:value1|key2:value2|key3:value3". + * @type int $vehicle_state + * Restricts the response to vehicles that have this vehicle state. + * @type bool $on_trip_only + * Only return the vehicles with current trip(s). + * @type string $filter + * Optional. A filter query to apply when listing vehicles. See + * http://aip.dev/160 for examples of the filter syntax. + * This field is designed to replace the `required_attributes`, + * `required_one_of_attributes`, and `required_one_of_attributes_sets` fields. + * If a non-empty value is specified here, the following fields must be empty: + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attributes_sets`. + * This filter functions as an AND clause with other constraints, + * such as `vehicle_state` or `on_trip_only`. + * Note that the only queries supported are on vehicle attributes (for + * example, `attributes. = ` or `attributes. = AND + * attributes. = `). The maximum number of restrictions allowed + * in a filter query is 50. + * Also, all attributes are stored as strings, so the only supported + * comparisons against attributes are string comparisons. In order to compare + * against number or boolean values, the values must be explicitly quoted to + * be treated as strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * @type \Google\Geo\Type\Viewport $viewport + * Optional. A filter that limits the vehicles returned to those whose last + * known location was in the rectangular area defined by the viewport. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 12; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 12; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of vehicles to return. + * Default value: 100. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of vehicles to return. + * Default value: 100. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value of the `next_page_token` provided by a previous call to + * `ListVehicles` so that you can paginate through groups of vehicles. The + * value is undefined if the filter criteria of the request is not the same as + * the filter criteria for the previous call to `ListVehicles`. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value of the `next_page_token` provided by a previous call to + * `ListVehicles` so that you can paginate through groups of vehicles. The + * value is undefined if the filter criteria of the request is not the same as + * the filter criteria for the previous call to `ListVehicles`. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Specifies the required minimum capacity of the vehicle. All vehicles + * returned will have a `maximum_capacity` greater than or equal to this + * value. If set, must be greater or equal to 0. + * + * Generated from protobuf field .google.protobuf.Int32Value minimum_capacity = 6; + * @return \Google\Protobuf\Int32Value|null + */ + public function getMinimumCapacity() + { + return $this->minimum_capacity; + } + + public function hasMinimumCapacity() + { + return isset($this->minimum_capacity); + } + + public function clearMinimumCapacity() + { + unset($this->minimum_capacity); + } + + /** + * Returns the unboxed value from getMinimumCapacity() + + * Specifies the required minimum capacity of the vehicle. All vehicles + * returned will have a `maximum_capacity` greater than or equal to this + * value. If set, must be greater or equal to 0. + * + * Generated from protobuf field .google.protobuf.Int32Value minimum_capacity = 6; + * @return int|null + */ + public function getMinimumCapacityUnwrapped() + { + return $this->readWrapperValue("minimum_capacity"); + } + + /** + * Specifies the required minimum capacity of the vehicle. All vehicles + * returned will have a `maximum_capacity` greater than or equal to this + * value. If set, must be greater or equal to 0. + * + * Generated from protobuf field .google.protobuf.Int32Value minimum_capacity = 6; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setMinimumCapacity($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->minimum_capacity = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Specifies the required minimum capacity of the vehicle. All vehicles + * returned will have a `maximum_capacity` greater than or equal to this + * value. If set, must be greater or equal to 0. + * + * Generated from protobuf field .google.protobuf.Int32Value minimum_capacity = 6; + * @param int|null $var + * @return $this + */ + public function setMinimumCapacityUnwrapped($var) + { + $this->writeWrapperValue("minimum_capacity", $var); + return $this;} + + /** + * Restricts the response to vehicles that support at least one of the + * specified trip types. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripType trip_types = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTripTypes() + { + return $this->trip_types; + } + + /** + * Restricts the response to vehicles that support at least one of the + * specified trip types. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripType trip_types = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTripTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Maps\FleetEngine\V1\TripType::class); + $this->trip_types = $arr; + + return $this; + } + + /** + * Restricts the response to vehicles that have sent location updates to Fleet + * Engine within the specified duration. Stationary vehicles still + * transmitting their locations are not considered stale. If present, must be + * a valid positive duration. + * + * Generated from protobuf field .google.protobuf.Duration maximum_staleness = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getMaximumStaleness() + { + return $this->maximum_staleness; + } + + public function hasMaximumStaleness() + { + return isset($this->maximum_staleness); + } + + public function clearMaximumStaleness() + { + unset($this->maximum_staleness); + } + + /** + * Restricts the response to vehicles that have sent location updates to Fleet + * Engine within the specified duration. Stationary vehicles still + * transmitting their locations are not considered stale. If present, must be + * a valid positive duration. + * + * Generated from protobuf field .google.protobuf.Duration maximum_staleness = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaximumStaleness($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->maximum_staleness = $var; + + return $this; + } + + /** + * Required. Restricts the response to vehicles with one of the specified type + * categories. `UNKNOWN` is not allowed. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Vehicle.VehicleType.Category vehicle_type_categories = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVehicleTypeCategories() + { + return $this->vehicle_type_categories; + } + + /** + * Required. Restricts the response to vehicles with one of the specified type + * categories. `UNKNOWN` is not allowed. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Vehicle.VehicleType.Category vehicle_type_categories = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVehicleTypeCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Maps\FleetEngine\V1\Vehicle\VehicleType\Category::class); + $this->vehicle_type_categories = $arr; + + return $this; + } + + /** + * Callers can form complex logical operations using any combination of the + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attribute_sets` fields. + * `required_attributes` is a list; `required_one_of_attributes` uses a + * message which allows a list of lists. In combination, the two fields allow + * the composition of this expression: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR + * ...) + * AND + * (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR + * ...) + * ``` + * Restricts the response to vehicles with the specified attributes. This + * field is a conjunction/AND operation. A max of 50 required_attributes is + * allowed. This matches the maximum number of attributes allowed on a + * vehicle. Each repeated string should be of the format "key:value". + * + * Generated from protobuf field repeated string required_attributes = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequiredAttributes() + { + return $this->required_attributes; + } + + /** + * Callers can form complex logical operations using any combination of the + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attribute_sets` fields. + * `required_attributes` is a list; `required_one_of_attributes` uses a + * message which allows a list of lists. In combination, the two fields allow + * the composition of this expression: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR + * ...) + * AND + * (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR + * ...) + * ``` + * Restricts the response to vehicles with the specified attributes. This + * field is a conjunction/AND operation. A max of 50 required_attributes is + * allowed. This matches the maximum number of attributes allowed on a + * vehicle. Each repeated string should be of the format "key:value". + * + * Generated from protobuf field repeated string required_attributes = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequiredAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->required_attributes = $arr; + + return $this; + } + + /** + * Restricts the response to vehicles with at least one of the specified + * attributes in each `VehicleAttributeList`. Within each list, a vehicle must + * match at least one of the attributes. This field is an inclusive + * disjunction/OR operation in each `VehicleAttributeList` and a + * conjunction/AND operation across the collection of `VehicleAttributeList`. + * Each repeated string should be of the format + * "key1:value1|key2:value2|key3:value3". + * + * Generated from protobuf field repeated string required_one_of_attributes = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequiredOneOfAttributes() + { + return $this->required_one_of_attributes; + } + + /** + * Restricts the response to vehicles with at least one of the specified + * attributes in each `VehicleAttributeList`. Within each list, a vehicle must + * match at least one of the attributes. This field is an inclusive + * disjunction/OR operation in each `VehicleAttributeList` and a + * conjunction/AND operation across the collection of `VehicleAttributeList`. + * Each repeated string should be of the format + * "key1:value1|key2:value2|key3:value3". + * + * Generated from protobuf field repeated string required_one_of_attributes = 13; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequiredOneOfAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->required_one_of_attributes = $arr; + + return $this; + } + + /** + * `required_one_of_attribute_sets` provides additional functionality. + * Similar to `required_one_of_attributes`, `required_one_of_attribute_sets` + * uses a message which allows a list of lists, allowing expressions such as + * this one: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * ( + * (required_one_of_attribute_sets[0][0] AND + * required_one_of_attribute_sets[0][1] AND + * ...) + * OR + * (required_one_of_attribute_sets[1][0] AND + * required_one_of_attribute_sets[1][1] AND + * ...) + * ) + * ``` + * Restricts the response to vehicles that match all the attributes in a + * `VehicleAttributeList`. Within each list, a vehicle must match all of the + * attributes. This field is a conjunction/AND operation in each + * `VehicleAttributeList` and inclusive disjunction/OR operation across the + * collection of `VehicleAttributeList`. Each repeated string should be of the + * format "key1:value1|key2:value2|key3:value3". + * + * Generated from protobuf field repeated string required_one_of_attribute_sets = 15; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequiredOneOfAttributeSets() + { + return $this->required_one_of_attribute_sets; + } + + /** + * `required_one_of_attribute_sets` provides additional functionality. + * Similar to `required_one_of_attributes`, `required_one_of_attribute_sets` + * uses a message which allows a list of lists, allowing expressions such as + * this one: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * ( + * (required_one_of_attribute_sets[0][0] AND + * required_one_of_attribute_sets[0][1] AND + * ...) + * OR + * (required_one_of_attribute_sets[1][0] AND + * required_one_of_attribute_sets[1][1] AND + * ...) + * ) + * ``` + * Restricts the response to vehicles that match all the attributes in a + * `VehicleAttributeList`. Within each list, a vehicle must match all of the + * attributes. This field is a conjunction/AND operation in each + * `VehicleAttributeList` and inclusive disjunction/OR operation across the + * collection of `VehicleAttributeList`. Each repeated string should be of the + * format "key1:value1|key2:value2|key3:value3". + * + * Generated from protobuf field repeated string required_one_of_attribute_sets = 15; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequiredOneOfAttributeSets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->required_one_of_attribute_sets = $arr; + + return $this; + } + + /** + * Restricts the response to vehicles that have this vehicle state. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleState vehicle_state = 11; + * @return int + */ + public function getVehicleState() + { + return $this->vehicle_state; + } + + /** + * Restricts the response to vehicles that have this vehicle state. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleState vehicle_state = 11; + * @param int $var + * @return $this + */ + public function setVehicleState($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\VehicleState::class); + $this->vehicle_state = $var; + + return $this; + } + + /** + * Only return the vehicles with current trip(s). + * + * Generated from protobuf field bool on_trip_only = 14; + * @return bool + */ + public function getOnTripOnly() + { + return $this->on_trip_only; + } + + /** + * Only return the vehicles with current trip(s). + * + * Generated from protobuf field bool on_trip_only = 14; + * @param bool $var + * @return $this + */ + public function setOnTripOnly($var) + { + GPBUtil::checkBool($var); + $this->on_trip_only = $var; + + return $this; + } + + /** + * Optional. A filter query to apply when listing vehicles. See + * http://aip.dev/160 for examples of the filter syntax. + * This field is designed to replace the `required_attributes`, + * `required_one_of_attributes`, and `required_one_of_attributes_sets` fields. + * If a non-empty value is specified here, the following fields must be empty: + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attributes_sets`. + * This filter functions as an AND clause with other constraints, + * such as `vehicle_state` or `on_trip_only`. + * Note that the only queries supported are on vehicle attributes (for + * example, `attributes. = ` or `attributes. = AND + * attributes. = `). The maximum number of restrictions allowed + * in a filter query is 50. + * Also, all attributes are stored as strings, so the only supported + * comparisons against attributes are string comparisons. In order to compare + * against number or boolean values, the values must be explicitly quoted to + * be treated as strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * + * Generated from protobuf field string filter = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter query to apply when listing vehicles. See + * http://aip.dev/160 for examples of the filter syntax. + * This field is designed to replace the `required_attributes`, + * `required_one_of_attributes`, and `required_one_of_attributes_sets` fields. + * If a non-empty value is specified here, the following fields must be empty: + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attributes_sets`. + * This filter functions as an AND clause with other constraints, + * such as `vehicle_state` or `on_trip_only`. + * Note that the only queries supported are on vehicle attributes (for + * example, `attributes. = ` or `attributes. = AND + * attributes. = `). The maximum number of restrictions allowed + * in a filter query is 50. + * Also, all attributes are stored as strings, so the only supported + * comparisons against attributes are string comparisons. In order to compare + * against number or boolean values, the values must be explicitly quoted to + * be treated as strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * + * Generated from protobuf field string filter = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. A filter that limits the vehicles returned to those whose last + * known location was in the rectangular area defined by the viewport. + * + * Generated from protobuf field .google.geo.type.Viewport viewport = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Geo\Type\Viewport|null + */ + public function getViewport() + { + return $this->viewport; + } + + public function hasViewport() + { + return isset($this->viewport); + } + + public function clearViewport() + { + unset($this->viewport); + } + + /** + * Optional. A filter that limits the vehicles returned to those whose last + * known location was in the rectangular area defined by the viewport. + * + * Generated from protobuf field .google.geo.type.Viewport viewport = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Geo\Type\Viewport $var + * @return $this + */ + public function setViewport($var) + { + GPBUtil::checkMessage($var, \Google\Geo\Type\Viewport::class); + $this->viewport = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/ListVehiclesResponse.php b/MapsFleetEngine/src/V1/ListVehiclesResponse.php new file mode 100644 index 000000000000..2ba9724c211e --- /dev/null +++ b/MapsFleetEngine/src/V1/ListVehiclesResponse.php @@ -0,0 +1,151 @@ +maps.fleetengine.v1.ListVehiclesResponse + */ +class ListVehiclesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Vehicles matching the criteria in the request. + * The maximum number of vehicles returned is determined by the `page_size` + * field in the request. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Vehicle vehicles = 1; + */ + private $vehicles; + /** + * Token to retrieve the next page of vehicles, or empty if there are no + * more vehicles that meet the request criteria. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Required. Total number of vehicles matching the request criteria across all + * pages. + * + * Generated from protobuf field int64 total_size = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\V1\Vehicle>|\Google\Protobuf\Internal\RepeatedField $vehicles + * Vehicles matching the criteria in the request. + * The maximum number of vehicles returned is determined by the `page_size` + * field in the request. + * @type string $next_page_token + * Token to retrieve the next page of vehicles, or empty if there are no + * more vehicles that meet the request criteria. + * @type int|string $total_size + * Required. Total number of vehicles matching the request criteria across all + * pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * Vehicles matching the criteria in the request. + * The maximum number of vehicles returned is determined by the `page_size` + * field in the request. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Vehicle vehicles = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVehicles() + { + return $this->vehicles; + } + + /** + * Vehicles matching the criteria in the request. + * The maximum number of vehicles returned is determined by the `page_size` + * field in the request. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Vehicle vehicles = 1; + * @param array<\Google\Maps\FleetEngine\V1\Vehicle>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVehicles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\Vehicle::class); + $this->vehicles = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of vehicles, or empty if there are no + * more vehicles that meet the request criteria. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of vehicles, or empty if there are no + * more vehicles that meet the request criteria. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Required. Total number of vehicles matching the request criteria across all + * pages. + * + * Generated from protobuf field int64 total_size = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Required. Total number of vehicles matching the request criteria across all + * pages. + * + * Generated from protobuf field int64 total_size = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt64($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/LocationPowerSaveMode.php b/MapsFleetEngine/src/V1/LocationPowerSaveMode.php new file mode 100644 index 000000000000..4eb20054c4f9 --- /dev/null +++ b/MapsFleetEngine/src/V1/LocationPowerSaveMode.php @@ -0,0 +1,89 @@ +maps.fleetengine.v1.LocationPowerSaveMode + */ +class LocationPowerSaveMode +{ + /** + * Undefined LocationPowerSaveMode + * + * Generated from protobuf enum UNKNOWN_LOCATION_POWER_SAVE_MODE = 0; + */ + const UNKNOWN_LOCATION_POWER_SAVE_MODE = 0; + /** + * Either the location providers shouldn't be affected by battery saver, or + * battery saver is off. + * + * Generated from protobuf enum LOCATION_MODE_NO_CHANGE = 1; + */ + const LOCATION_MODE_NO_CHANGE = 1; + /** + * The GPS based location provider should be disabled when battery saver is on + * and the device is non-interactive. + * + * Generated from protobuf enum LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF = 2; + */ + const LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF = 2; + /** + * All location providers should be disabled when battery saver is on and the + * device is non-interactive. + * + * Generated from protobuf enum LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF = 3; + */ + const LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF = 3; + /** + * All the location providers will be kept available, but location fixes + * should only be provided to foreground apps. + * + * Generated from protobuf enum LOCATION_MODE_FOREGROUND_ONLY = 4; + */ + const LOCATION_MODE_FOREGROUND_ONLY = 4; + /** + * Location will not be turned off, but LocationManager will throttle all + * requests to providers when the device is non-interactive. + * + * Generated from protobuf enum LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF = 5; + */ + const LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF = 5; + + private static $valueToName = [ + self::UNKNOWN_LOCATION_POWER_SAVE_MODE => 'UNKNOWN_LOCATION_POWER_SAVE_MODE', + self::LOCATION_MODE_NO_CHANGE => 'LOCATION_MODE_NO_CHANGE', + self::LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF => 'LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF', + self::LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF => 'LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF', + self::LOCATION_MODE_FOREGROUND_ONLY => 'LOCATION_MODE_FOREGROUND_ONLY', + self::LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF => 'LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/LocationSensor.php b/MapsFleetEngine/src/V1/LocationSensor.php new file mode 100644 index 000000000000..63194cc7ea5b --- /dev/null +++ b/MapsFleetEngine/src/V1/LocationSensor.php @@ -0,0 +1,110 @@ +maps.fleetengine.v1.LocationSensor + */ +class LocationSensor +{ + /** + * The sensor is unspecified or unknown. + * + * Generated from protobuf enum UNKNOWN_SENSOR = 0; + */ + const UNKNOWN_SENSOR = 0; + /** + * GPS or Assisted GPS. + * + * Generated from protobuf enum GPS = 1; + */ + const GPS = 1; + /** + * Assisted GPS, cell tower ID, or WiFi access point. + * + * Generated from protobuf enum NETWORK = 2; + */ + const NETWORK = 2; + /** + * Cell tower ID or WiFi access point. + * + * Generated from protobuf enum PASSIVE = 3; + */ + const PASSIVE = 3; + /** + * A location determined by the mobile device to be the most likely + * road position. + * + * Generated from protobuf enum ROAD_SNAPPED_LOCATION_PROVIDER = 4; + */ + const ROAD_SNAPPED_LOCATION_PROVIDER = 4; + /** + * A customer-supplied location from an independent source. Typically, this + * value is used for a location provided from sources other than the mobile + * device running Driver SDK. If the original source is described by one of + * the other enum values, use that value. Locations marked + * CUSTOMER_SUPPLIED_LOCATION are typically provided via a Vehicle's + * `last_location.supplemental_location_sensor`. + * + * Generated from protobuf enum CUSTOMER_SUPPLIED_LOCATION = 5; + */ + const CUSTOMER_SUPPLIED_LOCATION = 5; + /** + * A location calculated by Fleet Engine based on the signals available to it. + * Output only. This value will be rejected if it is received in a request. + * + * Generated from protobuf enum FLEET_ENGINE_LOCATION = 6; + */ + const FLEET_ENGINE_LOCATION = 6; + /** + * Android's Fused Location Provider. + * + * Generated from protobuf enum FUSED_LOCATION_PROVIDER = 100; + */ + const FUSED_LOCATION_PROVIDER = 100; + /** + * The location provider on Apple operating systems. + * + * Generated from protobuf enum CORE_LOCATION = 200; + */ + const CORE_LOCATION = 200; + + private static $valueToName = [ + self::UNKNOWN_SENSOR => 'UNKNOWN_SENSOR', + self::GPS => 'GPS', + self::NETWORK => 'NETWORK', + self::PASSIVE => 'PASSIVE', + self::ROAD_SNAPPED_LOCATION_PROVIDER => 'ROAD_SNAPPED_LOCATION_PROVIDER', + self::CUSTOMER_SUPPLIED_LOCATION => 'CUSTOMER_SUPPLIED_LOCATION', + self::FLEET_ENGINE_LOCATION => 'FLEET_ENGINE_LOCATION', + self::FUSED_LOCATION_PROVIDER => 'FUSED_LOCATION_PROVIDER', + self::CORE_LOCATION => 'CORE_LOCATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/NavigationStatus.php b/MapsFleetEngine/src/V1/NavigationStatus.php new file mode 100644 index 000000000000..40e2a39a9556 --- /dev/null +++ b/MapsFleetEngine/src/V1/NavigationStatus.php @@ -0,0 +1,76 @@ +maps.fleetengine.v1.NavigationStatus + */ +class NavigationStatus +{ + /** + * Unspecified navigation status. + * + * Generated from protobuf enum UNKNOWN_NAVIGATION_STATUS = 0; + */ + const UNKNOWN_NAVIGATION_STATUS = 0; + /** + * The Driver app's navigation is in `FREE_NAV` mode. + * + * Generated from protobuf enum NO_GUIDANCE = 1; + */ + const NO_GUIDANCE = 1; + /** + * Turn-by-turn navigation is available and the Driver app navigation has + * entered `GUIDED_NAV` mode. + * + * Generated from protobuf enum ENROUTE_TO_DESTINATION = 2; + */ + const ENROUTE_TO_DESTINATION = 2; + /** + * The vehicle has gone off the suggested route. + * + * Generated from protobuf enum OFF_ROUTE = 3; + */ + const OFF_ROUTE = 3; + /** + * The vehicle is within approximately 50m of the destination. + * + * Generated from protobuf enum ARRIVED_AT_DESTINATION = 4; + */ + const ARRIVED_AT_DESTINATION = 4; + + private static $valueToName = [ + self::UNKNOWN_NAVIGATION_STATUS => 'UNKNOWN_NAVIGATION_STATUS', + self::NO_GUIDANCE => 'NO_GUIDANCE', + self::ENROUTE_TO_DESTINATION => 'ENROUTE_TO_DESTINATION', + self::OFF_ROUTE => 'OFF_ROUTE', + self::ARRIVED_AT_DESTINATION => 'ARRIVED_AT_DESTINATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/PolylineFormatType.php b/MapsFleetEngine/src/V1/PolylineFormatType.php new file mode 100644 index 000000000000..40a6b80a1726 --- /dev/null +++ b/MapsFleetEngine/src/V1/PolylineFormatType.php @@ -0,0 +1,62 @@ +maps.fleetengine.v1.PolylineFormatType + */ +class PolylineFormatType +{ + /** + * The format is unspecified or unknown. + * + * Generated from protobuf enum UNKNOWN_FORMAT_TYPE = 0; + */ + const UNKNOWN_FORMAT_TYPE = 0; + /** + * A list of `google.type.LatLng`. + * + * Generated from protobuf enum LAT_LNG_LIST_TYPE = 1; + */ + const LAT_LNG_LIST_TYPE = 1; + /** + * A polyline encoded with a polyline compression algorithm. Decoding is not + * yet supported. + * + * Generated from protobuf enum ENCODED_POLYLINE_TYPE = 2; + */ + const ENCODED_POLYLINE_TYPE = 2; + + private static $valueToName = [ + self::UNKNOWN_FORMAT_TYPE => 'UNKNOWN_FORMAT_TYPE', + self::LAT_LNG_LIST_TYPE => 'LAT_LNG_LIST_TYPE', + self::ENCODED_POLYLINE_TYPE => 'ENCODED_POLYLINE_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/PowerSource.php b/MapsFleetEngine/src/V1/PowerSource.php new file mode 100644 index 000000000000..1dd4ecfc1b49 --- /dev/null +++ b/MapsFleetEngine/src/V1/PowerSource.php @@ -0,0 +1,75 @@ +maps.fleetengine.v1.PowerSource + */ +class PowerSource +{ + /** + * Power source unknown. + * + * Generated from protobuf enum UNKNOWN_POWER_SOURCE = 0; + */ + const UNKNOWN_POWER_SOURCE = 0; + /** + * Power source is an AC charger. + * + * Generated from protobuf enum POWER_SOURCE_AC = 1; + */ + const POWER_SOURCE_AC = 1; + /** + * Power source is a USB port. + * + * Generated from protobuf enum POWER_SOURCE_USB = 2; + */ + const POWER_SOURCE_USB = 2; + /** + * Power source is wireless. + * + * Generated from protobuf enum POWER_SOURCE_WIRELESS = 3; + */ + const POWER_SOURCE_WIRELESS = 3; + /** + * Battery is unplugged. + * + * Generated from protobuf enum POWER_SOURCE_UNPLUGGED = 4; + */ + const POWER_SOURCE_UNPLUGGED = 4; + + private static $valueToName = [ + self::UNKNOWN_POWER_SOURCE => 'UNKNOWN_POWER_SOURCE', + self::POWER_SOURCE_AC => 'POWER_SOURCE_AC', + self::POWER_SOURCE_USB => 'POWER_SOURCE_USB', + self::POWER_SOURCE_WIRELESS => 'POWER_SOURCE_WIRELESS', + self::POWER_SOURCE_UNPLUGGED => 'POWER_SOURCE_UNPLUGGED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/ReportBillableTripRequest.php b/MapsFleetEngine/src/V1/ReportBillableTripRequest.php new file mode 100644 index 000000000000..48d21dc5444e --- /dev/null +++ b/MapsFleetEngine/src/V1/ReportBillableTripRequest.php @@ -0,0 +1,239 @@ +maps.fleetengine.v1.ReportBillableTripRequest + */ +class ReportBillableTripRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Must be in the format + * `providers/{provider}/billableTrips/{billable_trip}`. The + * provider must be the Project ID (for example, `sample-cloud-project`) of + * the Google Cloud Project of which the service account making this call is a + * member. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Two letter country code of the country where the trip takes + * place. Price is defined according to country code. + * + * Generated from protobuf field string country_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $country_code = ''; + /** + * The platform upon which the request was issued. + * + * Generated from protobuf field .maps.fleetengine.v1.BillingPlatformIdentifier platform = 5; + */ + protected $platform = 0; + /** + * The identifiers that are directly related to the trip being reported. These + * are usually IDs (for example, session IDs) of pre-booking operations done + * before the trip ID is available. The number of `related_ids` is + * limited to 50. + * + * Generated from protobuf field repeated string related_ids = 6; + */ + private $related_ids; + /** + * The type of GMP product solution (for example, + * `ON_DEMAND_RIDESHARING_AND_DELIVERIES`) used for the reported trip. + * + * Generated from protobuf field .maps.fleetengine.v1.ReportBillableTripRequest.SolutionType solution_type = 7; + */ + protected $solution_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Must be in the format + * `providers/{provider}/billableTrips/{billable_trip}`. The + * provider must be the Project ID (for example, `sample-cloud-project`) of + * the Google Cloud Project of which the service account making this call is a + * member. + * @type string $country_code + * Required. Two letter country code of the country where the trip takes + * place. Price is defined according to country code. + * @type int $platform + * The platform upon which the request was issued. + * @type array|\Google\Protobuf\Internal\RepeatedField $related_ids + * The identifiers that are directly related to the trip being reported. These + * are usually IDs (for example, session IDs) of pre-booking operations done + * before the trip ID is available. The number of `related_ids` is + * limited to 50. + * @type int $solution_type + * The type of GMP product solution (for example, + * `ON_DEMAND_RIDESHARING_AND_DELIVERIES`) used for the reported trip. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\TripApi::initOnce(); + parent::__construct($data); + } + + /** + * Required. Must be in the format + * `providers/{provider}/billableTrips/{billable_trip}`. The + * provider must be the Project ID (for example, `sample-cloud-project`) of + * the Google Cloud Project of which the service account making this call is a + * member. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Must be in the format + * `providers/{provider}/billableTrips/{billable_trip}`. The + * provider must be the Project ID (for example, `sample-cloud-project`) of + * the Google Cloud Project of which the service account making this call is a + * member. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Two letter country code of the country where the trip takes + * place. Price is defined according to country code. + * + * Generated from protobuf field string country_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCountryCode() + { + return $this->country_code; + } + + /** + * Required. Two letter country code of the country where the trip takes + * place. Price is defined according to country code. + * + * Generated from protobuf field string country_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCountryCode($var) + { + GPBUtil::checkString($var, True); + $this->country_code = $var; + + return $this; + } + + /** + * The platform upon which the request was issued. + * + * Generated from protobuf field .maps.fleetengine.v1.BillingPlatformIdentifier platform = 5; + * @return int + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * The platform upon which the request was issued. + * + * Generated from protobuf field .maps.fleetengine.v1.BillingPlatformIdentifier platform = 5; + * @param int $var + * @return $this + */ + public function setPlatform($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\BillingPlatformIdentifier::class); + $this->platform = $var; + + return $this; + } + + /** + * The identifiers that are directly related to the trip being reported. These + * are usually IDs (for example, session IDs) of pre-booking operations done + * before the trip ID is available. The number of `related_ids` is + * limited to 50. + * + * Generated from protobuf field repeated string related_ids = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelatedIds() + { + return $this->related_ids; + } + + /** + * The identifiers that are directly related to the trip being reported. These + * are usually IDs (for example, session IDs) of pre-booking operations done + * before the trip ID is available. The number of `related_ids` is + * limited to 50. + * + * Generated from protobuf field repeated string related_ids = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelatedIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->related_ids = $arr; + + return $this; + } + + /** + * The type of GMP product solution (for example, + * `ON_DEMAND_RIDESHARING_AND_DELIVERIES`) used for the reported trip. + * + * Generated from protobuf field .maps.fleetengine.v1.ReportBillableTripRequest.SolutionType solution_type = 7; + * @return int + */ + public function getSolutionType() + { + return $this->solution_type; + } + + /** + * The type of GMP product solution (for example, + * `ON_DEMAND_RIDESHARING_AND_DELIVERIES`) used for the reported trip. + * + * Generated from protobuf field .maps.fleetengine.v1.ReportBillableTripRequest.SolutionType solution_type = 7; + * @param int $var + * @return $this + */ + public function setSolutionType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\ReportBillableTripRequest\SolutionType::class); + $this->solution_type = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/ReportBillableTripRequest/SolutionType.php b/MapsFleetEngine/src/V1/ReportBillableTripRequest/SolutionType.php new file mode 100644 index 000000000000..115efc7de189 --- /dev/null +++ b/MapsFleetEngine/src/V1/ReportBillableTripRequest/SolutionType.php @@ -0,0 +1,57 @@ +maps.fleetengine.v1.ReportBillableTripRequest.SolutionType + */ +class SolutionType +{ + /** + * The default value. For backwards-compatibility, the API will use + * `ON_DEMAND_RIDESHARING_AND_DELIVERIES` by default which is the first + * supported solution type. + * + * Generated from protobuf enum SOLUTION_TYPE_UNSPECIFIED = 0; + */ + const SOLUTION_TYPE_UNSPECIFIED = 0; + /** + * The solution is an on-demand ridesharing and deliveries trip. + * + * Generated from protobuf enum ON_DEMAND_RIDESHARING_AND_DELIVERIES = 1; + */ + const ON_DEMAND_RIDESHARING_AND_DELIVERIES = 1; + + private static $valueToName = [ + self::SOLUTION_TYPE_UNSPECIFIED => 'SOLUTION_TYPE_UNSPECIFIED', + self::ON_DEMAND_RIDESHARING_AND_DELIVERIES => 'ON_DEMAND_RIDESHARING_AND_DELIVERIES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngine/src/V1/RequestHeader.php b/MapsFleetEngine/src/V1/RequestHeader.php new file mode 100644 index 000000000000..c892bc38df04 --- /dev/null +++ b/MapsFleetEngine/src/V1/RequestHeader.php @@ -0,0 +1,493 @@ +maps.fleetengine.v1.RequestHeader + */ +class RequestHeader extends \Google\Protobuf\Internal\Message +{ + /** + * The BCP-47 language code, such as en-US or sr-Latn. For more information, + * see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If none + * is specified, the response may be in any language, with a preference for + * English if such a name exists. Field value example: `en-US`. + * + * Generated from protobuf field string language_code = 1; + */ + protected $language_code = ''; + /** + * Required. CLDR region code of the region where the request originates. + * Field value example: `US`. + * + * Generated from protobuf field string region_code = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_code = ''; + /** + * Version of the calling SDK, if applicable. + * The version format is "major.minor.patch", example: `1.1.2`. + * + * Generated from protobuf field string sdk_version = 3; + */ + protected $sdk_version = ''; + /** + * Version of the operating system on which the calling SDK is running. + * Field value examples: `4.4.1`, `12.1`. + * + * Generated from protobuf field string os_version = 4; + */ + protected $os_version = ''; + /** + * Model of the device on which the calling SDK is running. + * Field value examples: `iPhone12,1`, `SM-G920F`. + * + * Generated from protobuf field string device_model = 5; + */ + protected $device_model = ''; + /** + * The type of SDK sending the request. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader.SdkType sdk_type = 6; + */ + protected $sdk_type = 0; + /** + * Version of the MapSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `5.2.1`. + * + * Generated from protobuf field string maps_sdk_version = 7; + */ + protected $maps_sdk_version = ''; + /** + * Version of the NavSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `2.1.0`. + * + * Generated from protobuf field string nav_sdk_version = 8; + */ + protected $nav_sdk_version = ''; + /** + * Platform of the calling SDK. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader.Platform platform = 9; + */ + protected $platform = 0; + /** + * Manufacturer of the Android device from the calling SDK, only applicable + * for the Android SDKs. + * Field value example: `Samsung`. + * + * Generated from protobuf field string manufacturer = 10; + */ + protected $manufacturer = ''; + /** + * Android API level of the calling SDK, only applicable for the Android SDKs. + * Field value example: `23`. + * + * Generated from protobuf field int32 android_api_level = 11; + */ + protected $android_api_level = 0; + /** + * Optional ID that can be provided for logging purposes in order to identify + * the request. + * + * Generated from protobuf field string trace_id = 12; + */ + protected $trace_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * The BCP-47 language code, such as en-US or sr-Latn. For more information, + * see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If none + * is specified, the response may be in any language, with a preference for + * English if such a name exists. Field value example: `en-US`. + * @type string $region_code + * Required. CLDR region code of the region where the request originates. + * Field value example: `US`. + * @type string $sdk_version + * Version of the calling SDK, if applicable. + * The version format is "major.minor.patch", example: `1.1.2`. + * @type string $os_version + * Version of the operating system on which the calling SDK is running. + * Field value examples: `4.4.1`, `12.1`. + * @type string $device_model + * Model of the device on which the calling SDK is running. + * Field value examples: `iPhone12,1`, `SM-G920F`. + * @type int $sdk_type + * The type of SDK sending the request. + * @type string $maps_sdk_version + * Version of the MapSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `5.2.1`. + * @type string $nav_sdk_version + * Version of the NavSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `2.1.0`. + * @type int $platform + * Platform of the calling SDK. + * @type string $manufacturer + * Manufacturer of the Android device from the calling SDK, only applicable + * for the Android SDKs. + * Field value example: `Samsung`. + * @type int $android_api_level + * Android API level of the calling SDK, only applicable for the Android SDKs. + * Field value example: `23`. + * @type string $trace_id + * Optional ID that can be provided for logging purposes in order to identify + * the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Header::initOnce(); + parent::__construct($data); + } + + /** + * The BCP-47 language code, such as en-US or sr-Latn. For more information, + * see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If none + * is specified, the response may be in any language, with a preference for + * English if such a name exists. Field value example: `en-US`. + * + * Generated from protobuf field string language_code = 1; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * The BCP-47 language code, such as en-US or sr-Latn. For more information, + * see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If none + * is specified, the response may be in any language, with a preference for + * English if such a name exists. Field value example: `en-US`. + * + * Generated from protobuf field string language_code = 1; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Required. CLDR region code of the region where the request originates. + * Field value example: `US`. + * + * Generated from protobuf field string region_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. CLDR region code of the region where the request originates. + * Field value example: `US`. + * + * Generated from protobuf field string region_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Version of the calling SDK, if applicable. + * The version format is "major.minor.patch", example: `1.1.2`. + * + * Generated from protobuf field string sdk_version = 3; + * @return string + */ + public function getSdkVersion() + { + return $this->sdk_version; + } + + /** + * Version of the calling SDK, if applicable. + * The version format is "major.minor.patch", example: `1.1.2`. + * + * Generated from protobuf field string sdk_version = 3; + * @param string $var + * @return $this + */ + public function setSdkVersion($var) + { + GPBUtil::checkString($var, True); + $this->sdk_version = $var; + + return $this; + } + + /** + * Version of the operating system on which the calling SDK is running. + * Field value examples: `4.4.1`, `12.1`. + * + * Generated from protobuf field string os_version = 4; + * @return string + */ + public function getOsVersion() + { + return $this->os_version; + } + + /** + * Version of the operating system on which the calling SDK is running. + * Field value examples: `4.4.1`, `12.1`. + * + * Generated from protobuf field string os_version = 4; + * @param string $var + * @return $this + */ + public function setOsVersion($var) + { + GPBUtil::checkString($var, True); + $this->os_version = $var; + + return $this; + } + + /** + * Model of the device on which the calling SDK is running. + * Field value examples: `iPhone12,1`, `SM-G920F`. + * + * Generated from protobuf field string device_model = 5; + * @return string + */ + public function getDeviceModel() + { + return $this->device_model; + } + + /** + * Model of the device on which the calling SDK is running. + * Field value examples: `iPhone12,1`, `SM-G920F`. + * + * Generated from protobuf field string device_model = 5; + * @param string $var + * @return $this + */ + public function setDeviceModel($var) + { + GPBUtil::checkString($var, True); + $this->device_model = $var; + + return $this; + } + + /** + * The type of SDK sending the request. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader.SdkType sdk_type = 6; + * @return int + */ + public function getSdkType() + { + return $this->sdk_type; + } + + /** + * The type of SDK sending the request. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader.SdkType sdk_type = 6; + * @param int $var + * @return $this + */ + public function setSdkType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\RequestHeader\SdkType::class); + $this->sdk_type = $var; + + return $this; + } + + /** + * Version of the MapSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `5.2.1`. + * + * Generated from protobuf field string maps_sdk_version = 7; + * @return string + */ + public function getMapsSdkVersion() + { + return $this->maps_sdk_version; + } + + /** + * Version of the MapSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `5.2.1`. + * + * Generated from protobuf field string maps_sdk_version = 7; + * @param string $var + * @return $this + */ + public function setMapsSdkVersion($var) + { + GPBUtil::checkString($var, True); + $this->maps_sdk_version = $var; + + return $this; + } + + /** + * Version of the NavSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `2.1.0`. + * + * Generated from protobuf field string nav_sdk_version = 8; + * @return string + */ + public function getNavSdkVersion() + { + return $this->nav_sdk_version; + } + + /** + * Version of the NavSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `2.1.0`. + * + * Generated from protobuf field string nav_sdk_version = 8; + * @param string $var + * @return $this + */ + public function setNavSdkVersion($var) + { + GPBUtil::checkString($var, True); + $this->nav_sdk_version = $var; + + return $this; + } + + /** + * Platform of the calling SDK. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader.Platform platform = 9; + * @return int + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Platform of the calling SDK. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader.Platform platform = 9; + * @param int $var + * @return $this + */ + public function setPlatform($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\RequestHeader\Platform::class); + $this->platform = $var; + + return $this; + } + + /** + * Manufacturer of the Android device from the calling SDK, only applicable + * for the Android SDKs. + * Field value example: `Samsung`. + * + * Generated from protobuf field string manufacturer = 10; + * @return string + */ + public function getManufacturer() + { + return $this->manufacturer; + } + + /** + * Manufacturer of the Android device from the calling SDK, only applicable + * for the Android SDKs. + * Field value example: `Samsung`. + * + * Generated from protobuf field string manufacturer = 10; + * @param string $var + * @return $this + */ + public function setManufacturer($var) + { + GPBUtil::checkString($var, True); + $this->manufacturer = $var; + + return $this; + } + + /** + * Android API level of the calling SDK, only applicable for the Android SDKs. + * Field value example: `23`. + * + * Generated from protobuf field int32 android_api_level = 11; + * @return int + */ + public function getAndroidApiLevel() + { + return $this->android_api_level; + } + + /** + * Android API level of the calling SDK, only applicable for the Android SDKs. + * Field value example: `23`. + * + * Generated from protobuf field int32 android_api_level = 11; + * @param int $var + * @return $this + */ + public function setAndroidApiLevel($var) + { + GPBUtil::checkInt32($var); + $this->android_api_level = $var; + + return $this; + } + + /** + * Optional ID that can be provided for logging purposes in order to identify + * the request. + * + * Generated from protobuf field string trace_id = 12; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * Optional ID that can be provided for logging purposes in order to identify + * the request. + * + * Generated from protobuf field string trace_id = 12; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, True); + $this->trace_id = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/RequestHeader/Platform.php b/MapsFleetEngine/src/V1/RequestHeader/Platform.php new file mode 100644 index 000000000000..c4adb39dbc75 --- /dev/null +++ b/MapsFleetEngine/src/V1/RequestHeader/Platform.php @@ -0,0 +1,69 @@ +maps.fleetengine.v1.RequestHeader.Platform + */ +class Platform +{ + /** + * The default value. This value is used if the platform is omitted. + * + * Generated from protobuf enum PLATFORM_UNSPECIFIED = 0; + */ + const PLATFORM_UNSPECIFIED = 0; + /** + * The request is coming from Android. + * + * Generated from protobuf enum ANDROID = 1; + */ + const ANDROID = 1; + /** + * The request is coming from iOS. + * + * Generated from protobuf enum IOS = 2; + */ + const IOS = 2; + /** + * The request is coming from the web. + * + * Generated from protobuf enum WEB = 3; + */ + const WEB = 3; + + private static $valueToName = [ + self::PLATFORM_UNSPECIFIED => 'PLATFORM_UNSPECIFIED', + self::ANDROID => 'ANDROID', + self::IOS => 'IOS', + self::WEB => 'WEB', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngine/src/V1/RequestHeader/SdkType.php b/MapsFleetEngine/src/V1/RequestHeader/SdkType.php new file mode 100644 index 000000000000..306af2aae454 --- /dev/null +++ b/MapsFleetEngine/src/V1/RequestHeader/SdkType.php @@ -0,0 +1,69 @@ +maps.fleetengine.v1.RequestHeader.SdkType + */ +class SdkType +{ + /** + * The default value. This value is used if the `sdk_type` is omitted. + * + * Generated from protobuf enum SDK_TYPE_UNSPECIFIED = 0; + */ + const SDK_TYPE_UNSPECIFIED = 0; + /** + * The calling SDK is Consumer. + * + * Generated from protobuf enum CONSUMER = 1; + */ + const CONSUMER = 1; + /** + * The calling SDK is Driver. + * + * Generated from protobuf enum DRIVER = 2; + */ + const DRIVER = 2; + /** + * The calling SDK is JavaScript. + * + * Generated from protobuf enum JAVASCRIPT = 3; + */ + const JAVASCRIPT = 3; + + private static $valueToName = [ + self::SDK_TYPE_UNSPECIFIED => 'SDK_TYPE_UNSPECIFIED', + self::CONSUMER => 'CONSUMER', + self::DRIVER => 'DRIVER', + self::JAVASCRIPT => 'JAVASCRIPT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngine/src/V1/SearchTripsRequest.php b/MapsFleetEngine/src/V1/SearchTripsRequest.php new file mode 100644 index 000000000000..05455c7754ea --- /dev/null +++ b/MapsFleetEngine/src/V1/SearchTripsRequest.php @@ -0,0 +1,335 @@ +maps.fleetengine.v1.SearchTripsRequest + */ +class SearchTripsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * The vehicle associated with the trips in the request. If unspecified, the + * returned trips do not contain: + * * `current_route_segment` + * * `remaining_waypoints` + * * `remaining_distance_meters` + * * `eta_to_first_waypoint` + * + * Generated from protobuf field string vehicle_id = 4; + */ + protected $vehicle_id = ''; + /** + * If set to true, the response includes Trips that influence a driver's + * route. + * + * Generated from protobuf field bool active_trips_only = 5; + */ + protected $active_trips_only = false; + /** + * If not set, the server decides the number of results to return. + * + * Generated from protobuf field int32 page_size = 6; + */ + protected $page_size = 0; + /** + * Set this to a value previously returned in the `SearchTripsResponse` to + * continue from previous results. + * + * Generated from protobuf field string page_token = 7; + */ + protected $page_token = ''; + /** + * If specified, returns the trips that have not been updated after the time + * `(current - minimum_staleness)`. + * + * Generated from protobuf field .google.protobuf.Duration minimum_staleness = 8; + */ + protected $minimum_staleness = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $parent + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * @type string $vehicle_id + * The vehicle associated with the trips in the request. If unspecified, the + * returned trips do not contain: + * * `current_route_segment` + * * `remaining_waypoints` + * * `remaining_distance_meters` + * * `eta_to_first_waypoint` + * @type bool $active_trips_only + * If set to true, the response includes Trips that influence a driver's + * route. + * @type int $page_size + * If not set, the server decides the number of results to return. + * @type string $page_token + * Set this to a value previously returned in the `SearchTripsResponse` to + * continue from previous results. + * @type \Google\Protobuf\Duration $minimum_staleness + * If specified, returns the trips that have not been updated after the time + * `(current - minimum_staleness)`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\TripApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The vehicle associated with the trips in the request. If unspecified, the + * returned trips do not contain: + * * `current_route_segment` + * * `remaining_waypoints` + * * `remaining_distance_meters` + * * `eta_to_first_waypoint` + * + * Generated from protobuf field string vehicle_id = 4; + * @return string + */ + public function getVehicleId() + { + return $this->vehicle_id; + } + + /** + * The vehicle associated with the trips in the request. If unspecified, the + * returned trips do not contain: + * * `current_route_segment` + * * `remaining_waypoints` + * * `remaining_distance_meters` + * * `eta_to_first_waypoint` + * + * Generated from protobuf field string vehicle_id = 4; + * @param string $var + * @return $this + */ + public function setVehicleId($var) + { + GPBUtil::checkString($var, True); + $this->vehicle_id = $var; + + return $this; + } + + /** + * If set to true, the response includes Trips that influence a driver's + * route. + * + * Generated from protobuf field bool active_trips_only = 5; + * @return bool + */ + public function getActiveTripsOnly() + { + return $this->active_trips_only; + } + + /** + * If set to true, the response includes Trips that influence a driver's + * route. + * + * Generated from protobuf field bool active_trips_only = 5; + * @param bool $var + * @return $this + */ + public function setActiveTripsOnly($var) + { + GPBUtil::checkBool($var); + $this->active_trips_only = $var; + + return $this; + } + + /** + * If not set, the server decides the number of results to return. + * + * Generated from protobuf field int32 page_size = 6; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * If not set, the server decides the number of results to return. + * + * Generated from protobuf field int32 page_size = 6; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Set this to a value previously returned in the `SearchTripsResponse` to + * continue from previous results. + * + * Generated from protobuf field string page_token = 7; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Set this to a value previously returned in the `SearchTripsResponse` to + * continue from previous results. + * + * Generated from protobuf field string page_token = 7; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If specified, returns the trips that have not been updated after the time + * `(current - minimum_staleness)`. + * + * Generated from protobuf field .google.protobuf.Duration minimum_staleness = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getMinimumStaleness() + { + return $this->minimum_staleness; + } + + public function hasMinimumStaleness() + { + return isset($this->minimum_staleness); + } + + public function clearMinimumStaleness() + { + unset($this->minimum_staleness); + } + + /** + * If specified, returns the trips that have not been updated after the time + * `(current - minimum_staleness)`. + * + * Generated from protobuf field .google.protobuf.Duration minimum_staleness = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinimumStaleness($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->minimum_staleness = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/SearchTripsResponse.php b/MapsFleetEngine/src/V1/SearchTripsResponse.php new file mode 100644 index 000000000000..a416a1ded2ab --- /dev/null +++ b/MapsFleetEngine/src/V1/SearchTripsResponse.php @@ -0,0 +1,109 @@ +maps.fleetengine.v1.SearchTripsResponse + */ +class SearchTripsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of trips for the requested vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Trip trips = 1; + */ + private $trips; + /** + * Pass this token in the SearchTripsRequest to page through list results. The + * API returns a trip list on each call, and when no more results remain the + * trip list is empty. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\V1\Trip>|\Google\Protobuf\Internal\RepeatedField $trips + * The list of trips for the requested vehicle. + * @type string $next_page_token + * Pass this token in the SearchTripsRequest to page through list results. The + * API returns a trip list on each call, and when no more results remain the + * trip list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\TripApi::initOnce(); + parent::__construct($data); + } + + /** + * The list of trips for the requested vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Trip trips = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTrips() + { + return $this->trips; + } + + /** + * The list of trips for the requested vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Trip trips = 1; + * @param array<\Google\Maps\FleetEngine\V1\Trip>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTrips($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\Trip::class); + $this->trips = $arr; + + return $this; + } + + /** + * Pass this token in the SearchTripsRequest to page through list results. The + * API returns a trip list on each call, and when no more results remain the + * trip list is empty. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pass this token in the SearchTripsRequest to page through list results. The + * API returns a trip list on each call, and when no more results remain the + * trip list is empty. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/SearchVehiclesRequest.php b/MapsFleetEngine/src/V1/SearchVehiclesRequest.php new file mode 100644 index 000000000000..47e4b07b2d9a --- /dev/null +++ b/MapsFleetEngine/src/V1/SearchVehiclesRequest.php @@ -0,0 +1,1029 @@ +maps.fleetengine.v1.SearchVehiclesRequest + */ +class SearchVehiclesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The pickup point to search near. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation pickup_point = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $pickup_point = null; + /** + * The customer's intended dropoff location. The field is required if + * `trip_types` contains `TripType.SHARED`. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation dropoff_point = 5; + */ + protected $dropoff_point = null; + /** + * Required. Defines the vehicle search radius around the pickup point. Only + * vehicles within the search radius will be returned. Value must be between + * 400 and 10000 meters (inclusive). + * + * Generated from protobuf field int32 pickup_radius_meters = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $pickup_radius_meters = 0; + /** + * Required. Specifies the maximum number of vehicles to return. The value + * must be between 1 and 50 (inclusive). + * + * Generated from protobuf field int32 count = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $count = 0; + /** + * Required. Specifies the number of passengers being considered for a trip. + * The value must be greater than or equal to one. The driver is not + * considered in the capacity value. + * + * Generated from protobuf field int32 minimum_capacity = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $minimum_capacity = 0; + /** + * Required. Represents the type of proposed trip. Must include exactly one + * type. `UNKNOWN_TRIP_TYPE` is not allowed. Restricts the search to only + * those vehicles that can support that trip type. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripType trip_types = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + private $trip_types; + /** + * Restricts the search to only those vehicles that have sent location updates + * to Fleet Engine within the specified duration. Stationary vehicles still + * transmitting their locations are not considered stale. If this field is not + * set, the server uses five minutes as the default value. + * + * Generated from protobuf field .google.protobuf.Duration maximum_staleness = 10; + */ + protected $maximum_staleness = null; + /** + * Required. Restricts the search to vehicles with one of the specified types. + * At least one vehicle type must be specified. VehicleTypes with a category + * of `UNKNOWN` are not allowed. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Vehicle.VehicleType vehicle_types = 14 [(.google.api.field_behavior) = REQUIRED]; + */ + private $vehicle_types; + /** + * Callers can form complex logical operations using any combination of the + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attribute_sets` fields. + * `required_attributes` is a list; `required_one_of_attributes` uses a + * message which allows a list of lists. In combination, the two fields allow + * the composition of this expression: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR + * ...) + * AND + * (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR + * ...) + * ``` + * Restricts the search to only those vehicles with the specified attributes. + * This field is a conjunction/AND operation. A max of 50 required_attributes + * is allowed. This matches the maximum number of attributes allowed on a + * vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute required_attributes = 12; + */ + private $required_attributes; + /** + * Restricts the search to only those vehicles with at least one of + * the specified attributes in each `VehicleAttributeList`. Within each + * list, a vehicle must match at least one of the attributes. This field is an + * inclusive disjunction/OR operation in each `VehicleAttributeList` and a + * conjunction/AND operation across the collection of `VehicleAttributeList`. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttributeList required_one_of_attributes = 15; + */ + private $required_one_of_attributes; + /** + * `required_one_of_attribute_sets` provides additional functionality. + * Similar to `required_one_of_attributes`, `required_one_of_attribute_sets` + * uses a message which allows a list of lists, allowing expressions such as + * this one: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * ( + * (required_one_of_attribute_sets[0][0] AND + * required_one_of_attribute_sets[0][1] AND + * ...) + * OR + * (required_one_of_attribute_sets[1][0] AND + * required_one_of_attribute_sets[1][1] AND + * ...) + * ) + * ``` + * Restricts the search to only those vehicles with all the attributes in a + * `VehicleAttributeList`. Within each list, a + * vehicle must match all of the attributes. This field is a conjunction/AND + * operation in each `VehicleAttributeList` and inclusive disjunction/OR + * operation across the collection of `VehicleAttributeList`. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttributeList required_one_of_attribute_sets = 20; + */ + private $required_one_of_attribute_sets; + /** + * Required. Specifies the desired ordering criterion for results. + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder order_by = 13 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $order_by = 0; + /** + * This indicates if vehicles with a single active trip are eligible for this + * search. This field is only used when `current_trips_present` is + * unspecified. When `current_trips_present` is unspecified and this field + * is `false`, vehicles with assigned trips are excluded from the search + * results. When `current_trips_present` is unspecified and this field is + * `true`, search results can include vehicles with one active trip that has a + * status of `ENROUTE_TO_DROPOFF`. When `current_trips_present` is specified, + * this field cannot be set to true. + * The default value is `false`. + * + * Generated from protobuf field bool include_back_to_back = 18; + */ + protected $include_back_to_back = false; + /** + * Indicates the trip associated with this `SearchVehicleRequest`. + * + * Generated from protobuf field string trip_id = 19; + */ + protected $trip_id = ''; + /** + * This indicates if vehicles with active trips are eligible for this search. + * This must be set to something other than + * `CURRENT_TRIPS_PRESENT_UNSPECIFIED` if `trip_type` includes `SHARED`. + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.CurrentTripsPresent current_trips_present = 21; + */ + protected $current_trips_present = 0; + /** + * Optional. A filter query to apply when searching vehicles. See + * http://aip.dev/160 for examples of the filter syntax. + * This field is designed to replace the `required_attributes`, + * `required_one_of_attributes`, and `required_one_of_attributes_sets` fields. + * If a non-empty value is specified here, the following fields must be empty: + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attributes_sets`. + * This filter functions as an AND clause with other constraints, + * such as `minimum_capacity` or `vehicle_types`. + * Note that the only queries supported are on vehicle attributes (for + * example, `attributes. = ` or `attributes. = AND + * attributes. = `). The maximum number of restrictions allowed + * in a filter query is 50. + * Also, all attributes are stored as strings, so the only supported + * comparisons against attributes are string comparisons. In order to compare + * against number or boolean values, the values must be explicitly quoted to + * be treated as strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * + * Generated from protobuf field string filter = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $parent + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * @type \Google\Maps\FleetEngine\V1\TerminalLocation $pickup_point + * Required. The pickup point to search near. + * @type \Google\Maps\FleetEngine\V1\TerminalLocation $dropoff_point + * The customer's intended dropoff location. The field is required if + * `trip_types` contains `TripType.SHARED`. + * @type int $pickup_radius_meters + * Required. Defines the vehicle search radius around the pickup point. Only + * vehicles within the search radius will be returned. Value must be between + * 400 and 10000 meters (inclusive). + * @type int $count + * Required. Specifies the maximum number of vehicles to return. The value + * must be between 1 and 50 (inclusive). + * @type int $minimum_capacity + * Required. Specifies the number of passengers being considered for a trip. + * The value must be greater than or equal to one. The driver is not + * considered in the capacity value. + * @type array|\Google\Protobuf\Internal\RepeatedField $trip_types + * Required. Represents the type of proposed trip. Must include exactly one + * type. `UNKNOWN_TRIP_TYPE` is not allowed. Restricts the search to only + * those vehicles that can support that trip type. + * @type \Google\Protobuf\Duration $maximum_staleness + * Restricts the search to only those vehicles that have sent location updates + * to Fleet Engine within the specified duration. Stationary vehicles still + * transmitting their locations are not considered stale. If this field is not + * set, the server uses five minutes as the default value. + * @type array<\Google\Maps\FleetEngine\V1\Vehicle\VehicleType>|\Google\Protobuf\Internal\RepeatedField $vehicle_types + * Required. Restricts the search to vehicles with one of the specified types. + * At least one vehicle type must be specified. VehicleTypes with a category + * of `UNKNOWN` are not allowed. + * @type array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $required_attributes + * Callers can form complex logical operations using any combination of the + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attribute_sets` fields. + * `required_attributes` is a list; `required_one_of_attributes` uses a + * message which allows a list of lists. In combination, the two fields allow + * the composition of this expression: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR + * ...) + * AND + * (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR + * ...) + * ``` + * Restricts the search to only those vehicles with the specified attributes. + * This field is a conjunction/AND operation. A max of 50 required_attributes + * is allowed. This matches the maximum number of attributes allowed on a + * vehicle. + * @type array<\Google\Maps\FleetEngine\V1\VehicleAttributeList>|\Google\Protobuf\Internal\RepeatedField $required_one_of_attributes + * Restricts the search to only those vehicles with at least one of + * the specified attributes in each `VehicleAttributeList`. Within each + * list, a vehicle must match at least one of the attributes. This field is an + * inclusive disjunction/OR operation in each `VehicleAttributeList` and a + * conjunction/AND operation across the collection of `VehicleAttributeList`. + * @type array<\Google\Maps\FleetEngine\V1\VehicleAttributeList>|\Google\Protobuf\Internal\RepeatedField $required_one_of_attribute_sets + * `required_one_of_attribute_sets` provides additional functionality. + * Similar to `required_one_of_attributes`, `required_one_of_attribute_sets` + * uses a message which allows a list of lists, allowing expressions such as + * this one: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * ( + * (required_one_of_attribute_sets[0][0] AND + * required_one_of_attribute_sets[0][1] AND + * ...) + * OR + * (required_one_of_attribute_sets[1][0] AND + * required_one_of_attribute_sets[1][1] AND + * ...) + * ) + * ``` + * Restricts the search to only those vehicles with all the attributes in a + * `VehicleAttributeList`. Within each list, a + * vehicle must match all of the attributes. This field is a conjunction/AND + * operation in each `VehicleAttributeList` and inclusive disjunction/OR + * operation across the collection of `VehicleAttributeList`. + * @type int $order_by + * Required. Specifies the desired ordering criterion for results. + * @type bool $include_back_to_back + * This indicates if vehicles with a single active trip are eligible for this + * search. This field is only used when `current_trips_present` is + * unspecified. When `current_trips_present` is unspecified and this field + * is `false`, vehicles with assigned trips are excluded from the search + * results. When `current_trips_present` is unspecified and this field is + * `true`, search results can include vehicles with one active trip that has a + * status of `ENROUTE_TO_DROPOFF`. When `current_trips_present` is specified, + * this field cannot be set to true. + * The default value is `false`. + * @type string $trip_id + * Indicates the trip associated with this `SearchVehicleRequest`. + * @type int $current_trips_present + * This indicates if vehicles with active trips are eligible for this search. + * This must be set to something other than + * `CURRENT_TRIPS_PRESENT_UNSPECIFIED` if `trip_type` includes `SHARED`. + * @type string $filter + * Optional. A filter query to apply when searching vehicles. See + * http://aip.dev/160 for examples of the filter syntax. + * This field is designed to replace the `required_attributes`, + * `required_one_of_attributes`, and `required_one_of_attributes_sets` fields. + * If a non-empty value is specified here, the following fields must be empty: + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attributes_sets`. + * This filter functions as an AND clause with other constraints, + * such as `minimum_capacity` or `vehicle_types`. + * Note that the only queries supported are on vehicle attributes (for + * example, `attributes. = ` or `attributes. = AND + * attributes. = `). The maximum number of restrictions allowed + * in a filter query is 50. + * Also, all attributes are stored as strings, so the only supported + * comparisons against attributes are string comparisons. In order to compare + * against number or boolean values, the values must be explicitly quoted to + * be treated as strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The pickup point to search near. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation pickup_point = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\V1\TerminalLocation|null + */ + public function getPickupPoint() + { + return $this->pickup_point; + } + + public function hasPickupPoint() + { + return isset($this->pickup_point); + } + + public function clearPickupPoint() + { + unset($this->pickup_point); + } + + /** + * Required. The pickup point to search near. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation pickup_point = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\V1\TerminalLocation $var + * @return $this + */ + public function setPickupPoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\TerminalLocation::class); + $this->pickup_point = $var; + + return $this; + } + + /** + * The customer's intended dropoff location. The field is required if + * `trip_types` contains `TripType.SHARED`. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation dropoff_point = 5; + * @return \Google\Maps\FleetEngine\V1\TerminalLocation|null + */ + public function getDropoffPoint() + { + return $this->dropoff_point; + } + + public function hasDropoffPoint() + { + return isset($this->dropoff_point); + } + + public function clearDropoffPoint() + { + unset($this->dropoff_point); + } + + /** + * The customer's intended dropoff location. The field is required if + * `trip_types` contains `TripType.SHARED`. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation dropoff_point = 5; + * @param \Google\Maps\FleetEngine\V1\TerminalLocation $var + * @return $this + */ + public function setDropoffPoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\TerminalLocation::class); + $this->dropoff_point = $var; + + return $this; + } + + /** + * Required. Defines the vehicle search radius around the pickup point. Only + * vehicles within the search radius will be returned. Value must be between + * 400 and 10000 meters (inclusive). + * + * Generated from protobuf field int32 pickup_radius_meters = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getPickupRadiusMeters() + { + return $this->pickup_radius_meters; + } + + /** + * Required. Defines the vehicle search radius around the pickup point. Only + * vehicles within the search radius will be returned. Value must be between + * 400 and 10000 meters (inclusive). + * + * Generated from protobuf field int32 pickup_radius_meters = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setPickupRadiusMeters($var) + { + GPBUtil::checkInt32($var); + $this->pickup_radius_meters = $var; + + return $this; + } + + /** + * Required. Specifies the maximum number of vehicles to return. The value + * must be between 1 and 50 (inclusive). + * + * Generated from protobuf field int32 count = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getCount() + { + return $this->count; + } + + /** + * Required. Specifies the maximum number of vehicles to return. The value + * must be between 1 and 50 (inclusive). + * + * Generated from protobuf field int32 count = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt32($var); + $this->count = $var; + + return $this; + } + + /** + * Required. Specifies the number of passengers being considered for a trip. + * The value must be greater than or equal to one. The driver is not + * considered in the capacity value. + * + * Generated from protobuf field int32 minimum_capacity = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMinimumCapacity() + { + return $this->minimum_capacity; + } + + /** + * Required. Specifies the number of passengers being considered for a trip. + * The value must be greater than or equal to one. The driver is not + * considered in the capacity value. + * + * Generated from protobuf field int32 minimum_capacity = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMinimumCapacity($var) + { + GPBUtil::checkInt32($var); + $this->minimum_capacity = $var; + + return $this; + } + + /** + * Required. Represents the type of proposed trip. Must include exactly one + * type. `UNKNOWN_TRIP_TYPE` is not allowed. Restricts the search to only + * those vehicles that can support that trip type. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripType trip_types = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTripTypes() + { + return $this->trip_types; + } + + /** + * Required. Represents the type of proposed trip. Must include exactly one + * type. `UNKNOWN_TRIP_TYPE` is not allowed. Restricts the search to only + * those vehicles that can support that trip type. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripType trip_types = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTripTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Maps\FleetEngine\V1\TripType::class); + $this->trip_types = $arr; + + return $this; + } + + /** + * Restricts the search to only those vehicles that have sent location updates + * to Fleet Engine within the specified duration. Stationary vehicles still + * transmitting their locations are not considered stale. If this field is not + * set, the server uses five minutes as the default value. + * + * Generated from protobuf field .google.protobuf.Duration maximum_staleness = 10; + * @return \Google\Protobuf\Duration|null + */ + public function getMaximumStaleness() + { + return $this->maximum_staleness; + } + + public function hasMaximumStaleness() + { + return isset($this->maximum_staleness); + } + + public function clearMaximumStaleness() + { + unset($this->maximum_staleness); + } + + /** + * Restricts the search to only those vehicles that have sent location updates + * to Fleet Engine within the specified duration. Stationary vehicles still + * transmitting their locations are not considered stale. If this field is not + * set, the server uses five minutes as the default value. + * + * Generated from protobuf field .google.protobuf.Duration maximum_staleness = 10; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaximumStaleness($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->maximum_staleness = $var; + + return $this; + } + + /** + * Required. Restricts the search to vehicles with one of the specified types. + * At least one vehicle type must be specified. VehicleTypes with a category + * of `UNKNOWN` are not allowed. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Vehicle.VehicleType vehicle_types = 14 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVehicleTypes() + { + return $this->vehicle_types; + } + + /** + * Required. Restricts the search to vehicles with one of the specified types. + * At least one vehicle type must be specified. VehicleTypes with a category + * of `UNKNOWN` are not allowed. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Vehicle.VehicleType vehicle_types = 14 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Maps\FleetEngine\V1\Vehicle\VehicleType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVehicleTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\Vehicle\VehicleType::class); + $this->vehicle_types = $arr; + + return $this; + } + + /** + * Callers can form complex logical operations using any combination of the + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attribute_sets` fields. + * `required_attributes` is a list; `required_one_of_attributes` uses a + * message which allows a list of lists. In combination, the two fields allow + * the composition of this expression: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR + * ...) + * AND + * (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR + * ...) + * ``` + * Restricts the search to only those vehicles with the specified attributes. + * This field is a conjunction/AND operation. A max of 50 required_attributes + * is allowed. This matches the maximum number of attributes allowed on a + * vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute required_attributes = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequiredAttributes() + { + return $this->required_attributes; + } + + /** + * Callers can form complex logical operations using any combination of the + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attribute_sets` fields. + * `required_attributes` is a list; `required_one_of_attributes` uses a + * message which allows a list of lists. In combination, the two fields allow + * the composition of this expression: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR + * ...) + * AND + * (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR + * ...) + * ``` + * Restricts the search to only those vehicles with the specified attributes. + * This field is a conjunction/AND operation. A max of 50 required_attributes + * is allowed. This matches the maximum number of attributes allowed on a + * vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute required_attributes = 12; + * @param array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequiredAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\VehicleAttribute::class); + $this->required_attributes = $arr; + + return $this; + } + + /** + * Restricts the search to only those vehicles with at least one of + * the specified attributes in each `VehicleAttributeList`. Within each + * list, a vehicle must match at least one of the attributes. This field is an + * inclusive disjunction/OR operation in each `VehicleAttributeList` and a + * conjunction/AND operation across the collection of `VehicleAttributeList`. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttributeList required_one_of_attributes = 15; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequiredOneOfAttributes() + { + return $this->required_one_of_attributes; + } + + /** + * Restricts the search to only those vehicles with at least one of + * the specified attributes in each `VehicleAttributeList`. Within each + * list, a vehicle must match at least one of the attributes. This field is an + * inclusive disjunction/OR operation in each `VehicleAttributeList` and a + * conjunction/AND operation across the collection of `VehicleAttributeList`. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttributeList required_one_of_attributes = 15; + * @param array<\Google\Maps\FleetEngine\V1\VehicleAttributeList>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequiredOneOfAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\VehicleAttributeList::class); + $this->required_one_of_attributes = $arr; + + return $this; + } + + /** + * `required_one_of_attribute_sets` provides additional functionality. + * Similar to `required_one_of_attributes`, `required_one_of_attribute_sets` + * uses a message which allows a list of lists, allowing expressions such as + * this one: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * ( + * (required_one_of_attribute_sets[0][0] AND + * required_one_of_attribute_sets[0][1] AND + * ...) + * OR + * (required_one_of_attribute_sets[1][0] AND + * required_one_of_attribute_sets[1][1] AND + * ...) + * ) + * ``` + * Restricts the search to only those vehicles with all the attributes in a + * `VehicleAttributeList`. Within each list, a + * vehicle must match all of the attributes. This field is a conjunction/AND + * operation in each `VehicleAttributeList` and inclusive disjunction/OR + * operation across the collection of `VehicleAttributeList`. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttributeList required_one_of_attribute_sets = 20; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequiredOneOfAttributeSets() + { + return $this->required_one_of_attribute_sets; + } + + /** + * `required_one_of_attribute_sets` provides additional functionality. + * Similar to `required_one_of_attributes`, `required_one_of_attribute_sets` + * uses a message which allows a list of lists, allowing expressions such as + * this one: + * ``` + * (required_attributes[0] AND required_attributes[1] AND ...) + * AND + * ( + * (required_one_of_attribute_sets[0][0] AND + * required_one_of_attribute_sets[0][1] AND + * ...) + * OR + * (required_one_of_attribute_sets[1][0] AND + * required_one_of_attribute_sets[1][1] AND + * ...) + * ) + * ``` + * Restricts the search to only those vehicles with all the attributes in a + * `VehicleAttributeList`. Within each list, a + * vehicle must match all of the attributes. This field is a conjunction/AND + * operation in each `VehicleAttributeList` and inclusive disjunction/OR + * operation across the collection of `VehicleAttributeList`. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttributeList required_one_of_attribute_sets = 20; + * @param array<\Google\Maps\FleetEngine\V1\VehicleAttributeList>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequiredOneOfAttributeSets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\VehicleAttributeList::class); + $this->required_one_of_attribute_sets = $arr; + + return $this; + } + + /** + * Required. Specifies the desired ordering criterion for results. + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder order_by = 13 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Required. Specifies the desired ordering criterion for results. + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder order_by = 13 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\SearchVehiclesRequest\VehicleMatchOrder::class); + $this->order_by = $var; + + return $this; + } + + /** + * This indicates if vehicles with a single active trip are eligible for this + * search. This field is only used when `current_trips_present` is + * unspecified. When `current_trips_present` is unspecified and this field + * is `false`, vehicles with assigned trips are excluded from the search + * results. When `current_trips_present` is unspecified and this field is + * `true`, search results can include vehicles with one active trip that has a + * status of `ENROUTE_TO_DROPOFF`. When `current_trips_present` is specified, + * this field cannot be set to true. + * The default value is `false`. + * + * Generated from protobuf field bool include_back_to_back = 18; + * @return bool + */ + public function getIncludeBackToBack() + { + return $this->include_back_to_back; + } + + /** + * This indicates if vehicles with a single active trip are eligible for this + * search. This field is only used when `current_trips_present` is + * unspecified. When `current_trips_present` is unspecified and this field + * is `false`, vehicles with assigned trips are excluded from the search + * results. When `current_trips_present` is unspecified and this field is + * `true`, search results can include vehicles with one active trip that has a + * status of `ENROUTE_TO_DROPOFF`. When `current_trips_present` is specified, + * this field cannot be set to true. + * The default value is `false`. + * + * Generated from protobuf field bool include_back_to_back = 18; + * @param bool $var + * @return $this + */ + public function setIncludeBackToBack($var) + { + GPBUtil::checkBool($var); + $this->include_back_to_back = $var; + + return $this; + } + + /** + * Indicates the trip associated with this `SearchVehicleRequest`. + * + * Generated from protobuf field string trip_id = 19; + * @return string + */ + public function getTripId() + { + return $this->trip_id; + } + + /** + * Indicates the trip associated with this `SearchVehicleRequest`. + * + * Generated from protobuf field string trip_id = 19; + * @param string $var + * @return $this + */ + public function setTripId($var) + { + GPBUtil::checkString($var, True); + $this->trip_id = $var; + + return $this; + } + + /** + * This indicates if vehicles with active trips are eligible for this search. + * This must be set to something other than + * `CURRENT_TRIPS_PRESENT_UNSPECIFIED` if `trip_type` includes `SHARED`. + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.CurrentTripsPresent current_trips_present = 21; + * @return int + */ + public function getCurrentTripsPresent() + { + return $this->current_trips_present; + } + + /** + * This indicates if vehicles with active trips are eligible for this search. + * This must be set to something other than + * `CURRENT_TRIPS_PRESENT_UNSPECIFIED` if `trip_type` includes `SHARED`. + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.CurrentTripsPresent current_trips_present = 21; + * @param int $var + * @return $this + */ + public function setCurrentTripsPresent($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\SearchVehiclesRequest\CurrentTripsPresent::class); + $this->current_trips_present = $var; + + return $this; + } + + /** + * Optional. A filter query to apply when searching vehicles. See + * http://aip.dev/160 for examples of the filter syntax. + * This field is designed to replace the `required_attributes`, + * `required_one_of_attributes`, and `required_one_of_attributes_sets` fields. + * If a non-empty value is specified here, the following fields must be empty: + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attributes_sets`. + * This filter functions as an AND clause with other constraints, + * such as `minimum_capacity` or `vehicle_types`. + * Note that the only queries supported are on vehicle attributes (for + * example, `attributes. = ` or `attributes. = AND + * attributes. = `). The maximum number of restrictions allowed + * in a filter query is 50. + * Also, all attributes are stored as strings, so the only supported + * comparisons against attributes are string comparisons. In order to compare + * against number or boolean values, the values must be explicitly quoted to + * be treated as strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * + * Generated from protobuf field string filter = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter query to apply when searching vehicles. See + * http://aip.dev/160 for examples of the filter syntax. + * This field is designed to replace the `required_attributes`, + * `required_one_of_attributes`, and `required_one_of_attributes_sets` fields. + * If a non-empty value is specified here, the following fields must be empty: + * `required_attributes`, `required_one_of_attributes`, and + * `required_one_of_attributes_sets`. + * This filter functions as an AND clause with other constraints, + * such as `minimum_capacity` or `vehicle_types`. + * Note that the only queries supported are on vehicle attributes (for + * example, `attributes. = ` or `attributes. = AND + * attributes. = `). The maximum number of restrictions allowed + * in a filter query is 50. + * Also, all attributes are stored as strings, so the only supported + * comparisons against attributes are string comparisons. In order to compare + * against number or boolean values, the values must be explicitly quoted to + * be treated as strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * + * Generated from protobuf field string filter = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/SearchVehiclesRequest/CurrentTripsPresent.php b/MapsFleetEngine/src/V1/SearchVehiclesRequest/CurrentTripsPresent.php new file mode 100644 index 000000000000..ce1cc72a495b --- /dev/null +++ b/MapsFleetEngine/src/V1/SearchVehiclesRequest/CurrentTripsPresent.php @@ -0,0 +1,66 @@ +maps.fleetengine.v1.SearchVehiclesRequest.CurrentTripsPresent + */ +class CurrentTripsPresent +{ + /** + * The availability of vehicles with trips present is governed by the + * `include_back_to_back` field. + * + * Generated from protobuf enum CURRENT_TRIPS_PRESENT_UNSPECIFIED = 0; + */ + const CURRENT_TRIPS_PRESENT_UNSPECIFIED = 0; + /** + * Vehicles without trips can appear in search results. When this value is + * used, `include_back_to_back` cannot be `true`. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * Vehicles with at most 5 current trips and 10 waypoints are included + * in the search results. When this value is used, `include_back_to_back` + * cannot be `true`. + * + * Generated from protobuf enum ANY = 2; + */ + const ANY = 2; + + private static $valueToName = [ + self::CURRENT_TRIPS_PRESENT_UNSPECIFIED => 'CURRENT_TRIPS_PRESENT_UNSPECIFIED', + self::NONE => 'NONE', + self::ANY => 'ANY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngine/src/V1/SearchVehiclesRequest/VehicleMatchOrder.php b/MapsFleetEngine/src/V1/SearchVehiclesRequest/VehicleMatchOrder.php new file mode 100644 index 000000000000..e32514141df2 --- /dev/null +++ b/MapsFleetEngine/src/V1/SearchVehiclesRequest/VehicleMatchOrder.php @@ -0,0 +1,88 @@ +maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder + */ +class VehicleMatchOrder +{ + /** + * Default, used for unspecified or unrecognized vehicle matches order. + * + * Generated from protobuf enum UNKNOWN_VEHICLE_MATCH_ORDER = 0; + */ + const UNKNOWN_VEHICLE_MATCH_ORDER = 0; + /** + * Ascending order by vehicle driving time to the pickup point. + * + * Generated from protobuf enum PICKUP_POINT_ETA = 1; + */ + const PICKUP_POINT_ETA = 1; + /** + * Ascending order by vehicle driving distance to the pickup point. + * + * Generated from protobuf enum PICKUP_POINT_DISTANCE = 2; + */ + const PICKUP_POINT_DISTANCE = 2; + /** + * Ascending order by vehicle driving time to the dropoff point. This order + * can only be used if the dropoff point is specified in the request. + * + * Generated from protobuf enum DROPOFF_POINT_ETA = 3; + */ + const DROPOFF_POINT_ETA = 3; + /** + * Ascending order by straight-line distance from the vehicle's last + * reported location to the pickup point. + * + * Generated from protobuf enum PICKUP_POINT_STRAIGHT_DISTANCE = 4; + */ + const PICKUP_POINT_STRAIGHT_DISTANCE = 4; + /** + * Ascending order by the configured match cost. Match cost is defined as a + * weighted calculation between straight-line distance and ETA. Weights are + * set with default values and can be modified per customer. Please contact + * Google support if these weights need to be modified for your project. + * + * Generated from protobuf enum COST = 5; + */ + const COST = 5; + + private static $valueToName = [ + self::UNKNOWN_VEHICLE_MATCH_ORDER => 'UNKNOWN_VEHICLE_MATCH_ORDER', + self::PICKUP_POINT_ETA => 'PICKUP_POINT_ETA', + self::PICKUP_POINT_DISTANCE => 'PICKUP_POINT_DISTANCE', + self::DROPOFF_POINT_ETA => 'DROPOFF_POINT_ETA', + self::PICKUP_POINT_STRAIGHT_DISTANCE => 'PICKUP_POINT_STRAIGHT_DISTANCE', + self::COST => 'COST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngine/src/V1/SearchVehiclesResponse.php b/MapsFleetEngine/src/V1/SearchVehiclesResponse.php new file mode 100644 index 000000000000..c521ea8c385e --- /dev/null +++ b/MapsFleetEngine/src/V1/SearchVehiclesResponse.php @@ -0,0 +1,71 @@ +maps.fleetengine.v1.SearchVehiclesResponse + */ +class SearchVehiclesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of vehicles that match the `SearchVehiclesRequest` criteria, ordered + * according to `SearchVehiclesRequest.order_by` field. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleMatch matches = 1; + */ + private $matches; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\V1\VehicleMatch>|\Google\Protobuf\Internal\RepeatedField $matches + * List of vehicles that match the `SearchVehiclesRequest` criteria, ordered + * according to `SearchVehiclesRequest.order_by` field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * List of vehicles that match the `SearchVehiclesRequest` criteria, ordered + * according to `SearchVehiclesRequest.order_by` field. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleMatch matches = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMatches() + { + return $this->matches; + } + + /** + * List of vehicles that match the `SearchVehiclesRequest` criteria, ordered + * according to `SearchVehiclesRequest.order_by` field. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleMatch matches = 1; + * @param array<\Google\Maps\FleetEngine\V1\VehicleMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMatches($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\VehicleMatch::class); + $this->matches = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/SpeedReadingInterval.php b/MapsFleetEngine/src/V1/SpeedReadingInterval.php new file mode 100644 index 000000000000..53d8e860e1d4 --- /dev/null +++ b/MapsFleetEngine/src/V1/SpeedReadingInterval.php @@ -0,0 +1,145 @@ +maps.fleetengine.v1.SpeedReadingInterval + */ +class SpeedReadingInterval extends \Google\Protobuf\Internal\Message +{ + /** + * The starting index of this interval in the path. + * In JSON, when the index is 0, the field will appear to be unpopulated. + * + * Generated from protobuf field int32 start_polyline_point_index = 1; + */ + protected $start_polyline_point_index = 0; + /** + * The ending index of this interval in the path. + * In JSON, when the index is 0, the field will appear to be unpopulated. + * + * Generated from protobuf field int32 end_polyline_point_index = 2; + */ + protected $end_polyline_point_index = 0; + /** + * Traffic speed in this interval. + * + * Generated from protobuf field .maps.fleetengine.v1.SpeedReadingInterval.Speed speed = 3; + */ + protected $speed = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start_polyline_point_index + * The starting index of this interval in the path. + * In JSON, when the index is 0, the field will appear to be unpopulated. + * @type int $end_polyline_point_index + * The ending index of this interval in the path. + * In JSON, when the index is 0, the field will appear to be unpopulated. + * @type int $speed + * Traffic speed in this interval. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Traffic::initOnce(); + parent::__construct($data); + } + + /** + * The starting index of this interval in the path. + * In JSON, when the index is 0, the field will appear to be unpopulated. + * + * Generated from protobuf field int32 start_polyline_point_index = 1; + * @return int + */ + public function getStartPolylinePointIndex() + { + return $this->start_polyline_point_index; + } + + /** + * The starting index of this interval in the path. + * In JSON, when the index is 0, the field will appear to be unpopulated. + * + * Generated from protobuf field int32 start_polyline_point_index = 1; + * @param int $var + * @return $this + */ + public function setStartPolylinePointIndex($var) + { + GPBUtil::checkInt32($var); + $this->start_polyline_point_index = $var; + + return $this; + } + + /** + * The ending index of this interval in the path. + * In JSON, when the index is 0, the field will appear to be unpopulated. + * + * Generated from protobuf field int32 end_polyline_point_index = 2; + * @return int + */ + public function getEndPolylinePointIndex() + { + return $this->end_polyline_point_index; + } + + /** + * The ending index of this interval in the path. + * In JSON, when the index is 0, the field will appear to be unpopulated. + * + * Generated from protobuf field int32 end_polyline_point_index = 2; + * @param int $var + * @return $this + */ + public function setEndPolylinePointIndex($var) + { + GPBUtil::checkInt32($var); + $this->end_polyline_point_index = $var; + + return $this; + } + + /** + * Traffic speed in this interval. + * + * Generated from protobuf field .maps.fleetengine.v1.SpeedReadingInterval.Speed speed = 3; + * @return int + */ + public function getSpeed() + { + return $this->speed; + } + + /** + * Traffic speed in this interval. + * + * Generated from protobuf field .maps.fleetengine.v1.SpeedReadingInterval.Speed speed = 3; + * @param int $var + * @return $this + */ + public function setSpeed($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\SpeedReadingInterval\Speed::class); + $this->speed = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/SpeedReadingInterval/Speed.php b/MapsFleetEngine/src/V1/SpeedReadingInterval/Speed.php new file mode 100644 index 000000000000..4ad55d637cd3 --- /dev/null +++ b/MapsFleetEngine/src/V1/SpeedReadingInterval/Speed.php @@ -0,0 +1,69 @@ +maps.fleetengine.v1.SpeedReadingInterval.Speed + */ +class Speed +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum SPEED_UNSPECIFIED = 0; + */ + const SPEED_UNSPECIFIED = 0; + /** + * Normal speed, no slowdown is detected. + * + * Generated from protobuf enum NORMAL = 1; + */ + const NORMAL = 1; + /** + * Slowdown detected, but no traffic jam formed. + * + * Generated from protobuf enum SLOW = 2; + */ + const SLOW = 2; + /** + * Traffic jam detected. + * + * Generated from protobuf enum TRAFFIC_JAM = 3; + */ + const TRAFFIC_JAM = 3; + + private static $valueToName = [ + self::SPEED_UNSPECIFIED => 'SPEED_UNSPECIFIED', + self::NORMAL => 'NORMAL', + self::SLOW => 'SLOW', + self::TRAFFIC_JAM => 'TRAFFIC_JAM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngine/src/V1/StopLocation.php b/MapsFleetEngine/src/V1/StopLocation.php new file mode 100644 index 000000000000..6a2b230a3673 --- /dev/null +++ b/MapsFleetEngine/src/V1/StopLocation.php @@ -0,0 +1,172 @@ +maps.fleetengine.v1.StopLocation + */ +class StopLocation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Denotes the actual location. + * + * Generated from protobuf field .google.type.LatLng point = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $point = null; + /** + * Indicates when the stop happened. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 2; + */ + protected $timestamp = null; + /** + * Input only. Deprecated. Use the timestamp field. + * + * Generated from protobuf field .google.protobuf.Timestamp stop_time = 3 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @deprecated + */ + protected $stop_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $point + * Required. Denotes the actual location. + * @type \Google\Protobuf\Timestamp $timestamp + * Indicates when the stop happened. + * @type \Google\Protobuf\Timestamp $stop_time + * Input only. Deprecated. Use the timestamp field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Trips::initOnce(); + parent::__construct($data); + } + + /** + * Required. Denotes the actual location. + * + * Generated from protobuf field .google.type.LatLng point = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\LatLng|null + */ + public function getPoint() + { + return $this->point; + } + + public function hasPoint() + { + return isset($this->point); + } + + public function clearPoint() + { + unset($this->point); + } + + /** + * Required. Denotes the actual location. + * + * Generated from protobuf field .google.type.LatLng point = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setPoint($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->point = $var; + + return $this; + } + + /** + * Indicates when the stop happened. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTimestamp() + { + return $this->timestamp; + } + + public function hasTimestamp() + { + return isset($this->timestamp); + } + + public function clearTimestamp() + { + unset($this->timestamp); + } + + /** + * Indicates when the stop happened. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTimestamp($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->timestamp = $var; + + return $this; + } + + /** + * Input only. Deprecated. Use the timestamp field. + * + * Generated from protobuf field .google.protobuf.Timestamp stop_time = 3 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + * @deprecated + */ + public function getStopTime() + { + @trigger_error('stop_time is deprecated.', E_USER_DEPRECATED); + return $this->stop_time; + } + + public function hasStopTime() + { + @trigger_error('stop_time is deprecated.', E_USER_DEPRECATED); + return isset($this->stop_time); + } + + public function clearStopTime() + { + @trigger_error('stop_time is deprecated.', E_USER_DEPRECATED); + unset($this->stop_time); + } + + /** + * Input only. Deprecated. Use the timestamp field. + * + * Generated from protobuf field .google.protobuf.Timestamp stop_time = 3 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + * @deprecated + */ + public function setStopTime($var) + { + @trigger_error('stop_time is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->stop_time = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/TerminalLocation.php b/MapsFleetEngine/src/V1/TerminalLocation.php new file mode 100644 index 000000000000..aa49ef72b229 --- /dev/null +++ b/MapsFleetEngine/src/V1/TerminalLocation.php @@ -0,0 +1,245 @@ +maps.fleetengine.v1.TerminalLocation + */ +class TerminalLocation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Denotes the location of a trip waypoint. + * + * Generated from protobuf field .google.type.LatLng point = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $point = null; + /** + * Deprecated: Specify the `point` field instead. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalPointId terminal_point_id = 2 [deprecated = true]; + * @deprecated + */ + protected $terminal_point_id = null; + /** + * Deprecated: Specify the `point` field instead. + * + * Generated from protobuf field string access_point_id = 3 [deprecated = true]; + * @deprecated + */ + protected $access_point_id = ''; + /** + * Deprecated. + * + * Generated from protobuf field string trip_id = 4 [deprecated = true]; + * @deprecated + */ + protected $trip_id = ''; + /** + * Deprecated: `Vehicle.waypoint` will have this data. + * + * Generated from protobuf field .maps.fleetengine.v1.WaypointType terminal_location_type = 5 [deprecated = true]; + * @deprecated + */ + protected $terminal_location_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $point + * Required. Denotes the location of a trip waypoint. + * @type \Google\Maps\FleetEngine\V1\TerminalPointId $terminal_point_id + * Deprecated: Specify the `point` field instead. + * @type string $access_point_id + * Deprecated: Specify the `point` field instead. + * @type string $trip_id + * Deprecated. + * @type int $terminal_location_type + * Deprecated: `Vehicle.waypoint` will have this data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Fleetengine::initOnce(); + parent::__construct($data); + } + + /** + * Required. Denotes the location of a trip waypoint. + * + * Generated from protobuf field .google.type.LatLng point = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\LatLng|null + */ + public function getPoint() + { + return $this->point; + } + + public function hasPoint() + { + return isset($this->point); + } + + public function clearPoint() + { + unset($this->point); + } + + /** + * Required. Denotes the location of a trip waypoint. + * + * Generated from protobuf field .google.type.LatLng point = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setPoint($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->point = $var; + + return $this; + } + + /** + * Deprecated: Specify the `point` field instead. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalPointId terminal_point_id = 2 [deprecated = true]; + * @return \Google\Maps\FleetEngine\V1\TerminalPointId|null + * @deprecated + */ + public function getTerminalPointId() + { + @trigger_error('terminal_point_id is deprecated.', E_USER_DEPRECATED); + return $this->terminal_point_id; + } + + public function hasTerminalPointId() + { + @trigger_error('terminal_point_id is deprecated.', E_USER_DEPRECATED); + return isset($this->terminal_point_id); + } + + public function clearTerminalPointId() + { + @trigger_error('terminal_point_id is deprecated.', E_USER_DEPRECATED); + unset($this->terminal_point_id); + } + + /** + * Deprecated: Specify the `point` field instead. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalPointId terminal_point_id = 2 [deprecated = true]; + * @param \Google\Maps\FleetEngine\V1\TerminalPointId $var + * @return $this + * @deprecated + */ + public function setTerminalPointId($var) + { + @trigger_error('terminal_point_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\TerminalPointId::class); + $this->terminal_point_id = $var; + + return $this; + } + + /** + * Deprecated: Specify the `point` field instead. + * + * Generated from protobuf field string access_point_id = 3 [deprecated = true]; + * @return string + * @deprecated + */ + public function getAccessPointId() + { + @trigger_error('access_point_id is deprecated.', E_USER_DEPRECATED); + return $this->access_point_id; + } + + /** + * Deprecated: Specify the `point` field instead. + * + * Generated from protobuf field string access_point_id = 3 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setAccessPointId($var) + { + @trigger_error('access_point_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->access_point_id = $var; + + return $this; + } + + /** + * Deprecated. + * + * Generated from protobuf field string trip_id = 4 [deprecated = true]; + * @return string + * @deprecated + */ + public function getTripId() + { + @trigger_error('trip_id is deprecated.', E_USER_DEPRECATED); + return $this->trip_id; + } + + /** + * Deprecated. + * + * Generated from protobuf field string trip_id = 4 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setTripId($var) + { + @trigger_error('trip_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->trip_id = $var; + + return $this; + } + + /** + * Deprecated: `Vehicle.waypoint` will have this data. + * + * Generated from protobuf field .maps.fleetengine.v1.WaypointType terminal_location_type = 5 [deprecated = true]; + * @return int + * @deprecated + */ + public function getTerminalLocationType() + { + @trigger_error('terminal_location_type is deprecated.', E_USER_DEPRECATED); + return $this->terminal_location_type; + } + + /** + * Deprecated: `Vehicle.waypoint` will have this data. + * + * Generated from protobuf field .maps.fleetengine.v1.WaypointType terminal_location_type = 5 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setTerminalLocationType($var) + { + @trigger_error('terminal_location_type is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\WaypointType::class); + $this->terminal_location_type = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/TerminalPointId.php b/MapsFleetEngine/src/V1/TerminalPointId.php new file mode 100644 index 000000000000..dbd1ada8ce1c --- /dev/null +++ b/MapsFleetEngine/src/V1/TerminalPointId.php @@ -0,0 +1,159 @@ +maps.fleetengine.v1.TerminalPointId + */ +class TerminalPointId extends \Google\Protobuf\Internal\Message +{ + /** + * Deprecated. + * + * Generated from protobuf field string value = 4 [deprecated = true]; + * @deprecated + */ + protected $value = ''; + protected $Id; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $place_id + * Deprecated. + * @type string $generated_id + * Deprecated. + * @type string $value + * Deprecated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Fleetengine::initOnce(); + parent::__construct($data); + } + + /** + * Deprecated. + * + * Generated from protobuf field string place_id = 2 [deprecated = true]; + * @return string + * @deprecated + */ + public function getPlaceId() + { + @trigger_error('place_id is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(2); + } + + public function hasPlaceId() + { + @trigger_error('place_id is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(2); + } + + /** + * Deprecated. + * + * Generated from protobuf field string place_id = 2 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setPlaceId($var) + { + @trigger_error('place_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Deprecated. + * + * Generated from protobuf field string generated_id = 3 [deprecated = true]; + * @return string + * @deprecated + */ + public function getGeneratedId() + { + @trigger_error('generated_id is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(3); + } + + public function hasGeneratedId() + { + @trigger_error('generated_id is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(3); + } + + /** + * Deprecated. + * + * Generated from protobuf field string generated_id = 3 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setGeneratedId($var) + { + @trigger_error('generated_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Deprecated. + * + * Generated from protobuf field string value = 4 [deprecated = true]; + * @return string + * @deprecated + */ + public function getValue() + { + @trigger_error('value is deprecated.', E_USER_DEPRECATED); + return $this->value; + } + + /** + * Deprecated. + * + * Generated from protobuf field string value = 4 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setValue($var) + { + @trigger_error('value is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * @return string + */ + public function getId() + { + return $this->whichOneof("Id"); + } + +} + diff --git a/MapsFleetEngine/src/V1/TrafficPolylineData.php b/MapsFleetEngine/src/V1/TrafficPolylineData.php new file mode 100644 index 000000000000..d40f215739bf --- /dev/null +++ b/MapsFleetEngine/src/V1/TrafficPolylineData.php @@ -0,0 +1,81 @@ +maps.fleetengine.v1.TrafficPolylineData + */ +class TrafficPolylineData extends \Google\Protobuf\Internal\Message +{ + /** + * A polyline rendering of how fast traffic is for all regions along + * one stretch of a customer ride. + * + * Generated from protobuf field .maps.fleetengine.v1.VisualTrafficReportPolylineRendering traffic_rendering = 1; + */ + protected $traffic_rendering = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\VisualTrafficReportPolylineRendering $traffic_rendering + * A polyline rendering of how fast traffic is for all regions along + * one stretch of a customer ride. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Vehicles::initOnce(); + parent::__construct($data); + } + + /** + * A polyline rendering of how fast traffic is for all regions along + * one stretch of a customer ride. + * + * Generated from protobuf field .maps.fleetengine.v1.VisualTrafficReportPolylineRendering traffic_rendering = 1; + * @return \Google\Maps\FleetEngine\V1\VisualTrafficReportPolylineRendering|null + */ + public function getTrafficRendering() + { + return $this->traffic_rendering; + } + + public function hasTrafficRendering() + { + return isset($this->traffic_rendering); + } + + public function clearTrafficRendering() + { + unset($this->traffic_rendering); + } + + /** + * A polyline rendering of how fast traffic is for all regions along + * one stretch of a customer ride. + * + * Generated from protobuf field .maps.fleetengine.v1.VisualTrafficReportPolylineRendering traffic_rendering = 1; + * @param \Google\Maps\FleetEngine\V1\VisualTrafficReportPolylineRendering $var + * @return $this + */ + public function setTrafficRendering($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\VisualTrafficReportPolylineRendering::class); + $this->traffic_rendering = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/Trip.php b/MapsFleetEngine/src/V1/Trip.php new file mode 100644 index 000000000000..8a5d139fee2e --- /dev/null +++ b/MapsFleetEngine/src/V1/Trip.php @@ -0,0 +1,1614 @@ +maps.fleetengine.v1.Trip + */ +class Trip extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. In the format "providers/{provider}/trips/{trip}" + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * ID of the vehicle making this trip. + * + * Generated from protobuf field string vehicle_id = 2; + */ + protected $vehicle_id = ''; + /** + * Current status of the trip. + * + * Generated from protobuf field .maps.fleetengine.v1.TripStatus trip_status = 3; + */ + protected $trip_status = 0; + /** + * The type of the trip. + * + * Generated from protobuf field .maps.fleetengine.v1.TripType trip_type = 4; + */ + protected $trip_type = 0; + /** + * Location where customer indicates they will be picked up. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation pickup_point = 5; + */ + protected $pickup_point = null; + /** + * Input only. The actual location when and where customer was picked up. + * This field is for provider to provide feedback on actual pickup + * information. + * + * Generated from protobuf field .maps.fleetengine.v1.StopLocation actual_pickup_point = 22 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $actual_pickup_point = null; + /** + * Input only. The actual time and location of the driver arrival at + * the pickup point. + * This field is for provider to provide feedback on actual arrival + * information at the pickup point. + * + * Generated from protobuf field .maps.fleetengine.v1.StopLocation actual_pickup_arrival_point = 32 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $actual_pickup_arrival_point = null; + /** + * Output only. Either the estimated future time when the rider(s) will be + * picked up, or the actual time when they were picked up. + * + * Generated from protobuf field .google.protobuf.Timestamp pickup_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $pickup_time = null; + /** + * Intermediate stops in order that the trip requests (in addition + * to pickup and dropoff). Initially this will not be supported for shared + * trips. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TerminalLocation intermediate_destinations = 14; + */ + private $intermediate_destinations; + /** + * Indicates the last time the `intermediate_destinations` was modified. + * Your server should cache this value and pass it in `UpdateTripRequest` + * when update `intermediate_destination_index` to ensure the + * `intermediate_destinations` is not changed. + * + * Generated from protobuf field .google.protobuf.Timestamp intermediate_destinations_version = 25; + */ + protected $intermediate_destinations_version = null; + /** + * When `TripStatus` is `ENROUTE_TO_INTERMEDIATE_DESTINATION`, a number + * between [0..N-1] indicating which intermediate destination the vehicle will + * cross next. When `TripStatus` is `ARRIVED_AT_INTERMEDIATE_DESTINATION`, a + * number between [0..N-1] indicating which intermediate destination the + * vehicle is at. The provider sets this value. If there are no + * `intermediate_destinations`, this field is ignored. + * + * Generated from protobuf field int32 intermediate_destination_index = 15; + */ + protected $intermediate_destination_index = 0; + /** + * Input only. The actual time and location of the driver's arrival at + * an intermediate destination. + * This field is for provider to provide feedback on actual arrival + * information at intermediate destinations. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.StopLocation actual_intermediate_destination_arrival_points = 33 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private $actual_intermediate_destination_arrival_points; + /** + * Input only. The actual time and location when and where the customer was + * picked up from an intermediate destination. This field is for provider to + * provide feedback on actual pickup information at intermediate destinations. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.StopLocation actual_intermediate_destinations = 34 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private $actual_intermediate_destinations; + /** + * Location where customer indicates they will be dropped off. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation dropoff_point = 7; + */ + protected $dropoff_point = null; + /** + * Input only. The actual time and location when and where customer was + * dropped off. This field is for provider to provide feedback on actual + * dropoff information. + * + * Generated from protobuf field .maps.fleetengine.v1.StopLocation actual_dropoff_point = 23 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $actual_dropoff_point = null; + /** + * Output only. Either the estimated future time when the rider(s) will be + * dropped off at the final destination, or the actual time when they were + * dropped off. + * + * Generated from protobuf field .google.protobuf.Timestamp dropoff_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $dropoff_time = null; + /** + * Output only. The full path from the current location to the dropoff point, + * inclusive. This path could include waypoints from other trips. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripWaypoint remaining_waypoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $remaining_waypoints; + /** + * This field supports manual ordering of the waypoints for the trip. It + * contains all of the remaining waypoints for the assigned vehicle, as well + * as the pickup and drop-off waypoints for this trip. If the trip hasn't been + * assigned to a vehicle, then Fleet Engine ignores this field. For privacy + * reasons, this field is only populated by the server on `UpdateTrip` and + * `CreateTrip` calls, NOT on `GetTrip` calls. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripWaypoint vehicle_waypoints = 20; + */ + private $vehicle_waypoints; + /** + * Output only. Anticipated route for this trip to the first entry in + * remaining_waypoints. Note that the first waypoint may belong to a different + * trip. + * + * Generated from protobuf field repeated .google.type.LatLng route = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $route; + /** + * Output only. An encoded path to the next waypoint. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. Decoding is not yet supported. + * + * Generated from protobuf field string current_route_segment = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $current_route_segment = ''; + /** + * Output only. Indicates the last time the route was modified. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $current_route_segment_version = null; + /** + * Output only. Indicates the traffic conditions along the + * `current_route_segment` when they're available. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * + * Generated from protobuf field .maps.fleetengine.v1.ConsumableTrafficPolyline current_route_segment_traffic = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $current_route_segment_traffic = null; + /** + * Output only. Indicates the last time the `current_route_segment_traffic` + * was modified. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_traffic_version = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $current_route_segment_traffic_version = null; + /** + * Output only. The waypoint where `current_route_segment` ends. + * + * Generated from protobuf field .maps.fleetengine.v1.TripWaypoint current_route_segment_end_point = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $current_route_segment_end_point = null; + /** + * Output only. The remaining driving distance in the `current_route_segment` + * field. The value is unspecified if the trip is not assigned to a vehicle, + * or the trip is completed or cancelled. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $remaining_distance_meters = null; + /** + * Output only. The ETA to the next waypoint (the first entry in the + * `remaining_waypoints` field). The value is unspecified if the trip is not + * assigned to a vehicle, or the trip is inactive (completed or cancelled). + * + * Generated from protobuf field .google.protobuf.Timestamp eta_to_first_waypoint = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $eta_to_first_waypoint = null; + /** + * Output only. The duration from when the Trip data is returned to the time + * in `Trip.eta_to_first_waypoint`. The value is unspecified if the trip is + * not assigned to a vehicle, or the trip is inactive (completed or + * cancelled). + * + * Generated from protobuf field .google.protobuf.Duration remaining_time_to_first_waypoint = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $remaining_time_to_first_waypoint = null; + /** + * Output only. Indicates the last time that `remaining_waypoints` was changed + * (a waypoint was added, removed, or changed). + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $remaining_waypoints_version = null; + /** + * Output only. Indicates the last time the + * `remaining_waypoints.path_to_waypoint` and + * `remaining_waypoints.traffic_to_waypoint` were modified. Your client app + * should cache this value and pass it in `GetTripRequest` to ensure the + * paths and traffic for `remaining_waypoints` are only returned if updated. + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_route_version = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $remaining_waypoints_route_version = null; + /** + * Immutable. Indicates the number of passengers on this trip and does not + * include the driver. A vehicle must have available capacity to be returned + * in a `SearchVehicles` response. + * + * Generated from protobuf field int32 number_of_passengers = 10 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $number_of_passengers = 0; + /** + * Output only. Indicates the last reported location of the vehicle along the + * route. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleLocation last_location = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_location = null; + /** + * Output only. Indicates whether the vehicle's `last_location` can be snapped + * to the current_route_segment. False if `last_location` or + * `current_route_segment` doesn't exist. + * It is computed by Fleet Engine. Any update from clients will be ignored. + * + * Generated from protobuf field bool last_location_snappable = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_location_snappable = false; + /** + * The subset of Trip fields that are populated and how they should be + * interpreted. + * + * Generated from protobuf field .maps.fleetengine.v1.TripView view = 31; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. In the format "providers/{provider}/trips/{trip}" + * @type string $vehicle_id + * ID of the vehicle making this trip. + * @type int $trip_status + * Current status of the trip. + * @type int $trip_type + * The type of the trip. + * @type \Google\Maps\FleetEngine\V1\TerminalLocation $pickup_point + * Location where customer indicates they will be picked up. + * @type \Google\Maps\FleetEngine\V1\StopLocation $actual_pickup_point + * Input only. The actual location when and where customer was picked up. + * This field is for provider to provide feedback on actual pickup + * information. + * @type \Google\Maps\FleetEngine\V1\StopLocation $actual_pickup_arrival_point + * Input only. The actual time and location of the driver arrival at + * the pickup point. + * This field is for provider to provide feedback on actual arrival + * information at the pickup point. + * @type \Google\Protobuf\Timestamp $pickup_time + * Output only. Either the estimated future time when the rider(s) will be + * picked up, or the actual time when they were picked up. + * @type array<\Google\Maps\FleetEngine\V1\TerminalLocation>|\Google\Protobuf\Internal\RepeatedField $intermediate_destinations + * Intermediate stops in order that the trip requests (in addition + * to pickup and dropoff). Initially this will not be supported for shared + * trips. + * @type \Google\Protobuf\Timestamp $intermediate_destinations_version + * Indicates the last time the `intermediate_destinations` was modified. + * Your server should cache this value and pass it in `UpdateTripRequest` + * when update `intermediate_destination_index` to ensure the + * `intermediate_destinations` is not changed. + * @type int $intermediate_destination_index + * When `TripStatus` is `ENROUTE_TO_INTERMEDIATE_DESTINATION`, a number + * between [0..N-1] indicating which intermediate destination the vehicle will + * cross next. When `TripStatus` is `ARRIVED_AT_INTERMEDIATE_DESTINATION`, a + * number between [0..N-1] indicating which intermediate destination the + * vehicle is at. The provider sets this value. If there are no + * `intermediate_destinations`, this field is ignored. + * @type array<\Google\Maps\FleetEngine\V1\StopLocation>|\Google\Protobuf\Internal\RepeatedField $actual_intermediate_destination_arrival_points + * Input only. The actual time and location of the driver's arrival at + * an intermediate destination. + * This field is for provider to provide feedback on actual arrival + * information at intermediate destinations. + * @type array<\Google\Maps\FleetEngine\V1\StopLocation>|\Google\Protobuf\Internal\RepeatedField $actual_intermediate_destinations + * Input only. The actual time and location when and where the customer was + * picked up from an intermediate destination. This field is for provider to + * provide feedback on actual pickup information at intermediate destinations. + * @type \Google\Maps\FleetEngine\V1\TerminalLocation $dropoff_point + * Location where customer indicates they will be dropped off. + * @type \Google\Maps\FleetEngine\V1\StopLocation $actual_dropoff_point + * Input only. The actual time and location when and where customer was + * dropped off. This field is for provider to provide feedback on actual + * dropoff information. + * @type \Google\Protobuf\Timestamp $dropoff_time + * Output only. Either the estimated future time when the rider(s) will be + * dropped off at the final destination, or the actual time when they were + * dropped off. + * @type array<\Google\Maps\FleetEngine\V1\TripWaypoint>|\Google\Protobuf\Internal\RepeatedField $remaining_waypoints + * Output only. The full path from the current location to the dropoff point, + * inclusive. This path could include waypoints from other trips. + * @type array<\Google\Maps\FleetEngine\V1\TripWaypoint>|\Google\Protobuf\Internal\RepeatedField $vehicle_waypoints + * This field supports manual ordering of the waypoints for the trip. It + * contains all of the remaining waypoints for the assigned vehicle, as well + * as the pickup and drop-off waypoints for this trip. If the trip hasn't been + * assigned to a vehicle, then Fleet Engine ignores this field. For privacy + * reasons, this field is only populated by the server on `UpdateTrip` and + * `CreateTrip` calls, NOT on `GetTrip` calls. + * @type array<\Google\Type\LatLng>|\Google\Protobuf\Internal\RepeatedField $route + * Output only. Anticipated route for this trip to the first entry in + * remaining_waypoints. Note that the first waypoint may belong to a different + * trip. + * @type string $current_route_segment + * Output only. An encoded path to the next waypoint. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. Decoding is not yet supported. + * @type \Google\Protobuf\Timestamp $current_route_segment_version + * Output only. Indicates the last time the route was modified. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * @type \Google\Maps\FleetEngine\V1\ConsumableTrafficPolyline $current_route_segment_traffic + * Output only. Indicates the traffic conditions along the + * `current_route_segment` when they're available. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * @type \Google\Protobuf\Timestamp $current_route_segment_traffic_version + * Output only. Indicates the last time the `current_route_segment_traffic` + * was modified. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * @type \Google\Maps\FleetEngine\V1\TripWaypoint $current_route_segment_end_point + * Output only. The waypoint where `current_route_segment` ends. + * @type \Google\Protobuf\Int32Value $remaining_distance_meters + * Output only. The remaining driving distance in the `current_route_segment` + * field. The value is unspecified if the trip is not assigned to a vehicle, + * or the trip is completed or cancelled. + * @type \Google\Protobuf\Timestamp $eta_to_first_waypoint + * Output only. The ETA to the next waypoint (the first entry in the + * `remaining_waypoints` field). The value is unspecified if the trip is not + * assigned to a vehicle, or the trip is inactive (completed or cancelled). + * @type \Google\Protobuf\Duration $remaining_time_to_first_waypoint + * Output only. The duration from when the Trip data is returned to the time + * in `Trip.eta_to_first_waypoint`. The value is unspecified if the trip is + * not assigned to a vehicle, or the trip is inactive (completed or + * cancelled). + * @type \Google\Protobuf\Timestamp $remaining_waypoints_version + * Output only. Indicates the last time that `remaining_waypoints` was changed + * (a waypoint was added, removed, or changed). + * @type \Google\Protobuf\Timestamp $remaining_waypoints_route_version + * Output only. Indicates the last time the + * `remaining_waypoints.path_to_waypoint` and + * `remaining_waypoints.traffic_to_waypoint` were modified. Your client app + * should cache this value and pass it in `GetTripRequest` to ensure the + * paths and traffic for `remaining_waypoints` are only returned if updated. + * @type int $number_of_passengers + * Immutable. Indicates the number of passengers on this trip and does not + * include the driver. A vehicle must have available capacity to be returned + * in a `SearchVehicles` response. + * @type \Google\Maps\FleetEngine\V1\VehicleLocation $last_location + * Output only. Indicates the last reported location of the vehicle along the + * route. + * @type bool $last_location_snappable + * Output only. Indicates whether the vehicle's `last_location` can be snapped + * to the current_route_segment. False if `last_location` or + * `current_route_segment` doesn't exist. + * It is computed by Fleet Engine. Any update from clients will be ignored. + * @type int $view + * The subset of Trip fields that are populated and how they should be + * interpreted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Trips::initOnce(); + parent::__construct($data); + } + + /** + * Output only. In the format "providers/{provider}/trips/{trip}" + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. In the format "providers/{provider}/trips/{trip}" + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * ID of the vehicle making this trip. + * + * Generated from protobuf field string vehicle_id = 2; + * @return string + */ + public function getVehicleId() + { + return $this->vehicle_id; + } + + /** + * ID of the vehicle making this trip. + * + * Generated from protobuf field string vehicle_id = 2; + * @param string $var + * @return $this + */ + public function setVehicleId($var) + { + GPBUtil::checkString($var, True); + $this->vehicle_id = $var; + + return $this; + } + + /** + * Current status of the trip. + * + * Generated from protobuf field .maps.fleetengine.v1.TripStatus trip_status = 3; + * @return int + */ + public function getTripStatus() + { + return $this->trip_status; + } + + /** + * Current status of the trip. + * + * Generated from protobuf field .maps.fleetengine.v1.TripStatus trip_status = 3; + * @param int $var + * @return $this + */ + public function setTripStatus($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\TripStatus::class); + $this->trip_status = $var; + + return $this; + } + + /** + * The type of the trip. + * + * Generated from protobuf field .maps.fleetengine.v1.TripType trip_type = 4; + * @return int + */ + public function getTripType() + { + return $this->trip_type; + } + + /** + * The type of the trip. + * + * Generated from protobuf field .maps.fleetengine.v1.TripType trip_type = 4; + * @param int $var + * @return $this + */ + public function setTripType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\TripType::class); + $this->trip_type = $var; + + return $this; + } + + /** + * Location where customer indicates they will be picked up. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation pickup_point = 5; + * @return \Google\Maps\FleetEngine\V1\TerminalLocation|null + */ + public function getPickupPoint() + { + return $this->pickup_point; + } + + public function hasPickupPoint() + { + return isset($this->pickup_point); + } + + public function clearPickupPoint() + { + unset($this->pickup_point); + } + + /** + * Location where customer indicates they will be picked up. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation pickup_point = 5; + * @param \Google\Maps\FleetEngine\V1\TerminalLocation $var + * @return $this + */ + public function setPickupPoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\TerminalLocation::class); + $this->pickup_point = $var; + + return $this; + } + + /** + * Input only. The actual location when and where customer was picked up. + * This field is for provider to provide feedback on actual pickup + * information. + * + * Generated from protobuf field .maps.fleetengine.v1.StopLocation actual_pickup_point = 22 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Maps\FleetEngine\V1\StopLocation|null + */ + public function getActualPickupPoint() + { + return $this->actual_pickup_point; + } + + public function hasActualPickupPoint() + { + return isset($this->actual_pickup_point); + } + + public function clearActualPickupPoint() + { + unset($this->actual_pickup_point); + } + + /** + * Input only. The actual location when and where customer was picked up. + * This field is for provider to provide feedback on actual pickup + * information. + * + * Generated from protobuf field .maps.fleetengine.v1.StopLocation actual_pickup_point = 22 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Maps\FleetEngine\V1\StopLocation $var + * @return $this + */ + public function setActualPickupPoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\StopLocation::class); + $this->actual_pickup_point = $var; + + return $this; + } + + /** + * Input only. The actual time and location of the driver arrival at + * the pickup point. + * This field is for provider to provide feedback on actual arrival + * information at the pickup point. + * + * Generated from protobuf field .maps.fleetengine.v1.StopLocation actual_pickup_arrival_point = 32 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Maps\FleetEngine\V1\StopLocation|null + */ + public function getActualPickupArrivalPoint() + { + return $this->actual_pickup_arrival_point; + } + + public function hasActualPickupArrivalPoint() + { + return isset($this->actual_pickup_arrival_point); + } + + public function clearActualPickupArrivalPoint() + { + unset($this->actual_pickup_arrival_point); + } + + /** + * Input only. The actual time and location of the driver arrival at + * the pickup point. + * This field is for provider to provide feedback on actual arrival + * information at the pickup point. + * + * Generated from protobuf field .maps.fleetengine.v1.StopLocation actual_pickup_arrival_point = 32 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Maps\FleetEngine\V1\StopLocation $var + * @return $this + */ + public function setActualPickupArrivalPoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\StopLocation::class); + $this->actual_pickup_arrival_point = $var; + + return $this; + } + + /** + * Output only. Either the estimated future time when the rider(s) will be + * picked up, or the actual time when they were picked up. + * + * Generated from protobuf field .google.protobuf.Timestamp pickup_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPickupTime() + { + return $this->pickup_time; + } + + public function hasPickupTime() + { + return isset($this->pickup_time); + } + + public function clearPickupTime() + { + unset($this->pickup_time); + } + + /** + * Output only. Either the estimated future time when the rider(s) will be + * picked up, or the actual time when they were picked up. + * + * Generated from protobuf field .google.protobuf.Timestamp pickup_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPickupTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->pickup_time = $var; + + return $this; + } + + /** + * Intermediate stops in order that the trip requests (in addition + * to pickup and dropoff). Initially this will not be supported for shared + * trips. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TerminalLocation intermediate_destinations = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIntermediateDestinations() + { + return $this->intermediate_destinations; + } + + /** + * Intermediate stops in order that the trip requests (in addition + * to pickup and dropoff). Initially this will not be supported for shared + * trips. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TerminalLocation intermediate_destinations = 14; + * @param array<\Google\Maps\FleetEngine\V1\TerminalLocation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIntermediateDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\TerminalLocation::class); + $this->intermediate_destinations = $arr; + + return $this; + } + + /** + * Indicates the last time the `intermediate_destinations` was modified. + * Your server should cache this value and pass it in `UpdateTripRequest` + * when update `intermediate_destination_index` to ensure the + * `intermediate_destinations` is not changed. + * + * Generated from protobuf field .google.protobuf.Timestamp intermediate_destinations_version = 25; + * @return \Google\Protobuf\Timestamp|null + */ + public function getIntermediateDestinationsVersion() + { + return $this->intermediate_destinations_version; + } + + public function hasIntermediateDestinationsVersion() + { + return isset($this->intermediate_destinations_version); + } + + public function clearIntermediateDestinationsVersion() + { + unset($this->intermediate_destinations_version); + } + + /** + * Indicates the last time the `intermediate_destinations` was modified. + * Your server should cache this value and pass it in `UpdateTripRequest` + * when update `intermediate_destination_index` to ensure the + * `intermediate_destinations` is not changed. + * + * Generated from protobuf field .google.protobuf.Timestamp intermediate_destinations_version = 25; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setIntermediateDestinationsVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->intermediate_destinations_version = $var; + + return $this; + } + + /** + * When `TripStatus` is `ENROUTE_TO_INTERMEDIATE_DESTINATION`, a number + * between [0..N-1] indicating which intermediate destination the vehicle will + * cross next. When `TripStatus` is `ARRIVED_AT_INTERMEDIATE_DESTINATION`, a + * number between [0..N-1] indicating which intermediate destination the + * vehicle is at. The provider sets this value. If there are no + * `intermediate_destinations`, this field is ignored. + * + * Generated from protobuf field int32 intermediate_destination_index = 15; + * @return int + */ + public function getIntermediateDestinationIndex() + { + return $this->intermediate_destination_index; + } + + /** + * When `TripStatus` is `ENROUTE_TO_INTERMEDIATE_DESTINATION`, a number + * between [0..N-1] indicating which intermediate destination the vehicle will + * cross next. When `TripStatus` is `ARRIVED_AT_INTERMEDIATE_DESTINATION`, a + * number between [0..N-1] indicating which intermediate destination the + * vehicle is at. The provider sets this value. If there are no + * `intermediate_destinations`, this field is ignored. + * + * Generated from protobuf field int32 intermediate_destination_index = 15; + * @param int $var + * @return $this + */ + public function setIntermediateDestinationIndex($var) + { + GPBUtil::checkInt32($var); + $this->intermediate_destination_index = $var; + + return $this; + } + + /** + * Input only. The actual time and location of the driver's arrival at + * an intermediate destination. + * This field is for provider to provide feedback on actual arrival + * information at intermediate destinations. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.StopLocation actual_intermediate_destination_arrival_points = 33 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActualIntermediateDestinationArrivalPoints() + { + return $this->actual_intermediate_destination_arrival_points; + } + + /** + * Input only. The actual time and location of the driver's arrival at + * an intermediate destination. + * This field is for provider to provide feedback on actual arrival + * information at intermediate destinations. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.StopLocation actual_intermediate_destination_arrival_points = 33 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param array<\Google\Maps\FleetEngine\V1\StopLocation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActualIntermediateDestinationArrivalPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\StopLocation::class); + $this->actual_intermediate_destination_arrival_points = $arr; + + return $this; + } + + /** + * Input only. The actual time and location when and where the customer was + * picked up from an intermediate destination. This field is for provider to + * provide feedback on actual pickup information at intermediate destinations. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.StopLocation actual_intermediate_destinations = 34 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActualIntermediateDestinations() + { + return $this->actual_intermediate_destinations; + } + + /** + * Input only. The actual time and location when and where the customer was + * picked up from an intermediate destination. This field is for provider to + * provide feedback on actual pickup information at intermediate destinations. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.StopLocation actual_intermediate_destinations = 34 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param array<\Google\Maps\FleetEngine\V1\StopLocation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActualIntermediateDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\StopLocation::class); + $this->actual_intermediate_destinations = $arr; + + return $this; + } + + /** + * Location where customer indicates they will be dropped off. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation dropoff_point = 7; + * @return \Google\Maps\FleetEngine\V1\TerminalLocation|null + */ + public function getDropoffPoint() + { + return $this->dropoff_point; + } + + public function hasDropoffPoint() + { + return isset($this->dropoff_point); + } + + public function clearDropoffPoint() + { + unset($this->dropoff_point); + } + + /** + * Location where customer indicates they will be dropped off. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation dropoff_point = 7; + * @param \Google\Maps\FleetEngine\V1\TerminalLocation $var + * @return $this + */ + public function setDropoffPoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\TerminalLocation::class); + $this->dropoff_point = $var; + + return $this; + } + + /** + * Input only. The actual time and location when and where customer was + * dropped off. This field is for provider to provide feedback on actual + * dropoff information. + * + * Generated from protobuf field .maps.fleetengine.v1.StopLocation actual_dropoff_point = 23 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Maps\FleetEngine\V1\StopLocation|null + */ + public function getActualDropoffPoint() + { + return $this->actual_dropoff_point; + } + + public function hasActualDropoffPoint() + { + return isset($this->actual_dropoff_point); + } + + public function clearActualDropoffPoint() + { + unset($this->actual_dropoff_point); + } + + /** + * Input only. The actual time and location when and where customer was + * dropped off. This field is for provider to provide feedback on actual + * dropoff information. + * + * Generated from protobuf field .maps.fleetengine.v1.StopLocation actual_dropoff_point = 23 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Maps\FleetEngine\V1\StopLocation $var + * @return $this + */ + public function setActualDropoffPoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\StopLocation::class); + $this->actual_dropoff_point = $var; + + return $this; + } + + /** + * Output only. Either the estimated future time when the rider(s) will be + * dropped off at the final destination, or the actual time when they were + * dropped off. + * + * Generated from protobuf field .google.protobuf.Timestamp dropoff_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDropoffTime() + { + return $this->dropoff_time; + } + + public function hasDropoffTime() + { + return isset($this->dropoff_time); + } + + public function clearDropoffTime() + { + unset($this->dropoff_time); + } + + /** + * Output only. Either the estimated future time when the rider(s) will be + * dropped off at the final destination, or the actual time when they were + * dropped off. + * + * Generated from protobuf field .google.protobuf.Timestamp dropoff_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDropoffTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->dropoff_time = $var; + + return $this; + } + + /** + * Output only. The full path from the current location to the dropoff point, + * inclusive. This path could include waypoints from other trips. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripWaypoint remaining_waypoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRemainingWaypoints() + { + return $this->remaining_waypoints; + } + + /** + * Output only. The full path from the current location to the dropoff point, + * inclusive. This path could include waypoints from other trips. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripWaypoint remaining_waypoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Maps\FleetEngine\V1\TripWaypoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRemainingWaypoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\TripWaypoint::class); + $this->remaining_waypoints = $arr; + + return $this; + } + + /** + * This field supports manual ordering of the waypoints for the trip. It + * contains all of the remaining waypoints for the assigned vehicle, as well + * as the pickup and drop-off waypoints for this trip. If the trip hasn't been + * assigned to a vehicle, then Fleet Engine ignores this field. For privacy + * reasons, this field is only populated by the server on `UpdateTrip` and + * `CreateTrip` calls, NOT on `GetTrip` calls. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripWaypoint vehicle_waypoints = 20; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVehicleWaypoints() + { + return $this->vehicle_waypoints; + } + + /** + * This field supports manual ordering of the waypoints for the trip. It + * contains all of the remaining waypoints for the assigned vehicle, as well + * as the pickup and drop-off waypoints for this trip. If the trip hasn't been + * assigned to a vehicle, then Fleet Engine ignores this field. For privacy + * reasons, this field is only populated by the server on `UpdateTrip` and + * `CreateTrip` calls, NOT on `GetTrip` calls. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripWaypoint vehicle_waypoints = 20; + * @param array<\Google\Maps\FleetEngine\V1\TripWaypoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVehicleWaypoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\TripWaypoint::class); + $this->vehicle_waypoints = $arr; + + return $this; + } + + /** + * Output only. Anticipated route for this trip to the first entry in + * remaining_waypoints. Note that the first waypoint may belong to a different + * trip. + * + * Generated from protobuf field repeated .google.type.LatLng route = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoute() + { + return $this->route; + } + + /** + * Output only. Anticipated route for this trip to the first entry in + * remaining_waypoints. Note that the first waypoint may belong to a different + * trip. + * + * Generated from protobuf field repeated .google.type.LatLng route = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Type\LatLng>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoute($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\LatLng::class); + $this->route = $arr; + + return $this; + } + + /** + * Output only. An encoded path to the next waypoint. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. Decoding is not yet supported. + * + * Generated from protobuf field string current_route_segment = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCurrentRouteSegment() + { + return $this->current_route_segment; + } + + /** + * Output only. An encoded path to the next waypoint. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. Decoding is not yet supported. + * + * Generated from protobuf field string current_route_segment = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCurrentRouteSegment($var) + { + GPBUtil::checkString($var, True); + $this->current_route_segment = $var; + + return $this; + } + + /** + * Output only. Indicates the last time the route was modified. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCurrentRouteSegmentVersion() + { + return $this->current_route_segment_version; + } + + public function hasCurrentRouteSegmentVersion() + { + return isset($this->current_route_segment_version); + } + + public function clearCurrentRouteSegmentVersion() + { + unset($this->current_route_segment_version); + } + + /** + * Output only. Indicates the last time the route was modified. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCurrentRouteSegmentVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->current_route_segment_version = $var; + + return $this; + } + + /** + * Output only. Indicates the traffic conditions along the + * `current_route_segment` when they're available. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * + * Generated from protobuf field .maps.fleetengine.v1.ConsumableTrafficPolyline current_route_segment_traffic = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Maps\FleetEngine\V1\ConsumableTrafficPolyline|null + */ + public function getCurrentRouteSegmentTraffic() + { + return $this->current_route_segment_traffic; + } + + public function hasCurrentRouteSegmentTraffic() + { + return isset($this->current_route_segment_traffic); + } + + public function clearCurrentRouteSegmentTraffic() + { + unset($this->current_route_segment_traffic); + } + + /** + * Output only. Indicates the traffic conditions along the + * `current_route_segment` when they're available. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * + * Generated from protobuf field .maps.fleetengine.v1.ConsumableTrafficPolyline current_route_segment_traffic = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Maps\FleetEngine\V1\ConsumableTrafficPolyline $var + * @return $this + */ + public function setCurrentRouteSegmentTraffic($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\ConsumableTrafficPolyline::class); + $this->current_route_segment_traffic = $var; + + return $this; + } + + /** + * Output only. Indicates the last time the `current_route_segment_traffic` + * was modified. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_traffic_version = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCurrentRouteSegmentTrafficVersion() + { + return $this->current_route_segment_traffic_version; + } + + public function hasCurrentRouteSegmentTrafficVersion() + { + return isset($this->current_route_segment_traffic_version); + } + + public function clearCurrentRouteSegmentTrafficVersion() + { + unset($this->current_route_segment_traffic_version); + } + + /** + * Output only. Indicates the last time the `current_route_segment_traffic` + * was modified. + * Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_traffic_version = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCurrentRouteSegmentTrafficVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->current_route_segment_traffic_version = $var; + + return $this; + } + + /** + * Output only. The waypoint where `current_route_segment` ends. + * + * Generated from protobuf field .maps.fleetengine.v1.TripWaypoint current_route_segment_end_point = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Maps\FleetEngine\V1\TripWaypoint|null + */ + public function getCurrentRouteSegmentEndPoint() + { + return $this->current_route_segment_end_point; + } + + public function hasCurrentRouteSegmentEndPoint() + { + return isset($this->current_route_segment_end_point); + } + + public function clearCurrentRouteSegmentEndPoint() + { + unset($this->current_route_segment_end_point); + } + + /** + * Output only. The waypoint where `current_route_segment` ends. + * + * Generated from protobuf field .maps.fleetengine.v1.TripWaypoint current_route_segment_end_point = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Maps\FleetEngine\V1\TripWaypoint $var + * @return $this + */ + public function setCurrentRouteSegmentEndPoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\TripWaypoint::class); + $this->current_route_segment_end_point = $var; + + return $this; + } + + /** + * Output only. The remaining driving distance in the `current_route_segment` + * field. The value is unspecified if the trip is not assigned to a vehicle, + * or the trip is completed or cancelled. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getRemainingDistanceMeters() + { + return $this->remaining_distance_meters; + } + + public function hasRemainingDistanceMeters() + { + return isset($this->remaining_distance_meters); + } + + public function clearRemainingDistanceMeters() + { + unset($this->remaining_distance_meters); + } + + /** + * Returns the unboxed value from getRemainingDistanceMeters() + + * Output only. The remaining driving distance in the `current_route_segment` + * field. The value is unspecified if the trip is not assigned to a vehicle, + * or the trip is completed or cancelled. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|null + */ + public function getRemainingDistanceMetersUnwrapped() + { + return $this->readWrapperValue("remaining_distance_meters"); + } + + /** + * Output only. The remaining driving distance in the `current_route_segment` + * field. The value is unspecified if the trip is not assigned to a vehicle, + * or the trip is completed or cancelled. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setRemainingDistanceMeters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->remaining_distance_meters = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Output only. The remaining driving distance in the `current_route_segment` + * field. The value is unspecified if the trip is not assigned to a vehicle, + * or the trip is completed or cancelled. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|null $var + * @return $this + */ + public function setRemainingDistanceMetersUnwrapped($var) + { + $this->writeWrapperValue("remaining_distance_meters", $var); + return $this;} + + /** + * Output only. The ETA to the next waypoint (the first entry in the + * `remaining_waypoints` field). The value is unspecified if the trip is not + * assigned to a vehicle, or the trip is inactive (completed or cancelled). + * + * Generated from protobuf field .google.protobuf.Timestamp eta_to_first_waypoint = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEtaToFirstWaypoint() + { + return $this->eta_to_first_waypoint; + } + + public function hasEtaToFirstWaypoint() + { + return isset($this->eta_to_first_waypoint); + } + + public function clearEtaToFirstWaypoint() + { + unset($this->eta_to_first_waypoint); + } + + /** + * Output only. The ETA to the next waypoint (the first entry in the + * `remaining_waypoints` field). The value is unspecified if the trip is not + * assigned to a vehicle, or the trip is inactive (completed or cancelled). + * + * Generated from protobuf field .google.protobuf.Timestamp eta_to_first_waypoint = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEtaToFirstWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->eta_to_first_waypoint = $var; + + return $this; + } + + /** + * Output only. The duration from when the Trip data is returned to the time + * in `Trip.eta_to_first_waypoint`. The value is unspecified if the trip is + * not assigned to a vehicle, or the trip is inactive (completed or + * cancelled). + * + * Generated from protobuf field .google.protobuf.Duration remaining_time_to_first_waypoint = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getRemainingTimeToFirstWaypoint() + { + return $this->remaining_time_to_first_waypoint; + } + + public function hasRemainingTimeToFirstWaypoint() + { + return isset($this->remaining_time_to_first_waypoint); + } + + public function clearRemainingTimeToFirstWaypoint() + { + unset($this->remaining_time_to_first_waypoint); + } + + /** + * Output only. The duration from when the Trip data is returned to the time + * in `Trip.eta_to_first_waypoint`. The value is unspecified if the trip is + * not assigned to a vehicle, or the trip is inactive (completed or + * cancelled). + * + * Generated from protobuf field .google.protobuf.Duration remaining_time_to_first_waypoint = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRemainingTimeToFirstWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->remaining_time_to_first_waypoint = $var; + + return $this; + } + + /** + * Output only. Indicates the last time that `remaining_waypoints` was changed + * (a waypoint was added, removed, or changed). + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRemainingWaypointsVersion() + { + return $this->remaining_waypoints_version; + } + + public function hasRemainingWaypointsVersion() + { + return isset($this->remaining_waypoints_version); + } + + public function clearRemainingWaypointsVersion() + { + unset($this->remaining_waypoints_version); + } + + /** + * Output only. Indicates the last time that `remaining_waypoints` was changed + * (a waypoint was added, removed, or changed). + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRemainingWaypointsVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->remaining_waypoints_version = $var; + + return $this; + } + + /** + * Output only. Indicates the last time the + * `remaining_waypoints.path_to_waypoint` and + * `remaining_waypoints.traffic_to_waypoint` were modified. Your client app + * should cache this value and pass it in `GetTripRequest` to ensure the + * paths and traffic for `remaining_waypoints` are only returned if updated. + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_route_version = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRemainingWaypointsRouteVersion() + { + return $this->remaining_waypoints_route_version; + } + + public function hasRemainingWaypointsRouteVersion() + { + return isset($this->remaining_waypoints_route_version); + } + + public function clearRemainingWaypointsRouteVersion() + { + unset($this->remaining_waypoints_route_version); + } + + /** + * Output only. Indicates the last time the + * `remaining_waypoints.path_to_waypoint` and + * `remaining_waypoints.traffic_to_waypoint` were modified. Your client app + * should cache this value and pass it in `GetTripRequest` to ensure the + * paths and traffic for `remaining_waypoints` are only returned if updated. + * + * Generated from protobuf field .google.protobuf.Timestamp remaining_waypoints_route_version = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRemainingWaypointsRouteVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->remaining_waypoints_route_version = $var; + + return $this; + } + + /** + * Immutable. Indicates the number of passengers on this trip and does not + * include the driver. A vehicle must have available capacity to be returned + * in a `SearchVehicles` response. + * + * Generated from protobuf field int32 number_of_passengers = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getNumberOfPassengers() + { + return $this->number_of_passengers; + } + + /** + * Immutable. Indicates the number of passengers on this trip and does not + * include the driver. A vehicle must have available capacity to be returned + * in a `SearchVehicles` response. + * + * Generated from protobuf field int32 number_of_passengers = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setNumberOfPassengers($var) + { + GPBUtil::checkInt32($var); + $this->number_of_passengers = $var; + + return $this; + } + + /** + * Output only. Indicates the last reported location of the vehicle along the + * route. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleLocation last_location = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Maps\FleetEngine\V1\VehicleLocation|null + */ + public function getLastLocation() + { + return $this->last_location; + } + + public function hasLastLocation() + { + return isset($this->last_location); + } + + public function clearLastLocation() + { + unset($this->last_location); + } + + /** + * Output only. Indicates the last reported location of the vehicle along the + * route. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleLocation last_location = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Maps\FleetEngine\V1\VehicleLocation $var + * @return $this + */ + public function setLastLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\VehicleLocation::class); + $this->last_location = $var; + + return $this; + } + + /** + * Output only. Indicates whether the vehicle's `last_location` can be snapped + * to the current_route_segment. False if `last_location` or + * `current_route_segment` doesn't exist. + * It is computed by Fleet Engine. Any update from clients will be ignored. + * + * Generated from protobuf field bool last_location_snappable = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getLastLocationSnappable() + { + return $this->last_location_snappable; + } + + /** + * Output only. Indicates whether the vehicle's `last_location` can be snapped + * to the current_route_segment. False if `last_location` or + * `current_route_segment` doesn't exist. + * It is computed by Fleet Engine. Any update from clients will be ignored. + * + * Generated from protobuf field bool last_location_snappable = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setLastLocationSnappable($var) + { + GPBUtil::checkBool($var); + $this->last_location_snappable = $var; + + return $this; + } + + /** + * The subset of Trip fields that are populated and how they should be + * interpreted. + * + * Generated from protobuf field .maps.fleetengine.v1.TripView view = 31; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The subset of Trip fields that are populated and how they should be + * interpreted. + * + * Generated from protobuf field .maps.fleetengine.v1.TripView view = 31; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\TripView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/TripStatus.php b/MapsFleetEngine/src/V1/TripStatus.php new file mode 100644 index 000000000000..7c6eea573533 --- /dev/null +++ b/MapsFleetEngine/src/V1/TripStatus.php @@ -0,0 +1,111 @@ +maps.fleetengine.v1.TripStatus + */ +class TripStatus +{ + /** + * Default, used for unspecified or unrecognized trip status. + * + * Generated from protobuf enum UNKNOWN_TRIP_STATUS = 0; + */ + const UNKNOWN_TRIP_STATUS = 0; + /** + * Newly created trip. + * + * Generated from protobuf enum NEW = 1; + */ + const PBNEW = 1; + /** + * The driver is on their way to the pickup point. + * + * Generated from protobuf enum ENROUTE_TO_PICKUP = 2; + */ + const ENROUTE_TO_PICKUP = 2; + /** + * The driver has arrived at the pickup point. + * + * Generated from protobuf enum ARRIVED_AT_PICKUP = 3; + */ + const ARRIVED_AT_PICKUP = 3; + /** + * The driver has arrived at an intermediate destination and is waiting for + * the rider. + * + * Generated from protobuf enum ARRIVED_AT_INTERMEDIATE_DESTINATION = 7; + */ + const ARRIVED_AT_INTERMEDIATE_DESTINATION = 7; + /** + * The driver is on their way to an intermediate destination + * (not the dropoff point). + * + * Generated from protobuf enum ENROUTE_TO_INTERMEDIATE_DESTINATION = 8; + */ + const ENROUTE_TO_INTERMEDIATE_DESTINATION = 8; + /** + * The driver has picked up the rider and is on their way to the + * next destination. + * + * Generated from protobuf enum ENROUTE_TO_DROPOFF = 4; + */ + const ENROUTE_TO_DROPOFF = 4; + /** + * The rider has been dropped off and the trip is complete. + * + * Generated from protobuf enum COMPLETE = 5; + */ + const COMPLETE = 5; + /** + * The trip was canceled prior to pickup by the driver, rider, or + * rideshare provider. + * + * Generated from protobuf enum CANCELED = 6; + */ + const CANCELED = 6; + + private static $valueToName = [ + self::UNKNOWN_TRIP_STATUS => 'UNKNOWN_TRIP_STATUS', + self::PBNEW => 'NEW', + self::ENROUTE_TO_PICKUP => 'ENROUTE_TO_PICKUP', + self::ARRIVED_AT_PICKUP => 'ARRIVED_AT_PICKUP', + self::ARRIVED_AT_INTERMEDIATE_DESTINATION => 'ARRIVED_AT_INTERMEDIATE_DESTINATION', + self::ENROUTE_TO_INTERMEDIATE_DESTINATION => 'ENROUTE_TO_INTERMEDIATE_DESTINATION', + self::ENROUTE_TO_DROPOFF => 'ENROUTE_TO_DROPOFF', + self::COMPLETE => 'COMPLETE', + self::CANCELED => 'CANCELED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/TripType.php b/MapsFleetEngine/src/V1/TripType.php new file mode 100644 index 000000000000..94d7f9ab6998 --- /dev/null +++ b/MapsFleetEngine/src/V1/TripType.php @@ -0,0 +1,61 @@ +maps.fleetengine.v1.TripType + */ +class TripType +{ + /** + * Default, used for unspecified or unrecognized trip types. + * + * Generated from protobuf enum UNKNOWN_TRIP_TYPE = 0; + */ + const UNKNOWN_TRIP_TYPE = 0; + /** + * The trip may share a vehicle with other trips. + * + * Generated from protobuf enum SHARED = 1; + */ + const SHARED = 1; + /** + * The trip is exclusive to a vehicle. + * + * Generated from protobuf enum EXCLUSIVE = 2; + */ + const EXCLUSIVE = 2; + + private static $valueToName = [ + self::UNKNOWN_TRIP_TYPE => 'UNKNOWN_TRIP_TYPE', + self::SHARED => 'SHARED', + self::EXCLUSIVE => 'EXCLUSIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/TripView.php b/MapsFleetEngine/src/V1/TripView.php new file mode 100644 index 000000000000..b341430b2420 --- /dev/null +++ b/MapsFleetEngine/src/V1/TripView.php @@ -0,0 +1,67 @@ +maps.fleetengine.v1.TripView + */ +class TripView +{ + /** + * The default value. For backwards-compatibility, the API will default to an + * SDK view. To ensure stability and support, customers are + * advised to select a `TripView` other than `SDK`. + * + * Generated from protobuf enum TRIP_VIEW_UNSPECIFIED = 0; + */ + const TRIP_VIEW_UNSPECIFIED = 0; + /** + * Includes fields that may not be interpretable or supportable using + * publicly available libraries. + * + * Generated from protobuf enum SDK = 1; + */ + const SDK = 1; + /** + * Trip fields are populated for the Journey Sharing use case. This view is + * intended for server-to-server communications. + * + * Generated from protobuf enum JOURNEY_SHARING_V1S = 2; + */ + const JOURNEY_SHARING_V1S = 2; + + private static $valueToName = [ + self::TRIP_VIEW_UNSPECIFIED => 'TRIP_VIEW_UNSPECIFIED', + self::SDK => 'SDK', + self::JOURNEY_SHARING_V1S => 'JOURNEY_SHARING_V1S', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/TripWaypoint.php b/MapsFleetEngine/src/V1/TripWaypoint.php new file mode 100644 index 000000000000..fd7cfea0163e --- /dev/null +++ b/MapsFleetEngine/src/V1/TripWaypoint.php @@ -0,0 +1,451 @@ +maps.fleetengine.v1.TripWaypoint + */ +class TripWaypoint extends \Google\Protobuf\Internal\Message +{ + /** + * The location of this waypoint. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation location = 1; + */ + protected $location = null; + /** + * The trip associated with this waypoint. + * + * Generated from protobuf field string trip_id = 2; + */ + protected $trip_id = ''; + /** + * The role this waypoint plays in this trip, such as pickup or dropoff. + * + * Generated from protobuf field .maps.fleetengine.v1.WaypointType waypoint_type = 3; + */ + protected $waypoint_type = 0; + /** + * The path from the previous waypoint to the current waypoint. Undefined for + * the first waypoint in a list. This field is only populated when requested. + * + * Generated from protobuf field repeated .google.type.LatLng path_to_waypoint = 4; + */ + private $path_to_waypoint; + /** + * The encoded path from the previous waypoint to the current waypoint. + *

Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. Decoding is not yet supported. + * + * Generated from protobuf field string encoded_path_to_waypoint = 5; + */ + protected $encoded_path_to_waypoint = ''; + /** + * The traffic conditions along the path to this waypoint. Note that traffic + * is only available for Google Map Platform Rides and Deliveries Solution + * customers. + * + * Generated from protobuf field .maps.fleetengine.v1.ConsumableTrafficPolyline traffic_to_waypoint = 10; + */ + protected $traffic_to_waypoint = null; + /** + * The path distance from the previous waypoint to the current waypoint. + * Undefined for the first waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Int32Value distance_meters = 6; + */ + protected $distance_meters = null; + /** + * The estimated time of arrival at this waypoint. Undefined for the first + * waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Timestamp eta = 7; + */ + protected $eta = null; + /** + * The travel time from previous waypoint to this point. Undefined for the + * first waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Duration duration = 8; + */ + protected $duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\TerminalLocation $location + * The location of this waypoint. + * @type string $trip_id + * The trip associated with this waypoint. + * @type int $waypoint_type + * The role this waypoint plays in this trip, such as pickup or dropoff. + * @type array<\Google\Type\LatLng>|\Google\Protobuf\Internal\RepeatedField $path_to_waypoint + * The path from the previous waypoint to the current waypoint. Undefined for + * the first waypoint in a list. This field is only populated when requested. + * @type string $encoded_path_to_waypoint + * The encoded path from the previous waypoint to the current waypoint. + *

Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. Decoding is not yet supported. + * @type \Google\Maps\FleetEngine\V1\ConsumableTrafficPolyline $traffic_to_waypoint + * The traffic conditions along the path to this waypoint. Note that traffic + * is only available for Google Map Platform Rides and Deliveries Solution + * customers. + * @type \Google\Protobuf\Int32Value $distance_meters + * The path distance from the previous waypoint to the current waypoint. + * Undefined for the first waypoint in a list. + * @type \Google\Protobuf\Timestamp $eta + * The estimated time of arrival at this waypoint. Undefined for the first + * waypoint in a list. + * @type \Google\Protobuf\Duration $duration + * The travel time from previous waypoint to this point. Undefined for the + * first waypoint in a list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Fleetengine::initOnce(); + parent::__construct($data); + } + + /** + * The location of this waypoint. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation location = 1; + * @return \Google\Maps\FleetEngine\V1\TerminalLocation|null + */ + public function getLocation() + { + return $this->location; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * The location of this waypoint. + * + * Generated from protobuf field .maps.fleetengine.v1.TerminalLocation location = 1; + * @param \Google\Maps\FleetEngine\V1\TerminalLocation $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\TerminalLocation::class); + $this->location = $var; + + return $this; + } + + /** + * The trip associated with this waypoint. + * + * Generated from protobuf field string trip_id = 2; + * @return string + */ + public function getTripId() + { + return $this->trip_id; + } + + /** + * The trip associated with this waypoint. + * + * Generated from protobuf field string trip_id = 2; + * @param string $var + * @return $this + */ + public function setTripId($var) + { + GPBUtil::checkString($var, True); + $this->trip_id = $var; + + return $this; + } + + /** + * The role this waypoint plays in this trip, such as pickup or dropoff. + * + * Generated from protobuf field .maps.fleetengine.v1.WaypointType waypoint_type = 3; + * @return int + */ + public function getWaypointType() + { + return $this->waypoint_type; + } + + /** + * The role this waypoint plays in this trip, such as pickup or dropoff. + * + * Generated from protobuf field .maps.fleetengine.v1.WaypointType waypoint_type = 3; + * @param int $var + * @return $this + */ + public function setWaypointType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\WaypointType::class); + $this->waypoint_type = $var; + + return $this; + } + + /** + * The path from the previous waypoint to the current waypoint. Undefined for + * the first waypoint in a list. This field is only populated when requested. + * + * Generated from protobuf field repeated .google.type.LatLng path_to_waypoint = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPathToWaypoint() + { + return $this->path_to_waypoint; + } + + /** + * The path from the previous waypoint to the current waypoint. Undefined for + * the first waypoint in a list. This field is only populated when requested. + * + * Generated from protobuf field repeated .google.type.LatLng path_to_waypoint = 4; + * @param array<\Google\Type\LatLng>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPathToWaypoint($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\LatLng::class); + $this->path_to_waypoint = $arr; + + return $this; + } + + /** + * The encoded path from the previous waypoint to the current waypoint. + *

Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. Decoding is not yet supported. + * + * Generated from protobuf field string encoded_path_to_waypoint = 5; + * @return string + */ + public function getEncodedPathToWaypoint() + { + return $this->encoded_path_to_waypoint; + } + + /** + * The encoded path from the previous waypoint to the current waypoint. + *

Note: This field is intended only for use by the Driver SDK and Consumer + * SDK. Decoding is not yet supported. + * + * Generated from protobuf field string encoded_path_to_waypoint = 5; + * @param string $var + * @return $this + */ + public function setEncodedPathToWaypoint($var) + { + GPBUtil::checkString($var, True); + $this->encoded_path_to_waypoint = $var; + + return $this; + } + + /** + * The traffic conditions along the path to this waypoint. Note that traffic + * is only available for Google Map Platform Rides and Deliveries Solution + * customers. + * + * Generated from protobuf field .maps.fleetengine.v1.ConsumableTrafficPolyline traffic_to_waypoint = 10; + * @return \Google\Maps\FleetEngine\V1\ConsumableTrafficPolyline|null + */ + public function getTrafficToWaypoint() + { + return $this->traffic_to_waypoint; + } + + public function hasTrafficToWaypoint() + { + return isset($this->traffic_to_waypoint); + } + + public function clearTrafficToWaypoint() + { + unset($this->traffic_to_waypoint); + } + + /** + * The traffic conditions along the path to this waypoint. Note that traffic + * is only available for Google Map Platform Rides and Deliveries Solution + * customers. + * + * Generated from protobuf field .maps.fleetengine.v1.ConsumableTrafficPolyline traffic_to_waypoint = 10; + * @param \Google\Maps\FleetEngine\V1\ConsumableTrafficPolyline $var + * @return $this + */ + public function setTrafficToWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\ConsumableTrafficPolyline::class); + $this->traffic_to_waypoint = $var; + + return $this; + } + + /** + * The path distance from the previous waypoint to the current waypoint. + * Undefined for the first waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Int32Value distance_meters = 6; + * @return \Google\Protobuf\Int32Value|null + */ + public function getDistanceMeters() + { + return $this->distance_meters; + } + + public function hasDistanceMeters() + { + return isset($this->distance_meters); + } + + public function clearDistanceMeters() + { + unset($this->distance_meters); + } + + /** + * Returns the unboxed value from getDistanceMeters() + + * The path distance from the previous waypoint to the current waypoint. + * Undefined for the first waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Int32Value distance_meters = 6; + * @return int|null + */ + public function getDistanceMetersUnwrapped() + { + return $this->readWrapperValue("distance_meters"); + } + + /** + * The path distance from the previous waypoint to the current waypoint. + * Undefined for the first waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Int32Value distance_meters = 6; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setDistanceMeters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->distance_meters = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The path distance from the previous waypoint to the current waypoint. + * Undefined for the first waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Int32Value distance_meters = 6; + * @param int|null $var + * @return $this + */ + public function setDistanceMetersUnwrapped($var) + { + $this->writeWrapperValue("distance_meters", $var); + return $this;} + + /** + * The estimated time of arrival at this waypoint. Undefined for the first + * waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Timestamp eta = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEta() + { + return $this->eta; + } + + public function hasEta() + { + return isset($this->eta); + } + + public function clearEta() + { + unset($this->eta); + } + + /** + * The estimated time of arrival at this waypoint. Undefined for the first + * waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Timestamp eta = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEta($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->eta = $var; + + return $this; + } + + /** + * The travel time from previous waypoint to this point. Undefined for the + * first waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Duration duration = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * The travel time from previous waypoint to this point. Undefined for the + * first waypoint in a list. + * + * Generated from protobuf field .google.protobuf.Duration duration = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/UpdateTripRequest.php b/MapsFleetEngine/src/V1/UpdateTripRequest.php new file mode 100644 index 000000000000..309be11621d8 --- /dev/null +++ b/MapsFleetEngine/src/V1/UpdateTripRequest.php @@ -0,0 +1,355 @@ +maps.fleetengine.v1.UpdateTripRequest + */ +class UpdateTripRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + */ + protected $header = null; + /** + * Required. Must be in the format + * `providers/{provider}/trips/{trip}`. The provider must + * be the Project ID (for example, `sample-consumer-project`) of the Google + * Cloud Project of which the service account making this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The Trip associated with the update. + * The following fields are maintained by the Fleet Engine. Do not update + * them using Trip.update. + * * `current_route_segment` + * * `current_route_segment_end_point` + * * `current_route_segment_traffic` + * * `current_route_segment_traffic_version` + * * `current_route_segment_version` + * * `dropoff_time` + * * `eta_to_next_waypoint` + * * `intermediate_destinations_version` + * * `last_location` + * * `name` + * * `number_of_passengers` + * * `pickup_time` + * * `remaining_distance_meters` + * * `remaining_time_to_first_waypoint` + * * `remaining_waypoints` + * * `remaining_waypoints_version` + * * `route` + * When you update the `Trip.vehicle_id` for a shared trip, you must supply + * the list of `Trip.vehicle_waypoints` to specify the order of the remaining + * waypoints, otherwise the order will be undetermined. + * When you specify `Trip.vehicle_waypoints`, the list must contain all + * the remaining waypoints of the vehicle's trips, with no extra waypoints. + * You must order these waypoints such that for a given trip, the pickup + * point is before intermediate destinations, and all intermediate + * destinations come before the drop-off point. An `EXCLUSIVE` trip's + * waypoints must not interleave with any other trips. + * The `trip_id`, `waypoint_type` and `location` fields are used, and all + * other TripWaypoint fields in `vehicle_waypoints` are ignored. + * To avoid a race condition for trips with multiple destinations, you + * should provide `Trip.intermediate_destinations_version` when updating + * the trip status to `ENROUTE_TO_INTERMEDIATE_DESTINATION`. The + * `Trip.intermediate_destinations_version` passed must be consistent with + * Fleet Engine's version. If it isn't, the request fails. + * + * Generated from protobuf field .maps.fleetengine.v1.Trip trip = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $trip = null; + /** + * Required. The field mask indicating which fields in Trip to update. + * The `update_mask` must contain at least one field. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $name + * Required. Must be in the format + * `providers/{provider}/trips/{trip}`. The provider must + * be the Project ID (for example, `sample-consumer-project`) of the Google + * Cloud Project of which the service account making this call is a member. + * @type \Google\Maps\FleetEngine\V1\Trip $trip + * Required. The Trip associated with the update. + * The following fields are maintained by the Fleet Engine. Do not update + * them using Trip.update. + * * `current_route_segment` + * * `current_route_segment_end_point` + * * `current_route_segment_traffic` + * * `current_route_segment_traffic_version` + * * `current_route_segment_version` + * * `dropoff_time` + * * `eta_to_next_waypoint` + * * `intermediate_destinations_version` + * * `last_location` + * * `name` + * * `number_of_passengers` + * * `pickup_time` + * * `remaining_distance_meters` + * * `remaining_time_to_first_waypoint` + * * `remaining_waypoints` + * * `remaining_waypoints_version` + * * `route` + * When you update the `Trip.vehicle_id` for a shared trip, you must supply + * the list of `Trip.vehicle_waypoints` to specify the order of the remaining + * waypoints, otherwise the order will be undetermined. + * When you specify `Trip.vehicle_waypoints`, the list must contain all + * the remaining waypoints of the vehicle's trips, with no extra waypoints. + * You must order these waypoints such that for a given trip, the pickup + * point is before intermediate destinations, and all intermediate + * destinations come before the drop-off point. An `EXCLUSIVE` trip's + * waypoints must not interleave with any other trips. + * The `trip_id`, `waypoint_type` and `location` fields are used, and all + * other TripWaypoint fields in `vehicle_waypoints` are ignored. + * To avoid a race condition for trips with multiple destinations, you + * should provide `Trip.intermediate_destinations_version` when updating + * the trip status to `ENROUTE_TO_INTERMEDIATE_DESTINATION`. The + * `Trip.intermediate_destinations_version` passed must be consistent with + * Fleet Engine's version. If it isn't, the request fails. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The field mask indicating which fields in Trip to update. + * The `update_mask` must contain at least one field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\TripApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format + * `providers/{provider}/trips/{trip}`. The provider must + * be the Project ID (for example, `sample-consumer-project`) of the Google + * Cloud Project of which the service account making this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Must be in the format + * `providers/{provider}/trips/{trip}`. The provider must + * be the Project ID (for example, `sample-consumer-project`) of the Google + * Cloud Project of which the service account making this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The Trip associated with the update. + * The following fields are maintained by the Fleet Engine. Do not update + * them using Trip.update. + * * `current_route_segment` + * * `current_route_segment_end_point` + * * `current_route_segment_traffic` + * * `current_route_segment_traffic_version` + * * `current_route_segment_version` + * * `dropoff_time` + * * `eta_to_next_waypoint` + * * `intermediate_destinations_version` + * * `last_location` + * * `name` + * * `number_of_passengers` + * * `pickup_time` + * * `remaining_distance_meters` + * * `remaining_time_to_first_waypoint` + * * `remaining_waypoints` + * * `remaining_waypoints_version` + * * `route` + * When you update the `Trip.vehicle_id` for a shared trip, you must supply + * the list of `Trip.vehicle_waypoints` to specify the order of the remaining + * waypoints, otherwise the order will be undetermined. + * When you specify `Trip.vehicle_waypoints`, the list must contain all + * the remaining waypoints of the vehicle's trips, with no extra waypoints. + * You must order these waypoints such that for a given trip, the pickup + * point is before intermediate destinations, and all intermediate + * destinations come before the drop-off point. An `EXCLUSIVE` trip's + * waypoints must not interleave with any other trips. + * The `trip_id`, `waypoint_type` and `location` fields are used, and all + * other TripWaypoint fields in `vehicle_waypoints` are ignored. + * To avoid a race condition for trips with multiple destinations, you + * should provide `Trip.intermediate_destinations_version` when updating + * the trip status to `ENROUTE_TO_INTERMEDIATE_DESTINATION`. The + * `Trip.intermediate_destinations_version` passed must be consistent with + * Fleet Engine's version. If it isn't, the request fails. + * + * Generated from protobuf field .maps.fleetengine.v1.Trip trip = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\V1\Trip|null + */ + public function getTrip() + { + return $this->trip; + } + + public function hasTrip() + { + return isset($this->trip); + } + + public function clearTrip() + { + unset($this->trip); + } + + /** + * Required. The Trip associated with the update. + * The following fields are maintained by the Fleet Engine. Do not update + * them using Trip.update. + * * `current_route_segment` + * * `current_route_segment_end_point` + * * `current_route_segment_traffic` + * * `current_route_segment_traffic_version` + * * `current_route_segment_version` + * * `dropoff_time` + * * `eta_to_next_waypoint` + * * `intermediate_destinations_version` + * * `last_location` + * * `name` + * * `number_of_passengers` + * * `pickup_time` + * * `remaining_distance_meters` + * * `remaining_time_to_first_waypoint` + * * `remaining_waypoints` + * * `remaining_waypoints_version` + * * `route` + * When you update the `Trip.vehicle_id` for a shared trip, you must supply + * the list of `Trip.vehicle_waypoints` to specify the order of the remaining + * waypoints, otherwise the order will be undetermined. + * When you specify `Trip.vehicle_waypoints`, the list must contain all + * the remaining waypoints of the vehicle's trips, with no extra waypoints. + * You must order these waypoints such that for a given trip, the pickup + * point is before intermediate destinations, and all intermediate + * destinations come before the drop-off point. An `EXCLUSIVE` trip's + * waypoints must not interleave with any other trips. + * The `trip_id`, `waypoint_type` and `location` fields are used, and all + * other TripWaypoint fields in `vehicle_waypoints` are ignored. + * To avoid a race condition for trips with multiple destinations, you + * should provide `Trip.intermediate_destinations_version` when updating + * the trip status to `ENROUTE_TO_INTERMEDIATE_DESTINATION`. The + * `Trip.intermediate_destinations_version` passed must be consistent with + * Fleet Engine's version. If it isn't, the request fails. + * + * Generated from protobuf field .maps.fleetengine.v1.Trip trip = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\V1\Trip $var + * @return $this + */ + public function setTrip($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\Trip::class); + $this->trip = $var; + + return $this; + } + + /** + * Required. The field mask indicating which fields in Trip to update. + * The `update_mask` must contain at least one field. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The field mask indicating which fields in Trip to update. + * The `update_mask` must contain at least one field. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/UpdateVehicleAttributesRequest.php b/MapsFleetEngine/src/V1/UpdateVehicleAttributesRequest.php new file mode 100644 index 000000000000..30be79f52ba3 --- /dev/null +++ b/MapsFleetEngine/src/V1/UpdateVehicleAttributesRequest.php @@ -0,0 +1,161 @@ +maps.fleetengine.v1.UpdateVehicleAttributesRequest + */ +class UpdateVehicleAttributesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}/vehicles/{vehicle}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The vehicle attributes to update. Unmentioned attributes are not + * altered or removed. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $name + * Required. Must be in the format `providers/{provider}/vehicles/{vehicle}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * @type array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $attributes + * Required. The vehicle attributes to update. Unmentioned attributes are not + * altered or removed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}/vehicles/{vehicle}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Must be in the format `providers/{provider}/vehicles/{vehicle}`. + * The provider must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The vehicle attributes to update. Unmentioned attributes are not + * altered or removed. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Required. The vehicle attributes to update. Unmentioned attributes are not + * altered or removed. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\VehicleAttribute::class); + $this->attributes = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/UpdateVehicleAttributesResponse.php b/MapsFleetEngine/src/V1/UpdateVehicleAttributesResponse.php new file mode 100644 index 000000000000..ba1eb389f4f9 --- /dev/null +++ b/MapsFleetEngine/src/V1/UpdateVehicleAttributesResponse.php @@ -0,0 +1,71 @@ +maps.fleetengine.v1.UpdateVehicleAttributesResponse + */ +class UpdateVehicleAttributesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated full list of vehicle attributes, including new, + * altered, and untouched attributes. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $attributes + * Required. The updated full list of vehicle attributes, including new, + * altered, and untouched attributes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated full list of vehicle attributes, including new, + * altered, and untouched attributes. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Required. The updated full list of vehicle attributes, including new, + * altered, and untouched attributes. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\VehicleAttribute::class); + $this->attributes = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/UpdateVehicleRequest.php b/MapsFleetEngine/src/V1/UpdateVehicleRequest.php new file mode 100644 index 000000000000..3aded0e174b6 --- /dev/null +++ b/MapsFleetEngine/src/V1/UpdateVehicleRequest.php @@ -0,0 +1,267 @@ +maps.fleetengine.v1.UpdateVehicleRequest + */ +class UpdateVehicleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + */ + protected $header = null; + /** + * Required. Must be in the format + * `providers/{provider}/vehicles/{vehicle}`. + * The {provider} must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The `Vehicle` entity values to apply. When updating a `Vehicle`, + * the following fields may not be updated as they are managed by the + * server. + * * `available_capacity` + * * `current_route_segment_version` + * * `current_trips` + * * `name` + * * `waypoints_version` + * If the `attributes` field is updated, **all** the vehicle's attributes are + * replaced with the attributes provided in the request. If you want to update + * only some attributes, see the `UpdateVehicleAttributes` method. + * Likewise, the `waypoints` field can be updated, but must contain all the + * waypoints currently on the vehicle, and no other waypoints. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle vehicle = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vehicle = null; + /** + * Required. A field mask indicating which fields of the `Vehicle` to update. + * At least one field name must be provided. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\RequestHeader $header + * The standard Fleet Engine request header. + * @type string $name + * Required. Must be in the format + * `providers/{provider}/vehicles/{vehicle}`. + * The {provider} must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * @type \Google\Maps\FleetEngine\V1\Vehicle $vehicle + * Required. The `Vehicle` entity values to apply. When updating a `Vehicle`, + * the following fields may not be updated as they are managed by the + * server. + * * `available_capacity` + * * `current_route_segment_version` + * * `current_trips` + * * `name` + * * `waypoints_version` + * If the `attributes` field is updated, **all** the vehicle's attributes are + * replaced with the attributes provided in the request. If you want to update + * only some attributes, see the `UpdateVehicleAttributes` method. + * Likewise, the `waypoints` field can be updated, but must contain all the + * waypoints currently on the vehicle, and no other waypoints. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. A field mask indicating which fields of the `Vehicle` to update. + * At least one field name must be provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @return \Google\Maps\FleetEngine\V1\RequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The standard Fleet Engine request header. + * + * Generated from protobuf field .maps.fleetengine.v1.RequestHeader header = 1; + * @param \Google\Maps\FleetEngine\V1\RequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\RequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format + * `providers/{provider}/vehicles/{vehicle}`. + * The {provider} must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Must be in the format + * `providers/{provider}/vehicles/{vehicle}`. + * The {provider} must be the Project ID (for example, `sample-cloud-project`) + * of the Google Cloud Project of which the service account making + * this call is a member. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The `Vehicle` entity values to apply. When updating a `Vehicle`, + * the following fields may not be updated as they are managed by the + * server. + * * `available_capacity` + * * `current_route_segment_version` + * * `current_trips` + * * `name` + * * `waypoints_version` + * If the `attributes` field is updated, **all** the vehicle's attributes are + * replaced with the attributes provided in the request. If you want to update + * only some attributes, see the `UpdateVehicleAttributes` method. + * Likewise, the `waypoints` field can be updated, but must contain all the + * waypoints currently on the vehicle, and no other waypoints. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle vehicle = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\V1\Vehicle|null + */ + public function getVehicle() + { + return $this->vehicle; + } + + public function hasVehicle() + { + return isset($this->vehicle); + } + + public function clearVehicle() + { + unset($this->vehicle); + } + + /** + * Required. The `Vehicle` entity values to apply. When updating a `Vehicle`, + * the following fields may not be updated as they are managed by the + * server. + * * `available_capacity` + * * `current_route_segment_version` + * * `current_trips` + * * `name` + * * `waypoints_version` + * If the `attributes` field is updated, **all** the vehicle's attributes are + * replaced with the attributes provided in the request. If you want to update + * only some attributes, see the `UpdateVehicleAttributes` method. + * Likewise, the `waypoints` field can be updated, but must contain all the + * waypoints currently on the vehicle, and no other waypoints. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle vehicle = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\V1\Vehicle $var + * @return $this + */ + public function setVehicle($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\Vehicle::class); + $this->vehicle = $var; + + return $this; + } + + /** + * Required. A field mask indicating which fields of the `Vehicle` to update. + * At least one field name must be provided. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. A field mask indicating which fields of the `Vehicle` to update. + * At least one field name must be provided. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/Vehicle.php b/MapsFleetEngine/src/V1/Vehicle.php new file mode 100644 index 000000000000..cef7be90d471 --- /dev/null +++ b/MapsFleetEngine/src/V1/Vehicle.php @@ -0,0 +1,1108 @@ +maps.fleetengine.v1.Vehicle + */ +class Vehicle extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique name for this vehicle. + * The format is `providers/{provider}/vehicles/{vehicle}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The vehicle state. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleState vehicle_state = 2; + */ + protected $vehicle_state = 0; + /** + * Trip types supported by this vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripType supported_trip_types = 3; + */ + private $supported_trip_types; + /** + * Output only. List of `trip_id`'s for trips currently assigned to this + * vehicle. + * + * Generated from protobuf field repeated string current_trips = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $current_trips; + /** + * Last reported location of the vehicle. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleLocation last_location = 5; + */ + protected $last_location = null; + /** + * The total numbers of riders this vehicle can carry. The driver is not + * considered in this value. This value must be greater than or equal to one. + * + * Generated from protobuf field int32 maximum_capacity = 6; + */ + protected $maximum_capacity = 0; + /** + * List of vehicle attributes. A vehicle can have at most 100 + * attributes, and each attribute must have a unique key. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 8; + */ + private $attributes; + /** + * Required. The type of this vehicle. Can be used to filter vehicles in + * `SearchVehicles` results. Also influences ETA and route calculations. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle.VehicleType vehicle_type = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vehicle_type = null; + /** + * License plate information for the vehicle. + * + * Generated from protobuf field .maps.fleetengine.v1.LicensePlate license_plate = 10; + */ + protected $license_plate = null; + /** + * Deprecated: Use `Vehicle.waypoints` instead. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TerminalLocation route = 12 [deprecated = true]; + * @deprecated + */ + private $route; + /** + * The polyline specifying the route the driver app intends to take to + * the next waypoint. This list is also returned in + * `Trip.current_route_segment` for all active trips assigned to the vehicle. + * Note: This field is intended only for use by the Driver SDK. Decoding is + * not yet supported. + * + * Generated from protobuf field string current_route_segment = 20; + */ + protected $current_route_segment = ''; + /** + * Input only. Fleet Engine uses this information to improve journey sharing. + * Note: This field is intended only for use by the Driver SDK. + * + * Generated from protobuf field .maps.fleetengine.v1.TrafficPolylineData current_route_segment_traffic = 28 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $current_route_segment_traffic = null; + /** + * Output only. Time when `current_route_segment` was set. It can be stored by + * the client and passed in future `GetVehicle` requests to prevent returning + * routes that haven't changed. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $current_route_segment_version = null; + /** + * The waypoint where `current_route_segment` ends. This can be supplied by + * drivers on `UpdateVehicle` calls either as a full trip waypoint, a waypoint + * `LatLng`, or as the last `LatLng` of the `current_route_segment`. Fleet + * Engine will then do its best to interpolate to an actual waypoint if it is + * not fully specified. This field is ignored in `UpdateVehicle` calls unless + * `current_route_segment` is also specified. + * + * Generated from protobuf field .maps.fleetengine.v1.TripWaypoint current_route_segment_end_point = 24; + */ + protected $current_route_segment_end_point = null; + /** + * The remaining driving distance for the `current_route_segment`. + * This value is also returned in `Trip.remaining_distance_meters` for all + * active trips assigned to the vehicle. The value is unspecified if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 18; + */ + protected $remaining_distance_meters = null; + /** + * The ETA to the first entry in the `waypoints` field. The value is + * unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * + * Generated from protobuf field .google.protobuf.Timestamp eta_to_first_waypoint = 19; + */ + protected $eta_to_first_waypoint = null; + /** + * Input only. The remaining driving time for the `current_route_segment`. The + * value is unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. This value should match + * `eta_to_first_waypoint` - `current_time` if all parties are using the same + * clock. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_time_seconds = 25 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $remaining_time_seconds = null; + /** + * The remaining waypoints assigned to this Vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripWaypoint waypoints = 22; + */ + private $waypoints; + /** + * Output only. Last time the `waypoints` field was updated. Clients should + * cache this value and pass it in `GetVehicleRequest` to ensure the + * `waypoints` field is only returned if it is updated. + * + * Generated from protobuf field .google.protobuf.Timestamp waypoints_version = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $waypoints_version = null; + /** + * Indicates if the driver accepts back-to-back trips. If `true`, + * `SearchVehicles` may include the vehicle even if it is currently assigned + * to a trip. The default value is `false`. + * + * Generated from protobuf field bool back_to_back_enabled = 23; + */ + protected $back_to_back_enabled = false; + /** + * The vehicle's navigation status. + * + * Generated from protobuf field .maps.fleetengine.v1.NavigationStatus navigation_status = 26; + */ + protected $navigation_status = 0; + /** + * Input only. Information about settings in the mobile device being used by + * the driver. + * + * Generated from protobuf field .maps.fleetengine.v1.DeviceSettings device_settings = 27 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $device_settings = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique name for this vehicle. + * The format is `providers/{provider}/vehicles/{vehicle}`. + * @type int $vehicle_state + * The vehicle state. + * @type array|\Google\Protobuf\Internal\RepeatedField $supported_trip_types + * Trip types supported by this vehicle. + * @type array|\Google\Protobuf\Internal\RepeatedField $current_trips + * Output only. List of `trip_id`'s for trips currently assigned to this + * vehicle. + * @type \Google\Maps\FleetEngine\V1\VehicleLocation $last_location + * Last reported location of the vehicle. + * @type int $maximum_capacity + * The total numbers of riders this vehicle can carry. The driver is not + * considered in this value. This value must be greater than or equal to one. + * @type array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $attributes + * List of vehicle attributes. A vehicle can have at most 100 + * attributes, and each attribute must have a unique key. + * @type \Google\Maps\FleetEngine\V1\Vehicle\VehicleType $vehicle_type + * Required. The type of this vehicle. Can be used to filter vehicles in + * `SearchVehicles` results. Also influences ETA and route calculations. + * @type \Google\Maps\FleetEngine\V1\LicensePlate $license_plate + * License plate information for the vehicle. + * @type array<\Google\Maps\FleetEngine\V1\TerminalLocation>|\Google\Protobuf\Internal\RepeatedField $route + * Deprecated: Use `Vehicle.waypoints` instead. + * @type string $current_route_segment + * The polyline specifying the route the driver app intends to take to + * the next waypoint. This list is also returned in + * `Trip.current_route_segment` for all active trips assigned to the vehicle. + * Note: This field is intended only for use by the Driver SDK. Decoding is + * not yet supported. + * @type \Google\Maps\FleetEngine\V1\TrafficPolylineData $current_route_segment_traffic + * Input only. Fleet Engine uses this information to improve journey sharing. + * Note: This field is intended only for use by the Driver SDK. + * @type \Google\Protobuf\Timestamp $current_route_segment_version + * Output only. Time when `current_route_segment` was set. It can be stored by + * the client and passed in future `GetVehicle` requests to prevent returning + * routes that haven't changed. + * @type \Google\Maps\FleetEngine\V1\TripWaypoint $current_route_segment_end_point + * The waypoint where `current_route_segment` ends. This can be supplied by + * drivers on `UpdateVehicle` calls either as a full trip waypoint, a waypoint + * `LatLng`, or as the last `LatLng` of the `current_route_segment`. Fleet + * Engine will then do its best to interpolate to an actual waypoint if it is + * not fully specified. This field is ignored in `UpdateVehicle` calls unless + * `current_route_segment` is also specified. + * @type \Google\Protobuf\Int32Value $remaining_distance_meters + * The remaining driving distance for the `current_route_segment`. + * This value is also returned in `Trip.remaining_distance_meters` for all + * active trips assigned to the vehicle. The value is unspecified if the + * `current_route_segment` field is empty. + * @type \Google\Protobuf\Timestamp $eta_to_first_waypoint + * The ETA to the first entry in the `waypoints` field. The value is + * unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * @type \Google\Protobuf\Int32Value $remaining_time_seconds + * Input only. The remaining driving time for the `current_route_segment`. The + * value is unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. This value should match + * `eta_to_first_waypoint` - `current_time` if all parties are using the same + * clock. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * @type array<\Google\Maps\FleetEngine\V1\TripWaypoint>|\Google\Protobuf\Internal\RepeatedField $waypoints + * The remaining waypoints assigned to this Vehicle. + * @type \Google\Protobuf\Timestamp $waypoints_version + * Output only. Last time the `waypoints` field was updated. Clients should + * cache this value and pass it in `GetVehicleRequest` to ensure the + * `waypoints` field is only returned if it is updated. + * @type bool $back_to_back_enabled + * Indicates if the driver accepts back-to-back trips. If `true`, + * `SearchVehicles` may include the vehicle even if it is currently assigned + * to a trip. The default value is `false`. + * @type int $navigation_status + * The vehicle's navigation status. + * @type \Google\Maps\FleetEngine\V1\DeviceSettings $device_settings + * Input only. Information about settings in the mobile device being used by + * the driver. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Vehicles::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique name for this vehicle. + * The format is `providers/{provider}/vehicles/{vehicle}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique name for this vehicle. + * The format is `providers/{provider}/vehicles/{vehicle}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The vehicle state. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleState vehicle_state = 2; + * @return int + */ + public function getVehicleState() + { + return $this->vehicle_state; + } + + /** + * The vehicle state. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleState vehicle_state = 2; + * @param int $var + * @return $this + */ + public function setVehicleState($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\VehicleState::class); + $this->vehicle_state = $var; + + return $this; + } + + /** + * Trip types supported by this vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripType supported_trip_types = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedTripTypes() + { + return $this->supported_trip_types; + } + + /** + * Trip types supported by this vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripType supported_trip_types = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedTripTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Maps\FleetEngine\V1\TripType::class); + $this->supported_trip_types = $arr; + + return $this; + } + + /** + * Output only. List of `trip_id`'s for trips currently assigned to this + * vehicle. + * + * Generated from protobuf field repeated string current_trips = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCurrentTrips() + { + return $this->current_trips; + } + + /** + * Output only. List of `trip_id`'s for trips currently assigned to this + * vehicle. + * + * Generated from protobuf field repeated string current_trips = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCurrentTrips($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->current_trips = $arr; + + return $this; + } + + /** + * Last reported location of the vehicle. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleLocation last_location = 5; + * @return \Google\Maps\FleetEngine\V1\VehicleLocation|null + */ + public function getLastLocation() + { + return $this->last_location; + } + + public function hasLastLocation() + { + return isset($this->last_location); + } + + public function clearLastLocation() + { + unset($this->last_location); + } + + /** + * Last reported location of the vehicle. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleLocation last_location = 5; + * @param \Google\Maps\FleetEngine\V1\VehicleLocation $var + * @return $this + */ + public function setLastLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\VehicleLocation::class); + $this->last_location = $var; + + return $this; + } + + /** + * The total numbers of riders this vehicle can carry. The driver is not + * considered in this value. This value must be greater than or equal to one. + * + * Generated from protobuf field int32 maximum_capacity = 6; + * @return int + */ + public function getMaximumCapacity() + { + return $this->maximum_capacity; + } + + /** + * The total numbers of riders this vehicle can carry. The driver is not + * considered in this value. This value must be greater than or equal to one. + * + * Generated from protobuf field int32 maximum_capacity = 6; + * @param int $var + * @return $this + */ + public function setMaximumCapacity($var) + { + GPBUtil::checkInt32($var); + $this->maximum_capacity = $var; + + return $this; + } + + /** + * List of vehicle attributes. A vehicle can have at most 100 + * attributes, and each attribute must have a unique key. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * List of vehicle attributes. A vehicle can have at most 100 + * attributes, and each attribute must have a unique key. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 8; + * @param array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\VehicleAttribute::class); + $this->attributes = $arr; + + return $this; + } + + /** + * Required. The type of this vehicle. Can be used to filter vehicles in + * `SearchVehicles` results. Also influences ETA and route calculations. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle.VehicleType vehicle_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\V1\Vehicle\VehicleType|null + */ + public function getVehicleType() + { + return $this->vehicle_type; + } + + public function hasVehicleType() + { + return isset($this->vehicle_type); + } + + public function clearVehicleType() + { + unset($this->vehicle_type); + } + + /** + * Required. The type of this vehicle. Can be used to filter vehicles in + * `SearchVehicles` results. Also influences ETA and route calculations. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle.VehicleType vehicle_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\V1\Vehicle\VehicleType $var + * @return $this + */ + public function setVehicleType($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\Vehicle\VehicleType::class); + $this->vehicle_type = $var; + + return $this; + } + + /** + * License plate information for the vehicle. + * + * Generated from protobuf field .maps.fleetengine.v1.LicensePlate license_plate = 10; + * @return \Google\Maps\FleetEngine\V1\LicensePlate|null + */ + public function getLicensePlate() + { + return $this->license_plate; + } + + public function hasLicensePlate() + { + return isset($this->license_plate); + } + + public function clearLicensePlate() + { + unset($this->license_plate); + } + + /** + * License plate information for the vehicle. + * + * Generated from protobuf field .maps.fleetengine.v1.LicensePlate license_plate = 10; + * @param \Google\Maps\FleetEngine\V1\LicensePlate $var + * @return $this + */ + public function setLicensePlate($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\LicensePlate::class); + $this->license_plate = $var; + + return $this; + } + + /** + * Deprecated: Use `Vehicle.waypoints` instead. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TerminalLocation route = 12 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getRoute() + { + @trigger_error('route is deprecated.', E_USER_DEPRECATED); + return $this->route; + } + + /** + * Deprecated: Use `Vehicle.waypoints` instead. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TerminalLocation route = 12 [deprecated = true]; + * @param array<\Google\Maps\FleetEngine\V1\TerminalLocation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setRoute($var) + { + @trigger_error('route is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\TerminalLocation::class); + $this->route = $arr; + + return $this; + } + + /** + * The polyline specifying the route the driver app intends to take to + * the next waypoint. This list is also returned in + * `Trip.current_route_segment` for all active trips assigned to the vehicle. + * Note: This field is intended only for use by the Driver SDK. Decoding is + * not yet supported. + * + * Generated from protobuf field string current_route_segment = 20; + * @return string + */ + public function getCurrentRouteSegment() + { + return $this->current_route_segment; + } + + /** + * The polyline specifying the route the driver app intends to take to + * the next waypoint. This list is also returned in + * `Trip.current_route_segment` for all active trips assigned to the vehicle. + * Note: This field is intended only for use by the Driver SDK. Decoding is + * not yet supported. + * + * Generated from protobuf field string current_route_segment = 20; + * @param string $var + * @return $this + */ + public function setCurrentRouteSegment($var) + { + GPBUtil::checkString($var, True); + $this->current_route_segment = $var; + + return $this; + } + + /** + * Input only. Fleet Engine uses this information to improve journey sharing. + * Note: This field is intended only for use by the Driver SDK. + * + * Generated from protobuf field .maps.fleetengine.v1.TrafficPolylineData current_route_segment_traffic = 28 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Maps\FleetEngine\V1\TrafficPolylineData|null + */ + public function getCurrentRouteSegmentTraffic() + { + return $this->current_route_segment_traffic; + } + + public function hasCurrentRouteSegmentTraffic() + { + return isset($this->current_route_segment_traffic); + } + + public function clearCurrentRouteSegmentTraffic() + { + unset($this->current_route_segment_traffic); + } + + /** + * Input only. Fleet Engine uses this information to improve journey sharing. + * Note: This field is intended only for use by the Driver SDK. + * + * Generated from protobuf field .maps.fleetengine.v1.TrafficPolylineData current_route_segment_traffic = 28 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Maps\FleetEngine\V1\TrafficPolylineData $var + * @return $this + */ + public function setCurrentRouteSegmentTraffic($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\TrafficPolylineData::class); + $this->current_route_segment_traffic = $var; + + return $this; + } + + /** + * Output only. Time when `current_route_segment` was set. It can be stored by + * the client and passed in future `GetVehicle` requests to prevent returning + * routes that haven't changed. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCurrentRouteSegmentVersion() + { + return $this->current_route_segment_version; + } + + public function hasCurrentRouteSegmentVersion() + { + return isset($this->current_route_segment_version); + } + + public function clearCurrentRouteSegmentVersion() + { + unset($this->current_route_segment_version); + } + + /** + * Output only. Time when `current_route_segment` was set. It can be stored by + * the client and passed in future `GetVehicle` requests to prevent returning + * routes that haven't changed. + * + * Generated from protobuf field .google.protobuf.Timestamp current_route_segment_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCurrentRouteSegmentVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->current_route_segment_version = $var; + + return $this; + } + + /** + * The waypoint where `current_route_segment` ends. This can be supplied by + * drivers on `UpdateVehicle` calls either as a full trip waypoint, a waypoint + * `LatLng`, or as the last `LatLng` of the `current_route_segment`. Fleet + * Engine will then do its best to interpolate to an actual waypoint if it is + * not fully specified. This field is ignored in `UpdateVehicle` calls unless + * `current_route_segment` is also specified. + * + * Generated from protobuf field .maps.fleetengine.v1.TripWaypoint current_route_segment_end_point = 24; + * @return \Google\Maps\FleetEngine\V1\TripWaypoint|null + */ + public function getCurrentRouteSegmentEndPoint() + { + return $this->current_route_segment_end_point; + } + + public function hasCurrentRouteSegmentEndPoint() + { + return isset($this->current_route_segment_end_point); + } + + public function clearCurrentRouteSegmentEndPoint() + { + unset($this->current_route_segment_end_point); + } + + /** + * The waypoint where `current_route_segment` ends. This can be supplied by + * drivers on `UpdateVehicle` calls either as a full trip waypoint, a waypoint + * `LatLng`, or as the last `LatLng` of the `current_route_segment`. Fleet + * Engine will then do its best to interpolate to an actual waypoint if it is + * not fully specified. This field is ignored in `UpdateVehicle` calls unless + * `current_route_segment` is also specified. + * + * Generated from protobuf field .maps.fleetengine.v1.TripWaypoint current_route_segment_end_point = 24; + * @param \Google\Maps\FleetEngine\V1\TripWaypoint $var + * @return $this + */ + public function setCurrentRouteSegmentEndPoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\TripWaypoint::class); + $this->current_route_segment_end_point = $var; + + return $this; + } + + /** + * The remaining driving distance for the `current_route_segment`. + * This value is also returned in `Trip.remaining_distance_meters` for all + * active trips assigned to the vehicle. The value is unspecified if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 18; + * @return \Google\Protobuf\Int32Value|null + */ + public function getRemainingDistanceMeters() + { + return $this->remaining_distance_meters; + } + + public function hasRemainingDistanceMeters() + { + return isset($this->remaining_distance_meters); + } + + public function clearRemainingDistanceMeters() + { + unset($this->remaining_distance_meters); + } + + /** + * Returns the unboxed value from getRemainingDistanceMeters() + + * The remaining driving distance for the `current_route_segment`. + * This value is also returned in `Trip.remaining_distance_meters` for all + * active trips assigned to the vehicle. The value is unspecified if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 18; + * @return int|null + */ + public function getRemainingDistanceMetersUnwrapped() + { + return $this->readWrapperValue("remaining_distance_meters"); + } + + /** + * The remaining driving distance for the `current_route_segment`. + * This value is also returned in `Trip.remaining_distance_meters` for all + * active trips assigned to the vehicle. The value is unspecified if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 18; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setRemainingDistanceMeters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->remaining_distance_meters = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The remaining driving distance for the `current_route_segment`. + * This value is also returned in `Trip.remaining_distance_meters` for all + * active trips assigned to the vehicle. The value is unspecified if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 18; + * @param int|null $var + * @return $this + */ + public function setRemainingDistanceMetersUnwrapped($var) + { + $this->writeWrapperValue("remaining_distance_meters", $var); + return $this;} + + /** + * The ETA to the first entry in the `waypoints` field. The value is + * unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * + * Generated from protobuf field .google.protobuf.Timestamp eta_to_first_waypoint = 19; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEtaToFirstWaypoint() + { + return $this->eta_to_first_waypoint; + } + + public function hasEtaToFirstWaypoint() + { + return isset($this->eta_to_first_waypoint); + } + + public function clearEtaToFirstWaypoint() + { + unset($this->eta_to_first_waypoint); + } + + /** + * The ETA to the first entry in the `waypoints` field. The value is + * unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * + * Generated from protobuf field .google.protobuf.Timestamp eta_to_first_waypoint = 19; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEtaToFirstWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->eta_to_first_waypoint = $var; + + return $this; + } + + /** + * Input only. The remaining driving time for the `current_route_segment`. The + * value is unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. This value should match + * `eta_to_first_waypoint` - `current_time` if all parties are using the same + * clock. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_time_seconds = 25 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getRemainingTimeSeconds() + { + return $this->remaining_time_seconds; + } + + public function hasRemainingTimeSeconds() + { + return isset($this->remaining_time_seconds); + } + + public function clearRemainingTimeSeconds() + { + unset($this->remaining_time_seconds); + } + + /** + * Returns the unboxed value from getRemainingTimeSeconds() + + * Input only. The remaining driving time for the `current_route_segment`. The + * value is unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. This value should match + * `eta_to_first_waypoint` - `current_time` if all parties are using the same + * clock. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_time_seconds = 25 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return int|null + */ + public function getRemainingTimeSecondsUnwrapped() + { + return $this->readWrapperValue("remaining_time_seconds"); + } + + /** + * Input only. The remaining driving time for the `current_route_segment`. The + * value is unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. This value should match + * `eta_to_first_waypoint` - `current_time` if all parties are using the same + * clock. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_time_seconds = 25 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setRemainingTimeSeconds($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->remaining_time_seconds = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Input only. The remaining driving time for the `current_route_segment`. The + * value is unspecified if the `waypoints` field is empty or the + * `Vehicle.current_route_segment` field is empty. This value should match + * `eta_to_first_waypoint` - `current_time` if all parties are using the same + * clock. + * When updating a vehicle, `remaining_time_seconds` takes precedence over + * `eta_to_first_waypoint` in the same request. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_time_seconds = 25 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param int|null $var + * @return $this + */ + public function setRemainingTimeSecondsUnwrapped($var) + { + $this->writeWrapperValue("remaining_time_seconds", $var); + return $this;} + + /** + * The remaining waypoints assigned to this Vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripWaypoint waypoints = 22; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWaypoints() + { + return $this->waypoints; + } + + /** + * The remaining waypoints assigned to this Vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.TripWaypoint waypoints = 22; + * @param array<\Google\Maps\FleetEngine\V1\TripWaypoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWaypoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\TripWaypoint::class); + $this->waypoints = $arr; + + return $this; + } + + /** + * Output only. Last time the `waypoints` field was updated. Clients should + * cache this value and pass it in `GetVehicleRequest` to ensure the + * `waypoints` field is only returned if it is updated. + * + * Generated from protobuf field .google.protobuf.Timestamp waypoints_version = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getWaypointsVersion() + { + return $this->waypoints_version; + } + + public function hasWaypointsVersion() + { + return isset($this->waypoints_version); + } + + public function clearWaypointsVersion() + { + unset($this->waypoints_version); + } + + /** + * Output only. Last time the `waypoints` field was updated. Clients should + * cache this value and pass it in `GetVehicleRequest` to ensure the + * `waypoints` field is only returned if it is updated. + * + * Generated from protobuf field .google.protobuf.Timestamp waypoints_version = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setWaypointsVersion($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->waypoints_version = $var; + + return $this; + } + + /** + * Indicates if the driver accepts back-to-back trips. If `true`, + * `SearchVehicles` may include the vehicle even if it is currently assigned + * to a trip. The default value is `false`. + * + * Generated from protobuf field bool back_to_back_enabled = 23; + * @return bool + */ + public function getBackToBackEnabled() + { + return $this->back_to_back_enabled; + } + + /** + * Indicates if the driver accepts back-to-back trips. If `true`, + * `SearchVehicles` may include the vehicle even if it is currently assigned + * to a trip. The default value is `false`. + * + * Generated from protobuf field bool back_to_back_enabled = 23; + * @param bool $var + * @return $this + */ + public function setBackToBackEnabled($var) + { + GPBUtil::checkBool($var); + $this->back_to_back_enabled = $var; + + return $this; + } + + /** + * The vehicle's navigation status. + * + * Generated from protobuf field .maps.fleetengine.v1.NavigationStatus navigation_status = 26; + * @return int + */ + public function getNavigationStatus() + { + return $this->navigation_status; + } + + /** + * The vehicle's navigation status. + * + * Generated from protobuf field .maps.fleetengine.v1.NavigationStatus navigation_status = 26; + * @param int $var + * @return $this + */ + public function setNavigationStatus($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\NavigationStatus::class); + $this->navigation_status = $var; + + return $this; + } + + /** + * Input only. Information about settings in the mobile device being used by + * the driver. + * + * Generated from protobuf field .maps.fleetengine.v1.DeviceSettings device_settings = 27 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Maps\FleetEngine\V1\DeviceSettings|null + */ + public function getDeviceSettings() + { + return $this->device_settings; + } + + public function hasDeviceSettings() + { + return isset($this->device_settings); + } + + public function clearDeviceSettings() + { + unset($this->device_settings); + } + + /** + * Input only. Information about settings in the mobile device being used by + * the driver. + * + * Generated from protobuf field .maps.fleetengine.v1.DeviceSettings device_settings = 27 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Maps\FleetEngine\V1\DeviceSettings $var + * @return $this + */ + public function setDeviceSettings($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\DeviceSettings::class); + $this->device_settings = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/Vehicle/VehicleType.php b/MapsFleetEngine/src/V1/Vehicle/VehicleType.php new file mode 100644 index 000000000000..17228e717d09 --- /dev/null +++ b/MapsFleetEngine/src/V1/Vehicle/VehicleType.php @@ -0,0 +1,68 @@ +maps.fleetengine.v1.Vehicle.VehicleType + */ +class VehicleType extends \Google\Protobuf\Internal\Message +{ + /** + * Vehicle type category + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle.VehicleType.Category category = 1; + */ + protected $category = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $category + * Vehicle type category + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Vehicles::initOnce(); + parent::__construct($data); + } + + /** + * Vehicle type category + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle.VehicleType.Category category = 1; + * @return int + */ + public function getCategory() + { + return $this->category; + } + + /** + * Vehicle type category + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle.VehicleType.Category category = 1; + * @param int $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\Vehicle\VehicleType\Category::class); + $this->category = $var; + + return $this; + } + +} + + diff --git a/MapsFleetEngine/src/V1/Vehicle/VehicleType/Category.php b/MapsFleetEngine/src/V1/Vehicle/VehicleType/Category.php new file mode 100644 index 000000000000..d54a8e5d50d9 --- /dev/null +++ b/MapsFleetEngine/src/V1/Vehicle/VehicleType/Category.php @@ -0,0 +1,91 @@ +maps.fleetengine.v1.Vehicle.VehicleType.Category + */ +class Category +{ + /** + * Default, used for unspecified or unrecognized vehicle categories. + * + * Generated from protobuf enum UNKNOWN = 0; + */ + const UNKNOWN = 0; + /** + * An automobile. + * + * Generated from protobuf enum AUTO = 1; + */ + const AUTO = 1; + /** + * Any vehicle that acts as a taxi (typically licensed or regulated). + * + * Generated from protobuf enum TAXI = 2; + */ + const TAXI = 2; + /** + * Generally, a vehicle with a large storage capacity. + * + * Generated from protobuf enum TRUCK = 3; + */ + const TRUCK = 3; + /** + * A motorcycle, moped, or other two-wheeled vehicle + * + * Generated from protobuf enum TWO_WHEELER = 4; + */ + const TWO_WHEELER = 4; + /** + * Human-powered transport. + * + * Generated from protobuf enum BICYCLE = 5; + */ + const BICYCLE = 5; + /** + * A human transporter, typically walking or running, traveling along + * pedestrian pathways. + * + * Generated from protobuf enum PEDESTRIAN = 6; + */ + const PEDESTRIAN = 6; + + private static $valueToName = [ + self::UNKNOWN => 'UNKNOWN', + self::AUTO => 'AUTO', + self::TAXI => 'TAXI', + self::TRUCK => 'TRUCK', + self::TWO_WHEELER => 'TWO_WHEELER', + self::BICYCLE => 'BICYCLE', + self::PEDESTRIAN => 'PEDESTRIAN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngine/src/V1/VehicleAttribute.php b/MapsFleetEngine/src/V1/VehicleAttribute.php new file mode 100644 index 000000000000..33dc410a64bc --- /dev/null +++ b/MapsFleetEngine/src/V1/VehicleAttribute.php @@ -0,0 +1,225 @@ +maps.fleetengine.v1.VehicleAttribute + */ +class VehicleAttribute extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute's key. Keys may not contain the colon character (:). + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * The attribute's value. + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + protected $vehicle_attribute_value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The attribute's key. Keys may not contain the colon character (:). + * @type string $value + * The attribute's value. + * @type string $string_value + * String typed attribute value. + * Note: This is identical to the `value` field which will eventually be + * deprecated. For create or update methods, either field can be used, but + * it's strongly recommended to use `string_value`. If both `string_value` + * and `value` are set, they must be identical or an error will be thrown. + * Both fields are populated in responses. + * @type bool $bool_value + * Boolean typed attribute value. + * @type float $number_value + * Double typed attribute value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Fleetengine::initOnce(); + parent::__construct($data); + } + + /** + * The attribute's key. Keys may not contain the colon character (:). + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The attribute's key. Keys may not contain the colon character (:). + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * The attribute's value. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The attribute's value. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * String typed attribute value. + * Note: This is identical to the `value` field which will eventually be + * deprecated. For create or update methods, either field can be used, but + * it's strongly recommended to use `string_value`. If both `string_value` + * and `value` are set, they must be identical or an error will be thrown. + * Both fields are populated in responses. + * + * Generated from protobuf field string string_value = 3; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(3); + } + + public function hasStringValue() + { + return $this->hasOneof(3); + } + + /** + * String typed attribute value. + * Note: This is identical to the `value` field which will eventually be + * deprecated. For create or update methods, either field can be used, but + * it's strongly recommended to use `string_value`. If both `string_value` + * and `value` are set, they must be identical or an error will be thrown. + * Both fields are populated in responses. + * + * Generated from protobuf field string string_value = 3; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Boolean typed attribute value. + * + * Generated from protobuf field bool bool_value = 4; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(4); + } + + public function hasBoolValue() + { + return $this->hasOneof(4); + } + + /** + * Boolean typed attribute value. + * + * Generated from protobuf field bool bool_value = 4; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Double typed attribute value. + * + * Generated from protobuf field double number_value = 5; + * @return float + */ + public function getNumberValue() + { + return $this->readOneof(5); + } + + public function hasNumberValue() + { + return $this->hasOneof(5); + } + + /** + * Double typed attribute value. + * + * Generated from protobuf field double number_value = 5; + * @param float $var + * @return $this + */ + public function setNumberValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getVehicleAttributeValue() + { + return $this->whichOneof("vehicle_attribute_value"); + } + +} + diff --git a/MapsFleetEngine/src/V1/VehicleAttributeList.php b/MapsFleetEngine/src/V1/VehicleAttributeList.php new file mode 100644 index 000000000000..99d5f9de749e --- /dev/null +++ b/MapsFleetEngine/src/V1/VehicleAttributeList.php @@ -0,0 +1,67 @@ +maps.fleetengine.v1.VehicleAttributeList + */ +class VehicleAttributeList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of attributes in this collection. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 1; + */ + private $attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $attributes + * A list of attributes in this collection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * A list of attributes in this collection. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * A list of attributes in this collection. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VehicleAttribute attributes = 1; + * @param array<\Google\Maps\FleetEngine\V1\VehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\VehicleAttribute::class); + $this->attributes = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/VehicleLocation.php b/MapsFleetEngine/src/V1/VehicleLocation.php new file mode 100644 index 000000000000..a4efa0721e4a --- /dev/null +++ b/MapsFleetEngine/src/V1/VehicleLocation.php @@ -0,0 +1,1789 @@ +maps.fleetengine.v1.VehicleLocation + */ +class VehicleLocation extends \Google\Protobuf\Internal\Message +{ + /** + * The location of the vehicle. + * When it is sent to Fleet Engine, the vehicle's location is a GPS location. + * When you receive it in a response, the vehicle's location can be either a + * GPS location, a supplemental location, or some other estimated location. + * The source is specified in `location_sensor`. + * + * Generated from protobuf field .google.type.LatLng location = 1; + */ + protected $location = null; + /** + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @deprecated + */ + protected $horizontal_accuracy = null; + /** + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + */ + protected $latlng_accuracy = null; + /** + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + */ + protected $heading = null; + /** + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @deprecated + */ + protected $bearing_accuracy = null; + /** + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + */ + protected $heading_accuracy = null; + /** + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + */ + protected $altitude = null; + /** + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @deprecated + */ + protected $vertical_accuracy = null; + /** + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + */ + protected $altitude_accuracy = null; + /** + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @deprecated + */ + protected $speed_kmph = null; + /** + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + */ + protected $speed = null; + /** + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + */ + protected $speed_accuracy = null; + /** + * The time when `location` was reported by the sensor according to the + * sensor's clock. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + /** + * Output only. The time when the server received the location information. + * + * Generated from protobuf field .google.protobuf.Timestamp server_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $server_time = null; + /** + * Provider of location data (for example, `GPS`). + * + * Generated from protobuf field .maps.fleetengine.v1.LocationSensor location_sensor = 11; + */ + protected $location_sensor = 0; + /** + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + */ + protected $is_road_snapped = null; + /** + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $is_gps_sensor_enabled = null; + /** + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $time_since_update = null; + /** + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @deprecated + */ + protected $num_stale_updates = null; + /** + * Raw vehicle location (unprocessed by road-snapper). + * + * Generated from protobuf field .google.type.LatLng raw_location = 16; + */ + protected $raw_location = null; + /** + * Timestamp associated with the raw location. + * + * Generated from protobuf field .google.protobuf.Timestamp raw_location_time = 17; + */ + protected $raw_location_time = null; + /** + * Source of the raw location. Defaults to `GPS`. + * + * Generated from protobuf field .maps.fleetengine.v1.LocationSensor raw_location_sensor = 28; + */ + protected $raw_location_sensor = 0; + /** + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + */ + protected $raw_location_accuracy = null; + /** + * Supplemental location provided by the integrating app. + * + * Generated from protobuf field .google.type.LatLng supplemental_location = 18; + */ + protected $supplemental_location = null; + /** + * Timestamp associated with the supplemental location. + * + * Generated from protobuf field .google.protobuf.Timestamp supplemental_location_time = 19; + */ + protected $supplemental_location_time = null; + /** + * Source of the supplemental location. Defaults to + * `CUSTOMER_SUPPLIED_LOCATION`. + * + * Generated from protobuf field .maps.fleetengine.v1.LocationSensor supplemental_location_sensor = 20; + */ + protected $supplemental_location_sensor = 0; + /** + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + */ + protected $supplemental_location_accuracy = null; + /** + * Deprecated: Use `is_road_snapped` instead. + * + * Generated from protobuf field bool road_snapped = 26 [deprecated = true]; + * @deprecated + */ + protected $road_snapped = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $location + * The location of the vehicle. + * When it is sent to Fleet Engine, the vehicle's location is a GPS location. + * When you receive it in a response, the vehicle's location can be either a + * GPS location, a supplemental location, or some other estimated location. + * The source is specified in `location_sensor`. + * @type \Google\Protobuf\DoubleValue $horizontal_accuracy + * Deprecated: Use `latlng_accuracy` instead. + * @type \Google\Protobuf\DoubleValue $latlng_accuracy + * Accuracy of `location` in meters as a radius. + * @type \Google\Protobuf\Int32Value $heading + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * @type \Google\Protobuf\DoubleValue $bearing_accuracy + * Deprecated: Use `heading_accuracy` instead. + * @type \Google\Protobuf\DoubleValue $heading_accuracy + * Accuracy of `heading` in degrees. + * @type \Google\Protobuf\DoubleValue $altitude + * Altitude in meters above WGS84. + * @type \Google\Protobuf\DoubleValue $vertical_accuracy + * Deprecated: Use `altitude_accuracy` instead. + * @type \Google\Protobuf\DoubleValue $altitude_accuracy + * Accuracy of `altitude` in meters. + * @type \Google\Protobuf\Int32Value $speed_kmph + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * @type \Google\Protobuf\DoubleValue $speed + * Speed of the vehicle in meters/second + * @type \Google\Protobuf\DoubleValue $speed_accuracy + * Accuracy of `speed` in meters/second. + * @type \Google\Protobuf\Timestamp $update_time + * The time when `location` was reported by the sensor according to the + * sensor's clock. + * @type \Google\Protobuf\Timestamp $server_time + * Output only. The time when the server received the location information. + * @type int $location_sensor + * Provider of location data (for example, `GPS`). + * @type \Google\Protobuf\BoolValue $is_road_snapped + * Whether `location` is snapped to a road. + * @type \Google\Protobuf\BoolValue $is_gps_sensor_enabled + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * @type \Google\Protobuf\Int32Value $time_since_update + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * @type \Google\Protobuf\Int32Value $num_stale_updates + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * @type \Google\Type\LatLng $raw_location + * Raw vehicle location (unprocessed by road-snapper). + * @type \Google\Protobuf\Timestamp $raw_location_time + * Timestamp associated with the raw location. + * @type int $raw_location_sensor + * Source of the raw location. Defaults to `GPS`. + * @type \Google\Protobuf\DoubleValue $raw_location_accuracy + * Accuracy of `raw_location` as a radius, in meters. + * @type \Google\Type\LatLng $supplemental_location + * Supplemental location provided by the integrating app. + * @type \Google\Protobuf\Timestamp $supplemental_location_time + * Timestamp associated with the supplemental location. + * @type int $supplemental_location_sensor + * Source of the supplemental location. Defaults to + * `CUSTOMER_SUPPLIED_LOCATION`. + * @type \Google\Protobuf\DoubleValue $supplemental_location_accuracy + * Accuracy of `supplemental_location` as a radius, in meters. + * @type bool $road_snapped + * Deprecated: Use `is_road_snapped` instead. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Fleetengine::initOnce(); + parent::__construct($data); + } + + /** + * The location of the vehicle. + * When it is sent to Fleet Engine, the vehicle's location is a GPS location. + * When you receive it in a response, the vehicle's location can be either a + * GPS location, a supplemental location, or some other estimated location. + * The source is specified in `location_sensor`. + * + * Generated from protobuf field .google.type.LatLng location = 1; + * @return \Google\Type\LatLng|null + */ + public function getLocation() + { + return $this->location; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * The location of the vehicle. + * When it is sent to Fleet Engine, the vehicle's location is a GPS location. + * When you receive it in a response, the vehicle's location can be either a + * GPS location, a supplemental location, or some other estimated location. + * The source is specified in `location_sensor`. + * + * Generated from protobuf field .google.type.LatLng location = 1; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->location = $var; + + return $this; + } + + /** + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @return \Google\Protobuf\DoubleValue|null + * @deprecated + */ + public function getHorizontalAccuracy() + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->horizontal_accuracy; + } + + public function hasHorizontalAccuracy() + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + return isset($this->horizontal_accuracy); + } + + public function clearHorizontalAccuracy() + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + unset($this->horizontal_accuracy); + } + + /** + * Returns the unboxed value from getHorizontalAccuracy() + + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @return float|null + */ + public function getHorizontalAccuracyUnwrapped() + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("horizontal_accuracy"); + } + + /** + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + * @deprecated + */ + public function setHorizontalAccuracy($var) + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->horizontal_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @param float|null $var + * @return $this + */ + public function setHorizontalAccuracyUnwrapped($var) + { + $this->writeWrapperValue("horizontal_accuracy", $var); + return $this;} + + /** + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getLatlngAccuracy() + { + return $this->latlng_accuracy; + } + + public function hasLatlngAccuracy() + { + return isset($this->latlng_accuracy); + } + + public function clearLatlngAccuracy() + { + unset($this->latlng_accuracy); + } + + /** + * Returns the unboxed value from getLatlngAccuracy() + + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + * @return float|null + */ + public function getLatlngAccuracyUnwrapped() + { + return $this->readWrapperValue("latlng_accuracy"); + } + + /** + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setLatlngAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->latlng_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + * @param float|null $var + * @return $this + */ + public function setLatlngAccuracyUnwrapped($var) + { + $this->writeWrapperValue("latlng_accuracy", $var); + return $this;} + + /** + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + * @return \Google\Protobuf\Int32Value|null + */ + public function getHeading() + { + return $this->heading; + } + + public function hasHeading() + { + return isset($this->heading); + } + + public function clearHeading() + { + unset($this->heading); + } + + /** + * Returns the unboxed value from getHeading() + + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + * @return int|null + */ + public function getHeadingUnwrapped() + { + return $this->readWrapperValue("heading"); + } + + /** + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setHeading($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->heading = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + * @param int|null $var + * @return $this + */ + public function setHeadingUnwrapped($var) + { + $this->writeWrapperValue("heading", $var); + return $this;} + + /** + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @return \Google\Protobuf\DoubleValue|null + * @deprecated + */ + public function getBearingAccuracy() + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->bearing_accuracy; + } + + public function hasBearingAccuracy() + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + return isset($this->bearing_accuracy); + } + + public function clearBearingAccuracy() + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + unset($this->bearing_accuracy); + } + + /** + * Returns the unboxed value from getBearingAccuracy() + + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @return float|null + */ + public function getBearingAccuracyUnwrapped() + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("bearing_accuracy"); + } + + /** + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + * @deprecated + */ + public function setBearingAccuracy($var) + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->bearing_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @param float|null $var + * @return $this + */ + public function setBearingAccuracyUnwrapped($var) + { + $this->writeWrapperValue("bearing_accuracy", $var); + return $this;} + + /** + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getHeadingAccuracy() + { + return $this->heading_accuracy; + } + + public function hasHeadingAccuracy() + { + return isset($this->heading_accuracy); + } + + public function clearHeadingAccuracy() + { + unset($this->heading_accuracy); + } + + /** + * Returns the unboxed value from getHeadingAccuracy() + + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + * @return float|null + */ + public function getHeadingAccuracyUnwrapped() + { + return $this->readWrapperValue("heading_accuracy"); + } + + /** + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setHeadingAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->heading_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + * @param float|null $var + * @return $this + */ + public function setHeadingAccuracyUnwrapped($var) + { + $this->writeWrapperValue("heading_accuracy", $var); + return $this;} + + /** + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getAltitude() + { + return $this->altitude; + } + + public function hasAltitude() + { + return isset($this->altitude); + } + + public function clearAltitude() + { + unset($this->altitude); + } + + /** + * Returns the unboxed value from getAltitude() + + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + * @return float|null + */ + public function getAltitudeUnwrapped() + { + return $this->readWrapperValue("altitude"); + } + + /** + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setAltitude($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->altitude = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + * @param float|null $var + * @return $this + */ + public function setAltitudeUnwrapped($var) + { + $this->writeWrapperValue("altitude", $var); + return $this;} + + /** + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @return \Google\Protobuf\DoubleValue|null + * @deprecated + */ + public function getVerticalAccuracy() + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->vertical_accuracy; + } + + public function hasVerticalAccuracy() + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + return isset($this->vertical_accuracy); + } + + public function clearVerticalAccuracy() + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + unset($this->vertical_accuracy); + } + + /** + * Returns the unboxed value from getVerticalAccuracy() + + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @return float|null + */ + public function getVerticalAccuracyUnwrapped() + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("vertical_accuracy"); + } + + /** + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + * @deprecated + */ + public function setVerticalAccuracy($var) + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->vertical_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @param float|null $var + * @return $this + */ + public function setVerticalAccuracyUnwrapped($var) + { + $this->writeWrapperValue("vertical_accuracy", $var); + return $this;} + + /** + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getAltitudeAccuracy() + { + return $this->altitude_accuracy; + } + + public function hasAltitudeAccuracy() + { + return isset($this->altitude_accuracy); + } + + public function clearAltitudeAccuracy() + { + unset($this->altitude_accuracy); + } + + /** + * Returns the unboxed value from getAltitudeAccuracy() + + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + * @return float|null + */ + public function getAltitudeAccuracyUnwrapped() + { + return $this->readWrapperValue("altitude_accuracy"); + } + + /** + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setAltitudeAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->altitude_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + * @param float|null $var + * @return $this + */ + public function setAltitudeAccuracyUnwrapped($var) + { + $this->writeWrapperValue("altitude_accuracy", $var); + return $this;} + + /** + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @return \Google\Protobuf\Int32Value|null + * @deprecated + */ + public function getSpeedKmph() + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + return $this->speed_kmph; + } + + public function hasSpeedKmph() + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + return isset($this->speed_kmph); + } + + public function clearSpeedKmph() + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + unset($this->speed_kmph); + } + + /** + * Returns the unboxed value from getSpeedKmph() + + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @return int|null + */ + public function getSpeedKmphUnwrapped() + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("speed_kmph"); + } + + /** + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + * @deprecated + */ + public function setSpeedKmph($var) + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->speed_kmph = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @param int|null $var + * @return $this + */ + public function setSpeedKmphUnwrapped($var) + { + $this->writeWrapperValue("speed_kmph", $var); + return $this;} + + /** + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getSpeed() + { + return $this->speed; + } + + public function hasSpeed() + { + return isset($this->speed); + } + + public function clearSpeed() + { + unset($this->speed); + } + + /** + * Returns the unboxed value from getSpeed() + + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + * @return float|null + */ + public function getSpeedUnwrapped() + { + return $this->readWrapperValue("speed"); + } + + /** + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setSpeed($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->speed = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + * @param float|null $var + * @return $this + */ + public function setSpeedUnwrapped($var) + { + $this->writeWrapperValue("speed", $var); + return $this;} + + /** + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getSpeedAccuracy() + { + return $this->speed_accuracy; + } + + public function hasSpeedAccuracy() + { + return isset($this->speed_accuracy); + } + + public function clearSpeedAccuracy() + { + unset($this->speed_accuracy); + } + + /** + * Returns the unboxed value from getSpeedAccuracy() + + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + * @return float|null + */ + public function getSpeedAccuracyUnwrapped() + { + return $this->readWrapperValue("speed_accuracy"); + } + + /** + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setSpeedAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->speed_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + * @param float|null $var + * @return $this + */ + public function setSpeedAccuracyUnwrapped($var) + { + $this->writeWrapperValue("speed_accuracy", $var); + return $this;} + + /** + * The time when `location` was reported by the sensor according to the + * sensor's clock. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The time when `location` was reported by the sensor according to the + * sensor's clock. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The time when the server received the location information. + * + * Generated from protobuf field .google.protobuf.Timestamp server_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getServerTime() + { + return $this->server_time; + } + + public function hasServerTime() + { + return isset($this->server_time); + } + + public function clearServerTime() + { + unset($this->server_time); + } + + /** + * Output only. The time when the server received the location information. + * + * Generated from protobuf field .google.protobuf.Timestamp server_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setServerTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->server_time = $var; + + return $this; + } + + /** + * Provider of location data (for example, `GPS`). + * + * Generated from protobuf field .maps.fleetengine.v1.LocationSensor location_sensor = 11; + * @return int + */ + public function getLocationSensor() + { + return $this->location_sensor; + } + + /** + * Provider of location data (for example, `GPS`). + * + * Generated from protobuf field .maps.fleetengine.v1.LocationSensor location_sensor = 11; + * @param int $var + * @return $this + */ + public function setLocationSensor($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\LocationSensor::class); + $this->location_sensor = $var; + + return $this; + } + + /** + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + * @return \Google\Protobuf\BoolValue|null + */ + public function getIsRoadSnapped() + { + return $this->is_road_snapped; + } + + public function hasIsRoadSnapped() + { + return isset($this->is_road_snapped); + } + + public function clearIsRoadSnapped() + { + unset($this->is_road_snapped); + } + + /** + * Returns the unboxed value from getIsRoadSnapped() + + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + * @return bool|null + */ + public function getIsRoadSnappedUnwrapped() + { + return $this->readWrapperValue("is_road_snapped"); + } + + /** + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setIsRoadSnapped($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->is_road_snapped = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + * @param bool|null $var + * @return $this + */ + public function setIsRoadSnappedUnwrapped($var) + { + $this->writeWrapperValue("is_road_snapped", $var); + return $this;} + + /** + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getIsGpsSensorEnabled() + { + return $this->is_gps_sensor_enabled; + } + + public function hasIsGpsSensorEnabled() + { + return isset($this->is_gps_sensor_enabled); + } + + public function clearIsGpsSensorEnabled() + { + unset($this->is_gps_sensor_enabled); + } + + /** + * Returns the unboxed value from getIsGpsSensorEnabled() + + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return bool|null + */ + public function getIsGpsSensorEnabledUnwrapped() + { + return $this->readWrapperValue("is_gps_sensor_enabled"); + } + + /** + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setIsGpsSensorEnabled($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->is_gps_sensor_enabled = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param bool|null $var + * @return $this + */ + public function setIsGpsSensorEnabledUnwrapped($var) + { + $this->writeWrapperValue("is_gps_sensor_enabled", $var); + return $this;} + + /** + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getTimeSinceUpdate() + { + return $this->time_since_update; + } + + public function hasTimeSinceUpdate() + { + return isset($this->time_since_update); + } + + public function clearTimeSinceUpdate() + { + unset($this->time_since_update); + } + + /** + * Returns the unboxed value from getTimeSinceUpdate() + + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return int|null + */ + public function getTimeSinceUpdateUnwrapped() + { + return $this->readWrapperValue("time_since_update"); + } + + /** + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setTimeSinceUpdate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->time_since_update = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param int|null $var + * @return $this + */ + public function setTimeSinceUpdateUnwrapped($var) + { + $this->writeWrapperValue("time_since_update", $var); + return $this;} + + /** + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Int32Value|null + * @deprecated + */ + public function getNumStaleUpdates() + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + return $this->num_stale_updates; + } + + public function hasNumStaleUpdates() + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + return isset($this->num_stale_updates); + } + + public function clearNumStaleUpdates() + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + unset($this->num_stale_updates); + } + + /** + * Returns the unboxed value from getNumStaleUpdates() + + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @return int|null + */ + public function getNumStaleUpdatesUnwrapped() + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("num_stale_updates"); + } + + /** + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + * @deprecated + */ + public function setNumStaleUpdates($var) + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->num_stale_updates = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @param int|null $var + * @return $this + */ + public function setNumStaleUpdatesUnwrapped($var) + { + $this->writeWrapperValue("num_stale_updates", $var); + return $this;} + + /** + * Raw vehicle location (unprocessed by road-snapper). + * + * Generated from protobuf field .google.type.LatLng raw_location = 16; + * @return \Google\Type\LatLng|null + */ + public function getRawLocation() + { + return $this->raw_location; + } + + public function hasRawLocation() + { + return isset($this->raw_location); + } + + public function clearRawLocation() + { + unset($this->raw_location); + } + + /** + * Raw vehicle location (unprocessed by road-snapper). + * + * Generated from protobuf field .google.type.LatLng raw_location = 16; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setRawLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->raw_location = $var; + + return $this; + } + + /** + * Timestamp associated with the raw location. + * + * Generated from protobuf field .google.protobuf.Timestamp raw_location_time = 17; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRawLocationTime() + { + return $this->raw_location_time; + } + + public function hasRawLocationTime() + { + return isset($this->raw_location_time); + } + + public function clearRawLocationTime() + { + unset($this->raw_location_time); + } + + /** + * Timestamp associated with the raw location. + * + * Generated from protobuf field .google.protobuf.Timestamp raw_location_time = 17; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRawLocationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->raw_location_time = $var; + + return $this; + } + + /** + * Source of the raw location. Defaults to `GPS`. + * + * Generated from protobuf field .maps.fleetengine.v1.LocationSensor raw_location_sensor = 28; + * @return int + */ + public function getRawLocationSensor() + { + return $this->raw_location_sensor; + } + + /** + * Source of the raw location. Defaults to `GPS`. + * + * Generated from protobuf field .maps.fleetengine.v1.LocationSensor raw_location_sensor = 28; + * @param int $var + * @return $this + */ + public function setRawLocationSensor($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\LocationSensor::class); + $this->raw_location_sensor = $var; + + return $this; + } + + /** + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getRawLocationAccuracy() + { + return $this->raw_location_accuracy; + } + + public function hasRawLocationAccuracy() + { + return isset($this->raw_location_accuracy); + } + + public function clearRawLocationAccuracy() + { + unset($this->raw_location_accuracy); + } + + /** + * Returns the unboxed value from getRawLocationAccuracy() + + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + * @return float|null + */ + public function getRawLocationAccuracyUnwrapped() + { + return $this->readWrapperValue("raw_location_accuracy"); + } + + /** + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setRawLocationAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->raw_location_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + * @param float|null $var + * @return $this + */ + public function setRawLocationAccuracyUnwrapped($var) + { + $this->writeWrapperValue("raw_location_accuracy", $var); + return $this;} + + /** + * Supplemental location provided by the integrating app. + * + * Generated from protobuf field .google.type.LatLng supplemental_location = 18; + * @return \Google\Type\LatLng|null + */ + public function getSupplementalLocation() + { + return $this->supplemental_location; + } + + public function hasSupplementalLocation() + { + return isset($this->supplemental_location); + } + + public function clearSupplementalLocation() + { + unset($this->supplemental_location); + } + + /** + * Supplemental location provided by the integrating app. + * + * Generated from protobuf field .google.type.LatLng supplemental_location = 18; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setSupplementalLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->supplemental_location = $var; + + return $this; + } + + /** + * Timestamp associated with the supplemental location. + * + * Generated from protobuf field .google.protobuf.Timestamp supplemental_location_time = 19; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSupplementalLocationTime() + { + return $this->supplemental_location_time; + } + + public function hasSupplementalLocationTime() + { + return isset($this->supplemental_location_time); + } + + public function clearSupplementalLocationTime() + { + unset($this->supplemental_location_time); + } + + /** + * Timestamp associated with the supplemental location. + * + * Generated from protobuf field .google.protobuf.Timestamp supplemental_location_time = 19; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSupplementalLocationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->supplemental_location_time = $var; + + return $this; + } + + /** + * Source of the supplemental location. Defaults to + * `CUSTOMER_SUPPLIED_LOCATION`. + * + * Generated from protobuf field .maps.fleetengine.v1.LocationSensor supplemental_location_sensor = 20; + * @return int + */ + public function getSupplementalLocationSensor() + { + return $this->supplemental_location_sensor; + } + + /** + * Source of the supplemental location. Defaults to + * `CUSTOMER_SUPPLIED_LOCATION`. + * + * Generated from protobuf field .maps.fleetengine.v1.LocationSensor supplemental_location_sensor = 20; + * @param int $var + * @return $this + */ + public function setSupplementalLocationSensor($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\LocationSensor::class); + $this->supplemental_location_sensor = $var; + + return $this; + } + + /** + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getSupplementalLocationAccuracy() + { + return $this->supplemental_location_accuracy; + } + + public function hasSupplementalLocationAccuracy() + { + return isset($this->supplemental_location_accuracy); + } + + public function clearSupplementalLocationAccuracy() + { + unset($this->supplemental_location_accuracy); + } + + /** + * Returns the unboxed value from getSupplementalLocationAccuracy() + + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + * @return float|null + */ + public function getSupplementalLocationAccuracyUnwrapped() + { + return $this->readWrapperValue("supplemental_location_accuracy"); + } + + /** + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setSupplementalLocationAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->supplemental_location_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + * @param float|null $var + * @return $this + */ + public function setSupplementalLocationAccuracyUnwrapped($var) + { + $this->writeWrapperValue("supplemental_location_accuracy", $var); + return $this;} + + /** + * Deprecated: Use `is_road_snapped` instead. + * + * Generated from protobuf field bool road_snapped = 26 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getRoadSnapped() + { + @trigger_error('road_snapped is deprecated.', E_USER_DEPRECATED); + return $this->road_snapped; + } + + /** + * Deprecated: Use `is_road_snapped` instead. + * + * Generated from protobuf field bool road_snapped = 26 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setRoadSnapped($var) + { + @trigger_error('road_snapped is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->road_snapped = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/VehicleMatch.php b/MapsFleetEngine/src/V1/VehicleMatch.php new file mode 100644 index 000000000000..d0945ffdbcbf --- /dev/null +++ b/MapsFleetEngine/src/V1/VehicleMatch.php @@ -0,0 +1,697 @@ +maps.fleetengine.v1.VehicleMatch + */ +class VehicleMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A vehicle that matches the request. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle vehicle = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vehicle = null; + /** + * The vehicle's driving ETA to the pickup point specified in the + * request. An empty value indicates a failure in calculating ETA for the + * vehicle. If `SearchVehiclesRequest.include_back_to_back` was `true` and + * this vehicle has an active trip, `vehicle_pickup_eta` includes the time + * required to complete the current active trip. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_pickup_eta = 2; + */ + protected $vehicle_pickup_eta = null; + /** + * The distance from the Vehicle's current location to the pickup point + * specified in the request, including any intermediate pickup or dropoff + * points for existing trips. This distance comprises the calculated driving + * (route) distance, plus the straight line distance between the navigation + * end point and the requested pickup point. (The distance between the + * navigation end point and the requested pickup point is typically small.) An + * empty value indicates an error in calculating the distance. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_distance_meters = 3; + */ + protected $vehicle_pickup_distance_meters = null; + /** + * Required. The straight-line distance between the vehicle and the pickup + * point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_straight_line_distance_meters = 11 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vehicle_pickup_straight_line_distance_meters = null; + /** + * The complete vehicle's driving ETA to the drop off point specified in the + * request. The ETA includes stopping at any waypoints before the + * `dropoff_point` specified in the request. The value will only be populated + * when a drop off point is specified in the request. An empty value indicates + * an error calculating the ETA. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_dropoff_eta = 4; + */ + protected $vehicle_dropoff_eta = null; + /** + * The vehicle's driving distance (in meters) from the pickup point + * to the drop off point specified in the request. The distance is only + * between the two points and does not include the vehicle location or any + * other points that must be visited before the vehicle visits either the + * pickup point or dropoff point. The value will only be populated when a + * `dropoff_point` is specified in the request. An empty value indicates + * a failure in calculating the distance from the pickup to + * drop off point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_to_dropoff_distance_meters = 5; + */ + protected $vehicle_pickup_to_dropoff_distance_meters = null; + /** + * Required. The trip type of the request that was used to calculate the ETA + * to the pickup point. + * + * Generated from protobuf field .maps.fleetengine.v1.TripType trip_type = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $trip_type = 0; + /** + * The ordered list of waypoints used to calculate the ETA. The list + * includes vehicle location, the pickup points of active + * trips for the vehicle, and the pickup points provided in the + * request. An empty list indicates a failure in calculating ETA for the + * vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Waypoint vehicle_trips_waypoints = 7; + */ + private $vehicle_trips_waypoints; + /** + * Type of the vehicle match. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleMatch.VehicleMatchType vehicle_match_type = 8; + */ + protected $vehicle_match_type = 0; + /** + * The order requested for sorting vehicle matches. + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder requested_ordered_by = 9; + */ + protected $requested_ordered_by = 0; + /** + * The actual order that was used for this vehicle. Normally this + * will match the 'order_by' field from the request; however, in certain + * circumstances such as an internal server error, a different method + * may be used (such as `PICKUP_POINT_STRAIGHT_DISTANCE`). + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder ordered_by = 10; + */ + protected $ordered_by = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\V1\Vehicle $vehicle + * Required. A vehicle that matches the request. + * @type \Google\Protobuf\Timestamp $vehicle_pickup_eta + * The vehicle's driving ETA to the pickup point specified in the + * request. An empty value indicates a failure in calculating ETA for the + * vehicle. If `SearchVehiclesRequest.include_back_to_back` was `true` and + * this vehicle has an active trip, `vehicle_pickup_eta` includes the time + * required to complete the current active trip. + * @type \Google\Protobuf\Int32Value $vehicle_pickup_distance_meters + * The distance from the Vehicle's current location to the pickup point + * specified in the request, including any intermediate pickup or dropoff + * points for existing trips. This distance comprises the calculated driving + * (route) distance, plus the straight line distance between the navigation + * end point and the requested pickup point. (The distance between the + * navigation end point and the requested pickup point is typically small.) An + * empty value indicates an error in calculating the distance. + * @type \Google\Protobuf\Int32Value $vehicle_pickup_straight_line_distance_meters + * Required. The straight-line distance between the vehicle and the pickup + * point specified in the request. + * @type \Google\Protobuf\Timestamp $vehicle_dropoff_eta + * The complete vehicle's driving ETA to the drop off point specified in the + * request. The ETA includes stopping at any waypoints before the + * `dropoff_point` specified in the request. The value will only be populated + * when a drop off point is specified in the request. An empty value indicates + * an error calculating the ETA. + * @type \Google\Protobuf\Int32Value $vehicle_pickup_to_dropoff_distance_meters + * The vehicle's driving distance (in meters) from the pickup point + * to the drop off point specified in the request. The distance is only + * between the two points and does not include the vehicle location or any + * other points that must be visited before the vehicle visits either the + * pickup point or dropoff point. The value will only be populated when a + * `dropoff_point` is specified in the request. An empty value indicates + * a failure in calculating the distance from the pickup to + * drop off point specified in the request. + * @type int $trip_type + * Required. The trip type of the request that was used to calculate the ETA + * to the pickup point. + * @type array<\Google\Maps\FleetEngine\V1\Waypoint>|\Google\Protobuf\Internal\RepeatedField $vehicle_trips_waypoints + * The ordered list of waypoints used to calculate the ETA. The list + * includes vehicle location, the pickup points of active + * trips for the vehicle, and the pickup points provided in the + * request. An empty list indicates a failure in calculating ETA for the + * vehicle. + * @type int $vehicle_match_type + * Type of the vehicle match. + * @type int $requested_ordered_by + * The order requested for sorting vehicle matches. + * @type int $ordered_by + * The actual order that was used for this vehicle. Normally this + * will match the 'order_by' field from the request; however, in certain + * circumstances such as an internal server error, a different method + * may be used (such as `PICKUP_POINT_STRAIGHT_DISTANCE`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * Required. A vehicle that matches the request. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle vehicle = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\V1\Vehicle|null + */ + public function getVehicle() + { + return $this->vehicle; + } + + public function hasVehicle() + { + return isset($this->vehicle); + } + + public function clearVehicle() + { + unset($this->vehicle); + } + + /** + * Required. A vehicle that matches the request. + * + * Generated from protobuf field .maps.fleetengine.v1.Vehicle vehicle = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\V1\Vehicle $var + * @return $this + */ + public function setVehicle($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\V1\Vehicle::class); + $this->vehicle = $var; + + return $this; + } + + /** + * The vehicle's driving ETA to the pickup point specified in the + * request. An empty value indicates a failure in calculating ETA for the + * vehicle. If `SearchVehiclesRequest.include_back_to_back` was `true` and + * this vehicle has an active trip, `vehicle_pickup_eta` includes the time + * required to complete the current active trip. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_pickup_eta = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getVehiclePickupEta() + { + return $this->vehicle_pickup_eta; + } + + public function hasVehiclePickupEta() + { + return isset($this->vehicle_pickup_eta); + } + + public function clearVehiclePickupEta() + { + unset($this->vehicle_pickup_eta); + } + + /** + * The vehicle's driving ETA to the pickup point specified in the + * request. An empty value indicates a failure in calculating ETA for the + * vehicle. If `SearchVehiclesRequest.include_back_to_back` was `true` and + * this vehicle has an active trip, `vehicle_pickup_eta` includes the time + * required to complete the current active trip. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_pickup_eta = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setVehiclePickupEta($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->vehicle_pickup_eta = $var; + + return $this; + } + + /** + * The distance from the Vehicle's current location to the pickup point + * specified in the request, including any intermediate pickup or dropoff + * points for existing trips. This distance comprises the calculated driving + * (route) distance, plus the straight line distance between the navigation + * end point and the requested pickup point. (The distance between the + * navigation end point and the requested pickup point is typically small.) An + * empty value indicates an error in calculating the distance. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_distance_meters = 3; + * @return \Google\Protobuf\Int32Value|null + */ + public function getVehiclePickupDistanceMeters() + { + return $this->vehicle_pickup_distance_meters; + } + + public function hasVehiclePickupDistanceMeters() + { + return isset($this->vehicle_pickup_distance_meters); + } + + public function clearVehiclePickupDistanceMeters() + { + unset($this->vehicle_pickup_distance_meters); + } + + /** + * Returns the unboxed value from getVehiclePickupDistanceMeters() + + * The distance from the Vehicle's current location to the pickup point + * specified in the request, including any intermediate pickup or dropoff + * points for existing trips. This distance comprises the calculated driving + * (route) distance, plus the straight line distance between the navigation + * end point and the requested pickup point. (The distance between the + * navigation end point and the requested pickup point is typically small.) An + * empty value indicates an error in calculating the distance. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_distance_meters = 3; + * @return int|null + */ + public function getVehiclePickupDistanceMetersUnwrapped() + { + return $this->readWrapperValue("vehicle_pickup_distance_meters"); + } + + /** + * The distance from the Vehicle's current location to the pickup point + * specified in the request, including any intermediate pickup or dropoff + * points for existing trips. This distance comprises the calculated driving + * (route) distance, plus the straight line distance between the navigation + * end point and the requested pickup point. (The distance between the + * navigation end point and the requested pickup point is typically small.) An + * empty value indicates an error in calculating the distance. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_distance_meters = 3; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setVehiclePickupDistanceMeters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->vehicle_pickup_distance_meters = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The distance from the Vehicle's current location to the pickup point + * specified in the request, including any intermediate pickup or dropoff + * points for existing trips. This distance comprises the calculated driving + * (route) distance, plus the straight line distance between the navigation + * end point and the requested pickup point. (The distance between the + * navigation end point and the requested pickup point is typically small.) An + * empty value indicates an error in calculating the distance. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_distance_meters = 3; + * @param int|null $var + * @return $this + */ + public function setVehiclePickupDistanceMetersUnwrapped($var) + { + $this->writeWrapperValue("vehicle_pickup_distance_meters", $var); + return $this;} + + /** + * Required. The straight-line distance between the vehicle and the pickup + * point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_straight_line_distance_meters = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getVehiclePickupStraightLineDistanceMeters() + { + return $this->vehicle_pickup_straight_line_distance_meters; + } + + public function hasVehiclePickupStraightLineDistanceMeters() + { + return isset($this->vehicle_pickup_straight_line_distance_meters); + } + + public function clearVehiclePickupStraightLineDistanceMeters() + { + unset($this->vehicle_pickup_straight_line_distance_meters); + } + + /** + * Returns the unboxed value from getVehiclePickupStraightLineDistanceMeters() + + * Required. The straight-line distance between the vehicle and the pickup + * point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_straight_line_distance_meters = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return int|null + */ + public function getVehiclePickupStraightLineDistanceMetersUnwrapped() + { + return $this->readWrapperValue("vehicle_pickup_straight_line_distance_meters"); + } + + /** + * Required. The straight-line distance between the vehicle and the pickup + * point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_straight_line_distance_meters = 11 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setVehiclePickupStraightLineDistanceMeters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->vehicle_pickup_straight_line_distance_meters = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Required. The straight-line distance between the vehicle and the pickup + * point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_straight_line_distance_meters = 11 [(.google.api.field_behavior) = REQUIRED]; + * @param int|null $var + * @return $this + */ + public function setVehiclePickupStraightLineDistanceMetersUnwrapped($var) + { + $this->writeWrapperValue("vehicle_pickup_straight_line_distance_meters", $var); + return $this;} + + /** + * The complete vehicle's driving ETA to the drop off point specified in the + * request. The ETA includes stopping at any waypoints before the + * `dropoff_point` specified in the request. The value will only be populated + * when a drop off point is specified in the request. An empty value indicates + * an error calculating the ETA. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_dropoff_eta = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getVehicleDropoffEta() + { + return $this->vehicle_dropoff_eta; + } + + public function hasVehicleDropoffEta() + { + return isset($this->vehicle_dropoff_eta); + } + + public function clearVehicleDropoffEta() + { + unset($this->vehicle_dropoff_eta); + } + + /** + * The complete vehicle's driving ETA to the drop off point specified in the + * request. The ETA includes stopping at any waypoints before the + * `dropoff_point` specified in the request. The value will only be populated + * when a drop off point is specified in the request. An empty value indicates + * an error calculating the ETA. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_dropoff_eta = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setVehicleDropoffEta($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->vehicle_dropoff_eta = $var; + + return $this; + } + + /** + * The vehicle's driving distance (in meters) from the pickup point + * to the drop off point specified in the request. The distance is only + * between the two points and does not include the vehicle location or any + * other points that must be visited before the vehicle visits either the + * pickup point or dropoff point. The value will only be populated when a + * `dropoff_point` is specified in the request. An empty value indicates + * a failure in calculating the distance from the pickup to + * drop off point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_to_dropoff_distance_meters = 5; + * @return \Google\Protobuf\Int32Value|null + */ + public function getVehiclePickupToDropoffDistanceMeters() + { + return $this->vehicle_pickup_to_dropoff_distance_meters; + } + + public function hasVehiclePickupToDropoffDistanceMeters() + { + return isset($this->vehicle_pickup_to_dropoff_distance_meters); + } + + public function clearVehiclePickupToDropoffDistanceMeters() + { + unset($this->vehicle_pickup_to_dropoff_distance_meters); + } + + /** + * Returns the unboxed value from getVehiclePickupToDropoffDistanceMeters() + + * The vehicle's driving distance (in meters) from the pickup point + * to the drop off point specified in the request. The distance is only + * between the two points and does not include the vehicle location or any + * other points that must be visited before the vehicle visits either the + * pickup point or dropoff point. The value will only be populated when a + * `dropoff_point` is specified in the request. An empty value indicates + * a failure in calculating the distance from the pickup to + * drop off point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_to_dropoff_distance_meters = 5; + * @return int|null + */ + public function getVehiclePickupToDropoffDistanceMetersUnwrapped() + { + return $this->readWrapperValue("vehicle_pickup_to_dropoff_distance_meters"); + } + + /** + * The vehicle's driving distance (in meters) from the pickup point + * to the drop off point specified in the request. The distance is only + * between the two points and does not include the vehicle location or any + * other points that must be visited before the vehicle visits either the + * pickup point or dropoff point. The value will only be populated when a + * `dropoff_point` is specified in the request. An empty value indicates + * a failure in calculating the distance from the pickup to + * drop off point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_to_dropoff_distance_meters = 5; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setVehiclePickupToDropoffDistanceMeters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->vehicle_pickup_to_dropoff_distance_meters = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The vehicle's driving distance (in meters) from the pickup point + * to the drop off point specified in the request. The distance is only + * between the two points and does not include the vehicle location or any + * other points that must be visited before the vehicle visits either the + * pickup point or dropoff point. The value will only be populated when a + * `dropoff_point` is specified in the request. An empty value indicates + * a failure in calculating the distance from the pickup to + * drop off point specified in the request. + * + * Generated from protobuf field .google.protobuf.Int32Value vehicle_pickup_to_dropoff_distance_meters = 5; + * @param int|null $var + * @return $this + */ + public function setVehiclePickupToDropoffDistanceMetersUnwrapped($var) + { + $this->writeWrapperValue("vehicle_pickup_to_dropoff_distance_meters", $var); + return $this;} + + /** + * Required. The trip type of the request that was used to calculate the ETA + * to the pickup point. + * + * Generated from protobuf field .maps.fleetengine.v1.TripType trip_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getTripType() + { + return $this->trip_type; + } + + /** + * Required. The trip type of the request that was used to calculate the ETA + * to the pickup point. + * + * Generated from protobuf field .maps.fleetengine.v1.TripType trip_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setTripType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\TripType::class); + $this->trip_type = $var; + + return $this; + } + + /** + * The ordered list of waypoints used to calculate the ETA. The list + * includes vehicle location, the pickup points of active + * trips for the vehicle, and the pickup points provided in the + * request. An empty list indicates a failure in calculating ETA for the + * vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Waypoint vehicle_trips_waypoints = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVehicleTripsWaypoints() + { + return $this->vehicle_trips_waypoints; + } + + /** + * The ordered list of waypoints used to calculate the ETA. The list + * includes vehicle location, the pickup points of active + * trips for the vehicle, and the pickup points provided in the + * request. An empty list indicates a failure in calculating ETA for the + * vehicle. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.Waypoint vehicle_trips_waypoints = 7; + * @param array<\Google\Maps\FleetEngine\V1\Waypoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVehicleTripsWaypoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\Waypoint::class); + $this->vehicle_trips_waypoints = $arr; + + return $this; + } + + /** + * Type of the vehicle match. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleMatch.VehicleMatchType vehicle_match_type = 8; + * @return int + */ + public function getVehicleMatchType() + { + return $this->vehicle_match_type; + } + + /** + * Type of the vehicle match. + * + * Generated from protobuf field .maps.fleetengine.v1.VehicleMatch.VehicleMatchType vehicle_match_type = 8; + * @param int $var + * @return $this + */ + public function setVehicleMatchType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\VehicleMatch\VehicleMatchType::class); + $this->vehicle_match_type = $var; + + return $this; + } + + /** + * The order requested for sorting vehicle matches. + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder requested_ordered_by = 9; + * @return int + */ + public function getRequestedOrderedBy() + { + return $this->requested_ordered_by; + } + + /** + * The order requested for sorting vehicle matches. + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder requested_ordered_by = 9; + * @param int $var + * @return $this + */ + public function setRequestedOrderedBy($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\SearchVehiclesRequest\VehicleMatchOrder::class); + $this->requested_ordered_by = $var; + + return $this; + } + + /** + * The actual order that was used for this vehicle. Normally this + * will match the 'order_by' field from the request; however, in certain + * circumstances such as an internal server error, a different method + * may be used (such as `PICKUP_POINT_STRAIGHT_DISTANCE`). + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder ordered_by = 10; + * @return int + */ + public function getOrderedBy() + { + return $this->ordered_by; + } + + /** + * The actual order that was used for this vehicle. Normally this + * will match the 'order_by' field from the request; however, in certain + * circumstances such as an internal server error, a different method + * may be used (such as `PICKUP_POINT_STRAIGHT_DISTANCE`). + * + * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder ordered_by = 10; + * @param int $var + * @return $this + */ + public function setOrderedBy($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\SearchVehiclesRequest\VehicleMatchOrder::class); + $this->ordered_by = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/VehicleMatch/VehicleMatchType.php b/MapsFleetEngine/src/V1/VehicleMatch/VehicleMatchType.php new file mode 100644 index 000000000000..17636191628e --- /dev/null +++ b/MapsFleetEngine/src/V1/VehicleMatch/VehicleMatchType.php @@ -0,0 +1,81 @@ +maps.fleetengine.v1.VehicleMatch.VehicleMatchType + */ +class VehicleMatchType +{ + /** + * Unknown vehicle match type + * + * Generated from protobuf enum UNKNOWN = 0; + */ + const UNKNOWN = 0; + /** + * The vehicle currently has no trip assigned to it and can proceed to the + * pickup point. + * + * Generated from protobuf enum EXCLUSIVE = 1; + */ + const EXCLUSIVE = 1; + /** + * The vehicle is currently assigned to a trip, but can proceed to the + * pickup point after completing the in-progress trip. ETA and distance + * calculations take the existing trip into account. + * + * Generated from protobuf enum BACK_TO_BACK = 2; + */ + const BACK_TO_BACK = 2; + /** + * The vehicle has sufficient capacity for a shared ride. + * + * Generated from protobuf enum CARPOOL = 3; + */ + const CARPOOL = 3; + /** + * The vehicle will finish its current, active trip before proceeding to the + * pickup point. ETA and distance calculations take the existing trip into + * account. + * + * Generated from protobuf enum CARPOOL_BACK_TO_BACK = 4; + */ + const CARPOOL_BACK_TO_BACK = 4; + + private static $valueToName = [ + self::UNKNOWN => 'UNKNOWN', + self::EXCLUSIVE => 'EXCLUSIVE', + self::BACK_TO_BACK => 'BACK_TO_BACK', + self::CARPOOL => 'CARPOOL', + self::CARPOOL_BACK_TO_BACK => 'CARPOOL_BACK_TO_BACK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngine/src/V1/VehicleState.php b/MapsFleetEngine/src/V1/VehicleState.php new file mode 100644 index 000000000000..b2964c65ab9f --- /dev/null +++ b/MapsFleetEngine/src/V1/VehicleState.php @@ -0,0 +1,62 @@ +maps.fleetengine.v1.VehicleState + */ +class VehicleState +{ + /** + * Default, used for unspecified or unrecognized vehicle states. + * + * Generated from protobuf enum UNKNOWN_VEHICLE_STATE = 0; + */ + const UNKNOWN_VEHICLE_STATE = 0; + /** + * The vehicle is not accepting new trips. Note: the vehicle may continue to + * operate in this state while completing a trip assigned to it. + * + * Generated from protobuf enum OFFLINE = 1; + */ + const OFFLINE = 1; + /** + * The vehicle is accepting new trips. + * + * Generated from protobuf enum ONLINE = 2; + */ + const ONLINE = 2; + + private static $valueToName = [ + self::UNKNOWN_VEHICLE_STATE => 'UNKNOWN_VEHICLE_STATE', + self::OFFLINE => 'OFFLINE', + self::ONLINE => 'ONLINE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering.php b/MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering.php new file mode 100644 index 000000000000..ccaba2879f9f --- /dev/null +++ b/MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering.php @@ -0,0 +1,84 @@ +maps.fleetengine.v1.VisualTrafficReportPolylineRendering + */ +class VisualTrafficReportPolylineRendering extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Road stretches that should be rendered along the polyline. + * Stretches are guaranteed to not overlap, and do not necessarily span the + * full route. + * In the absence of a road stretch to style, the client should apply the + * default for the route. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VisualTrafficReportPolylineRendering.RoadStretch road_stretch = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $road_stretch; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\V1\VisualTrafficReportPolylineRendering\RoadStretch>|\Google\Protobuf\Internal\RepeatedField $road_stretch + * Optional. Road stretches that should be rendered along the polyline. + * Stretches are guaranteed to not overlap, and do not necessarily span the + * full route. + * In the absence of a road stretch to style, the client should apply the + * default for the route. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Vehicles::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Road stretches that should be rendered along the polyline. + * Stretches are guaranteed to not overlap, and do not necessarily span the + * full route. + * In the absence of a road stretch to style, the client should apply the + * default for the route. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VisualTrafficReportPolylineRendering.RoadStretch road_stretch = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoadStretch() + { + return $this->road_stretch; + } + + /** + * Optional. Road stretches that should be rendered along the polyline. + * Stretches are guaranteed to not overlap, and do not necessarily span the + * full route. + * In the absence of a road stretch to style, the client should apply the + * default for the route. + * + * Generated from protobuf field repeated .maps.fleetengine.v1.VisualTrafficReportPolylineRendering.RoadStretch road_stretch = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Maps\FleetEngine\V1\VisualTrafficReportPolylineRendering\RoadStretch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoadStretch($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\VisualTrafficReportPolylineRendering\RoadStretch::class); + $this->road_stretch = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering/RoadStretch.php b/MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering/RoadStretch.php new file mode 100644 index 000000000000..aefe24c67dee --- /dev/null +++ b/MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering/RoadStretch.php @@ -0,0 +1,140 @@ +maps.fleetengine.v1.VisualTrafficReportPolylineRendering.RoadStretch + */ +class RoadStretch extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The style to apply. + * + * Generated from protobuf field .maps.fleetengine.v1.VisualTrafficReportPolylineRendering.RoadStretch.Style style = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $style = 0; + /** + * Required. The style should be applied between `[offset_meters, + * offset_meters + length_meters)`. + * + * Generated from protobuf field int32 offset_meters = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $offset_meters = 0; + /** + * Required. The length of the path where to apply the style. + * + * Generated from protobuf field int32 length_meters = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $length_meters = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $style + * Required. The style to apply. + * @type int $offset_meters + * Required. The style should be applied between `[offset_meters, + * offset_meters + length_meters)`. + * @type int $length_meters + * Required. The length of the path where to apply the style. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\Vehicles::initOnce(); + parent::__construct($data); + } + + /** + * Required. The style to apply. + * + * Generated from protobuf field .maps.fleetengine.v1.VisualTrafficReportPolylineRendering.RoadStretch.Style style = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getStyle() + { + return $this->style; + } + + /** + * Required. The style to apply. + * + * Generated from protobuf field .maps.fleetengine.v1.VisualTrafficReportPolylineRendering.RoadStretch.Style style = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setStyle($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\V1\VisualTrafficReportPolylineRendering\RoadStretch\Style::class); + $this->style = $var; + + return $this; + } + + /** + * Required. The style should be applied between `[offset_meters, + * offset_meters + length_meters)`. + * + * Generated from protobuf field int32 offset_meters = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getOffsetMeters() + { + return $this->offset_meters; + } + + /** + * Required. The style should be applied between `[offset_meters, + * offset_meters + length_meters)`. + * + * Generated from protobuf field int32 offset_meters = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setOffsetMeters($var) + { + GPBUtil::checkInt32($var); + $this->offset_meters = $var; + + return $this; + } + + /** + * Required. The length of the path where to apply the style. + * + * Generated from protobuf field int32 length_meters = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getLengthMeters() + { + return $this->length_meters; + } + + /** + * Required. The length of the path where to apply the style. + * + * Generated from protobuf field int32 length_meters = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setLengthMeters($var) + { + GPBUtil::checkInt32($var); + $this->length_meters = $var; + + return $this; + } + +} + + diff --git a/MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering/RoadStretch/Style.php b/MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering/RoadStretch/Style.php new file mode 100644 index 000000000000..af03e404ae7c --- /dev/null +++ b/MapsFleetEngine/src/V1/VisualTrafficReportPolylineRendering/RoadStretch/Style.php @@ -0,0 +1,62 @@ +maps.fleetengine.v1.VisualTrafficReportPolylineRendering.RoadStretch.Style + */ +class Style +{ + /** + * No style selected. + * + * Generated from protobuf enum STYLE_UNSPECIFIED = 0; + */ + const STYLE_UNSPECIFIED = 0; + /** + * Traffic is slowing down. + * + * Generated from protobuf enum SLOWER_TRAFFIC = 1; + */ + const SLOWER_TRAFFIC = 1; + /** + * There is a traffic jam. + * + * Generated from protobuf enum TRAFFIC_JAM = 2; + */ + const TRAFFIC_JAM = 2; + + private static $valueToName = [ + self::STYLE_UNSPECIFIED => 'STYLE_UNSPECIFIED', + self::SLOWER_TRAFFIC => 'SLOWER_TRAFFIC', + self::TRAFFIC_JAM => 'TRAFFIC_JAM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngine/src/V1/Waypoint.php b/MapsFleetEngine/src/V1/Waypoint.php new file mode 100644 index 000000000000..06827e4e93bc --- /dev/null +++ b/MapsFleetEngine/src/V1/Waypoint.php @@ -0,0 +1,123 @@ +maps.fleetengine.v1.Waypoint + */ +class Waypoint extends \Google\Protobuf\Internal\Message +{ + /** + * The location of this waypoint. + * + * Generated from protobuf field .google.type.LatLng lat_lng = 1; + */ + protected $lat_lng = null; + /** + * The estimated time that the vehicle will arrive at this waypoint. + * + * Generated from protobuf field .google.protobuf.Timestamp eta = 2; + */ + protected $eta = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $lat_lng + * The location of this waypoint. + * @type \Google\Protobuf\Timestamp $eta + * The estimated time that the vehicle will arrive at this waypoint. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\V1\VehicleApi::initOnce(); + parent::__construct($data); + } + + /** + * The location of this waypoint. + * + * Generated from protobuf field .google.type.LatLng lat_lng = 1; + * @return \Google\Type\LatLng|null + */ + public function getLatLng() + { + return $this->lat_lng; + } + + public function hasLatLng() + { + return isset($this->lat_lng); + } + + public function clearLatLng() + { + unset($this->lat_lng); + } + + /** + * The location of this waypoint. + * + * Generated from protobuf field .google.type.LatLng lat_lng = 1; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setLatLng($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->lat_lng = $var; + + return $this; + } + + /** + * The estimated time that the vehicle will arrive at this waypoint. + * + * Generated from protobuf field .google.protobuf.Timestamp eta = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEta() + { + return $this->eta; + } + + public function hasEta() + { + return isset($this->eta); + } + + public function clearEta() + { + unset($this->eta); + } + + /** + * The estimated time that the vehicle will arrive at this waypoint. + * + * Generated from protobuf field .google.protobuf.Timestamp eta = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEta($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->eta = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngine/src/V1/WaypointType.php b/MapsFleetEngine/src/V1/WaypointType.php new file mode 100644 index 000000000000..7e3a3120d30b --- /dev/null +++ b/MapsFleetEngine/src/V1/WaypointType.php @@ -0,0 +1,68 @@ +maps.fleetengine.v1.WaypointType + */ +class WaypointType +{ + /** + * Unknown or unspecified waypoint type. + * + * Generated from protobuf enum UNKNOWN_WAYPOINT_TYPE = 0; + */ + const UNKNOWN_WAYPOINT_TYPE = 0; + /** + * Waypoints for picking up riders or items. + * + * Generated from protobuf enum PICKUP_WAYPOINT_TYPE = 1; + */ + const PICKUP_WAYPOINT_TYPE = 1; + /** + * Waypoints for dropping off riders or items. + * + * Generated from protobuf enum DROP_OFF_WAYPOINT_TYPE = 2; + */ + const DROP_OFF_WAYPOINT_TYPE = 2; + /** + * Waypoints for intermediate destinations in a multi-destination trip. + * + * Generated from protobuf enum INTERMEDIATE_DESTINATION_WAYPOINT_TYPE = 3; + */ + const INTERMEDIATE_DESTINATION_WAYPOINT_TYPE = 3; + + private static $valueToName = [ + self::UNKNOWN_WAYPOINT_TYPE => 'UNKNOWN_WAYPOINT_TYPE', + self::PICKUP_WAYPOINT_TYPE => 'PICKUP_WAYPOINT_TYPE', + self::DROP_OFF_WAYPOINT_TYPE => 'DROP_OFF_WAYPOINT_TYPE', + self::INTERMEDIATE_DESTINATION_WAYPOINT_TYPE => 'INTERMEDIATE_DESTINATION_WAYPOINT_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngine/src/V1/gapic_metadata.json b/MapsFleetEngine/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..280373142e1a --- /dev/null +++ b/MapsFleetEngine/src/V1/gapic_metadata.json @@ -0,0 +1,82 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "maps.fleetengine.v1", + "libraryPackage": "Google\\Maps\\FleetEngine\\V1", + "services": { + "TripService": { + "clients": { + "grpc": { + "libraryClient": "TripServiceGapicClient", + "rpcs": { + "CreateTrip": { + "methods": [ + "createTrip" + ] + }, + "GetTrip": { + "methods": [ + "getTrip" + ] + }, + "ReportBillableTrip": { + "methods": [ + "reportBillableTrip" + ] + }, + "SearchTrips": { + "methods": [ + "searchTrips" + ] + }, + "UpdateTrip": { + "methods": [ + "updateTrip" + ] + } + } + } + } + }, + "VehicleService": { + "clients": { + "grpc": { + "libraryClient": "VehicleServiceGapicClient", + "rpcs": { + "CreateVehicle": { + "methods": [ + "createVehicle" + ] + }, + "GetVehicle": { + "methods": [ + "getVehicle" + ] + }, + "ListVehicles": { + "methods": [ + "listVehicles" + ] + }, + "SearchVehicles": { + "methods": [ + "searchVehicles" + ] + }, + "UpdateVehicle": { + "methods": [ + "updateVehicle" + ] + }, + "UpdateVehicleAttributes": { + "methods": [ + "updateVehicleAttributes" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/MapsFleetEngine/src/V1/resources/trip_service_client_config.json b/MapsFleetEngine/src/V1/resources/trip_service_client_config.json new file mode 100644 index 000000000000..baf7c028dc49 --- /dev/null +++ b/MapsFleetEngine/src/V1/resources/trip_service_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "maps.fleetengine.v1.TripService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 15000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 15000, + "total_timeout_millis": 15000 + } + }, + "methods": { + "CreateTrip": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTrip": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ReportBillableTrip": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SearchTrips": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateTrip": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/MapsFleetEngine/src/V1/resources/trip_service_descriptor_config.php b/MapsFleetEngine/src/V1/resources/trip_service_descriptor_config.php new file mode 100644 index 000000000000..1e3977139b4b --- /dev/null +++ b/MapsFleetEngine/src/V1/resources/trip_service_descriptor_config.php @@ -0,0 +1,114 @@ + [ + 'maps.fleetengine.v1.TripService' => [ + 'CreateTrip' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\Trip', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'GetTrip' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\Trip', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'ReportBillableTrip' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'SearchTrips' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTrips', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\SearchTripsResponse', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'UpdateTrip' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\Trip', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'templateMap' => [ + 'trip' => 'providers/{provider}/trips/{trip}', + ], + ], + ], +]; diff --git a/MapsFleetEngine/src/V1/resources/trip_service_rest_client_config.php b/MapsFleetEngine/src/V1/resources/trip_service_rest_client_config.php new file mode 100644 index 000000000000..961afdee4c09 --- /dev/null +++ b/MapsFleetEngine/src/V1/resources/trip_service_rest_client_config.php @@ -0,0 +1,94 @@ + [ + 'maps.fleetengine.v1.TripService' => [ + 'CreateTrip' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=providers/*}/trips', + 'body' => 'trip', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'trip_id', + ], + ], + 'GetTrip' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=providers/*/trips/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ReportBillableTrip' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=providers/*/billableTrips/*}:report', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchTrips' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=providers/*}/trips:search', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateTrip' => [ + 'method' => 'put', + 'uriTemplate' => '/v1/{name=providers/*/trips/*}', + 'body' => 'trip', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/MapsFleetEngine/src/V1/resources/vehicle_service_client_config.json b/MapsFleetEngine/src/V1/resources/vehicle_service_client_config.json new file mode 100644 index 000000000000..8d97cde39440 --- /dev/null +++ b/MapsFleetEngine/src/V1/resources/vehicle_service_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "maps.fleetengine.v1.VehicleService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 15000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 15000, + "total_timeout_millis": 15000 + } + }, + "methods": { + "CreateVehicle": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetVehicle": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListVehicles": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SearchVehicles": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateVehicle": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateVehicleAttributes": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/MapsFleetEngine/src/V1/resources/vehicle_service_descriptor_config.php b/MapsFleetEngine/src/V1/resources/vehicle_service_descriptor_config.php new file mode 100644 index 000000000000..ec49a409478c --- /dev/null +++ b/MapsFleetEngine/src/V1/resources/vehicle_service_descriptor_config.php @@ -0,0 +1,129 @@ + [ + 'maps.fleetengine.v1.VehicleService' => [ + 'CreateVehicle' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\Vehicle', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'GetVehicle' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\Vehicle', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'ListVehicles' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getVehicles', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\ListVehiclesResponse', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'SearchVehicles' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\SearchVehiclesResponse', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'UpdateVehicle' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\Vehicle', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'UpdateVehicleAttributes' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\V1\UpdateVehicleAttributesResponse', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'templateMap' => [ + 'vehicle' => 'providers/{provider}/vehicles/{vehicle}', + ], + ], + ], +]; diff --git a/MapsFleetEngine/src/V1/resources/vehicle_service_rest_client_config.php b/MapsFleetEngine/src/V1/resources/vehicle_service_rest_client_config.php new file mode 100644 index 000000000000..ac8a656607f0 --- /dev/null +++ b/MapsFleetEngine/src/V1/resources/vehicle_service_rest_client_config.php @@ -0,0 +1,108 @@ + [ + 'maps.fleetengine.v1.VehicleService' => [ + 'CreateVehicle' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=providers/*}/vehicles', + 'body' => 'vehicle', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'vehicle_id', + ], + ], + 'GetVehicle' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=providers/*/vehicles/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListVehicles' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=providers/*}/vehicles', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'vehicle_type_categories', + ], + ], + 'SearchVehicles' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=providers/*}/vehicles:search', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateVehicle' => [ + 'method' => 'put', + 'uriTemplate' => '/v1/{name=providers/*/vehicles/*}', + 'body' => 'vehicle', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateVehicleAttributes' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=providers/*/vehicles/*}:updateAttributes', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/MapsFleetEngine/tests/Unit/V1/Client/TripServiceClientTest.php b/MapsFleetEngine/tests/Unit/V1/Client/TripServiceClientTest.php new file mode 100644 index 000000000000..8c62711fd674 --- /dev/null +++ b/MapsFleetEngine/tests/Unit/V1/Client/TripServiceClientTest.php @@ -0,0 +1,508 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return TripServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TripServiceClient($options); + } + + /** @test */ + public function createTripTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $vehicleId = 'vehicleId-1378647282'; + $intermediateDestinationIndex = 144716901; + $currentRouteSegment = 'currentRouteSegment-289364233'; + $numberOfPassengers = 674364405; + $lastLocationSnappable = false; + $expectedResponse = new Trip(); + $expectedResponse->setName($name); + $expectedResponse->setVehicleId($vehicleId); + $expectedResponse->setIntermediateDestinationIndex($intermediateDestinationIndex); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $expectedResponse->setNumberOfPassengers($numberOfPassengers); + $expectedResponse->setLastLocationSnappable($lastLocationSnappable); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->tripName('[PROVIDER]', '[TRIP]'); + $tripId = 'tripId-1059631243'; + $trip = new Trip(); + $request = (new CreateTripRequest()) + ->setParent($formattedParent) + ->setTripId($tripId) + ->setTrip($trip); + $response = $gapicClient->createTrip($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.TripService/CreateTrip', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTripId(); + $this->assertProtobufEquals($tripId, $actualValue); + $actualValue = $actualRequestObject->getTrip(); + $this->assertProtobufEquals($trip, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTripExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->tripName('[PROVIDER]', '[TRIP]'); + $tripId = 'tripId-1059631243'; + $trip = new Trip(); + $request = (new CreateTripRequest()) + ->setParent($formattedParent) + ->setTripId($tripId) + ->setTrip($trip); + try { + $gapicClient->createTrip($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTripTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $vehicleId = 'vehicleId-1378647282'; + $intermediateDestinationIndex = 144716901; + $currentRouteSegment = 'currentRouteSegment-289364233'; + $numberOfPassengers = 674364405; + $lastLocationSnappable = false; + $expectedResponse = new Trip(); + $expectedResponse->setName($name2); + $expectedResponse->setVehicleId($vehicleId); + $expectedResponse->setIntermediateDestinationIndex($intermediateDestinationIndex); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $expectedResponse->setNumberOfPassengers($numberOfPassengers); + $expectedResponse->setLastLocationSnappable($lastLocationSnappable); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tripName('[PROVIDER]', '[TRIP]'); + $request = (new GetTripRequest())->setName($formattedName); + $response = $gapicClient->getTrip($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.TripService/GetTrip', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTripExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tripName('[PROVIDER]', '[TRIP]'); + $request = (new GetTripRequest())->setName($formattedName); + try { + $gapicClient->getTrip($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reportBillableTripTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $countryCode = 'countryCode1481071862'; + $request = (new ReportBillableTripRequest())->setName($name)->setCountryCode($countryCode); + $gapicClient->reportBillableTrip($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.TripService/ReportBillableTrip', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getCountryCode(); + $this->assertProtobufEquals($countryCode, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reportBillableTripExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $countryCode = 'countryCode1481071862'; + $request = (new ReportBillableTripRequest())->setName($name)->setCountryCode($countryCode); + try { + $gapicClient->reportBillableTrip($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchTripsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tripsElement = new Trip(); + $trips = [$tripsElement]; + $expectedResponse = new SearchTripsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTrips($trips); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new SearchTripsRequest())->setParent($parent); + $response = $gapicClient->searchTrips($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTrips()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.TripService/SearchTrips', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchTripsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new SearchTripsRequest())->setParent($parent); + try { + $gapicClient->searchTrips($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTripTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $vehicleId = 'vehicleId-1378647282'; + $intermediateDestinationIndex = 144716901; + $currentRouteSegment = 'currentRouteSegment-289364233'; + $numberOfPassengers = 674364405; + $lastLocationSnappable = false; + $expectedResponse = new Trip(); + $expectedResponse->setName($name2); + $expectedResponse->setVehicleId($vehicleId); + $expectedResponse->setIntermediateDestinationIndex($intermediateDestinationIndex); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $expectedResponse->setNumberOfPassengers($numberOfPassengers); + $expectedResponse->setLastLocationSnappable($lastLocationSnappable); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $trip = new Trip(); + $updateMask = new FieldMask(); + $request = (new UpdateTripRequest()) + ->setName($name) + ->setTrip($trip) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateTrip($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.TripService/UpdateTrip', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getTrip(); + $this->assertProtobufEquals($trip, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTripExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $trip = new Trip(); + $updateMask = new FieldMask(); + $request = (new UpdateTripRequest()) + ->setName($name) + ->setTrip($trip) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateTrip($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTripAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $vehicleId = 'vehicleId-1378647282'; + $intermediateDestinationIndex = 144716901; + $currentRouteSegment = 'currentRouteSegment-289364233'; + $numberOfPassengers = 674364405; + $lastLocationSnappable = false; + $expectedResponse = new Trip(); + $expectedResponse->setName($name); + $expectedResponse->setVehicleId($vehicleId); + $expectedResponse->setIntermediateDestinationIndex($intermediateDestinationIndex); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $expectedResponse->setNumberOfPassengers($numberOfPassengers); + $expectedResponse->setLastLocationSnappable($lastLocationSnappable); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->tripName('[PROVIDER]', '[TRIP]'); + $tripId = 'tripId-1059631243'; + $trip = new Trip(); + $request = (new CreateTripRequest()) + ->setParent($formattedParent) + ->setTripId($tripId) + ->setTrip($trip); + $response = $gapicClient->createTripAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.TripService/CreateTrip', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTripId(); + $this->assertProtobufEquals($tripId, $actualValue); + $actualValue = $actualRequestObject->getTrip(); + $this->assertProtobufEquals($trip, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/MapsFleetEngine/tests/Unit/V1/Client/VehicleServiceClientTest.php b/MapsFleetEngine/tests/Unit/V1/Client/VehicleServiceClientTest.php new file mode 100644 index 000000000000..397ede0818b8 --- /dev/null +++ b/MapsFleetEngine/tests/Unit/V1/Client/VehicleServiceClientTest.php @@ -0,0 +1,626 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return VehicleServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new VehicleServiceClient($options); + } + + /** @test */ + public function createVehicleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $maximumCapacity = 582710265; + $currentRouteSegment = 'currentRouteSegment-289364233'; + $backToBackEnabled = false; + $expectedResponse = new Vehicle(); + $expectedResponse->setName($name); + $expectedResponse->setMaximumCapacity($maximumCapacity); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $expectedResponse->setBackToBackEnabled($backToBackEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $vehicleId = 'vehicleId-1378647282'; + $vehicle = new Vehicle(); + $vehicleVehicleType = new VehicleType(); + $vehicle->setVehicleType($vehicleVehicleType); + $request = (new CreateVehicleRequest()) + ->setParent($parent) + ->setVehicleId($vehicleId) + ->setVehicle($vehicle); + $response = $gapicClient->createVehicle($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.VehicleService/CreateVehicle', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getVehicleId(); + $this->assertProtobufEquals($vehicleId, $actualValue); + $actualValue = $actualRequestObject->getVehicle(); + $this->assertProtobufEquals($vehicle, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createVehicleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $vehicleId = 'vehicleId-1378647282'; + $vehicle = new Vehicle(); + $vehicleVehicleType = new VehicleType(); + $vehicle->setVehicleType($vehicleVehicleType); + $request = (new CreateVehicleRequest()) + ->setParent($parent) + ->setVehicleId($vehicleId) + ->setVehicle($vehicle); + try { + $gapicClient->createVehicle($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVehicleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $maximumCapacity = 582710265; + $currentRouteSegment = 'currentRouteSegment-289364233'; + $backToBackEnabled = false; + $expectedResponse = new Vehicle(); + $expectedResponse->setName($name2); + $expectedResponse->setMaximumCapacity($maximumCapacity); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $expectedResponse->setBackToBackEnabled($backToBackEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->vehicleName('[PROVIDER]', '[VEHICLE]'); + $request = (new GetVehicleRequest())->setName($formattedName); + $response = $gapicClient->getVehicle($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.VehicleService/GetVehicle', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVehicleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->vehicleName('[PROVIDER]', '[VEHICLE]'); + $request = (new GetVehicleRequest())->setName($formattedName); + try { + $gapicClient->getVehicle($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVehiclesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $vehiclesElement = new Vehicle(); + $vehicles = [$vehiclesElement]; + $expectedResponse = new ListVehiclesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setVehicles($vehicles); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $vehicleTypeCategories = []; + $request = (new ListVehiclesRequest())->setParent($parent)->setVehicleTypeCategories($vehicleTypeCategories); + $response = $gapicClient->listVehicles($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVehicles()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.VehicleService/ListVehicles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getVehicleTypeCategories(); + $this->assertProtobufEquals($vehicleTypeCategories, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVehiclesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $vehicleTypeCategories = []; + $request = (new ListVehiclesRequest())->setParent($parent)->setVehicleTypeCategories($vehicleTypeCategories); + try { + $gapicClient->listVehicles($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchVehiclesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SearchVehiclesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $pickupPoint = new TerminalLocation(); + $pickupPointPoint = new LatLng(); + $pickupPoint->setPoint($pickupPointPoint); + $pickupRadiusMeters = 254656044; + $count = 94851343; + $minimumCapacity = 518841803; + $tripTypes = []; + $vehicleTypes = []; + $orderBy = VehicleMatchOrder::UNKNOWN_VEHICLE_MATCH_ORDER; + $request = (new SearchVehiclesRequest()) + ->setParent($parent) + ->setPickupPoint($pickupPoint) + ->setPickupRadiusMeters($pickupRadiusMeters) + ->setCount($count) + ->setMinimumCapacity($minimumCapacity) + ->setTripTypes($tripTypes) + ->setVehicleTypes($vehicleTypes) + ->setOrderBy($orderBy); + $response = $gapicClient->searchVehicles($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.VehicleService/SearchVehicles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getPickupPoint(); + $this->assertProtobufEquals($pickupPoint, $actualValue); + $actualValue = $actualRequestObject->getPickupRadiusMeters(); + $this->assertProtobufEquals($pickupRadiusMeters, $actualValue); + $actualValue = $actualRequestObject->getCount(); + $this->assertProtobufEquals($count, $actualValue); + $actualValue = $actualRequestObject->getMinimumCapacity(); + $this->assertProtobufEquals($minimumCapacity, $actualValue); + $actualValue = $actualRequestObject->getTripTypes(); + $this->assertProtobufEquals($tripTypes, $actualValue); + $actualValue = $actualRequestObject->getVehicleTypes(); + $this->assertProtobufEquals($vehicleTypes, $actualValue); + $actualValue = $actualRequestObject->getOrderBy(); + $this->assertProtobufEquals($orderBy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchVehiclesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $pickupPoint = new TerminalLocation(); + $pickupPointPoint = new LatLng(); + $pickupPoint->setPoint($pickupPointPoint); + $pickupRadiusMeters = 254656044; + $count = 94851343; + $minimumCapacity = 518841803; + $tripTypes = []; + $vehicleTypes = []; + $orderBy = VehicleMatchOrder::UNKNOWN_VEHICLE_MATCH_ORDER; + $request = (new SearchVehiclesRequest()) + ->setParent($parent) + ->setPickupPoint($pickupPoint) + ->setPickupRadiusMeters($pickupRadiusMeters) + ->setCount($count) + ->setMinimumCapacity($minimumCapacity) + ->setTripTypes($tripTypes) + ->setVehicleTypes($vehicleTypes) + ->setOrderBy($orderBy); + try { + $gapicClient->searchVehicles($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateVehicleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $maximumCapacity = 582710265; + $currentRouteSegment = 'currentRouteSegment-289364233'; + $backToBackEnabled = false; + $expectedResponse = new Vehicle(); + $expectedResponse->setName($name2); + $expectedResponse->setMaximumCapacity($maximumCapacity); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $expectedResponse->setBackToBackEnabled($backToBackEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $vehicle = new Vehicle(); + $vehicleVehicleType = new VehicleType(); + $vehicle->setVehicleType($vehicleVehicleType); + $updateMask = new FieldMask(); + $request = (new UpdateVehicleRequest()) + ->setName($name) + ->setVehicle($vehicle) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateVehicle($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.VehicleService/UpdateVehicle', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getVehicle(); + $this->assertProtobufEquals($vehicle, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateVehicleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $vehicle = new Vehicle(); + $vehicleVehicleType = new VehicleType(); + $vehicle->setVehicleType($vehicleVehicleType); + $updateMask = new FieldMask(); + $request = (new UpdateVehicleRequest()) + ->setName($name) + ->setVehicle($vehicle) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateVehicle($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateVehicleAttributesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new UpdateVehicleAttributesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $attributes = []; + $request = (new UpdateVehicleAttributesRequest())->setName($name)->setAttributes($attributes); + $response = $gapicClient->updateVehicleAttributes($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.VehicleService/UpdateVehicleAttributes', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getAttributes(); + $this->assertProtobufEquals($attributes, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateVehicleAttributesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $attributes = []; + $request = (new UpdateVehicleAttributesRequest())->setName($name)->setAttributes($attributes); + try { + $gapicClient->updateVehicleAttributes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createVehicleAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $maximumCapacity = 582710265; + $currentRouteSegment = 'currentRouteSegment-289364233'; + $backToBackEnabled = false; + $expectedResponse = new Vehicle(); + $expectedResponse->setName($name); + $expectedResponse->setMaximumCapacity($maximumCapacity); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $expectedResponse->setBackToBackEnabled($backToBackEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $vehicleId = 'vehicleId-1378647282'; + $vehicle = new Vehicle(); + $vehicleVehicleType = new VehicleType(); + $vehicle->setVehicleType($vehicleVehicleType); + $request = (new CreateVehicleRequest()) + ->setParent($parent) + ->setVehicleId($vehicleId) + ->setVehicle($vehicle); + $response = $gapicClient->createVehicleAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.v1.VehicleService/CreateVehicle', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getVehicleId(); + $this->assertProtobufEquals($vehicleId, $actualValue); + $actualValue = $actualRequestObject->getVehicle(); + $this->assertProtobufEquals($vehicle, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/MapsFleetEngineDelivery/.OwlBot.yaml b/MapsFleetEngineDelivery/.OwlBot.yaml new file mode 100644 index 000000000000..ff78f04eb87a --- /dev/null +++ b/MapsFleetEngineDelivery/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/maps/fleetengine/delivery/(v1)/.*-php/(.*) + dest: /owl-bot-staging/MapsFleetEngineDelivery/$1/$2 +api-name: MapsFleetEngineDelivery diff --git a/MapsFleetEngineDelivery/.gitattributes b/MapsFleetEngineDelivery/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/MapsFleetEngineDelivery/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/MapsFleetEngineDelivery/.github/pull_request_template.md b/MapsFleetEngineDelivery/.github/pull_request_template.md new file mode 100644 index 000000000000..852c42303739 --- /dev/null +++ b/MapsFleetEngineDelivery/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `MapsFleetEngineDelivery/src`, and tests in `MapsFleetEngineDelivery/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/MapsFleetEngineDelivery/CONTRIBUTING.md b/MapsFleetEngineDelivery/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/MapsFleetEngineDelivery/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/MapsFleetEngineDelivery/LICENSE b/MapsFleetEngineDelivery/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/MapsFleetEngineDelivery/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/MapsFleetEngineDelivery/README.md b/MapsFleetEngineDelivery/README.md new file mode 100644 index 000000000000..e588ebf83fdd --- /dev/null +++ b/MapsFleetEngineDelivery/README.md @@ -0,0 +1,45 @@ +# Google Maps FleetEngine Delivery for PHP + +> Idiomatic PHP client for [Google Maps FleetEngine Delivery](https://developers.google.com/maps/documentation/transportation-logistics/mobility). + +[![Latest Stable Version](https://poser.pugx.org/google/maps-fleetengine-delivery/v/stable)](https://packagist.org/packages/google/maps-fleetengine-delivery) [![Packagist](https://img.shields.io/packagist/dm/google/maps-fleetengine-delivery.svg)](https://packagist.org/packages/google/maps-fleetengine-delivery) + +* [API documentation](https://cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/maps-fleetengine-delivery +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-maps-fleetengine-delivery/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/maps/documentation/transportation-logistics/mobility). diff --git a/MapsFleetEngineDelivery/VERSION b/MapsFleetEngineDelivery/VERSION new file mode 100644 index 000000000000..17e51c385ea3 --- /dev/null +++ b/MapsFleetEngineDelivery/VERSION @@ -0,0 +1 @@ +0.1.1 diff --git a/MapsFleetEngineDelivery/composer.json b/MapsFleetEngineDelivery/composer.json new file mode 100644 index 000000000000..970022278269 --- /dev/null +++ b/MapsFleetEngineDelivery/composer.json @@ -0,0 +1,31 @@ +{ + "name": "google/maps-fleetengine-delivery", + "description": "Google Maps FleetEngine Delivery Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Maps\\FleetEngine\\Delivery\\": "src", + "GPBMetadata\\Google\\Maps\\Fleetengine\\Delivery\\": "metadata" + } + }, + "extra": { + "component": { + "id": "maps-fleetengine-delivery", + "path": "MapsFleetEngineDelivery", + "target": "googleapis/php-maps-fleetengine-delivery" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0", + "google/geo-common-protos": "^0.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/MapsFleetEngineDelivery/metadata/V1/Common.php b/MapsFleetEngineDelivery/metadata/V1/Common.php new file mode 100644 index 0000000000000000000000000000000000000000..7ee87d6950d535c8ad9c8d1cf3199e9f8e25103d GIT binary patch literal 3677 zcmbtXOK;mo5RUxL$Pby09ma7T)=3d3O{v;RT7a%oNEW3CaY#X;<)RQktjM)Ygdzz( z95_Y(M~_91{SUnt{S`g+&~t%aySpSM#g-+v@x|0~zIl8zJHz?rTkq6^`$7df*he8Y zh4#4+o?^lC-Ox2$TWCioC)gJZx9eFp_C-M`se+ow8S zD);rYN{OCUb7v30uu%{Q2TULQ00Q~*qPA@rLJ*>m{Ci*py5(4*g>35`iECdtL3V%% z^s?+p|YiEDx3TVCk;H6kiW z9US%ur6=2u60=mDbs}uXK1$LhC-;TWkMN*%LGW=H`OY5mn<{wUduk2gt>9U$vW0E4 zh)>a(<@%D;kE*X^7_=9dW|72%sO$X??6HqL5BtIOq1w5JTZbsLoz8F&OTZT|tc31@ zY4+GHlbYP_@j=;n2*0kum;bdGxeZ#k;y~SsY2AuvJL~rneXMXv>hodBP+ZIFn->M% zCNw1P`Q&{_V$Itu*7(iVPZ{9T(r)5Y%dl}F41KE|g_z62XN1i5O>P0E&yXEq zeuDj6gZY5SIUPMdousEPZ*aE&+N9=^(wdFJJf;uZ*Lp!!*C zUPr0@Sa$30dANPS#Y5L1x6F08&tT3@o|&83-4!v8Riv?sB(H}~huephQ`fiNxlV{| z9T`UCBjcQ(BVJ^8H&R4OuUK-)UB*osZE=FnaL-{WCan)$8xQ54!0ahTCgF&2mfgL3 z$r8E4Pj{IiPJ&z;BgSaYK^Sj^IrtUi5=(s#Z;!`vBFrH>w8F^5JWa_MGPpfhCcTvO zw?P(fjt4R)zlP=1Sl>&2JeYe55O^4y`kStI%F{v{O(nDTIZQJUKXVNW&tNgO&|`k~ z8mK&EBaaLXtke6*(^}8&u3yS=ubpwvARAzxFcMjX1L8^~4& zKvR2cIi~xT^`H>>VN3v>h$F8$t=I`}2j;M2#t=F+$3wQ>!GeZ@H&@Kyi$j-<;!8u9 zcF18vmo_Lmbl2ckNNijjw2%MHz$c@d1_z5r$}2@ZR`iCfG}LC-M-3A75@Z!suN+lN1?4~{ z(XYdrtkl&bP1ZG4FUbw9sxS;8V*zfe<+9G+5;}-zpvd(<-DR}I^Z%yjCI6(`?uN321}v&bf7CfkhH-s?a9JTY}pmP@}(+^?`DNTf@U z$d(|PEmOUbA~tt^Po-M%t`sjzv0SUaEs=HUuZh;fSfM0QjgmB=Qj*d{NK$jBJ;T1i bo<8h-Q$L9}l7R*0%H@Sg#w*5qcn|O|iT#{% literal 0 HcmV?d00001 diff --git a/MapsFleetEngineDelivery/metadata/V1/DeliveryApi.php b/MapsFleetEngineDelivery/metadata/V1/DeliveryApi.php new file mode 100644 index 000000000000..087818359815 --- /dev/null +++ b/MapsFleetEngineDelivery/metadata/V1/DeliveryApi.php @@ -0,0 +1,123 @@ +internalAddGeneratedFile( + ' +Ö, +6google/maps/fleetengine/delivery/v1/delivery_api.protomaps.fleetengine.delivery.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/api/routing.protogoogle/geo/type/viewport.proto;google/maps/fleetengine/delivery/v1/delivery_vehicles.proto0google/maps/fleetengine/delivery/v1/header.proto1tudQ21+5wrkQ(%;)j1w!VJ8tZ89EUPuge~qx%XV%hhGOr0o*3L)T5!r zsY80lgdb57gg*Ce-zB|KzfVJA`@?{_G*k(xHOXGHL-bm`a|@x7KMHNCk%8|ITv{Gl zK~(O$lyd3~m`BSFb=jDP$K~<*YeFMODttcYtS~p>a7eMeY81-CclZaa!|J`Ac$vnoH<+7jfvYVuD zxe-N@SNHZup3Rx>5dmm=HeI_*VotI5PT-?Bn3G-w01#hz$NrEH(lSBxh`gKIbV68F1o%t!`Vo{$~SP;!-5}3DpNRY z6cw|`c)7CqR*ZWSmVHU0d;r(&Q5aH>o1s7A)Qsq0h`)+CWWT69gpcOFHmT>BfsaK~ zT$UHRrp98aLM#>Qt>F!nM{pygLkm6X4NQk&+}MB2A@{64 z699|zko8cosCYpVeX*EmCbQKPt~4PhBr5{m>T;#}RxGpiBD`MWaBb!=v8;Ryw`zK$ z-qqXB%&z{pzTMEx&a;+o9_;P6^zHgiU9T11QO-lIdeCVWmXs@y?;JMG!^gVb(A$NK zl82S8`t~yf7P87^fR(Iamqh z7wO~4m?s{GF64a542m-Rt{G36|pm6o$)J<`rP+pC!0HKZRdHF5-S5-I}l5 zT`YS-v5x?y3hz208_%og*y4*SdMo>9HLH9Dg$YGk)WXd9%Ik|dMt%ahz~V>fIZ?aw zt}OSJe$PUFI_NqS0@w09>YO&DShjnMZ$7QKpw8g^m$?=F7-2&bF;o`gr-D#B2$Pw6 z1k0j@(WHZw&rTtl7QOk)5}coqU4a!5kI9^*^FDw}av^Q@N#}i&v~^Ip72ACE0EpO57A=iD1EQpJm~1Ly{hdt z8njl(ZvC8r+et%R^ugFF%-AYwEqz1E<^>kA)|20`M;cVG6PU literal 0 HcmV?d00001 diff --git a/MapsFleetEngineDelivery/metadata/V1/Header.php b/MapsFleetEngineDelivery/metadata/V1/Header.php new file mode 100644 index 0000000000000000000000000000000000000000..b3e165a74fe77697e6a50e06ed8f78a080aad53d GIT binary patch literal 1530 zcmbVM&2HO95UwQ0QpRqoFb={3Ic)3zR)B$uS43PQ ziFhbNH}uIgnaz+BH(W%_N3IcK3`l=4CLO~ZKa!zwm~a<$G7rPKkM#wO;`+=-6d24| zfOQXjwnTnaUpDHONIi*>fdd3|fpJ7#Bo|hzhk|-kQ2Qdov3nB7?rw2xV})Z+8fO5m zPve-p&hX$TAo7cnsn1*z3o7LAF^e4*Fu|zLew1~clNt46l%XH{&XT|tEDT5*FbG_% zJs~+}>iakfWgpJTnwgchMz+N^1A#oCzN8kroJAt!mUPwiIf_j~Q%mj1Ds2kKW~7#L z)b)=@o)f_n+|5o1N0IR0EaRO5TyIYHC;HZmnB8UQdo8@AOBQln-&VB+$%=aRimgg$ zdftX{SI)V%$&qF}g`dmt{J#!Zd6@2kwzCV`dKa{1 zgLy*d=(wSWYJn7Lw-pr*IL_sma$_+ywn~3Ai^@GXh`slY+_G3+tEJ3c0SM!bZ7;JO z!J&ss=AyHZxW0NTv-Y5phKs8R)qQEX^WsdqiMsYl+Sb}5y!L=WJL zfG+=bQOPd)P>FmhW+7jww=)JW{|^Ieg`vng7c@v_)Rn7)T!k#lmvEN`9uJx4(1x(3$o$+#?YL|b5Xei@J(~l9JPn0HLjM9+fdoCQ{l+^t~u@whP{8_9YDF+H--b# zkZ@%vnS+tUl85g*t!k7)ExfTit#ZCdu~m3yx_+2=+A2z_SbZMepi#0fQl{2x z8col($6tzj?QX~TwRn;%l$I)#mMK&xQ@YJsXp_e8YcD$&vRuh>KYJ@>Qp^4<+NU|7 suBV8)z5}W2>s8bBNn^U73FlX*o5%Symx~>B`B!DhJoEQ|4c7o40MN7FivR!s literal 0 HcmV?d00001 diff --git a/MapsFleetEngineDelivery/metadata/V1/TaskTrackingInfo.php b/MapsFleetEngineDelivery/metadata/V1/TaskTrackingInfo.php new file mode 100644 index 000000000000..d6497b5b6af4 --- /dev/null +++ b/MapsFleetEngineDelivery/metadata/V1/TaskTrackingInfo.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' +´ +h*orlXKD{!tPa6MJIEl-4sE*}irz$dX37 zcA7F-^i|qjU!d>Mz66V|cz~{Z?v-RaKRBinZ!F8_eCPk~*>iW_g?q{tv599g(p2h) z3fm`&>p9G6IF?fHwpzqf8cxTh7V%U?$rY8IVnxw&`N~~n^_{NQAez#4oVG<$9n^8MYs!1%`Bi>=Ex0+(6|JGLpHh^t*i0_&WqHL8iF9|c7CNpbW0;cv7VQQNL zm|8A`sa03k0UDO+`$~nw!8=g!<96#7Z74o78GhZTzCmrusAPP(KnXB8?S0olFKj50VkPbvbV@C6Gve8%g_`*dkGjn9N=T|{ZNmEQ zLa`isdk3j(k`uSQerhTWZ&#j z$J4ZdRRfTZvF?&EnqzZ~ic>A?bUKbbz6vA3q6DatecG^yKR#?fWVtTpI7a$^uvRE0 zD>FOp*}Ni4zW$DeIgxHQ`zf%AWs~d&jfZdrewQKjiS;7g=9Q%mRhAl6mfBlgTnOPz zm!`Zhib0_*elw0FtZxie$gw^SMre|tY3}Rq7YK&?Up0e;r5wOMo{?j6=B!2(TLn6;o;D(NJ3eR z0!fBB=9!JR)NUKJDNiBfEcaquQsBnPwBZ!-h++~=O}Lh6+oWmqt(^W;D+6KQ!n`mw z%0KzCz*#uu=%_99QzZuyGd=9%B0$CgwVTd?d{wZYmp2&ESAt&p0dBrQhuGxM@b^tm zcmqQq&j_5SW4QSHfV~`W^Z0SgCZ$)fAS~;9xkt%?(Qxb*ZOiil{>l09l`uwCWX=j+ z={bPOm`CefMtu32GKq=#@O-3n#IyL%1W2c~mJC?-NXNucgeejB3#0EG((VwO`B>*% z-s92o!uB5t33#Of%;QGD206pK#N66BPChYGqBNG4;PYc>hHsm$Yu2rxdCV;TgdGZd zi*yqbmDeTR*xM$$yx zo-@joVkt2xU4yy3opd#wFQhXCJu$WX1mdFcNVnj6xstA&gr9+_VoBdYa1@j+6w4?y zw!8^*yey+ma~tGJy8OZ@?p3nImnR|SVYa-N&FXp%c?HfU$`?2uEDYg9E(t695hRbH z7K+()C12bz%Ei6i>`5tTdug{=&FA!8w0!|?71HI3QPsEe*@A9FyopI|>q9yROT(ir z=!H1Ud==Ymifbg@#fj3RP2%~fchTcfuu`Vp@p?E~{`)d~#%a$;Z3h$&n>R6B$2zod zF~tWQ*S^uCKCM%WvO_Uw=GOGl33xWXTJ6IWUA|*TF5Jb9fp+*-ZJ3@%d!`lilOc&g znqH8^pW(qkB6kS3gpO+wuFfgRd<>Id~NSsQkB-}aEV78Ad-@aotMFz*W zFG&^XuU!VZgj&WRGmhorfHg?Pk55NLeF_f;@=t}igD0Qo8v{h1VqBR7OqWI-DWi3dE;n1 zBMwq*FL;wi3yE7_A3XjRo62tLxj$m}w!}TE^3y~W_oyz;S~Z#-YIXImh^iKxt-;+I z(A5TqD_*W2Vzre3P}4Y~rVT-AT7;=-)z$j6SfC%T^iPLJ!F4!vO!9q}HqJOC1!ZvV I9l;U6fB#onR{#J2 literal 0 HcmV?d00001 diff --git a/MapsFleetEngineDelivery/owlbot.py b/MapsFleetEngineDelivery/owlbot.py new file mode 100644 index 000000000000..edc5e1e1407d --- /dev/null +++ b/MapsFleetEngineDelivery/owlbot.py @@ -0,0 +1,62 @@ +# Copyright 2023 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/MapsFleetEngineDelivery").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main( + src=src, + dest=dest, + copy_excludes=[ + src / "**/[A-Z]*_*.php", + ] +) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/MapsFleetEngineDelivery/phpunit.xml.dist b/MapsFleetEngineDelivery/phpunit.xml.dist new file mode 100644 index 000000000000..7aedcae3319c --- /dev/null +++ b/MapsFleetEngineDelivery/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/batch_create_tasks.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/batch_create_tasks.php new file mode 100644 index 000000000000..1c816c55c451 --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/batch_create_tasks.php @@ -0,0 +1,122 @@ +setType($requestsTaskType) + ->setState($requestsTaskState) + ->setTaskDuration($requestsTaskTaskDuration); + $createTaskRequest = (new CreateTaskRequest()) + ->setParent($requestsParent) + ->setTaskId($requestsTaskId) + ->setTask($requestsTask); + $requests = [$createTaskRequest,]; + $request = (new BatchCreateTasksRequest()) + ->setParent($formattedParent) + ->setRequests($requests); + + // Call the API and handle any network failures. + try { + /** @var BatchCreateTasksResponse $response */ + $response = $deliveryServiceClient->batchCreateTasks($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 +{ + $formattedParent = DeliveryServiceClient::providerName('[PROVIDER]'); + $requestsParent = '[PARENT]'; + $requestsTaskId = '[TASK_ID]'; + $requestsTaskType = Type::TYPE_UNSPECIFIED; + $requestsTaskState = State::STATE_UNSPECIFIED; + + batch_create_tasks_sample( + $formattedParent, + $requestsParent, + $requestsTaskId, + $requestsTaskType, + $requestsTaskState + ); +} +// [END fleetengine_v1_generated_DeliveryService_BatchCreateTasks_sync] diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/create_delivery_vehicle.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/create_delivery_vehicle.php new file mode 100644 index 000000000000..073a24cbc694 --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/create_delivery_vehicle.php @@ -0,0 +1,84 @@ +setParent($parent) + ->setDeliveryVehicleId($deliveryVehicleId) + ->setDeliveryVehicle($deliveryVehicle); + + // Call the API and handle any network failures. + try { + /** @var DeliveryVehicle $response */ + $response = $deliveryServiceClient->createDeliveryVehicle($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 +{ + $parent = '[PARENT]'; + $deliveryVehicleId = '[DELIVERY_VEHICLE_ID]'; + + create_delivery_vehicle_sample($parent, $deliveryVehicleId); +} +// [END fleetengine_v1_generated_DeliveryService_CreateDeliveryVehicle_sync] diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/create_task.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/create_task.php new file mode 100644 index 000000000000..1a5973aa56dd --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/create_task.php @@ -0,0 +1,98 @@ +setType($taskType) + ->setState($taskState) + ->setTaskDuration($taskTaskDuration); + $request = (new CreateTaskRequest()) + ->setParent($parent) + ->setTaskId($taskId) + ->setTask($task); + + // Call the API and handle any network failures. + try { + /** @var Task $response */ + $response = $deliveryServiceClient->createTask($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 +{ + $parent = '[PARENT]'; + $taskId = '[TASK_ID]'; + $taskType = Type::TYPE_UNSPECIFIED; + $taskState = State::STATE_UNSPECIFIED; + + create_task_sample($parent, $taskId, $taskType, $taskState); +} +// [END fleetengine_v1_generated_DeliveryService_CreateTask_sync] diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_delivery_vehicle.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_delivery_vehicle.php new file mode 100644 index 000000000000..50f56f19dccc --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_delivery_vehicle.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DeliveryVehicle $response */ + $response = $deliveryServiceClient->getDeliveryVehicle($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 = DeliveryServiceClient::deliveryVehicleName('[PROVIDER]', '[VEHICLE]'); + + get_delivery_vehicle_sample($formattedName); +} +// [END fleetengine_v1_generated_DeliveryService_GetDeliveryVehicle_sync] diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_task.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_task.php new file mode 100644 index 000000000000..c2813462b02b --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_task.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Task $response */ + $response = $deliveryServiceClient->getTask($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 = DeliveryServiceClient::taskName('[PROVIDER]', '[TASK]'); + + get_task_sample($formattedName); +} +// [END fleetengine_v1_generated_DeliveryService_GetTask_sync] diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_task_tracking_info.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_task_tracking_info.php new file mode 100644 index 000000000000..8535af281902 --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/get_task_tracking_info.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TaskTrackingInfo $response */ + $response = $deliveryServiceClient->getTaskTrackingInfo($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 = DeliveryServiceClient::taskTrackingInfoName('[PROVIDER]', '[TRACKING]'); + + get_task_tracking_info_sample($formattedName); +} +// [END fleetengine_v1_generated_DeliveryService_GetTaskTrackingInfo_sync] diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/list_delivery_vehicles.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/list_delivery_vehicles.php new file mode 100644 index 000000000000..957671072030 --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/list_delivery_vehicles.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $deliveryServiceClient->listDeliveryVehicles($request); + + /** @var DeliveryVehicle $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = DeliveryServiceClient::providerName('[PROVIDER]'); + + list_delivery_vehicles_sample($formattedParent); +} +// [END fleetengine_v1_generated_DeliveryService_ListDeliveryVehicles_sync] diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/list_tasks.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/list_tasks.php new file mode 100644 index 000000000000..cbdf67b339bf --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/list_tasks.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $deliveryServiceClient->listTasks($request); + + /** @var Task $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = DeliveryServiceClient::providerName('[PROVIDER]'); + + list_tasks_sample($formattedParent); +} +// [END fleetengine_v1_generated_DeliveryService_ListTasks_sync] diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/update_delivery_vehicle.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/update_delivery_vehicle.php new file mode 100644 index 000000000000..9a7f8b1f43a9 --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/update_delivery_vehicle.php @@ -0,0 +1,68 @@ +setDeliveryVehicle($deliveryVehicle) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var DeliveryVehicle $response */ + $response = $deliveryServiceClient->updateDeliveryVehicle($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END fleetengine_v1_generated_DeliveryService_UpdateDeliveryVehicle_sync] diff --git a/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/update_task.php b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/update_task.php new file mode 100644 index 000000000000..ba858db67368 --- /dev/null +++ b/MapsFleetEngineDelivery/samples/V1/DeliveryServiceClient/update_task.php @@ -0,0 +1,84 @@ +setType($taskType) + ->setState($taskState) + ->setTaskDuration($taskTaskDuration); + $updateMask = new FieldMask(); + $request = (new UpdateTaskRequest()) + ->setTask($task) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Task $response */ + $response = $deliveryServiceClient->updateTask($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 +{ + $taskType = Type::TYPE_UNSPECIFIED; + $taskState = State::STATE_UNSPECIFIED; + + update_task_sample($taskType, $taskState); +} +// [END fleetengine_v1_generated_DeliveryService_UpdateTask_sync] diff --git a/MapsFleetEngineDelivery/src/V1/BatchCreateTasksRequest.php b/MapsFleetEngineDelivery/src/V1/BatchCreateTasksRequest.php new file mode 100644 index 000000000000..591f65729838 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/BatchCreateTasksRequest.php @@ -0,0 +1,177 @@ +maps.fleetengine.delivery.v1.BatchCreateTasksRequest + */ +class BatchCreateTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * Note: If you set this field, then the header field in the + * `CreateTaskRequest` messages must either be empty, or it must match this + * field. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. The parent resource shared by all tasks. This value must be in + * the format `providers/{provider}`. The `provider` must be the Google Cloud + * Project ID. For example, `sample-cloud-project`. The parent field in the + * `CreateTaskRequest` messages must either be empty, or it must match this + * field. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The request message that specifies the resources to create. + * Note: You can create a maximum of 500 tasks in a batch. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.CreateTaskRequest requests = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $requests; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * Note: If you set this field, then the header field in the + * `CreateTaskRequest` messages must either be empty, or it must match this + * field. + * @type string $parent + * Required. The parent resource shared by all tasks. This value must be in + * the format `providers/{provider}`. The `provider` must be the Google Cloud + * Project ID. For example, `sample-cloud-project`. The parent field in the + * `CreateTaskRequest` messages must either be empty, or it must match this + * field. + * @type array<\Google\Maps\FleetEngine\Delivery\V1\CreateTaskRequest>|\Google\Protobuf\Internal\RepeatedField $requests + * Required. The request message that specifies the resources to create. + * Note: You can create a maximum of 500 tasks in a batch. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * Note: If you set this field, then the header field in the + * `CreateTaskRequest` messages must either be empty, or it must match this + * field. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * Note: If you set this field, then the header field in the + * `CreateTaskRequest` messages must either be empty, or it must match this + * field. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. The parent resource shared by all tasks. This value must be in + * the format `providers/{provider}`. The `provider` must be the Google Cloud + * Project ID. For example, `sample-cloud-project`. The parent field in the + * `CreateTaskRequest` messages must either be empty, or it must match this + * field. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource shared by all tasks. This value must be in + * the format `providers/{provider}`. The `provider` must be the Google Cloud + * Project ID. For example, `sample-cloud-project`. The parent field in the + * `CreateTaskRequest` messages must either be empty, or it must match this + * field. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The request message that specifies the resources to create. + * Note: You can create a maximum of 500 tasks in a batch. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.CreateTaskRequest requests = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequests() + { + return $this->requests; + } + + /** + * Required. The request message that specifies the resources to create. + * Note: You can create a maximum of 500 tasks in a batch. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.CreateTaskRequest requests = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\CreateTaskRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\CreateTaskRequest::class); + $this->requests = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/BatchCreateTasksResponse.php b/MapsFleetEngineDelivery/src/V1/BatchCreateTasksResponse.php new file mode 100644 index 000000000000..2f87fdd9b497 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/BatchCreateTasksResponse.php @@ -0,0 +1,67 @@ +maps.fleetengine.delivery.v1.BatchCreateTasksResponse + */ +class BatchCreateTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The created Tasks. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.Task tasks = 1; + */ + private $tasks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\Delivery\V1\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * The created Tasks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * The created Tasks. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The created Tasks. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.Task tasks = 1; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\Task::class); + $this->tasks = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/Client/DeliveryServiceClient.php b/MapsFleetEngineDelivery/src/V1/Client/DeliveryServiceClient.php new file mode 100644 index 000000000000..891beb0ddc83 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/Client/DeliveryServiceClient.php @@ -0,0 +1,559 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/delivery_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/delivery_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/delivery_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/delivery_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * delivery_vehicle resource. + * + * @param string $provider + * @param string $vehicle + * + * @return string The formatted delivery_vehicle resource. + */ + public static function deliveryVehicleName(string $provider, string $vehicle): string + { + return self::getPathTemplate('deliveryVehicle')->render([ + 'provider' => $provider, + 'vehicle' => $vehicle, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a provider + * resource. + * + * @param string $provider + * + * @return string The formatted provider resource. + */ + public static function providerName(string $provider): string + { + return self::getPathTemplate('provider')->render([ + 'provider' => $provider, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task + * resource. + * + * @param string $provider + * @param string $task + * + * @return string The formatted task resource. + */ + public static function taskName(string $provider, string $task): string + { + return self::getPathTemplate('task')->render([ + 'provider' => $provider, + 'task' => $task, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * task_tracking_info resource. + * + * @param string $provider + * @param string $tracking + * + * @return string The formatted task_tracking_info resource. + */ + public static function taskTrackingInfoName(string $provider, string $tracking): string + { + return self::getPathTemplate('taskTrackingInfo')->render([ + 'provider' => $provider, + 'tracking' => $tracking, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - deliveryVehicle: providers/{provider}/deliveryVehicles/{vehicle} + * - provider: providers/{provider} + * - task: providers/{provider}/tasks/{task} + * - taskTrackingInfo: providers/{provider}/taskTrackingInfo/{tracking} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'fleetengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates and returns a batch of new `Task` objects. + * + * The async variant is {@see DeliveryServiceClient::batchCreateTasksAsync()} . + * + * @example samples/V1/DeliveryServiceClient/batch_create_tasks.php + * + * @param BatchCreateTasksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BatchCreateTasksResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchCreateTasks( + BatchCreateTasksRequest $request, + array $callOptions = [] + ): BatchCreateTasksResponse { + return $this->startApiCall('BatchCreateTasks', $request, $callOptions)->wait(); + } + + /** + * Creates and returns a new `DeliveryVehicle`. + * + * The async variant is {@see DeliveryServiceClient::createDeliveryVehicleAsync()} + * . + * + * @example samples/V1/DeliveryServiceClient/create_delivery_vehicle.php + * + * @param CreateDeliveryVehicleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DeliveryVehicle + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDeliveryVehicle( + CreateDeliveryVehicleRequest $request, + array $callOptions = [] + ): DeliveryVehicle { + return $this->startApiCall('CreateDeliveryVehicle', $request, $callOptions)->wait(); + } + + /** + * Creates and returns a new `Task` object. + * + * The async variant is {@see DeliveryServiceClient::createTaskAsync()} . + * + * @example samples/V1/DeliveryServiceClient/create_task.php + * + * @param CreateTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Task + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTask(CreateTaskRequest $request, array $callOptions = []): Task + { + return $this->startApiCall('CreateTask', $request, $callOptions)->wait(); + } + + /** + * Returns the specified `DeliveryVehicle` instance. + * + * The async variant is {@see DeliveryServiceClient::getDeliveryVehicleAsync()} . + * + * @example samples/V1/DeliveryServiceClient/get_delivery_vehicle.php + * + * @param GetDeliveryVehicleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DeliveryVehicle + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDeliveryVehicle(GetDeliveryVehicleRequest $request, array $callOptions = []): DeliveryVehicle + { + return $this->startApiCall('GetDeliveryVehicle', $request, $callOptions)->wait(); + } + + /** + * Gets information about a `Task`. + * + * The async variant is {@see DeliveryServiceClient::getTaskAsync()} . + * + * @example samples/V1/DeliveryServiceClient/get_task.php + * + * @param GetTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Task + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTask(GetTaskRequest $request, array $callOptions = []): Task + { + return $this->startApiCall('GetTask', $request, $callOptions)->wait(); + } + + /** + * Returns the specified `TaskTrackingInfo` instance. + * + * The async variant is {@see DeliveryServiceClient::getTaskTrackingInfoAsync()} . + * + * @example samples/V1/DeliveryServiceClient/get_task_tracking_info.php + * + * @param GetTaskTrackingInfoRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TaskTrackingInfo + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTaskTrackingInfo(GetTaskTrackingInfoRequest $request, array $callOptions = []): TaskTrackingInfo + { + return $this->startApiCall('GetTaskTrackingInfo', $request, $callOptions)->wait(); + } + + /** + * Gets all `DeliveryVehicle`s that meet the specified filtering criteria. + * + * The async variant is {@see DeliveryServiceClient::listDeliveryVehiclesAsync()} . + * + * @example samples/V1/DeliveryServiceClient/list_delivery_vehicles.php + * + * @param ListDeliveryVehiclesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDeliveryVehicles( + ListDeliveryVehiclesRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListDeliveryVehicles', $request, $callOptions); + } + + /** + * Gets all `Task`s that meet the specified filtering criteria. + * + * The async variant is {@see DeliveryServiceClient::listTasksAsync()} . + * + * @example samples/V1/DeliveryServiceClient/list_tasks.php + * + * @param ListTasksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTasks(ListTasksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTasks', $request, $callOptions); + } + + /** + * Writes updated `DeliveryVehicle` data to Fleet Engine, and assigns + * `Tasks` to the `DeliveryVehicle`. You cannot update the name of the + * `DeliveryVehicle`. You *can* update `remaining_vehicle_journey_segments` + * though, but it must contain all of the `VehicleJourneySegment`s currently + * on the `DeliveryVehicle`. The `task_id`s are retrieved from + * `remaining_vehicle_journey_segments`, and their corresponding `Tasks` are + * assigned to the `DeliveryVehicle` if they have not yet been assigned. + * + * The async variant is {@see DeliveryServiceClient::updateDeliveryVehicleAsync()} + * . + * + * @example samples/V1/DeliveryServiceClient/update_delivery_vehicle.php + * + * @param UpdateDeliveryVehicleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DeliveryVehicle + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDeliveryVehicle( + UpdateDeliveryVehicleRequest $request, + array $callOptions = [] + ): DeliveryVehicle { + return $this->startApiCall('UpdateDeliveryVehicle', $request, $callOptions)->wait(); + } + + /** + * Updates `Task` data. + * + * The async variant is {@see DeliveryServiceClient::updateTaskAsync()} . + * + * @example samples/V1/DeliveryServiceClient/update_task.php + * + * @param UpdateTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Task + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateTask(UpdateTaskRequest $request, array $callOptions = []): Task + { + return $this->startApiCall('UpdateTask', $request, $callOptions)->wait(); + } +} diff --git a/MapsFleetEngineDelivery/src/V1/CreateDeliveryVehicleRequest.php b/MapsFleetEngineDelivery/src/V1/CreateDeliveryVehicleRequest.php new file mode 100644 index 000000000000..fbf9a7751d65 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/CreateDeliveryVehicleRequest.php @@ -0,0 +1,274 @@ +maps.fleetengine.delivery.v1.CreateDeliveryVehicleRequest + */ +class CreateDeliveryVehicleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}`. The provider must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The Delivery Vehicle ID must be unique and subject to the + * following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string delivery_vehicle_id = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $delivery_vehicle_id = ''; + /** + * Required. The `DeliveryVehicle` entity to create. When creating a new + * delivery vehicle, you may set the following optional fields: + * * last_location + * * attributes + * Note: The DeliveryVehicle's `name` field is ignored. All other + * DeliveryVehicle fields must not be set; otherwise, an error is returned. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicle delivery_vehicle = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $delivery_vehicle = null; + + /** + * @param string $parent Required. Must be in the format `providers/{provider}`. The provider must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle $deliveryVehicle Required. The `DeliveryVehicle` entity to create. When creating a new + * delivery vehicle, you may set the following optional fields: + * + * * last_location + * * attributes + * + * Note: The DeliveryVehicle's `name` field is ignored. All other + * DeliveryVehicle fields must not be set; otherwise, an error is returned. + * @param string $deliveryVehicleId Required. The Delivery Vehicle ID must be unique and subject to the + * following restrictions: + * + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * @return \Google\Maps\FleetEngine\Delivery\V1\CreateDeliveryVehicleRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle $deliveryVehicle, string $deliveryVehicleId): self + { + return (new self()) + ->setParent($parent) + ->setDeliveryVehicle($deliveryVehicle) + ->setDeliveryVehicleId($deliveryVehicleId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * @type string $parent + * Required. Must be in the format `providers/{provider}`. The provider must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * @type string $delivery_vehicle_id + * Required. The Delivery Vehicle ID must be unique and subject to the + * following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle $delivery_vehicle + * Required. The `DeliveryVehicle` entity to create. When creating a new + * delivery vehicle, you may set the following optional fields: + * * last_location + * * attributes + * Note: The DeliveryVehicle's `name` field is ignored. All other + * DeliveryVehicle fields must not be set; otherwise, an error is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}`. The provider must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Must be in the format `providers/{provider}`. The provider must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Delivery Vehicle ID must be unique and subject to the + * following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string delivery_vehicle_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDeliveryVehicleId() + { + return $this->delivery_vehicle_id; + } + + /** + * Required. The Delivery Vehicle ID must be unique and subject to the + * following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string delivery_vehicle_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDeliveryVehicleId($var) + { + GPBUtil::checkString($var, True); + $this->delivery_vehicle_id = $var; + + return $this; + } + + /** + * Required. The `DeliveryVehicle` entity to create. When creating a new + * delivery vehicle, you may set the following optional fields: + * * last_location + * * attributes + * Note: The DeliveryVehicle's `name` field is ignored. All other + * DeliveryVehicle fields must not be set; otherwise, an error is returned. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicle delivery_vehicle = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle|null + */ + public function getDeliveryVehicle() + { + return $this->delivery_vehicle; + } + + public function hasDeliveryVehicle() + { + return isset($this->delivery_vehicle); + } + + public function clearDeliveryVehicle() + { + unset($this->delivery_vehicle); + } + + /** + * Required. The `DeliveryVehicle` entity to create. When creating a new + * delivery vehicle, you may set the following optional fields: + * * last_location + * * attributes + * Note: The DeliveryVehicle's `name` field is ignored. All other + * DeliveryVehicle fields must not be set; otherwise, an error is returned. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicle delivery_vehicle = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle $var + * @return $this + */ + public function setDeliveryVehicle($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle::class); + $this->delivery_vehicle = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/CreateTaskRequest.php b/MapsFleetEngineDelivery/src/V1/CreateTaskRequest.php new file mode 100644 index 000000000000..a46f2f910ca5 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/CreateTaskRequest.php @@ -0,0 +1,304 @@ +maps.fleetengine.delivery.v1.CreateTaskRequest + */ +class CreateTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}`. The `provider` must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The Task ID must be unique, but it should be not a shipment + * tracking ID. To store a shipment tracking ID, use the `tracking_id` field. + * Note that multiple tasks can have the same `tracking_id`. Task IDs are + * subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string task_id = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $task_id = ''; + /** + * Required. The Task entity to create. + * When creating a Task, the following fields are required: + * * `type` + * * `state` (must be set to `OPEN`) + * * `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` + * tasks, but required for all other task types) + * * `planned_location` (optional for `UNAVAILABLE` tasks) + * * `task_duration` + * Note: The Task's `name` field is ignored. All other Task fields must not be + * set; otherwise, an error is returned. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task task = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $task = null; + + /** + * @param string $parent Required. Must be in the format `providers/{provider}`. The `provider` must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * @param \Google\Maps\FleetEngine\Delivery\V1\Task $task Required. The Task entity to create. + * When creating a Task, the following fields are required: + * + * * `type` + * * `state` (must be set to `OPEN`) + * * `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` + * tasks, but required for all other task types) + * * `planned_location` (optional for `UNAVAILABLE` tasks) + * * `task_duration` + * + * Note: The Task's `name` field is ignored. All other Task fields must not be + * set; otherwise, an error is returned. + * @param string $taskId Required. The Task ID must be unique, but it should be not a shipment + * tracking ID. To store a shipment tracking ID, use the `tracking_id` field. + * Note that multiple tasks can have the same `tracking_id`. Task IDs are + * subject to the following restrictions: + * + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * @return \Google\Maps\FleetEngine\Delivery\V1\CreateTaskRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Maps\FleetEngine\Delivery\V1\Task $task, string $taskId): self + { + return (new self()) + ->setParent($parent) + ->setTask($task) + ->setTaskId($taskId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * @type string $parent + * Required. Must be in the format `providers/{provider}`. The `provider` must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * @type string $task_id + * Required. The Task ID must be unique, but it should be not a shipment + * tracking ID. To store a shipment tracking ID, use the `tracking_id` field. + * Note that multiple tasks can have the same `tracking_id`. Task IDs are + * subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * @type \Google\Maps\FleetEngine\Delivery\V1\Task $task + * Required. The Task entity to create. + * When creating a Task, the following fields are required: + * * `type` + * * `state` (must be set to `OPEN`) + * * `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` + * tasks, but required for all other task types) + * * `planned_location` (optional for `UNAVAILABLE` tasks) + * * `task_duration` + * Note: The Task's `name` field is ignored. All other Task fields must not be + * set; otherwise, an error is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}`. The `provider` must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Must be in the format `providers/{provider}`. The `provider` must + * be the Google Cloud Project ID. For example, `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Task ID must be unique, but it should be not a shipment + * tracking ID. To store a shipment tracking ID, use the `tracking_id` field. + * Note that multiple tasks can have the same `tracking_id`. Task IDs are + * subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string task_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTaskId() + { + return $this->task_id; + } + + /** + * Required. The Task ID must be unique, but it should be not a shipment + * tracking ID. To store a shipment tracking ID, use the `tracking_id` field. + * Note that multiple tasks can have the same `tracking_id`. Task IDs are + * subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string task_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTaskId($var) + { + GPBUtil::checkString($var, True); + $this->task_id = $var; + + return $this; + } + + /** + * Required. The Task entity to create. + * When creating a Task, the following fields are required: + * * `type` + * * `state` (must be set to `OPEN`) + * * `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` + * tasks, but required for all other task types) + * * `planned_location` (optional for `UNAVAILABLE` tasks) + * * `task_duration` + * Note: The Task's `name` field is ignored. All other Task fields must not be + * set; otherwise, an error is returned. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task task = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\Delivery\V1\Task|null + */ + public function getTask() + { + return $this->task; + } + + public function hasTask() + { + return isset($this->task); + } + + public function clearTask() + { + unset($this->task); + } + + /** + * Required. The Task entity to create. + * When creating a Task, the following fields are required: + * * `type` + * * `state` (must be set to `OPEN`) + * * `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` + * tasks, but required for all other task types) + * * `planned_location` (optional for `UNAVAILABLE` tasks) + * * `task_duration` + * Note: The Task's `name` field is ignored. All other Task fields must not be + * set; otherwise, an error is returned. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task task = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\Delivery\V1\Task $var + * @return $this + */ + public function setTask($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\Task::class); + $this->task = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader.php b/MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader.php new file mode 100644 index 000000000000..99c677f30314 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader.php @@ -0,0 +1,493 @@ +maps.fleetengine.delivery.v1.DeliveryRequestHeader + */ +class DeliveryRequestHeader extends \Google\Protobuf\Internal\Message +{ + /** + * The BCP-47 language code, such as en-US or sr-Latn. For more information, + * see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If none + * is specified, the response may be in any language, with a preference for + * English if such a name exists. Field value example: `en-US`. + * + * Generated from protobuf field string language_code = 1; + */ + protected $language_code = ''; + /** + * Required. CLDR region code of the region where the request originates. + * Field value example: `US`. + * + * Generated from protobuf field string region_code = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_code = ''; + /** + * Version of the calling SDK, if applicable. + * The version format is "major.minor.patch", example: `1.1.2`. + * + * Generated from protobuf field string sdk_version = 3; + */ + protected $sdk_version = ''; + /** + * Version of the operating system on which the calling SDK is running. + * Field value examples: `4.4.1`, `12.1`. + * + * Generated from protobuf field string os_version = 4; + */ + protected $os_version = ''; + /** + * Model of the device on which the calling SDK is running. + * Field value examples: `iPhone12,1`, `SM-G920F`. + * + * Generated from protobuf field string device_model = 5; + */ + protected $device_model = ''; + /** + * The type of SDK sending the request. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader.SdkType sdk_type = 6; + */ + protected $sdk_type = 0; + /** + * Version of the MapSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `5.2.1`. + * + * Generated from protobuf field string maps_sdk_version = 7; + */ + protected $maps_sdk_version = ''; + /** + * Version of the NavSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `2.1.0`. + * + * Generated from protobuf field string nav_sdk_version = 8; + */ + protected $nav_sdk_version = ''; + /** + * Platform of the calling SDK. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader.Platform platform = 9; + */ + protected $platform = 0; + /** + * Manufacturer of the Android device from the calling SDK, only applicable + * for the Android SDKs. + * Field value example: `Samsung`. + * + * Generated from protobuf field string manufacturer = 10; + */ + protected $manufacturer = ''; + /** + * Android API level of the calling SDK, only applicable for the Android SDKs. + * Field value example: `23`. + * + * Generated from protobuf field int32 android_api_level = 11; + */ + protected $android_api_level = 0; + /** + * Optional ID that can be provided for logging purposes in order to identify + * the request. + * + * Generated from protobuf field string trace_id = 12; + */ + protected $trace_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * The BCP-47 language code, such as en-US or sr-Latn. For more information, + * see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If none + * is specified, the response may be in any language, with a preference for + * English if such a name exists. Field value example: `en-US`. + * @type string $region_code + * Required. CLDR region code of the region where the request originates. + * Field value example: `US`. + * @type string $sdk_version + * Version of the calling SDK, if applicable. + * The version format is "major.minor.patch", example: `1.1.2`. + * @type string $os_version + * Version of the operating system on which the calling SDK is running. + * Field value examples: `4.4.1`, `12.1`. + * @type string $device_model + * Model of the device on which the calling SDK is running. + * Field value examples: `iPhone12,1`, `SM-G920F`. + * @type int $sdk_type + * The type of SDK sending the request. + * @type string $maps_sdk_version + * Version of the MapSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `5.2.1`. + * @type string $nav_sdk_version + * Version of the NavSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `2.1.0`. + * @type int $platform + * Platform of the calling SDK. + * @type string $manufacturer + * Manufacturer of the Android device from the calling SDK, only applicable + * for the Android SDKs. + * Field value example: `Samsung`. + * @type int $android_api_level + * Android API level of the calling SDK, only applicable for the Android SDKs. + * Field value example: `23`. + * @type string $trace_id + * Optional ID that can be provided for logging purposes in order to identify + * the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Header::initOnce(); + parent::__construct($data); + } + + /** + * The BCP-47 language code, such as en-US or sr-Latn. For more information, + * see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If none + * is specified, the response may be in any language, with a preference for + * English if such a name exists. Field value example: `en-US`. + * + * Generated from protobuf field string language_code = 1; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * The BCP-47 language code, such as en-US or sr-Latn. For more information, + * see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If none + * is specified, the response may be in any language, with a preference for + * English if such a name exists. Field value example: `en-US`. + * + * Generated from protobuf field string language_code = 1; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Required. CLDR region code of the region where the request originates. + * Field value example: `US`. + * + * Generated from protobuf field string region_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. CLDR region code of the region where the request originates. + * Field value example: `US`. + * + * Generated from protobuf field string region_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Version of the calling SDK, if applicable. + * The version format is "major.minor.patch", example: `1.1.2`. + * + * Generated from protobuf field string sdk_version = 3; + * @return string + */ + public function getSdkVersion() + { + return $this->sdk_version; + } + + /** + * Version of the calling SDK, if applicable. + * The version format is "major.minor.patch", example: `1.1.2`. + * + * Generated from protobuf field string sdk_version = 3; + * @param string $var + * @return $this + */ + public function setSdkVersion($var) + { + GPBUtil::checkString($var, True); + $this->sdk_version = $var; + + return $this; + } + + /** + * Version of the operating system on which the calling SDK is running. + * Field value examples: `4.4.1`, `12.1`. + * + * Generated from protobuf field string os_version = 4; + * @return string + */ + public function getOsVersion() + { + return $this->os_version; + } + + /** + * Version of the operating system on which the calling SDK is running. + * Field value examples: `4.4.1`, `12.1`. + * + * Generated from protobuf field string os_version = 4; + * @param string $var + * @return $this + */ + public function setOsVersion($var) + { + GPBUtil::checkString($var, True); + $this->os_version = $var; + + return $this; + } + + /** + * Model of the device on which the calling SDK is running. + * Field value examples: `iPhone12,1`, `SM-G920F`. + * + * Generated from protobuf field string device_model = 5; + * @return string + */ + public function getDeviceModel() + { + return $this->device_model; + } + + /** + * Model of the device on which the calling SDK is running. + * Field value examples: `iPhone12,1`, `SM-G920F`. + * + * Generated from protobuf field string device_model = 5; + * @param string $var + * @return $this + */ + public function setDeviceModel($var) + { + GPBUtil::checkString($var, True); + $this->device_model = $var; + + return $this; + } + + /** + * The type of SDK sending the request. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader.SdkType sdk_type = 6; + * @return int + */ + public function getSdkType() + { + return $this->sdk_type; + } + + /** + * The type of SDK sending the request. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader.SdkType sdk_type = 6; + * @param int $var + * @return $this + */ + public function setSdkType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader\SdkType::class); + $this->sdk_type = $var; + + return $this; + } + + /** + * Version of the MapSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `5.2.1`. + * + * Generated from protobuf field string maps_sdk_version = 7; + * @return string + */ + public function getMapsSdkVersion() + { + return $this->maps_sdk_version; + } + + /** + * Version of the MapSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `5.2.1`. + * + * Generated from protobuf field string maps_sdk_version = 7; + * @param string $var + * @return $this + */ + public function setMapsSdkVersion($var) + { + GPBUtil::checkString($var, True); + $this->maps_sdk_version = $var; + + return $this; + } + + /** + * Version of the NavSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `2.1.0`. + * + * Generated from protobuf field string nav_sdk_version = 8; + * @return string + */ + public function getNavSdkVersion() + { + return $this->nav_sdk_version; + } + + /** + * Version of the NavSDK which the calling SDK depends on, if applicable. + * The version format is "major.minor.patch", example: `2.1.0`. + * + * Generated from protobuf field string nav_sdk_version = 8; + * @param string $var + * @return $this + */ + public function setNavSdkVersion($var) + { + GPBUtil::checkString($var, True); + $this->nav_sdk_version = $var; + + return $this; + } + + /** + * Platform of the calling SDK. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader.Platform platform = 9; + * @return int + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Platform of the calling SDK. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader.Platform platform = 9; + * @param int $var + * @return $this + */ + public function setPlatform($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader\Platform::class); + $this->platform = $var; + + return $this; + } + + /** + * Manufacturer of the Android device from the calling SDK, only applicable + * for the Android SDKs. + * Field value example: `Samsung`. + * + * Generated from protobuf field string manufacturer = 10; + * @return string + */ + public function getManufacturer() + { + return $this->manufacturer; + } + + /** + * Manufacturer of the Android device from the calling SDK, only applicable + * for the Android SDKs. + * Field value example: `Samsung`. + * + * Generated from protobuf field string manufacturer = 10; + * @param string $var + * @return $this + */ + public function setManufacturer($var) + { + GPBUtil::checkString($var, True); + $this->manufacturer = $var; + + return $this; + } + + /** + * Android API level of the calling SDK, only applicable for the Android SDKs. + * Field value example: `23`. + * + * Generated from protobuf field int32 android_api_level = 11; + * @return int + */ + public function getAndroidApiLevel() + { + return $this->android_api_level; + } + + /** + * Android API level of the calling SDK, only applicable for the Android SDKs. + * Field value example: `23`. + * + * Generated from protobuf field int32 android_api_level = 11; + * @param int $var + * @return $this + */ + public function setAndroidApiLevel($var) + { + GPBUtil::checkInt32($var); + $this->android_api_level = $var; + + return $this; + } + + /** + * Optional ID that can be provided for logging purposes in order to identify + * the request. + * + * Generated from protobuf field string trace_id = 12; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * Optional ID that can be provided for logging purposes in order to identify + * the request. + * + * Generated from protobuf field string trace_id = 12; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, True); + $this->trace_id = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader/Platform.php b/MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader/Platform.php new file mode 100644 index 000000000000..2b27deb24255 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader/Platform.php @@ -0,0 +1,69 @@ +maps.fleetengine.delivery.v1.DeliveryRequestHeader.Platform + */ +class Platform +{ + /** + * The default value. This value is used if the platform is omitted. + * + * Generated from protobuf enum PLATFORM_UNSPECIFIED = 0; + */ + const PLATFORM_UNSPECIFIED = 0; + /** + * The request is coming from Android. + * + * Generated from protobuf enum ANDROID = 1; + */ + const ANDROID = 1; + /** + * The request is coming from iOS. + * + * Generated from protobuf enum IOS = 2; + */ + const IOS = 2; + /** + * The request is coming from the web. + * + * Generated from protobuf enum WEB = 3; + */ + const WEB = 3; + + private static $valueToName = [ + self::PLATFORM_UNSPECIFIED => 'PLATFORM_UNSPECIFIED', + self::ANDROID => 'ANDROID', + self::IOS => 'IOS', + self::WEB => 'WEB', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader/SdkType.php b/MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader/SdkType.php new file mode 100644 index 000000000000..392572b0697f --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/DeliveryRequestHeader/SdkType.php @@ -0,0 +1,69 @@ +maps.fleetengine.delivery.v1.DeliveryRequestHeader.SdkType + */ +class SdkType +{ + /** + * The default value. This value is used if the `sdk_type` is omitted. + * + * Generated from protobuf enum SDK_TYPE_UNSPECIFIED = 0; + */ + const SDK_TYPE_UNSPECIFIED = 0; + /** + * The calling SDK is Consumer. + * + * Generated from protobuf enum CONSUMER = 1; + */ + const CONSUMER = 1; + /** + * The calling SDK is Driver. + * + * Generated from protobuf enum DRIVER = 2; + */ + const DRIVER = 2; + /** + * The calling SDK is JavaScript. + * + * Generated from protobuf enum JAVASCRIPT = 3; + */ + const JAVASCRIPT = 3; + + private static $valueToName = [ + self::SDK_TYPE_UNSPECIFIED => 'SDK_TYPE_UNSPECIFIED', + self::CONSUMER => 'CONSUMER', + self::DRIVER => 'DRIVER', + self::JAVASCRIPT => 'JAVASCRIPT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngineDelivery/src/V1/DeliveryVehicle.php b/MapsFleetEngineDelivery/src/V1/DeliveryVehicle.php new file mode 100644 index 000000000000..30bf0c4151e0 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/DeliveryVehicle.php @@ -0,0 +1,671 @@ +maps.fleetengine.delivery.v1.DeliveryVehicle + */ +class DeliveryVehicle extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of this Delivery Vehicle. + * The format is `providers/{provider}/deliveryVehicles/{vehicle}`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The last reported location of the Delivery Vehicle. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocation last_location = 2; + */ + protected $last_location = null; + /** + * The Delivery Vehicle's navigation status. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleNavigationStatus navigation_status = 3; + */ + protected $navigation_status = 0; + /** + * The encoded polyline specifying the route that the navigation recommends + * taking to the next waypoint. Your driver app updates this when a + * stop is reached or passed, and when the navigation reroutes. These + * `LatLng`s are returned in + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST) for all active Tasks assigned to the Vehicle. + * There are a few cases where this field might not be used to populate + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST): + * * The endpoint of the `current_route_segment` does not match + * `DeliveryVehicle.remaining_vehicle_journey_segments[0].stop` (gRPC) or + * `DeliveryVehicle.remainingVehicleJourneySegments[0].stop` (REST). + * * The driver app has not updated its location recently, so the last + * updated value for this field might be stale. + * * The driver app has recently updated its location, but the + * `current_route_segment` is stale, and points to a previous vehicle stop. + * In these cases, Fleet Engine populates this field with a route from the + * most recently passed VehicleStop to the upcoming VehicleStop to ensure that + * the consumer of this field has the best available information on the + * current path of the Delivery Vehicle. + * + * Generated from protobuf field bytes current_route_segment = 4; + */ + protected $current_route_segment = ''; + /** + * The location where the `current_route_segment` ends. This is not currently + * populated by the driver app, but you can supply it on + * `UpdateDeliveryVehicle` calls. It is either the `LatLng` from the upcoming + * vehicle stop, or the last `LatLng` of the `current_route_segment`. Fleet + * Engine will then do its best to interpolate to an actual `VehicleStop`. + * This field is ignored in `UpdateDeliveryVehicle` calls if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.type.LatLng current_route_segment_end_point = 5; + */ + protected $current_route_segment_end_point = null; + /** + * The remaining driving distance for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_distance_meters` (gRPC) + * or `Task.remainingVehicleJourneySegments[0].drivingDistanceMeters` (REST) + * for all active `Task`s assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 6; + */ + protected $remaining_distance_meters = null; + /** + * The remaining driving time for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or + * `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST) for all + * active tasks assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Duration remaining_duration = 7; + */ + protected $remaining_duration = null; + /** + * The journey segments assigned to this Delivery Vehicle, starting from the + * Vehicle's most recently reported location. This field won't be populated + * in the response of `ListDeliveryVehicles`. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.VehicleJourneySegment remaining_vehicle_journey_segments = 8; + */ + private $remaining_vehicle_journey_segments; + /** + * A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have + * at most 100 attributes, and each attribute must have a unique key. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.DeliveryVehicleAttribute attributes = 9; + */ + private $attributes; + /** + * The type of this delivery vehicle. If unset, this will default to `AUTO`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicle.DeliveryVehicleType type = 10; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of this Delivery Vehicle. + * The format is `providers/{provider}/deliveryVehicles/{vehicle}`. + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation $last_location + * The last reported location of the Delivery Vehicle. + * @type int $navigation_status + * The Delivery Vehicle's navigation status. + * @type string $current_route_segment + * The encoded polyline specifying the route that the navigation recommends + * taking to the next waypoint. Your driver app updates this when a + * stop is reached or passed, and when the navigation reroutes. These + * `LatLng`s are returned in + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST) for all active Tasks assigned to the Vehicle. + * There are a few cases where this field might not be used to populate + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST): + * * The endpoint of the `current_route_segment` does not match + * `DeliveryVehicle.remaining_vehicle_journey_segments[0].stop` (gRPC) or + * `DeliveryVehicle.remainingVehicleJourneySegments[0].stop` (REST). + * * The driver app has not updated its location recently, so the last + * updated value for this field might be stale. + * * The driver app has recently updated its location, but the + * `current_route_segment` is stale, and points to a previous vehicle stop. + * In these cases, Fleet Engine populates this field with a route from the + * most recently passed VehicleStop to the upcoming VehicleStop to ensure that + * the consumer of this field has the best available information on the + * current path of the Delivery Vehicle. + * @type \Google\Type\LatLng $current_route_segment_end_point + * The location where the `current_route_segment` ends. This is not currently + * populated by the driver app, but you can supply it on + * `UpdateDeliveryVehicle` calls. It is either the `LatLng` from the upcoming + * vehicle stop, or the last `LatLng` of the `current_route_segment`. Fleet + * Engine will then do its best to interpolate to an actual `VehicleStop`. + * This field is ignored in `UpdateDeliveryVehicle` calls if the + * `current_route_segment` field is empty. + * @type \Google\Protobuf\Int32Value $remaining_distance_meters + * The remaining driving distance for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_distance_meters` (gRPC) + * or `Task.remainingVehicleJourneySegments[0].drivingDistanceMeters` (REST) + * for all active `Task`s assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * @type \Google\Protobuf\Duration $remaining_duration + * The remaining driving time for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or + * `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST) for all + * active tasks assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * @type array<\Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment>|\Google\Protobuf\Internal\RepeatedField $remaining_vehicle_journey_segments + * The journey segments assigned to this Delivery Vehicle, starting from the + * Vehicle's most recently reported location. This field won't be populated + * in the response of `ListDeliveryVehicles`. + * @type array<\Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $attributes + * A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have + * at most 100 attributes, and each attribute must have a unique key. + * @type int $type + * The type of this delivery vehicle. If unset, this will default to `AUTO`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryVehicles::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of this Delivery Vehicle. + * The format is `providers/{provider}/deliveryVehicles/{vehicle}`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of this Delivery Vehicle. + * The format is `providers/{provider}/deliveryVehicles/{vehicle}`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The last reported location of the Delivery Vehicle. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocation last_location = 2; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation|null + */ + public function getLastLocation() + { + return $this->last_location; + } + + public function hasLastLocation() + { + return isset($this->last_location); + } + + public function clearLastLocation() + { + unset($this->last_location); + } + + /** + * The last reported location of the Delivery Vehicle. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocation last_location = 2; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation $var + * @return $this + */ + public function setLastLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation::class); + $this->last_location = $var; + + return $this; + } + + /** + * The Delivery Vehicle's navigation status. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleNavigationStatus navigation_status = 3; + * @return int + */ + public function getNavigationStatus() + { + return $this->navigation_status; + } + + /** + * The Delivery Vehicle's navigation status. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleNavigationStatus navigation_status = 3; + * @param int $var + * @return $this + */ + public function setNavigationStatus($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleNavigationStatus::class); + $this->navigation_status = $var; + + return $this; + } + + /** + * The encoded polyline specifying the route that the navigation recommends + * taking to the next waypoint. Your driver app updates this when a + * stop is reached or passed, and when the navigation reroutes. These + * `LatLng`s are returned in + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST) for all active Tasks assigned to the Vehicle. + * There are a few cases where this field might not be used to populate + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST): + * * The endpoint of the `current_route_segment` does not match + * `DeliveryVehicle.remaining_vehicle_journey_segments[0].stop` (gRPC) or + * `DeliveryVehicle.remainingVehicleJourneySegments[0].stop` (REST). + * * The driver app has not updated its location recently, so the last + * updated value for this field might be stale. + * * The driver app has recently updated its location, but the + * `current_route_segment` is stale, and points to a previous vehicle stop. + * In these cases, Fleet Engine populates this field with a route from the + * most recently passed VehicleStop to the upcoming VehicleStop to ensure that + * the consumer of this field has the best available information on the + * current path of the Delivery Vehicle. + * + * Generated from protobuf field bytes current_route_segment = 4; + * @return string + */ + public function getCurrentRouteSegment() + { + return $this->current_route_segment; + } + + /** + * The encoded polyline specifying the route that the navigation recommends + * taking to the next waypoint. Your driver app updates this when a + * stop is reached or passed, and when the navigation reroutes. These + * `LatLng`s are returned in + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST) for all active Tasks assigned to the Vehicle. + * There are a few cases where this field might not be used to populate + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST): + * * The endpoint of the `current_route_segment` does not match + * `DeliveryVehicle.remaining_vehicle_journey_segments[0].stop` (gRPC) or + * `DeliveryVehicle.remainingVehicleJourneySegments[0].stop` (REST). + * * The driver app has not updated its location recently, so the last + * updated value for this field might be stale. + * * The driver app has recently updated its location, but the + * `current_route_segment` is stale, and points to a previous vehicle stop. + * In these cases, Fleet Engine populates this field with a route from the + * most recently passed VehicleStop to the upcoming VehicleStop to ensure that + * the consumer of this field has the best available information on the + * current path of the Delivery Vehicle. + * + * Generated from protobuf field bytes current_route_segment = 4; + * @param string $var + * @return $this + */ + public function setCurrentRouteSegment($var) + { + GPBUtil::checkString($var, False); + $this->current_route_segment = $var; + + return $this; + } + + /** + * The location where the `current_route_segment` ends. This is not currently + * populated by the driver app, but you can supply it on + * `UpdateDeliveryVehicle` calls. It is either the `LatLng` from the upcoming + * vehicle stop, or the last `LatLng` of the `current_route_segment`. Fleet + * Engine will then do its best to interpolate to an actual `VehicleStop`. + * This field is ignored in `UpdateDeliveryVehicle` calls if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.type.LatLng current_route_segment_end_point = 5; + * @return \Google\Type\LatLng|null + */ + public function getCurrentRouteSegmentEndPoint() + { + return $this->current_route_segment_end_point; + } + + public function hasCurrentRouteSegmentEndPoint() + { + return isset($this->current_route_segment_end_point); + } + + public function clearCurrentRouteSegmentEndPoint() + { + unset($this->current_route_segment_end_point); + } + + /** + * The location where the `current_route_segment` ends. This is not currently + * populated by the driver app, but you can supply it on + * `UpdateDeliveryVehicle` calls. It is either the `LatLng` from the upcoming + * vehicle stop, or the last `LatLng` of the `current_route_segment`. Fleet + * Engine will then do its best to interpolate to an actual `VehicleStop`. + * This field is ignored in `UpdateDeliveryVehicle` calls if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.type.LatLng current_route_segment_end_point = 5; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setCurrentRouteSegmentEndPoint($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->current_route_segment_end_point = $var; + + return $this; + } + + /** + * The remaining driving distance for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_distance_meters` (gRPC) + * or `Task.remainingVehicleJourneySegments[0].drivingDistanceMeters` (REST) + * for all active `Task`s assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 6; + * @return \Google\Protobuf\Int32Value|null + */ + public function getRemainingDistanceMeters() + { + return $this->remaining_distance_meters; + } + + public function hasRemainingDistanceMeters() + { + return isset($this->remaining_distance_meters); + } + + public function clearRemainingDistanceMeters() + { + unset($this->remaining_distance_meters); + } + + /** + * Returns the unboxed value from getRemainingDistanceMeters() + + * The remaining driving distance for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_distance_meters` (gRPC) + * or `Task.remainingVehicleJourneySegments[0].drivingDistanceMeters` (REST) + * for all active `Task`s assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 6; + * @return int|null + */ + public function getRemainingDistanceMetersUnwrapped() + { + return $this->readWrapperValue("remaining_distance_meters"); + } + + /** + * The remaining driving distance for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_distance_meters` (gRPC) + * or `Task.remainingVehicleJourneySegments[0].drivingDistanceMeters` (REST) + * for all active `Task`s assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 6; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setRemainingDistanceMeters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->remaining_distance_meters = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The remaining driving distance for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_distance_meters` (gRPC) + * or `Task.remainingVehicleJourneySegments[0].drivingDistanceMeters` (REST) + * for all active `Task`s assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_distance_meters = 6; + * @param int|null $var + * @return $this + */ + public function setRemainingDistanceMetersUnwrapped($var) + { + $this->writeWrapperValue("remaining_distance_meters", $var); + return $this;} + + /** + * The remaining driving time for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or + * `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST) for all + * active tasks assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Duration remaining_duration = 7; + * @return \Google\Protobuf\Duration|null + */ + public function getRemainingDuration() + { + return $this->remaining_duration; + } + + public function hasRemainingDuration() + { + return isset($this->remaining_duration); + } + + public function clearRemainingDuration() + { + unset($this->remaining_duration); + } + + /** + * The remaining driving time for the `current_route_segment`. + * The Driver app typically provides this field, but there are some + * circumstances in which Fleet Engine will override the value sent by the + * app. For more information, see + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * This field is returned in + * `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or + * `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST) for all + * active tasks assigned to the Delivery Vehicle. + * Fleet Engine ignores this field in `UpdateDeliveryVehicleRequest` if the + * `current_route_segment` field is empty. + * + * Generated from protobuf field .google.protobuf.Duration remaining_duration = 7; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRemainingDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->remaining_duration = $var; + + return $this; + } + + /** + * The journey segments assigned to this Delivery Vehicle, starting from the + * Vehicle's most recently reported location. This field won't be populated + * in the response of `ListDeliveryVehicles`. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.VehicleJourneySegment remaining_vehicle_journey_segments = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRemainingVehicleJourneySegments() + { + return $this->remaining_vehicle_journey_segments; + } + + /** + * The journey segments assigned to this Delivery Vehicle, starting from the + * Vehicle's most recently reported location. This field won't be populated + * in the response of `ListDeliveryVehicles`. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.VehicleJourneySegment remaining_vehicle_journey_segments = 8; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRemainingVehicleJourneySegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment::class); + $this->remaining_vehicle_journey_segments = $arr; + + return $this; + } + + /** + * A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have + * at most 100 attributes, and each attribute must have a unique key. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.DeliveryVehicleAttribute attributes = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have + * at most 100 attributes, and each attribute must have a unique key. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.DeliveryVehicleAttribute attributes = 9; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleAttribute::class); + $this->attributes = $arr; + + return $this; + } + + /** + * The type of this delivery vehicle. If unset, this will default to `AUTO`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicle.DeliveryVehicleType type = 10; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of this delivery vehicle. If unset, this will default to `AUTO`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicle.DeliveryVehicleType type = 10; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle\DeliveryVehicleType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/DeliveryVehicle/DeliveryVehicleType.php b/MapsFleetEngineDelivery/src/V1/DeliveryVehicle/DeliveryVehicleType.php new file mode 100644 index 000000000000..1ad8ef742448 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/DeliveryVehicle/DeliveryVehicleType.php @@ -0,0 +1,77 @@ +maps.fleetengine.delivery.v1.DeliveryVehicle.DeliveryVehicleType + */ +class DeliveryVehicleType +{ + /** + * The value is unused. + * + * Generated from protobuf enum DELIVERY_VEHICLE_TYPE_UNSPECIFIED = 0; + */ + const DELIVERY_VEHICLE_TYPE_UNSPECIFIED = 0; + /** + * An automobile. + * + * Generated from protobuf enum AUTO = 1; + */ + const AUTO = 1; + /** + * A motorcycle, moped, or other two-wheeled vehicle + * + * Generated from protobuf enum TWO_WHEELER = 2; + */ + const TWO_WHEELER = 2; + /** + * Human-powered transport. + * + * Generated from protobuf enum BICYCLE = 3; + */ + const BICYCLE = 3; + /** + * A human transporter, typically walking or running, traveling along + * pedestrian pathways. + * + * Generated from protobuf enum PEDESTRIAN = 4; + */ + const PEDESTRIAN = 4; + + private static $valueToName = [ + self::DELIVERY_VEHICLE_TYPE_UNSPECIFIED => 'DELIVERY_VEHICLE_TYPE_UNSPECIFIED', + self::AUTO => 'AUTO', + self::TWO_WHEELER => 'TWO_WHEELER', + self::BICYCLE => 'BICYCLE', + self::PEDESTRIAN => 'PEDESTRIAN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngineDelivery/src/V1/DeliveryVehicleAttribute.php b/MapsFleetEngineDelivery/src/V1/DeliveryVehicleAttribute.php new file mode 100644 index 000000000000..6260a1669498 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/DeliveryVehicleAttribute.php @@ -0,0 +1,225 @@ +maps.fleetengine.delivery.v1.DeliveryVehicleAttribute + */ +class DeliveryVehicleAttribute extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute's key. + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * The attribute's value. + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + protected $delivery_vehicle_attribute_value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The attribute's key. + * @type string $value + * The attribute's value. + * @type string $string_value + * String typed attribute value. + * Note: This is identical to the `value` field which will eventually be + * deprecated. For create or update methods, either field can be used, but + * it's strongly recommended to use `string_value`. If both `string_value` + * and `value` are set, they must be identical or an error will be thrown. + * Both fields are populated in responses. + * @type bool $bool_value + * Boolean typed attribute value. + * @type float $number_value + * Double typed attribute value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * The attribute's key. + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The attribute's key. + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * The attribute's value. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The attribute's value. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * String typed attribute value. + * Note: This is identical to the `value` field which will eventually be + * deprecated. For create or update methods, either field can be used, but + * it's strongly recommended to use `string_value`. If both `string_value` + * and `value` are set, they must be identical or an error will be thrown. + * Both fields are populated in responses. + * + * Generated from protobuf field string string_value = 3; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(3); + } + + public function hasStringValue() + { + return $this->hasOneof(3); + } + + /** + * String typed attribute value. + * Note: This is identical to the `value` field which will eventually be + * deprecated. For create or update methods, either field can be used, but + * it's strongly recommended to use `string_value`. If both `string_value` + * and `value` are set, they must be identical or an error will be thrown. + * Both fields are populated in responses. + * + * Generated from protobuf field string string_value = 3; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Boolean typed attribute value. + * + * Generated from protobuf field bool bool_value = 4; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(4); + } + + public function hasBoolValue() + { + return $this->hasOneof(4); + } + + /** + * Boolean typed attribute value. + * + * Generated from protobuf field bool bool_value = 4; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Double typed attribute value. + * + * Generated from protobuf field double number_value = 5; + * @return float + */ + public function getNumberValue() + { + return $this->readOneof(5); + } + + public function hasNumberValue() + { + return $this->hasOneof(5); + } + + /** + * Double typed attribute value. + * + * Generated from protobuf field double number_value = 5; + * @param float $var + * @return $this + */ + public function setNumberValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getDeliveryVehicleAttributeValue() + { + return $this->whichOneof("delivery_vehicle_attribute_value"); + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/DeliveryVehicleLocation.php b/MapsFleetEngineDelivery/src/V1/DeliveryVehicleLocation.php new file mode 100644 index 000000000000..e5bcab30627f --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/DeliveryVehicleLocation.php @@ -0,0 +1,1789 @@ +maps.fleetengine.delivery.v1.DeliveryVehicleLocation + */ +class DeliveryVehicleLocation extends \Google\Protobuf\Internal\Message +{ + /** + * The location of the vehicle. + * When it is sent to Fleet Engine, the vehicle's location is a GPS location. + * When you receive it in a response, the vehicle's location can be either a + * GPS location, a supplemental location, or some other estimated location. + * The source is specified in `location_sensor`. + * + * Generated from protobuf field .google.type.LatLng location = 1; + */ + protected $location = null; + /** + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @deprecated + */ + protected $horizontal_accuracy = null; + /** + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + */ + protected $latlng_accuracy = null; + /** + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + */ + protected $heading = null; + /** + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @deprecated + */ + protected $bearing_accuracy = null; + /** + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + */ + protected $heading_accuracy = null; + /** + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + */ + protected $altitude = null; + /** + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @deprecated + */ + protected $vertical_accuracy = null; + /** + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + */ + protected $altitude_accuracy = null; + /** + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @deprecated + */ + protected $speed_kmph = null; + /** + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + */ + protected $speed = null; + /** + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + */ + protected $speed_accuracy = null; + /** + * The time when `location` was reported by the sensor according to the + * sensor's clock. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + /** + * Output only. The time when the server received the location information. + * + * Generated from protobuf field .google.protobuf.Timestamp server_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $server_time = null; + /** + * Provider of location data (for example, `GPS`). + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor location_sensor = 11; + */ + protected $location_sensor = 0; + /** + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + */ + protected $is_road_snapped = null; + /** + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $is_gps_sensor_enabled = null; + /** + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $time_since_update = null; + /** + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @deprecated + */ + protected $num_stale_updates = null; + /** + * Raw vehicle location (unprocessed by road-snapper). + * + * Generated from protobuf field .google.type.LatLng raw_location = 16; + */ + protected $raw_location = null; + /** + * Timestamp associated with the raw location. + * + * Generated from protobuf field .google.protobuf.Timestamp raw_location_time = 17; + */ + protected $raw_location_time = null; + /** + * Source of the raw location. Defaults to `GPS`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor raw_location_sensor = 28; + */ + protected $raw_location_sensor = 0; + /** + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + */ + protected $raw_location_accuracy = null; + /** + * Supplemental location provided by the integrating app. + * + * Generated from protobuf field .google.type.LatLng supplemental_location = 18; + */ + protected $supplemental_location = null; + /** + * Timestamp associated with the supplemental location. + * + * Generated from protobuf field .google.protobuf.Timestamp supplemental_location_time = 19; + */ + protected $supplemental_location_time = null; + /** + * Source of the supplemental location. Defaults to + * `CUSTOMER_SUPPLIED_LOCATION`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor supplemental_location_sensor = 20; + */ + protected $supplemental_location_sensor = 0; + /** + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + */ + protected $supplemental_location_accuracy = null; + /** + * Deprecated: Use `is_road_snapped` instead. + * + * Generated from protobuf field bool road_snapped = 26 [deprecated = true]; + * @deprecated + */ + protected $road_snapped = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $location + * The location of the vehicle. + * When it is sent to Fleet Engine, the vehicle's location is a GPS location. + * When you receive it in a response, the vehicle's location can be either a + * GPS location, a supplemental location, or some other estimated location. + * The source is specified in `location_sensor`. + * @type \Google\Protobuf\DoubleValue $horizontal_accuracy + * Deprecated: Use `latlng_accuracy` instead. + * @type \Google\Protobuf\DoubleValue $latlng_accuracy + * Accuracy of `location` in meters as a radius. + * @type \Google\Protobuf\Int32Value $heading + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * @type \Google\Protobuf\DoubleValue $bearing_accuracy + * Deprecated: Use `heading_accuracy` instead. + * @type \Google\Protobuf\DoubleValue $heading_accuracy + * Accuracy of `heading` in degrees. + * @type \Google\Protobuf\DoubleValue $altitude + * Altitude in meters above WGS84. + * @type \Google\Protobuf\DoubleValue $vertical_accuracy + * Deprecated: Use `altitude_accuracy` instead. + * @type \Google\Protobuf\DoubleValue $altitude_accuracy + * Accuracy of `altitude` in meters. + * @type \Google\Protobuf\Int32Value $speed_kmph + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * @type \Google\Protobuf\DoubleValue $speed + * Speed of the vehicle in meters/second + * @type \Google\Protobuf\DoubleValue $speed_accuracy + * Accuracy of `speed` in meters/second. + * @type \Google\Protobuf\Timestamp $update_time + * The time when `location` was reported by the sensor according to the + * sensor's clock. + * @type \Google\Protobuf\Timestamp $server_time + * Output only. The time when the server received the location information. + * @type int $location_sensor + * Provider of location data (for example, `GPS`). + * @type \Google\Protobuf\BoolValue $is_road_snapped + * Whether `location` is snapped to a road. + * @type \Google\Protobuf\BoolValue $is_gps_sensor_enabled + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * @type \Google\Protobuf\Int32Value $time_since_update + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * @type \Google\Protobuf\Int32Value $num_stale_updates + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * @type \Google\Type\LatLng $raw_location + * Raw vehicle location (unprocessed by road-snapper). + * @type \Google\Protobuf\Timestamp $raw_location_time + * Timestamp associated with the raw location. + * @type int $raw_location_sensor + * Source of the raw location. Defaults to `GPS`. + * @type \Google\Protobuf\DoubleValue $raw_location_accuracy + * Accuracy of `raw_location` as a radius, in meters. + * @type \Google\Type\LatLng $supplemental_location + * Supplemental location provided by the integrating app. + * @type \Google\Protobuf\Timestamp $supplemental_location_time + * Timestamp associated with the supplemental location. + * @type int $supplemental_location_sensor + * Source of the supplemental location. Defaults to + * `CUSTOMER_SUPPLIED_LOCATION`. + * @type \Google\Protobuf\DoubleValue $supplemental_location_accuracy + * Accuracy of `supplemental_location` as a radius, in meters. + * @type bool $road_snapped + * Deprecated: Use `is_road_snapped` instead. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * The location of the vehicle. + * When it is sent to Fleet Engine, the vehicle's location is a GPS location. + * When you receive it in a response, the vehicle's location can be either a + * GPS location, a supplemental location, or some other estimated location. + * The source is specified in `location_sensor`. + * + * Generated from protobuf field .google.type.LatLng location = 1; + * @return \Google\Type\LatLng|null + */ + public function getLocation() + { + return $this->location; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * The location of the vehicle. + * When it is sent to Fleet Engine, the vehicle's location is a GPS location. + * When you receive it in a response, the vehicle's location can be either a + * GPS location, a supplemental location, or some other estimated location. + * The source is specified in `location_sensor`. + * + * Generated from protobuf field .google.type.LatLng location = 1; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->location = $var; + + return $this; + } + + /** + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @return \Google\Protobuf\DoubleValue|null + * @deprecated + */ + public function getHorizontalAccuracy() + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->horizontal_accuracy; + } + + public function hasHorizontalAccuracy() + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + return isset($this->horizontal_accuracy); + } + + public function clearHorizontalAccuracy() + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + unset($this->horizontal_accuracy); + } + + /** + * Returns the unboxed value from getHorizontalAccuracy() + + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @return float|null + */ + public function getHorizontalAccuracyUnwrapped() + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("horizontal_accuracy"); + } + + /** + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + * @deprecated + */ + public function setHorizontalAccuracy($var) + { + @trigger_error('horizontal_accuracy is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->horizontal_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Deprecated: Use `latlng_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue horizontal_accuracy = 8 [deprecated = true]; + * @param float|null $var + * @return $this + */ + public function setHorizontalAccuracyUnwrapped($var) + { + $this->writeWrapperValue("horizontal_accuracy", $var); + return $this;} + + /** + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getLatlngAccuracy() + { + return $this->latlng_accuracy; + } + + public function hasLatlngAccuracy() + { + return isset($this->latlng_accuracy); + } + + public function clearLatlngAccuracy() + { + unset($this->latlng_accuracy); + } + + /** + * Returns the unboxed value from getLatlngAccuracy() + + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + * @return float|null + */ + public function getLatlngAccuracyUnwrapped() + { + return $this->readWrapperValue("latlng_accuracy"); + } + + /** + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setLatlngAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->latlng_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `location` in meters as a radius. + * + * Generated from protobuf field .google.protobuf.DoubleValue latlng_accuracy = 22; + * @param float|null $var + * @return $this + */ + public function setLatlngAccuracyUnwrapped($var) + { + $this->writeWrapperValue("latlng_accuracy", $var); + return $this;} + + /** + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + * @return \Google\Protobuf\Int32Value|null + */ + public function getHeading() + { + return $this->heading; + } + + public function hasHeading() + { + return isset($this->heading); + } + + public function clearHeading() + { + unset($this->heading); + } + + /** + * Returns the unboxed value from getHeading() + + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + * @return int|null + */ + public function getHeadingUnwrapped() + { + return $this->readWrapperValue("heading"); + } + + /** + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setHeading($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->heading = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Direction the vehicle is moving in degrees. 0 represents North. + * The valid range is [0,360). + * + * Generated from protobuf field .google.protobuf.Int32Value heading = 2; + * @param int|null $var + * @return $this + */ + public function setHeadingUnwrapped($var) + { + $this->writeWrapperValue("heading", $var); + return $this;} + + /** + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @return \Google\Protobuf\DoubleValue|null + * @deprecated + */ + public function getBearingAccuracy() + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->bearing_accuracy; + } + + public function hasBearingAccuracy() + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + return isset($this->bearing_accuracy); + } + + public function clearBearingAccuracy() + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + unset($this->bearing_accuracy); + } + + /** + * Returns the unboxed value from getBearingAccuracy() + + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @return float|null + */ + public function getBearingAccuracyUnwrapped() + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("bearing_accuracy"); + } + + /** + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + * @deprecated + */ + public function setBearingAccuracy($var) + { + @trigger_error('bearing_accuracy is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->bearing_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Deprecated: Use `heading_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue bearing_accuracy = 10 [deprecated = true]; + * @param float|null $var + * @return $this + */ + public function setBearingAccuracyUnwrapped($var) + { + $this->writeWrapperValue("bearing_accuracy", $var); + return $this;} + + /** + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getHeadingAccuracy() + { + return $this->heading_accuracy; + } + + public function hasHeadingAccuracy() + { + return isset($this->heading_accuracy); + } + + public function clearHeadingAccuracy() + { + unset($this->heading_accuracy); + } + + /** + * Returns the unboxed value from getHeadingAccuracy() + + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + * @return float|null + */ + public function getHeadingAccuracyUnwrapped() + { + return $this->readWrapperValue("heading_accuracy"); + } + + /** + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setHeadingAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->heading_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `heading` in degrees. + * + * Generated from protobuf field .google.protobuf.DoubleValue heading_accuracy = 23; + * @param float|null $var + * @return $this + */ + public function setHeadingAccuracyUnwrapped($var) + { + $this->writeWrapperValue("heading_accuracy", $var); + return $this;} + + /** + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getAltitude() + { + return $this->altitude; + } + + public function hasAltitude() + { + return isset($this->altitude); + } + + public function clearAltitude() + { + unset($this->altitude); + } + + /** + * Returns the unboxed value from getAltitude() + + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + * @return float|null + */ + public function getAltitudeUnwrapped() + { + return $this->readWrapperValue("altitude"); + } + + /** + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setAltitude($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->altitude = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Altitude in meters above WGS84. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude = 5; + * @param float|null $var + * @return $this + */ + public function setAltitudeUnwrapped($var) + { + $this->writeWrapperValue("altitude", $var); + return $this;} + + /** + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @return \Google\Protobuf\DoubleValue|null + * @deprecated + */ + public function getVerticalAccuracy() + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->vertical_accuracy; + } + + public function hasVerticalAccuracy() + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + return isset($this->vertical_accuracy); + } + + public function clearVerticalAccuracy() + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + unset($this->vertical_accuracy); + } + + /** + * Returns the unboxed value from getVerticalAccuracy() + + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @return float|null + */ + public function getVerticalAccuracyUnwrapped() + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("vertical_accuracy"); + } + + /** + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + * @deprecated + */ + public function setVerticalAccuracy($var) + { + @trigger_error('vertical_accuracy is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->vertical_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Deprecated: Use `altitude_accuracy` instead. + * + * Generated from protobuf field .google.protobuf.DoubleValue vertical_accuracy = 9 [deprecated = true]; + * @param float|null $var + * @return $this + */ + public function setVerticalAccuracyUnwrapped($var) + { + $this->writeWrapperValue("vertical_accuracy", $var); + return $this;} + + /** + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getAltitudeAccuracy() + { + return $this->altitude_accuracy; + } + + public function hasAltitudeAccuracy() + { + return isset($this->altitude_accuracy); + } + + public function clearAltitudeAccuracy() + { + unset($this->altitude_accuracy); + } + + /** + * Returns the unboxed value from getAltitudeAccuracy() + + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + * @return float|null + */ + public function getAltitudeAccuracyUnwrapped() + { + return $this->readWrapperValue("altitude_accuracy"); + } + + /** + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setAltitudeAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->altitude_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `altitude` in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue altitude_accuracy = 24; + * @param float|null $var + * @return $this + */ + public function setAltitudeAccuracyUnwrapped($var) + { + $this->writeWrapperValue("altitude_accuracy", $var); + return $this;} + + /** + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @return \Google\Protobuf\Int32Value|null + * @deprecated + */ + public function getSpeedKmph() + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + return $this->speed_kmph; + } + + public function hasSpeedKmph() + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + return isset($this->speed_kmph); + } + + public function clearSpeedKmph() + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + unset($this->speed_kmph); + } + + /** + * Returns the unboxed value from getSpeedKmph() + + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @return int|null + */ + public function getSpeedKmphUnwrapped() + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("speed_kmph"); + } + + /** + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + * @deprecated + */ + public function setSpeedKmph($var) + { + @trigger_error('speed_kmph is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->speed_kmph = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Speed of the vehicle in kilometers per hour. + * Deprecated: Use `speed` instead. + * + * Generated from protobuf field .google.protobuf.Int32Value speed_kmph = 3 [deprecated = true]; + * @param int|null $var + * @return $this + */ + public function setSpeedKmphUnwrapped($var) + { + $this->writeWrapperValue("speed_kmph", $var); + return $this;} + + /** + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getSpeed() + { + return $this->speed; + } + + public function hasSpeed() + { + return isset($this->speed); + } + + public function clearSpeed() + { + unset($this->speed); + } + + /** + * Returns the unboxed value from getSpeed() + + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + * @return float|null + */ + public function getSpeedUnwrapped() + { + return $this->readWrapperValue("speed"); + } + + /** + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setSpeed($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->speed = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Speed of the vehicle in meters/second + * + * Generated from protobuf field .google.protobuf.DoubleValue speed = 6; + * @param float|null $var + * @return $this + */ + public function setSpeedUnwrapped($var) + { + $this->writeWrapperValue("speed", $var); + return $this;} + + /** + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getSpeedAccuracy() + { + return $this->speed_accuracy; + } + + public function hasSpeedAccuracy() + { + return isset($this->speed_accuracy); + } + + public function clearSpeedAccuracy() + { + unset($this->speed_accuracy); + } + + /** + * Returns the unboxed value from getSpeedAccuracy() + + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + * @return float|null + */ + public function getSpeedAccuracyUnwrapped() + { + return $this->readWrapperValue("speed_accuracy"); + } + + /** + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setSpeedAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->speed_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `speed` in meters/second. + * + * Generated from protobuf field .google.protobuf.DoubleValue speed_accuracy = 7; + * @param float|null $var + * @return $this + */ + public function setSpeedAccuracyUnwrapped($var) + { + $this->writeWrapperValue("speed_accuracy", $var); + return $this;} + + /** + * The time when `location` was reported by the sensor according to the + * sensor's clock. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The time when `location` was reported by the sensor according to the + * sensor's clock. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The time when the server received the location information. + * + * Generated from protobuf field .google.protobuf.Timestamp server_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getServerTime() + { + return $this->server_time; + } + + public function hasServerTime() + { + return isset($this->server_time); + } + + public function clearServerTime() + { + unset($this->server_time); + } + + /** + * Output only. The time when the server received the location information. + * + * Generated from protobuf field .google.protobuf.Timestamp server_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setServerTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->server_time = $var; + + return $this; + } + + /** + * Provider of location data (for example, `GPS`). + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor location_sensor = 11; + * @return int + */ + public function getLocationSensor() + { + return $this->location_sensor; + } + + /** + * Provider of location data (for example, `GPS`). + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor location_sensor = 11; + * @param int $var + * @return $this + */ + public function setLocationSensor($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocationSensor::class); + $this->location_sensor = $var; + + return $this; + } + + /** + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + * @return \Google\Protobuf\BoolValue|null + */ + public function getIsRoadSnapped() + { + return $this->is_road_snapped; + } + + public function hasIsRoadSnapped() + { + return isset($this->is_road_snapped); + } + + public function clearIsRoadSnapped() + { + unset($this->is_road_snapped); + } + + /** + * Returns the unboxed value from getIsRoadSnapped() + + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + * @return bool|null + */ + public function getIsRoadSnappedUnwrapped() + { + return $this->readWrapperValue("is_road_snapped"); + } + + /** + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setIsRoadSnapped($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->is_road_snapped = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Whether `location` is snapped to a road. + * + * Generated from protobuf field .google.protobuf.BoolValue is_road_snapped = 27; + * @param bool|null $var + * @return $this + */ + public function setIsRoadSnappedUnwrapped($var) + { + $this->writeWrapperValue("is_road_snapped", $var); + return $this;} + + /** + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getIsGpsSensorEnabled() + { + return $this->is_gps_sensor_enabled; + } + + public function hasIsGpsSensorEnabled() + { + return isset($this->is_gps_sensor_enabled); + } + + public function clearIsGpsSensorEnabled() + { + unset($this->is_gps_sensor_enabled); + } + + /** + * Returns the unboxed value from getIsGpsSensorEnabled() + + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return bool|null + */ + public function getIsGpsSensorEnabledUnwrapped() + { + return $this->readWrapperValue("is_gps_sensor_enabled"); + } + + /** + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setIsGpsSensorEnabled($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->is_gps_sensor_enabled = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Input only. Indicates whether the GPS sensor is enabled on the mobile + * device. + * + * Generated from protobuf field .google.protobuf.BoolValue is_gps_sensor_enabled = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param bool|null $var + * @return $this + */ + public function setIsGpsSensorEnabledUnwrapped($var) + { + $this->writeWrapperValue("is_gps_sensor_enabled", $var); + return $this;} + + /** + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getTimeSinceUpdate() + { + return $this->time_since_update; + } + + public function hasTimeSinceUpdate() + { + return isset($this->time_since_update); + } + + public function clearTimeSinceUpdate() + { + unset($this->time_since_update); + } + + /** + * Returns the unboxed value from getTimeSinceUpdate() + + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return int|null + */ + public function getTimeSinceUpdateUnwrapped() + { + return $this->readWrapperValue("time_since_update"); + } + + /** + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setTimeSinceUpdate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->time_since_update = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Input only. Time (in seconds) since this location was first sent to the + * server. This will be zero for the first update. If the time is unknown (for + * example, when the app restarts), this value resets to zero. + * + * Generated from protobuf field .google.protobuf.Int32Value time_since_update = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param int|null $var + * @return $this + */ + public function setTimeSinceUpdateUnwrapped($var) + { + $this->writeWrapperValue("time_since_update", $var); + return $this;} + + /** + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Protobuf\Int32Value|null + * @deprecated + */ + public function getNumStaleUpdates() + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + return $this->num_stale_updates; + } + + public function hasNumStaleUpdates() + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + return isset($this->num_stale_updates); + } + + public function clearNumStaleUpdates() + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + unset($this->num_stale_updates); + } + + /** + * Returns the unboxed value from getNumStaleUpdates() + + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @return int|null + */ + public function getNumStaleUpdatesUnwrapped() + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + return $this->readWrapperValue("num_stale_updates"); + } + + /** + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + * @deprecated + */ + public function setNumStaleUpdates($var) + { + @trigger_error('num_stale_updates is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->num_stale_updates = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Input only. Deprecated: Other signals are now used to determine if a + * location is stale. + * + * Generated from protobuf field .google.protobuf.Int32Value num_stale_updates = 15 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; + * @param int|null $var + * @return $this + */ + public function setNumStaleUpdatesUnwrapped($var) + { + $this->writeWrapperValue("num_stale_updates", $var); + return $this;} + + /** + * Raw vehicle location (unprocessed by road-snapper). + * + * Generated from protobuf field .google.type.LatLng raw_location = 16; + * @return \Google\Type\LatLng|null + */ + public function getRawLocation() + { + return $this->raw_location; + } + + public function hasRawLocation() + { + return isset($this->raw_location); + } + + public function clearRawLocation() + { + unset($this->raw_location); + } + + /** + * Raw vehicle location (unprocessed by road-snapper). + * + * Generated from protobuf field .google.type.LatLng raw_location = 16; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setRawLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->raw_location = $var; + + return $this; + } + + /** + * Timestamp associated with the raw location. + * + * Generated from protobuf field .google.protobuf.Timestamp raw_location_time = 17; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRawLocationTime() + { + return $this->raw_location_time; + } + + public function hasRawLocationTime() + { + return isset($this->raw_location_time); + } + + public function clearRawLocationTime() + { + unset($this->raw_location_time); + } + + /** + * Timestamp associated with the raw location. + * + * Generated from protobuf field .google.protobuf.Timestamp raw_location_time = 17; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRawLocationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->raw_location_time = $var; + + return $this; + } + + /** + * Source of the raw location. Defaults to `GPS`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor raw_location_sensor = 28; + * @return int + */ + public function getRawLocationSensor() + { + return $this->raw_location_sensor; + } + + /** + * Source of the raw location. Defaults to `GPS`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor raw_location_sensor = 28; + * @param int $var + * @return $this + */ + public function setRawLocationSensor($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocationSensor::class); + $this->raw_location_sensor = $var; + + return $this; + } + + /** + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getRawLocationAccuracy() + { + return $this->raw_location_accuracy; + } + + public function hasRawLocationAccuracy() + { + return isset($this->raw_location_accuracy); + } + + public function clearRawLocationAccuracy() + { + unset($this->raw_location_accuracy); + } + + /** + * Returns the unboxed value from getRawLocationAccuracy() + + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + * @return float|null + */ + public function getRawLocationAccuracyUnwrapped() + { + return $this->readWrapperValue("raw_location_accuracy"); + } + + /** + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setRawLocationAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->raw_location_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `raw_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue raw_location_accuracy = 25; + * @param float|null $var + * @return $this + */ + public function setRawLocationAccuracyUnwrapped($var) + { + $this->writeWrapperValue("raw_location_accuracy", $var); + return $this;} + + /** + * Supplemental location provided by the integrating app. + * + * Generated from protobuf field .google.type.LatLng supplemental_location = 18; + * @return \Google\Type\LatLng|null + */ + public function getSupplementalLocation() + { + return $this->supplemental_location; + } + + public function hasSupplementalLocation() + { + return isset($this->supplemental_location); + } + + public function clearSupplementalLocation() + { + unset($this->supplemental_location); + } + + /** + * Supplemental location provided by the integrating app. + * + * Generated from protobuf field .google.type.LatLng supplemental_location = 18; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setSupplementalLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->supplemental_location = $var; + + return $this; + } + + /** + * Timestamp associated with the supplemental location. + * + * Generated from protobuf field .google.protobuf.Timestamp supplemental_location_time = 19; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSupplementalLocationTime() + { + return $this->supplemental_location_time; + } + + public function hasSupplementalLocationTime() + { + return isset($this->supplemental_location_time); + } + + public function clearSupplementalLocationTime() + { + unset($this->supplemental_location_time); + } + + /** + * Timestamp associated with the supplemental location. + * + * Generated from protobuf field .google.protobuf.Timestamp supplemental_location_time = 19; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSupplementalLocationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->supplemental_location_time = $var; + + return $this; + } + + /** + * Source of the supplemental location. Defaults to + * `CUSTOMER_SUPPLIED_LOCATION`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor supplemental_location_sensor = 20; + * @return int + */ + public function getSupplementalLocationSensor() + { + return $this->supplemental_location_sensor; + } + + /** + * Source of the supplemental location. Defaults to + * `CUSTOMER_SUPPLIED_LOCATION`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor supplemental_location_sensor = 20; + * @param int $var + * @return $this + */ + public function setSupplementalLocationSensor($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocationSensor::class); + $this->supplemental_location_sensor = $var; + + return $this; + } + + /** + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getSupplementalLocationAccuracy() + { + return $this->supplemental_location_accuracy; + } + + public function hasSupplementalLocationAccuracy() + { + return isset($this->supplemental_location_accuracy); + } + + public function clearSupplementalLocationAccuracy() + { + unset($this->supplemental_location_accuracy); + } + + /** + * Returns the unboxed value from getSupplementalLocationAccuracy() + + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + * @return float|null + */ + public function getSupplementalLocationAccuracyUnwrapped() + { + return $this->readWrapperValue("supplemental_location_accuracy"); + } + + /** + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setSupplementalLocationAccuracy($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->supplemental_location_accuracy = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Accuracy of `supplemental_location` as a radius, in meters. + * + * Generated from protobuf field .google.protobuf.DoubleValue supplemental_location_accuracy = 21; + * @param float|null $var + * @return $this + */ + public function setSupplementalLocationAccuracyUnwrapped($var) + { + $this->writeWrapperValue("supplemental_location_accuracy", $var); + return $this;} + + /** + * Deprecated: Use `is_road_snapped` instead. + * + * Generated from protobuf field bool road_snapped = 26 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getRoadSnapped() + { + @trigger_error('road_snapped is deprecated.', E_USER_DEPRECATED); + return $this->road_snapped; + } + + /** + * Deprecated: Use `is_road_snapped` instead. + * + * Generated from protobuf field bool road_snapped = 26 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setRoadSnapped($var) + { + @trigger_error('road_snapped is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->road_snapped = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/DeliveryVehicleLocationSensor.php b/MapsFleetEngineDelivery/src/V1/DeliveryVehicleLocationSensor.php new file mode 100644 index 000000000000..eb723fbe4a61 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/DeliveryVehicleLocationSensor.php @@ -0,0 +1,110 @@ +maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor + */ +class DeliveryVehicleLocationSensor +{ + /** + * The sensor is unspecified or unknown. + * + * Generated from protobuf enum UNKNOWN_SENSOR = 0; + */ + const UNKNOWN_SENSOR = 0; + /** + * GPS or Assisted GPS. + * + * Generated from protobuf enum GPS = 1; + */ + const GPS = 1; + /** + * Assisted GPS, cell tower ID, or WiFi access point. + * + * Generated from protobuf enum NETWORK = 2; + */ + const NETWORK = 2; + /** + * Cell tower ID or WiFi access point. + * + * Generated from protobuf enum PASSIVE = 3; + */ + const PASSIVE = 3; + /** + * A location determined by the mobile device to be the most likely + * road position. + * + * Generated from protobuf enum ROAD_SNAPPED_LOCATION_PROVIDER = 4; + */ + const ROAD_SNAPPED_LOCATION_PROVIDER = 4; + /** + * A customer-supplied location from an independent source. Typically, this + * value is used for a location provided from sources other than the mobile + * device running Driver SDK. If the original source is described by one of + * the other enum values, use that value. Locations marked + * CUSTOMER_SUPPLIED_LOCATION are typically provided via a DeliveryVehicle's + * `last_location.supplemental_location_sensor`. + * + * Generated from protobuf enum CUSTOMER_SUPPLIED_LOCATION = 5; + */ + const CUSTOMER_SUPPLIED_LOCATION = 5; + /** + * A location calculated by Fleet Engine based on the signals available to it. + * Output only. This value will be rejected if it is received in a request. + * + * Generated from protobuf enum FLEET_ENGINE_LOCATION = 6; + */ + const FLEET_ENGINE_LOCATION = 6; + /** + * Android's Fused Location Provider. + * + * Generated from protobuf enum FUSED_LOCATION_PROVIDER = 100; + */ + const FUSED_LOCATION_PROVIDER = 100; + /** + * The location provider on Apple operating systems. + * + * Generated from protobuf enum CORE_LOCATION = 200; + */ + const CORE_LOCATION = 200; + + private static $valueToName = [ + self::UNKNOWN_SENSOR => 'UNKNOWN_SENSOR', + self::GPS => 'GPS', + self::NETWORK => 'NETWORK', + self::PASSIVE => 'PASSIVE', + self::ROAD_SNAPPED_LOCATION_PROVIDER => 'ROAD_SNAPPED_LOCATION_PROVIDER', + self::CUSTOMER_SUPPLIED_LOCATION => 'CUSTOMER_SUPPLIED_LOCATION', + self::FLEET_ENGINE_LOCATION => 'FLEET_ENGINE_LOCATION', + self::FUSED_LOCATION_PROVIDER => 'FUSED_LOCATION_PROVIDER', + self::CORE_LOCATION => 'CORE_LOCATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngineDelivery/src/V1/DeliveryVehicleNavigationStatus.php b/MapsFleetEngineDelivery/src/V1/DeliveryVehicleNavigationStatus.php new file mode 100644 index 000000000000..2e8bcd7c4266 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/DeliveryVehicleNavigationStatus.php @@ -0,0 +1,76 @@ +maps.fleetengine.delivery.v1.DeliveryVehicleNavigationStatus + */ +class DeliveryVehicleNavigationStatus +{ + /** + * Unspecified navigation status. + * + * Generated from protobuf enum UNKNOWN_NAVIGATION_STATUS = 0; + */ + const UNKNOWN_NAVIGATION_STATUS = 0; + /** + * The Driver app's navigation is in `FREE_NAV` mode. + * + * Generated from protobuf enum NO_GUIDANCE = 1; + */ + const NO_GUIDANCE = 1; + /** + * Turn-by-turn navigation is available and the Driver app navigation has + * entered `GUIDED_NAV` mode. + * + * Generated from protobuf enum ENROUTE_TO_DESTINATION = 2; + */ + const ENROUTE_TO_DESTINATION = 2; + /** + * The vehicle has gone off the suggested route. + * + * Generated from protobuf enum OFF_ROUTE = 3; + */ + const OFF_ROUTE = 3; + /** + * The vehicle is within approximately 50m of the destination. + * + * Generated from protobuf enum ARRIVED_AT_DESTINATION = 4; + */ + const ARRIVED_AT_DESTINATION = 4; + + private static $valueToName = [ + self::UNKNOWN_NAVIGATION_STATUS => 'UNKNOWN_NAVIGATION_STATUS', + self::NO_GUIDANCE => 'NO_GUIDANCE', + self::ENROUTE_TO_DESTINATION => 'ENROUTE_TO_DESTINATION', + self::OFF_ROUTE => 'OFF_ROUTE', + self::ARRIVED_AT_DESTINATION => 'ARRIVED_AT_DESTINATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsFleetEngineDelivery/src/V1/GetDeliveryVehicleRequest.php b/MapsFleetEngineDelivery/src/V1/GetDeliveryVehicleRequest.php new file mode 100644 index 000000000000..20719e8f261d --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/GetDeliveryVehicleRequest.php @@ -0,0 +1,140 @@ +maps.fleetengine.delivery.v1.GetDeliveryVehicleRequest + */ +class GetDeliveryVehicleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. Must be in the format + * `providers/{provider}/deliveryVehicles/{delivery_vehicle}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Must be in the format + * `providers/{provider}/deliveryVehicles/{delivery_vehicle}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. Please see + * {@see DeliveryServiceClient::deliveryVehicleName()} for help formatting this field. + * + * @return \Google\Maps\FleetEngine\Delivery\V1\GetDeliveryVehicleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * @type string $name + * Required. Must be in the format + * `providers/{provider}/deliveryVehicles/{delivery_vehicle}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format + * `providers/{provider}/deliveryVehicles/{delivery_vehicle}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Must be in the format + * `providers/{provider}/deliveryVehicles/{delivery_vehicle}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/GetTaskRequest.php b/MapsFleetEngineDelivery/src/V1/GetTaskRequest.php new file mode 100644 index 000000000000..019e1e9dc29d --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/GetTaskRequest.php @@ -0,0 +1,135 @@ +maps.fleetengine.delivery.v1.GetTaskRequest + */ +class GetTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}/tasks/{task}`. The + * `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Must be in the format `providers/{provider}/tasks/{task}`. The + * `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. Please see + * {@see DeliveryServiceClient::taskName()} for help formatting this field. + * + * @return \Google\Maps\FleetEngine\Delivery\V1\GetTaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * @type string $name + * Required. Must be in the format `providers/{provider}/tasks/{task}`. The + * `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}/tasks/{task}`. The + * `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Must be in the format `providers/{provider}/tasks/{task}`. The + * `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/GetTaskTrackingInfoRequest.php b/MapsFleetEngineDelivery/src/V1/GetTaskTrackingInfoRequest.php new file mode 100644 index 000000000000..022c8c8f04b0 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/GetTaskTrackingInfoRequest.php @@ -0,0 +1,145 @@ +maps.fleetengine.delivery.v1.GetTaskTrackingInfoRequest + */ +class GetTaskTrackingInfoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. Must be in the format + * `providers/{provider}/taskTrackingInfo/{tracking_id}`. The `provider` + * must be the Google Cloud Project ID, and the `tracking_id` must be the + * tracking ID associated with the task. An example name can be + * `providers/sample-cloud-project/taskTrackingInfo/sample-tracking-id`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Must be in the format + * `providers/{provider}/taskTrackingInfo/{tracking_id}`. The `provider` + * must be the Google Cloud Project ID, and the `tracking_id` must be the + * tracking ID associated with the task. An example name can be + * `providers/sample-cloud-project/taskTrackingInfo/sample-tracking-id`. Please see + * {@see DeliveryServiceClient::taskTrackingInfoName()} for help formatting this field. + * + * @return \Google\Maps\FleetEngine\Delivery\V1\GetTaskTrackingInfoRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * @type string $name + * Required. Must be in the format + * `providers/{provider}/taskTrackingInfo/{tracking_id}`. The `provider` + * must be the Google Cloud Project ID, and the `tracking_id` must be the + * tracking ID associated with the task. An example name can be + * `providers/sample-cloud-project/taskTrackingInfo/sample-tracking-id`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format + * `providers/{provider}/taskTrackingInfo/{tracking_id}`. The `provider` + * must be the Google Cloud Project ID, and the `tracking_id` must be the + * tracking ID associated with the task. An example name can be + * `providers/sample-cloud-project/taskTrackingInfo/sample-tracking-id`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Must be in the format + * `providers/{provider}/taskTrackingInfo/{tracking_id}`. The `provider` + * must be the Google Cloud Project ID, and the `tracking_id` must be the + * tracking ID associated with the task. An example name can be + * `providers/sample-cloud-project/taskTrackingInfo/sample-tracking-id`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/ListDeliveryVehiclesRequest.php b/MapsFleetEngineDelivery/src/V1/ListDeliveryVehiclesRequest.php new file mode 100644 index 000000000000..6bdedae146df --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/ListDeliveryVehiclesRequest.php @@ -0,0 +1,365 @@ +maps.fleetengine.delivery.v1.ListDeliveryVehiclesRequest + */ +class ListDeliveryVehiclesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. + * For example, `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of vehicles to return. The service may return + * fewer than this number. If you don't specify this number, then the server + * determines the number of results to return. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListDeliveryVehicles` + * call. You must provide this in order to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDeliveryVehicles` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter query to apply when listing delivery vehicles. See + * http://aip.dev/160 for examples of the filter syntax. If you don't specify + * a value, or if you specify an empty string for the filter, then all + * delivery vehicles are returned. + * Note that the only queries supported for `ListDeliveryVehicles` are + * on vehicle attributes (for example, `attributes. = ` or + * `attributes. = AND attributes. = `). Also, all + * attributes are stored as strings, so the only supported comparisons against + * attributes are string comparisons. In order to compare against number or + * boolean values, the values must be explicitly quoted to be treated as + * strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * The maximum number of restrictions allowed in a filter query is 50. A + * restriction is a part of the query of the form + * `attribute. `, for example `attributes.foo = bar` + * is 1 restriction. + * + * Generated from protobuf field string filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. A filter that limits the vehicles returned to those whose last + * known location was in the rectangular area defined by the viewport. + * + * Generated from protobuf field .google.geo.type.Viewport viewport = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $viewport = null; + + /** + * @param string $parent Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. + * For example, `sample-cloud-project`. Please see + * {@see DeliveryServiceClient::providerName()} for help formatting this field. + * + * @return \Google\Maps\FleetEngine\Delivery\V1\ListDeliveryVehiclesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * @type string $parent + * Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. + * For example, `sample-cloud-project`. + * @type int $page_size + * Optional. The maximum number of vehicles to return. The service may return + * fewer than this number. If you don't specify this number, then the server + * determines the number of results to return. + * @type string $page_token + * Optional. A page token, received from a previous `ListDeliveryVehicles` + * call. You must provide this in order to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDeliveryVehicles` + * must match the call that provided the page token. + * @type string $filter + * Optional. A filter query to apply when listing delivery vehicles. See + * http://aip.dev/160 for examples of the filter syntax. If you don't specify + * a value, or if you specify an empty string for the filter, then all + * delivery vehicles are returned. + * Note that the only queries supported for `ListDeliveryVehicles` are + * on vehicle attributes (for example, `attributes. = ` or + * `attributes. = AND attributes. = `). Also, all + * attributes are stored as strings, so the only supported comparisons against + * attributes are string comparisons. In order to compare against number or + * boolean values, the values must be explicitly quoted to be treated as + * strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * The maximum number of restrictions allowed in a filter query is 50. A + * restriction is a part of the query of the form + * `attribute. `, for example `attributes.foo = bar` + * is 1 restriction. + * @type \Google\Geo\Type\Viewport $viewport + * Optional. A filter that limits the vehicles returned to those whose last + * known location was in the rectangular area defined by the viewport. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. + * For example, `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. + * For example, `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of vehicles to return. The service may return + * fewer than this number. If you don't specify this number, then the server + * determines the number of results to return. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of vehicles to return. The service may return + * fewer than this number. If you don't specify this number, then the server + * determines the number of results to return. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListDeliveryVehicles` + * call. You must provide this in order to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDeliveryVehicles` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListDeliveryVehicles` + * call. You must provide this in order to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDeliveryVehicles` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter query to apply when listing delivery vehicles. See + * http://aip.dev/160 for examples of the filter syntax. If you don't specify + * a value, or if you specify an empty string for the filter, then all + * delivery vehicles are returned. + * Note that the only queries supported for `ListDeliveryVehicles` are + * on vehicle attributes (for example, `attributes. = ` or + * `attributes. = AND attributes. = `). Also, all + * attributes are stored as strings, so the only supported comparisons against + * attributes are string comparisons. In order to compare against number or + * boolean values, the values must be explicitly quoted to be treated as + * strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * The maximum number of restrictions allowed in a filter query is 50. A + * restriction is a part of the query of the form + * `attribute. `, for example `attributes.foo = bar` + * is 1 restriction. + * + * Generated from protobuf field string filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter query to apply when listing delivery vehicles. See + * http://aip.dev/160 for examples of the filter syntax. If you don't specify + * a value, or if you specify an empty string for the filter, then all + * delivery vehicles are returned. + * Note that the only queries supported for `ListDeliveryVehicles` are + * on vehicle attributes (for example, `attributes. = ` or + * `attributes. = AND attributes. = `). Also, all + * attributes are stored as strings, so the only supported comparisons against + * attributes are string comparisons. In order to compare against number or + * boolean values, the values must be explicitly quoted to be treated as + * strings (for example, `attributes. = "10"` or + * `attributes. = "true"`). + * The maximum number of restrictions allowed in a filter query is 50. A + * restriction is a part of the query of the form + * `attribute. `, for example `attributes.foo = bar` + * is 1 restriction. + * + * Generated from protobuf field string filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. A filter that limits the vehicles returned to those whose last + * known location was in the rectangular area defined by the viewport. + * + * Generated from protobuf field .google.geo.type.Viewport viewport = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Geo\Type\Viewport|null + */ + public function getViewport() + { + return $this->viewport; + } + + public function hasViewport() + { + return isset($this->viewport); + } + + public function clearViewport() + { + unset($this->viewport); + } + + /** + * Optional. A filter that limits the vehicles returned to those whose last + * known location was in the rectangular area defined by the viewport. + * + * Generated from protobuf field .google.geo.type.Viewport viewport = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Geo\Type\Viewport $var + * @return $this + */ + public function setViewport($var) + { + GPBUtil::checkMessage($var, \Google\Geo\Type\Viewport::class); + $this->viewport = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/ListDeliveryVehiclesResponse.php b/MapsFleetEngineDelivery/src/V1/ListDeliveryVehiclesResponse.php new file mode 100644 index 000000000000..286675bd84db --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/ListDeliveryVehiclesResponse.php @@ -0,0 +1,159 @@ +maps.fleetengine.delivery.v1.ListDeliveryVehiclesResponse + */ +class ListDeliveryVehiclesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The set of delivery vehicles that meet the requested filtering criteria. + * When no filter is specified, the request returns all delivery vehicles. A + * successful response can also be empty. An empty response indicates that no + * delivery vehicles were found meeting the requested filter criteria. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.DeliveryVehicle delivery_vehicles = 1; + */ + private $delivery_vehicles; + /** + * You can pass this token in the `ListDeliveryVehiclesRequest` to continue to + * list results. When all of the results are returned, this field won't be in + * the response, or it will be an empty string. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of delivery vehicles that match the request criteria, + * across all pages. + * + * Generated from protobuf field int64 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle>|\Google\Protobuf\Internal\RepeatedField $delivery_vehicles + * The set of delivery vehicles that meet the requested filtering criteria. + * When no filter is specified, the request returns all delivery vehicles. A + * successful response can also be empty. An empty response indicates that no + * delivery vehicles were found meeting the requested filter criteria. + * @type string $next_page_token + * You can pass this token in the `ListDeliveryVehiclesRequest` to continue to + * list results. When all of the results are returned, this field won't be in + * the response, or it will be an empty string. + * @type int|string $total_size + * The total number of delivery vehicles that match the request criteria, + * across all pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * The set of delivery vehicles that meet the requested filtering criteria. + * When no filter is specified, the request returns all delivery vehicles. A + * successful response can also be empty. An empty response indicates that no + * delivery vehicles were found meeting the requested filter criteria. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.DeliveryVehicle delivery_vehicles = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDeliveryVehicles() + { + return $this->delivery_vehicles; + } + + /** + * The set of delivery vehicles that meet the requested filtering criteria. + * When no filter is specified, the request returns all delivery vehicles. A + * successful response can also be empty. An empty response indicates that no + * delivery vehicles were found meeting the requested filter criteria. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.DeliveryVehicle delivery_vehicles = 1; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDeliveryVehicles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle::class); + $this->delivery_vehicles = $arr; + + return $this; + } + + /** + * You can pass this token in the `ListDeliveryVehiclesRequest` to continue to + * list results. When all of the results are returned, this field won't be in + * the response, or it will be an empty string. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * You can pass this token in the `ListDeliveryVehiclesRequest` to continue to + * list results. When all of the results are returned, this field won't be in + * the response, or it will be an empty string. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * The total number of delivery vehicles that match the request criteria, + * across all pages. + * + * Generated from protobuf field int64 total_size = 3; + * @return int|string + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of delivery vehicles that match the request criteria, + * across all pages. + * + * Generated from protobuf field int64 total_size = 3; + * @param int|string $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt64($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/ListTasksRequest.php b/MapsFleetEngineDelivery/src/V1/ListTasksRequest.php new file mode 100644 index 000000000000..3e3592ff11e8 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/ListTasksRequest.php @@ -0,0 +1,273 @@ +maps.fleetengine.delivery.v1.ListTasksRequest + */ +class ListTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of Tasks to return. The service may return + * fewer than this value. If you don't specify this value, then the server + * determines the number of results to return. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token received from a previous `ListTasks` call. + * You can provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTasks` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter query to apply when listing Tasks. See + * http://aip.dev/160 for examples of filter syntax. If you don't specify a + * value, or if you filter on an empty string, then all Tasks are returned. + * For information about the Task properties that you can filter on, see [List + * tasks](https://developers.google.com/maps/documentation/transportation-logistics/last-mile-fleet-solution/fleet-performance/fleet-engine/deliveries_api#list-tasks). + * + * Generated from protobuf field string filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. Please see + * {@see DeliveryServiceClient::providerName()} for help formatting this field. + * + * @return \Google\Maps\FleetEngine\Delivery\V1\ListTasksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * @type string $parent + * Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * @type int $page_size + * Optional. The maximum number of Tasks to return. The service may return + * fewer than this value. If you don't specify this value, then the server + * determines the number of results to return. + * @type string $page_token + * Optional. A page token received from a previous `ListTasks` call. + * You can provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTasks` must match + * the call that provided the page token. + * @type string $filter + * Optional. A filter query to apply when listing Tasks. See + * http://aip.dev/160 for examples of filter syntax. If you don't specify a + * value, or if you filter on an empty string, then all Tasks are returned. + * For information about the Task properties that you can filter on, see [List + * tasks](https://developers.google.com/maps/documentation/transportation-logistics/last-mile-fleet-solution/fleet-performance/fleet-engine/deliveries_api#list-tasks). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Must be in the format `providers/{provider}`. + * The `provider` must be the Google Cloud Project ID. For example, + * `sample-cloud-project`. + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of Tasks to return. The service may return + * fewer than this value. If you don't specify this value, then the server + * determines the number of results to return. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of Tasks to return. The service may return + * fewer than this value. If you don't specify this value, then the server + * determines the number of results to return. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token received from a previous `ListTasks` call. + * You can provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTasks` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token received from a previous `ListTasks` call. + * You can provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTasks` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter query to apply when listing Tasks. See + * http://aip.dev/160 for examples of filter syntax. If you don't specify a + * value, or if you filter on an empty string, then all Tasks are returned. + * For information about the Task properties that you can filter on, see [List + * tasks](https://developers.google.com/maps/documentation/transportation-logistics/last-mile-fleet-solution/fleet-performance/fleet-engine/deliveries_api#list-tasks). + * + * Generated from protobuf field string filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter query to apply when listing Tasks. See + * http://aip.dev/160 for examples of filter syntax. If you don't specify a + * value, or if you filter on an empty string, then all Tasks are returned. + * For information about the Task properties that you can filter on, see [List + * tasks](https://developers.google.com/maps/documentation/transportation-logistics/last-mile-fleet-solution/fleet-performance/fleet-engine/deliveries_api#list-tasks). + * + * Generated from protobuf field string filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/ListTasksResponse.php b/MapsFleetEngineDelivery/src/V1/ListTasksResponse.php new file mode 100644 index 000000000000..6ff86766b915 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/ListTasksResponse.php @@ -0,0 +1,160 @@ +maps.fleetengine.delivery.v1.ListTasksResponse + */ +class ListTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The set of Tasks that meet the requested filtering criteria. When no filter + * is specified, the request returns all tasks. A successful response can also + * be empty. An empty response indicates that no Tasks were found meeting the + * requested filter criteria. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.Task tasks = 1; + */ + private $tasks; + /** + * Pass this token in the `ListTasksRequest` to continue to list results. + * If all results have been returned, then this field is either an empty + * string, or it doesn't appear in the response. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of Tasks that match the request criteria, across all + * pages. + * + * Generated from protobuf field int64 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\Delivery\V1\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * The set of Tasks that meet the requested filtering criteria. When no filter + * is specified, the request returns all tasks. A successful response can also + * be empty. An empty response indicates that no Tasks were found meeting the + * requested filter criteria. + * @type string $next_page_token + * Pass this token in the `ListTasksRequest` to continue to list results. + * If all results have been returned, then this field is either an empty + * string, or it doesn't appear in the response. + * @type int|string $total_size + * The total number of Tasks that match the request criteria, across all + * pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * The set of Tasks that meet the requested filtering criteria. When no filter + * is specified, the request returns all tasks. A successful response can also + * be empty. An empty response indicates that no Tasks were found meeting the + * requested filter criteria. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The set of Tasks that meet the requested filtering criteria. When no filter + * is specified, the request returns all tasks. A successful response can also + * be empty. An empty response indicates that no Tasks were found meeting the + * requested filter criteria. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.Task tasks = 1; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\Task::class); + $this->tasks = $arr; + + return $this; + } + + /** + * Pass this token in the `ListTasksRequest` to continue to list results. + * If all results have been returned, then this field is either an empty + * string, or it doesn't appear in the response. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pass this token in the `ListTasksRequest` to continue to list results. + * If all results have been returned, then this field is either an empty + * string, or it doesn't appear in the response. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * The total number of Tasks that match the request criteria, across all + * pages. + * + * Generated from protobuf field int64 total_size = 3; + * @return int|string + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of Tasks that match the request criteria, across all + * pages. + * + * Generated from protobuf field int64 total_size = 3; + * @param int|string $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt64($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/LocationInfo.php b/MapsFleetEngineDelivery/src/V1/LocationInfo.php new file mode 100644 index 000000000000..6c8597013b43 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/LocationInfo.php @@ -0,0 +1,77 @@ +maps.fleetengine.delivery.v1.LocationInfo + */ +class LocationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The location's coordinates. + * + * Generated from protobuf field .google.type.LatLng point = 1; + */ + protected $point = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $point + * The location's coordinates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryVehicles::initOnce(); + parent::__construct($data); + } + + /** + * The location's coordinates. + * + * Generated from protobuf field .google.type.LatLng point = 1; + * @return \Google\Type\LatLng|null + */ + public function getPoint() + { + return $this->point; + } + + public function hasPoint() + { + return isset($this->point); + } + + public function clearPoint() + { + unset($this->point); + } + + /** + * The location's coordinates. + * + * Generated from protobuf field .google.type.LatLng point = 1; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setPoint($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->point = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/Task.php b/MapsFleetEngineDelivery/src/V1/Task.php new file mode 100644 index 000000000000..66471744ba32 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/Task.php @@ -0,0 +1,720 @@ +maps.fleetengine.delivery.v1.Task + */ +class Task extends \Google\Protobuf\Internal\Message +{ + /** + * Must be in the format `providers/{provider}/tasks/{task}`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. Immutable. Defines the type of the Task. For example, a break or + * shipment. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $type = 0; + /** + * Required. The current execution state of the Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.State state = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $state = 0; + /** + * The outcome of the Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.TaskOutcome task_outcome = 9; + */ + protected $task_outcome = 0; + /** + * The timestamp that indicates when the `Task`'s outcome was set by the + * provider. + * + * Generated from protobuf field .google.protobuf.Timestamp task_outcome_time = 10; + */ + protected $task_outcome_time = null; + /** + * The location where the `Task`'s outcome was set. This value is updated as + * part of `UpdateTask`. If this value isn't explicitly updated by the + * provider, then Fleet Engine populates it by default with the last known + * vehicle location (the *raw* location). + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo task_outcome_location = 11; + */ + protected $task_outcome_location = null; + /** + * Indicates where the value of the `task_outcome_location` came from. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.TaskOutcomeLocationSource task_outcome_location_source = 12; + */ + protected $task_outcome_location_source = 0; + /** + * Immutable. This field facilitates the storing of an ID so you can avoid + * using a complicated mapping. You cannot set `tracking_id` for Tasks of type + * `UNAVAILABLE` and `SCHEDULED_STOP`. These IDs are subject to the + * following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string tracking_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $tracking_id = ''; + /** + * Output only. The ID of the vehicle that is executing this Task. Delivery + * Vehicle IDs are subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string delivery_vehicle_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delivery_vehicle_id = ''; + /** + * Immutable. The location where the Task will be completed. + * Optional for `UNAVAILABLE` Tasks, but required for all other Tasks. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo planned_location = 6 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $planned_location = null; + /** + * Required. Immutable. The time needed to execute a Task at this location. + * + * Generated from protobuf field .google.protobuf.Duration task_duration = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $task_duration = null; + /** + * The time window during which the task should be completed. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TimeWindow target_time_window = 14; + */ + protected $target_time_window = null; + /** + * Output only. Journey sharing-specific fields. Not populated when state is + * `CLOSED`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.JourneySharingInfo journey_sharing_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $journey_sharing_info = null; + /** + * The configuration for task tracking that specifies which data elements are + * visible to the end users under what circumstances. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig task_tracking_view_config = 13; + */ + protected $task_tracking_view_config = null; + /** + * A list of custom Task attributes. Each attribute must have a unique key. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.TaskAttribute attributes = 15; + */ + private $attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Must be in the format `providers/{provider}/tasks/{task}`. + * @type int $type + * Required. Immutable. Defines the type of the Task. For example, a break or + * shipment. + * @type int $state + * Required. The current execution state of the Task. + * @type int $task_outcome + * The outcome of the Task. + * @type \Google\Protobuf\Timestamp $task_outcome_time + * The timestamp that indicates when the `Task`'s outcome was set by the + * provider. + * @type \Google\Maps\FleetEngine\Delivery\V1\LocationInfo $task_outcome_location + * The location where the `Task`'s outcome was set. This value is updated as + * part of `UpdateTask`. If this value isn't explicitly updated by the + * provider, then Fleet Engine populates it by default with the last known + * vehicle location (the *raw* location). + * @type int $task_outcome_location_source + * Indicates where the value of the `task_outcome_location` came from. + * @type string $tracking_id + * Immutable. This field facilitates the storing of an ID so you can avoid + * using a complicated mapping. You cannot set `tracking_id` for Tasks of type + * `UNAVAILABLE` and `SCHEDULED_STOP`. These IDs are subject to the + * following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * @type string $delivery_vehicle_id + * Output only. The ID of the vehicle that is executing this Task. Delivery + * Vehicle IDs are subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * @type \Google\Maps\FleetEngine\Delivery\V1\LocationInfo $planned_location + * Immutable. The location where the Task will be completed. + * Optional for `UNAVAILABLE` Tasks, but required for all other Tasks. + * @type \Google\Protobuf\Duration $task_duration + * Required. Immutable. The time needed to execute a Task at this location. + * @type \Google\Maps\FleetEngine\Delivery\V1\TimeWindow $target_time_window + * The time window during which the task should be completed. + * @type \Google\Maps\FleetEngine\Delivery\V1\Task\JourneySharingInfo $journey_sharing_info + * Output only. Journey sharing-specific fields. Not populated when state is + * `CLOSED`. + * @type \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig $task_tracking_view_config + * The configuration for task tracking that specifies which data elements are + * visible to the end users under what circumstances. + * @type array<\Google\Maps\FleetEngine\Delivery\V1\TaskAttribute>|\Google\Protobuf\Internal\RepeatedField $attributes + * A list of custom Task attributes. Each attribute must have a unique key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Tasks::initOnce(); + parent::__construct($data); + } + + /** + * Must be in the format `providers/{provider}/tasks/{task}`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Must be in the format `providers/{provider}/tasks/{task}`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Immutable. Defines the type of the Task. For example, a break or + * shipment. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. Immutable. Defines the type of the Task. For example, a break or + * shipment. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\Task\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Required. The current execution state of the Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.State state = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Required. The current execution state of the Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.State state = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\Task\State::class); + $this->state = $var; + + return $this; + } + + /** + * The outcome of the Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.TaskOutcome task_outcome = 9; + * @return int + */ + public function getTaskOutcome() + { + return $this->task_outcome; + } + + /** + * The outcome of the Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.TaskOutcome task_outcome = 9; + * @param int $var + * @return $this + */ + public function setTaskOutcome($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\Task\TaskOutcome::class); + $this->task_outcome = $var; + + return $this; + } + + /** + * The timestamp that indicates when the `Task`'s outcome was set by the + * provider. + * + * Generated from protobuf field .google.protobuf.Timestamp task_outcome_time = 10; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTaskOutcomeTime() + { + return $this->task_outcome_time; + } + + public function hasTaskOutcomeTime() + { + return isset($this->task_outcome_time); + } + + public function clearTaskOutcomeTime() + { + unset($this->task_outcome_time); + } + + /** + * The timestamp that indicates when the `Task`'s outcome was set by the + * provider. + * + * Generated from protobuf field .google.protobuf.Timestamp task_outcome_time = 10; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTaskOutcomeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->task_outcome_time = $var; + + return $this; + } + + /** + * The location where the `Task`'s outcome was set. This value is updated as + * part of `UpdateTask`. If this value isn't explicitly updated by the + * provider, then Fleet Engine populates it by default with the last known + * vehicle location (the *raw* location). + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo task_outcome_location = 11; + * @return \Google\Maps\FleetEngine\Delivery\V1\LocationInfo|null + */ + public function getTaskOutcomeLocation() + { + return $this->task_outcome_location; + } + + public function hasTaskOutcomeLocation() + { + return isset($this->task_outcome_location); + } + + public function clearTaskOutcomeLocation() + { + unset($this->task_outcome_location); + } + + /** + * The location where the `Task`'s outcome was set. This value is updated as + * part of `UpdateTask`. If this value isn't explicitly updated by the + * provider, then Fleet Engine populates it by default with the last known + * vehicle location (the *raw* location). + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo task_outcome_location = 11; + * @param \Google\Maps\FleetEngine\Delivery\V1\LocationInfo $var + * @return $this + */ + public function setTaskOutcomeLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\LocationInfo::class); + $this->task_outcome_location = $var; + + return $this; + } + + /** + * Indicates where the value of the `task_outcome_location` came from. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.TaskOutcomeLocationSource task_outcome_location_source = 12; + * @return int + */ + public function getTaskOutcomeLocationSource() + { + return $this->task_outcome_location_source; + } + + /** + * Indicates where the value of the `task_outcome_location` came from. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.TaskOutcomeLocationSource task_outcome_location_source = 12; + * @param int $var + * @return $this + */ + public function setTaskOutcomeLocationSource($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\Task\TaskOutcomeLocationSource::class); + $this->task_outcome_location_source = $var; + + return $this; + } + + /** + * Immutable. This field facilitates the storing of an ID so you can avoid + * using a complicated mapping. You cannot set `tracking_id` for Tasks of type + * `UNAVAILABLE` and `SCHEDULED_STOP`. These IDs are subject to the + * following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string tracking_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getTrackingId() + { + return $this->tracking_id; + } + + /** + * Immutable. This field facilitates the storing of an ID so you can avoid + * using a complicated mapping. You cannot set `tracking_id` for Tasks of type + * `UNAVAILABLE` and `SCHEDULED_STOP`. These IDs are subject to the + * following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string tracking_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setTrackingId($var) + { + GPBUtil::checkString($var, True); + $this->tracking_id = $var; + + return $this; + } + + /** + * Output only. The ID of the vehicle that is executing this Task. Delivery + * Vehicle IDs are subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string delivery_vehicle_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDeliveryVehicleId() + { + return $this->delivery_vehicle_id; + } + + /** + * Output only. The ID of the vehicle that is executing this Task. Delivery + * Vehicle IDs are subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string delivery_vehicle_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDeliveryVehicleId($var) + { + GPBUtil::checkString($var, True); + $this->delivery_vehicle_id = $var; + + return $this; + } + + /** + * Immutable. The location where the Task will be completed. + * Optional for `UNAVAILABLE` Tasks, but required for all other Tasks. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo planned_location = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Maps\FleetEngine\Delivery\V1\LocationInfo|null + */ + public function getPlannedLocation() + { + return $this->planned_location; + } + + public function hasPlannedLocation() + { + return isset($this->planned_location); + } + + public function clearPlannedLocation() + { + unset($this->planned_location); + } + + /** + * Immutable. The location where the Task will be completed. + * Optional for `UNAVAILABLE` Tasks, but required for all other Tasks. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo planned_location = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Maps\FleetEngine\Delivery\V1\LocationInfo $var + * @return $this + */ + public function setPlannedLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\LocationInfo::class); + $this->planned_location = $var; + + return $this; + } + + /** + * Required. Immutable. The time needed to execute a Task at this location. + * + * Generated from protobuf field .google.protobuf.Duration task_duration = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Duration|null + */ + public function getTaskDuration() + { + return $this->task_duration; + } + + public function hasTaskDuration() + { + return isset($this->task_duration); + } + + public function clearTaskDuration() + { + unset($this->task_duration); + } + + /** + * Required. Immutable. The time needed to execute a Task at this location. + * + * Generated from protobuf field .google.protobuf.Duration task_duration = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTaskDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->task_duration = $var; + + return $this; + } + + /** + * The time window during which the task should be completed. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TimeWindow target_time_window = 14; + * @return \Google\Maps\FleetEngine\Delivery\V1\TimeWindow|null + */ + public function getTargetTimeWindow() + { + return $this->target_time_window; + } + + public function hasTargetTimeWindow() + { + return isset($this->target_time_window); + } + + public function clearTargetTimeWindow() + { + unset($this->target_time_window); + } + + /** + * The time window during which the task should be completed. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TimeWindow target_time_window = 14; + * @param \Google\Maps\FleetEngine\Delivery\V1\TimeWindow $var + * @return $this + */ + public function setTargetTimeWindow($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TimeWindow::class); + $this->target_time_window = $var; + + return $this; + } + + /** + * Output only. Journey sharing-specific fields. Not populated when state is + * `CLOSED`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.JourneySharingInfo journey_sharing_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Maps\FleetEngine\Delivery\V1\Task\JourneySharingInfo|null + */ + public function getJourneySharingInfo() + { + return $this->journey_sharing_info; + } + + public function hasJourneySharingInfo() + { + return isset($this->journey_sharing_info); + } + + public function clearJourneySharingInfo() + { + unset($this->journey_sharing_info); + } + + /** + * Output only. Journey sharing-specific fields. Not populated when state is + * `CLOSED`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.JourneySharingInfo journey_sharing_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Maps\FleetEngine\Delivery\V1\Task\JourneySharingInfo $var + * @return $this + */ + public function setJourneySharingInfo($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\Task\JourneySharingInfo::class); + $this->journey_sharing_info = $var; + + return $this; + } + + /** + * The configuration for task tracking that specifies which data elements are + * visible to the end users under what circumstances. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig task_tracking_view_config = 13; + * @return \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig|null + */ + public function getTaskTrackingViewConfig() + { + return $this->task_tracking_view_config; + } + + public function hasTaskTrackingViewConfig() + { + return isset($this->task_tracking_view_config); + } + + public function clearTaskTrackingViewConfig() + { + unset($this->task_tracking_view_config); + } + + /** + * The configuration for task tracking that specifies which data elements are + * visible to the end users under what circumstances. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig task_tracking_view_config = 13; + * @param \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig $var + * @return $this + */ + public function setTaskTrackingViewConfig($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig::class); + $this->task_tracking_view_config = $var; + + return $this; + } + + /** + * A list of custom Task attributes. Each attribute must have a unique key. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.TaskAttribute attributes = 15; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * A list of custom Task attributes. Each attribute must have a unique key. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.TaskAttribute attributes = 15; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\TaskAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\TaskAttribute::class); + $this->attributes = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/Task/JourneySharingInfo.php b/MapsFleetEngineDelivery/src/V1/Task/JourneySharingInfo.php new file mode 100644 index 000000000000..77d6f4b9f2fc --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/Task/JourneySharingInfo.php @@ -0,0 +1,214 @@ +maps.fleetengine.delivery.v1.Task.JourneySharingInfo + */ +class JourneySharingInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Tracking information for the stops that the assigned vehicle will make + * before it completes this Task. Note that this list can contain stops + * from other tasks. + * The first segment, + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0]` (gRPC) + * or `Task.journeySharingInfo.remainingVehicleJourneySegments[0]` (REST), + * contains route information from the driver's last known location to the + * upcoming `VehicleStop`. Current route information usually comes from the + * driver app, except for some cases noted in the documentation for + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * The other segments in + * `Task.journey_sharing_info.remaining_vehicle_journey_segments` (gRPC) or + * `Task.journeySharingInfo.remainingVehicleJourneySegments` (REST) are + * populated by Fleet Engine. They provide route information between the + * remaining `VehicleStops`. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.VehicleJourneySegment remaining_vehicle_journey_segments = 1; + */ + private $remaining_vehicle_journey_segments; + /** + * Indicates the vehicle's last reported location of the assigned vehicle. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocation last_location = 2; + */ + protected $last_location = null; + /** + * Indicates whether the vehicle's lastLocation can be snapped to + * the `current_route_segment`. This value is False if either + * `last_location` or `current_route_segment` don't exist. This value is + * computed by Fleet Engine. Updates from clients are ignored. + * + * Generated from protobuf field bool last_location_snappable = 3; + */ + protected $last_location_snappable = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment>|\Google\Protobuf\Internal\RepeatedField $remaining_vehicle_journey_segments + * Tracking information for the stops that the assigned vehicle will make + * before it completes this Task. Note that this list can contain stops + * from other tasks. + * The first segment, + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0]` (gRPC) + * or `Task.journeySharingInfo.remainingVehicleJourneySegments[0]` (REST), + * contains route information from the driver's last known location to the + * upcoming `VehicleStop`. Current route information usually comes from the + * driver app, except for some cases noted in the documentation for + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * The other segments in + * `Task.journey_sharing_info.remaining_vehicle_journey_segments` (gRPC) or + * `Task.journeySharingInfo.remainingVehicleJourneySegments` (REST) are + * populated by Fleet Engine. They provide route information between the + * remaining `VehicleStops`. + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation $last_location + * Indicates the vehicle's last reported location of the assigned vehicle. + * @type bool $last_location_snappable + * Indicates whether the vehicle's lastLocation can be snapped to + * the `current_route_segment`. This value is False if either + * `last_location` or `current_route_segment` don't exist. This value is + * computed by Fleet Engine. Updates from clients are ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Tasks::initOnce(); + parent::__construct($data); + } + + /** + * Tracking information for the stops that the assigned vehicle will make + * before it completes this Task. Note that this list can contain stops + * from other tasks. + * The first segment, + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0]` (gRPC) + * or `Task.journeySharingInfo.remainingVehicleJourneySegments[0]` (REST), + * contains route information from the driver's last known location to the + * upcoming `VehicleStop`. Current route information usually comes from the + * driver app, except for some cases noted in the documentation for + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * The other segments in + * `Task.journey_sharing_info.remaining_vehicle_journey_segments` (gRPC) or + * `Task.journeySharingInfo.remainingVehicleJourneySegments` (REST) are + * populated by Fleet Engine. They provide route information between the + * remaining `VehicleStops`. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.VehicleJourneySegment remaining_vehicle_journey_segments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRemainingVehicleJourneySegments() + { + return $this->remaining_vehicle_journey_segments; + } + + /** + * Tracking information for the stops that the assigned vehicle will make + * before it completes this Task. Note that this list can contain stops + * from other tasks. + * The first segment, + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0]` (gRPC) + * or `Task.journeySharingInfo.remainingVehicleJourneySegments[0]` (REST), + * contains route information from the driver's last known location to the + * upcoming `VehicleStop`. Current route information usually comes from the + * driver app, except for some cases noted in the documentation for + * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. + * The other segments in + * `Task.journey_sharing_info.remaining_vehicle_journey_segments` (gRPC) or + * `Task.journeySharingInfo.remainingVehicleJourneySegments` (REST) are + * populated by Fleet Engine. They provide route information between the + * remaining `VehicleStops`. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.VehicleJourneySegment remaining_vehicle_journey_segments = 1; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRemainingVehicleJourneySegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment::class); + $this->remaining_vehicle_journey_segments = $arr; + + return $this; + } + + /** + * Indicates the vehicle's last reported location of the assigned vehicle. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocation last_location = 2; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation|null + */ + public function getLastLocation() + { + return $this->last_location; + } + + public function hasLastLocation() + { + return isset($this->last_location); + } + + public function clearLastLocation() + { + unset($this->last_location); + } + + /** + * Indicates the vehicle's last reported location of the assigned vehicle. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocation last_location = 2; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation $var + * @return $this + */ + public function setLastLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation::class); + $this->last_location = $var; + + return $this; + } + + /** + * Indicates whether the vehicle's lastLocation can be snapped to + * the `current_route_segment`. This value is False if either + * `last_location` or `current_route_segment` don't exist. This value is + * computed by Fleet Engine. Updates from clients are ignored. + * + * Generated from protobuf field bool last_location_snappable = 3; + * @return bool + */ + public function getLastLocationSnappable() + { + return $this->last_location_snappable; + } + + /** + * Indicates whether the vehicle's lastLocation can be snapped to + * the `current_route_segment`. This value is False if either + * `last_location` or `current_route_segment` don't exist. This value is + * computed by Fleet Engine. Updates from clients are ignored. + * + * Generated from protobuf field bool last_location_snappable = 3; + * @param bool $var + * @return $this + */ + public function setLastLocationSnappable($var) + { + GPBUtil::checkBool($var); + $this->last_location_snappable = $var; + + return $this; + } + +} + + diff --git a/MapsFleetEngineDelivery/src/V1/Task/State.php b/MapsFleetEngineDelivery/src/V1/Task/State.php new file mode 100644 index 000000000000..5d27cd723b88 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/Task/State.php @@ -0,0 +1,63 @@ +maps.fleetengine.delivery.v1.Task.State + */ +class State +{ + /** + * Default. Used for an unspecified or unrecognized Task state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Either the Task has not yet been assigned to a delivery vehicle, or the + * delivery vehicle has not yet passed the `Task`'s assigned vehicle stop. + * + * Generated from protobuf enum OPEN = 1; + */ + const OPEN = 1; + /** + * When the vehicle passes the vehicle stop for this Task. + * + * Generated from protobuf enum CLOSED = 2; + */ + const CLOSED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::OPEN => 'OPEN', + self::CLOSED => 'CLOSED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngineDelivery/src/V1/Task/TaskOutcome.php b/MapsFleetEngineDelivery/src/V1/Task/TaskOutcome.php new file mode 100644 index 000000000000..b91927e2ebae --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/Task/TaskOutcome.php @@ -0,0 +1,63 @@ +maps.fleetengine.delivery.v1.Task.TaskOutcome + */ +class TaskOutcome +{ + /** + * The Task outcome before its value is set. + * + * Generated from protobuf enum TASK_OUTCOME_UNSPECIFIED = 0; + */ + const TASK_OUTCOME_UNSPECIFIED = 0; + /** + * The Task completed successfully. + * + * Generated from protobuf enum SUCCEEDED = 1; + */ + const SUCCEEDED = 1; + /** + * Either the Task couldn't be completed, or it was cancelled. + * + * Generated from protobuf enum FAILED = 2; + */ + const FAILED = 2; + + private static $valueToName = [ + self::TASK_OUTCOME_UNSPECIFIED => 'TASK_OUTCOME_UNSPECIFIED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngineDelivery/src/V1/Task/TaskOutcomeLocationSource.php b/MapsFleetEngineDelivery/src/V1/Task/TaskOutcomeLocationSource.php new file mode 100644 index 000000000000..ed781f22925e --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/Task/TaskOutcomeLocationSource.php @@ -0,0 +1,63 @@ +maps.fleetengine.delivery.v1.Task.TaskOutcomeLocationSource + */ +class TaskOutcomeLocationSource +{ + /** + * The task outcome before it is set. + * + * Generated from protobuf enum TASK_OUTCOME_LOCATION_SOURCE_UNSPECIFIED = 0; + */ + const TASK_OUTCOME_LOCATION_SOURCE_UNSPECIFIED = 0; + /** + * The provider-specified the `task_outcome_location`. + * + * Generated from protobuf enum PROVIDER = 2; + */ + const PROVIDER = 2; + /** + * The provider didn't specify the `task_outcome_location`, so Fleet Engine + * used the last known vehicle location. + * + * Generated from protobuf enum LAST_VEHICLE_LOCATION = 3; + */ + const LAST_VEHICLE_LOCATION = 3; + + private static $valueToName = [ + self::TASK_OUTCOME_LOCATION_SOURCE_UNSPECIFIED => 'TASK_OUTCOME_LOCATION_SOURCE_UNSPECIFIED', + self::PROVIDER => 'PROVIDER', + self::LAST_VEHICLE_LOCATION => 'LAST_VEHICLE_LOCATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngineDelivery/src/V1/Task/Type.php b/MapsFleetEngineDelivery/src/V1/Task/Type.php new file mode 100644 index 000000000000..7aa33a625c6b --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/Task/Type.php @@ -0,0 +1,85 @@ +maps.fleetengine.delivery.v1.Task.Type + */ +class Type +{ + /** + * Default, the Task type is unknown. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * A pickup Task is the action taken for picking up a shipment from a + * customer. Depot or feeder vehicle pickups should use the `SCHEDULED_STOP` + * type. + * + * Generated from protobuf enum PICKUP = 1; + */ + const PICKUP = 1; + /** + * A delivery Task is the action taken for delivering a shipment to an end + * customer. Depot or feeder vehicle dropoffs should use the + * `SCHEDULED_STOP` type. + * + * Generated from protobuf enum DELIVERY = 2; + */ + const DELIVERY = 2; + /** + * A scheduled stop Task is used for planning purposes. For example, it + * could represent picking up or dropping off shipments from feeder vehicles + * or depots. It shouldn't be used for any shipments that are picked up or + * dropped off from an end customer. + * + * Generated from protobuf enum SCHEDULED_STOP = 3; + */ + const SCHEDULED_STOP = 3; + /** + * A Task that means the Vehicle is not available for service. For example, + * this can happen when the driver takes a break, or when the vehicle + * is being refueled. + * + * Generated from protobuf enum UNAVAILABLE = 4; + */ + const UNAVAILABLE = 4; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::PICKUP => 'PICKUP', + self::DELIVERY => 'DELIVERY', + self::SCHEDULED_STOP => 'SCHEDULED_STOP', + self::UNAVAILABLE => 'UNAVAILABLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngineDelivery/src/V1/TaskAttribute.php b/MapsFleetEngineDelivery/src/V1/TaskAttribute.php new file mode 100644 index 000000000000..f5fba7a3cea3 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/TaskAttribute.php @@ -0,0 +1,176 @@ +maps.fleetengine.delivery.v1.TaskAttribute + */ +class TaskAttribute extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute's key. Keys may not contain the colon character (:). + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + protected $task_attribute_value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The attribute's key. Keys may not contain the colon character (:). + * @type string $string_value + * String typed attribute value. + * @type bool $bool_value + * Boolean typed attribute value. + * @type float $number_value + * Double typed attribute value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * The attribute's key. Keys may not contain the colon character (:). + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The attribute's key. Keys may not contain the colon character (:). + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * String typed attribute value. + * + * Generated from protobuf field string string_value = 2; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(2); + } + + public function hasStringValue() + { + return $this->hasOneof(2); + } + + /** + * String typed attribute value. + * + * Generated from protobuf field string string_value = 2; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Boolean typed attribute value. + * + * Generated from protobuf field bool bool_value = 3; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(3); + } + + public function hasBoolValue() + { + return $this->hasOneof(3); + } + + /** + * Boolean typed attribute value. + * + * Generated from protobuf field bool bool_value = 3; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Double typed attribute value. + * + * Generated from protobuf field double number_value = 4; + * @return float + */ + public function getNumberValue() + { + return $this->readOneof(4); + } + + public function hasNumberValue() + { + return $this->hasOneof(4); + } + + /** + * Double typed attribute value. + * + * Generated from protobuf field double number_value = 4; + * @param float $var + * @return $this + */ + public function setNumberValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getTaskAttributeValue() + { + return $this->whichOneof("task_attribute_value"); + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/TaskTrackingInfo.php b/MapsFleetEngineDelivery/src/V1/TaskTrackingInfo.php new file mode 100644 index 000000000000..66383f156e70 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/TaskTrackingInfo.php @@ -0,0 +1,698 @@ +maps.fleetengine.delivery.v1.TaskTrackingInfo + */ +class TaskTrackingInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Must be in the format `providers/{provider}/taskTrackingInfo/{tracking}`, + * where `tracking` represents the tracking ID. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Immutable. The tracking ID of a Task. + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string tracking_id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $tracking_id = ''; + /** + * The vehicle's last location. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocation vehicle_location = 3; + */ + protected $vehicle_location = null; + /** + * A list of points which when connected forms a polyline of the vehicle's + * expected route to the location of this task. + * + * Generated from protobuf field repeated .google.type.LatLng route_polyline_points = 4; + */ + private $route_polyline_points; + /** + * Indicates the number of stops the vehicle remaining until the task stop is + * reached, including the task stop. For example, if the vehicle's next stop + * is the task stop, the value will be 1. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_stop_count = 5; + */ + protected $remaining_stop_count = null; + /** + * The total remaining distance in meters to the `VehicleStop` of interest. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_driving_distance_meters = 6; + */ + protected $remaining_driving_distance_meters = null; + /** + * The timestamp that indicates the estimated arrival time to the stop + * location. + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_arrival_time = 7; + */ + protected $estimated_arrival_time = null; + /** + * The timestamp that indicates the estimated completion time of a Task. + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_task_completion_time = 8; + */ + protected $estimated_task_completion_time = null; + /** + * The current execution state of the Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.State state = 11; + */ + protected $state = 0; + /** + * The outcome of attempting to execute a Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.TaskOutcome task_outcome = 9; + */ + protected $task_outcome = 0; + /** + * The timestamp that indicates when the Task's outcome was set by the + * provider. + * + * Generated from protobuf field .google.protobuf.Timestamp task_outcome_time = 12; + */ + protected $task_outcome_time = null; + /** + * Immutable. The location where the Task will be completed. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo planned_location = 10 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $planned_location = null; + /** + * The time window during which the task should be completed. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TimeWindow target_time_window = 13; + */ + protected $target_time_window = null; + /** + * The custom attributes set on the task. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.TaskAttribute attributes = 14; + */ + private $attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Must be in the format `providers/{provider}/taskTrackingInfo/{tracking}`, + * where `tracking` represents the tracking ID. + * @type string $tracking_id + * Immutable. The tracking ID of a Task. + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation $vehicle_location + * The vehicle's last location. + * @type array<\Google\Type\LatLng>|\Google\Protobuf\Internal\RepeatedField $route_polyline_points + * A list of points which when connected forms a polyline of the vehicle's + * expected route to the location of this task. + * @type \Google\Protobuf\Int32Value $remaining_stop_count + * Indicates the number of stops the vehicle remaining until the task stop is + * reached, including the task stop. For example, if the vehicle's next stop + * is the task stop, the value will be 1. + * @type \Google\Protobuf\Int32Value $remaining_driving_distance_meters + * The total remaining distance in meters to the `VehicleStop` of interest. + * @type \Google\Protobuf\Timestamp $estimated_arrival_time + * The timestamp that indicates the estimated arrival time to the stop + * location. + * @type \Google\Protobuf\Timestamp $estimated_task_completion_time + * The timestamp that indicates the estimated completion time of a Task. + * @type int $state + * The current execution state of the Task. + * @type int $task_outcome + * The outcome of attempting to execute a Task. + * @type \Google\Protobuf\Timestamp $task_outcome_time + * The timestamp that indicates when the Task's outcome was set by the + * provider. + * @type \Google\Maps\FleetEngine\Delivery\V1\LocationInfo $planned_location + * Immutable. The location where the Task will be completed. + * @type \Google\Maps\FleetEngine\Delivery\V1\TimeWindow $target_time_window + * The time window during which the task should be completed. + * @type array<\Google\Maps\FleetEngine\Delivery\V1\TaskAttribute>|\Google\Protobuf\Internal\RepeatedField $attributes + * The custom attributes set on the task. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\TaskTrackingInfo::initOnce(); + parent::__construct($data); + } + + /** + * Must be in the format `providers/{provider}/taskTrackingInfo/{tracking}`, + * where `tracking` represents the tracking ID. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Must be in the format `providers/{provider}/taskTrackingInfo/{tracking}`, + * where `tracking` represents the tracking ID. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. The tracking ID of a Task. + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string tracking_id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getTrackingId() + { + return $this->tracking_id; + } + + /** + * Immutable. The tracking ID of a Task. + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string tracking_id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setTrackingId($var) + { + GPBUtil::checkString($var, True); + $this->tracking_id = $var; + + return $this; + } + + /** + * The vehicle's last location. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocation vehicle_location = 3; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation|null + */ + public function getVehicleLocation() + { + return $this->vehicle_location; + } + + public function hasVehicleLocation() + { + return isset($this->vehicle_location); + } + + public function clearVehicleLocation() + { + unset($this->vehicle_location); + } + + /** + * The vehicle's last location. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicleLocation vehicle_location = 3; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation $var + * @return $this + */ + public function setVehicleLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation::class); + $this->vehicle_location = $var; + + return $this; + } + + /** + * A list of points which when connected forms a polyline of the vehicle's + * expected route to the location of this task. + * + * Generated from protobuf field repeated .google.type.LatLng route_polyline_points = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoutePolylinePoints() + { + return $this->route_polyline_points; + } + + /** + * A list of points which when connected forms a polyline of the vehicle's + * expected route to the location of this task. + * + * Generated from protobuf field repeated .google.type.LatLng route_polyline_points = 4; + * @param array<\Google\Type\LatLng>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoutePolylinePoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\LatLng::class); + $this->route_polyline_points = $arr; + + return $this; + } + + /** + * Indicates the number of stops the vehicle remaining until the task stop is + * reached, including the task stop. For example, if the vehicle's next stop + * is the task stop, the value will be 1. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_stop_count = 5; + * @return \Google\Protobuf\Int32Value|null + */ + public function getRemainingStopCount() + { + return $this->remaining_stop_count; + } + + public function hasRemainingStopCount() + { + return isset($this->remaining_stop_count); + } + + public function clearRemainingStopCount() + { + unset($this->remaining_stop_count); + } + + /** + * Returns the unboxed value from getRemainingStopCount() + + * Indicates the number of stops the vehicle remaining until the task stop is + * reached, including the task stop. For example, if the vehicle's next stop + * is the task stop, the value will be 1. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_stop_count = 5; + * @return int|null + */ + public function getRemainingStopCountUnwrapped() + { + return $this->readWrapperValue("remaining_stop_count"); + } + + /** + * Indicates the number of stops the vehicle remaining until the task stop is + * reached, including the task stop. For example, if the vehicle's next stop + * is the task stop, the value will be 1. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_stop_count = 5; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setRemainingStopCount($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->remaining_stop_count = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Indicates the number of stops the vehicle remaining until the task stop is + * reached, including the task stop. For example, if the vehicle's next stop + * is the task stop, the value will be 1. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_stop_count = 5; + * @param int|null $var + * @return $this + */ + public function setRemainingStopCountUnwrapped($var) + { + $this->writeWrapperValue("remaining_stop_count", $var); + return $this;} + + /** + * The total remaining distance in meters to the `VehicleStop` of interest. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_driving_distance_meters = 6; + * @return \Google\Protobuf\Int32Value|null + */ + public function getRemainingDrivingDistanceMeters() + { + return $this->remaining_driving_distance_meters; + } + + public function hasRemainingDrivingDistanceMeters() + { + return isset($this->remaining_driving_distance_meters); + } + + public function clearRemainingDrivingDistanceMeters() + { + unset($this->remaining_driving_distance_meters); + } + + /** + * Returns the unboxed value from getRemainingDrivingDistanceMeters() + + * The total remaining distance in meters to the `VehicleStop` of interest. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_driving_distance_meters = 6; + * @return int|null + */ + public function getRemainingDrivingDistanceMetersUnwrapped() + { + return $this->readWrapperValue("remaining_driving_distance_meters"); + } + + /** + * The total remaining distance in meters to the `VehicleStop` of interest. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_driving_distance_meters = 6; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setRemainingDrivingDistanceMeters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->remaining_driving_distance_meters = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The total remaining distance in meters to the `VehicleStop` of interest. + * + * Generated from protobuf field .google.protobuf.Int32Value remaining_driving_distance_meters = 6; + * @param int|null $var + * @return $this + */ + public function setRemainingDrivingDistanceMetersUnwrapped($var) + { + $this->writeWrapperValue("remaining_driving_distance_meters", $var); + return $this;} + + /** + * The timestamp that indicates the estimated arrival time to the stop + * location. + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_arrival_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEstimatedArrivalTime() + { + return $this->estimated_arrival_time; + } + + public function hasEstimatedArrivalTime() + { + return isset($this->estimated_arrival_time); + } + + public function clearEstimatedArrivalTime() + { + unset($this->estimated_arrival_time); + } + + /** + * The timestamp that indicates the estimated arrival time to the stop + * location. + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_arrival_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEstimatedArrivalTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->estimated_arrival_time = $var; + + return $this; + } + + /** + * The timestamp that indicates the estimated completion time of a Task. + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_task_completion_time = 8; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEstimatedTaskCompletionTime() + { + return $this->estimated_task_completion_time; + } + + public function hasEstimatedTaskCompletionTime() + { + return isset($this->estimated_task_completion_time); + } + + public function clearEstimatedTaskCompletionTime() + { + unset($this->estimated_task_completion_time); + } + + /** + * The timestamp that indicates the estimated completion time of a Task. + * + * Generated from protobuf field .google.protobuf.Timestamp estimated_task_completion_time = 8; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEstimatedTaskCompletionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->estimated_task_completion_time = $var; + + return $this; + } + + /** + * The current execution state of the Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.State state = 11; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The current execution state of the Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.State state = 11; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\Task\State::class); + $this->state = $var; + + return $this; + } + + /** + * The outcome of attempting to execute a Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.TaskOutcome task_outcome = 9; + * @return int + */ + public function getTaskOutcome() + { + return $this->task_outcome; + } + + /** + * The outcome of attempting to execute a Task. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task.TaskOutcome task_outcome = 9; + * @param int $var + * @return $this + */ + public function setTaskOutcome($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\Task\TaskOutcome::class); + $this->task_outcome = $var; + + return $this; + } + + /** + * The timestamp that indicates when the Task's outcome was set by the + * provider. + * + * Generated from protobuf field .google.protobuf.Timestamp task_outcome_time = 12; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTaskOutcomeTime() + { + return $this->task_outcome_time; + } + + public function hasTaskOutcomeTime() + { + return isset($this->task_outcome_time); + } + + public function clearTaskOutcomeTime() + { + unset($this->task_outcome_time); + } + + /** + * The timestamp that indicates when the Task's outcome was set by the + * provider. + * + * Generated from protobuf field .google.protobuf.Timestamp task_outcome_time = 12; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTaskOutcomeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->task_outcome_time = $var; + + return $this; + } + + /** + * Immutable. The location where the Task will be completed. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo planned_location = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Maps\FleetEngine\Delivery\V1\LocationInfo|null + */ + public function getPlannedLocation() + { + return $this->planned_location; + } + + public function hasPlannedLocation() + { + return isset($this->planned_location); + } + + public function clearPlannedLocation() + { + unset($this->planned_location); + } + + /** + * Immutable. The location where the Task will be completed. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo planned_location = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Maps\FleetEngine\Delivery\V1\LocationInfo $var + * @return $this + */ + public function setPlannedLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\LocationInfo::class); + $this->planned_location = $var; + + return $this; + } + + /** + * The time window during which the task should be completed. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TimeWindow target_time_window = 13; + * @return \Google\Maps\FleetEngine\Delivery\V1\TimeWindow|null + */ + public function getTargetTimeWindow() + { + return $this->target_time_window; + } + + public function hasTargetTimeWindow() + { + return isset($this->target_time_window); + } + + public function clearTargetTimeWindow() + { + unset($this->target_time_window); + } + + /** + * The time window during which the task should be completed. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TimeWindow target_time_window = 13; + * @param \Google\Maps\FleetEngine\Delivery\V1\TimeWindow $var + * @return $this + */ + public function setTargetTimeWindow($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TimeWindow::class); + $this->target_time_window = $var; + + return $this; + } + + /** + * The custom attributes set on the task. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.TaskAttribute attributes = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * The custom attributes set on the task. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.TaskAttribute attributes = 14; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\TaskAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\TaskAttribute::class); + $this->attributes = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/TaskTrackingViewConfig.php b/MapsFleetEngineDelivery/src/V1/TaskTrackingViewConfig.php new file mode 100644 index 000000000000..0c3036b3dc7f --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/TaskTrackingViewConfig.php @@ -0,0 +1,346 @@ +maps.fleetengine.delivery.v1.TaskTrackingViewConfig + */ +class TaskTrackingViewConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The field that specifies when route polyline points can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption route_polyline_points_visibility = 1; + */ + protected $route_polyline_points_visibility = null; + /** + * The field that specifies when estimated arrival time can be visible. If + * this field is not specified, the project level default visibility + * configuration for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption estimated_arrival_time_visibility = 2; + */ + protected $estimated_arrival_time_visibility = null; + /** + * The field that specifies when estimated task completion time can be + * visible. If this field is not specified, the project level default + * visibility configuration for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption estimated_task_completion_time_visibility = 3; + */ + protected $estimated_task_completion_time_visibility = null; + /** + * The field that specifies when remaining driving distance can be visible. If + * this field is not specified, the project level default visibility + * configuration for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption remaining_driving_distance_visibility = 4; + */ + protected $remaining_driving_distance_visibility = null; + /** + * The field that specifies when remaining stop count can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption remaining_stop_count_visibility = 5; + */ + protected $remaining_stop_count_visibility = null; + /** + * The field that specifies when vehicle location can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption vehicle_location_visibility = 6; + */ + protected $vehicle_location_visibility = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $route_polyline_points_visibility + * The field that specifies when route polyline points can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * @type \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $estimated_arrival_time_visibility + * The field that specifies when estimated arrival time can be visible. If + * this field is not specified, the project level default visibility + * configuration for this data will be used. + * @type \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $estimated_task_completion_time_visibility + * The field that specifies when estimated task completion time can be + * visible. If this field is not specified, the project level default + * visibility configuration for this data will be used. + * @type \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $remaining_driving_distance_visibility + * The field that specifies when remaining driving distance can be visible. If + * this field is not specified, the project level default visibility + * configuration for this data will be used. + * @type \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $remaining_stop_count_visibility + * The field that specifies when remaining stop count can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * @type \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $vehicle_location_visibility + * The field that specifies when vehicle location can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Tasks::initOnce(); + parent::__construct($data); + } + + /** + * The field that specifies when route polyline points can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption route_polyline_points_visibility = 1; + * @return \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption|null + */ + public function getRoutePolylinePointsVisibility() + { + return $this->route_polyline_points_visibility; + } + + public function hasRoutePolylinePointsVisibility() + { + return isset($this->route_polyline_points_visibility); + } + + public function clearRoutePolylinePointsVisibility() + { + unset($this->route_polyline_points_visibility); + } + + /** + * The field that specifies when route polyline points can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption route_polyline_points_visibility = 1; + * @param \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $var + * @return $this + */ + public function setRoutePolylinePointsVisibility($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption::class); + $this->route_polyline_points_visibility = $var; + + return $this; + } + + /** + * The field that specifies when estimated arrival time can be visible. If + * this field is not specified, the project level default visibility + * configuration for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption estimated_arrival_time_visibility = 2; + * @return \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption|null + */ + public function getEstimatedArrivalTimeVisibility() + { + return $this->estimated_arrival_time_visibility; + } + + public function hasEstimatedArrivalTimeVisibility() + { + return isset($this->estimated_arrival_time_visibility); + } + + public function clearEstimatedArrivalTimeVisibility() + { + unset($this->estimated_arrival_time_visibility); + } + + /** + * The field that specifies when estimated arrival time can be visible. If + * this field is not specified, the project level default visibility + * configuration for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption estimated_arrival_time_visibility = 2; + * @param \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $var + * @return $this + */ + public function setEstimatedArrivalTimeVisibility($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption::class); + $this->estimated_arrival_time_visibility = $var; + + return $this; + } + + /** + * The field that specifies when estimated task completion time can be + * visible. If this field is not specified, the project level default + * visibility configuration for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption estimated_task_completion_time_visibility = 3; + * @return \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption|null + */ + public function getEstimatedTaskCompletionTimeVisibility() + { + return $this->estimated_task_completion_time_visibility; + } + + public function hasEstimatedTaskCompletionTimeVisibility() + { + return isset($this->estimated_task_completion_time_visibility); + } + + public function clearEstimatedTaskCompletionTimeVisibility() + { + unset($this->estimated_task_completion_time_visibility); + } + + /** + * The field that specifies when estimated task completion time can be + * visible. If this field is not specified, the project level default + * visibility configuration for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption estimated_task_completion_time_visibility = 3; + * @param \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $var + * @return $this + */ + public function setEstimatedTaskCompletionTimeVisibility($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption::class); + $this->estimated_task_completion_time_visibility = $var; + + return $this; + } + + /** + * The field that specifies when remaining driving distance can be visible. If + * this field is not specified, the project level default visibility + * configuration for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption remaining_driving_distance_visibility = 4; + * @return \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption|null + */ + public function getRemainingDrivingDistanceVisibility() + { + return $this->remaining_driving_distance_visibility; + } + + public function hasRemainingDrivingDistanceVisibility() + { + return isset($this->remaining_driving_distance_visibility); + } + + public function clearRemainingDrivingDistanceVisibility() + { + unset($this->remaining_driving_distance_visibility); + } + + /** + * The field that specifies when remaining driving distance can be visible. If + * this field is not specified, the project level default visibility + * configuration for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption remaining_driving_distance_visibility = 4; + * @param \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $var + * @return $this + */ + public function setRemainingDrivingDistanceVisibility($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption::class); + $this->remaining_driving_distance_visibility = $var; + + return $this; + } + + /** + * The field that specifies when remaining stop count can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption remaining_stop_count_visibility = 5; + * @return \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption|null + */ + public function getRemainingStopCountVisibility() + { + return $this->remaining_stop_count_visibility; + } + + public function hasRemainingStopCountVisibility() + { + return isset($this->remaining_stop_count_visibility); + } + + public function clearRemainingStopCountVisibility() + { + unset($this->remaining_stop_count_visibility); + } + + /** + * The field that specifies when remaining stop count can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption remaining_stop_count_visibility = 5; + * @param \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $var + * @return $this + */ + public function setRemainingStopCountVisibility($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption::class); + $this->remaining_stop_count_visibility = $var; + + return $this; + } + + /** + * The field that specifies when vehicle location can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption vehicle_location_visibility = 6; + * @return \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption|null + */ + public function getVehicleLocationVisibility() + { + return $this->vehicle_location_visibility; + } + + public function hasVehicleLocationVisibility() + { + return isset($this->vehicle_location_visibility); + } + + public function clearVehicleLocationVisibility() + { + unset($this->vehicle_location_visibility); + } + + /** + * The field that specifies when vehicle location can be visible. If this + * field is not specified, the project level default visibility configuration + * for this data will be used. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption vehicle_location_visibility = 6; + * @param \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption $var + * @return $this + */ + public function setVehicleLocationVisibility($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TaskTrackingViewConfig\VisibilityOption::class); + $this->vehicle_location_visibility = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/TaskTrackingViewConfig/VisibilityOption.php b/MapsFleetEngineDelivery/src/V1/TaskTrackingViewConfig/VisibilityOption.php new file mode 100644 index 000000000000..4688326500c9 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/TaskTrackingViewConfig/VisibilityOption.php @@ -0,0 +1,227 @@ +maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption + */ +class VisibilityOption extends \Google\Protobuf\Internal\Message +{ + protected $visibility_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $remaining_stop_count_threshold + * This data element is visible to the end users if the remaining stop + * count <= remaining_stop_count_threshold. + * @type \Google\Protobuf\Duration $duration_until_estimated_arrival_time_threshold + * This data element is visible to the end users if the ETA to the stop + * <= duration_until_estimated_arrival_time_threshold. + * @type int $remaining_driving_distance_meters_threshold + * This data element is visible to the end users if the remaining + * driving distance in meters <= + * remaining_driving_distance_meters_threshold. + * @type bool $always + * If set to true, this data element is always visible to the end users + * with no thresholds. This field cannot be set to false. + * @type bool $never + * If set to true, this data element is always hidden from the end users + * with no thresholds. This field cannot be set to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Tasks::initOnce(); + parent::__construct($data); + } + + /** + * This data element is visible to the end users if the remaining stop + * count <= remaining_stop_count_threshold. + * + * Generated from protobuf field int32 remaining_stop_count_threshold = 1; + * @return int + */ + public function getRemainingStopCountThreshold() + { + return $this->readOneof(1); + } + + public function hasRemainingStopCountThreshold() + { + return $this->hasOneof(1); + } + + /** + * This data element is visible to the end users if the remaining stop + * count <= remaining_stop_count_threshold. + * + * Generated from protobuf field int32 remaining_stop_count_threshold = 1; + * @param int $var + * @return $this + */ + public function setRemainingStopCountThreshold($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * This data element is visible to the end users if the ETA to the stop + * <= duration_until_estimated_arrival_time_threshold. + * + * Generated from protobuf field .google.protobuf.Duration duration_until_estimated_arrival_time_threshold = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getDurationUntilEstimatedArrivalTimeThreshold() + { + return $this->readOneof(2); + } + + public function hasDurationUntilEstimatedArrivalTimeThreshold() + { + return $this->hasOneof(2); + } + + /** + * This data element is visible to the end users if the ETA to the stop + * <= duration_until_estimated_arrival_time_threshold. + * + * Generated from protobuf field .google.protobuf.Duration duration_until_estimated_arrival_time_threshold = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDurationUntilEstimatedArrivalTimeThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * This data element is visible to the end users if the remaining + * driving distance in meters <= + * remaining_driving_distance_meters_threshold. + * + * Generated from protobuf field int32 remaining_driving_distance_meters_threshold = 3; + * @return int + */ + public function getRemainingDrivingDistanceMetersThreshold() + { + return $this->readOneof(3); + } + + public function hasRemainingDrivingDistanceMetersThreshold() + { + return $this->hasOneof(3); + } + + /** + * This data element is visible to the end users if the remaining + * driving distance in meters <= + * remaining_driving_distance_meters_threshold. + * + * Generated from protobuf field int32 remaining_driving_distance_meters_threshold = 3; + * @param int $var + * @return $this + */ + public function setRemainingDrivingDistanceMetersThreshold($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * If set to true, this data element is always visible to the end users + * with no thresholds. This field cannot be set to false. + * + * Generated from protobuf field bool always = 4; + * @return bool + */ + public function getAlways() + { + return $this->readOneof(4); + } + + public function hasAlways() + { + return $this->hasOneof(4); + } + + /** + * If set to true, this data element is always visible to the end users + * with no thresholds. This field cannot be set to false. + * + * Generated from protobuf field bool always = 4; + * @param bool $var + * @return $this + */ + public function setAlways($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * If set to true, this data element is always hidden from the end users + * with no thresholds. This field cannot be set to false. + * + * Generated from protobuf field bool never = 5; + * @return bool + */ + public function getNever() + { + return $this->readOneof(5); + } + + public function hasNever() + { + return $this->hasOneof(5); + } + + /** + * If set to true, this data element is always hidden from the end users + * with no thresholds. This field cannot be set to false. + * + * Generated from protobuf field bool never = 5; + * @param bool $var + * @return $this + */ + public function setNever($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getVisibilityOption() + { + return $this->whichOneof("visibility_option"); + } + +} + + diff --git a/MapsFleetEngineDelivery/src/V1/TimeWindow.php b/MapsFleetEngineDelivery/src/V1/TimeWindow.php new file mode 100644 index 000000000000..8d4491a57d7b --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/TimeWindow.php @@ -0,0 +1,121 @@ +maps.fleetengine.delivery.v1.TimeWindow + */ +class TimeWindow extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The start time of the time window (inclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_time = null; + /** + * Required. The end time of the time window (inclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Required. The start time of the time window (inclusive). + * @type \Google\Protobuf\Timestamp $end_time + * Required. The end time of the time window (inclusive). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Required. The start time of the time window (inclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Required. The start time of the time window (inclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Required. The end time of the time window (inclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Required. The end time of the time window (inclusive). + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/UpdateDeliveryVehicleRequest.php b/MapsFleetEngineDelivery/src/V1/UpdateDeliveryVehicleRequest.php new file mode 100644 index 000000000000..0d7c7af0e6f8 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/UpdateDeliveryVehicleRequest.php @@ -0,0 +1,201 @@ +maps.fleetengine.delivery.v1.UpdateDeliveryVehicleRequest + */ +class UpdateDeliveryVehicleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. The `DeliveryVehicle` entity update to apply. + * Note: You cannot update the name of the `DeliveryVehicle`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicle delivery_vehicle = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $delivery_vehicle = null; + /** + * Required. A field mask that indicates which `DeliveryVehicle` fields to + * update. Note that the update_mask must contain at least one field. + * This is a comma-separated list of fully qualified names of fields. Example: + * `"remaining_vehicle_journey_segments"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle $deliveryVehicle Required. The `DeliveryVehicle` entity update to apply. + * Note: You cannot update the name of the `DeliveryVehicle`. + * @param \Google\Protobuf\FieldMask $updateMask Required. A field mask that indicates which `DeliveryVehicle` fields to + * update. Note that the update_mask must contain at least one field. + * + * This is a comma-separated list of fully qualified names of fields. Example: + * `"remaining_vehicle_journey_segments"`. + * + * @return \Google\Maps\FleetEngine\Delivery\V1\UpdateDeliveryVehicleRequest + * + * @experimental + */ + public static function build(\Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle $deliveryVehicle, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDeliveryVehicle($deliveryVehicle) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle $delivery_vehicle + * Required. The `DeliveryVehicle` entity update to apply. + * Note: You cannot update the name of the `DeliveryVehicle`. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. A field mask that indicates which `DeliveryVehicle` fields to + * update. Note that the update_mask must contain at least one field. + * This is a comma-separated list of fully qualified names of fields. Example: + * `"remaining_vehicle_journey_segments"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. The `DeliveryVehicle` entity update to apply. + * Note: You cannot update the name of the `DeliveryVehicle`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicle delivery_vehicle = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle|null + */ + public function getDeliveryVehicle() + { + return $this->delivery_vehicle; + } + + public function hasDeliveryVehicle() + { + return isset($this->delivery_vehicle); + } + + public function clearDeliveryVehicle() + { + unset($this->delivery_vehicle); + } + + /** + * Required. The `DeliveryVehicle` entity update to apply. + * Note: You cannot update the name of the `DeliveryVehicle`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryVehicle delivery_vehicle = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle $var + * @return $this + */ + public function setDeliveryVehicle($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle::class); + $this->delivery_vehicle = $var; + + return $this; + } + + /** + * Required. A field mask that indicates which `DeliveryVehicle` fields to + * update. Note that the update_mask must contain at least one field. + * This is a comma-separated list of fully qualified names of fields. Example: + * `"remaining_vehicle_journey_segments"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. A field mask that indicates which `DeliveryVehicle` fields to + * update. Note that the update_mask must contain at least one field. + * This is a comma-separated list of fully qualified names of fields. Example: + * `"remaining_vehicle_journey_segments"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/UpdateTaskRequest.php b/MapsFleetEngineDelivery/src/V1/UpdateTaskRequest.php new file mode 100644 index 000000000000..5ec3945df6de --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/UpdateTaskRequest.php @@ -0,0 +1,259 @@ +maps.fleetengine.delivery.v1.UpdateTaskRequest + */ +class UpdateTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $header = null; + /** + * Required. The Task associated with the update. + * The following fields are maintained by Fleet Engine. Do not update + * them using `Task.update`. + * * `last_location`. + * * `last_location_snappable`. + * * `name`. + * * `remaining_vehicle_journey_segments`. + * * `task_outcome_location_source`. + * Note: You cannot change the value of `task_outcome` once you set it. + * If the Task has been assigned to a delivery vehicle, then don't set the + * Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop` + * that contains the Task from the delivery vehicle, which automatically sets + * the Task state to CLOSED. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task task = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $task = null; + /** + * Required. The field mask that indicates which Task fields to update. + * Note: The `update_mask` must contain at least one field. + * This is a comma-separated list of fully qualified names of fields. Example: + * `"task_outcome,task_outcome_time,task_outcome_location"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Maps\FleetEngine\Delivery\V1\Task $task Required. The Task associated with the update. + * The following fields are maintained by Fleet Engine. Do not update + * them using `Task.update`. + * + * * `last_location`. + * * `last_location_snappable`. + * * `name`. + * * `remaining_vehicle_journey_segments`. + * * `task_outcome_location_source`. + * + * Note: You cannot change the value of `task_outcome` once you set it. + * + * If the Task has been assigned to a delivery vehicle, then don't set the + * Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop` + * that contains the Task from the delivery vehicle, which automatically sets + * the Task state to CLOSED. + * @param \Google\Protobuf\FieldMask $updateMask Required. The field mask that indicates which Task fields to update. + * Note: The `update_mask` must contain at least one field. + * + * This is a comma-separated list of fully qualified names of fields. Example: + * `"task_outcome,task_outcome_time,task_outcome_location"`. + * + * @return \Google\Maps\FleetEngine\Delivery\V1\UpdateTaskRequest + * + * @experimental + */ + public static function build(\Google\Maps\FleetEngine\Delivery\V1\Task $task, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setTask($task) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header + * Optional. The standard Delivery API request header. + * @type \Google\Maps\FleetEngine\Delivery\V1\Task $task + * Required. The Task associated with the update. + * The following fields are maintained by Fleet Engine. Do not update + * them using `Task.update`. + * * `last_location`. + * * `last_location_snappable`. + * * `name`. + * * `remaining_vehicle_journey_segments`. + * * `task_outcome_location_source`. + * Note: You cannot change the value of `task_outcome` once you set it. + * If the Task has been assigned to a delivery vehicle, then don't set the + * Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop` + * that contains the Task from the delivery vehicle, which automatically sets + * the Task state to CLOSED. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The field mask that indicates which Task fields to update. + * Note: The `update_mask` must contain at least one field. + * This is a comma-separated list of fully qualified names of fields. Example: + * `"task_outcome,task_outcome_time,task_outcome_location"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * Optional. The standard Delivery API request header. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Required. The Task associated with the update. + * The following fields are maintained by Fleet Engine. Do not update + * them using `Task.update`. + * * `last_location`. + * * `last_location_snappable`. + * * `name`. + * * `remaining_vehicle_journey_segments`. + * * `task_outcome_location_source`. + * Note: You cannot change the value of `task_outcome` once you set it. + * If the Task has been assigned to a delivery vehicle, then don't set the + * Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop` + * that contains the Task from the delivery vehicle, which automatically sets + * the Task state to CLOSED. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task task = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\Delivery\V1\Task|null + */ + public function getTask() + { + return $this->task; + } + + public function hasTask() + { + return isset($this->task); + } + + public function clearTask() + { + unset($this->task); + } + + /** + * Required. The Task associated with the update. + * The following fields are maintained by Fleet Engine. Do not update + * them using `Task.update`. + * * `last_location`. + * * `last_location_snappable`. + * * `name`. + * * `remaining_vehicle_journey_segments`. + * * `task_outcome_location_source`. + * Note: You cannot change the value of `task_outcome` once you set it. + * If the Task has been assigned to a delivery vehicle, then don't set the + * Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop` + * that contains the Task from the delivery vehicle, which automatically sets + * the Task state to CLOSED. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.Task task = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\Delivery\V1\Task $var + * @return $this + */ + public function setTask($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\Task::class); + $this->task = $var; + + return $this; + } + + /** + * Required. The field mask that indicates which Task fields to update. + * Note: The `update_mask` must contain at least one field. + * This is a comma-separated list of fully qualified names of fields. Example: + * `"task_outcome,task_outcome_time,task_outcome_location"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The field mask that indicates which Task fields to update. + * Note: The `update_mask` must contain at least one field. + * This is a comma-separated list of fully qualified names of fields. Example: + * `"task_outcome,task_outcome_time,task_outcome_location"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/VehicleJourneySegment.php b/MapsFleetEngineDelivery/src/V1/VehicleJourneySegment.php new file mode 100644 index 000000000000..cdef673d39a0 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/VehicleJourneySegment.php @@ -0,0 +1,352 @@ +maps.fleetengine.delivery.v1.VehicleJourneySegment + */ +class VehicleJourneySegment extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the stop location, along with the `Task`s associated with + * the stop. Some fields of the VehicleStop might not be present if this + * journey segment is part of `JourneySharingInfo`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.VehicleStop stop = 1; + */ + protected $stop = null; + /** + * Output only. The travel distance from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the vehicle's location recorded + * at the time that this stop was added to the list. This field might not be + * present if this journey segment is part of `JourneySharingInfo`. + * + * Generated from protobuf field .google.protobuf.Int32Value driving_distance_meters = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $driving_distance_meters = null; + /** + * Output only. The travel time from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the Vehicle's location recorded + * at the time that this stop was added to the list. + * If this field is defined in the path + * `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or + * `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST), + * then it may be populated with the value from + * `DeliveryVehicle.remaining_duration` (gRPC) or + * `DeliveryVehicle.remainingDuration` (REST). + * This provides the remaining driving duration from the driver app's latest + * known location rather than the driving time from the previous stop. + * + * Generated from protobuf field .google.protobuf.Duration driving_duration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $driving_duration = null; + /** + * Output only. The path from the previous stop to this stop. If the current + * stop is the first stop in the list of journey segments, then this is the + * path from the vehicle's current location to this stop at the time that the + * stop was added to the list. This field might not be present if this journey + * segment is part of `JourneySharingInfo`. + * If this field is defined in the path + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST), then it may be populated with the `LatLng`s decoded from + * `DeliveryVehicle.current_route_segment` (gRPC) or + * `DeliveryVehicle.currentRouteSegment` (REST). This provides the driving + * path from the driver app's latest known location rather than the path from + * the previous stop. + * + * Generated from protobuf field repeated .google.type.LatLng path = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $path; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\VehicleStop $stop + * Specifies the stop location, along with the `Task`s associated with + * the stop. Some fields of the VehicleStop might not be present if this + * journey segment is part of `JourneySharingInfo`. + * @type \Google\Protobuf\Int32Value $driving_distance_meters + * Output only. The travel distance from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the vehicle's location recorded + * at the time that this stop was added to the list. This field might not be + * present if this journey segment is part of `JourneySharingInfo`. + * @type \Google\Protobuf\Duration $driving_duration + * Output only. The travel time from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the Vehicle's location recorded + * at the time that this stop was added to the list. + * If this field is defined in the path + * `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or + * `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST), + * then it may be populated with the value from + * `DeliveryVehicle.remaining_duration` (gRPC) or + * `DeliveryVehicle.remainingDuration` (REST). + * This provides the remaining driving duration from the driver app's latest + * known location rather than the driving time from the previous stop. + * @type array<\Google\Type\LatLng>|\Google\Protobuf\Internal\RepeatedField $path + * Output only. The path from the previous stop to this stop. If the current + * stop is the first stop in the list of journey segments, then this is the + * path from the vehicle's current location to this stop at the time that the + * stop was added to the list. This field might not be present if this journey + * segment is part of `JourneySharingInfo`. + * If this field is defined in the path + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST), then it may be populated with the `LatLng`s decoded from + * `DeliveryVehicle.current_route_segment` (gRPC) or + * `DeliveryVehicle.currentRouteSegment` (REST). This provides the driving + * path from the driver app's latest known location rather than the path from + * the previous stop. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryVehicles::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the stop location, along with the `Task`s associated with + * the stop. Some fields of the VehicleStop might not be present if this + * journey segment is part of `JourneySharingInfo`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.VehicleStop stop = 1; + * @return \Google\Maps\FleetEngine\Delivery\V1\VehicleStop|null + */ + public function getStop() + { + return $this->stop; + } + + public function hasStop() + { + return isset($this->stop); + } + + public function clearStop() + { + unset($this->stop); + } + + /** + * Specifies the stop location, along with the `Task`s associated with + * the stop. Some fields of the VehicleStop might not be present if this + * journey segment is part of `JourneySharingInfo`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.VehicleStop stop = 1; + * @param \Google\Maps\FleetEngine\Delivery\V1\VehicleStop $var + * @return $this + */ + public function setStop($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\VehicleStop::class); + $this->stop = $var; + + return $this; + } + + /** + * Output only. The travel distance from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the vehicle's location recorded + * at the time that this stop was added to the list. This field might not be + * present if this journey segment is part of `JourneySharingInfo`. + * + * Generated from protobuf field .google.protobuf.Int32Value driving_distance_meters = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getDrivingDistanceMeters() + { + return $this->driving_distance_meters; + } + + public function hasDrivingDistanceMeters() + { + return isset($this->driving_distance_meters); + } + + public function clearDrivingDistanceMeters() + { + unset($this->driving_distance_meters); + } + + /** + * Returns the unboxed value from getDrivingDistanceMeters() + + * Output only. The travel distance from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the vehicle's location recorded + * at the time that this stop was added to the list. This field might not be + * present if this journey segment is part of `JourneySharingInfo`. + * + * Generated from protobuf field .google.protobuf.Int32Value driving_distance_meters = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|null + */ + public function getDrivingDistanceMetersUnwrapped() + { + return $this->readWrapperValue("driving_distance_meters"); + } + + /** + * Output only. The travel distance from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the vehicle's location recorded + * at the time that this stop was added to the list. This field might not be + * present if this journey segment is part of `JourneySharingInfo`. + * + * Generated from protobuf field .google.protobuf.Int32Value driving_distance_meters = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setDrivingDistanceMeters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->driving_distance_meters = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Output only. The travel distance from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the vehicle's location recorded + * at the time that this stop was added to the list. This field might not be + * present if this journey segment is part of `JourneySharingInfo`. + * + * Generated from protobuf field .google.protobuf.Int32Value driving_distance_meters = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|null $var + * @return $this + */ + public function setDrivingDistanceMetersUnwrapped($var) + { + $this->writeWrapperValue("driving_distance_meters", $var); + return $this;} + + /** + * Output only. The travel time from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the Vehicle's location recorded + * at the time that this stop was added to the list. + * If this field is defined in the path + * `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or + * `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST), + * then it may be populated with the value from + * `DeliveryVehicle.remaining_duration` (gRPC) or + * `DeliveryVehicle.remainingDuration` (REST). + * This provides the remaining driving duration from the driver app's latest + * known location rather than the driving time from the previous stop. + * + * Generated from protobuf field .google.protobuf.Duration driving_duration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getDrivingDuration() + { + return $this->driving_duration; + } + + public function hasDrivingDuration() + { + return isset($this->driving_duration); + } + + public function clearDrivingDuration() + { + unset($this->driving_duration); + } + + /** + * Output only. The travel time from the previous stop to this stop. + * If the current stop is the first stop in the list of journey + * segments, then the starting point is the Vehicle's location recorded + * at the time that this stop was added to the list. + * If this field is defined in the path + * `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or + * `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST), + * then it may be populated with the value from + * `DeliveryVehicle.remaining_duration` (gRPC) or + * `DeliveryVehicle.remainingDuration` (REST). + * This provides the remaining driving duration from the driver app's latest + * known location rather than the driving time from the previous stop. + * + * Generated from protobuf field .google.protobuf.Duration driving_duration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDrivingDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->driving_duration = $var; + + return $this; + } + + /** + * Output only. The path from the previous stop to this stop. If the current + * stop is the first stop in the list of journey segments, then this is the + * path from the vehicle's current location to this stop at the time that the + * stop was added to the list. This field might not be present if this journey + * segment is part of `JourneySharingInfo`. + * If this field is defined in the path + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST), then it may be populated with the `LatLng`s decoded from + * `DeliveryVehicle.current_route_segment` (gRPC) or + * `DeliveryVehicle.currentRouteSegment` (REST). This provides the driving + * path from the driver app's latest known location rather than the path from + * the previous stop. + * + * Generated from protobuf field repeated .google.type.LatLng path = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPath() + { + return $this->path; + } + + /** + * Output only. The path from the previous stop to this stop. If the current + * stop is the first stop in the list of journey segments, then this is the + * path from the vehicle's current location to this stop at the time that the + * stop was added to the list. This field might not be present if this journey + * segment is part of `JourneySharingInfo`. + * If this field is defined in the path + * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` + * (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` + * (REST), then it may be populated with the `LatLng`s decoded from + * `DeliveryVehicle.current_route_segment` (gRPC) or + * `DeliveryVehicle.currentRouteSegment` (REST). This provides the driving + * path from the driver app's latest known location rather than the path from + * the previous stop. + * + * Generated from protobuf field repeated .google.type.LatLng path = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Type\LatLng>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPath($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\LatLng::class); + $this->path = $arr; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/VehicleStop.php b/MapsFleetEngineDelivery/src/V1/VehicleStop.php new file mode 100644 index 000000000000..febbc0c1605b --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/VehicleStop.php @@ -0,0 +1,161 @@ +maps.fleetengine.delivery.v1.VehicleStop + */ +class VehicleStop extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of the stop. Note that the locations in the `Task`s + * might not exactly match this location, but will be within a short distance + * of it. This field won't be populated in the response of a `GetTask` call. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo planned_location = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $planned_location = null; + /** + * The list of `Task`s to be performed at this stop. This field won't be + * populated in the response of a `GetTask` call. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.VehicleStop.TaskInfo tasks = 2; + */ + private $tasks; + /** + * The state of the `VehicleStop`. This field won't be populated in the + * response of a `GetTask` call. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.VehicleStop.State state = 3; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\FleetEngine\Delivery\V1\LocationInfo $planned_location + * Required. The location of the stop. Note that the locations in the `Task`s + * might not exactly match this location, but will be within a short distance + * of it. This field won't be populated in the response of a `GetTask` call. + * @type array<\Google\Maps\FleetEngine\Delivery\V1\VehicleStop\TaskInfo>|\Google\Protobuf\Internal\RepeatedField $tasks + * The list of `Task`s to be performed at this stop. This field won't be + * populated in the response of a `GetTask` call. + * @type int $state + * The state of the `VehicleStop`. This field won't be populated in the + * response of a `GetTask` call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryVehicles::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of the stop. Note that the locations in the `Task`s + * might not exactly match this location, but will be within a short distance + * of it. This field won't be populated in the response of a `GetTask` call. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo planned_location = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\FleetEngine\Delivery\V1\LocationInfo|null + */ + public function getPlannedLocation() + { + return $this->planned_location; + } + + public function hasPlannedLocation() + { + return isset($this->planned_location); + } + + public function clearPlannedLocation() + { + unset($this->planned_location); + } + + /** + * Required. The location of the stop. Note that the locations in the `Task`s + * might not exactly match this location, but will be within a short distance + * of it. This field won't be populated in the response of a `GetTask` call. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.LocationInfo planned_location = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\FleetEngine\Delivery\V1\LocationInfo $var + * @return $this + */ + public function setPlannedLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\LocationInfo::class); + $this->planned_location = $var; + + return $this; + } + + /** + * The list of `Task`s to be performed at this stop. This field won't be + * populated in the response of a `GetTask` call. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.VehicleStop.TaskInfo tasks = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The list of `Task`s to be performed at this stop. This field won't be + * populated in the response of a `GetTask` call. + * + * Generated from protobuf field repeated .maps.fleetengine.delivery.v1.VehicleStop.TaskInfo tasks = 2; + * @param array<\Google\Maps\FleetEngine\Delivery\V1\VehicleStop\TaskInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\VehicleStop\TaskInfo::class); + $this->tasks = $arr; + + return $this; + } + + /** + * The state of the `VehicleStop`. This field won't be populated in the + * response of a `GetTask` call. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.VehicleStop.State state = 3; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the `VehicleStop`. This field won't be populated in the + * response of a `GetTask` call. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.VehicleStop.State state = 3; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Maps\FleetEngine\Delivery\V1\VehicleStop\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/MapsFleetEngineDelivery/src/V1/VehicleStop/State.php b/MapsFleetEngineDelivery/src/V1/VehicleStop/State.php new file mode 100644 index 000000000000..646a6e27ea11 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/VehicleStop/State.php @@ -0,0 +1,74 @@ +maps.fleetengine.delivery.v1.VehicleStop.State + */ +class State +{ + /** + * Unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Created, but not actively routing. + * + * Generated from protobuf enum NEW = 1; + */ + const PBNEW = 1; + /** + * Assigned and actively routing. + * + * Generated from protobuf enum ENROUTE = 2; + */ + const ENROUTE = 2; + /** + * Arrived at stop. Assumes that when the Vehicle is routing to the next + * stop, that all previous stops have been completed. + * + * Generated from protobuf enum ARRIVED = 3; + */ + const ARRIVED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PBNEW => 'NEW', + self::ENROUTE => 'ENROUTE', + self::ARRIVED => 'ARRIVED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + + diff --git a/MapsFleetEngineDelivery/src/V1/VehicleStop/TaskInfo.php b/MapsFleetEngineDelivery/src/V1/VehicleStop/TaskInfo.php new file mode 100644 index 000000000000..ffa8663b7481 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/VehicleStop/TaskInfo.php @@ -0,0 +1,188 @@ +maps.fleetengine.delivery.v1.VehicleStop.TaskInfo + */ +class TaskInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The Task ID. This field won't be populated in the response of a `GetTask` + * call. Task IDs are subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string task_id = 1; + */ + protected $task_id = ''; + /** + * Output only. The time required to perform the Task. + * + * Generated from protobuf field .google.protobuf.Duration task_duration = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $task_duration = null; + /** + * Output only. The time window during which the task should be completed. + * This is only set in the response to `GetDeliveryVehicle`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TimeWindow target_time_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target_time_window = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $task_id + * The Task ID. This field won't be populated in the response of a `GetTask` + * call. Task IDs are subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * @type \Google\Protobuf\Duration $task_duration + * Output only. The time required to perform the Task. + * @type \Google\Maps\FleetEngine\Delivery\V1\TimeWindow $target_time_window + * Output only. The time window during which the task should be completed. + * This is only set in the response to `GetDeliveryVehicle`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryVehicles::initOnce(); + parent::__construct($data); + } + + /** + * The Task ID. This field won't be populated in the response of a `GetTask` + * call. Task IDs are subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string task_id = 1; + * @return string + */ + public function getTaskId() + { + return $this->task_id; + } + + /** + * The Task ID. This field won't be populated in the response of a `GetTask` + * call. Task IDs are subject to the following restrictions: + * * Must be a valid Unicode string. + * * Limited to a maximum length of 64 characters. + * * Normalized according to [Unicode Normalization Form C] + * (http://www.unicode.org/reports/tr15/). + * * May not contain any of the following ASCII characters: '/', ':', '?', + * ',', or '#'. + * + * Generated from protobuf field string task_id = 1; + * @param string $var + * @return $this + */ + public function setTaskId($var) + { + GPBUtil::checkString($var, True); + $this->task_id = $var; + + return $this; + } + + /** + * Output only. The time required to perform the Task. + * + * Generated from protobuf field .google.protobuf.Duration task_duration = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getTaskDuration() + { + return $this->task_duration; + } + + public function hasTaskDuration() + { + return isset($this->task_duration); + } + + public function clearTaskDuration() + { + unset($this->task_duration); + } + + /** + * Output only. The time required to perform the Task. + * + * Generated from protobuf field .google.protobuf.Duration task_duration = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTaskDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->task_duration = $var; + + return $this; + } + + /** + * Output only. The time window during which the task should be completed. + * This is only set in the response to `GetDeliveryVehicle`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TimeWindow target_time_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Maps\FleetEngine\Delivery\V1\TimeWindow|null + */ + public function getTargetTimeWindow() + { + return $this->target_time_window; + } + + public function hasTargetTimeWindow() + { + return isset($this->target_time_window); + } + + public function clearTargetTimeWindow() + { + unset($this->target_time_window); + } + + /** + * Output only. The time window during which the task should be completed. + * This is only set in the response to `GetDeliveryVehicle`. + * + * Generated from protobuf field .maps.fleetengine.delivery.v1.TimeWindow target_time_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Maps\FleetEngine\Delivery\V1\TimeWindow $var + * @return $this + */ + public function setTargetTimeWindow($var) + { + GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\TimeWindow::class); + $this->target_time_window = $var; + + return $this; + } + +} + + diff --git a/MapsFleetEngineDelivery/src/V1/gapic_metadata.json b/MapsFleetEngineDelivery/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..bb2fff435e22 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/gapic_metadata.json @@ -0,0 +1,68 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "maps.fleetengine.delivery.v1", + "libraryPackage": "Google\\Maps\\FleetEngine\\Delivery\\V1", + "services": { + "DeliveryService": { + "clients": { + "grpc": { + "libraryClient": "DeliveryServiceGapicClient", + "rpcs": { + "BatchCreateTasks": { + "methods": [ + "batchCreateTasks" + ] + }, + "CreateDeliveryVehicle": { + "methods": [ + "createDeliveryVehicle" + ] + }, + "CreateTask": { + "methods": [ + "createTask" + ] + }, + "GetDeliveryVehicle": { + "methods": [ + "getDeliveryVehicle" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "GetTaskTrackingInfo": { + "methods": [ + "getTaskTrackingInfo" + ] + }, + "ListDeliveryVehicles": { + "methods": [ + "listDeliveryVehicles" + ] + }, + "ListTasks": { + "methods": [ + "listTasks" + ] + }, + "UpdateDeliveryVehicle": { + "methods": [ + "updateDeliveryVehicle" + ] + }, + "UpdateTask": { + "methods": [ + "updateTask" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/MapsFleetEngineDelivery/src/V1/resources/delivery_service_client_config.json b/MapsFleetEngineDelivery/src/V1/resources/delivery_service_client_config.json new file mode 100644 index 000000000000..ec4118ccb923 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/resources/delivery_service_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "maps.fleetengine.delivery.v1.DeliveryService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchCreateTasks": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateDeliveryVehicle": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateTask": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDeliveryVehicle": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTaskTrackingInfo": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDeliveryVehicles": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDeliveryVehicle": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateTask": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/MapsFleetEngineDelivery/src/V1/resources/delivery_service_descriptor_config.php b/MapsFleetEngineDelivery/src/V1/resources/delivery_service_descriptor_config.php new file mode 100644 index 000000000000..165315e83862 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/resources/delivery_service_descriptor_config.php @@ -0,0 +1,202 @@ + [ + 'maps.fleetengine.delivery.v1.DeliveryService' => [ + 'BatchCreateTasks' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\BatchCreateTasksResponse', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'CreateDeliveryVehicle' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'CreateTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\Task', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'GetDeliveryVehicle' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'GetTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\Task', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'GetTaskTrackingInfo' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\TaskTrackingInfo', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'ListDeliveryVehicles' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDeliveryVehicles', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\ListDeliveryVehiclesResponse', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'ListTasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTasks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\ListTasksResponse', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'UpdateDeliveryVehicle' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getDeliveryVehicle', + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'UpdateTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\FleetEngine\Delivery\V1\Task', + 'headerParams' => [ + [ + 'keyName' => 'provider_id', + 'fieldAccessors' => [ + 'getTask', + 'getName', + ], + 'matchers' => [ + '/^(?providers\/[^\/]+)$/', + ], + ], + ], + ], + 'templateMap' => [ + 'deliveryVehicle' => 'providers/{provider}/deliveryVehicles/{vehicle}', + 'provider' => 'providers/{provider}', + 'task' => 'providers/{provider}/tasks/{task}', + 'taskTrackingInfo' => 'providers/{provider}/taskTrackingInfo/{tracking}', + ], + ], + ], +]; diff --git a/MapsFleetEngineDelivery/src/V1/resources/delivery_service_rest_client_config.php b/MapsFleetEngineDelivery/src/V1/resources/delivery_service_rest_client_config.php new file mode 100644 index 000000000000..66575bc17381 --- /dev/null +++ b/MapsFleetEngineDelivery/src/V1/resources/delivery_service_rest_client_config.php @@ -0,0 +1,158 @@ + [ + 'maps.fleetengine.delivery.v1.DeliveryService' => [ + 'BatchCreateTasks' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=providers/*}/tasks:batchCreate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateDeliveryVehicle' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=providers/*}/deliveryVehicles', + 'body' => 'delivery_vehicle', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'delivery_vehicle_id', + ], + ], + 'CreateTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=providers/*}/tasks', + 'body' => 'task', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'task_id', + ], + ], + 'GetDeliveryVehicle' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=providers/*/deliveryVehicles/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=providers/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTaskTrackingInfo' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=providers/*/taskTrackingInfo/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListDeliveryVehicles' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=providers/*}/deliveryVehicles', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=providers/*}/tasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateDeliveryVehicle' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{delivery_vehicle.name=providers/*/deliveryVehicles/*}', + 'body' => 'delivery_vehicle', + 'placeholders' => [ + 'delivery_vehicle.name' => [ + 'getters' => [ + 'getDeliveryVehicle', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateTask' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{task.name=providers/*/tasks/*}', + 'body' => 'task', + 'placeholders' => [ + 'task.name' => [ + 'getters' => [ + 'getTask', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/MapsFleetEngineDelivery/tests/Unit/V1/Client/DeliveryServiceClientTest.php b/MapsFleetEngineDelivery/tests/Unit/V1/Client/DeliveryServiceClientTest.php new file mode 100644 index 000000000000..652f4dc8e724 --- /dev/null +++ b/MapsFleetEngineDelivery/tests/Unit/V1/Client/DeliveryServiceClientTest.php @@ -0,0 +1,863 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return DeliveryServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DeliveryServiceClient($options); + } + + /** @test */ + public function batchCreateTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchCreateTasksResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->providerName('[PROVIDER]'); + $requests = []; + $request = (new BatchCreateTasksRequest())->setParent($formattedParent)->setRequests($requests); + $response = $gapicClient->batchCreateTasks($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/BatchCreateTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchCreateTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->providerName('[PROVIDER]'); + $requests = []; + $request = (new BatchCreateTasksRequest())->setParent($formattedParent)->setRequests($requests); + try { + $gapicClient->batchCreateTasks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDeliveryVehicleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $currentRouteSegment = '-9'; + $expectedResponse = new DeliveryVehicle(); + $expectedResponse->setName($name); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $deliveryVehicleId = 'deliveryVehicleId-1069581255'; + $deliveryVehicle = new DeliveryVehicle(); + $request = (new CreateDeliveryVehicleRequest()) + ->setParent($parent) + ->setDeliveryVehicleId($deliveryVehicleId) + ->setDeliveryVehicle($deliveryVehicle); + $response = $gapicClient->createDeliveryVehicle($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/CreateDeliveryVehicle', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getDeliveryVehicleId(); + $this->assertProtobufEquals($deliveryVehicleId, $actualValue); + $actualValue = $actualRequestObject->getDeliveryVehicle(); + $this->assertProtobufEquals($deliveryVehicle, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDeliveryVehicleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $deliveryVehicleId = 'deliveryVehicleId-1069581255'; + $deliveryVehicle = new DeliveryVehicle(); + $request = (new CreateDeliveryVehicleRequest()) + ->setParent($parent) + ->setDeliveryVehicleId($deliveryVehicleId) + ->setDeliveryVehicle($deliveryVehicle); + try { + $gapicClient->createDeliveryVehicle($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $trackingId = 'trackingId1878901667'; + $deliveryVehicleId = 'deliveryVehicleId-1069581255'; + $expectedResponse = new Task(); + $expectedResponse->setName($name); + $expectedResponse->setTrackingId($trackingId); + $expectedResponse->setDeliveryVehicleId($deliveryVehicleId); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $taskId = 'taskId-1537240555'; + $task = new Task(); + $taskType = Type::TYPE_UNSPECIFIED; + $task->setType($taskType); + $taskState = State::STATE_UNSPECIFIED; + $task->setState($taskState); + $taskTaskDuration = new Duration(); + $task->setTaskDuration($taskTaskDuration); + $request = (new CreateTaskRequest()) + ->setParent($parent) + ->setTaskId($taskId) + ->setTask($task); + $response = $gapicClient->createTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/CreateTask', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getTaskId(); + $this->assertProtobufEquals($taskId, $actualValue); + $actualValue = $actualRequestObject->getTask(); + $this->assertProtobufEquals($task, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $taskId = 'taskId-1537240555'; + $task = new Task(); + $taskType = Type::TYPE_UNSPECIFIED; + $task->setType($taskType); + $taskState = State::STATE_UNSPECIFIED; + $task->setState($taskState); + $taskTaskDuration = new Duration(); + $task->setTaskDuration($taskTaskDuration); + $request = (new CreateTaskRequest()) + ->setParent($parent) + ->setTaskId($taskId) + ->setTask($task); + try { + $gapicClient->createTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDeliveryVehicleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $currentRouteSegment = '-9'; + $expectedResponse = new DeliveryVehicle(); + $expectedResponse->setName($name2); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->deliveryVehicleName('[PROVIDER]', '[VEHICLE]'); + $request = (new GetDeliveryVehicleRequest())->setName($formattedName); + $response = $gapicClient->getDeliveryVehicle($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/GetDeliveryVehicle', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDeliveryVehicleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->deliveryVehicleName('[PROVIDER]', '[VEHICLE]'); + $request = (new GetDeliveryVehicleRequest())->setName($formattedName); + try { + $gapicClient->getDeliveryVehicle($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $trackingId = 'trackingId1878901667'; + $deliveryVehicleId = 'deliveryVehicleId-1069581255'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setTrackingId($trackingId); + $expectedResponse->setDeliveryVehicleId($deliveryVehicleId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROVIDER]', '[TASK]'); + $request = (new GetTaskRequest())->setName($formattedName); + $response = $gapicClient->getTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROVIDER]', '[TASK]'); + $request = (new GetTaskRequest())->setName($formattedName); + try { + $gapicClient->getTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskTrackingInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $trackingId = 'trackingId1878901667'; + $expectedResponse = new TaskTrackingInfo(); + $expectedResponse->setName($name2); + $expectedResponse->setTrackingId($trackingId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskTrackingInfoName('[PROVIDER]', '[TRACKING]'); + $request = (new GetTaskTrackingInfoRequest())->setName($formattedName); + $response = $gapicClient->getTaskTrackingInfo($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/GetTaskTrackingInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskTrackingInfoExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskTrackingInfoName('[PROVIDER]', '[TRACKING]'); + $request = (new GetTaskTrackingInfoRequest())->setName($formattedName); + try { + $gapicClient->getTaskTrackingInfo($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDeliveryVehiclesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $deliveryVehiclesElement = new DeliveryVehicle(); + $deliveryVehicles = [$deliveryVehiclesElement]; + $expectedResponse = new ListDeliveryVehiclesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setDeliveryVehicles($deliveryVehicles); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->providerName('[PROVIDER]'); + $request = (new ListDeliveryVehiclesRequest())->setParent($formattedParent); + $response = $gapicClient->listDeliveryVehicles($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDeliveryVehicles()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/ListDeliveryVehicles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDeliveryVehiclesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->providerName('[PROVIDER]'); + $request = (new ListDeliveryVehiclesRequest())->setParent($formattedParent); + try { + $gapicClient->listDeliveryVehicles($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $tasksElement = new Task(); + $tasks = [$tasksElement]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setTasks($tasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->providerName('[PROVIDER]'); + $request = (new ListTasksRequest())->setParent($formattedParent); + $response = $gapicClient->listTasks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->providerName('[PROVIDER]'); + $request = (new ListTasksRequest())->setParent($formattedParent); + try { + $gapicClient->listTasks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDeliveryVehicleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $currentRouteSegment = '-9'; + $expectedResponse = new DeliveryVehicle(); + $expectedResponse->setName($name); + $expectedResponse->setCurrentRouteSegment($currentRouteSegment); + $transport->addResponse($expectedResponse); + // Mock request + $deliveryVehicle = new DeliveryVehicle(); + $updateMask = new FieldMask(); + $request = (new UpdateDeliveryVehicleRequest()) + ->setDeliveryVehicle($deliveryVehicle) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateDeliveryVehicle($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/UpdateDeliveryVehicle', $actualFuncCall); + $actualValue = $actualRequestObject->getDeliveryVehicle(); + $this->assertProtobufEquals($deliveryVehicle, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDeliveryVehicleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $deliveryVehicle = new DeliveryVehicle(); + $updateMask = new FieldMask(); + $request = (new UpdateDeliveryVehicleRequest()) + ->setDeliveryVehicle($deliveryVehicle) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateDeliveryVehicle($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $trackingId = 'trackingId1878901667'; + $deliveryVehicleId = 'deliveryVehicleId-1069581255'; + $expectedResponse = new Task(); + $expectedResponse->setName($name); + $expectedResponse->setTrackingId($trackingId); + $expectedResponse->setDeliveryVehicleId($deliveryVehicleId); + $transport->addResponse($expectedResponse); + // Mock request + $task = new Task(); + $taskType = Type::TYPE_UNSPECIFIED; + $task->setType($taskType); + $taskState = State::STATE_UNSPECIFIED; + $task->setState($taskState); + $taskTaskDuration = new Duration(); + $task->setTaskDuration($taskTaskDuration); + $updateMask = new FieldMask(); + $request = (new UpdateTaskRequest())->setTask($task)->setUpdateMask($updateMask); + $response = $gapicClient->updateTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/UpdateTask', $actualFuncCall); + $actualValue = $actualRequestObject->getTask(); + $this->assertProtobufEquals($task, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $task = new Task(); + $taskType = Type::TYPE_UNSPECIFIED; + $task->setType($taskType); + $taskState = State::STATE_UNSPECIFIED; + $task->setState($taskState); + $taskTaskDuration = new Duration(); + $task->setTaskDuration($taskTaskDuration); + $updateMask = new FieldMask(); + $request = (new UpdateTaskRequest())->setTask($task)->setUpdateMask($updateMask); + try { + $gapicClient->updateTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchCreateTasksAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchCreateTasksResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->providerName('[PROVIDER]'); + $requests = []; + $request = (new BatchCreateTasksRequest())->setParent($formattedParent)->setRequests($requests); + $response = $gapicClient->batchCreateTasksAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/maps.fleetengine.delivery.v1.DeliveryService/BatchCreateTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/MapsRouteOptimization/.OwlBot.yaml b/MapsRouteOptimization/.OwlBot.yaml new file mode 100644 index 000000000000..408c54437af1 --- /dev/null +++ b/MapsRouteOptimization/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/maps/routeoptimization/(v1)/.*-php/(.*) + dest: /owl-bot-staging/MapsRouteOptimization/$1/$2 +api-name: MapsRouteOptimization diff --git a/MapsRouteOptimization/.gitattributes b/MapsRouteOptimization/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/MapsRouteOptimization/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/MapsRouteOptimization/.github/pull_request_template.md b/MapsRouteOptimization/.github/pull_request_template.md new file mode 100644 index 000000000000..957c01edbc65 --- /dev/null +++ b/MapsRouteOptimization/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `MapsRouteOptimization/src`, and tests in `MapsRouteOptimization/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/MapsRouteOptimization/CONTRIBUTING.md b/MapsRouteOptimization/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/MapsRouteOptimization/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/MapsRouteOptimization/LICENSE b/MapsRouteOptimization/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/MapsRouteOptimization/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/MapsRouteOptimization/README.md b/MapsRouteOptimization/README.md new file mode 100644 index 000000000000..af28ca684341 --- /dev/null +++ b/MapsRouteOptimization/README.md @@ -0,0 +1,45 @@ +# Google Maps Route Optimization for PHP + +> Idiomatic PHP client for [Google Maps Route Optimization](https://developers.google.com/maps/documentation/route-optimization). + +[![Latest Stable Version](https://poser.pugx.org/google/maps-routeoptimization/v/stable)](https://packagist.org/packages/google/maps-routeoptimization) [![Packagist](https://img.shields.io/packagist/dm/google/maps-routeoptimization.svg)](https://packagist.org/packages/google/maps-routeoptimization) + +* [API documentation](https://cloud.google.com/php/docs/reference/maps-routeoptimization/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/maps-routeoptimization +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-maps-routeoptimization/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/maps/documentation/route-optimization). diff --git a/MapsRouteOptimization/VERSION b/MapsRouteOptimization/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/MapsRouteOptimization/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/MapsRouteOptimization/composer.json b/MapsRouteOptimization/composer.json new file mode 100644 index 000000000000..8a3211233826 --- /dev/null +++ b/MapsRouteOptimization/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/maps-routeoptimization", + "description": "Google Maps Route Optimization Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Maps\\RouteOptimization\\": "src", + "GPBMetadata\\Google\\Maps\\Routeoptimization\\": "metadata" + } + }, + "extra": { + "component": { + "id": "maps-routeoptimization", + "path": "MapsRouteOptimization", + "target": "googleapis/php-maps-routeoptimization" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/MapsRouteOptimization/metadata/V1/RouteOptimizationService.php b/MapsRouteOptimization/metadata/V1/RouteOptimizationService.php new file mode 100644 index 0000000000000000000000000000000000000000..827cfb27474fa165cdf329557998b2f9d0c7b480 GIT binary patch literal 17092 zcmcg!OKc-ob~ULVd8u!yKWz5LY_>h_Znr5*{=}i(_K;$!MK>kNB&F^)l++Z-l2p?a zi>@lFTORZ#NQ_K?06`{;Ajl%fB8vbM43cGl1VMJ5Rc4U=EP^Zs2@qtLUG9CKViie| zRD0}RsjJ?*@4fr(=iE>6qfgpLZMc z)^Xcx8g@FF%$JherD{^m7pgaLs$+HRx{*m9TGnCHSUJ|)&WdeyT*GR+=CS#u?wVF> z3 z)2h=ck~E>zsvEcOBsonQ`&!#VKHX2sjqVWZkZt>gmTTB8y}6$^oVsncUCZ9Vp_$B~ z;d%_GC%5m2Wr>`5ki5(K7BT4w8Tztkq-Jl}S` zTgZ3#-0_$8rdCaqM^`^?k3YA1+BWu!y4!3W4xYrM<*koRAsg97!xM!KRIuCL<m$nRwOr;()GFtBJc518#`{&F+P* zSl)$+K{v!8rs${}D-CfgJ*#-{(R6Uuive*#z(xM9G#P*So7Atua3!a^^&_GAMimW` zQ#QWnAOU3=rrWxWLK_byL${;3iC<;I$`Q;RTMeVB)veZndFaH$$%)&swPKntayFaN zXD*b^I;XAr7ExViMA=G-e+|K6?;GU`%r;D?-PBJtvUuH{g_KR0HCyeDD|Ut(3*pAz z8ojXs&GN0Rd<;ZLwqb#s%QXa#sV>M6Ez-UA#K8XyP zU(1aqGw3+!3MWORl|6_#hHlr7IN@nVIQz1M86`&d5!^6aKQ!v-r?msqc3ce)&>_R9 zF{O6mGfa@r!3yRxl^R_02zw+^IULv4(Ne`DOm;pReS(769&&^23#CZVP)cygHV$mV zIno;F+RdgTHywSsO|QZoW<}fR0MV5TzR2x6TF0TQZR$0n>BIp~5K*qfMLLz)Fl=00 zZ)kYFg9Ec3kFnPYP})|zgXYE1+E(+lX|@a}KFi*{4%fYRI17m|zITVsv0?8+T5mS3 zXSl9?Xy8fp22sI3oVJN%*^ccFf)u(m(|H=7XY+2rrH*50hX%@zW7ah^5U!3$!-+4j z_xo=^!h3maAh2*WG_r`G@Ia0DA`S{|zVe5mkdlIn$NF>a1aS?*CtAj^ZOeAzQ#fX7 zGel$NV2bf2zJ$-BsV5M_3nNWnVzvZxd37VZTdZo8QgKgRd_}=Wd)Z&$v#_(JZdWUd;ne2>~ASv8ZMDvV~%n7N{1s)WvY_ zI$Z5CtdA$TI9$>Oaw7G2({QmziMcIPK7nbWNuie$%8M{(bJxQqj~S<^QiLVvso8F$ z;yS_zIcRXm>#UB}stTVf&6n~7mIhrfQTuo_wZO^uJTXy8N|YU#K~CCc-HDUgimiQe zPJ(3=baD%6^Z-OA@h=lFBmP!)A+8@D+QuP;8eIJ~xg7cD*xEazm&2)He zwp{yEQ2<=T`vi9!mtAWpaSy;ZA_fyrjZ+Rp$T*;MbqvO`P$v9ADD{s3b5i=qL^PHA z5bX*w*Oj}Yw=8KOt0IEM5`5hmJ$sK|nv#TN(rX=KvJ*pI6{!>1H)aFhgQdf!Rl_6u zE^zc6yaNkjns;$r35MM|ItDRGVp_&$W}S}^ilR?O+pPQ$65e}h+|fLdj-Zi`uuI<< z%>&6nb_*UB$_sC?Mf9F4ci`q3YdzN-yRNx9VqWsP(V;^dD9LOniDVR&_oC17=`Jo+ z!!X}L=SdR#{^-qDJ-?atW-ABqs+1&+&^@|HN;aVDs+mo6vdjb10{2HRAh| zRQVl91lJ)uZQ2F_LMJ}Q&hXpkTY`cNK>^X^A_9@R(J;_!Yj&rJ`<`b+$1urq-~3j0 zJUV40llVmlE=kbabJ34s(zc#CsJLU=jNn3psiw=;GmKG|dTgM6$P7X>u?`b7;vPh$ zkjV`U0qgTHjfNgk3lf>Q9ZLLL2&VM_fh1`)}4@%2c5=?Fw)l=&*shuFRX1~Qp`Q&?uhO~AlFynGQ-Y3|BRew z_Hhb@W{QN8`ABA4g?OSrLwQne!j-;PbS-Q)MMYD}dvKfcSaU5;j5OOopG|%QgA%mX zS`%}YJm3j&F?u*~nqFgpM$fb;9wxSSwhSrX$0&l`b6^hy5yZk2rwpZl05f35Sm+Y% zB6^Beq6(^;dDyaS0}UI>d*Xj5VKyKpZ^5E&+a@}Ct!dR+oWL|Lwze#9myB_`sJq41 zp_1P;BjWVbpN1_%?1U@=^QIh6`s9Nm-Dsi?i+%F~AP|!)T@V;sJ4Z%=ZHQ1~ z;u1{KA|#CZu?NB@zLUk7b@m&Y+?#Mm8=!jw^*{ADVYn*UJqS!7Mke*();g+Ka3P3V zPI=~sRAhebv+=KXz*^}ZAVU}-^;HO#2Rx^sys*7q+S;B+su+8J4^lLwupM}zRSH{}7RYX^rQHf<0m7;O3S&qw zB3jzK9}>L@w*|cgpq30RK8`sL}XS;>6N?DCT480ClhA}e*H+mVFMfMlgAMWmm zWCp*vAhU5yUM&{()bbNPY9jU3GR(*@s252jNwbv##1N&QU~>By1%=u4`L%aPGe}TP zBSy!`#0#`>^E`YS$5iL!;BR22@4zetUfyy%VjJigzR!nxi}5(^JU#)VVi6otG(->~ zsw_f;MSk>zLNWqoN;ibmq{rYH%kz1R4Oo;>rALRy`sbtbI>f~VO9!MKcbcx*ZW;^= z2ryNF#ZIe<=9iM7n58u9r!12>zcxmYBZXmCQrKYxlx>I+Nsd*V_zmW{&OwjdL6HEK z$V?!ZA;;K_m02DW6MvVy$Na1a30W*n`N|MwalH3W&8Ed7i@3tx;k6!^&v88SxXbJr zPp&pJ^FZXBu=Z;lx82kD1$-aD$o2xu`gy^C0Am;NZES4}^ep+67ga5GMl1tRz)Y&> z-4sWcm%bU@EpNLb>=)a;%*c-6s$~?(xA`U9GM?i`HI5p*y&hP$ctln>9%q-mHNGWL zi6{e|k}VsS&Hhi0f=2_N0Mu+lf64;p_!V}5H%Bj#qd62DcX97koa@KE*YN+5#4p1T z^@L8j2oXvgkq9%xIKi_;1gWh9^eFNjx$OzG$k#k6>tNwu(`y#S334b4Ktq^|U6w`? z6@#Vs5jcr#;TRPYDLURR(chzUL>kH?SmNf;Png@pZ$vn;3K4G+M199*i?ajm-vly& zA$!i7+%!xQUve>sdi+WJPZ%o%0a0IpS>m3Q9T7?l354Fogt+9nH;YFULuTFaT?yF( zO+P?h^;`+R)Q{on7ahGpwg0*|pu0gHLkw9e18;e^?;s_NSbQt?lVxd+16c4RL>SKiUe5*b`WR{SKEY#{{RePs9K8*!eLJ}J*-T}*le+PSs$c*EbuQxjlL^tvcogj*((;1Ph7xhN}Q2B;TUR05}2zG~OASrfV z$^)2h1OWz5betPtpnbrUq<$*e2+p<-sXq!q#LE_a3=uC9;2Jdsyf2EZ(&j5z_KIMS z4JPBw2Gg-9KBIIoR{u4NkRYM}iXS7?suQAwfn1ISsi`tVBsIhWGngjSu&YZb_rRd! z0?Zs?!5c+{YFznY$fgffBh17qd z@X0I+@5n(+dLnAnm~fQk5Ja%vW8T2Q_5XcP~BUDK)Df~!ZmBYS%AJ`N1s=~fXbIUhk#J%l5w@@`Ie)izn(eWClP~;qm2?W9-3lzc}DP^Uo zmyYz#(mE~u1bh7S8fK-KlT}s`P7n&{TI`WA7*6Ri$lRn2VgB1N_e{rF-811lF*sxf zF2cpxn=-PV6O>Kf963xj`)v*{6rNildu>kL=ME6gNYgV$BXdyEyGArE!a@o*d7PPO z!&2WvjK+K&L!Sl%z;o1xh0bwLM{BYm^g6_REBfk349zEQ!a^@2u*AfQl7yg0tr{@J z&1vweM#7RnU2l}{#yrYGuZaxsWk4s@S5vUi+s=o>{FV~`>-X&in89q9gIEp~iOl#I z=&)x6ta1>6#E&Oon*XUhq>`jp9~h^#CfI{0NMf5A77DQC)Oe1cNnk^rgcJNg#6i)+ z@jbX9$6yd+V4n=8Xm$M9$HYzmmS7|^5l#I(43muL1z23~ZxWpc*e?0%RJY*OytrtV)i7~$@dTIGW1uI+Ys#Yv) z6{?F9<4)TxW3jEYEv8K>AHfG>tR}J^`QYp+4x;dW1c-Gpq+zvORD$sh>~6Qhz5UnsMwZ#-RV0Vod4Bc?Tsa&(t92F-lLAKBGJe ztA9t%0!=>$AfD;}HoV2zu9NozR3S>?Lz5YBURfIBTYM$I z!!#s@^!|V2w(5cX)4aLqCHkkop!$-GjadiKbJhVPE$kQt`?C*=CQ*_uBi`YZ6Ms4h z7Y4mhzCfhz4U-9g{r%Bl&^dR223u|h&BcPx7_b&8;^kE0zrz5&abKV(GBE$ioa+2q z?c3Z`x=1Ubd6{>Q=pzvezciyRoiWm*_*F-D4p(Syu~;OL`tuM>apIH!Rw>sU{P5s) zxLH<<*~i*mp;D-_QhPR^2SCmCaHyk9p!XNDml>o~MG%0V+9;-Z^3X;N%LQ z!#-f>Avuxyg9*46Xye}NX~$>TI^m|L`g#Y+@J6w*b((#cC#83c65X&h)9i!IvVmXy zViw7ulmq*K1T(6RqaX4{c$SRB4ob`#P<@%T3h^&YqKThjYiAD)JVy6RH_TQFyd&TN z7V#LEWC==4()|E?%R4pfwZyLtS?~~B`^}z-S~(d&(XhmcjqjMsjw+{hz*F**UK9DQk^%;&5zS#md8n0C&f7|VU>%(G~Y(*?=ko0 z|27XX+yd_Gm@Lt>(M)euMkPytr>esp}B+xI*Q{j%{*?&Q6y~ z!F+Hh{bTN8!Klj=Od4FquaL4DbuM9pOi+^}F!^bvw2jJ&IB}<3s+P2>`nb9nUi&|U zI}ED}(P!*ZevQ?GfG#Lwbg>5}P_Gd3F)>DyK+in!_2kj-{qjG460W6I=@a=M@o!b{ z{bQBC3WL)B8K*KvwAMdM9{akK zG~d_1Y43CG)K5cSXFnMB@u)K3!_qDB;Xh+cGxh%90|psW>-zwhxU-VFJ9zSo%)kkW z>etz%jUS%|e!D;%5xeq6}KL05O{#y(}s2S;f{4s`Khi`F0nG8|NWco;D rGJC7FX_Ro+dgl%AYxjHnhYftcgMf)_EZq + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/MapsRouteOptimization/samples/V1/RouteOptimizationClient/batch_optimize_tours.php b/MapsRouteOptimization/samples/V1/RouteOptimizationClient/batch_optimize_tours.php new file mode 100644 index 000000000000..8747d8bbf89f --- /dev/null +++ b/MapsRouteOptimization/samples/V1/RouteOptimizationClient/batch_optimize_tours.php @@ -0,0 +1,121 @@ +setDataFormat($modelConfigsInputConfigDataFormat); + $modelConfigsOutputConfig = (new OutputConfig()) + ->setDataFormat($modelConfigsOutputConfigDataFormat); + $asyncModelConfig = (new AsyncModelConfig()) + ->setInputConfig($modelConfigsInputConfig) + ->setOutputConfig($modelConfigsOutputConfig); + $modelConfigs = [$asyncModelConfig,]; + $request = (new BatchOptimizeToursRequest()) + ->setParent($parent) + ->setModelConfigs($modelConfigs); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $routeOptimizationClient->batchOptimizeTours($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchOptimizeToursResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $parent = '[PARENT]'; + $modelConfigsInputConfigDataFormat = DataFormat::DATA_FORMAT_UNSPECIFIED; + $modelConfigsOutputConfigDataFormat = DataFormat::DATA_FORMAT_UNSPECIFIED; + + batch_optimize_tours_sample( + $parent, + $modelConfigsInputConfigDataFormat, + $modelConfigsOutputConfigDataFormat + ); +} +// [END routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_sync] diff --git a/MapsRouteOptimization/samples/V1/RouteOptimizationClient/optimize_tours.php b/MapsRouteOptimization/samples/V1/RouteOptimizationClient/optimize_tours.php new file mode 100644 index 000000000000..8ad98f631377 --- /dev/null +++ b/MapsRouteOptimization/samples/V1/RouteOptimizationClient/optimize_tours.php @@ -0,0 +1,89 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var OptimizeToursResponse $response */ + $response = $routeOptimizationClient->optimizeTours($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 +{ + $parent = '[PARENT]'; + + optimize_tours_sample($parent); +} +// [END routeoptimization_v1_generated_RouteOptimization_OptimizeTours_sync] diff --git a/MapsRouteOptimization/src/V1/AggregatedMetrics.php b/MapsRouteOptimization/src/V1/AggregatedMetrics.php new file mode 100644 index 000000000000..a4e7c9fdc222 --- /dev/null +++ b/MapsRouteOptimization/src/V1/AggregatedMetrics.php @@ -0,0 +1,454 @@ +google.maps.routeoptimization.v1.AggregatedMetrics + */ +class AggregatedMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Number of shipments performed. Note that a pickup and delivery pair only + * counts once. + * + * Generated from protobuf field int32 performed_shipment_count = 1; + */ + protected $performed_shipment_count = 0; + /** + * Total travel duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 2; + */ + protected $travel_duration = null; + /** + * Total wait duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 3; + */ + protected $wait_duration = null; + /** + * Total delay duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + */ + protected $delay_duration = null; + /** + * Total break duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + */ + protected $break_duration = null; + /** + * Total visit duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration visit_duration = 6; + */ + protected $visit_duration = null; + /** + * The total duration should be equal to the sum of all durations above. + * For routes, it also corresponds to: + * ``` + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + * - + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + * ``` + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + */ + protected $total_duration = null; + /** + * Total travel distance for a route or a solution. + * + * Generated from protobuf field double travel_distance_meters = 8; + */ + protected $travel_distance_meters = 0.0; + /** + * Maximum load achieved over the entire route (resp. solution), for each of + * the quantities on this route (resp. solution), computed as the maximum over + * all + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + * (resp. + * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + * + * Generated from protobuf field map max_loads = 9; + */ + private $max_loads; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $performed_shipment_count + * Number of shipments performed. Note that a pickup and delivery pair only + * counts once. + * @type \Google\Protobuf\Duration $travel_duration + * Total travel duration for a route or a solution. + * @type \Google\Protobuf\Duration $wait_duration + * Total wait duration for a route or a solution. + * @type \Google\Protobuf\Duration $delay_duration + * Total delay duration for a route or a solution. + * @type \Google\Protobuf\Duration $break_duration + * Total break duration for a route or a solution. + * @type \Google\Protobuf\Duration $visit_duration + * Total visit duration for a route or a solution. + * @type \Google\Protobuf\Duration $total_duration + * The total duration should be equal to the sum of all durations above. + * For routes, it also corresponds to: + * ``` + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + * - + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + * ``` + * @type float $travel_distance_meters + * Total travel distance for a route or a solution. + * @type array|\Google\Protobuf\Internal\MapField $max_loads + * Maximum load achieved over the entire route (resp. solution), for each of + * the quantities on this route (resp. solution), computed as the maximum over + * all + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + * (resp. + * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Number of shipments performed. Note that a pickup and delivery pair only + * counts once. + * + * Generated from protobuf field int32 performed_shipment_count = 1; + * @return int + */ + public function getPerformedShipmentCount() + { + return $this->performed_shipment_count; + } + + /** + * Number of shipments performed. Note that a pickup and delivery pair only + * counts once. + * + * Generated from protobuf field int32 performed_shipment_count = 1; + * @param int $var + * @return $this + */ + public function setPerformedShipmentCount($var) + { + GPBUtil::checkInt32($var); + $this->performed_shipment_count = $var; + + return $this; + } + + /** + * Total travel duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTravelDuration() + { + return $this->travel_duration; + } + + public function hasTravelDuration() + { + return isset($this->travel_duration); + } + + public function clearTravelDuration() + { + unset($this->travel_duration); + } + + /** + * Total travel duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTravelDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->travel_duration = $var; + + return $this; + } + + /** + * Total wait duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getWaitDuration() + { + return $this->wait_duration; + } + + public function hasWaitDuration() + { + return isset($this->wait_duration); + } + + public function clearWaitDuration() + { + unset($this->wait_duration); + } + + /** + * Total wait duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWaitDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait_duration = $var; + + return $this; + } + + /** + * Total delay duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getDelayDuration() + { + return $this->delay_duration; + } + + public function hasDelayDuration() + { + return isset($this->delay_duration); + } + + public function clearDelayDuration() + { + unset($this->delay_duration); + } + + /** + * Total delay duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDelayDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->delay_duration = $var; + + return $this; + } + + /** + * Total break duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getBreakDuration() + { + return $this->break_duration; + } + + public function hasBreakDuration() + { + return isset($this->break_duration); + } + + public function clearBreakDuration() + { + unset($this->break_duration); + } + + /** + * Total break duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBreakDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->break_duration = $var; + + return $this; + } + + /** + * Total visit duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration visit_duration = 6; + * @return \Google\Protobuf\Duration|null + */ + public function getVisitDuration() + { + return $this->visit_duration; + } + + public function hasVisitDuration() + { + return isset($this->visit_duration); + } + + public function clearVisitDuration() + { + unset($this->visit_duration); + } + + /** + * Total visit duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration visit_duration = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setVisitDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->visit_duration = $var; + + return $this; + } + + /** + * The total duration should be equal to the sum of all durations above. + * For routes, it also corresponds to: + * ``` + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + * - + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + * ``` + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + * @return \Google\Protobuf\Duration|null + */ + public function getTotalDuration() + { + return $this->total_duration; + } + + public function hasTotalDuration() + { + return isset($this->total_duration); + } + + public function clearTotalDuration() + { + unset($this->total_duration); + } + + /** + * The total duration should be equal to the sum of all durations above. + * For routes, it also corresponds to: + * ``` + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + * - + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + * ``` + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTotalDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->total_duration = $var; + + return $this; + } + + /** + * Total travel distance for a route or a solution. + * + * Generated from protobuf field double travel_distance_meters = 8; + * @return float + */ + public function getTravelDistanceMeters() + { + return $this->travel_distance_meters; + } + + /** + * Total travel distance for a route or a solution. + * + * Generated from protobuf field double travel_distance_meters = 8; + * @param float $var + * @return $this + */ + public function setTravelDistanceMeters($var) + { + GPBUtil::checkDouble($var); + $this->travel_distance_meters = $var; + + return $this; + } + + /** + * Maximum load achieved over the entire route (resp. solution), for each of + * the quantities on this route (resp. solution), computed as the maximum over + * all + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + * (resp. + * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + * + * Generated from protobuf field map max_loads = 9; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMaxLoads() + { + return $this->max_loads; + } + + /** + * Maximum load achieved over the entire route (resp. solution), for each of + * the quantities on this route (resp. solution), computed as the maximum over + * all + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + * (resp. + * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + * + * Generated from protobuf field map max_loads = 9; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMaxLoads($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\VehicleLoad::class); + $this->max_loads = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/BatchOptimizeToursMetadata.php b/MapsRouteOptimization/src/V1/BatchOptimizeToursMetadata.php new file mode 100644 index 000000000000..50b825aa8a7e --- /dev/null +++ b/MapsRouteOptimization/src/V1/BatchOptimizeToursMetadata.php @@ -0,0 +1,33 @@ +google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + */ +class BatchOptimizeToursMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest.php b/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest.php new file mode 100644 index 000000000000..3c9fbf3f7c0d --- /dev/null +++ b/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest.php @@ -0,0 +1,125 @@ +google.maps.routeoptimization.v1.BatchOptimizeToursRequest + */ +class BatchOptimizeToursRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Target project and location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $model_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Target project and location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * @type array<\Google\Maps\RouteOptimization\V1\BatchOptimizeToursRequest\AsyncModelConfig>|\Google\Protobuf\Internal\RepeatedField $model_configs + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Target project and location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Target project and location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModelConfigs() + { + return $this->model_configs; + } + + /** + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Maps\RouteOptimization\V1\BatchOptimizeToursRequest\AsyncModelConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModelConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\BatchOptimizeToursRequest\AsyncModelConfig::class); + $this->model_configs = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php b/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php new file mode 100644 index 000000000000..816ed3274e2a --- /dev/null +++ b/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php @@ -0,0 +1,160 @@ +google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + */ +class AsyncModelConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. User defined model name, can be used as alias by users to keep + * track of models. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Required. Information about the input model. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + /** + * Required. The desired output location information. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * Optional. User defined model name, can be used as alias by users to keep + * track of models. + * @type \Google\Maps\RouteOptimization\V1\InputConfig $input_config + * Required. Information about the input model. + * @type \Google\Maps\RouteOptimization\V1\OutputConfig $output_config + * Required. The desired output location information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. User defined model name, can be used as alias by users to keep + * track of models. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. User defined model name, can be used as alias by users to keep + * track of models. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. Information about the input model. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\RouteOptimization\V1\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. Information about the input model. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\RouteOptimization\V1\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\InputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Required. The desired output location information. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\RouteOptimization\V1\OutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. The desired output location information. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\RouteOptimization\V1\OutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\OutputConfig::class); + $this->output_config = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/BatchOptimizeToursResponse.php b/MapsRouteOptimization/src/V1/BatchOptimizeToursResponse.php new file mode 100644 index 000000000000..2b0e02bf139a --- /dev/null +++ b/MapsRouteOptimization/src/V1/BatchOptimizeToursResponse.php @@ -0,0 +1,34 @@ +google.maps.routeoptimization.v1.BatchOptimizeToursResponse + */ +class BatchOptimizeToursResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/MapsRouteOptimization/src/V1/BreakRule.php b/MapsRouteOptimization/src/V1/BreakRule.php new file mode 100644 index 000000000000..500ac900d732 --- /dev/null +++ b/MapsRouteOptimization/src/V1/BreakRule.php @@ -0,0 +1,113 @@ +google.maps.routeoptimization.v1.BreakRule + */ +class BreakRule extends \Google\Protobuf\Internal\Message +{ + /** + * Sequence of breaks. See the `BreakRequest` message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + */ + private $break_requests; + /** + * Several `FrequencyConstraint` may apply. They must all be satisfied by + * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + */ + private $frequency_constraints; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\BreakRule\BreakRequest>|\Google\Protobuf\Internal\RepeatedField $break_requests + * Sequence of breaks. See the `BreakRequest` message. + * @type array<\Google\Maps\RouteOptimization\V1\BreakRule\FrequencyConstraint>|\Google\Protobuf\Internal\RepeatedField $frequency_constraints + * Several `FrequencyConstraint` may apply. They must all be satisfied by + * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Sequence of breaks. See the `BreakRequest` message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBreakRequests() + { + return $this->break_requests; + } + + /** + * Sequence of breaks. See the `BreakRequest` message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * @param array<\Google\Maps\RouteOptimization\V1\BreakRule\BreakRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBreakRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\BreakRule\BreakRequest::class); + $this->break_requests = $arr; + + return $this; + } + + /** + * Several `FrequencyConstraint` may apply. They must all be satisfied by + * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrequencyConstraints() + { + return $this->frequency_constraints; + } + + /** + * Several `FrequencyConstraint` may apply. They must all be satisfied by + * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * @param array<\Google\Maps\RouteOptimization\V1\BreakRule\FrequencyConstraint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrequencyConstraints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\BreakRule\FrequencyConstraint::class); + $this->frequency_constraints = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/BreakRule/BreakRequest.php b/MapsRouteOptimization/src/V1/BreakRule/BreakRequest.php new file mode 100644 index 000000000000..b51b217abec7 --- /dev/null +++ b/MapsRouteOptimization/src/V1/BreakRule/BreakRequest.php @@ -0,0 +1,170 @@ +google.maps.routeoptimization.v1.BreakRule.BreakRequest + */ +class BreakRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Lower bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $earliest_start_time = null; + /** + * Required. Upper bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $latest_start_time = null; + /** + * Required. Minimum duration of the break. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $min_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $earliest_start_time + * Required. Lower bound (inclusive) on the start of the break. + * @type \Google\Protobuf\Timestamp $latest_start_time + * Required. Upper bound (inclusive) on the start of the break. + * @type \Google\Protobuf\Duration $min_duration + * Required. Minimum duration of the break. Must be positive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Lower bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEarliestStartTime() + { + return $this->earliest_start_time; + } + + public function hasEarliestStartTime() + { + return isset($this->earliest_start_time); + } + + public function clearEarliestStartTime() + { + unset($this->earliest_start_time); + } + + /** + * Required. Lower bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEarliestStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->earliest_start_time = $var; + + return $this; + } + + /** + * Required. Upper bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLatestStartTime() + { + return $this->latest_start_time; + } + + public function hasLatestStartTime() + { + return isset($this->latest_start_time); + } + + public function clearLatestStartTime() + { + unset($this->latest_start_time); + } + + /** + * Required. Upper bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLatestStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->latest_start_time = $var; + + return $this; + } + + /** + * Required. Minimum duration of the break. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getMinDuration() + { + return $this->min_duration; + } + + public function hasMinDuration() + { + return isset($this->min_duration); + } + + public function clearMinDuration() + { + unset($this->min_duration); + } + + /** + * Required. Minimum duration of the break. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->min_duration = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/BreakRule/FrequencyConstraint.php b/MapsRouteOptimization/src/V1/BreakRule/FrequencyConstraint.php new file mode 100644 index 000000000000..f1244ad33963 --- /dev/null +++ b/MapsRouteOptimization/src/V1/BreakRule/FrequencyConstraint.php @@ -0,0 +1,164 @@ +google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + */ +class FrequencyConstraint extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Minimum break duration for this constraint. Nonnegative. + * See description of `FrequencyConstraint`. + * + * Generated from protobuf field .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $min_break_duration = null; + /** + * Required. Maximum allowed span of any interval of time in the route that + * does not include at least partially a break of `duration >= + * min_break_duration`. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max_inter_break_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $min_break_duration + * Required. Minimum break duration for this constraint. Nonnegative. + * See description of `FrequencyConstraint`. + * @type \Google\Protobuf\Duration $max_inter_break_duration + * Required. Maximum allowed span of any interval of time in the route that + * does not include at least partially a break of `duration >= + * min_break_duration`. Must be positive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Minimum break duration for this constraint. Nonnegative. + * See description of `FrequencyConstraint`. + * + * Generated from protobuf field .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getMinBreakDuration() + { + return $this->min_break_duration; + } + + public function hasMinBreakDuration() + { + return isset($this->min_break_duration); + } + + public function clearMinBreakDuration() + { + unset($this->min_break_duration); + } + + /** + * Required. Minimum break duration for this constraint. Nonnegative. + * See description of `FrequencyConstraint`. + * + * Generated from protobuf field .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinBreakDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->min_break_duration = $var; + + return $this; + } + + /** + * Required. Maximum allowed span of any interval of time in the route that + * does not include at least partially a break of `duration >= + * min_break_duration`. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxInterBreakDuration() + { + return $this->max_inter_break_duration; + } + + public function hasMaxInterBreakDuration() + { + return isset($this->max_inter_break_duration); + } + + public function clearMaxInterBreakDuration() + { + unset($this->max_inter_break_duration); + } + + /** + * Required. Maximum allowed span of any interval of time in the route that + * does not include at least partially a break of `duration >= + * min_break_duration`. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxInterBreakDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_inter_break_duration = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Client/RouteOptimizationClient.php b/MapsRouteOptimization/src/V1/Client/RouteOptimizationClient.php new file mode 100644 index 000000000000..7c6f11e105cb --- /dev/null +++ b/MapsRouteOptimization/src/V1/Client/RouteOptimizationClient.php @@ -0,0 +1,311 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/route_optimization_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/route_optimization_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/route_optimization_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/route_optimization_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'routeoptimization.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Optimizes vehicle tours for one or more `OptimizeToursRequest` + * messages as a batch. + * + * This method is a Long Running Operation (LRO). The inputs for optimization + * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` + * messages) are read/written from/to Cloud Storage in user-specified + * format. Like the `OptimizeTours` method, each `OptimizeToursRequest` + * contains a `ShipmentModel` and returns an `OptimizeToursResponse` + * containing `ShipmentRoute`s, which are a set of routes to be performed by + * vehicles minimizing the overall cost. + * + * The async variant is {@see RouteOptimizationClient::batchOptimizeToursAsync()} . + * + * @example samples/V1/RouteOptimizationClient/batch_optimize_tours.php + * + * @param BatchOptimizeToursRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchOptimizeTours(BatchOptimizeToursRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchOptimizeTours', $request, $callOptions)->wait(); + } + + /** + * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an + * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of + * routes to be performed by vehicles minimizing the overall cost. + * + * A `ShipmentModel` model consists mainly of `Shipment`s that need to be + * carried out and `Vehicle`s that can be used to transport the `Shipment`s. + * The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically, + * they assign a series of `Visit`s to each vehicle, where a `Visit` + * corresponds to a `VisitRequest`, which is a pickup or delivery for a + * `Shipment`. + * + * The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that + * minimizes the total cost where cost has many components defined in the + * `ShipmentModel`. + * + * The async variant is {@see RouteOptimizationClient::optimizeToursAsync()} . + * + * @example samples/V1/RouteOptimizationClient/optimize_tours.php + * + * @param OptimizeToursRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OptimizeToursResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function optimizeTours(OptimizeToursRequest $request, array $callOptions = []): OptimizeToursResponse + { + return $this->startApiCall('OptimizeTours', $request, $callOptions)->wait(); + } +} diff --git a/MapsRouteOptimization/src/V1/DataFormat.php b/MapsRouteOptimization/src/V1/DataFormat.php new file mode 100644 index 000000000000..76303e93fb37 --- /dev/null +++ b/MapsRouteOptimization/src/V1/DataFormat.php @@ -0,0 +1,62 @@ +google.maps.routeoptimization.v1.DataFormat + */ +class DataFormat +{ + /** + * Invalid value, format must not be UNSPECIFIED. + * + * Generated from protobuf enum DATA_FORMAT_UNSPECIFIED = 0; + */ + const DATA_FORMAT_UNSPECIFIED = 0; + /** + * JavaScript Object Notation. + * + * Generated from protobuf enum JSON = 1; + */ + const JSON = 1; + /** + * Protocol Buffers text format. See + * https://protobuf.dev/reference/protobuf/textformat-spec/ + * + * Generated from protobuf enum PROTO_TEXT = 2; + */ + const PROTO_TEXT = 2; + + private static $valueToName = [ + self::DATA_FORMAT_UNSPECIFIED => 'DATA_FORMAT_UNSPECIFIED', + self::JSON => 'JSON', + self::PROTO_TEXT => 'PROTO_TEXT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsRouteOptimization/src/V1/DistanceLimit.php b/MapsRouteOptimization/src/V1/DistanceLimit.php new file mode 100644 index 000000000000..3d2f4d3910e5 --- /dev/null +++ b/MapsRouteOptimization/src/V1/DistanceLimit.php @@ -0,0 +1,216 @@ +google.maps.routeoptimization.v1.DistanceLimit + */ +class DistanceLimit extends \Google\Protobuf\Internal\Message +{ + /** + * A hard limit constraining the distance to be at most max_meters. The limit + * must be nonnegative. + * + * Generated from protobuf field optional int64 max_meters = 1; + */ + protected $max_meters = null; + /** + * A soft limit not enforcing a maximum distance limit, but when violated + * results in a cost which adds up to other costs defined in the model, + * with the same unit. + * If defined soft_max_meters must be less than max_meters and must be + * nonnegative. + * + * Generated from protobuf field optional int64 soft_max_meters = 2; + */ + protected $soft_max_meters = null; + /** + * Cost per kilometer incurred if distance is above `soft_max_meters` limit. + * The additional cost is 0 if the distance is under the limit, otherwise the + * formula used to compute the cost is the following: + * ``` + * (distance_meters - soft_max_meters) / 1000.0 * + * cost_per_kilometer_above_soft_max. + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_kilometer_above_soft_max = 3; + */ + protected $cost_per_kilometer_above_soft_max = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $max_meters + * A hard limit constraining the distance to be at most max_meters. The limit + * must be nonnegative. + * @type int|string $soft_max_meters + * A soft limit not enforcing a maximum distance limit, but when violated + * results in a cost which adds up to other costs defined in the model, + * with the same unit. + * If defined soft_max_meters must be less than max_meters and must be + * nonnegative. + * @type float $cost_per_kilometer_above_soft_max + * Cost per kilometer incurred if distance is above `soft_max_meters` limit. + * The additional cost is 0 if the distance is under the limit, otherwise the + * formula used to compute the cost is the following: + * ``` + * (distance_meters - soft_max_meters) / 1000.0 * + * cost_per_kilometer_above_soft_max. + * ``` + * The cost must be nonnegative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A hard limit constraining the distance to be at most max_meters. The limit + * must be nonnegative. + * + * Generated from protobuf field optional int64 max_meters = 1; + * @return int|string + */ + public function getMaxMeters() + { + return isset($this->max_meters) ? $this->max_meters : 0; + } + + public function hasMaxMeters() + { + return isset($this->max_meters); + } + + public function clearMaxMeters() + { + unset($this->max_meters); + } + + /** + * A hard limit constraining the distance to be at most max_meters. The limit + * must be nonnegative. + * + * Generated from protobuf field optional int64 max_meters = 1; + * @param int|string $var + * @return $this + */ + public function setMaxMeters($var) + { + GPBUtil::checkInt64($var); + $this->max_meters = $var; + + return $this; + } + + /** + * A soft limit not enforcing a maximum distance limit, but when violated + * results in a cost which adds up to other costs defined in the model, + * with the same unit. + * If defined soft_max_meters must be less than max_meters and must be + * nonnegative. + * + * Generated from protobuf field optional int64 soft_max_meters = 2; + * @return int|string + */ + public function getSoftMaxMeters() + { + return isset($this->soft_max_meters) ? $this->soft_max_meters : 0; + } + + public function hasSoftMaxMeters() + { + return isset($this->soft_max_meters); + } + + public function clearSoftMaxMeters() + { + unset($this->soft_max_meters); + } + + /** + * A soft limit not enforcing a maximum distance limit, but when violated + * results in a cost which adds up to other costs defined in the model, + * with the same unit. + * If defined soft_max_meters must be less than max_meters and must be + * nonnegative. + * + * Generated from protobuf field optional int64 soft_max_meters = 2; + * @param int|string $var + * @return $this + */ + public function setSoftMaxMeters($var) + { + GPBUtil::checkInt64($var); + $this->soft_max_meters = $var; + + return $this; + } + + /** + * Cost per kilometer incurred if distance is above `soft_max_meters` limit. + * The additional cost is 0 if the distance is under the limit, otherwise the + * formula used to compute the cost is the following: + * ``` + * (distance_meters - soft_max_meters) / 1000.0 * + * cost_per_kilometer_above_soft_max. + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_kilometer_above_soft_max = 3; + * @return float + */ + public function getCostPerKilometerAboveSoftMax() + { + return isset($this->cost_per_kilometer_above_soft_max) ? $this->cost_per_kilometer_above_soft_max : 0.0; + } + + public function hasCostPerKilometerAboveSoftMax() + { + return isset($this->cost_per_kilometer_above_soft_max); + } + + public function clearCostPerKilometerAboveSoftMax() + { + unset($this->cost_per_kilometer_above_soft_max); + } + + /** + * Cost per kilometer incurred if distance is above `soft_max_meters` limit. + * The additional cost is 0 if the distance is under the limit, otherwise the + * formula used to compute the cost is the following: + * ``` + * (distance_meters - soft_max_meters) / 1000.0 * + * cost_per_kilometer_above_soft_max. + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_kilometer_above_soft_max = 3; + * @param float $var + * @return $this + */ + public function setCostPerKilometerAboveSoftMax($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_kilometer_above_soft_max = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/GcsDestination.php b/MapsRouteOptimization/src/V1/GcsDestination.php new file mode 100644 index 000000000000..593d35570a86 --- /dev/null +++ b/MapsRouteOptimization/src/V1/GcsDestination.php @@ -0,0 +1,68 @@ +google.maps.routeoptimization.v1.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage URI. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. Google Cloud Storage URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage URI. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. Google Cloud Storage URI. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/GcsSource.php b/MapsRouteOptimization/src/V1/GcsSource.php new file mode 100644 index 000000000000..a4b7083b7252 --- /dev/null +++ b/MapsRouteOptimization/src/V1/GcsSource.php @@ -0,0 +1,71 @@ +google.maps.routeoptimization.v1.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI of a Google Cloud Storage object with the format + * `gs://bucket/path/to/object`. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI of a Google Cloud Storage object with the format + * `gs://bucket/path/to/object`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI of a Google Cloud Storage object with the format + * `gs://bucket/path/to/object`. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI of a Google Cloud Storage object with the format + * `gs://bucket/path/to/object`. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/InjectedSolutionConstraint.php b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint.php new file mode 100644 index 000000000000..bfb8197f0531 --- /dev/null +++ b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint.php @@ -0,0 +1,156 @@ +google.maps.routeoptimization.v1.InjectedSolutionConstraint + */ +class InjectedSolutionConstraint extends \Google\Protobuf\Internal\Message +{ + /** + * Routes of the solution to inject. Some routes may be omitted from the + * original solution. The routes and skipped shipments must satisfy the basic + * validity assumptions listed for `injected_first_solution_routes`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + private $routes; + /** + * Skipped shipments of the solution to inject. Some may be omitted from the + * original solution. See the `routes` field. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + private $skipped_shipments; + /** + * For zero or more groups of vehicles, specifies when and how much to relax + * constraints. If this field is empty, all non-empty vehicle routes are + * fully constrained. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + */ + private $constraint_relaxations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $routes + * Routes of the solution to inject. Some routes may be omitted from the + * original solution. The routes and skipped shipments must satisfy the basic + * validity assumptions listed for `injected_first_solution_routes`. + * @type array<\Google\Maps\RouteOptimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $skipped_shipments + * Skipped shipments of the solution to inject. Some may be omitted from the + * original solution. See the `routes` field. + * @type array<\Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation>|\Google\Protobuf\Internal\RepeatedField $constraint_relaxations + * For zero or more groups of vehicles, specifies when and how much to relax + * constraints. If this field is empty, all non-empty vehicle routes are + * fully constrained. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Routes of the solution to inject. Some routes may be omitted from the + * original solution. The routes and skipped shipments must satisfy the basic + * validity assumptions listed for `injected_first_solution_routes`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoutes() + { + return $this->routes; + } + + /** + * Routes of the solution to inject. Some routes may be omitted from the + * original solution. The routes and skipped shipments must satisfy the basic + * validity assumptions listed for `injected_first_solution_routes`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute::class); + $this->routes = $arr; + + return $this; + } + + /** + * Skipped shipments of the solution to inject. Some may be omitted from the + * original solution. See the `routes` field. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSkippedShipments() + { + return $this->skipped_shipments; + } + + /** + * Skipped shipments of the solution to inject. Some may be omitted from the + * original solution. See the `routes` field. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * @param array<\Google\Maps\RouteOptimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSkippedShipments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\SkippedShipment::class); + $this->skipped_shipments = $arr; + + return $this; + } + + /** + * For zero or more groups of vehicles, specifies when and how much to relax + * constraints. If this field is empty, all non-empty vehicle routes are + * fully constrained. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConstraintRelaxations() + { + return $this->constraint_relaxations; + } + + /** + * For zero or more groups of vehicles, specifies when and how much to relax + * constraints. If this field is empty, all non-empty vehicle routes are + * fully constrained. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * @param array<\Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConstraintRelaxations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation::class); + $this->constraint_relaxations = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation.php b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation.php new file mode 100644 index 000000000000..3396bf44f295 --- /dev/null +++ b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation.php @@ -0,0 +1,149 @@ +google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + */ +class ConstraintRelaxation extends \Google\Protobuf\Internal\Message +{ + /** + * All the visit constraint relaxations that will apply to visits on + * routes with vehicles in `vehicle_indices`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + */ + private $relaxations; + /** + * Specifies the vehicle indices to which the visit constraint + * `relaxations` apply. If empty, this is considered the default and the + * `relaxations` apply to all vehicles that are not specified in other + * `constraint_relaxations`. There can be at most one default, i.e., at + * most one constraint relaxation field is allowed empty + * `vehicle_indices`. A vehicle index can only be listed once, even within + * several `constraint_relaxations`. + * A vehicle index is mapped the same as + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + * if `interpret_injected_solutions_using_labels` is true (see `fields` + * comment). + * + * Generated from protobuf field repeated int32 vehicle_indices = 2; + */ + private $vehicle_indices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation\Relaxation>|\Google\Protobuf\Internal\RepeatedField $relaxations + * All the visit constraint relaxations that will apply to visits on + * routes with vehicles in `vehicle_indices`. + * @type array|\Google\Protobuf\Internal\RepeatedField $vehicle_indices + * Specifies the vehicle indices to which the visit constraint + * `relaxations` apply. If empty, this is considered the default and the + * `relaxations` apply to all vehicles that are not specified in other + * `constraint_relaxations`. There can be at most one default, i.e., at + * most one constraint relaxation field is allowed empty + * `vehicle_indices`. A vehicle index can only be listed once, even within + * several `constraint_relaxations`. + * A vehicle index is mapped the same as + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + * if `interpret_injected_solutions_using_labels` is true (see `fields` + * comment). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * All the visit constraint relaxations that will apply to visits on + * routes with vehicles in `vehicle_indices`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelaxations() + { + return $this->relaxations; + } + + /** + * All the visit constraint relaxations that will apply to visits on + * routes with vehicles in `vehicle_indices`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * @param array<\Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation\Relaxation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelaxations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation\Relaxation::class); + $this->relaxations = $arr; + + return $this; + } + + /** + * Specifies the vehicle indices to which the visit constraint + * `relaxations` apply. If empty, this is considered the default and the + * `relaxations` apply to all vehicles that are not specified in other + * `constraint_relaxations`. There can be at most one default, i.e., at + * most one constraint relaxation field is allowed empty + * `vehicle_indices`. A vehicle index can only be listed once, even within + * several `constraint_relaxations`. + * A vehicle index is mapped the same as + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + * if `interpret_injected_solutions_using_labels` is true (see `fields` + * comment). + * + * Generated from protobuf field repeated int32 vehicle_indices = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVehicleIndices() + { + return $this->vehicle_indices; + } + + /** + * Specifies the vehicle indices to which the visit constraint + * `relaxations` apply. If empty, this is considered the default and the + * `relaxations` apply to all vehicles that are not specified in other + * `constraint_relaxations`. There can be at most one default, i.e., at + * most one constraint relaxation field is allowed empty + * `vehicle_indices`. A vehicle index can only be listed once, even within + * several `constraint_relaxations`. + * A vehicle index is mapped the same as + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + * if `interpret_injected_solutions_using_labels` is true (see `fields` + * comment). + * + * Generated from protobuf field repeated int32 vehicle_indices = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVehicleIndices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->vehicle_indices = $arr; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php new file mode 100644 index 000000000000..822319bc2403 --- /dev/null +++ b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php @@ -0,0 +1,202 @@ += relaxations(i).threshold_time` AND + * * `j + 1 >= relaxations(i).threshold_visit_count` + * Similarly, the vehicle start is relaxed to `relaxations(i).level` if it + * satisfies: + * * `vehicle_start_time >= relaxations(i).threshold_time` AND + * * `relaxations(i).threshold_visit_count == 0` + * and the vehicle end is relaxed to `relaxations(i).level` if it satisfies: + * * `vehicle_end_time >= relaxations(i).threshold_time` AND + * * `route.visits_size() + 1 >= relaxations(i).threshold_visit_count` + * To apply a relaxation level if a visit meets the `threshold_visit_count` + * OR the `threshold_time` add two `relaxations` with the same `level`: + * one with only `threshold_visit_count` set and the other with only + * `threshold_time` set. If a visit satisfies the conditions of multiple + * `relaxations`, the most relaxed level applies. As a result, from the + * vehicle start through the route visits in order to the vehicle end, the + * relaxation level becomes more relaxed: i.e., the relaxation level is + * non-decreasing as the route progresses. + * The timing and sequence of route visits that do not satisfy the + * threshold conditions of any `relaxations` are fully constrained + * and no visits may be inserted into these sequences. Also, if a + * vehicle start or end does not satisfy the conditions of any + * relaxation the time is fixed, unless the vehicle is empty. + * + * Generated from protobuf message google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + */ +class Relaxation extends \Google\Protobuf\Internal\Message +{ + /** + * The constraint relaxation level that applies when the conditions + * at or after `threshold_time` AND at least `threshold_visit_count` are + * satisfied. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + */ + protected $level = 0; + /** + * The time at or after which the relaxation `level` may be applied. + * + * Generated from protobuf field .google.protobuf.Timestamp threshold_time = 2; + */ + protected $threshold_time = null; + /** + * The number of visits at or after which the relaxation `level` may be + * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + * applied directly at the vehicle start. + * If it is `route.visits_size() + 1`, the `level` may only be applied to + * the vehicle end. If it is more than `route.visits_size() + 1`, + * `level` is not applied at all for that route. + * + * Generated from protobuf field int32 threshold_visit_count = 3; + */ + protected $threshold_visit_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $level + * The constraint relaxation level that applies when the conditions + * at or after `threshold_time` AND at least `threshold_visit_count` are + * satisfied. + * @type \Google\Protobuf\Timestamp $threshold_time + * The time at or after which the relaxation `level` may be applied. + * @type int $threshold_visit_count + * The number of visits at or after which the relaxation `level` may be + * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + * applied directly at the vehicle start. + * If it is `route.visits_size() + 1`, the `level` may only be applied to + * the vehicle end. If it is more than `route.visits_size() + 1`, + * `level` is not applied at all for that route. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The constraint relaxation level that applies when the conditions + * at or after `threshold_time` AND at least `threshold_visit_count` are + * satisfied. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * @return int + */ + public function getLevel() + { + return $this->level; + } + + /** + * The constraint relaxation level that applies when the conditions + * at or after `threshold_time` AND at least `threshold_visit_count` are + * satisfied. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * @param int $var + * @return $this + */ + public function setLevel($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation\Relaxation\Level::class); + $this->level = $var; + + return $this; + } + + /** + * The time at or after which the relaxation `level` may be applied. + * + * Generated from protobuf field .google.protobuf.Timestamp threshold_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getThresholdTime() + { + return $this->threshold_time; + } + + public function hasThresholdTime() + { + return isset($this->threshold_time); + } + + public function clearThresholdTime() + { + unset($this->threshold_time); + } + + /** + * The time at or after which the relaxation `level` may be applied. + * + * Generated from protobuf field .google.protobuf.Timestamp threshold_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setThresholdTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->threshold_time = $var; + + return $this; + } + + /** + * The number of visits at or after which the relaxation `level` may be + * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + * applied directly at the vehicle start. + * If it is `route.visits_size() + 1`, the `level` may only be applied to + * the vehicle end. If it is more than `route.visits_size() + 1`, + * `level` is not applied at all for that route. + * + * Generated from protobuf field int32 threshold_visit_count = 3; + * @return int + */ + public function getThresholdVisitCount() + { + return $this->threshold_visit_count; + } + + /** + * The number of visits at or after which the relaxation `level` may be + * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + * applied directly at the vehicle start. + * If it is `route.visits_size() + 1`, the `level` may only be applied to + * the vehicle end. If it is more than `route.visits_size() + 1`, + * `level` is not applied at all for that route. + * + * Generated from protobuf field int32 threshold_visit_count = 3; + * @param int $var + * @return $this + */ + public function setThresholdVisitCount($var) + { + GPBUtil::checkInt32($var); + $this->threshold_visit_count = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation/Level.php b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation/Level.php new file mode 100644 index 000000000000..8c55ffabcb54 --- /dev/null +++ b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation/Level.php @@ -0,0 +1,80 @@ +google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level + */ +class Level +{ + /** + * Implicit default relaxation level: no constraints are relaxed, + * i.e., all visits are fully constrained. + * This value must not be explicitly used in `level`. + * + * Generated from protobuf enum LEVEL_UNSPECIFIED = 0; + */ + const LEVEL_UNSPECIFIED = 0; + /** + * Visit start times and vehicle start/end times will be relaxed, but + * each visit remains bound to the same vehicle and the visit sequence + * must be observed: no visit can be inserted between them or before + * them. + * + * Generated from protobuf enum RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1; + */ + const RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1; + /** + * Same as `RELAX_VISIT_TIMES_AFTER_THRESHOLD`, but the visit sequence + * is also relaxed: visits remain simply bound to their vehicle. + * + * Generated from protobuf enum RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2; + */ + const RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2; + /** + * Same as `RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD`, but the + * vehicle is also relaxed: visits are completely free at or after the + * threshold time and can potentially become unperformed. + * + * Generated from protobuf enum RELAX_ALL_AFTER_THRESHOLD = 3; + */ + const RELAX_ALL_AFTER_THRESHOLD = 3; + + private static $valueToName = [ + self::LEVEL_UNSPECIFIED => 'LEVEL_UNSPECIFIED', + self::RELAX_VISIT_TIMES_AFTER_THRESHOLD => 'RELAX_VISIT_TIMES_AFTER_THRESHOLD', + self::RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD => 'RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD', + self::RELAX_ALL_AFTER_THRESHOLD => 'RELAX_ALL_AFTER_THRESHOLD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/InputConfig.php b/MapsRouteOptimization/src/V1/InputConfig.php new file mode 100644 index 000000000000..1ce8d31e1dbd --- /dev/null +++ b/MapsRouteOptimization/src/V1/InputConfig.php @@ -0,0 +1,110 @@ +google.maps.routeoptimization.v1.InputConfig + */ +class InputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The input data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_format = 0; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\RouteOptimization\V1\GcsSource $gcs_source + * A Google Cloud Storage location. This must be a single object (file). + * @type int $data_format + * Required. The input data format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A Google Cloud Storage location. This must be a single object (file). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * @return \Google\Maps\RouteOptimization\V1\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(1); + } + + public function hasGcsSource() + { + return $this->hasOneof(1); + } + + /** + * A Google Cloud Storage location. This must be a single object (file). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * @param \Google\Maps\RouteOptimization\V1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\GcsSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Required. The input data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDataFormat() + { + return $this->data_format; + } + + /** + * Required. The input data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDataFormat($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\DataFormat::class); + $this->data_format = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/MapsRouteOptimization/src/V1/Location.php b/MapsRouteOptimization/src/V1/Location.php new file mode 100644 index 000000000000..fd6c1e3bb48d --- /dev/null +++ b/MapsRouteOptimization/src/V1/Location.php @@ -0,0 +1,133 @@ +google.maps.routeoptimization.v1.Location + */ +class Location extends \Google\Protobuf\Internal\Message +{ + /** + * The waypoint's geographic coordinates. + * + * Generated from protobuf field .google.type.LatLng lat_lng = 1; + */ + protected $lat_lng = null; + /** + * The compass heading associated with the direction of the flow of traffic. + * This value is used to specify the side of the road to use for pickup and + * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + * of due North, 90 specifies a heading of due East, etc. + * + * Generated from protobuf field optional int32 heading = 2; + */ + protected $heading = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $lat_lng + * The waypoint's geographic coordinates. + * @type int $heading + * The compass heading associated with the direction of the flow of traffic. + * This value is used to specify the side of the road to use for pickup and + * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + * of due North, 90 specifies a heading of due East, etc. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The waypoint's geographic coordinates. + * + * Generated from protobuf field .google.type.LatLng lat_lng = 1; + * @return \Google\Type\LatLng|null + */ + public function getLatLng() + { + return $this->lat_lng; + } + + public function hasLatLng() + { + return isset($this->lat_lng); + } + + public function clearLatLng() + { + unset($this->lat_lng); + } + + /** + * The waypoint's geographic coordinates. + * + * Generated from protobuf field .google.type.LatLng lat_lng = 1; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setLatLng($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->lat_lng = $var; + + return $this; + } + + /** + * The compass heading associated with the direction of the flow of traffic. + * This value is used to specify the side of the road to use for pickup and + * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + * of due North, 90 specifies a heading of due East, etc. + * + * Generated from protobuf field optional int32 heading = 2; + * @return int + */ + public function getHeading() + { + return isset($this->heading) ? $this->heading : 0; + } + + public function hasHeading() + { + return isset($this->heading); + } + + public function clearHeading() + { + unset($this->heading); + } + + /** + * The compass heading associated with the direction of the flow of traffic. + * This value is used to specify the side of the road to use for pickup and + * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + * of due North, 90 specifies a heading of due East, etc. + * + * Generated from protobuf field optional int32 heading = 2; + * @param int $var + * @return $this + */ + public function setHeading($var) + { + GPBUtil::checkInt32($var); + $this->heading = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursRequest.php b/MapsRouteOptimization/src/V1/OptimizeToursRequest.php new file mode 100644 index 000000000000..2f96a735eb6f --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursRequest.php @@ -0,0 +1,1178 @@ +google.maps.routeoptimization.v1.OptimizeToursRequest + */ +class OptimizeToursRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 2; + */ + protected $timeout = null; + /** + * Shipment model to solve. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + protected $model = null; + /** + * By default, the solving mode is `DEFAULT_SOLVE` (0). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + */ + protected $solving_mode = 0; + /** + * Search mode used to solve the request. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + */ + protected $search_mode = 0; + /** + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits[0].start_time <= visits[1].start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + * is empty or its `vehicle_index` is included in + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + */ + private $injected_first_solution_routes; + /** + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + */ + protected $injected_solution_constraint = null; + /** + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + */ + private $refresh_details_routes; + /** + * If true: + * * uses + * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to new + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to update + * [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * instead of + * [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + * request; + * * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + * the request; + * * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + * * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + * + * Generated from protobuf field bool interpret_injected_solutions_using_labels = 10; + */ + protected $interpret_injected_solutions_using_labels = false; + /** + * Consider traffic estimation in calculating `ShipmentRoute` fields + * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + * and `vehicle_end_time`; in setting the + * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + * field, and in calculating the + * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + * field. + * + * Generated from protobuf field bool consider_road_traffic = 11; + */ + protected $consider_road_traffic = false; + /** + * If true, polylines will be populated in response `ShipmentRoute`s. + * + * Generated from protobuf field bool populate_polylines = 12; + */ + protected $populate_polylines = false; + /** + * If true, polylines will be populated in response + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + * + * Generated from protobuf field bool populate_transition_polylines = 13; + */ + protected $populate_transition_polylines = false; + /** + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + * + * Generated from protobuf field bool allow_large_deadline_despite_interruption_risk = 14; + */ + protected $allow_large_deadline_despite_interruption_risk = false; + /** + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + * + * Generated from protobuf field bool use_geodesic_distances = 15; + */ + protected $use_geodesic_distances = false; + /** + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + * + * Generated from protobuf field optional double geodesic_meters_per_second = 16; + */ + protected $geodesic_meters_per_second = null; + /** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field. + * This defaults to 100 and is capped at 10,000. + * + * Generated from protobuf field optional int32 max_validation_errors = 5; + */ + protected $max_validation_errors = null; + /** + * Label that may be used to identify this request, reported back in the + * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + * + * Generated from protobuf field string label = 17; + */ + protected $label = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * @type \Google\Protobuf\Duration $timeout + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + * @type \Google\Maps\RouteOptimization\V1\ShipmentModel $model + * Shipment model to solve. + * @type int $solving_mode + * By default, the solving mode is `DEFAULT_SOLVE` (0). + * @type int $search_mode + * Search mode used to solve the request. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $injected_first_solution_routes + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits[0].start_time <= visits[1].start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + * is empty or its `vehicle_index` is included in + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * @type \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint $injected_solution_constraint + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $refresh_details_routes + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + * @type bool $interpret_injected_solutions_using_labels + * If true: + * * uses + * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to new + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to update + * [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * instead of + * [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + * request; + * * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + * the request; + * * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + * * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + * @type bool $consider_road_traffic + * Consider traffic estimation in calculating `ShipmentRoute` fields + * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + * and `vehicle_end_time`; in setting the + * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + * field, and in calculating the + * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + * field. + * @type bool $populate_polylines + * If true, polylines will be populated in response `ShipmentRoute`s. + * @type bool $populate_transition_polylines + * If true, polylines will be populated in response + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + * @type bool $allow_large_deadline_despite_interruption_risk + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + * @type bool $use_geodesic_distances + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + * @type float $geodesic_meters_per_second + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + * @type int $max_validation_errors + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field. + * This defaults to 100 and is capped at 10,000. + * @type string $label + * Label that may be used to identify this request, reported back in the + * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Shipment model to solve. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * @return \Google\Maps\RouteOptimization\V1\ShipmentModel|null + */ + public function getModel() + { + return $this->model; + } + + public function hasModel() + { + return isset($this->model); + } + + public function clearModel() + { + unset($this->model); + } + + /** + * Shipment model to solve. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * @param \Google\Maps\RouteOptimization\V1\ShipmentModel $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\ShipmentModel::class); + $this->model = $var; + + return $this; + } + + /** + * By default, the solving mode is `DEFAULT_SOLVE` (0). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * @return int + */ + public function getSolvingMode() + { + return $this->solving_mode; + } + + /** + * By default, the solving mode is `DEFAULT_SOLVE` (0). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * @param int $var + * @return $this + */ + public function setSolvingMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\OptimizeToursRequest\SolvingMode::class); + $this->solving_mode = $var; + + return $this; + } + + /** + * Search mode used to solve the request. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * @return int + */ + public function getSearchMode() + { + return $this->search_mode; + } + + /** + * Search mode used to solve the request. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * @param int $var + * @return $this + */ + public function setSearchMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\OptimizeToursRequest\SearchMode::class); + $this->search_mode = $var; + + return $this; + } + + /** + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits[0].start_time <= visits[1].start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + * is empty or its `vehicle_index` is included in + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInjectedFirstSolutionRoutes() + { + return $this->injected_first_solution_routes; + } + + /** + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits[0].start_time <= visits[1].start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + * is empty or its `vehicle_index` is included in + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInjectedFirstSolutionRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute::class); + $this->injected_first_solution_routes = $arr; + + return $this; + } + + /** + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * @return \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint|null + */ + public function getInjectedSolutionConstraint() + { + return $this->injected_solution_constraint; + } + + public function hasInjectedSolutionConstraint() + { + return isset($this->injected_solution_constraint); + } + + public function clearInjectedSolutionConstraint() + { + unset($this->injected_solution_constraint); + } + + /** + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * @param \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint $var + * @return $this + */ + public function setInjectedSolutionConstraint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint::class); + $this->injected_solution_constraint = $var; + + return $this; + } + + /** + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRefreshDetailsRoutes() + { + return $this->refresh_details_routes; + } + + /** + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRefreshDetailsRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute::class); + $this->refresh_details_routes = $arr; + + return $this; + } + + /** + * If true: + * * uses + * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to new + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to update + * [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * instead of + * [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + * request; + * * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + * the request; + * * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + * * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + * + * Generated from protobuf field bool interpret_injected_solutions_using_labels = 10; + * @return bool + */ + public function getInterpretInjectedSolutionsUsingLabels() + { + return $this->interpret_injected_solutions_using_labels; + } + + /** + * If true: + * * uses + * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to new + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to update + * [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * instead of + * [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + * request; + * * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + * the request; + * * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + * * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + * + * Generated from protobuf field bool interpret_injected_solutions_using_labels = 10; + * @param bool $var + * @return $this + */ + public function setInterpretInjectedSolutionsUsingLabels($var) + { + GPBUtil::checkBool($var); + $this->interpret_injected_solutions_using_labels = $var; + + return $this; + } + + /** + * Consider traffic estimation in calculating `ShipmentRoute` fields + * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + * and `vehicle_end_time`; in setting the + * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + * field, and in calculating the + * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + * field. + * + * Generated from protobuf field bool consider_road_traffic = 11; + * @return bool + */ + public function getConsiderRoadTraffic() + { + return $this->consider_road_traffic; + } + + /** + * Consider traffic estimation in calculating `ShipmentRoute` fields + * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + * and `vehicle_end_time`; in setting the + * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + * field, and in calculating the + * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + * field. + * + * Generated from protobuf field bool consider_road_traffic = 11; + * @param bool $var + * @return $this + */ + public function setConsiderRoadTraffic($var) + { + GPBUtil::checkBool($var); + $this->consider_road_traffic = $var; + + return $this; + } + + /** + * If true, polylines will be populated in response `ShipmentRoute`s. + * + * Generated from protobuf field bool populate_polylines = 12; + * @return bool + */ + public function getPopulatePolylines() + { + return $this->populate_polylines; + } + + /** + * If true, polylines will be populated in response `ShipmentRoute`s. + * + * Generated from protobuf field bool populate_polylines = 12; + * @param bool $var + * @return $this + */ + public function setPopulatePolylines($var) + { + GPBUtil::checkBool($var); + $this->populate_polylines = $var; + + return $this; + } + + /** + * If true, polylines will be populated in response + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + * + * Generated from protobuf field bool populate_transition_polylines = 13; + * @return bool + */ + public function getPopulateTransitionPolylines() + { + return $this->populate_transition_polylines; + } + + /** + * If true, polylines will be populated in response + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + * + * Generated from protobuf field bool populate_transition_polylines = 13; + * @param bool $var + * @return $this + */ + public function setPopulateTransitionPolylines($var) + { + GPBUtil::checkBool($var); + $this->populate_transition_polylines = $var; + + return $this; + } + + /** + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + * + * Generated from protobuf field bool allow_large_deadline_despite_interruption_risk = 14; + * @return bool + */ + public function getAllowLargeDeadlineDespiteInterruptionRisk() + { + return $this->allow_large_deadline_despite_interruption_risk; + } + + /** + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + * + * Generated from protobuf field bool allow_large_deadline_despite_interruption_risk = 14; + * @param bool $var + * @return $this + */ + public function setAllowLargeDeadlineDespiteInterruptionRisk($var) + { + GPBUtil::checkBool($var); + $this->allow_large_deadline_despite_interruption_risk = $var; + + return $this; + } + + /** + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + * + * Generated from protobuf field bool use_geodesic_distances = 15; + * @return bool + */ + public function getUseGeodesicDistances() + { + return $this->use_geodesic_distances; + } + + /** + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + * + * Generated from protobuf field bool use_geodesic_distances = 15; + * @param bool $var + * @return $this + */ + public function setUseGeodesicDistances($var) + { + GPBUtil::checkBool($var); + $this->use_geodesic_distances = $var; + + return $this; + } + + /** + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + * + * Generated from protobuf field optional double geodesic_meters_per_second = 16; + * @return float + */ + public function getGeodesicMetersPerSecond() + { + return isset($this->geodesic_meters_per_second) ? $this->geodesic_meters_per_second : 0.0; + } + + public function hasGeodesicMetersPerSecond() + { + return isset($this->geodesic_meters_per_second); + } + + public function clearGeodesicMetersPerSecond() + { + unset($this->geodesic_meters_per_second); + } + + /** + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + * + * Generated from protobuf field optional double geodesic_meters_per_second = 16; + * @param float $var + * @return $this + */ + public function setGeodesicMetersPerSecond($var) + { + GPBUtil::checkDouble($var); + $this->geodesic_meters_per_second = $var; + + return $this; + } + + /** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field. + * This defaults to 100 and is capped at 10,000. + * + * Generated from protobuf field optional int32 max_validation_errors = 5; + * @return int + */ + public function getMaxValidationErrors() + { + return isset($this->max_validation_errors) ? $this->max_validation_errors : 0; + } + + public function hasMaxValidationErrors() + { + return isset($this->max_validation_errors); + } + + public function clearMaxValidationErrors() + { + unset($this->max_validation_errors); + } + + /** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field. + * This defaults to 100 and is capped at 10,000. + * + * Generated from protobuf field optional int32 max_validation_errors = 5; + * @param int $var + * @return $this + */ + public function setMaxValidationErrors($var) + { + GPBUtil::checkInt32($var); + $this->max_validation_errors = $var; + + return $this; + } + + /** + * Label that may be used to identify this request, reported back in the + * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + * + * Generated from protobuf field string label = 17; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Label that may be used to identify this request, reported back in the + * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + * + * Generated from protobuf field string label = 17; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursRequest/SearchMode.php b/MapsRouteOptimization/src/V1/OptimizeToursRequest/SearchMode.php new file mode 100644 index 000000000000..eb2c4660db47 --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursRequest/SearchMode.php @@ -0,0 +1,63 @@ +google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode + */ +class SearchMode +{ + /** + * Unspecified search mode, equivalent to `RETURN_FAST`. + * + * Generated from protobuf enum SEARCH_MODE_UNSPECIFIED = 0; + */ + const SEARCH_MODE_UNSPECIFIED = 0; + /** + * Stop the search after finding the first good solution. + * + * Generated from protobuf enum RETURN_FAST = 1; + */ + const RETURN_FAST = 1; + /** + * Spend all the available time to search for better solutions. + * + * Generated from protobuf enum CONSUME_ALL_AVAILABLE_TIME = 2; + */ + const CONSUME_ALL_AVAILABLE_TIME = 2; + + private static $valueToName = [ + self::SEARCH_MODE_UNSPECIFIED => 'SEARCH_MODE_UNSPECIFIED', + self::RETURN_FAST => 'RETURN_FAST', + self::CONSUME_ALL_AVAILABLE_TIME => 'CONSUME_ALL_AVAILABLE_TIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursRequest/SolvingMode.php b/MapsRouteOptimization/src/V1/OptimizeToursRequest/SolvingMode.php new file mode 100644 index 000000000000..856705ff2d8e --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursRequest/SolvingMode.php @@ -0,0 +1,81 @@ +google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode + */ +class SolvingMode +{ + /** + * Solve the model. + * + * Generated from protobuf enum DEFAULT_SOLVE = 0; + */ + const DEFAULT_SOLVE = 0; + /** + * Only validates the model without solving it: populates as many + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * as possible. + * + * Generated from protobuf enum VALIDATE_ONLY = 1; + */ + const VALIDATE_ONLY = 1; + /** + * Only populates + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * or + * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments], + * and doesn't actually solve the rest of the request (`status` and `routes` + * are unset in the response). + * If infeasibilities in `injected_solution_constraint` routes are detected + * they are populated in the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field and + * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments] + * is left empty. + * *IMPORTANT*: not all infeasible shipments are returned here, but only the + * ones that are detected as infeasible during preprocessing. + * + * Generated from protobuf enum DETECT_SOME_INFEASIBLE_SHIPMENTS = 2; + */ + const DETECT_SOME_INFEASIBLE_SHIPMENTS = 2; + + private static $valueToName = [ + self::DEFAULT_SOLVE => 'DEFAULT_SOLVE', + self::VALIDATE_ONLY => 'VALIDATE_ONLY', + self::DETECT_SOME_INFEASIBLE_SHIPMENTS => 'DETECT_SOME_INFEASIBLE_SHIPMENTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursResponse.php b/MapsRouteOptimization/src/V1/OptimizeToursResponse.php new file mode 100644 index 000000000000..c82b1fbd15aa --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursResponse.php @@ -0,0 +1,239 @@ +google.maps.routeoptimization.v1.OptimizeToursResponse + */ +class OptimizeToursResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Routes computed for each vehicle; the i-th route corresponds to the i-th + * vehicle in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + private $routes; + /** + * Copy of the + * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + * if a label was specified in the request. + * + * Generated from protobuf field string request_label = 3; + */ + protected $request_label = ''; + /** + * The list of all shipments skipped. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + private $skipped_shipments; + /** + * List of all the validation errors that we were able to detect + * independently. See the "MULTIPLE ERRORS" explanation for the + * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + * message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + */ + private $validation_errors; + /** + * Duration, distance and usage metrics for this solution. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + protected $metrics = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $routes + * Routes computed for each vehicle; the i-th route corresponds to the i-th + * vehicle in the model. + * @type string $request_label + * Copy of the + * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + * if a label was specified in the request. + * @type array<\Google\Maps\RouteOptimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $skipped_shipments + * The list of all shipments skipped. + * @type array<\Google\Maps\RouteOptimization\V1\OptimizeToursValidationError>|\Google\Protobuf\Internal\RepeatedField $validation_errors + * List of all the validation errors that we were able to detect + * independently. See the "MULTIPLE ERRORS" explanation for the + * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + * message. + * @type \Google\Maps\RouteOptimization\V1\OptimizeToursResponse\Metrics $metrics + * Duration, distance and usage metrics for this solution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Routes computed for each vehicle; the i-th route corresponds to the i-th + * vehicle in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoutes() + { + return $this->routes; + } + + /** + * Routes computed for each vehicle; the i-th route corresponds to the i-th + * vehicle in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute::class); + $this->routes = $arr; + + return $this; + } + + /** + * Copy of the + * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + * if a label was specified in the request. + * + * Generated from protobuf field string request_label = 3; + * @return string + */ + public function getRequestLabel() + { + return $this->request_label; + } + + /** + * Copy of the + * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + * if a label was specified in the request. + * + * Generated from protobuf field string request_label = 3; + * @param string $var + * @return $this + */ + public function setRequestLabel($var) + { + GPBUtil::checkString($var, True); + $this->request_label = $var; + + return $this; + } + + /** + * The list of all shipments skipped. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSkippedShipments() + { + return $this->skipped_shipments; + } + + /** + * The list of all shipments skipped. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * @param array<\Google\Maps\RouteOptimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSkippedShipments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\SkippedShipment::class); + $this->skipped_shipments = $arr; + + return $this; + } + + /** + * List of all the validation errors that we were able to detect + * independently. See the "MULTIPLE ERRORS" explanation for the + * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + * message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValidationErrors() + { + return $this->validation_errors; + } + + /** + * List of all the validation errors that we were able to detect + * independently. See the "MULTIPLE ERRORS" explanation for the + * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + * message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * @param array<\Google\Maps\RouteOptimization\V1\OptimizeToursValidationError>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValidationErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError::class); + $this->validation_errors = $arr; + + return $this; + } + + /** + * Duration, distance and usage metrics for this solution. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * @return \Google\Maps\RouteOptimization\V1\OptimizeToursResponse\Metrics|null + */ + public function getMetrics() + { + return $this->metrics; + } + + public function hasMetrics() + { + return isset($this->metrics); + } + + public function clearMetrics() + { + unset($this->metrics); + } + + /** + * Duration, distance and usage metrics for this solution. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * @param \Google\Maps\RouteOptimization\V1\OptimizeToursResponse\Metrics $var + * @return $this + */ + public function setMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\OptimizeToursResponse\Metrics::class); + $this->metrics = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursResponse/Metrics.php b/MapsRouteOptimization/src/V1/OptimizeToursResponse/Metrics.php new file mode 100644 index 000000000000..e118c9adfa89 --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursResponse/Metrics.php @@ -0,0 +1,370 @@ +google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + */ +class Metrics extends \Google\Protobuf\Internal\Message +{ + /** + * Aggregated over the routes. Each metric is the sum (or max, for loads) + * over all + * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + * fields of the same name. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + */ + protected $aggregated_route_metrics = null; + /** + * Number of mandatory shipments skipped. + * + * Generated from protobuf field int32 skipped_mandatory_shipment_count = 2; + */ + protected $skipped_mandatory_shipment_count = 0; + /** + * Number of vehicles used. Note: if a vehicle route is empty and + * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + * is true, the vehicle is considered used. + * + * Generated from protobuf field int32 used_vehicle_count = 3; + */ + protected $used_vehicle_count = 0; + /** + * The earliest start time for a used vehicle, computed as the minimum over + * all used vehicles of + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + protected $earliest_vehicle_start_time = null; + /** + * The latest end time for a used vehicle, computed as the maximum over all + * used vehicles of + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + protected $latest_vehicle_end_time = null; + /** + * Cost of the solution, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, + * e.g. "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole + * solution. In other words, costs["model.shipments.pickups.cost"] is the + * sum of all pickup costs over the solution. All costs defined in the model + * are reported in detail here with the exception of costs related to + * TransitionAttributes that are only reported in an aggregated way as of + * 2022/01. + * + * Generated from protobuf field map costs = 10; + */ + private $costs; + /** + * Total cost of the solution. The sum of all values in the costs map. + * + * Generated from protobuf field double total_cost = 6; + */ + protected $total_cost = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\RouteOptimization\V1\AggregatedMetrics $aggregated_route_metrics + * Aggregated over the routes. Each metric is the sum (or max, for loads) + * over all + * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + * fields of the same name. + * @type int $skipped_mandatory_shipment_count + * Number of mandatory shipments skipped. + * @type int $used_vehicle_count + * Number of vehicles used. Note: if a vehicle route is empty and + * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + * is true, the vehicle is considered used. + * @type \Google\Protobuf\Timestamp $earliest_vehicle_start_time + * The earliest start time for a used vehicle, computed as the minimum over + * all used vehicles of + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + * @type \Google\Protobuf\Timestamp $latest_vehicle_end_time + * The latest end time for a used vehicle, computed as the maximum over all + * used vehicles of + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + * @type array|\Google\Protobuf\Internal\MapField $costs + * Cost of the solution, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, + * e.g. "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole + * solution. In other words, costs["model.shipments.pickups.cost"] is the + * sum of all pickup costs over the solution. All costs defined in the model + * are reported in detail here with the exception of costs related to + * TransitionAttributes that are only reported in an aggregated way as of + * 2022/01. + * @type float $total_cost + * Total cost of the solution. The sum of all values in the costs map. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Aggregated over the routes. Each metric is the sum (or max, for loads) + * over all + * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + * fields of the same name. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * @return \Google\Maps\RouteOptimization\V1\AggregatedMetrics|null + */ + public function getAggregatedRouteMetrics() + { + return $this->aggregated_route_metrics; + } + + public function hasAggregatedRouteMetrics() + { + return isset($this->aggregated_route_metrics); + } + + public function clearAggregatedRouteMetrics() + { + unset($this->aggregated_route_metrics); + } + + /** + * Aggregated over the routes. Each metric is the sum (or max, for loads) + * over all + * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + * fields of the same name. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * @param \Google\Maps\RouteOptimization\V1\AggregatedMetrics $var + * @return $this + */ + public function setAggregatedRouteMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\AggregatedMetrics::class); + $this->aggregated_route_metrics = $var; + + return $this; + } + + /** + * Number of mandatory shipments skipped. + * + * Generated from protobuf field int32 skipped_mandatory_shipment_count = 2; + * @return int + */ + public function getSkippedMandatoryShipmentCount() + { + return $this->skipped_mandatory_shipment_count; + } + + /** + * Number of mandatory shipments skipped. + * + * Generated from protobuf field int32 skipped_mandatory_shipment_count = 2; + * @param int $var + * @return $this + */ + public function setSkippedMandatoryShipmentCount($var) + { + GPBUtil::checkInt32($var); + $this->skipped_mandatory_shipment_count = $var; + + return $this; + } + + /** + * Number of vehicles used. Note: if a vehicle route is empty and + * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + * is true, the vehicle is considered used. + * + * Generated from protobuf field int32 used_vehicle_count = 3; + * @return int + */ + public function getUsedVehicleCount() + { + return $this->used_vehicle_count; + } + + /** + * Number of vehicles used. Note: if a vehicle route is empty and + * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + * is true, the vehicle is considered used. + * + * Generated from protobuf field int32 used_vehicle_count = 3; + * @param int $var + * @return $this + */ + public function setUsedVehicleCount($var) + { + GPBUtil::checkInt32($var); + $this->used_vehicle_count = $var; + + return $this; + } + + /** + * The earliest start time for a used vehicle, computed as the minimum over + * all used vehicles of + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEarliestVehicleStartTime() + { + return $this->earliest_vehicle_start_time; + } + + public function hasEarliestVehicleStartTime() + { + return isset($this->earliest_vehicle_start_time); + } + + public function clearEarliestVehicleStartTime() + { + unset($this->earliest_vehicle_start_time); + } + + /** + * The earliest start time for a used vehicle, computed as the minimum over + * all used vehicles of + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEarliestVehicleStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->earliest_vehicle_start_time = $var; + + return $this; + } + + /** + * The latest end time for a used vehicle, computed as the maximum over all + * used vehicles of + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLatestVehicleEndTime() + { + return $this->latest_vehicle_end_time; + } + + public function hasLatestVehicleEndTime() + { + return isset($this->latest_vehicle_end_time); + } + + public function clearLatestVehicleEndTime() + { + unset($this->latest_vehicle_end_time); + } + + /** + * The latest end time for a used vehicle, computed as the maximum over all + * used vehicles of + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLatestVehicleEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->latest_vehicle_end_time = $var; + + return $this; + } + + /** + * Cost of the solution, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, + * e.g. "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole + * solution. In other words, costs["model.shipments.pickups.cost"] is the + * sum of all pickup costs over the solution. All costs defined in the model + * are reported in detail here with the exception of costs related to + * TransitionAttributes that are only reported in an aggregated way as of + * 2022/01. + * + * Generated from protobuf field map costs = 10; + * @return \Google\Protobuf\Internal\MapField + */ + public function getCosts() + { + return $this->costs; + } + + /** + * Cost of the solution, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, + * e.g. "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole + * solution. In other words, costs["model.shipments.pickups.cost"] is the + * sum of all pickup costs over the solution. All costs defined in the model + * are reported in detail here with the exception of costs related to + * TransitionAttributes that are only reported in an aggregated way as of + * 2022/01. + * + * Generated from protobuf field map costs = 10; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setCosts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->costs = $arr; + + return $this; + } + + /** + * Total cost of the solution. The sum of all values in the costs map. + * + * Generated from protobuf field double total_cost = 6; + * @return float + */ + public function getTotalCost() + { + return $this->total_cost; + } + + /** + * Total cost of the solution. The sum of all values in the costs map. + * + * Generated from protobuf field double total_cost = 6; + * @param float $var + * @return $this + */ + public function setTotalCost($var) + { + GPBUtil::checkDouble($var); + $this->total_cost = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursValidationError.php b/MapsRouteOptimization/src/V1/OptimizeToursValidationError.php new file mode 100644 index 000000000000..518bc2697246 --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursValidationError.php @@ -0,0 +1,1179 @@ +google.maps.routeoptimization.v1.OptimizeToursValidationError + */ +class OptimizeToursValidationError extends \Google\Protobuf\Internal\Message +{ + /** + * A validation error is defined by the pair (`code`, `display_name`) which + * are always present. + * Other fields (below) provide more context about the error. + * *MULTIPLE ERRORS*: + * When there are multiple errors, the validation process tries to output + * several of them. Much like a compiler, this is an imperfect process. Some + * validation errors will be "fatal", meaning that they stop the entire + * validation process. This is the case for `display_name="UNSPECIFIED"` + * errors, among others. Some may cause the validation process to skip other + * errors. + * *STABILITY*: + * `code` and `display_name` should be very stable. But new codes and + * display names may appear over time, which may cause a given (invalid) + * request to yield a different (`code`, `display_name`) pair because the new + * error hid the old one (see "MULTIPLE ERRORS"). + * *REFERENCE*: A list of all (code, name) pairs: + * * UNSPECIFIED = 0; + * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + * the deadline. + * * REQUEST_OPTIONS_ERROR = 12; + * * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + * * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + * * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + * * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + * * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + * * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + * = 1207; + * * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + * * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + * * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + * * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + * * INJECTED_SOLUTION_ERROR = 20; + * * INJECTED_SOLUTION_MISSING_LABEL = 2000; + * * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + * * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + * * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + * * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + * * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + * * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + * * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + * * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + * * SHIPMENT_MODEL_ERROR = 22; + * * SHIPMENT_MODEL_TOO_LARGE = 2200; + * * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + * * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + * * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + * * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + * * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + * * INDEX_ERROR = 24; + * * TAG_ERROR = 26; + * * TIME_WINDOW_ERROR = 28; + * * TIME_WINDOW_INVALID_START_TIME = 2800; + * * TIME_WINDOW_INVALID_END_TIME = 2801; + * * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + * * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + * * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + * * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + * = 2808; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + * * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + * = 2810; + * * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + * * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + * * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + * * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + * = 2817; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + * * TRANSITION_ATTRIBUTES_ERROR = 30; + * * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + * * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + * * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + * * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + * * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + * * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + * * AMOUNT_ERROR = 31; + * * AMOUNT_NEGATIVE_VALUE = 3100; + * * LOAD_LIMIT_ERROR = 33; + * * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + * * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + * * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + * * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + * * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + * * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + * * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + * * INTERVAL_ERROR = 34; + * * INTERVAL_MIN_EXCEEDS_MAX = 3401; + * * INTERVAL_NEGATIVE_MIN = 3402; + * * INTERVAL_NEGATIVE_MAX = 3403; + * * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + * * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + * * DISTANCE_LIMIT_ERROR = 36; + * * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + * * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + * * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + * * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + * * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + * * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + * * DURATION_LIMIT_ERROR = 38; + * * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + * * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + * * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + * * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + * * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + * * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + * = 3807; + * * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + * = 3808; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + * * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + * * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + * = 3812; + * * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + * * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + * = 3815; + * * SHIPMENT_ERROR = 40; + * * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4001; + * * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + * * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + * * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + * * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + * * SHIPMENT_INVALID_PENALTY_COST = 4006; + * * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + * * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + * * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + * * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + * * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + * * VEHICLE_ERROR = 42; + * * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + * * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + * * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + * * VEHICLE_EMPTY_START_TAG = 4203; + * * VEHICLE_DUPLICATE_START_TAG = 4204; + * * VEHICLE_EMPTY_END_TAG = 4205; + * * VEHICLE_DUPLICATE_END_TAG = 4206; + * * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + * * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + * * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + * * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + * * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + * * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + * * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + * * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + * * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + * * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + * * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + * * VEHICLE_INVALID_COST_PER_HOUR = 4218; + * * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + * * VEHICLE_INVALID_FIXED_COST = 4220; + * * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + * * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + * = 4223; + * * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + * * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + * * VISIT_REQUEST_ERROR = 44; + * * VISIT_REQUEST_EMPTY_TAG = 4400; + * * VISIT_REQUEST_DUPLICATE_TAG = 4401; + * * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + * * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + * * PRECEDENCE_ERROR = 46; + * * BREAK_ERROR = 48; + * * BREAK_RULE_EMPTY = 4800; + * * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + * * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + * * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + * * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + * * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + * * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + * * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + * * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4812; + * * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + * * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + * * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + * * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + * * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + * * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + * * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + * * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + * * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + * * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + * * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + * * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + * * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + * * VEHICLE_OPERATOR_ERROR = 54; + * * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + * * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + * * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + * * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + * * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + * * DURATION_SECONDS_MATRIX_ERROR = 56; + * * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + * * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + * + * Generated from protobuf field int32 code = 1; + */ + protected $code = 0; + /** + * The error display name. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * An error context may involve 0, 1 (most of the time) or more fields. For + * example, referring to vehicle #4 and shipment #2's first pickup can be + * done as follows: + * ``` + * fields { name: "vehicles" index: 4} + * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + * ``` + * Note, however, that the cardinality of `fields` should not change for a + * given error code. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + */ + private $fields; + /** + * Human-readable string describing the error. There is a 1:1 mapping + * between `code` and `error_message` (when code != "UNSPECIFIED"). + * *STABILITY*: Not stable: the error message associated to a given `code` may + * change (hopefully to clarify it) over time. Please rely on the + * `display_name` and `code` instead. + * + * Generated from protobuf field string error_message = 4; + */ + protected $error_message = ''; + /** + * May contain the value(s) of the field(s). This is not always available. You + * should absolutely not rely on it and use it only for manual model + * debugging. + * + * Generated from protobuf field string offending_values = 5; + */ + protected $offending_values = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * A validation error is defined by the pair (`code`, `display_name`) which + * are always present. + * Other fields (below) provide more context about the error. + * *MULTIPLE ERRORS*: + * When there are multiple errors, the validation process tries to output + * several of them. Much like a compiler, this is an imperfect process. Some + * validation errors will be "fatal", meaning that they stop the entire + * validation process. This is the case for `display_name="UNSPECIFIED"` + * errors, among others. Some may cause the validation process to skip other + * errors. + * *STABILITY*: + * `code` and `display_name` should be very stable. But new codes and + * display names may appear over time, which may cause a given (invalid) + * request to yield a different (`code`, `display_name`) pair because the new + * error hid the old one (see "MULTIPLE ERRORS"). + * *REFERENCE*: A list of all (code, name) pairs: + * * UNSPECIFIED = 0; + * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + * the deadline. + * * REQUEST_OPTIONS_ERROR = 12; + * * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + * * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + * * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + * * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + * * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + * * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + * = 1207; + * * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + * * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + * * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + * * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + * * INJECTED_SOLUTION_ERROR = 20; + * * INJECTED_SOLUTION_MISSING_LABEL = 2000; + * * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + * * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + * * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + * * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + * * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + * * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + * * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + * * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + * * SHIPMENT_MODEL_ERROR = 22; + * * SHIPMENT_MODEL_TOO_LARGE = 2200; + * * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + * * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + * * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + * * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + * * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + * * INDEX_ERROR = 24; + * * TAG_ERROR = 26; + * * TIME_WINDOW_ERROR = 28; + * * TIME_WINDOW_INVALID_START_TIME = 2800; + * * TIME_WINDOW_INVALID_END_TIME = 2801; + * * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + * * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + * * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + * * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + * = 2808; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + * * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + * = 2810; + * * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + * * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + * * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + * * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + * = 2817; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + * * TRANSITION_ATTRIBUTES_ERROR = 30; + * * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + * * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + * * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + * * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + * * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + * * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + * * AMOUNT_ERROR = 31; + * * AMOUNT_NEGATIVE_VALUE = 3100; + * * LOAD_LIMIT_ERROR = 33; + * * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + * * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + * * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + * * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + * * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + * * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + * * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + * * INTERVAL_ERROR = 34; + * * INTERVAL_MIN_EXCEEDS_MAX = 3401; + * * INTERVAL_NEGATIVE_MIN = 3402; + * * INTERVAL_NEGATIVE_MAX = 3403; + * * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + * * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + * * DISTANCE_LIMIT_ERROR = 36; + * * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + * * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + * * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + * * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + * * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + * * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + * * DURATION_LIMIT_ERROR = 38; + * * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + * * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + * * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + * * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + * * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + * * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + * = 3807; + * * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + * = 3808; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + * * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + * * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + * = 3812; + * * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + * * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + * = 3815; + * * SHIPMENT_ERROR = 40; + * * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4001; + * * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + * * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + * * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + * * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + * * SHIPMENT_INVALID_PENALTY_COST = 4006; + * * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + * * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + * * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + * * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + * * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + * * VEHICLE_ERROR = 42; + * * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + * * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + * * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + * * VEHICLE_EMPTY_START_TAG = 4203; + * * VEHICLE_DUPLICATE_START_TAG = 4204; + * * VEHICLE_EMPTY_END_TAG = 4205; + * * VEHICLE_DUPLICATE_END_TAG = 4206; + * * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + * * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + * * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + * * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + * * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + * * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + * * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + * * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + * * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + * * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + * * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + * * VEHICLE_INVALID_COST_PER_HOUR = 4218; + * * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + * * VEHICLE_INVALID_FIXED_COST = 4220; + * * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + * * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + * = 4223; + * * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + * * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + * * VISIT_REQUEST_ERROR = 44; + * * VISIT_REQUEST_EMPTY_TAG = 4400; + * * VISIT_REQUEST_DUPLICATE_TAG = 4401; + * * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + * * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + * * PRECEDENCE_ERROR = 46; + * * BREAK_ERROR = 48; + * * BREAK_RULE_EMPTY = 4800; + * * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + * * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + * * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + * * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + * * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + * * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + * * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + * * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4812; + * * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + * * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + * * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + * * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + * * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + * * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + * * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + * * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + * * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + * * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + * * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + * * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + * * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + * * VEHICLE_OPERATOR_ERROR = 54; + * * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + * * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + * * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + * * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + * * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + * * DURATION_SECONDS_MATRIX_ERROR = 56; + * * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + * * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + * @type string $display_name + * The error display name. + * @type array<\Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference>|\Google\Protobuf\Internal\RepeatedField $fields + * An error context may involve 0, 1 (most of the time) or more fields. For + * example, referring to vehicle #4 and shipment #2's first pickup can be + * done as follows: + * ``` + * fields { name: "vehicles" index: 4} + * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + * ``` + * Note, however, that the cardinality of `fields` should not change for a + * given error code. + * @type string $error_message + * Human-readable string describing the error. There is a 1:1 mapping + * between `code` and `error_message` (when code != "UNSPECIFIED"). + * *STABILITY*: Not stable: the error message associated to a given `code` may + * change (hopefully to clarify it) over time. Please rely on the + * `display_name` and `code` instead. + * @type string $offending_values + * May contain the value(s) of the field(s). This is not always available. You + * should absolutely not rely on it and use it only for manual model + * debugging. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A validation error is defined by the pair (`code`, `display_name`) which + * are always present. + * Other fields (below) provide more context about the error. + * *MULTIPLE ERRORS*: + * When there are multiple errors, the validation process tries to output + * several of them. Much like a compiler, this is an imperfect process. Some + * validation errors will be "fatal", meaning that they stop the entire + * validation process. This is the case for `display_name="UNSPECIFIED"` + * errors, among others. Some may cause the validation process to skip other + * errors. + * *STABILITY*: + * `code` and `display_name` should be very stable. But new codes and + * display names may appear over time, which may cause a given (invalid) + * request to yield a different (`code`, `display_name`) pair because the new + * error hid the old one (see "MULTIPLE ERRORS"). + * *REFERENCE*: A list of all (code, name) pairs: + * * UNSPECIFIED = 0; + * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + * the deadline. + * * REQUEST_OPTIONS_ERROR = 12; + * * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + * * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + * * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + * * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + * * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + * * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + * = 1207; + * * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + * * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + * * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + * * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + * * INJECTED_SOLUTION_ERROR = 20; + * * INJECTED_SOLUTION_MISSING_LABEL = 2000; + * * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + * * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + * * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + * * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + * * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + * * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + * * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + * * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + * * SHIPMENT_MODEL_ERROR = 22; + * * SHIPMENT_MODEL_TOO_LARGE = 2200; + * * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + * * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + * * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + * * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + * * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + * * INDEX_ERROR = 24; + * * TAG_ERROR = 26; + * * TIME_WINDOW_ERROR = 28; + * * TIME_WINDOW_INVALID_START_TIME = 2800; + * * TIME_WINDOW_INVALID_END_TIME = 2801; + * * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + * * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + * * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + * * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + * = 2808; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + * * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + * = 2810; + * * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + * * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + * * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + * * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + * = 2817; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + * * TRANSITION_ATTRIBUTES_ERROR = 30; + * * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + * * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + * * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + * * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + * * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + * * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + * * AMOUNT_ERROR = 31; + * * AMOUNT_NEGATIVE_VALUE = 3100; + * * LOAD_LIMIT_ERROR = 33; + * * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + * * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + * * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + * * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + * * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + * * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + * * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + * * INTERVAL_ERROR = 34; + * * INTERVAL_MIN_EXCEEDS_MAX = 3401; + * * INTERVAL_NEGATIVE_MIN = 3402; + * * INTERVAL_NEGATIVE_MAX = 3403; + * * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + * * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + * * DISTANCE_LIMIT_ERROR = 36; + * * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + * * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + * * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + * * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + * * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + * * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + * * DURATION_LIMIT_ERROR = 38; + * * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + * * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + * * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + * * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + * * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + * * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + * = 3807; + * * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + * = 3808; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + * * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + * * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + * = 3812; + * * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + * * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + * = 3815; + * * SHIPMENT_ERROR = 40; + * * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4001; + * * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + * * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + * * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + * * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + * * SHIPMENT_INVALID_PENALTY_COST = 4006; + * * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + * * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + * * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + * * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + * * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + * * VEHICLE_ERROR = 42; + * * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + * * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + * * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + * * VEHICLE_EMPTY_START_TAG = 4203; + * * VEHICLE_DUPLICATE_START_TAG = 4204; + * * VEHICLE_EMPTY_END_TAG = 4205; + * * VEHICLE_DUPLICATE_END_TAG = 4206; + * * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + * * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + * * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + * * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + * * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + * * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + * * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + * * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + * * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + * * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + * * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + * * VEHICLE_INVALID_COST_PER_HOUR = 4218; + * * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + * * VEHICLE_INVALID_FIXED_COST = 4220; + * * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + * * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + * = 4223; + * * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + * * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + * * VISIT_REQUEST_ERROR = 44; + * * VISIT_REQUEST_EMPTY_TAG = 4400; + * * VISIT_REQUEST_DUPLICATE_TAG = 4401; + * * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + * * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + * * PRECEDENCE_ERROR = 46; + * * BREAK_ERROR = 48; + * * BREAK_RULE_EMPTY = 4800; + * * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + * * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + * * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + * * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + * * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + * * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + * * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + * * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4812; + * * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + * * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + * * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + * * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + * * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + * * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + * * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + * * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + * * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + * * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + * * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + * * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + * * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + * * VEHICLE_OPERATOR_ERROR = 54; + * * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + * * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + * * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + * * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + * * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + * * DURATION_SECONDS_MATRIX_ERROR = 56; + * * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + * * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + * + * Generated from protobuf field int32 code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * A validation error is defined by the pair (`code`, `display_name`) which + * are always present. + * Other fields (below) provide more context about the error. + * *MULTIPLE ERRORS*: + * When there are multiple errors, the validation process tries to output + * several of them. Much like a compiler, this is an imperfect process. Some + * validation errors will be "fatal", meaning that they stop the entire + * validation process. This is the case for `display_name="UNSPECIFIED"` + * errors, among others. Some may cause the validation process to skip other + * errors. + * *STABILITY*: + * `code` and `display_name` should be very stable. But new codes and + * display names may appear over time, which may cause a given (invalid) + * request to yield a different (`code`, `display_name`) pair because the new + * error hid the old one (see "MULTIPLE ERRORS"). + * *REFERENCE*: A list of all (code, name) pairs: + * * UNSPECIFIED = 0; + * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + * the deadline. + * * REQUEST_OPTIONS_ERROR = 12; + * * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + * * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + * * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + * * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + * * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + * * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + * = 1207; + * * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + * * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + * * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + * * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + * * INJECTED_SOLUTION_ERROR = 20; + * * INJECTED_SOLUTION_MISSING_LABEL = 2000; + * * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + * * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + * * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + * * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + * * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + * * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + * * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + * * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + * * SHIPMENT_MODEL_ERROR = 22; + * * SHIPMENT_MODEL_TOO_LARGE = 2200; + * * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + * * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + * * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + * * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + * * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + * * INDEX_ERROR = 24; + * * TAG_ERROR = 26; + * * TIME_WINDOW_ERROR = 28; + * * TIME_WINDOW_INVALID_START_TIME = 2800; + * * TIME_WINDOW_INVALID_END_TIME = 2801; + * * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + * * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + * * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + * * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + * = 2808; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + * * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + * = 2810; + * * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + * * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + * * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + * * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + * = 2817; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + * * TRANSITION_ATTRIBUTES_ERROR = 30; + * * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + * * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + * * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + * * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + * * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + * * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + * * AMOUNT_ERROR = 31; + * * AMOUNT_NEGATIVE_VALUE = 3100; + * * LOAD_LIMIT_ERROR = 33; + * * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + * * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + * * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + * * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + * * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + * * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + * * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + * * INTERVAL_ERROR = 34; + * * INTERVAL_MIN_EXCEEDS_MAX = 3401; + * * INTERVAL_NEGATIVE_MIN = 3402; + * * INTERVAL_NEGATIVE_MAX = 3403; + * * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + * * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + * * DISTANCE_LIMIT_ERROR = 36; + * * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + * * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + * * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + * * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + * * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + * * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + * * DURATION_LIMIT_ERROR = 38; + * * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + * * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + * * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + * * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + * * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + * * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + * = 3807; + * * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + * = 3808; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + * * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + * * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + * = 3812; + * * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + * * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + * = 3815; + * * SHIPMENT_ERROR = 40; + * * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4001; + * * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + * * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + * * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + * * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + * * SHIPMENT_INVALID_PENALTY_COST = 4006; + * * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + * * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + * * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + * * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + * * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + * * VEHICLE_ERROR = 42; + * * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + * * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + * * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + * * VEHICLE_EMPTY_START_TAG = 4203; + * * VEHICLE_DUPLICATE_START_TAG = 4204; + * * VEHICLE_EMPTY_END_TAG = 4205; + * * VEHICLE_DUPLICATE_END_TAG = 4206; + * * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + * * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + * * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + * * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + * * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + * * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + * * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + * * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + * * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + * * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + * * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + * * VEHICLE_INVALID_COST_PER_HOUR = 4218; + * * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + * * VEHICLE_INVALID_FIXED_COST = 4220; + * * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + * * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + * = 4223; + * * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + * * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + * * VISIT_REQUEST_ERROR = 44; + * * VISIT_REQUEST_EMPTY_TAG = 4400; + * * VISIT_REQUEST_DUPLICATE_TAG = 4401; + * * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + * * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + * * PRECEDENCE_ERROR = 46; + * * BREAK_ERROR = 48; + * * BREAK_RULE_EMPTY = 4800; + * * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + * * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + * * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + * * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + * * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + * * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + * * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + * * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4812; + * * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + * * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + * * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + * * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + * * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + * * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + * * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + * * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + * * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + * * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + * * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + * * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + * * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + * * VEHICLE_OPERATOR_ERROR = 54; + * * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + * * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + * * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + * * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + * * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + * * DURATION_SECONDS_MATRIX_ERROR = 56; + * * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + * * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + * + * Generated from protobuf field int32 code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkInt32($var); + $this->code = $var; + + return $this; + } + + /** + * The error display name. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The error display name. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * An error context may involve 0, 1 (most of the time) or more fields. For + * example, referring to vehicle #4 and shipment #2's first pickup can be + * done as follows: + * ``` + * fields { name: "vehicles" index: 4} + * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + * ``` + * Note, however, that the cardinality of `fields` should not change for a + * given error code. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * An error context may involve 0, 1 (most of the time) or more fields. For + * example, referring to vehicle #4 and shipment #2's first pickup can be + * done as follows: + * ``` + * fields { name: "vehicles" index: 4} + * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + * ``` + * Note, however, that the cardinality of `fields` should not change for a + * given error code. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * @param array<\Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference::class); + $this->fields = $arr; + + return $this; + } + + /** + * Human-readable string describing the error. There is a 1:1 mapping + * between `code` and `error_message` (when code != "UNSPECIFIED"). + * *STABILITY*: Not stable: the error message associated to a given `code` may + * change (hopefully to clarify it) over time. Please rely on the + * `display_name` and `code` instead. + * + * Generated from protobuf field string error_message = 4; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * Human-readable string describing the error. There is a 1:1 mapping + * between `code` and `error_message` (when code != "UNSPECIFIED"). + * *STABILITY*: Not stable: the error message associated to a given `code` may + * change (hopefully to clarify it) over time. Please rely on the + * `display_name` and `code` instead. + * + * Generated from protobuf field string error_message = 4; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + + /** + * May contain the value(s) of the field(s). This is not always available. You + * should absolutely not rely on it and use it only for manual model + * debugging. + * + * Generated from protobuf field string offending_values = 5; + * @return string + */ + public function getOffendingValues() + { + return $this->offending_values; + } + + /** + * May contain the value(s) of the field(s). This is not always available. You + * should absolutely not rely on it and use it only for manual model + * debugging. + * + * Generated from protobuf field string offending_values = 5; + * @param string $var + * @return $this + */ + public function setOffendingValues($var) + { + GPBUtil::checkString($var, True); + $this->offending_values = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursValidationError/FieldReference.php b/MapsRouteOptimization/src/V1/OptimizeToursValidationError/FieldReference.php new file mode 100644 index 000000000000..4215470610d6 --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursValidationError/FieldReference.php @@ -0,0 +1,195 @@ +google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + */ +class FieldReference extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the field, e.g., "vehicles". + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Recursively nested sub-field, if needed. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + */ + protected $sub_field = null; + protected $index_or_key; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the field, e.g., "vehicles". + * @type int $index + * Index of the field if repeated. + * @type string $key + * Key if the field is a map. + * @type \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference $sub_field + * Recursively nested sub-field, if needed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Name of the field, e.g., "vehicles". + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the field, e.g., "vehicles". + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Index of the field if repeated. + * + * Generated from protobuf field int32 index = 2; + * @return int + */ + public function getIndex() + { + return $this->readOneof(2); + } + + public function hasIndex() + { + return $this->hasOneof(2); + } + + /** + * Index of the field if repeated. + * + * Generated from protobuf field int32 index = 2; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Key if the field is a map. + * + * Generated from protobuf field string key = 4; + * @return string + */ + public function getKey() + { + return $this->readOneof(4); + } + + public function hasKey() + { + return $this->hasOneof(4); + } + + /** + * Key if the field is a map. + * + * Generated from protobuf field string key = 4; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Recursively nested sub-field, if needed. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * @return \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference|null + */ + public function getSubField() + { + return $this->sub_field; + } + + public function hasSubField() + { + return isset($this->sub_field); + } + + public function clearSubField() + { + unset($this->sub_field); + } + + /** + * Recursively nested sub-field, if needed. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * @param \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference $var + * @return $this + */ + public function setSubField($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference::class); + $this->sub_field = $var; + + return $this; + } + + /** + * @return string + */ + public function getIndexOrKey() + { + return $this->whichOneof("index_or_key"); + } + +} + + diff --git a/MapsRouteOptimization/src/V1/OutputConfig.php b/MapsRouteOptimization/src/V1/OutputConfig.php new file mode 100644 index 000000000000..7ed7e0a1d93f --- /dev/null +++ b/MapsRouteOptimization/src/V1/OutputConfig.php @@ -0,0 +1,111 @@ +google.maps.routeoptimization.v1.OutputConfig + */ +class OutputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The output data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_format = 0; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\RouteOptimization\V1\GcsDestination $gcs_destination + * The Google Cloud Storage location to write the output to. + * @type int $data_format + * Required. The output data format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud Storage location to write the output to. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * @return \Google\Maps\RouteOptimization\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * The Google Cloud Storage location to write the output to. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * @param \Google\Maps\RouteOptimization\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Required. The output data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDataFormat() + { + return $this->data_format; + } + + /** + * Required. The output data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDataFormat($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\DataFormat::class); + $this->data_format = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/MapsRouteOptimization/src/V1/Shipment.php b/MapsRouteOptimization/src/V1/Shipment.php new file mode 100644 index 000000000000..c3de173e6cc8 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Shipment.php @@ -0,0 +1,841 @@ +google.maps.routeoptimization.v1.Shipment + */ +class Shipment extends \Google\Protobuf\Internal\Message +{ + /** + * The user-defined display name of the shipment. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 16; + */ + protected $display_name = ''; + /** + * Set of pickup alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the deliveries. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + private $pickups; + /** + * Set of delivery alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the pickups. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + private $deliveries; + /** + * Load demands of the shipment (for example weight, volume, number of + * pallets etc). The keys in the map should be identifiers describing the type + * of the corresponding load, ideally also including the units. + * For example: "weight_kg", "volume_gallons", "pallet_count", etc. + * If a given key does not appear in the map, the corresponding load is + * considered as null. + * + * Generated from protobuf field map load_demands = 14; + */ + private $load_demands; + /** + * If the shipment is not completed, this penalty is added to the overall + * cost of the routes. A shipment is considered completed if one of its pickup + * and delivery alternatives is visited. The cost may be expressed in the + * same unit used for all other cost-related fields in the model and must be + * positive. + * *IMPORTANT*: If this penalty is not specified, it is considered infinite, + * i.e. the shipment must be completed. + * + * Generated from protobuf field optional double penalty_cost = 4; + */ + protected $penalty_cost = null; + /** + * The set of vehicles that may perform this shipment. If empty, all vehicles + * may perform it. Vehicles are given by their index in the `ShipmentModel`'s + * `vehicles` list. + * + * Generated from protobuf field repeated int32 allowed_vehicle_indices = 5; + */ + private $allowed_vehicle_indices; + /** + * Specifies the cost that is incurred when this shipment is delivered by each + * vehicle. If specified, it must have EITHER: + * * the same number of elements as `costs_per_vehicle_indices`. + * `costs_per_vehicle[i]` corresponds to vehicle + * `costs_per_vehicle_indices[i]` of the model. + * * the same number of elements as there are vehicles in the model. The + * i-th element corresponds to vehicle #i of the model. + * These costs must be in the same unit as `penalty_cost` and must not be + * negative. Leave this field empty, if there are no such costs. + * + * Generated from protobuf field repeated double costs_per_vehicle = 6; + */ + private $costs_per_vehicle; + /** + * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + * it must have the same number of elements as `costs_per_vehicle`. A vehicle + * index may not be specified more than once. If a vehicle is excluded from + * `costs_per_vehicle_indices`, its cost is zero. + * + * Generated from protobuf field repeated int32 costs_per_vehicle_indices = 7; + */ + private $costs_per_vehicle_indices; + /** + * Specifies the maximum relative detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_relative_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field optional double pickup_to_delivery_relative_detour_limit = 8; + */ + protected $pickup_to_delivery_relative_detour_limit = null; + /** + * Specifies the maximum absolute detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_absolute_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * t + pickup_to_delivery_absolute_detour_limit + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + protected $pickup_to_delivery_absolute_detour_limit = null; + /** + * Specifies the maximum duration from start of pickup to start of delivery of + * a shipment. If specified, it must be nonnegative, and the shipment must + * contain at least a pickup and a delivery. This does not depend on which + * alternatives are selected for pickup and delivery, nor on vehicle speed. + * This can be specified alongside maximum detour constraints: the solution + * will respect both specifications. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + protected $pickup_to_delivery_time_limit = null; + /** + * Non-empty string specifying a "type" for this shipment. + * This feature can be used to define incompatibilities or requirements + * between `shipment_types` (see `shipment_type_incompatibilities` and + * `shipment_type_requirements` in `ShipmentModel`). + * Differs from `visit_types` which is specified for a single visit: All + * pickup/deliveries belonging to the same shipment share the same + * `shipment_type`. + * + * Generated from protobuf field string shipment_type = 11; + */ + protected $shipment_type = ''; + /** + * Specifies a label for this shipment. This label is reported in the response + * in the `shipment_label` of the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 12; + */ + protected $label = ''; + /** + * If true, skip this shipment, but don't apply a `penalty_cost`. + * Ignoring a shipment results in a validation error when there are any + * `shipment_type_requirements` in the model. + * Ignoring a shipment that is performed in `injected_first_solution_routes` + * or `injected_solution_constraint` is permitted; the solver removes the + * related pickup/delivery visits from the performing route. + * `precedence_rules` that reference ignored shipments will also be ignored. + * + * Generated from protobuf field bool ignore = 13; + */ + protected $ignore = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The user-defined display name of the shipment. + * It can be up to 63 characters long and may use UTF-8 characters. + * @type array<\Google\Maps\RouteOptimization\V1\Shipment\VisitRequest>|\Google\Protobuf\Internal\RepeatedField $pickups + * Set of pickup alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the deliveries. + * @type array<\Google\Maps\RouteOptimization\V1\Shipment\VisitRequest>|\Google\Protobuf\Internal\RepeatedField $deliveries + * Set of delivery alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the pickups. + * @type array|\Google\Protobuf\Internal\MapField $load_demands + * Load demands of the shipment (for example weight, volume, number of + * pallets etc). The keys in the map should be identifiers describing the type + * of the corresponding load, ideally also including the units. + * For example: "weight_kg", "volume_gallons", "pallet_count", etc. + * If a given key does not appear in the map, the corresponding load is + * considered as null. + * @type float $penalty_cost + * If the shipment is not completed, this penalty is added to the overall + * cost of the routes. A shipment is considered completed if one of its pickup + * and delivery alternatives is visited. The cost may be expressed in the + * same unit used for all other cost-related fields in the model and must be + * positive. + * *IMPORTANT*: If this penalty is not specified, it is considered infinite, + * i.e. the shipment must be completed. + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_vehicle_indices + * The set of vehicles that may perform this shipment. If empty, all vehicles + * may perform it. Vehicles are given by their index in the `ShipmentModel`'s + * `vehicles` list. + * @type array|\Google\Protobuf\Internal\RepeatedField $costs_per_vehicle + * Specifies the cost that is incurred when this shipment is delivered by each + * vehicle. If specified, it must have EITHER: + * * the same number of elements as `costs_per_vehicle_indices`. + * `costs_per_vehicle[i]` corresponds to vehicle + * `costs_per_vehicle_indices[i]` of the model. + * * the same number of elements as there are vehicles in the model. The + * i-th element corresponds to vehicle #i of the model. + * These costs must be in the same unit as `penalty_cost` and must not be + * negative. Leave this field empty, if there are no such costs. + * @type array|\Google\Protobuf\Internal\RepeatedField $costs_per_vehicle_indices + * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + * it must have the same number of elements as `costs_per_vehicle`. A vehicle + * index may not be specified more than once. If a vehicle is excluded from + * `costs_per_vehicle_indices`, its cost is zero. + * @type float $pickup_to_delivery_relative_detour_limit + * Specifies the maximum relative detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_relative_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * @type \Google\Protobuf\Duration $pickup_to_delivery_absolute_detour_limit + * Specifies the maximum absolute detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_absolute_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * t + pickup_to_delivery_absolute_detour_limit + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * @type \Google\Protobuf\Duration $pickup_to_delivery_time_limit + * Specifies the maximum duration from start of pickup to start of delivery of + * a shipment. If specified, it must be nonnegative, and the shipment must + * contain at least a pickup and a delivery. This does not depend on which + * alternatives are selected for pickup and delivery, nor on vehicle speed. + * This can be specified alongside maximum detour constraints: the solution + * will respect both specifications. + * @type string $shipment_type + * Non-empty string specifying a "type" for this shipment. + * This feature can be used to define incompatibilities or requirements + * between `shipment_types` (see `shipment_type_incompatibilities` and + * `shipment_type_requirements` in `ShipmentModel`). + * Differs from `visit_types` which is specified for a single visit: All + * pickup/deliveries belonging to the same shipment share the same + * `shipment_type`. + * @type string $label + * Specifies a label for this shipment. This label is reported in the response + * in the `shipment_label` of the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * @type bool $ignore + * If true, skip this shipment, but don't apply a `penalty_cost`. + * Ignoring a shipment results in a validation error when there are any + * `shipment_type_requirements` in the model. + * Ignoring a shipment that is performed in `injected_first_solution_routes` + * or `injected_solution_constraint` is permitted; the solver removes the + * related pickup/delivery visits from the performing route. + * `precedence_rules` that reference ignored shipments will also be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The user-defined display name of the shipment. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 16; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The user-defined display name of the shipment. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 16; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Set of pickup alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the deliveries. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPickups() + { + return $this->pickups; + } + + /** + * Set of pickup alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the deliveries. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + * @param array<\Google\Maps\RouteOptimization\V1\Shipment\VisitRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPickups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\VisitRequest::class); + $this->pickups = $arr; + + return $this; + } + + /** + * Set of delivery alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the pickups. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDeliveries() + { + return $this->deliveries; + } + + /** + * Set of delivery alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the pickups. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + * @param array<\Google\Maps\RouteOptimization\V1\Shipment\VisitRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDeliveries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\VisitRequest::class); + $this->deliveries = $arr; + + return $this; + } + + /** + * Load demands of the shipment (for example weight, volume, number of + * pallets etc). The keys in the map should be identifiers describing the type + * of the corresponding load, ideally also including the units. + * For example: "weight_kg", "volume_gallons", "pallet_count", etc. + * If a given key does not appear in the map, the corresponding load is + * considered as null. + * + * Generated from protobuf field map load_demands = 14; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLoadDemands() + { + return $this->load_demands; + } + + /** + * Load demands of the shipment (for example weight, volume, number of + * pallets etc). The keys in the map should be identifiers describing the type + * of the corresponding load, ideally also including the units. + * For example: "weight_kg", "volume_gallons", "pallet_count", etc. + * If a given key does not appear in the map, the corresponding load is + * considered as null. + * + * Generated from protobuf field map load_demands = 14; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLoadDemands($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\Load::class); + $this->load_demands = $arr; + + return $this; + } + + /** + * If the shipment is not completed, this penalty is added to the overall + * cost of the routes. A shipment is considered completed if one of its pickup + * and delivery alternatives is visited. The cost may be expressed in the + * same unit used for all other cost-related fields in the model and must be + * positive. + * *IMPORTANT*: If this penalty is not specified, it is considered infinite, + * i.e. the shipment must be completed. + * + * Generated from protobuf field optional double penalty_cost = 4; + * @return float + */ + public function getPenaltyCost() + { + return isset($this->penalty_cost) ? $this->penalty_cost : 0.0; + } + + public function hasPenaltyCost() + { + return isset($this->penalty_cost); + } + + public function clearPenaltyCost() + { + unset($this->penalty_cost); + } + + /** + * If the shipment is not completed, this penalty is added to the overall + * cost of the routes. A shipment is considered completed if one of its pickup + * and delivery alternatives is visited. The cost may be expressed in the + * same unit used for all other cost-related fields in the model and must be + * positive. + * *IMPORTANT*: If this penalty is not specified, it is considered infinite, + * i.e. the shipment must be completed. + * + * Generated from protobuf field optional double penalty_cost = 4; + * @param float $var + * @return $this + */ + public function setPenaltyCost($var) + { + GPBUtil::checkDouble($var); + $this->penalty_cost = $var; + + return $this; + } + + /** + * The set of vehicles that may perform this shipment. If empty, all vehicles + * may perform it. Vehicles are given by their index in the `ShipmentModel`'s + * `vehicles` list. + * + * Generated from protobuf field repeated int32 allowed_vehicle_indices = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedVehicleIndices() + { + return $this->allowed_vehicle_indices; + } + + /** + * The set of vehicles that may perform this shipment. If empty, all vehicles + * may perform it. Vehicles are given by their index in the `ShipmentModel`'s + * `vehicles` list. + * + * Generated from protobuf field repeated int32 allowed_vehicle_indices = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedVehicleIndices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->allowed_vehicle_indices = $arr; + + return $this; + } + + /** + * Specifies the cost that is incurred when this shipment is delivered by each + * vehicle. If specified, it must have EITHER: + * * the same number of elements as `costs_per_vehicle_indices`. + * `costs_per_vehicle[i]` corresponds to vehicle + * `costs_per_vehicle_indices[i]` of the model. + * * the same number of elements as there are vehicles in the model. The + * i-th element corresponds to vehicle #i of the model. + * These costs must be in the same unit as `penalty_cost` and must not be + * negative. Leave this field empty, if there are no such costs. + * + * Generated from protobuf field repeated double costs_per_vehicle = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCostsPerVehicle() + { + return $this->costs_per_vehicle; + } + + /** + * Specifies the cost that is incurred when this shipment is delivered by each + * vehicle. If specified, it must have EITHER: + * * the same number of elements as `costs_per_vehicle_indices`. + * `costs_per_vehicle[i]` corresponds to vehicle + * `costs_per_vehicle_indices[i]` of the model. + * * the same number of elements as there are vehicles in the model. The + * i-th element corresponds to vehicle #i of the model. + * These costs must be in the same unit as `penalty_cost` and must not be + * negative. Leave this field empty, if there are no such costs. + * + * Generated from protobuf field repeated double costs_per_vehicle = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCostsPerVehicle($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->costs_per_vehicle = $arr; + + return $this; + } + + /** + * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + * it must have the same number of elements as `costs_per_vehicle`. A vehicle + * index may not be specified more than once. If a vehicle is excluded from + * `costs_per_vehicle_indices`, its cost is zero. + * + * Generated from protobuf field repeated int32 costs_per_vehicle_indices = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCostsPerVehicleIndices() + { + return $this->costs_per_vehicle_indices; + } + + /** + * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + * it must have the same number of elements as `costs_per_vehicle`. A vehicle + * index may not be specified more than once. If a vehicle is excluded from + * `costs_per_vehicle_indices`, its cost is zero. + * + * Generated from protobuf field repeated int32 costs_per_vehicle_indices = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCostsPerVehicleIndices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->costs_per_vehicle_indices = $arr; + + return $this; + } + + /** + * Specifies the maximum relative detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_relative_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field optional double pickup_to_delivery_relative_detour_limit = 8; + * @return float + */ + public function getPickupToDeliveryRelativeDetourLimit() + { + return isset($this->pickup_to_delivery_relative_detour_limit) ? $this->pickup_to_delivery_relative_detour_limit : 0.0; + } + + public function hasPickupToDeliveryRelativeDetourLimit() + { + return isset($this->pickup_to_delivery_relative_detour_limit); + } + + public function clearPickupToDeliveryRelativeDetourLimit() + { + unset($this->pickup_to_delivery_relative_detour_limit); + } + + /** + * Specifies the maximum relative detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_relative_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field optional double pickup_to_delivery_relative_detour_limit = 8; + * @param float $var + * @return $this + */ + public function setPickupToDeliveryRelativeDetourLimit($var) + { + GPBUtil::checkDouble($var); + $this->pickup_to_delivery_relative_detour_limit = $var; + + return $this; + } + + /** + * Specifies the maximum absolute detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_absolute_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * t + pickup_to_delivery_absolute_detour_limit + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * @return \Google\Protobuf\Duration|null + */ + public function getPickupToDeliveryAbsoluteDetourLimit() + { + return $this->pickup_to_delivery_absolute_detour_limit; + } + + public function hasPickupToDeliveryAbsoluteDetourLimit() + { + return isset($this->pickup_to_delivery_absolute_detour_limit); + } + + public function clearPickupToDeliveryAbsoluteDetourLimit() + { + unset($this->pickup_to_delivery_absolute_detour_limit); + } + + /** + * Specifies the maximum absolute detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_absolute_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * t + pickup_to_delivery_absolute_detour_limit + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setPickupToDeliveryAbsoluteDetourLimit($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->pickup_to_delivery_absolute_detour_limit = $var; + + return $this; + } + + /** + * Specifies the maximum duration from start of pickup to start of delivery of + * a shipment. If specified, it must be nonnegative, and the shipment must + * contain at least a pickup and a delivery. This does not depend on which + * alternatives are selected for pickup and delivery, nor on vehicle speed. + * This can be specified alongside maximum detour constraints: the solution + * will respect both specifications. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * @return \Google\Protobuf\Duration|null + */ + public function getPickupToDeliveryTimeLimit() + { + return $this->pickup_to_delivery_time_limit; + } + + public function hasPickupToDeliveryTimeLimit() + { + return isset($this->pickup_to_delivery_time_limit); + } + + public function clearPickupToDeliveryTimeLimit() + { + unset($this->pickup_to_delivery_time_limit); + } + + /** + * Specifies the maximum duration from start of pickup to start of delivery of + * a shipment. If specified, it must be nonnegative, and the shipment must + * contain at least a pickup and a delivery. This does not depend on which + * alternatives are selected for pickup and delivery, nor on vehicle speed. + * This can be specified alongside maximum detour constraints: the solution + * will respect both specifications. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setPickupToDeliveryTimeLimit($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->pickup_to_delivery_time_limit = $var; + + return $this; + } + + /** + * Non-empty string specifying a "type" for this shipment. + * This feature can be used to define incompatibilities or requirements + * between `shipment_types` (see `shipment_type_incompatibilities` and + * `shipment_type_requirements` in `ShipmentModel`). + * Differs from `visit_types` which is specified for a single visit: All + * pickup/deliveries belonging to the same shipment share the same + * `shipment_type`. + * + * Generated from protobuf field string shipment_type = 11; + * @return string + */ + public function getShipmentType() + { + return $this->shipment_type; + } + + /** + * Non-empty string specifying a "type" for this shipment. + * This feature can be used to define incompatibilities or requirements + * between `shipment_types` (see `shipment_type_incompatibilities` and + * `shipment_type_requirements` in `ShipmentModel`). + * Differs from `visit_types` which is specified for a single visit: All + * pickup/deliveries belonging to the same shipment share the same + * `shipment_type`. + * + * Generated from protobuf field string shipment_type = 11; + * @param string $var + * @return $this + */ + public function setShipmentType($var) + { + GPBUtil::checkString($var, True); + $this->shipment_type = $var; + + return $this; + } + + /** + * Specifies a label for this shipment. This label is reported in the response + * in the `shipment_label` of the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 12; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Specifies a label for this shipment. This label is reported in the response + * in the `shipment_label` of the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 12; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * If true, skip this shipment, but don't apply a `penalty_cost`. + * Ignoring a shipment results in a validation error when there are any + * `shipment_type_requirements` in the model. + * Ignoring a shipment that is performed in `injected_first_solution_routes` + * or `injected_solution_constraint` is permitted; the solver removes the + * related pickup/delivery visits from the performing route. + * `precedence_rules` that reference ignored shipments will also be ignored. + * + * Generated from protobuf field bool ignore = 13; + * @return bool + */ + public function getIgnore() + { + return $this->ignore; + } + + /** + * If true, skip this shipment, but don't apply a `penalty_cost`. + * Ignoring a shipment results in a validation error when there are any + * `shipment_type_requirements` in the model. + * Ignoring a shipment that is performed in `injected_first_solution_routes` + * or `injected_solution_constraint` is permitted; the solver removes the + * related pickup/delivery visits from the performing route. + * `precedence_rules` that reference ignored shipments will also be ignored. + * + * Generated from protobuf field bool ignore = 13; + * @param bool $var + * @return $this + */ + public function setIgnore($var) + { + GPBUtil::checkBool($var); + $this->ignore = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/Shipment/Load.php b/MapsRouteOptimization/src/V1/Shipment/Load.php new file mode 100644 index 000000000000..04cbca8a31a3 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Shipment/Load.php @@ -0,0 +1,79 @@ +google.maps.routeoptimization.v1.Shipment.Load + */ +class Load extends \Google\Protobuf\Internal\Message +{ + /** + * The amount by which the load of the vehicle performing the corresponding + * visit will vary. Since it is an integer, users are advised to choose an + * appropriate unit to avoid loss of precision. Must be ≥ 0. + * + * Generated from protobuf field int64 amount = 2; + */ + protected $amount = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $amount + * The amount by which the load of the vehicle performing the corresponding + * visit will vary. Since it is an integer, users are advised to choose an + * appropriate unit to avoid loss of precision. Must be ≥ 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The amount by which the load of the vehicle performing the corresponding + * visit will vary. Since it is an integer, users are advised to choose an + * appropriate unit to avoid loss of precision. Must be ≥ 0. + * + * Generated from protobuf field int64 amount = 2; + * @return int|string + */ + public function getAmount() + { + return $this->amount; + } + + /** + * The amount by which the load of the vehicle performing the corresponding + * visit will vary. Since it is an integer, users are advised to choose an + * appropriate unit to avoid loss of precision. Must be ≥ 0. + * + * Generated from protobuf field int64 amount = 2; + * @param int|string $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkInt64($var); + $this->amount = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Shipment/VisitRequest.php b/MapsRouteOptimization/src/V1/Shipment/VisitRequest.php new file mode 100644 index 000000000000..c8508e6489e6 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Shipment/VisitRequest.php @@ -0,0 +1,613 @@ +google.maps.routeoptimization.v1.Shipment.VisitRequest + */ +class VisitRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The geo-location where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng arrival_location = 1; + */ + protected $arrival_location = null; + /** + * The waypoint where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + protected $arrival_waypoint = null; + /** + * The geo-location where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + * If the shipment model has duration distance matrices, + * `departure_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng departure_location = 3; + */ + protected $departure_location = null; + /** + * The waypoint where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + * If the shipment model has duration distance matrices, + * `departure_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + protected $departure_waypoint = null; + /** + * Specifies tags attached to the visit request. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string tags = 5; + */ + private $tags; + /** + * Time windows which constrain the arrival time at a visit. + * Note that a vehicle may depart outside of the arrival time window, i.e. + * arrival time + duration do not need to be inside a time window. This can + * result in waiting time if the vehicle arrives before + * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + * The absence of `TimeWindow` means that the vehicle can perform this visit + * at any time. + * Time windows must be disjoint, i.e. no time window must overlap with or + * be adjacent to another, and they must be in increasing order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + * be set if there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + private $time_windows; + /** + * Duration of the visit, i.e. time spent by the vehicle between arrival + * and departure (to be added to the possible waiting time; see + * `time_windows`). + * + * Generated from protobuf field .google.protobuf.Duration duration = 7; + */ + protected $duration = null; + /** + * Cost to service this visit request on a vehicle route. This can be used + * to pay different costs for each alternative pickup or delivery of a + * shipment. This cost must be in the same unit as `Shipment.penalty_cost` + * and must not be negative. + * + * Generated from protobuf field double cost = 8; + */ + protected $cost = 0.0; + /** + * Load demands of this visit request. This is just like + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field, except that it only applies to this + * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + * instead of the whole + * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + * here are added to the demands listed in + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + * + * Generated from protobuf field map load_demands = 12; + */ + private $load_demands; + /** + * Specifies the types of the visit. This may be used to allocate additional + * time required for a vehicle to complete this visit (see + * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + * A type can only appear once. + * + * Generated from protobuf field repeated string visit_types = 10; + */ + private $visit_types; + /** + * Specifies a label for this `VisitRequest`. This label is reported in the + * response as `visit_label` in the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 11; + */ + protected $label = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $arrival_location + * The geo-location where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_location` must not be specified. + * @type \Google\Maps\RouteOptimization\V1\Waypoint $arrival_waypoint + * The waypoint where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_waypoint` must not be specified. + * @type \Google\Type\LatLng $departure_location + * The geo-location where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + * If the shipment model has duration distance matrices, + * `departure_location` must not be specified. + * @type \Google\Maps\RouteOptimization\V1\Waypoint $departure_waypoint + * The waypoint where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + * If the shipment model has duration distance matrices, + * `departure_waypoint` must not be specified. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Specifies tags attached to the visit request. + * Empty or duplicate strings are not allowed. + * @type array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $time_windows + * Time windows which constrain the arrival time at a visit. + * Note that a vehicle may depart outside of the arrival time window, i.e. + * arrival time + duration do not need to be inside a time window. This can + * result in waiting time if the vehicle arrives before + * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + * The absence of `TimeWindow` means that the vehicle can perform this visit + * at any time. + * Time windows must be disjoint, i.e. no time window must overlap with or + * be adjacent to another, and they must be in increasing order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + * be set if there is a single time window. + * @type \Google\Protobuf\Duration $duration + * Duration of the visit, i.e. time spent by the vehicle between arrival + * and departure (to be added to the possible waiting time; see + * `time_windows`). + * @type float $cost + * Cost to service this visit request on a vehicle route. This can be used + * to pay different costs for each alternative pickup or delivery of a + * shipment. This cost must be in the same unit as `Shipment.penalty_cost` + * and must not be negative. + * @type array|\Google\Protobuf\Internal\MapField $load_demands + * Load demands of this visit request. This is just like + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field, except that it only applies to this + * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + * instead of the whole + * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + * here are added to the demands listed in + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + * @type array|\Google\Protobuf\Internal\RepeatedField $visit_types + * Specifies the types of the visit. This may be used to allocate additional + * time required for a vehicle to complete this visit (see + * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + * A type can only appear once. + * @type string $label + * Specifies a label for this `VisitRequest`. This label is reported in the + * response as `visit_label` in the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The geo-location where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng arrival_location = 1; + * @return \Google\Type\LatLng|null + */ + public function getArrivalLocation() + { + return $this->arrival_location; + } + + public function hasArrivalLocation() + { + return isset($this->arrival_location); + } + + public function clearArrivalLocation() + { + unset($this->arrival_location); + } + + /** + * The geo-location where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng arrival_location = 1; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setArrivalLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->arrival_location = $var; + + return $this; + } + + /** + * The waypoint where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * @return \Google\Maps\RouteOptimization\V1\Waypoint|null + */ + public function getArrivalWaypoint() + { + return $this->arrival_waypoint; + } + + public function hasArrivalWaypoint() + { + return isset($this->arrival_waypoint); + } + + public function clearArrivalWaypoint() + { + unset($this->arrival_waypoint); + } + + /** + * The waypoint where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * @param \Google\Maps\RouteOptimization\V1\Waypoint $var + * @return $this + */ + public function setArrivalWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Waypoint::class); + $this->arrival_waypoint = $var; + + return $this; + } + + /** + * The geo-location where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + * If the shipment model has duration distance matrices, + * `departure_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng departure_location = 3; + * @return \Google\Type\LatLng|null + */ + public function getDepartureLocation() + { + return $this->departure_location; + } + + public function hasDepartureLocation() + { + return isset($this->departure_location); + } + + public function clearDepartureLocation() + { + unset($this->departure_location); + } + + /** + * The geo-location where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + * If the shipment model has duration distance matrices, + * `departure_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng departure_location = 3; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setDepartureLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->departure_location = $var; + + return $this; + } + + /** + * The waypoint where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + * If the shipment model has duration distance matrices, + * `departure_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * @return \Google\Maps\RouteOptimization\V1\Waypoint|null + */ + public function getDepartureWaypoint() + { + return $this->departure_waypoint; + } + + public function hasDepartureWaypoint() + { + return isset($this->departure_waypoint); + } + + public function clearDepartureWaypoint() + { + unset($this->departure_waypoint); + } + + /** + * The waypoint where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + * If the shipment model has duration distance matrices, + * `departure_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * @param \Google\Maps\RouteOptimization\V1\Waypoint $var + * @return $this + */ + public function setDepartureWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Waypoint::class); + $this->departure_waypoint = $var; + + return $this; + } + + /** + * Specifies tags attached to the visit request. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string tags = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Specifies tags attached to the visit request. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string tags = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * Time windows which constrain the arrival time at a visit. + * Note that a vehicle may depart outside of the arrival time window, i.e. + * arrival time + duration do not need to be inside a time window. This can + * result in waiting time if the vehicle arrives before + * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + * The absence of `TimeWindow` means that the vehicle can perform this visit + * at any time. + * Time windows must be disjoint, i.e. no time window must overlap with or + * be adjacent to another, and they must be in increasing order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + * be set if there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTimeWindows() + { + return $this->time_windows; + } + + /** + * Time windows which constrain the arrival time at a visit. + * Note that a vehicle may depart outside of the arrival time window, i.e. + * arrival time + duration do not need to be inside a time window. This can + * result in waiting time if the vehicle arrives before + * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + * The absence of `TimeWindow` means that the vehicle can perform this visit + * at any time. + * Time windows must be disjoint, i.e. no time window must overlap with or + * be adjacent to another, and they must be in increasing order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + * be set if there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + * @param array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTimeWindows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\TimeWindow::class); + $this->time_windows = $arr; + + return $this; + } + + /** + * Duration of the visit, i.e. time spent by the vehicle between arrival + * and departure (to be added to the possible waiting time; see + * `time_windows`). + * + * Generated from protobuf field .google.protobuf.Duration duration = 7; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Duration of the visit, i.e. time spent by the vehicle between arrival + * and departure (to be added to the possible waiting time; see + * `time_windows`). + * + * Generated from protobuf field .google.protobuf.Duration duration = 7; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * Cost to service this visit request on a vehicle route. This can be used + * to pay different costs for each alternative pickup or delivery of a + * shipment. This cost must be in the same unit as `Shipment.penalty_cost` + * and must not be negative. + * + * Generated from protobuf field double cost = 8; + * @return float + */ + public function getCost() + { + return $this->cost; + } + + /** + * Cost to service this visit request on a vehicle route. This can be used + * to pay different costs for each alternative pickup or delivery of a + * shipment. This cost must be in the same unit as `Shipment.penalty_cost` + * and must not be negative. + * + * Generated from protobuf field double cost = 8; + * @param float $var + * @return $this + */ + public function setCost($var) + { + GPBUtil::checkDouble($var); + $this->cost = $var; + + return $this; + } + + /** + * Load demands of this visit request. This is just like + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field, except that it only applies to this + * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + * instead of the whole + * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + * here are added to the demands listed in + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + * + * Generated from protobuf field map load_demands = 12; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLoadDemands() + { + return $this->load_demands; + } + + /** + * Load demands of this visit request. This is just like + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field, except that it only applies to this + * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + * instead of the whole + * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + * here are added to the demands listed in + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + * + * Generated from protobuf field map load_demands = 12; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLoadDemands($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\Load::class); + $this->load_demands = $arr; + + return $this; + } + + /** + * Specifies the types of the visit. This may be used to allocate additional + * time required for a vehicle to complete this visit (see + * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + * A type can only appear once. + * + * Generated from protobuf field repeated string visit_types = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVisitTypes() + { + return $this->visit_types; + } + + /** + * Specifies the types of the visit. This may be used to allocate additional + * time required for a vehicle to complete this visit (see + * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + * A type can only appear once. + * + * Generated from protobuf field repeated string visit_types = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVisitTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->visit_types = $arr; + + return $this; + } + + /** + * Specifies a label for this `VisitRequest`. This label is reported in the + * response as `visit_label` in the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 11; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Specifies a label for this `VisitRequest`. This label is reported in the + * response as `visit_label` in the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 11; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentModel.php b/MapsRouteOptimization/src/V1/ShipmentModel.php new file mode 100644 index 000000000000..34ac5c5b5eb4 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentModel.php @@ -0,0 +1,1010 @@ +google.maps.routeoptimization.v1.ShipmentModel + */ +class ShipmentModel extends \Google\Protobuf\Internal\Message +{ + /** + * Set of shipments which must be performed in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + */ + private $shipments; + /** + * Set of vehicles which can be used to perform visits. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + */ + private $vehicles; + /** + * Constrains the maximum number of active vehicles. A vehicle is active if + * its route performs at least one shipment. This can be used to limit the + * number of routes in the case where there are fewer drivers than + * vehicles and that the fleet of vehicles is heterogeneous. The optimization + * will then select the best subset of vehicles to use. + * Must be strictly positive. + * + * Generated from protobuf field optional int32 max_active_vehicles = 4; + */ + protected $max_active_vehicles = null; + /** + * Global start and end time of the model: no times outside of this range + * can be considered valid. + * The model's time span must be less than a year, i.e. the `global_end_time` + * and the `global_start_time` must be within 31536000 seconds of each other. + * When using `cost_per_*hour` fields, you might want to set this window to a + * smaller interval to increase performance (eg. if you model a single day, + * you should set the global time limits to that day). + * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used + * as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_start_time = 5; + */ + protected $global_start_time = null; + /** + * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) + * is used as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_end_time = 6; + */ + protected $global_end_time = null; + /** + * The "global duration" of the overall plan is the difference between the + * earliest effective start time and the latest effective end time of + * all vehicles. Users can assign a cost per hour to that quantity to try + * and optimize for earliest job completion, for example. This cost must be in + * the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double global_duration_cost_per_hour = 7; + */ + protected $global_duration_cost_per_hour = 0.0; + /** + * Specifies duration and distance matrices used in the model. If this field + * is empty, Google Maps or geodesic distances will be used instead, depending + * on the value of the `use_geodesic_distances` field. If it is not empty, + * `use_geodesic_distances` cannot be true and neither + * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` + * can be empty. + * Usage examples: + * * There are two locations: locA and locB. + * * 1 vehicle starting its route at locA and ending it at locA. + * * 1 pickup visit request at locB. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locA" } + * shipments { pickups { tags: "locB" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_dst_tags: "locA" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrices { + * rows { # from: locA + * durations { seconds: 0 } meters: 0 # to: locA + * durations { seconds: 100 } meters: 1000 # to: locB + * } + * rows { # from: locB + * durations { seconds: 102 } meters: 990 # to: locA + * durations { seconds: 0 } meters: 0 # to: locB + * } + * } + * } + * ``` + * * There are three locations: locA, locB and locC. + * * 1 vehicle starting its route at locA and ending it at locB, using + * matrix "fast". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "slow". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "fast". + * * 1 pickup visit request at locC. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } + * shipments { pickups { tags: "locC" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_src_tags: "locC" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrix_dst_tags: "locC" + * duration_distance_matrices { + * vehicle_start_tag: "fast" + * rows { # from: locA + * durations { seconds: 1000 } meters: 2000 # to: locB + * durations { seconds: 600 } meters: 1000 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 700 } meters: 1200 # to: locC + * } + * rows { # from: locC + * durations { seconds: 702 } meters: 1190 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * duration_distance_matrices { + * vehicle_start_tag: "slow" + * rows { # from: locA + * durations { seconds: 1800 } meters: 2001 # to: locB + * durations { seconds: 900 } meters: 1002 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 1000 } meters: 1202 # to: locC + * } + * rows { # from: locC + * durations { seconds: 1001 } meters: 1195 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * } + * ``` + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; + */ + private $duration_distance_matrices; + /** + * Tags defining the sources of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j)` defines durations and distances + * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits + * in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_src_tags = 9; + */ + private $duration_distance_matrix_src_tags; + /** + * Tags defining the destinations of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j).durations(k)` (resp. + * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration + * (resp. the distance) of the travel from visits with tag + * `duration_distance_matrix_src_tags(j)` to visits with tag + * `duration_distance_matrix_dst_tags(k)` in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_dst_tags = 10; + */ + private $duration_distance_matrix_dst_tags; + /** + * Transition attributes added to the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + */ + private $transition_attributes; + /** + * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + */ + private $shipment_type_incompatibilities; + /** + * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + */ + private $shipment_type_requirements; + /** + * Set of precedence rules which must be enforced in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + */ + private $precedence_rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\Shipment>|\Google\Protobuf\Internal\RepeatedField $shipments + * Set of shipments which must be performed in the model. + * @type array<\Google\Maps\RouteOptimization\V1\Vehicle>|\Google\Protobuf\Internal\RepeatedField $vehicles + * Set of vehicles which can be used to perform visits. + * @type int $max_active_vehicles + * Constrains the maximum number of active vehicles. A vehicle is active if + * its route performs at least one shipment. This can be used to limit the + * number of routes in the case where there are fewer drivers than + * vehicles and that the fleet of vehicles is heterogeneous. The optimization + * will then select the best subset of vehicles to use. + * Must be strictly positive. + * @type \Google\Protobuf\Timestamp $global_start_time + * Global start and end time of the model: no times outside of this range + * can be considered valid. + * The model's time span must be less than a year, i.e. the `global_end_time` + * and the `global_start_time` must be within 31536000 seconds of each other. + * When using `cost_per_*hour` fields, you might want to set this window to a + * smaller interval to increase performance (eg. if you model a single day, + * you should set the global time limits to that day). + * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used + * as default. + * @type \Google\Protobuf\Timestamp $global_end_time + * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) + * is used as default. + * @type float $global_duration_cost_per_hour + * The "global duration" of the overall plan is the difference between the + * earliest effective start time and the latest effective end time of + * all vehicles. Users can assign a cost per hour to that quantity to try + * and optimize for earliest job completion, for example. This cost must be in + * the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix>|\Google\Protobuf\Internal\RepeatedField $duration_distance_matrices + * Specifies duration and distance matrices used in the model. If this field + * is empty, Google Maps or geodesic distances will be used instead, depending + * on the value of the `use_geodesic_distances` field. If it is not empty, + * `use_geodesic_distances` cannot be true and neither + * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` + * can be empty. + * Usage examples: + * * There are two locations: locA and locB. + * * 1 vehicle starting its route at locA and ending it at locA. + * * 1 pickup visit request at locB. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locA" } + * shipments { pickups { tags: "locB" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_dst_tags: "locA" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrices { + * rows { # from: locA + * durations { seconds: 0 } meters: 0 # to: locA + * durations { seconds: 100 } meters: 1000 # to: locB + * } + * rows { # from: locB + * durations { seconds: 102 } meters: 990 # to: locA + * durations { seconds: 0 } meters: 0 # to: locB + * } + * } + * } + * ``` + * * There are three locations: locA, locB and locC. + * * 1 vehicle starting its route at locA and ending it at locB, using + * matrix "fast". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "slow". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "fast". + * * 1 pickup visit request at locC. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } + * shipments { pickups { tags: "locC" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_src_tags: "locC" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrix_dst_tags: "locC" + * duration_distance_matrices { + * vehicle_start_tag: "fast" + * rows { # from: locA + * durations { seconds: 1000 } meters: 2000 # to: locB + * durations { seconds: 600 } meters: 1000 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 700 } meters: 1200 # to: locC + * } + * rows { # from: locC + * durations { seconds: 702 } meters: 1190 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * duration_distance_matrices { + * vehicle_start_tag: "slow" + * rows { # from: locA + * durations { seconds: 1800 } meters: 2001 # to: locB + * durations { seconds: 900 } meters: 1002 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 1000 } meters: 1202 # to: locC + * } + * rows { # from: locC + * durations { seconds: 1001 } meters: 1195 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * } + * ``` + * @type array|\Google\Protobuf\Internal\RepeatedField $duration_distance_matrix_src_tags + * Tags defining the sources of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j)` defines durations and distances + * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits + * in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * @type array|\Google\Protobuf\Internal\RepeatedField $duration_distance_matrix_dst_tags + * Tags defining the destinations of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j).durations(k)` (resp. + * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration + * (resp. the distance) of the travel from visits with tag + * `duration_distance_matrix_src_tags(j)` to visits with tag + * `duration_distance_matrix_dst_tags(k)` in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * @type array<\Google\Maps\RouteOptimization\V1\TransitionAttributes>|\Google\Protobuf\Internal\RepeatedField $transition_attributes + * Transition attributes added to the model. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentTypeIncompatibility>|\Google\Protobuf\Internal\RepeatedField $shipment_type_incompatibilities + * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentTypeRequirement>|\Google\Protobuf\Internal\RepeatedField $shipment_type_requirements + * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentModel\PrecedenceRule>|\Google\Protobuf\Internal\RepeatedField $precedence_rules + * Set of precedence rules which must be enforced in the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Set of shipments which must be performed in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShipments() + { + return $this->shipments; + } + + /** + * Set of shipments which must be performed in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + * @param array<\Google\Maps\RouteOptimization\V1\Shipment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShipments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment::class); + $this->shipments = $arr; + + return $this; + } + + /** + * Set of vehicles which can be used to perform visits. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVehicles() + { + return $this->vehicles; + } + + /** + * Set of vehicles which can be used to perform visits. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + * @param array<\Google\Maps\RouteOptimization\V1\Vehicle>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVehicles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Vehicle::class); + $this->vehicles = $arr; + + return $this; + } + + /** + * Constrains the maximum number of active vehicles. A vehicle is active if + * its route performs at least one shipment. This can be used to limit the + * number of routes in the case where there are fewer drivers than + * vehicles and that the fleet of vehicles is heterogeneous. The optimization + * will then select the best subset of vehicles to use. + * Must be strictly positive. + * + * Generated from protobuf field optional int32 max_active_vehicles = 4; + * @return int + */ + public function getMaxActiveVehicles() + { + return isset($this->max_active_vehicles) ? $this->max_active_vehicles : 0; + } + + public function hasMaxActiveVehicles() + { + return isset($this->max_active_vehicles); + } + + public function clearMaxActiveVehicles() + { + unset($this->max_active_vehicles); + } + + /** + * Constrains the maximum number of active vehicles. A vehicle is active if + * its route performs at least one shipment. This can be used to limit the + * number of routes in the case where there are fewer drivers than + * vehicles and that the fleet of vehicles is heterogeneous. The optimization + * will then select the best subset of vehicles to use. + * Must be strictly positive. + * + * Generated from protobuf field optional int32 max_active_vehicles = 4; + * @param int $var + * @return $this + */ + public function setMaxActiveVehicles($var) + { + GPBUtil::checkInt32($var); + $this->max_active_vehicles = $var; + + return $this; + } + + /** + * Global start and end time of the model: no times outside of this range + * can be considered valid. + * The model's time span must be less than a year, i.e. the `global_end_time` + * and the `global_start_time` must be within 31536000 seconds of each other. + * When using `cost_per_*hour` fields, you might want to set this window to a + * smaller interval to increase performance (eg. if you model a single day, + * you should set the global time limits to that day). + * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used + * as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_start_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getGlobalStartTime() + { + return $this->global_start_time; + } + + public function hasGlobalStartTime() + { + return isset($this->global_start_time); + } + + public function clearGlobalStartTime() + { + unset($this->global_start_time); + } + + /** + * Global start and end time of the model: no times outside of this range + * can be considered valid. + * The model's time span must be less than a year, i.e. the `global_end_time` + * and the `global_start_time` must be within 31536000 seconds of each other. + * When using `cost_per_*hour` fields, you might want to set this window to a + * smaller interval to increase performance (eg. if you model a single day, + * you should set the global time limits to that day). + * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used + * as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_start_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setGlobalStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->global_start_time = $var; + + return $this; + } + + /** + * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) + * is used as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_end_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getGlobalEndTime() + { + return $this->global_end_time; + } + + public function hasGlobalEndTime() + { + return isset($this->global_end_time); + } + + public function clearGlobalEndTime() + { + unset($this->global_end_time); + } + + /** + * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) + * is used as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_end_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setGlobalEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->global_end_time = $var; + + return $this; + } + + /** + * The "global duration" of the overall plan is the difference between the + * earliest effective start time and the latest effective end time of + * all vehicles. Users can assign a cost per hour to that quantity to try + * and optimize for earliest job completion, for example. This cost must be in + * the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double global_duration_cost_per_hour = 7; + * @return float + */ + public function getGlobalDurationCostPerHour() + { + return $this->global_duration_cost_per_hour; + } + + /** + * The "global duration" of the overall plan is the difference between the + * earliest effective start time and the latest effective end time of + * all vehicles. Users can assign a cost per hour to that quantity to try + * and optimize for earliest job completion, for example. This cost must be in + * the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double global_duration_cost_per_hour = 7; + * @param float $var + * @return $this + */ + public function setGlobalDurationCostPerHour($var) + { + GPBUtil::checkDouble($var); + $this->global_duration_cost_per_hour = $var; + + return $this; + } + + /** + * Specifies duration and distance matrices used in the model. If this field + * is empty, Google Maps or geodesic distances will be used instead, depending + * on the value of the `use_geodesic_distances` field. If it is not empty, + * `use_geodesic_distances` cannot be true and neither + * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` + * can be empty. + * Usage examples: + * * There are two locations: locA and locB. + * * 1 vehicle starting its route at locA and ending it at locA. + * * 1 pickup visit request at locB. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locA" } + * shipments { pickups { tags: "locB" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_dst_tags: "locA" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrices { + * rows { # from: locA + * durations { seconds: 0 } meters: 0 # to: locA + * durations { seconds: 100 } meters: 1000 # to: locB + * } + * rows { # from: locB + * durations { seconds: 102 } meters: 990 # to: locA + * durations { seconds: 0 } meters: 0 # to: locB + * } + * } + * } + * ``` + * * There are three locations: locA, locB and locC. + * * 1 vehicle starting its route at locA and ending it at locB, using + * matrix "fast". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "slow". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "fast". + * * 1 pickup visit request at locC. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } + * shipments { pickups { tags: "locC" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_src_tags: "locC" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrix_dst_tags: "locC" + * duration_distance_matrices { + * vehicle_start_tag: "fast" + * rows { # from: locA + * durations { seconds: 1000 } meters: 2000 # to: locB + * durations { seconds: 600 } meters: 1000 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 700 } meters: 1200 # to: locC + * } + * rows { # from: locC + * durations { seconds: 702 } meters: 1190 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * duration_distance_matrices { + * vehicle_start_tag: "slow" + * rows { # from: locA + * durations { seconds: 1800 } meters: 2001 # to: locB + * durations { seconds: 900 } meters: 1002 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 1000 } meters: 1202 # to: locC + * } + * rows { # from: locC + * durations { seconds: 1001 } meters: 1195 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * } + * ``` + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDurationDistanceMatrices() + { + return $this->duration_distance_matrices; + } + + /** + * Specifies duration and distance matrices used in the model. If this field + * is empty, Google Maps or geodesic distances will be used instead, depending + * on the value of the `use_geodesic_distances` field. If it is not empty, + * `use_geodesic_distances` cannot be true and neither + * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` + * can be empty. + * Usage examples: + * * There are two locations: locA and locB. + * * 1 vehicle starting its route at locA and ending it at locA. + * * 1 pickup visit request at locB. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locA" } + * shipments { pickups { tags: "locB" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_dst_tags: "locA" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrices { + * rows { # from: locA + * durations { seconds: 0 } meters: 0 # to: locA + * durations { seconds: 100 } meters: 1000 # to: locB + * } + * rows { # from: locB + * durations { seconds: 102 } meters: 990 # to: locA + * durations { seconds: 0 } meters: 0 # to: locB + * } + * } + * } + * ``` + * * There are three locations: locA, locB and locC. + * * 1 vehicle starting its route at locA and ending it at locB, using + * matrix "fast". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "slow". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "fast". + * * 1 pickup visit request at locC. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } + * shipments { pickups { tags: "locC" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_src_tags: "locC" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrix_dst_tags: "locC" + * duration_distance_matrices { + * vehicle_start_tag: "fast" + * rows { # from: locA + * durations { seconds: 1000 } meters: 2000 # to: locB + * durations { seconds: 600 } meters: 1000 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 700 } meters: 1200 # to: locC + * } + * rows { # from: locC + * durations { seconds: 702 } meters: 1190 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * duration_distance_matrices { + * vehicle_start_tag: "slow" + * rows { # from: locA + * durations { seconds: 1800 } meters: 2001 # to: locB + * durations { seconds: 900 } meters: 1002 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 1000 } meters: 1202 # to: locC + * } + * rows { # from: locC + * durations { seconds: 1001 } meters: 1195 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * } + * ``` + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDurationDistanceMatrices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix::class); + $this->duration_distance_matrices = $arr; + + return $this; + } + + /** + * Tags defining the sources of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j)` defines durations and distances + * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits + * in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_src_tags = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDurationDistanceMatrixSrcTags() + { + return $this->duration_distance_matrix_src_tags; + } + + /** + * Tags defining the sources of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j)` defines durations and distances + * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits + * in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_src_tags = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDurationDistanceMatrixSrcTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->duration_distance_matrix_src_tags = $arr; + + return $this; + } + + /** + * Tags defining the destinations of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j).durations(k)` (resp. + * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration + * (resp. the distance) of the travel from visits with tag + * `duration_distance_matrix_src_tags(j)` to visits with tag + * `duration_distance_matrix_dst_tags(k)` in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_dst_tags = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDurationDistanceMatrixDstTags() + { + return $this->duration_distance_matrix_dst_tags; + } + + /** + * Tags defining the destinations of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j).durations(k)` (resp. + * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration + * (resp. the distance) of the travel from visits with tag + * `duration_distance_matrix_src_tags(j)` to visits with tag + * `duration_distance_matrix_dst_tags(k)` in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_dst_tags = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDurationDistanceMatrixDstTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->duration_distance_matrix_dst_tags = $arr; + + return $this; + } + + /** + * Transition attributes added to the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransitionAttributes() + { + return $this->transition_attributes; + } + + /** + * Transition attributes added to the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + * @param array<\Google\Maps\RouteOptimization\V1\TransitionAttributes>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransitionAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\TransitionAttributes::class); + $this->transition_attributes = $arr; + + return $this; + } + + /** + * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShipmentTypeIncompatibilities() + { + return $this->shipment_type_incompatibilities; + } + + /** + * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentTypeIncompatibility>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShipmentTypeIncompatibilities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentTypeIncompatibility::class); + $this->shipment_type_incompatibilities = $arr; + + return $this; + } + + /** + * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShipmentTypeRequirements() + { + return $this->shipment_type_requirements; + } + + /** + * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentTypeRequirement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShipmentTypeRequirements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentTypeRequirement::class); + $this->shipment_type_requirements = $arr; + + return $this; + } + + /** + * Set of precedence rules which must be enforced in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPrecedenceRules() + { + return $this->precedence_rules; + } + + /** + * Set of precedence rules which must be enforced in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentModel\PrecedenceRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPrecedenceRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentModel\PrecedenceRule::class); + $this->precedence_rules = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix.php b/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix.php new file mode 100644 index 000000000000..dc14a06e94f1 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix.php @@ -0,0 +1,135 @@ +google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + */ +class DurationDistanceMatrix extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the rows of the duration and distance matrix. It must have as + * many elements as + * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags]. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; + */ + private $rows; + /** + * Tag defining to which vehicles this duration and distance matrix applies. + * If empty, this applies to all vehicles, and there can only be a single + * matrix. + * Each vehicle start must match exactly one matrix, i.e. exactly one of + * their `start_tags` field must match the `vehicle_start_tag` of a matrix + * (and of that matrix only). + * All matrices must have a different `vehicle_start_tag`. + * + * Generated from protobuf field string vehicle_start_tag = 2; + */ + protected $vehicle_start_tag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix\Row>|\Google\Protobuf\Internal\RepeatedField $rows + * Specifies the rows of the duration and distance matrix. It must have as + * many elements as + * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags]. + * @type string $vehicle_start_tag + * Tag defining to which vehicles this duration and distance matrix applies. + * If empty, this applies to all vehicles, and there can only be a single + * matrix. + * Each vehicle start must match exactly one matrix, i.e. exactly one of + * their `start_tags` field must match the `vehicle_start_tag` of a matrix + * (and of that matrix only). + * All matrices must have a different `vehicle_start_tag`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the rows of the duration and distance matrix. It must have as + * many elements as + * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags]. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRows() + { + return $this->rows; + } + + /** + * Specifies the rows of the duration and distance matrix. It must have as + * many elements as + * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags]. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix\Row::class); + $this->rows = $arr; + + return $this; + } + + /** + * Tag defining to which vehicles this duration and distance matrix applies. + * If empty, this applies to all vehicles, and there can only be a single + * matrix. + * Each vehicle start must match exactly one matrix, i.e. exactly one of + * their `start_tags` field must match the `vehicle_start_tag` of a matrix + * (and of that matrix only). + * All matrices must have a different `vehicle_start_tag`. + * + * Generated from protobuf field string vehicle_start_tag = 2; + * @return string + */ + public function getVehicleStartTag() + { + return $this->vehicle_start_tag; + } + + /** + * Tag defining to which vehicles this duration and distance matrix applies. + * If empty, this applies to all vehicles, and there can only be a single + * matrix. + * Each vehicle start must match exactly one matrix, i.e. exactly one of + * their `start_tags` field must match the `vehicle_start_tag` of a matrix + * (and of that matrix only). + * All matrices must have a different `vehicle_start_tag`. + * + * Generated from protobuf field string vehicle_start_tag = 2; + * @param string $var + * @return $this + */ + public function setVehicleStartTag($var) + { + GPBUtil::checkString($var, True); + $this->vehicle_start_tag = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix/Row.php b/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix/Row.php new file mode 100644 index 000000000000..dfe9ec58784d --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix/Row.php @@ -0,0 +1,114 @@ +google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + */ +class Row extends \Google\Protobuf\Internal\Message +{ + /** + * Duration values for a given row. It must have as many elements as + * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags]. + * + * Generated from protobuf field repeated .google.protobuf.Duration durations = 1; + */ + private $durations; + /** + * Distance values for a given row. If no costs or constraints refer to + * distances in the model, this can be left empty; otherwise it must have + * as many elements as `durations`. + * + * Generated from protobuf field repeated double meters = 2; + */ + private $meters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $durations + * Duration values for a given row. It must have as many elements as + * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags]. + * @type array|\Google\Protobuf\Internal\RepeatedField $meters + * Distance values for a given row. If no costs or constraints refer to + * distances in the model, this can be left empty; otherwise it must have + * as many elements as `durations`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Duration values for a given row. It must have as many elements as + * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags]. + * + * Generated from protobuf field repeated .google.protobuf.Duration durations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDurations() + { + return $this->durations; + } + + /** + * Duration values for a given row. It must have as many elements as + * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags]. + * + * Generated from protobuf field repeated .google.protobuf.Duration durations = 1; + * @param array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDurations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->durations = $arr; + + return $this; + } + + /** + * Distance values for a given row. If no costs or constraints refer to + * distances in the model, this can be left empty; otherwise it must have + * as many elements as `durations`. + * + * Generated from protobuf field repeated double meters = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMeters() + { + return $this->meters; + } + + /** + * Distance values for a given row. If no costs or constraints refer to + * distances in the model, this can be left empty; otherwise it must have + * as many elements as `durations`. + * + * Generated from protobuf field repeated double meters = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMeters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->meters = $arr; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentModel/PrecedenceRule.php b/MapsRouteOptimization/src/V1/ShipmentModel/PrecedenceRule.php new file mode 100644 index 000000000000..2aea9bab72c0 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentModel/PrecedenceRule.php @@ -0,0 +1,241 @@ +google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + */ +class PrecedenceRule extends \Google\Protobuf\Internal\Message +{ + /** + * Shipment index of the "first" event. This field must be specified. + * + * Generated from protobuf field optional int32 first_index = 1; + */ + protected $first_index = null; + /** + * Indicates if the "first" event is a delivery. + * + * Generated from protobuf field bool first_is_delivery = 3; + */ + protected $first_is_delivery = false; + /** + * Shipment index of the "second" event. This field must be specified. + * + * Generated from protobuf field optional int32 second_index = 2; + */ + protected $second_index = null; + /** + * Indicates if the "second" event is a delivery. + * + * Generated from protobuf field bool second_is_delivery = 4; + */ + protected $second_is_delivery = false; + /** + * The offset between the "first" and "second" event. It can be negative. + * + * Generated from protobuf field .google.protobuf.Duration offset_duration = 5; + */ + protected $offset_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $first_index + * Shipment index of the "first" event. This field must be specified. + * @type bool $first_is_delivery + * Indicates if the "first" event is a delivery. + * @type int $second_index + * Shipment index of the "second" event. This field must be specified. + * @type bool $second_is_delivery + * Indicates if the "second" event is a delivery. + * @type \Google\Protobuf\Duration $offset_duration + * The offset between the "first" and "second" event. It can be negative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Shipment index of the "first" event. This field must be specified. + * + * Generated from protobuf field optional int32 first_index = 1; + * @return int + */ + public function getFirstIndex() + { + return isset($this->first_index) ? $this->first_index : 0; + } + + public function hasFirstIndex() + { + return isset($this->first_index); + } + + public function clearFirstIndex() + { + unset($this->first_index); + } + + /** + * Shipment index of the "first" event. This field must be specified. + * + * Generated from protobuf field optional int32 first_index = 1; + * @param int $var + * @return $this + */ + public function setFirstIndex($var) + { + GPBUtil::checkInt32($var); + $this->first_index = $var; + + return $this; + } + + /** + * Indicates if the "first" event is a delivery. + * + * Generated from protobuf field bool first_is_delivery = 3; + * @return bool + */ + public function getFirstIsDelivery() + { + return $this->first_is_delivery; + } + + /** + * Indicates if the "first" event is a delivery. + * + * Generated from protobuf field bool first_is_delivery = 3; + * @param bool $var + * @return $this + */ + public function setFirstIsDelivery($var) + { + GPBUtil::checkBool($var); + $this->first_is_delivery = $var; + + return $this; + } + + /** + * Shipment index of the "second" event. This field must be specified. + * + * Generated from protobuf field optional int32 second_index = 2; + * @return int + */ + public function getSecondIndex() + { + return isset($this->second_index) ? $this->second_index : 0; + } + + public function hasSecondIndex() + { + return isset($this->second_index); + } + + public function clearSecondIndex() + { + unset($this->second_index); + } + + /** + * Shipment index of the "second" event. This field must be specified. + * + * Generated from protobuf field optional int32 second_index = 2; + * @param int $var + * @return $this + */ + public function setSecondIndex($var) + { + GPBUtil::checkInt32($var); + $this->second_index = $var; + + return $this; + } + + /** + * Indicates if the "second" event is a delivery. + * + * Generated from protobuf field bool second_is_delivery = 4; + * @return bool + */ + public function getSecondIsDelivery() + { + return $this->second_is_delivery; + } + + /** + * Indicates if the "second" event is a delivery. + * + * Generated from protobuf field bool second_is_delivery = 4; + * @param bool $var + * @return $this + */ + public function setSecondIsDelivery($var) + { + GPBUtil::checkBool($var); + $this->second_is_delivery = $var; + + return $this; + } + + /** + * The offset between the "first" and "second" event. It can be negative. + * + * Generated from protobuf field .google.protobuf.Duration offset_duration = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getOffsetDuration() + { + return $this->offset_duration; + } + + public function hasOffsetDuration() + { + return isset($this->offset_duration); + } + + public function clearOffsetDuration() + { + unset($this->offset_duration); + } + + /** + * The offset between the "first" and "second" event. It can be negative. + * + * Generated from protobuf field .google.protobuf.Duration offset_duration = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setOffsetDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->offset_duration = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute.php b/MapsRouteOptimization/src/V1/ShipmentRoute.php new file mode 100644 index 000000000000..3c191d29cca6 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute.php @@ -0,0 +1,706 @@ + + * | TRANSITION[i] | VISIT[i] | + * | | | + * | * TRAVEL: the vehicle moves from | PERFORM the visit: | + * | VISIT[i-1].departure_location to | | + * | VISIT[i].arrival_location, which | * Spend some time: | + * | takes a given travel duration | the "visit duration". | + * | and distance | | + * | | * Load or unload | + * | * BREAKS: the driver may have | some quantities from the | + * | breaks (e.g. lunch break). | vehicle: the "demand". | + * | | | + * | * WAIT: the driver/vehicle does | | + * | nothing. This can happen for | | + * | many reasons, for example when | | + * | the vehicle reaches the next | | + * | event's destination before the | | + * | start of its time window | | + * | | | + * | * DELAY: *right before* the next | | + * | arrival. E.g. the vehicle and/or | | + * | driver spends time unloading. | | + * | | | + * ---+-------------------------------------+-----------------------------+--> + * ^ ^ ^ + * V[i-1].end V[i].start V[i].end + * ``` + * Lastly, here is how the TRAVEL, BREAKS, DELAY and WAIT can be arranged + * during a transition. + * * They don't overlap. + * * The DELAY is unique and *must* be a contiguous period of time right + * before the next visit (or vehicle end). Thus, it suffice to know the + * delay duration to know its start and end time. + * * The BREAKS are contiguous, non-overlapping periods of time. The + * response specifies the start time and duration of each break. + * * TRAVEL and WAIT are "preemptable": they can be interrupted several times + * during this transition. Clients can assume that travel happens "as soon as + * possible" and that "wait" fills the remaining time. + * A (complex) example: + * ``` + * TRANSITION[i] + * --++-----+-----------------------------------------------------------++--> + * || | | | | | | || + * || T | B | T | | B | | D || + * || r | r | r | W | r | W | e || + * || a | e | a | a | e | a | l || + * || v | a | v | i | a | i | a || + * || e | k | e | t | k | t | y || + * || l | | l | | | | || + * || | | | | | | || + * --++-----------------------------------------------------------------++--> + * ``` + * + * Generated from protobuf message google.maps.routeoptimization.v1.ShipmentRoute + */ +class ShipmentRoute extends \Google\Protobuf\Internal\Message +{ + /** + * Vehicle performing the route, identified by its index in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 vehicle_index = 1; + */ + protected $vehicle_index = 0; + /** + * Label of the vehicle performing this route, equal to + * `ShipmentModel.vehicles(vehicle_index).label`, if specified. + * + * Generated from protobuf field string vehicle_label = 2; + */ + protected $vehicle_label = ''; + /** + * Time at which the vehicle starts its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_start_time = 5; + */ + protected $vehicle_start_time = null; + /** + * Time at which the vehicle finishes its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_end_time = 6; + */ + protected $vehicle_end_time = null; + /** + * Ordered sequence of visits representing a route. + * visits[i] is the i-th visit in the route. + * If this field is empty, the vehicle is considered as unused. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + private $visits; + /** + * Ordered list of transitions for the route. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + */ + private $transitions; + /** + * When + * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * is set to true, this field indicates that inconsistencies in route timings + * are predicted using traffic-based travel duration estimates. There may be + * insufficient time to complete traffic-adjusted travel, delays, and breaks + * between visits, before the first visit, or after the last visit, while + * still satisfying the visit and vehicle time windows. For example, + * ``` + * start_time(previous_visit) + duration(previous_visit) + + * travel_duration(previous_visit, next_visit) > start_time(next_visit) + * ``` + * Arrival at next_visit will likely happen later than its current + * time window due the increased estimate of travel time + * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + * may be forced to overlap with a visit due to an increase in travel time + * estimates and visit or break time window restrictions. + * + * Generated from protobuf field bool has_traffic_infeasibilities = 9; + */ + protected $has_traffic_infeasibilities = false; + /** + * The encoded polyline representation of the route. + * This field is only populated if + * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + */ + protected $route_polyline = null; + /** + * Breaks scheduled for the vehicle performing this route. + * The `breaks` sequence represents time intervals, each starting at the + * corresponding `start_time` and lasting `duration` seconds. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + private $breaks; + /** + * Duration, distance and load metrics for this route. The fields of + * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + * summed over all + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * or + * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + * depending on the context. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + protected $metrics = null; + /** + * Cost of the route, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + * "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole route. + * In other words, costs["model.shipments.pickups.cost"] is the sum of all + * pickup costs over the route. All costs defined in the model are reported in + * detail here with the exception of costs related to TransitionAttributes + * that are only reported in an aggregated way as of 2022/01. + * + * Generated from protobuf field map route_costs = 17; + */ + private $route_costs; + /** + * Total cost of the route. The sum of all costs in the cost map. + * + * Generated from protobuf field double route_total_cost = 18; + */ + protected $route_total_cost = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $vehicle_index + * Vehicle performing the route, identified by its index in the source + * `ShipmentModel`. + * @type string $vehicle_label + * Label of the vehicle performing this route, equal to + * `ShipmentModel.vehicles(vehicle_index).label`, if specified. + * @type \Google\Protobuf\Timestamp $vehicle_start_time + * Time at which the vehicle starts its route. + * @type \Google\Protobuf\Timestamp $vehicle_end_time + * Time at which the vehicle finishes its route. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\Visit>|\Google\Protobuf\Internal\RepeatedField $visits + * Ordered sequence of visits representing a route. + * visits[i] is the i-th visit in the route. + * If this field is empty, the vehicle is considered as unused. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\Transition>|\Google\Protobuf\Internal\RepeatedField $transitions + * Ordered list of transitions for the route. + * @type bool $has_traffic_infeasibilities + * When + * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * is set to true, this field indicates that inconsistencies in route timings + * are predicted using traffic-based travel duration estimates. There may be + * insufficient time to complete traffic-adjusted travel, delays, and breaks + * between visits, before the first visit, or after the last visit, while + * still satisfying the visit and vehicle time windows. For example, + * ``` + * start_time(previous_visit) + duration(previous_visit) + + * travel_duration(previous_visit, next_visit) > start_time(next_visit) + * ``` + * Arrival at next_visit will likely happen later than its current + * time window due the increased estimate of travel time + * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + * may be forced to overlap with a visit due to an increase in travel time + * estimates and visit or break time window restrictions. + * @type \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline $route_polyline + * The encoded polyline representation of the route. + * This field is only populated if + * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + * is set to true. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\PBBreak>|\Google\Protobuf\Internal\RepeatedField $breaks + * Breaks scheduled for the vehicle performing this route. + * The `breaks` sequence represents time intervals, each starting at the + * corresponding `start_time` and lasting `duration` seconds. + * @type \Google\Maps\RouteOptimization\V1\AggregatedMetrics $metrics + * Duration, distance and load metrics for this route. The fields of + * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + * summed over all + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * or + * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + * depending on the context. + * @type array|\Google\Protobuf\Internal\MapField $route_costs + * Cost of the route, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + * "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole route. + * In other words, costs["model.shipments.pickups.cost"] is the sum of all + * pickup costs over the route. All costs defined in the model are reported in + * detail here with the exception of costs related to TransitionAttributes + * that are only reported in an aggregated way as of 2022/01. + * @type float $route_total_cost + * Total cost of the route. The sum of all costs in the cost map. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Vehicle performing the route, identified by its index in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 vehicle_index = 1; + * @return int + */ + public function getVehicleIndex() + { + return $this->vehicle_index; + } + + /** + * Vehicle performing the route, identified by its index in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 vehicle_index = 1; + * @param int $var + * @return $this + */ + public function setVehicleIndex($var) + { + GPBUtil::checkInt32($var); + $this->vehicle_index = $var; + + return $this; + } + + /** + * Label of the vehicle performing this route, equal to + * `ShipmentModel.vehicles(vehicle_index).label`, if specified. + * + * Generated from protobuf field string vehicle_label = 2; + * @return string + */ + public function getVehicleLabel() + { + return $this->vehicle_label; + } + + /** + * Label of the vehicle performing this route, equal to + * `ShipmentModel.vehicles(vehicle_index).label`, if specified. + * + * Generated from protobuf field string vehicle_label = 2; + * @param string $var + * @return $this + */ + public function setVehicleLabel($var) + { + GPBUtil::checkString($var, True); + $this->vehicle_label = $var; + + return $this; + } + + /** + * Time at which the vehicle starts its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_start_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getVehicleStartTime() + { + return $this->vehicle_start_time; + } + + public function hasVehicleStartTime() + { + return isset($this->vehicle_start_time); + } + + public function clearVehicleStartTime() + { + unset($this->vehicle_start_time); + } + + /** + * Time at which the vehicle starts its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_start_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setVehicleStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->vehicle_start_time = $var; + + return $this; + } + + /** + * Time at which the vehicle finishes its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_end_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getVehicleEndTime() + { + return $this->vehicle_end_time; + } + + public function hasVehicleEndTime() + { + return isset($this->vehicle_end_time); + } + + public function clearVehicleEndTime() + { + unset($this->vehicle_end_time); + } + + /** + * Time at which the vehicle finishes its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_end_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setVehicleEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->vehicle_end_time = $var; + + return $this; + } + + /** + * Ordered sequence of visits representing a route. + * visits[i] is the i-th visit in the route. + * If this field is empty, the vehicle is considered as unused. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVisits() + { + return $this->visits; + } + + /** + * Ordered sequence of visits representing a route. + * visits[i] is the i-th visit in the route. + * If this field is empty, the vehicle is considered as unused. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\Visit>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVisits($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\Visit::class); + $this->visits = $arr; + + return $this; + } + + /** + * Ordered list of transitions for the route. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransitions() + { + return $this->transitions; + } + + /** + * Ordered list of transitions for the route. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\Transition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransitions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\Transition::class); + $this->transitions = $arr; + + return $this; + } + + /** + * When + * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * is set to true, this field indicates that inconsistencies in route timings + * are predicted using traffic-based travel duration estimates. There may be + * insufficient time to complete traffic-adjusted travel, delays, and breaks + * between visits, before the first visit, or after the last visit, while + * still satisfying the visit and vehicle time windows. For example, + * ``` + * start_time(previous_visit) + duration(previous_visit) + + * travel_duration(previous_visit, next_visit) > start_time(next_visit) + * ``` + * Arrival at next_visit will likely happen later than its current + * time window due the increased estimate of travel time + * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + * may be forced to overlap with a visit due to an increase in travel time + * estimates and visit or break time window restrictions. + * + * Generated from protobuf field bool has_traffic_infeasibilities = 9; + * @return bool + */ + public function getHasTrafficInfeasibilities() + { + return $this->has_traffic_infeasibilities; + } + + /** + * When + * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * is set to true, this field indicates that inconsistencies in route timings + * are predicted using traffic-based travel duration estimates. There may be + * insufficient time to complete traffic-adjusted travel, delays, and breaks + * between visits, before the first visit, or after the last visit, while + * still satisfying the visit and vehicle time windows. For example, + * ``` + * start_time(previous_visit) + duration(previous_visit) + + * travel_duration(previous_visit, next_visit) > start_time(next_visit) + * ``` + * Arrival at next_visit will likely happen later than its current + * time window due the increased estimate of travel time + * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + * may be forced to overlap with a visit due to an increase in travel time + * estimates and visit or break time window restrictions. + * + * Generated from protobuf field bool has_traffic_infeasibilities = 9; + * @param bool $var + * @return $this + */ + public function setHasTrafficInfeasibilities($var) + { + GPBUtil::checkBool($var); + $this->has_traffic_infeasibilities = $var; + + return $this; + } + + /** + * The encoded polyline representation of the route. + * This field is only populated if + * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * @return \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline|null + */ + public function getRoutePolyline() + { + return $this->route_polyline; + } + + public function hasRoutePolyline() + { + return isset($this->route_polyline); + } + + public function clearRoutePolyline() + { + unset($this->route_polyline); + } + + /** + * The encoded polyline representation of the route. + * This field is only populated if + * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * @param \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline $var + * @return $this + */ + public function setRoutePolyline($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline::class); + $this->route_polyline = $var; + + return $this; + } + + /** + * Breaks scheduled for the vehicle performing this route. + * The `breaks` sequence represents time intervals, each starting at the + * corresponding `start_time` and lasting `duration` seconds. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBreaks() + { + return $this->breaks; + } + + /** + * Breaks scheduled for the vehicle performing this route. + * The `breaks` sequence represents time intervals, each starting at the + * corresponding `start_time` and lasting `duration` seconds. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\PBBreak>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBreaks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\PBBreak::class); + $this->breaks = $arr; + + return $this; + } + + /** + * Duration, distance and load metrics for this route. The fields of + * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + * summed over all + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * or + * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + * depending on the context. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * @return \Google\Maps\RouteOptimization\V1\AggregatedMetrics|null + */ + public function getMetrics() + { + return $this->metrics; + } + + public function hasMetrics() + { + return isset($this->metrics); + } + + public function clearMetrics() + { + unset($this->metrics); + } + + /** + * Duration, distance and load metrics for this route. The fields of + * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + * summed over all + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * or + * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + * depending on the context. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * @param \Google\Maps\RouteOptimization\V1\AggregatedMetrics $var + * @return $this + */ + public function setMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\AggregatedMetrics::class); + $this->metrics = $var; + + return $this; + } + + /** + * Cost of the route, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + * "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole route. + * In other words, costs["model.shipments.pickups.cost"] is the sum of all + * pickup costs over the route. All costs defined in the model are reported in + * detail here with the exception of costs related to TransitionAttributes + * that are only reported in an aggregated way as of 2022/01. + * + * Generated from protobuf field map route_costs = 17; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRouteCosts() + { + return $this->route_costs; + } + + /** + * Cost of the route, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + * "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole route. + * In other words, costs["model.shipments.pickups.cost"] is the sum of all + * pickup costs over the route. All costs defined in the model are reported in + * detail here with the exception of costs related to TransitionAttributes + * that are only reported in an aggregated way as of 2022/01. + * + * Generated from protobuf field map route_costs = 17; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRouteCosts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->route_costs = $arr; + + return $this; + } + + /** + * Total cost of the route. The sum of all costs in the cost map. + * + * Generated from protobuf field double route_total_cost = 18; + * @return float + */ + public function getRouteTotalCost() + { + return $this->route_total_cost; + } + + /** + * Total cost of the route. The sum of all costs in the cost map. + * + * Generated from protobuf field double route_total_cost = 18; + * @param float $var + * @return $this + */ + public function setRouteTotalCost($var) + { + GPBUtil::checkDouble($var); + $this->route_total_cost = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/EncodedPolyline.php b/MapsRouteOptimization/src/V1/ShipmentRoute/EncodedPolyline.php new file mode 100644 index 000000000000..db8290832846 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/EncodedPolyline.php @@ -0,0 +1,71 @@ +google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + */ +class EncodedPolyline extends \Google\Protobuf\Internal\Message +{ + /** + * String representing encoded points of the polyline. + * + * Generated from protobuf field string points = 1; + */ + protected $points = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $points + * String representing encoded points of the polyline. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * String representing encoded points of the polyline. + * + * Generated from protobuf field string points = 1; + * @return string + */ + public function getPoints() + { + return $this->points; + } + + /** + * String representing encoded points of the polyline. + * + * Generated from protobuf field string points = 1; + * @param string $var + * @return $this + */ + public function setPoints($var) + { + GPBUtil::checkString($var, True); + $this->points = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/PBBreak.php b/MapsRouteOptimization/src/V1/ShipmentRoute/PBBreak.php new file mode 100644 index 000000000000..e84a701f43cc --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/PBBreak.php @@ -0,0 +1,122 @@ +google.maps.routeoptimization.v1.ShipmentRoute.Break + */ +class PBBreak extends \Google\Protobuf\Internal\Message +{ + /** + * Start time of a break. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Duration of a break. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + */ + protected $duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Start time of a break. + * @type \Google\Protobuf\Duration $duration + * Duration of a break. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Start time of a break. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start time of a break. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Duration of a break. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Duration of a break. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/Transition.php b/MapsRouteOptimization/src/V1/ShipmentRoute/Transition.php new file mode 100644 index 000000000000..2de1b69665a9 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/Transition.php @@ -0,0 +1,571 @@ +google.maps.routeoptimization.v1.ShipmentRoute.Transition + */ +class Transition extends \Google\Protobuf\Internal\Message +{ + /** + * Travel duration during this transition. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 1; + */ + protected $travel_duration = null; + /** + * Distance traveled during the transition. + * + * Generated from protobuf field double travel_distance_meters = 2; + */ + protected $travel_distance_meters = 0.0; + /** + * When traffic is requested via + * [OptimizeToursRequest.consider_road_traffic] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * and the traffic info couldn't be retrieved for a `Transition`, this + * boolean is set to true. This may be temporary (rare hiccup in the + * realtime traffic servers) or permanent (no data for this location). + * + * Generated from protobuf field bool traffic_info_unavailable = 3; + */ + protected $traffic_info_unavailable = false; + /** + * Sum of the delay durations applied to this transition. If any, the delay + * starts exactly `delay_duration` seconds before the next event (visit or + * vehicle end). See + * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + */ + protected $delay_duration = null; + /** + * Sum of the duration of the breaks occurring during this transition, if + * any. Details about each break's start time and duration are stored in + * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + */ + protected $break_duration = null; + /** + * Time spent waiting during this transition. Wait duration corresponds to + * idle time and does not include break time. Also note that this wait time + * may be split into several non-contiguous intervals. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 6; + */ + protected $wait_duration = null; + /** + * Total duration of the transition, provided for convenience. It is equal + * to: + * * next visit `start_time` (or `vehicle_end_time` if this is the last + * transition) - this transition's `start_time`; + * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + * additionally holds: `total_duration = travel_duration + delay_duration + * + break_duration + wait_duration`. + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + */ + protected $total_duration = null; + /** + * Start time of this transition. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 8; + */ + protected $start_time = null; + /** + * The encoded polyline representation of the route followed during the + * transition. + * This field is only populated if [populate_transition_polylines] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + */ + protected $route_polyline = null; + /** + * Vehicle loads during this transition, for each type that either appears + * in this vehicle's + * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + * or that have non-zero + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * on some shipment performed on this route. + * The loads during the first transition are the starting loads of the + * vehicle route. Then, after each visit, the visit's `load_demands` are + * either added or subtracted to get the next transition's loads, depending + * on whether the visit was a pickup or a delivery. + * + * Generated from protobuf field map vehicle_loads = 11; + */ + private $vehicle_loads; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $travel_duration + * Travel duration during this transition. + * @type float $travel_distance_meters + * Distance traveled during the transition. + * @type bool $traffic_info_unavailable + * When traffic is requested via + * [OptimizeToursRequest.consider_road_traffic] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * and the traffic info couldn't be retrieved for a `Transition`, this + * boolean is set to true. This may be temporary (rare hiccup in the + * realtime traffic servers) or permanent (no data for this location). + * @type \Google\Protobuf\Duration $delay_duration + * Sum of the delay durations applied to this transition. If any, the delay + * starts exactly `delay_duration` seconds before the next event (visit or + * vehicle end). See + * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + * @type \Google\Protobuf\Duration $break_duration + * Sum of the duration of the breaks occurring during this transition, if + * any. Details about each break's start time and duration are stored in + * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + * @type \Google\Protobuf\Duration $wait_duration + * Time spent waiting during this transition. Wait duration corresponds to + * idle time and does not include break time. Also note that this wait time + * may be split into several non-contiguous intervals. + * @type \Google\Protobuf\Duration $total_duration + * Total duration of the transition, provided for convenience. It is equal + * to: + * * next visit `start_time` (or `vehicle_end_time` if this is the last + * transition) - this transition's `start_time`; + * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + * additionally holds: `total_duration = travel_duration + delay_duration + * + break_duration + wait_duration`. + * @type \Google\Protobuf\Timestamp $start_time + * Start time of this transition. + * @type \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline $route_polyline + * The encoded polyline representation of the route followed during the + * transition. + * This field is only populated if [populate_transition_polylines] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + * is set to true. + * @type array|\Google\Protobuf\Internal\MapField $vehicle_loads + * Vehicle loads during this transition, for each type that either appears + * in this vehicle's + * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + * or that have non-zero + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * on some shipment performed on this route. + * The loads during the first transition are the starting loads of the + * vehicle route. Then, after each visit, the visit's `load_demands` are + * either added or subtracted to get the next transition's loads, depending + * on whether the visit was a pickup or a delivery. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Travel duration during this transition. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getTravelDuration() + { + return $this->travel_duration; + } + + public function hasTravelDuration() + { + return isset($this->travel_duration); + } + + public function clearTravelDuration() + { + unset($this->travel_duration); + } + + /** + * Travel duration during this transition. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTravelDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->travel_duration = $var; + + return $this; + } + + /** + * Distance traveled during the transition. + * + * Generated from protobuf field double travel_distance_meters = 2; + * @return float + */ + public function getTravelDistanceMeters() + { + return $this->travel_distance_meters; + } + + /** + * Distance traveled during the transition. + * + * Generated from protobuf field double travel_distance_meters = 2; + * @param float $var + * @return $this + */ + public function setTravelDistanceMeters($var) + { + GPBUtil::checkDouble($var); + $this->travel_distance_meters = $var; + + return $this; + } + + /** + * When traffic is requested via + * [OptimizeToursRequest.consider_road_traffic] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * and the traffic info couldn't be retrieved for a `Transition`, this + * boolean is set to true. This may be temporary (rare hiccup in the + * realtime traffic servers) or permanent (no data for this location). + * + * Generated from protobuf field bool traffic_info_unavailable = 3; + * @return bool + */ + public function getTrafficInfoUnavailable() + { + return $this->traffic_info_unavailable; + } + + /** + * When traffic is requested via + * [OptimizeToursRequest.consider_road_traffic] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * and the traffic info couldn't be retrieved for a `Transition`, this + * boolean is set to true. This may be temporary (rare hiccup in the + * realtime traffic servers) or permanent (no data for this location). + * + * Generated from protobuf field bool traffic_info_unavailable = 3; + * @param bool $var + * @return $this + */ + public function setTrafficInfoUnavailable($var) + { + GPBUtil::checkBool($var); + $this->traffic_info_unavailable = $var; + + return $this; + } + + /** + * Sum of the delay durations applied to this transition. If any, the delay + * starts exactly `delay_duration` seconds before the next event (visit or + * vehicle end). See + * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getDelayDuration() + { + return $this->delay_duration; + } + + public function hasDelayDuration() + { + return isset($this->delay_duration); + } + + public function clearDelayDuration() + { + unset($this->delay_duration); + } + + /** + * Sum of the delay durations applied to this transition. If any, the delay + * starts exactly `delay_duration` seconds before the next event (visit or + * vehicle end). See + * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDelayDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->delay_duration = $var; + + return $this; + } + + /** + * Sum of the duration of the breaks occurring during this transition, if + * any. Details about each break's start time and duration are stored in + * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getBreakDuration() + { + return $this->break_duration; + } + + public function hasBreakDuration() + { + return isset($this->break_duration); + } + + public function clearBreakDuration() + { + unset($this->break_duration); + } + + /** + * Sum of the duration of the breaks occurring during this transition, if + * any. Details about each break's start time and duration are stored in + * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBreakDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->break_duration = $var; + + return $this; + } + + /** + * Time spent waiting during this transition. Wait duration corresponds to + * idle time and does not include break time. Also note that this wait time + * may be split into several non-contiguous intervals. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 6; + * @return \Google\Protobuf\Duration|null + */ + public function getWaitDuration() + { + return $this->wait_duration; + } + + public function hasWaitDuration() + { + return isset($this->wait_duration); + } + + public function clearWaitDuration() + { + unset($this->wait_duration); + } + + /** + * Time spent waiting during this transition. Wait duration corresponds to + * idle time and does not include break time. Also note that this wait time + * may be split into several non-contiguous intervals. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWaitDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait_duration = $var; + + return $this; + } + + /** + * Total duration of the transition, provided for convenience. It is equal + * to: + * * next visit `start_time` (or `vehicle_end_time` if this is the last + * transition) - this transition's `start_time`; + * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + * additionally holds: `total_duration = travel_duration + delay_duration + * + break_duration + wait_duration`. + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + * @return \Google\Protobuf\Duration|null + */ + public function getTotalDuration() + { + return $this->total_duration; + } + + public function hasTotalDuration() + { + return isset($this->total_duration); + } + + public function clearTotalDuration() + { + unset($this->total_duration); + } + + /** + * Total duration of the transition, provided for convenience. It is equal + * to: + * * next visit `start_time` (or `vehicle_end_time` if this is the last + * transition) - this transition's `start_time`; + * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + * additionally holds: `total_duration = travel_duration + delay_duration + * + break_duration + wait_duration`. + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTotalDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->total_duration = $var; + + return $this; + } + + /** + * Start time of this transition. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 8; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start time of this transition. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 8; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The encoded polyline representation of the route followed during the + * transition. + * This field is only populated if [populate_transition_polylines] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * @return \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline|null + */ + public function getRoutePolyline() + { + return $this->route_polyline; + } + + public function hasRoutePolyline() + { + return isset($this->route_polyline); + } + + public function clearRoutePolyline() + { + unset($this->route_polyline); + } + + /** + * The encoded polyline representation of the route followed during the + * transition. + * This field is only populated if [populate_transition_polylines] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * @param \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline $var + * @return $this + */ + public function setRoutePolyline($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline::class); + $this->route_polyline = $var; + + return $this; + } + + /** + * Vehicle loads during this transition, for each type that either appears + * in this vehicle's + * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + * or that have non-zero + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * on some shipment performed on this route. + * The loads during the first transition are the starting loads of the + * vehicle route. Then, after each visit, the visit's `load_demands` are + * either added or subtracted to get the next transition's loads, depending + * on whether the visit was a pickup or a delivery. + * + * Generated from protobuf field map vehicle_loads = 11; + * @return \Google\Protobuf\Internal\MapField + */ + public function getVehicleLoads() + { + return $this->vehicle_loads; + } + + /** + * Vehicle loads during this transition, for each type that either appears + * in this vehicle's + * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + * or that have non-zero + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * on some shipment performed on this route. + * The loads during the first transition are the starting loads of the + * vehicle route. Then, after each visit, the visit's `load_demands` are + * either added or subtracted to get the next transition's loads, depending + * on whether the visit was a pickup or a delivery. + * + * Generated from protobuf field map vehicle_loads = 11; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setVehicleLoads($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\VehicleLoad::class); + $this->vehicle_loads = $arr; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/VehicleLoad.php b/MapsRouteOptimization/src/V1/ShipmentRoute/VehicleLoad.php new file mode 100644 index 000000000000..a01bdaf35f2a --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/VehicleLoad.php @@ -0,0 +1,78 @@ +google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + */ +class VehicleLoad extends \Google\Protobuf\Internal\Message +{ + /** + * The amount of load on the vehicle, for the given type. The unit of load + * is usually indicated by the type. See + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + * + * Generated from protobuf field int64 amount = 1; + */ + protected $amount = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $amount + * The amount of load on the vehicle, for the given type. The unit of load + * is usually indicated by the type. See + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The amount of load on the vehicle, for the given type. The unit of load + * is usually indicated by the type. See + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + * + * Generated from protobuf field int64 amount = 1; + * @return int|string + */ + public function getAmount() + { + return $this->amount; + } + + /** + * The amount of load on the vehicle, for the given type. The unit of load + * is usually indicated by the type. See + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + * + * Generated from protobuf field int64 amount = 1; + * @param int|string $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkInt64($var); + $this->amount = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/Visit.php b/MapsRouteOptimization/src/V1/ShipmentRoute/Visit.php new file mode 100644 index 000000000000..def25c193fb5 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/Visit.php @@ -0,0 +1,431 @@ +google.maps.routeoptimization.v1.ShipmentRoute.Visit + */ +class Visit extends \Google\Protobuf\Internal\Message +{ + /** + * Index of the `shipments` field in the source + * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + * + * Generated from protobuf field int32 shipment_index = 1; + */ + protected $shipment_index = 0; + /** + * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + * corresponds to a delivery. + * + * Generated from protobuf field bool is_pickup = 2; + */ + protected $is_pickup = false; + /** + * Index of `VisitRequest` in either the pickup or delivery field of the + * `Shipment` (see `is_pickup`). + * + * Generated from protobuf field int32 visit_request_index = 3; + */ + protected $visit_request_index = 0; + /** + * Time at which the visit starts. Note that the vehicle may arrive earlier + * than this at the visit location. Times are consistent with the + * `ShipmentModel`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + */ + protected $start_time = null; + /** + * Total visit load demand as the sum of the shipment and the visit request + * `load_demands`. The values are negative if the visit is a delivery. + * Demands are reported for the same types as the + * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + * (see this field). + * + * Generated from protobuf field map load_demands = 11; + */ + private $load_demands; + /** + * Extra detour time due to the shipments visited on the route before the + * visit and to the potential waiting time induced by time windows. + * If the visit is a delivery, the detour is computed from the corresponding + * pickup visit and is equal to: + * ``` + * start_time(delivery) - start_time(pickup) + * - (duration(pickup) + travel duration from the pickup location + * to the delivery location). + * ``` + * Otherwise, it is computed from the vehicle `start_location` and is equal + * to: + * ``` + * start_time - vehicle_start_time - travel duration from + * the vehicle's `start_location` to the visit. + * ``` + * + * Generated from protobuf field .google.protobuf.Duration detour = 6; + */ + protected $detour = null; + /** + * Copy of the corresponding `Shipment.label`, if specified in the + * `Shipment`. + * + * Generated from protobuf field string shipment_label = 7; + */ + protected $shipment_label = ''; + /** + * Copy of the corresponding + * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + * if specified in the `VisitRequest`. + * + * Generated from protobuf field string visit_label = 8; + */ + protected $visit_label = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $shipment_index + * Index of the `shipments` field in the source + * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + * @type bool $is_pickup + * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + * corresponds to a delivery. + * @type int $visit_request_index + * Index of `VisitRequest` in either the pickup or delivery field of the + * `Shipment` (see `is_pickup`). + * @type \Google\Protobuf\Timestamp $start_time + * Time at which the visit starts. Note that the vehicle may arrive earlier + * than this at the visit location. Times are consistent with the + * `ShipmentModel`. + * @type array|\Google\Protobuf\Internal\MapField $load_demands + * Total visit load demand as the sum of the shipment and the visit request + * `load_demands`. The values are negative if the visit is a delivery. + * Demands are reported for the same types as the + * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + * (see this field). + * @type \Google\Protobuf\Duration $detour + * Extra detour time due to the shipments visited on the route before the + * visit and to the potential waiting time induced by time windows. + * If the visit is a delivery, the detour is computed from the corresponding + * pickup visit and is equal to: + * ``` + * start_time(delivery) - start_time(pickup) + * - (duration(pickup) + travel duration from the pickup location + * to the delivery location). + * ``` + * Otherwise, it is computed from the vehicle `start_location` and is equal + * to: + * ``` + * start_time - vehicle_start_time - travel duration from + * the vehicle's `start_location` to the visit. + * ``` + * @type string $shipment_label + * Copy of the corresponding `Shipment.label`, if specified in the + * `Shipment`. + * @type string $visit_label + * Copy of the corresponding + * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + * if specified in the `VisitRequest`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Index of the `shipments` field in the source + * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + * + * Generated from protobuf field int32 shipment_index = 1; + * @return int + */ + public function getShipmentIndex() + { + return $this->shipment_index; + } + + /** + * Index of the `shipments` field in the source + * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + * + * Generated from protobuf field int32 shipment_index = 1; + * @param int $var + * @return $this + */ + public function setShipmentIndex($var) + { + GPBUtil::checkInt32($var); + $this->shipment_index = $var; + + return $this; + } + + /** + * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + * corresponds to a delivery. + * + * Generated from protobuf field bool is_pickup = 2; + * @return bool + */ + public function getIsPickup() + { + return $this->is_pickup; + } + + /** + * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + * corresponds to a delivery. + * + * Generated from protobuf field bool is_pickup = 2; + * @param bool $var + * @return $this + */ + public function setIsPickup($var) + { + GPBUtil::checkBool($var); + $this->is_pickup = $var; + + return $this; + } + + /** + * Index of `VisitRequest` in either the pickup or delivery field of the + * `Shipment` (see `is_pickup`). + * + * Generated from protobuf field int32 visit_request_index = 3; + * @return int + */ + public function getVisitRequestIndex() + { + return $this->visit_request_index; + } + + /** + * Index of `VisitRequest` in either the pickup or delivery field of the + * `Shipment` (see `is_pickup`). + * + * Generated from protobuf field int32 visit_request_index = 3; + * @param int $var + * @return $this + */ + public function setVisitRequestIndex($var) + { + GPBUtil::checkInt32($var); + $this->visit_request_index = $var; + + return $this; + } + + /** + * Time at which the visit starts. Note that the vehicle may arrive earlier + * than this at the visit location. Times are consistent with the + * `ShipmentModel`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time at which the visit starts. Note that the vehicle may arrive earlier + * than this at the visit location. Times are consistent with the + * `ShipmentModel`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Total visit load demand as the sum of the shipment and the visit request + * `load_demands`. The values are negative if the visit is a delivery. + * Demands are reported for the same types as the + * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + * (see this field). + * + * Generated from protobuf field map load_demands = 11; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLoadDemands() + { + return $this->load_demands; + } + + /** + * Total visit load demand as the sum of the shipment and the visit request + * `load_demands`. The values are negative if the visit is a delivery. + * Demands are reported for the same types as the + * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + * (see this field). + * + * Generated from protobuf field map load_demands = 11; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLoadDemands($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\Load::class); + $this->load_demands = $arr; + + return $this; + } + + /** + * Extra detour time due to the shipments visited on the route before the + * visit and to the potential waiting time induced by time windows. + * If the visit is a delivery, the detour is computed from the corresponding + * pickup visit and is equal to: + * ``` + * start_time(delivery) - start_time(pickup) + * - (duration(pickup) + travel duration from the pickup location + * to the delivery location). + * ``` + * Otherwise, it is computed from the vehicle `start_location` and is equal + * to: + * ``` + * start_time - vehicle_start_time - travel duration from + * the vehicle's `start_location` to the visit. + * ``` + * + * Generated from protobuf field .google.protobuf.Duration detour = 6; + * @return \Google\Protobuf\Duration|null + */ + public function getDetour() + { + return $this->detour; + } + + public function hasDetour() + { + return isset($this->detour); + } + + public function clearDetour() + { + unset($this->detour); + } + + /** + * Extra detour time due to the shipments visited on the route before the + * visit and to the potential waiting time induced by time windows. + * If the visit is a delivery, the detour is computed from the corresponding + * pickup visit and is equal to: + * ``` + * start_time(delivery) - start_time(pickup) + * - (duration(pickup) + travel duration from the pickup location + * to the delivery location). + * ``` + * Otherwise, it is computed from the vehicle `start_location` and is equal + * to: + * ``` + * start_time - vehicle_start_time - travel duration from + * the vehicle's `start_location` to the visit. + * ``` + * + * Generated from protobuf field .google.protobuf.Duration detour = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDetour($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->detour = $var; + + return $this; + } + + /** + * Copy of the corresponding `Shipment.label`, if specified in the + * `Shipment`. + * + * Generated from protobuf field string shipment_label = 7; + * @return string + */ + public function getShipmentLabel() + { + return $this->shipment_label; + } + + /** + * Copy of the corresponding `Shipment.label`, if specified in the + * `Shipment`. + * + * Generated from protobuf field string shipment_label = 7; + * @param string $var + * @return $this + */ + public function setShipmentLabel($var) + { + GPBUtil::checkString($var, True); + $this->shipment_label = $var; + + return $this; + } + + /** + * Copy of the corresponding + * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + * if specified in the `VisitRequest`. + * + * Generated from protobuf field string visit_label = 8; + * @return string + */ + public function getVisitLabel() + { + return $this->visit_label; + } + + /** + * Copy of the corresponding + * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + * if specified in the `VisitRequest`. + * + * Generated from protobuf field string visit_label = 8; + * @param string $var + * @return $this + */ + public function setVisitLabel($var) + { + GPBUtil::checkString($var, True); + $this->visit_label = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility.php b/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility.php new file mode 100644 index 000000000000..17d80f6ccd1d --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility.php @@ -0,0 +1,107 @@ +google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + */ +class ShipmentTypeIncompatibility extends \Google\Protobuf\Internal\Message +{ + /** + * List of incompatible types. Two shipments having different `shipment_types` + * among those listed are "incompatible". + * + * Generated from protobuf field repeated string types = 1; + */ + private $types; + /** + * Mode applied to the incompatibility. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + */ + protected $incompatibility_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $types + * List of incompatible types. Two shipments having different `shipment_types` + * among those listed are "incompatible". + * @type int $incompatibility_mode + * Mode applied to the incompatibility. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * List of incompatible types. Two shipments having different `shipment_types` + * among those listed are "incompatible". + * + * Generated from protobuf field repeated string types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTypes() + { + return $this->types; + } + + /** + * List of incompatible types. Two shipments having different `shipment_types` + * among those listed are "incompatible". + * + * Generated from protobuf field repeated string types = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->types = $arr; + + return $this; + } + + /** + * Mode applied to the incompatibility. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * @return int + */ + public function getIncompatibilityMode() + { + return $this->incompatibility_mode; + } + + /** + * Mode applied to the incompatibility. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * @param int $var + * @return $this + */ + public function setIncompatibilityMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\ShipmentTypeIncompatibility\IncompatibilityMode::class); + $this->incompatibility_mode = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility/IncompatibilityMode.php b/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility/IncompatibilityMode.php new file mode 100644 index 000000000000..74baee1082ed --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility/IncompatibilityMode.php @@ -0,0 +1,70 @@ +google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + */ +class IncompatibilityMode +{ + /** + * Unspecified incompatibility mode. This value should never be used. + * + * Generated from protobuf enum INCOMPATIBILITY_MODE_UNSPECIFIED = 0; + */ + const INCOMPATIBILITY_MODE_UNSPECIFIED = 0; + /** + * In this mode, two shipments with incompatible types can never share the + * same vehicle. + * + * Generated from protobuf enum NOT_PERFORMED_BY_SAME_VEHICLE = 1; + */ + const NOT_PERFORMED_BY_SAME_VEHICLE = 1; + /** + * For two shipments with incompatible types with the + * `NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY` incompatibility mode: + * * If both are pickups only (no deliveries) or deliveries only (no + * pickups), they cannot share the same vehicle at all. + * * If one of the shipments has a delivery and the other a pickup, the two + * shipments can share the same vehicle iff the former shipment is + * delivered before the latter is picked up. + * + * Generated from protobuf enum NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2; + */ + const NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2; + + private static $valueToName = [ + self::INCOMPATIBILITY_MODE_UNSPECIFIED => 'INCOMPATIBILITY_MODE_UNSPECIFIED', + self::NOT_PERFORMED_BY_SAME_VEHICLE => 'NOT_PERFORMED_BY_SAME_VEHICLE', + self::NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY => 'NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentTypeRequirement.php b/MapsRouteOptimization/src/V1/ShipmentTypeRequirement.php new file mode 100644 index 000000000000..c7d8d7f847b7 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentTypeRequirement.php @@ -0,0 +1,156 @@ +google.maps.routeoptimization.v1.ShipmentTypeRequirement + */ +class ShipmentTypeRequirement extends \Google\Protobuf\Internal\Message +{ + /** + * List of alternative shipment types required by the + * `dependent_shipment_types`. + * + * Generated from protobuf field repeated string required_shipment_type_alternatives = 1; + */ + private $required_shipment_type_alternatives; + /** + * All shipments with a type in the `dependent_shipment_types` field require + * at least one shipment of type `required_shipment_type_alternatives` to be + * visited on the same route. + * NOTE: Chains of requirements such that a `shipment_type` depends on itself + * are not allowed. + * + * Generated from protobuf field repeated string dependent_shipment_types = 2; + */ + private $dependent_shipment_types; + /** + * Mode applied to the requirement. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + */ + protected $requirement_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $required_shipment_type_alternatives + * List of alternative shipment types required by the + * `dependent_shipment_types`. + * @type array|\Google\Protobuf\Internal\RepeatedField $dependent_shipment_types + * All shipments with a type in the `dependent_shipment_types` field require + * at least one shipment of type `required_shipment_type_alternatives` to be + * visited on the same route. + * NOTE: Chains of requirements such that a `shipment_type` depends on itself + * are not allowed. + * @type int $requirement_mode + * Mode applied to the requirement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * List of alternative shipment types required by the + * `dependent_shipment_types`. + * + * Generated from protobuf field repeated string required_shipment_type_alternatives = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequiredShipmentTypeAlternatives() + { + return $this->required_shipment_type_alternatives; + } + + /** + * List of alternative shipment types required by the + * `dependent_shipment_types`. + * + * Generated from protobuf field repeated string required_shipment_type_alternatives = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequiredShipmentTypeAlternatives($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->required_shipment_type_alternatives = $arr; + + return $this; + } + + /** + * All shipments with a type in the `dependent_shipment_types` field require + * at least one shipment of type `required_shipment_type_alternatives` to be + * visited on the same route. + * NOTE: Chains of requirements such that a `shipment_type` depends on itself + * are not allowed. + * + * Generated from protobuf field repeated string dependent_shipment_types = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDependentShipmentTypes() + { + return $this->dependent_shipment_types; + } + + /** + * All shipments with a type in the `dependent_shipment_types` field require + * at least one shipment of type `required_shipment_type_alternatives` to be + * visited on the same route. + * NOTE: Chains of requirements such that a `shipment_type` depends on itself + * are not allowed. + * + * Generated from protobuf field repeated string dependent_shipment_types = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDependentShipmentTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dependent_shipment_types = $arr; + + return $this; + } + + /** + * Mode applied to the requirement. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * @return int + */ + public function getRequirementMode() + { + return $this->requirement_mode; + } + + /** + * Mode applied to the requirement. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * @param int $var + * @return $this + */ + public function setRequirementMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\ShipmentTypeRequirement\RequirementMode::class); + $this->requirement_mode = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/ShipmentTypeRequirement/RequirementMode.php b/MapsRouteOptimization/src/V1/ShipmentTypeRequirement/RequirementMode.php new file mode 100644 index 000000000000..7aab3666154e --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentTypeRequirement/RequirementMode.php @@ -0,0 +1,78 @@ +google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode + */ +class RequirementMode +{ + /** + * Unspecified requirement mode. This value should never be used. + * + * Generated from protobuf enum REQUIREMENT_MODE_UNSPECIFIED = 0; + */ + const REQUIREMENT_MODE_UNSPECIFIED = 0; + /** + * In this mode, all "dependent" shipments must share the same vehicle as at + * least one of their "required" shipments. + * + * Generated from protobuf enum PERFORMED_BY_SAME_VEHICLE = 1; + */ + const PERFORMED_BY_SAME_VEHICLE = 1; + /** + * With the `IN_SAME_VEHICLE_AT_PICKUP_TIME` mode, all "dependent" + * shipments need to have at least one "required" shipment on their vehicle + * at the time of their pickup. + * A "dependent" shipment pickup must therefore have either: + * * A delivery-only "required" shipment delivered on the route after, or + * * A "required" shipment picked up on the route before it, and if the + * "required" shipment has a delivery, this delivery must be performed + * after the "dependent" shipment's pickup. + * + * Generated from protobuf enum IN_SAME_VEHICLE_AT_PICKUP_TIME = 2; + */ + const IN_SAME_VEHICLE_AT_PICKUP_TIME = 2; + /** + * Same as before, except the "dependent" shipments need to have a + * "required" shipment on their vehicle at the time of their *delivery*. + * + * Generated from protobuf enum IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3; + */ + const IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3; + + private static $valueToName = [ + self::REQUIREMENT_MODE_UNSPECIFIED => 'REQUIREMENT_MODE_UNSPECIFIED', + self::PERFORMED_BY_SAME_VEHICLE => 'PERFORMED_BY_SAME_VEHICLE', + self::IN_SAME_VEHICLE_AT_PICKUP_TIME => 'IN_SAME_VEHICLE_AT_PICKUP_TIME', + self::IN_SAME_VEHICLE_AT_DELIVERY_TIME => 'IN_SAME_VEHICLE_AT_DELIVERY_TIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/SkippedShipment.php b/MapsRouteOptimization/src/V1/SkippedShipment.php new file mode 100644 index 000000000000..5a036dbd56e2 --- /dev/null +++ b/MapsRouteOptimization/src/V1/SkippedShipment.php @@ -0,0 +1,153 @@ +google.maps.routeoptimization.v1.SkippedShipment + */ +class SkippedShipment extends \Google\Protobuf\Internal\Message +{ + /** + * The index corresponds to the index of the shipment in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 index = 1; + */ + protected $index = 0; + /** + * Copy of the corresponding + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + * specified in the `Shipment`. + * + * Generated from protobuf field string label = 2; + */ + protected $label = ''; + /** + * A list of reasons that explain why the shipment was skipped. See comment + * above `Reason`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + private $reasons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $index + * The index corresponds to the index of the shipment in the source + * `ShipmentModel`. + * @type string $label + * Copy of the corresponding + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + * specified in the `Shipment`. + * @type array<\Google\Maps\RouteOptimization\V1\SkippedShipment\Reason>|\Google\Protobuf\Internal\RepeatedField $reasons + * A list of reasons that explain why the shipment was skipped. See comment + * above `Reason`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The index corresponds to the index of the shipment in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 index = 1; + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * The index corresponds to the index of the shipment in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 index = 1; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * Copy of the corresponding + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + * specified in the `Shipment`. + * + * Generated from protobuf field string label = 2; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Copy of the corresponding + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + * specified in the `Shipment`. + * + * Generated from protobuf field string label = 2; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * A list of reasons that explain why the shipment was skipped. See comment + * above `Reason`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReasons() + { + return $this->reasons; + } + + /** + * A list of reasons that explain why the shipment was skipped. See comment + * above `Reason`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + * @param array<\Google\Maps\RouteOptimization\V1\SkippedShipment\Reason>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReasons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\SkippedShipment\Reason::class); + $this->reasons = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/SkippedShipment/Reason.php b/MapsRouteOptimization/src/V1/SkippedShipment/Reason.php new file mode 100644 index 000000000000..44b3a0d70662 --- /dev/null +++ b/MapsRouteOptimization/src/V1/SkippedShipment/Reason.php @@ -0,0 +1,179 @@ +google.maps.routeoptimization.v1.SkippedShipment.Reason + */ +class Reason extends \Google\Protobuf\Internal\Message +{ + /** + * Refer to the comments of Code. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + */ + protected $code = 0; + /** + * If the reason is related to a shipment-vehicle incompatibility, this + * field provides the index of one relevant vehicle. + * + * Generated from protobuf field optional int32 example_vehicle_index = 2; + */ + protected $example_vehicle_index = null; + /** + * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + * capacity type that is exceeded. + * + * Generated from protobuf field string example_exceeded_capacity_type = 3; + */ + protected $example_exceeded_capacity_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * Refer to the comments of Code. + * @type int $example_vehicle_index + * If the reason is related to a shipment-vehicle incompatibility, this + * field provides the index of one relevant vehicle. + * @type string $example_exceeded_capacity_type + * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + * capacity type that is exceeded. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Refer to the comments of Code. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Refer to the comments of Code. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\SkippedShipment\Reason\Code::class); + $this->code = $var; + + return $this; + } + + /** + * If the reason is related to a shipment-vehicle incompatibility, this + * field provides the index of one relevant vehicle. + * + * Generated from protobuf field optional int32 example_vehicle_index = 2; + * @return int + */ + public function getExampleVehicleIndex() + { + return isset($this->example_vehicle_index) ? $this->example_vehicle_index : 0; + } + + public function hasExampleVehicleIndex() + { + return isset($this->example_vehicle_index); + } + + public function clearExampleVehicleIndex() + { + unset($this->example_vehicle_index); + } + + /** + * If the reason is related to a shipment-vehicle incompatibility, this + * field provides the index of one relevant vehicle. + * + * Generated from protobuf field optional int32 example_vehicle_index = 2; + * @param int $var + * @return $this + */ + public function setExampleVehicleIndex($var) + { + GPBUtil::checkInt32($var); + $this->example_vehicle_index = $var; + + return $this; + } + + /** + * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + * capacity type that is exceeded. + * + * Generated from protobuf field string example_exceeded_capacity_type = 3; + * @return string + */ + public function getExampleExceededCapacityType() + { + return $this->example_exceeded_capacity_type; + } + + /** + * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + * capacity type that is exceeded. + * + * Generated from protobuf field string example_exceeded_capacity_type = 3; + * @param string $var + * @return $this + */ + public function setExampleExceededCapacityType($var) + { + GPBUtil::checkString($var, True); + $this->example_exceeded_capacity_type = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/SkippedShipment/Reason/Code.php b/MapsRouteOptimization/src/V1/SkippedShipment/Reason/Code.php new file mode 100644 index 000000000000..de17aa0f87c3 --- /dev/null +++ b/MapsRouteOptimization/src/V1/SkippedShipment/Reason/Code.php @@ -0,0 +1,114 @@ +google.maps.routeoptimization.v1.SkippedShipment.Reason.Code + */ +class Code +{ + /** + * This should never be used. If we are unable to understand why a + * shipment was skipped, we simply return an empty set of reasons. + * + * Generated from protobuf enum CODE_UNSPECIFIED = 0; + */ + const CODE_UNSPECIFIED = 0; + /** + * There is no vehicle in the model making all shipments infeasible. + * + * Generated from protobuf enum NO_VEHICLE = 1; + */ + const NO_VEHICLE = 1; + /** + * The demand of the shipment exceeds a vehicle's capacity for some + * capacity types, one of which is `example_exceeded_capacity_type`. + * + * Generated from protobuf enum DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2; + */ + const DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2; + /** + * The minimum distance necessary to perform this shipment, i.e. from + * the vehicle's `start_location` to the shipment's pickup and/or delivery + * locations and to the vehicle's end location exceeds the vehicle's + * `route_distance_limit`. + * Note that for this computation we use the geodesic distances. + * + * Generated from protobuf enum CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3; + */ + const CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3; + /** + * The minimum time necessary to perform this shipment, including travel + * time, wait time and service time exceeds the vehicle's + * `route_duration_limit`. + * Note: travel time is computed in the best-case scenario, namely as + * geodesic distance x 36 m/s (roughly 130 km/hour). + * + * Generated from protobuf enum CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4; + */ + const CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4; + /** + * Same as above but we only compare minimum travel time and the + * vehicle's `travel_duration_limit`. + * + * Generated from protobuf enum CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5; + */ + const CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5; + /** + * The vehicle cannot perform this shipment in the best-case scenario + * (see `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT` for time + * computation) if it starts at its earliest start time: the total time + * would make the vehicle end after its latest end time. + * + * Generated from protobuf enum CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6; + */ + const CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6; + /** + * The `allowed_vehicle_indices` field of the shipment is not empty and + * this vehicle does not belong to it. + * + * Generated from protobuf enum VEHICLE_NOT_ALLOWED = 7; + */ + const VEHICLE_NOT_ALLOWED = 7; + + private static $valueToName = [ + self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', + self::NO_VEHICLE => 'NO_VEHICLE', + self::DEMAND_EXCEEDS_VEHICLE_CAPACITY => 'DEMAND_EXCEEDS_VEHICLE_CAPACITY', + self::CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT => 'CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT', + self::CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT => 'CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT', + self::CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT => 'CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT', + self::CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS => 'CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS', + self::VEHICLE_NOT_ALLOWED => 'VEHICLE_NOT_ALLOWED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/TimeWindow.php b/MapsRouteOptimization/src/V1/TimeWindow.php new file mode 100644 index 000000000000..84c170884b1c --- /dev/null +++ b/MapsRouteOptimization/src/V1/TimeWindow.php @@ -0,0 +1,388 @@ +google.maps.routeoptimization.v1.TimeWindow + */ +class TimeWindow extends \Google\Protobuf\Internal\Message +{ + /** + * The hard time window start time. If unspecified it will be set to + * `ShipmentModel.global_start_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The hard time window end time. If unspecified it will be set to + * `ShipmentModel.global_end_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The soft start time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_start_time = 3; + */ + protected $soft_start_time = null; + /** + * The soft end time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_end_time = 4; + */ + protected $soft_end_time = null; + /** + * A cost per hour added to other costs in the model if the event occurs + * before soft_start_time, computed as: + * ``` + * max(0, soft_start_time - t.seconds) + * * cost_per_hour_before_soft_start_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * soft_start_time has been set. + * + * Generated from protobuf field optional double cost_per_hour_before_soft_start_time = 5; + */ + protected $cost_per_hour_before_soft_start_time = null; + /** + * A cost per hour added to other costs in the model if the event occurs after + * `soft_end_time`, computed as: + * ``` + * max(0, t.seconds - soft_end_time.seconds) + * * cost_per_hour_after_soft_end_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * `soft_end_time` has been set. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_end_time = 6; + */ + protected $cost_per_hour_after_soft_end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The hard time window start time. If unspecified it will be set to + * `ShipmentModel.global_start_time`. + * @type \Google\Protobuf\Timestamp $end_time + * The hard time window end time. If unspecified it will be set to + * `ShipmentModel.global_end_time`. + * @type \Google\Protobuf\Timestamp $soft_start_time + * The soft start time of the time window. + * @type \Google\Protobuf\Timestamp $soft_end_time + * The soft end time of the time window. + * @type float $cost_per_hour_before_soft_start_time + * A cost per hour added to other costs in the model if the event occurs + * before soft_start_time, computed as: + * ``` + * max(0, soft_start_time - t.seconds) + * * cost_per_hour_before_soft_start_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * soft_start_time has been set. + * @type float $cost_per_hour_after_soft_end_time + * A cost per hour added to other costs in the model if the event occurs after + * `soft_end_time`, computed as: + * ``` + * max(0, t.seconds - soft_end_time.seconds) + * * cost_per_hour_after_soft_end_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * `soft_end_time` has been set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The hard time window start time. If unspecified it will be set to + * `ShipmentModel.global_start_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The hard time window start time. If unspecified it will be set to + * `ShipmentModel.global_start_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The hard time window end time. If unspecified it will be set to + * `ShipmentModel.global_end_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The hard time window end time. If unspecified it will be set to + * `ShipmentModel.global_end_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The soft start time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_start_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSoftStartTime() + { + return $this->soft_start_time; + } + + public function hasSoftStartTime() + { + return isset($this->soft_start_time); + } + + public function clearSoftStartTime() + { + unset($this->soft_start_time); + } + + /** + * The soft start time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_start_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSoftStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->soft_start_time = $var; + + return $this; + } + + /** + * The soft end time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_end_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSoftEndTime() + { + return $this->soft_end_time; + } + + public function hasSoftEndTime() + { + return isset($this->soft_end_time); + } + + public function clearSoftEndTime() + { + unset($this->soft_end_time); + } + + /** + * The soft end time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_end_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSoftEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->soft_end_time = $var; + + return $this; + } + + /** + * A cost per hour added to other costs in the model if the event occurs + * before soft_start_time, computed as: + * ``` + * max(0, soft_start_time - t.seconds) + * * cost_per_hour_before_soft_start_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * soft_start_time has been set. + * + * Generated from protobuf field optional double cost_per_hour_before_soft_start_time = 5; + * @return float + */ + public function getCostPerHourBeforeSoftStartTime() + { + return isset($this->cost_per_hour_before_soft_start_time) ? $this->cost_per_hour_before_soft_start_time : 0.0; + } + + public function hasCostPerHourBeforeSoftStartTime() + { + return isset($this->cost_per_hour_before_soft_start_time); + } + + public function clearCostPerHourBeforeSoftStartTime() + { + unset($this->cost_per_hour_before_soft_start_time); + } + + /** + * A cost per hour added to other costs in the model if the event occurs + * before soft_start_time, computed as: + * ``` + * max(0, soft_start_time - t.seconds) + * * cost_per_hour_before_soft_start_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * soft_start_time has been set. + * + * Generated from protobuf field optional double cost_per_hour_before_soft_start_time = 5; + * @param float $var + * @return $this + */ + public function setCostPerHourBeforeSoftStartTime($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_hour_before_soft_start_time = $var; + + return $this; + } + + /** + * A cost per hour added to other costs in the model if the event occurs after + * `soft_end_time`, computed as: + * ``` + * max(0, t.seconds - soft_end_time.seconds) + * * cost_per_hour_after_soft_end_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * `soft_end_time` has been set. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_end_time = 6; + * @return float + */ + public function getCostPerHourAfterSoftEndTime() + { + return isset($this->cost_per_hour_after_soft_end_time) ? $this->cost_per_hour_after_soft_end_time : 0.0; + } + + public function hasCostPerHourAfterSoftEndTime() + { + return isset($this->cost_per_hour_after_soft_end_time); + } + + public function clearCostPerHourAfterSoftEndTime() + { + unset($this->cost_per_hour_after_soft_end_time); + } + + /** + * A cost per hour added to other costs in the model if the event occurs after + * `soft_end_time`, computed as: + * ``` + * max(0, t.seconds - soft_end_time.seconds) + * * cost_per_hour_after_soft_end_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * `soft_end_time` has been set. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_end_time = 6; + * @param float $var + * @return $this + */ + public function setCostPerHourAfterSoftEndTime($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_hour_after_soft_end_time = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/TransitionAttributes.php b/MapsRouteOptimization/src/V1/TransitionAttributes.php new file mode 100644 index 000000000000..6201a4c661d7 --- /dev/null +++ b/MapsRouteOptimization/src/V1/TransitionAttributes.php @@ -0,0 +1,412 @@ +google.maps.routeoptimization.v1.TransitionAttributes + */ +class TransitionAttributes extends \Google\Protobuf\Internal\Message +{ + /** + * Tags defining the set of (src->dst) transitions these attributes apply to. + * A source visit or vehicle start matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + * either contains `src_tag` or does not contain `excluded_src_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string src_tag = 1; + */ + protected $src_tag = ''; + /** + * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_src_tag = 2; + */ + protected $excluded_src_tag = ''; + /** + * A destination visit or vehicle end matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string dst_tag = 3; + */ + protected $dst_tag = ''; + /** + * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_dst_tag = 4; + */ + protected $excluded_dst_tag = ''; + /** + * Specifies a cost for performing this transition. This is in the same unit + * as all other costs in the model and must not be negative. It is applied on + * top of all other existing costs. + * + * Generated from protobuf field double cost = 5; + */ + protected $cost = 0.0; + /** + * Specifies a cost per kilometer applied to the distance traveled while + * performing this transition. It adds up to any + * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + * specified on vehicles. + * + * Generated from protobuf field double cost_per_kilometer = 6; + */ + protected $cost_per_kilometer = 0.0; + /** + * Specifies a limit on the distance traveled while performing this + * transition. + * As of 2021/06, only soft limits are supported. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + protected $distance_limit = null; + /** + * Specifies a delay incurred when performing this transition. + * This delay always occurs *after* finishing the source visit and *before* + * starting the destination visit. + * + * Generated from protobuf field .google.protobuf.Duration delay = 8; + */ + protected $delay = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $src_tag + * Tags defining the set of (src->dst) transitions these attributes apply to. + * A source visit or vehicle start matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + * either contains `src_tag` or does not contain `excluded_src_tag` (depending + * on which of these two fields is non-empty). + * @type string $excluded_src_tag + * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + * non-empty. + * @type string $dst_tag + * A destination visit or vehicle end matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + * on which of these two fields is non-empty). + * @type string $excluded_dst_tag + * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + * non-empty. + * @type float $cost + * Specifies a cost for performing this transition. This is in the same unit + * as all other costs in the model and must not be negative. It is applied on + * top of all other existing costs. + * @type float $cost_per_kilometer + * Specifies a cost per kilometer applied to the distance traveled while + * performing this transition. It adds up to any + * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + * specified on vehicles. + * @type \Google\Maps\RouteOptimization\V1\DistanceLimit $distance_limit + * Specifies a limit on the distance traveled while performing this + * transition. + * As of 2021/06, only soft limits are supported. + * @type \Google\Protobuf\Duration $delay + * Specifies a delay incurred when performing this transition. + * This delay always occurs *after* finishing the source visit and *before* + * starting the destination visit. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Tags defining the set of (src->dst) transitions these attributes apply to. + * A source visit or vehicle start matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + * either contains `src_tag` or does not contain `excluded_src_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string src_tag = 1; + * @return string + */ + public function getSrcTag() + { + return $this->src_tag; + } + + /** + * Tags defining the set of (src->dst) transitions these attributes apply to. + * A source visit or vehicle start matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + * either contains `src_tag` or does not contain `excluded_src_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string src_tag = 1; + * @param string $var + * @return $this + */ + public function setSrcTag($var) + { + GPBUtil::checkString($var, True); + $this->src_tag = $var; + + return $this; + } + + /** + * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_src_tag = 2; + * @return string + */ + public function getExcludedSrcTag() + { + return $this->excluded_src_tag; + } + + /** + * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_src_tag = 2; + * @param string $var + * @return $this + */ + public function setExcludedSrcTag($var) + { + GPBUtil::checkString($var, True); + $this->excluded_src_tag = $var; + + return $this; + } + + /** + * A destination visit or vehicle end matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string dst_tag = 3; + * @return string + */ + public function getDstTag() + { + return $this->dst_tag; + } + + /** + * A destination visit or vehicle end matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string dst_tag = 3; + * @param string $var + * @return $this + */ + public function setDstTag($var) + { + GPBUtil::checkString($var, True); + $this->dst_tag = $var; + + return $this; + } + + /** + * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_dst_tag = 4; + * @return string + */ + public function getExcludedDstTag() + { + return $this->excluded_dst_tag; + } + + /** + * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_dst_tag = 4; + * @param string $var + * @return $this + */ + public function setExcludedDstTag($var) + { + GPBUtil::checkString($var, True); + $this->excluded_dst_tag = $var; + + return $this; + } + + /** + * Specifies a cost for performing this transition. This is in the same unit + * as all other costs in the model and must not be negative. It is applied on + * top of all other existing costs. + * + * Generated from protobuf field double cost = 5; + * @return float + */ + public function getCost() + { + return $this->cost; + } + + /** + * Specifies a cost for performing this transition. This is in the same unit + * as all other costs in the model and must not be negative. It is applied on + * top of all other existing costs. + * + * Generated from protobuf field double cost = 5; + * @param float $var + * @return $this + */ + public function setCost($var) + { + GPBUtil::checkDouble($var); + $this->cost = $var; + + return $this; + } + + /** + * Specifies a cost per kilometer applied to the distance traveled while + * performing this transition. It adds up to any + * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + * specified on vehicles. + * + * Generated from protobuf field double cost_per_kilometer = 6; + * @return float + */ + public function getCostPerKilometer() + { + return $this->cost_per_kilometer; + } + + /** + * Specifies a cost per kilometer applied to the distance traveled while + * performing this transition. It adds up to any + * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + * specified on vehicles. + * + * Generated from protobuf field double cost_per_kilometer = 6; + * @param float $var + * @return $this + */ + public function setCostPerKilometer($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_kilometer = $var; + + return $this; + } + + /** + * Specifies a limit on the distance traveled while performing this + * transition. + * As of 2021/06, only soft limits are supported. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * @return \Google\Maps\RouteOptimization\V1\DistanceLimit|null + */ + public function getDistanceLimit() + { + return $this->distance_limit; + } + + public function hasDistanceLimit() + { + return isset($this->distance_limit); + } + + public function clearDistanceLimit() + { + unset($this->distance_limit); + } + + /** + * Specifies a limit on the distance traveled while performing this + * transition. + * As of 2021/06, only soft limits are supported. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * @param \Google\Maps\RouteOptimization\V1\DistanceLimit $var + * @return $this + */ + public function setDistanceLimit($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\DistanceLimit::class); + $this->distance_limit = $var; + + return $this; + } + + /** + * Specifies a delay incurred when performing this transition. + * This delay always occurs *after* finishing the source visit and *before* + * starting the destination visit. + * + * Generated from protobuf field .google.protobuf.Duration delay = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getDelay() + { + return $this->delay; + } + + public function hasDelay() + { + return isset($this->delay); + } + + public function clearDelay() + { + unset($this->delay); + } + + /** + * Specifies a delay incurred when performing this transition. + * This delay always occurs *after* finishing the source visit and *before* + * starting the destination visit. + * + * Generated from protobuf field .google.protobuf.Duration delay = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDelay($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->delay = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/Vehicle.php b/MapsRouteOptimization/src/V1/Vehicle.php new file mode 100644 index 000000000000..03fa94cd8170 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle.php @@ -0,0 +1,1375 @@ +google.maps.routeoptimization.v1.Vehicle + */ +class Vehicle extends \Google\Protobuf\Internal\Message +{ + /** + * The user-defined display name of the vehicle. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 32; + */ + protected $display_name = ''; + /** + * The travel mode which affects the roads usable by the vehicle and its + * speed. See also `travel_duration_multiple`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + */ + protected $travel_mode = 0; + /** + * Geographic location where the vehicle starts before picking up any + * shipments. If not specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng start_location = 3; + */ + protected $start_location = null; + /** + * Waypoint representing a geographic location where the vehicle starts before + * picking up any shipments. If neither `start_waypoint` nor `start_location` + * is specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + protected $start_waypoint = null; + /** + * Geographic location where the vehicle ends after it has completed its last + * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + * immediately when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng end_location = 5; + */ + protected $end_location = null; + /** + * Waypoint representing a geographic location where the vehicle ends after + * it has completed its last `VisitRequest`. If neither `end_waypoint` nor + * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + * when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + protected $end_waypoint = null; + /** + * Specifies tags attached to the start of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string start_tags = 7; + */ + private $start_tags; + /** + * Specifies tags attached to the end of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string end_tags = 8; + */ + private $end_tags; + /** + * Time windows during which the vehicle may depart its start location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + private $start_time_windows; + /** + * Time windows during which the vehicle may arrive at its end location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + private $end_time_windows; + /** + * Specifies a multiplicative factor that can be used to increase or decrease + * travel times of this vehicle. For example, setting this to 2.0 means + * that this vehicle is slower and has travel times that are twice what they + * are for standard vehicles. This multiple does not affect visit durations. + * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + * is standard, and this multiple is considered 1.0. + * WARNING: Travel times will be rounded to the nearest second after this + * multiple is applied but before performing any numerical operations, thus, + * a small multiple may result in a loss of precision. + * See also `extra_visit_duration_for_visit_type` below. + * + * Generated from protobuf field optional double travel_duration_multiple = 11; + */ + protected $travel_duration_multiple = null; + /** + * Unloading policy enforced on the vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + */ + protected $unloading_policy = 0; + /** + * Capacities of the vehicle (weight, volume, # of pallets for example). + * The keys in the map are the identifiers of the type of load, consistent + * with the keys of the + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field. If a given key is absent from this map, the corresponding capacity + * is considered to be limitless. + * + * Generated from protobuf field map load_limits = 30; + */ + private $load_limits; + /** + * Vehicle costs: all costs add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * Cost per hour of the vehicle route. This cost is applied to the total time + * taken by the route, and includes travel time, waiting time, and visit time. + * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + * in additional latency. + * + * Generated from protobuf field double cost_per_hour = 16; + */ + protected $cost_per_hour = 0.0; + /** + * Cost per traveled hour of the vehicle route. This cost is applied only to + * travel time taken by the route (i.e., that reported in + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + * and excludes waiting time and visit time. + * + * Generated from protobuf field double cost_per_traveled_hour = 17; + */ + protected $cost_per_traveled_hour = 0.0; + /** + * Cost per kilometer of the vehicle route. This cost is applied to the + * distance reported in the + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * and does not apply to any distance implicitly traveled from the + * `arrival_location` to the `departure_location` of a single `VisitRequest`. + * + * Generated from protobuf field double cost_per_kilometer = 18; + */ + protected $cost_per_kilometer = 0.0; + /** + * Fixed cost applied if this vehicle is used to handle a shipment. + * + * Generated from protobuf field double fixed_cost = 19; + */ + protected $fixed_cost = 0.0; + /** + * This field only applies to vehicles when their route does not serve any + * shipments. It indicates if the vehicle should be considered as used or not + * in this case. + * If true, the vehicle goes from its start to its end location even if it + * doesn't serve any shipments, and time and distance costs resulting from its + * start --> end travel are taken into account. + * Otherwise, it doesn't travel from its start to its end location, and no + * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + * information except for the vehicle index and label. + * + * Generated from protobuf field bool used_if_route_is_empty = 20; + */ + protected $used_if_route_is_empty = false; + /** + * Limit applied to the total duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route duration of a vehicle is the + * difference between its `vehicle_end_time` and `vehicle_start_time`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + */ + protected $route_duration_limit = null; + /** + * Limit applied to the travel duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route travel duration is the sum of all its + * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + */ + protected $travel_duration_limit = null; + /** + * Limit applied to the total distance of the vehicle's route. In a given + * `OptimizeToursResponse`, the route distance is the sum of all its + * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + protected $route_distance_limit = null; + /** + * Specifies a map from visit_types strings to durations. The duration is time + * in addition to + * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + * to be taken at visits with the specified `visit_types`. This extra visit + * duration adds cost if `cost_per_hour` is specified. Keys (i.e. + * `visit_types`) cannot be empty strings. + * If a visit request has multiple types, a duration will be added for each + * type in the map. + * + * Generated from protobuf field map extra_visit_duration_for_visit_type = 24; + */ + private $extra_visit_duration_for_visit_type; + /** + * Describes the break schedule to be enforced on this vehicle. + * If empty, no breaks will be scheduled for this vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + protected $break_rule = null; + /** + * Specifies a label for this vehicle. This label is reported in the response + * as the `vehicle_label` of the corresponding + * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + * + * Generated from protobuf field string label = 27; + */ + protected $label = ''; + /** + * If true, `used_if_route_is_empty` must be false, and this vehicle will + * remain unused. + * If a shipment is performed by an ignored vehicle in + * `injected_first_solution_routes`, it is skipped in the first solution but + * is free to be performed in the response. + * If a shipment is performed by an ignored vehicle in + * `injected_solution_constraint` and any related pickup/delivery is + * constrained to remain on the vehicle (i.e., not relaxed to level + * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + * If a shipment has a non-empty `allowed_vehicle_indices` field and all of + * the allowed vehicles are ignored, it is skipped in the response. + * + * Generated from protobuf field bool ignore = 28; + */ + protected $ignore = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The user-defined display name of the vehicle. + * It can be up to 63 characters long and may use UTF-8 characters. + * @type int $travel_mode + * The travel mode which affects the roads usable by the vehicle and its + * speed. See also `travel_duration_multiple`. + * @type \Google\Type\LatLng $start_location + * Geographic location where the vehicle starts before picking up any + * shipments. If not specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_location` + * must not be specified. + * @type \Google\Maps\RouteOptimization\V1\Waypoint $start_waypoint + * Waypoint representing a geographic location where the vehicle starts before + * picking up any shipments. If neither `start_waypoint` nor `start_location` + * is specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_waypoint` + * must not be specified. + * @type \Google\Type\LatLng $end_location + * Geographic location where the vehicle ends after it has completed its last + * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + * immediately when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_location` + * must not be specified. + * @type \Google\Maps\RouteOptimization\V1\Waypoint $end_waypoint + * Waypoint representing a geographic location where the vehicle ends after + * it has completed its last `VisitRequest`. If neither `end_waypoint` nor + * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + * when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_waypoint` + * must not be specified. + * @type array|\Google\Protobuf\Internal\RepeatedField $start_tags + * Specifies tags attached to the start of the vehicle's route. + * Empty or duplicate strings are not allowed. + * @type array|\Google\Protobuf\Internal\RepeatedField $end_tags + * Specifies tags attached to the end of the vehicle's route. + * Empty or duplicate strings are not allowed. + * @type array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $start_time_windows + * Time windows during which the vehicle may depart its start location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * @type array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $end_time_windows + * Time windows during which the vehicle may arrive at its end location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * @type float $travel_duration_multiple + * Specifies a multiplicative factor that can be used to increase or decrease + * travel times of this vehicle. For example, setting this to 2.0 means + * that this vehicle is slower and has travel times that are twice what they + * are for standard vehicles. This multiple does not affect visit durations. + * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + * is standard, and this multiple is considered 1.0. + * WARNING: Travel times will be rounded to the nearest second after this + * multiple is applied but before performing any numerical operations, thus, + * a small multiple may result in a loss of precision. + * See also `extra_visit_duration_for_visit_type` below. + * @type int $unloading_policy + * Unloading policy enforced on the vehicle. + * @type array|\Google\Protobuf\Internal\MapField $load_limits + * Capacities of the vehicle (weight, volume, # of pallets for example). + * The keys in the map are the identifiers of the type of load, consistent + * with the keys of the + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field. If a given key is absent from this map, the corresponding capacity + * is considered to be limitless. + * @type float $cost_per_hour + * Vehicle costs: all costs add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * Cost per hour of the vehicle route. This cost is applied to the total time + * taken by the route, and includes travel time, waiting time, and visit time. + * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + * in additional latency. + * @type float $cost_per_traveled_hour + * Cost per traveled hour of the vehicle route. This cost is applied only to + * travel time taken by the route (i.e., that reported in + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + * and excludes waiting time and visit time. + * @type float $cost_per_kilometer + * Cost per kilometer of the vehicle route. This cost is applied to the + * distance reported in the + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * and does not apply to any distance implicitly traveled from the + * `arrival_location` to the `departure_location` of a single `VisitRequest`. + * @type float $fixed_cost + * Fixed cost applied if this vehicle is used to handle a shipment. + * @type bool $used_if_route_is_empty + * This field only applies to vehicles when their route does not serve any + * shipments. It indicates if the vehicle should be considered as used or not + * in this case. + * If true, the vehicle goes from its start to its end location even if it + * doesn't serve any shipments, and time and distance costs resulting from its + * start --> end travel are taken into account. + * Otherwise, it doesn't travel from its start to its end location, and no + * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + * information except for the vehicle index and label. + * @type \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit $route_duration_limit + * Limit applied to the total duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route duration of a vehicle is the + * difference between its `vehicle_end_time` and `vehicle_start_time`. + * @type \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit $travel_duration_limit + * Limit applied to the travel duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route travel duration is the sum of all its + * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + * @type \Google\Maps\RouteOptimization\V1\DistanceLimit $route_distance_limit + * Limit applied to the total distance of the vehicle's route. In a given + * `OptimizeToursResponse`, the route distance is the sum of all its + * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + * @type array|\Google\Protobuf\Internal\MapField $extra_visit_duration_for_visit_type + * Specifies a map from visit_types strings to durations. The duration is time + * in addition to + * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + * to be taken at visits with the specified `visit_types`. This extra visit + * duration adds cost if `cost_per_hour` is specified. Keys (i.e. + * `visit_types`) cannot be empty strings. + * If a visit request has multiple types, a duration will be added for each + * type in the map. + * @type \Google\Maps\RouteOptimization\V1\BreakRule $break_rule + * Describes the break schedule to be enforced on this vehicle. + * If empty, no breaks will be scheduled for this vehicle. + * @type string $label + * Specifies a label for this vehicle. This label is reported in the response + * as the `vehicle_label` of the corresponding + * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + * @type bool $ignore + * If true, `used_if_route_is_empty` must be false, and this vehicle will + * remain unused. + * If a shipment is performed by an ignored vehicle in + * `injected_first_solution_routes`, it is skipped in the first solution but + * is free to be performed in the response. + * If a shipment is performed by an ignored vehicle in + * `injected_solution_constraint` and any related pickup/delivery is + * constrained to remain on the vehicle (i.e., not relaxed to level + * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + * If a shipment has a non-empty `allowed_vehicle_indices` field and all of + * the allowed vehicles are ignored, it is skipped in the response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The user-defined display name of the vehicle. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 32; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The user-defined display name of the vehicle. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 32; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The travel mode which affects the roads usable by the vehicle and its + * speed. See also `travel_duration_multiple`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * @return int + */ + public function getTravelMode() + { + return $this->travel_mode; + } + + /** + * The travel mode which affects the roads usable by the vehicle and its + * speed. See also `travel_duration_multiple`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * @param int $var + * @return $this + */ + public function setTravelMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\Vehicle\TravelMode::class); + $this->travel_mode = $var; + + return $this; + } + + /** + * Geographic location where the vehicle starts before picking up any + * shipments. If not specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng start_location = 3; + * @return \Google\Type\LatLng|null + */ + public function getStartLocation() + { + return $this->start_location; + } + + public function hasStartLocation() + { + return isset($this->start_location); + } + + public function clearStartLocation() + { + unset($this->start_location); + } + + /** + * Geographic location where the vehicle starts before picking up any + * shipments. If not specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng start_location = 3; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setStartLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->start_location = $var; + + return $this; + } + + /** + * Waypoint representing a geographic location where the vehicle starts before + * picking up any shipments. If neither `start_waypoint` nor `start_location` + * is specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * @return \Google\Maps\RouteOptimization\V1\Waypoint|null + */ + public function getStartWaypoint() + { + return $this->start_waypoint; + } + + public function hasStartWaypoint() + { + return isset($this->start_waypoint); + } + + public function clearStartWaypoint() + { + unset($this->start_waypoint); + } + + /** + * Waypoint representing a geographic location where the vehicle starts before + * picking up any shipments. If neither `start_waypoint` nor `start_location` + * is specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * @param \Google\Maps\RouteOptimization\V1\Waypoint $var + * @return $this + */ + public function setStartWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Waypoint::class); + $this->start_waypoint = $var; + + return $this; + } + + /** + * Geographic location where the vehicle ends after it has completed its last + * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + * immediately when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng end_location = 5; + * @return \Google\Type\LatLng|null + */ + public function getEndLocation() + { + return $this->end_location; + } + + public function hasEndLocation() + { + return isset($this->end_location); + } + + public function clearEndLocation() + { + unset($this->end_location); + } + + /** + * Geographic location where the vehicle ends after it has completed its last + * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + * immediately when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng end_location = 5; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setEndLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->end_location = $var; + + return $this; + } + + /** + * Waypoint representing a geographic location where the vehicle ends after + * it has completed its last `VisitRequest`. If neither `end_waypoint` nor + * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + * when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * @return \Google\Maps\RouteOptimization\V1\Waypoint|null + */ + public function getEndWaypoint() + { + return $this->end_waypoint; + } + + public function hasEndWaypoint() + { + return isset($this->end_waypoint); + } + + public function clearEndWaypoint() + { + unset($this->end_waypoint); + } + + /** + * Waypoint representing a geographic location where the vehicle ends after + * it has completed its last `VisitRequest`. If neither `end_waypoint` nor + * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + * when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * @param \Google\Maps\RouteOptimization\V1\Waypoint $var + * @return $this + */ + public function setEndWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Waypoint::class); + $this->end_waypoint = $var; + + return $this; + } + + /** + * Specifies tags attached to the start of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string start_tags = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStartTags() + { + return $this->start_tags; + } + + /** + * Specifies tags attached to the start of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string start_tags = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStartTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->start_tags = $arr; + + return $this; + } + + /** + * Specifies tags attached to the end of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string end_tags = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndTags() + { + return $this->end_tags; + } + + /** + * Specifies tags attached to the end of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string end_tags = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->end_tags = $arr; + + return $this; + } + + /** + * Time windows during which the vehicle may depart its start location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStartTimeWindows() + { + return $this->start_time_windows; + } + + /** + * Time windows during which the vehicle may depart its start location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + * @param array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStartTimeWindows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\TimeWindow::class); + $this->start_time_windows = $arr; + + return $this; + } + + /** + * Time windows during which the vehicle may arrive at its end location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndTimeWindows() + { + return $this->end_time_windows; + } + + /** + * Time windows during which the vehicle may arrive at its end location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + * @param array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndTimeWindows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\TimeWindow::class); + $this->end_time_windows = $arr; + + return $this; + } + + /** + * Specifies a multiplicative factor that can be used to increase or decrease + * travel times of this vehicle. For example, setting this to 2.0 means + * that this vehicle is slower and has travel times that are twice what they + * are for standard vehicles. This multiple does not affect visit durations. + * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + * is standard, and this multiple is considered 1.0. + * WARNING: Travel times will be rounded to the nearest second after this + * multiple is applied but before performing any numerical operations, thus, + * a small multiple may result in a loss of precision. + * See also `extra_visit_duration_for_visit_type` below. + * + * Generated from protobuf field optional double travel_duration_multiple = 11; + * @return float + */ + public function getTravelDurationMultiple() + { + return isset($this->travel_duration_multiple) ? $this->travel_duration_multiple : 0.0; + } + + public function hasTravelDurationMultiple() + { + return isset($this->travel_duration_multiple); + } + + public function clearTravelDurationMultiple() + { + unset($this->travel_duration_multiple); + } + + /** + * Specifies a multiplicative factor that can be used to increase or decrease + * travel times of this vehicle. For example, setting this to 2.0 means + * that this vehicle is slower and has travel times that are twice what they + * are for standard vehicles. This multiple does not affect visit durations. + * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + * is standard, and this multiple is considered 1.0. + * WARNING: Travel times will be rounded to the nearest second after this + * multiple is applied but before performing any numerical operations, thus, + * a small multiple may result in a loss of precision. + * See also `extra_visit_duration_for_visit_type` below. + * + * Generated from protobuf field optional double travel_duration_multiple = 11; + * @param float $var + * @return $this + */ + public function setTravelDurationMultiple($var) + { + GPBUtil::checkDouble($var); + $this->travel_duration_multiple = $var; + + return $this; + } + + /** + * Unloading policy enforced on the vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * @return int + */ + public function getUnloadingPolicy() + { + return $this->unloading_policy; + } + + /** + * Unloading policy enforced on the vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * @param int $var + * @return $this + */ + public function setUnloadingPolicy($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\Vehicle\UnloadingPolicy::class); + $this->unloading_policy = $var; + + return $this; + } + + /** + * Capacities of the vehicle (weight, volume, # of pallets for example). + * The keys in the map are the identifiers of the type of load, consistent + * with the keys of the + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field. If a given key is absent from this map, the corresponding capacity + * is considered to be limitless. + * + * Generated from protobuf field map load_limits = 30; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLoadLimits() + { + return $this->load_limits; + } + + /** + * Capacities of the vehicle (weight, volume, # of pallets for example). + * The keys in the map are the identifiers of the type of load, consistent + * with the keys of the + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field. If a given key is absent from this map, the corresponding capacity + * is considered to be limitless. + * + * Generated from protobuf field map load_limits = 30; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLoadLimits($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit::class); + $this->load_limits = $arr; + + return $this; + } + + /** + * Vehicle costs: all costs add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * Cost per hour of the vehicle route. This cost is applied to the total time + * taken by the route, and includes travel time, waiting time, and visit time. + * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + * in additional latency. + * + * Generated from protobuf field double cost_per_hour = 16; + * @return float + */ + public function getCostPerHour() + { + return $this->cost_per_hour; + } + + /** + * Vehicle costs: all costs add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * Cost per hour of the vehicle route. This cost is applied to the total time + * taken by the route, and includes travel time, waiting time, and visit time. + * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + * in additional latency. + * + * Generated from protobuf field double cost_per_hour = 16; + * @param float $var + * @return $this + */ + public function setCostPerHour($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_hour = $var; + + return $this; + } + + /** + * Cost per traveled hour of the vehicle route. This cost is applied only to + * travel time taken by the route (i.e., that reported in + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + * and excludes waiting time and visit time. + * + * Generated from protobuf field double cost_per_traveled_hour = 17; + * @return float + */ + public function getCostPerTraveledHour() + { + return $this->cost_per_traveled_hour; + } + + /** + * Cost per traveled hour of the vehicle route. This cost is applied only to + * travel time taken by the route (i.e., that reported in + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + * and excludes waiting time and visit time. + * + * Generated from protobuf field double cost_per_traveled_hour = 17; + * @param float $var + * @return $this + */ + public function setCostPerTraveledHour($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_traveled_hour = $var; + + return $this; + } + + /** + * Cost per kilometer of the vehicle route. This cost is applied to the + * distance reported in the + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * and does not apply to any distance implicitly traveled from the + * `arrival_location` to the `departure_location` of a single `VisitRequest`. + * + * Generated from protobuf field double cost_per_kilometer = 18; + * @return float + */ + public function getCostPerKilometer() + { + return $this->cost_per_kilometer; + } + + /** + * Cost per kilometer of the vehicle route. This cost is applied to the + * distance reported in the + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * and does not apply to any distance implicitly traveled from the + * `arrival_location` to the `departure_location` of a single `VisitRequest`. + * + * Generated from protobuf field double cost_per_kilometer = 18; + * @param float $var + * @return $this + */ + public function setCostPerKilometer($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_kilometer = $var; + + return $this; + } + + /** + * Fixed cost applied if this vehicle is used to handle a shipment. + * + * Generated from protobuf field double fixed_cost = 19; + * @return float + */ + public function getFixedCost() + { + return $this->fixed_cost; + } + + /** + * Fixed cost applied if this vehicle is used to handle a shipment. + * + * Generated from protobuf field double fixed_cost = 19; + * @param float $var + * @return $this + */ + public function setFixedCost($var) + { + GPBUtil::checkDouble($var); + $this->fixed_cost = $var; + + return $this; + } + + /** + * This field only applies to vehicles when their route does not serve any + * shipments. It indicates if the vehicle should be considered as used or not + * in this case. + * If true, the vehicle goes from its start to its end location even if it + * doesn't serve any shipments, and time and distance costs resulting from its + * start --> end travel are taken into account. + * Otherwise, it doesn't travel from its start to its end location, and no + * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + * information except for the vehicle index and label. + * + * Generated from protobuf field bool used_if_route_is_empty = 20; + * @return bool + */ + public function getUsedIfRouteIsEmpty() + { + return $this->used_if_route_is_empty; + } + + /** + * This field only applies to vehicles when their route does not serve any + * shipments. It indicates if the vehicle should be considered as used or not + * in this case. + * If true, the vehicle goes from its start to its end location even if it + * doesn't serve any shipments, and time and distance costs resulting from its + * start --> end travel are taken into account. + * Otherwise, it doesn't travel from its start to its end location, and no + * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + * information except for the vehicle index and label. + * + * Generated from protobuf field bool used_if_route_is_empty = 20; + * @param bool $var + * @return $this + */ + public function setUsedIfRouteIsEmpty($var) + { + GPBUtil::checkBool($var); + $this->used_if_route_is_empty = $var; + + return $this; + } + + /** + * Limit applied to the total duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route duration of a vehicle is the + * difference between its `vehicle_end_time` and `vehicle_start_time`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * @return \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit|null + */ + public function getRouteDurationLimit() + { + return $this->route_duration_limit; + } + + public function hasRouteDurationLimit() + { + return isset($this->route_duration_limit); + } + + public function clearRouteDurationLimit() + { + unset($this->route_duration_limit); + } + + /** + * Limit applied to the total duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route duration of a vehicle is the + * difference between its `vehicle_end_time` and `vehicle_start_time`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * @param \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit $var + * @return $this + */ + public function setRouteDurationLimit($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit::class); + $this->route_duration_limit = $var; + + return $this; + } + + /** + * Limit applied to the travel duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route travel duration is the sum of all its + * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * @return \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit|null + */ + public function getTravelDurationLimit() + { + return $this->travel_duration_limit; + } + + public function hasTravelDurationLimit() + { + return isset($this->travel_duration_limit); + } + + public function clearTravelDurationLimit() + { + unset($this->travel_duration_limit); + } + + /** + * Limit applied to the travel duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route travel duration is the sum of all its + * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * @param \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit $var + * @return $this + */ + public function setTravelDurationLimit($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit::class); + $this->travel_duration_limit = $var; + + return $this; + } + + /** + * Limit applied to the total distance of the vehicle's route. In a given + * `OptimizeToursResponse`, the route distance is the sum of all its + * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * @return \Google\Maps\RouteOptimization\V1\DistanceLimit|null + */ + public function getRouteDistanceLimit() + { + return $this->route_distance_limit; + } + + public function hasRouteDistanceLimit() + { + return isset($this->route_distance_limit); + } + + public function clearRouteDistanceLimit() + { + unset($this->route_distance_limit); + } + + /** + * Limit applied to the total distance of the vehicle's route. In a given + * `OptimizeToursResponse`, the route distance is the sum of all its + * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * @param \Google\Maps\RouteOptimization\V1\DistanceLimit $var + * @return $this + */ + public function setRouteDistanceLimit($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\DistanceLimit::class); + $this->route_distance_limit = $var; + + return $this; + } + + /** + * Specifies a map from visit_types strings to durations. The duration is time + * in addition to + * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + * to be taken at visits with the specified `visit_types`. This extra visit + * duration adds cost if `cost_per_hour` is specified. Keys (i.e. + * `visit_types`) cannot be empty strings. + * If a visit request has multiple types, a duration will be added for each + * type in the map. + * + * Generated from protobuf field map extra_visit_duration_for_visit_type = 24; + * @return \Google\Protobuf\Internal\MapField + */ + public function getExtraVisitDurationForVisitType() + { + return $this->extra_visit_duration_for_visit_type; + } + + /** + * Specifies a map from visit_types strings to durations. The duration is time + * in addition to + * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + * to be taken at visits with the specified `visit_types`. This extra visit + * duration adds cost if `cost_per_hour` is specified. Keys (i.e. + * `visit_types`) cannot be empty strings. + * If a visit request has multiple types, a duration will be added for each + * type in the map. + * + * Generated from protobuf field map extra_visit_duration_for_visit_type = 24; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setExtraVisitDurationForVisitType($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->extra_visit_duration_for_visit_type = $arr; + + return $this; + } + + /** + * Describes the break schedule to be enforced on this vehicle. + * If empty, no breaks will be scheduled for this vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * @return \Google\Maps\RouteOptimization\V1\BreakRule|null + */ + public function getBreakRule() + { + return $this->break_rule; + } + + public function hasBreakRule() + { + return isset($this->break_rule); + } + + public function clearBreakRule() + { + unset($this->break_rule); + } + + /** + * Describes the break schedule to be enforced on this vehicle. + * If empty, no breaks will be scheduled for this vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * @param \Google\Maps\RouteOptimization\V1\BreakRule $var + * @return $this + */ + public function setBreakRule($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\BreakRule::class); + $this->break_rule = $var; + + return $this; + } + + /** + * Specifies a label for this vehicle. This label is reported in the response + * as the `vehicle_label` of the corresponding + * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + * + * Generated from protobuf field string label = 27; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Specifies a label for this vehicle. This label is reported in the response + * as the `vehicle_label` of the corresponding + * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + * + * Generated from protobuf field string label = 27; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * If true, `used_if_route_is_empty` must be false, and this vehicle will + * remain unused. + * If a shipment is performed by an ignored vehicle in + * `injected_first_solution_routes`, it is skipped in the first solution but + * is free to be performed in the response. + * If a shipment is performed by an ignored vehicle in + * `injected_solution_constraint` and any related pickup/delivery is + * constrained to remain on the vehicle (i.e., not relaxed to level + * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + * If a shipment has a non-empty `allowed_vehicle_indices` field and all of + * the allowed vehicles are ignored, it is skipped in the response. + * + * Generated from protobuf field bool ignore = 28; + * @return bool + */ + public function getIgnore() + { + return $this->ignore; + } + + /** + * If true, `used_if_route_is_empty` must be false, and this vehicle will + * remain unused. + * If a shipment is performed by an ignored vehicle in + * `injected_first_solution_routes`, it is skipped in the first solution but + * is free to be performed in the response. + * If a shipment is performed by an ignored vehicle in + * `injected_solution_constraint` and any related pickup/delivery is + * constrained to remain on the vehicle (i.e., not relaxed to level + * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + * If a shipment has a non-empty `allowed_vehicle_indices` field and all of + * the allowed vehicles are ignored, it is skipped in the response. + * + * Generated from protobuf field bool ignore = 28; + * @param bool $var + * @return $this + */ + public function setIgnore($var) + { + GPBUtil::checkBool($var); + $this->ignore = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/Vehicle/DurationLimit.php b/MapsRouteOptimization/src/V1/Vehicle/DurationLimit.php new file mode 100644 index 000000000000..08869c7751a9 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/DurationLimit.php @@ -0,0 +1,357 @@ +google.maps.routeoptimization.v1.Vehicle.DurationLimit + */ +class DurationLimit extends \Google\Protobuf\Internal\Message +{ + /** + * A hard limit constraining the duration to be at most max_duration. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 1; + */ + protected $max_duration = null; + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost. This cost adds up to other costs defined in + * the model, with the same unit. + * If defined, `soft_max_duration` must be nonnegative. If max_duration is + * also defined, `soft_max_duration` must be less than max_duration. + * + * Generated from protobuf field .google.protobuf.Duration soft_max_duration = 2; + */ + protected $soft_max_duration = null; + /** + * Cost per hour incurred if the `soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_hour_after_soft_max * (duration - soft_max_duration) + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_max = 3; + */ + protected $cost_per_hour_after_soft_max = null; + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost, quadratic in the duration. This cost adds + * up to other costs defined in the model, with the same unit. + * If defined, `quadratic_soft_max_duration` must be nonnegative. If + * `max_duration` is also defined, `quadratic_soft_max_duration` must be + * less than `max_duration`, and the difference must be no larger than one + * day: + * `max_duration - quadratic_soft_max_duration <= 86400 seconds` + * + * Generated from protobuf field .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + protected $quadratic_soft_max_duration = null; + /** + * Cost per square hour incurred if the + * `quadratic_soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_square_hour_after_quadratic_soft_max * + * (duration - quadratic_soft_max_duration)^2 + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_square_hour_after_quadratic_soft_max = 5; + */ + protected $cost_per_square_hour_after_quadratic_soft_max = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $max_duration + * A hard limit constraining the duration to be at most max_duration. + * @type \Google\Protobuf\Duration $soft_max_duration + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost. This cost adds up to other costs defined in + * the model, with the same unit. + * If defined, `soft_max_duration` must be nonnegative. If max_duration is + * also defined, `soft_max_duration` must be less than max_duration. + * @type float $cost_per_hour_after_soft_max + * Cost per hour incurred if the `soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_hour_after_soft_max * (duration - soft_max_duration) + * ``` + * The cost must be nonnegative. + * @type \Google\Protobuf\Duration $quadratic_soft_max_duration + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost, quadratic in the duration. This cost adds + * up to other costs defined in the model, with the same unit. + * If defined, `quadratic_soft_max_duration` must be nonnegative. If + * `max_duration` is also defined, `quadratic_soft_max_duration` must be + * less than `max_duration`, and the difference must be no larger than one + * day: + * `max_duration - quadratic_soft_max_duration <= 86400 seconds` + * @type float $cost_per_square_hour_after_quadratic_soft_max + * Cost per square hour incurred if the + * `quadratic_soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_square_hour_after_quadratic_soft_max * + * (duration - quadratic_soft_max_duration)^2 + * ``` + * The cost must be nonnegative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A hard limit constraining the duration to be at most max_duration. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxDuration() + { + return $this->max_duration; + } + + public function hasMaxDuration() + { + return isset($this->max_duration); + } + + public function clearMaxDuration() + { + unset($this->max_duration); + } + + /** + * A hard limit constraining the duration to be at most max_duration. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_duration = $var; + + return $this; + } + + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost. This cost adds up to other costs defined in + * the model, with the same unit. + * If defined, `soft_max_duration` must be nonnegative. If max_duration is + * also defined, `soft_max_duration` must be less than max_duration. + * + * Generated from protobuf field .google.protobuf.Duration soft_max_duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getSoftMaxDuration() + { + return $this->soft_max_duration; + } + + public function hasSoftMaxDuration() + { + return isset($this->soft_max_duration); + } + + public function clearSoftMaxDuration() + { + unset($this->soft_max_duration); + } + + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost. This cost adds up to other costs defined in + * the model, with the same unit. + * If defined, `soft_max_duration` must be nonnegative. If max_duration is + * also defined, `soft_max_duration` must be less than max_duration. + * + * Generated from protobuf field .google.protobuf.Duration soft_max_duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSoftMaxDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->soft_max_duration = $var; + + return $this; + } + + /** + * Cost per hour incurred if the `soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_hour_after_soft_max * (duration - soft_max_duration) + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_max = 3; + * @return float + */ + public function getCostPerHourAfterSoftMax() + { + return isset($this->cost_per_hour_after_soft_max) ? $this->cost_per_hour_after_soft_max : 0.0; + } + + public function hasCostPerHourAfterSoftMax() + { + return isset($this->cost_per_hour_after_soft_max); + } + + public function clearCostPerHourAfterSoftMax() + { + unset($this->cost_per_hour_after_soft_max); + } + + /** + * Cost per hour incurred if the `soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_hour_after_soft_max * (duration - soft_max_duration) + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_max = 3; + * @param float $var + * @return $this + */ + public function setCostPerHourAfterSoftMax($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_hour_after_soft_max = $var; + + return $this; + } + + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost, quadratic in the duration. This cost adds + * up to other costs defined in the model, with the same unit. + * If defined, `quadratic_soft_max_duration` must be nonnegative. If + * `max_duration` is also defined, `quadratic_soft_max_duration` must be + * less than `max_duration`, and the difference must be no larger than one + * day: + * `max_duration - quadratic_soft_max_duration <= 86400 seconds` + * + * Generated from protobuf field .google.protobuf.Duration quadratic_soft_max_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getQuadraticSoftMaxDuration() + { + return $this->quadratic_soft_max_duration; + } + + public function hasQuadraticSoftMaxDuration() + { + return isset($this->quadratic_soft_max_duration); + } + + public function clearQuadraticSoftMaxDuration() + { + unset($this->quadratic_soft_max_duration); + } + + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost, quadratic in the duration. This cost adds + * up to other costs defined in the model, with the same unit. + * If defined, `quadratic_soft_max_duration` must be nonnegative. If + * `max_duration` is also defined, `quadratic_soft_max_duration` must be + * less than `max_duration`, and the difference must be no larger than one + * day: + * `max_duration - quadratic_soft_max_duration <= 86400 seconds` + * + * Generated from protobuf field .google.protobuf.Duration quadratic_soft_max_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setQuadraticSoftMaxDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->quadratic_soft_max_duration = $var; + + return $this; + } + + /** + * Cost per square hour incurred if the + * `quadratic_soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_square_hour_after_quadratic_soft_max * + * (duration - quadratic_soft_max_duration)^2 + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * @return float + */ + public function getCostPerSquareHourAfterQuadraticSoftMax() + { + return isset($this->cost_per_square_hour_after_quadratic_soft_max) ? $this->cost_per_square_hour_after_quadratic_soft_max : 0.0; + } + + public function hasCostPerSquareHourAfterQuadraticSoftMax() + { + return isset($this->cost_per_square_hour_after_quadratic_soft_max); + } + + public function clearCostPerSquareHourAfterQuadraticSoftMax() + { + unset($this->cost_per_square_hour_after_quadratic_soft_max); + } + + /** + * Cost per square hour incurred if the + * `quadratic_soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_square_hour_after_quadratic_soft_max * + * (duration - quadratic_soft_max_duration)^2 + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * @param float $var + * @return $this + */ + public function setCostPerSquareHourAfterQuadraticSoftMax($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_square_hour_after_quadratic_soft_max = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Vehicle/LoadLimit.php b/MapsRouteOptimization/src/V1/Vehicle/LoadLimit.php new file mode 100644 index 000000000000..f52604927f98 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/LoadLimit.php @@ -0,0 +1,268 @@ +google.maps.routeoptimization.v1.Vehicle.LoadLimit + */ +class LoadLimit extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum acceptable amount of load. + * + * Generated from protobuf field optional int64 max_load = 1; + */ + protected $max_load = null; + /** + * A soft limit of the load. See + * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + * + * Generated from protobuf field int64 soft_max_load = 2; + */ + protected $soft_max_load = 0; + /** + * If the load ever exceeds + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + * along this vehicle's route, the following cost penalty applies (only once + * per vehicle): (load - + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + * add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double cost_per_unit_above_soft_max = 3; + */ + protected $cost_per_unit_above_soft_max = 0.0; + /** + * The acceptable load interval of the vehicle at the start of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + */ + protected $start_load_interval = null; + /** + * The acceptable load interval of the vehicle at the end of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + */ + protected $end_load_interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $max_load + * The maximum acceptable amount of load. + * @type int|string $soft_max_load + * A soft limit of the load. See + * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + * @type float $cost_per_unit_above_soft_max + * If the load ever exceeds + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + * along this vehicle's route, the following cost penalty applies (only once + * per vehicle): (load - + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + * add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * @type \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $start_load_interval + * The acceptable load interval of the vehicle at the start of the route. + * @type \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $end_load_interval + * The acceptable load interval of the vehicle at the end of the route. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The maximum acceptable amount of load. + * + * Generated from protobuf field optional int64 max_load = 1; + * @return int|string + */ + public function getMaxLoad() + { + return isset($this->max_load) ? $this->max_load : 0; + } + + public function hasMaxLoad() + { + return isset($this->max_load); + } + + public function clearMaxLoad() + { + unset($this->max_load); + } + + /** + * The maximum acceptable amount of load. + * + * Generated from protobuf field optional int64 max_load = 1; + * @param int|string $var + * @return $this + */ + public function setMaxLoad($var) + { + GPBUtil::checkInt64($var); + $this->max_load = $var; + + return $this; + } + + /** + * A soft limit of the load. See + * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + * + * Generated from protobuf field int64 soft_max_load = 2; + * @return int|string + */ + public function getSoftMaxLoad() + { + return $this->soft_max_load; + } + + /** + * A soft limit of the load. See + * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + * + * Generated from protobuf field int64 soft_max_load = 2; + * @param int|string $var + * @return $this + */ + public function setSoftMaxLoad($var) + { + GPBUtil::checkInt64($var); + $this->soft_max_load = $var; + + return $this; + } + + /** + * If the load ever exceeds + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + * along this vehicle's route, the following cost penalty applies (only once + * per vehicle): (load - + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + * add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double cost_per_unit_above_soft_max = 3; + * @return float + */ + public function getCostPerUnitAboveSoftMax() + { + return $this->cost_per_unit_above_soft_max; + } + + /** + * If the load ever exceeds + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + * along this vehicle's route, the following cost penalty applies (only once + * per vehicle): (load - + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + * add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double cost_per_unit_above_soft_max = 3; + * @param float $var + * @return $this + */ + public function setCostPerUnitAboveSoftMax($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_unit_above_soft_max = $var; + + return $this; + } + + /** + * The acceptable load interval of the vehicle at the start of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * @return \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval|null + */ + public function getStartLoadInterval() + { + return $this->start_load_interval; + } + + public function hasStartLoadInterval() + { + return isset($this->start_load_interval); + } + + public function clearStartLoadInterval() + { + unset($this->start_load_interval); + } + + /** + * The acceptable load interval of the vehicle at the start of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * @param \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $var + * @return $this + */ + public function setStartLoadInterval($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval::class); + $this->start_load_interval = $var; + + return $this; + } + + /** + * The acceptable load interval of the vehicle at the end of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * @return \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval|null + */ + public function getEndLoadInterval() + { + return $this->end_load_interval; + } + + public function hasEndLoadInterval() + { + return isset($this->end_load_interval); + } + + public function clearEndLoadInterval() + { + unset($this->end_load_interval); + } + + /** + * The acceptable load interval of the vehicle at the end of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * @param \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $var + * @return $this + */ + public function setEndLoadInterval($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval::class); + $this->end_load_interval = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Vehicle/LoadLimit/Interval.php b/MapsRouteOptimization/src/V1/Vehicle/LoadLimit/Interval.php new file mode 100644 index 000000000000..274435df50d9 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/LoadLimit/Interval.php @@ -0,0 +1,148 @@ +google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + */ +class Interval extends \Google\Protobuf\Internal\Message +{ + /** + * A minimum acceptable load. Must be ≥ 0. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field int64 min = 1; + */ + protected $min = 0; + /** + * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + * load is unrestricted by this message. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field optional int64 max = 2; + */ + protected $max = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $min + * A minimum acceptable load. Must be ≥ 0. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * @type int|string $max + * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + * load is unrestricted by this message. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A minimum acceptable load. Must be ≥ 0. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field int64 min = 1; + * @return int|string + */ + public function getMin() + { + return $this->min; + } + + /** + * A minimum acceptable load. Must be ≥ 0. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field int64 min = 1; + * @param int|string $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkInt64($var); + $this->min = $var; + + return $this; + } + + /** + * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + * load is unrestricted by this message. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field optional int64 max = 2; + * @return int|string + */ + public function getMax() + { + return isset($this->max) ? $this->max : 0; + } + + public function hasMax() + { + return isset($this->max); + } + + public function clearMax() + { + unset($this->max); + } + + /** + * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + * load is unrestricted by this message. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field optional int64 max = 2; + * @param int|string $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkInt64($var); + $this->max = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Vehicle/TravelMode.php b/MapsRouteOptimization/src/V1/Vehicle/TravelMode.php new file mode 100644 index 000000000000..12f4ff7dd0cb --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/TravelMode.php @@ -0,0 +1,65 @@ +google.maps.routeoptimization.v1.Vehicle.TravelMode + */ +class TravelMode +{ + /** + * Unspecified travel mode, equivalent to `DRIVING`. + * + * Generated from protobuf enum TRAVEL_MODE_UNSPECIFIED = 0; + */ + const TRAVEL_MODE_UNSPECIFIED = 0; + /** + * Travel mode corresponding to driving directions (car, ...). + * + * Generated from protobuf enum DRIVING = 1; + */ + const DRIVING = 1; + /** + * Travel mode corresponding to walking directions. + * + * Generated from protobuf enum WALKING = 2; + */ + const WALKING = 2; + + private static $valueToName = [ + self::TRAVEL_MODE_UNSPECIFIED => 'TRAVEL_MODE_UNSPECIFIED', + self::DRIVING => 'DRIVING', + self::WALKING => 'WALKING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/Vehicle/UnloadingPolicy.php b/MapsRouteOptimization/src/V1/Vehicle/UnloadingPolicy.php new file mode 100644 index 000000000000..463afa6b0065 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/UnloadingPolicy.php @@ -0,0 +1,66 @@ +google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy + */ +class UnloadingPolicy +{ + /** + * Unspecified unloading policy; deliveries must just occur after their + * corresponding pickups. + * + * Generated from protobuf enum UNLOADING_POLICY_UNSPECIFIED = 0; + */ + const UNLOADING_POLICY_UNSPECIFIED = 0; + /** + * Deliveries must occur in reverse order of pickups + * + * Generated from protobuf enum LAST_IN_FIRST_OUT = 1; + */ + const LAST_IN_FIRST_OUT = 1; + /** + * Deliveries must occur in the same order as pickups + * + * Generated from protobuf enum FIRST_IN_FIRST_OUT = 2; + */ + const FIRST_IN_FIRST_OUT = 2; + + private static $valueToName = [ + self::UNLOADING_POLICY_UNSPECIFIED => 'UNLOADING_POLICY_UNSPECIFIED', + self::LAST_IN_FIRST_OUT => 'LAST_IN_FIRST_OUT', + self::FIRST_IN_FIRST_OUT => 'FIRST_IN_FIRST_OUT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/Waypoint.php b/MapsRouteOptimization/src/V1/Waypoint.php new file mode 100644 index 000000000000..b691d5167b2b --- /dev/null +++ b/MapsRouteOptimization/src/V1/Waypoint.php @@ -0,0 +1,166 @@ +google.maps.routeoptimization.v1.Waypoint + */ +class Waypoint extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Indicates that the location of this waypoint is meant to have a + * preference for the vehicle to stop at a particular side of road. When you + * set this value, the route will pass through the location so that the + * vehicle can stop at the side of road that the location is biased towards + * from the center of the road. This option doesn't work for the 'WALKING' + * travel mode. + * + * Generated from protobuf field bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $side_of_road = false; + protected $location_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\RouteOptimization\V1\Location $location + * A point specified using geographic coordinates, including an optional + * heading. + * @type string $place_id + * The POI Place ID associated with the waypoint. + * @type bool $side_of_road + * Optional. Indicates that the location of this waypoint is meant to have a + * preference for the vehicle to stop at a particular side of road. When you + * set this value, the route will pass through the location so that the + * vehicle can stop at the side of road that the location is biased towards + * from the center of the road. This option doesn't work for the 'WALKING' + * travel mode. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A point specified using geographic coordinates, including an optional + * heading. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Location location = 1; + * @return \Google\Maps\RouteOptimization\V1\Location|null + */ + public function getLocation() + { + return $this->readOneof(1); + } + + public function hasLocation() + { + return $this->hasOneof(1); + } + + /** + * A point specified using geographic coordinates, including an optional + * heading. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Location location = 1; + * @param \Google\Maps\RouteOptimization\V1\Location $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Location::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The POI Place ID associated with the waypoint. + * + * Generated from protobuf field string place_id = 2; + * @return string + */ + public function getPlaceId() + { + return $this->readOneof(2); + } + + public function hasPlaceId() + { + return $this->hasOneof(2); + } + + /** + * The POI Place ID associated with the waypoint. + * + * Generated from protobuf field string place_id = 2; + * @param string $var + * @return $this + */ + public function setPlaceId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Indicates that the location of this waypoint is meant to have a + * preference for the vehicle to stop at a particular side of road. When you + * set this value, the route will pass through the location so that the + * vehicle can stop at the side of road that the location is biased towards + * from the center of the road. This option doesn't work for the 'WALKING' + * travel mode. + * + * Generated from protobuf field bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSideOfRoad() + { + return $this->side_of_road; + } + + /** + * Optional. Indicates that the location of this waypoint is meant to have a + * preference for the vehicle to stop at a particular side of road. When you + * set this value, the route will pass through the location so that the + * vehicle can stop at the side of road that the location is biased towards + * from the center of the road. This option doesn't work for the 'WALKING' + * travel mode. + * + * Generated from protobuf field bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSideOfRoad($var) + { + GPBUtil::checkBool($var); + $this->side_of_road = $var; + + return $this; + } + + /** + * @return string + */ + public function getLocationType() + { + return $this->whichOneof("location_type"); + } + +} + diff --git a/MapsRouteOptimization/src/V1/gapic_metadata.json b/MapsRouteOptimization/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..71f5ea3e4f9b --- /dev/null +++ b/MapsRouteOptimization/src/V1/gapic_metadata.json @@ -0,0 +1,28 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.maps.routeoptimization.v1", + "libraryPackage": "Google\\Maps\\RouteOptimization\\V1", + "services": { + "RouteOptimization": { + "clients": { + "grpc": { + "libraryClient": "RouteOptimizationGapicClient", + "rpcs": { + "BatchOptimizeTours": { + "methods": [ + "batchOptimizeTours" + ] + }, + "OptimizeTours": { + "methods": [ + "optimizeTours" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/MapsRouteOptimization/src/V1/resources/route_optimization_client_config.json b/MapsRouteOptimization/src/V1/resources/route_optimization_client_config.json new file mode 100644 index 000000000000..0e5122e35b74 --- /dev/null +++ b/MapsRouteOptimization/src/V1/resources/route_optimization_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.maps.routeoptimization.v1.RouteOptimization": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 3600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 3600000, + "total_timeout_millis": 3600000 + } + }, + "methods": { + "BatchOptimizeTours": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "OptimizeTours": { + "timeout_millis": 3600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/MapsRouteOptimization/src/V1/resources/route_optimization_descriptor_config.php b/MapsRouteOptimization/src/V1/resources/route_optimization_descriptor_config.php new file mode 100644 index 000000000000..0e8b84155c48 --- /dev/null +++ b/MapsRouteOptimization/src/V1/resources/route_optimization_descriptor_config.php @@ -0,0 +1,59 @@ + [ + 'google.maps.routeoptimization.v1.RouteOptimization' => [ + 'BatchOptimizeTours' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Maps\RouteOptimization\V1\BatchOptimizeToursResponse', + 'metadataReturnType' => '\Google\Maps\RouteOptimization\V1\BatchOptimizeToursMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'OptimizeTours' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\RouteOptimization\V1\OptimizeToursResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + ], + ], +]; diff --git a/MapsRouteOptimization/src/V1/resources/route_optimization_rest_client_config.php b/MapsRouteOptimization/src/V1/resources/route_optimization_rest_client_config.php new file mode 100644 index 000000000000..5087b38b87fd --- /dev/null +++ b/MapsRouteOptimization/src/V1/resources/route_optimization_rest_client_config.php @@ -0,0 +1,80 @@ + [ + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.maps.routeoptimization.v1.RouteOptimization' => [ + 'BatchOptimizeTours' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:batchOptimizeTours', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}:batchOptimizeTours', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'OptimizeTours' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:optimizeTours', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}:optimizeTours', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/MapsRouteOptimization/tests/Unit/V1/Client/RouteOptimizationClientTest.php b/MapsRouteOptimization/tests/Unit/V1/Client/RouteOptimizationClientTest.php new file mode 100644 index 000000000000..7dc0ad01af34 --- /dev/null +++ b/MapsRouteOptimization/tests/Unit/V1/Client/RouteOptimizationClientTest.php @@ -0,0 +1,327 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return RouteOptimizationClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RouteOptimizationClient($options); + } + + /** @test */ + public function batchOptimizeToursTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchOptimizeToursTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchOptimizeToursResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchOptimizeToursTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $modelConfigs = []; + $request = (new BatchOptimizeToursRequest())->setParent($parent)->setModelConfigs($modelConfigs); + $response = $gapicClient->batchOptimizeTours($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.maps.routeoptimization.v1.RouteOptimization/BatchOptimizeTours', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getModelConfigs(); + $this->assertProtobufEquals($modelConfigs, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchOptimizeToursTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchOptimizeToursExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchOptimizeToursTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $modelConfigs = []; + $request = (new BatchOptimizeToursRequest())->setParent($parent)->setModelConfigs($modelConfigs); + $response = $gapicClient->batchOptimizeTours($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchOptimizeToursTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function optimizeToursTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $requestLabel = 'requestLabel1739091268'; + $expectedResponse = new OptimizeToursResponse(); + $expectedResponse->setRequestLabel($requestLabel); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new OptimizeToursRequest())->setParent($parent); + $response = $gapicClient->optimizeTours($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.maps.routeoptimization.v1.RouteOptimization/OptimizeTours', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function optimizeToursExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new OptimizeToursRequest())->setParent($parent); + try { + $gapicClient->optimizeTours($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchOptimizeToursAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchOptimizeToursTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchOptimizeToursResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchOptimizeToursTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $modelConfigs = []; + $request = (new BatchOptimizeToursRequest())->setParent($parent)->setModelConfigs($modelConfigs); + $response = $gapicClient->batchOptimizeToursAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.maps.routeoptimization.v1.RouteOptimization/BatchOptimizeTours', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getModelConfigs(); + $this->assertProtobufEquals($modelConfigs, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchOptimizeToursTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/MediaTranslation/.repo-metadata.json b/MediaTranslation/.repo-metadata.json deleted file mode 100644 index 90c6fa45fc91..000000000000 --- a/MediaTranslation/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-media-translation", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-media-translation/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "mediatranslation" -} diff --git a/MediaTranslation/VERSION b/MediaTranslation/VERSION index 2b7c5ae01848..6f2743d65dc0 100644 --- a/MediaTranslation/VERSION +++ b/MediaTranslation/VERSION @@ -1 +1 @@ -0.4.2 +0.4.4 diff --git a/MediaTranslation/composer.json b/MediaTranslation/composer.json index a8608c4e2a04..258a65699817 100644 --- a/MediaTranslation/composer.json +++ b/MediaTranslation/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Memcache/.repo-metadata.json b/Memcache/.repo-metadata.json deleted file mode 100644 index a54596357674..000000000000 --- a/Memcache/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-memcache", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-memcache/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "memcache" -} diff --git a/Memcache/VERSION b/Memcache/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/Memcache/VERSION +++ b/Memcache/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/Memcache/composer.json b/Memcache/composer.json index 1aee882d0237..a83469d3316e 100644 --- a/Memcache/composer.json +++ b/Memcache/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/MigrationCenter/.repo-metadata.json b/MigrationCenter/.repo-metadata.json deleted file mode 100644 index 4de03e4f3e9c..000000000000 --- a/MigrationCenter/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-migrationcenter", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-migrationcenter/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "migrationcenter" -} diff --git a/MigrationCenter/VERSION b/MigrationCenter/VERSION index 17b2ccd9bf90..0bfccb080404 100644 --- a/MigrationCenter/VERSION +++ b/MigrationCenter/VERSION @@ -1 +1 @@ -0.4.3 +0.4.5 diff --git a/MigrationCenter/composer.json b/MigrationCenter/composer.json index 821ea08fba04..4c680405f725 100644 --- a/MigrationCenter/composer.json +++ b/MigrationCenter/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/MigrationCenter/src/V1/Client/MigrationCenterClient.php b/MigrationCenter/src/V1/Client/MigrationCenterClient.php index 00a3ab3e2c5d..f94a5e4531fe 100644 --- a/MigrationCenter/src/V1/Client/MigrationCenterClient.php +++ b/MigrationCenter/src/V1/Client/MigrationCenterClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -99,6 +98,7 @@ use Google\Cloud\MigrationCenter\V1\UpdateSettingsRequest; use Google\Cloud\MigrationCenter\V1\UpdateSourceRequest; use Google\Cloud\MigrationCenter\V1\ValidateImportJobRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -243,6 +243,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a asset * resource. diff --git a/MigrationCenter/tests/Unit/V1/Client/MigrationCenterClientTest.php b/MigrationCenter/tests/Unit/V1/Client/MigrationCenterClientTest.php index d744c65b5918..9659331b0cf9 100644 --- a/MigrationCenter/tests/Unit/V1/Client/MigrationCenterClientTest.php +++ b/MigrationCenter/tests/Unit/V1/Client/MigrationCenterClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Location\GetLocationRequest; @@ -104,6 +103,7 @@ use Google\Cloud\MigrationCenter\V1\UpdateSettingsRequest; use Google\Cloud\MigrationCenter\V1\UpdateSourceRequest; use Google\Cloud\MigrationCenter\V1\ValidateImportJobRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/Monitoring/.repo-metadata.json b/Monitoring/.repo-metadata.json deleted file mode 100644 index 72899863f305..000000000000 --- a/Monitoring/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-monitoring", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-monitoring/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "monitoring" -} diff --git a/Monitoring/VERSION b/Monitoring/VERSION index 4dae2985b58c..587c5f0c7309 100644 --- a/Monitoring/VERSION +++ b/Monitoring/VERSION @@ -1 +1 @@ -1.10.1 +1.10.3 diff --git a/Monitoring/composer.json b/Monitoring/composer.json index a0d438090a1d..6d449f0e89d8 100644 --- a/Monitoring/composer.json +++ b/Monitoring/composer.json @@ -5,7 +5,7 @@ "minimum-stability": "stable", "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/NetApp/.repo-metadata.json b/NetApp/.repo-metadata.json deleted file mode 100644 index 4a2ebf1c412f..000000000000 --- a/NetApp/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-netapp", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-netapp/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "netapp" -} diff --git a/NetApp/VERSION b/NetApp/VERSION index 3a4036fb450f..9e11b32fcaa9 100644 --- a/NetApp/VERSION +++ b/NetApp/VERSION @@ -1 +1 @@ -0.2.5 +0.3.1 diff --git a/NetApp/composer.json b/NetApp/composer.json index 79888d1ae14b..e7136628dc2b 100644 --- a/NetApp/composer.json +++ b/NetApp/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/NetApp/metadata/V1/Common.php b/NetApp/metadata/V1/Common.php index b7d17cec3d2dc98728b7265c965539671a79fd6c..8cb63d596909b5e28725ee7adc0a9dd328d9c669 100644 GIT binary patch delta 222 zcmX@W{)}V85=NsK_W&o~)RM%M#FE4q_x$|yoYWY{g3K7V%+#C|r__wZvdsJ&dejEm-*KgTg$WUE_URCmS$XatU#8vAFrTMhLKM&SVN_1OTTNNR$8o delta 30 mcmaFHae#fp62{5*8TFYKGfx&^vSrc=oxFi5bTdD5I3ob3SqX0d diff --git a/NetApp/metadata/V1/Volume.php b/NetApp/metadata/V1/Volume.php index e446a354b1ebf3bb642d43de6af3b795e0b97496..c7bf382b1697a6541175826d39af35b844e90ac0 100644 GIT binary patch delta 420 zcmbPcyv%IFA10=|`kVhTePU*6;otm;jhRhK$cc-uBr~-rGcP^9AU`KFxl%$&fl-6o zNOf`}kAz?dL@EF*o&+P%L_Q+}kX!3f6zYL^j$lO~3mH8afEEgAaET@71N{Q@Y)M8@ zYH>z>PD*@AVr8)e6VM=5h)R&tl$^M@5GDvobBTv|x(3BNI)`}r`^AU)1qZk~d%AhL zx(F}`adWY|`Z+q;_yBo~LR?&I0gj=;KsJ*T9~Tcel%TG4lH?MP$8P`TW-(!A0ECKw A3;+NC delta 49 zcmV-10M7rWHkLE6`~m{aEVKRs@&f{`4zuzG0|v7>4J-k(cn*UH0^I?V{T0BI;}#vW H6BrW%>y#2R diff --git a/NetApp/src/V1/BackupConfig.php b/NetApp/src/V1/BackupConfig.php index 0dc20e3134e6..93f0b682ab39 100644 --- a/NetApp/src/V1/BackupConfig.php +++ b/NetApp/src/V1/BackupConfig.php @@ -37,6 +37,13 @@ class BackupConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool scheduled_backup_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; */ protected $scheduled_backup_enabled = null; + /** + * Output only. Total size of all backups in a chain in bytes = baseline + * backup size + sum(incremental backup size). + * + * Generated from protobuf field optional int64 backup_chain_bytes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_chain_bytes = null; /** * Constructor. @@ -54,6 +61,9 @@ class BackupConfig extends \Google\Protobuf\Internal\Message * @type bool $scheduled_backup_enabled * Optional. When set to true, scheduled backup is enabled on the volume. * This field should be nil when there's no backup policy attached. + * @type int|string $backup_chain_bytes + * Output only. Total size of all backups in a chain in bytes = baseline + * backup size + sum(incremental backup size). * } */ public function __construct($data = NULL) { @@ -157,5 +167,43 @@ public function setScheduledBackupEnabled($var) return $this; } + /** + * Output only. Total size of all backups in a chain in bytes = baseline + * backup size + sum(incremental backup size). + * + * Generated from protobuf field optional int64 backup_chain_bytes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getBackupChainBytes() + { + return isset($this->backup_chain_bytes) ? $this->backup_chain_bytes : 0; + } + + public function hasBackupChainBytes() + { + return isset($this->backup_chain_bytes); + } + + public function clearBackupChainBytes() + { + unset($this->backup_chain_bytes); + } + + /** + * Output only. Total size of all backups in a chain in bytes = baseline + * backup size + sum(incremental backup size). + * + * Generated from protobuf field optional int64 backup_chain_bytes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setBackupChainBytes($var) + { + GPBUtil::checkInt64($var); + $this->backup_chain_bytes = $var; + + return $this; + } + } diff --git a/NetApp/src/V1/Client/NetAppClient.php b/NetApp/src/V1/Client/NetAppClient.php index 07758c118b3a..3d8033fe4cce 100644 --- a/NetApp/src/V1/Client/NetAppClient.php +++ b/NetApp/src/V1/Client/NetAppClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -99,6 +98,7 @@ use Google\Cloud\NetApp\V1\VerifyKmsConfigRequest; use Google\Cloud\NetApp\V1\VerifyKmsConfigResponse; use Google\Cloud\NetApp\V1\Volume; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -246,6 +246,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * active_directory resource. diff --git a/NetApp/src/V1/LocationMetadata.php b/NetApp/src/V1/LocationMetadata.php new file mode 100644 index 000000000000..1718fe1bb168 --- /dev/null +++ b/NetApp/src/V1/LocationMetadata.php @@ -0,0 +1,68 @@ +google.cloud.netapp.v1.LocationMetadata + */ +class LocationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Supported service levels in a location. + * + * Generated from protobuf field repeated .google.cloud.netapp.v1.ServiceLevel supported_service_levels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $supported_service_levels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $supported_service_levels + * Output only. Supported service levels in a location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Netapp\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Supported service levels in a location. + * + * Generated from protobuf field repeated .google.cloud.netapp.v1.ServiceLevel supported_service_levels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedServiceLevels() + { + return $this->supported_service_levels; + } + + /** + * Output only. Supported service levels in a location. + * + * Generated from protobuf field repeated .google.cloud.netapp.v1.ServiceLevel supported_service_levels = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedServiceLevels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\NetApp\V1\ServiceLevel::class); + $this->supported_service_levels = $arr; + + return $this; + } + +} + diff --git a/NetApp/src/V1/ServiceLevel.php b/NetApp/src/V1/ServiceLevel.php index aa00d60b8b25..75c2df85fcfd 100644 --- a/NetApp/src/V1/ServiceLevel.php +++ b/NetApp/src/V1/ServiceLevel.php @@ -37,12 +37,19 @@ class ServiceLevel * Generated from protobuf enum STANDARD = 3; */ const STANDARD = 3; + /** + * Flex service level. + * + * Generated from protobuf enum FLEX = 4; + */ + const FLEX = 4; private static $valueToName = [ self::SERVICE_LEVEL_UNSPECIFIED => 'SERVICE_LEVEL_UNSPECIFIED', self::PREMIUM => 'PREMIUM', self::EXTREME => 'EXTREME', self::STANDARD => 'STANDARD', + self::FLEX => 'FLEX', ]; public static function name($value) diff --git a/NetApp/src/V1/TieringPolicy.php b/NetApp/src/V1/TieringPolicy.php new file mode 100644 index 000000000000..26a4a16e0cba --- /dev/null +++ b/NetApp/src/V1/TieringPolicy.php @@ -0,0 +1,129 @@ +google.cloud.netapp.v1.TieringPolicy + */ +class TieringPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Flag indicating if the volume has tiering policy enable/pause. + * Default is PAUSED. + * + * Generated from protobuf field optional .google.cloud.netapp.v1.TieringPolicy.TierAction tier_action = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tier_action = null; + /** + * Optional. Time in days to mark the volume's data block as cold and make it + * eligible for tiering, can be range from 7-183. Default is 31. + * + * Generated from protobuf field optional int32 cooling_threshold_days = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cooling_threshold_days = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $tier_action + * Optional. Flag indicating if the volume has tiering policy enable/pause. + * Default is PAUSED. + * @type int $cooling_threshold_days + * Optional. Time in days to mark the volume's data block as cold and make it + * eligible for tiering, can be range from 7-183. Default is 31. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Netapp\V1\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Flag indicating if the volume has tiering policy enable/pause. + * Default is PAUSED. + * + * Generated from protobuf field optional .google.cloud.netapp.v1.TieringPolicy.TierAction tier_action = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTierAction() + { + return isset($this->tier_action) ? $this->tier_action : 0; + } + + public function hasTierAction() + { + return isset($this->tier_action); + } + + public function clearTierAction() + { + unset($this->tier_action); + } + + /** + * Optional. Flag indicating if the volume has tiering policy enable/pause. + * Default is PAUSED. + * + * Generated from protobuf field optional .google.cloud.netapp.v1.TieringPolicy.TierAction tier_action = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTierAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetApp\V1\TieringPolicy\TierAction::class); + $this->tier_action = $var; + + return $this; + } + + /** + * Optional. Time in days to mark the volume's data block as cold and make it + * eligible for tiering, can be range from 7-183. Default is 31. + * + * Generated from protobuf field optional int32 cooling_threshold_days = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getCoolingThresholdDays() + { + return isset($this->cooling_threshold_days) ? $this->cooling_threshold_days : 0; + } + + public function hasCoolingThresholdDays() + { + return isset($this->cooling_threshold_days); + } + + public function clearCoolingThresholdDays() + { + unset($this->cooling_threshold_days); + } + + /** + * Optional. Time in days to mark the volume's data block as cold and make it + * eligible for tiering, can be range from 7-183. Default is 31. + * + * Generated from protobuf field optional int32 cooling_threshold_days = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setCoolingThresholdDays($var) + { + GPBUtil::checkInt32($var); + $this->cooling_threshold_days = $var; + + return $this; + } + +} + diff --git a/NetApp/src/V1/TieringPolicy/TierAction.php b/NetApp/src/V1/TieringPolicy/TierAction.php new file mode 100644 index 000000000000..a36b3b7e7ebe --- /dev/null +++ b/NetApp/src/V1/TieringPolicy/TierAction.php @@ -0,0 +1,63 @@ +google.cloud.netapp.v1.TieringPolicy.TierAction + */ +class TierAction +{ + /** + * Unspecified. + * + * Generated from protobuf enum TIER_ACTION_UNSPECIFIED = 0; + */ + const TIER_ACTION_UNSPECIFIED = 0; + /** + * When tiering is enabled, new cold data will be tiered. + * + * Generated from protobuf enum ENABLED = 1; + */ + const ENABLED = 1; + /** + * When paused, tiering won't be performed on new data. Existing data stays + * tiered until accessed. + * + * Generated from protobuf enum PAUSED = 2; + */ + const PAUSED = 2; + + private static $valueToName = [ + self::TIER_ACTION_UNSPECIFIED => 'TIER_ACTION_UNSPECIFIED', + self::ENABLED => 'ENABLED', + self::PAUSED => 'PAUSED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/NetApp/src/V1/Volume.php b/NetApp/src/V1/Volume.php index 5fc1de1f8bbc..d4bad094dd85 100644 --- a/NetApp/src/V1/Volume.php +++ b/NetApp/src/V1/Volume.php @@ -210,6 +210,12 @@ class Volume extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; */ private $restricted_actions; + /** + * Tiering policy for the volume. + * + * Generated from protobuf field optional .google.cloud.netapp.v1.TieringPolicy tiering_policy = 34; + */ + protected $tiering_policy = null; /** * Constructor. @@ -288,6 +294,8 @@ class Volume extends \Google\Protobuf\Internal\Message * BackupConfig of the volume. * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_actions * Optional. List of actions that are restricted on this volume. + * @type \Google\Cloud\NetApp\V1\TieringPolicy $tiering_policy + * Tiering policy for the volume. * } */ public function __construct($data = NULL) { @@ -1169,5 +1177,41 @@ public function setRestrictedActions($var) return $this; } + /** + * Tiering policy for the volume. + * + * Generated from protobuf field optional .google.cloud.netapp.v1.TieringPolicy tiering_policy = 34; + * @return \Google\Cloud\NetApp\V1\TieringPolicy|null + */ + public function getTieringPolicy() + { + return $this->tiering_policy; + } + + public function hasTieringPolicy() + { + return isset($this->tiering_policy); + } + + public function clearTieringPolicy() + { + unset($this->tiering_policy); + } + + /** + * Tiering policy for the volume. + * + * Generated from protobuf field optional .google.cloud.netapp.v1.TieringPolicy tiering_policy = 34; + * @param \Google\Cloud\NetApp\V1\TieringPolicy $var + * @return $this + */ + public function setTieringPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetApp\V1\TieringPolicy::class); + $this->tiering_policy = $var; + + return $this; + } + } diff --git a/NetApp/tests/Unit/V1/Client/NetAppClientTest.php b/NetApp/tests/Unit/V1/Client/NetAppClientTest.php index 596652724877..ae89b079a418 100644 --- a/NetApp/tests/Unit/V1/Client/NetAppClientTest.php +++ b/NetApp/tests/Unit/V1/Client/NetAppClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Location\GetLocationRequest; @@ -105,6 +104,7 @@ use Google\Cloud\NetApp\V1\VerifyKmsConfigRequest; use Google\Cloud\NetApp\V1\VerifyKmsConfigResponse; use Google\Cloud\NetApp\V1\Volume; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/NetworkConnectivity/.repo-metadata.json b/NetworkConnectivity/.repo-metadata.json deleted file mode 100644 index 15938e537d21..000000000000 --- a/NetworkConnectivity/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-network-connectivity", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-network-connectivity/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "networkconnectivity" -} diff --git a/NetworkConnectivity/VERSION b/NetworkConnectivity/VERSION index 8af85beb5159..9075be495155 100644 --- a/NetworkConnectivity/VERSION +++ b/NetworkConnectivity/VERSION @@ -1 +1 @@ -1.5.3 +1.5.5 diff --git a/NetworkConnectivity/composer.json b/NetworkConnectivity/composer.json index 7424be793d30..516c32aa88d8 100644 --- a/NetworkConnectivity/composer.json +++ b/NetworkConnectivity/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/NetworkManagement/.repo-metadata.json b/NetworkManagement/.repo-metadata.json deleted file mode 100644 index 2f27e7b71acf..000000000000 --- a/NetworkManagement/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-network-management", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-network-management/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "networkmanagement" -} diff --git a/NetworkManagement/VERSION b/NetworkManagement/VERSION index 943f9cbc4ec7..661e7aeadf36 100644 --- a/NetworkManagement/VERSION +++ b/NetworkManagement/VERSION @@ -1 +1 @@ -1.7.1 +1.7.3 diff --git a/NetworkManagement/composer.json b/NetworkManagement/composer.json index 3eea9727a801..e746cc0daab1 100644 --- a/NetworkManagement/composer.json +++ b/NetworkManagement/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/NetworkSecurity/.repo-metadata.json b/NetworkSecurity/.repo-metadata.json deleted file mode 100644 index 28c127346924..000000000000 --- a/NetworkSecurity/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-network-security", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-network-security/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "networksecurity" -} diff --git a/NetworkSecurity/VERSION b/NetworkSecurity/VERSION index 844f6a91acb9..ef5e4454454d 100644 --- a/NetworkSecurity/VERSION +++ b/NetworkSecurity/VERSION @@ -1 +1 @@ -0.6.3 +0.6.5 diff --git a/NetworkSecurity/composer.json b/NetworkSecurity/composer.json index 28da8ddbab52..5d867174522f 100644 --- a/NetworkSecurity/composer.json +++ b/NetworkSecurity/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/NetworkSecurity/src/V1/Client/NetworkSecurityClient.php b/NetworkSecurity/src/V1/Client/NetworkSecurityClient.php index 2ad412876d46..f8d3d81f64b3 100644 --- a/NetworkSecurity/src/V1/Client/NetworkSecurityClient.php +++ b/NetworkSecurity/src/V1/Client/NetworkSecurityClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -61,6 +60,7 @@ use Google\Cloud\NetworkSecurity\V1\UpdateAuthorizationPolicyRequest; use Google\Cloud\NetworkSecurity\V1\UpdateClientTlsPolicyRequest; use Google\Cloud\NetworkSecurity\V1\UpdateServerTlsPolicyRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -177,6 +177,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * authorization_policy resource. diff --git a/NetworkSecurity/tests/Unit/V1/Client/NetworkSecurityClientTest.php b/NetworkSecurity/tests/Unit/V1/Client/NetworkSecurityClientTest.php index 8f9e4dfc8feb..c4c12d316d6f 100644 --- a/NetworkSecurity/tests/Unit/V1/Client/NetworkSecurityClientTest.php +++ b/NetworkSecurity/tests/Unit/V1/Client/NetworkSecurityClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Iam\V1\GetIamPolicyRequest; @@ -59,6 +58,7 @@ use Google\Cloud\NetworkSecurity\V1\UpdateAuthorizationPolicyRequest; use Google\Cloud\NetworkSecurity\V1\UpdateClientTlsPolicyRequest; use Google\Cloud\NetworkSecurity\V1\UpdateServerTlsPolicyRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/NetworkServices/.OwlBot.yaml b/NetworkServices/.OwlBot.yaml new file mode 100644 index 000000000000..76f29e1e1115 --- /dev/null +++ b/NetworkServices/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/cloud/networkservices/(v1)/.*-php/(.*) + dest: /owl-bot-staging/NetworkServices/$1/$2 +api-name: NetworkServices diff --git a/NetworkServices/.gitattributes b/NetworkServices/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/NetworkServices/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/NetworkServices/.github/pull_request_template.md b/NetworkServices/.github/pull_request_template.md new file mode 100644 index 000000000000..edf73190827a --- /dev/null +++ b/NetworkServices/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `NetworkServices/src`, and tests in `NetworkServices/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/NetworkServices/CONTRIBUTING.md b/NetworkServices/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/NetworkServices/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/NetworkServices/LICENSE b/NetworkServices/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/NetworkServices/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/NetworkServices/README.md b/NetworkServices/README.md new file mode 100644 index 000000000000..688292532f5f --- /dev/null +++ b/NetworkServices/README.md @@ -0,0 +1,45 @@ +# Google Cloud Network Services for PHP + +> Idiomatic PHP client for [Google Cloud Network Services](https://cloud.google.com/products/networking). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-networkservices/v/stable)](https://packagist.org/packages/google/cloud-networkservices) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-networkservices.svg)](https://packagist.org/packages/google/cloud-networkservices) + +* [API documentation](https://cloud.google.com/php/docs/reference/cloud-networkservices/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/cloud-networkservices +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/google-cloud-php-networkservices/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://cloud.google.com/products/networking). diff --git a/NetworkServices/VERSION b/NetworkServices/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/NetworkServices/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/NetworkServices/composer.json b/NetworkServices/composer.json new file mode 100644 index 000000000000..ff83c0717b40 --- /dev/null +++ b/NetworkServices/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/cloud-networkservices", + "description": "Google Cloud Network Services Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Cloud\\NetworkServices\\": "src", + "GPBMetadata\\Google\\Cloud\\Networkservices\\": "metadata" + } + }, + "extra": { + "component": { + "id": "cloud-networkservices", + "path": "NetworkServices", + "target": "googleapis/google-cloud-php-networkservices" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/NetworkServices/metadata/V1/Common.php b/NetworkServices/metadata/V1/Common.php new file mode 100644 index 0000000000000000000000000000000000000000..ced22555a28e0bda23dd6e53811e2908d4937469 GIT binary patch literal 1930 zcmcIl+iu%N5RD|qiC3-TFhL@yD6*9UL8zeCpyz5FsBAY2?s=3QBzXlgwuqPl+FabiHajjRRLu7U0C;FmR!{ zg;UJL_F>3m{<}D5HBL$*%V7@!0X!hS-Gj*GG!%@FrKw@eKoo^czBIS8un8QU;%3Ux zFs_i?#e&ChK03x6M9hO7#XA8wE&ka{YG#Ji-lO1q9XKHi%D7>iWpxI!%(Y0&qOvK1 z%){lrsvu9kqgnc<=M~xRNo_O>ehJ%0==~ac{BJ~|JxHx}B_aKig!Dzbo*A^1hGZvN zA}5^6s_{!1-98KxCCjens?wgJs>?yD+ez$eC0uG&x9fTqEeF$!>^qge%!<}VHzDv+ zm-0Vzxr0^(;Zg;)igZ{@ac-lP1@K92;HwyR07P@0`GM!R)%(yrLA6%(VO+(j1`5wva zD=D*5nFlN}uq;hq53X6W8LyN!-dCg3~s^du`=KQG(onxtPs)blnB6SOSM z^K13rE9maBBkk7``g$1!M_x5~?t=DZIl6U`NK`A!>Q%R`{~>f# z@1pe!1&Or#2&Fwprlm?-X{xNr_NNC6;>RFaWoj!oD5_roQ3WqDdV;n_eaq~bmgx-5 zPJif(Oso6c>Ao0P{TBn%`QhMb-0u$d2L0Z~HSJ5ZmY$mjFE>i(UWdbta%UZVk!iyb z??UK&ETK&~@1Lgp-{sUw$h;*jGzL zS4%|CmdH`Ii1g$3AGw8{?U{Vh16vi+Vj$vE^GK}N)WL3?Mr;m!k_c$Hn S=cfK=C%&>w=kh5!Md%Y%t$Vuw literal 0 HcmV?d00001 diff --git a/NetworkServices/metadata/V1/Dep.php b/NetworkServices/metadata/V1/Dep.php new file mode 100644 index 0000000000000000000000000000000000000000..42c11411c28f82972ec10af861f1f0e4e725d52b GIT binary patch literal 9040 zcmeHN&2QVt6))x3vB%v+nS5C5O=7N+MI0lMU}cLm%6hl7r8q`q*_9Pzw-8ED)W~K- zlU$Or*A0AVfue`)t>>Ql1#D5EK)dKa&_m%KT67N!!2I*DzS*G`J^G&4`qLs$c}6Kwr-npz13_ISJv%4 z$1sVTk>$dMT;8b4#ll+kbujhpmaCJzykpxtCduli-D+el;vd-VQ;)d&hEBZf{$jR4 zoJ`;qAxqmMo}=kRUfonqpZtMZvbbeEuY+6BoS%Lb0E7mI2u_THXt4L*Izwszc>Wf|5^ZNs5SG91VucM2_L zJNVS0DQtRi&+!jOFb(!(tGP z@WR|z5F%m?UTRDp1IG`BbsWwU_?*3q&UH?OUqk0~Vyff=2R5CC+ZN&Mza=ykdWeJI z3YyYd{;usB{$UV%0F8t%p|iYn!oowq)=<)GIgaf@omR;{FxN|+fw<1)7W&6UhgT0B zLIaU-7M-P=X1Dy*cmVmU!h_hTBXo*gO_l+XHx=X30KjCsnv|v#-+i%WOB~xB}CEo#?)oea8Pf z%9^&$%60ac_!Ay>@exeSy6Q8QLMn6NI$F3GGd732AEtjJq3b2X^SjsORml4-D28|q zO*onhNyr7_0qoPilzVuDP$3r`ZHK5Hw7Ef=j5CtWAQU|J?Wd5Wp>Rm}BARF#CbX^~ z7hFvwd>KvJE+nj4KMXX0r|b_TG}ki}&w&P$;0n+y1~3moqbhq(Fk*<5!87Q*1<SdT!f^oI#Fw-TsQ_uh)hPH}5* zqM0~kRiklI9ujyPU5XnOZ24&Lv*eyb$Ype;6Edz$L%I0#cYpWkWMWcE{~pNkBv9Ml zXq*T#Z72e^#|d)Sm@@A63W+rYqcAEiB$g8$A$?staw|6&P;tRM-7EtVfavHY=wqL(dv2il5d zC*Zg|c&Y5PWQEeD>})TS7t9D_y<9T-DE(^*U1fD8;!~*TYNSBk4+`WW9y+}LYI*#= zgs$}ngBQm#g0?}8fFw%e;?U_aWMS0NY)}|GK^7PnJCuYYJT!sQ-%OxuqA12sbZVQK z4qA-}nvrr?LC}*$5$DBlc);W8MocL@1|o=37>~hdg)lxCRt8Ten3y8?9SBAg!T4ZK zhdF%<;KC2-ky)Ho@hrMh+%A@@YW2O%qWYw~wOL$Qd$d+8BtHjz;rUAOD^H4BRrPUE zDHJPPNeL&>=f%V2jlz4$1QgF?rMR`ZQQj(sJU5oUGzn7_q?V8xYw#&mzcx#>hSUOf}w_>kkE`+1R?=jDn zdu-e8#GN%_AA&9i0Bxj4-S&L!!3KW}unDmp0k&SI1H$&J;b4D!mLMb8aBLLUSbU@&|V`Twd=6AV}{K1cCnc$}k97nje6kA{n8XgGz zM-YzK4s8J8h_w^J_P>?xVa~M?G^AY{@8d5Frj4Bi*~7n;(8ZV@4?h&i-}Blf#!3V? zd~1;|v}>Y>=H(j}2_*}P_@e~6B4n-eHSQ01yrGDxj~f0I()x{<<8~Y~vnNvMb{>DI z5Jnye8T@j3v>ndJw6pjpfRoU%p>c{g91y3U4T013ZZz&hmG5i0$3poc!1d9+&agdT zPb^X|By>dxSEtDUjEXlL5UKY^*1P))j4H#X&urybx&HFY@;@k94Y+0RCnw93(3fsfRo|4py3RyL{B8$#^gDL+EpiT&Mo9>&Zunxz*rnkjx7G8YEL@UxV-_*vo7$9*Yq*{=ta&VnmFo!6zdx5^3fp spAY=x^ASh+{PtpfBB)IFZiPQP-(jC*w0*(R^XrXZB>T$Z2pu8xAC@>P!2kdN literal 0 HcmV?d00001 diff --git a/NetworkServices/metadata/V1/EndpointPolicy.php b/NetworkServices/metadata/V1/EndpointPolicy.php new file mode 100644 index 0000000000000000000000000000000000000000..6d16490baf6516f855ead7843eadb90caae3c517 GIT binary patch literal 3659 zcmb_fO>g5=6eVdpkQX{_4I@GasgF#h=}1#&S~>{16qK(<88wL~O{*!2upH;5HFa!b zzZ5c6V1dK}_!TVqDXiJBW8I%HE3V(O-8f0rq?&GOIrrndbMHI%`pd8FGaEg^C1Mgs zrKF8peN4{?wjGOFnq}ZtuhSt8)~v3r8^jSYF4SnE8h=flq>(n3_ z&9Hjyj7jJZmUHeB=R((ro4MG^5VLJtx=9t=GIXskvJ42BYL~dSsu5h0a}`3>wo27z zi3MxsySjmA;xVxJyWB)Wn#~vW@=>P3Fa|9+jZLlLiTWgPWCtgewt;I630}HW`VexqubPS zWH6PaQ$j;#y*C?A{Ip&;y@NM6MoAh2xreFKBg5G-b_ne`<}SnS1sH@+%?aFPZN0g# z6Qi9YXX=G+Ig)gJs_P&(xz>qa*r~m4DpoUZb-R{1efp4B2EU@Z=XdaJ=+IYG?b?%l zSuHoef_`L`%eLELq4uHAH$rMXq93DwAE4)VYH(qVyNT>xh$Htxyx3a(*pI8)ddBfd z=a*yk>1`?DRsyrWb#MdO#e%lXbiC>-UEt5R@Udh<3mTBb4bp$ShwewOl(2&4y(^lE z;n+qZH}_vQF6^MB<`7T|#q&?a;g{t0s^}jy2rh;d@Vw?cubvH;+xMEA&Pzu347EiJ zH#LvvAkA)&<|aPHD1PyPc^6IU^gSFg;RwyszD-gK0O0<1Zq|6w@C}H>NqL1nRD1Ny za`e|AJC^CoTZqNLt^r7gDlRdI2AY*ZEb7j!Q5)P_2IoWHmvfs!$+jUUXI8(?x^AAI= zZldH+zX(Y*cTW1e^@T;WaG@GK-tP%1{zWYPEfU7tL0Ct)SS`r4aQhP{c^Fe{0`i!#lv!;n9tS~xn6s9vK$kZP_k5)^U7hdeq5|C$EBaHvX^Kx zY#BaFM_VR}KzIT7?>i``o4NF#1{uTBSWm*c;BgSnW5%WqGx{>@GMi1)LHhR?dU&9_ zG?D^L>*V_$h^tUU_iWXH3i#^q9Ms`WHY3akc?BhG^^_p-(2Gac#?ViSPogM2`Sa0huQonOl20a>l;!5n3|IkFczGz&Hv|=MrfJrAj2q zNI&2sAJIymjTsA={s&0UGkJ|d3X;4f($|m>C9ALKZN|Q@@)fi+V!-M!JC{s!(tpCS zj+p*WKGyYk@CFuZs7XU5TnV_~OaRHp(X0jMAY15R0R)Yb$r#^8eRIDqphqC}w>4z$ zgD3{sTQ=p`Hx)kkf~^8(#;G;7Zo@o*jeA5m?AGqso4?{~CAMmdYAMg2kUrX(}aEeDxT(HB#Fh5q>(_91V-84Vs{#VjcFw~Xm5KINYsLtiO3 PexWc+{v9zu1BCtu@jv!t literal 0 HcmV?d00001 diff --git a/NetworkServices/metadata/V1/Gateway.php b/NetworkServices/metadata/V1/Gateway.php new file mode 100644 index 0000000000000000000000000000000000000000..47966104bb94cfe9dd1bbd42fb30280ea9bcfbfc GIT binary patch literal 2567 zcmbtW!EW0|5Upg%iAHs6vu>mM&}@~UQGl9)(;Nyqb}PxWY9N+XTXv8_06|eJnH5d4 z+?7)`)gSardg*`kD|!wP^xjivmrKT$ZA3wI5wV$}{wJ@+@f(H0rl9;4`c)pjuU9qtA` z5e^5wLn{wSj45pIhXFFMMUu4If)pgAyXSKn`L@^Hq0EWgkOxs4O$}p6c}k@?sXSC+ z1)Mt|l{iPkxRT@+;nA30j7~^I`8e`7W!?f{nm%=}A*~j=-CdV@{W?9h&)pz0j5oJ> z19Fq=Ayt)}+bg9*M%}mBX#R+)Z^uO)aQiI0-dC1jecM%p*ZTdG-(A#WC1phL^8j8i z!TLK1QM((P>r%J+jBfSwjkV7eo*lZ?NO2U4crDSqlr-w1IuP_*XUK%IQ0Udvf+yFF z4a)!K;Fc1zwgNfP6{QTxR0{Qle`;CnGbk|X4J^;~N2R6Yd_j8*MJJ-z1eO3SW${h% z(VDLAl0?%}as`_78i&|t%4=ahuRU1w>>l-4DMuDC%;O}?O_b^CLi$tbX8Jsuhy*fP z35tEyG1zpad~%_T_C4hIB&4N9Jo@O-`rIKp=p?Z7ng;nWh&U@1G0S{R-=~mgPJpnt zWu!%Mt%RN{{I{fvbs946N|a)Zwi9Qaw$pUf|&P3w%6F9;eCB#j{~N zF{kC<;ghE>;|hu$(qG2dfZ8@JhIT}KuH>g9SO3*2+Po>PKq0h;)M7Yur5;5^Kpyd6 zME#ObTcJFH)yvUYh$&OefZHlVh6xCnRp!-zb_YK8>95?n5KJ^gq5LDPG;tuuH%~75 zGd)&eo(ut?e+;xi6>A>m^^(dz^*}PX->aR0!4;$odlBs{FqPE4C zyq)=JKb~R9Hvn5~7+hIiu>Ej0<{Tq7et*0J(?Wuo2&pqeTdrp13D+%#6u?rVG+I_!$@Ap1;AI&>m2X4r9 zVi8xRM3;AZGVK!CacydAwkhxU?KW{`&E9hilek4$Ufht^H@4*3;>y;?DC*h1tC6zY zvF(mYN}6f=ddVX6rS0x|#N9VE;+6JiN*&kH6xa4CDROWCOWh-$qiRI1H>zuds=7+m zR-NOt78p)z{U}cB*~}b(W~!bi*AcJD;NUgL_~-aLrlH9mRVn_vX?TiZ8Prfs<9jsg zvD{WokD&C)y=~vps9{?&6WFjcQn(`vOt$x?VRO)*Hmx!f5>hb7(`Uv zb557#-n;k22z*u1^~g0#7|(@>Oh)Z(`1?b+KWHFJ*M&rphko%`=oj~Aa@PV#)iFwL zz_3Vy+(*F@PYH~wk{-|)tcPh8t+$zTl|3XY*b$swigwVD5wRiv<7G%k$s%2XVU~B< zgq$d(t3&@(lF~G!Jz};M)3A24ZkS z!AuUMhWe9w3L~bvLrgC_EDzx^Uxde;MQSlJskq7oYZi5TOofD$g^V8LBnD(Q6`GV_ zrgm+Q^2(DP!IJ_C=3oTFs7t(Tnt%KhVcu14!HwhI6vm??y&{&x(i#d$U%^-h?R}~C zyex3>A{Q^fC+`uj3o&UKQm${}>7(5EhXWYTOJEa)xi52Xl90ht+O_pHm1Lxof`l+hEm)@2tn;N80UpNsO&r_0uGUNzO=`W&oajcD>6)Ksz(%$SRR(-eS%I- z6vjB>@`X2vM1CHI*%{ImnA&>Ls43g)n~mDS%F;@0aq5DUhE(l&WnpWIIZ$fW>f5W8 zrc!&}Xx272S2otClGRIaQ8{`>?#~2dmWiqp_q21*CLhs=a{I+5l;C8eVac zf$_*@(CUuu3SBd^=Z3B@uw`a#jzWqbBt3vk+jvEEC2qvE(1@r|haFldb``)OIJsF= z?TF%@;;_|87*}F&)d|QbhdXm<5Z8fK*)FAy!loJDDAtXoaw{=#y|lc&PnEqx8+ zu>cXGgXK^xpn2d)I!w1&OyRg01eN0OsNz*1Gdmypp^r{>S}=)IN-)ZrFwVQ!BUm3k z+r2^nEfqus%8YTTLE37Jb`F{QB?0NE-AGSibdR+d#zhqn!B9`lJg+AF;d zejSudTjM1TzlA>!_=Sh-hF^JOblGj?Apb)GK3Fw88VxXBlYHl6*}_3$#8F+$NS;jT z>U~}s?@IkEcL~xCrnBPVrAJgpNy0p5pQw#hRCK1i3)9Cn@ElAfBFzU)oa-8T_HO^4 zm9D}?i@c&r>`YE|ej6^=@nRJ67~1^g$UGWY+`l{We8Ms>WFJ_o=P-?p zg-~)rsdIX(`fmbmV4HtmJXI&7lN;>1-AH`1Cdy}U`Czkm$3F4QfO9#%G#pE1XJ_uj zmtT|D>-?RexWL{SitFN?A(%0|;*v literal 0 HcmV?d00001 diff --git a/NetworkServices/metadata/V1/HttpRoute.php b/NetworkServices/metadata/V1/HttpRoute.php new file mode 100644 index 0000000000000000000000000000000000000000..0953f461d643b9f753622093ef5e65d24de80fb5 GIT binary patch literal 6027 zcmb_g&2!t<5f3R-78kNCL$*w@ZGy^4t*8xYF=?lzYbz8|h|^kwgUn z=mV&aW;E03q5nWyZhVS zx4&NY`#wC-)`&}}5fV$=JJG^E(R}KKp6NN--k{qhR5QH;-*yNsXj-kIZ8zFly|&T* zF^UG>fSRPN^*pcVkfP~$1FPtg@W`Y40ilPsNrK|xQn4R~zD~VCND3Srz%>p?;2S2< z)|x9@Bs44|G&*Y>r&DD(o$a$Yo##uB0ZhjT0&N}fS_}?80S*88gFVMKwIDP?{O@f$ z&~4WaZNstujMsXibqyyVD1C8nci@_#?YSBgXt*X>cvlmcZ13B?hh})9MT#|>vq9x5Jzelu+zjv8)^#e4P+#ydd#yi5uB4We* zf8T^`OcwPH++e)RrL@#Sc4h4AN?M(TY(Si@?%3{rPKnmX)Ep?53~lslE**VIsULu1 zQiAzHXNTp+@QYH)7o;5`O$xDZ*g0cNYTzTsrPPh&I1b8$eQ8q8U*Ul> zF5@i4^(#C)1B%^qJxX-b2uO}=rLMtEVbOpSELkv*cuM^Urq5k23hAc_e1D1cnTwiu zd2Wup4hq)X&~|yjK{8LuMnfM-ZHq4}ormxaYg|~*aV`t280J0(z>a88SWF!eyVnmz zMCAWA1`{n}*_4c`osqN{@t`x2eI1XBwJAiIn2Ays0f88tKW z|46~)8PFfWT&up*Y;5n;^=hM5*LSyfn)T|&>PEdb{f3I4w;IpuHN9DHZB@4G+wIMd z^;&(kvb))yPN`YQtTuMHYtw1uU3RBl*BkBidTV+Nl~vpIt!ATDX??7>u!n5btL^C< zY(0h=u4nT9NyFV$W8j1v?jO+?ScjS(ws|LN8!{Ggj1%q*rBqK~#>?;uH3r5|jXksv z4}<>$YK4L2pFu{z7eK*WNi2O-^|?s(xNb(Rl&S*w1iNcDGU zgFxoB%OpNc!<1yHXW7_5P_+SL0b#k2m9CXYfoqhmvp9tv67n*}01b=f)7J#V22B7W zBPluX4jFy0=3_peh!4Z$y-$Savn;V68qPqNCtFVcGR5}BIIr5f46xhUYzeBWKY$s| z>2nO`$(9uwnFj=~Ip6a>C@q4OT*hS%rmn2Qw{#qz=L@n^N}b;EZ_2+qEbwN?s&sOGa{P{>v0V z)uVyL#HP#;iqg5N!)%x3IDE0nB&Yk_ zr@THZrR4;mmnAp#1>C11Vx)2P1DOf1;4`&c>-lexV;EBBZ{%uP)b)*jD?9{vGhZh3nU@aXioS8+>6YAz!@947dUK^ z-sm#oqmfLcY6Qw&a7rnOk%mOif0lx5{G?D<8TatrfRq-cA_?k9|GEm}_y&m{k;(Wr z!ruIQpp3koSQG!h>Ok53rm_zUuXxbK&oXrx3ozqfQ2a#xIxRY$$(u}Ei+-N+Q5IJV zS9uAhEW@16|0MRDI zJ3l=$X^=O*zB}f>NWpBCPZ?r+M$oTs&OG+?@jz0y#Y<4mL#hD7Z?YUGFcg1?&;K2@ z-{sSe3)&CoAZ&~y3-!h6Njw!3GlH{PiE5KrtB+t7J5hYpUQp^ay|waf3LfBF>s9fz zG8LcPWP{XZ>cy65JLT|*jc9t_g#j{-Z*Ycuj>`Vt;|nYQOux0pC&+~=n;;jq#ROSC z^n$|krLUqL9XVuNzV(Ia+%|l%jbZ~<>yO#internalAddGeneratedFile( + ' +÷ +*google/cloud/networkservices/v1/mesh.protogoogle.cloud.networkservices.v1google/api/resource.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"¯ +Mesh +name ( BàA + self_link ( BàA4 + create_time ( 2.google.protobuf.TimestampBàA4 + update_time ( 2.google.protobuf.TimestampBàAF +labels ( 21.google.cloud.networkservices.v1.Mesh.LabelsEntryBàA + description ( BàA +interception_port (BàA- + LabelsEntry +key (  +value ( :8:_êA\\ +#networkservices.googleapis.com/Mesh5projects/{project}/locations/{location}/meshes/{mesh}"w +ListMeshesRequest; +parent ( B+àAúA%#networkservices.googleapis.com/Mesh + page_size ( + +page_token ( "d +ListMeshesResponse5 +meshes ( 2%.google.cloud.networkservices.v1.Mesh +next_page_token ( "K +GetMeshRequest9 +name ( B+àAúA% +#networkservices.googleapis.com/Mesh"  +CreateMeshRequest; +parent ( B+àAúA%#networkservices.googleapis.com/Mesh +mesh_id ( BàA8 +mesh ( 2%.google.cloud.networkservices.v1.MeshBàA"ƒ +UpdateMeshRequest4 + update_mask ( 2.google.protobuf.FieldMaskBàA8 +mesh ( 2%.google.cloud.networkservices.v1.MeshBàA"N +DeleteMeshRequest9 +name ( B+àAúA% +#networkservices.googleapis.com/MeshBê +#com.google.cloud.networkservices.v1B MeshProtoPZMcloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespbªGoogle.Cloud.NetworkServices.V1ÊGoogle\\Cloud\\NetworkServices\\V1ê"Google::Cloud::NetworkServices::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/NetworkServices/metadata/V1/NetworkServices.php b/NetworkServices/metadata/V1/NetworkServices.php new file mode 100644 index 000000000000..40934b680b86 --- /dev/null +++ b/NetworkServices/metadata/V1/NetworkServices.php @@ -0,0 +1,110 @@ +internalAddGeneratedFile( + ' +¬N +6google/cloud/networkservices/v1/network_services.protogoogle.cloud.networkservices.v1google/api/client.proto5google/cloud/networkservices/v1/endpoint_policy.proto-google/cloud/networkservices/v1/gateway.proto0google/cloud/networkservices/v1/grpc_route.proto0google/cloud/networkservices/v1/http_route.proto*google/cloud/networkservices/v1/mesh.proto5google/cloud/networkservices/v1/service_binding.proto/google/cloud/networkservices/v1/tcp_route.proto/google/cloud/networkservices/v1/tls_route.proto#google/longrunning/operations.proto2™H +NetworkServicesÚ +ListEndpointPolicies<.google.cloud.networkservices.v1.ListEndpointPoliciesRequest=.google.cloud.networkservices.v1.ListEndpointPoliciesResponse"EÚAparent‚Óä“64/v1/{parent=projects/*/locations/*}/endpointPoliciesÄ +GetEndpointPolicy9.google.cloud.networkservices.v1.GetEndpointPolicyRequest/.google.cloud.networkservices.v1.EndpointPolicy"CÚAname‚Óä“64/v1/{name=projects/*/locations/*/endpointPolicies/*}µ +CreateEndpointPolicy<.google.cloud.networkservices.v1.CreateEndpointPolicyRequest.google.longrunning.Operation"¿ÊAC +EndpointPolicy1google.cloud.networkservices.v1.OperationMetadataÚA)parent,endpoint_policy,endpoint_policy_id‚Óä“G"4/v1/{parent=projects/*/locations/*}/endpointPolicies:endpoint_policy· +UpdateEndpointPolicy<.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest.google.longrunning.Operation"ÁÊAC +EndpointPolicy1google.cloud.networkservices.v1.OperationMetadataÚAendpoint_policy,update_mask‚Óä“W2D/v1/{endpoint_policy.name=projects/*/locations/*/endpointPolicies/*}:endpoint_policy† +DeleteEndpointPolicy<.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest.google.longrunning.Operation"ÊAJ +google.protobuf.Empty1google.cloud.networkservices.v1.OperationMetadataÚAname‚Óä“6*4/v1/{name=projects/*/locations/*/endpointPolicies/*}º + ListGateways4.google.cloud.networkservices.v1.ListGatewaysRequest5.google.cloud.networkservices.v1.ListGatewaysResponse"=ÚAparent‚Óä“.,/v1/{parent=projects/*/locations/*}/gateways§ + +GetGateway2.google.cloud.networkservices.v1.GetGatewayRequest(.google.cloud.networkservices.v1.Gateway";ÚAname‚Óä“.,/v1/{name=projects/*/locations/*/gateways/*}€ + CreateGateway5.google.cloud.networkservices.v1.CreateGatewayRequest.google.longrunning.Operation"˜ÊA< +Gateway1google.cloud.networkservices.v1.OperationMetadataÚAparent,gateway,gateway_id‚Óä“7",/v1/{parent=projects/*/locations/*}/gateways:gateway‚ + UpdateGateway5.google.cloud.networkservices.v1.UpdateGatewayRequest.google.longrunning.Operation"šÊA< +Gateway1google.cloud.networkservices.v1.OperationMetadataÚAgateway,update_mask‚Óä“?24/v1/{gateway.name=projects/*/locations/*/gateways/*}:gatewayð + DeleteGateway5.google.cloud.networkservices.v1.DeleteGatewayRequest.google.longrunning.Operation"ˆÊAJ +google.protobuf.Empty1google.cloud.networkservices.v1.OperationMetadataÚAname‚Óä“.*,/v1/{name=projects/*/locations/*/gateways/*} +ListGrpcRoutes6.google.cloud.networkservices.v1.ListGrpcRoutesRequest7.google.cloud.networkservices.v1.ListGrpcRoutesResponse"?ÚAparent‚Óä“0./v1/{parent=projects/*/locations/*}/grpcRoutes¯ + GetGrpcRoute4.google.cloud.networkservices.v1.GetGrpcRouteRequest*.google.cloud.networkservices.v1.GrpcRoute"=ÚAname‚Óä“0./v1/{name=projects/*/locations/*/grpcRoutes/*}‘ +CreateGrpcRoute7.google.cloud.networkservices.v1.CreateGrpcRouteRequest.google.longrunning.Operation"¥ÊA> + GrpcRoute1google.cloud.networkservices.v1.OperationMetadataÚAparent,grpc_route,grpc_route_id‚Óä“<"./v1/{parent=projects/*/locations/*}/grpcRoutes: +grpc_route“ +UpdateGrpcRoute7.google.cloud.networkservices.v1.UpdateGrpcRouteRequest.google.longrunning.Operation"§ÊA> + GrpcRoute1google.cloud.networkservices.v1.OperationMetadataÚAgrpc_route,update_mask‚Óä“G29/v1/{grpc_route.name=projects/*/locations/*/grpcRoutes/*}: +grpc_routeö +DeleteGrpcRoute7.google.cloud.networkservices.v1.DeleteGrpcRouteRequest.google.longrunning.Operation"ŠÊAJ +google.protobuf.Empty1google.cloud.networkservices.v1.OperationMetadataÚAname‚Óä“0*./v1/{name=projects/*/locations/*/grpcRoutes/*} +ListHttpRoutes6.google.cloud.networkservices.v1.ListHttpRoutesRequest7.google.cloud.networkservices.v1.ListHttpRoutesResponse"?ÚAparent‚Óä“0./v1/{parent=projects/*/locations/*}/httpRoutes¯ + GetHttpRoute4.google.cloud.networkservices.v1.GetHttpRouteRequest*.google.cloud.networkservices.v1.HttpRoute"=ÚAname‚Óä“0./v1/{name=projects/*/locations/*/httpRoutes/*}‘ +CreateHttpRoute7.google.cloud.networkservices.v1.CreateHttpRouteRequest.google.longrunning.Operation"¥ÊA> + HttpRoute1google.cloud.networkservices.v1.OperationMetadataÚAparent,http_route,http_route_id‚Óä“<"./v1/{parent=projects/*/locations/*}/httpRoutes: +http_route“ +UpdateHttpRoute7.google.cloud.networkservices.v1.UpdateHttpRouteRequest.google.longrunning.Operation"§ÊA> + HttpRoute1google.cloud.networkservices.v1.OperationMetadataÚAhttp_route,update_mask‚Óä“G29/v1/{http_route.name=projects/*/locations/*/httpRoutes/*}: +http_routeö +DeleteHttpRoute7.google.cloud.networkservices.v1.DeleteHttpRouteRequest.google.longrunning.Operation"ŠÊAJ +google.protobuf.Empty1google.cloud.networkservices.v1.OperationMetadataÚAname‚Óä“0*./v1/{name=projects/*/locations/*/httpRoutes/*}¾ + ListTcpRoutes5.google.cloud.networkservices.v1.ListTcpRoutesRequest6.google.cloud.networkservices.v1.ListTcpRoutesResponse">ÚAparent‚Óä“/-/v1/{parent=projects/*/locations/*}/tcpRoutes« + GetTcpRoute3.google.cloud.networkservices.v1.GetTcpRouteRequest).google.cloud.networkservices.v1.TcpRoute"<ÚAname‚Óä“/-/v1/{name=projects/*/locations/*/tcpRoutes/*}Š +CreateTcpRoute6.google.cloud.networkservices.v1.CreateTcpRouteRequest.google.longrunning.Operation" ÊA= +TcpRoute1google.cloud.networkservices.v1.OperationMetadataÚAparent,tcp_route,tcp_route_id‚Óä“:"-/v1/{parent=projects/*/locations/*}/tcpRoutes: tcp_routeŒ +UpdateTcpRoute6.google.cloud.networkservices.v1.UpdateTcpRouteRequest.google.longrunning.Operation"¢ÊA= +TcpRoute1google.cloud.networkservices.v1.OperationMetadataÚAtcp_route,update_mask‚Óä“D27/v1/{tcp_route.name=projects/*/locations/*/tcpRoutes/*}: tcp_routeó +DeleteTcpRoute6.google.cloud.networkservices.v1.DeleteTcpRouteRequest.google.longrunning.Operation"‰ÊAJ +google.protobuf.Empty1google.cloud.networkservices.v1.OperationMetadataÚAname‚Óä“/*-/v1/{name=projects/*/locations/*/tcpRoutes/*}¾ + ListTlsRoutes5.google.cloud.networkservices.v1.ListTlsRoutesRequest6.google.cloud.networkservices.v1.ListTlsRoutesResponse">ÚAparent‚Óä“/-/v1/{parent=projects/*/locations/*}/tlsRoutes« + GetTlsRoute3.google.cloud.networkservices.v1.GetTlsRouteRequest).google.cloud.networkservices.v1.TlsRoute"<ÚAname‚Óä“/-/v1/{name=projects/*/locations/*/tlsRoutes/*}Š +CreateTlsRoute6.google.cloud.networkservices.v1.CreateTlsRouteRequest.google.longrunning.Operation" ÊA= +TlsRoute1google.cloud.networkservices.v1.OperationMetadataÚAparent,tls_route,tls_route_id‚Óä“:"-/v1/{parent=projects/*/locations/*}/tlsRoutes: tls_routeŒ +UpdateTlsRoute6.google.cloud.networkservices.v1.UpdateTlsRouteRequest.google.longrunning.Operation"¢ÊA= +TlsRoute1google.cloud.networkservices.v1.OperationMetadataÚAtls_route,update_mask‚Óä“D27/v1/{tls_route.name=projects/*/locations/*/tlsRoutes/*}: tls_routeó +DeleteTlsRoute6.google.cloud.networkservices.v1.DeleteTlsRouteRequest.google.longrunning.Operation"‰ÊAJ +google.protobuf.Empty1google.cloud.networkservices.v1.OperationMetadataÚAname‚Óä“/*-/v1/{name=projects/*/locations/*/tlsRoutes/*}Ö +ListServiceBindings;.google.cloud.networkservices.v1.ListServiceBindingsRequest<.google.cloud.networkservices.v1.ListServiceBindingsResponse"DÚAparent‚Óä“53/v1/{parent=projects/*/locations/*}/serviceBindingsà +GetServiceBinding9.google.cloud.networkservices.v1.GetServiceBindingRequest/.google.cloud.networkservices.v1.ServiceBinding"BÚAname‚Óä“53/v1/{name=projects/*/locations/*/serviceBindings/*}´ +CreateServiceBinding<.google.cloud.networkservices.v1.CreateServiceBindingRequest.google.longrunning.Operation"¾ÊAC +ServiceBinding1google.cloud.networkservices.v1.OperationMetadataÚA)parent,service_binding,service_binding_id‚Óä“F"3/v1/{parent=projects/*/locations/*}/serviceBindings:service_binding… +DeleteServiceBinding<.google.cloud.networkservices.v1.DeleteServiceBindingRequest.google.longrunning.Operation"ÊAJ +google.protobuf.Empty1google.cloud.networkservices.v1.OperationMetadataÚAname‚Óä“5*3/v1/{name=projects/*/locations/*/serviceBindings/*}² + +ListMeshes2.google.cloud.networkservices.v1.ListMeshesRequest3.google.cloud.networkservices.v1.ListMeshesResponse";ÚAparent‚Óä“,*/v1/{parent=projects/*/locations/*}/meshesœ +GetMesh/.google.cloud.networkservices.v1.GetMeshRequest%.google.cloud.networkservices.v1.Mesh"9ÚAname‚Óä“,*/v1/{name=projects/*/locations/*/meshes/*}ì + +CreateMesh2.google.cloud.networkservices.v1.CreateMeshRequest.google.longrunning.Operation"ŠÊA9 +Mesh1google.cloud.networkservices.v1.OperationMetadataÚAparent,mesh,mesh_id‚Óä“2"*/v1/{parent=projects/*/locations/*}/meshes:meshî + +UpdateMesh2.google.cloud.networkservices.v1.UpdateMeshRequest.google.longrunning.Operation"ŒÊA9 +Mesh1google.cloud.networkservices.v1.OperationMetadataÚAmesh,update_mask‚Óä“72//v1/{mesh.name=projects/*/locations/*/meshes/*}:meshè + +DeleteMesh2.google.cloud.networkservices.v1.DeleteMeshRequest.google.longrunning.Operation"†ÊAJ +google.protobuf.Empty1google.cloud.networkservices.v1.OperationMetadataÚAname‚Óä“,**/v1/{name=projects/*/locations/*/meshes/*}RÊAnetworkservices.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBß +#com.google.cloud.networkservices.v1PZMcloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespbªGoogle.Cloud.NetworkServices.V1ÊGoogle\\Cloud\\NetworkServices\\V1ê"Google::Cloud::NetworkServices::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/NetworkServices/metadata/V1/ServiceBinding.php b/NetworkServices/metadata/V1/ServiceBinding.php new file mode 100644 index 000000000000..23a6be8c3ca8 --- /dev/null +++ b/NetworkServices/metadata/V1/ServiceBinding.php @@ -0,0 +1,59 @@ +internalAddGeneratedFile( + ' +‚ +5google/cloud/networkservices/v1/service_binding.protogoogle.cloud.networkservices.v1google/api/resource.protogoogle/protobuf/timestamp.proto"¿ +ServiceBinding +name ( BàA + description ( BàA4 + create_time ( 2.google.protobuf.TimestampBàA4 + update_time ( 2.google.protobuf.TimestampBàA +service ( BàAP +labels ( 2;.google.cloud.networkservices.v1.ServiceBinding.LabelsEntryBàA- + LabelsEntry +key (  +value ( :8:}êAz +-networkservices.googleapis.com/ServiceBindingIprojects/{project}/locations/{location}/serviceBindings/{service_binding}"Š +ListServiceBindingsRequestE +parent ( B5àAúA/-networkservices.googleapis.com/ServiceBinding + page_size ( + +page_token ( " +ListServiceBindingsResponseI +service_bindings ( 2/.google.cloud.networkservices.v1.ServiceBinding +next_page_token ( "_ +GetServiceBindingRequestC +name ( B5àAúA/ +-networkservices.googleapis.com/ServiceBinding"Ô +CreateServiceBindingRequestE +parent ( B5àAúA/-networkservices.googleapis.com/ServiceBinding +service_binding_id ( BàAM +service_binding ( 2/.google.cloud.networkservices.v1.ServiceBindingBàA"b +DeleteServiceBindingRequestC +name ( B5àAúA/ +-networkservices.googleapis.com/ServiceBindingBô +#com.google.cloud.networkservices.v1BServiceBindingProtoPZMcloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespbªGoogle.Cloud.NetworkServices.V1ÊGoogle\\Cloud\\NetworkServices\\V1ê"Google::Cloud::NetworkServices::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/NetworkServices/metadata/V1/TcpRoute.php b/NetworkServices/metadata/V1/TcpRoute.php new file mode 100644 index 000000000000..35505dfd4a1c --- /dev/null +++ b/NetworkServices/metadata/V1/TcpRoute.php @@ -0,0 +1,85 @@ +internalAddGeneratedFile( + ' +Ë +/google/cloud/networkservices/v1/tcp_route.protogoogle.cloud.networkservices.v1google/api/resource.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"À +TcpRoute +name ( BàA + self_link ( BàA4 + create_time ( 2.google.protobuf.TimestampBàA4 + update_time ( 2.google.protobuf.TimestampBàA + description ( BàAG +rules ( 23.google.cloud.networkservices.v1.TcpRoute.RouteRuleBàA; +meshes ( B+àAúA% +#networkservices.googleapis.com/Mesh@ +gateways ( B.àAúA( +&networkservices.googleapis.com/GatewayJ +labels + ( 25.google.cloud.networkservices.v1.TcpRoute.LabelsEntryBàA£ + RouteRuleJ +matches ( 24.google.cloud.networkservices.v1.TcpRoute.RouteMatchBàAJ +action ( 25.google.cloud.networkservices.v1.TcpRoute.RouteActionBàA5 + +RouteMatch +address ( BàA +port ( BàA‡ + RouteActionU + destinations ( 2:.google.cloud.networkservices.v1.TcpRoute.RouteDestinationBàA! +original_destination (BàAl +RouteDestinationC + service_name ( B-àAúA\' +%compute.googleapis.com/BackendService +weight (BàA- + LabelsEntry +key (  +value ( :8:kêAh +\'networkservices.googleapis.com/TcpRoute=projects/{project}/locations/{location}/tcpRoutes/{tcp_route}"~ +ListTcpRoutesRequest? +parent ( B/àAúA)\'networkservices.googleapis.com/TcpRoute + page_size ( + +page_token ( "o +ListTcpRoutesResponse= + +tcp_routes ( 2).google.cloud.networkservices.v1.TcpRoute +next_page_token ( "S +GetTcpRouteRequest= +name ( B/àAúA) +\'networkservices.googleapis.com/TcpRoute"¶ +CreateTcpRouteRequest? +parent ( B/àAúA)\'networkservices.googleapis.com/TcpRoute + tcp_route_id ( BàAA + tcp_route ( 2).google.cloud.networkservices.v1.TcpRouteBàA" +UpdateTcpRouteRequest4 + update_mask ( 2.google.protobuf.FieldMaskBàAA + tcp_route ( 2).google.cloud.networkservices.v1.TcpRouteBàA"V +DeleteTcpRouteRequest= +name ( B/àAúA) +\'networkservices.googleapis.com/TcpRouteBã +#com.google.cloud.networkservices.v1B TcpRouteProtoPZMcloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespbªGoogle.Cloud.NetworkServices.V1ÊGoogle\\Cloud\\NetworkServices\\V1ê"Google::Cloud::NetworkServices::V1êAr +%compute.googleapis.com/BackendServiceIprojects/{project}/locations/{location}/backendServices/{backend_service}bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/NetworkServices/metadata/V1/TlsRoute.php b/NetworkServices/metadata/V1/TlsRoute.php new file mode 100644 index 000000000000..1687a1119d3c --- /dev/null +++ b/NetworkServices/metadata/V1/TlsRoute.php @@ -0,0 +1,78 @@ +internalAddGeneratedFile( + ' +¸ +/google/cloud/networkservices/v1/tls_route.protogoogle.cloud.networkservices.v1google/api/resource.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"¢ +TlsRoute +name ( BàA + self_link ( BàA4 + create_time ( 2.google.protobuf.TimestampBàA4 + update_time ( 2.google.protobuf.TimestampBàA + description ( BàAG +rules ( 23.google.cloud.networkservices.v1.TlsRoute.RouteRuleBàA; +meshes ( B+àAúA% +#networkservices.googleapis.com/Mesh@ +gateways ( B.àAúA( +&networkservices.googleapis.com/Gateway£ + RouteRuleJ +matches ( 24.google.cloud.networkservices.v1.TlsRoute.RouteMatchBàAJ +action ( 25.google.cloud.networkservices.v1.TlsRoute.RouteActionBàA6 + +RouteMatch +sni_host ( BàA +alpn ( BàAd + RouteActionU + destinations ( 2:.google.cloud.networkservices.v1.TlsRoute.RouteDestinationBàAl +RouteDestinationC + service_name ( B-àAúA\' +%compute.googleapis.com/BackendService +weight (BàA:kêAh +\'networkservices.googleapis.com/TlsRoute=projects/{project}/locations/{location}/tlsRoutes/{tls_route}"~ +ListTlsRoutesRequest? +parent ( B/àAúA)\'networkservices.googleapis.com/TlsRoute + page_size ( + +page_token ( "o +ListTlsRoutesResponse= + +tls_routes ( 2).google.cloud.networkservices.v1.TlsRoute +next_page_token ( "S +GetTlsRouteRequest= +name ( B/àAúA) +\'networkservices.googleapis.com/TlsRoute"¶ +CreateTlsRouteRequest? +parent ( B/àAúA)\'networkservices.googleapis.com/TlsRoute + tls_route_id ( BàAA + tls_route ( 2).google.cloud.networkservices.v1.TlsRouteBàA" +UpdateTlsRouteRequest4 + update_mask ( 2.google.protobuf.FieldMaskBàAA + tls_route ( 2).google.cloud.networkservices.v1.TlsRouteBàA"V +DeleteTlsRouteRequest= +name ( B/àAúA) +\'networkservices.googleapis.com/TlsRouteBî +#com.google.cloud.networkservices.v1B TlsRouteProtoPZMcloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespbªGoogle.Cloud.NetworkServices.V1ÊGoogle\\Cloud\\NetworkServices\\V1ê"Google::Cloud::NetworkServices::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/NetworkServices/owlbot.py b/NetworkServices/owlbot.py new file mode 100644 index 000000000000..349da58a252d --- /dev/null +++ b/NetworkServices/owlbot.py @@ -0,0 +1,62 @@ +# Copyright 2023 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/NetworkServices").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main( + src=src, + dest=dest, + copy_excludes=[ + src / "**/[A-Z]*_*.php", + ] +) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/NetworkServices/phpunit.xml.dist b/NetworkServices/phpunit.xml.dist new file mode 100644 index 000000000000..3b8df2f6f57f --- /dev/null +++ b/NetworkServices/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/NetworkServices/samples/V1/DepServiceClient/create_lb_route_extension.php b/NetworkServices/samples/V1/DepServiceClient/create_lb_route_extension.php new file mode 100644 index 000000000000..598214c9eed5 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/create_lb_route_extension.php @@ -0,0 +1,175 @@ +setCelExpression($lbRouteExtensionExtensionChainsMatchConditionCelExpression); + $extension = (new Extension()) + ->setName($lbRouteExtensionExtensionChainsExtensionsName) + ->setService($lbRouteExtensionExtensionChainsExtensionsService); + $lbRouteExtensionExtensionChainsExtensions = [$extension,]; + $extensionChain = (new ExtensionChain()) + ->setName($lbRouteExtensionExtensionChainsName) + ->setMatchCondition($lbRouteExtensionExtensionChainsMatchCondition) + ->setExtensions($lbRouteExtensionExtensionChainsExtensions); + $lbRouteExtensionExtensionChains = [$extensionChain,]; + $lbRouteExtension = (new LbRouteExtension()) + ->setName($lbRouteExtensionName) + ->setForwardingRules($lbRouteExtensionForwardingRules) + ->setExtensionChains($lbRouteExtensionExtensionChains) + ->setLoadBalancingScheme($lbRouteExtensionLoadBalancingScheme); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $depServiceClient->createLbRouteExtension( + $formattedParent, + $lbRouteExtensionId, + $lbRouteExtension + ); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var LbRouteExtension $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = DepServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $lbRouteExtensionId = '[LB_ROUTE_EXTENSION_ID]'; + $lbRouteExtensionName = '[NAME]'; + $lbRouteExtensionForwardingRulesElement = '[FORWARDING_RULES]'; + $lbRouteExtensionExtensionChainsName = '[NAME]'; + $lbRouteExtensionExtensionChainsMatchConditionCelExpression = '[CEL_EXPRESSION]'; + $lbRouteExtensionExtensionChainsExtensionsName = '[NAME]'; + $lbRouteExtensionExtensionChainsExtensionsService = '[SERVICE]'; + $lbRouteExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + + create_lb_route_extension_sample( + $formattedParent, + $lbRouteExtensionId, + $lbRouteExtensionName, + $lbRouteExtensionForwardingRulesElement, + $lbRouteExtensionExtensionChainsName, + $lbRouteExtensionExtensionChainsMatchConditionCelExpression, + $lbRouteExtensionExtensionChainsExtensionsName, + $lbRouteExtensionExtensionChainsExtensionsService, + $lbRouteExtensionLoadBalancingScheme + ); +} +// [END networkservices_v1_generated_DepService_CreateLbRouteExtension_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/create_lb_traffic_extension.php b/NetworkServices/samples/V1/DepServiceClient/create_lb_traffic_extension.php new file mode 100644 index 000000000000..2e9a47c1e5ba --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/create_lb_traffic_extension.php @@ -0,0 +1,176 @@ +setCelExpression($lbTrafficExtensionExtensionChainsMatchConditionCelExpression); + $extension = (new Extension()) + ->setName($lbTrafficExtensionExtensionChainsExtensionsName) + ->setService($lbTrafficExtensionExtensionChainsExtensionsService); + $lbTrafficExtensionExtensionChainsExtensions = [$extension,]; + $extensionChain = (new ExtensionChain()) + ->setName($lbTrafficExtensionExtensionChainsName) + ->setMatchCondition($lbTrafficExtensionExtensionChainsMatchCondition) + ->setExtensions($lbTrafficExtensionExtensionChainsExtensions); + $lbTrafficExtensionExtensionChains = [$extensionChain,]; + $lbTrafficExtension = (new LbTrafficExtension()) + ->setName($lbTrafficExtensionName) + ->setForwardingRules($lbTrafficExtensionForwardingRules) + ->setExtensionChains($lbTrafficExtensionExtensionChains) + ->setLoadBalancingScheme($lbTrafficExtensionLoadBalancingScheme); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $depServiceClient->createLbTrafficExtension( + $formattedParent, + $lbTrafficExtensionId, + $lbTrafficExtension + ); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var LbTrafficExtension $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = DepServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $lbTrafficExtensionId = '[LB_TRAFFIC_EXTENSION_ID]'; + $lbTrafficExtensionName = '[NAME]'; + $lbTrafficExtensionForwardingRulesElement = '[FORWARDING_RULES]'; + $lbTrafficExtensionExtensionChainsName = '[NAME]'; + $lbTrafficExtensionExtensionChainsMatchConditionCelExpression = '[CEL_EXPRESSION]'; + $lbTrafficExtensionExtensionChainsExtensionsName = '[NAME]'; + $lbTrafficExtensionExtensionChainsExtensionsService = '[SERVICE]'; + $lbTrafficExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + + create_lb_traffic_extension_sample( + $formattedParent, + $lbTrafficExtensionId, + $lbTrafficExtensionName, + $lbTrafficExtensionForwardingRulesElement, + $lbTrafficExtensionExtensionChainsName, + $lbTrafficExtensionExtensionChainsMatchConditionCelExpression, + $lbTrafficExtensionExtensionChainsExtensionsName, + $lbTrafficExtensionExtensionChainsExtensionsService, + $lbTrafficExtensionLoadBalancingScheme + ); +} +// [END networkservices_v1_generated_DepService_CreateLbTrafficExtension_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/delete_lb_route_extension.php b/NetworkServices/samples/V1/DepServiceClient/delete_lb_route_extension.php new file mode 100644 index 000000000000..2df81768f9af --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/delete_lb_route_extension.php @@ -0,0 +1,81 @@ +deleteLbRouteExtension($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = DepServiceClient::lbRouteExtensionName( + '[PROJECT]', + '[LOCATION]', + '[LB_ROUTE_EXTENSION]' + ); + + delete_lb_route_extension_sample($formattedName); +} +// [END networkservices_v1_generated_DepService_DeleteLbRouteExtension_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/delete_lb_traffic_extension.php b/NetworkServices/samples/V1/DepServiceClient/delete_lb_traffic_extension.php new file mode 100644 index 000000000000..fc42b3518345 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/delete_lb_traffic_extension.php @@ -0,0 +1,81 @@ +deleteLbTrafficExtension($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = DepServiceClient::lbTrafficExtensionName( + '[PROJECT]', + '[LOCATION]', + '[LB_TRAFFIC_EXTENSION]' + ); + + delete_lb_traffic_extension_sample($formattedName); +} +// [END networkservices_v1_generated_DepService_DeleteLbTrafficExtension_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/get_iam_policy.php b/NetworkServices/samples/V1/DepServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..832b15c7c359 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($resource); + 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 +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END networkservices_v1_generated_DepService_GetIamPolicy_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/get_lb_route_extension.php b/NetworkServices/samples/V1/DepServiceClient/get_lb_route_extension.php new file mode 100644 index 000000000000..ef31fa9b961f --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/get_lb_route_extension.php @@ -0,0 +1,72 @@ +getLbRouteExtension($formattedName); + 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 = DepServiceClient::lbRouteExtensionName( + '[PROJECT]', + '[LOCATION]', + '[LB_ROUTE_EXTENSION]' + ); + + get_lb_route_extension_sample($formattedName); +} +// [END networkservices_v1_generated_DepService_GetLbRouteExtension_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/get_lb_traffic_extension.php b/NetworkServices/samples/V1/DepServiceClient/get_lb_traffic_extension.php new file mode 100644 index 000000000000..cb36945c2eba --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/get_lb_traffic_extension.php @@ -0,0 +1,72 @@ +getLbTrafficExtension($formattedName); + 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 = DepServiceClient::lbTrafficExtensionName( + '[PROJECT]', + '[LOCATION]', + '[LB_TRAFFIC_EXTENSION]' + ); + + get_lb_traffic_extension_sample($formattedName); +} +// [END networkservices_v1_generated_DepService_GetLbTrafficExtension_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/get_location.php b/NetworkServices/samples/V1/DepServiceClient/get_location.php new file mode 100644 index 000000000000..bbff9dad5472 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END networkservices_v1_generated_DepService_GetLocation_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/list_lb_route_extensions.php b/NetworkServices/samples/V1/DepServiceClient/list_lb_route_extensions.php new file mode 100644 index 000000000000..c137b56d4588 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/list_lb_route_extensions.php @@ -0,0 +1,73 @@ +listLbRouteExtensions($formattedParent); + + /** @var LbRouteExtension $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = DepServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_lb_route_extensions_sample($formattedParent); +} +// [END networkservices_v1_generated_DepService_ListLbRouteExtensions_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/list_lb_traffic_extensions.php b/NetworkServices/samples/V1/DepServiceClient/list_lb_traffic_extensions.php new file mode 100644 index 000000000000..634a564a0e49 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/list_lb_traffic_extensions.php @@ -0,0 +1,73 @@ +listLbTrafficExtensions($formattedParent); + + /** @var LbTrafficExtension $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = DepServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_lb_traffic_extensions_sample($formattedParent); +} +// [END networkservices_v1_generated_DepService_ListLbTrafficExtensions_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/list_locations.php b/NetworkServices/samples/V1/DepServiceClient/list_locations.php new file mode 100644 index 000000000000..4801d3cb82a2 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END networkservices_v1_generated_DepService_ListLocations_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/set_iam_policy.php b/NetworkServices/samples/V1/DepServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..c38ed7f06c3c --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/set_iam_policy.php @@ -0,0 +1,73 @@ +setIamPolicy($resource, $policy); + 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 +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END networkservices_v1_generated_DepService_SetIamPolicy_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/test_iam_permissions.php b/NetworkServices/samples/V1/DepServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..6274d58218e6 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/test_iam_permissions.php @@ -0,0 +1,80 @@ +testIamPermissions($resource, $permissions); + 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 +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END networkservices_v1_generated_DepService_TestIamPermissions_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/update_lb_route_extension.php b/NetworkServices/samples/V1/DepServiceClient/update_lb_route_extension.php new file mode 100644 index 000000000000..6a6c037a79c6 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/update_lb_route_extension.php @@ -0,0 +1,160 @@ +setCelExpression($lbRouteExtensionExtensionChainsMatchConditionCelExpression); + $extension = (new Extension()) + ->setName($lbRouteExtensionExtensionChainsExtensionsName) + ->setService($lbRouteExtensionExtensionChainsExtensionsService); + $lbRouteExtensionExtensionChainsExtensions = [$extension,]; + $extensionChain = (new ExtensionChain()) + ->setName($lbRouteExtensionExtensionChainsName) + ->setMatchCondition($lbRouteExtensionExtensionChainsMatchCondition) + ->setExtensions($lbRouteExtensionExtensionChainsExtensions); + $lbRouteExtensionExtensionChains = [$extensionChain,]; + $lbRouteExtension = (new LbRouteExtension()) + ->setName($lbRouteExtensionName) + ->setForwardingRules($lbRouteExtensionForwardingRules) + ->setExtensionChains($lbRouteExtensionExtensionChains) + ->setLoadBalancingScheme($lbRouteExtensionLoadBalancingScheme); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $depServiceClient->updateLbRouteExtension($lbRouteExtension); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var LbRouteExtension $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $lbRouteExtensionName = '[NAME]'; + $lbRouteExtensionForwardingRulesElement = '[FORWARDING_RULES]'; + $lbRouteExtensionExtensionChainsName = '[NAME]'; + $lbRouteExtensionExtensionChainsMatchConditionCelExpression = '[CEL_EXPRESSION]'; + $lbRouteExtensionExtensionChainsExtensionsName = '[NAME]'; + $lbRouteExtensionExtensionChainsExtensionsService = '[SERVICE]'; + $lbRouteExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + + update_lb_route_extension_sample( + $lbRouteExtensionName, + $lbRouteExtensionForwardingRulesElement, + $lbRouteExtensionExtensionChainsName, + $lbRouteExtensionExtensionChainsMatchConditionCelExpression, + $lbRouteExtensionExtensionChainsExtensionsName, + $lbRouteExtensionExtensionChainsExtensionsService, + $lbRouteExtensionLoadBalancingScheme + ); +} +// [END networkservices_v1_generated_DepService_UpdateLbRouteExtension_sync] diff --git a/NetworkServices/samples/V1/DepServiceClient/update_lb_traffic_extension.php b/NetworkServices/samples/V1/DepServiceClient/update_lb_traffic_extension.php new file mode 100644 index 000000000000..3480f1d17892 --- /dev/null +++ b/NetworkServices/samples/V1/DepServiceClient/update_lb_traffic_extension.php @@ -0,0 +1,160 @@ +setCelExpression($lbTrafficExtensionExtensionChainsMatchConditionCelExpression); + $extension = (new Extension()) + ->setName($lbTrafficExtensionExtensionChainsExtensionsName) + ->setService($lbTrafficExtensionExtensionChainsExtensionsService); + $lbTrafficExtensionExtensionChainsExtensions = [$extension,]; + $extensionChain = (new ExtensionChain()) + ->setName($lbTrafficExtensionExtensionChainsName) + ->setMatchCondition($lbTrafficExtensionExtensionChainsMatchCondition) + ->setExtensions($lbTrafficExtensionExtensionChainsExtensions); + $lbTrafficExtensionExtensionChains = [$extensionChain,]; + $lbTrafficExtension = (new LbTrafficExtension()) + ->setName($lbTrafficExtensionName) + ->setForwardingRules($lbTrafficExtensionForwardingRules) + ->setExtensionChains($lbTrafficExtensionExtensionChains) + ->setLoadBalancingScheme($lbTrafficExtensionLoadBalancingScheme); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $depServiceClient->updateLbTrafficExtension($lbTrafficExtension); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var LbTrafficExtension $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $lbTrafficExtensionName = '[NAME]'; + $lbTrafficExtensionForwardingRulesElement = '[FORWARDING_RULES]'; + $lbTrafficExtensionExtensionChainsName = '[NAME]'; + $lbTrafficExtensionExtensionChainsMatchConditionCelExpression = '[CEL_EXPRESSION]'; + $lbTrafficExtensionExtensionChainsExtensionsName = '[NAME]'; + $lbTrafficExtensionExtensionChainsExtensionsService = '[SERVICE]'; + $lbTrafficExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + + update_lb_traffic_extension_sample( + $lbTrafficExtensionName, + $lbTrafficExtensionForwardingRulesElement, + $lbTrafficExtensionExtensionChainsName, + $lbTrafficExtensionExtensionChainsMatchConditionCelExpression, + $lbTrafficExtensionExtensionChainsExtensionsName, + $lbTrafficExtensionExtensionChainsExtensionsService, + $lbTrafficExtensionLoadBalancingScheme + ); +} +// [END networkservices_v1_generated_DepService_UpdateLbTrafficExtension_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/create_endpoint_policy.php b/NetworkServices/samples/V1/NetworkServicesClient/create_endpoint_policy.php new file mode 100644 index 000000000000..2aa8f48da9de --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/create_endpoint_policy.php @@ -0,0 +1,110 @@ +setName($endpointPolicyName) + ->setType($endpointPolicyType) + ->setEndpointMatcher($endpointPolicyEndpointMatcher); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->createEndpointPolicy( + $formattedParent, + $endpointPolicyId, + $endpointPolicy + ); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var EndpointPolicy $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $endpointPolicyId = '[ENDPOINT_POLICY_ID]'; + $endpointPolicyName = '[NAME]'; + $endpointPolicyType = EndpointPolicyType::ENDPOINT_POLICY_TYPE_UNSPECIFIED; + + create_endpoint_policy_sample( + $formattedParent, + $endpointPolicyId, + $endpointPolicyName, + $endpointPolicyType + ); +} +// [END networkservices_v1_generated_NetworkServices_CreateEndpointPolicy_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/create_gateway.php b/NetworkServices/samples/V1/NetworkServicesClient/create_gateway.php new file mode 100644 index 000000000000..126f873f0749 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/create_gateway.php @@ -0,0 +1,115 @@ +`. + * @param int $gatewayPortsElement One or more ports that the Gateway must receive traffic on. The + * proxy binds to the ports specified. Gateway listen on 0.0.0.0 on the ports + * specified below. + * @param string $gatewayScope Immutable. Scope determines how configuration across multiple + * Gateway instances are merged. The configuration for multiple Gateway + * instances with the same scope will be merged as presented as a single + * coniguration to the proxy/load balancer. + * + * Max length 64 characters. + * Scope should start with a letter and can only have letters, numbers, + * hyphens. + */ +function create_gateway_sample( + string $formattedParent, + string $gatewayId, + string $gatewayName, + int $gatewayPortsElement, + string $gatewayScope +): void { + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $gatewayPorts = [$gatewayPortsElement,]; + $gateway = (new Gateway()) + ->setName($gatewayName) + ->setPorts($gatewayPorts) + ->setScope($gatewayScope); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->createGateway($formattedParent, $gatewayId, $gateway); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Gateway $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $gatewayId = '[GATEWAY_ID]'; + $gatewayName = '[NAME]'; + $gatewayPortsElement = 0; + $gatewayScope = '[SCOPE]'; + + create_gateway_sample( + $formattedParent, + $gatewayId, + $gatewayName, + $gatewayPortsElement, + $gatewayScope + ); +} +// [END networkservices_v1_generated_NetworkServices_CreateGateway_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/create_grpc_route.php b/NetworkServices/samples/V1/NetworkServicesClient/create_grpc_route.php new file mode 100644 index 000000000000..dc9aa621c9bd --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/create_grpc_route.php @@ -0,0 +1,138 @@ +` + * @param string $grpcRouteHostnamesElement Service hostnames with an optional port for which this route + * describes traffic. + * + * Format: [:] + * + * Hostname is the fully qualified domain name of a network host. This matches + * the RFC 1123 definition of a hostname with 2 notable exceptions: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * + * The routes associated with a Mesh or Gateway must have unique hostnames. If + * you attempt to attach multiple routes with conflicting hostnames, the + * configuration will be rejected. + * + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is + * not possible to associate two routes both with `*.bar.com` or both with + * `bar.com`. + * + * If a port is specified, then gRPC clients must use the channel URI with the + * port to match this rule (i.e. "xds:///service:123"), otherwise they must + * supply the URI without a port (i.e. "xds:///service"). + */ +function create_grpc_route_sample( + string $formattedParent, + string $grpcRouteId, + string $grpcRouteName, + string $grpcRouteHostnamesElement +): void { + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $grpcRouteHostnames = [$grpcRouteHostnamesElement,]; + $grpcRouteRulesAction = new RouteAction(); + $routeRule = (new RouteRule()) + ->setAction($grpcRouteRulesAction); + $grpcRouteRules = [$routeRule,]; + $grpcRoute = (new GrpcRoute()) + ->setName($grpcRouteName) + ->setHostnames($grpcRouteHostnames) + ->setRules($grpcRouteRules); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->createGrpcRoute($formattedParent, $grpcRouteId, $grpcRoute); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var GrpcRoute $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $grpcRouteId = '[GRPC_ROUTE_ID]'; + $grpcRouteName = '[NAME]'; + $grpcRouteHostnamesElement = '[HOSTNAMES]'; + + create_grpc_route_sample( + $formattedParent, + $grpcRouteId, + $grpcRouteName, + $grpcRouteHostnamesElement + ); +} +// [END networkservices_v1_generated_NetworkServices_CreateGrpcRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/create_http_route.php b/NetworkServices/samples/V1/NetworkServicesClient/create_http_route.php new file mode 100644 index 000000000000..5fd253d5b741 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/create_http_route.php @@ -0,0 +1,127 @@ +`. + * @param string $httpRouteHostnamesElement Hostnames define a set of hosts that should match against the + * HTTP host header to select a HttpRoute to process the request. Hostname is + * the fully qualified domain name of a network host, as defined by RFC 1123 + * with the exception that: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * + * The routes associated with a Mesh or Gateways must have unique hostnames. + * If you attempt to attach multiple routes with conflicting hostnames, + * the configuration will be rejected. + * + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same Mesh (or + * Gateways under the same scope), it is not possible to associate two routes + * both with `*.bar.com` or both with `bar.com`. + */ +function create_http_route_sample( + string $formattedParent, + string $httpRouteId, + string $httpRouteName, + string $httpRouteHostnamesElement +): void { + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $httpRouteHostnames = [$httpRouteHostnamesElement,]; + $httpRouteRules = [new RouteRule()]; + $httpRoute = (new HttpRoute()) + ->setName($httpRouteName) + ->setHostnames($httpRouteHostnames) + ->setRules($httpRouteRules); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->createHttpRoute($formattedParent, $httpRouteId, $httpRoute); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var HttpRoute $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $httpRouteId = '[HTTP_ROUTE_ID]'; + $httpRouteName = '[NAME]'; + $httpRouteHostnamesElement = '[HOSTNAMES]'; + + create_http_route_sample( + $formattedParent, + $httpRouteId, + $httpRouteName, + $httpRouteHostnamesElement + ); +} +// [END networkservices_v1_generated_NetworkServices_CreateHttpRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/create_mesh.php b/NetworkServices/samples/V1/NetworkServicesClient/create_mesh.php new file mode 100644 index 000000000000..9f1b6b794526 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/create_mesh.php @@ -0,0 +1,88 @@ +`. + */ +function create_mesh_sample(string $formattedParent, string $meshId, string $meshName): void +{ + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $mesh = (new Mesh()) + ->setName($meshName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->createMesh($formattedParent, $meshId, $mesh); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Mesh $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $meshId = '[MESH_ID]'; + $meshName = '[NAME]'; + + create_mesh_sample($formattedParent, $meshId, $meshName); +} +// [END networkservices_v1_generated_NetworkServices_CreateMesh_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/create_service_binding.php b/NetworkServices/samples/V1/NetworkServicesClient/create_service_binding.php new file mode 100644 index 000000000000..406278babd24 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/create_service_binding.php @@ -0,0 +1,105 @@ +setName($serviceBindingName) + ->setService($serviceBindingService); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->createServiceBinding( + $formattedParent, + $serviceBindingId, + $serviceBinding + ); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ServiceBinding $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $serviceBindingId = '[SERVICE_BINDING_ID]'; + $serviceBindingName = '[NAME]'; + $serviceBindingService = '[SERVICE]'; + + create_service_binding_sample( + $formattedParent, + $serviceBindingId, + $serviceBindingName, + $serviceBindingService + ); +} +// [END networkservices_v1_generated_NetworkServices_CreateServiceBinding_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/create_tcp_route.php b/NetworkServices/samples/V1/NetworkServicesClient/create_tcp_route.php new file mode 100644 index 000000000000..c9fa3555fcde --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/create_tcp_route.php @@ -0,0 +1,98 @@ +`. + */ +function create_tcp_route_sample( + string $formattedParent, + string $tcpRouteId, + string $tcpRouteName +): void { + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $tcpRouteRulesAction = new RouteAction(); + $routeRule = (new RouteRule()) + ->setAction($tcpRouteRulesAction); + $tcpRouteRules = [$routeRule,]; + $tcpRoute = (new TcpRoute()) + ->setName($tcpRouteName) + ->setRules($tcpRouteRules); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->createTcpRoute($formattedParent, $tcpRouteId, $tcpRoute); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TcpRoute $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $tcpRouteId = '[TCP_ROUTE_ID]'; + $tcpRouteName = '[NAME]'; + + create_tcp_route_sample($formattedParent, $tcpRouteId, $tcpRouteName); +} +// [END networkservices_v1_generated_NetworkServices_CreateTcpRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/create_tls_route.php b/NetworkServices/samples/V1/NetworkServicesClient/create_tls_route.php new file mode 100644 index 000000000000..bb6ebbf6a796 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/create_tls_route.php @@ -0,0 +1,119 @@ +`. + * @param string $formattedTlsRouteRulesActionDestinationsServiceName The URL of a BackendService to route traffic to. Please see + * {@see NetworkServicesClient::backendServiceName()} for help formatting this field. + */ +function create_tls_route_sample( + string $formattedParent, + string $tlsRouteId, + string $tlsRouteName, + string $formattedTlsRouteRulesActionDestinationsServiceName +): void { + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $tlsRouteRulesMatches = [new RouteMatch()]; + $routeDestination = (new RouteDestination()) + ->setServiceName($formattedTlsRouteRulesActionDestinationsServiceName); + $tlsRouteRulesActionDestinations = [$routeDestination,]; + $tlsRouteRulesAction = (new RouteAction()) + ->setDestinations($tlsRouteRulesActionDestinations); + $routeRule = (new RouteRule()) + ->setMatches($tlsRouteRulesMatches) + ->setAction($tlsRouteRulesAction); + $tlsRouteRules = [$routeRule,]; + $tlsRoute = (new TlsRoute()) + ->setName($tlsRouteName) + ->setRules($tlsRouteRules); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->createTlsRoute($formattedParent, $tlsRouteId, $tlsRoute); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TlsRoute $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $tlsRouteId = '[TLS_ROUTE_ID]'; + $tlsRouteName = '[NAME]'; + $formattedTlsRouteRulesActionDestinationsServiceName = NetworkServicesClient::backendServiceName( + '[PROJECT]', + '[LOCATION]', + '[BACKEND_SERVICE]' + ); + + create_tls_route_sample( + $formattedParent, + $tlsRouteId, + $tlsRouteName, + $formattedTlsRouteRulesActionDestinationsServiceName + ); +} +// [END networkservices_v1_generated_NetworkServices_CreateTlsRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/delete_endpoint_policy.php b/NetworkServices/samples/V1/NetworkServicesClient/delete_endpoint_policy.php new file mode 100644 index 000000000000..75a1d8ec33ca --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/delete_endpoint_policy.php @@ -0,0 +1,80 @@ +deleteEndpointPolicy($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = NetworkServicesClient::endpointPolicyName( + '[PROJECT]', + '[LOCATION]', + '[ENDPOINT_POLICY]' + ); + + delete_endpoint_policy_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_DeleteEndpointPolicy_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/delete_gateway.php b/NetworkServices/samples/V1/NetworkServicesClient/delete_gateway.php new file mode 100644 index 000000000000..004b9523e533 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/delete_gateway.php @@ -0,0 +1,76 @@ +deleteGateway($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = NetworkServicesClient::gatewayName('[PROJECT]', '[LOCATION]', '[GATEWAY]'); + + delete_gateway_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_DeleteGateway_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/delete_grpc_route.php b/NetworkServices/samples/V1/NetworkServicesClient/delete_grpc_route.php new file mode 100644 index 000000000000..7c932c859d5e --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/delete_grpc_route.php @@ -0,0 +1,76 @@ +deleteGrpcRoute($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = NetworkServicesClient::grpcRouteName('[PROJECT]', '[LOCATION]', '[GRPC_ROUTE]'); + + delete_grpc_route_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_DeleteGrpcRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/delete_http_route.php b/NetworkServices/samples/V1/NetworkServicesClient/delete_http_route.php new file mode 100644 index 000000000000..c634d8c2e8d2 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/delete_http_route.php @@ -0,0 +1,76 @@ +deleteHttpRoute($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = NetworkServicesClient::httpRouteName('[PROJECT]', '[LOCATION]', '[HTTP_ROUTE]'); + + delete_http_route_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_DeleteHttpRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/delete_mesh.php b/NetworkServices/samples/V1/NetworkServicesClient/delete_mesh.php new file mode 100644 index 000000000000..b633a303aff2 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/delete_mesh.php @@ -0,0 +1,76 @@ +deleteMesh($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = NetworkServicesClient::meshName('[PROJECT]', '[LOCATION]', '[MESH]'); + + delete_mesh_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_DeleteMesh_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/delete_service_binding.php b/NetworkServices/samples/V1/NetworkServicesClient/delete_service_binding.php new file mode 100644 index 000000000000..e6cfea124f1c --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/delete_service_binding.php @@ -0,0 +1,80 @@ +deleteServiceBinding($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = NetworkServicesClient::serviceBindingName( + '[PROJECT]', + '[LOCATION]', + '[SERVICE_BINDING]' + ); + + delete_service_binding_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_DeleteServiceBinding_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/delete_tcp_route.php b/NetworkServices/samples/V1/NetworkServicesClient/delete_tcp_route.php new file mode 100644 index 000000000000..cc696c7296e8 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/delete_tcp_route.php @@ -0,0 +1,76 @@ +deleteTcpRoute($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = NetworkServicesClient::tcpRouteName('[PROJECT]', '[LOCATION]', '[TCP_ROUTE]'); + + delete_tcp_route_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_DeleteTcpRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/delete_tls_route.php b/NetworkServices/samples/V1/NetworkServicesClient/delete_tls_route.php new file mode 100644 index 000000000000..f4ffb3b17d07 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/delete_tls_route.php @@ -0,0 +1,76 @@ +deleteTlsRoute($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = NetworkServicesClient::tlsRouteName('[PROJECT]', '[LOCATION]', '[TLS_ROUTE]'); + + delete_tls_route_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_DeleteTlsRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_endpoint_policy.php b/NetworkServices/samples/V1/NetworkServicesClient/get_endpoint_policy.php new file mode 100644 index 000000000000..ecbec1690753 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_endpoint_policy.php @@ -0,0 +1,71 @@ +getEndpointPolicy($formattedName); + 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 = NetworkServicesClient::endpointPolicyName( + '[PROJECT]', + '[LOCATION]', + '[ENDPOINT_POLICY]' + ); + + get_endpoint_policy_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_GetEndpointPolicy_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_gateway.php b/NetworkServices/samples/V1/NetworkServicesClient/get_gateway.php new file mode 100644 index 000000000000..ca4a9a0f1d35 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_gateway.php @@ -0,0 +1,67 @@ +getGateway($formattedName); + 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 = NetworkServicesClient::gatewayName('[PROJECT]', '[LOCATION]', '[GATEWAY]'); + + get_gateway_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_GetGateway_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_grpc_route.php b/NetworkServices/samples/V1/NetworkServicesClient/get_grpc_route.php new file mode 100644 index 000000000000..70376169c80d --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_grpc_route.php @@ -0,0 +1,67 @@ +getGrpcRoute($formattedName); + 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 = NetworkServicesClient::grpcRouteName('[PROJECT]', '[LOCATION]', '[GRPC_ROUTE]'); + + get_grpc_route_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_GetGrpcRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_http_route.php b/NetworkServices/samples/V1/NetworkServicesClient/get_http_route.php new file mode 100644 index 000000000000..30236bfaa045 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_http_route.php @@ -0,0 +1,67 @@ +getHttpRoute($formattedName); + 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 = NetworkServicesClient::httpRouteName('[PROJECT]', '[LOCATION]', '[HTTP_ROUTE]'); + + get_http_route_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_GetHttpRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_iam_policy.php b/NetworkServices/samples/V1/NetworkServicesClient/get_iam_policy.php new file mode 100644 index 000000000000..940b4c0f3e6e --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($resource); + 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 +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END networkservices_v1_generated_NetworkServices_GetIamPolicy_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_location.php b/NetworkServices/samples/V1/NetworkServicesClient/get_location.php new file mode 100644 index 000000000000..67e709f726c7 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END networkservices_v1_generated_NetworkServices_GetLocation_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_mesh.php b/NetworkServices/samples/V1/NetworkServicesClient/get_mesh.php new file mode 100644 index 000000000000..f41d60ac2c17 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_mesh.php @@ -0,0 +1,67 @@ +getMesh($formattedName); + 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 = NetworkServicesClient::meshName('[PROJECT]', '[LOCATION]', '[MESH]'); + + get_mesh_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_GetMesh_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_service_binding.php b/NetworkServices/samples/V1/NetworkServicesClient/get_service_binding.php new file mode 100644 index 000000000000..0c579cf3ba9c --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_service_binding.php @@ -0,0 +1,71 @@ +getServiceBinding($formattedName); + 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 = NetworkServicesClient::serviceBindingName( + '[PROJECT]', + '[LOCATION]', + '[SERVICE_BINDING]' + ); + + get_service_binding_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_GetServiceBinding_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_tcp_route.php b/NetworkServices/samples/V1/NetworkServicesClient/get_tcp_route.php new file mode 100644 index 000000000000..e552e73f0cfc --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_tcp_route.php @@ -0,0 +1,67 @@ +getTcpRoute($formattedName); + 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 = NetworkServicesClient::tcpRouteName('[PROJECT]', '[LOCATION]', '[TCP_ROUTE]'); + + get_tcp_route_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_GetTcpRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/get_tls_route.php b/NetworkServices/samples/V1/NetworkServicesClient/get_tls_route.php new file mode 100644 index 000000000000..c7b20170cc5c --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/get_tls_route.php @@ -0,0 +1,67 @@ +getTlsRoute($formattedName); + 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 = NetworkServicesClient::tlsRouteName('[PROJECT]', '[LOCATION]', '[TLS_ROUTE]'); + + get_tls_route_sample($formattedName); +} +// [END networkservices_v1_generated_NetworkServices_GetTlsRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/list_endpoint_policies.php b/NetworkServices/samples/V1/NetworkServicesClient/list_endpoint_policies.php new file mode 100644 index 000000000000..8147e92ba408 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/list_endpoint_policies.php @@ -0,0 +1,72 @@ +listEndpointPolicies($formattedParent); + + /** @var EndpointPolicy $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_endpoint_policies_sample($formattedParent); +} +// [END networkservices_v1_generated_NetworkServices_ListEndpointPolicies_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/list_gateways.php b/NetworkServices/samples/V1/NetworkServicesClient/list_gateways.php new file mode 100644 index 000000000000..04442a8d900b --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/list_gateways.php @@ -0,0 +1,72 @@ +listGateways($formattedParent); + + /** @var Gateway $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_gateways_sample($formattedParent); +} +// [END networkservices_v1_generated_NetworkServices_ListGateways_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/list_grpc_routes.php b/NetworkServices/samples/V1/NetworkServicesClient/list_grpc_routes.php new file mode 100644 index 000000000000..e1801bbe87a9 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/list_grpc_routes.php @@ -0,0 +1,72 @@ +listGrpcRoutes($formattedParent); + + /** @var GrpcRoute $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_grpc_routes_sample($formattedParent); +} +// [END networkservices_v1_generated_NetworkServices_ListGrpcRoutes_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/list_http_routes.php b/NetworkServices/samples/V1/NetworkServicesClient/list_http_routes.php new file mode 100644 index 000000000000..a127eacc570b --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/list_http_routes.php @@ -0,0 +1,72 @@ +listHttpRoutes($formattedParent); + + /** @var HttpRoute $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_http_routes_sample($formattedParent); +} +// [END networkservices_v1_generated_NetworkServices_ListHttpRoutes_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/list_locations.php b/NetworkServices/samples/V1/NetworkServicesClient/list_locations.php new file mode 100644 index 000000000000..269d1269bf55 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END networkservices_v1_generated_NetworkServices_ListLocations_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/list_meshes.php b/NetworkServices/samples/V1/NetworkServicesClient/list_meshes.php new file mode 100644 index 000000000000..35dfeecd85b3 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/list_meshes.php @@ -0,0 +1,72 @@ +listMeshes($formattedParent); + + /** @var Mesh $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_meshes_sample($formattedParent); +} +// [END networkservices_v1_generated_NetworkServices_ListMeshes_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/list_service_bindings.php b/NetworkServices/samples/V1/NetworkServicesClient/list_service_bindings.php new file mode 100644 index 000000000000..28e98b073bee --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/list_service_bindings.php @@ -0,0 +1,72 @@ +listServiceBindings($formattedParent); + + /** @var ServiceBinding $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_service_bindings_sample($formattedParent); +} +// [END networkservices_v1_generated_NetworkServices_ListServiceBindings_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/list_tcp_routes.php b/NetworkServices/samples/V1/NetworkServicesClient/list_tcp_routes.php new file mode 100644 index 000000000000..fdf7e2714912 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/list_tcp_routes.php @@ -0,0 +1,72 @@ +listTcpRoutes($formattedParent); + + /** @var TcpRoute $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_tcp_routes_sample($formattedParent); +} +// [END networkservices_v1_generated_NetworkServices_ListTcpRoutes_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/list_tls_routes.php b/NetworkServices/samples/V1/NetworkServicesClient/list_tls_routes.php new file mode 100644 index 000000000000..209d60ded156 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/list_tls_routes.php @@ -0,0 +1,72 @@ +listTlsRoutes($formattedParent); + + /** @var TlsRoute $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = NetworkServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_tls_routes_sample($formattedParent); +} +// [END networkservices_v1_generated_NetworkServices_ListTlsRoutes_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/set_iam_policy.php b/NetworkServices/samples/V1/NetworkServicesClient/set_iam_policy.php new file mode 100644 index 000000000000..9650d9511d36 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/set_iam_policy.php @@ -0,0 +1,73 @@ +setIamPolicy($resource, $policy); + 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 +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END networkservices_v1_generated_NetworkServices_SetIamPolicy_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/test_iam_permissions.php b/NetworkServices/samples/V1/NetworkServicesClient/test_iam_permissions.php new file mode 100644 index 000000000000..d5cbc0435ed6 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/test_iam_permissions.php @@ -0,0 +1,80 @@ +testIamPermissions($resource, $permissions); + 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 +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END networkservices_v1_generated_NetworkServices_TestIamPermissions_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/update_endpoint_policy.php b/NetworkServices/samples/V1/NetworkServicesClient/update_endpoint_policy.php new file mode 100644 index 000000000000..c8af2b89d13d --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/update_endpoint_policy.php @@ -0,0 +1,90 @@ +setName($endpointPolicyName) + ->setType($endpointPolicyType) + ->setEndpointMatcher($endpointPolicyEndpointMatcher); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->updateEndpointPolicy($endpointPolicy); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var EndpointPolicy $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $endpointPolicyName = '[NAME]'; + $endpointPolicyType = EndpointPolicyType::ENDPOINT_POLICY_TYPE_UNSPECIFIED; + + update_endpoint_policy_sample($endpointPolicyName, $endpointPolicyType); +} +// [END networkservices_v1_generated_NetworkServices_UpdateEndpointPolicy_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/update_gateway.php b/NetworkServices/samples/V1/NetworkServicesClient/update_gateway.php new file mode 100644 index 000000000000..a14c29803888 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/update_gateway.php @@ -0,0 +1,101 @@ +`. + * @param int $gatewayPortsElement One or more ports that the Gateway must receive traffic on. The + * proxy binds to the ports specified. Gateway listen on 0.0.0.0 on the ports + * specified below. + * @param string $gatewayScope Immutable. Scope determines how configuration across multiple + * Gateway instances are merged. The configuration for multiple Gateway + * instances with the same scope will be merged as presented as a single + * coniguration to the proxy/load balancer. + * + * Max length 64 characters. + * Scope should start with a letter and can only have letters, numbers, + * hyphens. + */ +function update_gateway_sample( + string $gatewayName, + int $gatewayPortsElement, + string $gatewayScope +): void { + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $gatewayPorts = [$gatewayPortsElement,]; + $gateway = (new Gateway()) + ->setName($gatewayName) + ->setPorts($gatewayPorts) + ->setScope($gatewayScope); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->updateGateway($gateway); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Gateway $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $gatewayName = '[NAME]'; + $gatewayPortsElement = 0; + $gatewayScope = '[SCOPE]'; + + update_gateway_sample($gatewayName, $gatewayPortsElement, $gatewayScope); +} +// [END networkservices_v1_generated_NetworkServices_UpdateGateway_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/update_grpc_route.php b/NetworkServices/samples/V1/NetworkServicesClient/update_grpc_route.php new file mode 100644 index 000000000000..7f46e6d62d3e --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/update_grpc_route.php @@ -0,0 +1,123 @@ +` + * @param string $grpcRouteHostnamesElement Service hostnames with an optional port for which this route + * describes traffic. + * + * Format: [:] + * + * Hostname is the fully qualified domain name of a network host. This matches + * the RFC 1123 definition of a hostname with 2 notable exceptions: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * + * The routes associated with a Mesh or Gateway must have unique hostnames. If + * you attempt to attach multiple routes with conflicting hostnames, the + * configuration will be rejected. + * + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is + * not possible to associate two routes both with `*.bar.com` or both with + * `bar.com`. + * + * If a port is specified, then gRPC clients must use the channel URI with the + * port to match this rule (i.e. "xds:///service:123"), otherwise they must + * supply the URI without a port (i.e. "xds:///service"). + */ +function update_grpc_route_sample(string $grpcRouteName, string $grpcRouteHostnamesElement): void +{ + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $grpcRouteHostnames = [$grpcRouteHostnamesElement,]; + $grpcRouteRulesAction = new RouteAction(); + $routeRule = (new RouteRule()) + ->setAction($grpcRouteRulesAction); + $grpcRouteRules = [$routeRule,]; + $grpcRoute = (new GrpcRoute()) + ->setName($grpcRouteName) + ->setHostnames($grpcRouteHostnames) + ->setRules($grpcRouteRules); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->updateGrpcRoute($grpcRoute); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var GrpcRoute $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $grpcRouteName = '[NAME]'; + $grpcRouteHostnamesElement = '[HOSTNAMES]'; + + update_grpc_route_sample($grpcRouteName, $grpcRouteHostnamesElement); +} +// [END networkservices_v1_generated_NetworkServices_UpdateGrpcRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/update_http_route.php b/NetworkServices/samples/V1/NetworkServicesClient/update_http_route.php new file mode 100644 index 000000000000..3608abfb0134 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/update_http_route.php @@ -0,0 +1,112 @@ +`. + * @param string $httpRouteHostnamesElement Hostnames define a set of hosts that should match against the + * HTTP host header to select a HttpRoute to process the request. Hostname is + * the fully qualified domain name of a network host, as defined by RFC 1123 + * with the exception that: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * + * The routes associated with a Mesh or Gateways must have unique hostnames. + * If you attempt to attach multiple routes with conflicting hostnames, + * the configuration will be rejected. + * + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same Mesh (or + * Gateways under the same scope), it is not possible to associate two routes + * both with `*.bar.com` or both with `bar.com`. + */ +function update_http_route_sample(string $httpRouteName, string $httpRouteHostnamesElement): void +{ + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $httpRouteHostnames = [$httpRouteHostnamesElement,]; + $httpRouteRules = [new RouteRule()]; + $httpRoute = (new HttpRoute()) + ->setName($httpRouteName) + ->setHostnames($httpRouteHostnames) + ->setRules($httpRouteRules); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->updateHttpRoute($httpRoute); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var HttpRoute $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $httpRouteName = '[NAME]'; + $httpRouteHostnamesElement = '[HOSTNAMES]'; + + update_http_route_sample($httpRouteName, $httpRouteHostnamesElement); +} +// [END networkservices_v1_generated_NetworkServices_UpdateHttpRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/update_mesh.php b/NetworkServices/samples/V1/NetworkServicesClient/update_mesh.php new file mode 100644 index 000000000000..faea526d27ad --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/update_mesh.php @@ -0,0 +1,82 @@ +`. + */ +function update_mesh_sample(string $meshName): void +{ + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $mesh = (new Mesh()) + ->setName($meshName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->updateMesh($mesh); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Mesh $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $meshName = '[NAME]'; + + update_mesh_sample($meshName); +} +// [END networkservices_v1_generated_NetworkServices_UpdateMesh_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/update_tcp_route.php b/NetworkServices/samples/V1/NetworkServicesClient/update_tcp_route.php new file mode 100644 index 000000000000..a68a27818f9e --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/update_tcp_route.php @@ -0,0 +1,89 @@ +`. + */ +function update_tcp_route_sample(string $tcpRouteName): void +{ + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $tcpRouteRulesAction = new RouteAction(); + $routeRule = (new RouteRule()) + ->setAction($tcpRouteRulesAction); + $tcpRouteRules = [$routeRule,]; + $tcpRoute = (new TcpRoute()) + ->setName($tcpRouteName) + ->setRules($tcpRouteRules); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->updateTcpRoute($tcpRoute); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TcpRoute $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $tcpRouteName = '[NAME]'; + + update_tcp_route_sample($tcpRouteName); +} +// [END networkservices_v1_generated_NetworkServices_UpdateTcpRoute_sync] diff --git a/NetworkServices/samples/V1/NetworkServicesClient/update_tls_route.php b/NetworkServices/samples/V1/NetworkServicesClient/update_tls_route.php new file mode 100644 index 000000000000..563f4a423ea7 --- /dev/null +++ b/NetworkServices/samples/V1/NetworkServicesClient/update_tls_route.php @@ -0,0 +1,106 @@ +`. + * @param string $formattedTlsRouteRulesActionDestinationsServiceName The URL of a BackendService to route traffic to. Please see + * {@see NetworkServicesClient::backendServiceName()} for help formatting this field. + */ +function update_tls_route_sample( + string $tlsRouteName, + string $formattedTlsRouteRulesActionDestinationsServiceName +): void { + // Create a client. + $networkServicesClient = new NetworkServicesClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $tlsRouteRulesMatches = [new RouteMatch()]; + $routeDestination = (new RouteDestination()) + ->setServiceName($formattedTlsRouteRulesActionDestinationsServiceName); + $tlsRouteRulesActionDestinations = [$routeDestination,]; + $tlsRouteRulesAction = (new RouteAction()) + ->setDestinations($tlsRouteRulesActionDestinations); + $routeRule = (new RouteRule()) + ->setMatches($tlsRouteRulesMatches) + ->setAction($tlsRouteRulesAction); + $tlsRouteRules = [$routeRule,]; + $tlsRoute = (new TlsRoute()) + ->setName($tlsRouteName) + ->setRules($tlsRouteRules); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkServicesClient->updateTlsRoute($tlsRoute); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TlsRoute $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $tlsRouteName = '[NAME]'; + $formattedTlsRouteRulesActionDestinationsServiceName = NetworkServicesClient::backendServiceName( + '[PROJECT]', + '[LOCATION]', + '[BACKEND_SERVICE]' + ); + + update_tls_route_sample($tlsRouteName, $formattedTlsRouteRulesActionDestinationsServiceName); +} +// [END networkservices_v1_generated_NetworkServices_UpdateTlsRoute_sync] diff --git a/NetworkServices/src/V1/CreateEndpointPolicyRequest.php b/NetworkServices/src/V1/CreateEndpointPolicyRequest.php new file mode 100644 index 000000000000..c6dfd22a5f8c --- /dev/null +++ b/NetworkServices/src/V1/CreateEndpointPolicyRequest.php @@ -0,0 +1,153 @@ +google.cloud.networkservices.v1.CreateEndpointPolicyRequest + */ +class CreateEndpointPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the EndpointPolicy. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Short name of the EndpointPolicy resource to be created. + * E.g. "CustomECS". + * + * Generated from protobuf field string endpoint_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint_policy_id = ''; + /** + * Required. EndpointPolicy resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointPolicy endpoint_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the EndpointPolicy. Must be in the + * format `projects/*/locations/global`. + * @type string $endpoint_policy_id + * Required. Short name of the EndpointPolicy resource to be created. + * E.g. "CustomECS". + * @type \Google\Cloud\NetworkServices\V1\EndpointPolicy $endpoint_policy + * Required. EndpointPolicy resource to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\EndpointPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the EndpointPolicy. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the EndpointPolicy. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Short name of the EndpointPolicy resource to be created. + * E.g. "CustomECS". + * + * Generated from protobuf field string endpoint_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEndpointPolicyId() + { + return $this->endpoint_policy_id; + } + + /** + * Required. Short name of the EndpointPolicy resource to be created. + * E.g. "CustomECS". + * + * Generated from protobuf field string endpoint_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEndpointPolicyId($var) + { + GPBUtil::checkString($var, True); + $this->endpoint_policy_id = $var; + + return $this; + } + + /** + * Required. EndpointPolicy resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointPolicy endpoint_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\EndpointPolicy|null + */ + public function getEndpointPolicy() + { + return $this->endpoint_policy; + } + + public function hasEndpointPolicy() + { + return isset($this->endpoint_policy); + } + + public function clearEndpointPolicy() + { + unset($this->endpoint_policy); + } + + /** + * Required. EndpointPolicy resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointPolicy endpoint_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\EndpointPolicy $var + * @return $this + */ + public function setEndpointPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\EndpointPolicy::class); + $this->endpoint_policy = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/CreateGatewayRequest.php b/NetworkServices/src/V1/CreateGatewayRequest.php new file mode 100644 index 000000000000..6f322da461a6 --- /dev/null +++ b/NetworkServices/src/V1/CreateGatewayRequest.php @@ -0,0 +1,149 @@ +google.cloud.networkservices.v1.CreateGatewayRequest + */ +class CreateGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the Gateway. Must be in the + * format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Short name of the Gateway resource to be created. + * + * Generated from protobuf field string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $gateway_id = ''; + /** + * Required. Gateway resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Gateway gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $gateway = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the Gateway. Must be in the + * format `projects/*/locations/*`. + * @type string $gateway_id + * Required. Short name of the Gateway resource to be created. + * @type \Google\Cloud\NetworkServices\V1\Gateway $gateway + * Required. Gateway resource to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Gateway::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the Gateway. Must be in the + * format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the Gateway. Must be in the + * format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Short name of the Gateway resource to be created. + * + * Generated from protobuf field string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGatewayId() + { + return $this->gateway_id; + } + + /** + * Required. Short name of the Gateway resource to be created. + * + * Generated from protobuf field string gateway_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGatewayId($var) + { + GPBUtil::checkString($var, True); + $this->gateway_id = $var; + + return $this; + } + + /** + * Required. Gateway resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Gateway gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\Gateway|null + */ + public function getGateway() + { + return $this->gateway; + } + + public function hasGateway() + { + return isset($this->gateway); + } + + public function clearGateway() + { + unset($this->gateway); + } + + /** + * Required. Gateway resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Gateway gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\Gateway $var + * @return $this + */ + public function setGateway($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\Gateway::class); + $this->gateway = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/CreateGrpcRouteRequest.php b/NetworkServices/src/V1/CreateGrpcRouteRequest.php new file mode 100644 index 000000000000..cf754379ca47 --- /dev/null +++ b/NetworkServices/src/V1/CreateGrpcRouteRequest.php @@ -0,0 +1,149 @@ +google.cloud.networkservices.v1.CreateGrpcRouteRequest + */ +class CreateGrpcRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the GrpcRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Short name of the GrpcRoute resource to be created. + * + * Generated from protobuf field string grpc_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $grpc_route_id = ''; + /** + * Required. GrpcRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute grpc_route = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $grpc_route = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the GrpcRoute. Must be in the + * format `projects/*/locations/global`. + * @type string $grpc_route_id + * Required. Short name of the GrpcRoute resource to be created. + * @type \Google\Cloud\NetworkServices\V1\GrpcRoute $grpc_route + * Required. GrpcRoute resource to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the GrpcRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the GrpcRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Short name of the GrpcRoute resource to be created. + * + * Generated from protobuf field string grpc_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGrpcRouteId() + { + return $this->grpc_route_id; + } + + /** + * Required. Short name of the GrpcRoute resource to be created. + * + * Generated from protobuf field string grpc_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGrpcRouteId($var) + { + GPBUtil::checkString($var, True); + $this->grpc_route_id = $var; + + return $this; + } + + /** + * Required. GrpcRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute grpc_route = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\GrpcRoute|null + */ + public function getGrpcRoute() + { + return $this->grpc_route; + } + + public function hasGrpcRoute() + { + return isset($this->grpc_route); + } + + public function clearGrpcRoute() + { + unset($this->grpc_route); + } + + /** + * Required. GrpcRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute grpc_route = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\GrpcRoute $var + * @return $this + */ + public function setGrpcRoute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\GrpcRoute::class); + $this->grpc_route = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/CreateHttpRouteRequest.php b/NetworkServices/src/V1/CreateHttpRouteRequest.php new file mode 100644 index 000000000000..a14312ab5e4a --- /dev/null +++ b/NetworkServices/src/V1/CreateHttpRouteRequest.php @@ -0,0 +1,149 @@ +google.cloud.networkservices.v1.CreateHttpRouteRequest + */ +class CreateHttpRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the HttpRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Short name of the HttpRoute resource to be created. + * + * Generated from protobuf field string http_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $http_route_id = ''; + /** + * Required. HttpRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute http_route = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $http_route = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the HttpRoute. Must be in the + * format `projects/*/locations/global`. + * @type string $http_route_id + * Required. Short name of the HttpRoute resource to be created. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute $http_route + * Required. HttpRoute resource to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the HttpRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the HttpRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Short name of the HttpRoute resource to be created. + * + * Generated from protobuf field string http_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHttpRouteId() + { + return $this->http_route_id; + } + + /** + * Required. Short name of the HttpRoute resource to be created. + * + * Generated from protobuf field string http_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHttpRouteId($var) + { + GPBUtil::checkString($var, True); + $this->http_route_id = $var; + + return $this; + } + + /** + * Required. HttpRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute http_route = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute|null + */ + public function getHttpRoute() + { + return $this->http_route; + } + + public function hasHttpRoute() + { + return isset($this->http_route); + } + + public function clearHttpRoute() + { + unset($this->http_route); + } + + /** + * Required. HttpRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute http_route = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute $var + * @return $this + */ + public function setHttpRoute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute::class); + $this->http_route = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/CreateLbRouteExtensionRequest.php b/NetworkServices/src/V1/CreateLbRouteExtensionRequest.php new file mode 100644 index 000000000000..b4d77055dfb2 --- /dev/null +++ b/NetworkServices/src/V1/CreateLbRouteExtensionRequest.php @@ -0,0 +1,227 @@ +google.cloud.networkservices.v1.CreateLbRouteExtensionRequest + */ +class CreateLbRouteExtensionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the `LbRouteExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. User-provided ID of the `LbRouteExtension` resource to be + * created. + * + * Generated from protobuf field string lb_route_extension_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lb_route_extension_id = ''; + /** + * Required. `LbRouteExtension` resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbRouteExtension lb_route_extension = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lb_route_extension = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the `LbRouteExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * @type string $lb_route_extension_id + * Required. User-provided ID of the `LbRouteExtension` resource to be + * created. + * @type \Google\Cloud\NetworkServices\V1\LbRouteExtension $lb_route_extension + * Required. `LbRouteExtension` resource to be created. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the `LbRouteExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the `LbRouteExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. User-provided ID of the `LbRouteExtension` resource to be + * created. + * + * Generated from protobuf field string lb_route_extension_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLbRouteExtensionId() + { + return $this->lb_route_extension_id; + } + + /** + * Required. User-provided ID of the `LbRouteExtension` resource to be + * created. + * + * Generated from protobuf field string lb_route_extension_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLbRouteExtensionId($var) + { + GPBUtil::checkString($var, True); + $this->lb_route_extension_id = $var; + + return $this; + } + + /** + * Required. `LbRouteExtension` resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbRouteExtension lb_route_extension = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\LbRouteExtension|null + */ + public function getLbRouteExtension() + { + return $this->lb_route_extension; + } + + public function hasLbRouteExtension() + { + return isset($this->lb_route_extension); + } + + public function clearLbRouteExtension() + { + unset($this->lb_route_extension); + } + + /** + * Required. `LbRouteExtension` resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbRouteExtension lb_route_extension = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\LbRouteExtension $var + * @return $this + */ + public function setLbRouteExtension($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\LbRouteExtension::class); + $this->lb_route_extension = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/CreateLbTrafficExtensionRequest.php b/NetworkServices/src/V1/CreateLbTrafficExtensionRequest.php new file mode 100644 index 000000000000..d22d3c89205c --- /dev/null +++ b/NetworkServices/src/V1/CreateLbTrafficExtensionRequest.php @@ -0,0 +1,227 @@ +google.cloud.networkservices.v1.CreateLbTrafficExtensionRequest + */ +class CreateLbTrafficExtensionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the `LbTrafficExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. User-provided ID of the `LbTrafficExtension` resource to be + * created. + * + * Generated from protobuf field string lb_traffic_extension_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lb_traffic_extension_id = ''; + /** + * Required. `LbTrafficExtension` resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbTrafficExtension lb_traffic_extension = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lb_traffic_extension = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the `LbTrafficExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * @type string $lb_traffic_extension_id + * Required. User-provided ID of the `LbTrafficExtension` resource to be + * created. + * @type \Google\Cloud\NetworkServices\V1\LbTrafficExtension $lb_traffic_extension + * Required. `LbTrafficExtension` resource to be created. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the `LbTrafficExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the `LbTrafficExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. User-provided ID of the `LbTrafficExtension` resource to be + * created. + * + * Generated from protobuf field string lb_traffic_extension_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLbTrafficExtensionId() + { + return $this->lb_traffic_extension_id; + } + + /** + * Required. User-provided ID of the `LbTrafficExtension` resource to be + * created. + * + * Generated from protobuf field string lb_traffic_extension_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLbTrafficExtensionId($var) + { + GPBUtil::checkString($var, True); + $this->lb_traffic_extension_id = $var; + + return $this; + } + + /** + * Required. `LbTrafficExtension` resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbTrafficExtension lb_traffic_extension = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\LbTrafficExtension|null + */ + public function getLbTrafficExtension() + { + return $this->lb_traffic_extension; + } + + public function hasLbTrafficExtension() + { + return isset($this->lb_traffic_extension); + } + + public function clearLbTrafficExtension() + { + unset($this->lb_traffic_extension); + } + + /** + * Required. `LbTrafficExtension` resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbTrafficExtension lb_traffic_extension = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\LbTrafficExtension $var + * @return $this + */ + public function setLbTrafficExtension($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\LbTrafficExtension::class); + $this->lb_traffic_extension = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/CreateMeshRequest.php b/NetworkServices/src/V1/CreateMeshRequest.php new file mode 100644 index 000000000000..b563e82b165d --- /dev/null +++ b/NetworkServices/src/V1/CreateMeshRequest.php @@ -0,0 +1,149 @@ +google.cloud.networkservices.v1.CreateMeshRequest + */ +class CreateMeshRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the Mesh. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Short name of the Mesh resource to be created. + * + * Generated from protobuf field string mesh_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mesh_id = ''; + /** + * Required. Mesh resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Mesh mesh = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mesh = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the Mesh. Must be in the + * format `projects/*/locations/global`. + * @type string $mesh_id + * Required. Short name of the Mesh resource to be created. + * @type \Google\Cloud\NetworkServices\V1\Mesh $mesh + * Required. Mesh resource to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Mesh::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the Mesh. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the Mesh. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Short name of the Mesh resource to be created. + * + * Generated from protobuf field string mesh_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMeshId() + { + return $this->mesh_id; + } + + /** + * Required. Short name of the Mesh resource to be created. + * + * Generated from protobuf field string mesh_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMeshId($var) + { + GPBUtil::checkString($var, True); + $this->mesh_id = $var; + + return $this; + } + + /** + * Required. Mesh resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Mesh mesh = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\Mesh|null + */ + public function getMesh() + { + return $this->mesh; + } + + public function hasMesh() + { + return isset($this->mesh); + } + + public function clearMesh() + { + unset($this->mesh); + } + + /** + * Required. Mesh resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Mesh mesh = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\Mesh $var + * @return $this + */ + public function setMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\Mesh::class); + $this->mesh = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/CreateServiceBindingRequest.php b/NetworkServices/src/V1/CreateServiceBindingRequest.php new file mode 100644 index 000000000000..1f35c7a500e5 --- /dev/null +++ b/NetworkServices/src/V1/CreateServiceBindingRequest.php @@ -0,0 +1,149 @@ +google.cloud.networkservices.v1.CreateServiceBindingRequest + */ +class CreateServiceBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the ServiceBinding. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Short name of the ServiceBinding resource to be created. + * + * Generated from protobuf field string service_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_binding_id = ''; + /** + * Required. ServiceBinding resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.ServiceBinding service_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_binding = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the ServiceBinding. Must be in the + * format `projects/*/locations/global`. + * @type string $service_binding_id + * Required. Short name of the ServiceBinding resource to be created. + * @type \Google\Cloud\NetworkServices\V1\ServiceBinding $service_binding + * Required. ServiceBinding resource to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\ServiceBinding::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the ServiceBinding. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the ServiceBinding. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Short name of the ServiceBinding resource to be created. + * + * Generated from protobuf field string service_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceBindingId() + { + return $this->service_binding_id; + } + + /** + * Required. Short name of the ServiceBinding resource to be created. + * + * Generated from protobuf field string service_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceBindingId($var) + { + GPBUtil::checkString($var, True); + $this->service_binding_id = $var; + + return $this; + } + + /** + * Required. ServiceBinding resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.ServiceBinding service_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\ServiceBinding|null + */ + public function getServiceBinding() + { + return $this->service_binding; + } + + public function hasServiceBinding() + { + return isset($this->service_binding); + } + + public function clearServiceBinding() + { + unset($this->service_binding); + } + + /** + * Required. ServiceBinding resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.ServiceBinding service_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\ServiceBinding $var + * @return $this + */ + public function setServiceBinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\ServiceBinding::class); + $this->service_binding = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/CreateTcpRouteRequest.php b/NetworkServices/src/V1/CreateTcpRouteRequest.php new file mode 100644 index 000000000000..77daad17011e --- /dev/null +++ b/NetworkServices/src/V1/CreateTcpRouteRequest.php @@ -0,0 +1,149 @@ +google.cloud.networkservices.v1.CreateTcpRouteRequest + */ +class CreateTcpRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the TcpRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Short name of the TcpRoute resource to be created. + * + * Generated from protobuf field string tcp_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tcp_route_id = ''; + /** + * Required. TcpRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TcpRoute tcp_route = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tcp_route = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the TcpRoute. Must be in the + * format `projects/*/locations/global`. + * @type string $tcp_route_id + * Required. Short name of the TcpRoute resource to be created. + * @type \Google\Cloud\NetworkServices\V1\TcpRoute $tcp_route + * Required. TcpRoute resource to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the TcpRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the TcpRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Short name of the TcpRoute resource to be created. + * + * Generated from protobuf field string tcp_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTcpRouteId() + { + return $this->tcp_route_id; + } + + /** + * Required. Short name of the TcpRoute resource to be created. + * + * Generated from protobuf field string tcp_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTcpRouteId($var) + { + GPBUtil::checkString($var, True); + $this->tcp_route_id = $var; + + return $this; + } + + /** + * Required. TcpRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TcpRoute tcp_route = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\TcpRoute|null + */ + public function getTcpRoute() + { + return $this->tcp_route; + } + + public function hasTcpRoute() + { + return isset($this->tcp_route); + } + + public function clearTcpRoute() + { + unset($this->tcp_route); + } + + /** + * Required. TcpRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TcpRoute tcp_route = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\TcpRoute $var + * @return $this + */ + public function setTcpRoute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\TcpRoute::class); + $this->tcp_route = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/CreateTlsRouteRequest.php b/NetworkServices/src/V1/CreateTlsRouteRequest.php new file mode 100644 index 000000000000..3b8efdfc7adb --- /dev/null +++ b/NetworkServices/src/V1/CreateTlsRouteRequest.php @@ -0,0 +1,149 @@ +google.cloud.networkservices.v1.CreateTlsRouteRequest + */ +class CreateTlsRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the TlsRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Short name of the TlsRoute resource to be created. + * + * Generated from protobuf field string tls_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tls_route_id = ''; + /** + * Required. TlsRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TlsRoute tls_route = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tls_route = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the TlsRoute. Must be in the + * format `projects/*/locations/global`. + * @type string $tls_route_id + * Required. Short name of the TlsRoute resource to be created. + * @type \Google\Cloud\NetworkServices\V1\TlsRoute $tls_route + * Required. TlsRoute resource to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the TlsRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the TlsRoute. Must be in the + * format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Short name of the TlsRoute resource to be created. + * + * Generated from protobuf field string tls_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTlsRouteId() + { + return $this->tls_route_id; + } + + /** + * Required. Short name of the TlsRoute resource to be created. + * + * Generated from protobuf field string tls_route_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTlsRouteId($var) + { + GPBUtil::checkString($var, True); + $this->tls_route_id = $var; + + return $this; + } + + /** + * Required. TlsRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TlsRoute tls_route = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\TlsRoute|null + */ + public function getTlsRoute() + { + return $this->tls_route; + } + + public function hasTlsRoute() + { + return isset($this->tls_route); + } + + public function clearTlsRoute() + { + unset($this->tls_route); + } + + /** + * Required. TlsRoute resource to be created. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TlsRoute tls_route = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\TlsRoute $var + * @return $this + */ + public function setTlsRoute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\TlsRoute::class); + $this->tls_route = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteEndpointPolicyRequest.php b/NetworkServices/src/V1/DeleteEndpointPolicyRequest.php new file mode 100644 index 000000000000..67da0d66c369 --- /dev/null +++ b/NetworkServices/src/V1/DeleteEndpointPolicyRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + */ +class DeleteEndpointPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the EndpointPolicy to delete. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the EndpointPolicy to delete. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\EndpointPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the EndpointPolicy to delete. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the EndpointPolicy to delete. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteGatewayRequest.php b/NetworkServices/src/V1/DeleteGatewayRequest.php new file mode 100644 index 000000000000..a476f6e4aada --- /dev/null +++ b/NetworkServices/src/V1/DeleteGatewayRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.DeleteGatewayRequest + */ +class DeleteGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the Gateway to delete. Must be in the format + * `projects/*/locations/*/gateways/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the Gateway to delete. Must be in the format + * `projects/*/locations/*/gateways/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Gateway::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the Gateway to delete. Must be in the format + * `projects/*/locations/*/gateways/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the Gateway to delete. Must be in the format + * `projects/*/locations/*/gateways/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteGrpcRouteRequest.php b/NetworkServices/src/V1/DeleteGrpcRouteRequest.php new file mode 100644 index 000000000000..b39a2e36f98b --- /dev/null +++ b/NetworkServices/src/V1/DeleteGrpcRouteRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.DeleteGrpcRouteRequest + */ +class DeleteGrpcRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the GrpcRoute to delete. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the GrpcRoute to delete. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the GrpcRoute to delete. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the GrpcRoute to delete. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteHttpRouteRequest.php b/NetworkServices/src/V1/DeleteHttpRouteRequest.php new file mode 100644 index 000000000000..ece4a3988fdd --- /dev/null +++ b/NetworkServices/src/V1/DeleteHttpRouteRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.DeleteHttpRouteRequest + */ +class DeleteHttpRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the HttpRoute to delete. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the HttpRoute to delete. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the HttpRoute to delete. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the HttpRoute to delete. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteLbRouteExtensionRequest.php b/NetworkServices/src/V1/DeleteLbRouteExtensionRequest.php new file mode 100644 index 000000000000..c85d32350f47 --- /dev/null +++ b/NetworkServices/src/V1/DeleteLbRouteExtensionRequest.php @@ -0,0 +1,149 @@ +google.cloud.networkservices.v1.DeleteLbRouteExtensionRequest + */ +class DeleteLbRouteExtensionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the `LbRouteExtension` resource to delete. Must be in + * the format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the `LbRouteExtension` resource to delete. Must be in + * the format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the `LbRouteExtension` resource to delete. Must be in + * the format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the `LbRouteExtension` resource to delete. Must be in + * the format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteLbTrafficExtensionRequest.php b/NetworkServices/src/V1/DeleteLbTrafficExtensionRequest.php new file mode 100644 index 000000000000..37b363179f7f --- /dev/null +++ b/NetworkServices/src/V1/DeleteLbTrafficExtensionRequest.php @@ -0,0 +1,149 @@ +google.cloud.networkservices.v1.DeleteLbTrafficExtensionRequest + */ +class DeleteLbTrafficExtensionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the `LbTrafficExtension` resource to delete. Must be + * in the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the `LbTrafficExtension` resource to delete. Must be + * in the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the `LbTrafficExtension` resource to delete. Must be + * in the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the `LbTrafficExtension` resource to delete. Must be + * in the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteMeshRequest.php b/NetworkServices/src/V1/DeleteMeshRequest.php new file mode 100644 index 000000000000..04581c6f16d5 --- /dev/null +++ b/NetworkServices/src/V1/DeleteMeshRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.DeleteMeshRequest + */ +class DeleteMeshRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the Mesh to delete. Must be in the format + * `projects/*/locations/global/meshes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the Mesh to delete. Must be in the format + * `projects/*/locations/global/meshes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Mesh::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the Mesh to delete. Must be in the format + * `projects/*/locations/global/meshes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the Mesh to delete. Must be in the format + * `projects/*/locations/global/meshes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteServiceBindingRequest.php b/NetworkServices/src/V1/DeleteServiceBindingRequest.php new file mode 100644 index 000000000000..b7c9e7b99b11 --- /dev/null +++ b/NetworkServices/src/V1/DeleteServiceBindingRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.DeleteServiceBindingRequest + */ +class DeleteServiceBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the ServiceBinding to delete. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the ServiceBinding to delete. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\ServiceBinding::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the ServiceBinding to delete. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the ServiceBinding to delete. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteTcpRouteRequest.php b/NetworkServices/src/V1/DeleteTcpRouteRequest.php new file mode 100644 index 000000000000..c22688511054 --- /dev/null +++ b/NetworkServices/src/V1/DeleteTcpRouteRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.DeleteTcpRouteRequest + */ +class DeleteTcpRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the TcpRoute to delete. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the TcpRoute to delete. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the TcpRoute to delete. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the TcpRoute to delete. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DeleteTlsRouteRequest.php b/NetworkServices/src/V1/DeleteTlsRouteRequest.php new file mode 100644 index 000000000000..2d3eaffd3ac1 --- /dev/null +++ b/NetworkServices/src/V1/DeleteTlsRouteRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.DeleteTlsRouteRequest + */ +class DeleteTlsRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the TlsRoute to delete. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the TlsRoute to delete. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the TlsRoute to delete. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the TlsRoute to delete. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/DepServiceClient.php b/NetworkServices/src/V1/DepServiceClient.php new file mode 100644 index 000000000000..f0542ec40f33 --- /dev/null +++ b/NetworkServices/src/V1/DepServiceClient.php @@ -0,0 +1,34 @@ +google.cloud.networkservices.v1.EndpointMatcher + */ +class EndpointMatcher extends \Google\Protobuf\Internal\Message +{ + protected $matcher_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\NetworkServices\V1\EndpointMatcher\MetadataLabelMatcher $metadata_label_matcher + * The matcher is based on node metadata presented by xDS clients. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * The matcher is based on node metadata presented by xDS clients. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher metadata_label_matcher = 1; + * @return \Google\Cloud\NetworkServices\V1\EndpointMatcher\MetadataLabelMatcher|null + */ + public function getMetadataLabelMatcher() + { + return $this->readOneof(1); + } + + public function hasMetadataLabelMatcher() + { + return $this->hasOneof(1); + } + + /** + * The matcher is based on node metadata presented by xDS clients. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher metadata_label_matcher = 1; + * @param \Google\Cloud\NetworkServices\V1\EndpointMatcher\MetadataLabelMatcher $var + * @return $this + */ + public function setMetadataLabelMatcher($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\EndpointMatcher\MetadataLabelMatcher::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getMatcherType() + { + return $this->whichOneof("matcher_type"); + } + +} + diff --git a/NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher.php b/NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher.php new file mode 100644 index 000000000000..d6ad89414ba5 --- /dev/null +++ b/NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher.php @@ -0,0 +1,194 @@ +google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + */ +class MetadataLabelMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies how matching should be done. + * Supported values are: + * MATCH_ANY: At least one of the Labels specified in the + * matcher should match the metadata presented by xDS client. + * MATCH_ALL: The metadata presented by the xDS client should + * contain all of the labels specified here. + * The selection is determined based on the best match. For + * example, suppose there are three EndpointPolicy + * resources P1, P2 and P3 and if P1 has a the matcher as + * MATCH_ANY , P2 has MATCH_ALL , and P3 has + * MATCH_ALL . + * If a client with label connects, the config from P1 + * will be selected. + * If a client with label connects, the config from P2 + * will be selected. + * If a client with label connects, the config + * from P3 will be selected. + * If there is more than one best match, (for example, if a + * config P4 with selector exists and if a client with + * label connects), an error will be thrown. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria metadata_label_match_criteria = 1; + */ + protected $metadata_label_match_criteria = 0; + /** + * The list of label value pairs that must match labels in the + * provided metadata based on filterMatchCriteria This list can + * have at most 64 entries. The list can be empty if the match + * criteria is MATCH_ANY, to specify a wildcard match (i.e this + * matches any client). + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2; + */ + private $metadata_labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $metadata_label_match_criteria + * Specifies how matching should be done. + * Supported values are: + * MATCH_ANY: At least one of the Labels specified in the + * matcher should match the metadata presented by xDS client. + * MATCH_ALL: The metadata presented by the xDS client should + * contain all of the labels specified here. + * The selection is determined based on the best match. For + * example, suppose there are three EndpointPolicy + * resources P1, P2 and P3 and if P1 has a the matcher as + * MATCH_ANY , P2 has MATCH_ALL , and P3 has + * MATCH_ALL . + * If a client with label connects, the config from P1 + * will be selected. + * If a client with label connects, the config from P2 + * will be selected. + * If a client with label connects, the config + * from P3 will be selected. + * If there is more than one best match, (for example, if a + * config P4 with selector exists and if a client with + * label connects), an error will be thrown. + * @type array<\Google\Cloud\NetworkServices\V1\EndpointMatcher\MetadataLabelMatcher\MetadataLabels>|\Google\Protobuf\Internal\RepeatedField $metadata_labels + * The list of label value pairs that must match labels in the + * provided metadata based on filterMatchCriteria This list can + * have at most 64 entries. The list can be empty if the match + * criteria is MATCH_ANY, to specify a wildcard match (i.e this + * matches any client). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Specifies how matching should be done. + * Supported values are: + * MATCH_ANY: At least one of the Labels specified in the + * matcher should match the metadata presented by xDS client. + * MATCH_ALL: The metadata presented by the xDS client should + * contain all of the labels specified here. + * The selection is determined based on the best match. For + * example, suppose there are three EndpointPolicy + * resources P1, P2 and P3 and if P1 has a the matcher as + * MATCH_ANY , P2 has MATCH_ALL , and P3 has + * MATCH_ALL . + * If a client with label connects, the config from P1 + * will be selected. + * If a client with label connects, the config from P2 + * will be selected. + * If a client with label connects, the config + * from P3 will be selected. + * If there is more than one best match, (for example, if a + * config P4 with selector exists and if a client with + * label connects), an error will be thrown. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria metadata_label_match_criteria = 1; + * @return int + */ + public function getMetadataLabelMatchCriteria() + { + return $this->metadata_label_match_criteria; + } + + /** + * Specifies how matching should be done. + * Supported values are: + * MATCH_ANY: At least one of the Labels specified in the + * matcher should match the metadata presented by xDS client. + * MATCH_ALL: The metadata presented by the xDS client should + * contain all of the labels specified here. + * The selection is determined based on the best match. For + * example, suppose there are three EndpointPolicy + * resources P1, P2 and P3 and if P1 has a the matcher as + * MATCH_ANY , P2 has MATCH_ALL , and P3 has + * MATCH_ALL . + * If a client with label connects, the config from P1 + * will be selected. + * If a client with label connects, the config from P2 + * will be selected. + * If a client with label connects, the config + * from P3 will be selected. + * If there is more than one best match, (for example, if a + * config P4 with selector exists and if a client with + * label connects), an error will be thrown. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria metadata_label_match_criteria = 1; + * @param int $var + * @return $this + */ + public function setMetadataLabelMatchCriteria($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\EndpointMatcher\MetadataLabelMatcher\MetadataLabelMatchCriteria::class); + $this->metadata_label_match_criteria = $var; + + return $this; + } + + /** + * The list of label value pairs that must match labels in the + * provided metadata based on filterMatchCriteria This list can + * have at most 64 entries. The list can be empty if the match + * criteria is MATCH_ANY, to specify a wildcard match (i.e this + * matches any client). + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetadataLabels() + { + return $this->metadata_labels; + } + + /** + * The list of label value pairs that must match labels in the + * provided metadata based on filterMatchCriteria This list can + * have at most 64 entries. The list can be empty if the match + * criteria is MATCH_ANY, to specify a wildcard match (i.e this + * matches any client). + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2; + * @param array<\Google\Cloud\NetworkServices\V1\EndpointMatcher\MetadataLabelMatcher\MetadataLabels>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetadataLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\EndpointMatcher\MetadataLabelMatcher\MetadataLabels::class); + $this->metadata_labels = $arr; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher/MetadataLabelMatchCriteria.php b/NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher/MetadataLabelMatchCriteria.php new file mode 100644 index 000000000000..fef45bd409e1 --- /dev/null +++ b/NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher/MetadataLabelMatchCriteria.php @@ -0,0 +1,64 @@ +google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria + */ +class MetadataLabelMatchCriteria +{ + /** + * Default value. Should not be used. + * + * Generated from protobuf enum METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED = 0; + */ + const METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED = 0; + /** + * At least one of the Labels specified in the matcher should match the + * metadata presented by xDS client. + * + * Generated from protobuf enum MATCH_ANY = 1; + */ + const MATCH_ANY = 1; + /** + * The metadata presented by the xDS client should contain all of the + * labels specified here. + * + * Generated from protobuf enum MATCH_ALL = 2; + */ + const MATCH_ALL = 2; + + private static $valueToName = [ + self::METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED => 'METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED', + self::MATCH_ANY => 'MATCH_ANY', + self::MATCH_ALL => 'MATCH_ALL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher/MetadataLabels.php b/NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher/MetadataLabels.php new file mode 100644 index 000000000000..3d690c287146 --- /dev/null +++ b/NetworkServices/src/V1/EndpointMatcher/MetadataLabelMatcher/MetadataLabels.php @@ -0,0 +1,106 @@ +google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + */ +class MetadataLabels extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Label name presented as key in xDS Node Metadata. + * + * Generated from protobuf field string label_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $label_name = ''; + /** + * Required. Label value presented as value corresponding to the above + * key, in xDS Node Metadata. + * + * Generated from protobuf field string label_value = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $label_value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $label_name + * Required. Label name presented as key in xDS Node Metadata. + * @type string $label_value + * Required. Label value presented as value corresponding to the above + * key, in xDS Node Metadata. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Required. Label name presented as key in xDS Node Metadata. + * + * Generated from protobuf field string label_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLabelName() + { + return $this->label_name; + } + + /** + * Required. Label name presented as key in xDS Node Metadata. + * + * Generated from protobuf field string label_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLabelName($var) + { + GPBUtil::checkString($var, True); + $this->label_name = $var; + + return $this; + } + + /** + * Required. Label value presented as value corresponding to the above + * key, in xDS Node Metadata. + * + * Generated from protobuf field string label_value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLabelValue() + { + return $this->label_value; + } + + /** + * Required. Label value presented as value corresponding to the above + * key, in xDS Node Metadata. + * + * Generated from protobuf field string label_value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLabelValue($var) + { + GPBUtil::checkString($var, True); + $this->label_value = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/EndpointPolicy.php b/NetworkServices/src/V1/EndpointPolicy.php new file mode 100644 index 000000000000..1bde99da2ce8 --- /dev/null +++ b/NetworkServices/src/V1/EndpointPolicy.php @@ -0,0 +1,526 @@ +google.cloud.networkservices.v1.EndpointPolicy + */ +class EndpointPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the EndpointPolicy resource. It matches pattern + * `projects/{project}/locations/global/endpointPolicies/{endpoint_policy}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Set of label tags associated with the EndpointPolicy resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. The type of endpoint policy. This is primarily used to validate + * the configuration. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType type = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Optional. This field specifies the URL of AuthorizationPolicy resource that + * applies authorization policies to the inbound traffic at the + * matched endpoints. Refer to Authorization. If this field is not + * specified, authorization is disabled(no authz checks) for this + * endpoint. + * + * Generated from protobuf field string authorization_policy = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $authorization_policy = ''; + /** + * Required. A matcher that selects endpoints to which the policies should be + * applied. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointMatcher endpoint_matcher = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint_matcher = null; + /** + * Optional. Port selector for the (matched) endpoints. If no port selector is + * provided, the matched config is applied to all ports. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TrafficPortSelector traffic_port_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $traffic_port_selector = null; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is + * used to determine the authentication policy to be applied to terminate the + * inbound traffic at the identified backends. If this field is not set, + * authentication is disabled(open) for this endpoint. + * + * Generated from protobuf field string server_tls_policy = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $server_tls_policy = ''; + /** + * Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy + * can be set to specify the authentication for traffic from the proxy to the + * actual endpoints. More specifically, it is applied to the outgoing traffic + * from the proxy to the endpoint. This is typically used for sidecar model + * where the proxy identifies itself as endpoint to the control plane, with + * the connection between sidecar and endpoint requiring authentication. If + * this field is not set, authentication is disabled(open). Applicable only + * when EndpointPolicyType is SIDECAR_PROXY. + * + * Generated from protobuf field string client_tls_policy = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $client_tls_policy = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the EndpointPolicy resource. It matches pattern + * `projects/{project}/locations/global/endpointPolicies/{endpoint_policy}`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Set of label tags associated with the EndpointPolicy resource. + * @type int $type + * Required. The type of endpoint policy. This is primarily used to validate + * the configuration. + * @type string $authorization_policy + * Optional. This field specifies the URL of AuthorizationPolicy resource that + * applies authorization policies to the inbound traffic at the + * matched endpoints. Refer to Authorization. If this field is not + * specified, authorization is disabled(no authz checks) for this + * endpoint. + * @type \Google\Cloud\NetworkServices\V1\EndpointMatcher $endpoint_matcher + * Required. A matcher that selects endpoints to which the policies should be + * applied. + * @type \Google\Cloud\NetworkServices\V1\TrafficPortSelector $traffic_port_selector + * Optional. Port selector for the (matched) endpoints. If no port selector is + * provided, the matched config is applied to all ports. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type string $server_tls_policy + * Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is + * used to determine the authentication policy to be applied to terminate the + * inbound traffic at the identified backends. If this field is not set, + * authentication is disabled(open) for this endpoint. + * @type string $client_tls_policy + * Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy + * can be set to specify the authentication for traffic from the proxy to the + * actual endpoints. More specifically, it is applied to the outgoing traffic + * from the proxy to the endpoint. This is typically used for sidecar model + * where the proxy identifies itself as endpoint to the control plane, with + * the connection between sidecar and endpoint requiring authentication. If + * this field is not set, authentication is disabled(open). Applicable only + * when EndpointPolicyType is SIDECAR_PROXY. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\EndpointPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the EndpointPolicy resource. It matches pattern + * `projects/{project}/locations/global/endpointPolicies/{endpoint_policy}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the EndpointPolicy resource. It matches pattern + * `projects/{project}/locations/global/endpointPolicies/{endpoint_policy}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Set of label tags associated with the EndpointPolicy resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Set of label tags associated with the EndpointPolicy resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. The type of endpoint policy. This is primarily used to validate + * the configuration. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of endpoint policy. This is primarily used to validate + * the configuration. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\EndpointPolicy\EndpointPolicyType::class); + $this->type = $var; + + return $this; + } + + /** + * Optional. This field specifies the URL of AuthorizationPolicy resource that + * applies authorization policies to the inbound traffic at the + * matched endpoints. Refer to Authorization. If this field is not + * specified, authorization is disabled(no authz checks) for this + * endpoint. + * + * Generated from protobuf field string authorization_policy = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAuthorizationPolicy() + { + return $this->authorization_policy; + } + + /** + * Optional. This field specifies the URL of AuthorizationPolicy resource that + * applies authorization policies to the inbound traffic at the + * matched endpoints. Refer to Authorization. If this field is not + * specified, authorization is disabled(no authz checks) for this + * endpoint. + * + * Generated from protobuf field string authorization_policy = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAuthorizationPolicy($var) + { + GPBUtil::checkString($var, True); + $this->authorization_policy = $var; + + return $this; + } + + /** + * Required. A matcher that selects endpoints to which the policies should be + * applied. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointMatcher endpoint_matcher = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\EndpointMatcher|null + */ + public function getEndpointMatcher() + { + return $this->endpoint_matcher; + } + + public function hasEndpointMatcher() + { + return isset($this->endpoint_matcher); + } + + public function clearEndpointMatcher() + { + unset($this->endpoint_matcher); + } + + /** + * Required. A matcher that selects endpoints to which the policies should be + * applied. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointMatcher endpoint_matcher = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\EndpointMatcher $var + * @return $this + */ + public function setEndpointMatcher($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\EndpointMatcher::class); + $this->endpoint_matcher = $var; + + return $this; + } + + /** + * Optional. Port selector for the (matched) endpoints. If no port selector is + * provided, the matched config is applied to all ports. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TrafficPortSelector traffic_port_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\NetworkServices\V1\TrafficPortSelector|null + */ + public function getTrafficPortSelector() + { + return $this->traffic_port_selector; + } + + public function hasTrafficPortSelector() + { + return isset($this->traffic_port_selector); + } + + public function clearTrafficPortSelector() + { + unset($this->traffic_port_selector); + } + + /** + * Optional. Port selector for the (matched) endpoints. If no port selector is + * provided, the matched config is applied to all ports. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TrafficPortSelector traffic_port_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\NetworkServices\V1\TrafficPortSelector $var + * @return $this + */ + public function setTrafficPortSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\TrafficPortSelector::class); + $this->traffic_port_selector = $var; + + return $this; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is + * used to determine the authentication policy to be applied to terminate the + * inbound traffic at the identified backends. If this field is not set, + * authentication is disabled(open) for this endpoint. + * + * Generated from protobuf field string server_tls_policy = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getServerTlsPolicy() + { + return $this->server_tls_policy; + } + + /** + * Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is + * used to determine the authentication policy to be applied to terminate the + * inbound traffic at the identified backends. If this field is not set, + * authentication is disabled(open) for this endpoint. + * + * Generated from protobuf field string server_tls_policy = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServerTlsPolicy($var) + { + GPBUtil::checkString($var, True); + $this->server_tls_policy = $var; + + return $this; + } + + /** + * Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy + * can be set to specify the authentication for traffic from the proxy to the + * actual endpoints. More specifically, it is applied to the outgoing traffic + * from the proxy to the endpoint. This is typically used for sidecar model + * where the proxy identifies itself as endpoint to the control plane, with + * the connection between sidecar and endpoint requiring authentication. If + * this field is not set, authentication is disabled(open). Applicable only + * when EndpointPolicyType is SIDECAR_PROXY. + * + * Generated from protobuf field string client_tls_policy = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getClientTlsPolicy() + { + return $this->client_tls_policy; + } + + /** + * Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy + * can be set to specify the authentication for traffic from the proxy to the + * actual endpoints. More specifically, it is applied to the outgoing traffic + * from the proxy to the endpoint. This is typically used for sidecar model + * where the proxy identifies itself as endpoint to the control plane, with + * the connection between sidecar and endpoint requiring authentication. If + * this field is not set, authentication is disabled(open). Applicable only + * when EndpointPolicyType is SIDECAR_PROXY. + * + * Generated from protobuf field string client_tls_policy = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setClientTlsPolicy($var) + { + GPBUtil::checkString($var, True); + $this->client_tls_policy = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/EndpointPolicy/EndpointPolicyType.php b/NetworkServices/src/V1/EndpointPolicy/EndpointPolicyType.php new file mode 100644 index 000000000000..9b5a5abc3ea8 --- /dev/null +++ b/NetworkServices/src/V1/EndpointPolicy/EndpointPolicyType.php @@ -0,0 +1,62 @@ +google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType + */ +class EndpointPolicyType +{ + /** + * Default value. Must not be used. + * + * Generated from protobuf enum ENDPOINT_POLICY_TYPE_UNSPECIFIED = 0; + */ + const ENDPOINT_POLICY_TYPE_UNSPECIFIED = 0; + /** + * Represents a proxy deployed as a sidecar. + * + * Generated from protobuf enum SIDECAR_PROXY = 1; + */ + const SIDECAR_PROXY = 1; + /** + * Represents a proxyless gRPC backend. + * + * Generated from protobuf enum GRPC_SERVER = 2; + */ + const GRPC_SERVER = 2; + + private static $valueToName = [ + self::ENDPOINT_POLICY_TYPE_UNSPECIFIED => 'ENDPOINT_POLICY_TYPE_UNSPECIFIED', + self::SIDECAR_PROXY => 'SIDECAR_PROXY', + self::GRPC_SERVER => 'GRPC_SERVER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/NetworkServices/src/V1/EventType.php b/NetworkServices/src/V1/EventType.php new file mode 100644 index 000000000000..fd2bd9ecfea8 --- /dev/null +++ b/NetworkServices/src/V1/EventType.php @@ -0,0 +1,95 @@ +google.cloud.networkservices.v1.EventType + */ +class EventType +{ + /** + * Unspecified value. Do not use. + * + * Generated from protobuf enum EVENT_TYPE_UNSPECIFIED = 0; + */ + const EVENT_TYPE_UNSPECIFIED = 0; + /** + * If included in `supported_events`, + * the extension is called when the HTTP request headers arrive. + * + * Generated from protobuf enum REQUEST_HEADERS = 1; + */ + const REQUEST_HEADERS = 1; + /** + * If included in `supported_events`, + * the extension is called when the HTTP request body arrives. + * + * Generated from protobuf enum REQUEST_BODY = 2; + */ + const REQUEST_BODY = 2; + /** + * If included in `supported_events`, + * the extension is called when the HTTP response headers arrive. + * + * Generated from protobuf enum RESPONSE_HEADERS = 3; + */ + const RESPONSE_HEADERS = 3; + /** + * If included in `supported_events`, + * the extension is called when the HTTP response body arrives. + * + * Generated from protobuf enum RESPONSE_BODY = 4; + */ + const RESPONSE_BODY = 4; + /** + * If included in `supported_events`, + * the extension is called when the HTTP request trailers arrives. + * + * Generated from protobuf enum REQUEST_TRAILERS = 5; + */ + const REQUEST_TRAILERS = 5; + /** + * If included in `supported_events`, + * the extension is called when the HTTP response trailers arrives. + * + * Generated from protobuf enum RESPONSE_TRAILERS = 6; + */ + const RESPONSE_TRAILERS = 6; + + private static $valueToName = [ + self::EVENT_TYPE_UNSPECIFIED => 'EVENT_TYPE_UNSPECIFIED', + self::REQUEST_HEADERS => 'REQUEST_HEADERS', + self::REQUEST_BODY => 'REQUEST_BODY', + self::RESPONSE_HEADERS => 'RESPONSE_HEADERS', + self::RESPONSE_BODY => 'RESPONSE_BODY', + self::REQUEST_TRAILERS => 'REQUEST_TRAILERS', + self::RESPONSE_TRAILERS => 'RESPONSE_TRAILERS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/NetworkServices/src/V1/ExtensionChain.php b/NetworkServices/src/V1/ExtensionChain.php new file mode 100644 index 000000000000..4da12b6f0838 --- /dev/null +++ b/NetworkServices/src/V1/ExtensionChain.php @@ -0,0 +1,182 @@ +google.cloud.networkservices.v1.ExtensionChain + */ +class ExtensionChain extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name for this extension chain. + * The name is logged as part of the HTTP request logs. + * The name must conform with RFC-1034, is restricted to lower-cased letters, + * numbers and hyphens, and can have a maximum length of 63 characters. + * Additionally, the first character must be a letter and the last a letter or + * a number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Conditions under which this chain is invoked for a request. + * + * Generated from protobuf field .google.cloud.networkservices.v1.ExtensionChain.MatchCondition match_condition = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $match_condition = null; + /** + * Required. A set of extensions to execute for the matching request. + * At least one extension is required. + * Up to 3 extensions can be defined for each extension chain + * for `LbTrafficExtension` resource. + * `LbRouteExtension` chains are limited to 1 extension per extension chain. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ExtensionChain.Extension extensions = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $extensions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name for this extension chain. + * The name is logged as part of the HTTP request logs. + * The name must conform with RFC-1034, is restricted to lower-cased letters, + * numbers and hyphens, and can have a maximum length of 63 characters. + * Additionally, the first character must be a letter and the last a letter or + * a number. + * @type \Google\Cloud\NetworkServices\V1\ExtensionChain\MatchCondition $match_condition + * Required. Conditions under which this chain is invoked for a request. + * @type array<\Google\Cloud\NetworkServices\V1\ExtensionChain\Extension>|\Google\Protobuf\Internal\RepeatedField $extensions + * Required. A set of extensions to execute for the matching request. + * At least one extension is required. + * Up to 3 extensions can be defined for each extension chain + * for `LbTrafficExtension` resource. + * `LbRouteExtension` chains are limited to 1 extension per extension chain. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name for this extension chain. + * The name is logged as part of the HTTP request logs. + * The name must conform with RFC-1034, is restricted to lower-cased letters, + * numbers and hyphens, and can have a maximum length of 63 characters. + * Additionally, the first character must be a letter and the last a letter or + * a number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name for this extension chain. + * The name is logged as part of the HTTP request logs. + * The name must conform with RFC-1034, is restricted to lower-cased letters, + * numbers and hyphens, and can have a maximum length of 63 characters. + * Additionally, the first character must be a letter and the last a letter or + * a number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Conditions under which this chain is invoked for a request. + * + * Generated from protobuf field .google.cloud.networkservices.v1.ExtensionChain.MatchCondition match_condition = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\ExtensionChain\MatchCondition|null + */ + public function getMatchCondition() + { + return $this->match_condition; + } + + public function hasMatchCondition() + { + return isset($this->match_condition); + } + + public function clearMatchCondition() + { + unset($this->match_condition); + } + + /** + * Required. Conditions under which this chain is invoked for a request. + * + * Generated from protobuf field .google.cloud.networkservices.v1.ExtensionChain.MatchCondition match_condition = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\ExtensionChain\MatchCondition $var + * @return $this + */ + public function setMatchCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\ExtensionChain\MatchCondition::class); + $this->match_condition = $var; + + return $this; + } + + /** + * Required. A set of extensions to execute for the matching request. + * At least one extension is required. + * Up to 3 extensions can be defined for each extension chain + * for `LbTrafficExtension` resource. + * `LbRouteExtension` chains are limited to 1 extension per extension chain. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ExtensionChain.Extension extensions = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtensions() + { + return $this->extensions; + } + + /** + * Required. A set of extensions to execute for the matching request. + * At least one extension is required. + * Up to 3 extensions can be defined for each extension chain + * for `LbTrafficExtension` resource. + * `LbRouteExtension` chains are limited to 1 extension per extension chain. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ExtensionChain.Extension extensions = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\NetworkServices\V1\ExtensionChain\Extension>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\ExtensionChain\Extension::class); + $this->extensions = $arr; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ExtensionChain/Extension.php b/NetworkServices/src/V1/ExtensionChain/Extension.php new file mode 100644 index 000000000000..7654813e8516 --- /dev/null +++ b/NetworkServices/src/V1/ExtensionChain/Extension.php @@ -0,0 +1,414 @@ +google.cloud.networkservices.v1.ExtensionChain.Extension + */ +class Extension extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name for this extension. + * The name is logged as part of the HTTP request logs. + * The name must conform with RFC-1034, is restricted to lower-cased + * letters, numbers and hyphens, and can have a maximum length of 63 + * characters. Additionally, the first character must be a letter and the + * last a letter or a number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The `:authority` header in the gRPC request sent from Envoy + * to the extension service. + * Required for Callout extensions. + * + * Generated from protobuf field string authority = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $authority = ''; + /** + * Required. The reference to the service that runs the extension. + * Currently only callout extensions are supported here. + * To configure a callout extension, `service` must be a fully-qualified + * reference + * to a [backend + * service](https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) + * in the format: + * `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}` + * or + * `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServices/{backendService}`. + * + * Generated from protobuf field string service = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = ''; + /** + * Optional. A set of events during request or response processing for which + * this extension is called. This field is required for the + * `LbTrafficExtension` resource. It must not be set for the + * `LbRouteExtension` resource. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.EventType supported_events = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $supported_events; + /** + * Optional. Specifies the timeout for each individual message on the + * stream. The timeout must be between 10-1000 milliseconds. Required for + * Callout extensions. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timeout = null; + /** + * Optional. Determines how the proxy behaves if the call to the extension + * fails or times out. + * When set to `TRUE`, request or response processing continues without + * error. Any subsequent extensions in the extension chain are also + * executed. When set to `FALSE` or the default setting of `FALSE` is used, + * one of the following happens: + * * If response headers have not been delivered to the downstream client, + * a generic 500 error is returned to the client. The error response can be + * tailored by configuring a custom error response in the load balancer. + * * If response headers have been delivered, then the HTTP stream to the + * downstream client is reset. + * + * Generated from protobuf field bool fail_open = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $fail_open = false; + /** + * Optional. List of the HTTP headers to forward to the extension + * (from the client or backend). If omitted, all headers are sent. + * Each element is a string indicating the header name. + * + * Generated from protobuf field repeated string forward_headers = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $forward_headers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name for this extension. + * The name is logged as part of the HTTP request logs. + * The name must conform with RFC-1034, is restricted to lower-cased + * letters, numbers and hyphens, and can have a maximum length of 63 + * characters. Additionally, the first character must be a letter and the + * last a letter or a number. + * @type string $authority + * Optional. The `:authority` header in the gRPC request sent from Envoy + * to the extension service. + * Required for Callout extensions. + * @type string $service + * Required. The reference to the service that runs the extension. + * Currently only callout extensions are supported here. + * To configure a callout extension, `service` must be a fully-qualified + * reference + * to a [backend + * service](https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) + * in the format: + * `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}` + * or + * `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServices/{backendService}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $supported_events + * Optional. A set of events during request or response processing for which + * this extension is called. This field is required for the + * `LbTrafficExtension` resource. It must not be set for the + * `LbRouteExtension` resource. + * @type \Google\Protobuf\Duration $timeout + * Optional. Specifies the timeout for each individual message on the + * stream. The timeout must be between 10-1000 milliseconds. Required for + * Callout extensions. + * @type bool $fail_open + * Optional. Determines how the proxy behaves if the call to the extension + * fails or times out. + * When set to `TRUE`, request or response processing continues without + * error. Any subsequent extensions in the extension chain are also + * executed. When set to `FALSE` or the default setting of `FALSE` is used, + * one of the following happens: + * * If response headers have not been delivered to the downstream client, + * a generic 500 error is returned to the client. The error response can be + * tailored by configuring a custom error response in the load balancer. + * * If response headers have been delivered, then the HTTP stream to the + * downstream client is reset. + * @type array|\Google\Protobuf\Internal\RepeatedField $forward_headers + * Optional. List of the HTTP headers to forward to the extension + * (from the client or backend). If omitted, all headers are sent. + * Each element is a string indicating the header name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name for this extension. + * The name is logged as part of the HTTP request logs. + * The name must conform with RFC-1034, is restricted to lower-cased + * letters, numbers and hyphens, and can have a maximum length of 63 + * characters. Additionally, the first character must be a letter and the + * last a letter or a number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name for this extension. + * The name is logged as part of the HTTP request logs. + * The name must conform with RFC-1034, is restricted to lower-cased + * letters, numbers and hyphens, and can have a maximum length of 63 + * characters. Additionally, the first character must be a letter and the + * last a letter or a number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The `:authority` header in the gRPC request sent from Envoy + * to the extension service. + * Required for Callout extensions. + * + * Generated from protobuf field string authority = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAuthority() + { + return $this->authority; + } + + /** + * Optional. The `:authority` header in the gRPC request sent from Envoy + * to the extension service. + * Required for Callout extensions. + * + * Generated from protobuf field string authority = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAuthority($var) + { + GPBUtil::checkString($var, True); + $this->authority = $var; + + return $this; + } + + /** + * Required. The reference to the service that runs the extension. + * Currently only callout extensions are supported here. + * To configure a callout extension, `service` must be a fully-qualified + * reference + * to a [backend + * service](https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) + * in the format: + * `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}` + * or + * `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServices/{backendService}`. + * + * Generated from protobuf field string service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Required. The reference to the service that runs the extension. + * Currently only callout extensions are supported here. + * To configure a callout extension, `service` must be a fully-qualified + * reference + * to a [backend + * service](https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) + * in the format: + * `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}` + * or + * `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServices/{backendService}`. + * + * Generated from protobuf field string service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * Optional. A set of events during request or response processing for which + * this extension is called. This field is required for the + * `LbTrafficExtension` resource. It must not be set for the + * `LbRouteExtension` resource. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.EventType supported_events = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedEvents() + { + return $this->supported_events; + } + + /** + * Optional. A set of events during request or response processing for which + * this extension is called. This field is required for the + * `LbTrafficExtension` resource. It must not be set for the + * `LbRouteExtension` resource. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.EventType supported_events = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\NetworkServices\V1\EventType::class); + $this->supported_events = $arr; + + return $this; + } + + /** + * Optional. Specifies the timeout for each individual message on the + * stream. The timeout must be between 10-1000 milliseconds. Required for + * Callout extensions. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Optional. Specifies the timeout for each individual message on the + * stream. The timeout must be between 10-1000 milliseconds. Required for + * Callout extensions. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Optional. Determines how the proxy behaves if the call to the extension + * fails or times out. + * When set to `TRUE`, request or response processing continues without + * error. Any subsequent extensions in the extension chain are also + * executed. When set to `FALSE` or the default setting of `FALSE` is used, + * one of the following happens: + * * If response headers have not been delivered to the downstream client, + * a generic 500 error is returned to the client. The error response can be + * tailored by configuring a custom error response in the load balancer. + * * If response headers have been delivered, then the HTTP stream to the + * downstream client is reset. + * + * Generated from protobuf field bool fail_open = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getFailOpen() + { + return $this->fail_open; + } + + /** + * Optional. Determines how the proxy behaves if the call to the extension + * fails or times out. + * When set to `TRUE`, request or response processing continues without + * error. Any subsequent extensions in the extension chain are also + * executed. When set to `FALSE` or the default setting of `FALSE` is used, + * one of the following happens: + * * If response headers have not been delivered to the downstream client, + * a generic 500 error is returned to the client. The error response can be + * tailored by configuring a custom error response in the load balancer. + * * If response headers have been delivered, then the HTTP stream to the + * downstream client is reset. + * + * Generated from protobuf field bool fail_open = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setFailOpen($var) + { + GPBUtil::checkBool($var); + $this->fail_open = $var; + + return $this; + } + + /** + * Optional. List of the HTTP headers to forward to the extension + * (from the client or backend). If omitted, all headers are sent. + * Each element is a string indicating the header name. + * + * Generated from protobuf field repeated string forward_headers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getForwardHeaders() + { + return $this->forward_headers; + } + + /** + * Optional. List of the HTTP headers to forward to the extension + * (from the client or backend). If omitted, all headers are sent. + * Each element is a string indicating the header name. + * + * Generated from protobuf field repeated string forward_headers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setForwardHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->forward_headers = $arr; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/ExtensionChain/MatchCondition.php b/NetworkServices/src/V1/ExtensionChain/MatchCondition.php new file mode 100644 index 000000000000..37dd5419254f --- /dev/null +++ b/NetworkServices/src/V1/ExtensionChain/MatchCondition.php @@ -0,0 +1,80 @@ +google.cloud.networkservices.v1.ExtensionChain.MatchCondition + */ +class MatchCondition extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A Common Expression Language (CEL) expression that is used to + * match requests for which the extension chain is executed. + * For more information, see [CEL matcher language + * reference](https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference). + * + * Generated from protobuf field string cel_expression = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cel_expression = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cel_expression + * Required. A Common Expression Language (CEL) expression that is used to + * match requests for which the extension chain is executed. + * For more information, see [CEL matcher language + * reference](https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. A Common Expression Language (CEL) expression that is used to + * match requests for which the extension chain is executed. + * For more information, see [CEL matcher language + * reference](https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference). + * + * Generated from protobuf field string cel_expression = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCelExpression() + { + return $this->cel_expression; + } + + /** + * Required. A Common Expression Language (CEL) expression that is used to + * match requests for which the extension chain is executed. + * For more information, see [CEL matcher language + * reference](https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference). + * + * Generated from protobuf field string cel_expression = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCelExpression($var) + { + GPBUtil::checkString($var, True); + $this->cel_expression = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/Gapic/DepServiceGapicClient.php b/NetworkServices/src/V1/Gapic/DepServiceGapicClient.php new file mode 100644 index 000000000000..79300bc735ba --- /dev/null +++ b/NetworkServices/src/V1/Gapic/DepServiceGapicClient.php @@ -0,0 +1,1454 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $lbRouteExtensionId = 'lb_route_extension_id'; + * $lbRouteExtension = new LbRouteExtension(); + * $operationResponse = $depServiceClient->createLbRouteExtension($formattedParent, $lbRouteExtensionId, $lbRouteExtension); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $depServiceClient->createLbRouteExtension($formattedParent, $lbRouteExtensionId, $lbRouteExtension); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $depServiceClient->resumeOperation($operationName, 'createLbRouteExtension'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated This class will be removed in the next major version update. + */ +class DepServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.networkservices.v1.DepService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'networkservices.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'networkservices.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $lbRouteExtensionNameTemplate; + + private static $lbTrafficExtensionNameTemplate; + + private static $locationNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/dep_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/dep_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/dep_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/dep_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getLbRouteExtensionNameTemplate() + { + if (self::$lbRouteExtensionNameTemplate == null) { + self::$lbRouteExtensionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}'); + } + + return self::$lbRouteExtensionNameTemplate; + } + + private static function getLbTrafficExtensionNameTemplate() + { + if (self::$lbTrafficExtensionNameTemplate == null) { + self::$lbTrafficExtensionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}'); + } + + return self::$lbTrafficExtensionNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'lbRouteExtension' => self::getLbRouteExtensionNameTemplate(), + 'lbTrafficExtension' => self::getLbTrafficExtensionNameTemplate(), + 'location' => self::getLocationNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * lb_route_extension resource. + * + * @param string $project + * @param string $location + * @param string $lbRouteExtension + * + * @return string The formatted lb_route_extension resource. + */ + public static function lbRouteExtensionName($project, $location, $lbRouteExtension) + { + return self::getLbRouteExtensionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'lb_route_extension' => $lbRouteExtension, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * lb_traffic_extension resource. + * + * @param string $project + * @param string $location + * @param string $lbTrafficExtension + * + * @return string The formatted lb_traffic_extension resource. + */ + public static function lbTrafficExtensionName($project, $location, $lbTrafficExtension) + { + return self::getLbTrafficExtensionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'lb_traffic_extension' => $lbTrafficExtension, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - lbRouteExtension: projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension} + * - lbTrafficExtension: projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension} + * - location: projects/{project}/locations/{location} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'networkservices.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a new `LbRouteExtension` resource in a given project and location. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $formattedParent = $depServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $lbRouteExtensionId = 'lb_route_extension_id'; + * $lbRouteExtension = new LbRouteExtension(); + * $operationResponse = $depServiceClient->createLbRouteExtension($formattedParent, $lbRouteExtensionId, $lbRouteExtension); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $depServiceClient->createLbRouteExtension($formattedParent, $lbRouteExtensionId, $lbRouteExtension); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $depServiceClient->resumeOperation($operationName, 'createLbRouteExtension'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the `LbRouteExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * @param string $lbRouteExtensionId Required. User-provided ID of the `LbRouteExtension` resource to be + * created. + * @param LbRouteExtension $lbRouteExtension Required. `LbRouteExtension` resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createLbRouteExtension($parent, $lbRouteExtensionId, $lbRouteExtension, array $optionalArgs = []) + { + $request = new CreateLbRouteExtensionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setLbRouteExtensionId($lbRouteExtensionId); + $request->setLbRouteExtension($lbRouteExtension); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateLbRouteExtension', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new `LbTrafficExtension` resource in a given project and + * location. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $formattedParent = $depServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $lbTrafficExtensionId = 'lb_traffic_extension_id'; + * $lbTrafficExtension = new LbTrafficExtension(); + * $operationResponse = $depServiceClient->createLbTrafficExtension($formattedParent, $lbTrafficExtensionId, $lbTrafficExtension); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $depServiceClient->createLbTrafficExtension($formattedParent, $lbTrafficExtensionId, $lbTrafficExtension); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $depServiceClient->resumeOperation($operationName, 'createLbTrafficExtension'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the `LbTrafficExtension` resource. Must be + * in the format `projects/{project}/locations/{location}`. + * @param string $lbTrafficExtensionId Required. User-provided ID of the `LbTrafficExtension` resource to be + * created. + * @param LbTrafficExtension $lbTrafficExtension Required. `LbTrafficExtension` resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createLbTrafficExtension($parent, $lbTrafficExtensionId, $lbTrafficExtension, array $optionalArgs = []) + { + $request = new CreateLbTrafficExtensionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setLbTrafficExtensionId($lbTrafficExtensionId); + $request->setLbTrafficExtension($lbTrafficExtension); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateLbTrafficExtension', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes the specified `LbRouteExtension` resource. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $formattedName = $depServiceClient->lbRouteExtensionName('[PROJECT]', '[LOCATION]', '[LB_ROUTE_EXTENSION]'); + * $operationResponse = $depServiceClient->deleteLbRouteExtension($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $depServiceClient->deleteLbRouteExtension($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $depServiceClient->resumeOperation($operationName, 'deleteLbRouteExtension'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the `LbRouteExtension` resource to delete. Must be in + * the format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteLbRouteExtension($name, array $optionalArgs = []) + { + $request = new DeleteLbRouteExtensionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteLbRouteExtension', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes the specified `LbTrafficExtension` resource. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $formattedName = $depServiceClient->lbTrafficExtensionName('[PROJECT]', '[LOCATION]', '[LB_TRAFFIC_EXTENSION]'); + * $operationResponse = $depServiceClient->deleteLbTrafficExtension($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $depServiceClient->deleteLbTrafficExtension($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $depServiceClient->resumeOperation($operationName, 'deleteLbTrafficExtension'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the `LbTrafficExtension` resource to delete. Must be + * in the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteLbTrafficExtension($name, array $optionalArgs = []) + { + $request = new DeleteLbTrafficExtensionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteLbTrafficExtension', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets details of the specified `LbRouteExtension` resource. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $formattedName = $depServiceClient->lbRouteExtensionName('[PROJECT]', '[LOCATION]', '[LB_ROUTE_EXTENSION]'); + * $response = $depServiceClient->getLbRouteExtension($formattedName); + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the `LbRouteExtension` resource to get. Must be in the + * format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\LbRouteExtension + * + * @throws ApiException if the remote call fails + */ + public function getLbRouteExtension($name, array $optionalArgs = []) + { + $request = new GetLbRouteExtensionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLbRouteExtension', LbRouteExtension::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of the specified `LbTrafficExtension` resource. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $formattedName = $depServiceClient->lbTrafficExtensionName('[PROJECT]', '[LOCATION]', '[LB_TRAFFIC_EXTENSION]'); + * $response = $depServiceClient->getLbTrafficExtension($formattedName); + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the `LbTrafficExtension` resource to get. Must be in + * the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\LbTrafficExtension + * + * @throws ApiException if the remote call fails + */ + public function getLbTrafficExtension($name, array $optionalArgs = []) + { + $request = new GetLbTrafficExtensionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLbTrafficExtension', LbTrafficExtension::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists `LbRouteExtension` resources in a given project and location. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $formattedParent = $depServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $depServiceClient->listLbRouteExtensions($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $depServiceClient->listLbRouteExtensions($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the `LbRouteExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results. + * @type string $orderBy + * Optional. Hint for how to order the results. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLbRouteExtensions($parent, array $optionalArgs = []) + { + $request = new ListLbRouteExtensionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLbRouteExtensions', $optionalArgs, ListLbRouteExtensionsResponse::class, $request); + } + + /** + * Lists `LbTrafficExtension` resources in a given project and location. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $formattedParent = $depServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $depServiceClient->listLbTrafficExtensions($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $depServiceClient->listLbTrafficExtensions($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the `LbTrafficExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results. + * @type string $orderBy + * Optional. Hint for how to order the results. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLbTrafficExtensions($parent, array $optionalArgs = []) + { + $request = new ListLbTrafficExtensionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLbTrafficExtensions', $optionalArgs, ListLbTrafficExtensionsResponse::class, $request); + } + + /** + * Updates the parameters of the specified `LbRouteExtension` resource. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $lbRouteExtension = new LbRouteExtension(); + * $operationResponse = $depServiceClient->updateLbRouteExtension($lbRouteExtension); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $depServiceClient->updateLbRouteExtension($lbRouteExtension); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $depServiceClient->resumeOperation($operationName, 'updateLbRouteExtension'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param LbRouteExtension $lbRouteExtension Required. `LbRouteExtension` resource being updated. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Used to specify the fields to be overwritten in the + * `LbRouteExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * @type string $requestId + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateLbRouteExtension($lbRouteExtension, array $optionalArgs = []) + { + $request = new UpdateLbRouteExtensionRequest(); + $requestParamHeaders = []; + $request->setLbRouteExtension($lbRouteExtension); + $requestParamHeaders['lb_route_extension.name'] = $lbRouteExtension->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateLbRouteExtension', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of the specified `LbTrafficExtension` resource. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $lbTrafficExtension = new LbTrafficExtension(); + * $operationResponse = $depServiceClient->updateLbTrafficExtension($lbTrafficExtension); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $depServiceClient->updateLbTrafficExtension($lbTrafficExtension); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $depServiceClient->resumeOperation($operationName, 'updateLbTrafficExtension'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param LbTrafficExtension $lbTrafficExtension Required. `LbTrafficExtension` resource being updated. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Used to specify the fields to be overwritten in the + * `LbTrafficExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * @type string $requestId + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateLbTrafficExtension($lbTrafficExtension, array $optionalArgs = []) + { + $request = new UpdateLbTrafficExtensionRequest(); + $requestParamHeaders = []; + $request->setLbTrafficExtension($lbTrafficExtension); + $requestParamHeaders['lb_traffic_extension.name'] = $lbTrafficExtension->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateLbTrafficExtension', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $response = $depServiceClient->getLocation(); + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $depServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $depServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $resource = 'resource'; + * $response = $depServiceClient->getIamPolicy($resource); + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $depServiceClient->setIamPolicy($resource, $policy); + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * Sample code: + * ``` + * $depServiceClient = new DepServiceClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $depServiceClient->testIamPermissions($resource, $permissions); + * } finally { + * $depServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } +} diff --git a/NetworkServices/src/V1/Gapic/NetworkServicesGapicClient.php b/NetworkServices/src/V1/Gapic/NetworkServicesGapicClient.php new file mode 100644 index 000000000000..62d0585f837e --- /dev/null +++ b/NetworkServices/src/V1/Gapic/NetworkServicesGapicClient.php @@ -0,0 +1,3503 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $endpointPolicyId = 'endpoint_policy_id'; + * $endpointPolicy = new EndpointPolicy(); + * $operationResponse = $networkServicesClient->createEndpointPolicy($formattedParent, $endpointPolicyId, $endpointPolicy); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->createEndpointPolicy($formattedParent, $endpointPolicyId, $endpointPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'createEndpointPolicy'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated This class will be removed in the next major version update. + */ +class NetworkServicesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.networkservices.v1.NetworkServices'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'networkservices.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'networkservices.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $authorizationPolicyNameTemplate; + + private static $backendServiceNameTemplate; + + private static $clientTlsPolicyNameTemplate; + + private static $endpointPolicyNameTemplate; + + private static $gatewayNameTemplate; + + private static $grpcRouteNameTemplate; + + private static $httpRouteNameTemplate; + + private static $locationNameTemplate; + + private static $meshNameTemplate; + + private static $serverTlsPolicyNameTemplate; + + private static $serviceBindingNameTemplate; + + private static $tcpRouteNameTemplate; + + private static $tlsRouteNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/network_services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_services_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/network_services_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_services_rest_client_config.php', + ], + ], + ]; + } + + private static function getAuthorizationPolicyNameTemplate() + { + if (self::$authorizationPolicyNameTemplate == null) { + self::$authorizationPolicyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}'); + } + + return self::$authorizationPolicyNameTemplate; + } + + private static function getBackendServiceNameTemplate() + { + if (self::$backendServiceNameTemplate == null) { + self::$backendServiceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/backendServices/{backend_service}'); + } + + return self::$backendServiceNameTemplate; + } + + private static function getClientTlsPolicyNameTemplate() + { + if (self::$clientTlsPolicyNameTemplate == null) { + self::$clientTlsPolicyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}'); + } + + return self::$clientTlsPolicyNameTemplate; + } + + private static function getEndpointPolicyNameTemplate() + { + if (self::$endpointPolicyNameTemplate == null) { + self::$endpointPolicyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/endpointPolicies/{endpoint_policy}'); + } + + return self::$endpointPolicyNameTemplate; + } + + private static function getGatewayNameTemplate() + { + if (self::$gatewayNameTemplate == null) { + self::$gatewayNameTemplate = new PathTemplate('projects/{project}/locations/{location}/gateways/{gateway}'); + } + + return self::$gatewayNameTemplate; + } + + private static function getGrpcRouteNameTemplate() + { + if (self::$grpcRouteNameTemplate == null) { + self::$grpcRouteNameTemplate = new PathTemplate('projects/{project}/locations/{location}/grpcRoutes/{grpc_route}'); + } + + return self::$grpcRouteNameTemplate; + } + + private static function getHttpRouteNameTemplate() + { + if (self::$httpRouteNameTemplate == null) { + self::$httpRouteNameTemplate = new PathTemplate('projects/{project}/locations/{location}/httpRoutes/{http_route}'); + } + + return self::$httpRouteNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getMeshNameTemplate() + { + if (self::$meshNameTemplate == null) { + self::$meshNameTemplate = new PathTemplate('projects/{project}/locations/{location}/meshes/{mesh}'); + } + + return self::$meshNameTemplate; + } + + private static function getServerTlsPolicyNameTemplate() + { + if (self::$serverTlsPolicyNameTemplate == null) { + self::$serverTlsPolicyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}'); + } + + return self::$serverTlsPolicyNameTemplate; + } + + private static function getServiceBindingNameTemplate() + { + if (self::$serviceBindingNameTemplate == null) { + self::$serviceBindingNameTemplate = new PathTemplate('projects/{project}/locations/{location}/serviceBindings/{service_binding}'); + } + + return self::$serviceBindingNameTemplate; + } + + private static function getTcpRouteNameTemplate() + { + if (self::$tcpRouteNameTemplate == null) { + self::$tcpRouteNameTemplate = new PathTemplate('projects/{project}/locations/{location}/tcpRoutes/{tcp_route}'); + } + + return self::$tcpRouteNameTemplate; + } + + private static function getTlsRouteNameTemplate() + { + if (self::$tlsRouteNameTemplate == null) { + self::$tlsRouteNameTemplate = new PathTemplate('projects/{project}/locations/{location}/tlsRoutes/{tls_route}'); + } + + return self::$tlsRouteNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'authorizationPolicy' => self::getAuthorizationPolicyNameTemplate(), + 'backendService' => self::getBackendServiceNameTemplate(), + 'clientTlsPolicy' => self::getClientTlsPolicyNameTemplate(), + 'endpointPolicy' => self::getEndpointPolicyNameTemplate(), + 'gateway' => self::getGatewayNameTemplate(), + 'grpcRoute' => self::getGrpcRouteNameTemplate(), + 'httpRoute' => self::getHttpRouteNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'mesh' => self::getMeshNameTemplate(), + 'serverTlsPolicy' => self::getServerTlsPolicyNameTemplate(), + 'serviceBinding' => self::getServiceBindingNameTemplate(), + 'tcpRoute' => self::getTcpRouteNameTemplate(), + 'tlsRoute' => self::getTlsRouteNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * authorization_policy resource. + * + * @param string $project + * @param string $location + * @param string $authorizationPolicy + * + * @return string The formatted authorization_policy resource. + */ + public static function authorizationPolicyName($project, $location, $authorizationPolicy) + { + return self::getAuthorizationPolicyNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'authorization_policy' => $authorizationPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * backend_service resource. + * + * @param string $project + * @param string $location + * @param string $backendService + * + * @return string The formatted backend_service resource. + */ + public static function backendServiceName($project, $location, $backendService) + { + return self::getBackendServiceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'backend_service' => $backendService, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * client_tls_policy resource. + * + * @param string $project + * @param string $location + * @param string $clientTlsPolicy + * + * @return string The formatted client_tls_policy resource. + */ + public static function clientTlsPolicyName($project, $location, $clientTlsPolicy) + { + return self::getClientTlsPolicyNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'client_tls_policy' => $clientTlsPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * endpoint_policy resource. + * + * @param string $project + * @param string $location + * @param string $endpointPolicy + * + * @return string The formatted endpoint_policy resource. + */ + public static function endpointPolicyName($project, $location, $endpointPolicy) + { + return self::getEndpointPolicyNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'endpoint_policy' => $endpointPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a gateway + * resource. + * + * @param string $project + * @param string $location + * @param string $gateway + * + * @return string The formatted gateway resource. + */ + public static function gatewayName($project, $location, $gateway) + { + return self::getGatewayNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'gateway' => $gateway, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a grpc_route + * resource. + * + * @param string $project + * @param string $location + * @param string $grpcRoute + * + * @return string The formatted grpc_route resource. + */ + public static function grpcRouteName($project, $location, $grpcRoute) + { + return self::getGrpcRouteNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'grpc_route' => $grpcRoute, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a http_route + * resource. + * + * @param string $project + * @param string $location + * @param string $httpRoute + * + * @return string The formatted http_route resource. + */ + public static function httpRouteName($project, $location, $httpRoute) + { + return self::getHttpRouteNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'http_route' => $httpRoute, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a mesh + * resource. + * + * @param string $project + * @param string $location + * @param string $mesh + * + * @return string The formatted mesh resource. + */ + public static function meshName($project, $location, $mesh) + { + return self::getMeshNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'mesh' => $mesh, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * server_tls_policy resource. + * + * @param string $project + * @param string $location + * @param string $serverTlsPolicy + * + * @return string The formatted server_tls_policy resource. + */ + public static function serverTlsPolicyName($project, $location, $serverTlsPolicy) + { + return self::getServerTlsPolicyNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'server_tls_policy' => $serverTlsPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * service_binding resource. + * + * @param string $project + * @param string $location + * @param string $serviceBinding + * + * @return string The formatted service_binding resource. + */ + public static function serviceBindingName($project, $location, $serviceBinding) + { + return self::getServiceBindingNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'service_binding' => $serviceBinding, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a tcp_route + * resource. + * + * @param string $project + * @param string $location + * @param string $tcpRoute + * + * @return string The formatted tcp_route resource. + */ + public static function tcpRouteName($project, $location, $tcpRoute) + { + return self::getTcpRouteNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'tcp_route' => $tcpRoute, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a tls_route + * resource. + * + * @param string $project + * @param string $location + * @param string $tlsRoute + * + * @return string The formatted tls_route resource. + */ + public static function tlsRouteName($project, $location, $tlsRoute) + { + return self::getTlsRouteNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'tls_route' => $tlsRoute, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - authorizationPolicy: projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy} + * - backendService: projects/{project}/locations/{location}/backendServices/{backend_service} + * - clientTlsPolicy: projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy} + * - endpointPolicy: projects/{project}/locations/{location}/endpointPolicies/{endpoint_policy} + * - gateway: projects/{project}/locations/{location}/gateways/{gateway} + * - grpcRoute: projects/{project}/locations/{location}/grpcRoutes/{grpc_route} + * - httpRoute: projects/{project}/locations/{location}/httpRoutes/{http_route} + * - location: projects/{project}/locations/{location} + * - mesh: projects/{project}/locations/{location}/meshes/{mesh} + * - serverTlsPolicy: projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy} + * - serviceBinding: projects/{project}/locations/{location}/serviceBindings/{service_binding} + * - tcpRoute: projects/{project}/locations/{location}/tcpRoutes/{tcp_route} + * - tlsRoute: projects/{project}/locations/{location}/tlsRoutes/{tls_route} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'networkservices.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a new EndpointPolicy in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * $endpointPolicyId = 'endpoint_policy_id'; + * $endpointPolicy = new EndpointPolicy(); + * $operationResponse = $networkServicesClient->createEndpointPolicy($formattedParent, $endpointPolicyId, $endpointPolicy); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->createEndpointPolicy($formattedParent, $endpointPolicyId, $endpointPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'createEndpointPolicy'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the EndpointPolicy. Must be in the + * format `projects/*/locations/global`. + * @param string $endpointPolicyId Required. Short name of the EndpointPolicy resource to be created. + * E.g. "CustomECS". + * @param EndpointPolicy $endpointPolicy Required. EndpointPolicy resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createEndpointPolicy($parent, $endpointPolicyId, $endpointPolicy, array $optionalArgs = []) + { + $request = new CreateEndpointPolicyRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEndpointPolicyId($endpointPolicyId); + $request->setEndpointPolicy($endpointPolicy); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateEndpointPolicy', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Gateway in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * $gatewayId = 'gateway_id'; + * $gateway = new Gateway(); + * $operationResponse = $networkServicesClient->createGateway($formattedParent, $gatewayId, $gateway); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->createGateway($formattedParent, $gatewayId, $gateway); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'createGateway'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the Gateway. Must be in the + * format `projects/*/locations/*`. + * @param string $gatewayId Required. Short name of the Gateway resource to be created. + * @param Gateway $gateway Required. Gateway resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createGateway($parent, $gatewayId, $gateway, array $optionalArgs = []) + { + $request = new CreateGatewayRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setGatewayId($gatewayId); + $request->setGateway($gateway); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateGateway', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new GrpcRoute in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * $grpcRouteId = 'grpc_route_id'; + * $grpcRoute = new GrpcRoute(); + * $operationResponse = $networkServicesClient->createGrpcRoute($formattedParent, $grpcRouteId, $grpcRoute); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->createGrpcRoute($formattedParent, $grpcRouteId, $grpcRoute); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'createGrpcRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the GrpcRoute. Must be in the + * format `projects/*/locations/global`. + * @param string $grpcRouteId Required. Short name of the GrpcRoute resource to be created. + * @param GrpcRoute $grpcRoute Required. GrpcRoute resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createGrpcRoute($parent, $grpcRouteId, $grpcRoute, array $optionalArgs = []) + { + $request = new CreateGrpcRouteRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setGrpcRouteId($grpcRouteId); + $request->setGrpcRoute($grpcRoute); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateGrpcRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new HttpRoute in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * $httpRouteId = 'http_route_id'; + * $httpRoute = new HttpRoute(); + * $operationResponse = $networkServicesClient->createHttpRoute($formattedParent, $httpRouteId, $httpRoute); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->createHttpRoute($formattedParent, $httpRouteId, $httpRoute); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'createHttpRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the HttpRoute. Must be in the + * format `projects/*/locations/global`. + * @param string $httpRouteId Required. Short name of the HttpRoute resource to be created. + * @param HttpRoute $httpRoute Required. HttpRoute resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createHttpRoute($parent, $httpRouteId, $httpRoute, array $optionalArgs = []) + { + $request = new CreateHttpRouteRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setHttpRouteId($httpRouteId); + $request->setHttpRoute($httpRoute); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateHttpRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Mesh in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * $meshId = 'mesh_id'; + * $mesh = new Mesh(); + * $operationResponse = $networkServicesClient->createMesh($formattedParent, $meshId, $mesh); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->createMesh($formattedParent, $meshId, $mesh); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'createMesh'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the Mesh. Must be in the + * format `projects/*/locations/global`. + * @param string $meshId Required. Short name of the Mesh resource to be created. + * @param Mesh $mesh Required. Mesh resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createMesh($parent, $meshId, $mesh, array $optionalArgs = []) + { + $request = new CreateMeshRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setMeshId($meshId); + $request->setMesh($mesh); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateMesh', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new ServiceBinding in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * $serviceBindingId = 'service_binding_id'; + * $serviceBinding = new ServiceBinding(); + * $operationResponse = $networkServicesClient->createServiceBinding($formattedParent, $serviceBindingId, $serviceBinding); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->createServiceBinding($formattedParent, $serviceBindingId, $serviceBinding); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'createServiceBinding'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the ServiceBinding. Must be in the + * format `projects/*/locations/global`. + * @param string $serviceBindingId Required. Short name of the ServiceBinding resource to be created. + * @param ServiceBinding $serviceBinding Required. ServiceBinding resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createServiceBinding($parent, $serviceBindingId, $serviceBinding, array $optionalArgs = []) + { + $request = new CreateServiceBindingRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setServiceBindingId($serviceBindingId); + $request->setServiceBinding($serviceBinding); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateServiceBinding', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new TcpRoute in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * $tcpRouteId = 'tcp_route_id'; + * $tcpRoute = new TcpRoute(); + * $operationResponse = $networkServicesClient->createTcpRoute($formattedParent, $tcpRouteId, $tcpRoute); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->createTcpRoute($formattedParent, $tcpRouteId, $tcpRoute); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'createTcpRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the TcpRoute. Must be in the + * format `projects/*/locations/global`. + * @param string $tcpRouteId Required. Short name of the TcpRoute resource to be created. + * @param TcpRoute $tcpRoute Required. TcpRoute resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createTcpRoute($parent, $tcpRouteId, $tcpRoute, array $optionalArgs = []) + { + $request = new CreateTcpRouteRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTcpRouteId($tcpRouteId); + $request->setTcpRoute($tcpRoute); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateTcpRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new TlsRoute in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * $tlsRouteId = 'tls_route_id'; + * $tlsRoute = new TlsRoute(); + * $operationResponse = $networkServicesClient->createTlsRoute($formattedParent, $tlsRouteId, $tlsRoute); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->createTlsRoute($formattedParent, $tlsRouteId, $tlsRoute); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'createTlsRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the TlsRoute. Must be in the + * format `projects/*/locations/global`. + * @param string $tlsRouteId Required. Short name of the TlsRoute resource to be created. + * @param TlsRoute $tlsRoute Required. TlsRoute resource to be created. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createTlsRoute($parent, $tlsRouteId, $tlsRoute, array $optionalArgs = []) + { + $request = new CreateTlsRouteRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTlsRouteId($tlsRouteId); + $request->setTlsRoute($tlsRoute); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateTlsRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single EndpointPolicy. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->endpointPolicyName('[PROJECT]', '[LOCATION]', '[ENDPOINT_POLICY]'); + * $operationResponse = $networkServicesClient->deleteEndpointPolicy($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->deleteEndpointPolicy($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'deleteEndpointPolicy'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the EndpointPolicy to delete. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteEndpointPolicy($name, array $optionalArgs = []) + { + $request = new DeleteEndpointPolicyRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteEndpointPolicy', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single Gateway. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->gatewayName('[PROJECT]', '[LOCATION]', '[GATEWAY]'); + * $operationResponse = $networkServicesClient->deleteGateway($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->deleteGateway($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'deleteGateway'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the Gateway to delete. Must be in the format + * `projects/*/locations/*/gateways/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteGateway($name, array $optionalArgs = []) + { + $request = new DeleteGatewayRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteGateway', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single GrpcRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->grpcRouteName('[PROJECT]', '[LOCATION]', '[GRPC_ROUTE]'); + * $operationResponse = $networkServicesClient->deleteGrpcRoute($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->deleteGrpcRoute($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'deleteGrpcRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the GrpcRoute to delete. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteGrpcRoute($name, array $optionalArgs = []) + { + $request = new DeleteGrpcRouteRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteGrpcRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single HttpRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->httpRouteName('[PROJECT]', '[LOCATION]', '[HTTP_ROUTE]'); + * $operationResponse = $networkServicesClient->deleteHttpRoute($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->deleteHttpRoute($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'deleteHttpRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the HttpRoute to delete. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteHttpRoute($name, array $optionalArgs = []) + { + $request = new DeleteHttpRouteRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteHttpRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single Mesh. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->meshName('[PROJECT]', '[LOCATION]', '[MESH]'); + * $operationResponse = $networkServicesClient->deleteMesh($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->deleteMesh($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'deleteMesh'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the Mesh to delete. Must be in the format + * `projects/*/locations/global/meshes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteMesh($name, array $optionalArgs = []) + { + $request = new DeleteMeshRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteMesh', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single ServiceBinding. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->serviceBindingName('[PROJECT]', '[LOCATION]', '[SERVICE_BINDING]'); + * $operationResponse = $networkServicesClient->deleteServiceBinding($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->deleteServiceBinding($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'deleteServiceBinding'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the ServiceBinding to delete. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteServiceBinding($name, array $optionalArgs = []) + { + $request = new DeleteServiceBindingRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteServiceBinding', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single TcpRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->tcpRouteName('[PROJECT]', '[LOCATION]', '[TCP_ROUTE]'); + * $operationResponse = $networkServicesClient->deleteTcpRoute($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->deleteTcpRoute($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'deleteTcpRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the TcpRoute to delete. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteTcpRoute($name, array $optionalArgs = []) + { + $request = new DeleteTcpRouteRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteTcpRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single TlsRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->tlsRouteName('[PROJECT]', '[LOCATION]', '[TLS_ROUTE]'); + * $operationResponse = $networkServicesClient->deleteTlsRoute($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->deleteTlsRoute($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'deleteTlsRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the TlsRoute to delete. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteTlsRoute($name, array $optionalArgs = []) + { + $request = new DeleteTlsRouteRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteTlsRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets details of a single EndpointPolicy. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->endpointPolicyName('[PROJECT]', '[LOCATION]', '[ENDPOINT_POLICY]'); + * $response = $networkServicesClient->getEndpointPolicy($formattedName); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the EndpointPolicy to get. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\EndpointPolicy + * + * @throws ApiException if the remote call fails + */ + public function getEndpointPolicy($name, array $optionalArgs = []) + { + $request = new GetEndpointPolicyRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetEndpointPolicy', EndpointPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Gateway. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->gatewayName('[PROJECT]', '[LOCATION]', '[GATEWAY]'); + * $response = $networkServicesClient->getGateway($formattedName); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the Gateway to get. Must be in the format + * `projects/*/locations/*/gateways/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\Gateway + * + * @throws ApiException if the remote call fails + */ + public function getGateway($name, array $optionalArgs = []) + { + $request = new GetGatewayRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetGateway', Gateway::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single GrpcRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->grpcRouteName('[PROJECT]', '[LOCATION]', '[GRPC_ROUTE]'); + * $response = $networkServicesClient->getGrpcRoute($formattedName); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the GrpcRoute to get. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\GrpcRoute + * + * @throws ApiException if the remote call fails + */ + public function getGrpcRoute($name, array $optionalArgs = []) + { + $request = new GetGrpcRouteRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetGrpcRoute', GrpcRoute::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single HttpRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->httpRouteName('[PROJECT]', '[LOCATION]', '[HTTP_ROUTE]'); + * $response = $networkServicesClient->getHttpRoute($formattedName); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the HttpRoute to get. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\HttpRoute + * + * @throws ApiException if the remote call fails + */ + public function getHttpRoute($name, array $optionalArgs = []) + { + $request = new GetHttpRouteRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetHttpRoute', HttpRoute::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Mesh. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->meshName('[PROJECT]', '[LOCATION]', '[MESH]'); + * $response = $networkServicesClient->getMesh($formattedName); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the Mesh to get. Must be in the format + * `projects/*/locations/global/meshes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\Mesh + * + * @throws ApiException if the remote call fails + */ + public function getMesh($name, array $optionalArgs = []) + { + $request = new GetMeshRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetMesh', Mesh::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single ServiceBinding. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->serviceBindingName('[PROJECT]', '[LOCATION]', '[SERVICE_BINDING]'); + * $response = $networkServicesClient->getServiceBinding($formattedName); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the ServiceBinding to get. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\ServiceBinding + * + * @throws ApiException if the remote call fails + */ + public function getServiceBinding($name, array $optionalArgs = []) + { + $request = new GetServiceBindingRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetServiceBinding', ServiceBinding::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single TcpRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->tcpRouteName('[PROJECT]', '[LOCATION]', '[TCP_ROUTE]'); + * $response = $networkServicesClient->getTcpRoute($formattedName); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the TcpRoute to get. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\TcpRoute + * + * @throws ApiException if the remote call fails + */ + public function getTcpRoute($name, array $optionalArgs = []) + { + $request = new GetTcpRouteRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetTcpRoute', TcpRoute::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single TlsRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedName = $networkServicesClient->tlsRouteName('[PROJECT]', '[LOCATION]', '[TLS_ROUTE]'); + * $response = $networkServicesClient->getTlsRoute($formattedName); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the TlsRoute to get. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\NetworkServices\V1\TlsRoute + * + * @throws ApiException if the remote call fails + */ + public function getTlsRoute($name, array $optionalArgs = []) + { + $request = new GetTlsRouteRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetTlsRoute', TlsRoute::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists EndpointPolicies in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $networkServicesClient->listEndpointPolicies($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkServicesClient->listEndpointPolicies($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the EndpointPolicies should + * be listed, specified in the format `projects/*/locations/global`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listEndpointPolicies($parent, array $optionalArgs = []) + { + $request = new ListEndpointPoliciesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListEndpointPolicies', $optionalArgs, ListEndpointPoliciesResponse::class, $request); + } + + /** + * Lists Gateways in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $networkServicesClient->listGateways($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkServicesClient->listGateways($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the Gateways should be + * listed, specified in the format `projects/*/locations/*`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listGateways($parent, array $optionalArgs = []) + { + $request = new ListGatewaysRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListGateways', $optionalArgs, ListGatewaysResponse::class, $request); + } + + /** + * Lists GrpcRoutes in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $networkServicesClient->listGrpcRoutes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkServicesClient->listGrpcRoutes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the GrpcRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listGrpcRoutes($parent, array $optionalArgs = []) + { + $request = new ListGrpcRoutesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListGrpcRoutes', $optionalArgs, ListGrpcRoutesResponse::class, $request); + } + + /** + * Lists HttpRoute in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $networkServicesClient->listHttpRoutes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkServicesClient->listHttpRoutes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the HttpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listHttpRoutes($parent, array $optionalArgs = []) + { + $request = new ListHttpRoutesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListHttpRoutes', $optionalArgs, ListHttpRoutesResponse::class, $request); + } + + /** + * Lists Meshes in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $networkServicesClient->listMeshes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkServicesClient->listMeshes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the Meshes should be + * listed, specified in the format `projects/*/locations/global`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listMeshes($parent, array $optionalArgs = []) + { + $request = new ListMeshesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListMeshes', $optionalArgs, ListMeshesResponse::class, $request); + } + + /** + * Lists ServiceBinding in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $networkServicesClient->listServiceBindings($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkServicesClient->listServiceBindings($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the ServiceBindings should be + * listed, specified in the format `projects/*/locations/global`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listServiceBindings($parent, array $optionalArgs = []) + { + $request = new ListServiceBindingsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListServiceBindings', $optionalArgs, ListServiceBindingsResponse::class, $request); + } + + /** + * Lists TcpRoute in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $networkServicesClient->listTcpRoutes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkServicesClient->listTcpRoutes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the TcpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listTcpRoutes($parent, array $optionalArgs = []) + { + $request = new ListTcpRoutesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListTcpRoutes', $optionalArgs, ListTcpRoutesResponse::class, $request); + } + + /** + * Lists TlsRoute in a given project and location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $formattedParent = $networkServicesClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $networkServicesClient->listTlsRoutes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkServicesClient->listTlsRoutes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location from which the TlsRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listTlsRoutes($parent, array $optionalArgs = []) + { + $request = new ListTlsRoutesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListTlsRoutes', $optionalArgs, ListTlsRoutesResponse::class, $request); + } + + /** + * Updates the parameters of a single EndpointPolicy. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $endpointPolicy = new EndpointPolicy(); + * $operationResponse = $networkServicesClient->updateEndpointPolicy($endpointPolicy); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->updateEndpointPolicy($endpointPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'updateEndpointPolicy'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param EndpointPolicy $endpointPolicy Required. Updated EndpointPolicy resource. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * EndpointPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateEndpointPolicy($endpointPolicy, array $optionalArgs = []) + { + $request = new UpdateEndpointPolicyRequest(); + $requestParamHeaders = []; + $request->setEndpointPolicy($endpointPolicy); + $requestParamHeaders['endpoint_policy.name'] = $endpointPolicy->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateEndpointPolicy', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Gateway. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $gateway = new Gateway(); + * $operationResponse = $networkServicesClient->updateGateway($gateway); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->updateGateway($gateway); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'updateGateway'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param Gateway $gateway Required. Updated Gateway resource. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Gateway resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateGateway($gateway, array $optionalArgs = []) + { + $request = new UpdateGatewayRequest(); + $requestParamHeaders = []; + $request->setGateway($gateway); + $requestParamHeaders['gateway.name'] = $gateway->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateGateway', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single GrpcRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $grpcRoute = new GrpcRoute(); + * $operationResponse = $networkServicesClient->updateGrpcRoute($grpcRoute); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->updateGrpcRoute($grpcRoute); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'updateGrpcRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param GrpcRoute $grpcRoute Required. Updated GrpcRoute resource. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * GrpcRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateGrpcRoute($grpcRoute, array $optionalArgs = []) + { + $request = new UpdateGrpcRouteRequest(); + $requestParamHeaders = []; + $request->setGrpcRoute($grpcRoute); + $requestParamHeaders['grpc_route.name'] = $grpcRoute->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateGrpcRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single HttpRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $httpRoute = new HttpRoute(); + * $operationResponse = $networkServicesClient->updateHttpRoute($httpRoute); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->updateHttpRoute($httpRoute); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'updateHttpRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param HttpRoute $httpRoute Required. Updated HttpRoute resource. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * HttpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateHttpRoute($httpRoute, array $optionalArgs = []) + { + $request = new UpdateHttpRouteRequest(); + $requestParamHeaders = []; + $request->setHttpRoute($httpRoute); + $requestParamHeaders['http_route.name'] = $httpRoute->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateHttpRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Mesh. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $mesh = new Mesh(); + * $operationResponse = $networkServicesClient->updateMesh($mesh); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->updateMesh($mesh); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'updateMesh'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param Mesh $mesh Required. Updated Mesh resource. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Mesh resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateMesh($mesh, array $optionalArgs = []) + { + $request = new UpdateMeshRequest(); + $requestParamHeaders = []; + $request->setMesh($mesh); + $requestParamHeaders['mesh.name'] = $mesh->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateMesh', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single TcpRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $tcpRoute = new TcpRoute(); + * $operationResponse = $networkServicesClient->updateTcpRoute($tcpRoute); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->updateTcpRoute($tcpRoute); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'updateTcpRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param TcpRoute $tcpRoute Required. Updated TcpRoute resource. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * TcpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateTcpRoute($tcpRoute, array $optionalArgs = []) + { + $request = new UpdateTcpRouteRequest(); + $requestParamHeaders = []; + $request->setTcpRoute($tcpRoute); + $requestParamHeaders['tcp_route.name'] = $tcpRoute->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateTcpRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single TlsRoute. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $tlsRoute = new TlsRoute(); + * $operationResponse = $networkServicesClient->updateTlsRoute($tlsRoute); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $networkServicesClient->updateTlsRoute($tlsRoute); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkServicesClient->resumeOperation($operationName, 'updateTlsRoute'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param TlsRoute $tlsRoute Required. Updated TlsRoute resource. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * TlsRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateTlsRoute($tlsRoute, array $optionalArgs = []) + { + $request = new UpdateTlsRouteRequest(); + $requestParamHeaders = []; + $request->setTlsRoute($tlsRoute); + $requestParamHeaders['tls_route.name'] = $tlsRoute->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateTlsRoute', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $response = $networkServicesClient->getLocation(); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $networkServicesClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkServicesClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $resource = 'resource'; + * $response = $networkServicesClient->getIamPolicy($resource); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $networkServicesClient->setIamPolicy($resource, $policy); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * Sample code: + * ``` + * $networkServicesClient = new NetworkServicesClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $networkServicesClient->testIamPermissions($resource, $permissions); + * } finally { + * $networkServicesClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } +} diff --git a/NetworkServices/src/V1/Gateway.php b/NetworkServices/src/V1/Gateway.php new file mode 100644 index 000000000000..234827599ae4 --- /dev/null +++ b/NetworkServices/src/V1/Gateway.php @@ -0,0 +1,444 @@ +google.cloud.networkservices.v1.Gateway + */ +class Gateway extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the Gateway resource. It matches pattern + * `projects/*/locations/*/gateways/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $self_link = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Set of label tags associated with the Gateway resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Immutable. The type of the customer managed gateway. + * This field is required. If unspecified, an error is returned. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Gateway.Type type = 6 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $type = 0; + /** + * Required. One or more ports that the Gateway must receive traffic on. The + * proxy binds to the ports specified. Gateway listen on 0.0.0.0 on the ports + * specified below. + * + * Generated from protobuf field repeated int32 ports = 11 [(.google.api.field_behavior) = REQUIRED]; + */ + private $ports; + /** + * Required. Immutable. Scope determines how configuration across multiple + * Gateway instances are merged. The configuration for multiple Gateway + * instances with the same scope will be merged as presented as a single + * coniguration to the proxy/load balancer. + * Max length 64 characters. + * Scope should start with a letter and can only have letters, numbers, + * hyphens. + * + * Generated from protobuf field string scope = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $scope = ''; + /** + * Optional. A fully-qualified ServerTLSPolicy URL reference. Specifies how + * TLS traffic is terminated. If empty, TLS termination is disabled. + * + * Generated from protobuf field string server_tls_policy = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $server_tls_policy = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the Gateway resource. It matches pattern + * `projects/*/locations/*/gateways/`. + * @type string $self_link + * Output only. Server-defined URL of this resource + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Set of label tags associated with the Gateway resource. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type int $type + * Immutable. The type of the customer managed gateway. + * This field is required. If unspecified, an error is returned. + * @type array|\Google\Protobuf\Internal\RepeatedField $ports + * Required. One or more ports that the Gateway must receive traffic on. The + * proxy binds to the ports specified. Gateway listen on 0.0.0.0 on the ports + * specified below. + * @type string $scope + * Required. Immutable. Scope determines how configuration across multiple + * Gateway instances are merged. The configuration for multiple Gateway + * instances with the same scope will be merged as presented as a single + * coniguration to the proxy/load balancer. + * Max length 64 characters. + * Scope should start with a letter and can only have letters, numbers, + * hyphens. + * @type string $server_tls_policy + * Optional. A fully-qualified ServerTLSPolicy URL reference. Specifies how + * TLS traffic is terminated. If empty, TLS termination is disabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Gateway::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the Gateway resource. It matches pattern + * `projects/*/locations/*/gateways/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the Gateway resource. It matches pattern + * `projects/*/locations/*/gateways/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSelfLink() + { + return $this->self_link; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSelfLink($var) + { + GPBUtil::checkString($var, True); + $this->self_link = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Set of label tags associated with the Gateway resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Set of label tags associated with the Gateway resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Immutable. The type of the customer managed gateway. + * This field is required. If unspecified, an error is returned. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Gateway.Type type = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Immutable. The type of the customer managed gateway. + * This field is required. If unspecified, an error is returned. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Gateway.Type type = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\Gateway\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Required. One or more ports that the Gateway must receive traffic on. The + * proxy binds to the ports specified. Gateway listen on 0.0.0.0 on the ports + * specified below. + * + * Generated from protobuf field repeated int32 ports = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPorts() + { + return $this->ports; + } + + /** + * Required. One or more ports that the Gateway must receive traffic on. The + * proxy binds to the ports specified. Gateway listen on 0.0.0.0 on the ports + * specified below. + * + * Generated from protobuf field repeated int32 ports = 11 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->ports = $arr; + + return $this; + } + + /** + * Required. Immutable. Scope determines how configuration across multiple + * Gateway instances are merged. The configuration for multiple Gateway + * instances with the same scope will be merged as presented as a single + * coniguration to the proxy/load balancer. + * Max length 64 characters. + * Scope should start with a letter and can only have letters, numbers, + * hyphens. + * + * Generated from protobuf field string scope = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * Required. Immutable. Scope determines how configuration across multiple + * Gateway instances are merged. The configuration for multiple Gateway + * instances with the same scope will be merged as presented as a single + * coniguration to the proxy/load balancer. + * Max length 64 characters. + * Scope should start with a letter and can only have letters, numbers, + * hyphens. + * + * Generated from protobuf field string scope = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + + /** + * Optional. A fully-qualified ServerTLSPolicy URL reference. Specifies how + * TLS traffic is terminated. If empty, TLS termination is disabled. + * + * Generated from protobuf field string server_tls_policy = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServerTlsPolicy() + { + return $this->server_tls_policy; + } + + /** + * Optional. A fully-qualified ServerTLSPolicy URL reference. Specifies how + * TLS traffic is terminated. If empty, TLS termination is disabled. + * + * Generated from protobuf field string server_tls_policy = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServerTlsPolicy($var) + { + GPBUtil::checkString($var, True); + $this->server_tls_policy = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/Gateway/Type.php b/NetworkServices/src/V1/Gateway/Type.php new file mode 100644 index 000000000000..db55d3853089 --- /dev/null +++ b/NetworkServices/src/V1/Gateway/Type.php @@ -0,0 +1,66 @@ +google.cloud.networkservices.v1.Gateway.Type + */ +class Type +{ + /** + * The type of the customer managed gateway is unspecified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The type of the customer managed gateway is TrafficDirector Open + * Mesh. + * + * Generated from protobuf enum OPEN_MESH = 1; + */ + const OPEN_MESH = 1; + /** + * The type of the customer managed gateway is SecureWebGateway (SWG). + * + * Generated from protobuf enum SECURE_WEB_GATEWAY = 2; + */ + const SECURE_WEB_GATEWAY = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::OPEN_MESH => 'OPEN_MESH', + self::SECURE_WEB_GATEWAY => 'SECURE_WEB_GATEWAY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/NetworkServices/src/V1/GetEndpointPolicyRequest.php b/NetworkServices/src/V1/GetEndpointPolicyRequest.php new file mode 100644 index 000000000000..185d8ae98028 --- /dev/null +++ b/NetworkServices/src/V1/GetEndpointPolicyRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.GetEndpointPolicyRequest + */ +class GetEndpointPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the EndpointPolicy to get. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the EndpointPolicy to get. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\EndpointPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the EndpointPolicy to get. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the EndpointPolicy to get. Must be in the format + * `projects/*/locations/global/endpointPolicies/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GetGatewayRequest.php b/NetworkServices/src/V1/GetGatewayRequest.php new file mode 100644 index 000000000000..94c1dd152792 --- /dev/null +++ b/NetworkServices/src/V1/GetGatewayRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.GetGatewayRequest + */ +class GetGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the Gateway to get. Must be in the format + * `projects/*/locations/*/gateways/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the Gateway to get. Must be in the format + * `projects/*/locations/*/gateways/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Gateway::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the Gateway to get. Must be in the format + * `projects/*/locations/*/gateways/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the Gateway to get. Must be in the format + * `projects/*/locations/*/gateways/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GetGrpcRouteRequest.php b/NetworkServices/src/V1/GetGrpcRouteRequest.php new file mode 100644 index 000000000000..a78e9293575a --- /dev/null +++ b/NetworkServices/src/V1/GetGrpcRouteRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.GetGrpcRouteRequest + */ +class GetGrpcRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the GrpcRoute to get. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the GrpcRoute to get. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the GrpcRoute to get. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the GrpcRoute to get. Must be in the format + * `projects/*/locations/global/grpcRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GetHttpRouteRequest.php b/NetworkServices/src/V1/GetHttpRouteRequest.php new file mode 100644 index 000000000000..6a0950a4ae8a --- /dev/null +++ b/NetworkServices/src/V1/GetHttpRouteRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.GetHttpRouteRequest + */ +class GetHttpRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the HttpRoute to get. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the HttpRoute to get. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the HttpRoute to get. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the HttpRoute to get. Must be in the format + * `projects/*/locations/global/httpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GetLbRouteExtensionRequest.php b/NetworkServices/src/V1/GetLbRouteExtensionRequest.php new file mode 100644 index 000000000000..8392a00c0eb2 --- /dev/null +++ b/NetworkServices/src/V1/GetLbRouteExtensionRequest.php @@ -0,0 +1,75 @@ +google.cloud.networkservices.v1.GetLbRouteExtensionRequest + */ +class GetLbRouteExtensionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the `LbRouteExtension` resource to get. Must be in the + * format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the `LbRouteExtension` resource to get. Must be in the + * format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the `LbRouteExtension` resource to get. Must be in the + * format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the `LbRouteExtension` resource to get. Must be in the + * format + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GetLbTrafficExtensionRequest.php b/NetworkServices/src/V1/GetLbTrafficExtensionRequest.php new file mode 100644 index 000000000000..c8ddafef9721 --- /dev/null +++ b/NetworkServices/src/V1/GetLbTrafficExtensionRequest.php @@ -0,0 +1,75 @@ +google.cloud.networkservices.v1.GetLbTrafficExtensionRequest + */ +class GetLbTrafficExtensionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the `LbTrafficExtension` resource to get. Must be in + * the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the `LbTrafficExtension` resource to get. Must be in + * the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the `LbTrafficExtension` resource to get. Must be in + * the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the `LbTrafficExtension` resource to get. Must be in + * the format + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GetMeshRequest.php b/NetworkServices/src/V1/GetMeshRequest.php new file mode 100644 index 000000000000..268a9a24efca --- /dev/null +++ b/NetworkServices/src/V1/GetMeshRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.GetMeshRequest + */ +class GetMeshRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the Mesh to get. Must be in the format + * `projects/*/locations/global/meshes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the Mesh to get. Must be in the format + * `projects/*/locations/global/meshes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Mesh::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the Mesh to get. Must be in the format + * `projects/*/locations/global/meshes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the Mesh to get. Must be in the format + * `projects/*/locations/global/meshes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GetServiceBindingRequest.php b/NetworkServices/src/V1/GetServiceBindingRequest.php new file mode 100644 index 000000000000..36a12ec1ce97 --- /dev/null +++ b/NetworkServices/src/V1/GetServiceBindingRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.GetServiceBindingRequest + */ +class GetServiceBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the ServiceBinding to get. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the ServiceBinding to get. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\ServiceBinding::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the ServiceBinding to get. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the ServiceBinding to get. Must be in the format + * `projects/*/locations/global/serviceBindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GetTcpRouteRequest.php b/NetworkServices/src/V1/GetTcpRouteRequest.php new file mode 100644 index 000000000000..9fc56eba0b6a --- /dev/null +++ b/NetworkServices/src/V1/GetTcpRouteRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.GetTcpRouteRequest + */ +class GetTcpRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the TcpRoute to get. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the TcpRoute to get. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the TcpRoute to get. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the TcpRoute to get. Must be in the format + * `projects/*/locations/global/tcpRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GetTlsRouteRequest.php b/NetworkServices/src/V1/GetTlsRouteRequest.php new file mode 100644 index 000000000000..89e92b962a86 --- /dev/null +++ b/NetworkServices/src/V1/GetTlsRouteRequest.php @@ -0,0 +1,71 @@ +google.cloud.networkservices.v1.GetTlsRouteRequest + */ +class GetTlsRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the TlsRoute to get. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the TlsRoute to get. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the TlsRoute to get. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the TlsRoute to get. Must be in the format + * `projects/*/locations/global/tlsRoutes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GrpcRoute.php b/NetworkServices/src/V1/GrpcRoute.php new file mode 100644 index 000000000000..2404004aec76 --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute.php @@ -0,0 +1,534 @@ +google.cloud.networkservices.v1.GrpcRoute + */ +class GrpcRoute extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the GrpcRoute resource. It matches pattern + * `projects/*/locations/global/grpcRoutes/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $self_link = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Set of label tags associated with the GrpcRoute resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. Service hostnames with an optional port for which this route + * describes traffic. + * Format: [:] + * Hostname is the fully qualified domain name of a network host. This matches + * the RFC 1123 definition of a hostname with 2 notable exceptions: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * The routes associated with a Mesh or Gateway must have unique hostnames. If + * you attempt to attach multiple routes with conflicting hostnames, the + * configuration will be rejected. + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is + * not possible to associate two routes both with `*.bar.com` or both with + * `bar.com`. + * If a port is specified, then gRPC clients must use the channel URI with the + * port to match this rule (i.e. "xds:///service:123"), otherwise they must + * supply the URI without a port (i.e. "xds:///service"). + * + * Generated from protobuf field repeated string hostnames = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + private $hostnames; + /** + * Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * + * Generated from protobuf field repeated string meshes = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $meshes; + /** + * Optional. Gateways defines a list of gateways this GrpcRoute is attached + * to, as one of the routing rules to route the requests served by the + * gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $gateways; + /** + * Required. A list of detailed rules defining how to route traffic. + * Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the + * first matching GrpcRoute.RouteRule will be executed. At least one rule + * must be supplied. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.RouteRule rules = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the GrpcRoute resource. It matches pattern + * `projects/*/locations/global/grpcRoutes/` + * @type string $self_link + * Output only. Server-defined URL of this resource + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Set of label tags associated with the GrpcRoute resource. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type array|\Google\Protobuf\Internal\RepeatedField $hostnames + * Required. Service hostnames with an optional port for which this route + * describes traffic. + * Format: [:] + * Hostname is the fully qualified domain name of a network host. This matches + * the RFC 1123 definition of a hostname with 2 notable exceptions: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * The routes associated with a Mesh or Gateway must have unique hostnames. If + * you attempt to attach multiple routes with conflicting hostnames, the + * configuration will be rejected. + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is + * not possible to associate two routes both with `*.bar.com` or both with + * `bar.com`. + * If a port is specified, then gRPC clients must use the channel URI with the + * port to match this rule (i.e. "xds:///service:123"), otherwise they must + * supply the URI without a port (i.e. "xds:///service"). + * @type array|\Google\Protobuf\Internal\RepeatedField $meshes + * Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * @type array|\Google\Protobuf\Internal\RepeatedField $gateways + * Optional. Gateways defines a list of gateways this GrpcRoute is attached + * to, as one of the routing rules to route the requests served by the + * gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * @type array<\Google\Cloud\NetworkServices\V1\GrpcRoute\RouteRule>|\Google\Protobuf\Internal\RepeatedField $rules + * Required. A list of detailed rules defining how to route traffic. + * Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the + * first matching GrpcRoute.RouteRule will be executed. At least one rule + * must be supplied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the GrpcRoute resource. It matches pattern + * `projects/*/locations/global/grpcRoutes/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the GrpcRoute resource. It matches pattern + * `projects/*/locations/global/grpcRoutes/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSelfLink() + { + return $this->self_link; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSelfLink($var) + { + GPBUtil::checkString($var, True); + $this->self_link = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Set of label tags associated with the GrpcRoute resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Set of label tags associated with the GrpcRoute resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Required. Service hostnames with an optional port for which this route + * describes traffic. + * Format: [:] + * Hostname is the fully qualified domain name of a network host. This matches + * the RFC 1123 definition of a hostname with 2 notable exceptions: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * The routes associated with a Mesh or Gateway must have unique hostnames. If + * you attempt to attach multiple routes with conflicting hostnames, the + * configuration will be rejected. + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is + * not possible to associate two routes both with `*.bar.com` or both with + * `bar.com`. + * If a port is specified, then gRPC clients must use the channel URI with the + * port to match this rule (i.e. "xds:///service:123"), otherwise they must + * supply the URI without a port (i.e. "xds:///service"). + * + * Generated from protobuf field repeated string hostnames = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHostnames() + { + return $this->hostnames; + } + + /** + * Required. Service hostnames with an optional port for which this route + * describes traffic. + * Format: [:] + * Hostname is the fully qualified domain name of a network host. This matches + * the RFC 1123 definition of a hostname with 2 notable exceptions: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * The routes associated with a Mesh or Gateway must have unique hostnames. If + * you attempt to attach multiple routes with conflicting hostnames, the + * configuration will be rejected. + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is + * not possible to associate two routes both with `*.bar.com` or both with + * `bar.com`. + * If a port is specified, then gRPC clients must use the channel URI with the + * port to match this rule (i.e. "xds:///service:123"), otherwise they must + * supply the URI without a port (i.e. "xds:///service"). + * + * Generated from protobuf field repeated string hostnames = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHostnames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->hostnames = $arr; + + return $this; + } + + /** + * Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * + * Generated from protobuf field repeated string meshes = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMeshes() + { + return $this->meshes; + } + + /** + * Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * + * Generated from protobuf field repeated string meshes = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMeshes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->meshes = $arr; + + return $this; + } + + /** + * Optional. Gateways defines a list of gateways this GrpcRoute is attached + * to, as one of the routing rules to route the requests served by the + * gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGateways() + { + return $this->gateways; + } + + /** + * Optional. Gateways defines a list of gateways this GrpcRoute is attached + * to, as one of the routing rules to route the requests served by the + * gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGateways($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->gateways = $arr; + + return $this; + } + + /** + * Required. A list of detailed rules defining how to route traffic. + * Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the + * first matching GrpcRoute.RouteRule will be executed. At least one rule + * must be supplied. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.RouteRule rules = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Required. A list of detailed rules defining how to route traffic. + * Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the + * first matching GrpcRoute.RouteRule will be executed. At least one rule + * must be supplied. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.RouteRule rules = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\NetworkServices\V1\GrpcRoute\RouteRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\GrpcRoute\RouteRule::class); + $this->rules = $arr; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/GrpcRoute/Destination.php b/NetworkServices/src/V1/GrpcRoute/Destination.php new file mode 100644 index 000000000000..4a86ffa2e4a0 --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/Destination.php @@ -0,0 +1,163 @@ +google.cloud.networkservices.v1.GrpcRoute.Destination + */ +class Destination extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the proportion of requests forwarded to the backend + * referenced by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * + * Generated from protobuf field optional int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $weight = null; + protected $destination_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_name + * Required. The URL of a destination service to which to route traffic. + * Must refer to either a BackendService or ServiceDirectoryService. + * @type int $weight + * Optional. Specifies the proportion of requests forwarded to the backend + * referenced by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URL of a destination service to which to route traffic. + * Must refer to either a BackendService or ServiceDirectoryService. + * + * Generated from protobuf field string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceName() + { + return $this->readOneof(1); + } + + public function hasServiceName() + { + return $this->hasOneof(1); + } + + /** + * Required. The URL of a destination service to which to route traffic. + * Must refer to either a BackendService or ServiceDirectoryService. + * + * Generated from protobuf field string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Specifies the proportion of requests forwarded to the backend + * referenced by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * + * Generated from protobuf field optional int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getWeight() + { + return isset($this->weight) ? $this->weight : 0; + } + + public function hasWeight() + { + return isset($this->weight); + } + + public function clearWeight() + { + unset($this->weight); + } + + /** + * Optional. Specifies the proportion of requests forwarded to the backend + * referenced by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * + * Generated from protobuf field optional int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setWeight($var) + { + GPBUtil::checkInt32($var); + $this->weight = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestinationType() + { + return $this->whichOneof("destination_type"); + } + +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy.php b/NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy.php new file mode 100644 index 000000000000..66fe88cebbf6 --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy.php @@ -0,0 +1,127 @@ +google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + */ +class FaultInjectionPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The specification for injecting delay to client requests. + * + * Generated from protobuf field optional .google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay delay = 1; + */ + protected $delay = null; + /** + * The specification for aborting to client requests. + * + * Generated from protobuf field optional .google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort abort = 2; + */ + protected $abort = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy\Delay $delay + * The specification for injecting delay to client requests. + * @type \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy\Abort $abort + * The specification for aborting to client requests. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * The specification for injecting delay to client requests. + * + * Generated from protobuf field optional .google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay delay = 1; + * @return \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy\Delay|null + */ + public function getDelay() + { + return $this->delay; + } + + public function hasDelay() + { + return isset($this->delay); + } + + public function clearDelay() + { + unset($this->delay); + } + + /** + * The specification for injecting delay to client requests. + * + * Generated from protobuf field optional .google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay delay = 1; + * @param \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy\Delay $var + * @return $this + */ + public function setDelay($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy\Delay::class); + $this->delay = $var; + + return $this; + } + + /** + * The specification for aborting to client requests. + * + * Generated from protobuf field optional .google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort abort = 2; + * @return \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy\Abort|null + */ + public function getAbort() + { + return $this->abort; + } + + public function hasAbort() + { + return isset($this->abort); + } + + public function clearAbort() + { + unset($this->abort); + } + + /** + * The specification for aborting to client requests. + * + * Generated from protobuf field optional .google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort abort = 2; + * @param \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy\Abort $var + * @return $this + */ + public function setAbort($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy\Abort::class); + $this->abort = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy/Abort.php b/NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy/Abort.php new file mode 100644 index 000000000000..5410ea0bd2ac --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy/Abort.php @@ -0,0 +1,131 @@ +google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + */ +class Abort extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP status code used to abort the request. + * The value must be between 200 and 599 inclusive. + * + * Generated from protobuf field optional int32 http_status = 1; + */ + protected $http_status = null; + /** + * The percentage of traffic which will be aborted. + * The value must be between [0, 100] + * + * Generated from protobuf field optional int32 percentage = 2; + */ + protected $percentage = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $http_status + * The HTTP status code used to abort the request. + * The value must be between 200 and 599 inclusive. + * @type int $percentage + * The percentage of traffic which will be aborted. + * The value must be between [0, 100] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP status code used to abort the request. + * The value must be between 200 and 599 inclusive. + * + * Generated from protobuf field optional int32 http_status = 1; + * @return int + */ + public function getHttpStatus() + { + return isset($this->http_status) ? $this->http_status : 0; + } + + public function hasHttpStatus() + { + return isset($this->http_status); + } + + public function clearHttpStatus() + { + unset($this->http_status); + } + + /** + * The HTTP status code used to abort the request. + * The value must be between 200 and 599 inclusive. + * + * Generated from protobuf field optional int32 http_status = 1; + * @param int $var + * @return $this + */ + public function setHttpStatus($var) + { + GPBUtil::checkInt32($var); + $this->http_status = $var; + + return $this; + } + + /** + * The percentage of traffic which will be aborted. + * The value must be between [0, 100] + * + * Generated from protobuf field optional int32 percentage = 2; + * @return int + */ + public function getPercentage() + { + return isset($this->percentage) ? $this->percentage : 0; + } + + public function hasPercentage() + { + return isset($this->percentage); + } + + public function clearPercentage() + { + unset($this->percentage); + } + + /** + * The percentage of traffic which will be aborted. + * The value must be between [0, 100] + * + * Generated from protobuf field optional int32 percentage = 2; + * @param int $var + * @return $this + */ + public function setPercentage($var) + { + GPBUtil::checkInt32($var); + $this->percentage = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy/Delay.php b/NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy/Delay.php new file mode 100644 index 000000000000..a68314953ff2 --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/FaultInjectionPolicy/Delay.php @@ -0,0 +1,127 @@ +google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + */ +class Delay extends \Google\Protobuf\Internal\Message +{ + /** + * Specify a fixed delay before forwarding the request. + * + * Generated from protobuf field optional .google.protobuf.Duration fixed_delay = 1; + */ + protected $fixed_delay = null; + /** + * The percentage of traffic on which delay will be injected. + * The value must be between [0, 100] + * + * Generated from protobuf field optional int32 percentage = 2; + */ + protected $percentage = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $fixed_delay + * Specify a fixed delay before forwarding the request. + * @type int $percentage + * The percentage of traffic on which delay will be injected. + * The value must be between [0, 100] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Specify a fixed delay before forwarding the request. + * + * Generated from protobuf field optional .google.protobuf.Duration fixed_delay = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getFixedDelay() + { + return $this->fixed_delay; + } + + public function hasFixedDelay() + { + return isset($this->fixed_delay); + } + + public function clearFixedDelay() + { + unset($this->fixed_delay); + } + + /** + * Specify a fixed delay before forwarding the request. + * + * Generated from protobuf field optional .google.protobuf.Duration fixed_delay = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setFixedDelay($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->fixed_delay = $var; + + return $this; + } + + /** + * The percentage of traffic on which delay will be injected. + * The value must be between [0, 100] + * + * Generated from protobuf field optional int32 percentage = 2; + * @return int + */ + public function getPercentage() + { + return isset($this->percentage) ? $this->percentage : 0; + } + + public function hasPercentage() + { + return isset($this->percentage); + } + + public function clearPercentage() + { + unset($this->percentage); + } + + /** + * The percentage of traffic on which delay will be injected. + * The value must be between [0, 100] + * + * Generated from protobuf field optional int32 percentage = 2; + * @param int $var + * @return $this + */ + public function setPercentage($var) + { + GPBUtil::checkInt32($var); + $this->percentage = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/HeaderMatch.php b/NetworkServices/src/V1/GrpcRoute/HeaderMatch.php new file mode 100644 index 000000000000..262656cf1653 --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/HeaderMatch.php @@ -0,0 +1,140 @@ +google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + */ +class HeaderMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies how to match against the value of the header. If not + * specified, a default value of EXACT is used. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = 0; + /** + * Required. The key of the header. + * + * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key = ''; + /** + * Required. The value of the header. + * + * Generated from protobuf field string value = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Optional. Specifies how to match against the value of the header. If not + * specified, a default value of EXACT is used. + * @type string $key + * Required. The key of the header. + * @type string $value + * Required. The value of the header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies how to match against the value of the header. If not + * specified, a default value of EXACT is used. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. Specifies how to match against the value of the header. If not + * specified, a default value of EXACT is used. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\GrpcRoute\HeaderMatch\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Required. The key of the header. + * + * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Required. The key of the header. + * + * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Required. The value of the header. + * + * Generated from protobuf field string value = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Required. The value of the header. + * + * Generated from protobuf field string value = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/HeaderMatch/Type.php b/NetworkServices/src/V1/GrpcRoute/HeaderMatch/Type.php new file mode 100644 index 000000000000..d9a3d9463930 --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/HeaderMatch/Type.php @@ -0,0 +1,63 @@ +google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type + */ +class Type +{ + /** + * Unspecified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Will only match the exact value provided. + * + * Generated from protobuf enum EXACT = 1; + */ + const EXACT = 1; + /** + * Will match paths conforming to the prefix specified by value. RE2 + * syntax is supported. + * + * Generated from protobuf enum REGULAR_EXPRESSION = 2; + */ + const REGULAR_EXPRESSION = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::EXACT => 'EXACT', + self::REGULAR_EXPRESSION => 'REGULAR_EXPRESSION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/MethodMatch.php b/NetworkServices/src/V1/GrpcRoute/MethodMatch.php new file mode 100644 index 000000000000..09aa288199ad --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/MethodMatch.php @@ -0,0 +1,200 @@ +google.cloud.networkservices.v1.GrpcRoute.MethodMatch + */ +class MethodMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies how to match against the name. If not specified, a + * default value of "EXACT" is used. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = 0; + /** + * Required. Name of the service to match against. If unspecified, will + * match all services. + * + * Generated from protobuf field string grpc_service = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $grpc_service = ''; + /** + * Required. Name of the method to match against. If unspecified, will match + * all methods. + * + * Generated from protobuf field string grpc_method = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $grpc_method = ''; + /** + * Optional. Specifies that matches are case sensitive. The default value + * is true. case_sensitive must not be used with a type of + * REGULAR_EXPRESSION. + * + * Generated from protobuf field optional bool case_sensitive = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $case_sensitive = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Optional. Specifies how to match against the name. If not specified, a + * default value of "EXACT" is used. + * @type string $grpc_service + * Required. Name of the service to match against. If unspecified, will + * match all services. + * @type string $grpc_method + * Required. Name of the method to match against. If unspecified, will match + * all methods. + * @type bool $case_sensitive + * Optional. Specifies that matches are case sensitive. The default value + * is true. case_sensitive must not be used with a type of + * REGULAR_EXPRESSION. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies how to match against the name. If not specified, a + * default value of "EXACT" is used. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. Specifies how to match against the name. If not specified, a + * default value of "EXACT" is used. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\GrpcRoute\MethodMatch\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Required. Name of the service to match against. If unspecified, will + * match all services. + * + * Generated from protobuf field string grpc_service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGrpcService() + { + return $this->grpc_service; + } + + /** + * Required. Name of the service to match against. If unspecified, will + * match all services. + * + * Generated from protobuf field string grpc_service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGrpcService($var) + { + GPBUtil::checkString($var, True); + $this->grpc_service = $var; + + return $this; + } + + /** + * Required. Name of the method to match against. If unspecified, will match + * all methods. + * + * Generated from protobuf field string grpc_method = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGrpcMethod() + { + return $this->grpc_method; + } + + /** + * Required. Name of the method to match against. If unspecified, will match + * all methods. + * + * Generated from protobuf field string grpc_method = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGrpcMethod($var) + { + GPBUtil::checkString($var, True); + $this->grpc_method = $var; + + return $this; + } + + /** + * Optional. Specifies that matches are case sensitive. The default value + * is true. case_sensitive must not be used with a type of + * REGULAR_EXPRESSION. + * + * Generated from protobuf field optional bool case_sensitive = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getCaseSensitive() + { + return isset($this->case_sensitive) ? $this->case_sensitive : false; + } + + public function hasCaseSensitive() + { + return isset($this->case_sensitive); + } + + public function clearCaseSensitive() + { + unset($this->case_sensitive); + } + + /** + * Optional. Specifies that matches are case sensitive. The default value + * is true. case_sensitive must not be used with a type of + * REGULAR_EXPRESSION. + * + * Generated from protobuf field optional bool case_sensitive = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setCaseSensitive($var) + { + GPBUtil::checkBool($var); + $this->case_sensitive = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/MethodMatch/Type.php b/NetworkServices/src/V1/GrpcRoute/MethodMatch/Type.php new file mode 100644 index 000000000000..bd338efc7c0c --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/MethodMatch/Type.php @@ -0,0 +1,63 @@ +google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type + */ +class Type +{ + /** + * Unspecified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Will only match the exact name provided. + * + * Generated from protobuf enum EXACT = 1; + */ + const EXACT = 1; + /** + * Will interpret grpc_method and grpc_service as regexes. RE2 syntax is + * supported. + * + * Generated from protobuf enum REGULAR_EXPRESSION = 2; + */ + const REGULAR_EXPRESSION = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::EXACT => 'EXACT', + self::REGULAR_EXPRESSION => 'REGULAR_EXPRESSION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/RetryPolicy.php b/NetworkServices/src/V1/GrpcRoute/RetryPolicy.php new file mode 100644 index 000000000000..af01dc57b8d7 --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/RetryPolicy.php @@ -0,0 +1,166 @@ +google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + */ +class RetryPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * - connect-failure: Router will retry on failures connecting to Backend + * Services, for example due to connection timeouts. + * - refused-stream: Router will retry if the backend service resets the + * stream + * with a REFUSED_STREAM error code. This reset type indicates that it is + * safe to retry. + * - cancelled: Router will retry if the gRPC status code in the response + * header + * is set to cancelled + * - deadline-exceeded: Router will retry if the gRPC status code in the + * response + * header is set to deadline-exceeded + * - resource-exhausted: Router will retry if the gRPC status code in the + * response header is set to resource-exhausted + * - unavailable: Router will retry if the gRPC status code in the response + * header is set to unavailable + * + * Generated from protobuf field repeated string retry_conditions = 1; + */ + private $retry_conditions; + /** + * Specifies the allowed number of retries. This number must be > 0. If not + * specified, default to 1. + * + * Generated from protobuf field uint32 num_retries = 2; + */ + protected $num_retries = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $retry_conditions + * - connect-failure: Router will retry on failures connecting to Backend + * Services, for example due to connection timeouts. + * - refused-stream: Router will retry if the backend service resets the + * stream + * with a REFUSED_STREAM error code. This reset type indicates that it is + * safe to retry. + * - cancelled: Router will retry if the gRPC status code in the response + * header + * is set to cancelled + * - deadline-exceeded: Router will retry if the gRPC status code in the + * response + * header is set to deadline-exceeded + * - resource-exhausted: Router will retry if the gRPC status code in the + * response header is set to resource-exhausted + * - unavailable: Router will retry if the gRPC status code in the response + * header is set to unavailable + * @type int $num_retries + * Specifies the allowed number of retries. This number must be > 0. If not + * specified, default to 1. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * - connect-failure: Router will retry on failures connecting to Backend + * Services, for example due to connection timeouts. + * - refused-stream: Router will retry if the backend service resets the + * stream + * with a REFUSED_STREAM error code. This reset type indicates that it is + * safe to retry. + * - cancelled: Router will retry if the gRPC status code in the response + * header + * is set to cancelled + * - deadline-exceeded: Router will retry if the gRPC status code in the + * response + * header is set to deadline-exceeded + * - resource-exhausted: Router will retry if the gRPC status code in the + * response header is set to resource-exhausted + * - unavailable: Router will retry if the gRPC status code in the response + * header is set to unavailable + * + * Generated from protobuf field repeated string retry_conditions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRetryConditions() + { + return $this->retry_conditions; + } + + /** + * - connect-failure: Router will retry on failures connecting to Backend + * Services, for example due to connection timeouts. + * - refused-stream: Router will retry if the backend service resets the + * stream + * with a REFUSED_STREAM error code. This reset type indicates that it is + * safe to retry. + * - cancelled: Router will retry if the gRPC status code in the response + * header + * is set to cancelled + * - deadline-exceeded: Router will retry if the gRPC status code in the + * response + * header is set to deadline-exceeded + * - resource-exhausted: Router will retry if the gRPC status code in the + * response header is set to resource-exhausted + * - unavailable: Router will retry if the gRPC status code in the response + * header is set to unavailable + * + * Generated from protobuf field repeated string retry_conditions = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRetryConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->retry_conditions = $arr; + + return $this; + } + + /** + * Specifies the allowed number of retries. This number must be > 0. If not + * specified, default to 1. + * + * Generated from protobuf field uint32 num_retries = 2; + * @return int + */ + public function getNumRetries() + { + return $this->num_retries; + } + + /** + * Specifies the allowed number of retries. This number must be > 0. If not + * specified, default to 1. + * + * Generated from protobuf field uint32 num_retries = 2; + * @param int $var + * @return $this + */ + public function setNumRetries($var) + { + GPBUtil::checkUint32($var); + $this->num_retries = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/RouteAction.php b/NetworkServices/src/V1/GrpcRoute/RouteAction.php new file mode 100644 index 000000000000..de116a6717b2 --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/RouteAction.php @@ -0,0 +1,248 @@ +google.cloud.networkservices.v1.GrpcRoute.RouteAction + */ +class RouteAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The destination services to which traffic should be forwarded. + * If multiple destinations are specified, traffic will be split between + * Backend Service(s) according to the weight field of these destinations. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.Destination destinations = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $destinations; + /** + * Optional. The specification for fault injection introduced into traffic to test the + * resiliency of clients to destination service failure. As part of fault + * injection, when clients send requests to a destination, delays can be + * introduced on a percentage of requests before sending those requests to + * the destination service. Similarly requests from clients can be aborted + * by for a percentage of requests. + * timeout and retry_policy will be ignored by clients that are configured + * with a fault_injection_policy + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy fault_injection_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $fault_injection_policy = null; + /** + * Optional. Specifies the timeout for selected route. Timeout is computed + * from the time the request has been fully processed (i.e. end of stream) + * up until the response has been completely processed. Timeout includes all + * retries. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timeout = null; + /** + * Optional. Specifies the retry policy associated with this route. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.RetryPolicy retry_policy = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $retry_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\GrpcRoute\Destination>|\Google\Protobuf\Internal\RepeatedField $destinations + * Optional. The destination services to which traffic should be forwarded. + * If multiple destinations are specified, traffic will be split between + * Backend Service(s) according to the weight field of these destinations. + * @type \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy $fault_injection_policy + * Optional. The specification for fault injection introduced into traffic to test the + * resiliency of clients to destination service failure. As part of fault + * injection, when clients send requests to a destination, delays can be + * introduced on a percentage of requests before sending those requests to + * the destination service. Similarly requests from clients can be aborted + * by for a percentage of requests. + * timeout and retry_policy will be ignored by clients that are configured + * with a fault_injection_policy + * @type \Google\Protobuf\Duration $timeout + * Optional. Specifies the timeout for selected route. Timeout is computed + * from the time the request has been fully processed (i.e. end of stream) + * up until the response has been completely processed. Timeout includes all + * retries. + * @type \Google\Cloud\NetworkServices\V1\GrpcRoute\RetryPolicy $retry_policy + * Optional. Specifies the retry policy associated with this route. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The destination services to which traffic should be forwarded. + * If multiple destinations are specified, traffic will be split between + * Backend Service(s) according to the weight field of these destinations. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.Destination destinations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestinations() + { + return $this->destinations; + } + + /** + * Optional. The destination services to which traffic should be forwarded. + * If multiple destinations are specified, traffic will be split between + * Backend Service(s) according to the weight field of these destinations. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.Destination destinations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\NetworkServices\V1\GrpcRoute\Destination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\GrpcRoute\Destination::class); + $this->destinations = $arr; + + return $this; + } + + /** + * Optional. The specification for fault injection introduced into traffic to test the + * resiliency of clients to destination service failure. As part of fault + * injection, when clients send requests to a destination, delays can be + * introduced on a percentage of requests before sending those requests to + * the destination service. Similarly requests from clients can be aborted + * by for a percentage of requests. + * timeout and retry_policy will be ignored by clients that are configured + * with a fault_injection_policy + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy fault_injection_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy|null + */ + public function getFaultInjectionPolicy() + { + return $this->fault_injection_policy; + } + + public function hasFaultInjectionPolicy() + { + return isset($this->fault_injection_policy); + } + + public function clearFaultInjectionPolicy() + { + unset($this->fault_injection_policy); + } + + /** + * Optional. The specification for fault injection introduced into traffic to test the + * resiliency of clients to destination service failure. As part of fault + * injection, when clients send requests to a destination, delays can be + * introduced on a percentage of requests before sending those requests to + * the destination service. Similarly requests from clients can be aborted + * by for a percentage of requests. + * timeout and retry_policy will be ignored by clients that are configured + * with a fault_injection_policy + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy fault_injection_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy $var + * @return $this + */ + public function setFaultInjectionPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\GrpcRoute\FaultInjectionPolicy::class); + $this->fault_injection_policy = $var; + + return $this; + } + + /** + * Optional. Specifies the timeout for selected route. Timeout is computed + * from the time the request has been fully processed (i.e. end of stream) + * up until the response has been completely processed. Timeout includes all + * retries. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Optional. Specifies the timeout for selected route. Timeout is computed + * from the time the request has been fully processed (i.e. end of stream) + * up until the response has been completely processed. Timeout includes all + * retries. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Optional. Specifies the retry policy associated with this route. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.RetryPolicy retry_policy = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\NetworkServices\V1\GrpcRoute\RetryPolicy|null + */ + public function getRetryPolicy() + { + return $this->retry_policy; + } + + public function hasRetryPolicy() + { + return isset($this->retry_policy); + } + + public function clearRetryPolicy() + { + unset($this->retry_policy); + } + + /** + * Optional. Specifies the retry policy associated with this route. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.RetryPolicy retry_policy = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\NetworkServices\V1\GrpcRoute\RetryPolicy $var + * @return $this + */ + public function setRetryPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\GrpcRoute\RetryPolicy::class); + $this->retry_policy = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/RouteMatch.php b/NetworkServices/src/V1/GrpcRoute/RouteMatch.php new file mode 100644 index 000000000000..42b682b8cbc3 --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/RouteMatch.php @@ -0,0 +1,117 @@ +google.cloud.networkservices.v1.GrpcRoute.RouteMatch + */ +class RouteMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A gRPC method to match against. If this field is empty or + * omitted, will match all methods. + * + * Generated from protobuf field optional .google.cloud.networkservices.v1.GrpcRoute.MethodMatch method = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $method = null; + /** + * Optional. Specifies a collection of headers to match. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.HeaderMatch headers = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $headers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\NetworkServices\V1\GrpcRoute\MethodMatch $method + * Optional. A gRPC method to match against. If this field is empty or + * omitted, will match all methods. + * @type array<\Google\Cloud\NetworkServices\V1\GrpcRoute\HeaderMatch>|\Google\Protobuf\Internal\RepeatedField $headers + * Optional. Specifies a collection of headers to match. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A gRPC method to match against. If this field is empty or + * omitted, will match all methods. + * + * Generated from protobuf field optional .google.cloud.networkservices.v1.GrpcRoute.MethodMatch method = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\NetworkServices\V1\GrpcRoute\MethodMatch|null + */ + public function getMethod() + { + return $this->method; + } + + public function hasMethod() + { + return isset($this->method); + } + + public function clearMethod() + { + unset($this->method); + } + + /** + * Optional. A gRPC method to match against. If this field is empty or + * omitted, will match all methods. + * + * Generated from protobuf field optional .google.cloud.networkservices.v1.GrpcRoute.MethodMatch method = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\NetworkServices\V1\GrpcRoute\MethodMatch $var + * @return $this + */ + public function setMethod($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\GrpcRoute\MethodMatch::class); + $this->method = $var; + + return $this; + } + + /** + * Optional. Specifies a collection of headers to match. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.HeaderMatch headers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Optional. Specifies a collection of headers to match. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.HeaderMatch headers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\NetworkServices\V1\GrpcRoute\HeaderMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\GrpcRoute\HeaderMatch::class); + $this->headers = $arr; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/GrpcRoute/RouteRule.php b/NetworkServices/src/V1/GrpcRoute/RouteRule.php new file mode 100644 index 000000000000..97b6b43f567e --- /dev/null +++ b/NetworkServices/src/V1/GrpcRoute/RouteRule.php @@ -0,0 +1,128 @@ +google.cloud.networkservices.v1.GrpcRoute.RouteRule + */ +class RouteRule extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Matches define conditions used for matching the rule against + * incoming gRPC requests. Each match is independent, i.e. this rule will be + * matched if ANY one of the matches is satisfied. If no matches field is + * specified, this rule will unconditionally match traffic. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.RouteMatch matches = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $matches; + /** + * Required. A detailed rule defining how to route traffic. This field is + * required. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.RouteAction action = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $action = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\GrpcRoute\RouteMatch>|\Google\Protobuf\Internal\RepeatedField $matches + * Optional. Matches define conditions used for matching the rule against + * incoming gRPC requests. Each match is independent, i.e. this rule will be + * matched if ANY one of the matches is satisfied. If no matches field is + * specified, this rule will unconditionally match traffic. + * @type \Google\Cloud\NetworkServices\V1\GrpcRoute\RouteAction $action + * Required. A detailed rule defining how to route traffic. This field is + * required. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Matches define conditions used for matching the rule against + * incoming gRPC requests. Each match is independent, i.e. this rule will be + * matched if ANY one of the matches is satisfied. If no matches field is + * specified, this rule will unconditionally match traffic. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.RouteMatch matches = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMatches() + { + return $this->matches; + } + + /** + * Optional. Matches define conditions used for matching the rule against + * incoming gRPC requests. Each match is independent, i.e. this rule will be + * matched if ANY one of the matches is satisfied. If no matches field is + * specified, this rule will unconditionally match traffic. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute.RouteMatch matches = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\NetworkServices\V1\GrpcRoute\RouteMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMatches($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\GrpcRoute\RouteMatch::class); + $this->matches = $arr; + + return $this; + } + + /** + * Required. A detailed rule defining how to route traffic. This field is + * required. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.RouteAction action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\GrpcRoute\RouteAction|null + */ + public function getAction() + { + return $this->action; + } + + public function hasAction() + { + return isset($this->action); + } + + public function clearAction() + { + unset($this->action); + } + + /** + * Required. A detailed rule defining how to route traffic. This field is + * required. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute.RouteAction action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\GrpcRoute\RouteAction $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\GrpcRoute\RouteAction::class); + $this->action = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute.php b/NetworkServices/src/V1/HttpRoute.php new file mode 100644 index 000000000000..7663ee89f61e --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute.php @@ -0,0 +1,518 @@ +google.cloud.networkservices.v1.HttpRoute + */ +class HttpRoute extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the HttpRoute resource. It matches pattern + * `projects/*/locations/global/httpRoutes/http_route_name>`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $self_link = ''; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. Hostnames define a set of hosts that should match against the + * HTTP host header to select a HttpRoute to process the request. Hostname is + * the fully qualified domain name of a network host, as defined by RFC 1123 + * with the exception that: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * The routes associated with a Mesh or Gateways must have unique hostnames. + * If you attempt to attach multiple routes with conflicting hostnames, + * the configuration will be rejected. + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same Mesh (or + * Gateways under the same scope), it is not possible to associate two routes + * both with `*.bar.com` or both with `bar.com`. + * + * Generated from protobuf field repeated string hostnames = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + private $hostnames; + /** + * Optional. Meshes defines a list of meshes this HttpRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * + * Generated from protobuf field repeated string meshes = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $meshes; + /** + * Optional. Gateways defines a list of gateways this HttpRoute is attached + * to, as one of the routing rules to route the requests served by the + * gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $gateways; + /** + * Optional. Set of label tags associated with the HttpRoute resource. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. Rules that define how traffic is routed and handled. + * Rules will be matched sequentially based on the RouteMatch specified for + * the rule. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.RouteRule rules = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the HttpRoute resource. It matches pattern + * `projects/*/locations/global/httpRoutes/http_route_name>`. + * @type string $self_link + * Output only. Server-defined URL of this resource + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type array|\Google\Protobuf\Internal\RepeatedField $hostnames + * Required. Hostnames define a set of hosts that should match against the + * HTTP host header to select a HttpRoute to process the request. Hostname is + * the fully qualified domain name of a network host, as defined by RFC 1123 + * with the exception that: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * The routes associated with a Mesh or Gateways must have unique hostnames. + * If you attempt to attach multiple routes with conflicting hostnames, + * the configuration will be rejected. + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same Mesh (or + * Gateways under the same scope), it is not possible to associate two routes + * both with `*.bar.com` or both with `bar.com`. + * @type array|\Google\Protobuf\Internal\RepeatedField $meshes + * Optional. Meshes defines a list of meshes this HttpRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * @type array|\Google\Protobuf\Internal\RepeatedField $gateways + * Optional. Gateways defines a list of gateways this HttpRoute is attached + * to, as one of the routing rules to route the requests served by the + * gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Set of label tags associated with the HttpRoute resource. + * @type array<\Google\Cloud\NetworkServices\V1\HttpRoute\RouteRule>|\Google\Protobuf\Internal\RepeatedField $rules + * Required. Rules that define how traffic is routed and handled. + * Rules will be matched sequentially based on the RouteMatch specified for + * the rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the HttpRoute resource. It matches pattern + * `projects/*/locations/global/httpRoutes/http_route_name>`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the HttpRoute resource. It matches pattern + * `projects/*/locations/global/httpRoutes/http_route_name>`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSelfLink() + { + return $this->self_link; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSelfLink($var) + { + GPBUtil::checkString($var, True); + $this->self_link = $var; + + return $this; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. Hostnames define a set of hosts that should match against the + * HTTP host header to select a HttpRoute to process the request. Hostname is + * the fully qualified domain name of a network host, as defined by RFC 1123 + * with the exception that: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * The routes associated with a Mesh or Gateways must have unique hostnames. + * If you attempt to attach multiple routes with conflicting hostnames, + * the configuration will be rejected. + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same Mesh (or + * Gateways under the same scope), it is not possible to associate two routes + * both with `*.bar.com` or both with `bar.com`. + * + * Generated from protobuf field repeated string hostnames = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHostnames() + { + return $this->hostnames; + } + + /** + * Required. Hostnames define a set of hosts that should match against the + * HTTP host header to select a HttpRoute to process the request. Hostname is + * the fully qualified domain name of a network host, as defined by RFC 1123 + * with the exception that: + * - IPs are not allowed. + * - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + * label must appear by itself as the first label. + * Hostname can be "precise" which is a domain name without the terminating + * dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + * domain name prefixed with a single wildcard label (e.g. `*.example.com`). + * Note that as per RFC1035 and RFC1123, a label must consist of lower case + * alphanumeric characters or '-', and must start and end with an alphanumeric + * character. No other punctuation is allowed. + * The routes associated with a Mesh or Gateways must have unique hostnames. + * If you attempt to attach multiple routes with conflicting hostnames, + * the configuration will be rejected. + * For example, while it is acceptable for routes for the hostnames + * `*.foo.bar.com` and `*.bar.com` to be associated with the same Mesh (or + * Gateways under the same scope), it is not possible to associate two routes + * both with `*.bar.com` or both with `bar.com`. + * + * Generated from protobuf field repeated string hostnames = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHostnames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->hostnames = $arr; + + return $this; + } + + /** + * Optional. Meshes defines a list of meshes this HttpRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * + * Generated from protobuf field repeated string meshes = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMeshes() + { + return $this->meshes; + } + + /** + * Optional. Meshes defines a list of meshes this HttpRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * + * Generated from protobuf field repeated string meshes = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMeshes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->meshes = $arr; + + return $this; + } + + /** + * Optional. Gateways defines a list of gateways this HttpRoute is attached + * to, as one of the routing rules to route the requests served by the + * gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGateways() + { + return $this->gateways; + } + + /** + * Optional. Gateways defines a list of gateways this HttpRoute is attached + * to, as one of the routing rules to route the requests served by the + * gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGateways($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->gateways = $arr; + + return $this; + } + + /** + * Optional. Set of label tags associated with the HttpRoute resource. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Set of label tags associated with the HttpRoute resource. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. Rules that define how traffic is routed and handled. + * Rules will be matched sequentially based on the RouteMatch specified for + * the rule. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.RouteRule rules = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Required. Rules that define how traffic is routed and handled. + * Rules will be matched sequentially based on the RouteMatch specified for + * the rule. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.RouteRule rules = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\NetworkServices\V1\HttpRoute\RouteRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\HttpRoute\RouteRule::class); + $this->rules = $arr; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/HttpRoute/CorsPolicy.php b/NetworkServices/src/V1/HttpRoute/CorsPolicy.php new file mode 100644 index 000000000000..933d8ca4ce6c --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/CorsPolicy.php @@ -0,0 +1,342 @@ +google.cloud.networkservices.v1.HttpRoute.CorsPolicy + */ +class CorsPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the list of origins that will be allowed to do CORS requests. + * An origin is allowed if it matches either an item in allow_origins or + * an item in allow_origin_regexes. + * + * Generated from protobuf field repeated string allow_origins = 1; + */ + private $allow_origins; + /** + * Specifies the regular expression patterns that match allowed origins. For + * regular expression grammar, please see + * https://github.com/google/re2/wiki/Syntax. + * + * Generated from protobuf field repeated string allow_origin_regexes = 2; + */ + private $allow_origin_regexes; + /** + * Specifies the content for Access-Control-Allow-Methods header. + * + * Generated from protobuf field repeated string allow_methods = 3; + */ + private $allow_methods; + /** + * Specifies the content for Access-Control-Allow-Headers header. + * + * Generated from protobuf field repeated string allow_headers = 4; + */ + private $allow_headers; + /** + * Specifies the content for Access-Control-Expose-Headers header. + * + * Generated from protobuf field repeated string expose_headers = 5; + */ + private $expose_headers; + /** + * Specifies how long result of a preflight request can be cached in + * seconds. This translates to the Access-Control-Max-Age header. + * + * Generated from protobuf field string max_age = 6; + */ + protected $max_age = ''; + /** + * In response to a preflight request, setting this to true indicates that + * the actual request can include user credentials. This translates to the + * Access-Control-Allow-Credentials header. + * Default value is false. + * + * Generated from protobuf field bool allow_credentials = 7; + */ + protected $allow_credentials = false; + /** + * If true, the CORS policy is disabled. The default value is false, which + * indicates that the CORS policy is in effect. + * + * Generated from protobuf field bool disabled = 8; + */ + protected $disabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $allow_origins + * Specifies the list of origins that will be allowed to do CORS requests. + * An origin is allowed if it matches either an item in allow_origins or + * an item in allow_origin_regexes. + * @type array|\Google\Protobuf\Internal\RepeatedField $allow_origin_regexes + * Specifies the regular expression patterns that match allowed origins. For + * regular expression grammar, please see + * https://github.com/google/re2/wiki/Syntax. + * @type array|\Google\Protobuf\Internal\RepeatedField $allow_methods + * Specifies the content for Access-Control-Allow-Methods header. + * @type array|\Google\Protobuf\Internal\RepeatedField $allow_headers + * Specifies the content for Access-Control-Allow-Headers header. + * @type array|\Google\Protobuf\Internal\RepeatedField $expose_headers + * Specifies the content for Access-Control-Expose-Headers header. + * @type string $max_age + * Specifies how long result of a preflight request can be cached in + * seconds. This translates to the Access-Control-Max-Age header. + * @type bool $allow_credentials + * In response to a preflight request, setting this to true indicates that + * the actual request can include user credentials. This translates to the + * Access-Control-Allow-Credentials header. + * Default value is false. + * @type bool $disabled + * If true, the CORS policy is disabled. The default value is false, which + * indicates that the CORS policy is in effect. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the list of origins that will be allowed to do CORS requests. + * An origin is allowed if it matches either an item in allow_origins or + * an item in allow_origin_regexes. + * + * Generated from protobuf field repeated string allow_origins = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowOrigins() + { + return $this->allow_origins; + } + + /** + * Specifies the list of origins that will be allowed to do CORS requests. + * An origin is allowed if it matches either an item in allow_origins or + * an item in allow_origin_regexes. + * + * Generated from protobuf field repeated string allow_origins = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowOrigins($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allow_origins = $arr; + + return $this; + } + + /** + * Specifies the regular expression patterns that match allowed origins. For + * regular expression grammar, please see + * https://github.com/google/re2/wiki/Syntax. + * + * Generated from protobuf field repeated string allow_origin_regexes = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowOriginRegexes() + { + return $this->allow_origin_regexes; + } + + /** + * Specifies the regular expression patterns that match allowed origins. For + * regular expression grammar, please see + * https://github.com/google/re2/wiki/Syntax. + * + * Generated from protobuf field repeated string allow_origin_regexes = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowOriginRegexes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allow_origin_regexes = $arr; + + return $this; + } + + /** + * Specifies the content for Access-Control-Allow-Methods header. + * + * Generated from protobuf field repeated string allow_methods = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowMethods() + { + return $this->allow_methods; + } + + /** + * Specifies the content for Access-Control-Allow-Methods header. + * + * Generated from protobuf field repeated string allow_methods = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowMethods($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allow_methods = $arr; + + return $this; + } + + /** + * Specifies the content for Access-Control-Allow-Headers header. + * + * Generated from protobuf field repeated string allow_headers = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowHeaders() + { + return $this->allow_headers; + } + + /** + * Specifies the content for Access-Control-Allow-Headers header. + * + * Generated from protobuf field repeated string allow_headers = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allow_headers = $arr; + + return $this; + } + + /** + * Specifies the content for Access-Control-Expose-Headers header. + * + * Generated from protobuf field repeated string expose_headers = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExposeHeaders() + { + return $this->expose_headers; + } + + /** + * Specifies the content for Access-Control-Expose-Headers header. + * + * Generated from protobuf field repeated string expose_headers = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExposeHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->expose_headers = $arr; + + return $this; + } + + /** + * Specifies how long result of a preflight request can be cached in + * seconds. This translates to the Access-Control-Max-Age header. + * + * Generated from protobuf field string max_age = 6; + * @return string + */ + public function getMaxAge() + { + return $this->max_age; + } + + /** + * Specifies how long result of a preflight request can be cached in + * seconds. This translates to the Access-Control-Max-Age header. + * + * Generated from protobuf field string max_age = 6; + * @param string $var + * @return $this + */ + public function setMaxAge($var) + { + GPBUtil::checkString($var, True); + $this->max_age = $var; + + return $this; + } + + /** + * In response to a preflight request, setting this to true indicates that + * the actual request can include user credentials. This translates to the + * Access-Control-Allow-Credentials header. + * Default value is false. + * + * Generated from protobuf field bool allow_credentials = 7; + * @return bool + */ + public function getAllowCredentials() + { + return $this->allow_credentials; + } + + /** + * In response to a preflight request, setting this to true indicates that + * the actual request can include user credentials. This translates to the + * Access-Control-Allow-Credentials header. + * Default value is false. + * + * Generated from protobuf field bool allow_credentials = 7; + * @param bool $var + * @return $this + */ + public function setAllowCredentials($var) + { + GPBUtil::checkBool($var); + $this->allow_credentials = $var; + + return $this; + } + + /** + * If true, the CORS policy is disabled. The default value is false, which + * indicates that the CORS policy is in effect. + * + * Generated from protobuf field bool disabled = 8; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * If true, the CORS policy is disabled. The default value is false, which + * indicates that the CORS policy is in effect. + * + * Generated from protobuf field bool disabled = 8; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/Destination.php b/NetworkServices/src/V1/HttpRoute/Destination.php new file mode 100644 index 000000000000..11407089692a --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/Destination.php @@ -0,0 +1,142 @@ +google.cloud.networkservices.v1.HttpRoute.Destination + */ +class Destination extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of a BackendService to route traffic to. + * + * Generated from protobuf field string service_name = 1 [(.google.api.resource_reference) = { + */ + protected $service_name = ''; + /** + * Specifies the proportion of requests forwarded to the backend referenced + * by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * + * Generated from protobuf field int32 weight = 2; + */ + protected $weight = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_name + * The URL of a BackendService to route traffic to. + * @type int $weight + * Specifies the proportion of requests forwarded to the backend referenced + * by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of a BackendService to route traffic to. + * + * Generated from protobuf field string service_name = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getServiceName() + { + return $this->service_name; + } + + /** + * The URL of a BackendService to route traffic to. + * + * Generated from protobuf field string service_name = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceName($var) + { + GPBUtil::checkString($var, True); + $this->service_name = $var; + + return $this; + } + + /** + * Specifies the proportion of requests forwarded to the backend referenced + * by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * + * Generated from protobuf field int32 weight = 2; + * @return int + */ + public function getWeight() + { + return $this->weight; + } + + /** + * Specifies the proportion of requests forwarded to the backend referenced + * by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * + * Generated from protobuf field int32 weight = 2; + * @param int $var + * @return $this + */ + public function setWeight($var) + { + GPBUtil::checkInt32($var); + $this->weight = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy.php b/NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy.php new file mode 100644 index 000000000000..6c8150d71139 --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy.php @@ -0,0 +1,127 @@ +google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + */ +class FaultInjectionPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The specification for injecting delay to client requests. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay delay = 1; + */ + protected $delay = null; + /** + * The specification for aborting to client requests. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort abort = 2; + */ + protected $abort = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy\Delay $delay + * The specification for injecting delay to client requests. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy\Abort $abort + * The specification for aborting to client requests. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * The specification for injecting delay to client requests. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay delay = 1; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy\Delay|null + */ + public function getDelay() + { + return $this->delay; + } + + public function hasDelay() + { + return isset($this->delay); + } + + public function clearDelay() + { + unset($this->delay); + } + + /** + * The specification for injecting delay to client requests. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay delay = 1; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy\Delay $var + * @return $this + */ + public function setDelay($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy\Delay::class); + $this->delay = $var; + + return $this; + } + + /** + * The specification for aborting to client requests. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort abort = 2; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy\Abort|null + */ + public function getAbort() + { + return $this->abort; + } + + public function hasAbort() + { + return isset($this->abort); + } + + public function clearAbort() + { + unset($this->abort); + } + + /** + * The specification for aborting to client requests. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort abort = 2; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy\Abort $var + * @return $this + */ + public function setAbort($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy\Abort::class); + $this->abort = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy/Abort.php b/NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy/Abort.php new file mode 100644 index 000000000000..38c8ed390f7a --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy/Abort.php @@ -0,0 +1,111 @@ +google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + */ +class Abort extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP status code used to abort the request. + * The value must be between 200 and 599 inclusive. + * + * Generated from protobuf field int32 http_status = 1; + */ + protected $http_status = 0; + /** + * The percentage of traffic which will be aborted. + * The value must be between [0, 100] + * + * Generated from protobuf field int32 percentage = 2; + */ + protected $percentage = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $http_status + * The HTTP status code used to abort the request. + * The value must be between 200 and 599 inclusive. + * @type int $percentage + * The percentage of traffic which will be aborted. + * The value must be between [0, 100] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP status code used to abort the request. + * The value must be between 200 and 599 inclusive. + * + * Generated from protobuf field int32 http_status = 1; + * @return int + */ + public function getHttpStatus() + { + return $this->http_status; + } + + /** + * The HTTP status code used to abort the request. + * The value must be between 200 and 599 inclusive. + * + * Generated from protobuf field int32 http_status = 1; + * @param int $var + * @return $this + */ + public function setHttpStatus($var) + { + GPBUtil::checkInt32($var); + $this->http_status = $var; + + return $this; + } + + /** + * The percentage of traffic which will be aborted. + * The value must be between [0, 100] + * + * Generated from protobuf field int32 percentage = 2; + * @return int + */ + public function getPercentage() + { + return $this->percentage; + } + + /** + * The percentage of traffic which will be aborted. + * The value must be between [0, 100] + * + * Generated from protobuf field int32 percentage = 2; + * @param int $var + * @return $this + */ + public function setPercentage($var) + { + GPBUtil::checkInt32($var); + $this->percentage = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy/Delay.php b/NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy/Delay.php new file mode 100644 index 000000000000..59e0e4e5892e --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/FaultInjectionPolicy/Delay.php @@ -0,0 +1,117 @@ +google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + */ +class Delay extends \Google\Protobuf\Internal\Message +{ + /** + * Specify a fixed delay before forwarding the request. + * + * Generated from protobuf field .google.protobuf.Duration fixed_delay = 1; + */ + protected $fixed_delay = null; + /** + * The percentage of traffic on which delay will be injected. + * The value must be between [0, 100] + * + * Generated from protobuf field int32 percentage = 2; + */ + protected $percentage = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $fixed_delay + * Specify a fixed delay before forwarding the request. + * @type int $percentage + * The percentage of traffic on which delay will be injected. + * The value must be between [0, 100] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Specify a fixed delay before forwarding the request. + * + * Generated from protobuf field .google.protobuf.Duration fixed_delay = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getFixedDelay() + { + return $this->fixed_delay; + } + + public function hasFixedDelay() + { + return isset($this->fixed_delay); + } + + public function clearFixedDelay() + { + unset($this->fixed_delay); + } + + /** + * Specify a fixed delay before forwarding the request. + * + * Generated from protobuf field .google.protobuf.Duration fixed_delay = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setFixedDelay($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->fixed_delay = $var; + + return $this; + } + + /** + * The percentage of traffic on which delay will be injected. + * The value must be between [0, 100] + * + * Generated from protobuf field int32 percentage = 2; + * @return int + */ + public function getPercentage() + { + return $this->percentage; + } + + /** + * The percentage of traffic on which delay will be injected. + * The value must be between [0, 100] + * + * Generated from protobuf field int32 percentage = 2; + * @param int $var + * @return $this + */ + public function setPercentage($var) + { + GPBUtil::checkInt32($var); + $this->percentage = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/HeaderMatch.php b/NetworkServices/src/V1/HttpRoute/HeaderMatch.php new file mode 100644 index 000000000000..f32578a97bb5 --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/HeaderMatch.php @@ -0,0 +1,328 @@ +google.cloud.networkservices.v1.HttpRoute.HeaderMatch + */ +class HeaderMatch extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the HTTP header to match against. + * + * Generated from protobuf field string header = 1; + */ + protected $header = ''; + /** + * If specified, the match result will be inverted before checking. Default + * value is set to false. + * + * Generated from protobuf field bool invert_match = 8; + */ + protected $invert_match = false; + protected $MatchType; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $exact_match + * The value of the header should match exactly the content of + * exact_match. + * @type string $regex_match + * The value of the header must match the regular expression specified in + * regex_match. For regular expression grammar, please see: + * https://github.com/google/re2/wiki/Syntax + * @type string $prefix_match + * The value of the header must start with the contents of prefix_match. + * @type bool $present_match + * A header with header_name must exist. The match takes place whether or + * not the header has a value. + * @type string $suffix_match + * The value of the header must end with the contents of suffix_match. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderMatch\IntegerRange $range_match + * If specified, the rule will match if the request header value is within + * the range. + * @type string $header + * The name of the HTTP header to match against. + * @type bool $invert_match + * If specified, the match result will be inverted before checking. Default + * value is set to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * The value of the header should match exactly the content of + * exact_match. + * + * Generated from protobuf field string exact_match = 2; + * @return string + */ + public function getExactMatch() + { + return $this->readOneof(2); + } + + public function hasExactMatch() + { + return $this->hasOneof(2); + } + + /** + * The value of the header should match exactly the content of + * exact_match. + * + * Generated from protobuf field string exact_match = 2; + * @param string $var + * @return $this + */ + public function setExactMatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The value of the header must match the regular expression specified in + * regex_match. For regular expression grammar, please see: + * https://github.com/google/re2/wiki/Syntax + * + * Generated from protobuf field string regex_match = 3; + * @return string + */ + public function getRegexMatch() + { + return $this->readOneof(3); + } + + public function hasRegexMatch() + { + return $this->hasOneof(3); + } + + /** + * The value of the header must match the regular expression specified in + * regex_match. For regular expression grammar, please see: + * https://github.com/google/re2/wiki/Syntax + * + * Generated from protobuf field string regex_match = 3; + * @param string $var + * @return $this + */ + public function setRegexMatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The value of the header must start with the contents of prefix_match. + * + * Generated from protobuf field string prefix_match = 4; + * @return string + */ + public function getPrefixMatch() + { + return $this->readOneof(4); + } + + public function hasPrefixMatch() + { + return $this->hasOneof(4); + } + + /** + * The value of the header must start with the contents of prefix_match. + * + * Generated from protobuf field string prefix_match = 4; + * @param string $var + * @return $this + */ + public function setPrefixMatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A header with header_name must exist. The match takes place whether or + * not the header has a value. + * + * Generated from protobuf field bool present_match = 5; + * @return bool + */ + public function getPresentMatch() + { + return $this->readOneof(5); + } + + public function hasPresentMatch() + { + return $this->hasOneof(5); + } + + /** + * A header with header_name must exist. The match takes place whether or + * not the header has a value. + * + * Generated from protobuf field bool present_match = 5; + * @param bool $var + * @return $this + */ + public function setPresentMatch($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The value of the header must end with the contents of suffix_match. + * + * Generated from protobuf field string suffix_match = 6; + * @return string + */ + public function getSuffixMatch() + { + return $this->readOneof(6); + } + + public function hasSuffixMatch() + { + return $this->hasOneof(6); + } + + /** + * The value of the header must end with the contents of suffix_match. + * + * Generated from protobuf field string suffix_match = 6; + * @param string $var + * @return $this + */ + public function setSuffixMatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * If specified, the rule will match if the request header value is within + * the range. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange range_match = 7; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderMatch\IntegerRange|null + */ + public function getRangeMatch() + { + return $this->readOneof(7); + } + + public function hasRangeMatch() + { + return $this->hasOneof(7); + } + + /** + * If specified, the rule will match if the request header value is within + * the range. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange range_match = 7; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderMatch\IntegerRange $var + * @return $this + */ + public function setRangeMatch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderMatch\IntegerRange::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * The name of the HTTP header to match against. + * + * Generated from protobuf field string header = 1; + * @return string + */ + public function getHeader() + { + return $this->header; + } + + /** + * The name of the HTTP header to match against. + * + * Generated from protobuf field string header = 1; + * @param string $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkString($var, True); + $this->header = $var; + + return $this; + } + + /** + * If specified, the match result will be inverted before checking. Default + * value is set to false. + * + * Generated from protobuf field bool invert_match = 8; + * @return bool + */ + public function getInvertMatch() + { + return $this->invert_match; + } + + /** + * If specified, the match result will be inverted before checking. Default + * value is set to false. + * + * Generated from protobuf field bool invert_match = 8; + * @param bool $var + * @return $this + */ + public function setInvertMatch($var) + { + GPBUtil::checkBool($var); + $this->invert_match = $var; + + return $this; + } + + /** + * @return string + */ + public function getMatchType() + { + return $this->whichOneof("MatchType"); + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/HeaderMatch/IntegerRange.php b/NetworkServices/src/V1/HttpRoute/HeaderMatch/IntegerRange.php new file mode 100644 index 000000000000..93c8a691649e --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/HeaderMatch/IntegerRange.php @@ -0,0 +1,102 @@ +google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + */ +class IntegerRange extends \Google\Protobuf\Internal\Message +{ + /** + * Start of the range (inclusive) + * + * Generated from protobuf field int32 start = 1; + */ + protected $start = 0; + /** + * End of the range (exclusive) + * + * Generated from protobuf field int32 end = 2; + */ + protected $end = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start + * Start of the range (inclusive) + * @type int $end + * End of the range (exclusive) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Start of the range (inclusive) + * + * Generated from protobuf field int32 start = 1; + * @return int + */ + public function getStart() + { + return $this->start; + } + + /** + * Start of the range (inclusive) + * + * Generated from protobuf field int32 start = 1; + * @param int $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt32($var); + $this->start = $var; + + return $this; + } + + /** + * End of the range (exclusive) + * + * Generated from protobuf field int32 end = 2; + * @return int + */ + public function getEnd() + { + return $this->end; + } + + /** + * End of the range (exclusive) + * + * Generated from protobuf field int32 end = 2; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/HeaderModifier.php b/NetworkServices/src/V1/HttpRoute/HeaderModifier.php new file mode 100644 index 000000000000..2d26748177ca --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/HeaderModifier.php @@ -0,0 +1,145 @@ +google.cloud.networkservices.v1.HttpRoute.HeaderModifier + */ +class HeaderModifier extends \Google\Protobuf\Internal\Message +{ + /** + * Completely overwrite/replace the headers with given map where key is the + * name of the header, value is the value of the header. + * + * Generated from protobuf field map set = 1; + */ + private $set; + /** + * Add the headers with given map where key is the name of the header, value + * is the value of the header. + * + * Generated from protobuf field map add = 2; + */ + private $add; + /** + * Remove headers (matching by header names) specified in the list. + * + * Generated from protobuf field repeated string remove = 3; + */ + private $remove; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $set + * Completely overwrite/replace the headers with given map where key is the + * name of the header, value is the value of the header. + * @type array|\Google\Protobuf\Internal\MapField $add + * Add the headers with given map where key is the name of the header, value + * is the value of the header. + * @type array|\Google\Protobuf\Internal\RepeatedField $remove + * Remove headers (matching by header names) specified in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Completely overwrite/replace the headers with given map where key is the + * name of the header, value is the value of the header. + * + * Generated from protobuf field map set = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getSet() + { + return $this->set; + } + + /** + * Completely overwrite/replace the headers with given map where key is the + * name of the header, value is the value of the header. + * + * Generated from protobuf field map set = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setSet($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->set = $arr; + + return $this; + } + + /** + * Add the headers with given map where key is the name of the header, value + * is the value of the header. + * + * Generated from protobuf field map add = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAdd() + { + return $this->add; + } + + /** + * Add the headers with given map where key is the name of the header, value + * is the value of the header. + * + * Generated from protobuf field map add = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAdd($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->add = $arr; + + return $this; + } + + /** + * Remove headers (matching by header names) specified in the list. + * + * Generated from protobuf field repeated string remove = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRemove() + { + return $this->remove; + } + + /** + * Remove headers (matching by header names) specified in the list. + * + * Generated from protobuf field repeated string remove = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRemove($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->remove = $arr; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/QueryParameterMatch.php b/NetworkServices/src/V1/HttpRoute/QueryParameterMatch.php new file mode 100644 index 000000000000..166456935351 --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/QueryParameterMatch.php @@ -0,0 +1,200 @@ +google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + */ +class QueryParameterMatch extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the query parameter to match. + * + * Generated from protobuf field string query_parameter = 1; + */ + protected $query_parameter = ''; + protected $MatchType; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $exact_match + * The value of the query parameter must exactly match the contents of + * exact_match. + * Only one of exact_match, regex_match, or present_match must be set. + * @type string $regex_match + * The value of the query parameter must match the regular expression + * specified by regex_match. For regular expression grammar, please see + * https://github.com/google/re2/wiki/Syntax + * Only one of exact_match, regex_match, or present_match must be set. + * @type bool $present_match + * Specifies that the QueryParameterMatcher matches if request contains + * query parameter, irrespective of whether the parameter has a value or + * not. + * Only one of exact_match, regex_match, or present_match must be set. + * @type string $query_parameter + * The name of the query parameter to match. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * The value of the query parameter must exactly match the contents of + * exact_match. + * Only one of exact_match, regex_match, or present_match must be set. + * + * Generated from protobuf field string exact_match = 2; + * @return string + */ + public function getExactMatch() + { + return $this->readOneof(2); + } + + public function hasExactMatch() + { + return $this->hasOneof(2); + } + + /** + * The value of the query parameter must exactly match the contents of + * exact_match. + * Only one of exact_match, regex_match, or present_match must be set. + * + * Generated from protobuf field string exact_match = 2; + * @param string $var + * @return $this + */ + public function setExactMatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The value of the query parameter must match the regular expression + * specified by regex_match. For regular expression grammar, please see + * https://github.com/google/re2/wiki/Syntax + * Only one of exact_match, regex_match, or present_match must be set. + * + * Generated from protobuf field string regex_match = 3; + * @return string + */ + public function getRegexMatch() + { + return $this->readOneof(3); + } + + public function hasRegexMatch() + { + return $this->hasOneof(3); + } + + /** + * The value of the query parameter must match the regular expression + * specified by regex_match. For regular expression grammar, please see + * https://github.com/google/re2/wiki/Syntax + * Only one of exact_match, regex_match, or present_match must be set. + * + * Generated from protobuf field string regex_match = 3; + * @param string $var + * @return $this + */ + public function setRegexMatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Specifies that the QueryParameterMatcher matches if request contains + * query parameter, irrespective of whether the parameter has a value or + * not. + * Only one of exact_match, regex_match, or present_match must be set. + * + * Generated from protobuf field bool present_match = 4; + * @return bool + */ + public function getPresentMatch() + { + return $this->readOneof(4); + } + + public function hasPresentMatch() + { + return $this->hasOneof(4); + } + + /** + * Specifies that the QueryParameterMatcher matches if request contains + * query parameter, irrespective of whether the parameter has a value or + * not. + * Only one of exact_match, regex_match, or present_match must be set. + * + * Generated from protobuf field bool present_match = 4; + * @param bool $var + * @return $this + */ + public function setPresentMatch($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The name of the query parameter to match. + * + * Generated from protobuf field string query_parameter = 1; + * @return string + */ + public function getQueryParameter() + { + return $this->query_parameter; + } + + /** + * The name of the query parameter to match. + * + * Generated from protobuf field string query_parameter = 1; + * @param string $var + * @return $this + */ + public function setQueryParameter($var) + { + GPBUtil::checkString($var, True); + $this->query_parameter = $var; + + return $this; + } + + /** + * @return string + */ + public function getMatchType() + { + return $this->whichOneof("MatchType"); + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/Redirect.php b/NetworkServices/src/V1/HttpRoute/Redirect.php new file mode 100644 index 000000000000..07c8da47ad5b --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/Redirect.php @@ -0,0 +1,328 @@ +google.cloud.networkservices.v1.HttpRoute.Redirect + */ +class Redirect extends \Google\Protobuf\Internal\Message +{ + /** + * The host that will be used in the redirect response instead of the one + * that was supplied in the request. + * + * Generated from protobuf field string host_redirect = 1; + */ + protected $host_redirect = ''; + /** + * The path that will be used in the redirect response instead of the one + * that was supplied in the request. + * path_redirect can not be supplied together with prefix_redirect. Supply + * one alone or neither. If neither is supplied, the path of the original + * request will be used for the redirect. + * + * Generated from protobuf field string path_redirect = 2; + */ + protected $path_redirect = ''; + /** + * Indicates that during redirection, the matched prefix (or path) should be + * swapped with this value. This option allows URLs be dynamically created + * based on the request. + * + * Generated from protobuf field string prefix_rewrite = 3; + */ + protected $prefix_rewrite = ''; + /** + * The HTTP Status code to use for the redirect. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode response_code = 4; + */ + protected $response_code = 0; + /** + * If set to true, the URL scheme in the redirected request is set to https. + * If set to false, the URL scheme of the redirected request will remain the + * same as that of the request. + * The default is set to false. + * + * Generated from protobuf field bool https_redirect = 5; + */ + protected $https_redirect = false; + /** + * if set to true, any accompanying query portion of the original URL is + * removed prior to redirecting the request. If set to false, the query + * portion of the original URL is retained. + * The default is set to false. + * + * Generated from protobuf field bool strip_query = 6; + */ + protected $strip_query = false; + /** + * The port that will be used in the redirected request instead of the one + * that was supplied in the request. + * + * Generated from protobuf field int32 port_redirect = 7; + */ + protected $port_redirect = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_redirect + * The host that will be used in the redirect response instead of the one + * that was supplied in the request. + * @type string $path_redirect + * The path that will be used in the redirect response instead of the one + * that was supplied in the request. + * path_redirect can not be supplied together with prefix_redirect. Supply + * one alone or neither. If neither is supplied, the path of the original + * request will be used for the redirect. + * @type string $prefix_rewrite + * Indicates that during redirection, the matched prefix (or path) should be + * swapped with this value. This option allows URLs be dynamically created + * based on the request. + * @type int $response_code + * The HTTP Status code to use for the redirect. + * @type bool $https_redirect + * If set to true, the URL scheme in the redirected request is set to https. + * If set to false, the URL scheme of the redirected request will remain the + * same as that of the request. + * The default is set to false. + * @type bool $strip_query + * if set to true, any accompanying query portion of the original URL is + * removed prior to redirecting the request. If set to false, the query + * portion of the original URL is retained. + * The default is set to false. + * @type int $port_redirect + * The port that will be used in the redirected request instead of the one + * that was supplied in the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * The host that will be used in the redirect response instead of the one + * that was supplied in the request. + * + * Generated from protobuf field string host_redirect = 1; + * @return string + */ + public function getHostRedirect() + { + return $this->host_redirect; + } + + /** + * The host that will be used in the redirect response instead of the one + * that was supplied in the request. + * + * Generated from protobuf field string host_redirect = 1; + * @param string $var + * @return $this + */ + public function setHostRedirect($var) + { + GPBUtil::checkString($var, True); + $this->host_redirect = $var; + + return $this; + } + + /** + * The path that will be used in the redirect response instead of the one + * that was supplied in the request. + * path_redirect can not be supplied together with prefix_redirect. Supply + * one alone or neither. If neither is supplied, the path of the original + * request will be used for the redirect. + * + * Generated from protobuf field string path_redirect = 2; + * @return string + */ + public function getPathRedirect() + { + return $this->path_redirect; + } + + /** + * The path that will be used in the redirect response instead of the one + * that was supplied in the request. + * path_redirect can not be supplied together with prefix_redirect. Supply + * one alone or neither. If neither is supplied, the path of the original + * request will be used for the redirect. + * + * Generated from protobuf field string path_redirect = 2; + * @param string $var + * @return $this + */ + public function setPathRedirect($var) + { + GPBUtil::checkString($var, True); + $this->path_redirect = $var; + + return $this; + } + + /** + * Indicates that during redirection, the matched prefix (or path) should be + * swapped with this value. This option allows URLs be dynamically created + * based on the request. + * + * Generated from protobuf field string prefix_rewrite = 3; + * @return string + */ + public function getPrefixRewrite() + { + return $this->prefix_rewrite; + } + + /** + * Indicates that during redirection, the matched prefix (or path) should be + * swapped with this value. This option allows URLs be dynamically created + * based on the request. + * + * Generated from protobuf field string prefix_rewrite = 3; + * @param string $var + * @return $this + */ + public function setPrefixRewrite($var) + { + GPBUtil::checkString($var, True); + $this->prefix_rewrite = $var; + + return $this; + } + + /** + * The HTTP Status code to use for the redirect. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode response_code = 4; + * @return int + */ + public function getResponseCode() + { + return $this->response_code; + } + + /** + * The HTTP Status code to use for the redirect. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode response_code = 4; + * @param int $var + * @return $this + */ + public function setResponseCode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\HttpRoute\Redirect\ResponseCode::class); + $this->response_code = $var; + + return $this; + } + + /** + * If set to true, the URL scheme in the redirected request is set to https. + * If set to false, the URL scheme of the redirected request will remain the + * same as that of the request. + * The default is set to false. + * + * Generated from protobuf field bool https_redirect = 5; + * @return bool + */ + public function getHttpsRedirect() + { + return $this->https_redirect; + } + + /** + * If set to true, the URL scheme in the redirected request is set to https. + * If set to false, the URL scheme of the redirected request will remain the + * same as that of the request. + * The default is set to false. + * + * Generated from protobuf field bool https_redirect = 5; + * @param bool $var + * @return $this + */ + public function setHttpsRedirect($var) + { + GPBUtil::checkBool($var); + $this->https_redirect = $var; + + return $this; + } + + /** + * if set to true, any accompanying query portion of the original URL is + * removed prior to redirecting the request. If set to false, the query + * portion of the original URL is retained. + * The default is set to false. + * + * Generated from protobuf field bool strip_query = 6; + * @return bool + */ + public function getStripQuery() + { + return $this->strip_query; + } + + /** + * if set to true, any accompanying query portion of the original URL is + * removed prior to redirecting the request. If set to false, the query + * portion of the original URL is retained. + * The default is set to false. + * + * Generated from protobuf field bool strip_query = 6; + * @param bool $var + * @return $this + */ + public function setStripQuery($var) + { + GPBUtil::checkBool($var); + $this->strip_query = $var; + + return $this; + } + + /** + * The port that will be used in the redirected request instead of the one + * that was supplied in the request. + * + * Generated from protobuf field int32 port_redirect = 7; + * @return int + */ + public function getPortRedirect() + { + return $this->port_redirect; + } + + /** + * The port that will be used in the redirected request instead of the one + * that was supplied in the request. + * + * Generated from protobuf field int32 port_redirect = 7; + * @param int $var + * @return $this + */ + public function setPortRedirect($var) + { + GPBUtil::checkInt32($var); + $this->port_redirect = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/Redirect/ResponseCode.php b/NetworkServices/src/V1/HttpRoute/Redirect/ResponseCode.php new file mode 100644 index 000000000000..1d05afded328 --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/Redirect/ResponseCode.php @@ -0,0 +1,83 @@ +google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode + */ +class ResponseCode +{ + /** + * Default value + * + * Generated from protobuf enum RESPONSE_CODE_UNSPECIFIED = 0; + */ + const RESPONSE_CODE_UNSPECIFIED = 0; + /** + * Corresponds to 301. + * + * Generated from protobuf enum MOVED_PERMANENTLY_DEFAULT = 1; + */ + const MOVED_PERMANENTLY_DEFAULT = 1; + /** + * Corresponds to 302. + * + * Generated from protobuf enum FOUND = 2; + */ + const FOUND = 2; + /** + * Corresponds to 303. + * + * Generated from protobuf enum SEE_OTHER = 3; + */ + const SEE_OTHER = 3; + /** + * Corresponds to 307. In this case, the request method will be retained. + * + * Generated from protobuf enum TEMPORARY_REDIRECT = 4; + */ + const TEMPORARY_REDIRECT = 4; + /** + * Corresponds to 308. In this case, the request method will be retained. + * + * Generated from protobuf enum PERMANENT_REDIRECT = 5; + */ + const PERMANENT_REDIRECT = 5; + + private static $valueToName = [ + self::RESPONSE_CODE_UNSPECIFIED => 'RESPONSE_CODE_UNSPECIFIED', + self::MOVED_PERMANENTLY_DEFAULT => 'MOVED_PERMANENTLY_DEFAULT', + self::FOUND => 'FOUND', + self::SEE_OTHER => 'SEE_OTHER', + self::TEMPORARY_REDIRECT => 'TEMPORARY_REDIRECT', + self::PERMANENT_REDIRECT => 'PERMANENT_REDIRECT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/NetworkServices/src/V1/HttpRoute/RequestMirrorPolicy.php b/NetworkServices/src/V1/HttpRoute/RequestMirrorPolicy.php new file mode 100644 index 000000000000..f80400e5e43b --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/RequestMirrorPolicy.php @@ -0,0 +1,85 @@ +google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + */ +class RequestMirrorPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The destination the requests will be mirrored to. The weight of the + * destination will be ignored. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.Destination destination = 1; + */ + protected $destination = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\Destination $destination + * The destination the requests will be mirrored to. The weight of the + * destination will be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * The destination the requests will be mirrored to. The weight of the + * destination will be ignored. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.Destination destination = 1; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\Destination|null + */ + public function getDestination() + { + return $this->destination; + } + + public function hasDestination() + { + return isset($this->destination); + } + + public function clearDestination() + { + unset($this->destination); + } + + /** + * The destination the requests will be mirrored to. The weight of the + * destination will be ignored. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.Destination destination = 1; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\Destination $var + * @return $this + */ + public function setDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\Destination::class); + $this->destination = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/RetryPolicy.php b/NetworkServices/src/V1/HttpRoute/RetryPolicy.php new file mode 100644 index 000000000000..1cb2959062b1 --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/RetryPolicy.php @@ -0,0 +1,214 @@ +google.cloud.networkservices.v1.HttpRoute.RetryPolicy + */ +class RetryPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies one or more conditions when this retry policy applies. Valid + * values are: + * 5xx: Proxy will attempt a retry if the destination service responds + * with any 5xx response code, of if the destination service does not + * respond at all, example: disconnect, reset, read timeout, connection + * failure and refused streams. + * gateway-error: Similar to 5xx, but only applies to response codes 502, + * 503, 504. + * reset: Proxy will attempt a retry if the destination service does not + * respond at all (disconnect/reset/read timeout) + * connect-failure: Proxy will retry on failures connecting to destination + * for example due to connection timeouts. + * retriable-4xx: Proxy will retry fro retriable 4xx response codes. + * Currently the only retriable error supported is 409. + * refused-stream: Proxy will retry if the destination resets the stream + * with a REFUSED_STREAM error code. This reset type indicates that it + * is safe to retry. + * + * Generated from protobuf field repeated string retry_conditions = 1; + */ + private $retry_conditions; + /** + * Specifies the allowed number of retries. This number must be > 0. If not + * specified, default to 1. + * + * Generated from protobuf field int32 num_retries = 2; + */ + protected $num_retries = 0; + /** + * Specifies a non-zero timeout per retry attempt. + * + * Generated from protobuf field .google.protobuf.Duration per_try_timeout = 3; + */ + protected $per_try_timeout = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $retry_conditions + * Specifies one or more conditions when this retry policy applies. Valid + * values are: + * 5xx: Proxy will attempt a retry if the destination service responds + * with any 5xx response code, of if the destination service does not + * respond at all, example: disconnect, reset, read timeout, connection + * failure and refused streams. + * gateway-error: Similar to 5xx, but only applies to response codes 502, + * 503, 504. + * reset: Proxy will attempt a retry if the destination service does not + * respond at all (disconnect/reset/read timeout) + * connect-failure: Proxy will retry on failures connecting to destination + * for example due to connection timeouts. + * retriable-4xx: Proxy will retry fro retriable 4xx response codes. + * Currently the only retriable error supported is 409. + * refused-stream: Proxy will retry if the destination resets the stream + * with a REFUSED_STREAM error code. This reset type indicates that it + * is safe to retry. + * @type int $num_retries + * Specifies the allowed number of retries. This number must be > 0. If not + * specified, default to 1. + * @type \Google\Protobuf\Duration $per_try_timeout + * Specifies a non-zero timeout per retry attempt. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies one or more conditions when this retry policy applies. Valid + * values are: + * 5xx: Proxy will attempt a retry if the destination service responds + * with any 5xx response code, of if the destination service does not + * respond at all, example: disconnect, reset, read timeout, connection + * failure and refused streams. + * gateway-error: Similar to 5xx, but only applies to response codes 502, + * 503, 504. + * reset: Proxy will attempt a retry if the destination service does not + * respond at all (disconnect/reset/read timeout) + * connect-failure: Proxy will retry on failures connecting to destination + * for example due to connection timeouts. + * retriable-4xx: Proxy will retry fro retriable 4xx response codes. + * Currently the only retriable error supported is 409. + * refused-stream: Proxy will retry if the destination resets the stream + * with a REFUSED_STREAM error code. This reset type indicates that it + * is safe to retry. + * + * Generated from protobuf field repeated string retry_conditions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRetryConditions() + { + return $this->retry_conditions; + } + + /** + * Specifies one or more conditions when this retry policy applies. Valid + * values are: + * 5xx: Proxy will attempt a retry if the destination service responds + * with any 5xx response code, of if the destination service does not + * respond at all, example: disconnect, reset, read timeout, connection + * failure and refused streams. + * gateway-error: Similar to 5xx, but only applies to response codes 502, + * 503, 504. + * reset: Proxy will attempt a retry if the destination service does not + * respond at all (disconnect/reset/read timeout) + * connect-failure: Proxy will retry on failures connecting to destination + * for example due to connection timeouts. + * retriable-4xx: Proxy will retry fro retriable 4xx response codes. + * Currently the only retriable error supported is 409. + * refused-stream: Proxy will retry if the destination resets the stream + * with a REFUSED_STREAM error code. This reset type indicates that it + * is safe to retry. + * + * Generated from protobuf field repeated string retry_conditions = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRetryConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->retry_conditions = $arr; + + return $this; + } + + /** + * Specifies the allowed number of retries. This number must be > 0. If not + * specified, default to 1. + * + * Generated from protobuf field int32 num_retries = 2; + * @return int + */ + public function getNumRetries() + { + return $this->num_retries; + } + + /** + * Specifies the allowed number of retries. This number must be > 0. If not + * specified, default to 1. + * + * Generated from protobuf field int32 num_retries = 2; + * @param int $var + * @return $this + */ + public function setNumRetries($var) + { + GPBUtil::checkInt32($var); + $this->num_retries = $var; + + return $this; + } + + /** + * Specifies a non-zero timeout per retry attempt. + * + * Generated from protobuf field .google.protobuf.Duration per_try_timeout = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getPerTryTimeout() + { + return $this->per_try_timeout; + } + + public function hasPerTryTimeout() + { + return isset($this->per_try_timeout); + } + + public function clearPerTryTimeout() + { + unset($this->per_try_timeout); + } + + /** + * Specifies a non-zero timeout per retry attempt. + * + * Generated from protobuf field .google.protobuf.Duration per_try_timeout = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setPerTryTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->per_try_timeout = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/RouteAction.php b/NetworkServices/src/V1/HttpRoute/RouteAction.php new file mode 100644 index 000000000000..7c470d169513 --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/RouteAction.php @@ -0,0 +1,544 @@ +google.cloud.networkservices.v1.HttpRoute.RouteAction + */ +class RouteAction extends \Google\Protobuf\Internal\Message +{ + /** + * The destination to which traffic should be forwarded. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.Destination destinations = 1; + */ + private $destinations; + /** + * If set, the request is directed as configured by this field. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.Redirect redirect = 2; + */ + protected $redirect = null; + /** + * The specification for fault injection introduced into traffic to test the + * resiliency of clients to backend service failure. As part of fault + * injection, when clients send requests to a backend service, delays can be + * introduced on a percentage of requests before sending those requests to + * the backend service. Similarly requests from clients can be aborted for a + * percentage of requests. + * timeout and retry_policy will be ignored by clients that are configured + * with a fault_injection_policy + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy fault_injection_policy = 4; + */ + protected $fault_injection_policy = null; + /** + * The specification for modifying the headers of a matching request prior + * to delivery of the request to the destination. If HeaderModifiers are set + * on both the Destination and the RouteAction, they will be merged. + * Conflicts between the two will not be resolved on the configuration. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.HeaderModifier request_header_modifier = 5; + */ + protected $request_header_modifier = null; + /** + * The specification for modifying the headers of a response prior to + * sending the response back to the client. If HeaderModifiers are set + * on both the Destination and the RouteAction, they will be merged. + * Conflicts between the two will not be resolved on the configuration. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.HeaderModifier response_header_modifier = 6; + */ + protected $response_header_modifier = null; + /** + * The specification for rewrite URL before forwarding requests to the + * destination. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.URLRewrite url_rewrite = 7; + */ + protected $url_rewrite = null; + /** + * Specifies the timeout for selected route. Timeout is computed from the + * time the request has been fully processed (i.e. end of stream) up until + * the response has been completely processed. Timeout includes all retries. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + */ + protected $timeout = null; + /** + * Specifies the retry policy associated with this route. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.RetryPolicy retry_policy = 9; + */ + protected $retry_policy = null; + /** + * Specifies the policy on how requests intended for the routes destination + * are shadowed to a separate mirrored destination. Proxy will not wait for + * the shadow destination to respond before returning the response. Prior to + * sending traffic to the shadow service, the host/authority header is + * suffixed with -shadow. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy request_mirror_policy = 10; + */ + protected $request_mirror_policy = null; + /** + * The specification for allowing client side cross-origin requests. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.CorsPolicy cors_policy = 11; + */ + protected $cors_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\HttpRoute\Destination>|\Google\Protobuf\Internal\RepeatedField $destinations + * The destination to which traffic should be forwarded. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\Redirect $redirect + * If set, the request is directed as configured by this field. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy $fault_injection_policy + * The specification for fault injection introduced into traffic to test the + * resiliency of clients to backend service failure. As part of fault + * injection, when clients send requests to a backend service, delays can be + * introduced on a percentage of requests before sending those requests to + * the backend service. Similarly requests from clients can be aborted for a + * percentage of requests. + * timeout and retry_policy will be ignored by clients that are configured + * with a fault_injection_policy + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderModifier $request_header_modifier + * The specification for modifying the headers of a matching request prior + * to delivery of the request to the destination. If HeaderModifiers are set + * on both the Destination and the RouteAction, they will be merged. + * Conflicts between the two will not be resolved on the configuration. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderModifier $response_header_modifier + * The specification for modifying the headers of a response prior to + * sending the response back to the client. If HeaderModifiers are set + * on both the Destination and the RouteAction, they will be merged. + * Conflicts between the two will not be resolved on the configuration. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\URLRewrite $url_rewrite + * The specification for rewrite URL before forwarding requests to the + * destination. + * @type \Google\Protobuf\Duration $timeout + * Specifies the timeout for selected route. Timeout is computed from the + * time the request has been fully processed (i.e. end of stream) up until + * the response has been completely processed. Timeout includes all retries. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\RetryPolicy $retry_policy + * Specifies the retry policy associated with this route. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\RequestMirrorPolicy $request_mirror_policy + * Specifies the policy on how requests intended for the routes destination + * are shadowed to a separate mirrored destination. Proxy will not wait for + * the shadow destination to respond before returning the response. Prior to + * sending traffic to the shadow service, the host/authority header is + * suffixed with -shadow. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\CorsPolicy $cors_policy + * The specification for allowing client side cross-origin requests. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * The destination to which traffic should be forwarded. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.Destination destinations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestinations() + { + return $this->destinations; + } + + /** + * The destination to which traffic should be forwarded. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.Destination destinations = 1; + * @param array<\Google\Cloud\NetworkServices\V1\HttpRoute\Destination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\HttpRoute\Destination::class); + $this->destinations = $arr; + + return $this; + } + + /** + * If set, the request is directed as configured by this field. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.Redirect redirect = 2; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\Redirect|null + */ + public function getRedirect() + { + return $this->redirect; + } + + public function hasRedirect() + { + return isset($this->redirect); + } + + public function clearRedirect() + { + unset($this->redirect); + } + + /** + * If set, the request is directed as configured by this field. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.Redirect redirect = 2; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\Redirect $var + * @return $this + */ + public function setRedirect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\Redirect::class); + $this->redirect = $var; + + return $this; + } + + /** + * The specification for fault injection introduced into traffic to test the + * resiliency of clients to backend service failure. As part of fault + * injection, when clients send requests to a backend service, delays can be + * introduced on a percentage of requests before sending those requests to + * the backend service. Similarly requests from clients can be aborted for a + * percentage of requests. + * timeout and retry_policy will be ignored by clients that are configured + * with a fault_injection_policy + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy fault_injection_policy = 4; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy|null + */ + public function getFaultInjectionPolicy() + { + return $this->fault_injection_policy; + } + + public function hasFaultInjectionPolicy() + { + return isset($this->fault_injection_policy); + } + + public function clearFaultInjectionPolicy() + { + unset($this->fault_injection_policy); + } + + /** + * The specification for fault injection introduced into traffic to test the + * resiliency of clients to backend service failure. As part of fault + * injection, when clients send requests to a backend service, delays can be + * introduced on a percentage of requests before sending those requests to + * the backend service. Similarly requests from clients can be aborted for a + * percentage of requests. + * timeout and retry_policy will be ignored by clients that are configured + * with a fault_injection_policy + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy fault_injection_policy = 4; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy $var + * @return $this + */ + public function setFaultInjectionPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\FaultInjectionPolicy::class); + $this->fault_injection_policy = $var; + + return $this; + } + + /** + * The specification for modifying the headers of a matching request prior + * to delivery of the request to the destination. If HeaderModifiers are set + * on both the Destination and the RouteAction, they will be merged. + * Conflicts between the two will not be resolved on the configuration. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.HeaderModifier request_header_modifier = 5; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderModifier|null + */ + public function getRequestHeaderModifier() + { + return $this->request_header_modifier; + } + + public function hasRequestHeaderModifier() + { + return isset($this->request_header_modifier); + } + + public function clearRequestHeaderModifier() + { + unset($this->request_header_modifier); + } + + /** + * The specification for modifying the headers of a matching request prior + * to delivery of the request to the destination. If HeaderModifiers are set + * on both the Destination and the RouteAction, they will be merged. + * Conflicts between the two will not be resolved on the configuration. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.HeaderModifier request_header_modifier = 5; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderModifier $var + * @return $this + */ + public function setRequestHeaderModifier($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderModifier::class); + $this->request_header_modifier = $var; + + return $this; + } + + /** + * The specification for modifying the headers of a response prior to + * sending the response back to the client. If HeaderModifiers are set + * on both the Destination and the RouteAction, they will be merged. + * Conflicts between the two will not be resolved on the configuration. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.HeaderModifier response_header_modifier = 6; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderModifier|null + */ + public function getResponseHeaderModifier() + { + return $this->response_header_modifier; + } + + public function hasResponseHeaderModifier() + { + return isset($this->response_header_modifier); + } + + public function clearResponseHeaderModifier() + { + unset($this->response_header_modifier); + } + + /** + * The specification for modifying the headers of a response prior to + * sending the response back to the client. If HeaderModifiers are set + * on both the Destination and the RouteAction, they will be merged. + * Conflicts between the two will not be resolved on the configuration. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.HeaderModifier response_header_modifier = 6; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderModifier $var + * @return $this + */ + public function setResponseHeaderModifier($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderModifier::class); + $this->response_header_modifier = $var; + + return $this; + } + + /** + * The specification for rewrite URL before forwarding requests to the + * destination. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.URLRewrite url_rewrite = 7; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\URLRewrite|null + */ + public function getUrlRewrite() + { + return $this->url_rewrite; + } + + public function hasUrlRewrite() + { + return isset($this->url_rewrite); + } + + public function clearUrlRewrite() + { + unset($this->url_rewrite); + } + + /** + * The specification for rewrite URL before forwarding requests to the + * destination. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.URLRewrite url_rewrite = 7; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\URLRewrite $var + * @return $this + */ + public function setUrlRewrite($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\URLRewrite::class); + $this->url_rewrite = $var; + + return $this; + } + + /** + * Specifies the timeout for selected route. Timeout is computed from the + * time the request has been fully processed (i.e. end of stream) up until + * the response has been completely processed. Timeout includes all retries. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Specifies the timeout for selected route. Timeout is computed from the + * time the request has been fully processed (i.e. end of stream) up until + * the response has been completely processed. Timeout includes all retries. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Specifies the retry policy associated with this route. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.RetryPolicy retry_policy = 9; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\RetryPolicy|null + */ + public function getRetryPolicy() + { + return $this->retry_policy; + } + + public function hasRetryPolicy() + { + return isset($this->retry_policy); + } + + public function clearRetryPolicy() + { + unset($this->retry_policy); + } + + /** + * Specifies the retry policy associated with this route. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.RetryPolicy retry_policy = 9; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\RetryPolicy $var + * @return $this + */ + public function setRetryPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\RetryPolicy::class); + $this->retry_policy = $var; + + return $this; + } + + /** + * Specifies the policy on how requests intended for the routes destination + * are shadowed to a separate mirrored destination. Proxy will not wait for + * the shadow destination to respond before returning the response. Prior to + * sending traffic to the shadow service, the host/authority header is + * suffixed with -shadow. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy request_mirror_policy = 10; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\RequestMirrorPolicy|null + */ + public function getRequestMirrorPolicy() + { + return $this->request_mirror_policy; + } + + public function hasRequestMirrorPolicy() + { + return isset($this->request_mirror_policy); + } + + public function clearRequestMirrorPolicy() + { + unset($this->request_mirror_policy); + } + + /** + * Specifies the policy on how requests intended for the routes destination + * are shadowed to a separate mirrored destination. Proxy will not wait for + * the shadow destination to respond before returning the response. Prior to + * sending traffic to the shadow service, the host/authority header is + * suffixed with -shadow. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy request_mirror_policy = 10; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\RequestMirrorPolicy $var + * @return $this + */ + public function setRequestMirrorPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\RequestMirrorPolicy::class); + $this->request_mirror_policy = $var; + + return $this; + } + + /** + * The specification for allowing client side cross-origin requests. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.CorsPolicy cors_policy = 11; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\CorsPolicy|null + */ + public function getCorsPolicy() + { + return $this->cors_policy; + } + + public function hasCorsPolicy() + { + return isset($this->cors_policy); + } + + public function clearCorsPolicy() + { + unset($this->cors_policy); + } + + /** + * The specification for allowing client side cross-origin requests. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.CorsPolicy cors_policy = 11; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\CorsPolicy $var + * @return $this + */ + public function setCorsPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\CorsPolicy::class); + $this->cors_policy = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/RouteMatch.php b/NetworkServices/src/V1/HttpRoute/RouteMatch.php new file mode 100644 index 000000000000..5a253d249df6 --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/RouteMatch.php @@ -0,0 +1,288 @@ +google.cloud.networkservices.v1.HttpRoute.RouteMatch + */ +class RouteMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies if prefix_match and full_path_match matches are case sensitive. + * The default value is false. + * + * Generated from protobuf field bool ignore_case = 4; + */ + protected $ignore_case = false; + /** + * Specifies a list of HTTP request headers to match against. ALL of the + * supplied headers must be matched. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.HeaderMatch headers = 5; + */ + private $headers; + /** + * Specifies a list of query parameters to match against. ALL of the query + * parameters must be matched. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch query_parameters = 6; + */ + private $query_parameters; + protected $PathMatch; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $full_path_match + * The HTTP request path value should exactly match this value. + * Only one of full_path_match, prefix_match, or regex_match should be + * used. + * @type string $prefix_match + * The HTTP request path value must begin with specified prefix_match. + * prefix_match must begin with a /. + * Only one of full_path_match, prefix_match, or regex_match should be + * used. + * @type string $regex_match + * The HTTP request path value must satisfy the regular expression + * specified by regex_match after removing any query parameters and anchor + * supplied with the original URL. For regular expression grammar, please + * see https://github.com/google/re2/wiki/Syntax + * Only one of full_path_match, prefix_match, or regex_match should be + * used. + * @type bool $ignore_case + * Specifies if prefix_match and full_path_match matches are case sensitive. + * The default value is false. + * @type array<\Google\Cloud\NetworkServices\V1\HttpRoute\HeaderMatch>|\Google\Protobuf\Internal\RepeatedField $headers + * Specifies a list of HTTP request headers to match against. ALL of the + * supplied headers must be matched. + * @type array<\Google\Cloud\NetworkServices\V1\HttpRoute\QueryParameterMatch>|\Google\Protobuf\Internal\RepeatedField $query_parameters + * Specifies a list of query parameters to match against. ALL of the query + * parameters must be matched. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP request path value should exactly match this value. + * Only one of full_path_match, prefix_match, or regex_match should be + * used. + * + * Generated from protobuf field string full_path_match = 1; + * @return string + */ + public function getFullPathMatch() + { + return $this->readOneof(1); + } + + public function hasFullPathMatch() + { + return $this->hasOneof(1); + } + + /** + * The HTTP request path value should exactly match this value. + * Only one of full_path_match, prefix_match, or regex_match should be + * used. + * + * Generated from protobuf field string full_path_match = 1; + * @param string $var + * @return $this + */ + public function setFullPathMatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The HTTP request path value must begin with specified prefix_match. + * prefix_match must begin with a /. + * Only one of full_path_match, prefix_match, or regex_match should be + * used. + * + * Generated from protobuf field string prefix_match = 2; + * @return string + */ + public function getPrefixMatch() + { + return $this->readOneof(2); + } + + public function hasPrefixMatch() + { + return $this->hasOneof(2); + } + + /** + * The HTTP request path value must begin with specified prefix_match. + * prefix_match must begin with a /. + * Only one of full_path_match, prefix_match, or regex_match should be + * used. + * + * Generated from protobuf field string prefix_match = 2; + * @param string $var + * @return $this + */ + public function setPrefixMatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The HTTP request path value must satisfy the regular expression + * specified by regex_match after removing any query parameters and anchor + * supplied with the original URL. For regular expression grammar, please + * see https://github.com/google/re2/wiki/Syntax + * Only one of full_path_match, prefix_match, or regex_match should be + * used. + * + * Generated from protobuf field string regex_match = 3; + * @return string + */ + public function getRegexMatch() + { + return $this->readOneof(3); + } + + public function hasRegexMatch() + { + return $this->hasOneof(3); + } + + /** + * The HTTP request path value must satisfy the regular expression + * specified by regex_match after removing any query parameters and anchor + * supplied with the original URL. For regular expression grammar, please + * see https://github.com/google/re2/wiki/Syntax + * Only one of full_path_match, prefix_match, or regex_match should be + * used. + * + * Generated from protobuf field string regex_match = 3; + * @param string $var + * @return $this + */ + public function setRegexMatch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Specifies if prefix_match and full_path_match matches are case sensitive. + * The default value is false. + * + * Generated from protobuf field bool ignore_case = 4; + * @return bool + */ + public function getIgnoreCase() + { + return $this->ignore_case; + } + + /** + * Specifies if prefix_match and full_path_match matches are case sensitive. + * The default value is false. + * + * Generated from protobuf field bool ignore_case = 4; + * @param bool $var + * @return $this + */ + public function setIgnoreCase($var) + { + GPBUtil::checkBool($var); + $this->ignore_case = $var; + + return $this; + } + + /** + * Specifies a list of HTTP request headers to match against. ALL of the + * supplied headers must be matched. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.HeaderMatch headers = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Specifies a list of HTTP request headers to match against. ALL of the + * supplied headers must be matched. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.HeaderMatch headers = 5; + * @param array<\Google\Cloud\NetworkServices\V1\HttpRoute\HeaderMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\HttpRoute\HeaderMatch::class); + $this->headers = $arr; + + return $this; + } + + /** + * Specifies a list of query parameters to match against. ALL of the query + * parameters must be matched. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch query_parameters = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryParameters() + { + return $this->query_parameters; + } + + /** + * Specifies a list of query parameters to match against. ALL of the query + * parameters must be matched. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch query_parameters = 6; + * @param array<\Google\Cloud\NetworkServices\V1\HttpRoute\QueryParameterMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\HttpRoute\QueryParameterMatch::class); + $this->query_parameters = $arr; + + return $this; + } + + /** + * @return string + */ + public function getPathMatch() + { + return $this->whichOneof("PathMatch"); + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/RouteRule.php b/NetworkServices/src/V1/HttpRoute/RouteRule.php new file mode 100644 index 000000000000..7e5875caaa5a --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/RouteRule.php @@ -0,0 +1,137 @@ +google.cloud.networkservices.v1.HttpRoute.RouteRule + */ +class RouteRule extends \Google\Protobuf\Internal\Message +{ + /** + * A list of matches define conditions used for matching the rule against + * incoming HTTP requests. Each match is independent, i.e. this rule will be + * matched if ANY one of the matches is satisfied. + * If no matches field is specified, this rule will unconditionally match + * traffic. + * If a default rule is desired to be configured, add a rule with no matches + * specified to the end of the rules list. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.RouteMatch matches = 1; + */ + private $matches; + /** + * The detailed rule defining how to route matched traffic. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.RouteAction action = 2; + */ + protected $action = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\HttpRoute\RouteMatch>|\Google\Protobuf\Internal\RepeatedField $matches + * A list of matches define conditions used for matching the rule against + * incoming HTTP requests. Each match is independent, i.e. this rule will be + * matched if ANY one of the matches is satisfied. + * If no matches field is specified, this rule will unconditionally match + * traffic. + * If a default rule is desired to be configured, add a rule with no matches + * specified to the end of the rules list. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute\RouteAction $action + * The detailed rule defining how to route matched traffic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * A list of matches define conditions used for matching the rule against + * incoming HTTP requests. Each match is independent, i.e. this rule will be + * matched if ANY one of the matches is satisfied. + * If no matches field is specified, this rule will unconditionally match + * traffic. + * If a default rule is desired to be configured, add a rule with no matches + * specified to the end of the rules list. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.RouteMatch matches = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMatches() + { + return $this->matches; + } + + /** + * A list of matches define conditions used for matching the rule against + * incoming HTTP requests. Each match is independent, i.e. this rule will be + * matched if ANY one of the matches is satisfied. + * If no matches field is specified, this rule will unconditionally match + * traffic. + * If a default rule is desired to be configured, add a rule with no matches + * specified to the end of the rules list. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute.RouteMatch matches = 1; + * @param array<\Google\Cloud\NetworkServices\V1\HttpRoute\RouteMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMatches($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\HttpRoute\RouteMatch::class); + $this->matches = $arr; + + return $this; + } + + /** + * The detailed rule defining how to route matched traffic. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.RouteAction action = 2; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute\RouteAction|null + */ + public function getAction() + { + return $this->action; + } + + public function hasAction() + { + return isset($this->action); + } + + public function clearAction() + { + unset($this->action); + } + + /** + * The detailed rule defining how to route matched traffic. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute.RouteAction action = 2; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute\RouteAction $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute\RouteAction::class); + $this->action = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/HttpRoute/URLRewrite.php b/NetworkServices/src/V1/HttpRoute/URLRewrite.php new file mode 100644 index 000000000000..d9c7db9e1acc --- /dev/null +++ b/NetworkServices/src/V1/HttpRoute/URLRewrite.php @@ -0,0 +1,111 @@ +google.cloud.networkservices.v1.HttpRoute.URLRewrite + */ +class URLRewrite extends \Google\Protobuf\Internal\Message +{ + /** + * Prior to forwarding the request to the selected destination, the matching + * portion of the requests path is replaced by this value. + * + * Generated from protobuf field string path_prefix_rewrite = 1; + */ + protected $path_prefix_rewrite = ''; + /** + * Prior to forwarding the request to the selected destination, the requests + * host header is replaced by this value. + * + * Generated from protobuf field string host_rewrite = 2; + */ + protected $host_rewrite = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path_prefix_rewrite + * Prior to forwarding the request to the selected destination, the matching + * portion of the requests path is replaced by this value. + * @type string $host_rewrite + * Prior to forwarding the request to the selected destination, the requests + * host header is replaced by this value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Prior to forwarding the request to the selected destination, the matching + * portion of the requests path is replaced by this value. + * + * Generated from protobuf field string path_prefix_rewrite = 1; + * @return string + */ + public function getPathPrefixRewrite() + { + return $this->path_prefix_rewrite; + } + + /** + * Prior to forwarding the request to the selected destination, the matching + * portion of the requests path is replaced by this value. + * + * Generated from protobuf field string path_prefix_rewrite = 1; + * @param string $var + * @return $this + */ + public function setPathPrefixRewrite($var) + { + GPBUtil::checkString($var, True); + $this->path_prefix_rewrite = $var; + + return $this; + } + + /** + * Prior to forwarding the request to the selected destination, the requests + * host header is replaced by this value. + * + * Generated from protobuf field string host_rewrite = 2; + * @return string + */ + public function getHostRewrite() + { + return $this->host_rewrite; + } + + /** + * Prior to forwarding the request to the selected destination, the requests + * host header is replaced by this value. + * + * Generated from protobuf field string host_rewrite = 2; + * @param string $var + * @return $this + */ + public function setHostRewrite($var) + { + GPBUtil::checkString($var, True); + $this->host_rewrite = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/LbRouteExtension.php b/NetworkServices/src/V1/LbRouteExtension.php new file mode 100644 index 000000000000..9609aa638c89 --- /dev/null +++ b/NetworkServices/src/V1/LbRouteExtension.php @@ -0,0 +1,462 @@ +google.cloud.networkservices.v1.LbRouteExtension + */ +class LbRouteExtension extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Identifier. Name of the `LbRouteExtension` resource in the + * following format: + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. A human-readable description of the resource. + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Set of labels associated with the `LbRouteExtension` resource. + * The format must comply with [the requirements for + * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements) + * for Google Cloud resources. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. A list of references to the forwarding rules to which this + * service extension is attached to. At least one forwarding rule is required. + * There can be only one `LbRouteExtension` resource per forwarding rule. + * + * Generated from protobuf field repeated string forwarding_rules = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + private $forwarding_rules; + /** + * Required. A set of ordered extension chains that contain the match + * conditions and extensions to execute. Match conditions for each extension + * chain are evaluated in sequence for a given request. The first extension + * chain that has a condition that matches the request is executed. + * Any subsequent extension chains do not execute. + * Limited to 5 extension chains per resource. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ExtensionChain extension_chains = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + private $extension_chains; + /** + * Required. All backend services and forwarding rules referenced by this + * extension must share the same load balancing scheme. Supported values: + * `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more information, refer to + * [Choosing a load + * balancer](https://cloud.google.com/load-balancing/docs/backend-service). + * + * Generated from protobuf field .google.cloud.networkservices.v1.LoadBalancingScheme load_balancing_scheme = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $load_balancing_scheme = 0; + /** + * Optional. The metadata provided here is included as part of the + * `metadata_context` (of type `google.protobuf.Struct`) in the + * `ProcessingRequest` message sent to the extension + * server. The metadata is available under the namespace + * `com.google.lb_route_extension.`. + * The following variables are supported in the metadata Struct: + * `{forwarding_rule_id}` - substituted with the forwarding rule's fully + * qualified resource name. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Identifier. Name of the `LbRouteExtension` resource in the + * following format: + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type string $description + * Optional. A human-readable description of the resource. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Set of labels associated with the `LbRouteExtension` resource. + * The format must comply with [the requirements for + * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements) + * for Google Cloud resources. + * @type array|\Google\Protobuf\Internal\RepeatedField $forwarding_rules + * Required. A list of references to the forwarding rules to which this + * service extension is attached to. At least one forwarding rule is required. + * There can be only one `LbRouteExtension` resource per forwarding rule. + * @type array<\Google\Cloud\NetworkServices\V1\ExtensionChain>|\Google\Protobuf\Internal\RepeatedField $extension_chains + * Required. A set of ordered extension chains that contain the match + * conditions and extensions to execute. Match conditions for each extension + * chain are evaluated in sequence for a given request. The first extension + * chain that has a condition that matches the request is executed. + * Any subsequent extension chains do not execute. + * Limited to 5 extension chains per resource. + * @type int $load_balancing_scheme + * Required. All backend services and forwarding rules referenced by this + * extension must share the same load balancing scheme. Supported values: + * `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more information, refer to + * [Choosing a load + * balancer](https://cloud.google.com/load-balancing/docs/backend-service). + * @type \Google\Protobuf\Struct $metadata + * Optional. The metadata provided here is included as part of the + * `metadata_context` (of type `google.protobuf.Struct`) in the + * `ProcessingRequest` message sent to the extension + * server. The metadata is available under the namespace + * `com.google.lb_route_extension.`. + * The following variables are supported in the metadata Struct: + * `{forwarding_rule_id}` - substituted with the forwarding rule's fully + * qualified resource name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. Identifier. Name of the `LbRouteExtension` resource in the + * following format: + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Identifier. Name of the `LbRouteExtension` resource in the + * following format: + * `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. A human-readable description of the resource. + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A human-readable description of the resource. + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Set of labels associated with the `LbRouteExtension` resource. + * The format must comply with [the requirements for + * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements) + * for Google Cloud resources. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Set of labels associated with the `LbRouteExtension` resource. + * The format must comply with [the requirements for + * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements) + * for Google Cloud resources. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. A list of references to the forwarding rules to which this + * service extension is attached to. At least one forwarding rule is required. + * There can be only one `LbRouteExtension` resource per forwarding rule. + * + * Generated from protobuf field repeated string forwarding_rules = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getForwardingRules() + { + return $this->forwarding_rules; + } + + /** + * Required. A list of references to the forwarding rules to which this + * service extension is attached to. At least one forwarding rule is required. + * There can be only one `LbRouteExtension` resource per forwarding rule. + * + * Generated from protobuf field repeated string forwarding_rules = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setForwardingRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->forwarding_rules = $arr; + + return $this; + } + + /** + * Required. A set of ordered extension chains that contain the match + * conditions and extensions to execute. Match conditions for each extension + * chain are evaluated in sequence for a given request. The first extension + * chain that has a condition that matches the request is executed. + * Any subsequent extension chains do not execute. + * Limited to 5 extension chains per resource. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ExtensionChain extension_chains = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtensionChains() + { + return $this->extension_chains; + } + + /** + * Required. A set of ordered extension chains that contain the match + * conditions and extensions to execute. Match conditions for each extension + * chain are evaluated in sequence for a given request. The first extension + * chain that has a condition that matches the request is executed. + * Any subsequent extension chains do not execute. + * Limited to 5 extension chains per resource. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ExtensionChain extension_chains = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\NetworkServices\V1\ExtensionChain>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtensionChains($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\ExtensionChain::class); + $this->extension_chains = $arr; + + return $this; + } + + /** + * Required. All backend services and forwarding rules referenced by this + * extension must share the same load balancing scheme. Supported values: + * `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more information, refer to + * [Choosing a load + * balancer](https://cloud.google.com/load-balancing/docs/backend-service). + * + * Generated from protobuf field .google.cloud.networkservices.v1.LoadBalancingScheme load_balancing_scheme = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getLoadBalancingScheme() + { + return $this->load_balancing_scheme; + } + + /** + * Required. All backend services and forwarding rules referenced by this + * extension must share the same load balancing scheme. Supported values: + * `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more information, refer to + * [Choosing a load + * balancer](https://cloud.google.com/load-balancing/docs/backend-service). + * + * Generated from protobuf field .google.cloud.networkservices.v1.LoadBalancingScheme load_balancing_scheme = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setLoadBalancingScheme($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\LoadBalancingScheme::class); + $this->load_balancing_scheme = $var; + + return $this; + } + + /** + * Optional. The metadata provided here is included as part of the + * `metadata_context` (of type `google.protobuf.Struct`) in the + * `ProcessingRequest` message sent to the extension + * server. The metadata is available under the namespace + * `com.google.lb_route_extension.`. + * The following variables are supported in the metadata Struct: + * `{forwarding_rule_id}` - substituted with the forwarding rule's fully + * qualified resource name. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Optional. The metadata provided here is included as part of the + * `metadata_context` (of type `google.protobuf.Struct`) in the + * `ProcessingRequest` message sent to the extension + * server. The metadata is available under the namespace + * `com.google.lb_route_extension.`. + * The following variables are supported in the metadata Struct: + * `{forwarding_rule_id}` - substituted with the forwarding rule's fully + * qualified resource name. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/LbTrafficExtension.php b/NetworkServices/src/V1/LbTrafficExtension.php new file mode 100644 index 000000000000..250a492185ab --- /dev/null +++ b/NetworkServices/src/V1/LbTrafficExtension.php @@ -0,0 +1,460 @@ +google.cloud.networkservices.v1.LbTrafficExtension + */ +class LbTrafficExtension extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Identifier. Name of the `LbTrafficExtension` resource in the + * following format: + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. A human-readable description of the resource. + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Set of labels associated with the `LbTrafficExtension` resource. + * The format must comply with [the requirements for + * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements) + * for Google Cloud resources. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. A list of references to the forwarding rules to which this + * service extension is attached to. At least one forwarding rule is required. + * There can be only one `LBTrafficExtension` resource per forwarding rule. + * + * Generated from protobuf field repeated string forwarding_rules = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + private $forwarding_rules; + /** + * Required. A set of ordered extension chains that contain the match + * conditions and extensions to execute. Match conditions for each extension + * chain are evaluated in sequence for a given request. The first extension + * chain that has a condition that matches the request is executed. + * Any subsequent extension chains do not execute. + * Limited to 5 extension chains per resource. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ExtensionChain extension_chains = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + private $extension_chains; + /** + * Required. All backend services and forwarding rules referenced by this + * extension must share the same load balancing scheme. Supported values: + * `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more information, refer to + * [Choosing a load + * balancer](https://cloud.google.com/load-balancing/docs/backend-service). + * + * Generated from protobuf field .google.cloud.networkservices.v1.LoadBalancingScheme load_balancing_scheme = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $load_balancing_scheme = 0; + /** + * Optional. The metadata provided here is included in the + * `ProcessingRequest.metadata_context.filter_metadata` map field. The + * metadata is available under the key + * `com.google.lb_traffic_extension.`. + * The following variables are supported in the metadata: + * `{forwarding_rule_id}` - substituted with the forwarding rule's fully + * qualified resource name. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Identifier. Name of the `LbTrafficExtension` resource in the + * following format: + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type string $description + * Optional. A human-readable description of the resource. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Set of labels associated with the `LbTrafficExtension` resource. + * The format must comply with [the requirements for + * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements) + * for Google Cloud resources. + * @type array|\Google\Protobuf\Internal\RepeatedField $forwarding_rules + * Required. A list of references to the forwarding rules to which this + * service extension is attached to. At least one forwarding rule is required. + * There can be only one `LBTrafficExtension` resource per forwarding rule. + * @type array<\Google\Cloud\NetworkServices\V1\ExtensionChain>|\Google\Protobuf\Internal\RepeatedField $extension_chains + * Required. A set of ordered extension chains that contain the match + * conditions and extensions to execute. Match conditions for each extension + * chain are evaluated in sequence for a given request. The first extension + * chain that has a condition that matches the request is executed. + * Any subsequent extension chains do not execute. + * Limited to 5 extension chains per resource. + * @type int $load_balancing_scheme + * Required. All backend services and forwarding rules referenced by this + * extension must share the same load balancing scheme. Supported values: + * `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more information, refer to + * [Choosing a load + * balancer](https://cloud.google.com/load-balancing/docs/backend-service). + * @type \Google\Protobuf\Struct $metadata + * Optional. The metadata provided here is included in the + * `ProcessingRequest.metadata_context.filter_metadata` map field. The + * metadata is available under the key + * `com.google.lb_traffic_extension.`. + * The following variables are supported in the metadata: + * `{forwarding_rule_id}` - substituted with the forwarding rule's fully + * qualified resource name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. Identifier. Name of the `LbTrafficExtension` resource in the + * following format: + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Identifier. Name of the `LbTrafficExtension` resource in the + * following format: + * `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. A human-readable description of the resource. + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A human-readable description of the resource. + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Set of labels associated with the `LbTrafficExtension` resource. + * The format must comply with [the requirements for + * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements) + * for Google Cloud resources. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Set of labels associated with the `LbTrafficExtension` resource. + * The format must comply with [the requirements for + * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements) + * for Google Cloud resources. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. A list of references to the forwarding rules to which this + * service extension is attached to. At least one forwarding rule is required. + * There can be only one `LBTrafficExtension` resource per forwarding rule. + * + * Generated from protobuf field repeated string forwarding_rules = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getForwardingRules() + { + return $this->forwarding_rules; + } + + /** + * Required. A list of references to the forwarding rules to which this + * service extension is attached to. At least one forwarding rule is required. + * There can be only one `LBTrafficExtension` resource per forwarding rule. + * + * Generated from protobuf field repeated string forwarding_rules = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setForwardingRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->forwarding_rules = $arr; + + return $this; + } + + /** + * Required. A set of ordered extension chains that contain the match + * conditions and extensions to execute. Match conditions for each extension + * chain are evaluated in sequence for a given request. The first extension + * chain that has a condition that matches the request is executed. + * Any subsequent extension chains do not execute. + * Limited to 5 extension chains per resource. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ExtensionChain extension_chains = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtensionChains() + { + return $this->extension_chains; + } + + /** + * Required. A set of ordered extension chains that contain the match + * conditions and extensions to execute. Match conditions for each extension + * chain are evaluated in sequence for a given request. The first extension + * chain that has a condition that matches the request is executed. + * Any subsequent extension chains do not execute. + * Limited to 5 extension chains per resource. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ExtensionChain extension_chains = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\NetworkServices\V1\ExtensionChain>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtensionChains($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\ExtensionChain::class); + $this->extension_chains = $arr; + + return $this; + } + + /** + * Required. All backend services and forwarding rules referenced by this + * extension must share the same load balancing scheme. Supported values: + * `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more information, refer to + * [Choosing a load + * balancer](https://cloud.google.com/load-balancing/docs/backend-service). + * + * Generated from protobuf field .google.cloud.networkservices.v1.LoadBalancingScheme load_balancing_scheme = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getLoadBalancingScheme() + { + return $this->load_balancing_scheme; + } + + /** + * Required. All backend services and forwarding rules referenced by this + * extension must share the same load balancing scheme. Supported values: + * `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more information, refer to + * [Choosing a load + * balancer](https://cloud.google.com/load-balancing/docs/backend-service). + * + * Generated from protobuf field .google.cloud.networkservices.v1.LoadBalancingScheme load_balancing_scheme = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setLoadBalancingScheme($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\LoadBalancingScheme::class); + $this->load_balancing_scheme = $var; + + return $this; + } + + /** + * Optional. The metadata provided here is included in the + * `ProcessingRequest.metadata_context.filter_metadata` map field. The + * metadata is available under the key + * `com.google.lb_traffic_extension.`. + * The following variables are supported in the metadata: + * `{forwarding_rule_id}` - substituted with the forwarding rule's fully + * qualified resource name. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Optional. The metadata provided here is included in the + * `ProcessingRequest.metadata_context.filter_metadata` map field. The + * metadata is available under the key + * `com.google.lb_traffic_extension.`. + * The following variables are supported in the metadata: + * `{forwarding_rule_id}` - substituted with the forwarding rule's fully + * qualified resource name. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListEndpointPoliciesRequest.php b/NetworkServices/src/V1/ListEndpointPoliciesRequest.php new file mode 100644 index 000000000000..21810b6aea0d --- /dev/null +++ b/NetworkServices/src/V1/ListEndpointPoliciesRequest.php @@ -0,0 +1,151 @@ +google.cloud.networkservices.v1.ListEndpointPoliciesRequest + */ +class ListEndpointPoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the EndpointPolicies should + * be listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of EndpointPolicies to return per call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the EndpointPolicies should + * be listed, specified in the format `projects/*/locations/global`. + * @type int $page_size + * Maximum number of EndpointPolicies to return per call. + * @type string $page_token + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\EndpointPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the EndpointPolicies should + * be listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the EndpointPolicies should + * be listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of EndpointPolicies to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of EndpointPolicies to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListEndpointPoliciesResponse.php b/NetworkServices/src/V1/ListEndpointPoliciesResponse.php new file mode 100644 index 000000000000..05c64b8047f8 --- /dev/null +++ b/NetworkServices/src/V1/ListEndpointPoliciesResponse.php @@ -0,0 +1,109 @@ +google.cloud.networkservices.v1.ListEndpointPoliciesResponse + */ +class ListEndpointPoliciesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of EndpointPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.EndpointPolicy endpoint_policies = 1; + */ + private $endpoint_policies; + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\EndpointPolicy>|\Google\Protobuf\Internal\RepeatedField $endpoint_policies + * List of EndpointPolicy resources. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\EndpointPolicy::initOnce(); + parent::__construct($data); + } + + /** + * List of EndpointPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.EndpointPolicy endpoint_policies = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndpointPolicies() + { + return $this->endpoint_policies; + } + + /** + * List of EndpointPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.EndpointPolicy endpoint_policies = 1; + * @param array<\Google\Cloud\NetworkServices\V1\EndpointPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndpointPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\EndpointPolicy::class); + $this->endpoint_policies = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListGatewaysRequest.php b/NetworkServices/src/V1/ListGatewaysRequest.php new file mode 100644 index 000000000000..392d1e12e611 --- /dev/null +++ b/NetworkServices/src/V1/ListGatewaysRequest.php @@ -0,0 +1,147 @@ +google.cloud.networkservices.v1.ListGatewaysRequest + */ +class ListGatewaysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the Gateways should be + * listed, specified in the format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Gateways to return per call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The value returned by the last `ListGatewaysResponse` + * Indicates that this is a continuation of a prior `ListGateways` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the Gateways should be + * listed, specified in the format `projects/*/locations/*`. + * @type int $page_size + * Maximum number of Gateways to return per call. + * @type string $page_token + * The value returned by the last `ListGatewaysResponse` + * Indicates that this is a continuation of a prior `ListGateways` call, + * and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Gateway::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the Gateways should be + * listed, specified in the format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the Gateways should be + * listed, specified in the format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of Gateways to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Gateways to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value returned by the last `ListGatewaysResponse` + * Indicates that this is a continuation of a prior `ListGateways` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value returned by the last `ListGatewaysResponse` + * Indicates that this is a continuation of a prior `ListGateways` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListGatewaysResponse.php b/NetworkServices/src/V1/ListGatewaysResponse.php new file mode 100644 index 000000000000..4e2ad9ad2a55 --- /dev/null +++ b/NetworkServices/src/V1/ListGatewaysResponse.php @@ -0,0 +1,109 @@ +google.cloud.networkservices.v1.ListGatewaysResponse + */ +class ListGatewaysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of Gateway resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.Gateway gateways = 1; + */ + private $gateways; + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\Gateway>|\Google\Protobuf\Internal\RepeatedField $gateways + * List of Gateway resources. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Gateway::initOnce(); + parent::__construct($data); + } + + /** + * List of Gateway resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.Gateway gateways = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGateways() + { + return $this->gateways; + } + + /** + * List of Gateway resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.Gateway gateways = 1; + * @param array<\Google\Cloud\NetworkServices\V1\Gateway>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGateways($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\Gateway::class); + $this->gateways = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListGrpcRoutesRequest.php b/NetworkServices/src/V1/ListGrpcRoutesRequest.php new file mode 100644 index 000000000000..2e87d06f1647 --- /dev/null +++ b/NetworkServices/src/V1/ListGrpcRoutesRequest.php @@ -0,0 +1,147 @@ +google.cloud.networkservices.v1.ListGrpcRoutesRequest + */ +class ListGrpcRoutesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the GrpcRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of GrpcRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The value returned by the last `ListGrpcRoutesResponse` + * Indicates that this is a continuation of a prior `ListGrpcRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the GrpcRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * @type int $page_size + * Maximum number of GrpcRoutes to return per call. + * @type string $page_token + * The value returned by the last `ListGrpcRoutesResponse` + * Indicates that this is a continuation of a prior `ListGrpcRoutes` call, + * and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the GrpcRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the GrpcRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of GrpcRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of GrpcRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value returned by the last `ListGrpcRoutesResponse` + * Indicates that this is a continuation of a prior `ListGrpcRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value returned by the last `ListGrpcRoutesResponse` + * Indicates that this is a continuation of a prior `ListGrpcRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListGrpcRoutesResponse.php b/NetworkServices/src/V1/ListGrpcRoutesResponse.php new file mode 100644 index 000000000000..25ae1ebe88f6 --- /dev/null +++ b/NetworkServices/src/V1/ListGrpcRoutesResponse.php @@ -0,0 +1,109 @@ +google.cloud.networkservices.v1.ListGrpcRoutesResponse + */ +class ListGrpcRoutesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of GrpcRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute grpc_routes = 1; + */ + private $grpc_routes; + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\GrpcRoute>|\Google\Protobuf\Internal\RepeatedField $grpc_routes + * List of GrpcRoute resources. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * List of GrpcRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute grpc_routes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGrpcRoutes() + { + return $this->grpc_routes; + } + + /** + * List of GrpcRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.GrpcRoute grpc_routes = 1; + * @param array<\Google\Cloud\NetworkServices\V1\GrpcRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGrpcRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\GrpcRoute::class); + $this->grpc_routes = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListHttpRoutesRequest.php b/NetworkServices/src/V1/ListHttpRoutesRequest.php new file mode 100644 index 000000000000..c4373e5845c5 --- /dev/null +++ b/NetworkServices/src/V1/ListHttpRoutesRequest.php @@ -0,0 +1,147 @@ +google.cloud.networkservices.v1.ListHttpRoutesRequest + */ +class ListHttpRoutesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the HttpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of HttpRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The value returned by the last `ListHttpRoutesResponse` + * Indicates that this is a continuation of a prior `ListHttpRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the HttpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * @type int $page_size + * Maximum number of HttpRoutes to return per call. + * @type string $page_token + * The value returned by the last `ListHttpRoutesResponse` + * Indicates that this is a continuation of a prior `ListHttpRoutes` call, + * and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the HttpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the HttpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of HttpRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of HttpRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value returned by the last `ListHttpRoutesResponse` + * Indicates that this is a continuation of a prior `ListHttpRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value returned by the last `ListHttpRoutesResponse` + * Indicates that this is a continuation of a prior `ListHttpRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListHttpRoutesResponse.php b/NetworkServices/src/V1/ListHttpRoutesResponse.php new file mode 100644 index 000000000000..121684e24a3e --- /dev/null +++ b/NetworkServices/src/V1/ListHttpRoutesResponse.php @@ -0,0 +1,109 @@ +google.cloud.networkservices.v1.ListHttpRoutesResponse + */ +class ListHttpRoutesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of HttpRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute http_routes = 1; + */ + private $http_routes; + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\HttpRoute>|\Google\Protobuf\Internal\RepeatedField $http_routes + * List of HttpRoute resources. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * List of HttpRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute http_routes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHttpRoutes() + { + return $this->http_routes; + } + + /** + * List of HttpRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.HttpRoute http_routes = 1; + * @param array<\Google\Cloud\NetworkServices\V1\HttpRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHttpRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\HttpRoute::class); + $this->http_routes = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListLbRouteExtensionsRequest.php b/NetworkServices/src/V1/ListLbRouteExtensionsRequest.php new file mode 100644 index 000000000000..f9ecef198259 --- /dev/null +++ b/NetworkServices/src/V1/ListLbRouteExtensionsRequest.php @@ -0,0 +1,215 @@ +google.cloud.networkservices.v1.ListLbRouteExtensionsRequest + */ +class ListLbRouteExtensionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the `LbRouteExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results that the server returns. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the `LbRouteExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * @type int $page_size + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results that the server returns. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the `LbRouteExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the `LbRouteExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results that the server returns. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results that the server returns. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListLbRouteExtensionsResponse.php b/NetworkServices/src/V1/ListLbRouteExtensionsResponse.php new file mode 100644 index 000000000000..eefc0f3e2d60 --- /dev/null +++ b/NetworkServices/src/V1/ListLbRouteExtensionsResponse.php @@ -0,0 +1,135 @@ +google.cloud.networkservices.v1.ListLbRouteExtensionsResponse + */ +class ListLbRouteExtensionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of `LbRouteExtension` resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.LbRouteExtension lb_route_extensions = 1; + */ + private $lb_route_extensions; + /** + * A token identifying a page of results that the server returns. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\LbRouteExtension>|\Google\Protobuf\Internal\RepeatedField $lb_route_extensions + * The list of `LbRouteExtension` resources. + * @type string $next_page_token + * A token identifying a page of results that the server returns. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * The list of `LbRouteExtension` resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.LbRouteExtension lb_route_extensions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLbRouteExtensions() + { + return $this->lb_route_extensions; + } + + /** + * The list of `LbRouteExtension` resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.LbRouteExtension lb_route_extensions = 1; + * @param array<\Google\Cloud\NetworkServices\V1\LbRouteExtension>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLbRouteExtensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\LbRouteExtension::class); + $this->lb_route_extensions = $arr; + + return $this; + } + + /** + * A token identifying a page of results that the server returns. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results that the server returns. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListLbTrafficExtensionsRequest.php b/NetworkServices/src/V1/ListLbTrafficExtensionsRequest.php new file mode 100644 index 000000000000..23db243c4023 --- /dev/null +++ b/NetworkServices/src/V1/ListLbTrafficExtensionsRequest.php @@ -0,0 +1,215 @@ +google.cloud.networkservices.v1.ListLbTrafficExtensionsRequest + */ +class ListLbTrafficExtensionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the `LbTrafficExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results that the server returns. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the `LbTrafficExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * @type int $page_size + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results that the server returns. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the `LbTrafficExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the `LbTrafficExtension` + * resources are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results that the server returns. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results that the server returns. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListLbTrafficExtensionsResponse.php b/NetworkServices/src/V1/ListLbTrafficExtensionsResponse.php new file mode 100644 index 000000000000..f87a63f11b09 --- /dev/null +++ b/NetworkServices/src/V1/ListLbTrafficExtensionsResponse.php @@ -0,0 +1,135 @@ +google.cloud.networkservices.v1.ListLbTrafficExtensionsResponse + */ +class ListLbTrafficExtensionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of `LbTrafficExtension` resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.LbTrafficExtension lb_traffic_extensions = 1; + */ + private $lb_traffic_extensions; + /** + * A token identifying a page of results that the server returns. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\LbTrafficExtension>|\Google\Protobuf\Internal\RepeatedField $lb_traffic_extensions + * The list of `LbTrafficExtension` resources. + * @type string $next_page_token + * A token identifying a page of results that the server returns. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * The list of `LbTrafficExtension` resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.LbTrafficExtension lb_traffic_extensions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLbTrafficExtensions() + { + return $this->lb_traffic_extensions; + } + + /** + * The list of `LbTrafficExtension` resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.LbTrafficExtension lb_traffic_extensions = 1; + * @param array<\Google\Cloud\NetworkServices\V1\LbTrafficExtension>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLbTrafficExtensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\LbTrafficExtension::class); + $this->lb_traffic_extensions = $arr; + + return $this; + } + + /** + * A token identifying a page of results that the server returns. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results that the server returns. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListMeshesRequest.php b/NetworkServices/src/V1/ListMeshesRequest.php new file mode 100644 index 000000000000..a68f0aad5fab --- /dev/null +++ b/NetworkServices/src/V1/ListMeshesRequest.php @@ -0,0 +1,147 @@ +google.cloud.networkservices.v1.ListMeshesRequest + */ +class ListMeshesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the Meshes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Meshes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The value returned by the last `ListMeshesResponse` + * Indicates that this is a continuation of a prior `ListMeshes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the Meshes should be + * listed, specified in the format `projects/*/locations/global`. + * @type int $page_size + * Maximum number of Meshes to return per call. + * @type string $page_token + * The value returned by the last `ListMeshesResponse` + * Indicates that this is a continuation of a prior `ListMeshes` call, + * and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Mesh::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the Meshes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the Meshes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of Meshes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Meshes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value returned by the last `ListMeshesResponse` + * Indicates that this is a continuation of a prior `ListMeshes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value returned by the last `ListMeshesResponse` + * Indicates that this is a continuation of a prior `ListMeshes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListMeshesResponse.php b/NetworkServices/src/V1/ListMeshesResponse.php new file mode 100644 index 000000000000..4fc4bf9fd178 --- /dev/null +++ b/NetworkServices/src/V1/ListMeshesResponse.php @@ -0,0 +1,109 @@ +google.cloud.networkservices.v1.ListMeshesResponse + */ +class ListMeshesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of Mesh resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.Mesh meshes = 1; + */ + private $meshes; + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\Mesh>|\Google\Protobuf\Internal\RepeatedField $meshes + * List of Mesh resources. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Mesh::initOnce(); + parent::__construct($data); + } + + /** + * List of Mesh resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.Mesh meshes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMeshes() + { + return $this->meshes; + } + + /** + * List of Mesh resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.Mesh meshes = 1; + * @param array<\Google\Cloud\NetworkServices\V1\Mesh>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMeshes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\Mesh::class); + $this->meshes = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListServiceBindingsRequest.php b/NetworkServices/src/V1/ListServiceBindingsRequest.php new file mode 100644 index 000000000000..de4c7e3221de --- /dev/null +++ b/NetworkServices/src/V1/ListServiceBindingsRequest.php @@ -0,0 +1,147 @@ +google.cloud.networkservices.v1.ListServiceBindingsRequest + */ +class ListServiceBindingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the ServiceBindings should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of ServiceBindings to return per call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The value returned by the last `ListServiceBindingsResponse` + * Indicates that this is a continuation of a prior `ListRouters` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the ServiceBindings should be + * listed, specified in the format `projects/*/locations/global`. + * @type int $page_size + * Maximum number of ServiceBindings to return per call. + * @type string $page_token + * The value returned by the last `ListServiceBindingsResponse` + * Indicates that this is a continuation of a prior `ListRouters` call, + * and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\ServiceBinding::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the ServiceBindings should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the ServiceBindings should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of ServiceBindings to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of ServiceBindings to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value returned by the last `ListServiceBindingsResponse` + * Indicates that this is a continuation of a prior `ListRouters` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value returned by the last `ListServiceBindingsResponse` + * Indicates that this is a continuation of a prior `ListRouters` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListServiceBindingsResponse.php b/NetworkServices/src/V1/ListServiceBindingsResponse.php new file mode 100644 index 000000000000..e1ebc8bef520 --- /dev/null +++ b/NetworkServices/src/V1/ListServiceBindingsResponse.php @@ -0,0 +1,109 @@ +google.cloud.networkservices.v1.ListServiceBindingsResponse + */ +class ListServiceBindingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of ServiceBinding resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ServiceBinding service_bindings = 1; + */ + private $service_bindings; + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\ServiceBinding>|\Google\Protobuf\Internal\RepeatedField $service_bindings + * List of ServiceBinding resources. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\ServiceBinding::initOnce(); + parent::__construct($data); + } + + /** + * List of ServiceBinding resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ServiceBinding service_bindings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceBindings() + { + return $this->service_bindings; + } + + /** + * List of ServiceBinding resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.ServiceBinding service_bindings = 1; + * @param array<\Google\Cloud\NetworkServices\V1\ServiceBinding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\ServiceBinding::class); + $this->service_bindings = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListTcpRoutesRequest.php b/NetworkServices/src/V1/ListTcpRoutesRequest.php new file mode 100644 index 000000000000..703c0941b27a --- /dev/null +++ b/NetworkServices/src/V1/ListTcpRoutesRequest.php @@ -0,0 +1,147 @@ +google.cloud.networkservices.v1.ListTcpRoutesRequest + */ +class ListTcpRoutesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the TcpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of TcpRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The value returned by the last `ListTcpRoutesResponse` + * Indicates that this is a continuation of a prior `ListTcpRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the TcpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * @type int $page_size + * Maximum number of TcpRoutes to return per call. + * @type string $page_token + * The value returned by the last `ListTcpRoutesResponse` + * Indicates that this is a continuation of a prior `ListTcpRoutes` call, + * and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the TcpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the TcpRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of TcpRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of TcpRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value returned by the last `ListTcpRoutesResponse` + * Indicates that this is a continuation of a prior `ListTcpRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value returned by the last `ListTcpRoutesResponse` + * Indicates that this is a continuation of a prior `ListTcpRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListTcpRoutesResponse.php b/NetworkServices/src/V1/ListTcpRoutesResponse.php new file mode 100644 index 000000000000..ed511f17c5f4 --- /dev/null +++ b/NetworkServices/src/V1/ListTcpRoutesResponse.php @@ -0,0 +1,109 @@ +google.cloud.networkservices.v1.ListTcpRoutesResponse + */ +class ListTcpRoutesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of TcpRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute tcp_routes = 1; + */ + private $tcp_routes; + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\TcpRoute>|\Google\Protobuf\Internal\RepeatedField $tcp_routes + * List of TcpRoute resources. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * List of TcpRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute tcp_routes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTcpRoutes() + { + return $this->tcp_routes; + } + + /** + * List of TcpRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute tcp_routes = 1; + * @param array<\Google\Cloud\NetworkServices\V1\TcpRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTcpRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\TcpRoute::class); + $this->tcp_routes = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListTlsRoutesRequest.php b/NetworkServices/src/V1/ListTlsRoutesRequest.php new file mode 100644 index 000000000000..1afc22c3f5fd --- /dev/null +++ b/NetworkServices/src/V1/ListTlsRoutesRequest.php @@ -0,0 +1,147 @@ +google.cloud.networkservices.v1.ListTlsRoutesRequest + */ +class ListTlsRoutesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location from which the TlsRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of TlsRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The value returned by the last `ListTlsRoutesResponse` + * Indicates that this is a continuation of a prior `ListTlsRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location from which the TlsRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * @type int $page_size + * Maximum number of TlsRoutes to return per call. + * @type string $page_token + * The value returned by the last `ListTlsRoutesResponse` + * Indicates that this is a continuation of a prior `ListTlsRoutes` call, + * and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location from which the TlsRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location from which the TlsRoutes should be + * listed, specified in the format `projects/*/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of TlsRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of TlsRoutes to return per call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value returned by the last `ListTlsRoutesResponse` + * Indicates that this is a continuation of a prior `ListTlsRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value returned by the last `ListTlsRoutesResponse` + * Indicates that this is a continuation of a prior `ListTlsRoutes` call, + * and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ListTlsRoutesResponse.php b/NetworkServices/src/V1/ListTlsRoutesResponse.php new file mode 100644 index 000000000000..baf951142c4e --- /dev/null +++ b/NetworkServices/src/V1/ListTlsRoutesResponse.php @@ -0,0 +1,109 @@ +google.cloud.networkservices.v1.ListTlsRoutesResponse + */ +class ListTlsRoutesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of TlsRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute tls_routes = 1; + */ + private $tls_routes; + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\TlsRoute>|\Google\Protobuf\Internal\RepeatedField $tls_routes + * List of TlsRoute resources. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * List of TlsRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute tls_routes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTlsRoutes() + { + return $this->tls_routes; + } + + /** + * List of TlsRoute resources. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute tls_routes = 1; + * @param array<\Google\Cloud\NetworkServices\V1\TlsRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTlsRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\TlsRoute::class); + $this->tls_routes = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `next_page_token` is included. To get the next set of results, call this + * method again using the value of `next_page_token` as `page_token`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/LoadBalancingScheme.php b/NetworkServices/src/V1/LoadBalancingScheme.php new file mode 100644 index 000000000000..263ab38300d8 --- /dev/null +++ b/NetworkServices/src/V1/LoadBalancingScheme.php @@ -0,0 +1,65 @@ +google.cloud.networkservices.v1.LoadBalancingScheme + */ +class LoadBalancingScheme +{ + /** + * Default value. Do not use. + * + * Generated from protobuf enum LOAD_BALANCING_SCHEME_UNSPECIFIED = 0; + */ + const LOAD_BALANCING_SCHEME_UNSPECIFIED = 0; + /** + * Signifies that this is used for Internal HTTP(S) Load Balancing. + * + * Generated from protobuf enum INTERNAL_MANAGED = 1; + */ + const INTERNAL_MANAGED = 1; + /** + * Signifies that this is used for External Managed HTTP(S) Load + * Balancing. + * + * Generated from protobuf enum EXTERNAL_MANAGED = 2; + */ + const EXTERNAL_MANAGED = 2; + + private static $valueToName = [ + self::LOAD_BALANCING_SCHEME_UNSPECIFIED => 'LOAD_BALANCING_SCHEME_UNSPECIFIED', + self::INTERNAL_MANAGED => 'INTERNAL_MANAGED', + self::EXTERNAL_MANAGED => 'EXTERNAL_MANAGED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/NetworkServices/src/V1/Mesh.php b/NetworkServices/src/V1/Mesh.php new file mode 100644 index 000000000000..14d967fcf671 --- /dev/null +++ b/NetworkServices/src/V1/Mesh.php @@ -0,0 +1,321 @@ +google.cloud.networkservices.v1.Mesh + */ +class Mesh extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the Mesh resource. It matches pattern + * `projects/*/locations/global/meshes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $self_link = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Set of label tags associated with the Mesh resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. If set to a valid TCP port (1-65535), instructs the SIDECAR proxy + * to listen on the specified port of localhost (127.0.0.1) address. The + * SIDECAR proxy will expect all traffic to be redirected to this port + * regardless of its actual ip:port destination. If unset, a port '15001' is + * used as the interception port. This is applicable only for sidecar proxy + * deployments. + * + * Generated from protobuf field int32 interception_port = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $interception_port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the Mesh resource. It matches pattern + * `projects/*/locations/global/meshes/`. + * @type string $self_link + * Output only. Server-defined URL of this resource + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Set of label tags associated with the Mesh resource. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type int $interception_port + * Optional. If set to a valid TCP port (1-65535), instructs the SIDECAR proxy + * to listen on the specified port of localhost (127.0.0.1) address. The + * SIDECAR proxy will expect all traffic to be redirected to this port + * regardless of its actual ip:port destination. If unset, a port '15001' is + * used as the interception port. This is applicable only for sidecar proxy + * deployments. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Mesh::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the Mesh resource. It matches pattern + * `projects/*/locations/global/meshes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the Mesh resource. It matches pattern + * `projects/*/locations/global/meshes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSelfLink() + { + return $this->self_link; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSelfLink($var) + { + GPBUtil::checkString($var, True); + $this->self_link = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Set of label tags associated with the Mesh resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Set of label tags associated with the Mesh resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. If set to a valid TCP port (1-65535), instructs the SIDECAR proxy + * to listen on the specified port of localhost (127.0.0.1) address. The + * SIDECAR proxy will expect all traffic to be redirected to this port + * regardless of its actual ip:port destination. If unset, a port '15001' is + * used as the interception port. This is applicable only for sidecar proxy + * deployments. + * + * Generated from protobuf field int32 interception_port = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInterceptionPort() + { + return $this->interception_port; + } + + /** + * Optional. If set to a valid TCP port (1-65535), instructs the SIDECAR proxy + * to listen on the specified port of localhost (127.0.0.1) address. The + * SIDECAR proxy will expect all traffic to be redirected to this port + * regardless of its actual ip:port destination. If unset, a port '15001' is + * used as the interception port. This is applicable only for sidecar proxy + * deployments. + * + * Generated from protobuf field int32 interception_port = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInterceptionPort($var) + { + GPBUtil::checkInt32($var); + $this->interception_port = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/NetworkServicesClient.php b/NetworkServices/src/V1/NetworkServicesClient.php new file mode 100644 index 000000000000..d5820d488650 --- /dev/null +++ b/NetworkServices/src/V1/NetworkServicesClient.php @@ -0,0 +1,34 @@ +google.cloud.networkservices.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/ServiceBinding.php b/NetworkServices/src/V1/ServiceBinding.php new file mode 100644 index 000000000000..93e657a35992 --- /dev/null +++ b/NetworkServices/src/V1/ServiceBinding.php @@ -0,0 +1,270 @@ +google.cloud.networkservices.v1.ServiceBinding + */ +class ServiceBinding extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the ServiceBinding resource. It matches pattern + * `projects/*/locations/global/serviceBindings/service_binding_name`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. The full service directory service name of the format + * /projects/*/locations/*/namespaces/*/services/* + * + * Generated from protobuf field string service = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = ''; + /** + * Optional. Set of label tags associated with the ServiceBinding resource. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the ServiceBinding resource. It matches pattern + * `projects/*/locations/global/serviceBindings/service_binding_name`. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type string $service + * Required. The full service directory service name of the format + * /projects/*/locations/*/namespaces/*/services/* + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Set of label tags associated with the ServiceBinding resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\ServiceBinding::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the ServiceBinding resource. It matches pattern + * `projects/*/locations/global/serviceBindings/service_binding_name`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the ServiceBinding resource. It matches pattern + * `projects/*/locations/global/serviceBindings/service_binding_name`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. The full service directory service name of the format + * /projects/*/locations/*/namespaces/*/services/* + * + * Generated from protobuf field string service = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Required. The full service directory service name of the format + * /projects/*/locations/*/namespaces/*/services/* + * + * Generated from protobuf field string service = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * Optional. Set of label tags associated with the ServiceBinding resource. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Set of label tags associated with the ServiceBinding resource. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/TcpRoute.php b/NetworkServices/src/V1/TcpRoute.php new file mode 100644 index 000000000000..00624114cb2f --- /dev/null +++ b/NetworkServices/src/V1/TcpRoute.php @@ -0,0 +1,404 @@ +google.cloud.networkservices.v1.TcpRoute + */ +class TcpRoute extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the TcpRoute resource. It matches pattern + * `projects/*/locations/global/tcpRoutes/tcp_route_name>`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $self_link = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. Rules that define how traffic is routed and handled. At least one + * RouteRule must be supplied. If there are multiple rules then the action + * taken will be the first rule to match. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute.RouteRule rules = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rules; + /** + * Optional. Meshes defines a list of meshes this TcpRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * + * Generated from protobuf field repeated string meshes = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $meshes; + /** + * Optional. Gateways defines a list of gateways this TcpRoute is attached to, + * as one of the routing rules to route the requests served by the gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $gateways; + /** + * Optional. Set of label tags associated with the TcpRoute resource. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the TcpRoute resource. It matches pattern + * `projects/*/locations/global/tcpRoutes/tcp_route_name>`. + * @type string $self_link + * Output only. Server-defined URL of this resource + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type array<\Google\Cloud\NetworkServices\V1\TcpRoute\RouteRule>|\Google\Protobuf\Internal\RepeatedField $rules + * Required. Rules that define how traffic is routed and handled. At least one + * RouteRule must be supplied. If there are multiple rules then the action + * taken will be the first rule to match. + * @type array|\Google\Protobuf\Internal\RepeatedField $meshes + * Optional. Meshes defines a list of meshes this TcpRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * @type array|\Google\Protobuf\Internal\RepeatedField $gateways + * Optional. Gateways defines a list of gateways this TcpRoute is attached to, + * as one of the routing rules to route the requests served by the gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Set of label tags associated with the TcpRoute resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the TcpRoute resource. It matches pattern + * `projects/*/locations/global/tcpRoutes/tcp_route_name>`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the TcpRoute resource. It matches pattern + * `projects/*/locations/global/tcpRoutes/tcp_route_name>`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSelfLink() + { + return $this->self_link; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSelfLink($var) + { + GPBUtil::checkString($var, True); + $this->self_link = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Required. Rules that define how traffic is routed and handled. At least one + * RouteRule must be supplied. If there are multiple rules then the action + * taken will be the first rule to match. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute.RouteRule rules = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Required. Rules that define how traffic is routed and handled. At least one + * RouteRule must be supplied. If there are multiple rules then the action + * taken will be the first rule to match. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute.RouteRule rules = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\NetworkServices\V1\TcpRoute\RouteRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\TcpRoute\RouteRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * Optional. Meshes defines a list of meshes this TcpRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * + * Generated from protobuf field repeated string meshes = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMeshes() + { + return $this->meshes; + } + + /** + * Optional. Meshes defines a list of meshes this TcpRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * + * Generated from protobuf field repeated string meshes = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMeshes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->meshes = $arr; + + return $this; + } + + /** + * Optional. Gateways defines a list of gateways this TcpRoute is attached to, + * as one of the routing rules to route the requests served by the gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGateways() + { + return $this->gateways; + } + + /** + * Optional. Gateways defines a list of gateways this TcpRoute is attached to, + * as one of the routing rules to route the requests served by the gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGateways($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->gateways = $arr; + + return $this; + } + + /** + * Optional. Set of label tags associated with the TcpRoute resource. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Set of label tags associated with the TcpRoute resource. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/TcpRoute/RouteAction.php b/NetworkServices/src/V1/TcpRoute/RouteAction.php new file mode 100644 index 000000000000..625d6bfaf160 --- /dev/null +++ b/NetworkServices/src/V1/TcpRoute/RouteAction.php @@ -0,0 +1,118 @@ +google.cloud.networkservices.v1.TcpRoute.RouteAction + */ +class RouteAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The destination services to which traffic should be forwarded. + * At least one destination service is required. Only one of route + * destination or original destination can be set. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute.RouteDestination destinations = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $destinations; + /** + * Optional. If true, Router will use the destination IP and port of the + * original connection as the destination of the request. Default is false. + * Only one of route destinations or original destination can be set. + * + * Generated from protobuf field bool original_destination = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $original_destination = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\TcpRoute\RouteDestination>|\Google\Protobuf\Internal\RepeatedField $destinations + * Optional. The destination services to which traffic should be forwarded. + * At least one destination service is required. Only one of route + * destination or original destination can be set. + * @type bool $original_destination + * Optional. If true, Router will use the destination IP and port of the + * original connection as the destination of the request. Default is false. + * Only one of route destinations or original destination can be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The destination services to which traffic should be forwarded. + * At least one destination service is required. Only one of route + * destination or original destination can be set. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute.RouteDestination destinations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestinations() + { + return $this->destinations; + } + + /** + * Optional. The destination services to which traffic should be forwarded. + * At least one destination service is required. Only one of route + * destination or original destination can be set. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute.RouteDestination destinations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\NetworkServices\V1\TcpRoute\RouteDestination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\TcpRoute\RouteDestination::class); + $this->destinations = $arr; + + return $this; + } + + /** + * Optional. If true, Router will use the destination IP and port of the + * original connection as the destination of the request. Default is false. + * Only one of route destinations or original destination can be set. + * + * Generated from protobuf field bool original_destination = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getOriginalDestination() + { + return $this->original_destination; + } + + /** + * Optional. If true, Router will use the destination IP and port of the + * original connection as the destination of the request. Default is false. + * Only one of route destinations or original destination can be set. + * + * Generated from protobuf field bool original_destination = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setOriginalDestination($var) + { + GPBUtil::checkBool($var); + $this->original_destination = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/TcpRoute/RouteDestination.php b/NetworkServices/src/V1/TcpRoute/RouteDestination.php new file mode 100644 index 000000000000..3d34bad73b25 --- /dev/null +++ b/NetworkServices/src/V1/TcpRoute/RouteDestination.php @@ -0,0 +1,142 @@ +google.cloud.networkservices.v1.TcpRoute.RouteDestination + */ +class RouteDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URL of a BackendService to route traffic to. + * + * Generated from protobuf field string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $service_name = ''; + /** + * Optional. Specifies the proportion of requests forwarded to the backend + * referenced by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * + * Generated from protobuf field int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $weight = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_name + * Required. The URL of a BackendService to route traffic to. + * @type int $weight + * Optional. Specifies the proportion of requests forwarded to the backend + * referenced by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URL of a BackendService to route traffic to. + * + * Generated from protobuf field string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceName() + { + return $this->service_name; + } + + /** + * Required. The URL of a BackendService to route traffic to. + * + * Generated from protobuf field string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceName($var) + { + GPBUtil::checkString($var, True); + $this->service_name = $var; + + return $this; + } + + /** + * Optional. Specifies the proportion of requests forwarded to the backend + * referenced by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * + * Generated from protobuf field int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getWeight() + { + return $this->weight; + } + + /** + * Optional. Specifies the proportion of requests forwarded to the backend + * referenced by the serviceName field. This is computed as: + * - weight/Sum(weights in this destination list). + * For non-zero values, there may be some epsilon from the exact proportion + * defined here depending on the precision an implementation supports. + * If only one serviceName is specified and it has a weight greater than 0, + * 100% of the traffic is forwarded to that backend. + * If weights are specified for any one service name, they need to be + * specified for all of them. + * If weights are unspecified for all services, then, traffic is distributed + * in equal proportions to all of them. + * + * Generated from protobuf field int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setWeight($var) + { + GPBUtil::checkInt32($var); + $this->weight = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/TcpRoute/RouteMatch.php b/NetworkServices/src/V1/TcpRoute/RouteMatch.php new file mode 100644 index 000000000000..dcf1ce46d8f5 --- /dev/null +++ b/NetworkServices/src/V1/TcpRoute/RouteMatch.php @@ -0,0 +1,137 @@ +google.cloud.networkservices.v1.TcpRoute.RouteMatch + */ +class RouteMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Must be specified in the CIDR range format. A CIDR range + * consists of an IP Address and a prefix length to construct the subnet + * mask. By default, the prefix length is 32 (i.e. matches a single IP + * address). Only IPV4 addresses are supported. + * Examples: + * "10.0.0.1" - matches against this exact IP address. + * "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet + * and 255.255.255.0 mask. + * "0.0.0.0/0" - matches against any IP address'. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address = ''; + /** + * Required. Specifies the destination port to match against. + * + * Generated from protobuf field string port = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $port = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Required. Must be specified in the CIDR range format. A CIDR range + * consists of an IP Address and a prefix length to construct the subnet + * mask. By default, the prefix length is 32 (i.e. matches a single IP + * address). Only IPV4 addresses are supported. + * Examples: + * "10.0.0.1" - matches against this exact IP address. + * "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet + * and 255.255.255.0 mask. + * "0.0.0.0/0" - matches against any IP address'. + * @type string $port + * Required. Specifies the destination port to match against. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. Must be specified in the CIDR range format. A CIDR range + * consists of an IP Address and a prefix length to construct the subnet + * mask. By default, the prefix length is 32 (i.e. matches a single IP + * address). Only IPV4 addresses are supported. + * Examples: + * "10.0.0.1" - matches against this exact IP address. + * "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet + * and 255.255.255.0 mask. + * "0.0.0.0/0" - matches against any IP address'. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Required. Must be specified in the CIDR range format. A CIDR range + * consists of an IP Address and a prefix length to construct the subnet + * mask. By default, the prefix length is 32 (i.e. matches a single IP + * address). Only IPV4 addresses are supported. + * Examples: + * "10.0.0.1" - matches against this exact IP address. + * "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet + * and 255.255.255.0 mask. + * "0.0.0.0/0" - matches against any IP address'. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Required. Specifies the destination port to match against. + * + * Generated from protobuf field string port = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPort() + { + return $this->port; + } + + /** + * Required. Specifies the destination port to match against. + * + * Generated from protobuf field string port = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkString($var, True); + $this->port = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/TcpRoute/RouteRule.php b/NetworkServices/src/V1/TcpRoute/RouteRule.php new file mode 100644 index 000000000000..93e5aca679ae --- /dev/null +++ b/NetworkServices/src/V1/TcpRoute/RouteRule.php @@ -0,0 +1,125 @@ +google.cloud.networkservices.v1.TcpRoute.RouteRule + */ +class RouteRule extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. RouteMatch defines the predicate used to match requests to a + * given action. Multiple match types are "OR"ed for evaluation. If no + * routeMatch field is specified, this rule will unconditionally match + * traffic. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute.RouteMatch matches = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $matches; + /** + * Required. The detailed rule defining how to route matched traffic. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TcpRoute.RouteAction action = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $action = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\TcpRoute\RouteMatch>|\Google\Protobuf\Internal\RepeatedField $matches + * Optional. RouteMatch defines the predicate used to match requests to a + * given action. Multiple match types are "OR"ed for evaluation. If no + * routeMatch field is specified, this rule will unconditionally match + * traffic. + * @type \Google\Cloud\NetworkServices\V1\TcpRoute\RouteAction $action + * Required. The detailed rule defining how to route matched traffic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. RouteMatch defines the predicate used to match requests to a + * given action. Multiple match types are "OR"ed for evaluation. If no + * routeMatch field is specified, this rule will unconditionally match + * traffic. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute.RouteMatch matches = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMatches() + { + return $this->matches; + } + + /** + * Optional. RouteMatch defines the predicate used to match requests to a + * given action. Multiple match types are "OR"ed for evaluation. If no + * routeMatch field is specified, this rule will unconditionally match + * traffic. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TcpRoute.RouteMatch matches = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\NetworkServices\V1\TcpRoute\RouteMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMatches($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\TcpRoute\RouteMatch::class); + $this->matches = $arr; + + return $this; + } + + /** + * Required. The detailed rule defining how to route matched traffic. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TcpRoute.RouteAction action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\TcpRoute\RouteAction|null + */ + public function getAction() + { + return $this->action; + } + + public function hasAction() + { + return isset($this->action); + } + + public function clearAction() + { + unset($this->action); + } + + /** + * Required. The detailed rule defining how to route matched traffic. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TcpRoute.RouteAction action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\TcpRoute\RouteAction $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\TcpRoute\RouteAction::class); + $this->action = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/TlsRoute.php b/NetworkServices/src/V1/TlsRoute.php new file mode 100644 index 000000000000..9d44cf7d5e26 --- /dev/null +++ b/NetworkServices/src/V1/TlsRoute.php @@ -0,0 +1,370 @@ +google.cloud.networkservices.v1.TlsRoute + */ +class TlsRoute extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the TlsRoute resource. It matches pattern + * `projects/*/locations/global/tlsRoutes/tls_route_name>`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $self_link = ''; + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. Rules that define how traffic is routed and handled. At least one + * RouteRule must be supplied. If there are multiple rules then the action + * taken will be the first rule to match. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute.RouteRule rules = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rules; + /** + * Optional. Meshes defines a list of meshes this TlsRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * + * Generated from protobuf field repeated string meshes = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $meshes; + /** + * Optional. Gateways defines a list of gateways this TlsRoute is attached to, + * as one of the routing rules to route the requests served by the gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $gateways; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the TlsRoute resource. It matches pattern + * `projects/*/locations/global/tlsRoutes/tls_route_name>`. + * @type string $self_link + * Output only. Server-defined URL of this resource + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the resource was updated. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type array<\Google\Cloud\NetworkServices\V1\TlsRoute\RouteRule>|\Google\Protobuf\Internal\RepeatedField $rules + * Required. Rules that define how traffic is routed and handled. At least one + * RouteRule must be supplied. If there are multiple rules then the action + * taken will be the first rule to match. + * @type array|\Google\Protobuf\Internal\RepeatedField $meshes + * Optional. Meshes defines a list of meshes this TlsRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * @type array|\Google\Protobuf\Internal\RepeatedField $gateways + * Optional. Gateways defines a list of gateways this TlsRoute is attached to, + * as one of the routing rules to route the requests served by the gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the TlsRoute resource. It matches pattern + * `projects/*/locations/global/tlsRoutes/tls_route_name>`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the TlsRoute resource. It matches pattern + * `projects/*/locations/global/tlsRoutes/tls_route_name>`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSelfLink() + { + return $this->self_link; + } + + /** + * Output only. Server-defined URL of this resource + * + * Generated from protobuf field string self_link = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSelfLink($var) + { + GPBUtil::checkString($var, True); + $this->self_link = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Required. Rules that define how traffic is routed and handled. At least one + * RouteRule must be supplied. If there are multiple rules then the action + * taken will be the first rule to match. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute.RouteRule rules = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Required. Rules that define how traffic is routed and handled. At least one + * RouteRule must be supplied. If there are multiple rules then the action + * taken will be the first rule to match. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute.RouteRule rules = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\NetworkServices\V1\TlsRoute\RouteRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\TlsRoute\RouteRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * Optional. Meshes defines a list of meshes this TlsRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * + * Generated from protobuf field repeated string meshes = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMeshes() + { + return $this->meshes; + } + + /** + * Optional. Meshes defines a list of meshes this TlsRoute is attached to, as + * one of the routing rules to route the requests served by the mesh. + * Each mesh reference should match the pattern: + * `projects/*/locations/global/meshes/` + * The attached Mesh should be of a type SIDECAR + * + * Generated from protobuf field repeated string meshes = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMeshes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->meshes = $arr; + + return $this; + } + + /** + * Optional. Gateways defines a list of gateways this TlsRoute is attached to, + * as one of the routing rules to route the requests served by the gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGateways() + { + return $this->gateways; + } + + /** + * Optional. Gateways defines a list of gateways this TlsRoute is attached to, + * as one of the routing rules to route the requests served by the gateway. + * Each gateway reference should match the pattern: + * `projects/*/locations/global/gateways/` + * + * Generated from protobuf field repeated string gateways = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGateways($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->gateways = $arr; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/TlsRoute/RouteAction.php b/NetworkServices/src/V1/TlsRoute/RouteAction.php new file mode 100644 index 000000000000..c21d616ff11f --- /dev/null +++ b/NetworkServices/src/V1/TlsRoute/RouteAction.php @@ -0,0 +1,72 @@ +google.cloud.networkservices.v1.TlsRoute.RouteAction + */ +class RouteAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The destination services to which traffic should be forwarded. + * At least one destination service is required. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute.RouteDestination destinations = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $destinations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\TlsRoute\RouteDestination>|\Google\Protobuf\Internal\RepeatedField $destinations + * Required. The destination services to which traffic should be forwarded. + * At least one destination service is required. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The destination services to which traffic should be forwarded. + * At least one destination service is required. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute.RouteDestination destinations = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestinations() + { + return $this->destinations; + } + + /** + * Required. The destination services to which traffic should be forwarded. + * At least one destination service is required. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute.RouteDestination destinations = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\NetworkServices\V1\TlsRoute\RouteDestination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\TlsRoute\RouteDestination::class); + $this->destinations = $arr; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/TlsRoute/RouteDestination.php b/NetworkServices/src/V1/TlsRoute/RouteDestination.php new file mode 100644 index 000000000000..bbf0121a0e41 --- /dev/null +++ b/NetworkServices/src/V1/TlsRoute/RouteDestination.php @@ -0,0 +1,114 @@ +google.cloud.networkservices.v1.TlsRoute.RouteDestination + */ +class RouteDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URL of a BackendService to route traffic to. + * + * Generated from protobuf field string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $service_name = ''; + /** + * Optional. Specifies the proportion of requests forwareded to the backend + * referenced by the service_name field. This is computed as: + * - weight/Sum(weights in destinations) + * Weights in all destinations does not need to sum up to 100. + * + * Generated from protobuf field int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $weight = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_name + * Required. The URL of a BackendService to route traffic to. + * @type int $weight + * Optional. Specifies the proportion of requests forwareded to the backend + * referenced by the service_name field. This is computed as: + * - weight/Sum(weights in destinations) + * Weights in all destinations does not need to sum up to 100. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URL of a BackendService to route traffic to. + * + * Generated from protobuf field string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceName() + { + return $this->service_name; + } + + /** + * Required. The URL of a BackendService to route traffic to. + * + * Generated from protobuf field string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceName($var) + { + GPBUtil::checkString($var, True); + $this->service_name = $var; + + return $this; + } + + /** + * Optional. Specifies the proportion of requests forwareded to the backend + * referenced by the service_name field. This is computed as: + * - weight/Sum(weights in destinations) + * Weights in all destinations does not need to sum up to 100. + * + * Generated from protobuf field int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getWeight() + { + return $this->weight; + } + + /** + * Optional. Specifies the proportion of requests forwareded to the backend + * referenced by the service_name field. This is computed as: + * - weight/Sum(weights in destinations) + * Weights in all destinations does not need to sum up to 100. + * + * Generated from protobuf field int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setWeight($var) + { + GPBUtil::checkInt32($var); + $this->weight = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/TlsRoute/RouteMatch.php b/NetworkServices/src/V1/TlsRoute/RouteMatch.php new file mode 100644 index 000000000000..962f1af263a4 --- /dev/null +++ b/NetworkServices/src/V1/TlsRoute/RouteMatch.php @@ -0,0 +1,145 @@ +google.cloud.networkservices.v1.TlsRoute.RouteMatch + */ +class RouteMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. SNI (server name indicator) to match against. + * SNI will be matched against all wildcard domains, i.e. `www.example.com` + * will be first matched against `www.example.com`, then `*.example.com`, + * then `*.com.` + * Partial wildcards are not supported, and values like *w.example.com are + * invalid. + * At least one of sni_host and alpn is required. + * Up to 5 sni hosts across all matches can be set. + * + * Generated from protobuf field repeated string sni_host = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sni_host; + /** + * Optional. ALPN (Application-Layer Protocol Negotiation) to match against. + * Examples: "http/1.1", "h2". + * At least one of sni_host and alpn is required. + * Up to 5 alpns across all matches can be set. + * + * Generated from protobuf field repeated string alpn = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $alpn; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $sni_host + * Optional. SNI (server name indicator) to match against. + * SNI will be matched against all wildcard domains, i.e. `www.example.com` + * will be first matched against `www.example.com`, then `*.example.com`, + * then `*.com.` + * Partial wildcards are not supported, and values like *w.example.com are + * invalid. + * At least one of sni_host and alpn is required. + * Up to 5 sni hosts across all matches can be set. + * @type array|\Google\Protobuf\Internal\RepeatedField $alpn + * Optional. ALPN (Application-Layer Protocol Negotiation) to match against. + * Examples: "http/1.1", "h2". + * At least one of sni_host and alpn is required. + * Up to 5 alpns across all matches can be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. SNI (server name indicator) to match against. + * SNI will be matched against all wildcard domains, i.e. `www.example.com` + * will be first matched against `www.example.com`, then `*.example.com`, + * then `*.com.` + * Partial wildcards are not supported, and values like *w.example.com are + * invalid. + * At least one of sni_host and alpn is required. + * Up to 5 sni hosts across all matches can be set. + * + * Generated from protobuf field repeated string sni_host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSniHost() + { + return $this->sni_host; + } + + /** + * Optional. SNI (server name indicator) to match against. + * SNI will be matched against all wildcard domains, i.e. `www.example.com` + * will be first matched against `www.example.com`, then `*.example.com`, + * then `*.com.` + * Partial wildcards are not supported, and values like *w.example.com are + * invalid. + * At least one of sni_host and alpn is required. + * Up to 5 sni hosts across all matches can be set. + * + * Generated from protobuf field repeated string sni_host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSniHost($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->sni_host = $arr; + + return $this; + } + + /** + * Optional. ALPN (Application-Layer Protocol Negotiation) to match against. + * Examples: "http/1.1", "h2". + * At least one of sni_host and alpn is required. + * Up to 5 alpns across all matches can be set. + * + * Generated from protobuf field repeated string alpn = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAlpn() + { + return $this->alpn; + } + + /** + * Optional. ALPN (Application-Layer Protocol Negotiation) to match against. + * Examples: "http/1.1", "h2". + * At least one of sni_host and alpn is required. + * Up to 5 alpns across all matches can be set. + * + * Generated from protobuf field repeated string alpn = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAlpn($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->alpn = $arr; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/TlsRoute/RouteRule.php b/NetworkServices/src/V1/TlsRoute/RouteRule.php new file mode 100644 index 000000000000..4858d3637394 --- /dev/null +++ b/NetworkServices/src/V1/TlsRoute/RouteRule.php @@ -0,0 +1,117 @@ +google.cloud.networkservices.v1.TlsRoute.RouteRule + */ +class RouteRule extends \Google\Protobuf\Internal\Message +{ + /** + * Required. RouteMatch defines the predicate used to match requests to a + * given action. Multiple match types are "OR"ed for evaluation. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute.RouteMatch matches = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $matches; + /** + * Required. The detailed rule defining how to route matched traffic. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TlsRoute.RouteAction action = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $action = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\NetworkServices\V1\TlsRoute\RouteMatch>|\Google\Protobuf\Internal\RepeatedField $matches + * Required. RouteMatch defines the predicate used to match requests to a + * given action. Multiple match types are "OR"ed for evaluation. + * @type \Google\Cloud\NetworkServices\V1\TlsRoute\RouteAction $action + * Required. The detailed rule defining how to route matched traffic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Required. RouteMatch defines the predicate used to match requests to a + * given action. Multiple match types are "OR"ed for evaluation. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute.RouteMatch matches = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMatches() + { + return $this->matches; + } + + /** + * Required. RouteMatch defines the predicate used to match requests to a + * given action. Multiple match types are "OR"ed for evaluation. + * + * Generated from protobuf field repeated .google.cloud.networkservices.v1.TlsRoute.RouteMatch matches = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\NetworkServices\V1\TlsRoute\RouteMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMatches($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\TlsRoute\RouteMatch::class); + $this->matches = $arr; + + return $this; + } + + /** + * Required. The detailed rule defining how to route matched traffic. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TlsRoute.RouteAction action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\TlsRoute\RouteAction|null + */ + public function getAction() + { + return $this->action; + } + + public function hasAction() + { + return isset($this->action); + } + + public function clearAction() + { + unset($this->action); + } + + /** + * Required. The detailed rule defining how to route matched traffic. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TlsRoute.RouteAction action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\TlsRoute\RouteAction $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\TlsRoute\RouteAction::class); + $this->action = $var; + + return $this; + } + +} + + diff --git a/NetworkServices/src/V1/TrafficPortSelector.php b/NetworkServices/src/V1/TrafficPortSelector.php new file mode 100644 index 000000000000..409d32c196e4 --- /dev/null +++ b/NetworkServices/src/V1/TrafficPortSelector.php @@ -0,0 +1,79 @@ +google.cloud.networkservices.v1.TrafficPortSelector + */ +class TrafficPortSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of ports. Can be port numbers or port range + * (example, [80-90] specifies all ports from 80 to 90, including + * 80 and 90) or named ports or * to specify all ports. If the + * list is empty, all ports are selected. + * + * Generated from protobuf field repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ports; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $ports + * Optional. A list of ports. Can be port numbers or port range + * (example, [80-90] specifies all ports from 80 to 90, including + * 80 and 90) or named ports or * to specify all ports. If the + * list is empty, all ports are selected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of ports. Can be port numbers or port range + * (example, [80-90] specifies all ports from 80 to 90, including + * 80 and 90) or named ports or * to specify all ports. If the + * list is empty, all ports are selected. + * + * Generated from protobuf field repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPorts() + { + return $this->ports; + } + + /** + * Optional. A list of ports. Can be port numbers or port range + * (example, [80-90] specifies all ports from 80 to 90, including + * 80 and 90) or named ports or * to specify all ports. If the + * list is empty, all ports are selected. + * + * Generated from protobuf field repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ports = $arr; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/UpdateEndpointPolicyRequest.php b/NetworkServices/src/V1/UpdateEndpointPolicyRequest.php new file mode 100644 index 000000000000..740ea6a28f2f --- /dev/null +++ b/NetworkServices/src/V1/UpdateEndpointPolicyRequest.php @@ -0,0 +1,137 @@ +google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + */ +class UpdateEndpointPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * EndpointPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. Updated EndpointPolicy resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointPolicy endpoint_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * EndpointPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\NetworkServices\V1\EndpointPolicy $endpoint_policy + * Required. Updated EndpointPolicy resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\EndpointPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * EndpointPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * EndpointPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Updated EndpointPolicy resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointPolicy endpoint_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\EndpointPolicy|null + */ + public function getEndpointPolicy() + { + return $this->endpoint_policy; + } + + public function hasEndpointPolicy() + { + return isset($this->endpoint_policy); + } + + public function clearEndpointPolicy() + { + unset($this->endpoint_policy); + } + + /** + * Required. Updated EndpointPolicy resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.EndpointPolicy endpoint_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\EndpointPolicy $var + * @return $this + */ + public function setEndpointPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\EndpointPolicy::class); + $this->endpoint_policy = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/UpdateGatewayRequest.php b/NetworkServices/src/V1/UpdateGatewayRequest.php new file mode 100644 index 000000000000..1e79d3c2758d --- /dev/null +++ b/NetworkServices/src/V1/UpdateGatewayRequest.php @@ -0,0 +1,137 @@ +google.cloud.networkservices.v1.UpdateGatewayRequest + */ +class UpdateGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Gateway resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. Updated Gateway resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Gateway gateway = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $gateway = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Gateway resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\NetworkServices\V1\Gateway $gateway + * Required. Updated Gateway resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Gateway::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Gateway resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Gateway resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Updated Gateway resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Gateway gateway = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\Gateway|null + */ + public function getGateway() + { + return $this->gateway; + } + + public function hasGateway() + { + return isset($this->gateway); + } + + public function clearGateway() + { + unset($this->gateway); + } + + /** + * Required. Updated Gateway resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Gateway gateway = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\Gateway $var + * @return $this + */ + public function setGateway($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\Gateway::class); + $this->gateway = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/UpdateGrpcRouteRequest.php b/NetworkServices/src/V1/UpdateGrpcRouteRequest.php new file mode 100644 index 000000000000..5411ee2c11a8 --- /dev/null +++ b/NetworkServices/src/V1/UpdateGrpcRouteRequest.php @@ -0,0 +1,137 @@ +google.cloud.networkservices.v1.UpdateGrpcRouteRequest + */ +class UpdateGrpcRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * GrpcRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. Updated GrpcRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute grpc_route = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $grpc_route = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * GrpcRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\NetworkServices\V1\GrpcRoute $grpc_route + * Required. Updated GrpcRoute resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\GrpcRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * GrpcRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * GrpcRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Updated GrpcRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute grpc_route = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\GrpcRoute|null + */ + public function getGrpcRoute() + { + return $this->grpc_route; + } + + public function hasGrpcRoute() + { + return isset($this->grpc_route); + } + + public function clearGrpcRoute() + { + unset($this->grpc_route); + } + + /** + * Required. Updated GrpcRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.GrpcRoute grpc_route = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\GrpcRoute $var + * @return $this + */ + public function setGrpcRoute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\GrpcRoute::class); + $this->grpc_route = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/UpdateHttpRouteRequest.php b/NetworkServices/src/V1/UpdateHttpRouteRequest.php new file mode 100644 index 000000000000..292e9c1af9d9 --- /dev/null +++ b/NetworkServices/src/V1/UpdateHttpRouteRequest.php @@ -0,0 +1,137 @@ +google.cloud.networkservices.v1.UpdateHttpRouteRequest + */ +class UpdateHttpRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * HttpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. Updated HttpRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute http_route = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $http_route = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * HttpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\NetworkServices\V1\HttpRoute $http_route + * Required. Updated HttpRoute resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * HttpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * HttpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Updated HttpRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute http_route = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\HttpRoute|null + */ + public function getHttpRoute() + { + return $this->http_route; + } + + public function hasHttpRoute() + { + return isset($this->http_route); + } + + public function clearHttpRoute() + { + unset($this->http_route); + } + + /** + * Required. Updated HttpRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.HttpRoute http_route = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\HttpRoute $var + * @return $this + */ + public function setHttpRoute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\HttpRoute::class); + $this->http_route = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/UpdateLbRouteExtensionRequest.php b/NetworkServices/src/V1/UpdateLbRouteExtensionRequest.php new file mode 100644 index 000000000000..ec0253dd7b40 --- /dev/null +++ b/NetworkServices/src/V1/UpdateLbRouteExtensionRequest.php @@ -0,0 +1,211 @@ +google.cloud.networkservices.v1.UpdateLbRouteExtensionRequest + */ +class UpdateLbRouteExtensionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Used to specify the fields to be overwritten in the + * `LbRouteExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. `LbRouteExtension` resource being updated. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbRouteExtension lb_route_extension = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lb_route_extension = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Used to specify the fields to be overwritten in the + * `LbRouteExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * @type \Google\Cloud\NetworkServices\V1\LbRouteExtension $lb_route_extension + * Required. `LbRouteExtension` resource being updated. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Used to specify the fields to be overwritten in the + * `LbRouteExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Used to specify the fields to be overwritten in the + * `LbRouteExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. `LbRouteExtension` resource being updated. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbRouteExtension lb_route_extension = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\LbRouteExtension|null + */ + public function getLbRouteExtension() + { + return $this->lb_route_extension; + } + + public function hasLbRouteExtension() + { + return isset($this->lb_route_extension); + } + + public function clearLbRouteExtension() + { + unset($this->lb_route_extension); + } + + /** + * Required. `LbRouteExtension` resource being updated. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbRouteExtension lb_route_extension = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\LbRouteExtension $var + * @return $this + */ + public function setLbRouteExtension($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\LbRouteExtension::class); + $this->lb_route_extension = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/UpdateLbTrafficExtensionRequest.php b/NetworkServices/src/V1/UpdateLbTrafficExtensionRequest.php new file mode 100644 index 000000000000..808280a78d2e --- /dev/null +++ b/NetworkServices/src/V1/UpdateLbTrafficExtensionRequest.php @@ -0,0 +1,211 @@ +google.cloud.networkservices.v1.UpdateLbTrafficExtensionRequest + */ +class UpdateLbTrafficExtensionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Used to specify the fields to be overwritten in the + * `LbTrafficExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. `LbTrafficExtension` resource being updated. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbTrafficExtension lb_traffic_extension = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lb_traffic_extension = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Used to specify the fields to be overwritten in the + * `LbTrafficExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * @type \Google\Cloud\NetworkServices\V1\LbTrafficExtension $lb_traffic_extension + * Required. `LbTrafficExtension` resource being updated. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Used to specify the fields to be overwritten in the + * `LbTrafficExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Used to specify the fields to be overwritten in the + * `LbTrafficExtension` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. `LbTrafficExtension` resource being updated. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbTrafficExtension lb_traffic_extension = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\LbTrafficExtension|null + */ + public function getLbTrafficExtension() + { + return $this->lb_traffic_extension; + } + + public function hasLbTrafficExtension() + { + return isset($this->lb_traffic_extension); + } + + public function clearLbTrafficExtension() + { + unset($this->lb_traffic_extension); + } + + /** + * Required. `LbTrafficExtension` resource being updated. + * + * Generated from protobuf field .google.cloud.networkservices.v1.LbTrafficExtension lb_traffic_extension = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\LbTrafficExtension $var + * @return $this + */ + public function setLbTrafficExtension($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\LbTrafficExtension::class); + $this->lb_traffic_extension = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/UpdateMeshRequest.php b/NetworkServices/src/V1/UpdateMeshRequest.php new file mode 100644 index 000000000000..ce964500953b --- /dev/null +++ b/NetworkServices/src/V1/UpdateMeshRequest.php @@ -0,0 +1,137 @@ +google.cloud.networkservices.v1.UpdateMeshRequest + */ +class UpdateMeshRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Mesh resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. Updated Mesh resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Mesh mesh = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mesh = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Mesh resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\NetworkServices\V1\Mesh $mesh + * Required. Updated Mesh resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\Mesh::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Mesh resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Mesh resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Updated Mesh resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Mesh mesh = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\Mesh|null + */ + public function getMesh() + { + return $this->mesh; + } + + public function hasMesh() + { + return isset($this->mesh); + } + + public function clearMesh() + { + unset($this->mesh); + } + + /** + * Required. Updated Mesh resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.Mesh mesh = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\Mesh $var + * @return $this + */ + public function setMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\Mesh::class); + $this->mesh = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/UpdateTcpRouteRequest.php b/NetworkServices/src/V1/UpdateTcpRouteRequest.php new file mode 100644 index 000000000000..6b041d9abb14 --- /dev/null +++ b/NetworkServices/src/V1/UpdateTcpRouteRequest.php @@ -0,0 +1,137 @@ +google.cloud.networkservices.v1.UpdateTcpRouteRequest + */ +class UpdateTcpRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * TcpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. Updated TcpRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TcpRoute tcp_route = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tcp_route = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * TcpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\NetworkServices\V1\TcpRoute $tcp_route + * Required. Updated TcpRoute resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TcpRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * TcpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * TcpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Updated TcpRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TcpRoute tcp_route = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\TcpRoute|null + */ + public function getTcpRoute() + { + return $this->tcp_route; + } + + public function hasTcpRoute() + { + return isset($this->tcp_route); + } + + public function clearTcpRoute() + { + unset($this->tcp_route); + } + + /** + * Required. Updated TcpRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TcpRoute tcp_route = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\TcpRoute $var + * @return $this + */ + public function setTcpRoute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\TcpRoute::class); + $this->tcp_route = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/UpdateTlsRouteRequest.php b/NetworkServices/src/V1/UpdateTlsRouteRequest.php new file mode 100644 index 000000000000..ad8536d49340 --- /dev/null +++ b/NetworkServices/src/V1/UpdateTlsRouteRequest.php @@ -0,0 +1,137 @@ +google.cloud.networkservices.v1.UpdateTlsRouteRequest + */ +class UpdateTlsRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * TlsRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. Updated TlsRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TlsRoute tls_route = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tls_route = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * TlsRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\NetworkServices\V1\TlsRoute $tls_route + * Required. Updated TlsRoute resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkservices\V1\TlsRoute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * TlsRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * TlsRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Updated TlsRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TlsRoute tls_route = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkServices\V1\TlsRoute|null + */ + public function getTlsRoute() + { + return $this->tls_route; + } + + public function hasTlsRoute() + { + return isset($this->tls_route); + } + + public function clearTlsRoute() + { + unset($this->tls_route); + } + + /** + * Required. Updated TlsRoute resource. + * + * Generated from protobuf field .google.cloud.networkservices.v1.TlsRoute tls_route = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkServices\V1\TlsRoute $var + * @return $this + */ + public function setTlsRoute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\TlsRoute::class); + $this->tls_route = $var; + + return $this; + } + +} + diff --git a/NetworkServices/src/V1/gapic_metadata.json b/NetworkServices/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..6242fe95cd6a --- /dev/null +++ b/NetworkServices/src/V1/gapic_metadata.json @@ -0,0 +1,322 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.networkservices.v1", + "libraryPackage": "Google\\Cloud\\NetworkServices\\V1", + "services": { + "DepService": { + "clients": { + "grpc": { + "libraryClient": "DepServiceGapicClient", + "rpcs": { + "CreateLbRouteExtension": { + "methods": [ + "createLbRouteExtension" + ] + }, + "CreateLbTrafficExtension": { + "methods": [ + "createLbTrafficExtension" + ] + }, + "DeleteLbRouteExtension": { + "methods": [ + "deleteLbRouteExtension" + ] + }, + "DeleteLbTrafficExtension": { + "methods": [ + "deleteLbTrafficExtension" + ] + }, + "GetLbRouteExtension": { + "methods": [ + "getLbRouteExtension" + ] + }, + "GetLbTrafficExtension": { + "methods": [ + "getLbTrafficExtension" + ] + }, + "ListLbRouteExtensions": { + "methods": [ + "listLbRouteExtensions" + ] + }, + "ListLbTrafficExtensions": { + "methods": [ + "listLbTrafficExtensions" + ] + }, + "UpdateLbRouteExtension": { + "methods": [ + "updateLbRouteExtension" + ] + }, + "UpdateLbTrafficExtension": { + "methods": [ + "updateLbTrafficExtension" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + }, + "NetworkServices": { + "clients": { + "grpc": { + "libraryClient": "NetworkServicesGapicClient", + "rpcs": { + "CreateEndpointPolicy": { + "methods": [ + "createEndpointPolicy" + ] + }, + "CreateGateway": { + "methods": [ + "createGateway" + ] + }, + "CreateGrpcRoute": { + "methods": [ + "createGrpcRoute" + ] + }, + "CreateHttpRoute": { + "methods": [ + "createHttpRoute" + ] + }, + "CreateMesh": { + "methods": [ + "createMesh" + ] + }, + "CreateServiceBinding": { + "methods": [ + "createServiceBinding" + ] + }, + "CreateTcpRoute": { + "methods": [ + "createTcpRoute" + ] + }, + "CreateTlsRoute": { + "methods": [ + "createTlsRoute" + ] + }, + "DeleteEndpointPolicy": { + "methods": [ + "deleteEndpointPolicy" + ] + }, + "DeleteGateway": { + "methods": [ + "deleteGateway" + ] + }, + "DeleteGrpcRoute": { + "methods": [ + "deleteGrpcRoute" + ] + }, + "DeleteHttpRoute": { + "methods": [ + "deleteHttpRoute" + ] + }, + "DeleteMesh": { + "methods": [ + "deleteMesh" + ] + }, + "DeleteServiceBinding": { + "methods": [ + "deleteServiceBinding" + ] + }, + "DeleteTcpRoute": { + "methods": [ + "deleteTcpRoute" + ] + }, + "DeleteTlsRoute": { + "methods": [ + "deleteTlsRoute" + ] + }, + "GetEndpointPolicy": { + "methods": [ + "getEndpointPolicy" + ] + }, + "GetGateway": { + "methods": [ + "getGateway" + ] + }, + "GetGrpcRoute": { + "methods": [ + "getGrpcRoute" + ] + }, + "GetHttpRoute": { + "methods": [ + "getHttpRoute" + ] + }, + "GetMesh": { + "methods": [ + "getMesh" + ] + }, + "GetServiceBinding": { + "methods": [ + "getServiceBinding" + ] + }, + "GetTcpRoute": { + "methods": [ + "getTcpRoute" + ] + }, + "GetTlsRoute": { + "methods": [ + "getTlsRoute" + ] + }, + "ListEndpointPolicies": { + "methods": [ + "listEndpointPolicies" + ] + }, + "ListGateways": { + "methods": [ + "listGateways" + ] + }, + "ListGrpcRoutes": { + "methods": [ + "listGrpcRoutes" + ] + }, + "ListHttpRoutes": { + "methods": [ + "listHttpRoutes" + ] + }, + "ListMeshes": { + "methods": [ + "listMeshes" + ] + }, + "ListServiceBindings": { + "methods": [ + "listServiceBindings" + ] + }, + "ListTcpRoutes": { + "methods": [ + "listTcpRoutes" + ] + }, + "ListTlsRoutes": { + "methods": [ + "listTlsRoutes" + ] + }, + "UpdateEndpointPolicy": { + "methods": [ + "updateEndpointPolicy" + ] + }, + "UpdateGateway": { + "methods": [ + "updateGateway" + ] + }, + "UpdateGrpcRoute": { + "methods": [ + "updateGrpcRoute" + ] + }, + "UpdateHttpRoute": { + "methods": [ + "updateHttpRoute" + ] + }, + "UpdateMesh": { + "methods": [ + "updateMesh" + ] + }, + "UpdateTcpRoute": { + "methods": [ + "updateTcpRoute" + ] + }, + "UpdateTlsRoute": { + "methods": [ + "updateTlsRoute" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/NetworkServices/src/V1/resources/dep_service_client_config.json b/NetworkServices/src/V1/resources/dep_service_client_config.json new file mode 100644 index 000000000000..dad488e147d4 --- /dev/null +++ b/NetworkServices/src/V1/resources/dep_service_client_config.json @@ -0,0 +1,107 @@ +{ + "interfaces": { + "google.cloud.networkservices.v1.DepService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateLbRouteExtension": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateLbTrafficExtension": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteLbRouteExtension": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteLbTrafficExtension": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLbRouteExtension": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLbTrafficExtension": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListLbRouteExtensions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListLbTrafficExtensions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateLbRouteExtension": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateLbTrafficExtension": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/NetworkServices/src/V1/resources/dep_service_descriptor_config.php b/NetworkServices/src/V1/resources/dep_service_descriptor_config.php new file mode 100644 index 000000000000..1dab206f9965 --- /dev/null +++ b/NetworkServices/src/V1/resources/dep_service_descriptor_config.php @@ -0,0 +1,131 @@ + [ + 'google.cloud.networkservices.v1.DepService' => [ + 'CreateLbRouteExtension' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\LbRouteExtension', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateLbTrafficExtension' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\LbTrafficExtension', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteLbRouteExtension' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteLbTrafficExtension' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateLbRouteExtension' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\LbRouteExtension', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateLbTrafficExtension' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\LbTrafficExtension', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListLbRouteExtensions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLbRouteExtensions', + ], + ], + 'ListLbTrafficExtensions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLbTrafficExtensions', + ], + ], + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + ], + ], +]; diff --git a/NetworkServices/src/V1/resources/dep_service_rest_client_config.php b/NetworkServices/src/V1/resources/dep_service_rest_client_config.php new file mode 100644 index 000000000000..00779b775bb0 --- /dev/null +++ b/NetworkServices/src/V1/resources/dep_service_rest_client_config.php @@ -0,0 +1,349 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.networkservices.v1.DepService' => [ + 'CreateLbRouteExtension' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/lbRouteExtensions', + 'body' => 'lb_route_extension', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'lb_route_extension_id', + ], + ], + 'CreateLbTrafficExtension' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/lbTrafficExtensions', + 'body' => 'lb_traffic_extension', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'lb_traffic_extension_id', + ], + ], + 'DeleteLbRouteExtension' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/lbRouteExtensions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteLbTrafficExtension' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/lbTrafficExtensions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetLbRouteExtension' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/lbRouteExtensions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetLbTrafficExtension' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/lbTrafficExtensions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLbRouteExtensions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/lbRouteExtensions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListLbTrafficExtensions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/lbTrafficExtensions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateLbRouteExtension' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{lb_route_extension.name=projects/*/locations/*/lbRouteExtensions/*}', + 'body' => 'lb_route_extension', + 'placeholders' => [ + 'lb_route_extension.name' => [ + 'getters' => [ + 'getLbRouteExtension', + 'getName', + ], + ], + ], + ], + 'UpdateLbTrafficExtension' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{lb_traffic_extension.name=projects/*/locations/*/lbTrafficExtensions/*}', + 'body' => 'lb_traffic_extension', + 'placeholders' => [ + 'lb_traffic_extension.name' => [ + 'getters' => [ + 'getLbTrafficExtension', + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serviceBindings/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/meshes/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/gateways/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serviceBindings/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/meshes/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/gateways/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serviceBindings/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/meshes/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/gateways/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/NetworkServices/src/V1/resources/network_services_client_config.json b/NetworkServices/src/V1/resources/network_services_client_config.json new file mode 100644 index 000000000000..39cf35750a4b --- /dev/null +++ b/NetworkServices/src/V1/resources/network_services_client_config.json @@ -0,0 +1,252 @@ +{ + "interfaces": { + "google.cloud.networkservices.v1.NetworkServices": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateGrpcRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateHttpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateMesh": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateServiceBinding": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateTcpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateTlsRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteGrpcRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteHttpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteMesh": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteServiceBinding": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTcpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTlsRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetGrpcRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetHttpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetMesh": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetServiceBinding": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetTcpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetTlsRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListEndpointPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListGateways": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListGrpcRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListHttpRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListMeshes": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListServiceBindings": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListTcpRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListTlsRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateGateway": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateGrpcRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateHttpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateMesh": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateTcpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateTlsRoute": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/NetworkServices/src/V1/resources/network_services_descriptor_config.php b/NetworkServices/src/V1/resources/network_services_descriptor_config.php new file mode 100644 index 000000000000..41cddfb811e0 --- /dev/null +++ b/NetworkServices/src/V1/resources/network_services_descriptor_config.php @@ -0,0 +1,361 @@ + [ + 'google.cloud.networkservices.v1.NetworkServices' => [ + 'CreateEndpointPolicy' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\EndpointPolicy', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateGateway' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\Gateway', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateGrpcRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\GrpcRoute', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateHttpRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\HttpRoute', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateMesh' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\Mesh', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateServiceBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\ServiceBinding', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateTcpRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\TcpRoute', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateTlsRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\TlsRoute', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteEndpointPolicy' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteGateway' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteGrpcRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteHttpRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteMesh' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteServiceBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteTcpRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteTlsRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateEndpointPolicy' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\EndpointPolicy', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateGateway' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\Gateway', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateGrpcRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\GrpcRoute', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateHttpRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\HttpRoute', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateMesh' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\Mesh', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateTcpRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\TcpRoute', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateTlsRoute' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkServices\V1\TlsRoute', + 'metadataReturnType' => '\Google\Cloud\NetworkServices\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListEndpointPolicies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEndpointPolicies', + ], + ], + 'ListGateways' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGateways', + ], + ], + 'ListGrpcRoutes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGrpcRoutes', + ], + ], + 'ListHttpRoutes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getHttpRoutes', + ], + ], + 'ListMeshes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMeshes', + ], + ], + 'ListServiceBindings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServiceBindings', + ], + ], + 'ListTcpRoutes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTcpRoutes', + ], + ], + 'ListTlsRoutes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTlsRoutes', + ], + ], + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + ], + ], +]; diff --git a/NetworkServices/src/V1/resources/network_services_rest_client_config.php b/NetworkServices/src/V1/resources/network_services_rest_client_config.php new file mode 100644 index 000000000000..ca9776abdda5 --- /dev/null +++ b/NetworkServices/src/V1/resources/network_services_rest_client_config.php @@ -0,0 +1,702 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.networkservices.v1.NetworkServices' => [ + 'CreateEndpointPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/endpointPolicies', + 'body' => 'endpoint_policy', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'endpoint_policy_id', + ], + ], + 'CreateGateway' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/gateways', + 'body' => 'gateway', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'gateway_id', + ], + ], + 'CreateGrpcRoute' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/grpcRoutes', + 'body' => 'grpc_route', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'grpc_route_id', + ], + ], + 'CreateHttpRoute' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/httpRoutes', + 'body' => 'http_route', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'http_route_id', + ], + ], + 'CreateMesh' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/meshes', + 'body' => 'mesh', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'mesh_id', + ], + ], + 'CreateServiceBinding' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/serviceBindings', + 'body' => 'service_binding', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'service_binding_id', + ], + ], + 'CreateTcpRoute' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/tcpRoutes', + 'body' => 'tcp_route', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'tcp_route_id', + ], + ], + 'CreateTlsRoute' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/tlsRoutes', + 'body' => 'tls_route', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'tls_route_id', + ], + ], + 'DeleteEndpointPolicy' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/endpointPolicies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteGateway' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/gateways/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteGrpcRoute' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/grpcRoutes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteHttpRoute' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/httpRoutes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteMesh' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/meshes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteServiceBinding' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/serviceBindings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTcpRoute' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/tcpRoutes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTlsRoute' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/tlsRoutes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEndpointPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/endpointPolicies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGateway' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/gateways/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGrpcRoute' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/grpcRoutes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetHttpRoute' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/httpRoutes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetMesh' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/meshes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetServiceBinding' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/serviceBindings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTcpRoute' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/tcpRoutes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTlsRoute' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/tlsRoutes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEndpointPolicies' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/endpointPolicies', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListGateways' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/gateways', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListGrpcRoutes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/grpcRoutes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListHttpRoutes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/httpRoutes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListMeshes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/meshes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListServiceBindings' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/serviceBindings', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTcpRoutes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/tcpRoutes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTlsRoutes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/tlsRoutes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEndpointPolicy' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{endpoint_policy.name=projects/*/locations/*/endpointPolicies/*}', + 'body' => 'endpoint_policy', + 'placeholders' => [ + 'endpoint_policy.name' => [ + 'getters' => [ + 'getEndpointPolicy', + 'getName', + ], + ], + ], + ], + 'UpdateGateway' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{gateway.name=projects/*/locations/*/gateways/*}', + 'body' => 'gateway', + 'placeholders' => [ + 'gateway.name' => [ + 'getters' => [ + 'getGateway', + 'getName', + ], + ], + ], + ], + 'UpdateGrpcRoute' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{grpc_route.name=projects/*/locations/*/grpcRoutes/*}', + 'body' => 'grpc_route', + 'placeholders' => [ + 'grpc_route.name' => [ + 'getters' => [ + 'getGrpcRoute', + 'getName', + ], + ], + ], + ], + 'UpdateHttpRoute' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{http_route.name=projects/*/locations/*/httpRoutes/*}', + 'body' => 'http_route', + 'placeholders' => [ + 'http_route.name' => [ + 'getters' => [ + 'getHttpRoute', + 'getName', + ], + ], + ], + ], + 'UpdateMesh' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{mesh.name=projects/*/locations/*/meshes/*}', + 'body' => 'mesh', + 'placeholders' => [ + 'mesh.name' => [ + 'getters' => [ + 'getMesh', + 'getName', + ], + ], + ], + ], + 'UpdateTcpRoute' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{tcp_route.name=projects/*/locations/*/tcpRoutes/*}', + 'body' => 'tcp_route', + 'placeholders' => [ + 'tcp_route.name' => [ + 'getters' => [ + 'getTcpRoute', + 'getName', + ], + ], + ], + ], + 'UpdateTlsRoute' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{tls_route.name=projects/*/locations/*/tlsRoutes/*}', + 'body' => 'tls_route', + 'placeholders' => [ + 'tls_route.name' => [ + 'getters' => [ + 'getTlsRoute', + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serviceBindings/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/meshes/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/gateways/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serviceBindings/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/meshes/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/gateways/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serviceBindings/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/meshes/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/gateways/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/NetworkServices/tests/Unit/V1/DepServiceClientTest.php b/NetworkServices/tests/Unit/V1/DepServiceClientTest.php new file mode 100644 index 000000000000..4941a961fba3 --- /dev/null +++ b/NetworkServices/tests/Unit/V1/DepServiceClientTest.php @@ -0,0 +1,1442 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DepServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DepServiceClient($options); + } + + /** @test */ + public function createLbRouteExtensionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createLbRouteExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new LbRouteExtension(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createLbRouteExtensionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $lbRouteExtensionId = 'lbRouteExtensionId1673910458'; + $lbRouteExtension = new LbRouteExtension(); + $lbRouteExtensionName = 'lbRouteExtensionName-498882633'; + $lbRouteExtension->setName($lbRouteExtensionName); + $lbRouteExtensionForwardingRules = []; + $lbRouteExtension->setForwardingRules($lbRouteExtensionForwardingRules); + $lbRouteExtensionExtensionChains = []; + $lbRouteExtension->setExtensionChains($lbRouteExtensionExtensionChains); + $lbRouteExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + $lbRouteExtension->setLoadBalancingScheme($lbRouteExtensionLoadBalancingScheme); + $response = $gapicClient->createLbRouteExtension($formattedParent, $lbRouteExtensionId, $lbRouteExtension); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/CreateLbRouteExtension', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getLbRouteExtensionId(); + $this->assertProtobufEquals($lbRouteExtensionId, $actualValue); + $actualValue = $actualApiRequestObject->getLbRouteExtension(); + $this->assertProtobufEquals($lbRouteExtension, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createLbRouteExtensionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createLbRouteExtensionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createLbRouteExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $lbRouteExtensionId = 'lbRouteExtensionId1673910458'; + $lbRouteExtension = new LbRouteExtension(); + $lbRouteExtensionName = 'lbRouteExtensionName-498882633'; + $lbRouteExtension->setName($lbRouteExtensionName); + $lbRouteExtensionForwardingRules = []; + $lbRouteExtension->setForwardingRules($lbRouteExtensionForwardingRules); + $lbRouteExtensionExtensionChains = []; + $lbRouteExtension->setExtensionChains($lbRouteExtensionExtensionChains); + $lbRouteExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + $lbRouteExtension->setLoadBalancingScheme($lbRouteExtensionLoadBalancingScheme); + $response = $gapicClient->createLbRouteExtension($formattedParent, $lbRouteExtensionId, $lbRouteExtension); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createLbRouteExtensionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createLbTrafficExtensionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createLbTrafficExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new LbTrafficExtension(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createLbTrafficExtensionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $lbTrafficExtensionId = 'lbTrafficExtensionId1573377862'; + $lbTrafficExtension = new LbTrafficExtension(); + $lbTrafficExtensionName = 'lbTrafficExtensionName1872015107'; + $lbTrafficExtension->setName($lbTrafficExtensionName); + $lbTrafficExtensionForwardingRules = []; + $lbTrafficExtension->setForwardingRules($lbTrafficExtensionForwardingRules); + $lbTrafficExtensionExtensionChains = []; + $lbTrafficExtension->setExtensionChains($lbTrafficExtensionExtensionChains); + $lbTrafficExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + $lbTrafficExtension->setLoadBalancingScheme($lbTrafficExtensionLoadBalancingScheme); + $response = $gapicClient->createLbTrafficExtension($formattedParent, $lbTrafficExtensionId, $lbTrafficExtension); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/CreateLbTrafficExtension', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getLbTrafficExtensionId(); + $this->assertProtobufEquals($lbTrafficExtensionId, $actualValue); + $actualValue = $actualApiRequestObject->getLbTrafficExtension(); + $this->assertProtobufEquals($lbTrafficExtension, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createLbTrafficExtensionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createLbTrafficExtensionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createLbTrafficExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $lbTrafficExtensionId = 'lbTrafficExtensionId1573377862'; + $lbTrafficExtension = new LbTrafficExtension(); + $lbTrafficExtensionName = 'lbTrafficExtensionName1872015107'; + $lbTrafficExtension->setName($lbTrafficExtensionName); + $lbTrafficExtensionForwardingRules = []; + $lbTrafficExtension->setForwardingRules($lbTrafficExtensionForwardingRules); + $lbTrafficExtensionExtensionChains = []; + $lbTrafficExtension->setExtensionChains($lbTrafficExtensionExtensionChains); + $lbTrafficExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + $lbTrafficExtension->setLoadBalancingScheme($lbTrafficExtensionLoadBalancingScheme); + $response = $gapicClient->createLbTrafficExtension($formattedParent, $lbTrafficExtensionId, $lbTrafficExtension); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createLbTrafficExtensionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteLbRouteExtensionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteLbRouteExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteLbRouteExtensionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->lbRouteExtensionName('[PROJECT]', '[LOCATION]', '[LB_ROUTE_EXTENSION]'); + $response = $gapicClient->deleteLbRouteExtension($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/DeleteLbRouteExtension', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteLbRouteExtensionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteLbRouteExtensionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteLbRouteExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lbRouteExtensionName('[PROJECT]', '[LOCATION]', '[LB_ROUTE_EXTENSION]'); + $response = $gapicClient->deleteLbRouteExtension($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteLbRouteExtensionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteLbTrafficExtensionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteLbTrafficExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteLbTrafficExtensionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->lbTrafficExtensionName('[PROJECT]', '[LOCATION]', '[LB_TRAFFIC_EXTENSION]'); + $response = $gapicClient->deleteLbTrafficExtension($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/DeleteLbTrafficExtension', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteLbTrafficExtensionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteLbTrafficExtensionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteLbTrafficExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lbTrafficExtensionName('[PROJECT]', '[LOCATION]', '[LB_TRAFFIC_EXTENSION]'); + $response = $gapicClient->deleteLbTrafficExtension($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteLbTrafficExtensionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLbRouteExtensionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $expectedResponse = new LbRouteExtension(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lbRouteExtensionName('[PROJECT]', '[LOCATION]', '[LB_ROUTE_EXTENSION]'); + $response = $gapicClient->getLbRouteExtension($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/GetLbRouteExtension', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLbRouteExtensionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lbRouteExtensionName('[PROJECT]', '[LOCATION]', '[LB_ROUTE_EXTENSION]'); + try { + $gapicClient->getLbRouteExtension($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLbTrafficExtensionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $expectedResponse = new LbTrafficExtension(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lbTrafficExtensionName('[PROJECT]', '[LOCATION]', '[LB_TRAFFIC_EXTENSION]'); + $response = $gapicClient->getLbTrafficExtension($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/GetLbTrafficExtension', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLbTrafficExtensionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lbTrafficExtensionName('[PROJECT]', '[LOCATION]', '[LB_TRAFFIC_EXTENSION]'); + try { + $gapicClient->getLbTrafficExtension($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLbRouteExtensionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $lbRouteExtensionsElement = new LbRouteExtension(); + $lbRouteExtensions = [ + $lbRouteExtensionsElement, + ]; + $expectedResponse = new ListLbRouteExtensionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLbRouteExtensions($lbRouteExtensions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listLbRouteExtensions($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLbRouteExtensions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/ListLbRouteExtensions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLbRouteExtensionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listLbRouteExtensions($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLbTrafficExtensionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $lbTrafficExtensionsElement = new LbTrafficExtension(); + $lbTrafficExtensions = [ + $lbTrafficExtensionsElement, + ]; + $expectedResponse = new ListLbTrafficExtensionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLbTrafficExtensions($lbTrafficExtensions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listLbTrafficExtensions($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLbTrafficExtensions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/ListLbTrafficExtensions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLbTrafficExtensionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listLbTrafficExtensions($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateLbRouteExtensionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateLbRouteExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new LbRouteExtension(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateLbRouteExtensionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $lbRouteExtension = new LbRouteExtension(); + $lbRouteExtensionName = 'lbRouteExtensionName-498882633'; + $lbRouteExtension->setName($lbRouteExtensionName); + $lbRouteExtensionForwardingRules = []; + $lbRouteExtension->setForwardingRules($lbRouteExtensionForwardingRules); + $lbRouteExtensionExtensionChains = []; + $lbRouteExtension->setExtensionChains($lbRouteExtensionExtensionChains); + $lbRouteExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + $lbRouteExtension->setLoadBalancingScheme($lbRouteExtensionLoadBalancingScheme); + $response = $gapicClient->updateLbRouteExtension($lbRouteExtension); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/UpdateLbRouteExtension', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getLbRouteExtension(); + $this->assertProtobufEquals($lbRouteExtension, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateLbRouteExtensionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateLbRouteExtensionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateLbRouteExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $lbRouteExtension = new LbRouteExtension(); + $lbRouteExtensionName = 'lbRouteExtensionName-498882633'; + $lbRouteExtension->setName($lbRouteExtensionName); + $lbRouteExtensionForwardingRules = []; + $lbRouteExtension->setForwardingRules($lbRouteExtensionForwardingRules); + $lbRouteExtensionExtensionChains = []; + $lbRouteExtension->setExtensionChains($lbRouteExtensionExtensionChains); + $lbRouteExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + $lbRouteExtension->setLoadBalancingScheme($lbRouteExtensionLoadBalancingScheme); + $response = $gapicClient->updateLbRouteExtension($lbRouteExtension); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateLbRouteExtensionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateLbTrafficExtensionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateLbTrafficExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new LbTrafficExtension(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateLbTrafficExtensionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $lbTrafficExtension = new LbTrafficExtension(); + $lbTrafficExtensionName = 'lbTrafficExtensionName1872015107'; + $lbTrafficExtension->setName($lbTrafficExtensionName); + $lbTrafficExtensionForwardingRules = []; + $lbTrafficExtension->setForwardingRules($lbTrafficExtensionForwardingRules); + $lbTrafficExtensionExtensionChains = []; + $lbTrafficExtension->setExtensionChains($lbTrafficExtensionExtensionChains); + $lbTrafficExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + $lbTrafficExtension->setLoadBalancingScheme($lbTrafficExtensionLoadBalancingScheme); + $response = $gapicClient->updateLbTrafficExtension($lbTrafficExtension); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.DepService/UpdateLbTrafficExtension', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getLbTrafficExtension(); + $this->assertProtobufEquals($lbTrafficExtension, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateLbTrafficExtensionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateLbTrafficExtensionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateLbTrafficExtensionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $lbTrafficExtension = new LbTrafficExtension(); + $lbTrafficExtensionName = 'lbTrafficExtensionName1872015107'; + $lbTrafficExtension->setName($lbTrafficExtensionName); + $lbTrafficExtensionForwardingRules = []; + $lbTrafficExtension->setForwardingRules($lbTrafficExtensionForwardingRules); + $lbTrafficExtensionExtensionChains = []; + $lbTrafficExtension->setExtensionChains($lbTrafficExtensionExtensionChains); + $lbTrafficExtensionLoadBalancingScheme = LoadBalancingScheme::LOAD_BALANCING_SCHEME_UNSPECIFIED; + $lbTrafficExtension->setLoadBalancingScheme($lbTrafficExtensionLoadBalancingScheme); + $response = $gapicClient->updateLbTrafficExtension($lbTrafficExtension); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateLbTrafficExtensionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/NetworkServices/tests/Unit/V1/NetworkServicesClientTest.php b/NetworkServices/tests/Unit/V1/NetworkServicesClientTest.php new file mode 100644 index 000000000000..bb3e3d923e70 --- /dev/null +++ b/NetworkServices/tests/Unit/V1/NetworkServicesClientTest.php @@ -0,0 +1,4472 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkServicesClient($options); + } + + /** @test */ + public function createEndpointPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createEndpointPolicyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $authorizationPolicy = 'authorizationPolicy-1576667208'; + $description = 'description-1724546052'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $clientTlsPolicy = 'clientTlsPolicy-611416598'; + $expectedResponse = new EndpointPolicy(); + $expectedResponse->setName($name); + $expectedResponse->setAuthorizationPolicy($authorizationPolicy); + $expectedResponse->setDescription($description); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $expectedResponse->setClientTlsPolicy($clientTlsPolicy); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createEndpointPolicyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $endpointPolicyId = 'endpointPolicyId-969914082'; + $endpointPolicy = new EndpointPolicy(); + $endpointPolicyName = 'endpointPolicyName36531794'; + $endpointPolicy->setName($endpointPolicyName); + $endpointPolicyType = EndpointPolicyType::ENDPOINT_POLICY_TYPE_UNSPECIFIED; + $endpointPolicy->setType($endpointPolicyType); + $endpointPolicyEndpointMatcher = new EndpointMatcher(); + $endpointPolicy->setEndpointMatcher($endpointPolicyEndpointMatcher); + $response = $gapicClient->createEndpointPolicy($formattedParent, $endpointPolicyId, $endpointPolicy); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/CreateEndpointPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getEndpointPolicyId(); + $this->assertProtobufEquals($endpointPolicyId, $actualValue); + $actualValue = $actualApiRequestObject->getEndpointPolicy(); + $this->assertProtobufEquals($endpointPolicy, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createEndpointPolicyTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createEndpointPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createEndpointPolicyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $endpointPolicyId = 'endpointPolicyId-969914082'; + $endpointPolicy = new EndpointPolicy(); + $endpointPolicyName = 'endpointPolicyName36531794'; + $endpointPolicy->setName($endpointPolicyName); + $endpointPolicyType = EndpointPolicyType::ENDPOINT_POLICY_TYPE_UNSPECIFIED; + $endpointPolicy->setType($endpointPolicyType); + $endpointPolicyEndpointMatcher = new EndpointMatcher(); + $endpointPolicy->setEndpointMatcher($endpointPolicyEndpointMatcher); + $response = $gapicClient->createEndpointPolicy($formattedParent, $endpointPolicyId, $endpointPolicy); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createEndpointPolicyTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createGatewayTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $scope = 'scope109264468'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $expectedResponse = new Gateway(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $expectedResponse->setScope($scope); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createGatewayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $gatewayId = 'gatewayId955798774'; + $gateway = new Gateway(); + $gatewayName = 'gatewayName-435522833'; + $gateway->setName($gatewayName); + $gatewayPorts = []; + $gateway->setPorts($gatewayPorts); + $gatewayScope = 'gatewayScope-611626384'; + $gateway->setScope($gatewayScope); + $response = $gapicClient->createGateway($formattedParent, $gatewayId, $gateway); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/CreateGateway', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getGatewayId(); + $this->assertProtobufEquals($gatewayId, $actualValue); + $actualValue = $actualApiRequestObject->getGateway(); + $this->assertProtobufEquals($gateway, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGatewayTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createGatewayExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $gatewayId = 'gatewayId955798774'; + $gateway = new Gateway(); + $gatewayName = 'gatewayName-435522833'; + $gateway->setName($gatewayName); + $gatewayPorts = []; + $gateway->setPorts($gatewayPorts); + $gatewayScope = 'gatewayScope-611626384'; + $gateway->setScope($gatewayScope); + $response = $gapicClient->createGateway($formattedParent, $gatewayId, $gateway); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGatewayTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createGrpcRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGrpcRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new GrpcRoute(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createGrpcRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $grpcRouteId = 'grpcRouteId100668882'; + $grpcRoute = new GrpcRoute(); + $grpcRouteName = 'grpcRouteName-2118800906'; + $grpcRoute->setName($grpcRouteName); + $grpcRouteHostnames = []; + $grpcRoute->setHostnames($grpcRouteHostnames); + $grpcRouteRules = []; + $grpcRoute->setRules($grpcRouteRules); + $response = $gapicClient->createGrpcRoute($formattedParent, $grpcRouteId, $grpcRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/CreateGrpcRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getGrpcRouteId(); + $this->assertProtobufEquals($grpcRouteId, $actualValue); + $actualValue = $actualApiRequestObject->getGrpcRoute(); + $this->assertProtobufEquals($grpcRoute, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGrpcRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createGrpcRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGrpcRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $grpcRouteId = 'grpcRouteId100668882'; + $grpcRoute = new GrpcRoute(); + $grpcRouteName = 'grpcRouteName-2118800906'; + $grpcRoute->setName($grpcRouteName); + $grpcRouteHostnames = []; + $grpcRoute->setHostnames($grpcRouteHostnames); + $grpcRouteRules = []; + $grpcRoute->setRules($grpcRouteRules); + $response = $gapicClient->createGrpcRoute($formattedParent, $grpcRouteId, $grpcRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGrpcRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createHttpRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createHttpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new HttpRoute(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createHttpRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $httpRouteId = 'httpRouteId-1087115096'; + $httpRoute = new HttpRoute(); + $httpRouteName = 'httpRouteName988382412'; + $httpRoute->setName($httpRouteName); + $httpRouteHostnames = []; + $httpRoute->setHostnames($httpRouteHostnames); + $httpRouteRules = []; + $httpRoute->setRules($httpRouteRules); + $response = $gapicClient->createHttpRoute($formattedParent, $httpRouteId, $httpRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/CreateHttpRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getHttpRouteId(); + $this->assertProtobufEquals($httpRouteId, $actualValue); + $actualValue = $actualApiRequestObject->getHttpRoute(); + $this->assertProtobufEquals($httpRoute, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createHttpRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createHttpRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createHttpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $httpRouteId = 'httpRouteId-1087115096'; + $httpRoute = new HttpRoute(); + $httpRouteName = 'httpRouteName988382412'; + $httpRoute->setName($httpRouteName); + $httpRouteHostnames = []; + $httpRoute->setHostnames($httpRouteHostnames); + $httpRouteRules = []; + $httpRoute->setRules($httpRouteRules); + $response = $gapicClient->createHttpRoute($formattedParent, $httpRouteId, $httpRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createHttpRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createMeshTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createMeshTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $interceptionPort = 537115930; + $expectedResponse = new Mesh(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $expectedResponse->setInterceptionPort($interceptionPort); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createMeshTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $meshId = 'meshId954595501'; + $mesh = new Mesh(); + $meshName = 'meshName-472824296'; + $mesh->setName($meshName); + $response = $gapicClient->createMesh($formattedParent, $meshId, $mesh); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/CreateMesh', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getMeshId(); + $this->assertProtobufEquals($meshId, $actualValue); + $actualValue = $actualApiRequestObject->getMesh(); + $this->assertProtobufEquals($mesh, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createMeshTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createMeshExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createMeshTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $meshId = 'meshId954595501'; + $mesh = new Mesh(); + $meshName = 'meshName-472824296'; + $mesh->setName($meshName); + $response = $gapicClient->createMesh($formattedParent, $meshId, $mesh); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createMeshTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createServiceBindingTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createServiceBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $service = 'service1984153269'; + $expectedResponse = new ServiceBinding(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setService($service); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createServiceBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $serviceBindingId = 'serviceBindingId-2088291105'; + $serviceBinding = new ServiceBinding(); + $serviceBindingName = 'serviceBindingName985981115'; + $serviceBinding->setName($serviceBindingName); + $serviceBindingService = 'serviceBindingService344355461'; + $serviceBinding->setService($serviceBindingService); + $response = $gapicClient->createServiceBinding($formattedParent, $serviceBindingId, $serviceBinding); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/CreateServiceBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getServiceBindingId(); + $this->assertProtobufEquals($serviceBindingId, $actualValue); + $actualValue = $actualApiRequestObject->getServiceBinding(); + $this->assertProtobufEquals($serviceBinding, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createServiceBindingTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createServiceBindingExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createServiceBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $serviceBindingId = 'serviceBindingId-2088291105'; + $serviceBinding = new ServiceBinding(); + $serviceBindingName = 'serviceBindingName985981115'; + $serviceBinding->setName($serviceBindingName); + $serviceBindingService = 'serviceBindingService344355461'; + $serviceBinding->setService($serviceBindingService); + $response = $gapicClient->createServiceBinding($formattedParent, $serviceBindingId, $serviceBinding); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createServiceBindingTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTcpRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTcpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new TcpRoute(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTcpRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $tcpRouteId = 'tcpRouteId-154571409'; + $tcpRoute = new TcpRoute(); + $tcpRouteName = 'tcpRouteName1920926099'; + $tcpRoute->setName($tcpRouteName); + $tcpRouteRules = []; + $tcpRoute->setRules($tcpRouteRules); + $response = $gapicClient->createTcpRoute($formattedParent, $tcpRouteId, $tcpRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/CreateTcpRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTcpRouteId(); + $this->assertProtobufEquals($tcpRouteId, $actualValue); + $actualValue = $actualApiRequestObject->getTcpRoute(); + $this->assertProtobufEquals($tcpRoute, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTcpRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTcpRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTcpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $tcpRouteId = 'tcpRouteId-154571409'; + $tcpRoute = new TcpRoute(); + $tcpRouteName = 'tcpRouteName1920926099'; + $tcpRoute->setName($tcpRouteName); + $tcpRouteRules = []; + $tcpRoute->setRules($tcpRouteRules); + $response = $gapicClient->createTcpRoute($formattedParent, $tcpRouteId, $tcpRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTcpRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTlsRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTlsRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new TlsRoute(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTlsRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $tlsRouteId = 'tlsRouteId263195029'; + $tlsRoute = new TlsRoute(); + $tlsRouteName = 'tlsRouteName-1956274759'; + $tlsRoute->setName($tlsRouteName); + $tlsRouteRules = []; + $tlsRoute->setRules($tlsRouteRules); + $response = $gapicClient->createTlsRoute($formattedParent, $tlsRouteId, $tlsRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/CreateTlsRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTlsRouteId(); + $this->assertProtobufEquals($tlsRouteId, $actualValue); + $actualValue = $actualApiRequestObject->getTlsRoute(); + $this->assertProtobufEquals($tlsRoute, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTlsRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTlsRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTlsRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $tlsRouteId = 'tlsRouteId263195029'; + $tlsRoute = new TlsRoute(); + $tlsRouteName = 'tlsRouteName-1956274759'; + $tlsRoute->setName($tlsRouteName); + $tlsRouteRules = []; + $tlsRoute->setRules($tlsRouteRules); + $response = $gapicClient->createTlsRoute($formattedParent, $tlsRouteId, $tlsRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTlsRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteEndpointPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteEndpointPolicyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteEndpointPolicyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->endpointPolicyName('[PROJECT]', '[LOCATION]', '[ENDPOINT_POLICY]'); + $response = $gapicClient->deleteEndpointPolicy($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/DeleteEndpointPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteEndpointPolicyTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteEndpointPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteEndpointPolicyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->endpointPolicyName('[PROJECT]', '[LOCATION]', '[ENDPOINT_POLICY]'); + $response = $gapicClient->deleteEndpointPolicy($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteEndpointPolicyTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteGatewayTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteGatewayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->gatewayName('[PROJECT]', '[LOCATION]', '[GATEWAY]'); + $response = $gapicClient->deleteGateway($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/DeleteGateway', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteGatewayTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteGatewayExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->gatewayName('[PROJECT]', '[LOCATION]', '[GATEWAY]'); + $response = $gapicClient->deleteGateway($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteGatewayTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteGrpcRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteGrpcRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteGrpcRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->grpcRouteName('[PROJECT]', '[LOCATION]', '[GRPC_ROUTE]'); + $response = $gapicClient->deleteGrpcRoute($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/DeleteGrpcRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteGrpcRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteGrpcRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteGrpcRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->grpcRouteName('[PROJECT]', '[LOCATION]', '[GRPC_ROUTE]'); + $response = $gapicClient->deleteGrpcRoute($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteGrpcRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteHttpRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteHttpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteHttpRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->httpRouteName('[PROJECT]', '[LOCATION]', '[HTTP_ROUTE]'); + $response = $gapicClient->deleteHttpRoute($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/DeleteHttpRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteHttpRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteHttpRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteHttpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->httpRouteName('[PROJECT]', '[LOCATION]', '[HTTP_ROUTE]'); + $response = $gapicClient->deleteHttpRoute($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteHttpRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteMeshTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteMeshTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteMeshTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->meshName('[PROJECT]', '[LOCATION]', '[MESH]'); + $response = $gapicClient->deleteMesh($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/DeleteMesh', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteMeshTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteMeshExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteMeshTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->meshName('[PROJECT]', '[LOCATION]', '[MESH]'); + $response = $gapicClient->deleteMesh($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteMeshTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteServiceBindingTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteServiceBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteServiceBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->serviceBindingName('[PROJECT]', '[LOCATION]', '[SERVICE_BINDING]'); + $response = $gapicClient->deleteServiceBinding($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/DeleteServiceBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteServiceBindingTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteServiceBindingExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteServiceBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceBindingName('[PROJECT]', '[LOCATION]', '[SERVICE_BINDING]'); + $response = $gapicClient->deleteServiceBinding($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteServiceBindingTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTcpRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTcpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTcpRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tcpRouteName('[PROJECT]', '[LOCATION]', '[TCP_ROUTE]'); + $response = $gapicClient->deleteTcpRoute($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/DeleteTcpRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTcpRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTcpRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTcpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tcpRouteName('[PROJECT]', '[LOCATION]', '[TCP_ROUTE]'); + $response = $gapicClient->deleteTcpRoute($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTcpRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTlsRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTlsRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTlsRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tlsRouteName('[PROJECT]', '[LOCATION]', '[TLS_ROUTE]'); + $response = $gapicClient->deleteTlsRoute($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/DeleteTlsRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTlsRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTlsRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTlsRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tlsRouteName('[PROJECT]', '[LOCATION]', '[TLS_ROUTE]'); + $response = $gapicClient->deleteTlsRoute($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTlsRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getEndpointPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $authorizationPolicy = 'authorizationPolicy-1576667208'; + $description = 'description-1724546052'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $clientTlsPolicy = 'clientTlsPolicy-611416598'; + $expectedResponse = new EndpointPolicy(); + $expectedResponse->setName($name2); + $expectedResponse->setAuthorizationPolicy($authorizationPolicy); + $expectedResponse->setDescription($description); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $expectedResponse->setClientTlsPolicy($clientTlsPolicy); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->endpointPolicyName('[PROJECT]', '[LOCATION]', '[ENDPOINT_POLICY]'); + $response = $gapicClient->getEndpointPolicy($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/GetEndpointPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEndpointPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->endpointPolicyName('[PROJECT]', '[LOCATION]', '[ENDPOINT_POLICY]'); + try { + $gapicClient->getEndpointPolicy($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGatewayTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $scope = 'scope109264468'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $expectedResponse = new Gateway(); + $expectedResponse->setName($name2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $expectedResponse->setScope($scope); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->gatewayName('[PROJECT]', '[LOCATION]', '[GATEWAY]'); + $response = $gapicClient->getGateway($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/GetGateway', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGatewayExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->gatewayName('[PROJECT]', '[LOCATION]', '[GATEWAY]'); + try { + $gapicClient->getGateway($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGrpcRouteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new GrpcRoute(); + $expectedResponse->setName($name2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->grpcRouteName('[PROJECT]', '[LOCATION]', '[GRPC_ROUTE]'); + $response = $gapicClient->getGrpcRoute($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/GetGrpcRoute', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGrpcRouteExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->grpcRouteName('[PROJECT]', '[LOCATION]', '[GRPC_ROUTE]'); + try { + $gapicClient->getGrpcRoute($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHttpRouteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new HttpRoute(); + $expectedResponse->setName($name2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->httpRouteName('[PROJECT]', '[LOCATION]', '[HTTP_ROUTE]'); + $response = $gapicClient->getHttpRoute($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/GetHttpRoute', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHttpRouteExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->httpRouteName('[PROJECT]', '[LOCATION]', '[HTTP_ROUTE]'); + try { + $gapicClient->getHttpRoute($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMeshTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $interceptionPort = 537115930; + $expectedResponse = new Mesh(); + $expectedResponse->setName($name2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $expectedResponse->setInterceptionPort($interceptionPort); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->meshName('[PROJECT]', '[LOCATION]', '[MESH]'); + $response = $gapicClient->getMesh($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/GetMesh', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMeshExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->meshName('[PROJECT]', '[LOCATION]', '[MESH]'); + try { + $gapicClient->getMesh($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceBindingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $service = 'service1984153269'; + $expectedResponse = new ServiceBinding(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setService($service); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceBindingName('[PROJECT]', '[LOCATION]', '[SERVICE_BINDING]'); + $response = $gapicClient->getServiceBinding($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/GetServiceBinding', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceBindingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceBindingName('[PROJECT]', '[LOCATION]', '[SERVICE_BINDING]'); + try { + $gapicClient->getServiceBinding($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTcpRouteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new TcpRoute(); + $expectedResponse->setName($name2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tcpRouteName('[PROJECT]', '[LOCATION]', '[TCP_ROUTE]'); + $response = $gapicClient->getTcpRoute($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/GetTcpRoute', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTcpRouteExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tcpRouteName('[PROJECT]', '[LOCATION]', '[TCP_ROUTE]'); + try { + $gapicClient->getTcpRoute($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTlsRouteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new TlsRoute(); + $expectedResponse->setName($name2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tlsRouteName('[PROJECT]', '[LOCATION]', '[TLS_ROUTE]'); + $response = $gapicClient->getTlsRoute($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/GetTlsRoute', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTlsRouteExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tlsRouteName('[PROJECT]', '[LOCATION]', '[TLS_ROUTE]'); + try { + $gapicClient->getTlsRoute($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEndpointPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $endpointPoliciesElement = new EndpointPolicy(); + $endpointPolicies = [ + $endpointPoliciesElement, + ]; + $expectedResponse = new ListEndpointPoliciesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEndpointPolicies($endpointPolicies); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listEndpointPolicies($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEndpointPolicies()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/ListEndpointPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEndpointPoliciesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listEndpointPolicies($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGatewaysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $gatewaysElement = new Gateway(); + $gateways = [ + $gatewaysElement, + ]; + $expectedResponse = new ListGatewaysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGateways($gateways); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listGateways($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGateways()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/ListGateways', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGatewaysExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listGateways($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGrpcRoutesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $grpcRoutesElement = new GrpcRoute(); + $grpcRoutes = [ + $grpcRoutesElement, + ]; + $expectedResponse = new ListGrpcRoutesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGrpcRoutes($grpcRoutes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listGrpcRoutes($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGrpcRoutes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/ListGrpcRoutes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGrpcRoutesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listGrpcRoutes($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listHttpRoutesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $httpRoutesElement = new HttpRoute(); + $httpRoutes = [ + $httpRoutesElement, + ]; + $expectedResponse = new ListHttpRoutesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setHttpRoutes($httpRoutes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listHttpRoutes($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getHttpRoutes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/ListHttpRoutes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listHttpRoutesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listHttpRoutes($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMeshesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $meshesElement = new Mesh(); + $meshes = [ + $meshesElement, + ]; + $expectedResponse = new ListMeshesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMeshes($meshes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listMeshes($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMeshes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/ListMeshes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMeshesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listMeshes($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServiceBindingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $serviceBindingsElement = new ServiceBinding(); + $serviceBindings = [ + $serviceBindingsElement, + ]; + $expectedResponse = new ListServiceBindingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServiceBindings($serviceBindings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listServiceBindings($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServiceBindings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/ListServiceBindings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServiceBindingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listServiceBindings($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTcpRoutesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tcpRoutesElement = new TcpRoute(); + $tcpRoutes = [ + $tcpRoutesElement, + ]; + $expectedResponse = new ListTcpRoutesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTcpRoutes($tcpRoutes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listTcpRoutes($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTcpRoutes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/ListTcpRoutes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTcpRoutesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listTcpRoutes($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTlsRoutesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tlsRoutesElement = new TlsRoute(); + $tlsRoutes = [ + $tlsRoutesElement, + ]; + $expectedResponse = new ListTlsRoutesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTlsRoutes($tlsRoutes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listTlsRoutes($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTlsRoutes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/ListTlsRoutes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTlsRoutesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listTlsRoutes($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEndpointPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateEndpointPolicyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $authorizationPolicy = 'authorizationPolicy-1576667208'; + $description = 'description-1724546052'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $clientTlsPolicy = 'clientTlsPolicy-611416598'; + $expectedResponse = new EndpointPolicy(); + $expectedResponse->setName($name); + $expectedResponse->setAuthorizationPolicy($authorizationPolicy); + $expectedResponse->setDescription($description); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $expectedResponse->setClientTlsPolicy($clientTlsPolicy); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateEndpointPolicyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $endpointPolicy = new EndpointPolicy(); + $endpointPolicyName = 'endpointPolicyName36531794'; + $endpointPolicy->setName($endpointPolicyName); + $endpointPolicyType = EndpointPolicyType::ENDPOINT_POLICY_TYPE_UNSPECIFIED; + $endpointPolicy->setType($endpointPolicyType); + $endpointPolicyEndpointMatcher = new EndpointMatcher(); + $endpointPolicy->setEndpointMatcher($endpointPolicyEndpointMatcher); + $response = $gapicClient->updateEndpointPolicy($endpointPolicy); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/UpdateEndpointPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getEndpointPolicy(); + $this->assertProtobufEquals($endpointPolicy, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateEndpointPolicyTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateEndpointPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateEndpointPolicyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $endpointPolicy = new EndpointPolicy(); + $endpointPolicyName = 'endpointPolicyName36531794'; + $endpointPolicy->setName($endpointPolicyName); + $endpointPolicyType = EndpointPolicyType::ENDPOINT_POLICY_TYPE_UNSPECIFIED; + $endpointPolicy->setType($endpointPolicyType); + $endpointPolicyEndpointMatcher = new EndpointMatcher(); + $endpointPolicy->setEndpointMatcher($endpointPolicyEndpointMatcher); + $response = $gapicClient->updateEndpointPolicy($endpointPolicy); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateEndpointPolicyTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateGatewayTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $scope = 'scope109264468'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $expectedResponse = new Gateway(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $expectedResponse->setScope($scope); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateGatewayTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $gateway = new Gateway(); + $gatewayName = 'gatewayName-435522833'; + $gateway->setName($gatewayName); + $gatewayPorts = []; + $gateway->setPorts($gatewayPorts); + $gatewayScope = 'gatewayScope-611626384'; + $gateway->setScope($gatewayScope); + $response = $gapicClient->updateGateway($gateway); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/UpdateGateway', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGateway(); + $this->assertProtobufEquals($gateway, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateGatewayTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateGatewayExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateGatewayTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $gateway = new Gateway(); + $gatewayName = 'gatewayName-435522833'; + $gateway->setName($gatewayName); + $gatewayPorts = []; + $gateway->setPorts($gatewayPorts); + $gatewayScope = 'gatewayScope-611626384'; + $gateway->setScope($gatewayScope); + $response = $gapicClient->updateGateway($gateway); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateGatewayTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateGrpcRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateGrpcRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new GrpcRoute(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateGrpcRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $grpcRoute = new GrpcRoute(); + $grpcRouteName = 'grpcRouteName-2118800906'; + $grpcRoute->setName($grpcRouteName); + $grpcRouteHostnames = []; + $grpcRoute->setHostnames($grpcRouteHostnames); + $grpcRouteRules = []; + $grpcRoute->setRules($grpcRouteRules); + $response = $gapicClient->updateGrpcRoute($grpcRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/UpdateGrpcRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGrpcRoute(); + $this->assertProtobufEquals($grpcRoute, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateGrpcRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateGrpcRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateGrpcRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $grpcRoute = new GrpcRoute(); + $grpcRouteName = 'grpcRouteName-2118800906'; + $grpcRoute->setName($grpcRouteName); + $grpcRouteHostnames = []; + $grpcRoute->setHostnames($grpcRouteHostnames); + $grpcRouteRules = []; + $grpcRoute->setRules($grpcRouteRules); + $response = $gapicClient->updateGrpcRoute($grpcRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateGrpcRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateHttpRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateHttpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new HttpRoute(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateHttpRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $httpRoute = new HttpRoute(); + $httpRouteName = 'httpRouteName988382412'; + $httpRoute->setName($httpRouteName); + $httpRouteHostnames = []; + $httpRoute->setHostnames($httpRouteHostnames); + $httpRouteRules = []; + $httpRoute->setRules($httpRouteRules); + $response = $gapicClient->updateHttpRoute($httpRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/UpdateHttpRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHttpRoute(); + $this->assertProtobufEquals($httpRoute, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateHttpRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateHttpRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateHttpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $httpRoute = new HttpRoute(); + $httpRouteName = 'httpRouteName988382412'; + $httpRoute->setName($httpRouteName); + $httpRouteHostnames = []; + $httpRoute->setHostnames($httpRouteHostnames); + $httpRouteRules = []; + $httpRoute->setRules($httpRouteRules); + $response = $gapicClient->updateHttpRoute($httpRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateHttpRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateMeshTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateMeshTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $interceptionPort = 537115930; + $expectedResponse = new Mesh(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $expectedResponse->setInterceptionPort($interceptionPort); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateMeshTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $mesh = new Mesh(); + $meshName = 'meshName-472824296'; + $mesh->setName($meshName); + $response = $gapicClient->updateMesh($mesh); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/UpdateMesh', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMesh(); + $this->assertProtobufEquals($mesh, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateMeshTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateMeshExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateMeshTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $mesh = new Mesh(); + $meshName = 'meshName-472824296'; + $mesh->setName($meshName); + $response = $gapicClient->updateMesh($mesh); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateMeshTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateTcpRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTcpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new TcpRoute(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateTcpRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tcpRoute = new TcpRoute(); + $tcpRouteName = 'tcpRouteName1920926099'; + $tcpRoute->setName($tcpRouteName); + $tcpRouteRules = []; + $tcpRoute->setRules($tcpRouteRules); + $response = $gapicClient->updateTcpRoute($tcpRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/UpdateTcpRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTcpRoute(); + $this->assertProtobufEquals($tcpRoute, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTcpRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateTcpRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTcpRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $tcpRoute = new TcpRoute(); + $tcpRouteName = 'tcpRouteName1920926099'; + $tcpRoute->setName($tcpRouteName); + $tcpRouteRules = []; + $tcpRoute->setRules($tcpRouteRules); + $response = $gapicClient->updateTcpRoute($tcpRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTcpRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateTlsRouteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTlsRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $description = 'description-1724546052'; + $expectedResponse = new TlsRoute(); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateTlsRouteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tlsRoute = new TlsRoute(); + $tlsRouteName = 'tlsRouteName-1956274759'; + $tlsRoute->setName($tlsRouteName); + $tlsRouteRules = []; + $tlsRoute->setRules($tlsRouteRules); + $response = $gapicClient->updateTlsRoute($tlsRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networkservices.v1.NetworkServices/UpdateTlsRoute', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTlsRoute(); + $this->assertProtobufEquals($tlsRoute, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTlsRouteTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateTlsRouteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTlsRouteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $tlsRoute = new TlsRoute(); + $tlsRouteName = 'tlsRouteName-1956274759'; + $tlsRoute->setName($tlsRouteName); + $tlsRouteRules = []; + $tlsRoute->setRules($tlsRouteRules); + $response = $gapicClient->updateTlsRoute($tlsRoute); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTlsRouteTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/Notebooks/.OwlBot.yaml b/Notebooks/.OwlBot.yaml index 2d69b69eeaf2..00c8349f0880 100644 --- a/Notebooks/.OwlBot.yaml +++ b/Notebooks/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/notebooks/(v1|v1beta1|v2)/.*-php/(.*) + - source: /google/cloud/notebooks/(v2|v1)/.*-php/(.*) dest: /owl-bot-staging/Notebooks/$1/$2 api-name: Notebooks diff --git a/Notebooks/.repo-metadata.json b/Notebooks/.repo-metadata.json deleted file mode 100644 index a6ad96856704..000000000000 --- a/Notebooks/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-notebooks", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-notebooks/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "notebooks" -} diff --git a/Notebooks/README.md b/Notebooks/README.md index a8cd01275c58..6439f55bb670 100644 --- a/Notebooks/README.md +++ b/Notebooks/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/Notebooks/VERSION b/Notebooks/VERSION index f38fc5393ff6..8bd6ba8c5c36 100644 --- a/Notebooks/VERSION +++ b/Notebooks/VERSION @@ -1 +1 @@ -0.7.3 +0.7.5 diff --git a/Notebooks/composer.json b/Notebooks/composer.json index 7df6caef592a..218f0510c8d7 100644 --- a/Notebooks/composer.json +++ b/Notebooks/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Notebooks/metadata/V1Beta1/Environment.php b/Notebooks/metadata/V1Beta1/Environment.php deleted file mode 100644 index ea3e0767c410194cfdec03aca56e189908117294..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1663 zcmb7^-EPw`6vx*V=;ls*bO_3jhBqdylUTw4agj2h-AC68whE02p-7dRxSb)1Eyt-; zroI9Xz$5S|JjJf}6gZBP25sY`H;wFb{`UEuK;xDAx;{3RBLi4Z?r2#T zF1ZB-k8u8U2ssuJ4;t#;vA`tzvM=G*WW?Sh*mGO>1dRygmNl(vDsolod#wBU&siCc zBO===kk2kZQDNM8O*FKo>t>Ahk{i0}9dIok;93C|>T|8qS+i8V3+7!CG7pV= zYO5G;RTn_T)dM1DtX5Ks4KO?Md&EaWT)QDxD$ndSGr&8agM(=$?3M%H%<#%FC~G8= zd|BsD`%#puI(*s<3GW`5PecaDC*C+|$o@>L46dv7m6zb=@0hCh0pM6-BJzok^Cwh5 zNuXg(HM(_H04uV<6wehy*t(qq(2c#MTln-g2~Gzt>V6q%{GGwkln_If+TFQYT7GrcRM8$GHKI#I|gQ zj#a$uVIO8+V{iKgdziH6eu!!3UfW41bWn{KoO93loj>>7^XHpy-6I!16YJEbo)OT# z*gF-2BPzO{6F8rfO?|oj9hC-y`m`A8lu|JM7gGD4^Y&1#-2&b;-TXl4r$38 zI^%xHb^_XSoMXRqvfZPBv0bukKQL^Q7CAD2ZH%bz8YUI%&B`le=^KI3t#goWm4S5C z7^K_Tt}u|N0Oru}eNlg|EXNj^Km*O&{6Y*d8Sm$=gAsTp#%48HP%t1}#SW-v8^dmm`le^Of#WriwOl@= z!6cN7viU`%mcdyAaWk~BT)trBGcoYSbXL14dNde&_ET;*12~&}buS5;YQ3*D85Y%)+GJ*t$X! zodzb7xF1RIM}e7D3S#d=hQdDySi_s4-U;TmV@rbpyVFymgJ3$gKORvXjfju+;MAo; zLQHJtcAgaf+mYfWutg2!E2+Pw1j$3{n4Str#99m~YcPLe49C=B)sZx%q2?204OS%e^*Lga2(TW>RnMKI3V#yF z#Lu0qLYmbL?jg4-MV>VPO!`EP&(|EaDaabgGX%OPGsenj&{$B`%D*^9GIZ zh50zRY4QoIu&cF9svD;1jO{>J;BdELX=Ip3XmxnwnHVuiIzW(@VyQN;D(UFmz&aEb zks-TNzRIaM&_!tqfsP^qslXhoT~q*s%3U3w2~?X&u?$L)4Itdx;ZQ$x$9mthPN*kj z5impU!7X#_2hM2bNOz6kNLXUd5fyUSPy)Sg`NyHt%iNIdYx`6~$vD5$sBd+O=VPPL z4|_rmAydrOG}FgA(u}^_|5x7>FV?p))hEK5?ciG;IVV(~a0+*jBNJM504v;iYMb7v z%c_B}!cF@6qe380#6#G1SU4W}I(zJSgyYXDjqiC0%?TT;Zn?rLvx6lhqw-8Q_vvqAG)iUEeO5l52pDn;fRG@`V5j4B=_$ts# ziZHvD1i1q_)37o0`oQtt7+znvkBB@K5@Z*$rbqEz>8xJ}pKx6pv97q86eq2eL8h40 z*u~U}q=aipZ8)%cu^Q|_I{1iIGbsi$NW5(joah{nVwqyajWwIp#v{ni-g!1`M69VT zl4Y3VJt*u;<>ZsZMhTYBU+onFg%!&T0aM727B9#&Lm9vr&uh&Cy|a^_pL{>gFBE=Hz#Om6%-*&pY45l1CCDJTr73D1 zea*vCv(@M*ZS3QWl4M{~RZ}`L`o?)1%_ciZlPoN>HT;EBz#RKg!_aE@V;*mC@t|36 zNj1i}z(5sM(G+Q4`GHX~WCgMj_#;6sZ~RF(0E2@*U*vhup;eCY863K1sQS-bXqIPeYnG+WwqLR-DI=O zd$Udk()CyJOGL)6D*H+np2I>^EZBrIGaKouQsq|Skc9qq6by1hS7i;w7h$g6!Sj5w z+;}JL!-MGz8cuXLdHO|M$V&0EBHf4h=6|GS;FsP;UuTnz3u(OT;&yXZS%&P)6k7Q! z0R=>gE5`?B-pX>UsmV5=X5xqMLe6-?L|YD>nWYacjQ75Y@ow+w%=d4}dv(6+75NrX zRO4N*80~t0#0=eN8=P4OaUbMM<-6pA5Tsn@DCP15rd*DAdh@&-K7Ke^489CEt(nD) T4K|i}$x_BS!`0~w&H(-enV+7Y diff --git a/Notebooks/metadata/V1Beta1/Service.php b/Notebooks/metadata/V1Beta1/Service.php deleted file mode 100644 index 388980ecae6b..000000000000 --- a/Notebooks/metadata/V1Beta1/Service.php +++ /dev/null @@ -1,153 +0,0 @@ -internalAddGeneratedFile( - ' -ˆ6 -,google/cloud/notebooks/v1beta1/service.protogoogle.cloud.notebooks.v1beta1google/api/client.protogoogle/api/field_behavior.proto0google/cloud/notebooks/v1beta1/environment.proto-google/cloud/notebooks/v1beta1/instance.proto#google/longrunning/operations.protogoogle/protobuf/timestamp.proto"ï -OperationMetadata/ - create_time ( 2.google.protobuf.Timestamp, -end_time ( 2.google.protobuf.Timestamp -target (  -verb (  -status_message (  -requested_cancellation ( - api_version (  -endpoint ( "R -ListInstancesRequest -parent ( BàA - page_size ( - -page_token ( "‚ -ListInstancesResponse; - instances ( 2(.google.cloud.notebooks.v1beta1.Instance -next_page_token (  - unreachable ( "\' -GetInstanceRequest -name ( BàA"‡ -CreateInstanceRequest -parent ( BàA - instance_id ( BàA? -instance ( 2(.google.cloud.notebooks.v1beta1.InstanceBàA"H -RegisterInstanceRequest -parent ( BàA - instance_id ( BàA"˜ -SetInstanceAcceleratorRequest -name ( BàAK -type (28.google.cloud.notebooks.v1beta1.Instance.AcceleratorTypeBàA - -core_count (BàA"M -SetInstanceMachineTypeRequest -name ( BàA - machine_type ( BàA"² -SetInstanceLabelsRequest -name ( BàAT -labels ( 2D.google.cloud.notebooks.v1beta1.SetInstanceLabelsRequest.LabelsEntry- - LabelsEntry -key (  -value ( :8"* -DeleteInstanceRequest -name ( BàA") -StartInstanceRequest -name ( BàA"( -StopInstanceRequest -name ( BàA") -ResetInstanceRequest -name ( BàA"Î -ReportInstanceInfoRequest -name ( BàA -vm_id ( BàAY -metadata ( 2G.google.cloud.notebooks.v1beta1.ReportInstanceInfoRequest.MetadataEntry/ - MetadataEntry -key (  -value ( :8"> -IsInstanceUpgradeableRequest -notebook_instance ( BàA"z -IsInstanceUpgradeableResponse - upgradeable ( -upgrade_version (  - upgrade_info (  - upgrade_image ( "+ -UpgradeInstanceRequest -name ( BàA"G -UpgradeInstanceInternalRequest -name ( BàA -vm_id ( BàA"U -ListEnvironmentsRequest -parent ( BàA - page_size ( - -page_token ( "‹ -ListEnvironmentsResponseA - environments ( 2+.google.cloud.notebooks.v1beta1.Environment -next_page_token (  - unreachable ( "* -GetEnvironmentRequest -name ( BàA"“ -CreateEnvironmentRequest -parent ( BàA -environment_id ( BàAE - environment ( 2+.google.cloud.notebooks.v1beta1.EnvironmentBàA"- -DeleteEnvironmentRequest -name ( BàA2 -NotebookService¸ - ListInstances4.google.cloud.notebooks.v1beta1.ListInstancesRequest5.google.cloud.notebooks.v1beta1.ListInstancesResponse":‚Óä“42/v1beta1/{parent=projects/*/locations/*}/instances§ - GetInstance2.google.cloud.notebooks.v1beta1.GetInstanceRequest(.google.cloud.notebooks.v1beta1.Instance":‚Óä“42/v1beta1/{name=projects/*/locations/*/instances/*}Ì -CreateInstance5.google.cloud.notebooks.v1beta1.CreateInstanceRequest.google.longrunning.Operation"dÊA -InstanceOperationMetadata‚Óä“>"2/v1beta1/{parent=projects/*/locations/*}/instances:instanceÒ -RegisterInstance7.google.cloud.notebooks.v1beta1.RegisterInstanceRequest.google.longrunning.Operation"fÊA -InstanceOperationMetadata‚Óä“@";/v1beta1/{parent=projects/*/locations/*}/instances:register:*ä -SetInstanceAccelerator=.google.cloud.notebooks.v1beta1.SetInstanceAcceleratorRequest.google.longrunning.Operation"lÊA -InstanceOperationMetadata‚Óä“F2A/v1beta1/{name=projects/*/locations/*/instances/*}:setAccelerator:*ä -SetInstanceMachineType=.google.cloud.notebooks.v1beta1.SetInstanceMachineTypeRequest.google.longrunning.Operation"lÊA -InstanceOperationMetadata‚Óä“F2A/v1beta1/{name=projects/*/locations/*/instances/*}:setMachineType:*Õ -SetInstanceLabels8.google.cloud.notebooks.v1beta1.SetInstanceLabelsRequest.google.longrunning.Operation"gÊA -InstanceOperationMetadata‚Óä“A2"9/v1beta1/{name=projects/*/locations/*/instances/*}:report:*î -IsInstanceUpgradeable<.google.cloud.notebooks.v1beta1.IsInstanceUpgradeableRequest=.google.cloud.notebooks.v1beta1.IsInstanceUpgradeableResponse"Xˆ‚Óä“OM/v1beta1/{notebook_instance=projects/*/locations/*/instances/*}:isUpgradeableÒ -UpgradeInstance6.google.cloud.notebooks.v1beta1.UpgradeInstanceRequest.google.longrunning.Operation"hˆÊA -InstanceOperationMetadata‚Óä“?":/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade:*ê -UpgradeInstanceInternal>.google.cloud.notebooks.v1beta1.UpgradeInstanceInternalRequest.google.longrunning.Operation"pˆÊA -InstanceOperationMetadata‚Óä“G"B/v1beta1/{name=projects/*/locations/*/instances/*}:upgradeInternal:*Ä -ListEnvironments7.google.cloud.notebooks.v1beta1.ListEnvironmentsRequest8.google.cloud.notebooks.v1beta1.ListEnvironmentsResponse"=‚Óä“75/v1beta1/{parent=projects/*/locations/*}/environments³ -GetEnvironment5.google.cloud.notebooks.v1beta1.GetEnvironmentRequest+.google.cloud.notebooks.v1beta1.Environment"=‚Óä“75/v1beta1/{name=projects/*/locations/*/environments/*}Û -CreateEnvironment8.google.cloud.notebooks.v1beta1.CreateEnvironmentRequest.google.longrunning.Operation"mÊA - EnvironmentOperationMetadata‚Óä“D"5/v1beta1/{parent=projects/*/locations/*}/environments: environmentØ -DeleteEnvironment8.google.cloud.notebooks.v1beta1.DeleteEnvironmentRequest.google.longrunning.Operation"jÊA* -google.protobuf.EmptyOperationMetadata‚Óä“7*5/v1beta1/{name=projects/*/locations/*/environments/*}LÊAnotebooks.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBÞ -"com.google.cloud.notebooks.v1beta1BNotebooksProtoPZ@cloud.google.com/go/notebooks/apiv1beta1/notebookspb;notebookspbªGoogle.Cloud.Notebooks.V1Beta1ÊGoogle\\Cloud\\Notebooks\\V1beta1ê!Google::Cloud::Notebooks::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/Notebooks/owlbot.py b/Notebooks/owlbot.py index 8505efd3a495..527e42784e37 100644 --- a/Notebooks/owlbot.py +++ b/Notebooks/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,34 +32,25 @@ php.owlbot_main(src=src, dest=dest) -# Change the wording for the deprecation warning. +# remove class_alias code s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/Notebooks/src/V1/Client/ManagedNotebookServiceClient.php b/Notebooks/src/V1/Client/ManagedNotebookServiceClient.php index f10302b38158..f373975d269a 100644 --- a/Notebooks/src/V1/Client/ManagedNotebookServiceClient.php +++ b/Notebooks/src/V1/Client/ManagedNotebookServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -458,8 +477,10 @@ public function listRuntimes(ListRuntimesRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function refreshRuntimeTokenInternal(RefreshRuntimeTokenInternalRequest $request, array $callOptions = []): RefreshRuntimeTokenInternalResponse - { + public function refreshRuntimeTokenInternal( + RefreshRuntimeTokenInternalRequest $request, + array $callOptions = [] + ): RefreshRuntimeTokenInternalResponse { return $this->startApiCall('RefreshRuntimeTokenInternal', $request, $callOptions)->wait(); } @@ -792,8 +813,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/Notebooks/src/V1/Client/NotebookServiceClient.php b/Notebooks/src/V1/Client/NotebookServiceClient.php index 196bc6fc83d6..744311d10c83 100644 --- a/Notebooks/src/V1/Client/NotebookServiceClient.php +++ b/Notebooks/src/V1/Client/NotebookServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a environment * resource. @@ -741,8 +760,10 @@ public function getInstance(GetInstanceRequest $request, array $callOptions = [] * * @throws ApiException Thrown if the API call fails. */ - public function getInstanceHealth(GetInstanceHealthRequest $request, array $callOptions = []): GetInstanceHealthResponse - { + public function getInstanceHealth( + GetInstanceHealthRequest $request, + array $callOptions = [] + ): GetInstanceHealthResponse { return $this->startApiCall('GetInstanceHealth', $request, $callOptions)->wait(); } @@ -794,8 +815,10 @@ public function getSchedule(GetScheduleRequest $request, array $callOptions = [] * * @throws ApiException Thrown if the API call fails. */ - public function isInstanceUpgradeable(IsInstanceUpgradeableRequest $request, array $callOptions = []): IsInstanceUpgradeableResponse - { + public function isInstanceUpgradeable( + IsInstanceUpgradeableRequest $request, + array $callOptions = [] + ): IsInstanceUpgradeableResponse { return $this->startApiCall('IsInstanceUpgradeable', $request, $callOptions)->wait(); } @@ -1035,8 +1058,10 @@ public function rollbackInstance(RollbackInstanceRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function setInstanceAccelerator(SetInstanceAcceleratorRequest $request, array $callOptions = []): OperationResponse - { + public function setInstanceAccelerator( + SetInstanceAcceleratorRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('SetInstanceAccelerator', $request, $callOptions)->wait(); } @@ -1088,8 +1113,10 @@ public function setInstanceLabels(SetInstanceLabelsRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function setInstanceMachineType(SetInstanceMachineTypeRequest $request, array $callOptions = []): OperationResponse - { + public function setInstanceMachineType( + SetInstanceMachineTypeRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('SetInstanceMachineType', $request, $callOptions)->wait(); } @@ -1192,8 +1219,10 @@ public function triggerSchedule(TriggerScheduleRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function updateInstanceConfig(UpdateInstanceConfigRequest $request, array $callOptions = []): OperationResponse - { + public function updateInstanceConfig( + UpdateInstanceConfigRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateInstanceConfig', $request, $callOptions)->wait(); } @@ -1219,8 +1248,10 @@ public function updateInstanceConfig(UpdateInstanceConfigRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function updateInstanceMetadataItems(UpdateInstanceMetadataItemsRequest $request, array $callOptions = []): UpdateInstanceMetadataItemsResponse - { + public function updateInstanceMetadataItems( + UpdateInstanceMetadataItemsRequest $request, + array $callOptions = [] + ): UpdateInstanceMetadataItemsResponse { return $this->startApiCall('UpdateInstanceMetadataItems', $request, $callOptions)->wait(); } @@ -1246,8 +1277,10 @@ public function updateInstanceMetadataItems(UpdateInstanceMetadataItemsRequest $ * * @throws ApiException Thrown if the API call fails. */ - public function updateShieldedInstanceConfig(UpdateShieldedInstanceConfigRequest $request, array $callOptions = []): OperationResponse - { + public function updateShieldedInstanceConfig( + UpdateShieldedInstanceConfigRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateShieldedInstanceConfig', $request, $callOptions)->wait(); } @@ -1300,8 +1333,10 @@ public function upgradeInstance(UpgradeInstanceRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function upgradeInstanceInternal(UpgradeInstanceInternalRequest $request, array $callOptions = []): OperationResponse - { + public function upgradeInstanceInternal( + UpgradeInstanceInternalRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpgradeInstanceInternal', $request, $callOptions)->wait(); } @@ -1441,8 +1476,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/Notebooks/src/V1/ContainerImage.php b/Notebooks/src/V1/ContainerImage.php index a0a191dda14c..e5e167882f71 100644 --- a/Notebooks/src/V1/ContainerImage.php +++ b/Notebooks/src/V1/ContainerImage.php @@ -22,14 +22,14 @@ class ContainerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository = ''; + protected $repository = ''; /** * The tag of the container image. If not specified, this defaults * to the latest tag. * * Generated from protobuf field string tag = 2; */ - private $tag = ''; + protected $tag = ''; /** * Constructor. diff --git a/Notebooks/src/V1/CreateEnvironmentRequest.php b/Notebooks/src/V1/CreateEnvironmentRequest.php index 211ea5559fb1..ec9ffc493c20 100644 --- a/Notebooks/src/V1/CreateEnvironmentRequest.php +++ b/Notebooks/src/V1/CreateEnvironmentRequest.php @@ -20,7 +20,7 @@ class CreateEnvironmentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parent = ''; + protected $parent = ''; /** * Required. User-defined unique ID of this environment. The `environment_id` must * be 1 to 63 characters long and contain only lowercase letters, @@ -29,13 +29,13 @@ class CreateEnvironmentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $environment_id = ''; + protected $environment_id = ''; /** * Required. The environment to be created. * * Generated from protobuf field .google.cloud.notebooks.v1.Environment environment = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $environment = null; + protected $environment = null; /** * @param string $parent Required. Format: `projects/{project_id}/locations/{location}` diff --git a/Notebooks/src/V1/CreateExecutionRequest.php b/Notebooks/src/V1/CreateExecutionRequest.php index 16165b453b06..1a9830086a8e 100644 --- a/Notebooks/src/V1/CreateExecutionRequest.php +++ b/Notebooks/src/V1/CreateExecutionRequest.php @@ -21,19 +21,19 @@ class CreateExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. User-defined unique ID of this execution. * * Generated from protobuf field string execution_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $execution_id = ''; + protected $execution_id = ''; /** * Required. The execution to be created. * * Generated from protobuf field .google.cloud.notebooks.v1.Execution execution = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $execution = null; + protected $execution = null; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V1/CreateInstanceRequest.php b/Notebooks/src/V1/CreateInstanceRequest.php index 07ef4667cfaa..939cf437387c 100644 --- a/Notebooks/src/V1/CreateInstanceRequest.php +++ b/Notebooks/src/V1/CreateInstanceRequest.php @@ -21,19 +21,19 @@ class CreateInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parent = ''; + protected $parent = ''; /** * Required. User-defined unique ID of this instance. * * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance_id = ''; + protected $instance_id = ''; /** * Required. The instance to be created. * * Generated from protobuf field .google.cloud.notebooks.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance = null; + protected $instance = null; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V1/CreateRuntimeRequest.php b/Notebooks/src/V1/CreateRuntimeRequest.php index c06e131f6740..e243650c684a 100644 --- a/Notebooks/src/V1/CreateRuntimeRequest.php +++ b/Notebooks/src/V1/CreateRuntimeRequest.php @@ -21,25 +21,25 @@ class CreateRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. User-defined unique ID of this Runtime. * * Generated from protobuf field string runtime_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $runtime_id = ''; + protected $runtime_id = ''; /** * Required. The Runtime to be created. * * Generated from protobuf field .google.cloud.notebooks.v1.Runtime runtime = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $runtime = null; + protected $runtime = null; /** * Idempotent request UUID. * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V1/CreateScheduleRequest.php b/Notebooks/src/V1/CreateScheduleRequest.php index 76f5e8286a68..888985827ce4 100644 --- a/Notebooks/src/V1/CreateScheduleRequest.php +++ b/Notebooks/src/V1/CreateScheduleRequest.php @@ -21,19 +21,19 @@ class CreateScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. User-defined unique ID of this schedule. * * Generated from protobuf field string schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $schedule_id = ''; + protected $schedule_id = ''; /** * Required. The schedule to be created. * * Generated from protobuf field .google.cloud.notebooks.v1.Schedule schedule = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $schedule = null; + protected $schedule = null; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V1/DeleteEnvironmentRequest.php b/Notebooks/src/V1/DeleteEnvironmentRequest.php index 5662061e52a9..5e6b4395d2c5 100644 --- a/Notebooks/src/V1/DeleteEnvironmentRequest.php +++ b/Notebooks/src/V1/DeleteEnvironmentRequest.php @@ -21,7 +21,7 @@ class DeleteEnvironmentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/DeleteExecutionRequest.php b/Notebooks/src/V1/DeleteExecutionRequest.php index 6cb3ee758db0..6435f7ee1ac0 100644 --- a/Notebooks/src/V1/DeleteExecutionRequest.php +++ b/Notebooks/src/V1/DeleteExecutionRequest.php @@ -21,7 +21,7 @@ class DeleteExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/DeleteInstanceRequest.php b/Notebooks/src/V1/DeleteInstanceRequest.php index 8cbe9bf3aec2..0cfd481b0578 100644 --- a/Notebooks/src/V1/DeleteInstanceRequest.php +++ b/Notebooks/src/V1/DeleteInstanceRequest.php @@ -21,7 +21,7 @@ class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/DeleteRuntimeRequest.php b/Notebooks/src/V1/DeleteRuntimeRequest.php index 9c9ac56f8f51..0235ff0c569f 100644 --- a/Notebooks/src/V1/DeleteRuntimeRequest.php +++ b/Notebooks/src/V1/DeleteRuntimeRequest.php @@ -21,13 +21,13 @@ class DeleteRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Idempotent request UUID. * * Generated from protobuf field string request_id = 2; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/DeleteScheduleRequest.php b/Notebooks/src/V1/DeleteScheduleRequest.php index 5ca09e55dfba..b39703383d85 100644 --- a/Notebooks/src/V1/DeleteScheduleRequest.php +++ b/Notebooks/src/V1/DeleteScheduleRequest.php @@ -21,7 +21,7 @@ class DeleteScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/DiagnoseInstanceRequest.php b/Notebooks/src/V1/DiagnoseInstanceRequest.php index 19d4cc985b53..3d75ec3995b2 100644 --- a/Notebooks/src/V1/DiagnoseInstanceRequest.php +++ b/Notebooks/src/V1/DiagnoseInstanceRequest.php @@ -21,13 +21,13 @@ class DiagnoseInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. Defines flags that are used to run the diagnostic tool * * Generated from protobuf field .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $diagnostic_config = null; + protected $diagnostic_config = null; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/DiagnoseRuntimeRequest.php b/Notebooks/src/V1/DiagnoseRuntimeRequest.php index 69952bf55086..3a76ddd8406b 100644 --- a/Notebooks/src/V1/DiagnoseRuntimeRequest.php +++ b/Notebooks/src/V1/DiagnoseRuntimeRequest.php @@ -21,13 +21,13 @@ class DiagnoseRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. Defines flags that are used to run the diagnostic tool * * Generated from protobuf field .google.cloud.notebooks.v1.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $diagnostic_config = null; + protected $diagnostic_config = null; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/DiagnosticConfig.php b/Notebooks/src/V1/DiagnosticConfig.php index bdbbe603512c..9e051f4082f2 100644 --- a/Notebooks/src/V1/DiagnosticConfig.php +++ b/Notebooks/src/V1/DiagnosticConfig.php @@ -30,7 +30,7 @@ class DiagnosticConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $gcs_bucket = ''; + protected $gcs_bucket = ''; /** * Optional. Defines the relative storage path in the Cloud Storage bucket * where the diagnostic logs will be written: Default path will be the root @@ -41,25 +41,25 @@ class DiagnosticConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $relative_path = ''; + protected $relative_path = ''; /** * Optional. Enables flag to repair service for instance * * Generated from protobuf field bool repair_flag_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $repair_flag_enabled = false; + protected $repair_flag_enabled = false; /** * Optional. Enables flag to capture packets from the instance for 30 seconds * * Generated from protobuf field bool packet_capture_flag_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $packet_capture_flag_enabled = false; + protected $packet_capture_flag_enabled = false; /** * Optional. Enables flag to copy all `/home/jupyter` folder contents * * Generated from protobuf field bool copy_home_files_flag_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $copy_home_files_flag_enabled = false; + protected $copy_home_files_flag_enabled = false; /** * Constructor. diff --git a/Notebooks/src/V1/EncryptionConfig.php b/Notebooks/src/V1/EncryptionConfig.php index dd2e45342146..0c4d23f850e9 100644 --- a/Notebooks/src/V1/EncryptionConfig.php +++ b/Notebooks/src/V1/EncryptionConfig.php @@ -24,7 +24,7 @@ class EncryptionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key = 1; */ - private $kms_key = ''; + protected $kms_key = ''; /** * Constructor. diff --git a/Notebooks/src/V1/Environment.php b/Notebooks/src/V1/Environment.php index 93d72bd7cb67..acba5f6f762f 100644 --- a/Notebooks/src/V1/Environment.php +++ b/Notebooks/src/V1/Environment.php @@ -23,19 +23,19 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Display name of this environment for the UI. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * A brief description of this environment. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Path to a Bash script that automatically runs after a notebook instance * fully boots up. The path must be a URL or @@ -43,13 +43,13 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string post_startup_script = 8; */ - private $post_startup_script = ''; + protected $post_startup_script = ''; /** * Output only. The time at which this environment was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; protected $image_type; /** diff --git a/Notebooks/src/V1/Event.php b/Notebooks/src/V1/Event.php index 0d4d07125885..e283621af63c 100644 --- a/Notebooks/src/V1/Event.php +++ b/Notebooks/src/V1/Event.php @@ -20,13 +20,13 @@ class Event extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp report_time = 1; */ - private $report_time = null; + protected $report_time = null; /** * Event type. * * Generated from protobuf field .google.cloud.notebooks.v1.Event.EventType type = 2; */ - private $type = 0; + protected $type = 0; /** * Optional. Event details. This field is used to pass event information. * diff --git a/Notebooks/src/V1/Event/EventType.php b/Notebooks/src/V1/Event/EventType.php index 40fde28d60fd..7483230ee0f7 100644 --- a/Notebooks/src/V1/Event/EventType.php +++ b/Notebooks/src/V1/Event/EventType.php @@ -79,6 +79,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EventType::class, \Google\Cloud\Notebooks\V1\Event_EventType::class); diff --git a/Notebooks/src/V1/Execution.php b/Notebooks/src/V1/Execution.php index bde64db5ee91..df7bc7abdea9 100644 --- a/Notebooks/src/V1/Execution.php +++ b/Notebooks/src/V1/Execution.php @@ -20,57 +20,57 @@ class Execution extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.ExecutionTemplate execution_template = 1; */ - private $execution_template = null; + protected $execution_template = null; /** * Output only. The resource name of the execute. Format: * `projects/{project_id}/locations/{location}/executions/{execution_id}` * * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Name used for UI purposes. * Name can only contain alphanumeric characters and underscores '_'. * * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $display_name = ''; + protected $display_name = ''; /** * A brief description of this execution. * * Generated from protobuf field string description = 4; */ - private $description = ''; + protected $description = ''; /** * Output only. Time the Execution was instantiated. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time the Execution was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. State of the underlying AI Platform job. * * Generated from protobuf field .google.cloud.notebooks.v1.Execution.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output notebook file generated by this execution * * Generated from protobuf field string output_notebook_file = 8; */ - private $output_notebook_file = ''; + protected $output_notebook_file = ''; /** * Output only. The URI of the external job used to execute the notebook. * * Generated from protobuf field string job_uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $job_uri = ''; + protected $job_uri = ''; /** * Constructor. diff --git a/Notebooks/src/V1/Execution/State.php b/Notebooks/src/V1/Execution/State.php index 5aee6d68273a..20298fd7cd9c 100644 --- a/Notebooks/src/V1/Execution/State.php +++ b/Notebooks/src/V1/Execution/State.php @@ -112,6 +112,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Notebooks\V1\Execution_State::class); diff --git a/Notebooks/src/V1/ExecutionTemplate.php b/Notebooks/src/V1/ExecutionTemplate.php index c41231015ea9..ef49f88b9317 100644 --- a/Notebooks/src/V1/ExecutionTemplate.php +++ b/Notebooks/src/V1/ExecutionTemplate.php @@ -68,14 +68,14 @@ class ExecutionTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string master_type = 2; */ - private $master_type = ''; + protected $master_type = ''; /** * Configuration (count and accelerator type) for hardware running notebook * execution. * * Generated from protobuf field .google.cloud.notebooks.v1.ExecutionTemplate.SchedulerAcceleratorConfig accelerator_config = 3; */ - private $accelerator_config = null; + protected $accelerator_config = null; /** * Labels for execution. * If execution is scheduled, a field included will be 'nbs-scheduled'. @@ -94,7 +94,7 @@ class ExecutionTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string input_notebook_file = 5; */ - private $input_notebook_file = ''; + protected $input_notebook_file = ''; /** * Container Image URI to a DLVM * Example: 'gcr.io/deeplearning-platform-release/base-cu100' @@ -103,7 +103,7 @@ class ExecutionTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string container_image_uri = 6; */ - private $container_image_uri = ''; + protected $container_image_uri = ''; /** * Path to the notebook folder to write to. * Must be in a Google Cloud Storage bucket path. @@ -112,7 +112,7 @@ class ExecutionTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string output_notebook_folder = 7; */ - private $output_notebook_folder = ''; + protected $output_notebook_folder = ''; /** * Parameters to be overridden in the notebook during execution. * Ref https://papermill.readthedocs.io/en/latest/usage-parameterize.html on @@ -122,13 +122,13 @@ class ExecutionTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string params_yaml_file = 8; */ - private $params_yaml_file = ''; + protected $params_yaml_file = ''; /** * Parameters used within the 'input_notebook_file' notebook. * * Generated from protobuf field string parameters = 9; */ - private $parameters = ''; + protected $parameters = ''; /** * The email address of a service account to use when running the execution. * You must have the `iam.serviceAccounts.actAs` permission for the specified @@ -136,13 +136,13 @@ class ExecutionTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 10; */ - private $service_account = ''; + protected $service_account = ''; /** * The type of Job to be used on this execution. * * Generated from protobuf field .google.cloud.notebooks.v1.ExecutionTemplate.JobType job_type = 11; */ - private $job_type = 0; + protected $job_type = 0; /** * Name of the kernel spec to use. This must be specified if the * kernel spec name on the execution target does not match the name in the @@ -150,7 +150,7 @@ class ExecutionTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kernel_spec = 14; */ - private $kernel_spec = ''; + protected $kernel_spec = ''; /** * The name of a Vertex AI [Tensorboard] resource to which this execution * will upload Tensorboard logs. @@ -159,7 +159,7 @@ class ExecutionTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tensorboard = 15 [(.google.api.resource_reference) = { */ - private $tensorboard = ''; + protected $tensorboard = ''; protected $job_parameters; /** diff --git a/Notebooks/src/V1/ExecutionTemplate/DataprocParameters.php b/Notebooks/src/V1/ExecutionTemplate/DataprocParameters.php index cd996687fcbd..1893292ab9af 100644 --- a/Notebooks/src/V1/ExecutionTemplate/DataprocParameters.php +++ b/Notebooks/src/V1/ExecutionTemplate/DataprocParameters.php @@ -21,7 +21,7 @@ class DataprocParameters extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string cluster = 1; */ - private $cluster = ''; + protected $cluster = ''; /** * Constructor. @@ -69,6 +69,4 @@ public function setCluster($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DataprocParameters::class, \Google\Cloud\Notebooks\V1\ExecutionTemplate_DataprocParameters::class); diff --git a/Notebooks/src/V1/ExecutionTemplate/JobType.php b/Notebooks/src/V1/ExecutionTemplate/JobType.php index 7977f67eb20a..d6885eb20b1b 100644 --- a/Notebooks/src/V1/ExecutionTemplate/JobType.php +++ b/Notebooks/src/V1/ExecutionTemplate/JobType.php @@ -61,6 +61,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(JobType::class, \Google\Cloud\Notebooks\V1\ExecutionTemplate_JobType::class); diff --git a/Notebooks/src/V1/ExecutionTemplate/ScaleTier.php b/Notebooks/src/V1/ExecutionTemplate/ScaleTier.php index be85f68c19bd..ea59e2ce5b6a 100644 --- a/Notebooks/src/V1/ExecutionTemplate/ScaleTier.php +++ b/Notebooks/src/V1/ExecutionTemplate/ScaleTier.php @@ -94,6 +94,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ScaleTier::class, \Google\Cloud\Notebooks\V1\ExecutionTemplate_ScaleTier::class); diff --git a/Notebooks/src/V1/ExecutionTemplate/SchedulerAcceleratorConfig.php b/Notebooks/src/V1/ExecutionTemplate/SchedulerAcceleratorConfig.php index 15a0531cc3ec..4fdc477bacaa 100644 --- a/Notebooks/src/V1/ExecutionTemplate/SchedulerAcceleratorConfig.php +++ b/Notebooks/src/V1/ExecutionTemplate/SchedulerAcceleratorConfig.php @@ -23,13 +23,13 @@ class SchedulerAcceleratorConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.ExecutionTemplate.SchedulerAcceleratorType type = 1; */ - private $type = 0; + protected $type = 0; /** * Count of cores of this accelerator. * * Generated from protobuf field int64 core_count = 2; */ - private $core_count = 0; + protected $core_count = 0; /** * Constructor. @@ -102,6 +102,4 @@ public function setCoreCount($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SchedulerAcceleratorConfig::class, \Google\Cloud\Notebooks\V1\ExecutionTemplate_SchedulerAcceleratorConfig::class); diff --git a/Notebooks/src/V1/ExecutionTemplate/SchedulerAcceleratorType.php b/Notebooks/src/V1/ExecutionTemplate/SchedulerAcceleratorType.php index 63a5af02a0c9..290584532661 100644 --- a/Notebooks/src/V1/ExecutionTemplate/SchedulerAcceleratorType.php +++ b/Notebooks/src/V1/ExecutionTemplate/SchedulerAcceleratorType.php @@ -101,6 +101,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SchedulerAcceleratorType::class, \Google\Cloud\Notebooks\V1\ExecutionTemplate_SchedulerAcceleratorType::class); diff --git a/Notebooks/src/V1/ExecutionTemplate/VertexAIParameters.php b/Notebooks/src/V1/ExecutionTemplate/VertexAIParameters.php index 824d333a64cd..34f47048d3c8 100644 --- a/Notebooks/src/V1/ExecutionTemplate/VertexAIParameters.php +++ b/Notebooks/src/V1/ExecutionTemplate/VertexAIParameters.php @@ -29,7 +29,7 @@ class VertexAIParameters extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 1; */ - private $network = ''; + protected $network = ''; /** * Environment variables. * At most 100 environment variables can be specified and unique. @@ -143,6 +143,4 @@ public function setEnv($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(VertexAIParameters::class, \Google\Cloud\Notebooks\V1\ExecutionTemplate_VertexAIParameters::class); diff --git a/Notebooks/src/V1/GetEnvironmentRequest.php b/Notebooks/src/V1/GetEnvironmentRequest.php index d7aed02e822a..62e81c7994b0 100644 --- a/Notebooks/src/V1/GetEnvironmentRequest.php +++ b/Notebooks/src/V1/GetEnvironmentRequest.php @@ -21,7 +21,7 @@ class GetEnvironmentRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/GetExecutionRequest.php b/Notebooks/src/V1/GetExecutionRequest.php index 1312983d32f1..b4da531db6e5 100644 --- a/Notebooks/src/V1/GetExecutionRequest.php +++ b/Notebooks/src/V1/GetExecutionRequest.php @@ -21,7 +21,7 @@ class GetExecutionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/GetInstanceHealthRequest.php b/Notebooks/src/V1/GetInstanceHealthRequest.php index c3162bc937e4..362418036f21 100644 --- a/Notebooks/src/V1/GetInstanceHealthRequest.php +++ b/Notebooks/src/V1/GetInstanceHealthRequest.php @@ -21,7 +21,7 @@ class GetInstanceHealthRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/GetInstanceHealthResponse.php b/Notebooks/src/V1/GetInstanceHealthResponse.php index b293d515adbd..70d662501f62 100644 --- a/Notebooks/src/V1/GetInstanceHealthResponse.php +++ b/Notebooks/src/V1/GetInstanceHealthResponse.php @@ -20,7 +20,7 @@ class GetInstanceHealthResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.GetInstanceHealthResponse.HealthState health_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $health_state = 0; + protected $health_state = 0; /** * Output only. Additional information about instance health. * Example: diff --git a/Notebooks/src/V1/GetInstanceHealthResponse/HealthState.php b/Notebooks/src/V1/GetInstanceHealthResponse/HealthState.php index 5ecda3012ea2..aa89d90dd0a2 100644 --- a/Notebooks/src/V1/GetInstanceHealthResponse/HealthState.php +++ b/Notebooks/src/V1/GetInstanceHealthResponse/HealthState.php @@ -79,6 +79,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HealthState::class, \Google\Cloud\Notebooks\V1\GetInstanceHealthResponse_HealthState::class); diff --git a/Notebooks/src/V1/GetInstanceRequest.php b/Notebooks/src/V1/GetInstanceRequest.php index e4cb6a7fed79..4f5d9539fda5 100644 --- a/Notebooks/src/V1/GetInstanceRequest.php +++ b/Notebooks/src/V1/GetInstanceRequest.php @@ -21,7 +21,7 @@ class GetInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/GetRuntimeRequest.php b/Notebooks/src/V1/GetRuntimeRequest.php index 9840fa71b1de..3bf80c4ed391 100644 --- a/Notebooks/src/V1/GetRuntimeRequest.php +++ b/Notebooks/src/V1/GetRuntimeRequest.php @@ -21,7 +21,7 @@ class GetRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/GetScheduleRequest.php b/Notebooks/src/V1/GetScheduleRequest.php index 4ea7f48a3a30..46cef98735dd 100644 --- a/Notebooks/src/V1/GetScheduleRequest.php +++ b/Notebooks/src/V1/GetScheduleRequest.php @@ -21,7 +21,7 @@ class GetScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/Instance.php b/Notebooks/src/V1/Instance.php index 2a1342ffa0e0..accb7b274f41 100644 --- a/Notebooks/src/V1/Instance.php +++ b/Notebooks/src/V1/Instance.php @@ -21,7 +21,7 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Path to a Bash script that automatically runs after a notebook instance * fully boots up. The path must be a URL or @@ -29,13 +29,13 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string post_startup_script = 4; */ - private $post_startup_script = ''; + protected $post_startup_script = ''; /** * Output only. The proxy endpoint that is used to access the Jupyter notebook. * * Generated from protobuf field string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $proxy_uri = ''; + protected $proxy_uri = ''; /** * Input only. The owner of this instance after creation. Format: `alias@example.com` * Currently supports one owner only. If not specified, all of the service @@ -56,7 +56,7 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 7; */ - private $service_account = ''; + protected $service_account = ''; /** * Optional. The URIs of service account scopes to be included in * Compute Engine instances. @@ -78,7 +78,7 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string machine_type = 8 [(.google.api.field_behavior) = REQUIRED]; */ - private $machine_type = ''; + protected $machine_type = ''; /** * The hardware accelerator used on this instance. If you use * accelerators, make sure that your configuration has @@ -87,13 +87,13 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.AcceleratorConfig accelerator_config = 9; */ - private $accelerator_config = null; + protected $accelerator_config = null; /** * Output only. The state of this instance. * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Whether the end user authorizes Google Cloud to install GPU driver * on this instance. @@ -102,21 +102,21 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool install_gpu_driver = 11; */ - private $install_gpu_driver = false; + protected $install_gpu_driver = false; /** * Specify a custom Cloud Storage path where the GPU driver is stored. * If not specified, we'll automatically choose from official GPU drivers. * * Generated from protobuf field string custom_gpu_driver_path = 12; */ - private $custom_gpu_driver_path = ''; + protected $custom_gpu_driver_path = ''; /** * Input only. The type of the boot disk attached to this instance, defaults to * standard persistent disk (`PD_STANDARD`). * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.DiskType boot_disk_type = 13 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $boot_disk_type = 0; + protected $boot_disk_type = 0; /** * Input only. The size of the boot disk in GB attached to this instance, up to a maximum * of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not @@ -124,14 +124,14 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 boot_disk_size_gb = 14 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $boot_disk_size_gb = 0; + protected $boot_disk_size_gb = 0; /** * Input only. The type of the data disk attached to this instance, defaults to * standard persistent disk (`PD_STANDARD`). * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.DiskType data_disk_type = 25 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $data_disk_type = 0; + protected $data_disk_type = 0; /** * Input only. The size of the data disk in GB attached to this instance, up to a maximum * of 64000 GB (64 TB). You can choose the size of the data disk based on how @@ -139,29 +139,29 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 data_disk_size_gb = 26 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $data_disk_size_gb = 0; + protected $data_disk_size_gb = 0; /** * Input only. If true, the data disk will not be auto deleted when deleting the instance. * * Generated from protobuf field bool no_remove_data_disk = 27 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $no_remove_data_disk = false; + protected $no_remove_data_disk = false; /** * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK. * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.DiskEncryption disk_encryption = 15 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $disk_encryption = 0; + protected $disk_encryption = 0; /** * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption * is CMEK. * Format: * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` - * Learn more about [using your own encryption keys](https://cloud.google.com/kms/docs/quickstart). + * Learn more about [using your own encryption keys](/kms/docs/quickstart). * * Generated from protobuf field string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $kms_key = ''; + protected $kms_key = ''; /** * Output only. Attached disks to notebook instance. * @@ -175,19 +175,19 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.ShieldedInstanceConfig shielded_instance_config = 30 [(.google.api.field_behavior) = OPTIONAL]; */ - private $shielded_instance_config = null; + protected $shielded_instance_config = null; /** * If true, no public IP will be assigned to this instance. * * Generated from protobuf field bool no_public_ip = 17; */ - private $no_public_ip = false; + protected $no_public_ip = false; /** * If true, the notebook instance will not register with the proxy. * * Generated from protobuf field bool no_proxy_access = 18; */ - private $no_proxy_access = false; + protected $no_proxy_access = false; /** * The name of the VPC that this instance is in. * Format: @@ -195,7 +195,7 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 19; */ - private $network = ''; + protected $network = ''; /** * The name of the subnet that this instance is in. * Format: @@ -203,7 +203,7 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string subnet = 20; */ - private $subnet = ''; + protected $subnet = ''; /** * Labels to apply to this instance. * These can be later modified by the setLabels method. @@ -236,7 +236,7 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.NicType nic_type = 33 [(.google.api.field_behavior) = OPTIONAL]; */ - private $nic_type = 0; + protected $nic_type = 0; /** * Optional. The optional reservation affinity. Setting this field will apply * the specified [Zonal Compute @@ -245,32 +245,32 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.ReservationAffinity reservation_affinity = 34 [(.google.api.field_behavior) = OPTIONAL]; */ - private $reservation_affinity = null; + protected $reservation_affinity = null; /** * Output only. Email address of entity that sent original CreateInstance request. * * Generated from protobuf field string creator = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $creator = ''; + protected $creator = ''; /** * Optional. Flag to enable ip forwarding or not, default false/off. * https://cloud.google.com/vpc/docs/using-routes#canipforward * * Generated from protobuf field bool can_ip_forward = 39 [(.google.api.field_behavior) = OPTIONAL]; */ - private $can_ip_forward = false; + protected $can_ip_forward = false; /** * Output only. Instance creation time. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Instance update time. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; protected $environment; /** @@ -357,7 +357,7 @@ class Instance extends \Google\Protobuf\Internal\Message * is CMEK. * Format: * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` - * Learn more about [using your own encryption keys](https://cloud.google.com/kms/docs/quickstart). + * Learn more about [using your own encryption keys](/kms/docs/quickstart). * @type array<\Google\Cloud\Notebooks\V1\Instance\Disk>|\Google\Protobuf\Internal\RepeatedField $disks * Output only. Attached disks to notebook instance. * @type \Google\Cloud\Notebooks\V1\Instance\ShieldedInstanceConfig $shielded_instance_config @@ -999,7 +999,7 @@ public function setDiskEncryption($var) * is CMEK. * Format: * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` - * Learn more about [using your own encryption keys](https://cloud.google.com/kms/docs/quickstart). + * Learn more about [using your own encryption keys](/kms/docs/quickstart). * * Generated from protobuf field string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; * @return string @@ -1014,7 +1014,7 @@ public function getKmsKey() * is CMEK. * Format: * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` - * Learn more about [using your own encryption keys](https://cloud.google.com/kms/docs/quickstart). + * Learn more about [using your own encryption keys](/kms/docs/quickstart). * * Generated from protobuf field string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; * @param string $var diff --git a/Notebooks/src/V1/Instance/AcceleratorConfig.php b/Notebooks/src/V1/Instance/AcceleratorConfig.php index 7e5f6b5fe05f..370d4b0b8ad5 100644 --- a/Notebooks/src/V1/Instance/AcceleratorConfig.php +++ b/Notebooks/src/V1/Instance/AcceleratorConfig.php @@ -23,13 +23,13 @@ class AcceleratorConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.AcceleratorType type = 1; */ - private $type = 0; + protected $type = 0; /** * Count of cores of this accelerator. * * Generated from protobuf field int64 core_count = 2; */ - private $core_count = 0; + protected $core_count = 0; /** * Constructor. @@ -102,6 +102,4 @@ public function setCoreCount($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AcceleratorConfig::class, \Google\Cloud\Notebooks\V1\Instance_AcceleratorConfig::class); diff --git a/Notebooks/src/V1/Instance/AcceleratorType.php b/Notebooks/src/V1/Instance/AcceleratorType.php index 9831175c0a2b..75f282233135 100644 --- a/Notebooks/src/V1/Instance/AcceleratorType.php +++ b/Notebooks/src/V1/Instance/AcceleratorType.php @@ -123,6 +123,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AcceleratorType::class, \Google\Cloud\Notebooks\V1\Instance_AcceleratorType::class); diff --git a/Notebooks/src/V1/Instance/Disk.php b/Notebooks/src/V1/Instance/Disk.php index e89c213cba70..a6ec7d6cec59 100644 --- a/Notebooks/src/V1/Instance/Disk.php +++ b/Notebooks/src/V1/Instance/Disk.php @@ -21,14 +21,14 @@ class Disk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool auto_delete = 1; */ - private $auto_delete = false; + protected $auto_delete = false; /** * Indicates that this is a boot disk. The virtual machine will use the * first partition of the disk for its root filesystem. * * Generated from protobuf field bool boot = 2; */ - private $boot = false; + protected $boot = false; /** * Indicates a unique device name of your choice that is reflected into the * `/dev/disk/by-id/google-*` tree of a Linux operating system running @@ -40,13 +40,13 @@ class Disk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string device_name = 3; */ - private $device_name = ''; + protected $device_name = ''; /** * Indicates the size of the disk in base-2 GB. * * Generated from protobuf field int64 disk_size_gb = 4; */ - private $disk_size_gb = 0; + protected $disk_size_gb = 0; /** * Indicates a list of features to enable on the guest operating system. * Applicable only for bootable images. Read Enabling guest operating @@ -62,7 +62,7 @@ class Disk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 index = 6; */ - private $index = 0; + protected $index = 0; /** * Indicates the disk interface to use for attaching this disk, which is * either SCSI or NVME. The default is SCSI. Persistent disks must always @@ -76,14 +76,14 @@ class Disk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string interface = 7; */ - private $interface = ''; + protected $interface = ''; /** * Type of the resource. Always compute#attachedDisk for attached * disks. * * Generated from protobuf field string kind = 8; */ - private $kind = ''; + protected $kind = ''; /** * A list of publicly visible licenses. Reserved for Google's use. * A License represents billing and aggregate usage data for public @@ -101,14 +101,14 @@ class Disk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string mode = 10; */ - private $mode = ''; + protected $mode = ''; /** * Indicates a valid partial or full URL to an existing Persistent Disk * resource. * * Generated from protobuf field string source = 11; */ - private $source = ''; + protected $source = ''; /** * Indicates the type of the disk, either `SCRATCH` or `PERSISTENT`. * Valid values: @@ -117,7 +117,7 @@ class Disk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type = 12; */ - private $type = ''; + protected $type = ''; /** * Constructor. @@ -563,6 +563,4 @@ public function setType($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Disk::class, \Google\Cloud\Notebooks\V1\Instance_Disk::class); diff --git a/Notebooks/src/V1/Instance/Disk/GuestOsFeature.php b/Notebooks/src/V1/Instance/Disk/GuestOsFeature.php index b49d243a9a65..88b0be061cd8 100644 --- a/Notebooks/src/V1/Instance/Disk/GuestOsFeature.php +++ b/Notebooks/src/V1/Instance/Disk/GuestOsFeature.php @@ -28,7 +28,7 @@ class GuestOsFeature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type = 1; */ - private $type = ''; + protected $type = ''; /** * Constructor. @@ -97,6 +97,4 @@ public function setType($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GuestOsFeature::class, \Google\Cloud\Notebooks\V1\Instance_Disk_GuestOsFeature::class); diff --git a/Notebooks/src/V1/Instance/DiskEncryption.php b/Notebooks/src/V1/Instance/DiskEncryption.php index ed653659e11e..edff3dd3edfe 100644 --- a/Notebooks/src/V1/Instance/DiskEncryption.php +++ b/Notebooks/src/V1/Instance/DiskEncryption.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DiskEncryption::class, \Google\Cloud\Notebooks\V1\Instance_DiskEncryption::class); diff --git a/Notebooks/src/V1/Instance/DiskType.php b/Notebooks/src/V1/Instance/DiskType.php index 268219224d84..8e7615c0d8da 100644 --- a/Notebooks/src/V1/Instance/DiskType.php +++ b/Notebooks/src/V1/Instance/DiskType.php @@ -73,6 +73,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DiskType::class, \Google\Cloud\Notebooks\V1\Instance_DiskType::class); diff --git a/Notebooks/src/V1/Instance/NicType.php b/Notebooks/src/V1/Instance/NicType.php index c2da464bc534..42ec41cc89d2 100644 --- a/Notebooks/src/V1/Instance/NicType.php +++ b/Notebooks/src/V1/Instance/NicType.php @@ -60,6 +60,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NicType::class, \Google\Cloud\Notebooks\V1\Instance_NicType::class); diff --git a/Notebooks/src/V1/Instance/ShieldedInstanceConfig.php b/Notebooks/src/V1/Instance/ShieldedInstanceConfig.php index 486facfce179..d841b4b9cbb7 100644 --- a/Notebooks/src/V1/Instance/ShieldedInstanceConfig.php +++ b/Notebooks/src/V1/Instance/ShieldedInstanceConfig.php @@ -26,13 +26,13 @@ class ShieldedInstanceConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_secure_boot = 1; */ - private $enable_secure_boot = false; + protected $enable_secure_boot = false; /** * Defines whether the instance has the vTPM enabled. Enabled by default. * * Generated from protobuf field bool enable_vtpm = 2; */ - private $enable_vtpm = false; + protected $enable_vtpm = false; /** * Defines whether the instance has integrity monitoring enabled. * Enables monitoring and attestation of the boot integrity of the instance. @@ -42,7 +42,7 @@ class ShieldedInstanceConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_integrity_monitoring = 3; */ - private $enable_integrity_monitoring = false; + protected $enable_integrity_monitoring = false; /** * Constructor. @@ -164,6 +164,4 @@ public function setEnableIntegrityMonitoring($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ShieldedInstanceConfig::class, \Google\Cloud\Notebooks\V1\Instance_ShieldedInstanceConfig::class); diff --git a/Notebooks/src/V1/Instance/State.php b/Notebooks/src/V1/Instance/State.php index 7787b107121a..e3e0ad509f51 100644 --- a/Notebooks/src/V1/Instance/State.php +++ b/Notebooks/src/V1/Instance/State.php @@ -123,6 +123,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Notebooks\V1\Instance_State::class); diff --git a/Notebooks/src/V1/Instance/UpgradeHistoryEntry.php b/Notebooks/src/V1/Instance/UpgradeHistoryEntry.php index 6c44f999857f..d4622036c2d2 100644 --- a/Notebooks/src/V1/Instance/UpgradeHistoryEntry.php +++ b/Notebooks/src/V1/Instance/UpgradeHistoryEntry.php @@ -20,43 +20,43 @@ class UpgradeHistoryEntry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string snapshot = 1; */ - private $snapshot = ''; + protected $snapshot = ''; /** * The VM image before this instance upgrade. * * Generated from protobuf field string vm_image = 2; */ - private $vm_image = ''; + protected $vm_image = ''; /** * The container image before this instance upgrade. * * Generated from protobuf field string container_image = 3; */ - private $container_image = ''; + protected $container_image = ''; /** * The framework of this notebook instance. * * Generated from protobuf field string framework = 4; */ - private $framework = ''; + protected $framework = ''; /** * The version of the notebook instance before this upgrade. * * Generated from protobuf field string version = 5; */ - private $version = ''; + protected $version = ''; /** * The state of this instance upgrade history entry. * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.UpgradeHistoryEntry.State state = 6; */ - private $state = 0; + protected $state = 0; /** * The time that this instance upgrade history entry is created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; */ - private $create_time = null; + protected $create_time = null; /** * Target VM Image. Format: `ainotebooks-vm/project/image-name/name`. * @@ -69,13 +69,13 @@ class UpgradeHistoryEntry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.UpgradeHistoryEntry.Action action = 9; */ - private $action = 0; + protected $action = 0; /** * Target VM Version, like m63. * * Generated from protobuf field string target_version = 10; */ - private $target_version = ''; + protected $target_version = ''; /** * Constructor. @@ -386,6 +386,4 @@ public function setTargetVersion($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UpgradeHistoryEntry::class, \Google\Cloud\Notebooks\V1\Instance_UpgradeHistoryEntry::class); diff --git a/Notebooks/src/V1/Instance/UpgradeHistoryEntry/Action.php b/Notebooks/src/V1/Instance/UpgradeHistoryEntry/Action.php index 6dc76ab38872..f6a6bfea8f73 100644 --- a/Notebooks/src/V1/Instance/UpgradeHistoryEntry/Action.php +++ b/Notebooks/src/V1/Instance/UpgradeHistoryEntry/Action.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Action::class, \Google\Cloud\Notebooks\V1\Instance_UpgradeHistoryEntry_Action::class); diff --git a/Notebooks/src/V1/Instance/UpgradeHistoryEntry/State.php b/Notebooks/src/V1/Instance/UpgradeHistoryEntry/State.php index 911247394eb3..f1d105de24a5 100644 --- a/Notebooks/src/V1/Instance/UpgradeHistoryEntry/State.php +++ b/Notebooks/src/V1/Instance/UpgradeHistoryEntry/State.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Notebooks\V1\Instance_UpgradeHistoryEntry_State::class); diff --git a/Notebooks/src/V1/InstanceConfig.php b/Notebooks/src/V1/InstanceConfig.php index c54cd43d6a27..cda436e61847 100644 --- a/Notebooks/src/V1/InstanceConfig.php +++ b/Notebooks/src/V1/InstanceConfig.php @@ -21,13 +21,13 @@ class InstanceConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string notebook_upgrade_schedule = 1; */ - private $notebook_upgrade_schedule = ''; + protected $notebook_upgrade_schedule = ''; /** * Verifies core internal services are running. * * Generated from protobuf field bool enable_health_monitoring = 2; */ - private $enable_health_monitoring = false; + protected $enable_health_monitoring = false; /** * Constructor. diff --git a/Notebooks/src/V1/IsInstanceUpgradeableRequest.php b/Notebooks/src/V1/IsInstanceUpgradeableRequest.php index d1ae5e94ea5e..8bf9e2313d97 100644 --- a/Notebooks/src/V1/IsInstanceUpgradeableRequest.php +++ b/Notebooks/src/V1/IsInstanceUpgradeableRequest.php @@ -21,14 +21,14 @@ class IsInstanceUpgradeableRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string notebook_instance = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $notebook_instance = ''; + protected $notebook_instance = ''; /** * Optional. The optional UpgradeType. Setting this field will search for additional * compute images to upgrade this instance. * * Generated from protobuf field .google.cloud.notebooks.v1.UpgradeType type = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Notebooks/src/V1/IsInstanceUpgradeableResponse.php b/Notebooks/src/V1/IsInstanceUpgradeableResponse.php index b571b20e22ce..397995bcd0c7 100644 --- a/Notebooks/src/V1/IsInstanceUpgradeableResponse.php +++ b/Notebooks/src/V1/IsInstanceUpgradeableResponse.php @@ -20,20 +20,20 @@ class IsInstanceUpgradeableResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool upgradeable = 1; */ - private $upgradeable = false; + protected $upgradeable = false; /** * The version this instance will be upgraded to if calling the upgrade * endpoint. This field will only be populated if field upgradeable is true. * * Generated from protobuf field string upgrade_version = 2; */ - private $upgrade_version = ''; + protected $upgrade_version = ''; /** * Additional information about upgrade. * * Generated from protobuf field string upgrade_info = 3; */ - private $upgrade_info = ''; + protected $upgrade_info = ''; /** * The new image self link this instance will be upgraded to if calling the * upgrade endpoint. This field will only be populated if field upgradeable @@ -41,7 +41,7 @@ class IsInstanceUpgradeableResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string upgrade_image = 4; */ - private $upgrade_image = ''; + protected $upgrade_image = ''; /** * Constructor. diff --git a/Notebooks/src/V1/ListEnvironmentsRequest.php b/Notebooks/src/V1/ListEnvironmentsRequest.php index a17b61a08a89..9ccab752a6a3 100644 --- a/Notebooks/src/V1/ListEnvironmentsRequest.php +++ b/Notebooks/src/V1/ListEnvironmentsRequest.php @@ -20,20 +20,20 @@ class ListEnvironmentsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parent = ''; + protected $parent = ''; /** * Maximum return size of the list call. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A previous returned page token that can be used to continue listing from * the last result. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. Format: `projects/{project_id}/locations/{location}` diff --git a/Notebooks/src/V1/ListEnvironmentsResponse.php b/Notebooks/src/V1/ListEnvironmentsResponse.php index 885fb5ce74bf..9b06c1ea14f6 100644 --- a/Notebooks/src/V1/ListEnvironmentsResponse.php +++ b/Notebooks/src/V1/ListEnvironmentsResponse.php @@ -27,7 +27,7 @@ class ListEnvironmentsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/Notebooks/src/V1/ListExecutionsRequest.php b/Notebooks/src/V1/ListExecutionsRequest.php index a268dd82117d..d77a6a1ed25b 100644 --- a/Notebooks/src/V1/ListExecutionsRequest.php +++ b/Notebooks/src/V1/ListExecutionsRequest.php @@ -21,20 +21,20 @@ class ListExecutionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Maximum return size of the list call. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A previous returned page token that can be used to continue listing * from the last result. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Filter applied to resulting executions. Currently only supports filtering * executions by a specified `schedule_id`. @@ -42,13 +42,13 @@ class ListExecutionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * Sort by field. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V1/ListExecutionsResponse.php b/Notebooks/src/V1/ListExecutionsResponse.php index 28a4ae2528f1..368324e19d2f 100644 --- a/Notebooks/src/V1/ListExecutionsResponse.php +++ b/Notebooks/src/V1/ListExecutionsResponse.php @@ -27,7 +27,7 @@ class ListExecutionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Executions IDs that could not be reached. For example: * ['projects/{project_id}/location/{location}/executions/imagenet_test1', diff --git a/Notebooks/src/V1/ListInstancesRequest.php b/Notebooks/src/V1/ListInstancesRequest.php index ee6cefac68da..22cb60a12a02 100644 --- a/Notebooks/src/V1/ListInstancesRequest.php +++ b/Notebooks/src/V1/ListInstancesRequest.php @@ -21,20 +21,20 @@ class ListInstancesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parent = ''; + protected $parent = ''; /** * Maximum return size of the list call. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A previous returned page token that can be used to continue listing * from the last result. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V1/ListInstancesResponse.php b/Notebooks/src/V1/ListInstancesResponse.php index e89ff5182640..f621f82fdf0f 100644 --- a/Notebooks/src/V1/ListInstancesResponse.php +++ b/Notebooks/src/V1/ListInstancesResponse.php @@ -27,7 +27,7 @@ class ListInstancesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. For example, * `['us-west1-a', 'us-central1-b']`. diff --git a/Notebooks/src/V1/ListRuntimesRequest.php b/Notebooks/src/V1/ListRuntimesRequest.php index 68efd02971bb..8e6cda6cbd5b 100644 --- a/Notebooks/src/V1/ListRuntimesRequest.php +++ b/Notebooks/src/V1/ListRuntimesRequest.php @@ -21,20 +21,20 @@ class ListRuntimesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Maximum return size of the list call. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A previous returned page token that can be used to continue listing * from the last result. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V1/ListRuntimesResponse.php b/Notebooks/src/V1/ListRuntimesResponse.php index cf9c526ecddd..c2339d4e4dfb 100644 --- a/Notebooks/src/V1/ListRuntimesResponse.php +++ b/Notebooks/src/V1/ListRuntimesResponse.php @@ -27,7 +27,7 @@ class ListRuntimesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. For example, * `['us-west1', 'us-central1']`. diff --git a/Notebooks/src/V1/ListSchedulesRequest.php b/Notebooks/src/V1/ListSchedulesRequest.php index 2972b25884f7..7fb6ed52536e 100644 --- a/Notebooks/src/V1/ListSchedulesRequest.php +++ b/Notebooks/src/V1/ListSchedulesRequest.php @@ -21,32 +21,32 @@ class ListSchedulesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Maximum return size of the list call. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A previous returned page token that can be used to continue listing * from the last result. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Filter applied to resulting schedules. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * Field to order results by. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V1/ListSchedulesResponse.php b/Notebooks/src/V1/ListSchedulesResponse.php index d77b4cf42b2c..21f314072c1d 100644 --- a/Notebooks/src/V1/ListSchedulesResponse.php +++ b/Notebooks/src/V1/ListSchedulesResponse.php @@ -27,7 +27,7 @@ class ListSchedulesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Schedules that could not be reached. For example: * ['projects/{project_id}/location/{location}/schedules/monthly_digest', diff --git a/Notebooks/src/V1/LocalDisk.php b/Notebooks/src/V1/LocalDisk.php index c410063011c4..97bb2321a01a 100644 --- a/Notebooks/src/V1/LocalDisk.php +++ b/Notebooks/src/V1/LocalDisk.php @@ -21,14 +21,14 @@ class LocalDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool auto_delete = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $auto_delete = false; + protected $auto_delete = false; /** * Optional. Output only. Indicates that this is a boot disk. The virtual machine * will use the first partition of the disk for its root filesystem. * * Generated from protobuf field bool boot = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $boot = false; + protected $boot = false; /** * Optional. Output only. Specifies a unique device name * of your choice that is reflected into the @@ -41,7 +41,7 @@ class LocalDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string device_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $device_name = ''; + protected $device_name = ''; /** * Output only. Indicates a list of features to enable on the guest operating system. * Applicable only for bootable images. Read Enabling guest operating @@ -57,7 +57,7 @@ class LocalDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 index = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $index = 0; + protected $index = 0; /** * Input only. Specifies the parameters for a new disk that will be created * alongside the new instance. Use initialization parameters to create boot @@ -67,7 +67,7 @@ class LocalDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.LocalDiskInitializeParams initialize_params = 6 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $initialize_params = null; + protected $initialize_params = null; /** * Specifies the disk interface to use for attaching this disk, which is * either SCSI or NVME. The default is SCSI. Persistent disks must always use @@ -80,13 +80,13 @@ class LocalDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string interface = 7; */ - private $interface = ''; + protected $interface = ''; /** * Output only. Type of the resource. Always compute#attachedDisk for attached disks. * * Generated from protobuf field string kind = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $kind = ''; + protected $kind = ''; /** * Output only. Any valid publicly visible licenses. * @@ -102,14 +102,14 @@ class LocalDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string mode = 10; */ - private $mode = ''; + protected $mode = ''; /** * Specifies a valid partial or full URL to an existing Persistent Disk * resource. * * Generated from protobuf field string source = 11; */ - private $source = ''; + protected $source = ''; /** * Specifies the type of the disk, either `SCRATCH` or `PERSISTENT`. If not * specified, the default is `PERSISTENT`. @@ -119,7 +119,7 @@ class LocalDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type = 12; */ - private $type = ''; + protected $type = ''; /** * Constructor. diff --git a/Notebooks/src/V1/LocalDisk/RuntimeGuestOsFeature.php b/Notebooks/src/V1/LocalDisk/RuntimeGuestOsFeature.php index 846afa1e8b0d..320e37d9e11a 100644 --- a/Notebooks/src/V1/LocalDisk/RuntimeGuestOsFeature.php +++ b/Notebooks/src/V1/LocalDisk/RuntimeGuestOsFeature.php @@ -34,7 +34,7 @@ class RuntimeGuestOsFeature extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type = 1; */ - private $type = ''; + protected $type = ''; /** * Constructor. @@ -106,6 +106,4 @@ public function setType($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RuntimeGuestOsFeature::class, \Google\Cloud\Notebooks\V1\LocalDisk_RuntimeGuestOsFeature::class); diff --git a/Notebooks/src/V1/LocalDiskInitializeParams.php b/Notebooks/src/V1/LocalDiskInitializeParams.php index 41b2dc3a3a0b..f731a6094b6b 100644 --- a/Notebooks/src/V1/LocalDiskInitializeParams.php +++ b/Notebooks/src/V1/LocalDiskInitializeParams.php @@ -24,7 +24,7 @@ class LocalDiskInitializeParams extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. Specifies the disk name. If not specified, the default is to use the name * of the instance. If the disk with the instance name exists already in the @@ -32,7 +32,7 @@ class LocalDiskInitializeParams extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string disk_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disk_name = ''; + protected $disk_name = ''; /** * Optional. Specifies the size of the disk in base-2 GB. If not specified, the disk * will be the same size as the image (usually 10GB). If specified, the size @@ -40,14 +40,14 @@ class LocalDiskInitializeParams extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 disk_size_gb = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disk_size_gb = 0; + protected $disk_size_gb = 0; /** * Input only. The type of the boot disk attached to this instance, defaults to * standard persistent disk (`PD_STANDARD`). * * Generated from protobuf field .google.cloud.notebooks.v1.LocalDiskInitializeParams.DiskType disk_type = 4 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $disk_type = 0; + protected $disk_type = 0; /** * Optional. Labels to apply to this disk. These can be later modified by the * disks.setLabels method. This field is only applicable for persistent disks. diff --git a/Notebooks/src/V1/LocalDiskInitializeParams/DiskType.php b/Notebooks/src/V1/LocalDiskInitializeParams/DiskType.php index 8c1eaa5a9195..997ce8129326 100644 --- a/Notebooks/src/V1/LocalDiskInitializeParams/DiskType.php +++ b/Notebooks/src/V1/LocalDiskInitializeParams/DiskType.php @@ -73,6 +73,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DiskType::class, \Google\Cloud\Notebooks\V1\LocalDiskInitializeParams_DiskType::class); diff --git a/Notebooks/src/V1/ManagedNotebookServiceGrpcClient.php b/Notebooks/src/V1/ManagedNotebookServiceGrpcClient.php deleted file mode 100644 index fcc6636baebf..000000000000 --- a/Notebooks/src/V1/ManagedNotebookServiceGrpcClient.php +++ /dev/null @@ -1,240 +0,0 @@ -_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/ListRuntimes', - $argument, - ['\Google\Cloud\Notebooks\V1\ListRuntimesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Runtime. The location must be a regional endpoint - * rather than zonal. - * @param \Google\Cloud\Notebooks\V1\GetRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetRuntime(\Google\Cloud\Notebooks\V1\GetRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/GetRuntime', - $argument, - ['\Google\Cloud\Notebooks\V1\Runtime', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Runtime in a given project and location. - * @param \Google\Cloud\Notebooks\V1\CreateRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateRuntime(\Google\Cloud\Notebooks\V1\CreateRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/CreateRuntime', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Update Notebook Runtime configuration. - * @param \Google\Cloud\Notebooks\V1\UpdateRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateRuntime(\Google\Cloud\Notebooks\V1\UpdateRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/UpdateRuntime', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Runtime. - * @param \Google\Cloud\Notebooks\V1\DeleteRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteRuntime(\Google\Cloud\Notebooks\V1\DeleteRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/DeleteRuntime', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Starts a Managed Notebook Runtime. - * Perform "Start" on GPU instances; "Resume" on CPU instances - * See: - * https://cloud.google.com/compute/docs/instances/stop-start-instance - * https://cloud.google.com/compute/docs/instances/suspend-resume-instance - * @param \Google\Cloud\Notebooks\V1\StartRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StartRuntime(\Google\Cloud\Notebooks\V1\StartRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/StartRuntime', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Stops a Managed Notebook Runtime. - * Perform "Stop" on GPU instances; "Suspend" on CPU instances - * See: - * https://cloud.google.com/compute/docs/instances/stop-start-instance - * https://cloud.google.com/compute/docs/instances/suspend-resume-instance - * @param \Google\Cloud\Notebooks\V1\StopRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StopRuntime(\Google\Cloud\Notebooks\V1\StopRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/StopRuntime', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Switch a Managed Notebook Runtime. - * @param \Google\Cloud\Notebooks\V1\SwitchRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SwitchRuntime(\Google\Cloud\Notebooks\V1\SwitchRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/SwitchRuntime', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Resets a Managed Notebook Runtime. - * @param \Google\Cloud\Notebooks\V1\ResetRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ResetRuntime(\Google\Cloud\Notebooks\V1\ResetRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/ResetRuntime', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Upgrades a Managed Notebook Runtime to the latest version. - * @param \Google\Cloud\Notebooks\V1\UpgradeRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpgradeRuntime(\Google\Cloud\Notebooks\V1\UpgradeRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/UpgradeRuntime', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Report and process a runtime event. - * @param \Google\Cloud\Notebooks\V1\ReportRuntimeEventRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ReportRuntimeEvent(\Google\Cloud\Notebooks\V1\ReportRuntimeEventRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/ReportRuntimeEvent', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets an access token for the consumer service account that the customer - * attached to the runtime. Only accessible from the tenant instance. - * @param \Google\Cloud\Notebooks\V1\RefreshRuntimeTokenInternalRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RefreshRuntimeTokenInternal(\Google\Cloud\Notebooks\V1\RefreshRuntimeTokenInternalRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/RefreshRuntimeTokenInternal', - $argument, - ['\Google\Cloud\Notebooks\V1\RefreshRuntimeTokenInternalResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. - * @param \Google\Cloud\Notebooks\V1\DiagnoseRuntimeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DiagnoseRuntime(\Google\Cloud\Notebooks\V1\DiagnoseRuntimeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.ManagedNotebookService/DiagnoseRuntime', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/Notebooks/src/V1/NotebookServiceGrpcClient.php b/Notebooks/src/V1/NotebookServiceGrpcClient.php deleted file mode 100644 index c2a4b5106f64..000000000000 --- a/Notebooks/src/V1/NotebookServiceGrpcClient.php +++ /dev/null @@ -1,552 +0,0 @@ -_simpleRequest('/google.cloud.notebooks.v1.NotebookService/ListInstances', - $argument, - ['\Google\Cloud\Notebooks\V1\ListInstancesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Instance. - * @param \Google\Cloud\Notebooks\V1\GetInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetInstance(\Google\Cloud\Notebooks\V1\GetInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/GetInstance', - $argument, - ['\Google\Cloud\Notebooks\V1\Instance', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Instance in a given project and location. - * @param \Google\Cloud\Notebooks\V1\CreateInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateInstance(\Google\Cloud\Notebooks\V1\CreateInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/CreateInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Registers an existing legacy notebook instance to the Notebooks API server. - * Legacy instances are instances created with the legacy Compute Engine - * calls. They are not manageable by the Notebooks API out of the box. This - * call makes these instances manageable by the Notebooks API. - * @param \Google\Cloud\Notebooks\V1\RegisterInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RegisterInstance(\Google\Cloud\Notebooks\V1\RegisterInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/RegisterInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the guest accelerators of a single Instance. - * @param \Google\Cloud\Notebooks\V1\SetInstanceAcceleratorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetInstanceAccelerator(\Google\Cloud\Notebooks\V1\SetInstanceAcceleratorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/SetInstanceAccelerator', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the machine type of a single Instance. - * @param \Google\Cloud\Notebooks\V1\SetInstanceMachineTypeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetInstanceMachineType(\Google\Cloud\Notebooks\V1\SetInstanceMachineTypeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/SetInstanceMachineType', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Update Notebook Instance configurations. - * @param \Google\Cloud\Notebooks\V1\UpdateInstanceConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateInstanceConfig(\Google\Cloud\Notebooks\V1\UpdateInstanceConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/UpdateInstanceConfig', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the Shielded instance configuration of a single Instance. - * @param \Google\Cloud\Notebooks\V1\UpdateShieldedInstanceConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateShieldedInstanceConfig(\Google\Cloud\Notebooks\V1\UpdateShieldedInstanceConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/UpdateShieldedInstanceConfig', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Replaces all the labels of an Instance. - * @param \Google\Cloud\Notebooks\V1\SetInstanceLabelsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetInstanceLabels(\Google\Cloud\Notebooks\V1\SetInstanceLabelsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/SetInstanceLabels', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Add/update metadata items for an instance. - * @param \Google\Cloud\Notebooks\V1\UpdateInstanceMetadataItemsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateInstanceMetadataItems(\Google\Cloud\Notebooks\V1\UpdateInstanceMetadataItemsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/UpdateInstanceMetadataItems', - $argument, - ['\Google\Cloud\Notebooks\V1\UpdateInstanceMetadataItemsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Instance. - * @param \Google\Cloud\Notebooks\V1\DeleteInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteInstance(\Google\Cloud\Notebooks\V1\DeleteInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/DeleteInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Starts a notebook instance. - * @param \Google\Cloud\Notebooks\V1\StartInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StartInstance(\Google\Cloud\Notebooks\V1\StartInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/StartInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Stops a notebook instance. - * @param \Google\Cloud\Notebooks\V1\StopInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StopInstance(\Google\Cloud\Notebooks\V1\StopInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/StopInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Resets a notebook instance. - * @param \Google\Cloud\Notebooks\V1\ResetInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ResetInstance(\Google\Cloud\Notebooks\V1\ResetInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/ResetInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Allows notebook instances to - * report their latest instance information to the Notebooks - * API server. The server will merge the reported information to - * the instance metadata store. Do not use this method directly. - * @param \Google\Cloud\Notebooks\V1\ReportInstanceInfoRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ReportInstanceInfo(\Google\Cloud\Notebooks\V1\ReportInstanceInfoRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/ReportInstanceInfo', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Check if a notebook instance is upgradable. - * @param \Google\Cloud\Notebooks\V1\IsInstanceUpgradeableRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function IsInstanceUpgradeable(\Google\Cloud\Notebooks\V1\IsInstanceUpgradeableRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/IsInstanceUpgradeable', - $argument, - ['\Google\Cloud\Notebooks\V1\IsInstanceUpgradeableResponse', 'decode'], - $metadata, $options); - } - - /** - * Check if a notebook instance is healthy. - * @param \Google\Cloud\Notebooks\V1\GetInstanceHealthRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetInstanceHealth(\Google\Cloud\Notebooks\V1\GetInstanceHealthRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/GetInstanceHealth', - $argument, - ['\Google\Cloud\Notebooks\V1\GetInstanceHealthResponse', 'decode'], - $metadata, $options); - } - - /** - * Upgrades a notebook instance to the latest version. - * @param \Google\Cloud\Notebooks\V1\UpgradeInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpgradeInstance(\Google\Cloud\Notebooks\V1\UpgradeInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/UpgradeInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Rollbacks a notebook instance to the previous version. - * @param \Google\Cloud\Notebooks\V1\RollbackInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RollbackInstance(\Google\Cloud\Notebooks\V1\RollbackInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/RollbackInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a Diagnostic File and runs Diagnostic Tool given an Instance. - * @param \Google\Cloud\Notebooks\V1\DiagnoseInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DiagnoseInstance(\Google\Cloud\Notebooks\V1\DiagnoseInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/DiagnoseInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Allows notebook instances to - * call this endpoint to upgrade themselves. Do not use this method directly. - * @param \Google\Cloud\Notebooks\V1\UpgradeInstanceInternalRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpgradeInstanceInternal(\Google\Cloud\Notebooks\V1\UpgradeInstanceInternalRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/UpgradeInstanceInternal', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists environments in a project. - * @param \Google\Cloud\Notebooks\V1\ListEnvironmentsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListEnvironments(\Google\Cloud\Notebooks\V1\ListEnvironmentsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/ListEnvironments', - $argument, - ['\Google\Cloud\Notebooks\V1\ListEnvironmentsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Environment. - * @param \Google\Cloud\Notebooks\V1\GetEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetEnvironment(\Google\Cloud\Notebooks\V1\GetEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/GetEnvironment', - $argument, - ['\Google\Cloud\Notebooks\V1\Environment', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Environment. - * @param \Google\Cloud\Notebooks\V1\CreateEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateEnvironment(\Google\Cloud\Notebooks\V1\CreateEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/CreateEnvironment', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Environment. - * @param \Google\Cloud\Notebooks\V1\DeleteEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteEnvironment(\Google\Cloud\Notebooks\V1\DeleteEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/DeleteEnvironment', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists schedules in a given project and location. - * @param \Google\Cloud\Notebooks\V1\ListSchedulesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListSchedules(\Google\Cloud\Notebooks\V1\ListSchedulesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/ListSchedules', - $argument, - ['\Google\Cloud\Notebooks\V1\ListSchedulesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of schedule - * @param \Google\Cloud\Notebooks\V1\GetScheduleRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetSchedule(\Google\Cloud\Notebooks\V1\GetScheduleRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/GetSchedule', - $argument, - ['\Google\Cloud\Notebooks\V1\Schedule', 'decode'], - $metadata, $options); - } - - /** - * Deletes schedule and all underlying jobs - * @param \Google\Cloud\Notebooks\V1\DeleteScheduleRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteSchedule(\Google\Cloud\Notebooks\V1\DeleteScheduleRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/DeleteSchedule', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Scheduled Notebook in a given project and location. - * @param \Google\Cloud\Notebooks\V1\CreateScheduleRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateSchedule(\Google\Cloud\Notebooks\V1\CreateScheduleRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/CreateSchedule', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Triggers execution of an existing schedule. - * @param \Google\Cloud\Notebooks\V1\TriggerScheduleRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TriggerSchedule(\Google\Cloud\Notebooks\V1\TriggerScheduleRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/TriggerSchedule', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists executions in a given project and location - * @param \Google\Cloud\Notebooks\V1\ListExecutionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListExecutions(\Google\Cloud\Notebooks\V1\ListExecutionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/ListExecutions', - $argument, - ['\Google\Cloud\Notebooks\V1\ListExecutionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of executions - * @param \Google\Cloud\Notebooks\V1\GetExecutionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetExecution(\Google\Cloud\Notebooks\V1\GetExecutionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/GetExecution', - $argument, - ['\Google\Cloud\Notebooks\V1\Execution', 'decode'], - $metadata, $options); - } - - /** - * Deletes execution - * @param \Google\Cloud\Notebooks\V1\DeleteExecutionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteExecution(\Google\Cloud\Notebooks\V1\DeleteExecutionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/DeleteExecution', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Execution in a given project and location. - * @param \Google\Cloud\Notebooks\V1\CreateExecutionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateExecution(\Google\Cloud\Notebooks\V1\CreateExecutionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1.NotebookService/CreateExecution', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/Notebooks/src/V1/OperationMetadata.php b/Notebooks/src/V1/OperationMetadata.php index ab1b0031f6f4..49db986749ec 100644 --- a/Notebooks/src/V1/OperationMetadata.php +++ b/Notebooks/src/V1/OperationMetadata.php @@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; */ - private $create_time = null; + protected $create_time = null; /** * The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - private $end_time = null; + protected $end_time = null; /** * Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3; */ - private $target = ''; + protected $target = ''; /** * Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4; */ - private $verb = ''; + protected $verb = ''; /** * Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5; */ - private $status_message = ''; + protected $status_message = ''; /** * Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -53,19 +53,19 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * API version used to start the operation. * * Generated from protobuf field string api_version = 7; */ - private $api_version = ''; + protected $api_version = ''; /** * API endpoint name of this operation. * * Generated from protobuf field string endpoint = 8; */ - private $endpoint = ''; + protected $endpoint = ''; /** * Constructor. diff --git a/Notebooks/src/V1/RefreshRuntimeTokenInternalRequest.php b/Notebooks/src/V1/RefreshRuntimeTokenInternalRequest.php index 389e1323aabc..6662c576c620 100644 --- a/Notebooks/src/V1/RefreshRuntimeTokenInternalRequest.php +++ b/Notebooks/src/V1/RefreshRuntimeTokenInternalRequest.php @@ -21,14 +21,14 @@ class RefreshRuntimeTokenInternalRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The VM hardware token for authenticating the VM. * https://cloud.google.com/compute/docs/instances/verifying-instance-identity * * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $vm_id = ''; + protected $vm_id = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/RefreshRuntimeTokenInternalResponse.php b/Notebooks/src/V1/RefreshRuntimeTokenInternalResponse.php index d8ec0250b4dc..a9e31bde51a9 100644 --- a/Notebooks/src/V1/RefreshRuntimeTokenInternalResponse.php +++ b/Notebooks/src/V1/RefreshRuntimeTokenInternalResponse.php @@ -20,13 +20,13 @@ class RefreshRuntimeTokenInternalResponse extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string access_token = 1; */ - private $access_token = ''; + protected $access_token = ''; /** * Output only. Token expiration time. * * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $expire_time = null; + protected $expire_time = null; /** * Constructor. diff --git a/Notebooks/src/V1/RegisterInstanceRequest.php b/Notebooks/src/V1/RegisterInstanceRequest.php index 7b399d4f8309..96eb12f68d0b 100644 --- a/Notebooks/src/V1/RegisterInstanceRequest.php +++ b/Notebooks/src/V1/RegisterInstanceRequest.php @@ -21,7 +21,7 @@ class RegisterInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parent = ''; + protected $parent = ''; /** * Required. User defined unique ID of this instance. The `instance_id` must * be 1 to 63 characters long and contain only lowercase letters, @@ -30,7 +30,7 @@ class RegisterInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance_id = ''; + protected $instance_id = ''; /** * Constructor. diff --git a/Notebooks/src/V1/ReportInstanceInfoRequest.php b/Notebooks/src/V1/ReportInstanceInfoRequest.php index 37ade7bb0812..8fbf0ac26d2d 100644 --- a/Notebooks/src/V1/ReportInstanceInfoRequest.php +++ b/Notebooks/src/V1/ReportInstanceInfoRequest.php @@ -21,14 +21,14 @@ class ReportInstanceInfoRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The VM hardware token for authenticating the VM. * https://cloud.google.com/compute/docs/instances/verifying-instance-identity * * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $vm_id = ''; + protected $vm_id = ''; /** * The metadata reported to Notebooks API. This will be merged to the instance * metadata store diff --git a/Notebooks/src/V1/ReportRuntimeEventRequest.php b/Notebooks/src/V1/ReportRuntimeEventRequest.php index 054dee8a7901..8d785cdc3c76 100644 --- a/Notebooks/src/V1/ReportRuntimeEventRequest.php +++ b/Notebooks/src/V1/ReportRuntimeEventRequest.php @@ -21,20 +21,20 @@ class ReportRuntimeEventRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The VM hardware token for authenticating the VM. * https://cloud.google.com/compute/docs/instances/verifying-instance-identity * * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $vm_id = ''; + protected $vm_id = ''; /** * Required. The Event to be reported. * * Generated from protobuf field .google.cloud.notebooks.v1.Event event = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $event = null; + protected $event = null; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/ReservationAffinity.php b/Notebooks/src/V1/ReservationAffinity.php index 5e452fae5b49..b22aec5c428f 100644 --- a/Notebooks/src/V1/ReservationAffinity.php +++ b/Notebooks/src/V1/ReservationAffinity.php @@ -20,13 +20,13 @@ class ReservationAffinity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $consume_reservation_type = 0; + protected $consume_reservation_type = 0; /** * Optional. Corresponds to the label key of reservation resource. * * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $key = ''; + protected $key = ''; /** * Optional. Corresponds to the label values of reservation resource. * diff --git a/Notebooks/src/V1/ReservationAffinity/Type.php b/Notebooks/src/V1/ReservationAffinity/Type.php index af2ee3dd3de4..b3cac5e2c1dd 100644 --- a/Notebooks/src/V1/ReservationAffinity/Type.php +++ b/Notebooks/src/V1/ReservationAffinity/Type.php @@ -67,6 +67,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Notebooks\V1\ReservationAffinity_Type::class); diff --git a/Notebooks/src/V1/ResetInstanceRequest.php b/Notebooks/src/V1/ResetInstanceRequest.php index db7a8168f574..e9c2bf7e8038 100644 --- a/Notebooks/src/V1/ResetInstanceRequest.php +++ b/Notebooks/src/V1/ResetInstanceRequest.php @@ -21,7 +21,7 @@ class ResetInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Notebooks/src/V1/ResetRuntimeRequest.php b/Notebooks/src/V1/ResetRuntimeRequest.php index 031044897778..61cbd7275467 100644 --- a/Notebooks/src/V1/ResetRuntimeRequest.php +++ b/Notebooks/src/V1/ResetRuntimeRequest.php @@ -21,13 +21,13 @@ class ResetRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Idempotent request UUID. * * Generated from protobuf field string request_id = 2; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/RollbackInstanceRequest.php b/Notebooks/src/V1/RollbackInstanceRequest.php index 0d4021cfa946..f9491707036b 100644 --- a/Notebooks/src/V1/RollbackInstanceRequest.php +++ b/Notebooks/src/V1/RollbackInstanceRequest.php @@ -21,14 +21,14 @@ class RollbackInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The snapshot for rollback. * Example: `projects/test-project/global/snapshots/krwlzipynril`. * * Generated from protobuf field string target_snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_snapshot = ''; + protected $target_snapshot = ''; /** * Constructor. diff --git a/Notebooks/src/V1/Runtime.php b/Notebooks/src/V1/Runtime.php index db2de8e215a7..1911c7430ba6 100644 --- a/Notebooks/src/V1/Runtime.php +++ b/Notebooks/src/V1/Runtime.php @@ -22,50 +22,50 @@ class Runtime extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Runtime state. * * Generated from protobuf field .google.cloud.notebooks.v1.Runtime.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Runtime health_state. * * Generated from protobuf field .google.cloud.notebooks.v1.Runtime.HealthState health_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $health_state = 0; + protected $health_state = 0; /** * The config settings for accessing runtime. * * Generated from protobuf field .google.cloud.notebooks.v1.RuntimeAccessConfig access_config = 5; */ - private $access_config = null; + protected $access_config = null; /** * The config settings for software inside the runtime. * * Generated from protobuf field .google.cloud.notebooks.v1.RuntimeSoftwareConfig software_config = 6; */ - private $software_config = null; + protected $software_config = null; /** * Output only. Contains Runtime daemon metrics such as Service status and JupyterLab * stats. * * Generated from protobuf field .google.cloud.notebooks.v1.RuntimeMetrics metrics = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metrics = null; + protected $metrics = null; /** * Output only. Runtime creation time. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Runtime update time. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; protected $runtime_type; /** diff --git a/Notebooks/src/V1/Runtime/HealthState.php b/Notebooks/src/V1/Runtime/HealthState.php index 9a0f048b360a..ea3ee074e077 100644 --- a/Notebooks/src/V1/Runtime/HealthState.php +++ b/Notebooks/src/V1/Runtime/HealthState.php @@ -79,6 +79,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HealthState::class, \Google\Cloud\Notebooks\V1\Runtime_HealthState::class); diff --git a/Notebooks/src/V1/Runtime/State.php b/Notebooks/src/V1/Runtime/State.php index a3e9c1f5c8f0..07f03ed2eac1 100644 --- a/Notebooks/src/V1/Runtime/State.php +++ b/Notebooks/src/V1/Runtime/State.php @@ -102,6 +102,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Notebooks\V1\Runtime_State::class); diff --git a/Notebooks/src/V1/RuntimeAcceleratorConfig.php b/Notebooks/src/V1/RuntimeAcceleratorConfig.php index 8593eccf03f7..10aff3fbdc09 100644 --- a/Notebooks/src/V1/RuntimeAcceleratorConfig.php +++ b/Notebooks/src/V1/RuntimeAcceleratorConfig.php @@ -30,13 +30,13 @@ class RuntimeAcceleratorConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.RuntimeAcceleratorConfig.AcceleratorType type = 1; */ - private $type = 0; + protected $type = 0; /** * Count of cores of this accelerator. * * Generated from protobuf field int64 core_count = 2; */ - private $core_count = 0; + protected $core_count = 0; /** * Constructor. diff --git a/Notebooks/src/V1/RuntimeAcceleratorConfig/AcceleratorType.php b/Notebooks/src/V1/RuntimeAcceleratorConfig/AcceleratorType.php index 2804e7e85158..f3b0bbdcaedb 100644 --- a/Notebooks/src/V1/RuntimeAcceleratorConfig/AcceleratorType.php +++ b/Notebooks/src/V1/RuntimeAcceleratorConfig/AcceleratorType.php @@ -122,6 +122,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AcceleratorType::class, \Google\Cloud\Notebooks\V1\RuntimeAcceleratorConfig_AcceleratorType::class); diff --git a/Notebooks/src/V1/RuntimeAccessConfig.php b/Notebooks/src/V1/RuntimeAccessConfig.php index 822f85e8aab4..48279d238329 100644 --- a/Notebooks/src/V1/RuntimeAccessConfig.php +++ b/Notebooks/src/V1/RuntimeAccessConfig.php @@ -20,20 +20,20 @@ class RuntimeAccessConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.RuntimeAccessConfig.RuntimeAccessType access_type = 1; */ - private $access_type = 0; + protected $access_type = 0; /** * The owner of this runtime after creation. Format: `alias@example.com` * Currently supports one owner only. * * Generated from protobuf field string runtime_owner = 2; */ - private $runtime_owner = ''; + protected $runtime_owner = ''; /** * Output only. The proxy endpoint that is used to access the runtime. * * Generated from protobuf field string proxy_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $proxy_uri = ''; + protected $proxy_uri = ''; /** * Constructor. diff --git a/Notebooks/src/V1/RuntimeAccessConfig/RuntimeAccessType.php b/Notebooks/src/V1/RuntimeAccessConfig/RuntimeAccessType.php index 4893e511e971..d831cabb5da8 100644 --- a/Notebooks/src/V1/RuntimeAccessConfig/RuntimeAccessType.php +++ b/Notebooks/src/V1/RuntimeAccessConfig/RuntimeAccessType.php @@ -63,6 +63,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RuntimeAccessType::class, \Google\Cloud\Notebooks\V1\RuntimeAccessConfig_RuntimeAccessType::class); diff --git a/Notebooks/src/V1/RuntimeShieldedInstanceConfig.php b/Notebooks/src/V1/RuntimeShieldedInstanceConfig.php index 7046f1edf9a8..278de0fa9476 100644 --- a/Notebooks/src/V1/RuntimeShieldedInstanceConfig.php +++ b/Notebooks/src/V1/RuntimeShieldedInstanceConfig.php @@ -26,13 +26,13 @@ class RuntimeShieldedInstanceConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_secure_boot = 1; */ - private $enable_secure_boot = false; + protected $enable_secure_boot = false; /** * Defines whether the instance has the vTPM enabled. Enabled by default. * * Generated from protobuf field bool enable_vtpm = 2; */ - private $enable_vtpm = false; + protected $enable_vtpm = false; /** * Defines whether the instance has integrity monitoring enabled. * Enables monitoring and attestation of the boot integrity of the instance. @@ -42,7 +42,7 @@ class RuntimeShieldedInstanceConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_integrity_monitoring = 3; */ - private $enable_integrity_monitoring = false; + protected $enable_integrity_monitoring = false; /** * Constructor. diff --git a/Notebooks/src/V1/RuntimeSoftwareConfig.php b/Notebooks/src/V1/RuntimeSoftwareConfig.php index 1ef9c683f4ca..6aff9234d908 100644 --- a/Notebooks/src/V1/RuntimeSoftwareConfig.php +++ b/Notebooks/src/V1/RuntimeSoftwareConfig.php @@ -26,41 +26,41 @@ class RuntimeSoftwareConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string notebook_upgrade_schedule = 1; */ - private $notebook_upgrade_schedule = ''; + protected $notebook_upgrade_schedule = ''; /** * Verifies core internal services are running. * Default: True * * Generated from protobuf field optional bool enable_health_monitoring = 2; */ - private $enable_health_monitoring = null; + protected $enable_health_monitoring = null; /** * Runtime will automatically shutdown after idle_shutdown_time. * Default: True * * Generated from protobuf field optional bool idle_shutdown = 3; */ - private $idle_shutdown = null; + protected $idle_shutdown = null; /** * Time in minutes to wait before shutting down runtime. Default: 180 minutes * * Generated from protobuf field int32 idle_shutdown_timeout = 4; */ - private $idle_shutdown_timeout = 0; + protected $idle_shutdown_timeout = 0; /** * Install Nvidia Driver automatically. * Default: True * * Generated from protobuf field bool install_gpu_driver = 5; */ - private $install_gpu_driver = false; + protected $install_gpu_driver = false; /** * Specify a custom Cloud Storage path where the GPU driver is stored. * If not specified, we'll automatically choose from official GPU drivers. * * Generated from protobuf field string custom_gpu_driver_path = 6; */ - private $custom_gpu_driver_path = ''; + protected $custom_gpu_driver_path = ''; /** * Path to a Bash script that automatically runs after a notebook instance * fully boots up. The path must be a URL or @@ -68,7 +68,7 @@ class RuntimeSoftwareConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string post_startup_script = 7; */ - private $post_startup_script = ''; + protected $post_startup_script = ''; /** * Optional. Use a list of container images to use as Kernels in the notebook instance. * @@ -80,26 +80,26 @@ class RuntimeSoftwareConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional bool upgradeable = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $upgradeable = null; + protected $upgradeable = null; /** * Behavior for the post startup script. * * Generated from protobuf field .google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior post_startup_script_behavior = 10; */ - private $post_startup_script_behavior = 0; + protected $post_startup_script_behavior = 0; /** * Bool indicating whether JupyterLab terminal will be available or not. * Default: False * * Generated from protobuf field optional bool disable_terminal = 11; */ - private $disable_terminal = null; + protected $disable_terminal = null; /** * Output only. version of boot image such as M100, from release label of the image. * * Generated from protobuf field optional string version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $version = null; + protected $version = null; /** * Constructor. diff --git a/Notebooks/src/V1/RuntimeSoftwareConfig/PostStartupScriptBehavior.php b/Notebooks/src/V1/RuntimeSoftwareConfig/PostStartupScriptBehavior.php index 2f94ae4c207c..8abe10a6f0cf 100644 --- a/Notebooks/src/V1/RuntimeSoftwareConfig/PostStartupScriptBehavior.php +++ b/Notebooks/src/V1/RuntimeSoftwareConfig/PostStartupScriptBehavior.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PostStartupScriptBehavior::class, \Google\Cloud\Notebooks\V1\RuntimeSoftwareConfig_PostStartupScriptBehavior::class); diff --git a/Notebooks/src/V1/Schedule.php b/Notebooks/src/V1/Schedule.php index 9b316f311080..b71b84c1a035 100644 --- a/Notebooks/src/V1/Schedule.php +++ b/Notebooks/src/V1/Schedule.php @@ -21,7 +21,7 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. Display name used for UI purposes. * Name can only contain alphanumeric characters, hyphens `-`, @@ -29,17 +29,17 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $display_name = ''; + protected $display_name = ''; /** * A brief description of this environment. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Generated from protobuf field .google.cloud.notebooks.v1.Schedule.State state = 4; */ - private $state = 0; + protected $state = 0; /** * Cron-tab formatted schedule by which the job will execute. * Format: minute, hour, day of month, month, day of week, @@ -48,7 +48,7 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string cron_schedule = 5; */ - private $cron_schedule = ''; + protected $cron_schedule = ''; /** * Timezone on which the cron_schedule. * The value of this field must be a time zone name from the tz database. @@ -60,25 +60,25 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string time_zone = 6; */ - private $time_zone = ''; + protected $time_zone = ''; /** * Output only. Time the schedule was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time the schedule was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Notebook Execution Template corresponding to this schedule. * * Generated from protobuf field .google.cloud.notebooks.v1.ExecutionTemplate execution_template = 9; */ - private $execution_template = null; + protected $execution_template = null; /** * Output only. The most recent execution names triggered from this schedule and their * corresponding states. diff --git a/Notebooks/src/V1/Schedule/State.php b/Notebooks/src/V1/Schedule/State.php index c75aef0bb897..0a013c1822f7 100644 --- a/Notebooks/src/V1/Schedule/State.php +++ b/Notebooks/src/V1/Schedule/State.php @@ -92,6 +92,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Notebooks\V1\Schedule_State::class); diff --git a/Notebooks/src/V1/SetInstanceAcceleratorRequest.php b/Notebooks/src/V1/SetInstanceAcceleratorRequest.php index 3efe85479245..a8991d313283 100644 --- a/Notebooks/src/V1/SetInstanceAcceleratorRequest.php +++ b/Notebooks/src/V1/SetInstanceAcceleratorRequest.php @@ -21,13 +21,13 @@ class SetInstanceAcceleratorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. Type of this accelerator. * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.AcceleratorType type = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $type = 0; + protected $type = 0; /** * Required. Count of cores of this accelerator. Note that not all combinations * of `type` and `core_count` are valid. Check [GPUs on @@ -36,7 +36,7 @@ class SetInstanceAcceleratorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 core_count = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $core_count = 0; + protected $core_count = 0; /** * Constructor. diff --git a/Notebooks/src/V1/SetInstanceLabelsRequest.php b/Notebooks/src/V1/SetInstanceLabelsRequest.php index 30dc7565e8c2..1b05aa04ab3c 100644 --- a/Notebooks/src/V1/SetInstanceLabelsRequest.php +++ b/Notebooks/src/V1/SetInstanceLabelsRequest.php @@ -21,7 +21,7 @@ class SetInstanceLabelsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Labels to apply to this instance. * These can be later modified by the setLabels method diff --git a/Notebooks/src/V1/SetInstanceMachineTypeRequest.php b/Notebooks/src/V1/SetInstanceMachineTypeRequest.php index ee0ca6c34cb7..0046af14c896 100644 --- a/Notebooks/src/V1/SetInstanceMachineTypeRequest.php +++ b/Notebooks/src/V1/SetInstanceMachineTypeRequest.php @@ -21,14 +21,14 @@ class SetInstanceMachineTypeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The [Compute Engine machine * type](https://cloud.google.com/compute/docs/machine-types). * * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $machine_type = ''; + protected $machine_type = ''; /** * Constructor. diff --git a/Notebooks/src/V1/StartInstanceRequest.php b/Notebooks/src/V1/StartInstanceRequest.php index 84cec4c3ca92..fd0251b536cd 100644 --- a/Notebooks/src/V1/StartInstanceRequest.php +++ b/Notebooks/src/V1/StartInstanceRequest.php @@ -21,7 +21,7 @@ class StartInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Notebooks/src/V1/StartRuntimeRequest.php b/Notebooks/src/V1/StartRuntimeRequest.php index 3bd61abdf737..da0fff0d9c0f 100644 --- a/Notebooks/src/V1/StartRuntimeRequest.php +++ b/Notebooks/src/V1/StartRuntimeRequest.php @@ -21,13 +21,13 @@ class StartRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Idempotent request UUID. * * Generated from protobuf field string request_id = 2; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/StopInstanceRequest.php b/Notebooks/src/V1/StopInstanceRequest.php index 13e61963c0a4..8ece20d7764e 100644 --- a/Notebooks/src/V1/StopInstanceRequest.php +++ b/Notebooks/src/V1/StopInstanceRequest.php @@ -21,7 +21,7 @@ class StopInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Notebooks/src/V1/StopRuntimeRequest.php b/Notebooks/src/V1/StopRuntimeRequest.php index dd830af0a7da..9214951474e6 100644 --- a/Notebooks/src/V1/StopRuntimeRequest.php +++ b/Notebooks/src/V1/StopRuntimeRequest.php @@ -21,13 +21,13 @@ class StopRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Idempotent request UUID. * * Generated from protobuf field string request_id = 2; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/SwitchRuntimeRequest.php b/Notebooks/src/V1/SwitchRuntimeRequest.php index 6e8f514f030c..7b9edc1008cc 100644 --- a/Notebooks/src/V1/SwitchRuntimeRequest.php +++ b/Notebooks/src/V1/SwitchRuntimeRequest.php @@ -21,25 +21,25 @@ class SwitchRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * machine type. * * Generated from protobuf field string machine_type = 2; */ - private $machine_type = ''; + protected $machine_type = ''; /** * accelerator config. * * Generated from protobuf field .google.cloud.notebooks.v1.RuntimeAcceleratorConfig accelerator_config = 3; */ - private $accelerator_config = null; + protected $accelerator_config = null; /** * Idempotent request UUID. * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/TriggerScheduleRequest.php b/Notebooks/src/V1/TriggerScheduleRequest.php index 055810ef270b..c3e6b514d541 100644 --- a/Notebooks/src/V1/TriggerScheduleRequest.php +++ b/Notebooks/src/V1/TriggerScheduleRequest.php @@ -21,7 +21,7 @@ class TriggerScheduleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Notebooks/src/V1/UpdateInstanceConfigRequest.php b/Notebooks/src/V1/UpdateInstanceConfigRequest.php index 11848cc46efc..2078a1ee9c1a 100644 --- a/Notebooks/src/V1/UpdateInstanceConfigRequest.php +++ b/Notebooks/src/V1/UpdateInstanceConfigRequest.php @@ -21,13 +21,13 @@ class UpdateInstanceConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * The instance configurations to be updated. * * Generated from protobuf field .google.cloud.notebooks.v1.InstanceConfig config = 2; */ - private $config = null; + protected $config = null; /** * Constructor. diff --git a/Notebooks/src/V1/UpdateInstanceMetadataItemsRequest.php b/Notebooks/src/V1/UpdateInstanceMetadataItemsRequest.php index cf0dad7fb944..397f1889d94f 100644 --- a/Notebooks/src/V1/UpdateInstanceMetadataItemsRequest.php +++ b/Notebooks/src/V1/UpdateInstanceMetadataItemsRequest.php @@ -21,7 +21,7 @@ class UpdateInstanceMetadataItemsRequest extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Metadata items to add/update for the instance. * diff --git a/Notebooks/src/V1/UpdateRuntimeRequest.php b/Notebooks/src/V1/UpdateRuntimeRequest.php index 0f3d5647fdb2..a91ad274204a 100644 --- a/Notebooks/src/V1/UpdateRuntimeRequest.php +++ b/Notebooks/src/V1/UpdateRuntimeRequest.php @@ -20,7 +20,7 @@ class UpdateRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.Runtime runtime = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $runtime = null; + protected $runtime = null; /** * Required. Specifies the path, relative to `Runtime`, of * the field to update. For example, to change the software configuration @@ -45,13 +45,13 @@ class UpdateRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Idempotent request UUID. * * Generated from protobuf field string request_id = 3; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\Notebooks\V1\Runtime $runtime Required. The Runtime to be updated. diff --git a/Notebooks/src/V1/UpdateShieldedInstanceConfigRequest.php b/Notebooks/src/V1/UpdateShieldedInstanceConfigRequest.php index 2b3485cee78e..7c09308bcf3c 100644 --- a/Notebooks/src/V1/UpdateShieldedInstanceConfigRequest.php +++ b/Notebooks/src/V1/UpdateShieldedInstanceConfigRequest.php @@ -22,13 +22,13 @@ class UpdateShieldedInstanceConfigRequest extends \Google\Protobuf\Internal\Mess * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * ShieldedInstance configuration to be updated. * * Generated from protobuf field .google.cloud.notebooks.v1.Instance.ShieldedInstanceConfig shielded_instance_config = 2; */ - private $shielded_instance_config = null; + protected $shielded_instance_config = null; /** * Constructor. diff --git a/Notebooks/src/V1/UpgradeInstanceInternalRequest.php b/Notebooks/src/V1/UpgradeInstanceInternalRequest.php index f3392951752c..583a3256c765 100644 --- a/Notebooks/src/V1/UpgradeInstanceInternalRequest.php +++ b/Notebooks/src/V1/UpgradeInstanceInternalRequest.php @@ -21,21 +21,21 @@ class UpgradeInstanceInternalRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The VM hardware token for authenticating the VM. * https://cloud.google.com/compute/docs/instances/verifying-instance-identity * * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $vm_id = ''; + protected $vm_id = ''; /** * Optional. The optional UpgradeType. Setting this field will search for additional * compute images to upgrade this instance. * * Generated from protobuf field .google.cloud.notebooks.v1.UpgradeType type = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Notebooks/src/V1/UpgradeInstanceRequest.php b/Notebooks/src/V1/UpgradeInstanceRequest.php index 0af614121f1a..16e89def7081 100644 --- a/Notebooks/src/V1/UpgradeInstanceRequest.php +++ b/Notebooks/src/V1/UpgradeInstanceRequest.php @@ -21,14 +21,14 @@ class UpgradeInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. The optional UpgradeType. Setting this field will search for additional * compute images to upgrade this instance. * * Generated from protobuf field .google.cloud.notebooks.v1.UpgradeType type = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type = 0; + protected $type = 0; /** * Constructor. diff --git a/Notebooks/src/V1/UpgradeRuntimeRequest.php b/Notebooks/src/V1/UpgradeRuntimeRequest.php index d244e0433035..019158ec9b8d 100644 --- a/Notebooks/src/V1/UpgradeRuntimeRequest.php +++ b/Notebooks/src/V1/UpgradeRuntimeRequest.php @@ -23,13 +23,13 @@ class UpgradeRuntimeRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Idempotent request UUID. * * Generated from protobuf field string request_id = 2; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V1/VirtualMachine.php b/Notebooks/src/V1/VirtualMachine.php index fd34c8ee940e..7f76639f36dc 100644 --- a/Notebooks/src/V1/VirtualMachine.php +++ b/Notebooks/src/V1/VirtualMachine.php @@ -20,19 +20,19 @@ class VirtualMachine extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string instance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $instance_name = ''; + protected $instance_name = ''; /** * Output only. The unique identifier of the Managed Compute Engine instance. * * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $instance_id = ''; + protected $instance_id = ''; /** * Virtual Machine configuration settings. * * Generated from protobuf field .google.cloud.notebooks.v1.VirtualMachineConfig virtual_machine_config = 3; */ - private $virtual_machine_config = null; + protected $virtual_machine_config = null; /** * Constructor. diff --git a/Notebooks/src/V1/VirtualMachineConfig.php b/Notebooks/src/V1/VirtualMachineConfig.php index 1109ca8ba36c..b4298431489c 100644 --- a/Notebooks/src/V1/VirtualMachineConfig.php +++ b/Notebooks/src/V1/VirtualMachineConfig.php @@ -24,7 +24,7 @@ class VirtualMachineConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $zone = ''; + protected $zone = ''; /** * Required. The Compute Engine machine type used for runtimes. * Short name is valid. Examples: @@ -33,7 +33,7 @@ class VirtualMachineConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $machine_type = ''; + protected $machine_type = ''; /** * Optional. Use a list of container images to use as Kernels in the notebook instance. * @@ -45,25 +45,25 @@ class VirtualMachineConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.LocalDisk data_disk = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $data_disk = null; + protected $data_disk = null; /** * Optional. Encryption settings for virtual machine data disk. * * Generated from protobuf field .google.cloud.notebooks.v1.EncryptionConfig encryption_config = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $encryption_config = null; + protected $encryption_config = null; /** * Optional. Shielded VM Instance configuration settings. * * Generated from protobuf field .google.cloud.notebooks.v1.RuntimeShieldedInstanceConfig shielded_instance_config = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $shielded_instance_config = null; + protected $shielded_instance_config = null; /** * Optional. The Compute Engine accelerator configuration for this runtime. * * Generated from protobuf field .google.cloud.notebooks.v1.RuntimeAcceleratorConfig accelerator_config = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $accelerator_config = null; + protected $accelerator_config = null; /** * Optional. The Compute Engine network to be used for machine * communications. Cannot be specified with subnetwork. If neither @@ -82,7 +82,7 @@ class VirtualMachineConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $network = ''; + protected $network = ''; /** * Optional. The Compute Engine subnetwork to be used for machine * communications. Cannot be specified with network. @@ -92,7 +92,7 @@ class VirtualMachineConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string subnet = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $subnet = ''; + protected $subnet = ''; /** * Optional. If true, runtime will only have internal IP * addresses. By default, runtimes are not restricted to internal IP @@ -103,7 +103,7 @@ class VirtualMachineConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool internal_ip_only = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $internal_ip_only = false; + protected $internal_ip_only = false; /** * Optional. The Compute Engine tags to add to runtime (see [Tagging * instances](https://cloud.google.com/compute/docs/label-or-tag-resources#tags)). @@ -146,7 +146,7 @@ class VirtualMachineConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v1.VirtualMachineConfig.NicType nic_type = 17 [(.google.api.field_behavior) = OPTIONAL]; */ - private $nic_type = 0; + protected $nic_type = 0; /** * Optional. Reserved IP Range name is used for VPC Peering. * The subnetwork allocation will use the range *name* if it's assigned. @@ -163,13 +163,13 @@ class VirtualMachineConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string reserved_ip_range = 18 [(.google.api.field_behavior) = OPTIONAL]; */ - private $reserved_ip_range = ''; + protected $reserved_ip_range = ''; /** * Optional. Boot image metadata used for runtime upgradeability. * * Generated from protobuf field .google.cloud.notebooks.v1.VirtualMachineConfig.BootImage boot_image = 19 [(.google.api.field_behavior) = OPTIONAL]; */ - private $boot_image = null; + protected $boot_image = null; /** * Constructor. diff --git a/Notebooks/src/V1/VirtualMachineConfig/BootImage.php b/Notebooks/src/V1/VirtualMachineConfig/BootImage.php index 62c028e84006..463ba69f5b52 100644 --- a/Notebooks/src/V1/VirtualMachineConfig/BootImage.php +++ b/Notebooks/src/V1/VirtualMachineConfig/BootImage.php @@ -32,6 +32,4 @@ public function __construct($data = NULL) { } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BootImage::class, \Google\Cloud\Notebooks\V1\VirtualMachineConfig_BootImage::class); diff --git a/Notebooks/src/V1/VirtualMachineConfig/NicType.php b/Notebooks/src/V1/VirtualMachineConfig/NicType.php index 2432a9b28a55..6d532c37c334 100644 --- a/Notebooks/src/V1/VirtualMachineConfig/NicType.php +++ b/Notebooks/src/V1/VirtualMachineConfig/NicType.php @@ -60,6 +60,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NicType::class, \Google\Cloud\Notebooks\V1\VirtualMachineConfig_NicType::class); diff --git a/Notebooks/src/V1/VmImage.php b/Notebooks/src/V1/VmImage.php index 8ab5f1a78bef..e4c537d0a018 100644 --- a/Notebooks/src/V1/VmImage.php +++ b/Notebooks/src/V1/VmImage.php @@ -22,7 +22,7 @@ class VmImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $project = ''; + protected $project = ''; protected $image; /** diff --git a/Notebooks/src/V1beta1/ContainerImage.php b/Notebooks/src/V1beta1/ContainerImage.php deleted file mode 100644 index d61cc974ecde..000000000000 --- a/Notebooks/src/V1beta1/ContainerImage.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.notebooks.v1beta1.ContainerImage - */ -class ContainerImage extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The path to the container image repository. For example: - * `gcr.io/{project_id}/{image_name}` - * - * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $repository = ''; - /** - * The tag of the container image. If not specified, this defaults - * to the latest tag. - * - * Generated from protobuf field string tag = 2; - */ - private $tag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repository - * Required. The path to the container image repository. For example: - * `gcr.io/{project_id}/{image_name}` - * @type string $tag - * The tag of the container image. If not specified, this defaults - * to the latest tag. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Environment::initOnce(); - parent::__construct($data); - } - - /** - * Required. The path to the container image repository. For example: - * `gcr.io/{project_id}/{image_name}` - * - * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getRepository() - { - return $this->repository; - } - - /** - * Required. The path to the container image repository. For example: - * `gcr.io/{project_id}/{image_name}` - * - * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->repository = $var; - - return $this; - } - - /** - * The tag of the container image. If not specified, this defaults - * to the latest tag. - * - * Generated from protobuf field string tag = 2; - * @return string - */ - public function getTag() - { - return $this->tag; - } - - /** - * The tag of the container image. If not specified, this defaults - * to the latest tag. - * - * Generated from protobuf field string tag = 2; - * @param string $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkString($var, True); - $this->tag = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/CreateEnvironmentRequest.php b/Notebooks/src/V1beta1/CreateEnvironmentRequest.php deleted file mode 100644 index 34875db33e53..000000000000 --- a/Notebooks/src/V1beta1/CreateEnvironmentRequest.php +++ /dev/null @@ -1,157 +0,0 @@ -google.cloud.notebooks.v1beta1.CreateEnvironmentRequest - */ -class CreateEnvironmentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: `projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $parent = ''; - /** - * Required. User-defined unique ID of this environment. The `environment_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * - * Generated from protobuf field string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $environment_id = ''; - /** - * Required. The environment to be created. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Environment environment = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $environment = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Format: `projects/{project_id}/locations/{location}` - * @type string $environment_id - * Required. User-defined unique ID of this environment. The `environment_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * @type \Google\Cloud\Notebooks\V1beta1\Environment $environment - * Required. The environment to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: `projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Format: `projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. User-defined unique ID of this environment. The `environment_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * - * Generated from protobuf field string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEnvironmentId() - { - return $this->environment_id; - } - - /** - * Required. User-defined unique ID of this environment. The `environment_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * - * Generated from protobuf field string environment_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEnvironmentId($var) - { - GPBUtil::checkString($var, True); - $this->environment_id = $var; - - return $this; - } - - /** - * Required. The environment to be created. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Environment environment = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Notebooks\V1beta1\Environment|null - */ - public function getEnvironment() - { - return $this->environment; - } - - public function hasEnvironment() - { - return isset($this->environment); - } - - public function clearEnvironment() - { - unset($this->environment); - } - - /** - * Required. The environment to be created. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Environment environment = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Notebooks\V1beta1\Environment $var - * @return $this - */ - public function setEnvironment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Notebooks\V1beta1\Environment::class); - $this->environment = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/CreateInstanceRequest.php b/Notebooks/src/V1beta1/CreateInstanceRequest.php deleted file mode 100644 index dfbf290e2d53..000000000000 --- a/Notebooks/src/V1beta1/CreateInstanceRequest.php +++ /dev/null @@ -1,149 +0,0 @@ -google.cloud.notebooks.v1beta1.CreateInstanceRequest - */ -class CreateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $parent = ''; - /** - * Required. User-defined unique ID of this instance. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $instance_id = ''; - /** - * Required. The instance to be created. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $instance = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * @type string $instance_id - * Required. User-defined unique ID of this instance. - * @type \Google\Cloud\Notebooks\V1beta1\Instance $instance - * Required. The instance to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. User-defined unique ID of this instance. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. User-defined unique ID of this instance. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. The instance to be created. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Notebooks\V1beta1\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The instance to be created. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Notebooks\V1beta1\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Notebooks\V1beta1\Instance::class); - $this->instance = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/DeleteEnvironmentRequest.php b/Notebooks/src/V1beta1/DeleteEnvironmentRequest.php deleted file mode 100644 index 8f4089e19654..000000000000 --- a/Notebooks/src/V1beta1/DeleteEnvironmentRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.notebooks.v1beta1.DeleteEnvironmentRequest - */ -class DeleteEnvironmentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/DeleteInstanceRequest.php b/Notebooks/src/V1beta1/DeleteInstanceRequest.php deleted file mode 100644 index b751b50a4cb4..000000000000 --- a/Notebooks/src/V1beta1/DeleteInstanceRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.notebooks.v1beta1.DeleteInstanceRequest - */ -class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/Environment.php b/Notebooks/src/V1beta1/Environment.php deleted file mode 100644 index cd20997095ae..000000000000 --- a/Notebooks/src/V1beta1/Environment.php +++ /dev/null @@ -1,305 +0,0 @@ -google.cloud.notebooks.v1beta1.Environment - */ -class Environment extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Name of this environment. - * Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Display name of this environment for the UI. - * - * Generated from protobuf field string display_name = 2; - */ - private $display_name = ''; - /** - * A brief description of this environment. - * - * Generated from protobuf field string description = 3; - */ - private $description = ''; - /** - * Path to a Bash script that automatically runs after a notebook instance - * fully boots up. The path must be a URL or - * Cloud Storage path. Example: `"gs://path-to-file/file-name"` - * - * Generated from protobuf field string post_startup_script = 8; - */ - private $post_startup_script = ''; - /** - * Output only. The time at which this environment was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - protected $image_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Name of this environment. - * Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * @type string $display_name - * Display name of this environment for the UI. - * @type string $description - * A brief description of this environment. - * @type \Google\Cloud\Notebooks\V1beta1\VmImage $vm_image - * Use a Compute Engine VM image to start the notebook instance. - * @type \Google\Cloud\Notebooks\V1beta1\ContainerImage $container_image - * Use a container image to start the notebook instance. - * @type string $post_startup_script - * Path to a Bash script that automatically runs after a notebook instance - * fully boots up. The path must be a URL or - * Cloud Storage path. Example: `"gs://path-to-file/file-name"` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time at which this environment was created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Environment::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Name of this environment. - * Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Name of this environment. - * Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Display name of this environment for the UI. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Display name of this environment for the UI. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * A brief description of this environment. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * A brief description of this environment. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Use a Compute Engine VM image to start the notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.VmImage vm_image = 6; - * @return \Google\Cloud\Notebooks\V1beta1\VmImage|null - */ - public function getVmImage() - { - return $this->readOneof(6); - } - - public function hasVmImage() - { - return $this->hasOneof(6); - } - - /** - * Use a Compute Engine VM image to start the notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.VmImage vm_image = 6; - * @param \Google\Cloud\Notebooks\V1beta1\VmImage $var - * @return $this - */ - public function setVmImage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Notebooks\V1beta1\VmImage::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Use a container image to start the notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ContainerImage container_image = 7; - * @return \Google\Cloud\Notebooks\V1beta1\ContainerImage|null - */ - public function getContainerImage() - { - return $this->readOneof(7); - } - - public function hasContainerImage() - { - return $this->hasOneof(7); - } - - /** - * Use a container image to start the notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ContainerImage container_image = 7; - * @param \Google\Cloud\Notebooks\V1beta1\ContainerImage $var - * @return $this - */ - public function setContainerImage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Notebooks\V1beta1\ContainerImage::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Path to a Bash script that automatically runs after a notebook instance - * fully boots up. The path must be a URL or - * Cloud Storage path. Example: `"gs://path-to-file/file-name"` - * - * Generated from protobuf field string post_startup_script = 8; - * @return string - */ - public function getPostStartupScript() - { - return $this->post_startup_script; - } - - /** - * Path to a Bash script that automatically runs after a notebook instance - * fully boots up. The path must be a URL or - * Cloud Storage path. Example: `"gs://path-to-file/file-name"` - * - * Generated from protobuf field string post_startup_script = 8; - * @param string $var - * @return $this - */ - public function setPostStartupScript($var) - { - GPBUtil::checkString($var, True); - $this->post_startup_script = $var; - - return $this; - } - - /** - * Output only. The time at which this environment was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time at which this environment was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * @return string - */ - public function getImageType() - { - return $this->whichOneof("image_type"); - } - -} - diff --git a/Notebooks/src/V1beta1/Gapic/NotebookServiceGapicClient.php b/Notebooks/src/V1beta1/Gapic/NotebookServiceGapicClient.php deleted file mode 100644 index beaea9086cc7..000000000000 --- a/Notebooks/src/V1beta1/Gapic/NotebookServiceGapicClient.php +++ /dev/null @@ -1,1955 +0,0 @@ -createEnvironment($parent, $environmentId, $environment); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->createEnvironment($parent, $environmentId, $environment); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'createEnvironment'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class NotebookServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.notebooks.v1beta1.NotebookService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'notebooks.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'notebooks.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $environmentNameTemplate; - - private static $instanceNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/notebook_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/notebook_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/notebook_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/notebook_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEnvironmentNameTemplate() - { - if (self::$environmentNameTemplate == null) { - self::$environmentNameTemplate = new PathTemplate('projects/{project}/environments/{environment}'); - } - - return self::$environmentNameTemplate; - } - - private static function getInstanceNameTemplate() - { - if (self::$instanceNameTemplate == null) { - self::$instanceNameTemplate = new PathTemplate('projects/{project}/instances/{instance}'); - } - - return self::$instanceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'environment' => self::getEnvironmentNameTemplate(), - 'instance' => self::getInstanceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a environment - * resource. - * - * @param string $project - * @param string $environment - * - * @return string The formatted environment resource. - * - * @experimental - */ - public static function environmentName($project, $environment) - { - return self::getEnvironmentNameTemplate()->render([ - 'project' => $project, - 'environment' => $environment, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $instance - * - * @return string The formatted instance resource. - * - * @experimental - */ - public static function instanceName($project, $instance) - { - return self::getInstanceNameTemplate()->render([ - 'project' => $project, - 'instance' => $instance, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - environment: projects/{project}/environments/{environment} - * - instance: projects/{project}/instances/{instance} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'notebooks.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a new Environment. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $parent = 'parent'; - * $environmentId = 'environment_id'; - * $environment = new Environment(); - * $operationResponse = $notebookServiceClient->createEnvironment($parent, $environmentId, $environment); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->createEnvironment($parent, $environmentId, $environment); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'createEnvironment'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Format: `projects/{project_id}/locations/{location}` - * @param string $environmentId Required. User-defined unique ID of this environment. The `environment_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * @param Environment $environment Required. The environment to be created. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createEnvironment($parent, $environmentId, $environment, array $optionalArgs = []) - { - $request = new CreateEnvironmentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEnvironmentId($environmentId); - $request->setEnvironment($environment); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateEnvironment', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Instance in a given project and location. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $parent = 'parent'; - * $instanceId = 'instance_id'; - * $instance = new Instance(); - * $operationResponse = $notebookServiceClient->createInstance($parent, $instanceId, $instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->createInstance($parent, $instanceId, $instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'createInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * @param string $instanceId Required. User-defined unique ID of this instance. - * @param Instance $instance Required. The instance to be created. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createInstance($parent, $instanceId, $instance, array $optionalArgs = []) - { - $request = new CreateInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $request->setInstance($instance); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single Environment. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $operationResponse = $notebookServiceClient->deleteEnvironment($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->deleteEnvironment($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'deleteEnvironment'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteEnvironment($name, array $optionalArgs = []) - { - $request = new DeleteEnvironmentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteEnvironment', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single Instance. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $operationResponse = $notebookServiceClient->deleteInstance($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->deleteInstance($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'deleteInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteInstance($name, array $optionalArgs = []) - { - $request = new DeleteInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets details of a single Environment. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $response = $notebookServiceClient->getEnvironment($name); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Notebooks\V1beta1\Environment - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getEnvironment($name, array $optionalArgs = []) - { - $request = new GetEnvironmentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetEnvironment', Environment::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Instance. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $response = $notebookServiceClient->getInstance($name); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Notebooks\V1beta1\Instance - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getInstance($name, array $optionalArgs = []) - { - $request = new GetInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetInstance', Instance::class, $optionalArgs, $request)->wait(); - } - - /** - * Check if a notebook instance is upgradable. - * Deprecated. Please consider using v1. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $notebookInstance = 'notebook_instance'; - * $response = $notebookServiceClient->isInstanceUpgradeable($notebookInstance); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $notebookInstance Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Notebooks\V1beta1\IsInstanceUpgradeableResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - * - * @deprecated This method will be removed in the next major version update. - */ - public function isInstanceUpgradeable($notebookInstance, array $optionalArgs = []) - { - $request = new IsInstanceUpgradeableRequest(); - $requestParamHeaders = []; - $request->setNotebookInstance($notebookInstance); - $requestParamHeaders['notebook_instance'] = $notebookInstance; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('IsInstanceUpgradeable', IsInstanceUpgradeableResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists environments in a project. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $notebookServiceClient->listEnvironments($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $notebookServiceClient->listEnvironments($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Format: `projects/{project_id}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listEnvironments($parent, array $optionalArgs = []) - { - $request = new ListEnvironmentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListEnvironments', $optionalArgs, ListEnvironmentsResponse::class, $request); - } - - /** - * Lists instances in a given project and location. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $notebookServiceClient->listInstances($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $notebookServiceClient->listInstances($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listInstances($parent, array $optionalArgs = []) - { - $request = new ListInstancesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListInstances', $optionalArgs, ListInstancesResponse::class, $request); - } - - /** - * Registers an existing legacy notebook instance to the Notebooks API server. - * Legacy instances are instances created with the legacy Compute Engine - * calls. They are not manageable by the Notebooks API out of the box. This - * call makes these instances manageable by the Notebooks API. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $parent = 'parent'; - * $instanceId = 'instance_id'; - * $operationResponse = $notebookServiceClient->registerInstance($parent, $instanceId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->registerInstance($parent, $instanceId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'registerInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * @param string $instanceId Required. User defined unique ID of this instance. The `instance_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function registerInstance($parent, $instanceId, array $optionalArgs = []) - { - $request = new RegisterInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RegisterInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Allows notebook instances to - * report their latest instance information to the Notebooks - * API server. The server will merge the reported information to - * the instance metadata store. Do not use this method directly. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $vmId = 'vm_id'; - * $operationResponse = $notebookServiceClient->reportInstanceInfo($name, $vmId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->reportInstanceInfo($name, $vmId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'reportInstanceInfo'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param string $vmId Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * @param array $optionalArgs { - * Optional. - * - * @type array $metadata - * The metadata reported to Notebooks API. This will be merged to the instance - * metadata store - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function reportInstanceInfo($name, $vmId, array $optionalArgs = []) - { - $request = new ReportInstanceInfoRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setVmId($vmId); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['metadata'])) { - $request->setMetadata($optionalArgs['metadata']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ReportInstanceInfo', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Resets a notebook instance. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $operationResponse = $notebookServiceClient->resetInstance($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->resetInstance($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'resetInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function resetInstance($name, array $optionalArgs = []) - { - $request = new ResetInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ResetInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the guest accelerators of a single Instance. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $type = AcceleratorType::ACCELERATOR_TYPE_UNSPECIFIED; - * $coreCount = 0; - * $operationResponse = $notebookServiceClient->setInstanceAccelerator($name, $type, $coreCount); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->setInstanceAccelerator($name, $type, $coreCount); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'setInstanceAccelerator'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param int $type Required. Type of this accelerator. - * For allowed values, use constants defined on {@see \Google\Cloud\Notebooks\V1beta1\Instance\AcceleratorType} - * @param int $coreCount Required. Count of cores of this accelerator. Note that not all combinations - * of `type` and `core_count` are valid. Check [GPUs on - * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to - * find a valid combination. TPUs are not supported. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setInstanceAccelerator($name, $type, $coreCount, array $optionalArgs = []) - { - $request = new SetInstanceAcceleratorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setType($type); - $request->setCoreCount($coreCount); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('SetInstanceAccelerator', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the labels of an Instance. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $operationResponse = $notebookServiceClient->setInstanceLabels($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->setInstanceLabels($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'setInstanceLabels'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param array $optionalArgs { - * Optional. - * - * @type array $labels - * Labels to apply to this instance. - * These can be later modified by the setLabels method - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setInstanceLabels($name, array $optionalArgs = []) - { - $request = new SetInstanceLabelsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['labels'])) { - $request->setLabels($optionalArgs['labels']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('SetInstanceLabels', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the machine type of a single Instance. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $machineType = 'machine_type'; - * $operationResponse = $notebookServiceClient->setInstanceMachineType($name, $machineType); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->setInstanceMachineType($name, $machineType); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'setInstanceMachineType'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param string $machineType Required. The [Compute Engine machine - * type](https://cloud.google.com/compute/docs/machine-types). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setInstanceMachineType($name, $machineType, array $optionalArgs = []) - { - $request = new SetInstanceMachineTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setMachineType($machineType); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('SetInstanceMachineType', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Starts a notebook instance. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $operationResponse = $notebookServiceClient->startInstance($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->startInstance($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'startInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function startInstance($name, array $optionalArgs = []) - { - $request = new StartInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('StartInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Stops a notebook instance. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $operationResponse = $notebookServiceClient->stopInstance($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->stopInstance($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'stopInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function stopInstance($name, array $optionalArgs = []) - { - $request = new StopInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('StopInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Upgrades a notebook instance to the latest version. - * Deprecated. Please consider using v1. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $operationResponse = $notebookServiceClient->upgradeInstance($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->upgradeInstance($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'upgradeInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - * - * @deprecated This method will be removed in the next major version update. - */ - public function upgradeInstance($name, array $optionalArgs = []) - { - $request = new UpgradeInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpgradeInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Allows notebook instances to - * call this endpoint to upgrade themselves. Do not use this method directly. - * Deprecated. Please consider using v1. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $name = 'name'; - * $vmId = 'vm_id'; - * $operationResponse = $notebookServiceClient->upgradeInstanceInternal($name, $vmId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $notebookServiceClient->upgradeInstanceInternal($name, $vmId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $notebookServiceClient->resumeOperation($operationName, 'upgradeInstanceInternal'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param string $vmId Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - * - * @deprecated This method will be removed in the next major version update. - */ - public function upgradeInstanceInternal($name, $vmId, array $optionalArgs = []) - { - $request = new UpgradeInstanceInternalRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setVmId($vmId); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpgradeInstanceInternal', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $response = $notebookServiceClient->getLocation(); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $notebookServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $notebookServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $resource = 'resource'; - * $response = $notebookServiceClient->getIamPolicy($resource); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $notebookServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $notebookServiceClient = new NotebookServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $notebookServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $notebookServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/Notebooks/src/V1beta1/GetEnvironmentRequest.php b/Notebooks/src/V1beta1/GetEnvironmentRequest.php deleted file mode 100644 index 9ef6dcb4c521..000000000000 --- a/Notebooks/src/V1beta1/GetEnvironmentRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.notebooks.v1beta1.GetEnvironmentRequest - */ -class GetEnvironmentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/environments/{environment_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/GetInstanceRequest.php b/Notebooks/src/V1beta1/GetInstanceRequest.php deleted file mode 100644 index 8a3ea2a489cb..000000000000 --- a/Notebooks/src/V1beta1/GetInstanceRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.notebooks.v1beta1.GetInstanceRequest - */ -class GetInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/Instance.php b/Notebooks/src/V1beta1/Instance.php deleted file mode 100644 index 9ac03c2d5999..000000000000 --- a/Notebooks/src/V1beta1/Instance.php +++ /dev/null @@ -1,1268 +0,0 @@ -google.cloud.notebooks.v1beta1.Instance - */ -class Instance extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of this notebook instance. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Path to a Bash script that automatically runs after a notebook instance - * fully boots up. The path must be a URL or - * Cloud Storage path (`gs://path-to-file/file-name`). - * - * Generated from protobuf field string post_startup_script = 4; - */ - private $post_startup_script = ''; - /** - * Output only. The proxy endpoint that is used to access the Jupyter notebook. - * - * Generated from protobuf field string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $proxy_uri = ''; - /** - * Input only. The owner of this instance after creation. Format: `alias@example.com` - * Currently supports one owner only. If not specified, all of the service - * account users of your VM instance's service account can use - * the instance. - * - * Generated from protobuf field repeated string instance_owners = 6 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $instance_owners; - /** - * The service account on this instance, giving access to other Google - * Cloud services. - * You can use any service account within the same project, but you - * must have the service account user permission to use the instance. - * If not specified, the [Compute Engine default service - * account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - * is used. - * - * Generated from protobuf field string service_account = 7; - */ - private $service_account = ''; - /** - * Required. The [Compute Engine machine - * type](https://cloud.google.com/compute/docs/machine-types) of this - * instance. - * - * Generated from protobuf field string machine_type = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - private $machine_type = ''; - /** - * The hardware accelerator used on this instance. If you use - * accelerators, make sure that your configuration has - * [enough vCPUs and memory to support the `machine_type` you have - * selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; - */ - private $accelerator_config = null; - /** - * Output only. The state of this instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Whether the end user authorizes Google Cloud to install GPU driver - * on this instance. - * If this field is empty or set to false, the GPU driver won't be installed. - * Only applicable to instances with GPUs. - * - * Generated from protobuf field bool install_gpu_driver = 11; - */ - private $install_gpu_driver = false; - /** - * Specify a custom Cloud Storage path where the GPU driver is stored. - * If not specified, we'll automatically choose from official GPU drivers. - * - * Generated from protobuf field string custom_gpu_driver_path = 12; - */ - private $custom_gpu_driver_path = ''; - /** - * Input only. The type of the boot disk attached to this instance, defaults to - * standard persistent disk (`PD_STANDARD`). - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.DiskType boot_disk_type = 13 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $boot_disk_type = 0; - /** - * Input only. The size of the boot disk in GB attached to this instance, up to a maximum - * of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not - * specified, this defaults to 100. - * - * Generated from protobuf field int64 boot_disk_size_gb = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $boot_disk_size_gb = 0; - /** - * Input only. The type of the data disk attached to this instance, defaults to - * standard persistent disk (`PD_STANDARD`). - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.DiskType data_disk_type = 25 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $data_disk_type = 0; - /** - * Input only. The size of the data disk in GB attached to this instance, up to a maximum - * of 64000 GB (64 TB). You can choose the size of the data disk based on how - * big your notebooks and data are. If not specified, this defaults to 100. - * - * Generated from protobuf field int64 data_disk_size_gb = 26 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $data_disk_size_gb = 0; - /** - * Input only. If true, the data disk will not be auto deleted when deleting the instance. - * - * Generated from protobuf field bool no_remove_data_disk = 27 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $no_remove_data_disk = false; - /** - * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.DiskEncryption disk_encryption = 15 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $disk_encryption = 0; - /** - * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption - * is CMEK. - * Format: - * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` - * Learn more about [using your own encryption - * keys](https://cloud.google.com/kms/docs/quickstart). - * - * Generated from protobuf field string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $kms_key = ''; - /** - * If true, no public IP will be assigned to this instance. - * - * Generated from protobuf field bool no_public_ip = 17; - */ - private $no_public_ip = false; - /** - * If true, the notebook instance will not register with the proxy. - * - * Generated from protobuf field bool no_proxy_access = 18; - */ - private $no_proxy_access = false; - /** - * The name of the VPC that this instance is in. - * Format: - * `projects/{project_id}/global/networks/{network_id}` - * - * Generated from protobuf field string network = 19; - */ - private $network = ''; - /** - * The name of the subnet that this instance is in. - * Format: - * `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnet = 20; - */ - private $subnet = ''; - /** - * Labels to apply to this instance. - * These can be later modified by the setLabels method. - * - * Generated from protobuf field map labels = 21; - */ - private $labels; - /** - * Custom metadata to apply to this instance. - * - * Generated from protobuf field map metadata = 22; - */ - private $metadata; - /** - * Optional. The type of vNIC to be used on this interface. This may be gVNIC or - * VirtioNet. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $nic_type = 0; - /** - * Optional. The optional reservation affinity. Setting this field will apply - * the specified [Zonal Compute - * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) - * to this notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $reservation_affinity = null; - /** - * Optional. Flag to enable ip forwarding or not, default false/off. - * https://cloud.google.com/vpc/docs/using-routes#canipforward - * - * Generated from protobuf field bool can_ip_forward = 31 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $can_ip_forward = false; - /** - * Output only. Instance creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. Instance update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - protected $environment; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The name of this notebook instance. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @type \Google\Cloud\Notebooks\V1beta1\VmImage $vm_image - * Use a Compute Engine VM image to start the notebook instance. - * @type \Google\Cloud\Notebooks\V1beta1\ContainerImage $container_image - * Use a container image to start the notebook instance. - * @type string $post_startup_script - * Path to a Bash script that automatically runs after a notebook instance - * fully boots up. The path must be a URL or - * Cloud Storage path (`gs://path-to-file/file-name`). - * @type string $proxy_uri - * Output only. The proxy endpoint that is used to access the Jupyter notebook. - * @type array|\Google\Protobuf\Internal\RepeatedField $instance_owners - * Input only. The owner of this instance after creation. Format: `alias@example.com` - * Currently supports one owner only. If not specified, all of the service - * account users of your VM instance's service account can use - * the instance. - * @type string $service_account - * The service account on this instance, giving access to other Google - * Cloud services. - * You can use any service account within the same project, but you - * must have the service account user permission to use the instance. - * If not specified, the [Compute Engine default service - * account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - * is used. - * @type string $machine_type - * Required. The [Compute Engine machine - * type](https://cloud.google.com/compute/docs/machine-types) of this - * instance. - * @type \Google\Cloud\Notebooks\V1beta1\Instance\AcceleratorConfig $accelerator_config - * The hardware accelerator used on this instance. If you use - * accelerators, make sure that your configuration has - * [enough vCPUs and memory to support the `machine_type` you have - * selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). - * @type int $state - * Output only. The state of this instance. - * @type bool $install_gpu_driver - * Whether the end user authorizes Google Cloud to install GPU driver - * on this instance. - * If this field is empty or set to false, the GPU driver won't be installed. - * Only applicable to instances with GPUs. - * @type string $custom_gpu_driver_path - * Specify a custom Cloud Storage path where the GPU driver is stored. - * If not specified, we'll automatically choose from official GPU drivers. - * @type int $boot_disk_type - * Input only. The type of the boot disk attached to this instance, defaults to - * standard persistent disk (`PD_STANDARD`). - * @type int|string $boot_disk_size_gb - * Input only. The size of the boot disk in GB attached to this instance, up to a maximum - * of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not - * specified, this defaults to 100. - * @type int $data_disk_type - * Input only. The type of the data disk attached to this instance, defaults to - * standard persistent disk (`PD_STANDARD`). - * @type int|string $data_disk_size_gb - * Input only. The size of the data disk in GB attached to this instance, up to a maximum - * of 64000 GB (64 TB). You can choose the size of the data disk based on how - * big your notebooks and data are. If not specified, this defaults to 100. - * @type bool $no_remove_data_disk - * Input only. If true, the data disk will not be auto deleted when deleting the instance. - * @type int $disk_encryption - * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK. - * @type string $kms_key - * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption - * is CMEK. - * Format: - * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` - * Learn more about [using your own encryption - * keys](https://cloud.google.com/kms/docs/quickstart). - * @type bool $no_public_ip - * If true, no public IP will be assigned to this instance. - * @type bool $no_proxy_access - * If true, the notebook instance will not register with the proxy. - * @type string $network - * The name of the VPC that this instance is in. - * Format: - * `projects/{project_id}/global/networks/{network_id}` - * @type string $subnet - * The name of the subnet that this instance is in. - * Format: - * `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}` - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels to apply to this instance. - * These can be later modified by the setLabels method. - * @type array|\Google\Protobuf\Internal\MapField $metadata - * Custom metadata to apply to this instance. - * @type int $nic_type - * Optional. The type of vNIC to be used on this interface. This may be gVNIC or - * VirtioNet. - * @type \Google\Cloud\Notebooks\V1beta1\ReservationAffinity $reservation_affinity - * Optional. The optional reservation affinity. Setting this field will apply - * the specified [Zonal Compute - * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) - * to this notebook instance. - * @type bool $can_ip_forward - * Optional. Flag to enable ip forwarding or not, default false/off. - * https://cloud.google.com/vpc/docs/using-routes#canipforward - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Instance creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Instance update time. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Instance::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The name of this notebook instance. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of this notebook instance. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Use a Compute Engine VM image to start the notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.VmImage vm_image = 2; - * @return \Google\Cloud\Notebooks\V1beta1\VmImage|null - */ - public function getVmImage() - { - return $this->readOneof(2); - } - - public function hasVmImage() - { - return $this->hasOneof(2); - } - - /** - * Use a Compute Engine VM image to start the notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.VmImage vm_image = 2; - * @param \Google\Cloud\Notebooks\V1beta1\VmImage $var - * @return $this - */ - public function setVmImage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Notebooks\V1beta1\VmImage::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Use a container image to start the notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ContainerImage container_image = 3; - * @return \Google\Cloud\Notebooks\V1beta1\ContainerImage|null - */ - public function getContainerImage() - { - return $this->readOneof(3); - } - - public function hasContainerImage() - { - return $this->hasOneof(3); - } - - /** - * Use a container image to start the notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ContainerImage container_image = 3; - * @param \Google\Cloud\Notebooks\V1beta1\ContainerImage $var - * @return $this - */ - public function setContainerImage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Notebooks\V1beta1\ContainerImage::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Path to a Bash script that automatically runs after a notebook instance - * fully boots up. The path must be a URL or - * Cloud Storage path (`gs://path-to-file/file-name`). - * - * Generated from protobuf field string post_startup_script = 4; - * @return string - */ - public function getPostStartupScript() - { - return $this->post_startup_script; - } - - /** - * Path to a Bash script that automatically runs after a notebook instance - * fully boots up. The path must be a URL or - * Cloud Storage path (`gs://path-to-file/file-name`). - * - * Generated from protobuf field string post_startup_script = 4; - * @param string $var - * @return $this - */ - public function setPostStartupScript($var) - { - GPBUtil::checkString($var, True); - $this->post_startup_script = $var; - - return $this; - } - - /** - * Output only. The proxy endpoint that is used to access the Jupyter notebook. - * - * Generated from protobuf field string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getProxyUri() - { - return $this->proxy_uri; - } - - /** - * Output only. The proxy endpoint that is used to access the Jupyter notebook. - * - * Generated from protobuf field string proxy_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setProxyUri($var) - { - GPBUtil::checkString($var, True); - $this->proxy_uri = $var; - - return $this; - } - - /** - * Input only. The owner of this instance after creation. Format: `alias@example.com` - * Currently supports one owner only. If not specified, all of the service - * account users of your VM instance's service account can use - * the instance. - * - * Generated from protobuf field repeated string instance_owners = 6 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstanceOwners() - { - return $this->instance_owners; - } - - /** - * Input only. The owner of this instance after creation. Format: `alias@example.com` - * Currently supports one owner only. If not specified, all of the service - * account users of your VM instance's service account can use - * the instance. - * - * Generated from protobuf field repeated string instance_owners = 6 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstanceOwners($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->instance_owners = $arr; - - return $this; - } - - /** - * The service account on this instance, giving access to other Google - * Cloud services. - * You can use any service account within the same project, but you - * must have the service account user permission to use the instance. - * If not specified, the [Compute Engine default service - * account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - * is used. - * - * Generated from protobuf field string service_account = 7; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * The service account on this instance, giving access to other Google - * Cloud services. - * You can use any service account within the same project, but you - * must have the service account user permission to use the instance. - * If not specified, the [Compute Engine default service - * account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - * is used. - * - * Generated from protobuf field string service_account = 7; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Required. The [Compute Engine machine - * type](https://cloud.google.com/compute/docs/machine-types) of this - * instance. - * - * Generated from protobuf field string machine_type = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getMachineType() - { - return $this->machine_type; - } - - /** - * Required. The [Compute Engine machine - * type](https://cloud.google.com/compute/docs/machine-types) of this - * instance. - * - * Generated from protobuf field string machine_type = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setMachineType($var) - { - GPBUtil::checkString($var, True); - $this->machine_type = $var; - - return $this; - } - - /** - * The hardware accelerator used on this instance. If you use - * accelerators, make sure that your configuration has - * [enough vCPUs and memory to support the `machine_type` you have - * selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; - * @return \Google\Cloud\Notebooks\V1beta1\Instance\AcceleratorConfig|null - */ - public function getAcceleratorConfig() - { - return $this->accelerator_config; - } - - public function hasAcceleratorConfig() - { - return isset($this->accelerator_config); - } - - public function clearAcceleratorConfig() - { - unset($this->accelerator_config); - } - - /** - * The hardware accelerator used on this instance. If you use - * accelerators, make sure that your configuration has - * [enough vCPUs and memory to support the `machine_type` you have - * selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig accelerator_config = 9; - * @param \Google\Cloud\Notebooks\V1beta1\Instance\AcceleratorConfig $var - * @return $this - */ - public function setAcceleratorConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Notebooks\V1beta1\Instance\AcceleratorConfig::class); - $this->accelerator_config = $var; - - return $this; - } - - /** - * Output only. The state of this instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of this instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Notebooks\V1beta1\Instance\State::class); - $this->state = $var; - - return $this; - } - - /** - * Whether the end user authorizes Google Cloud to install GPU driver - * on this instance. - * If this field is empty or set to false, the GPU driver won't be installed. - * Only applicable to instances with GPUs. - * - * Generated from protobuf field bool install_gpu_driver = 11; - * @return bool - */ - public function getInstallGpuDriver() - { - return $this->install_gpu_driver; - } - - /** - * Whether the end user authorizes Google Cloud to install GPU driver - * on this instance. - * If this field is empty or set to false, the GPU driver won't be installed. - * Only applicable to instances with GPUs. - * - * Generated from protobuf field bool install_gpu_driver = 11; - * @param bool $var - * @return $this - */ - public function setInstallGpuDriver($var) - { - GPBUtil::checkBool($var); - $this->install_gpu_driver = $var; - - return $this; - } - - /** - * Specify a custom Cloud Storage path where the GPU driver is stored. - * If not specified, we'll automatically choose from official GPU drivers. - * - * Generated from protobuf field string custom_gpu_driver_path = 12; - * @return string - */ - public function getCustomGpuDriverPath() - { - return $this->custom_gpu_driver_path; - } - - /** - * Specify a custom Cloud Storage path where the GPU driver is stored. - * If not specified, we'll automatically choose from official GPU drivers. - * - * Generated from protobuf field string custom_gpu_driver_path = 12; - * @param string $var - * @return $this - */ - public function setCustomGpuDriverPath($var) - { - GPBUtil::checkString($var, True); - $this->custom_gpu_driver_path = $var; - - return $this; - } - - /** - * Input only. The type of the boot disk attached to this instance, defaults to - * standard persistent disk (`PD_STANDARD`). - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.DiskType boot_disk_type = 13 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return int - */ - public function getBootDiskType() - { - return $this->boot_disk_type; - } - - /** - * Input only. The type of the boot disk attached to this instance, defaults to - * standard persistent disk (`PD_STANDARD`). - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.DiskType boot_disk_type = 13 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setBootDiskType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Notebooks\V1beta1\Instance\DiskType::class); - $this->boot_disk_type = $var; - - return $this; - } - - /** - * Input only. The size of the boot disk in GB attached to this instance, up to a maximum - * of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not - * specified, this defaults to 100. - * - * Generated from protobuf field int64 boot_disk_size_gb = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return int|string - */ - public function getBootDiskSizeGb() - { - return $this->boot_disk_size_gb; - } - - /** - * Input only. The size of the boot disk in GB attached to this instance, up to a maximum - * of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not - * specified, this defaults to 100. - * - * Generated from protobuf field int64 boot_disk_size_gb = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setBootDiskSizeGb($var) - { - GPBUtil::checkInt64($var); - $this->boot_disk_size_gb = $var; - - return $this; - } - - /** - * Input only. The type of the data disk attached to this instance, defaults to - * standard persistent disk (`PD_STANDARD`). - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.DiskType data_disk_type = 25 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return int - */ - public function getDataDiskType() - { - return $this->data_disk_type; - } - - /** - * Input only. The type of the data disk attached to this instance, defaults to - * standard persistent disk (`PD_STANDARD`). - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.DiskType data_disk_type = 25 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDataDiskType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Notebooks\V1beta1\Instance\DiskType::class); - $this->data_disk_type = $var; - - return $this; - } - - /** - * Input only. The size of the data disk in GB attached to this instance, up to a maximum - * of 64000 GB (64 TB). You can choose the size of the data disk based on how - * big your notebooks and data are. If not specified, this defaults to 100. - * - * Generated from protobuf field int64 data_disk_size_gb = 26 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return int|string - */ - public function getDataDiskSizeGb() - { - return $this->data_disk_size_gb; - } - - /** - * Input only. The size of the data disk in GB attached to this instance, up to a maximum - * of 64000 GB (64 TB). You can choose the size of the data disk based on how - * big your notebooks and data are. If not specified, this defaults to 100. - * - * Generated from protobuf field int64 data_disk_size_gb = 26 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setDataDiskSizeGb($var) - { - GPBUtil::checkInt64($var); - $this->data_disk_size_gb = $var; - - return $this; - } - - /** - * Input only. If true, the data disk will not be auto deleted when deleting the instance. - * - * Generated from protobuf field bool no_remove_data_disk = 27 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return bool - */ - public function getNoRemoveDataDisk() - { - return $this->no_remove_data_disk; - } - - /** - * Input only. If true, the data disk will not be auto deleted when deleting the instance. - * - * Generated from protobuf field bool no_remove_data_disk = 27 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setNoRemoveDataDisk($var) - { - GPBUtil::checkBool($var); - $this->no_remove_data_disk = $var; - - return $this; - } - - /** - * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.DiskEncryption disk_encryption = 15 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return int - */ - public function getDiskEncryption() - { - return $this->disk_encryption; - } - - /** - * Input only. Disk encryption method used on the boot and data disks, defaults to GMEK. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.DiskEncryption disk_encryption = 15 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDiskEncryption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Notebooks\V1beta1\Instance\DiskEncryption::class); - $this->disk_encryption = $var; - - return $this; - } - - /** - * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption - * is CMEK. - * Format: - * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` - * Learn more about [using your own encryption - * keys](https://cloud.google.com/kms/docs/quickstart). - * - * Generated from protobuf field string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getKmsKey() - { - return $this->kms_key; - } - - /** - * Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption - * is CMEK. - * Format: - * `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` - * Learn more about [using your own encryption - * keys](https://cloud.google.com/kms/docs/quickstart). - * - * Generated from protobuf field string kms_key = 16 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setKmsKey($var) - { - GPBUtil::checkString($var, True); - $this->kms_key = $var; - - return $this; - } - - /** - * If true, no public IP will be assigned to this instance. - * - * Generated from protobuf field bool no_public_ip = 17; - * @return bool - */ - public function getNoPublicIp() - { - return $this->no_public_ip; - } - - /** - * If true, no public IP will be assigned to this instance. - * - * Generated from protobuf field bool no_public_ip = 17; - * @param bool $var - * @return $this - */ - public function setNoPublicIp($var) - { - GPBUtil::checkBool($var); - $this->no_public_ip = $var; - - return $this; - } - - /** - * If true, the notebook instance will not register with the proxy. - * - * Generated from protobuf field bool no_proxy_access = 18; - * @return bool - */ - public function getNoProxyAccess() - { - return $this->no_proxy_access; - } - - /** - * If true, the notebook instance will not register with the proxy. - * - * Generated from protobuf field bool no_proxy_access = 18; - * @param bool $var - * @return $this - */ - public function setNoProxyAccess($var) - { - GPBUtil::checkBool($var); - $this->no_proxy_access = $var; - - return $this; - } - - /** - * The name of the VPC that this instance is in. - * Format: - * `projects/{project_id}/global/networks/{network_id}` - * - * Generated from protobuf field string network = 19; - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * The name of the VPC that this instance is in. - * Format: - * `projects/{project_id}/global/networks/{network_id}` - * - * Generated from protobuf field string network = 19; - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * The name of the subnet that this instance is in. - * Format: - * `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnet = 20; - * @return string - */ - public function getSubnet() - { - return $this->subnet; - } - - /** - * The name of the subnet that this instance is in. - * Format: - * `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnet = 20; - * @param string $var - * @return $this - */ - public function setSubnet($var) - { - GPBUtil::checkString($var, True); - $this->subnet = $var; - - return $this; - } - - /** - * Labels to apply to this instance. - * These can be later modified by the setLabels method. - * - * Generated from protobuf field map labels = 21; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels to apply to this instance. - * These can be later modified by the setLabels method. - * - * Generated from protobuf field map labels = 21; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Custom metadata to apply to this instance. - * - * Generated from protobuf field map metadata = 22; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMetadata() - { - return $this->metadata; - } - - /** - * Custom metadata to apply to this instance. - * - * Generated from protobuf field map metadata = 22; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->metadata = $arr; - - return $this; - } - - /** - * Optional. The type of vNIC to be used on this interface. This may be gVNIC or - * VirtioNet. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getNicType() - { - return $this->nic_type; - } - - /** - * Optional. The type of vNIC to be used on this interface. This may be gVNIC or - * VirtioNet. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.NicType nic_type = 28 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setNicType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Notebooks\V1beta1\Instance\NicType::class); - $this->nic_type = $var; - - return $this; - } - - /** - * Optional. The optional reservation affinity. Setting this field will apply - * the specified [Zonal Compute - * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) - * to this notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Notebooks\V1beta1\ReservationAffinity|null - */ - public function getReservationAffinity() - { - return $this->reservation_affinity; - } - - public function hasReservationAffinity() - { - return isset($this->reservation_affinity); - } - - public function clearReservationAffinity() - { - unset($this->reservation_affinity); - } - - /** - * Optional. The optional reservation affinity. Setting this field will apply - * the specified [Zonal Compute - * Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) - * to this notebook instance. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ReservationAffinity reservation_affinity = 29 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Notebooks\V1beta1\ReservationAffinity $var - * @return $this - */ - public function setReservationAffinity($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Notebooks\V1beta1\ReservationAffinity::class); - $this->reservation_affinity = $var; - - return $this; - } - - /** - * Optional. Flag to enable ip forwarding or not, default false/off. - * https://cloud.google.com/vpc/docs/using-routes#canipforward - * - * Generated from protobuf field bool can_ip_forward = 31 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getCanIpForward() - { - return $this->can_ip_forward; - } - - /** - * Optional. Flag to enable ip forwarding or not, default false/off. - * https://cloud.google.com/vpc/docs/using-routes#canipforward - * - * Generated from protobuf field bool can_ip_forward = 31 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setCanIpForward($var) - { - GPBUtil::checkBool($var); - $this->can_ip_forward = $var; - - return $this; - } - - /** - * Output only. Instance creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Instance creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Instance update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. Instance update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * @return string - */ - public function getEnvironment() - { - return $this->whichOneof("environment"); - } - -} - diff --git a/Notebooks/src/V1beta1/Instance/AcceleratorConfig.php b/Notebooks/src/V1beta1/Instance/AcceleratorConfig.php deleted file mode 100644 index eed28d9c42ec..000000000000 --- a/Notebooks/src/V1beta1/Instance/AcceleratorConfig.php +++ /dev/null @@ -1,107 +0,0 @@ -google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig - */ -class AcceleratorConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Type of this accelerator. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.AcceleratorType type = 1; - */ - private $type = 0; - /** - * Count of cores of this accelerator. - * - * Generated from protobuf field int64 core_count = 2; - */ - private $core_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * Type of this accelerator. - * @type int|string $core_count - * Count of cores of this accelerator. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Instance::initOnce(); - parent::__construct($data); - } - - /** - * Type of this accelerator. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.AcceleratorType type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Type of this accelerator. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.AcceleratorType type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Notebooks\V1beta1\Instance\AcceleratorType::class); - $this->type = $var; - - return $this; - } - - /** - * Count of cores of this accelerator. - * - * Generated from protobuf field int64 core_count = 2; - * @return int|string - */ - public function getCoreCount() - { - return $this->core_count; - } - - /** - * Count of cores of this accelerator. - * - * Generated from protobuf field int64 core_count = 2; - * @param int|string $var - * @return $this - */ - public function setCoreCount($var) - { - GPBUtil::checkInt64($var); - $this->core_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AcceleratorConfig::class, \Google\Cloud\Notebooks\V1beta1\Instance_AcceleratorConfig::class); - diff --git a/Notebooks/src/V1beta1/Instance/AcceleratorType.php b/Notebooks/src/V1beta1/Instance/AcceleratorType.php deleted file mode 100644 index e55d73bbe60e..000000000000 --- a/Notebooks/src/V1beta1/Instance/AcceleratorType.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.notebooks.v1beta1.Instance.AcceleratorType - */ -class AcceleratorType -{ - /** - * Accelerator type is not specified. - * - * Generated from protobuf enum ACCELERATOR_TYPE_UNSPECIFIED = 0; - */ - const ACCELERATOR_TYPE_UNSPECIFIED = 0; - /** - * Accelerator type is Nvidia Tesla K80. - * - * Generated from protobuf enum NVIDIA_TESLA_K80 = 1; - */ - const NVIDIA_TESLA_K80 = 1; - /** - * Accelerator type is Nvidia Tesla P100. - * - * Generated from protobuf enum NVIDIA_TESLA_P100 = 2; - */ - const NVIDIA_TESLA_P100 = 2; - /** - * Accelerator type is Nvidia Tesla V100. - * - * Generated from protobuf enum NVIDIA_TESLA_V100 = 3; - */ - const NVIDIA_TESLA_V100 = 3; - /** - * Accelerator type is Nvidia Tesla P4. - * - * Generated from protobuf enum NVIDIA_TESLA_P4 = 4; - */ - const NVIDIA_TESLA_P4 = 4; - /** - * Accelerator type is Nvidia Tesla T4. - * - * Generated from protobuf enum NVIDIA_TESLA_T4 = 5; - */ - const NVIDIA_TESLA_T4 = 5; - /** - * Accelerator type is NVIDIA Tesla T4 Virtual Workstations. - * - * Generated from protobuf enum NVIDIA_TESLA_T4_VWS = 8; - */ - const NVIDIA_TESLA_T4_VWS = 8; - /** - * Accelerator type is NVIDIA Tesla P100 Virtual Workstations. - * - * Generated from protobuf enum NVIDIA_TESLA_P100_VWS = 9; - */ - const NVIDIA_TESLA_P100_VWS = 9; - /** - * Accelerator type is NVIDIA Tesla P4 Virtual Workstations. - * - * Generated from protobuf enum NVIDIA_TESLA_P4_VWS = 10; - */ - const NVIDIA_TESLA_P4_VWS = 10; - /** - * (Coming soon) Accelerator type is TPU V2. - * - * Generated from protobuf enum TPU_V2 = 6; - */ - const TPU_V2 = 6; - /** - * (Coming soon) Accelerator type is TPU V3. - * - * Generated from protobuf enum TPU_V3 = 7; - */ - const TPU_V3 = 7; - - private static $valueToName = [ - self::ACCELERATOR_TYPE_UNSPECIFIED => 'ACCELERATOR_TYPE_UNSPECIFIED', - self::NVIDIA_TESLA_K80 => 'NVIDIA_TESLA_K80', - self::NVIDIA_TESLA_P100 => 'NVIDIA_TESLA_P100', - self::NVIDIA_TESLA_V100 => 'NVIDIA_TESLA_V100', - self::NVIDIA_TESLA_P4 => 'NVIDIA_TESLA_P4', - self::NVIDIA_TESLA_T4 => 'NVIDIA_TESLA_T4', - self::NVIDIA_TESLA_T4_VWS => 'NVIDIA_TESLA_T4_VWS', - self::NVIDIA_TESLA_P100_VWS => 'NVIDIA_TESLA_P100_VWS', - self::NVIDIA_TESLA_P4_VWS => 'NVIDIA_TESLA_P4_VWS', - self::TPU_V2 => 'TPU_V2', - self::TPU_V3 => 'TPU_V3', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AcceleratorType::class, \Google\Cloud\Notebooks\V1beta1\Instance_AcceleratorType::class); - diff --git a/Notebooks/src/V1beta1/Instance/DiskEncryption.php b/Notebooks/src/V1beta1/Instance/DiskEncryption.php deleted file mode 100644 index 19b4ee286796..000000000000 --- a/Notebooks/src/V1beta1/Instance/DiskEncryption.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.notebooks.v1beta1.Instance.DiskEncryption - */ -class DiskEncryption -{ - /** - * Disk encryption is not specified. - * - * Generated from protobuf enum DISK_ENCRYPTION_UNSPECIFIED = 0; - */ - const DISK_ENCRYPTION_UNSPECIFIED = 0; - /** - * Use Google managed encryption keys to encrypt the boot disk. - * - * Generated from protobuf enum GMEK = 1; - */ - const GMEK = 1; - /** - * Use customer managed encryption keys to encrypt the boot disk. - * - * Generated from protobuf enum CMEK = 2; - */ - const CMEK = 2; - - private static $valueToName = [ - self::DISK_ENCRYPTION_UNSPECIFIED => 'DISK_ENCRYPTION_UNSPECIFIED', - self::GMEK => 'GMEK', - self::CMEK => 'CMEK', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DiskEncryption::class, \Google\Cloud\Notebooks\V1beta1\Instance_DiskEncryption::class); - diff --git a/Notebooks/src/V1beta1/Instance/DiskType.php b/Notebooks/src/V1beta1/Instance/DiskType.php deleted file mode 100644 index 6aaa4f75e048..000000000000 --- a/Notebooks/src/V1beta1/Instance/DiskType.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.notebooks.v1beta1.Instance.DiskType - */ -class DiskType -{ - /** - * Disk type not set. - * - * Generated from protobuf enum DISK_TYPE_UNSPECIFIED = 0; - */ - const DISK_TYPE_UNSPECIFIED = 0; - /** - * Standard persistent disk type. - * - * Generated from protobuf enum PD_STANDARD = 1; - */ - const PD_STANDARD = 1; - /** - * SSD persistent disk type. - * - * Generated from protobuf enum PD_SSD = 2; - */ - const PD_SSD = 2; - /** - * Balanced persistent disk type. - * - * Generated from protobuf enum PD_BALANCED = 3; - */ - const PD_BALANCED = 3; - - private static $valueToName = [ - self::DISK_TYPE_UNSPECIFIED => 'DISK_TYPE_UNSPECIFIED', - self::PD_STANDARD => 'PD_STANDARD', - self::PD_SSD => 'PD_SSD', - self::PD_BALANCED => 'PD_BALANCED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DiskType::class, \Google\Cloud\Notebooks\V1beta1\Instance_DiskType::class); - diff --git a/Notebooks/src/V1beta1/Instance/NicType.php b/Notebooks/src/V1beta1/Instance/NicType.php deleted file mode 100644 index 76b0718710d7..000000000000 --- a/Notebooks/src/V1beta1/Instance/NicType.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.notebooks.v1beta1.Instance.NicType - */ -class NicType -{ - /** - * No type specified. Default should be UNSPECIFIED_NIC_TYPE. - * - * Generated from protobuf enum UNSPECIFIED_NIC_TYPE = 0; - */ - const UNSPECIFIED_NIC_TYPE = 0; - /** - * VIRTIO. Default in Notebooks DLVM. - * - * Generated from protobuf enum VIRTIO_NET = 1; - */ - const VIRTIO_NET = 1; - /** - * GVNIC. Alternative to VIRTIO. - * https://github.com/GoogleCloudPlatform/compute-virtual-ethernet-linux - * - * Generated from protobuf enum GVNIC = 2; - */ - const GVNIC = 2; - - private static $valueToName = [ - self::UNSPECIFIED_NIC_TYPE => 'UNSPECIFIED_NIC_TYPE', - self::VIRTIO_NET => 'VIRTIO_NET', - self::GVNIC => 'GVNIC', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NicType::class, \Google\Cloud\Notebooks\V1beta1\Instance_NicType::class); - diff --git a/Notebooks/src/V1beta1/Instance/State.php b/Notebooks/src/V1beta1/Instance/State.php deleted file mode 100644 index 96588a90fa9b..000000000000 --- a/Notebooks/src/V1beta1/Instance/State.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.notebooks.v1beta1.Instance.State - */ -class State -{ - /** - * State is not specified. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The control logic is starting the instance. - * - * Generated from protobuf enum STARTING = 1; - */ - const STARTING = 1; - /** - * The control logic is installing required frameworks and registering the - * instance with notebook proxy - * - * Generated from protobuf enum PROVISIONING = 2; - */ - const PROVISIONING = 2; - /** - * The instance is running. - * - * Generated from protobuf enum ACTIVE = 3; - */ - const ACTIVE = 3; - /** - * The control logic is stopping the instance. - * - * Generated from protobuf enum STOPPING = 4; - */ - const STOPPING = 4; - /** - * The instance is stopped. - * - * Generated from protobuf enum STOPPED = 5; - */ - const STOPPED = 5; - /** - * The instance is deleted. - * - * Generated from protobuf enum DELETED = 6; - */ - const DELETED = 6; - /** - * The instance is upgrading. - * - * Generated from protobuf enum UPGRADING = 7; - */ - const UPGRADING = 7; - /** - * The instance is being created. - * - * Generated from protobuf enum INITIALIZING = 8; - */ - const INITIALIZING = 8; - /** - * The instance is getting registered. - * - * Generated from protobuf enum REGISTERING = 9; - */ - const REGISTERING = 9; - /** - * The instance is suspending. - * - * Generated from protobuf enum SUSPENDING = 10; - */ - const SUSPENDING = 10; - /** - * The instance is suspended. - * - * Generated from protobuf enum SUSPENDED = 11; - */ - const SUSPENDED = 11; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::STARTING => 'STARTING', - self::PROVISIONING => 'PROVISIONING', - self::ACTIVE => 'ACTIVE', - self::STOPPING => 'STOPPING', - self::STOPPED => 'STOPPED', - self::DELETED => 'DELETED', - self::UPGRADING => 'UPGRADING', - self::INITIALIZING => 'INITIALIZING', - self::REGISTERING => 'REGISTERING', - self::SUSPENDING => 'SUSPENDING', - self::SUSPENDED => 'SUSPENDED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Notebooks\V1beta1\Instance_State::class); - diff --git a/Notebooks/src/V1beta1/Instance_AcceleratorConfig.php b/Notebooks/src/V1beta1/Instance_AcceleratorConfig.php deleted file mode 100644 index de47453685b7..000000000000 --- a/Notebooks/src/V1beta1/Instance_AcceleratorConfig.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.notebooks.v1beta1.IsInstanceUpgradeableRequest - */ -class IsInstanceUpgradeableRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string notebook_instance = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $notebook_instance = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $notebook_instance - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string notebook_instance = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getNotebookInstance() - { - return $this->notebook_instance; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string notebook_instance = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setNotebookInstance($var) - { - GPBUtil::checkString($var, True); - $this->notebook_instance = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/IsInstanceUpgradeableResponse.php b/Notebooks/src/V1beta1/IsInstanceUpgradeableResponse.php deleted file mode 100644 index 10584e67e62d..000000000000 --- a/Notebooks/src/V1beta1/IsInstanceUpgradeableResponse.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.notebooks.v1beta1.IsInstanceUpgradeableResponse - */ -class IsInstanceUpgradeableResponse extends \Google\Protobuf\Internal\Message -{ - /** - * If an instance is upgradeable. - * - * Generated from protobuf field bool upgradeable = 1; - */ - private $upgradeable = false; - /** - * The version this instance will be upgraded to if calling the upgrade - * endpoint. This field will only be populated if field upgradeable is true. - * - * Generated from protobuf field string upgrade_version = 2; - */ - private $upgrade_version = ''; - /** - * Additional information about upgrade. - * - * Generated from protobuf field string upgrade_info = 3; - */ - private $upgrade_info = ''; - /** - * The new image self link this instance will be upgraded to if calling the - * upgrade endpoint. This field will only be populated if field upgradeable - * is true. - * - * Generated from protobuf field string upgrade_image = 4; - */ - private $upgrade_image = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $upgradeable - * If an instance is upgradeable. - * @type string $upgrade_version - * The version this instance will be upgraded to if calling the upgrade - * endpoint. This field will only be populated if field upgradeable is true. - * @type string $upgrade_info - * Additional information about upgrade. - * @type string $upgrade_image - * The new image self link this instance will be upgraded to if calling the - * upgrade endpoint. This field will only be populated if field upgradeable - * is true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * If an instance is upgradeable. - * - * Generated from protobuf field bool upgradeable = 1; - * @return bool - */ - public function getUpgradeable() - { - return $this->upgradeable; - } - - /** - * If an instance is upgradeable. - * - * Generated from protobuf field bool upgradeable = 1; - * @param bool $var - * @return $this - */ - public function setUpgradeable($var) - { - GPBUtil::checkBool($var); - $this->upgradeable = $var; - - return $this; - } - - /** - * The version this instance will be upgraded to if calling the upgrade - * endpoint. This field will only be populated if field upgradeable is true. - * - * Generated from protobuf field string upgrade_version = 2; - * @return string - */ - public function getUpgradeVersion() - { - return $this->upgrade_version; - } - - /** - * The version this instance will be upgraded to if calling the upgrade - * endpoint. This field will only be populated if field upgradeable is true. - * - * Generated from protobuf field string upgrade_version = 2; - * @param string $var - * @return $this - */ - public function setUpgradeVersion($var) - { - GPBUtil::checkString($var, True); - $this->upgrade_version = $var; - - return $this; - } - - /** - * Additional information about upgrade. - * - * Generated from protobuf field string upgrade_info = 3; - * @return string - */ - public function getUpgradeInfo() - { - return $this->upgrade_info; - } - - /** - * Additional information about upgrade. - * - * Generated from protobuf field string upgrade_info = 3; - * @param string $var - * @return $this - */ - public function setUpgradeInfo($var) - { - GPBUtil::checkString($var, True); - $this->upgrade_info = $var; - - return $this; - } - - /** - * The new image self link this instance will be upgraded to if calling the - * upgrade endpoint. This field will only be populated if field upgradeable - * is true. - * - * Generated from protobuf field string upgrade_image = 4; - * @return string - */ - public function getUpgradeImage() - { - return $this->upgrade_image; - } - - /** - * The new image self link this instance will be upgraded to if calling the - * upgrade endpoint. This field will only be populated if field upgradeable - * is true. - * - * Generated from protobuf field string upgrade_image = 4; - * @param string $var - * @return $this - */ - public function setUpgradeImage($var) - { - GPBUtil::checkString($var, True); - $this->upgrade_image = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/ListEnvironmentsRequest.php b/Notebooks/src/V1beta1/ListEnvironmentsRequest.php deleted file mode 100644 index b8fe91db9ba8..000000000000 --- a/Notebooks/src/V1beta1/ListEnvironmentsRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.notebooks.v1beta1.ListEnvironmentsRequest - */ -class ListEnvironmentsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: `projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $parent = ''; - /** - * Maximum return size of the list call. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * A previous returned page token that can be used to continue listing from - * the last result. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Format: `projects/{project_id}/locations/{location}` - * @type int $page_size - * Maximum return size of the list call. - * @type string $page_token - * A previous returned page token that can be used to continue listing from - * the last result. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: `projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Format: `projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Maximum return size of the list call. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum return size of the list call. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A previous returned page token that can be used to continue listing from - * the last result. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A previous returned page token that can be used to continue listing from - * the last result. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/ListEnvironmentsResponse.php b/Notebooks/src/V1beta1/ListEnvironmentsResponse.php deleted file mode 100644 index ee87b7be12f8..000000000000 --- a/Notebooks/src/V1beta1/ListEnvironmentsResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.notebooks.v1beta1.ListEnvironmentsResponse - */ -class ListEnvironmentsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of returned environments. - * - * Generated from protobuf field repeated .google.cloud.notebooks.v1beta1.Environment environments = 1; - */ - private $environments; - /** - * A page token that can be used to continue listing from the last result - * in the next list call. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Notebooks\V1beta1\Environment>|\Google\Protobuf\Internal\RepeatedField $environments - * A list of returned environments. - * @type string $next_page_token - * A page token that can be used to continue listing from the last result - * in the next list call. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * A list of returned environments. - * - * Generated from protobuf field repeated .google.cloud.notebooks.v1beta1.Environment environments = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEnvironments() - { - return $this->environments; - } - - /** - * A list of returned environments. - * - * Generated from protobuf field repeated .google.cloud.notebooks.v1beta1.Environment environments = 1; - * @param array<\Google\Cloud\Notebooks\V1beta1\Environment>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEnvironments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Notebooks\V1beta1\Environment::class); - $this->environments = $arr; - - return $this; - } - - /** - * A page token that can be used to continue listing from the last result - * in the next list call. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A page token that can be used to continue listing from the last result - * in the next list call. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/ListInstancesRequest.php b/Notebooks/src/V1beta1/ListInstancesRequest.php deleted file mode 100644 index 310348badfcd..000000000000 --- a/Notebooks/src/V1beta1/ListInstancesRequest.php +++ /dev/null @@ -1,143 +0,0 @@ -google.cloud.notebooks.v1beta1.ListInstancesRequest - */ -class ListInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $parent = ''; - /** - * Maximum return size of the list call. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * A previous returned page token that can be used to continue listing - * from the last result. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * @type int $page_size - * Maximum return size of the list call. - * @type string $page_token - * A previous returned page token that can be used to continue listing - * from the last result. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Maximum return size of the list call. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum return size of the list call. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A previous returned page token that can be used to continue listing - * from the last result. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A previous returned page token that can be used to continue listing - * from the last result. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/ListInstancesResponse.php b/Notebooks/src/V1beta1/ListInstancesResponse.php deleted file mode 100644 index 6b00c1039da9..000000000000 --- a/Notebooks/src/V1beta1/ListInstancesResponse.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.notebooks.v1beta1.ListInstancesResponse - */ -class ListInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of returned instances. - * - * Generated from protobuf field repeated .google.cloud.notebooks.v1beta1.Instance instances = 1; - */ - private $instances; - /** - * Page token that can be used to continue listing from the last result in the - * next list call. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. For example, - * `['us-west1-a', 'us-central1-b']`. - * A ListInstancesResponse will only contain either instances or unreachables, - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Notebooks\V1beta1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * A list of returned instances. - * @type string $next_page_token - * Page token that can be used to continue listing from the last result in the - * next list call. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. For example, - * `['us-west1-a', 'us-central1-b']`. - * A ListInstancesResponse will only contain either instances or unreachables, - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * A list of returned instances. - * - * Generated from protobuf field repeated .google.cloud.notebooks.v1beta1.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * A list of returned instances. - * - * Generated from protobuf field repeated .google.cloud.notebooks.v1beta1.Instance instances = 1; - * @param array<\Google\Cloud\Notebooks\V1beta1\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Notebooks\V1beta1\Instance::class); - $this->instances = $arr; - - return $this; - } - - /** - * Page token that can be used to continue listing from the last result in the - * next list call. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Page token that can be used to continue listing from the last result in the - * next list call. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. For example, - * `['us-west1-a', 'us-central1-b']`. - * A ListInstancesResponse will only contain either instances or unreachables, - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. For example, - * `['us-west1-a', 'us-central1-b']`. - * A ListInstancesResponse will only contain either instances or unreachables, - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/NotebookServiceClient.php b/Notebooks/src/V1beta1/NotebookServiceClient.php deleted file mode 100644 index 61cef1ccfde7..000000000000 --- a/Notebooks/src/V1beta1/NotebookServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/ListInstances', - $argument, - ['\Google\Cloud\Notebooks\V1beta1\ListInstancesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Instance. - * @param \Google\Cloud\Notebooks\V1beta1\GetInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetInstance(\Google\Cloud\Notebooks\V1beta1\GetInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/GetInstance', - $argument, - ['\Google\Cloud\Notebooks\V1beta1\Instance', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Instance in a given project and location. - * @param \Google\Cloud\Notebooks\V1beta1\CreateInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateInstance(\Google\Cloud\Notebooks\V1beta1\CreateInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/CreateInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Registers an existing legacy notebook instance to the Notebooks API server. - * Legacy instances are instances created with the legacy Compute Engine - * calls. They are not manageable by the Notebooks API out of the box. This - * call makes these instances manageable by the Notebooks API. - * @param \Google\Cloud\Notebooks\V1beta1\RegisterInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RegisterInstance(\Google\Cloud\Notebooks\V1beta1\RegisterInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/RegisterInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the guest accelerators of a single Instance. - * @param \Google\Cloud\Notebooks\V1beta1\SetInstanceAcceleratorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetInstanceAccelerator(\Google\Cloud\Notebooks\V1beta1\SetInstanceAcceleratorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/SetInstanceAccelerator', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the machine type of a single Instance. - * @param \Google\Cloud\Notebooks\V1beta1\SetInstanceMachineTypeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetInstanceMachineType(\Google\Cloud\Notebooks\V1beta1\SetInstanceMachineTypeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/SetInstanceMachineType', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the labels of an Instance. - * @param \Google\Cloud\Notebooks\V1beta1\SetInstanceLabelsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetInstanceLabels(\Google\Cloud\Notebooks\V1beta1\SetInstanceLabelsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/SetInstanceLabels', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Instance. - * @param \Google\Cloud\Notebooks\V1beta1\DeleteInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteInstance(\Google\Cloud\Notebooks\V1beta1\DeleteInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/DeleteInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Starts a notebook instance. - * @param \Google\Cloud\Notebooks\V1beta1\StartInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StartInstance(\Google\Cloud\Notebooks\V1beta1\StartInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/StartInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Stops a notebook instance. - * @param \Google\Cloud\Notebooks\V1beta1\StopInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StopInstance(\Google\Cloud\Notebooks\V1beta1\StopInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/StopInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Resets a notebook instance. - * @param \Google\Cloud\Notebooks\V1beta1\ResetInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ResetInstance(\Google\Cloud\Notebooks\V1beta1\ResetInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/ResetInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Allows notebook instances to - * report their latest instance information to the Notebooks - * API server. The server will merge the reported information to - * the instance metadata store. Do not use this method directly. - * @param \Google\Cloud\Notebooks\V1beta1\ReportInstanceInfoRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ReportInstanceInfo(\Google\Cloud\Notebooks\V1beta1\ReportInstanceInfoRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/ReportInstanceInfo', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Check if a notebook instance is upgradable. - * Deprecated. Please consider using v1. - * @param \Google\Cloud\Notebooks\V1beta1\IsInstanceUpgradeableRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function IsInstanceUpgradeable(\Google\Cloud\Notebooks\V1beta1\IsInstanceUpgradeableRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/IsInstanceUpgradeable', - $argument, - ['\Google\Cloud\Notebooks\V1beta1\IsInstanceUpgradeableResponse', 'decode'], - $metadata, $options); - } - - /** - * Upgrades a notebook instance to the latest version. - * Deprecated. Please consider using v1. - * @param \Google\Cloud\Notebooks\V1beta1\UpgradeInstanceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpgradeInstance(\Google\Cloud\Notebooks\V1beta1\UpgradeInstanceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/UpgradeInstance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Allows notebook instances to - * call this endpoint to upgrade themselves. Do not use this method directly. - * Deprecated. Please consider using v1. - * @param \Google\Cloud\Notebooks\V1beta1\UpgradeInstanceInternalRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpgradeInstanceInternal(\Google\Cloud\Notebooks\V1beta1\UpgradeInstanceInternalRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/UpgradeInstanceInternal', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists environments in a project. - * @param \Google\Cloud\Notebooks\V1beta1\ListEnvironmentsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListEnvironments(\Google\Cloud\Notebooks\V1beta1\ListEnvironmentsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/ListEnvironments', - $argument, - ['\Google\Cloud\Notebooks\V1beta1\ListEnvironmentsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Environment. - * @param \Google\Cloud\Notebooks\V1beta1\GetEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetEnvironment(\Google\Cloud\Notebooks\V1beta1\GetEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/GetEnvironment', - $argument, - ['\Google\Cloud\Notebooks\V1beta1\Environment', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Environment. - * @param \Google\Cloud\Notebooks\V1beta1\CreateEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateEnvironment(\Google\Cloud\Notebooks\V1beta1\CreateEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/CreateEnvironment', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Environment. - * @param \Google\Cloud\Notebooks\V1beta1\DeleteEnvironmentRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteEnvironment(\Google\Cloud\Notebooks\V1beta1\DeleteEnvironmentRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.notebooks.v1beta1.NotebookService/DeleteEnvironment', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/Notebooks/src/V1beta1/OperationMetadata.php b/Notebooks/src/V1beta1/OperationMetadata.php deleted file mode 100644 index 78056ee2b13a..000000000000 --- a/Notebooks/src/V1beta1/OperationMetadata.php +++ /dev/null @@ -1,337 +0,0 @@ -google.cloud.notebooks.v1beta1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - */ - private $create_time = null; - /** - * The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - private $end_time = null; - /** - * Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3; - */ - private $target = ''; - /** - * Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4; - */ - private $verb = ''; - /** - * Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5; - */ - private $status_message = ''; - /** - * Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6; - */ - private $requested_cancellation = false; - /** - * API version used to start the operation. - * - * Generated from protobuf field string api_version = 7; - */ - private $api_version = ''; - /** - * API endpoint name of this operation. - * - * Generated from protobuf field string endpoint = 8; - */ - private $endpoint = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * The time the operation finished running. - * @type string $target - * Server-defined resource path for the target of the operation. - * @type string $verb - * Name of the verb executed by the operation. - * @type string $status_message - * Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. - * @type string $api_version - * API version used to start the operation. - * @type string $endpoint - * API endpoint name of this operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * API version used to start the operation. - * - * Generated from protobuf field string api_version = 7; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * API version used to start the operation. - * - * Generated from protobuf field string api_version = 7; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - - /** - * API endpoint name of this operation. - * - * Generated from protobuf field string endpoint = 8; - * @return string - */ - public function getEndpoint() - { - return $this->endpoint; - } - - /** - * API endpoint name of this operation. - * - * Generated from protobuf field string endpoint = 8; - * @param string $var - * @return $this - */ - public function setEndpoint($var) - { - GPBUtil::checkString($var, True); - $this->endpoint = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/RegisterInstanceRequest.php b/Notebooks/src/V1beta1/RegisterInstanceRequest.php deleted file mode 100644 index c45b439d5fdf..000000000000 --- a/Notebooks/src/V1beta1/RegisterInstanceRequest.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.notebooks.v1beta1.RegisterInstanceRequest - */ -class RegisterInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $parent = ''; - /** - * Required. User defined unique ID of this instance. The `instance_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $instance_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * @type string $instance_id - * Required. User defined unique ID of this instance. The `instance_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Format: - * `parent=projects/{project_id}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. User defined unique ID of this instance. The `instance_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. User defined unique ID of this instance. The `instance_id` must - * be 1 to 63 characters long and contain only lowercase letters, - * numeric characters, and dashes. The first character must be a lowercase - * letter and the last character cannot be a dash. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/ReportInstanceInfoRequest.php b/Notebooks/src/V1beta1/ReportInstanceInfoRequest.php deleted file mode 100644 index 818400cc9846..000000000000 --- a/Notebooks/src/V1beta1/ReportInstanceInfoRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.notebooks.v1beta1.ReportInstanceInfoRequest - */ -class ReportInstanceInfoRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * - * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $vm_id = ''; - /** - * The metadata reported to Notebooks API. This will be merged to the instance - * metadata store - * - * Generated from protobuf field map metadata = 3; - */ - private $metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @type string $vm_id - * Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * @type array|\Google\Protobuf\Internal\MapField $metadata - * The metadata reported to Notebooks API. This will be merged to the instance - * metadata store - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * - * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getVmId() - { - return $this->vm_id; - } - - /** - * Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * - * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setVmId($var) - { - GPBUtil::checkString($var, True); - $this->vm_id = $var; - - return $this; - } - - /** - * The metadata reported to Notebooks API. This will be merged to the instance - * metadata store - * - * Generated from protobuf field map metadata = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMetadata() - { - return $this->metadata; - } - - /** - * The metadata reported to Notebooks API. This will be merged to the instance - * metadata store - * - * Generated from protobuf field map metadata = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->metadata = $arr; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/ReservationAffinity.php b/Notebooks/src/V1beta1/ReservationAffinity.php deleted file mode 100644 index eae6b2c387ba..000000000000 --- a/Notebooks/src/V1beta1/ReservationAffinity.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.notebooks.v1beta1.ReservationAffinity - */ -class ReservationAffinity extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Type of reservation to consume - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $consume_reservation_type = 0; - /** - * Optional. Corresponds to the label key of reservation resource. - * - * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $key = ''; - /** - * Optional. Corresponds to the label values of reservation resource. - * - * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $consume_reservation_type - * Optional. Type of reservation to consume - * @type string $key - * Optional. Corresponds to the label key of reservation resource. - * @type array|\Google\Protobuf\Internal\RepeatedField $values - * Optional. Corresponds to the label values of reservation resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Instance::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Type of reservation to consume - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getConsumeReservationType() - { - return $this->consume_reservation_type; - } - - /** - * Optional. Type of reservation to consume - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setConsumeReservationType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Notebooks\V1beta1\ReservationAffinity\Type::class); - $this->consume_reservation_type = $var; - - return $this; - } - - /** - * Optional. Corresponds to the label key of reservation resource. - * - * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Optional. Corresponds to the label key of reservation resource. - * - * Generated from protobuf field string key = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Optional. Corresponds to the label values of reservation resource. - * - * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * Optional. Corresponds to the label values of reservation resource. - * - * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->values = $arr; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/ReservationAffinity/Type.php b/Notebooks/src/V1beta1/ReservationAffinity/Type.php deleted file mode 100644 index 6a87d49f0679..000000000000 --- a/Notebooks/src/V1beta1/ReservationAffinity/Type.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.notebooks.v1beta1.ReservationAffinity.Type - */ -class Type -{ - /** - * Default type. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * Do not consume from any allocated capacity. - * - * Generated from protobuf enum NO_RESERVATION = 1; - */ - const NO_RESERVATION = 1; - /** - * Consume any reservation available. - * - * Generated from protobuf enum ANY_RESERVATION = 2; - */ - const ANY_RESERVATION = 2; - /** - * Must consume from a specific reservation. Must specify key value fields - * for specifying the reservations. - * - * Generated from protobuf enum SPECIFIC_RESERVATION = 3; - */ - const SPECIFIC_RESERVATION = 3; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::NO_RESERVATION => 'NO_RESERVATION', - self::ANY_RESERVATION => 'ANY_RESERVATION', - self::SPECIFIC_RESERVATION => 'SPECIFIC_RESERVATION', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Notebooks\V1beta1\ReservationAffinity_Type::class); - diff --git a/Notebooks/src/V1beta1/ReservationAffinity_Type.php b/Notebooks/src/V1beta1/ReservationAffinity_Type.php deleted file mode 100644 index 2b2e258aa3fc..000000000000 --- a/Notebooks/src/V1beta1/ReservationAffinity_Type.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.notebooks.v1beta1.ResetInstanceRequest - */ -class ResetInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/SetInstanceAcceleratorRequest.php b/Notebooks/src/V1beta1/SetInstanceAcceleratorRequest.php deleted file mode 100644 index 5ae74fadedec..000000000000 --- a/Notebooks/src/V1beta1/SetInstanceAcceleratorRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -google.cloud.notebooks.v1beta1.SetInstanceAcceleratorRequest - */ -class SetInstanceAcceleratorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Required. Type of this accelerator. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.AcceleratorType type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $type = 0; - /** - * Required. Count of cores of this accelerator. Note that not all combinations - * of `type` and `core_count` are valid. Check [GPUs on - * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to - * find a valid combination. TPUs are not supported. - * - * Generated from protobuf field int64 core_count = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $core_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @type int $type - * Required. Type of this accelerator. - * @type int|string $core_count - * Required. Count of cores of this accelerator. Note that not all combinations - * of `type` and `core_count` are valid. Check [GPUs on - * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to - * find a valid combination. TPUs are not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. Type of this accelerator. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.AcceleratorType type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Required. Type of this accelerator. - * - * Generated from protobuf field .google.cloud.notebooks.v1beta1.Instance.AcceleratorType type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Notebooks\V1beta1\Instance\AcceleratorType::class); - $this->type = $var; - - return $this; - } - - /** - * Required. Count of cores of this accelerator. Note that not all combinations - * of `type` and `core_count` are valid. Check [GPUs on - * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to - * find a valid combination. TPUs are not supported. - * - * Generated from protobuf field int64 core_count = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int|string - */ - public function getCoreCount() - { - return $this->core_count; - } - - /** - * Required. Count of cores of this accelerator. Note that not all combinations - * of `type` and `core_count` are valid. Check [GPUs on - * Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to - * find a valid combination. TPUs are not supported. - * - * Generated from protobuf field int64 core_count = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int|string $var - * @return $this - */ - public function setCoreCount($var) - { - GPBUtil::checkInt64($var); - $this->core_count = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/SetInstanceLabelsRequest.php b/Notebooks/src/V1beta1/SetInstanceLabelsRequest.php deleted file mode 100644 index bcbaf6d9a6d9..000000000000 --- a/Notebooks/src/V1beta1/SetInstanceLabelsRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.notebooks.v1beta1.SetInstanceLabelsRequest - */ -class SetInstanceLabelsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Labels to apply to this instance. - * These can be later modified by the setLabels method - * - * Generated from protobuf field map labels = 2; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels to apply to this instance. - * These can be later modified by the setLabels method - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Labels to apply to this instance. - * These can be later modified by the setLabels method - * - * Generated from protobuf field map labels = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels to apply to this instance. - * These can be later modified by the setLabels method - * - * Generated from protobuf field map labels = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/SetInstanceMachineTypeRequest.php b/Notebooks/src/V1beta1/SetInstanceMachineTypeRequest.php deleted file mode 100644 index ca3634380aff..000000000000 --- a/Notebooks/src/V1beta1/SetInstanceMachineTypeRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.notebooks.v1beta1.SetInstanceMachineTypeRequest - */ -class SetInstanceMachineTypeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Required. The [Compute Engine machine - * type](https://cloud.google.com/compute/docs/machine-types). - * - * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $machine_type = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @type string $machine_type - * Required. The [Compute Engine machine - * type](https://cloud.google.com/compute/docs/machine-types). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The [Compute Engine machine - * type](https://cloud.google.com/compute/docs/machine-types). - * - * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getMachineType() - { - return $this->machine_type; - } - - /** - * Required. The [Compute Engine machine - * type](https://cloud.google.com/compute/docs/machine-types). - * - * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setMachineType($var) - { - GPBUtil::checkString($var, True); - $this->machine_type = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/StartInstanceRequest.php b/Notebooks/src/V1beta1/StartInstanceRequest.php deleted file mode 100644 index 791eaf0b0c46..000000000000 --- a/Notebooks/src/V1beta1/StartInstanceRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.notebooks.v1beta1.StartInstanceRequest - */ -class StartInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/StopInstanceRequest.php b/Notebooks/src/V1beta1/StopInstanceRequest.php deleted file mode 100644 index d587f2bd1d04..000000000000 --- a/Notebooks/src/V1beta1/StopInstanceRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.notebooks.v1beta1.StopInstanceRequest - */ -class StopInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/UpgradeInstanceInternalRequest.php b/Notebooks/src/V1beta1/UpgradeInstanceInternalRequest.php deleted file mode 100644 index 9ca602ab1f1a..000000000000 --- a/Notebooks/src/V1beta1/UpgradeInstanceInternalRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.notebooks.v1beta1.UpgradeInstanceInternalRequest - */ -class UpgradeInstanceInternalRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * - * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $vm_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @type string $vm_id - * Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * - * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getVmId() - { - return $this->vm_id; - } - - /** - * Required. The VM hardware token for authenticating the VM. - * https://cloud.google.com/compute/docs/instances/verifying-instance-identity - * - * Generated from protobuf field string vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setVmId($var) - { - GPBUtil::checkString($var, True); - $this->vm_id = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/UpgradeInstanceRequest.php b/Notebooks/src/V1beta1/UpgradeInstanceRequest.php deleted file mode 100644 index 0f06377c00a9..000000000000 --- a/Notebooks/src/V1beta1/UpgradeInstanceRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.notebooks.v1beta1.UpgradeInstanceRequest - */ -class UpgradeInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Format: - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/Notebooks/src/V1beta1/VmImage.php b/Notebooks/src/V1beta1/VmImage.php deleted file mode 100644 index 3e0630ca0b88..000000000000 --- a/Notebooks/src/V1beta1/VmImage.php +++ /dev/null @@ -1,150 +0,0 @@ -google.cloud.notebooks.v1beta1.VmImage - */ -class VmImage extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the Google Cloud project that this VM image belongs to. - * Format: `projects/{project_id}` - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project = ''; - protected $image; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project - * Required. The name of the Google Cloud project that this VM image belongs to. - * Format: `projects/{project_id}` - * @type string $image_name - * Use VM image name to find the image. - * @type string $image_family - * Use this VM image family to find the image; the newest image in this - * family will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Environment::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the Google Cloud project that this VM image belongs to. - * Format: `projects/{project_id}` - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProject() - { - return $this->project; - } - - /** - * Required. The name of the Google Cloud project that this VM image belongs to. - * Format: `projects/{project_id}` - * - * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkString($var, True); - $this->project = $var; - - return $this; - } - - /** - * Use VM image name to find the image. - * - * Generated from protobuf field string image_name = 2; - * @return string - */ - public function getImageName() - { - return $this->readOneof(2); - } - - public function hasImageName() - { - return $this->hasOneof(2); - } - - /** - * Use VM image name to find the image. - * - * Generated from protobuf field string image_name = 2; - * @param string $var - * @return $this - */ - public function setImageName($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Use this VM image family to find the image; the newest image in this - * family will be used. - * - * Generated from protobuf field string image_family = 3; - * @return string - */ - public function getImageFamily() - { - return $this->readOneof(3); - } - - public function hasImageFamily() - { - return $this->hasOneof(3); - } - - /** - * Use this VM image family to find the image; the newest image in this - * family will be used. - * - * Generated from protobuf field string image_family = 3; - * @param string $var - * @return $this - */ - public function setImageFamily($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getImage() - { - return $this->whichOneof("image"); - } - -} - diff --git a/Notebooks/src/V1beta1/gapic_metadata.json b/Notebooks/src/V1beta1/gapic_metadata.json deleted file mode 100644 index 48cfb690c3d7..000000000000 --- a/Notebooks/src/V1beta1/gapic_metadata.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.notebooks.v1beta1", - "libraryPackage": "Google\\Cloud\\Notebooks\\V1beta1", - "services": { - "NotebookService": { - "clients": { - "grpc": { - "libraryClient": "NotebookServiceGapicClient", - "rpcs": { - "CreateEnvironment": { - "methods": [ - "createEnvironment" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteEnvironment": { - "methods": [ - "deleteEnvironment" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "GetEnvironment": { - "methods": [ - "getEnvironment" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "IsInstanceUpgradeable": { - "methods": [ - "isInstanceUpgradeable" - ] - }, - "ListEnvironments": { - "methods": [ - "listEnvironments" - ] - }, - "ListInstances": { - "methods": [ - "listInstances" - ] - }, - "RegisterInstance": { - "methods": [ - "registerInstance" - ] - }, - "ReportInstanceInfo": { - "methods": [ - "reportInstanceInfo" - ] - }, - "ResetInstance": { - "methods": [ - "resetInstance" - ] - }, - "SetInstanceAccelerator": { - "methods": [ - "setInstanceAccelerator" - ] - }, - "SetInstanceLabels": { - "methods": [ - "setInstanceLabels" - ] - }, - "SetInstanceMachineType": { - "methods": [ - "setInstanceMachineType" - ] - }, - "StartInstance": { - "methods": [ - "startInstance" - ] - }, - "StopInstance": { - "methods": [ - "stopInstance" - ] - }, - "UpgradeInstance": { - "methods": [ - "upgradeInstance" - ] - }, - "UpgradeInstanceInternal": { - "methods": [ - "upgradeInstanceInternal" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/Notebooks/src/V1beta1/resources/notebook_service_client_config.json b/Notebooks/src/V1beta1/resources/notebook_service_client_config.json deleted file mode 100644 index 052fa58c29b6..000000000000 --- a/Notebooks/src/V1beta1/resources/notebook_service_client_config.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "interfaces": { - "google.cloud.notebooks.v1beta1.NotebookService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateEnvironment": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteEnvironment": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetEnvironment": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "IsInstanceUpgradeable": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListEnvironments": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RegisterInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ReportInstanceInfo": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ResetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetInstanceAccelerator": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetInstanceLabels": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetInstanceMachineType": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "StartInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "StopInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpgradeInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpgradeInstanceInternal": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/Notebooks/src/V1beta1/resources/notebook_service_descriptor_config.php b/Notebooks/src/V1beta1/resources/notebook_service_descriptor_config.php deleted file mode 100644 index 33ecc9d79fec..000000000000 --- a/Notebooks/src/V1beta1/resources/notebook_service_descriptor_config.php +++ /dev/null @@ -1,211 +0,0 @@ - [ - 'google.cloud.notebooks.v1beta1.NotebookService' => [ - 'CreateEnvironment' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Environment', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteEnvironment' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RegisterInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ReportInstanceInfo' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ResetInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'SetInstanceAccelerator' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'SetInstanceLabels' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'SetInstanceMachineType' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'StartInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'StopInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpgradeInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpgradeInstanceInternal' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Notebooks\V1beta1\Instance', - 'metadataReturnType' => '\Google\Cloud\Notebooks\V1beta1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListEnvironments' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEnvironments', - ], - ], - 'ListInstances' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getInstances', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - ], - ], -]; diff --git a/Notebooks/src/V1beta1/resources/notebook_service_rest_client_config.php b/Notebooks/src/V1beta1/resources/notebook_service_rest_client_config.php deleted file mode 100644 index 8cfe9f1fc5ab..000000000000 --- a/Notebooks/src/V1beta1/resources/notebook_service_rest_client_config.php +++ /dev/null @@ -1,364 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.notebooks.v1beta1.NotebookService' => [ - 'CreateEnvironment' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/environments', - 'body' => 'environment', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'environment_id', - ], - ], - 'CreateInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/instances', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'instance_id', - ], - ], - 'DeleteEnvironment' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/environments/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteInstance' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetEnvironment' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/environments/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetInstance' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'IsInstanceUpgradeable' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{notebook_instance=projects/*/locations/*/instances/*}:isUpgradeable', - 'placeholders' => [ - 'notebook_instance' => [ - 'getters' => [ - 'getNotebookInstance', - ], - ], - ], - ], - 'ListEnvironments' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/environments', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListInstances' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/instances', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RegisterInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/instances:register', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ReportInstanceInfo' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}:report', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ResetInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}:reset', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SetInstanceAccelerator' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}:setAccelerator', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SetInstanceLabels' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}:setLabels', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SetInstanceMachineType' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}:setMachineType', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'StartInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}:start', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'StopInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}:stop', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpgradeInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpgradeInstanceInternal' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/instances/*}:upgradeInternal', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/instances/*}:getIamPolicy', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/instances/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/instances/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/Notebooks/src/V2/AcceleratorConfig.php b/Notebooks/src/V2/AcceleratorConfig.php index 870a9eb04930..bef92e9d19fb 100644 --- a/Notebooks/src/V2/AcceleratorConfig.php +++ b/Notebooks/src/V2/AcceleratorConfig.php @@ -25,13 +25,13 @@ class AcceleratorConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v2.AcceleratorConfig.AcceleratorType type = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type = 0; + protected $type = 0; /** * Optional. Count of cores of this accelerator. * * Generated from protobuf field int64 core_count = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $core_count = 0; + protected $core_count = 0; /** * Constructor. diff --git a/Notebooks/src/V2/AcceleratorConfig/AcceleratorType.php b/Notebooks/src/V2/AcceleratorConfig/AcceleratorType.php index c1f2b8471a7f..ff2bb8d5584b 100644 --- a/Notebooks/src/V2/AcceleratorConfig/AcceleratorType.php +++ b/Notebooks/src/V2/AcceleratorConfig/AcceleratorType.php @@ -116,6 +116,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AcceleratorType::class, \Google\Cloud\Notebooks\V2\AcceleratorConfig_AcceleratorType::class); diff --git a/Notebooks/src/V2/BootDisk.php b/Notebooks/src/V2/BootDisk.php index d4ae28e419c9..fde8f7d94633 100644 --- a/Notebooks/src/V2/BootDisk.php +++ b/Notebooks/src/V2/BootDisk.php @@ -22,20 +22,20 @@ class BootDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 disk_size_gb = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disk_size_gb = 0; + protected $disk_size_gb = 0; /** * Optional. Indicates the type of the disk. * * Generated from protobuf field .google.cloud.notebooks.v2.DiskType disk_type = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disk_type = 0; + protected $disk_type = 0; /** * Optional. Input only. Disk encryption method used on the boot and data * disks, defaults to GMEK. * * Generated from protobuf field .google.cloud.notebooks.v2.DiskEncryption disk_encryption = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; */ - private $disk_encryption = 0; + protected $disk_encryption = 0; /** * Optional. Input only. The KMS key used to encrypt the disks, only * applicable if disk_encryption is CMEK. Format: @@ -44,7 +44,7 @@ class BootDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; */ - private $kms_key = ''; + protected $kms_key = ''; /** * Constructor. diff --git a/Notebooks/src/V2/CheckInstanceUpgradabilityRequest.php b/Notebooks/src/V2/CheckInstanceUpgradabilityRequest.php index 1a662e1f909e..14ad3c7b8c7b 100644 --- a/Notebooks/src/V2/CheckInstanceUpgradabilityRequest.php +++ b/Notebooks/src/V2/CheckInstanceUpgradabilityRequest.php @@ -21,7 +21,7 @@ class CheckInstanceUpgradabilityRequest extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string notebook_instance = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $notebook_instance = ''; + protected $notebook_instance = ''; /** * Constructor. diff --git a/Notebooks/src/V2/CheckInstanceUpgradabilityResponse.php b/Notebooks/src/V2/CheckInstanceUpgradabilityResponse.php index b4d14e76bc15..fa10bb6afe87 100644 --- a/Notebooks/src/V2/CheckInstanceUpgradabilityResponse.php +++ b/Notebooks/src/V2/CheckInstanceUpgradabilityResponse.php @@ -20,20 +20,20 @@ class CheckInstanceUpgradabilityResponse extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field bool upgradeable = 1; */ - private $upgradeable = false; + protected $upgradeable = false; /** * The version this instance will be upgraded to if calling the upgrade * endpoint. This field will only be populated if field upgradeable is true. * * Generated from protobuf field string upgrade_version = 2; */ - private $upgrade_version = ''; + protected $upgrade_version = ''; /** * Additional information about upgrade. * * Generated from protobuf field string upgrade_info = 3; */ - private $upgrade_info = ''; + protected $upgrade_info = ''; /** * The new image self link this instance will be upgraded to if calling the * upgrade endpoint. This field will only be populated if field upgradeable @@ -41,7 +41,7 @@ class CheckInstanceUpgradabilityResponse extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field string upgrade_image = 4; */ - private $upgrade_image = ''; + protected $upgrade_image = ''; /** * Constructor. diff --git a/Notebooks/src/V2/Client/NotebookServiceClient.php b/Notebooks/src/V2/Client/NotebookServiceClient.php index cbb3c2d91f82..d626f221dec2 100644 --- a/Notebooks/src/V2/Client/NotebookServiceClient.php +++ b/Notebooks/src/V2/Client/NotebookServiceClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a instance * resource. @@ -323,8 +342,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function checkInstanceUpgradability(CheckInstanceUpgradabilityRequest $request, array $callOptions = []): CheckInstanceUpgradabilityResponse - { + public function checkInstanceUpgradability( + CheckInstanceUpgradabilityRequest $request, + array $callOptions = [] + ): CheckInstanceUpgradabilityResponse { return $this->startApiCall('CheckInstanceUpgradability', $request, $callOptions)->wait(); } @@ -750,8 +771,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/Notebooks/src/V2/ContainerImage.php b/Notebooks/src/V2/ContainerImage.php index d24175bf1a10..72e77b2eb0b6 100644 --- a/Notebooks/src/V2/ContainerImage.php +++ b/Notebooks/src/V2/ContainerImage.php @@ -22,14 +22,14 @@ class ContainerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository = ''; + protected $repository = ''; /** * Optional. The tag of the container image. If not specified, this defaults * to the latest tag. * * Generated from protobuf field string tag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $tag = ''; + protected $tag = ''; /** * Constructor. diff --git a/Notebooks/src/V2/CreateInstanceRequest.php b/Notebooks/src/V2/CreateInstanceRequest.php index d68a1dcc72bb..305567395f86 100644 --- a/Notebooks/src/V2/CreateInstanceRequest.php +++ b/Notebooks/src/V2/CreateInstanceRequest.php @@ -21,25 +21,25 @@ class CreateInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. User-defined unique ID of this instance. * * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance_id = ''; + protected $instance_id = ''; /** * Required. The instance to be created. * * Generated from protobuf field .google.cloud.notebooks.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance = null; + protected $instance = null; /** * Optional. Idempotent request UUID. * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V2/DataDisk.php b/Notebooks/src/V2/DataDisk.php index 78cc27f40674..670f178b50a0 100644 --- a/Notebooks/src/V2/DataDisk.php +++ b/Notebooks/src/V2/DataDisk.php @@ -21,20 +21,20 @@ class DataDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 disk_size_gb = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disk_size_gb = 0; + protected $disk_size_gb = 0; /** * Optional. Input only. Indicates the type of the disk. * * Generated from protobuf field .google.cloud.notebooks.v2.DiskType disk_type = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; */ - private $disk_type = 0; + protected $disk_type = 0; /** * Optional. Input only. Disk encryption method used on the boot and data * disks, defaults to GMEK. * * Generated from protobuf field .google.cloud.notebooks.v2.DiskEncryption disk_encryption = 5 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; */ - private $disk_encryption = 0; + protected $disk_encryption = 0; /** * Optional. Input only. The KMS key used to encrypt the disks, only * applicable if disk_encryption is CMEK. Format: @@ -43,7 +43,7 @@ class DataDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; */ - private $kms_key = ''; + protected $kms_key = ''; /** * Constructor. diff --git a/Notebooks/src/V2/DeleteInstanceRequest.php b/Notebooks/src/V2/DeleteInstanceRequest.php index c71f7d7da60e..6eb1f755fd45 100644 --- a/Notebooks/src/V2/DeleteInstanceRequest.php +++ b/Notebooks/src/V2/DeleteInstanceRequest.php @@ -21,13 +21,13 @@ class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Idempotent request UUID. * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V2/DiagnoseInstanceRequest.php b/Notebooks/src/V2/DiagnoseInstanceRequest.php index 697edf89add1..bf8021ecb723 100644 --- a/Notebooks/src/V2/DiagnoseInstanceRequest.php +++ b/Notebooks/src/V2/DiagnoseInstanceRequest.php @@ -21,19 +21,19 @@ class DiagnoseInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. Defines flags that are used to run the diagnostic tool * * Generated from protobuf field .google.cloud.notebooks.v2.DiagnosticConfig diagnostic_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $diagnostic_config = null; + protected $diagnostic_config = null; /** * Optional. Maxmium amount of time in minutes before the operation times out. * * Generated from protobuf field int32 timeout_minutes = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $timeout_minutes = 0; + protected $timeout_minutes = 0; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V2/DiagnosticConfig.php b/Notebooks/src/V2/DiagnosticConfig.php index b4aa1e72a4cd..23d388e99653 100644 --- a/Notebooks/src/V2/DiagnosticConfig.php +++ b/Notebooks/src/V2/DiagnosticConfig.php @@ -30,7 +30,7 @@ class DiagnosticConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string gcs_bucket = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $gcs_bucket = ''; + protected $gcs_bucket = ''; /** * Optional. Defines the relative storage path in the Cloud Storage bucket * where the diagnostic logs will be written: Default path will be the root @@ -40,25 +40,25 @@ class DiagnosticConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string relative_path = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $relative_path = ''; + protected $relative_path = ''; /** * Optional. Enables flag to repair service for instance * * Generated from protobuf field bool enable_repair_flag = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_repair_flag = false; + protected $enable_repair_flag = false; /** * Optional. Enables flag to capture packets from the instance for 30 seconds * * Generated from protobuf field bool enable_packet_capture_flag = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_packet_capture_flag = false; + protected $enable_packet_capture_flag = false; /** * Optional. Enables flag to copy all `/home/jupyter` folder contents * * Generated from protobuf field bool enable_copy_home_files_flag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_copy_home_files_flag = false; + protected $enable_copy_home_files_flag = false; /** * Constructor. diff --git a/Notebooks/src/V2/Event.php b/Notebooks/src/V2/Event.php index f1ff6f0c3d98..9214bd704974 100644 --- a/Notebooks/src/V2/Event.php +++ b/Notebooks/src/V2/Event.php @@ -20,13 +20,13 @@ class Event extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp report_time = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $report_time = null; + protected $report_time = null; /** * Optional. Event type. * * Generated from protobuf field .google.cloud.notebooks.v2.Event.EventType type = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type = 0; + protected $type = 0; /** * Optional. Event details. This field is used to pass event information. * diff --git a/Notebooks/src/V2/Event/EventType.php b/Notebooks/src/V2/Event/EventType.php index d99ae420a4ac..d5db26d5f066 100644 --- a/Notebooks/src/V2/Event/EventType.php +++ b/Notebooks/src/V2/Event/EventType.php @@ -88,6 +88,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EventType::class, \Google\Cloud\Notebooks\V2\Event_EventType::class); diff --git a/Notebooks/src/V2/GPUDriverConfig.php b/Notebooks/src/V2/GPUDriverConfig.php index 37a58d278c37..e7b276edeb92 100644 --- a/Notebooks/src/V2/GPUDriverConfig.php +++ b/Notebooks/src/V2/GPUDriverConfig.php @@ -22,7 +22,7 @@ class GPUDriverConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_gpu_driver = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_gpu_driver = false; + protected $enable_gpu_driver = false; /** * Optional. Specify a custom Cloud Storage path where the GPU driver is * stored. If not specified, we'll automatically choose from official GPU @@ -30,7 +30,7 @@ class GPUDriverConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string custom_gpu_driver_path = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $custom_gpu_driver_path = ''; + protected $custom_gpu_driver_path = ''; /** * Constructor. diff --git a/Notebooks/src/V2/GceSetup.php b/Notebooks/src/V2/GceSetup.php index 64d6c174d11b..4865a23b99cd 100644 --- a/Notebooks/src/V2/GceSetup.php +++ b/Notebooks/src/V2/GceSetup.php @@ -22,7 +22,7 @@ class GceSetup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string machine_type = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $machine_type = ''; + protected $machine_type = ''; /** * Optional. The hardware accelerators used on this instance. If you use * accelerators, make sure that your configuration has @@ -45,7 +45,7 @@ class GceSetup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v2.BootDisk boot_disk = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $boot_disk = null; + protected $boot_disk = null; /** * Optional. Data disks attached to the VM instance. * Currently supports only one data disk. @@ -60,7 +60,7 @@ class GceSetup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v2.ShieldedInstanceConfig shielded_instance_config = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $shielded_instance_config = null; + protected $shielded_instance_config = null; /** * Optional. The network interfaces for the VM. * Supports only one interface. @@ -73,7 +73,7 @@ class GceSetup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disable_public_ip = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_public_ip = false; + protected $disable_public_ip = false; /** * Optional. The Compute Engine tags to add to runtime (see [Tagging * instances](https://cloud.google.com/compute/docs/label-or-tag-resources#tags)). @@ -93,13 +93,13 @@ class GceSetup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_ip_forwarding = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_ip_forwarding = false; + protected $enable_ip_forwarding = false; /** * Optional. Configuration for GPU drivers. * * Generated from protobuf field .google.cloud.notebooks.v2.GPUDriverConfig gpu_driver_config = 14 [(.google.api.field_behavior) = OPTIONAL]; */ - private $gpu_driver_config = null; + protected $gpu_driver_config = null; protected $image; /** diff --git a/Notebooks/src/V2/GetInstanceRequest.php b/Notebooks/src/V2/GetInstanceRequest.php index c949da8ffe72..c33d67eee7dd 100644 --- a/Notebooks/src/V2/GetInstanceRequest.php +++ b/Notebooks/src/V2/GetInstanceRequest.php @@ -21,7 +21,7 @@ class GetInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Format: diff --git a/Notebooks/src/V2/Instance.php b/Notebooks/src/V2/Instance.php index d0f4bb53825a..fac652448bdc 100644 --- a/Notebooks/src/V2/Instance.php +++ b/Notebooks/src/V2/Instance.php @@ -21,14 +21,14 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The proxy endpoint that is used to access the Jupyter * notebook. * * Generated from protobuf field string proxy_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $proxy_uri = ''; + protected $proxy_uri = ''; /** * Optional. Input only. The owner of this instance after creation. Format: * `alias@example.com` @@ -45,13 +45,13 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string creator = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $creator = ''; + protected $creator = ''; /** * Output only. The state of this instance. * * Generated from protobuf field .google.cloud.notebooks.v2.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The upgrade history of this instance. * @@ -63,13 +63,13 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $id = ''; + protected $id = ''; /** * Output only. Instance health_state. * * Generated from protobuf field .google.cloud.notebooks.v2.HealthState health_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $health_state = 0; + protected $health_state = 0; /** * Output only. Additional information about instance health. * Example: @@ -89,19 +89,19 @@ class Instance extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Instance update time. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Optional. If true, the notebook instance will not register with the proxy. * * Generated from protobuf field bool disable_proxy_access = 13 [(.google.api.field_behavior) = OPTIONAL]; */ - private $disable_proxy_access = false; + protected $disable_proxy_access = false; /** * Optional. Labels to apply to this instance. * These can be later modified by the UpdateInstance method. diff --git a/Notebooks/src/V2/ListInstancesRequest.php b/Notebooks/src/V2/ListInstancesRequest.php index d85952fde233..debdf1761f08 100644 --- a/Notebooks/src/V2/ListInstancesRequest.php +++ b/Notebooks/src/V2/ListInstancesRequest.php @@ -21,33 +21,33 @@ class ListInstancesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum return size of the list call. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. A previous returned page token that can be used to continue * listing from the last result. * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Sort results. Supported values are "name", "name desc" or "" * (unsorted). * * Generated from protobuf field string order_by = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * Optional. List filter. * * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. Format: diff --git a/Notebooks/src/V2/ListInstancesResponse.php b/Notebooks/src/V2/ListInstancesResponse.php index 33e576fcf4a8..0a01d401ae79 100644 --- a/Notebooks/src/V2/ListInstancesResponse.php +++ b/Notebooks/src/V2/ListInstancesResponse.php @@ -27,7 +27,7 @@ class ListInstancesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. For example, * ['us-west1-a', 'us-central1-b']. diff --git a/Notebooks/src/V2/NetworkInterface.php b/Notebooks/src/V2/NetworkInterface.php index d40d88375389..66f44bc6a3bf 100644 --- a/Notebooks/src/V2/NetworkInterface.php +++ b/Notebooks/src/V2/NetworkInterface.php @@ -22,7 +22,7 @@ class NetworkInterface extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $network = ''; + protected $network = ''; /** * Optional. The name of the subnet that this VM instance is in. * Format: @@ -30,14 +30,14 @@ class NetworkInterface extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string subnet = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $subnet = ''; + protected $subnet = ''; /** * Optional. The type of vNIC to be used on this interface. This may be gVNIC * or VirtioNet. * * Generated from protobuf field .google.cloud.notebooks.v2.NetworkInterface.NicType nic_type = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $nic_type = 0; + protected $nic_type = 0; /** * Constructor. diff --git a/Notebooks/src/V2/NetworkInterface/NicType.php b/Notebooks/src/V2/NetworkInterface/NicType.php index d8ddfee35971..781be1f53db4 100644 --- a/Notebooks/src/V2/NetworkInterface/NicType.php +++ b/Notebooks/src/V2/NetworkInterface/NicType.php @@ -60,6 +60,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NicType::class, \Google\Cloud\Notebooks\V2\NetworkInterface_NicType::class); diff --git a/Notebooks/src/V2/OperationMetadata.php b/Notebooks/src/V2/OperationMetadata.php index d7da26dee06b..501b362e7d4f 100644 --- a/Notebooks/src/V2/OperationMetadata.php +++ b/Notebooks/src/V2/OperationMetadata.php @@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; */ - private $create_time = null; + protected $create_time = null; /** * The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - private $end_time = null; + protected $end_time = null; /** * Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3; */ - private $target = ''; + protected $target = ''; /** * Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4; */ - private $verb = ''; + protected $verb = ''; /** * Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5; */ - private $status_message = ''; + protected $status_message = ''; /** * Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -54,19 +54,19 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * API version used to start the operation. * * Generated from protobuf field string api_version = 7; */ - private $api_version = ''; + protected $api_version = ''; /** * API endpoint name of this operation. * * Generated from protobuf field string endpoint = 8; */ - private $endpoint = ''; + protected $endpoint = ''; /** * Constructor. diff --git a/Notebooks/src/V2/ResetInstanceRequest.php b/Notebooks/src/V2/ResetInstanceRequest.php index ab94d9c712b4..b76c5142315b 100644 --- a/Notebooks/src/V2/ResetInstanceRequest.php +++ b/Notebooks/src/V2/ResetInstanceRequest.php @@ -21,7 +21,7 @@ class ResetInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Notebooks/src/V2/RollbackInstanceRequest.php b/Notebooks/src/V2/RollbackInstanceRequest.php index 1306dbe4eff3..77824123e24e 100644 --- a/Notebooks/src/V2/RollbackInstanceRequest.php +++ b/Notebooks/src/V2/RollbackInstanceRequest.php @@ -21,20 +21,20 @@ class RollbackInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The snapshot for rollback. * Example: "projects/test-project/global/snapshots/krwlzipynril". * * Generated from protobuf field string target_snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_snapshot = ''; + protected $target_snapshot = ''; /** * Required. Output only. Revision Id * * Generated from protobuf field string revision_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = REQUIRED]; */ - private $revision_id = ''; + protected $revision_id = ''; /** * Constructor. diff --git a/Notebooks/src/V2/ServiceAccount.php b/Notebooks/src/V2/ServiceAccount.php index d9639890b7e1..8016666a9a2f 100644 --- a/Notebooks/src/V2/ServiceAccount.php +++ b/Notebooks/src/V2/ServiceAccount.php @@ -20,7 +20,7 @@ class ServiceAccount extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string email = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $email = ''; + protected $email = ''; /** * Output only. The list of scopes to be made available for this service * account. Set by the CLH to https://www.googleapis.com/auth/cloud-platform diff --git a/Notebooks/src/V2/ShieldedInstanceConfig.php b/Notebooks/src/V2/ShieldedInstanceConfig.php index 9b7d58f14662..911a41c87c93 100644 --- a/Notebooks/src/V2/ShieldedInstanceConfig.php +++ b/Notebooks/src/V2/ShieldedInstanceConfig.php @@ -26,14 +26,14 @@ class ShieldedInstanceConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_secure_boot = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_secure_boot = false; + protected $enable_secure_boot = false; /** * Optional. Defines whether the VM instance has the vTPM enabled. Enabled by * default. * * Generated from protobuf field bool enable_vtpm = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_vtpm = false; + protected $enable_vtpm = false; /** * Optional. Defines whether the VM instance has integrity monitoring enabled. * Enables monitoring and attestation of the boot integrity of the VM @@ -43,7 +43,7 @@ class ShieldedInstanceConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_integrity_monitoring = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_integrity_monitoring = false; + protected $enable_integrity_monitoring = false; /** * Constructor. diff --git a/Notebooks/src/V2/StartInstanceRequest.php b/Notebooks/src/V2/StartInstanceRequest.php index 97dc82f8fcf4..41021273b9d3 100644 --- a/Notebooks/src/V2/StartInstanceRequest.php +++ b/Notebooks/src/V2/StartInstanceRequest.php @@ -21,7 +21,7 @@ class StartInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Notebooks/src/V2/StopInstanceRequest.php b/Notebooks/src/V2/StopInstanceRequest.php index 29385a867d5c..b3ae64046da9 100644 --- a/Notebooks/src/V2/StopInstanceRequest.php +++ b/Notebooks/src/V2/StopInstanceRequest.php @@ -21,7 +21,7 @@ class StopInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Notebooks/src/V2/UpdateInstanceRequest.php b/Notebooks/src/V2/UpdateInstanceRequest.php index 8a60c44c5eea..7ded465f5ce2 100644 --- a/Notebooks/src/V2/UpdateInstanceRequest.php +++ b/Notebooks/src/V2/UpdateInstanceRequest.php @@ -20,19 +20,19 @@ class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.notebooks.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $instance = null; + protected $instance = null; /** * Required. Mask used to update an instance * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Optional. Idempotent request UUID. * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\Notebooks\V2\Instance $instance Required. A representation of an instance. diff --git a/Notebooks/src/V2/UpgradeHistoryEntry.php b/Notebooks/src/V2/UpgradeHistoryEntry.php index a5978b95453f..01fdd5a03451 100644 --- a/Notebooks/src/V2/UpgradeHistoryEntry.php +++ b/Notebooks/src/V2/UpgradeHistoryEntry.php @@ -21,55 +21,55 @@ class UpgradeHistoryEntry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string snapshot = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $snapshot = ''; + protected $snapshot = ''; /** * Optional. The VM image before this instance upgrade. * * Generated from protobuf field string vm_image = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $vm_image = ''; + protected $vm_image = ''; /** * Optional. The container image before this instance upgrade. * * Generated from protobuf field string container_image = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $container_image = ''; + protected $container_image = ''; /** * Optional. The framework of this notebook instance. * * Generated from protobuf field string framework = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $framework = ''; + protected $framework = ''; /** * Optional. The version of the notebook instance before this upgrade. * * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $version = ''; + protected $version = ''; /** * Output only. The state of this instance upgrade history entry. * * Generated from protobuf field .google.cloud.notebooks.v2.UpgradeHistoryEntry.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Immutable. The time that this instance upgrade history entry is created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $create_time = null; + protected $create_time = null; /** * Optional. Action. Rolloback or Upgrade. * * Generated from protobuf field .google.cloud.notebooks.v2.UpgradeHistoryEntry.Action action = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $action = 0; + protected $action = 0; /** * Optional. Target VM Version, like m63. * * Generated from protobuf field string target_version = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $target_version = ''; + protected $target_version = ''; /** * Constructor. diff --git a/Notebooks/src/V2/UpgradeHistoryEntry/Action.php b/Notebooks/src/V2/UpgradeHistoryEntry/Action.php index 563ca0f0e2ef..9a466c032959 100644 --- a/Notebooks/src/V2/UpgradeHistoryEntry/Action.php +++ b/Notebooks/src/V2/UpgradeHistoryEntry/Action.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Action::class, \Google\Cloud\Notebooks\V2\UpgradeHistoryEntry_Action::class); diff --git a/Notebooks/src/V2/UpgradeHistoryEntry/State.php b/Notebooks/src/V2/UpgradeHistoryEntry/State.php index b1760831b649..dcba7619f3eb 100644 --- a/Notebooks/src/V2/UpgradeHistoryEntry/State.php +++ b/Notebooks/src/V2/UpgradeHistoryEntry/State.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Notebooks\V2\UpgradeHistoryEntry_State::class); diff --git a/Notebooks/src/V2/UpgradeInstanceRequest.php b/Notebooks/src/V2/UpgradeInstanceRequest.php index 7be594b1ca14..7335c3fdaa52 100644 --- a/Notebooks/src/V2/UpgradeInstanceRequest.php +++ b/Notebooks/src/V2/UpgradeInstanceRequest.php @@ -21,7 +21,7 @@ class UpgradeInstanceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Notebooks/src/V2/VmImage.php b/Notebooks/src/V2/VmImage.php index 3a77d0cde504..e1b2043b1087 100644 --- a/Notebooks/src/V2/VmImage.php +++ b/Notebooks/src/V2/VmImage.php @@ -22,7 +22,7 @@ class VmImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $project = ''; + protected $project = ''; protected $image; /** diff --git a/Notebooks/tests/Unit/V1/Client/ManagedNotebookServiceClientTest.php b/Notebooks/tests/Unit/V1/Client/ManagedNotebookServiceClientTest.php index cb281e0882bf..98dc000d67e1 100644 --- a/Notebooks/tests/Unit/V1/Client/ManagedNotebookServiceClientTest.php +++ b/Notebooks/tests/Unit/V1/Client/ManagedNotebookServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ManagedNotebookServiceClient */ @@ -189,12 +191,15 @@ public function createRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->runtimeName('[PROJECT]', '[LOCATION]', '[RUNTIME]'); @@ -257,8 +262,7 @@ public function deleteRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->runtimeName('[PROJECT]', '[LOCATION]', '[RUNTIME]'); - $request = (new DeleteRuntimeRequest()) - ->setName($formattedName); + $request = (new DeleteRuntimeRequest())->setName($formattedName); $response = $gapicClient->deleteRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -314,17 +318,19 @@ public function deleteRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->runtimeName('[PROJECT]', '[LOCATION]', '[RUNTIME]'); - $request = (new DeleteRuntimeRequest()) - ->setName($formattedName); + $request = (new DeleteRuntimeRequest())->setName($formattedName); $response = $gapicClient->deleteRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -383,9 +389,7 @@ public function diagnoseRuntimeTest() $diagnosticConfig = new DiagnosticConfig(); $diagnosticConfigGcsBucket = 'diagnosticConfigGcsBucket-1116063720'; $diagnosticConfig->setGcsBucket($diagnosticConfigGcsBucket); - $request = (new DiagnoseRuntimeRequest()) - ->setName($formattedName) - ->setDiagnosticConfig($diagnosticConfig); + $request = (new DiagnoseRuntimeRequest())->setName($formattedName)->setDiagnosticConfig($diagnosticConfig); $response = $gapicClient->diagnoseRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -443,21 +447,22 @@ public function diagnoseRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->runtimeName('[PROJECT]', '[LOCATION]', '[RUNTIME]'); $diagnosticConfig = new DiagnosticConfig(); $diagnosticConfigGcsBucket = 'diagnosticConfigGcsBucket-1116063720'; $diagnosticConfig->setGcsBucket($diagnosticConfigGcsBucket); - $request = (new DiagnoseRuntimeRequest()) - ->setName($formattedName) - ->setDiagnosticConfig($diagnosticConfig); + $request = (new DiagnoseRuntimeRequest())->setName($formattedName)->setDiagnosticConfig($diagnosticConfig); $response = $gapicClient->diagnoseRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -495,8 +500,7 @@ public function getRuntimeTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->runtimeName('[PROJECT]', '[LOCATION]', '[RUNTIME]'); - $request = (new GetRuntimeRequest()) - ->setName($formattedName); + $request = (new GetRuntimeRequest())->setName($formattedName); $response = $gapicClient->getRuntime($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -520,17 +524,19 @@ public function getRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->runtimeName('[PROJECT]', '[LOCATION]', '[RUNTIME]'); - $request = (new GetRuntimeRequest()) - ->setName($formattedName); + $request = (new GetRuntimeRequest())->setName($formattedName); try { $gapicClient->getRuntime($request); // If the $gapicClient method call did not throw, fail the test @@ -555,17 +561,14 @@ public function listRuntimesTest() // Mock response $nextPageToken = ''; $runtimesElement = new Runtime(); - $runtimes = [ - $runtimesElement, - ]; + $runtimes = [$runtimesElement]; $expectedResponse = new ListRuntimesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRuntimes($runtimes); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRuntimesRequest()) - ->setParent($formattedParent); + $request = (new ListRuntimesRequest())->setParent($formattedParent); $response = $gapicClient->listRuntimes($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -592,17 +595,19 @@ public function listRuntimesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRuntimesRequest()) - ->setParent($formattedParent); + $request = (new ListRuntimesRequest())->setParent($formattedParent); try { $gapicClient->listRuntimes($request); // If the $gapicClient method call did not throw, fail the test @@ -632,16 +637,17 @@ public function refreshRuntimeTokenInternalTest() // Mock request $formattedName = $gapicClient->runtimeName('[PROJECT]', '[LOCATION]', '[RUNTIME]'); $vmId = 'vmId112317347'; - $request = (new RefreshRuntimeTokenInternalRequest()) - ->setName($formattedName) - ->setVmId($vmId); + $request = (new RefreshRuntimeTokenInternalRequest())->setName($formattedName)->setVmId($vmId); $response = $gapicClient->refreshRuntimeTokenInternal($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1.ManagedNotebookService/RefreshRuntimeTokenInternal', $actualFuncCall); + $this->assertSame( + '/google.cloud.notebooks.v1.ManagedNotebookService/RefreshRuntimeTokenInternal', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $actualValue = $actualRequestObject->getVmId(); @@ -660,19 +666,20 @@ public function refreshRuntimeTokenInternalExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->runtimeName('[PROJECT]', '[LOCATION]', '[RUNTIME]'); $vmId = 'vmId112317347'; - $request = (new RefreshRuntimeTokenInternalRequest()) - ->setName($formattedName) - ->setVmId($vmId); + $request = (new RefreshRuntimeTokenInternalRequest())->setName($formattedName)->setVmId($vmId); try { $gapicClient->refreshRuntimeTokenInternal($request); // If the $gapicClient method call did not throw, fail the test @@ -784,12 +791,15 @@ public function reportRuntimeEventExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->runtimeName('[PROJECT]', '[LOCATION]', '[RUNTIME]'); @@ -854,8 +864,7 @@ public function resetRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new ResetRuntimeRequest()) - ->setName($name); + $request = (new ResetRuntimeRequest())->setName($name); $response = $gapicClient->resetRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -911,17 +920,19 @@ public function resetRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new ResetRuntimeRequest()) - ->setName($name); + $request = (new ResetRuntimeRequest())->setName($name); $response = $gapicClient->resetRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -977,8 +988,7 @@ public function startRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new StartRuntimeRequest()) - ->setName($name); + $request = (new StartRuntimeRequest())->setName($name); $response = $gapicClient->startRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1034,17 +1044,19 @@ public function startRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new StartRuntimeRequest()) - ->setName($name); + $request = (new StartRuntimeRequest())->setName($name); $response = $gapicClient->startRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1100,8 +1112,7 @@ public function stopRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new StopRuntimeRequest()) - ->setName($name); + $request = (new StopRuntimeRequest())->setName($name); $response = $gapicClient->stopRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1157,17 +1168,19 @@ public function stopRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new StopRuntimeRequest()) - ->setName($name); + $request = (new StopRuntimeRequest())->setName($name); $response = $gapicClient->stopRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1223,8 +1236,7 @@ public function switchRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new SwitchRuntimeRequest()) - ->setName($name); + $request = (new SwitchRuntimeRequest())->setName($name); $response = $gapicClient->switchRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1280,17 +1292,19 @@ public function switchRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new SwitchRuntimeRequest()) - ->setName($name); + $request = (new SwitchRuntimeRequest())->setName($name); $response = $gapicClient->switchRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1347,9 +1361,7 @@ public function updateRuntimeTest() // Mock request $runtime = new Runtime(); $updateMask = new FieldMask(); - $request = (new UpdateRuntimeRequest()) - ->setRuntime($runtime) - ->setUpdateMask($updateMask); + $request = (new UpdateRuntimeRequest())->setRuntime($runtime)->setUpdateMask($updateMask); $response = $gapicClient->updateRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1407,19 +1419,20 @@ public function updateRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $runtime = new Runtime(); $updateMask = new FieldMask(); - $request = (new UpdateRuntimeRequest()) - ->setRuntime($runtime) - ->setUpdateMask($updateMask); + $request = (new UpdateRuntimeRequest())->setRuntime($runtime)->setUpdateMask($updateMask); $response = $gapicClient->updateRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1475,8 +1488,7 @@ public function upgradeRuntimeTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new UpgradeRuntimeRequest()) - ->setName($name); + $request = (new UpgradeRuntimeRequest())->setName($name); $response = $gapicClient->upgradeRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1532,17 +1544,19 @@ public function upgradeRuntimeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new UpgradeRuntimeRequest()) - ->setName($name); + $request = (new UpgradeRuntimeRequest())->setName($name); $response = $gapicClient->upgradeRuntime($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1604,12 +1618,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1636,9 +1653,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1668,12 +1683,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1706,8 +1724,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1731,17 +1748,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1773,9 +1792,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1801,19 +1818,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1841,9 +1859,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1869,19 +1885,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test diff --git a/Notebooks/tests/Unit/V1/Client/NotebookServiceClientTest.php b/Notebooks/tests/Unit/V1/Client/NotebookServiceClientTest.php index 638ef0633c61..b7b0e24c3802 100644 --- a/Notebooks/tests/Unit/V1/Client/NotebookServiceClientTest.php +++ b/Notebooks/tests/Unit/V1/Client/NotebookServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return NotebookServiceClient */ @@ -223,12 +225,15 @@ public function createEnvironmentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $parent = 'parent-995424086'; @@ -366,12 +371,15 @@ public function createExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[EXECUTION]'); @@ -535,12 +543,15 @@ public function createInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $parent = 'parent-995424086'; @@ -680,12 +691,15 @@ public function createScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); @@ -748,8 +762,7 @@ public function deleteEnvironmentTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new DeleteEnvironmentRequest()) - ->setName($name); + $request = (new DeleteEnvironmentRequest())->setName($name); $response = $gapicClient->deleteEnvironment($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -805,17 +818,19 @@ public function deleteEnvironmentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new DeleteEnvironmentRequest()) - ->setName($name); + $request = (new DeleteEnvironmentRequest())->setName($name); $response = $gapicClient->deleteEnvironment($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -869,8 +884,7 @@ public function deleteExecutionTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[EXECUTION]'); - $request = (new DeleteExecutionRequest()) - ->setName($formattedName); + $request = (new DeleteExecutionRequest())->setName($formattedName); $response = $gapicClient->deleteExecution($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -926,17 +940,19 @@ public function deleteExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[EXECUTION]'); - $request = (new DeleteExecutionRequest()) - ->setName($formattedName); + $request = (new DeleteExecutionRequest())->setName($formattedName); $response = $gapicClient->deleteExecution($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -990,8 +1006,7 @@ public function deleteInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new DeleteInstanceRequest()) - ->setName($name); + $request = (new DeleteInstanceRequest())->setName($name); $response = $gapicClient->deleteInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1047,17 +1062,19 @@ public function deleteInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new DeleteInstanceRequest()) - ->setName($name); + $request = (new DeleteInstanceRequest())->setName($name); $response = $gapicClient->deleteInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1111,8 +1128,7 @@ public function deleteScheduleTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new DeleteScheduleRequest()) - ->setName($formattedName); + $request = (new DeleteScheduleRequest())->setName($formattedName); $response = $gapicClient->deleteSchedule($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1168,17 +1184,19 @@ public function deleteScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new DeleteScheduleRequest()) - ->setName($formattedName); + $request = (new DeleteScheduleRequest())->setName($formattedName); $response = $gapicClient->deleteSchedule($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1269,9 +1287,7 @@ public function diagnoseInstanceTest() $diagnosticConfig = new DiagnosticConfig(); $diagnosticConfigGcsBucket = 'diagnosticConfigGcsBucket-1116063720'; $diagnosticConfig->setGcsBucket($diagnosticConfigGcsBucket); - $request = (new DiagnoseInstanceRequest()) - ->setName($formattedName) - ->setDiagnosticConfig($diagnosticConfig); + $request = (new DiagnoseInstanceRequest())->setName($formattedName)->setDiagnosticConfig($diagnosticConfig); $response = $gapicClient->diagnoseInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1329,21 +1345,22 @@ public function diagnoseInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); $diagnosticConfig = new DiagnosticConfig(); $diagnosticConfigGcsBucket = 'diagnosticConfigGcsBucket-1116063720'; $diagnosticConfig->setGcsBucket($diagnosticConfigGcsBucket); - $request = (new DiagnoseInstanceRequest()) - ->setName($formattedName) - ->setDiagnosticConfig($diagnosticConfig); + $request = (new DiagnoseInstanceRequest())->setName($formattedName)->setDiagnosticConfig($diagnosticConfig); $response = $gapicClient->diagnoseInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1387,8 +1404,7 @@ public function getEnvironmentTest() $transport->addResponse($expectedResponse); // Mock request $name = 'name3373707'; - $request = (new GetEnvironmentRequest()) - ->setName($name); + $request = (new GetEnvironmentRequest())->setName($name); $response = $gapicClient->getEnvironment($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1412,17 +1428,19 @@ public function getEnvironmentExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new GetEnvironmentRequest()) - ->setName($name); + $request = (new GetEnvironmentRequest())->setName($name); try { $gapicClient->getEnvironment($request); // If the $gapicClient method call did not throw, fail the test @@ -1459,8 +1477,7 @@ public function getExecutionTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); + $request = (new GetExecutionRequest())->setName($formattedName); $response = $gapicClient->getExecution($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1484,17 +1501,19 @@ public function getExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); + $request = (new GetExecutionRequest())->setName($formattedName); try { $gapicClient->getExecution($request); // If the $gapicClient method call did not throw, fail the test @@ -1555,8 +1574,7 @@ public function getInstanceTest() $transport->addResponse($expectedResponse); // Mock request $name = 'name3373707'; - $request = (new GetInstanceRequest()) - ->setName($name); + $request = (new GetInstanceRequest())->setName($name); $response = $gapicClient->getInstance($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1580,17 +1598,19 @@ public function getInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new GetInstanceRequest()) - ->setName($name); + $request = (new GetInstanceRequest())->setName($name); try { $gapicClient->getInstance($request); // If the $gapicClient method call did not throw, fail the test @@ -1617,8 +1637,7 @@ public function getInstanceHealthTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetInstanceHealthRequest()) - ->setName($formattedName); + $request = (new GetInstanceHealthRequest())->setName($formattedName); $response = $gapicClient->getInstanceHealth($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1642,17 +1661,19 @@ public function getInstanceHealthExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetInstanceHealthRequest()) - ->setName($formattedName); + $request = (new GetInstanceHealthRequest())->setName($formattedName); try { $gapicClient->getInstanceHealth($request); // If the $gapicClient method call did not throw, fail the test @@ -1689,8 +1710,7 @@ public function getScheduleTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new GetScheduleRequest()) - ->setName($formattedName); + $request = (new GetScheduleRequest())->setName($formattedName); $response = $gapicClient->getSchedule($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1714,17 +1734,19 @@ public function getScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new GetScheduleRequest()) - ->setName($formattedName); + $request = (new GetScheduleRequest())->setName($formattedName); try { $gapicClient->getSchedule($request); // If the $gapicClient method call did not throw, fail the test @@ -1759,8 +1781,7 @@ public function isInstanceUpgradeableTest() $transport->addResponse($expectedResponse); // Mock request $notebookInstance = 'notebookInstance-1078982023'; - $request = (new IsInstanceUpgradeableRequest()) - ->setNotebookInstance($notebookInstance); + $request = (new IsInstanceUpgradeableRequest())->setNotebookInstance($notebookInstance); $response = $gapicClient->isInstanceUpgradeable($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1784,17 +1805,19 @@ public function isInstanceUpgradeableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $notebookInstance = 'notebookInstance-1078982023'; - $request = (new IsInstanceUpgradeableRequest()) - ->setNotebookInstance($notebookInstance); + $request = (new IsInstanceUpgradeableRequest())->setNotebookInstance($notebookInstance); try { $gapicClient->isInstanceUpgradeable($request); // If the $gapicClient method call did not throw, fail the test @@ -1819,17 +1842,14 @@ public function listEnvironmentsTest() // Mock response $nextPageToken = ''; $environmentsElement = new Environment(); - $environments = [ - $environmentsElement, - ]; + $environments = [$environmentsElement]; $expectedResponse = new ListEnvironmentsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setEnvironments($environments); $transport->addResponse($expectedResponse); // Mock request $parent = 'parent-995424086'; - $request = (new ListEnvironmentsRequest()) - ->setParent($parent); + $request = (new ListEnvironmentsRequest())->setParent($parent); $response = $gapicClient->listEnvironments($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1856,17 +1876,19 @@ public function listEnvironmentsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $parent = 'parent-995424086'; - $request = (new ListEnvironmentsRequest()) - ->setParent($parent); + $request = (new ListEnvironmentsRequest())->setParent($parent); try { $gapicClient->listEnvironments($request); // If the $gapicClient method call did not throw, fail the test @@ -1891,17 +1913,14 @@ public function listExecutionsTest() // Mock response $nextPageToken = ''; $executionsElement = new Execution(); - $executions = [ - $executionsElement, - ]; + $executions = [$executionsElement]; $expectedResponse = new ListExecutionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setExecutions($executions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[EXECUTION]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); + $request = (new ListExecutionsRequest())->setParent($formattedParent); $response = $gapicClient->listExecutions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1928,17 +1947,19 @@ public function listExecutionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[EXECUTION]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); + $request = (new ListExecutionsRequest())->setParent($formattedParent); try { $gapicClient->listExecutions($request); // If the $gapicClient method call did not throw, fail the test @@ -1963,17 +1984,14 @@ public function listInstancesTest() // Mock response $nextPageToken = ''; $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; + $instances = [$instancesElement]; $expectedResponse = new ListInstancesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setInstances($instances); $transport->addResponse($expectedResponse); // Mock request $parent = 'parent-995424086'; - $request = (new ListInstancesRequest()) - ->setParent($parent); + $request = (new ListInstancesRequest())->setParent($parent); $response = $gapicClient->listInstances($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2000,17 +2018,19 @@ public function listInstancesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $parent = 'parent-995424086'; - $request = (new ListInstancesRequest()) - ->setParent($parent); + $request = (new ListInstancesRequest())->setParent($parent); try { $gapicClient->listInstances($request); // If the $gapicClient method call did not throw, fail the test @@ -2035,17 +2055,14 @@ public function listSchedulesTest() // Mock response $nextPageToken = ''; $schedulesElement = new Schedule(); - $schedules = [ - $schedulesElement, - ]; + $schedules = [$schedulesElement]; $expectedResponse = new ListSchedulesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSchedules($schedules); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new ListSchedulesRequest()) - ->setParent($formattedParent); + $request = (new ListSchedulesRequest())->setParent($formattedParent); $response = $gapicClient->listSchedules($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2072,17 +2089,19 @@ public function listSchedulesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new ListSchedulesRequest()) - ->setParent($formattedParent); + $request = (new ListSchedulesRequest())->setParent($formattedParent); try { $gapicClient->listSchedules($request); // If the $gapicClient method call did not throw, fail the test @@ -2162,9 +2181,7 @@ public function registerInstanceTest() // Mock request $parent = 'parent-995424086'; $instanceId = 'instanceId-2101995259'; - $request = (new RegisterInstanceRequest()) - ->setParent($parent) - ->setInstanceId($instanceId); + $request = (new RegisterInstanceRequest())->setParent($parent)->setInstanceId($instanceId); $response = $gapicClient->registerInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2222,19 +2239,20 @@ public function registerInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $parent = 'parent-995424086'; $instanceId = 'instanceId-2101995259'; - $request = (new RegisterInstanceRequest()) - ->setParent($parent) - ->setInstanceId($instanceId); + $request = (new RegisterInstanceRequest())->setParent($parent)->setInstanceId($instanceId); $response = $gapicClient->registerInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2323,9 +2341,7 @@ public function reportInstanceInfoTest() // Mock request $name = 'name3373707'; $vmId = 'vmId112317347'; - $request = (new ReportInstanceInfoRequest()) - ->setName($name) - ->setVmId($vmId); + $request = (new ReportInstanceInfoRequest())->setName($name)->setVmId($vmId); $response = $gapicClient->reportInstanceInfo($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2383,19 +2399,20 @@ public function reportInstanceInfoExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; $vmId = 'vmId112317347'; - $request = (new ReportInstanceInfoRequest()) - ->setName($name) - ->setVmId($vmId); + $request = (new ReportInstanceInfoRequest())->setName($name)->setVmId($vmId); $response = $gapicClient->reportInstanceInfo($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2483,8 +2500,7 @@ public function resetInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new ResetInstanceRequest()) - ->setName($name); + $request = (new ResetInstanceRequest())->setName($name); $response = $gapicClient->resetInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2540,17 +2556,19 @@ public function resetInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new ResetInstanceRequest()) - ->setName($name); + $request = (new ResetInstanceRequest())->setName($name); $response = $gapicClient->resetInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2639,9 +2657,7 @@ public function rollbackInstanceTest() // Mock request $name = 'name3373707'; $targetSnapshot = 'targetSnapshot556386482'; - $request = (new RollbackInstanceRequest()) - ->setName($name) - ->setTargetSnapshot($targetSnapshot); + $request = (new RollbackInstanceRequest())->setName($name)->setTargetSnapshot($targetSnapshot); $response = $gapicClient->rollbackInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2699,19 +2715,20 @@ public function rollbackInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; $targetSnapshot = 'targetSnapshot556386482'; - $request = (new RollbackInstanceRequest()) - ->setName($name) - ->setTargetSnapshot($targetSnapshot); + $request = (new RollbackInstanceRequest())->setName($name)->setTargetSnapshot($targetSnapshot); $response = $gapicClient->rollbackInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2864,12 +2881,15 @@ public function setInstanceAcceleratorExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; @@ -2966,8 +2986,7 @@ public function setInstanceLabelsTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new SetInstanceLabelsRequest()) - ->setName($name); + $request = (new SetInstanceLabelsRequest())->setName($name); $response = $gapicClient->setInstanceLabels($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3023,17 +3042,19 @@ public function setInstanceLabelsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new SetInstanceLabelsRequest()) - ->setName($name); + $request = (new SetInstanceLabelsRequest())->setName($name); $response = $gapicClient->setInstanceLabels($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3122,9 +3143,7 @@ public function setInstanceMachineTypeTest() // Mock request $name = 'name3373707'; $machineType = 'machineType1838323762'; - $request = (new SetInstanceMachineTypeRequest()) - ->setName($name) - ->setMachineType($machineType); + $request = (new SetInstanceMachineTypeRequest())->setName($name)->setMachineType($machineType); $response = $gapicClient->setInstanceMachineType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3182,19 +3201,20 @@ public function setInstanceMachineTypeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; $machineType = 'machineType1838323762'; - $request = (new SetInstanceMachineTypeRequest()) - ->setName($name) - ->setMachineType($machineType); + $request = (new SetInstanceMachineTypeRequest())->setName($name)->setMachineType($machineType); $response = $gapicClient->setInstanceMachineType($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3282,8 +3302,7 @@ public function startInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new StartInstanceRequest()) - ->setName($name); + $request = (new StartInstanceRequest())->setName($name); $response = $gapicClient->startInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3339,17 +3358,19 @@ public function startInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new StartInstanceRequest()) - ->setName($name); + $request = (new StartInstanceRequest())->setName($name); $response = $gapicClient->startInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3437,8 +3458,7 @@ public function stopInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new StopInstanceRequest()) - ->setName($name); + $request = (new StopInstanceRequest())->setName($name); $response = $gapicClient->stopInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3494,17 +3514,19 @@ public function stopInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new StopInstanceRequest()) - ->setName($name); + $request = (new StopInstanceRequest())->setName($name); $response = $gapicClient->stopInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3568,8 +3590,7 @@ public function triggerScheduleTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new TriggerScheduleRequest()) - ->setName($formattedName); + $request = (new TriggerScheduleRequest())->setName($formattedName); $response = $gapicClient->triggerSchedule($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3625,17 +3646,19 @@ public function triggerScheduleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->scheduleName('[PROJECT]', '[LOCATION]', '[SCHEDULE]'); - $request = (new TriggerScheduleRequest()) - ->setName($formattedName); + $request = (new TriggerScheduleRequest())->setName($formattedName); $response = $gapicClient->triggerSchedule($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3723,8 +3746,7 @@ public function updateInstanceConfigTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new UpdateInstanceConfigRequest()) - ->setName($name); + $request = (new UpdateInstanceConfigRequest())->setName($name); $response = $gapicClient->updateInstanceConfig($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3780,17 +3802,19 @@ public function updateInstanceConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new UpdateInstanceConfigRequest()) - ->setName($name); + $request = (new UpdateInstanceConfigRequest())->setName($name); $response = $gapicClient->updateInstanceConfig($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3826,8 +3850,7 @@ public function updateInstanceMetadataItemsTest() $transport->addResponse($expectedResponse); // Mock request $name = 'name3373707'; - $request = (new UpdateInstanceMetadataItemsRequest()) - ->setName($name); + $request = (new UpdateInstanceMetadataItemsRequest())->setName($name); $response = $gapicClient->updateInstanceMetadataItems($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3851,17 +3874,19 @@ public function updateInstanceMetadataItemsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new UpdateInstanceMetadataItemsRequest()) - ->setName($name); + $request = (new UpdateInstanceMetadataItemsRequest())->setName($name); try { $gapicClient->updateInstanceMetadataItems($request); // If the $gapicClient method call did not throw, fail the test @@ -3940,8 +3965,7 @@ public function updateShieldedInstanceConfigTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new UpdateShieldedInstanceConfigRequest()) - ->setName($name); + $request = (new UpdateShieldedInstanceConfigRequest())->setName($name); $response = $gapicClient->updateShieldedInstanceConfig($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3951,7 +3975,10 @@ public function updateShieldedInstanceConfigTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1.NotebookService/UpdateShieldedInstanceConfig', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.notebooks.v1.NotebookService/UpdateShieldedInstanceConfig', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($name, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -3997,17 +4024,19 @@ public function updateShieldedInstanceConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new UpdateShieldedInstanceConfigRequest()) - ->setName($name); + $request = (new UpdateShieldedInstanceConfigRequest())->setName($name); $response = $gapicClient->updateShieldedInstanceConfig($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4095,8 +4124,7 @@ public function upgradeInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new UpgradeInstanceRequest()) - ->setName($name); + $request = (new UpgradeInstanceRequest())->setName($name); $response = $gapicClient->upgradeInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4152,17 +4180,19 @@ public function upgradeInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new UpgradeInstanceRequest()) - ->setName($name); + $request = (new UpgradeInstanceRequest())->setName($name); $response = $gapicClient->upgradeInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4251,9 +4281,7 @@ public function upgradeInstanceInternalTest() // Mock request $name = 'name3373707'; $vmId = 'vmId112317347'; - $request = (new UpgradeInstanceInternalRequest()) - ->setName($name) - ->setVmId($vmId); + $request = (new UpgradeInstanceInternalRequest())->setName($name)->setVmId($vmId); $response = $gapicClient->upgradeInstanceInternal($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4311,19 +4339,20 @@ public function upgradeInstanceInternalExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; $vmId = 'vmId112317347'; - $request = (new UpgradeInstanceInternalRequest()) - ->setName($name) - ->setVmId($vmId); + $request = (new UpgradeInstanceInternalRequest())->setName($name)->setVmId($vmId); $response = $gapicClient->upgradeInstanceInternal($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4385,12 +4414,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -4417,9 +4449,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -4449,12 +4479,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -4487,8 +4520,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -4512,17 +4544,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -4554,9 +4588,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -4582,19 +4614,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -4622,9 +4655,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -4650,19 +4681,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test diff --git a/Notebooks/tests/Unit/V1beta1/NotebookServiceClientTest.php b/Notebooks/tests/Unit/V1beta1/NotebookServiceClientTest.php deleted file mode 100644 index 87e99808942f..000000000000 --- a/Notebooks/tests/Unit/V1beta1/NotebookServiceClientTest.php +++ /dev/null @@ -1,2785 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return NotebookServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new NotebookServiceClient($options); - } - - /** @test */ - public function createEnvironmentTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $postStartupScript = 'postStartupScript355382860'; - $expectedResponse = new Environment(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setPostStartupScript($postStartupScript); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createEnvironmentTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $environmentId = 'environmentId608412359'; - $environment = new Environment(); - $response = $gapicClient->createEnvironment($parent, $environmentId, $environment); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/CreateEnvironment', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualApiRequestObject->getEnvironmentId(); - $this->assertProtobufEquals($environmentId, $actualValue); - $actualValue = $actualApiRequestObject->getEnvironment(); - $this->assertProtobufEquals($environment, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEnvironmentTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createEnvironmentExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $environmentId = 'environmentId608412359'; - $environment = new Environment(); - $response = $gapicClient->createEnvironment($parent, $environmentId, $environment); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createEnvironmentTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceMachineType = 'instanceMachineType-107765684'; - $instance->setMachineType($instanceMachineType); - $response = $gapicClient->createInstance($parent, $instanceId, $instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceMachineType = 'instanceMachineType-107765684'; - $instance->setMachineType($instanceMachineType); - $response = $gapicClient->createInstance($parent, $instanceId, $instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEnvironmentTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteEnvironmentTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->deleteEnvironment($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/DeleteEnvironment', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEnvironmentTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteEnvironmentExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteEnvironmentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->deleteEnvironment($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteEnvironmentTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->deleteInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/DeleteInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->deleteInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getEnvironmentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $postStartupScript = 'postStartupScript355382860'; - $expectedResponse = new Environment(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setPostStartupScript($postStartupScript); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->getEnvironment($name); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/GetEnvironment', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEnvironmentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $gapicClient->getEnvironment($name); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->getInstance($name); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $gapicClient->getInstance($name); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function isInstanceUpgradeableTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $upgradeable = true; - $upgradeVersion = 'upgradeVersion1040155061'; - $upgradeInfo = 'upgradeInfo-1337232143'; - $upgradeImage = 'upgradeImage1495441784'; - $expectedResponse = new IsInstanceUpgradeableResponse(); - $expectedResponse->setUpgradeable($upgradeable); - $expectedResponse->setUpgradeVersion($upgradeVersion); - $expectedResponse->setUpgradeInfo($upgradeInfo); - $expectedResponse->setUpgradeImage($upgradeImage); - $transport->addResponse($expectedResponse); - // Mock request - $notebookInstance = 'notebookInstance-1078982023'; - $response = $gapicClient->isInstanceUpgradeable($notebookInstance); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/IsInstanceUpgradeable', $actualFuncCall); - $actualValue = $actualRequestObject->getNotebookInstance(); - $this->assertProtobufEquals($notebookInstance, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function isInstanceUpgradeableExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $notebookInstance = 'notebookInstance-1078982023'; - try { - $gapicClient->isInstanceUpgradeable($notebookInstance); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEnvironmentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $environmentsElement = new Environment(); - $environments = [ - $environmentsElement, - ]; - $expectedResponse = new ListEnvironmentsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEnvironments($environments); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listEnvironments($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEnvironments()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/ListEnvironments', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEnvironmentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - try { - $gapicClient->listEnvironments($parent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInstances($instances); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listInstances($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - try { - $gapicClient->listInstances($parent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function registerInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/registerInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/registerInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $instanceId = 'instanceId-2101995259'; - $response = $gapicClient->registerInstance($parent, $instanceId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/RegisterInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/registerInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function registerInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/registerInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $instanceId = 'instanceId-2101995259'; - $response = $gapicClient->registerInstance($parent, $instanceId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/registerInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function reportInstanceInfoTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/reportInstanceInfoTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/reportInstanceInfoTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $vmId = 'vmId112317347'; - $response = $gapicClient->reportInstanceInfo($name, $vmId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/ReportInstanceInfo', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualApiRequestObject->getVmId(); - $this->assertProtobufEquals($vmId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/reportInstanceInfoTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function reportInstanceInfoExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/reportInstanceInfoTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $vmId = 'vmId112317347'; - $response = $gapicClient->reportInstanceInfo($name, $vmId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/reportInstanceInfoTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function resetInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/resetInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/resetInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->resetInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/ResetInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/resetInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function resetInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/resetInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->resetInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/resetInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setInstanceAcceleratorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setInstanceAcceleratorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/setInstanceAcceleratorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $type = AcceleratorType::ACCELERATOR_TYPE_UNSPECIFIED; - $coreCount = 1963855761; - $response = $gapicClient->setInstanceAccelerator($name, $type, $coreCount); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/SetInstanceAccelerator', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualApiRequestObject->getType(); - $this->assertProtobufEquals($type, $actualValue); - $actualValue = $actualApiRequestObject->getCoreCount(); - $this->assertProtobufEquals($coreCount, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setInstanceAcceleratorTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setInstanceAcceleratorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setInstanceAcceleratorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $type = AcceleratorType::ACCELERATOR_TYPE_UNSPECIFIED; - $coreCount = 1963855761; - $response = $gapicClient->setInstanceAccelerator($name, $type, $coreCount); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setInstanceAcceleratorTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setInstanceLabelsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setInstanceLabelsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/setInstanceLabelsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->setInstanceLabels($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/SetInstanceLabels', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setInstanceLabelsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setInstanceLabelsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setInstanceLabelsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->setInstanceLabels($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setInstanceLabelsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setInstanceMachineTypeTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setInstanceMachineTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType2 = 'machineType21397579621'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType2); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/setInstanceMachineTypeTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $machineType = 'machineType1838323762'; - $response = $gapicClient->setInstanceMachineType($name, $machineType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/SetInstanceMachineType', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualApiRequestObject->getMachineType(); - $this->assertProtobufEquals($machineType, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setInstanceMachineTypeTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setInstanceMachineTypeExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setInstanceMachineTypeTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $machineType = 'machineType1838323762'; - $response = $gapicClient->setInstanceMachineType($name, $machineType); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setInstanceMachineTypeTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function startInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/startInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/startInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->startInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/StartInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/startInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function startInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/startInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->startInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/startInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function stopInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/stopInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/stopInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->stopInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/StopInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/stopInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function stopInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/stopInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->stopInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/stopInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function upgradeInstanceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/upgradeInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/upgradeInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->upgradeInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/UpgradeInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeInstanceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function upgradeInstanceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/upgradeInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->upgradeInstance($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeInstanceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function upgradeInstanceInternalTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/upgradeInstanceInternalTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $postStartupScript = 'postStartupScript355382860'; - $proxyUri = 'proxyUri-475670501'; - $serviceAccount = 'serviceAccount-1948028253'; - $machineType = 'machineType1838323762'; - $installGpuDriver = false; - $customGpuDriverPath = 'customGpuDriverPath1863223803'; - $bootDiskSizeGb = 1398920548; - $dataDiskSizeGb = 1668379732; - $noRemoveDataDisk = false; - $kmsKey = 'kmsKey-591635343'; - $noPublicIp = false; - $noProxyAccess = false; - $network = 'network1843485230'; - $subnet = 'subnet-891534499'; - $canIpForward = true; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setPostStartupScript($postStartupScript); - $expectedResponse->setProxyUri($proxyUri); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setMachineType($machineType); - $expectedResponse->setInstallGpuDriver($installGpuDriver); - $expectedResponse->setCustomGpuDriverPath($customGpuDriverPath); - $expectedResponse->setBootDiskSizeGb($bootDiskSizeGb); - $expectedResponse->setDataDiskSizeGb($dataDiskSizeGb); - $expectedResponse->setNoRemoveDataDisk($noRemoveDataDisk); - $expectedResponse->setKmsKey($kmsKey); - $expectedResponse->setNoPublicIp($noPublicIp); - $expectedResponse->setNoProxyAccess($noProxyAccess); - $expectedResponse->setNetwork($network); - $expectedResponse->setSubnet($subnet); - $expectedResponse->setCanIpForward($canIpForward); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/upgradeInstanceInternalTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $vmId = 'vmId112317347'; - $response = $gapicClient->upgradeInstanceInternal($name, $vmId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.notebooks.v1beta1.NotebookService/UpgradeInstanceInternal', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualApiRequestObject->getVmId(); - $this->assertProtobufEquals($vmId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeInstanceInternalTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function upgradeInstanceInternalExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/upgradeInstanceInternalTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $vmId = 'vmId112317347'; - $response = $gapicClient->upgradeInstanceInternal($name, $vmId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeInstanceInternalTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Notebooks/tests/Unit/V2/Client/NotebookServiceClientTest.php b/Notebooks/tests/Unit/V2/Client/NotebookServiceClientTest.php index ca443b8fbf3e..a491fa765b98 100644 --- a/Notebooks/tests/Unit/V2/Client/NotebookServiceClientTest.php +++ b/Notebooks/tests/Unit/V2/Client/NotebookServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return NotebookServiceClient */ @@ -110,8 +112,7 @@ public function checkInstanceUpgradabilityTest() $transport->addResponse($expectedResponse); // Mock request $notebookInstance = 'notebookInstance-1078982023'; - $request = (new CheckInstanceUpgradabilityRequest()) - ->setNotebookInstance($notebookInstance); + $request = (new CheckInstanceUpgradabilityRequest())->setNotebookInstance($notebookInstance); $response = $gapicClient->checkInstanceUpgradability($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -135,17 +136,19 @@ public function checkInstanceUpgradabilityExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $notebookInstance = 'notebookInstance-1078982023'; - $request = (new CheckInstanceUpgradabilityRequest()) - ->setNotebookInstance($notebookInstance); + $request = (new CheckInstanceUpgradabilityRequest())->setNotebookInstance($notebookInstance); try { $gapicClient->checkInstanceUpgradability($request); // If the $gapicClient method call did not throw, fail the test @@ -265,12 +268,15 @@ public function createInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -333,8 +339,7 @@ public function deleteInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); + $request = (new DeleteInstanceRequest())->setName($formattedName); $response = $gapicClient->deleteInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -390,17 +395,19 @@ public function deleteInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); + $request = (new DeleteInstanceRequest())->setName($formattedName); $response = $gapicClient->deleteInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -467,9 +474,7 @@ public function diagnoseInstanceTest() $diagnosticConfig = new DiagnosticConfig(); $diagnosticConfigGcsBucket = 'diagnosticConfigGcsBucket-1116063720'; $diagnosticConfig->setGcsBucket($diagnosticConfigGcsBucket); - $request = (new DiagnoseInstanceRequest()) - ->setName($formattedName) - ->setDiagnosticConfig($diagnosticConfig); + $request = (new DiagnoseInstanceRequest())->setName($formattedName)->setDiagnosticConfig($diagnosticConfig); $response = $gapicClient->diagnoseInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -527,21 +532,22 @@ public function diagnoseInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); $diagnosticConfig = new DiagnosticConfig(); $diagnosticConfigGcsBucket = 'diagnosticConfigGcsBucket-1116063720'; $diagnosticConfig->setGcsBucket($diagnosticConfigGcsBucket); - $request = (new DiagnoseInstanceRequest()) - ->setName($formattedName) - ->setDiagnosticConfig($diagnosticConfig); + $request = (new DiagnoseInstanceRequest())->setName($formattedName)->setDiagnosticConfig($diagnosticConfig); $response = $gapicClient->diagnoseInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -587,8 +593,7 @@ public function getInstanceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); + $request = (new GetInstanceRequest())->setName($formattedName); $response = $gapicClient->getInstance($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -612,17 +617,19 @@ public function getInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); + $request = (new GetInstanceRequest())->setName($formattedName); try { $gapicClient->getInstance($request); // If the $gapicClient method call did not throw, fail the test @@ -647,17 +654,14 @@ public function listInstancesTest() // Mock response $nextPageToken = ''; $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; + $instances = [$instancesElement]; $expectedResponse = new ListInstancesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setInstances($instances); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); + $request = (new ListInstancesRequest())->setParent($formattedParent); $response = $gapicClient->listInstances($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -684,17 +688,19 @@ public function listInstancesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); + $request = (new ListInstancesRequest())->setParent($formattedParent); try { $gapicClient->listInstances($request); // If the $gapicClient method call did not throw, fail the test @@ -749,8 +755,7 @@ public function resetInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new ResetInstanceRequest()) - ->setName($name); + $request = (new ResetInstanceRequest())->setName($name); $response = $gapicClient->resetInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -806,17 +811,19 @@ public function resetInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new ResetInstanceRequest()) - ->setName($name); + $request = (new ResetInstanceRequest())->setName($name); $response = $gapicClient->resetInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -945,12 +952,15 @@ public function rollbackInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); @@ -1023,8 +1033,7 @@ public function startInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new StartInstanceRequest()) - ->setName($name); + $request = (new StartInstanceRequest())->setName($name); $response = $gapicClient->startInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1080,17 +1089,19 @@ public function startInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new StartInstanceRequest()) - ->setName($name); + $request = (new StartInstanceRequest())->setName($name); $response = $gapicClient->startInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1154,8 +1165,7 @@ public function stopInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new StopInstanceRequest()) - ->setName($name); + $request = (new StopInstanceRequest())->setName($name); $response = $gapicClient->stopInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1211,17 +1221,19 @@ public function stopInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new StopInstanceRequest()) - ->setName($name); + $request = (new StopInstanceRequest())->setName($name); $response = $gapicClient->stopInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1286,9 +1298,7 @@ public function updateInstanceTest() // Mock request $instance = new Instance(); $updateMask = new FieldMask(); - $request = (new UpdateInstanceRequest()) - ->setInstance($instance) - ->setUpdateMask($updateMask); + $request = (new UpdateInstanceRequest())->setInstance($instance)->setUpdateMask($updateMask); $response = $gapicClient->updateInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1346,19 +1356,20 @@ public function updateInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $instance = new Instance(); $updateMask = new FieldMask(); - $request = (new UpdateInstanceRequest()) - ->setInstance($instance) - ->setUpdateMask($updateMask); + $request = (new UpdateInstanceRequest())->setInstance($instance)->setUpdateMask($updateMask); $response = $gapicClient->updateInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1422,8 +1433,7 @@ public function upgradeInstanceTest() $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new UpgradeInstanceRequest()) - ->setName($name); + $request = (new UpgradeInstanceRequest())->setName($name); $response = $gapicClient->upgradeInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1479,17 +1489,19 @@ public function upgradeInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; - $request = (new UpgradeInstanceRequest()) - ->setName($name); + $request = (new UpgradeInstanceRequest())->setName($name); $response = $gapicClient->upgradeInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1551,12 +1563,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -1583,9 +1598,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -1615,12 +1628,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -1653,8 +1669,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1678,17 +1693,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1720,9 +1737,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1748,19 +1763,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1788,9 +1804,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1816,19 +1830,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1863,8 +1878,7 @@ public function checkInstanceUpgradabilityAsyncTest() $transport->addResponse($expectedResponse); // Mock request $notebookInstance = 'notebookInstance-1078982023'; - $request = (new CheckInstanceUpgradabilityRequest()) - ->setNotebookInstance($notebookInstance); + $request = (new CheckInstanceUpgradabilityRequest())->setNotebookInstance($notebookInstance); $response = $gapicClient->checkInstanceUpgradabilityAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/Optimization/.repo-metadata.json b/Optimization/.repo-metadata.json deleted file mode 100644 index 54dbf8b2fb69..000000000000 --- a/Optimization/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-optimization", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-optimization/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudoptimization" -} diff --git a/Optimization/README.md b/Optimization/README.md index 5c98a8cf43f6..143a597dce5d 100644 --- a/Optimization/README.md +++ b/Optimization/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/Optimization/VERSION b/Optimization/VERSION index 844f6a91acb9..ef5e4454454d 100644 --- a/Optimization/VERSION +++ b/Optimization/VERSION @@ -1 +1 @@ -0.6.3 +0.6.5 diff --git a/Optimization/composer.json b/Optimization/composer.json index de26d6d26c23..1de971eab512 100644 --- a/Optimization/composer.json +++ b/Optimization/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Optimization/owlbot.py b/Optimization/owlbot.py index e062ddb1f10d..263fb4ea6aa6 100644 --- a/Optimization/owlbot.py +++ b/Optimization/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -47,32 +41,6 @@ + "\n", '') -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) - # format generated clients subprocess.run([ 'npm', @@ -81,8 +49,8 @@ '--package=@prettier/plugin-php@^0.16', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', - '--print-width=80']) + '--print-width=120']) diff --git a/Optimization/src/V1/AggregatedMetrics.php b/Optimization/src/V1/AggregatedMetrics.php index bd9e49ae7605..22976ce6c208 100644 --- a/Optimization/src/V1/AggregatedMetrics.php +++ b/Optimization/src/V1/AggregatedMetrics.php @@ -26,37 +26,37 @@ class AggregatedMetrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 performed_shipment_count = 1; */ - private $performed_shipment_count = 0; + protected $performed_shipment_count = 0; /** * Total travel duration for a route or a solution. * * Generated from protobuf field .google.protobuf.Duration travel_duration = 2; */ - private $travel_duration = null; + protected $travel_duration = null; /** * Total wait duration for a route or a solution. * * Generated from protobuf field .google.protobuf.Duration wait_duration = 3; */ - private $wait_duration = null; + protected $wait_duration = null; /** * Total delay duration for a route or a solution. * * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; */ - private $delay_duration = null; + protected $delay_duration = null; /** * Total break duration for a route or a solution. * * Generated from protobuf field .google.protobuf.Duration break_duration = 5; */ - private $break_duration = null; + protected $break_duration = null; /** * Total visit duration for a route or a solution. * * Generated from protobuf field .google.protobuf.Duration visit_duration = 6; */ - private $visit_duration = null; + protected $visit_duration = null; /** * The total duration should be equal to the sum of all durations above. * For routes, it also corresponds to: @@ -66,13 +66,13 @@ class AggregatedMetrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration total_duration = 7; */ - private $total_duration = null; + protected $total_duration = null; /** * Total travel distance for a route or a solution. * * Generated from protobuf field double travel_distance_meters = 8; */ - private $travel_distance_meters = 0.0; + protected $travel_distance_meters = 0.0; /** * Maximum load achieved over the entire route (resp. solution), for each of * the quantities on this route (resp. solution), computed as the maximum over diff --git a/Optimization/src/V1/AsyncModelMetadata.php b/Optimization/src/V1/AsyncModelMetadata.php index ea3a6723a51d..a2578dd38100 100644 --- a/Optimization/src/V1/AsyncModelMetadata.php +++ b/Optimization/src/V1/AsyncModelMetadata.php @@ -20,26 +20,26 @@ class AsyncModelMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.AsyncModelMetadata.State state = 1; */ - private $state = 0; + protected $state = 0; /** * A message providing more details about the current state of the operation. * For example, the error message if the operation is failed. * * Generated from protobuf field string state_message = 2; */ - private $state_message = ''; + protected $state_message = ''; /** * The creation time of the operation. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; */ - private $create_time = null; + protected $create_time = null; /** * The last update time of the operation. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/Optimization/src/V1/BatchOptimizeToursRequest.php b/Optimization/src/V1/BatchOptimizeToursRequest.php index 8469cd790301..a1c21c85233e 100644 --- a/Optimization/src/V1/BatchOptimizeToursRequest.php +++ b/Optimization/src/V1/BatchOptimizeToursRequest.php @@ -26,7 +26,7 @@ class BatchOptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parent = ''; + protected $parent = ''; /** * Required. Input/Output information each purchase model, such as file paths * and data formats. diff --git a/Optimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php b/Optimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php index d79231b70eac..37053e55a3d6 100644 --- a/Optimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php +++ b/Optimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php @@ -21,19 +21,19 @@ class AsyncModelConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 1; */ - private $display_name = ''; + protected $display_name = ''; /** * Required. Information about the input model. * * Generated from protobuf field .google.cloud.optimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $input_config = null; + protected $input_config = null; /** * Required. The desired output location information. * * Generated from protobuf field .google.cloud.optimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $output_config = null; + protected $output_config = null; /** * If this is set, the model will be solved in the checkpoint mode. In this * mode, the input model can have a deadline longer than 30 mins without the @@ -46,7 +46,7 @@ class AsyncModelConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_checkpoints = 4; */ - private $enable_checkpoints = false; + protected $enable_checkpoints = false; /** * Constructor. diff --git a/Optimization/src/V1/BreakRule/BreakRequest.php b/Optimization/src/V1/BreakRule/BreakRequest.php index b94ad6687673..5249352d2077 100644 --- a/Optimization/src/V1/BreakRule/BreakRequest.php +++ b/Optimization/src/V1/BreakRule/BreakRequest.php @@ -24,19 +24,19 @@ class BreakRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $earliest_start_time = null; + protected $earliest_start_time = null; /** * Required. Upper bound (inclusive) on the start of the break. * * Generated from protobuf field .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $latest_start_time = null; + protected $latest_start_time = null; /** * Required. Minimum duration of the break. Must be positive. * * Generated from protobuf field .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $min_duration = null; + protected $min_duration = null; /** * Constructor. diff --git a/Optimization/src/V1/BreakRule/FrequencyConstraint.php b/Optimization/src/V1/BreakRule/FrequencyConstraint.php index ed95610a1174..eadcefaeabba 100644 --- a/Optimization/src/V1/BreakRule/FrequencyConstraint.php +++ b/Optimization/src/V1/BreakRule/FrequencyConstraint.php @@ -51,7 +51,7 @@ class FrequencyConstraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $min_break_duration = null; + protected $min_break_duration = null; /** * Required. Maximum allowed span of any interval of time in the route that * does not include at least partially a break of `duration >= @@ -59,7 +59,7 @@ class FrequencyConstraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_inter_break_duration = null; + protected $max_inter_break_duration = null; /** * Constructor. diff --git a/Optimization/src/V1/CapacityQuantity.php b/Optimization/src/V1/CapacityQuantity.php index 2d55e5710bdc..a9c5183dc909 100644 --- a/Optimization/src/V1/CapacityQuantity.php +++ b/Optimization/src/V1/CapacityQuantity.php @@ -21,11 +21,11 @@ class CapacityQuantity extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field string type = 1; */ - private $type = ''; + protected $type = ''; /** * Generated from protobuf field int64 value = 2; */ - private $value = 0; + protected $value = 0; /** * Constructor. diff --git a/Optimization/src/V1/CapacityQuantityInterval.php b/Optimization/src/V1/CapacityQuantityInterval.php index ed3ed24db849..020743277a3d 100644 --- a/Optimization/src/V1/CapacityQuantityInterval.php +++ b/Optimization/src/V1/CapacityQuantityInterval.php @@ -21,15 +21,15 @@ class CapacityQuantityInterval extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field string type = 1; */ - private $type = ''; + protected $type = ''; /** * Generated from protobuf field optional int64 min_value = 2; */ - private $min_value = null; + protected $min_value = null; /** * Generated from protobuf field optional int64 max_value = 3; */ - private $max_value = null; + protected $max_value = null; /** * Constructor. diff --git a/Optimization/src/V1/Client/FleetRoutingClient.php b/Optimization/src/V1/Client/FleetRoutingClient.php index 853382b19525..8635b879fae2 100644 --- a/Optimization/src/V1/Client/FleetRoutingClient.php +++ b/Optimization/src/V1/Client/FleetRoutingClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Constructor. * diff --git a/Optimization/src/V1/DistanceLimit.php b/Optimization/src/V1/DistanceLimit.php index a79150418ad8..70ad9af40a26 100644 --- a/Optimization/src/V1/DistanceLimit.php +++ b/Optimization/src/V1/DistanceLimit.php @@ -24,7 +24,7 @@ class DistanceLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int64 max_meters = 1; */ - private $max_meters = null; + protected $max_meters = null; /** * A soft limit not enforcing a maximum distance limit, but when violated * results in a cost which adds up to other costs defined in the model, @@ -34,7 +34,7 @@ class DistanceLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int64 soft_max_meters = 2; */ - private $soft_max_meters = null; + protected $soft_max_meters = null; /** * Cost per kilometer incurred, increasing up to `soft_max_meters`, with * formula: @@ -46,7 +46,7 @@ class DistanceLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double cost_per_kilometer_below_soft_max = 4; */ - private $cost_per_kilometer_below_soft_max = null; + protected $cost_per_kilometer_below_soft_max = null; /** * Cost per kilometer incurred if distance is above `soft_max_meters` limit. * The additional cost is 0 if the distance is under the limit, otherwise the @@ -59,7 +59,7 @@ class DistanceLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double cost_per_kilometer_above_soft_max = 3; */ - private $cost_per_kilometer_above_soft_max = null; + protected $cost_per_kilometer_above_soft_max = null; /** * Constructor. diff --git a/Optimization/src/V1/FleetRoutingClient.php b/Optimization/src/V1/FleetRoutingClient.php deleted file mode 100644 index 057a434d2d45..000000000000 --- a/Optimization/src/V1/FleetRoutingClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.optimization.v1.FleetRouting/OptimizeTours', - $argument, - ['\Google\Cloud\Optimization\V1\OptimizeToursResponse', 'decode'], - $metadata, $options); - } - - /** - * Optimizes vehicle tours for one or more `OptimizeToursRequest` - * messages as a batch. - * - * This method is a Long Running Operation (LRO). The inputs for optimization - * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` - * messages) are read/written from/to Cloud Storage in user-specified - * format. Like the `OptimizeTours` method, each `OptimizeToursRequest` - * contains a `ShipmentModel` and returns an `OptimizeToursResponse` - * containing `ShipmentRoute`s, which are a set of routes to be performed by - * vehicles minimizing the overall cost. - * @param \Google\Cloud\Optimization\V1\BatchOptimizeToursRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function BatchOptimizeTours(\Google\Cloud\Optimization\V1\BatchOptimizeToursRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.optimization.v1.FleetRouting/BatchOptimizeTours', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/Optimization/src/V1/Gapic/FleetRoutingGapicClient.php b/Optimization/src/V1/Gapic/FleetRoutingGapicClient.php deleted file mode 100644 index 9a867e1a46e0..000000000000 --- a/Optimization/src/V1/Gapic/FleetRoutingGapicClient.php +++ /dev/null @@ -1,690 +0,0 @@ -batchOptimizeTours($parent, $modelConfigs); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $fleetRoutingClient->batchOptimizeTours($parent, $modelConfigs); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $fleetRoutingClient->resumeOperation($operationName, 'batchOptimizeTours'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $fleetRoutingClient->close(); - * } - * ``` - * - * @deprecated Please use the new service client {@see \Google\Cloud\Optimization\V1\Client\FleetRoutingClient}. - */ -class FleetRoutingGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.optimization.v1.FleetRouting'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudoptimization.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudoptimization.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/fleet_routing_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/fleet_routing_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/fleet_routing_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/fleet_routing_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudoptimization.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Optimizes vehicle tours for one or more `OptimizeToursRequest` - * messages as a batch. - * - * This method is a Long Running Operation (LRO). The inputs for optimization - * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` - * messages) are read/written from/to Cloud Storage in user-specified - * format. Like the `OptimizeTours` method, each `OptimizeToursRequest` - * contains a `ShipmentModel` and returns an `OptimizeToursResponse` - * containing `ShipmentRoute`s, which are a set of routes to be performed by - * vehicles minimizing the overall cost. - * - * Sample code: - * ``` - * $fleetRoutingClient = new FleetRoutingClient(); - * try { - * $parent = 'parent'; - * $modelConfigs = []; - * $operationResponse = $fleetRoutingClient->batchOptimizeTours($parent, $modelConfigs); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $fleetRoutingClient->batchOptimizeTours($parent, $modelConfigs); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $fleetRoutingClient->resumeOperation($operationName, 'batchOptimizeTours'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $fleetRoutingClient->close(); - * } - * ``` - * - * @param string $parent Required. Target project and location to make a call. - * - * Format: `projects/{project-id}/locations/{location-id}`. - * - * If no location is specified, a region will be chosen automatically. - * @param AsyncModelConfig[] $modelConfigs Required. Input/Output information each purchase model, such as file paths - * and data formats. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchOptimizeTours( - $parent, - $modelConfigs, - array $optionalArgs = [] - ) { - $request = new BatchOptimizeToursRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setModelConfigs($modelConfigs); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'BatchOptimizeTours', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an - * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of - * routes to be performed by vehicles minimizing the overall cost. - * - * A `ShipmentModel` model consists mainly of `Shipment`s that need to be - * carried out and `Vehicle`s that can be used to transport the `Shipment`s. - * The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically, - * they assign a series of `Visit`s to each vehicle, where a `Visit` - * corresponds to a `VisitRequest`, which is a pickup or delivery for a - * `Shipment`. - * - * The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that - * minimizes the total cost where cost has many components defined in the - * `ShipmentModel`. - * - * Sample code: - * ``` - * $fleetRoutingClient = new FleetRoutingClient(); - * try { - * $parent = 'parent'; - * $response = $fleetRoutingClient->optimizeTours($parent); - * } finally { - * $fleetRoutingClient->close(); - * } - * ``` - * - * @param string $parent Required. Target project and location to make a call. - * - * Format: `projects/{project-id}/locations/{location-id}`. - * - * If no location is specified, a region will be chosen automatically. - * @param array $optionalArgs { - * Optional. - * - * @type Duration $timeout - * If this timeout is set, the server returns a response before the timeout - * period has elapsed or the server deadline for synchronous requests is - * reached, whichever is sooner. - * - * For asynchronous requests, the server will generate a solution (if - * possible) before the timeout has elapsed. - * @type ShipmentModel $model - * Shipment model to solve. - * @type int $solvingMode - * By default, the solving mode is `DEFAULT_SOLVE` (0). - * For allowed values, use constants defined on {@see \Google\Cloud\Optimization\V1\OptimizeToursRequest\SolvingMode} - * @type int $searchMode - * Search mode used to solve the request. - * For allowed values, use constants defined on {@see \Google\Cloud\Optimization\V1\OptimizeToursRequest\SearchMode} - * @type ShipmentRoute[] $injectedFirstSolutionRoutes - * Guide the optimization algorithm in finding a first solution that is - * similar to a previous solution. - * - * The model is constrained when the first solution is built. - * Any shipments not performed on a route are implicitly skipped in the first - * solution, but they may be performed in successive solutions. - * - * The solution must satisfy some basic validity assumptions: - * - * * for all routes, `vehicle_index` must be in range and not be duplicated. - * * for all visits, `shipment_index` and `visit_request_index` must be - * in range. - * * a shipment may only be referenced on one route. - * * the pickup of a pickup-delivery shipment must be performed before - * the delivery. - * * no more than one pickup alternative or delivery alternative of - * a shipment may be performed. - * * for all routes, times are increasing (i.e., `vehicle_start_time - * <= visits[0].start_time <= visits[1].start_time ... - * <= vehicle_end_time`). - * * a shipment may only be performed on a vehicle that is allowed. A - * vehicle is allowed if - * [Shipment.allowed_vehicle_indices][google.cloud.optimization.v1.Shipment.allowed_vehicle_indices] - * is empty or its `vehicle_index` is included in - * [Shipment.allowed_vehicle_indices][google.cloud.optimization.v1.Shipment.allowed_vehicle_indices]. - * - * If the injected solution is not feasible, a validation error is not - * necessarily returned and an error indicating infeasibility may be returned - * instead. - * @type InjectedSolutionConstraint $injectedSolutionConstraint - * Constrain the optimization algorithm to find a final solution that is - * similar to a previous solution. For example, this may be used to freeze - * portions of routes which have already been completed or which are to be - * completed but must not be modified. - * - * If the injected solution is not feasible, a validation error is not - * necessarily returned and an error indicating infeasibility may be returned - * instead. - * @type ShipmentRoute[] $refreshDetailsRoutes - * If non-empty, the given routes will be refreshed, without modifying their - * underlying sequence of visits or travel times: only other details will be - * updated. This does not solve the model. - * - * As of 2020/11, this only populates the polylines of non-empty routes and - * requires that `populate_polylines` is true. - * - * The `route_polyline` fields of the passed-in routes may be inconsistent - * with route `transitions`. - * - * This field must not be used together with `injected_first_solution_routes` - * or `injected_solution_constraint`. - * - * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. - * Polylines are still populated between all visits in all non-empty routes - * regardless of whether the related shipments or vehicles are ignored. - * @type bool $interpretInjectedSolutionsUsingLabels - * If true: - * - * * uses - * [ShipmentRoute.vehicle_label][google.cloud.optimization.v1.ShipmentRoute.vehicle_label] - * instead of `vehicle_index` to - * match routes in an injected solution with vehicles in the request; - * reuses the mapping of original - * [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index] - * to new - * [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index] - * to update - * [ConstraintRelaxation.vehicle_indices][google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] - * if non-empty, but the mapping must be unambiguous (i.e., multiple - * `ShipmentRoute`s must not share the same original `vehicle_index`). - * * uses - * [ShipmentRoute.Visit.shipment_label][google.cloud.optimization.v1.ShipmentRoute.Visit.shipment_label] - * instead of `shipment_index` - * to match visits in an injected solution with shipments in the request; - * * uses - * [SkippedShipment.label][google.cloud.optimization.v1.SkippedShipment.label] - * instead of - * [SkippedShipment.index][google.cloud.optimization.v1.SkippedShipment.index] - * to - * match skipped shipments in the injected solution with request - * shipments. - * - * This interpretation applies to the `injected_first_solution_routes`, - * `injected_solution_constraint`, and `refresh_details_routes` fields. - * It can be used when shipment or vehicle indices in the request have - * changed since the solution was created, perhaps because shipments or - * vehicles have been removed from or added to the request. - * - * If true, labels in the following categories must appear at most once in - * their category: - * - * * [Vehicle.label][google.cloud.optimization.v1.Vehicle.label] in the - * request; - * * [Shipment.label][google.cloud.optimization.v1.Shipment.label] in the - * request; - * * [ShipmentRoute.vehicle_label][google.cloud.optimization.v1.ShipmentRoute.vehicle_label] in the injected solution; - * * [SkippedShipment.label][google.cloud.optimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.cloud.optimization.v1.ShipmentRoute.Visit.shipment_label] in - * the injected solution (except pickup/delivery visit pairs, whose - * `shipment_label` must appear twice). - * - * If a `vehicle_label` in the injected solution does not correspond to a - * request vehicle, the corresponding route is removed from the solution - * along with its visits. If a `shipment_label` in the injected solution does - * not correspond to a request shipment, the corresponding visit is removed - * from the solution. If a - * [SkippedShipment.label][google.cloud.optimization.v1.SkippedShipment.label] - * in the injected solution does not correspond to a request shipment, the - * `SkippedShipment` is removed from the solution. - * - * Removing route visits or entire routes from an injected solution may - * have an effect on the implied constraints, which may lead to change in - * solution, validation errors, or infeasibility. - * - * NOTE: The caller must ensure that each - * [Vehicle.label][google.cloud.optimization.v1.Vehicle.label] (resp. - * [Shipment.label][google.cloud.optimization.v1.Shipment.label]) uniquely - * identifies a vehicle (resp. shipment) entity used across the two relevant - * requests: the past request that produced the `OptimizeToursResponse` used - * in the injected solution and the current request that includes the injected - * solution. The uniqueness checks described above are not enough to guarantee - * this requirement. - * @type bool $considerRoadTraffic - * Consider traffic estimation in calculating `ShipmentRoute` fields - * [Transition.travel_duration][google.cloud.optimization.v1.ShipmentRoute.Transition.travel_duration], - * [Visit.start_time][google.cloud.optimization.v1.ShipmentRoute.Visit.start_time], - * and `vehicle_end_time`; in setting the - * [ShipmentRoute.has_traffic_infeasibilities][google.cloud.optimization.v1.ShipmentRoute.has_traffic_infeasibilities] - * field, and in calculating the - * [OptimizeToursResponse.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.total_cost] - * field. - * @type bool $populatePolylines - * If true, polylines will be populated in response `ShipmentRoute`s. - * @type bool $populateTransitionPolylines - * If true, polylines will be populated in response - * [ShipmentRoute.transitions][google.cloud.optimization.v1.ShipmentRoute.transitions]. - * Note that in this case, the polylines will also be populated in the - * deprecated `travel_steps`. - * @type bool $allowLargeDeadlineDespiteInterruptionRisk - * If this is set, then the request can have a deadline - * (see https://grpc.io/blog/deadlines) of up to 60 minutes. - * Otherwise, the maximum deadline is only 30 minutes. - * Note that long-lived requests have a significantly larger (but still small) - * risk of interruption. - * @type bool $useGeodesicDistances - * If true, travel distances will be computed using geodesic distances instead - * of Google Maps distances, and travel times will be computed using geodesic - * distances with a speed defined by `geodesic_meters_per_second`. - * @type float $geodesicMetersPerSecond - * When `use_geodesic_distances` is true, this field must be set and defines - * the speed applied to compute travel times. Its value must be at least 1.0 - * meters/seconds. - * @type int $maxValidationErrors - * Truncates the number of validation errors returned. These errors are - * typically attached to an INVALID_ARGUMENT error payload as a BadRequest - * error detail (https://cloud.google.com/apis/design/errors#error_details), - * unless solving_mode=VALIDATE_ONLY: see the - * [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors] - * field. - * This defaults to 100 and is capped at 10,000. - * @type string $label - * Label that may be used to identify this request, reported back in the - * [OptimizeToursResponse.request_label][google.cloud.optimization.v1.OptimizeToursResponse.request_label]. - * @type bool $populateTravelStepPolylines - * Deprecated: Use - * [OptimizeToursRequest.populate_transition_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines] - * instead. If true, polylines will be populated in response - * [ShipmentRoute.transitions][google.cloud.optimization.v1.ShipmentRoute.transitions]. - * Note that in this case, the polylines will also be populated in the - * deprecated `travel_steps`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Optimization\V1\OptimizeToursResponse - * - * @throws ApiException if the remote call fails - */ - public function optimizeTours($parent, array $optionalArgs = []) - { - $request = new OptimizeToursRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['timeout'])) { - $request->setTimeout($optionalArgs['timeout']); - } - - if (isset($optionalArgs['model'])) { - $request->setModel($optionalArgs['model']); - } - - if (isset($optionalArgs['solvingMode'])) { - $request->setSolvingMode($optionalArgs['solvingMode']); - } - - if (isset($optionalArgs['searchMode'])) { - $request->setSearchMode($optionalArgs['searchMode']); - } - - if (isset($optionalArgs['injectedFirstSolutionRoutes'])) { - $request->setInjectedFirstSolutionRoutes( - $optionalArgs['injectedFirstSolutionRoutes'] - ); - } - - if (isset($optionalArgs['injectedSolutionConstraint'])) { - $request->setInjectedSolutionConstraint( - $optionalArgs['injectedSolutionConstraint'] - ); - } - - if (isset($optionalArgs['refreshDetailsRoutes'])) { - $request->setRefreshDetailsRoutes( - $optionalArgs['refreshDetailsRoutes'] - ); - } - - if (isset($optionalArgs['interpretInjectedSolutionsUsingLabels'])) { - $request->setInterpretInjectedSolutionsUsingLabels( - $optionalArgs['interpretInjectedSolutionsUsingLabels'] - ); - } - - if (isset($optionalArgs['considerRoadTraffic'])) { - $request->setConsiderRoadTraffic( - $optionalArgs['considerRoadTraffic'] - ); - } - - if (isset($optionalArgs['populatePolylines'])) { - $request->setPopulatePolylines($optionalArgs['populatePolylines']); - } - - if (isset($optionalArgs['populateTransitionPolylines'])) { - $request->setPopulateTransitionPolylines( - $optionalArgs['populateTransitionPolylines'] - ); - } - - if (isset($optionalArgs['allowLargeDeadlineDespiteInterruptionRisk'])) { - $request->setAllowLargeDeadlineDespiteInterruptionRisk( - $optionalArgs['allowLargeDeadlineDespiteInterruptionRisk'] - ); - } - - if (isset($optionalArgs['useGeodesicDistances'])) { - $request->setUseGeodesicDistances( - $optionalArgs['useGeodesicDistances'] - ); - } - - if (isset($optionalArgs['geodesicMetersPerSecond'])) { - $request->setGeodesicMetersPerSecond( - $optionalArgs['geodesicMetersPerSecond'] - ); - } - - if (isset($optionalArgs['maxValidationErrors'])) { - $request->setMaxValidationErrors( - $optionalArgs['maxValidationErrors'] - ); - } - - if (isset($optionalArgs['label'])) { - $request->setLabel($optionalArgs['label']); - } - - if (isset($optionalArgs['populateTravelStepPolylines'])) { - $request->setPopulateTravelStepPolylines( - $optionalArgs['populateTravelStepPolylines'] - ); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'OptimizeTours', - OptimizeToursResponse::class, - $optionalArgs, - $request - )->wait(); - } -} diff --git a/Optimization/src/V1/GcsDestination.php b/Optimization/src/V1/GcsDestination.php index 9c9d993880b2..3ccb29cfd250 100644 --- a/Optimization/src/V1/GcsDestination.php +++ b/Optimization/src/V1/GcsDestination.php @@ -20,7 +20,7 @@ class GcsDestination extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $uri = ''; + protected $uri = ''; /** * Constructor. diff --git a/Optimization/src/V1/GcsSource.php b/Optimization/src/V1/GcsSource.php index 2d630bfe970e..9ddec1cbc0f7 100644 --- a/Optimization/src/V1/GcsSource.php +++ b/Optimization/src/V1/GcsSource.php @@ -20,7 +20,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $uri = ''; + protected $uri = ''; /** * Constructor. diff --git a/Optimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php b/Optimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php index 5a4fee031252..c8170db9cbe7 100644 --- a/Optimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php +++ b/Optimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php @@ -50,13 +50,13 @@ class Relaxation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; */ - private $level = 0; + protected $level = 0; /** * The time at or after which the relaxation `level` may be applied. * * Generated from protobuf field .google.protobuf.Timestamp threshold_time = 2; */ - private $threshold_time = null; + protected $threshold_time = null; /** * The number of visits at or after which the relaxation `level` may be * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be @@ -67,7 +67,7 @@ class Relaxation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 threshold_visit_count = 3; */ - private $threshold_visit_count = 0; + protected $threshold_visit_count = 0; /** * Constructor. diff --git a/Optimization/src/V1/InputConfig.php b/Optimization/src/V1/InputConfig.php index 05cdd837c471..b6c65c213d2a 100644 --- a/Optimization/src/V1/InputConfig.php +++ b/Optimization/src/V1/InputConfig.php @@ -20,7 +20,7 @@ class InputConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.DataFormat data_format = 2; */ - private $data_format = 0; + protected $data_format = 0; protected $source; /** diff --git a/Optimization/src/V1/Location.php b/Optimization/src/V1/Location.php index d75aa1d056f4..cb4cfc3a20de 100644 --- a/Optimization/src/V1/Location.php +++ b/Optimization/src/V1/Location.php @@ -20,7 +20,7 @@ class Location extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.type.LatLng lat_lng = 1; */ - private $lat_lng = null; + protected $lat_lng = null; /** * The compass heading associated with the direction of the flow of traffic. * This value is used to specify the side of the road to use for pickup and @@ -29,7 +29,7 @@ class Location extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int32 heading = 2; */ - private $heading = null; + protected $heading = null; /** * Constructor. diff --git a/Optimization/src/V1/OptimizeToursRequest.php b/Optimization/src/V1/OptimizeToursRequest.php index 2c85c6ea1a44..97f382a04375 100644 --- a/Optimization/src/V1/OptimizeToursRequest.php +++ b/Optimization/src/V1/OptimizeToursRequest.php @@ -23,7 +23,7 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parent = ''; + protected $parent = ''; /** * If this timeout is set, the server returns a response before the timeout * period has elapsed or the server deadline for synchronous requests is @@ -33,25 +33,25 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration timeout = 2; */ - private $timeout = null; + protected $timeout = null; /** * Shipment model to solve. * * Generated from protobuf field .google.cloud.optimization.v1.ShipmentModel model = 3; */ - private $model = null; + protected $model = null; /** * By default, the solving mode is `DEFAULT_SOLVE` (0). * * Generated from protobuf field .google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; */ - private $solving_mode = 0; + protected $solving_mode = 0; /** * Search mode used to solve the request. * * Generated from protobuf field .google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; */ - private $search_mode = 0; + protected $search_mode = 0; /** * Guide the optimization algorithm in finding a first solution that is * similar to a previous solution. @@ -93,7 +93,7 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; */ - private $injected_solution_constraint = null; + protected $injected_solution_constraint = null; /** * If non-empty, the given routes will be refreshed, without modifying their * underlying sequence of visits or travel times: only other details will be @@ -173,7 +173,7 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool interpret_injected_solutions_using_labels = 10; */ - private $interpret_injected_solutions_using_labels = false; + protected $interpret_injected_solutions_using_labels = false; /** * Consider traffic estimation in calculating `ShipmentRoute` fields * [Transition.travel_duration][google.cloud.optimization.v1.ShipmentRoute.Transition.travel_duration], @@ -186,13 +186,13 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool consider_road_traffic = 11; */ - private $consider_road_traffic = false; + protected $consider_road_traffic = false; /** * If true, polylines will be populated in response `ShipmentRoute`s. * * Generated from protobuf field bool populate_polylines = 12; */ - private $populate_polylines = false; + protected $populate_polylines = false; /** * If true, polylines will be populated in response * [ShipmentRoute.transitions][google.cloud.optimization.v1.ShipmentRoute.transitions]. @@ -201,7 +201,7 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool populate_transition_polylines = 13; */ - private $populate_transition_polylines = false; + protected $populate_transition_polylines = false; /** * If this is set, then the request can have a deadline * (see https://grpc.io/blog/deadlines) of up to 60 minutes. @@ -211,7 +211,7 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool allow_large_deadline_despite_interruption_risk = 14; */ - private $allow_large_deadline_despite_interruption_risk = false; + protected $allow_large_deadline_despite_interruption_risk = false; /** * If true, travel distances will be computed using geodesic distances instead * of Google Maps distances, and travel times will be computed using geodesic @@ -219,7 +219,7 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool use_geodesic_distances = 15; */ - private $use_geodesic_distances = false; + protected $use_geodesic_distances = false; /** * When `use_geodesic_distances` is true, this field must be set and defines * the speed applied to compute travel times. Its value must be at least 1.0 @@ -227,7 +227,7 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double geodesic_meters_per_second = 16; */ - private $geodesic_meters_per_second = null; + protected $geodesic_meters_per_second = null; /** * Truncates the number of validation errors returned. These errors are * typically attached to an INVALID_ARGUMENT error payload as a BadRequest @@ -239,14 +239,14 @@ class OptimizeToursRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int32 max_validation_errors = 5; */ - private $max_validation_errors = null; + protected $max_validation_errors = null; /** * Label that may be used to identify this request, reported back in the * [OptimizeToursResponse.request_label][google.cloud.optimization.v1.OptimizeToursResponse.request_label]. * * Generated from protobuf field string label = 17; */ - private $label = ''; + protected $label = ''; /** * Deprecated: Use * [OptimizeToursRequest.populate_transition_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines] diff --git a/Optimization/src/V1/OptimizeToursResponse.php b/Optimization/src/V1/OptimizeToursResponse.php index 13dee71cfc19..14b27b295c28 100644 --- a/Optimization/src/V1/OptimizeToursResponse.php +++ b/Optimization/src/V1/OptimizeToursResponse.php @@ -31,7 +31,7 @@ class OptimizeToursResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_label = 3; */ - private $request_label = ''; + protected $request_label = ''; /** * The list of all shipments skipped. * @@ -52,7 +52,7 @@ class OptimizeToursResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6; */ - private $metrics = null; + protected $metrics = null; /** * Deprecated: Use * [Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost] diff --git a/Optimization/src/V1/OptimizeToursResponse/Metrics.php b/Optimization/src/V1/OptimizeToursResponse/Metrics.php index 42d83d3f87d3..156dfcb25d18 100644 --- a/Optimization/src/V1/OptimizeToursResponse/Metrics.php +++ b/Optimization/src/V1/OptimizeToursResponse/Metrics.php @@ -23,13 +23,13 @@ class Metrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1; */ - private $aggregated_route_metrics = null; + protected $aggregated_route_metrics = null; /** * Number of mandatory shipments skipped. * * Generated from protobuf field int32 skipped_mandatory_shipment_count = 2; */ - private $skipped_mandatory_shipment_count = 0; + protected $skipped_mandatory_shipment_count = 0; /** * Number of vehicles used. Note: if a vehicle route is empty and * [Vehicle.used_if_route_is_empty][google.cloud.optimization.v1.Vehicle.used_if_route_is_empty] @@ -37,7 +37,7 @@ class Metrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 used_vehicle_count = 3; */ - private $used_vehicle_count = 0; + protected $used_vehicle_count = 0; /** * The earliest start time for a used vehicle, computed as the minimum over * all used vehicles of @@ -45,7 +45,7 @@ class Metrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp earliest_vehicle_start_time = 4; */ - private $earliest_vehicle_start_time = null; + protected $earliest_vehicle_start_time = null; /** * The latest end time for a used vehicle, computed as the maximum over all * used vehicles of @@ -53,7 +53,7 @@ class Metrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp latest_vehicle_end_time = 5; */ - private $latest_vehicle_end_time = null; + protected $latest_vehicle_end_time = null; /** * Cost of the solution, broken down by cost-related request fields. * The keys are proto paths, relative to the input OptimizeToursRequest, @@ -73,7 +73,7 @@ class Metrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double total_cost = 6; */ - private $total_cost = 0.0; + protected $total_cost = 0.0; /** * Constructor. diff --git a/Optimization/src/V1/OptimizeToursValidationError.php b/Optimization/src/V1/OptimizeToursValidationError.php index e12b4554d7fe..bb7ec123e7f8 100644 --- a/Optimization/src/V1/OptimizeToursValidationError.php +++ b/Optimization/src/V1/OptimizeToursValidationError.php @@ -257,13 +257,13 @@ class OptimizeToursValidationError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 code = 1; */ - private $code = 0; + protected $code = 0; /** * The error display name. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * An error context may involve 0, 1 (most of the time) or more fields. For * example, referring to vehicle #4 and shipment #2's first pickup can be @@ -287,7 +287,7 @@ class OptimizeToursValidationError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string error_message = 4; */ - private $error_message = ''; + protected $error_message = ''; /** * May contain the value(s) of the field(s). This is not always available. You * should absolutely not rely on it and use it only for manual model @@ -295,7 +295,7 @@ class OptimizeToursValidationError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string offending_values = 5; */ - private $offending_values = ''; + protected $offending_values = ''; /** * Constructor. diff --git a/Optimization/src/V1/OptimizeToursValidationError/FieldReference.php b/Optimization/src/V1/OptimizeToursValidationError/FieldReference.php index 52b93165f70c..9efaeeb668d4 100644 --- a/Optimization/src/V1/OptimizeToursValidationError/FieldReference.php +++ b/Optimization/src/V1/OptimizeToursValidationError/FieldReference.php @@ -28,13 +28,13 @@ class FieldReference extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Recursively nested sub-field, if needed. * * Generated from protobuf field .google.cloud.optimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; */ - private $sub_field = null; + protected $sub_field = null; protected $index_or_key; /** diff --git a/Optimization/src/V1/OutputConfig.php b/Optimization/src/V1/OutputConfig.php index 1f1f07a5106a..b8b6565a9842 100644 --- a/Optimization/src/V1/OutputConfig.php +++ b/Optimization/src/V1/OutputConfig.php @@ -20,7 +20,7 @@ class OutputConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.DataFormat data_format = 2; */ - private $data_format = 0; + protected $data_format = 0; protected $destination; /** diff --git a/Optimization/src/V1/RouteModifiers.php b/Optimization/src/V1/RouteModifiers.php index 4c356775bd52..0a3309db7946 100644 --- a/Optimization/src/V1/RouteModifiers.php +++ b/Optimization/src/V1/RouteModifiers.php @@ -25,7 +25,7 @@ class RouteModifiers extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool avoid_tolls = 2; */ - private $avoid_tolls = false; + protected $avoid_tolls = false; /** * Specifies whether to avoid highways where reasonable. Preference will be * given to routes not containing highways. Applies only to motorized travel @@ -33,7 +33,7 @@ class RouteModifiers extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool avoid_highways = 3; */ - private $avoid_highways = false; + protected $avoid_highways = false; /** * Specifies whether to avoid ferries where reasonable. Preference will be * given to routes not containing travel by ferries. Applies only to motorized @@ -41,7 +41,7 @@ class RouteModifiers extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool avoid_ferries = 4; */ - private $avoid_ferries = false; + protected $avoid_ferries = false; /** * Optional. Specifies whether to avoid navigating indoors where reasonable. * Preference will be given to routes not containing indoor navigation. @@ -49,7 +49,7 @@ class RouteModifiers extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool avoid_indoor = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $avoid_indoor = false; + protected $avoid_indoor = false; /** * Constructor. diff --git a/Optimization/src/V1/Shipment.php b/Optimization/src/V1/Shipment.php index bda31c679302..652069078d66 100644 --- a/Optimization/src/V1/Shipment.php +++ b/Optimization/src/V1/Shipment.php @@ -55,7 +55,7 @@ class Shipment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double penalty_cost = 4; */ - private $penalty_cost = null; + protected $penalty_cost = null; /** * The set of vehicles that may perform this shipment. If empty, all vehicles * may perform it. Vehicles are given by their index in the `ShipmentModel`'s @@ -105,7 +105,7 @@ class Shipment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double pickup_to_delivery_relative_detour_limit = 8; */ - private $pickup_to_delivery_relative_detour_limit = null; + protected $pickup_to_delivery_relative_detour_limit = null; /** * Specifies the maximum absolute detour time compared to the shortest path * from pickup to delivery. If specified, it must be nonnegative, and the @@ -124,7 +124,7 @@ class Shipment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; */ - private $pickup_to_delivery_absolute_detour_limit = null; + protected $pickup_to_delivery_absolute_detour_limit = null; /** * Specifies the maximum duration from start of pickup to start of delivery of * a shipment. If specified, it must be nonnegative, and the shipment must @@ -135,7 +135,7 @@ class Shipment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_time_limit = 10; */ - private $pickup_to_delivery_time_limit = null; + protected $pickup_to_delivery_time_limit = null; /** * Non-empty string specifying a "type" for this shipment. * This feature can be used to define incompatibilities or requirements @@ -147,7 +147,7 @@ class Shipment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string shipment_type = 11; */ - private $shipment_type = ''; + protected $shipment_type = ''; /** * Specifies a label for this shipment. This label is reported in the response * in the `shipment_label` of the corresponding @@ -155,7 +155,7 @@ class Shipment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string label = 12; */ - private $label = ''; + protected $label = ''; /** * If true, skip this shipment, but don't apply a `penalty_cost`. * Ignoring a shipment results in a validation error when there are any @@ -167,7 +167,7 @@ class Shipment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool ignore = 13; */ - private $ignore = false; + protected $ignore = false; /** * Deprecated: Use * [Shipment.load_demands][google.cloud.optimization.v1.Shipment.load_demands] diff --git a/Optimization/src/V1/Shipment/Load.php b/Optimization/src/V1/Shipment/Load.php index 5bbd1032c66f..36b14a8fe738 100644 --- a/Optimization/src/V1/Shipment/Load.php +++ b/Optimization/src/V1/Shipment/Load.php @@ -25,7 +25,7 @@ class Load extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 amount = 2; */ - private $amount = 0; + protected $amount = 0; /** * Constructor. diff --git a/Optimization/src/V1/Shipment/VisitRequest.php b/Optimization/src/V1/Shipment/VisitRequest.php index 3c82d7c20548..0de34e70561f 100644 --- a/Optimization/src/V1/Shipment/VisitRequest.php +++ b/Optimization/src/V1/Shipment/VisitRequest.php @@ -25,7 +25,7 @@ class VisitRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.type.LatLng arrival_location = 1; */ - private $arrival_location = null; + protected $arrival_location = null; /** * The waypoint where the vehicle arrives when performing this * `VisitRequest`. If the shipment model has duration distance matrices, @@ -33,7 +33,7 @@ class VisitRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.Waypoint arrival_waypoint = 2; */ - private $arrival_waypoint = null; + protected $arrival_waypoint = null; /** * The geo-location where the vehicle departs after completing this * `VisitRequest`. Can be omitted if it is the same as `arrival_location`. @@ -42,7 +42,7 @@ class VisitRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.type.LatLng departure_location = 3; */ - private $departure_location = null; + protected $departure_location = null; /** * The waypoint where the vehicle departs after completing this * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. @@ -51,7 +51,7 @@ class VisitRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.Waypoint departure_waypoint = 4; */ - private $departure_waypoint = null; + protected $departure_waypoint = null; /** * Specifies tags attached to the visit request. * Empty or duplicate strings are not allowed. @@ -82,7 +82,7 @@ class VisitRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration duration = 7; */ - private $duration = null; + protected $duration = null; /** * Cost to service this visit request on a vehicle route. This can be used * to pay different costs for each alternative pickup or delivery of a @@ -91,7 +91,7 @@ class VisitRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double cost = 8; */ - private $cost = 0.0; + protected $cost = 0.0; /** * Load demands of this visit request. This is just like * [Shipment.load_demands][google.cloud.optimization.v1.Shipment.load_demands] @@ -120,7 +120,7 @@ class VisitRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string label = 11; */ - private $label = ''; + protected $label = ''; /** * Deprecated: Use * [VisitRequest.load_demands][google.cloud.optimization.v1.Shipment.VisitRequest.load_demands] diff --git a/Optimization/src/V1/ShipmentModel.php b/Optimization/src/V1/ShipmentModel.php index 447be9106ef4..058949f5a9bd 100644 --- a/Optimization/src/V1/ShipmentModel.php +++ b/Optimization/src/V1/ShipmentModel.php @@ -42,7 +42,7 @@ class ShipmentModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int32 max_active_vehicles = 4; */ - private $max_active_vehicles = null; + protected $max_active_vehicles = null; /** * Global start and end time of the model: no times outside of this range * can be considered valid. @@ -56,14 +56,14 @@ class ShipmentModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp global_start_time = 5; */ - private $global_start_time = null; + protected $global_start_time = null; /** * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) * is used as default. * * Generated from protobuf field .google.protobuf.Timestamp global_end_time = 6; */ - private $global_end_time = null; + protected $global_end_time = null; /** * The "global duration" of the overall plan is the difference between the * earliest effective start time and the latest effective end time of @@ -74,7 +74,7 @@ class ShipmentModel extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double global_duration_cost_per_hour = 7; */ - private $global_duration_cost_per_hour = 0.0; + protected $global_duration_cost_per_hour = 0.0; /** * Specifies duration and distance matrices used in the model. If this field * is empty, Google Maps or geodesic distances will be used instead, depending diff --git a/Optimization/src/V1/ShipmentModel/BreakRule/BreakRequest.php b/Optimization/src/V1/ShipmentModel/BreakRule/BreakRequest.php index 4d4a719150d3..2c5d2f194083 100644 --- a/Optimization/src/V1/ShipmentModel/BreakRule/BreakRequest.php +++ b/Optimization/src/V1/ShipmentModel/BreakRule/BreakRequest.php @@ -24,19 +24,19 @@ class BreakRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $earliest_start_time = null; + protected $earliest_start_time = null; /** * Required. Upper bound (inclusive) on the start of the break. * * Generated from protobuf field .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $latest_start_time = null; + protected $latest_start_time = null; /** * Required. Minimum duration of the break. Must be positive. * * Generated from protobuf field .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $min_duration = null; + protected $min_duration = null; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentModel/BreakRule/FrequencyConstraint.php b/Optimization/src/V1/ShipmentModel/BreakRule/FrequencyConstraint.php index 363fff0cbba8..bd64391c1e4a 100644 --- a/Optimization/src/V1/ShipmentModel/BreakRule/FrequencyConstraint.php +++ b/Optimization/src/V1/ShipmentModel/BreakRule/FrequencyConstraint.php @@ -51,7 +51,7 @@ class FrequencyConstraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $min_break_duration = null; + protected $min_break_duration = null; /** * Required. Maximum allowed span of any interval of time in the route * that does not include at least partially a break of `duration >= @@ -59,7 +59,7 @@ class FrequencyConstraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $max_inter_break_duration = null; + protected $max_inter_break_duration = null; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentModel/DurationDistanceMatrix.php b/Optimization/src/V1/ShipmentModel/DurationDistanceMatrix.php index 66b0bdc8124d..d209bc4e5c2a 100644 --- a/Optimization/src/V1/ShipmentModel/DurationDistanceMatrix.php +++ b/Optimization/src/V1/ShipmentModel/DurationDistanceMatrix.php @@ -35,7 +35,7 @@ class DurationDistanceMatrix extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string vehicle_start_tag = 2; */ - private $vehicle_start_tag = ''; + protected $vehicle_start_tag = ''; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentModel/PrecedenceRule.php b/Optimization/src/V1/ShipmentModel/PrecedenceRule.php index 509b6c74d8b0..3c125da2dbc5 100644 --- a/Optimization/src/V1/ShipmentModel/PrecedenceRule.php +++ b/Optimization/src/V1/ShipmentModel/PrecedenceRule.php @@ -27,31 +27,31 @@ class PrecedenceRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int32 first_index = 1; */ - private $first_index = null; + protected $first_index = null; /** * Indicates if the "first" event is a delivery. * * Generated from protobuf field bool first_is_delivery = 3; */ - private $first_is_delivery = false; + protected $first_is_delivery = false; /** * Shipment index of the "second" event. This field must be specified. * * Generated from protobuf field optional int32 second_index = 2; */ - private $second_index = null; + protected $second_index = null; /** * Indicates if the "second" event is a delivery. * * Generated from protobuf field bool second_is_delivery = 4; */ - private $second_is_delivery = false; + protected $second_is_delivery = false; /** * The offset between the "first" and "second" event. It can be negative. * * Generated from protobuf field .google.protobuf.Duration offset_duration = 5; */ - private $offset_duration = null; + protected $offset_duration = null; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentRoute.php b/Optimization/src/V1/ShipmentRoute.php index 26b7ebf14f5f..05da325cf562 100644 --- a/Optimization/src/V1/ShipmentRoute.php +++ b/Optimization/src/V1/ShipmentRoute.php @@ -98,26 +98,26 @@ class ShipmentRoute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 vehicle_index = 1; */ - private $vehicle_index = 0; + protected $vehicle_index = 0; /** * Label of the vehicle performing this route, equal to * `ShipmentModel.vehicles(vehicle_index).label`, if specified. * * Generated from protobuf field string vehicle_label = 2; */ - private $vehicle_label = ''; + protected $vehicle_label = ''; /** * Time at which the vehicle starts its route. * * Generated from protobuf field .google.protobuf.Timestamp vehicle_start_time = 5; */ - private $vehicle_start_time = null; + protected $vehicle_start_time = null; /** * Time at which the vehicle finishes its route. * * Generated from protobuf field .google.protobuf.Timestamp vehicle_end_time = 6; */ - private $vehicle_end_time = null; + protected $vehicle_end_time = null; /** * Ordered sequence of visits representing a route. * visits[i] is the i-th visit in the route. @@ -152,7 +152,7 @@ class ShipmentRoute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool has_traffic_infeasibilities = 9; */ - private $has_traffic_infeasibilities = false; + protected $has_traffic_infeasibilities = false; /** * The encoded polyline representation of the route. * This field is only populated if @@ -161,7 +161,7 @@ class ShipmentRoute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; */ - private $route_polyline = null; + protected $route_polyline = null; /** * Breaks scheduled for the vehicle performing this route. * The `breaks` sequence represents time intervals, each starting at the @@ -181,7 +181,7 @@ class ShipmentRoute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.AggregatedMetrics metrics = 12; */ - private $metrics = null; + protected $metrics = null; /** * Cost of the route, broken down by cost-related request fields. * The keys are proto paths, relative to the input OptimizeToursRequest, e.g. @@ -200,7 +200,7 @@ class ShipmentRoute extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double route_total_cost = 18; */ - private $route_total_cost = 0.0; + protected $route_total_cost = 0.0; /** * Deprecated: Use * [Transition.vehicle_loads][google.cloud.optimization.v1.ShipmentRoute.Transition.vehicle_loads] diff --git a/Optimization/src/V1/ShipmentRoute/Delay.php b/Optimization/src/V1/ShipmentRoute/Delay.php index 98c9963c58c5..6e2ef2dcebb7 100644 --- a/Optimization/src/V1/ShipmentRoute/Delay.php +++ b/Optimization/src/V1/ShipmentRoute/Delay.php @@ -24,13 +24,13 @@ class Delay extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - private $start_time = null; + protected $start_time = null; /** * Duration of the delay. * * Generated from protobuf field .google.protobuf.Duration duration = 2; */ - private $duration = null; + protected $duration = null; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentRoute/EncodedPolyline.php b/Optimization/src/V1/ShipmentRoute/EncodedPolyline.php index 441e0efb6cc6..a930a4eacea8 100644 --- a/Optimization/src/V1/ShipmentRoute/EncodedPolyline.php +++ b/Optimization/src/V1/ShipmentRoute/EncodedPolyline.php @@ -23,7 +23,7 @@ class EncodedPolyline extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string points = 1; */ - private $points = ''; + protected $points = ''; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentRoute/PBBreak.php b/Optimization/src/V1/ShipmentRoute/PBBreak.php index 8e137a3a492e..fae28f7abedc 100644 --- a/Optimization/src/V1/ShipmentRoute/PBBreak.php +++ b/Optimization/src/V1/ShipmentRoute/PBBreak.php @@ -20,13 +20,13 @@ class PBBreak extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - private $start_time = null; + protected $start_time = null; /** * Duration of a break. * * Generated from protobuf field .google.protobuf.Duration duration = 2; */ - private $duration = null; + protected $duration = null; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentRoute/Transition.php b/Optimization/src/V1/ShipmentRoute/Transition.php index dde3e27515f6..689a30f8e195 100644 --- a/Optimization/src/V1/ShipmentRoute/Transition.php +++ b/Optimization/src/V1/ShipmentRoute/Transition.php @@ -23,13 +23,13 @@ class Transition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration travel_duration = 1; */ - private $travel_duration = null; + protected $travel_duration = null; /** * Distance traveled during the transition. * * Generated from protobuf field double travel_distance_meters = 2; */ - private $travel_distance_meters = 0.0; + protected $travel_distance_meters = 0.0; /** * When traffic is requested via * [OptimizeToursRequest.consider_road_traffic] @@ -40,7 +40,7 @@ class Transition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool traffic_info_unavailable = 3; */ - private $traffic_info_unavailable = false; + protected $traffic_info_unavailable = false; /** * Sum of the delay durations applied to this transition. If any, the delay * starts exactly `delay_duration` seconds before the next event (visit or @@ -49,7 +49,7 @@ class Transition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; */ - private $delay_duration = null; + protected $delay_duration = null; /** * Sum of the duration of the breaks occurring during this transition, if * any. Details about each break's start time and duration are stored in @@ -57,7 +57,7 @@ class Transition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration break_duration = 5; */ - private $break_duration = null; + protected $break_duration = null; /** * Time spent waiting during this transition. Wait duration corresponds to * idle time and does not include break time. Also note that this wait time @@ -65,7 +65,7 @@ class Transition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration wait_duration = 6; */ - private $wait_duration = null; + protected $wait_duration = null; /** * Total duration of the transition, provided for convenience. It is equal * to: @@ -77,13 +77,13 @@ class Transition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration total_duration = 7; */ - private $total_duration = null; + protected $total_duration = null; /** * Start time of this transition. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 8; */ - private $start_time = null; + protected $start_time = null; /** * The encoded polyline representation of the route followed during the * transition. @@ -93,7 +93,7 @@ class Transition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; */ - private $route_polyline = null; + protected $route_polyline = null; /** * Vehicle loads during this transition, for each type that either appears * in this vehicle's diff --git a/Optimization/src/V1/ShipmentRoute/TravelStep.php b/Optimization/src/V1/ShipmentRoute/TravelStep.php index cd7d0d2ae27d..6977249edcbd 100644 --- a/Optimization/src/V1/ShipmentRoute/TravelStep.php +++ b/Optimization/src/V1/ShipmentRoute/TravelStep.php @@ -32,13 +32,13 @@ class TravelStep extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration duration = 1; */ - private $duration = null; + protected $duration = null; /** * Distance traveled during the step. * * Generated from protobuf field double distance_meters = 2; */ - private $distance_meters = 0.0; + protected $distance_meters = 0.0; /** * When traffic is requested via * [OptimizeToursRequest.consider_road_traffic][google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic], @@ -48,7 +48,7 @@ class TravelStep extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool traffic_info_unavailable = 3; */ - private $traffic_info_unavailable = false; + protected $traffic_info_unavailable = false; /** * The encoded polyline representation of the route followed during the * step. @@ -58,7 +58,7 @@ class TravelStep extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4; */ - private $route_polyline = null; + protected $route_polyline = null; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentRoute/VehicleLoad.php b/Optimization/src/V1/ShipmentRoute/VehicleLoad.php index 29bb1d03e8b7..748144841d92 100644 --- a/Optimization/src/V1/ShipmentRoute/VehicleLoad.php +++ b/Optimization/src/V1/ShipmentRoute/VehicleLoad.php @@ -24,7 +24,7 @@ class VehicleLoad extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 amount = 1; */ - private $amount = 0; + protected $amount = 0; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentRoute/Visit.php b/Optimization/src/V1/ShipmentRoute/Visit.php index 24fb82775ce7..14d098f0cf98 100644 --- a/Optimization/src/V1/ShipmentRoute/Visit.php +++ b/Optimization/src/V1/ShipmentRoute/Visit.php @@ -22,21 +22,21 @@ class Visit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 shipment_index = 1; */ - private $shipment_index = 0; + protected $shipment_index = 0; /** * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it * corresponds to a delivery. * * Generated from protobuf field bool is_pickup = 2; */ - private $is_pickup = false; + protected $is_pickup = false; /** * Index of `VisitRequest` in either the pickup or delivery field of the * `Shipment` (see `is_pickup`). * * Generated from protobuf field int32 visit_request_index = 3; */ - private $visit_request_index = 0; + protected $visit_request_index = 0; /** * Time at which the visit starts. Note that the vehicle may arrive earlier * than this at the visit location. Times are consistent with the @@ -44,7 +44,7 @@ class Visit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; */ - private $start_time = null; + protected $start_time = null; /** * Total visit load demand as the sum of the shipment and the visit request * `load_demands`. The values are negative if the visit is a delivery. @@ -74,14 +74,14 @@ class Visit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration detour = 6; */ - private $detour = null; + protected $detour = null; /** * Copy of the corresponding `Shipment.label`, if specified in the * `Shipment`. * * Generated from protobuf field string shipment_label = 7; */ - private $shipment_label = ''; + protected $shipment_label = ''; /** * Copy of the corresponding * [VisitRequest.label][google.cloud.optimization.v1.Shipment.VisitRequest.label], @@ -89,7 +89,7 @@ class Visit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string visit_label = 8; */ - private $visit_label = ''; + protected $visit_label = ''; /** * Deprecated: Use * [Transition.vehicle_loads][google.cloud.optimization.v1.ShipmentRoute.Transition.vehicle_loads] diff --git a/Optimization/src/V1/ShipmentTypeIncompatibility.php b/Optimization/src/V1/ShipmentTypeIncompatibility.php index 92968de59157..b42f828a6d3c 100644 --- a/Optimization/src/V1/ShipmentTypeIncompatibility.php +++ b/Optimization/src/V1/ShipmentTypeIncompatibility.php @@ -29,7 +29,7 @@ class ShipmentTypeIncompatibility extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; */ - private $incompatibility_mode = 0; + protected $incompatibility_mode = 0; /** * Constructor. diff --git a/Optimization/src/V1/ShipmentTypeRequirement.php b/Optimization/src/V1/ShipmentTypeRequirement.php index ebe1ddba7e19..1b6005011b9b 100644 --- a/Optimization/src/V1/ShipmentTypeRequirement.php +++ b/Optimization/src/V1/ShipmentTypeRequirement.php @@ -38,7 +38,7 @@ class ShipmentTypeRequirement extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; */ - private $requirement_mode = 0; + protected $requirement_mode = 0; /** * Constructor. diff --git a/Optimization/src/V1/SkippedShipment.php b/Optimization/src/V1/SkippedShipment.php index de3502241baf..90c4eeab9d8a 100644 --- a/Optimization/src/V1/SkippedShipment.php +++ b/Optimization/src/V1/SkippedShipment.php @@ -23,7 +23,7 @@ class SkippedShipment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 index = 1; */ - private $index = 0; + protected $index = 0; /** * Copy of the corresponding * [Shipment.label][google.cloud.optimization.v1.Shipment.label], if specified @@ -31,7 +31,7 @@ class SkippedShipment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string label = 2; */ - private $label = ''; + protected $label = ''; /** * A list of reasons that explain why the shipment was skipped. See comment * above `Reason`. diff --git a/Optimization/src/V1/SkippedShipment/Reason.php b/Optimization/src/V1/SkippedShipment/Reason.php index 15347c3f689b..600f452d411f 100644 --- a/Optimization/src/V1/SkippedShipment/Reason.php +++ b/Optimization/src/V1/SkippedShipment/Reason.php @@ -45,21 +45,21 @@ class Reason extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1; */ - private $code = 0; + protected $code = 0; /** * If the reason is related to a shipment-vehicle incompatibility, this * field provides the index of one relevant vehicle. * * Generated from protobuf field optional int32 example_vehicle_index = 2; */ - private $example_vehicle_index = null; + protected $example_vehicle_index = null; /** * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one * capacity type that is exceeded. * * Generated from protobuf field string example_exceeded_capacity_type = 3; */ - private $example_exceeded_capacity_type = ''; + protected $example_exceeded_capacity_type = ''; /** * Constructor. diff --git a/Optimization/src/V1/TimeWindow.php b/Optimization/src/V1/TimeWindow.php index cbbee60f3e3c..33c8cc767a0b 100644 --- a/Optimization/src/V1/TimeWindow.php +++ b/Optimization/src/V1/TimeWindow.php @@ -40,26 +40,26 @@ class TimeWindow extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - private $start_time = null; + protected $start_time = null; /** * The hard time window end time. If unspecified it will be set to * `ShipmentModel.global_end_time`. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - private $end_time = null; + protected $end_time = null; /** * The soft start time of the time window. * * Generated from protobuf field .google.protobuf.Timestamp soft_start_time = 3; */ - private $soft_start_time = null; + protected $soft_start_time = null; /** * The soft end time of the time window. * * Generated from protobuf field .google.protobuf.Timestamp soft_end_time = 4; */ - private $soft_end_time = null; + protected $soft_end_time = null; /** * A cost per hour added to other costs in the model if the event occurs * before soft_start_time, computed as: @@ -73,7 +73,7 @@ class TimeWindow extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double cost_per_hour_before_soft_start_time = 5; */ - private $cost_per_hour_before_soft_start_time = null; + protected $cost_per_hour_before_soft_start_time = null; /** * A cost per hour added to other costs in the model if the event occurs after * `soft_end_time`, computed as: @@ -87,7 +87,7 @@ class TimeWindow extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double cost_per_hour_after_soft_end_time = 6; */ - private $cost_per_hour_after_soft_end_time = null; + protected $cost_per_hour_after_soft_end_time = null; /** * Constructor. diff --git a/Optimization/src/V1/TransitionAttributes.php b/Optimization/src/V1/TransitionAttributes.php index 61ac001df2a4..a5182bd35dfb 100644 --- a/Optimization/src/V1/TransitionAttributes.php +++ b/Optimization/src/V1/TransitionAttributes.php @@ -28,14 +28,14 @@ class TransitionAttributes extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string src_tag = 1; */ - private $src_tag = ''; + protected $src_tag = ''; /** * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be * non-empty. * * Generated from protobuf field string excluded_src_tag = 2; */ - private $excluded_src_tag = ''; + protected $excluded_src_tag = ''; /** * A destination visit or vehicle end matches iff its * [VisitRequest.tags][google.cloud.optimization.v1.Shipment.VisitRequest.tags] @@ -45,14 +45,14 @@ class TransitionAttributes extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dst_tag = 3; */ - private $dst_tag = ''; + protected $dst_tag = ''; /** * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be * non-empty. * * Generated from protobuf field string excluded_dst_tag = 4; */ - private $excluded_dst_tag = ''; + protected $excluded_dst_tag = ''; /** * Specifies a cost for performing this transition. This is in the same unit * as all other costs in the model and must not be negative. It is applied on @@ -60,7 +60,7 @@ class TransitionAttributes extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double cost = 5; */ - private $cost = 0.0; + protected $cost = 0.0; /** * Specifies a cost per kilometer applied to the distance traveled while * performing this transition. It adds up to any @@ -69,7 +69,7 @@ class TransitionAttributes extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double cost_per_kilometer = 6; */ - private $cost_per_kilometer = 0.0; + protected $cost_per_kilometer = 0.0; /** * Specifies a limit on the distance traveled while performing this * transition. @@ -77,7 +77,7 @@ class TransitionAttributes extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.DistanceLimit distance_limit = 7; */ - private $distance_limit = null; + protected $distance_limit = null; /** * Specifies a delay incurred when performing this transition. * This delay always occurs *after* finishing the source visit and *before* @@ -85,7 +85,7 @@ class TransitionAttributes extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration delay = 8; */ - private $delay = null; + protected $delay = null; /** * Constructor. diff --git a/Optimization/src/V1/Vehicle.php b/Optimization/src/V1/Vehicle.php index b5dbb09f5210..90af4115a7c0 100644 --- a/Optimization/src/V1/Vehicle.php +++ b/Optimization/src/V1/Vehicle.php @@ -23,14 +23,14 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.Vehicle.TravelMode travel_mode = 1; */ - private $travel_mode = 0; + protected $travel_mode = 0; /** * Optional. A set of conditions to satisfy that affect the way routes are * calculated for the given vehicle. * * Generated from protobuf field .google.cloud.optimization.v1.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $route_modifiers = null; + protected $route_modifiers = null; /** * Geographic location where the vehicle starts before picking up any * shipments. If not specified, the vehicle starts at its first pickup. @@ -39,7 +39,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.type.LatLng start_location = 3; */ - private $start_location = null; + protected $start_location = null; /** * Waypoint representing a geographic location where the vehicle starts before * picking up any shipments. If neither `start_waypoint` nor `start_location` @@ -49,7 +49,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.Waypoint start_waypoint = 4; */ - private $start_waypoint = null; + protected $start_waypoint = null; /** * Geographic location where the vehicle ends after it has completed its last * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends @@ -59,7 +59,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.type.LatLng end_location = 5; */ - private $end_location = null; + protected $end_location = null; /** * Waypoint representing a geographic location where the vehicle ends after * it has completed its last `VisitRequest`. If neither `end_waypoint` nor @@ -70,7 +70,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.Waypoint end_waypoint = 6; */ - private $end_waypoint = null; + protected $end_waypoint = null; /** * Specifies tags attached to the start of the vehicle's route. * Empty or duplicate strings are not allowed. @@ -130,13 +130,13 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double travel_duration_multiple = 11; */ - private $travel_duration_multiple = null; + protected $travel_duration_multiple = null; /** * Unloading policy enforced on the vehicle. * * Generated from protobuf field .google.cloud.optimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; */ - private $unloading_policy = 0; + protected $unloading_policy = 0; /** * Capacities of the vehicle (weight, volume, # of pallets for example). * The keys in the map are the identifiers of the type of load, consistent @@ -158,7 +158,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double cost_per_hour = 16; */ - private $cost_per_hour = 0.0; + protected $cost_per_hour = 0.0; /** * Cost per traveled hour of the vehicle route. This cost is applied only to * travel time taken by the route (i.e., that reported in @@ -167,7 +167,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double cost_per_traveled_hour = 17; */ - private $cost_per_traveled_hour = 0.0; + protected $cost_per_traveled_hour = 0.0; /** * Cost per kilometer of the vehicle route. This cost is applied to the * distance reported in the @@ -177,13 +177,13 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double cost_per_kilometer = 18; */ - private $cost_per_kilometer = 0.0; + protected $cost_per_kilometer = 0.0; /** * Fixed cost applied if this vehicle is used to handle a shipment. * * Generated from protobuf field double fixed_cost = 19; */ - private $fixed_cost = 0.0; + protected $fixed_cost = 0.0; /** * This field only applies to vehicles when their route does not serve any * shipments. It indicates if the vehicle should be considered as used or not @@ -198,7 +198,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool used_if_route_is_empty = 20; */ - private $used_if_route_is_empty = false; + protected $used_if_route_is_empty = false; /** * Limit applied to the total duration of the vehicle's route. In a given * `OptimizeToursResponse`, the route duration of a vehicle is the @@ -206,7 +206,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.Vehicle.DurationLimit route_duration_limit = 21; */ - private $route_duration_limit = null; + protected $route_duration_limit = null; /** * Limit applied to the travel duration of the vehicle's route. In a given * `OptimizeToursResponse`, the route travel duration is the sum of all its @@ -214,7 +214,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; */ - private $travel_duration_limit = null; + protected $travel_duration_limit = null; /** * Limit applied to the total distance of the vehicle's route. In a given * `OptimizeToursResponse`, the route distance is the sum of all its @@ -222,7 +222,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.DistanceLimit route_distance_limit = 23; */ - private $route_distance_limit = null; + protected $route_distance_limit = null; /** * Specifies a map from visit_types strings to durations. The duration is time * in addition to @@ -242,7 +242,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.optimization.v1.BreakRule break_rule = 25; */ - private $break_rule = null; + protected $break_rule = null; /** * Specifies a label for this vehicle. This label is reported in the response * as the `vehicle_label` of the corresponding @@ -250,7 +250,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string label = 27; */ - private $label = ''; + protected $label = ''; /** * If true, `used_if_route_is_empty` must be false, and this vehicle will * remain unused. @@ -266,7 +266,7 @@ class Vehicle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool ignore = 28; */ - private $ignore = false; + protected $ignore = false; /** * Deprecated: No longer used. * Indices in the `break_rule` field in the source diff --git a/Optimization/src/V1/Vehicle/DurationLimit.php b/Optimization/src/V1/Vehicle/DurationLimit.php index 48855471aa7c..39073f5778a3 100644 --- a/Optimization/src/V1/Vehicle/DurationLimit.php +++ b/Optimization/src/V1/Vehicle/DurationLimit.php @@ -23,7 +23,7 @@ class DurationLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration max_duration = 1; */ - private $max_duration = null; + protected $max_duration = null; /** * A soft limit not enforcing a maximum duration limit, but when violated * makes the route incur a cost. This cost adds up to other costs defined in @@ -33,7 +33,7 @@ class DurationLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration soft_max_duration = 2; */ - private $soft_max_duration = null; + protected $soft_max_duration = null; /** * Cost per hour incurred if the `soft_max_duration` threshold is violated. * The additional cost is 0 if the duration is under the threshold, @@ -45,7 +45,7 @@ class DurationLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double cost_per_hour_after_soft_max = 3; */ - private $cost_per_hour_after_soft_max = null; + protected $cost_per_hour_after_soft_max = null; /** * A soft limit not enforcing a maximum duration limit, but when violated * makes the route incur a cost, quadratic in the duration. This cost adds @@ -58,7 +58,7 @@ class DurationLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration quadratic_soft_max_duration = 4; */ - private $quadratic_soft_max_duration = null; + protected $quadratic_soft_max_duration = null; /** * Cost per square hour incurred if the * `quadratic_soft_max_duration` threshold is violated. @@ -72,7 +72,7 @@ class DurationLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional double cost_per_square_hour_after_quadratic_soft_max = 5; */ - private $cost_per_square_hour_after_quadratic_soft_max = null; + protected $cost_per_square_hour_after_quadratic_soft_max = null; /** * Constructor. diff --git a/Optimization/src/V1/Vehicle/LoadLimit.php b/Optimization/src/V1/Vehicle/LoadLimit.php index 3b0c60192d79..689c39958ffb 100644 --- a/Optimization/src/V1/Vehicle/LoadLimit.php +++ b/Optimization/src/V1/Vehicle/LoadLimit.php @@ -22,14 +22,14 @@ class LoadLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int64 max_load = 1; */ - private $max_load = null; + protected $max_load = null; /** * A soft limit of the load. See * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. * * Generated from protobuf field int64 soft_max_load = 2; */ - private $soft_max_load = 0; + protected $soft_max_load = 0; /** * If the load ever exceeds * [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load] @@ -42,19 +42,19 @@ class LoadLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double cost_per_unit_above_soft_max = 3; */ - private $cost_per_unit_above_soft_max = 0.0; + protected $cost_per_unit_above_soft_max = 0.0; /** * The acceptable load interval of the vehicle at the start of the route. * * Generated from protobuf field .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; */ - private $start_load_interval = null; + protected $start_load_interval = null; /** * The acceptable load interval of the vehicle at the end of the route. * * Generated from protobuf field .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; */ - private $end_load_interval = null; + protected $end_load_interval = null; /** * Constructor. diff --git a/Optimization/src/V1/Vehicle/LoadLimit/Interval.php b/Optimization/src/V1/Vehicle/LoadLimit/Interval.php index 087a0c1b9842..68ade4c77afe 100644 --- a/Optimization/src/V1/Vehicle/LoadLimit/Interval.php +++ b/Optimization/src/V1/Vehicle/LoadLimit/Interval.php @@ -24,7 +24,7 @@ class Interval extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 min = 1; */ - private $min = 0; + protected $min = 0; /** * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum * load is unrestricted by this message. @@ -35,7 +35,7 @@ class Interval extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int64 max = 2; */ - private $max = null; + protected $max = null; /** * Constructor. diff --git a/Optimization/src/V1/Waypoint.php b/Optimization/src/V1/Waypoint.php index 40df3e8a163d..3c51fbabc2fe 100644 --- a/Optimization/src/V1/Waypoint.php +++ b/Optimization/src/V1/Waypoint.php @@ -26,7 +26,7 @@ class Waypoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool side_of_road = 3; */ - private $side_of_road = false; + protected $side_of_road = false; protected $location_type; /** diff --git a/Optimization/tests/Unit/V1/Client/FleetRoutingClientTest.php b/Optimization/tests/Unit/V1/Client/FleetRoutingClientTest.php index 1b87ad9a0077..049de54e9641 100644 --- a/Optimization/tests/Unit/V1/Client/FleetRoutingClientTest.php +++ b/Optimization/tests/Unit/V1/Client/FleetRoutingClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return FleetRoutingClient */ @@ -98,9 +100,7 @@ public function batchOptimizeToursTest() // Mock request $parent = 'parent-995424086'; $modelConfigs = []; - $request = (new BatchOptimizeToursRequest()) - ->setParent($parent) - ->setModelConfigs($modelConfigs); + $request = (new BatchOptimizeToursRequest())->setParent($parent)->setModelConfigs($modelConfigs); $response = $gapicClient->batchOptimizeTours($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -158,19 +158,20 @@ public function batchOptimizeToursExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $parent = 'parent-995424086'; $modelConfigs = []; - $request = (new BatchOptimizeToursRequest()) - ->setParent($parent) - ->setModelConfigs($modelConfigs); + $request = (new BatchOptimizeToursRequest())->setParent($parent)->setModelConfigs($modelConfigs); $response = $gapicClient->batchOptimizeTours($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -203,15 +204,14 @@ public function optimizeToursTest() $this->assertTrue($transport->isExhausted()); // Mock response $requestLabel = 'requestLabel1739091268'; - $totalCost = -7.0589032E7; + $totalCost = -7.0589032e7; $expectedResponse = new OptimizeToursResponse(); $expectedResponse->setRequestLabel($requestLabel); $expectedResponse->setTotalCost($totalCost); $transport->addResponse($expectedResponse); // Mock request $parent = 'parent-995424086'; - $request = (new OptimizeToursRequest()) - ->setParent($parent); + $request = (new OptimizeToursRequest())->setParent($parent); $response = $gapicClient->optimizeTours($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -235,17 +235,19 @@ public function optimizeToursExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $parent = 'parent-995424086'; - $request = (new OptimizeToursRequest()) - ->setParent($parent); + $request = (new OptimizeToursRequest())->setParent($parent); try { $gapicClient->optimizeTours($request); // If the $gapicClient method call did not throw, fail the test @@ -291,9 +293,7 @@ public function batchOptimizeToursAsyncTest() // Mock request $parent = 'parent-995424086'; $modelConfigs = []; - $request = (new BatchOptimizeToursRequest()) - ->setParent($parent) - ->setModelConfigs($modelConfigs); + $request = (new BatchOptimizeToursRequest())->setParent($parent)->setModelConfigs($modelConfigs); $response = $gapicClient->batchOptimizeToursAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/Optimization/tests/Unit/V1/FleetRoutingClientTest.php b/Optimization/tests/Unit/V1/FleetRoutingClientTest.php deleted file mode 100644 index 5afac3e60e43..000000000000 --- a/Optimization/tests/Unit/V1/FleetRoutingClientTest.php +++ /dev/null @@ -1,249 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FleetRoutingClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FleetRoutingClient($options); - } - - /** @test */ - public function batchOptimizeToursTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchOptimizeToursTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchOptimizeToursResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchOptimizeToursTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $modelConfigs = []; - $response = $gapicClient->batchOptimizeTours($parent, $modelConfigs); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.optimization.v1.FleetRouting/BatchOptimizeTours', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualApiRequestObject->getModelConfigs(); - $this->assertProtobufEquals($modelConfigs, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchOptimizeToursTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchOptimizeToursExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchOptimizeToursTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $modelConfigs = []; - $response = $gapicClient->batchOptimizeTours($parent, $modelConfigs); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchOptimizeToursTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function optimizeToursTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $requestLabel = 'requestLabel1739091268'; - $totalCost = -7.0589032E7; - $expectedResponse = new OptimizeToursResponse(); - $expectedResponse->setRequestLabel($requestLabel); - $expectedResponse->setTotalCost($totalCost); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->optimizeTours($parent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.optimization.v1.FleetRouting/OptimizeTours', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function optimizeToursExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - try { - $gapicClient->optimizeTours($parent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/OrchestrationAirflow/.repo-metadata.json b/OrchestrationAirflow/.repo-metadata.json deleted file mode 100644 index 13389804889f..000000000000 --- a/OrchestrationAirflow/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-orchestration-airflow", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-orchestration-airflow/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "composer" -} diff --git a/OrchestrationAirflow/VERSION b/OrchestrationAirflow/VERSION index fdd3be6df54a..9edc58bb1dd8 100644 --- a/OrchestrationAirflow/VERSION +++ b/OrchestrationAirflow/VERSION @@ -1 +1 @@ -1.6.2 +1.6.4 diff --git a/OrchestrationAirflow/composer.json b/OrchestrationAirflow/composer.json index 7282b746c2c3..8528c685501f 100644 --- a/OrchestrationAirflow/composer.json +++ b/OrchestrationAirflow/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/OrgPolicy/.repo-metadata.json b/OrgPolicy/.repo-metadata.json deleted file mode 100644 index 733836bd6abd..000000000000 --- a/OrgPolicy/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-org-policy", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-org-policy/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "orgpolicy" -} diff --git a/OrgPolicy/README.md b/OrgPolicy/README.md index 75a350e42cc3..c5642d44ebb5 100644 --- a/OrgPolicy/README.md +++ b/OrgPolicy/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/OrgPolicy/VERSION b/OrgPolicy/VERSION index 844f6a91acb9..ef5e4454454d 100644 --- a/OrgPolicy/VERSION +++ b/OrgPolicy/VERSION @@ -1 +1 @@ -0.6.3 +0.6.5 diff --git a/OrgPolicy/composer.json b/OrgPolicy/composer.json index 0b8f1e4f7e4e..797a67139443 100644 --- a/OrgPolicy/composer.json +++ b/OrgPolicy/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/OrgPolicy/owlbot.py b/OrgPolicy/owlbot.py index 4e1387f272bf..0329697d7623 100644 --- a/OrgPolicy/owlbot.py +++ b/OrgPolicy/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,34 +32,25 @@ php.owlbot_main(src=src, dest=dest) -# Change the wording for the deprecation warning. +# remove class_alias code s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/OrgPolicy/src/V2/AlternatePolicySpec.php b/OrgPolicy/src/V2/AlternatePolicySpec.php index 5227cb9b89c0..4d3a507f2019 100644 --- a/OrgPolicy/src/V2/AlternatePolicySpec.php +++ b/OrgPolicy/src/V2/AlternatePolicySpec.php @@ -23,13 +23,13 @@ class AlternatePolicySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string launch = 1; */ - private $launch = ''; + protected $launch = ''; /** * Specify constraint for configurations of Google Cloud resources. * * Generated from protobuf field .google.cloud.orgpolicy.v2.PolicySpec spec = 2; */ - private $spec = null; + protected $spec = null; /** * Constructor. diff --git a/OrgPolicy/src/V2/Client/OrgPolicyClient.php b/OrgPolicy/src/V2/Client/OrgPolicyClient.php index deaaa4b807be..ddbf9810e36b 100644 --- a/OrgPolicy/src/V2/Client/OrgPolicyClient.php +++ b/OrgPolicy/src/V2/Client/OrgPolicyClient.php @@ -1,6 +1,6 @@ startApiCall('CreateCustomConstraint', $request, $callOptions)->wait(); } @@ -626,8 +626,10 @@ public function listConstraints(ListConstraintsRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function listCustomConstraints(ListCustomConstraintsRequest $request, array $callOptions = []): PagedListResponse - { + public function listCustomConstraints( + ListCustomConstraintsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListCustomConstraints', $request, $callOptions); } @@ -684,8 +686,10 @@ public function listPolicies(ListPoliciesRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function updateCustomConstraint(UpdateCustomConstraintRequest $request, array $callOptions = []): CustomConstraint - { + public function updateCustomConstraint( + UpdateCustomConstraintRequest $request, + array $callOptions = [] + ): CustomConstraint { return $this->startApiCall('UpdateCustomConstraint', $request, $callOptions)->wait(); } diff --git a/OrgPolicy/src/V2/Constraint.php b/OrgPolicy/src/V2/Constraint.php index 33b1cbd2787f..4b0d15284a17 100644 --- a/OrgPolicy/src/V2/Constraint.php +++ b/OrgPolicy/src/V2/Constraint.php @@ -37,14 +37,14 @@ class Constraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * The human readable name. * Mutable. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * Detailed description of what this constraint controls as well as how and * where it is enforced. @@ -52,19 +52,19 @@ class Constraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * The evaluation behavior of this constraint in the absence of a policy. * * Generated from protobuf field .google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4; */ - private $constraint_default = 0; + protected $constraint_default = 0; /** * Shows if dry run is supported for this constraint or not. * * Generated from protobuf field bool supports_dry_run = 7; */ - private $supports_dry_run = false; + protected $supports_dry_run = false; protected $constraint_type; /** diff --git a/OrgPolicy/src/V2/Constraint/BooleanConstraint.php b/OrgPolicy/src/V2/Constraint/BooleanConstraint.php index 0302a06ca9cf..0880368ce56b 100644 --- a/OrgPolicy/src/V2/Constraint/BooleanConstraint.php +++ b/OrgPolicy/src/V2/Constraint/BooleanConstraint.php @@ -34,6 +34,4 @@ public function __construct($data = NULL) { } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BooleanConstraint::class, \Google\Cloud\OrgPolicy\V2\Constraint_BooleanConstraint::class); diff --git a/OrgPolicy/src/V2/Constraint/ConstraintDefault.php b/OrgPolicy/src/V2/Constraint/ConstraintDefault.php index b7eaebc4f0ca..62145f84b9a4 100644 --- a/OrgPolicy/src/V2/Constraint/ConstraintDefault.php +++ b/OrgPolicy/src/V2/Constraint/ConstraintDefault.php @@ -64,6 +64,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConstraintDefault::class, \Google\Cloud\OrgPolicy\V2\Constraint_ConstraintDefault::class); diff --git a/OrgPolicy/src/V2/Constraint/ListConstraint.php b/OrgPolicy/src/V2/Constraint/ListConstraint.php index 6dbf89baae3a..f62192e1809c 100644 --- a/OrgPolicy/src/V2/Constraint/ListConstraint.php +++ b/OrgPolicy/src/V2/Constraint/ListConstraint.php @@ -23,7 +23,7 @@ class ListConstraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool supports_in = 1; */ - private $supports_in = false; + protected $supports_in = false; /** * Indicates whether subtrees of the Resource Manager resource hierarchy * can be used in `Policy.allowed_values` and `Policy.denied_values`. For @@ -32,7 +32,7 @@ class ListConstraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool supports_under = 2; */ - private $supports_under = false; + protected $supports_under = false; /** * Constructor. @@ -120,6 +120,4 @@ public function setSupportsUnder($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ListConstraint::class, \Google\Cloud\OrgPolicy\V2\Constraint_ListConstraint::class); diff --git a/OrgPolicy/src/V2/Constraint_BooleanConstraint.php b/OrgPolicy/src/V2/Constraint_BooleanConstraint.php deleted file mode 100644 index b4579aae90e8..000000000000 --- a/OrgPolicy/src/V2/Constraint_BooleanConstraint.php +++ /dev/null @@ -1,16 +0,0 @@ -string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Custom constraint to create. * * Generated from protobuf field .google.cloud.orgpolicy.v2.CustomConstraint custom_constraint = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $custom_constraint = null; + protected $custom_constraint = null; /** * @param string $parent Required. Must be in the following form: diff --git a/OrgPolicy/src/V2/CreatePolicyRequest.php b/OrgPolicy/src/V2/CreatePolicyRequest.php index b46cb1334ac9..adbbed633510 100644 --- a/OrgPolicy/src/V2/CreatePolicyRequest.php +++ b/OrgPolicy/src/V2/CreatePolicyRequest.php @@ -26,13 +26,13 @@ class CreatePolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Policy to create. * * Generated from protobuf field .google.cloud.orgpolicy.v2.Policy policy = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $policy = null; + protected $policy = null; /** * @param string $parent Required. The Google Cloud resource that will parent the new policy. Must diff --git a/OrgPolicy/src/V2/CustomConstraint.php b/OrgPolicy/src/V2/CustomConstraint.php index 3a0f553e0255..db6db0d97896 100644 --- a/OrgPolicy/src/V2/CustomConstraint.php +++ b/OrgPolicy/src/V2/CustomConstraint.php @@ -29,7 +29,7 @@ class CustomConstraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Immutable. The resource instance type on which this policy applies. Format * will be of the form : `/` Example: @@ -52,27 +52,27 @@ class CustomConstraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string condition = 4; */ - private $condition = ''; + protected $condition = ''; /** * Allow or deny type. * * Generated from protobuf field .google.cloud.orgpolicy.v2.CustomConstraint.ActionType action_type = 5; */ - private $action_type = 0; + protected $action_type = 0; /** * One line display name for the UI. * The max length of the display_name is 200 characters. * * Generated from protobuf field string display_name = 6; */ - private $display_name = ''; + protected $display_name = ''; /** * Detailed information about this custom policy constraint. * The max length of the description is 2000 characters. * * Generated from protobuf field string description = 7; */ - private $description = ''; + protected $description = ''; /** * Output only. The last time this custom constraint was updated. This * represents the last time that the `CreateCustomConstraint` or @@ -80,7 +80,7 @@ class CustomConstraint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/OrgPolicy/src/V2/CustomConstraint/ActionType.php b/OrgPolicy/src/V2/CustomConstraint/ActionType.php index b86b75e0c8ae..bc8d3ec933ae 100644 --- a/OrgPolicy/src/V2/CustomConstraint/ActionType.php +++ b/OrgPolicy/src/V2/CustomConstraint/ActionType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ActionType::class, \Google\Cloud\OrgPolicy\V2\CustomConstraint_ActionType::class); diff --git a/OrgPolicy/src/V2/CustomConstraint/MethodType.php b/OrgPolicy/src/V2/CustomConstraint/MethodType.php index d883a15addef..6beff87de3f4 100644 --- a/OrgPolicy/src/V2/CustomConstraint/MethodType.php +++ b/OrgPolicy/src/V2/CustomConstraint/MethodType.php @@ -72,6 +72,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MethodType::class, \Google\Cloud\OrgPolicy\V2\CustomConstraint_MethodType::class); diff --git a/OrgPolicy/src/V2/DeleteCustomConstraintRequest.php b/OrgPolicy/src/V2/DeleteCustomConstraintRequest.php index 07cac66d8902..76d93c9521c7 100644 --- a/OrgPolicy/src/V2/DeleteCustomConstraintRequest.php +++ b/OrgPolicy/src/V2/DeleteCustomConstraintRequest.php @@ -22,7 +22,7 @@ class DeleteCustomConstraintRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Name of the custom constraint to delete. diff --git a/OrgPolicy/src/V2/DeletePolicyRequest.php b/OrgPolicy/src/V2/DeletePolicyRequest.php index 21935d79c91c..05b6ac45c430 100644 --- a/OrgPolicy/src/V2/DeletePolicyRequest.php +++ b/OrgPolicy/src/V2/DeletePolicyRequest.php @@ -22,7 +22,7 @@ class DeletePolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The current etag of policy. If an etag is provided and does not * match the current etag of the policy, deletion will be blocked and an @@ -30,7 +30,7 @@ class DeletePolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. Name of the policy to delete. diff --git a/OrgPolicy/src/V2/Gapic/OrgPolicyGapicClient.php b/OrgPolicy/src/V2/Gapic/OrgPolicyGapicClient.php deleted file mode 100644 index 90e2ccb01335..000000000000 --- a/OrgPolicy/src/V2/Gapic/OrgPolicyGapicClient.php +++ /dev/null @@ -1,1137 +0,0 @@ -organizationName('[ORGANIZATION]'); - * $customConstraint = new CustomConstraint(); - * $response = $orgPolicyClient->createCustomConstraint($formattedParent, $customConstraint); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\OrgPolicy\V2\Client\OrgPolicyClient}. - */ -class OrgPolicyGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.orgpolicy.v2.OrgPolicy'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'orgpolicy.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'orgpolicy.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $customConstraintNameTemplate; - - private static $folderNameTemplate; - - private static $folderPolicyNameTemplate; - - private static $organizationNameTemplate; - - private static $organizationPolicyNameTemplate; - - private static $policyNameTemplate; - - private static $projectNameTemplate; - - private static $projectPolicyNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/org_policy_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/org_policy_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/org_policy_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/org_policy_rest_client_config.php', - ], - ], - ]; - } - - private static function getCustomConstraintNameTemplate() - { - if (self::$customConstraintNameTemplate == null) { - self::$customConstraintNameTemplate = new PathTemplate('organizations/{organization}/customConstraints/{custom_constraint}'); - } - - return self::$customConstraintNameTemplate; - } - - private static function getFolderNameTemplate() - { - if (self::$folderNameTemplate == null) { - self::$folderNameTemplate = new PathTemplate('folders/{folder}'); - } - - return self::$folderNameTemplate; - } - - private static function getFolderPolicyNameTemplate() - { - if (self::$folderPolicyNameTemplate == null) { - self::$folderPolicyNameTemplate = new PathTemplate('folders/{folder}/policies/{policy}'); - } - - return self::$folderPolicyNameTemplate; - } - - private static function getOrganizationNameTemplate() - { - if (self::$organizationNameTemplate == null) { - self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); - } - - return self::$organizationNameTemplate; - } - - private static function getOrganizationPolicyNameTemplate() - { - if (self::$organizationPolicyNameTemplate == null) { - self::$organizationPolicyNameTemplate = new PathTemplate('organizations/{organization}/policies/{policy}'); - } - - return self::$organizationPolicyNameTemplate; - } - - private static function getPolicyNameTemplate() - { - if (self::$policyNameTemplate == null) { - self::$policyNameTemplate = new PathTemplate('projects/{project}/policies/{policy}'); - } - - return self::$policyNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectPolicyNameTemplate() - { - if (self::$projectPolicyNameTemplate == null) { - self::$projectPolicyNameTemplate = new PathTemplate('projects/{project}/policies/{policy}'); - } - - return self::$projectPolicyNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'customConstraint' => self::getCustomConstraintNameTemplate(), - 'folder' => self::getFolderNameTemplate(), - 'folderPolicy' => self::getFolderPolicyNameTemplate(), - 'organization' => self::getOrganizationNameTemplate(), - 'organizationPolicy' => self::getOrganizationPolicyNameTemplate(), - 'policy' => self::getPolicyNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectPolicy' => self::getProjectPolicyNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * custom_constraint resource. - * - * @param string $organization - * @param string $customConstraint - * - * @return string The formatted custom_constraint resource. - */ - public static function customConstraintName($organization, $customConstraint) - { - return self::getCustomConstraintNameTemplate()->render([ - 'organization' => $organization, - 'custom_constraint' => $customConstraint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a folder - * resource. - * - * @param string $folder - * - * @return string The formatted folder resource. - */ - public static function folderName($folder) - { - return self::getFolderNameTemplate()->render([ - 'folder' => $folder, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_policy resource. - * - * @param string $folder - * @param string $policy - * - * @return string The formatted folder_policy resource. - */ - public static function folderPolicyName($folder, $policy) - { - return self::getFolderPolicyNameTemplate()->render([ - 'folder' => $folder, - 'policy' => $policy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a organization - * resource. - * - * @param string $organization - * - * @return string The formatted organization resource. - */ - public static function organizationName($organization) - { - return self::getOrganizationNameTemplate()->render([ - 'organization' => $organization, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_policy resource. - * - * @param string $organization - * @param string $policy - * - * @return string The formatted organization_policy resource. - */ - public static function organizationPolicyName($organization, $policy) - { - return self::getOrganizationPolicyNameTemplate()->render([ - 'organization' => $organization, - 'policy' => $policy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a policy - * resource. - * - * @param string $project - * @param string $policy - * - * @return string The formatted policy resource. - */ - public static function policyName($project, $policy) - { - return self::getPolicyNameTemplate()->render([ - 'project' => $project, - 'policy' => $policy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_policy resource. - * - * @param string $project - * @param string $policy - * - * @return string The formatted project_policy resource. - */ - public static function projectPolicyName($project, $policy) - { - return self::getProjectPolicyNameTemplate()->render([ - 'project' => $project, - 'policy' => $policy, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - customConstraint: organizations/{organization}/customConstraints/{custom_constraint} - * - folder: folders/{folder} - * - folderPolicy: folders/{folder}/policies/{policy} - * - organization: organizations/{organization} - * - organizationPolicy: organizations/{organization}/policies/{policy} - * - policy: projects/{project}/policies/{policy} - * - project: projects/{project} - * - projectPolicy: projects/{project}/policies/{policy} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'orgpolicy.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a custom constraint. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * organization does not exist. - * Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the - * constraint already exists on the given organization. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedParent = $orgPolicyClient->organizationName('[ORGANIZATION]'); - * $customConstraint = new CustomConstraint(); - * $response = $orgPolicyClient->createCustomConstraint($formattedParent, $customConstraint); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $parent Required. Must be in the following form: - * - * * `organizations/{organization_id}` - * @param CustomConstraint $customConstraint Required. Custom constraint to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\OrgPolicy\V2\CustomConstraint - * - * @throws ApiException if the remote call fails - */ - public function createCustomConstraint($parent, $customConstraint, array $optionalArgs = []) - { - $request = new CreateCustomConstraintRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCustomConstraint($customConstraint); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateCustomConstraint', CustomConstraint::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a policy. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * constraint does not exist. - * Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the - * policy already exists on the given Google Cloud resource. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedParent = $orgPolicyClient->projectName('[PROJECT]'); - * $policy = new Policy(); - * $response = $orgPolicyClient->createPolicy($formattedParent, $policy); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $parent Required. The Google Cloud resource that will parent the new policy. Must - * be in one of the following forms: - * - * * `projects/{project_number}` - * * `projects/{project_id}` - * * `folders/{folder_id}` - * * `organizations/{organization_id}` - * @param Policy $policy Required. Policy to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\OrgPolicy\V2\Policy - * - * @throws ApiException if the remote call fails - */ - public function createPolicy($parent, $policy, array $optionalArgs = []) - { - $request = new CreatePolicyRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPolicy($policy); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreatePolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a custom constraint. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * constraint does not exist. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedName = $orgPolicyClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - * $orgPolicyClient->deleteCustomConstraint($formattedName); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the custom constraint to delete. - * See the custom constraint entry for naming rules. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteCustomConstraint($name, array $optionalArgs = []) - { - $request = new DeleteCustomConstraintRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteCustomConstraint', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a policy. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * constraint or organization policy does not exist. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedName = $orgPolicyClient->policyName('[PROJECT]', '[POLICY]'); - * $orgPolicyClient->deletePolicy($formattedName); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the policy to delete. - * See the policy entry for naming rules. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. The current etag of policy. If an etag is provided and does not - * match the current etag of the policy, deletion will be blocked and an - * ABORTED error will be returned. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deletePolicy($name, array $optionalArgs = []) - { - $request = new DeletePolicyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeletePolicy', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a custom constraint. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * custom constraint does not exist. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedName = $orgPolicyClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - * $response = $orgPolicyClient->getCustomConstraint($formattedName); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the custom constraint. See the custom constraint - * entry for naming requirements. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\OrgPolicy\V2\CustomConstraint - * - * @throws ApiException if the remote call fails - */ - public function getCustomConstraint($name, array $optionalArgs = []) - { - $request = new GetCustomConstraintRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetCustomConstraint', CustomConstraint::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the effective policy on a resource. This is the result of merging - * policies in the resource hierarchy and evaluating conditions. The - * returned policy will not have an `etag` or `condition` set because it is - * an evaluated policy across multiple resources. - * Subtrees of Resource Manager resource hierarchy with 'under:' prefix will - * not be expanded. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedName = $orgPolicyClient->policyName('[PROJECT]', '[POLICY]'); - * $response = $orgPolicyClient->getEffectivePolicy($formattedName); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $name Required. The effective policy to compute. See - * [Policy][google.cloud.orgpolicy.v2.Policy] for naming requirements. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\OrgPolicy\V2\Policy - * - * @throws ApiException if the remote call fails - */ - public function getEffectivePolicy($name, array $optionalArgs = []) - { - $request = new GetEffectivePolicyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetEffectivePolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a policy on a resource. - * - * If no policy is set on the resource, `NOT_FOUND` is returned. The - * `etag` value can be used with `UpdatePolicy()` to update a - * policy during read-modify-write. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedName = $orgPolicyClient->policyName('[PROJECT]', '[POLICY]'); - * $response = $orgPolicyClient->getPolicy($formattedName); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the policy. See - * [Policy][google.cloud.orgpolicy.v2.Policy] for naming requirements. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\OrgPolicy\V2\Policy - * - * @throws ApiException if the remote call fails - */ - public function getPolicy($name, array $optionalArgs = []) - { - $request = new GetPolicyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists constraints that could be applied on the specified resource. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedParent = $orgPolicyClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $orgPolicyClient->listConstraints($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $orgPolicyClient->listConstraints($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $parent Required. The Google Cloud resource that parents the constraint. Must be in - * one of the following forms: - * - * * `projects/{project_number}` - * * `projects/{project_id}` - * * `folders/{folder_id}` - * * `organizations/{organization_id}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listConstraints($parent, array $optionalArgs = []) - { - $request = new ListConstraintsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListConstraints', $optionalArgs, ListConstraintsResponse::class, $request); - } - - /** - * Retrieves all of the custom constraints that exist on a particular - * organization resource. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedParent = $orgPolicyClient->organizationName('[ORGANIZATION]'); - * // Iterate over pages of elements - * $pagedResponse = $orgPolicyClient->listCustomConstraints($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $orgPolicyClient->listCustomConstraints($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $parent Required. The target Google Cloud resource that parents the set of custom - * constraints that will be returned from this call. Must be in one of the - * following forms: - * - * * `organizations/{organization_id}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listCustomConstraints($parent, array $optionalArgs = []) - { - $request = new ListCustomConstraintsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListCustomConstraints', $optionalArgs, ListCustomConstraintsResponse::class, $request); - } - - /** - * Retrieves all of the policies that exist on a particular resource. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $formattedParent = $orgPolicyClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $orgPolicyClient->listPolicies($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $orgPolicyClient->listPolicies($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param string $parent Required. The target Google Cloud resource that parents the set of - * constraints and policies that will be returned from this call. Must be in - * one of the following forms: - * - * * `projects/{project_number}` - * * `projects/{project_id}` - * * `folders/{folder_id}` - * * `organizations/{organization_id}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listPolicies($parent, array $optionalArgs = []) - { - $request = new ListPoliciesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListPolicies', $optionalArgs, ListPoliciesResponse::class, $request); - } - - /** - * Updates a custom constraint. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * constraint does not exist. - * - * Note: the supplied policy will perform a full overwrite of all - * fields. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $customConstraint = new CustomConstraint(); - * $response = $orgPolicyClient->updateCustomConstraint($customConstraint); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param CustomConstraint $customConstraint Required. `CustomConstraint` to update. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\OrgPolicy\V2\CustomConstraint - * - * @throws ApiException if the remote call fails - */ - public function updateCustomConstraint($customConstraint, array $optionalArgs = []) - { - $request = new UpdateCustomConstraintRequest(); - $requestParamHeaders = []; - $request->setCustomConstraint($customConstraint); - $requestParamHeaders['custom_constraint.name'] = $customConstraint->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateCustomConstraint', CustomConstraint::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a policy. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * constraint or the policy do not exist. - * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag - * supplied in the request does not match the persisted etag of the policy - * - * Note: the supplied policy will perform a full overwrite of all - * fields. - * - * Sample code: - * ``` - * $orgPolicyClient = new OrgPolicyClient(); - * try { - * $policy = new Policy(); - * $response = $orgPolicyClient->updatePolicy($policy); - * } finally { - * $orgPolicyClient->close(); - * } - * ``` - * - * @param Policy $policy Required. Policy to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask used to specify the fields to be overwritten in the policy - * by the set. The fields specified in the update_mask are relative to the - * policy, not the full request. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\OrgPolicy\V2\Policy - * - * @throws ApiException if the remote call fails - */ - public function updatePolicy($policy, array $optionalArgs = []) - { - $request = new UpdatePolicyRequest(); - $requestParamHeaders = []; - $request->setPolicy($policy); - $requestParamHeaders['policy.name'] = $policy->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdatePolicy', Policy::class, $optionalArgs, $request)->wait(); - } -} diff --git a/OrgPolicy/src/V2/GetCustomConstraintRequest.php b/OrgPolicy/src/V2/GetCustomConstraintRequest.php index 0bca05fde5ee..f169a5d51f9c 100644 --- a/OrgPolicy/src/V2/GetCustomConstraintRequest.php +++ b/OrgPolicy/src/V2/GetCustomConstraintRequest.php @@ -22,7 +22,7 @@ class GetCustomConstraintRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Resource name of the custom constraint. See the custom constraint diff --git a/OrgPolicy/src/V2/GetEffectivePolicyRequest.php b/OrgPolicy/src/V2/GetEffectivePolicyRequest.php index 21446fbad6d3..338899f8a5e9 100644 --- a/OrgPolicy/src/V2/GetEffectivePolicyRequest.php +++ b/OrgPolicy/src/V2/GetEffectivePolicyRequest.php @@ -22,7 +22,7 @@ class GetEffectivePolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The effective policy to compute. See diff --git a/OrgPolicy/src/V2/GetPolicyRequest.php b/OrgPolicy/src/V2/GetPolicyRequest.php index 8f6d1c586b14..f48f61f6804a 100644 --- a/OrgPolicy/src/V2/GetPolicyRequest.php +++ b/OrgPolicy/src/V2/GetPolicyRequest.php @@ -22,7 +22,7 @@ class GetPolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. Resource name of the policy. See diff --git a/OrgPolicy/src/V2/ListConstraintsRequest.php b/OrgPolicy/src/V2/ListConstraintsRequest.php index 63676bb7b47e..f0f09385397f 100644 --- a/OrgPolicy/src/V2/ListConstraintsRequest.php +++ b/OrgPolicy/src/V2/ListConstraintsRequest.php @@ -26,7 +26,7 @@ class ListConstraintsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Size of the pages to be returned. This is currently unsupported and will * be ignored. The server may at any point start using this field to limit @@ -34,14 +34,14 @@ class ListConstraintsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page token used to retrieve the next page. This is currently unsupported * and will be ignored. The server may at any point start using this field. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The Google Cloud resource that parents the constraint. Must be in diff --git a/OrgPolicy/src/V2/ListConstraintsResponse.php b/OrgPolicy/src/V2/ListConstraintsResponse.php index 922531138951..26bd82b66fd3 100644 --- a/OrgPolicy/src/V2/ListConstraintsResponse.php +++ b/OrgPolicy/src/V2/ListConstraintsResponse.php @@ -27,7 +27,7 @@ class ListConstraintsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/OrgPolicy/src/V2/ListCustomConstraintsRequest.php b/OrgPolicy/src/V2/ListCustomConstraintsRequest.php index 21cbafbb0466..b04e17ab5b9c 100644 --- a/OrgPolicy/src/V2/ListCustomConstraintsRequest.php +++ b/OrgPolicy/src/V2/ListCustomConstraintsRequest.php @@ -24,7 +24,7 @@ class ListCustomConstraintsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Size of the pages to be returned. This is currently unsupported and will * be ignored. The server may at any point start using this field to limit @@ -32,14 +32,14 @@ class ListCustomConstraintsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page token used to retrieve the next page. This is currently unsupported * and will be ignored. The server may at any point start using this field. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The target Google Cloud resource that parents the set of custom diff --git a/OrgPolicy/src/V2/ListCustomConstraintsResponse.php b/OrgPolicy/src/V2/ListCustomConstraintsResponse.php index e4e5b2d94a76..98b10425eb16 100644 --- a/OrgPolicy/src/V2/ListCustomConstraintsResponse.php +++ b/OrgPolicy/src/V2/ListCustomConstraintsResponse.php @@ -30,7 +30,7 @@ class ListCustomConstraintsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/OrgPolicy/src/V2/ListPoliciesRequest.php b/OrgPolicy/src/V2/ListPoliciesRequest.php index cf79e64a6237..a604c24236bb 100644 --- a/OrgPolicy/src/V2/ListPoliciesRequest.php +++ b/OrgPolicy/src/V2/ListPoliciesRequest.php @@ -27,7 +27,7 @@ class ListPoliciesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Size of the pages to be returned. This is currently unsupported and will * be ignored. The server may at any point start using this field to limit @@ -35,14 +35,14 @@ class ListPoliciesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page token used to retrieve the next page. This is currently unsupported * and will be ignored. The server may at any point start using this field. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The target Google Cloud resource that parents the set of diff --git a/OrgPolicy/src/V2/ListPoliciesResponse.php b/OrgPolicy/src/V2/ListPoliciesResponse.php index 7816e854e44a..d60a6f2158e1 100644 --- a/OrgPolicy/src/V2/ListPoliciesResponse.php +++ b/OrgPolicy/src/V2/ListPoliciesResponse.php @@ -30,7 +30,7 @@ class ListPoliciesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/OrgPolicy/src/V2/OrgPolicyClient.php b/OrgPolicy/src/V2/OrgPolicyClient.php deleted file mode 100644 index 8145ac29b639..000000000000 --- a/OrgPolicy/src/V2/OrgPolicyClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.orgpolicy.v2.OrgPolicy/ListConstraints', - $argument, - ['\Google\Cloud\OrgPolicy\V2\ListConstraintsResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves all of the `Policies` that exist on a particular resource. - * @param \Google\Cloud\OrgPolicy\V2\ListPoliciesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPolicies(\Google\Cloud\OrgPolicy\V2\ListPoliciesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.orgpolicy.v2.OrgPolicy/ListPolicies', - $argument, - ['\Google\Cloud\OrgPolicy\V2\ListPoliciesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a `Policy` on a resource. - * - * If no `Policy` is set on the resource, NOT_FOUND is returned. The - * `etag` value can be used with `UpdatePolicy()` to update a - * `Policy` during read-modify-write. - * @param \Google\Cloud\OrgPolicy\V2\GetPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetPolicy(\Google\Cloud\OrgPolicy\V2\GetPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.orgpolicy.v2.OrgPolicy/GetPolicy', - $argument, - ['\Google\Cloud\OrgPolicy\V2\Policy', 'decode'], - $metadata, $options); - } - - /** - * Gets the effective `Policy` on a resource. This is the result of merging - * `Policies` in the resource hierarchy and evaluating conditions. The - * returned `Policy` will not have an `etag` or `condition` set because it is - * a computed `Policy` across multiple resources. - * Subtrees of Resource Manager resource hierarchy with 'under:' prefix will - * not be expanded. - * @param \Google\Cloud\OrgPolicy\V2\GetEffectivePolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetEffectivePolicy(\Google\Cloud\OrgPolicy\V2\GetEffectivePolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.orgpolicy.v2.OrgPolicy/GetEffectivePolicy', - $argument, - ['\Google\Cloud\OrgPolicy\V2\Policy', 'decode'], - $metadata, $options); - } - - /** - * Creates a Policy. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * constraint does not exist. - * Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the - * policy already exists on the given Cloud resource. - * @param \Google\Cloud\OrgPolicy\V2\CreatePolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreatePolicy(\Google\Cloud\OrgPolicy\V2\CreatePolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.orgpolicy.v2.OrgPolicy/CreatePolicy', - $argument, - ['\Google\Cloud\OrgPolicy\V2\Policy', 'decode'], - $metadata, $options); - } - - /** - * Updates a Policy. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * constraint or the policy do not exist. - * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag - * supplied in the request does not match the persisted etag of the policy - * - * Note: the supplied policy will perform a full overwrite of all - * fields. - * @param \Google\Cloud\OrgPolicy\V2\UpdatePolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdatePolicy(\Google\Cloud\OrgPolicy\V2\UpdatePolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.orgpolicy.v2.OrgPolicy/UpdatePolicy', - $argument, - ['\Google\Cloud\OrgPolicy\V2\Policy', 'decode'], - $metadata, $options); - } - - /** - * Deletes a Policy. - * - * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the - * constraint or Org Policy does not exist. - * @param \Google\Cloud\OrgPolicy\V2\DeletePolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeletePolicy(\Google\Cloud\OrgPolicy\V2\DeletePolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.orgpolicy.v2.OrgPolicy/DeletePolicy', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/OrgPolicy/src/V2/Policy.php b/OrgPolicy/src/V2/Policy.php index fab357ec11cc..804da4a74295 100644 --- a/OrgPolicy/src/V2/Policy.php +++ b/OrgPolicy/src/V2/Policy.php @@ -30,13 +30,13 @@ class Policy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Basic information about the Organization Policy. * * Generated from protobuf field .google.cloud.orgpolicy.v2.PolicySpec spec = 2; */ - private $spec = null; + protected $spec = null; /** * Deprecated. * @@ -51,7 +51,7 @@ class Policy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.orgpolicy.v2.PolicySpec dry_run_spec = 4; */ - private $dry_run_spec = null; + protected $dry_run_spec = null; /** * Optional. An opaque tag indicating the current state of the policy, used * for concurrency control. This 'etag' is computed by the server based on the @@ -60,7 +60,7 @@ class Policy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Constructor. diff --git a/OrgPolicy/src/V2/PolicySpec.php b/OrgPolicy/src/V2/PolicySpec.php index 2f98ec07aba0..88ddcb36ab79 100644 --- a/OrgPolicy/src/V2/PolicySpec.php +++ b/OrgPolicy/src/V2/PolicySpec.php @@ -28,7 +28,7 @@ class PolicySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 1; */ - private $etag = ''; + protected $etag = ''; /** * Output only. The time stamp this was previously updated. This * represents the last time a call to `CreatePolicy` or `UpdatePolicy` was @@ -36,7 +36,7 @@ class PolicySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * In policies for boolean constraints, the following requirements apply: * - There must be one and only one policy rule where condition is unset. @@ -58,7 +58,7 @@ class PolicySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool inherit_from_parent = 4; */ - private $inherit_from_parent = false; + protected $inherit_from_parent = false; /** * Ignores policies set above this resource and restores the * `constraint_default` enforcement behavior of the specific constraint at @@ -69,7 +69,7 @@ class PolicySpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool reset = 5; */ - private $reset = false; + protected $reset = false; /** * Constructor. diff --git a/OrgPolicy/src/V2/PolicySpec/PolicyRule.php b/OrgPolicy/src/V2/PolicySpec/PolicyRule.php index 0aaa59d7b13a..4d8fddc8c552 100644 --- a/OrgPolicy/src/V2/PolicySpec/PolicyRule.php +++ b/OrgPolicy/src/V2/PolicySpec/PolicyRule.php @@ -31,7 +31,7 @@ class PolicyRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.type.Expr condition = 5; */ - private $condition = null; + protected $condition = null; protected $kind; /** @@ -275,6 +275,4 @@ public function getKind() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PolicyRule::class, \Google\Cloud\OrgPolicy\V2\PolicySpec_PolicyRule::class); diff --git a/OrgPolicy/src/V2/PolicySpec/PolicyRule/StringValues.php b/OrgPolicy/src/V2/PolicySpec/PolicyRule/StringValues.php index 389de6430399..2640fcecd954 100644 --- a/OrgPolicy/src/V2/PolicySpec/PolicyRule/StringValues.php +++ b/OrgPolicy/src/V2/PolicySpec/PolicyRule/StringValues.php @@ -113,6 +113,4 @@ public function setDeniedValues($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StringValues::class, \Google\Cloud\OrgPolicy\V2\PolicySpec_PolicyRule_StringValues::class); diff --git a/OrgPolicy/src/V2/PolicySpec_PolicyRule.php b/OrgPolicy/src/V2/PolicySpec_PolicyRule.php deleted file mode 100644 index b5af57273b60..000000000000 --- a/OrgPolicy/src/V2/PolicySpec_PolicyRule.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.cloud.orgpolicy.v2.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $custom_constraint = null; + protected $custom_constraint = null; /** * @param \Google\Cloud\OrgPolicy\V2\CustomConstraint $customConstraint Required. `CustomConstraint` to update. diff --git a/OrgPolicy/src/V2/UpdatePolicyRequest.php b/OrgPolicy/src/V2/UpdatePolicyRequest.php index 9220cb532daf..0c67e5957f80 100644 --- a/OrgPolicy/src/V2/UpdatePolicyRequest.php +++ b/OrgPolicy/src/V2/UpdatePolicyRequest.php @@ -21,7 +21,7 @@ class UpdatePolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.orgpolicy.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $policy = null; + protected $policy = null; /** * Field mask used to specify the fields to be overwritten in the policy * by the set. The fields specified in the update_mask are relative to the @@ -29,7 +29,7 @@ class UpdatePolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\OrgPolicy\V2\Policy $policy Required. Policy to update. diff --git a/OrgPolicy/tests/Unit/V2/Client/OrgPolicyClientTest.php b/OrgPolicy/tests/Unit/V2/Client/OrgPolicyClientTest.php index 58468aadfe0d..f65371295daf 100644 --- a/OrgPolicy/tests/Unit/V2/Client/OrgPolicyClientTest.php +++ b/OrgPolicy/tests/Unit/V2/Client/OrgPolicyClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return OrgPolicyClient */ @@ -127,12 +129,15 @@ public function createCustomConstraintExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->organizationName('[ORGANIZATION]'); @@ -171,9 +176,7 @@ public function createPolicyTest() // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); $policy = new Policy(); - $request = (new CreatePolicyRequest()) - ->setParent($formattedParent) - ->setPolicy($policy); + $request = (new CreatePolicyRequest())->setParent($formattedParent)->setPolicy($policy); $response = $gapicClient->createPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -199,19 +202,20 @@ public function createPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); $policy = new Policy(); - $request = (new CreatePolicyRequest()) - ->setParent($formattedParent) - ->setPolicy($policy); + $request = (new CreatePolicyRequest())->setParent($formattedParent)->setPolicy($policy); try { $gapicClient->createPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -238,8 +242,7 @@ public function deleteCustomConstraintTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - $request = (new DeleteCustomConstraintRequest()) - ->setName($formattedName); + $request = (new DeleteCustomConstraintRequest())->setName($formattedName); $gapicClient->deleteCustomConstraint($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -262,17 +265,19 @@ public function deleteCustomConstraintExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - $request = (new DeleteCustomConstraintRequest()) - ->setName($formattedName); + $request = (new DeleteCustomConstraintRequest())->setName($formattedName); try { $gapicClient->deleteCustomConstraint($request); // If the $gapicClient method call did not throw, fail the test @@ -299,8 +304,7 @@ public function deletePolicyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - $request = (new DeletePolicyRequest()) - ->setName($formattedName); + $request = (new DeletePolicyRequest())->setName($formattedName); $gapicClient->deletePolicy($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -323,17 +327,19 @@ public function deletePolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - $request = (new DeletePolicyRequest()) - ->setName($formattedName); + $request = (new DeletePolicyRequest())->setName($formattedName); try { $gapicClient->deletePolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -368,8 +374,7 @@ public function getCustomConstraintTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - $request = (new GetCustomConstraintRequest()) - ->setName($formattedName); + $request = (new GetCustomConstraintRequest())->setName($formattedName); $response = $gapicClient->getCustomConstraint($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -393,17 +398,19 @@ public function getCustomConstraintExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - $request = (new GetCustomConstraintRequest()) - ->setName($formattedName); + $request = (new GetCustomConstraintRequest())->setName($formattedName); try { $gapicClient->getCustomConstraint($request); // If the $gapicClient method call did not throw, fail the test @@ -434,8 +441,7 @@ public function getEffectivePolicyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - $request = (new GetEffectivePolicyRequest()) - ->setName($formattedName); + $request = (new GetEffectivePolicyRequest())->setName($formattedName); $response = $gapicClient->getEffectivePolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -459,17 +465,19 @@ public function getEffectivePolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - $request = (new GetEffectivePolicyRequest()) - ->setName($formattedName); + $request = (new GetEffectivePolicyRequest())->setName($formattedName); try { $gapicClient->getEffectivePolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -500,8 +508,7 @@ public function getPolicyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - $request = (new GetPolicyRequest()) - ->setName($formattedName); + $request = (new GetPolicyRequest())->setName($formattedName); $response = $gapicClient->getPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -525,17 +532,19 @@ public function getPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - $request = (new GetPolicyRequest()) - ->setName($formattedName); + $request = (new GetPolicyRequest())->setName($formattedName); try { $gapicClient->getPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -560,17 +569,14 @@ public function listConstraintsTest() // Mock response $nextPageToken = ''; $constraintsElement = new Constraint(); - $constraints = [ - $constraintsElement, - ]; + $constraints = [$constraintsElement]; $expectedResponse = new ListConstraintsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setConstraints($constraints); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListConstraintsRequest()) - ->setParent($formattedParent); + $request = (new ListConstraintsRequest())->setParent($formattedParent); $response = $gapicClient->listConstraints($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -597,17 +603,19 @@ public function listConstraintsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListConstraintsRequest()) - ->setParent($formattedParent); + $request = (new ListConstraintsRequest())->setParent($formattedParent); try { $gapicClient->listConstraints($request); // If the $gapicClient method call did not throw, fail the test @@ -632,17 +640,14 @@ public function listCustomConstraintsTest() // Mock response $nextPageToken = ''; $customConstraintsElement = new CustomConstraint(); - $customConstraints = [ - $customConstraintsElement, - ]; + $customConstraints = [$customConstraintsElement]; $expectedResponse = new ListCustomConstraintsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCustomConstraints($customConstraints); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->organizationName('[ORGANIZATION]'); - $request = (new ListCustomConstraintsRequest()) - ->setParent($formattedParent); + $request = (new ListCustomConstraintsRequest())->setParent($formattedParent); $response = $gapicClient->listCustomConstraints($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -669,17 +674,19 @@ public function listCustomConstraintsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->organizationName('[ORGANIZATION]'); - $request = (new ListCustomConstraintsRequest()) - ->setParent($formattedParent); + $request = (new ListCustomConstraintsRequest())->setParent($formattedParent); try { $gapicClient->listCustomConstraints($request); // If the $gapicClient method call did not throw, fail the test @@ -704,17 +711,14 @@ public function listPoliciesTest() // Mock response $nextPageToken = ''; $policiesElement = new Policy(); - $policies = [ - $policiesElement, - ]; + $policies = [$policiesElement]; $expectedResponse = new ListPoliciesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setPolicies($policies); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListPoliciesRequest()) - ->setParent($formattedParent); + $request = (new ListPoliciesRequest())->setParent($formattedParent); $response = $gapicClient->listPolicies($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -741,17 +745,19 @@ public function listPoliciesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListPoliciesRequest()) - ->setParent($formattedParent); + $request = (new ListPoliciesRequest())->setParent($formattedParent); try { $gapicClient->listPolicies($request); // If the $gapicClient method call did not throw, fail the test @@ -786,8 +792,7 @@ public function updateCustomConstraintTest() $transport->addResponse($expectedResponse); // Mock request $customConstraint = new CustomConstraint(); - $request = (new UpdateCustomConstraintRequest()) - ->setCustomConstraint($customConstraint); + $request = (new UpdateCustomConstraintRequest())->setCustomConstraint($customConstraint); $response = $gapicClient->updateCustomConstraint($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -811,17 +816,19 @@ public function updateCustomConstraintExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $customConstraint = new CustomConstraint(); - $request = (new UpdateCustomConstraintRequest()) - ->setCustomConstraint($customConstraint); + $request = (new UpdateCustomConstraintRequest())->setCustomConstraint($customConstraint); try { $gapicClient->updateCustomConstraint($request); // If the $gapicClient method call did not throw, fail the test @@ -852,8 +859,7 @@ public function updatePolicyTest() $transport->addResponse($expectedResponse); // Mock request $policy = new Policy(); - $request = (new UpdatePolicyRequest()) - ->setPolicy($policy); + $request = (new UpdatePolicyRequest())->setPolicy($policy); $response = $gapicClient->updatePolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -877,17 +883,19 @@ public function updatePolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $policy = new Policy(); - $request = (new UpdatePolicyRequest()) - ->setPolicy($policy); + $request = (new UpdatePolicyRequest())->setPolicy($policy); try { $gapicClient->updatePolicy($request); // If the $gapicClient method call did not throw, fail the test diff --git a/OrgPolicy/tests/Unit/V2/OrgPolicyClientTest.php b/OrgPolicy/tests/Unit/V2/OrgPolicyClientTest.php deleted file mode 100644 index a730604e0fb7..000000000000 --- a/OrgPolicy/tests/Unit/V2/OrgPolicyClientTest.php +++ /dev/null @@ -1,839 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return OrgPolicyClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new OrgPolicyClient($options); - } - - /** @test */ - public function createCustomConstraintTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $condition = 'condition-861311717'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new CustomConstraint(); - $expectedResponse->setName($name); - $expectedResponse->setCondition($condition); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->organizationName('[ORGANIZATION]'); - $customConstraint = new CustomConstraint(); - $response = $gapicClient->createCustomConstraint($formattedParent, $customConstraint); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/CreateCustomConstraint', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCustomConstraint(); - $this->assertProtobufEquals($customConstraint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createCustomConstraintExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->organizationName('[ORGANIZATION]'); - $customConstraint = new CustomConstraint(); - try { - $gapicClient->createCustomConstraint($formattedParent, $customConstraint); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $policy = new Policy(); - $response = $gapicClient->createPolicy($formattedParent, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/CreatePolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $policy = new Policy(); - try { - $gapicClient->createPolicy($formattedParent, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteCustomConstraintTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - $gapicClient->deleteCustomConstraint($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/DeleteCustomConstraint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteCustomConstraintExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - try { - $gapicClient->deleteCustomConstraint($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deletePolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - $gapicClient->deletePolicy($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/DeletePolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deletePolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - try { - $gapicClient->deletePolicy($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCustomConstraintTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $condition = 'condition-861311717'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new CustomConstraint(); - $expectedResponse->setName($name2); - $expectedResponse->setCondition($condition); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - $response = $gapicClient->getCustomConstraint($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/GetCustomConstraint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCustomConstraintExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->customConstraintName('[ORGANIZATION]', '[CUSTOM_CONSTRAINT]'); - try { - $gapicClient->getCustomConstraint($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEffectivePolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - $response = $gapicClient->getEffectivePolicy($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/GetEffectivePolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEffectivePolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - try { - $gapicClient->getEffectivePolicy($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - $response = $gapicClient->getPolicy($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/GetPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]', '[POLICY]'); - try { - $gapicClient->getPolicy($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConstraintsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $constraintsElement = new Constraint(); - $constraints = [ - $constraintsElement, - ]; - $expectedResponse = new ListConstraintsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConstraints($constraints); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listConstraints($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getConstraints()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/ListConstraints', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConstraintsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listConstraints($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCustomConstraintsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $customConstraintsElement = new CustomConstraint(); - $customConstraints = [ - $customConstraintsElement, - ]; - $expectedResponse = new ListCustomConstraintsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCustomConstraints($customConstraints); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->organizationName('[ORGANIZATION]'); - $response = $gapicClient->listCustomConstraints($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCustomConstraints()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/ListCustomConstraints', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCustomConstraintsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->organizationName('[ORGANIZATION]'); - try { - $gapicClient->listCustomConstraints($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPoliciesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $policiesElement = new Policy(); - $policies = [ - $policiesElement, - ]; - $expectedResponse = new ListPoliciesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPolicies($policies); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listPolicies($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPolicies()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/ListPolicies', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPoliciesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listPolicies($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCustomConstraintTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $condition = 'condition-861311717'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new CustomConstraint(); - $expectedResponse->setName($name); - $expectedResponse->setCondition($condition); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $customConstraint = new CustomConstraint(); - $response = $gapicClient->updateCustomConstraint($customConstraint); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/UpdateCustomConstraint', $actualFuncCall); - $actualValue = $actualRequestObject->getCustomConstraint(); - $this->assertProtobufEquals($customConstraint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCustomConstraintExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $customConstraint = new CustomConstraint(); - try { - $gapicClient->updateCustomConstraint($customConstraint); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updatePolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $policy = new Policy(); - $response = $gapicClient->updatePolicy($policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.orgpolicy.v2.OrgPolicy/UpdatePolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updatePolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $policy = new Policy(); - try { - $gapicClient->updatePolicy($policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/OsConfig/.repo-metadata.json b/OsConfig/.repo-metadata.json deleted file mode 100644 index b84bcfb95566..000000000000 --- a/OsConfig/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-osconfig", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-osconfig/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "osconfig" -} diff --git a/OsConfig/VERSION b/OsConfig/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/OsConfig/VERSION +++ b/OsConfig/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/OsConfig/composer.json b/OsConfig/composer.json index 8d090e21ded7..e06427144cb3 100644 --- a/OsConfig/composer.json +++ b/OsConfig/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/OsLogin/.repo-metadata.json b/OsLogin/.repo-metadata.json deleted file mode 100644 index b5bf87ef52a0..000000000000 --- a/OsLogin/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-oslogin", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-oslogin/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "oslogin" -} diff --git a/OsLogin/VERSION b/OsLogin/VERSION index 77fee73a8cf9..158c74729336 100644 --- a/OsLogin/VERSION +++ b/OsLogin/VERSION @@ -1 +1 @@ -1.9.3 +1.9.5 diff --git a/OsLogin/composer.json b/OsLogin/composer.json index a8450e651617..3ea5d89d40de 100644 --- a/OsLogin/composer.json +++ b/OsLogin/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Parallelstore/.repo-metadata.json b/Parallelstore/.repo-metadata.json deleted file mode 100644 index 774a9618bc0c..000000000000 --- a/Parallelstore/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-parallelstore", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-parallelstore/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "parallelstore" -} diff --git a/Parallelstore/VERSION b/Parallelstore/VERSION index 17e51c385ea3..9e11b32fcaa9 100644 --- a/Parallelstore/VERSION +++ b/Parallelstore/VERSION @@ -1 +1 @@ -0.1.1 +0.3.1 diff --git a/Parallelstore/composer.json b/Parallelstore/composer.json index 65eb89aa0a15..16863e68a428 100644 --- a/Parallelstore/composer.json +++ b/Parallelstore/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Parallelstore/metadata/V1Beta/Parallelstore.php b/Parallelstore/metadata/V1Beta/Parallelstore.php index b61f54a8f05fe1c9e924f0011758d4ceafd1d37c..04d4c6613bb1bd36aa6ae95fbfd32f233f0c7bc7 100644 GIT binary patch delta 1024 zcmX?Ya>RDSe`cnyCYu>qEII3yx%h+gON)|I-II%*N|UowON0ctm`jT?B^VVLH8`D^ zA2>28X>f_Sq!yQC<|US7=I7y8DGV_#Ah9ShCnq(hxFo+QRY;JFr692+17Rkkk}j77 z(9CFWu!3@@F4blp79#+>)4&<4tAqy-PnL&|ImRgh~!HN))=He?ZNh~QXj?YakE>28Om0+9vkw-;^9jJr@ z6!*+R5?tJg1)1?coyEYom*9YFo*c+8&UBk;awdNswd~a-#$Ki4EL@V4_wh?A2u0%v zZjdqDM&RH!#}eFNj{(Cx1Y6<(c@Ua-OwbY!OkW(%xZ;Gwl><`Jf#(*8ZbqS0eCdx1 zY&$spDIytyk~?4qc}-3baAgPcguEwT6L6CQvz<7&*dU3}iIDKKhqdN2sda|xsXRb=KRmSpDV#TO)&WJoZBgoogle.cloud.parallelstore.v1beta.DestinationGcsBucket + */ +class DestinationGcsBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI to a Cloud Storage object in format: + * 'gs:///'. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI to a Cloud Storage object in format: + * 'gs:///'. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI to a Cloud Storage object in format: + * 'gs:///'. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI to a Cloud Storage object in format: + * 'gs:///'. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1beta/DestinationParallelstore.php b/Parallelstore/src/V1beta/DestinationParallelstore.php new file mode 100644 index 000000000000..aa269c4cff8f --- /dev/null +++ b/Parallelstore/src/V1beta/DestinationParallelstore.php @@ -0,0 +1,71 @@ +google.cloud.parallelstore.v1beta.DestinationParallelstore + */ +class DestinationParallelstore extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with '/'. Defaults to '/' if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Root directory path to the Paralellstore filesystem, starting + * with '/'. Defaults to '/' if unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with '/'. Defaults to '/' if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with '/'. Defaults to '/' if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1beta/ExportDataMetadata.php b/Parallelstore/src/V1beta/ExportDataMetadata.php index c813b06e40d9..69a26dd796d3 100644 --- a/Parallelstore/src/V1beta/ExportDataMetadata.php +++ b/Parallelstore/src/V1beta/ExportDataMetadata.php @@ -21,6 +21,52 @@ class ExportDataMetadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; */ protected $operation_metadata = null; + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; /** * Constructor. @@ -30,6 +76,24 @@ class ExportDataMetadata extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $operation_metadata * Contains the data transfer operation metadata. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. * } */ public function __construct($data = NULL) { @@ -73,5 +137,215 @@ public function setOperationMetadata($var) return $this; } + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + } diff --git a/Parallelstore/src/V1beta/ExportDataRequest.php b/Parallelstore/src/V1beta/ExportDataRequest.php index 1bd142857555..ae44382b9a09 100644 --- a/Parallelstore/src/V1beta/ExportDataRequest.php +++ b/Parallelstore/src/V1beta/ExportDataRequest.php @@ -47,12 +47,10 @@ class ExportDataRequest extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type string $source_path - * Optional. Root directory path to the Paralellstore filesystem, starting - * with '/'. Sets to '/' if no value is set. - * @type string $destination_gcs_uri - * URI to a Cloud Storage object in format: - * 'gs:///'. + * @type \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $source_parallelstore + * Parallelstore source. + * @type \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $destination_gcs_bucket + * Cloud Storage destination. * @type string $name * Required. Name of the resource. * @type string $request_id @@ -75,66 +73,62 @@ public function __construct($data = NULL) { } /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with '/'. Sets to '/' if no value is set. + * Parallelstore source. * - * Generated from protobuf field string source_path = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 2; + * @return \Google\Cloud\Parallelstore\V1beta\SourceParallelstore|null */ - public function getSourcePath() + public function getSourceParallelstore() { return $this->readOneof(2); } - public function hasSourcePath() + public function hasSourceParallelstore() { return $this->hasOneof(2); } /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with '/'. Sets to '/' if no value is set. + * Parallelstore source. * - * Generated from protobuf field string source_path = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 2; + * @param \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $var * @return $this */ - public function setSourcePath($var) + public function setSourceParallelstore($var) { - GPBUtil::checkString($var, True); + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceParallelstore::class); $this->writeOneof(2, $var); return $this; } /** - * URI to a Cloud Storage object in format: - * 'gs:///'. + * Cloud Storage destination. * - * Generated from protobuf field string destination_gcs_uri = 3; - * @return string + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 3; + * @return \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket|null */ - public function getDestinationGcsUri() + public function getDestinationGcsBucket() { return $this->readOneof(3); } - public function hasDestinationGcsUri() + public function hasDestinationGcsBucket() { return $this->hasOneof(3); } /** - * URI to a Cloud Storage object in format: - * 'gs:///'. + * Cloud Storage destination. * - * Generated from protobuf field string destination_gcs_uri = 3; - * @param string $var + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 3; + * @param \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $var * @return $this */ - public function setDestinationGcsUri($var) + public function setDestinationGcsBucket($var) { - GPBUtil::checkString($var, True); + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket::class); $this->writeOneof(3, $var); return $this; diff --git a/Parallelstore/src/V1beta/ImportDataMetadata.php b/Parallelstore/src/V1beta/ImportDataMetadata.php index 54b589c2f5b9..69156774b164 100644 --- a/Parallelstore/src/V1beta/ImportDataMetadata.php +++ b/Parallelstore/src/V1beta/ImportDataMetadata.php @@ -21,6 +21,52 @@ class ImportDataMetadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferOperationMetadata operation_metadata = 1; */ protected $operation_metadata = null; + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; /** * Constructor. @@ -30,6 +76,24 @@ class ImportDataMetadata extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\Parallelstore\V1beta\TransferOperationMetadata $operation_metadata * Contains the data transfer operation metadata. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. * } */ public function __construct($data = NULL) { @@ -73,5 +137,215 @@ public function setOperationMetadata($var) return $this; } + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + } diff --git a/Parallelstore/src/V1beta/ImportDataRequest.php b/Parallelstore/src/V1beta/ImportDataRequest.php index 07cbafdb8fe0..22490bcf147b 100644 --- a/Parallelstore/src/V1beta/ImportDataRequest.php +++ b/Parallelstore/src/V1beta/ImportDataRequest.php @@ -47,12 +47,10 @@ class ImportDataRequest extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type string $source_gcs_uri - * URI to a Cloud Storage object in format: - * 'gs:///'. - * @type string $destination_path - * Optional. Root directory path to the Paralellstore filesystem, starting - * with '/'. Sets to '/' if no value is set. + * @type \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $source_gcs_bucket + * Cloud Storage source. + * @type \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $destination_parallelstore + * Parallelstore destination. * @type string $name * Required. Name of the resource. * @type string $request_id @@ -75,66 +73,62 @@ public function __construct($data = NULL) { } /** - * URI to a Cloud Storage object in format: - * 'gs:///'. + * Cloud Storage source. * - * Generated from protobuf field string source_gcs_uri = 2; - * @return string + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 2; + * @return \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket|null */ - public function getSourceGcsUri() + public function getSourceGcsBucket() { return $this->readOneof(2); } - public function hasSourceGcsUri() + public function hasSourceGcsBucket() { return $this->hasOneof(2); } /** - * URI to a Cloud Storage object in format: - * 'gs:///'. + * Cloud Storage source. * - * Generated from protobuf field string source_gcs_uri = 2; - * @param string $var + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 2; + * @param \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $var * @return $this */ - public function setSourceGcsUri($var) + public function setSourceGcsBucket($var) { - GPBUtil::checkString($var, True); + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket::class); $this->writeOneof(2, $var); return $this; } /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with '/'. Sets to '/' if no value is set. + * Parallelstore destination. * - * Generated from protobuf field string destination_path = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 3; + * @return \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore|null */ - public function getDestinationPath() + public function getDestinationParallelstore() { return $this->readOneof(3); } - public function hasDestinationPath() + public function hasDestinationParallelstore() { return $this->hasOneof(3); } /** - * Optional. Root directory path to the Paralellstore filesystem, starting - * with '/'. Sets to '/' if no value is set. + * Parallelstore destination. * - * Generated from protobuf field string destination_path = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 3; + * @param \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $var * @return $this */ - public function setDestinationPath($var) + public function setDestinationParallelstore($var) { - GPBUtil::checkString($var, True); + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore::class); $this->writeOneof(3, $var); return $this; diff --git a/Parallelstore/src/V1beta/SourceGcsBucket.php b/Parallelstore/src/V1beta/SourceGcsBucket.php new file mode 100644 index 000000000000..600704436b92 --- /dev/null +++ b/Parallelstore/src/V1beta/SourceGcsBucket.php @@ -0,0 +1,71 @@ +google.cloud.parallelstore.v1beta.SourceGcsBucket + */ +class SourceGcsBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI to a Cloud Storage object in format: + * 'gs:///'. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI to a Cloud Storage object in format: + * 'gs:///'. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI to a Cloud Storage object in format: + * 'gs:///'. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI to a Cloud Storage object in format: + * 'gs:///'. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1beta/SourceParallelstore.php b/Parallelstore/src/V1beta/SourceParallelstore.php new file mode 100644 index 000000000000..b3711c983c9a --- /dev/null +++ b/Parallelstore/src/V1beta/SourceParallelstore.php @@ -0,0 +1,71 @@ +google.cloud.parallelstore.v1beta.SourceParallelstore + */ +class SourceParallelstore extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with '/'. Defaults to '/' if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Root directory path to the Paralellstore filesystem, starting + * with '/'. Defaults to '/' if unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1Beta\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with '/'. Defaults to '/' if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with '/'. Defaults to '/' if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1beta/TransferOperationMetadata.php b/Parallelstore/src/V1beta/TransferOperationMetadata.php index 0f22496d37a4..b454093a3cae 100644 --- a/Parallelstore/src/V1beta/TransferOperationMetadata.php +++ b/Parallelstore/src/V1beta/TransferOperationMetadata.php @@ -16,42 +16,19 @@ class TransferOperationMetadata extends \Google\Protobuf\Internal\Message { /** - * Output only. CCFE supplied fields BEGIN - * The time the operation was created. + * Output only. Information about the progress of the transfer operation. * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Information about the progress of the transfer operation. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3; + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $counters = null; /** - * Required. The origin of the data transfer. - * - * Generated from protobuf field string source = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $source = ''; - /** - * Required. The destination of the data transfer. + * Output only. The type of transfer occurring. * - * Generated from protobuf field string destination = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $destination = ''; - /** - * The type of transfer occurring. - * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6; + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $transfer_type = 0; + protected $source; + protected $destination; /** * Constructor. @@ -59,19 +36,18 @@ class TransferOperationMetadata extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. CCFE supplied fields BEGIN - * The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. + * @type \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $source_parallelstore + * Output only. Parallelstore source. + * @type \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $source_gcs_bucket + * Output only. Cloud Storage source. + * @type \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $destination_gcs_bucket + * Output only. Cloud Storage destination. + * @type \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $destination_parallelstore + * Output only. Parallelstore destination. * @type \Google\Cloud\Parallelstore\V1beta\TransferCounters $counters - * Information about the progress of the transfer operation. - * @type string $source - * Required. The origin of the data transfer. - * @type string $destination - * Required. The destination of the data transfer. + * Output only. Information about the progress of the transfer operation. * @type int $transfer_type - * The type of transfer occurring. + * Output only. The type of transfer occurring. * } */ public function __construct($data = NULL) { @@ -80,171 +56,169 @@ public function __construct($data = NULL) { } /** - * Output only. CCFE supplied fields BEGIN - * The time the operation was created. + * Output only. Parallelstore source. * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\SourceParallelstore|null */ - public function getCreateTime() + public function getSourceParallelstore() { - return $this->create_time; + return $this->readOneof(7); } - public function hasCreateTime() + public function hasSourceParallelstore() { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); + return $this->hasOneof(7); } /** - * Output only. CCFE supplied fields BEGIN - * The time the operation was created. + * Output only. Parallelstore source. * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\SourceParallelstore $var * @return $this */ - public function setCreateTime($var) + public function setSourceParallelstore($var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceParallelstore::class); + $this->writeOneof(7, $var); return $this; } /** - * Output only. The time the operation finished running. + * Output only. Cloud Storage source. * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket|null */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() + public function getSourceGcsBucket() { - return isset($this->end_time); + return $this->readOneof(8); } - public function clearEndTime() + public function hasSourceGcsBucket() { - unset($this->end_time); + return $this->hasOneof(8); } /** - * Output only. The time the operation finished running. + * Output only. Cloud Storage source. * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var + * Generated from protobuf field .google.cloud.parallelstore.v1beta.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket $var * @return $this */ - public function setEndTime($var) + public function setSourceGcsBucket($var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\SourceGcsBucket::class); + $this->writeOneof(8, $var); return $this; } /** - * Information about the progress of the transfer operation. + * Output only. Cloud Storage destination. * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3; - * @return \Google\Cloud\Parallelstore\V1beta\TransferCounters|null + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket|null */ - public function getCounters() + public function getDestinationGcsBucket() { - return $this->counters; + return $this->readOneof(9); } - public function hasCounters() + public function hasDestinationGcsBucket() { - return isset($this->counters); - } - - public function clearCounters() - { - unset($this->counters); + return $this->hasOneof(9); } /** - * Information about the progress of the transfer operation. + * Output only. Cloud Storage destination. * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3; - * @param \Google\Cloud\Parallelstore\V1beta\TransferCounters $var + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket $var * @return $this */ - public function setCounters($var) + public function setDestinationGcsBucket($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\TransferCounters::class); - $this->counters = $var; + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationGcsBucket::class); + $this->writeOneof(9, $var); return $this; } /** - * Required. The origin of the data transfer. + * Output only. Parallelstore destination. * - * Generated from protobuf field string source = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore|null */ - public function getSource() + public function getDestinationParallelstore() + { + return $this->readOneof(10); + } + + public function hasDestinationParallelstore() { - return $this->source; + return $this->hasOneof(10); } /** - * Required. The origin of the data transfer. + * Output only. Parallelstore destination. * - * Generated from protobuf field string source = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var + * Generated from protobuf field .google.cloud.parallelstore.v1beta.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore $var * @return $this */ - public function setSource($var) + public function setDestinationParallelstore($var) { - GPBUtil::checkString($var, True); - $this->source = $var; + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\DestinationParallelstore::class); + $this->writeOneof(10, $var); return $this; } /** - * Required. The destination of the data transfer. + * Output only. Information about the progress of the transfer operation. * - * Generated from protobuf field string destination = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return string + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1beta\TransferCounters|null */ - public function getDestination() + public function getCounters() + { + return $this->counters; + } + + public function hasCounters() { - return $this->destination; + return isset($this->counters); + } + + public function clearCounters() + { + unset($this->counters); } /** - * Required. The destination of the data transfer. + * Output only. Information about the progress of the transfer operation. * - * Generated from protobuf field string destination = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1beta\TransferCounters $var * @return $this */ - public function setDestination($var) + public function setCounters($var) { - GPBUtil::checkString($var, True); - $this->destination = $var; + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1beta\TransferCounters::class); + $this->counters = $var; return $this; } /** - * The type of transfer occurring. + * Output only. The type of transfer occurring. * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6; + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int */ public function getTransferType() @@ -253,9 +227,9 @@ public function getTransferType() } /** - * The type of transfer occurring. + * Output only. The type of transfer occurring. * - * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6; + * Generated from protobuf field .google.cloud.parallelstore.v1beta.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var * @return $this */ @@ -267,5 +241,21 @@ public function setTransferType($var) return $this; } + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + } diff --git a/Parallelstore/tests/Unit/V1beta/Client/ParallelstoreClientTest.php b/Parallelstore/tests/Unit/V1beta/Client/ParallelstoreClientTest.php index bb647a1a1913..fce42908a97f 100644 --- a/Parallelstore/tests/Unit/V1beta/Client/ParallelstoreClientTest.php +++ b/Parallelstore/tests/Unit/V1beta/Client/ParallelstoreClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Location\GetLocationRequest; @@ -43,6 +42,7 @@ use Google\Cloud\Parallelstore\V1beta\ListInstancesRequest; use Google\Cloud\Parallelstore\V1beta\ListInstancesResponse; use Google\Cloud\Parallelstore\V1beta\UpdateInstanceRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/PolicySimulator/.repo-metadata.json b/PolicySimulator/.repo-metadata.json deleted file mode 100644 index bd8f1aa27eb7..000000000000 --- a/PolicySimulator/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-policysimulator", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-policysimulator/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "policysimulator" -} diff --git a/PolicySimulator/VERSION b/PolicySimulator/VERSION index 7179039691ce..3a4036fb450f 100644 --- a/PolicySimulator/VERSION +++ b/PolicySimulator/VERSION @@ -1 +1 @@ -0.2.3 +0.2.5 diff --git a/PolicySimulator/composer.json b/PolicySimulator/composer.json index 43d9c192af72..f41d1f2483cb 100644 --- a/PolicySimulator/composer.json +++ b/PolicySimulator/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/PolicySimulator/src/V1/Client/SimulatorClient.php b/PolicySimulator/src/V1/Client/SimulatorClient.php index 34c715a200ce..4a59574ef715 100644 --- a/PolicySimulator/src/V1/Client/SimulatorClient.php +++ b/PolicySimulator/src/V1/Client/SimulatorClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -39,6 +38,7 @@ use Google\Cloud\PolicySimulator\V1\GetReplayRequest; use Google\Cloud\PolicySimulator\V1\ListReplayResultsRequest; use Google\Cloud\PolicySimulator\V1\Replay; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -147,6 +147,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * folder_location_replay resource. diff --git a/PolicySimulator/tests/Unit/V1/Client/SimulatorClientTest.php b/PolicySimulator/tests/Unit/V1/Client/SimulatorClientTest.php index f931e2836865..c6ea9f7d3dcd 100644 --- a/PolicySimulator/tests/Unit/V1/Client/SimulatorClientTest.php +++ b/PolicySimulator/tests/Unit/V1/Client/SimulatorClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\PolicySimulator\V1\Client\SimulatorClient; @@ -35,6 +34,7 @@ use Google\Cloud\PolicySimulator\V1\Replay; use Google\Cloud\PolicySimulator\V1\ReplayConfig; use Google\Cloud\PolicySimulator\V1\ReplayResult; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/PolicyTroubleshooter/.repo-metadata.json b/PolicyTroubleshooter/.repo-metadata.json deleted file mode 100644 index e3001a96a465..000000000000 --- a/PolicyTroubleshooter/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-policy-troubleshooter", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-policy-troubleshooter/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "policytroubleshooter" -} diff --git a/PolicyTroubleshooter/VERSION b/PolicyTroubleshooter/VERSION index 1892b9267677..d0149fef743a 100644 --- a/PolicyTroubleshooter/VERSION +++ b/PolicyTroubleshooter/VERSION @@ -1 +1 @@ -1.3.2 +1.3.4 diff --git a/PolicyTroubleshooter/composer.json b/PolicyTroubleshooter/composer.json index 375d3dec31cf..b8ee963fd0d8 100644 --- a/PolicyTroubleshooter/composer.json +++ b/PolicyTroubleshooter/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/PolicyTroubleshooterIam/.repo-metadata.json b/PolicyTroubleshooterIam/.repo-metadata.json deleted file mode 100644 index f2583bbb0bfc..000000000000 --- a/PolicyTroubleshooterIam/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-policytroubleshooter-iam", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-policytroubleshooter-iam/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "policytroubleshooter" -} diff --git a/PolicyTroubleshooterIam/VERSION b/PolicyTroubleshooterIam/VERSION index 7179039691ce..3a4036fb450f 100644 --- a/PolicyTroubleshooterIam/VERSION +++ b/PolicyTroubleshooterIam/VERSION @@ -1 +1 @@ -0.2.3 +0.2.5 diff --git a/PolicyTroubleshooterIam/composer.json b/PolicyTroubleshooterIam/composer.json index 7a9734811fb6..fd6a722f221e 100644 --- a/PolicyTroubleshooterIam/composer.json +++ b/PolicyTroubleshooterIam/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/cloud-iam": "^0.5.0" }, "require-dev": { diff --git a/PrivateCatalog/.repo-metadata.json b/PrivateCatalog/.repo-metadata.json deleted file mode 100644 index 2c63da28b06a..000000000000 --- a/PrivateCatalog/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-private-catalog", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-private-catalog/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudprivatecatalog" -} diff --git a/PrivateCatalog/VERSION b/PrivateCatalog/VERSION index 2b7c5ae01848..6f2743d65dc0 100644 --- a/PrivateCatalog/VERSION +++ b/PrivateCatalog/VERSION @@ -1 +1 @@ -0.4.2 +0.4.4 diff --git a/PrivateCatalog/composer.json b/PrivateCatalog/composer.json index 40bb7e1d9164..d829de2de7bb 100644 --- a/PrivateCatalog/composer.json +++ b/PrivateCatalog/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Profiler/.repo-metadata.json b/Profiler/.repo-metadata.json deleted file mode 100644 index 13410d69008a..000000000000 --- a/Profiler/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-profiler", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-profiler/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudprofiler" -} diff --git a/Profiler/VERSION b/Profiler/VERSION index 347f5833ee6d..428b770e3e23 100644 --- a/Profiler/VERSION +++ b/Profiler/VERSION @@ -1 +1 @@ -1.4.1 +1.4.3 diff --git a/Profiler/composer.json b/Profiler/composer.json index ec5abf3348ef..1da48834cb3f 100644 --- a/Profiler/composer.json +++ b/Profiler/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/PubSub/.repo-metadata.json b/PubSub/.repo-metadata.json deleted file mode 100644 index 6b2479cbdca1..000000000000 --- a/PubSub/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-pubsub", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-pubsub/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "pubsub" -} diff --git a/PubSub/VERSION b/PubSub/VERSION index 3e3c2f1e5edb..c043eea7767e 100644 --- a/PubSub/VERSION +++ b/PubSub/VERSION @@ -1 +1 @@ -2.1.1 +2.2.1 diff --git a/PubSub/composer.json b/PubSub/composer.json index b551813ac56a..45d9e87c141a 100644 --- a/PubSub/composer.json +++ b/PubSub/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^8.0", "google/cloud-core": "^1.55", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/PubSub/metadata/V1/Pubsub.php b/PubSub/metadata/V1/Pubsub.php index 416804f66cdf0c3546bdfc7e3cc7df7e44430523..f3397d12f3af01f4049712e6e47697a9b187f963 100644 GIT binary patch delta 75 zcmaD;xut5uS!SjwMVrqv&lO?nW1gHRad+}OaVZ{l1x5`{C*}u^j7nXTx3=akI|@ofHD<0+VhS-IH$_jso=rv;P^i0khW|T_JX$5wrjR diff --git a/PubSub/src/PubSubClient.php b/PubSub/src/PubSubClient.php index 1e67a0ede389..926ce1b734ff 100644 --- a/PubSub/src/PubSubClient.php +++ b/PubSub/src/PubSubClient.php @@ -99,7 +99,7 @@ class PubSubClient use ApiHelperTrait; use ClientOptionsTrait; - const VERSION = '2.0.0-RC1'; + const VERSION = '2.2.1'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/pubsub'; diff --git a/PubSub/src/V1/BigQueryConfig.php b/PubSub/src/V1/BigQueryConfig.php index 6949c403f2c6..64a73f17d55a 100644 --- a/PubSub/src/V1/BigQueryConfig.php +++ b/PubSub/src/V1/BigQueryConfig.php @@ -65,6 +65,17 @@ class BigQueryConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; */ private $use_table_schema = false; + /** + * Optional. The service account to use to write to BigQuery. The subscription + * creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub [service + * agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $service_account_email = ''; /** * Constructor. @@ -98,6 +109,13 @@ class BigQueryConfig extends \Google\Protobuf\Internal\Message * Optional. When true, use the BigQuery table's schema as the columns to * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be * enabled at the same time. + * @type string $service_account_email + * Optional. The service account to use to write to BigQuery. The subscription + * creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub [service + * agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. * } */ public function __construct($data = NULL) { @@ -289,5 +307,41 @@ public function setUseTableSchema($var) return $this; } + /** + * Optional. The service account to use to write to BigQuery. The subscription + * creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub [service + * agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * Optional. The service account to use to write to BigQuery. The subscription + * creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub [service + * agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + } diff --git a/PubSub/src/V1/CloudStorageConfig.php b/PubSub/src/V1/CloudStorageConfig.php index 136d636c81c5..59bd8903f911 100644 --- a/PubSub/src/V1/CloudStorageConfig.php +++ b/PubSub/src/V1/CloudStorageConfig.php @@ -70,6 +70,17 @@ class CloudStorageConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $state = 0; + /** + * Optional. The service account to use to write to Cloud Storage. The + * subscription creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub + * [service agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $service_account_email = ''; protected $output_format; /** @@ -111,6 +122,13 @@ class CloudStorageConfig extends \Google\Protobuf\Internal\Message * @type int $state * Output only. An output-only field that indicates whether or not the * subscription can receive messages. + * @type string $service_account_email + * Optional. The service account to use to write to Cloud Storage. The + * subscription creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub + * [service agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. * } */ public function __construct($data = NULL) { @@ -402,6 +420,42 @@ public function setState($var) return $this; } + /** + * Optional. The service account to use to write to Cloud Storage. The + * subscription creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub + * [service agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * Optional. The service account to use to write to Cloud Storage. The + * subscription creator or updater that specifies this field must have + * `iam.serviceAccounts.actAs` permission on the service account. If not + * specified, the Pub/Sub + * [service agent](https://cloud.google.com/iam/docs/service-agents), + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + * + * Generated from protobuf field string service_account_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + /** * @return string */ diff --git a/Quotas/.repo-metadata.json b/Quotas/.repo-metadata.json deleted file mode 100644 index e1199af50324..000000000000 --- a/Quotas/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-quotas", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-quotas/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudquotas" -} diff --git a/Quotas/VERSION b/Quotas/VERSION index 0c62199f16ac..7179039691ce 100644 --- a/Quotas/VERSION +++ b/Quotas/VERSION @@ -1 +1 @@ -0.2.1 +0.2.3 diff --git a/Quotas/composer.json b/Quotas/composer.json index 29f78fb52ed1..5d23a978c2a7 100644 --- a/Quotas/composer.json +++ b/Quotas/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/RapidMigrationAssessment/.repo-metadata.json b/RapidMigrationAssessment/.repo-metadata.json deleted file mode 100644 index 3b9e9b130fbe..000000000000 --- a/RapidMigrationAssessment/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-rapidmigrationassessment", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-rapidmigrationassessment/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "rapidmigrationassessment" -} diff --git a/RapidMigrationAssessment/VERSION b/RapidMigrationAssessment/VERSION index 1c09c74e221c..c2c0004f0e2a 100644 --- a/RapidMigrationAssessment/VERSION +++ b/RapidMigrationAssessment/VERSION @@ -1 +1 @@ -0.3.3 +0.3.5 diff --git a/RapidMigrationAssessment/composer.json b/RapidMigrationAssessment/composer.json index e7274a212b11..a24106f4784a 100644 --- a/RapidMigrationAssessment/composer.json +++ b/RapidMigrationAssessment/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/RapidMigrationAssessment/src/V1/Client/RapidMigrationAssessmentClient.php b/RapidMigrationAssessment/src/V1/Client/RapidMigrationAssessmentClient.php index 65ed6a9b5fd1..c2393f551dce 100644 --- a/RapidMigrationAssessment/src/V1/Client/RapidMigrationAssessmentClient.php +++ b/RapidMigrationAssessment/src/V1/Client/RapidMigrationAssessmentClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -50,6 +49,7 @@ use Google\Cloud\RapidMigrationAssessment\V1\RegisterCollectorRequest; use Google\Cloud\RapidMigrationAssessment\V1\ResumeCollectorRequest; use Google\Cloud\RapidMigrationAssessment\V1\UpdateCollectorRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -157,6 +157,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a annotation * resource. diff --git a/RapidMigrationAssessment/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php b/RapidMigrationAssessment/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php index d860ccf2034a..3a9a7a5abaf6 100644 --- a/RapidMigrationAssessment/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php +++ b/RapidMigrationAssessment/tests/Unit/V1/Client/RapidMigrationAssessmentClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Location\GetLocationRequest; @@ -45,6 +44,7 @@ use Google\Cloud\RapidMigrationAssessment\V1\RegisterCollectorRequest; use Google\Cloud\RapidMigrationAssessment\V1\ResumeCollectorRequest; use Google\Cloud\RapidMigrationAssessment\V1\UpdateCollectorRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/RecaptchaEnterprise/.repo-metadata.json b/RecaptchaEnterprise/.repo-metadata.json deleted file mode 100644 index 2030c0fdf695..000000000000 --- a/RecaptchaEnterprise/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-recaptcha-enterprise", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-recaptcha-enterprise/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "recaptchaenterprise" -} diff --git a/RecaptchaEnterprise/VERSION b/RecaptchaEnterprise/VERSION index 0eed1a29efd6..6b89d58f861a 100644 --- a/RecaptchaEnterprise/VERSION +++ b/RecaptchaEnterprise/VERSION @@ -1 +1 @@ -1.12.0 +1.12.2 diff --git a/RecaptchaEnterprise/composer.json b/RecaptchaEnterprise/composer.json index ec19dc0c290d..ab6b9f72e0ef 100644 --- a/RecaptchaEnterprise/composer.json +++ b/RecaptchaEnterprise/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/RecommendationEngine/.repo-metadata.json b/RecommendationEngine/.repo-metadata.json deleted file mode 100644 index 2de6a729323f..000000000000 --- a/RecommendationEngine/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-recommendations-ai", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-recommendations-ai/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "recommendationengine" -} diff --git a/RecommendationEngine/VERSION b/RecommendationEngine/VERSION index f38fc5393ff6..8bd6ba8c5c36 100644 --- a/RecommendationEngine/VERSION +++ b/RecommendationEngine/VERSION @@ -1 +1 @@ -0.7.3 +0.7.5 diff --git a/RecommendationEngine/composer.json b/RecommendationEngine/composer.json index 158778b1c4d6..0b986b590eaf 100644 --- a/RecommendationEngine/composer.json +++ b/RecommendationEngine/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Recommender/.repo-metadata.json b/Recommender/.repo-metadata.json deleted file mode 100644 index 1790c7675780..000000000000 --- a/Recommender/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-recommender", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-recommender/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "recommender" -} diff --git a/Recommender/VERSION b/Recommender/VERSION index 0a5af26df3fd..e6dbb7c238fe 100644 --- a/Recommender/VERSION +++ b/Recommender/VERSION @@ -1 +1 @@ -1.11.3 +1.11.5 diff --git a/Recommender/composer.json b/Recommender/composer.json index c35cfffd0c89..9a0312f240b0 100644 --- a/Recommender/composer.json +++ b/Recommender/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Redis/.repo-metadata.json b/Redis/.repo-metadata.json deleted file mode 100644 index bbe1a402579a..000000000000 --- a/Redis/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-redis", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-redis/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "redis" -} diff --git a/Redis/VERSION b/Redis/VERSION index 77fee73a8cf9..158c74729336 100644 --- a/Redis/VERSION +++ b/Redis/VERSION @@ -1 +1 @@ -1.9.3 +1.9.5 diff --git a/Redis/composer.json b/Redis/composer.json index 42883012c93b..3fb2ab5b177c 100644 --- a/Redis/composer.json +++ b/Redis/composer.json @@ -20,7 +20,7 @@ "require": { "php": "^8.0", "ext-grpc": "*", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/RedisCluster/.repo-metadata.json b/RedisCluster/.repo-metadata.json deleted file mode 100644 index b40ef061be66..000000000000 --- a/RedisCluster/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-redis-cluster", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-redis-cluster/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "redis" -} diff --git a/RedisCluster/VERSION b/RedisCluster/VERSION index 7179039691ce..0d91a54c7d43 100644 --- a/RedisCluster/VERSION +++ b/RedisCluster/VERSION @@ -1 +1 @@ -0.2.3 +0.3.0 diff --git a/RedisCluster/composer.json b/RedisCluster/composer.json index c0f5c938300d..4468df40ac0f 100644 --- a/RedisCluster/composer.json +++ b/RedisCluster/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/RedisCluster/metadata/V1/CloudRedisCluster.php b/RedisCluster/metadata/V1/CloudRedisCluster.php index 958d741750aa35126f10d0c8f3a951dcf02301e2..ca7ebc33312f87bc11e52448e82a5a795f30bf79 100644 GIT binary patch delta 2162 zcmai$QE%H+6vt;LTjP_oO>dJlO{=YqD2!EPTF2U{AZPFYw$aUJ)<6FbSSO;{!}QaBU}P+C=5ezUTbTIsbFd zz4pI1PVRl@_rF?(m1pm*9KYkA^55Tsg&eUmjRVsnMur%cwxiWli|_~5UenO5!!mjQ zfS4A#2Yy}MCvj$uxz43;z2Mnb{35(*&j(_$Az1Rq(c?@YTEaLXV3XLCi zJh%d*2B~Xi2Q%Z*IUnWjb~&6XJ7y0t1>G_ZJ#ZezTL!6VCc&n5MDXr*JVsM8j@6g< zeZeqjYYXB>O`TvGz%sP$150b_-TJ27`tCS+9&A#lY@bhmfp5V~oivDxwv47lYVIS^ z)$InU$ERtSfLl@CPjlM0gD>wSZo|Yt)hGzQC*;uE1~dwnpQ?=m5@#vTt+IC+doJ|H z+i3)0d`?#SD$L>wN;vk7uCU9=Uwsf6HU_8x6Z@*J?vgq-iSd*exTd;Q1eat-eR~*{ z5H4rd7uAq* zfXtq%>4|yZdM_vfAty!WEO?o?)%IWfhu*|TPmR5Uf@J&K(5ig15A4~}LEw5_OMX5A z@y>}G7-zHz{(X8b+}4gQ<+=m>?to{iZ$+epH_w{@Mt!?GolaweOMExTav$OiXR4e{ z_m3&X)#gqY_npPXL7bP@`tZb0EO5Pu$bd9Ev?qMpS2Fm)!ZX{m;VEsb7Ito=#gwKkLd0LIRe=o-u@5?@mCas`)!azW1GbxA1+ znZjB@$c8VW5CmjNzqr;7(%Xa5du)n#!8M0-btgp#_N}2=i1VeAAZ78I zQk632pi~4YBVbX^ z+P6ZJxokn<(?!}Q291D^?hXw_A84&K&fg5ghTnYX@tIkE;K*(dcTJsNKAmWKNgUCO z)w|-nPGE=(^GB~ka?{yFT5qLXNUv84vgC*mPMfpfZuS^}xL&Lju;WfujYCi=NV%fm zEwJ|LxZ3`Tfk5{Yg{C1YIe{wGQeQMTSOQ{Yfu_Vto~I8uBbNm%@oxL$5b0V}+e<;z*DhmID96yd+WBvm?YNA#E delta 60 zcmV-C0K@;pKm0171O&7q3OA8UH?ung7X$*Y3A4Tk-vX0B4egU+4&$?V4>tmm7-5t1 S7@Y#t2(ywI3Iwx^9ykG)&lPF_ diff --git a/RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php b/RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php new file mode 100644 index 000000000000..b23b63cb2e21 --- /dev/null +++ b/RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CertificateAuthority $response */ + $response = $cloudRedisClusterClient->getClusterCertificateAuthority($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 = CloudRedisClusterClient::certificateAuthorityName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + + get_cluster_certificate_authority_sample($formattedName); +} +// [END redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] diff --git a/RedisCluster/src/V1/CertificateAuthority.php b/RedisCluster/src/V1/CertificateAuthority.php new file mode 100644 index 000000000000..65adb51a42bd --- /dev/null +++ b/RedisCluster/src/V1/CertificateAuthority.php @@ -0,0 +1,112 @@ +google.cloud.redis.cluster.v1.CertificateAuthority + */ +class CertificateAuthority extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + protected $server_ca; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority $managed_server_ca + * @type string $name + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 1; + * @return \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority|null + */ + public function getManagedServerCa() + { + return $this->readOneof(1); + } + + public function hasManagedServerCa() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 1; + * @param \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority $var + * @return $this + */ + public function setManagedServerCa($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * @return string + */ + public function getServerCa() + { + return $this->whichOneof("server_ca"); + } + +} + diff --git a/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority.php b/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority.php new file mode 100644 index 000000000000..a6ae67f1e601 --- /dev/null +++ b/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority.php @@ -0,0 +1,70 @@ +google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority + */ +class ManagedCertificateAuthority extends \Google\Protobuf\Internal\Message +{ + /** + * The PEM encoded CA certificate chains for redis managed + * server authentication + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + */ + private $ca_certs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain>|\Google\Protobuf\Internal\RepeatedField $ca_certs + * The PEM encoded CA certificate chains for redis managed + * server authentication + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * The PEM encoded CA certificate chains for redis managed + * server authentication + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCaCerts() + { + return $this->ca_certs; + } + + /** + * The PEM encoded CA certificate chains for redis managed + * server authentication + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * @param array<\Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCaCerts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain::class); + $this->ca_certs = $arr; + + return $this; + } + +} + + diff --git a/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php b/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php new file mode 100644 index 000000000000..09a80e62cb93 --- /dev/null +++ b/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php @@ -0,0 +1,66 @@ +google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + */ +class CertChain extends \Google\Protobuf\Internal\Message +{ + /** + * The certificates that form the CA chain, from leaf to root order. + * + * Generated from protobuf field repeated string certificates = 1; + */ + private $certificates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $certificates + * The certificates that form the CA chain, from leaf to root order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * The certificates that form the CA chain, from leaf to root order. + * + * Generated from protobuf field repeated string certificates = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCertificates() + { + return $this->certificates; + } + + /** + * The certificates that form the CA chain, from leaf to root order. + * + * Generated from protobuf field repeated string certificates = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->certificates = $arr; + + return $this; + } + +} + + diff --git a/RedisCluster/src/V1/Client/CloudRedisClusterClient.php b/RedisCluster/src/V1/Client/CloudRedisClusterClient.php index 6b937e16541c..9522b09bc6b2 100644 --- a/RedisCluster/src/V1/Client/CloudRedisClusterClient.php +++ b/RedisCluster/src/V1/Client/CloudRedisClusterClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -38,12 +37,15 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\Cloud\Redis\Cluster\V1\CertificateAuthority; use Google\Cloud\Redis\Cluster\V1\Cluster; use Google\Cloud\Redis\Cluster\V1\CreateClusterRequest; use Google\Cloud\Redis\Cluster\V1\DeleteClusterRequest; +use Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest; use Google\Cloud\Redis\Cluster\V1\GetClusterRequest; use Google\Cloud\Redis\Cluster\V1\ListClustersRequest; use Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use Google\Protobuf\Any; use GuzzleHttp\Promise\PromiseInterface; @@ -82,6 +84,7 @@ * @method PromiseInterface createClusterAsync(CreateClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteClusterAsync(DeleteClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface getClusterAsync(GetClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getClusterCertificateAuthorityAsync(GetClusterCertificateAuthorityRequest $request, array $optionalArgs = []) * @method PromiseInterface listClustersAsync(ListClustersRequest $request, array $optionalArgs = []) * @method PromiseInterface updateClusterAsync(UpdateClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) @@ -166,6 +169,44 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * certificate_authority resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted certificate_authority resource. + */ + public static function certificateAuthorityName(string $project, string $location, string $cluster): string + { + return self::getPathTemplate('certificateAuthority')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a cluster * resource. @@ -206,6 +247,7 @@ public static function locationName(string $project, string $location): string * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - certificateAuthority: projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority * - cluster: projects/{project}/locations/{location}/clusters/{cluster} * - location: projects/{project}/locations/{location} * @@ -385,6 +427,35 @@ public function getCluster(GetClusterRequest $request, array $callOptions = []): return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); } + /** + * Gets the details of certificate authority information for Redis cluster. + * + * The async variant is + * {@see CloudRedisClusterClient::getClusterCertificateAuthorityAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php + * + * @param GetClusterCertificateAuthorityRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CertificateAuthority + * + * @throws ApiException Thrown if the API call fails. + */ + public function getClusterCertificateAuthority( + GetClusterCertificateAuthorityRequest $request, + array $callOptions = [] + ): CertificateAuthority { + return $this->startApiCall('GetClusterCertificateAuthority', $request, $callOptions)->wait(); + } + /** * Lists all Redis clusters owned by a project in either the specified * location (region) or all locations. diff --git a/RedisCluster/src/V1/Cluster.php b/RedisCluster/src/V1/Cluster.php index 717d2175cd9b..58b6ccfa3e61 100644 --- a/RedisCluster/src/V1/Cluster.php +++ b/RedisCluster/src/V1/Cluster.php @@ -63,7 +63,8 @@ class Cluster extends \Google\Protobuf\Internal\Message */ protected $transit_encryption_mode = 0; /** - * Output only. Redis memory size in GB for the entire cluster. + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. * * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -102,6 +103,45 @@ class Cluster extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $state_info = null; + /** + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $node_type = 0; + /** + * Optional. Persistence config (RDB, AOF) for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $persistence_config = null; + /** + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * + * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $redis_configs; + /** + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * + * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $precise_size_gb = null; + /** + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $zone_distribution_config = null; + /** + * Optional. The delete operation will fail when the value is set to true. + * + * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $deletion_protection_enabled = null; /** * Constructor. @@ -129,7 +169,8 @@ class Cluster extends \Google\Protobuf\Internal\Message * Optional. The in-transit encryption for the Redis cluster. * If not provided, encryption is disabled for the cluster. * @type int $size_gb - * Output only. Redis memory size in GB for the entire cluster. + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. * @type int $shard_count * Required. Number of shards for the Redis cluster. * @type array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $psc_configs @@ -144,6 +185,21 @@ class Cluster extends \Google\Protobuf\Internal\Message * accessing the cluster. * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $state_info * Output only. Additional information about the current state of the cluster. + * @type int $node_type + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $persistence_config + * Optional. Persistence config (RDB, AOF) for the cluster. + * @type array|\Google\Protobuf\Internal\MapField $redis_configs + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * @type float $precise_size_gb + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * @type \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $zone_distribution_config + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * @type bool $deletion_protection_enabled + * Optional. The delete operation will fail when the value is set to true. * } */ public function __construct($data = NULL) { @@ -364,7 +420,8 @@ public function setTransitEncryptionMode($var) } /** - * Output only. Redis memory size in GB for the entire cluster. + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. * * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int @@ -385,7 +442,8 @@ public function clearSizeGb() } /** - * Output only. Redis memory size in GB for the entire cluster. + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. * * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var @@ -557,5 +615,207 @@ public function setStateInfo($var) return $this; } + /** + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNodeType() + { + return $this->node_type; + } + + /** + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNodeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\NodeType::class); + $this->node_type = $var; + + return $this; + } + + /** + * Optional. Persistence config (RDB, AOF) for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig|null + */ + public function getPersistenceConfig() + { + return $this->persistence_config; + } + + public function hasPersistenceConfig() + { + return isset($this->persistence_config); + } + + public function clearPersistenceConfig() + { + unset($this->persistence_config); + } + + /** + * Optional. Persistence config (RDB, AOF) for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $var + * @return $this + */ + public function setPersistenceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig::class); + $this->persistence_config = $var; + + return $this; + } + + /** + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * + * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRedisConfigs() + { + return $this->redis_configs; + } + + /** + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * + * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRedisConfigs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->redis_configs = $arr; + + return $this; + } + + /** + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * + * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getPreciseSizeGb() + { + return isset($this->precise_size_gb) ? $this->precise_size_gb : 0.0; + } + + public function hasPreciseSizeGb() + { + return isset($this->precise_size_gb); + } + + public function clearPreciseSizeGb() + { + unset($this->precise_size_gb); + } + + /** + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * + * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setPreciseSizeGb($var) + { + GPBUtil::checkDouble($var); + $this->precise_size_gb = $var; + + return $this; + } + + /** + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig|null + */ + public function getZoneDistributionConfig() + { + return $this->zone_distribution_config; + } + + public function hasZoneDistributionConfig() + { + return isset($this->zone_distribution_config); + } + + public function clearZoneDistributionConfig() + { + unset($this->zone_distribution_config); + } + + /** + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $var + * @return $this + */ + public function setZoneDistributionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig::class); + $this->zone_distribution_config = $var; + + return $this; + } + + /** + * Optional. The delete operation will fail when the value is set to true. + * + * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDeletionProtectionEnabled() + { + return isset($this->deletion_protection_enabled) ? $this->deletion_protection_enabled : false; + } + + public function hasDeletionProtectionEnabled() + { + return isset($this->deletion_protection_enabled); + } + + public function clearDeletionProtectionEnabled() + { + unset($this->deletion_protection_enabled); + } + + /** + * Optional. The delete operation will fail when the value is set to true. + * + * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDeletionProtectionEnabled($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection_enabled = $var; + + return $this; + } + } diff --git a/RedisCluster/src/V1/ClusterPersistenceConfig.php b/RedisCluster/src/V1/ClusterPersistenceConfig.php new file mode 100644 index 000000000000..b17af3046ed1 --- /dev/null +++ b/RedisCluster/src/V1/ClusterPersistenceConfig.php @@ -0,0 +1,155 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig + */ +class ClusterPersistenceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The mode of persistence. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = 0; + /** + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_config = null; + /** + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $aof_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Optional. The mode of persistence. + * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig $rdb_config + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig $aof_config + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The mode of persistence. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. The mode of persistence. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\PersistenceMode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig|null + */ + public function getRdbConfig() + { + return $this->rdb_config; + } + + public function hasRdbConfig() + { + return isset($this->rdb_config); + } + + public function clearRdbConfig() + { + unset($this->rdb_config); + } + + /** + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig $var + * @return $this + */ + public function setRdbConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig::class); + $this->rdb_config = $var; + + return $this; + } + + /** + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig|null + */ + public function getAofConfig() + { + return $this->aof_config; + } + + public function hasAofConfig() + { + return isset($this->aof_config); + } + + public function clearAofConfig() + { + unset($this->aof_config); + } + + /** + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig $var + * @return $this + */ + public function setAofConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig::class); + $this->aof_config = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig.php b/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig.php new file mode 100644 index 000000000000..7ae275fc1b9a --- /dev/null +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig.php @@ -0,0 +1,68 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig + */ +class AOFConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. fsync configuration. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $append_fsync = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $append_fsync + * Optional. fsync configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. fsync configuration. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAppendFsync() + { + return $this->append_fsync; + } + + /** + * Optional. fsync configuration. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAppendFsync($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig\AppendFsync::class); + $this->append_fsync = $var; + + return $this; + } + +} + + diff --git a/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php b/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php new file mode 100644 index 000000000000..c825e1b2ee66 --- /dev/null +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php @@ -0,0 +1,72 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync + */ +class AppendFsync +{ + /** + * Not set. Default: EVERYSEC + * + * Generated from protobuf enum APPEND_FSYNC_UNSPECIFIED = 0; + */ + const APPEND_FSYNC_UNSPECIFIED = 0; + /** + * Never fsync. Normally Linux will flush data every 30 seconds with this + * configuration, but it's up to the kernel's exact tuning. + * + * Generated from protobuf enum NO = 1; + */ + const NO = 1; + /** + * fsync every second. Fast enough, and you may lose 1 second of data if + * there is a disaster + * + * Generated from protobuf enum EVERYSEC = 2; + */ + const EVERYSEC = 2; + /** + * fsync every time new commands are appended to the AOF. It has the best + * data loss protection at the cost of performance + * + * Generated from protobuf enum ALWAYS = 3; + */ + const ALWAYS = 3; + + private static $valueToName = [ + self::APPEND_FSYNC_UNSPECIFIED => 'APPEND_FSYNC_UNSPECIFIED', + self::NO => 'NO', + self::EVERYSEC => 'EVERYSEC', + self::ALWAYS => 'ALWAYS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/RedisCluster/src/V1/ClusterPersistenceConfig/PersistenceMode.php b/RedisCluster/src/V1/ClusterPersistenceConfig/PersistenceMode.php new file mode 100644 index 000000000000..5e37e2527fd1 --- /dev/null +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/PersistenceMode.php @@ -0,0 +1,69 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode + */ +class PersistenceMode +{ + /** + * Not set. + * + * Generated from protobuf enum PERSISTENCE_MODE_UNSPECIFIED = 0; + */ + const PERSISTENCE_MODE_UNSPECIFIED = 0; + /** + * Persistence is disabled, and any snapshot data is deleted. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * RDB based persistence is enabled. + * + * Generated from protobuf enum RDB = 2; + */ + const RDB = 2; + /** + * AOF based persistence is enabled. + * + * Generated from protobuf enum AOF = 3; + */ + const AOF = 3; + + private static $valueToName = [ + self::PERSISTENCE_MODE_UNSPECIFIED => 'PERSISTENCE_MODE_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::RDB => 'RDB', + self::AOF => 'AOF', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig.php b/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig.php new file mode 100644 index 000000000000..72bea412dc13 --- /dev/null +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig.php @@ -0,0 +1,120 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig + */ +class RDBConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Period between RDB snapshots. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_snapshot_period = 0; + /** + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_snapshot_start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $rdb_snapshot_period + * Optional. Period between RDB snapshots. + * @type \Google\Protobuf\Timestamp $rdb_snapshot_start_time + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Period between RDB snapshots. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getRdbSnapshotPeriod() + { + return $this->rdb_snapshot_period; + } + + /** + * Optional. Period between RDB snapshots. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setRdbSnapshotPeriod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig\SnapshotPeriod::class); + $this->rdb_snapshot_period = $var; + + return $this; + } + + /** + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRdbSnapshotStartTime() + { + return $this->rdb_snapshot_start_time; + } + + public function hasRdbSnapshotStartTime() + { + return isset($this->rdb_snapshot_start_time); + } + + public function clearRdbSnapshotStartTime() + { + unset($this->rdb_snapshot_start_time); + } + + /** + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRdbSnapshotStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->rdb_snapshot_start_time = $var; + + return $this; + } + +} + + diff --git a/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php b/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php new file mode 100644 index 000000000000..a1ff3273539a --- /dev/null +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php @@ -0,0 +1,76 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod + */ +class SnapshotPeriod +{ + /** + * Not set. + * + * Generated from protobuf enum SNAPSHOT_PERIOD_UNSPECIFIED = 0; + */ + const SNAPSHOT_PERIOD_UNSPECIFIED = 0; + /** + * One hour. + * + * Generated from protobuf enum ONE_HOUR = 1; + */ + const ONE_HOUR = 1; + /** + * Six hours. + * + * Generated from protobuf enum SIX_HOURS = 2; + */ + const SIX_HOURS = 2; + /** + * Twelve hours. + * + * Generated from protobuf enum TWELVE_HOURS = 3; + */ + const TWELVE_HOURS = 3; + /** + * Twenty four hours. + * + * Generated from protobuf enum TWENTY_FOUR_HOURS = 4; + */ + const TWENTY_FOUR_HOURS = 4; + + private static $valueToName = [ + self::SNAPSHOT_PERIOD_UNSPECIFIED => 'SNAPSHOT_PERIOD_UNSPECIFIED', + self::ONE_HOUR => 'ONE_HOUR', + self::SIX_HOURS => 'SIX_HOURS', + self::TWELVE_HOURS => 'TWELVE_HOURS', + self::TWENTY_FOUR_HOURS => 'TWENTY_FOUR_HOURS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/RedisCluster/src/V1/GetClusterCertificateAuthorityRequest.php b/RedisCluster/src/V1/GetClusterCertificateAuthorityRequest.php new file mode 100644 index 000000000000..5a8f0feed587 --- /dev/null +++ b/RedisCluster/src/V1/GetClusterCertificateAuthorityRequest.php @@ -0,0 +1,92 @@ +google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest + */ +class GetClusterCertificateAuthorityRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::certificateAuthorityName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/NodeType.php b/RedisCluster/src/V1/NodeType.php new file mode 100644 index 000000000000..3fe082e637cb --- /dev/null +++ b/RedisCluster/src/V1/NodeType.php @@ -0,0 +1,73 @@ +google.cloud.redis.cluster.v1.NodeType + */ +class NodeType +{ + /** + * Generated from protobuf enum NODE_TYPE_UNSPECIFIED = 0; + */ + const NODE_TYPE_UNSPECIFIED = 0; + /** + * Redis shared core nano node_type. + * + * Generated from protobuf enum REDIS_SHARED_CORE_NANO = 1; + */ + const REDIS_SHARED_CORE_NANO = 1; + /** + * Redis highmem medium node_type. + * + * Generated from protobuf enum REDIS_HIGHMEM_MEDIUM = 2; + */ + const REDIS_HIGHMEM_MEDIUM = 2; + /** + * Redis highmem xlarge node_type. + * + * Generated from protobuf enum REDIS_HIGHMEM_XLARGE = 3; + */ + const REDIS_HIGHMEM_XLARGE = 3; + /** + * Redis standard small node_type. + * + * Generated from protobuf enum REDIS_STANDARD_SMALL = 4; + */ + const REDIS_STANDARD_SMALL = 4; + + private static $valueToName = [ + self::NODE_TYPE_UNSPECIFIED => 'NODE_TYPE_UNSPECIFIED', + self::REDIS_SHARED_CORE_NANO => 'REDIS_SHARED_CORE_NANO', + self::REDIS_HIGHMEM_MEDIUM => 'REDIS_HIGHMEM_MEDIUM', + self::REDIS_HIGHMEM_XLARGE => 'REDIS_HIGHMEM_XLARGE', + self::REDIS_STANDARD_SMALL => 'REDIS_STANDARD_SMALL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/RedisCluster/src/V1/ZoneDistributionConfig.php b/RedisCluster/src/V1/ZoneDistributionConfig.php new file mode 100644 index 000000000000..1645d3cf3f67 --- /dev/null +++ b/RedisCluster/src/V1/ZoneDistributionConfig.php @@ -0,0 +1,113 @@ +google.cloud.redis.cluster.v1.ZoneDistributionConfig + */ +class ZoneDistributionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = 0; + /** + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * @type string $zone + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig\ZoneDistributionMode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/ZoneDistributionConfig/ZoneDistributionMode.php b/RedisCluster/src/V1/ZoneDistributionConfig/ZoneDistributionMode.php new file mode 100644 index 000000000000..80c81d323b89 --- /dev/null +++ b/RedisCluster/src/V1/ZoneDistributionConfig/ZoneDistributionMode.php @@ -0,0 +1,67 @@ +google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode + */ +class ZoneDistributionMode +{ + /** + * Not Set. Default: MULTI_ZONE + * + * Generated from protobuf enum ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + */ + const ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + /** + * Distribute all resources across 3 zones picked at random, within the + * region. + * + * Generated from protobuf enum MULTI_ZONE = 1; + */ + const MULTI_ZONE = 1; + /** + * Distribute all resources in a single zone. The zone field must be + * specified, when this mode is selected. + * + * Generated from protobuf enum SINGLE_ZONE = 2; + */ + const SINGLE_ZONE = 2; + + private static $valueToName = [ + self::ZONE_DISTRIBUTION_MODE_UNSPECIFIED => 'ZONE_DISTRIBUTION_MODE_UNSPECIFIED', + self::MULTI_ZONE => 'MULTI_ZONE', + self::SINGLE_ZONE => 'SINGLE_ZONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/RedisCluster/src/V1/gapic_metadata.json b/RedisCluster/src/V1/gapic_metadata.json index 441f3d1baf21..3c75e8b0b86c 100644 --- a/RedisCluster/src/V1/gapic_metadata.json +++ b/RedisCluster/src/V1/gapic_metadata.json @@ -25,6 +25,11 @@ "getCluster" ] }, + "GetClusterCertificateAuthority": { + "methods": [ + "getClusterCertificateAuthority" + ] + }, "ListClusters": { "methods": [ "listClusters" diff --git a/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json b/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json index 574207f2c4ac..11c25ca9ac4a 100644 --- a/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json +++ b/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json @@ -41,6 +41,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "GetClusterCertificateAuthority": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "ListClusters": { "timeout_millis": 600000, "retry_codes_name": "no_retry_1_codes", diff --git a/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php b/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php index e5d8665a28fc..686a9576bac4 100644 --- a/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php +++ b/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php @@ -93,6 +93,18 @@ ], ], ], + 'GetClusterCertificateAuthority' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Redis\Cluster\V1\CertificateAuthority', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'ListClusters' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -148,6 +160,7 @@ 'interfaceOverride' => 'google.cloud.location.Locations', ], 'templateMap' => [ + 'certificateAuthority' => 'projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority', 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', 'location' => 'projects/{project}/locations/{location}', ], diff --git a/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php b/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php index 115039ea6b92..69fe4ba287c9 100644 --- a/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php +++ b/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php @@ -84,6 +84,17 @@ ], ], ], + 'GetClusterCertificateAuthority' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/certificateAuthority}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'ListClusters' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', diff --git a/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php b/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php index 570744dc9f19..8c5d0fb49197 100644 --- a/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php +++ b/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php @@ -24,21 +24,23 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\Cloud\Redis\Cluster\V1\CertificateAuthority; use Google\Cloud\Redis\Cluster\V1\Client\CloudRedisClusterClient; use Google\Cloud\Redis\Cluster\V1\Cluster; use Google\Cloud\Redis\Cluster\V1\CreateClusterRequest; use Google\Cloud\Redis\Cluster\V1\DeleteClusterRequest; +use Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest; use Google\Cloud\Redis\Cluster\V1\GetClusterRequest; use Google\Cloud\Redis\Cluster\V1\ListClustersRequest; use Google\Cloud\Redis\Cluster\V1\ListClustersResponse; use Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -103,12 +105,16 @@ public function createClusterTest() $replicaCount = 564075208; $sizeGb = 2105542105; $shardCount = 495377042; + $preciseSizeGb = 1.3422684e8; + $deletionProtectionEnabled = true; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); $expectedResponse->setReplicaCount($replicaCount); $expectedResponse->setSizeGb($sizeGb); $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -371,12 +377,16 @@ public function getClusterTest() $replicaCount = 564075208; $sizeGb = 2105542105; $shardCount = 495377042; + $preciseSizeGb = 1.3422684e8; + $deletionProtectionEnabled = true; $expectedResponse = new Cluster(); $expectedResponse->setName($name2); $expectedResponse->setUid($uid); $expectedResponse->setReplicaCount($replicaCount); $expectedResponse->setSizeGb($sizeGb); $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); @@ -430,6 +440,74 @@ public function getClusterExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getClusterCertificateAuthorityTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new CertificateAuthority(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterCertificateAuthorityRequest())->setName($formattedName); + $response = $gapicClient->getClusterCertificateAuthority($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.redis.cluster.v1.CloudRedisCluster/GetClusterCertificateAuthority', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterCertificateAuthorityExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterCertificateAuthorityRequest())->setName($formattedName); + try { + $gapicClient->getClusterCertificateAuthority($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listClustersTest() { @@ -527,12 +605,16 @@ public function updateClusterTest() $replicaCount = 564075208; $sizeGb = 2105542105; $shardCount = 495377042; + $preciseSizeGb = 1.3422684e8; + $deletionProtectionEnabled = true; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); $expectedResponse->setReplicaCount($replicaCount); $expectedResponse->setSizeGb($sizeGb); $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -803,12 +885,16 @@ public function createClusterAsyncTest() $replicaCount = 564075208; $sizeGb = 2105542105; $shardCount = 495377042; + $preciseSizeGb = 1.3422684e8; + $deletionProtectionEnabled = true; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); $expectedResponse->setReplicaCount($replicaCount); $expectedResponse->setSizeGb($sizeGb); $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); diff --git a/ResourceManager/.repo-metadata.json b/ResourceManager/.repo-metadata.json deleted file mode 100644 index 1148b5d116c9..000000000000 --- a/ResourceManager/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-resource-manager", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-resource-manager/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudresourcemanager" -} diff --git a/ResourceManager/VERSION b/ResourceManager/VERSION index ee94dd834b53..7ada0d303f3e 100644 --- a/ResourceManager/VERSION +++ b/ResourceManager/VERSION @@ -1 +1 @@ -0.8.3 +0.8.5 diff --git a/ResourceManager/composer.json b/ResourceManager/composer.json index daf253b5a51b..7f2643b8eb78 100644 --- a/ResourceManager/composer.json +++ b/ResourceManager/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ResourceSettings/.repo-metadata.json b/ResourceSettings/.repo-metadata.json deleted file mode 100644 index efd81f6f0740..000000000000 --- a/ResourceSettings/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-resource-settings", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-resource-settings/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "resourcesettings" -} diff --git a/ResourceSettings/VERSION b/ResourceSettings/VERSION index 0495c4a88cae..3c43790f5d82 100644 --- a/ResourceSettings/VERSION +++ b/ResourceSettings/VERSION @@ -1 +1 @@ -1.2.3 +1.2.6 diff --git a/ResourceSettings/composer.json b/ResourceSettings/composer.json index 34ebaa2db145..bdf76b88b6f9 100644 --- a/ResourceSettings/composer.json +++ b/ResourceSettings/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ResourceSettings/metadata/V1/ResourceSettings.php b/ResourceSettings/metadata/V1/ResourceSettings.php index 978b2e87241f3a684cf11d66656a8c0589d12f7c..0ddd1d8f7c88c52b096800ab85dfa2b2b8b3fc65 100644 GIT binary patch delta 38 ucmaDM`&xFxEhff;n{PAOu`~YJEXAeH%pTUk#CXb4e)0qs`OPW3EsOvn5DhQ@ delta 35 rcmaDY`$BfZEhff&n{PAOu`~YMEXAeH%o2RcQGW6S7WvKTye*6X|8NYP diff --git a/ResourceSettings/samples/V1/ResourceSettingsServiceClient/get_setting.php b/ResourceSettings/samples/V1/ResourceSettingsServiceClient/get_setting.php index 383b62101fcb..d09a9930816d 100644 --- a/ResourceSettings/samples/V1/ResourceSettingsServiceClient/get_setting.php +++ b/ResourceSettings/samples/V1/ResourceSettingsServiceClient/get_setting.php @@ -34,7 +34,8 @@ * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the * setting does not exist. * - * @param string $formattedName The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * @param string $formattedName The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming * requirements. Please see * {@see ResourceSettingsServiceClient::settingName()} for help formatting this field. */ diff --git a/ResourceSettings/samples/V1/ResourceSettingsServiceClient/list_settings.php b/ResourceSettings/samples/V1/ResourceSettingsServiceClient/list_settings.php index 53580af9b606..3f444af5b71d 100644 --- a/ResourceSettings/samples/V1/ResourceSettingsServiceClient/list_settings.php +++ b/ResourceSettings/samples/V1/ResourceSettingsServiceClient/list_settings.php @@ -32,8 +32,8 @@ /** * Lists all the settings that are available on the Cloud resource `parent`. * - * @param string $parent The Cloud resource that parents the setting. Must be in one of the - * following forms: + * @param string $parent The Cloud resource that parents the setting. Must be in one of + * the following forms: * * * `projects/{project_number}` * * `projects/{project_id}` diff --git a/ResourceSettings/src/V1/Client/ResourceSettingsServiceClient.php b/ResourceSettings/src/V1/Client/ResourceSettingsServiceClient.php index bce2a4ead91e..6d5483bb3dfe 100644 --- a/ResourceSettings/src/V1/Client/ResourceSettingsServiceClient.php +++ b/ResourceSettings/src/V1/Client/ResourceSettingsServiceClient.php @@ -52,6 +52,9 @@ * resource is not in a Cloud Organization. * For all requests, returns a `google.rpc.Status` with * `google.rpc.Code.INVALID_ARGUMENT` if the request is malformed. + * (== deprecation_description Resource Settings is deprecated. As of November + * 7, 2023, no organizations will be onboarded for any of the enabled settings, + * and the service will be shut down on October 1, 2024. ==) * * This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. @@ -61,6 +64,8 @@ * name, and additionally a parseName method to extract the individual identifiers * contained within formatted names that are returned by the API. * + * @deprecated This class will be removed in the next major version update. + * * @method PromiseInterface getSettingAsync(GetSettingRequest $request, array $optionalArgs = []) * @method PromiseInterface listSettingsAsync(ListSettingsRequest $request, array $optionalArgs = []) * @method PromiseInterface updateSettingAsync(UpdateSettingRequest $request, array $optionalArgs = []) diff --git a/ResourceSettings/src/V1/Gapic/ResourceSettingsServiceGapicClient.php b/ResourceSettings/src/V1/Gapic/ResourceSettingsServiceGapicClient.php index 81b66a825428..735b280de306 100644 --- a/ResourceSettings/src/V1/Gapic/ResourceSettingsServiceGapicClient.php +++ b/ResourceSettings/src/V1/Gapic/ResourceSettingsServiceGapicClient.php @@ -53,6 +53,9 @@ * resource is not in a Cloud Organization. * For all requests, returns a `google.rpc.Status` with * `google.rpc.Code.INVALID_ARGUMENT` if the request is malformed. + * (== deprecation_description Resource Settings is deprecated. As of November + * 7, 2023, no organizations will be onboarded for any of the enabled settings, + * and the service will be shut down on October 1, 2024. ==) * * This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -395,7 +398,8 @@ public function __construct(array $options = []) * } * ``` * - * @param string $name Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * @param string $name Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming * requirements. * @param array $optionalArgs { * Optional. @@ -463,8 +467,8 @@ public function getSetting($name, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The Cloud resource that parents the setting. Must be in one of the - * following forms: + * @param string $parent Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: * * * `projects/{project_number}` * * `projects/{project_id}` @@ -556,7 +560,8 @@ public function listSettings($parent, array $optionalArgs = []) * } * ``` * - * @param Setting $setting Required. The setting to update. See [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. + * @param Setting $setting Required. The setting to update. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. * @param array $optionalArgs { * Optional. * diff --git a/ResourceSettings/src/V1/GetSettingRequest.php b/ResourceSettings/src/V1/GetSettingRequest.php index 7bf36eeab4c8..4e9469b716bd 100644 --- a/ResourceSettings/src/V1/GetSettingRequest.php +++ b/ResourceSettings/src/V1/GetSettingRequest.php @@ -16,7 +16,8 @@ class GetSettingRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming * requirements. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -30,7 +31,8 @@ class GetSettingRequest extends \Google\Protobuf\Internal\Message private $view = 0; /** - * @param string $name Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * @param string $name Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming * requirements. Please see * {@see ResourceSettingsServiceClient::settingName()} for help formatting this field. * @@ -51,7 +53,8 @@ public static function build(string $name): self * Optional. Data for populating the Message object. * * @type string $name - * Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming * requirements. * @type int $view * The SettingView for this request. @@ -63,7 +66,8 @@ public function __construct($data = NULL) { } /** - * Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming * requirements. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -75,7 +79,8 @@ public function getName() } /** - * Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming + * Required. The name of the setting to get. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for naming * requirements. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { diff --git a/ResourceSettings/src/V1/ListSettingsRequest.php b/ResourceSettings/src/V1/ListSettingsRequest.php index da218cbb94b9..869cbbe3267f 100644 --- a/ResourceSettings/src/V1/ListSettingsRequest.php +++ b/ResourceSettings/src/V1/ListSettingsRequest.php @@ -16,8 +16,8 @@ class ListSettingsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The Cloud resource that parents the setting. Must be in one of the - * following forms: + * Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: * * `projects/{project_number}` * * `projects/{project_id}` * * `folders/{folder_id}` @@ -46,8 +46,8 @@ class ListSettingsRequest extends \Google\Protobuf\Internal\Message private $view = 0; /** - * @param string $parent Required. The Cloud resource that parents the setting. Must be in one of the - * following forms: + * @param string $parent Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: * * * `projects/{project_number}` * * `projects/{project_id}` @@ -71,8 +71,8 @@ public static function build(string $parent): self * Optional. Data for populating the Message object. * * @type string $parent - * Required. The Cloud resource that parents the setting. Must be in one of the - * following forms: + * Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: * * `projects/{project_number}` * * `projects/{project_id}` * * `folders/{folder_id}` @@ -91,8 +91,8 @@ public function __construct($data = NULL) { } /** - * Required. The Cloud resource that parents the setting. Must be in one of the - * following forms: + * Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: * * `projects/{project_number}` * * `projects/{project_id}` * * `folders/{folder_id}` @@ -107,8 +107,8 @@ public function getParent() } /** - * Required. The Cloud resource that parents the setting. Must be in one of the - * following forms: + * Required. The Cloud resource that parents the setting. Must be in one of + * the following forms: * * `projects/{project_number}` * * `projects/{project_id}` * * `folders/{folder_id}` diff --git a/ResourceSettings/src/V1/Setting.php b/ResourceSettings/src/V1/Setting.php index 77f510c0f6f1..88d798f2e288 100644 --- a/ResourceSettings/src/V1/Setting.php +++ b/ResourceSettings/src/V1/Setting.php @@ -26,39 +26,45 @@ class Setting extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Output only. Metadata about a setting which is not editable by the end user. + * Output only. Metadata about a setting which is not editable by the end + * user. * * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $metadata = null; /** * The configured value of the setting at the given parent resource (ignoring - * the resource hierarchy). The data type of [Value][google.cloud.resourcesettings.v1.Value] must always be - * consistent with the data type defined in [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * the resource hierarchy). The data type of + * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent + * with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Value local_value = 8; */ private $local_value = null; /** - * Output only. The computed effective value of the setting at the given parent resource - * (based on the resource hierarchy). + * Output only. The computed effective value of the setting at the given + * parent resource (based on the resource hierarchy). * The effective value evaluates to one of the following options in the given * order (the next option is used if the previous one does not exist): - * 1. the local setting value on the given resource: [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] + * 1. the local setting value on the given resource: + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] * 2. if one of the given resource's ancestors have a local setting value, * the local value at the nearest such ancestor - * 3. the setting's default value: [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] + * 3. the setting's default value: + * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] * 4. an empty value (defined as a `Value` with all fields unset) - * The data type of [Value][google.cloud.resourcesettings.v1.Value] must always be - * consistent with the data type defined in [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * The data type of [Value][google.cloud.resourcesettings.v1.Value] must + * always be consistent with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Value effective_value = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $effective_value = null; /** * A fingerprint used for optimistic concurrency. See - * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] for more - * details. + * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] + * for more details. * * Generated from protobuf field string etag = 10; */ @@ -77,27 +83,33 @@ class Setting extends \Google\Protobuf\Internal\Message * * `organizations/{organization_id}/settings/{setting_name}` * For example, "/projects/123/settings/gcp-enableMyFeature" * @type \Google\Cloud\ResourceSettings\V1\SettingMetadata $metadata - * Output only. Metadata about a setting which is not editable by the end user. + * Output only. Metadata about a setting which is not editable by the end + * user. * @type \Google\Cloud\ResourceSettings\V1\Value $local_value * The configured value of the setting at the given parent resource (ignoring - * the resource hierarchy). The data type of [Value][google.cloud.resourcesettings.v1.Value] must always be - * consistent with the data type defined in [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * the resource hierarchy). The data type of + * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent + * with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. * @type \Google\Cloud\ResourceSettings\V1\Value $effective_value - * Output only. The computed effective value of the setting at the given parent resource - * (based on the resource hierarchy). + * Output only. The computed effective value of the setting at the given + * parent resource (based on the resource hierarchy). * The effective value evaluates to one of the following options in the given * order (the next option is used if the previous one does not exist): - * 1. the local setting value on the given resource: [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] + * 1. the local setting value on the given resource: + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] * 2. if one of the given resource's ancestors have a local setting value, * the local value at the nearest such ancestor - * 3. the setting's default value: [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] + * 3. the setting's default value: + * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] * 4. an empty value (defined as a `Value` with all fields unset) - * The data type of [Value][google.cloud.resourcesettings.v1.Value] must always be - * consistent with the data type defined in [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * The data type of [Value][google.cloud.resourcesettings.v1.Value] must + * always be consistent with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. * @type string $etag * A fingerprint used for optimistic concurrency. See - * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] for more - * details. + * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] + * for more details. * } */ public function __construct($data = NULL) { @@ -140,7 +152,8 @@ public function setName($var) } /** - * Output only. Metadata about a setting which is not editable by the end user. + * Output only. Metadata about a setting which is not editable by the end + * user. * * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\ResourceSettings\V1\SettingMetadata|null @@ -161,7 +174,8 @@ public function clearMetadata() } /** - * Output only. Metadata about a setting which is not editable by the end user. + * Output only. Metadata about a setting which is not editable by the end + * user. * * Generated from protobuf field .google.cloud.resourcesettings.v1.SettingMetadata metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\ResourceSettings\V1\SettingMetadata $var @@ -177,8 +191,10 @@ public function setMetadata($var) /** * The configured value of the setting at the given parent resource (ignoring - * the resource hierarchy). The data type of [Value][google.cloud.resourcesettings.v1.Value] must always be - * consistent with the data type defined in [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * the resource hierarchy). The data type of + * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent + * with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Value local_value = 8; * @return \Google\Cloud\ResourceSettings\V1\Value|null @@ -200,8 +216,10 @@ public function clearLocalValue() /** * The configured value of the setting at the given parent resource (ignoring - * the resource hierarchy). The data type of [Value][google.cloud.resourcesettings.v1.Value] must always be - * consistent with the data type defined in [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * the resource hierarchy). The data type of + * [Value][google.cloud.resourcesettings.v1.Value] must always be consistent + * with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Value local_value = 8; * @param \Google\Cloud\ResourceSettings\V1\Value $var @@ -216,17 +234,20 @@ public function setLocalValue($var) } /** - * Output only. The computed effective value of the setting at the given parent resource - * (based on the resource hierarchy). + * Output only. The computed effective value of the setting at the given + * parent resource (based on the resource hierarchy). * The effective value evaluates to one of the following options in the given * order (the next option is used if the previous one does not exist): - * 1. the local setting value on the given resource: [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] + * 1. the local setting value on the given resource: + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] * 2. if one of the given resource's ancestors have a local setting value, * the local value at the nearest such ancestor - * 3. the setting's default value: [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] + * 3. the setting's default value: + * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] * 4. an empty value (defined as a `Value` with all fields unset) - * The data type of [Value][google.cloud.resourcesettings.v1.Value] must always be - * consistent with the data type defined in [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * The data type of [Value][google.cloud.resourcesettings.v1.Value] must + * always be consistent with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Value effective_value = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\ResourceSettings\V1\Value|null @@ -247,17 +268,20 @@ public function clearEffectiveValue() } /** - * Output only. The computed effective value of the setting at the given parent resource - * (based on the resource hierarchy). + * Output only. The computed effective value of the setting at the given + * parent resource (based on the resource hierarchy). * The effective value evaluates to one of the following options in the given * order (the next option is used if the previous one does not exist): - * 1. the local setting value on the given resource: [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] + * 1. the local setting value on the given resource: + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value] * 2. if one of the given resource's ancestors have a local setting value, * the local value at the nearest such ancestor - * 3. the setting's default value: [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] + * 3. the setting's default value: + * [SettingMetadata.default_value][google.cloud.resourcesettings.v1.SettingMetadata.default_value] * 4. an empty value (defined as a `Value` with all fields unset) - * The data type of [Value][google.cloud.resourcesettings.v1.Value] must always be - * consistent with the data type defined in [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. + * The data type of [Value][google.cloud.resourcesettings.v1.Value] must + * always be consistent with the data type defined in + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata]. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Value effective_value = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\ResourceSettings\V1\Value $var @@ -273,8 +297,8 @@ public function setEffectiveValue($var) /** * A fingerprint used for optimistic concurrency. See - * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] for more - * details. + * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] + * for more details. * * Generated from protobuf field string etag = 10; * @return string @@ -286,8 +310,8 @@ public function getEtag() /** * A fingerprint used for optimistic concurrency. See - * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] for more - * details. + * [UpdateSetting][google.cloud.resourcesettings.v1.ResourceSettingsService.UpdateSetting] + * for more details. * * Generated from protobuf field string etag = 10; * @param string $var diff --git a/ResourceSettings/src/V1/SettingMetadata.php b/ResourceSettings/src/V1/SettingMetadata.php index 1d7faac979f7..cf7f941b300f 100644 --- a/ResourceSettings/src/V1/SettingMetadata.php +++ b/ResourceSettings/src/V1/SettingMetadata.php @@ -41,8 +41,9 @@ class SettingMetadata extends \Google\Protobuf\Internal\Message */ private $data_type = 0; /** - * The value provided by [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] if no setting value is - * explicitly set. + * The value provided by + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] + * if no setting value is explicitly set. * Note: not all settings have a default value. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Value default_value = 5; @@ -65,8 +66,9 @@ class SettingMetadata extends \Google\Protobuf\Internal\Message * @type int $data_type * The data type for this setting. * @type \Google\Cloud\ResourceSettings\V1\Value $default_value - * The value provided by [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] if no setting value is - * explicitly set. + * The value provided by + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] + * if no setting value is explicitly set. * Note: not all settings have a default value. * } */ @@ -182,8 +184,9 @@ public function setDataType($var) } /** - * The value provided by [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] if no setting value is - * explicitly set. + * The value provided by + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] + * if no setting value is explicitly set. * Note: not all settings have a default value. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Value default_value = 5; @@ -205,8 +208,9 @@ public function clearDefaultValue() } /** - * The value provided by [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] if no setting value is - * explicitly set. + * The value provided by + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] + * if no setting value is explicitly set. * Note: not all settings have a default value. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Value default_value = 5; diff --git a/ResourceSettings/src/V1/SettingMetadata/DataType.php b/ResourceSettings/src/V1/SettingMetadata/DataType.php index ee1b2fa553c5..69a636bedaa5 100644 --- a/ResourceSettings/src/V1/SettingMetadata/DataType.php +++ b/ResourceSettings/src/V1/SettingMetadata/DataType.php @@ -7,8 +7,9 @@ use UnexpectedValueException; /** - * The data type for setting values of this setting. See [Value][google.cloud.resourcesettings.v1.Value] for more - * details on the available data types. + * The data type for setting values of this setting. See + * [Value][google.cloud.resourcesettings.v1.Value] for more details on the + * available data types. * * Protobuf type google.cloud.resourcesettings.v1.SettingMetadata.DataType */ diff --git a/ResourceSettings/src/V1/SettingView.php b/ResourceSettings/src/V1/SettingView.php index f20206bdce88..80dad94f8b5f 100644 --- a/ResourceSettings/src/V1/SettingView.php +++ b/ResourceSettings/src/V1/SettingView.php @@ -21,20 +21,26 @@ class SettingView */ const SETTING_VIEW_UNSPECIFIED = 0; /** - * Include [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata], but nothing else. - * This is the default value (for both ListSettings and GetSetting). + * Include + * [Setting.metadata][google.cloud.resourcesettings.v1.Setting.metadata], but + * nothing else. This is the default value (for both ListSettings and + * GetSetting). * * Generated from protobuf enum SETTING_VIEW_BASIC = 1; */ const SETTING_VIEW_BASIC = 1; /** - * Include [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value], but nothing else. + * Include + * [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value], + * but nothing else. * * Generated from protobuf enum SETTING_VIEW_EFFECTIVE_VALUE = 2; */ const SETTING_VIEW_EFFECTIVE_VALUE = 2; /** - * Include [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value], but nothing else. + * Include + * [Setting.local_value][google.cloud.resourcesettings.v1.Setting.local_value], + * but nothing else. * * Generated from protobuf enum SETTING_VIEW_LOCAL_VALUE = 3; */ diff --git a/ResourceSettings/src/V1/UpdateSettingRequest.php b/ResourceSettings/src/V1/UpdateSettingRequest.php index 7552b423dfa0..e3f37d99cb30 100644 --- a/ResourceSettings/src/V1/UpdateSettingRequest.php +++ b/ResourceSettings/src/V1/UpdateSettingRequest.php @@ -16,7 +16,8 @@ class UpdateSettingRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The setting to update. See [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. + * Required. The setting to update. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Setting setting = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -29,7 +30,8 @@ class UpdateSettingRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\ResourceSettings\V1\Setting $setting - * Required. The setting to update. See [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. + * Required. The setting to update. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. * } */ public function __construct($data = NULL) { @@ -38,7 +40,8 @@ public function __construct($data = NULL) { } /** - * Required. The setting to update. See [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. + * Required. The setting to update. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Setting setting = 1 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Cloud\ResourceSettings\V1\Setting|null @@ -59,7 +62,8 @@ public function clearSetting() } /** - * Required. The setting to update. See [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. + * Required. The setting to update. See + * [Setting][google.cloud.resourcesettings.v1.Setting] for field requirements. * * Generated from protobuf field .google.cloud.resourcesettings.v1.Setting setting = 1 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Cloud\ResourceSettings\V1\Setting $var diff --git a/Retail/.repo-metadata.json b/Retail/.repo-metadata.json deleted file mode 100644 index 254902988047..000000000000 --- a/Retail/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-retail", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-retail/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "retail" -} diff --git a/Retail/VERSION b/Retail/VERSION index fdd3be6df54a..bd8bf882d061 100644 --- a/Retail/VERSION +++ b/Retail/VERSION @@ -1 +1 @@ -1.6.2 +1.7.0 diff --git a/Retail/composer.json b/Retail/composer.json index 4b1701d1153b..b73434ef5db9 100644 --- a/Retail/composer.json +++ b/Retail/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Retail/metadata/V2/Catalog.php b/Retail/metadata/V2/Catalog.php index 469b6ef38c33339a3125744a6d52a5009289b8c5..b421b2082c35c38f63489d95268a0fa9689a9869 100644 GIT binary patch delta 739 zcmaDU`(I_lT&Bt5Od>)7MfoN9Nu_BqA(^?U#U+Wk1(O+>#3s*W(q~#NH~AdXDrqVC z^!)tvoK*b+s8anBxY8o#bf)k8n{P9FF-Zt{aq*-jCa0FfC+Fv-Wu{B;Dllqr8<|WF z;FXyCo<-2i4J7FdmXmtP%EgVu7qaByhv?1BD@iRXOUx;jU{qiRYF7Yh*YJdj3Z-(1 zWTxlk7p11eL(~J6mZla|F<#W&<3Wg(A3ki&Bdc^Ri*##0u8v2-8@PtT70z5*lbt zj9fxkJj2Ju1`P#JkZ}s>ad817vZy2;6i>jA0mXup9wZX=V3DW?k8dFzE{@c^6o_hO z1;%>(%B3v01Tew^-3cP_umQUa>n huL}VUga%p~C=~&fF=}vtM8Vv6q*TDUS(WVw2LMu*=urRw delta 35 tcmV+;0NnroBa|EmMU=Z@<5-v*3%`Zzu)y@mnt_Ri59RyYa*16e^O_a$|>Kr4N z7internalAddGeneratedFile( ' -ý -/google/cloud/retail/v2/completion_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/retail/v2/common.proto*google/cloud/retail/v2/import_config.proto#google/longrunning/operations.proto"Ý +« +/google/cloud/retail/v2/completion_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/retail/v2/common.proto*google/cloud/retail/v2/import_config.proto#google/longrunning/operations.proto"ƒ CompleteQueryRequest6 catalog ( B%àAúA retail.googleapis.com/Catalog @@ -34,13 +34,14 @@ public static function initOnce() { language_codes (  device_type (  dataset (  -max_suggestions ( +max_suggestions ($ +enable_attribute_suggestions ( entity - ( "… + ( " CompleteQueryResponseZ completion_results ( 2>.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult -attribution_token ( _ -recent_search_results ( 2@.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultæ +attribution_token ( c +recent_search_results ( 2@.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultBæ CompletionResult suggestion ( b @@ -48,9 +49,9 @@ public static function initOnce() { attributes ( 2N.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.AttributesEntryZ AttributesEntry key ( 6 -value ( 2\'.google.cloud.retail.v2.CustomAttribute:8+ +value ( 2\'.google.cloud.retail.v2.CustomAttribute:8/ RecentSearchResult - recent_search ( 2² + recent_search ( :2² CompletionService³ CompleteQuery,.google.cloud.retail.v2.CompleteQueryRequest-.google.cloud.retail.v2.CompleteQueryResponse"E‚Óä“?=/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery› ImportCompletionData3.google.cloud.retail.v2.ImportCompletionDataRequest.google.longrunning.Operation"®ÊA\\ diff --git a/Retail/metadata/V2/Model.php b/Retail/metadata/V2/Model.php index 5c42900891d77e53c775d20e3eb75afeae4fa750..bd179dbbd43becebfe2646601adcba7477d6134e 100644 GIT binary patch delta 471 zcmeAcZV=zFkBRBKz~lo=^O&adZBAh3U{(|g#rs2Ai3;R6UoPTTyCZX=+|cPNh?RX?jLU zNPc>1Nk(cBsveMKK+{W7D@x)Eit04fP4}48W8P7GScinternalAddGeneratedFile( ' -Õ, -,google/cloud/retail/v2/product_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/retail/v2/common.proto*google/cloud/retail/v2/import_config.proto$google/cloud/retail/v2/product.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"œ +”/ +,google/cloud/retail/v2/product_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/retail/v2/common.proto*google/cloud/retail/v2/import_config.proto$google/cloud/retail/v2/product.proto)google/cloud/retail/v2/purge_config.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"œ CreateProductRequest4 parent ( B$àAúA retail.googleapis.com/Branch5 @@ -97,14 +98,16 @@ public static function initOnce() { remove_time ( 2.google.protobuf.Timestamp allow_missing ("! RemoveFulfillmentPlacesMetadata"! -RemoveFulfillmentPlacesResponse2® +RemoveFulfillmentPlacesResponse2 ProductServiceÏ CreateProduct,.google.cloud.retail.v2.CreateProductRequest.google.cloud.retail.v2.Product"oÚAparent,product,product_id‚Óä“M"B/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:product¬ GetProduct).google.cloud.retail.v2.GetProductRequest.google.cloud.retail.v2.Product"RÚAname‚Óä“EC/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}¾ ListProducts+.google.cloud.retail.v2.ListProductsRequest,.google.cloud.retail.v2.ListProductsResponse"SÚAparent‚Óä“DB/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/productsÒ UpdateProduct,.google.cloud.retail.v2.UpdateProductRequest.google.cloud.retail.v2.Product"rÚAproduct,update_mask‚Óä“V2K/v2/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:product© - DeleteProduct,.google.cloud.retail.v2.DeleteProductRequest.google.protobuf.Empty"RÚAname‚Óä“E*C/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}Ž + DeleteProduct,.google.cloud.retail.v2.DeleteProductRequest.google.protobuf.Empty"RÚAname‚Óä“E*C/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}‘ + PurgeProducts,.google.cloud.retail.v2.PurgeProductsRequest.google.longrunning.Operation"²ÊA\\ +,google.cloud.retail.v2.PurgeProductsResponse,google.cloud.retail.v2.PurgeProductsMetadata‚Óä“M"H/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge:*Ž ImportProducts-.google.cloud.retail.v2.ImportProductsRequest.google.longrunning.Operation"­ÊAV -google.cloud.retail.v2.ImportProductsResponse%google.cloud.retail.v2.ImportMetadata‚Óä“N"I/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import:*´ SetInventory+.google.cloud.retail.v2.SetInventoryRequest.google.longrunning.Operation"×ÊAZ diff --git a/Retail/metadata/V2/PurgeConfig.php b/Retail/metadata/V2/PurgeConfig.php index bf1a8fe3f65f..aadd07c3e56f 100644 --- a/Retail/metadata/V2/PurgeConfig.php +++ b/Retail/metadata/V2/PurgeConfig.php @@ -16,11 +16,26 @@ public static function initOnce() { } \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); + \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -â -)google/cloud/retail/v2/purge_config.protogoogle.cloud.retail.v2google/api/resource.proto" - PurgeMetadata"s +‡ +)google/cloud/retail/v2/purge_config.protogoogle.cloud.retail.v2google/api/resource.protogoogle/protobuf/timestamp.proto" + PurgeMetadata"§ +PurgeProductsMetadata/ + create_time ( 2.google.protobuf.Timestamp/ + update_time ( 2.google.protobuf.Timestamp + success_count ( + failure_count ("p +PurgeProductsRequest4 +parent ( B$àAúA +retail.googleapis.com/Branch +filter ( BàA +force ("f +PurgeProductsResponse + purge_count (8 + purge_sample ( B"úA +retail.googleapis.com/Product"s PurgeUserEventsRequest5 parent ( B%àAúA retail.googleapis.com/Catalog diff --git a/Retail/metadata/V2/ServingConfig.php b/Retail/metadata/V2/ServingConfig.php index 5203a953114607438366b62f30f9d50d26781803..77ff7ac9d3ee6060672264dcddcb7498ef5c9abc 100644 GIT binary patch delta 57 zcmbO!xLt6=EheVP+>`GxZDyLrv3VkM4wI}5mq=!MUVc$(d{Jt0aePW@US&>ZafyV4 N0;2}U=0B`+nE*;?6P^G7 delta 27 jcmdlkI8$)LEheU~T$ArGZD#txzIh^Z4%237wmD1yokR*u diff --git a/Retail/samples/V2/PredictionServiceClient/predict.php b/Retail/samples/V2/PredictionServiceClient/predict.php index 03b3f78cc49d..069f6b7547dc 100644 --- a/Retail/samples/V2/PredictionServiceClient/predict.php +++ b/Retail/samples/V2/PredictionServiceClient/predict.php @@ -49,6 +49,7 @@ * @param string $userEventEventType User event type. Allowed values are: * * * `add-to-cart`: Products being added to cart. + * * `remove-from-cart`: Products being removed from cart. * * `category-page-view`: Special pages such as sale or promotion pages * viewed. * * `detail-page-view`: Products detail page viewed. diff --git a/Retail/samples/V2/ProductServiceClient/add_fulfillment_places.php b/Retail/samples/V2/ProductServiceClient/add_fulfillment_places.php index 5c5804efbde0..8e86a1f28e91 100644 --- a/Retail/samples/V2/ProductServiceClient/add_fulfillment_places.php +++ b/Retail/samples/V2/ProductServiceClient/add_fulfillment_places.php @@ -31,10 +31,11 @@ use Google\Rpc\Status; /** - * It is recommended to use the + * We recommend that you use the * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - * method instead of - * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]. + * method instead of the + * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] + * method. * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] * achieves the same results but provides more fine-grained control over * ingesting local inventory data. diff --git a/Retail/samples/V2/ProductServiceClient/purge_products.php b/Retail/samples/V2/ProductServiceClient/purge_products.php new file mode 100644 index 000000000000..93a27488aa8d --- /dev/null +++ b/Retail/samples/V2/ProductServiceClient/purge_products.php @@ -0,0 +1,147 @@ +", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + */ +function purge_products_sample(string $formattedParent, string $filter): void +{ + // Create a client. + $productServiceClient = new ProductServiceClient(); + + // Prepare the request message. + $request = (new PurgeProductsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $productServiceClient->purgeProducts($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var PurgeProductsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = ProductServiceClient::branchName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]', + '[BRANCH]' + ); + $filter = '[FILTER]'; + + purge_products_sample($formattedParent, $filter); +} +// [END retail_v2_generated_ProductService_PurgeProducts_sync] diff --git a/Retail/samples/V2/ProductServiceClient/remove_fulfillment_places.php b/Retail/samples/V2/ProductServiceClient/remove_fulfillment_places.php index 962a359aa191..56eefdd0a030 100644 --- a/Retail/samples/V2/ProductServiceClient/remove_fulfillment_places.php +++ b/Retail/samples/V2/ProductServiceClient/remove_fulfillment_places.php @@ -31,10 +31,11 @@ use Google\Rpc\Status; /** - * It is recommended to use the + * We recommend that you use the * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - * method instead of - * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. + * method instead of the + * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] + * method. * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] * achieves the same results but provides more fine-grained control over * ingesting local inventory data. diff --git a/Retail/samples/V2/SearchServiceClient/search.php b/Retail/samples/V2/SearchServiceClient/search.php index fa8605121e77..771ba5ad8dfb 100644 --- a/Retail/samples/V2/SearchServiceClient/search.php +++ b/Retail/samples/V2/SearchServiceClient/search.php @@ -40,7 +40,7 @@ * or the name of the legacy placement resource, such as * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param string $visitorId A unique identifier for tracking visitors. For example, this * could be implemented with an HTTP cookie, which should be able to uniquely * identify a visitor on a single device. This unique identifier should not diff --git a/Retail/samples/V2/UserEventServiceClient/import_user_events.php b/Retail/samples/V2/UserEventServiceClient/import_user_events.php index ac4cb1ee0c27..e42d5a4a318e 100644 --- a/Retail/samples/V2/UserEventServiceClient/import_user_events.php +++ b/Retail/samples/V2/UserEventServiceClient/import_user_events.php @@ -47,6 +47,7 @@ * @param string $inputConfigUserEventInlineSourceUserEventsEventType User event type. Allowed values are: * * * `add-to-cart`: Products being added to cart. + * * `remove-from-cart`: Products being removed from cart. * * `category-page-view`: Special pages such as sale or promotion pages * viewed. * * `detail-page-view`: Products detail page viewed. diff --git a/Retail/samples/V2/UserEventServiceClient/write_user_event.php b/Retail/samples/V2/UserEventServiceClient/write_user_event.php index f2c0f2982f24..8ad1def7af10 100644 --- a/Retail/samples/V2/UserEventServiceClient/write_user_event.php +++ b/Retail/samples/V2/UserEventServiceClient/write_user_event.php @@ -36,6 +36,7 @@ * @param string $userEventEventType User event type. Allowed values are: * * * `add-to-cart`: Products being added to cart. + * * `remove-from-cart`: Products being removed from cart. * * `category-page-view`: Special pages such as sale or promotion pages * viewed. * * `detail-page-view`: Products detail page viewed. diff --git a/Retail/src/V2/CatalogAttribute.php b/Retail/src/V2/CatalogAttribute.php index a6dcac38d081..49e8cb5a8175 100644 --- a/Retail/src/V2/CatalogAttribute.php +++ b/Retail/src/V2/CatalogAttribute.php @@ -69,7 +69,9 @@ class CatalogAttribute extends \Google\Protobuf\Internal\Message * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values * are indexed so that it can be filtered, faceted, or boosted in * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * Must be specified, otherwise throws INVALID_FORMAT error. + * Must be specified when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. * * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.IndexableOption indexable_option = 5; */ @@ -94,7 +96,9 @@ class CatalogAttribute extends \Google\Protobuf\Internal\Message * will not be searchable by text queries in * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as * there are no text values associated to numerical attributes. - * Must be specified, otherwise throws INVALID_FORMAT error. + * Must be specified, when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. * * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.SearchableOption searchable_option = 7; */ @@ -117,6 +121,12 @@ class CatalogAttribute extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.RetrievableOption retrievable_option = 12; */ private $retrievable_option = 0; + /** + * Contains facet options. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig facet_config = 13; + */ + private $facet_config = null; /** * Constructor. @@ -165,7 +175,9 @@ class CatalogAttribute extends \Google\Protobuf\Internal\Message * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values * are indexed so that it can be filtered, faceted, or boosted in * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * Must be specified, otherwise throws INVALID_FORMAT error. + * Must be specified when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. * @type int $dynamic_facetable_option * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic * facet. Could only be DYNAMIC_FACETABLE_DISABLED if @@ -182,7 +194,9 @@ class CatalogAttribute extends \Google\Protobuf\Internal\Message * will not be searchable by text queries in * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as * there are no text values associated to numerical attributes. - * Must be specified, otherwise throws INVALID_FORMAT error. + * Must be specified, when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. * @type int $exact_searchable_option * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. * This property only applies to textual custom attributes and requires @@ -193,6 +207,8 @@ class CatalogAttribute extends \Google\Protobuf\Internal\Message * If RETRIEVABLE_ENABLED, attribute values are retrievable in the search * results. If unset, the server behavior defaults to * [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. + * @type \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig $facet_config + * Contains facet options. * } */ public function __construct($data = NULL) { @@ -342,7 +358,9 @@ public function setType($var) * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values * are indexed so that it can be filtered, faceted, or boosted in * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * Must be specified, otherwise throws INVALID_FORMAT error. + * Must be specified when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. * * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.IndexableOption indexable_option = 5; * @return int @@ -358,7 +376,9 @@ public function getIndexableOption() * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values * are indexed so that it can be filtered, faceted, or boosted in * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. - * Must be specified, otherwise throws INVALID_FORMAT error. + * Must be specified when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. * * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.IndexableOption indexable_option = 5; * @param int $var @@ -416,7 +436,9 @@ public function setDynamicFacetableOption($var) * will not be searchable by text queries in * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as * there are no text values associated to numerical attributes. - * Must be specified, otherwise throws INVALID_FORMAT error. + * Must be specified, when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. * * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.SearchableOption searchable_option = 7; * @return int @@ -436,7 +458,9 @@ public function getSearchableOption() * will not be searchable by text queries in * [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as * there are no text values associated to numerical attributes. - * Must be specified, otherwise throws INVALID_FORMAT error. + * Must be specified, when + * [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. * * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.SearchableOption searchable_option = 7; * @param int $var @@ -514,5 +538,41 @@ public function setRetrievableOption($var) return $this; } + /** + * Contains facet options. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig facet_config = 13; + * @return \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig|null + */ + public function getFacetConfig() + { + return $this->facet_config; + } + + public function hasFacetConfig() + { + return isset($this->facet_config); + } + + public function clearFacetConfig() + { + unset($this->facet_config); + } + + /** + * Contains facet options. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig facet_config = 13; + * @param \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig $var + * @return $this + */ + public function setFacetConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig::class); + $this->facet_config = $var; + + return $this; + } + } diff --git a/Retail/src/V2/CatalogAttribute/FacetConfig.php b/Retail/src/V2/CatalogAttribute/FacetConfig.php new file mode 100644 index 000000000000..ea504a3bddc8 --- /dev/null +++ b/Retail/src/V2/CatalogAttribute/FacetConfig.php @@ -0,0 +1,313 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig + */ +class FacetConfig extends \Google\Protobuf\Internal\Message +{ + /** + * If you don't set the facet + * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] + * in the request to a numerical attribute, then we use the computed + * intervals with rounded bounds obtained from all its product numerical + * attribute values. The computed intervals might not be ideal for some + * attributes. Therefore, we give you the option to overwrite them with the + * facet_intervals field. The maximum of facet intervals per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each + * interval must have a lower bound or an upper bound. If both bounds are + * provided, then the lower bound must be smaller or equal than the upper + * bound. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Interval facet_intervals = 1; + */ + private $facet_intervals; + /** + * Each instance represents a list of attribute values to ignore as facet + * values for a specific time range. The maximum number of instances per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues ignored_facet_values = 2; + */ + private $ignored_facet_values; + /** + * Each instance replaces a list of facet values by a merged facet + * value. If a facet value is not in any list, then it will stay the same. + * To avoid conflicts, only paths of length 1 are accepted. In other words, + * if "dark_blue" merged into "BLUE", then the latter can't merge into + * "blues" because this would create a path of length 2. The maximum number + * of instances of MergedFacetValue per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This + * feature is available only for textual custom attributes. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue merged_facet_values = 3; + */ + private $merged_facet_values; + /** + * Use this field only if you want to merge a facet key into another facet + * key. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet merged_facet = 4; + */ + private $merged_facet = null; + /** + * Set this field only if you want to rerank based on facet values engaged + * by the user for the current key. This option is only possible for custom + * facetable textual keys. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig rerank_config = 5; + */ + private $rerank_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $facet_intervals + * If you don't set the facet + * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] + * in the request to a numerical attribute, then we use the computed + * intervals with rounded bounds obtained from all its product numerical + * attribute values. The computed intervals might not be ideal for some + * attributes. Therefore, we give you the option to overwrite them with the + * facet_intervals field. The maximum of facet intervals per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each + * interval must have a lower bound or an upper bound. If both bounds are + * provided, then the lower bound must be smaller or equal than the upper + * bound. + * @type array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\IgnoredFacetValues>|\Google\Protobuf\Internal\RepeatedField $ignored_facet_values + * Each instance represents a list of attribute values to ignore as facet + * values for a specific time range. The maximum number of instances per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. + * @type array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacetValue>|\Google\Protobuf\Internal\RepeatedField $merged_facet_values + * Each instance replaces a list of facet values by a merged facet + * value. If a facet value is not in any list, then it will stay the same. + * To avoid conflicts, only paths of length 1 are accepted. In other words, + * if "dark_blue" merged into "BLUE", then the latter can't merge into + * "blues" because this would create a path of length 2. The maximum number + * of instances of MergedFacetValue per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This + * feature is available only for textual custom attributes. + * @type \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet $merged_facet + * Use this field only if you want to merge a facet key into another facet + * key. + * @type \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig $rerank_config + * Set this field only if you want to rerank based on facet values engaged + * by the user for the current key. This option is only possible for custom + * facetable textual keys. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * If you don't set the facet + * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] + * in the request to a numerical attribute, then we use the computed + * intervals with rounded bounds obtained from all its product numerical + * attribute values. The computed intervals might not be ideal for some + * attributes. Therefore, we give you the option to overwrite them with the + * facet_intervals field. The maximum of facet intervals per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each + * interval must have a lower bound or an upper bound. If both bounds are + * provided, then the lower bound must be smaller or equal than the upper + * bound. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Interval facet_intervals = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacetIntervals() + { + return $this->facet_intervals; + } + + /** + * If you don't set the facet + * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] + * in the request to a numerical attribute, then we use the computed + * intervals with rounded bounds obtained from all its product numerical + * attribute values. The computed intervals might not be ideal for some + * attributes. Therefore, we give you the option to overwrite them with the + * facet_intervals field. The maximum of facet intervals per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each + * interval must have a lower bound or an upper bound. If both bounds are + * provided, then the lower bound must be smaller or equal than the upper + * bound. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Interval facet_intervals = 1; + * @param array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacetIntervals($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Interval::class); + $this->facet_intervals = $arr; + + return $this; + } + + /** + * Each instance represents a list of attribute values to ignore as facet + * values for a specific time range. The maximum number of instances per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues ignored_facet_values = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIgnoredFacetValues() + { + return $this->ignored_facet_values; + } + + /** + * Each instance represents a list of attribute values to ignore as facet + * values for a specific time range. The maximum number of instances per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues ignored_facet_values = 2; + * @param array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\IgnoredFacetValues>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIgnoredFacetValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\IgnoredFacetValues::class); + $this->ignored_facet_values = $arr; + + return $this; + } + + /** + * Each instance replaces a list of facet values by a merged facet + * value. If a facet value is not in any list, then it will stay the same. + * To avoid conflicts, only paths of length 1 are accepted. In other words, + * if "dark_blue" merged into "BLUE", then the latter can't merge into + * "blues" because this would create a path of length 2. The maximum number + * of instances of MergedFacetValue per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This + * feature is available only for textual custom attributes. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue merged_facet_values = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMergedFacetValues() + { + return $this->merged_facet_values; + } + + /** + * Each instance replaces a list of facet values by a merged facet + * value. If a facet value is not in any list, then it will stay the same. + * To avoid conflicts, only paths of length 1 are accepted. In other words, + * if "dark_blue" merged into "BLUE", then the latter can't merge into + * "blues" because this would create a path of length 2. The maximum number + * of instances of MergedFacetValue per + * [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This + * feature is available only for textual custom attributes. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue merged_facet_values = 3; + * @param array<\Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacetValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMergedFacetValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacetValue::class); + $this->merged_facet_values = $arr; + + return $this; + } + + /** + * Use this field only if you want to merge a facet key into another facet + * key. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet merged_facet = 4; + * @return \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet|null + */ + public function getMergedFacet() + { + return $this->merged_facet; + } + + public function hasMergedFacet() + { + return isset($this->merged_facet); + } + + public function clearMergedFacet() + { + unset($this->merged_facet); + } + + /** + * Use this field only if you want to merge a facet key into another facet + * key. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet merged_facet = 4; + * @param \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet $var + * @return $this + */ + public function setMergedFacet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet::class); + $this->merged_facet = $var; + + return $this; + } + + /** + * Set this field only if you want to rerank based on facet values engaged + * by the user for the current key. This option is only possible for custom + * facetable textual keys. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig rerank_config = 5; + * @return \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig|null + */ + public function getRerankConfig() + { + return $this->rerank_config; + } + + public function hasRerankConfig() + { + return isset($this->rerank_config); + } + + public function clearRerankConfig() + { + unset($this->rerank_config); + } + + /** + * Set this field only if you want to rerank based on facet values engaged + * by the user for the current key. This option is only possible for custom + * facetable textual keys. + * + * Generated from protobuf field .google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig rerank_config = 5; + * @param \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig $var + * @return $this + */ + public function setRerankConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig::class); + $this->rerank_config = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php b/Retail/src/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php new file mode 100644 index 000000000000..a90c0ad0386e --- /dev/null +++ b/Retail/src/V2/CatalogAttribute/FacetConfig/IgnoredFacetValues.php @@ -0,0 +1,200 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + */ +class IgnoredFacetValues extends \Google\Protobuf\Internal\Message +{ + /** + * List of facet values to ignore for the following time range. The facet + * values are the same as the attribute values. There is a limit of 10 + * values per instance of IgnoredFacetValues. Each value can have at most + * 128 characters. + * + * Generated from protobuf field repeated string values = 1; + */ + private $values; + /** + * Time range for the current list of facet values to ignore. + * If multiple time ranges are specified for an facet value for the + * current attribute, consider all of them. If both are empty, ignore + * always. If start time and end time are set, then start time + * must be before end time. + * If start time is not empty and end time is empty, then will ignore + * these facet values after the start time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + */ + private $start_time = null; + /** + * If start time is empty and end time is not empty, then ignore these + * facet values before end time. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + */ + private $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * List of facet values to ignore for the following time range. The facet + * values are the same as the attribute values. There is a limit of 10 + * values per instance of IgnoredFacetValues. Each value can have at most + * 128 characters. + * @type \Google\Protobuf\Timestamp $start_time + * Time range for the current list of facet values to ignore. + * If multiple time ranges are specified for an facet value for the + * current attribute, consider all of them. If both are empty, ignore + * always. If start time and end time are set, then start time + * must be before end time. + * If start time is not empty and end time is empty, then will ignore + * these facet values after the start time. + * @type \Google\Protobuf\Timestamp $end_time + * If start time is empty and end time is not empty, then ignore these + * facet values before end time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * List of facet values to ignore for the following time range. The facet + * values are the same as the attribute values. There is a limit of 10 + * values per instance of IgnoredFacetValues. Each value can have at most + * 128 characters. + * + * Generated from protobuf field repeated string values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * List of facet values to ignore for the following time range. The facet + * values are the same as the attribute values. There is a limit of 10 + * values per instance of IgnoredFacetValues. Each value can have at most + * 128 characters. + * + * Generated from protobuf field repeated string values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + + /** + * Time range for the current list of facet values to ignore. + * If multiple time ranges are specified for an facet value for the + * current attribute, consider all of them. If both are empty, ignore + * always. If start time and end time are set, then start time + * must be before end time. + * If start time is not empty and end time is empty, then will ignore + * these facet values after the start time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time range for the current list of facet values to ignore. + * If multiple time ranges are specified for an facet value for the + * current attribute, consider all of them. If both are empty, ignore + * always. If start time and end time are set, then start time + * must be before end time. + * If start time is not empty and end time is empty, then will ignore + * these facet values after the start time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * If start time is empty and end time is not empty, then ignore these + * facet values before end time. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * If start time is empty and end time is not empty, then ignore these + * facet values before end time. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/CatalogAttribute/FacetConfig/MergedFacet.php b/Retail/src/V2/CatalogAttribute/FacetConfig/MergedFacet.php new file mode 100644 index 000000000000..2a4dfc91cd80 --- /dev/null +++ b/Retail/src/V2/CatalogAttribute/FacetConfig/MergedFacet.php @@ -0,0 +1,92 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + */ +class MergedFacet extends \Google\Protobuf\Internal\Message +{ + /** + * The merged facet key should be a valid facet key that is different than + * the facet key of the current catalog attribute. We refer this is + * merged facet key as the child of the current catalog attribute. This + * merged facet key can't be a parent of another facet key (i.e. no + * directed path of length 2). This merged facet key needs to be either a + * textual custom attribute or a numerical custom attribute. + * + * Generated from protobuf field string merged_facet_key = 1; + */ + private $merged_facet_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $merged_facet_key + * The merged facet key should be a valid facet key that is different than + * the facet key of the current catalog attribute. We refer this is + * merged facet key as the child of the current catalog attribute. This + * merged facet key can't be a parent of another facet key (i.e. no + * directed path of length 2). This merged facet key needs to be either a + * textual custom attribute or a numerical custom attribute. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * The merged facet key should be a valid facet key that is different than + * the facet key of the current catalog attribute. We refer this is + * merged facet key as the child of the current catalog attribute. This + * merged facet key can't be a parent of another facet key (i.e. no + * directed path of length 2). This merged facet key needs to be either a + * textual custom attribute or a numerical custom attribute. + * + * Generated from protobuf field string merged_facet_key = 1; + * @return string + */ + public function getMergedFacetKey() + { + return $this->merged_facet_key; + } + + /** + * The merged facet key should be a valid facet key that is different than + * the facet key of the current catalog attribute. We refer this is + * merged facet key as the child of the current catalog attribute. This + * merged facet key can't be a parent of another facet key (i.e. no + * directed path of length 2). This merged facet key needs to be either a + * textual custom attribute or a numerical custom attribute. + * + * Generated from protobuf field string merged_facet_key = 1; + * @param string $var + * @return $this + */ + public function setMergedFacetKey($var) + { + GPBUtil::checkString($var, True); + $this->merged_facet_key = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php b/Retail/src/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php new file mode 100644 index 000000000000..2685affa32a3 --- /dev/null +++ b/Retail/src/V2/CatalogAttribute/FacetConfig/MergedFacetValue.php @@ -0,0 +1,121 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + */ +class MergedFacetValue extends \Google\Protobuf\Internal\Message +{ + /** + * All the facet values that are replaces by the same + * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + * that follows. The maximum number of values per MergedFacetValue is 25. + * Each value can have up to 128 characters. + * + * Generated from protobuf field repeated string values = 1; + */ + private $values; + /** + * All the previous values are replaced by this merged facet value. + * This merged_value must be non-empty and can have up to 128 characters. + * + * Generated from protobuf field string merged_value = 2; + */ + private $merged_value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * All the facet values that are replaces by the same + * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + * that follows. The maximum number of values per MergedFacetValue is 25. + * Each value can have up to 128 characters. + * @type string $merged_value + * All the previous values are replaced by this merged facet value. + * This merged_value must be non-empty and can have up to 128 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * All the facet values that are replaces by the same + * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + * that follows. The maximum number of values per MergedFacetValue is 25. + * Each value can have up to 128 characters. + * + * Generated from protobuf field repeated string values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * All the facet values that are replaces by the same + * [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + * that follows. The maximum number of values per MergedFacetValue is 25. + * Each value can have up to 128 characters. + * + * Generated from protobuf field repeated string values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + + /** + * All the previous values are replaced by this merged facet value. + * This merged_value must be non-empty and can have up to 128 characters. + * + * Generated from protobuf field string merged_value = 2; + * @return string + */ + public function getMergedValue() + { + return $this->merged_value; + } + + /** + * All the previous values are replaced by this merged facet value. + * This merged_value must be non-empty and can have up to 128 characters. + * + * Generated from protobuf field string merged_value = 2; + * @param string $var + * @return $this + */ + public function setMergedValue($var) + { + GPBUtil::checkString($var, True); + $this->merged_value = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/CatalogAttribute/FacetConfig/RerankConfig.php b/Retail/src/V2/CatalogAttribute/FacetConfig/RerankConfig.php new file mode 100644 index 000000000000..70a3fa2f4c8b --- /dev/null +++ b/Retail/src/V2/CatalogAttribute/FacetConfig/RerankConfig.php @@ -0,0 +1,121 @@ +google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + */ +class RerankConfig extends \Google\Protobuf\Internal\Message +{ + /** + * If set to true, then we also rerank the dynamic facets based on the + * facet values engaged by the user for the current attribute key during + * serving. + * + * Generated from protobuf field bool rerank_facet = 1; + */ + private $rerank_facet = false; + /** + * If empty, rerank on all facet values for the current key. Otherwise, + * will rerank on the facet values from this list only. + * + * Generated from protobuf field repeated string facet_values = 2; + */ + private $facet_values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $rerank_facet + * If set to true, then we also rerank the dynamic facets based on the + * facet values engaged by the user for the current attribute key during + * serving. + * @type array|\Google\Protobuf\Internal\RepeatedField $facet_values + * If empty, rerank on all facet values for the current key. Otherwise, + * will rerank on the facet values from this list only. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * If set to true, then we also rerank the dynamic facets based on the + * facet values engaged by the user for the current attribute key during + * serving. + * + * Generated from protobuf field bool rerank_facet = 1; + * @return bool + */ + public function getRerankFacet() + { + return $this->rerank_facet; + } + + /** + * If set to true, then we also rerank the dynamic facets based on the + * facet values engaged by the user for the current attribute key during + * serving. + * + * Generated from protobuf field bool rerank_facet = 1; + * @param bool $var + * @return $this + */ + public function setRerankFacet($var) + { + GPBUtil::checkBool($var); + $this->rerank_facet = $var; + + return $this; + } + + /** + * If empty, rerank on all facet values for the current key. Otherwise, + * will rerank on the facet values from this list only. + * + * Generated from protobuf field repeated string facet_values = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacetValues() + { + return $this->facet_values; + } + + /** + * If empty, rerank on all facet values for the current key. Otherwise, + * will rerank on the facet values from this list only. + * + * Generated from protobuf field repeated string facet_values = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacetValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->facet_values = $arr; + + return $this; + } + +} + + diff --git a/Retail/src/V2/Client/ProductServiceClient.php b/Retail/src/V2/Client/ProductServiceClient.php index c7a4c31d702f..40b00be2c1e1 100644 --- a/Retail/src/V2/Client/ProductServiceClient.php +++ b/Retail/src/V2/Client/ProductServiceClient.php @@ -43,6 +43,7 @@ use Google\Cloud\Retail\V2\ImportProductsRequest; use Google\Cloud\Retail\V2\ListProductsRequest; use Google\Cloud\Retail\V2\Product; +use Google\Cloud\Retail\V2\PurgeProductsRequest; use Google\Cloud\Retail\V2\RemoveFulfillmentPlacesRequest; use Google\Cloud\Retail\V2\RemoveLocalInventoriesRequest; use Google\Cloud\Retail\V2\SetInventoryRequest; @@ -69,6 +70,7 @@ * @method PromiseInterface getProductAsync(GetProductRequest $request, array $optionalArgs = []) * @method PromiseInterface importProductsAsync(ImportProductsRequest $request, array $optionalArgs = []) * @method PromiseInterface listProductsAsync(ListProductsRequest $request, array $optionalArgs = []) + * @method PromiseInterface purgeProductsAsync(PurgeProductsRequest $request, array $optionalArgs = []) * @method PromiseInterface removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest $request, array $optionalArgs = []) * @method PromiseInterface removeLocalInventoriesAsync(RemoveLocalInventoriesRequest $request, array $optionalArgs = []) * @method PromiseInterface setInventoryAsync(SetInventoryRequest $request, array $optionalArgs = []) @@ -295,10 +297,11 @@ public function __call($method, $args) } /** - * It is recommended to use the + * We recommend that you use the * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - * method instead of - * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]. + * method instead of the + * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] + * method. * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] * achieves the same results but provides more fine-grained control over * ingesting local inventory data. @@ -536,10 +539,53 @@ public function listProducts(ListProductsRequest $request, array $callOptions = } /** - * It is recommended to use the + * Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s + * under a branch. + * + * This process is asynchronous. If the request is valid, the removal will be + * enqueued and processed offline. Depending on the number of + * [Product][google.cloud.retail.v2.Product]s, this operation could take hours + * to complete. Before the operation completes, some + * [Product][google.cloud.retail.v2.Product]s may still be returned by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * or + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * Depending on the number of [Product][google.cloud.retail.v2.Product]s, this + * operation could take hours to complete. To get a sample of + * [Product][google.cloud.retail.v2.Product]s that would be deleted, set + * [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] + * to false. + * + * The async variant is {@see ProductServiceClient::purgeProductsAsync()} . + * + * @example samples/V2/ProductServiceClient/purge_products.php + * + * @param PurgeProductsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function purgeProducts(PurgeProductsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PurgeProducts', $request, $callOptions)->wait(); + } + + /** + * We recommend that you use the * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - * method instead of - * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. + * method instead of the + * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] + * method. * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] * achieves the same results but provides more fine-grained control over * ingesting local inventory data. diff --git a/Retail/src/V2/CompleteQueryRequest.php b/Retail/src/V2/CompleteQueryRequest.php index b4d3e501e713..bcab48177f66 100644 --- a/Retail/src/V2/CompleteQueryRequest.php +++ b/Retail/src/V2/CompleteQueryRequest.php @@ -95,10 +95,17 @@ class CompleteQueryRequest extends \Google\Protobuf\Internal\Message */ private $max_suggestions = 0; /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * If true, attribute suggestions are enabled and provided in response. + * This field is only available for "cloud-retail" dataset. + * + * Generated from protobuf field bool enable_attribute_suggestions = 9; + */ + private $enable_attribute_suggestions = false; + /** + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get * per-entity autocomplete results. * @@ -163,11 +170,14 @@ class CompleteQueryRequest extends \Google\Protobuf\Internal\Message * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions]. * The maximum allowed max suggestions is 20. If it is set higher, it will be * capped by 20. + * @type bool $enable_attribute_suggestions + * If true, attribute suggestions are enabled and provided in response. + * This field is only available for "cloud-retail" dataset. * @type string $entity - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get * per-entity autocomplete results. * } @@ -434,10 +444,38 @@ public function setMaxSuggestions($var) } /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * If true, attribute suggestions are enabled and provided in response. + * This field is only available for "cloud-retail" dataset. + * + * Generated from protobuf field bool enable_attribute_suggestions = 9; + * @return bool + */ + public function getEnableAttributeSuggestions() + { + return $this->enable_attribute_suggestions; + } + + /** + * If true, attribute suggestions are enabled and provided in response. + * This field is only available for "cloud-retail" dataset. + * + * Generated from protobuf field bool enable_attribute_suggestions = 9; + * @param bool $var + * @return $this + */ + public function setEnableAttributeSuggestions($var) + { + GPBUtil::checkBool($var); + $this->enable_attribute_suggestions = $var; + + return $this; + } + + /** + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get * per-entity autocomplete results. * @@ -450,10 +488,10 @@ public function getEntity() } /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get * per-entity autocomplete results. * diff --git a/Retail/src/V2/CompleteQueryResponse.php b/Retail/src/V2/CompleteQueryResponse.php index d776f8017ded..0e2b35d44631 100644 --- a/Retail/src/V2/CompleteQueryResponse.php +++ b/Retail/src/V2/CompleteQueryResponse.php @@ -32,9 +32,9 @@ class CompleteQueryResponse extends \Google\Protobuf\Internal\Message */ private $attribution_token = ''; /** - * Matched recent searches of this user. The maximum number of recent searches - * is 10. This field is a restricted feature. Contact Retail Search support - * team if you are interested in enabling it. + * Deprecated. Matched recent searches of this user. The maximum number of + * recent searches is 10. This field is a restricted feature. If you want to + * enable it, contact Retail Search support. * This feature is only available when * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. @@ -48,7 +48,8 @@ class CompleteQueryResponse extends \Google\Protobuf\Internal\Message * Recent searches are deduplicated. More recent searches will be reserved * when duplication happens. * - * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3 [deprecated = true]; + * @deprecated */ private $recent_search_results; @@ -67,9 +68,9 @@ class CompleteQueryResponse extends \Google\Protobuf\Internal\Message * for search events resulting from this completion, which enables accurate * attribution of complete model performance. * @type array<\Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult>|\Google\Protobuf\Internal\RepeatedField $recent_search_results - * Matched recent searches of this user. The maximum number of recent searches - * is 10. This field is a restricted feature. Contact Retail Search support - * team if you are interested in enabling it. + * Deprecated. Matched recent searches of this user. The maximum number of + * recent searches is 10. This field is a restricted feature. If you want to + * enable it, contact Retail Search support. * This feature is only available when * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. @@ -150,9 +151,9 @@ public function setAttributionToken($var) } /** - * Matched recent searches of this user. The maximum number of recent searches - * is 10. This field is a restricted feature. Contact Retail Search support - * team if you are interested in enabling it. + * Deprecated. Matched recent searches of this user. The maximum number of + * recent searches is 10. This field is a restricted feature. If you want to + * enable it, contact Retail Search support. * This feature is only available when * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. @@ -166,18 +167,20 @@ public function setAttributionToken($var) * Recent searches are deduplicated. More recent searches will be reserved * when duplication happens. * - * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3 [deprecated = true]; * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated */ public function getRecentSearchResults() { + @trigger_error('recent_search_results is deprecated.', E_USER_DEPRECATED); return $this->recent_search_results; } /** - * Matched recent searches of this user. The maximum number of recent searches - * is 10. This field is a restricted feature. Contact Retail Search support - * team if you are interested in enabling it. + * Deprecated. Matched recent searches of this user. The maximum number of + * recent searches is 10. This field is a restricted feature. If you want to + * enable it, contact Retail Search support. * This feature is only available when * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] * field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported. @@ -191,12 +194,14 @@ public function getRecentSearchResults() * Recent searches are deduplicated. More recent searches will be reserved * when duplication happens. * - * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3 [deprecated = true]; * @param array<\Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult>|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setRecentSearchResults($var) { + @trigger_error('recent_search_results is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult::class); $this->recent_search_results = $arr; diff --git a/Retail/src/V2/CompleteQueryResponse/RecentSearchResult.php b/Retail/src/V2/CompleteQueryResponse/RecentSearchResult.php index 7a386a07c3ef..7541383e2cc5 100644 --- a/Retail/src/V2/CompleteQueryResponse/RecentSearchResult.php +++ b/Retail/src/V2/CompleteQueryResponse/RecentSearchResult.php @@ -9,8 +9,9 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Recent search of this user. + * Deprecated: Recent search of this user. * + * @deprecated * Generated from protobuf message google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult */ class RecentSearchResult extends \Google\Protobuf\Internal\Message diff --git a/Retail/src/V2/CompletionConfig.php b/Retail/src/V2/CompletionConfig.php index 01df5af357fc..621613aa1463 100644 --- a/Retail/src/V2/CompletionConfig.php +++ b/Retail/src/V2/CompletionConfig.php @@ -73,8 +73,8 @@ class CompletionConfig extends \Google\Protobuf\Internal\Message /** * Output only. Name of the LRO corresponding to the latest suggestion terms * list import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API + * method to retrieve the latest state of the Long Running Operation. * * Generated from protobuf field string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -149,8 +149,8 @@ class CompletionConfig extends \Google\Protobuf\Internal\Message * @type string $last_suggestions_import_operation * Output only. Name of the LRO corresponding to the latest suggestion terms * list import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API + * method to retrieve the latest state of the Long Running Operation. * @type \Google\Cloud\Retail\V2\CompletionDataInputConfig $denylist_input_config * Output only. The source data for the latest import of the autocomplete * denylist phrases. @@ -377,8 +377,8 @@ public function setSuggestionsInputConfig($var) /** * Output only. Name of the LRO corresponding to the latest suggestion terms * list import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API + * method to retrieve the latest state of the Long Running Operation. * * Generated from protobuf field string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -391,8 +391,8 @@ public function getLastSuggestionsImportOperation() /** * Output only. Name of the LRO corresponding to the latest suggestion terms * list import. - * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - * retrieve the latest state of the Long Running Operation. + * Can use [GetOperation][google.longrunning.Operations.GetOperation] API + * method to retrieve the latest state of the Long Running Operation. * * Generated from protobuf field string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var diff --git a/Retail/src/V2/Condition.php b/Retail/src/V2/Condition.php index 7cb876e07279..7f735eab09ee 100644 --- a/Retail/src/V2/Condition.php +++ b/Retail/src/V2/Condition.php @@ -36,6 +36,15 @@ class Condition extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3; */ private $active_time_range; + /** + * Used to support browse uses cases. + * A list (up to 10 entries) of categories or departments. + * The format should be the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * + * Generated from protobuf field repeated string page_categories = 4; + */ + private $page_categories; /** * Constructor. @@ -51,6 +60,11 @@ class Condition extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\Retail\V2\Condition\TimeRange>|\Google\Protobuf\Internal\RepeatedField $active_time_range * Range of time(s) specifying when Condition is active. * Condition true if any time range matches. + * @type array|\Google\Protobuf\Internal\RepeatedField $page_categories + * Used to support browse uses cases. + * A list (up to 10 entries) of categories or departments. + * The format should be the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; * } */ public function __construct($data = NULL) { @@ -118,5 +132,37 @@ public function setActiveTimeRange($var) return $this; } + /** + * Used to support browse uses cases. + * A list (up to 10 entries) of categories or departments. + * The format should be the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * + * Generated from protobuf field repeated string page_categories = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageCategories() + { + return $this->page_categories; + } + + /** + * Used to support browse uses cases. + * A list (up to 10 entries) of categories or departments. + * The format should be the same as + * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + * + * Generated from protobuf field repeated string page_categories = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->page_categories = $arr; + + return $this; + } + } diff --git a/Retail/src/V2/ExperimentInfo.php b/Retail/src/V2/ExperimentInfo.php index 3b08bdaddf2b..0418cc8baac2 100644 --- a/Retail/src/V2/ExperimentInfo.php +++ b/Retail/src/V2/ExperimentInfo.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Metadata for active A/B testing [Experiments][]. + * Metadata for active A/B testing [Experiment][]. * * Generated from protobuf message google.cloud.retail.v2.ExperimentInfo */ diff --git a/Retail/src/V2/ExperimentInfo/ServingConfigExperiment.php b/Retail/src/V2/ExperimentInfo/ServingConfigExperiment.php index 4decc3d0b7ef..43d7f95f4ced 100644 --- a/Retail/src/V2/ExperimentInfo/ServingConfigExperiment.php +++ b/Retail/src/V2/ExperimentInfo/ServingConfigExperiment.php @@ -26,8 +26,8 @@ class ServingConfigExperiment extends \Google\Protobuf\Internal\Message private $original_serving_config = ''; /** * The fully qualified resource name of the serving config - * [VariantArm.serving_config_id][] responsible for generating the search - * response. For example: + * [Experiment.VariantArm.serving_config_id][] responsible for generating + * the search response. For example: * `projects/*/locations/*/catalogs/*/servingConfigs/*`. * * Generated from protobuf field string experiment_serving_config = 2 [(.google.api.resource_reference) = { @@ -47,8 +47,8 @@ class ServingConfigExperiment extends \Google\Protobuf\Internal\Message * example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. * @type string $experiment_serving_config * The fully qualified resource name of the serving config - * [VariantArm.serving_config_id][] responsible for generating the search - * response. For example: + * [Experiment.VariantArm.serving_config_id][] responsible for generating + * the search response. For example: * `projects/*/locations/*/catalogs/*/servingConfigs/*`. * } */ @@ -91,8 +91,8 @@ public function setOriginalServingConfig($var) /** * The fully qualified resource name of the serving config - * [VariantArm.serving_config_id][] responsible for generating the search - * response. For example: + * [Experiment.VariantArm.serving_config_id][] responsible for generating + * the search response. For example: * `projects/*/locations/*/catalogs/*/servingConfigs/*`. * * Generated from protobuf field string experiment_serving_config = 2 [(.google.api.resource_reference) = { @@ -105,8 +105,8 @@ public function getExperimentServingConfig() /** * The fully qualified resource name of the serving config - * [VariantArm.serving_config_id][] responsible for generating the search - * response. For example: + * [Experiment.VariantArm.serving_config_id][] responsible for generating + * the search response. For example: * `projects/*/locations/*/catalogs/*/servingConfigs/*`. * * Generated from protobuf field string experiment_serving_config = 2 [(.google.api.resource_reference) = { diff --git a/Retail/src/V2/Gapic/CompletionServiceGapicClient.php b/Retail/src/V2/Gapic/CompletionServiceGapicClient.php index 8cca4158d02e..ba9532eb1013 100644 --- a/Retail/src/V2/Gapic/CompletionServiceGapicClient.php +++ b/Retail/src/V2/Gapic/CompletionServiceGapicClient.php @@ -394,11 +394,15 @@ public function __construct(array $options = []) * * The maximum allowed max suggestions is 20. If it is set higher, it will be * capped by 20. + * @type bool $enableAttributeSuggestions + * If true, attribute suggestions are enabled and provided in response. + * + * This field is only available for "cloud-retail" dataset. * @type string $entity - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get * per-entity autocomplete results. * @type RetrySettings|array $retrySettings @@ -438,6 +442,12 @@ public function completeQuery($catalog, $query, array $optionalArgs = []) $request->setMaxSuggestions($optionalArgs['maxSuggestions']); } + if (isset($optionalArgs['enableAttributeSuggestions'])) { + $request->setEnableAttributeSuggestions( + $optionalArgs['enableAttributeSuggestions'] + ); + } + if (isset($optionalArgs['entity'])) { $request->setEntity($optionalArgs['entity']); } diff --git a/Retail/src/V2/Gapic/ProductServiceGapicClient.php b/Retail/src/V2/Gapic/ProductServiceGapicClient.php index 44661ab347f6..bc5b10c3323d 100644 --- a/Retail/src/V2/Gapic/ProductServiceGapicClient.php +++ b/Retail/src/V2/Gapic/ProductServiceGapicClient.php @@ -48,6 +48,7 @@ use Google\Cloud\Retail\V2\LocalInventory; use Google\Cloud\Retail\V2\Product; use Google\Cloud\Retail\V2\ProductInputConfig; +use Google\Cloud\Retail\V2\PurgeProductsRequest; use Google\Cloud\Retail\V2\RemoveFulfillmentPlacesRequest; use Google\Cloud\Retail\V2\RemoveLocalInventoriesRequest; use Google\Cloud\Retail\V2\SetInventoryRequest; @@ -395,10 +396,11 @@ public function __construct(array $options = []) } /** - * It is recommended to use the + * We recommend that you use the * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - * method instead of - * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]. + * method instead of the + * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] + * method. * [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] * achieves the same results but provides more fine-grained control over * ingesting local inventory data. @@ -972,7 +974,8 @@ public function getProduct($name, array $optionalArgs = []) * The desired location of errors incurred during the Import. * @type FieldMask $updateMask * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. * @type int $reconciliationMode * The mode of reconciliation between existing products and the products to be * imported. Defaults to @@ -987,9 +990,14 @@ public function getProduct($name, array $optionalArgs = []) * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * + * Only supported when + * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + * is set to `FULL`. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1188,10 +1196,151 @@ public function listProducts($parent, array $optionalArgs = []) } /** - * It is recommended to use the + * Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s + * under a branch. + * + * This process is asynchronous. If the request is valid, the removal will be + * enqueued and processed offline. Depending on the number of + * [Product][google.cloud.retail.v2.Product]s, this operation could take hours + * to complete. Before the operation completes, some + * [Product][google.cloud.retail.v2.Product]s may still be returned by + * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + * or + * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * + * Depending on the number of [Product][google.cloud.retail.v2.Product]s, this + * operation could take hours to complete. To get a sample of + * [Product][google.cloud.retail.v2.Product]s that would be deleted, set + * [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] + * to false. + * + * Sample code: + * ``` + * $productServiceClient = new ProductServiceClient(); + * try { + * $formattedParent = $productServiceClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + * $filter = 'filter'; + * $operationResponse = $productServiceClient->purgeProducts($formattedParent, $filter); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $productServiceClient->purgeProducts($formattedParent, $filter); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $productServiceClient->resumeOperation($operationName, 'purgeProducts'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $productServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * @param string $filter Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * + * The eligible fields for filtering are: + * + * * `availability`: Double quoted + * [Product.availability][google.cloud.retail.v2.Product.availability] string. + * * `create_time` : in ISO 8601 "zulu" format. + * + * Supported syntax: + * + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * @param array $optionalArgs { + * Optional. + * + * @type bool $force + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function purgeProducts($parent, $filter, array $optionalArgs = []) + { + $request = new PurgeProductsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setFilter($filter); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'PurgeProducts', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + + /** + * We recommend that you use the * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - * method instead of - * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. + * method instead of the + * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] + * method. * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] * achieves the same results but provides more fine-grained control over * ingesting local inventory data. diff --git a/Retail/src/V2/Gapic/SearchServiceGapicClient.php b/Retail/src/V2/Gapic/SearchServiceGapicClient.php index 784e0548b68e..387c6940dd3e 100644 --- a/Retail/src/V2/Gapic/SearchServiceGapicClient.php +++ b/Retail/src/V2/Gapic/SearchServiceGapicClient.php @@ -322,7 +322,7 @@ public function __construct(array $options = []) * or the name of the legacy placement resource, such as * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param string $visitorId Required. A unique identifier for tracking visitors. For example, this * could be implemented with an HTTP cookie, which should be able to uniquely * identify a visitor on a single device. This unique identifier should not @@ -371,8 +371,8 @@ public function __construct(array $options = []) * @type string $filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @type string $canonicalFilter @@ -380,20 +380,20 @@ public function __construct(array $options = []) * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter] - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. * @type string $orderBy * The order in which products are returned. Products can be ordered by * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @type FacetSpec[] $facetSpecs @@ -408,8 +408,8 @@ public function __construct(array $options = []) * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @type BoostSpec $boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] @@ -420,8 +420,8 @@ public function __construct(array $options = []) * to the sum of the boost scores from all matched boost conditions. * @type QueryExpansionSpec $queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @type string[] $variantRollupKeys * The keys to fetch and rollup the matching * [variant][google.cloud.retail.v2.Product.Type.VARIANT] @@ -494,7 +494,7 @@ public function __construct(array $options = []) * If this field is set to an invalid value other than these, an * INVALID_ARGUMENT error is returned. * @type string[] $pageCategories - * The categories associated with a category page. Required for category + * The categories associated with a category page. Must be set for category * navigation queries to achieve good search quality. The format should be * the same as * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; @@ -536,9 +536,9 @@ public function __construct(array $options = []) * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @type SpellCorrectionSpec $spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. diff --git a/Retail/src/V2/ImportProductsRequest.php b/Retail/src/V2/ImportProductsRequest.php index 91433c09da10..f49d3116c9ee 100644 --- a/Retail/src/V2/ImportProductsRequest.php +++ b/Retail/src/V2/ImportProductsRequest.php @@ -45,7 +45,8 @@ class ImportProductsRequest extends \Google\Protobuf\Internal\Message private $errors_config = null; /** * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4; */ @@ -66,9 +67,13 @@ class ImportProductsRequest extends \Google\Protobuf\Internal\Message * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + * is set to `FULL`. * * Generated from protobuf field string notification_pubsub_topic = 7; */ @@ -93,7 +98,8 @@ class ImportProductsRequest extends \Google\Protobuf\Internal\Message * The desired location of errors incurred during the Import. * @type \Google\Protobuf\FieldMask $update_mask * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. * @type int $reconciliation_mode * The mode of reconciliation between existing products and the products to be * imported. Defaults to @@ -106,9 +112,13 @@ class ImportProductsRequest extends \Google\Protobuf\Internal\Message * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + * is set to `FULL`. * } */ public function __construct($data = NULL) { @@ -252,7 +262,8 @@ public function setErrorsConfig($var) /** * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4; * @return \Google\Protobuf\FieldMask|null @@ -274,7 +285,8 @@ public function clearUpdateMask() /** * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4; * @param \Google\Protobuf\FieldMask $var @@ -326,9 +338,13 @@ public function setReconciliationMode($var) * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + * is set to `FULL`. * * Generated from protobuf field string notification_pubsub_topic = 7; * @return string @@ -346,9 +362,13 @@ public function getNotificationPubsubTopic() * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + * is set to `FULL`. * * Generated from protobuf field string notification_pubsub_topic = 7; * @param string $var diff --git a/Retail/src/V2/Model.php b/Retail/src/V2/Model.php index b57fb228bca6..ec1d0eb0d7bd 100644 --- a/Retail/src/V2/Model.php +++ b/Retail/src/V2/Model.php @@ -159,6 +159,12 @@ class Model extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.retail.v2.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $serving_config_lists; + /** + * Optional. Additional model features config. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ModelFeaturesConfig model_features_config = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $model_features_config = null; /** * Constructor. @@ -250,6 +256,8 @@ class Model extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\Retail\V2\Model\ServingConfigList>|\Google\Protobuf\Internal\RepeatedField $serving_config_lists * Output only. The list of valid serving configs associated with the * PageOptimizationConfig. + * @type \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig $model_features_config + * Optional. Additional model features config. * } */ public function __construct($data = NULL) { @@ -763,5 +771,41 @@ public function setServingConfigLists($var) return $this; } + /** + * Optional. Additional model features config. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ModelFeaturesConfig model_features_config = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig|null + */ + public function getModelFeaturesConfig() + { + return $this->model_features_config; + } + + public function hasModelFeaturesConfig() + { + return isset($this->model_features_config); + } + + public function clearModelFeaturesConfig() + { + unset($this->model_features_config); + } + + /** + * Optional. Additional model features config. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ModelFeaturesConfig model_features_config = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig $var + * @return $this + */ + public function setModelFeaturesConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model\ModelFeaturesConfig::class); + $this->model_features_config = $var; + + return $this; + } + } diff --git a/Retail/src/V2/Model/ContextProductsType.php b/Retail/src/V2/Model/ContextProductsType.php new file mode 100644 index 000000000000..a7fbf24dca54 --- /dev/null +++ b/Retail/src/V2/Model/ContextProductsType.php @@ -0,0 +1,66 @@ +google.cloud.retail.v2.Model.ContextProductsType + */ +class ContextProductsType +{ + /** + * Unspecified default value, should never be explicitly set. + * Defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * + * Generated from protobuf enum CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0; + */ + const CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0; + /** + * Use only a single product as context for the recommendation. Typically + * used on pages like add-to-cart or product details. + * + * Generated from protobuf enum SINGLE_CONTEXT_PRODUCT = 1; + */ + const SINGLE_CONTEXT_PRODUCT = 1; + /** + * Use one or multiple products as context for the recommendation. Typically + * used on shopping cart pages. + * + * Generated from protobuf enum MULTIPLE_CONTEXT_PRODUCTS = 2; + */ + const MULTIPLE_CONTEXT_PRODUCTS = 2; + + private static $valueToName = [ + self::CONTEXT_PRODUCTS_TYPE_UNSPECIFIED => 'CONTEXT_PRODUCTS_TYPE_UNSPECIFIED', + self::SINGLE_CONTEXT_PRODUCT => 'SINGLE_CONTEXT_PRODUCT', + self::MULTIPLE_CONTEXT_PRODUCTS => 'MULTIPLE_CONTEXT_PRODUCTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/Retail/src/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php b/Retail/src/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php new file mode 100644 index 000000000000..6ea15360edfd --- /dev/null +++ b/Retail/src/V2/Model/FrequentlyBoughtTogetherFeaturesConfig.php @@ -0,0 +1,80 @@ +google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + */ +class FrequentlyBoughtTogetherFeaturesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the context of the model when it is used in predict + * requests. Can only be set for the `frequently-bought-together` type. If + * it isn't specified, it defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ContextProductsType context_products_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $context_products_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $context_products_type + * Optional. Specifies the context of the model when it is used in predict + * requests. Can only be set for the `frequently-bought-together` type. If + * it isn't specified, it defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the context of the model when it is used in predict + * requests. Can only be set for the `frequently-bought-together` type. If + * it isn't specified, it defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ContextProductsType context_products_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextProductsType() + { + return $this->context_products_type; + } + + /** + * Optional. Specifies the context of the model when it is used in predict + * requests. Can only be set for the `frequently-bought-together` type. If + * it isn't specified, it defaults to + * [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.ContextProductsType context_products_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextProductsType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\Model\ContextProductsType::class); + $this->context_products_type = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/Model/ModelFeaturesConfig.php b/Retail/src/V2/Model/ModelFeaturesConfig.php new file mode 100644 index 000000000000..d37c05a3bb6f --- /dev/null +++ b/Retail/src/V2/Model/ModelFeaturesConfig.php @@ -0,0 +1,76 @@ +google.cloud.retail.v2.Model.ModelFeaturesConfig + */ +class ModelFeaturesConfig extends \Google\Protobuf\Internal\Message +{ + protected $type_dedicated_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig $frequently_bought_together_config + * Additional configs for frequently-bought-together models. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Model::initOnce(); + parent::__construct($data); + } + + /** + * Additional configs for frequently-bought-together models. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config = 1; + * @return \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig|null + */ + public function getFrequentlyBoughtTogetherConfig() + { + return $this->readOneof(1); + } + + public function hasFrequentlyBoughtTogetherConfig() + { + return $this->hasOneof(1); + } + + /** + * Additional configs for frequently-bought-together models. + * + * Generated from protobuf field .google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config = 1; + * @param \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig $var + * @return $this + */ + public function setFrequentlyBoughtTogetherConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model\FrequentlyBoughtTogetherFeaturesConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getTypeDedicatedConfig() + { + return $this->whichOneof("type_dedicated_config"); + } + +} + + diff --git a/Retail/src/V2/Product.php b/Retail/src/V2/Product.php index 3f7b62923fa9..96ee9cf0935e 100644 --- a/Retail/src/V2/Product.php +++ b/Retail/src/V2/Product.php @@ -119,9 +119,10 @@ class Product extends \Google\Protobuf\Internal\Message * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT * error is returned. * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed. - * Each value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * [Product][google.cloud.retail.v2.Product] unless overridden through the + * Google Cloud console. Empty values are not allowed. Each value must be a + * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. * Corresponding properties: Google Merchant Center property * [google_product_category][mc_google_product_category]. Schema.org property * [Product.category] (https://schema.org/category). @@ -144,9 +145,10 @@ class Product extends \Google\Protobuf\Internal\Message private $title = ''; /** * The brands of the product. - * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded - * string with a length limit of 1,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. + * A maximum of 30 brands are allowed unless overridden through the Google + * Cloud console. Each + * brand must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. * Corresponding properties: Google Merchant Center property * [brand](https://support.google.com/merchants/answer/6324351). Schema.org * property [Product.brand](https://schema.org/brand). @@ -481,22 +483,19 @@ class Product extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Protobuf\Timestamp $expire_time - * The timestamp when this product becomes unavailable for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note - * that this is only applicable to - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and - * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. - * In general, we suggest the users to delete the stale products explicitly, - * instead of using this field to determine staleness. - * If it is set, the [Product][google.cloud.retail.v2.Product] is not - * available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after - * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the - * product can still be retrieved by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * and - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * Note that this field is applied in the following ways: + * * If the [Product][google.cloud.retail.v2.Product] is already expired + * when it is uploaded, this product + * is not indexed for search. + * * If the [Product][google.cloud.retail.v2.Product] is not expired when it + * is uploaded, only the + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s + * expireTime is respected, and + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s + * expireTime is not used. + * In general, we suggest the users to delete the stale + * products explicitly, instead of using this field to determine staleness. * [expire_time][google.cloud.retail.v2.Product.expire_time] must be later * than [available_time][google.cloud.retail.v2.Product.available_time] and * [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an @@ -603,9 +602,10 @@ class Product extends \Google\Protobuf\Internal\Message * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT * error is returned. * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed. - * Each value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * [Product][google.cloud.retail.v2.Product] unless overridden through the + * Google Cloud console. Empty values are not allowed. Each value must be a + * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. * Corresponding properties: Google Merchant Center property * [google_product_category][mc_google_product_category]. Schema.org property * [Product.category] (https://schema.org/category). @@ -620,9 +620,10 @@ class Product extends \Google\Protobuf\Internal\Message * property [Product.name](https://schema.org/name). * @type array|\Google\Protobuf\Internal\RepeatedField $brands * The brands of the product. - * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded - * string with a length limit of 1,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. + * A maximum of 30 brands are allowed unless overridden through the Google + * Cloud console. Each + * brand must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. * Corresponding properties: Google Merchant Center property * [brand](https://support.google.com/merchants/answer/6324351). Schema.org * property [Product.brand](https://schema.org/brand). @@ -859,22 +860,19 @@ public function __construct($data = NULL) { } /** - * The timestamp when this product becomes unavailable for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note - * that this is only applicable to - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and - * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. - * In general, we suggest the users to delete the stale products explicitly, - * instead of using this field to determine staleness. - * If it is set, the [Product][google.cloud.retail.v2.Product] is not - * available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after - * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the - * product can still be retrieved by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * and - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * Note that this field is applied in the following ways: + * * If the [Product][google.cloud.retail.v2.Product] is already expired + * when it is uploaded, this product + * is not indexed for search. + * * If the [Product][google.cloud.retail.v2.Product] is not expired when it + * is uploaded, only the + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s + * expireTime is respected, and + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s + * expireTime is not used. + * In general, we suggest the users to delete the stale + * products explicitly, instead of using this field to determine staleness. * [expire_time][google.cloud.retail.v2.Product.expire_time] must be later * than [available_time][google.cloud.retail.v2.Product.available_time] and * [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an @@ -896,22 +894,19 @@ public function hasExpireTime() } /** - * The timestamp when this product becomes unavailable for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note - * that this is only applicable to - * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and - * ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. - * In general, we suggest the users to delete the stale products explicitly, - * instead of using this field to determine staleness. - * If it is set, the [Product][google.cloud.retail.v2.Product] is not - * available for - * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after - * [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the - * product can still be retrieved by - * [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - * and - * [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + * Note that this field is applied in the following ways: + * * If the [Product][google.cloud.retail.v2.Product] is already expired + * when it is uploaded, this product + * is not indexed for search. + * * If the [Product][google.cloud.retail.v2.Product] is not expired when it + * is uploaded, only the + * [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and + * [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s + * expireTime is respected, and + * [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s + * expireTime is not used. + * In general, we suggest the users to delete the stale + * products explicitly, instead of using this field to determine staleness. * [expire_time][google.cloud.retail.v2.Product.expire_time] must be later * than [available_time][google.cloud.retail.v2.Product.available_time] and * [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an @@ -1271,9 +1266,10 @@ public function setGtin($var) * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT * error is returned. * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed. - * Each value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * [Product][google.cloud.retail.v2.Product] unless overridden through the + * Google Cloud console. Empty values are not allowed. Each value must be a + * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. * Corresponding properties: Google Merchant Center property * [google_product_category][mc_google_product_category]. Schema.org property * [Product.category] (https://schema.org/category). @@ -1307,9 +1303,10 @@ public function getCategories() * [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT * error is returned. * At most 250 values are allowed per - * [Product][google.cloud.retail.v2.Product]. Empty values are not allowed. - * Each value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * [Product][google.cloud.retail.v2.Product] unless overridden through the + * Google Cloud console. Empty values are not allowed. Each value must be a + * UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + * INVALID_ARGUMENT error is returned. * Corresponding properties: Google Merchant Center property * [google_product_category][mc_google_product_category]. Schema.org property * [Product.category] (https://schema.org/category). @@ -1366,9 +1363,10 @@ public function setTitle($var) /** * The brands of the product. - * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded - * string with a length limit of 1,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. + * A maximum of 30 brands are allowed unless overridden through the Google + * Cloud console. Each + * brand must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. * Corresponding properties: Google Merchant Center property * [brand](https://support.google.com/merchants/answer/6324351). Schema.org * property [Product.brand](https://schema.org/brand). @@ -1383,9 +1381,10 @@ public function getBrands() /** * The brands of the product. - * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded - * string with a length limit of 1,000 characters. Otherwise, an - * INVALID_ARGUMENT error is returned. + * A maximum of 30 brands are allowed unless overridden through the Google + * Cloud console. Each + * brand must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. * Corresponding properties: Google Merchant Center property * [brand](https://support.google.com/merchants/answer/6324351). Schema.org * property [Product.brand](https://schema.org/brand). diff --git a/Retail/src/V2/Promotion.php b/Retail/src/V2/Promotion.php index 21a491904535..65ac09c3031f 100644 --- a/Retail/src/V2/Promotion.php +++ b/Retail/src/V2/Promotion.php @@ -21,8 +21,8 @@ class Promotion extends \Google\Protobuf\Internal\Message * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is * returned. - * Google Merchant Center property - * [promotion](https://support.google.com/merchants/answer/7050148). + * Corresponds to Google Merchant Center property + * [promotion_id](https://support.google.com/merchants/answer/7050148). * * Generated from protobuf field string promotion_id = 1; */ @@ -40,8 +40,8 @@ class Promotion extends \Google\Protobuf\Internal\Message * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is * returned. - * Google Merchant Center property - * [promotion](https://support.google.com/merchants/answer/7050148). + * Corresponds to Google Merchant Center property + * [promotion_id](https://support.google.com/merchants/answer/7050148). * } */ public function __construct($data = NULL) { @@ -55,8 +55,8 @@ public function __construct($data = NULL) { * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is * returned. - * Google Merchant Center property - * [promotion](https://support.google.com/merchants/answer/7050148). + * Corresponds to Google Merchant Center property + * [promotion_id](https://support.google.com/merchants/answer/7050148). * * Generated from protobuf field string promotion_id = 1; * @return string @@ -72,8 +72,8 @@ public function getPromotionId() * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is * returned. - * Google Merchant Center property - * [promotion](https://support.google.com/merchants/answer/7050148). + * Corresponds to Google Merchant Center property + * [promotion_id](https://support.google.com/merchants/answer/7050148). * * Generated from protobuf field string promotion_id = 1; * @param string $var diff --git a/Retail/src/V2/PurgeProductsMetadata.php b/Retail/src/V2/PurgeProductsMetadata.php new file mode 100644 index 000000000000..6257797c5e3b --- /dev/null +++ b/Retail/src/V2/PurgeProductsMetadata.php @@ -0,0 +1,194 @@ +google.cloud.retail.v2.PurgeProductsMetadata + */ +class PurgeProductsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + private $create_time = null; + /** + * Operation last update time. If the operation is done, this is also the + * finish time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; + */ + private $update_time = null; + /** + * Count of entries that were deleted successfully. + * + * Generated from protobuf field int64 success_count = 3; + */ + private $success_count = 0; + /** + * Count of entries that encountered errors while processing. + * + * Generated from protobuf field int64 failure_count = 4; + */ + private $failure_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Operation create time. + * @type \Google\Protobuf\Timestamp $update_time + * Operation last update time. If the operation is done, this is also the + * finish time. + * @type int|string $success_count + * Count of entries that were deleted successfully. + * @type int|string $failure_count + * Count of entries that encountered errors while processing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); + parent::__construct($data); + } + + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Operation last update time. If the operation is done, this is also the + * finish time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Operation last update time. If the operation is done, this is also the + * finish time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Count of entries that were deleted successfully. + * + * Generated from protobuf field int64 success_count = 3; + * @return int|string + */ + public function getSuccessCount() + { + return $this->success_count; + } + + /** + * Count of entries that were deleted successfully. + * + * Generated from protobuf field int64 success_count = 3; + * @param int|string $var + * @return $this + */ + public function setSuccessCount($var) + { + GPBUtil::checkInt64($var); + $this->success_count = $var; + + return $this; + } + + /** + * Count of entries that encountered errors while processing. + * + * Generated from protobuf field int64 failure_count = 4; + * @return int|string + */ + public function getFailureCount() + { + return $this->failure_count; + } + + /** + * Count of entries that encountered errors while processing. + * + * Generated from protobuf field int64 failure_count = 4; + * @param int|string $var + * @return $this + */ + public function setFailureCount($var) + { + GPBUtil::checkInt64($var); + $this->failure_count = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/PurgeProductsRequest.php b/Retail/src/V2/PurgeProductsRequest.php new file mode 100644 index 000000000000..53cc69c9627c --- /dev/null +++ b/Retail/src/V2/PurgeProductsRequest.php @@ -0,0 +1,263 @@ +google.cloud.retail.v2.PurgeProductsRequest + */ +class PurgeProductsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * [Product.availability][google.cloud.retail.v2.Product.availability] string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $filter = ''; + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * + * Generated from protobuf field bool force = 3; + */ + private $force = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * @type string $filter + * Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * [Product.availability][google.cloud.retail.v2.Product.availability] string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * @type bool $force + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * [Product.availability][google.cloud.retail.v2.Product.availability] string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * [Product.availability][google.cloud.retail.v2.Product.availability] string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * + * Generated from protobuf field bool force = 3; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * + * Generated from protobuf field bool force = 3; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/PurgeProductsResponse.php b/Retail/src/V2/PurgeProductsResponse.php new file mode 100644 index 000000000000..0e0461501f8f --- /dev/null +++ b/Retail/src/V2/PurgeProductsResponse.php @@ -0,0 +1,111 @@ +google.cloud.retail.v2.PurgeProductsResponse + */ +class PurgeProductsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The total count of products purged as a result of the operation. + * + * Generated from protobuf field int64 purge_count = 1; + */ + private $purge_count = 0; + /** + * A sample of the product names that will be deleted. + * Only populated if `force` is set to false. A max of 100 names will be + * returned and the names are chosen at random. + * + * Generated from protobuf field repeated string purge_sample = 2 [(.google.api.resource_reference) = { + */ + private $purge_sample; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $purge_count + * The total count of products purged as a result of the operation. + * @type array|\Google\Protobuf\Internal\RepeatedField $purge_sample + * A sample of the product names that will be deleted. + * Only populated if `force` is set to false. A max of 100 names will be + * returned and the names are chosen at random. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\PurgeConfig::initOnce(); + parent::__construct($data); + } + + /** + * The total count of products purged as a result of the operation. + * + * Generated from protobuf field int64 purge_count = 1; + * @return int|string + */ + public function getPurgeCount() + { + return $this->purge_count; + } + + /** + * The total count of products purged as a result of the operation. + * + * Generated from protobuf field int64 purge_count = 1; + * @param int|string $var + * @return $this + */ + public function setPurgeCount($var) + { + GPBUtil::checkInt64($var); + $this->purge_count = $var; + + return $this; + } + + /** + * A sample of the product names that will be deleted. + * Only populated if `force` is set to false. A max of 100 names will be + * returned and the names are chosen at random. + * + * Generated from protobuf field repeated string purge_sample = 2 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPurgeSample() + { + return $this->purge_sample; + } + + /** + * A sample of the product names that will be deleted. + * Only populated if `force` is set to false. A max of 100 names will be + * returned and the names are chosen at random. + * + * Generated from protobuf field repeated string purge_sample = 2 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPurgeSample($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->purge_sample = $arr; + + return $this; + } + +} + diff --git a/Retail/src/V2/Rule.php b/Retail/src/V2/Rule.php index d363e1b4b1f9..2b03244383a2 100644 --- a/Retail/src/V2/Rule.php +++ b/Retail/src/V2/Rule.php @@ -51,6 +51,10 @@ class Rule extends \Google\Protobuf\Internal\Message * Filters results. * @type \Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction $twoway_synonyms_action * Treats a set of terms as synonyms of one another. + * @type \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction $force_return_facet_action + * Force returns an attribute as a facet in the request. + * @type \Google\Cloud\Retail\V2\Rule\RemoveFacetAction $remove_facet_action + * Remove an attribute as a facet in the request (if present). * @type \Google\Cloud\Retail\V2\Condition $condition * Required. The condition that triggers the rule. * If the condition is empty, the rule will always apply. @@ -311,6 +315,68 @@ public function setTwowaySynonymsAction($var) return $this; } + /** + * Force returns an attribute as a facet in the request. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.ForceReturnFacetAction force_return_facet_action = 12; + * @return \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction|null + */ + public function getForceReturnFacetAction() + { + return $this->readOneof(12); + } + + public function hasForceReturnFacetAction() + { + return $this->hasOneof(12); + } + + /** + * Force returns an attribute as a facet in the request. + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.ForceReturnFacetAction force_return_facet_action = 12; + * @param \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction $var + * @return $this + */ + public function setForceReturnFacetAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Remove an attribute as a facet in the request (if present). + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.RemoveFacetAction remove_facet_action = 13; + * @return \Google\Cloud\Retail\V2\Rule\RemoveFacetAction|null + */ + public function getRemoveFacetAction() + { + return $this->readOneof(13); + } + + public function hasRemoveFacetAction() + { + return $this->hasOneof(13); + } + + /** + * Remove an attribute as a facet in the request (if present). + * + * Generated from protobuf field .google.cloud.retail.v2.Rule.RemoveFacetAction remove_facet_action = 13; + * @param \Google\Cloud\Retail\V2\Rule\RemoveFacetAction $var + * @return $this + */ + public function setRemoveFacetAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Rule\RemoveFacetAction::class); + $this->writeOneof(13, $var); + + return $this; + } + /** * Required. The condition that triggers the rule. * If the condition is empty, the rule will always apply. diff --git a/Retail/src/V2/Rule/FilterAction.php b/Retail/src/V2/Rule/FilterAction.php index b64b2948b4bf..2e58b91888ca 100644 --- a/Retail/src/V2/Rule/FilterAction.php +++ b/Retail/src/V2/Rule/FilterAction.php @@ -10,12 +10,12 @@ /** * * Rule Condition: - * - No - * [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] - * provided is a global match. - * - 1 or more - * [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] - * provided are combined with OR operator. + * - No + * [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] + * provided is a global match. + * - 1 or more + * [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] + * provided are combined with OR operator. * * Action Input: The request query and filter that are applied to the * retrieved products, in addition to any filters already provided with the * SearchRequest. The AND operator is used to combine the query's existing @@ -32,10 +32,9 @@ class FilterAction extends \Google\Protobuf\Internal\Message * A filter to apply on the matching condition results. Supported features: * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. * * Filter syntax is identical to - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For * more - * details at the Retail Search - * [user guide](https://cloud.google.com/retail/search/docs/filter-and-order#filter). + * information, see [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * To filter products with product ID "product_1" or "product_2", and * color * "Red" or "Blue":
@@ -57,10 +56,9 @@ class FilterAction extends \Google\Protobuf\Internal\Message * A filter to apply on the matching condition results. Supported features: * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. * * Filter syntax is identical to - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For * more - * details at the Retail Search - * [user guide](https://cloud.google.com/retail/search/docs/filter-and-order#filter). + * information, see [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * To filter products with product ID "product_1" or "product_2", and * color * "Red" or "Blue":
@@ -78,10 +76,9 @@ public function __construct($data = NULL) { * A filter to apply on the matching condition results. Supported features: * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. * * Filter syntax is identical to - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For * more - * details at the Retail Search - * [user guide](https://cloud.google.com/retail/search/docs/filter-and-order#filter). + * information, see [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * To filter products with product ID "product_1" or "product_2", and * color * "Red" or "Blue":
@@ -101,10 +98,9 @@ public function getFilter() * A filter to apply on the matching condition results. Supported features: * * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. * * Filter syntax is identical to - * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. See + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For * more - * details at the Retail Search - * [user guide](https://cloud.google.com/retail/search/docs/filter-and-order#filter). + * information, see [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * To filter products with product ID "product_1" or "product_2", and * color * "Red" or "Blue":
diff --git a/Retail/src/V2/Rule/ForceReturnFacetAction.php b/Retail/src/V2/Rule/ForceReturnFacetAction.php new file mode 100644 index 000000000000..24238cc30930 --- /dev/null +++ b/Retail/src/V2/Rule/ForceReturnFacetAction.php @@ -0,0 +1,93 @@ +google.cloud.retail.v2.Rule.ForceReturnFacetAction + */ +class ForceReturnFacetAction extends \Google\Protobuf\Internal\Message +{ + /** + * Each instance corresponds to a force return attribute for the given + * condition. There can't be more 3 instances here. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; + */ + private $facet_position_adjustments; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment>|\Google\Protobuf\Internal\RepeatedField $facet_position_adjustments + * Each instance corresponds to a force return attribute for the given + * condition. There can't be more 3 instances here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * Each instance corresponds to a force return attribute for the given + * condition. There can't be more 3 instances here. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFacetPositionAdjustments() + { + return $this->facet_position_adjustments; + } + + /** + * Each instance corresponds to a force return attribute for the given + * condition. There can't be more 3 instances here. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; + * @param array<\Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFacetPositionAdjustments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment::class); + $this->facet_position_adjustments = $arr; + + return $this; + } + +} + + diff --git a/Retail/src/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php b/Retail/src/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php new file mode 100644 index 000000000000..d23aa3c35ea8 --- /dev/null +++ b/Retail/src/V2/Rule/ForceReturnFacetAction/FacetPositionAdjustment.php @@ -0,0 +1,115 @@ +google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + */ +class FacetPositionAdjustment extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute name to force return as a facet. Each attribute name + * should be a valid attribute name, be non-empty and contain at most 80 + * characters long. + * + * Generated from protobuf field string attribute_name = 1; + */ + private $attribute_name = ''; + /** + * This is the position in the request as explained above. It should be + * strictly positive be at most 100. + * + * Generated from protobuf field int32 position = 2; + */ + private $position = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attribute_name + * The attribute name to force return as a facet. Each attribute name + * should be a valid attribute name, be non-empty and contain at most 80 + * characters long. + * @type int $position + * This is the position in the request as explained above. It should be + * strictly positive be at most 100. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The attribute name to force return as a facet. Each attribute name + * should be a valid attribute name, be non-empty and contain at most 80 + * characters long. + * + * Generated from protobuf field string attribute_name = 1; + * @return string + */ + public function getAttributeName() + { + return $this->attribute_name; + } + + /** + * The attribute name to force return as a facet. Each attribute name + * should be a valid attribute name, be non-empty and contain at most 80 + * characters long. + * + * Generated from protobuf field string attribute_name = 1; + * @param string $var + * @return $this + */ + public function setAttributeName($var) + { + GPBUtil::checkString($var, True); + $this->attribute_name = $var; + + return $this; + } + + /** + * This is the position in the request as explained above. It should be + * strictly positive be at most 100. + * + * Generated from protobuf field int32 position = 2; + * @return int + */ + public function getPosition() + { + return $this->position; + } + + /** + * This is the position in the request as explained above. It should be + * strictly positive be at most 100. + * + * Generated from protobuf field int32 position = 2; + * @param int $var + * @return $this + */ + public function setPosition($var) + { + GPBUtil::checkInt32($var); + $this->position = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/Rule/RedirectAction.php b/Retail/src/V2/Rule/RedirectAction.php index b0ab86c70dd5..2bf730f82559 100644 --- a/Retail/src/V2/Rule/RedirectAction.php +++ b/Retail/src/V2/Rule/RedirectAction.php @@ -11,7 +11,7 @@ /** * Redirects a shopper to a specific page. * * Rule Condition: - * - Must specify + * Must specify * [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms]. * * Action Input: Request Query * * Action Result: Redirects shopper to provided uri. diff --git a/Retail/src/V2/Rule/RemoveFacetAction.php b/Retail/src/V2/Rule/RemoveFacetAction.php new file mode 100644 index 000000000000..3f1893ff288c --- /dev/null +++ b/Retail/src/V2/Rule/RemoveFacetAction.php @@ -0,0 +1,93 @@ +google.cloud.retail.v2.Rule.RemoveFacetAction + */ +class RemoveFacetAction extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute names (i.e. facet keys) to remove from the dynamic facets + * (if present in the request). There can't be more 3 attribute names. + * Each attribute name should be a valid attribute name, be non-empty and + * contain at most 80 characters. + * + * Generated from protobuf field repeated string attribute_names = 1; + */ + private $attribute_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $attribute_names + * The attribute names (i.e. facet keys) to remove from the dynamic facets + * (if present in the request). There can't be more 3 attribute names. + * Each attribute name should be a valid attribute name, be non-empty and + * contain at most 80 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce(); + parent::__construct($data); + } + + /** + * The attribute names (i.e. facet keys) to remove from the dynamic facets + * (if present in the request). There can't be more 3 attribute names. + * Each attribute name should be a valid attribute name, be non-empty and + * contain at most 80 characters. + * + * Generated from protobuf field repeated string attribute_names = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributeNames() + { + return $this->attribute_names; + } + + /** + * The attribute names (i.e. facet keys) to remove from the dynamic facets + * (if present in the request). There can't be more 3 attribute names. + * Each attribute name should be a valid attribute name, be non-empty and + * contain at most 80 characters. + * + * Generated from protobuf field repeated string attribute_names = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributeNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->attribute_names = $arr; + + return $this; + } + +} + + diff --git a/Retail/src/V2/SearchRequest.php b/Retail/src/V2/SearchRequest.php index c60975e84f4e..ddbb0e0375ce 100644 --- a/Retail/src/V2/SearchRequest.php +++ b/Retail/src/V2/SearchRequest.php @@ -22,7 +22,7 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * or the name of the legacy placement resource, such as * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -102,8 +102,8 @@ class SearchRequest extends \Google\Protobuf\Internal\Message /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * * Generated from protobuf field string filter = 10; @@ -113,13 +113,13 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * The default filter that is applied when a user performs a search without * checking any filters on the search page. * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter] - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. * * Generated from protobuf field string canonical_filter = 28; */ @@ -127,9 +127,9 @@ class SearchRequest extends \Google\Protobuf\Internal\Message /** * The order in which products are returned. Products can be ordered by * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * * Generated from protobuf field string order_by = 11; @@ -154,8 +154,8 @@ class SearchRequest extends \Google\Protobuf\Internal\Message */ protected $dynamic_facet_spec = null; /** - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * Notice that if both * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] * and @@ -169,8 +169,8 @@ class SearchRequest extends \Google\Protobuf\Internal\Message private $boost_spec = null; /** * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; */ @@ -247,7 +247,7 @@ class SearchRequest extends \Google\Protobuf\Internal\Message */ private $variant_rollup_keys; /** - * The categories associated with a category page. Required for category + * The categories associated with a category page. Must be set for category * navigation queries to achieve good search quality. The format should be * the same as * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; @@ -295,9 +295,9 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * * The key portion of a label must be unique. However, you can use the same * key with multiple resources. * * Keys must start with a lowercase letter or international character. - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * * Generated from protobuf field map labels = 34; */ @@ -333,7 +333,7 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * or the name of the legacy placement resource, such as * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @type string $branch * The branch resource name, such as * `projects/*/locations/global/catalogs/default_catalog/branches/0`. @@ -381,26 +381,26 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * @type string $filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @type string $canonical_filter * The default filter that is applied when a user performs a search without * checking any filters on the search page. * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter] - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. * @type string $order_by * The order in which products are returned. Products can be ordered by * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @type array<\Google\Cloud\Retail\V2\SearchRequest\FacetSpec>|\Google\Protobuf\Internal\RepeatedField $facet_specs * Facet specifications for faceted search. If empty, no facets are returned. @@ -412,8 +412,8 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @type \Google\Cloud\Retail\V2\SearchRequest\BoostSpec $boost_spec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * Notice that if both * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] * and @@ -423,8 +423,8 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * to the sum of the boost scores from all matched boost conditions. * @type \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec $query_expansion_spec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @type array|\Google\Protobuf\Internal\RepeatedField $variant_rollup_keys * The keys to fetch and rollup the matching * [variant][google.cloud.retail.v2.Product.Type.VARIANT] @@ -493,7 +493,7 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * If this field is set to an invalid value other than these, an * INVALID_ARGUMENT error is returned. * @type array|\Google\Protobuf\Internal\RepeatedField $page_categories - * The categories associated with a category page. Required for category + * The categories associated with a category page. Must be set for category * navigation queries to achieve good search quality. The format should be * the same as * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; @@ -529,9 +529,9 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * * The key portion of a label must be unique. However, you can use the same * key with multiple resources. * * Keys must start with a lowercase letter or international character. - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @type \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec $spell_correction_spec * The spell correction specification that specifies the mode under * which spell correction will take effect. @@ -555,7 +555,7 @@ public function __construct($data = NULL) { * or the name of the legacy placement resource, such as * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -571,7 +571,7 @@ public function getPlacement() * or the name of the legacy placement resource, such as * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * * Generated from protobuf field string placement = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -840,8 +840,8 @@ public function setOffset($var) /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * * Generated from protobuf field string filter = 10; @@ -855,8 +855,8 @@ public function getFilter() /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * * Generated from protobuf field string filter = 10; @@ -875,13 +875,13 @@ public function setFilter($var) * The default filter that is applied when a user performs a search without * checking any filters on the search page. * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter] - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. * * Generated from protobuf field string canonical_filter = 28; * @return string @@ -895,13 +895,13 @@ public function getCanonicalFilter() * The default filter that is applied when a user performs a search without * checking any filters on the search page. * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter] - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - * more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. * * Generated from protobuf field string canonical_filter = 28; * @param string $var @@ -918,9 +918,9 @@ public function setCanonicalFilter($var) /** * The order in which products are returned. Products can be ordered by * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * * Generated from protobuf field string order_by = 11; @@ -934,9 +934,9 @@ public function getOrderBy() /** * The order in which products are returned. Products can be ordered by * a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * * Generated from protobuf field string order_by = 11; @@ -1030,8 +1030,8 @@ public function setDynamicFacetSpec($var) } /** - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * Notice that if both * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] * and @@ -1059,8 +1059,8 @@ public function clearBoostSpec() } /** - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * Notice that if both * [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] * and @@ -1083,8 +1083,8 @@ public function setBoostSpec($var) /** * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; * @return \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec|null @@ -1106,8 +1106,8 @@ public function clearQueryExpansionSpec() /** * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; * @param \Google\Cloud\Retail\V2\SearchRequest\QueryExpansionSpec $var @@ -1278,7 +1278,7 @@ public function setVariantRollupKeys($var) } /** - * The categories associated with a category page. Required for category + * The categories associated with a category page. Must be set for category * navigation queries to achieve good search quality. The format should be * the same as * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; @@ -1298,7 +1298,7 @@ public function getPageCategories() } /** - * The categories associated with a category page. Required for category + * The categories associated with a category page. Must be set for category * navigation queries to achieve good search quality. The format should be * the same as * [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; @@ -1414,9 +1414,9 @@ public function setPersonalizationSpec($var) * * The key portion of a label must be unique. However, you can use the same * key with multiple resources. * * Keys must start with a lowercase letter or international character. - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * * Generated from protobuf field map labels = 34; * @return \Google\Protobuf\Internal\MapField @@ -1439,9 +1439,9 @@ public function getLabels() * * The key portion of a label must be unique. However, you can use the same * key with multiple resources. * * Keys must start with a lowercase letter or international character. - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * * Generated from protobuf field map labels = 34; * @param array|\Google\Protobuf\Internal\MapField $var diff --git a/Retail/src/V2/SearchRequest/FacetSpec.php b/Retail/src/V2/SearchRequest/FacetSpec.php index a163dcba5b93..e475023d3f4b 100644 --- a/Retail/src/V2/SearchRequest/FacetSpec.php +++ b/Retail/src/V2/SearchRequest/FacetSpec.php @@ -60,26 +60,26 @@ class FacetSpec extends \Google\Protobuf\Internal\Message /** * Enables dynamic position for this facet. If set to true, the position of * this facet among all facets in the response is determined by Google - * Retail Search. It will be ordered together with dynamic facets if dynamic + * Retail Search. It is ordered together with dynamic facets if dynamic * facets is enabled. If set to false, the position of this facet in the - * response will be the same as in the request, and it will be ranked before + * response is the same as in the request, and it is ranked before * the facets with dynamic position enable and all dynamic facets. * For example, you may always want to have rating facet returned in * the response, but it's not necessarily to always display the rating facet * at the top. In that case, you can set enable_dynamic_position to true so - * that the position of rating facet in response will be determined by + * that the position of rating facet in response is determined by * Google Retail Search. * Another example, assuming you have the following facets in the request: * * "rating", enable_dynamic_position = true * * "price", enable_dynamic_position = false * * "brands", enable_dynamic_position = false - * And also you have a dynamic facets enable, which will generate a facet - * 'gender'. Then the final order of the facets in the response can be + * And also you have a dynamic facets enable, which generates a facet + * "gender". Then, the final order of the facets in the response can be * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", * "rating") depends on how Google Retail Search orders "gender" and - * "rating" facets. However, notice that "price" and "brands" will always be - * ranked at 1st and 2nd position since their enable_dynamic_position are - * false. + * "rating" facets. However, notice that "price" and "brands" are always + * ranked at first and second position because their enable_dynamic_position + * values are false. * * Generated from protobuf field bool enable_dynamic_position = 4; */ @@ -124,26 +124,26 @@ class FacetSpec extends \Google\Protobuf\Internal\Message * @type bool $enable_dynamic_position * Enables dynamic position for this facet. If set to true, the position of * this facet among all facets in the response is determined by Google - * Retail Search. It will be ordered together with dynamic facets if dynamic + * Retail Search. It is ordered together with dynamic facets if dynamic * facets is enabled. If set to false, the position of this facet in the - * response will be the same as in the request, and it will be ranked before + * response is the same as in the request, and it is ranked before * the facets with dynamic position enable and all dynamic facets. * For example, you may always want to have rating facet returned in * the response, but it's not necessarily to always display the rating facet * at the top. In that case, you can set enable_dynamic_position to true so - * that the position of rating facet in response will be determined by + * that the position of rating facet in response is determined by * Google Retail Search. * Another example, assuming you have the following facets in the request: * * "rating", enable_dynamic_position = true * * "price", enable_dynamic_position = false * * "brands", enable_dynamic_position = false - * And also you have a dynamic facets enable, which will generate a facet - * 'gender'. Then the final order of the facets in the response can be + * And also you have a dynamic facets enable, which generates a facet + * "gender". Then, the final order of the facets in the response can be * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", * "rating") depends on how Google Retail Search orders "gender" and - * "rating" facets. However, notice that "price" and "brands" will always be - * ranked at 1st and 2nd position since their enable_dynamic_position are - * false. + * "rating" facets. However, notice that "price" and "brands" are always + * ranked at first and second position because their enable_dynamic_position + * values are false. * } */ public function __construct($data = NULL) { @@ -290,26 +290,26 @@ public function setExcludedFilterKeys($var) /** * Enables dynamic position for this facet. If set to true, the position of * this facet among all facets in the response is determined by Google - * Retail Search. It will be ordered together with dynamic facets if dynamic + * Retail Search. It is ordered together with dynamic facets if dynamic * facets is enabled. If set to false, the position of this facet in the - * response will be the same as in the request, and it will be ranked before + * response is the same as in the request, and it is ranked before * the facets with dynamic position enable and all dynamic facets. * For example, you may always want to have rating facet returned in * the response, but it's not necessarily to always display the rating facet * at the top. In that case, you can set enable_dynamic_position to true so - * that the position of rating facet in response will be determined by + * that the position of rating facet in response is determined by * Google Retail Search. * Another example, assuming you have the following facets in the request: * * "rating", enable_dynamic_position = true * * "price", enable_dynamic_position = false * * "brands", enable_dynamic_position = false - * And also you have a dynamic facets enable, which will generate a facet - * 'gender'. Then the final order of the facets in the response can be + * And also you have a dynamic facets enable, which generates a facet + * "gender". Then, the final order of the facets in the response can be * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", * "rating") depends on how Google Retail Search orders "gender" and - * "rating" facets. However, notice that "price" and "brands" will always be - * ranked at 1st and 2nd position since their enable_dynamic_position are - * false. + * "rating" facets. However, notice that "price" and "brands" are always + * ranked at first and second position because their enable_dynamic_position + * values are false. * * Generated from protobuf field bool enable_dynamic_position = 4; * @return bool @@ -322,26 +322,26 @@ public function getEnableDynamicPosition() /** * Enables dynamic position for this facet. If set to true, the position of * this facet among all facets in the response is determined by Google - * Retail Search. It will be ordered together with dynamic facets if dynamic + * Retail Search. It is ordered together with dynamic facets if dynamic * facets is enabled. If set to false, the position of this facet in the - * response will be the same as in the request, and it will be ranked before + * response is the same as in the request, and it is ranked before * the facets with dynamic position enable and all dynamic facets. * For example, you may always want to have rating facet returned in * the response, but it's not necessarily to always display the rating facet * at the top. In that case, you can set enable_dynamic_position to true so - * that the position of rating facet in response will be determined by + * that the position of rating facet in response is determined by * Google Retail Search. * Another example, assuming you have the following facets in the request: * * "rating", enable_dynamic_position = true * * "price", enable_dynamic_position = false * * "brands", enable_dynamic_position = false - * And also you have a dynamic facets enable, which will generate a facet - * 'gender'. Then the final order of the facets in the response can be + * And also you have a dynamic facets enable, which generates a facet + * "gender". Then, the final order of the facets in the response can be * ("price", "brands", "rating", "gender") or ("price", "brands", "gender", * "rating") depends on how Google Retail Search orders "gender" and - * "rating" facets. However, notice that "price" and "brands" will always be - * ranked at 1st and 2nd position since their enable_dynamic_position are - * false. + * "rating" facets. However, notice that "price" and "brands" are always + * ranked at first and second position because their enable_dynamic_position + * values are false. * * Generated from protobuf field bool enable_dynamic_position = 4; * @param bool $var diff --git a/Retail/src/V2/SearchRequest/FacetSpec/FacetKey.php b/Retail/src/V2/SearchRequest/FacetSpec/FacetKey.php index 7a86c6757042..af515256eca9 100644 --- a/Retail/src/V2/SearchRequest/FacetSpec/FacetKey.php +++ b/Retail/src/V2/SearchRequest/FacetSpec/FacetKey.php @@ -63,13 +63,13 @@ class FacetKey extends \Google\Protobuf\Internal\Message * for facets with numerical values. Must not be set for facet with text * values. Maximum number of intervals is 40. * For all numerical facet keys that appear in the list of products from - * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are + * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are * computed from their distribution weekly. If the model assigns a high * score to a numerical facet key and its intervals are not specified in - * the search request, these percentiles will become the bounds - * for its intervals and will be returned in the response. If the + * the search request, these percentiles become the bounds + * for its intervals and are returned in the response. If the * facet key intervals are specified in the request, then the specified - * intervals will be returned instead. + * intervals are returned instead. * * Generated from protobuf field repeated .google.cloud.retail.v2.Interval intervals = 2; */ @@ -98,7 +98,7 @@ class FacetKey extends \Google\Protobuf\Internal\Message * Only get facet values that start with the given string prefix. For * example, suppose "categories" has three values "Women > Shoe", * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - * "categories" facet will give only "Women > Shoe" and "Women > Dress". + * "categories" facet gives only "Women > Shoe" and "Women > Dress". * Only supported on textual fields. Maximum is 10. * * Generated from protobuf field repeated string prefixes = 8; @@ -108,7 +108,7 @@ class FacetKey extends \Google\Protobuf\Internal\Message * Only get facet values that contains the given strings. For example, * suppose "categories" has three values "Women > Shoe", * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - * "categories" facet will give only "Women > Shoe" and "Men > Shoe". + * "categories" facet gives only "Women > Shoe" and "Men > Shoe". * Only supported on textual fields. Maximum is 10. * * Generated from protobuf field repeated string contains = 9; @@ -146,7 +146,7 @@ class FacetKey extends \Google\Protobuf\Internal\Message private $order_by = ''; /** * The query that is used to compute facet for the given facet key. - * When provided, it will override the default behavior of facet + * When provided, it overrides the default behavior of facet * computation. The query syntax is the same as a filter expression. See * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for * detail syntax and limitations. Notice that there is no limitation on @@ -154,16 +154,16 @@ class FacetKey extends \Google\Protobuf\Internal\Message * when query is specified. * In the response, * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * will be always "1" and + * is always "1" and * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * will be the number of results that match the query. + * is the number of results that match the query. * For example, you can set a customized facet for "shipToStore", * where * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] * is "customizedShipToStore", and * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - * Then the facet will count the products that are both in stock and ship + * Then the facet counts the products that are both in stock and ship * to store "123". * * Generated from protobuf field string query = 5; @@ -227,13 +227,13 @@ class FacetKey extends \Google\Protobuf\Internal\Message * for facets with numerical values. Must not be set for facet with text * values. Maximum number of intervals is 40. * For all numerical facet keys that appear in the list of products from - * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are + * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are * computed from their distribution weekly. If the model assigns a high * score to a numerical facet key and its intervals are not specified in - * the search request, these percentiles will become the bounds - * for its intervals and will be returned in the response. If the + * the search request, these percentiles become the bounds + * for its intervals and are returned in the response. If the * facet key intervals are specified in the request, then the specified - * intervals will be returned instead. + * intervals are returned instead. * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_values * Only get facet for the given restricted values. For example, when using * "pickupInStore" as key and set restricted values to @@ -254,13 +254,13 @@ class FacetKey extends \Google\Protobuf\Internal\Message * Only get facet values that start with the given string prefix. For * example, suppose "categories" has three values "Women > Shoe", * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - * "categories" facet will give only "Women > Shoe" and "Women > Dress". + * "categories" facet gives only "Women > Shoe" and "Women > Dress". * Only supported on textual fields. Maximum is 10. * @type array|\Google\Protobuf\Internal\RepeatedField $contains * Only get facet values that contains the given strings. For example, * suppose "categories" has three values "Women > Shoe", * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - * "categories" facet will give only "Women > Shoe" and "Men > Shoe". + * "categories" facet gives only "Women > Shoe" and "Men > Shoe". * Only supported on textual fields. Maximum is 10. * @type bool $case_insensitive * True to make facet keys case insensitive when getting faceting @@ -286,7 +286,7 @@ class FacetKey extends \Google\Protobuf\Internal\Message * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restricted_values]. * @type string $query * The query that is used to compute facet for the given facet key. - * When provided, it will override the default behavior of facet + * When provided, it overrides the default behavior of facet * computation. The query syntax is the same as a filter expression. See * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for * detail syntax and limitations. Notice that there is no limitation on @@ -294,16 +294,16 @@ class FacetKey extends \Google\Protobuf\Internal\Message * when query is specified. * In the response, * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * will be always "1" and + * is always "1" and * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * will be the number of results that match the query. + * is the number of results that match the query. * For example, you can set a customized facet for "shipToStore", * where * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] * is "customizedShipToStore", and * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - * Then the facet will count the products that are both in stock and ship + * Then the facet counts the products that are both in stock and ship * to store "123". * @type bool $return_min_max * Returns the min and max value for each numerical facet intervals. @@ -420,13 +420,13 @@ public function setKey($var) * for facets with numerical values. Must not be set for facet with text * values. Maximum number of intervals is 40. * For all numerical facet keys that appear in the list of products from - * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are + * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are * computed from their distribution weekly. If the model assigns a high * score to a numerical facet key and its intervals are not specified in - * the search request, these percentiles will become the bounds - * for its intervals and will be returned in the response. If the + * the search request, these percentiles become the bounds + * for its intervals and are returned in the response. If the * facet key intervals are specified in the request, then the specified - * intervals will be returned instead. + * intervals are returned instead. * * Generated from protobuf field repeated .google.cloud.retail.v2.Interval intervals = 2; * @return \Google\Protobuf\Internal\RepeatedField @@ -441,13 +441,13 @@ public function getIntervals() * for facets with numerical values. Must not be set for facet with text * values. Maximum number of intervals is 40. * For all numerical facet keys that appear in the list of products from - * the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are + * the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are * computed from their distribution weekly. If the model assigns a high * score to a numerical facet key and its intervals are not specified in - * the search request, these percentiles will become the bounds - * for its intervals and will be returned in the response. If the + * the search request, these percentiles become the bounds + * for its intervals and are returned in the response. If the * facet key intervals are specified in the request, then the specified - * intervals will be returned instead. + * intervals are returned instead. * * Generated from protobuf field repeated .google.cloud.retail.v2.Interval intervals = 2; * @param array<\Google\Cloud\Retail\V2\Interval>|\Google\Protobuf\Internal\RepeatedField $var @@ -519,7 +519,7 @@ public function setRestrictedValues($var) * Only get facet values that start with the given string prefix. For * example, suppose "categories" has three values "Women > Shoe", * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - * "categories" facet will give only "Women > Shoe" and "Women > Dress". + * "categories" facet gives only "Women > Shoe" and "Women > Dress". * Only supported on textual fields. Maximum is 10. * * Generated from protobuf field repeated string prefixes = 8; @@ -534,7 +534,7 @@ public function getPrefixes() * Only get facet values that start with the given string prefix. For * example, suppose "categories" has three values "Women > Shoe", * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - * "categories" facet will give only "Women > Shoe" and "Women > Dress". + * "categories" facet gives only "Women > Shoe" and "Women > Dress". * Only supported on textual fields. Maximum is 10. * * Generated from protobuf field repeated string prefixes = 8; @@ -553,7 +553,7 @@ public function setPrefixes($var) * Only get facet values that contains the given strings. For example, * suppose "categories" has three values "Women > Shoe", * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - * "categories" facet will give only "Women > Shoe" and "Men > Shoe". + * "categories" facet gives only "Women > Shoe" and "Men > Shoe". * Only supported on textual fields. Maximum is 10. * * Generated from protobuf field repeated string contains = 9; @@ -568,7 +568,7 @@ public function getContains() * Only get facet values that contains the given strings. For example, * suppose "categories" has three values "Women > Shoe", * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - * "categories" facet will give only "Women > Shoe" and "Men > Shoe". + * "categories" facet gives only "Women > Shoe" and "Men > Shoe". * Only supported on textual fields. Maximum is 10. * * Generated from protobuf field repeated string contains = 9; @@ -673,7 +673,7 @@ public function setOrderBy($var) /** * The query that is used to compute facet for the given facet key. - * When provided, it will override the default behavior of facet + * When provided, it overrides the default behavior of facet * computation. The query syntax is the same as a filter expression. See * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for * detail syntax and limitations. Notice that there is no limitation on @@ -681,16 +681,16 @@ public function setOrderBy($var) * when query is specified. * In the response, * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * will be always "1" and + * is always "1" and * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * will be the number of results that match the query. + * is the number of results that match the query. * For example, you can set a customized facet for "shipToStore", * where * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] * is "customizedShipToStore", and * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - * Then the facet will count the products that are both in stock and ship + * Then the facet counts the products that are both in stock and ship * to store "123". * * Generated from protobuf field string query = 5; @@ -703,7 +703,7 @@ public function getQuery() /** * The query that is used to compute facet for the given facet key. - * When provided, it will override the default behavior of facet + * When provided, it overrides the default behavior of facet * computation. The query syntax is the same as a filter expression. See * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for * detail syntax and limitations. Notice that there is no limitation on @@ -711,16 +711,16 @@ public function getQuery() * when query is specified. * In the response, * [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - * will be always "1" and + * is always "1" and * [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - * will be the number of results that match the query. + * is the number of results that match the query. * For example, you can set a customized facet for "shipToStore", * where * [FacetKey.key][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.key] * is "customizedShipToStore", and * [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - * Then the facet will count the products that are both in stock and ship + * Then the facet counts the products that are both in stock and ship * to store "123". * * Generated from protobuf field string query = 5; diff --git a/Retail/src/V2/ServingConfig.php b/Retail/src/V2/ServingConfig.php index 60300899b3c1..3c7e9061df1a 100644 --- a/Retail/src/V2/ServingConfig.php +++ b/Retail/src/V2/ServingConfig.php @@ -236,6 +236,13 @@ class ServingConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field string enable_category_filter_level = 16; */ private $enable_category_filter_level = ''; + /** + * When the flag is enabled, the products in the denylist will not be filtered + * out in the recommendation filtering results. + * + * Generated from protobuf field bool ignore_recs_denylist = 24; + */ + private $ignore_recs_denylist = false; /** * The specification for personalization spec. * Can only be set if @@ -419,6 +426,9 @@ class ServingConfig extends \Google\Protobuf\Internal\Message * Can only be set if * [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + * @type bool $ignore_recs_denylist + * When the flag is enabled, the products in the denylist will not be filtered + * out in the recommendation filtering results. * @type \Google\Cloud\Retail\V2\SearchRequest\PersonalizationSpec $personalization_spec * The specification for personalization spec. * Can only be set if @@ -1130,6 +1140,34 @@ public function setEnableCategoryFilterLevel($var) return $this; } + /** + * When the flag is enabled, the products in the denylist will not be filtered + * out in the recommendation filtering results. + * + * Generated from protobuf field bool ignore_recs_denylist = 24; + * @return bool + */ + public function getIgnoreRecsDenylist() + { + return $this->ignore_recs_denylist; + } + + /** + * When the flag is enabled, the products in the denylist will not be filtered + * out in the recommendation filtering results. + * + * Generated from protobuf field bool ignore_recs_denylist = 24; + * @param bool $var + * @return $this + */ + public function setIgnoreRecsDenylist($var) + { + GPBUtil::checkBool($var); + $this->ignore_recs_denylist = $var; + + return $this; + } + /** * The specification for personalization spec. * Can only be set if diff --git a/Retail/src/V2/UserEvent.php b/Retail/src/V2/UserEvent.php index aa33cff0e247..9650ad0818a8 100644 --- a/Retail/src/V2/UserEvent.php +++ b/Retail/src/V2/UserEvent.php @@ -19,6 +19,7 @@ class UserEvent extends \Google\Protobuf\Internal\Message /** * Required. User event type. Allowed values are: * * `add-to-cart`: Products being added to cart. + * * `remove-from-cart`: Products being removed from cart. * * `category-page-view`: Special pages such as sale or promotion pages * viewed. * * `detail-page-view`: Products detail page viewed. @@ -278,8 +279,8 @@ class UserEvent extends \Google\Protobuf\Internal\Message * The entity for customers that may run multiple different entities, domains, * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * It is recommended to set this field to get better per-entity search, - * completion and prediction results. + * We recommend that you set this field to get better per-entity search, + * completion, and prediction results. * * Generated from protobuf field string entity = 23; */ @@ -294,6 +295,7 @@ class UserEvent extends \Google\Protobuf\Internal\Message * @type string $event_type * Required. User event type. Allowed values are: * * `add-to-cart`: Products being added to cart. + * * `remove-from-cart`: Products being removed from cart. * * `category-page-view`: Special pages such as sale or promotion pages * viewed. * * `detail-page-view`: Products detail page viewed. @@ -473,8 +475,8 @@ class UserEvent extends \Google\Protobuf\Internal\Message * The entity for customers that may run multiple different entities, domains, * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * It is recommended to set this field to get better per-entity search, - * completion and prediction results. + * We recommend that you set this field to get better per-entity search, + * completion, and prediction results. * } */ public function __construct($data = NULL) { @@ -485,6 +487,7 @@ public function __construct($data = NULL) { /** * Required. User event type. Allowed values are: * * `add-to-cart`: Products being added to cart. + * * `remove-from-cart`: Products being removed from cart. * * `category-page-view`: Special pages such as sale or promotion pages * viewed. * * `detail-page-view`: Products detail page viewed. @@ -506,6 +509,7 @@ public function getEventType() /** * Required. User event type. Allowed values are: * * `add-to-cart`: Products being added to cart. + * * `remove-from-cart`: Products being removed from cart. * * `category-page-view`: Special pages such as sale or promotion pages * viewed. * * `detail-page-view`: Products detail page viewed. @@ -1322,8 +1326,8 @@ public function setPageViewId($var) * The entity for customers that may run multiple different entities, domains, * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * It is recommended to set this field to get better per-entity search, - * completion and prediction results. + * We recommend that you set this field to get better per-entity search, + * completion, and prediction results. * * Generated from protobuf field string entity = 23; * @return string @@ -1337,8 +1341,8 @@ public function getEntity() * The entity for customers that may run multiple different entities, domains, * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * It is recommended to set this field to get better per-entity search, - * completion and prediction results. + * We recommend that you set this field to get better per-entity search, + * completion, and prediction results. * * Generated from protobuf field string entity = 23; * @param string $var diff --git a/Retail/src/V2/gapic_metadata.json b/Retail/src/V2/gapic_metadata.json index e974d0681272..7c30c861c0d5 100644 --- a/Retail/src/V2/gapic_metadata.json +++ b/Retail/src/V2/gapic_metadata.json @@ -239,6 +239,11 @@ "listProducts" ] }, + "PurgeProducts": { + "methods": [ + "purgeProducts" + ] + }, "RemoveFulfillmentPlaces": { "methods": [ "removeFulfillmentPlaces" diff --git a/Retail/src/V2/resources/analytics_service_client_config.json b/Retail/src/V2/resources/analytics_service_client_config.json index 6efec10116d6..aa40f9904b75 100644 --- a/Retail/src/V2/resources/analytics_service_client_config.json +++ b/Retail/src/V2/resources/analytics_service_client_config.json @@ -3,7 +3,7 @@ "google.cloud.retail.v2.AnalyticsService": { "retry_codes": { "no_retry_codes": [], - "retry_policy_3_codes": [ + "retry_policy_4_codes": [ "UNAVAILABLE", "DEADLINE_EXCEEDED" ] @@ -18,7 +18,7 @@ "max_rpc_timeout_millis": 0, "total_timeout_millis": 0 }, - "retry_policy_3_params": { + "retry_policy_4_params": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, @@ -31,8 +31,8 @@ "methods": { "ExportAnalyticsMetrics": { "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" } } } diff --git a/Retail/src/V2/resources/model_service_client_config.json b/Retail/src/V2/resources/model_service_client_config.json index 41d881361688..0e96f5ce8c6e 100644 --- a/Retail/src/V2/resources/model_service_client_config.json +++ b/Retail/src/V2/resources/model_service_client_config.json @@ -3,7 +3,7 @@ "google.cloud.retail.v2.ModelService": { "retry_codes": { "no_retry_codes": [], - "retry_policy_3_codes": [ + "retry_policy_4_codes": [ "UNAVAILABLE", "DEADLINE_EXCEEDED" ] @@ -18,7 +18,7 @@ "max_rpc_timeout_millis": 0, "total_timeout_millis": 0 }, - "retry_policy_3_params": { + "retry_policy_4_params": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, @@ -31,43 +31,43 @@ "methods": { "CreateModel": { "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" }, "DeleteModel": { "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" }, "GetModel": { "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" }, "ListModels": { "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" }, "PauseModel": { "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" }, "ResumeModel": { "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" }, "TuneModel": { "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" }, "UpdateModel": { "timeout_millis": 60000, - "retry_codes_name": "retry_policy_3_codes", - "retry_params_name": "retry_policy_3_params" + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" } } } diff --git a/Retail/src/V2/resources/product_service_client_config.json b/Retail/src/V2/resources/product_service_client_config.json index 6934201597bd..cd5260972f02 100644 --- a/Retail/src/V2/resources/product_service_client_config.json +++ b/Retail/src/V2/resources/product_service_client_config.json @@ -3,11 +3,11 @@ "google.cloud.retail.v2.ProductService": { "retry_codes": { "no_retry_codes": [], - "retry_policy_2_codes": [ + "retry_policy_3_codes": [ "UNAVAILABLE", "DEADLINE_EXCEEDED" ], - "retry_policy_4_codes": [ + "retry_policy_5_codes": [ "UNAVAILABLE", "DEADLINE_EXCEEDED" ] @@ -22,7 +22,7 @@ "max_rpc_timeout_millis": 0, "total_timeout_millis": 0 }, - "retry_policy_2_params": { + "retry_policy_3_params": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 30000, @@ -31,7 +31,7 @@ "max_rpc_timeout_millis": 30000, "total_timeout_millis": 30000 }, - "retry_policy_4_params": { + "retry_policy_5_params": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 300000, @@ -44,58 +44,63 @@ "methods": { "AddFulfillmentPlaces": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "AddLocalInventories": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "CreateProduct": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "DeleteProduct": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "GetProduct": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "ImportProducts": { "timeout_millis": 300000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" }, "ListProducts": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "PurgeProducts": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "RemoveFulfillmentPlaces": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "RemoveLocalInventories": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "SetInventory": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "UpdateProduct": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" } } } diff --git a/Retail/src/V2/resources/product_service_descriptor_config.php b/Retail/src/V2/resources/product_service_descriptor_config.php index a64d175f1efd..24cfd2c05def 100644 --- a/Retail/src/V2/resources/product_service_descriptor_config.php +++ b/Retail/src/V2/resources/product_service_descriptor_config.php @@ -80,6 +80,25 @@ ], ], ], + 'PurgeProducts' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Retail\V2\PurgeProductsResponse', + 'metadataReturnType' => '\Google\Cloud\Retail\V2\PurgeProductsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'RemoveFulfillmentPlaces' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Retail\V2\RemoveFulfillmentPlacesResponse', diff --git a/Retail/src/V2/resources/product_service_rest_client_config.php b/Retail/src/V2/resources/product_service_rest_client_config.php index e896c5dba858..a7470a66da8c 100644 --- a/Retail/src/V2/resources/product_service_rest_client_config.php +++ b/Retail/src/V2/resources/product_service_rest_client_config.php @@ -107,6 +107,18 @@ ], ], ], + 'PurgeProducts' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'RemoveFulfillmentPlaces' => [ 'method' => 'post', 'uriTemplate' => '/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces', diff --git a/Retail/src/V2/resources/user_event_service_client_config.json b/Retail/src/V2/resources/user_event_service_client_config.json index 92d9b5f139fa..3715586469ab 100644 --- a/Retail/src/V2/resources/user_event_service_client_config.json +++ b/Retail/src/V2/resources/user_event_service_client_config.json @@ -3,15 +3,15 @@ "google.cloud.retail.v2.UserEventService": { "retry_codes": { "no_retry_codes": [], - "retry_policy_1_codes": [ + "retry_policy_2_codes": [ "UNAVAILABLE", "DEADLINE_EXCEEDED" ], - "retry_policy_2_codes": [ + "retry_policy_3_codes": [ "UNAVAILABLE", "DEADLINE_EXCEEDED" ], - "retry_policy_5_codes": [ + "retry_policy_6_codes": [ "UNAVAILABLE", "DEADLINE_EXCEEDED" ] @@ -26,16 +26,16 @@ "max_rpc_timeout_millis": 0, "total_timeout_millis": 0 }, - "retry_policy_1_params": { + "retry_policy_2_params": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 5000, - "initial_rpc_timeout_millis": 5000, + "initial_rpc_timeout_millis": 10000, "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 5000, - "total_timeout_millis": 5000 + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 }, - "retry_policy_2_params": { + "retry_policy_3_params": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 30000, @@ -44,7 +44,7 @@ "max_rpc_timeout_millis": 30000, "total_timeout_millis": 30000 }, - "retry_policy_5_params": { + "retry_policy_6_params": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 300000, @@ -56,29 +56,29 @@ }, "methods": { "CollectUserEvent": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" }, "ImportUserEvents": { "timeout_millis": 600000, - "retry_codes_name": "retry_policy_5_codes", - "retry_params_name": "retry_policy_5_params" + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" }, "PurgeUserEvents": { "timeout_millis": 30000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "RejoinUserEvents": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" }, "WriteUserEvent": { - "timeout_millis": 5000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" } } } diff --git a/Retail/tests/Unit/V2/Client/ProductServiceClientTest.php b/Retail/tests/Unit/V2/Client/ProductServiceClientTest.php index 2d7cd3c1dad6..0a493e35946b 100644 --- a/Retail/tests/Unit/V2/Client/ProductServiceClientTest.php +++ b/Retail/tests/Unit/V2/Client/ProductServiceClientTest.php @@ -41,6 +41,8 @@ use Google\Cloud\Retail\V2\ListProductsResponse; use Google\Cloud\Retail\V2\Product; use Google\Cloud\Retail\V2\ProductInputConfig; +use Google\Cloud\Retail\V2\PurgeProductsRequest; +use Google\Cloud\Retail\V2\PurgeProductsResponse; use Google\Cloud\Retail\V2\RemoveFulfillmentPlacesRequest; use Google\Cloud\Retail\V2\RemoveFulfillmentPlacesResponse; use Google\Cloud\Retail\V2\RemoveLocalInventoriesRequest; @@ -775,6 +777,135 @@ public function listProductsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function purgeProductsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/purgeProductsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $purgeCount = 575305851; + $expectedResponse = new PurgeProductsResponse(); + $expectedResponse->setPurgeCount($purgeCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/purgeProductsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $filter = 'filter-1274492040'; + $request = (new PurgeProductsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->purgeProducts($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ProductService/PurgeProducts', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/purgeProductsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function purgeProductsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/purgeProductsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $filter = 'filter-1274492040'; + $request = (new PurgeProductsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->purgeProducts($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/purgeProductsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function removeFulfillmentPlacesTest() { diff --git a/Retail/tests/Unit/V2/Client/ServingConfigServiceClientTest.php b/Retail/tests/Unit/V2/Client/ServingConfigServiceClientTest.php index 5402ff62c775..e8de958c4ea6 100644 --- a/Retail/tests/Unit/V2/Client/ServingConfigServiceClientTest.php +++ b/Retail/tests/Unit/V2/Client/ServingConfigServiceClientTest.php @@ -83,6 +83,7 @@ public function addControlTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -90,6 +91,7 @@ public function addControlTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); @@ -163,6 +165,7 @@ public function createServingConfigTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -170,6 +173,7 @@ public function createServingConfigTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); @@ -318,6 +322,7 @@ public function getServingConfigTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); @@ -325,6 +330,7 @@ public function getServingConfigTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); @@ -464,6 +470,7 @@ public function removeControlTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -471,6 +478,7 @@ public function removeControlTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); @@ -544,6 +552,7 @@ public function updateServingConfigTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -551,6 +560,7 @@ public function updateServingConfigTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $servingConfig = new ServingConfig(); @@ -626,6 +636,7 @@ public function addControlAsyncTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -633,6 +644,7 @@ public function addControlAsyncTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); diff --git a/Retail/tests/Unit/V2/ProductServiceClientTest.php b/Retail/tests/Unit/V2/ProductServiceClientTest.php index 9bcacce3209b..e859eb2a279b 100644 --- a/Retail/tests/Unit/V2/ProductServiceClientTest.php +++ b/Retail/tests/Unit/V2/ProductServiceClientTest.php @@ -34,6 +34,7 @@ use Google\Cloud\Retail\V2\Product; use Google\Cloud\Retail\V2\ProductInputConfig; use Google\Cloud\Retail\V2\ProductServiceClient; +use Google\Cloud\Retail\V2\PurgeProductsResponse; use Google\Cloud\Retail\V2\RemoveFulfillmentPlacesResponse; use Google\Cloud\Retail\V2\RemoveLocalInventoriesResponse; use Google\Cloud\Retail\V2\SetInventoryResponse; @@ -724,6 +725,129 @@ public function listProductsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function purgeProductsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/purgeProductsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $purgeCount = 575305851; + $expectedResponse = new PurgeProductsResponse(); + $expectedResponse->setPurgeCount($purgeCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/purgeProductsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $filter = 'filter-1274492040'; + $response = $gapicClient->purgeProducts($formattedParent, $filter); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.retail.v2.ProductService/PurgeProducts', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/purgeProductsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function purgeProductsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/purgeProductsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->branchName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[BRANCH]'); + $filter = 'filter-1274492040'; + $response = $gapicClient->purgeProducts($formattedParent, $filter); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/purgeProductsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function removeFulfillmentPlacesTest() { diff --git a/Retail/tests/Unit/V2/ServingConfigServiceClientTest.php b/Retail/tests/Unit/V2/ServingConfigServiceClientTest.php index 992220cf2157..c8ff9ac6e486 100644 --- a/Retail/tests/Unit/V2/ServingConfigServiceClientTest.php +++ b/Retail/tests/Unit/V2/ServingConfigServiceClientTest.php @@ -76,6 +76,7 @@ public function addControlTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -83,6 +84,7 @@ public function addControlTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); @@ -150,6 +152,7 @@ public function createServingConfigTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -157,6 +160,7 @@ public function createServingConfigTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); @@ -293,6 +297,7 @@ public function getServingConfigTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); @@ -300,6 +305,7 @@ public function getServingConfigTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); @@ -431,6 +437,7 @@ public function removeControlTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -438,6 +445,7 @@ public function removeControlTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $formattedServingConfig = $gapicClient->servingConfigName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[SERVING_CONFIG]'); @@ -505,6 +513,7 @@ public function updateServingConfigTest() $priceRerankingLevel = 'priceRerankingLevel1240955890'; $diversityLevel = 'diversityLevel1294448926'; $enableCategoryFilterLevel = 'enableCategoryFilterLevel-215507998'; + $ignoreRecsDenylist = false; $expectedResponse = new ServingConfig(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -512,6 +521,7 @@ public function updateServingConfigTest() $expectedResponse->setPriceRerankingLevel($priceRerankingLevel); $expectedResponse->setDiversityLevel($diversityLevel); $expectedResponse->setEnableCategoryFilterLevel($enableCategoryFilterLevel); + $expectedResponse->setIgnoreRecsDenylist($ignoreRecsDenylist); $transport->addResponse($expectedResponse); // Mock request $servingConfig = new ServingConfig(); diff --git a/Run/.repo-metadata.json b/Run/.repo-metadata.json deleted file mode 100644 index 022c308695eb..000000000000 --- a/Run/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-run", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-run/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "run" -} diff --git a/Run/VERSION b/Run/VERSION index f374f6662e9a..965065db5b84 100644 --- a/Run/VERSION +++ b/Run/VERSION @@ -1 +1 @@ -0.9.1 +0.9.3 diff --git a/Run/composer.json b/Run/composer.json index b6e3511fd10e..bd8024cc81c2 100644 --- a/Run/composer.json +++ b/Run/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Scheduler/.repo-metadata.json b/Scheduler/.repo-metadata.json deleted file mode 100644 index fe3068a70138..000000000000 --- a/Scheduler/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-scheduler", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-scheduler/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudscheduler" -} diff --git a/Scheduler/VERSION b/Scheduler/VERSION index 587c5f0c7309..db77e0ee9760 100644 --- a/Scheduler/VERSION +++ b/Scheduler/VERSION @@ -1 +1 @@ -1.10.3 +1.10.5 diff --git a/Scheduler/composer.json b/Scheduler/composer.json index 63512c75c94c..1d27a4fdda28 100644 --- a/Scheduler/composer.json +++ b/Scheduler/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/SecretManager/.repo-metadata.json b/SecretManager/.repo-metadata.json deleted file mode 100644 index 58379895a86c..000000000000 --- a/SecretManager/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-secret-manager", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-secret-manager/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "secretmanager" -} diff --git a/SecretManager/VERSION b/SecretManager/VERSION index 141f2e805beb..42cf0675c566 100644 --- a/SecretManager/VERSION +++ b/SecretManager/VERSION @@ -1 +1 @@ -1.15.0 +1.15.2 diff --git a/SecretManager/composer.json b/SecretManager/composer.json index 5ef9e703f9a2..b70bfc1a836a 100644 --- a/SecretManager/composer.json +++ b/SecretManager/composer.json @@ -25,7 +25,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/SecureSourceManager/.repo-metadata.json b/SecureSourceManager/.repo-metadata.json deleted file mode 100644 index f41a49ff176f..000000000000 --- a/SecureSourceManager/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-securesourcemanager", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-securesourcemanager/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "securesourcemanager" -} diff --git a/SecureSourceManager/VERSION b/SecureSourceManager/VERSION index 7179039691ce..3a4036fb450f 100644 --- a/SecureSourceManager/VERSION +++ b/SecureSourceManager/VERSION @@ -1 +1 @@ -0.2.3 +0.2.5 diff --git a/SecureSourceManager/composer.json b/SecureSourceManager/composer.json index b8f9e7275411..01d834ec3e73 100644 --- a/SecureSourceManager/composer.json +++ b/SecureSourceManager/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/SecureSourceManager/src/V1/Client/SecureSourceManagerClient.php b/SecureSourceManager/src/V1/Client/SecureSourceManagerClient.php index 016a49abb4f3..6f118877094e 100644 --- a/SecureSourceManager/src/V1/Client/SecureSourceManagerClient.php +++ b/SecureSourceManager/src/V1/Client/SecureSourceManagerClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -53,6 +52,7 @@ use Google\Cloud\SecureSourceManager\V1\ListInstancesRequest; use Google\Cloud\SecureSourceManager\V1\ListRepositoriesRequest; use Google\Cloud\SecureSourceManager\V1\Repository; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -182,6 +182,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a crypto_key * resource. diff --git a/SecureSourceManager/tests/Unit/V1/Client/SecureSourceManagerClientTest.php b/SecureSourceManager/tests/Unit/V1/Client/SecureSourceManagerClientTest.php index c2abfa77a4c1..1850c4c03286 100644 --- a/SecureSourceManager/tests/Unit/V1/Client/SecureSourceManagerClientTest.php +++ b/SecureSourceManager/tests/Unit/V1/Client/SecureSourceManagerClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Iam\V1\GetIamPolicyRequest; @@ -49,6 +48,7 @@ use Google\Cloud\SecureSourceManager\V1\ListRepositoriesRequest; use Google\Cloud\SecureSourceManager\V1\ListRepositoriesResponse; use Google\Cloud\SecureSourceManager\V1\Repository; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/SecurityCenter/.repo-metadata.json b/SecurityCenter/.repo-metadata.json deleted file mode 100644 index 41cc012724c5..000000000000 --- a/SecurityCenter/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-security-center", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-security-center/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "securitycenter" -} diff --git a/SecurityCenter/VERSION b/SecurityCenter/VERSION index cfc730712d5d..bf4df28efca7 100644 --- a/SecurityCenter/VERSION +++ b/SecurityCenter/VERSION @@ -1 +1 @@ -1.28.0 +1.28.2 diff --git a/SecurityCenter/composer.json b/SecurityCenter/composer.json index d2c0d5391ab4..ef99afb9dbaa 100644 --- a/SecurityCenter/composer.json +++ b/SecurityCenter/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/SecurityCenter/src/V2/Client/SecurityCenterClient.php b/SecurityCenter/src/V2/Client/SecurityCenterClient.php index 23ebca8d78cb..2f41e7df8dab 100644 --- a/SecurityCenter/src/V2/Client/SecurityCenterClient.php +++ b/SecurityCenter/src/V2/Client/SecurityCenterClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -88,6 +87,7 @@ use Google\Cloud\SecurityCenter\V2\UpdateSecurityMarksRequest; use Google\Cloud\SecurityCenter\V2\UpdateSourceRequest; use Google\Cloud\SecurityCenter\V2\ValuedResource; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -222,6 +222,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * big_query_export resource. diff --git a/SecurityCenter/tests/Unit/V2/Client/SecurityCenterClientTest.php b/SecurityCenter/tests/Unit/V2/Client/SecurityCenterClientTest.php index 84f082146410..1fa344e78293 100644 --- a/SecurityCenter/tests/Unit/V2/Client/SecurityCenterClientTest.php +++ b/SecurityCenter/tests/Unit/V2/Client/SecurityCenterClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Iam\V1\GetIamPolicyRequest; @@ -97,6 +96,7 @@ use Google\Cloud\SecurityCenter\V2\UpdateSecurityMarksRequest; use Google\Cloud\SecurityCenter\V2\UpdateSourceRequest; use Google\Cloud\SecurityCenter\V2\ValuedResource; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/SecurityCenterManagement/.repo-metadata.json b/SecurityCenterManagement/.repo-metadata.json deleted file mode 100644 index 5614c7841fc2..000000000000 --- a/SecurityCenterManagement/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-securitycentermanagement", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-securitycentermanagement/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "securitycentermanagement" -} diff --git a/SecurityCenterManagement/VERSION b/SecurityCenterManagement/VERSION index 53a75d673557..d15723fbe8de 100644 --- a/SecurityCenterManagement/VERSION +++ b/SecurityCenterManagement/VERSION @@ -1 +1 @@ -0.2.6 +0.3.2 diff --git a/SecurityCenterManagement/composer.json b/SecurityCenterManagement/composer.json index 7a35e08ad721..6525be6e8dcc 100644 --- a/SecurityCenterManagement/composer.json +++ b/SecurityCenterManagement/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/SecurityCenterManagement/metadata/V1/SecurityCenterManagement.php b/SecurityCenterManagement/metadata/V1/SecurityCenterManagement.php index 35852f0c46a7ddf43b1f5a85a31e0828c81e1dbc..993d200288e858a980171037b2a842fc9b21faf5 100644 GIT binary patch delta 1904 zcmbVNUr19?9Om9_I?txd6KmIrIqz7kX-;nvIWxKD+QxM0mIaoKIgc{jrtaRYB#bER zB_iUyhSak~#a@M8dW!x$7$H(1(L?kQN^eooy}NVn*fy%i-E)55_xrxz_dENzN_~Du zJy}v~ZoQ&_@2=mMT~qt1kw*X+LnxX~#l(eEC@G>;2&FQyD1!Asos1+9Ls=+$O}}cB z*TPGnAtqf(PNK;$N=7E)C?S=E1u-HbhL-NtacA(hp3@g2;oe%4?J_Wr*DTN^;2UIg?K^X-c2bxSIo>m;!aRJ#5mINhLx#;5*JC1K#ySQ3V;|qA*LEl;Tz&=XC zt#$|a{z2&n4fQ}f;0r0gRIYXU3;&h|z4&Rh9e=IW8VCmH#mibd9x`ajK?u$(d9xSc zX}mRV!-IyJ@>hbm(ctnB$VCW_145}}3Y@Xz_iR%Y*U`gfK(hylB{LmF^JyfAFhoS# zy~)$x`MzDLLqtRD3I$pQV?t?2VFz;*RLw27{ZB&FvHN&-W|eAT%(42Jqj4?yvStZ$2eOv{6+(&++d(j3b6yfKdCbk z6nS&ac)Pw;R%jtk*%#CXpL?XPuYJPwDg|BmT6YWX@MuXG!Rc5W>w(?)*=c);6CUvfmjM3(NfEx%L_ESk3dWBS@azwIgSVE6Oj}VLa-!bQ zT+o^6lwStre}+skzH{!NJTf0aA=~dNm&&m?H&O}l;egHm4`?awd<8Vrjt!o}j=#st JE?;;~{|0Qsp1%M9 delta 59 zcmV-B0L1_3)&b(Y0kDMx1%setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SecurityCenterService $response */ + $response = $securityCenterManagementClient->getSecurityCenterService($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 = SecurityCenterManagementClient::securityCenterServiceName( + '[PROJECT]', + '[LOCATION]', + '[SERVICE]' + ); + + get_security_center_service_sample($formattedName); +} +// [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityCenterService_sync] diff --git a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_descendant_event_threat_detection_custom_modules.php b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_descendant_event_threat_detection_custom_modules.php index f1b6f6a939cd..23c295c639b4 100644 --- a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_descendant_event_threat_detection_custom_modules.php +++ b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_descendant_event_threat_detection_custom_modules.php @@ -34,10 +34,10 @@ * given Resource Manager parent and its descendants. * * @param string $formattedParent Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. */ function list_descendant_event_threat_detection_custom_modules_sample( diff --git a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_descendant_security_health_analytics_custom_modules.php b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_descendant_security_health_analytics_custom_modules.php index 8a0b48c2cd99..16b8fca809b1 100644 --- a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_descendant_security_health_analytics_custom_modules.php +++ b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_descendant_security_health_analytics_custom_modules.php @@ -33,11 +33,12 @@ * Returns a list of all resident SecurityHealthAnalyticsCustomModules under * the given CRM parent and all of the parent's CRM descendants. * - * @param string $formattedParent Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * @param string $formattedParent Name of the parent organization, folder, or project in which to + * list custom modules, specified in one of the following formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. */ function list_descendant_security_health_analytics_custom_modules_sample( diff --git a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_effective_event_threat_detection_custom_modules.php b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_effective_event_threat_detection_custom_modules.php index a8e26e0f9596..033056c3a15d 100644 --- a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_effective_event_threat_detection_custom_modules.php +++ b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_effective_event_threat_detection_custom_modules.php @@ -35,10 +35,10 @@ * parent along with modules inherited from its ancestors. * * @param string $formattedParent Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. */ function list_effective_event_threat_detection_custom_modules_sample( diff --git a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_effective_security_health_analytics_custom_modules.php b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_effective_security_health_analytics_custom_modules.php index d3c895e2dcfa..e752bde456c7 100644 --- a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_effective_security_health_analytics_custom_modules.php +++ b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_effective_security_health_analytics_custom_modules.php @@ -35,11 +35,12 @@ * parent, and inherited modules, inherited from CRM ancestors (no * descendants). * - * @param string $formattedParent Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * @param string $formattedParent Name of parent to list effective custom modules. specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. */ function list_effective_security_health_analytics_custom_modules_sample( diff --git a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_event_threat_detection_custom_modules.php b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_event_threat_detection_custom_modules.php index 88440cfc8cf0..3d1de8512479 100644 --- a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_event_threat_detection_custom_modules.php +++ b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_event_threat_detection_custom_modules.php @@ -35,10 +35,10 @@ * scope of the parent along with modules inherited from ancestors. * * @param string $formattedParent Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. */ function list_event_threat_detection_custom_modules_sample(string $formattedParent): void diff --git a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_security_center_services.php b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_security_center_services.php new file mode 100644 index 000000000000..ead3764fc0b0 --- /dev/null +++ b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_security_center_services.php @@ -0,0 +1,86 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $securityCenterManagementClient->listSecurityCenterServices($request); + + /** @var SecurityCenterService $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = SecurityCenterManagementClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + + list_security_center_services_sample($formattedParent); +} +// [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityCenterServices_sync] diff --git a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_security_health_analytics_custom_modules.php b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_security_health_analytics_custom_modules.php index c3973601135e..345420db4ca7 100644 --- a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_security_health_analytics_custom_modules.php +++ b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/list_security_health_analytics_custom_modules.php @@ -34,11 +34,12 @@ * parent. This includes resident modules defined at the scope of the parent, * and inherited modules, inherited from CRM ancestors (no descendants). * - * @param string $formattedParent Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * @param string $formattedParent Name of parent organization, folder, or project in which to list + * custom modules, specified in one of the following formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. */ function list_security_health_analytics_custom_modules_sample(string $formattedParent): void diff --git a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/update_security_center_service.php b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/update_security_center_service.php new file mode 100644 index 000000000000..004b435f70f8 --- /dev/null +++ b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/update_security_center_service.php @@ -0,0 +1,62 @@ +setSecurityCenterService($securityCenterService) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var SecurityCenterService $response */ + $response = $securityCenterManagementClient->updateSecurityCenterService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityCenterService_sync] diff --git a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/validate_event_threat_detection_custom_module.php b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/validate_event_threat_detection_custom_module.php index bede785fceaa..651855f64a10 100644 --- a/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/validate_event_threat_detection_custom_module.php +++ b/SecurityCenterManagement/samples/V1/SecurityCenterManagementClient/validate_event_threat_detection_custom_module.php @@ -35,7 +35,7 @@ * * Its format is: * - * * "organizations/{organization}/locations/{location}". Please see + * * `organizations/{organization}/locations/{location}`. Please see * {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. * @param string $rawText The raw text of the module's contents. Used to generate error * messages. diff --git a/SecurityCenterManagement/src/V1/Client/SecurityCenterManagementClient.php b/SecurityCenterManagement/src/V1/Client/SecurityCenterManagementClient.php index 1ed9613cad2d..6c12ef5c3016 100644 --- a/SecurityCenterManagement/src/V1/Client/SecurityCenterManagementClient.php +++ b/SecurityCenterManagement/src/V1/Client/SecurityCenterManagementClient.php @@ -46,17 +46,21 @@ use Google\Cloud\SecurityCenterManagement\V1\GetEffectiveEventThreatDetectionCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\GetEventThreatDetectionCustomModuleRequest; +use Google\Cloud\SecurityCenterManagement\V1\GetSecurityCenterServiceRequest; use Google\Cloud\SecurityCenterManagement\V1\GetSecurityHealthAnalyticsCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\ListDescendantEventThreatDetectionCustomModulesRequest; use Google\Cloud\SecurityCenterManagement\V1\ListDescendantSecurityHealthAnalyticsCustomModulesRequest; use Google\Cloud\SecurityCenterManagement\V1\ListEffectiveEventThreatDetectionCustomModulesRequest; use Google\Cloud\SecurityCenterManagement\V1\ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; use Google\Cloud\SecurityCenterManagement\V1\ListEventThreatDetectionCustomModulesRequest; +use Google\Cloud\SecurityCenterManagement\V1\ListSecurityCenterServicesRequest; use Google\Cloud\SecurityCenterManagement\V1\ListSecurityHealthAnalyticsCustomModulesRequest; +use Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService; use Google\Cloud\SecurityCenterManagement\V1\SecurityHealthAnalyticsCustomModule; use Google\Cloud\SecurityCenterManagement\V1\SimulateSecurityHealthAnalyticsCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\SimulateSecurityHealthAnalyticsCustomModuleResponse; use Google\Cloud\SecurityCenterManagement\V1\UpdateEventThreatDetectionCustomModuleRequest; +use Google\Cloud\SecurityCenterManagement\V1\UpdateSecurityCenterServiceRequest; use Google\Cloud\SecurityCenterManagement\V1\UpdateSecurityHealthAnalyticsCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\ValidateEventThreatDetectionCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\ValidateEventThreatDetectionCustomModuleResponse; @@ -80,15 +84,18 @@ * @method PromiseInterface getEffectiveEventThreatDetectionCustomModuleAsync(GetEffectiveEventThreatDetectionCustomModuleRequest $request, array $optionalArgs = []) * @method PromiseInterface getEffectiveSecurityHealthAnalyticsCustomModuleAsync(GetEffectiveSecurityHealthAnalyticsCustomModuleRequest $request, array $optionalArgs = []) * @method PromiseInterface getEventThreatDetectionCustomModuleAsync(GetEventThreatDetectionCustomModuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSecurityCenterServiceAsync(GetSecurityCenterServiceRequest $request, array $optionalArgs = []) * @method PromiseInterface getSecurityHealthAnalyticsCustomModuleAsync(GetSecurityHealthAnalyticsCustomModuleRequest $request, array $optionalArgs = []) * @method PromiseInterface listDescendantEventThreatDetectionCustomModulesAsync(ListDescendantEventThreatDetectionCustomModulesRequest $request, array $optionalArgs = []) * @method PromiseInterface listDescendantSecurityHealthAnalyticsCustomModulesAsync(ListDescendantSecurityHealthAnalyticsCustomModulesRequest $request, array $optionalArgs = []) * @method PromiseInterface listEffectiveEventThreatDetectionCustomModulesAsync(ListEffectiveEventThreatDetectionCustomModulesRequest $request, array $optionalArgs = []) * @method PromiseInterface listEffectiveSecurityHealthAnalyticsCustomModulesAsync(ListEffectiveSecurityHealthAnalyticsCustomModulesRequest $request, array $optionalArgs = []) * @method PromiseInterface listEventThreatDetectionCustomModulesAsync(ListEventThreatDetectionCustomModulesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSecurityCenterServicesAsync(ListSecurityCenterServicesRequest $request, array $optionalArgs = []) * @method PromiseInterface listSecurityHealthAnalyticsCustomModulesAsync(ListSecurityHealthAnalyticsCustomModulesRequest $request, array $optionalArgs = []) * @method PromiseInterface simulateSecurityHealthAnalyticsCustomModuleAsync(SimulateSecurityHealthAnalyticsCustomModuleRequest $request, array $optionalArgs = []) * @method PromiseInterface updateEventThreatDetectionCustomModuleAsync(UpdateEventThreatDetectionCustomModuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSecurityCenterServiceAsync(UpdateSecurityCenterServiceRequest $request, array $optionalArgs = []) * @method PromiseInterface updateSecurityHealthAnalyticsCustomModuleAsync(UpdateSecurityHealthAnalyticsCustomModuleRequest $request, array $optionalArgs = []) * @method PromiseInterface validateEventThreatDetectionCustomModuleAsync(ValidateEventThreatDetectionCustomModuleRequest $request, array $optionalArgs = []) * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) @@ -312,6 +319,25 @@ public static function folderLocationSecurityHealthAnalyticsCustomModuleName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_service resource. + * + * @param string $folder + * @param string $location + * @param string $service + * + * @return string The formatted folder_location_service resource. + */ + public static function folderLocationServiceName(string $folder, string $location, string $service): string + { + return self::getPathTemplate('folderLocationService')->render([ + 'folder' => $folder, + 'location' => $location, + 'service' => $service, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -435,6 +461,28 @@ public static function organizationLocationSecurityHealthAnalyticsCustomModuleNa ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_service resource. + * + * @param string $organization + * @param string $location + * @param string $service + * + * @return string The formatted organization_location_service resource. + */ + public static function organizationLocationServiceName( + string $organization, + string $location, + string $service + ): string { + return self::getPathTemplate('organizationLocationService')->render([ + 'organization' => $organization, + 'location' => $location, + 'service' => $service, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_effective_event_threat_detection_custom_module resource. @@ -523,6 +571,44 @@ public static function projectLocationSecurityHealthAnalyticsCustomModuleName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_service resource. + * + * @param string $project + * @param string $location + * @param string $service + * + * @return string The formatted project_location_service resource. + */ + public static function projectLocationServiceName(string $project, string $location, string $service): string + { + return self::getPathTemplate('projectLocationService')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * security_center_service resource. + * + * @param string $project + * @param string $location + * @param string $service + * + * @return string The formatted security_center_service resource. + */ + public static function securityCenterServiceName(string $project, string $location, string $service): string + { + return self::getPathTemplate('securityCenterService')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * security_health_analytics_custom_module resource. @@ -557,16 +643,20 @@ public static function securityHealthAnalyticsCustomModuleName( * - folderLocationEffectiveSecurityHealthAnalyticsCustomModule: folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module} * - folderLocationEventThreatDetectionCustomModule: folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module} * - folderLocationSecurityHealthAnalyticsCustomModule: folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module} + * - folderLocationService: folders/{folder}/locations/{location}/securityCenterServices/{service} * - location: projects/{project}/locations/{location} * - organizationLocation: organizations/{organization}/locations/{location} * - organizationLocationEffectiveEventThreatDetectionCustomModule: organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module} * - organizationLocationEffectiveSecurityHealthAnalyticsCustomModule: organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module} * - organizationLocationEventThreatDetectionCustomModule: organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module} * - organizationLocationSecurityHealthAnalyticsCustomModule: organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module} + * - organizationLocationService: organizations/{organization}/locations/{location}/securityCenterServices/{service} * - projectLocationEffectiveEventThreatDetectionCustomModule: projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module} * - projectLocationEffectiveSecurityHealthAnalyticsCustomModule: projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module} * - projectLocationEventThreatDetectionCustomModule: projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module} * - projectLocationSecurityHealthAnalyticsCustomModule: projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module} + * - projectLocationService: projects/{project}/locations/{location}/securityCenterServices/{service} + * - securityCenterService: projects/{project}/locations/{location}/securityCenterServices/{service} * - securityHealthAnalyticsCustomModule: organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module} * * The optional $template argument can be supplied to specify a particular pattern, @@ -880,6 +970,35 @@ public function getEventThreatDetectionCustomModule( return $this->startApiCall('GetEventThreatDetectionCustomModule', $request, $callOptions)->wait(); } + /** + * Gets service settings for the specified Security Command Center service. + * + * The async variant is + * {@see SecurityCenterManagementClient::getSecurityCenterServiceAsync()} . + * + * @example samples/V1/SecurityCenterManagementClient/get_security_center_service.php + * + * @param GetSecurityCenterServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SecurityCenterService + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSecurityCenterService( + GetSecurityCenterServiceRequest $request, + array $callOptions = [] + ): SecurityCenterService { + return $this->startApiCall('GetSecurityCenterService', $request, $callOptions)->wait(); + } + /** * Retrieves a SecurityHealthAnalyticsCustomModule. * @@ -1069,6 +1188,36 @@ public function listEventThreatDetectionCustomModules( return $this->startApiCall('ListEventThreatDetectionCustomModules', $request, $callOptions); } + /** + * Returns a list of all Security Command Center services for the given + * parent. + * + * The async variant is + * {@see SecurityCenterManagementClient::listSecurityCenterServicesAsync()} . + * + * @example samples/V1/SecurityCenterManagementClient/list_security_center_services.php + * + * @param ListSecurityCenterServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSecurityCenterServices( + ListSecurityCenterServicesRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListSecurityCenterServices', $request, $callOptions); + } + /** * Returns a list of all SecurityHealthAnalyticsCustomModules for the given * parent. This includes resident modules defined at the scope of the parent, @@ -1166,6 +1315,35 @@ public function updateEventThreatDetectionCustomModule( return $this->startApiCall('UpdateEventThreatDetectionCustomModule', $request, $callOptions)->wait(); } + /** + * Updates a Security Command Center service using the given update mask. + * + * The async variant is + * {@see SecurityCenterManagementClient::updateSecurityCenterServiceAsync()} . + * + * @example samples/V1/SecurityCenterManagementClient/update_security_center_service.php + * + * @param UpdateSecurityCenterServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SecurityCenterService + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSecurityCenterService( + UpdateSecurityCenterServiceRequest $request, + array $callOptions = [] + ): SecurityCenterService { + return $this->startApiCall('UpdateSecurityCenterService', $request, $callOptions)->wait(); + } + /** * Updates the SecurityHealthAnalyticsCustomModule under the given name based * on the given update mask. Updating the enablement state is supported on diff --git a/SecurityCenterManagement/src/V1/CreateEventThreatDetectionCustomModuleRequest.php b/SecurityCenterManagement/src/V1/CreateEventThreatDetectionCustomModuleRequest.php index d61da0e767b2..f10cdbc65818 100644 --- a/SecurityCenterManagement/src/V1/CreateEventThreatDetectionCustomModuleRequest.php +++ b/SecurityCenterManagement/src/V1/CreateEventThreatDetectionCustomModuleRequest.php @@ -17,10 +17,10 @@ class CreateEventThreatDetectionCustomModuleRequest extends \Google\Protobuf\Int { /** * Required. Name of parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -48,10 +48,10 @@ class CreateEventThreatDetectionCustomModuleRequest extends \Google\Protobuf\Int /** * @param string $parent Required. Name of parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. * @param \Google\Cloud\SecurityCenterManagement\V1\EventThreatDetectionCustomModule $eventThreatDetectionCustomModule Required. The module to create. The * event_threat_detection_custom_module.name will be ignored and server @@ -76,10 +76,10 @@ public static function build(string $parent, \Google\Cloud\SecurityCenterManagem * * @type string $parent * Required. Name of parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * @type \Google\Cloud\SecurityCenterManagement\V1\EventThreatDetectionCustomModule $event_threat_detection_custom_module * Required. The module to create. The * event_threat_detection_custom_module.name will be ignored and server @@ -101,10 +101,10 @@ public function __construct($data = NULL) { /** * Required. Name of parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -116,10 +116,10 @@ public function getParent() /** * Required. Name of parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/CreateSecurityHealthAnalyticsCustomModuleRequest.php b/SecurityCenterManagement/src/V1/CreateSecurityHealthAnalyticsCustomModuleRequest.php index cf77baa4b7e1..582fa03482dc 100644 --- a/SecurityCenterManagement/src/V1/CreateSecurityHealthAnalyticsCustomModuleRequest.php +++ b/SecurityCenterManagement/src/V1/CreateSecurityHealthAnalyticsCustomModuleRequest.php @@ -16,11 +16,11 @@ class CreateSecurityHealthAnalyticsCustomModuleRequest extends \Google\Protobuf\Internal\Message { /** - * Required. Name of the parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of the parent organization, folder, or project of the + * module, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -46,11 +46,12 @@ class CreateSecurityHealthAnalyticsCustomModuleRequest extends \Google\Protobuf\ protected $validate_only = false; /** - * @param string $parent Required. Name of the parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * @param string $parent Required. Name of the parent organization, folder, or project of the + * module, specified in one of the following formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. * @param \Google\Cloud\SecurityCenterManagement\V1\SecurityHealthAnalyticsCustomModule $securityHealthAnalyticsCustomModule Required. The resource being created * @@ -72,11 +73,11 @@ public static function build(string $parent, \Google\Cloud\SecurityCenterManagem * Optional. Data for populating the Message object. * * @type string $parent - * Required. Name of the parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of the parent organization, folder, or project of the + * module, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @type \Google\Cloud\SecurityCenterManagement\V1\SecurityHealthAnalyticsCustomModule $security_health_analytics_custom_module * Required. The resource being created * @type bool $validate_only @@ -96,11 +97,11 @@ public function __construct($data = NULL) { } /** - * Required. Name of the parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of the parent organization, folder, or project of the + * module, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -111,11 +112,11 @@ public function getParent() } /** - * Required. Name of the parent for the module. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of the parent organization, folder, or project of the + * module, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/DeleteEventThreatDetectionCustomModuleRequest.php b/SecurityCenterManagement/src/V1/DeleteEventThreatDetectionCustomModuleRequest.php index 1fe6c7ad08c5..4f08f7d5180f 100644 --- a/SecurityCenterManagement/src/V1/DeleteEventThreatDetectionCustomModuleRequest.php +++ b/SecurityCenterManagement/src/V1/DeleteEventThreatDetectionCustomModuleRequest.php @@ -18,9 +18,9 @@ class DeleteEventThreatDetectionCustomModuleRequest extends \Google\Protobuf\Int /** * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -43,9 +43,9 @@ class DeleteEventThreatDetectionCustomModuleRequest extends \Google\Protobuf\Int * * Its format is: * - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". Please see + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. Please see * {@see SecurityCenterManagementClient::eventThreatDetectionCustomModuleName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\DeleteEventThreatDetectionCustomModuleRequest @@ -67,9 +67,9 @@ public static function build(string $name): self * @type string $name * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * @type bool $validate_only * Optional. When set to true, only validations (including IAM checks) will * done for the request (module will not be deleted). An OK response indicates @@ -88,9 +88,9 @@ public function __construct($data = NULL) { /** * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -103,9 +103,9 @@ public function getName() /** * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/DeleteSecurityHealthAnalyticsCustomModuleRequest.php b/SecurityCenterManagement/src/V1/DeleteSecurityHealthAnalyticsCustomModuleRequest.php index 3c9ec160708e..ccb2146822e6 100644 --- a/SecurityCenterManagement/src/V1/DeleteSecurityHealthAnalyticsCustomModuleRequest.php +++ b/SecurityCenterManagement/src/V1/DeleteSecurityHealthAnalyticsCustomModuleRequest.php @@ -18,9 +18,9 @@ class DeleteSecurityHealthAnalyticsCustomModuleRequest extends \Google\Protobuf\ /** * Required. The resource name of the SHA custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -43,9 +43,9 @@ class DeleteSecurityHealthAnalyticsCustomModuleRequest extends \Google\Protobuf\ * * Its format is: * - * * "organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". Please see + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. Please see * {@see SecurityCenterManagementClient::securityHealthAnalyticsCustomModuleName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\DeleteSecurityHealthAnalyticsCustomModuleRequest @@ -67,9 +67,9 @@ public static function build(string $name): self * @type string $name * Required. The resource name of the SHA custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. * @type bool $validate_only * Optional. When set to true, only validations (including IAM checks) will * done for the request (module will not be deleted). An OK response indicates @@ -88,9 +88,9 @@ public function __construct($data = NULL) { /** * Required. The resource name of the SHA custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -103,9 +103,9 @@ public function getName() /** * Required. The resource name of the SHA custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". - * * "projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}". + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/EffectiveEventThreatDetectionCustomModule.php b/SecurityCenterManagement/src/V1/EffectiveEventThreatDetectionCustomModule.php index 90256280eeeb..659b3cd6a15e 100644 --- a/SecurityCenterManagement/src/V1/EffectiveEventThreatDetectionCustomModule.php +++ b/SecurityCenterManagement/src/V1/EffectiveEventThreatDetectionCustomModule.php @@ -24,9 +24,9 @@ class EffectiveEventThreatDetectionCustomModule extends \Google\Protobuf\Interna /** * Identifier. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ @@ -72,9 +72,9 @@ class EffectiveEventThreatDetectionCustomModule extends \Google\Protobuf\Interna * @type string $name * Identifier. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. * @type \Google\Protobuf\Struct $config * Output only. Config for the effective module. * @type int $enablement_state @@ -96,9 +96,9 @@ public function __construct($data = NULL) { /** * Identifier. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @return string @@ -111,9 +111,9 @@ public function getName() /** * Identifier. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @param string $var diff --git a/SecurityCenterManagement/src/V1/EffectiveSecurityHealthAnalyticsCustomModule.php b/SecurityCenterManagement/src/V1/EffectiveSecurityHealthAnalyticsCustomModule.php index 87da6b3c67d7..1345238cbc2f 100644 --- a/SecurityCenterManagement/src/V1/EffectiveSecurityHealthAnalyticsCustomModule.php +++ b/SecurityCenterManagement/src/V1/EffectiveSecurityHealthAnalyticsCustomModule.php @@ -24,13 +24,11 @@ class EffectiveSecurityHealthAnalyticsCustomModule extends \Google\Protobuf\Internal\Message { /** - * Identifier. The resource name of the custom module. - * Its format is - * "organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}", - * or - * "folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}", - * or - * "projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}" + * Identifier. The full resource name of the custom module, specified in one + * of the following formats: + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ @@ -64,13 +62,11 @@ class EffectiveSecurityHealthAnalyticsCustomModule extends \Google\Protobuf\Inte * Optional. Data for populating the Message object. * * @type string $name - * Identifier. The resource name of the custom module. - * Its format is - * "organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}", - * or - * "folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}", - * or - * "projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}" + * Identifier. The full resource name of the custom module, specified in one + * of the following formats: + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` * @type \Google\Cloud\SecurityCenterManagement\V1\CustomConfig $custom_config * Output only. The user-specified configuration for the module. * @type int $enablement_state @@ -88,13 +84,11 @@ public function __construct($data = NULL) { } /** - * Identifier. The resource name of the custom module. - * Its format is - * "organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}", - * or - * "folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}", - * or - * "projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}" + * Identifier. The full resource name of the custom module, specified in one + * of the following formats: + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @return string @@ -105,13 +99,11 @@ public function getName() } /** - * Identifier. The resource name of the custom module. - * Its format is - * "organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}", - * or - * "folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}", - * or - * "projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}" + * Identifier. The full resource name of the custom module, specified in one + * of the following formats: + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @param string $var diff --git a/SecurityCenterManagement/src/V1/EventThreatDetectionCustomModule.php b/SecurityCenterManagement/src/V1/EventThreatDetectionCustomModule.php index 871499213c60..c6dc2492db74 100644 --- a/SecurityCenterManagement/src/V1/EventThreatDetectionCustomModule.php +++ b/SecurityCenterManagement/src/V1/EventThreatDetectionCustomModule.php @@ -20,9 +20,9 @@ class EventThreatDetectionCustomModule extends \Google\Protobuf\Internal\Message /** * Identifier. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ @@ -91,9 +91,9 @@ class EventThreatDetectionCustomModule extends \Google\Protobuf\Internal\Message * @type string $name * Identifier. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * @type \Google\Protobuf\Struct $config * Optional. Config for the module. For the resident module, its config value * is defined at this level. For the inherited module, its config value is @@ -126,9 +126,9 @@ public function __construct($data = NULL) { /** * Identifier. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @return string @@ -141,9 +141,9 @@ public function getName() /** * Identifier. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @param string $var diff --git a/SecurityCenterManagement/src/V1/GetEffectiveEventThreatDetectionCustomModuleRequest.php b/SecurityCenterManagement/src/V1/GetEffectiveEventThreatDetectionCustomModuleRequest.php index 5cf9e6238825..34bdee84cc97 100644 --- a/SecurityCenterManagement/src/V1/GetEffectiveEventThreatDetectionCustomModuleRequest.php +++ b/SecurityCenterManagement/src/V1/GetEffectiveEventThreatDetectionCustomModuleRequest.php @@ -18,9 +18,9 @@ class GetEffectiveEventThreatDetectionCustomModuleRequest extends \Google\Protob /** * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -31,9 +31,9 @@ class GetEffectiveEventThreatDetectionCustomModuleRequest extends \Google\Protob * * Its format is: * - * * "organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". Please see + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. Please see * {@see SecurityCenterManagementClient::effectiveEventThreatDetectionCustomModuleName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\GetEffectiveEventThreatDetectionCustomModuleRequest @@ -55,9 +55,9 @@ public static function build(string $name): self * @type string $name * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. * } */ public function __construct($data = NULL) { @@ -68,9 +68,9 @@ public function __construct($data = NULL) { /** * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -83,9 +83,9 @@ public function getName() /** * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.php b/SecurityCenterManagement/src/V1/GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.php index 01e20495ef13..e784437bc70f 100644 --- a/SecurityCenterManagement/src/V1/GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.php +++ b/SecurityCenterManagement/src/V1/GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.php @@ -16,25 +16,24 @@ class GetEffectiveSecurityHealthAnalyticsCustomModuleRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the SHA custom module. - * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". + * Required. The full resource name of the custom module, specified in one of + * the following formats: + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ protected $name = ''; /** - * @param string $name Required. The resource name of the SHA custom module. + * @param string $name Required. The full resource name of the custom module, specified in one of + * the following formats: * - * Its format is: - * - * * "organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". Please see - * {@see SecurityCenterManagementClient::effectiveSecurityHealthAnalyticsCustomModuleName()} for help formatting this field. + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * Please see {@see SecurityCenterManagementClient::effectiveSecurityHealthAnalyticsCustomModuleName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\GetEffectiveSecurityHealthAnalyticsCustomModuleRequest * @@ -53,11 +52,11 @@ public static function build(string $name): self * Optional. Data for populating the Message object. * * @type string $name - * Required. The resource name of the SHA custom module. - * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". + * Required. The full resource name of the custom module, specified in one of + * the following formats: + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` * } */ public function __construct($data = NULL) { @@ -66,11 +65,11 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of the SHA custom module. - * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". + * Required. The full resource name of the custom module, specified in one of + * the following formats: + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -81,11 +80,11 @@ public function getName() } /** - * Required. The resource name of the SHA custom module. - * Its format is: - * * "organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". - * * "projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{module_id}". + * Required. The full resource name of the custom module, specified in one of + * the following formats: + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/GetEventThreatDetectionCustomModuleRequest.php b/SecurityCenterManagement/src/V1/GetEventThreatDetectionCustomModuleRequest.php index 12b0807bc264..e280d8f676fa 100644 --- a/SecurityCenterManagement/src/V1/GetEventThreatDetectionCustomModuleRequest.php +++ b/SecurityCenterManagement/src/V1/GetEventThreatDetectionCustomModuleRequest.php @@ -18,9 +18,9 @@ class GetEventThreatDetectionCustomModuleRequest extends \Google\Protobuf\Intern /** * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -31,9 +31,9 @@ class GetEventThreatDetectionCustomModuleRequest extends \Google\Protobuf\Intern * * Its format is: * - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". Please see + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. Please see * {@see SecurityCenterManagementClient::eventThreatDetectionCustomModuleName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\GetEventThreatDetectionCustomModuleRequest @@ -55,9 +55,9 @@ public static function build(string $name): self * @type string $name * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * } */ public function __construct($data = NULL) { @@ -68,9 +68,9 @@ public function __construct($data = NULL) { /** * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -83,9 +83,9 @@ public function getName() /** * Required. The resource name of the ETD custom module. * Its format is: - * * "organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". - * * "projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}". + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/GetSecurityCenterServiceRequest.php b/SecurityCenterManagement/src/V1/GetSecurityCenterServiceRequest.php new file mode 100644 index 000000000000..d84834c46546 --- /dev/null +++ b/SecurityCenterManagement/src/V1/GetSecurityCenterServiceRequest.php @@ -0,0 +1,135 @@ +google.cloud.securitycentermanagement.v1.GetSecurityCenterServiceRequest + */ +class GetSecurityCenterServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Security Command Center service to retrieve. + * Formats: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The possible values for id {service} are: + * * container-threat-detection + * * event-threat-detection + * * security-health-analytics + * * vm-threat-detection + * * web-security-scanner + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The Security Command Center service to retrieve. + * + * Formats: + * + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * + * The possible values for id {service} are: + * + * * container-threat-detection + * * event-threat-detection + * * security-health-analytics + * * vm-threat-detection + * * web-security-scanner + * Please see {@see SecurityCenterManagementClient::securityCenterServiceName()} for help formatting this field. + * + * @return \Google\Cloud\SecurityCenterManagement\V1\GetSecurityCenterServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The Security Command Center service to retrieve. + * Formats: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The possible values for id {service} are: + * * container-threat-detection + * * event-threat-detection + * * security-health-analytics + * * vm-threat-detection + * * web-security-scanner + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securitycentermanagement\V1\SecurityCenterManagement::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Security Command Center service to retrieve. + * Formats: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The possible values for id {service} are: + * * container-threat-detection + * * event-threat-detection + * * security-health-analytics + * * vm-threat-detection + * * web-security-scanner + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The Security Command Center service to retrieve. + * Formats: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The possible values for id {service} are: + * * container-threat-detection + * * event-threat-detection + * * security-health-analytics + * * vm-threat-detection + * * web-security-scanner + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/SecurityCenterManagement/src/V1/ListDescendantEventThreatDetectionCustomModulesRequest.php b/SecurityCenterManagement/src/V1/ListDescendantEventThreatDetectionCustomModulesRequest.php index c80385f93f54..6ea98488fc72 100644 --- a/SecurityCenterManagement/src/V1/ListDescendantEventThreatDetectionCustomModulesRequest.php +++ b/SecurityCenterManagement/src/V1/ListDescendantEventThreatDetectionCustomModulesRequest.php @@ -18,10 +18,10 @@ class ListDescendantEventThreatDetectionCustomModulesRequest extends \Google\Pro { /** * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -43,10 +43,10 @@ class ListDescendantEventThreatDetectionCustomModulesRequest extends \Google\Pro /** * @param string $parent Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\ListDescendantEventThreatDetectionCustomModulesRequest @@ -67,10 +67,10 @@ public static function build(string $parent): self * * @type string $parent * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * @type int $page_size * Optional. The maximum number of modules to return. The service may return * fewer than this value. If unspecified, at most 10 configs will be returned. @@ -86,10 +86,10 @@ public function __construct($data = NULL) { /** * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -101,10 +101,10 @@ public function getParent() /** * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/ListDescendantSecurityHealthAnalyticsCustomModulesRequest.php b/SecurityCenterManagement/src/V1/ListDescendantSecurityHealthAnalyticsCustomModulesRequest.php index 8fb32db14c7e..4db8d6b92e86 100644 --- a/SecurityCenterManagement/src/V1/ListDescendantSecurityHealthAnalyticsCustomModulesRequest.php +++ b/SecurityCenterManagement/src/V1/ListDescendantSecurityHealthAnalyticsCustomModulesRequest.php @@ -17,11 +17,11 @@ class ListDescendantSecurityHealthAnalyticsCustomModulesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of the parent organization, folder, or project in which to + * list custom modules, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -41,11 +41,12 @@ class ListDescendantSecurityHealthAnalyticsCustomModulesRequest extends \Google\ protected $page_token = ''; /** - * @param string $parent Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * @param string $parent Required. Name of the parent organization, folder, or project in which to + * list custom modules, specified in one of the following formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\ListDescendantSecurityHealthAnalyticsCustomModulesRequest @@ -65,11 +66,11 @@ public static function build(string $parent): self * Optional. Data for populating the Message object. * * @type string $parent - * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of the parent organization, folder, or project in which to + * list custom modules, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @type int $page_size * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. @@ -83,11 +84,11 @@ public function __construct($data = NULL) { } /** - * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of the parent organization, folder, or project in which to + * list custom modules, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -98,11 +99,11 @@ public function getParent() } /** - * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of the parent organization, folder, or project in which to + * list custom modules, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/ListEffectiveEventThreatDetectionCustomModulesRequest.php b/SecurityCenterManagement/src/V1/ListEffectiveEventThreatDetectionCustomModulesRequest.php index 1de4b9f88c17..40094fd46acf 100644 --- a/SecurityCenterManagement/src/V1/ListEffectiveEventThreatDetectionCustomModulesRequest.php +++ b/SecurityCenterManagement/src/V1/ListEffectiveEventThreatDetectionCustomModulesRequest.php @@ -18,10 +18,10 @@ class ListEffectiveEventThreatDetectionCustomModulesRequest extends \Google\Prot { /** * Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -42,10 +42,10 @@ class ListEffectiveEventThreatDetectionCustomModulesRequest extends \Google\Prot /** * @param string $parent Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\ListEffectiveEventThreatDetectionCustomModulesRequest @@ -66,10 +66,10 @@ public static function build(string $parent): self * * @type string $parent * Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * @type int $page_size * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. @@ -84,10 +84,10 @@ public function __construct($data = NULL) { /** * Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -99,10 +99,10 @@ public function getParent() /** * Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.php b/SecurityCenterManagement/src/V1/ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.php index d6469a51e013..4e8e3f4aceaf 100644 --- a/SecurityCenterManagement/src/V1/ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.php +++ b/SecurityCenterManagement/src/V1/ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.php @@ -17,11 +17,12 @@ class ListEffectiveSecurityHealthAnalyticsCustomModulesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * Required. Name of parent to list effective custom modules. specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -41,11 +42,12 @@ class ListEffectiveSecurityHealthAnalyticsCustomModulesRequest extends \Google\P protected $page_token = ''; /** - * @param string $parent Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * @param string $parent Required. Name of parent to list effective custom modules. specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\ListEffectiveSecurityHealthAnalyticsCustomModulesRequest @@ -65,11 +67,12 @@ public static function build(string $parent): self * Optional. Data for populating the Message object. * * @type string $parent - * Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * Required. Name of parent to list effective custom modules. specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * @type int $page_size * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. @@ -83,11 +86,12 @@ public function __construct($data = NULL) { } /** - * Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * Required. Name of parent to list effective custom modules. specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -98,11 +102,12 @@ public function getParent() } /** - * Required. Name of parent to list effective custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * Required. Name of parent to list effective custom modules. specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/ListEventThreatDetectionCustomModulesRequest.php b/SecurityCenterManagement/src/V1/ListEventThreatDetectionCustomModulesRequest.php index d5503de8ec2e..16e359448211 100644 --- a/SecurityCenterManagement/src/V1/ListEventThreatDetectionCustomModulesRequest.php +++ b/SecurityCenterManagement/src/V1/ListEventThreatDetectionCustomModulesRequest.php @@ -17,10 +17,10 @@ class ListEventThreatDetectionCustomModulesRequest extends \Google\Protobuf\Inte { /** * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -47,10 +47,10 @@ class ListEventThreatDetectionCustomModulesRequest extends \Google\Protobuf\Inte /** * @param string $parent Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\ListEventThreatDetectionCustomModulesRequest @@ -71,10 +71,10 @@ public static function build(string $parent): self * * @type string $parent * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * @type int $page_size * Optional. The maximum number of modules to return. The service may return * fewer than this value. If unspecified, at most 10 configs will be returned. @@ -95,10 +95,10 @@ public function __construct($data = NULL) { /** * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -110,10 +110,10 @@ public function getParent() /** * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", + * `organizations/{organization}/locations/{location}`, + * `folders/{folder}/locations/{location}`, * or - * "projects/{project}/locations/{location}" + * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/ListSecurityCenterServicesRequest.php b/SecurityCenterManagement/src/V1/ListSecurityCenterServicesRequest.php new file mode 100644 index 000000000000..c4a0cd81d3af --- /dev/null +++ b/SecurityCenterManagement/src/V1/ListSecurityCenterServicesRequest.php @@ -0,0 +1,175 @@ +google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesRequest + */ +class ListSecurityCenterServicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent to list Security Command Center services. + * Formats: + * * organizations/{organization}/locations/{location} + * * folders/{folder}/locations/{location} + * * projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of results to return in a single response. + * Default is 10, minimum is 1, maximum is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last call indicating a continuation. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the parent to list Security Command Center services. + * + * Formats: + * + * * organizations/{organization}/locations/{location} + * * folders/{folder}/locations/{location} + * * projects/{project}/locations/{location} + * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. + * + * @return \Google\Cloud\SecurityCenterManagement\V1\ListSecurityCenterServicesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent to list Security Command Center services. + * Formats: + * * organizations/{organization}/locations/{location} + * * folders/{folder}/locations/{location} + * * projects/{project}/locations/{location} + * @type int $page_size + * Optional. The maximum number of results to return in a single response. + * Default is 10, minimum is 1, maximum is 1000. + * @type string $page_token + * Optional. The value returned by the last call indicating a continuation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securitycentermanagement\V1\SecurityCenterManagement::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent to list Security Command Center services. + * Formats: + * * organizations/{organization}/locations/{location} + * * folders/{folder}/locations/{location} + * * projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the parent to list Security Command Center services. + * Formats: + * * organizations/{organization}/locations/{location} + * * folders/{folder}/locations/{location} + * * projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of results to return in a single response. + * Default is 10, minimum is 1, maximum is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of results to return in a single response. + * Default is 10, minimum is 1, maximum is 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value returned by the last call indicating a continuation. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last call indicating a continuation. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/SecurityCenterManagement/src/V1/ListSecurityCenterServicesResponse.php b/SecurityCenterManagement/src/V1/ListSecurityCenterServicesResponse.php new file mode 100644 index 000000000000..772555d39002 --- /dev/null +++ b/SecurityCenterManagement/src/V1/ListSecurityCenterServicesResponse.php @@ -0,0 +1,101 @@ +google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesResponse + */ +class ListSecurityCenterServicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of services. + * + * Generated from protobuf field repeated .google.cloud.securitycentermanagement.v1.SecurityCenterService security_center_services = 1; + */ + private $security_center_services; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService>|\Google\Protobuf\Internal\RepeatedField $security_center_services + * The list of services. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securitycentermanagement\V1\SecurityCenterManagement::initOnce(); + parent::__construct($data); + } + + /** + * The list of services. + * + * Generated from protobuf field repeated .google.cloud.securitycentermanagement.v1.SecurityCenterService security_center_services = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecurityCenterServices() + { + return $this->security_center_services; + } + + /** + * The list of services. + * + * Generated from protobuf field repeated .google.cloud.securitycentermanagement.v1.SecurityCenterService security_center_services = 1; + * @param array<\Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecurityCenterServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService::class); + $this->security_center_services = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/SecurityCenterManagement/src/V1/ListSecurityHealthAnalyticsCustomModulesRequest.php b/SecurityCenterManagement/src/V1/ListSecurityHealthAnalyticsCustomModulesRequest.php index 9ada583f6929..2e52af07903c 100644 --- a/SecurityCenterManagement/src/V1/ListSecurityHealthAnalyticsCustomModulesRequest.php +++ b/SecurityCenterManagement/src/V1/ListSecurityHealthAnalyticsCustomModulesRequest.php @@ -16,11 +16,11 @@ class ListSecurityHealthAnalyticsCustomModulesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of parent organization, folder, or project in which to list + * custom modules, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -40,11 +40,12 @@ class ListSecurityHealthAnalyticsCustomModulesRequest extends \Google\Protobuf\I protected $page_token = ''; /** - * @param string $parent Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * @param string $parent Required. Name of parent organization, folder, or project in which to list + * custom modules, specified in one of the following formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * Please see {@see SecurityCenterManagementClient::organizationLocationName()} for help formatting this field. * * @return \Google\Cloud\SecurityCenterManagement\V1\ListSecurityHealthAnalyticsCustomModulesRequest @@ -64,11 +65,11 @@ public static function build(string $parent): self * Optional. Data for populating the Message object. * * @type string $parent - * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of parent organization, folder, or project in which to list + * custom modules, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @type int $page_size * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. @@ -82,11 +83,11 @@ public function __construct($data = NULL) { } /** - * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of parent organization, folder, or project in which to list + * custom modules, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -97,11 +98,11 @@ public function getParent() } /** - * Required. Name of parent to list custom modules. Its format is - * "organizations/{organization}/locations/{location}", - * "folders/{folder}/locations/{location}", - * or - * "projects/{project}/locations/{location}" + * Required. Name of parent organization, folder, or project in which to list + * custom modules, specified in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/SecurityCenterService.php b/SecurityCenterManagement/src/V1/SecurityCenterService.php new file mode 100644 index 000000000000..6482912da57a --- /dev/null +++ b/SecurityCenterManagement/src/V1/SecurityCenterService.php @@ -0,0 +1,345 @@ +google.cloud.securitycentermanagement.v1.SecurityCenterService + */ +class SecurityCenterService extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the service. + * Its format is: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The possible values for id {service} are: + * * container-threat-detection + * * event-threat-detection + * * security-health-analytics + * * vm-threat-detection + * * web-security-scanner + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The intended state of enablement for the service at its level of + * the resource hierarchy. A DISABLED state will override all module + * enablement_states to DISABLED. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState intended_enablement_state = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intended_enablement_state = 0; + /** + * Output only. The effective enablement state for the service at its level of + * the resource hierarchy. If the intended state is set to INHERITED, the + * effective state will be inherited from the enablement state of an ancestor. + * This state may differ from the intended enablement state due to billing + * eligibility or onboarding status. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState effective_enablement_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $effective_enablement_state = 0; + /** + * Optional. The configurations including the state of enablement for the + * service's different modules. The absence of a module in the map implies its + * configuration is inherited from its parents. + * + * Generated from protobuf field map modules = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $modules; + /** + * Output only. The time the service was last updated. This could be due to an + * explicit user update or due to a side effect of another system change such + * as billing subscription expiry. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Additional service specific configuration. Not all services will + * utilize this field. + * + * Generated from protobuf field .google.protobuf.Struct service_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the service. + * Its format is: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The possible values for id {service} are: + * * container-threat-detection + * * event-threat-detection + * * security-health-analytics + * * vm-threat-detection + * * web-security-scanner + * @type int $intended_enablement_state + * Optional. The intended state of enablement for the service at its level of + * the resource hierarchy. A DISABLED state will override all module + * enablement_states to DISABLED. + * @type int $effective_enablement_state + * Output only. The effective enablement state for the service at its level of + * the resource hierarchy. If the intended state is set to INHERITED, the + * effective state will be inherited from the enablement state of an ancestor. + * This state may differ from the intended enablement state due to billing + * eligibility or onboarding status. + * @type array|\Google\Protobuf\Internal\MapField $modules + * Optional. The configurations including the state of enablement for the + * service's different modules. The absence of a module in the map implies its + * configuration is inherited from its parents. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time the service was last updated. This could be due to an + * explicit user update or due to a side effect of another system change such + * as billing subscription expiry. + * @type \Google\Protobuf\Struct $service_config + * Optional. Additional service specific configuration. Not all services will + * utilize this field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securitycentermanagement\V1\SecurityCenterManagement::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the service. + * Its format is: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The possible values for id {service} are: + * * container-threat-detection + * * event-threat-detection + * * security-health-analytics + * * vm-threat-detection + * * web-security-scanner + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the service. + * Its format is: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The possible values for id {service} are: + * * container-threat-detection + * * event-threat-detection + * * security-health-analytics + * * vm-threat-detection + * * web-security-scanner + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The intended state of enablement for the service at its level of + * the resource hierarchy. A DISABLED state will override all module + * enablement_states to DISABLED. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState intended_enablement_state = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntendedEnablementState() + { + return $this->intended_enablement_state; + } + + /** + * Optional. The intended state of enablement for the service at its level of + * the resource hierarchy. A DISABLED state will override all module + * enablement_states to DISABLED. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState intended_enablement_state = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntendedEnablementState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService\EnablementState::class); + $this->intended_enablement_state = $var; + + return $this; + } + + /** + * Output only. The effective enablement state for the service at its level of + * the resource hierarchy. If the intended state is set to INHERITED, the + * effective state will be inherited from the enablement state of an ancestor. + * This state may differ from the intended enablement state due to billing + * eligibility or onboarding status. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState effective_enablement_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEffectiveEnablementState() + { + return $this->effective_enablement_state; + } + + /** + * Output only. The effective enablement state for the service at its level of + * the resource hierarchy. If the intended state is set to INHERITED, the + * effective state will be inherited from the enablement state of an ancestor. + * This state may differ from the intended enablement state due to billing + * eligibility or onboarding status. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState effective_enablement_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEffectiveEnablementState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService\EnablementState::class); + $this->effective_enablement_state = $var; + + return $this; + } + + /** + * Optional. The configurations including the state of enablement for the + * service's different modules. The absence of a module in the map implies its + * configuration is inherited from its parents. + * + * Generated from protobuf field map modules = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getModules() + { + return $this->modules; + } + + /** + * Optional. The configurations including the state of enablement for the + * service's different modules. The absence of a module in the map implies its + * configuration is inherited from its parents. + * + * Generated from protobuf field map modules = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setModules($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService\ModuleSettings::class); + $this->modules = $arr; + + return $this; + } + + /** + * Output only. The time the service was last updated. This could be due to an + * explicit user update or due to a side effect of another system change such + * as billing subscription expiry. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time the service was last updated. This could be due to an + * explicit user update or due to a side effect of another system change such + * as billing subscription expiry. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Additional service specific configuration. Not all services will + * utilize this field. + * + * Generated from protobuf field .google.protobuf.Struct service_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getServiceConfig() + { + return $this->service_config; + } + + public function hasServiceConfig() + { + return isset($this->service_config); + } + + public function clearServiceConfig() + { + unset($this->service_config); + } + + /** + * Optional. Additional service specific configuration. Not all services will + * utilize this field. + * + * Generated from protobuf field .google.protobuf.Struct service_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setServiceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->service_config = $var; + + return $this; + } + +} + diff --git a/SecurityCenterManagement/src/V1/SecurityCenterService/EnablementState.php b/SecurityCenterManagement/src/V1/SecurityCenterService/EnablementState.php new file mode 100644 index 000000000000..7d9b56a0a305 --- /dev/null +++ b/SecurityCenterManagement/src/V1/SecurityCenterService/EnablementState.php @@ -0,0 +1,71 @@ +google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState + */ +class EnablementState +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ENABLEMENT_STATE_UNSPECIFIED = 0; + */ + const ENABLEMENT_STATE_UNSPECIFIED = 0; + /** + * State is inherited from the parent resource. Not a valid effective + * enablement state. + * + * Generated from protobuf enum INHERITED = 1; + */ + const INHERITED = 1; + /** + * State is enabled. + * + * Generated from protobuf enum ENABLED = 2; + */ + const ENABLED = 2; + /** + * State is disabled. + * + * Generated from protobuf enum DISABLED = 3; + */ + const DISABLED = 3; + + private static $valueToName = [ + self::ENABLEMENT_STATE_UNSPECIFIED => 'ENABLEMENT_STATE_UNSPECIFIED', + self::INHERITED => 'INHERITED', + self::ENABLED => 'ENABLED', + self::DISABLED => 'DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/SecurityCenterManagement/src/V1/SecurityCenterService/ModuleSettings.php b/SecurityCenterManagement/src/V1/SecurityCenterService/ModuleSettings.php new file mode 100644 index 000000000000..7b603e767c13 --- /dev/null +++ b/SecurityCenterManagement/src/V1/SecurityCenterService/ModuleSettings.php @@ -0,0 +1,126 @@ +google.cloud.securitycentermanagement.v1.SecurityCenterService.ModuleSettings + */ +class ModuleSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The intended state of enablement for the module at its level of + * the resource hierarchy. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState intended_enablement_state = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intended_enablement_state = 0; + /** + * Output only. The effective enablement state for the module at its level + * of the resource hierarchy. If the intended state is set to INHERITED, the + * effective state will be inherited from the enablement state of an + * ancestor. This state may + * differ from the intended enablement state due to billing eligibility or + * onboarding status. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState effective_enablement_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $effective_enablement_state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $intended_enablement_state + * Optional. The intended state of enablement for the module at its level of + * the resource hierarchy. + * @type int $effective_enablement_state + * Output only. The effective enablement state for the module at its level + * of the resource hierarchy. If the intended state is set to INHERITED, the + * effective state will be inherited from the enablement state of an + * ancestor. This state may + * differ from the intended enablement state due to billing eligibility or + * onboarding status. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securitycentermanagement\V1\SecurityCenterManagement::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The intended state of enablement for the module at its level of + * the resource hierarchy. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState intended_enablement_state = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntendedEnablementState() + { + return $this->intended_enablement_state; + } + + /** + * Optional. The intended state of enablement for the module at its level of + * the resource hierarchy. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState intended_enablement_state = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntendedEnablementState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService\EnablementState::class); + $this->intended_enablement_state = $var; + + return $this; + } + + /** + * Output only. The effective enablement state for the module at its level + * of the resource hierarchy. If the intended state is set to INHERITED, the + * effective state will be inherited from the enablement state of an + * ancestor. This state may + * differ from the intended enablement state due to billing eligibility or + * onboarding status. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState effective_enablement_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEffectiveEnablementState() + { + return $this->effective_enablement_state; + } + + /** + * Output only. The effective enablement state for the module at its level + * of the resource hierarchy. If the intended state is set to INHERITED, the + * effective state will be inherited from the enablement state of an + * ancestor. This state may + * differ from the intended enablement state due to billing eligibility or + * onboarding status. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState effective_enablement_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEffectiveEnablementState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService\EnablementState::class); + $this->effective_enablement_state = $var; + + return $this; + } + +} + + diff --git a/SecurityCenterManagement/src/V1/SecurityHealthAnalyticsCustomModule.php b/SecurityCenterManagement/src/V1/SecurityHealthAnalyticsCustomModule.php index 368dacf75d34..db568064f325 100644 --- a/SecurityCenterManagement/src/V1/SecurityHealthAnalyticsCustomModule.php +++ b/SecurityCenterManagement/src/V1/SecurityHealthAnalyticsCustomModule.php @@ -20,15 +20,11 @@ class SecurityHealthAnalyticsCustomModule extends \Google\Protobuf\Internal\Message { /** - * Identifier. The resource name of the custom module. - * Its format is - * "organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}", - * or - * "folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}", - * or - * "projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}" - * The id {customModule} is server-generated and is not user settable. - * It will be a numeric id containing 1-20 digits. + * Identifier. The full resource name of the custom module, specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ @@ -84,15 +80,11 @@ class SecurityHealthAnalyticsCustomModule extends \Google\Protobuf\Internal\Mess * Optional. Data for populating the Message object. * * @type string $name - * Identifier. The resource name of the custom module. - * Its format is - * "organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}", - * or - * "folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}", - * or - * "projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}" - * The id {customModule} is server-generated and is not user settable. - * It will be a numeric id containing 1-20 digits. + * Identifier. The full resource name of the custom module, specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` * @type string $display_name * Optional. The display name of the Security Health Analytics custom module. * This display name becomes the finding category for all findings that are @@ -120,15 +112,11 @@ public function __construct($data = NULL) { } /** - * Identifier. The resource name of the custom module. - * Its format is - * "organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}", - * or - * "folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}", - * or - * "projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}" - * The id {customModule} is server-generated and is not user settable. - * It will be a numeric id containing 1-20 digits. + * Identifier. The full resource name of the custom module, specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @return string @@ -139,15 +127,11 @@ public function getName() } /** - * Identifier. The resource name of the custom module. - * Its format is - * "organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}", - * or - * "folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}", - * or - * "projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}" - * The id {customModule} is server-generated and is not user settable. - * It will be a numeric id containing 1-20 digits. + * Identifier. The full resource name of the custom module, specified in one + * of the following formats: + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @param string $var diff --git a/SecurityCenterManagement/src/V1/SimulatedFinding.php b/SecurityCenterManagement/src/V1/SimulatedFinding.php index ba665bfb2ba1..4ca02b40dcf3 100644 --- a/SecurityCenterManagement/src/V1/SimulatedFinding.php +++ b/SecurityCenterManagement/src/V1/SimulatedFinding.php @@ -20,9 +20,9 @@ class SimulatedFinding extends \Google\Protobuf\Internal\Message * Identifier. The [relative resource * name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) * of the finding. Example: - * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", - * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", - * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". + * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + * `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + * `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ @@ -32,7 +32,7 @@ class SimulatedFinding extends \Google\Protobuf\Internal\Message * https://cloud.google.com/apis/design/resource_names#relative_resource_name * This field is immutable after creation time. * For example: - * "organizations/{organization_id}/sources/{source_id}" + * `organizations/{organization_id}/sources/{source_id}` * * Generated from protobuf field string parent = 2; */ @@ -107,15 +107,15 @@ class SimulatedFinding extends \Google\Protobuf\Internal\Message * Identifier. The [relative resource * name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) * of the finding. Example: - * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", - * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", - * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". + * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + * `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + * `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. * @type string $parent * The relative resource name of the source the finding belongs to. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * This field is immutable after creation time. * For example: - * "organizations/{organization_id}/sources/{source_id}" + * `organizations/{organization_id}/sources/{source_id}` * @type string $resource_name * For findings on Google Cloud resources, the full resource * name of the Google Cloud resource this finding is for. See: @@ -158,9 +158,9 @@ public function __construct($data = NULL) { * Identifier. The [relative resource * name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) * of the finding. Example: - * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", - * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", - * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". + * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + * `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + * `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @return string @@ -174,9 +174,9 @@ public function getName() * Identifier. The [relative resource * name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) * of the finding. Example: - * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", - * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", - * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". + * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + * `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + * `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @param string $var @@ -195,7 +195,7 @@ public function setName($var) * https://cloud.google.com/apis/design/resource_names#relative_resource_name * This field is immutable after creation time. * For example: - * "organizations/{organization_id}/sources/{source_id}" + * `organizations/{organization_id}/sources/{source_id}` * * Generated from protobuf field string parent = 2; * @return string @@ -210,7 +210,7 @@ public function getParent() * https://cloud.google.com/apis/design/resource_names#relative_resource_name * This field is immutable after creation time. * For example: - * "organizations/{organization_id}/sources/{source_id}" + * `organizations/{organization_id}/sources/{source_id}` * * Generated from protobuf field string parent = 2; * @param string $var diff --git a/SecurityCenterManagement/src/V1/UpdateSecurityCenterServiceRequest.php b/SecurityCenterManagement/src/V1/UpdateSecurityCenterServiceRequest.php new file mode 100644 index 000000000000..9f8693b99a17 --- /dev/null +++ b/SecurityCenterManagement/src/V1/UpdateSecurityCenterServiceRequest.php @@ -0,0 +1,205 @@ +google.cloud.securitycentermanagement.v1.UpdateSecurityCenterServiceRequest + */ +class UpdateSecurityCenterServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated service. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService security_center_service = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_center_service = null; + /** + * Required. The list of fields to be updated. Possible values: + * * "intended_enablement_state" + * * "modules" + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Optional. When set to true, only validations (including IAM checks) will be + * done for the request (service will not be updated). An OK response + * indicates that the request is valid, while an error response indicates that + * the request is invalid. Note that a subsequent request to actually update + * the service could still fail for one of the following reasons: + * - The state could have changed (e.g. IAM permission lost). + * - A failure occurred while trying to delete the module. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService $securityCenterService Required. The updated service. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to be updated. Possible values: + * + * * "intended_enablement_state" + * * "modules" + * + * @return \Google\Cloud\SecurityCenterManagement\V1\UpdateSecurityCenterServiceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService $securityCenterService, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSecurityCenterService($securityCenterService) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService $security_center_service + * Required. The updated service. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to be updated. Possible values: + * * "intended_enablement_state" + * * "modules" + * @type bool $validate_only + * Optional. When set to true, only validations (including IAM checks) will be + * done for the request (service will not be updated). An OK response + * indicates that the request is valid, while an error response indicates that + * the request is invalid. Note that a subsequent request to actually update + * the service could still fail for one of the following reasons: + * - The state could have changed (e.g. IAM permission lost). + * - A failure occurred while trying to delete the module. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securitycentermanagement\V1\SecurityCenterManagement::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated service. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService security_center_service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService|null + */ + public function getSecurityCenterService() + { + return $this->security_center_service; + } + + public function hasSecurityCenterService() + { + return isset($this->security_center_service); + } + + public function clearSecurityCenterService() + { + unset($this->security_center_service); + } + + /** + * Required. The updated service. + * + * Generated from protobuf field .google.cloud.securitycentermanagement.v1.SecurityCenterService security_center_service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService $var + * @return $this + */ + public function setSecurityCenterService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService::class); + $this->security_center_service = $var; + + return $this; + } + + /** + * Required. The list of fields to be updated. Possible values: + * * "intended_enablement_state" + * * "modules" + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to be updated. Possible values: + * * "intended_enablement_state" + * * "modules" + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. When set to true, only validations (including IAM checks) will be + * done for the request (service will not be updated). An OK response + * indicates that the request is valid, while an error response indicates that + * the request is invalid. Note that a subsequent request to actually update + * the service could still fail for one of the following reasons: + * - The state could have changed (e.g. IAM permission lost). + * - A failure occurred while trying to delete the module. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. When set to true, only validations (including IAM checks) will be + * done for the request (service will not be updated). An OK response + * indicates that the request is valid, while an error response indicates that + * the request is invalid. Note that a subsequent request to actually update + * the service could still fail for one of the following reasons: + * - The state could have changed (e.g. IAM permission lost). + * - A failure occurred while trying to delete the module. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/SecurityCenterManagement/src/V1/ValidateEventThreatDetectionCustomModuleRequest.php b/SecurityCenterManagement/src/V1/ValidateEventThreatDetectionCustomModuleRequest.php index 17c5ea7528d1..40ac0673ade5 100644 --- a/SecurityCenterManagement/src/V1/ValidateEventThreatDetectionCustomModuleRequest.php +++ b/SecurityCenterManagement/src/V1/ValidateEventThreatDetectionCustomModuleRequest.php @@ -18,7 +18,7 @@ class ValidateEventThreatDetectionCustomModuleRequest extends \Google\Protobuf\I /** * Required. Resource name of the parent to validate the Custom Module under. * Its format is: - * * "organizations/{organization}/locations/{location}". + * * `organizations/{organization}/locations/{location}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -46,7 +46,7 @@ class ValidateEventThreatDetectionCustomModuleRequest extends \Google\Protobuf\I * @type string $parent * Required. Resource name of the parent to validate the Custom Module under. * Its format is: - * * "organizations/{organization}/locations/{location}". + * * `organizations/{organization}/locations/{location}`. * @type string $raw_text * Required. The raw text of the module's contents. Used to generate error * messages. @@ -62,7 +62,7 @@ public function __construct($data = NULL) { /** * Required. Resource name of the parent to validate the Custom Module under. * Its format is: - * * "organizations/{organization}/locations/{location}". + * * `organizations/{organization}/locations/{location}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -75,7 +75,7 @@ public function getParent() /** * Required. Resource name of the parent to validate the Custom Module under. * Its format is: - * * "organizations/{organization}/locations/{location}". + * * `organizations/{organization}/locations/{location}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/SecurityCenterManagement/src/V1/gapic_metadata.json b/SecurityCenterManagement/src/V1/gapic_metadata.json index bcffad6c658f..b7aad2f739fd 100644 --- a/SecurityCenterManagement/src/V1/gapic_metadata.json +++ b/SecurityCenterManagement/src/V1/gapic_metadata.json @@ -45,6 +45,11 @@ "getEventThreatDetectionCustomModule" ] }, + "GetSecurityCenterService": { + "methods": [ + "getSecurityCenterService" + ] + }, "GetSecurityHealthAnalyticsCustomModule": { "methods": [ "getSecurityHealthAnalyticsCustomModule" @@ -75,6 +80,11 @@ "listEventThreatDetectionCustomModules" ] }, + "ListSecurityCenterServices": { + "methods": [ + "listSecurityCenterServices" + ] + }, "ListSecurityHealthAnalyticsCustomModules": { "methods": [ "listSecurityHealthAnalyticsCustomModules" @@ -90,6 +100,11 @@ "updateEventThreatDetectionCustomModule" ] }, + "UpdateSecurityCenterService": { + "methods": [ + "updateSecurityCenterService" + ] + }, "UpdateSecurityHealthAnalyticsCustomModule": { "methods": [ "updateSecurityHealthAnalyticsCustomModule" diff --git a/SecurityCenterManagement/src/V1/resources/security_center_management_client_config.json b/SecurityCenterManagement/src/V1/resources/security_center_management_client_config.json index 03100e57b500..cefc54399731 100644 --- a/SecurityCenterManagement/src/V1/resources/security_center_management_client_config.json +++ b/SecurityCenterManagement/src/V1/resources/security_center_management_client_config.json @@ -74,6 +74,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetSecurityCenterService": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetSecurityHealthAnalyticsCustomModule": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -104,6 +109,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListSecurityCenterServices": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "ListSecurityHealthAnalyticsCustomModules": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -119,6 +129,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "UpdateSecurityCenterService": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "UpdateSecurityHealthAnalyticsCustomModule": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/SecurityCenterManagement/src/V1/resources/security_center_management_descriptor_config.php b/SecurityCenterManagement/src/V1/resources/security_center_management_descriptor_config.php index 1e8bae692e00..840299f2b1b6 100644 --- a/SecurityCenterManagement/src/V1/resources/security_center_management_descriptor_config.php +++ b/SecurityCenterManagement/src/V1/resources/security_center_management_descriptor_config.php @@ -107,6 +107,18 @@ ], ], ], + 'GetSecurityCenterService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetSecurityHealthAnalyticsCustomModule' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\SecurityCenterManagement\V1\SecurityHealthAnalyticsCustomModule', @@ -219,6 +231,26 @@ ], ], ], + 'ListSecurityCenterServices' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSecurityCenterServices', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\SecurityCenterManagement\V1\ListSecurityCenterServicesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListSecurityHealthAnalyticsCustomModules' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -264,6 +296,19 @@ ], ], ], + 'UpdateSecurityCenterService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService', + 'headerParams' => [ + [ + 'keyName' => 'security_center_service.name', + 'fieldAccessors' => [ + 'getSecurityCenterService', + 'getName', + ], + ], + ], + ], 'UpdateSecurityHealthAnalyticsCustomModule' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\SecurityCenterManagement\V1\SecurityHealthAnalyticsCustomModule', @@ -332,16 +377,20 @@ 'folderLocationEffectiveSecurityHealthAnalyticsCustomModule' => 'folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}', 'folderLocationEventThreatDetectionCustomModule' => 'folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}', 'folderLocationSecurityHealthAnalyticsCustomModule' => 'folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}', + 'folderLocationService' => 'folders/{folder}/locations/{location}/securityCenterServices/{service}', 'location' => 'projects/{project}/locations/{location}', 'organizationLocation' => 'organizations/{organization}/locations/{location}', 'organizationLocationEffectiveEventThreatDetectionCustomModule' => 'organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}', 'organizationLocationEffectiveSecurityHealthAnalyticsCustomModule' => 'organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}', 'organizationLocationEventThreatDetectionCustomModule' => 'organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}', 'organizationLocationSecurityHealthAnalyticsCustomModule' => 'organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}', + 'organizationLocationService' => 'organizations/{organization}/locations/{location}/securityCenterServices/{service}', 'projectLocationEffectiveEventThreatDetectionCustomModule' => 'projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}', 'projectLocationEffectiveSecurityHealthAnalyticsCustomModule' => 'projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}', 'projectLocationEventThreatDetectionCustomModule' => 'projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}', 'projectLocationSecurityHealthAnalyticsCustomModule' => 'projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}', + 'projectLocationService' => 'projects/{project}/locations/{location}/securityCenterServices/{service}', + 'securityCenterService' => 'projects/{project}/locations/{location}/securityCenterServices/{service}', 'securityHealthAnalyticsCustomModule' => 'organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}', ], ], diff --git a/SecurityCenterManagement/src/V1/resources/security_center_management_rest_client_config.php b/SecurityCenterManagement/src/V1/resources/security_center_management_rest_client_config.php index a3546e1c6148..545daa6979b5 100644 --- a/SecurityCenterManagement/src/V1/resources/security_center_management_rest_client_config.php +++ b/SecurityCenterManagement/src/V1/resources/security_center_management_rest_client_config.php @@ -200,6 +200,27 @@ ], ], ], + 'GetSecurityCenterService' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/securityCenterServices/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=folders/*/locations/*/securityCenterServices/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/securityCenterServices/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetSecurityHealthAnalyticsCustomModule' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/securityHealthAnalyticsCustomModules/*}', @@ -326,6 +347,27 @@ ], ], ], + 'ListSecurityCenterServices' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/securityCenterServices', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=folders/*/locations/*}/securityCenterServices', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/securityCenterServices', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListSecurityHealthAnalyticsCustomModules' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/securityHealthAnalyticsCustomModules', @@ -405,6 +447,40 @@ 'update_mask', ], ], + 'UpdateSecurityCenterService' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{security_center_service.name=projects/*/locations/*/securityCenterServices/*}', + 'body' => 'security_center_service', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{security_center_service.name=folders/*/locations/*/securityCenterServices/*}', + 'body' => 'security_center_service', + 'queryParams' => [ + 'update_mask', + ], + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{security_center_service.name=organizations/*/locations/*/securityCenterServices/*}', + 'body' => 'security_center_service', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'security_center_service.name' => [ + 'getters' => [ + 'getSecurityCenterService', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], 'UpdateSecurityHealthAnalyticsCustomModule' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{security_health_analytics_custom_module.name=projects/*/locations/*/securityHealthAnalyticsCustomModules/*}', diff --git a/SecurityCenterManagement/tests/Unit/V1/Client/SecurityCenterManagementClientTest.php b/SecurityCenterManagement/tests/Unit/V1/Client/SecurityCenterManagementClientTest.php index e8573745e661..860d42e08553 100644 --- a/SecurityCenterManagement/tests/Unit/V1/Client/SecurityCenterManagementClientTest.php +++ b/SecurityCenterManagement/tests/Unit/V1/Client/SecurityCenterManagementClientTest.php @@ -42,6 +42,7 @@ use Google\Cloud\SecurityCenterManagement\V1\GetEffectiveEventThreatDetectionCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\GetEventThreatDetectionCustomModuleRequest; +use Google\Cloud\SecurityCenterManagement\V1\GetSecurityCenterServiceRequest; use Google\Cloud\SecurityCenterManagement\V1\GetSecurityHealthAnalyticsCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\ListDescendantEventThreatDetectionCustomModulesRequest; use Google\Cloud\SecurityCenterManagement\V1\ListDescendantEventThreatDetectionCustomModulesResponse; @@ -53,13 +54,17 @@ use Google\Cloud\SecurityCenterManagement\V1\ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; use Google\Cloud\SecurityCenterManagement\V1\ListEventThreatDetectionCustomModulesRequest; use Google\Cloud\SecurityCenterManagement\V1\ListEventThreatDetectionCustomModulesResponse; +use Google\Cloud\SecurityCenterManagement\V1\ListSecurityCenterServicesRequest; +use Google\Cloud\SecurityCenterManagement\V1\ListSecurityCenterServicesResponse; use Google\Cloud\SecurityCenterManagement\V1\ListSecurityHealthAnalyticsCustomModulesRequest; use Google\Cloud\SecurityCenterManagement\V1\ListSecurityHealthAnalyticsCustomModulesResponse; +use Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService; use Google\Cloud\SecurityCenterManagement\V1\SecurityHealthAnalyticsCustomModule; use Google\Cloud\SecurityCenterManagement\V1\SimulateSecurityHealthAnalyticsCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\SimulateSecurityHealthAnalyticsCustomModuleRequest\SimulatedResource; use Google\Cloud\SecurityCenterManagement\V1\SimulateSecurityHealthAnalyticsCustomModuleResponse; use Google\Cloud\SecurityCenterManagement\V1\UpdateEventThreatDetectionCustomModuleRequest; +use Google\Cloud\SecurityCenterManagement\V1\UpdateSecurityCenterServiceRequest; use Google\Cloud\SecurityCenterManagement\V1\UpdateSecurityHealthAnalyticsCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\ValidateEventThreatDetectionCustomModuleRequest; use Google\Cloud\SecurityCenterManagement\V1\ValidateEventThreatDetectionCustomModuleResponse; @@ -658,6 +663,74 @@ public function getEventThreatDetectionCustomModuleExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getSecurityCenterServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new SecurityCenterService(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->securityCenterServiceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new GetSecurityCenterServiceRequest())->setName($formattedName); + $response = $gapicClient->getSecurityCenterService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.securitycentermanagement.v1.SecurityCenterManagement/GetSecurityCenterService', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSecurityCenterServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->securityCenterServiceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new GetSecurityCenterServiceRequest())->setName($formattedName); + try { + $gapicClient->getSecurityCenterService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getSecurityHealthAnalyticsCustomModuleTest() { @@ -1112,6 +1185,80 @@ public function listEventThreatDetectionCustomModulesExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listSecurityCenterServicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $securityCenterServicesElement = new SecurityCenterService(); + $securityCenterServices = [$securityCenterServicesElement]; + $expectedResponse = new ListSecurityCenterServicesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSecurityCenterServices($securityCenterServices); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListSecurityCenterServicesRequest())->setParent($formattedParent); + $response = $gapicClient->listSecurityCenterServices($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSecurityCenterServices()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.securitycentermanagement.v1.SecurityCenterManagement/ListSecurityCenterServices', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSecurityCenterServicesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListSecurityCenterServicesRequest())->setParent($formattedParent); + try { + $gapicClient->listSecurityCenterServices($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listSecurityHealthAnalyticsCustomModulesTest() { @@ -1356,6 +1503,82 @@ public function updateEventThreatDetectionCustomModuleExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateSecurityCenterServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new SecurityCenterService(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $securityCenterService = new SecurityCenterService(); + $updateMask = new FieldMask(); + $request = (new UpdateSecurityCenterServiceRequest()) + ->setSecurityCenterService($securityCenterService) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateSecurityCenterService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.securitycentermanagement.v1.SecurityCenterManagement/UpdateSecurityCenterService', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getSecurityCenterService(); + $this->assertProtobufEquals($securityCenterService, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSecurityCenterServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $securityCenterService = new SecurityCenterService(); + $updateMask = new FieldMask(); + $request = (new UpdateSecurityCenterServiceRequest()) + ->setSecurityCenterService($securityCenterService) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateSecurityCenterService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function updateSecurityHealthAnalyticsCustomModuleTest() { diff --git a/SecurityPrivateCa/.repo-metadata.json b/SecurityPrivateCa/.repo-metadata.json deleted file mode 100644 index 8477bf729527..000000000000 --- a/SecurityPrivateCa/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-security-private-ca", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-security-private-ca/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "privateca" -} diff --git a/SecurityPrivateCa/VERSION b/SecurityPrivateCa/VERSION index 943f9cbc4ec7..661e7aeadf36 100644 --- a/SecurityPrivateCa/VERSION +++ b/SecurityPrivateCa/VERSION @@ -1 +1 @@ -1.7.1 +1.7.3 diff --git a/SecurityPrivateCa/composer.json b/SecurityPrivateCa/composer.json index a89d8318f297..280716ef36a8 100644 --- a/SecurityPrivateCa/composer.json +++ b/SecurityPrivateCa/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/SecurityPublicCA/.OwlBot.yaml b/SecurityPublicCA/.OwlBot.yaml index f6aff046c3f0..71a093d0d049 100644 --- a/SecurityPublicCA/.OwlBot.yaml +++ b/SecurityPublicCA/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/security/publicca/v1beta1/.*-php/(.*) - dest: /owl-bot-staging/SecurityPublicCA/v1beta1/$1 + - source: /google/cloud/security/publicca/(v1|v1beta1)/.*-php/(.*) + dest: /owl-bot-staging/SecurityPublicCA/$1/$2 api-name: SecurityPublicCA diff --git a/SecurityPublicCA/.repo-metadata.json b/SecurityPublicCA/.repo-metadata.json deleted file mode 100644 index e8146b1ec489..000000000000 --- a/SecurityPublicCA/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-security-public-ca", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-security-public-ca/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/certificate-manager/docs/public-ca", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "publicca" -} diff --git a/SecurityPublicCA/VERSION b/SecurityPublicCA/VERSION index 1c09c74e221c..267577d47e49 100644 --- a/SecurityPublicCA/VERSION +++ b/SecurityPublicCA/VERSION @@ -1 +1 @@ -0.3.3 +0.4.1 diff --git a/SecurityPublicCA/composer.json b/SecurityPublicCA/composer.json index 109bc4003c06..f5652dfb3824 100644 --- a/SecurityPublicCA/composer.json +++ b/SecurityPublicCA/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/SecurityPublicCA/metadata/V1/Resources.php b/SecurityPublicCA/metadata/V1/Resources.php new file mode 100644 index 000000000000..c6551ee40ca3 --- /dev/null +++ b/SecurityPublicCA/metadata/V1/Resources.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' +Ë +1google/cloud/security/publicca/v1/resources.proto!google.cloud.security.publicca.v1google/api/resource.proto"Ý +ExternalAccountKey +name ( BàA +key_id ( BàA + b64_mac_key ( BàA:„êA€ +*publicca.googleapis.com/ExternalAccountKeyRprojects/{project}/locations/{location}/externalAccountKeys/{external_account_key}Bï +%com.google.cloud.security.publicca.v1BResourcesProtoPZAcloud.google.com/go/security/publicca/apiv1/publiccapb;publiccapbøª!Google.Cloud.Security.PublicCA.V1Ê!Google\\Cloud\\Security\\PublicCA\\V1ê%Google::Cloud::Security::PublicCA::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/SecurityPublicCA/metadata/V1/Service.php b/SecurityPublicCA/metadata/V1/Service.php new file mode 100644 index 000000000000..e5dbf8c95864 --- /dev/null +++ b/SecurityPublicCA/metadata/V1/Service.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile( + ' +– +/google/cloud/security/publicca/v1/service.proto!google.cloud.security.publicca.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto1google/cloud/security/publicca/v1/resources.proto"¿ +CreateExternalAccountKeyRequestB +parent ( B2àAúA,*publicca.googleapis.com/ExternalAccountKeyX +external_account_key ( 25.google.cloud.security.publicca.v1.ExternalAccountKeyBàA2ý +!PublicCertificateAuthorityServiceŠ +CreateExternalAccountKeyB.google.cloud.security.publicca.v1.CreateExternalAccountKeyRequest5.google.cloud.security.publicca.v1.ExternalAccountKey"sÚAparent,external_account_key‚Óä“O"7/v1/{parent=projects/*/locations/*}/externalAccountKeys:external_account_keyKÊApublicca.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBí +%com.google.cloud.security.publicca.v1B ServiceProtoPZAcloud.google.com/go/security/publicca/apiv1/publiccapb;publiccapbøª!Google.Cloud.Security.PublicCA.V1Ê!Google\\Cloud\\Security\\PublicCA\\V1ê%Google::Cloud::Security::PublicCA::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/SecurityPublicCA/samples/V1/PublicCertificateAuthorityServiceClient/create_external_account_key.php b/SecurityPublicCA/samples/V1/PublicCertificateAuthorityServiceClient/create_external_account_key.php new file mode 100644 index 000000000000..91aa21a04c6f --- /dev/null +++ b/SecurityPublicCA/samples/V1/PublicCertificateAuthorityServiceClient/create_external_account_key.php @@ -0,0 +1,77 @@ +setParent($formattedParent) + ->setExternalAccountKey($externalAccountKey); + + // Call the API and handle any network failures. + try { + /** @var ExternalAccountKey $response */ + $response = $publicCertificateAuthorityServiceClient->createExternalAccountKey($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 +{ + $formattedParent = PublicCertificateAuthorityServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_external_account_key_sample($formattedParent); +} +// [END publicca_v1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] diff --git a/SecurityPublicCA/src/V1/Client/PublicCertificateAuthorityServiceClient.php b/SecurityPublicCA/src/V1/Client/PublicCertificateAuthorityServiceClient.php new file mode 100644 index 000000000000..3262f6430fd6 --- /dev/null +++ b/SecurityPublicCA/src/V1/Client/PublicCertificateAuthorityServiceClient.php @@ -0,0 +1,263 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/public_certificate_authority_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/public_certificate_authority_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/public_certificate_authority_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/public_certificate_authority_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * external_account_key resource. + * + * @param string $project + * @param string $location + * @param string $externalAccountKey + * + * @return string The formatted external_account_key resource. + */ + public static function externalAccountKeyName(string $project, string $location, string $externalAccountKey): string + { + return self::getPathTemplate('externalAccountKey')->render([ + 'project' => $project, + 'location' => $location, + 'external_account_key' => $externalAccountKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - externalAccountKey: projects/{project}/locations/{location}/externalAccountKeys/{external_account_key} + * - location: projects/{project}/locations/{location} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'publicca.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new + * [ExternalAccountKey][google.cloud.security.publicca.v1.ExternalAccountKey] + * bound to the project. + * + * The async variant is + * {@see PublicCertificateAuthorityServiceClient::createExternalAccountKeyAsync()} + * . + * + * @example samples/V1/PublicCertificateAuthorityServiceClient/create_external_account_key.php + * + * @param CreateExternalAccountKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ExternalAccountKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function createExternalAccountKey(CreateExternalAccountKeyRequest $request, array $callOptions = []): ExternalAccountKey + { + return $this->startApiCall('CreateExternalAccountKey', $request, $callOptions)->wait(); + } +} diff --git a/SecurityPublicCA/src/V1/CreateExternalAccountKeyRequest.php b/SecurityPublicCA/src/V1/CreateExternalAccountKeyRequest.php new file mode 100644 index 000000000000..b779920a03d8 --- /dev/null +++ b/SecurityPublicCA/src/V1/CreateExternalAccountKeyRequest.php @@ -0,0 +1,154 @@ +google.cloud.security.publicca.v1.CreateExternalAccountKeyRequest + */ +class CreateExternalAccountKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource where this external_account_key will be + * created. Format: projects/[project_id]/locations/[location]. At present + * only the "global" location is supported. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. The external account key to create. This field only exists to + * future-proof the API. At present, all fields in ExternalAccountKey are + * output only and all values are ignored. For the purpose of the + * CreateExternalAccountKeyRequest, set it to a default/empty value. + * + * Generated from protobuf field .google.cloud.security.publicca.v1.ExternalAccountKey external_account_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $external_account_key = null; + + /** + * @param string $parent Required. The parent resource where this external_account_key will be + * created. Format: projects/[project_id]/locations/[location]. At present + * only the "global" location is supported. Please see + * {@see PublicCertificateAuthorityServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Security\PublicCA\V1\ExternalAccountKey $externalAccountKey Required. The external account key to create. This field only exists to + * future-proof the API. At present, all fields in ExternalAccountKey are + * output only and all values are ignored. For the purpose of the + * CreateExternalAccountKeyRequest, set it to a default/empty value. + * + * @return \Google\Cloud\Security\PublicCA\V1\CreateExternalAccountKeyRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Security\PublicCA\V1\ExternalAccountKey $externalAccountKey): self + { + return (new self()) + ->setParent($parent) + ->setExternalAccountKey($externalAccountKey); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource where this external_account_key will be + * created. Format: projects/[project_id]/locations/[location]. At present + * only the "global" location is supported. + * @type \Google\Cloud\Security\PublicCA\V1\ExternalAccountKey $external_account_key + * Required. The external account key to create. This field only exists to + * future-proof the API. At present, all fields in ExternalAccountKey are + * output only and all values are ignored. For the purpose of the + * CreateExternalAccountKeyRequest, set it to a default/empty value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Security\Publicca\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource where this external_account_key will be + * created. Format: projects/[project_id]/locations/[location]. At present + * only the "global" location is supported. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource where this external_account_key will be + * created. Format: projects/[project_id]/locations/[location]. At present + * only the "global" location is supported. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The external account key to create. This field only exists to + * future-proof the API. At present, all fields in ExternalAccountKey are + * output only and all values are ignored. For the purpose of the + * CreateExternalAccountKeyRequest, set it to a default/empty value. + * + * Generated from protobuf field .google.cloud.security.publicca.v1.ExternalAccountKey external_account_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Security\PublicCA\V1\ExternalAccountKey|null + */ + public function getExternalAccountKey() + { + return $this->external_account_key; + } + + public function hasExternalAccountKey() + { + return isset($this->external_account_key); + } + + public function clearExternalAccountKey() + { + unset($this->external_account_key); + } + + /** + * Required. The external account key to create. This field only exists to + * future-proof the API. At present, all fields in ExternalAccountKey are + * output only and all values are ignored. For the purpose of the + * CreateExternalAccountKeyRequest, set it to a default/empty value. + * + * Generated from protobuf field .google.cloud.security.publicca.v1.ExternalAccountKey external_account_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Security\PublicCA\V1\ExternalAccountKey $var + * @return $this + */ + public function setExternalAccountKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Security\PublicCA\V1\ExternalAccountKey::class); + $this->external_account_key = $var; + + return $this; + } + +} + diff --git a/SecurityPublicCA/src/V1/ExternalAccountKey.php b/SecurityPublicCA/src/V1/ExternalAccountKey.php new file mode 100644 index 000000000000..70b0528be3df --- /dev/null +++ b/SecurityPublicCA/src/V1/ExternalAccountKey.php @@ -0,0 +1,156 @@ +google.cloud.security.publicca.v1.ExternalAccountKey + */ +class ExternalAccountKey extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name. + * projects/{project}/locations/{location}/externalAccountKeys/{key_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $name = ''; + /** + * Output only. Key ID. + * It is generated by the PublicCertificateAuthorityService + * when the ExternalAccountKey is created + * + * Generated from protobuf field string key_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $key_id = ''; + /** + * Output only. Base64-URL-encoded HS256 key. + * It is generated by the PublicCertificateAuthorityService + * when the ExternalAccountKey is created + * + * Generated from protobuf field bytes b64_mac_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $b64_mac_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Resource name. + * projects/{project}/locations/{location}/externalAccountKeys/{key_id} + * @type string $key_id + * Output only. Key ID. + * It is generated by the PublicCertificateAuthorityService + * when the ExternalAccountKey is created + * @type string $b64_mac_key + * Output only. Base64-URL-encoded HS256 key. + * It is generated by the PublicCertificateAuthorityService + * when the ExternalAccountKey is created + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Security\Publicca\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Resource name. + * projects/{project}/locations/{location}/externalAccountKeys/{key_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name. + * projects/{project}/locations/{location}/externalAccountKeys/{key_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Key ID. + * It is generated by the PublicCertificateAuthorityService + * when the ExternalAccountKey is created + * + * Generated from protobuf field string key_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getKeyId() + { + return $this->key_id; + } + + /** + * Output only. Key ID. + * It is generated by the PublicCertificateAuthorityService + * when the ExternalAccountKey is created + * + * Generated from protobuf field string key_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setKeyId($var) + { + GPBUtil::checkString($var, True); + $this->key_id = $var; + + return $this; + } + + /** + * Output only. Base64-URL-encoded HS256 key. + * It is generated by the PublicCertificateAuthorityService + * when the ExternalAccountKey is created + * + * Generated from protobuf field bytes b64_mac_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getB64MacKey() + { + return $this->b64_mac_key; + } + + /** + * Output only. Base64-URL-encoded HS256 key. + * It is generated by the PublicCertificateAuthorityService + * when the ExternalAccountKey is created + * + * Generated from protobuf field bytes b64_mac_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setB64MacKey($var) + { + GPBUtil::checkString($var, False); + $this->b64_mac_key = $var; + + return $this; + } + +} + diff --git a/SecurityPublicCA/src/V1/gapic_metadata.json b/SecurityPublicCA/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..24cfe71a2605 --- /dev/null +++ b/SecurityPublicCA/src/V1/gapic_metadata.json @@ -0,0 +1,23 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.security.publicca.v1", + "libraryPackage": "Google\\Cloud\\Security\\PublicCA\\V1", + "services": { + "PublicCertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "PublicCertificateAuthorityServiceGapicClient", + "rpcs": { + "CreateExternalAccountKey": { + "methods": [ + "createExternalAccountKey" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/SecurityPublicCA/src/V1/resources/public_certificate_authority_service_client_config.json b/SecurityPublicCA/src/V1/resources/public_certificate_authority_service_client_config.json new file mode 100644 index 000000000000..a3415ccf86b0 --- /dev/null +++ b/SecurityPublicCA/src/V1/resources/public_certificate_authority_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.security.publicca.v1.PublicCertificateAuthorityService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateExternalAccountKey": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/SecurityPublicCA/src/V1/resources/public_certificate_authority_service_descriptor_config.php b/SecurityPublicCA/src/V1/resources/public_certificate_authority_service_descriptor_config.php new file mode 100644 index 000000000000..c586b2567746 --- /dev/null +++ b/SecurityPublicCA/src/V1/resources/public_certificate_authority_service_descriptor_config.php @@ -0,0 +1,44 @@ + [ + 'google.cloud.security.publicca.v1.PublicCertificateAuthorityService' => [ + 'CreateExternalAccountKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Security\PublicCA\V1\ExternalAccountKey', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'externalAccountKey' => 'projects/{project}/locations/{location}/externalAccountKeys/{external_account_key}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/SecurityPublicCA/src/V1/resources/public_certificate_authority_service_rest_client_config.php b/SecurityPublicCA/src/V1/resources/public_certificate_authority_service_rest_client_config.php new file mode 100644 index 000000000000..c19a32d3f493 --- /dev/null +++ b/SecurityPublicCA/src/V1/resources/public_certificate_authority_service_rest_client_config.php @@ -0,0 +1,41 @@ + [ + 'google.cloud.security.publicca.v1.PublicCertificateAuthorityService' => [ + 'CreateExternalAccountKey' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/externalAccountKeys', + 'body' => 'external_account_key', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/SecurityPublicCA/tests/Unit/V1/Client/PublicCertificateAuthorityServiceClientTest.php b/SecurityPublicCA/tests/Unit/V1/Client/PublicCertificateAuthorityServiceClientTest.php new file mode 100644 index 000000000000..c09338662bf4 --- /dev/null +++ b/SecurityPublicCA/tests/Unit/V1/Client/PublicCertificateAuthorityServiceClientTest.php @@ -0,0 +1,173 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PublicCertificateAuthorityServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PublicCertificateAuthorityServiceClient($options); + } + + /** @test */ + public function createExternalAccountKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $keyId = 'keyId-1134673157'; + $b64MacKey = '-48'; + $expectedResponse = new ExternalAccountKey(); + $expectedResponse->setName($name); + $expectedResponse->setKeyId($keyId); + $expectedResponse->setB64MacKey($b64MacKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $externalAccountKey = new ExternalAccountKey(); + $request = (new CreateExternalAccountKeyRequest()) + ->setParent($formattedParent) + ->setExternalAccountKey($externalAccountKey); + $response = $gapicClient->createExternalAccountKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.security.publicca.v1.PublicCertificateAuthorityService/CreateExternalAccountKey', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getExternalAccountKey(); + $this->assertProtobufEquals($externalAccountKey, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createExternalAccountKeyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $externalAccountKey = new ExternalAccountKey(); + $request = (new CreateExternalAccountKeyRequest()) + ->setParent($formattedParent) + ->setExternalAccountKey($externalAccountKey); + try { + $gapicClient->createExternalAccountKey($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createExternalAccountKeyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $keyId = 'keyId-1134673157'; + $b64MacKey = '-48'; + $expectedResponse = new ExternalAccountKey(); + $expectedResponse->setName($name); + $expectedResponse->setKeyId($keyId); + $expectedResponse->setB64MacKey($b64MacKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $externalAccountKey = new ExternalAccountKey(); + $request = (new CreateExternalAccountKeyRequest()) + ->setParent($formattedParent) + ->setExternalAccountKey($externalAccountKey); + $response = $gapicClient->createExternalAccountKeyAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.security.publicca.v1.PublicCertificateAuthorityService/CreateExternalAccountKey', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getExternalAccountKey(); + $this->assertProtobufEquals($externalAccountKey, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ServiceControl/.repo-metadata.json b/ServiceControl/.repo-metadata.json deleted file mode 100644 index 8909451cf031..000000000000 --- a/ServiceControl/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-service-control", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-service-control/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "servicecontrol" -} diff --git a/ServiceControl/VERSION b/ServiceControl/VERSION index 9df886c42a1e..1c99cf0e8093 100644 --- a/ServiceControl/VERSION +++ b/ServiceControl/VERSION @@ -1 +1 @@ -1.4.2 +1.4.4 diff --git a/ServiceControl/composer.json b/ServiceControl/composer.json index 4caf77578ab4..61366b0225a9 100644 --- a/ServiceControl/composer.json +++ b/ServiceControl/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ServiceDirectory/.repo-metadata.json b/ServiceDirectory/.repo-metadata.json deleted file mode 100644 index f03524c66a3f..000000000000 --- a/ServiceDirectory/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-service-directory", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-service-directory/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "servicedirectory" -} diff --git a/ServiceDirectory/VERSION b/ServiceDirectory/VERSION index 31e5c843497c..95b25aee2591 100644 --- a/ServiceDirectory/VERSION +++ b/ServiceDirectory/VERSION @@ -1 +1 @@ -1.3.3 +1.3.6 diff --git a/ServiceDirectory/composer.json b/ServiceDirectory/composer.json index 2e3b75bb9352..08ae4a1c8442 100644 --- a/ServiceDirectory/composer.json +++ b/ServiceDirectory/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ServiceDirectory/src/V1beta1/ListEndpointsRequest.php b/ServiceDirectory/src/V1beta1/ListEndpointsRequest.php index e4e4452d62ec..05a174faf1d9 100644 --- a/ServiceDirectory/src/V1beta1/ListEndpointsRequest.php +++ b/ServiceDirectory/src/V1beta1/ListEndpointsRequest.php @@ -24,7 +24,7 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message */ private $parent = ''; /** - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -94,7 +94,7 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * Required. The resource name of the service whose endpoints you'd like to * list. * @type int $page_size - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * @type string $page_token * Optional. The next_page_token value returned from a previous List request, * if any. @@ -173,7 +173,7 @@ public function setParent($var) } /** - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -184,7 +184,7 @@ public function getPageSize() } /** - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var diff --git a/ServiceDirectory/src/V1beta1/ListNamespacesRequest.php b/ServiceDirectory/src/V1beta1/ListNamespacesRequest.php index f49c416460b6..6a60e7615839 100644 --- a/ServiceDirectory/src/V1beta1/ListNamespacesRequest.php +++ b/ServiceDirectory/src/V1beta1/ListNamespacesRequest.php @@ -24,7 +24,7 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message */ private $parent = ''; /** - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -89,7 +89,7 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message * Required. The resource name of the project and location whose namespaces * you'd like to list. * @type int $page_size - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * @type string $page_token * Optional. The next_page_token value returned from a previous List request, * if any. @@ -163,7 +163,7 @@ public function setParent($var) } /** - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -174,7 +174,7 @@ public function getPageSize() } /** - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var diff --git a/ServiceDirectory/src/V1beta1/ListServicesRequest.php b/ServiceDirectory/src/V1beta1/ListServicesRequest.php index 18cb36bccaae..146097d38bea 100644 --- a/ServiceDirectory/src/V1beta1/ListServicesRequest.php +++ b/ServiceDirectory/src/V1beta1/ListServicesRequest.php @@ -24,7 +24,7 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message */ private $parent = ''; /** - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -92,7 +92,7 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * Required. The resource name of the namespace whose services you'd * like to list. * @type int $page_size - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * @type string $page_token * Optional. The next_page_token value returned from a previous List request, * if any. @@ -169,7 +169,7 @@ public function setParent($var) } /** - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -180,7 +180,7 @@ public function getPageSize() } /** - * Optional. The maximum number of items to return. + * Optional. The maximum number of items to return. The default value is 100. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var diff --git a/ServiceHealth/.repo-metadata.json b/ServiceHealth/.repo-metadata.json deleted file mode 100644 index 21336165b796..000000000000 --- a/ServiceHealth/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-servicehealth", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-servicehealth/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "servicehealth" -} diff --git a/ServiceHealth/VERSION b/ServiceHealth/VERSION index 845639eef26c..c946ee6160c2 100644 --- a/ServiceHealth/VERSION +++ b/ServiceHealth/VERSION @@ -1 +1 @@ -0.1.4 +0.1.6 diff --git a/ServiceHealth/composer.json b/ServiceHealth/composer.json index 666e6f1852b7..7c9a3d32752c 100644 --- a/ServiceHealth/composer.json +++ b/ServiceHealth/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ServiceManagement/.repo-metadata.json b/ServiceManagement/.repo-metadata.json deleted file mode 100644 index 4d2fb8ad3b4d..000000000000 --- a/ServiceManagement/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-service-management", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-service-management/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "servicemanagement" -} diff --git a/ServiceManagement/VERSION b/ServiceManagement/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/ServiceManagement/VERSION +++ b/ServiceManagement/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/ServiceManagement/composer.json b/ServiceManagement/composer.json index 38e12be57801..b141d03bacc7 100644 --- a/ServiceManagement/composer.json +++ b/ServiceManagement/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ServiceUsage/.repo-metadata.json b/ServiceUsage/.repo-metadata.json deleted file mode 100644 index 76a91d5f1b0f..000000000000 --- a/ServiceUsage/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-service-usage", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-service-usage/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "serviceusage" -} diff --git a/ServiceUsage/VERSION b/ServiceUsage/VERSION index 1892b9267677..d0149fef743a 100644 --- a/ServiceUsage/VERSION +++ b/ServiceUsage/VERSION @@ -1 +1 @@ -1.3.2 +1.3.4 diff --git a/ServiceUsage/composer.json b/ServiceUsage/composer.json index c6d06b1a30fc..e7850c6dda41 100644 --- a/ServiceUsage/composer.json +++ b/ServiceUsage/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Shell/.repo-metadata.json b/Shell/.repo-metadata.json deleted file mode 100644 index 65b9bdaa166d..000000000000 --- a/Shell/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-shell", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-shell/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudshell" -} diff --git a/Shell/VERSION b/Shell/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/Shell/VERSION +++ b/Shell/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/Shell/composer.json b/Shell/composer.json index da8f472579a4..5b20b8fb5c8c 100644 --- a/Shell/composer.json +++ b/Shell/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ShoppingCommonProtos/.repo-metadata.json b/ShoppingCommonProtos/.repo-metadata.json deleted file mode 100644 index 873470389f0f..000000000000 --- a/ShoppingCommonProtos/.repo-metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "distribution_name": "google/shopping-common-protos", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-common-protos/latest", - "library_type": "CORE" -} diff --git a/ShoppingCommonProtos/VERSION b/ShoppingCommonProtos/VERSION index 0d91a54c7d43..1d0ba9ea182b 100644 --- a/ShoppingCommonProtos/VERSION +++ b/ShoppingCommonProtos/VERSION @@ -1 +1 @@ -0.3.0 +0.4.0 diff --git a/ShoppingCss/.repo-metadata.json b/ShoppingCss/.repo-metadata.json deleted file mode 100644 index d9e42ac0e1e3..000000000000 --- a/ShoppingCss/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/shopping-css", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-css/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "css" -} diff --git a/ShoppingCss/VERSION b/ShoppingCss/VERSION index abd410582dea..b0032849c80b 100644 --- a/ShoppingCss/VERSION +++ b/ShoppingCss/VERSION @@ -1 +1 @@ -0.2.4 +0.2.7 diff --git a/ShoppingCss/composer.json b/ShoppingCss/composer.json index 0fd8b8ebf72a..6ee19e6f8024 100644 --- a/ShoppingCss/composer.json +++ b/ShoppingCss/composer.json @@ -18,8 +18,8 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", - "google/shopping-common-protos": "^0.3.0" + "google/gax": "^1.34.0", + "google/shopping-common-protos": "^0.4.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ShoppingMerchantAccounts/.OwlBot.yaml b/ShoppingMerchantAccounts/.OwlBot.yaml new file mode 100644 index 000000000000..58bb41d7352d --- /dev/null +++ b/ShoppingMerchantAccounts/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/shopping/merchant/accounts/(v1beta)/.*-php/(.*) + dest: /owl-bot-staging/ShoppingMerchantAccounts/$1/$2 +api-name: ShoppingMerchantAccounts diff --git a/ShoppingMerchantAccounts/.gitattributes b/ShoppingMerchantAccounts/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/ShoppingMerchantAccounts/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/ShoppingMerchantAccounts/.github/pull_request_template.md b/ShoppingMerchantAccounts/.github/pull_request_template.md new file mode 100644 index 000000000000..110a57ac1220 --- /dev/null +++ b/ShoppingMerchantAccounts/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `ShoppingMerchantAccounts/src`, and tests in `ShoppingMerchantAccounts/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/ShoppingMerchantAccounts/CONTRIBUTING.md b/ShoppingMerchantAccounts/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/ShoppingMerchantAccounts/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/ShoppingMerchantAccounts/LICENSE b/ShoppingMerchantAccounts/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/ShoppingMerchantAccounts/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/ShoppingMerchantAccounts/README.md b/ShoppingMerchantAccounts/README.md new file mode 100644 index 000000000000..0a7324131e56 --- /dev/null +++ b/ShoppingMerchantAccounts/README.md @@ -0,0 +1,45 @@ +# Google Shopping Merchant Accounts for PHP + +> Idiomatic PHP client for [Google Shopping Merchant Accounts](https://developers.google.com/merchant/api). + +[![Latest Stable Version](https://poser.pugx.org/google/shopping-merchant-accounts/v/stable)](https://packagist.org/packages/google/shopping-merchant-accounts) [![Packagist](https://img.shields.io/packagist/dm/google/shopping-merchant-accounts.svg)](https://packagist.org/packages/google/shopping-merchant-accounts) + +* [API documentation](https://cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/shopping-merchant-accounts +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-shopping-merchant-accounts/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/merchant/api). diff --git a/ShoppingMerchantAccounts/VERSION b/ShoppingMerchantAccounts/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/ShoppingMerchantAccounts/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/ShoppingMerchantAccounts/composer.json b/ShoppingMerchantAccounts/composer.json new file mode 100644 index 000000000000..ba353727fbe4 --- /dev/null +++ b/ShoppingMerchantAccounts/composer.json @@ -0,0 +1,31 @@ +{ + "name": "google/shopping-merchant-accounts", + "description": "Google Shopping Merchant Accounts Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Shopping\\Merchant\\Accounts\\": "src", + "GPBMetadata\\Google\\Shopping\\Merchant\\Accounts\\": "metadata" + } + }, + "extra": { + "component": { + "id": "shopping-merchant-accounts", + "path": "ShoppingMerchantAccounts", + "target": "googleapis/php-shopping-merchant-accounts" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0", + "google/shopping-common-protos": "^0.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Accessright.php b/ShoppingMerchantAccounts/metadata/V1Beta/Accessright.php new file mode 100644 index 0000000000000000000000000000000000000000..fb5fc5530adb19ab628caa714a0560c20f8f9e2d GIT binary patch literal 940 zcmbV~(TdYR6o&1JqN5k3ASifo#D(q3nzDG8S|x4Lnv13(tzJl=Os3OxAe|XzCW1;| z!e{hBoFq+MSQIfgNrwOY=b!VPx9{anqL(nEoGNVS2C}bUb`+!%Mi5azR&KXc0TFx2 z3aT6ce*w{A1%V%~Uf5DCN=2v(xe$3l2YM%@WIP}2sUkbf%>WZ3N^bPv%XLN#uKuak zisd`w)NK&rcu%#&gu*Ny&#h>K4NhmZW4b&#rt_m?>Kz@^PuF8B9wI~vtTov4)){?A zU>{j#1tXvhHuiPS^qO&I7%td1d)EP}1DX{f(i zqel&%qypc2j-GmxNw8e5lW_K7wf-0_<6sg_!@%#}={-gdmMbsvy~OW!dJoY(&!2}; z_pJ8}J&A*4x=7|;Gzr#85HFHd7|ptO$3Hsg%5JIiuZhOp8+mGeap!YH3Q=xa4{JBb s#otyMOZI!K>n)eru)Vs>vitRdzqvR~{i=a^gZ&@5*UAR*0UZ$f1;^VnivR!s literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/AccountTax.php b/ShoppingMerchantAccounts/metadata/V1Beta/AccountTax.php new file mode 100644 index 000000000000..813982eba941 --- /dev/null +++ b/ShoppingMerchantAccounts/metadata/V1Beta/AccountTax.php @@ -0,0 +1,58 @@ +internalAddGeneratedFile( + ' +“ +:google/shopping/merchant/accounts/v1beta/account_tax.proto(google.shopping.merchant.accounts.v1betagoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto google/protobuf/field_mask.proto7google/shopping/merchant/accounts/v1beta/tax_rule.proto"æ + +AccountTax +name ( BàA +account (BàAD + tax_rules ( 21.google.shopping.merchant.accounts.v1beta.TaxRule:iêAf +%merchantapi.googleapis.com/AccountTax#accounts/{account}/accounttax/{tax}* accountTaxes2 +accountTax"S +GetAccountTaxRequest; +name ( B-àAúA\' +%merchantapi.googleapis.com/AccountTax"š +UpdateAccountTaxRequestN + account_tax ( 24.google.shopping.merchant.accounts.v1beta.AccountTaxBàA/ + update_mask ( 2.google.protobuf.FieldMask"} +ListAccountTaxRequest= +parent ( B-àAúA\'%merchantapi.googleapis.com/AccountTax + page_size ( + +page_token ( "~ +ListAccountTaxResponseK + account_taxes ( 24.google.shopping.merchant.accounts.v1beta.AccountTax +next_page_token ( 2„ +AccountTaxServiceÅ + GetAccountTax>.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest4.google.shopping.merchant.accounts.v1beta.AccountTax">ÚAname‚Óä“1//accounts/v1beta/{name=accounts/*/accounttax/*}Õ +ListAccountTax?.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest@.google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse"@ÚAparent‚Óä“1//accounts/v1beta/{parent=accounts/*}/accounttax… +UpdateAccountTaxA.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest4.google.shopping.merchant.accounts.v1beta.AccountTax"xÚAaccount_tax,update_maskÚA account_tax‚Óä“J2;/accounts/v1beta/{account_tax.name=accounts/*/accounttax/*}: account_taxGÊAmerchantapi.googleapis.comÒA\'https://www.googleapis.com/auth/contentB‘ +,com.google.shopping.merchant.accounts.v1betaBAccountTaxProtoPZNcloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Accountissue.php b/ShoppingMerchantAccounts/metadata/V1Beta/Accountissue.php new file mode 100644 index 0000000000000000000000000000000000000000..e1ae6e3f0e13224be44fffdb0cc0ccd82bb24580 GIT binary patch literal 2826 zcmbtWO>f&a7_Rc+CCtYXwOt)w#<~IGW{re;zz$BcLUtU_L-SGFEwE02Aj`B(Or|uE zN|pw>3_I-JAG5>$!H(UnhoOg^hW&z_MpBgPz{!#mlc!-n1P@>h z5fr%$bzu7#vOa=g6tKVxeAte=T@*nt7=+kIkpbcMKHS@H!RmIsb)UP^AdWm#g1sQ< z`N*XGAPh0-nFADgeU~uP^}HY^jGBj!+laa8H>Na3hFk{#;tmiET@S(9L3x*3bzJ7! zH5t-ws*v`s3Tay^r2X=7nHz5c;Q214P>svb-~>Sa3*)wrJxH0$_}?m~4knmk*T=7U zwOg?3`V{d1XT^+&*u{a`|GH(&!bogeU1ECdS z+ae?oC?>y0aS83bWp*)`N(4NsgbO3 zIRwV&T1Hca(J{D-2Yf%_JDSr$lwpz(KRX2{3v}RKC zH7j7b6L|4}OGd8g#1YPB#8mE&32^(o5Z{932!%n!WA+>`;57SzNxT+|n`4;@(2YiF zUP-LS2C5_;e0A$*P1D=pqXY`d;TFX|9}9UAzs`btPUc23mJ2~9dDCx$xd`?69>eSC zsHUH3uxR6@5&&c$|^4D?G`vooB(&I4I8t*xWnHfJo0Yqm9&asst`9FVdS}-y))9Vy_wb- hw%Zwbd;ENDc>X?0E=nW!stfN_(lWXGoPtvT{skB6y(s_y literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Accounts.php b/ShoppingMerchantAccounts/metadata/V1Beta/Accounts.php new file mode 100644 index 0000000000000000000000000000000000000000..5feed8e5d36762dc61459d29cecadbc2dab59318 GIT binary patch literal 4619 zcmcgw&2JM&6lW7ck{43M5Qt+AUED~7G}uZg1vvz|P9RVZNC{fE)Da#zP72~-Q3o1uHD%_hoX@m zhc+$hb>FYMv=BA?AaJ~Tp-Dr#VR@`z*|r~hEGq0QRw%R5?|ESZz_Xe(3M`xI>szG_ zJW;inRbChB%J-$Z@`hAbHl(`pXNx5~ybNHwRut)K9ri%SzaXx-j;%+`V)$>?iA=|H zm}9xlQ;c#&uUT$HQMmhTE%t2Y_@2%MHa(lpUCvhc#MXg z<(AiIWQR_`{BR487K?StQh52w+y!Ztt8;4lT;gM~*yZGk&cc|sTG#cEvN-gXh2LDk ze)_3=2z*B1lnu}GISRfP6^jQk9jNFfxavC8V}r@ua;RG^(T26-_~Brp_oytTzMV|5 z$H;Fs1NNkUgQ=)+c*BYw^)LI%nk+wv=m5cQKM81g4ZDvyO?tQ+qUtVQcVvwj)oNN& zx3Dee(jwp`aUT9U3s+vVAIV%Im{*OQSB;!kjhs&!IXf*)Sb#W=o0_|8^dGakU)XroFqqp9)Y@}I_4$f=xS>ZBh06y=fS3o2M5{fG*C^3#59 z15U0}CQsa>k7M+gTx~;T9v%4CnC-_z?w=9RS3`<`8(wwQ_i9c(4rzz_br_ZQ1@03| ziz;%JQ3N`XfgK2b)2Fyh2Z$_qHGx5xh zW77;z_r#JpsEyt@@L15&HaE0cyPud5e%wCtwWg5}MwRWOBEE9@Z5ppuC6=w0vyWlw zFt^B!wvt#BCGkF7cuCc@$3-$Q5z;!2tfYPqnkV~%1}BmJ+Pxu{;gpr!3rwqCM^Q2F zL_ba}ol!t2+Q^Gxar+1{U<}uGoGJ}vQ)BsReU|TS4RJ5M1IH!qChx@31dN+XXDJIA z-p+?rNNx+J)~HLd_7lh7yq&(&VCq4@`Kv?aTWg^YU?LUZLq&Ka6X=g5ZH1I7)|vl^dcua_T8*57V>QRcRukQoEan(YwJVPT zyy#G}3S+V&B2>;BesJDEc0b|KFPPcsPwp!X&TzB$&wGE=+eh@_#_E^!GTNP_au=AU|pV2Lpl(K(Pl>vOKbbrz^Mk!Vm-c%jbW5J2Xpj z=}!&y(_@d1;uTdFh53E*T!WdOBZz#gO8eELrl*oOi06t3WHGnU6^IIv&I`}kiOq}VWg8;gmIO8*cHZ}nzOAPU33##RxxJRe>SqcFCM=b&a-uKO>0F+o2% p9!-MEvWhIIRE{A6%)fL#{rR_$yco1RF!X#}5GRvIfPL5p_z%(mRW!CAJm2l^R)E*6Xo7>Uw9{ zos9`mBm`$p9Jq2pocT96!mV78;KZN6iP_zmjqy4(X^0Q;X7>WWmLeOyuB_^?8&mRns3r#Y1u!US1!b%f1njKiJ)H`?CR*(3uiBvcw zWN0D98xhCB_D~rk*Blu(RSeT4zD+&l@KFy@L+SY*wvp%IKC&sMM{F>dv82b8uI)Z4$6RY)@5Bb2@c#*2c1h*@<0j&kjabzl27{Atvs{w(cV?t#bz% zb04Da8Q$~xh~b$%`~>q8()#`QKz5kO3o(TOq3hts74Z0y>Xr(T16h=ZEXqR`I3%7X36@0Z z)Olq}%U~g>%4`az3O7sFe%IcR#z10D#w65_ZZZ)uO=Q!|V6nI>pEpZ+7D{Gk$DNiV zp8;G-8h}jCGR)^Xnb@eGy~c1dm%UfQxo^^7IdOo}*D3I}7$$lju`$3#8EbE$ zY!{24UP6@#Fj=frPH_SSrSmRWne$Fs1F&AHHahjrGrdwR?`r#6r`~MnPa5r3wOrq+ zS1U`eNwsos$C9Q%xl_vX#4P1TN;92lGou^C=!an-UM;?{5e>JR4b}oNw4=)sJ{-+dJ zed4gY2RaMn04$5Jbj(|2sI^Q{eRZvcDv~|~89xNqgWeqW)l4xbyo&ZM#{(|hRs3TC z+@6iLjod?QBI&mjSee6^R1r>JI+El$+d1L6OC+2xz0kt(^3|_@ew+SC+DzOOkAvZ} z9c$-7LNh1Q_i1oz{%J|I^Cvjp!~c=vm#G)pYCmy1XPgRu3WWqU%OWE-0NMTc+vMFEsE(JDNeV?1x(mS)FWZjCAR_dT( zTEy=QM?udRlK=YYz~bS*9)ud4-qz`3?|N7no9pq-Z6mrWPu;A~yj6#m(e3vHoB;3- DCajeX literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Businessinfo.php b/ShoppingMerchantAccounts/metadata/V1Beta/Businessinfo.php new file mode 100644 index 0000000000000000000000000000000000000000..6959d4660d30d75845c070ca5123b905ccecf697 GIT binary patch literal 3108 zcmbtWO>^5s7)DN7!lqE7&VXZP=#q9OPA5nc^D%>h15(nuIVABUq0BI1G?Kiw7i6uF zR>_o%FK}TPZv74X0e%MD;MP+QocIZx*j=p@*^XPA=HSTI`#kU0^S-;Eeirp3a0j+f zh+>zb4)h*F+D9;o2_-%WpqF;LD26^6L^wdP2I1ZjJUlvu_xJWs-(%2(q_K|-*dwGD zAU)}mD8gY+AE4OpyCKzG-zRBE6a8$;bl=gw7v`tBAKiaaG@iqW{;3f&QO4Q&2K=v16umhr6(z#b_84K{g?cQ&jd2VT@=Rhub1?=xW zM%XsPknk#yFfokFoGvM*0e1t8LOLJj0Y*W`LVfoPlXyPpF_My+Imn{+!s~&Xd^@|x z7mCZ?O%qC(niCYCVW#w%!+J4wyH7%NhGN{se%2Y*pgBC8K8}zrNDkA1hvq1Bh9pdK zf!XQAY#gu7OUV5F9V|u7YzqxPVEdq6sE%uJ9sGO~Y`?@JQ0p03%eRP@ZxJouB3iaZ zYHv$7ZiIDT2sGOzwcDi^U9LjMlQNVBt0e=LxL9BERldZ;R${}fX9NSLC~2`H!Fhnw z*PK5p8;QR^Gd{Xf8ner0RkIRYyTQ ztxT;PvhYyhkN{M(EXu>+@P&w~i;U%s#^*UpUiqog(AwO^qtaBJaGuOtg?sxNyqR~$ zkyBm0CSv_$b}#u_ILX#Rmj42yH@^AD>;Zc{mo8JNWMxl@#!gawr0}(xl4rpmKz_>-iR_Q??OfW5G<#{ zp~EM4T)X*jYsG0HP>tUf!L2fvY^?f+0&b3#Mx8^AV^CSu+W$;&ZRe>e=JbcZ{(e%~ zQuT@J)dip8W}&HjBU&1&KURP`*$s7f_IgjEUpA-csk!ROtD6wPW~qH5(Zfb_GSLx; z_T03MQIXYJznit`^ZBP~ulFg95<}O|&(FuF*G*|(_X#@^Lux%yz$P2%nagLblr<)9 zE^XzjLq8yCCnw=6qDP*0m1dhn-lp?LN8a}3qjz11{Dbx4c;3vekfj^v)Z3=8%x;B4 HFa+Q~Jvly< literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Customerservice.php b/ShoppingMerchantAccounts/metadata/V1Beta/Customerservice.php new file mode 100644 index 0000000000000000000000000000000000000000..486de878948c3ad5cb87f619818890fc861773ba GIT binary patch literal 1155 zcmbu8&u-H|5XNysBUlbd5r~KbTA)&0sn|-nIix5iH1yCUQX>w?QnX%A;+34;)p{MN zpxilf;&FHu9)_)Zn6`2K|Z}eC+rpxr-1@ zNSfkzzthndgv}$fFkuv@nrQPnVCjr;rWr}tXQR1?=OjtNFs|p$Gfp)V9OngNPQgCH zB{R=GkizV!hwC{f`P$6Nf^)7xagqcBNU35{3pFvRp0@zKS$6)#KC0U0I5x+2Iiu%Y z8?uMB%3!xU#tL+%c(<542dp=z;D#;sB@50NB#{p>SuvqJZ>wqxxv6w|B_Wu^g2O0V zhHy(|v5r@#tPrx8s=7S$YsbQj`pH^SJcpj+Jkxz literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Emailpreferences.php b/ShoppingMerchantAccounts/metadata/V1Beta/Emailpreferences.php new file mode 100644 index 0000000000000000000000000000000000000000..9300700c0a36da5e763e6f6db2eb48fd291f9731 GIT binary patch literal 2540 zcmb_e&yU+g6vkK2+LM=1Ih$-0r2Nn(i%@0BnmChWgfn(M z<6Xfj7sR1=4*UyT`8PPit*1(GLgK`Y3yjBhlEzucQgX?7=DqK|`QH0x=Hn;+#0MY3 z2BtVb91r2(OUNe}`hmwi$8+Hz9F1@Q9dGIr7Y7=IwGM1|`mkPW_CFA=%nJht8*uD- zV;Ade;`u(IV||JPXM!l#k>hwFRZ9%qEm@ zf?V>I*mVVtkjtTu#w7&&xA#-#@^#*A$5`<`H_0@Fmh5pjYvt4TQyC~~bD zW==qS?gd?8Y8Ye8=X6Iir3Xpa2#$ zqO94&Pe@WBb2ywAFclQV7RBFlATOoUT_{t%1+GS_ z+*Y7cx?a8V(!8c3aFgOQW+OVZIq}(cPOQCEu4|iaP+N_nb$s5WJ<*al3ZWD~2VgO! zz6Z8D-M-yy+r7TouiGc>UblYOJZjc!`8U*?;JR3?*X+(oKd-1az_s|Z+0N(Gx53s) z`>@kKY96B!RLX}?SKdyp1tJ(H&a7rAk z{-S_))-a~lQqX^umbS({A-wP!8!mqO!jv-k`sZK2%~jNc%#C**iKsH~qur!`b~Bwb zQ@_uF+v}^QHa6erdW8RDug{ei=DkeU>@C$=vM?yOvMglWw2gT&vYlFJ{Ad;~7V=M~ zwKL(|XNInyot-7z&1H^4KG7Xd+yInUzf-`T(Ei5!R^MH1QhD=qm8WgT^}=Ba6rCqy u@1LGTBA?_{ly-+dI9Ln^Z%U;++L_--d+`%s>BVs2Ye8DZxB3js0Qeio6?2vV literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Homepage.php b/ShoppingMerchantAccounts/metadata/V1Beta/Homepage.php new file mode 100644 index 0000000000000000000000000000000000000000..17f59c6b82b0b1e2767032e047ebe8766a64ab7f GIT binary patch literal 2726 zcmb_e&uu^oH1@Fr zJB)QgY$pMWB0@WM7sq~pD7TUCvy}40-dSj3j_iPSafCY9k}&|FsEd;b`4~1f>+8az zg*fsW63*LFaNfFt^IQezeYa2-#)|;>AxaW>Pr-sc0L3p#n<4RG!VwpLmq@ZrDB%Q! zZKu@dgi)9|Y)~IpFT)%&v%M5Cp~^DU32tUW36Z=t%5h9l=&j7vX#1Lzei?;Y~F z5%F9~S*8M`iR0{Z+J_kBcqb&7^27PuB{*!=ae#IRix21e0IO0OJIO+O8Fd{cKfXJn zJhQ7SM4gb^Y83}^R}^)%kT4T;7W{D<-2A|5HmkX#rQ5*LZD8p(u<|x2f38BHh}gbV zI&X;b`M!;ICg*lj>8T9P^%=xUG_|F>P_~w+N;?PW3TbkS$_oQb>Q*s71;?`Pn=znK zJz1Z4<4&4q!9*I9nUeley7$R1hG9;F6Qa#X7q@06#MWeHJmEb4$Ne5$)D#61D^E?V z5=)E>yNL9Krf=`5Rj(KXb0_skNNSUMSw9YrZHr7Q8^CN}u7MulCn-+2`Sn2NSKhd# zf88&~N~QAL0B0XXV#wfwplhHAFD03()fA!kpQok4GG$8Ubug967~7flQqHMbS)=LW zv5LZ#UX^db^qov)jr9@OZh_ApQF(M95485{32;WkZQ*!__}F}DfT_NNGM6;j_qKx7 z=cX8!KS213^V*f={PW*$pOvnfSB7q$y{y=mi%Og;DzIn1HNfe?qA+ibPhimVC>(xx z?M?^kCY$f8Aj#==?fNh$ZEcMt=M+_KzB0h6feJHM#%DR;codRLlFg0E!Z4fBBxDUc z#+>=P0nQvKY4i5@EDpFHg~y8I@m1y8VR(qwMb_eiNxAW-TOK_;|8l+Afb%GEY!vMXMF^3uASZQFZ_S62bgU?n=Au~@2!^0rdDfk$1d>*zEs z9$3~vho;=NW!r{%kUFG}-quVnrRloWH9a?VbiYA8EoGSUj=buLjWdLI7Qt0_ghV`xzA81kgL0>xw0=qQW(lxdJ!= z5r6D%1J#MHr+N72rs1lFX?TX#F}_6Kx5Sp#aVf$K%eK0v?irRTvI8Ykr|Y*xACt-6 zv@PUnOAJjdGy0Iax?+0NF||&8o4UGV*q-H-Q8b-Cpk9x3_GbNdpq9ZIEpgqqF`XVV za!d4_F74MYiawc}+-?SN+Iy;xAX2i8x@4LbW5F`rbo!-FFCoSq%ytZFdS^S6Giaxo zp>6HRu$;3UtNF;Z!g@6G;cwF9-%<+hg>Im=Nnbra zxk>CCsbQ?d4+31@HQZq}26aP4GR)YTgV{EyikwXqS%Ijn9Z=Q9B9Bd?(bJj8Z<0V( z0r-2*dP>b$gnPq2Fx$lOwz)Re3?=nCtc+-7Xg*pSS)bc@5U}w7fldzdgT`Gn>2pu* zvyhn{O?n2|VKp5l~HTa?CTIQYYJfn%EpAaj%wjp^Xy<&b)9 ztLerrphJrr$~ko~NSsQDNOZVpc=S-!EwhOe1XCh5%XOU34+Sx^AtZSUmjXZBw!z0L zCoIYdE4~G1ssSt`Z4H(O)1~VeF;1N|Z_m5+9_<43`;u}FA zB3!~Du2a{=(T>xysW!D^H#UzF(>nr_xC$2o6#AU41_v~@z|T+O*Z5xoELV8Y`i;_H zinS)*02Vi@Z`b7{8xAB1(U$R?HaWGd#^yHO8PdayNR}N#r-?jF@pG49skUF1)xBc1 zEN7LRB5yBEkSI*&lqdKokar=T-K*A01-YV@rG2HCSEX!iPuf*;vb;1IZ@|J}+P>d! z3G1$}w`6AmyTrnwp*xmp<4VLDC2wy#6PX#GxA?CD%mjt^c!0{CAs55`{puJR(Vc=? z_W7HKDIRI2I+CETW#OGR9Hl~VB)>yghVs}oR4AklAoy-0l8kE`~LvN2WF<4PYR&r(q zE~_KzH$z}4JP}sy#!pkQHavo=)H%ZXAb$vOW#s-qa&MkKbU`^`+s#%l7MGONS+$M0Na;q#*2vAWF=imjgq*6XgNXi;!84MT1>HeWtAX0R+g>w{ap>%d+A U0@in58+%vdlK!3Q6ixyD18y}njsO4v literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Phoneverificationstate.php b/ShoppingMerchantAccounts/metadata/V1Beta/Phoneverificationstate.php new file mode 100644 index 0000000000000000000000000000000000000000..97dea70ede8e54f23881f40c9dbbeb8410366110 GIT binary patch literal 1037 zcmb_bO^?$s6r><=@Co(6h09xQQL|`CwBpuMP`k~R95#t)wg(ica$Kjil-ic#tOTfk zf;)eK--z=`rQIS9m@LU^ZyHZ4m<2}tKCKMLo?AG8nSmSt6k;lu1Jicwn<7q=4udZeWJVuCQ zIL{$`R0MrTU_MzS86!~Yn%{usYsQ&oIAh;T2PTl>ET@L*AvP^IDJ?@;5O6}R3#d6u z>_7_Bu?e(x!?KB{fw9LmRUBvWoaRI^sf7v+bTryh-L<~Fu`U|fl8&Wd)gDKq2PP+= zRY8x{0Tk7R;^WG9NpR>+m9w`WSmR^5*>tiuW~^2REX#)I*E8h)mwEQBn#OKpVYjic z+gR9jEZ+R+p_kRvR!7lTmeJ^2Xb^r1e0RNaKYKUc^)&JVf4z*Rk-NV0m!W%YZr%Bd zC;ivx>?E=-Hn3hl9-{M;xI4c?KArvSp-Yo}`(K|id-eDmswjlLFFwgcv1#cHv$GX{ p+Zilbvo>wNWHSD9OrBS3^KRG;@UqUuQH)MTs6y6hIiLeVzX6q!S$+Tj literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Programs.php b/ShoppingMerchantAccounts/metadata/V1Beta/Programs.php new file mode 100644 index 0000000000000000000000000000000000000000..64938f2978cb12d4b7663e36977401ef833e45b2 GIT binary patch literal 3086 zcmb_ePjlNu6i0E=q?@!&whawFz#_uL&9v4ez!a1w9XWP9p5~9+1P+X+p0&KTcaXJ0 zyGnqJFCFe2_y&9oK0;@>z^$hqI5EQ);KWK=$?~KDyR9!?OYi;Od%yR4&->t^*Ym(f zs7hSoV?o-e^*s_jf;^uIW-|x1f=-9{$Yyav`R6at7M<=LKuAO`+T{#PUo0zD} zSl1y2?=jD#ZrA7&-|k^o7}&O1;0kV>ZnTKNhJ^0=xX+7G3;R7I*Em*ijROVOuoPV5tBsO0-U7gOFz2YQV8J;+^5X?9huVk>EacZJK`~}%yXrB?$~H<8lwk#vBsFTTAij&8MwxKi zr=DPbU7DI^mxz?!@JZp03LC=F4l2Ysn&yQhw~_Dzl8ug#PekCmTT$L2z#u&}UO}Jb z(T3%^EM$SX+%$(Z4IwUb+;u2%#biEvlsN4Y>ETn#{K;IO5GAEoCK>U5Z-*+Dt#&&l zbx#VjkkSy6vIhQM0{352k+2Xu785BK6Db!HDHmfY=WnYJ*rSFWu@#Ft|3T(OC#0m= zQk*D*_c8{)Dm;Fr|1u3`m6+iYm=4EdMMGNQYAN^9nuG6yr8cvJzHCj@)Mnt*m8s-? z4n6`ip`gf0PCmQ7dA~SrHANM)cpSQi!Ez9Rn^+FRDQWtoD;3nVS)1^cX_Sl8$-$=p z25z4SY4B}8eG=xyS7xNa{O0!Lv7Zc4q73o`%x9iK2xbHoPKJ@(|1zS3Wh|GNE!W#< z8M(9!U9uLH4VS^v@riX(X?}TlT(9ib_G*>#;yZ8=EXbwTtnAmSwbFiNQG*L$F8wtH z=fP~{(2{S;i#ZejWjzIYq8cd<#e+QYqTHlL(%z2~K^f=jG)UK@aqh(%ZLmJ4PJDA# zo%92+R3$>;gai>T;O8T1S$}Cw{bQ|;lZgII12^|6PXKv>Xo4#q_GL?z0u?44r?_{) zRS$Pblgo`833Mjxs0MEX5Iq;{8{$SPjg+nF0^AzSfqQai5x5Id0%RJYur?+ZmW+DC zCEtl=CUi73dL7)VxVYtzw?^h;uw176Z9;DTI16s5{P;2PPpM7duNnYD4ZyAOIT?DX zKIbPVRDbZoigwepKmPoA%7FJS{Li0jU_k1{Si-h7;_HtY1>V&iK`j zy2l#RcV1XZ>6h0NPeP`m;jqHz8n`whBRD}uBaTT$uhEjdY)ih-Kb@#0CW)rN)Yil1 zTpv|1d^kS8qn>Y2PBmMOsed+EIqi4^Wj*=ob1Q%OHvZjeto4NOxM>(?XJ@L=bXVg* z^bDKHdxtAZKWX5uT;OAqQM#5)t^5|Ou6=!IJ1l4?0O6lOm;KkJS>~bc&B-Krt*zm) fb;S#TKUqufKX>CxW9E)|>HRXYjPHR1FaY3RN01wI literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Regions.php b/ShoppingMerchantAccounts/metadata/V1Beta/Regions.php new file mode 100644 index 0000000000000000000000000000000000000000..10ba3bb8424544df3e31a6f1268e3ce6e98e8b0a GIT binary patch literal 3981 zcmbtXO>f*p7{*Bxnn~KE6DbK>skoa+`B1QFTD6kXZRJhUP(ePFhVZpwHS3-14s~qT zo=pf*4shbc0saBMfD;np7r+Gx4v3sMaN@?56R&5+UT@NEcbC1aWzYM}^S;mfF?0W6 zP!G_wzD_+F5>Bgn!_a>M| zej{|KrPqAF=2A1N`$53Gnt4D&r%pU>636iy9*@k!TNTQQ8PXc_y~q$-Amot)8U@6m z`ucWp0~S;XC#7|PR(hh)N*fBTWGl4N-mM}mUPj1qNfhZj5*3{w9ezQh;xb2%IN|U& z!=f_t7-z&~pMj4BeV@1y1>1{j_ZyzWfu9~5Y~R`;#4WAT$O&1%{cszWT2_tnG`R7bxp}p149E8MImywoE|4tfJZ#YH?z$dQ-Uz*A z!8-;xO`l57iJl#>lI?kZ90iEDWi@?jLbNknaT)b^cQ%h0b*n{MCx^@ryEEOPDv>%S znZ_PGUpol+apxPRrh@PWiJtag`(8+bfQD_tDl+Ab2TbLKU9F~R@CXWNE)_18aTfhJ ziSG7RL3mEu8A;_CN#z+yGw~bTGbAcJMFzAkQ`+ah)6n=zNTJcS0$OM=AR(l?f?N=gGbsN8 zNY#k&1R4rO?gx_J2k~vCr{-3f0 zq(;jTbbR5~fS`^i5fbmY|CD+{njz`aGc?{pAqt>nQf#AFrHm2eMt?7XhAl@u`YA7G z_7!=O|7QRVO0Ds=mXwAdU&c4kNR>r_OODGT+tb|A-g@OrO~W6fvA~Dv;g%i0O3RSH zM5WrpM8B7|1eI#Wwg6fI92;O{q&`AdYZPWj2qR3QUlN)2plkGX>hB7eCip74F2f4+ znRf`K=ZD8->arTExO8ej>~t{?i!ed=h})ns#eQs|Yf+tv^G4Hlup`^tFB-bq>NcK2 z!;+MUsOklA72;3ONG8@1BvhOVTU|$@b;C^9cZgRLPW9#Pq0#0t@g8F|P=OxfWhsrJ ze(Gg9j+VQFuCzoNPos&Zf^aH6GCZeNs1t~J`LmHPHA z_?8`C-T0QZOMIJ1L{G=1IF6o6t%c_Z(Vi^+NkhY#d4%sLo4mZIXUr0cUF2npwH$)^ z!kMiONbSp{eNyGtf3|b&Pg1|yrP(^?L1dZc(b19eGd;SI2Ctir59er)7r)ZbBAn+s zjzw`qwVLhtqPDGlxaqilqng;qN5h)`qB|?lP}kO^0|b@j=3`}0XnuP(Jz>% literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Shippingsettings.php b/ShoppingMerchantAccounts/metadata/V1Beta/Shippingsettings.php new file mode 100644 index 0000000000000000000000000000000000000000..d157f2c09c7f9ebcf713ea7fee8096eeef18292c GIT binary patch literal 9275 zcmb_iOK%(36%I*Jk3+pYifx&GF%t(?+=OcArUB$Q2}hzOI(k*4tT<&c7?D@fBov34 z8A_227iiH%cU^SRUr-b%y6C1w|3QIt*Y4U)P;}LGgFaS0=iEEP;X^K2#|xR9d+)jD zeCK_J@4nwWYQn3TRnZWx<%?Qo|19GliA>XVe5dNvGyAQB1L0<>&T-SO3pbm|tZZdA zx5}BqO0oP39`&4-TNO*0L&rI+i$(9qX*TV~;o`Ayt4CJDU$m-Kr`7Pi#gn)8g>T^w zn|FA^_i>|_<+}hH*0J!KR#jwHw~Ynp2@hvZ@Gj0%RpHIYGl_*%?yc;gvSmy1BvFcK>j0;gD~_C&hqMw*>+ayR_JXsL8nTLE;BbB< zU^TvU_V@e=d?NrF@l?d|lb6Maw%8-@tAR2WpQ=yK!gv*ca%VP(V8N4I&lCOkvoNNF z)o#F~Ld@(0GrsoHk7F@y9!4#UFed`>j4h0lIPtX@t=t5yChEB2o|zm(U0Wf=%7|-e zn5wp1S2U`$p(dpCYjHZf2UFo;-$o@Sk$Nik?ZFXVQFoW|wB#y5gf}2XxxzejomSJE zA01Y4J9v1N&Pv673{wQ?F~$~?403)9`JB$ZH#naP=q#y|$dKo+jS#E%VeS}1+;QvJ zbljS7%@eEM67%DX#MPb~==$uoi?+R%q~k|$rO$EGxAyB|eu9a7&_g7!w{FMIZb(kH zh>=IcN15oXjnYjYp^adM5U9n*fqgg+O#J@f#6t{-$}$sK8zagl%+{SVtL~qfm}n1O z>)4x5vC4*EJ)piWDPfW$Lae{^Uq>NTYTv3kph-~zqi3a31ewllzK}p!zDDuFN>=`p z3b3oGpv3MG(+Hl}?n zF4%X|U&UcEdX4r3F4Uc>RX3G9?9ha1D);f=mjr5zs4E-2Cc92|$S36VGCsWq^9tX( z;|UYt#L~^gu!u(}188;%)=#KtroZj{Pf zI|Z{;*m+c3E|}%V+XZuXv$S1UEn86j&BnAjm?;(33(MugO7Jjl zT!cBrRbVXS8OAJ32U?ZRZ(M*GGuR^SDgDnFOm{jT#eU_`X5HEsb(y3kexJj|E~htr zTd=+;W0!|Fna<16P&lNhKu{*yG8$mS?X#v`1|SA{I5nmq#jME{2BSkNUBF~Cu4~uf zN@=aQy;0aK_tV5AjIR{di;oIBk5LaAqPDf1UpK>NaqVT8UEW$JpqkyqKf4eXPo`C?Vc9B!%1~t` z7VvaX)+ij2D-}pZL!}J-L*&zt^L8|pOHonqwHsxL zhOCOY{yuf&)~*s(6pNSmM3cMa*2TR zu&1E(yfU~dLvJ;RT-3(M;$sHIhi*%g54-HECumS*)ngT0Z}r#$S2h8FZ3{4N!u7V% z^a0km0oOt!@3XEy18Cdo@KFe(%mlOZ#A%4`FwrkW8Iu55ji3qB3H={2xL|Y#U~H(S zqP%)ocO|g3Ssq+zJv6g>LVSv8f}@oFeHc^Uv22>#D-=Fl$v^H&#Q>ulTbuYCb8!mB z%DaUUeTi#Rm~;y(oAPTy!*Zy+w!6cNBO0E1uv4UsNm?o8%ey=DZIo6@yG(CP|9K43 z=i8Nb1;(nDi<1ahv8&k0`QR0pQA6xRBmx_{c-ayBlQ}wNdS=P>pqQr0;6S8w^9tjHvBmYPBw zyO-oKm3#EHTo=8a-H_o;KY`iE^}O(6HP+yXQ~yC6E^YK3?P*WL$q5#s7{z?^)b@|e zW9KA5Wr$9^{~dBBwv6;~8oh_qH=GlR$tN(U<~-3goHln%%P4tCm(~`8=28a4=Z;4y z+_#%P{YP;aQy!yz6GodfLJdTG9v$XX%fZ;Gun&*?;Elqy9$Vqb>>h8DXRg6aqjkKG zBL(Ncw0(h7O)_g`>Cf>P3ax6_7EI9Wh+l=NC^Az2mmdH~iCA-`?@`oCh3ltz!*#o1QS5%NfATt?ZuFmX_~e9j4+ zl~cLrX+{Q8Y(!X>W)ok#;$+=ARCSb$izr?+)u^`*+%sIn*F-9v@r#EEZWTEEMHu9a z93MR~ew*F-tQjvUh?wlb~wUBvB3y?zgsahyqs4d)5-U7{W?L$oT zkw7fPWzEYz2}_WRZJ@BT{iNmj^g==+Ks#fyV|ou}Sn9|Y*)Ba#CGtEqM(uR+zbYo0 zIregH%)_OKN+X ze-eZ1#RiT%&%Fc(!cA``rj!?p`U$ zmzUaKVldYS4{eCHtH++!?C*WY{x#{ ztk#`YEg(d1tPdSj*}1>4L4MSaYyuTG_wTho?qgy`!gp_nzi)U${-PxE1C(=re8M~B Lk3^mUHs=2Y=ET2q literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/TaxRule.php b/ShoppingMerchantAccounts/metadata/V1Beta/TaxRule.php new file mode 100644 index 0000000000000000000000000000000000000000..295a92a7e65e80c51e5bb2e6918f4a1445e07c59 GIT binary patch literal 1359 zcmbVM%We}f6eSIPIf$Y`K_M#xm6}Rrq81@UN!73O&OIAV3ofF&%wBb}xXl>#g zGp$`$(wVY{OMU&+C+AUkBrIq_c-R9&HB(mVzANo?#$e~}re9i{1#Jq)M!1!0>~wC3 z+{0EUaGf1v4K~qYH`AR0T+ZLZTioj^7Vb0PaR3uCV^ViIS5sYq+}1j{P>>HbBW{Y@ z+A=Smzh%Yb-8h~Py6>{mnoCQCZlE8F=+%FQ#B1e^ewi-6OqXA#%g@u*Y!(#O>2GJ! zoc=s&Prp^sauE}+j%r*|mkuc+7B?1frByw=<3(sqNn;}_V~8{nV`x;}QEjK^|EmPQ zph%y6heh~%2X>ZXIfBP%Ein+~V2;5;f4S+&!&?Z2QNTGq90Nzk2+L2BHX{;ZE&?IHRtayAm=xj&qXJ3B)wR&msb`n9t@ufvDv{H|P_}<}*D2EvuP>9C9x+-{~dd+3XHq zsxE(ARbP|1bvAk?h!5@(U4FOK8dm$h?4IhdKB`)4=&u!2yHMMh)!f`Fy3Q)P&MLaj z%Db-owssUG#16A!=ABo5Z{$T=Rjkp}CDRAq89BgoUG%H#`c>A$QusC~=JiWgzbs;# zbs{KwbBM|>3uqrxSEy76F&@|f ze3Jqflk6?b$6n3%M}(6i266&Z;$JS#f?rmMgy+=(=12kW2|+LML-( zYHp#|bPwek@itz#5@Qur&e57)OJ-?YWJ*@c-X#fe`?t&J+IVdWWj{C28xw^yz1g)m zVXUiO{&aSX@z5%t{OM-x_Wd9K{IsxPRwtJEv1-QJDPe95%)brv?s+;fcW003Je-TC z_;Hroho&`=+jv%v+_odKH>CjIJWGJ)&g_|;WnX0URsmBCS1Vgpa4N}pyLn`-MEWDo$bW0A{BFY}T7-rM7O2<`2mah;Mb?Qcqla^i898jHvY8MkHs?wMwLV~WeTCd0Ul=aRs zJDVs(zHs7z;J{DdH*nxDAfZZd>!}A${DfTKo!wc-A@N75_~Nx^=6Tqayn+`zcHjh}As;m@j@dv{=I%o6UC z3T`vj4u~0dSQOE)ZFULwJ6xP8wPM2esZYE%C!|YYTtIvy zjf+s|bx9m~KEbuRy#=e9p75Mn8p7FCA)GB0!m(5c=Zl9nOkP3A54_m*+e$)TP!?jjU_10lX$fbTa_&OJfW0-G zCta6>0-4Tc2n2*);8aQMa~cW8>oB!aX%o?xLH<)(Qeh<=ZQ)XuW2JH?$u%r^LI$H_ z%!x>NxRT~A0ebx>=Nw9{h&omnGRXo9<4WaZPbUz=7JeE~(C=bv)+q^^HtBf#l<|u# z-65*vCQfo}!8oT22#g|hQ5hr zfM^ndx6VxiUZGr`91nagUAghb_nIc5IQb@_9H6dV6lzDU+|U53@|*UL^{a+H&Wiyw zS6RVRY=GOFr}y$dYS;4OF^|+!FZ1;wTEylNZGuTqs2|>2{vhRh*xd51QNwltU3YUz z(;qo0#TOcy$tlw}(3>gDfU2qzjAQFQTAFz4`YI~q@!ZB?Ry4M=cx)}8;s_MTM4o&4 zeN@>Mff6&mQ9U?d-`(&MQD~jMqPEVpqlG#Sr zB9B9HDS1^o`s)^V`NdUqcT`~IHu{fK==K=G^m?vyZh%Am*BAq(xSwC29C6epil4u< zQhWUFufKnus_OQcd)kpS&yz-99@F55xIs-5&MTi3pN>IW=o=AiP>XtPl-0Faw{2LL}!-wC3|%E@EnT6+8cXt94K XdXQag2kyZ`@4)HI?5^5FJ%s)Pu>p%8 literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/Termsofservicekind.php b/ShoppingMerchantAccounts/metadata/V1Beta/Termsofservicekind.php new file mode 100644 index 0000000000000000000000000000000000000000..ae647842c8360a8109710ab800ff0a111f06ec7c GIT binary patch literal 953 zcmbtS%Z}496s0U!c*CeH*xnI?rh|q=BX%tX^^uln)HG_#EKsD#ah%p7wJqBjX+ZrD zzKgo?B63KIETamD*h`jE zg!W-8#5Sj{-U%rg-@1FM$PRPkVnRg0jdt&E5^At(sM>3h zX{zoSpaL&Hj$%l~PTvJPPip>g63={lFR>qclCXomo43M_^fYiGDssqyP4?+p8&@HVRG~1*eUI zQ%B)Vh`N2ZywzeIFK6-ETiy8+FTVAIY5X}@hu*}W`QG&GN%sYM zzVKF)PorQHPrSgEoOQ-OI_TPF)%jNmTbo~@{J{HBHqp^ glfmz2@~n#ayUXL!uWK(KS^r1dD`f5P0UZ$f1({$!6951J literal 0 HcmV?d00001 diff --git a/ShoppingMerchantAccounts/metadata/V1Beta/User.php b/ShoppingMerchantAccounts/metadata/V1Beta/User.php new file mode 100644 index 0000000000000000000000000000000000000000..4c14c78b98b0a858ca31c917489220dce7afbe8f GIT binary patch literal 3507 zcmbtXL37(g6vj@{G;1h{fHs&zw!QU^uY5+Lav=H+IM+8t=Zh-}}Dzy_G)vIOql7 zU06jP3T=wou=Nbm9)dyWQ{VAj*orzG6hg=E2iQfS4q9t$OY6gtR+ zUElAz$RIsG2(Z^R`Y3dIwnq)yas0@m#5jJ?Lew@Q!qSNR0C;vEk-&Bktkz09Y_)Au zyHORX8g-efu_IG8ESakD^g)SjUI)N&Z9?E7O9@T^WPd@_a)H)9z~&NyNxm; zPKX2Qhc&jt@^8|zBsc{K) zR)8Cp=lPrk-y^0utZA5HT;QgQkw>SC*}}+emr&0>#(p?m=suDyG%?78dsca+AJAu$ zADDy+z&kcMnmqQ(e&qd$2nlhwH-V@>cnx1^ z`8Y^dX4I7#b!A39He>dVOm7F+aD?u$HM4g|7CKzqW=pCoH@rQvA(RrzrFZ0#Fgf#x zfw)L=Q4NY@G0xs+Qpg>q3|HvKj}lgm;yaGb{h9`|d>Uv=V3rS;Ic?ArFpnpuT?g;x3(+g#aFZpn6FiK%iFuv#gz6cxcRiQA1|fN`d?NJ z+*J}YB_#~@M07T|4M7N0(i^ApX&^>1F-}q6#_pgn7qK!)ahCtfRl%()qC9dReHkG_ zwa4ceZLGeq(tlg`t~@yRQwl6?hKP|jn#}|^0y|`LMk-Vg=~h7QC3P^;_)Vg{3FbM* zCTObDx5xGIG&*q}Q$cdsg>hz%I0Nbt{y-FRzDE zdjv9($lK(m5fo&KSyiv{m7YwvxVCS=;%Ar$MTwI1|A=rKEChBJH3_>|1%^4%$l4tM z#P8HULY@#q=#$DFfu#`uBw+Uv(l$Wcb*u|!rssnl_PU3@qRo*Lxw#jL|IC97*R_tq zW9%U9=M9!5!-r-r?CW@Tb?u5q6U^u^pI=;KWz_~l43g%h%5s>t^xcUD>ap4k>V=4ZP!5bQM8hFDf1#jBUsGV7hoZGb#Ckvk6FB%uSgzwbH z)gj4d4YQE=OEVQ+SNC`lq-vR>*G6JvL+94dEIHW6H~qM_$yT3R+41xLcdN15qck9< zVVso$aD4V^<ql)B%&*X{|FSO| qhCzPZC@Tl8_2FadhG^P{tI6x#TKtAT@ + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountIssueServiceClient/list_account_issues.php b/ShoppingMerchantAccounts/samples/V1beta/AccountIssueServiceClient/list_account_issues.php new file mode 100644 index 000000000000..ea9addae607f --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountIssueServiceClient/list_account_issues.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $accountIssueServiceClient->listAccountIssues($request); + + /** @var AccountIssue $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = AccountIssueServiceClient::accountName('[ACCOUNT]'); + + list_account_issues_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_AccountIssueService_ListAccountIssues_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/get_account_tax.php b/ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/get_account_tax.php new file mode 100644 index 000000000000..30f6fd40c345 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/get_account_tax.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AccountTax $response */ + $response = $accountTaxServiceClient->getAccountTax($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 = AccountTaxServiceClient::accountTaxName('[ACCOUNT]', '[TAX]'); + + get_account_tax_sample($formattedName); +} +// [END merchantapi_v1beta_generated_AccountTaxService_GetAccountTax_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/list_account_tax.php b/ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/list_account_tax.php new file mode 100644 index 000000000000..2fa73598cddf --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/list_account_tax.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $accountTaxServiceClient->listAccountTax($request); + + /** @var AccountTax $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = AccountTaxServiceClient::accountName('[ACCOUNT]'); + + list_account_tax_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_AccountTaxService_ListAccountTax_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/update_account_tax.php b/ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/update_account_tax.php new file mode 100644 index 000000000000..d6562a792eaa --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountTaxServiceClient/update_account_tax.php @@ -0,0 +1,59 @@ +setAccountTax($accountTax); + + // Call the API and handle any network failures. + try { + /** @var AccountTax $response */ + $response = $accountTaxServiceClient->updateAccountTax($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END merchantapi_v1beta_generated_AccountTaxService_UpdateAccountTax_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/create_and_configure_account.php b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/create_and_configure_account.php new file mode 100644 index 000000000000..7184ea7b8671 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/create_and_configure_account.php @@ -0,0 +1,85 @@ +setAccountName($accountAccountName) + ->setTimeZone($accountTimeZone) + ->setLanguageCode($accountLanguageCode); + $request = (new CreateAndConfigureAccountRequest()) + ->setAccount($account); + + // Call the API and handle any network failures. + try { + /** @var Account $response */ + $response = $accountsServiceClient->createAndConfigureAccount($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 +{ + $accountAccountName = '[ACCOUNT_NAME]'; + $accountLanguageCode = '[LANGUAGE_CODE]'; + + create_and_configure_account_sample($accountAccountName, $accountLanguageCode); +} +// [END merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/delete_account.php b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/delete_account.php new file mode 100644 index 000000000000..1b4d72bea7f8 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/delete_account.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $accountsServiceClient->deleteAccount($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = AccountsServiceClient::accountName('[ACCOUNT]'); + + delete_account_sample($formattedName); +} +// [END merchantapi_v1beta_generated_AccountsService_DeleteAccount_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/get_account.php b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/get_account.php new file mode 100644 index 000000000000..fc0f70e38306 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/get_account.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Account $response */ + $response = $accountsServiceClient->getAccount($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 = AccountsServiceClient::accountName('[ACCOUNT]'); + + get_account_sample($formattedName); +} +// [END merchantapi_v1beta_generated_AccountsService_GetAccount_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/list_accounts.php b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/list_accounts.php new file mode 100644 index 000000000000..749d6a98167e --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/list_accounts.php @@ -0,0 +1,66 @@ +listAccounts($request); + + /** @var Account $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END merchantapi_v1beta_generated_AccountsService_ListAccounts_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/list_sub_accounts.php b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/list_sub_accounts.php new file mode 100644 index 000000000000..dd6d8ca1bdb3 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/list_sub_accounts.php @@ -0,0 +1,81 @@ +setProvider($formattedProvider); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $accountsServiceClient->listSubAccounts($request); + + /** @var Account $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedProvider = AccountsServiceClient::accountName('[ACCOUNT]'); + + list_sub_accounts_sample($formattedProvider); +} +// [END merchantapi_v1beta_generated_AccountsService_ListSubAccounts_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/update_account.php b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/update_account.php new file mode 100644 index 000000000000..c45799709056 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/AccountsServiceClient/update_account.php @@ -0,0 +1,86 @@ +setAccountName($accountAccountName) + ->setTimeZone($accountTimeZone) + ->setLanguageCode($accountLanguageCode); + $updateMask = new FieldMask(); + $request = (new UpdateAccountRequest()) + ->setAccount($account) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Account $response */ + $response = $accountsServiceClient->updateAccount($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 +{ + $accountAccountName = '[ACCOUNT_NAME]'; + $accountLanguageCode = '[LANGUAGE_CODE]'; + + update_account_sample($accountAccountName, $accountLanguageCode); +} +// [END merchantapi_v1beta_generated_AccountsService_UpdateAccount_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/BusinessIdentityServiceClient/get_business_identity.php b/ShoppingMerchantAccounts/samples/V1beta/BusinessIdentityServiceClient/get_business_identity.php new file mode 100644 index 000000000000..56bdd5f69a62 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/BusinessIdentityServiceClient/get_business_identity.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BusinessIdentity $response */ + $response = $businessIdentityServiceClient->getBusinessIdentity($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 = BusinessIdentityServiceClient::businessIdentityName('[ACCOUNT]'); + + get_business_identity_sample($formattedName); +} +// [END merchantapi_v1beta_generated_BusinessIdentityService_GetBusinessIdentity_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/BusinessIdentityServiceClient/update_business_identity.php b/ShoppingMerchantAccounts/samples/V1beta/BusinessIdentityServiceClient/update_business_identity.php new file mode 100644 index 000000000000..506bae6d51b5 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/BusinessIdentityServiceClient/update_business_identity.php @@ -0,0 +1,63 @@ +setBusinessIdentity($businessIdentity) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var BusinessIdentity $response */ + $response = $businessIdentityServiceClient->updateBusinessIdentity($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END merchantapi_v1beta_generated_BusinessIdentityService_UpdateBusinessIdentity_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/BusinessInfoServiceClient/get_business_info.php b/ShoppingMerchantAccounts/samples/V1beta/BusinessInfoServiceClient/get_business_info.php new file mode 100644 index 000000000000..b7d14563264e --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/BusinessInfoServiceClient/get_business_info.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BusinessInfo $response */ + $response = $businessInfoServiceClient->getBusinessInfo($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 = BusinessInfoServiceClient::businessInfoName('[ACCOUNT]'); + + get_business_info_sample($formattedName); +} +// [END merchantapi_v1beta_generated_BusinessInfoService_GetBusinessInfo_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/BusinessInfoServiceClient/update_business_info.php b/ShoppingMerchantAccounts/samples/V1beta/BusinessInfoServiceClient/update_business_info.php new file mode 100644 index 000000000000..98f5230587f3 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/BusinessInfoServiceClient/update_business_info.php @@ -0,0 +1,63 @@ +setBusinessInfo($businessInfo) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var BusinessInfo $response */ + $response = $businessInfoServiceClient->updateBusinessInfo($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END merchantapi_v1beta_generated_BusinessInfoService_UpdateBusinessInfo_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/EmailPreferencesServiceClient/get_email_preferences.php b/ShoppingMerchantAccounts/samples/V1beta/EmailPreferencesServiceClient/get_email_preferences.php new file mode 100644 index 000000000000..dc56f020684e --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/EmailPreferencesServiceClient/get_email_preferences.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var EmailPreferences $response */ + $response = $emailPreferencesServiceClient->getEmailPreferences($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 = EmailPreferencesServiceClient::emailPreferencesName('[ACCOUNT]', '[EMAIL]'); + + get_email_preferences_sample($formattedName); +} +// [END merchantapi_v1beta_generated_EmailPreferencesService_GetEmailPreferences_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/EmailPreferencesServiceClient/update_email_preferences.php b/ShoppingMerchantAccounts/samples/V1beta/EmailPreferencesServiceClient/update_email_preferences.php new file mode 100644 index 000000000000..053f8c6c757f --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/EmailPreferencesServiceClient/update_email_preferences.php @@ -0,0 +1,72 @@ +setEmailPreferences($emailPreferences) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var EmailPreferences $response */ + $response = $emailPreferencesServiceClient->updateEmailPreferences($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END merchantapi_v1beta_generated_EmailPreferencesService_UpdateEmailPreferences_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/claim_homepage.php b/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/claim_homepage.php new file mode 100644 index 000000000000..083c6c136ab2 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/claim_homepage.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Homepage $response */ + $response = $homepageServiceClient->claimHomepage($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 = HomepageServiceClient::homepageName('[ACCOUNT]'); + + claim_homepage_sample($formattedName); +} +// [END merchantapi_v1beta_generated_HomepageService_ClaimHomepage_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/get_homepage.php b/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/get_homepage.php new file mode 100644 index 000000000000..b66fabc54f03 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/get_homepage.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Homepage $response */ + $response = $homepageServiceClient->getHomepage($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 = HomepageServiceClient::homepageName('[ACCOUNT]'); + + get_homepage_sample($formattedName); +} +// [END merchantapi_v1beta_generated_HomepageService_GetHomepage_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/unclaim_homepage.php b/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/unclaim_homepage.php new file mode 100644 index 000000000000..eac0891a0434 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/unclaim_homepage.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Homepage $response */ + $response = $homepageServiceClient->unclaimHomepage($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 = HomepageServiceClient::homepageName('[ACCOUNT]'); + + unclaim_homepage_sample($formattedName); +} +// [END merchantapi_v1beta_generated_HomepageService_UnclaimHomepage_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/update_homepage.php b/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/update_homepage.php new file mode 100644 index 000000000000..6cddc6c40be0 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/HomepageServiceClient/update_homepage.php @@ -0,0 +1,75 @@ +setUri($homepageUri); + $updateMask = new FieldMask(); + $request = (new UpdateHomepageRequest()) + ->setHomepage($homepage) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Homepage $response */ + $response = $homepageServiceClient->updateHomepage($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 +{ + $homepageUri = '[URI]'; + + update_homepage_sample($homepageUri); +} +// [END merchantapi_v1beta_generated_HomepageService_UpdateHomepage_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/OnlineReturnPolicyServiceClient/get_online_return_policy.php b/ShoppingMerchantAccounts/samples/V1beta/OnlineReturnPolicyServiceClient/get_online_return_policy.php new file mode 100644 index 000000000000..f60e202c48ca --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/OnlineReturnPolicyServiceClient/get_online_return_policy.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OnlineReturnPolicy $response */ + $response = $onlineReturnPolicyServiceClient->getOnlineReturnPolicy($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 = OnlineReturnPolicyServiceClient::onlineReturnPolicyName( + '[ACCOUNT]', + '[RETURN_POLICY]' + ); + + get_online_return_policy_sample($formattedName); +} +// [END merchantapi_v1beta_generated_OnlineReturnPolicyService_GetOnlineReturnPolicy_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/OnlineReturnPolicyServiceClient/list_online_return_policies.php b/ShoppingMerchantAccounts/samples/V1beta/OnlineReturnPolicyServiceClient/list_online_return_policies.php new file mode 100644 index 000000000000..bd452520e650 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/OnlineReturnPolicyServiceClient/list_online_return_policies.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $onlineReturnPolicyServiceClient->listOnlineReturnPolicies($request); + + /** @var OnlineReturnPolicy $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = OnlineReturnPolicyServiceClient::accountName('[ACCOUNT]'); + + list_online_return_policies_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_OnlineReturnPolicyService_ListOnlineReturnPolicies_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/disable_program.php b/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/disable_program.php new file mode 100644 index 000000000000..e5670f8349e1 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/disable_program.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Program $response */ + $response = $programsServiceClient->disableProgram($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 = ProgramsServiceClient::programName('[ACCOUNT]', '[PROGRAM]'); + + disable_program_sample($formattedName); +} +// [END merchantapi_v1beta_generated_ProgramsService_DisableProgram_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/enable_program.php b/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/enable_program.php new file mode 100644 index 000000000000..65f896457952 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/enable_program.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Program $response */ + $response = $programsServiceClient->enableProgram($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 = ProgramsServiceClient::programName('[ACCOUNT]', '[PROGRAM]'); + + enable_program_sample($formattedName); +} +// [END merchantapi_v1beta_generated_ProgramsService_EnableProgram_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/get_program.php b/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/get_program.php new file mode 100644 index 000000000000..bdf4ef8b4459 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/get_program.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Program $response */ + $response = $programsServiceClient->getProgram($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 = ProgramsServiceClient::programName('[ACCOUNT]', '[PROGRAM]'); + + get_program_sample($formattedName); +} +// [END merchantapi_v1beta_generated_ProgramsService_GetProgram_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/list_programs.php b/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/list_programs.php new file mode 100644 index 000000000000..efd8c44a494e --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/ProgramsServiceClient/list_programs.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $programsServiceClient->listPrograms($request); + + /** @var Program $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ProgramsServiceClient::accountName('[ACCOUNT]'); + + list_programs_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_ProgramsService_ListPrograms_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/create_region.php b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/create_region.php new file mode 100644 index 000000000000..1852fd182737 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/create_region.php @@ -0,0 +1,79 @@ +setParent($formattedParent) + ->setRegionId($regionId) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var Region $response */ + $response = $regionsServiceClient->createRegion($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 +{ + $formattedParent = RegionsServiceClient::accountName('[ACCOUNT]'); + $regionId = '[REGION_ID]'; + + create_region_sample($formattedParent, $regionId); +} +// [END merchantapi_v1beta_generated_RegionsService_CreateRegion_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/delete_region.php b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/delete_region.php new file mode 100644 index 000000000000..68f04df70093 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/delete_region.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $regionsServiceClient->deleteRegion($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = RegionsServiceClient::regionName('[ACCOUNT]', '[REGION]'); + + delete_region_sample($formattedName); +} +// [END merchantapi_v1beta_generated_RegionsService_DeleteRegion_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/get_region.php b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/get_region.php new file mode 100644 index 000000000000..333825c9d0e4 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/get_region.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Region $response */ + $response = $regionsServiceClient->getRegion($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 = RegionsServiceClient::regionName('[ACCOUNT]', '[REGION]'); + + get_region_sample($formattedName); +} +// [END merchantapi_v1beta_generated_RegionsService_GetRegion_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/list_regions.php b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/list_regions.php new file mode 100644 index 000000000000..9fc24c91c928 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/list_regions.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionsServiceClient->listRegions($request); + + /** @var Region $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = RegionsServiceClient::accountName('[ACCOUNT]'); + + list_regions_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_RegionsService_ListRegions_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/update_region.php b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/update_region.php new file mode 100644 index 000000000000..43d3071fcc16 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/RegionsServiceClient/update_region.php @@ -0,0 +1,60 @@ +setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var Region $response */ + $response = $regionsServiceClient->updateRegion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END merchantapi_v1beta_generated_RegionsService_UpdateRegion_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/ShippingSettingsServiceClient/get_shipping_settings.php b/ShoppingMerchantAccounts/samples/V1beta/ShippingSettingsServiceClient/get_shipping_settings.php new file mode 100644 index 000000000000..615345cbde6b --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/ShippingSettingsServiceClient/get_shipping_settings.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ShippingSettings $response */ + $response = $shippingSettingsServiceClient->getShippingSettings($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 = ShippingSettingsServiceClient::shippingSettingsName('[ACCOUNT]'); + + get_shipping_settings_sample($formattedName); +} +// [END merchantapi_v1beta_generated_ShippingSettingsService_GetShippingSettings_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/ShippingSettingsServiceClient/insert_shipping_settings.php b/ShoppingMerchantAccounts/samples/V1beta/ShippingSettingsServiceClient/insert_shipping_settings.php new file mode 100644 index 000000000000..7291ea582400 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/ShippingSettingsServiceClient/insert_shipping_settings.php @@ -0,0 +1,94 @@ +setEtag($shippingSettingEtag); + $request = (new InsertShippingSettingsRequest()) + ->setParent($parent) + ->setShippingSetting($shippingSetting); + + // Call the API and handle any network failures. + try { + /** @var ShippingSettings $response */ + $response = $shippingSettingsServiceClient->insertShippingSettings($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 +{ + $parent = '[PARENT]'; + $shippingSettingEtag = '[ETAG]'; + + insert_shipping_settings_sample($parent, $shippingSettingEtag); +} +// [END merchantapi_v1beta_generated_ShippingSettingsService_InsertShippingSettings_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceAgreementStateServiceClient/get_terms_of_service_agreement_state.php b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceAgreementStateServiceClient/get_terms_of_service_agreement_state.php new file mode 100644 index 000000000000..9bb58f8ccf1d --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceAgreementStateServiceClient/get_terms_of_service_agreement_state.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TermsOfServiceAgreementState $response */ + $response = $termsOfServiceAgreementStateServiceClient->getTermsOfServiceAgreementState($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 = TermsOfServiceAgreementStateServiceClient::termsOfServiceAgreementStateName( + '[ACCOUNT]', + '[IDENTIFIER]' + ); + + get_terms_of_service_agreement_state_sample($formattedName); +} +// [END merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_GetTermsOfServiceAgreementState_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceAgreementStateServiceClient/retrieve_for_application_terms_of_service_agreement_state.php b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceAgreementStateServiceClient/retrieve_for_application_terms_of_service_agreement_state.php new file mode 100644 index 000000000000..89a9dfd79809 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceAgreementStateServiceClient/retrieve_for_application_terms_of_service_agreement_state.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var TermsOfServiceAgreementState $response */ + $response = $termsOfServiceAgreementStateServiceClient->retrieveForApplicationTermsOfServiceAgreementState( + $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 +{ + $formattedParent = TermsOfServiceAgreementStateServiceClient::accountName('[ACCOUNT]'); + + retrieve_for_application_terms_of_service_agreement_state_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_RetrieveForApplicationTermsOfServiceAgreementState_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/accept_terms_of_service.php b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/accept_terms_of_service.php new file mode 100644 index 000000000000..e49762eda174 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/accept_terms_of_service.php @@ -0,0 +1,82 @@ +setName($formattedName) + ->setAccount($formattedAccount) + ->setRegionCode($regionCode); + + // Call the API and handle any network failures. + try { + $termsOfServiceServiceClient->acceptTermsOfService($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = TermsOfServiceServiceClient::termsOfServiceName('[VERSION]'); + $formattedAccount = TermsOfServiceServiceClient::accountName('[ACCOUNT]'); + $regionCode = '[REGION_CODE]'; + + accept_terms_of_service_sample($formattedName, $formattedAccount, $regionCode); +} +// [END merchantapi_v1beta_generated_TermsOfServiceService_AcceptTermsOfService_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/get_terms_of_service.php b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/get_terms_of_service.php new file mode 100644 index 000000000000..23f9da178dc8 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/get_terms_of_service.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TermsOfService $response */ + $response = $termsOfServiceServiceClient->getTermsOfService($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 = TermsOfServiceServiceClient::termsOfServiceName('[VERSION]'); + + get_terms_of_service_sample($formattedName); +} +// [END merchantapi_v1beta_generated_TermsOfServiceService_GetTermsOfService_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/retrieve_latest_terms_of_service.php b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/retrieve_latest_terms_of_service.php new file mode 100644 index 000000000000..93f5743b4f56 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/TermsOfServiceServiceClient/retrieve_latest_terms_of_service.php @@ -0,0 +1,58 @@ +retrieveLatestTermsOfService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/create_user.php b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/create_user.php new file mode 100644 index 000000000000..75cd1c3aa221 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/create_user.php @@ -0,0 +1,79 @@ +setParent($formattedParent) + ->setUserId($userId) + ->setUser($user); + + // Call the API and handle any network failures. + try { + /** @var User $response */ + $response = $userServiceClient->createUser($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 +{ + $formattedParent = UserServiceClient::accountName('[ACCOUNT]'); + $userId = '[USER_ID]'; + + create_user_sample($formattedParent, $userId); +} +// [END merchantapi_v1beta_generated_UserService_CreateUser_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/delete_user.php b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/delete_user.php new file mode 100644 index 000000000000..f2d0c3141114 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/delete_user.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $userServiceClient->deleteUser($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = UserServiceClient::userName('[ACCOUNT]', '[EMAIL]'); + + delete_user_sample($formattedName); +} +// [END merchantapi_v1beta_generated_UserService_DeleteUser_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/get_user.php b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/get_user.php new file mode 100644 index 000000000000..3be89ea85f5a --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/get_user.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var User $response */ + $response = $userServiceClient->getUser($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 = UserServiceClient::userName('[ACCOUNT]', '[EMAIL]'); + + get_user_sample($formattedName); +} +// [END merchantapi_v1beta_generated_UserService_GetUser_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/list_users.php b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/list_users.php new file mode 100644 index 000000000000..280478627a83 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/list_users.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $userServiceClient->listUsers($request); + + /** @var User $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = UserServiceClient::accountName('[ACCOUNT]'); + + list_users_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_UserService_ListUsers_sync] diff --git a/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/update_user.php b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/update_user.php new file mode 100644 index 000000000000..07ef92d1c5a3 --- /dev/null +++ b/ShoppingMerchantAccounts/samples/V1beta/UserServiceClient/update_user.php @@ -0,0 +1,63 @@ +setUser($user) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var User $response */ + $response = $userServiceClient->updateUser($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END merchantapi_v1beta_generated_UserService_UpdateUser_sync] diff --git a/ShoppingMerchantAccounts/src/V1beta/AcceptTermsOfServiceRequest.php b/ShoppingMerchantAccounts/src/V1beta/AcceptTermsOfServiceRequest.php new file mode 100644 index 000000000000..a6142644d651 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/AcceptTermsOfServiceRequest.php @@ -0,0 +1,162 @@ +google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + */ +class AcceptTermsOfServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The account for which to accept the ToS. + * + * Generated from protobuf field string account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $account = ''; + /** + * Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This + * is either a country when the ToS applies specifically to that country or + * 001 when it applies globally. + * + * Generated from protobuf field string region_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_code = ''; + + /** + * @param string $name Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * Please see {@see TermsOfServiceServiceClient::termsOfServiceName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\AcceptTermsOfServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * @type string $account + * Required. The account for which to accept the ToS. + * @type string $region_code + * Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This + * is either a country when the ToS applies specifically to that country or + * 001 when it applies globally. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Termsofservice::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The account for which to accept the ToS. + * + * Generated from protobuf field string account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAccount() + { + return $this->account; + } + + /** + * Required. The account for which to accept the ToS. + * + * Generated from protobuf field string account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAccount($var) + { + GPBUtil::checkString($var, True); + $this->account = $var; + + return $this; + } + + /** + * Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This + * is either a country when the ToS applies specifically to that country or + * 001 when it applies globally. + * + * Generated from protobuf field string region_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This + * is either a country when the ToS applies specifically to that country or + * 001 when it applies globally. + * + * Generated from protobuf field string region_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Accepted.php b/ShoppingMerchantAccounts/src/V1beta/Accepted.php new file mode 100644 index 000000000000..2ec74d8c5d25 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Accepted.php @@ -0,0 +1,173 @@ +google.shopping.merchant.accounts.v1beta.Accepted + */ +class Accepted extends \Google\Protobuf\Internal\Message +{ + /** + * The accepted + * [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService). + * + * Generated from protobuf field string terms_of_service = 1 [(.google.api.resource_reference) = { + */ + protected $terms_of_service = ''; + /** + * The account where the acceptance was recorded. This can be the account + * itself or, in the case of subaccounts, the MCA account. + * + * Generated from protobuf field string accepted_by = 2 [(.google.api.resource_reference) = { + */ + protected $accepted_by = ''; + /** + * When set, it states that the accepted + * [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * is only valid until the end of this date (in UTC). A new one must be + * accepted before then. The information of the required + * [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * is found in the [Required](Required) message. + * + * Generated from protobuf field optional .google.type.Date valid_until = 3; + */ + protected $valid_until = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $terms_of_service + * The accepted + * [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService). + * @type string $accepted_by + * The account where the acceptance was recorded. This can be the account + * itself or, in the case of subaccounts, the MCA account. + * @type \Google\Type\Date $valid_until + * When set, it states that the accepted + * [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * is only valid until the end of this date (in UTC). A new one must be + * accepted before then. The information of the required + * [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * is found in the [Required](Required) message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Termsofserviceagreementstate::initOnce(); + parent::__construct($data); + } + + /** + * The accepted + * [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService). + * + * Generated from protobuf field string terms_of_service = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getTermsOfService() + { + return $this->terms_of_service; + } + + /** + * The accepted + * [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService). + * + * Generated from protobuf field string terms_of_service = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTermsOfService($var) + { + GPBUtil::checkString($var, True); + $this->terms_of_service = $var; + + return $this; + } + + /** + * The account where the acceptance was recorded. This can be the account + * itself or, in the case of subaccounts, the MCA account. + * + * Generated from protobuf field string accepted_by = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getAcceptedBy() + { + return $this->accepted_by; + } + + /** + * The account where the acceptance was recorded. This can be the account + * itself or, in the case of subaccounts, the MCA account. + * + * Generated from protobuf field string accepted_by = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAcceptedBy($var) + { + GPBUtil::checkString($var, True); + $this->accepted_by = $var; + + return $this; + } + + /** + * When set, it states that the accepted + * [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * is only valid until the end of this date (in UTC). A new one must be + * accepted before then. The information of the required + * [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * is found in the [Required](Required) message. + * + * Generated from protobuf field optional .google.type.Date valid_until = 3; + * @return \Google\Type\Date|null + */ + public function getValidUntil() + { + return $this->valid_until; + } + + public function hasValidUntil() + { + return isset($this->valid_until); + } + + public function clearValidUntil() + { + unset($this->valid_until); + } + + /** + * When set, it states that the accepted + * [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * is only valid until the end of this date (in UTC). A new one must be + * accepted before then. The information of the required + * [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * is found in the [Required](Required) message. + * + * Generated from protobuf field optional .google.type.Date valid_until = 3; + * @param \Google\Type\Date $var + * @return $this + */ + public function setValidUntil($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->valid_until = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/AccessRight.php b/ShoppingMerchantAccounts/src/V1beta/AccessRight.php new file mode 100644 index 000000000000..6cf7167d2f5d --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/AccessRight.php @@ -0,0 +1,68 @@ +google.shopping.merchant.accounts.v1beta.AccessRight + */ +class AccessRight +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ACCESS_RIGHT_UNSPECIFIED = 0; + */ + const ACCESS_RIGHT_UNSPECIFIED = 0; + /** + * Standard access rights. + * + * Generated from protobuf enum STANDARD = 1; + */ + const STANDARD = 1; + /** + * Admin access rights. + * + * Generated from protobuf enum ADMIN = 2; + */ + const ADMIN = 2; + /** + * Users with this right have access to performance and insights. + * + * Generated from protobuf enum PERFORMANCE_REPORTING = 3; + */ + const PERFORMANCE_REPORTING = 3; + + private static $valueToName = [ + self::ACCESS_RIGHT_UNSPECIFIED => 'ACCESS_RIGHT_UNSPECIFIED', + self::STANDARD => 'STANDARD', + self::ADMIN => 'ADMIN', + self::PERFORMANCE_REPORTING => 'PERFORMANCE_REPORTING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Account.php b/ShoppingMerchantAccounts/src/V1beta/Account.php new file mode 100644 index 000000000000..837ebd359d18 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Account.php @@ -0,0 +1,317 @@ +google.shopping.merchant.accounts.v1beta.Account + */ +class Account extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the account. + * Format: `accounts/{account}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The ID of the account. + * + * Generated from protobuf field int64 account_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $account_id = 0; + /** + * Required. A human-readable name of the account. See + * [store name](https://support.google.com/merchants/answer/160556) and + * [business name](https://support.google.com/merchants/answer/12159159) for + * more information. + * + * Generated from protobuf field string account_name = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $account_name = ''; + /** + * Whether this account contains adult content. + * + * Generated from protobuf field bool adult_content = 4; + */ + protected $adult_content = false; + /** + * Output only. Whether this is a test account. + * + * Generated from protobuf field bool test_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $test_account = false; + /** + * Required. The time zone of the account. + * On writes, `time_zone` sets both the `reporting_time_zone` and the + * `display_time_zone`. + * For reads, `time_zone` always returns the `display_time_zone`. If + * `display_time_zone` doesn't exist for your account, `time_zone` is empty. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $time_zone = null; + /** + * Required. The account's [BCP-47 language + * code](https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`. + * + * Generated from protobuf field string language_code = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the account. + * Format: `accounts/{account}` + * @type int|string $account_id + * Output only. The ID of the account. + * @type string $account_name + * Required. A human-readable name of the account. See + * [store name](https://support.google.com/merchants/answer/160556) and + * [business name](https://support.google.com/merchants/answer/12159159) for + * more information. + * @type bool $adult_content + * Whether this account contains adult content. + * @type bool $test_account + * Output only. Whether this is a test account. + * @type \Google\Type\TimeZone $time_zone + * Required. The time zone of the account. + * On writes, `time_zone` sets both the `reporting_time_zone` and the + * `display_time_zone`. + * For reads, `time_zone` always returns the `display_time_zone`. If + * `display_time_zone` doesn't exist for your account, `time_zone` is empty. + * @type string $language_code + * Required. The account's [BCP-47 language + * code](https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the account. + * Format: `accounts/{account}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the account. + * Format: `accounts/{account}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The ID of the account. + * + * Generated from protobuf field int64 account_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getAccountId() + { + return $this->account_id; + } + + /** + * Output only. The ID of the account. + * + * Generated from protobuf field int64 account_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setAccountId($var) + { + GPBUtil::checkInt64($var); + $this->account_id = $var; + + return $this; + } + + /** + * Required. A human-readable name of the account. See + * [store name](https://support.google.com/merchants/answer/160556) and + * [business name](https://support.google.com/merchants/answer/12159159) for + * more information. + * + * Generated from protobuf field string account_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAccountName() + { + return $this->account_name; + } + + /** + * Required. A human-readable name of the account. See + * [store name](https://support.google.com/merchants/answer/160556) and + * [business name](https://support.google.com/merchants/answer/12159159) for + * more information. + * + * Generated from protobuf field string account_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAccountName($var) + { + GPBUtil::checkString($var, True); + $this->account_name = $var; + + return $this; + } + + /** + * Whether this account contains adult content. + * + * Generated from protobuf field bool adult_content = 4; + * @return bool + */ + public function getAdultContent() + { + return $this->adult_content; + } + + /** + * Whether this account contains adult content. + * + * Generated from protobuf field bool adult_content = 4; + * @param bool $var + * @return $this + */ + public function setAdultContent($var) + { + GPBUtil::checkBool($var); + $this->adult_content = $var; + + return $this; + } + + /** + * Output only. Whether this is a test account. + * + * Generated from protobuf field bool test_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getTestAccount() + { + return $this->test_account; + } + + /** + * Output only. Whether this is a test account. + * + * Generated from protobuf field bool test_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setTestAccount($var) + { + GPBUtil::checkBool($var); + $this->test_account = $var; + + return $this; + } + + /** + * Required. The time zone of the account. + * On writes, `time_zone` sets both the `reporting_time_zone` and the + * `display_time_zone`. + * For reads, `time_zone` always returns the `display_time_zone`. If + * `display_time_zone` doesn't exist for your account, `time_zone` is empty. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\TimeZone|null + */ + public function getTimeZone() + { + return $this->time_zone; + } + + public function hasTimeZone() + { + return isset($this->time_zone); + } + + public function clearTimeZone() + { + unset($this->time_zone); + } + + /** + * Required. The time zone of the account. + * On writes, `time_zone` sets both the `reporting_time_zone` and the + * `display_time_zone`. + * For reads, `time_zone` always returns the `display_time_zone`. If + * `display_time_zone` doesn't exist for your account, `time_zone` is empty. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\TimeZone $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeZone::class); + $this->time_zone = $var; + + return $this; + } + + /** + * Required. The account's [BCP-47 language + * code](https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`. + * + * Generated from protobuf field string language_code = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The account's [BCP-47 language + * code](https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`. + * + * Generated from protobuf field string language_code = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/AccountIssue.php b/ShoppingMerchantAccounts/src/V1beta/AccountIssue.php new file mode 100644 index 000000000000..843b2b7559d2 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/AccountIssue.php @@ -0,0 +1,246 @@ +google.shopping.merchant.accounts.v1beta.AccountIssue + */ +class AccountIssue extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the account issue. + * Format: `accounts/{account}/issues/{id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * The localized title of the issue. + * + * Generated from protobuf field string title = 2; + */ + protected $title = ''; + /** + * The overall severity of the issue. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.AccountIssue.Severity severity = 3; + */ + protected $severity = 0; + /** + * The impact this issue has on various destinations. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination impacted_destinations = 4; + */ + private $impacted_destinations; + /** + * Further localized details about the issue. + * + * Generated from protobuf field string detail = 5; + */ + protected $detail = ''; + /** + * Link to Merchant Center Help Center providing further information about the + * issue and how to fix it. + * + * Generated from protobuf field string documentation_uri = 6; + */ + protected $documentation_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the account issue. + * Format: `accounts/{account}/issues/{id}` + * @type string $title + * The localized title of the issue. + * @type int $severity + * The overall severity of the issue. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\AccountIssue\ImpactedDestination>|\Google\Protobuf\Internal\RepeatedField $impacted_destinations + * The impact this issue has on various destinations. + * @type string $detail + * Further localized details about the issue. + * @type string $documentation_uri + * Link to Merchant Center Help Center providing further information about the + * issue and how to fix it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accountissue::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the account issue. + * Format: `accounts/{account}/issues/{id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the account issue. + * Format: `accounts/{account}/issues/{id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The localized title of the issue. + * + * Generated from protobuf field string title = 2; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The localized title of the issue. + * + * Generated from protobuf field string title = 2; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The overall severity of the issue. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.AccountIssue.Severity severity = 3; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * The overall severity of the issue. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.AccountIssue.Severity severity = 3; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\AccountIssue\Severity::class); + $this->severity = $var; + + return $this; + } + + /** + * The impact this issue has on various destinations. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination impacted_destinations = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImpactedDestinations() + { + return $this->impacted_destinations; + } + + /** + * The impact this issue has on various destinations. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination impacted_destinations = 4; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\AccountIssue\ImpactedDestination>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImpactedDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\AccountIssue\ImpactedDestination::class); + $this->impacted_destinations = $arr; + + return $this; + } + + /** + * Further localized details about the issue. + * + * Generated from protobuf field string detail = 5; + * @return string + */ + public function getDetail() + { + return $this->detail; + } + + /** + * Further localized details about the issue. + * + * Generated from protobuf field string detail = 5; + * @param string $var + * @return $this + */ + public function setDetail($var) + { + GPBUtil::checkString($var, True); + $this->detail = $var; + + return $this; + } + + /** + * Link to Merchant Center Help Center providing further information about the + * issue and how to fix it. + * + * Generated from protobuf field string documentation_uri = 6; + * @return string + */ + public function getDocumentationUri() + { + return $this->documentation_uri; + } + + /** + * Link to Merchant Center Help Center providing further information about the + * issue and how to fix it. + * + * Generated from protobuf field string documentation_uri = 6; + * @param string $var + * @return $this + */ + public function setDocumentationUri($var) + { + GPBUtil::checkString($var, True); + $this->documentation_uri = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/AccountIssue/ImpactedDestination.php b/ShoppingMerchantAccounts/src/V1beta/AccountIssue/ImpactedDestination.php new file mode 100644 index 000000000000..3c6cf9739899 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/AccountIssue/ImpactedDestination.php @@ -0,0 +1,112 @@ +google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + */ +class ImpactedDestination extends \Google\Protobuf\Internal\Message +{ + /** + * The impacted reporting context. + * + * Generated from protobuf field optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 1; + */ + protected $reporting_context = null; + /** + * The (negative) impact for various regions on the given destination. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact impacts = 2; + */ + private $impacts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $reporting_context + * The impacted reporting context. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\AccountIssue\ImpactedDestination\Impact>|\Google\Protobuf\Internal\RepeatedField $impacts + * The (negative) impact for various regions on the given destination. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accountissue::initOnce(); + parent::__construct($data); + } + + /** + * The impacted reporting context. + * + * Generated from protobuf field optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 1; + * @return int + */ + public function getReportingContext() + { + return isset($this->reporting_context) ? $this->reporting_context : 0; + } + + public function hasReportingContext() + { + return isset($this->reporting_context); + } + + public function clearReportingContext() + { + unset($this->reporting_context); + } + + /** + * The impacted reporting context. + * + * Generated from protobuf field optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 1; + * @param int $var + * @return $this + */ + public function setReportingContext($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Type\ReportingContext\ReportingContextEnum::class); + $this->reporting_context = $var; + + return $this; + } + + /** + * The (negative) impact for various regions on the given destination. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact impacts = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImpacts() + { + return $this->impacts; + } + + /** + * The (negative) impact for various regions on the given destination. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact impacts = 2; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\AccountIssue\ImpactedDestination\Impact>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImpacts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\AccountIssue\ImpactedDestination\Impact::class); + $this->impacts = $arr; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/AccountIssue/ImpactedDestination/Impact.php b/ShoppingMerchantAccounts/src/V1beta/AccountIssue/ImpactedDestination/Impact.php new file mode 100644 index 000000000000..e8e1d44851aa --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/AccountIssue/ImpactedDestination/Impact.php @@ -0,0 +1,106 @@ +google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + */ +class Impact extends \Google\Protobuf\Internal\Message +{ + /** + * The [CLDR region code](https://cldr.unicode.org/) where this issue + * applies. + * + * Generated from protobuf field string region_code = 1; + */ + protected $region_code = ''; + /** + * The severity of the issue on the destination and region. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.AccountIssue.Severity severity = 2; + */ + protected $severity = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $region_code + * The [CLDR region code](https://cldr.unicode.org/) where this issue + * applies. + * @type int $severity + * The severity of the issue on the destination and region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accountissue::initOnce(); + parent::__construct($data); + } + + /** + * The [CLDR region code](https://cldr.unicode.org/) where this issue + * applies. + * + * Generated from protobuf field string region_code = 1; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * The [CLDR region code](https://cldr.unicode.org/) where this issue + * applies. + * + * Generated from protobuf field string region_code = 1; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * The severity of the issue on the destination and region. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.AccountIssue.Severity severity = 2; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * The severity of the issue on the destination and region. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.AccountIssue.Severity severity = 2; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\AccountIssue\Severity::class); + $this->severity = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/AccountIssue/Severity.php b/ShoppingMerchantAccounts/src/V1beta/AccountIssue/Severity.php new file mode 100644 index 000000000000..eab38a067aec --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/AccountIssue/Severity.php @@ -0,0 +1,70 @@ +google.shopping.merchant.accounts.v1beta.AccountIssue.Severity + */ +class Severity +{ + /** + * The severity is unknown. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * The issue causes offers to not serve. + * + * Generated from protobuf enum CRITICAL = 1; + */ + const CRITICAL = 1; + /** + * The issue might affect offers (in the future) or might be an + * indicator of issues with offers. + * + * Generated from protobuf enum ERROR = 2; + */ + const ERROR = 2; + /** + * The issue is a suggestion for improvement. + * + * Generated from protobuf enum SUGGESTION = 3; + */ + const SUGGESTION = 3; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::CRITICAL => 'CRITICAL', + self::ERROR => 'ERROR', + self::SUGGESTION => 'SUGGESTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/AccountTax.php b/ShoppingMerchantAccounts/src/V1beta/AccountTax.php new file mode 100644 index 000000000000..ffb456098b92 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/AccountTax.php @@ -0,0 +1,151 @@ +google.shopping.merchant.accounts.v1beta.AccountTax + */ +class AccountTax extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the tax setting. + * Format: + * "{account_tax.name=accounts/{account}}" + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The ID of the account to which these account tax settings + * belong. + * + * Generated from protobuf field int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $account = 0; + /** + * Tax rules. "Define the tax rules in each region. + * No tax will be presented if a region has no rule." + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.TaxRule tax_rules = 3; + */ + private $tax_rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the tax setting. + * Format: + * "{account_tax.name=accounts/{account}}" + * @type int|string $account + * Output only. The ID of the account to which these account tax settings + * belong. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\TaxRule>|\Google\Protobuf\Internal\RepeatedField $tax_rules + * Tax rules. "Define the tax rules in each region. + * No tax will be presented if a region has no rule." + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\AccountTax::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the tax setting. + * Format: + * "{account_tax.name=accounts/{account}}" + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the tax setting. + * Format: + * "{account_tax.name=accounts/{account}}" + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The ID of the account to which these account tax settings + * belong. + * + * Generated from protobuf field int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getAccount() + { + return $this->account; + } + + /** + * Output only. The ID of the account to which these account tax settings + * belong. + * + * Generated from protobuf field int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setAccount($var) + { + GPBUtil::checkInt64($var); + $this->account = $var; + + return $this; + } + + /** + * Tax rules. "Define the tax rules in each region. + * No tax will be presented if a region has no rule." + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.TaxRule tax_rules = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaxRules() + { + return $this->tax_rules; + } + + /** + * Tax rules. "Define the tax rules in each region. + * No tax will be presented if a region has no rule." + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.TaxRule tax_rules = 3; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\TaxRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaxRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\TaxRule::class); + $this->tax_rules = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Address.php b/ShoppingMerchantAccounts/src/V1beta/Address.php new file mode 100644 index 000000000000..34ec6c688ce8 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Address.php @@ -0,0 +1,269 @@ +google.shopping.merchant.accounts.v1beta.Address + */ +class Address extends \Google\Protobuf\Internal\Message +{ + /** + * Street-level part of the address. For example: `111w 31st Street`. + * + * Generated from protobuf field optional string street_address = 1; + */ + protected $street_address = null; + /** + * Required. City, town or commune. May also include dependent localities or + * sublocalities (For example neighborhoods or suburbs). + * + * Generated from protobuf field optional string city = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $city = null; + /** + * Required. Top-level administrative subdivision of the country. For example, + * a state like California ("CA") or a province like Quebec ("QC"). + * + * Generated from protobuf field optional string administrative_area = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $administrative_area = null; + /** + * Required. Postal code or ZIP (For example "94043"). + * + * Generated from protobuf field optional string postal_code = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $postal_code = null; + /** + * Required. [CLDR country + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * (For example "US"). + * + * Generated from protobuf field optional string region_code = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_code = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $street_address + * Street-level part of the address. For example: `111w 31st Street`. + * @type string $city + * Required. City, town or commune. May also include dependent localities or + * sublocalities (For example neighborhoods or suburbs). + * @type string $administrative_area + * Required. Top-level administrative subdivision of the country. For example, + * a state like California ("CA") or a province like Quebec ("QC"). + * @type string $postal_code + * Required. Postal code or ZIP (For example "94043"). + * @type string $region_code + * Required. [CLDR country + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * (For example "US"). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Street-level part of the address. For example: `111w 31st Street`. + * + * Generated from protobuf field optional string street_address = 1; + * @return string + */ + public function getStreetAddress() + { + return isset($this->street_address) ? $this->street_address : ''; + } + + public function hasStreetAddress() + { + return isset($this->street_address); + } + + public function clearStreetAddress() + { + unset($this->street_address); + } + + /** + * Street-level part of the address. For example: `111w 31st Street`. + * + * Generated from protobuf field optional string street_address = 1; + * @param string $var + * @return $this + */ + public function setStreetAddress($var) + { + GPBUtil::checkString($var, True); + $this->street_address = $var; + + return $this; + } + + /** + * Required. City, town or commune. May also include dependent localities or + * sublocalities (For example neighborhoods or suburbs). + * + * Generated from protobuf field optional string city = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCity() + { + return isset($this->city) ? $this->city : ''; + } + + public function hasCity() + { + return isset($this->city); + } + + public function clearCity() + { + unset($this->city); + } + + /** + * Required. City, town or commune. May also include dependent localities or + * sublocalities (For example neighborhoods or suburbs). + * + * Generated from protobuf field optional string city = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCity($var) + { + GPBUtil::checkString($var, True); + $this->city = $var; + + return $this; + } + + /** + * Required. Top-level administrative subdivision of the country. For example, + * a state like California ("CA") or a province like Quebec ("QC"). + * + * Generated from protobuf field optional string administrative_area = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAdministrativeArea() + { + return isset($this->administrative_area) ? $this->administrative_area : ''; + } + + public function hasAdministrativeArea() + { + return isset($this->administrative_area); + } + + public function clearAdministrativeArea() + { + unset($this->administrative_area); + } + + /** + * Required. Top-level administrative subdivision of the country. For example, + * a state like California ("CA") or a province like Quebec ("QC"). + * + * Generated from protobuf field optional string administrative_area = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAdministrativeArea($var) + { + GPBUtil::checkString($var, True); + $this->administrative_area = $var; + + return $this; + } + + /** + * Required. Postal code or ZIP (For example "94043"). + * + * Generated from protobuf field optional string postal_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPostalCode() + { + return isset($this->postal_code) ? $this->postal_code : ''; + } + + public function hasPostalCode() + { + return isset($this->postal_code); + } + + public function clearPostalCode() + { + unset($this->postal_code); + } + + /** + * Required. Postal code or ZIP (For example "94043"). + * + * Generated from protobuf field optional string postal_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPostalCode($var) + { + GPBUtil::checkString($var, True); + $this->postal_code = $var; + + return $this; + } + + /** + * Required. [CLDR country + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * (For example "US"). + * + * Generated from protobuf field optional string region_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionCode() + { + return isset($this->region_code) ? $this->region_code : ''; + } + + public function hasRegionCode() + { + return isset($this->region_code); + } + + public function clearRegionCode() + { + unset($this->region_code); + } + + /** + * Required. [CLDR country + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * (For example "US"). + * + * Generated from protobuf field optional string region_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/BusinessDayConfig.php b/ShoppingMerchantAccounts/src/V1beta/BusinessDayConfig.php new file mode 100644 index 000000000000..65de9fa71831 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/BusinessDayConfig.php @@ -0,0 +1,71 @@ +google.shopping.merchant.accounts.v1beta.BusinessDayConfig + */ +class BusinessDayConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Regular business days. + * May not be empty. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday business_days = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $business_days; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $business_days + * Required. Regular business days. + * May not be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. Regular business days. + * May not be empty. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday business_days = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBusinessDays() + { + return $this->business_days; + } + + /** + * Required. Regular business days. + * May not be empty. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday business_days = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBusinessDays($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig\Weekday::class); + $this->business_days = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/BusinessDayConfig/Weekday.php b/ShoppingMerchantAccounts/src/V1beta/BusinessDayConfig/Weekday.php new file mode 100644 index 000000000000..bf07a2ef971f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/BusinessDayConfig/Weekday.php @@ -0,0 +1,79 @@ +google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday + */ +class Weekday +{ + /** + * Generated from protobuf enum WEEKDAY_UNSPECIFIED = 0; + */ + const WEEKDAY_UNSPECIFIED = 0; + /** + * Generated from protobuf enum MONDAY = 1; + */ + const MONDAY = 1; + /** + * Generated from protobuf enum TUESDAY = 2; + */ + const TUESDAY = 2; + /** + * Generated from protobuf enum WEDNESDAY = 3; + */ + const WEDNESDAY = 3; + /** + * Generated from protobuf enum THURSDAY = 4; + */ + const THURSDAY = 4; + /** + * Generated from protobuf enum FRIDAY = 5; + */ + const FRIDAY = 5; + /** + * Generated from protobuf enum SATURDAY = 6; + */ + const SATURDAY = 6; + /** + * Generated from protobuf enum SUNDAY = 7; + */ + const SUNDAY = 7; + + private static $valueToName = [ + self::WEEKDAY_UNSPECIFIED => 'WEEKDAY_UNSPECIFIED', + self::MONDAY => 'MONDAY', + self::TUESDAY => 'TUESDAY', + self::WEDNESDAY => 'WEDNESDAY', + self::THURSDAY => 'THURSDAY', + self::FRIDAY => 'FRIDAY', + self::SATURDAY => 'SATURDAY', + self::SUNDAY => 'SUNDAY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity.php b/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity.php new file mode 100644 index 000000000000..2fdab06c69d9 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity.php @@ -0,0 +1,382 @@ +google.shopping.merchant.accounts.v1beta.BusinessIdentity + */ +class BusinessIdentity extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. Whether the identity attributes may be used for promotions. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent promotions_consent = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $promotions_consent = 0; + /** + * Optional. Specifies whether the business identifies itself as being + * black-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute black_owned = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $black_owned = null; + /** + * Optional. Specifies whether the business identifies itself as being + * women-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute women_owned = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $women_owned = null; + /** + * Optional. Specifies whether the business identifies itself as being + * veteran-owned. This optional field will only be available for merchants + * with a business country set to `US`. It is also not applicable for + * marketplaces or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute veteran_owned = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $veteran_owned = null; + /** + * Optional. Specifies whether the business identifies itself as being + * latino-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute latino_owned = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $latino_owned = null; + /** + * Optional. Specifies whether the business identifies itself as a small + * business. This optional field will only be available for merchants with a + * business country set to `US`. It is also not applicable for marketplaces. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute small_business = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $small_business = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * @type int $promotions_consent + * Optional. Whether the identity attributes may be used for promotions. + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $black_owned + * Optional. Specifies whether the business identifies itself as being + * black-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $women_owned + * Optional. Specifies whether the business identifies itself as being + * women-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $veteran_owned + * Optional. Specifies whether the business identifies itself as being + * veteran-owned. This optional field will only be available for merchants + * with a business country set to `US`. It is also not applicable for + * marketplaces or marketplace sellers. + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $latino_owned + * Optional. Specifies whether the business identifies itself as being + * latino-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $small_business + * Optional. Specifies whether the business identifies itself as a small + * business. This optional field will only be available for merchants with a + * business country set to `US`. It is also not applicable for marketplaces. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Businessidentity::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Whether the identity attributes may be used for promotions. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent promotions_consent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPromotionsConsent() + { + return $this->promotions_consent; + } + + /** + * Optional. Whether the identity attributes may be used for promotions. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent promotions_consent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPromotionsConsent($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\PromotionsConsent::class); + $this->promotions_consent = $var; + + return $this; + } + + /** + * Optional. Specifies whether the business identifies itself as being + * black-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute black_owned = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute|null + */ + public function getBlackOwned() + { + return $this->black_owned; + } + + public function hasBlackOwned() + { + return isset($this->black_owned); + } + + public function clearBlackOwned() + { + unset($this->black_owned); + } + + /** + * Optional. Specifies whether the business identifies itself as being + * black-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute black_owned = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $var + * @return $this + */ + public function setBlackOwned($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute::class); + $this->black_owned = $var; + + return $this; + } + + /** + * Optional. Specifies whether the business identifies itself as being + * women-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute women_owned = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute|null + */ + public function getWomenOwned() + { + return $this->women_owned; + } + + public function hasWomenOwned() + { + return isset($this->women_owned); + } + + public function clearWomenOwned() + { + unset($this->women_owned); + } + + /** + * Optional. Specifies whether the business identifies itself as being + * women-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute women_owned = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $var + * @return $this + */ + public function setWomenOwned($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute::class); + $this->women_owned = $var; + + return $this; + } + + /** + * Optional. Specifies whether the business identifies itself as being + * veteran-owned. This optional field will only be available for merchants + * with a business country set to `US`. It is also not applicable for + * marketplaces or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute veteran_owned = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute|null + */ + public function getVeteranOwned() + { + return $this->veteran_owned; + } + + public function hasVeteranOwned() + { + return isset($this->veteran_owned); + } + + public function clearVeteranOwned() + { + unset($this->veteran_owned); + } + + /** + * Optional. Specifies whether the business identifies itself as being + * veteran-owned. This optional field will only be available for merchants + * with a business country set to `US`. It is also not applicable for + * marketplaces or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute veteran_owned = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $var + * @return $this + */ + public function setVeteranOwned($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute::class); + $this->veteran_owned = $var; + + return $this; + } + + /** + * Optional. Specifies whether the business identifies itself as being + * latino-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute latino_owned = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute|null + */ + public function getLatinoOwned() + { + return $this->latino_owned; + } + + public function hasLatinoOwned() + { + return isset($this->latino_owned); + } + + public function clearLatinoOwned() + { + unset($this->latino_owned); + } + + /** + * Optional. Specifies whether the business identifies itself as being + * latino-owned. This optional field will only be available for merchants with + * a business country set to `US`. It is also not applicable for marketplaces + * or marketplace sellers. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute latino_owned = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $var + * @return $this + */ + public function setLatinoOwned($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute::class); + $this->latino_owned = $var; + + return $this; + } + + /** + * Optional. Specifies whether the business identifies itself as a small + * business. This optional field will only be available for merchants with a + * business country set to `US`. It is also not applicable for marketplaces. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute small_business = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute|null + */ + public function getSmallBusiness() + { + return $this->small_business; + } + + public function hasSmallBusiness() + { + return isset($this->small_business); + } + + public function clearSmallBusiness() + { + unset($this->small_business); + } + + /** + * Optional. Specifies whether the business identifies itself as a small + * business. This optional field will only be available for merchants with a + * business country set to `US`. It is also not applicable for marketplaces. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute small_business = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute $var + * @return $this + */ + public function setSmallBusiness($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute::class); + $this->small_business = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/IdentityAttribute.php b/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/IdentityAttribute.php new file mode 100644 index 000000000000..287558f7f280 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/IdentityAttribute.php @@ -0,0 +1,68 @@ +google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + */ +class IdentityAttribute extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The declaration of identity for this attribute. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration identity_declaration = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $identity_declaration = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $identity_declaration + * Required. The declaration of identity for this attribute. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Businessidentity::initOnce(); + parent::__construct($data); + } + + /** + * Required. The declaration of identity for this attribute. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration identity_declaration = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getIdentityDeclaration() + { + return $this->identity_declaration; + } + + /** + * Required. The declaration of identity for this attribute. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration identity_declaration = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setIdentityDeclaration($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity\IdentityAttribute\IdentityDeclaration::class); + $this->identity_declaration = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/IdentityAttribute/IdentityDeclaration.php b/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/IdentityAttribute/IdentityDeclaration.php new file mode 100644 index 000000000000..4b426ddf10ac --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/IdentityAttribute/IdentityDeclaration.php @@ -0,0 +1,62 @@ +google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration + */ +class IdentityDeclaration +{ + /** + * Default value indicating that no selection was made. + * + * Generated from protobuf enum IDENTITY_DECLARATION_UNSPECIFIED = 0; + */ + const IDENTITY_DECLARATION_UNSPECIFIED = 0; + /** + * Indicates that the account identifies with the attribute. + * + * Generated from protobuf enum SELF_IDENTIFIES_AS = 1; + */ + const SELF_IDENTIFIES_AS = 1; + /** + * Indicates that the account does not identify with the attribute. + * + * Generated from protobuf enum DOES_NOT_SELF_IDENTIFY_AS = 2; + */ + const DOES_NOT_SELF_IDENTIFY_AS = 2; + + private static $valueToName = [ + self::IDENTITY_DECLARATION_UNSPECIFIED => 'IDENTITY_DECLARATION_UNSPECIFIED', + self::SELF_IDENTIFIES_AS => 'SELF_IDENTIFIES_AS', + self::DOES_NOT_SELF_IDENTIFY_AS => 'DOES_NOT_SELF_IDENTIFY_AS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/PromotionsConsent.php b/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/PromotionsConsent.php new file mode 100644 index 000000000000..7f3987bc8c2e --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/BusinessIdentity/PromotionsConsent.php @@ -0,0 +1,65 @@ +google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent + */ +class PromotionsConsent +{ + /** + * Default value indicating that no selection was made. + * + * Generated from protobuf enum PROMOTIONS_CONSENT_UNSPECIFIED = 0; + */ + const PROMOTIONS_CONSENT_UNSPECIFIED = 0; + /** + * Indicates that the account consented to having their business identity + * used for promotions. + * + * Generated from protobuf enum PROMOTIONS_CONSENT_GIVEN = 1; + */ + const PROMOTIONS_CONSENT_GIVEN = 1; + /** + * Indicates that the account did not consent to having their business + * identity used for promotions. + * + * Generated from protobuf enum PROMOTIONS_CONSENT_DENIED = 2; + */ + const PROMOTIONS_CONSENT_DENIED = 2; + + private static $valueToName = [ + self::PROMOTIONS_CONSENT_UNSPECIFIED => 'PROMOTIONS_CONSENT_UNSPECIFIED', + self::PROMOTIONS_CONSENT_GIVEN => 'PROMOTIONS_CONSENT_GIVEN', + self::PROMOTIONS_CONSENT_DENIED => 'PROMOTIONS_CONSENT_DENIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/BusinessInfo.php b/ShoppingMerchantAccounts/src/V1beta/BusinessInfo.php new file mode 100644 index 000000000000..63e49eaa9cad --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/BusinessInfo.php @@ -0,0 +1,247 @@ +google.shopping.merchant.accounts.v1beta.BusinessInfo + */ +class BusinessInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The address of the business. + * + * Generated from protobuf field optional .google.type.PostalAddress address = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $address = null; + /** + * Output only. The phone number of the business. + * + * Generated from protobuf field optional .google.type.PhoneNumber phone = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $phone = null; + /** + * Output only. The phone verification state of the business. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.PhoneVerificationState phone_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $phone_verification_state = null; + /** + * Optional. The customer service of the business. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.CustomerService customer_service = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $customer_service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * @type \Google\Type\PostalAddress $address + * Optional. The address of the business. + * @type \Google\Type\PhoneNumber $phone + * Output only. The phone number of the business. + * @type int $phone_verification_state + * Output only. The phone verification state of the business. + * @type \Google\Shopping\Merchant\Accounts\V1beta\CustomerService $customer_service + * Optional. The customer service of the business. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Businessinfo::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The address of the business. + * + * Generated from protobuf field optional .google.type.PostalAddress address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Type\PostalAddress|null + */ + public function getAddress() + { + return $this->address; + } + + public function hasAddress() + { + return isset($this->address); + } + + public function clearAddress() + { + unset($this->address); + } + + /** + * Optional. The address of the business. + * + * Generated from protobuf field optional .google.type.PostalAddress address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Type\PostalAddress $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkMessage($var, \Google\Type\PostalAddress::class); + $this->address = $var; + + return $this; + } + + /** + * Output only. The phone number of the business. + * + * Generated from protobuf field optional .google.type.PhoneNumber phone = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Type\PhoneNumber|null + */ + public function getPhone() + { + return $this->phone; + } + + public function hasPhone() + { + return isset($this->phone); + } + + public function clearPhone() + { + unset($this->phone); + } + + /** + * Output only. The phone number of the business. + * + * Generated from protobuf field optional .google.type.PhoneNumber phone = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Type\PhoneNumber $var + * @return $this + */ + public function setPhone($var) + { + GPBUtil::checkMessage($var, \Google\Type\PhoneNumber::class); + $this->phone = $var; + + return $this; + } + + /** + * Output only. The phone verification state of the business. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.PhoneVerificationState phone_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getPhoneVerificationState() + { + return isset($this->phone_verification_state) ? $this->phone_verification_state : 0; + } + + public function hasPhoneVerificationState() + { + return isset($this->phone_verification_state); + } + + public function clearPhoneVerificationState() + { + unset($this->phone_verification_state); + } + + /** + * Output only. The phone verification state of the business. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.PhoneVerificationState phone_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setPhoneVerificationState($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\PhoneVerificationState::class); + $this->phone_verification_state = $var; + + return $this; + } + + /** + * Optional. The customer service of the business. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.CustomerService customer_service = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\CustomerService|null + */ + public function getCustomerService() + { + return $this->customer_service; + } + + public function hasCustomerService() + { + return isset($this->customer_service); + } + + public function clearCustomerService() + { + unset($this->customer_service); + } + + /** + * Optional. The customer service of the business. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.CustomerService customer_service = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\CustomerService $var + * @return $this + */ + public function setCustomerService($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\CustomerService::class); + $this->customer_service = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/CarrierRate.php b/ShoppingMerchantAccounts/src/V1beta/CarrierRate.php new file mode 100644 index 000000000000..2a0ecd661631 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/CarrierRate.php @@ -0,0 +1,318 @@ +google.shopping.merchant.accounts.v1beta.CarrierRate + */ +class CarrierRate extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the carrier rate. Must be unique per rate group. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = null; + /** + * Required. Carrier service, such as `"UPS"` or `"Fedex"`. + * + * Generated from protobuf field optional string carrier = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $carrier = null; + /** + * Required. Carrier service, such as `"ground"` or `"2 days"`. + * + * Generated from protobuf field optional string carrier_service = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $carrier_service = null; + /** + * Required. Shipping origin for this carrier rate. + * + * Generated from protobuf field optional string origin_postal_code = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $origin_postal_code = null; + /** + * Optional. Multiplicative shipping rate modifier as a number in decimal + * notation. Can be negative. For example `"5.4"` increases the rate by 5.4%, + * `"-3"` decreases the rate by 3%. + * + * Generated from protobuf field optional string percentage_adjustment = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $percentage_adjustment = null; + /** + * Optional. Additive shipping rate modifier. Can be negative. For example + * `{ "amount_micros": 1, "currency_code" : "USD" }` adds $1 to the rate, + * `{ "amount_micros": -3, "currency_code" : "USD" }` removes $3 from the + * rate. + * + * Generated from protobuf field optional .google.shopping.type.Price flat_adjustment = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $flat_adjustment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the carrier rate. Must be unique per rate group. + * @type string $carrier + * Required. Carrier service, such as `"UPS"` or `"Fedex"`. + * @type string $carrier_service + * Required. Carrier service, such as `"ground"` or `"2 days"`. + * @type string $origin_postal_code + * Required. Shipping origin for this carrier rate. + * @type string $percentage_adjustment + * Optional. Multiplicative shipping rate modifier as a number in decimal + * notation. Can be negative. For example `"5.4"` increases the rate by 5.4%, + * `"-3"` decreases the rate by 3%. + * @type \Google\Shopping\Type\Price $flat_adjustment + * Optional. Additive shipping rate modifier. Can be negative. For example + * `{ "amount_micros": 1, "currency_code" : "USD" }` adds $1 to the rate, + * `{ "amount_micros": -3, "currency_code" : "USD" }` removes $3 from the + * rate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the carrier rate. Must be unique per rate group. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Required. Name of the carrier rate. Must be unique per rate group. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Carrier service, such as `"UPS"` or `"Fedex"`. + * + * Generated from protobuf field optional string carrier = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCarrier() + { + return isset($this->carrier) ? $this->carrier : ''; + } + + public function hasCarrier() + { + return isset($this->carrier); + } + + public function clearCarrier() + { + unset($this->carrier); + } + + /** + * Required. Carrier service, such as `"UPS"` or `"Fedex"`. + * + * Generated from protobuf field optional string carrier = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCarrier($var) + { + GPBUtil::checkString($var, True); + $this->carrier = $var; + + return $this; + } + + /** + * Required. Carrier service, such as `"ground"` or `"2 days"`. + * + * Generated from protobuf field optional string carrier_service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCarrierService() + { + return isset($this->carrier_service) ? $this->carrier_service : ''; + } + + public function hasCarrierService() + { + return isset($this->carrier_service); + } + + public function clearCarrierService() + { + unset($this->carrier_service); + } + + /** + * Required. Carrier service, such as `"ground"` or `"2 days"`. + * + * Generated from protobuf field optional string carrier_service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCarrierService($var) + { + GPBUtil::checkString($var, True); + $this->carrier_service = $var; + + return $this; + } + + /** + * Required. Shipping origin for this carrier rate. + * + * Generated from protobuf field optional string origin_postal_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOriginPostalCode() + { + return isset($this->origin_postal_code) ? $this->origin_postal_code : ''; + } + + public function hasOriginPostalCode() + { + return isset($this->origin_postal_code); + } + + public function clearOriginPostalCode() + { + unset($this->origin_postal_code); + } + + /** + * Required. Shipping origin for this carrier rate. + * + * Generated from protobuf field optional string origin_postal_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOriginPostalCode($var) + { + GPBUtil::checkString($var, True); + $this->origin_postal_code = $var; + + return $this; + } + + /** + * Optional. Multiplicative shipping rate modifier as a number in decimal + * notation. Can be negative. For example `"5.4"` increases the rate by 5.4%, + * `"-3"` decreases the rate by 3%. + * + * Generated from protobuf field optional string percentage_adjustment = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPercentageAdjustment() + { + return isset($this->percentage_adjustment) ? $this->percentage_adjustment : ''; + } + + public function hasPercentageAdjustment() + { + return isset($this->percentage_adjustment); + } + + public function clearPercentageAdjustment() + { + unset($this->percentage_adjustment); + } + + /** + * Optional. Multiplicative shipping rate modifier as a number in decimal + * notation. Can be negative. For example `"5.4"` increases the rate by 5.4%, + * `"-3"` decreases the rate by 3%. + * + * Generated from protobuf field optional string percentage_adjustment = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPercentageAdjustment($var) + { + GPBUtil::checkString($var, True); + $this->percentage_adjustment = $var; + + return $this; + } + + /** + * Optional. Additive shipping rate modifier. Can be negative. For example + * `{ "amount_micros": 1, "currency_code" : "USD" }` adds $1 to the rate, + * `{ "amount_micros": -3, "currency_code" : "USD" }` removes $3 from the + * rate. + * + * Generated from protobuf field optional .google.shopping.type.Price flat_adjustment = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Type\Price|null + */ + public function getFlatAdjustment() + { + return $this->flat_adjustment; + } + + public function hasFlatAdjustment() + { + return isset($this->flat_adjustment); + } + + public function clearFlatAdjustment() + { + unset($this->flat_adjustment); + } + + /** + * Optional. Additive shipping rate modifier. Can be negative. For example + * `{ "amount_micros": 1, "currency_code" : "USD" }` adds $1 to the rate, + * `{ "amount_micros": -3, "currency_code" : "USD" }` removes $3 from the + * rate. + * + * Generated from protobuf field optional .google.shopping.type.Price flat_adjustment = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setFlatAdjustment($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->flat_adjustment = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ClaimHomepageRequest.php b/ShoppingMerchantAccounts/src/V1beta/ClaimHomepageRequest.php new file mode 100644 index 000000000000..1dacdf05fa4d --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ClaimHomepageRequest.php @@ -0,0 +1,71 @@ +google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + */ +class ClaimHomepageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the homepage to claim. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the homepage to claim. + * Format: `accounts/{account}/homepage` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Homepage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the homepage to claim. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the homepage to claim. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/AccountIssueServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/AccountIssueServiceClient.php new file mode 100644 index 000000000000..ef1611a481bd --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/AccountIssueServiceClient.php @@ -0,0 +1,246 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/account_issue_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/account_issue_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/account_issue_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/account_issue_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Lists all account issues of a Merchant Center account. + * + * The async variant is {@see AccountIssueServiceClient::listAccountIssuesAsync()} + * . + * + * @example samples/V1beta/AccountIssueServiceClient/list_account_issues.php + * + * @param ListAccountIssuesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listAccountIssues(ListAccountIssuesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAccountIssues', $request, $callOptions); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/AccountTaxServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/AccountTaxServiceClient.php new file mode 100644 index 000000000000..bf760cb30598 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/AccountTaxServiceClient.php @@ -0,0 +1,333 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/account_tax_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/account_tax_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/account_tax_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/account_tax_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a account_tax + * resource. + * + * @param string $account + * @param string $tax + * + * @return string The formatted account_tax resource. + * + * @experimental + */ + public static function accountTaxName(string $account, string $tax): string + { + return self::getPathTemplate('accountTax')->render([ + 'account' => $account, + 'tax' => $tax, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - accountTax: accounts/{account}/accounttax/{tax} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the tax rules that match the conditions of GetAccountTaxRequest + * + * The async variant is {@see AccountTaxServiceClient::getAccountTaxAsync()} . + * + * @example samples/V1beta/AccountTaxServiceClient/get_account_tax.php + * + * @param GetAccountTaxRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AccountTax + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getAccountTax(GetAccountTaxRequest $request, array $callOptions = []): AccountTax + { + return $this->startApiCall('GetAccountTax', $request, $callOptions)->wait(); + } + + /** + * Lists the tax settings of the sub-accounts only in your + * Merchant Center account. + * This method can only be called on a multi-client account, otherwise it'll + * return an error. + * + * The async variant is {@see AccountTaxServiceClient::listAccountTaxAsync()} . + * + * @example samples/V1beta/AccountTaxServiceClient/list_account_tax.php + * + * @param ListAccountTaxRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listAccountTax(ListAccountTaxRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAccountTax', $request, $callOptions); + } + + /** + * Updates the tax settings of the account. + * + * The async variant is {@see AccountTaxServiceClient::updateAccountTaxAsync()} . + * + * @example samples/V1beta/AccountTaxServiceClient/update_account_tax.php + * + * @param UpdateAccountTaxRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AccountTax + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateAccountTax(UpdateAccountTaxRequest $request, array $callOptions = []): AccountTax + { + return $this->startApiCall('UpdateAccountTax', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/AccountsServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/AccountsServiceClient.php new file mode 100644 index 000000000000..0ebd5217301c --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/AccountsServiceClient.php @@ -0,0 +1,449 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/accounts_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/accounts_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/accounts_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/accounts_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * terms_of_service resource. + * + * @param string $version + * + * @return string The formatted terms_of_service resource. + * + * @experimental + */ + public static function termsOfServiceName(string $version): string + { + return self::getPathTemplate('termsOfService')->render([ + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a user + * resource. + * + * @param string $account + * @param string $email + * + * @return string The formatted user resource. + * + * @experimental + */ + public static function userName(string $account, string $email): string + { + return self::getPathTemplate('user')->render([ + 'account' => $account, + 'email' => $email, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - termsOfService: termsOfService/{version} + * - user: accounts/{account}/users/{email} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a standalone Merchant Center account with additional configuration. + * Adds the user that makes the request as an admin for the new account. + * + * The async variant is + * {@see AccountsServiceClient::createAndConfigureAccountAsync()} . + * + * @example samples/V1beta/AccountsServiceClient/create_and_configure_account.php + * + * @param CreateAndConfigureAccountRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Account + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createAndConfigureAccount( + CreateAndConfigureAccountRequest $request, + array $callOptions = [] + ): Account { + return $this->startApiCall('CreateAndConfigureAccount', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified account regardless of its type: standalone, MCA or + * sub-account. Deleting an MCA leads to the deletion of all of its + * sub-accounts. Executing this method requires admin access. + * + * The async variant is {@see AccountsServiceClient::deleteAccountAsync()} . + * + * @example samples/V1beta/AccountsServiceClient/delete_account.php + * + * @param DeleteAccountRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteAccount(DeleteAccountRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAccount', $request, $callOptions)->wait(); + } + + /** + * Retrieves an account from your Merchant Center account. + * After inserting, updating, or deleting an account, it may take several + * minutes before changes take effect. + * + * The async variant is {@see AccountsServiceClient::getAccountAsync()} . + * + * @example samples/V1beta/AccountsServiceClient/get_account.php + * + * @param GetAccountRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Account + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getAccount(GetAccountRequest $request, array $callOptions = []): Account + { + return $this->startApiCall('GetAccount', $request, $callOptions)->wait(); + } + + /** + * Lists accounts accessible to the calling user and matching the + * constraints of the request such as page size or filters. + * This is not just listing the sub-accounts of an MCA, but all accounts the + * calling user has access to including other MCAs, linked accounts, + * standalone accounts and so on. + * + * The async variant is {@see AccountsServiceClient::listAccountsAsync()} . + * + * @example samples/V1beta/AccountsServiceClient/list_accounts.php + * + * @param ListAccountsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listAccounts(ListAccountsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAccounts', $request, $callOptions); + } + + /** + * List all sub-accounts for a given multi client account. This is a + * convenience wrapper for the more powerful `ListAccounts` method. This + * method will produce the same results as calling `ListsAccounts` with the + * following filter: + * `relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))` + * + * The async variant is {@see AccountsServiceClient::listSubAccountsAsync()} . + * + * @example samples/V1beta/AccountsServiceClient/list_sub_accounts.php + * + * @param ListSubAccountsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listSubAccounts(ListSubAccountsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSubAccounts', $request, $callOptions); + } + + /** + * Updates an account regardless of its type: standalone, MCA or sub-account. + * Executing this method requires admin access. + * + * The async variant is {@see AccountsServiceClient::updateAccountAsync()} . + * + * @example samples/V1beta/AccountsServiceClient/update_account.php + * + * @param UpdateAccountRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Account + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateAccount(UpdateAccountRequest $request, array $callOptions = []): Account + { + return $this->startApiCall('UpdateAccount', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/BusinessIdentityServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/BusinessIdentityServiceClient.php new file mode 100644 index 000000000000..60894a0f6bcc --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/BusinessIdentityServiceClient.php @@ -0,0 +1,282 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/business_identity_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/business_identity_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/business_identity_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/business_identity_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * business_identity resource. + * + * @param string $account + * + * @return string The formatted business_identity resource. + * + * @experimental + */ + public static function businessIdentityName(string $account): string + { + return self::getPathTemplate('businessIdentity')->render([ + 'account' => $account, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - businessIdentity: accounts/{account}/businessIdentity + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the business identity of an account. + * + * The async variant is + * {@see BusinessIdentityServiceClient::getBusinessIdentityAsync()} . + * + * @example samples/V1beta/BusinessIdentityServiceClient/get_business_identity.php + * + * @param GetBusinessIdentityRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BusinessIdentity + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getBusinessIdentity(GetBusinessIdentityRequest $request, array $callOptions = []): BusinessIdentity + { + return $this->startApiCall('GetBusinessIdentity', $request, $callOptions)->wait(); + } + + /** + * Updates the business identity of an account. Executing this method requires + * admin access. + * + * The async variant is + * {@see BusinessIdentityServiceClient::updateBusinessIdentityAsync()} . + * + * @example samples/V1beta/BusinessIdentityServiceClient/update_business_identity.php + * + * @param UpdateBusinessIdentityRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BusinessIdentity + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateBusinessIdentity( + UpdateBusinessIdentityRequest $request, + array $callOptions = [] + ): BusinessIdentity { + return $this->startApiCall('UpdateBusinessIdentity', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/BusinessInfoServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/BusinessInfoServiceClient.php new file mode 100644 index 000000000000..fa4096db0b84 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/BusinessInfoServiceClient.php @@ -0,0 +1,277 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/business_info_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/business_info_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/business_info_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/business_info_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * business_info resource. + * + * @param string $account + * + * @return string The formatted business_info resource. + * + * @experimental + */ + public static function businessInfoName(string $account): string + { + return self::getPathTemplate('businessInfo')->render([ + 'account' => $account, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - businessInfo: accounts/{account}/businessInfo + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the business info of an account. + * + * The async variant is {@see BusinessInfoServiceClient::getBusinessInfoAsync()} . + * + * @example samples/V1beta/BusinessInfoServiceClient/get_business_info.php + * + * @param GetBusinessInfoRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BusinessInfo + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getBusinessInfo(GetBusinessInfoRequest $request, array $callOptions = []): BusinessInfo + { + return $this->startApiCall('GetBusinessInfo', $request, $callOptions)->wait(); + } + + /** + * Updates the business info of an account. Executing this method requires + * admin access. + * + * The async variant is {@see BusinessInfoServiceClient::updateBusinessInfoAsync()} + * . + * + * @example samples/V1beta/BusinessInfoServiceClient/update_business_info.php + * + * @param UpdateBusinessInfoRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BusinessInfo + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateBusinessInfo(UpdateBusinessInfoRequest $request, array $callOptions = []): BusinessInfo + { + return $this->startApiCall('UpdateBusinessInfo', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/EmailPreferencesServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/EmailPreferencesServiceClient.php new file mode 100644 index 000000000000..82b795a8a131 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/EmailPreferencesServiceClient.php @@ -0,0 +1,298 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/email_preferences_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/email_preferences_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/email_preferences_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/email_preferences_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * email_preferences resource. + * + * @param string $account + * @param string $email + * + * @return string The formatted email_preferences resource. + * + * @experimental + */ + public static function emailPreferencesName(string $account, string $email): string + { + return self::getPathTemplate('emailPreferences')->render([ + 'account' => $account, + 'email' => $email, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - emailPreferences: accounts/{account}/users/{email}/emailPreferences + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the email preferences for a Merchant Center account user. + * + * Use the name=accounts/*/users/me/emailPreferences alias to get preferences + * for the authenticated user. + * + * The async variant is + * {@see EmailPreferencesServiceClient::getEmailPreferencesAsync()} . + * + * @example samples/V1beta/EmailPreferencesServiceClient/get_email_preferences.php + * + * @param GetEmailPreferencesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EmailPreferences + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getEmailPreferences(GetEmailPreferencesRequest $request, array $callOptions = []): EmailPreferences + { + return $this->startApiCall('GetEmailPreferences', $request, $callOptions)->wait(); + } + + /** + * Updates the email preferences for a Merchant Center account user. MCA users + * should specify the MCA account rather than a sub-account of the MCA. + * + * Preferences which are not explicitly selected in the update mask will not + * be updated. + * + * It is invalid for updates to specify an UNCONFIRMED opt-in status value. + * + * Use the name=accounts/*/users/me/emailPreferences alias to update + * preferences + * for the authenticated user. + * + * The async variant is + * {@see EmailPreferencesServiceClient::updateEmailPreferencesAsync()} . + * + * @example samples/V1beta/EmailPreferencesServiceClient/update_email_preferences.php + * + * @param UpdateEmailPreferencesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EmailPreferences + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateEmailPreferences( + UpdateEmailPreferencesRequest $request, + array $callOptions = [] + ): EmailPreferences { + return $this->startApiCall('UpdateEmailPreferences', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/HomepageServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/HomepageServiceClient.php new file mode 100644 index 000000000000..b19e66b3d2ab --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/HomepageServiceClient.php @@ -0,0 +1,348 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/homepage_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/homepage_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/homepage_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/homepage_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a homepage + * resource. + * + * @param string $account + * + * @return string The formatted homepage resource. + * + * @experimental + */ + public static function homepageName(string $account): string + { + return self::getPathTemplate('homepage')->render([ + 'account' => $account, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - homepage: accounts/{account}/homepage + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Claims a store's homepage. Executing this method requires admin access. + * + * If the homepage is already claimed, this will recheck the + * verification (unless the merchant is exempted from claiming, which also + * exempts from verification) and return a successful response. If ownership + * can no longer be verified, it will return an error, but it won't clear the + * claim. In case of failure, a canonical error message will be returned: + * * PERMISSION_DENIED: user doesn't have the necessary permissions on this + * MC account; + * * FAILED_PRECONDITION: + * - The account is not a Merchant Center account; + * - MC account doesn't have a homepage; + * - claiming failed (in this case the error message will contain more + * details). + * + * The async variant is {@see HomepageServiceClient::claimHomepageAsync()} . + * + * @example samples/V1beta/HomepageServiceClient/claim_homepage.php + * + * @param ClaimHomepageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Homepage + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function claimHomepage(ClaimHomepageRequest $request, array $callOptions = []): Homepage + { + return $this->startApiCall('ClaimHomepage', $request, $callOptions)->wait(); + } + + /** + * Retrieves a store's homepage. + * + * The async variant is {@see HomepageServiceClient::getHomepageAsync()} . + * + * @example samples/V1beta/HomepageServiceClient/get_homepage.php + * + * @param GetHomepageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Homepage + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getHomepage(GetHomepageRequest $request, array $callOptions = []): Homepage + { + return $this->startApiCall('GetHomepage', $request, $callOptions)->wait(); + } + + /** + * Unclaims a store's homepage. Executing this method requires admin access. + * + * The async variant is {@see HomepageServiceClient::unclaimHomepageAsync()} . + * + * @example samples/V1beta/HomepageServiceClient/unclaim_homepage.php + * + * @param UnclaimHomepageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Homepage + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function unclaimHomepage(UnclaimHomepageRequest $request, array $callOptions = []): Homepage + { + return $this->startApiCall('UnclaimHomepage', $request, $callOptions)->wait(); + } + + /** + * Updates a store's homepage. Executing this method requires admin access. + * + * The async variant is {@see HomepageServiceClient::updateHomepageAsync()} . + * + * @example samples/V1beta/HomepageServiceClient/update_homepage.php + * + * @param UpdateHomepageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Homepage + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateHomepage(UpdateHomepageRequest $request, array $callOptions = []): Homepage + { + return $this->startApiCall('UpdateHomepage', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/OnlineReturnPolicyServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/OnlineReturnPolicyServiceClient.php new file mode 100644 index 000000000000..7219e14001e8 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/OnlineReturnPolicyServiceClient.php @@ -0,0 +1,307 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/online_return_policy_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/online_return_policy_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/online_return_policy_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/online_return_policy_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * online_return_policy resource. + * + * @param string $account + * @param string $returnPolicy + * + * @return string The formatted online_return_policy resource. + * + * @experimental + */ + public static function onlineReturnPolicyName(string $account, string $returnPolicy): string + { + return self::getPathTemplate('onlineReturnPolicy')->render([ + 'account' => $account, + 'return_policy' => $returnPolicy, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - onlineReturnPolicy: accounts/{account}/onlineReturnPolicies/{return_policy} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Gets an existing return policy. + * + * The async variant is + * {@see OnlineReturnPolicyServiceClient::getOnlineReturnPolicyAsync()} . + * + * @example samples/V1beta/OnlineReturnPolicyServiceClient/get_online_return_policy.php + * + * @param GetOnlineReturnPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OnlineReturnPolicy + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getOnlineReturnPolicy( + GetOnlineReturnPolicyRequest $request, + array $callOptions = [] + ): OnlineReturnPolicy { + return $this->startApiCall('GetOnlineReturnPolicy', $request, $callOptions)->wait(); + } + + /** + * Lists all existing return policies. + * + * The async variant is + * {@see OnlineReturnPolicyServiceClient::listOnlineReturnPoliciesAsync()} . + * + * @example samples/V1beta/OnlineReturnPolicyServiceClient/list_online_return_policies.php + * + * @param ListOnlineReturnPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listOnlineReturnPolicies( + ListOnlineReturnPoliciesRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListOnlineReturnPolicies', $request, $callOptions); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/ProgramsServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/ProgramsServiceClient.php new file mode 100644 index 000000000000..9d54d2584501 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/ProgramsServiceClient.php @@ -0,0 +1,368 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/programs_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/programs_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/programs_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/programs_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a program + * resource. + * + * @param string $account + * @param string $program + * + * @return string The formatted program resource. + * + * @experimental + */ + public static function programName(string $account, string $program): string + { + return self::getPathTemplate('program')->render([ + 'account' => $account, + 'program' => $program, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - program: accounts/{account}/programs/{program} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Disable participation in the specified program for the account. Executing + * this method requires admin access. + * + * The async variant is {@see ProgramsServiceClient::disableProgramAsync()} . + * + * @example samples/V1beta/ProgramsServiceClient/disable_program.php + * + * @param DisableProgramRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Program + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function disableProgram(DisableProgramRequest $request, array $callOptions = []): Program + { + return $this->startApiCall('DisableProgram', $request, $callOptions)->wait(); + } + + /** + * Enable participation in the specified program for the account. Executing + * this method requires admin access. + * + * The async variant is {@see ProgramsServiceClient::enableProgramAsync()} . + * + * @example samples/V1beta/ProgramsServiceClient/enable_program.php + * + * @param EnableProgramRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Program + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function enableProgram(EnableProgramRequest $request, array $callOptions = []): Program + { + return $this->startApiCall('EnableProgram', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified program for the account. + * + * The async variant is {@see ProgramsServiceClient::getProgramAsync()} . + * + * @example samples/V1beta/ProgramsServiceClient/get_program.php + * + * @param GetProgramRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Program + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getProgram(GetProgramRequest $request, array $callOptions = []): Program + { + return $this->startApiCall('GetProgram', $request, $callOptions)->wait(); + } + + /** + * Retrieves all programs for the account. + * + * The async variant is {@see ProgramsServiceClient::listProgramsAsync()} . + * + * @example samples/V1beta/ProgramsServiceClient/list_programs.php + * + * @param ListProgramsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listPrograms(ListProgramsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListPrograms', $request, $callOptions); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/RegionsServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/RegionsServiceClient.php new file mode 100644 index 000000000000..cb42ff72b237 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/RegionsServiceClient.php @@ -0,0 +1,391 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/regions_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/regions_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/regions_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/regions_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a region + * resource. + * + * @param string $account + * @param string $region + * + * @return string The formatted region resource. + * + * @experimental + */ + public static function regionName(string $account, string $region): string + { + return self::getPathTemplate('region')->render([ + 'account' => $account, + 'region' => $region, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - region: accounts/{account}/regions/{region} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a region definition in your Merchant Center account. Executing this + * method requires admin access. + * + * The async variant is {@see RegionsServiceClient::createRegionAsync()} . + * + * @example samples/V1beta/RegionsServiceClient/create_region.php + * + * @param CreateRegionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Region + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createRegion(CreateRegionRequest $request, array $callOptions = []): Region + { + return $this->startApiCall('CreateRegion', $request, $callOptions)->wait(); + } + + /** + * Deletes a region definition from your Merchant Center account. Executing + * this method requires admin access. + * + * The async variant is {@see RegionsServiceClient::deleteRegionAsync()} . + * + * @example samples/V1beta/RegionsServiceClient/delete_region.php + * + * @param DeleteRegionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteRegion(DeleteRegionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteRegion', $request, $callOptions)->wait(); + } + + /** + * Retrieves a region defined in your Merchant Center account. + * + * The async variant is {@see RegionsServiceClient::getRegionAsync()} . + * + * @example samples/V1beta/RegionsServiceClient/get_region.php + * + * @param GetRegionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Region + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getRegion(GetRegionRequest $request, array $callOptions = []): Region + { + return $this->startApiCall('GetRegion', $request, $callOptions)->wait(); + } + + /** + * Lists the regions in your Merchant Center account. + * + * The async variant is {@see RegionsServiceClient::listRegionsAsync()} . + * + * @example samples/V1beta/RegionsServiceClient/list_regions.php + * + * @param ListRegionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listRegions(ListRegionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRegions', $request, $callOptions); + } + + /** + * Updates a region definition in your Merchant Center account. Executing this + * method requires admin access. + * + * The async variant is {@see RegionsServiceClient::updateRegionAsync()} . + * + * @example samples/V1beta/RegionsServiceClient/update_region.php + * + * @param UpdateRegionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Region + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateRegion(UpdateRegionRequest $request, array $callOptions = []): Region + { + return $this->startApiCall('UpdateRegion', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/ShippingSettingsServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/ShippingSettingsServiceClient.php new file mode 100644 index 000000000000..8c59f7e795a3 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/ShippingSettingsServiceClient.php @@ -0,0 +1,282 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/shipping_settings_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/shipping_settings_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/shipping_settings_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/shipping_settings_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * shipping_settings resource. + * + * @param string $account + * + * @return string The formatted shipping_settings resource. + * + * @experimental + */ + public static function shippingSettingsName(string $account): string + { + return self::getPathTemplate('shippingSettings')->render([ + 'account' => $account, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - shippingSettings: accounts/{account}/shippingSettings + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieve shipping setting information. + * + * The async variant is + * {@see ShippingSettingsServiceClient::getShippingSettingsAsync()} . + * + * @example samples/V1beta/ShippingSettingsServiceClient/get_shipping_settings.php + * + * @param GetShippingSettingsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ShippingSettings + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getShippingSettings(GetShippingSettingsRequest $request, array $callOptions = []): ShippingSettings + { + return $this->startApiCall('GetShippingSettings', $request, $callOptions)->wait(); + } + + /** + * Replace the shipping setting of a merchant with the request shipping + * setting. Executing this method requires admin access. + * + * The async variant is + * {@see ShippingSettingsServiceClient::insertShippingSettingsAsync()} . + * + * @example samples/V1beta/ShippingSettingsServiceClient/insert_shipping_settings.php + * + * @param InsertShippingSettingsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ShippingSettings + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function insertShippingSettings( + InsertShippingSettingsRequest $request, + array $callOptions = [] + ): ShippingSettings { + return $this->startApiCall('InsertShippingSettings', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/TermsOfServiceAgreementStateServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/TermsOfServiceAgreementStateServiceClient.php new file mode 100644 index 000000000000..553c3a223ba8 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/TermsOfServiceAgreementStateServiceClient.php @@ -0,0 +1,309 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/terms_of_service_agreement_state_service_client_config.json', + 'descriptorsConfigPath' => + __DIR__ . '/../resources/terms_of_service_agreement_state_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/terms_of_service_agreement_state_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/terms_of_service_agreement_state_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * terms_of_service_agreement_state resource. + * + * @param string $account + * @param string $identifier + * + * @return string The formatted terms_of_service_agreement_state resource. + * + * @experimental + */ + public static function termsOfServiceAgreementStateName(string $account, string $identifier): string + { + return self::getPathTemplate('termsOfServiceAgreementState')->render([ + 'account' => $account, + 'identifier' => $identifier, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - termsOfServiceAgreementState: accounts/{account}/termsOfServiceAgreementStates/{identifier} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the state of a terms of service agreement. + * + * The async variant is + * {@see TermsOfServiceAgreementStateServiceClient::getTermsOfServiceAgreementStateAsync()} + * . + * + * @example samples/V1beta/TermsOfServiceAgreementStateServiceClient/get_terms_of_service_agreement_state.php + * + * @param GetTermsOfServiceAgreementStateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TermsOfServiceAgreementState + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getTermsOfServiceAgreementState( + GetTermsOfServiceAgreementStateRequest $request, + array $callOptions = [] + ): TermsOfServiceAgreementState { + return $this->startApiCall('GetTermsOfServiceAgreementState', $request, $callOptions)->wait(); + } + + /** + * Retrieves the state of the agreement for the application terms of service. + * + * The async variant is + * {@see TermsOfServiceAgreementStateServiceClient::retrieveForApplicationTermsOfServiceAgreementStateAsync()} + * . + * + * @example samples/V1beta/TermsOfServiceAgreementStateServiceClient/retrieve_for_application_terms_of_service_agreement_state.php + * + * @param RetrieveForApplicationTermsOfServiceAgreementStateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TermsOfServiceAgreementState + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function retrieveForApplicationTermsOfServiceAgreementState( + RetrieveForApplicationTermsOfServiceAgreementStateRequest $request, + array $callOptions = [] + ): TermsOfServiceAgreementState { + return $this->startApiCall( + 'RetrieveForApplicationTermsOfServiceAgreementState', + $request, + $callOptions + )->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/TermsOfServiceServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/TermsOfServiceServiceClient.php new file mode 100644 index 000000000000..9d4887c48a05 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/TermsOfServiceServiceClient.php @@ -0,0 +1,327 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/terms_of_service_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/terms_of_service_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/terms_of_service_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/terms_of_service_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * terms_of_service resource. + * + * @param string $version + * + * @return string The formatted terms_of_service resource. + * + * @experimental + */ + public static function termsOfServiceName(string $version): string + { + return self::getPathTemplate('termsOfService')->render([ + 'version' => $version, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - termsOfService: termsOfService/{version} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Accepts a `TermsOfService`. Executing this method requires admin access. + * + * The async variant is + * {@see TermsOfServiceServiceClient::acceptTermsOfServiceAsync()} . + * + * @example samples/V1beta/TermsOfServiceServiceClient/accept_terms_of_service.php + * + * @param AcceptTermsOfServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function acceptTermsOfService(AcceptTermsOfServiceRequest $request, array $callOptions = []): void + { + $this->startApiCall('AcceptTermsOfService', $request, $callOptions)->wait(); + } + + /** + * Retrieves the `TermsOfService` associated with the provided version. + * + * The async variant is + * {@see TermsOfServiceServiceClient::getTermsOfServiceAsync()} . + * + * @example samples/V1beta/TermsOfServiceServiceClient/get_terms_of_service.php + * + * @param GetTermsOfServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TermsOfService + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getTermsOfService(GetTermsOfServiceRequest $request, array $callOptions = []): TermsOfService + { + return $this->startApiCall('GetTermsOfService', $request, $callOptions)->wait(); + } + + /** + * Retrieves the latest version of the `TermsOfService` for a given `kind` and + * `region_code`. + * + * The async variant is + * {@see TermsOfServiceServiceClient::retrieveLatestTermsOfServiceAsync()} . + * + * @example samples/V1beta/TermsOfServiceServiceClient/retrieve_latest_terms_of_service.php + * + * @param RetrieveLatestTermsOfServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TermsOfService + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function retrieveLatestTermsOfService( + RetrieveLatestTermsOfServiceRequest $request, + array $callOptions = [] + ): TermsOfService { + return $this->startApiCall('RetrieveLatestTermsOfService', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/Client/UserServiceClient.php b/ShoppingMerchantAccounts/src/V1beta/Client/UserServiceClient.php new file mode 100644 index 000000000000..278054e34fe7 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Client/UserServiceClient.php @@ -0,0 +1,387 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/user_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/user_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/user_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/user_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a user + * resource. + * + * @param string $account + * @param string $email + * + * @return string The formatted user resource. + * + * @experimental + */ + public static function userName(string $account, string $email): string + { + return self::getPathTemplate('user')->render([ + 'account' => $account, + 'email' => $email, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - user: accounts/{account}/users/{email} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Merchant Center account user. Executing this method requires + * admin access. + * + * The async variant is {@see UserServiceClient::createUserAsync()} . + * + * @example samples/V1beta/UserServiceClient/create_user.php + * + * @param CreateUserRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return User + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createUser(CreateUserRequest $request, array $callOptions = []): User + { + return $this->startApiCall('CreateUser', $request, $callOptions)->wait(); + } + + /** + * Deletes a Merchant Center account user. Executing this method requires + * admin access. + * + * The async variant is {@see UserServiceClient::deleteUserAsync()} . + * + * @example samples/V1beta/UserServiceClient/delete_user.php + * + * @param DeleteUserRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteUser(DeleteUserRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteUser', $request, $callOptions)->wait(); + } + + /** + * Retrieves a Merchant Center account user. + * + * The async variant is {@see UserServiceClient::getUserAsync()} . + * + * @example samples/V1beta/UserServiceClient/get_user.php + * + * @param GetUserRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return User + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getUser(GetUserRequest $request, array $callOptions = []): User + { + return $this->startApiCall('GetUser', $request, $callOptions)->wait(); + } + + /** + * Lists all users of a Merchant Center account. + * + * The async variant is {@see UserServiceClient::listUsersAsync()} . + * + * @example samples/V1beta/UserServiceClient/list_users.php + * + * @param ListUsersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listUsers(ListUsersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUsers', $request, $callOptions); + } + + /** + * Updates a Merchant Center account user. Executing this method requires + * admin access. + * + * The async variant is {@see UserServiceClient::updateUserAsync()} . + * + * @example samples/V1beta/UserServiceClient/update_user.php + * + * @param UpdateUserRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return User + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateUser(UpdateUserRequest $request, array $callOptions = []): User + { + return $this->startApiCall('UpdateUser', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest.php b/ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest.php new file mode 100644 index 000000000000..b3a4f65fc8d7 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest.php @@ -0,0 +1,201 @@ +google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + */ +class CreateAndConfigureAccountRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account to be created. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Account account = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $account = null; + /** + * Optional. Users to be added to the account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.CreateUserRequest users = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $users; + /** + * Optional. The Terms of Service (ToS) to be accepted immediately upon + * account creation. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService accept_terms_of_service = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $accept_terms_of_service = null; + /** + * Optional. If specified, an account service between the account to be + * created and the provider account is initialized as part of the + * creation. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService service = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $service; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\Account $account + * Required. The account to be created. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\CreateUserRequest>|\Google\Protobuf\Internal\RepeatedField $users + * Optional. Users to be added to the account. + * @type \Google\Shopping\Merchant\Accounts\V1beta\CreateAndConfigureAccountRequest\AcceptTermsOfService $accept_terms_of_service + * Optional. The Terms of Service (ToS) to be accepted immediately upon + * account creation. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\CreateAndConfigureAccountRequest\AddAccountService>|\Google\Protobuf\Internal\RepeatedField $service + * Optional. If specified, an account service between the account to be + * created and the provider account is initialized as part of the + * creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account to be created. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Account account = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Account|null + */ + public function getAccount() + { + return $this->account; + } + + public function hasAccount() + { + return isset($this->account); + } + + public function clearAccount() + { + unset($this->account); + } + + /** + * Required. The account to be created. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Account account = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Account $var + * @return $this + */ + public function setAccount($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Account::class); + $this->account = $var; + + return $this; + } + + /** + * Optional. Users to be added to the account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.CreateUserRequest users = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsers() + { + return $this->users; + } + + /** + * Optional. Users to be added to the account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.CreateUserRequest users = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\CreateUserRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\CreateUserRequest::class); + $this->users = $arr; + + return $this; + } + + /** + * Optional. The Terms of Service (ToS) to be accepted immediately upon + * account creation. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService accept_terms_of_service = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\CreateAndConfigureAccountRequest\AcceptTermsOfService|null + */ + public function getAcceptTermsOfService() + { + return $this->accept_terms_of_service; + } + + public function hasAcceptTermsOfService() + { + return isset($this->accept_terms_of_service); + } + + public function clearAcceptTermsOfService() + { + unset($this->accept_terms_of_service); + } + + /** + * Optional. The Terms of Service (ToS) to be accepted immediately upon + * account creation. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService accept_terms_of_service = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\CreateAndConfigureAccountRequest\AcceptTermsOfService $var + * @return $this + */ + public function setAcceptTermsOfService($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\CreateAndConfigureAccountRequest\AcceptTermsOfService::class); + $this->accept_terms_of_service = $var; + + return $this; + } + + /** + * Optional. If specified, an account service between the account to be + * created and the provider account is initialized as part of the + * creation. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService service = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getService() + { + return $this->service; + } + + /** + * Optional. If specified, an account service between the account to be + * created and the provider account is initialized as part of the + * creation. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService service = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\CreateAndConfigureAccountRequest\AddAccountService>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setService($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\CreateAndConfigureAccountRequest\AddAccountService::class); + $this->service = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest/AcceptTermsOfService.php b/ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest/AcceptTermsOfService.php new file mode 100644 index 000000000000..0d12bd91ca36 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest/AcceptTermsOfService.php @@ -0,0 +1,110 @@ +google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + */ +class AcceptTermsOfService extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the terms of service version. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Region code as defined by [CLDR](https://cldr.unicode.org/). + * This is either a country when the ToS applies specifically to that + * country or `001` when it applies globally. + * + * Generated from protobuf field string region_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the terms of service version. + * @type string $region_code + * Required. Region code as defined by [CLDR](https://cldr.unicode.org/). + * This is either a country when the ToS applies specifically to that + * country or `001` when it applies globally. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the terms of service version. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the terms of service version. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Region code as defined by [CLDR](https://cldr.unicode.org/). + * This is either a country when the ToS applies specifically to that + * country or `001` when it applies globally. + * + * Generated from protobuf field string region_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. Region code as defined by [CLDR](https://cldr.unicode.org/). + * This is either a country when the ToS applies specifically to that + * country or `001` when it applies globally. + * + * Generated from protobuf field string region_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest/AddAccountService.php b/ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest/AddAccountService.php new file mode 100644 index 000000000000..b7d977979d4a --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/CreateAndConfigureAccountRequest/AddAccountService.php @@ -0,0 +1,125 @@ +google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + */ +class AddAccountService extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The provider of the service. + * Format: `accounts/{account}` + * + * Generated from protobuf field optional string provider = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $provider = null; + protected $service_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\GPBEmpty $account_aggregation + * The provider is an aggregator for the account. + * @type string $provider + * Optional. The provider of the service. + * Format: `accounts/{account}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * The provider is an aggregator for the account. + * + * Generated from protobuf field .google.protobuf.Empty account_aggregation = 2; + * @return \Google\Protobuf\GPBEmpty|null + */ + public function getAccountAggregation() + { + return $this->readOneof(2); + } + + public function hasAccountAggregation() + { + return $this->hasOneof(2); + } + + /** + * The provider is an aggregator for the account. + * + * Generated from protobuf field .google.protobuf.Empty account_aggregation = 2; + * @param \Google\Protobuf\GPBEmpty $var + * @return $this + */ + public function setAccountAggregation($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\GPBEmpty::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. The provider of the service. + * Format: `accounts/{account}` + * + * Generated from protobuf field optional string provider = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getProvider() + { + return isset($this->provider) ? $this->provider : ''; + } + + public function hasProvider() + { + return isset($this->provider); + } + + public function clearProvider() + { + unset($this->provider); + } + + /** + * Optional. The provider of the service. + * Format: `accounts/{account}` + * + * Generated from protobuf field optional string provider = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProvider($var) + { + GPBUtil::checkString($var, True); + $this->provider = $var; + + return $this; + } + + /** + * @return string + */ + public function getServiceType() + { + return $this->whichOneof("service_type"); + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/CreateRegionRequest.php b/ShoppingMerchantAccounts/src/V1beta/CreateRegionRequest.php new file mode 100644 index 000000000000..4c3e1c565e78 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/CreateRegionRequest.php @@ -0,0 +1,173 @@ +google.shopping.merchant.accounts.v1beta.CreateRegionRequest + */ +class CreateRegionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account to create a region for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The identifier for the region, unique over all regions of the + * same account. + * + * Generated from protobuf field string region_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_id = ''; + /** + * Required. The region to create. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region region = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = null; + + /** + * @param string $parent Required. The account to create a region for. + * Format: `accounts/{account}` + * Please see {@see RegionsServiceClient::accountName()} for help formatting this field. + * @param \Google\Shopping\Merchant\Accounts\V1beta\Region $region Required. The region to create. + * @param string $regionId Required. The identifier for the region, unique over all regions of the + * same account. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\CreateRegionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Shopping\Merchant\Accounts\V1beta\Region $region, string $regionId): self + { + return (new self()) + ->setParent($parent) + ->setRegion($region) + ->setRegionId($regionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account to create a region for. + * Format: `accounts/{account}` + * @type string $region_id + * Required. The identifier for the region, unique over all regions of the + * same account. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Region $region + * Required. The region to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account to create a region for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account to create a region for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The identifier for the region, unique over all regions of the + * same account. + * + * Generated from protobuf field string region_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionId() + { + return $this->region_id; + } + + /** + * Required. The identifier for the region, unique over all regions of the + * same account. + * + * Generated from protobuf field string region_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionId($var) + { + GPBUtil::checkString($var, True); + $this->region_id = $var; + + return $this; + } + + /** + * Required. The region to create. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region region = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Region|null + */ + public function getRegion() + { + return $this->region; + } + + public function hasRegion() + { + return isset($this->region); + } + + public function clearRegion() + { + unset($this->region); + } + + /** + * Required. The region to create. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region region = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Region $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Region::class); + $this->region = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/CreateUserRequest.php b/ShoppingMerchantAccounts/src/V1beta/CreateUserRequest.php new file mode 100644 index 000000000000..f8b622da84ef --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/CreateUserRequest.php @@ -0,0 +1,170 @@ +google.shopping.merchant.accounts.v1beta.CreateUserRequest + */ +class CreateUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the account for which a user will be + * created. Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The email address of the user (for example, + * `john.doe@gmail.com`). + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_id = ''; + /** + * Required. The user to create. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user = null; + + /** + * @param string $parent Required. The resource name of the account for which a user will be + * created. Format: `accounts/{account}` + * Please see {@see UserServiceClient::accountName()} for help formatting this field. + * @param \Google\Shopping\Merchant\Accounts\V1beta\User $user Required. The user to create. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\CreateUserRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Shopping\Merchant\Accounts\V1beta\User $user): self + { + return (new self()) + ->setParent($parent) + ->setUser($user); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the account for which a user will be + * created. Format: `accounts/{account}` + * @type string $user_id + * Required. The email address of the user (for example, + * `john.doe@gmail.com`). + * @type \Google\Shopping\Merchant\Accounts\V1beta\User $user + * Required. The user to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\User::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the account for which a user will be + * created. Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the account for which a user will be + * created. Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The email address of the user (for example, + * `john.doe@gmail.com`). + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * Required. The email address of the user (for example, + * `john.doe@gmail.com`). + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkString($var, True); + $this->user_id = $var; + + return $this; + } + + /** + * Required. The user to create. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Required. The user to create. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\User::class); + $this->user = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/CustomerService.php b/ShoppingMerchantAccounts/src/V1beta/CustomerService.php new file mode 100644 index 000000000000..6f6b96063640 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/CustomerService.php @@ -0,0 +1,165 @@ +google.shopping.merchant.accounts.v1beta.CustomerService + */ +class CustomerService extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The URI where customer service may be found. + * + * Generated from protobuf field optional string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $uri = null; + /** + * Optional. The email address where customer service may be reached. + * + * Generated from protobuf field optional string email = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email = null; + /** + * Optional. The phone number where customer service may be called. + * + * Generated from protobuf field optional .google.type.PhoneNumber phone = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $phone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Optional. The URI where customer service may be found. + * @type string $email + * Optional. The email address where customer service may be reached. + * @type \Google\Type\PhoneNumber $phone + * Optional. The phone number where customer service may be called. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Customerservice::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The URI where customer service may be found. + * + * Generated from protobuf field optional string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUri() + { + return isset($this->uri) ? $this->uri : ''; + } + + public function hasUri() + { + return isset($this->uri); + } + + public function clearUri() + { + unset($this->uri); + } + + /** + * Optional. The URI where customer service may be found. + * + * Generated from protobuf field optional string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Optional. The email address where customer service may be reached. + * + * Generated from protobuf field optional string email = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return isset($this->email) ? $this->email : ''; + } + + public function hasEmail() + { + return isset($this->email); + } + + public function clearEmail() + { + unset($this->email); + } + + /** + * Optional. The email address where customer service may be reached. + * + * Generated from protobuf field optional string email = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Optional. The phone number where customer service may be called. + * + * Generated from protobuf field optional .google.type.PhoneNumber phone = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Type\PhoneNumber|null + */ + public function getPhone() + { + return $this->phone; + } + + public function hasPhone() + { + return isset($this->phone); + } + + public function clearPhone() + { + unset($this->phone); + } + + /** + * Optional. The phone number where customer service may be called. + * + * Generated from protobuf field optional .google.type.PhoneNumber phone = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Type\PhoneNumber $var + * @return $this + */ + public function setPhone($var) + { + GPBUtil::checkMessage($var, \Google\Type\PhoneNumber::class); + $this->phone = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/CutoffTime.php b/ShoppingMerchantAccounts/src/V1beta/CutoffTime.php new file mode 100644 index 000000000000..402e6093b765 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/CutoffTime.php @@ -0,0 +1,181 @@ +google.shopping.merchant.accounts.v1beta.CutoffTime + */ +class CutoffTime extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Hour of the cutoff time until which an order has to be placed to + * be processed in the same day. + * + * Generated from protobuf field optional int32 hour = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $hour = null; + /** + * Required. Minute of the cutoff time until which an order has to be placed + * to be processed in the same day. + * + * Generated from protobuf field optional int32 minute = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $minute = null; + /** + * Required. [Timezone + * identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) + * For example "Europe/Zurich". + * + * Generated from protobuf field optional string time_zone = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $time_zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $hour + * Required. Hour of the cutoff time until which an order has to be placed to + * be processed in the same day. + * @type int $minute + * Required. Minute of the cutoff time until which an order has to be placed + * to be processed in the same day. + * @type string $time_zone + * Required. [Timezone + * identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) + * For example "Europe/Zurich". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. Hour of the cutoff time until which an order has to be placed to + * be processed in the same day. + * + * Generated from protobuf field optional int32 hour = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getHour() + { + return isset($this->hour) ? $this->hour : 0; + } + + public function hasHour() + { + return isset($this->hour); + } + + public function clearHour() + { + unset($this->hour); + } + + /** + * Required. Hour of the cutoff time until which an order has to be placed to + * be processed in the same day. + * + * Generated from protobuf field optional int32 hour = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setHour($var) + { + GPBUtil::checkInt32($var); + $this->hour = $var; + + return $this; + } + + /** + * Required. Minute of the cutoff time until which an order has to be placed + * to be processed in the same day. + * + * Generated from protobuf field optional int32 minute = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMinute() + { + return isset($this->minute) ? $this->minute : 0; + } + + public function hasMinute() + { + return isset($this->minute); + } + + public function clearMinute() + { + unset($this->minute); + } + + /** + * Required. Minute of the cutoff time until which an order has to be placed + * to be processed in the same day. + * + * Generated from protobuf field optional int32 minute = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMinute($var) + { + GPBUtil::checkInt32($var); + $this->minute = $var; + + return $this; + } + + /** + * Required. [Timezone + * identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) + * For example "Europe/Zurich". + * + * Generated from protobuf field optional string time_zone = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTimeZone() + { + return isset($this->time_zone) ? $this->time_zone : ''; + } + + public function hasTimeZone() + { + return isset($this->time_zone); + } + + public function clearTimeZone() + { + unset($this->time_zone); + } + + /** + * Required. [Timezone + * identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) + * For example "Europe/Zurich". + * + * Generated from protobuf field optional string time_zone = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/DeleteAccountRequest.php b/ShoppingMerchantAccounts/src/V1beta/DeleteAccountRequest.php new file mode 100644 index 000000000000..4fffbfe08f22 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/DeleteAccountRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + */ +class DeleteAccountRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the account to delete. + * Format: `accounts/{account}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the account to delete. + * Format: `accounts/{account}` + * Please see {@see AccountsServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\DeleteAccountRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the account to delete. + * Format: `accounts/{account}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the account to delete. + * Format: `accounts/{account}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the account to delete. + * Format: `accounts/{account}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/DeleteRegionRequest.php b/ShoppingMerchantAccounts/src/V1beta/DeleteRegionRequest.php new file mode 100644 index 000000000000..7b67f0e68c31 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/DeleteRegionRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + */ +class DeleteRegionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the region to delete. + * Format: `accounts/{account}/regions/{region}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the region to delete. + * Format: `accounts/{account}/regions/{region}` + * Please see {@see RegionsServiceClient::regionName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\DeleteRegionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the region to delete. + * Format: `accounts/{account}/regions/{region}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the region to delete. + * Format: `accounts/{account}/regions/{region}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the region to delete. + * Format: `accounts/{account}/regions/{region}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/DeleteUserRequest.php b/ShoppingMerchantAccounts/src/V1beta/DeleteUserRequest.php new file mode 100644 index 000000000000..8d43fa48995f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/DeleteUserRequest.php @@ -0,0 +1,97 @@ +google.shopping.merchant.accounts.v1beta.DeleteUserRequest + */ +class DeleteUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the user to delete. + * Format: `accounts/{account}/users/{email}` + * It is also possible to delete the user corresponding to the caller by using + * `me` rather than an email address as in `accounts/{account}/users/me`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the user to delete. + * Format: `accounts/{account}/users/{email}` + * + * It is also possible to delete the user corresponding to the caller by using + * `me` rather than an email address as in `accounts/{account}/users/me`. Please see + * {@see UserServiceClient::userName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\DeleteUserRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the user to delete. + * Format: `accounts/{account}/users/{email}` + * It is also possible to delete the user corresponding to the caller by using + * `me` rather than an email address as in `accounts/{account}/users/me`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\User::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the user to delete. + * Format: `accounts/{account}/users/{email}` + * It is also possible to delete the user corresponding to the caller by using + * `me` rather than an email address as in `accounts/{account}/users/me`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the user to delete. + * Format: `accounts/{account}/users/{email}` + * It is also possible to delete the user corresponding to the caller by using + * `me` rather than an email address as in `accounts/{account}/users/me`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/DeliveryTime.php b/ShoppingMerchantAccounts/src/V1beta/DeliveryTime.php new file mode 100644 index 000000000000..b09d1c03f9d4 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/DeliveryTime.php @@ -0,0 +1,487 @@ +google.shopping.merchant.accounts.v1beta.DeliveryTime + */ +class DeliveryTime extends \Google\Protobuf\Internal\Message +{ + /** + * Minimum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. + * Either `min_transit_days`, `max_transit_days` or + * `transit_time_table` must be set, but not both. + * + * Generated from protobuf field optional int32 min_transit_days = 1; + */ + protected $min_transit_days = null; + /** + * Maximum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. Must be greater than or equal + * to `min_transit_days`. + * + * Generated from protobuf field optional int32 max_transit_days = 2; + */ + protected $max_transit_days = null; + /** + * Business days cutoff time definition. + * If not configured the cutoff time will be defaulted to 8AM PST. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.CutoffTime cutoff_time = 3; + */ + protected $cutoff_time = null; + /** + * Minimum number of business days spent before an order is shipped. + * 0 means same day shipped, 1 means next day shipped. + * + * Generated from protobuf field optional int32 min_handling_days = 4; + */ + protected $min_handling_days = null; + /** + * Maximum number of business days spent before an order is shipped. + * 0 means same day shipped, 1 means next day shipped. + * Must be greater than or equal to `min_handling_days`. + * + * Generated from protobuf field optional int32 max_handling_days = 5; + */ + protected $max_handling_days = null; + /** + * Transit time table, number of business days spent in transit based on row + * and column dimensions. Either `min_transit_days`, `max_transit_days` or + * `transit_time_table` can be set, but not both. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.TransitTable transit_time_table = 6; + */ + protected $transit_time_table = null; + /** + * The business days during which orders can be handled. + * If not provided, Monday to Friday business days will be assumed. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.BusinessDayConfig handling_business_day_config = 7; + */ + protected $handling_business_day_config = null; + /** + * The business days during which orders can be in-transit. + * If not provided, Monday to Friday business days will be assumed. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.BusinessDayConfig transit_business_day_config = 8; + */ + protected $transit_business_day_config = null; + /** + * Optional. Indicates that the delivery time should be calculated per + * warehouse (shipping origin location) based on the settings of the selected + * carrier. When set, no other transit time related field in [delivery + * time][[google.shopping.content.bundles.ShippingSetting.DeliveryTime] should + * be set. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime warehouse_based_delivery_times = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $warehouse_based_delivery_times; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_transit_days + * Minimum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. + * Either `min_transit_days`, `max_transit_days` or + * `transit_time_table` must be set, but not both. + * @type int $max_transit_days + * Maximum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. Must be greater than or equal + * to `min_transit_days`. + * @type \Google\Shopping\Merchant\Accounts\V1beta\CutoffTime $cutoff_time + * Business days cutoff time definition. + * If not configured the cutoff time will be defaulted to 8AM PST. + * @type int $min_handling_days + * Minimum number of business days spent before an order is shipped. + * 0 means same day shipped, 1 means next day shipped. + * @type int $max_handling_days + * Maximum number of business days spent before an order is shipped. + * 0 means same day shipped, 1 means next day shipped. + * Must be greater than or equal to `min_handling_days`. + * @type \Google\Shopping\Merchant\Accounts\V1beta\TransitTable $transit_time_table + * Transit time table, number of business days spent in transit based on row + * and column dimensions. Either `min_transit_days`, `max_transit_days` or + * `transit_time_table` can be set, but not both. + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig $handling_business_day_config + * The business days during which orders can be handled. + * If not provided, Monday to Friday business days will be assumed. + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig $transit_business_day_config + * The business days during which orders can be in-transit. + * If not provided, Monday to Friday business days will be assumed. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\WarehouseBasedDeliveryTime>|\Google\Protobuf\Internal\RepeatedField $warehouse_based_delivery_times + * Optional. Indicates that the delivery time should be calculated per + * warehouse (shipping origin location) based on the settings of the selected + * carrier. When set, no other transit time related field in [delivery + * time][[google.shopping.content.bundles.ShippingSetting.DeliveryTime] should + * be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Minimum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. + * Either `min_transit_days`, `max_transit_days` or + * `transit_time_table` must be set, but not both. + * + * Generated from protobuf field optional int32 min_transit_days = 1; + * @return int + */ + public function getMinTransitDays() + { + return isset($this->min_transit_days) ? $this->min_transit_days : 0; + } + + public function hasMinTransitDays() + { + return isset($this->min_transit_days); + } + + public function clearMinTransitDays() + { + unset($this->min_transit_days); + } + + /** + * Minimum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. + * Either `min_transit_days`, `max_transit_days` or + * `transit_time_table` must be set, but not both. + * + * Generated from protobuf field optional int32 min_transit_days = 1; + * @param int $var + * @return $this + */ + public function setMinTransitDays($var) + { + GPBUtil::checkInt32($var); + $this->min_transit_days = $var; + + return $this; + } + + /** + * Maximum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. Must be greater than or equal + * to `min_transit_days`. + * + * Generated from protobuf field optional int32 max_transit_days = 2; + * @return int + */ + public function getMaxTransitDays() + { + return isset($this->max_transit_days) ? $this->max_transit_days : 0; + } + + public function hasMaxTransitDays() + { + return isset($this->max_transit_days); + } + + public function clearMaxTransitDays() + { + unset($this->max_transit_days); + } + + /** + * Maximum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. Must be greater than or equal + * to `min_transit_days`. + * + * Generated from protobuf field optional int32 max_transit_days = 2; + * @param int $var + * @return $this + */ + public function setMaxTransitDays($var) + { + GPBUtil::checkInt32($var); + $this->max_transit_days = $var; + + return $this; + } + + /** + * Business days cutoff time definition. + * If not configured the cutoff time will be defaulted to 8AM PST. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.CutoffTime cutoff_time = 3; + * @return \Google\Shopping\Merchant\Accounts\V1beta\CutoffTime|null + */ + public function getCutoffTime() + { + return $this->cutoff_time; + } + + public function hasCutoffTime() + { + return isset($this->cutoff_time); + } + + public function clearCutoffTime() + { + unset($this->cutoff_time); + } + + /** + * Business days cutoff time definition. + * If not configured the cutoff time will be defaulted to 8AM PST. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.CutoffTime cutoff_time = 3; + * @param \Google\Shopping\Merchant\Accounts\V1beta\CutoffTime $var + * @return $this + */ + public function setCutoffTime($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\CutoffTime::class); + $this->cutoff_time = $var; + + return $this; + } + + /** + * Minimum number of business days spent before an order is shipped. + * 0 means same day shipped, 1 means next day shipped. + * + * Generated from protobuf field optional int32 min_handling_days = 4; + * @return int + */ + public function getMinHandlingDays() + { + return isset($this->min_handling_days) ? $this->min_handling_days : 0; + } + + public function hasMinHandlingDays() + { + return isset($this->min_handling_days); + } + + public function clearMinHandlingDays() + { + unset($this->min_handling_days); + } + + /** + * Minimum number of business days spent before an order is shipped. + * 0 means same day shipped, 1 means next day shipped. + * + * Generated from protobuf field optional int32 min_handling_days = 4; + * @param int $var + * @return $this + */ + public function setMinHandlingDays($var) + { + GPBUtil::checkInt32($var); + $this->min_handling_days = $var; + + return $this; + } + + /** + * Maximum number of business days spent before an order is shipped. + * 0 means same day shipped, 1 means next day shipped. + * Must be greater than or equal to `min_handling_days`. + * + * Generated from protobuf field optional int32 max_handling_days = 5; + * @return int + */ + public function getMaxHandlingDays() + { + return isset($this->max_handling_days) ? $this->max_handling_days : 0; + } + + public function hasMaxHandlingDays() + { + return isset($this->max_handling_days); + } + + public function clearMaxHandlingDays() + { + unset($this->max_handling_days); + } + + /** + * Maximum number of business days spent before an order is shipped. + * 0 means same day shipped, 1 means next day shipped. + * Must be greater than or equal to `min_handling_days`. + * + * Generated from protobuf field optional int32 max_handling_days = 5; + * @param int $var + * @return $this + */ + public function setMaxHandlingDays($var) + { + GPBUtil::checkInt32($var); + $this->max_handling_days = $var; + + return $this; + } + + /** + * Transit time table, number of business days spent in transit based on row + * and column dimensions. Either `min_transit_days`, `max_transit_days` or + * `transit_time_table` can be set, but not both. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.TransitTable transit_time_table = 6; + * @return \Google\Shopping\Merchant\Accounts\V1beta\TransitTable|null + */ + public function getTransitTimeTable() + { + return $this->transit_time_table; + } + + public function hasTransitTimeTable() + { + return isset($this->transit_time_table); + } + + public function clearTransitTimeTable() + { + unset($this->transit_time_table); + } + + /** + * Transit time table, number of business days spent in transit based on row + * and column dimensions. Either `min_transit_days`, `max_transit_days` or + * `transit_time_table` can be set, but not both. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.TransitTable transit_time_table = 6; + * @param \Google\Shopping\Merchant\Accounts\V1beta\TransitTable $var + * @return $this + */ + public function setTransitTimeTable($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\TransitTable::class); + $this->transit_time_table = $var; + + return $this; + } + + /** + * The business days during which orders can be handled. + * If not provided, Monday to Friday business days will be assumed. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.BusinessDayConfig handling_business_day_config = 7; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig|null + */ + public function getHandlingBusinessDayConfig() + { + return $this->handling_business_day_config; + } + + public function hasHandlingBusinessDayConfig() + { + return isset($this->handling_business_day_config); + } + + public function clearHandlingBusinessDayConfig() + { + unset($this->handling_business_day_config); + } + + /** + * The business days during which orders can be handled. + * If not provided, Monday to Friday business days will be assumed. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.BusinessDayConfig handling_business_day_config = 7; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig $var + * @return $this + */ + public function setHandlingBusinessDayConfig($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig::class); + $this->handling_business_day_config = $var; + + return $this; + } + + /** + * The business days during which orders can be in-transit. + * If not provided, Monday to Friday business days will be assumed. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.BusinessDayConfig transit_business_day_config = 8; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig|null + */ + public function getTransitBusinessDayConfig() + { + return $this->transit_business_day_config; + } + + public function hasTransitBusinessDayConfig() + { + return isset($this->transit_business_day_config); + } + + public function clearTransitBusinessDayConfig() + { + unset($this->transit_business_day_config); + } + + /** + * The business days during which orders can be in-transit. + * If not provided, Monday to Friday business days will be assumed. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.BusinessDayConfig transit_business_day_config = 8; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig $var + * @return $this + */ + public function setTransitBusinessDayConfig($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig::class); + $this->transit_business_day_config = $var; + + return $this; + } + + /** + * Optional. Indicates that the delivery time should be calculated per + * warehouse (shipping origin location) based on the settings of the selected + * carrier. When set, no other transit time related field in [delivery + * time][[google.shopping.content.bundles.ShippingSetting.DeliveryTime] should + * be set. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime warehouse_based_delivery_times = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarehouseBasedDeliveryTimes() + { + return $this->warehouse_based_delivery_times; + } + + /** + * Optional. Indicates that the delivery time should be calculated per + * warehouse (shipping origin location) based on the settings of the selected + * carrier. When set, no other transit time related field in [delivery + * time][[google.shopping.content.bundles.ShippingSetting.DeliveryTime] should + * be set. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime warehouse_based_delivery_times = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\WarehouseBasedDeliveryTime>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarehouseBasedDeliveryTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\WarehouseBasedDeliveryTime::class); + $this->warehouse_based_delivery_times = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/DisableProgramRequest.php b/ShoppingMerchantAccounts/src/V1beta/DisableProgramRequest.php new file mode 100644 index 000000000000..d45d7aeb3377 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/DisableProgramRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.DisableProgramRequest + */ +class DisableProgramRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the program for which to disable participation for + * the given account. Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the program for which to disable participation for + * the given account. Format: `accounts/{account}/programs/{program}` + * Please see {@see ProgramsServiceClient::programName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\DisableProgramRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the program for which to disable participation for + * the given account. Format: `accounts/{account}/programs/{program}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Programs::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the program for which to disable participation for + * the given account. Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the program for which to disable participation for + * the given account. Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Distance.php b/ShoppingMerchantAccounts/src/V1beta/Distance.php new file mode 100644 index 000000000000..48243a4601f3 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Distance.php @@ -0,0 +1,126 @@ +google.shopping.merchant.accounts.v1beta.Distance + */ +class Distance extends \Google\Protobuf\Internal\Message +{ + /** + * Integer value of distance. + * + * Generated from protobuf field optional int64 value = 1; + */ + protected $value = null; + /** + * Unit can differ based on country, it is parameterized to include miles + * and kilometers. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Distance.Unit unit = 2; + */ + protected $unit = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $value + * Integer value of distance. + * @type int $unit + * Unit can differ based on country, it is parameterized to include miles + * and kilometers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Integer value of distance. + * + * Generated from protobuf field optional int64 value = 1; + * @return int|string + */ + public function getValue() + { + return isset($this->value) ? $this->value : 0; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Integer value of distance. + * + * Generated from protobuf field optional int64 value = 1; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + + /** + * Unit can differ based on country, it is parameterized to include miles + * and kilometers. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Distance.Unit unit = 2; + * @return int + */ + public function getUnit() + { + return isset($this->unit) ? $this->unit : 0; + } + + public function hasUnit() + { + return isset($this->unit); + } + + public function clearUnit() + { + unset($this->unit); + } + + /** + * Unit can differ based on country, it is parameterized to include miles + * and kilometers. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Distance.Unit unit = 2; + * @param int $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\Distance\Unit::class); + $this->unit = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Distance/Unit.php b/ShoppingMerchantAccounts/src/V1beta/Distance/Unit.php new file mode 100644 index 000000000000..f36d905b16f0 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Distance/Unit.php @@ -0,0 +1,63 @@ +google.shopping.merchant.accounts.v1beta.Distance.Unit + */ +class Unit +{ + /** + * Unit unspecified + * + * Generated from protobuf enum UNIT_UNSPECIFIED = 0; + */ + const UNIT_UNSPECIFIED = 0; + /** + * Unit in miles + * + * Generated from protobuf enum MILES = 1; + */ + const MILES = 1; + /** + * Unit in kilometers + * + * Generated from protobuf enum KILOMETERS = 2; + */ + const KILOMETERS = 2; + + private static $valueToName = [ + self::UNIT_UNSPECIFIED => 'UNIT_UNSPECIFIED', + self::MILES => 'MILES', + self::KILOMETERS => 'KILOMETERS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/EmailPreferences.php b/ShoppingMerchantAccounts/src/V1beta/EmailPreferences.php new file mode 100644 index 000000000000..719b98fb6dce --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/EmailPreferences.php @@ -0,0 +1,107 @@ +google.shopping.merchant.accounts.v1beta.EmailPreferences + */ +class EmailPreferences extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the EmailPreferences. The endpoint is only + * supported for the authenticated user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. Updates on new features, tips and best practices. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState news_and_tips = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $news_and_tips = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the EmailPreferences. The endpoint is only + * supported for the authenticated user. + * @type int $news_and_tips + * Optional. Updates on new features, tips and best practices. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Emailpreferences::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the EmailPreferences. The endpoint is only + * supported for the authenticated user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the EmailPreferences. The endpoint is only + * supported for the authenticated user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Updates on new features, tips and best practices. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState news_and_tips = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNewsAndTips() + { + return $this->news_and_tips; + } + + /** + * Optional. Updates on new features, tips and best practices. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState news_and_tips = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNewsAndTips($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\EmailPreferences\OptInState::class); + $this->news_and_tips = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/EmailPreferences/OptInState.php b/ShoppingMerchantAccounts/src/V1beta/EmailPreferences/OptInState.php new file mode 100644 index 000000000000..0a7b85c33350 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/EmailPreferences/OptInState.php @@ -0,0 +1,71 @@ +google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState + */ +class OptInState +{ + /** + * Opt-in status is not specified. + * + * Generated from protobuf enum OPT_IN_STATE_UNSPECIFIED = 0; + */ + const OPT_IN_STATE_UNSPECIFIED = 0; + /** + * User has opted out of receiving this type of email. + * + * Generated from protobuf enum OPTED_OUT = 1; + */ + const OPTED_OUT = 1; + /** + * User has opted in to receiving this type of email. + * + * Generated from protobuf enum OPTED_IN = 2; + */ + const OPTED_IN = 2; + /** + * User has opted in to receiving this type of email and the confirmation + * email has been sent, but user has not yet confirmed the opt in (applies + * only to certain countries). + * + * Generated from protobuf enum UNCONFIRMED = 3; + */ + const UNCONFIRMED = 3; + + private static $valueToName = [ + self::OPT_IN_STATE_UNSPECIFIED => 'OPT_IN_STATE_UNSPECIFIED', + self::OPTED_OUT => 'OPTED_OUT', + self::OPTED_IN => 'OPTED_IN', + self::UNCONFIRMED => 'UNCONFIRMED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/EnableProgramRequest.php b/ShoppingMerchantAccounts/src/V1beta/EnableProgramRequest.php new file mode 100644 index 000000000000..053b5962c902 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/EnableProgramRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.EnableProgramRequest + */ +class EnableProgramRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the program for which to enable participation for the + * given account. Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the program for which to enable participation for the + * given account. Format: `accounts/{account}/programs/{program}` + * Please see {@see ProgramsServiceClient::programName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\EnableProgramRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the program for which to enable participation for the + * given account. Format: `accounts/{account}/programs/{program}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Programs::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the program for which to enable participation for the + * given account. Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the program for which to enable participation for the + * given account. Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetAccountRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetAccountRequest.php new file mode 100644 index 000000000000..631a4ef161aa --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetAccountRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetAccountRequest + */ +class GetAccountRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the account to retrieve. + * Format: `accounts/{account}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the account to retrieve. + * Format: `accounts/{account}` + * Please see {@see AccountsServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetAccountRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the account to retrieve. + * Format: `accounts/{account}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the account to retrieve. + * Format: `accounts/{account}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the account to retrieve. + * Format: `accounts/{account}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetAccountTaxRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetAccountTaxRequest.php new file mode 100644 index 000000000000..0ac30088d6f7 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetAccountTaxRequest.php @@ -0,0 +1,81 @@ +google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + */ +class GetAccountTaxRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name from which tax settings will be retrieved + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name from which tax settings will be retrieved + * Please see {@see AccountTaxServiceClient::accountTaxName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetAccountTaxRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name from which tax settings will be retrieved + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\AccountTax::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name from which tax settings will be retrieved + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name from which tax settings will be retrieved + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetBusinessIdentityRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetBusinessIdentityRequest.php new file mode 100644 index 000000000000..9972f6ca7759 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetBusinessIdentityRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + */ +class GetBusinessIdentityRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * Please see {@see BusinessIdentityServiceClient::businessIdentityName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetBusinessIdentityRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Businessidentity::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetBusinessInfoRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetBusinessInfoRequest.php new file mode 100644 index 000000000000..3504bff8c2a2 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetBusinessInfoRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + */ +class GetBusinessInfoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * Please see {@see BusinessInfoServiceClient::businessInfoName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetBusinessInfoRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Businessinfo::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetEmailPreferencesRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetEmailPreferencesRequest.php new file mode 100644 index 000000000000..2f35d48d8844 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetEmailPreferencesRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + */ +class GetEmailPreferencesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the `EmailPreferences` resource. + * Format: `accounts/{account}/users/{email}/emailPreferences` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the `EmailPreferences` resource. + * Format: `accounts/{account}/users/{email}/emailPreferences` + * Please see {@see EmailPreferencesServiceClient::emailPreferencesName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetEmailPreferencesRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the `EmailPreferences` resource. + * Format: `accounts/{account}/users/{email}/emailPreferences` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Emailpreferences::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the `EmailPreferences` resource. + * Format: `accounts/{account}/users/{email}/emailPreferences` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the `EmailPreferences` resource. + * Format: `accounts/{account}/users/{email}/emailPreferences` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetHomepageRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetHomepageRequest.php new file mode 100644 index 000000000000..9754b2ec8f7e --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetHomepageRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetHomepageRequest + */ +class GetHomepageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the homepage to retrieve. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the homepage to retrieve. + * Format: `accounts/{account}/homepage` + * Please see {@see HomepageServiceClient::homepageName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetHomepageRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the homepage to retrieve. + * Format: `accounts/{account}/homepage` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Homepage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the homepage to retrieve. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the homepage to retrieve. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetOnlineReturnPolicyRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetOnlineReturnPolicyRequest.php new file mode 100644 index 000000000000..3a0a018fba55 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetOnlineReturnPolicyRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + */ +class GetOnlineReturnPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the return policy to retrieve. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the return policy to retrieve. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * Please see {@see OnlineReturnPolicyServiceClient::onlineReturnPolicyName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetOnlineReturnPolicyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the return policy to retrieve. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\OnlineReturnPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the return policy to retrieve. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the return policy to retrieve. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetProgramRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetProgramRequest.php new file mode 100644 index 000000000000..74ab12ce2057 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetProgramRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetProgramRequest + */ +class GetProgramRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the program to retrieve. + * Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the program to retrieve. + * Format: `accounts/{account}/programs/{program}` + * Please see {@see ProgramsServiceClient::programName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetProgramRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the program to retrieve. + * Format: `accounts/{account}/programs/{program}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Programs::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the program to retrieve. + * Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the program to retrieve. + * Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetRegionRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetRegionRequest.php new file mode 100644 index 000000000000..c6522e48cc26 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetRegionRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetRegionRequest + */ +class GetRegionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the region to retrieve. + * Format: `accounts/{account}/regions/{region}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the region to retrieve. + * Format: `accounts/{account}/regions/{region}` + * Please see {@see RegionsServiceClient::regionName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetRegionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the region to retrieve. + * Format: `accounts/{account}/regions/{region}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the region to retrieve. + * Format: `accounts/{account}/regions/{region}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the region to retrieve. + * Format: `accounts/{account}/regions/{region}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetShippingSettingsRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetShippingSettingsRequest.php new file mode 100644 index 000000000000..23a535a79619 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetShippingSettingsRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + */ +class GetShippingSettingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the shipping setting to retrieve. + * Format: `accounts/{account}/shippingsetting` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the shipping setting to retrieve. + * Format: `accounts/{account}/shippingsetting` + * Please see {@see ShippingSettingsServiceClient::shippingSettingsName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetShippingSettingsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the shipping setting to retrieve. + * Format: `accounts/{account}/shippingsetting` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the shipping setting to retrieve. + * Format: `accounts/{account}/shippingsetting` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the shipping setting to retrieve. + * Format: `accounts/{account}/shippingsetting` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetTermsOfServiceAgreementStateRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetTermsOfServiceAgreementStateRequest.php new file mode 100644 index 000000000000..61f09bfa276d --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetTermsOfServiceAgreementStateRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + */ +class GetTermsOfServiceAgreementStateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * Please see {@see TermsOfServiceAgreementStateServiceClient::termsOfServiceAgreementStateName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetTermsOfServiceAgreementStateRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Termsofserviceagreementstate::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetTermsOfServiceRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetTermsOfServiceRequest.php new file mode 100644 index 000000000000..909418d67a77 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetTermsOfServiceRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + */ +class GetTermsOfServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * Please see {@see TermsOfServiceServiceClient::termsOfServiceName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetTermsOfServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Termsofservice::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/GetUserRequest.php b/ShoppingMerchantAccounts/src/V1beta/GetUserRequest.php new file mode 100644 index 000000000000..206b970077de --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/GetUserRequest.php @@ -0,0 +1,102 @@ +google.shopping.merchant.accounts.v1beta.GetUserRequest + */ +class GetUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the user to retrieve. + * Format: `accounts/{account}/users/{email}` + * It is also possible to retrieve the user corresponding to the caller by + * using `me` rather than an email address as in + * `accounts/{account}/users/me`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the user to retrieve. + * Format: `accounts/{account}/users/{email}` + * + * It is also possible to retrieve the user corresponding to the caller by + * using `me` rather than an email address as in + * `accounts/{account}/users/me`. Please see + * {@see UserServiceClient::userName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\GetUserRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the user to retrieve. + * Format: `accounts/{account}/users/{email}` + * It is also possible to retrieve the user corresponding to the caller by + * using `me` rather than an email address as in + * `accounts/{account}/users/me`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\User::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the user to retrieve. + * Format: `accounts/{account}/users/{email}` + * It is also possible to retrieve the user corresponding to the caller by + * using `me` rather than an email address as in + * `accounts/{account}/users/me`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the user to retrieve. + * Format: `accounts/{account}/users/{email}` + * It is also possible to retrieve the user corresponding to the caller by + * using `me` rather than an email address as in + * `accounts/{account}/users/me`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Headers.php b/ShoppingMerchantAccounts/src/V1beta/Headers.php new file mode 100644 index 000000000000..590857b53dfe --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Headers.php @@ -0,0 +1,302 @@ +google.shopping.merchant.accounts.v1beta.Headers + */ +class Headers extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of inclusive order price upper bounds. The last price's + * value can be infinity by setting price amount_micros = -1. For example + * `[{"amount_micros": 10000000, "currency_code": "USD"}, + * {"amount_micros": 500000000, "currency_code": "USD"}, + * {"amount_micros": -1, "currency_code": "USD"}]` represents the headers + * "<= $10", "<= $500", and "> $500". All prices within a service must have + * the same currency. Must be non-empty. Must be positive except -1. Can only + * be set if all other fields are not set. + * + * Generated from protobuf field repeated .google.shopping.type.Price prices = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $prices; + /** + * Required. A list of inclusive order weight upper bounds. The last weight's + * value can be infinity by setting price amount_micros = -1. For example + * `[{"amount_micros": 10000000, "unit": "kg"}, {"amount_micros": 50000000, + * "unit": "kg"}, + * {"amount_micros": -1, "unit": "kg"}]` represents the headers + * "<= 10kg", "<= 50kg", and "> 50kg". All weights within a service must have + * the same unit. Must be non-empty. Must be positive except -1. Can only be + * set if all other fields are not set. + * + * Generated from protobuf field repeated .google.shopping.type.Weight weights = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $weights; + /** + * Required. A list of inclusive number of items upper bounds. The last value + * can be + * `"infinity"`. For example + * `["10", "50", "infinity"]` represents the headers + * "<= 10 items", "<= 50 items", and "> 50 items". Must be non-empty. Can + * only be set if all other fields are not set. + * + * Generated from protobuf field repeated string number_of_items = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $number_of_items; + /** + * Required. A list of postal group names. The last value can be + * `"all other locations"`. Example: + * `["zone 1", "zone 2", "all other locations"]`. The referred + * postal code groups must match the delivery country of the service. Must + * be non-empty. Can only be set if all other fields are not set. + * + * Generated from protobuf field repeated string postal_code_group_names = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $postal_code_group_names; + /** + * Required. A list of location ID sets. Must be non-empty. Can only be set if + * all other fields are not set. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.LocationIdSet locations = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + private $locations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Type\Price>|\Google\Protobuf\Internal\RepeatedField $prices + * Required. A list of inclusive order price upper bounds. The last price's + * value can be infinity by setting price amount_micros = -1. For example + * `[{"amount_micros": 10000000, "currency_code": "USD"}, + * {"amount_micros": 500000000, "currency_code": "USD"}, + * {"amount_micros": -1, "currency_code": "USD"}]` represents the headers + * "<= $10", "<= $500", and "> $500". All prices within a service must have + * the same currency. Must be non-empty. Must be positive except -1. Can only + * be set if all other fields are not set. + * @type array<\Google\Shopping\Type\Weight>|\Google\Protobuf\Internal\RepeatedField $weights + * Required. A list of inclusive order weight upper bounds. The last weight's + * value can be infinity by setting price amount_micros = -1. For example + * `[{"amount_micros": 10000000, "unit": "kg"}, {"amount_micros": 50000000, + * "unit": "kg"}, + * {"amount_micros": -1, "unit": "kg"}]` represents the headers + * "<= 10kg", "<= 50kg", and "> 50kg". All weights within a service must have + * the same unit. Must be non-empty. Must be positive except -1. Can only be + * set if all other fields are not set. + * @type array|\Google\Protobuf\Internal\RepeatedField $number_of_items + * Required. A list of inclusive number of items upper bounds. The last value + * can be + * `"infinity"`. For example + * `["10", "50", "infinity"]` represents the headers + * "<= 10 items", "<= 50 items", and "> 50 items". Must be non-empty. Can + * only be set if all other fields are not set. + * @type array|\Google\Protobuf\Internal\RepeatedField $postal_code_group_names + * Required. A list of postal group names. The last value can be + * `"all other locations"`. Example: + * `["zone 1", "zone 2", "all other locations"]`. The referred + * postal code groups must match the delivery country of the service. Must + * be non-empty. Can only be set if all other fields are not set. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\LocationIdSet>|\Google\Protobuf\Internal\RepeatedField $locations + * Required. A list of location ID sets. Must be non-empty. Can only be set if + * all other fields are not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of inclusive order price upper bounds. The last price's + * value can be infinity by setting price amount_micros = -1. For example + * `[{"amount_micros": 10000000, "currency_code": "USD"}, + * {"amount_micros": 500000000, "currency_code": "USD"}, + * {"amount_micros": -1, "currency_code": "USD"}]` represents the headers + * "<= $10", "<= $500", and "> $500". All prices within a service must have + * the same currency. Must be non-empty. Must be positive except -1. Can only + * be set if all other fields are not set. + * + * Generated from protobuf field repeated .google.shopping.type.Price prices = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPrices() + { + return $this->prices; + } + + /** + * Required. A list of inclusive order price upper bounds. The last price's + * value can be infinity by setting price amount_micros = -1. For example + * `[{"amount_micros": 10000000, "currency_code": "USD"}, + * {"amount_micros": 500000000, "currency_code": "USD"}, + * {"amount_micros": -1, "currency_code": "USD"}]` represents the headers + * "<= $10", "<= $500", and "> $500". All prices within a service must have + * the same currency. Must be non-empty. Must be positive except -1. Can only + * be set if all other fields are not set. + * + * Generated from protobuf field repeated .google.shopping.type.Price prices = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Shopping\Type\Price>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPrices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Type\Price::class); + $this->prices = $arr; + + return $this; + } + + /** + * Required. A list of inclusive order weight upper bounds. The last weight's + * value can be infinity by setting price amount_micros = -1. For example + * `[{"amount_micros": 10000000, "unit": "kg"}, {"amount_micros": 50000000, + * "unit": "kg"}, + * {"amount_micros": -1, "unit": "kg"}]` represents the headers + * "<= 10kg", "<= 50kg", and "> 50kg". All weights within a service must have + * the same unit. Must be non-empty. Must be positive except -1. Can only be + * set if all other fields are not set. + * + * Generated from protobuf field repeated .google.shopping.type.Weight weights = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWeights() + { + return $this->weights; + } + + /** + * Required. A list of inclusive order weight upper bounds. The last weight's + * value can be infinity by setting price amount_micros = -1. For example + * `[{"amount_micros": 10000000, "unit": "kg"}, {"amount_micros": 50000000, + * "unit": "kg"}, + * {"amount_micros": -1, "unit": "kg"}]` represents the headers + * "<= 10kg", "<= 50kg", and "> 50kg". All weights within a service must have + * the same unit. Must be non-empty. Must be positive except -1. Can only be + * set if all other fields are not set. + * + * Generated from protobuf field repeated .google.shopping.type.Weight weights = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Shopping\Type\Weight>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWeights($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Type\Weight::class); + $this->weights = $arr; + + return $this; + } + + /** + * Required. A list of inclusive number of items upper bounds. The last value + * can be + * `"infinity"`. For example + * `["10", "50", "infinity"]` represents the headers + * "<= 10 items", "<= 50 items", and "> 50 items". Must be non-empty. Can + * only be set if all other fields are not set. + * + * Generated from protobuf field repeated string number_of_items = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNumberOfItems() + { + return $this->number_of_items; + } + + /** + * Required. A list of inclusive number of items upper bounds. The last value + * can be + * `"infinity"`. For example + * `["10", "50", "infinity"]` represents the headers + * "<= 10 items", "<= 50 items", and "> 50 items". Must be non-empty. Can + * only be set if all other fields are not set. + * + * Generated from protobuf field repeated string number_of_items = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNumberOfItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->number_of_items = $arr; + + return $this; + } + + /** + * Required. A list of postal group names. The last value can be + * `"all other locations"`. Example: + * `["zone 1", "zone 2", "all other locations"]`. The referred + * postal code groups must match the delivery country of the service. Must + * be non-empty. Can only be set if all other fields are not set. + * + * Generated from protobuf field repeated string postal_code_group_names = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPostalCodeGroupNames() + { + return $this->postal_code_group_names; + } + + /** + * Required. A list of postal group names. The last value can be + * `"all other locations"`. Example: + * `["zone 1", "zone 2", "all other locations"]`. The referred + * postal code groups must match the delivery country of the service. Must + * be non-empty. Can only be set if all other fields are not set. + * + * Generated from protobuf field repeated string postal_code_group_names = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPostalCodeGroupNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->postal_code_group_names = $arr; + + return $this; + } + + /** + * Required. A list of location ID sets. Must be non-empty. Can only be set if + * all other fields are not set. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.LocationIdSet locations = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLocations() + { + return $this->locations; + } + + /** + * Required. A list of location ID sets. Must be non-empty. Can only be set if + * all other fields are not set. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.LocationIdSet locations = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\LocationIdSet>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\LocationIdSet::class); + $this->locations = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Homepage.php b/ShoppingMerchantAccounts/src/V1beta/Homepage.php new file mode 100644 index 000000000000..d3165059ba9e --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Homepage.php @@ -0,0 +1,153 @@ +google.shopping.merchant.accounts.v1beta.Homepage + */ +class Homepage extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the store's homepage. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. The URI (typically a URL) of the store's homepage. + * + * Generated from protobuf field optional string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = null; + /** + * Output only. Whether the homepage is claimed. See + * https://support.google.com/merchants/answer/176793. + * + * Generated from protobuf field bool claimed = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $claimed = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the store's homepage. + * Format: `accounts/{account}/homepage` + * @type string $uri + * Required. The URI (typically a URL) of the store's homepage. + * @type bool $claimed + * Output only. Whether the homepage is claimed. See + * https://support.google.com/merchants/answer/176793. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Homepage::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the store's homepage. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the store's homepage. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The URI (typically a URL) of the store's homepage. + * + * Generated from protobuf field optional string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return isset($this->uri) ? $this->uri : ''; + } + + public function hasUri() + { + return isset($this->uri); + } + + public function clearUri() + { + unset($this->uri); + } + + /** + * Required. The URI (typically a URL) of the store's homepage. + * + * Generated from protobuf field optional string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Output only. Whether the homepage is claimed. See + * https://support.google.com/merchants/answer/176793. + * + * Generated from protobuf field bool claimed = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getClaimed() + { + return $this->claimed; + } + + /** + * Output only. Whether the homepage is claimed. See + * https://support.google.com/merchants/answer/176793. + * + * Generated from protobuf field bool claimed = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setClaimed($var) + { + GPBUtil::checkBool($var); + $this->claimed = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/InsertShippingSettingsRequest.php b/ShoppingMerchantAccounts/src/V1beta/InsertShippingSettingsRequest.php new file mode 100644 index 000000000000..b7c047b3c076 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/InsertShippingSettingsRequest.php @@ -0,0 +1,115 @@ +google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + */ +class InsertShippingSettingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account where this product will be inserted. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The new version of the account. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.ShippingSettings shipping_setting = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $shipping_setting = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account where this product will be inserted. + * Format: accounts/{account} + * @type \Google\Shopping\Merchant\Accounts\V1beta\ShippingSettings $shipping_setting + * Required. The new version of the account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account where this product will be inserted. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account where this product will be inserted. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The new version of the account. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.ShippingSettings shipping_setting = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\ShippingSettings|null + */ + public function getShippingSetting() + { + return $this->shipping_setting; + } + + public function hasShippingSetting() + { + return isset($this->shipping_setting); + } + + public function clearShippingSetting() + { + unset($this->shipping_setting); + } + + /** + * Required. The new version of the account. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.ShippingSettings shipping_setting = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\ShippingSettings $var + * @return $this + */ + public function setShippingSetting($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\ShippingSettings::class); + $this->shipping_setting = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListAccountIssuesRequest.php b/ShoppingMerchantAccounts/src/V1beta/ListAccountIssuesRequest.php new file mode 100644 index 000000000000..9a4b880efad8 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListAccountIssuesRequest.php @@ -0,0 +1,272 @@ +google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + */ +class ListAccountIssuesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of issues. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of issues to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListAccountIssues` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccountIssues` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The issues in the response will have human-readable fields in the + * given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47), + * such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be + * used. + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The [IANA](https://www.iana.org/time-zones) timezone used to + * localize times in human-readable fields. For example 'America/Los_Angeles'. + * If not set, 'America/Los_Angeles' will be used. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $time_zone = null; + + /** + * @param string $parent Required. The parent, which owns this collection of issues. + * Format: `accounts/{account}` + * Please see {@see AccountIssueServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\ListAccountIssuesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of issues. + * Format: `accounts/{account}` + * @type int $page_size + * Optional. The maximum number of issues to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * @type string $page_token + * Optional. A page token, received from a previous `ListAccountIssues` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccountIssues` must + * match the call that provided the page token. + * @type string $language_code + * Optional. The issues in the response will have human-readable fields in the + * given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47), + * such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be + * used. + * @type \Google\Type\TimeZone $time_zone + * Optional. The [IANA](https://www.iana.org/time-zones) timezone used to + * localize times in human-readable fields. For example 'America/Los_Angeles'. + * If not set, 'America/Los_Angeles' will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accountissue::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of issues. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of issues. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of issues to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of issues to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListAccountIssues` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccountIssues` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListAccountIssues` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccountIssues` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The issues in the response will have human-readable fields in the + * given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47), + * such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be + * used. + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The issues in the response will have human-readable fields in the + * given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47), + * such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be + * used. + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The [IANA](https://www.iana.org/time-zones) timezone used to + * localize times in human-readable fields. For example 'America/Los_Angeles'. + * If not set, 'America/Los_Angeles' will be used. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Type\TimeZone|null + */ + public function getTimeZone() + { + return $this->time_zone; + } + + public function hasTimeZone() + { + return isset($this->time_zone); + } + + public function clearTimeZone() + { + unset($this->time_zone); + } + + /** + * Optional. The [IANA](https://www.iana.org/time-zones) timezone used to + * localize times in human-readable fields. For example 'America/Los_Angeles'. + * If not set, 'America/Los_Angeles' will be used. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Type\TimeZone $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeZone::class); + $this->time_zone = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListAccountIssuesResponse.php b/ShoppingMerchantAccounts/src/V1beta/ListAccountIssuesResponse.php new file mode 100644 index 000000000000..d628fd7c1f98 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListAccountIssuesResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + */ +class ListAccountIssuesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The issues from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountIssue account_issues = 1; + */ + private $account_issues; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\AccountIssue>|\Google\Protobuf\Internal\RepeatedField $account_issues + * The issues from the specified account. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accountissue::initOnce(); + parent::__construct($data); + } + + /** + * The issues from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountIssue account_issues = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccountIssues() + { + return $this->account_issues; + } + + /** + * The issues from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountIssue account_issues = 1; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\AccountIssue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccountIssues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\AccountIssue::class); + $this->account_issues = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListAccountTaxRequest.php b/ShoppingMerchantAccounts/src/V1beta/ListAccountTaxRequest.php new file mode 100644 index 000000000000..0bc45dadbf86 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListAccountTaxRequest.php @@ -0,0 +1,160 @@ +google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + */ +class ListAccountTaxRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of account tax. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of tax settings to return in the response, used for + * paging. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The token returned by the previous request. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent, which owns this collection of account tax. + * Format: accounts/{account} + * Please see {@see AccountTaxServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\ListAccountTaxRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of account tax. + * Format: accounts/{account} + * @type int $page_size + * The maximum number of tax settings to return in the response, used for + * paging. + * @type string $page_token + * The token returned by the previous request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\AccountTax::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of account tax. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of account tax. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of tax settings to return in the response, used for + * paging. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of tax settings to return in the response, used for + * paging. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The token returned by the previous request. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The token returned by the previous request. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListAccountTaxResponse.php b/ShoppingMerchantAccounts/src/V1beta/ListAccountTaxResponse.php new file mode 100644 index 000000000000..886d936394fb --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListAccountTaxResponse.php @@ -0,0 +1,103 @@ +google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + */ +class ListAccountTaxResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Page of accounttax settings + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountTax account_taxes = 1; + */ + private $account_taxes; + /** + * The token for the retrieval of the next page of account tax settings. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\AccountTax>|\Google\Protobuf\Internal\RepeatedField $account_taxes + * Page of accounttax settings + * @type string $next_page_token + * The token for the retrieval of the next page of account tax settings. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\AccountTax::initOnce(); + parent::__construct($data); + } + + /** + * Page of accounttax settings + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountTax account_taxes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccountTaxes() + { + return $this->account_taxes; + } + + /** + * Page of accounttax settings + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccountTax account_taxes = 1; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\AccountTax>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccountTaxes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\AccountTax::class); + $this->account_taxes = $arr; + + return $this; + } + + /** + * The token for the retrieval of the next page of account tax settings. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token for the retrieval of the next page of account tax settings. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListAccountsRequest.php b/ShoppingMerchantAccounts/src/V1beta/ListAccountsRequest.php new file mode 100644 index 000000000000..8f6df5eeb323 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListAccountsRequest.php @@ -0,0 +1,167 @@ +google.shopping.merchant.accounts.v1beta.ListAccountsRequest + */ +class ListAccountsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Returns only accounts that match the + * [filter](/merchant/api/guides/accounts/filter). + * For more details, see the + * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_size + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * @type string $page_token + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * @type string $filter + * Optional. Returns only accounts that match the + * [filter](/merchant/api/guides/accounts/filter). + * For more details, see the + * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Returns only accounts that match the + * [filter](/merchant/api/guides/accounts/filter). + * For more details, see the + * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Returns only accounts that match the + * [filter](/merchant/api/guides/accounts/filter). + * For more details, see the + * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListAccountsResponse.php b/ShoppingMerchantAccounts/src/V1beta/ListAccountsResponse.php new file mode 100644 index 000000000000..2657571c726f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListAccountsResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.accounts.v1beta.ListAccountsResponse + */ +class ListAccountsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The accounts matching the `ListAccountsRequest`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Account accounts = 1; + */ + private $accounts; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Account>|\Google\Protobuf\Internal\RepeatedField $accounts + * The accounts matching the `ListAccountsRequest`. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * The accounts matching the `ListAccountsRequest`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Account accounts = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccounts() + { + return $this->accounts; + } + + /** + * The accounts matching the `ListAccountsRequest`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Account accounts = 1; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Account>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Account::class); + $this->accounts = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListOnlineReturnPoliciesRequest.php b/ShoppingMerchantAccounts/src/V1beta/ListOnlineReturnPoliciesRequest.php new file mode 100644 index 000000000000..28df898b100c --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListOnlineReturnPoliciesRequest.php @@ -0,0 +1,194 @@ +google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + */ +class ListOnlineReturnPoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The merchant account for which to list return policies. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `OnlineReturnPolicy` resources to return. + * The service returns fewer than this value if the number of return policies + * for the given merchant is less that than the `pageSize`. The default value + * is 10. The maximum value is 100; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListOnlineReturnPolicies` + * call. Provide the page token to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListOnlineReturnPolicies` must match the call that provided the page + * token. The token returned as + * [nextPageToken][google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token] + * in the response to the previous request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The merchant account for which to list return policies. + * Format: `accounts/{account}` + * Please see {@see OnlineReturnPolicyServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\ListOnlineReturnPoliciesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The merchant account for which to list return policies. + * Format: `accounts/{account}` + * @type int $page_size + * Optional. The maximum number of `OnlineReturnPolicy` resources to return. + * The service returns fewer than this value if the number of return policies + * for the given merchant is less that than the `pageSize`. The default value + * is 10. The maximum value is 100; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum + * @type string $page_token + * Optional. A page token, received from a previous `ListOnlineReturnPolicies` + * call. Provide the page token to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListOnlineReturnPolicies` must match the call that provided the page + * token. The token returned as + * [nextPageToken][google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token] + * in the response to the previous request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\OnlineReturnPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The merchant account for which to list return policies. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The merchant account for which to list return policies. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `OnlineReturnPolicy` resources to return. + * The service returns fewer than this value if the number of return policies + * for the given merchant is less that than the `pageSize`. The default value + * is 10. The maximum value is 100; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `OnlineReturnPolicy` resources to return. + * The service returns fewer than this value if the number of return policies + * for the given merchant is less that than the `pageSize`. The default value + * is 10. The maximum value is 100; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListOnlineReturnPolicies` + * call. Provide the page token to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListOnlineReturnPolicies` must match the call that provided the page + * token. The token returned as + * [nextPageToken][google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token] + * in the response to the previous request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListOnlineReturnPolicies` + * call. Provide the page token to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListOnlineReturnPolicies` must match the call that provided the page + * token. The token returned as + * [nextPageToken][google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token] + * in the response to the previous request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListOnlineReturnPoliciesResponse.php b/ShoppingMerchantAccounts/src/V1beta/ListOnlineReturnPoliciesResponse.php new file mode 100644 index 000000000000..5c81dd796a21 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListOnlineReturnPoliciesResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + */ +class ListOnlineReturnPoliciesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The retrieved return policies. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy online_return_policies = 1; + */ + private $online_return_policies; + /** + * A token, which can be sent as `pageToken` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy>|\Google\Protobuf\Internal\RepeatedField $online_return_policies + * The retrieved return policies. + * @type string $next_page_token + * A token, which can be sent as `pageToken` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\OnlineReturnPolicy::initOnce(); + parent::__construct($data); + } + + /** + * The retrieved return policies. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy online_return_policies = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOnlineReturnPolicies() + { + return $this->online_return_policies; + } + + /** + * The retrieved return policies. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy online_return_policies = 1; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOnlineReturnPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy::class); + $this->online_return_policies = $arr; + + return $this; + } + + /** + * A token, which can be sent as `pageToken` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `pageToken` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListProgramsRequest.php b/ShoppingMerchantAccounts/src/V1beta/ListProgramsRequest.php new file mode 100644 index 000000000000..058e8e269f61 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListProgramsRequest.php @@ -0,0 +1,166 @@ +google.shopping.merchant.accounts.v1beta.ListProgramsRequest + */ +class ListProgramsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the account for which to retrieve all programs. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of programs to return in a single response. If + * unspecified (or 0), a default size of 1000 is used. The maximum value is + * 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A continuation token, received from a previous `ListPrograms` + * call. Provide this to retrieve the next page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the account for which to retrieve all programs. + * Format: `accounts/{account}` + * Please see {@see ProgramsServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\ListProgramsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the account for which to retrieve all programs. + * Format: `accounts/{account}` + * @type int $page_size + * Optional. The maximum number of programs to return in a single response. If + * unspecified (or 0), a default size of 1000 is used. The maximum value is + * 1000; values above 1000 will be coerced to 1000. + * @type string $page_token + * Optional. A continuation token, received from a previous `ListPrograms` + * call. Provide this to retrieve the next page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Programs::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the account for which to retrieve all programs. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the account for which to retrieve all programs. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of programs to return in a single response. If + * unspecified (or 0), a default size of 1000 is used. The maximum value is + * 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of programs to return in a single response. If + * unspecified (or 0), a default size of 1000 is used. The maximum value is + * 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A continuation token, received from a previous `ListPrograms` + * call. Provide this to retrieve the next page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A continuation token, received from a previous `ListPrograms` + * call. Provide this to retrieve the next page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListProgramsResponse.php b/ShoppingMerchantAccounts/src/V1beta/ListProgramsResponse.php new file mode 100644 index 000000000000..1fde590a5c20 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListProgramsResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.accounts.v1beta.ListProgramsResponse + */ +class ListProgramsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The programs for the given account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Program programs = 1; + */ + private $programs; + /** + * A token that can be sent as `page_token` to retrieve the next page. If this + * field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Program>|\Google\Protobuf\Internal\RepeatedField $programs + * The programs for the given account. + * @type string $next_page_token + * A token that can be sent as `page_token` to retrieve the next page. If this + * field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Programs::initOnce(); + parent::__construct($data); + } + + /** + * The programs for the given account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Program programs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPrograms() + { + return $this->programs; + } + + /** + * The programs for the given account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Program programs = 1; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Program>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPrograms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Program::class); + $this->programs = $arr; + + return $this; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. If this + * field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. If this + * field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListRegionsRequest.php b/ShoppingMerchantAccounts/src/V1beta/ListRegionsRequest.php new file mode 100644 index 000000000000..7ac56faeee04 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListRegionsRequest.php @@ -0,0 +1,178 @@ +google.shopping.merchant.accounts.v1beta.ListRegionsRequest + */ +class ListRegionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account to list regions for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of regions to return. The service may return + * fewer than this value. + * If unspecified, at most 50 regions will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListRegions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRegions` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The account to list regions for. + * Format: `accounts/{account}` + * Please see {@see RegionsServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\ListRegionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account to list regions for. + * Format: `accounts/{account}` + * @type int $page_size + * Optional. The maximum number of regions to return. The service may return + * fewer than this value. + * If unspecified, at most 50 regions will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListRegions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRegions` must + * match the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account to list regions for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account to list regions for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of regions to return. The service may return + * fewer than this value. + * If unspecified, at most 50 regions will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of regions to return. The service may return + * fewer than this value. + * If unspecified, at most 50 regions will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListRegions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRegions` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListRegions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRegions` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListRegionsResponse.php b/ShoppingMerchantAccounts/src/V1beta/ListRegionsResponse.php new file mode 100644 index 000000000000..2808b4627115 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListRegionsResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.accounts.v1beta.ListRegionsResponse + */ +class ListRegionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The regions from the specified merchant. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Region regions = 1; + */ + private $regions; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Region>|\Google\Protobuf\Internal\RepeatedField $regions + * The regions from the specified merchant. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * The regions from the specified merchant. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Region regions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRegions() + { + return $this->regions; + } + + /** + * The regions from the specified merchant. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Region regions = 1; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Region>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRegions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Region::class); + $this->regions = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListSubAccountsRequest.php b/ShoppingMerchantAccounts/src/V1beta/ListSubAccountsRequest.php new file mode 100644 index 000000000000..b2c73ff68b86 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListSubAccountsRequest.php @@ -0,0 +1,174 @@ +google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + */ +class ListSubAccountsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent account. + * Format: `accounts/{account}` + * + * Generated from protobuf field string provider = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $provider = ''; + /** + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $provider Required. The parent account. + * Format: `accounts/{account}` + * Please see {@see AccountsServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\ListSubAccountsRequest + * + * @experimental + */ + public static function build(string $provider): self + { + return (new self()) + ->setProvider($provider); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $provider + * Required. The parent account. + * Format: `accounts/{account}` + * @type int $page_size + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * @type string $page_token + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent account. + * Format: `accounts/{account}` + * + * Generated from protobuf field string provider = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProvider() + { + return $this->provider; + } + + /** + * Required. The parent account. + * Format: `accounts/{account}` + * + * Generated from protobuf field string provider = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProvider($var) + { + GPBUtil::checkString($var, True); + $this->provider = $var; + + return $this; + } + + /** + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListSubAccountsResponse.php b/ShoppingMerchantAccounts/src/V1beta/ListSubAccountsResponse.php new file mode 100644 index 000000000000..92b97a283909 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListSubAccountsResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + */ +class ListSubAccountsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The accounts for which the given parent account is an aggregator. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Account accounts = 1; + */ + private $accounts; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Account>|\Google\Protobuf\Internal\RepeatedField $accounts + * The accounts for which the given parent account is an aggregator. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * The accounts for which the given parent account is an aggregator. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Account accounts = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccounts() + { + return $this->accounts; + } + + /** + * The accounts for which the given parent account is an aggregator. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Account accounts = 1; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Account>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Account::class); + $this->accounts = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListUsersRequest.php b/ShoppingMerchantAccounts/src/V1beta/ListUsersRequest.php new file mode 100644 index 000000000000..9cf5640d80dd --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListUsersRequest.php @@ -0,0 +1,174 @@ +google.shopping.merchant.accounts.v1beta.ListUsersRequest + */ +class ListUsersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of users. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of users to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListUsers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUsers` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent, which owns this collection of users. + * Format: `accounts/{account}` + * Please see {@see UserServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\ListUsersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of users. + * Format: `accounts/{account}` + * @type int $page_size + * Optional. The maximum number of users to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * @type string $page_token + * Optional. A page token, received from a previous `ListUsers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUsers` must match + * the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\User::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of users. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of users. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of users to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of users to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListUsers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUsers` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListUsers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUsers` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/ListUsersResponse.php b/ShoppingMerchantAccounts/src/V1beta/ListUsersResponse.php new file mode 100644 index 000000000000..524503824a7b --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ListUsersResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.accounts.v1beta.ListUsersResponse + */ +class ListUsersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The users from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.User users = 1; + */ + private $users; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\User>|\Google\Protobuf\Internal\RepeatedField $users + * The users from the specified account. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\User::initOnce(); + parent::__construct($data); + } + + /** + * The users from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.User users = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsers() + { + return $this->users; + } + + /** + * The users from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.User users = 1; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\User>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\User::class); + $this->users = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/LocationIdSet.php b/ShoppingMerchantAccounts/src/V1beta/LocationIdSet.php new file mode 100644 index 000000000000..5fd32032012b --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/LocationIdSet.php @@ -0,0 +1,84 @@ +google.shopping.merchant.accounts.v1beta.LocationIdSet + */ +class LocationIdSet extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A non-empty list of + * [location + * IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * They must all be of the same location type (For + * example, state). + * + * Generated from protobuf field repeated string location_ids = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $location_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $location_ids + * Required. A non-empty list of + * [location + * IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * They must all be of the same location type (For + * example, state). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. A non-empty list of + * [location + * IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * They must all be of the same location type (For + * example, state). + * + * Generated from protobuf field repeated string location_ids = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLocationIds() + { + return $this->location_ids; + } + + /** + * Required. A non-empty list of + * [location + * IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * They must all be of the same location type (For + * example, state). + * + * Generated from protobuf field repeated string location_ids = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLocationIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->location_ids = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/MinimumOrderValueTable.php b/ShoppingMerchantAccounts/src/V1beta/MinimumOrderValueTable.php new file mode 100644 index 000000000000..f045fb7b7fc6 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/MinimumOrderValueTable.php @@ -0,0 +1,83 @@ +google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + */ +class MinimumOrderValueTable extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of store code sets sharing the same minimum order value + * (MOV). At least two sets are required and the last one must be empty, which + * signifies 'MOV for all other stores'. Each store code can only appear once + * across all the sets. All prices within a service must have the same + * currency. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov store_code_set_with_movs = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $store_code_set_with_movs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\MinimumOrderValueTable\StoreCodeSetWithMov>|\Google\Protobuf\Internal\RepeatedField $store_code_set_with_movs + * Required. A list of store code sets sharing the same minimum order value + * (MOV). At least two sets are required and the last one must be empty, which + * signifies 'MOV for all other stores'. Each store code can only appear once + * across all the sets. All prices within a service must have the same + * currency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of store code sets sharing the same minimum order value + * (MOV). At least two sets are required and the last one must be empty, which + * signifies 'MOV for all other stores'. Each store code can only appear once + * across all the sets. All prices within a service must have the same + * currency. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov store_code_set_with_movs = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStoreCodeSetWithMovs() + { + return $this->store_code_set_with_movs; + } + + /** + * Required. A list of store code sets sharing the same minimum order value + * (MOV). At least two sets are required and the last one must be empty, which + * signifies 'MOV for all other stores'. Each store code can only appear once + * across all the sets. All prices within a service must have the same + * currency. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov store_code_set_with_movs = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\MinimumOrderValueTable\StoreCodeSetWithMov>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStoreCodeSetWithMovs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\MinimumOrderValueTable\StoreCodeSetWithMov::class); + $this->store_code_set_with_movs = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/MinimumOrderValueTable/StoreCodeSetWithMov.php b/ShoppingMerchantAccounts/src/V1beta/MinimumOrderValueTable/StoreCodeSetWithMov.php new file mode 100644 index 000000000000..5f43ff9b5d6f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/MinimumOrderValueTable/StoreCodeSetWithMov.php @@ -0,0 +1,116 @@ +google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + */ +class StoreCodeSetWithMov extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of unique store codes or empty for the catch all. + * + * Generated from protobuf field repeated string store_codes = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $store_codes; + /** + * The minimum order value for the given stores. + * + * Generated from protobuf field optional .google.shopping.type.Price value = 2; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $store_codes + * Optional. A list of unique store codes or empty for the catch all. + * @type \Google\Shopping\Type\Price $value + * The minimum order value for the given stores. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of unique store codes or empty for the catch all. + * + * Generated from protobuf field repeated string store_codes = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStoreCodes() + { + return $this->store_codes; + } + + /** + * Optional. A list of unique store codes or empty for the catch all. + * + * Generated from protobuf field repeated string store_codes = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStoreCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->store_codes = $arr; + + return $this; + } + + /** + * The minimum order value for the given stores. + * + * Generated from protobuf field optional .google.shopping.type.Price value = 2; + * @return \Google\Shopping\Type\Price|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The minimum order value for the given stores. + * + * Generated from protobuf field optional .google.shopping.type.Price value = 2; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->value = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy.php b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy.php new file mode 100644 index 000000000000..e89bfa020e98 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy.php @@ -0,0 +1,605 @@ +google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + */ +class OnlineReturnPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the `OnlineReturnPolicy` resource. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Return policy ID generated by Google. + * + * Generated from protobuf field string return_policy_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $return_policy_id = ''; + /** + * This field represents the unique user-defined label of the return policy. + * It is important to note that the same label cannot be used in different + * return policies for the same country. Unless a product specifies a specific + * label attribute, policies will be automatically labeled as 'default'. + * To assign a custom return policy to certain product groups, follow the + * instructions provided in the [Return policy label] + * (https://support.google.com/merchants/answer/9445425). + * The label can contain up to 50 characters. + * + * Generated from protobuf field string label = 3; + */ + protected $label = ''; + /** + * The countries of sale where the return policy applies. The values + * must be a valid 2 letter ISO 3166 code. + * + * Generated from protobuf field repeated string countries = 4; + */ + private $countries; + /** + * The return policy. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy policy = 5; + */ + protected $policy = null; + /** + * The restocking fee that applies to all return reason categories. This would + * be treated as a free restocking fee if the value is not set. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee restocking_fee = 6; + */ + protected $restocking_fee = null; + /** + * The return methods of how customers can return an item. This value is + * required to not be empty unless the type of return policy is noReturns. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod return_methods = 7; + */ + private $return_methods; + /** + * The item conditions accepted for returns must not be empty unless the type + * of return policy is 'noReturns'. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition item_conditions = 8; + */ + private $item_conditions; + /** + * The return shipping fee. Should be set only when customer need to download + * and print the return label. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee return_shipping_fee = 9; + */ + protected $return_shipping_fee = null; + /** + * The return policy uri. This can used by Google to do a sanity check for the + * policy. It must be a valid URL. + * + * Generated from protobuf field string return_policy_uri = 10; + */ + protected $return_policy_uri = ''; + /** + * This field specifies if merchant only accepts defective products for + * returns, and this field is required. + * + * Generated from protobuf field optional bool accept_defective_only = 11; + */ + protected $accept_defective_only = null; + /** + * The field specifies the number of days it takes for merchants to process + * refunds, field is optional. + * + * Generated from protobuf field optional int32 process_refund_days = 12; + */ + protected $process_refund_days = null; + /** + * This field specifies if merchant allows customers to exchange products, + * this field is required. + * + * Generated from protobuf field optional bool accept_exchange = 13; + */ + protected $accept_exchange = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the `OnlineReturnPolicy` resource. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * @type string $return_policy_id + * Output only. Return policy ID generated by Google. + * @type string $label + * This field represents the unique user-defined label of the return policy. + * It is important to note that the same label cannot be used in different + * return policies for the same country. Unless a product specifies a specific + * label attribute, policies will be automatically labeled as 'default'. + * To assign a custom return policy to certain product groups, follow the + * instructions provided in the [Return policy label] + * (https://support.google.com/merchants/answer/9445425). + * The label can contain up to 50 characters. + * @type array|\Google\Protobuf\Internal\RepeatedField $countries + * The countries of sale where the return policy applies. The values + * must be a valid 2 letter ISO 3166 code. + * @type \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\Policy $policy + * The return policy. + * @type \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\RestockingFee $restocking_fee + * The restocking fee that applies to all return reason categories. This would + * be treated as a free restocking fee if the value is not set. + * @type array|\Google\Protobuf\Internal\RepeatedField $return_methods + * The return methods of how customers can return an item. This value is + * required to not be empty unless the type of return policy is noReturns. + * @type array|\Google\Protobuf\Internal\RepeatedField $item_conditions + * The item conditions accepted for returns must not be empty unless the type + * of return policy is 'noReturns'. + * @type \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\ReturnShippingFee $return_shipping_fee + * The return shipping fee. Should be set only when customer need to download + * and print the return label. + * @type string $return_policy_uri + * The return policy uri. This can used by Google to do a sanity check for the + * policy. It must be a valid URL. + * @type bool $accept_defective_only + * This field specifies if merchant only accepts defective products for + * returns, and this field is required. + * @type int $process_refund_days + * The field specifies the number of days it takes for merchants to process + * refunds, field is optional. + * @type bool $accept_exchange + * This field specifies if merchant allows customers to exchange products, + * this field is required. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\OnlineReturnPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the `OnlineReturnPolicy` resource. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the `OnlineReturnPolicy` resource. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Return policy ID generated by Google. + * + * Generated from protobuf field string return_policy_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReturnPolicyId() + { + return $this->return_policy_id; + } + + /** + * Output only. Return policy ID generated by Google. + * + * Generated from protobuf field string return_policy_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReturnPolicyId($var) + { + GPBUtil::checkString($var, True); + $this->return_policy_id = $var; + + return $this; + } + + /** + * This field represents the unique user-defined label of the return policy. + * It is important to note that the same label cannot be used in different + * return policies for the same country. Unless a product specifies a specific + * label attribute, policies will be automatically labeled as 'default'. + * To assign a custom return policy to certain product groups, follow the + * instructions provided in the [Return policy label] + * (https://support.google.com/merchants/answer/9445425). + * The label can contain up to 50 characters. + * + * Generated from protobuf field string label = 3; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * This field represents the unique user-defined label of the return policy. + * It is important to note that the same label cannot be used in different + * return policies for the same country. Unless a product specifies a specific + * label attribute, policies will be automatically labeled as 'default'. + * To assign a custom return policy to certain product groups, follow the + * instructions provided in the [Return policy label] + * (https://support.google.com/merchants/answer/9445425). + * The label can contain up to 50 characters. + * + * Generated from protobuf field string label = 3; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * The countries of sale where the return policy applies. The values + * must be a valid 2 letter ISO 3166 code. + * + * Generated from protobuf field repeated string countries = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCountries() + { + return $this->countries; + } + + /** + * The countries of sale where the return policy applies. The values + * must be a valid 2 letter ISO 3166 code. + * + * Generated from protobuf field repeated string countries = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCountries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->countries = $arr; + + return $this; + } + + /** + * The return policy. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy policy = 5; + * @return \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * The return policy. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy policy = 5; + * @param \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\Policy::class); + $this->policy = $var; + + return $this; + } + + /** + * The restocking fee that applies to all return reason categories. This would + * be treated as a free restocking fee if the value is not set. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee restocking_fee = 6; + * @return \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\RestockingFee|null + */ + public function getRestockingFee() + { + return $this->restocking_fee; + } + + public function hasRestockingFee() + { + return isset($this->restocking_fee); + } + + public function clearRestockingFee() + { + unset($this->restocking_fee); + } + + /** + * The restocking fee that applies to all return reason categories. This would + * be treated as a free restocking fee if the value is not set. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee restocking_fee = 6; + * @param \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\RestockingFee $var + * @return $this + */ + public function setRestockingFee($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\RestockingFee::class); + $this->restocking_fee = $var; + + return $this; + } + + /** + * The return methods of how customers can return an item. This value is + * required to not be empty unless the type of return policy is noReturns. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod return_methods = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReturnMethods() + { + return $this->return_methods; + } + + /** + * The return methods of how customers can return an item. This value is + * required to not be empty unless the type of return policy is noReturns. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod return_methods = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReturnMethods($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\ReturnMethod::class); + $this->return_methods = $arr; + + return $this; + } + + /** + * The item conditions accepted for returns must not be empty unless the type + * of return policy is 'noReturns'. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition item_conditions = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItemConditions() + { + return $this->item_conditions; + } + + /** + * The item conditions accepted for returns must not be empty unless the type + * of return policy is 'noReturns'. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition item_conditions = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItemConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\ItemCondition::class); + $this->item_conditions = $arr; + + return $this; + } + + /** + * The return shipping fee. Should be set only when customer need to download + * and print the return label. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee return_shipping_fee = 9; + * @return \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\ReturnShippingFee|null + */ + public function getReturnShippingFee() + { + return $this->return_shipping_fee; + } + + public function hasReturnShippingFee() + { + return isset($this->return_shipping_fee); + } + + public function clearReturnShippingFee() + { + unset($this->return_shipping_fee); + } + + /** + * The return shipping fee. Should be set only when customer need to download + * and print the return label. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee return_shipping_fee = 9; + * @param \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\ReturnShippingFee $var + * @return $this + */ + public function setReturnShippingFee($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\ReturnShippingFee::class); + $this->return_shipping_fee = $var; + + return $this; + } + + /** + * The return policy uri. This can used by Google to do a sanity check for the + * policy. It must be a valid URL. + * + * Generated from protobuf field string return_policy_uri = 10; + * @return string + */ + public function getReturnPolicyUri() + { + return $this->return_policy_uri; + } + + /** + * The return policy uri. This can used by Google to do a sanity check for the + * policy. It must be a valid URL. + * + * Generated from protobuf field string return_policy_uri = 10; + * @param string $var + * @return $this + */ + public function setReturnPolicyUri($var) + { + GPBUtil::checkString($var, True); + $this->return_policy_uri = $var; + + return $this; + } + + /** + * This field specifies if merchant only accepts defective products for + * returns, and this field is required. + * + * Generated from protobuf field optional bool accept_defective_only = 11; + * @return bool + */ + public function getAcceptDefectiveOnly() + { + return isset($this->accept_defective_only) ? $this->accept_defective_only : false; + } + + public function hasAcceptDefectiveOnly() + { + return isset($this->accept_defective_only); + } + + public function clearAcceptDefectiveOnly() + { + unset($this->accept_defective_only); + } + + /** + * This field specifies if merchant only accepts defective products for + * returns, and this field is required. + * + * Generated from protobuf field optional bool accept_defective_only = 11; + * @param bool $var + * @return $this + */ + public function setAcceptDefectiveOnly($var) + { + GPBUtil::checkBool($var); + $this->accept_defective_only = $var; + + return $this; + } + + /** + * The field specifies the number of days it takes for merchants to process + * refunds, field is optional. + * + * Generated from protobuf field optional int32 process_refund_days = 12; + * @return int + */ + public function getProcessRefundDays() + { + return isset($this->process_refund_days) ? $this->process_refund_days : 0; + } + + public function hasProcessRefundDays() + { + return isset($this->process_refund_days); + } + + public function clearProcessRefundDays() + { + unset($this->process_refund_days); + } + + /** + * The field specifies the number of days it takes for merchants to process + * refunds, field is optional. + * + * Generated from protobuf field optional int32 process_refund_days = 12; + * @param int $var + * @return $this + */ + public function setProcessRefundDays($var) + { + GPBUtil::checkInt32($var); + $this->process_refund_days = $var; + + return $this; + } + + /** + * This field specifies if merchant allows customers to exchange products, + * this field is required. + * + * Generated from protobuf field optional bool accept_exchange = 13; + * @return bool + */ + public function getAcceptExchange() + { + return isset($this->accept_exchange) ? $this->accept_exchange : false; + } + + public function hasAcceptExchange() + { + return isset($this->accept_exchange); + } + + public function clearAcceptExchange() + { + unset($this->accept_exchange); + } + + /** + * This field specifies if merchant allows customers to exchange products, + * this field is required. + * + * Generated from protobuf field optional bool accept_exchange = 13; + * @param bool $var + * @return $this + */ + public function setAcceptExchange($var) + { + GPBUtil::checkBool($var); + $this->accept_exchange = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ItemCondition.php b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ItemCondition.php new file mode 100644 index 000000000000..ba8c0e5a93c0 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ItemCondition.php @@ -0,0 +1,66 @@ +google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition + */ +class ItemCondition +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ITEM_CONDITION_UNSPECIFIED = 0; + */ + const ITEM_CONDITION_UNSPECIFIED = 0; + /** + * New. + * + * Generated from protobuf enum NEW = 1; + */ + const PBNEW = 1; + /** + * Used. + * + * Generated from protobuf enum USED = 2; + */ + const USED = 2; + + private static $valueToName = [ + self::ITEM_CONDITION_UNSPECIFIED => 'ITEM_CONDITION_UNSPECIFIED', + self::PBNEW => 'NEW', + self::USED => 'USED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/Policy.php b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/Policy.php new file mode 100644 index 000000000000..995320304f98 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/Policy.php @@ -0,0 +1,110 @@ +google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + */ +class Policy extends \Google\Protobuf\Internal\Message +{ + /** + * Policy type. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type type = 1; + */ + protected $type = 0; + /** + * The number of days items can be returned after delivery, where one day + * is defined as 24 hours after the delivery timestamp. Required for + * `NUMBER_OF_DAYS_AFTER_DELIVERY` returns. + * + * Generated from protobuf field int64 days = 2; + */ + protected $days = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Policy type. + * @type int|string $days + * The number of days items can be returned after delivery, where one day + * is defined as 24 hours after the delivery timestamp. Required for + * `NUMBER_OF_DAYS_AFTER_DELIVERY` returns. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\OnlineReturnPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Policy type. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Policy type. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\Policy\Type::class); + $this->type = $var; + + return $this; + } + + /** + * The number of days items can be returned after delivery, where one day + * is defined as 24 hours after the delivery timestamp. Required for + * `NUMBER_OF_DAYS_AFTER_DELIVERY` returns. + * + * Generated from protobuf field int64 days = 2; + * @return int|string + */ + public function getDays() + { + return $this->days; + } + + /** + * The number of days items can be returned after delivery, where one day + * is defined as 24 hours after the delivery timestamp. Required for + * `NUMBER_OF_DAYS_AFTER_DELIVERY` returns. + * + * Generated from protobuf field int64 days = 2; + * @param int|string $var + * @return $this + */ + public function setDays($var) + { + GPBUtil::checkInt64($var); + $this->days = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/Policy/Type.php b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/Policy/Type.php new file mode 100644 index 000000000000..64278bfdde5f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/Policy/Type.php @@ -0,0 +1,69 @@ +google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type + */ +class Type +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The number of days within which a return is valid after delivery. + * + * Generated from protobuf enum NUMBER_OF_DAYS_AFTER_DELIVERY = 1; + */ + const NUMBER_OF_DAYS_AFTER_DELIVERY = 1; + /** + * No returns. + * + * Generated from protobuf enum NO_RETURNS = 2; + */ + const NO_RETURNS = 2; + /** + * Life time returns. + * + * Generated from protobuf enum LIFETIME_RETURNS = 3; + */ + const LIFETIME_RETURNS = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::NUMBER_OF_DAYS_AFTER_DELIVERY => 'NUMBER_OF_DAYS_AFTER_DELIVERY', + self::NO_RETURNS => 'NO_RETURNS', + self::LIFETIME_RETURNS => 'LIFETIME_RETURNS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/RestockingFee.php b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/RestockingFee.php new file mode 100644 index 000000000000..6f52b430f501 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/RestockingFee.php @@ -0,0 +1,112 @@ +google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + */ +class RestockingFee extends \Google\Protobuf\Internal\Message +{ + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Type\Price $fixed_fee + * Fixed restocking fee. + * @type int $micro_percent + * Percent of total price in micros. 15,000,000 means 15% of the total + * price would be charged. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\OnlineReturnPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Fixed restocking fee. + * + * Generated from protobuf field .google.shopping.type.Price fixed_fee = 1; + * @return \Google\Shopping\Type\Price|null + */ + public function getFixedFee() + { + return $this->readOneof(1); + } + + public function hasFixedFee() + { + return $this->hasOneof(1); + } + + /** + * Fixed restocking fee. + * + * Generated from protobuf field .google.shopping.type.Price fixed_fee = 1; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setFixedFee($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Percent of total price in micros. 15,000,000 means 15% of the total + * price would be charged. + * + * Generated from protobuf field int32 micro_percent = 2; + * @return int + */ + public function getMicroPercent() + { + return $this->readOneof(2); + } + + public function hasMicroPercent() + { + return $this->hasOneof(2); + } + + /** + * Percent of total price in micros. 15,000,000 means 15% of the total + * price would be charged. + * + * Generated from protobuf field int32 micro_percent = 2; + * @param int $var + * @return $this + */ + public function setMicroPercent($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnMethod.php b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnMethod.php new file mode 100644 index 000000000000..3ac551c767c0 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnMethod.php @@ -0,0 +1,69 @@ +google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod + */ +class ReturnMethod +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum RETURN_METHOD_UNSPECIFIED = 0; + */ + const RETURN_METHOD_UNSPECIFIED = 0; + /** + * Return by mail. + * + * Generated from protobuf enum BY_MAIL = 1; + */ + const BY_MAIL = 1; + /** + * Return in store. + * + * Generated from protobuf enum IN_STORE = 2; + */ + const IN_STORE = 2; + /** + * Return at a kiosk. + * + * Generated from protobuf enum AT_A_KIOSK = 3; + */ + const AT_A_KIOSK = 3; + + private static $valueToName = [ + self::RETURN_METHOD_UNSPECIFIED => 'RETURN_METHOD_UNSPECIFIED', + self::BY_MAIL => 'BY_MAIL', + self::IN_STORE => 'IN_STORE', + self::AT_A_KIOSK => 'AT_A_KIOSK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnShippingFee.php b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnShippingFee.php new file mode 100644 index 000000000000..d28e87ba40b0 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnShippingFee.php @@ -0,0 +1,121 @@ +google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + */ +class ReturnShippingFee extends \Google\Protobuf\Internal\Message +{ + /** + * Type of return shipping fee. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type type = 1; + */ + protected $type = 0; + /** + * Fixed return shipping fee amount. This value is only applicable when type + * is `FIXED`. We will treat the return shipping fee as free if type is + * `FIXED` and this value is not set. + * + * Generated from protobuf field .google.shopping.type.Price fixed_fee = 2; + */ + protected $fixed_fee = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Type of return shipping fee. + * @type \Google\Shopping\Type\Price $fixed_fee + * Fixed return shipping fee amount. This value is only applicable when type + * is `FIXED`. We will treat the return shipping fee as free if type is + * `FIXED` and this value is not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\OnlineReturnPolicy::initOnce(); + parent::__construct($data); + } + + /** + * Type of return shipping fee. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of return shipping fee. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy\ReturnShippingFee\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Fixed return shipping fee amount. This value is only applicable when type + * is `FIXED`. We will treat the return shipping fee as free if type is + * `FIXED` and this value is not set. + * + * Generated from protobuf field .google.shopping.type.Price fixed_fee = 2; + * @return \Google\Shopping\Type\Price|null + */ + public function getFixedFee() + { + return $this->fixed_fee; + } + + public function hasFixedFee() + { + return isset($this->fixed_fee); + } + + public function clearFixedFee() + { + unset($this->fixed_fee); + } + + /** + * Fixed return shipping fee amount. This value is only applicable when type + * is `FIXED`. We will treat the return shipping fee as free if type is + * `FIXED` and this value is not set. + * + * Generated from protobuf field .google.shopping.type.Price fixed_fee = 2; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setFixedFee($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->fixed_fee = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnShippingFee/Type.php b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnShippingFee/Type.php new file mode 100644 index 000000000000..3db2a9e32fdb --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/OnlineReturnPolicy/ReturnShippingFee/Type.php @@ -0,0 +1,62 @@ +google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type + */ +class Type +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The return shipping fee is a fixed value. + * + * Generated from protobuf enum FIXED = 1; + */ + const FIXED = 1; + /** + * Customers will pay the actual return shipping fee. + * + * Generated from protobuf enum CUSTOMER_PAYING_ACTUAL_FEE = 2; + */ + const CUSTOMER_PAYING_ACTUAL_FEE = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::FIXED => 'FIXED', + self::CUSTOMER_PAYING_ACTUAL_FEE => 'CUSTOMER_PAYING_ACTUAL_FEE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/PhoneVerificationState.php b/ShoppingMerchantAccounts/src/V1beta/PhoneVerificationState.php new file mode 100644 index 000000000000..c4cadc2d7524 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/PhoneVerificationState.php @@ -0,0 +1,61 @@ +google.shopping.merchant.accounts.v1beta.PhoneVerificationState + */ +class PhoneVerificationState +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum PHONE_VERIFICATION_STATE_UNSPECIFIED = 0; + */ + const PHONE_VERIFICATION_STATE_UNSPECIFIED = 0; + /** + * The phone is verified. + * + * Generated from protobuf enum PHONE_VERIFICATION_STATE_VERIFIED = 1; + */ + const PHONE_VERIFICATION_STATE_VERIFIED = 1; + /** + * The phone is unverified + * + * Generated from protobuf enum PHONE_VERIFICATION_STATE_UNVERIFIED = 2; + */ + const PHONE_VERIFICATION_STATE_UNVERIFIED = 2; + + private static $valueToName = [ + self::PHONE_VERIFICATION_STATE_UNSPECIFIED => 'PHONE_VERIFICATION_STATE_UNSPECIFIED', + self::PHONE_VERIFICATION_STATE_VERIFIED => 'PHONE_VERIFICATION_STATE_VERIFIED', + self::PHONE_VERIFICATION_STATE_UNVERIFIED => 'PHONE_VERIFICATION_STATE_UNVERIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Program.php b/ShoppingMerchantAccounts/src/V1beta/Program.php new file mode 100644 index 000000000000..3dccfa8bd3bd --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Program.php @@ -0,0 +1,236 @@ +google.shopping.merchant.accounts.v1beta.Program + */ +class Program extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the program. + * Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The URL of a Merchant Center help page describing the program. + * + * Generated from protobuf field string documentation_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $documentation_uri = ''; + /** + * Output only. The participation state of the account in the program. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Program.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The regions in which the account is actively participating in + * the program. Active regions are defined as those where all program + * requirements affecting the regions have been met. + * Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + * either a country where the program applies specifically to that country or + * `001` when the program applies globally. + * + * Generated from protobuf field repeated string active_region_codes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $active_region_codes; + /** + * Output only. The requirements that the account has not yet satisfied that + * are affecting participation in the program. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Program.Requirement unmet_requirements = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $unmet_requirements; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the program. + * Format: `accounts/{account}/programs/{program}` + * @type string $documentation_uri + * Output only. The URL of a Merchant Center help page describing the program. + * @type int $state + * Output only. The participation state of the account in the program. + * @type array|\Google\Protobuf\Internal\RepeatedField $active_region_codes + * Output only. The regions in which the account is actively participating in + * the program. Active regions are defined as those where all program + * requirements affecting the regions have been met. + * Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + * either a country where the program applies specifically to that country or + * `001` when the program applies globally. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Program\Requirement>|\Google\Protobuf\Internal\RepeatedField $unmet_requirements + * Output only. The requirements that the account has not yet satisfied that + * are affecting participation in the program. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Programs::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the program. + * Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the program. + * Format: `accounts/{account}/programs/{program}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The URL of a Merchant Center help page describing the program. + * + * Generated from protobuf field string documentation_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDocumentationUri() + { + return $this->documentation_uri; + } + + /** + * Output only. The URL of a Merchant Center help page describing the program. + * + * Generated from protobuf field string documentation_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDocumentationUri($var) + { + GPBUtil::checkString($var, True); + $this->documentation_uri = $var; + + return $this; + } + + /** + * Output only. The participation state of the account in the program. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Program.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The participation state of the account in the program. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Program.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\Program\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The regions in which the account is actively participating in + * the program. Active regions are defined as those where all program + * requirements affecting the regions have been met. + * Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + * either a country where the program applies specifically to that country or + * `001` when the program applies globally. + * + * Generated from protobuf field repeated string active_region_codes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActiveRegionCodes() + { + return $this->active_region_codes; + } + + /** + * Output only. The regions in which the account is actively participating in + * the program. Active regions are defined as those where all program + * requirements affecting the regions have been met. + * Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + * either a country where the program applies specifically to that country or + * `001` when the program applies globally. + * + * Generated from protobuf field repeated string active_region_codes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActiveRegionCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->active_region_codes = $arr; + + return $this; + } + + /** + * Output only. The requirements that the account has not yet satisfied that + * are affecting participation in the program. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Program.Requirement unmet_requirements = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnmetRequirements() + { + return $this->unmet_requirements; + } + + /** + * Output only. The requirements that the account has not yet satisfied that + * are affecting participation in the program. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Program.Requirement unmet_requirements = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Program\Requirement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnmetRequirements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Program\Requirement::class); + $this->unmet_requirements = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Program/Requirement.php b/ShoppingMerchantAccounts/src/V1beta/Program/Requirement.php new file mode 100644 index 000000000000..427261bf37a9 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Program/Requirement.php @@ -0,0 +1,152 @@ +google.shopping.merchant.accounts.v1beta.Program.Requirement + */ +class Requirement extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the requirement. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $title = ''; + /** + * Output only. The URL of a help page describing the requirement. + * + * Generated from protobuf field string documentation_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $documentation_uri = ''; + /** + * Output only. The regions that are currently affected by this requirement + * not being met. + * Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + * either a country where the program applies specifically to that country + * or `001` when the program applies globally. + * + * Generated from protobuf field repeated string affected_region_codes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $affected_region_codes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Output only. Name of the requirement. + * @type string $documentation_uri + * Output only. The URL of a help page describing the requirement. + * @type array|\Google\Protobuf\Internal\RepeatedField $affected_region_codes + * Output only. The regions that are currently affected by this requirement + * not being met. + * Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + * either a country where the program applies specifically to that country + * or `001` when the program applies globally. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Programs::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the requirement. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Output only. Name of the requirement. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Output only. The URL of a help page describing the requirement. + * + * Generated from protobuf field string documentation_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDocumentationUri() + { + return $this->documentation_uri; + } + + /** + * Output only. The URL of a help page describing the requirement. + * + * Generated from protobuf field string documentation_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDocumentationUri($var) + { + GPBUtil::checkString($var, True); + $this->documentation_uri = $var; + + return $this; + } + + /** + * Output only. The regions that are currently affected by this requirement + * not being met. + * Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + * either a country where the program applies specifically to that country + * or `001` when the program applies globally. + * + * Generated from protobuf field repeated string affected_region_codes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAffectedRegionCodes() + { + return $this->affected_region_codes; + } + + /** + * Output only. The regions that are currently affected by this requirement + * not being met. + * Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + * either a country where the program applies specifically to that country + * or `001` when the program applies globally. + * + * Generated from protobuf field repeated string affected_region_codes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAffectedRegionCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->affected_region_codes = $arr; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Program/State.php b/ShoppingMerchantAccounts/src/V1beta/Program/State.php new file mode 100644 index 000000000000..5a8f6d4c15a3 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Program/State.php @@ -0,0 +1,69 @@ +google.shopping.merchant.accounts.v1beta.Program.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The account is not eligible to participate in the program. + * + * Generated from protobuf enum NOT_ELIGIBLE = 1; + */ + const NOT_ELIGIBLE = 1; + /** + * The account is eligible to participate in the program. + * + * Generated from protobuf enum ELIGIBLE = 2; + */ + const ELIGIBLE = 2; + /** + * The program is enabled for the account. + * + * Generated from protobuf enum ENABLED = 3; + */ + const ENABLED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::NOT_ELIGIBLE => 'NOT_ELIGIBLE', + self::ELIGIBLE => 'ELIGIBLE', + self::ENABLED => 'ENABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/RateGroup.php b/ShoppingMerchantAccounts/src/V1beta/RateGroup.php new file mode 100644 index 000000000000..60cf14d67ad7 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/RateGroup.php @@ -0,0 +1,310 @@ +google.shopping.merchant.accounts.v1beta.RateGroup + */ +class RateGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of [shipping + * labels](https://support.google.com/merchants/answer/6324504) defining the + * products to which this rate group applies to. This is a disjunction: only + * one of the labels has to match for the rate group to apply. May only be + * empty for the last rate group of a service. + * + * Generated from protobuf field repeated string applicable_shipping_labels = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $applicable_shipping_labels; + /** + * The value of the rate group (For example flat rate $10). Can only be set + * if `main_table` and `subtables` are not set. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Value single_value = 2; + */ + protected $single_value = null; + /** + * A table defining the rate group, when `single_value` is not + * expressive enough. Can only be set if `single_value` is not + * set. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Table main_table = 3; + */ + protected $main_table = null; + /** + * Optional. A list of subtables referred to by `main_table`. Can only + * be set if `main_table` is set. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Table subtables = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $subtables; + /** + * Optional. A list of carrier rates that can be referred to by + * `main_table` or `single_value`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.CarrierRate carrier_rates = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $carrier_rates; + /** + * Optional. Name of the rate group. + * If set has to be unique within shipping service. + * + * Generated from protobuf field optional string name = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $applicable_shipping_labels + * Required. A list of [shipping + * labels](https://support.google.com/merchants/answer/6324504) defining the + * products to which this rate group applies to. This is a disjunction: only + * one of the labels has to match for the rate group to apply. May only be + * empty for the last rate group of a service. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Value $single_value + * The value of the rate group (For example flat rate $10). Can only be set + * if `main_table` and `subtables` are not set. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Table $main_table + * A table defining the rate group, when `single_value` is not + * expressive enough. Can only be set if `single_value` is not + * set. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Table>|\Google\Protobuf\Internal\RepeatedField $subtables + * Optional. A list of subtables referred to by `main_table`. Can only + * be set if `main_table` is set. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\CarrierRate>|\Google\Protobuf\Internal\RepeatedField $carrier_rates + * Optional. A list of carrier rates that can be referred to by + * `main_table` or `single_value`. + * @type string $name + * Optional. Name of the rate group. + * If set has to be unique within shipping service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of [shipping + * labels](https://support.google.com/merchants/answer/6324504) defining the + * products to which this rate group applies to. This is a disjunction: only + * one of the labels has to match for the rate group to apply. May only be + * empty for the last rate group of a service. + * + * Generated from protobuf field repeated string applicable_shipping_labels = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApplicableShippingLabels() + { + return $this->applicable_shipping_labels; + } + + /** + * Required. A list of [shipping + * labels](https://support.google.com/merchants/answer/6324504) defining the + * products to which this rate group applies to. This is a disjunction: only + * one of the labels has to match for the rate group to apply. May only be + * empty for the last rate group of a service. + * + * Generated from protobuf field repeated string applicable_shipping_labels = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApplicableShippingLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applicable_shipping_labels = $arr; + + return $this; + } + + /** + * The value of the rate group (For example flat rate $10). Can only be set + * if `main_table` and `subtables` are not set. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Value single_value = 2; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Value|null + */ + public function getSingleValue() + { + return $this->single_value; + } + + public function hasSingleValue() + { + return isset($this->single_value); + } + + public function clearSingleValue() + { + unset($this->single_value); + } + + /** + * The value of the rate group (For example flat rate $10). Can only be set + * if `main_table` and `subtables` are not set. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Value single_value = 2; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Value $var + * @return $this + */ + public function setSingleValue($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Value::class); + $this->single_value = $var; + + return $this; + } + + /** + * A table defining the rate group, when `single_value` is not + * expressive enough. Can only be set if `single_value` is not + * set. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Table main_table = 3; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Table|null + */ + public function getMainTable() + { + return $this->main_table; + } + + public function hasMainTable() + { + return isset($this->main_table); + } + + public function clearMainTable() + { + unset($this->main_table); + } + + /** + * A table defining the rate group, when `single_value` is not + * expressive enough. Can only be set if `single_value` is not + * set. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Table main_table = 3; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Table $var + * @return $this + */ + public function setMainTable($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Table::class); + $this->main_table = $var; + + return $this; + } + + /** + * Optional. A list of subtables referred to by `main_table`. Can only + * be set if `main_table` is set. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Table subtables = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubtables() + { + return $this->subtables; + } + + /** + * Optional. A list of subtables referred to by `main_table`. Can only + * be set if `main_table` is set. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Table subtables = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Table>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubtables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Table::class); + $this->subtables = $arr; + + return $this; + } + + /** + * Optional. A list of carrier rates that can be referred to by + * `main_table` or `single_value`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.CarrierRate carrier_rates = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCarrierRates() + { + return $this->carrier_rates; + } + + /** + * Optional. A list of carrier rates that can be referred to by + * `main_table` or `single_value`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.CarrierRate carrier_rates = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\CarrierRate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCarrierRates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\CarrierRate::class); + $this->carrier_rates = $arr; + + return $this; + } + + /** + * Optional. Name of the rate group. + * If set has to be unique within shipping service. + * + * Generated from protobuf field optional string name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Optional. Name of the rate group. + * If set has to be unique within shipping service. + * + * Generated from protobuf field optional string name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Region.php b/ShoppingMerchantAccounts/src/V1beta/Region.php new file mode 100644 index 000000000000..0a3a87633667 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Region.php @@ -0,0 +1,362 @@ +google.shopping.merchant.accounts.v1beta.Region + */ +class Region extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the region. + * Format: `accounts/{account}/regions/{region}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The display name of the region. + * + * Generated from protobuf field optional string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = null; + /** + * Optional. A list of postal codes that defines the region area. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea postal_code_area = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $postal_code_area = null; + /** + * Optional. A list of geotargets that defines the region area. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea geotarget_area = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $geotarget_area = null; + /** + * Output only. Indicates if the region is eligible for use in the Regional + * Inventory configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue regional_inventory_eligible = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $regional_inventory_eligible = null; + /** + * Output only. Indicates if the region is eligible for use in the Shipping + * Services configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue shipping_eligible = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $shipping_eligible = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the region. + * Format: `accounts/{account}/regions/{region}` + * @type string $display_name + * Optional. The display name of the region. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Region\PostalCodeArea $postal_code_area + * Optional. A list of postal codes that defines the region area. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Region\GeoTargetArea $geotarget_area + * Optional. A list of geotargets that defines the region area. + * @type \Google\Protobuf\BoolValue $regional_inventory_eligible + * Output only. Indicates if the region is eligible for use in the Regional + * Inventory configuration. + * @type \Google\Protobuf\BoolValue $shipping_eligible + * Output only. Indicates if the region is eligible for use in the Shipping + * Services configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the region. + * Format: `accounts/{account}/regions/{region}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the region. + * Format: `accounts/{account}/regions/{region}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The display name of the region. + * + * Generated from protobuf field optional string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return isset($this->display_name) ? $this->display_name : ''; + } + + public function hasDisplayName() + { + return isset($this->display_name); + } + + public function clearDisplayName() + { + unset($this->display_name); + } + + /** + * Optional. The display name of the region. + * + * Generated from protobuf field optional string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. A list of postal codes that defines the region area. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea postal_code_area = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Region\PostalCodeArea|null + */ + public function getPostalCodeArea() + { + return $this->postal_code_area; + } + + public function hasPostalCodeArea() + { + return isset($this->postal_code_area); + } + + public function clearPostalCodeArea() + { + unset($this->postal_code_area); + } + + /** + * Optional. A list of postal codes that defines the region area. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea postal_code_area = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Region\PostalCodeArea $var + * @return $this + */ + public function setPostalCodeArea($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Region\PostalCodeArea::class); + $this->postal_code_area = $var; + + return $this; + } + + /** + * Optional. A list of geotargets that defines the region area. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea geotarget_area = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Region\GeoTargetArea|null + */ + public function getGeotargetArea() + { + return $this->geotarget_area; + } + + public function hasGeotargetArea() + { + return isset($this->geotarget_area); + } + + public function clearGeotargetArea() + { + unset($this->geotarget_area); + } + + /** + * Optional. A list of geotargets that defines the region area. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea geotarget_area = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Region\GeoTargetArea $var + * @return $this + */ + public function setGeotargetArea($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Region\GeoTargetArea::class); + $this->geotarget_area = $var; + + return $this; + } + + /** + * Output only. Indicates if the region is eligible for use in the Regional + * Inventory configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue regional_inventory_eligible = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getRegionalInventoryEligible() + { + return $this->regional_inventory_eligible; + } + + public function hasRegionalInventoryEligible() + { + return isset($this->regional_inventory_eligible); + } + + public function clearRegionalInventoryEligible() + { + unset($this->regional_inventory_eligible); + } + + /** + * Returns the unboxed value from getRegionalInventoryEligible() + + * Output only. Indicates if the region is eligible for use in the Regional + * Inventory configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue regional_inventory_eligible = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool|null + */ + public function getRegionalInventoryEligibleUnwrapped() + { + return $this->readWrapperValue("regional_inventory_eligible"); + } + + /** + * Output only. Indicates if the region is eligible for use in the Regional + * Inventory configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue regional_inventory_eligible = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setRegionalInventoryEligible($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->regional_inventory_eligible = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Output only. Indicates if the region is eligible for use in the Regional + * Inventory configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue regional_inventory_eligible = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool|null $var + * @return $this + */ + public function setRegionalInventoryEligibleUnwrapped($var) + { + $this->writeWrapperValue("regional_inventory_eligible", $var); + return $this;} + + /** + * Output only. Indicates if the region is eligible for use in the Shipping + * Services configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue shipping_eligible = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getShippingEligible() + { + return $this->shipping_eligible; + } + + public function hasShippingEligible() + { + return isset($this->shipping_eligible); + } + + public function clearShippingEligible() + { + unset($this->shipping_eligible); + } + + /** + * Returns the unboxed value from getShippingEligible() + + * Output only. Indicates if the region is eligible for use in the Shipping + * Services configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue shipping_eligible = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool|null + */ + public function getShippingEligibleUnwrapped() + { + return $this->readWrapperValue("shipping_eligible"); + } + + /** + * Output only. Indicates if the region is eligible for use in the Shipping + * Services configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue shipping_eligible = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setShippingEligible($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->shipping_eligible = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Output only. Indicates if the region is eligible for use in the Shipping + * Services configuration. + * + * Generated from protobuf field .google.protobuf.BoolValue shipping_eligible = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool|null $var + * @return $this + */ + public function setShippingEligibleUnwrapped($var) + { + $this->writeWrapperValue("shipping_eligible", $var); + return $this;} + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Region/GeoTargetArea.php b/ShoppingMerchantAccounts/src/V1beta/Region/GeoTargetArea.php new file mode 100644 index 000000000000..ee736ab7b266 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Region/GeoTargetArea.php @@ -0,0 +1,76 @@ +google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + */ +class GeoTargetArea extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A non-empty list of [location + * IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * They must all be of the same location type (for example, state). + * + * Generated from protobuf field repeated int64 geotarget_criteria_ids = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $geotarget_criteria_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|array|\Google\Protobuf\Internal\RepeatedField $geotarget_criteria_ids + * Required. A non-empty list of [location + * IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * They must all be of the same location type (for example, state). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * Required. A non-empty list of [location + * IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * They must all be of the same location type (for example, state). + * + * Generated from protobuf field repeated int64 geotarget_criteria_ids = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGeotargetCriteriaIds() + { + return $this->geotarget_criteria_ids; + } + + /** + * Required. A non-empty list of [location + * IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * They must all be of the same location type (for example, state). + * + * Generated from protobuf field repeated int64 geotarget_criteria_ids = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGeotargetCriteriaIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->geotarget_criteria_ids = $arr; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Region/PostalCodeArea.php b/ShoppingMerchantAccounts/src/V1beta/Region/PostalCodeArea.php new file mode 100644 index 000000000000..3eb47d47154d --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Region/PostalCodeArea.php @@ -0,0 +1,112 @@ +google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + */ +class PostalCodeArea extends \Google\Protobuf\Internal\Message +{ + /** + * Required. [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * or the country the postal code group applies to. + * + * Generated from protobuf field string region_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_code = ''; + /** + * Required. A range of postal codes. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange postal_codes = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $postal_codes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $region_code + * Required. [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * or the country the postal code group applies to. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Region\PostalCodeArea\PostalCodeRange>|\Google\Protobuf\Internal\RepeatedField $postal_codes + * Required. A range of postal codes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * Required. [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * or the country the postal code group applies to. + * + * Generated from protobuf field string region_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * or the country the postal code group applies to. + * + * Generated from protobuf field string region_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Required. A range of postal codes. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange postal_codes = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPostalCodes() + { + return $this->postal_codes; + } + + /** + * Required. A range of postal codes. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange postal_codes = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Region\PostalCodeArea\PostalCodeRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPostalCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Region\PostalCodeArea\PostalCodeRange::class); + $this->postal_codes = $arr; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Region/PostalCodeArea/PostalCodeRange.php b/ShoppingMerchantAccounts/src/V1beta/Region/PostalCodeArea/PostalCodeRange.php new file mode 100644 index 000000000000..15fe90dd7751 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Region/PostalCodeArea/PostalCodeRange.php @@ -0,0 +1,138 @@ +google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + */ +class PostalCodeRange extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A postal code or a pattern of the form prefix* denoting the + * inclusive lower bound of the range defining the area. Examples values: + * `94108`, `9410*`, `9*`. + * + * Generated from protobuf field string begin = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $begin = ''; + /** + * Optional. A postal code or a pattern of the form `prefix*` denoting the + * inclusive upper bound of the range defining the area. It must have the + * same length as postalCodeRangeBegin: if postalCodeRangeBegin is a + * postal code then postalCodeRangeEnd must be a postal code too; if + * postalCodeRangeBegin is a pattern then postalCodeRangeEnd must be a + * pattern with the same prefix length. Optional: if not set, then the + * area is defined as being all the postal codes matching + * postalCodeRangeBegin. + * + * Generated from protobuf field string end = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $end = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $begin + * Required. A postal code or a pattern of the form prefix* denoting the + * inclusive lower bound of the range defining the area. Examples values: + * `94108`, `9410*`, `9*`. + * @type string $end + * Optional. A postal code or a pattern of the form `prefix*` denoting the + * inclusive upper bound of the range defining the area. It must have the + * same length as postalCodeRangeBegin: if postalCodeRangeBegin is a + * postal code then postalCodeRangeEnd must be a postal code too; if + * postalCodeRangeBegin is a pattern then postalCodeRangeEnd must be a + * pattern with the same prefix length. Optional: if not set, then the + * area is defined as being all the postal codes matching + * postalCodeRangeBegin. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * Required. A postal code or a pattern of the form prefix* denoting the + * inclusive lower bound of the range defining the area. Examples values: + * `94108`, `9410*`, `9*`. + * + * Generated from protobuf field string begin = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBegin() + { + return $this->begin; + } + + /** + * Required. A postal code or a pattern of the form prefix* denoting the + * inclusive lower bound of the range defining the area. Examples values: + * `94108`, `9410*`, `9*`. + * + * Generated from protobuf field string begin = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBegin($var) + { + GPBUtil::checkString($var, True); + $this->begin = $var; + + return $this; + } + + /** + * Optional. A postal code or a pattern of the form `prefix*` denoting the + * inclusive upper bound of the range defining the area. It must have the + * same length as postalCodeRangeBegin: if postalCodeRangeBegin is a + * postal code then postalCodeRangeEnd must be a postal code too; if + * postalCodeRangeBegin is a pattern then postalCodeRangeEnd must be a + * pattern with the same prefix length. Optional: if not set, then the + * area is defined as being all the postal codes matching + * postalCodeRangeBegin. + * + * Generated from protobuf field string end = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEnd() + { + return $this->end; + } + + /** + * Optional. A postal code or a pattern of the form `prefix*` denoting the + * inclusive upper bound of the range defining the area. It must have the + * same length as postalCodeRangeBegin: if postalCodeRangeBegin is a + * postal code then postalCodeRangeEnd must be a postal code too; if + * postalCodeRangeBegin is a pattern then postalCodeRangeEnd must be a + * pattern with the same prefix length. Optional: if not set, then the + * area is defined as being all the postal codes matching + * postalCodeRangeBegin. + * + * Generated from protobuf field string end = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkString($var, True); + $this->end = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Required.php b/ShoppingMerchantAccounts/src/V1beta/Required.php new file mode 100644 index 000000000000..21465950f13b --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Required.php @@ -0,0 +1,117 @@ +google.shopping.merchant.accounts.v1beta.Required + */ +class Required extends \Google\Protobuf\Internal\Message +{ + /** + * The + * [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * that need to be accepted. + * + * Generated from protobuf field string terms_of_service = 1 [(.google.api.resource_reference) = { + */ + protected $terms_of_service = ''; + /** + * Full URL to the terms of service file. This field is the same as + * [TermsOfService.file_uri](TermsOfService.file_uri), it is added + * here for convenience only. + * + * Generated from protobuf field string tos_file_uri = 2; + */ + protected $tos_file_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $terms_of_service + * The + * [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * that need to be accepted. + * @type string $tos_file_uri + * Full URL to the terms of service file. This field is the same as + * [TermsOfService.file_uri](TermsOfService.file_uri), it is added + * here for convenience only. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Termsofserviceagreementstate::initOnce(); + parent::__construct($data); + } + + /** + * The + * [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * that need to be accepted. + * + * Generated from protobuf field string terms_of_service = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getTermsOfService() + { + return $this->terms_of_service; + } + + /** + * The + * [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + * that need to be accepted. + * + * Generated from protobuf field string terms_of_service = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTermsOfService($var) + { + GPBUtil::checkString($var, True); + $this->terms_of_service = $var; + + return $this; + } + + /** + * Full URL to the terms of service file. This field is the same as + * [TermsOfService.file_uri](TermsOfService.file_uri), it is added + * here for convenience only. + * + * Generated from protobuf field string tos_file_uri = 2; + * @return string + */ + public function getTosFileUri() + { + return $this->tos_file_uri; + } + + /** + * Full URL to the terms of service file. This field is the same as + * [TermsOfService.file_uri](TermsOfService.file_uri), it is added + * here for convenience only. + * + * Generated from protobuf field string tos_file_uri = 2; + * @param string $var + * @return $this + */ + public function setTosFileUri($var) + { + GPBUtil::checkString($var, True); + $this->tos_file_uri = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/RetrieveForApplicationTermsOfServiceAgreementStateRequest.php b/ShoppingMerchantAccounts/src/V1beta/RetrieveForApplicationTermsOfServiceAgreementStateRequest.php new file mode 100644 index 000000000000..b205a7ba5b34 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/RetrieveForApplicationTermsOfServiceAgreementStateRequest.php @@ -0,0 +1,87 @@ +google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + */ +class RetrieveForApplicationTermsOfServiceAgreementStateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account for which to get a TermsOfServiceAgreementState + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The account for which to get a TermsOfServiceAgreementState + * Format: `accounts/{account}` + * Please see {@see TermsOfServiceAgreementStateServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\RetrieveForApplicationTermsOfServiceAgreementStateRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account for which to get a TermsOfServiceAgreementState + * Format: `accounts/{account}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Termsofserviceagreementstate::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account for which to get a TermsOfServiceAgreementState + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account for which to get a TermsOfServiceAgreementState + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/RetrieveLatestTermsOfServiceRequest.php b/ShoppingMerchantAccounts/src/V1beta/RetrieveLatestTermsOfServiceRequest.php new file mode 100644 index 000000000000..e186162e0196 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/RetrieveLatestTermsOfServiceRequest.php @@ -0,0 +1,109 @@ +google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + */ +class RetrieveLatestTermsOfServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Region code as defined by [CLDR](https://cldr.unicode.org/). This is either + * a country when the ToS applies specifically to that country or 001 when it + * applies globally. + * + * Generated from protobuf field string region_code = 1; + */ + protected $region_code = ''; + /** + * The Kind this terms of service version applies to. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TermsOfServiceKind kind = 2; + */ + protected $kind = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $region_code + * Region code as defined by [CLDR](https://cldr.unicode.org/). This is either + * a country when the ToS applies specifically to that country or 001 when it + * applies globally. + * @type int $kind + * The Kind this terms of service version applies to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Termsofservice::initOnce(); + parent::__construct($data); + } + + /** + * Region code as defined by [CLDR](https://cldr.unicode.org/). This is either + * a country when the ToS applies specifically to that country or 001 when it + * applies globally. + * + * Generated from protobuf field string region_code = 1; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Region code as defined by [CLDR](https://cldr.unicode.org/). This is either + * a country when the ToS applies specifically to that country or 001 when it + * applies globally. + * + * Generated from protobuf field string region_code = 1; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * The Kind this terms of service version applies to. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TermsOfServiceKind kind = 2; + * @return int + */ + public function getKind() + { + return $this->kind; + } + + /** + * The Kind this terms of service version applies to. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TermsOfServiceKind kind = 2; + * @param int $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\TermsOfServiceKind::class); + $this->kind = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Row.php b/ShoppingMerchantAccounts/src/V1beta/Row.php new file mode 100644 index 000000000000..1be1ce4d055f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Row.php @@ -0,0 +1,75 @@ +google.shopping.merchant.accounts.v1beta.Row + */ +class Row extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The list of cells that constitute the row. Must have the same + * length as `columnHeaders` for two-dimensional tables, a length of 1 for + * one-dimensional tables. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Value cells = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $cells; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Value>|\Google\Protobuf\Internal\RepeatedField $cells + * Required. The list of cells that constitute the row. Must have the same + * length as `columnHeaders` for two-dimensional tables, a length of 1 for + * one-dimensional tables. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The list of cells that constitute the row. Must have the same + * length as `columnHeaders` for two-dimensional tables, a length of 1 for + * one-dimensional tables. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Value cells = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCells() + { + return $this->cells; + } + + /** + * Required. The list of cells that constitute the row. Must have the same + * length as `columnHeaders` for two-dimensional tables, a length of 1 for + * one-dimensional tables. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Value cells = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCells($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Value::class); + $this->cells = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Service.php b/ShoppingMerchantAccounts/src/V1beta/Service.php new file mode 100644 index 000000000000..22990ff58a68 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Service.php @@ -0,0 +1,531 @@ +google.shopping.merchant.accounts.v1beta.Service + */ +class Service extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Free-form name of the service. Must be unique within target + * account. + * + * Generated from protobuf field optional string service_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_name = null; + /** + * Required. A boolean exposing the active status of the shipping service. + * + * Generated from protobuf field optional bool active = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $active = null; + /** + * Required. The CLDR territory code of the countries to which the service + * applies. + * + * Generated from protobuf field repeated string delivery_countries = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $delivery_countries; + /** + * The CLDR code of the currency to which this service applies. Must match + * that of the prices in rate groups. + * + * Generated from protobuf field optional string currency_code = 4; + */ + protected $currency_code = null; + /** + * Required. Time spent in various aspects from order to the delivery of the + * product. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.DeliveryTime delivery_time = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $delivery_time = null; + /** + * Optional. Shipping rate group definitions. Only the last one is allowed to + * have an empty `applicable_shipping_labels`, which means "everything else". + * The other `applicable_shipping_labels` must not overlap. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.RateGroup rate_groups = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $rate_groups; + /** + * Type of locations this service ships orders to. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.ShipmentType shipment_type = 7; + */ + protected $shipment_type = null; + /** + * Minimum order value for this service. If set, indicates that customers + * will have to spend at least this amount. + * All prices within a service must have the same currency. + * Cannot be set together with minimum_order_value_table. + * + * Generated from protobuf field optional .google.shopping.type.Price minimum_order_value = 8; + */ + protected $minimum_order_value = null; + /** + * Table of per store minimum order values for the pickup fulfillment type. + * Cannot be set together with minimum_order_value. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable minimum_order_value_table = 9; + */ + protected $minimum_order_value_table = null; + /** + * A list of stores your products are delivered from. + * This is only valid for the local delivery shipment type. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig store_config = 10; + */ + protected $store_config = null; + /** + * Optional. Loyalty programs that this shipping service is limited to. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram loyalty_programs = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $loyalty_programs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_name + * Required. Free-form name of the service. Must be unique within target + * account. + * @type bool $active + * Required. A boolean exposing the active status of the shipping service. + * @type array|\Google\Protobuf\Internal\RepeatedField $delivery_countries + * Required. The CLDR territory code of the countries to which the service + * applies. + * @type string $currency_code + * The CLDR code of the currency to which this service applies. Must match + * that of the prices in rate groups. + * @type \Google\Shopping\Merchant\Accounts\V1beta\DeliveryTime $delivery_time + * Required. Time spent in various aspects from order to the delivery of the + * product. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\RateGroup>|\Google\Protobuf\Internal\RepeatedField $rate_groups + * Optional. Shipping rate group definitions. Only the last one is allowed to + * have an empty `applicable_shipping_labels`, which means "everything else". + * The other `applicable_shipping_labels` must not overlap. + * @type int $shipment_type + * Type of locations this service ships orders to. + * @type \Google\Shopping\Type\Price $minimum_order_value + * Minimum order value for this service. If set, indicates that customers + * will have to spend at least this amount. + * All prices within a service must have the same currency. + * Cannot be set together with minimum_order_value_table. + * @type \Google\Shopping\Merchant\Accounts\V1beta\MinimumOrderValueTable $minimum_order_value_table + * Table of per store minimum order values for the pickup fulfillment type. + * Cannot be set together with minimum_order_value. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig $store_config + * A list of stores your products are delivered from. + * This is only valid for the local delivery shipment type. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Service\LoyaltyProgram>|\Google\Protobuf\Internal\RepeatedField $loyalty_programs + * Optional. Loyalty programs that this shipping service is limited to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. Free-form name of the service. Must be unique within target + * account. + * + * Generated from protobuf field optional string service_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceName() + { + return isset($this->service_name) ? $this->service_name : ''; + } + + public function hasServiceName() + { + return isset($this->service_name); + } + + public function clearServiceName() + { + unset($this->service_name); + } + + /** + * Required. Free-form name of the service. Must be unique within target + * account. + * + * Generated from protobuf field optional string service_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceName($var) + { + GPBUtil::checkString($var, True); + $this->service_name = $var; + + return $this; + } + + /** + * Required. A boolean exposing the active status of the shipping service. + * + * Generated from protobuf field optional bool active = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getActive() + { + return isset($this->active) ? $this->active : false; + } + + public function hasActive() + { + return isset($this->active); + } + + public function clearActive() + { + unset($this->active); + } + + /** + * Required. A boolean exposing the active status of the shipping service. + * + * Generated from protobuf field optional bool active = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setActive($var) + { + GPBUtil::checkBool($var); + $this->active = $var; + + return $this; + } + + /** + * Required. The CLDR territory code of the countries to which the service + * applies. + * + * Generated from protobuf field repeated string delivery_countries = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDeliveryCountries() + { + return $this->delivery_countries; + } + + /** + * Required. The CLDR territory code of the countries to which the service + * applies. + * + * Generated from protobuf field repeated string delivery_countries = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDeliveryCountries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->delivery_countries = $arr; + + return $this; + } + + /** + * The CLDR code of the currency to which this service applies. Must match + * that of the prices in rate groups. + * + * Generated from protobuf field optional string currency_code = 4; + * @return string + */ + public function getCurrencyCode() + { + return isset($this->currency_code) ? $this->currency_code : ''; + } + + public function hasCurrencyCode() + { + return isset($this->currency_code); + } + + public function clearCurrencyCode() + { + unset($this->currency_code); + } + + /** + * The CLDR code of the currency to which this service applies. Must match + * that of the prices in rate groups. + * + * Generated from protobuf field optional string currency_code = 4; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * Required. Time spent in various aspects from order to the delivery of the + * product. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.DeliveryTime delivery_time = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\DeliveryTime|null + */ + public function getDeliveryTime() + { + return $this->delivery_time; + } + + public function hasDeliveryTime() + { + return isset($this->delivery_time); + } + + public function clearDeliveryTime() + { + unset($this->delivery_time); + } + + /** + * Required. Time spent in various aspects from order to the delivery of the + * product. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.DeliveryTime delivery_time = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\DeliveryTime $var + * @return $this + */ + public function setDeliveryTime($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\DeliveryTime::class); + $this->delivery_time = $var; + + return $this; + } + + /** + * Optional. Shipping rate group definitions. Only the last one is allowed to + * have an empty `applicable_shipping_labels`, which means "everything else". + * The other `applicable_shipping_labels` must not overlap. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.RateGroup rate_groups = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRateGroups() + { + return $this->rate_groups; + } + + /** + * Optional. Shipping rate group definitions. Only the last one is allowed to + * have an empty `applicable_shipping_labels`, which means "everything else". + * The other `applicable_shipping_labels` must not overlap. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.RateGroup rate_groups = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\RateGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRateGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\RateGroup::class); + $this->rate_groups = $arr; + + return $this; + } + + /** + * Type of locations this service ships orders to. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.ShipmentType shipment_type = 7; + * @return int + */ + public function getShipmentType() + { + return isset($this->shipment_type) ? $this->shipment_type : 0; + } + + public function hasShipmentType() + { + return isset($this->shipment_type); + } + + public function clearShipmentType() + { + unset($this->shipment_type); + } + + /** + * Type of locations this service ships orders to. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.ShipmentType shipment_type = 7; + * @param int $var + * @return $this + */ + public function setShipmentType($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\Service\ShipmentType::class); + $this->shipment_type = $var; + + return $this; + } + + /** + * Minimum order value for this service. If set, indicates that customers + * will have to spend at least this amount. + * All prices within a service must have the same currency. + * Cannot be set together with minimum_order_value_table. + * + * Generated from protobuf field optional .google.shopping.type.Price minimum_order_value = 8; + * @return \Google\Shopping\Type\Price|null + */ + public function getMinimumOrderValue() + { + return $this->minimum_order_value; + } + + public function hasMinimumOrderValue() + { + return isset($this->minimum_order_value); + } + + public function clearMinimumOrderValue() + { + unset($this->minimum_order_value); + } + + /** + * Minimum order value for this service. If set, indicates that customers + * will have to spend at least this amount. + * All prices within a service must have the same currency. + * Cannot be set together with minimum_order_value_table. + * + * Generated from protobuf field optional .google.shopping.type.Price minimum_order_value = 8; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setMinimumOrderValue($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->minimum_order_value = $var; + + return $this; + } + + /** + * Table of per store minimum order values for the pickup fulfillment type. + * Cannot be set together with minimum_order_value. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable minimum_order_value_table = 9; + * @return \Google\Shopping\Merchant\Accounts\V1beta\MinimumOrderValueTable|null + */ + public function getMinimumOrderValueTable() + { + return $this->minimum_order_value_table; + } + + public function hasMinimumOrderValueTable() + { + return isset($this->minimum_order_value_table); + } + + public function clearMinimumOrderValueTable() + { + unset($this->minimum_order_value_table); + } + + /** + * Table of per store minimum order values for the pickup fulfillment type. + * Cannot be set together with minimum_order_value. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable minimum_order_value_table = 9; + * @param \Google\Shopping\Merchant\Accounts\V1beta\MinimumOrderValueTable $var + * @return $this + */ + public function setMinimumOrderValueTable($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\MinimumOrderValueTable::class); + $this->minimum_order_value_table = $var; + + return $this; + } + + /** + * A list of stores your products are delivered from. + * This is only valid for the local delivery shipment type. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig store_config = 10; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig|null + */ + public function getStoreConfig() + { + return $this->store_config; + } + + public function hasStoreConfig() + { + return isset($this->store_config); + } + + public function clearStoreConfig() + { + unset($this->store_config); + } + + /** + * A list of stores your products are delivered from. + * This is only valid for the local delivery shipment type. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig store_config = 10; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig $var + * @return $this + */ + public function setStoreConfig($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig::class); + $this->store_config = $var; + + return $this; + } + + /** + * Optional. Loyalty programs that this shipping service is limited to. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram loyalty_programs = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLoyaltyPrograms() + { + return $this->loyalty_programs; + } + + /** + * Optional. Loyalty programs that this shipping service is limited to. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram loyalty_programs = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Service\LoyaltyProgram>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLoyaltyPrograms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Service\LoyaltyProgram::class); + $this->loyalty_programs = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Service/LoyaltyProgram.php b/ShoppingMerchantAccounts/src/V1beta/Service/LoyaltyProgram.php new file mode 100644 index 000000000000..bd0b9d449277 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Service/LoyaltyProgram.php @@ -0,0 +1,121 @@ +google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + */ +class LoyaltyProgram extends \Google\Protobuf\Internal\Message +{ + /** + * This is the loyalty program label set in your loyalty program settings in + * Merchant Center. This sub-attribute allows Google to map your loyalty + * program to eligible offers. + * + * Generated from protobuf field optional string program_label = 1; + */ + protected $program_label = null; + /** + * Optional. Loyalty program tier of this shipping service. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers loyalty_program_tiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $loyalty_program_tiers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $program_label + * This is the loyalty program label set in your loyalty program settings in + * Merchant Center. This sub-attribute allows Google to map your loyalty + * program to eligible offers. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Service\LoyaltyProgram\LoyaltyProgramTiers>|\Google\Protobuf\Internal\RepeatedField $loyalty_program_tiers + * Optional. Loyalty program tier of this shipping service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * This is the loyalty program label set in your loyalty program settings in + * Merchant Center. This sub-attribute allows Google to map your loyalty + * program to eligible offers. + * + * Generated from protobuf field optional string program_label = 1; + * @return string + */ + public function getProgramLabel() + { + return isset($this->program_label) ? $this->program_label : ''; + } + + public function hasProgramLabel() + { + return isset($this->program_label); + } + + public function clearProgramLabel() + { + unset($this->program_label); + } + + /** + * This is the loyalty program label set in your loyalty program settings in + * Merchant Center. This sub-attribute allows Google to map your loyalty + * program to eligible offers. + * + * Generated from protobuf field optional string program_label = 1; + * @param string $var + * @return $this + */ + public function setProgramLabel($var) + { + GPBUtil::checkString($var, True); + $this->program_label = $var; + + return $this; + } + + /** + * Optional. Loyalty program tier of this shipping service. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers loyalty_program_tiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLoyaltyProgramTiers() + { + return $this->loyalty_program_tiers; + } + + /** + * Optional. Loyalty program tier of this shipping service. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers loyalty_program_tiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Service\LoyaltyProgram\LoyaltyProgramTiers>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLoyaltyProgramTiers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Service\LoyaltyProgram\LoyaltyProgramTiers::class); + $this->loyalty_program_tiers = $arr; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Service/LoyaltyProgram/LoyaltyProgramTiers.php b/ShoppingMerchantAccounts/src/V1beta/Service/LoyaltyProgram/LoyaltyProgramTiers.php new file mode 100644 index 000000000000..a4058843e20f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Service/LoyaltyProgram/LoyaltyProgramTiers.php @@ -0,0 +1,90 @@ +google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + */ +class LoyaltyProgramTiers extends \Google\Protobuf\Internal\Message +{ + /** + * The tier label [tier_label] sub-attribute differentiates offer level + * benefits between each tier. This value is also set in your program + * settings in Merchant Center, and is required for data source changes + * even if your loyalty program only has 1 tier. + * + * Generated from protobuf field optional string tier_label = 1; + */ + protected $tier_label = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tier_label + * The tier label [tier_label] sub-attribute differentiates offer level + * benefits between each tier. This value is also set in your program + * settings in Merchant Center, and is required for data source changes + * even if your loyalty program only has 1 tier. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * The tier label [tier_label] sub-attribute differentiates offer level + * benefits between each tier. This value is also set in your program + * settings in Merchant Center, and is required for data source changes + * even if your loyalty program only has 1 tier. + * + * Generated from protobuf field optional string tier_label = 1; + * @return string + */ + public function getTierLabel() + { + return isset($this->tier_label) ? $this->tier_label : ''; + } + + public function hasTierLabel() + { + return isset($this->tier_label); + } + + public function clearTierLabel() + { + unset($this->tier_label); + } + + /** + * The tier label [tier_label] sub-attribute differentiates offer level + * benefits between each tier. This value is also set in your program + * settings in Merchant Center, and is required for data source changes + * even if your loyalty program only has 1 tier. + * + * Generated from protobuf field optional string tier_label = 1; + * @param string $var + * @return $this + */ + public function setTierLabel($var) + { + GPBUtil::checkString($var, True); + $this->tier_label = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Service/ShipmentType.php b/ShoppingMerchantAccounts/src/V1beta/Service/ShipmentType.php new file mode 100644 index 000000000000..0f120cc67a09 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Service/ShipmentType.php @@ -0,0 +1,71 @@ +google.shopping.merchant.accounts.v1beta.Service.ShipmentType + */ +class ShipmentType +{ + /** + * This service did not specify shipment type. + * + * Generated from protobuf enum SHIPMENT_TYPE_UNSPECIFIED = 0; + */ + const SHIPMENT_TYPE_UNSPECIFIED = 0; + /** + * This service ships orders to an address chosen by the customer. + * + * Generated from protobuf enum DELIVERY = 1; + */ + const DELIVERY = 1; + /** + * This service ships orders to an address chosen by the customer. + * The order is shipped from a local store near by. + * + * Generated from protobuf enum LOCAL_DELIVERY = 2; + */ + const LOCAL_DELIVERY = 2; + /** + * This service ships orders to an address chosen by the customer. + * The order is shipped from a collection point. + * + * Generated from protobuf enum COLLECTION_POINT = 3; + */ + const COLLECTION_POINT = 3; + + private static $valueToName = [ + self::SHIPMENT_TYPE_UNSPECIFIED => 'SHIPMENT_TYPE_UNSPECIFIED', + self::DELIVERY => 'DELIVERY', + self::LOCAL_DELIVERY => 'LOCAL_DELIVERY', + self::COLLECTION_POINT => 'COLLECTION_POINT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig.php b/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig.php new file mode 100644 index 000000000000..e2f2fae94413 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig.php @@ -0,0 +1,213 @@ +google.shopping.merchant.accounts.v1beta.Service.StoreConfig + */ +class StoreConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether all stores, or selected stores, listed by this + * merchant provide local delivery. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType store_service_type = 1; + */ + protected $store_service_type = null; + /** + * Optional. A list of store codes that provide local delivery. + * If empty, then `all_stores` must be true. + * + * Generated from protobuf field repeated string store_codes = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $store_codes; + /** + * Configs related to local delivery ends for the day. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig cutoff_config = 3; + */ + protected $cutoff_config = null; + /** + * Maximum delivery radius. + * This is only required for the local delivery shipment type. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Distance service_radius = 4; + */ + protected $service_radius = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $store_service_type + * Indicates whether all stores, or selected stores, listed by this + * merchant provide local delivery. + * @type array|\Google\Protobuf\Internal\RepeatedField $store_codes + * Optional. A list of store codes that provide local delivery. + * If empty, then `all_stores` must be true. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig\CutoffConfig $cutoff_config + * Configs related to local delivery ends for the day. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Distance $service_radius + * Maximum delivery radius. + * This is only required for the local delivery shipment type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether all stores, or selected stores, listed by this + * merchant provide local delivery. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType store_service_type = 1; + * @return int + */ + public function getStoreServiceType() + { + return isset($this->store_service_type) ? $this->store_service_type : 0; + } + + public function hasStoreServiceType() + { + return isset($this->store_service_type); + } + + public function clearStoreServiceType() + { + unset($this->store_service_type); + } + + /** + * Indicates whether all stores, or selected stores, listed by this + * merchant provide local delivery. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType store_service_type = 1; + * @param int $var + * @return $this + */ + public function setStoreServiceType($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig\StoreServiceType::class); + $this->store_service_type = $var; + + return $this; + } + + /** + * Optional. A list of store codes that provide local delivery. + * If empty, then `all_stores` must be true. + * + * Generated from protobuf field repeated string store_codes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStoreCodes() + { + return $this->store_codes; + } + + /** + * Optional. A list of store codes that provide local delivery. + * If empty, then `all_stores` must be true. + * + * Generated from protobuf field repeated string store_codes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStoreCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->store_codes = $arr; + + return $this; + } + + /** + * Configs related to local delivery ends for the day. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig cutoff_config = 3; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig\CutoffConfig|null + */ + public function getCutoffConfig() + { + return $this->cutoff_config; + } + + public function hasCutoffConfig() + { + return isset($this->cutoff_config); + } + + public function clearCutoffConfig() + { + unset($this->cutoff_config); + } + + /** + * Configs related to local delivery ends for the day. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig cutoff_config = 3; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig\CutoffConfig $var + * @return $this + */ + public function setCutoffConfig($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig\CutoffConfig::class); + $this->cutoff_config = $var; + + return $this; + } + + /** + * Maximum delivery radius. + * This is only required for the local delivery shipment type. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Distance service_radius = 4; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Distance|null + */ + public function getServiceRadius() + { + return $this->service_radius; + } + + public function hasServiceRadius() + { + return isset($this->service_radius); + } + + public function clearServiceRadius() + { + unset($this->service_radius); + } + + /** + * Maximum delivery radius. + * This is only required for the local delivery shipment type. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Distance service_radius = 4; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Distance $var + * @return $this + */ + public function setServiceRadius($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Distance::class); + $this->service_radius = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/CutoffConfig.php b/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/CutoffConfig.php new file mode 100644 index 000000000000..d73c80c0f022 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/CutoffConfig.php @@ -0,0 +1,198 @@ +google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + */ +class CutoffConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Time that local delivery ends for the day. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime local_cutoff_time = 1; + */ + protected $local_cutoff_time = null; + /** + * Only valid with local delivery fulfillment. Represents cutoff time + * as the number of hours before store closing. Mutually exclusive + * with `local_cutoff_time`. + * + * Generated from protobuf field optional int64 store_close_offset_hours = 2; + */ + protected $store_close_offset_hours = null; + /** + * Merchants can opt-out of showing n+1 day local delivery when they have + * a shipping service configured to n day local delivery. For example, if + * the shipping service defines same-day delivery, and it's past the + * cut-off, setting this field to `true` results in the calculated + * shipping service rate returning `NO_DELIVERY_POST_CUTOFF`. In the + * same example, setting this field to `false` results in the calculated + * shipping time being one day. This is only for local delivery. + * + * Generated from protobuf field optional bool no_delivery_post_cutoff = 3; + */ + protected $no_delivery_post_cutoff = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig\CutoffConfig\LocalCutoffTime $local_cutoff_time + * Time that local delivery ends for the day. + * @type int|string $store_close_offset_hours + * Only valid with local delivery fulfillment. Represents cutoff time + * as the number of hours before store closing. Mutually exclusive + * with `local_cutoff_time`. + * @type bool $no_delivery_post_cutoff + * Merchants can opt-out of showing n+1 day local delivery when they have + * a shipping service configured to n day local delivery. For example, if + * the shipping service defines same-day delivery, and it's past the + * cut-off, setting this field to `true` results in the calculated + * shipping service rate returning `NO_DELIVERY_POST_CUTOFF`. In the + * same example, setting this field to `false` results in the calculated + * shipping time being one day. This is only for local delivery. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Time that local delivery ends for the day. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime local_cutoff_time = 1; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig\CutoffConfig\LocalCutoffTime|null + */ + public function getLocalCutoffTime() + { + return $this->local_cutoff_time; + } + + public function hasLocalCutoffTime() + { + return isset($this->local_cutoff_time); + } + + public function clearLocalCutoffTime() + { + unset($this->local_cutoff_time); + } + + /** + * Time that local delivery ends for the day. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime local_cutoff_time = 1; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig\CutoffConfig\LocalCutoffTime $var + * @return $this + */ + public function setLocalCutoffTime($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Service\StoreConfig\CutoffConfig\LocalCutoffTime::class); + $this->local_cutoff_time = $var; + + return $this; + } + + /** + * Only valid with local delivery fulfillment. Represents cutoff time + * as the number of hours before store closing. Mutually exclusive + * with `local_cutoff_time`. + * + * Generated from protobuf field optional int64 store_close_offset_hours = 2; + * @return int|string + */ + public function getStoreCloseOffsetHours() + { + return isset($this->store_close_offset_hours) ? $this->store_close_offset_hours : 0; + } + + public function hasStoreCloseOffsetHours() + { + return isset($this->store_close_offset_hours); + } + + public function clearStoreCloseOffsetHours() + { + unset($this->store_close_offset_hours); + } + + /** + * Only valid with local delivery fulfillment. Represents cutoff time + * as the number of hours before store closing. Mutually exclusive + * with `local_cutoff_time`. + * + * Generated from protobuf field optional int64 store_close_offset_hours = 2; + * @param int|string $var + * @return $this + */ + public function setStoreCloseOffsetHours($var) + { + GPBUtil::checkInt64($var); + $this->store_close_offset_hours = $var; + + return $this; + } + + /** + * Merchants can opt-out of showing n+1 day local delivery when they have + * a shipping service configured to n day local delivery. For example, if + * the shipping service defines same-day delivery, and it's past the + * cut-off, setting this field to `true` results in the calculated + * shipping service rate returning `NO_DELIVERY_POST_CUTOFF`. In the + * same example, setting this field to `false` results in the calculated + * shipping time being one day. This is only for local delivery. + * + * Generated from protobuf field optional bool no_delivery_post_cutoff = 3; + * @return bool + */ + public function getNoDeliveryPostCutoff() + { + return isset($this->no_delivery_post_cutoff) ? $this->no_delivery_post_cutoff : false; + } + + public function hasNoDeliveryPostCutoff() + { + return isset($this->no_delivery_post_cutoff); + } + + public function clearNoDeliveryPostCutoff() + { + unset($this->no_delivery_post_cutoff); + } + + /** + * Merchants can opt-out of showing n+1 day local delivery when they have + * a shipping service configured to n day local delivery. For example, if + * the shipping service defines same-day delivery, and it's past the + * cut-off, setting this field to `true` results in the calculated + * shipping service rate returning `NO_DELIVERY_POST_CUTOFF`. In the + * same example, setting this field to `false` results in the calculated + * shipping time being one day. This is only for local delivery. + * + * Generated from protobuf field optional bool no_delivery_post_cutoff = 3; + * @param bool $var + * @return $this + */ + public function setNoDeliveryPostCutoff($var) + { + GPBUtil::checkBool($var); + $this->no_delivery_post_cutoff = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/CutoffConfig/LocalCutoffTime.php b/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/CutoffConfig/LocalCutoffTime.php new file mode 100644 index 000000000000..456d655f5487 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/CutoffConfig/LocalCutoffTime.php @@ -0,0 +1,130 @@ +google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + */ +class LocalCutoffTime extends \Google\Protobuf\Internal\Message +{ + /** + * Hour local delivery orders must be placed by to process the same + * day. + * + * Generated from protobuf field optional int64 hour = 1; + */ + protected $hour = null; + /** + * Minute local delivery orders must be placed by to process the same + * day. + * + * Generated from protobuf field optional int64 minute = 2; + */ + protected $minute = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $hour + * Hour local delivery orders must be placed by to process the same + * day. + * @type int|string $minute + * Minute local delivery orders must be placed by to process the same + * day. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Hour local delivery orders must be placed by to process the same + * day. + * + * Generated from protobuf field optional int64 hour = 1; + * @return int|string + */ + public function getHour() + { + return isset($this->hour) ? $this->hour : 0; + } + + public function hasHour() + { + return isset($this->hour); + } + + public function clearHour() + { + unset($this->hour); + } + + /** + * Hour local delivery orders must be placed by to process the same + * day. + * + * Generated from protobuf field optional int64 hour = 1; + * @param int|string $var + * @return $this + */ + public function setHour($var) + { + GPBUtil::checkInt64($var); + $this->hour = $var; + + return $this; + } + + /** + * Minute local delivery orders must be placed by to process the same + * day. + * + * Generated from protobuf field optional int64 minute = 2; + * @return int|string + */ + public function getMinute() + { + return isset($this->minute) ? $this->minute : 0; + } + + public function hasMinute() + { + return isset($this->minute); + } + + public function clearMinute() + { + unset($this->minute); + } + + /** + * Minute local delivery orders must be placed by to process the same + * day. + * + * Generated from protobuf field optional int64 minute = 2; + * @param int|string $var + * @return $this + */ + public function setMinute($var) + { + GPBUtil::checkInt64($var); + $this->minute = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/StoreServiceType.php b/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/StoreServiceType.php new file mode 100644 index 000000000000..d5a4e0c4511c --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Service/StoreConfig/StoreServiceType.php @@ -0,0 +1,65 @@ +google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType + */ +class StoreServiceType +{ + /** + * Did not specify store service type. + * + * Generated from protobuf enum STORE_SERVICE_TYPE_UNSPECIFIED = 0; + */ + const STORE_SERVICE_TYPE_UNSPECIFIED = 0; + /** + * Indicates whether all stores, current and future, listed by this + * merchant provide local delivery. + * + * Generated from protobuf enum ALL_STORES = 1; + */ + const ALL_STORES = 1; + /** + * Indicates that only the stores listed in `store_codes` are eligible + * for local delivery. + * + * Generated from protobuf enum SELECTED_STORES = 2; + */ + const SELECTED_STORES = 2; + + private static $valueToName = [ + self::STORE_SERVICE_TYPE_UNSPECIFIED => 'STORE_SERVICE_TYPE_UNSPECIFIED', + self::ALL_STORES => 'ALL_STORES', + self::SELECTED_STORES => 'SELECTED_STORES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/ShippingSettings.php b/ShoppingMerchantAccounts/src/V1beta/ShippingSettings.php new file mode 100644 index 000000000000..ca24f2a0433c --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/ShippingSettings.php @@ -0,0 +1,222 @@ +google.shopping.merchant.accounts.v1beta.ShippingSettings + */ +class ShippingSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the shipping setting. + * Format: `accounts/{account}/shippingSetting` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The target account's list of services. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Service services = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $services; + /** + * Optional. A list of warehouses which can be referred to in `services`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Warehouse warehouses = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $warehouses; + /** + * Required. This field is used for avoid async issue. Make sure shipping + * setting data + * didn't change between get call and insert call. The user should do + * following steps: + * 1. Set etag field as empty string for initial shipping setting creation. + * 2. After initial creation, call get method to obtain an etag and current + * shipping setting data before call insert. + * 3. Modify to wanted shipping setting information. + * 4. Call insert method with the wanted shipping setting information with + * the etag obtained from step 2. + * 5. If shipping setting data changed between step 2 and step 4. Insert + * request will fail because the etag changes every time the shipping setting + * data changes. User should repeate step 2-4 with the new etag. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the shipping setting. + * Format: `accounts/{account}/shippingSetting` + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Service>|\Google\Protobuf\Internal\RepeatedField $services + * Optional. The target account's list of services. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Warehouse>|\Google\Protobuf\Internal\RepeatedField $warehouses + * Optional. A list of warehouses which can be referred to in `services`. + * @type string $etag + * Required. This field is used for avoid async issue. Make sure shipping + * setting data + * didn't change between get call and insert call. The user should do + * following steps: + * 1. Set etag field as empty string for initial shipping setting creation. + * 2. After initial creation, call get method to obtain an etag and current + * shipping setting data before call insert. + * 3. Modify to wanted shipping setting information. + * 4. Call insert method with the wanted shipping setting information with + * the etag obtained from step 2. + * 5. If shipping setting data changed between step 2 and step 4. Insert + * request will fail because the etag changes every time the shipping setting + * data changes. User should repeate step 2-4 with the new etag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the shipping setting. + * Format: `accounts/{account}/shippingSetting` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the shipping setting. + * Format: `accounts/{account}/shippingSetting` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The target account's list of services. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Service services = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServices() + { + return $this->services; + } + + /** + * Optional. The target account's list of services. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Service services = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Service>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Service::class); + $this->services = $arr; + + return $this; + } + + /** + * Optional. A list of warehouses which can be referred to in `services`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Warehouse warehouses = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarehouses() + { + return $this->warehouses; + } + + /** + * Optional. A list of warehouses which can be referred to in `services`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Warehouse warehouses = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Warehouse>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarehouses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Warehouse::class); + $this->warehouses = $arr; + + return $this; + } + + /** + * Required. This field is used for avoid async issue. Make sure shipping + * setting data + * didn't change between get call and insert call. The user should do + * following steps: + * 1. Set etag field as empty string for initial shipping setting creation. + * 2. After initial creation, call get method to obtain an etag and current + * shipping setting data before call insert. + * 3. Modify to wanted shipping setting information. + * 4. Call insert method with the wanted shipping setting information with + * the etag obtained from step 2. + * 5. If shipping setting data changed between step 2 and step 4. Insert + * request will fail because the etag changes every time the shipping setting + * data changes. User should repeate step 2-4 with the new etag. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Required. This field is used for avoid async issue. Make sure shipping + * setting data + * didn't change between get call and insert call. The user should do + * following steps: + * 1. Set etag field as empty string for initial shipping setting creation. + * 2. After initial creation, call get method to obtain an etag and current + * shipping setting data before call insert. + * 3. Modify to wanted shipping setting information. + * 4. Call insert method with the wanted shipping setting information with + * the etag obtained from step 2. + * 5. If shipping setting data changed between step 2 and step 4. Insert + * request will fail because the etag changes every time the shipping setting + * data changes. User should repeate step 2-4 with the new etag. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Table.php b/ShoppingMerchantAccounts/src/V1beta/Table.php new file mode 100644 index 000000000000..a3a047fff753 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Table.php @@ -0,0 +1,208 @@ +google.shopping.merchant.accounts.v1beta.Table + */ +class Table extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the table. Required for subtables, ignored for the main table. + * + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Required. Headers of the table's rows. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Headers row_headers = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $row_headers = null; + /** + * Headers of the table's columns. Optional: if not set then the table has + * only one dimension. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Headers column_headers = 3; + */ + protected $column_headers = null; + /** + * Required. The list of rows that constitute the table. Must have the same + * length as `row_headers`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Row rows = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rows; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the table. Required for subtables, ignored for the main table. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Headers $row_headers + * Required. Headers of the table's rows. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Headers $column_headers + * Headers of the table's columns. Optional: if not set then the table has + * only one dimension. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\Row>|\Google\Protobuf\Internal\RepeatedField $rows + * Required. The list of rows that constitute the table. Must have the same + * length as `row_headers`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Name of the table. Required for subtables, ignored for the main table. + * + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Name of the table. Required for subtables, ignored for the main table. + * + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Headers of the table's rows. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Headers row_headers = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Headers|null + */ + public function getRowHeaders() + { + return $this->row_headers; + } + + public function hasRowHeaders() + { + return isset($this->row_headers); + } + + public function clearRowHeaders() + { + unset($this->row_headers); + } + + /** + * Required. Headers of the table's rows. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Headers row_headers = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Headers $var + * @return $this + */ + public function setRowHeaders($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Headers::class); + $this->row_headers = $var; + + return $this; + } + + /** + * Headers of the table's columns. Optional: if not set then the table has + * only one dimension. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Headers column_headers = 3; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Headers|null + */ + public function getColumnHeaders() + { + return $this->column_headers; + } + + public function hasColumnHeaders() + { + return isset($this->column_headers); + } + + public function clearColumnHeaders() + { + unset($this->column_headers); + } + + /** + * Headers of the table's columns. Optional: if not set then the table has + * only one dimension. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Headers column_headers = 3; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Headers $var + * @return $this + */ + public function setColumnHeaders($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Headers::class); + $this->column_headers = $var; + + return $this; + } + + /** + * Required. The list of rows that constitute the table. Must have the same + * length as `row_headers`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Row rows = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRows() + { + return $this->rows; + } + + /** + * Required. The list of rows that constitute the table. Must have the same + * length as `row_headers`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.Row rows = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\Row::class); + $this->rows = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/TaxRule.php b/ShoppingMerchantAccounts/src/V1beta/TaxRule.php new file mode 100644 index 000000000000..1adb31a44a29 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/TaxRule.php @@ -0,0 +1,332 @@ +google.shopping.merchant.accounts.v1beta.TaxRule + */ +class TaxRule extends \Google\Protobuf\Internal\Message +{ + /** + * Region code in which this rule is applicable + * + * Generated from protobuf field string region_code = 1; + */ + protected $region_code = ''; + /** + * If set, shipping charge is taxed (at the same rate as product) when + * delivering to this admin's area. + * Can only be set on US states without category. + * + * Generated from protobuf field bool shipping_taxed = 6; + */ + protected $shipping_taxed = false; + /** + * Required. Time period when this rule is effective. If the duration is + * missing from effective_time listed, then it is open ended to the future. + * The start of this time period is inclusive, and the end is exclusive. + * + * Generated from protobuf field .google.type.Interval effective_time_period = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $effective_time_period = null; + protected $location; + protected $rate_calculation; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $location_id + * The admin_id or criteria_id of the region in which this rule is + * applicable. + * @type \Google\Shopping\Merchant\Accounts\V1beta\TaxRule\TaxPostalCodeRange $post_code_range + * The range of postal codes in which this rule is applicable. + * @type bool $use_google_rate + * Rate that depends on delivery location: if merchant has a nexus in + * corresponding US state, rates from authorities with jurisdiction over + * delivery area are added up. + * @type int|string $self_specified_rate_micros + * A fixed rate specified in micros, where 100% = 1_000_000. + * Suitable for origin-based states. + * @type string $region_code + * Region code in which this rule is applicable + * @type bool $shipping_taxed + * If set, shipping charge is taxed (at the same rate as product) when + * delivering to this admin's area. + * Can only be set on US states without category. + * @type \Google\Type\Interval $effective_time_period + * Required. Time period when this rule is effective. If the duration is + * missing from effective_time listed, then it is open ended to the future. + * The start of this time period is inclusive, and the end is exclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\TaxRule::initOnce(); + parent::__construct($data); + } + + /** + * The admin_id or criteria_id of the region in which this rule is + * applicable. + * + * Generated from protobuf field int64 location_id = 2; + * @return int|string + */ + public function getLocationId() + { + return $this->readOneof(2); + } + + public function hasLocationId() + { + return $this->hasOneof(2); + } + + /** + * The admin_id or criteria_id of the region in which this rule is + * applicable. + * + * Generated from protobuf field int64 location_id = 2; + * @param int|string $var + * @return $this + */ + public function setLocationId($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The range of postal codes in which this rule is applicable. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange post_code_range = 3; + * @return \Google\Shopping\Merchant\Accounts\V1beta\TaxRule\TaxPostalCodeRange|null + */ + public function getPostCodeRange() + { + return $this->readOneof(3); + } + + public function hasPostCodeRange() + { + return $this->hasOneof(3); + } + + /** + * The range of postal codes in which this rule is applicable. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange post_code_range = 3; + * @param \Google\Shopping\Merchant\Accounts\V1beta\TaxRule\TaxPostalCodeRange $var + * @return $this + */ + public function setPostCodeRange($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\TaxRule\TaxPostalCodeRange::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Rate that depends on delivery location: if merchant has a nexus in + * corresponding US state, rates from authorities with jurisdiction over + * delivery area are added up. + * + * Generated from protobuf field bool use_google_rate = 4; + * @return bool + */ + public function getUseGoogleRate() + { + return $this->readOneof(4); + } + + public function hasUseGoogleRate() + { + return $this->hasOneof(4); + } + + /** + * Rate that depends on delivery location: if merchant has a nexus in + * corresponding US state, rates from authorities with jurisdiction over + * delivery area are added up. + * + * Generated from protobuf field bool use_google_rate = 4; + * @param bool $var + * @return $this + */ + public function setUseGoogleRate($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A fixed rate specified in micros, where 100% = 1_000_000. + * Suitable for origin-based states. + * + * Generated from protobuf field int64 self_specified_rate_micros = 5; + * @return int|string + */ + public function getSelfSpecifiedRateMicros() + { + return $this->readOneof(5); + } + + public function hasSelfSpecifiedRateMicros() + { + return $this->hasOneof(5); + } + + /** + * A fixed rate specified in micros, where 100% = 1_000_000. + * Suitable for origin-based states. + * + * Generated from protobuf field int64 self_specified_rate_micros = 5; + * @param int|string $var + * @return $this + */ + public function setSelfSpecifiedRateMicros($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Region code in which this rule is applicable + * + * Generated from protobuf field string region_code = 1; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Region code in which this rule is applicable + * + * Generated from protobuf field string region_code = 1; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * If set, shipping charge is taxed (at the same rate as product) when + * delivering to this admin's area. + * Can only be set on US states without category. + * + * Generated from protobuf field bool shipping_taxed = 6; + * @return bool + */ + public function getShippingTaxed() + { + return $this->shipping_taxed; + } + + /** + * If set, shipping charge is taxed (at the same rate as product) when + * delivering to this admin's area. + * Can only be set on US states without category. + * + * Generated from protobuf field bool shipping_taxed = 6; + * @param bool $var + * @return $this + */ + public function setShippingTaxed($var) + { + GPBUtil::checkBool($var); + $this->shipping_taxed = $var; + + return $this; + } + + /** + * Required. Time period when this rule is effective. If the duration is + * missing from effective_time listed, then it is open ended to the future. + * The start of this time period is inclusive, and the end is exclusive. + * + * Generated from protobuf field .google.type.Interval effective_time_period = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\Interval|null + */ + public function getEffectiveTimePeriod() + { + return $this->effective_time_period; + } + + public function hasEffectiveTimePeriod() + { + return isset($this->effective_time_period); + } + + public function clearEffectiveTimePeriod() + { + unset($this->effective_time_period); + } + + /** + * Required. Time period when this rule is effective. If the duration is + * missing from effective_time listed, then it is open ended to the future. + * The start of this time period is inclusive, and the end is exclusive. + * + * Generated from protobuf field .google.type.Interval effective_time_period = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\Interval $var + * @return $this + */ + public function setEffectiveTimePeriod($var) + { + GPBUtil::checkMessage($var, \Google\Type\Interval::class); + $this->effective_time_period = $var; + + return $this; + } + + /** + * @return string + */ + public function getLocation() + { + return $this->whichOneof("location"); + } + + /** + * @return string + */ + public function getRateCalculation() + { + return $this->whichOneof("rate_calculation"); + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/TaxRule/TaxPostalCodeRange.php b/ShoppingMerchantAccounts/src/V1beta/TaxRule/TaxPostalCodeRange.php new file mode 100644 index 000000000000..4a5e1e8f2275 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/TaxRule/TaxPostalCodeRange.php @@ -0,0 +1,110 @@ +google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + */ +class TaxPostalCodeRange extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The start of the postal code range, which is also the smallest + * in the range. + * + * Generated from protobuf field string start = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start = ''; + /** + * The end of the postal code range. Will be the same as start if not + * specified. + * + * Generated from protobuf field string end = 2; + */ + protected $end = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $start + * Required. The start of the postal code range, which is also the smallest + * in the range. + * @type string $end + * The end of the postal code range. Will be the same as start if not + * specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\TaxRule::initOnce(); + parent::__construct($data); + } + + /** + * Required. The start of the postal code range, which is also the smallest + * in the range. + * + * Generated from protobuf field string start = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStart() + { + return $this->start; + } + + /** + * Required. The start of the postal code range, which is also the smallest + * in the range. + * + * Generated from protobuf field string start = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkString($var, True); + $this->start = $var; + + return $this; + } + + /** + * The end of the postal code range. Will be the same as start if not + * specified. + * + * Generated from protobuf field string end = 2; + * @return string + */ + public function getEnd() + { + return $this->end; + } + + /** + * The end of the postal code range. Will be the same as start if not + * specified. + * + * Generated from protobuf field string end = 2; + * @param string $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkString($var, True); + $this->end = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/TermsOfService.php b/ShoppingMerchantAccounts/src/V1beta/TermsOfService.php new file mode 100644 index 000000000000..ebd5ac385da8 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/TermsOfService.php @@ -0,0 +1,245 @@ +google.shopping.merchant.accounts.v1beta.TermsOfService + */ +class TermsOfService extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Region code as defined by [CLDR](https://cldr.unicode.org/). This is either + * a country where the ToS applies specifically to that country or `001` when + * the same `TermsOfService` can be signed in any country. However note that + * when signing a ToS that applies globally we still expect that a specific + * country is provided (this should be merchant business country or program + * country of participation). + * + * Generated from protobuf field string region_code = 2; + */ + protected $region_code = ''; + /** + * The Kind this terms of service version applies to. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TermsOfServiceKind kind = 3; + */ + protected $kind = 0; + /** + * URI for terms of service file that needs to be displayed to signing users. + * + * Generated from protobuf field optional string file_uri = 4; + */ + protected $file_uri = null; + /** + * Whether this terms of service version is external. External terms of + * service versions can only be agreed through external processes and not + * directly by the merchant through UI or API. + * + * Generated from protobuf field bool external = 5; + */ + protected $external = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * @type string $region_code + * Region code as defined by [CLDR](https://cldr.unicode.org/). This is either + * a country where the ToS applies specifically to that country or `001` when + * the same `TermsOfService` can be signed in any country. However note that + * when signing a ToS that applies globally we still expect that a specific + * country is provided (this should be merchant business country or program + * country of participation). + * @type int $kind + * The Kind this terms of service version applies to. + * @type string $file_uri + * URI for terms of service file that needs to be displayed to signing users. + * @type bool $external + * Whether this terms of service version is external. External terms of + * service versions can only be agreed through external processes and not + * directly by the merchant through UI or API. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Termsofservice::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Region code as defined by [CLDR](https://cldr.unicode.org/). This is either + * a country where the ToS applies specifically to that country or `001` when + * the same `TermsOfService` can be signed in any country. However note that + * when signing a ToS that applies globally we still expect that a specific + * country is provided (this should be merchant business country or program + * country of participation). + * + * Generated from protobuf field string region_code = 2; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Region code as defined by [CLDR](https://cldr.unicode.org/). This is either + * a country where the ToS applies specifically to that country or `001` when + * the same `TermsOfService` can be signed in any country. However note that + * when signing a ToS that applies globally we still expect that a specific + * country is provided (this should be merchant business country or program + * country of participation). + * + * Generated from protobuf field string region_code = 2; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * The Kind this terms of service version applies to. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TermsOfServiceKind kind = 3; + * @return int + */ + public function getKind() + { + return $this->kind; + } + + /** + * The Kind this terms of service version applies to. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TermsOfServiceKind kind = 3; + * @param int $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\TermsOfServiceKind::class); + $this->kind = $var; + + return $this; + } + + /** + * URI for terms of service file that needs to be displayed to signing users. + * + * Generated from protobuf field optional string file_uri = 4; + * @return string + */ + public function getFileUri() + { + return isset($this->file_uri) ? $this->file_uri : ''; + } + + public function hasFileUri() + { + return isset($this->file_uri); + } + + public function clearFileUri() + { + unset($this->file_uri); + } + + /** + * URI for terms of service file that needs to be displayed to signing users. + * + * Generated from protobuf field optional string file_uri = 4; + * @param string $var + * @return $this + */ + public function setFileUri($var) + { + GPBUtil::checkString($var, True); + $this->file_uri = $var; + + return $this; + } + + /** + * Whether this terms of service version is external. External terms of + * service versions can only be agreed through external processes and not + * directly by the merchant through UI or API. + * + * Generated from protobuf field bool external = 5; + * @return bool + */ + public function getExternal() + { + return $this->external; + } + + /** + * Whether this terms of service version is external. External terms of + * service versions can only be agreed through external processes and not + * directly by the merchant through UI or API. + * + * Generated from protobuf field bool external = 5; + * @param bool $var + * @return $this + */ + public function setExternal($var) + { + GPBUtil::checkBool($var); + $this->external = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/TermsOfServiceAgreementState.php b/ShoppingMerchantAccounts/src/V1beta/TermsOfServiceAgreementState.php new file mode 100644 index 000000000000..4c0889cd0a1a --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/TermsOfServiceAgreementState.php @@ -0,0 +1,254 @@ +google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + */ +class TermsOfServiceAgreementState extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Region code as defined by https://cldr.unicode.org/. This is the + * country the current state applies to. + * + * Generated from protobuf field string region_code = 2; + */ + protected $region_code = ''; + /** + * Terms of Service kind associated with the particular version. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TermsOfServiceKind terms_of_service_kind = 3; + */ + protected $terms_of_service_kind = 0; + /** + * The accepted terms of service of this kind and for the associated + * region_code + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Accepted accepted = 4; + */ + protected $accepted = null; + /** + * The required terms of service + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Required required = 5; + */ + protected $required = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * @type string $region_code + * Region code as defined by https://cldr.unicode.org/. This is the + * country the current state applies to. + * @type int $terms_of_service_kind + * Terms of Service kind associated with the particular version. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Accepted $accepted + * The accepted terms of service of this kind and for the associated + * region_code + * @type \Google\Shopping\Merchant\Accounts\V1beta\Required $required + * The required terms of service + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Termsofserviceagreementstate::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Region code as defined by https://cldr.unicode.org/. This is the + * country the current state applies to. + * + * Generated from protobuf field string region_code = 2; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Region code as defined by https://cldr.unicode.org/. This is the + * country the current state applies to. + * + * Generated from protobuf field string region_code = 2; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Terms of Service kind associated with the particular version. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TermsOfServiceKind terms_of_service_kind = 3; + * @return int + */ + public function getTermsOfServiceKind() + { + return $this->terms_of_service_kind; + } + + /** + * Terms of Service kind associated with the particular version. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.TermsOfServiceKind terms_of_service_kind = 3; + * @param int $var + * @return $this + */ + public function setTermsOfServiceKind($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\TermsOfServiceKind::class); + $this->terms_of_service_kind = $var; + + return $this; + } + + /** + * The accepted terms of service of this kind and for the associated + * region_code + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Accepted accepted = 4; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Accepted|null + */ + public function getAccepted() + { + return $this->accepted; + } + + public function hasAccepted() + { + return isset($this->accepted); + } + + public function clearAccepted() + { + unset($this->accepted); + } + + /** + * The accepted terms of service of this kind and for the associated + * region_code + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Accepted accepted = 4; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Accepted $var + * @return $this + */ + public function setAccepted($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Accepted::class); + $this->accepted = $var; + + return $this; + } + + /** + * The required terms of service + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Required required = 5; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Required|null + */ + public function getRequired() + { + return $this->required; + } + + public function hasRequired() + { + return isset($this->required); + } + + public function clearRequired() + { + unset($this->required); + } + + /** + * The required terms of service + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Required required = 5; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Required $var + * @return $this + */ + public function setRequired($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Required::class); + $this->required = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/TermsOfServiceKind.php b/ShoppingMerchantAccounts/src/V1beta/TermsOfServiceKind.php new file mode 100644 index 000000000000..62911fb3bed8 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/TermsOfServiceKind.php @@ -0,0 +1,54 @@ +google.shopping.merchant.accounts.v1beta.TermsOfServiceKind + */ +class TermsOfServiceKind +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TERMS_OF_SERVICE_KIND_UNSPECIFIED = 0; + */ + const TERMS_OF_SERVICE_KIND_UNSPECIFIED = 0; + /** + * Merchant Center application. + * + * Generated from protobuf enum MERCHANT_CENTER = 1; + */ + const MERCHANT_CENTER = 1; + + private static $valueToName = [ + self::TERMS_OF_SERVICE_KIND_UNSPECIFIED => 'TERMS_OF_SERVICE_KIND_UNSPECIFIED', + self::MERCHANT_CENTER => 'MERCHANT_CENTER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/TransitTable.php b/ShoppingMerchantAccounts/src/V1beta/TransitTable.php new file mode 100644 index 000000000000..9aac90e07367 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/TransitTable.php @@ -0,0 +1,181 @@ +google.shopping.merchant.accounts.v1beta.TransitTable + */ +class TransitTable extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of region names + * [Region.name][google.shopping.merchant.accounts.v1beta.Region.name] . The + * last value can be + * `"all other locations"`. Example: + * `["zone 1", "zone 2", "all other locations"]`. The referred + * postal code groups must match the delivery country of the service. + * + * Generated from protobuf field repeated string postal_code_group_names = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $postal_code_group_names; + /** + * Required. A list of transit time labels. The last value can be + * `"all other labels"`. Example: + * `["food", "electronics", "all other labels"]`. + * + * Generated from protobuf field repeated string transit_time_labels = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $transit_time_labels; + /** + * Required. If there's only one dimension set of `postal_code_group_names` or + * `transit_time_labels`, there are multiple rows each with one value + * for that dimension. If there are two dimensions, each row corresponds to a + * `postal_code_group_names`, and columns (values) to a + * `transit_time_labels`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow rows = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rows; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $postal_code_group_names + * Required. A list of region names + * [Region.name][google.shopping.merchant.accounts.v1beta.Region.name] . The + * last value can be + * `"all other locations"`. Example: + * `["zone 1", "zone 2", "all other locations"]`. The referred + * postal code groups must match the delivery country of the service. + * @type array|\Google\Protobuf\Internal\RepeatedField $transit_time_labels + * Required. A list of transit time labels. The last value can be + * `"all other labels"`. Example: + * `["food", "electronics", "all other labels"]`. + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\TransitTable\TransitTimeRow>|\Google\Protobuf\Internal\RepeatedField $rows + * Required. If there's only one dimension set of `postal_code_group_names` or + * `transit_time_labels`, there are multiple rows each with one value + * for that dimension. If there are two dimensions, each row corresponds to a + * `postal_code_group_names`, and columns (values) to a + * `transit_time_labels`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of region names + * [Region.name][google.shopping.merchant.accounts.v1beta.Region.name] . The + * last value can be + * `"all other locations"`. Example: + * `["zone 1", "zone 2", "all other locations"]`. The referred + * postal code groups must match the delivery country of the service. + * + * Generated from protobuf field repeated string postal_code_group_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPostalCodeGroupNames() + { + return $this->postal_code_group_names; + } + + /** + * Required. A list of region names + * [Region.name][google.shopping.merchant.accounts.v1beta.Region.name] . The + * last value can be + * `"all other locations"`. Example: + * `["zone 1", "zone 2", "all other locations"]`. The referred + * postal code groups must match the delivery country of the service. + * + * Generated from protobuf field repeated string postal_code_group_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPostalCodeGroupNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->postal_code_group_names = $arr; + + return $this; + } + + /** + * Required. A list of transit time labels. The last value can be + * `"all other labels"`. Example: + * `["food", "electronics", "all other labels"]`. + * + * Generated from protobuf field repeated string transit_time_labels = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransitTimeLabels() + { + return $this->transit_time_labels; + } + + /** + * Required. A list of transit time labels. The last value can be + * `"all other labels"`. Example: + * `["food", "electronics", "all other labels"]`. + * + * Generated from protobuf field repeated string transit_time_labels = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransitTimeLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->transit_time_labels = $arr; + + return $this; + } + + /** + * Required. If there's only one dimension set of `postal_code_group_names` or + * `transit_time_labels`, there are multiple rows each with one value + * for that dimension. If there are two dimensions, each row corresponds to a + * `postal_code_group_names`, and columns (values) to a + * `transit_time_labels`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow rows = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRows() + { + return $this->rows; + } + + /** + * Required. If there's only one dimension set of `postal_code_group_names` or + * `transit_time_labels`, there are multiple rows each with one value + * for that dimension. If there are two dimensions, each row corresponds to a + * `postal_code_group_names`, and columns (values) to a + * `transit_time_labels`. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow rows = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\TransitTable\TransitTimeRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\TransitTable\TransitTimeRow::class); + $this->rows = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/TransitTable/TransitTimeRow.php b/ShoppingMerchantAccounts/src/V1beta/TransitTable/TransitTimeRow.php new file mode 100644 index 000000000000..725147db5b22 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/TransitTable/TransitTimeRow.php @@ -0,0 +1,72 @@ +google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + */ +class TransitTimeRow extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Transit time range (min-max) in business days. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Accounts\V1beta\TransitTable\TransitTimeRow\TransitTimeValue>|\Google\Protobuf\Internal\RepeatedField $values + * Required. Transit time range (min-max) in business days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. Transit time range (min-max) in business days. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Required. Transit time range (min-max) in business days. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue values = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Shopping\Merchant\Accounts\V1beta\TransitTable\TransitTimeRow\TransitTimeValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Accounts\V1beta\TransitTable\TransitTimeRow\TransitTimeValue::class); + $this->values = $arr; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/TransitTable/TransitTimeRow/TransitTimeValue.php b/ShoppingMerchantAccounts/src/V1beta/TransitTable/TransitTimeRow/TransitTimeValue.php new file mode 100644 index 000000000000..b04797075281 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/TransitTable/TransitTimeRow/TransitTimeValue.php @@ -0,0 +1,126 @@ +google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + */ +class TransitTimeValue extends \Google\Protobuf\Internal\Message +{ + /** + * Minimum transit time range in business days. 0 means same + * day delivery, 1 means next day delivery. + * + * Generated from protobuf field optional int32 min_transit_days = 1; + */ + protected $min_transit_days = null; + /** + * Must be greater than or equal to `min_transit_days`. + * + * Generated from protobuf field optional int32 max_transit_days = 2; + */ + protected $max_transit_days = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_transit_days + * Minimum transit time range in business days. 0 means same + * day delivery, 1 means next day delivery. + * @type int $max_transit_days + * Must be greater than or equal to `min_transit_days`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Minimum transit time range in business days. 0 means same + * day delivery, 1 means next day delivery. + * + * Generated from protobuf field optional int32 min_transit_days = 1; + * @return int + */ + public function getMinTransitDays() + { + return isset($this->min_transit_days) ? $this->min_transit_days : 0; + } + + public function hasMinTransitDays() + { + return isset($this->min_transit_days); + } + + public function clearMinTransitDays() + { + unset($this->min_transit_days); + } + + /** + * Minimum transit time range in business days. 0 means same + * day delivery, 1 means next day delivery. + * + * Generated from protobuf field optional int32 min_transit_days = 1; + * @param int $var + * @return $this + */ + public function setMinTransitDays($var) + { + GPBUtil::checkInt32($var); + $this->min_transit_days = $var; + + return $this; + } + + /** + * Must be greater than or equal to `min_transit_days`. + * + * Generated from protobuf field optional int32 max_transit_days = 2; + * @return int + */ + public function getMaxTransitDays() + { + return isset($this->max_transit_days) ? $this->max_transit_days : 0; + } + + public function hasMaxTransitDays() + { + return isset($this->max_transit_days); + } + + public function clearMaxTransitDays() + { + unset($this->max_transit_days); + } + + /** + * Must be greater than or equal to `min_transit_days`. + * + * Generated from protobuf field optional int32 max_transit_days = 2; + * @param int $var + * @return $this + */ + public function setMaxTransitDays($var) + { + GPBUtil::checkInt32($var); + $this->max_transit_days = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/UnclaimHomepageRequest.php b/ShoppingMerchantAccounts/src/V1beta/UnclaimHomepageRequest.php new file mode 100644 index 000000000000..cdef87d2c32a --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/UnclaimHomepageRequest.php @@ -0,0 +1,71 @@ +google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + */ +class UnclaimHomepageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the homepage to unclaim. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the homepage to unclaim. + * Format: `accounts/{account}/homepage` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Homepage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the homepage to unclaim. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the homepage to unclaim. + * Format: `accounts/{account}/homepage` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/UpdateAccountRequest.php b/ShoppingMerchantAccounts/src/V1beta/UpdateAccountRequest.php new file mode 100644 index 000000000000..d21bc30b6f62 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/UpdateAccountRequest.php @@ -0,0 +1,136 @@ +google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + */ +class UpdateAccountRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new version of the account. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Account account = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $account = null; + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Accounts\V1beta\Account $account Required. The new version of the account. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields being updated. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\UpdateAccountRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Accounts\V1beta\Account $account, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAccount($account) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\Account $account + * Required. The new version of the account. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields being updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Accounts::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new version of the account. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Account account = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Account|null + */ + public function getAccount() + { + return $this->account; + } + + public function hasAccount() + { + return isset($this->account); + } + + public function clearAccount() + { + unset($this->account); + } + + /** + * Required. The new version of the account. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Account account = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Account $var + * @return $this + */ + public function setAccount($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Account::class); + $this->account = $var; + + return $this; + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/UpdateAccountTaxRequest.php b/ShoppingMerchantAccounts/src/V1beta/UpdateAccountTaxRequest.php new file mode 100644 index 000000000000..cc93204a575f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/UpdateAccountTaxRequest.php @@ -0,0 +1,149 @@ +google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + */ +class UpdateAccountTaxRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The tax setting that will be updated + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.AccountTax account_tax = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $account_tax = null; + /** + * The list of fields to be updated + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Accounts\V1beta\AccountTax $accountTax Required. The tax setting that will be updated + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\UpdateAccountTaxRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Accounts\V1beta\AccountTax $accountTax, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAccountTax($accountTax) + ->setUpdateMask($updateMask); + } + + /** + * @param \Google\Shopping\Merchant\Accounts\V1beta\AccountTax $accountTax Required. The tax setting that will be updated + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\UpdateAccountTaxRequest + * + * @experimental + */ + public static function buildFromAccountTax(\Google\Shopping\Merchant\Accounts\V1beta\AccountTax $accountTax): self + { + return (new self()) + ->setAccountTax($accountTax); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\AccountTax $account_tax + * Required. The tax setting that will be updated + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to be updated + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\AccountTax::initOnce(); + parent::__construct($data); + } + + /** + * Required. The tax setting that will be updated + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.AccountTax account_tax = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\AccountTax|null + */ + public function getAccountTax() + { + return $this->account_tax; + } + + public function hasAccountTax() + { + return isset($this->account_tax); + } + + public function clearAccountTax() + { + unset($this->account_tax); + } + + /** + * Required. The tax setting that will be updated + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.AccountTax account_tax = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\AccountTax $var + * @return $this + */ + public function setAccountTax($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\AccountTax::class); + $this->account_tax = $var; + + return $this; + } + + /** + * The list of fields to be updated + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The list of fields to be updated + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/UpdateBusinessIdentityRequest.php b/ShoppingMerchantAccounts/src/V1beta/UpdateBusinessIdentityRequest.php new file mode 100644 index 000000000000..7acb0c176ba2 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/UpdateBusinessIdentityRequest.php @@ -0,0 +1,136 @@ +google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + */ +class UpdateBusinessIdentityRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new version of the business identity. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity business_identity = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $business_identity = null; + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity $businessIdentity Required. The new version of the business identity. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields being updated. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\UpdateBusinessIdentityRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity $businessIdentity, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBusinessIdentity($businessIdentity) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity $business_identity + * Required. The new version of the business identity. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields being updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Businessidentity::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new version of the business identity. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity business_identity = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity|null + */ + public function getBusinessIdentity() + { + return $this->business_identity; + } + + public function hasBusinessIdentity() + { + return isset($this->business_identity); + } + + public function clearBusinessIdentity() + { + unset($this->business_identity); + } + + /** + * Required. The new version of the business identity. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessIdentity business_identity = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity $var + * @return $this + */ + public function setBusinessIdentity($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity::class); + $this->business_identity = $var; + + return $this; + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/UpdateBusinessInfoRequest.php b/ShoppingMerchantAccounts/src/V1beta/UpdateBusinessInfoRequest.php new file mode 100644 index 000000000000..28cedab3ed57 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/UpdateBusinessInfoRequest.php @@ -0,0 +1,136 @@ +google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + */ +class UpdateBusinessInfoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new version of the business info. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessInfo business_info = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $business_info = null; + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessInfo $businessInfo Required. The new version of the business info. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields being updated. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\UpdateBusinessInfoRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Accounts\V1beta\BusinessInfo $businessInfo, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBusinessInfo($businessInfo) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessInfo $business_info + * Required. The new version of the business info. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields being updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Businessinfo::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new version of the business info. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessInfo business_info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessInfo|null + */ + public function getBusinessInfo() + { + return $this->business_info; + } + + public function hasBusinessInfo() + { + return isset($this->business_info); + } + + public function clearBusinessInfo() + { + unset($this->business_info); + } + + /** + * Required. The new version of the business info. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.BusinessInfo business_info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessInfo $var + * @return $this + */ + public function setBusinessInfo($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessInfo::class); + $this->business_info = $var; + + return $this; + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/UpdateEmailPreferencesRequest.php b/ShoppingMerchantAccounts/src/V1beta/UpdateEmailPreferencesRequest.php new file mode 100644 index 000000000000..0bb941a5e69f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/UpdateEmailPreferencesRequest.php @@ -0,0 +1,136 @@ +google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + */ +class UpdateEmailPreferencesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Email Preferences to be updated. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.EmailPreferences email_preferences = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $email_preferences = null; + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Accounts\V1beta\EmailPreferences $emailPreferences Required. Email Preferences to be updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields being updated. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\UpdateEmailPreferencesRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Accounts\V1beta\EmailPreferences $emailPreferences, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setEmailPreferences($emailPreferences) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\EmailPreferences $email_preferences + * Required. Email Preferences to be updated. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields being updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Emailpreferences::initOnce(); + parent::__construct($data); + } + + /** + * Required. Email Preferences to be updated. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.EmailPreferences email_preferences = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\EmailPreferences|null + */ + public function getEmailPreferences() + { + return $this->email_preferences; + } + + public function hasEmailPreferences() + { + return isset($this->email_preferences); + } + + public function clearEmailPreferences() + { + unset($this->email_preferences); + } + + /** + * Required. Email Preferences to be updated. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.EmailPreferences email_preferences = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\EmailPreferences $var + * @return $this + */ + public function setEmailPreferences($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\EmailPreferences::class); + $this->email_preferences = $var; + + return $this; + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/UpdateHomepageRequest.php b/ShoppingMerchantAccounts/src/V1beta/UpdateHomepageRequest.php new file mode 100644 index 000000000000..fa0b2bb491a0 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/UpdateHomepageRequest.php @@ -0,0 +1,136 @@ +google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + */ +class UpdateHomepageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new version of the homepage. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Homepage homepage = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $homepage = null; + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Accounts\V1beta\Homepage $homepage Required. The new version of the homepage. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields being updated. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\UpdateHomepageRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Accounts\V1beta\Homepage $homepage, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setHomepage($homepage) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\Homepage $homepage + * Required. The new version of the homepage. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields being updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Homepage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new version of the homepage. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Homepage homepage = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Homepage|null + */ + public function getHomepage() + { + return $this->homepage; + } + + public function hasHomepage() + { + return isset($this->homepage); + } + + public function clearHomepage() + { + unset($this->homepage); + } + + /** + * Required. The new version of the homepage. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Homepage homepage = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Homepage $var + * @return $this + */ + public function setHomepage($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Homepage::class); + $this->homepage = $var; + + return $this; + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/UpdateRegionRequest.php b/ShoppingMerchantAccounts/src/V1beta/UpdateRegionRequest.php new file mode 100644 index 000000000000..1aab80c12999 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/UpdateRegionRequest.php @@ -0,0 +1,146 @@ +google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + */ +class UpdateRegionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated region. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region region = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = null; + /** + * Optional. The comma-separated field mask indicating the fields to update. + * Example: + * `"displayName,postalCodeArea.regionCode"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Accounts\V1beta\Region $region Required. The updated region. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The comma-separated field mask indicating the fields to update. + * Example: + * `"displayName,postalCodeArea.regionCode"`. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\UpdateRegionRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Accounts\V1beta\Region $region, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setRegion($region) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\Region $region + * Required. The updated region. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The comma-separated field mask indicating the fields to update. + * Example: + * `"displayName,postalCodeArea.regionCode"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Regions::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated region. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region region = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Region|null + */ + public function getRegion() + { + return $this->region; + } + + public function hasRegion() + { + return isset($this->region); + } + + public function clearRegion() + { + unset($this->region); + } + + /** + * Required. The updated region. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.Region region = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Region $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Region::class); + $this->region = $var; + + return $this; + } + + /** + * Optional. The comma-separated field mask indicating the fields to update. + * Example: + * `"displayName,postalCodeArea.regionCode"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The comma-separated field mask indicating the fields to update. + * Example: + * `"displayName,postalCodeArea.regionCode"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/UpdateUserRequest.php b/ShoppingMerchantAccounts/src/V1beta/UpdateUserRequest.php new file mode 100644 index 000000000000..8f89b75ed4a0 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/UpdateUserRequest.php @@ -0,0 +1,147 @@ +google.shopping.merchant.accounts.v1beta.UpdateUserRequest + */ +class UpdateUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new version of the user. + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.User user = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user = null; + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Accounts\V1beta\User $user Required. The new version of the user. + * + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields being updated. + * + * @return \Google\Shopping\Merchant\Accounts\V1beta\UpdateUserRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Accounts\V1beta\User $user, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setUser($user) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Accounts\V1beta\User $user + * Required. The new version of the user. + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields being updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\User::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new version of the user. + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.User user = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Required. The new version of the user. + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.User user = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\User::class); + $this->user = $var; + + return $this; + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/User.php b/ShoppingMerchantAccounts/src/V1beta/User.php new file mode 100644 index 000000000000..47cf3940cee7 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/User.php @@ -0,0 +1,155 @@ +google.shopping.merchant.accounts.v1beta.User + */ +class User extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the user. + * Format: `accounts/{account}/user/{email}` + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The state of the user. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.User.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. The [access + * rights](https://support.google.com/merchants/answer/12160472?sjid=6789834943175119429-EU#accesstypes) + * the user has. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccessRight access_rights = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $access_rights; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the user. + * Format: `accounts/{account}/user/{email}` + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * @type int $state + * Output only. The state of the user. + * @type array|\Google\Protobuf\Internal\RepeatedField $access_rights + * Optional. The [access + * rights](https://support.google.com/merchants/answer/12160472?sjid=6789834943175119429-EU#accesstypes) + * the user has. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\User::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the user. + * Format: `accounts/{account}/user/{email}` + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the user. + * Format: `accounts/{account}/user/{email}` + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The state of the user. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.User.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the user. + * + * Generated from protobuf field .google.shopping.merchant.accounts.v1beta.User.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Accounts\V1beta\User\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. The [access + * rights](https://support.google.com/merchants/answer/12160472?sjid=6789834943175119429-EU#accesstypes) + * the user has. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccessRight access_rights = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessRights() + { + return $this->access_rights; + } + + /** + * Optional. The [access + * rights](https://support.google.com/merchants/answer/12160472?sjid=6789834943175119429-EU#accesstypes) + * the user has. + * + * Generated from protobuf field repeated .google.shopping.merchant.accounts.v1beta.AccessRight access_rights = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessRights($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Shopping\Merchant\Accounts\V1beta\AccessRight::class); + $this->access_rights = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/User/State.php b/ShoppingMerchantAccounts/src/V1beta/User/State.php new file mode 100644 index 000000000000..fc4bbc4f423b --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/User/State.php @@ -0,0 +1,63 @@ +google.shopping.merchant.accounts.v1beta.User.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The user is pending confirmation. In this state, the user first needs to + * accept the invitation before performing other actions. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The user is verified. + * + * Generated from protobuf enum VERIFIED = 2; + */ + const VERIFIED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::VERIFIED => 'VERIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantAccounts/src/V1beta/Value.php b/ShoppingMerchantAccounts/src/V1beta/Value.php new file mode 100644 index 000000000000..2dec763a7c37 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Value.php @@ -0,0 +1,276 @@ +google.shopping.merchant.accounts.v1beta.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + /** + * If true, then the product can't be shipped. Must be true when set, can only + * be set if all other fields are not set. + * + * Generated from protobuf field optional bool no_shipping = 1; + */ + protected $no_shipping = null; + /** + * A flat rate. Can only be set if all other fields are not set. + * + * Generated from protobuf field optional .google.shopping.type.Price flat_rate = 2; + */ + protected $flat_rate = null; + /** + * A percentage of the price represented as a number in decimal notation + * (For example, `"5.4"`). Can only be set if all other fields are not + * set. + * + * Generated from protobuf field optional string price_percentage = 3; + */ + protected $price_percentage = null; + /** + * The name of a carrier rate referring to a carrier rate defined in the + * same rate group. Can only be set if all other fields are not set. + * + * Generated from protobuf field optional string carrier_rate = 4; + */ + protected $carrier_rate = null; + /** + * The name of a subtable. Can only be set in table cells (For example, not + * for single values), and only if all other fields are not set. + * + * Generated from protobuf field optional string subtable = 5; + */ + protected $subtable = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $no_shipping + * If true, then the product can't be shipped. Must be true when set, can only + * be set if all other fields are not set. + * @type \Google\Shopping\Type\Price $flat_rate + * A flat rate. Can only be set if all other fields are not set. + * @type string $price_percentage + * A percentage of the price represented as a number in decimal notation + * (For example, `"5.4"`). Can only be set if all other fields are not + * set. + * @type string $carrier_rate + * The name of a carrier rate referring to a carrier rate defined in the + * same rate group. Can only be set if all other fields are not set. + * @type string $subtable + * The name of a subtable. Can only be set in table cells (For example, not + * for single values), and only if all other fields are not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * If true, then the product can't be shipped. Must be true when set, can only + * be set if all other fields are not set. + * + * Generated from protobuf field optional bool no_shipping = 1; + * @return bool + */ + public function getNoShipping() + { + return isset($this->no_shipping) ? $this->no_shipping : false; + } + + public function hasNoShipping() + { + return isset($this->no_shipping); + } + + public function clearNoShipping() + { + unset($this->no_shipping); + } + + /** + * If true, then the product can't be shipped. Must be true when set, can only + * be set if all other fields are not set. + * + * Generated from protobuf field optional bool no_shipping = 1; + * @param bool $var + * @return $this + */ + public function setNoShipping($var) + { + GPBUtil::checkBool($var); + $this->no_shipping = $var; + + return $this; + } + + /** + * A flat rate. Can only be set if all other fields are not set. + * + * Generated from protobuf field optional .google.shopping.type.Price flat_rate = 2; + * @return \Google\Shopping\Type\Price|null + */ + public function getFlatRate() + { + return $this->flat_rate; + } + + public function hasFlatRate() + { + return isset($this->flat_rate); + } + + public function clearFlatRate() + { + unset($this->flat_rate); + } + + /** + * A flat rate. Can only be set if all other fields are not set. + * + * Generated from protobuf field optional .google.shopping.type.Price flat_rate = 2; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setFlatRate($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->flat_rate = $var; + + return $this; + } + + /** + * A percentage of the price represented as a number in decimal notation + * (For example, `"5.4"`). Can only be set if all other fields are not + * set. + * + * Generated from protobuf field optional string price_percentage = 3; + * @return string + */ + public function getPricePercentage() + { + return isset($this->price_percentage) ? $this->price_percentage : ''; + } + + public function hasPricePercentage() + { + return isset($this->price_percentage); + } + + public function clearPricePercentage() + { + unset($this->price_percentage); + } + + /** + * A percentage of the price represented as a number in decimal notation + * (For example, `"5.4"`). Can only be set if all other fields are not + * set. + * + * Generated from protobuf field optional string price_percentage = 3; + * @param string $var + * @return $this + */ + public function setPricePercentage($var) + { + GPBUtil::checkString($var, True); + $this->price_percentage = $var; + + return $this; + } + + /** + * The name of a carrier rate referring to a carrier rate defined in the + * same rate group. Can only be set if all other fields are not set. + * + * Generated from protobuf field optional string carrier_rate = 4; + * @return string + */ + public function getCarrierRate() + { + return isset($this->carrier_rate) ? $this->carrier_rate : ''; + } + + public function hasCarrierRate() + { + return isset($this->carrier_rate); + } + + public function clearCarrierRate() + { + unset($this->carrier_rate); + } + + /** + * The name of a carrier rate referring to a carrier rate defined in the + * same rate group. Can only be set if all other fields are not set. + * + * Generated from protobuf field optional string carrier_rate = 4; + * @param string $var + * @return $this + */ + public function setCarrierRate($var) + { + GPBUtil::checkString($var, True); + $this->carrier_rate = $var; + + return $this; + } + + /** + * The name of a subtable. Can only be set in table cells (For example, not + * for single values), and only if all other fields are not set. + * + * Generated from protobuf field optional string subtable = 5; + * @return string + */ + public function getSubtable() + { + return isset($this->subtable) ? $this->subtable : ''; + } + + public function hasSubtable() + { + return isset($this->subtable); + } + + public function clearSubtable() + { + unset($this->subtable); + } + + /** + * The name of a subtable. Can only be set in table cells (For example, not + * for single values), and only if all other fields are not set. + * + * Generated from protobuf field optional string subtable = 5; + * @param string $var + * @return $this + */ + public function setSubtable($var) + { + GPBUtil::checkString($var, True); + $this->subtable = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/Warehouse.php b/ShoppingMerchantAccounts/src/V1beta/Warehouse.php new file mode 100644 index 000000000000..8d730a158dd5 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/Warehouse.php @@ -0,0 +1,274 @@ +google.shopping.merchant.accounts.v1beta.Warehouse + */ +class Warehouse extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the warehouse. Must be unique within account. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = null; + /** + * Required. Shipping address of the warehouse. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Address shipping_address = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $shipping_address = null; + /** + * Required. The latest time of day that an order can be accepted and begin + * processing. Later orders will be processed in the next day. The time is + * based on the warehouse postal code. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime cutoff_time = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cutoff_time = null; + /** + * Required. The number of days it takes for this warehouse to pack up and + * ship an item. This is on the warehouse level, but can be overridden on the + * offer level based on the attributes of an item. + * + * Generated from protobuf field optional int64 handling_days = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $handling_days = null; + /** + * Business days of the warehouse. + * If not set, will be Monday to Friday by default. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.BusinessDayConfig business_day_config = 5; + */ + protected $business_day_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the warehouse. Must be unique within account. + * @type \Google\Shopping\Merchant\Accounts\V1beta\Address $shipping_address + * Required. Shipping address of the warehouse. + * @type \Google\Shopping\Merchant\Accounts\V1beta\WarehouseCutoffTime $cutoff_time + * Required. The latest time of day that an order can be accepted and begin + * processing. Later orders will be processed in the next day. The time is + * based on the warehouse postal code. + * @type int|string $handling_days + * Required. The number of days it takes for this warehouse to pack up and + * ship an item. This is on the warehouse level, but can be overridden on the + * offer level based on the attributes of an item. + * @type \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig $business_day_config + * Business days of the warehouse. + * If not set, will be Monday to Friday by default. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the warehouse. Must be unique within account. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Required. The name of the warehouse. Must be unique within account. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Shipping address of the warehouse. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Address shipping_address = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\Address|null + */ + public function getShippingAddress() + { + return $this->shipping_address; + } + + public function hasShippingAddress() + { + return isset($this->shipping_address); + } + + public function clearShippingAddress() + { + unset($this->shipping_address); + } + + /** + * Required. Shipping address of the warehouse. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.Address shipping_address = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\Address $var + * @return $this + */ + public function setShippingAddress($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\Address::class); + $this->shipping_address = $var; + + return $this; + } + + /** + * Required. The latest time of day that an order can be accepted and begin + * processing. Later orders will be processed in the next day. The time is + * based on the warehouse postal code. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime cutoff_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Accounts\V1beta\WarehouseCutoffTime|null + */ + public function getCutoffTime() + { + return $this->cutoff_time; + } + + public function hasCutoffTime() + { + return isset($this->cutoff_time); + } + + public function clearCutoffTime() + { + unset($this->cutoff_time); + } + + /** + * Required. The latest time of day that an order can be accepted and begin + * processing. Later orders will be processed in the next day. The time is + * based on the warehouse postal code. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime cutoff_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Accounts\V1beta\WarehouseCutoffTime $var + * @return $this + */ + public function setCutoffTime($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\WarehouseCutoffTime::class); + $this->cutoff_time = $var; + + return $this; + } + + /** + * Required. The number of days it takes for this warehouse to pack up and + * ship an item. This is on the warehouse level, but can be overridden on the + * offer level based on the attributes of an item. + * + * Generated from protobuf field optional int64 handling_days = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getHandlingDays() + { + return isset($this->handling_days) ? $this->handling_days : 0; + } + + public function hasHandlingDays() + { + return isset($this->handling_days); + } + + public function clearHandlingDays() + { + unset($this->handling_days); + } + + /** + * Required. The number of days it takes for this warehouse to pack up and + * ship an item. This is on the warehouse level, but can be overridden on the + * offer level based on the attributes of an item. + * + * Generated from protobuf field optional int64 handling_days = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setHandlingDays($var) + { + GPBUtil::checkInt64($var); + $this->handling_days = $var; + + return $this; + } + + /** + * Business days of the warehouse. + * If not set, will be Monday to Friday by default. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.BusinessDayConfig business_day_config = 5; + * @return \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig|null + */ + public function getBusinessDayConfig() + { + return $this->business_day_config; + } + + public function hasBusinessDayConfig() + { + return isset($this->business_day_config); + } + + public function clearBusinessDayConfig() + { + unset($this->business_day_config); + } + + /** + * Business days of the warehouse. + * If not set, will be Monday to Friday by default. + * + * Generated from protobuf field optional .google.shopping.merchant.accounts.v1beta.BusinessDayConfig business_day_config = 5; + * @param \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig $var + * @return $this + */ + public function setBusinessDayConfig($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Accounts\V1beta\BusinessDayConfig::class); + $this->business_day_config = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/WarehouseBasedDeliveryTime.php b/ShoppingMerchantAccounts/src/V1beta/WarehouseBasedDeliveryTime.php new file mode 100644 index 000000000000..c8486fd2ffa8 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/WarehouseBasedDeliveryTime.php @@ -0,0 +1,176 @@ +google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + */ +class WarehouseBasedDeliveryTime extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Carrier, such as `"UPS"` or `"Fedex"`. + * + * Generated from protobuf field optional string carrier = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $carrier = null; + /** + * Required. Carrier service, such as `"ground"` or `"2 days"`. The name of + * the service must be in the eddSupportedServices list. + * + * Generated from protobuf field optional string carrier_service = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $carrier_service = null; + /** + * Required. Warehouse name. This should match + * [warehouse][ShippingSetting.warehouses.name] + * + * Generated from protobuf field optional string warehouse = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $warehouse = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $carrier + * Required. Carrier, such as `"UPS"` or `"Fedex"`. + * @type string $carrier_service + * Required. Carrier service, such as `"ground"` or `"2 days"`. The name of + * the service must be in the eddSupportedServices list. + * @type string $warehouse + * Required. Warehouse name. This should match + * [warehouse][ShippingSetting.warehouses.name] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. Carrier, such as `"UPS"` or `"Fedex"`. + * + * Generated from protobuf field optional string carrier = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCarrier() + { + return isset($this->carrier) ? $this->carrier : ''; + } + + public function hasCarrier() + { + return isset($this->carrier); + } + + public function clearCarrier() + { + unset($this->carrier); + } + + /** + * Required. Carrier, such as `"UPS"` or `"Fedex"`. + * + * Generated from protobuf field optional string carrier = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCarrier($var) + { + GPBUtil::checkString($var, True); + $this->carrier = $var; + + return $this; + } + + /** + * Required. Carrier service, such as `"ground"` or `"2 days"`. The name of + * the service must be in the eddSupportedServices list. + * + * Generated from protobuf field optional string carrier_service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCarrierService() + { + return isset($this->carrier_service) ? $this->carrier_service : ''; + } + + public function hasCarrierService() + { + return isset($this->carrier_service); + } + + public function clearCarrierService() + { + unset($this->carrier_service); + } + + /** + * Required. Carrier service, such as `"ground"` or `"2 days"`. The name of + * the service must be in the eddSupportedServices list. + * + * Generated from protobuf field optional string carrier_service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCarrierService($var) + { + GPBUtil::checkString($var, True); + $this->carrier_service = $var; + + return $this; + } + + /** + * Required. Warehouse name. This should match + * [warehouse][ShippingSetting.warehouses.name] + * + * Generated from protobuf field optional string warehouse = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getWarehouse() + { + return isset($this->warehouse) ? $this->warehouse : ''; + } + + public function hasWarehouse() + { + return isset($this->warehouse); + } + + public function clearWarehouse() + { + unset($this->warehouse); + } + + /** + * Required. Warehouse name. This should match + * [warehouse][ShippingSetting.warehouses.name] + * + * Generated from protobuf field optional string warehouse = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setWarehouse($var) + { + GPBUtil::checkString($var, True); + $this->warehouse = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/WarehouseCutoffTime.php b/ShoppingMerchantAccounts/src/V1beta/WarehouseCutoffTime.php new file mode 100644 index 000000000000..15aae9579c08 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/WarehouseCutoffTime.php @@ -0,0 +1,139 @@ +google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + */ +class WarehouseCutoffTime extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Hour of the cutoff time until which an order has to be placed to + * be processed in the same day by the warehouse. Hour is based on the + * timezone of warehouse. + * + * Generated from protobuf field optional int32 hour = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $hour = null; + /** + * Required. Minute of the cutoff time until which an order has to be placed + * to be processed in the same day by the warehouse. Minute is based on the + * timezone of warehouse. + * + * Generated from protobuf field optional int32 minute = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $minute = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $hour + * Required. Hour of the cutoff time until which an order has to be placed to + * be processed in the same day by the warehouse. Hour is based on the + * timezone of warehouse. + * @type int $minute + * Required. Minute of the cutoff time until which an order has to be placed + * to be processed in the same day by the warehouse. Minute is based on the + * timezone of warehouse. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Accounts\V1Beta\Shippingsettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. Hour of the cutoff time until which an order has to be placed to + * be processed in the same day by the warehouse. Hour is based on the + * timezone of warehouse. + * + * Generated from protobuf field optional int32 hour = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getHour() + { + return isset($this->hour) ? $this->hour : 0; + } + + public function hasHour() + { + return isset($this->hour); + } + + public function clearHour() + { + unset($this->hour); + } + + /** + * Required. Hour of the cutoff time until which an order has to be placed to + * be processed in the same day by the warehouse. Hour is based on the + * timezone of warehouse. + * + * Generated from protobuf field optional int32 hour = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setHour($var) + { + GPBUtil::checkInt32($var); + $this->hour = $var; + + return $this; + } + + /** + * Required. Minute of the cutoff time until which an order has to be placed + * to be processed in the same day by the warehouse. Minute is based on the + * timezone of warehouse. + * + * Generated from protobuf field optional int32 minute = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMinute() + { + return isset($this->minute) ? $this->minute : 0; + } + + public function hasMinute() + { + return isset($this->minute); + } + + public function clearMinute() + { + unset($this->minute); + } + + /** + * Required. Minute of the cutoff time until which an order has to be placed + * to be processed in the same day by the warehouse. Minute is based on the + * timezone of warehouse. + * + * Generated from protobuf field optional int32 minute = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMinute($var) + { + GPBUtil::checkInt32($var); + $this->minute = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantAccounts/src/V1beta/gapic_metadata.json b/ShoppingMerchantAccounts/src/V1beta/gapic_metadata.json new file mode 100644 index 000000000000..afecdaeb028d --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/gapic_metadata.json @@ -0,0 +1,350 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.shopping.merchant.accounts.v1beta", + "libraryPackage": "Google\\Shopping\\Merchant\\Accounts\\V1beta", + "services": { + "AccountTaxService": { + "clients": { + "grpc": { + "libraryClient": "AccountTaxServiceGapicClient", + "rpcs": { + "GetAccountTax": { + "methods": [ + "getAccountTax" + ] + }, + "ListAccountTax": { + "methods": [ + "listAccountTax" + ] + }, + "UpdateAccountTax": { + "methods": [ + "updateAccountTax" + ] + } + } + } + } + }, + "AccountIssueService": { + "clients": { + "grpc": { + "libraryClient": "AccountIssueServiceGapicClient", + "rpcs": { + "ListAccountIssues": { + "methods": [ + "listAccountIssues" + ] + } + } + } + } + }, + "UserService": { + "clients": { + "grpc": { + "libraryClient": "UserServiceGapicClient", + "rpcs": { + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "ListUsers": { + "methods": [ + "listUsers" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + } + } + } + } + }, + "AccountsService": { + "clients": { + "grpc": { + "libraryClient": "AccountsServiceGapicClient", + "rpcs": { + "CreateAndConfigureAccount": { + "methods": [ + "createAndConfigureAccount" + ] + }, + "DeleteAccount": { + "methods": [ + "deleteAccount" + ] + }, + "GetAccount": { + "methods": [ + "getAccount" + ] + }, + "ListAccounts": { + "methods": [ + "listAccounts" + ] + }, + "ListSubAccounts": { + "methods": [ + "listSubAccounts" + ] + }, + "UpdateAccount": { + "methods": [ + "updateAccount" + ] + } + } + } + } + }, + "BusinessIdentityService": { + "clients": { + "grpc": { + "libraryClient": "BusinessIdentityServiceGapicClient", + "rpcs": { + "GetBusinessIdentity": { + "methods": [ + "getBusinessIdentity" + ] + }, + "UpdateBusinessIdentity": { + "methods": [ + "updateBusinessIdentity" + ] + } + } + } + } + }, + "BusinessInfoService": { + "clients": { + "grpc": { + "libraryClient": "BusinessInfoServiceGapicClient", + "rpcs": { + "GetBusinessInfo": { + "methods": [ + "getBusinessInfo" + ] + }, + "UpdateBusinessInfo": { + "methods": [ + "updateBusinessInfo" + ] + } + } + } + } + }, + "EmailPreferencesService": { + "clients": { + "grpc": { + "libraryClient": "EmailPreferencesServiceGapicClient", + "rpcs": { + "GetEmailPreferences": { + "methods": [ + "getEmailPreferences" + ] + }, + "UpdateEmailPreferences": { + "methods": [ + "updateEmailPreferences" + ] + } + } + } + } + }, + "HomepageService": { + "clients": { + "grpc": { + "libraryClient": "HomepageServiceGapicClient", + "rpcs": { + "ClaimHomepage": { + "methods": [ + "claimHomepage" + ] + }, + "GetHomepage": { + "methods": [ + "getHomepage" + ] + }, + "UnclaimHomepage": { + "methods": [ + "unclaimHomepage" + ] + }, + "UpdateHomepage": { + "methods": [ + "updateHomepage" + ] + } + } + } + } + }, + "OnlineReturnPolicyService": { + "clients": { + "grpc": { + "libraryClient": "OnlineReturnPolicyServiceGapicClient", + "rpcs": { + "GetOnlineReturnPolicy": { + "methods": [ + "getOnlineReturnPolicy" + ] + }, + "ListOnlineReturnPolicies": { + "methods": [ + "listOnlineReturnPolicies" + ] + } + } + } + } + }, + "ProgramsService": { + "clients": { + "grpc": { + "libraryClient": "ProgramsServiceGapicClient", + "rpcs": { + "DisableProgram": { + "methods": [ + "disableProgram" + ] + }, + "EnableProgram": { + "methods": [ + "enableProgram" + ] + }, + "GetProgram": { + "methods": [ + "getProgram" + ] + }, + "ListPrograms": { + "methods": [ + "listPrograms" + ] + } + } + } + } + }, + "RegionsService": { + "clients": { + "grpc": { + "libraryClient": "RegionsServiceGapicClient", + "rpcs": { + "CreateRegion": { + "methods": [ + "createRegion" + ] + }, + "DeleteRegion": { + "methods": [ + "deleteRegion" + ] + }, + "GetRegion": { + "methods": [ + "getRegion" + ] + }, + "ListRegions": { + "methods": [ + "listRegions" + ] + }, + "UpdateRegion": { + "methods": [ + "updateRegion" + ] + } + } + } + } + }, + "ShippingSettingsService": { + "clients": { + "grpc": { + "libraryClient": "ShippingSettingsServiceGapicClient", + "rpcs": { + "GetShippingSettings": { + "methods": [ + "getShippingSettings" + ] + }, + "InsertShippingSettings": { + "methods": [ + "insertShippingSettings" + ] + } + } + } + } + }, + "TermsOfServiceService": { + "clients": { + "grpc": { + "libraryClient": "TermsOfServiceServiceGapicClient", + "rpcs": { + "AcceptTermsOfService": { + "methods": [ + "acceptTermsOfService" + ] + }, + "GetTermsOfService": { + "methods": [ + "getTermsOfService" + ] + }, + "RetrieveLatestTermsOfService": { + "methods": [ + "retrieveLatestTermsOfService" + ] + } + } + } + } + }, + "TermsOfServiceAgreementStateService": { + "clients": { + "grpc": { + "libraryClient": "TermsOfServiceAgreementStateServiceGapicClient", + "rpcs": { + "GetTermsOfServiceAgreementState": { + "methods": [ + "getTermsOfServiceAgreementState" + ] + }, + "RetrieveForApplicationTermsOfServiceAgreementState": { + "methods": [ + "retrieveForApplicationTermsOfServiceAgreementState" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_client_config.json new file mode 100644 index 000000000000..f88a7f01dba0 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_client_config.json @@ -0,0 +1,27 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.AccountIssueService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "ListAccountIssues": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_descriptor_config.php new file mode 100644 index 000000000000..e83bab368ace --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_descriptor_config.php @@ -0,0 +1,51 @@ + [ + 'google.shopping.merchant.accounts.v1beta.AccountIssueService' => [ + 'ListAccountIssues' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAccountIssues', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ListAccountIssuesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_rest_client_config.php new file mode 100644 index 000000000000..adf65d1d40fe --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/account_issue_service_rest_client_config.php @@ -0,0 +1,40 @@ + [ + 'google.shopping.merchant.accounts.v1beta.AccountIssueService' => [ + 'ListAccountIssues' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/issues', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_client_config.json new file mode 100644 index 000000000000..442e17235466 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.AccountTaxService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "GetAccountTax": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListAccountTax": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateAccountTax": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_descriptor_config.php new file mode 100644 index 000000000000..93361bb90f3f --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_descriptor_config.php @@ -0,0 +1,77 @@ + [ + 'google.shopping.merchant.accounts.v1beta.AccountTaxService' => [ + 'GetAccountTax' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\AccountTax', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAccountTax' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAccountTaxes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ListAccountTaxResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAccountTax' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\AccountTax', + 'headerParams' => [ + [ + 'keyName' => 'account_tax.name', + 'fieldAccessors' => [ + 'getAccountTax', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'accountTax' => 'accounts/{account}/accounttax/{tax}', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_rest_client_config.php new file mode 100644 index 000000000000..8f8acbb9fec5 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/account_tax_service_rest_client_config.php @@ -0,0 +1,64 @@ + [ + 'google.shopping.merchant.accounts.v1beta.AccountTaxService' => [ + 'GetAccountTax' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/accounttax/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAccountTax' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/accounttax', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAccountTax' => [ + 'method' => 'patch', + 'uriTemplate' => '/accounts/v1beta/{account_tax.name=accounts/*/accounttax/*}', + 'body' => 'account_tax', + 'placeholders' => [ + 'account_tax.name' => [ + 'getters' => [ + 'getAccountTax', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_client_config.json new file mode 100644 index 000000000000..344c72e6d186 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.AccountsService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateAndConfigureAccount": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteAccount": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetAccount": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListAccounts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSubAccounts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateAccount": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_descriptor_config.php new file mode 100644 index 000000000000..9b02ca020fa0 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_descriptor_config.php @@ -0,0 +1,106 @@ + [ + 'google.shopping.merchant.accounts.v1beta.AccountsService' => [ + 'CreateAndConfigureAccount' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Account', + ], + 'DeleteAccount' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAccount' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Account', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAccounts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAccounts', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ListAccountsResponse', + ], + 'ListSubAccounts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAccounts', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ListSubAccountsResponse', + 'headerParams' => [ + [ + 'keyName' => 'provider', + 'fieldAccessors' => [ + 'getProvider', + ], + ], + ], + ], + 'UpdateAccount' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Account', + 'headerParams' => [ + [ + 'keyName' => 'account.name', + 'fieldAccessors' => [ + 'getAccount', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'termsOfService' => 'termsOfService/{version}', + 'user' => 'accounts/{account}/users/{email}', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_rest_client_config.php new file mode 100644 index 000000000000..25b104ba8c1d --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/accounts_service_rest_client_config.php @@ -0,0 +1,87 @@ + [ + 'google.shopping.merchant.accounts.v1beta.AccountsService' => [ + 'CreateAndConfigureAccount' => [ + 'method' => 'post', + 'uriTemplate' => '/accounts/v1beta/accounts:createAndConfigure', + 'body' => '*', + ], + 'DeleteAccount' => [ + 'method' => 'delete', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAccount' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAccounts' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/accounts', + ], + 'ListSubAccounts' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{provider=accounts/*}:listSubaccounts', + 'placeholders' => [ + 'provider' => [ + 'getters' => [ + 'getProvider', + ], + ], + ], + ], + 'UpdateAccount' => [ + 'method' => 'patch', + 'uriTemplate' => '/accounts/v1beta/{account.name=accounts/*}', + 'body' => 'account', + 'placeholders' => [ + 'account.name' => [ + 'getters' => [ + 'getAccount', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_client_config.json new file mode 100644 index 000000000000..e76226539f3a --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.BusinessIdentityService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "GetBusinessIdentity": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateBusinessIdentity": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_descriptor_config.php new file mode 100644 index 000000000000..6b9b9c7acfa3 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_descriptor_config.php @@ -0,0 +1,56 @@ + [ + 'google.shopping.merchant.accounts.v1beta.BusinessIdentityService' => [ + 'GetBusinessIdentity' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBusinessIdentity' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\BusinessIdentity', + 'headerParams' => [ + [ + 'keyName' => 'business_identity.name', + 'fieldAccessors' => [ + 'getBusinessIdentity', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'businessIdentity' => 'accounts/{account}/businessIdentity', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_rest_client_config.php new file mode 100644 index 000000000000..4b881021701c --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/business_identity_service_rest_client_config.php @@ -0,0 +1,56 @@ + [ + 'google.shopping.merchant.accounts.v1beta.BusinessIdentityService' => [ + 'GetBusinessIdentity' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/businessIdentity}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBusinessIdentity' => [ + 'method' => 'patch', + 'uriTemplate' => '/accounts/v1beta/{business_identity.name=accounts/*/businessIdentity}', + 'body' => 'business_identity', + 'placeholders' => [ + 'business_identity.name' => [ + 'getters' => [ + 'getBusinessIdentity', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_client_config.json new file mode 100644 index 000000000000..39ad4e7b6dab --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.BusinessInfoService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "GetBusinessInfo": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateBusinessInfo": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_descriptor_config.php new file mode 100644 index 000000000000..83bfe0c63711 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_descriptor_config.php @@ -0,0 +1,56 @@ + [ + 'google.shopping.merchant.accounts.v1beta.BusinessInfoService' => [ + 'GetBusinessInfo' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\BusinessInfo', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBusinessInfo' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\BusinessInfo', + 'headerParams' => [ + [ + 'keyName' => 'business_info.name', + 'fieldAccessors' => [ + 'getBusinessInfo', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'businessInfo' => 'accounts/{account}/businessInfo', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_rest_client_config.php new file mode 100644 index 000000000000..315a18d19a81 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/business_info_service_rest_client_config.php @@ -0,0 +1,56 @@ + [ + 'google.shopping.merchant.accounts.v1beta.BusinessInfoService' => [ + 'GetBusinessInfo' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/businessInfo}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBusinessInfo' => [ + 'method' => 'patch', + 'uriTemplate' => '/accounts/v1beta/{business_info.name=accounts/*/businessInfo}', + 'body' => 'business_info', + 'placeholders' => [ + 'business_info.name' => [ + 'getters' => [ + 'getBusinessInfo', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_client_config.json new file mode 100644 index 000000000000..0f2b0ad48986 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.EmailPreferencesService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "GetEmailPreferences": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateEmailPreferences": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_descriptor_config.php new file mode 100644 index 000000000000..3dbb47bc7a1c --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_descriptor_config.php @@ -0,0 +1,56 @@ + [ + 'google.shopping.merchant.accounts.v1beta.EmailPreferencesService' => [ + 'GetEmailPreferences' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\EmailPreferences', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateEmailPreferences' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\EmailPreferences', + 'headerParams' => [ + [ + 'keyName' => 'email_preferences.name', + 'fieldAccessors' => [ + 'getEmailPreferences', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'emailPreferences' => 'accounts/{account}/users/{email}/emailPreferences', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_rest_client_config.php new file mode 100644 index 000000000000..35c786490bdc --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/email_preferences_service_rest_client_config.php @@ -0,0 +1,56 @@ + [ + 'google.shopping.merchant.accounts.v1beta.EmailPreferencesService' => [ + 'GetEmailPreferences' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/users/*/emailPreferences}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateEmailPreferences' => [ + 'method' => 'patch', + 'uriTemplate' => '/accounts/v1beta/{email_preferences.name=accounts/*/users/*/emailPreferences}', + 'body' => 'email_preferences', + 'placeholders' => [ + 'email_preferences.name' => [ + 'getters' => [ + 'getEmailPreferences', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_client_config.json new file mode 100644 index 000000000000..8c821772b798 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.HomepageService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "ClaimHomepage": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetHomepage": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UnclaimHomepage": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateHomepage": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_descriptor_config.php new file mode 100644 index 000000000000..5a7e6763906a --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_descriptor_config.php @@ -0,0 +1,80 @@ + [ + 'google.shopping.merchant.accounts.v1beta.HomepageService' => [ + 'ClaimHomepage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Homepage', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetHomepage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Homepage', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UnclaimHomepage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Homepage', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateHomepage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Homepage', + 'headerParams' => [ + [ + 'keyName' => 'homepage.name', + 'fieldAccessors' => [ + 'getHomepage', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'homepage' => 'accounts/{account}/homepage', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_rest_client_config.php new file mode 100644 index 000000000000..24173fa32872 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/homepage_service_rest_client_config.php @@ -0,0 +1,80 @@ + [ + 'google.shopping.merchant.accounts.v1beta.HomepageService' => [ + 'ClaimHomepage' => [ + 'method' => 'post', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/homepage}:claim', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetHomepage' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/homepage}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UnclaimHomepage' => [ + 'method' => 'post', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/homepage}:unclaim', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateHomepage' => [ + 'method' => 'patch', + 'uriTemplate' => '/accounts/v1beta/{homepage.name=accounts/*/homepage}', + 'body' => 'homepage', + 'placeholders' => [ + 'homepage.name' => [ + 'getters' => [ + 'getHomepage', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_client_config.json new file mode 100644 index 000000000000..61c27356e30c --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetOnlineReturnPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListOnlineReturnPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_descriptor_config.php new file mode 100644 index 000000000000..b82d66f35905 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService' => [ + 'GetOnlineReturnPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\OnlineReturnPolicy', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListOnlineReturnPolicies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getOnlineReturnPolicies', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ListOnlineReturnPoliciesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'onlineReturnPolicy' => 'accounts/{account}/onlineReturnPolicies/{return_policy}', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_rest_client_config.php new file mode 100644 index 000000000000..4c2860272263 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/online_return_policy_service_rest_client_config.php @@ -0,0 +1,51 @@ + [ + 'google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService' => [ + 'GetOnlineReturnPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/onlineReturnPolicies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOnlineReturnPolicies' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/onlineReturnPolicies', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/programs_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/programs_service_client_config.json new file mode 100644 index 000000000000..84085e3ccaa5 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/programs_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.ProgramsService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "DisableProgram": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "EnableProgram": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetProgram": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListPrograms": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/programs_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/programs_service_descriptor_config.php new file mode 100644 index 000000000000..1ece7290be08 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/programs_service_descriptor_config.php @@ -0,0 +1,88 @@ + [ + 'google.shopping.merchant.accounts.v1beta.ProgramsService' => [ + 'DisableProgram' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Program', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'EnableProgram' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Program', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetProgram' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Program', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListPrograms' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getPrograms', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ListProgramsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'program' => 'accounts/{account}/programs/{program}', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/programs_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/programs_service_rest_client_config.php new file mode 100644 index 000000000000..093de7ce37c4 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/programs_service_rest_client_config.php @@ -0,0 +1,75 @@ + [ + 'google.shopping.merchant.accounts.v1beta.ProgramsService' => [ + 'DisableProgram' => [ + 'method' => 'post', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/programs/*}:disable', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'EnableProgram' => [ + 'method' => 'post', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/programs/*}:enable', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetProgram' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/programs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListPrograms' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/programs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/regions_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/regions_service_client_config.json new file mode 100644 index 000000000000..7c03c4fe08ac --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/regions_service_client_config.json @@ -0,0 +1,47 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.RegionsService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateRegion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteRegion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetRegion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListRegions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateRegion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/regions_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/regions_service_descriptor_config.php new file mode 100644 index 000000000000..dacc16d45460 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/regions_service_descriptor_config.php @@ -0,0 +1,101 @@ + [ + 'google.shopping.merchant.accounts.v1beta.RegionsService' => [ + 'CreateRegion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Region', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteRegion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetRegion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Region', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListRegions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRegions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ListRegionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateRegion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\Region', + 'headerParams' => [ + [ + 'keyName' => 'region.name', + 'fieldAccessors' => [ + 'getRegion', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'region' => 'accounts/{account}/regions/{region}', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/regions_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/regions_service_rest_client_config.php new file mode 100644 index 000000000000..261a2845bf91 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/regions_service_rest_client_config.php @@ -0,0 +1,90 @@ + [ + 'google.shopping.merchant.accounts.v1beta.RegionsService' => [ + 'CreateRegion' => [ + 'method' => 'post', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/regions', + 'body' => 'region', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'region_id', + ], + ], + 'DeleteRegion' => [ + 'method' => 'delete', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/regions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetRegion' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/regions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListRegions' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/regions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateRegion' => [ + 'method' => 'patch', + 'uriTemplate' => '/accounts/v1beta/{region.name=accounts/*/regions/*}', + 'body' => 'region', + 'placeholders' => [ + 'region.name' => [ + 'getters' => [ + 'getRegion', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_client_config.json new file mode 100644 index 000000000000..ce62836950ac --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.ShippingSettingsService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "GetShippingSettings": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "InsertShippingSettings": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_descriptor_config.php new file mode 100644 index 000000000000..be89341d2681 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_descriptor_config.php @@ -0,0 +1,55 @@ + [ + 'google.shopping.merchant.accounts.v1beta.ShippingSettingsService' => [ + 'GetShippingSettings' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ShippingSettings', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'InsertShippingSettings' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ShippingSettings', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'shippingSettings' => 'accounts/{account}/shippingSettings', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_rest_client_config.php new file mode 100644 index 000000000000..142b0fa02ecb --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/shipping_settings_service_rest_client_config.php @@ -0,0 +1,52 @@ + [ + 'google.shopping.merchant.accounts.v1beta.ShippingSettingsService' => [ + 'GetShippingSettings' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/shippingSettings}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InsertShippingSettings' => [ + 'method' => 'post', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/shippingSettings:insert', + 'body' => 'shipping_setting', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_client_config.json new file mode 100644 index 000000000000..834014c3c033 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "GetTermsOfServiceAgreementState": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "RetrieveForApplicationTermsOfServiceAgreementState": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_descriptor_config.php new file mode 100644 index 000000000000..88c5a9ff8f43 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_descriptor_config.php @@ -0,0 +1,56 @@ + [ + 'google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService' => [ + 'GetTermsOfServiceAgreementState' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\TermsOfServiceAgreementState', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RetrieveForApplicationTermsOfServiceAgreementState' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\TermsOfServiceAgreementState', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'termsOfServiceAgreementState' => 'accounts/{account}/termsOfServiceAgreementStates/{identifier}', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_rest_client_config.php new file mode 100644 index 000000000000..6f21dae29908 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_agreement_state_service_rest_client_config.php @@ -0,0 +1,51 @@ + [ + 'google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService' => [ + 'GetTermsOfServiceAgreementState' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/termsOfServiceAgreementStates/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RetrieveForApplicationTermsOfServiceAgreementState' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/termsOfServiceAgreementStates:retrieveForApplication', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_client_config.json new file mode 100644 index 000000000000..8f26657e4ca9 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_client_config.json @@ -0,0 +1,49 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.TermsOfServiceService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "AcceptTermsOfService": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTermsOfService": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RetrieveLatestTermsOfService": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_descriptor_config.php new file mode 100644 index 000000000000..a5856be1bfdd --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_descriptor_config.php @@ -0,0 +1,60 @@ + [ + 'google.shopping.merchant.accounts.v1beta.TermsOfServiceService' => [ + 'AcceptTermsOfService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetTermsOfService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\TermsOfService', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RetrieveLatestTermsOfService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\TermsOfService', + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'termsOfService' => 'termsOfService/{version}', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_rest_client_config.php new file mode 100644 index 000000000000..4a489030f6d1 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/terms_of_service_service_rest_client_config.php @@ -0,0 +1,55 @@ + [ + 'google.shopping.merchant.accounts.v1beta.TermsOfServiceService' => [ + 'AcceptTermsOfService' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=termsOfService/*}:accept', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTermsOfService' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=termsOfService/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RetrieveLatestTermsOfService' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/termsOfService:retrieveLatest', + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/user_service_client_config.json b/ShoppingMerchantAccounts/src/V1beta/resources/user_service_client_config.json new file mode 100644 index 000000000000..2b5cbcfcbe8c --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/user_service_client_config.json @@ -0,0 +1,47 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.UserService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateUser": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateUser": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/user_service_descriptor_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/user_service_descriptor_config.php new file mode 100644 index 000000000000..8b50a366a6d2 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/user_service_descriptor_config.php @@ -0,0 +1,101 @@ + [ + 'google.shopping.merchant.accounts.v1beta.UserService' => [ + 'CreateUser' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\User', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteUser' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetUser' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\User', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListUsers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUsers', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\ListUsersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateUser' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Accounts\V1beta\User', + 'headerParams' => [ + [ + 'keyName' => 'user.name', + 'fieldAccessors' => [ + 'getUser', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'user' => 'accounts/{account}/users/{email}', + ], + ], + ], +]; diff --git a/ShoppingMerchantAccounts/src/V1beta/resources/user_service_rest_client_config.php b/ShoppingMerchantAccounts/src/V1beta/resources/user_service_rest_client_config.php new file mode 100644 index 000000000000..34a4c397cdd1 --- /dev/null +++ b/ShoppingMerchantAccounts/src/V1beta/resources/user_service_rest_client_config.php @@ -0,0 +1,93 @@ + [ + 'google.shopping.merchant.accounts.v1beta.UserService' => [ + 'CreateUser' => [ + 'method' => 'post', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/users', + 'body' => 'user', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'user_id', + ], + ], + 'DeleteUser' => [ + 'method' => 'delete', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/users/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetUser' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{name=accounts/*/users/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListUsers' => [ + 'method' => 'get', + 'uriTemplate' => '/accounts/v1beta/{parent=accounts/*}/users', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateUser' => [ + 'method' => 'patch', + 'uriTemplate' => '/accounts/v1beta/{user.name=accounts/*/users/*}', + 'body' => 'user', + 'placeholders' => [ + 'user.name' => [ + 'getters' => [ + 'getUser', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountIssueServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountIssueServiceClientTest.php new file mode 100644 index 000000000000..b815aa945ee6 --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountIssueServiceClientTest.php @@ -0,0 +1,176 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return AccountIssueServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AccountIssueServiceClient($options); + } + + /** @test */ + public function listAccountIssuesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $accountIssuesElement = new AccountIssue(); + $accountIssues = [$accountIssuesElement]; + $expectedResponse = new ListAccountIssuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAccountIssues($accountIssues); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListAccountIssuesRequest())->setParent($formattedParent); + $response = $gapicClient->listAccountIssues($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAccountIssues()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.AccountIssueService/ListAccountIssues', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAccountIssuesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListAccountIssuesRequest())->setParent($formattedParent); + try { + $gapicClient->listAccountIssues($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAccountIssuesAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $accountIssuesElement = new AccountIssue(); + $accountIssues = [$accountIssuesElement]; + $expectedResponse = new ListAccountIssuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAccountIssues($accountIssues); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListAccountIssuesRequest())->setParent($formattedParent); + $response = $gapicClient->listAccountIssuesAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAccountIssues()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.AccountIssueService/ListAccountIssues', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountTaxServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountTaxServiceClientTest.php new file mode 100644 index 000000000000..42898a5f080e --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountTaxServiceClientTest.php @@ -0,0 +1,308 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return AccountTaxServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AccountTaxServiceClient($options); + } + + /** @test */ + public function getAccountTaxTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $account = 1177318867; + $expectedResponse = new AccountTax(); + $expectedResponse->setName($name2); + $expectedResponse->setAccount($account); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->accountTaxName('[ACCOUNT]', '[TAX]'); + $request = (new GetAccountTaxRequest())->setName($formattedName); + $response = $gapicClient->getAccountTax($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.AccountTaxService/GetAccountTax', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAccountTaxExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->accountTaxName('[ACCOUNT]', '[TAX]'); + $request = (new GetAccountTaxRequest())->setName($formattedName); + try { + $gapicClient->getAccountTax($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAccountTaxTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $accountTaxesElement = new AccountTax(); + $accountTaxes = [$accountTaxesElement]; + $expectedResponse = new ListAccountTaxResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAccountTaxes($accountTaxes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListAccountTaxRequest())->setParent($formattedParent); + $response = $gapicClient->listAccountTax($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAccountTaxes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.AccountTaxService/ListAccountTax', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAccountTaxExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListAccountTaxRequest())->setParent($formattedParent); + try { + $gapicClient->listAccountTax($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAccountTaxTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $account = 1177318867; + $expectedResponse = new AccountTax(); + $expectedResponse->setName($name); + $expectedResponse->setAccount($account); + $transport->addResponse($expectedResponse); + // Mock request + $accountTax = new AccountTax(); + $request = (new UpdateAccountTaxRequest())->setAccountTax($accountTax); + $response = $gapicClient->updateAccountTax($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.AccountTaxService/UpdateAccountTax', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getAccountTax(); + $this->assertProtobufEquals($accountTax, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAccountTaxExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $accountTax = new AccountTax(); + $request = (new UpdateAccountTaxRequest())->setAccountTax($accountTax); + try { + $gapicClient->updateAccountTax($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAccountTaxAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $account = 1177318867; + $expectedResponse = new AccountTax(); + $expectedResponse->setName($name2); + $expectedResponse->setAccount($account); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->accountTaxName('[ACCOUNT]', '[TAX]'); + $request = (new GetAccountTaxRequest())->setName($formattedName); + $response = $gapicClient->getAccountTaxAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.AccountTaxService/GetAccountTax', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountsServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountsServiceClientTest.php new file mode 100644 index 000000000000..4b73cd74a42e --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/AccountsServiceClientTest.php @@ -0,0 +1,575 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return AccountsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AccountsServiceClient($options); + } + + /** @test */ + public function createAndConfigureAccountTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $accountId = 803333011; + $accountName = 'accountName1091239261'; + $adultContent = true; + $testAccount = true; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new Account(); + $expectedResponse->setName($name); + $expectedResponse->setAccountId($accountId); + $expectedResponse->setAccountName($accountName); + $expectedResponse->setAdultContent($adultContent); + $expectedResponse->setTestAccount($testAccount); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $account = new Account(); + $accountAccountName = 'accountAccountName-1464628757'; + $account->setAccountName($accountAccountName); + $accountTimeZone = new TimeZone(); + $account->setTimeZone($accountTimeZone); + $accountLanguageCode = 'accountLanguageCode-1326363598'; + $account->setLanguageCode($accountLanguageCode); + $request = (new CreateAndConfigureAccountRequest())->setAccount($account); + $response = $gapicClient->createAndConfigureAccount($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.AccountsService/CreateAndConfigureAccount', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getAccount(); + $this->assertProtobufEquals($account, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAndConfigureAccountExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $account = new Account(); + $accountAccountName = 'accountAccountName-1464628757'; + $account->setAccountName($accountAccountName); + $accountTimeZone = new TimeZone(); + $account->setTimeZone($accountTimeZone); + $accountLanguageCode = 'accountLanguageCode-1326363598'; + $account->setLanguageCode($accountLanguageCode); + $request = (new CreateAndConfigureAccountRequest())->setAccount($account); + try { + $gapicClient->createAndConfigureAccount($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAccountTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->accountName('[ACCOUNT]'); + $request = (new DeleteAccountRequest())->setName($formattedName); + $gapicClient->deleteAccount($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.AccountsService/DeleteAccount', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAccountExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->accountName('[ACCOUNT]'); + $request = (new DeleteAccountRequest())->setName($formattedName); + try { + $gapicClient->deleteAccount($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAccountTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $accountId = 803333011; + $accountName = 'accountName1091239261'; + $adultContent = true; + $testAccount = true; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new Account(); + $expectedResponse->setName($name2); + $expectedResponse->setAccountId($accountId); + $expectedResponse->setAccountName($accountName); + $expectedResponse->setAdultContent($adultContent); + $expectedResponse->setTestAccount($testAccount); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->accountName('[ACCOUNT]'); + $request = (new GetAccountRequest())->setName($formattedName); + $response = $gapicClient->getAccount($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.AccountsService/GetAccount', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAccountExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->accountName('[ACCOUNT]'); + $request = (new GetAccountRequest())->setName($formattedName); + try { + $gapicClient->getAccount($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAccountsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $accountsElement = new Account(); + $accounts = [$accountsElement]; + $expectedResponse = new ListAccountsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAccounts($accounts); + $transport->addResponse($expectedResponse); + $request = new ListAccountsRequest(); + $response = $gapicClient->listAccounts($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAccounts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.AccountsService/ListAccounts', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAccountsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new ListAccountsRequest(); + try { + $gapicClient->listAccounts($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSubAccountsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $accountsElement = new Account(); + $accounts = [$accountsElement]; + $expectedResponse = new ListSubAccountsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAccounts($accounts); + $transport->addResponse($expectedResponse); + // Mock request + $formattedProvider = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListSubAccountsRequest())->setProvider($formattedProvider); + $response = $gapicClient->listSubAccounts($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAccounts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.AccountsService/ListSubAccounts', $actualFuncCall); + $actualValue = $actualRequestObject->getProvider(); + $this->assertProtobufEquals($formattedProvider, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSubAccountsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedProvider = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListSubAccountsRequest())->setProvider($formattedProvider); + try { + $gapicClient->listSubAccounts($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAccountTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $accountId = 803333011; + $accountName = 'accountName1091239261'; + $adultContent = true; + $testAccount = true; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new Account(); + $expectedResponse->setName($name); + $expectedResponse->setAccountId($accountId); + $expectedResponse->setAccountName($accountName); + $expectedResponse->setAdultContent($adultContent); + $expectedResponse->setTestAccount($testAccount); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $account = new Account(); + $accountAccountName = 'accountAccountName-1464628757'; + $account->setAccountName($accountAccountName); + $accountTimeZone = new TimeZone(); + $account->setTimeZone($accountTimeZone); + $accountLanguageCode = 'accountLanguageCode-1326363598'; + $account->setLanguageCode($accountLanguageCode); + $updateMask = new FieldMask(); + $request = (new UpdateAccountRequest())->setAccount($account)->setUpdateMask($updateMask); + $response = $gapicClient->updateAccount($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.AccountsService/UpdateAccount', $actualFuncCall); + $actualValue = $actualRequestObject->getAccount(); + $this->assertProtobufEquals($account, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAccountExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $account = new Account(); + $accountAccountName = 'accountAccountName-1464628757'; + $account->setAccountName($accountAccountName); + $accountTimeZone = new TimeZone(); + $account->setTimeZone($accountTimeZone); + $accountLanguageCode = 'accountLanguageCode-1326363598'; + $account->setLanguageCode($accountLanguageCode); + $updateMask = new FieldMask(); + $request = (new UpdateAccountRequest())->setAccount($account)->setUpdateMask($updateMask); + try { + $gapicClient->updateAccount($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createAndConfigureAccountAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $accountId = 803333011; + $accountName = 'accountName1091239261'; + $adultContent = true; + $testAccount = true; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new Account(); + $expectedResponse->setName($name); + $expectedResponse->setAccountId($accountId); + $expectedResponse->setAccountName($accountName); + $expectedResponse->setAdultContent($adultContent); + $expectedResponse->setTestAccount($testAccount); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $account = new Account(); + $accountAccountName = 'accountAccountName-1464628757'; + $account->setAccountName($accountAccountName); + $accountTimeZone = new TimeZone(); + $account->setTimeZone($accountTimeZone); + $accountLanguageCode = 'accountLanguageCode-1326363598'; + $account->setLanguageCode($accountLanguageCode); + $request = (new CreateAndConfigureAccountRequest())->setAccount($account); + $response = $gapicClient->createAndConfigureAccountAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.AccountsService/CreateAndConfigureAccount', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getAccount(); + $this->assertProtobufEquals($account, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/BusinessIdentityServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/BusinessIdentityServiceClientTest.php new file mode 100644 index 000000000000..7fe097cf70dd --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/BusinessIdentityServiceClientTest.php @@ -0,0 +1,241 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return BusinessIdentityServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BusinessIdentityServiceClient($options); + } + + /** @test */ + public function getBusinessIdentityTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new BusinessIdentity(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->businessIdentityName('[ACCOUNT]'); + $request = (new GetBusinessIdentityRequest())->setName($formattedName); + $response = $gapicClient->getBusinessIdentity($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.BusinessIdentityService/GetBusinessIdentity', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBusinessIdentityExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->businessIdentityName('[ACCOUNT]'); + $request = (new GetBusinessIdentityRequest())->setName($formattedName); + try { + $gapicClient->getBusinessIdentity($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBusinessIdentityTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new BusinessIdentity(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $businessIdentity = new BusinessIdentity(); + $updateMask = new FieldMask(); + $request = (new UpdateBusinessIdentityRequest()) + ->setBusinessIdentity($businessIdentity) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateBusinessIdentity($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.BusinessIdentityService/UpdateBusinessIdentity', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getBusinessIdentity(); + $this->assertProtobufEquals($businessIdentity, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBusinessIdentityExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $businessIdentity = new BusinessIdentity(); + $updateMask = new FieldMask(); + $request = (new UpdateBusinessIdentityRequest()) + ->setBusinessIdentity($businessIdentity) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateBusinessIdentity($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBusinessIdentityAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new BusinessIdentity(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->businessIdentityName('[ACCOUNT]'); + $request = (new GetBusinessIdentityRequest())->setName($formattedName); + $response = $gapicClient->getBusinessIdentityAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.BusinessIdentityService/GetBusinessIdentity', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/BusinessInfoServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/BusinessInfoServiceClientTest.php new file mode 100644 index 000000000000..1ad1e8261747 --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/BusinessInfoServiceClientTest.php @@ -0,0 +1,237 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return BusinessInfoServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BusinessInfoServiceClient($options); + } + + /** @test */ + public function getBusinessInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new BusinessInfo(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->businessInfoName('[ACCOUNT]'); + $request = (new GetBusinessInfoRequest())->setName($formattedName); + $response = $gapicClient->getBusinessInfo($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.BusinessInfoService/GetBusinessInfo', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBusinessInfoExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->businessInfoName('[ACCOUNT]'); + $request = (new GetBusinessInfoRequest())->setName($formattedName); + try { + $gapicClient->getBusinessInfo($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBusinessInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new BusinessInfo(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $businessInfo = new BusinessInfo(); + $updateMask = new FieldMask(); + $request = (new UpdateBusinessInfoRequest())->setBusinessInfo($businessInfo)->setUpdateMask($updateMask); + $response = $gapicClient->updateBusinessInfo($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.BusinessInfoService/UpdateBusinessInfo', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getBusinessInfo(); + $this->assertProtobufEquals($businessInfo, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBusinessInfoExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $businessInfo = new BusinessInfo(); + $updateMask = new FieldMask(); + $request = (new UpdateBusinessInfoRequest())->setBusinessInfo($businessInfo)->setUpdateMask($updateMask); + try { + $gapicClient->updateBusinessInfo($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBusinessInfoAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new BusinessInfo(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->businessInfoName('[ACCOUNT]'); + $request = (new GetBusinessInfoRequest())->setName($formattedName); + $response = $gapicClient->getBusinessInfoAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.BusinessInfoService/GetBusinessInfo', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/EmailPreferencesServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/EmailPreferencesServiceClientTest.php new file mode 100644 index 000000000000..6894d76b2730 --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/EmailPreferencesServiceClientTest.php @@ -0,0 +1,241 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return EmailPreferencesServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EmailPreferencesServiceClient($options); + } + + /** @test */ + public function getEmailPreferencesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new EmailPreferences(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->emailPreferencesName('[ACCOUNT]', '[EMAIL]'); + $request = (new GetEmailPreferencesRequest())->setName($formattedName); + $response = $gapicClient->getEmailPreferences($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.EmailPreferencesService/GetEmailPreferences', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEmailPreferencesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->emailPreferencesName('[ACCOUNT]', '[EMAIL]'); + $request = (new GetEmailPreferencesRequest())->setName($formattedName); + try { + $gapicClient->getEmailPreferences($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEmailPreferencesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new EmailPreferences(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $emailPreferences = new EmailPreferences(); + $updateMask = new FieldMask(); + $request = (new UpdateEmailPreferencesRequest()) + ->setEmailPreferences($emailPreferences) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateEmailPreferences($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.EmailPreferencesService/UpdateEmailPreferences', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getEmailPreferences(); + $this->assertProtobufEquals($emailPreferences, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEmailPreferencesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $emailPreferences = new EmailPreferences(); + $updateMask = new FieldMask(); + $request = (new UpdateEmailPreferencesRequest()) + ->setEmailPreferences($emailPreferences) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateEmailPreferences($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEmailPreferencesAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new EmailPreferences(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->emailPreferencesName('[ACCOUNT]', '[EMAIL]'); + $request = (new GetEmailPreferencesRequest())->setName($formattedName); + $response = $gapicClient->getEmailPreferencesAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.EmailPreferencesService/GetEmailPreferences', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/HomepageServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/HomepageServiceClientTest.php new file mode 100644 index 000000000000..b17feeeb0e8a --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/HomepageServiceClientTest.php @@ -0,0 +1,384 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return HomepageServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new HomepageServiceClient($options); + } + + /** @test */ + public function claimHomepageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uri = 'uri116076'; + $claimed = false; + $expectedResponse = new Homepage(); + $expectedResponse->setName($name2); + $expectedResponse->setUri($uri); + $expectedResponse->setClaimed($claimed); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->homepageName('[ACCOUNT]'); + $request = (new ClaimHomepageRequest())->setName($formattedName); + $response = $gapicClient->claimHomepage($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.HomepageService/ClaimHomepage', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function claimHomepageExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->homepageName('[ACCOUNT]'); + $request = (new ClaimHomepageRequest())->setName($formattedName); + try { + $gapicClient->claimHomepage($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHomepageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uri = 'uri116076'; + $claimed = false; + $expectedResponse = new Homepage(); + $expectedResponse->setName($name2); + $expectedResponse->setUri($uri); + $expectedResponse->setClaimed($claimed); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->homepageName('[ACCOUNT]'); + $request = (new GetHomepageRequest())->setName($formattedName); + $response = $gapicClient->getHomepage($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.HomepageService/GetHomepage', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHomepageExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->homepageName('[ACCOUNT]'); + $request = (new GetHomepageRequest())->setName($formattedName); + try { + $gapicClient->getHomepage($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function unclaimHomepageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uri = 'uri116076'; + $claimed = false; + $expectedResponse = new Homepage(); + $expectedResponse->setName($name2); + $expectedResponse->setUri($uri); + $expectedResponse->setClaimed($claimed); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->homepageName('[ACCOUNT]'); + $request = (new UnclaimHomepageRequest())->setName($formattedName); + $response = $gapicClient->unclaimHomepage($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.HomepageService/UnclaimHomepage', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function unclaimHomepageExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->homepageName('[ACCOUNT]'); + $request = (new UnclaimHomepageRequest())->setName($formattedName); + try { + $gapicClient->unclaimHomepage($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateHomepageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uri = 'uri116076'; + $claimed = false; + $expectedResponse = new Homepage(); + $expectedResponse->setName($name); + $expectedResponse->setUri($uri); + $expectedResponse->setClaimed($claimed); + $transport->addResponse($expectedResponse); + // Mock request + $homepage = new Homepage(); + $homepageUri = 'homepageUri1440042654'; + $homepage->setUri($homepageUri); + $updateMask = new FieldMask(); + $request = (new UpdateHomepageRequest())->setHomepage($homepage)->setUpdateMask($updateMask); + $response = $gapicClient->updateHomepage($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.HomepageService/UpdateHomepage', $actualFuncCall); + $actualValue = $actualRequestObject->getHomepage(); + $this->assertProtobufEquals($homepage, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateHomepageExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $homepage = new Homepage(); + $homepageUri = 'homepageUri1440042654'; + $homepage->setUri($homepageUri); + $updateMask = new FieldMask(); + $request = (new UpdateHomepageRequest())->setHomepage($homepage)->setUpdateMask($updateMask); + try { + $gapicClient->updateHomepage($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function claimHomepageAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uri = 'uri116076'; + $claimed = false; + $expectedResponse = new Homepage(); + $expectedResponse->setName($name2); + $expectedResponse->setUri($uri); + $expectedResponse->setClaimed($claimed); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->homepageName('[ACCOUNT]'); + $request = (new ClaimHomepageRequest())->setName($formattedName); + $response = $gapicClient->claimHomepageAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.HomepageService/ClaimHomepage', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/OnlineReturnPolicyServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/OnlineReturnPolicyServiceClientTest.php new file mode 100644 index 000000000000..dc63a3e7f2d1 --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/OnlineReturnPolicyServiceClientTest.php @@ -0,0 +1,263 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return OnlineReturnPolicyServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new OnlineReturnPolicyServiceClient($options); + } + + /** @test */ + public function getOnlineReturnPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $returnPolicyId = 'returnPolicyId1108665081'; + $label = 'label102727412'; + $returnPolicyUri = 'returnPolicyUri8891214'; + $acceptDefectiveOnly = false; + $processRefundDays = 1233584878; + $acceptExchange = true; + $expectedResponse = new OnlineReturnPolicy(); + $expectedResponse->setName($name2); + $expectedResponse->setReturnPolicyId($returnPolicyId); + $expectedResponse->setLabel($label); + $expectedResponse->setReturnPolicyUri($returnPolicyUri); + $expectedResponse->setAcceptDefectiveOnly($acceptDefectiveOnly); + $expectedResponse->setProcessRefundDays($processRefundDays); + $expectedResponse->setAcceptExchange($acceptExchange); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->onlineReturnPolicyName('[ACCOUNT]', '[RETURN_POLICY]'); + $request = (new GetOnlineReturnPolicyRequest())->setName($formattedName); + $response = $gapicClient->getOnlineReturnPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService/GetOnlineReturnPolicy', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getOnlineReturnPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->onlineReturnPolicyName('[ACCOUNT]', '[RETURN_POLICY]'); + $request = (new GetOnlineReturnPolicyRequest())->setName($formattedName); + try { + $gapicClient->getOnlineReturnPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOnlineReturnPoliciesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $onlineReturnPoliciesElement = new OnlineReturnPolicy(); + $onlineReturnPolicies = [$onlineReturnPoliciesElement]; + $expectedResponse = new ListOnlineReturnPoliciesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setOnlineReturnPolicies($onlineReturnPolicies); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListOnlineReturnPoliciesRequest())->setParent($formattedParent); + $response = $gapicClient->listOnlineReturnPolicies($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getOnlineReturnPolicies()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService/ListOnlineReturnPolicies', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOnlineReturnPoliciesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListOnlineReturnPoliciesRequest())->setParent($formattedParent); + try { + $gapicClient->listOnlineReturnPolicies($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getOnlineReturnPolicyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $returnPolicyId = 'returnPolicyId1108665081'; + $label = 'label102727412'; + $returnPolicyUri = 'returnPolicyUri8891214'; + $acceptDefectiveOnly = false; + $processRefundDays = 1233584878; + $acceptExchange = true; + $expectedResponse = new OnlineReturnPolicy(); + $expectedResponse->setName($name2); + $expectedResponse->setReturnPolicyId($returnPolicyId); + $expectedResponse->setLabel($label); + $expectedResponse->setReturnPolicyUri($returnPolicyUri); + $expectedResponse->setAcceptDefectiveOnly($acceptDefectiveOnly); + $expectedResponse->setProcessRefundDays($processRefundDays); + $expectedResponse->setAcceptExchange($acceptExchange); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->onlineReturnPolicyName('[ACCOUNT]', '[RETURN_POLICY]'); + $request = (new GetOnlineReturnPolicyRequest())->setName($formattedName); + $response = $gapicClient->getOnlineReturnPolicyAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService/GetOnlineReturnPolicy', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/ProgramsServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/ProgramsServiceClientTest.php new file mode 100644 index 000000000000..32d659e6eebe --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/ProgramsServiceClientTest.php @@ -0,0 +1,370 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ProgramsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProgramsServiceClient($options); + } + + /** @test */ + public function disableProgramTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $documentationUri = 'documentationUri1128720999'; + $expectedResponse = new Program(); + $expectedResponse->setName($name2); + $expectedResponse->setDocumentationUri($documentationUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->programName('[ACCOUNT]', '[PROGRAM]'); + $request = (new DisableProgramRequest())->setName($formattedName); + $response = $gapicClient->disableProgram($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.ProgramsService/DisableProgram', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function disableProgramExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->programName('[ACCOUNT]', '[PROGRAM]'); + $request = (new DisableProgramRequest())->setName($formattedName); + try { + $gapicClient->disableProgram($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function enableProgramTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $documentationUri = 'documentationUri1128720999'; + $expectedResponse = new Program(); + $expectedResponse->setName($name2); + $expectedResponse->setDocumentationUri($documentationUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->programName('[ACCOUNT]', '[PROGRAM]'); + $request = (new EnableProgramRequest())->setName($formattedName); + $response = $gapicClient->enableProgram($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.ProgramsService/EnableProgram', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function enableProgramExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->programName('[ACCOUNT]', '[PROGRAM]'); + $request = (new EnableProgramRequest())->setName($formattedName); + try { + $gapicClient->enableProgram($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProgramTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $documentationUri = 'documentationUri1128720999'; + $expectedResponse = new Program(); + $expectedResponse->setName($name2); + $expectedResponse->setDocumentationUri($documentationUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->programName('[ACCOUNT]', '[PROGRAM]'); + $request = (new GetProgramRequest())->setName($formattedName); + $response = $gapicClient->getProgram($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.ProgramsService/GetProgram', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProgramExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->programName('[ACCOUNT]', '[PROGRAM]'); + $request = (new GetProgramRequest())->setName($formattedName); + try { + $gapicClient->getProgram($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProgramsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $programsElement = new Program(); + $programs = [$programsElement]; + $expectedResponse = new ListProgramsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setPrograms($programs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListProgramsRequest())->setParent($formattedParent); + $response = $gapicClient->listPrograms($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getPrograms()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.ProgramsService/ListPrograms', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProgramsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListProgramsRequest())->setParent($formattedParent); + try { + $gapicClient->listPrograms($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function disableProgramAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $documentationUri = 'documentationUri1128720999'; + $expectedResponse = new Program(); + $expectedResponse->setName($name2); + $expectedResponse->setDocumentationUri($documentationUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->programName('[ACCOUNT]', '[PROGRAM]'); + $request = (new DisableProgramRequest())->setName($formattedName); + $response = $gapicClient->disableProgramAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.ProgramsService/DisableProgram', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/RegionsServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/RegionsServiceClientTest.php new file mode 100644 index 000000000000..8146846df509 --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/RegionsServiceClientTest.php @@ -0,0 +1,457 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return RegionsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionsServiceClient($options); + } + + /** @test */ + public function createRegionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Region(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $regionId = 'regionId74348102'; + $region = new Region(); + $request = (new CreateRegionRequest()) + ->setParent($formattedParent) + ->setRegionId($regionId) + ->setRegion($region); + $response = $gapicClient->createRegion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.RegionsService/CreateRegion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRegionId(); + $this->assertProtobufEquals($regionId, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createRegionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $regionId = 'regionId74348102'; + $region = new Region(); + $request = (new CreateRegionRequest()) + ->setParent($formattedParent) + ->setRegionId($regionId) + ->setRegion($region); + try { + $gapicClient->createRegion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteRegionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->regionName('[ACCOUNT]', '[REGION]'); + $request = (new DeleteRegionRequest())->setName($formattedName); + $gapicClient->deleteRegion($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.RegionsService/DeleteRegion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteRegionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->regionName('[ACCOUNT]', '[REGION]'); + $request = (new DeleteRegionRequest())->setName($formattedName); + try { + $gapicClient->deleteRegion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRegionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Region(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->regionName('[ACCOUNT]', '[REGION]'); + $request = (new GetRegionRequest())->setName($formattedName); + $response = $gapicClient->getRegion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.RegionsService/GetRegion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRegionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->regionName('[ACCOUNT]', '[REGION]'); + $request = (new GetRegionRequest())->setName($formattedName); + try { + $gapicClient->getRegion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRegionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $regionsElement = new Region(); + $regions = [$regionsElement]; + $expectedResponse = new ListRegionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRegions($regions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListRegionsRequest())->setParent($formattedParent); + $response = $gapicClient->listRegions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRegions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.RegionsService/ListRegions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRegionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListRegionsRequest())->setParent($formattedParent); + try { + $gapicClient->listRegions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateRegionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Region(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $region = new Region(); + $request = (new UpdateRegionRequest())->setRegion($region); + $response = $gapicClient->updateRegion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.RegionsService/UpdateRegion', $actualFuncCall); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateRegionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $region = new Region(); + $request = (new UpdateRegionRequest())->setRegion($region); + try { + $gapicClient->updateRegion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createRegionAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Region(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $regionId = 'regionId74348102'; + $region = new Region(); + $request = (new CreateRegionRequest()) + ->setParent($formattedParent) + ->setRegionId($regionId) + ->setRegion($region); + $response = $gapicClient->createRegionAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.RegionsService/CreateRegion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRegionId(); + $this->assertProtobufEquals($regionId, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/ShippingSettingsServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/ShippingSettingsServiceClientTest.php new file mode 100644 index 000000000000..079bde4b70e8 --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/ShippingSettingsServiceClientTest.php @@ -0,0 +1,246 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ShippingSettingsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ShippingSettingsServiceClient($options); + } + + /** @test */ + public function getShippingSettingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $expectedResponse = new ShippingSettings(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->shippingSettingsName('[ACCOUNT]'); + $request = (new GetShippingSettingsRequest())->setName($formattedName); + $response = $gapicClient->getShippingSettings($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.ShippingSettingsService/GetShippingSettings', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getShippingSettingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->shippingSettingsName('[ACCOUNT]'); + $request = (new GetShippingSettingsRequest())->setName($formattedName); + try { + $gapicClient->getShippingSettings($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertShippingSettingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $expectedResponse = new ShippingSettings(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $shippingSetting = new ShippingSettings(); + $shippingSettingEtag = 'shippingSettingEtag-383675145'; + $shippingSetting->setEtag($shippingSettingEtag); + $request = (new InsertShippingSettingsRequest())->setParent($parent)->setShippingSetting($shippingSetting); + $response = $gapicClient->insertShippingSettings($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.ShippingSettingsService/InsertShippingSettings', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getShippingSetting(); + $this->assertProtobufEquals($shippingSetting, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertShippingSettingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $shippingSetting = new ShippingSettings(); + $shippingSettingEtag = 'shippingSettingEtag-383675145'; + $shippingSetting->setEtag($shippingSettingEtag); + $request = (new InsertShippingSettingsRequest())->setParent($parent)->setShippingSetting($shippingSetting); + try { + $gapicClient->insertShippingSettings($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getShippingSettingsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $expectedResponse = new ShippingSettings(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->shippingSettingsName('[ACCOUNT]'); + $request = (new GetShippingSettingsRequest())->setName($formattedName); + $response = $gapicClient->getShippingSettingsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.ShippingSettingsService/GetShippingSettings', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/TermsOfServiceAgreementStateServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/TermsOfServiceAgreementStateServiceClientTest.php new file mode 100644 index 000000000000..de875ce6d36f --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/TermsOfServiceAgreementStateServiceClientTest.php @@ -0,0 +1,238 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return TermsOfServiceAgreementStateServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TermsOfServiceAgreementStateServiceClient($options); + } + + /** @test */ + public function getTermsOfServiceAgreementStateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $regionCode = 'regionCode-1566082984'; + $expectedResponse = new TermsOfServiceAgreementState(); + $expectedResponse->setName($name2); + $expectedResponse->setRegionCode($regionCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->termsOfServiceAgreementStateName('[ACCOUNT]', '[IDENTIFIER]'); + $request = (new GetTermsOfServiceAgreementStateRequest())->setName($formattedName); + $response = $gapicClient->getTermsOfServiceAgreementState($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService/GetTermsOfServiceAgreementState', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTermsOfServiceAgreementStateExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->termsOfServiceAgreementStateName('[ACCOUNT]', '[IDENTIFIER]'); + $request = (new GetTermsOfServiceAgreementStateRequest())->setName($formattedName); + try { + $gapicClient->getTermsOfServiceAgreementState($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function retrieveForApplicationTermsOfServiceAgreementStateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $regionCode = 'regionCode-1566082984'; + $expectedResponse = new TermsOfServiceAgreementState(); + $expectedResponse->setName($name); + $expectedResponse->setRegionCode($regionCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new RetrieveForApplicationTermsOfServiceAgreementStateRequest())->setParent($formattedParent); + $response = $gapicClient->retrieveForApplicationTermsOfServiceAgreementState($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService/RetrieveForApplicationTermsOfServiceAgreementState', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function retrieveForApplicationTermsOfServiceAgreementStateExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new RetrieveForApplicationTermsOfServiceAgreementStateRequest())->setParent($formattedParent); + try { + $gapicClient->retrieveForApplicationTermsOfServiceAgreementState($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTermsOfServiceAgreementStateAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $regionCode = 'regionCode-1566082984'; + $expectedResponse = new TermsOfServiceAgreementState(); + $expectedResponse->setName($name2); + $expectedResponse->setRegionCode($regionCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->termsOfServiceAgreementStateName('[ACCOUNT]', '[IDENTIFIER]'); + $request = (new GetTermsOfServiceAgreementStateRequest())->setName($formattedName); + $response = $gapicClient->getTermsOfServiceAgreementStateAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService/GetTermsOfServiceAgreementState', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/TermsOfServiceServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/TermsOfServiceServiceClientTest.php new file mode 100644 index 000000000000..97443f909778 --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/TermsOfServiceServiceClientTest.php @@ -0,0 +1,325 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return TermsOfServiceServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TermsOfServiceServiceClient($options); + } + + /** @test */ + public function acceptTermsOfServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->termsOfServiceName('[VERSION]'); + $formattedAccount = $gapicClient->accountName('[ACCOUNT]'); + $regionCode = 'regionCode-1566082984'; + $request = (new AcceptTermsOfServiceRequest()) + ->setName($formattedName) + ->setAccount($formattedAccount) + ->setRegionCode($regionCode); + $gapicClient->acceptTermsOfService($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.TermsOfServiceService/AcceptTermsOfService', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getAccount(); + $this->assertProtobufEquals($formattedAccount, $actualValue); + $actualValue = $actualRequestObject->getRegionCode(); + $this->assertProtobufEquals($regionCode, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function acceptTermsOfServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->termsOfServiceName('[VERSION]'); + $formattedAccount = $gapicClient->accountName('[ACCOUNT]'); + $regionCode = 'regionCode-1566082984'; + $request = (new AcceptTermsOfServiceRequest()) + ->setName($formattedName) + ->setAccount($formattedAccount) + ->setRegionCode($regionCode); + try { + $gapicClient->acceptTermsOfService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTermsOfServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $regionCode = 'regionCode-1566082984'; + $fileUri = 'fileUri-735196119'; + $external = false; + $expectedResponse = new TermsOfService(); + $expectedResponse->setName($name2); + $expectedResponse->setRegionCode($regionCode); + $expectedResponse->setFileUri($fileUri); + $expectedResponse->setExternal($external); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->termsOfServiceName('[VERSION]'); + $request = (new GetTermsOfServiceRequest())->setName($formattedName); + $response = $gapicClient->getTermsOfService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.TermsOfServiceService/GetTermsOfService', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTermsOfServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->termsOfServiceName('[VERSION]'); + $request = (new GetTermsOfServiceRequest())->setName($formattedName); + try { + $gapicClient->getTermsOfService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function retrieveLatestTermsOfServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $regionCode2 = 'regionCode2-1767191029'; + $fileUri = 'fileUri-735196119'; + $external = false; + $expectedResponse = new TermsOfService(); + $expectedResponse->setName($name); + $expectedResponse->setRegionCode($regionCode2); + $expectedResponse->setFileUri($fileUri); + $expectedResponse->setExternal($external); + $transport->addResponse($expectedResponse); + $request = new RetrieveLatestTermsOfServiceRequest(); + $response = $gapicClient->retrieveLatestTermsOfService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.TermsOfServiceService/RetrieveLatestTermsOfService', + $actualFuncCall + ); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function retrieveLatestTermsOfServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new RetrieveLatestTermsOfServiceRequest(); + try { + $gapicClient->retrieveLatestTermsOfService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function acceptTermsOfServiceAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->termsOfServiceName('[VERSION]'); + $formattedAccount = $gapicClient->accountName('[ACCOUNT]'); + $regionCode = 'regionCode-1566082984'; + $request = (new AcceptTermsOfServiceRequest()) + ->setName($formattedName) + ->setAccount($formattedAccount) + ->setRegionCode($regionCode); + $gapicClient->acceptTermsOfServiceAsync($request)->wait(); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.accounts.v1beta.TermsOfServiceService/AcceptTermsOfService', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getAccount(); + $this->assertProtobufEquals($formattedAccount, $actualValue); + $actualValue = $actualRequestObject->getRegionCode(); + $this->assertProtobufEquals($regionCode, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/UserServiceClientTest.php b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/UserServiceClientTest.php new file mode 100644 index 000000000000..728476565e30 --- /dev/null +++ b/ShoppingMerchantAccounts/tests/Unit/V1beta/Client/UserServiceClientTest.php @@ -0,0 +1,454 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return UserServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new UserServiceClient($options); + } + + /** @test */ + public function createUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $userId = 'userId-147132913'; + $user = new User(); + $request = (new CreateUserRequest()) + ->setParent($formattedParent) + ->setUserId($userId) + ->setUser($user); + $response = $gapicClient->createUser($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.UserService/CreateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getUserId(); + $this->assertProtobufEquals($userId, $actualValue); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createUserExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $userId = 'userId-147132913'; + $user = new User(); + $request = (new CreateUserRequest()) + ->setParent($formattedParent) + ->setUserId($userId) + ->setUser($user); + try { + $gapicClient->createUser($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[ACCOUNT]', '[EMAIL]'); + $request = (new DeleteUserRequest())->setName($formattedName); + $gapicClient->deleteUser($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.UserService/DeleteUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteUserExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->userName('[ACCOUNT]', '[EMAIL]'); + $request = (new DeleteUserRequest())->setName($formattedName); + try { + $gapicClient->deleteUser($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new User(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[ACCOUNT]', '[EMAIL]'); + $request = (new GetUserRequest())->setName($formattedName); + $response = $gapicClient->getUser($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.UserService/GetUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getUserExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->userName('[ACCOUNT]', '[EMAIL]'); + $request = (new GetUserRequest())->setName($formattedName); + try { + $gapicClient->getUser($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $usersElement = new User(); + $users = [$usersElement]; + $expectedResponse = new ListUsersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUsers($users); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListUsersRequest())->setParent($formattedParent); + $response = $gapicClient->listUsers($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUsers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.UserService/ListUsers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListUsersRequest())->setParent($formattedParent); + try { + $gapicClient->listUsers($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $user = new User(); + $updateMask = new FieldMask(); + $request = (new UpdateUserRequest())->setUser($user)->setUpdateMask($updateMask); + $response = $gapicClient->updateUser($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.UserService/UpdateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateUserExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $user = new User(); + $updateMask = new FieldMask(); + $request = (new UpdateUserRequest())->setUser($user)->setUpdateMask($updateMask); + try { + $gapicClient->updateUser($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createUserAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $userId = 'userId-147132913'; + $user = new User(); + $request = (new CreateUserRequest()) + ->setParent($formattedParent) + ->setUserId($userId) + ->setUser($user); + $response = $gapicClient->createUserAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.accounts.v1beta.UserService/CreateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getUserId(); + $this->assertProtobufEquals($userId, $actualValue); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantConversions/.repo-metadata.json b/ShoppingMerchantConversions/.repo-metadata.json deleted file mode 100644 index 13805bce874f..000000000000 --- a/ShoppingMerchantConversions/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/shopping-merchant-conversions", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-conversions/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi" -} diff --git a/ShoppingMerchantConversions/VERSION b/ShoppingMerchantConversions/VERSION index 77d6f4ca2371..d917d3e26adc 100644 --- a/ShoppingMerchantConversions/VERSION +++ b/ShoppingMerchantConversions/VERSION @@ -1 +1 @@ -0.0.0 +0.1.2 diff --git a/ShoppingMerchantConversions/composer.json b/ShoppingMerchantConversions/composer.json index 8cebf17e357e..2a38b4b53db7 100644 --- a/ShoppingMerchantConversions/composer.json +++ b/ShoppingMerchantConversions/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.32.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ShoppingMerchantConversions/src/V1beta/MerchantCenterDestination.php b/ShoppingMerchantConversions/src/V1beta/MerchantCenterDestination.php index 0a64654af2b4..e3d932f76e21 100644 --- a/ShoppingMerchantConversions/src/V1beta/MerchantCenterDestination.php +++ b/ShoppingMerchantConversions/src/V1beta/MerchantCenterDestination.php @@ -10,7 +10,7 @@ /** * "Merchant Center Destination" sources can be used to send conversion events - * from a website using a Google tag directly to a Merchant Center account + * from an online store using a Google tag directly to a Merchant Center account * where the source is created. * * Generated from protobuf message google.shopping.merchant.conversions.v1beta.MerchantCenterDestination diff --git a/ShoppingMerchantDatasources/.OwlBot.yaml b/ShoppingMerchantDatasources/.OwlBot.yaml new file mode 100644 index 000000000000..49e75ace32d4 --- /dev/null +++ b/ShoppingMerchantDatasources/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/shopping/merchant/datasources/(v1beta)/.*-php/(.*) + dest: /owl-bot-staging/ShoppingMerchantDatasources/$1/$2 +api-name: ShoppingMerchantDatasources diff --git a/ShoppingMerchantDatasources/.gitattributes b/ShoppingMerchantDatasources/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/ShoppingMerchantDatasources/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/ShoppingMerchantDatasources/.github/pull_request_template.md b/ShoppingMerchantDatasources/.github/pull_request_template.md new file mode 100644 index 000000000000..508d9567d793 --- /dev/null +++ b/ShoppingMerchantDatasources/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com: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`. + +* Push the changes in a new branch to a fork, and open a new pull request +[here](https://github.com/googleapis/google-cloud-php). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/ShoppingMerchantDatasources/CONTRIBUTING.md b/ShoppingMerchantDatasources/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/ShoppingMerchantDatasources/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/ShoppingMerchantDatasources/LICENSE b/ShoppingMerchantDatasources/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/ShoppingMerchantDatasources/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/ShoppingMerchantDatasources/README.md b/ShoppingMerchantDatasources/README.md new file mode 100644 index 000000000000..215b6d98a7d6 --- /dev/null +++ b/ShoppingMerchantDatasources/README.md @@ -0,0 +1,45 @@ +# Google Shopping Merchant Datasources for PHP + +> Idiomatic PHP client for [Google Shopping Merchant Datasources](https://developers.google.com/merchant/api). + +[![Latest Stable Version](https://poser.pugx.org/google/shopping-merchant-datasources/v/stable)](https://packagist.org/packages/google/shopping-merchant-datasources) [![Packagist](https://img.shields.io/packagist/dm/google/shopping-merchant-datasources.svg)](https://packagist.org/packages/google/shopping-merchant-datasources) + +* [API documentation](https://cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/shopping-merchant-datasources +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-shopping-merchant-datasources/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/merchant/api). diff --git a/ShoppingMerchantDatasources/VERSION b/ShoppingMerchantDatasources/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/ShoppingMerchantDatasources/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/ShoppingMerchantDatasources/composer.json b/ShoppingMerchantDatasources/composer.json new file mode 100644 index 000000000000..691b330a9b7d --- /dev/null +++ b/ShoppingMerchantDatasources/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/shopping-merchant-datasources", + "description": "Google Shopping Merchant Datasources Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Shopping\\Merchant\\Datasources\\": "src", + "GPBMetadata\\Google\\Shopping\\Merchant\\Datasources\\": "metadata" + } + }, + "extra": { + "component": { + "id": "shopping-merchant-datasources", + "path": "ShoppingMerchantDatasources", + "target": "googleapis/php-shopping-merchant-datasources" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/ShoppingMerchantDatasources/metadata/V1Beta/Datasources.php b/ShoppingMerchantDatasources/metadata/V1Beta/Datasources.php new file mode 100644 index 0000000000000000000000000000000000000000..964ff3530c839f94194e0b7db3de9eedee48dc03 GIT binary patch literal 5123 zcmb_gOK;mo5RN3rS?Gz|f2o$xFh*0E) zT-tR5ACgn={Ri!_mmc~ndMVJ}d@72beCoA5b$0m>^^9oO7gOAwZ|0kw`8eeLhqOh} zd(t{Fh@~)6mud$RYY~ZBCNou2mugOtum6oK!mbAIGBNYp!op-_1HXTbP zIjL!yO`T-ymPx5*G&5~tsV&7|nYzLhcaxpjyIUhn3ExT!PY4-Go7hxQiL_qMZ@?yQ zR#_LIm2D5Svf+VN3LVhOv%7iNzl@NoE4D3#me5Ni!5?*Mx~57tQyBcauGv-1(3qy^ z+Bd*>MQSLzO~Af?Z^JQErkRGs4YmxGEZ&q{OuqLzH6cSQk{@Q7Ck+x-DH)7dhN4#r z#8xehGSe!<)?BVhSdeOdXYr=zmcwZcY0-@_m+K31MPimi!rmpxBFwRjWf3rWMWfDe=l`>>z{O1M^~= zvV-v*2Bsq54aI&wzU?@b87fwGKuLtmkA=PleW@ALVMBmLmEL)vc{M55>p=-})5V}@ zcnRG=KU_mAr|M;V%Qa8?QjqqgARUr|v?~P*bDl4SY8h1&nX3p3*Fp;oUP;xOS4!T7 zE1?aRS1;buRc}dX3p8Yg@QUyjeWeN(UGz4bySGF3%zXl5YMD4(58{3lh(>UNu6645 zG(ud)wuQFh7w9Urw6x;WJ9S>g3jB(_gI$Ptbk=rWvX+vJ+u#d2Es`z(?_$f%3dPw*0&;E&k( z7{H$6r#y|Xq6?w4R<-(k92OINF@dk3^L5Rpx^hqzb_w4uj-Q}Op*Qmg?p?^PL<+GJ zS-QkU%k{Q}5N`rFaJV%;1GqEUk0Rl6DGLB&sdY3de&NgLQfafiyHnlW+%6YaOKYWK zA$bO$MG3iFO2+Usnpi76E+*r63dMIz$pk)+rsdt8t+gU-oXF8*xsBfU6%16$iwdsn zG)zUA4k3I?QB~71n4Nj)T^)*1$8BS{%hT;P?cvf4|KY7R{|MY>XM(OL;Pn9UF_*Nyc&s9kG0RLa5@mT=~IOx*^{7=BwdvX(d?30 z{C5l`ds`Yu3$WMRr+MPT`|3!>ZrHb>dHvB%u*|0hALVG4xv;e0S8hH$7kkt)VoUZ|zbWW~$o_-WrvtM;I@(-=>v}G>w6Ok*yfAz!`VA(M7Gu=TWitEw z`(FBjnMrY2E2En5MryG9PjLj-Z9m21C~H0$QfnA`nOTl~`Gu;RPThy$qgm5@!{;an zsQ-%;tu6Bsbmugi){f;*P--~UjO-457zeT&On=An&Ku`4*H5I`u{I^@@ZOE!)%~{n Vbtv>PY3PR}vD5wFbBGQR`VZWK2FL&a literal 0 HcmV?d00001 diff --git a/ShoppingMerchantDatasources/metadata/V1Beta/Datasourcetypes.php b/ShoppingMerchantDatasources/metadata/V1Beta/Datasourcetypes.php new file mode 100644 index 0000000000000000000000000000000000000000..6315bdf7b252a7865b94ae4e3be19fd1193dc246 GIT binary patch literal 1712 zcmcIk?QYXB6kS&KWnhdHK?MR#8CoYG)!<*pKuz0imAbZCH^xV#%1zwXQfga{GpV5c zN8%xnc(U;(*h#;j8!!R+)6_mb_xRkK^Wqina_|uDV2TBj*n_P;lwAzDV3N7ahpn*P z#sa#m$BB=H1!1uUtF;4IDwYo(sG|W3g^P2r!&t}1*`UifC$y98Vc~WWm01r-6oZ27 z@kR?vG_fT690yiZ4FHOIIN->|aHnqXDWE>;>_o&)V?gZe4TzoMnAmx}VJrM50IrXM z0FJk!0^lQn>fvF_CoT*mlImxb1WiJTB*-Tp)XleG8~FiN9Mjl#NL@)7h5A5^x;V2A zV@{1-GFNihQSt16L3(nW!shF4w_wWVv3+tPjd+I?{%jSYs|X zC2|W&5#q_}5DF|qK{q4an&4#g=A2<Q&__(vW8P+O-zv$Pf_~YEJ)P_=^@cqj(edib=w=! zJeqB=pvRA5Kb3$+X8GBkbpdYcJYK61liKsA`PtL_oOvIBHpX7lM=e$Ak}9>N_YAeS zJM+mf%tv6wWy(Y<6^3>~)WNB_A7F-t-2_W63#k+Y2dR0OP&5felYR>p1|`i~AX(VW zSF5E;^RU{emkQoDR|HyzpQu79+D$GTGnI0=OO!Oxje*5f3 zL`{Of>VZb2--A2*xTC)C|3Q8PlFGLp(+M)6_#Rl6NT?`Kw(HLKQ^s&E&Q(1-iLk#K zAghx3B9m?3&ql literal 0 HcmV?d00001 diff --git a/ShoppingMerchantDatasources/metadata/V1Beta/Fileinputs.php b/ShoppingMerchantDatasources/metadata/V1Beta/Fileinputs.php new file mode 100644 index 0000000000000000000000000000000000000000..22eaf1d0d76aa6430f60f35b8e40ad05f956d450 GIT binary patch literal 1892 zcmbtV-E!MR6vi=0;|*<6LppAI!IE~S?$FA#+&K-59m$S|#4=bRla6LIYiVWgAZvxR zYR6^rD19p)fEVB$IJ^3>P1AvZZ)~5R@0|1Pw`X5{AI&242={47Vn0wW7B=*O^%bNhJdIu2##7Fx0c|BS9z`siw&pZ;XCxFY zj|h?lC9O9vCRC7?4^S+OQjut?5JDlD(x_7B}4Kco8?S$!YAm@ZS?B@2(A8g zmaP>s)e4zvD>BtGnLc=!ml8k#$T%k;lkB=v6jNr-gZEpgCi@>qk=F^j<5S_zoP-Ji zcOz+3aHYBPQrB+KjaK4mJqb3>vAWeiI+gl8RP&*pBkxgT1JG-keS&tCUEMZE4$`QC z_s)N>T}&laA!}40{9Z-3*IKH7fo{=|OakhuNw>3J?xW9uM2Gv%oQGnj+T6@s-=G~y zq4YtBYH{b~y@DRuwkCyS`Z`&Z89A5~W#dyd)OrTQn*IfNvkag})p*B4+SpuD-W)q?6{P8Bjb3`8yNcDC-u+K?$V`q2B(*M6*!l@rSZZr zegNx6eIMOjTF=a(bpqz + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/create_data_source.php b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/create_data_source.php new file mode 100644 index 000000000000..51916fb14a3f --- /dev/null +++ b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/create_data_source.php @@ -0,0 +1,91 @@ +setChannel($dataSourcePrimaryProductDataSourceChannel); + $dataSource = (new DataSource()) + ->setPrimaryProductDataSource($dataSourcePrimaryProductDataSource) + ->setDisplayName($dataSourceDisplayName); + $request = (new CreateDataSourceRequest()) + ->setParent($formattedParent) + ->setDataSource($dataSource); + + // Call the API and handle any network failures. + try { + /** @var DataSource $response */ + $response = $dataSourcesServiceClient->createDataSource($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 +{ + $formattedParent = DataSourcesServiceClient::accountName('[ACCOUNT]'); + $dataSourcePrimaryProductDataSourceChannel = Channel::CHANNEL_UNSPECIFIED; + $dataSourceDisplayName = '[DISPLAY_NAME]'; + + create_data_source_sample( + $formattedParent, + $dataSourcePrimaryProductDataSourceChannel, + $dataSourceDisplayName + ); +} +// [END merchantapi_v1beta_generated_DataSourcesService_CreateDataSource_sync] diff --git a/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/delete_data_source.php b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/delete_data_source.php new file mode 100644 index 000000000000..ad4fc6aa88af --- /dev/null +++ b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/delete_data_source.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $dataSourcesServiceClient->deleteDataSource($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = DataSourcesServiceClient::dataSourceName('[ACCOUNT]', '[DATASOURCE]'); + + delete_data_source_sample($formattedName); +} +// [END merchantapi_v1beta_generated_DataSourcesService_DeleteDataSource_sync] diff --git a/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/fetch_data_source.php b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/fetch_data_source.php new file mode 100644 index 000000000000..c52db577e25e --- /dev/null +++ b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/fetch_data_source.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $dataSourcesServiceClient->fetchDataSource($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = DataSourcesServiceClient::dataSourceName('[ACCOUNT]', '[DATASOURCE]'); + + fetch_data_source_sample($formattedName); +} +// [END merchantapi_v1beta_generated_DataSourcesService_FetchDataSource_sync] diff --git a/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/get_data_source.php b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/get_data_source.php new file mode 100644 index 000000000000..f52a2378a767 --- /dev/null +++ b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/get_data_source.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DataSource $response */ + $response = $dataSourcesServiceClient->getDataSource($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 = DataSourcesServiceClient::dataSourceName('[ACCOUNT]', '[DATASOURCE]'); + + get_data_source_sample($formattedName); +} +// [END merchantapi_v1beta_generated_DataSourcesService_GetDataSource_sync] diff --git a/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/list_data_sources.php b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/list_data_sources.php new file mode 100644 index 000000000000..0ce83d697da2 --- /dev/null +++ b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/list_data_sources.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataSourcesServiceClient->listDataSources($request); + + /** @var DataSource $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = DataSourcesServiceClient::accountName('[ACCOUNT]'); + + list_data_sources_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_DataSourcesService_ListDataSources_sync] diff --git a/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/update_data_source.php b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/update_data_source.php new file mode 100644 index 000000000000..7d357f9641e4 --- /dev/null +++ b/ShoppingMerchantDatasources/samples/V1beta/DataSourcesServiceClient/update_data_source.php @@ -0,0 +1,85 @@ +setChannel($dataSourcePrimaryProductDataSourceChannel); + $dataSource = (new DataSource()) + ->setPrimaryProductDataSource($dataSourcePrimaryProductDataSource) + ->setDisplayName($dataSourceDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateDataSourceRequest()) + ->setDataSource($dataSource) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var DataSource $response */ + $response = $dataSourcesServiceClient->updateDataSource($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 +{ + $dataSourcePrimaryProductDataSourceChannel = Channel::CHANNEL_UNSPECIFIED; + $dataSourceDisplayName = '[DISPLAY_NAME]'; + + update_data_source_sample($dataSourcePrimaryProductDataSourceChannel, $dataSourceDisplayName); +} +// [END merchantapi_v1beta_generated_DataSourcesService_UpdateDataSource_sync] diff --git a/ShoppingMerchantDatasources/src/V1beta/Client/DataSourcesServiceClient.php b/ShoppingMerchantDatasources/src/V1beta/Client/DataSourcesServiceClient.php new file mode 100644 index 000000000000..516734376895 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/Client/DataSourcesServiceClient.php @@ -0,0 +1,419 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/data_sources_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/data_sources_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/data_sources_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/data_sources_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_source + * resource. + * + * @param string $account + * @param string $datasource + * + * @return string The formatted data_source resource. + * + * @experimental + */ + public static function dataSourceName(string $account, string $datasource): string + { + return self::getPathTemplate('dataSource')->render([ + 'account' => $account, + 'datasource' => $datasource, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - dataSource: accounts/{account}/dataSources/{datasource} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates the new data source configuration for the given account. + * + * The async variant is {@see DataSourcesServiceClient::createDataSourceAsync()} . + * + * @example samples/V1beta/DataSourcesServiceClient/create_data_source.php + * + * @param CreateDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataSource + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createDataSource(CreateDataSourceRequest $request, array $callOptions = []): DataSource + { + return $this->startApiCall('CreateDataSource', $request, $callOptions)->wait(); + } + + /** + * Deletes a data source from your Merchant Center account. + * + * The async variant is {@see DataSourcesServiceClient::deleteDataSourceAsync()} . + * + * @example samples/V1beta/DataSourcesServiceClient/delete_data_source.php + * + * @param DeleteDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteDataSource(DeleteDataSourceRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteDataSource', $request, $callOptions)->wait(); + } + + /** + * Performs the data fetch immediately (even outside fetch schedule) on a + * data source from your Merchant Center Account. If you need to call + * this method more than once per day, you should use the Products service to + * update your product data instead. + * This method only works on data sources with a file input set. + * + * The async variant is {@see DataSourcesServiceClient::fetchDataSourceAsync()} . + * + * @example samples/V1beta/DataSourcesServiceClient/fetch_data_source.php + * + * @param FetchDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function fetchDataSource(FetchDataSourceRequest $request, array $callOptions = []): void + { + $this->startApiCall('FetchDataSource', $request, $callOptions)->wait(); + } + + /** + * Retrieves the data source configuration for the given account. + * + * The async variant is {@see DataSourcesServiceClient::getDataSourceAsync()} . + * + * @example samples/V1beta/DataSourcesServiceClient/get_data_source.php + * + * @param GetDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataSource + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getDataSource(GetDataSourceRequest $request, array $callOptions = []): DataSource + { + return $this->startApiCall('GetDataSource', $request, $callOptions)->wait(); + } + + /** + * Lists the configurations for data sources for the given account. + * + * The async variant is {@see DataSourcesServiceClient::listDataSourcesAsync()} . + * + * @example samples/V1beta/DataSourcesServiceClient/list_data_sources.php + * + * @param ListDataSourcesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listDataSources(ListDataSourcesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDataSources', $request, $callOptions); + } + + /** + * Updates the existing data source configuration. The fields that are + * set in the update mask but not provided in the resource will be deleted. + * + * The async variant is {@see DataSourcesServiceClient::updateDataSourceAsync()} . + * + * @example samples/V1beta/DataSourcesServiceClient/update_data_source.php + * + * @param UpdateDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataSource + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateDataSource(UpdateDataSourceRequest $request, array $callOptions = []): DataSource + { + return $this->startApiCall('UpdateDataSource', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantDatasources/src/V1beta/CreateDataSourceRequest.php b/ShoppingMerchantDatasources/src/V1beta/CreateDataSourceRequest.php new file mode 100644 index 000000000000..5e2a06d7eb8a --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/CreateDataSourceRequest.php @@ -0,0 +1,132 @@ +google.shopping.merchant.datasources.v1beta.CreateDataSourceRequest + */ +class CreateDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account where this data source will be created. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The data source to create. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_source = null; + + /** + * @param string $parent Required. The account where this data source will be created. + * Format: `accounts/{account}` + * Please see {@see DataSourcesServiceClient::accountName()} for help formatting this field. + * @param \Google\Shopping\Merchant\Datasources\V1beta\DataSource $dataSource Required. The data source to create. + * + * @return \Google\Shopping\Merchant\Datasources\V1beta\CreateDataSourceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Shopping\Merchant\Datasources\V1beta\DataSource $dataSource): self + { + return (new self()) + ->setParent($parent) + ->setDataSource($dataSource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account where this data source will be created. + * Format: `accounts/{account}` + * @type \Google\Shopping\Merchant\Datasources\V1beta\DataSource $data_source + * Required. The data source to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account where this data source will be created. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account where this data source will be created. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The data source to create. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Datasources\V1beta\DataSource|null + */ + public function getDataSource() + { + return $this->data_source; + } + + public function hasDataSource() + { + return isset($this->data_source); + } + + public function clearDataSource() + { + unset($this->data_source); + } + + /** + * Required. The data source to create. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Datasources\V1beta\DataSource $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Datasources\V1beta\DataSource::class); + $this->data_source = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/DataSource.php b/ShoppingMerchantDatasources/src/V1beta/DataSource.php new file mode 100644 index 000000000000..163311124daa --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/DataSource.php @@ -0,0 +1,434 @@ +google.shopping.merchant.datasources.v1beta.DataSource + */ +class DataSource extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the data source. + * Format: + * `{datasource.name=accounts/{account}/dataSources/{datasource}}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The data source id. + * + * Generated from protobuf field int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $data_source_id = 0; + /** + * Required. The displayed data source name in the Merchant Center UI. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. Determines the type of input to the data source. Based on the + * input some settings might not work. Only generic data sources can be + * created through the API. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $input = 0; + /** + * Optional. The field is used only when data is managed through a file. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $file_input = null; + protected $Type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Datasources\V1beta\PrimaryProductDataSource $primary_product_data_source + * Required. The [primary data + * source](https://support.google.com/merchants/answer/7439058) for local + * and online products. + * @type \Google\Shopping\Merchant\Datasources\V1beta\SupplementalProductDataSource $supplemental_product_data_source + * Required. The [supplemental data + * source](https://support.google.com/merchants/answer/7439058) for local + * and online products. + * @type \Google\Shopping\Merchant\Datasources\V1beta\LocalInventoryDataSource $local_inventory_data_source + * Required. The [local + * inventory](https://support.google.com/merchants/answer/7023001) data + * source. + * @type \Google\Shopping\Merchant\Datasources\V1beta\RegionalInventoryDataSource $regional_inventory_data_source + * Required. The [regional + * inventory](https://support.google.com/merchants/answer/7439058) data + * source. + * @type \Google\Shopping\Merchant\Datasources\V1beta\PromotionDataSource $promotion_data_source + * Required. The + * [promotion](https://support.google.com/merchants/answer/2906014) data + * source. + * @type string $name + * Identifier. The name of the data source. + * Format: + * `{datasource.name=accounts/{account}/dataSources/{datasource}}` + * @type int|string $data_source_id + * Output only. The data source id. + * @type string $display_name + * Required. The displayed data source name in the Merchant Center UI. + * @type int $input + * Output only. Determines the type of input to the data source. Based on the + * input some settings might not work. Only generic data sources can be + * created through the API. + * @type \Google\Shopping\Merchant\Datasources\V1beta\FileInput $file_input + * Optional. The field is used only when data is managed through a file. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [primary data + * source](https://support.google.com/merchants/answer/7439058) for local + * and online products. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource primary_product_data_source = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Datasources\V1beta\PrimaryProductDataSource|null + */ + public function getPrimaryProductDataSource() + { + return $this->readOneof(4); + } + + public function hasPrimaryProductDataSource() + { + return $this->hasOneof(4); + } + + /** + * Required. The [primary data + * source](https://support.google.com/merchants/answer/7439058) for local + * and online products. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource primary_product_data_source = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Datasources\V1beta\PrimaryProductDataSource $var + * @return $this + */ + public function setPrimaryProductDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Datasources\V1beta\PrimaryProductDataSource::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Required. The [supplemental data + * source](https://support.google.com/merchants/answer/7439058) for local + * and online products. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.SupplementalProductDataSource supplemental_product_data_source = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Datasources\V1beta\SupplementalProductDataSource|null + */ + public function getSupplementalProductDataSource() + { + return $this->readOneof(5); + } + + public function hasSupplementalProductDataSource() + { + return $this->hasOneof(5); + } + + /** + * Required. The [supplemental data + * source](https://support.google.com/merchants/answer/7439058) for local + * and online products. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.SupplementalProductDataSource supplemental_product_data_source = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Datasources\V1beta\SupplementalProductDataSource $var + * @return $this + */ + public function setSupplementalProductDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Datasources\V1beta\SupplementalProductDataSource::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Required. The [local + * inventory](https://support.google.com/merchants/answer/7023001) data + * source. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.LocalInventoryDataSource local_inventory_data_source = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Datasources\V1beta\LocalInventoryDataSource|null + */ + public function getLocalInventoryDataSource() + { + return $this->readOneof(6); + } + + public function hasLocalInventoryDataSource() + { + return $this->hasOneof(6); + } + + /** + * Required. The [local + * inventory](https://support.google.com/merchants/answer/7023001) data + * source. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.LocalInventoryDataSource local_inventory_data_source = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Datasources\V1beta\LocalInventoryDataSource $var + * @return $this + */ + public function setLocalInventoryDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Datasources\V1beta\LocalInventoryDataSource::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Required. The [regional + * inventory](https://support.google.com/merchants/answer/7439058) data + * source. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.RegionalInventoryDataSource regional_inventory_data_source = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Datasources\V1beta\RegionalInventoryDataSource|null + */ + public function getRegionalInventoryDataSource() + { + return $this->readOneof(7); + } + + public function hasRegionalInventoryDataSource() + { + return $this->hasOneof(7); + } + + /** + * Required. The [regional + * inventory](https://support.google.com/merchants/answer/7439058) data + * source. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.RegionalInventoryDataSource regional_inventory_data_source = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Datasources\V1beta\RegionalInventoryDataSource $var + * @return $this + */ + public function setRegionalInventoryDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Datasources\V1beta\RegionalInventoryDataSource::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Required. The + * [promotion](https://support.google.com/merchants/answer/2906014) data + * source. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.PromotionDataSource promotion_data_source = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Datasources\V1beta\PromotionDataSource|null + */ + public function getPromotionDataSource() + { + return $this->readOneof(8); + } + + public function hasPromotionDataSource() + { + return $this->hasOneof(8); + } + + /** + * Required. The + * [promotion](https://support.google.com/merchants/answer/2906014) data + * source. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.PromotionDataSource promotion_data_source = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Datasources\V1beta\PromotionDataSource $var + * @return $this + */ + public function setPromotionDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Datasources\V1beta\PromotionDataSource::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Identifier. The name of the data source. + * Format: + * `{datasource.name=accounts/{account}/dataSources/{datasource}}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the data source. + * Format: + * `{datasource.name=accounts/{account}/dataSources/{datasource}}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The data source id. + * + * Generated from protobuf field int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getDataSourceId() + { + return $this->data_source_id; + } + + /** + * Output only. The data source id. + * + * Generated from protobuf field int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setDataSourceId($var) + { + GPBUtil::checkInt64($var); + $this->data_source_id = $var; + + return $this; + } + + /** + * Required. The displayed data source name in the Merchant Center UI. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The displayed data source name in the Merchant Center UI. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Determines the type of input to the data source. Based on the + * input some settings might not work. Only generic data sources can be + * created through the API. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getInput() + { + return $this->input; + } + + /** + * Output only. Determines the type of input to the data source. Based on the + * input some settings might not work. Only generic data sources can be + * created through the API. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Datasources\V1beta\DataSource\Input::class); + $this->input = $var; + + return $this; + } + + /** + * Optional. The field is used only when data is managed through a file. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Datasources\V1beta\FileInput|null + */ + public function getFileInput() + { + return $this->file_input; + } + + public function hasFileInput() + { + return isset($this->file_input); + } + + public function clearFileInput() + { + unset($this->file_input); + } + + /** + * Optional. The field is used only when data is managed through a file. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Datasources\V1beta\FileInput $var + * @return $this + */ + public function setFileInput($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Datasources\V1beta\FileInput::class); + $this->file_input = $var; + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("Type"); + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/DataSource/Input.php b/ShoppingMerchantDatasources/src/V1beta/DataSource/Input.php new file mode 100644 index 000000000000..95a87cb08bbe --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/DataSource/Input.php @@ -0,0 +1,85 @@ +google.shopping.merchant.datasources.v1beta.DataSource.Input + */ +class Input +{ + /** + * Input unspecified. + * + * Generated from protobuf enum INPUT_UNSPECIFIED = 0; + */ + const INPUT_UNSPECIFIED = 0; + /** + * Represents data sources for which the data is primarily provided through + * the API. + * + * Generated from protobuf enum API = 1; + */ + const API = 1; + /** + * Represents data sources for which the data is primarily provided through + * file input. Data can still be provided through the API. + * + * Generated from protobuf enum FILE = 2; + */ + const FILE = 2; + /** + * The data source for products added directly in Merchant Center. + * This type of data source can not be created or updated through this API, + * only by Merchant Center UI. + * This type of data source is read only. + * + * Generated from protobuf enum UI = 3; + */ + const UI = 3; + /** + * This is also known as + * [Automated feeds](https://support.google.com/merchants/answer/12158480) + * used to automatically build your product data. This type of data source + * can be enabled or disabled through the Accounts bundle. + * + * Generated from protobuf enum AUTOFEED = 4; + */ + const AUTOFEED = 4; + + private static $valueToName = [ + self::INPUT_UNSPECIFIED => 'INPUT_UNSPECIFIED', + self::API => 'API', + self::FILE => 'FILE', + self::UI => 'UI', + self::AUTOFEED => 'AUTOFEED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantDatasources/src/V1beta/DeleteDataSourceRequest.php b/ShoppingMerchantDatasources/src/V1beta/DeleteDataSourceRequest.php new file mode 100644 index 000000000000..e1510c8ad295 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/DeleteDataSourceRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.datasources.v1beta.DeleteDataSourceRequest + */ +class DeleteDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the data source to delete. + * Format: `accounts/{account}/dataSources/{datasource}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the data source to delete. + * Format: `accounts/{account}/dataSources/{datasource}` + * Please see {@see DataSourcesServiceClient::dataSourceName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Datasources\V1beta\DeleteDataSourceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the data source to delete. + * Format: `accounts/{account}/dataSources/{datasource}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the data source to delete. + * Format: `accounts/{account}/dataSources/{datasource}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the data source to delete. + * Format: `accounts/{account}/dataSources/{datasource}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/FetchDataSourceRequest.php b/ShoppingMerchantDatasources/src/V1beta/FetchDataSourceRequest.php new file mode 100644 index 000000000000..8dbc2c96b44b --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/FetchDataSourceRequest.php @@ -0,0 +1,71 @@ +google.shopping.merchant.datasources.v1beta.FetchDataSourceRequest + */ +class FetchDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the data source resource to fetch. + * Format: `accounts/{account}/dataSources/{datasource}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the data source resource to fetch. + * Format: `accounts/{account}/dataSources/{datasource}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the data source resource to fetch. + * Format: `accounts/{account}/dataSources/{datasource}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the data source resource to fetch. + * Format: `accounts/{account}/dataSources/{datasource}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/FileInput.php b/ShoppingMerchantDatasources/src/V1beta/FileInput.php new file mode 100644 index 000000000000..ce4a7ac5a393 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/FileInput.php @@ -0,0 +1,158 @@ +google.shopping.merchant.datasources.v1beta.FileInput + */ +class FileInput extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Fetch details to deliver the data source. It contains settings + * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary + * based on the frequency of fetching. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $fetch_settings = null; + /** + * Optional. The file name of the data source. Required for `UPLOAD` file + * input type. + * + * Generated from protobuf field string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $file_name = ''; + /** + * Output only. The type of file input. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $file_input_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Datasources\V1beta\FileInput\FetchSettings $fetch_settings + * Optional. Fetch details to deliver the data source. It contains settings + * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary + * based on the frequency of fetching. + * @type string $file_name + * Optional. The file name of the data source. Required for `UPLOAD` file + * input type. + * @type int $file_input_type + * Output only. The type of file input. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Fileinputs::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Fetch details to deliver the data source. It contains settings + * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary + * based on the frequency of fetching. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Datasources\V1beta\FileInput\FetchSettings|null + */ + public function getFetchSettings() + { + return $this->fetch_settings; + } + + public function hasFetchSettings() + { + return isset($this->fetch_settings); + } + + public function clearFetchSettings() + { + unset($this->fetch_settings); + } + + /** + * Optional. Fetch details to deliver the data source. It contains settings + * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary + * based on the frequency of fetching. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Datasources\V1beta\FileInput\FetchSettings $var + * @return $this + */ + public function setFetchSettings($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Datasources\V1beta\FileInput\FetchSettings::class); + $this->fetch_settings = $var; + + return $this; + } + + /** + * Optional. The file name of the data source. Required for `UPLOAD` file + * input type. + * + * Generated from protobuf field string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFileName() + { + return $this->file_name; + } + + /** + * Optional. The file name of the data source. Required for `UPLOAD` file + * input type. + * + * Generated from protobuf field string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFileName($var) + { + GPBUtil::checkString($var, True); + $this->file_name = $var; + + return $this; + } + + /** + * Output only. The type of file input. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getFileInputType() + { + return $this->file_input_type; + } + + /** + * Output only. The type of file input. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setFileInputType($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Datasources\V1beta\FileInput\FileInputType::class); + $this->file_input_type = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/FileInput/FetchSettings.php b/ShoppingMerchantDatasources/src/V1beta/FileInput/FetchSettings.php new file mode 100644 index 000000000000..1e056b90782f --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/FileInput/FetchSettings.php @@ -0,0 +1,402 @@ +google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings + */ +class FetchSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Enables or pauses the fetch schedule. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enabled = false; + /** + * Optional. The day of the month when the data source file should be + * fetched (1-31). This field can only be set for monthly frequency. + * + * Generated from protobuf field int32 day_of_month = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $day_of_month = 0; + /** + * Optional. The hour of the day when the data source file should be + * fetched. Minutes and seconds are not supported and will be ignored. + * + * Generated from protobuf field .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $time_of_day = null; + /** + * Optional. The day of the week when the data source file should be + * fetched. This field can only be set for weekly frequency. + * + * Generated from protobuf field .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $day_of_week = 0; + /** + * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by + * default. For example, "America/Los_Angeles". + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $time_zone = ''; + /** + * Required. The frequency describing fetch schedule. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $frequency = 0; + /** + * Optional. The URL where the data source file can be fetched. Google + * Merchant Center supports automatic scheduled uploads using the HTTP, + * HTTPS or SFTP protocols, so the value will need to be a valid link using + * one of those three protocols. Immutable for Google Sheets files. + * + * Generated from protobuf field string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $fetch_uri = ''; + /** + * Optional. An optional user name for [fetch + * url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. + * Used for [submitting data sources through + * SFTP](https://support.google.com/merchants/answer/13813117). + * + * Generated from protobuf field string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $username = ''; + /** + * Optional. An optional password for [fetch + * url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. + * Used for [submitting data sources through + * SFTP](https://support.google.com/merchants/answer/13813117). + * + * Generated from protobuf field string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $password = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Optional. Enables or pauses the fetch schedule. + * @type int $day_of_month + * Optional. The day of the month when the data source file should be + * fetched (1-31). This field can only be set for monthly frequency. + * @type \Google\Type\TimeOfDay $time_of_day + * Optional. The hour of the day when the data source file should be + * fetched. Minutes and seconds are not supported and will be ignored. + * @type int $day_of_week + * Optional. The day of the week when the data source file should be + * fetched. This field can only be set for weekly frequency. + * @type string $time_zone + * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by + * default. For example, "America/Los_Angeles". + * @type int $frequency + * Required. The frequency describing fetch schedule. + * @type string $fetch_uri + * Optional. The URL where the data source file can be fetched. Google + * Merchant Center supports automatic scheduled uploads using the HTTP, + * HTTPS or SFTP protocols, so the value will need to be a valid link using + * one of those three protocols. Immutable for Google Sheets files. + * @type string $username + * Optional. An optional user name for [fetch + * url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. + * Used for [submitting data sources through + * SFTP](https://support.google.com/merchants/answer/13813117). + * @type string $password + * Optional. An optional password for [fetch + * url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. + * Used for [submitting data sources through + * SFTP](https://support.google.com/merchants/answer/13813117). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Fileinputs::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Enables or pauses the fetch schedule. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Optional. Enables or pauses the fetch schedule. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * Optional. The day of the month when the data source file should be + * fetched (1-31). This field can only be set for monthly frequency. + * + * Generated from protobuf field int32 day_of_month = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDayOfMonth() + { + return $this->day_of_month; + } + + /** + * Optional. The day of the month when the data source file should be + * fetched (1-31). This field can only be set for monthly frequency. + * + * Generated from protobuf field int32 day_of_month = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDayOfMonth($var) + { + GPBUtil::checkInt32($var); + $this->day_of_month = $var; + + return $this; + } + + /** + * Optional. The hour of the day when the data source file should be + * fetched. Minutes and seconds are not supported and will be ignored. + * + * Generated from protobuf field .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Type\TimeOfDay|null + */ + public function getTimeOfDay() + { + return $this->time_of_day; + } + + public function hasTimeOfDay() + { + return isset($this->time_of_day); + } + + public function clearTimeOfDay() + { + unset($this->time_of_day); + } + + /** + * Optional. The hour of the day when the data source file should be + * fetched. Minutes and seconds are not supported and will be ignored. + * + * Generated from protobuf field .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Type\TimeOfDay $var + * @return $this + */ + public function setTimeOfDay($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class); + $this->time_of_day = $var; + + return $this; + } + + /** + * Optional. The day of the week when the data source file should be + * fetched. This field can only be set for weekly frequency. + * + * Generated from protobuf field .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDayOfWeek() + { + return $this->day_of_week; + } + + /** + * Optional. The day of the week when the data source file should be + * fetched. This field can only be set for weekly frequency. + * + * Generated from protobuf field .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDayOfWeek($var) + { + GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); + $this->day_of_week = $var; + + return $this; + } + + /** + * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by + * default. For example, "America/Los_Angeles". + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by + * default. For example, "America/Los_Angeles". + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * Required. The frequency describing fetch schedule. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getFrequency() + { + return $this->frequency; + } + + /** + * Required. The frequency describing fetch schedule. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setFrequency($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Datasources\V1beta\FileInput\FetchSettings\Frequency::class); + $this->frequency = $var; + + return $this; + } + + /** + * Optional. The URL where the data source file can be fetched. Google + * Merchant Center supports automatic scheduled uploads using the HTTP, + * HTTPS or SFTP protocols, so the value will need to be a valid link using + * one of those three protocols. Immutable for Google Sheets files. + * + * Generated from protobuf field string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFetchUri() + { + return $this->fetch_uri; + } + + /** + * Optional. The URL where the data source file can be fetched. Google + * Merchant Center supports automatic scheduled uploads using the HTTP, + * HTTPS or SFTP protocols, so the value will need to be a valid link using + * one of those three protocols. Immutable for Google Sheets files. + * + * Generated from protobuf field string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFetchUri($var) + { + GPBUtil::checkString($var, True); + $this->fetch_uri = $var; + + return $this; + } + + /** + * Optional. An optional user name for [fetch + * url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. + * Used for [submitting data sources through + * SFTP](https://support.google.com/merchants/answer/13813117). + * + * Generated from protobuf field string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Optional. An optional user name for [fetch + * url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. + * Used for [submitting data sources through + * SFTP](https://support.google.com/merchants/answer/13813117). + * + * Generated from protobuf field string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + + /** + * Optional. An optional password for [fetch + * url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. + * Used for [submitting data sources through + * SFTP](https://support.google.com/merchants/answer/13813117). + * + * Generated from protobuf field string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Optional. An optional password for [fetch + * url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. + * Used for [submitting data sources through + * SFTP](https://support.google.com/merchants/answer/13813117). + * + * Generated from protobuf field string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantDatasources/src/V1beta/FileInput/FetchSettings/Frequency.php b/ShoppingMerchantDatasources/src/V1beta/FileInput/FetchSettings/Frequency.php new file mode 100644 index 000000000000..6f4d3e69e446 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/FileInput/FetchSettings/Frequency.php @@ -0,0 +1,84 @@ +google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.Frequency + */ +class Frequency +{ + /** + * Frequency unspecified. + * + * Generated from protobuf enum FREQUENCY_UNSPECIFIED = 0; + */ + const FREQUENCY_UNSPECIFIED = 0; + /** + * The fetch happens every day. + * + * Generated from protobuf enum FREQUENCY_DAILY = 1; + */ + const FREQUENCY_DAILY = 1; + /** + * The fetch happens every week. + * + * Generated from protobuf enum FREQUENCY_WEEKLY = 2; + */ + const FREQUENCY_WEEKLY = 2; + /** + * The fetch happens every month. + * + * Generated from protobuf enum FREQUENCY_MONTHLY = 3; + */ + const FREQUENCY_MONTHLY = 3; + + private static $valueToName = [ + self::FREQUENCY_UNSPECIFIED => 'FREQUENCY_UNSPECIFIED', + self::FREQUENCY_DAILY => 'FREQUENCY_DAILY', + self::FREQUENCY_WEEKLY => 'FREQUENCY_WEEKLY', + self::FREQUENCY_MONTHLY => 'FREQUENCY_MONTHLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantDatasources/src/V1beta/FileInput/FileInputType.php b/ShoppingMerchantDatasources/src/V1beta/FileInput/FileInputType.php new file mode 100644 index 000000000000..3cfe3196d5ec --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/FileInput/FileInputType.php @@ -0,0 +1,72 @@ +google.shopping.merchant.datasources.v1beta.FileInput.FileInputType + */ +class FileInputType +{ + /** + * File input type unspecified. + * + * Generated from protobuf enum FILE_INPUT_TYPE_UNSPECIFIED = 0; + */ + const FILE_INPUT_TYPE_UNSPECIFIED = 0; + /** + * The file is uploaded through SFTP, Google Cloud Storage or manually in + * the Merchant Center. + * + * Generated from protobuf enum UPLOAD = 1; + */ + const UPLOAD = 1; + /** + * The file is fetched from the configured + * [fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri]. + * + * Generated from protobuf enum FETCH = 2; + */ + const FETCH = 2; + /** + * The file is fetched from Google Sheets specified in the + * [fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri]. + * + * Generated from protobuf enum GOOGLE_SHEETS = 3; + */ + const GOOGLE_SHEETS = 3; + + private static $valueToName = [ + self::FILE_INPUT_TYPE_UNSPECIFIED => 'FILE_INPUT_TYPE_UNSPECIFIED', + self::UPLOAD => 'UPLOAD', + self::FETCH => 'FETCH', + self::GOOGLE_SHEETS => 'GOOGLE_SHEETS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantDatasources/src/V1beta/GetDataSourceRequest.php b/ShoppingMerchantDatasources/src/V1beta/GetDataSourceRequest.php new file mode 100644 index 000000000000..2d17a5e9e0b4 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/GetDataSourceRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.datasources.v1beta.GetDataSourceRequest + */ +class GetDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the data source to retrieve. + * Format: `accounts/{account}/dataSources/{datasource}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the data source to retrieve. + * Format: `accounts/{account}/dataSources/{datasource}` + * Please see {@see DataSourcesServiceClient::dataSourceName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Datasources\V1beta\GetDataSourceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the data source to retrieve. + * Format: `accounts/{account}/dataSources/{datasource}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the data source to retrieve. + * Format: `accounts/{account}/dataSources/{datasource}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the data source to retrieve. + * Format: `accounts/{account}/dataSources/{datasource}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/ListDataSourcesRequest.php b/ShoppingMerchantDatasources/src/V1beta/ListDataSourcesRequest.php new file mode 100644 index 000000000000..855b5bd16f24 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/ListDataSourcesRequest.php @@ -0,0 +1,178 @@ +google.shopping.merchant.datasources.v1beta.ListDataSourcesRequest + */ +class ListDataSourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account to list data sources for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of data sources to return. The service may + * return fewer than this value. The maximum value is 1000; values above 1000 + * will be coerced to 1000. If unspecified, the maximum number of data sources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListDataSources` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataSources` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The account to list data sources for. + * Format: `accounts/{account}` + * Please see {@see DataSourcesServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Datasources\V1beta\ListDataSourcesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account to list data sources for. + * Format: `accounts/{account}` + * @type int $page_size + * Optional. The maximum number of data sources to return. The service may + * return fewer than this value. The maximum value is 1000; values above 1000 + * will be coerced to 1000. If unspecified, the maximum number of data sources + * will be returned. + * @type string $page_token + * Optional. A page token, received from a previous `ListDataSources` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataSources` + * must match the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account to list data sources for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account to list data sources for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of data sources to return. The service may + * return fewer than this value. The maximum value is 1000; values above 1000 + * will be coerced to 1000. If unspecified, the maximum number of data sources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of data sources to return. The service may + * return fewer than this value. The maximum value is 1000; values above 1000 + * will be coerced to 1000. If unspecified, the maximum number of data sources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListDataSources` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataSources` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListDataSources` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataSources` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/ListDataSourcesResponse.php b/ShoppingMerchantDatasources/src/V1beta/ListDataSourcesResponse.php new file mode 100644 index 000000000000..d4adb39df479 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/ListDataSourcesResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.datasources.v1beta.ListDataSourcesResponse + */ +class ListDataSourcesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The data sources from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.datasources.v1beta.DataSource data_sources = 1; + */ + private $data_sources; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Datasources\V1beta\DataSource>|\Google\Protobuf\Internal\RepeatedField $data_sources + * The data sources from the specified account. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasources::initOnce(); + parent::__construct($data); + } + + /** + * The data sources from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.datasources.v1beta.DataSource data_sources = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataSources() + { + return $this->data_sources; + } + + /** + * The data sources from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.datasources.v1beta.DataSource data_sources = 1; + * @param array<\Google\Shopping\Merchant\Datasources\V1beta\DataSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Datasources\V1beta\DataSource::class); + $this->data_sources = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/LocalInventoryDataSource.php b/ShoppingMerchantDatasources/src/V1beta/LocalInventoryDataSource.php new file mode 100644 index 000000000000..5bd74225e70a --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/LocalInventoryDataSource.php @@ -0,0 +1,125 @@ +google.shopping.merchant.datasources.v1beta.LocalInventoryDataSource + */ +class LocalInventoryDataSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The feed label of the offers to which the local + * inventory is provided. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * + * Generated from protobuf field string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $feed_label = ''; + /** + * Required. Immutable. The two-letter ISO 639-1 language of the items to + * which the local inventory is provided. + * + * Generated from protobuf field string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $content_language = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $feed_label + * Required. Immutable. The feed label of the offers to which the local + * inventory is provided. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * @type string $content_language + * Required. Immutable. The two-letter ISO 639-1 language of the items to + * which the local inventory is provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasourcetypes::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The feed label of the offers to which the local + * inventory is provided. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * + * Generated from protobuf field string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getFeedLabel() + { + return $this->feed_label; + } + + /** + * Required. Immutable. The feed label of the offers to which the local + * inventory is provided. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * + * Generated from protobuf field string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setFeedLabel($var) + { + GPBUtil::checkString($var, True); + $this->feed_label = $var; + + return $this; + } + + /** + * Required. Immutable. The two-letter ISO 639-1 language of the items to + * which the local inventory is provided. + * + * Generated from protobuf field string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getContentLanguage() + { + return $this->content_language; + } + + /** + * Required. Immutable. The two-letter ISO 639-1 language of the items to + * which the local inventory is provided. + * + * Generated from protobuf field string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/PrimaryProductDataSource.php b/ShoppingMerchantDatasources/src/V1beta/PrimaryProductDataSource.php new file mode 100644 index 000000000000..725929b67eb4 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/PrimaryProductDataSource.php @@ -0,0 +1,265 @@ +google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource + */ +class PrimaryProductDataSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Specifies the type of data source channel. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Channel channel = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $channel = 0; + /** + * Optional. Immutable. The feed label that is specified on the data source + * level. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * `feedLabel` and `contentLanguage` must be either both set or unset for data + * sources with product content type. + * They must be set for data sources with a file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept products without that + * restriction. + * + * Generated from protobuf field optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $feed_label = null; + /** + * Optional. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * `feedLabel` and `contentLanguage` must be either both set or unset. + * The fields can only be unset for data sources without file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept products without that + * restriction. + * + * Generated from protobuf field optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $content_language = null; + /** + * Optional. The countries where the items may be displayed. Represented as a + * [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * + * Generated from protobuf field repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $countries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $channel + * Required. Immutable. Specifies the type of data source channel. + * @type string $feed_label + * Optional. Immutable. The feed label that is specified on the data source + * level. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * `feedLabel` and `contentLanguage` must be either both set or unset for data + * sources with product content type. + * They must be set for data sources with a file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept products without that + * restriction. + * @type string $content_language + * Optional. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * `feedLabel` and `contentLanguage` must be either both set or unset. + * The fields can only be unset for data sources without file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept products without that + * restriction. + * @type array|\Google\Protobuf\Internal\RepeatedField $countries + * Optional. The countries where the items may be displayed. Represented as a + * [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasourcetypes::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Specifies the type of data source channel. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Channel channel = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getChannel() + { + return $this->channel; + } + + /** + * Required. Immutable. Specifies the type of data source channel. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Channel channel = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setChannel($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Datasources\V1beta\PrimaryProductDataSource\Channel::class); + $this->channel = $var; + + return $this; + } + + /** + * Optional. Immutable. The feed label that is specified on the data source + * level. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * `feedLabel` and `contentLanguage` must be either both set or unset for data + * sources with product content type. + * They must be set for data sources with a file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept products without that + * restriction. + * + * Generated from protobuf field optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getFeedLabel() + { + return isset($this->feed_label) ? $this->feed_label : ''; + } + + public function hasFeedLabel() + { + return isset($this->feed_label); + } + + public function clearFeedLabel() + { + unset($this->feed_label); + } + + /** + * Optional. Immutable. The feed label that is specified on the data source + * level. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * `feedLabel` and `contentLanguage` must be either both set or unset for data + * sources with product content type. + * They must be set for data sources with a file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept products without that + * restriction. + * + * Generated from protobuf field optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setFeedLabel($var) + { + GPBUtil::checkString($var, True); + $this->feed_label = $var; + + return $this; + } + + /** + * Optional. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * `feedLabel` and `contentLanguage` must be either both set or unset. + * The fields can only be unset for data sources without file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept products without that + * restriction. + * + * Generated from protobuf field optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getContentLanguage() + { + return isset($this->content_language) ? $this->content_language : ''; + } + + public function hasContentLanguage() + { + return isset($this->content_language); + } + + public function clearContentLanguage() + { + unset($this->content_language); + } + + /** + * Optional. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * `feedLabel` and `contentLanguage` must be either both set or unset. + * The fields can only be unset for data sources without file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept products without that + * restriction. + * + * Generated from protobuf field optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + + /** + * Optional. The countries where the items may be displayed. Represented as a + * [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * + * Generated from protobuf field repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCountries() + { + return $this->countries; + } + + /** + * Optional. The countries where the items may be displayed. Represented as a + * [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * + * Generated from protobuf field repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCountries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->countries = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/PrimaryProductDataSource/Channel.php b/ShoppingMerchantDatasources/src/V1beta/PrimaryProductDataSource/Channel.php new file mode 100644 index 000000000000..d0a015f65ae9 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/PrimaryProductDataSource/Channel.php @@ -0,0 +1,71 @@ +google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Channel + */ +class Channel +{ + /** + * Not specified. + * + * Generated from protobuf enum CHANNEL_UNSPECIFIED = 0; + */ + const CHANNEL_UNSPECIFIED = 0; + /** + * Online product. + * + * Generated from protobuf enum ONLINE_PRODUCTS = 1; + */ + const ONLINE_PRODUCTS = 1; + /** + * Local product. + * + * Generated from protobuf enum LOCAL_PRODUCTS = 2; + */ + const LOCAL_PRODUCTS = 2; + /** + * Unified data source for both local and online products. + * + * Generated from protobuf enum PRODUCTS = 3; + */ + const PRODUCTS = 3; + + private static $valueToName = [ + self::CHANNEL_UNSPECIFIED => 'CHANNEL_UNSPECIFIED', + self::ONLINE_PRODUCTS => 'ONLINE_PRODUCTS', + self::LOCAL_PRODUCTS => 'LOCAL_PRODUCTS', + self::PRODUCTS => 'PRODUCTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantDatasources/src/V1beta/PromotionDataSource.php b/ShoppingMerchantDatasources/src/V1beta/PromotionDataSource.php new file mode 100644 index 000000000000..c2971d9c23a6 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/PromotionDataSource.php @@ -0,0 +1,121 @@ +google.shopping.merchant.datasources.v1beta.PromotionDataSource + */ +class PromotionDataSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The target country used as part of the unique + * identifier. Represented as a [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * Promotions are only available in selected + * [countries](https://support.google.com/merchants/answer/4588460). + * + * Generated from protobuf field string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $target_country = ''; + /** + * Required. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * + * Generated from protobuf field string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $content_language = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $target_country + * Required. Immutable. The target country used as part of the unique + * identifier. Represented as a [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * Promotions are only available in selected + * [countries](https://support.google.com/merchants/answer/4588460). + * @type string $content_language + * Required. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasourcetypes::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The target country used as part of the unique + * identifier. Represented as a [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * Promotions are only available in selected + * [countries](https://support.google.com/merchants/answer/4588460). + * + * Generated from protobuf field string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getTargetCountry() + { + return $this->target_country; + } + + /** + * Required. Immutable. The target country used as part of the unique + * identifier. Represented as a [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * Promotions are only available in selected + * [countries](https://support.google.com/merchants/answer/4588460). + * + * Generated from protobuf field string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setTargetCountry($var) + { + GPBUtil::checkString($var, True); + $this->target_country = $var; + + return $this; + } + + /** + * Required. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * + * Generated from protobuf field string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getContentLanguage() + { + return $this->content_language; + } + + /** + * Required. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * + * Generated from protobuf field string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/RegionalInventoryDataSource.php b/ShoppingMerchantDatasources/src/V1beta/RegionalInventoryDataSource.php new file mode 100644 index 000000000000..cef3f26f4e5c --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/RegionalInventoryDataSource.php @@ -0,0 +1,125 @@ +google.shopping.merchant.datasources.v1beta.RegionalInventoryDataSource + */ +class RegionalInventoryDataSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The feed label of the offers to which the regional + * inventory is provided. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * + * Generated from protobuf field string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $feed_label = ''; + /** + * Required. Immutable. The two-letter ISO 639-1 language of the items to + * which the regional inventory is provided. + * + * Generated from protobuf field string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $content_language = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $feed_label + * Required. Immutable. The feed label of the offers to which the regional + * inventory is provided. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * @type string $content_language + * Required. Immutable. The two-letter ISO 639-1 language of the items to + * which the regional inventory is provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasourcetypes::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The feed label of the offers to which the regional + * inventory is provided. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * + * Generated from protobuf field string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getFeedLabel() + { + return $this->feed_label; + } + + /** + * Required. Immutable. The feed label of the offers to which the regional + * inventory is provided. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * + * Generated from protobuf field string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setFeedLabel($var) + { + GPBUtil::checkString($var, True); + $this->feed_label = $var; + + return $this; + } + + /** + * Required. Immutable. The two-letter ISO 639-1 language of the items to + * which the regional inventory is provided. + * + * Generated from protobuf field string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getContentLanguage() + { + return $this->content_language; + } + + /** + * Required. Immutable. The two-letter ISO 639-1 language of the items to + * which the regional inventory is provided. + * + * Generated from protobuf field string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/SupplementalProductDataSource.php b/ShoppingMerchantDatasources/src/V1beta/SupplementalProductDataSource.php new file mode 100644 index 000000000000..a14d5bfaf3e2 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/SupplementalProductDataSource.php @@ -0,0 +1,189 @@ +google.shopping.merchant.datasources.v1beta.SupplementalProductDataSource + */ +class SupplementalProductDataSource extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Immutable. The feed label that is specified on the data source + * level. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * `feedLabel` and `contentLanguage` must be either both set or unset for data + * sources with product content type. + * They must be set for data sources with a file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept produts without that + * restriction. + * + * Generated from protobuf field optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $feed_label = null; + /** + * Optional. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * `feedLabel` and `contentLanguage` must be either both set or unset. + * The fields can only be unset for data sources without file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept produts without that + * restriction. + * + * Generated from protobuf field optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $content_language = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $feed_label + * Optional. Immutable. The feed label that is specified on the data source + * level. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * `feedLabel` and `contentLanguage` must be either both set or unset for data + * sources with product content type. + * They must be set for data sources with a file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept produts without that + * restriction. + * @type string $content_language + * Optional. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * `feedLabel` and `contentLanguage` must be either both set or unset. + * The fields can only be unset for data sources without file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept produts without that + * restriction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasourcetypes::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Immutable. The feed label that is specified on the data source + * level. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * `feedLabel` and `contentLanguage` must be either both set or unset for data + * sources with product content type. + * They must be set for data sources with a file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept produts without that + * restriction. + * + * Generated from protobuf field optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getFeedLabel() + { + return isset($this->feed_label) ? $this->feed_label : ''; + } + + public function hasFeedLabel() + { + return isset($this->feed_label); + } + + public function clearFeedLabel() + { + unset($this->feed_label); + } + + /** + * Optional. Immutable. The feed label that is specified on the data source + * level. + * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + * and dashes (-). + * See also [migration to feed + * labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + * `feedLabel` and `contentLanguage` must be either both set or unset for data + * sources with product content type. + * They must be set for data sources with a file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept produts without that + * restriction. + * + * Generated from protobuf field optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setFeedLabel($var) + { + GPBUtil::checkString($var, True); + $this->feed_label = $var; + + return $this; + } + + /** + * Optional. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * `feedLabel` and `contentLanguage` must be either both set or unset. + * The fields can only be unset for data sources without file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept produts without that + * restriction. + * + * Generated from protobuf field optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getContentLanguage() + { + return isset($this->content_language) ? $this->content_language : ''; + } + + public function hasContentLanguage() + { + return isset($this->content_language); + } + + public function clearContentLanguage() + { + unset($this->content_language); + } + + /** + * Optional. Immutable. The two-letter ISO 639-1 language of the items in the + * data source. + * `feedLabel` and `contentLanguage` must be either both set or unset. + * The fields can only be unset for data sources without file input. + * If set, the data source will only accept products matching this + * combination. If unset, the data source will accept produts without that + * restriction. + * + * Generated from protobuf field optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/UpdateDataSourceRequest.php b/ShoppingMerchantDatasources/src/V1beta/UpdateDataSourceRequest.php new file mode 100644 index 000000000000..f0852c6fe162 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/UpdateDataSourceRequest.php @@ -0,0 +1,158 @@ +google.shopping.merchant.datasources.v1beta.UpdateDataSourceRequest + */ +class UpdateDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The data source resource to update. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_source = null; + /** + * Required. The list of data source fields to be updated. + * Fields specified in the update mask without a value specified in the + * body will be deleted from the data source. + * Providing special "*" value for full data source replacement is not + * supported. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Datasources\V1beta\DataSource $dataSource Required. The data source resource to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of data source fields to be updated. + * + * Fields specified in the update mask without a value specified in the + * body will be deleted from the data source. + * + * Providing special "*" value for full data source replacement is not + * supported. + * + * @return \Google\Shopping\Merchant\Datasources\V1beta\UpdateDataSourceRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Datasources\V1beta\DataSource $dataSource, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDataSource($dataSource) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Datasources\V1beta\DataSource $data_source + * Required. The data source resource to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of data source fields to be updated. + * Fields specified in the update mask without a value specified in the + * body will be deleted from the data source. + * Providing special "*" value for full data source replacement is not + * supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The data source resource to update. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Datasources\V1beta\DataSource|null + */ + public function getDataSource() + { + return $this->data_source; + } + + public function hasDataSource() + { + return isset($this->data_source); + } + + public function clearDataSource() + { + unset($this->data_source); + } + + /** + * Required. The data source resource to update. + * + * Generated from protobuf field .google.shopping.merchant.datasources.v1beta.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Datasources\V1beta\DataSource $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Datasources\V1beta\DataSource::class); + $this->data_source = $var; + + return $this; + } + + /** + * Required. The list of data source fields to be updated. + * Fields specified in the update mask without a value specified in the + * body will be deleted from the data source. + * Providing special "*" value for full data source replacement is not + * supported. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of data source fields to be updated. + * Fields specified in the update mask without a value specified in the + * body will be deleted from the data source. + * Providing special "*" value for full data source replacement is not + * supported. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantDatasources/src/V1beta/gapic_metadata.json b/ShoppingMerchantDatasources/src/V1beta/gapic_metadata.json new file mode 100644 index 000000000000..a982ccd30154 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/gapic_metadata.json @@ -0,0 +1,48 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.shopping.merchant.datasources.v1beta", + "libraryPackage": "Google\\Shopping\\Merchant\\Datasources\\V1beta", + "services": { + "DataSourcesService": { + "clients": { + "grpc": { + "libraryClient": "DataSourcesServiceGapicClient", + "rpcs": { + "CreateDataSource": { + "methods": [ + "createDataSource" + ] + }, + "DeleteDataSource": { + "methods": [ + "deleteDataSource" + ] + }, + "FetchDataSource": { + "methods": [ + "fetchDataSource" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_client_config.json b/ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_client_config.json new file mode 100644 index 000000000000..9118f6e25343 --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.shopping.merchant.datasources.v1beta.DataSourcesService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FetchDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDataSources": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_descriptor_config.php b/ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_descriptor_config.php new file mode 100644 index 000000000000..989016d16b4c --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_descriptor_config.php @@ -0,0 +1,113 @@ + [ + 'google.shopping.merchant.datasources.v1beta.DataSourcesService' => [ + 'CreateDataSource' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Datasources\V1beta\DataSource', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataSource' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'FetchDataSource' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Datasources\V1beta\DataSource', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDataSources' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataSources', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Datasources\V1beta\ListDataSourcesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateDataSource' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Datasources\V1beta\DataSource', + 'headerParams' => [ + [ + 'keyName' => 'data_source.name', + 'fieldAccessors' => [ + 'getDataSource', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'dataSource' => 'accounts/{account}/dataSources/{datasource}', + ], + ], + ], +]; diff --git a/ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_rest_client_config.php b/ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_rest_client_config.php new file mode 100644 index 000000000000..f2c12673dfcb --- /dev/null +++ b/ShoppingMerchantDatasources/src/V1beta/resources/data_sources_service_rest_client_config.php @@ -0,0 +1,102 @@ + [ + 'google.shopping.merchant.datasources.v1beta.DataSourcesService' => [ + 'CreateDataSource' => [ + 'method' => 'post', + 'uriTemplate' => '/datasources/v1beta/{parent=accounts/*}/dataSources', + 'body' => 'data_source', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataSource' => [ + 'method' => 'delete', + 'uriTemplate' => '/datasources/v1beta/{name=accounts/*/dataSources/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FetchDataSource' => [ + 'method' => 'post', + 'uriTemplate' => '/datasources/v1beta/{name=accounts/*/dataSources/*}:fetch', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'method' => 'get', + 'uriTemplate' => '/datasources/v1beta/{name=accounts/*/dataSources/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListDataSources' => [ + 'method' => 'get', + 'uriTemplate' => '/datasources/v1beta/{parent=accounts/*}/dataSources', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateDataSource' => [ + 'method' => 'patch', + 'uriTemplate' => '/datasources/v1beta/{data_source.name=accounts/*/dataSources/*}', + 'body' => 'data_source', + 'placeholders' => [ + 'data_source.name' => [ + 'getters' => [ + 'getDataSource', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantDatasources/tests/Unit/V1beta/Client/DataSourcesServiceClientTest.php b/ShoppingMerchantDatasources/tests/Unit/V1beta/Client/DataSourcesServiceClientTest.php new file mode 100644 index 000000000000..832c9296f010 --- /dev/null +++ b/ShoppingMerchantDatasources/tests/Unit/V1beta/Client/DataSourcesServiceClientTest.php @@ -0,0 +1,570 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return DataSourcesServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DataSourcesServiceClient($options); + } + + /** @test */ + public function createDataSourceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $dataSourceId = 1015796374; + $displayName = 'displayName1615086568'; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name); + $expectedResponse->setDataSourceId($dataSourceId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $dataSource = new DataSource(); + $dataSourceDisplayName = 'dataSourceDisplayName121757896'; + $dataSource->setDisplayName($dataSourceDisplayName); + $dataSourcePrimaryProductDataSource = new PrimaryProductDataSource(); + $primaryProductDataSourceChannel = Channel::CHANNEL_UNSPECIFIED; + $dataSourcePrimaryProductDataSource->setChannel($primaryProductDataSourceChannel); + $dataSource->setPrimaryProductDataSource($dataSourcePrimaryProductDataSource); + $request = (new CreateDataSourceRequest())->setParent($formattedParent)->setDataSource($dataSource); + $response = $gapicClient->createDataSource($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.datasources.v1beta.DataSourcesService/CreateDataSource', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataSourceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $dataSource = new DataSource(); + $dataSourceDisplayName = 'dataSourceDisplayName121757896'; + $dataSource->setDisplayName($dataSourceDisplayName); + $dataSourcePrimaryProductDataSource = new PrimaryProductDataSource(); + $primaryProductDataSourceChannel = Channel::CHANNEL_UNSPECIFIED; + $dataSourcePrimaryProductDataSource->setChannel($primaryProductDataSourceChannel); + $dataSource->setPrimaryProductDataSource($dataSourcePrimaryProductDataSource); + $request = (new CreateDataSourceRequest())->setParent($formattedParent)->setDataSource($dataSource); + try { + $gapicClient->createDataSource($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataSourceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataSourceName('[ACCOUNT]', '[DATASOURCE]'); + $request = (new DeleteDataSourceRequest())->setName($formattedName); + $gapicClient->deleteDataSource($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.datasources.v1beta.DataSourcesService/DeleteDataSource', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataSourceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataSourceName('[ACCOUNT]', '[DATASOURCE]'); + $request = (new DeleteDataSourceRequest())->setName($formattedName); + try { + $gapicClient->deleteDataSource($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchDataSourceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataSourceName('[ACCOUNT]', '[DATASOURCE]'); + $request = (new FetchDataSourceRequest())->setName($formattedName); + $gapicClient->fetchDataSource($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.datasources.v1beta.DataSourcesService/FetchDataSource', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchDataSourceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataSourceName('[ACCOUNT]', '[DATASOURCE]'); + $request = (new FetchDataSourceRequest())->setName($formattedName); + try { + $gapicClient->fetchDataSource($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataSourceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $dataSourceId = 1015796374; + $displayName = 'displayName1615086568'; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name2); + $expectedResponse->setDataSourceId($dataSourceId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataSourceName('[ACCOUNT]', '[DATASOURCE]'); + $request = (new GetDataSourceRequest())->setName($formattedName); + $response = $gapicClient->getDataSource($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.datasources.v1beta.DataSourcesService/GetDataSource', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataSourceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataSourceName('[ACCOUNT]', '[DATASOURCE]'); + $request = (new GetDataSourceRequest())->setName($formattedName); + try { + $gapicClient->getDataSource($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataSourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataSourcesElement = new DataSource(); + $dataSources = [$dataSourcesElement]; + $expectedResponse = new ListDataSourcesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataSources($dataSources); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListDataSourcesRequest())->setParent($formattedParent); + $response = $gapicClient->listDataSources($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataSources()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.datasources.v1beta.DataSourcesService/ListDataSources', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataSourcesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListDataSourcesRequest())->setParent($formattedParent); + try { + $gapicClient->listDataSources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataSourceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $dataSourceId = 1015796374; + $displayName = 'displayName1615086568'; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name); + $expectedResponse->setDataSourceId($dataSourceId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $dataSource = new DataSource(); + $dataSourceDisplayName = 'dataSourceDisplayName121757896'; + $dataSource->setDisplayName($dataSourceDisplayName); + $dataSourcePrimaryProductDataSource = new PrimaryProductDataSource(); + $primaryProductDataSourceChannel = Channel::CHANNEL_UNSPECIFIED; + $dataSourcePrimaryProductDataSource->setChannel($primaryProductDataSourceChannel); + $dataSource->setPrimaryProductDataSource($dataSourcePrimaryProductDataSource); + $updateMask = new FieldMask(); + $request = (new UpdateDataSourceRequest())->setDataSource($dataSource)->setUpdateMask($updateMask); + $response = $gapicClient->updateDataSource($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.datasources.v1beta.DataSourcesService/UpdateDataSource', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataSourceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $dataSource = new DataSource(); + $dataSourceDisplayName = 'dataSourceDisplayName121757896'; + $dataSource->setDisplayName($dataSourceDisplayName); + $dataSourcePrimaryProductDataSource = new PrimaryProductDataSource(); + $primaryProductDataSourceChannel = Channel::CHANNEL_UNSPECIFIED; + $dataSourcePrimaryProductDataSource->setChannel($primaryProductDataSourceChannel); + $dataSource->setPrimaryProductDataSource($dataSourcePrimaryProductDataSource); + $updateMask = new FieldMask(); + $request = (new UpdateDataSourceRequest())->setDataSource($dataSource)->setUpdateMask($updateMask); + try { + $gapicClient->updateDataSource($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataSourceAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $dataSourceId = 1015796374; + $displayName = 'displayName1615086568'; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name); + $expectedResponse->setDataSourceId($dataSourceId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $dataSource = new DataSource(); + $dataSourceDisplayName = 'dataSourceDisplayName121757896'; + $dataSource->setDisplayName($dataSourceDisplayName); + $dataSourcePrimaryProductDataSource = new PrimaryProductDataSource(); + $primaryProductDataSourceChannel = Channel::CHANNEL_UNSPECIFIED; + $dataSourcePrimaryProductDataSource->setChannel($primaryProductDataSourceChannel); + $dataSource->setPrimaryProductDataSource($dataSourcePrimaryProductDataSource); + $request = (new CreateDataSourceRequest())->setParent($formattedParent)->setDataSource($dataSource); + $response = $gapicClient->createDataSourceAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.datasources.v1beta.DataSourcesService/CreateDataSource', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantInventories/.repo-metadata.json b/ShoppingMerchantInventories/.repo-metadata.json deleted file mode 100644 index d67750dbd930..000000000000 --- a/ShoppingMerchantInventories/.repo-metadata.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "distribution_name": "google/shopping-merchant-inventories", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-inventories/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi" -} diff --git a/ShoppingMerchantInventories/VERSION b/ShoppingMerchantInventories/VERSION index 267577d47e49..8f0916f768f0 100644 --- a/ShoppingMerchantInventories/VERSION +++ b/ShoppingMerchantInventories/VERSION @@ -1 +1 @@ -0.4.1 +0.5.0 diff --git a/ShoppingMerchantInventories/composer.json b/ShoppingMerchantInventories/composer.json index c425b3dcc3e4..a67c871fe1cc 100644 --- a/ShoppingMerchantInventories/composer.json +++ b/ShoppingMerchantInventories/composer.json @@ -18,8 +18,8 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", - "google/shopping-common-protos": "^0.3.0" + "google/gax": "^1.34.0", + "google/shopping-common-protos": "^0.4.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ShoppingMerchantInventories/samples/V1beta/LocalInventoryServiceClient/insert_local_inventory.php b/ShoppingMerchantInventories/samples/V1beta/LocalInventoryServiceClient/insert_local_inventory.php index 01f58e746fa5..a62a1bad1509 100644 --- a/ShoppingMerchantInventories/samples/V1beta/LocalInventoryServiceClient/insert_local_inventory.php +++ b/ShoppingMerchantInventories/samples/V1beta/LocalInventoryServiceClient/insert_local_inventory.php @@ -44,7 +44,7 @@ * Please see {@see LocalInventoryServiceClient::productName()} for help formatting this field. * @param string $localInventoryStoreCode Immutable. Store code (the store ID from your Business Profile) * of the physical store the product is sold in. See the [Local product - * inventory feed + * inventory data * specification](https://support.google.com/merchants/answer/3061342) for * more information. */ diff --git a/ShoppingMerchantInventories/src/V1beta/Gapic/LocalInventoryServiceGapicClient.php b/ShoppingMerchantInventories/src/V1beta/Gapic/LocalInventoryServiceGapicClient.php deleted file mode 100644 index 95edebf1042d..000000000000 --- a/ShoppingMerchantInventories/src/V1beta/Gapic/LocalInventoryServiceGapicClient.php +++ /dev/null @@ -1,477 +0,0 @@ -localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - * $localInventoryServiceClient->deleteLocalInventory($formattedName); - * } finally { - * $localInventoryServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class LocalInventoryServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.shopping.merchant.inventories.v1beta.LocalInventoryService'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'merchantapi.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = ['https://www.googleapis.com/auth/content']; - - private static $localInventoryNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/local_inventory_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/local_inventory_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/local_inventory_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/local_inventory_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocalInventoryNameTemplate() - { - if (self::$localInventoryNameTemplate == null) { - self::$localInventoryNameTemplate = new PathTemplate( - 'accounts/{account}/products/{product}/localInventories/{store_code}' - ); - } - - return self::$localInventoryNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'localInventory' => self::getLocalInventoryNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * local_inventory resource. - * - * @param string $account - * @param string $product - * @param string $storeCode - * - * @return string The formatted local_inventory resource. - * - * @experimental - */ - public static function localInventoryName($account, $product, $storeCode) - { - return self::getLocalInventoryNameTemplate()->render([ - 'account' => $account, - 'product' => $product, - 'store_code' => $storeCode, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - localInventory: accounts/{account}/products/{product}/localInventories/{store_code} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'merchantapi.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Deletes the specified `LocalInventory` from the given product in your - * merchant account. It might take a up to an hour for the - * `LocalInventory` to be deleted from the specific product. - * Once you have received a successful delete response, wait for that - * period before attempting a delete again. - * - * Sample code: - * ``` - * $localInventoryServiceClient = new LocalInventoryServiceClient(); - * try { - * $formattedName = $localInventoryServiceClient->localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - * $localInventoryServiceClient->deleteLocalInventory($formattedName); - * } finally { - * $localInventoryServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the local inventory for the given product to delete. - * Format: - * `accounts/{account}/products/{product}/localInventories/{store_code}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteLocalInventory($name, array $optionalArgs = []) - { - $request = new DeleteLocalInventoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteLocalInventory', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Inserts a `LocalInventory` resource to a product in your merchant - * account. - * - * Replaces the full `LocalInventory` resource if an entry with the same - * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code] - * already exists for the product. - * - * It might take up to 30 minutes for the new or updated `LocalInventory` - * resource to appear in products. - * - * Sample code: - * ``` - * $localInventoryServiceClient = new LocalInventoryServiceClient(); - * try { - * $parent = 'parent'; - * $localInventory = new LocalInventory(); - * $response = $localInventoryServiceClient->insertLocalInventory($parent, $localInventory); - * } finally { - * $localInventoryServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The account and product where this inventory will be inserted. - * Format: `accounts/{account}/products/{product}` - * @param LocalInventory $localInventory Required. Local inventory information of the product. If the product - * already has a `LocalInventory` resource for the same `storeCode`, full - * replacement of the `LocalInventory` resource is performed. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Shopping\Merchant\Inventories\V1beta\LocalInventory - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function insertLocalInventory( - $parent, - $localInventory, - array $optionalArgs = [] - ) { - $request = new InsertLocalInventoryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setLocalInventory($localInventory); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'InsertLocalInventory', - LocalInventory::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists the `LocalInventory` resources for the given product in your merchant - * account. The response might contain fewer items than specified by - * `pageSize`. If `pageToken` was returned in previous request, it can be used - * to obtain additional results. - * - * `LocalInventory` resources are listed per product for a given account. - * - * Sample code: - * ``` - * $localInventoryServiceClient = new LocalInventoryServiceClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $localInventoryServiceClient->listLocalInventories($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $localInventoryServiceClient->listLocalInventories($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $localInventoryServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The `name` of the parent product to list local inventories for. - * Format: - * `accounts/{account}/products/{product}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocalInventories($parent, array $optionalArgs = []) - { - $request = new ListLocalInventoriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocalInventories', - $optionalArgs, - ListLocalInventoriesResponse::class, - $request - ); - } -} diff --git a/ShoppingMerchantInventories/src/V1beta/Gapic/RegionalInventoryServiceGapicClient.php b/ShoppingMerchantInventories/src/V1beta/Gapic/RegionalInventoryServiceGapicClient.php deleted file mode 100644 index a84877920765..000000000000 --- a/ShoppingMerchantInventories/src/V1beta/Gapic/RegionalInventoryServiceGapicClient.php +++ /dev/null @@ -1,477 +0,0 @@ -regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - * $regionalInventoryServiceClient->deleteRegionalInventory($formattedName); - * } finally { - * $regionalInventoryServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class RegionalInventoryServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.shopping.merchant.inventories.v1beta.RegionalInventoryService'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'merchantapi.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = ['https://www.googleapis.com/auth/content']; - - private static $regionalInventoryNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/regional_inventory_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/regional_inventory_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/regional_inventory_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/regional_inventory_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getRegionalInventoryNameTemplate() - { - if (self::$regionalInventoryNameTemplate == null) { - self::$regionalInventoryNameTemplate = new PathTemplate( - 'accounts/{account}/products/{product}/regionalInventories/{region}' - ); - } - - return self::$regionalInventoryNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'regionalInventory' => self::getRegionalInventoryNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * regional_inventory resource. - * - * @param string $account - * @param string $product - * @param string $region - * - * @return string The formatted regional_inventory resource. - * - * @experimental - */ - public static function regionalInventoryName($account, $product, $region) - { - return self::getRegionalInventoryNameTemplate()->render([ - 'account' => $account, - 'product' => $product, - 'region' => $region, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - regionalInventory: accounts/{account}/products/{product}/regionalInventories/{region} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'merchantapi.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Deletes the specified `RegionalInventory` resource from the given product - * in your merchant account. It might take up to an hour for the - * `RegionalInventory` to be deleted from the specific product. - * Once you have received a successful delete response, wait for that - * period before attempting a delete again. - * - * Sample code: - * ``` - * $regionalInventoryServiceClient = new RegionalInventoryServiceClient(); - * try { - * $formattedName = $regionalInventoryServiceClient->regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - * $regionalInventoryServiceClient->deleteRegionalInventory($formattedName); - * } finally { - * $regionalInventoryServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the `RegionalInventory` resource to delete. - * Format: - * `accounts/{account}/products/{product}/regionalInventories/{region}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteRegionalInventory($name, array $optionalArgs = []) - { - $request = new DeleteRegionalInventoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteRegionalInventory', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Inserts a `RegionalInventory` to a given product in your - * merchant account. - * - * Replaces the full `RegionalInventory` resource if an entry with the same - * [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region] - * already exists for the product. - * - * It might take up to 30 minutes for the new or updated `RegionalInventory` - * resource to appear in products. - * - * Sample code: - * ``` - * $regionalInventoryServiceClient = new RegionalInventoryServiceClient(); - * try { - * $parent = 'parent'; - * $regionalInventory = new RegionalInventory(); - * $response = $regionalInventoryServiceClient->insertRegionalInventory($parent, $regionalInventory); - * } finally { - * $regionalInventoryServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The account and product where this inventory will be inserted. - * Format: `accounts/{account}/products/{product}` - * @param RegionalInventory $regionalInventory Required. Regional inventory information to add to the product. If the - * product already has a `RegionalInventory` resource for the same `region`, - * full replacement of the `RegionalInventory` resource is performed. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Shopping\Merchant\Inventories\V1beta\RegionalInventory - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function insertRegionalInventory( - $parent, - $regionalInventory, - array $optionalArgs = [] - ) { - $request = new InsertRegionalInventoryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRegionalInventory($regionalInventory); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'InsertRegionalInventory', - RegionalInventory::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists the `RegionalInventory` resources for the given product in your - * merchant account. The response might contain fewer items than specified by - * `pageSize`. If `pageToken` was returned in previous request, it can be - * used to obtain additional results. - * - * `RegionalInventory` resources are listed per product for a given account. - * - * Sample code: - * ``` - * $regionalInventoryServiceClient = new RegionalInventoryServiceClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $regionalInventoryServiceClient->listRegionalInventories($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $regionalInventoryServiceClient->listRegionalInventories($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $regionalInventoryServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The `name` of the parent product to list `RegionalInventory` - * resources for. Format: `accounts/{account}/products/{product}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listRegionalInventories($parent, array $optionalArgs = []) - { - $request = new ListRegionalInventoriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListRegionalInventories', - $optionalArgs, - ListRegionalInventoriesResponse::class, - $request - ); - } -} diff --git a/ShoppingMerchantInventories/src/V1beta/LocalInventory.php b/ShoppingMerchantInventories/src/V1beta/LocalInventory.php index 708bd5459701..4a9b982f84d8 100644 --- a/ShoppingMerchantInventories/src/V1beta/LocalInventory.php +++ b/ShoppingMerchantInventories/src/V1beta/LocalInventory.php @@ -13,7 +13,7 @@ * for a specific product at the store specified by * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code]. * For a list of all accepted attribute values, see the [local product inventory - * feed specification](https://support.google.com/merchants/answer/3061342). + * data specification](https://support.google.com/merchants/answer/3061342). * * Generated from protobuf message google.shopping.merchant.inventories.v1beta.LocalInventory */ @@ -37,7 +37,7 @@ class LocalInventory extends \Google\Protobuf\Internal\Message /** * Required. Immutable. Store code (the store ID from your Business Profile) * of the physical store the product is sold in. See the [Local product - * inventory feed + * inventory data * specification](https://support.google.com/merchants/answer/3061342) for * more information. * @@ -67,7 +67,7 @@ class LocalInventory extends \Google\Protobuf\Internal\Message protected $sale_price_effective_date = null; /** * Availability of the product at this store. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string availability = 7; @@ -84,7 +84,7 @@ class LocalInventory extends \Google\Protobuf\Internal\Message * Supported pickup method for this product. Unless the value is `"not * supported"`, this field must be submitted together with * `pickupSla`. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string pickup_method = 9; @@ -94,7 +94,7 @@ class LocalInventory extends \Google\Protobuf\Internal\Message * Relative time period from the order date for an order for this product, * from this store, to be ready for pickup. Must be submitted with * `pickupMethod`. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string pickup_sla = 10; @@ -108,7 +108,7 @@ class LocalInventory extends \Google\Protobuf\Internal\Message protected $instore_product_location = null; /** * A list of custom (merchant-provided) attributes. You can also use - * `CustomAttribute` to submit any attribute of the feed specification in its + * `CustomAttribute` to submit any attribute of the data specification in its * generic form. * * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 12; @@ -131,7 +131,7 @@ class LocalInventory extends \Google\Protobuf\Internal\Message * @type string $store_code * Required. Immutable. Store code (the store ID from your Business Profile) * of the physical store the product is sold in. See the [Local product - * inventory feed + * inventory data * specification](https://support.google.com/merchants/answer/3061342) for * more information. * @type \Google\Shopping\Type\Price $price @@ -145,7 +145,7 @@ class LocalInventory extends \Google\Protobuf\Internal\Message * sale at this store. * @type string $availability * Availability of the product at this store. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * @type int|string $quantity * Quantity of the product available at this store. Must be greater than or @@ -154,19 +154,19 @@ class LocalInventory extends \Google\Protobuf\Internal\Message * Supported pickup method for this product. Unless the value is `"not * supported"`, this field must be submitted together with * `pickupSla`. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * @type string $pickup_sla * Relative time period from the order date for an order for this product, * from this store, to be ready for pickup. Must be submitted with * `pickupMethod`. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * @type string $instore_product_location * Location of the product inside the store. Maximum length is 20 bytes. * @type array<\Google\Shopping\Type\CustomAttribute>|\Google\Protobuf\Internal\RepeatedField $custom_attributes * A list of custom (merchant-provided) attributes. You can also use - * `CustomAttribute` to submit any attribute of the feed specification in its + * `CustomAttribute` to submit any attribute of the data specification in its * generic form. * } */ @@ -236,7 +236,7 @@ public function setAccount($var) /** * Required. Immutable. Store code (the store ID from your Business Profile) * of the physical store the product is sold in. See the [Local product - * inventory feed + * inventory data * specification](https://support.google.com/merchants/answer/3061342) for * more information. * @@ -251,7 +251,7 @@ public function getStoreCode() /** * Required. Immutable. Store code (the store ID from your Business Profile) * of the physical store the product is sold in. See the [Local product - * inventory feed + * inventory data * specification](https://support.google.com/merchants/answer/3061342) for * more information. * @@ -383,7 +383,7 @@ public function setSalePriceEffectiveDate($var) /** * Availability of the product at this store. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string availability = 7; @@ -406,7 +406,7 @@ public function clearAvailability() /** * Availability of the product at this store. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string availability = 7; @@ -463,7 +463,7 @@ public function setQuantity($var) * Supported pickup method for this product. Unless the value is `"not * supported"`, this field must be submitted together with * `pickupSla`. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string pickup_method = 9; @@ -488,7 +488,7 @@ public function clearPickupMethod() * Supported pickup method for this product. Unless the value is `"not * supported"`, this field must be submitted together with * `pickupSla`. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string pickup_method = 9; @@ -507,7 +507,7 @@ public function setPickupMethod($var) * Relative time period from the order date for an order for this product, * from this store, to be ready for pickup. Must be submitted with * `pickupMethod`. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string pickup_sla = 10; @@ -532,7 +532,7 @@ public function clearPickupSla() * Relative time period from the order date for an order for this product, * from this store, to be ready for pickup. Must be submitted with * `pickupMethod`. - * For accepted attribute values, see the [local product inventory feed + * For accepted attribute values, see the [local product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string pickup_sla = 10; @@ -585,7 +585,7 @@ public function setInstoreProductLocation($var) /** * A list of custom (merchant-provided) attributes. You can also use - * `CustomAttribute` to submit any attribute of the feed specification in its + * `CustomAttribute` to submit any attribute of the data specification in its * generic form. * * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 12; @@ -598,7 +598,7 @@ public function getCustomAttributes() /** * A list of custom (merchant-provided) attributes. You can also use - * `CustomAttribute` to submit any attribute of the feed specification in its + * `CustomAttribute` to submit any attribute of the data specification in its * generic form. * * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 12; diff --git a/ShoppingMerchantInventories/src/V1beta/LocalInventoryServiceClient.php b/ShoppingMerchantInventories/src/V1beta/LocalInventoryServiceClient.php deleted file mode 100644 index 760fd1ae56a3..000000000000 --- a/ShoppingMerchantInventories/src/V1beta/LocalInventoryServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ -google.shopping.merchant.inventories.v1beta.RegionalInventory @@ -67,7 +67,7 @@ class RegionalInventory extends \Google\Protobuf\Internal\Message protected $sale_price_effective_date = null; /** * Availability of the product in this region. - * For accepted attribute values, see the [regional product inventory feed + * For accepted attribute values, see the [regional product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string availability = 7; @@ -75,7 +75,7 @@ class RegionalInventory extends \Google\Protobuf\Internal\Message protected $availability = null; /** * A list of custom (merchant-provided) attributes. You can also use - * `CustomAttribute` to submit any attribute of the feed specification in its + * `CustomAttribute` to submit any attribute of the data specification in its * generic form. * * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 8; @@ -111,11 +111,11 @@ class RegionalInventory extends \Google\Protobuf\Internal\Message * sale price in this region. * @type string $availability * Availability of the product in this region. - * For accepted attribute values, see the [regional product inventory feed + * For accepted attribute values, see the [regional product inventory data * specification](https://support.google.com/merchants/answer/3061342) * @type array<\Google\Shopping\Type\CustomAttribute>|\Google\Protobuf\Internal\RepeatedField $custom_attributes * A list of custom (merchant-provided) attributes. You can also use - * `CustomAttribute` to submit any attribute of the feed specification in its + * `CustomAttribute` to submit any attribute of the data specification in its * generic form. * } */ @@ -330,7 +330,7 @@ public function setSalePriceEffectiveDate($var) /** * Availability of the product in this region. - * For accepted attribute values, see the [regional product inventory feed + * For accepted attribute values, see the [regional product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string availability = 7; @@ -353,7 +353,7 @@ public function clearAvailability() /** * Availability of the product in this region. - * For accepted attribute values, see the [regional product inventory feed + * For accepted attribute values, see the [regional product inventory data * specification](https://support.google.com/merchants/answer/3061342) * * Generated from protobuf field optional string availability = 7; @@ -370,7 +370,7 @@ public function setAvailability($var) /** * A list of custom (merchant-provided) attributes. You can also use - * `CustomAttribute` to submit any attribute of the feed specification in its + * `CustomAttribute` to submit any attribute of the data specification in its * generic form. * * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 8; @@ -383,7 +383,7 @@ public function getCustomAttributes() /** * A list of custom (merchant-provided) attributes. You can also use - * `CustomAttribute` to submit any attribute of the feed specification in its + * `CustomAttribute` to submit any attribute of the data specification in its * generic form. * * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 8; diff --git a/ShoppingMerchantInventories/src/V1beta/RegionalInventoryServiceClient.php b/ShoppingMerchantInventories/src/V1beta/RegionalInventoryServiceClient.php deleted file mode 100644 index c527c43a194c..000000000000 --- a/ShoppingMerchantInventories/src/V1beta/RegionalInventoryServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return LocalInventoryServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new LocalInventoryServiceClient($options); - } - - /** @test */ - public function deleteLocalInventoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - $gapicClient->deleteLocalInventory($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.LocalInventoryService/DeleteLocalInventory', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteLocalInventoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - try { - $gapicClient->deleteLocalInventory($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function insertLocalInventoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $account = 1177318867; - $storeCode = 'storeCode921424523'; - $availability = 'availability1997542747'; - $quantity = 1285004149; - $pickupMethod = 'pickupMethod-950845436'; - $pickupSla = 'pickupSla-964667163'; - $instoreProductLocation = 'instoreProductLocation-243942392'; - $expectedResponse = new LocalInventory(); - $expectedResponse->setName($name); - $expectedResponse->setAccount($account); - $expectedResponse->setStoreCode($storeCode); - $expectedResponse->setAvailability($availability); - $expectedResponse->setQuantity($quantity); - $expectedResponse->setPickupMethod($pickupMethod); - $expectedResponse->setPickupSla($pickupSla); - $expectedResponse->setInstoreProductLocation($instoreProductLocation); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $localInventory = new LocalInventory(); - $localInventoryStoreCode = 'localInventoryStoreCode1126909757'; - $localInventory->setStoreCode($localInventoryStoreCode); - $response = $gapicClient->insertLocalInventory($parent, $localInventory); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.LocalInventoryService/InsertLocalInventory', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getLocalInventory(); - $this->assertProtobufEquals($localInventory, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function insertLocalInventoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $localInventory = new LocalInventory(); - $localInventoryStoreCode = 'localInventoryStoreCode1126909757'; - $localInventory->setStoreCode($localInventoryStoreCode); - try { - $gapicClient->insertLocalInventory($parent, $localInventory); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocalInventoriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $localInventoriesElement = new LocalInventory(); - $localInventories = [ - $localInventoriesElement, - ]; - $expectedResponse = new ListLocalInventoriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocalInventories($localInventories); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listLocalInventories($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocalInventories()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.LocalInventoryService/ListLocalInventories', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocalInventoriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - try { - $gapicClient->listLocalInventories($parent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/ShoppingMerchantInventories/tests/Unit/V1beta/RegionalInventoryServiceClientTest.php b/ShoppingMerchantInventories/tests/Unit/V1beta/RegionalInventoryServiceClientTest.php deleted file mode 100644 index 8f1abd6b6218..000000000000 --- a/ShoppingMerchantInventories/tests/Unit/V1beta/RegionalInventoryServiceClientTest.php +++ /dev/null @@ -1,262 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RegionalInventoryServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RegionalInventoryServiceClient($options); - } - - /** @test */ - public function deleteRegionalInventoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - $gapicClient->deleteRegionalInventory($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/DeleteRegionalInventory', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteRegionalInventoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - try { - $gapicClient->deleteRegionalInventory($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function insertRegionalInventoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $account = 1177318867; - $region = 'region-934795532'; - $availability = 'availability1997542747'; - $expectedResponse = new RegionalInventory(); - $expectedResponse->setName($name); - $expectedResponse->setAccount($account); - $expectedResponse->setRegion($region); - $expectedResponse->setAvailability($availability); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $regionalInventory = new RegionalInventory(); - $regionalInventoryRegion = 'regionalInventoryRegion-40810671'; - $regionalInventory->setRegion($regionalInventoryRegion); - $response = $gapicClient->insertRegionalInventory($parent, $regionalInventory); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/InsertRegionalInventory', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getRegionalInventory(); - $this->assertProtobufEquals($regionalInventory, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function insertRegionalInventoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $regionalInventory = new RegionalInventory(); - $regionalInventoryRegion = 'regionalInventoryRegion-40810671'; - $regionalInventory->setRegion($regionalInventoryRegion); - try { - $gapicClient->insertRegionalInventory($parent, $regionalInventory); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRegionalInventoriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $regionalInventoriesElement = new RegionalInventory(); - $regionalInventories = [ - $regionalInventoriesElement, - ]; - $expectedResponse = new ListRegionalInventoriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRegionalInventories($regionalInventories); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listRegionalInventories($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRegionalInventories()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/ListRegionalInventories', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRegionalInventoriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - try { - $gapicClient->listRegionalInventories($parent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/ShoppingMerchantLfp/.OwlBot.yaml b/ShoppingMerchantLfp/.OwlBot.yaml new file mode 100644 index 000000000000..880fecf9979c --- /dev/null +++ b/ShoppingMerchantLfp/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/shopping/merchant/lfp/(v1beta)/.*-php/(.*) + dest: /owl-bot-staging/ShoppingMerchantLfp/$1/$2 +api-name: ShoppingMerchantLfp diff --git a/ShoppingMerchantLfp/.gitattributes b/ShoppingMerchantLfp/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/ShoppingMerchantLfp/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/ShoppingMerchantLfp/.github/pull_request_template.md b/ShoppingMerchantLfp/.github/pull_request_template.md new file mode 100644 index 000000000000..a57edc6f00c5 --- /dev/null +++ b/ShoppingMerchantLfp/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `ShoppingMerchantLfp/src`, and tests in `ShoppingMerchantLfp/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/ShoppingMerchantLfp/CONTRIBUTING.md b/ShoppingMerchantLfp/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/ShoppingMerchantLfp/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/ShoppingMerchantLfp/LICENSE b/ShoppingMerchantLfp/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/ShoppingMerchantLfp/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/ShoppingMerchantLfp/README.md b/ShoppingMerchantLfp/README.md new file mode 100644 index 000000000000..48e6065a8ddd --- /dev/null +++ b/ShoppingMerchantLfp/README.md @@ -0,0 +1,45 @@ +# Google Shopping Merchant Lfp for PHP + +> Idiomatic PHP client for [Google Shopping Merchant Lfp](https://developers.google.com/merchant/api). + +[![Latest Stable Version](https://poser.pugx.org/google/shopping-merchant-lfp/v/stable)](https://packagist.org/packages/google/shopping-merchant-lfp) [![Packagist](https://img.shields.io/packagist/dm/google/shopping-merchant-lfp.svg)](https://packagist.org/packages/google/shopping-merchant-lfp) + +* [API documentation](https://cloud.google.com/php/docs/reference/shopping-merchant-lfp/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/shopping-merchant-lfp +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-shopping-merchant-lfp/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/merchant/api). diff --git a/ShoppingMerchantLfp/VERSION b/ShoppingMerchantLfp/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/ShoppingMerchantLfp/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/ShoppingMerchantLfp/composer.json b/ShoppingMerchantLfp/composer.json new file mode 100644 index 000000000000..acd1bab41129 --- /dev/null +++ b/ShoppingMerchantLfp/composer.json @@ -0,0 +1,31 @@ +{ + "name": "google/shopping-merchant-lfp", + "description": "Google Shopping Merchant Lfp Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Shopping\\Merchant\\Lfp\\": "src", + "GPBMetadata\\Google\\Shopping\\Merchant\\Lfp\\": "metadata" + } + }, + "extra": { + "component": { + "id": "shopping-merchant-lfp", + "path": "ShoppingMerchantLfp", + "target": "googleapis/php-shopping-merchant-lfp" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0", + "google/shopping-common-protos": "^0.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/ShoppingMerchantLfp/metadata/V1Beta/Lfpinventory.php b/ShoppingMerchantLfp/metadata/V1Beta/Lfpinventory.php new file mode 100644 index 0000000000000000000000000000000000000000..4f599a0f37f800bf0c355b91c13e62117a09bca3 GIT binary patch literal 2529 zcmbVOO>f*p7{;5ACbLN>22p1V>NKsCqyk$B0#zH*$R^}NYDm;ZJs?Zgtao;Igfla> z$B9C;95``Bh(ExUI|qIM2aX`_IdJMv;KV!r+D(?Aqj6-oGSwv$S5#HV%^0wGS0Xd+2S@%DkY2U=~Sh`*hA z^Pd;q{Jp}P|Fk3h7b_m?*8ldP~mWWXRrj^yuxNf-)7J!uQv$hgWS$82goi5$cCx0^8sqy zDV!6@oG@!pK1PjuLxPU(LeMJOP$ea>>|v<2%DJ9W)_h7E)^p1ohRs_T{GNqU{5%qLVhvc{D?g35!UJMNFMq z)1||j*+5e-Q`i9YGJ@r-Ok>B;aUP>LVRMaWw$%h0Z>yd~Y?KkpX4nWQ{BQ${p)YTEUC2o(xRM6B6?bgYneC~X5MEgD&K1L-(On?D+_-0uzKFP7W` zo)rnfTVlg0;9O|)PSMB2IV;}!dXq1Cz$gfcj+ZX`-<%EF3?Er*`;X=>nyt~m1=!p{bp-{lF7)o>Bd=*txL4|4-eN)iKO z3eq}2%75Ht^ZID)p;^cpj+)|#%h+9CT`7C|f1_;=r<4uE>Mu3)_VDU+8Xp7k%)bm| zj+S9QxmK7_!=nDi&C^_X`t6^8|4`dn_;~n`Kg&^Euc-0pGACe**G*_%M60p=yW1#P zGD^HZTz|2rluVkAb8>QWnU*9~J*OCX?^n%XAnSDy@!lH7I6G7hj4wCBNTlu3Uh}>y zuDIJks)Or|Y^?zWWb2jt7%f~~jN|6}pJ`SoRRh$T%x3?i#p-PNAioI=T^z2wG-R6j K;oe7mg#HDc;!U#v literal 0 HcmV?d00001 diff --git a/ShoppingMerchantLfp/metadata/V1Beta/Lfpsale.php b/ShoppingMerchantLfp/metadata/V1Beta/Lfpsale.php new file mode 100644 index 0000000000000000000000000000000000000000..2d84b6512b1327e85277e87e07771550ae2f1e0e GIT binary patch literal 2254 zcmbVOL2nyH6vlSyIODbgQ`E(wVsI1Ia(i6Mf5Tu5w$aPgg7~*i6jBV+k2xYU@#$yc-t9}w{L*F zCkDv-GL+s|>m#t+Kq!bvl3>`dEEDEPU<5}$FV7>U>m$ZQjbBuXgw zp0^EC9w;U_)(*Qop#8fz$JDlWqyQ#1aS_^{CI^V|cDSN3Cy}>BlOSeNiFgl8U3W@V zNvYoH-!<22I2Pi59;54?3vv^yIHhNA$2g`cjrm3vw+5J(EAL;38%pL4ITxA*!4uc5 za;hK}IX;XS2cg!@9~*a8yCGF*r9M6cFj? zuOzqV{nbFr(9rwP(48A-Nlyo>hHL$mQS;TX@oL!WtfK3R#L!$m2?CLFW!2%lF@nQ- z=O#i4G$8c@F`-r?bIcCjLoK0)n9nBGQnhWNc1)+xBDuqr>f{!BI}jiuSAInJG$m7N zHLK%y(9%>fZY@_^4!R;^7Er4Nd+ouhofB1wr1P}*v`HQ;#PmFc>B!WHwE{jShXGpA z^UT-eSt!Hm7FY$dc3HwX)GgFVA+vTCO&gf{2L*f8{+LXe(eJaJCVYOcq*77Mm?(DQq(Vq>su zR--0b@*%p>HPrU2FnSW**x?C{m4SaopQq54op(`Fk{F0L!e{zDL>k!FcVv3E2loq3 z{;LUWgPpN7__2n^{?ZvR2N<`}qTS=Dl3_ OR%Vv@n>I&tg#H10h2v5H literal 0 HcmV?d00001 diff --git a/ShoppingMerchantLfp/metadata/V1Beta/Lfpstore.php b/ShoppingMerchantLfp/metadata/V1Beta/Lfpstore.php new file mode 100644 index 0000000000000000000000000000000000000000..b4e6b9d34e360002f7279740a9ee0a13e460fb31 GIT binary patch literal 3379 zcmb_f%~K;)5Z@ty&@8Yu%SQ~W`wUnFb~kbHpc}+>vV@Q-zKY-;tW=GY$xAZjFf-1) zfGiacp1gas$}0Z?{|8T&NB72wgXLlW1W)#RGm}gpP>ITgSJNM_``5qj*ZJhR({Nys z6sSdAjnOKpoDtTb#BptA>$XWM&03ARM7NI}!=!GSkj;Ivw|_+Po5iE|(A2Y=u1>S0 zZrgQ}X1s>&IEGcv98*_sXco(uH79fOv_hH2j~=sKnilQ>EbW+jj;2#mILPgyMpa{4 zxgb21OM$2IZs4iBQ*+8MpXN|+9Y8lV&m;Irc!YBx_~$e$rlAv$X$=1@8J=ob1~W9% zc!jxbkeX(C6pgRz)|!^i4BH~yVBgYdYK8bdx$cr8{~mb_b}M&DJSvgUY|8R)TA}JEKNYevH}dwIDYLbDK1JJ0UJ*P1jl%adQW)_Nm+h zImI!`ie=dx1>5qn*-lO!7dIKcFb!(4!ECk+YF2Z!p`94EJDBMq4G7eCkZtTS^Zc>H z&U#-cO7`SaBPftkt+wm2g-lMh5#)F-!{vQg8=S)OqHmK9X`c>hpGK~yecC7H1IL%&i9fezYBMrhHX*RY93dp8z1e+B`$vlCQfO^GZnj#?;zpX&=H{ioB)Y6f1lvh9BD;?xt6t{}`&3kub0uOp>2_w{ysYx0AA2a@0f|(t|Yv=2QDE_B}ZyhglFz#q|s(Sb=i|I1rckw)c_|ELF zsMVP(QqqIjDZ z7YQaJgp)t&tB4Vc0Nli2)lYtWp@<>=-RnPp71s=UEx}Yb zq2+8}L3bPd%eY@&DEIuXdEBm($YCS-L01mGQY4GWxWUzcH)OWcLh?_TRd*-!nN_z@ znAKc}Ncftj#b$8@_SFGk|5bv?F3QT!!aHu;71CWcVR-!&?24)1A<68863nfh+_??+ zMB#TO5svulkHsHKdAY%u<7G3M)6>%+z4lY0HCZF0+qi#OEO!p&Wqe=yfgm>-Hl5h? z4x}%h>!#hThPM2fs@pgG(7@X}zcrl7I+D(*R7OQvKU{9_e2@JdJF=4BxQ+`=e{F6- G3*a9-!EH7G literal 0 HcmV?d00001 diff --git a/ShoppingMerchantLfp/owlbot.py b/ShoppingMerchantLfp/owlbot.py new file mode 100644 index 000000000000..f4d8bce3479d --- /dev/null +++ b/ShoppingMerchantLfp/owlbot.py @@ -0,0 +1,62 @@ +# Copyright 2023 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/ShoppingMerchantLfp").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main( + src=src, + dest=dest, + copy_excludes=[ + src / "**/[A-Z]*_*.php", + ] +) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/ShoppingMerchantLfp/phpunit.xml.dist b/ShoppingMerchantLfp/phpunit.xml.dist new file mode 100644 index 000000000000..119b44975c4c --- /dev/null +++ b/ShoppingMerchantLfp/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/ShoppingMerchantLfp/samples/V1beta/LfpInventoryServiceClient/insert_lfp_inventory.php b/ShoppingMerchantLfp/samples/V1beta/LfpInventoryServiceClient/insert_lfp_inventory.php new file mode 100644 index 000000000000..d5e65fbb3523 --- /dev/null +++ b/ShoppingMerchantLfp/samples/V1beta/LfpInventoryServiceClient/insert_lfp_inventory.php @@ -0,0 +1,121 @@ +setTargetAccount($lfpInventoryTargetAccount) + ->setStoreCode($lfpInventoryStoreCode) + ->setOfferId($lfpInventoryOfferId) + ->setRegionCode($lfpInventoryRegionCode) + ->setContentLanguage($lfpInventoryContentLanguage) + ->setAvailability($lfpInventoryAvailability); + $request = (new InsertLfpInventoryRequest()) + ->setParent($formattedParent) + ->setLfpInventory($lfpInventory); + + // Call the API and handle any network failures. + try { + /** @var LfpInventory $response */ + $response = $lfpInventoryServiceClient->insertLfpInventory($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 +{ + $formattedParent = LfpInventoryServiceClient::accountName('[ACCOUNT]'); + $lfpInventoryTargetAccount = 0; + $lfpInventoryStoreCode = '[STORE_CODE]'; + $lfpInventoryOfferId = '[OFFER_ID]'; + $lfpInventoryRegionCode = '[REGION_CODE]'; + $lfpInventoryContentLanguage = '[CONTENT_LANGUAGE]'; + $lfpInventoryAvailability = '[AVAILABILITY]'; + + insert_lfp_inventory_sample( + $formattedParent, + $lfpInventoryTargetAccount, + $lfpInventoryStoreCode, + $lfpInventoryOfferId, + $lfpInventoryRegionCode, + $lfpInventoryContentLanguage, + $lfpInventoryAvailability + ); +} +// [END merchantapi_v1beta_generated_LfpInventoryService_InsertLfpInventory_sync] diff --git a/ShoppingMerchantLfp/samples/V1beta/LfpSaleServiceClient/insert_lfp_sale.php b/ShoppingMerchantLfp/samples/V1beta/LfpSaleServiceClient/insert_lfp_sale.php new file mode 100644 index 000000000000..0b5bd5a1c094 --- /dev/null +++ b/ShoppingMerchantLfp/samples/V1beta/LfpSaleServiceClient/insert_lfp_sale.php @@ -0,0 +1,126 @@ +setTargetAccount($lfpSaleTargetAccount) + ->setStoreCode($lfpSaleStoreCode) + ->setOfferId($lfpSaleOfferId) + ->setRegionCode($lfpSaleRegionCode) + ->setContentLanguage($lfpSaleContentLanguage) + ->setGtin($lfpSaleGtin) + ->setPrice($lfpSalePrice) + ->setQuantity($lfpSaleQuantity) + ->setSaleTime($lfpSaleSaleTime); + $request = (new InsertLfpSaleRequest()) + ->setParent($parent) + ->setLfpSale($lfpSale); + + // Call the API and handle any network failures. + try { + /** @var LfpSale $response */ + $response = $lfpSaleServiceClient->insertLfpSale($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 +{ + $parent = '[PARENT]'; + $lfpSaleTargetAccount = 0; + $lfpSaleStoreCode = '[STORE_CODE]'; + $lfpSaleOfferId = '[OFFER_ID]'; + $lfpSaleRegionCode = '[REGION_CODE]'; + $lfpSaleContentLanguage = '[CONTENT_LANGUAGE]'; + $lfpSaleGtin = '[GTIN]'; + $lfpSaleQuantity = 0; + + insert_lfp_sale_sample( + $parent, + $lfpSaleTargetAccount, + $lfpSaleStoreCode, + $lfpSaleOfferId, + $lfpSaleRegionCode, + $lfpSaleContentLanguage, + $lfpSaleGtin, + $lfpSaleQuantity + ); +} +// [END merchantapi_v1beta_generated_LfpSaleService_InsertLfpSale_sync] diff --git a/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/delete_lfp_store.php b/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/delete_lfp_store.php new file mode 100644 index 000000000000..c9c5caa5ddc0 --- /dev/null +++ b/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/delete_lfp_store.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $lfpStoreServiceClient->deleteLfpStore($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = LfpStoreServiceClient::lfpStoreName( + '[ACCOUNT]', + '[TARGET_MERCHANT]', + '[STORE_CODE]' + ); + + delete_lfp_store_sample($formattedName); +} +// [END merchantapi_v1beta_generated_LfpStoreService_DeleteLfpStore_sync] diff --git a/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/get_lfp_store.php b/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/get_lfp_store.php new file mode 100644 index 000000000000..1ba263d37a19 --- /dev/null +++ b/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/get_lfp_store.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var LfpStore $response */ + $response = $lfpStoreServiceClient->getLfpStore($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 = LfpStoreServiceClient::lfpStoreName( + '[ACCOUNT]', + '[TARGET_MERCHANT]', + '[STORE_CODE]' + ); + + get_lfp_store_sample($formattedName); +} +// [END merchantapi_v1beta_generated_LfpStoreService_GetLfpStore_sync] diff --git a/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/insert_lfp_store.php b/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/insert_lfp_store.php new file mode 100644 index 000000000000..f46222484b5d --- /dev/null +++ b/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/insert_lfp_store.php @@ -0,0 +1,95 @@ +setTargetAccount($lfpStoreTargetAccount) + ->setStoreCode($lfpStoreStoreCode) + ->setStoreAddress($lfpStoreStoreAddress); + $request = (new InsertLfpStoreRequest()) + ->setParent($formattedParent) + ->setLfpStore($lfpStore); + + // Call the API and handle any network failures. + try { + /** @var LfpStore $response */ + $response = $lfpStoreServiceClient->insertLfpStore($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 +{ + $formattedParent = LfpStoreServiceClient::accountName('[ACCOUNT]'); + $lfpStoreTargetAccount = 0; + $lfpStoreStoreCode = '[STORE_CODE]'; + $lfpStoreStoreAddress = '[STORE_ADDRESS]'; + + insert_lfp_store_sample( + $formattedParent, + $lfpStoreTargetAccount, + $lfpStoreStoreCode, + $lfpStoreStoreAddress + ); +} +// [END merchantapi_v1beta_generated_LfpStoreService_InsertLfpStore_sync] diff --git a/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/list_lfp_stores.php b/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/list_lfp_stores.php new file mode 100644 index 000000000000..cb381618bea6 --- /dev/null +++ b/ShoppingMerchantLfp/samples/V1beta/LfpStoreServiceClient/list_lfp_stores.php @@ -0,0 +1,81 @@ +setParent($formattedParent) + ->setTargetAccount($targetAccount); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $lfpStoreServiceClient->listLfpStores($request); + + /** @var LfpStore $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = LfpStoreServiceClient::accountName('[ACCOUNT]'); + $targetAccount = 0; + + list_lfp_stores_sample($formattedParent, $targetAccount); +} +// [END merchantapi_v1beta_generated_LfpStoreService_ListLfpStores_sync] diff --git a/ShoppingMerchantLfp/src/V1beta/Client/LfpInventoryServiceClient.php b/ShoppingMerchantLfp/src/V1beta/Client/LfpInventoryServiceClient.php new file mode 100644 index 000000000000..e3b20b17deb7 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/Client/LfpInventoryServiceClient.php @@ -0,0 +1,278 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/lfp_inventory_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/lfp_inventory_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/lfp_inventory_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/lfp_inventory_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * lfp_inventory resource. + * + * @param string $account + * @param string $targetMerchant + * @param string $storeCode + * @param string $offer + * + * @return string The formatted lfp_inventory resource. + * + * @experimental + */ + public static function lfpInventoryName( + string $account, + string $targetMerchant, + string $storeCode, + string $offer + ): string { + return self::getPathTemplate('lfpInventory')->render([ + 'account' => $account, + 'target_merchant' => $targetMerchant, + 'store_code' => $storeCode, + 'offer' => $offer, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - lfpInventory: accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Inserts a `LfpInventory` resource for the given target merchant account. If + * the resource already exists, it will be replaced. The inventory + * automatically expires after 30 days. + * + * The async variant is {@see LfpInventoryServiceClient::insertLfpInventoryAsync()} + * . + * + * @example samples/V1beta/LfpInventoryServiceClient/insert_lfp_inventory.php + * + * @param InsertLfpInventoryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return LfpInventory + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function insertLfpInventory(InsertLfpInventoryRequest $request, array $callOptions = []): LfpInventory + { + return $this->startApiCall('InsertLfpInventory', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantLfp/src/V1beta/Client/LfpSaleServiceClient.php b/ShoppingMerchantLfp/src/V1beta/Client/LfpSaleServiceClient.php new file mode 100644 index 000000000000..b8f6ae64e486 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/Client/LfpSaleServiceClient.php @@ -0,0 +1,249 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/lfp_sale_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/lfp_sale_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/lfp_sale_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/lfp_sale_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a lfp_sale + * resource. + * + * @param string $account + * @param string $sale + * + * @return string The formatted lfp_sale resource. + * + * @experimental + */ + public static function lfpSaleName(string $account, string $sale): string + { + return self::getPathTemplate('lfpSale')->render([ + 'account' => $account, + 'sale' => $sale, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - lfpSale: accounts/{account}/lfpSales/{sale} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Inserts a `LfpSale` for the given merchant. + * + * The async variant is {@see LfpSaleServiceClient::insertLfpSaleAsync()} . + * + * @example samples/V1beta/LfpSaleServiceClient/insert_lfp_sale.php + * + * @param InsertLfpSaleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return LfpSale + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function insertLfpSale(InsertLfpSaleRequest $request, array $callOptions = []): LfpSale + { + return $this->startApiCall('InsertLfpSale', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantLfp/src/V1beta/Client/LfpStoreServiceClient.php b/ShoppingMerchantLfp/src/V1beta/Client/LfpStoreServiceClient.php new file mode 100644 index 000000000000..55b891b12662 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/Client/LfpStoreServiceClient.php @@ -0,0 +1,360 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/lfp_store_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/lfp_store_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/lfp_store_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/lfp_store_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a lfp_store + * resource. + * + * @param string $account + * @param string $targetMerchant + * @param string $storeCode + * + * @return string The formatted lfp_store resource. + * + * @experimental + */ + public static function lfpStoreName(string $account, string $targetMerchant, string $storeCode): string + { + return self::getPathTemplate('lfpStore')->render([ + 'account' => $account, + 'target_merchant' => $targetMerchant, + 'store_code' => $storeCode, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - lfpStore: accounts/{account}/lfpStores/{target_merchant}~{store_code} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes a store for a target merchant. + * + * The async variant is {@see LfpStoreServiceClient::deleteLfpStoreAsync()} . + * + * @example samples/V1beta/LfpStoreServiceClient/delete_lfp_store.php + * + * @param DeleteLfpStoreRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteLfpStore(DeleteLfpStoreRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteLfpStore', $request, $callOptions)->wait(); + } + + /** + * Retrieves information about a store. + * + * The async variant is {@see LfpStoreServiceClient::getLfpStoreAsync()} . + * + * @example samples/V1beta/LfpStoreServiceClient/get_lfp_store.php + * + * @param GetLfpStoreRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return LfpStore + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getLfpStore(GetLfpStoreRequest $request, array $callOptions = []): LfpStore + { + return $this->startApiCall('GetLfpStore', $request, $callOptions)->wait(); + } + + /** + * Inserts a store for the target merchant. If the store with the same store + * code already exists, it will be replaced. + * + * The async variant is {@see LfpStoreServiceClient::insertLfpStoreAsync()} . + * + * @example samples/V1beta/LfpStoreServiceClient/insert_lfp_store.php + * + * @param InsertLfpStoreRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return LfpStore + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function insertLfpStore(InsertLfpStoreRequest $request, array $callOptions = []): LfpStore + { + return $this->startApiCall('InsertLfpStore', $request, $callOptions)->wait(); + } + + /** + * Lists the stores of the target merchant, specified by the filter in + * `ListLfpStoresRequest`. + * + * The async variant is {@see LfpStoreServiceClient::listLfpStoresAsync()} . + * + * @example samples/V1beta/LfpStoreServiceClient/list_lfp_stores.php + * + * @param ListLfpStoresRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listLfpStores(ListLfpStoresRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLfpStores', $request, $callOptions); + } +} diff --git a/ShoppingMerchantLfp/src/V1beta/DeleteLfpStoreRequest.php b/ShoppingMerchantLfp/src/V1beta/DeleteLfpStoreRequest.php new file mode 100644 index 000000000000..645ef9361185 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/DeleteLfpStoreRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.lfp.v1beta.DeleteLfpStoreRequest + */ +class DeleteLfpStoreRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the store to delete for the target merchant account. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the store to delete for the target merchant account. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * Please see {@see LfpStoreServiceClient::lfpStoreName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Lfp\V1beta\DeleteLfpStoreRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the store to delete for the target merchant account. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the store to delete for the target merchant account. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the store to delete for the target merchant account. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/GetLfpStoreRequest.php b/ShoppingMerchantLfp/src/V1beta/GetLfpStoreRequest.php new file mode 100644 index 000000000000..2246d59e626b --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/GetLfpStoreRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.lfp.v1beta.GetLfpStoreRequest + */ +class GetLfpStoreRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the store to retrieve. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the store to retrieve. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * Please see {@see LfpStoreServiceClient::lfpStoreName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Lfp\V1beta\GetLfpStoreRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the store to retrieve. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the store to retrieve. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the store to retrieve. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/InsertLfpInventoryRequest.php b/ShoppingMerchantLfp/src/V1beta/InsertLfpInventoryRequest.php new file mode 100644 index 000000000000..2587b2753c55 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/InsertLfpInventoryRequest.php @@ -0,0 +1,115 @@ +google.shopping.merchant.lfp.v1beta.InsertLfpInventoryRequest + */ +class InsertLfpInventoryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The LFP provider account. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The inventory to insert. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpInventory lfp_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lfp_inventory = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The LFP provider account. + * Format: `accounts/{account}` + * @type \Google\Shopping\Merchant\Lfp\V1beta\LfpInventory $lfp_inventory + * Required. The inventory to insert. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpinventory::initOnce(); + parent::__construct($data); + } + + /** + * Required. The LFP provider account. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The LFP provider account. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The inventory to insert. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpInventory lfp_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Lfp\V1beta\LfpInventory|null + */ + public function getLfpInventory() + { + return $this->lfp_inventory; + } + + public function hasLfpInventory() + { + return isset($this->lfp_inventory); + } + + public function clearLfpInventory() + { + unset($this->lfp_inventory); + } + + /** + * Required. The inventory to insert. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpInventory lfp_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Lfp\V1beta\LfpInventory $var + * @return $this + */ + public function setLfpInventory($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Lfp\V1beta\LfpInventory::class); + $this->lfp_inventory = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/InsertLfpSaleRequest.php b/ShoppingMerchantLfp/src/V1beta/InsertLfpSaleRequest.php new file mode 100644 index 000000000000..ad886a3cbd70 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/InsertLfpSaleRequest.php @@ -0,0 +1,115 @@ +google.shopping.merchant.lfp.v1beta.InsertLfpSaleRequest + */ +class InsertLfpSaleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The LFP provider account. + * Format: `accounts/{lfp_partner}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The sale to insert. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpSale lfp_sale = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lfp_sale = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The LFP provider account. + * Format: `accounts/{lfp_partner}` + * @type \Google\Shopping\Merchant\Lfp\V1beta\LfpSale $lfp_sale + * Required. The sale to insert. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpsale::initOnce(); + parent::__construct($data); + } + + /** + * Required. The LFP provider account. + * Format: `accounts/{lfp_partner}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The LFP provider account. + * Format: `accounts/{lfp_partner}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The sale to insert. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpSale lfp_sale = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Lfp\V1beta\LfpSale|null + */ + public function getLfpSale() + { + return $this->lfp_sale; + } + + public function hasLfpSale() + { + return isset($this->lfp_sale); + } + + public function clearLfpSale() + { + unset($this->lfp_sale); + } + + /** + * Required. The sale to insert. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpSale lfp_sale = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Lfp\V1beta\LfpSale $var + * @return $this + */ + public function setLfpSale($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Lfp\V1beta\LfpSale::class); + $this->lfp_sale = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/InsertLfpStoreRequest.php b/ShoppingMerchantLfp/src/V1beta/InsertLfpStoreRequest.php new file mode 100644 index 000000000000..2464b3d6169b --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/InsertLfpStoreRequest.php @@ -0,0 +1,132 @@ +google.shopping.merchant.lfp.v1beta.InsertLfpStoreRequest + */ +class InsertLfpStoreRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The LFP provider account + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The store to insert. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpStore lfp_store = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lfp_store = null; + + /** + * @param string $parent Required. The LFP provider account + * Format: `accounts/{account}` + * Please see {@see LfpStoreServiceClient::accountName()} for help formatting this field. + * @param \Google\Shopping\Merchant\Lfp\V1beta\LfpStore $lfpStore Required. The store to insert. + * + * @return \Google\Shopping\Merchant\Lfp\V1beta\InsertLfpStoreRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Shopping\Merchant\Lfp\V1beta\LfpStore $lfpStore): self + { + return (new self()) + ->setParent($parent) + ->setLfpStore($lfpStore); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The LFP provider account + * Format: `accounts/{account}` + * @type \Google\Shopping\Merchant\Lfp\V1beta\LfpStore $lfp_store + * Required. The store to insert. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The LFP provider account + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The LFP provider account + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The store to insert. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpStore lfp_store = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Lfp\V1beta\LfpStore|null + */ + public function getLfpStore() + { + return $this->lfp_store; + } + + public function hasLfpStore() + { + return isset($this->lfp_store); + } + + public function clearLfpStore() + { + unset($this->lfp_store); + } + + /** + * Required. The store to insert. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpStore lfp_store = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Lfp\V1beta\LfpStore $var + * @return $this + */ + public function setLfpStore($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Lfp\V1beta\LfpStore::class); + $this->lfp_store = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/LfpInventory.php b/ShoppingMerchantLfp/src/V1beta/LfpInventory.php new file mode 100644 index 000000000000..9732a1c20e68 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/LfpInventory.php @@ -0,0 +1,671 @@ +google.shopping.merchant.lfp.v1beta.LfpInventory + */ +class LfpInventory extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The name for the `LfpInventory` resource. + * Format: + * `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. The Merchant Center ID of the merchant to submit the inventory + * for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_account = 0; + /** + * Required. The identifier of the merchant's store. Either the store code + * inserted through `InsertLfpStore` or the store code in the Business + * Profile. + * + * Generated from protobuf field string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $store_code = ''; + /** + * Required. Immutable. A unique identifier for the product. If both + * inventories and sales are submitted for a merchant, this id should match + * for the same product. + * **Note**: if the merchant sells the same product new and used, they should + * have different IDs. + * + * Generated from protobuf field string offer_id = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $offer_id = ''; + /** + * Required. The [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) + * for the country where the product is sold. + * + * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_code = ''; + /** + * Required. The two-letter ISO 639-1 language code for the item. + * + * Generated from protobuf field string content_language = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $content_language = ''; + /** + * Optional. The Global Trade Item Number of the product. + * + * Generated from protobuf field optional string gtin = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $gtin = null; + /** + * Optional. The current price of the product. + * + * Generated from protobuf field .google.shopping.type.Price price = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $price = null; + /** + * Required. Availability of the product at this store. + * For accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342) + * + * Generated from protobuf field string availability = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $availability = ''; + /** + * Optional. Quantity of the product available at this store. Must be greater + * than or equal to zero. + * + * Generated from protobuf field optional int64 quantity = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $quantity = null; + /** + * Optional. The time when the inventory is collected. If not set, it will be + * set to the time when the inventory is submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp collection_time = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $collection_time = null; + /** + * Optional. Supported pickup method for this offer. Unless the value is "not + * supported", this field must be submitted together with `pickupSla`. For + * accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342). + * + * Generated from protobuf field optional string pickup_method = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $pickup_method = null; + /** + * Optional. Expected date that an order will be ready for pickup relative to + * the order date. Must be submitted together with `pickupMethod`. For + * accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342). + * + * Generated from protobuf field optional string pickup_sla = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $pickup_sla = null; + /** + * Optional. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. If this is not set, it will default to `regionCode`. + * + * Generated from protobuf field optional string feed_label = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $feed_label = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The name for the `LfpInventory` resource. + * Format: + * `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}` + * @type int|string $target_account + * Required. The Merchant Center ID of the merchant to submit the inventory + * for. + * @type string $store_code + * Required. The identifier of the merchant's store. Either the store code + * inserted through `InsertLfpStore` or the store code in the Business + * Profile. + * @type string $offer_id + * Required. Immutable. A unique identifier for the product. If both + * inventories and sales are submitted for a merchant, this id should match + * for the same product. + * **Note**: if the merchant sells the same product new and used, they should + * have different IDs. + * @type string $region_code + * Required. The [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) + * for the country where the product is sold. + * @type string $content_language + * Required. The two-letter ISO 639-1 language code for the item. + * @type string $gtin + * Optional. The Global Trade Item Number of the product. + * @type \Google\Shopping\Type\Price $price + * Optional. The current price of the product. + * @type string $availability + * Required. Availability of the product at this store. + * For accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342) + * @type int|string $quantity + * Optional. Quantity of the product available at this store. Must be greater + * than or equal to zero. + * @type \Google\Protobuf\Timestamp $collection_time + * Optional. The time when the inventory is collected. If not set, it will be + * set to the time when the inventory is submitted. + * @type string $pickup_method + * Optional. Supported pickup method for this offer. Unless the value is "not + * supported", this field must be submitted together with `pickupSla`. For + * accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342). + * @type string $pickup_sla + * Optional. Expected date that an order will be ready for pickup relative to + * the order date. Must be submitted together with `pickupMethod`. For + * accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342). + * @type string $feed_label + * Optional. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. If this is not set, it will default to `regionCode`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpinventory::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The name for the `LfpInventory` resource. + * Format: + * `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The name for the `LfpInventory` resource. + * Format: + * `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The Merchant Center ID of the merchant to submit the inventory + * for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getTargetAccount() + { + return $this->target_account; + } + + /** + * Required. The Merchant Center ID of the merchant to submit the inventory + * for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setTargetAccount($var) + { + GPBUtil::checkInt64($var); + $this->target_account = $var; + + return $this; + } + + /** + * Required. The identifier of the merchant's store. Either the store code + * inserted through `InsertLfpStore` or the store code in the Business + * Profile. + * + * Generated from protobuf field string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStoreCode() + { + return $this->store_code; + } + + /** + * Required. The identifier of the merchant's store. Either the store code + * inserted through `InsertLfpStore` or the store code in the Business + * Profile. + * + * Generated from protobuf field string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStoreCode($var) + { + GPBUtil::checkString($var, True); + $this->store_code = $var; + + return $this; + } + + /** + * Required. Immutable. A unique identifier for the product. If both + * inventories and sales are submitted for a merchant, this id should match + * for the same product. + * **Note**: if the merchant sells the same product new and used, they should + * have different IDs. + * + * Generated from protobuf field string offer_id = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getOfferId() + { + return $this->offer_id; + } + + /** + * Required. Immutable. A unique identifier for the product. If both + * inventories and sales are submitted for a merchant, this id should match + * for the same product. + * **Note**: if the merchant sells the same product new and used, they should + * have different IDs. + * + * Generated from protobuf field string offer_id = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setOfferId($var) + { + GPBUtil::checkString($var, True); + $this->offer_id = $var; + + return $this; + } + + /** + * Required. The [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) + * for the country where the product is sold. + * + * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. The [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) + * for the country where the product is sold. + * + * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Required. The two-letter ISO 639-1 language code for the item. + * + * Generated from protobuf field string content_language = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getContentLanguage() + { + return $this->content_language; + } + + /** + * Required. The two-letter ISO 639-1 language code for the item. + * + * Generated from protobuf field string content_language = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + + /** + * Optional. The Global Trade Item Number of the product. + * + * Generated from protobuf field optional string gtin = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getGtin() + { + return isset($this->gtin) ? $this->gtin : ''; + } + + public function hasGtin() + { + return isset($this->gtin); + } + + public function clearGtin() + { + unset($this->gtin); + } + + /** + * Optional. The Global Trade Item Number of the product. + * + * Generated from protobuf field optional string gtin = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setGtin($var) + { + GPBUtil::checkString($var, True); + $this->gtin = $var; + + return $this; + } + + /** + * Optional. The current price of the product. + * + * Generated from protobuf field .google.shopping.type.Price price = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Type\Price|null + */ + public function getPrice() + { + return $this->price; + } + + public function hasPrice() + { + return isset($this->price); + } + + public function clearPrice() + { + unset($this->price); + } + + /** + * Optional. The current price of the product. + * + * Generated from protobuf field .google.shopping.type.Price price = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setPrice($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->price = $var; + + return $this; + } + + /** + * Required. Availability of the product at this store. + * For accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342) + * + * Generated from protobuf field string availability = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAvailability() + { + return $this->availability; + } + + /** + * Required. Availability of the product at this store. + * For accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342) + * + * Generated from protobuf field string availability = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAvailability($var) + { + GPBUtil::checkString($var, True); + $this->availability = $var; + + return $this; + } + + /** + * Optional. Quantity of the product available at this store. Must be greater + * than or equal to zero. + * + * Generated from protobuf field optional int64 quantity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getQuantity() + { + return isset($this->quantity) ? $this->quantity : 0; + } + + public function hasQuantity() + { + return isset($this->quantity); + } + + public function clearQuantity() + { + unset($this->quantity); + } + + /** + * Optional. Quantity of the product available at this store. Must be greater + * than or equal to zero. + * + * Generated from protobuf field optional int64 quantity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setQuantity($var) + { + GPBUtil::checkInt64($var); + $this->quantity = $var; + + return $this; + } + + /** + * Optional. The time when the inventory is collected. If not set, it will be + * set to the time when the inventory is submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp collection_time = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCollectionTime() + { + return $this->collection_time; + } + + public function hasCollectionTime() + { + return isset($this->collection_time); + } + + public function clearCollectionTime() + { + unset($this->collection_time); + } + + /** + * Optional. The time when the inventory is collected. If not set, it will be + * set to the time when the inventory is submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp collection_time = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCollectionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->collection_time = $var; + + return $this; + } + + /** + * Optional. Supported pickup method for this offer. Unless the value is "not + * supported", this field must be submitted together with `pickupSla`. For + * accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342). + * + * Generated from protobuf field optional string pickup_method = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPickupMethod() + { + return isset($this->pickup_method) ? $this->pickup_method : ''; + } + + public function hasPickupMethod() + { + return isset($this->pickup_method); + } + + public function clearPickupMethod() + { + unset($this->pickup_method); + } + + /** + * Optional. Supported pickup method for this offer. Unless the value is "not + * supported", this field must be submitted together with `pickupSla`. For + * accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342). + * + * Generated from protobuf field optional string pickup_method = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPickupMethod($var) + { + GPBUtil::checkString($var, True); + $this->pickup_method = $var; + + return $this; + } + + /** + * Optional. Expected date that an order will be ready for pickup relative to + * the order date. Must be submitted together with `pickupMethod`. For + * accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342). + * + * Generated from protobuf field optional string pickup_sla = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPickupSla() + { + return isset($this->pickup_sla) ? $this->pickup_sla : ''; + } + + public function hasPickupSla() + { + return isset($this->pickup_sla); + } + + public function clearPickupSla() + { + unset($this->pickup_sla); + } + + /** + * Optional. Expected date that an order will be ready for pickup relative to + * the order date. Must be submitted together with `pickupMethod`. For + * accepted attribute values, see the [local product inventory data + * specification](https://support.google.com/merchants/answer/3061342). + * + * Generated from protobuf field optional string pickup_sla = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPickupSla($var) + { + GPBUtil::checkString($var, True); + $this->pickup_sla = $var; + + return $this; + } + + /** + * Optional. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. If this is not set, it will default to `regionCode`. + * + * Generated from protobuf field optional string feed_label = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFeedLabel() + { + return isset($this->feed_label) ? $this->feed_label : ''; + } + + public function hasFeedLabel() + { + return isset($this->feed_label); + } + + public function clearFeedLabel() + { + unset($this->feed_label); + } + + /** + * Optional. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. If this is not set, it will default to `regionCode`. + * + * Generated from protobuf field optional string feed_label = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFeedLabel($var) + { + GPBUtil::checkString($var, True); + $this->feed_label = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/LfpSale.php b/ShoppingMerchantLfp/src/V1beta/LfpSale.php new file mode 100644 index 000000000000..f084b75fd2c1 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/LfpSale.php @@ -0,0 +1,529 @@ +google.shopping.merchant.lfp.v1beta.LfpSale + */ +class LfpSale extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The name of the `LfpSale` resource. + * Format: + * `accounts/{account}/lfpSales/{sale}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. The Merchant Center ID of the merchant to submit the sale for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_account = 0; + /** + * Required. The identifier of the merchant's store. Either a `storeCode` + * inserted through the API or the code of the store in the Business Profile. + * + * Generated from protobuf field string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $store_code = ''; + /** + * Required. A unique identifier for the product. If both inventories and + * sales are submitted for a merchant, this id should match for the same + * product. + * **Note**: if the merchant sells the same product new and used, they should + * have different IDs. + * + * Generated from protobuf field string offer_id = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $offer_id = ''; + /** + * Required. The [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) + * for the country where the product is sold. + * + * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_code = ''; + /** + * Required. The two-letter ISO 639-1 language code for the item. + * + * Generated from protobuf field string content_language = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $content_language = ''; + /** + * Required. The Global Trade Item Number of the sold product. + * + * Generated from protobuf field string gtin = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $gtin = ''; + /** + * Required. The unit price of the product. + * + * Generated from protobuf field .google.shopping.type.Price price = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $price = null; + /** + * Required. The relative change of the available quantity. Negative for items + * returned. + * + * Generated from protobuf field int64 quantity = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $quantity = 0; + /** + * Required. The timestamp for the sale. + * + * Generated from protobuf field .google.protobuf.Timestamp sale_time = 10 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sale_time = null; + /** + * Output only. System generated globally unique ID for the `LfpSale`. + * + * Generated from protobuf field optional string uid = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + protected $uid = null; + /** + * Optional. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. If this is not set, it will default to `regionCode`. + * + * Generated from protobuf field optional string feed_label = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $feed_label = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The name of the `LfpSale` resource. + * Format: + * `accounts/{account}/lfpSales/{sale}` + * @type int|string $target_account + * Required. The Merchant Center ID of the merchant to submit the sale for. + * @type string $store_code + * Required. The identifier of the merchant's store. Either a `storeCode` + * inserted through the API or the code of the store in the Business Profile. + * @type string $offer_id + * Required. A unique identifier for the product. If both inventories and + * sales are submitted for a merchant, this id should match for the same + * product. + * **Note**: if the merchant sells the same product new and used, they should + * have different IDs. + * @type string $region_code + * Required. The [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) + * for the country where the product is sold. + * @type string $content_language + * Required. The two-letter ISO 639-1 language code for the item. + * @type string $gtin + * Required. The Global Trade Item Number of the sold product. + * @type \Google\Shopping\Type\Price $price + * Required. The unit price of the product. + * @type int|string $quantity + * Required. The relative change of the available quantity. Negative for items + * returned. + * @type \Google\Protobuf\Timestamp $sale_time + * Required. The timestamp for the sale. + * @type string $uid + * Output only. System generated globally unique ID for the `LfpSale`. + * @type string $feed_label + * Optional. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. If this is not set, it will default to `regionCode`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpsale::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The name of the `LfpSale` resource. + * Format: + * `accounts/{account}/lfpSales/{sale}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The name of the `LfpSale` resource. + * Format: + * `accounts/{account}/lfpSales/{sale}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The Merchant Center ID of the merchant to submit the sale for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getTargetAccount() + { + return $this->target_account; + } + + /** + * Required. The Merchant Center ID of the merchant to submit the sale for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setTargetAccount($var) + { + GPBUtil::checkInt64($var); + $this->target_account = $var; + + return $this; + } + + /** + * Required. The identifier of the merchant's store. Either a `storeCode` + * inserted through the API or the code of the store in the Business Profile. + * + * Generated from protobuf field string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStoreCode() + { + return $this->store_code; + } + + /** + * Required. The identifier of the merchant's store. Either a `storeCode` + * inserted through the API or the code of the store in the Business Profile. + * + * Generated from protobuf field string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStoreCode($var) + { + GPBUtil::checkString($var, True); + $this->store_code = $var; + + return $this; + } + + /** + * Required. A unique identifier for the product. If both inventories and + * sales are submitted for a merchant, this id should match for the same + * product. + * **Note**: if the merchant sells the same product new and used, they should + * have different IDs. + * + * Generated from protobuf field string offer_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOfferId() + { + return $this->offer_id; + } + + /** + * Required. A unique identifier for the product. If both inventories and + * sales are submitted for a merchant, this id should match for the same + * product. + * **Note**: if the merchant sells the same product new and used, they should + * have different IDs. + * + * Generated from protobuf field string offer_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOfferId($var) + { + GPBUtil::checkString($var, True); + $this->offer_id = $var; + + return $this; + } + + /** + * Required. The [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) + * for the country where the product is sold. + * + * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. The [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) + * for the country where the product is sold. + * + * Generated from protobuf field string region_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Required. The two-letter ISO 639-1 language code for the item. + * + * Generated from protobuf field string content_language = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getContentLanguage() + { + return $this->content_language; + } + + /** + * Required. The two-letter ISO 639-1 language code for the item. + * + * Generated from protobuf field string content_language = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + + /** + * Required. The Global Trade Item Number of the sold product. + * + * Generated from protobuf field string gtin = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGtin() + { + return $this->gtin; + } + + /** + * Required. The Global Trade Item Number of the sold product. + * + * Generated from protobuf field string gtin = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGtin($var) + { + GPBUtil::checkString($var, True); + $this->gtin = $var; + + return $this; + } + + /** + * Required. The unit price of the product. + * + * Generated from protobuf field .google.shopping.type.Price price = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Type\Price|null + */ + public function getPrice() + { + return $this->price; + } + + public function hasPrice() + { + return isset($this->price); + } + + public function clearPrice() + { + unset($this->price); + } + + /** + * Required. The unit price of the product. + * + * Generated from protobuf field .google.shopping.type.Price price = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setPrice($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->price = $var; + + return $this; + } + + /** + * Required. The relative change of the available quantity. Negative for items + * returned. + * + * Generated from protobuf field int64 quantity = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + * Required. The relative change of the available quantity. Negative for items + * returned. + * + * Generated from protobuf field int64 quantity = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setQuantity($var) + { + GPBUtil::checkInt64($var); + $this->quantity = $var; + + return $this; + } + + /** + * Required. The timestamp for the sale. + * + * Generated from protobuf field .google.protobuf.Timestamp sale_time = 10 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSaleTime() + { + return $this->sale_time; + } + + public function hasSaleTime() + { + return isset($this->sale_time); + } + + public function clearSaleTime() + { + unset($this->sale_time); + } + + /** + * Required. The timestamp for the sale. + * + * Generated from protobuf field .google.protobuf.Timestamp sale_time = 10 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSaleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->sale_time = $var; + + return $this; + } + + /** + * Output only. System generated globally unique ID for the `LfpSale`. + * + * Generated from protobuf field optional string uid = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return string + */ + public function getUid() + { + return isset($this->uid) ? $this->uid : ''; + } + + public function hasUid() + { + return isset($this->uid); + } + + public function clearUid() + { + unset($this->uid); + } + + /** + * Output only. System generated globally unique ID for the `LfpSale`. + * + * Generated from protobuf field optional string uid = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Optional. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. If this is not set, it will default to `regionCode`. + * + * Generated from protobuf field optional string feed_label = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFeedLabel() + { + return isset($this->feed_label) ? $this->feed_label : ''; + } + + public function hasFeedLabel() + { + return isset($this->feed_label); + } + + public function clearFeedLabel() + { + unset($this->feed_label); + } + + /** + * Optional. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. If this is not set, it will default to `regionCode`. + * + * Generated from protobuf field optional string feed_label = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFeedLabel($var) + { + GPBUtil::checkString($var, True); + $this->feed_label = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/LfpStore.php b/ShoppingMerchantLfp/src/V1beta/LfpStore.php new file mode 100644 index 000000000000..a63da1ec01d8 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/LfpStore.php @@ -0,0 +1,564 @@ +google.shopping.merchant.lfp.v1beta.LfpStore + */ +class LfpStore extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The name of the `LfpStore` resource. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. The Merchant Center id of the merchant to submit the store for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_account = 0; + /** + * Required. Immutable. A store identifier that is unique for the target + * merchant. + * + * Generated from protobuf field string store_code = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $store_code = ''; + /** + * Required. The street address of the store. + * Example: 1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA. + * + * Generated from protobuf field string store_address = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $store_address = ''; + /** + * Optional. The merchant or store name. + * + * Generated from protobuf field optional string store_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $store_name = null; + /** + * Optional. The store phone number in + * [E.164](https://en.wikipedia.org/wiki/E.164) format. Example: + * `+15556767888` + * + * Generated from protobuf field optional string phone_number = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $phone_number = null; + /** + * Optional. The website URL for the store or merchant. + * + * Generated from protobuf field optional string website_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $website_uri = null; + /** + * Optional. [Google My Business category + * id](https://gcid-explorer.corp.google.com/static/gcid.html). + * + * Generated from protobuf field repeated string gcid_category = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $gcid_category; + /** + * Optional. The [Google Place + * Id](https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview) + * of the store location. + * + * Generated from protobuf field optional string place_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $place_id = null; + /** + * Optional. Output only. The state of matching to a Google Business Profile. + * See + * [matchingStateHint][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state_hint] + * for further details if no match is found. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpStore.StoreMatchingState matching_state = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $matching_state = 0; + /** + * Optional. Output only. The hint of why the matching has failed. This is + * only set when + * [matchingState][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state]=`STORE_MATCHING_STATE_FAILED`. + * Possible values are: + * - "`linked-store-not-found`": There aren't any Google Business + * Profile stores available for matching. + * - "`store-match-not-found`": The provided `LfpStore` couldn't be matched to + * any of the connected Google Business Profile stores. Merchant Center + * account is connected correctly and stores are available on Google Business + * Profile, but the `LfpStore` location address does not match with Google + * Business Profile stores' addresses. Update the `LfpStore` address or Google + * Business Profile store address to match correctly. + * - "`store-match-unverified`": The provided `LfpStore` couldn't be matched + * to any of the connected Google Business Profile stores, as the matched + * Google Business Profile store is unverified. Go through the Google Business + * Profile verification process to match correctly. + * + * Generated from protobuf field optional string matching_state_hint = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $matching_state_hint = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The name of the `LfpStore` resource. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * @type int|string $target_account + * Required. The Merchant Center id of the merchant to submit the store for. + * @type string $store_code + * Required. Immutable. A store identifier that is unique for the target + * merchant. + * @type string $store_address + * Required. The street address of the store. + * Example: 1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA. + * @type string $store_name + * Optional. The merchant or store name. + * @type string $phone_number + * Optional. The store phone number in + * [E.164](https://en.wikipedia.org/wiki/E.164) format. Example: + * `+15556767888` + * @type string $website_uri + * Optional. The website URL for the store or merchant. + * @type array|\Google\Protobuf\Internal\RepeatedField $gcid_category + * Optional. [Google My Business category + * id](https://gcid-explorer.corp.google.com/static/gcid.html). + * @type string $place_id + * Optional. The [Google Place + * Id](https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview) + * of the store location. + * @type int $matching_state + * Optional. Output only. The state of matching to a Google Business Profile. + * See + * [matchingStateHint][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state_hint] + * for further details if no match is found. + * @type string $matching_state_hint + * Optional. Output only. The hint of why the matching has failed. This is + * only set when + * [matchingState][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state]=`STORE_MATCHING_STATE_FAILED`. + * Possible values are: + * - "`linked-store-not-found`": There aren't any Google Business + * Profile stores available for matching. + * - "`store-match-not-found`": The provided `LfpStore` couldn't be matched to + * any of the connected Google Business Profile stores. Merchant Center + * account is connected correctly and stores are available on Google Business + * Profile, but the `LfpStore` location address does not match with Google + * Business Profile stores' addresses. Update the `LfpStore` address or Google + * Business Profile store address to match correctly. + * - "`store-match-unverified`": The provided `LfpStore` couldn't be matched + * to any of the connected Google Business Profile stores, as the matched + * Google Business Profile store is unverified. Go through the Google Business + * Profile verification process to match correctly. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpstore::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The name of the `LfpStore` resource. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The name of the `LfpStore` resource. + * Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The Merchant Center id of the merchant to submit the store for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getTargetAccount() + { + return $this->target_account; + } + + /** + * Required. The Merchant Center id of the merchant to submit the store for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setTargetAccount($var) + { + GPBUtil::checkInt64($var); + $this->target_account = $var; + + return $this; + } + + /** + * Required. Immutable. A store identifier that is unique for the target + * merchant. + * + * Generated from protobuf field string store_code = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getStoreCode() + { + return $this->store_code; + } + + /** + * Required. Immutable. A store identifier that is unique for the target + * merchant. + * + * Generated from protobuf field string store_code = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setStoreCode($var) + { + GPBUtil::checkString($var, True); + $this->store_code = $var; + + return $this; + } + + /** + * Required. The street address of the store. + * Example: 1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA. + * + * Generated from protobuf field string store_address = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStoreAddress() + { + return $this->store_address; + } + + /** + * Required. The street address of the store. + * Example: 1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA. + * + * Generated from protobuf field string store_address = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStoreAddress($var) + { + GPBUtil::checkString($var, True); + $this->store_address = $var; + + return $this; + } + + /** + * Optional. The merchant or store name. + * + * Generated from protobuf field optional string store_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getStoreName() + { + return isset($this->store_name) ? $this->store_name : ''; + } + + public function hasStoreName() + { + return isset($this->store_name); + } + + public function clearStoreName() + { + unset($this->store_name); + } + + /** + * Optional. The merchant or store name. + * + * Generated from protobuf field optional string store_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setStoreName($var) + { + GPBUtil::checkString($var, True); + $this->store_name = $var; + + return $this; + } + + /** + * Optional. The store phone number in + * [E.164](https://en.wikipedia.org/wiki/E.164) format. Example: + * `+15556767888` + * + * Generated from protobuf field optional string phone_number = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPhoneNumber() + { + return isset($this->phone_number) ? $this->phone_number : ''; + } + + public function hasPhoneNumber() + { + return isset($this->phone_number); + } + + public function clearPhoneNumber() + { + unset($this->phone_number); + } + + /** + * Optional. The store phone number in + * [E.164](https://en.wikipedia.org/wiki/E.164) format. Example: + * `+15556767888` + * + * Generated from protobuf field optional string phone_number = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPhoneNumber($var) + { + GPBUtil::checkString($var, True); + $this->phone_number = $var; + + return $this; + } + + /** + * Optional. The website URL for the store or merchant. + * + * Generated from protobuf field optional string website_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getWebsiteUri() + { + return isset($this->website_uri) ? $this->website_uri : ''; + } + + public function hasWebsiteUri() + { + return isset($this->website_uri); + } + + public function clearWebsiteUri() + { + unset($this->website_uri); + } + + /** + * Optional. The website URL for the store or merchant. + * + * Generated from protobuf field optional string website_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setWebsiteUri($var) + { + GPBUtil::checkString($var, True); + $this->website_uri = $var; + + return $this; + } + + /** + * Optional. [Google My Business category + * id](https://gcid-explorer.corp.google.com/static/gcid.html). + * + * Generated from protobuf field repeated string gcid_category = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGcidCategory() + { + return $this->gcid_category; + } + + /** + * Optional. [Google My Business category + * id](https://gcid-explorer.corp.google.com/static/gcid.html). + * + * Generated from protobuf field repeated string gcid_category = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGcidCategory($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->gcid_category = $arr; + + return $this; + } + + /** + * Optional. The [Google Place + * Id](https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview) + * of the store location. + * + * Generated from protobuf field optional string place_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPlaceId() + { + return isset($this->place_id) ? $this->place_id : ''; + } + + public function hasPlaceId() + { + return isset($this->place_id); + } + + public function clearPlaceId() + { + unset($this->place_id); + } + + /** + * Optional. The [Google Place + * Id](https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview) + * of the store location. + * + * Generated from protobuf field optional string place_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPlaceId($var) + { + GPBUtil::checkString($var, True); + $this->place_id = $var; + + return $this; + } + + /** + * Optional. Output only. The state of matching to a Google Business Profile. + * See + * [matchingStateHint][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state_hint] + * for further details if no match is found. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpStore.StoreMatchingState matching_state = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getMatchingState() + { + return $this->matching_state; + } + + /** + * Optional. Output only. The state of matching to a Google Business Profile. + * See + * [matchingStateHint][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state_hint] + * for further details if no match is found. + * + * Generated from protobuf field .google.shopping.merchant.lfp.v1beta.LfpStore.StoreMatchingState matching_state = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setMatchingState($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Lfp\V1beta\LfpStore\StoreMatchingState::class); + $this->matching_state = $var; + + return $this; + } + + /** + * Optional. Output only. The hint of why the matching has failed. This is + * only set when + * [matchingState][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state]=`STORE_MATCHING_STATE_FAILED`. + * Possible values are: + * - "`linked-store-not-found`": There aren't any Google Business + * Profile stores available for matching. + * - "`store-match-not-found`": The provided `LfpStore` couldn't be matched to + * any of the connected Google Business Profile stores. Merchant Center + * account is connected correctly and stores are available on Google Business + * Profile, but the `LfpStore` location address does not match with Google + * Business Profile stores' addresses. Update the `LfpStore` address or Google + * Business Profile store address to match correctly. + * - "`store-match-unverified`": The provided `LfpStore` couldn't be matched + * to any of the connected Google Business Profile stores, as the matched + * Google Business Profile store is unverified. Go through the Google Business + * Profile verification process to match correctly. + * + * Generated from protobuf field optional string matching_state_hint = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getMatchingStateHint() + { + return isset($this->matching_state_hint) ? $this->matching_state_hint : ''; + } + + public function hasMatchingStateHint() + { + return isset($this->matching_state_hint); + } + + public function clearMatchingStateHint() + { + unset($this->matching_state_hint); + } + + /** + * Optional. Output only. The hint of why the matching has failed. This is + * only set when + * [matchingState][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state]=`STORE_MATCHING_STATE_FAILED`. + * Possible values are: + * - "`linked-store-not-found`": There aren't any Google Business + * Profile stores available for matching. + * - "`store-match-not-found`": The provided `LfpStore` couldn't be matched to + * any of the connected Google Business Profile stores. Merchant Center + * account is connected correctly and stores are available on Google Business + * Profile, but the `LfpStore` location address does not match with Google + * Business Profile stores' addresses. Update the `LfpStore` address or Google + * Business Profile store address to match correctly. + * - "`store-match-unverified`": The provided `LfpStore` couldn't be matched + * to any of the connected Google Business Profile stores, as the matched + * Google Business Profile store is unverified. Go through the Google Business + * Profile verification process to match correctly. + * + * Generated from protobuf field optional string matching_state_hint = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setMatchingStateHint($var) + { + GPBUtil::checkString($var, True); + $this->matching_state_hint = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/LfpStore/StoreMatchingState.php b/ShoppingMerchantLfp/src/V1beta/LfpStore/StoreMatchingState.php new file mode 100644 index 000000000000..e5fd9ceb71a8 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/LfpStore/StoreMatchingState.php @@ -0,0 +1,63 @@ +google.shopping.merchant.lfp.v1beta.LfpStore.StoreMatchingState + */ +class StoreMatchingState +{ + /** + * Store matching state unspecified. + * + * Generated from protobuf enum STORE_MATCHING_STATE_UNSPECIFIED = 0; + */ + const STORE_MATCHING_STATE_UNSPECIFIED = 0; + /** + * The `LfpStore` is successfully matched with a Google Business Profile + * store. + * + * Generated from protobuf enum STORE_MATCHING_STATE_MATCHED = 1; + */ + const STORE_MATCHING_STATE_MATCHED = 1; + /** + * The `LfpStore` is not matched with a Google Business Profile store. + * + * Generated from protobuf enum STORE_MATCHING_STATE_FAILED = 2; + */ + const STORE_MATCHING_STATE_FAILED = 2; + + private static $valueToName = [ + self::STORE_MATCHING_STATE_UNSPECIFIED => 'STORE_MATCHING_STATE_UNSPECIFIED', + self::STORE_MATCHING_STATE_MATCHED => 'STORE_MATCHING_STATE_MATCHED', + self::STORE_MATCHING_STATE_FAILED => 'STORE_MATCHING_STATE_FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantLfp/src/V1beta/ListLfpStoresRequest.php b/ShoppingMerchantLfp/src/V1beta/ListLfpStoresRequest.php new file mode 100644 index 000000000000..b65faf6aea9a --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/ListLfpStoresRequest.php @@ -0,0 +1,224 @@ +google.shopping.merchant.lfp.v1beta.ListLfpStoresRequest + */ +class ListLfpStoresRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The LFP partner. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Merchant Center id of the merchant to list stores for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_account = 0; + /** + * Optional. The maximum number of `LfpStore` resources for the given account + * to return. The service returns fewer than this value if the number of + * stores for the given account is less than the `pageSize`. The default value + * is 250. The maximum value is 1000; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListLfpStoresRequest` + * call. Provide the page token to retrieve the subsequent page. When + * paginating, all other parameters provided to `ListLfpStoresRequest` must + * match the call that provided the page token. The token returned as + * [nextPageToken][google.shopping.merchant.lfp.v1beta.ListLfpStoresResponse.next_page_token] + * in the response to the previous request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The LFP partner. + * Format: `accounts/{account}` + * Please see {@see LfpStoreServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Lfp\V1beta\ListLfpStoresRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The LFP partner. + * Format: `accounts/{account}` + * @type int|string $target_account + * Required. The Merchant Center id of the merchant to list stores for. + * @type int $page_size + * Optional. The maximum number of `LfpStore` resources for the given account + * to return. The service returns fewer than this value if the number of + * stores for the given account is less than the `pageSize`. The default value + * is 250. The maximum value is 1000; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum. + * @type string $page_token + * Optional. A page token, received from a previous `ListLfpStoresRequest` + * call. Provide the page token to retrieve the subsequent page. When + * paginating, all other parameters provided to `ListLfpStoresRequest` must + * match the call that provided the page token. The token returned as + * [nextPageToken][google.shopping.merchant.lfp.v1beta.ListLfpStoresResponse.next_page_token] + * in the response to the previous request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The LFP partner. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The LFP partner. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Merchant Center id of the merchant to list stores for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getTargetAccount() + { + return $this->target_account; + } + + /** + * Required. The Merchant Center id of the merchant to list stores for. + * + * Generated from protobuf field int64 target_account = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setTargetAccount($var) + { + GPBUtil::checkInt64($var); + $this->target_account = $var; + + return $this; + } + + /** + * Optional. The maximum number of `LfpStore` resources for the given account + * to return. The service returns fewer than this value if the number of + * stores for the given account is less than the `pageSize`. The default value + * is 250. The maximum value is 1000; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `LfpStore` resources for the given account + * to return. The service returns fewer than this value if the number of + * stores for the given account is less than the `pageSize`. The default value + * is 250. The maximum value is 1000; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListLfpStoresRequest` + * call. Provide the page token to retrieve the subsequent page. When + * paginating, all other parameters provided to `ListLfpStoresRequest` must + * match the call that provided the page token. The token returned as + * [nextPageToken][google.shopping.merchant.lfp.v1beta.ListLfpStoresResponse.next_page_token] + * in the response to the previous request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListLfpStoresRequest` + * call. Provide the page token to retrieve the subsequent page. When + * paginating, all other parameters provided to `ListLfpStoresRequest` must + * match the call that provided the page token. The token returned as + * [nextPageToken][google.shopping.merchant.lfp.v1beta.ListLfpStoresResponse.next_page_token] + * in the response to the previous request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/ListLfpStoresResponse.php b/ShoppingMerchantLfp/src/V1beta/ListLfpStoresResponse.php new file mode 100644 index 000000000000..778565e74b02 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/ListLfpStoresResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.lfp.v1beta.ListLfpStoresResponse + */ +class ListLfpStoresResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The stores from the specified merchant. + * + * Generated from protobuf field repeated .google.shopping.merchant.lfp.v1beta.LfpStore lfp_stores = 1; + */ + private $lfp_stores; + /** + * A token, which can be sent as `pageToken` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Lfp\V1beta\LfpStore>|\Google\Protobuf\Internal\RepeatedField $lfp_stores + * The stores from the specified merchant. + * @type string $next_page_token + * A token, which can be sent as `pageToken` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Lfp\V1Beta\Lfpstore::initOnce(); + parent::__construct($data); + } + + /** + * The stores from the specified merchant. + * + * Generated from protobuf field repeated .google.shopping.merchant.lfp.v1beta.LfpStore lfp_stores = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLfpStores() + { + return $this->lfp_stores; + } + + /** + * The stores from the specified merchant. + * + * Generated from protobuf field repeated .google.shopping.merchant.lfp.v1beta.LfpStore lfp_stores = 1; + * @param array<\Google\Shopping\Merchant\Lfp\V1beta\LfpStore>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLfpStores($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Lfp\V1beta\LfpStore::class); + $this->lfp_stores = $arr; + + return $this; + } + + /** + * A token, which can be sent as `pageToken` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `pageToken` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantLfp/src/V1beta/gapic_metadata.json b/ShoppingMerchantLfp/src/V1beta/gapic_metadata.json new file mode 100644 index 000000000000..7dcbd25ff046 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/gapic_metadata.json @@ -0,0 +1,66 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.shopping.merchant.lfp.v1beta", + "libraryPackage": "Google\\Shopping\\Merchant\\Lfp\\V1beta", + "services": { + "LfpInventoryService": { + "clients": { + "grpc": { + "libraryClient": "LfpInventoryServiceGapicClient", + "rpcs": { + "InsertLfpInventory": { + "methods": [ + "insertLfpInventory" + ] + } + } + } + } + }, + "LfpSaleService": { + "clients": { + "grpc": { + "libraryClient": "LfpSaleServiceGapicClient", + "rpcs": { + "InsertLfpSale": { + "methods": [ + "insertLfpSale" + ] + } + } + } + } + }, + "LfpStoreService": { + "clients": { + "grpc": { + "libraryClient": "LfpStoreServiceGapicClient", + "rpcs": { + "DeleteLfpStore": { + "methods": [ + "deleteLfpStore" + ] + }, + "GetLfpStore": { + "methods": [ + "getLfpStore" + ] + }, + "InsertLfpStore": { + "methods": [ + "insertLfpStore" + ] + }, + "ListLfpStores": { + "methods": [ + "listLfpStores" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_client_config.json b/ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_client_config.json new file mode 100644 index 000000000000..4cd21cd60ee5 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.shopping.merchant.lfp.v1beta.LfpInventoryService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "InsertLfpInventory": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_descriptor_config.php b/ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_descriptor_config.php new file mode 100644 index 000000000000..95f63d8d482b --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_descriptor_config.php @@ -0,0 +1,44 @@ + [ + 'google.shopping.merchant.lfp.v1beta.LfpInventoryService' => [ + 'InsertLfpInventory' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Lfp\V1beta\LfpInventory', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'lfpInventory' => 'accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}', + ], + ], + ], +]; diff --git a/ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_rest_client_config.php b/ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_rest_client_config.php new file mode 100644 index 000000000000..82d1e968e31e --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/resources/lfp_inventory_service_rest_client_config.php @@ -0,0 +1,41 @@ + [ + 'google.shopping.merchant.lfp.v1beta.LfpInventoryService' => [ + 'InsertLfpInventory' => [ + 'method' => 'post', + 'uriTemplate' => '/lfp/v1beta/{parent=accounts/*}/lfpInventories:insert', + 'body' => 'lfp_inventory', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_client_config.json b/ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_client_config.json new file mode 100644 index 000000000000..790a45b7ae78 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.shopping.merchant.lfp.v1beta.LfpSaleService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "InsertLfpSale": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_descriptor_config.php b/ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_descriptor_config.php new file mode 100644 index 000000000000..45fcc9293d75 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.shopping.merchant.lfp.v1beta.LfpSaleService' => [ + 'InsertLfpSale' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Lfp\V1beta\LfpSale', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'lfpSale' => 'accounts/{account}/lfpSales/{sale}', + ], + ], + ], +]; diff --git a/ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_rest_client_config.php b/ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_rest_client_config.php new file mode 100644 index 000000000000..61ae24465e65 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/resources/lfp_sale_service_rest_client_config.php @@ -0,0 +1,41 @@ + [ + 'google.shopping.merchant.lfp.v1beta.LfpSaleService' => [ + 'InsertLfpSale' => [ + 'method' => 'post', + 'uriTemplate' => '/lfp/v1beta/{parent=accounts/*}/lfpSales:insert', + 'body' => 'lfp_sale', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_client_config.json b/ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_client_config.json new file mode 100644 index 000000000000..87213f5f366a --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.shopping.merchant.lfp.v1beta.LfpStoreService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "DeleteLfpStore": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLfpStore": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "InsertLfpStore": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLfpStores": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_descriptor_config.php b/ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_descriptor_config.php new file mode 100644 index 000000000000..6565f4f3e2ff --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_descriptor_config.php @@ -0,0 +1,88 @@ + [ + 'google.shopping.merchant.lfp.v1beta.LfpStoreService' => [ + 'DeleteLfpStore' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLfpStore' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Lfp\V1beta\LfpStore', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'InsertLfpStore' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Lfp\V1beta\LfpStore', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListLfpStores' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLfpStores', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Lfp\V1beta\ListLfpStoresResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'lfpStore' => 'accounts/{account}/lfpStores/{target_merchant}~{store_code}', + ], + ], + ], +]; diff --git a/ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_rest_client_config.php b/ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_rest_client_config.php new file mode 100644 index 000000000000..671b42ae6445 --- /dev/null +++ b/ShoppingMerchantLfp/src/V1beta/resources/lfp_store_service_rest_client_config.php @@ -0,0 +1,77 @@ + [ + 'google.shopping.merchant.lfp.v1beta.LfpStoreService' => [ + 'DeleteLfpStore' => [ + 'method' => 'delete', + 'uriTemplate' => '/lfp/v1beta/{name=accounts/*/lfpStores/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetLfpStore' => [ + 'method' => 'get', + 'uriTemplate' => '/lfp/v1beta/{name=accounts/*/lfpStores/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InsertLfpStore' => [ + 'method' => 'post', + 'uriTemplate' => '/lfp/v1beta/{parent=accounts/*}/lfpStores:insert', + 'body' => 'lfp_store', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListLfpStores' => [ + 'method' => 'get', + 'uriTemplate' => '/lfp/v1beta/{parent=accounts/*}/lfpStores', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'target_account', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpInventoryServiceClientTest.php b/ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpInventoryServiceClientTest.php new file mode 100644 index 000000000000..bd703e66f149 --- /dev/null +++ b/ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpInventoryServiceClientTest.php @@ -0,0 +1,250 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return LfpInventoryServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LfpInventoryServiceClient($options); + } + + /** @test */ + public function insertLfpInventoryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $targetAccount = 475823745; + $storeCode = 'storeCode921424523'; + $offerId = 'offerId-768546338'; + $regionCode = 'regionCode-1566082984'; + $contentLanguage = 'contentLanguage-1408137122'; + $gtin = 'gtin3183314'; + $availability = 'availability1997542747'; + $quantity = 1285004149; + $pickupMethod = 'pickupMethod-950845436'; + $pickupSla = 'pickupSla-964667163'; + $feedLabel = 'feedLabel574920979'; + $expectedResponse = new LfpInventory(); + $expectedResponse->setName($name); + $expectedResponse->setTargetAccount($targetAccount); + $expectedResponse->setStoreCode($storeCode); + $expectedResponse->setOfferId($offerId); + $expectedResponse->setRegionCode($regionCode); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setGtin($gtin); + $expectedResponse->setAvailability($availability); + $expectedResponse->setQuantity($quantity); + $expectedResponse->setPickupMethod($pickupMethod); + $expectedResponse->setPickupSla($pickupSla); + $expectedResponse->setFeedLabel($feedLabel); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $lfpInventory = new LfpInventory(); + $lfpInventoryTargetAccount = 1536575798; + $lfpInventory->setTargetAccount($lfpInventoryTargetAccount); + $lfpInventoryStoreCode = 'lfpInventoryStoreCode-797569720'; + $lfpInventory->setStoreCode($lfpInventoryStoreCode); + $lfpInventoryOfferId = 'lfpInventoryOfferId1572615665'; + $lfpInventory->setOfferId($lfpInventoryOfferId); + $lfpInventoryRegionCode = 'lfpInventoryRegionCode-1841774745'; + $lfpInventory->setRegionCode($lfpInventoryRegionCode); + $lfpInventoryContentLanguage = 'lfpInventoryContentLanguage-367271349'; + $lfpInventory->setContentLanguage($lfpInventoryContentLanguage); + $lfpInventoryAvailability = 'lfpInventoryAvailability-621632447'; + $lfpInventory->setAvailability($lfpInventoryAvailability); + $request = (new InsertLfpInventoryRequest())->setParent($formattedParent)->setLfpInventory($lfpInventory); + $response = $gapicClient->insertLfpInventory($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.lfp.v1beta.LfpInventoryService/InsertLfpInventory', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getLfpInventory(); + $this->assertProtobufEquals($lfpInventory, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertLfpInventoryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $lfpInventory = new LfpInventory(); + $lfpInventoryTargetAccount = 1536575798; + $lfpInventory->setTargetAccount($lfpInventoryTargetAccount); + $lfpInventoryStoreCode = 'lfpInventoryStoreCode-797569720'; + $lfpInventory->setStoreCode($lfpInventoryStoreCode); + $lfpInventoryOfferId = 'lfpInventoryOfferId1572615665'; + $lfpInventory->setOfferId($lfpInventoryOfferId); + $lfpInventoryRegionCode = 'lfpInventoryRegionCode-1841774745'; + $lfpInventory->setRegionCode($lfpInventoryRegionCode); + $lfpInventoryContentLanguage = 'lfpInventoryContentLanguage-367271349'; + $lfpInventory->setContentLanguage($lfpInventoryContentLanguage); + $lfpInventoryAvailability = 'lfpInventoryAvailability-621632447'; + $lfpInventory->setAvailability($lfpInventoryAvailability); + $request = (new InsertLfpInventoryRequest())->setParent($formattedParent)->setLfpInventory($lfpInventory); + try { + $gapicClient->insertLfpInventory($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertLfpInventoryAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $targetAccount = 475823745; + $storeCode = 'storeCode921424523'; + $offerId = 'offerId-768546338'; + $regionCode = 'regionCode-1566082984'; + $contentLanguage = 'contentLanguage-1408137122'; + $gtin = 'gtin3183314'; + $availability = 'availability1997542747'; + $quantity = 1285004149; + $pickupMethod = 'pickupMethod-950845436'; + $pickupSla = 'pickupSla-964667163'; + $feedLabel = 'feedLabel574920979'; + $expectedResponse = new LfpInventory(); + $expectedResponse->setName($name); + $expectedResponse->setTargetAccount($targetAccount); + $expectedResponse->setStoreCode($storeCode); + $expectedResponse->setOfferId($offerId); + $expectedResponse->setRegionCode($regionCode); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setGtin($gtin); + $expectedResponse->setAvailability($availability); + $expectedResponse->setQuantity($quantity); + $expectedResponse->setPickupMethod($pickupMethod); + $expectedResponse->setPickupSla($pickupSla); + $expectedResponse->setFeedLabel($feedLabel); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $lfpInventory = new LfpInventory(); + $lfpInventoryTargetAccount = 1536575798; + $lfpInventory->setTargetAccount($lfpInventoryTargetAccount); + $lfpInventoryStoreCode = 'lfpInventoryStoreCode-797569720'; + $lfpInventory->setStoreCode($lfpInventoryStoreCode); + $lfpInventoryOfferId = 'lfpInventoryOfferId1572615665'; + $lfpInventory->setOfferId($lfpInventoryOfferId); + $lfpInventoryRegionCode = 'lfpInventoryRegionCode-1841774745'; + $lfpInventory->setRegionCode($lfpInventoryRegionCode); + $lfpInventoryContentLanguage = 'lfpInventoryContentLanguage-367271349'; + $lfpInventory->setContentLanguage($lfpInventoryContentLanguage); + $lfpInventoryAvailability = 'lfpInventoryAvailability-621632447'; + $lfpInventory->setAvailability($lfpInventoryAvailability); + $request = (new InsertLfpInventoryRequest())->setParent($formattedParent)->setLfpInventory($lfpInventory); + $response = $gapicClient->insertLfpInventoryAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.lfp.v1beta.LfpInventoryService/InsertLfpInventory', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getLfpInventory(); + $this->assertProtobufEquals($lfpInventory, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpSaleServiceClientTest.php b/ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpSaleServiceClientTest.php new file mode 100644 index 000000000000..70154081ccc6 --- /dev/null +++ b/ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpSaleServiceClientTest.php @@ -0,0 +1,256 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return LfpSaleServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LfpSaleServiceClient($options); + } + + /** @test */ + public function insertLfpSaleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $targetAccount = 475823745; + $storeCode = 'storeCode921424523'; + $offerId = 'offerId-768546338'; + $regionCode = 'regionCode-1566082984'; + $contentLanguage = 'contentLanguage-1408137122'; + $gtin = 'gtin3183314'; + $quantity = 1285004149; + $uid = 'uid115792'; + $feedLabel = 'feedLabel574920979'; + $expectedResponse = new LfpSale(); + $expectedResponse->setName($name); + $expectedResponse->setTargetAccount($targetAccount); + $expectedResponse->setStoreCode($storeCode); + $expectedResponse->setOfferId($offerId); + $expectedResponse->setRegionCode($regionCode); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setGtin($gtin); + $expectedResponse->setQuantity($quantity); + $expectedResponse->setUid($uid); + $expectedResponse->setFeedLabel($feedLabel); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $lfpSale = new LfpSale(); + $lfpSaleTargetAccount = 1054087489; + $lfpSale->setTargetAccount($lfpSaleTargetAccount); + $lfpSaleStoreCode = 'lfpSaleStoreCode344053585'; + $lfpSale->setStoreCode($lfpSaleStoreCode); + $lfpSaleOfferId = 'lfpSaleOfferId353693242'; + $lfpSale->setOfferId($lfpSaleOfferId); + $lfpSaleRegionCode = 'lfpSaleRegionCode-811190658'; + $lfpSale->setRegionCode($lfpSaleRegionCode); + $lfpSaleContentLanguage = 'lfpSaleContentLanguage1086341524'; + $lfpSale->setContentLanguage($lfpSaleContentLanguage); + $lfpSaleGtin = 'lfpSaleGtin2062138383'; + $lfpSale->setGtin($lfpSaleGtin); + $lfpSalePrice = new Price(); + $lfpSale->setPrice($lfpSalePrice); + $lfpSaleQuantity = 1858119496; + $lfpSale->setQuantity($lfpSaleQuantity); + $lfpSaleSaleTime = new Timestamp(); + $lfpSale->setSaleTime($lfpSaleSaleTime); + $request = (new InsertLfpSaleRequest())->setParent($parent)->setLfpSale($lfpSale); + $response = $gapicClient->insertLfpSale($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.lfp.v1beta.LfpSaleService/InsertLfpSale', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getLfpSale(); + $this->assertProtobufEquals($lfpSale, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertLfpSaleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $lfpSale = new LfpSale(); + $lfpSaleTargetAccount = 1054087489; + $lfpSale->setTargetAccount($lfpSaleTargetAccount); + $lfpSaleStoreCode = 'lfpSaleStoreCode344053585'; + $lfpSale->setStoreCode($lfpSaleStoreCode); + $lfpSaleOfferId = 'lfpSaleOfferId353693242'; + $lfpSale->setOfferId($lfpSaleOfferId); + $lfpSaleRegionCode = 'lfpSaleRegionCode-811190658'; + $lfpSale->setRegionCode($lfpSaleRegionCode); + $lfpSaleContentLanguage = 'lfpSaleContentLanguage1086341524'; + $lfpSale->setContentLanguage($lfpSaleContentLanguage); + $lfpSaleGtin = 'lfpSaleGtin2062138383'; + $lfpSale->setGtin($lfpSaleGtin); + $lfpSalePrice = new Price(); + $lfpSale->setPrice($lfpSalePrice); + $lfpSaleQuantity = 1858119496; + $lfpSale->setQuantity($lfpSaleQuantity); + $lfpSaleSaleTime = new Timestamp(); + $lfpSale->setSaleTime($lfpSaleSaleTime); + $request = (new InsertLfpSaleRequest())->setParent($parent)->setLfpSale($lfpSale); + try { + $gapicClient->insertLfpSale($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertLfpSaleAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $targetAccount = 475823745; + $storeCode = 'storeCode921424523'; + $offerId = 'offerId-768546338'; + $regionCode = 'regionCode-1566082984'; + $contentLanguage = 'contentLanguage-1408137122'; + $gtin = 'gtin3183314'; + $quantity = 1285004149; + $uid = 'uid115792'; + $feedLabel = 'feedLabel574920979'; + $expectedResponse = new LfpSale(); + $expectedResponse->setName($name); + $expectedResponse->setTargetAccount($targetAccount); + $expectedResponse->setStoreCode($storeCode); + $expectedResponse->setOfferId($offerId); + $expectedResponse->setRegionCode($regionCode); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setGtin($gtin); + $expectedResponse->setQuantity($quantity); + $expectedResponse->setUid($uid); + $expectedResponse->setFeedLabel($feedLabel); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $lfpSale = new LfpSale(); + $lfpSaleTargetAccount = 1054087489; + $lfpSale->setTargetAccount($lfpSaleTargetAccount); + $lfpSaleStoreCode = 'lfpSaleStoreCode344053585'; + $lfpSale->setStoreCode($lfpSaleStoreCode); + $lfpSaleOfferId = 'lfpSaleOfferId353693242'; + $lfpSale->setOfferId($lfpSaleOfferId); + $lfpSaleRegionCode = 'lfpSaleRegionCode-811190658'; + $lfpSale->setRegionCode($lfpSaleRegionCode); + $lfpSaleContentLanguage = 'lfpSaleContentLanguage1086341524'; + $lfpSale->setContentLanguage($lfpSaleContentLanguage); + $lfpSaleGtin = 'lfpSaleGtin2062138383'; + $lfpSale->setGtin($lfpSaleGtin); + $lfpSalePrice = new Price(); + $lfpSale->setPrice($lfpSalePrice); + $lfpSaleQuantity = 1858119496; + $lfpSale->setQuantity($lfpSaleQuantity); + $lfpSaleSaleTime = new Timestamp(); + $lfpSale->setSaleTime($lfpSaleSaleTime); + $request = (new InsertLfpSaleRequest())->setParent($parent)->setLfpSale($lfpSale); + $response = $gapicClient->insertLfpSaleAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.lfp.v1beta.LfpSaleService/InsertLfpSale', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getLfpSale(); + $this->assertProtobufEquals($lfpSale, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpStoreServiceClientTest.php b/ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpStoreServiceClientTest.php new file mode 100644 index 000000000000..81fb9b5cb032 --- /dev/null +++ b/ShoppingMerchantLfp/tests/Unit/V1beta/Client/LfpStoreServiceClientTest.php @@ -0,0 +1,409 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return LfpStoreServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LfpStoreServiceClient($options); + } + + /** @test */ + public function deleteLfpStoreTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lfpStoreName('[ACCOUNT]', '[TARGET_MERCHANT]', '[STORE_CODE]'); + $request = (new DeleteLfpStoreRequest())->setName($formattedName); + $gapicClient->deleteLfpStore($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.lfp.v1beta.LfpStoreService/DeleteLfpStore', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteLfpStoreExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lfpStoreName('[ACCOUNT]', '[TARGET_MERCHANT]', '[STORE_CODE]'); + $request = (new DeleteLfpStoreRequest())->setName($formattedName); + try { + $gapicClient->deleteLfpStore($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLfpStoreTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $targetAccount = 475823745; + $storeCode = 'storeCode921424523'; + $storeAddress = 'storeAddress-1067464042'; + $storeName = 'storeName921739049'; + $phoneNumber = 'phoneNumber-612351174'; + $websiteUri = 'websiteUri-2118185016'; + $placeId = 'placeId1858938707'; + $matchingStateHint = 'matchingStateHint-1034076425'; + $expectedResponse = new LfpStore(); + $expectedResponse->setName($name2); + $expectedResponse->setTargetAccount($targetAccount); + $expectedResponse->setStoreCode($storeCode); + $expectedResponse->setStoreAddress($storeAddress); + $expectedResponse->setStoreName($storeName); + $expectedResponse->setPhoneNumber($phoneNumber); + $expectedResponse->setWebsiteUri($websiteUri); + $expectedResponse->setPlaceId($placeId); + $expectedResponse->setMatchingStateHint($matchingStateHint); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lfpStoreName('[ACCOUNT]', '[TARGET_MERCHANT]', '[STORE_CODE]'); + $request = (new GetLfpStoreRequest())->setName($formattedName); + $response = $gapicClient->getLfpStore($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.lfp.v1beta.LfpStoreService/GetLfpStore', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLfpStoreExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lfpStoreName('[ACCOUNT]', '[TARGET_MERCHANT]', '[STORE_CODE]'); + $request = (new GetLfpStoreRequest())->setName($formattedName); + try { + $gapicClient->getLfpStore($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertLfpStoreTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $targetAccount = 475823745; + $storeCode = 'storeCode921424523'; + $storeAddress = 'storeAddress-1067464042'; + $storeName = 'storeName921739049'; + $phoneNumber = 'phoneNumber-612351174'; + $websiteUri = 'websiteUri-2118185016'; + $placeId = 'placeId1858938707'; + $matchingStateHint = 'matchingStateHint-1034076425'; + $expectedResponse = new LfpStore(); + $expectedResponse->setName($name); + $expectedResponse->setTargetAccount($targetAccount); + $expectedResponse->setStoreCode($storeCode); + $expectedResponse->setStoreAddress($storeAddress); + $expectedResponse->setStoreName($storeName); + $expectedResponse->setPhoneNumber($phoneNumber); + $expectedResponse->setWebsiteUri($websiteUri); + $expectedResponse->setPlaceId($placeId); + $expectedResponse->setMatchingStateHint($matchingStateHint); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $lfpStore = new LfpStore(); + $lfpStoreTargetAccount = 1057875153; + $lfpStore->setTargetAccount($lfpStoreTargetAccount); + $lfpStoreStoreCode = 'lfpStoreStoreCode1730784867'; + $lfpStore->setStoreCode($lfpStoreStoreCode); + $lfpStoreStoreAddress = 'lfpStoreStoreAddress-1359855682'; + $lfpStore->setStoreAddress($lfpStoreStoreAddress); + $request = (new InsertLfpStoreRequest())->setParent($formattedParent)->setLfpStore($lfpStore); + $response = $gapicClient->insertLfpStore($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.lfp.v1beta.LfpStoreService/InsertLfpStore', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getLfpStore(); + $this->assertProtobufEquals($lfpStore, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertLfpStoreExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $lfpStore = new LfpStore(); + $lfpStoreTargetAccount = 1057875153; + $lfpStore->setTargetAccount($lfpStoreTargetAccount); + $lfpStoreStoreCode = 'lfpStoreStoreCode1730784867'; + $lfpStore->setStoreCode($lfpStoreStoreCode); + $lfpStoreStoreAddress = 'lfpStoreStoreAddress-1359855682'; + $lfpStore->setStoreAddress($lfpStoreStoreAddress); + $request = (new InsertLfpStoreRequest())->setParent($formattedParent)->setLfpStore($lfpStore); + try { + $gapicClient->insertLfpStore($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLfpStoresTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $lfpStoresElement = new LfpStore(); + $lfpStores = [$lfpStoresElement]; + $expectedResponse = new ListLfpStoresResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLfpStores($lfpStores); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $targetAccount = 475823745; + $request = (new ListLfpStoresRequest())->setParent($formattedParent)->setTargetAccount($targetAccount); + $response = $gapicClient->listLfpStores($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLfpStores()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.lfp.v1beta.LfpStoreService/ListLfpStores', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTargetAccount(); + $this->assertProtobufEquals($targetAccount, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLfpStoresExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $targetAccount = 475823745; + $request = (new ListLfpStoresRequest())->setParent($formattedParent)->setTargetAccount($targetAccount); + try { + $gapicClient->listLfpStores($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteLfpStoreAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lfpStoreName('[ACCOUNT]', '[TARGET_MERCHANT]', '[STORE_CODE]'); + $request = (new DeleteLfpStoreRequest())->setName($formattedName); + $gapicClient->deleteLfpStoreAsync($request)->wait(); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.lfp.v1beta.LfpStoreService/DeleteLfpStore', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantNotifications/.OwlBot.yaml b/ShoppingMerchantNotifications/.OwlBot.yaml new file mode 100644 index 000000000000..ed64454b352e --- /dev/null +++ b/ShoppingMerchantNotifications/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/shopping/merchant/notifications/(v1beta)/.*-php/(.*) + dest: /owl-bot-staging/ShoppingMerchantNotifications/$1/$2 +api-name: ShoppingMerchantNotifications diff --git a/ShoppingMerchantNotifications/.gitattributes b/ShoppingMerchantNotifications/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/ShoppingMerchantNotifications/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/ShoppingMerchantNotifications/.github/pull_request_template.md b/ShoppingMerchantNotifications/.github/pull_request_template.md new file mode 100644 index 000000000000..b5a3dbcdaffd --- /dev/null +++ b/ShoppingMerchantNotifications/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `ShoppingMerchantNotifications/src`, and tests in `ShoppingMerchantNotifications/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/ShoppingMerchantNotifications/CONTRIBUTING.md b/ShoppingMerchantNotifications/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/ShoppingMerchantNotifications/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/ShoppingMerchantNotifications/LICENSE b/ShoppingMerchantNotifications/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/ShoppingMerchantNotifications/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/ShoppingMerchantNotifications/README.md b/ShoppingMerchantNotifications/README.md new file mode 100644 index 000000000000..9c0bb8642f38 --- /dev/null +++ b/ShoppingMerchantNotifications/README.md @@ -0,0 +1,45 @@ +# Google Shopping Merchant Notifications for PHP + +> Idiomatic PHP client for [Google Shopping Merchant Notifications](https://developers.google.com/merchant/api). + +[![Latest Stable Version](https://poser.pugx.org/google/shopping-merchant-notifications/v/stable)](https://packagist.org/packages/google/shopping-merchant-notifications) [![Packagist](https://img.shields.io/packagist/dm/google/shopping-merchant-notifications.svg)](https://packagist.org/packages/google/shopping-merchant-notifications) + +* [API documentation](https://cloud.google.com/php/docs/reference/shopping-merchant-notifications/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/shopping-merchant-notifications +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-shopping-merchant-notifications/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/merchant/api). diff --git a/ShoppingMerchantNotifications/VERSION b/ShoppingMerchantNotifications/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/ShoppingMerchantNotifications/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/ShoppingMerchantNotifications/composer.json b/ShoppingMerchantNotifications/composer.json new file mode 100644 index 000000000000..c2b0e36d4e59 --- /dev/null +++ b/ShoppingMerchantNotifications/composer.json @@ -0,0 +1,31 @@ +{ + "name": "google/shopping-merchant-notifications", + "description": "Google Shopping Merchant Notifications Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Shopping\\Merchant\\Notifications\\": "src", + "GPBMetadata\\Google\\Shopping\\Merchant\\Notifications\\": "metadata" + } + }, + "extra": { + "component": { + "id": "shopping-merchant-notifications", + "path": "ShoppingMerchantNotifications", + "target": "googleapis/php-shopping-merchant-notifications" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0", + "google/shopping-common-protos": "^0.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/ShoppingMerchantNotifications/metadata/V1Beta/Notificationsapi.php b/ShoppingMerchantNotifications/metadata/V1Beta/Notificationsapi.php new file mode 100644 index 0000000000000000000000000000000000000000..bb527803180fa63c9a73a9b5ed28a497ad3dafee GIT binary patch literal 5458 zcmcIoOHUhD6wW}x;}8f;A#offojQpiD6s`m)yRZaW8)aq0LzcGG2lMB7~}b&*vSwO#NFs;+wOod;uJ434N5mVF=Rp7WjWJnnt? zfwf`5O{qu>Vyl!ir22D-ZV<_`O=@apORBr;>%^8cbIa0O#7;}n!m6~gT9pb5OVxL9 zt7E#hMzT`VG@C7waW+iL(v4W)EyS5D~XA-_nUeyW8_fC#^<~Y^dA1 zX?M4^Onj1^TFDT5w7jro(dVZ>Fx<)&URIsW)9(!lT77Pj8vAmN-^{sk?|t28hTLd` zM0kW@HWj*#IdT$Sr(oeM;!C{eNl6D$nhv5g-4>;3FG`bF{6jH#G8*@}7pKX$BNOY) zu}a5jH#70?Un}sjaVPy7cK(HVgb}Xz+NR>#dg21N{0U4%4L?|4n}nO#nk_wA%FETI)fJ`ixUf=Hs-Kh!%Gye$RLJ90 zVPW)~coil}<<*6?d{wDbPR60iy!LK~+|mMI4Ti+4qi^8fbdD!-C>2lw)~KfmcIi23$Z6I?WRS(7&(CZ_53Rc#4rdQbeN z2X1ukkXm;)wyGFCK zxHCuddqnegER1&}EhmTc#q85|ejTtd@=(#%sHeN(XD6^<3vi=zN82^noy7%UUk(By z?6Ucd`%rvN$C0fY`^E2i;Cjan0wP z#h>M5P_>UwTQL b_b0 literal 0 HcmV?d00001 diff --git a/ShoppingMerchantNotifications/owlbot.py b/ShoppingMerchantNotifications/owlbot.py new file mode 100644 index 000000000000..c1f6f24f08ad --- /dev/null +++ b/ShoppingMerchantNotifications/owlbot.py @@ -0,0 +1,62 @@ +# Copyright 2023 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/ShoppingMerchantNotifications").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main( + src=src, + dest=dest, + copy_excludes=[ + src / "**/[A-Z]*_*.php", + ] +) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/ShoppingMerchantNotifications/phpunit.xml.dist b/ShoppingMerchantNotifications/phpunit.xml.dist new file mode 100644 index 000000000000..c1b2fb235513 --- /dev/null +++ b/ShoppingMerchantNotifications/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/create_notification_subscription.php b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/create_notification_subscription.php new file mode 100644 index 000000000000..7c48924874a8 --- /dev/null +++ b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/create_notification_subscription.php @@ -0,0 +1,85 @@ +setParent($formattedParent) + ->setNotificationSubscription($notificationSubscription); + + // Call the API and handle any network failures. + try { + /** @var NotificationSubscription $response */ + $response = $notificationsApiServiceClient->createNotificationSubscription($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 +{ + $formattedParent = NotificationsApiServiceClient::accountName('[ACCOUNT]'); + + create_notification_subscription_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_NotificationsApiService_CreateNotificationSubscription_sync] diff --git a/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/delete_notification_subscription.php b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/delete_notification_subscription.php new file mode 100644 index 000000000000..1899eacb4026 --- /dev/null +++ b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/delete_notification_subscription.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $notificationsApiServiceClient->deleteNotificationSubscription($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = NotificationsApiServiceClient::notificationSubscriptionName( + '[ACCOUNT]', + '[NOTIFICATION_SUBSCRIPTION]' + ); + + delete_notification_subscription_sample($formattedName); +} +// [END merchantapi_v1beta_generated_NotificationsApiService_DeleteNotificationSubscription_sync] diff --git a/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/get_notification_subscription.php b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/get_notification_subscription.php new file mode 100644 index 000000000000..c56b4c6d3973 --- /dev/null +++ b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/get_notification_subscription.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var NotificationSubscription $response */ + $response = $notificationsApiServiceClient->getNotificationSubscription($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 = NotificationsApiServiceClient::notificationSubscriptionName( + '[ACCOUNT]', + '[NOTIFICATION_SUBSCRIPTION]' + ); + + get_notification_subscription_sample($formattedName); +} +// [END merchantapi_v1beta_generated_NotificationsApiService_GetNotificationSubscription_sync] diff --git a/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/list_notification_subscriptions.php b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/list_notification_subscriptions.php new file mode 100644 index 000000000000..38a375d9005e --- /dev/null +++ b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/list_notification_subscriptions.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $notificationsApiServiceClient->listNotificationSubscriptions($request); + + /** @var NotificationSubscription $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = NotificationsApiServiceClient::accountName('[ACCOUNT]'); + + list_notification_subscriptions_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_NotificationsApiService_ListNotificationSubscriptions_sync] diff --git a/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/update_notification_subscription.php b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/update_notification_subscription.php new file mode 100644 index 000000000000..0a5077e5053a --- /dev/null +++ b/ShoppingMerchantNotifications/samples/V1beta/NotificationsApiServiceClient/update_notification_subscription.php @@ -0,0 +1,59 @@ +setNotificationSubscription($notificationSubscription); + + // Call the API and handle any network failures. + try { + /** @var NotificationSubscription $response */ + $response = $notificationsApiServiceClient->updateNotificationSubscription($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END merchantapi_v1beta_generated_NotificationsApiService_UpdateNotificationSubscription_sync] diff --git a/ShoppingMerchantNotifications/src/V1beta/Attribute.php b/ShoppingMerchantNotifications/src/V1beta/Attribute.php new file mode 100644 index 000000000000..cb02b67cd0a3 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/Attribute.php @@ -0,0 +1,55 @@ +google.shopping.merchant.notifications.v1beta.Attribute + */ +class Attribute +{ + /** + * Unspecified attribute + * + * Generated from protobuf enum ATTRIBUTE_UNSPECIFIED = 0; + */ + const ATTRIBUTE_UNSPECIFIED = 0; + /** + * Status of the changed entity + * + * Generated from protobuf enum STATUS = 1; + */ + const STATUS = 1; + + private static $valueToName = [ + self::ATTRIBUTE_UNSPECIFIED => 'ATTRIBUTE_UNSPECIFIED', + self::STATUS => 'STATUS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/Client/NotificationsApiServiceClient.php b/ShoppingMerchantNotifications/src/V1beta/Client/NotificationsApiServiceClient.php new file mode 100644 index 000000000000..946b2e52c72a --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/Client/NotificationsApiServiceClient.php @@ -0,0 +1,411 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/notifications_api_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/notifications_api_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/notifications_api_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/notifications_api_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * notification_subscription resource. + * + * @param string $account + * @param string $notificationSubscription + * + * @return string The formatted notification_subscription resource. + * + * @experimental + */ + public static function notificationSubscriptionName(string $account, string $notificationSubscription): string + { + return self::getPathTemplate('notificationSubscription')->render([ + 'account' => $account, + 'notification_subscription' => $notificationSubscription, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - notificationSubscription: accounts/{account}/notificationsubscriptions/{notification_subscription} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a notification subscription for a merchant. We will allow the + * following types of notification subscriptions to exist together (per + * merchant as a subscriber per event type): + * 1. Subscription for all managed accounts + subscription for self + * 2. Multiple "partial" subscriptions for managed accounts + subscription + * for self + * + * we will not allow (per merchant as a subscriber per event type): + * 1. multiple self subscriptions. + * 2. multiple "all managed accounts" subscriptions. + * 3. all and partial subscriptions at the same time. + * 4. multiple partial subscriptions for the same target account + * + * The async variant is + * {@see NotificationsApiServiceClient::createNotificationSubscriptionAsync()} . + * + * @example samples/V1beta/NotificationsApiServiceClient/create_notification_subscription.php + * + * @param CreateNotificationSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationSubscription + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createNotificationSubscription( + CreateNotificationSubscriptionRequest $request, + array $callOptions = [] + ): NotificationSubscription { + return $this->startApiCall('CreateNotificationSubscription', $request, $callOptions)->wait(); + } + + /** + * Deletes a notification subscription for a merchant. + * + * The async variant is + * {@see NotificationsApiServiceClient::deleteNotificationSubscriptionAsync()} . + * + * @example samples/V1beta/NotificationsApiServiceClient/delete_notification_subscription.php + * + * @param DeleteNotificationSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteNotificationSubscription( + DeleteNotificationSubscriptionRequest $request, + array $callOptions = [] + ): void { + $this->startApiCall('DeleteNotificationSubscription', $request, $callOptions)->wait(); + } + + /** + * Gets notification subscriptions for an account. + * + * The async variant is + * {@see NotificationsApiServiceClient::getNotificationSubscriptionAsync()} . + * + * @example samples/V1beta/NotificationsApiServiceClient/get_notification_subscription.php + * + * @param GetNotificationSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationSubscription + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getNotificationSubscription( + GetNotificationSubscriptionRequest $request, + array $callOptions = [] + ): NotificationSubscription { + return $this->startApiCall('GetNotificationSubscription', $request, $callOptions)->wait(); + } + + /** + * Gets all the notification subscriptions for a merchant. + * + * The async variant is + * {@see NotificationsApiServiceClient::listNotificationSubscriptionsAsync()} . + * + * @example samples/V1beta/NotificationsApiServiceClient/list_notification_subscriptions.php + * + * @param ListNotificationSubscriptionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listNotificationSubscriptions( + ListNotificationSubscriptionsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListNotificationSubscriptions', $request, $callOptions); + } + + /** + * Updates an existing notification subscription for a merchant. + * + * The async variant is + * {@see NotificationsApiServiceClient::updateNotificationSubscriptionAsync()} . + * + * @example samples/V1beta/NotificationsApiServiceClient/update_notification_subscription.php + * + * @param UpdateNotificationSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationSubscription + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateNotificationSubscription( + UpdateNotificationSubscriptionRequest $request, + array $callOptions = [] + ): NotificationSubscription { + return $this->startApiCall('UpdateNotificationSubscription', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantNotifications/src/V1beta/CreateNotificationSubscriptionRequest.php b/ShoppingMerchantNotifications/src/V1beta/CreateNotificationSubscriptionRequest.php new file mode 100644 index 000000000000..a5e24b3dec22 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/CreateNotificationSubscriptionRequest.php @@ -0,0 +1,132 @@ +google.shopping.merchant.notifications.v1beta.CreateNotificationSubscriptionRequest + */ +class CreateNotificationSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The merchant account that owns the new notification subscription. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The notification subscription to create. + * + * Generated from protobuf field .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $notification_subscription = null; + + /** + * @param string $parent Required. The merchant account that owns the new notification subscription. + * Format: `accounts/{account}` + * Please see {@see NotificationsApiServiceClient::accountName()} for help formatting this field. + * @param \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription $notificationSubscription Required. The notification subscription to create. + * + * @return \Google\Shopping\Merchant\Notifications\V1beta\CreateNotificationSubscriptionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription $notificationSubscription): self + { + return (new self()) + ->setParent($parent) + ->setNotificationSubscription($notificationSubscription); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The merchant account that owns the new notification subscription. + * Format: `accounts/{account}` + * @type \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription $notification_subscription + * Required. The notification subscription to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Notifications\V1Beta\Notificationsapi::initOnce(); + parent::__construct($data); + } + + /** + * Required. The merchant account that owns the new notification subscription. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The merchant account that owns the new notification subscription. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The notification subscription to create. + * + * Generated from protobuf field .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription|null + */ + public function getNotificationSubscription() + { + return $this->notification_subscription; + } + + public function hasNotificationSubscription() + { + return isset($this->notification_subscription); + } + + public function clearNotificationSubscription() + { + unset($this->notification_subscription); + } + + /** + * Required. The notification subscription to create. + * + * Generated from protobuf field .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription $var + * @return $this + */ + public function setNotificationSubscription($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription::class); + $this->notification_subscription = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/DeleteNotificationSubscriptionRequest.php b/ShoppingMerchantNotifications/src/V1beta/DeleteNotificationSubscriptionRequest.php new file mode 100644 index 000000000000..dafc3e4463ca --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/DeleteNotificationSubscriptionRequest.php @@ -0,0 +1,81 @@ +google.shopping.merchant.notifications.v1beta.DeleteNotificationSubscriptionRequest + */ +class DeleteNotificationSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the notification subscription to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the notification subscription to be deleted. Please see + * {@see NotificationsApiServiceClient::notificationSubscriptionName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Notifications\V1beta\DeleteNotificationSubscriptionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the notification subscription to be deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Notifications\V1Beta\Notificationsapi::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the notification subscription to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the notification subscription to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/GetNotificationSubscriptionRequest.php b/ShoppingMerchantNotifications/src/V1beta/GetNotificationSubscriptionRequest.php new file mode 100644 index 000000000000..9fc0826fb173 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/GetNotificationSubscriptionRequest.php @@ -0,0 +1,81 @@ +google.shopping.merchant.notifications.v1beta.GetNotificationSubscriptionRequest + */ +class GetNotificationSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `name` of the notification subscription. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The `name` of the notification subscription. Please see + * {@see NotificationsApiServiceClient::notificationSubscriptionName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Notifications\V1beta\GetNotificationSubscriptionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The `name` of the notification subscription. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Notifications\V1Beta\Notificationsapi::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `name` of the notification subscription. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The `name` of the notification subscription. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/ListNotificationSubscriptionsRequest.php b/ShoppingMerchantNotifications/src/V1beta/ListNotificationSubscriptionsRequest.php new file mode 100644 index 000000000000..e6dc5df062bd --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/ListNotificationSubscriptionsRequest.php @@ -0,0 +1,166 @@ +google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsRequest + */ +class ListNotificationSubscriptionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The merchant account who owns the notification subscriptions. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of notification subscriptions to return in a page. + * The default value for `page_size` is 100. The + * maximum value is `200`. Values above `200` will be coerced to `200`. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Token (if provided) to retrieve the subsequent page. All other parameters + * must match the original call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The merchant account who owns the notification subscriptions. + * Format: `accounts/{account}` + * Please see {@see NotificationsApiServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Notifications\V1beta\ListNotificationSubscriptionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The merchant account who owns the notification subscriptions. + * Format: `accounts/{account}` + * @type int $page_size + * The maximum number of notification subscriptions to return in a page. + * The default value for `page_size` is 100. The + * maximum value is `200`. Values above `200` will be coerced to `200`. + * @type string $page_token + * Token (if provided) to retrieve the subsequent page. All other parameters + * must match the original call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Notifications\V1Beta\Notificationsapi::initOnce(); + parent::__construct($data); + } + + /** + * Required. The merchant account who owns the notification subscriptions. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The merchant account who owns the notification subscriptions. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of notification subscriptions to return in a page. + * The default value for `page_size` is 100. The + * maximum value is `200`. Values above `200` will be coerced to `200`. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of notification subscriptions to return in a page. + * The default value for `page_size` is 100. The + * maximum value is `200`. Values above `200` will be coerced to `200`. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Token (if provided) to retrieve the subsequent page. All other parameters + * must match the original call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Token (if provided) to retrieve the subsequent page. All other parameters + * must match the original call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/ListNotificationSubscriptionsResponse.php b/ShoppingMerchantNotifications/src/V1beta/ListNotificationSubscriptionsResponse.php new file mode 100644 index 000000000000..025a2024795d --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/ListNotificationSubscriptionsResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.notifications.v1beta.ListNotificationSubscriptionsResponse + */ +class ListNotificationSubscriptionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of notification subscriptions requested by the merchant. + * + * Generated from protobuf field repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + */ + private $notification_subscriptions; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription>|\Google\Protobuf\Internal\RepeatedField $notification_subscriptions + * The list of notification subscriptions requested by the merchant. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Notifications\V1Beta\Notificationsapi::initOnce(); + parent::__construct($data); + } + + /** + * The list of notification subscriptions requested by the merchant. + * + * Generated from protobuf field repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotificationSubscriptions() + { + return $this->notification_subscriptions; + } + + /** + * The list of notification subscriptions requested by the merchant. + * + * Generated from protobuf field repeated .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscriptions = 1; + * @param array<\Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotificationSubscriptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription::class); + $this->notification_subscriptions = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/NotificationSubscription.php b/ShoppingMerchantNotifications/src/V1beta/NotificationSubscription.php new file mode 100644 index 000000000000..356de59ca41d --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/NotificationSubscription.php @@ -0,0 +1,235 @@ +google.shopping.merchant.notifications.v1beta.NotificationSubscription + */ +class NotificationSubscription extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The `name` of the notification configuration. Generated by the + * Content API upon creation of a new `NotificationSubscription`. The + * `account` represents the merchant ID of the merchant that owns the + * configuration. Format: + * `accounts/{account}/notificationsubscriptions/{notification_subscription}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The event that the merchant wants to be notified about. + * + * Generated from protobuf field .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + */ + protected $registered_event = 0; + /** + * URL to be used to push the notification to the merchant. + * + * Generated from protobuf field string call_back_uri = 5; + */ + protected $call_back_uri = ''; + protected $interested_in; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $all_managed_accounts + * If this value is true, the requesting account is notified of the + * specified event for all managed accounts (can be subaccounts or other + * linked accounts) including newly added accounts on a daily basis. + * @type string $target_account + * The `name` of the account you want to receive notifications for. + * Format: `accounts/{account}` + * @type string $name + * Output only. The `name` of the notification configuration. Generated by the + * Content API upon creation of a new `NotificationSubscription`. The + * `account` represents the merchant ID of the merchant that owns the + * configuration. Format: + * `accounts/{account}/notificationsubscriptions/{notification_subscription}` + * @type int $registered_event + * The event that the merchant wants to be notified about. + * @type string $call_back_uri + * URL to be used to push the notification to the merchant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Notifications\V1Beta\Notificationsapi::initOnce(); + parent::__construct($data); + } + + /** + * If this value is true, the requesting account is notified of the + * specified event for all managed accounts (can be subaccounts or other + * linked accounts) including newly added accounts on a daily basis. + * + * Generated from protobuf field bool all_managed_accounts = 3; + * @return bool + */ + public function getAllManagedAccounts() + { + return $this->readOneof(3); + } + + public function hasAllManagedAccounts() + { + return $this->hasOneof(3); + } + + /** + * If this value is true, the requesting account is notified of the + * specified event for all managed accounts (can be subaccounts or other + * linked accounts) including newly added accounts on a daily basis. + * + * Generated from protobuf field bool all_managed_accounts = 3; + * @param bool $var + * @return $this + */ + public function setAllManagedAccounts($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The `name` of the account you want to receive notifications for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string target_account = 4; + * @return string + */ + public function getTargetAccount() + { + return $this->readOneof(4); + } + + public function hasTargetAccount() + { + return $this->hasOneof(4); + } + + /** + * The `name` of the account you want to receive notifications for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string target_account = 4; + * @param string $var + * @return $this + */ + public function setTargetAccount($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Output only. The `name` of the notification configuration. Generated by the + * Content API upon creation of a new `NotificationSubscription`. The + * `account` represents the merchant ID of the merchant that owns the + * configuration. Format: + * `accounts/{account}/notificationsubscriptions/{notification_subscription}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The `name` of the notification configuration. Generated by the + * Content API upon creation of a new `NotificationSubscription`. The + * `account` represents the merchant ID of the merchant that owns the + * configuration. Format: + * `accounts/{account}/notificationsubscriptions/{notification_subscription}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The event that the merchant wants to be notified about. + * + * Generated from protobuf field .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * @return int + */ + public function getRegisteredEvent() + { + return $this->registered_event; + } + + /** + * The event that the merchant wants to be notified about. + * + * Generated from protobuf field .google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType registered_event = 2; + * @param int $var + * @return $this + */ + public function setRegisteredEvent($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription\NotificationEventType::class); + $this->registered_event = $var; + + return $this; + } + + /** + * URL to be used to push the notification to the merchant. + * + * Generated from protobuf field string call_back_uri = 5; + * @return string + */ + public function getCallBackUri() + { + return $this->call_back_uri; + } + + /** + * URL to be used to push the notification to the merchant. + * + * Generated from protobuf field string call_back_uri = 5; + * @param string $var + * @return $this + */ + public function setCallBackUri($var) + { + GPBUtil::checkString($var, True); + $this->call_back_uri = $var; + + return $this; + } + + /** + * @return string + */ + public function getInterestedIn() + { + return $this->whichOneof("interested_in"); + } + +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/NotificationSubscription/NotificationEventType.php b/ShoppingMerchantNotifications/src/V1beta/NotificationSubscription/NotificationEventType.php new file mode 100644 index 000000000000..ed880b2c4f5d --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/NotificationSubscription/NotificationEventType.php @@ -0,0 +1,57 @@ +google.shopping.merchant.notifications.v1beta.NotificationSubscription.NotificationEventType + */ +class NotificationEventType +{ + /** + * Notifications event type is unspecified. + * + * Generated from protobuf enum NOTIFICATION_EVENT_TYPE_UNSPECIFIED = 0; + */ + const NOTIFICATION_EVENT_TYPE_UNSPECIFIED = 0; + /** + * Notification of product status changes, for example when product becomes + * disapproved. + * + * Generated from protobuf enum PRODUCT_STATUS_CHANGE = 1; + */ + const PRODUCT_STATUS_CHANGE = 1; + + private static $valueToName = [ + self::NOTIFICATION_EVENT_TYPE_UNSPECIFIED => 'NOTIFICATION_EVENT_TYPE_UNSPECIFIED', + self::PRODUCT_STATUS_CHANGE => 'PRODUCT_STATUS_CHANGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantNotifications/src/V1beta/ProductChange.php b/ShoppingMerchantNotifications/src/V1beta/ProductChange.php new file mode 100644 index 000000000000..e762b0a1191a --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/ProductChange.php @@ -0,0 +1,210 @@ +google.shopping.merchant.notifications.v1beta.ProductChange + */ +class ProductChange extends \Google\Protobuf\Internal\Message +{ + /** + * The old value of the changed resource or attribute. + * + * Generated from protobuf field optional string old_value = 1; + */ + protected $old_value = null; + /** + * The new value of the changed resource or attribute. + * + * Generated from protobuf field optional string new_value = 2; + */ + protected $new_value = null; + /** + * Countries that have the change (if applicable) + * + * Generated from protobuf field optional string region_code = 3; + */ + protected $region_code = null; + /** + * Reporting contexts that have the change (if applicable) + * + * Generated from protobuf field optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + */ + protected $reporting_context = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $old_value + * The old value of the changed resource or attribute. + * @type string $new_value + * The new value of the changed resource or attribute. + * @type string $region_code + * Countries that have the change (if applicable) + * @type int $reporting_context + * Reporting contexts that have the change (if applicable) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Notifications\V1Beta\Notificationsapi::initOnce(); + parent::__construct($data); + } + + /** + * The old value of the changed resource or attribute. + * + * Generated from protobuf field optional string old_value = 1; + * @return string + */ + public function getOldValue() + { + return isset($this->old_value) ? $this->old_value : ''; + } + + public function hasOldValue() + { + return isset($this->old_value); + } + + public function clearOldValue() + { + unset($this->old_value); + } + + /** + * The old value of the changed resource or attribute. + * + * Generated from protobuf field optional string old_value = 1; + * @param string $var + * @return $this + */ + public function setOldValue($var) + { + GPBUtil::checkString($var, True); + $this->old_value = $var; + + return $this; + } + + /** + * The new value of the changed resource or attribute. + * + * Generated from protobuf field optional string new_value = 2; + * @return string + */ + public function getNewValue() + { + return isset($this->new_value) ? $this->new_value : ''; + } + + public function hasNewValue() + { + return isset($this->new_value); + } + + public function clearNewValue() + { + unset($this->new_value); + } + + /** + * The new value of the changed resource or attribute. + * + * Generated from protobuf field optional string new_value = 2; + * @param string $var + * @return $this + */ + public function setNewValue($var) + { + GPBUtil::checkString($var, True); + $this->new_value = $var; + + return $this; + } + + /** + * Countries that have the change (if applicable) + * + * Generated from protobuf field optional string region_code = 3; + * @return string + */ + public function getRegionCode() + { + return isset($this->region_code) ? $this->region_code : ''; + } + + public function hasRegionCode() + { + return isset($this->region_code); + } + + public function clearRegionCode() + { + unset($this->region_code); + } + + /** + * Countries that have the change (if applicable) + * + * Generated from protobuf field optional string region_code = 3; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Reporting contexts that have the change (if applicable) + * + * Generated from protobuf field optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * @return int + */ + public function getReportingContext() + { + return isset($this->reporting_context) ? $this->reporting_context : 0; + } + + public function hasReportingContext() + { + return isset($this->reporting_context); + } + + public function clearReportingContext() + { + unset($this->reporting_context); + } + + /** + * Reporting contexts that have the change (if applicable) + * + * Generated from protobuf field optional .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 4; + * @param int $var + * @return $this + */ + public function setReportingContext($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Type\ReportingContext\ReportingContextEnum::class); + $this->reporting_context = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/ProductStatusChangeMessage.php b/ShoppingMerchantNotifications/src/V1beta/ProductStatusChangeMessage.php new file mode 100644 index 000000000000..2f9f4a5ff587 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/ProductStatusChangeMessage.php @@ -0,0 +1,352 @@ +google.shopping.merchant.notifications.v1beta.ProductStatusChangeMessage + */ +class ProductStatusChangeMessage extends \Google\Protobuf\Internal\Message +{ + /** + * The target account that owns the entity that changed. + * Format : `accounts/{merchant_id}` + * + * Generated from protobuf field optional string account = 1; + */ + protected $account = null; + /** + * The account that manages the merchant's account. can be the same as + * merchant id if it is standalone account. Format : + * `accounts/{service_provider_id}` + * + * Generated from protobuf field optional string managing_account = 2; + */ + protected $managing_account = null; + /** + * The resource that changed, in this case it will always be `Product`. + * + * Generated from protobuf field optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + */ + protected $resource_type = null; + /** + * The attribute in the resource that changed, in this case it will be always + * `Status`. + * + * Generated from protobuf field optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + */ + protected $attribute = null; + /** + * A message to describe the change that happened to the product + * + * Generated from protobuf field repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + */ + private $changes; + /** + * The product id. + * + * Generated from protobuf field optional string resource_id = 6; + */ + protected $resource_id = null; + /** + * The product name. + * Format: `{product.name=accounts/{account}/products/{product}}` + * + * Generated from protobuf field optional string resource = 7; + */ + protected $resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $account + * The target account that owns the entity that changed. + * Format : `accounts/{merchant_id}` + * @type string $managing_account + * The account that manages the merchant's account. can be the same as + * merchant id if it is standalone account. Format : + * `accounts/{service_provider_id}` + * @type int $resource_type + * The resource that changed, in this case it will always be `Product`. + * @type int $attribute + * The attribute in the resource that changed, in this case it will be always + * `Status`. + * @type array<\Google\Shopping\Merchant\Notifications\V1beta\ProductChange>|\Google\Protobuf\Internal\RepeatedField $changes + * A message to describe the change that happened to the product + * @type string $resource_id + * The product id. + * @type string $resource + * The product name. + * Format: `{product.name=accounts/{account}/products/{product}}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Notifications\V1Beta\Notificationsapi::initOnce(); + parent::__construct($data); + } + + /** + * The target account that owns the entity that changed. + * Format : `accounts/{merchant_id}` + * + * Generated from protobuf field optional string account = 1; + * @return string + */ + public function getAccount() + { + return isset($this->account) ? $this->account : ''; + } + + public function hasAccount() + { + return isset($this->account); + } + + public function clearAccount() + { + unset($this->account); + } + + /** + * The target account that owns the entity that changed. + * Format : `accounts/{merchant_id}` + * + * Generated from protobuf field optional string account = 1; + * @param string $var + * @return $this + */ + public function setAccount($var) + { + GPBUtil::checkString($var, True); + $this->account = $var; + + return $this; + } + + /** + * The account that manages the merchant's account. can be the same as + * merchant id if it is standalone account. Format : + * `accounts/{service_provider_id}` + * + * Generated from protobuf field optional string managing_account = 2; + * @return string + */ + public function getManagingAccount() + { + return isset($this->managing_account) ? $this->managing_account : ''; + } + + public function hasManagingAccount() + { + return isset($this->managing_account); + } + + public function clearManagingAccount() + { + unset($this->managing_account); + } + + /** + * The account that manages the merchant's account. can be the same as + * merchant id if it is standalone account. Format : + * `accounts/{service_provider_id}` + * + * Generated from protobuf field optional string managing_account = 2; + * @param string $var + * @return $this + */ + public function setManagingAccount($var) + { + GPBUtil::checkString($var, True); + $this->managing_account = $var; + + return $this; + } + + /** + * The resource that changed, in this case it will always be `Product`. + * + * Generated from protobuf field optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * @return int + */ + public function getResourceType() + { + return isset($this->resource_type) ? $this->resource_type : 0; + } + + public function hasResourceType() + { + return isset($this->resource_type); + } + + public function clearResourceType() + { + unset($this->resource_type); + } + + /** + * The resource that changed, in this case it will always be `Product`. + * + * Generated from protobuf field optional .google.shopping.merchant.notifications.v1beta.Resource resource_type = 3; + * @param int $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Notifications\V1beta\Resource::class); + $this->resource_type = $var; + + return $this; + } + + /** + * The attribute in the resource that changed, in this case it will be always + * `Status`. + * + * Generated from protobuf field optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * @return int + */ + public function getAttribute() + { + return isset($this->attribute) ? $this->attribute : 0; + } + + public function hasAttribute() + { + return isset($this->attribute); + } + + public function clearAttribute() + { + unset($this->attribute); + } + + /** + * The attribute in the resource that changed, in this case it will be always + * `Status`. + * + * Generated from protobuf field optional .google.shopping.merchant.notifications.v1beta.Attribute attribute = 4; + * @param int $var + * @return $this + */ + public function setAttribute($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Notifications\V1beta\Attribute::class); + $this->attribute = $var; + + return $this; + } + + /** + * A message to describe the change that happened to the product + * + * Generated from protobuf field repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChanges() + { + return $this->changes; + } + + /** + * A message to describe the change that happened to the product + * + * Generated from protobuf field repeated .google.shopping.merchant.notifications.v1beta.ProductChange changes = 5; + * @param array<\Google\Shopping\Merchant\Notifications\V1beta\ProductChange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Notifications\V1beta\ProductChange::class); + $this->changes = $arr; + + return $this; + } + + /** + * The product id. + * + * Generated from protobuf field optional string resource_id = 6; + * @return string + */ + public function getResourceId() + { + return isset($this->resource_id) ? $this->resource_id : ''; + } + + public function hasResourceId() + { + return isset($this->resource_id); + } + + public function clearResourceId() + { + unset($this->resource_id); + } + + /** + * The product id. + * + * Generated from protobuf field optional string resource_id = 6; + * @param string $var + * @return $this + */ + public function setResourceId($var) + { + GPBUtil::checkString($var, True); + $this->resource_id = $var; + + return $this; + } + + /** + * The product name. + * Format: `{product.name=accounts/{account}/products/{product}}` + * + * Generated from protobuf field optional string resource = 7; + * @return string + */ + public function getResource() + { + return isset($this->resource) ? $this->resource : ''; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * The product name. + * Format: `{product.name=accounts/{account}/products/{product}}` + * + * Generated from protobuf field optional string resource = 7; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/Resource.php b/ShoppingMerchantNotifications/src/V1beta/Resource.php new file mode 100644 index 000000000000..bc8d5172fd82 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/Resource.php @@ -0,0 +1,55 @@ +google.shopping.merchant.notifications.v1beta.Resource + */ +class Resource +{ + /** + * Unspecified resource + * + * Generated from protobuf enum RESOURCE_UNSPECIFIED = 0; + */ + const RESOURCE_UNSPECIFIED = 0; + /** + * Resource type : product + * + * Generated from protobuf enum PRODUCT = 1; + */ + const PRODUCT = 1; + + private static $valueToName = [ + self::RESOURCE_UNSPECIFIED => 'RESOURCE_UNSPECIFIED', + self::PRODUCT => 'PRODUCT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/UpdateNotificationSubscriptionRequest.php b/ShoppingMerchantNotifications/src/V1beta/UpdateNotificationSubscriptionRequest.php new file mode 100644 index 000000000000..290aa83e1749 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/UpdateNotificationSubscriptionRequest.php @@ -0,0 +1,141 @@ +google.shopping.merchant.notifications.v1beta.UpdateNotificationSubscriptionRequest + */ +class UpdateNotificationSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new version of the notification subscription that should be + * updated. + * + * Generated from protobuf field .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $notification_subscription = null; + /** + * List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription $notificationSubscription Required. The new version of the notification subscription that should be + * updated. + * @param \Google\Protobuf\FieldMask $updateMask List of fields being updated. + * + * @return \Google\Shopping\Merchant\Notifications\V1beta\UpdateNotificationSubscriptionRequest + * + * @experimental + */ + public static function build(\Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription $notificationSubscription, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setNotificationSubscription($notificationSubscription) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription $notification_subscription + * Required. The new version of the notification subscription that should be + * updated. + * @type \Google\Protobuf\FieldMask $update_mask + * List of fields being updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Notifications\V1Beta\Notificationsapi::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new version of the notification subscription that should be + * updated. + * + * Generated from protobuf field .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription|null + */ + public function getNotificationSubscription() + { + return $this->notification_subscription; + } + + public function hasNotificationSubscription() + { + return isset($this->notification_subscription); + } + + public function clearNotificationSubscription() + { + unset($this->notification_subscription); + } + + /** + * Required. The new version of the notification subscription that should be + * updated. + * + * Generated from protobuf field .google.shopping.merchant.notifications.v1beta.NotificationSubscription notification_subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription $var + * @return $this + */ + public function setNotificationSubscription($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription::class); + $this->notification_subscription = $var; + + return $this; + } + + /** + * List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * List of fields being updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantNotifications/src/V1beta/gapic_metadata.json b/ShoppingMerchantNotifications/src/V1beta/gapic_metadata.json new file mode 100644 index 000000000000..dd4017020fa4 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.shopping.merchant.notifications.v1beta", + "libraryPackage": "Google\\Shopping\\Merchant\\Notifications\\V1beta", + "services": { + "NotificationsApiService": { + "clients": { + "grpc": { + "libraryClient": "NotificationsApiServiceGapicClient", + "rpcs": { + "CreateNotificationSubscription": { + "methods": [ + "createNotificationSubscription" + ] + }, + "DeleteNotificationSubscription": { + "methods": [ + "deleteNotificationSubscription" + ] + }, + "GetNotificationSubscription": { + "methods": [ + "getNotificationSubscription" + ] + }, + "ListNotificationSubscriptions": { + "methods": [ + "listNotificationSubscriptions" + ] + }, + "UpdateNotificationSubscription": { + "methods": [ + "updateNotificationSubscription" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_client_config.json b/ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_client_config.json new file mode 100644 index 000000000000..7363f5f4e9f6 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "google.shopping.merchant.notifications.v1beta.NotificationsApiService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateNotificationSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteNotificationSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetNotificationSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListNotificationSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateNotificationSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_descriptor_config.php b/ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_descriptor_config.php new file mode 100644 index 000000000000..56616d6a8995 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_descriptor_config.php @@ -0,0 +1,101 @@ + [ + 'google.shopping.merchant.notifications.v1beta.NotificationsApiService' => [ + 'CreateNotificationSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteNotificationSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListNotificationSubscriptions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNotificationSubscriptions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Notifications\V1beta\ListNotificationSubscriptionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateNotificationSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Notifications\V1beta\NotificationSubscription', + 'headerParams' => [ + [ + 'keyName' => 'notification_subscription.name', + 'fieldAccessors' => [ + 'getNotificationSubscription', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'notificationSubscription' => 'accounts/{account}/notificationsubscriptions/{notification_subscription}', + ], + ], + ], +]; diff --git a/ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_rest_client_config.php b/ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_rest_client_config.php new file mode 100644 index 000000000000..0413910f4426 --- /dev/null +++ b/ShoppingMerchantNotifications/src/V1beta/resources/notifications_api_service_rest_client_config.php @@ -0,0 +1,87 @@ + [ + 'google.shopping.merchant.notifications.v1beta.NotificationsApiService' => [ + 'CreateNotificationSubscription' => [ + 'method' => 'post', + 'uriTemplate' => '/notifications/v1beta/{parent=accounts/*}/notificationsubscriptions', + 'body' => 'notification_subscription', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteNotificationSubscription' => [ + 'method' => 'delete', + 'uriTemplate' => '/notifications/v1beta/{name=accounts/*/notificationsubscriptions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationSubscription' => [ + 'method' => 'get', + 'uriTemplate' => '/notifications/v1beta/{name=accounts/*/notificationsubscriptions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListNotificationSubscriptions' => [ + 'method' => 'get', + 'uriTemplate' => '/notifications/v1beta/{parent=accounts/*}/notificationsubscriptions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateNotificationSubscription' => [ + 'method' => 'patch', + 'uriTemplate' => '/notifications/v1beta/{notification_subscription.name=accounts/*/notificationsubscriptions/*}', + 'body' => 'notification_subscription', + 'placeholders' => [ + 'notification_subscription.name' => [ + 'getters' => [ + 'getNotificationSubscription', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantNotifications/tests/Unit/V1beta/Client/NotificationsApiServiceClientTest.php b/ShoppingMerchantNotifications/tests/Unit/V1beta/Client/NotificationsApiServiceClientTest.php new file mode 100644 index 000000000000..00ed872b4476 --- /dev/null +++ b/ShoppingMerchantNotifications/tests/Unit/V1beta/Client/NotificationsApiServiceClientTest.php @@ -0,0 +1,477 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return NotificationsApiServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NotificationsApiServiceClient($options); + } + + /** @test */ + public function createNotificationSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $allManagedAccounts = true; + $name = 'name3373707'; + $callBackUri = 'callBackUri-1975013675'; + $expectedResponse = new NotificationSubscription(); + $expectedResponse->setAllManagedAccounts($allManagedAccounts); + $expectedResponse->setName($name); + $expectedResponse->setCallBackUri($callBackUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $notificationSubscription = new NotificationSubscription(); + $request = (new CreateNotificationSubscriptionRequest()) + ->setParent($formattedParent) + ->setNotificationSubscription($notificationSubscription); + $response = $gapicClient->createNotificationSubscription($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.notifications.v1beta.NotificationsApiService/CreateNotificationSubscription', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getNotificationSubscription(); + $this->assertProtobufEquals($notificationSubscription, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createNotificationSubscriptionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $notificationSubscription = new NotificationSubscription(); + $request = (new CreateNotificationSubscriptionRequest()) + ->setParent($formattedParent) + ->setNotificationSubscription($notificationSubscription); + try { + $gapicClient->createNotificationSubscription($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteNotificationSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationSubscriptionName('[ACCOUNT]', '[NOTIFICATION_SUBSCRIPTION]'); + $request = (new DeleteNotificationSubscriptionRequest())->setName($formattedName); + $gapicClient->deleteNotificationSubscription($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.notifications.v1beta.NotificationsApiService/DeleteNotificationSubscription', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteNotificationSubscriptionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->notificationSubscriptionName('[ACCOUNT]', '[NOTIFICATION_SUBSCRIPTION]'); + $request = (new DeleteNotificationSubscriptionRequest())->setName($formattedName); + try { + $gapicClient->deleteNotificationSubscription($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNotificationSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $allManagedAccounts = true; + $name2 = 'name2-1052831874'; + $callBackUri = 'callBackUri-1975013675'; + $expectedResponse = new NotificationSubscription(); + $expectedResponse->setAllManagedAccounts($allManagedAccounts); + $expectedResponse->setName($name2); + $expectedResponse->setCallBackUri($callBackUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationSubscriptionName('[ACCOUNT]', '[NOTIFICATION_SUBSCRIPTION]'); + $request = (new GetNotificationSubscriptionRequest())->setName($formattedName); + $response = $gapicClient->getNotificationSubscription($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.notifications.v1beta.NotificationsApiService/GetNotificationSubscription', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNotificationSubscriptionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->notificationSubscriptionName('[ACCOUNT]', '[NOTIFICATION_SUBSCRIPTION]'); + $request = (new GetNotificationSubscriptionRequest())->setName($formattedName); + try { + $gapicClient->getNotificationSubscription($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNotificationSubscriptionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $notificationSubscriptionsElement = new NotificationSubscription(); + $notificationSubscriptions = [$notificationSubscriptionsElement]; + $expectedResponse = new ListNotificationSubscriptionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setNotificationSubscriptions($notificationSubscriptions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListNotificationSubscriptionsRequest())->setParent($formattedParent); + $response = $gapicClient->listNotificationSubscriptions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNotificationSubscriptions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.notifications.v1beta.NotificationsApiService/ListNotificationSubscriptions', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNotificationSubscriptionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListNotificationSubscriptionsRequest())->setParent($formattedParent); + try { + $gapicClient->listNotificationSubscriptions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateNotificationSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $allManagedAccounts = true; + $name = 'name3373707'; + $callBackUri = 'callBackUri-1975013675'; + $expectedResponse = new NotificationSubscription(); + $expectedResponse->setAllManagedAccounts($allManagedAccounts); + $expectedResponse->setName($name); + $expectedResponse->setCallBackUri($callBackUri); + $transport->addResponse($expectedResponse); + // Mock request + $notificationSubscription = new NotificationSubscription(); + $request = (new UpdateNotificationSubscriptionRequest())->setNotificationSubscription( + $notificationSubscription + ); + $response = $gapicClient->updateNotificationSubscription($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.notifications.v1beta.NotificationsApiService/UpdateNotificationSubscription', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getNotificationSubscription(); + $this->assertProtobufEquals($notificationSubscription, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateNotificationSubscriptionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $notificationSubscription = new NotificationSubscription(); + $request = (new UpdateNotificationSubscriptionRequest())->setNotificationSubscription( + $notificationSubscription + ); + try { + $gapicClient->updateNotificationSubscription($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createNotificationSubscriptionAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $allManagedAccounts = true; + $name = 'name3373707'; + $callBackUri = 'callBackUri-1975013675'; + $expectedResponse = new NotificationSubscription(); + $expectedResponse->setAllManagedAccounts($allManagedAccounts); + $expectedResponse->setName($name); + $expectedResponse->setCallBackUri($callBackUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $notificationSubscription = new NotificationSubscription(); + $request = (new CreateNotificationSubscriptionRequest()) + ->setParent($formattedParent) + ->setNotificationSubscription($notificationSubscription); + $response = $gapicClient->createNotificationSubscriptionAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.notifications.v1beta.NotificationsApiService/CreateNotificationSubscription', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getNotificationSubscription(); + $this->assertProtobufEquals($notificationSubscription, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantProducts/.OwlBot.yaml b/ShoppingMerchantProducts/.OwlBot.yaml new file mode 100644 index 000000000000..86fff653ac3c --- /dev/null +++ b/ShoppingMerchantProducts/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/shopping/merchant/products/(v1beta)/.*-php/(.*) + dest: /owl-bot-staging/ShoppingMerchantProducts/$1/$2 +api-name: ShoppingMerchantProducts diff --git a/ShoppingMerchantProducts/.gitattributes b/ShoppingMerchantProducts/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/ShoppingMerchantProducts/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/ShoppingMerchantProducts/.github/pull_request_template.md b/ShoppingMerchantProducts/.github/pull_request_template.md new file mode 100644 index 000000000000..61f8ea1fc4b4 --- /dev/null +++ b/ShoppingMerchantProducts/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `ShoppingMerchantProducts/src`, and tests in `ShoppingMerchantProducts/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/ShoppingMerchantProducts/CONTRIBUTING.md b/ShoppingMerchantProducts/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/ShoppingMerchantProducts/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/ShoppingMerchantProducts/LICENSE b/ShoppingMerchantProducts/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/ShoppingMerchantProducts/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/ShoppingMerchantProducts/README.md b/ShoppingMerchantProducts/README.md new file mode 100644 index 000000000000..7bf028ac3bbb --- /dev/null +++ b/ShoppingMerchantProducts/README.md @@ -0,0 +1,45 @@ +# Google Shopping Merchant Products for PHP + +> Idiomatic PHP client for [Google Shopping Merchant Products](https://developers.google.com/merchant/api). + +[![Latest Stable Version](https://poser.pugx.org/google/shopping-merchant-products/v/stable)](https://packagist.org/packages/google/shopping-merchant-products) [![Packagist](https://img.shields.io/packagist/dm/google/shopping-merchant-products.svg)](https://packagist.org/packages/google/shopping-merchant-products) + +* [API documentation](https://cloud.google.com/php/docs/reference/shopping-merchant-products/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/shopping-merchant-products +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-shopping-merchant-products/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/merchant/api). diff --git a/ShoppingMerchantProducts/VERSION b/ShoppingMerchantProducts/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/ShoppingMerchantProducts/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/ShoppingMerchantProducts/composer.json b/ShoppingMerchantProducts/composer.json new file mode 100644 index 000000000000..8db07b43bdde --- /dev/null +++ b/ShoppingMerchantProducts/composer.json @@ -0,0 +1,31 @@ +{ + "name": "google/shopping-merchant-products", + "description": "Google Shopping Merchant Products Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Shopping\\Merchant\\Products\\": "src", + "GPBMetadata\\Google\\Shopping\\Merchant\\Products\\": "metadata" + } + }, + "extra": { + "component": { + "id": "shopping-merchant-products", + "path": "ShoppingMerchantProducts", + "target": "googleapis/php-shopping-merchant-products" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0", + "google/shopping-common-protos": "^0.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/ShoppingMerchantProducts/metadata/V1Beta/Productinputs.php b/ShoppingMerchantProducts/metadata/V1Beta/Productinputs.php new file mode 100644 index 0000000000000000000000000000000000000000..3dcc7f184895f7fd958ef031b78b78209c4dffb0 GIT binary patch literal 2868 zcmbtWPjBNy6emfy?M|14S}RDyfguz%t(I6DR!F$pMNZo-Me4TdRveI}$aW@)C1=KX z#;v+lE}Xc-iO&HafeS~tajFC-J_6#voAKCnYD(KBha~oU@Av-w-kW*yX*7z^`*?>? z61#%*v3H8ah~Ow@g83}OUNRVv82fA-1tE#s7;o+4=le%^du#XTJuu}giG5<>A!Eak zn0&;dD4;`gOk#iJQegsAKk)@Oj~{tNxY=_+qeSqwa)c0d$Am|&Pw>t`cMsJ1u5g_l zh3UM|n9iQYbPhD8^TnesD6b>rhc4$>zfZBz8N%?15-$vV%!Mo9XF1@#fCeIP!{8<4 zyMYI8$O#~nbq5LcMZhSQ2K&?}tyP?2O5Np%L47uG7A5!=49ex~QbA(shRzn@ejG%C z#Rs5jSwkZ7Ld!R;Rqa;71q0klW3;SNkQ-RU2`PHVI3^;A>AH$r0!;FM&cD>qjsnM~ zl*uYE$}Q_6rwfRy3^&7oP;on(X8{TOT{3cy0~X)T^pI#$-8jg+_K^AZI1;BfcX%zi zae7J)N0FeZ^5 z)551(n8kMO9^pOMP0$x@U)nTb#}y=$7^&!Bt27n$d-+(E`7nvv_LUcr^t-EQsN zo;Mz#IbDi+HG5k#x@bOaT|Kw&7M)!|N%we{B;Lam) zeGcR`nNH=i*S@J#j6H;0A>zPG1mX30kS=r{mlC*&3T->LRhY&$TJ#ex*tl0fy^Cvr z`auabEsIjmaTJX8@=yB&IV+i4AeuIYf4mK?HK%%Iy1vg63a81L{x``E6xB?4uN$Y% zfXUkH`Z1Mu?iC-qi|CEsbk&+aRnXEdr3x-S(g6@#lyftI#NNCYVw zWoc|oG2T>3tlpvvm)zzfQtkX*Ll24``3n*s2R<==uOOpbS7Y<$*_W+#I*nH>Ve{bY zU;p^F`g!w{j6(SxD(*(>12p0uO>6RK9%fhb-x5C~^x7*?(OvA?WGbC6ByysFNC> g$n$1Z%|2SmPtu3!g{pA>y7KO&G}AlM1Wge72cALRi~s-t literal 0 HcmV?d00001 diff --git a/ShoppingMerchantProducts/metadata/V1Beta/Products.php b/ShoppingMerchantProducts/metadata/V1Beta/Products.php new file mode 100644 index 0000000000000000000000000000000000000000..274dfd8befa6eadd6497dac9d8044ae40ed2223a GIT binary patch literal 2821 zcmbVOOK;mo5Uwo8k4b9RObe?5if&a0mW@P&-2w^Z*a2lbZqWLH*ytf3K#cV@nMeKXwq55isuU!ns{ zapVfzM&2_ddKiTf6U=7;^5RYhN62UWkOVktAhdUkj*idJ{@$arFQh4FapdDB>N3_1 zu*rKY3<>R;eH{5cmkLutwPRm!^L)d@!p;A0Bt8JB+s8a~eT)uHT8C1j?F!dENZ{;K z4QC%}IQvAy+23!pr1BPkAGn;O>>Mru$-gl60^%bsTp=GTggb;1LEM1+B(vN`9XH@u z8jtFBV(JURC{hN;)W`KTlwvB~m5|A*Y@;kd=~ggVB>NE+IHGP~?_usoBor(ZHD=-6}ZJLG?7oW^*LSZ6u-?4|_)_!Xl37RuZ=Y802sE|CG-PiEUBJR23NI z&1R8P0Wr>SHz1gbtJypxIB2(U&pjtBx|-=@tf@3{knbc%PL^HP?=w1iJUQ~&vk=?r zXH4x9I^5YIy7^YSo%i~ooR@mu9o4HQ&H!W!v>RhP93 zHzcN?G%=mE>gPj(j_Q=-=~iilPlpsD-489=(W1=#y9eBnOG8#&+m9>=A**VtAD(K| zew&6_J;lZim{xnCQbMKryzu~L)h?kps7%R&h0V1_8ck6Q1=QG0m9pnPjr*}jpPvZnsARwfCg_7rY@M|g(EGr%Uygl;5xk`gk5G$zSy3FbpdEQiZ4PeR{o zh5?Wq3HAe~DIseDK7P|P59P+j#xBh1{JC_l`nqxDo*2upNbytQ40%<9G{5xH0~5c&=-hHwHdZ^#;g|# z>jUFO32qG6(b%3m{9(H+ft~j?Puo}9d1-0tjL#>f)=)+T`Kt%dt?Kvz`opqUdqRY~ zX_^-o7dqB_yxdsyOugY+&r5Jy&fLWLv_8y;A)kVsl%5><0gKxifSTVfd)tLi#_^v! zU+8URWDdR8*1fmRq?PUj!^m5mF9&Z%!U*=&YW{t_o!*s(u2y5ORf%SL{TaXj;9n>f B$EW}R literal 0 HcmV?d00001 diff --git a/ShoppingMerchantProducts/metadata/V1Beta/ProductsCommon.php b/ShoppingMerchantProducts/metadata/V1Beta/ProductsCommon.php new file mode 100644 index 0000000000000000000000000000000000000000..e346d8ffd0e9b43342028c78457be4993bbf1448 GIT binary patch literal 9898 zcmcIqOLyDW5e`M`!J$M+&0V9b2+wI}h1;h>~n7wJpY!-IE-hgMt7=;sgXx zJY+FxHhrAt5A+|ji|(@Ts{f=vp!+Vm>C9XJ1Rs*6_%sVgoS8fK-nnyUzL|^1U${*d zt{0ygw&AIPp%?4zV$d{-uIB`f=2*pgcz9@dMa^lsre%05#p3o}@x|VLac6sX{~8YU zozT;ajbg)b8kVu@HyzhC?Z#@$@U*6C2dk(`54FHwJzA?9ftvhQP-n}rS9mG_TWuM> zt7=B^X|?>*1@*nYo6%_j#ov|jg5v8B(^5X@~voEQfD3(m&F=4Hu@I% zSuyZJBRzYu=ovxi*^hYLq~OQouY&Tk}Xo^9@=rAHvsuZ_F1KW{77OkQo#(~ zBw9l7N`F7N39uOio>>nA!=%=rx?ekANcZxVrF@)^4?FGj5H59^!<8h z>y{x8Gd)9e35EkRK-vh>a+M*X$&lA0=SBaQN12l)&NN)GO#3@|j7b+F;g(ZJYb(sj zF=v=Km!P1jwqu)`Y6&JVbA*@+0A@>VM5FS|7$wG4m{)Zjuc(8UNa@J<@^~@3oRjXu zq;c$;7_v}8!AN1qQ#d-mzPJ*dO>FU%#A9iYZu*+#_@QTrL3?i{s&hoY2;=IJYFa8Dt@#J}?jYlie99tMnUSRqJ(Pv?QvDv3y6LEf}62w7GOeO)f{h=+Y6 zPP&vUyPd((E134fx`@%_N}A&b@-^1DadwThl!`6XAnifHa@wjDv=!IEOY6%e*7@<- zbv_g0t2|t)!BnEqa~hu7^5vg0co*{PpPXN((12$)5qkhf9Qit5u2leE#j7k1Qr*s%*crN_3=n>uXsO2v;&L4mbweRIBHuy1*~&cKG~%0f5C1On7l@D9JlQIy zIm41ykeRDsEXqhrAO)DLd^2FZiV#?3fr})7DaA*`E#G6(B9Rbf5J~adK4unqjX9Ty zBViOGj)+X_9GM;?PEn5yU%t|SZD@EEE zfg#-&SOM20KjJ-KBNiSlvDiO+`7s}DB<>ly>0$biKV$I{iGK_drDerAq$Gg@eF`(5 z^ZHK(3RRelgQt!)qG|c^7wkCakDl8+9ubffYiwd7vM3q(@|U~=yc-BFT}y2%v^#`H zo4kkXw1*{FNHcx2g)q@WAzv=@XuNr80RhLiSiucaa0RB)e1_TE%zmHPJ;Sj?2n~4$ z`I*WG#22Z);KHXDvrJqSEg7VlV5oZbU8`&5q$TvgQxGh;!V%t@L>5H!$U63q-?~2cDC-Ab+F@ z^Xun`Vz>vY&})gNeJXq__i4!%%%^5ZSHFJ}^E^4b0sH2OJ3$COD-US4M_A*Afzyfn zm|6tn{vB`Xw9rUmk-IVWx5c#>ug{6NU4aM`4(2ab~2hYk3+b zF+Zlu_3{MdQ*Osfxgh4rk}|kF2@^`X!ev3OUHLDrSb0cNr z0VQdg7fY3Bc?t?jSN&PeLr#gS&hiLcP_Wi41B@wAg~@tPC@|QBePBpXdm#|pr5pH^ z=U_(ZhdaDl!Yypt6trOjrQrv!?F4{Oz6zI>Q=o?6pA0bA&`DMnXOqgs2_eq5yuWmM zF?BXXn#32bJOk58no4<~Pn5F{A6Hj$VOQ#86c*^pBjp8{!*G)Hk&^5o{IV-&^pn>5 zN$dTj`~9Q`e3t!@nH`toF$?s^JGMqDVh9smgasuZwx2=giAnFfYk!?HaSt$~yp7Gue- zA-!w+YX+wJ8ZFOY1XGfU$c463I1gY>>#DL2MoIja5>7X8ohHJW z;?Jlmq|?fY#Uji^jN(NMz5={fX*KQ%o?+YEvfhLRP4$~~tVEPU$5ReN!U_rjDr$ni z#d6%+Mr@k&*+k=xFIR=S+#;f-x4{vuvv?6Os7J}c{e-n}0P3Ek^oJ~r#TT#B3l*T_ zG#v2u;DOP_H@qWit&$CLgJZ`fm`MT(x3v{Mbbb!#4J`Z;Ft}4dF9KO{sslR>^e&JU zhl}+LCAf43mFZ<5D_$RnjWMr_P45HQ3LVo4S(-pme@3U2)jJhO?%oNo*o3*ky(ny2 z$1ytPxt~&fiIz<@zutbQ#XTgD5@{?;FeQLrM^EWBOhgDWsyy-L`P5d$PHE~s&O-rv z>EiiE(E0vg={DJ+i>u1Hr1akmOmxF)Y<+a$bOk|a)A6VUo7yUtF5ObRh}3266W}Do zlZq29!c4aYu`G5?t0!MdVCbfL#FJ7%>ZUw#_pQ7|0+LkuHgszK6?wv!<$n|LfeJ!c^=>N$VS{OksQ4 zU8bD<*X9tl<~lHdNu`ex7mSd@8OQx+G#OaK2lvpI8Ze6}C@!lJ91#_(((HMw(!`9U zUx?E+@%@t?s4U|MOH$MKL!9LT&+5n4o>7zDaK6(=Aed(kCeCpW6e`a91-#V{h+B2w0Kz&Ab&f_40 zP5u3Eey4dEi*J!D9|tSFgdICunRct;sd0ZG46)Yx#y_s zf|bO8k#u0W#hhDAh=_a?5|1)`_wKr}POlRRNo-O)nAhwPQ&Szfvf zvuIlU>P4+%->7peIWlf(AK^y4Nf~BqJFjbXdplWFi{nlQ97x@Eq`AHKLQta0PT|IciKCM&b}X)>HNu5s$9jkjO_w zM}#5hbftzk3z0lULNpl`QJqg5V(`~lIfK8>+C + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/ShoppingMerchantProducts/samples/V1beta/ProductInputsServiceClient/delete_product_input.php b/ShoppingMerchantProducts/samples/V1beta/ProductInputsServiceClient/delete_product_input.php new file mode 100644 index 000000000000..5844d58adc06 --- /dev/null +++ b/ShoppingMerchantProducts/samples/V1beta/ProductInputsServiceClient/delete_product_input.php @@ -0,0 +1,78 @@ +setName($formattedName) + ->setDataSource($dataSource); + + // Call the API and handle any network failures. + try { + $productInputsServiceClient->deleteProductInput($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = ProductInputsServiceClient::productInputName('[ACCOUNT]', '[PRODUCTINPUT]'); + $dataSource = '[DATA_SOURCE]'; + + delete_product_input_sample($formattedName, $dataSource); +} +// [END merchantapi_v1beta_generated_ProductInputsService_DeleteProductInput_sync] diff --git a/ShoppingMerchantProducts/samples/V1beta/ProductInputsServiceClient/insert_product_input.php b/ShoppingMerchantProducts/samples/V1beta/ProductInputsServiceClient/insert_product_input.php new file mode 100644 index 000000000000..01aaff1a236d --- /dev/null +++ b/ShoppingMerchantProducts/samples/V1beta/ProductInputsServiceClient/insert_product_input.php @@ -0,0 +1,122 @@ +setChannel($productInputChannel) + ->setOfferId($productInputOfferId) + ->setContentLanguage($productInputContentLanguage) + ->setFeedLabel($productInputFeedLabel); + $request = (new InsertProductInputRequest()) + ->setParent($formattedParent) + ->setProductInput($productInput) + ->setDataSource($dataSource); + + // Call the API and handle any network failures. + try { + /** @var ProductInput $response */ + $response = $productInputsServiceClient->insertProductInput($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 +{ + $formattedParent = ProductInputsServiceClient::accountName('[ACCOUNT]'); + $productInputChannel = ChannelEnum::CHANNEL_ENUM_UNSPECIFIED; + $productInputOfferId = '[OFFER_ID]'; + $productInputContentLanguage = '[CONTENT_LANGUAGE]'; + $productInputFeedLabel = '[FEED_LABEL]'; + $dataSource = '[DATA_SOURCE]'; + + insert_product_input_sample( + $formattedParent, + $productInputChannel, + $productInputOfferId, + $productInputContentLanguage, + $productInputFeedLabel, + $dataSource + ); +} +// [END merchantapi_v1beta_generated_ProductInputsService_InsertProductInput_sync] diff --git a/ShoppingMerchantProducts/samples/V1beta/ProductsServiceClient/get_product.php b/ShoppingMerchantProducts/samples/V1beta/ProductsServiceClient/get_product.php new file mode 100644 index 000000000000..5c0629f776f0 --- /dev/null +++ b/ShoppingMerchantProducts/samples/V1beta/ProductsServiceClient/get_product.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Product $response */ + $response = $productsServiceClient->getProduct($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 = ProductsServiceClient::productName('[ACCOUNT]', '[PRODUCT]'); + + get_product_sample($formattedName); +} +// [END merchantapi_v1beta_generated_ProductsService_GetProduct_sync] diff --git a/ShoppingMerchantProducts/samples/V1beta/ProductsServiceClient/list_products.php b/ShoppingMerchantProducts/samples/V1beta/ProductsServiceClient/list_products.php new file mode 100644 index 000000000000..013345182a68 --- /dev/null +++ b/ShoppingMerchantProducts/samples/V1beta/ProductsServiceClient/list_products.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $productsServiceClient->listProducts($request); + + /** @var Product $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ProductsServiceClient::accountName('[ACCOUNT]'); + + list_products_sample($formattedParent); +} +// [END merchantapi_v1beta_generated_ProductsService_ListProducts_sync] diff --git a/ShoppingMerchantProducts/src/V1beta/Attributes.php b/ShoppingMerchantProducts/src/V1beta/Attributes.php new file mode 100644 index 000000000000..83e074c06b33 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/Attributes.php @@ -0,0 +1,4169 @@ +google.shopping.merchant.products.v1beta.Attributes + */ +class Attributes extends \Google\Protobuf\Internal\Message +{ + /** + * Set this value to false when the item does not have unique product + * identifiers appropriate to its category, such as GTIN, MPN, and brand. + * Defaults to true, if not provided. + * + * Generated from protobuf field optional bool identifier_exists = 4; + */ + protected $identifier_exists = null; + /** + * Whether the item is a merchant-defined bundle. A bundle is a custom + * grouping of different products sold by a merchant for a single price. + * + * Generated from protobuf field optional bool is_bundle = 5; + */ + protected $is_bundle = null; + /** + * Title of the item. + * + * Generated from protobuf field optional string title = 6; + */ + protected $title = null; + /** + * Description of the item. + * + * Generated from protobuf field optional string description = 7; + */ + protected $description = null; + /** + * URL directly linking to your item's page on your online store. + * + * Generated from protobuf field optional string link = 8; + */ + protected $link = null; + /** + * URL for the mobile-optimized version of your item's landing page. + * + * Generated from protobuf field optional string mobile_link = 9; + */ + protected $mobile_link = null; + /** + * URL for the canonical version of your item's landing page. + * + * Generated from protobuf field optional string canonical_link = 10; + */ + protected $canonical_link = null; + /** + * URL of an image of the item. + * + * Generated from protobuf field optional string image_link = 11; + */ + protected $image_link = null; + /** + * Additional URLs of images of the item. + * + * Generated from protobuf field repeated string additional_image_links = 12; + */ + private $additional_image_links; + /** + * Date on which the item should expire, as specified upon insertion, in + * [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual + * expiration date is exposed in `productstatuses` as + * [googleExpirationDate](https://support.google.com/merchants/answer/6324499) + * and might be earlier if `expirationDate` is too far in the future. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_date = 16; + */ + protected $expiration_date = null; + /** + * The date time when an offer becomes visible in search results across + * Google’s YouTube surfaces, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. See [Disclosure date]( + * https://support.google.com/merchants/answer/13034208) for more information. + * + * Generated from protobuf field .google.protobuf.Timestamp disclosure_date = 79; + */ + protected $disclosure_date = null; + /** + * Set to true if the item is targeted towards adults. + * + * Generated from protobuf field optional bool adult = 17; + */ + protected $adult = null; + /** + * Target [age group](https://support.google.com/merchants/answer/6324463) of + * the item. + * + * Generated from protobuf field optional string age_group = 18; + */ + protected $age_group = null; + /** + * Availability status of the item. + * + * Generated from protobuf field optional string availability = 19; + */ + protected $availability = null; + /** + * The day a pre-ordered product becomes available for delivery, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp availability_date = 20; + */ + protected $availability_date = null; + /** + * Brand of the item. + * + * Generated from protobuf field optional string brand = 21; + */ + protected $brand = null; + /** + * Color of the item. + * + * Generated from protobuf field optional string color = 22; + */ + protected $color = null; + /** + * Condition or state of the item. + * + * Generated from protobuf field optional string condition = 23; + */ + protected $condition = null; + /** + * Target gender of the item. + * + * Generated from protobuf field optional string gender = 24; + */ + protected $gender = null; + /** + * Google's category of the item (see [Google product + * taxonomy](https://support.google.com/merchants/answer/1705911)). When + * querying products, this field will contain the user provided value. There + * is currently no way to get back the auto assigned google product + * categories through the API. + * + * Generated from protobuf field optional string google_product_category = 25; + */ + protected $google_product_category = null; + /** + * Global Trade Item Number + * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the + * item. + * + * Generated from protobuf field optional string gtin = 26; + */ + protected $gtin = null; + /** + * Shared identifier for all variants of the same product. + * + * Generated from protobuf field optional string item_group_id = 27; + */ + protected $item_group_id = null; + /** + * The material of which the item is made. + * + * Generated from protobuf field optional string material = 28; + */ + protected $material = null; + /** + * Manufacturer Part Number + * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the + * item. + * + * Generated from protobuf field optional string mpn = 29; + */ + protected $mpn = null; + /** + * The item's pattern (for example, polka dots). + * + * Generated from protobuf field optional string pattern = 30; + */ + protected $pattern = null; + /** + * Price of the item. + * + * Generated from protobuf field .google.shopping.type.Price price = 31; + */ + protected $price = null; + /** + * Number and amount of installments to pay for an item. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.Installment installment = 32; + */ + protected $installment = null; + /** + * Number of periods (months or years) and amount of payment per period + * for an item with an associated subscription contract. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.SubscriptionCost subscription_cost = 33; + */ + protected $subscription_cost = null; + /** + * Loyalty points that users receive after purchasing the item. Japan only. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.LoyaltyPoints loyalty_points = 34; + */ + protected $loyalty_points = null; + /** + * A list of loyalty program information that is used to surface loyalty + * benefits (for example, better pricing, points, etc) to the user of this + * item. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.LoyaltyProgram loyalty_programs = 136; + */ + private $loyalty_programs; + /** + * Categories of the item (formatted as in [product data + * specification](https://support.google.com/merchants/answer/188494#product_type)). + * + * Generated from protobuf field repeated string product_types = 35; + */ + private $product_types; + /** + * Advertised sale price of the item. + * + * Generated from protobuf field .google.shopping.type.Price sale_price = 36; + */ + protected $sale_price = null; + /** + * Date range during which the item is on sale (see [product data + * specification](https://support.google.com/merchants/answer/188494#sale_price_effective_date)). + * + * Generated from protobuf field .google.type.Interval sale_price_effective_date = 37; + */ + protected $sale_price_effective_date = null; + /** + * The quantity of the product that is available for selling on Google. + * Supported only for online products. + * + * Generated from protobuf field optional int64 sell_on_google_quantity = 38; + */ + protected $sell_on_google_quantity = null; + /** + * The height of the product in the units provided. The value must be + * between + * 0 (exclusive) and 3000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductDimension product_height = 119; + */ + protected $product_height = null; + /** + * The length of the product in the units provided. The value must be + * between 0 (exclusive) and 3000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductDimension product_length = 120; + */ + protected $product_length = null; + /** + * The width of the product in the units provided. The value must be between + * 0 (exclusive) and 3000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductDimension product_width = 121; + */ + protected $product_width = null; + /** + * The weight of the product in the units provided. The value must be + * between 0 (exclusive) and 2000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductWeight product_weight = 122; + */ + protected $product_weight = null; + /** + * Shipping rules. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Shipping shipping = 39; + */ + private $shipping; + /** + * Conditions to be met for a product to have free shipping. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.FreeShippingThreshold free_shipping_threshold = 135; + */ + private $free_shipping_threshold; + /** + * Weight of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingWeight shipping_weight = 40; + */ + protected $shipping_weight = null; + /** + * Length of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingDimension shipping_length = 41; + */ + protected $shipping_length = null; + /** + * Width of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingDimension shipping_width = 42; + */ + protected $shipping_width = null; + /** + * Height of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingDimension shipping_height = 43; + */ + protected $shipping_height = null; + /** + * Maximal product handling time (in business days). + * + * Generated from protobuf field optional int64 max_handling_time = 44; + */ + protected $max_handling_time = null; + /** + * Minimal product handling time (in business days). + * + * Generated from protobuf field optional int64 min_handling_time = 45; + */ + protected $min_handling_time = null; + /** + * The shipping label of the product, used to group product in account-level + * shipping rules. + * + * Generated from protobuf field optional string shipping_label = 46; + */ + protected $shipping_label = null; + /** + * The transit time label of the product, used to group product in + * account-level transit time tables. + * + * Generated from protobuf field optional string transit_time_label = 47; + */ + protected $transit_time_label = null; + /** + * Size of the item. Only one value is allowed. For variants with different + * sizes, insert a separate product for each size with the same + * `itemGroupId` value (see + * [https://support.google.com/merchants/answer/6324492](size definition)). + * + * Generated from protobuf field optional string size = 48; + */ + protected $size = null; + /** + * System in which the size is specified. Recommended for apparel items. + * + * Generated from protobuf field optional string size_system = 49; + */ + protected $size_system = null; + /** + * The cut of the item. It can be used to represent combined size types for + * apparel items. Maximum two of size types can be provided (see + * [https://support.google.com/merchants/answer/6324497](size type)). + * + * Generated from protobuf field repeated string size_types = 50; + */ + private $size_types; + /** + * Tax information. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Tax taxes = 51; + */ + private $taxes; + /** + * The tax category of the product, used to configure detailed tax nexus + * in account-level tax settings. + * + * Generated from protobuf field optional string tax_category = 52; + */ + protected $tax_category = null; + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + * + * Generated from protobuf field optional string energy_efficiency_class = 53; + */ + protected $energy_efficiency_class = null; + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + * + * Generated from protobuf field optional string min_energy_efficiency_class = 54; + */ + protected $min_energy_efficiency_class = null; + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + * + * Generated from protobuf field optional string max_energy_efficiency_class = 55; + */ + protected $max_energy_efficiency_class = null; + /** + * The measure and dimension of an item. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.UnitPricingMeasure unit_pricing_measure = 56; + */ + protected $unit_pricing_measure = null; + /** + * The preference of the denominator of the unit price. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.UnitPricingBaseMeasure unit_pricing_base_measure = 57; + */ + protected $unit_pricing_base_measure = null; + /** + * The number of identical products in a merchant-defined multipack. + * + * Generated from protobuf field optional int64 multipack = 58; + */ + protected $multipack = null; + /** + * Used to group items in an arbitrary way. Only for CPA%, discouraged + * otherwise. + * + * Generated from protobuf field optional string ads_grouping = 59; + */ + protected $ads_grouping = null; + /** + * Similar to ads_grouping, but only works on CPC. + * + * Generated from protobuf field repeated string ads_labels = 60; + */ + private $ads_labels; + /** + * Allows advertisers to override the item URL when the product is shown + * within the context of Product ads. + * + * Generated from protobuf field optional string ads_redirect = 61; + */ + protected $ads_redirect = null; + /** + * Cost of goods sold. Used for gross profit reporting. + * + * Generated from protobuf field .google.shopping.type.Price cost_of_goods_sold = 62; + */ + protected $cost_of_goods_sold = null; + /** + * Technical specification or additional product details. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.ProductDetail product_details = 63; + */ + private $product_details; + /** + * Bullet points describing the most relevant highlights of a product. + * + * Generated from protobuf field repeated string product_highlights = 64; + */ + private $product_highlights; + /** + * An identifier for an item for dynamic remarketing campaigns. + * + * Generated from protobuf field optional string display_ads_id = 65; + */ + protected $display_ads_id = null; + /** + * Advertiser-specified recommendations. + * + * Generated from protobuf field repeated string display_ads_similar_ids = 66; + */ + private $display_ads_similar_ids; + /** + * Title of an item for dynamic remarketing campaigns. + * + * Generated from protobuf field optional string display_ads_title = 67; + */ + protected $display_ads_title = null; + /** + * URL directly to your item's landing page for dynamic remarketing + * campaigns. + * + * Generated from protobuf field optional string display_ads_link = 68; + */ + protected $display_ads_link = null; + /** + * Offer margin for dynamic remarketing campaigns. + * + * Generated from protobuf field optional double display_ads_value = 69; + */ + protected $display_ads_value = null; + /** + * The unique ID of a promotion. + * + * Generated from protobuf field repeated string promotion_ids = 70; + */ + private $promotion_ids; + /** + * The pick up option for the item. + * + * Generated from protobuf field optional string pickup_method = 80; + */ + protected $pickup_method = null; + /** + * Item store pickup timeline. + * + * Generated from protobuf field optional string pickup_sla = 81; + */ + protected $pickup_sla = null; + /** + * Link template for merchant hosted local storefront. + * + * Generated from protobuf field optional string link_template = 82; + */ + protected $link_template = null; + /** + * Link template for merchant hosted local storefront optimized for mobile + * devices. + * + * Generated from protobuf field optional string mobile_link_template = 83; + */ + protected $mobile_link_template = null; + /** + * Custom label 0 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_0 = 71; + */ + protected $custom_label_0 = null; + /** + * Custom label 1 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_1 = 72; + */ + protected $custom_label_1 = null; + /** + * Custom label 2 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_2 = 73; + */ + protected $custom_label_2 = null; + /** + * Custom label 3 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_3 = 74; + */ + protected $custom_label_3 = null; + /** + * Custom label 4 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_4 = 75; + */ + protected $custom_label_4 = null; + /** + * The list of destinations to include for this target (corresponds to + * checked check boxes in Merchant Center). Default destinations are always + * included unless provided in `excludedDestinations`. + * + * Generated from protobuf field repeated string included_destinations = 76; + */ + private $included_destinations; + /** + * The list of destinations to exclude for this target (corresponds to + * unchecked check boxes in Merchant Center). + * + * Generated from protobuf field repeated string excluded_destinations = 77; + */ + private $excluded_destinations; + /** + * List of country codes (ISO 3166-1 alpha-2) to exclude the offer from + * Shopping Ads destination. + * Countries from this list are removed from countries configured + * in data source settings. + * + * Generated from protobuf field repeated string shopping_ads_excluded_countries = 78; + */ + private $shopping_ads_excluded_countries; + /** + * Required for multi-seller accounts. Use this attribute if you're a + * marketplace uploading products for various sellers to your multi-seller + * account. + * + * Generated from protobuf field optional string external_seller_id = 1; + */ + protected $external_seller_id = null; + /** + * Publication of this item will be temporarily + * [paused](https://support.google.com/merchants/answer/11909930). + * + * Generated from protobuf field optional string pause = 13; + */ + protected $pause = null; + /** + * Additional URLs of lifestyle images of the item, used to explicitly + * identify images that showcase your item in a real-world context. See the + * [Help Center article](https://support.google.com/merchants/answer/9103186) + * for more information. + * + * Generated from protobuf field repeated string lifestyle_image_links = 14; + */ + private $lifestyle_image_links; + /** + * Extra fields to export to the Cloud Retail program. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.CloudExportAdditionalProperties cloud_export_additional_properties = 84; + */ + private $cloud_export_additional_properties; + /** + * URL of the 3D image of the item. See the + * [Help Center article](https://support.google.com/merchants/answer/13674896) + * for more information. + * + * Generated from protobuf field optional string virtual_model_link = 130; + */ + protected $virtual_model_link = null; + /** + * Product Certifications, for example for energy efficiency labeling of + * products recorded in the [EU EPREL](https://eprel.ec.europa.eu/screen/home) + * database. See the [Help + * Center](https://support.google.com/merchants/answer/13528839) + * article for more information. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Certification certifications = 123; + */ + private $certifications; + /** + * Structured title, for algorithmically (AI)-generated titles. + * + * Generated from protobuf field optional .google.shopping.merchant.products.v1beta.ProductStructuredTitle structured_title = 132; + */ + protected $structured_title = null; + /** + * Structured description, for algorithmically (AI)-generated descriptions. + * + * Generated from protobuf field optional .google.shopping.merchant.products.v1beta.ProductStructuredDescription structured_description = 133; + */ + protected $structured_description = null; + /** + * A safeguard in the "Automated Discounts" + * (https://support.google.com/merchants/answer/10295759) and + * "Dynamic Promotions" + * (https://support.google.com/merchants/answer/13949249) projects, + * ensuring that discounts on merchants' offers do not fall below this value, + * thereby preserving the offer's value and profitability. + * + * Generated from protobuf field .google.shopping.type.Price auto_pricing_min_price = 124; + */ + protected $auto_pricing_min_price = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $identifier_exists + * Set this value to false when the item does not have unique product + * identifiers appropriate to its category, such as GTIN, MPN, and brand. + * Defaults to true, if not provided. + * @type bool $is_bundle + * Whether the item is a merchant-defined bundle. A bundle is a custom + * grouping of different products sold by a merchant for a single price. + * @type string $title + * Title of the item. + * @type string $description + * Description of the item. + * @type string $link + * URL directly linking to your item's page on your online store. + * @type string $mobile_link + * URL for the mobile-optimized version of your item's landing page. + * @type string $canonical_link + * URL for the canonical version of your item's landing page. + * @type string $image_link + * URL of an image of the item. + * @type array|\Google\Protobuf\Internal\RepeatedField $additional_image_links + * Additional URLs of images of the item. + * @type \Google\Protobuf\Timestamp $expiration_date + * Date on which the item should expire, as specified upon insertion, in + * [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual + * expiration date is exposed in `productstatuses` as + * [googleExpirationDate](https://support.google.com/merchants/answer/6324499) + * and might be earlier if `expirationDate` is too far in the future. + * @type \Google\Protobuf\Timestamp $disclosure_date + * The date time when an offer becomes visible in search results across + * Google’s YouTube surfaces, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. See [Disclosure date]( + * https://support.google.com/merchants/answer/13034208) for more information. + * @type bool $adult + * Set to true if the item is targeted towards adults. + * @type string $age_group + * Target [age group](https://support.google.com/merchants/answer/6324463) of + * the item. + * @type string $availability + * Availability status of the item. + * @type \Google\Protobuf\Timestamp $availability_date + * The day a pre-ordered product becomes available for delivery, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * @type string $brand + * Brand of the item. + * @type string $color + * Color of the item. + * @type string $condition + * Condition or state of the item. + * @type string $gender + * Target gender of the item. + * @type string $google_product_category + * Google's category of the item (see [Google product + * taxonomy](https://support.google.com/merchants/answer/1705911)). When + * querying products, this field will contain the user provided value. There + * is currently no way to get back the auto assigned google product + * categories through the API. + * @type string $gtin + * Global Trade Item Number + * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the + * item. + * @type string $item_group_id + * Shared identifier for all variants of the same product. + * @type string $material + * The material of which the item is made. + * @type string $mpn + * Manufacturer Part Number + * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the + * item. + * @type string $pattern + * The item's pattern (for example, polka dots). + * @type \Google\Shopping\Type\Price $price + * Price of the item. + * @type \Google\Shopping\Merchant\Products\V1beta\Installment $installment + * Number and amount of installments to pay for an item. + * @type \Google\Shopping\Merchant\Products\V1beta\SubscriptionCost $subscription_cost + * Number of periods (months or years) and amount of payment per period + * for an item with an associated subscription contract. + * @type \Google\Shopping\Merchant\Products\V1beta\LoyaltyPoints $loyalty_points + * Loyalty points that users receive after purchasing the item. Japan only. + * @type array<\Google\Shopping\Merchant\Products\V1beta\LoyaltyProgram>|\Google\Protobuf\Internal\RepeatedField $loyalty_programs + * A list of loyalty program information that is used to surface loyalty + * benefits (for example, better pricing, points, etc) to the user of this + * item. + * @type array|\Google\Protobuf\Internal\RepeatedField $product_types + * Categories of the item (formatted as in [product data + * specification](https://support.google.com/merchants/answer/188494#product_type)). + * @type \Google\Shopping\Type\Price $sale_price + * Advertised sale price of the item. + * @type \Google\Type\Interval $sale_price_effective_date + * Date range during which the item is on sale (see [product data + * specification](https://support.google.com/merchants/answer/188494#sale_price_effective_date)). + * @type int|string $sell_on_google_quantity + * The quantity of the product that is available for selling on Google. + * Supported only for online products. + * @type \Google\Shopping\Merchant\Products\V1beta\ProductDimension $product_height + * The height of the product in the units provided. The value must be + * between + * 0 (exclusive) and 3000 (inclusive). + * @type \Google\Shopping\Merchant\Products\V1beta\ProductDimension $product_length + * The length of the product in the units provided. The value must be + * between 0 (exclusive) and 3000 (inclusive). + * @type \Google\Shopping\Merchant\Products\V1beta\ProductDimension $product_width + * The width of the product in the units provided. The value must be between + * 0 (exclusive) and 3000 (inclusive). + * @type \Google\Shopping\Merchant\Products\V1beta\ProductWeight $product_weight + * The weight of the product in the units provided. The value must be + * between 0 (exclusive) and 2000 (inclusive). + * @type array<\Google\Shopping\Merchant\Products\V1beta\Shipping>|\Google\Protobuf\Internal\RepeatedField $shipping + * Shipping rules. + * @type array<\Google\Shopping\Merchant\Products\V1beta\FreeShippingThreshold>|\Google\Protobuf\Internal\RepeatedField $free_shipping_threshold + * Conditions to be met for a product to have free shipping. + * @type \Google\Shopping\Merchant\Products\V1beta\ShippingWeight $shipping_weight + * Weight of the item for shipping. + * @type \Google\Shopping\Merchant\Products\V1beta\ShippingDimension $shipping_length + * Length of the item for shipping. + * @type \Google\Shopping\Merchant\Products\V1beta\ShippingDimension $shipping_width + * Width of the item for shipping. + * @type \Google\Shopping\Merchant\Products\V1beta\ShippingDimension $shipping_height + * Height of the item for shipping. + * @type int|string $max_handling_time + * Maximal product handling time (in business days). + * @type int|string $min_handling_time + * Minimal product handling time (in business days). + * @type string $shipping_label + * The shipping label of the product, used to group product in account-level + * shipping rules. + * @type string $transit_time_label + * The transit time label of the product, used to group product in + * account-level transit time tables. + * @type string $size + * Size of the item. Only one value is allowed. For variants with different + * sizes, insert a separate product for each size with the same + * `itemGroupId` value (see + * [https://support.google.com/merchants/answer/6324492](size definition)). + * @type string $size_system + * System in which the size is specified. Recommended for apparel items. + * @type array|\Google\Protobuf\Internal\RepeatedField $size_types + * The cut of the item. It can be used to represent combined size types for + * apparel items. Maximum two of size types can be provided (see + * [https://support.google.com/merchants/answer/6324497](size type)). + * @type array<\Google\Shopping\Merchant\Products\V1beta\Tax>|\Google\Protobuf\Internal\RepeatedField $taxes + * Tax information. + * @type string $tax_category + * The tax category of the product, used to configure detailed tax nexus + * in account-level tax settings. + * @type string $energy_efficiency_class + * The energy efficiency class as defined in EU directive 2010/30/EU. + * @type string $min_energy_efficiency_class + * The energy efficiency class as defined in EU directive 2010/30/EU. + * @type string $max_energy_efficiency_class + * The energy efficiency class as defined in EU directive 2010/30/EU. + * @type \Google\Shopping\Merchant\Products\V1beta\UnitPricingMeasure $unit_pricing_measure + * The measure and dimension of an item. + * @type \Google\Shopping\Merchant\Products\V1beta\UnitPricingBaseMeasure $unit_pricing_base_measure + * The preference of the denominator of the unit price. + * @type int|string $multipack + * The number of identical products in a merchant-defined multipack. + * @type string $ads_grouping + * Used to group items in an arbitrary way. Only for CPA%, discouraged + * otherwise. + * @type array|\Google\Protobuf\Internal\RepeatedField $ads_labels + * Similar to ads_grouping, but only works on CPC. + * @type string $ads_redirect + * Allows advertisers to override the item URL when the product is shown + * within the context of Product ads. + * @type \Google\Shopping\Type\Price $cost_of_goods_sold + * Cost of goods sold. Used for gross profit reporting. + * @type array<\Google\Shopping\Merchant\Products\V1beta\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $product_details + * Technical specification or additional product details. + * @type array|\Google\Protobuf\Internal\RepeatedField $product_highlights + * Bullet points describing the most relevant highlights of a product. + * @type string $display_ads_id + * An identifier for an item for dynamic remarketing campaigns. + * @type array|\Google\Protobuf\Internal\RepeatedField $display_ads_similar_ids + * Advertiser-specified recommendations. + * @type string $display_ads_title + * Title of an item for dynamic remarketing campaigns. + * @type string $display_ads_link + * URL directly to your item's landing page for dynamic remarketing + * campaigns. + * @type float $display_ads_value + * Offer margin for dynamic remarketing campaigns. + * @type array|\Google\Protobuf\Internal\RepeatedField $promotion_ids + * The unique ID of a promotion. + * @type string $pickup_method + * The pick up option for the item. + * @type string $pickup_sla + * Item store pickup timeline. + * @type string $link_template + * Link template for merchant hosted local storefront. + * @type string $mobile_link_template + * Link template for merchant hosted local storefront optimized for mobile + * devices. + * @type string $custom_label_0 + * Custom label 0 for custom grouping of items in a Shopping campaign. + * @type string $custom_label_1 + * Custom label 1 for custom grouping of items in a Shopping campaign. + * @type string $custom_label_2 + * Custom label 2 for custom grouping of items in a Shopping campaign. + * @type string $custom_label_3 + * Custom label 3 for custom grouping of items in a Shopping campaign. + * @type string $custom_label_4 + * Custom label 4 for custom grouping of items in a Shopping campaign. + * @type array|\Google\Protobuf\Internal\RepeatedField $included_destinations + * The list of destinations to include for this target (corresponds to + * checked check boxes in Merchant Center). Default destinations are always + * included unless provided in `excludedDestinations`. + * @type array|\Google\Protobuf\Internal\RepeatedField $excluded_destinations + * The list of destinations to exclude for this target (corresponds to + * unchecked check boxes in Merchant Center). + * @type array|\Google\Protobuf\Internal\RepeatedField $shopping_ads_excluded_countries + * List of country codes (ISO 3166-1 alpha-2) to exclude the offer from + * Shopping Ads destination. + * Countries from this list are removed from countries configured + * in data source settings. + * @type string $external_seller_id + * Required for multi-seller accounts. Use this attribute if you're a + * marketplace uploading products for various sellers to your multi-seller + * account. + * @type string $pause + * Publication of this item will be temporarily + * [paused](https://support.google.com/merchants/answer/11909930). + * @type array|\Google\Protobuf\Internal\RepeatedField $lifestyle_image_links + * Additional URLs of lifestyle images of the item, used to explicitly + * identify images that showcase your item in a real-world context. See the + * [Help Center article](https://support.google.com/merchants/answer/9103186) + * for more information. + * @type array<\Google\Shopping\Merchant\Products\V1beta\CloudExportAdditionalProperties>|\Google\Protobuf\Internal\RepeatedField $cloud_export_additional_properties + * Extra fields to export to the Cloud Retail program. + * @type string $virtual_model_link + * URL of the 3D image of the item. See the + * [Help Center article](https://support.google.com/merchants/answer/13674896) + * for more information. + * @type array<\Google\Shopping\Merchant\Products\V1beta\Certification>|\Google\Protobuf\Internal\RepeatedField $certifications + * Product Certifications, for example for energy efficiency labeling of + * products recorded in the [EU EPREL](https://eprel.ec.europa.eu/screen/home) + * database. See the [Help + * Center](https://support.google.com/merchants/answer/13528839) + * article for more information. + * @type \Google\Shopping\Merchant\Products\V1beta\ProductStructuredTitle $structured_title + * Structured title, for algorithmically (AI)-generated titles. + * @type \Google\Shopping\Merchant\Products\V1beta\ProductStructuredDescription $structured_description + * Structured description, for algorithmically (AI)-generated descriptions. + * @type \Google\Shopping\Type\Price $auto_pricing_min_price + * A safeguard in the "Automated Discounts" + * (https://support.google.com/merchants/answer/10295759) and + * "Dynamic Promotions" + * (https://support.google.com/merchants/answer/13949249) projects, + * ensuring that discounts on merchants' offers do not fall below this value, + * thereby preserving the offer's value and profitability. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Set this value to false when the item does not have unique product + * identifiers appropriate to its category, such as GTIN, MPN, and brand. + * Defaults to true, if not provided. + * + * Generated from protobuf field optional bool identifier_exists = 4; + * @return bool + */ + public function getIdentifierExists() + { + return isset($this->identifier_exists) ? $this->identifier_exists : false; + } + + public function hasIdentifierExists() + { + return isset($this->identifier_exists); + } + + public function clearIdentifierExists() + { + unset($this->identifier_exists); + } + + /** + * Set this value to false when the item does not have unique product + * identifiers appropriate to its category, such as GTIN, MPN, and brand. + * Defaults to true, if not provided. + * + * Generated from protobuf field optional bool identifier_exists = 4; + * @param bool $var + * @return $this + */ + public function setIdentifierExists($var) + { + GPBUtil::checkBool($var); + $this->identifier_exists = $var; + + return $this; + } + + /** + * Whether the item is a merchant-defined bundle. A bundle is a custom + * grouping of different products sold by a merchant for a single price. + * + * Generated from protobuf field optional bool is_bundle = 5; + * @return bool + */ + public function getIsBundle() + { + return isset($this->is_bundle) ? $this->is_bundle : false; + } + + public function hasIsBundle() + { + return isset($this->is_bundle); + } + + public function clearIsBundle() + { + unset($this->is_bundle); + } + + /** + * Whether the item is a merchant-defined bundle. A bundle is a custom + * grouping of different products sold by a merchant for a single price. + * + * Generated from protobuf field optional bool is_bundle = 5; + * @param bool $var + * @return $this + */ + public function setIsBundle($var) + { + GPBUtil::checkBool($var); + $this->is_bundle = $var; + + return $this; + } + + /** + * Title of the item. + * + * Generated from protobuf field optional string title = 6; + * @return string + */ + public function getTitle() + { + return isset($this->title) ? $this->title : ''; + } + + public function hasTitle() + { + return isset($this->title); + } + + public function clearTitle() + { + unset($this->title); + } + + /** + * Title of the item. + * + * Generated from protobuf field optional string title = 6; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Description of the item. + * + * Generated from protobuf field optional string description = 7; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Description of the item. + * + * Generated from protobuf field optional string description = 7; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * URL directly linking to your item's page on your online store. + * + * Generated from protobuf field optional string link = 8; + * @return string + */ + public function getLink() + { + return isset($this->link) ? $this->link : ''; + } + + public function hasLink() + { + return isset($this->link); + } + + public function clearLink() + { + unset($this->link); + } + + /** + * URL directly linking to your item's page on your online store. + * + * Generated from protobuf field optional string link = 8; + * @param string $var + * @return $this + */ + public function setLink($var) + { + GPBUtil::checkString($var, True); + $this->link = $var; + + return $this; + } + + /** + * URL for the mobile-optimized version of your item's landing page. + * + * Generated from protobuf field optional string mobile_link = 9; + * @return string + */ + public function getMobileLink() + { + return isset($this->mobile_link) ? $this->mobile_link : ''; + } + + public function hasMobileLink() + { + return isset($this->mobile_link); + } + + public function clearMobileLink() + { + unset($this->mobile_link); + } + + /** + * URL for the mobile-optimized version of your item's landing page. + * + * Generated from protobuf field optional string mobile_link = 9; + * @param string $var + * @return $this + */ + public function setMobileLink($var) + { + GPBUtil::checkString($var, True); + $this->mobile_link = $var; + + return $this; + } + + /** + * URL for the canonical version of your item's landing page. + * + * Generated from protobuf field optional string canonical_link = 10; + * @return string + */ + public function getCanonicalLink() + { + return isset($this->canonical_link) ? $this->canonical_link : ''; + } + + public function hasCanonicalLink() + { + return isset($this->canonical_link); + } + + public function clearCanonicalLink() + { + unset($this->canonical_link); + } + + /** + * URL for the canonical version of your item's landing page. + * + * Generated from protobuf field optional string canonical_link = 10; + * @param string $var + * @return $this + */ + public function setCanonicalLink($var) + { + GPBUtil::checkString($var, True); + $this->canonical_link = $var; + + return $this; + } + + /** + * URL of an image of the item. + * + * Generated from protobuf field optional string image_link = 11; + * @return string + */ + public function getImageLink() + { + return isset($this->image_link) ? $this->image_link : ''; + } + + public function hasImageLink() + { + return isset($this->image_link); + } + + public function clearImageLink() + { + unset($this->image_link); + } + + /** + * URL of an image of the item. + * + * Generated from protobuf field optional string image_link = 11; + * @param string $var + * @return $this + */ + public function setImageLink($var) + { + GPBUtil::checkString($var, True); + $this->image_link = $var; + + return $this; + } + + /** + * Additional URLs of images of the item. + * + * Generated from protobuf field repeated string additional_image_links = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdditionalImageLinks() + { + return $this->additional_image_links; + } + + /** + * Additional URLs of images of the item. + * + * Generated from protobuf field repeated string additional_image_links = 12; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdditionalImageLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_image_links = $arr; + + return $this; + } + + /** + * Date on which the item should expire, as specified upon insertion, in + * [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual + * expiration date is exposed in `productstatuses` as + * [googleExpirationDate](https://support.google.com/merchants/answer/6324499) + * and might be earlier if `expirationDate` is too far in the future. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_date = 16; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpirationDate() + { + return $this->expiration_date; + } + + public function hasExpirationDate() + { + return isset($this->expiration_date); + } + + public function clearExpirationDate() + { + unset($this->expiration_date); + } + + /** + * Date on which the item should expire, as specified upon insertion, in + * [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual + * expiration date is exposed in `productstatuses` as + * [googleExpirationDate](https://support.google.com/merchants/answer/6324499) + * and might be earlier if `expirationDate` is too far in the future. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_date = 16; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpirationDate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expiration_date = $var; + + return $this; + } + + /** + * The date time when an offer becomes visible in search results across + * Google’s YouTube surfaces, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. See [Disclosure date]( + * https://support.google.com/merchants/answer/13034208) for more information. + * + * Generated from protobuf field .google.protobuf.Timestamp disclosure_date = 79; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDisclosureDate() + { + return $this->disclosure_date; + } + + public function hasDisclosureDate() + { + return isset($this->disclosure_date); + } + + public function clearDisclosureDate() + { + unset($this->disclosure_date); + } + + /** + * The date time when an offer becomes visible in search results across + * Google’s YouTube surfaces, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. See [Disclosure date]( + * https://support.google.com/merchants/answer/13034208) for more information. + * + * Generated from protobuf field .google.protobuf.Timestamp disclosure_date = 79; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDisclosureDate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->disclosure_date = $var; + + return $this; + } + + /** + * Set to true if the item is targeted towards adults. + * + * Generated from protobuf field optional bool adult = 17; + * @return bool + */ + public function getAdult() + { + return isset($this->adult) ? $this->adult : false; + } + + public function hasAdult() + { + return isset($this->adult); + } + + public function clearAdult() + { + unset($this->adult); + } + + /** + * Set to true if the item is targeted towards adults. + * + * Generated from protobuf field optional bool adult = 17; + * @param bool $var + * @return $this + */ + public function setAdult($var) + { + GPBUtil::checkBool($var); + $this->adult = $var; + + return $this; + } + + /** + * Target [age group](https://support.google.com/merchants/answer/6324463) of + * the item. + * + * Generated from protobuf field optional string age_group = 18; + * @return string + */ + public function getAgeGroup() + { + return isset($this->age_group) ? $this->age_group : ''; + } + + public function hasAgeGroup() + { + return isset($this->age_group); + } + + public function clearAgeGroup() + { + unset($this->age_group); + } + + /** + * Target [age group](https://support.google.com/merchants/answer/6324463) of + * the item. + * + * Generated from protobuf field optional string age_group = 18; + * @param string $var + * @return $this + */ + public function setAgeGroup($var) + { + GPBUtil::checkString($var, True); + $this->age_group = $var; + + return $this; + } + + /** + * Availability status of the item. + * + * Generated from protobuf field optional string availability = 19; + * @return string + */ + public function getAvailability() + { + return isset($this->availability) ? $this->availability : ''; + } + + public function hasAvailability() + { + return isset($this->availability); + } + + public function clearAvailability() + { + unset($this->availability); + } + + /** + * Availability status of the item. + * + * Generated from protobuf field optional string availability = 19; + * @param string $var + * @return $this + */ + public function setAvailability($var) + { + GPBUtil::checkString($var, True); + $this->availability = $var; + + return $this; + } + + /** + * The day a pre-ordered product becomes available for delivery, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp availability_date = 20; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAvailabilityDate() + { + return $this->availability_date; + } + + public function hasAvailabilityDate() + { + return isset($this->availability_date); + } + + public function clearAvailabilityDate() + { + unset($this->availability_date); + } + + /** + * The day a pre-ordered product becomes available for delivery, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp availability_date = 20; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAvailabilityDate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->availability_date = $var; + + return $this; + } + + /** + * Brand of the item. + * + * Generated from protobuf field optional string brand = 21; + * @return string + */ + public function getBrand() + { + return isset($this->brand) ? $this->brand : ''; + } + + public function hasBrand() + { + return isset($this->brand); + } + + public function clearBrand() + { + unset($this->brand); + } + + /** + * Brand of the item. + * + * Generated from protobuf field optional string brand = 21; + * @param string $var + * @return $this + */ + public function setBrand($var) + { + GPBUtil::checkString($var, True); + $this->brand = $var; + + return $this; + } + + /** + * Color of the item. + * + * Generated from protobuf field optional string color = 22; + * @return string + */ + public function getColor() + { + return isset($this->color) ? $this->color : ''; + } + + public function hasColor() + { + return isset($this->color); + } + + public function clearColor() + { + unset($this->color); + } + + /** + * Color of the item. + * + * Generated from protobuf field optional string color = 22; + * @param string $var + * @return $this + */ + public function setColor($var) + { + GPBUtil::checkString($var, True); + $this->color = $var; + + return $this; + } + + /** + * Condition or state of the item. + * + * Generated from protobuf field optional string condition = 23; + * @return string + */ + public function getCondition() + { + return isset($this->condition) ? $this->condition : ''; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * Condition or state of the item. + * + * Generated from protobuf field optional string condition = 23; + * @param string $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkString($var, True); + $this->condition = $var; + + return $this; + } + + /** + * Target gender of the item. + * + * Generated from protobuf field optional string gender = 24; + * @return string + */ + public function getGender() + { + return isset($this->gender) ? $this->gender : ''; + } + + public function hasGender() + { + return isset($this->gender); + } + + public function clearGender() + { + unset($this->gender); + } + + /** + * Target gender of the item. + * + * Generated from protobuf field optional string gender = 24; + * @param string $var + * @return $this + */ + public function setGender($var) + { + GPBUtil::checkString($var, True); + $this->gender = $var; + + return $this; + } + + /** + * Google's category of the item (see [Google product + * taxonomy](https://support.google.com/merchants/answer/1705911)). When + * querying products, this field will contain the user provided value. There + * is currently no way to get back the auto assigned google product + * categories through the API. + * + * Generated from protobuf field optional string google_product_category = 25; + * @return string + */ + public function getGoogleProductCategory() + { + return isset($this->google_product_category) ? $this->google_product_category : ''; + } + + public function hasGoogleProductCategory() + { + return isset($this->google_product_category); + } + + public function clearGoogleProductCategory() + { + unset($this->google_product_category); + } + + /** + * Google's category of the item (see [Google product + * taxonomy](https://support.google.com/merchants/answer/1705911)). When + * querying products, this field will contain the user provided value. There + * is currently no way to get back the auto assigned google product + * categories through the API. + * + * Generated from protobuf field optional string google_product_category = 25; + * @param string $var + * @return $this + */ + public function setGoogleProductCategory($var) + { + GPBUtil::checkString($var, True); + $this->google_product_category = $var; + + return $this; + } + + /** + * Global Trade Item Number + * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the + * item. + * + * Generated from protobuf field optional string gtin = 26; + * @return string + */ + public function getGtin() + { + return isset($this->gtin) ? $this->gtin : ''; + } + + public function hasGtin() + { + return isset($this->gtin); + } + + public function clearGtin() + { + unset($this->gtin); + } + + /** + * Global Trade Item Number + * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the + * item. + * + * Generated from protobuf field optional string gtin = 26; + * @param string $var + * @return $this + */ + public function setGtin($var) + { + GPBUtil::checkString($var, True); + $this->gtin = $var; + + return $this; + } + + /** + * Shared identifier for all variants of the same product. + * + * Generated from protobuf field optional string item_group_id = 27; + * @return string + */ + public function getItemGroupId() + { + return isset($this->item_group_id) ? $this->item_group_id : ''; + } + + public function hasItemGroupId() + { + return isset($this->item_group_id); + } + + public function clearItemGroupId() + { + unset($this->item_group_id); + } + + /** + * Shared identifier for all variants of the same product. + * + * Generated from protobuf field optional string item_group_id = 27; + * @param string $var + * @return $this + */ + public function setItemGroupId($var) + { + GPBUtil::checkString($var, True); + $this->item_group_id = $var; + + return $this; + } + + /** + * The material of which the item is made. + * + * Generated from protobuf field optional string material = 28; + * @return string + */ + public function getMaterial() + { + return isset($this->material) ? $this->material : ''; + } + + public function hasMaterial() + { + return isset($this->material); + } + + public function clearMaterial() + { + unset($this->material); + } + + /** + * The material of which the item is made. + * + * Generated from protobuf field optional string material = 28; + * @param string $var + * @return $this + */ + public function setMaterial($var) + { + GPBUtil::checkString($var, True); + $this->material = $var; + + return $this; + } + + /** + * Manufacturer Part Number + * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the + * item. + * + * Generated from protobuf field optional string mpn = 29; + * @return string + */ + public function getMpn() + { + return isset($this->mpn) ? $this->mpn : ''; + } + + public function hasMpn() + { + return isset($this->mpn); + } + + public function clearMpn() + { + unset($this->mpn); + } + + /** + * Manufacturer Part Number + * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the + * item. + * + * Generated from protobuf field optional string mpn = 29; + * @param string $var + * @return $this + */ + public function setMpn($var) + { + GPBUtil::checkString($var, True); + $this->mpn = $var; + + return $this; + } + + /** + * The item's pattern (for example, polka dots). + * + * Generated from protobuf field optional string pattern = 30; + * @return string + */ + public function getPattern() + { + return isset($this->pattern) ? $this->pattern : ''; + } + + public function hasPattern() + { + return isset($this->pattern); + } + + public function clearPattern() + { + unset($this->pattern); + } + + /** + * The item's pattern (for example, polka dots). + * + * Generated from protobuf field optional string pattern = 30; + * @param string $var + * @return $this + */ + public function setPattern($var) + { + GPBUtil::checkString($var, True); + $this->pattern = $var; + + return $this; + } + + /** + * Price of the item. + * + * Generated from protobuf field .google.shopping.type.Price price = 31; + * @return \Google\Shopping\Type\Price|null + */ + public function getPrice() + { + return $this->price; + } + + public function hasPrice() + { + return isset($this->price); + } + + public function clearPrice() + { + unset($this->price); + } + + /** + * Price of the item. + * + * Generated from protobuf field .google.shopping.type.Price price = 31; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setPrice($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->price = $var; + + return $this; + } + + /** + * Number and amount of installments to pay for an item. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.Installment installment = 32; + * @return \Google\Shopping\Merchant\Products\V1beta\Installment|null + */ + public function getInstallment() + { + return $this->installment; + } + + public function hasInstallment() + { + return isset($this->installment); + } + + public function clearInstallment() + { + unset($this->installment); + } + + /** + * Number and amount of installments to pay for an item. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.Installment installment = 32; + * @param \Google\Shopping\Merchant\Products\V1beta\Installment $var + * @return $this + */ + public function setInstallment($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\Installment::class); + $this->installment = $var; + + return $this; + } + + /** + * Number of periods (months or years) and amount of payment per period + * for an item with an associated subscription contract. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.SubscriptionCost subscription_cost = 33; + * @return \Google\Shopping\Merchant\Products\V1beta\SubscriptionCost|null + */ + public function getSubscriptionCost() + { + return $this->subscription_cost; + } + + public function hasSubscriptionCost() + { + return isset($this->subscription_cost); + } + + public function clearSubscriptionCost() + { + unset($this->subscription_cost); + } + + /** + * Number of periods (months or years) and amount of payment per period + * for an item with an associated subscription contract. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.SubscriptionCost subscription_cost = 33; + * @param \Google\Shopping\Merchant\Products\V1beta\SubscriptionCost $var + * @return $this + */ + public function setSubscriptionCost($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\SubscriptionCost::class); + $this->subscription_cost = $var; + + return $this; + } + + /** + * Loyalty points that users receive after purchasing the item. Japan only. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.LoyaltyPoints loyalty_points = 34; + * @return \Google\Shopping\Merchant\Products\V1beta\LoyaltyPoints|null + */ + public function getLoyaltyPoints() + { + return $this->loyalty_points; + } + + public function hasLoyaltyPoints() + { + return isset($this->loyalty_points); + } + + public function clearLoyaltyPoints() + { + unset($this->loyalty_points); + } + + /** + * Loyalty points that users receive after purchasing the item. Japan only. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.LoyaltyPoints loyalty_points = 34; + * @param \Google\Shopping\Merchant\Products\V1beta\LoyaltyPoints $var + * @return $this + */ + public function setLoyaltyPoints($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\LoyaltyPoints::class); + $this->loyalty_points = $var; + + return $this; + } + + /** + * A list of loyalty program information that is used to surface loyalty + * benefits (for example, better pricing, points, etc) to the user of this + * item. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.LoyaltyProgram loyalty_programs = 136; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLoyaltyPrograms() + { + return $this->loyalty_programs; + } + + /** + * A list of loyalty program information that is used to surface loyalty + * benefits (for example, better pricing, points, etc) to the user of this + * item. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.LoyaltyProgram loyalty_programs = 136; + * @param array<\Google\Shopping\Merchant\Products\V1beta\LoyaltyProgram>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLoyaltyPrograms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\LoyaltyProgram::class); + $this->loyalty_programs = $arr; + + return $this; + } + + /** + * Categories of the item (formatted as in [product data + * specification](https://support.google.com/merchants/answer/188494#product_type)). + * + * Generated from protobuf field repeated string product_types = 35; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProductTypes() + { + return $this->product_types; + } + + /** + * Categories of the item (formatted as in [product data + * specification](https://support.google.com/merchants/answer/188494#product_type)). + * + * Generated from protobuf field repeated string product_types = 35; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProductTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->product_types = $arr; + + return $this; + } + + /** + * Advertised sale price of the item. + * + * Generated from protobuf field .google.shopping.type.Price sale_price = 36; + * @return \Google\Shopping\Type\Price|null + */ + public function getSalePrice() + { + return $this->sale_price; + } + + public function hasSalePrice() + { + return isset($this->sale_price); + } + + public function clearSalePrice() + { + unset($this->sale_price); + } + + /** + * Advertised sale price of the item. + * + * Generated from protobuf field .google.shopping.type.Price sale_price = 36; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setSalePrice($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->sale_price = $var; + + return $this; + } + + /** + * Date range during which the item is on sale (see [product data + * specification](https://support.google.com/merchants/answer/188494#sale_price_effective_date)). + * + * Generated from protobuf field .google.type.Interval sale_price_effective_date = 37; + * @return \Google\Type\Interval|null + */ + public function getSalePriceEffectiveDate() + { + return $this->sale_price_effective_date; + } + + public function hasSalePriceEffectiveDate() + { + return isset($this->sale_price_effective_date); + } + + public function clearSalePriceEffectiveDate() + { + unset($this->sale_price_effective_date); + } + + /** + * Date range during which the item is on sale (see [product data + * specification](https://support.google.com/merchants/answer/188494#sale_price_effective_date)). + * + * Generated from protobuf field .google.type.Interval sale_price_effective_date = 37; + * @param \Google\Type\Interval $var + * @return $this + */ + public function setSalePriceEffectiveDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Interval::class); + $this->sale_price_effective_date = $var; + + return $this; + } + + /** + * The quantity of the product that is available for selling on Google. + * Supported only for online products. + * + * Generated from protobuf field optional int64 sell_on_google_quantity = 38; + * @return int|string + */ + public function getSellOnGoogleQuantity() + { + return isset($this->sell_on_google_quantity) ? $this->sell_on_google_quantity : 0; + } + + public function hasSellOnGoogleQuantity() + { + return isset($this->sell_on_google_quantity); + } + + public function clearSellOnGoogleQuantity() + { + unset($this->sell_on_google_quantity); + } + + /** + * The quantity of the product that is available for selling on Google. + * Supported only for online products. + * + * Generated from protobuf field optional int64 sell_on_google_quantity = 38; + * @param int|string $var + * @return $this + */ + public function setSellOnGoogleQuantity($var) + { + GPBUtil::checkInt64($var); + $this->sell_on_google_quantity = $var; + + return $this; + } + + /** + * The height of the product in the units provided. The value must be + * between + * 0 (exclusive) and 3000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductDimension product_height = 119; + * @return \Google\Shopping\Merchant\Products\V1beta\ProductDimension|null + */ + public function getProductHeight() + { + return $this->product_height; + } + + public function hasProductHeight() + { + return isset($this->product_height); + } + + public function clearProductHeight() + { + unset($this->product_height); + } + + /** + * The height of the product in the units provided. The value must be + * between + * 0 (exclusive) and 3000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductDimension product_height = 119; + * @param \Google\Shopping\Merchant\Products\V1beta\ProductDimension $var + * @return $this + */ + public function setProductHeight($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ProductDimension::class); + $this->product_height = $var; + + return $this; + } + + /** + * The length of the product in the units provided. The value must be + * between 0 (exclusive) and 3000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductDimension product_length = 120; + * @return \Google\Shopping\Merchant\Products\V1beta\ProductDimension|null + */ + public function getProductLength() + { + return $this->product_length; + } + + public function hasProductLength() + { + return isset($this->product_length); + } + + public function clearProductLength() + { + unset($this->product_length); + } + + /** + * The length of the product in the units provided. The value must be + * between 0 (exclusive) and 3000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductDimension product_length = 120; + * @param \Google\Shopping\Merchant\Products\V1beta\ProductDimension $var + * @return $this + */ + public function setProductLength($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ProductDimension::class); + $this->product_length = $var; + + return $this; + } + + /** + * The width of the product in the units provided. The value must be between + * 0 (exclusive) and 3000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductDimension product_width = 121; + * @return \Google\Shopping\Merchant\Products\V1beta\ProductDimension|null + */ + public function getProductWidth() + { + return $this->product_width; + } + + public function hasProductWidth() + { + return isset($this->product_width); + } + + public function clearProductWidth() + { + unset($this->product_width); + } + + /** + * The width of the product in the units provided. The value must be between + * 0 (exclusive) and 3000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductDimension product_width = 121; + * @param \Google\Shopping\Merchant\Products\V1beta\ProductDimension $var + * @return $this + */ + public function setProductWidth($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ProductDimension::class); + $this->product_width = $var; + + return $this; + } + + /** + * The weight of the product in the units provided. The value must be + * between 0 (exclusive) and 2000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductWeight product_weight = 122; + * @return \Google\Shopping\Merchant\Products\V1beta\ProductWeight|null + */ + public function getProductWeight() + { + return $this->product_weight; + } + + public function hasProductWeight() + { + return isset($this->product_weight); + } + + public function clearProductWeight() + { + unset($this->product_weight); + } + + /** + * The weight of the product in the units provided. The value must be + * between 0 (exclusive) and 2000 (inclusive). + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductWeight product_weight = 122; + * @param \Google\Shopping\Merchant\Products\V1beta\ProductWeight $var + * @return $this + */ + public function setProductWeight($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ProductWeight::class); + $this->product_weight = $var; + + return $this; + } + + /** + * Shipping rules. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Shipping shipping = 39; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShipping() + { + return $this->shipping; + } + + /** + * Shipping rules. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Shipping shipping = 39; + * @param array<\Google\Shopping\Merchant\Products\V1beta\Shipping>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShipping($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\Shipping::class); + $this->shipping = $arr; + + return $this; + } + + /** + * Conditions to be met for a product to have free shipping. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.FreeShippingThreshold free_shipping_threshold = 135; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFreeShippingThreshold() + { + return $this->free_shipping_threshold; + } + + /** + * Conditions to be met for a product to have free shipping. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.FreeShippingThreshold free_shipping_threshold = 135; + * @param array<\Google\Shopping\Merchant\Products\V1beta\FreeShippingThreshold>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFreeShippingThreshold($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\FreeShippingThreshold::class); + $this->free_shipping_threshold = $arr; + + return $this; + } + + /** + * Weight of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingWeight shipping_weight = 40; + * @return \Google\Shopping\Merchant\Products\V1beta\ShippingWeight|null + */ + public function getShippingWeight() + { + return $this->shipping_weight; + } + + public function hasShippingWeight() + { + return isset($this->shipping_weight); + } + + public function clearShippingWeight() + { + unset($this->shipping_weight); + } + + /** + * Weight of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingWeight shipping_weight = 40; + * @param \Google\Shopping\Merchant\Products\V1beta\ShippingWeight $var + * @return $this + */ + public function setShippingWeight($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ShippingWeight::class); + $this->shipping_weight = $var; + + return $this; + } + + /** + * Length of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingDimension shipping_length = 41; + * @return \Google\Shopping\Merchant\Products\V1beta\ShippingDimension|null + */ + public function getShippingLength() + { + return $this->shipping_length; + } + + public function hasShippingLength() + { + return isset($this->shipping_length); + } + + public function clearShippingLength() + { + unset($this->shipping_length); + } + + /** + * Length of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingDimension shipping_length = 41; + * @param \Google\Shopping\Merchant\Products\V1beta\ShippingDimension $var + * @return $this + */ + public function setShippingLength($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ShippingDimension::class); + $this->shipping_length = $var; + + return $this; + } + + /** + * Width of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingDimension shipping_width = 42; + * @return \Google\Shopping\Merchant\Products\V1beta\ShippingDimension|null + */ + public function getShippingWidth() + { + return $this->shipping_width; + } + + public function hasShippingWidth() + { + return isset($this->shipping_width); + } + + public function clearShippingWidth() + { + unset($this->shipping_width); + } + + /** + * Width of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingDimension shipping_width = 42; + * @param \Google\Shopping\Merchant\Products\V1beta\ShippingDimension $var + * @return $this + */ + public function setShippingWidth($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ShippingDimension::class); + $this->shipping_width = $var; + + return $this; + } + + /** + * Height of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingDimension shipping_height = 43; + * @return \Google\Shopping\Merchant\Products\V1beta\ShippingDimension|null + */ + public function getShippingHeight() + { + return $this->shipping_height; + } + + public function hasShippingHeight() + { + return isset($this->shipping_height); + } + + public function clearShippingHeight() + { + unset($this->shipping_height); + } + + /** + * Height of the item for shipping. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ShippingDimension shipping_height = 43; + * @param \Google\Shopping\Merchant\Products\V1beta\ShippingDimension $var + * @return $this + */ + public function setShippingHeight($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ShippingDimension::class); + $this->shipping_height = $var; + + return $this; + } + + /** + * Maximal product handling time (in business days). + * + * Generated from protobuf field optional int64 max_handling_time = 44; + * @return int|string + */ + public function getMaxHandlingTime() + { + return isset($this->max_handling_time) ? $this->max_handling_time : 0; + } + + public function hasMaxHandlingTime() + { + return isset($this->max_handling_time); + } + + public function clearMaxHandlingTime() + { + unset($this->max_handling_time); + } + + /** + * Maximal product handling time (in business days). + * + * Generated from protobuf field optional int64 max_handling_time = 44; + * @param int|string $var + * @return $this + */ + public function setMaxHandlingTime($var) + { + GPBUtil::checkInt64($var); + $this->max_handling_time = $var; + + return $this; + } + + /** + * Minimal product handling time (in business days). + * + * Generated from protobuf field optional int64 min_handling_time = 45; + * @return int|string + */ + public function getMinHandlingTime() + { + return isset($this->min_handling_time) ? $this->min_handling_time : 0; + } + + public function hasMinHandlingTime() + { + return isset($this->min_handling_time); + } + + public function clearMinHandlingTime() + { + unset($this->min_handling_time); + } + + /** + * Minimal product handling time (in business days). + * + * Generated from protobuf field optional int64 min_handling_time = 45; + * @param int|string $var + * @return $this + */ + public function setMinHandlingTime($var) + { + GPBUtil::checkInt64($var); + $this->min_handling_time = $var; + + return $this; + } + + /** + * The shipping label of the product, used to group product in account-level + * shipping rules. + * + * Generated from protobuf field optional string shipping_label = 46; + * @return string + */ + public function getShippingLabel() + { + return isset($this->shipping_label) ? $this->shipping_label : ''; + } + + public function hasShippingLabel() + { + return isset($this->shipping_label); + } + + public function clearShippingLabel() + { + unset($this->shipping_label); + } + + /** + * The shipping label of the product, used to group product in account-level + * shipping rules. + * + * Generated from protobuf field optional string shipping_label = 46; + * @param string $var + * @return $this + */ + public function setShippingLabel($var) + { + GPBUtil::checkString($var, True); + $this->shipping_label = $var; + + return $this; + } + + /** + * The transit time label of the product, used to group product in + * account-level transit time tables. + * + * Generated from protobuf field optional string transit_time_label = 47; + * @return string + */ + public function getTransitTimeLabel() + { + return isset($this->transit_time_label) ? $this->transit_time_label : ''; + } + + public function hasTransitTimeLabel() + { + return isset($this->transit_time_label); + } + + public function clearTransitTimeLabel() + { + unset($this->transit_time_label); + } + + /** + * The transit time label of the product, used to group product in + * account-level transit time tables. + * + * Generated from protobuf field optional string transit_time_label = 47; + * @param string $var + * @return $this + */ + public function setTransitTimeLabel($var) + { + GPBUtil::checkString($var, True); + $this->transit_time_label = $var; + + return $this; + } + + /** + * Size of the item. Only one value is allowed. For variants with different + * sizes, insert a separate product for each size with the same + * `itemGroupId` value (see + * [https://support.google.com/merchants/answer/6324492](size definition)). + * + * Generated from protobuf field optional string size = 48; + * @return string + */ + public function getSize() + { + return isset($this->size) ? $this->size : ''; + } + + public function hasSize() + { + return isset($this->size); + } + + public function clearSize() + { + unset($this->size); + } + + /** + * Size of the item. Only one value is allowed. For variants with different + * sizes, insert a separate product for each size with the same + * `itemGroupId` value (see + * [https://support.google.com/merchants/answer/6324492](size definition)). + * + * Generated from protobuf field optional string size = 48; + * @param string $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkString($var, True); + $this->size = $var; + + return $this; + } + + /** + * System in which the size is specified. Recommended for apparel items. + * + * Generated from protobuf field optional string size_system = 49; + * @return string + */ + public function getSizeSystem() + { + return isset($this->size_system) ? $this->size_system : ''; + } + + public function hasSizeSystem() + { + return isset($this->size_system); + } + + public function clearSizeSystem() + { + unset($this->size_system); + } + + /** + * System in which the size is specified. Recommended for apparel items. + * + * Generated from protobuf field optional string size_system = 49; + * @param string $var + * @return $this + */ + public function setSizeSystem($var) + { + GPBUtil::checkString($var, True); + $this->size_system = $var; + + return $this; + } + + /** + * The cut of the item. It can be used to represent combined size types for + * apparel items. Maximum two of size types can be provided (see + * [https://support.google.com/merchants/answer/6324497](size type)). + * + * Generated from protobuf field repeated string size_types = 50; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSizeTypes() + { + return $this->size_types; + } + + /** + * The cut of the item. It can be used to represent combined size types for + * apparel items. Maximum two of size types can be provided (see + * [https://support.google.com/merchants/answer/6324497](size type)). + * + * Generated from protobuf field repeated string size_types = 50; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSizeTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->size_types = $arr; + + return $this; + } + + /** + * Tax information. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Tax taxes = 51; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaxes() + { + return $this->taxes; + } + + /** + * Tax information. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Tax taxes = 51; + * @param array<\Google\Shopping\Merchant\Products\V1beta\Tax>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaxes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\Tax::class); + $this->taxes = $arr; + + return $this; + } + + /** + * The tax category of the product, used to configure detailed tax nexus + * in account-level tax settings. + * + * Generated from protobuf field optional string tax_category = 52; + * @return string + */ + public function getTaxCategory() + { + return isset($this->tax_category) ? $this->tax_category : ''; + } + + public function hasTaxCategory() + { + return isset($this->tax_category); + } + + public function clearTaxCategory() + { + unset($this->tax_category); + } + + /** + * The tax category of the product, used to configure detailed tax nexus + * in account-level tax settings. + * + * Generated from protobuf field optional string tax_category = 52; + * @param string $var + * @return $this + */ + public function setTaxCategory($var) + { + GPBUtil::checkString($var, True); + $this->tax_category = $var; + + return $this; + } + + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + * + * Generated from protobuf field optional string energy_efficiency_class = 53; + * @return string + */ + public function getEnergyEfficiencyClass() + { + return isset($this->energy_efficiency_class) ? $this->energy_efficiency_class : ''; + } + + public function hasEnergyEfficiencyClass() + { + return isset($this->energy_efficiency_class); + } + + public function clearEnergyEfficiencyClass() + { + unset($this->energy_efficiency_class); + } + + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + * + * Generated from protobuf field optional string energy_efficiency_class = 53; + * @param string $var + * @return $this + */ + public function setEnergyEfficiencyClass($var) + { + GPBUtil::checkString($var, True); + $this->energy_efficiency_class = $var; + + return $this; + } + + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + * + * Generated from protobuf field optional string min_energy_efficiency_class = 54; + * @return string + */ + public function getMinEnergyEfficiencyClass() + { + return isset($this->min_energy_efficiency_class) ? $this->min_energy_efficiency_class : ''; + } + + public function hasMinEnergyEfficiencyClass() + { + return isset($this->min_energy_efficiency_class); + } + + public function clearMinEnergyEfficiencyClass() + { + unset($this->min_energy_efficiency_class); + } + + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + * + * Generated from protobuf field optional string min_energy_efficiency_class = 54; + * @param string $var + * @return $this + */ + public function setMinEnergyEfficiencyClass($var) + { + GPBUtil::checkString($var, True); + $this->min_energy_efficiency_class = $var; + + return $this; + } + + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + * + * Generated from protobuf field optional string max_energy_efficiency_class = 55; + * @return string + */ + public function getMaxEnergyEfficiencyClass() + { + return isset($this->max_energy_efficiency_class) ? $this->max_energy_efficiency_class : ''; + } + + public function hasMaxEnergyEfficiencyClass() + { + return isset($this->max_energy_efficiency_class); + } + + public function clearMaxEnergyEfficiencyClass() + { + unset($this->max_energy_efficiency_class); + } + + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + * + * Generated from protobuf field optional string max_energy_efficiency_class = 55; + * @param string $var + * @return $this + */ + public function setMaxEnergyEfficiencyClass($var) + { + GPBUtil::checkString($var, True); + $this->max_energy_efficiency_class = $var; + + return $this; + } + + /** + * The measure and dimension of an item. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.UnitPricingMeasure unit_pricing_measure = 56; + * @return \Google\Shopping\Merchant\Products\V1beta\UnitPricingMeasure|null + */ + public function getUnitPricingMeasure() + { + return $this->unit_pricing_measure; + } + + public function hasUnitPricingMeasure() + { + return isset($this->unit_pricing_measure); + } + + public function clearUnitPricingMeasure() + { + unset($this->unit_pricing_measure); + } + + /** + * The measure and dimension of an item. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.UnitPricingMeasure unit_pricing_measure = 56; + * @param \Google\Shopping\Merchant\Products\V1beta\UnitPricingMeasure $var + * @return $this + */ + public function setUnitPricingMeasure($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\UnitPricingMeasure::class); + $this->unit_pricing_measure = $var; + + return $this; + } + + /** + * The preference of the denominator of the unit price. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.UnitPricingBaseMeasure unit_pricing_base_measure = 57; + * @return \Google\Shopping\Merchant\Products\V1beta\UnitPricingBaseMeasure|null + */ + public function getUnitPricingBaseMeasure() + { + return $this->unit_pricing_base_measure; + } + + public function hasUnitPricingBaseMeasure() + { + return isset($this->unit_pricing_base_measure); + } + + public function clearUnitPricingBaseMeasure() + { + unset($this->unit_pricing_base_measure); + } + + /** + * The preference of the denominator of the unit price. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.UnitPricingBaseMeasure unit_pricing_base_measure = 57; + * @param \Google\Shopping\Merchant\Products\V1beta\UnitPricingBaseMeasure $var + * @return $this + */ + public function setUnitPricingBaseMeasure($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\UnitPricingBaseMeasure::class); + $this->unit_pricing_base_measure = $var; + + return $this; + } + + /** + * The number of identical products in a merchant-defined multipack. + * + * Generated from protobuf field optional int64 multipack = 58; + * @return int|string + */ + public function getMultipack() + { + return isset($this->multipack) ? $this->multipack : 0; + } + + public function hasMultipack() + { + return isset($this->multipack); + } + + public function clearMultipack() + { + unset($this->multipack); + } + + /** + * The number of identical products in a merchant-defined multipack. + * + * Generated from protobuf field optional int64 multipack = 58; + * @param int|string $var + * @return $this + */ + public function setMultipack($var) + { + GPBUtil::checkInt64($var); + $this->multipack = $var; + + return $this; + } + + /** + * Used to group items in an arbitrary way. Only for CPA%, discouraged + * otherwise. + * + * Generated from protobuf field optional string ads_grouping = 59; + * @return string + */ + public function getAdsGrouping() + { + return isset($this->ads_grouping) ? $this->ads_grouping : ''; + } + + public function hasAdsGrouping() + { + return isset($this->ads_grouping); + } + + public function clearAdsGrouping() + { + unset($this->ads_grouping); + } + + /** + * Used to group items in an arbitrary way. Only for CPA%, discouraged + * otherwise. + * + * Generated from protobuf field optional string ads_grouping = 59; + * @param string $var + * @return $this + */ + public function setAdsGrouping($var) + { + GPBUtil::checkString($var, True); + $this->ads_grouping = $var; + + return $this; + } + + /** + * Similar to ads_grouping, but only works on CPC. + * + * Generated from protobuf field repeated string ads_labels = 60; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdsLabels() + { + return $this->ads_labels; + } + + /** + * Similar to ads_grouping, but only works on CPC. + * + * Generated from protobuf field repeated string ads_labels = 60; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdsLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ads_labels = $arr; + + return $this; + } + + /** + * Allows advertisers to override the item URL when the product is shown + * within the context of Product ads. + * + * Generated from protobuf field optional string ads_redirect = 61; + * @return string + */ + public function getAdsRedirect() + { + return isset($this->ads_redirect) ? $this->ads_redirect : ''; + } + + public function hasAdsRedirect() + { + return isset($this->ads_redirect); + } + + public function clearAdsRedirect() + { + unset($this->ads_redirect); + } + + /** + * Allows advertisers to override the item URL when the product is shown + * within the context of Product ads. + * + * Generated from protobuf field optional string ads_redirect = 61; + * @param string $var + * @return $this + */ + public function setAdsRedirect($var) + { + GPBUtil::checkString($var, True); + $this->ads_redirect = $var; + + return $this; + } + + /** + * Cost of goods sold. Used for gross profit reporting. + * + * Generated from protobuf field .google.shopping.type.Price cost_of_goods_sold = 62; + * @return \Google\Shopping\Type\Price|null + */ + public function getCostOfGoodsSold() + { + return $this->cost_of_goods_sold; + } + + public function hasCostOfGoodsSold() + { + return isset($this->cost_of_goods_sold); + } + + public function clearCostOfGoodsSold() + { + unset($this->cost_of_goods_sold); + } + + /** + * Cost of goods sold. Used for gross profit reporting. + * + * Generated from protobuf field .google.shopping.type.Price cost_of_goods_sold = 62; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setCostOfGoodsSold($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->cost_of_goods_sold = $var; + + return $this; + } + + /** + * Technical specification or additional product details. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.ProductDetail product_details = 63; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProductDetails() + { + return $this->product_details; + } + + /** + * Technical specification or additional product details. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.ProductDetail product_details = 63; + * @param array<\Google\Shopping\Merchant\Products\V1beta\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProductDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\ProductDetail::class); + $this->product_details = $arr; + + return $this; + } + + /** + * Bullet points describing the most relevant highlights of a product. + * + * Generated from protobuf field repeated string product_highlights = 64; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProductHighlights() + { + return $this->product_highlights; + } + + /** + * Bullet points describing the most relevant highlights of a product. + * + * Generated from protobuf field repeated string product_highlights = 64; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProductHighlights($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->product_highlights = $arr; + + return $this; + } + + /** + * An identifier for an item for dynamic remarketing campaigns. + * + * Generated from protobuf field optional string display_ads_id = 65; + * @return string + */ + public function getDisplayAdsId() + { + return isset($this->display_ads_id) ? $this->display_ads_id : ''; + } + + public function hasDisplayAdsId() + { + return isset($this->display_ads_id); + } + + public function clearDisplayAdsId() + { + unset($this->display_ads_id); + } + + /** + * An identifier for an item for dynamic remarketing campaigns. + * + * Generated from protobuf field optional string display_ads_id = 65; + * @param string $var + * @return $this + */ + public function setDisplayAdsId($var) + { + GPBUtil::checkString($var, True); + $this->display_ads_id = $var; + + return $this; + } + + /** + * Advertiser-specified recommendations. + * + * Generated from protobuf field repeated string display_ads_similar_ids = 66; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisplayAdsSimilarIds() + { + return $this->display_ads_similar_ids; + } + + /** + * Advertiser-specified recommendations. + * + * Generated from protobuf field repeated string display_ads_similar_ids = 66; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisplayAdsSimilarIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->display_ads_similar_ids = $arr; + + return $this; + } + + /** + * Title of an item for dynamic remarketing campaigns. + * + * Generated from protobuf field optional string display_ads_title = 67; + * @return string + */ + public function getDisplayAdsTitle() + { + return isset($this->display_ads_title) ? $this->display_ads_title : ''; + } + + public function hasDisplayAdsTitle() + { + return isset($this->display_ads_title); + } + + public function clearDisplayAdsTitle() + { + unset($this->display_ads_title); + } + + /** + * Title of an item for dynamic remarketing campaigns. + * + * Generated from protobuf field optional string display_ads_title = 67; + * @param string $var + * @return $this + */ + public function setDisplayAdsTitle($var) + { + GPBUtil::checkString($var, True); + $this->display_ads_title = $var; + + return $this; + } + + /** + * URL directly to your item's landing page for dynamic remarketing + * campaigns. + * + * Generated from protobuf field optional string display_ads_link = 68; + * @return string + */ + public function getDisplayAdsLink() + { + return isset($this->display_ads_link) ? $this->display_ads_link : ''; + } + + public function hasDisplayAdsLink() + { + return isset($this->display_ads_link); + } + + public function clearDisplayAdsLink() + { + unset($this->display_ads_link); + } + + /** + * URL directly to your item's landing page for dynamic remarketing + * campaigns. + * + * Generated from protobuf field optional string display_ads_link = 68; + * @param string $var + * @return $this + */ + public function setDisplayAdsLink($var) + { + GPBUtil::checkString($var, True); + $this->display_ads_link = $var; + + return $this; + } + + /** + * Offer margin for dynamic remarketing campaigns. + * + * Generated from protobuf field optional double display_ads_value = 69; + * @return float + */ + public function getDisplayAdsValue() + { + return isset($this->display_ads_value) ? $this->display_ads_value : 0.0; + } + + public function hasDisplayAdsValue() + { + return isset($this->display_ads_value); + } + + public function clearDisplayAdsValue() + { + unset($this->display_ads_value); + } + + /** + * Offer margin for dynamic remarketing campaigns. + * + * Generated from protobuf field optional double display_ads_value = 69; + * @param float $var + * @return $this + */ + public function setDisplayAdsValue($var) + { + GPBUtil::checkDouble($var); + $this->display_ads_value = $var; + + return $this; + } + + /** + * The unique ID of a promotion. + * + * Generated from protobuf field repeated string promotion_ids = 70; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPromotionIds() + { + return $this->promotion_ids; + } + + /** + * The unique ID of a promotion. + * + * Generated from protobuf field repeated string promotion_ids = 70; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPromotionIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->promotion_ids = $arr; + + return $this; + } + + /** + * The pick up option for the item. + * + * Generated from protobuf field optional string pickup_method = 80; + * @return string + */ + public function getPickupMethod() + { + return isset($this->pickup_method) ? $this->pickup_method : ''; + } + + public function hasPickupMethod() + { + return isset($this->pickup_method); + } + + public function clearPickupMethod() + { + unset($this->pickup_method); + } + + /** + * The pick up option for the item. + * + * Generated from protobuf field optional string pickup_method = 80; + * @param string $var + * @return $this + */ + public function setPickupMethod($var) + { + GPBUtil::checkString($var, True); + $this->pickup_method = $var; + + return $this; + } + + /** + * Item store pickup timeline. + * + * Generated from protobuf field optional string pickup_sla = 81; + * @return string + */ + public function getPickupSla() + { + return isset($this->pickup_sla) ? $this->pickup_sla : ''; + } + + public function hasPickupSla() + { + return isset($this->pickup_sla); + } + + public function clearPickupSla() + { + unset($this->pickup_sla); + } + + /** + * Item store pickup timeline. + * + * Generated from protobuf field optional string pickup_sla = 81; + * @param string $var + * @return $this + */ + public function setPickupSla($var) + { + GPBUtil::checkString($var, True); + $this->pickup_sla = $var; + + return $this; + } + + /** + * Link template for merchant hosted local storefront. + * + * Generated from protobuf field optional string link_template = 82; + * @return string + */ + public function getLinkTemplate() + { + return isset($this->link_template) ? $this->link_template : ''; + } + + public function hasLinkTemplate() + { + return isset($this->link_template); + } + + public function clearLinkTemplate() + { + unset($this->link_template); + } + + /** + * Link template for merchant hosted local storefront. + * + * Generated from protobuf field optional string link_template = 82; + * @param string $var + * @return $this + */ + public function setLinkTemplate($var) + { + GPBUtil::checkString($var, True); + $this->link_template = $var; + + return $this; + } + + /** + * Link template for merchant hosted local storefront optimized for mobile + * devices. + * + * Generated from protobuf field optional string mobile_link_template = 83; + * @return string + */ + public function getMobileLinkTemplate() + { + return isset($this->mobile_link_template) ? $this->mobile_link_template : ''; + } + + public function hasMobileLinkTemplate() + { + return isset($this->mobile_link_template); + } + + public function clearMobileLinkTemplate() + { + unset($this->mobile_link_template); + } + + /** + * Link template for merchant hosted local storefront optimized for mobile + * devices. + * + * Generated from protobuf field optional string mobile_link_template = 83; + * @param string $var + * @return $this + */ + public function setMobileLinkTemplate($var) + { + GPBUtil::checkString($var, True); + $this->mobile_link_template = $var; + + return $this; + } + + /** + * Custom label 0 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_0 = 71; + * @return string + */ + public function getCustomLabel0() + { + return isset($this->custom_label_0) ? $this->custom_label_0 : ''; + } + + public function hasCustomLabel0() + { + return isset($this->custom_label_0); + } + + public function clearCustomLabel0() + { + unset($this->custom_label_0); + } + + /** + * Custom label 0 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_0 = 71; + * @param string $var + * @return $this + */ + public function setCustomLabel0($var) + { + GPBUtil::checkString($var, True); + $this->custom_label_0 = $var; + + return $this; + } + + /** + * Custom label 1 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_1 = 72; + * @return string + */ + public function getCustomLabel1() + { + return isset($this->custom_label_1) ? $this->custom_label_1 : ''; + } + + public function hasCustomLabel1() + { + return isset($this->custom_label_1); + } + + public function clearCustomLabel1() + { + unset($this->custom_label_1); + } + + /** + * Custom label 1 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_1 = 72; + * @param string $var + * @return $this + */ + public function setCustomLabel1($var) + { + GPBUtil::checkString($var, True); + $this->custom_label_1 = $var; + + return $this; + } + + /** + * Custom label 2 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_2 = 73; + * @return string + */ + public function getCustomLabel2() + { + return isset($this->custom_label_2) ? $this->custom_label_2 : ''; + } + + public function hasCustomLabel2() + { + return isset($this->custom_label_2); + } + + public function clearCustomLabel2() + { + unset($this->custom_label_2); + } + + /** + * Custom label 2 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_2 = 73; + * @param string $var + * @return $this + */ + public function setCustomLabel2($var) + { + GPBUtil::checkString($var, True); + $this->custom_label_2 = $var; + + return $this; + } + + /** + * Custom label 3 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_3 = 74; + * @return string + */ + public function getCustomLabel3() + { + return isset($this->custom_label_3) ? $this->custom_label_3 : ''; + } + + public function hasCustomLabel3() + { + return isset($this->custom_label_3); + } + + public function clearCustomLabel3() + { + unset($this->custom_label_3); + } + + /** + * Custom label 3 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_3 = 74; + * @param string $var + * @return $this + */ + public function setCustomLabel3($var) + { + GPBUtil::checkString($var, True); + $this->custom_label_3 = $var; + + return $this; + } + + /** + * Custom label 4 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_4 = 75; + * @return string + */ + public function getCustomLabel4() + { + return isset($this->custom_label_4) ? $this->custom_label_4 : ''; + } + + public function hasCustomLabel4() + { + return isset($this->custom_label_4); + } + + public function clearCustomLabel4() + { + unset($this->custom_label_4); + } + + /** + * Custom label 4 for custom grouping of items in a Shopping campaign. + * + * Generated from protobuf field optional string custom_label_4 = 75; + * @param string $var + * @return $this + */ + public function setCustomLabel4($var) + { + GPBUtil::checkString($var, True); + $this->custom_label_4 = $var; + + return $this; + } + + /** + * The list of destinations to include for this target (corresponds to + * checked check boxes in Merchant Center). Default destinations are always + * included unless provided in `excludedDestinations`. + * + * Generated from protobuf field repeated string included_destinations = 76; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIncludedDestinations() + { + return $this->included_destinations; + } + + /** + * The list of destinations to include for this target (corresponds to + * checked check boxes in Merchant Center). Default destinations are always + * included unless provided in `excludedDestinations`. + * + * Generated from protobuf field repeated string included_destinations = 76; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIncludedDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->included_destinations = $arr; + + return $this; + } + + /** + * The list of destinations to exclude for this target (corresponds to + * unchecked check boxes in Merchant Center). + * + * Generated from protobuf field repeated string excluded_destinations = 77; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExcludedDestinations() + { + return $this->excluded_destinations; + } + + /** + * The list of destinations to exclude for this target (corresponds to + * unchecked check boxes in Merchant Center). + * + * Generated from protobuf field repeated string excluded_destinations = 77; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExcludedDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->excluded_destinations = $arr; + + return $this; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) to exclude the offer from + * Shopping Ads destination. + * Countries from this list are removed from countries configured + * in data source settings. + * + * Generated from protobuf field repeated string shopping_ads_excluded_countries = 78; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShoppingAdsExcludedCountries() + { + return $this->shopping_ads_excluded_countries; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) to exclude the offer from + * Shopping Ads destination. + * Countries from this list are removed from countries configured + * in data source settings. + * + * Generated from protobuf field repeated string shopping_ads_excluded_countries = 78; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShoppingAdsExcludedCountries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->shopping_ads_excluded_countries = $arr; + + return $this; + } + + /** + * Required for multi-seller accounts. Use this attribute if you're a + * marketplace uploading products for various sellers to your multi-seller + * account. + * + * Generated from protobuf field optional string external_seller_id = 1; + * @return string + */ + public function getExternalSellerId() + { + return isset($this->external_seller_id) ? $this->external_seller_id : ''; + } + + public function hasExternalSellerId() + { + return isset($this->external_seller_id); + } + + public function clearExternalSellerId() + { + unset($this->external_seller_id); + } + + /** + * Required for multi-seller accounts. Use this attribute if you're a + * marketplace uploading products for various sellers to your multi-seller + * account. + * + * Generated from protobuf field optional string external_seller_id = 1; + * @param string $var + * @return $this + */ + public function setExternalSellerId($var) + { + GPBUtil::checkString($var, True); + $this->external_seller_id = $var; + + return $this; + } + + /** + * Publication of this item will be temporarily + * [paused](https://support.google.com/merchants/answer/11909930). + * + * Generated from protobuf field optional string pause = 13; + * @return string + */ + public function getPause() + { + return isset($this->pause) ? $this->pause : ''; + } + + public function hasPause() + { + return isset($this->pause); + } + + public function clearPause() + { + unset($this->pause); + } + + /** + * Publication of this item will be temporarily + * [paused](https://support.google.com/merchants/answer/11909930). + * + * Generated from protobuf field optional string pause = 13; + * @param string $var + * @return $this + */ + public function setPause($var) + { + GPBUtil::checkString($var, True); + $this->pause = $var; + + return $this; + } + + /** + * Additional URLs of lifestyle images of the item, used to explicitly + * identify images that showcase your item in a real-world context. See the + * [Help Center article](https://support.google.com/merchants/answer/9103186) + * for more information. + * + * Generated from protobuf field repeated string lifestyle_image_links = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLifestyleImageLinks() + { + return $this->lifestyle_image_links; + } + + /** + * Additional URLs of lifestyle images of the item, used to explicitly + * identify images that showcase your item in a real-world context. See the + * [Help Center article](https://support.google.com/merchants/answer/9103186) + * for more information. + * + * Generated from protobuf field repeated string lifestyle_image_links = 14; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLifestyleImageLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->lifestyle_image_links = $arr; + + return $this; + } + + /** + * Extra fields to export to the Cloud Retail program. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.CloudExportAdditionalProperties cloud_export_additional_properties = 84; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCloudExportAdditionalProperties() + { + return $this->cloud_export_additional_properties; + } + + /** + * Extra fields to export to the Cloud Retail program. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.CloudExportAdditionalProperties cloud_export_additional_properties = 84; + * @param array<\Google\Shopping\Merchant\Products\V1beta\CloudExportAdditionalProperties>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCloudExportAdditionalProperties($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\CloudExportAdditionalProperties::class); + $this->cloud_export_additional_properties = $arr; + + return $this; + } + + /** + * URL of the 3D image of the item. See the + * [Help Center article](https://support.google.com/merchants/answer/13674896) + * for more information. + * + * Generated from protobuf field optional string virtual_model_link = 130; + * @return string + */ + public function getVirtualModelLink() + { + return isset($this->virtual_model_link) ? $this->virtual_model_link : ''; + } + + public function hasVirtualModelLink() + { + return isset($this->virtual_model_link); + } + + public function clearVirtualModelLink() + { + unset($this->virtual_model_link); + } + + /** + * URL of the 3D image of the item. See the + * [Help Center article](https://support.google.com/merchants/answer/13674896) + * for more information. + * + * Generated from protobuf field optional string virtual_model_link = 130; + * @param string $var + * @return $this + */ + public function setVirtualModelLink($var) + { + GPBUtil::checkString($var, True); + $this->virtual_model_link = $var; + + return $this; + } + + /** + * Product Certifications, for example for energy efficiency labeling of + * products recorded in the [EU EPREL](https://eprel.ec.europa.eu/screen/home) + * database. See the [Help + * Center](https://support.google.com/merchants/answer/13528839) + * article for more information. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Certification certifications = 123; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCertifications() + { + return $this->certifications; + } + + /** + * Product Certifications, for example for energy efficiency labeling of + * products recorded in the [EU EPREL](https://eprel.ec.europa.eu/screen/home) + * database. See the [Help + * Center](https://support.google.com/merchants/answer/13528839) + * article for more information. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Certification certifications = 123; + * @param array<\Google\Shopping\Merchant\Products\V1beta\Certification>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCertifications($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\Certification::class); + $this->certifications = $arr; + + return $this; + } + + /** + * Structured title, for algorithmically (AI)-generated titles. + * + * Generated from protobuf field optional .google.shopping.merchant.products.v1beta.ProductStructuredTitle structured_title = 132; + * @return \Google\Shopping\Merchant\Products\V1beta\ProductStructuredTitle|null + */ + public function getStructuredTitle() + { + return $this->structured_title; + } + + public function hasStructuredTitle() + { + return isset($this->structured_title); + } + + public function clearStructuredTitle() + { + unset($this->structured_title); + } + + /** + * Structured title, for algorithmically (AI)-generated titles. + * + * Generated from protobuf field optional .google.shopping.merchant.products.v1beta.ProductStructuredTitle structured_title = 132; + * @param \Google\Shopping\Merchant\Products\V1beta\ProductStructuredTitle $var + * @return $this + */ + public function setStructuredTitle($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ProductStructuredTitle::class); + $this->structured_title = $var; + + return $this; + } + + /** + * Structured description, for algorithmically (AI)-generated descriptions. + * + * Generated from protobuf field optional .google.shopping.merchant.products.v1beta.ProductStructuredDescription structured_description = 133; + * @return \Google\Shopping\Merchant\Products\V1beta\ProductStructuredDescription|null + */ + public function getStructuredDescription() + { + return $this->structured_description; + } + + public function hasStructuredDescription() + { + return isset($this->structured_description); + } + + public function clearStructuredDescription() + { + unset($this->structured_description); + } + + /** + * Structured description, for algorithmically (AI)-generated descriptions. + * + * Generated from protobuf field optional .google.shopping.merchant.products.v1beta.ProductStructuredDescription structured_description = 133; + * @param \Google\Shopping\Merchant\Products\V1beta\ProductStructuredDescription $var + * @return $this + */ + public function setStructuredDescription($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ProductStructuredDescription::class); + $this->structured_description = $var; + + return $this; + } + + /** + * A safeguard in the "Automated Discounts" + * (https://support.google.com/merchants/answer/10295759) and + * "Dynamic Promotions" + * (https://support.google.com/merchants/answer/13949249) projects, + * ensuring that discounts on merchants' offers do not fall below this value, + * thereby preserving the offer's value and profitability. + * + * Generated from protobuf field .google.shopping.type.Price auto_pricing_min_price = 124; + * @return \Google\Shopping\Type\Price|null + */ + public function getAutoPricingMinPrice() + { + return $this->auto_pricing_min_price; + } + + public function hasAutoPricingMinPrice() + { + return isset($this->auto_pricing_min_price); + } + + public function clearAutoPricingMinPrice() + { + unset($this->auto_pricing_min_price); + } + + /** + * A safeguard in the "Automated Discounts" + * (https://support.google.com/merchants/answer/10295759) and + * "Dynamic Promotions" + * (https://support.google.com/merchants/answer/13949249) projects, + * ensuring that discounts on merchants' offers do not fall below this value, + * thereby preserving the offer's value and profitability. + * + * Generated from protobuf field .google.shopping.type.Price auto_pricing_min_price = 124; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setAutoPricingMinPrice($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->auto_pricing_min_price = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/Certification.php b/ShoppingMerchantProducts/src/V1beta/Certification.php new file mode 100644 index 000000000000..4fb13756a085 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/Certification.php @@ -0,0 +1,232 @@ +google.shopping.merchant.products.v1beta.Certification + */ +class Certification extends \Google\Protobuf\Internal\Message +{ + /** + * The certification authority, for example "European_Commission". + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_authority = 1; + */ + protected $certification_authority = null; + /** + * The name of the certification, for example "EPREL". + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_name = 2; + */ + protected $certification_name = null; + /** + * The certification code. + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_code = 3; + */ + protected $certification_code = null; + /** + * The certification value (also known as class, level or grade), for example + * "A+", "C", "gold". + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_value = 4; + */ + protected $certification_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $certification_authority + * The certification authority, for example "European_Commission". + * Maximum length is 2000 characters. + * @type string $certification_name + * The name of the certification, for example "EPREL". + * Maximum length is 2000 characters. + * @type string $certification_code + * The certification code. + * Maximum length is 2000 characters. + * @type string $certification_value + * The certification value (also known as class, level or grade), for example + * "A+", "C", "gold". + * Maximum length is 2000 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The certification authority, for example "European_Commission". + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_authority = 1; + * @return string + */ + public function getCertificationAuthority() + { + return isset($this->certification_authority) ? $this->certification_authority : ''; + } + + public function hasCertificationAuthority() + { + return isset($this->certification_authority); + } + + public function clearCertificationAuthority() + { + unset($this->certification_authority); + } + + /** + * The certification authority, for example "European_Commission". + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_authority = 1; + * @param string $var + * @return $this + */ + public function setCertificationAuthority($var) + { + GPBUtil::checkString($var, True); + $this->certification_authority = $var; + + return $this; + } + + /** + * The name of the certification, for example "EPREL". + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_name = 2; + * @return string + */ + public function getCertificationName() + { + return isset($this->certification_name) ? $this->certification_name : ''; + } + + public function hasCertificationName() + { + return isset($this->certification_name); + } + + public function clearCertificationName() + { + unset($this->certification_name); + } + + /** + * The name of the certification, for example "EPREL". + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_name = 2; + * @param string $var + * @return $this + */ + public function setCertificationName($var) + { + GPBUtil::checkString($var, True); + $this->certification_name = $var; + + return $this; + } + + /** + * The certification code. + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_code = 3; + * @return string + */ + public function getCertificationCode() + { + return isset($this->certification_code) ? $this->certification_code : ''; + } + + public function hasCertificationCode() + { + return isset($this->certification_code); + } + + public function clearCertificationCode() + { + unset($this->certification_code); + } + + /** + * The certification code. + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_code = 3; + * @param string $var + * @return $this + */ + public function setCertificationCode($var) + { + GPBUtil::checkString($var, True); + $this->certification_code = $var; + + return $this; + } + + /** + * The certification value (also known as class, level or grade), for example + * "A+", "C", "gold". + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_value = 4; + * @return string + */ + public function getCertificationValue() + { + return isset($this->certification_value) ? $this->certification_value : ''; + } + + public function hasCertificationValue() + { + return isset($this->certification_value); + } + + public function clearCertificationValue() + { + unset($this->certification_value); + } + + /** + * The certification value (also known as class, level or grade), for example + * "A+", "C", "gold". + * Maximum length is 2000 characters. + * + * Generated from protobuf field optional string certification_value = 4; + * @param string $var + * @return $this + */ + public function setCertificationValue($var) + { + GPBUtil::checkString($var, True); + $this->certification_value = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/Client/ProductInputsServiceClient.php b/ShoppingMerchantProducts/src/V1beta/Client/ProductInputsServiceClient.php new file mode 100644 index 000000000000..fe1d7d3475e8 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/Client/ProductInputsServiceClient.php @@ -0,0 +1,304 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/product_inputs_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/product_inputs_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/product_inputs_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/product_inputs_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * product_input resource. + * + * @param string $account + * @param string $productinput + * + * @return string The formatted product_input resource. + * + * @experimental + */ + public static function productInputName(string $account, string $productinput): string + { + return self::getPathTemplate('productInput')->render([ + 'account' => $account, + 'productinput' => $productinput, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - productInput: accounts/{account}/productInputs/{productinput} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes a product input from your Merchant Center account. + * + * After inserting, updating, or deleting a product input, it may take several + * minutes before the processed product can be retrieved. + * + * The async variant is + * {@see ProductInputsServiceClient::deleteProductInputAsync()} . + * + * @example samples/V1beta/ProductInputsServiceClient/delete_product_input.php + * + * @param DeleteProductInputRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteProductInput(DeleteProductInputRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteProductInput', $request, $callOptions)->wait(); + } + + /** + * Uploads a product input to your Merchant Center account. If an input + * with the same contentLanguage, offerId, and dataSource already exists, + * this method replaces that entry. + * + * After inserting, updating, or deleting a product input, it may take several + * minutes before the processed product can be retrieved. + * + * The async variant is + * {@see ProductInputsServiceClient::insertProductInputAsync()} . + * + * @example samples/V1beta/ProductInputsServiceClient/insert_product_input.php + * + * @param InsertProductInputRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ProductInput + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function insertProductInput(InsertProductInputRequest $request, array $callOptions = []): ProductInput + { + return $this->startApiCall('InsertProductInput', $request, $callOptions)->wait(); + } +} diff --git a/ShoppingMerchantProducts/src/V1beta/Client/ProductsServiceClient.php b/ShoppingMerchantProducts/src/V1beta/Client/ProductsServiceClient.php new file mode 100644 index 000000000000..ed36d24d1bd3 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/Client/ProductsServiceClient.php @@ -0,0 +1,305 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/products_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/products_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/products_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/products_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a account + * resource. + * + * @param string $account + * + * @return string The formatted account resource. + * + * @experimental + */ + public static function accountName(string $account): string + { + return self::getPathTemplate('account')->render([ + 'account' => $account, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a product + * resource. + * + * @param string $account + * @param string $product + * + * @return string The formatted product resource. + * + * @experimental + */ + public static function productName(string $account, string $product): string + { + return self::getPathTemplate('product')->render([ + 'account' => $account, + 'product' => $product, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - account: accounts/{account} + * - product: accounts/{account}/products/{product} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the processed product from your Merchant Center account. + * + * After inserting, updating, or deleting a product input, it may take several + * minutes before the updated final product can be retrieved. + * + * The async variant is {@see ProductsServiceClient::getProductAsync()} . + * + * @example samples/V1beta/ProductsServiceClient/get_product.php + * + * @param GetProductRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Product + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getProduct(GetProductRequest $request, array $callOptions = []): Product + { + return $this->startApiCall('GetProduct', $request, $callOptions)->wait(); + } + + /** + * Lists the processed products in your Merchant Center account. The response + * might contain fewer items than specified by pageSize. Rely on pageToken to + * determine if there are more items to be requested. + * + * After inserting, updating, or deleting a product input, it may take several + * minutes before the updated processed product can be retrieved. + * + * The async variant is {@see ProductsServiceClient::listProductsAsync()} . + * + * @example samples/V1beta/ProductsServiceClient/list_products.php + * + * @param ListProductsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listProducts(ListProductsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListProducts', $request, $callOptions); + } +} diff --git a/ShoppingMerchantProducts/src/V1beta/CloudExportAdditionalProperties.php b/ShoppingMerchantProducts/src/V1beta/CloudExportAdditionalProperties.php new file mode 100644 index 000000000000..11f9f31a43d2 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/CloudExportAdditionalProperties.php @@ -0,0 +1,409 @@ +google.shopping.merchant.products.v1beta.CloudExportAdditionalProperties + */ +class CloudExportAdditionalProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the given property. For example, + * "Screen-Resolution" for a TV product. Maximum string size is 256 + * characters. + * + * Generated from protobuf field optional string property_name = 1; + */ + protected $property_name = null; + /** + * Text value of the given property. For example, + * "8K(UHD)" could be a text value for a TV product. Maximum + * repeatedness of this value is 400. Values are stored in an arbitrary but + * consistent order. Maximum string size is 256 characters. + * + * Generated from protobuf field repeated string text_value = 2; + */ + private $text_value; + /** + * Boolean value of the given property. For example for a TV product, + * "True" or "False" if the screen is UHD. + * + * Generated from protobuf field optional bool bool_value = 3; + */ + protected $bool_value = null; + /** + * Integer values of the given property. For example, 1080 for a TV + * product's Screen Resolution. Maximum repeatedness of this value + * is 400. Values are stored in an arbitrary but consistent order. + * + * Generated from protobuf field repeated int64 int_value = 4; + */ + private $int_value; + /** + * Float values of the given property. For example for a TV product + * 1.2345. Maximum repeatedness of this value is 400. Values + * are stored in an arbitrary but consistent order. + * + * Generated from protobuf field repeated float float_value = 5; + */ + private $float_value; + /** + * Minimum float value of the given property. For example for a TV + * product 1.00. + * + * Generated from protobuf field optional float min_value = 6; + */ + protected $min_value = null; + /** + * Maximum float value of the given property. For example for a TV + * product 100.00. + * + * Generated from protobuf field optional float max_value = 7; + */ + protected $max_value = null; + /** + * Unit of the given property. For example, "Pixels" for a TV product. Maximum + * string size is 256B. + * + * Generated from protobuf field optional string unit_code = 8; + */ + protected $unit_code = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $property_name + * Name of the given property. For example, + * "Screen-Resolution" for a TV product. Maximum string size is 256 + * characters. + * @type array|\Google\Protobuf\Internal\RepeatedField $text_value + * Text value of the given property. For example, + * "8K(UHD)" could be a text value for a TV product. Maximum + * repeatedness of this value is 400. Values are stored in an arbitrary but + * consistent order. Maximum string size is 256 characters. + * @type bool $bool_value + * Boolean value of the given property. For example for a TV product, + * "True" or "False" if the screen is UHD. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $int_value + * Integer values of the given property. For example, 1080 for a TV + * product's Screen Resolution. Maximum repeatedness of this value + * is 400. Values are stored in an arbitrary but consistent order. + * @type array|\Google\Protobuf\Internal\RepeatedField $float_value + * Float values of the given property. For example for a TV product + * 1.2345. Maximum repeatedness of this value is 400. Values + * are stored in an arbitrary but consistent order. + * @type float $min_value + * Minimum float value of the given property. For example for a TV + * product 1.00. + * @type float $max_value + * Maximum float value of the given property. For example for a TV + * product 100.00. + * @type string $unit_code + * Unit of the given property. For example, "Pixels" for a TV product. Maximum + * string size is 256B. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Name of the given property. For example, + * "Screen-Resolution" for a TV product. Maximum string size is 256 + * characters. + * + * Generated from protobuf field optional string property_name = 1; + * @return string + */ + public function getPropertyName() + { + return isset($this->property_name) ? $this->property_name : ''; + } + + public function hasPropertyName() + { + return isset($this->property_name); + } + + public function clearPropertyName() + { + unset($this->property_name); + } + + /** + * Name of the given property. For example, + * "Screen-Resolution" for a TV product. Maximum string size is 256 + * characters. + * + * Generated from protobuf field optional string property_name = 1; + * @param string $var + * @return $this + */ + public function setPropertyName($var) + { + GPBUtil::checkString($var, True); + $this->property_name = $var; + + return $this; + } + + /** + * Text value of the given property. For example, + * "8K(UHD)" could be a text value for a TV product. Maximum + * repeatedness of this value is 400. Values are stored in an arbitrary but + * consistent order. Maximum string size is 256 characters. + * + * Generated from protobuf field repeated string text_value = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTextValue() + { + return $this->text_value; + } + + /** + * Text value of the given property. For example, + * "8K(UHD)" could be a text value for a TV product. Maximum + * repeatedness of this value is 400. Values are stored in an arbitrary but + * consistent order. Maximum string size is 256 characters. + * + * Generated from protobuf field repeated string text_value = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTextValue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_value = $arr; + + return $this; + } + + /** + * Boolean value of the given property. For example for a TV product, + * "True" or "False" if the screen is UHD. + * + * Generated from protobuf field optional bool bool_value = 3; + * @return bool + */ + public function getBoolValue() + { + return isset($this->bool_value) ? $this->bool_value : false; + } + + public function hasBoolValue() + { + return isset($this->bool_value); + } + + public function clearBoolValue() + { + unset($this->bool_value); + } + + /** + * Boolean value of the given property. For example for a TV product, + * "True" or "False" if the screen is UHD. + * + * Generated from protobuf field optional bool bool_value = 3; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->bool_value = $var; + + return $this; + } + + /** + * Integer values of the given property. For example, 1080 for a TV + * product's Screen Resolution. Maximum repeatedness of this value + * is 400. Values are stored in an arbitrary but consistent order. + * + * Generated from protobuf field repeated int64 int_value = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIntValue() + { + return $this->int_value; + } + + /** + * Integer values of the given property. For example, 1080 for a TV + * product's Screen Resolution. Maximum repeatedness of this value + * is 400. Values are stored in an arbitrary but consistent order. + * + * Generated from protobuf field repeated int64 int_value = 4; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIntValue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->int_value = $arr; + + return $this; + } + + /** + * Float values of the given property. For example for a TV product + * 1.2345. Maximum repeatedness of this value is 400. Values + * are stored in an arbitrary but consistent order. + * + * Generated from protobuf field repeated float float_value = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFloatValue() + { + return $this->float_value; + } + + /** + * Float values of the given property. For example for a TV product + * 1.2345. Maximum repeatedness of this value is 400. Values + * are stored in an arbitrary but consistent order. + * + * Generated from protobuf field repeated float float_value = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFloatValue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FLOAT); + $this->float_value = $arr; + + return $this; + } + + /** + * Minimum float value of the given property. For example for a TV + * product 1.00. + * + * Generated from protobuf field optional float min_value = 6; + * @return float + */ + public function getMinValue() + { + return isset($this->min_value) ? $this->min_value : 0.0; + } + + public function hasMinValue() + { + return isset($this->min_value); + } + + public function clearMinValue() + { + unset($this->min_value); + } + + /** + * Minimum float value of the given property. For example for a TV + * product 1.00. + * + * Generated from protobuf field optional float min_value = 6; + * @param float $var + * @return $this + */ + public function setMinValue($var) + { + GPBUtil::checkFloat($var); + $this->min_value = $var; + + return $this; + } + + /** + * Maximum float value of the given property. For example for a TV + * product 100.00. + * + * Generated from protobuf field optional float max_value = 7; + * @return float + */ + public function getMaxValue() + { + return isset($this->max_value) ? $this->max_value : 0.0; + } + + public function hasMaxValue() + { + return isset($this->max_value); + } + + public function clearMaxValue() + { + unset($this->max_value); + } + + /** + * Maximum float value of the given property. For example for a TV + * product 100.00. + * + * Generated from protobuf field optional float max_value = 7; + * @param float $var + * @return $this + */ + public function setMaxValue($var) + { + GPBUtil::checkFloat($var); + $this->max_value = $var; + + return $this; + } + + /** + * Unit of the given property. For example, "Pixels" for a TV product. Maximum + * string size is 256B. + * + * Generated from protobuf field optional string unit_code = 8; + * @return string + */ + public function getUnitCode() + { + return isset($this->unit_code) ? $this->unit_code : ''; + } + + public function hasUnitCode() + { + return isset($this->unit_code); + } + + public function clearUnitCode() + { + unset($this->unit_code); + } + + /** + * Unit of the given property. For example, "Pixels" for a TV product. Maximum + * string size is 256B. + * + * Generated from protobuf field optional string unit_code = 8; + * @param string $var + * @return $this + */ + public function setUnitCode($var) + { + GPBUtil::checkString($var, True); + $this->unit_code = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/DeleteProductInputRequest.php b/ShoppingMerchantProducts/src/V1beta/DeleteProductInputRequest.php new file mode 100644 index 000000000000..07a8d632cf25 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/DeleteProductInputRequest.php @@ -0,0 +1,128 @@ +google.shopping.merchant.products.v1beta.DeleteProductInputRequest + */ +class DeleteProductInputRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the product input resource to delete. + * Format: accounts/{account}/productInputs/{product} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The primary or supplemental data source from which the product + * input should be deleted. Format: + * `accounts/{account}/dataSources/{datasource}`. + * + * Generated from protobuf field string data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_source = ''; + + /** + * @param string $name Required. The name of the product input resource to delete. + * Format: accounts/{account}/productInputs/{product} + * Please see {@see ProductInputsServiceClient::productInputName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Products\V1beta\DeleteProductInputRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the product input resource to delete. + * Format: accounts/{account}/productInputs/{product} + * @type string $data_source + * Required. The primary or supplemental data source from which the product + * input should be deleted. Format: + * `accounts/{account}/dataSources/{datasource}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\Productinputs::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the product input resource to delete. + * Format: accounts/{account}/productInputs/{product} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the product input resource to delete. + * Format: accounts/{account}/productInputs/{product} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The primary or supplemental data source from which the product + * input should be deleted. Format: + * `accounts/{account}/dataSources/{datasource}`. + * + * Generated from protobuf field string data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataSource() + { + return $this->data_source; + } + + /** + * Required. The primary or supplemental data source from which the product + * input should be deleted. Format: + * `accounts/{account}/dataSources/{datasource}`. + * + * Generated from protobuf field string data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkString($var, True); + $this->data_source = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/FreeShippingThreshold.php b/ShoppingMerchantProducts/src/V1beta/FreeShippingThreshold.php new file mode 100644 index 000000000000..b8144719c31c --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/FreeShippingThreshold.php @@ -0,0 +1,133 @@ +google.shopping.merchant.products.v1beta.FreeShippingThreshold + */ +class FreeShippingThreshold extends \Google\Protobuf\Internal\Message +{ + /** + * The [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * of the country to which an item will ship. + * + * Generated from protobuf field optional string country = 1; + */ + protected $country = null; + /** + * The minimum product price for the shipping cost to become free. Represented + * as a number. + * + * Generated from protobuf field optional .google.shopping.type.Price price_threshold = 2; + */ + protected $price_threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $country + * The [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * of the country to which an item will ship. + * @type \Google\Shopping\Type\Price $price_threshold + * The minimum product price for the shipping cost to become free. Represented + * as a number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * of the country to which an item will ship. + * + * Generated from protobuf field optional string country = 1; + * @return string + */ + public function getCountry() + { + return isset($this->country) ? $this->country : ''; + } + + public function hasCountry() + { + return isset($this->country); + } + + public function clearCountry() + { + unset($this->country); + } + + /** + * The [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * of the country to which an item will ship. + * + * Generated from protobuf field optional string country = 1; + * @param string $var + * @return $this + */ + public function setCountry($var) + { + GPBUtil::checkString($var, True); + $this->country = $var; + + return $this; + } + + /** + * The minimum product price for the shipping cost to become free. Represented + * as a number. + * + * Generated from protobuf field optional .google.shopping.type.Price price_threshold = 2; + * @return \Google\Shopping\Type\Price|null + */ + public function getPriceThreshold() + { + return $this->price_threshold; + } + + public function hasPriceThreshold() + { + return isset($this->price_threshold); + } + + public function clearPriceThreshold() + { + unset($this->price_threshold); + } + + /** + * The minimum product price for the shipping cost to become free. Represented + * as a number. + * + * Generated from protobuf field optional .google.shopping.type.Price price_threshold = 2; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setPriceThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->price_threshold = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/GetProductRequest.php b/ShoppingMerchantProducts/src/V1beta/GetProductRequest.php new file mode 100644 index 000000000000..a677e340fa21 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/GetProductRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.products.v1beta.GetProductRequest + */ +class GetProductRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the product to retrieve. + * Format: `accounts/{account}/products/{product}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the product to retrieve. + * Format: `accounts/{account}/products/{product}` + * Please see {@see ProductsServiceClient::productName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Products\V1beta\GetProductRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the product to retrieve. + * Format: `accounts/{account}/products/{product}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\Products::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the product to retrieve. + * Format: `accounts/{account}/products/{product}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the product to retrieve. + * Format: `accounts/{account}/products/{product}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/InsertProductInputRequest.php b/ShoppingMerchantProducts/src/V1beta/InsertProductInputRequest.php new file mode 100644 index 000000000000..9d329b775de3 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/InsertProductInputRequest.php @@ -0,0 +1,161 @@ +google.shopping.merchant.products.v1beta.InsertProductInputRequest + */ +class InsertProductInputRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account where this product will be inserted. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The product input to insert. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductInput product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $product_input = null; + /** + * Required. The primary or supplemental product data source name. If the + * product already exists and data source provided is different, then the + * product will be moved to a new data source. Format: + * `accounts/{account}/dataSources/{datasource}`. + * + * Generated from protobuf field string data_source = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_source = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account where this product will be inserted. + * Format: accounts/{account} + * @type \Google\Shopping\Merchant\Products\V1beta\ProductInput $product_input + * Required. The product input to insert. + * @type string $data_source + * Required. The primary or supplemental product data source name. If the + * product already exists and data source provided is different, then the + * product will be moved to a new data source. Format: + * `accounts/{account}/dataSources/{datasource}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\Productinputs::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account where this product will be inserted. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account where this product will be inserted. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The product input to insert. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductInput product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Products\V1beta\ProductInput|null + */ + public function getProductInput() + { + return $this->product_input; + } + + public function hasProductInput() + { + return isset($this->product_input); + } + + public function clearProductInput() + { + unset($this->product_input); + } + + /** + * Required. The product input to insert. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductInput product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Products\V1beta\ProductInput $var + * @return $this + */ + public function setProductInput($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ProductInput::class); + $this->product_input = $var; + + return $this; + } + + /** + * Required. The primary or supplemental product data source name. If the + * product already exists and data source provided is different, then the + * product will be moved to a new data source. Format: + * `accounts/{account}/dataSources/{datasource}`. + * + * Generated from protobuf field string data_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataSource() + { + return $this->data_source; + } + + /** + * Required. The primary or supplemental product data source name. If the + * product already exists and data source provided is different, then the + * product will be moved to a new data source. Format: + * `accounts/{account}/dataSources/{datasource}`. + * + * Generated from protobuf field string data_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkString($var, True); + $this->data_source = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/Installment.php b/ShoppingMerchantProducts/src/V1beta/Installment.php new file mode 100644 index 000000000000..12dceae2af7a --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/Installment.php @@ -0,0 +1,211 @@ +google.shopping.merchant.products.v1beta.Installment + */ +class Installment extends \Google\Protobuf\Internal\Message +{ + /** + * The number of installments the buyer has to pay. + * + * Generated from protobuf field int64 months = 1; + */ + protected $months = 0; + /** + * The amount the buyer has to pay per month. + * + * Generated from protobuf field .google.shopping.type.Price amount = 2; + */ + protected $amount = null; + /** + * The up-front down payment amount the buyer has to pay. + * + * Generated from protobuf field optional .google.shopping.type.Price downpayment = 3; + */ + protected $downpayment = null; + /** + * Type of installment payments. + * Supported values are: + * * "`finance`" + * * "`lease`" + * + * Generated from protobuf field optional string credit_type = 4; + */ + protected $credit_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $months + * The number of installments the buyer has to pay. + * @type \Google\Shopping\Type\Price $amount + * The amount the buyer has to pay per month. + * @type \Google\Shopping\Type\Price $downpayment + * The up-front down payment amount the buyer has to pay. + * @type string $credit_type + * Type of installment payments. + * Supported values are: + * * "`finance`" + * * "`lease`" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The number of installments the buyer has to pay. + * + * Generated from protobuf field int64 months = 1; + * @return int|string + */ + public function getMonths() + { + return $this->months; + } + + /** + * The number of installments the buyer has to pay. + * + * Generated from protobuf field int64 months = 1; + * @param int|string $var + * @return $this + */ + public function setMonths($var) + { + GPBUtil::checkInt64($var); + $this->months = $var; + + return $this; + } + + /** + * The amount the buyer has to pay per month. + * + * Generated from protobuf field .google.shopping.type.Price amount = 2; + * @return \Google\Shopping\Type\Price|null + */ + public function getAmount() + { + return $this->amount; + } + + public function hasAmount() + { + return isset($this->amount); + } + + public function clearAmount() + { + unset($this->amount); + } + + /** + * The amount the buyer has to pay per month. + * + * Generated from protobuf field .google.shopping.type.Price amount = 2; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->amount = $var; + + return $this; + } + + /** + * The up-front down payment amount the buyer has to pay. + * + * Generated from protobuf field optional .google.shopping.type.Price downpayment = 3; + * @return \Google\Shopping\Type\Price|null + */ + public function getDownpayment() + { + return $this->downpayment; + } + + public function hasDownpayment() + { + return isset($this->downpayment); + } + + public function clearDownpayment() + { + unset($this->downpayment); + } + + /** + * The up-front down payment amount the buyer has to pay. + * + * Generated from protobuf field optional .google.shopping.type.Price downpayment = 3; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setDownpayment($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->downpayment = $var; + + return $this; + } + + /** + * Type of installment payments. + * Supported values are: + * * "`finance`" + * * "`lease`" + * + * Generated from protobuf field optional string credit_type = 4; + * @return string + */ + public function getCreditType() + { + return isset($this->credit_type) ? $this->credit_type : ''; + } + + public function hasCreditType() + { + return isset($this->credit_type); + } + + public function clearCreditType() + { + unset($this->credit_type); + } + + /** + * Type of installment payments. + * Supported values are: + * * "`finance`" + * * "`lease`" + * + * Generated from protobuf field optional string credit_type = 4; + * @param string $var + * @return $this + */ + public function setCreditType($var) + { + GPBUtil::checkString($var, True); + $this->credit_type = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ListProductsRequest.php b/ShoppingMerchantProducts/src/V1beta/ListProductsRequest.php new file mode 100644 index 000000000000..0dfef12c25c8 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ListProductsRequest.php @@ -0,0 +1,178 @@ +google.shopping.merchant.products.v1beta.ListProductsRequest + */ +class ListProductsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account to list processed products for. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of products to return. The service may return fewer than + * this value. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * If unspecified, the maximum number of products will be returned. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token, received from a previous `ListProducts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProducts` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The account to list processed products for. + * Format: accounts/{account} + * Please see {@see ProductsServiceClient::accountName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Products\V1beta\ListProductsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account to list processed products for. + * Format: accounts/{account} + * @type int $page_size + * The maximum number of products to return. The service may return fewer than + * this value. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * If unspecified, the maximum number of products will be returned. + * @type string $page_token + * A page token, received from a previous `ListProducts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProducts` must + * match the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\Products::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account to list processed products for. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account to list processed products for. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of products to return. The service may return fewer than + * this value. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * If unspecified, the maximum number of products will be returned. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of products to return. The service may return fewer than + * this value. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * If unspecified, the maximum number of products will be returned. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, received from a previous `ListProducts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProducts` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListProducts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListProducts` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ListProductsResponse.php b/ShoppingMerchantProducts/src/V1beta/ListProductsResponse.php new file mode 100644 index 000000000000..11e20c4af4cd --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ListProductsResponse.php @@ -0,0 +1,109 @@ +google.shopping.merchant.products.v1beta.ListProductsResponse + */ +class ListProductsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The processed products from the specified account. These are your processed + * products after applying rules and supplemental data sources. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Product products = 1; + */ + private $products; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Products\V1beta\Product>|\Google\Protobuf\Internal\RepeatedField $products + * The processed products from the specified account. These are your processed + * products after applying rules and supplemental data sources. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\Products::initOnce(); + parent::__construct($data); + } + + /** + * The processed products from the specified account. These are your processed + * products after applying rules and supplemental data sources. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Product products = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProducts() + { + return $this->products; + } + + /** + * The processed products from the specified account. These are your processed + * products after applying rules and supplemental data sources. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.Product products = 1; + * @param array<\Google\Shopping\Merchant\Products\V1beta\Product>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProducts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\Product::class); + $this->products = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/LoyaltyPoints.php b/ShoppingMerchantProducts/src/V1beta/LoyaltyPoints.php new file mode 100644 index 000000000000..c2b7a0032353 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/LoyaltyPoints.php @@ -0,0 +1,147 @@ +google.shopping.merchant.products.v1beta.LoyaltyPoints + */ +class LoyaltyPoints extends \Google\Protobuf\Internal\Message +{ + /** + * Name of loyalty points program. It is recommended to limit the name to + * 12 full-width characters or 24 Roman characters. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The retailer's loyalty points in absolute value. + * + * Generated from protobuf field int64 points_value = 2; + */ + protected $points_value = 0; + /** + * The ratio of a point when converted to currency. Google assumes currency + * based on Merchant Center settings. If ratio is left out, it defaults to + * 1.0. + * + * Generated from protobuf field double ratio = 3; + */ + protected $ratio = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of loyalty points program. It is recommended to limit the name to + * 12 full-width characters or 24 Roman characters. + * @type int|string $points_value + * The retailer's loyalty points in absolute value. + * @type float $ratio + * The ratio of a point when converted to currency. Google assumes currency + * based on Merchant Center settings. If ratio is left out, it defaults to + * 1.0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Name of loyalty points program. It is recommended to limit the name to + * 12 full-width characters or 24 Roman characters. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of loyalty points program. It is recommended to limit the name to + * 12 full-width characters or 24 Roman characters. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The retailer's loyalty points in absolute value. + * + * Generated from protobuf field int64 points_value = 2; + * @return int|string + */ + public function getPointsValue() + { + return $this->points_value; + } + + /** + * The retailer's loyalty points in absolute value. + * + * Generated from protobuf field int64 points_value = 2; + * @param int|string $var + * @return $this + */ + public function setPointsValue($var) + { + GPBUtil::checkInt64($var); + $this->points_value = $var; + + return $this; + } + + /** + * The ratio of a point when converted to currency. Google assumes currency + * based on Merchant Center settings. If ratio is left out, it defaults to + * 1.0. + * + * Generated from protobuf field double ratio = 3; + * @return float + */ + public function getRatio() + { + return $this->ratio; + } + + /** + * The ratio of a point when converted to currency. Google assumes currency + * based on Merchant Center settings. If ratio is left out, it defaults to + * 1.0. + * + * Generated from protobuf field double ratio = 3; + * @param float $var + * @return $this + */ + public function setRatio($var) + { + GPBUtil::checkDouble($var); + $this->ratio = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/LoyaltyProgram.php b/ShoppingMerchantProducts/src/V1beta/LoyaltyProgram.php new file mode 100644 index 000000000000..b27167e58a02 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/LoyaltyProgram.php @@ -0,0 +1,277 @@ +google.shopping.merchant.products.v1beta.LoyaltyProgram + */ +class LoyaltyProgram extends \Google\Protobuf\Internal\Message +{ + /** + * The label of the loyalty program. This is an internal label that uniquely + * identifies the relationship between a merchant entity and a loyalty + * program entity. The label must be provided so that the system can associate + * the assets below (for example, price and points) with a merchant. The + * corresponding program must be linked to the merchant account. + * + * Generated from protobuf field optional string program_label = 1; + */ + protected $program_label = null; + /** + * The label of the tier within the loyalty program. + * Must match one of the labels within the program. + * + * Generated from protobuf field optional string tier_label = 2; + */ + protected $tier_label = null; + /** + * The price for members of the given tier, that is, the instant discount + * price. Must be smaller or equal to the regular price. + * + * Generated from protobuf field optional .google.shopping.type.Price price = 3; + */ + protected $price = null; + /** + * The cashback that can be used for future purchases. + * + * Generated from protobuf field optional .google.shopping.type.Price cashback_for_future_use = 4; + */ + protected $cashback_for_future_use = null; + /** + * The amount of loyalty points earned on a purchase. + * + * Generated from protobuf field optional int64 loyalty_points = 5; + */ + protected $loyalty_points = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $program_label + * The label of the loyalty program. This is an internal label that uniquely + * identifies the relationship between a merchant entity and a loyalty + * program entity. The label must be provided so that the system can associate + * the assets below (for example, price and points) with a merchant. The + * corresponding program must be linked to the merchant account. + * @type string $tier_label + * The label of the tier within the loyalty program. + * Must match one of the labels within the program. + * @type \Google\Shopping\Type\Price $price + * The price for members of the given tier, that is, the instant discount + * price. Must be smaller or equal to the regular price. + * @type \Google\Shopping\Type\Price $cashback_for_future_use + * The cashback that can be used for future purchases. + * @type int|string $loyalty_points + * The amount of loyalty points earned on a purchase. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The label of the loyalty program. This is an internal label that uniquely + * identifies the relationship between a merchant entity and a loyalty + * program entity. The label must be provided so that the system can associate + * the assets below (for example, price and points) with a merchant. The + * corresponding program must be linked to the merchant account. + * + * Generated from protobuf field optional string program_label = 1; + * @return string + */ + public function getProgramLabel() + { + return isset($this->program_label) ? $this->program_label : ''; + } + + public function hasProgramLabel() + { + return isset($this->program_label); + } + + public function clearProgramLabel() + { + unset($this->program_label); + } + + /** + * The label of the loyalty program. This is an internal label that uniquely + * identifies the relationship between a merchant entity and a loyalty + * program entity. The label must be provided so that the system can associate + * the assets below (for example, price and points) with a merchant. The + * corresponding program must be linked to the merchant account. + * + * Generated from protobuf field optional string program_label = 1; + * @param string $var + * @return $this + */ + public function setProgramLabel($var) + { + GPBUtil::checkString($var, True); + $this->program_label = $var; + + return $this; + } + + /** + * The label of the tier within the loyalty program. + * Must match one of the labels within the program. + * + * Generated from protobuf field optional string tier_label = 2; + * @return string + */ + public function getTierLabel() + { + return isset($this->tier_label) ? $this->tier_label : ''; + } + + public function hasTierLabel() + { + return isset($this->tier_label); + } + + public function clearTierLabel() + { + unset($this->tier_label); + } + + /** + * The label of the tier within the loyalty program. + * Must match one of the labels within the program. + * + * Generated from protobuf field optional string tier_label = 2; + * @param string $var + * @return $this + */ + public function setTierLabel($var) + { + GPBUtil::checkString($var, True); + $this->tier_label = $var; + + return $this; + } + + /** + * The price for members of the given tier, that is, the instant discount + * price. Must be smaller or equal to the regular price. + * + * Generated from protobuf field optional .google.shopping.type.Price price = 3; + * @return \Google\Shopping\Type\Price|null + */ + public function getPrice() + { + return $this->price; + } + + public function hasPrice() + { + return isset($this->price); + } + + public function clearPrice() + { + unset($this->price); + } + + /** + * The price for members of the given tier, that is, the instant discount + * price. Must be smaller or equal to the regular price. + * + * Generated from protobuf field optional .google.shopping.type.Price price = 3; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setPrice($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->price = $var; + + return $this; + } + + /** + * The cashback that can be used for future purchases. + * + * Generated from protobuf field optional .google.shopping.type.Price cashback_for_future_use = 4; + * @return \Google\Shopping\Type\Price|null + */ + public function getCashbackForFutureUse() + { + return $this->cashback_for_future_use; + } + + public function hasCashbackForFutureUse() + { + return isset($this->cashback_for_future_use); + } + + public function clearCashbackForFutureUse() + { + unset($this->cashback_for_future_use); + } + + /** + * The cashback that can be used for future purchases. + * + * Generated from protobuf field optional .google.shopping.type.Price cashback_for_future_use = 4; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setCashbackForFutureUse($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->cashback_for_future_use = $var; + + return $this; + } + + /** + * The amount of loyalty points earned on a purchase. + * + * Generated from protobuf field optional int64 loyalty_points = 5; + * @return int|string + */ + public function getLoyaltyPoints() + { + return isset($this->loyalty_points) ? $this->loyalty_points : 0; + } + + public function hasLoyaltyPoints() + { + return isset($this->loyalty_points); + } + + public function clearLoyaltyPoints() + { + unset($this->loyalty_points); + } + + /** + * The amount of loyalty points earned on a purchase. + * + * Generated from protobuf field optional int64 loyalty_points = 5; + * @param int|string $var + * @return $this + */ + public function setLoyaltyPoints($var) + { + GPBUtil::checkInt64($var); + $this->loyalty_points = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/Product.php b/ShoppingMerchantProducts/src/V1beta/Product.php new file mode 100644 index 000000000000..8180250ca379 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/Product.php @@ -0,0 +1,518 @@ +google.shopping.merchant.products.v1beta.Product + */ +class Product extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the product. + * Format: + * `"{product.name=accounts/{account}/products/{product}}"` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The + * [channel](https://support.google.com/merchants/answer/7361332) of the + * product. + * + * Generated from protobuf field .google.shopping.type.Channel.ChannelEnum channel = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $channel = 0; + /** + * Output only. Your unique identifier for the product. This is the same for + * the product input and processed product. Leading and trailing whitespaces + * are stripped and multiple whitespaces are replaced by a single whitespace + * upon submission. See the [product data + * specification](https://support.google.com/merchants/answer/188494#id) for + * details. + * + * Generated from protobuf field string offer_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $offer_id = ''; + /** + * Output only. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * product. + * + * Generated from protobuf field string content_language = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $content_language = ''; + /** + * Output only. The feed label for the product. + * + * Generated from protobuf field string feed_label = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $feed_label = ''; + /** + * Output only. The primary data source of the product. + * + * Generated from protobuf field string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $data_source = ''; + /** + * Output only. Represents the existing version (freshness) of the product, + * which can be used to preserve the right order when multiple updates are + * done at the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing product. Re-insertion (for + * example, product refresh after 30 days) can be performed with the current + * `version_number`. + * Only supported for insertions into primary data sources. + * If the operation is prevented, the aborted exception will be + * thrown. + * + * Generated from protobuf field optional int64 version_number = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $version_number = null; + /** + * Output only. A list of product attributes. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.Attributes attributes = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $attributes = null; + /** + * Output only. A list of custom (merchant-provided) attributes. It can also + * be used to submit any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API, such as additional attributes used for Buy on Google. + * + * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $custom_attributes; + /** + * Output only. The status of a product, data validation issues, that is, + * information about a product computed asynchronously. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductStatus product_status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $product_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the product. + * Format: + * `"{product.name=accounts/{account}/products/{product}}"` + * @type int $channel + * Output only. The + * [channel](https://support.google.com/merchants/answer/7361332) of the + * product. + * @type string $offer_id + * Output only. Your unique identifier for the product. This is the same for + * the product input and processed product. Leading and trailing whitespaces + * are stripped and multiple whitespaces are replaced by a single whitespace + * upon submission. See the [product data + * specification](https://support.google.com/merchants/answer/188494#id) for + * details. + * @type string $content_language + * Output only. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * product. + * @type string $feed_label + * Output only. The feed label for the product. + * @type string $data_source + * Output only. The primary data source of the product. + * @type int|string $version_number + * Output only. Represents the existing version (freshness) of the product, + * which can be used to preserve the right order when multiple updates are + * done at the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing product. Re-insertion (for + * example, product refresh after 30 days) can be performed with the current + * `version_number`. + * Only supported for insertions into primary data sources. + * If the operation is prevented, the aborted exception will be + * thrown. + * @type \Google\Shopping\Merchant\Products\V1beta\Attributes $attributes + * Output only. A list of product attributes. + * @type array<\Google\Shopping\Type\CustomAttribute>|\Google\Protobuf\Internal\RepeatedField $custom_attributes + * Output only. A list of custom (merchant-provided) attributes. It can also + * be used to submit any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API, such as additional attributes used for Buy on Google. + * @type \Google\Shopping\Merchant\Products\V1beta\ProductStatus $product_status + * Output only. The status of a product, data validation issues, that is, + * information about a product computed asynchronously. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\Products::initOnce(); + parent::__construct($data); + } + + /** + * The name of the product. + * Format: + * `"{product.name=accounts/{account}/products/{product}}"` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the product. + * Format: + * `"{product.name=accounts/{account}/products/{product}}"` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The + * [channel](https://support.google.com/merchants/answer/7361332) of the + * product. + * + * Generated from protobuf field .google.shopping.type.Channel.ChannelEnum channel = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getChannel() + { + return $this->channel; + } + + /** + * Output only. The + * [channel](https://support.google.com/merchants/answer/7361332) of the + * product. + * + * Generated from protobuf field .google.shopping.type.Channel.ChannelEnum channel = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setChannel($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Type\Channel\ChannelEnum::class); + $this->channel = $var; + + return $this; + } + + /** + * Output only. Your unique identifier for the product. This is the same for + * the product input and processed product. Leading and trailing whitespaces + * are stripped and multiple whitespaces are replaced by a single whitespace + * upon submission. See the [product data + * specification](https://support.google.com/merchants/answer/188494#id) for + * details. + * + * Generated from protobuf field string offer_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getOfferId() + { + return $this->offer_id; + } + + /** + * Output only. Your unique identifier for the product. This is the same for + * the product input and processed product. Leading and trailing whitespaces + * are stripped and multiple whitespaces are replaced by a single whitespace + * upon submission. See the [product data + * specification](https://support.google.com/merchants/answer/188494#id) for + * details. + * + * Generated from protobuf field string offer_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setOfferId($var) + { + GPBUtil::checkString($var, True); + $this->offer_id = $var; + + return $this; + } + + /** + * Output only. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * product. + * + * Generated from protobuf field string content_language = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getContentLanguage() + { + return $this->content_language; + } + + /** + * Output only. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * product. + * + * Generated from protobuf field string content_language = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + + /** + * Output only. The feed label for the product. + * + * Generated from protobuf field string feed_label = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getFeedLabel() + { + return $this->feed_label; + } + + /** + * Output only. The feed label for the product. + * + * Generated from protobuf field string feed_label = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setFeedLabel($var) + { + GPBUtil::checkString($var, True); + $this->feed_label = $var; + + return $this; + } + + /** + * Output only. The primary data source of the product. + * + * Generated from protobuf field string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDataSource() + { + return $this->data_source; + } + + /** + * Output only. The primary data source of the product. + * + * Generated from protobuf field string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkString($var, True); + $this->data_source = $var; + + return $this; + } + + /** + * Output only. Represents the existing version (freshness) of the product, + * which can be used to preserve the right order when multiple updates are + * done at the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing product. Re-insertion (for + * example, product refresh after 30 days) can be performed with the current + * `version_number`. + * Only supported for insertions into primary data sources. + * If the operation is prevented, the aborted exception will be + * thrown. + * + * Generated from protobuf field optional int64 version_number = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getVersionNumber() + { + return isset($this->version_number) ? $this->version_number : 0; + } + + public function hasVersionNumber() + { + return isset($this->version_number); + } + + public function clearVersionNumber() + { + unset($this->version_number); + } + + /** + * Output only. Represents the existing version (freshness) of the product, + * which can be used to preserve the right order when multiple updates are + * done at the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing product. Re-insertion (for + * example, product refresh after 30 days) can be performed with the current + * `version_number`. + * Only supported for insertions into primary data sources. + * If the operation is prevented, the aborted exception will be + * thrown. + * + * Generated from protobuf field optional int64 version_number = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setVersionNumber($var) + { + GPBUtil::checkInt64($var); + $this->version_number = $var; + + return $this; + } + + /** + * Output only. A list of product attributes. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.Attributes attributes = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Shopping\Merchant\Products\V1beta\Attributes|null + */ + public function getAttributes() + { + return $this->attributes; + } + + public function hasAttributes() + { + return isset($this->attributes); + } + + public function clearAttributes() + { + unset($this->attributes); + } + + /** + * Output only. A list of product attributes. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.Attributes attributes = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Shopping\Merchant\Products\V1beta\Attributes $var + * @return $this + */ + public function setAttributes($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\Attributes::class); + $this->attributes = $var; + + return $this; + } + + /** + * Output only. A list of custom (merchant-provided) attributes. It can also + * be used to submit any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API, such as additional attributes used for Buy on Google. + * + * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomAttributes() + { + return $this->custom_attributes; + } + + /** + * Output only. A list of custom (merchant-provided) attributes. It can also + * be used to submit any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API, such as additional attributes used for Buy on Google. + * + * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Shopping\Type\CustomAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Type\CustomAttribute::class); + $this->custom_attributes = $arr; + + return $this; + } + + /** + * Output only. The status of a product, data validation issues, that is, + * information about a product computed asynchronously. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductStatus product_status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Shopping\Merchant\Products\V1beta\ProductStatus|null + */ + public function getProductStatus() + { + return $this->product_status; + } + + public function hasProductStatus() + { + return isset($this->product_status); + } + + public function clearProductStatus() + { + unset($this->product_status); + } + + /** + * Output only. The status of a product, data validation issues, that is, + * information about a product computed asynchronously. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductStatus product_status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Shopping\Merchant\Products\V1beta\ProductStatus $var + * @return $this + */ + public function setProductStatus($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\ProductStatus::class); + $this->product_status = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductDetail.php b/ShoppingMerchantProducts/src/V1beta/ProductDetail.php new file mode 100644 index 000000000000..f0d107d9d854 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductDetail.php @@ -0,0 +1,135 @@ +google.shopping.merchant.products.v1beta.ProductDetail + */ +class ProductDetail extends \Google\Protobuf\Internal\Message +{ + /** + * The section header used to group a set of product details. + * + * Generated from protobuf field string section_name = 1; + */ + protected $section_name = ''; + /** + * The name of the product detail. + * + * Generated from protobuf field string attribute_name = 2; + */ + protected $attribute_name = ''; + /** + * The value of the product detail. + * + * Generated from protobuf field string attribute_value = 3; + */ + protected $attribute_value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $section_name + * The section header used to group a set of product details. + * @type string $attribute_name + * The name of the product detail. + * @type string $attribute_value + * The value of the product detail. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The section header used to group a set of product details. + * + * Generated from protobuf field string section_name = 1; + * @return string + */ + public function getSectionName() + { + return $this->section_name; + } + + /** + * The section header used to group a set of product details. + * + * Generated from protobuf field string section_name = 1; + * @param string $var + * @return $this + */ + public function setSectionName($var) + { + GPBUtil::checkString($var, True); + $this->section_name = $var; + + return $this; + } + + /** + * The name of the product detail. + * + * Generated from protobuf field string attribute_name = 2; + * @return string + */ + public function getAttributeName() + { + return $this->attribute_name; + } + + /** + * The name of the product detail. + * + * Generated from protobuf field string attribute_name = 2; + * @param string $var + * @return $this + */ + public function setAttributeName($var) + { + GPBUtil::checkString($var, True); + $this->attribute_name = $var; + + return $this; + } + + /** + * The value of the product detail. + * + * Generated from protobuf field string attribute_value = 3; + * @return string + */ + public function getAttributeValue() + { + return $this->attribute_value; + } + + /** + * The value of the product detail. + * + * Generated from protobuf field string attribute_value = 3; + * @param string $var + * @return $this + */ + public function setAttributeValue($var) + { + GPBUtil::checkString($var, True); + $this->attribute_value = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductDimension.php b/ShoppingMerchantProducts/src/V1beta/ProductDimension.php new file mode 100644 index 000000000000..235bc781ea79 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductDimension.php @@ -0,0 +1,117 @@ +google.shopping.merchant.products.v1beta.ProductDimension + */ +class ProductDimension extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The dimension value represented as a number. The value can have a + * maximum precision of four decimal places. + * + * Generated from protobuf field double value = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value = 0.0; + /** + * Required. The dimension units. + * Acceptable values are: + * * "`in`" + * * "`cm`" + * + * Generated from protobuf field string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * Required. The dimension value represented as a number. The value can have a + * maximum precision of four decimal places. + * @type string $unit + * Required. The dimension units. + * Acceptable values are: + * * "`in`" + * * "`cm`" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Required. The dimension value represented as a number. The value can have a + * maximum precision of four decimal places. + * + * Generated from protobuf field double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * Required. The dimension value represented as a number. The value can have a + * maximum precision of four decimal places. + * + * Generated from protobuf field double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + + /** + * Required. The dimension units. + * Acceptable values are: + * * "`in`" + * * "`cm`" + * + * Generated from protobuf field string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * Required. The dimension units. + * Acceptable values are: + * * "`in`" + * * "`cm`" + * + * Generated from protobuf field string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductInput.php b/ShoppingMerchantProducts/src/V1beta/ProductInput.php new file mode 100644 index 000000000000..e4308a2eda96 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductInput.php @@ -0,0 +1,511 @@ +google.shopping.merchant.products.v1beta.ProductInput + */ +class ProductInput extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the product input. + * Format: + * `"{productinput.name=accounts/{account}/productInputs/{productinput}}"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The name of the processed product. + * Format: + * `"{product.name=accounts/{account}/products/{product}}"` + * + * Generated from protobuf field string product = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $product = ''; + /** + * Required. Immutable. The + * [channel](https://support.google.com/merchants/answer/7361332) of the + * product. + * + * Generated from protobuf field .google.shopping.type.Channel.ChannelEnum channel = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $channel = 0; + /** + * Required. Immutable. Your unique identifier for the product. This is the + * same for the product input and processed product. Leading and trailing + * whitespaces are stripped and multiple whitespaces are replaced by a single + * whitespace upon submission. See the [products data + * specification](https://support.google.com/merchants/answer/188494#id) for + * details. + * + * Generated from protobuf field string offer_id = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $offer_id = ''; + /** + * Required. Immutable. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * product. + * + * Generated from protobuf field string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $content_language = ''; + /** + * Required. Immutable. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. + * + * Generated from protobuf field string feed_label = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $feed_label = ''; + /** + * Optional. Represents the existing version (freshness) of the product, which + * can be used to preserve the right order when multiple updates are done at + * the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing product. Re-insertion (for + * example, product refresh after 30 days) can be performed with the current + * `version_number`. + * Only supported for insertions into primary data sources. + * If the operation is prevented, the aborted exception will be + * thrown. + * + * Generated from protobuf field optional int64 version_number = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $version_number = null; + /** + * Optional. A list of product attributes. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.Attributes attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $attributes = null; + /** + * Optional. A list of custom (merchant-provided) attributes. It can also be + * used for submitting any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API, such as additional attributes used for Buy on Google. + * Maximum allowed number of characters for each + * custom attribute is 10240 (represents sum of characters for name and + * value). Maximum 2500 custom attributes can be set per product, with total + * size of 102.4kB. Underscores in custom attribute names are replaced by + * spaces upon insertion. + * + * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $custom_attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the product input. + * Format: + * `"{productinput.name=accounts/{account}/productInputs/{productinput}}"` + * @type string $product + * Output only. The name of the processed product. + * Format: + * `"{product.name=accounts/{account}/products/{product}}"` + * @type int $channel + * Required. Immutable. The + * [channel](https://support.google.com/merchants/answer/7361332) of the + * product. + * @type string $offer_id + * Required. Immutable. Your unique identifier for the product. This is the + * same for the product input and processed product. Leading and trailing + * whitespaces are stripped and multiple whitespaces are replaced by a single + * whitespace upon submission. See the [products data + * specification](https://support.google.com/merchants/answer/188494#id) for + * details. + * @type string $content_language + * Required. Immutable. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * product. + * @type string $feed_label + * Required. Immutable. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. + * @type int|string $version_number + * Optional. Represents the existing version (freshness) of the product, which + * can be used to preserve the right order when multiple updates are done at + * the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing product. Re-insertion (for + * example, product refresh after 30 days) can be performed with the current + * `version_number`. + * Only supported for insertions into primary data sources. + * If the operation is prevented, the aborted exception will be + * thrown. + * @type \Google\Shopping\Merchant\Products\V1beta\Attributes $attributes + * Optional. A list of product attributes. + * @type array<\Google\Shopping\Type\CustomAttribute>|\Google\Protobuf\Internal\RepeatedField $custom_attributes + * Optional. A list of custom (merchant-provided) attributes. It can also be + * used for submitting any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API, such as additional attributes used for Buy on Google. + * Maximum allowed number of characters for each + * custom attribute is 10240 (represents sum of characters for name and + * value). Maximum 2500 custom attributes can be set per product, with total + * size of 102.4kB. Underscores in custom attribute names are replaced by + * spaces upon insertion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\Productinputs::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the product input. + * Format: + * `"{productinput.name=accounts/{account}/productInputs/{productinput}}"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the product input. + * Format: + * `"{productinput.name=accounts/{account}/productInputs/{productinput}}"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The name of the processed product. + * Format: + * `"{product.name=accounts/{account}/products/{product}}"` + * + * Generated from protobuf field string product = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getProduct() + { + return $this->product; + } + + /** + * Output only. The name of the processed product. + * Format: + * `"{product.name=accounts/{account}/products/{product}}"` + * + * Generated from protobuf field string product = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setProduct($var) + { + GPBUtil::checkString($var, True); + $this->product = $var; + + return $this; + } + + /** + * Required. Immutable. The + * [channel](https://support.google.com/merchants/answer/7361332) of the + * product. + * + * Generated from protobuf field .google.shopping.type.Channel.ChannelEnum channel = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getChannel() + { + return $this->channel; + } + + /** + * Required. Immutable. The + * [channel](https://support.google.com/merchants/answer/7361332) of the + * product. + * + * Generated from protobuf field .google.shopping.type.Channel.ChannelEnum channel = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setChannel($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Type\Channel\ChannelEnum::class); + $this->channel = $var; + + return $this; + } + + /** + * Required. Immutable. Your unique identifier for the product. This is the + * same for the product input and processed product. Leading and trailing + * whitespaces are stripped and multiple whitespaces are replaced by a single + * whitespace upon submission. See the [products data + * specification](https://support.google.com/merchants/answer/188494#id) for + * details. + * + * Generated from protobuf field string offer_id = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getOfferId() + { + return $this->offer_id; + } + + /** + * Required. Immutable. Your unique identifier for the product. This is the + * same for the product input and processed product. Leading and trailing + * whitespaces are stripped and multiple whitespaces are replaced by a single + * whitespace upon submission. See the [products data + * specification](https://support.google.com/merchants/answer/188494#id) for + * details. + * + * Generated from protobuf field string offer_id = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setOfferId($var) + { + GPBUtil::checkString($var, True); + $this->offer_id = $var; + + return $this; + } + + /** + * Required. Immutable. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * product. + * + * Generated from protobuf field string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getContentLanguage() + { + return $this->content_language; + } + + /** + * Required. Immutable. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * product. + * + * Generated from protobuf field string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + + /** + * Required. Immutable. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. + * + * Generated from protobuf field string feed_label = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getFeedLabel() + { + return $this->feed_label; + } + + /** + * Required. Immutable. The [feed + * label](https://developers.google.com/shopping-content/guides/products/feed-labels) + * for the product. + * + * Generated from protobuf field string feed_label = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setFeedLabel($var) + { + GPBUtil::checkString($var, True); + $this->feed_label = $var; + + return $this; + } + + /** + * Optional. Represents the existing version (freshness) of the product, which + * can be used to preserve the right order when multiple updates are done at + * the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing product. Re-insertion (for + * example, product refresh after 30 days) can be performed with the current + * `version_number`. + * Only supported for insertions into primary data sources. + * If the operation is prevented, the aborted exception will be + * thrown. + * + * Generated from protobuf field optional int64 version_number = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getVersionNumber() + { + return isset($this->version_number) ? $this->version_number : 0; + } + + public function hasVersionNumber() + { + return isset($this->version_number); + } + + public function clearVersionNumber() + { + unset($this->version_number); + } + + /** + * Optional. Represents the existing version (freshness) of the product, which + * can be used to preserve the right order when multiple updates are done at + * the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing product. Re-insertion (for + * example, product refresh after 30 days) can be performed with the current + * `version_number`. + * Only supported for insertions into primary data sources. + * If the operation is prevented, the aborted exception will be + * thrown. + * + * Generated from protobuf field optional int64 version_number = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setVersionNumber($var) + { + GPBUtil::checkInt64($var); + $this->version_number = $var; + + return $this; + } + + /** + * Optional. A list of product attributes. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.Attributes attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Products\V1beta\Attributes|null + */ + public function getAttributes() + { + return $this->attributes; + } + + public function hasAttributes() + { + return isset($this->attributes); + } + + public function clearAttributes() + { + unset($this->attributes); + } + + /** + * Optional. A list of product attributes. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.Attributes attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Products\V1beta\Attributes $var + * @return $this + */ + public function setAttributes($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1beta\Attributes::class); + $this->attributes = $var; + + return $this; + } + + /** + * Optional. A list of custom (merchant-provided) attributes. It can also be + * used for submitting any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API, such as additional attributes used for Buy on Google. + * Maximum allowed number of characters for each + * custom attribute is 10240 (represents sum of characters for name and + * value). Maximum 2500 custom attributes can be set per product, with total + * size of 102.4kB. Underscores in custom attribute names are replaced by + * spaces upon insertion. + * + * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomAttributes() + { + return $this->custom_attributes; + } + + /** + * Optional. A list of custom (merchant-provided) attributes. It can also be + * used for submitting any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API, such as additional attributes used for Buy on Google. + * Maximum allowed number of characters for each + * custom attribute is 10240 (represents sum of characters for name and + * value). Maximum 2500 custom attributes can be set per product, with total + * size of 102.4kB. Underscores in custom attribute names are replaced by + * spaces upon insertion. + * + * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Type\CustomAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Type\CustomAttribute::class); + $this->custom_attributes = $arr; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductStatus.php b/ShoppingMerchantProducts/src/V1beta/ProductStatus.php new file mode 100644 index 000000000000..88c885bd8e1f --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductStatus.php @@ -0,0 +1,246 @@ +google.shopping.merchant.products.v1beta.ProductStatus + */ +class ProductStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The intended destinations for the product. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.ProductStatus.DestinationStatus destination_statuses = 3; + */ + private $destination_statuses; + /** + * A list of all issues associated with the product. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.ProductStatus.ItemLevelIssue item_level_issues = 4; + */ + private $item_level_issues; + /** + * Date on which the item has been created, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp creation_date = 5; + */ + protected $creation_date = null; + /** + * Date on which the item has been last updated, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_date = 6; + */ + protected $last_update_date = null; + /** + * Date on which the item expires, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp google_expiration_date = 7; + */ + protected $google_expiration_date = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Products\V1beta\ProductStatus\DestinationStatus>|\Google\Protobuf\Internal\RepeatedField $destination_statuses + * The intended destinations for the product. + * @type array<\Google\Shopping\Merchant\Products\V1beta\ProductStatus\ItemLevelIssue>|\Google\Protobuf\Internal\RepeatedField $item_level_issues + * A list of all issues associated with the product. + * @type \Google\Protobuf\Timestamp $creation_date + * Date on which the item has been created, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * @type \Google\Protobuf\Timestamp $last_update_date + * Date on which the item has been last updated, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * @type \Google\Protobuf\Timestamp $google_expiration_date + * Date on which the item expires, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The intended destinations for the product. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.ProductStatus.DestinationStatus destination_statuses = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestinationStatuses() + { + return $this->destination_statuses; + } + + /** + * The intended destinations for the product. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.ProductStatus.DestinationStatus destination_statuses = 3; + * @param array<\Google\Shopping\Merchant\Products\V1beta\ProductStatus\DestinationStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestinationStatuses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\ProductStatus\DestinationStatus::class); + $this->destination_statuses = $arr; + + return $this; + } + + /** + * A list of all issues associated with the product. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.ProductStatus.ItemLevelIssue item_level_issues = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItemLevelIssues() + { + return $this->item_level_issues; + } + + /** + * A list of all issues associated with the product. + * + * Generated from protobuf field repeated .google.shopping.merchant.products.v1beta.ProductStatus.ItemLevelIssue item_level_issues = 4; + * @param array<\Google\Shopping\Merchant\Products\V1beta\ProductStatus\ItemLevelIssue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItemLevelIssues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Products\V1beta\ProductStatus\ItemLevelIssue::class); + $this->item_level_issues = $arr; + + return $this; + } + + /** + * Date on which the item has been created, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp creation_date = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreationDate() + { + return $this->creation_date; + } + + public function hasCreationDate() + { + return isset($this->creation_date); + } + + public function clearCreationDate() + { + unset($this->creation_date); + } + + /** + * Date on which the item has been created, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp creation_date = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreationDate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->creation_date = $var; + + return $this; + } + + /** + * Date on which the item has been last updated, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_date = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastUpdateDate() + { + return $this->last_update_date; + } + + public function hasLastUpdateDate() + { + return isset($this->last_update_date); + } + + public function clearLastUpdateDate() + { + unset($this->last_update_date); + } + + /** + * Date on which the item has been last updated, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_date = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastUpdateDate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_date = $var; + + return $this; + } + + /** + * Date on which the item expires, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp google_expiration_date = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getGoogleExpirationDate() + { + return $this->google_expiration_date; + } + + public function hasGoogleExpirationDate() + { + return isset($this->google_expiration_date); + } + + public function clearGoogleExpirationDate() + { + unset($this->google_expiration_date); + } + + /** + * Date on which the item expires, in [ISO + * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + * + * Generated from protobuf field .google.protobuf.Timestamp google_expiration_date = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setGoogleExpirationDate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->google_expiration_date = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductStatus/DestinationStatus.php b/ShoppingMerchantProducts/src/V1beta/ProductStatus/DestinationStatus.php new file mode 100644 index 000000000000..5191155fa26e --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductStatus/DestinationStatus.php @@ -0,0 +1,178 @@ +google.shopping.merchant.products.v1beta.ProductStatus.DestinationStatus + */ +class DestinationStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the reporting context. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 1; + */ + protected $reporting_context = 0; + /** + * List of country codes (ISO 3166-1 alpha-2) where the offer is approved. + * + * Generated from protobuf field repeated string approved_countries = 2; + */ + private $approved_countries; + /** + * List of country codes (ISO 3166-1 alpha-2) where the offer is pending + * approval. + * + * Generated from protobuf field repeated string pending_countries = 3; + */ + private $pending_countries; + /** + * List of country codes (ISO 3166-1 alpha-2) where the offer is + * disapproved. + * + * Generated from protobuf field repeated string disapproved_countries = 4; + */ + private $disapproved_countries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $reporting_context + * The name of the reporting context. + * @type array|\Google\Protobuf\Internal\RepeatedField $approved_countries + * List of country codes (ISO 3166-1 alpha-2) where the offer is approved. + * @type array|\Google\Protobuf\Internal\RepeatedField $pending_countries + * List of country codes (ISO 3166-1 alpha-2) where the offer is pending + * approval. + * @type array|\Google\Protobuf\Internal\RepeatedField $disapproved_countries + * List of country codes (ISO 3166-1 alpha-2) where the offer is + * disapproved. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The name of the reporting context. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 1; + * @return int + */ + public function getReportingContext() + { + return $this->reporting_context; + } + + /** + * The name of the reporting context. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 1; + * @param int $var + * @return $this + */ + public function setReportingContext($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Type\ReportingContext\ReportingContextEnum::class); + $this->reporting_context = $var; + + return $this; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) where the offer is approved. + * + * Generated from protobuf field repeated string approved_countries = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApprovedCountries() + { + return $this->approved_countries; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) where the offer is approved. + * + * Generated from protobuf field repeated string approved_countries = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApprovedCountries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->approved_countries = $arr; + + return $this; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) where the offer is pending + * approval. + * + * Generated from protobuf field repeated string pending_countries = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPendingCountries() + { + return $this->pending_countries; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) where the offer is pending + * approval. + * + * Generated from protobuf field repeated string pending_countries = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPendingCountries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->pending_countries = $arr; + + return $this; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) where the offer is + * disapproved. + * + * Generated from protobuf field repeated string disapproved_countries = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisapprovedCountries() + { + return $this->disapproved_countries; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) where the offer is + * disapproved. + * + * Generated from protobuf field repeated string disapproved_countries = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisapprovedCountries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->disapproved_countries = $arr; + + return $this; + } + +} + + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductStatus/ItemLevelIssue.php b/ShoppingMerchantProducts/src/V1beta/ProductStatus/ItemLevelIssue.php new file mode 100644 index 000000000000..6543aa3e5b49 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductStatus/ItemLevelIssue.php @@ -0,0 +1,344 @@ +google.shopping.merchant.products.v1beta.ProductStatus.ItemLevelIssue + */ +class ItemLevelIssue extends \Google\Protobuf\Internal\Message +{ + /** + * The error code of the issue. + * + * Generated from protobuf field string code = 1; + */ + protected $code = ''; + /** + * How this issue affects serving of the offer. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductStatus.ItemLevelIssue.Severity severity = 2; + */ + protected $severity = 0; + /** + * Whether the issue can be resolved by the merchant. + * + * Generated from protobuf field string resolution = 3; + */ + protected $resolution = ''; + /** + * The attribute's name, if the issue is caused by a single attribute. + * + * Generated from protobuf field string attribute = 4; + */ + protected $attribute = ''; + /** + * The reporting context the issue applies to. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 5; + */ + protected $reporting_context = 0; + /** + * A short issue description in English. + * + * Generated from protobuf field string description = 6; + */ + protected $description = ''; + /** + * A detailed issue description in English. + * + * Generated from protobuf field string detail = 7; + */ + protected $detail = ''; + /** + * The URL of a web page to help with resolving this issue. + * + * Generated from protobuf field string documentation = 8; + */ + protected $documentation = ''; + /** + * List of country codes (ISO 3166-1 alpha-2) where issue applies to the + * offer. + * + * Generated from protobuf field repeated string applicable_countries = 9; + */ + private $applicable_countries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $code + * The error code of the issue. + * @type int $severity + * How this issue affects serving of the offer. + * @type string $resolution + * Whether the issue can be resolved by the merchant. + * @type string $attribute + * The attribute's name, if the issue is caused by a single attribute. + * @type int $reporting_context + * The reporting context the issue applies to. + * @type string $description + * A short issue description in English. + * @type string $detail + * A detailed issue description in English. + * @type string $documentation + * The URL of a web page to help with resolving this issue. + * @type array|\Google\Protobuf\Internal\RepeatedField $applicable_countries + * List of country codes (ISO 3166-1 alpha-2) where issue applies to the + * offer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The error code of the issue. + * + * Generated from protobuf field string code = 1; + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * The error code of the issue. + * + * Generated from protobuf field string code = 1; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + + /** + * How this issue affects serving of the offer. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductStatus.ItemLevelIssue.Severity severity = 2; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * How this issue affects serving of the offer. + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.ProductStatus.ItemLevelIssue.Severity severity = 2; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1beta\ProductStatus\ItemLevelIssue\Severity::class); + $this->severity = $var; + + return $this; + } + + /** + * Whether the issue can be resolved by the merchant. + * + * Generated from protobuf field string resolution = 3; + * @return string + */ + public function getResolution() + { + return $this->resolution; + } + + /** + * Whether the issue can be resolved by the merchant. + * + * Generated from protobuf field string resolution = 3; + * @param string $var + * @return $this + */ + public function setResolution($var) + { + GPBUtil::checkString($var, True); + $this->resolution = $var; + + return $this; + } + + /** + * The attribute's name, if the issue is caused by a single attribute. + * + * Generated from protobuf field string attribute = 4; + * @return string + */ + public function getAttribute() + { + return $this->attribute; + } + + /** + * The attribute's name, if the issue is caused by a single attribute. + * + * Generated from protobuf field string attribute = 4; + * @param string $var + * @return $this + */ + public function setAttribute($var) + { + GPBUtil::checkString($var, True); + $this->attribute = $var; + + return $this; + } + + /** + * The reporting context the issue applies to. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 5; + * @return int + */ + public function getReportingContext() + { + return $this->reporting_context; + } + + /** + * The reporting context the issue applies to. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 5; + * @param int $var + * @return $this + */ + public function setReportingContext($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Type\ReportingContext\ReportingContextEnum::class); + $this->reporting_context = $var; + + return $this; + } + + /** + * A short issue description in English. + * + * Generated from protobuf field string description = 6; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A short issue description in English. + * + * Generated from protobuf field string description = 6; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * A detailed issue description in English. + * + * Generated from protobuf field string detail = 7; + * @return string + */ + public function getDetail() + { + return $this->detail; + } + + /** + * A detailed issue description in English. + * + * Generated from protobuf field string detail = 7; + * @param string $var + * @return $this + */ + public function setDetail($var) + { + GPBUtil::checkString($var, True); + $this->detail = $var; + + return $this; + } + + /** + * The URL of a web page to help with resolving this issue. + * + * Generated from protobuf field string documentation = 8; + * @return string + */ + public function getDocumentation() + { + return $this->documentation; + } + + /** + * The URL of a web page to help with resolving this issue. + * + * Generated from protobuf field string documentation = 8; + * @param string $var + * @return $this + */ + public function setDocumentation($var) + { + GPBUtil::checkString($var, True); + $this->documentation = $var; + + return $this; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) where issue applies to the + * offer. + * + * Generated from protobuf field repeated string applicable_countries = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApplicableCountries() + { + return $this->applicable_countries; + } + + /** + * List of country codes (ISO 3166-1 alpha-2) where issue applies to the + * offer. + * + * Generated from protobuf field repeated string applicable_countries = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApplicableCountries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applicable_countries = $arr; + + return $this; + } + +} + + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductStatus/ItemLevelIssue/Severity.php b/ShoppingMerchantProducts/src/V1beta/ProductStatus/ItemLevelIssue/Severity.php new file mode 100644 index 000000000000..4bed758521cc --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductStatus/ItemLevelIssue/Severity.php @@ -0,0 +1,71 @@ +google.shopping.merchant.products.v1beta.ProductStatus.ItemLevelIssue.Severity + */ +class Severity +{ + /** + * Not specified. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * This issue represents a warning and does not have a direct affect + * on the product. + * + * Generated from protobuf enum NOT_IMPACTED = 1; + */ + const NOT_IMPACTED = 1; + /** + * The product is demoted and most likely have limited performance + * in search results + * + * Generated from protobuf enum DEMOTED = 2; + */ + const DEMOTED = 2; + /** + * Issue disapproves the product. + * + * Generated from protobuf enum DISAPPROVED = 3; + */ + const DISAPPROVED = 3; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::NOT_IMPACTED => 'NOT_IMPACTED', + self::DEMOTED => 'DEMOTED', + self::DISAPPROVED => 'DISAPPROVED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductStructuredDescription.php b/ShoppingMerchantProducts/src/V1beta/ProductStructuredDescription.php new file mode 100644 index 000000000000..2d681842a75b --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductStructuredDescription.php @@ -0,0 +1,133 @@ +google.shopping.merchant.products.v1beta.ProductStructuredDescription + */ +class ProductStructuredDescription extends \Google\Protobuf\Internal\Message +{ + /** + * The digital source type, for example "trained_algorithmic_media". + * Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). + * Maximum length is 40 characters. + * + * Generated from protobuf field optional string digital_source_type = 1; + */ + protected $digital_source_type = null; + /** + * The description text + * Maximum length is 5000 characters + * + * Generated from protobuf field optional string content = 2; + */ + protected $content = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $digital_source_type + * The digital source type, for example "trained_algorithmic_media". + * Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). + * Maximum length is 40 characters. + * @type string $content + * The description text + * Maximum length is 5000 characters + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The digital source type, for example "trained_algorithmic_media". + * Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). + * Maximum length is 40 characters. + * + * Generated from protobuf field optional string digital_source_type = 1; + * @return string + */ + public function getDigitalSourceType() + { + return isset($this->digital_source_type) ? $this->digital_source_type : ''; + } + + public function hasDigitalSourceType() + { + return isset($this->digital_source_type); + } + + public function clearDigitalSourceType() + { + unset($this->digital_source_type); + } + + /** + * The digital source type, for example "trained_algorithmic_media". + * Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). + * Maximum length is 40 characters. + * + * Generated from protobuf field optional string digital_source_type = 1; + * @param string $var + * @return $this + */ + public function setDigitalSourceType($var) + { + GPBUtil::checkString($var, True); + $this->digital_source_type = $var; + + return $this; + } + + /** + * The description text + * Maximum length is 5000 characters + * + * Generated from protobuf field optional string content = 2; + * @return string + */ + public function getContent() + { + return isset($this->content) ? $this->content : ''; + } + + public function hasContent() + { + return isset($this->content); + } + + public function clearContent() + { + unset($this->content); + } + + /** + * The description text + * Maximum length is 5000 characters + * + * Generated from protobuf field optional string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductStructuredTitle.php b/ShoppingMerchantProducts/src/V1beta/ProductStructuredTitle.php new file mode 100644 index 000000000000..500b8141ae0b --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductStructuredTitle.php @@ -0,0 +1,133 @@ +google.shopping.merchant.products.v1beta.ProductStructuredTitle + */ +class ProductStructuredTitle extends \Google\Protobuf\Internal\Message +{ + /** + * The digital source type, for example "trained_algorithmic_media". + * Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). + * Maximum length is 40 characters. + * + * Generated from protobuf field optional string digital_source_type = 1; + */ + protected $digital_source_type = null; + /** + * The title text + * Maximum length is 150 characters + * + * Generated from protobuf field optional string content = 2; + */ + protected $content = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $digital_source_type + * The digital source type, for example "trained_algorithmic_media". + * Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). + * Maximum length is 40 characters. + * @type string $content + * The title text + * Maximum length is 150 characters + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The digital source type, for example "trained_algorithmic_media". + * Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). + * Maximum length is 40 characters. + * + * Generated from protobuf field optional string digital_source_type = 1; + * @return string + */ + public function getDigitalSourceType() + { + return isset($this->digital_source_type) ? $this->digital_source_type : ''; + } + + public function hasDigitalSourceType() + { + return isset($this->digital_source_type); + } + + public function clearDigitalSourceType() + { + unset($this->digital_source_type); + } + + /** + * The digital source type, for example "trained_algorithmic_media". + * Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). + * Maximum length is 40 characters. + * + * Generated from protobuf field optional string digital_source_type = 1; + * @param string $var + * @return $this + */ + public function setDigitalSourceType($var) + { + GPBUtil::checkString($var, True); + $this->digital_source_type = $var; + + return $this; + } + + /** + * The title text + * Maximum length is 150 characters + * + * Generated from protobuf field optional string content = 2; + * @return string + */ + public function getContent() + { + return isset($this->content) ? $this->content : ''; + } + + public function hasContent() + { + return isset($this->content); + } + + public function clearContent() + { + unset($this->content); + } + + /** + * The title text + * Maximum length is 150 characters + * + * Generated from protobuf field optional string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ProductWeight.php b/ShoppingMerchantProducts/src/V1beta/ProductWeight.php new file mode 100644 index 000000000000..8673e96521c3 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ProductWeight.php @@ -0,0 +1,125 @@ +google.shopping.merchant.products.v1beta.ProductWeight + */ +class ProductWeight extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The weight represented as a number. The weight can have a maximum + * precision of four decimal places. + * + * Generated from protobuf field double value = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value = 0.0; + /** + * Required. The weight unit. + * Acceptable values are: + * * "`g`" + * * "`kg`" + * * "`oz`" + * * "`lb`" + * + * Generated from protobuf field string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * Required. The weight represented as a number. The weight can have a maximum + * precision of four decimal places. + * @type string $unit + * Required. The weight unit. + * Acceptable values are: + * * "`g`" + * * "`kg`" + * * "`oz`" + * * "`lb`" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Required. The weight represented as a number. The weight can have a maximum + * precision of four decimal places. + * + * Generated from protobuf field double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * Required. The weight represented as a number. The weight can have a maximum + * precision of four decimal places. + * + * Generated from protobuf field double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + + /** + * Required. The weight unit. + * Acceptable values are: + * * "`g`" + * * "`kg`" + * * "`oz`" + * * "`lb`" + * + * Generated from protobuf field string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * Required. The weight unit. + * Acceptable values are: + * * "`g`" + * * "`kg`" + * * "`oz`" + * * "`lb`" + * + * Generated from protobuf field string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/Shipping.php b/ShoppingMerchantProducts/src/V1beta/Shipping.php new file mode 100644 index 000000000000..565fdd9c99d3 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/Shipping.php @@ -0,0 +1,637 @@ +google.shopping.merchant.products.v1beta.Shipping + */ +class Shipping extends \Google\Protobuf\Internal\Message +{ + /** + * Fixed shipping price, represented as a number. + * + * Generated from protobuf field .google.shopping.type.Price price = 1; + */ + protected $price = null; + /** + * The [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * of the country to which an item will ship. + * + * Generated from protobuf field string country = 2; + */ + protected $country = ''; + /** + * The geographic region to which a shipping rate applies. + * See [region](https://support.google.com/merchants/answer/6324484) for more + * information. + * + * Generated from protobuf field string region = 3; + */ + protected $region = ''; + /** + * A free-form description of the service class or delivery speed. + * + * Generated from protobuf field string service = 4; + */ + protected $service = ''; + /** + * The numeric ID of a location that the shipping rate applies to as + * defined in the [AdWords + * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * + * Generated from protobuf field int64 location_id = 5; + */ + protected $location_id = 0; + /** + * The location where the shipping is applicable, represented by a + * location group name. + * + * Generated from protobuf field string location_group_name = 6; + */ + protected $location_group_name = ''; + /** + * The postal code range that the shipping rate applies to, represented by + * a postal code, a postal code prefix followed by a * wildcard, a range + * between two postal codes or two postal code prefixes of equal length. + * + * Generated from protobuf field string postal_code = 7; + */ + protected $postal_code = ''; + /** + * Minimum handling time (inclusive) between when the order is received and + * shipped in business days. 0 means that the order is shipped on the same + * day as it is received if it happens before the cut-off time. + * [minHandlingTime][google.shopping.content.bundles.Products.Shipping.min_handling_time] + * can only be present together with + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time]; + * but it is not required if + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * is present. + * + * Generated from protobuf field optional int64 min_handling_time = 8; + */ + protected $min_handling_time = null; + /** + * Maximum handling time (inclusive) between when the order is received and + * shipped in business days. 0 means that the order is shipped on the same + * day as it is received if it happens before the cut-off time. Both + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * and + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * are required if providing shipping speeds. + * [minHandlingTime][google.shopping.content.bundles.Products.Shipping.min_handling_time] + * is optional if + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * is present. + * + * Generated from protobuf field optional int64 max_handling_time = 9; + */ + protected $max_handling_time = null; + /** + * Minimum transit time (inclusive) between when the order has shipped and + * when it is delivered in business days. 0 means that the order is + * delivered on the same day as it ships. + * [minTransitTime][google.shopping.content.bundles.Products.Shipping.min_transit_time] + * can only be present together with + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time]; + * but it is not required if + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * is present. + * + * Generated from protobuf field optional int64 min_transit_time = 10; + */ + protected $min_transit_time = null; + /** + * Maximum transit time (inclusive) between when the order has shipped and + * when it is delivered in business days. 0 means that the order is + * delivered on the same day as it ships. Both + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * and + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * are required if providing shipping speeds. + * [minTransitTime][google.shopping.content.bundles.Products.Shipping.min_transit_time] + * is optional if + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * is present. + * + * Generated from protobuf field optional int64 max_transit_time = 11; + */ + protected $max_transit_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Shopping\Type\Price $price + * Fixed shipping price, represented as a number. + * @type string $country + * The [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * of the country to which an item will ship. + * @type string $region + * The geographic region to which a shipping rate applies. + * See [region](https://support.google.com/merchants/answer/6324484) for more + * information. + * @type string $service + * A free-form description of the service class or delivery speed. + * @type int|string $location_id + * The numeric ID of a location that the shipping rate applies to as + * defined in the [AdWords + * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * @type string $location_group_name + * The location where the shipping is applicable, represented by a + * location group name. + * @type string $postal_code + * The postal code range that the shipping rate applies to, represented by + * a postal code, a postal code prefix followed by a * wildcard, a range + * between two postal codes or two postal code prefixes of equal length. + * @type int|string $min_handling_time + * Minimum handling time (inclusive) between when the order is received and + * shipped in business days. 0 means that the order is shipped on the same + * day as it is received if it happens before the cut-off time. + * [minHandlingTime][google.shopping.content.bundles.Products.Shipping.min_handling_time] + * can only be present together with + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time]; + * but it is not required if + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * is present. + * @type int|string $max_handling_time + * Maximum handling time (inclusive) between when the order is received and + * shipped in business days. 0 means that the order is shipped on the same + * day as it is received if it happens before the cut-off time. Both + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * and + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * are required if providing shipping speeds. + * [minHandlingTime][google.shopping.content.bundles.Products.Shipping.min_handling_time] + * is optional if + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * is present. + * @type int|string $min_transit_time + * Minimum transit time (inclusive) between when the order has shipped and + * when it is delivered in business days. 0 means that the order is + * delivered on the same day as it ships. + * [minTransitTime][google.shopping.content.bundles.Products.Shipping.min_transit_time] + * can only be present together with + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time]; + * but it is not required if + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * is present. + * @type int|string $max_transit_time + * Maximum transit time (inclusive) between when the order has shipped and + * when it is delivered in business days. 0 means that the order is + * delivered on the same day as it ships. Both + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * and + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * are required if providing shipping speeds. + * [minTransitTime][google.shopping.content.bundles.Products.Shipping.min_transit_time] + * is optional if + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * is present. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Fixed shipping price, represented as a number. + * + * Generated from protobuf field .google.shopping.type.Price price = 1; + * @return \Google\Shopping\Type\Price|null + */ + public function getPrice() + { + return $this->price; + } + + public function hasPrice() + { + return isset($this->price); + } + + public function clearPrice() + { + unset($this->price); + } + + /** + * Fixed shipping price, represented as a number. + * + * Generated from protobuf field .google.shopping.type.Price price = 1; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setPrice($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->price = $var; + + return $this; + } + + /** + * The [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * of the country to which an item will ship. + * + * Generated from protobuf field string country = 2; + * @return string + */ + public function getCountry() + { + return $this->country; + } + + /** + * The [CLDR territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + * of the country to which an item will ship. + * + * Generated from protobuf field string country = 2; + * @param string $var + * @return $this + */ + public function setCountry($var) + { + GPBUtil::checkString($var, True); + $this->country = $var; + + return $this; + } + + /** + * The geographic region to which a shipping rate applies. + * See [region](https://support.google.com/merchants/answer/6324484) for more + * information. + * + * Generated from protobuf field string region = 3; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The geographic region to which a shipping rate applies. + * See [region](https://support.google.com/merchants/answer/6324484) for more + * information. + * + * Generated from protobuf field string region = 3; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + + /** + * A free-form description of the service class or delivery speed. + * + * Generated from protobuf field string service = 4; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * A free-form description of the service class or delivery speed. + * + * Generated from protobuf field string service = 4; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * The numeric ID of a location that the shipping rate applies to as + * defined in the [AdWords + * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * + * Generated from protobuf field int64 location_id = 5; + * @return int|string + */ + public function getLocationId() + { + return $this->location_id; + } + + /** + * The numeric ID of a location that the shipping rate applies to as + * defined in the [AdWords + * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * + * Generated from protobuf field int64 location_id = 5; + * @param int|string $var + * @return $this + */ + public function setLocationId($var) + { + GPBUtil::checkInt64($var); + $this->location_id = $var; + + return $this; + } + + /** + * The location where the shipping is applicable, represented by a + * location group name. + * + * Generated from protobuf field string location_group_name = 6; + * @return string + */ + public function getLocationGroupName() + { + return $this->location_group_name; + } + + /** + * The location where the shipping is applicable, represented by a + * location group name. + * + * Generated from protobuf field string location_group_name = 6; + * @param string $var + * @return $this + */ + public function setLocationGroupName($var) + { + GPBUtil::checkString($var, True); + $this->location_group_name = $var; + + return $this; + } + + /** + * The postal code range that the shipping rate applies to, represented by + * a postal code, a postal code prefix followed by a * wildcard, a range + * between two postal codes or two postal code prefixes of equal length. + * + * Generated from protobuf field string postal_code = 7; + * @return string + */ + public function getPostalCode() + { + return $this->postal_code; + } + + /** + * The postal code range that the shipping rate applies to, represented by + * a postal code, a postal code prefix followed by a * wildcard, a range + * between two postal codes or two postal code prefixes of equal length. + * + * Generated from protobuf field string postal_code = 7; + * @param string $var + * @return $this + */ + public function setPostalCode($var) + { + GPBUtil::checkString($var, True); + $this->postal_code = $var; + + return $this; + } + + /** + * Minimum handling time (inclusive) between when the order is received and + * shipped in business days. 0 means that the order is shipped on the same + * day as it is received if it happens before the cut-off time. + * [minHandlingTime][google.shopping.content.bundles.Products.Shipping.min_handling_time] + * can only be present together with + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time]; + * but it is not required if + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * is present. + * + * Generated from protobuf field optional int64 min_handling_time = 8; + * @return int|string + */ + public function getMinHandlingTime() + { + return isset($this->min_handling_time) ? $this->min_handling_time : 0; + } + + public function hasMinHandlingTime() + { + return isset($this->min_handling_time); + } + + public function clearMinHandlingTime() + { + unset($this->min_handling_time); + } + + /** + * Minimum handling time (inclusive) between when the order is received and + * shipped in business days. 0 means that the order is shipped on the same + * day as it is received if it happens before the cut-off time. + * [minHandlingTime][google.shopping.content.bundles.Products.Shipping.min_handling_time] + * can only be present together with + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time]; + * but it is not required if + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * is present. + * + * Generated from protobuf field optional int64 min_handling_time = 8; + * @param int|string $var + * @return $this + */ + public function setMinHandlingTime($var) + { + GPBUtil::checkInt64($var); + $this->min_handling_time = $var; + + return $this; + } + + /** + * Maximum handling time (inclusive) between when the order is received and + * shipped in business days. 0 means that the order is shipped on the same + * day as it is received if it happens before the cut-off time. Both + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * and + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * are required if providing shipping speeds. + * [minHandlingTime][google.shopping.content.bundles.Products.Shipping.min_handling_time] + * is optional if + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * is present. + * + * Generated from protobuf field optional int64 max_handling_time = 9; + * @return int|string + */ + public function getMaxHandlingTime() + { + return isset($this->max_handling_time) ? $this->max_handling_time : 0; + } + + public function hasMaxHandlingTime() + { + return isset($this->max_handling_time); + } + + public function clearMaxHandlingTime() + { + unset($this->max_handling_time); + } + + /** + * Maximum handling time (inclusive) between when the order is received and + * shipped in business days. 0 means that the order is shipped on the same + * day as it is received if it happens before the cut-off time. Both + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * and + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * are required if providing shipping speeds. + * [minHandlingTime][google.shopping.content.bundles.Products.Shipping.min_handling_time] + * is optional if + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * is present. + * + * Generated from protobuf field optional int64 max_handling_time = 9; + * @param int|string $var + * @return $this + */ + public function setMaxHandlingTime($var) + { + GPBUtil::checkInt64($var); + $this->max_handling_time = $var; + + return $this; + } + + /** + * Minimum transit time (inclusive) between when the order has shipped and + * when it is delivered in business days. 0 means that the order is + * delivered on the same day as it ships. + * [minTransitTime][google.shopping.content.bundles.Products.Shipping.min_transit_time] + * can only be present together with + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time]; + * but it is not required if + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * is present. + * + * Generated from protobuf field optional int64 min_transit_time = 10; + * @return int|string + */ + public function getMinTransitTime() + { + return isset($this->min_transit_time) ? $this->min_transit_time : 0; + } + + public function hasMinTransitTime() + { + return isset($this->min_transit_time); + } + + public function clearMinTransitTime() + { + unset($this->min_transit_time); + } + + /** + * Minimum transit time (inclusive) between when the order has shipped and + * when it is delivered in business days. 0 means that the order is + * delivered on the same day as it ships. + * [minTransitTime][google.shopping.content.bundles.Products.Shipping.min_transit_time] + * can only be present together with + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time]; + * but it is not required if + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * is present. + * + * Generated from protobuf field optional int64 min_transit_time = 10; + * @param int|string $var + * @return $this + */ + public function setMinTransitTime($var) + { + GPBUtil::checkInt64($var); + $this->min_transit_time = $var; + + return $this; + } + + /** + * Maximum transit time (inclusive) between when the order has shipped and + * when it is delivered in business days. 0 means that the order is + * delivered on the same day as it ships. Both + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * and + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * are required if providing shipping speeds. + * [minTransitTime][google.shopping.content.bundles.Products.Shipping.min_transit_time] + * is optional if + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * is present. + * + * Generated from protobuf field optional int64 max_transit_time = 11; + * @return int|string + */ + public function getMaxTransitTime() + { + return isset($this->max_transit_time) ? $this->max_transit_time : 0; + } + + public function hasMaxTransitTime() + { + return isset($this->max_transit_time); + } + + public function clearMaxTransitTime() + { + unset($this->max_transit_time); + } + + /** + * Maximum transit time (inclusive) between when the order has shipped and + * when it is delivered in business days. 0 means that the order is + * delivered on the same day as it ships. Both + * [maxHandlingTime][google.shopping.content.bundles.Products.Shipping.max_handling_time] + * and + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * are required if providing shipping speeds. + * [minTransitTime][google.shopping.content.bundles.Products.Shipping.min_transit_time] + * is optional if + * [maxTransitTime][google.shopping.content.bundles.Products.Shipping.max_transit_time] + * is present. + * + * Generated from protobuf field optional int64 max_transit_time = 11; + * @param int|string $var + * @return $this + */ + public function setMaxTransitTime($var) + { + GPBUtil::checkInt64($var); + $this->max_transit_time = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ShippingDimension.php b/ShoppingMerchantProducts/src/V1beta/ShippingDimension.php new file mode 100644 index 000000000000..8a7cc811e161 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ShippingDimension.php @@ -0,0 +1,105 @@ +google.shopping.merchant.products.v1beta.ShippingDimension + */ +class ShippingDimension extends \Google\Protobuf\Internal\Message +{ + /** + * The dimension of the product used to calculate the shipping cost of the + * item. + * + * Generated from protobuf field double value = 1; + */ + protected $value = 0.0; + /** + * The unit of value. + * + * Generated from protobuf field string unit = 2; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * The dimension of the product used to calculate the shipping cost of the + * item. + * @type string $unit + * The unit of value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The dimension of the product used to calculate the shipping cost of the + * item. + * + * Generated from protobuf field double value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The dimension of the product used to calculate the shipping cost of the + * item. + * + * Generated from protobuf field double value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + + /** + * The unit of value. + * + * Generated from protobuf field string unit = 2; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * The unit of value. + * + * Generated from protobuf field string unit = 2; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/ShippingWeight.php b/ShoppingMerchantProducts/src/V1beta/ShippingWeight.php new file mode 100644 index 000000000000..f8ae12ee3449 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/ShippingWeight.php @@ -0,0 +1,105 @@ +google.shopping.merchant.products.v1beta.ShippingWeight + */ +class ShippingWeight extends \Google\Protobuf\Internal\Message +{ + /** + * The weight of the product used to calculate the shipping cost of the + * item. + * + * Generated from protobuf field double value = 1; + */ + protected $value = 0.0; + /** + * The unit of value. + * + * Generated from protobuf field string unit = 2; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * The weight of the product used to calculate the shipping cost of the + * item. + * @type string $unit + * The unit of value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The weight of the product used to calculate the shipping cost of the + * item. + * + * Generated from protobuf field double value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The weight of the product used to calculate the shipping cost of the + * item. + * + * Generated from protobuf field double value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + + /** + * The unit of value. + * + * Generated from protobuf field string unit = 2; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * The unit of value. + * + * Generated from protobuf field string unit = 2; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/SubscriptionCost.php b/ShoppingMerchantProducts/src/V1beta/SubscriptionCost.php new file mode 100644 index 000000000000..e91de0040f21 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/SubscriptionCost.php @@ -0,0 +1,157 @@ +google.shopping.merchant.products.v1beta.SubscriptionCost + */ +class SubscriptionCost extends \Google\Protobuf\Internal\Message +{ + /** + * The type of subscription period. + * Supported values are: + * * "`month`" + * * "`year`" + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.SubscriptionPeriod period = 1; + */ + protected $period = 0; + /** + * The number of subscription periods the buyer has to pay. + * + * Generated from protobuf field int64 period_length = 2; + */ + protected $period_length = 0; + /** + * The amount the buyer has to pay per subscription period. + * + * Generated from protobuf field .google.shopping.type.Price amount = 3; + */ + protected $amount = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $period + * The type of subscription period. + * Supported values are: + * * "`month`" + * * "`year`" + * @type int|string $period_length + * The number of subscription periods the buyer has to pay. + * @type \Google\Shopping\Type\Price $amount + * The amount the buyer has to pay per subscription period. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The type of subscription period. + * Supported values are: + * * "`month`" + * * "`year`" + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.SubscriptionPeriod period = 1; + * @return int + */ + public function getPeriod() + { + return $this->period; + } + + /** + * The type of subscription period. + * Supported values are: + * * "`month`" + * * "`year`" + * + * Generated from protobuf field .google.shopping.merchant.products.v1beta.SubscriptionPeriod period = 1; + * @param int $var + * @return $this + */ + public function setPeriod($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1beta\SubscriptionPeriod::class); + $this->period = $var; + + return $this; + } + + /** + * The number of subscription periods the buyer has to pay. + * + * Generated from protobuf field int64 period_length = 2; + * @return int|string + */ + public function getPeriodLength() + { + return $this->period_length; + } + + /** + * The number of subscription periods the buyer has to pay. + * + * Generated from protobuf field int64 period_length = 2; + * @param int|string $var + * @return $this + */ + public function setPeriodLength($var) + { + GPBUtil::checkInt64($var); + $this->period_length = $var; + + return $this; + } + + /** + * The amount the buyer has to pay per subscription period. + * + * Generated from protobuf field .google.shopping.type.Price amount = 3; + * @return \Google\Shopping\Type\Price|null + */ + public function getAmount() + { + return $this->amount; + } + + public function hasAmount() + { + return isset($this->amount); + } + + public function clearAmount() + { + unset($this->amount); + } + + /** + * The amount the buyer has to pay per subscription period. + * + * Generated from protobuf field .google.shopping.type.Price amount = 3; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->amount = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/SubscriptionPeriod.php b/ShoppingMerchantProducts/src/V1beta/SubscriptionPeriod.php new file mode 100644 index 000000000000..baf05451244f --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/SubscriptionPeriod.php @@ -0,0 +1,61 @@ +google.shopping.merchant.products.v1beta.SubscriptionPeriod + */ +class SubscriptionPeriod +{ + /** + * Indicates that the subscription period is unspecified. + * + * Generated from protobuf enum SUBSCRIPTION_PERIOD_UNSPECIFIED = 0; + */ + const SUBSCRIPTION_PERIOD_UNSPECIFIED = 0; + /** + * Indicates that the subscription period is month. + * + * Generated from protobuf enum MONTH = 1; + */ + const MONTH = 1; + /** + * Indicates that the subscription period is year. + * + * Generated from protobuf enum YEAR = 2; + */ + const YEAR = 2; + + private static $valueToName = [ + self::SUBSCRIPTION_PERIOD_UNSPECIFIED => 'SUBSCRIPTION_PERIOD_UNSPECIFIED', + self::MONTH => 'MONTH', + self::YEAR => 'YEAR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantProducts/src/V1beta/Tax.php b/ShoppingMerchantProducts/src/V1beta/Tax.php new file mode 100644 index 000000000000..8ab29a91dfa4 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/Tax.php @@ -0,0 +1,265 @@ +google.shopping.merchant.products.v1beta.Tax + */ +class Tax extends \Google\Protobuf\Internal\Message +{ + /** + * The percentage of tax rate that applies to the item price. + * + * Generated from protobuf field double rate = 1; + */ + protected $rate = 0.0; + /** + * The country within which the item is taxed, specified as a [CLDR + * territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml). + * + * Generated from protobuf field string country = 2; + */ + protected $country = ''; + /** + * The geographic region to which the tax rate applies. + * + * Generated from protobuf field string region = 3; + */ + protected $region = ''; + /** + * Set to true if tax is charged on shipping. + * + * Generated from protobuf field bool tax_ship = 4; + */ + protected $tax_ship = false; + /** + * The numeric ID of a location that the tax rate applies to as defined in + * the [AdWords + * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * + * Generated from protobuf field int64 location_id = 5; + */ + protected $location_id = 0; + /** + * The postal code range that the tax rate applies to, represented by + * a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP + * codes or two ZIP code prefixes of equal length. + * Examples: 94114, 94*, 94002-95460, 94*-95*. + * + * Generated from protobuf field string postal_code = 6; + */ + protected $postal_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $rate + * The percentage of tax rate that applies to the item price. + * @type string $country + * The country within which the item is taxed, specified as a [CLDR + * territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml). + * @type string $region + * The geographic region to which the tax rate applies. + * @type bool $tax_ship + * Set to true if tax is charged on shipping. + * @type int|string $location_id + * The numeric ID of a location that the tax rate applies to as defined in + * the [AdWords + * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * @type string $postal_code + * The postal code range that the tax rate applies to, represented by + * a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP + * codes or two ZIP code prefixes of equal length. + * Examples: 94114, 94*, 94002-95460, 94*-95*. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The percentage of tax rate that applies to the item price. + * + * Generated from protobuf field double rate = 1; + * @return float + */ + public function getRate() + { + return $this->rate; + } + + /** + * The percentage of tax rate that applies to the item price. + * + * Generated from protobuf field double rate = 1; + * @param float $var + * @return $this + */ + public function setRate($var) + { + GPBUtil::checkDouble($var); + $this->rate = $var; + + return $this; + } + + /** + * The country within which the item is taxed, specified as a [CLDR + * territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml). + * + * Generated from protobuf field string country = 2; + * @return string + */ + public function getCountry() + { + return $this->country; + } + + /** + * The country within which the item is taxed, specified as a [CLDR + * territory + * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml). + * + * Generated from protobuf field string country = 2; + * @param string $var + * @return $this + */ + public function setCountry($var) + { + GPBUtil::checkString($var, True); + $this->country = $var; + + return $this; + } + + /** + * The geographic region to which the tax rate applies. + * + * Generated from protobuf field string region = 3; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The geographic region to which the tax rate applies. + * + * Generated from protobuf field string region = 3; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + + /** + * Set to true if tax is charged on shipping. + * + * Generated from protobuf field bool tax_ship = 4; + * @return bool + */ + public function getTaxShip() + { + return $this->tax_ship; + } + + /** + * Set to true if tax is charged on shipping. + * + * Generated from protobuf field bool tax_ship = 4; + * @param bool $var + * @return $this + */ + public function setTaxShip($var) + { + GPBUtil::checkBool($var); + $this->tax_ship = $var; + + return $this; + } + + /** + * The numeric ID of a location that the tax rate applies to as defined in + * the [AdWords + * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * + * Generated from protobuf field int64 location_id = 5; + * @return int|string + */ + public function getLocationId() + { + return $this->location_id; + } + + /** + * The numeric ID of a location that the tax rate applies to as defined in + * the [AdWords + * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + * + * Generated from protobuf field int64 location_id = 5; + * @param int|string $var + * @return $this + */ + public function setLocationId($var) + { + GPBUtil::checkInt64($var); + $this->location_id = $var; + + return $this; + } + + /** + * The postal code range that the tax rate applies to, represented by + * a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP + * codes or two ZIP code prefixes of equal length. + * Examples: 94114, 94*, 94002-95460, 94*-95*. + * + * Generated from protobuf field string postal_code = 6; + * @return string + */ + public function getPostalCode() + { + return $this->postal_code; + } + + /** + * The postal code range that the tax rate applies to, represented by + * a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP + * codes or two ZIP code prefixes of equal length. + * Examples: 94114, 94*, 94002-95460, 94*-95*. + * + * Generated from protobuf field string postal_code = 6; + * @param string $var + * @return $this + */ + public function setPostalCode($var) + { + GPBUtil::checkString($var, True); + $this->postal_code = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/UnitPricingBaseMeasure.php b/ShoppingMerchantProducts/src/V1beta/UnitPricingBaseMeasure.php new file mode 100644 index 000000000000..3c17379382f0 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/UnitPricingBaseMeasure.php @@ -0,0 +1,101 @@ +google.shopping.merchant.products.v1beta.UnitPricingBaseMeasure + */ +class UnitPricingBaseMeasure extends \Google\Protobuf\Internal\Message +{ + /** + * The denominator of the unit price. + * + * Generated from protobuf field int64 value = 1; + */ + protected $value = 0; + /** + * The unit of the denominator. + * + * Generated from protobuf field string unit = 2; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $value + * The denominator of the unit price. + * @type string $unit + * The unit of the denominator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The denominator of the unit price. + * + * Generated from protobuf field int64 value = 1; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * The denominator of the unit price. + * + * Generated from protobuf field int64 value = 1; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + + /** + * The unit of the denominator. + * + * Generated from protobuf field string unit = 2; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * The unit of the denominator. + * + * Generated from protobuf field string unit = 2; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/UnitPricingMeasure.php b/ShoppingMerchantProducts/src/V1beta/UnitPricingMeasure.php new file mode 100644 index 000000000000..72026613ced4 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/UnitPricingMeasure.php @@ -0,0 +1,101 @@ +google.shopping.merchant.products.v1beta.UnitPricingMeasure + */ +class UnitPricingMeasure extends \Google\Protobuf\Internal\Message +{ + /** + * The measure of an item. + * + * Generated from protobuf field double value = 1; + */ + protected $value = 0.0; + /** + * The unit of the measure. + * + * Generated from protobuf field string unit = 2; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * The measure of an item. + * @type string $unit + * The unit of the measure. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce(); + parent::__construct($data); + } + + /** + * The measure of an item. + * + * Generated from protobuf field double value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The measure of an item. + * + * Generated from protobuf field double value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + + /** + * The unit of the measure. + * + * Generated from protobuf field string unit = 2; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * The unit of the measure. + * + * Generated from protobuf field string unit = 2; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantProducts/src/V1beta/gapic_metadata.json b/ShoppingMerchantProducts/src/V1beta/gapic_metadata.json new file mode 100644 index 000000000000..f5f9af9b448e --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/gapic_metadata.json @@ -0,0 +1,47 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.shopping.merchant.products.v1beta", + "libraryPackage": "Google\\Shopping\\Merchant\\Products\\V1beta", + "services": { + "ProductInputsService": { + "clients": { + "grpc": { + "libraryClient": "ProductInputsServiceGapicClient", + "rpcs": { + "DeleteProductInput": { + "methods": [ + "deleteProductInput" + ] + }, + "InsertProductInput": { + "methods": [ + "insertProductInput" + ] + } + } + } + } + }, + "ProductsService": { + "clients": { + "grpc": { + "libraryClient": "ProductsServiceGapicClient", + "rpcs": { + "GetProduct": { + "methods": [ + "getProduct" + ] + }, + "ListProducts": { + "methods": [ + "listProducts" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_client_config.json b/ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_client_config.json new file mode 100644 index 000000000000..0b77ec4bc1ca --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.shopping.merchant.products.v1beta.ProductInputsService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "DeleteProductInput": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "InsertProductInput": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_descriptor_config.php b/ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_descriptor_config.php new file mode 100644 index 000000000000..099da3d6bd65 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_descriptor_config.php @@ -0,0 +1,56 @@ + [ + 'google.shopping.merchant.products.v1beta.ProductInputsService' => [ + 'DeleteProductInput' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'InsertProductInput' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Products\V1beta\ProductInput', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'productInput' => 'accounts/{account}/productInputs/{productinput}', + ], + ], + ], +]; diff --git a/ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_rest_client_config.php b/ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_rest_client_config.php new file mode 100644 index 000000000000..c9a434ca8611 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/resources/product_inputs_service_rest_client_config.php @@ -0,0 +1,55 @@ + [ + 'google.shopping.merchant.products.v1beta.ProductInputsService' => [ + 'DeleteProductInput' => [ + 'method' => 'delete', + 'uriTemplate' => '/products/v1beta/{name=accounts/*/productInputs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'data_source', + ], + ], + 'InsertProductInput' => [ + 'method' => 'post', + 'uriTemplate' => '/products/v1beta/{parent=accounts/*}/productInputs:insert', + 'body' => 'product_input', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantProducts/src/V1beta/resources/products_service_client_config.json b/ShoppingMerchantProducts/src/V1beta/resources/products_service_client_config.json new file mode 100644 index 000000000000..c107575483a9 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/resources/products_service_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.shopping.merchant.products.v1beta.ProductsService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetProduct": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListProducts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantProducts/src/V1beta/resources/products_service_descriptor_config.php b/ShoppingMerchantProducts/src/V1beta/resources/products_service_descriptor_config.php new file mode 100644 index 000000000000..b281e65c2b32 --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/resources/products_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.shopping.merchant.products.v1beta.ProductsService' => [ + 'GetProduct' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Products\V1beta\Product', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListProducts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProducts', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Products\V1beta\ListProductsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'account' => 'accounts/{account}', + 'product' => 'accounts/{account}/products/{product}', + ], + ], + ], +]; diff --git a/ShoppingMerchantProducts/src/V1beta/resources/products_service_rest_client_config.php b/ShoppingMerchantProducts/src/V1beta/resources/products_service_rest_client_config.php new file mode 100644 index 000000000000..847c853c6dce --- /dev/null +++ b/ShoppingMerchantProducts/src/V1beta/resources/products_service_rest_client_config.php @@ -0,0 +1,51 @@ + [ + 'google.shopping.merchant.products.v1beta.ProductsService' => [ + 'GetProduct' => [ + 'method' => 'get', + 'uriTemplate' => '/products/v1beta/{name=accounts/*/products/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListProducts' => [ + 'method' => 'get', + 'uriTemplate' => '/products/v1beta/{parent=accounts/*}/products', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantProducts/tests/Unit/V1beta/Client/ProductInputsServiceClientTest.php b/ShoppingMerchantProducts/tests/Unit/V1beta/Client/ProductInputsServiceClientTest.php new file mode 100644 index 000000000000..b99dfc267bf8 --- /dev/null +++ b/ShoppingMerchantProducts/tests/Unit/V1beta/Client/ProductInputsServiceClientTest.php @@ -0,0 +1,275 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ProductInputsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProductInputsServiceClient($options); + } + + /** @test */ + public function deleteProductInputTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->productInputName('[ACCOUNT]', '[PRODUCTINPUT]'); + $dataSource = 'dataSource-1333894576'; + $request = (new DeleteProductInputRequest())->setName($formattedName)->setDataSource($dataSource); + $gapicClient->deleteProductInput($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.products.v1beta.ProductInputsService/DeleteProductInput', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteProductInputExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->productInputName('[ACCOUNT]', '[PRODUCTINPUT]'); + $dataSource = 'dataSource-1333894576'; + $request = (new DeleteProductInputRequest())->setName($formattedName)->setDataSource($dataSource); + try { + $gapicClient->deleteProductInput($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertProductInputTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $product = 'product-309474065'; + $offerId = 'offerId-768546338'; + $contentLanguage = 'contentLanguage-1408137122'; + $feedLabel = 'feedLabel574920979'; + $versionNumber = 135927952; + $expectedResponse = new ProductInput(); + $expectedResponse->setName($name); + $expectedResponse->setProduct($product); + $expectedResponse->setOfferId($offerId); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setFeedLabel($feedLabel); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $productInput = new ProductInput(); + $productInputChannel = ChannelEnum::CHANNEL_ENUM_UNSPECIFIED; + $productInput->setChannel($productInputChannel); + $productInputOfferId = 'productInputOfferId-2885636'; + $productInput->setOfferId($productInputOfferId); + $productInputContentLanguage = 'productInputContentLanguage-1069389482'; + $productInput->setContentLanguage($productInputContentLanguage); + $productInputFeedLabel = 'productInputFeedLabel-2084228581'; + $productInput->setFeedLabel($productInputFeedLabel); + $dataSource = 'dataSource-1333894576'; + $request = (new InsertProductInputRequest()) + ->setParent($formattedParent) + ->setProductInput($productInput) + ->setDataSource($dataSource); + $response = $gapicClient->insertProductInput($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.products.v1beta.ProductInputsService/InsertProductInput', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getProductInput(); + $this->assertProtobufEquals($productInput, $actualValue); + $actualValue = $actualRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertProductInputExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $productInput = new ProductInput(); + $productInputChannel = ChannelEnum::CHANNEL_ENUM_UNSPECIFIED; + $productInput->setChannel($productInputChannel); + $productInputOfferId = 'productInputOfferId-2885636'; + $productInput->setOfferId($productInputOfferId); + $productInputContentLanguage = 'productInputContentLanguage-1069389482'; + $productInput->setContentLanguage($productInputContentLanguage); + $productInputFeedLabel = 'productInputFeedLabel-2084228581'; + $productInput->setFeedLabel($productInputFeedLabel); + $dataSource = 'dataSource-1333894576'; + $request = (new InsertProductInputRequest()) + ->setParent($formattedParent) + ->setProductInput($productInput) + ->setDataSource($dataSource); + try { + $gapicClient->insertProductInput($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteProductInputAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->productInputName('[ACCOUNT]', '[PRODUCTINPUT]'); + $dataSource = 'dataSource-1333894576'; + $request = (new DeleteProductInputRequest())->setName($formattedName)->setDataSource($dataSource); + $gapicClient->deleteProductInputAsync($request)->wait(); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.products.v1beta.ProductInputsService/DeleteProductInput', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantProducts/tests/Unit/V1beta/Client/ProductsServiceClientTest.php b/ShoppingMerchantProducts/tests/Unit/V1beta/Client/ProductsServiceClientTest.php new file mode 100644 index 000000000000..e62ac9e77434 --- /dev/null +++ b/ShoppingMerchantProducts/tests/Unit/V1beta/Client/ProductsServiceClientTest.php @@ -0,0 +1,250 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ProductsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProductsServiceClient($options); + } + + /** @test */ + public function getProductTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $offerId = 'offerId-768546338'; + $contentLanguage = 'contentLanguage-1408137122'; + $feedLabel = 'feedLabel574920979'; + $dataSource = 'dataSource-1333894576'; + $versionNumber = 135927952; + $expectedResponse = new Product(); + $expectedResponse->setName($name2); + $expectedResponse->setOfferId($offerId); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setFeedLabel($feedLabel); + $expectedResponse->setDataSource($dataSource); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); + $request = (new GetProductRequest())->setName($formattedName); + $response = $gapicClient->getProduct($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.products.v1beta.ProductsService/GetProduct', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProductExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); + $request = (new GetProductRequest())->setName($formattedName); + try { + $gapicClient->getProduct($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProductsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $productsElement = new Product(); + $products = [$productsElement]; + $expectedResponse = new ListProductsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProducts($products); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListProductsRequest())->setParent($formattedParent); + $response = $gapicClient->listProducts($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProducts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.products.v1beta.ProductsService/ListProducts', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProductsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->accountName('[ACCOUNT]'); + $request = (new ListProductsRequest())->setParent($formattedParent); + try { + $gapicClient->listProducts($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProductAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $offerId = 'offerId-768546338'; + $contentLanguage = 'contentLanguage-1408137122'; + $feedLabel = 'feedLabel574920979'; + $dataSource = 'dataSource-1333894576'; + $versionNumber = 135927952; + $expectedResponse = new Product(); + $expectedResponse->setName($name2); + $expectedResponse->setOfferId($offerId); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setFeedLabel($feedLabel); + $expectedResponse->setDataSource($dataSource); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); + $request = (new GetProductRequest())->setName($formattedName); + $response = $gapicClient->getProductAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.shopping.merchant.products.v1beta.ProductsService/GetProduct', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantPromotions/.OwlBot.yaml b/ShoppingMerchantPromotions/.OwlBot.yaml new file mode 100644 index 000000000000..9f439abd98c4 --- /dev/null +++ b/ShoppingMerchantPromotions/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/shopping/merchant/promotions/(v1beta)/.*-php/(.*) + dest: /owl-bot-staging/ShoppingMerchantPromotions/$1/$2 +api-name: ShoppingMerchantPromotions diff --git a/ShoppingMerchantPromotions/.gitattributes b/ShoppingMerchantPromotions/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/ShoppingMerchantPromotions/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/ShoppingMerchantPromotions/.github/pull_request_template.md b/ShoppingMerchantPromotions/.github/pull_request_template.md new file mode 100644 index 000000000000..f939e834c3f7 --- /dev/null +++ b/ShoppingMerchantPromotions/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `ShoppingMerchantPromotions/src`, and tests in `ShoppingMerchantPromotions/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). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/ShoppingMerchantPromotions/CONTRIBUTING.md b/ShoppingMerchantPromotions/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/ShoppingMerchantPromotions/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/ShoppingMerchantPromotions/LICENSE b/ShoppingMerchantPromotions/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/ShoppingMerchantPromotions/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. + diff --git a/ShoppingMerchantPromotions/README.md b/ShoppingMerchantPromotions/README.md new file mode 100644 index 000000000000..359f6f1f5fec --- /dev/null +++ b/ShoppingMerchantPromotions/README.md @@ -0,0 +1,45 @@ +# Google Shopping Merchant Promotions for PHP + +> Idiomatic PHP client for [Google Shopping Merchant Promotions](https://developers.google.com/merchant/api). + +[![Latest Stable Version](https://poser.pugx.org/google/shopping-merchant-promotions/v/stable)](https://packagist.org/packages/google/shopping-merchant-promotions) [![Packagist](https://img.shields.io/packagist/dm/google/shopping-merchant-promotions.svg)](https://packagist.org/packages/google/shopping-merchant-promotions) + +* [API documentation](https://cloud.google.com/php/docs/reference/shopping-merchant-promotions/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/shopping-merchant-promotions +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-shopping-merchant-promotions/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/merchant/api). diff --git a/ShoppingMerchantPromotions/VERSION b/ShoppingMerchantPromotions/VERSION new file mode 100644 index 000000000000..6e8bf73aa550 --- /dev/null +++ b/ShoppingMerchantPromotions/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/ShoppingMerchantPromotions/composer.json b/ShoppingMerchantPromotions/composer.json new file mode 100644 index 000000000000..ee66500b3af9 --- /dev/null +++ b/ShoppingMerchantPromotions/composer.json @@ -0,0 +1,31 @@ +{ + "name": "google/shopping-merchant-promotions", + "description": "Google Shopping Merchant Promotions Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Shopping\\Merchant\\Promotions\\": "src", + "GPBMetadata\\Google\\Shopping\\Merchant\\Promotions\\": "metadata" + } + }, + "extra": { + "component": { + "id": "shopping-merchant-promotions", + "path": "ShoppingMerchantPromotions", + "target": "googleapis/php-shopping-merchant-promotions" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0", + "google/shopping-common-protos": "^0.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/ShoppingMerchantPromotions/metadata/V1Beta/Promotions.php b/ShoppingMerchantPromotions/metadata/V1Beta/Promotions.php new file mode 100644 index 0000000000000000000000000000000000000000..f5cfe274337cedef98025f7917b5af0fe03cdd6b GIT binary patch literal 3316 zcmbtWPj4GV6ldcmZ6;OHOhw`bAqEo~Cn{dW6{y-^$~tL7Btk+Gai|Q|dOfyRUC%5t zvk4*if`r5!iO<2uK-~CqpPO(zncem5Caxnp&A}P%d++!D{ob4T@L|viz&mIg z6U-ceo2YS$L1e^gR|AMgLdoJR_5%S-%$Lk*Pgy;C)w=&xb zYB@f~(tJ?26%tp4jg-M2adB}K#h6NWIiRvS71R$>Iu=wGtF}V~X2kJpTbR4d3j}5R zQq{8BSm-jVFU8fwt%CDfs2Im+Spz{emYR1%i!N7#g@18<+YMSL#ok8meUCO7X-k zEhdhfz%$*bo$=%?y_FHPRL|;-q-lx5os0rYI+KX1iKrjIXd_>jt3=j6!5CN@Le|$* zKRnhb{4fco^;E-oa82!syn&43bT#*{eFNSBH+8~wubH3dizeWk;Fe2eJBX!%oA`cEwoxzA`9E=chrPR^9yzfzf0 z4F>3vvbgX$xV?=BgR;&|$~}qkzkPSK0v5gmuYc4MBuPF9`ED>ce=GVbXj z0MU0rpJI~EU9RvQShxt!19>fBxFb#U@{-k56uny2;3AkK_#08rgb;0p^52tSUbm1R zVs`Ag82)a6xeM)u)p7cD!8obd($%6bY<~aee?LuB3Jo!V5b9B;x4Bx8#L5fYN4ENf>$azr5o z0thfrt&;Lb-0&~ubQbaqAqW#~*8hTMMr2ER)^TrO{ z3(q~@x83pHga*TN%Vm2AHSw73x#8Z$>j7of)Cxh|iRadYI{??3(9pMrR5>&nN2ofo znAJZN$o*b|+&@Z?`$mS`KY86i^|t^+#|lFwmo$X~_$w&*<3|I>9x5TT82))_hs1Vm zW?PQ^7u@?Xw=Qfi*x%20m4jSonr+Oq@uZkF@o#RMou7H>(?0(d-rQK& zh-_Y1n7-@c6^HQ4Z|o%H_0cHH@BvbHC(8-X&=>HJC(!tO&Puy6MlI!iE#*Dubi(^u z%=_xI#2-ooJ@#0d#kc^fb4A23OMCoRm}pcJ2q6$##eBrF?SGX4>Wl^UAYwF>MzD#F zM$wQF%lDD@*1&dbb}1K>!p_Q@-_>p&c@58<1J$Q-8m0f#i;@oD@eVC;e{~z^ z4!1VZIL3PkTVvjg>>&y0h)#T7b=W3GR4yU-GS@0dTL6ydjtR4wL*<23P?WxdwV@aJ zXo7i(XdKlY5!Kt?F1fVhe}4sf7``If{jgHR7#lA*K;0tQfgTHspjJwJsto6!leN7#>sP81@hd>0{;-9CoZL14Ml(xqIA857py0As$2v7BqY5U~q3 z@Svs~L9R3v2>me)q@2sMKyvB5Tsjv>u5~}xnhhjZTFI5_urol!HQ!~Y(_HSS}yzw%CS(e zNtSNtTZXcaLyEeLU~$OnIp982aNf~NzMk%A(dj{Gdk=Jwx~ zVbw^7Ne}NXQ7HMaG1Y(wzb!-|4Y9YEusV)zv$YxM=@u0`Dy zuo$0PGB$hZ_HIJRPo5f57IPr-vhBbf@g!}+TF3r6pKsYbR=@B$eTA&+HfmE-&y0^$&*D#fLlm!BF*|YJ$IZA(|vU@&&fJ0j_@_cc5wP;-dOiP`j-)>kX}at-E@=O%l}} za*i`IW@Iy8F7AF0(tPWcUcfUXVpsi1A1inpMjt|vdsv6n%tNwR+&zHh>;fuP;X&u% zK_mj{<{dPGuKe*IXr20jtxXRske{S>jK4EKI-V| zDZ#BEBA%R~cAKhhiiM)|5H=gfr{stnswUA%u3M5G!Pc~B+HL`_-0Qh8x4Lr`aN1^( z_mzXLs**$Pz^vTm^vfQ}2hDsR@1nBAGe0BIO!bIpt;%vH>%G?u13L^RtFE`|-Bty7 z#KJCu%(-|N7gTW#`G4EGjWN)os#_#=8p9%Qzu!q-tA`qJK Ki~L9U2=G4wlCDGm literal 0 HcmV?d00001 diff --git a/ShoppingMerchantPromotions/owlbot.py b/ShoppingMerchantPromotions/owlbot.py new file mode 100644 index 000000000000..f6c990ef7aa1 --- /dev/null +++ b/ShoppingMerchantPromotions/owlbot.py @@ -0,0 +1,62 @@ +# Copyright 2023 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/ShoppingMerchantPromotions").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main( + src=src, + dest=dest, + copy_excludes=[ + src / "**/[A-Z]*_*.php", + ] +) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/ShoppingMerchantPromotions/phpunit.xml.dist b/ShoppingMerchantPromotions/phpunit.xml.dist new file mode 100644 index 000000000000..44c7db5b55db --- /dev/null +++ b/ShoppingMerchantPromotions/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/get_promotion.php b/ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/get_promotion.php new file mode 100644 index 000000000000..0d72b86c1b9c --- /dev/null +++ b/ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/get_promotion.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Promotion $response */ + $response = $promotionsServiceClient->getPromotion($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 = PromotionsServiceClient::promotionName('[ACCOUNT]', '[PROMOTION]'); + + get_promotion_sample($formattedName); +} +// [END merchantapi_v1beta_generated_PromotionsService_GetPromotion_sync] diff --git a/ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/insert_promotion.php b/ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/insert_promotion.php new file mode 100644 index 000000000000..39e34be1c9d5 --- /dev/null +++ b/ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/insert_promotion.php @@ -0,0 +1,124 @@ +setPromotionId($promotionPromotionId) + ->setContentLanguage($promotionContentLanguage) + ->setTargetCountry($promotionTargetCountry) + ->setRedemptionChannel($promotionRedemptionChannel); + $request = (new InsertPromotionRequest()) + ->setParent($parent) + ->setPromotion($promotion) + ->setDataSource($dataSource); + + // Call the API and handle any network failures. + try { + /** @var Promotion $response */ + $response = $promotionsServiceClient->insertPromotion($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 +{ + $parent = '[PARENT]'; + $promotionPromotionId = '[PROMOTION_ID]'; + $promotionContentLanguage = '[CONTENT_LANGUAGE]'; + $promotionTargetCountry = '[TARGET_COUNTRY]'; + $promotionRedemptionChannelElement = RedemptionChannel::REDEMPTION_CHANNEL_UNSPECIFIED; + $dataSource = '[DATA_SOURCE]'; + + insert_promotion_sample( + $parent, + $promotionPromotionId, + $promotionContentLanguage, + $promotionTargetCountry, + $promotionRedemptionChannelElement, + $dataSource + ); +} +// [END merchantapi_v1beta_generated_PromotionsService_InsertPromotion_sync] diff --git a/ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/list_promotions.php b/ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/list_promotions.php new file mode 100644 index 000000000000..0059cc186a9f --- /dev/null +++ b/ShoppingMerchantPromotions/samples/V1beta/PromotionsServiceClient/list_promotions.php @@ -0,0 +1,81 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $promotionsServiceClient->listPromotions($request); + + /** @var Promotion $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $parent = '[PARENT]'; + + list_promotions_sample($parent); +} +// [END merchantapi_v1beta_generated_PromotionsService_ListPromotions_sync] diff --git a/ShoppingMerchantPromotions/src/V1beta/Attributes.php b/ShoppingMerchantPromotions/src/V1beta/Attributes.php new file mode 100644 index 000000000000..0ceaab172a7c --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/Attributes.php @@ -0,0 +1,1533 @@ +google.shopping.merchant.promotions.v1beta.Attributes + */ +class Attributes extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Applicability of the promotion to either all products or + * [only specific + * products](https://support.google.com/merchants/answer/6396257?ref_topic=6396150&sjid=17642868584668136159-NC). + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.ProductApplicability product_applicability = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $product_applicability = 0; + /** + * Required. + * [Type](https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC) + * of the promotion. Use this attribute to indicate whether or not customers + * need a coupon code to redeem your promotion. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.OfferType offer_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $offer_type = 0; + /** + * Optional. Generic redemption code for the promotion. To be used with the + * `offerType` field and must meet the [minimum + * requirements](https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field string generic_redemption_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generic_redemption_code = ''; + /** + * Required. [Long + * title](https://support.google.com/merchants/answer/13838102?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field string long_title = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $long_title = ''; + /** + * Required. The [coupon value type] + * (https://support.google.com/merchants/answer/13861986?ref_topic=13773355&sjid=17642868584668136159-NC) + * attribute to signal the type of promotion that you are running. Depending + * on type of the selected coupon value [some attributes are + * required](https://support.google.com/merchants/answer/6393006?ref_topic=7322920). + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.CouponValueType coupon_value_type = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $coupon_value_type = 0; + /** + * Required. The list of destinations where the promotion applies to. If you + * don't specify a destination by including a supported value in your data + * source, your promotion will display in Shopping ads and free listings by + * default. + * You may have previously submitted the following values as destinations for + * your products: Shopping Actions, Surfaces across Google, Local surfaces + * across Google. To represent these values use `FREE_LISTINGS`, + * `FREE_LOCAL_LISTINGS`, `LOCAL_INVENTORY_ADS`. For more details see + * [Promotion + * destination](https://support.google.com/merchants/answer/13837465?sjid=5155774230887277618-NC) + * + * Generated from protobuf field repeated .google.shopping.type.Destination.DestinationEnum promotion_destinations = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + private $promotion_destinations; + /** + * Optional. Product filter by [item + * ID](https://support.google.com/merchants/answer/13861565?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string item_id_inclusion = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $item_id_inclusion; + /** + * Optional. Product filter by brand for the promotion. The product filter + * attributes only applies when the products eligible for promotion product + * applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string brand_inclusion = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $brand_inclusion; + /** + * Optional. Product filter by item group ID for the promotion. The product + * filter attributes only applies when the products eligible for promotion + * product applicability [product_applicability] attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string item_group_id_inclusion = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $item_group_id_inclusion; + /** + * Optional. Product filter by product type for the promotion. The product + * filter attributes only applies when the products eligible for promotion + * product applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string product_type_inclusion = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $product_type_inclusion; + /** + * Optional. Product filter by [item ID + * exclusion](https://support.google.com/merchants/answer/13863524?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string item_id_exclusion = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $item_id_exclusion; + /** + * Optional. Product filter by [brand + * exclusion](https://support.google.com/merchants/answer/13861679?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string brand_exclusion = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $brand_exclusion; + /** + * Optional. Product filter by [item group + * ID](https://support.google.com/merchants/answer/13837298?ref_topic=13773355&sjid=17642868584668136159-NC). + * The product filter attributes only applies when the products eligible for + * promotion product applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * exclusion for the promotion. + * + * Generated from protobuf field repeated string item_group_id_exclusion = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $item_group_id_exclusion; + /** + * Optional. Product filter by [product type + * exclusion](https://support.google.com/merchants/answer/13863746?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string product_type_exclusion = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $product_type_exclusion; + /** + * Optional. [Minimum purchase + * amount](https://support.google.com/merchants/answer/13837705?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field .google.shopping.type.Price minimum_purchase_amount = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $minimum_purchase_amount = null; + /** + * Optional. [Minimum purchase + * quantity](https://support.google.com/merchants/answer/13838182?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field int64 minimum_purchase_quantity = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $minimum_purchase_quantity = 0; + /** + * Optional. [Maximum purchase + * quantity](https://support.google.com/merchants/answer/13861564?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field int64 limit_quantity = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $limit_quantity = 0; + /** + * Optional. [Maximum product + * price](https://support.google.com/merchants/answer/2906014) for + * promotion. + * + * Generated from protobuf field .google.shopping.type.Price limit_value = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $limit_value = null; + /** + * Optional. The [percentage + * discount](https://support.google.com/merchants/answer/13837404?sjid=17642868584668136159-NC) + * offered in the promotion. + * + * Generated from protobuf field int64 percent_off = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $percent_off = 0; + /** + * Optional. The [money off + * amount](https://support.google.com/merchants/answer/13838101?ref_topic=13773355&sjid=17642868584668136159-NC) + * offered in the promotion. + * + * Generated from protobuf field .google.shopping.type.Price money_off_amount = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $money_off_amount = null; + /** + * Optional. The number of items discounted in the promotion. The attribute is + * set when `couponValueType` is equal to `buy_m_get_n_money_off` or + * `buy_m_get_n_percent_off`. + * + * Generated from protobuf field int64 get_this_quantity_discounted = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $get_this_quantity_discounted = 0; + /** + * Optional. [Free gift + * value](https://support.google.com/merchants/answer/13844477?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field .google.shopping.type.Price free_gift_value = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $free_gift_value = null; + /** + * Optional. [Free gift + * description](https://support.google.com/merchants/answer/13847245?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field string free_gift_description = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $free_gift_description = ''; + /** + * Optional. [Free gift item + * ID](https://support.google.com/merchants/answer/13857152?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field string free_gift_item_id = 24 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $free_gift_item_id = ''; + /** + * Required. `TimePeriod` representation of the promotion's effective dates. + * This attribute specifies that the promotion can be tested on your online + * store during this time period. + * + * Generated from protobuf field .google.type.Interval promotion_effective_time_period = 25 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $promotion_effective_time_period = null; + /** + * Optional. `TimePeriod` representation of the promotion's display dates. + * This attribute specifies the date and time frame when the promotion will be + * live on Google.com and Shopping ads. If the display time period for + * promotion `promotion_display_time_period` attribute is not specified, the + * promotion effective time period `promotion_effective_time_period` + * determines the date and time frame when the promotion will be live on + * Google.com and Shopping ads. + * + * Generated from protobuf field .google.type.Interval promotion_display_time_period = 26 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $promotion_display_time_period = null; + /** + * Optional. Whether the promotion applies to [all stores, or only specified + * stores](https://support.google.com/merchants/answer/13857563?sjid=17642868584668136159-NC). + * Local Inventory ads promotions throw an error if no store applicability is + * included. An `INVALID_ARGUMENT` error is thrown if `store_applicability` is + * set to `ALL_STORES` and `store_codes_inclusion` or `score_code_exclusion` + * is set to a value. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.StoreApplicability store_applicability = 28 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $store_applicability = 0; + /** + * Optional. [Store codes to + * include](https://support.google.com/merchants/answer/13857470?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The store filter attributes only applies when the + * `store_applicability` attribute is set to + * [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + * Store code (the store ID from + * your Business Profile) of the physical store the product is sold in. See + * the [Local product inventory data + * specification](https://support.google.com/merchants/answer/3061342) for + * more information. + * + * Generated from protobuf field repeated string store_codes_inclusion = 29 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $store_codes_inclusion; + /** + * Optional. [Store codes to + * exclude](https://support.google.com/merchants/answer/13859586?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The store filter attributes only applies when the + * `store_applicability` attribute is set to + * [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string store_codes_exclusion = 30 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $store_codes_exclusion; + /** + * Optional. URL to the page on the merchant's site where the promotion shows. + * Local Inventory ads promotions throw an error if no `promotion_url` is + * included. URL is used to confirm that the promotion is valid and can be + * redeemed. + * + * Generated from protobuf field string promotion_url = 31 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $promotion_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $product_applicability + * Required. Applicability of the promotion to either all products or + * [only specific + * products](https://support.google.com/merchants/answer/6396257?ref_topic=6396150&sjid=17642868584668136159-NC). + * @type int $offer_type + * Required. + * [Type](https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC) + * of the promotion. Use this attribute to indicate whether or not customers + * need a coupon code to redeem your promotion. + * @type string $generic_redemption_code + * Optional. Generic redemption code for the promotion. To be used with the + * `offerType` field and must meet the [minimum + * requirements](https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC). + * @type string $long_title + * Required. [Long + * title](https://support.google.com/merchants/answer/13838102?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * @type int $coupon_value_type + * Required. The [coupon value type] + * (https://support.google.com/merchants/answer/13861986?ref_topic=13773355&sjid=17642868584668136159-NC) + * attribute to signal the type of promotion that you are running. Depending + * on type of the selected coupon value [some attributes are + * required](https://support.google.com/merchants/answer/6393006?ref_topic=7322920). + * @type array|\Google\Protobuf\Internal\RepeatedField $promotion_destinations + * Required. The list of destinations where the promotion applies to. If you + * don't specify a destination by including a supported value in your data + * source, your promotion will display in Shopping ads and free listings by + * default. + * You may have previously submitted the following values as destinations for + * your products: Shopping Actions, Surfaces across Google, Local surfaces + * across Google. To represent these values use `FREE_LISTINGS`, + * `FREE_LOCAL_LISTINGS`, `LOCAL_INVENTORY_ADS`. For more details see + * [Promotion + * destination](https://support.google.com/merchants/answer/13837465?sjid=5155774230887277618-NC) + * @type array|\Google\Protobuf\Internal\RepeatedField $item_id_inclusion + * Optional. Product filter by [item + * ID](https://support.google.com/merchants/answer/13861565?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * @type array|\Google\Protobuf\Internal\RepeatedField $brand_inclusion + * Optional. Product filter by brand for the promotion. The product filter + * attributes only applies when the products eligible for promotion product + * applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * @type array|\Google\Protobuf\Internal\RepeatedField $item_group_id_inclusion + * Optional. Product filter by item group ID for the promotion. The product + * filter attributes only applies when the products eligible for promotion + * product applicability [product_applicability] attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * @type array|\Google\Protobuf\Internal\RepeatedField $product_type_inclusion + * Optional. Product filter by product type for the promotion. The product + * filter attributes only applies when the products eligible for promotion + * product applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * @type array|\Google\Protobuf\Internal\RepeatedField $item_id_exclusion + * Optional. Product filter by [item ID + * exclusion](https://support.google.com/merchants/answer/13863524?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * @type array|\Google\Protobuf\Internal\RepeatedField $brand_exclusion + * Optional. Product filter by [brand + * exclusion](https://support.google.com/merchants/answer/13861679?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * @type array|\Google\Protobuf\Internal\RepeatedField $item_group_id_exclusion + * Optional. Product filter by [item group + * ID](https://support.google.com/merchants/answer/13837298?ref_topic=13773355&sjid=17642868584668136159-NC). + * The product filter attributes only applies when the products eligible for + * promotion product applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * exclusion for the promotion. + * @type array|\Google\Protobuf\Internal\RepeatedField $product_type_exclusion + * Optional. Product filter by [product type + * exclusion](https://support.google.com/merchants/answer/13863746?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * @type \Google\Shopping\Type\Price $minimum_purchase_amount + * Optional. [Minimum purchase + * amount](https://support.google.com/merchants/answer/13837705?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * @type int|string $minimum_purchase_quantity + * Optional. [Minimum purchase + * quantity](https://support.google.com/merchants/answer/13838182?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * @type int|string $limit_quantity + * Optional. [Maximum purchase + * quantity](https://support.google.com/merchants/answer/13861564?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * @type \Google\Shopping\Type\Price $limit_value + * Optional. [Maximum product + * price](https://support.google.com/merchants/answer/2906014) for + * promotion. + * @type int|string $percent_off + * Optional. The [percentage + * discount](https://support.google.com/merchants/answer/13837404?sjid=17642868584668136159-NC) + * offered in the promotion. + * @type \Google\Shopping\Type\Price $money_off_amount + * Optional. The [money off + * amount](https://support.google.com/merchants/answer/13838101?ref_topic=13773355&sjid=17642868584668136159-NC) + * offered in the promotion. + * @type int|string $get_this_quantity_discounted + * Optional. The number of items discounted in the promotion. The attribute is + * set when `couponValueType` is equal to `buy_m_get_n_money_off` or + * `buy_m_get_n_percent_off`. + * @type \Google\Shopping\Type\Price $free_gift_value + * Optional. [Free gift + * value](https://support.google.com/merchants/answer/13844477?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * @type string $free_gift_description + * Optional. [Free gift + * description](https://support.google.com/merchants/answer/13847245?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * @type string $free_gift_item_id + * Optional. [Free gift item + * ID](https://support.google.com/merchants/answer/13857152?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * @type \Google\Type\Interval $promotion_effective_time_period + * Required. `TimePeriod` representation of the promotion's effective dates. + * This attribute specifies that the promotion can be tested on your online + * store during this time period. + * @type \Google\Type\Interval $promotion_display_time_period + * Optional. `TimePeriod` representation of the promotion's display dates. + * This attribute specifies the date and time frame when the promotion will be + * live on Google.com and Shopping ads. If the display time period for + * promotion `promotion_display_time_period` attribute is not specified, the + * promotion effective time period `promotion_effective_time_period` + * determines the date and time frame when the promotion will be live on + * Google.com and Shopping ads. + * @type int $store_applicability + * Optional. Whether the promotion applies to [all stores, or only specified + * stores](https://support.google.com/merchants/answer/13857563?sjid=17642868584668136159-NC). + * Local Inventory ads promotions throw an error if no store applicability is + * included. An `INVALID_ARGUMENT` error is thrown if `store_applicability` is + * set to `ALL_STORES` and `store_codes_inclusion` or `score_code_exclusion` + * is set to a value. + * @type array|\Google\Protobuf\Internal\RepeatedField $store_codes_inclusion + * Optional. [Store codes to + * include](https://support.google.com/merchants/answer/13857470?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The store filter attributes only applies when the + * `store_applicability` attribute is set to + * [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + * Store code (the store ID from + * your Business Profile) of the physical store the product is sold in. See + * the [Local product inventory data + * specification](https://support.google.com/merchants/answer/3061342) for + * more information. + * @type array|\Google\Protobuf\Internal\RepeatedField $store_codes_exclusion + * Optional. [Store codes to + * exclude](https://support.google.com/merchants/answer/13859586?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The store filter attributes only applies when the + * `store_applicability` attribute is set to + * [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + * @type string $promotion_url + * Optional. URL to the page on the merchant's site where the promotion shows. + * Local Inventory ads promotions throw an error if no `promotion_url` is + * included. URL is used to confirm that the promotion is valid and can be + * redeemed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Promotions\V1Beta\PromotionsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Required. Applicability of the promotion to either all products or + * [only specific + * products](https://support.google.com/merchants/answer/6396257?ref_topic=6396150&sjid=17642868584668136159-NC). + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.ProductApplicability product_applicability = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getProductApplicability() + { + return $this->product_applicability; + } + + /** + * Required. Applicability of the promotion to either all products or + * [only specific + * products](https://support.google.com/merchants/answer/6396257?ref_topic=6396150&sjid=17642868584668136159-NC). + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.ProductApplicability product_applicability = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setProductApplicability($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Promotions\V1beta\ProductApplicability::class); + $this->product_applicability = $var; + + return $this; + } + + /** + * Required. + * [Type](https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC) + * of the promotion. Use this attribute to indicate whether or not customers + * need a coupon code to redeem your promotion. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.OfferType offer_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getOfferType() + { + return $this->offer_type; + } + + /** + * Required. + * [Type](https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC) + * of the promotion. Use this attribute to indicate whether or not customers + * need a coupon code to redeem your promotion. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.OfferType offer_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setOfferType($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Promotions\V1beta\OfferType::class); + $this->offer_type = $var; + + return $this; + } + + /** + * Optional. Generic redemption code for the promotion. To be used with the + * `offerType` field and must meet the [minimum + * requirements](https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field string generic_redemption_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getGenericRedemptionCode() + { + return $this->generic_redemption_code; + } + + /** + * Optional. Generic redemption code for the promotion. To be used with the + * `offerType` field and must meet the [minimum + * requirements](https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field string generic_redemption_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setGenericRedemptionCode($var) + { + GPBUtil::checkString($var, True); + $this->generic_redemption_code = $var; + + return $this; + } + + /** + * Required. [Long + * title](https://support.google.com/merchants/answer/13838102?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field string long_title = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLongTitle() + { + return $this->long_title; + } + + /** + * Required. [Long + * title](https://support.google.com/merchants/answer/13838102?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field string long_title = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLongTitle($var) + { + GPBUtil::checkString($var, True); + $this->long_title = $var; + + return $this; + } + + /** + * Required. The [coupon value type] + * (https://support.google.com/merchants/answer/13861986?ref_topic=13773355&sjid=17642868584668136159-NC) + * attribute to signal the type of promotion that you are running. Depending + * on type of the selected coupon value [some attributes are + * required](https://support.google.com/merchants/answer/6393006?ref_topic=7322920). + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.CouponValueType coupon_value_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getCouponValueType() + { + return $this->coupon_value_type; + } + + /** + * Required. The [coupon value type] + * (https://support.google.com/merchants/answer/13861986?ref_topic=13773355&sjid=17642868584668136159-NC) + * attribute to signal the type of promotion that you are running. Depending + * on type of the selected coupon value [some attributes are + * required](https://support.google.com/merchants/answer/6393006?ref_topic=7322920). + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.CouponValueType coupon_value_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setCouponValueType($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Promotions\V1beta\CouponValueType::class); + $this->coupon_value_type = $var; + + return $this; + } + + /** + * Required. The list of destinations where the promotion applies to. If you + * don't specify a destination by including a supported value in your data + * source, your promotion will display in Shopping ads and free listings by + * default. + * You may have previously submitted the following values as destinations for + * your products: Shopping Actions, Surfaces across Google, Local surfaces + * across Google. To represent these values use `FREE_LISTINGS`, + * `FREE_LOCAL_LISTINGS`, `LOCAL_INVENTORY_ADS`. For more details see + * [Promotion + * destination](https://support.google.com/merchants/answer/13837465?sjid=5155774230887277618-NC) + * + * Generated from protobuf field repeated .google.shopping.type.Destination.DestinationEnum promotion_destinations = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPromotionDestinations() + { + return $this->promotion_destinations; + } + + /** + * Required. The list of destinations where the promotion applies to. If you + * don't specify a destination by including a supported value in your data + * source, your promotion will display in Shopping ads and free listings by + * default. + * You may have previously submitted the following values as destinations for + * your products: Shopping Actions, Surfaces across Google, Local surfaces + * across Google. To represent these values use `FREE_LISTINGS`, + * `FREE_LOCAL_LISTINGS`, `LOCAL_INVENTORY_ADS`. For more details see + * [Promotion + * destination](https://support.google.com/merchants/answer/13837465?sjid=5155774230887277618-NC) + * + * Generated from protobuf field repeated .google.shopping.type.Destination.DestinationEnum promotion_destinations = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPromotionDestinations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Shopping\Type\Destination\DestinationEnum::class); + $this->promotion_destinations = $arr; + + return $this; + } + + /** + * Optional. Product filter by [item + * ID](https://support.google.com/merchants/answer/13861565?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string item_id_inclusion = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItemIdInclusion() + { + return $this->item_id_inclusion; + } + + /** + * Optional. Product filter by [item + * ID](https://support.google.com/merchants/answer/13861565?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string item_id_inclusion = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItemIdInclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->item_id_inclusion = $arr; + + return $this; + } + + /** + * Optional. Product filter by brand for the promotion. The product filter + * attributes only applies when the products eligible for promotion product + * applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string brand_inclusion = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBrandInclusion() + { + return $this->brand_inclusion; + } + + /** + * Optional. Product filter by brand for the promotion. The product filter + * attributes only applies when the products eligible for promotion product + * applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string brand_inclusion = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBrandInclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->brand_inclusion = $arr; + + return $this; + } + + /** + * Optional. Product filter by item group ID for the promotion. The product + * filter attributes only applies when the products eligible for promotion + * product applicability [product_applicability] attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string item_group_id_inclusion = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItemGroupIdInclusion() + { + return $this->item_group_id_inclusion; + } + + /** + * Optional. Product filter by item group ID for the promotion. The product + * filter attributes only applies when the products eligible for promotion + * product applicability [product_applicability] attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string item_group_id_inclusion = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItemGroupIdInclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->item_group_id_inclusion = $arr; + + return $this; + } + + /** + * Optional. Product filter by product type for the promotion. The product + * filter attributes only applies when the products eligible for promotion + * product applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string product_type_inclusion = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProductTypeInclusion() + { + return $this->product_type_inclusion; + } + + /** + * Optional. Product filter by product type for the promotion. The product + * filter attributes only applies when the products eligible for promotion + * product applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string product_type_inclusion = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProductTypeInclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->product_type_inclusion = $arr; + + return $this; + } + + /** + * Optional. Product filter by [item ID + * exclusion](https://support.google.com/merchants/answer/13863524?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string item_id_exclusion = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItemIdExclusion() + { + return $this->item_id_exclusion; + } + + /** + * Optional. Product filter by [item ID + * exclusion](https://support.google.com/merchants/answer/13863524?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string item_id_exclusion = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItemIdExclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->item_id_exclusion = $arr; + + return $this; + } + + /** + * Optional. Product filter by [brand + * exclusion](https://support.google.com/merchants/answer/13861679?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string brand_exclusion = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBrandExclusion() + { + return $this->brand_exclusion; + } + + /** + * Optional. Product filter by [brand + * exclusion](https://support.google.com/merchants/answer/13861679?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string brand_exclusion = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBrandExclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->brand_exclusion = $arr; + + return $this; + } + + /** + * Optional. Product filter by [item group + * ID](https://support.google.com/merchants/answer/13837298?ref_topic=13773355&sjid=17642868584668136159-NC). + * The product filter attributes only applies when the products eligible for + * promotion product applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * exclusion for the promotion. + * + * Generated from protobuf field repeated string item_group_id_exclusion = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItemGroupIdExclusion() + { + return $this->item_group_id_exclusion; + } + + /** + * Optional. Product filter by [item group + * ID](https://support.google.com/merchants/answer/13837298?ref_topic=13773355&sjid=17642868584668136159-NC). + * The product filter attributes only applies when the products eligible for + * promotion product applicability `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * exclusion for the promotion. + * + * Generated from protobuf field repeated string item_group_id_exclusion = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItemGroupIdExclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->item_group_id_exclusion = $arr; + + return $this; + } + + /** + * Optional. Product filter by [product type + * exclusion](https://support.google.com/merchants/answer/13863746?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string product_type_exclusion = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProductTypeExclusion() + { + return $this->product_type_exclusion; + } + + /** + * Optional. Product filter by [product type + * exclusion](https://support.google.com/merchants/answer/13863746?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The product filter attributes only applies when the + * products eligible for promotion product applicability + * `product_applicability` attribute is set to + * [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string product_type_exclusion = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProductTypeExclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->product_type_exclusion = $arr; + + return $this; + } + + /** + * Optional. [Minimum purchase + * amount](https://support.google.com/merchants/answer/13837705?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field .google.shopping.type.Price minimum_purchase_amount = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Type\Price|null + */ + public function getMinimumPurchaseAmount() + { + return $this->minimum_purchase_amount; + } + + public function hasMinimumPurchaseAmount() + { + return isset($this->minimum_purchase_amount); + } + + public function clearMinimumPurchaseAmount() + { + unset($this->minimum_purchase_amount); + } + + /** + * Optional. [Minimum purchase + * amount](https://support.google.com/merchants/answer/13837705?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field .google.shopping.type.Price minimum_purchase_amount = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setMinimumPurchaseAmount($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->minimum_purchase_amount = $var; + + return $this; + } + + /** + * Optional. [Minimum purchase + * quantity](https://support.google.com/merchants/answer/13838182?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field int64 minimum_purchase_quantity = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getMinimumPurchaseQuantity() + { + return $this->minimum_purchase_quantity; + } + + /** + * Optional. [Minimum purchase + * quantity](https://support.google.com/merchants/answer/13838182?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field int64 minimum_purchase_quantity = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setMinimumPurchaseQuantity($var) + { + GPBUtil::checkInt64($var); + $this->minimum_purchase_quantity = $var; + + return $this; + } + + /** + * Optional. [Maximum purchase + * quantity](https://support.google.com/merchants/answer/13861564?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field int64 limit_quantity = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getLimitQuantity() + { + return $this->limit_quantity; + } + + /** + * Optional. [Maximum purchase + * quantity](https://support.google.com/merchants/answer/13861564?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field int64 limit_quantity = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setLimitQuantity($var) + { + GPBUtil::checkInt64($var); + $this->limit_quantity = $var; + + return $this; + } + + /** + * Optional. [Maximum product + * price](https://support.google.com/merchants/answer/2906014) for + * promotion. + * + * Generated from protobuf field .google.shopping.type.Price limit_value = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Type\Price|null + */ + public function getLimitValue() + { + return $this->limit_value; + } + + public function hasLimitValue() + { + return isset($this->limit_value); + } + + public function clearLimitValue() + { + unset($this->limit_value); + } + + /** + * Optional. [Maximum product + * price](https://support.google.com/merchants/answer/2906014) for + * promotion. + * + * Generated from protobuf field .google.shopping.type.Price limit_value = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setLimitValue($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->limit_value = $var; + + return $this; + } + + /** + * Optional. The [percentage + * discount](https://support.google.com/merchants/answer/13837404?sjid=17642868584668136159-NC) + * offered in the promotion. + * + * Generated from protobuf field int64 percent_off = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getPercentOff() + { + return $this->percent_off; + } + + /** + * Optional. The [percentage + * discount](https://support.google.com/merchants/answer/13837404?sjid=17642868584668136159-NC) + * offered in the promotion. + * + * Generated from protobuf field int64 percent_off = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setPercentOff($var) + { + GPBUtil::checkInt64($var); + $this->percent_off = $var; + + return $this; + } + + /** + * Optional. The [money off + * amount](https://support.google.com/merchants/answer/13838101?ref_topic=13773355&sjid=17642868584668136159-NC) + * offered in the promotion. + * + * Generated from protobuf field .google.shopping.type.Price money_off_amount = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Type\Price|null + */ + public function getMoneyOffAmount() + { + return $this->money_off_amount; + } + + public function hasMoneyOffAmount() + { + return isset($this->money_off_amount); + } + + public function clearMoneyOffAmount() + { + unset($this->money_off_amount); + } + + /** + * Optional. The [money off + * amount](https://support.google.com/merchants/answer/13838101?ref_topic=13773355&sjid=17642868584668136159-NC) + * offered in the promotion. + * + * Generated from protobuf field .google.shopping.type.Price money_off_amount = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setMoneyOffAmount($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->money_off_amount = $var; + + return $this; + } + + /** + * Optional. The number of items discounted in the promotion. The attribute is + * set when `couponValueType` is equal to `buy_m_get_n_money_off` or + * `buy_m_get_n_percent_off`. + * + * Generated from protobuf field int64 get_this_quantity_discounted = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getGetThisQuantityDiscounted() + { + return $this->get_this_quantity_discounted; + } + + /** + * Optional. The number of items discounted in the promotion. The attribute is + * set when `couponValueType` is equal to `buy_m_get_n_money_off` or + * `buy_m_get_n_percent_off`. + * + * Generated from protobuf field int64 get_this_quantity_discounted = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setGetThisQuantityDiscounted($var) + { + GPBUtil::checkInt64($var); + $this->get_this_quantity_discounted = $var; + + return $this; + } + + /** + * Optional. [Free gift + * value](https://support.google.com/merchants/answer/13844477?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field .google.shopping.type.Price free_gift_value = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Type\Price|null + */ + public function getFreeGiftValue() + { + return $this->free_gift_value; + } + + public function hasFreeGiftValue() + { + return isset($this->free_gift_value); + } + + public function clearFreeGiftValue() + { + unset($this->free_gift_value); + } + + /** + * Optional. [Free gift + * value](https://support.google.com/merchants/answer/13844477?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field .google.shopping.type.Price free_gift_value = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setFreeGiftValue($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->free_gift_value = $var; + + return $this; + } + + /** + * Optional. [Free gift + * description](https://support.google.com/merchants/answer/13847245?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field string free_gift_description = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFreeGiftDescription() + { + return $this->free_gift_description; + } + + /** + * Optional. [Free gift + * description](https://support.google.com/merchants/answer/13847245?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field string free_gift_description = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFreeGiftDescription($var) + { + GPBUtil::checkString($var, True); + $this->free_gift_description = $var; + + return $this; + } + + /** + * Optional. [Free gift item + * ID](https://support.google.com/merchants/answer/13857152?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field string free_gift_item_id = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFreeGiftItemId() + { + return $this->free_gift_item_id; + } + + /** + * Optional. [Free gift item + * ID](https://support.google.com/merchants/answer/13857152?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. + * + * Generated from protobuf field string free_gift_item_id = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFreeGiftItemId($var) + { + GPBUtil::checkString($var, True); + $this->free_gift_item_id = $var; + + return $this; + } + + /** + * Required. `TimePeriod` representation of the promotion's effective dates. + * This attribute specifies that the promotion can be tested on your online + * store during this time period. + * + * Generated from protobuf field .google.type.Interval promotion_effective_time_period = 25 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\Interval|null + */ + public function getPromotionEffectiveTimePeriod() + { + return $this->promotion_effective_time_period; + } + + public function hasPromotionEffectiveTimePeriod() + { + return isset($this->promotion_effective_time_period); + } + + public function clearPromotionEffectiveTimePeriod() + { + unset($this->promotion_effective_time_period); + } + + /** + * Required. `TimePeriod` representation of the promotion's effective dates. + * This attribute specifies that the promotion can be tested on your online + * store during this time period. + * + * Generated from protobuf field .google.type.Interval promotion_effective_time_period = 25 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\Interval $var + * @return $this + */ + public function setPromotionEffectiveTimePeriod($var) + { + GPBUtil::checkMessage($var, \Google\Type\Interval::class); + $this->promotion_effective_time_period = $var; + + return $this; + } + + /** + * Optional. `TimePeriod` representation of the promotion's display dates. + * This attribute specifies the date and time frame when the promotion will be + * live on Google.com and Shopping ads. If the display time period for + * promotion `promotion_display_time_period` attribute is not specified, the + * promotion effective time period `promotion_effective_time_period` + * determines the date and time frame when the promotion will be live on + * Google.com and Shopping ads. + * + * Generated from protobuf field .google.type.Interval promotion_display_time_period = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Type\Interval|null + */ + public function getPromotionDisplayTimePeriod() + { + return $this->promotion_display_time_period; + } + + public function hasPromotionDisplayTimePeriod() + { + return isset($this->promotion_display_time_period); + } + + public function clearPromotionDisplayTimePeriod() + { + unset($this->promotion_display_time_period); + } + + /** + * Optional. `TimePeriod` representation of the promotion's display dates. + * This attribute specifies the date and time frame when the promotion will be + * live on Google.com and Shopping ads. If the display time period for + * promotion `promotion_display_time_period` attribute is not specified, the + * promotion effective time period `promotion_effective_time_period` + * determines the date and time frame when the promotion will be live on + * Google.com and Shopping ads. + * + * Generated from protobuf field .google.type.Interval promotion_display_time_period = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Type\Interval $var + * @return $this + */ + public function setPromotionDisplayTimePeriod($var) + { + GPBUtil::checkMessage($var, \Google\Type\Interval::class); + $this->promotion_display_time_period = $var; + + return $this; + } + + /** + * Optional. Whether the promotion applies to [all stores, or only specified + * stores](https://support.google.com/merchants/answer/13857563?sjid=17642868584668136159-NC). + * Local Inventory ads promotions throw an error if no store applicability is + * included. An `INVALID_ARGUMENT` error is thrown if `store_applicability` is + * set to `ALL_STORES` and `store_codes_inclusion` or `score_code_exclusion` + * is set to a value. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.StoreApplicability store_applicability = 28 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getStoreApplicability() + { + return $this->store_applicability; + } + + /** + * Optional. Whether the promotion applies to [all stores, or only specified + * stores](https://support.google.com/merchants/answer/13857563?sjid=17642868584668136159-NC). + * Local Inventory ads promotions throw an error if no store applicability is + * included. An `INVALID_ARGUMENT` error is thrown if `store_applicability` is + * set to `ALL_STORES` and `store_codes_inclusion` or `score_code_exclusion` + * is set to a value. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.StoreApplicability store_applicability = 28 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setStoreApplicability($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Promotions\V1beta\StoreApplicability::class); + $this->store_applicability = $var; + + return $this; + } + + /** + * Optional. [Store codes to + * include](https://support.google.com/merchants/answer/13857470?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The store filter attributes only applies when the + * `store_applicability` attribute is set to + * [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + * Store code (the store ID from + * your Business Profile) of the physical store the product is sold in. See + * the [Local product inventory data + * specification](https://support.google.com/merchants/answer/3061342) for + * more information. + * + * Generated from protobuf field repeated string store_codes_inclusion = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStoreCodesInclusion() + { + return $this->store_codes_inclusion; + } + + /** + * Optional. [Store codes to + * include](https://support.google.com/merchants/answer/13857470?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The store filter attributes only applies when the + * `store_applicability` attribute is set to + * [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + * Store code (the store ID from + * your Business Profile) of the physical store the product is sold in. See + * the [Local product inventory data + * specification](https://support.google.com/merchants/answer/3061342) for + * more information. + * + * Generated from protobuf field repeated string store_codes_inclusion = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStoreCodesInclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->store_codes_inclusion = $arr; + + return $this; + } + + /** + * Optional. [Store codes to + * exclude](https://support.google.com/merchants/answer/13859586?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The store filter attributes only applies when the + * `store_applicability` attribute is set to + * [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string store_codes_exclusion = 30 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStoreCodesExclusion() + { + return $this->store_codes_exclusion; + } + + /** + * Optional. [Store codes to + * exclude](https://support.google.com/merchants/answer/13859586?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. The store filter attributes only applies when the + * `store_applicability` attribute is set to + * [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + * + * Generated from protobuf field repeated string store_codes_exclusion = 30 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStoreCodesExclusion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->store_codes_exclusion = $arr; + + return $this; + } + + /** + * Optional. URL to the page on the merchant's site where the promotion shows. + * Local Inventory ads promotions throw an error if no `promotion_url` is + * included. URL is used to confirm that the promotion is valid and can be + * redeemed. + * + * Generated from protobuf field string promotion_url = 31 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPromotionUrl() + { + return $this->promotion_url; + } + + /** + * Optional. URL to the page on the merchant's site where the promotion shows. + * Local Inventory ads promotions throw an error if no `promotion_url` is + * included. URL is used to confirm that the promotion is valid and can be + * redeemed. + * + * Generated from protobuf field string promotion_url = 31 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPromotionUrl($var) + { + GPBUtil::checkString($var, True); + $this->promotion_url = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/Client/PromotionsServiceClient.php b/ShoppingMerchantPromotions/src/V1beta/Client/PromotionsServiceClient.php new file mode 100644 index 000000000000..d84120b553c9 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/Client/PromotionsServiceClient.php @@ -0,0 +1,317 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/promotions_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/promotions_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/promotions_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/promotions_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a promotion + * resource. + * + * @param string $account + * @param string $promotion + * + * @return string The formatted promotion resource. + * + * @experimental + */ + public static function promotionName(string $account, string $promotion): string + { + return self::getPathTemplate('promotion')->render([ + 'account' => $account, + 'promotion' => $promotion, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - promotion: accounts/{account}/promotions/{promotion} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'merchantapi.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the promotion from your Merchant Center account. + * + * After inserting or updating a promotion input, it may take several + * minutes before the updated promotion can be retrieved. + * + * The async variant is {@see PromotionsServiceClient::getPromotionAsync()} . + * + * @example samples/V1beta/PromotionsServiceClient/get_promotion.php + * + * @param GetPromotionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Promotion + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getPromotion(GetPromotionRequest $request, array $callOptions = []): Promotion + { + return $this->startApiCall('GetPromotion', $request, $callOptions)->wait(); + } + + /** + * Inserts a promotion for your Merchant Center account. If the promotion + * already exists, then it updates the promotion instead. + * + * The async variant is {@see PromotionsServiceClient::insertPromotionAsync()} . + * + * @example samples/V1beta/PromotionsServiceClient/insert_promotion.php + * + * @param InsertPromotionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Promotion + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function insertPromotion(InsertPromotionRequest $request, array $callOptions = []): Promotion + { + return $this->startApiCall('InsertPromotion', $request, $callOptions)->wait(); + } + + /** + * Lists the promotions in your Merchant Center account. The + * response might contain fewer items than specified by `pageSize`. Rely on + * `pageToken` to determine if there are more items to be requested. + * + * After inserting or updating a promotion, it may take several minutes before + * the updated processed promotion can be retrieved. + * + * The async variant is {@see PromotionsServiceClient::listPromotionsAsync()} . + * + * @example samples/V1beta/PromotionsServiceClient/list_promotions.php + * + * @param ListPromotionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listPromotions(ListPromotionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListPromotions', $request, $callOptions); + } +} diff --git a/ShoppingMerchantPromotions/src/V1beta/CouponValueType.php b/ShoppingMerchantPromotions/src/V1beta/CouponValueType.php new file mode 100644 index 000000000000..3ba583e2c44b --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/CouponValueType.php @@ -0,0 +1,139 @@ +google.shopping.merchant.promotions.v1beta.CouponValueType + */ +class CouponValueType +{ + /** + * Indicates that the coupon value type is unspecified. + * + * Generated from protobuf enum COUPON_VALUE_TYPE_UNSPECIFIED = 0; + */ + const COUPON_VALUE_TYPE_UNSPECIFIED = 0; + /** + * Money off coupon value type. + * + * Generated from protobuf enum MONEY_OFF = 1; + */ + const MONEY_OFF = 1; + /** + * Percent off coupon value type. + * + * Generated from protobuf enum PERCENT_OFF = 2; + */ + const PERCENT_OFF = 2; + /** + * Buy M quantity, get N money off coupon value type. + * `minimum_purchase_quantity` and `get_this_quantity_discounted` must be + * present. `money_off_amount` must also be present. + * + * Generated from protobuf enum BUY_M_GET_N_MONEY_OFF = 3; + */ + const BUY_M_GET_N_MONEY_OFF = 3; + /** + * Buy M quantity, get N percent off coupon value type. + * `minimum_purchase_quantity` and `get_this_quantity_discounted` must be + * present. `percent_off_percentage` must also be present. + * + * Generated from protobuf enum BUY_M_GET_N_PERCENT_OFF = 4; + */ + const BUY_M_GET_N_PERCENT_OFF = 4; + /** + * Buy M quantity, get money off. `minimum_purchase_quantity` and + * `money_off_amount` must be present. + * + * Generated from protobuf enum BUY_M_GET_MONEY_OFF = 5; + */ + const BUY_M_GET_MONEY_OFF = 5; + /** + * Buy M quantity, get money off. `minimum_purchase_quantity` and + * `percent_off_percentage` must be present. + * + * Generated from protobuf enum BUY_M_GET_PERCENT_OFF = 6; + */ + const BUY_M_GET_PERCENT_OFF = 6; + /** + * Free gift with description only. + * + * Generated from protobuf enum FREE_GIFT = 7; + */ + const FREE_GIFT = 7; + /** + * Free gift with monetary value. + * + * Generated from protobuf enum FREE_GIFT_WITH_VALUE = 8; + */ + const FREE_GIFT_WITH_VALUE = 8; + /** + * Free gift with item ID. + * + * Generated from protobuf enum FREE_GIFT_WITH_ITEM_ID = 9; + */ + const FREE_GIFT_WITH_ITEM_ID = 9; + /** + * Standard free shipping coupon value type. + * + * Generated from protobuf enum FREE_SHIPPING_STANDARD = 10; + */ + const FREE_SHIPPING_STANDARD = 10; + /** + * Overnight free shipping coupon value type. + * + * Generated from protobuf enum FREE_SHIPPING_OVERNIGHT = 11; + */ + const FREE_SHIPPING_OVERNIGHT = 11; + /** + * Two day free shipping coupon value type. + * + * Generated from protobuf enum FREE_SHIPPING_TWO_DAY = 12; + */ + const FREE_SHIPPING_TWO_DAY = 12; + + private static $valueToName = [ + self::COUPON_VALUE_TYPE_UNSPECIFIED => 'COUPON_VALUE_TYPE_UNSPECIFIED', + self::MONEY_OFF => 'MONEY_OFF', + self::PERCENT_OFF => 'PERCENT_OFF', + self::BUY_M_GET_N_MONEY_OFF => 'BUY_M_GET_N_MONEY_OFF', + self::BUY_M_GET_N_PERCENT_OFF => 'BUY_M_GET_N_PERCENT_OFF', + self::BUY_M_GET_MONEY_OFF => 'BUY_M_GET_MONEY_OFF', + self::BUY_M_GET_PERCENT_OFF => 'BUY_M_GET_PERCENT_OFF', + self::FREE_GIFT => 'FREE_GIFT', + self::FREE_GIFT_WITH_VALUE => 'FREE_GIFT_WITH_VALUE', + self::FREE_GIFT_WITH_ITEM_ID => 'FREE_GIFT_WITH_ITEM_ID', + self::FREE_SHIPPING_STANDARD => 'FREE_SHIPPING_STANDARD', + self::FREE_SHIPPING_OVERNIGHT => 'FREE_SHIPPING_OVERNIGHT', + self::FREE_SHIPPING_TWO_DAY => 'FREE_SHIPPING_TWO_DAY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/GetPromotionRequest.php b/ShoppingMerchantPromotions/src/V1beta/GetPromotionRequest.php new file mode 100644 index 000000000000..f920e0b1bea7 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/GetPromotionRequest.php @@ -0,0 +1,86 @@ +google.shopping.merchant.promotions.v1beta.GetPromotionRequest + */ +class GetPromotionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the promotion to retrieve. + * Format: `accounts/{account}/promotions/{promotions}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the promotion to retrieve. + * Format: `accounts/{account}/promotions/{promotions}` + * Please see {@see PromotionsServiceClient::promotionName()} for help formatting this field. + * + * @return \Google\Shopping\Merchant\Promotions\V1beta\GetPromotionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the promotion to retrieve. + * Format: `accounts/{account}/promotions/{promotions}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Promotions\V1Beta\Promotions::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the promotion to retrieve. + * Format: `accounts/{account}/promotions/{promotions}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the promotion to retrieve. + * Format: `accounts/{account}/promotions/{promotions}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/InsertPromotionRequest.php b/ShoppingMerchantPromotions/src/V1beta/InsertPromotionRequest.php new file mode 100644 index 000000000000..325c7a3cd825 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/InsertPromotionRequest.php @@ -0,0 +1,161 @@ +google.shopping.merchant.promotions.v1beta.InsertPromotionRequest + */ +class InsertPromotionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account where the promotion will be inserted. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The promotion to insert. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $promotion = null; + /** + * Required. The data source of the + * [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC) + * Format: + * `accounts/{account}/dataSources/{datasource}`. + * + * Generated from protobuf field string data_source = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_source = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account where the promotion will be inserted. + * Format: accounts/{account} + * @type \Google\Shopping\Merchant\Promotions\V1beta\Promotion $promotion + * Required. The promotion to insert. + * @type string $data_source + * Required. The data source of the + * [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC) + * Format: + * `accounts/{account}/dataSources/{datasource}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Promotions\V1Beta\Promotions::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account where the promotion will be inserted. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account where the promotion will be inserted. + * Format: accounts/{account} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The promotion to insert. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Shopping\Merchant\Promotions\V1beta\Promotion|null + */ + public function getPromotion() + { + return $this->promotion; + } + + public function hasPromotion() + { + return isset($this->promotion); + } + + public function clearPromotion() + { + unset($this->promotion); + } + + /** + * Required. The promotion to insert. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Shopping\Merchant\Promotions\V1beta\Promotion $var + * @return $this + */ + public function setPromotion($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Promotions\V1beta\Promotion::class); + $this->promotion = $var; + + return $this; + } + + /** + * Required. The data source of the + * [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC) + * Format: + * `accounts/{account}/dataSources/{datasource}`. + * + * Generated from protobuf field string data_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataSource() + { + return $this->data_source; + } + + /** + * Required. The data source of the + * [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC) + * Format: + * `accounts/{account}/dataSources/{datasource}`. + * + * Generated from protobuf field string data_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkString($var, True); + $this->data_source = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/ListPromotionsRequest.php b/ShoppingMerchantPromotions/src/V1beta/ListPromotionsRequest.php new file mode 100644 index 000000000000..ae0893fc6c2c --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/ListPromotionsRequest.php @@ -0,0 +1,177 @@ +google.shopping.merchant.promotions.v1beta.ListPromotionsRequest + */ +class ListPromotionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The account to list processed promotions for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Output only. The maximum number of promotions to return. The service may + * return fewer than this value. The maximum value is 1000; values above 1000 + * will be coerced to 1000. If unspecified, the maximum number of promotions + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $page_size = 0; + /** + * Output only. A page token, received from a previous `ListPromotions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPromotions` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The account to list processed promotions for. + * Format: `accounts/{account}` + * + * @return \Google\Shopping\Merchant\Promotions\V1beta\ListPromotionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The account to list processed promotions for. + * Format: `accounts/{account}` + * @type int $page_size + * Output only. The maximum number of promotions to return. The service may + * return fewer than this value. The maximum value is 1000; values above 1000 + * will be coerced to 1000. If unspecified, the maximum number of promotions + * will be returned. + * @type string $page_token + * Output only. A page token, received from a previous `ListPromotions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPromotions` must + * match the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Promotions\V1Beta\Promotions::initOnce(); + parent::__construct($data); + } + + /** + * Required. The account to list processed promotions for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The account to list processed promotions for. + * Format: `accounts/{account}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Output only. The maximum number of promotions to return. The service may + * return fewer than this value. The maximum value is 1000; values above 1000 + * will be coerced to 1000. If unspecified, the maximum number of promotions + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Output only. The maximum number of promotions to return. The service may + * return fewer than this value. The maximum value is 1000; values above 1000 + * will be coerced to 1000. If unspecified, the maximum number of promotions + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Output only. A page token, received from a previous `ListPromotions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPromotions` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Output only. A page token, received from a previous `ListPromotions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPromotions` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/ListPromotionsResponse.php b/ShoppingMerchantPromotions/src/V1beta/ListPromotionsResponse.php new file mode 100644 index 000000000000..7de3554cbe13 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/ListPromotionsResponse.php @@ -0,0 +1,105 @@ +google.shopping.merchant.promotions.v1beta.ListPromotionsResponse + */ +class ListPromotionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The processed promotions from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.Promotion promotions = 1; + */ + private $promotions; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Promotions\V1beta\Promotion>|\Google\Protobuf\Internal\RepeatedField $promotions + * The processed promotions from the specified account. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Promotions\V1Beta\Promotions::initOnce(); + parent::__construct($data); + } + + /** + * The processed promotions from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.Promotion promotions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPromotions() + { + return $this->promotions; + } + + /** + * The processed promotions from the specified account. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.Promotion promotions = 1; + * @param array<\Google\Shopping\Merchant\Promotions\V1beta\Promotion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPromotions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Promotions\V1beta\Promotion::class); + $this->promotions = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/OfferType.php b/ShoppingMerchantPromotions/src/V1beta/OfferType.php new file mode 100644 index 000000000000..5bd2fefafa1d --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/OfferType.php @@ -0,0 +1,62 @@ +google.shopping.merchant.promotions.v1beta.OfferType + */ +class OfferType +{ + /** + * Unknown offer type. + * + * Generated from protobuf enum OFFER_TYPE_UNSPECIFIED = 0; + */ + const OFFER_TYPE_UNSPECIFIED = 0; + /** + * Offer type without a code. + * + * Generated from protobuf enum NO_CODE = 1; + */ + const NO_CODE = 1; + /** + * Offer type with a code. Generic redemption code for the promotion is + * required when `offerType` = `GENERIC_CODE`. + * + * Generated from protobuf enum GENERIC_CODE = 2; + */ + const GENERIC_CODE = 2; + + private static $valueToName = [ + self::OFFER_TYPE_UNSPECIFIED => 'OFFER_TYPE_UNSPECIFIED', + self::NO_CODE => 'NO_CODE', + self::GENERIC_CODE => 'GENERIC_CODE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/ProductApplicability.php b/ShoppingMerchantPromotions/src/V1beta/ProductApplicability.php new file mode 100644 index 000000000000..5c76d8a5691f --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/ProductApplicability.php @@ -0,0 +1,61 @@ +google.shopping.merchant.promotions.v1beta.ProductApplicability + */ +class ProductApplicability +{ + /** + * Which products the promotion applies to is unknown. + * + * Generated from protobuf enum PRODUCT_APPLICABILITY_UNSPECIFIED = 0; + */ + const PRODUCT_APPLICABILITY_UNSPECIFIED = 0; + /** + * Applicable to all products. + * + * Generated from protobuf enum ALL_PRODUCTS = 1; + */ + const ALL_PRODUCTS = 1; + /** + * Applicable to only a single product or list of products. + * + * Generated from protobuf enum SPECIFIC_PRODUCTS = 2; + */ + const SPECIFIC_PRODUCTS = 2; + + private static $valueToName = [ + self::PRODUCT_APPLICABILITY_UNSPECIFIED => 'PRODUCT_APPLICABILITY_UNSPECIFIED', + self::ALL_PRODUCTS => 'ALL_PRODUCTS', + self::SPECIFIC_PRODUCTS => 'SPECIFIC_PRODUCTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/Promotion.php b/ShoppingMerchantPromotions/src/V1beta/Promotion.php new file mode 100644 index 000000000000..6cdae1f7dd85 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/Promotion.php @@ -0,0 +1,539 @@ +google.shopping.merchant.promotions.v1beta.Promotion + */ +class Promotion extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the promotion. + * Format: `accounts/{account}/promotions/{promotion}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. The user provided promotion ID to uniquely identify the + * promotion. Follow [minimum + * requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements) + * to prevent promotion disapprovals. + * + * Generated from protobuf field string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $promotion_id = ''; + /** + * Required. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * promotion. + * Promotions is only for [selected + * languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=). + * + * Generated from protobuf field string content_language = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $content_language = ''; + /** + * Required. The target country used as part of the unique identifier. + * Represented as a [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * Promotions are only available in selected + * countries, [Free Listings and Shopping + * ads](https://support.google.com/merchants/answer/4588460) [Local Inventory + * ads](https://support.google.com/merchants/answer/10146326) + * + * Generated from protobuf field string target_country = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_country = ''; + /** + * Required. [Redemption + * channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. At least one channel is required. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + private $redemption_channel; + /** + * Output only. The primary data source of the promotion. + * + * Generated from protobuf field string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $data_source = ''; + /** + * Optional. A list of promotion attributes. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $attributes = null; + /** + * Optional. A list of custom (merchant-provided) attributes. It can also be + * used for submitting any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API. + * + * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $custom_attributes; + /** + * Output only. The [status of a + * promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC), + * data validation issues, that is, information about a promotion computed + * asynchronously. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.PromotionStatus promotion_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $promotion_status = null; + /** + * Optional. Represents the existing version (freshness) of the promotion, + * which can be used to preserve the right order when multiple updates are + * done at the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing promotion. Re-insertion (for + * example, promotion refresh after 30 days) can be performed with the current + * `version_number`. + * If the operation is prevented, the aborted exception will be + * thrown. + * + * Generated from protobuf field optional int64 version_number = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $version_number = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the promotion. + * Format: `accounts/{account}/promotions/{promotion}` + * @type string $promotion_id + * Required. The user provided promotion ID to uniquely identify the + * promotion. Follow [minimum + * requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements) + * to prevent promotion disapprovals. + * @type string $content_language + * Required. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * promotion. + * Promotions is only for [selected + * languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=). + * @type string $target_country + * Required. The target country used as part of the unique identifier. + * Represented as a [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * Promotions are only available in selected + * countries, [Free Listings and Shopping + * ads](https://support.google.com/merchants/answer/4588460) [Local Inventory + * ads](https://support.google.com/merchants/answer/10146326) + * @type array|\Google\Protobuf\Internal\RepeatedField $redemption_channel + * Required. [Redemption + * channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. At least one channel is required. + * @type string $data_source + * Output only. The primary data source of the promotion. + * @type \Google\Shopping\Merchant\Promotions\V1beta\Attributes $attributes + * Optional. A list of promotion attributes. + * @type array<\Google\Shopping\Type\CustomAttribute>|\Google\Protobuf\Internal\RepeatedField $custom_attributes + * Optional. A list of custom (merchant-provided) attributes. It can also be + * used for submitting any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API. + * @type \Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus $promotion_status + * Output only. The [status of a + * promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC), + * data validation issues, that is, information about a promotion computed + * asynchronously. + * @type int|string $version_number + * Optional. Represents the existing version (freshness) of the promotion, + * which can be used to preserve the right order when multiple updates are + * done at the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing promotion. Re-insertion (for + * example, promotion refresh after 30 days) can be performed with the current + * `version_number`. + * If the operation is prevented, the aborted exception will be + * thrown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Promotions\V1Beta\Promotions::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the promotion. + * Format: `accounts/{account}/promotions/{promotion}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the promotion. + * Format: `accounts/{account}/promotions/{promotion}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The user provided promotion ID to uniquely identify the + * promotion. Follow [minimum + * requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements) + * to prevent promotion disapprovals. + * + * Generated from protobuf field string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPromotionId() + { + return $this->promotion_id; + } + + /** + * Required. The user provided promotion ID to uniquely identify the + * promotion. Follow [minimum + * requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements) + * to prevent promotion disapprovals. + * + * Generated from protobuf field string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPromotionId($var) + { + GPBUtil::checkString($var, True); + $this->promotion_id = $var; + + return $this; + } + + /** + * Required. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * promotion. + * Promotions is only for [selected + * languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=). + * + * Generated from protobuf field string content_language = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getContentLanguage() + { + return $this->content_language; + } + + /** + * Required. The two-letter [ISO + * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + * promotion. + * Promotions is only for [selected + * languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=). + * + * Generated from protobuf field string content_language = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setContentLanguage($var) + { + GPBUtil::checkString($var, True); + $this->content_language = $var; + + return $this; + } + + /** + * Required. The target country used as part of the unique identifier. + * Represented as a [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * Promotions are only available in selected + * countries, [Free Listings and Shopping + * ads](https://support.google.com/merchants/answer/4588460) [Local Inventory + * ads](https://support.google.com/merchants/answer/10146326) + * + * Generated from protobuf field string target_country = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetCountry() + { + return $this->target_country; + } + + /** + * Required. The target country used as part of the unique identifier. + * Represented as a [CLDR territory + * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + * Promotions are only available in selected + * countries, [Free Listings and Shopping + * ads](https://support.google.com/merchants/answer/4588460) [Local Inventory + * ads](https://support.google.com/merchants/answer/10146326) + * + * Generated from protobuf field string target_country = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetCountry($var) + { + GPBUtil::checkString($var, True); + $this->target_country = $var; + + return $this; + } + + /** + * Required. [Redemption + * channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. At least one channel is required. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRedemptionChannel() + { + return $this->redemption_channel; + } + + /** + * Required. [Redemption + * channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC) + * for the promotion. At least one channel is required. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRedemptionChannel($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Shopping\Merchant\Promotions\V1beta\RedemptionChannel::class); + $this->redemption_channel = $arr; + + return $this; + } + + /** + * Output only. The primary data source of the promotion. + * + * Generated from protobuf field string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDataSource() + { + return $this->data_source; + } + + /** + * Output only. The primary data source of the promotion. + * + * Generated from protobuf field string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkString($var, True); + $this->data_source = $var; + + return $this; + } + + /** + * Optional. A list of promotion attributes. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Shopping\Merchant\Promotions\V1beta\Attributes|null + */ + public function getAttributes() + { + return $this->attributes; + } + + public function hasAttributes() + { + return isset($this->attributes); + } + + public function clearAttributes() + { + unset($this->attributes); + } + + /** + * Optional. A list of promotion attributes. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Shopping\Merchant\Promotions\V1beta\Attributes $var + * @return $this + */ + public function setAttributes($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Promotions\V1beta\Attributes::class); + $this->attributes = $var; + + return $this; + } + + /** + * Optional. A list of custom (merchant-provided) attributes. It can also be + * used for submitting any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API. + * + * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomAttributes() + { + return $this->custom_attributes; + } + + /** + * Optional. A list of custom (merchant-provided) attributes. It can also be + * used for submitting any attribute of the data specification in its generic + * form (for example, + * `{ "name": "size type", "value": "regular" }`). + * This is useful for submitting attributes not explicitly exposed by the + * API. + * + * Generated from protobuf field repeated .google.shopping.type.CustomAttribute custom_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Shopping\Type\CustomAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Type\CustomAttribute::class); + $this->custom_attributes = $arr; + + return $this; + } + + /** + * Output only. The [status of a + * promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC), + * data validation issues, that is, information about a promotion computed + * asynchronously. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.PromotionStatus promotion_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus|null + */ + public function getPromotionStatus() + { + return $this->promotion_status; + } + + public function hasPromotionStatus() + { + return isset($this->promotion_status); + } + + public function clearPromotionStatus() + { + unset($this->promotion_status); + } + + /** + * Output only. The [status of a + * promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC), + * data validation issues, that is, information about a promotion computed + * asynchronously. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.PromotionStatus promotion_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus $var + * @return $this + */ + public function setPromotionStatus($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus::class); + $this->promotion_status = $var; + + return $this; + } + + /** + * Optional. Represents the existing version (freshness) of the promotion, + * which can be used to preserve the right order when multiple updates are + * done at the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing promotion. Re-insertion (for + * example, promotion refresh after 30 days) can be performed with the current + * `version_number`. + * If the operation is prevented, the aborted exception will be + * thrown. + * + * Generated from protobuf field optional int64 version_number = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getVersionNumber() + { + return isset($this->version_number) ? $this->version_number : 0; + } + + public function hasVersionNumber() + { + return isset($this->version_number); + } + + public function clearVersionNumber() + { + unset($this->version_number); + } + + /** + * Optional. Represents the existing version (freshness) of the promotion, + * which can be used to preserve the right order when multiple updates are + * done at the same time. + * If set, the insertion is prevented when version number is lower than + * the current version number of the existing promotion. Re-insertion (for + * example, promotion refresh after 30 days) can be performed with the current + * `version_number`. + * If the operation is prevented, the aborted exception will be + * thrown. + * + * Generated from protobuf field optional int64 version_number = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setVersionNumber($var) + { + GPBUtil::checkInt64($var); + $this->version_number = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/PromotionStatus.php b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus.php new file mode 100644 index 000000000000..4d9d68cd6b8f --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus.php @@ -0,0 +1,213 @@ +google.shopping.merchant.promotions.v1beta.PromotionStatus + */ +class PromotionStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The intended destinations for the promotion. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.PromotionStatus.DestinationStatus destination_statuses = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $destination_statuses; + /** + * Output only. A list of issues associated with the promotion. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.PromotionStatus.ItemLevelIssue item_level_issues = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $item_level_issues; + /** + * Output only. Date on which the promotion has been created + * in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, + * and offset, for example `2020-01-02T09:00:00+01:00` or + * `2020-01-02T09:00:00Z` + * + * Generated from protobuf field .google.protobuf.Timestamp creation_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $creation_date = null; + /** + * Output only. Date on which the promotion status has been last updated + * in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, + * and offset, for example `2020-01-02T09:00:00+01:00` or + * `2020-01-02T09:00:00Z` + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_update_date = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus\DestinationStatus>|\Google\Protobuf\Internal\RepeatedField $destination_statuses + * Output only. The intended destinations for the promotion. + * @type array<\Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus\ItemLevelIssue>|\Google\Protobuf\Internal\RepeatedField $item_level_issues + * Output only. A list of issues associated with the promotion. + * @type \Google\Protobuf\Timestamp $creation_date + * Output only. Date on which the promotion has been created + * in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, + * and offset, for example `2020-01-02T09:00:00+01:00` or + * `2020-01-02T09:00:00Z` + * @type \Google\Protobuf\Timestamp $last_update_date + * Output only. Date on which the promotion status has been last updated + * in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, + * and offset, for example `2020-01-02T09:00:00+01:00` or + * `2020-01-02T09:00:00Z` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Promotions\V1Beta\PromotionsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The intended destinations for the promotion. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.PromotionStatus.DestinationStatus destination_statuses = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestinationStatuses() + { + return $this->destination_statuses; + } + + /** + * Output only. The intended destinations for the promotion. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.PromotionStatus.DestinationStatus destination_statuses = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus\DestinationStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestinationStatuses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus\DestinationStatus::class); + $this->destination_statuses = $arr; + + return $this; + } + + /** + * Output only. A list of issues associated with the promotion. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.PromotionStatus.ItemLevelIssue item_level_issues = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItemLevelIssues() + { + return $this->item_level_issues; + } + + /** + * Output only. A list of issues associated with the promotion. + * + * Generated from protobuf field repeated .google.shopping.merchant.promotions.v1beta.PromotionStatus.ItemLevelIssue item_level_issues = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus\ItemLevelIssue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItemLevelIssues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus\ItemLevelIssue::class); + $this->item_level_issues = $arr; + + return $this; + } + + /** + * Output only. Date on which the promotion has been created + * in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, + * and offset, for example `2020-01-02T09:00:00+01:00` or + * `2020-01-02T09:00:00Z` + * + * Generated from protobuf field .google.protobuf.Timestamp creation_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreationDate() + { + return $this->creation_date; + } + + public function hasCreationDate() + { + return isset($this->creation_date); + } + + public function clearCreationDate() + { + unset($this->creation_date); + } + + /** + * Output only. Date on which the promotion has been created + * in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, + * and offset, for example `2020-01-02T09:00:00+01:00` or + * `2020-01-02T09:00:00Z` + * + * Generated from protobuf field .google.protobuf.Timestamp creation_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreationDate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->creation_date = $var; + + return $this; + } + + /** + * Output only. Date on which the promotion status has been last updated + * in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, + * and offset, for example `2020-01-02T09:00:00+01:00` or + * `2020-01-02T09:00:00Z` + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastUpdateDate() + { + return $this->last_update_date; + } + + public function hasLastUpdateDate() + { + return isset($this->last_update_date); + } + + public function clearLastUpdateDate() + { + unset($this->last_update_date); + } + + /** + * Output only. Date on which the promotion status has been last updated + * in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, + * and offset, for example `2020-01-02T09:00:00+01:00` or + * `2020-01-02T09:00:00Z` + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastUpdateDate($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_date = $var; + + return $this; + } + +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/DestinationStatus.php b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/DestinationStatus.php new file mode 100644 index 000000000000..f2c58402a0b3 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/DestinationStatus.php @@ -0,0 +1,102 @@ +google.shopping.merchant.promotions.v1beta.PromotionStatus.DestinationStatus + */ +class DestinationStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the promotion destination. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reporting_context = 0; + /** + * Output only. The status for the specified destination. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.PromotionStatus.DestinationStatus.State status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $reporting_context + * Output only. The name of the promotion destination. + * @type int $status + * Output only. The status for the specified destination. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Promotions\V1Beta\PromotionsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the promotion destination. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getReportingContext() + { + return $this->reporting_context; + } + + /** + * Output only. The name of the promotion destination. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setReportingContext($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Type\ReportingContext\ReportingContextEnum::class); + $this->reporting_context = $var; + + return $this; + } + + /** + * Output only. The status for the specified destination. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.PromotionStatus.DestinationStatus.State status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. The status for the specified destination. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.PromotionStatus.DestinationStatus.State status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus\DestinationStatus\State::class); + $this->status = $var; + + return $this; + } + +} + + diff --git a/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/DestinationStatus/State.php b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/DestinationStatus/State.php new file mode 100644 index 000000000000..60d08d8a2fed --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/DestinationStatus/State.php @@ -0,0 +1,91 @@ +google.shopping.merchant.promotions.v1beta.PromotionStatus.DestinationStatus.State + */ +class State +{ + /** + * Unknown promotion state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The promotion is under review. + * + * Generated from protobuf enum IN_REVIEW = 1; + */ + const IN_REVIEW = 1; + /** + * The promotion is disapproved. + * + * Generated from protobuf enum REJECTED = 2; + */ + const REJECTED = 2; + /** + * The promotion is approved and active. + * + * Generated from protobuf enum LIVE = 3; + */ + const LIVE = 3; + /** + * The promotion is stopped by merchant. + * + * Generated from protobuf enum STOPPED = 4; + */ + const STOPPED = 4; + /** + * The promotion is no longer active. + * + * Generated from protobuf enum EXPIRED = 5; + */ + const EXPIRED = 5; + /** + * The promotion is not stopped, and all reviews are approved, but the + * active date is in the future. + * + * Generated from protobuf enum PENDING = 6; + */ + const PENDING = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::IN_REVIEW => 'IN_REVIEW', + self::REJECTED => 'REJECTED', + self::LIVE => 'LIVE', + self::STOPPED => 'STOPPED', + self::EXPIRED => 'EXPIRED', + self::PENDING => 'PENDING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/ItemLevelIssue.php b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/ItemLevelIssue.php new file mode 100644 index 000000000000..9bb69f1b5eef --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/ItemLevelIssue.php @@ -0,0 +1,348 @@ +google.shopping.merchant.promotions.v1beta.PromotionStatus.ItemLevelIssue + */ +class ItemLevelIssue extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The error code of the issue. + * + * Generated from protobuf field string code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $code = ''; + /** + * Output only. How this issue affects serving of the promotion. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.PromotionStatus.ItemLevelIssue.Severity severity = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $severity = 0; + /** + * Output only. Whether the issue can be resolved by the merchant. + * + * Generated from protobuf field string resolution = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $resolution = ''; + /** + * Output only. The attribute's name, if the issue is caused by a single + * attribute. + * + * Generated from protobuf field string attribute = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $attribute = ''; + /** + * Output only. The destination the issue applies to. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reporting_context = 0; + /** + * Output only. A short issue description in English. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. A detailed issue description in English. + * + * Generated from protobuf field string detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $detail = ''; + /** + * Output only. The URL of a web page to help with resolving this issue. + * + * Generated from protobuf field string documentation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $documentation = ''; + /** + * Output only. List of country codes (ISO 3166-1 alpha-2) where issue + * applies to the offer. + * + * Generated from protobuf field repeated string applicable_countries = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $applicable_countries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $code + * Output only. The error code of the issue. + * @type int $severity + * Output only. How this issue affects serving of the promotion. + * @type string $resolution + * Output only. Whether the issue can be resolved by the merchant. + * @type string $attribute + * Output only. The attribute's name, if the issue is caused by a single + * attribute. + * @type int $reporting_context + * Output only. The destination the issue applies to. + * @type string $description + * Output only. A short issue description in English. + * @type string $detail + * Output only. A detailed issue description in English. + * @type string $documentation + * Output only. The URL of a web page to help with resolving this issue. + * @type array|\Google\Protobuf\Internal\RepeatedField $applicable_countries + * Output only. List of country codes (ISO 3166-1 alpha-2) where issue + * applies to the offer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Merchant\Promotions\V1Beta\PromotionsCommon::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The error code of the issue. + * + * Generated from protobuf field string code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * Output only. The error code of the issue. + * + * Generated from protobuf field string code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + + /** + * Output only. How this issue affects serving of the promotion. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.PromotionStatus.ItemLevelIssue.Severity severity = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Output only. How this issue affects serving of the promotion. + * + * Generated from protobuf field .google.shopping.merchant.promotions.v1beta.PromotionStatus.ItemLevelIssue.Severity severity = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Promotions\V1beta\PromotionStatus\ItemLevelIssue\Severity::class); + $this->severity = $var; + + return $this; + } + + /** + * Output only. Whether the issue can be resolved by the merchant. + * + * Generated from protobuf field string resolution = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getResolution() + { + return $this->resolution; + } + + /** + * Output only. Whether the issue can be resolved by the merchant. + * + * Generated from protobuf field string resolution = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setResolution($var) + { + GPBUtil::checkString($var, True); + $this->resolution = $var; + + return $this; + } + + /** + * Output only. The attribute's name, if the issue is caused by a single + * attribute. + * + * Generated from protobuf field string attribute = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAttribute() + { + return $this->attribute; + } + + /** + * Output only. The attribute's name, if the issue is caused by a single + * attribute. + * + * Generated from protobuf field string attribute = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAttribute($var) + { + GPBUtil::checkString($var, True); + $this->attribute = $var; + + return $this; + } + + /** + * Output only. The destination the issue applies to. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getReportingContext() + { + return $this->reporting_context; + } + + /** + * Output only. The destination the issue applies to. + * + * Generated from protobuf field .google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setReportingContext($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Type\ReportingContext\ReportingContextEnum::class); + $this->reporting_context = $var; + + return $this; + } + + /** + * Output only. A short issue description in English. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. A short issue description in English. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. A detailed issue description in English. + * + * Generated from protobuf field string detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDetail() + { + return $this->detail; + } + + /** + * Output only. A detailed issue description in English. + * + * Generated from protobuf field string detail = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDetail($var) + { + GPBUtil::checkString($var, True); + $this->detail = $var; + + return $this; + } + + /** + * Output only. The URL of a web page to help with resolving this issue. + * + * Generated from protobuf field string documentation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDocumentation() + { + return $this->documentation; + } + + /** + * Output only. The URL of a web page to help with resolving this issue. + * + * Generated from protobuf field string documentation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDocumentation($var) + { + GPBUtil::checkString($var, True); + $this->documentation = $var; + + return $this; + } + + /** + * Output only. List of country codes (ISO 3166-1 alpha-2) where issue + * applies to the offer. + * + * Generated from protobuf field repeated string applicable_countries = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getApplicableCountries() + { + return $this->applicable_countries; + } + + /** + * Output only. List of country codes (ISO 3166-1 alpha-2) where issue + * applies to the offer. + * + * Generated from protobuf field repeated string applicable_countries = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setApplicableCountries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applicable_countries = $arr; + + return $this; + } + +} + + diff --git a/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/ItemLevelIssue/Severity.php b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/ItemLevelIssue/Severity.php new file mode 100644 index 000000000000..17c953b3250c --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/PromotionStatus/ItemLevelIssue/Severity.php @@ -0,0 +1,71 @@ +google.shopping.merchant.promotions.v1beta.PromotionStatus.ItemLevelIssue.Severity + */ +class Severity +{ + /** + * Not specified. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * This issue represents a warning and does not have a direct affect + * on the promotion. + * + * Generated from protobuf enum NOT_IMPACTED = 1; + */ + const NOT_IMPACTED = 1; + /** + * The promotion is demoted and most likely have limited performance + * in search results + * + * Generated from protobuf enum DEMOTED = 2; + */ + const DEMOTED = 2; + /** + * Issue disapproves the promotion. + * + * Generated from protobuf enum DISAPPROVED = 3; + */ + const DISAPPROVED = 3; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::NOT_IMPACTED => 'NOT_IMPACTED', + self::DEMOTED => 'DEMOTED', + self::DISAPPROVED => 'DISAPPROVED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantPromotions/src/V1beta/RedemptionChannel.php b/ShoppingMerchantPromotions/src/V1beta/RedemptionChannel.php new file mode 100644 index 000000000000..332a86656527 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/RedemptionChannel.php @@ -0,0 +1,62 @@ +google.shopping.merchant.promotions.v1beta.RedemptionChannel + */ +class RedemptionChannel +{ + /** + * Indicates that the channel is unspecified. + * + * Generated from protobuf enum REDEMPTION_CHANNEL_UNSPECIFIED = 0; + */ + const REDEMPTION_CHANNEL_UNSPECIFIED = 0; + /** + * Indicates that the channel is in store. + * This is same as `local` channel used for `products`. + * + * Generated from protobuf enum IN_STORE = 1; + */ + const IN_STORE = 1; + /** + * Indicates that the channel is online. + * + * Generated from protobuf enum ONLINE = 2; + */ + const ONLINE = 2; + + private static $valueToName = [ + self::REDEMPTION_CHANNEL_UNSPECIFIED => 'REDEMPTION_CHANNEL_UNSPECIFIED', + self::IN_STORE => 'IN_STORE', + self::ONLINE => 'ONLINE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/StoreApplicability.php b/ShoppingMerchantPromotions/src/V1beta/StoreApplicability.php new file mode 100644 index 000000000000..376ee3fcb547 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/StoreApplicability.php @@ -0,0 +1,62 @@ +google.shopping.merchant.promotions.v1beta.StoreApplicability + */ +class StoreApplicability +{ + /** + * Which store codes the promotion applies to is unknown. + * + * Generated from protobuf enum STORE_APPLICABILITY_UNSPECIFIED = 0; + */ + const STORE_APPLICABILITY_UNSPECIFIED = 0; + /** + * Promotion applies to all stores. + * + * Generated from protobuf enum ALL_STORES = 1; + */ + const ALL_STORES = 1; + /** + * Promotion applies to only the specified stores. + * + * Generated from protobuf enum SPECIFIC_STORES = 2; + */ + const SPECIFIC_STORES = 2; + + private static $valueToName = [ + self::STORE_APPLICABILITY_UNSPECIFIED => 'STORE_APPLICABILITY_UNSPECIFIED', + self::ALL_STORES => 'ALL_STORES', + self::SPECIFIC_STORES => 'SPECIFIC_STORES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ShoppingMerchantPromotions/src/V1beta/gapic_metadata.json b/ShoppingMerchantPromotions/src/V1beta/gapic_metadata.json new file mode 100644 index 000000000000..f44f6c792289 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.shopping.merchant.promotions.v1beta", + "libraryPackage": "Google\\Shopping\\Merchant\\Promotions\\V1beta", + "services": { + "PromotionsService": { + "clients": { + "grpc": { + "libraryClient": "PromotionsServiceGapicClient", + "rpcs": { + "GetPromotion": { + "methods": [ + "getPromotion" + ] + }, + "InsertPromotion": { + "methods": [ + "insertPromotion" + ] + }, + "ListPromotions": { + "methods": [ + "listPromotions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_client_config.json b/ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_client_config.json new file mode 100644 index 000000000000..231fd93b28f5 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_client_config.json @@ -0,0 +1,49 @@ +{ + "interfaces": { + "google.shopping.merchant.promotions.v1beta.PromotionsService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetPromotion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "InsertPromotion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListPromotions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_descriptor_config.php b/ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_descriptor_config.php new file mode 100644 index 000000000000..da29dd8fa638 --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_descriptor_config.php @@ -0,0 +1,75 @@ + [ + 'google.shopping.merchant.promotions.v1beta.PromotionsService' => [ + 'GetPromotion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Promotions\V1beta\Promotion', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'InsertPromotion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Shopping\Merchant\Promotions\V1beta\Promotion', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListPromotions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getPromotions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Shopping\Merchant\Promotions\V1beta\ListPromotionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'promotion' => 'accounts/{account}/promotions/{promotion}', + ], + ], + ], +]; diff --git a/ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_rest_client_config.php b/ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_rest_client_config.php new file mode 100644 index 000000000000..fb32bad54d8a --- /dev/null +++ b/ShoppingMerchantPromotions/src/V1beta/resources/promotions_service_rest_client_config.php @@ -0,0 +1,63 @@ + [ + 'google.shopping.merchant.promotions.v1beta.PromotionsService' => [ + 'GetPromotion' => [ + 'method' => 'get', + 'uriTemplate' => '/promotions/v1beta/{name=accounts/*/promotions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InsertPromotion' => [ + 'method' => 'post', + 'uriTemplate' => '/promotions/v1beta/{parent=accounts/*}/promotions:insert', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListPromotions' => [ + 'method' => 'get', + 'uriTemplate' => '/promotions/v1beta/{parent=accounts/*}/promotions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/ShoppingMerchantPromotions/tests/Unit/V1beta/Client/PromotionsServiceClientTest.php b/ShoppingMerchantPromotions/tests/Unit/V1beta/Client/PromotionsServiceClientTest.php new file mode 100644 index 000000000000..d9dcd45a770e --- /dev/null +++ b/ShoppingMerchantPromotions/tests/Unit/V1beta/Client/PromotionsServiceClientTest.php @@ -0,0 +1,368 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return PromotionsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PromotionsServiceClient($options); + } + + /** @test */ + public function getPromotionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $promotionId = 'promotionId1962741303'; + $contentLanguage = 'contentLanguage-1408137122'; + $targetCountry = 'targetCountry1659326184'; + $dataSource = 'dataSource-1333894576'; + $versionNumber = 135927952; + $expectedResponse = new Promotion(); + $expectedResponse->setName($name2); + $expectedResponse->setPromotionId($promotionId); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setTargetCountry($targetCountry); + $expectedResponse->setDataSource($dataSource); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->promotionName('[ACCOUNT]', '[PROMOTION]'); + $request = (new GetPromotionRequest())->setName($formattedName); + $response = $gapicClient->getPromotion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.promotions.v1beta.PromotionsService/GetPromotion', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getPromotionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->promotionName('[ACCOUNT]', '[PROMOTION]'); + $request = (new GetPromotionRequest())->setName($formattedName); + try { + $gapicClient->getPromotion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertPromotionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $promotionId = 'promotionId1962741303'; + $contentLanguage = 'contentLanguage-1408137122'; + $targetCountry = 'targetCountry1659326184'; + $dataSource2 = 'dataSource2-1972430333'; + $versionNumber = 135927952; + $expectedResponse = new Promotion(); + $expectedResponse->setName($name); + $expectedResponse->setPromotionId($promotionId); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setTargetCountry($targetCountry); + $expectedResponse->setDataSource($dataSource2); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $promotion = new Promotion(); + $promotionPromotionId = 'promotionPromotionId-209461125'; + $promotion->setPromotionId($promotionPromotionId); + $promotionContentLanguage = 'promotionContentLanguage390538190'; + $promotion->setContentLanguage($promotionContentLanguage); + $promotionTargetCountry = 'promotionTargetCountry-1176642334'; + $promotion->setTargetCountry($promotionTargetCountry); + $promotionRedemptionChannel = []; + $promotion->setRedemptionChannel($promotionRedemptionChannel); + $dataSource = 'dataSource-1333894576'; + $request = (new InsertPromotionRequest()) + ->setParent($parent) + ->setPromotion($promotion) + ->setDataSource($dataSource); + $response = $gapicClient->insertPromotion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.promotions.v1beta.PromotionsService/InsertPromotion', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getPromotion(); + $this->assertProtobufEquals($promotion, $actualValue); + $actualValue = $actualRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertPromotionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $promotion = new Promotion(); + $promotionPromotionId = 'promotionPromotionId-209461125'; + $promotion->setPromotionId($promotionPromotionId); + $promotionContentLanguage = 'promotionContentLanguage390538190'; + $promotion->setContentLanguage($promotionContentLanguage); + $promotionTargetCountry = 'promotionTargetCountry-1176642334'; + $promotion->setTargetCountry($promotionTargetCountry); + $promotionRedemptionChannel = []; + $promotion->setRedemptionChannel($promotionRedemptionChannel); + $dataSource = 'dataSource-1333894576'; + $request = (new InsertPromotionRequest()) + ->setParent($parent) + ->setPromotion($promotion) + ->setDataSource($dataSource); + try { + $gapicClient->insertPromotion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPromotionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $promotionsElement = new Promotion(); + $promotions = [$promotionsElement]; + $expectedResponse = new ListPromotionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setPromotions($promotions); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListPromotionsRequest())->setParent($parent); + $response = $gapicClient->listPromotions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getPromotions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.promotions.v1beta.PromotionsService/ListPromotions', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPromotionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListPromotionsRequest())->setParent($parent); + try { + $gapicClient->listPromotions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getPromotionAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $promotionId = 'promotionId1962741303'; + $contentLanguage = 'contentLanguage-1408137122'; + $targetCountry = 'targetCountry1659326184'; + $dataSource = 'dataSource-1333894576'; + $versionNumber = 135927952; + $expectedResponse = new Promotion(); + $expectedResponse->setName($name2); + $expectedResponse->setPromotionId($promotionId); + $expectedResponse->setContentLanguage($contentLanguage); + $expectedResponse->setTargetCountry($targetCountry); + $expectedResponse->setDataSource($dataSource); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->promotionName('[ACCOUNT]', '[PROMOTION]'); + $request = (new GetPromotionRequest())->setName($formattedName); + $response = $gapicClient->getPromotionAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.shopping.merchant.promotions.v1beta.PromotionsService/GetPromotion', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/ShoppingMerchantQuota/.repo-metadata.json b/ShoppingMerchantQuota/.repo-metadata.json deleted file mode 100644 index 9926c4c8c270..000000000000 --- a/ShoppingMerchantQuota/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/shopping-merchant-quota", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-quota/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi" -} diff --git a/ShoppingMerchantQuota/VERSION b/ShoppingMerchantQuota/VERSION index 17e51c385ea3..b1e80bb2480a 100644 --- a/ShoppingMerchantQuota/VERSION +++ b/ShoppingMerchantQuota/VERSION @@ -1 +1 @@ -0.1.1 +0.1.3 diff --git a/ShoppingMerchantQuota/composer.json b/ShoppingMerchantQuota/composer.json index 3c295b0f1ffd..30f4dd98c584 100644 --- a/ShoppingMerchantQuota/composer.json +++ b/ShoppingMerchantQuota/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ShoppingMerchantReports/.repo-metadata.json b/ShoppingMerchantReports/.repo-metadata.json deleted file mode 100644 index e217be9c76b4..000000000000 --- a/ShoppingMerchantReports/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/shopping-merchant-reports", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-reports/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi" -} diff --git a/ShoppingMerchantReports/VERSION b/ShoppingMerchantReports/VERSION index 39e898a4f952..6f4eebdf6f68 100644 --- a/ShoppingMerchantReports/VERSION +++ b/ShoppingMerchantReports/VERSION @@ -1 +1 @@ -0.7.1 +0.8.1 diff --git a/ShoppingMerchantReports/composer.json b/ShoppingMerchantReports/composer.json index ee190ed472f0..efe06256ca79 100644 --- a/ShoppingMerchantReports/composer.json +++ b/ShoppingMerchantReports/composer.json @@ -18,8 +18,8 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", - "google/shopping-common-protos": "^0.3.0" + "google/gax": "^1.34.0", + "google/shopping-common-protos": "^0.4.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/ShoppingMerchantReports/metadata/V1Beta/Reports.php b/ShoppingMerchantReports/metadata/V1Beta/Reports.php index 86bab1070db3663d1c23168104e7c4e63139db7a..12e2a9bb33c10faab09f3451f85e4fc55af4209f 100644 GIT binary patch delta 299 zcmZ3RwIOeVH#5_$^v%A^ml&BYa7JbOmX?}al3A9Tms(sbAqLdQXXFpk z2vjOzpy!G#t>nwaiy|N-%O&aR=H}`g;u+@Z=NcS5*;&GLvZKtE&G`xkIVJBia!CTM z4=Bn{DNQa3NG(dsFUn2KOHQ3Eudl`_&&5)nnwl-aG&xaA+9x?DGda6hf*I%lW)FrA zMn)kCF7C|Sf+C=^GV}9_C0M{Rj360#E+Me;_>zpG{L=J{_@cy;R0&p~0!9xepn}O? Md5t#fYyIN_0IJ+rdjJ3c delta 63 zcmV-F0KosSZmnvtO9KLzW3x>I(g6bI2a_QMZ?pOZh8G0T2MQRIKOh*hoE>2T2SNo3 V17B%mlQ0d|vymad39~aS{R+uK6}A8X diff --git a/ShoppingMerchantReports/src/V1beta/BestSellersProductClusterView.php b/ShoppingMerchantReports/src/V1beta/BestSellersProductClusterView.php index 1eb9b46f8d8f..1bf3d09e8d85 100644 --- a/ShoppingMerchantReports/src/V1beta/BestSellersProductClusterView.php +++ b/ShoppingMerchantReports/src/V1beta/BestSellersProductClusterView.php @@ -120,9 +120,9 @@ class BestSellersProductClusterView extends \Google\Protobuf\Internal\Message */ private $variant_gtins; /** - * Whether the product cluster is `IN_STOCK` in your product feed in at least - * one of the countries, `OUT_OF_STOCK` in your product feed in all countries, - * or `NOT_IN_INVENTORY` at all. + * Whether the product cluster is `IN_STOCK` in your product data source in at + * least one of the countries, `OUT_OF_STOCK` in your product data source in + * all countries, or `NOT_IN_INVENTORY` at all. * The field doesn't take the Best sellers report country filter into account. * * Generated from protobuf field optional .google.shopping.merchant.reports.v1beta.BestSellersProductClusterView.InventoryStatus inventory_status = 14; @@ -130,8 +130,8 @@ class BestSellersProductClusterView extends \Google\Protobuf\Internal\Message protected $inventory_status = null; /** * Whether there is at least one product of the brand currently `IN_STOCK` in - * your product feed in at least one of the countries, all products are - * `OUT_OF_STOCK` in your product feed in all countries, or + * your product data source in at least one of the countries, all products are + * `OUT_OF_STOCK` in your product data source in all countries, or * `NOT_IN_INVENTORY`. * The field doesn't take the Best sellers report country filter into account. * @@ -230,14 +230,14 @@ class BestSellersProductClusterView extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\RepeatedField $variant_gtins * GTINs of example variants of the product cluster. * @type int $inventory_status - * Whether the product cluster is `IN_STOCK` in your product feed in at least - * one of the countries, `OUT_OF_STOCK` in your product feed in all countries, - * or `NOT_IN_INVENTORY` at all. + * Whether the product cluster is `IN_STOCK` in your product data source in at + * least one of the countries, `OUT_OF_STOCK` in your product data source in + * all countries, or `NOT_IN_INVENTORY` at all. * The field doesn't take the Best sellers report country filter into account. * @type int $brand_inventory_status * Whether there is at least one product of the brand currently `IN_STOCK` in - * your product feed in at least one of the countries, all products are - * `OUT_OF_STOCK` in your product feed in all countries, or + * your product data source in at least one of the countries, all products are + * `OUT_OF_STOCK` in your product data source in all countries, or * `NOT_IN_INVENTORY`. * The field doesn't take the Best sellers report country filter into account. * @type int|string $rank @@ -736,9 +736,9 @@ public function setVariantGtins($var) } /** - * Whether the product cluster is `IN_STOCK` in your product feed in at least - * one of the countries, `OUT_OF_STOCK` in your product feed in all countries, - * or `NOT_IN_INVENTORY` at all. + * Whether the product cluster is `IN_STOCK` in your product data source in at + * least one of the countries, `OUT_OF_STOCK` in your product data source in + * all countries, or `NOT_IN_INVENTORY` at all. * The field doesn't take the Best sellers report country filter into account. * * Generated from protobuf field optional .google.shopping.merchant.reports.v1beta.BestSellersProductClusterView.InventoryStatus inventory_status = 14; @@ -760,9 +760,9 @@ public function clearInventoryStatus() } /** - * Whether the product cluster is `IN_STOCK` in your product feed in at least - * one of the countries, `OUT_OF_STOCK` in your product feed in all countries, - * or `NOT_IN_INVENTORY` at all. + * Whether the product cluster is `IN_STOCK` in your product data source in at + * least one of the countries, `OUT_OF_STOCK` in your product data source in + * all countries, or `NOT_IN_INVENTORY` at all. * The field doesn't take the Best sellers report country filter into account. * * Generated from protobuf field optional .google.shopping.merchant.reports.v1beta.BestSellersProductClusterView.InventoryStatus inventory_status = 14; @@ -779,8 +779,8 @@ public function setInventoryStatus($var) /** * Whether there is at least one product of the brand currently `IN_STOCK` in - * your product feed in at least one of the countries, all products are - * `OUT_OF_STOCK` in your product feed in all countries, or + * your product data source in at least one of the countries, all products are + * `OUT_OF_STOCK` in your product data source in all countries, or * `NOT_IN_INVENTORY`. * The field doesn't take the Best sellers report country filter into account. * @@ -804,8 +804,8 @@ public function clearBrandInventoryStatus() /** * Whether there is at least one product of the brand currently `IN_STOCK` in - * your product feed in at least one of the countries, all products are - * `OUT_OF_STOCK` in your product feed in all countries, or + * your product data source in at least one of the countries, all products are + * `OUT_OF_STOCK` in your product data source in all countries, or * `NOT_IN_INVENTORY`. * The field doesn't take the Best sellers report country filter into account. * diff --git a/ShoppingMerchantReports/src/V1beta/NonProductPerformanceView.php b/ShoppingMerchantReports/src/V1beta/NonProductPerformanceView.php index 1dfa95ca927a..262572a66387 100644 --- a/ShoppingMerchantReports/src/V1beta/NonProductPerformanceView.php +++ b/ShoppingMerchantReports/src/V1beta/NonProductPerformanceView.php @@ -10,8 +10,8 @@ /** * Fields available for query in `non_product_performance_view` table. - * Performance data on images and website links leading to your non-product - * website pages. This includes performance metrics (for example, `clicks`) + * Performance data on images and online store links leading to your non-product + * pages. This includes performance metrics (for example, `clicks`) * and dimensions according to which performance metrics are segmented (for * example, `date`). * Segment fields cannot be selected in queries without also selecting at least @@ -38,23 +38,23 @@ class NonProductPerformanceView extends \Google\Protobuf\Internal\Message */ protected $week = null; /** - * Number of clicks on images and website links leading to your non-product - * website pages. Metric. + * Number of clicks on images and online store links leading to your + * non-product pages. Metric. * * Generated from protobuf field optional int64 clicks = 3; */ protected $clicks = null; /** - * Number of times images and website links leading to your non-product - * website pages were shown. Metric. + * Number of times images and online store links leading to your non-product + * pages were shown. Metric. * * Generated from protobuf field optional int64 impressions = 4; */ protected $impressions = null; /** * Click-through rate - the number of clicks (`clicks`) divided by the number - * of impressions (`impressions`) of images and website links leading to your - * non-product website pages. Metric. + * of impressions (`impressions`) of images and online store links leading to + * your non-product pages. Metric. * * Generated from protobuf field optional double click_through_rate = 5; */ @@ -73,15 +73,15 @@ class NonProductPerformanceView extends \Google\Protobuf\Internal\Message * First day of the week (Monday) of the metrics date in the merchant * timezone. Segment. * @type int|string $clicks - * Number of clicks on images and website links leading to your non-product - * website pages. Metric. + * Number of clicks on images and online store links leading to your + * non-product pages. Metric. * @type int|string $impressions - * Number of times images and website links leading to your non-product - * website pages were shown. Metric. + * Number of times images and online store links leading to your non-product + * pages were shown. Metric. * @type float $click_through_rate * Click-through rate - the number of clicks (`clicks`) divided by the number - * of impressions (`impressions`) of images and website links leading to your - * non-product website pages. Metric. + * of impressions (`impressions`) of images and online store links leading to + * your non-product pages. Metric. * } */ public function __construct($data = NULL) { @@ -166,8 +166,8 @@ public function setWeek($var) } /** - * Number of clicks on images and website links leading to your non-product - * website pages. Metric. + * Number of clicks on images and online store links leading to your + * non-product pages. Metric. * * Generated from protobuf field optional int64 clicks = 3; * @return int|string @@ -188,8 +188,8 @@ public function clearClicks() } /** - * Number of clicks on images and website links leading to your non-product - * website pages. Metric. + * Number of clicks on images and online store links leading to your + * non-product pages. Metric. * * Generated from protobuf field optional int64 clicks = 3; * @param int|string $var @@ -204,8 +204,8 @@ public function setClicks($var) } /** - * Number of times images and website links leading to your non-product - * website pages were shown. Metric. + * Number of times images and online store links leading to your non-product + * pages were shown. Metric. * * Generated from protobuf field optional int64 impressions = 4; * @return int|string @@ -226,8 +226,8 @@ public function clearImpressions() } /** - * Number of times images and website links leading to your non-product - * website pages were shown. Metric. + * Number of times images and online store links leading to your non-product + * pages were shown. Metric. * * Generated from protobuf field optional int64 impressions = 4; * @param int|string $var @@ -243,8 +243,8 @@ public function setImpressions($var) /** * Click-through rate - the number of clicks (`clicks`) divided by the number - * of impressions (`impressions`) of images and website links leading to your - * non-product website pages. Metric. + * of impressions (`impressions`) of images and online store links leading to + * your non-product pages. Metric. * * Generated from protobuf field optional double click_through_rate = 5; * @return float @@ -266,8 +266,8 @@ public function clearClickThroughRate() /** * Click-through rate - the number of clicks (`clicks`) divided by the number - * of impressions (`impressions`) of images and website links leading to your - * non-product website pages. Metric. + * of impressions (`impressions`) of images and online store links leading to + * your non-product pages. Metric. * * Generated from protobuf field optional double click_through_rate = 5; * @param float $var diff --git a/ShoppingMerchantReports/src/V1beta/PriceInsightsProductView.php b/ShoppingMerchantReports/src/V1beta/PriceInsightsProductView.php index b53355a0c2aa..497d56770bab 100644 --- a/ShoppingMerchantReports/src/V1beta/PriceInsightsProductView.php +++ b/ShoppingMerchantReports/src/V1beta/PriceInsightsProductView.php @@ -152,6 +152,12 @@ class PriceInsightsProductView extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional double predicted_conversions_change_fraction = 19; */ protected $predicted_conversions_change_fraction = null; + /** + * The predicted effectiveness of applying the price suggestion, bucketed. + * + * Generated from protobuf field .google.shopping.merchant.reports.v1beta.PriceInsightsProductView.Effectiveness effectiveness = 22; + */ + protected $effectiveness = 0; /** * Constructor. @@ -216,6 +222,8 @@ class PriceInsightsProductView extends \Google\Protobuf\Internal\Message * Predicted change in conversions as a fraction after introducing the * suggested price compared to current active price. For example, 0.05 is a 5% * predicted increase in conversions). + * @type int $effectiveness + * The predicted effectiveness of applying the price suggestion, bucketed. * } */ public function __construct($data = NULL) { @@ -945,5 +953,31 @@ public function setPredictedConversionsChangeFraction($var) return $this; } + /** + * The predicted effectiveness of applying the price suggestion, bucketed. + * + * Generated from protobuf field .google.shopping.merchant.reports.v1beta.PriceInsightsProductView.Effectiveness effectiveness = 22; + * @return int + */ + public function getEffectiveness() + { + return $this->effectiveness; + } + + /** + * The predicted effectiveness of applying the price suggestion, bucketed. + * + * Generated from protobuf field .google.shopping.merchant.reports.v1beta.PriceInsightsProductView.Effectiveness effectiveness = 22; + * @param int $var + * @return $this + */ + public function setEffectiveness($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Reports\V1beta\PriceInsightsProductView\Effectiveness::class); + $this->effectiveness = $var; + + return $this; + } + } diff --git a/ShoppingMerchantReports/src/V1beta/PriceInsightsProductView/Effectiveness.php b/ShoppingMerchantReports/src/V1beta/PriceInsightsProductView/Effectiveness.php new file mode 100644 index 000000000000..8df736edbef7 --- /dev/null +++ b/ShoppingMerchantReports/src/V1beta/PriceInsightsProductView/Effectiveness.php @@ -0,0 +1,74 @@ +google.shopping.merchant.reports.v1beta.PriceInsightsProductView.Effectiveness + */ +class Effectiveness +{ + /** + * Effectiveness is unknown. + * + * Generated from protobuf enum EFFECTIVENESS_UNSPECIFIED = 0; + */ + const EFFECTIVENESS_UNSPECIFIED = 0; + /** + * Effectiveness is low. + * + * Generated from protobuf enum LOW = 1; + */ + const LOW = 1; + /** + * Effectiveness is medium. + * + * Generated from protobuf enum MEDIUM = 2; + */ + const MEDIUM = 2; + /** + * Effectiveness is high. + * + * Generated from protobuf enum HIGH = 3; + */ + const HIGH = 3; + + private static $valueToName = [ + self::EFFECTIVENESS_UNSPECIFIED => 'EFFECTIVENESS_UNSPECIFIED', + self::LOW => 'LOW', + self::MEDIUM => 'MEDIUM', + self::HIGH => 'HIGH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ShoppingMerchantReports/src/V1beta/ProductView.php b/ShoppingMerchantReports/src/V1beta/ProductView.php index 40c7606b8e2d..34a8c027f4d7 100644 --- a/ShoppingMerchantReports/src/V1beta/ProductView.php +++ b/ShoppingMerchantReports/src/V1beta/ProductView.php @@ -162,7 +162,7 @@ class ProductView extends \Google\Protobuf\Internal\Message /** * Normalized [shipping * label](https://support.google.com/merchants/answer/6324504) specified in - * the feed. + * the data source. * * Generated from protobuf field optional string shipping_label = 20; */ @@ -295,7 +295,7 @@ class ProductView extends \Google\Protobuf\Internal\Message * @type string $shipping_label * Normalized [shipping * label](https://support.google.com/merchants/answer/6324504) specified in - * the feed. + * the data source. * @type array|\Google\Protobuf\Internal\RepeatedField $gtin * List of Global Trade Item Numbers (GTINs) of the product. * @type string $item_group_id @@ -1084,7 +1084,7 @@ public function setAvailability($var) /** * Normalized [shipping * label](https://support.google.com/merchants/answer/6324504) specified in - * the feed. + * the data source. * * Generated from protobuf field optional string shipping_label = 20; * @return string @@ -1107,7 +1107,7 @@ public function clearShippingLabel() /** * Normalized [shipping * label](https://support.google.com/merchants/answer/6324504) specified in - * the feed. + * the data source. * * Generated from protobuf field optional string shipping_label = 20; * @param string $var diff --git a/ShoppingMerchantReports/src/V1beta/ProductView/AggregatedReportingContextStatus.php b/ShoppingMerchantReports/src/V1beta/ProductView/AggregatedReportingContextStatus.php index 9e6a103dccbc..575646bd3caf 100644 --- a/ShoppingMerchantReports/src/V1beta/ProductView/AggregatedReportingContextStatus.php +++ b/ShoppingMerchantReports/src/V1beta/ProductView/AggregatedReportingContextStatus.php @@ -9,7 +9,7 @@ /** * Status of the product aggregated for all reporting contexts. * Here's an example of how the aggregated status is computed: - * Free listings | Shopping Ads | Status + * Free listings | Shopping ads | Status * --------------|--------------|------------------------------ * Approved | Approved | ELIGIBLE * Approved | Pending | ELIGIBLE diff --git a/ShoppingMerchantReports/src/V1beta/ReportRow.php b/ShoppingMerchantReports/src/V1beta/ReportRow.php index c85412be9fe9..79de75b02264 100644 --- a/ShoppingMerchantReports/src/V1beta/ReportRow.php +++ b/ShoppingMerchantReports/src/V1beta/ReportRow.php @@ -24,6 +24,12 @@ class ReportRow extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.shopping.merchant.reports.v1beta.ProductPerformanceView product_performance_view = 1; */ protected $product_performance_view = null; + /** + * Fields available for query in `non_product_performance_view` table. + * + * Generated from protobuf field .google.shopping.merchant.reports.v1beta.NonProductPerformanceView non_product_performance_view = 7; + */ + protected $non_product_performance_view = null; /** * Fields available for query in `product_view` table. * @@ -84,6 +90,8 @@ class ReportRow extends \Google\Protobuf\Internal\Message * * @type \Google\Shopping\Merchant\Reports\V1beta\ProductPerformanceView $product_performance_view * Fields available for query in `product_performance_view` table. + * @type \Google\Shopping\Merchant\Reports\V1beta\NonProductPerformanceView $non_product_performance_view + * Fields available for query in `non_product_performance_view` table. * @type \Google\Shopping\Merchant\Reports\V1beta\ProductView $product_view * Fields available for query in `product_view` table. * @type \Google\Shopping\Merchant\Reports\V1beta\PriceCompetitivenessProductView $price_competitiveness_product_view @@ -146,6 +154,42 @@ public function setProductPerformanceView($var) return $this; } + /** + * Fields available for query in `non_product_performance_view` table. + * + * Generated from protobuf field .google.shopping.merchant.reports.v1beta.NonProductPerformanceView non_product_performance_view = 7; + * @return \Google\Shopping\Merchant\Reports\V1beta\NonProductPerformanceView|null + */ + public function getNonProductPerformanceView() + { + return $this->non_product_performance_view; + } + + public function hasNonProductPerformanceView() + { + return isset($this->non_product_performance_view); + } + + public function clearNonProductPerformanceView() + { + unset($this->non_product_performance_view); + } + + /** + * Fields available for query in `non_product_performance_view` table. + * + * Generated from protobuf field .google.shopping.merchant.reports.v1beta.NonProductPerformanceView non_product_performance_view = 7; + * @param \Google\Shopping\Merchant\Reports\V1beta\NonProductPerformanceView $var + * @return $this + */ + public function setNonProductPerformanceView($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Reports\V1beta\NonProductPerformanceView::class); + $this->non_product_performance_view = $var; + + return $this; + } + /** * Fields available for query in `product_view` table. * diff --git a/Spanner/.repo-metadata.json b/Spanner/.repo-metadata.json deleted file mode 100644 index 73a45e4f9560..000000000000 --- a/Spanner/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-spanner", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-spanner/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "spanner" -} diff --git a/Spanner/VERSION b/Spanner/VERSION index 32a6ce3c719b..b3a8c61e6a86 100644 --- a/Spanner/VERSION +++ b/Spanner/VERSION @@ -1 +1 @@ -1.76.0 +1.79.0 diff --git a/Spanner/composer.json b/Spanner/composer.json index 379d4e2d1492..6bd4c5577770 100644 --- a/Spanner/composer.json +++ b/Spanner/composer.json @@ -7,7 +7,7 @@ "php": "^8.0", "ext-grpc": "*", "google/cloud-core": "^1.52.7", - "google/gax": "^1.32" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Spanner/metadata/Admin/Database/V1/Backup.php b/Spanner/metadata/Admin/Database/V1/Backup.php index 925eac7804bb777289e9fdfa00defeb3edbfbe07..b610f628c7710a42b0e686c9a703228810f5ff09 100644 GIT binary patch delta 153 zcmeyNepz!v6f^TuC9cVaEJ~B>nIE#uV&`I;{FTFg^J12{jEbRLVySt_MU@35nfZC~ znR#jXMY)L}wgj&Nvj(@3!Q?t_rOi5Q>o{5FGjqvI?&px1{EL5`sE`8}Z+32Re0FMO id|qO1YOw^f0`uf*f&EOYnJ3!_p1`RhAPSQ)1R|4v1K|Y21_}m~ObI`;qXeA+vzG>%2?X5&3LKM; f5FC?H5U!I!5t0Py0ty%TS%G=;XOR*~ E0Nm0M$^ZZW delta 26 icmZ1(`#fgDZ5GB&oA0m`@H2g8n(QZXX>*dOyCeXlq6+2! diff --git a/Spanner/metadata/V1/Spanner.php b/Spanner/metadata/V1/Spanner.php index 84e977db75db8bfbc409ed4e8d15b1c0709ed7a7..c5904d92a6e986818242f4f20afd005295b8d52f 100644 GIT binary patch delta 289 zcmeB(+#0>Xf|Y4Sz-BAfMq#FJtef{roMIFavgP8)FG@)*ichMP5Kv&$;4@O2{E=UH z@+}o^Wj%k8j8ml(^8-glA$u;)oc!eM_>9cF5(z=D(inA^+Il@7pqvL#3anTugo_=j zSxACQ#6QTzH7MRGGCtHVIKb7})6LV>MSuZCCLqYu*D)wE-rF@&fKf=4OAxNd&p#f_ z7GMIJ$^o-RNRms`$KTmI-ow)`BtFy{#b6OG0fbzzhhq@XIz}OJE@6bIYlO2;Xs~CP Ms{qsHb}2?70J~yO(f|Me delta 28 kcmdlQ-4VILf|coy?`A93Mq#E?%$xU0oMPO(MVe6v0HHVvX8-^I diff --git a/Spanner/src/Admin/Database/V1/Backup.php b/Spanner/src/Admin/Database/V1/Backup.php index e204aa6759d0..d1826bc0e8a5 100644 --- a/Spanner/src/Admin/Database/V1/Backup.php +++ b/Spanner/src/Admin/Database/V1/Backup.php @@ -16,10 +16,10 @@ class Backup extends \Google\Protobuf\Internal\Message { /** - * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. - * Name of the database from which this backup was - * created. This needs to be in the same instance as the backup. - * Values are of the form + * Required for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. Name of the database from which this backup was created. This + * needs to be in the same instance as the backup. Values are of the form * `projects//instances//databases/`. * * Generated from protobuf field string database = 2 [(.google.api.resource_reference) = { @@ -35,7 +35,8 @@ class Backup extends \Google\Protobuf\Internal\Message */ private $version_time = null; /** - * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * Required for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] * operation. The expiration time of the backup, with microseconds * granularity that must be at least 6 hours and at most 366 days * from the time the CreateBackup request is processed. Once the `expire_time` @@ -46,8 +47,11 @@ class Backup extends \Google\Protobuf\Internal\Message */ private $expire_time = null; /** - * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. - * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation. + * Output only for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. Required for the + * [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] + * operation. * A globally unique identifier for the backup which cannot be * changed. Values are of the form * `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` @@ -62,7 +66,8 @@ class Backup extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * Output only. The time the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] * request is received. If the request does not specify `version_time`, the * `version_time` of the backup will be equivalent to the `create_time`. * @@ -99,6 +104,17 @@ class Backup extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.admin.database.v1.EncryptionInfo encryption_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $encryption_info = null; + /** + * Output only. The encryption information for the backup, whether it is + * protected by one or more KMS keys. The information includes all Cloud + * KMS key versions used to encrypt the backup. The `encryption_status' field + * inside of each `EncryptionInfo` is not populated. At least one of the key + * versions must be available for the backup to be restored. If a key version + * is revoked in the middle of a restore, the restore behavior is undefined. + * + * Generated from protobuf field repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_information = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $encryption_information; /** * Output only. The database dialect information for the backup. * @@ -135,10 +151,10 @@ class Backup extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $database - * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. - * Name of the database from which this backup was - * created. This needs to be in the same instance as the backup. - * Values are of the form + * Required for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. Name of the database from which this backup was created. This + * needs to be in the same instance as the backup. Values are of the form * `projects//instances//databases/`. * @type \Google\Protobuf\Timestamp $version_time * The backup will contain an externally consistent copy of the database at @@ -146,15 +162,19 @@ class Backup extends \Google\Protobuf\Internal\Message * specified, the system will set `version_time` to the `create_time` of the * backup. * @type \Google\Protobuf\Timestamp $expire_time - * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * Required for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] * operation. The expiration time of the backup, with microseconds * granularity that must be at least 6 hours and at most 366 days * from the time the CreateBackup request is processed. Once the `expire_time` * has passed, the backup is eligible to be automatically deleted by Cloud * Spanner to free the resources used by the backup. * @type string $name - * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. - * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation. + * Output only for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. Required for the + * [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] + * operation. * A globally unique identifier for the backup which cannot be * changed. Values are of the form * `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` @@ -165,7 +185,8 @@ class Backup extends \Google\Protobuf\Internal\Message * by the prefix of the backup name of the form * `projects//instances/`. * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * Output only. The time the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] * request is received. If the request does not specify `version_time`, the * `version_time` of the backup will be equivalent to the `create_time`. * @type int|string $size_bytes @@ -182,6 +203,13 @@ class Backup extends \Google\Protobuf\Internal\Message * to the backup is removed. * @type \Google\Cloud\Spanner\Admin\Database\V1\EncryptionInfo $encryption_info * Output only. The encryption information for the backup. + * @type array<\Google\Cloud\Spanner\Admin\Database\V1\EncryptionInfo>|\Google\Protobuf\Internal\RepeatedField $encryption_information + * Output only. The encryption information for the backup, whether it is + * protected by one or more KMS keys. The information includes all Cloud + * KMS key versions used to encrypt the backup. The `encryption_status' field + * inside of each `EncryptionInfo` is not populated. At least one of the key + * versions must be available for the backup to be restored. If a key version + * is revoked in the middle of a restore, the restore behavior is undefined. * @type int $database_dialect * Output only. The database dialect information for the backup. * @type array|\Google\Protobuf\Internal\RepeatedField $referencing_backups @@ -206,10 +234,10 @@ public function __construct($data = NULL) { } /** - * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. - * Name of the database from which this backup was - * created. This needs to be in the same instance as the backup. - * Values are of the form + * Required for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. Name of the database from which this backup was created. This + * needs to be in the same instance as the backup. Values are of the form * `projects//instances//databases/`. * * Generated from protobuf field string database = 2 [(.google.api.resource_reference) = { @@ -221,10 +249,10 @@ public function getDatabase() } /** - * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. - * Name of the database from which this backup was - * created. This needs to be in the same instance as the backup. - * Values are of the form + * Required for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. Name of the database from which this backup was created. This + * needs to be in the same instance as the backup. Values are of the form * `projects//instances//databases/`. * * Generated from protobuf field string database = 2 [(.google.api.resource_reference) = { @@ -282,7 +310,8 @@ public function setVersionTime($var) } /** - * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * Required for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] * operation. The expiration time of the backup, with microseconds * granularity that must be at least 6 hours and at most 366 days * from the time the CreateBackup request is processed. Once the `expire_time` @@ -308,7 +337,8 @@ public function clearExpireTime() } /** - * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * Required for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] * operation. The expiration time of the backup, with microseconds * granularity that must be at least 6 hours and at most 366 days * from the time the CreateBackup request is processed. Once the `expire_time` @@ -328,8 +358,11 @@ public function setExpireTime($var) } /** - * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. - * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation. + * Output only for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. Required for the + * [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] + * operation. * A globally unique identifier for the backup which cannot be * changed. Values are of the form * `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` @@ -349,8 +382,11 @@ public function getName() } /** - * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. - * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation. + * Output only for the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. Required for the + * [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] + * operation. * A globally unique identifier for the backup which cannot be * changed. Values are of the form * `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` @@ -374,7 +410,8 @@ public function setName($var) } /** - * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * Output only. The time the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] * request is received. If the request does not specify `version_time`, the * `version_time` of the backup will be equivalent to the `create_time`. * @@ -397,7 +434,8 @@ public function clearCreateTime() } /** - * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * Output only. The time the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] * request is received. If the request does not specify `version_time`, the * `version_time` of the backup will be equivalent to the `create_time`. * @@ -539,6 +577,42 @@ public function setEncryptionInfo($var) return $this; } + /** + * Output only. The encryption information for the backup, whether it is + * protected by one or more KMS keys. The information includes all Cloud + * KMS key versions used to encrypt the backup. The `encryption_status' field + * inside of each `EncryptionInfo` is not populated. At least one of the key + * versions must be available for the backup to be restored. If a key version + * is revoked in the middle of a restore, the restore behavior is undefined. + * + * Generated from protobuf field repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_information = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEncryptionInformation() + { + return $this->encryption_information; + } + + /** + * Output only. The encryption information for the backup, whether it is + * protected by one or more KMS keys. The information includes all Cloud + * KMS key versions used to encrypt the backup. The `encryption_status' field + * inside of each `EncryptionInfo` is not populated. At least one of the key + * versions must be available for the backup to be restored. If a key version + * is revoked in the middle of a restore, the restore behavior is undefined. + * + * Generated from protobuf field repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_information = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Spanner\Admin\Database\V1\EncryptionInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEncryptionInformation($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\Admin\Database\V1\EncryptionInfo::class); + $this->encryption_information = $arr; + + return $this; + } + /** * Output only. The database dialect information for the backup. * diff --git a/Spanner/src/Admin/Database/V1/BackupInfo.php b/Spanner/src/Admin/Database/V1/BackupInfo.php index 23d659f3e921..daaf059905a8 100644 --- a/Spanner/src/Admin/Database/V1/BackupInfo.php +++ b/Spanner/src/Admin/Database/V1/BackupInfo.php @@ -24,16 +24,17 @@ class BackupInfo extends \Google\Protobuf\Internal\Message /** * The backup contains an externally consistent copy of `source_database` at * the timestamp specified by `version_time`. If the - * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify - * `version_time`, the `version_time` of the backup is equivalent to the - * `create_time`. + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * request did not specify `version_time`, the `version_time` of the backup is + * equivalent to the `create_time`. * * Generated from protobuf field .google.protobuf.Timestamp version_time = 4; */ private $version_time = null; /** - * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was - * received. + * The time the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * request was received. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; */ @@ -56,12 +57,13 @@ class BackupInfo extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $version_time * The backup contains an externally consistent copy of `source_database` at * the timestamp specified by `version_time`. If the - * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify - * `version_time`, the `version_time` of the backup is equivalent to the - * `create_time`. + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * request did not specify `version_time`, the `version_time` of the backup is + * equivalent to the `create_time`. * @type \Google\Protobuf\Timestamp $create_time - * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was - * received. + * The time the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * request was received. * @type string $source_database * Name of the database the backup was created from. * } @@ -100,9 +102,9 @@ public function setBackup($var) /** * The backup contains an externally consistent copy of `source_database` at * the timestamp specified by `version_time`. If the - * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify - * `version_time`, the `version_time` of the backup is equivalent to the - * `create_time`. + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * request did not specify `version_time`, the `version_time` of the backup is + * equivalent to the `create_time`. * * Generated from protobuf field .google.protobuf.Timestamp version_time = 4; * @return \Google\Protobuf\Timestamp|null @@ -125,9 +127,9 @@ public function clearVersionTime() /** * The backup contains an externally consistent copy of `source_database` at * the timestamp specified by `version_time`. If the - * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify - * `version_time`, the `version_time` of the backup is equivalent to the - * `create_time`. + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * request did not specify `version_time`, the `version_time` of the backup is + * equivalent to the `create_time`. * * Generated from protobuf field .google.protobuf.Timestamp version_time = 4; * @param \Google\Protobuf\Timestamp $var @@ -142,8 +144,9 @@ public function setVersionTime($var) } /** - * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was - * received. + * The time the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * request was received. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; * @return \Google\Protobuf\Timestamp|null @@ -164,8 +167,9 @@ public function clearCreateTime() } /** - * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was - * received. + * The time the + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * request was received. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; * @param \Google\Protobuf\Timestamp $var diff --git a/Spanner/src/Admin/Database/V1/Client/DatabaseAdminClient.php b/Spanner/src/Admin/Database/V1/Client/DatabaseAdminClient.php index 46665d9fa572..157c2df243ab 100644 --- a/Spanner/src/Admin/Database/V1/Client/DatabaseAdminClient.php +++ b/Spanner/src/Admin/Database/V1/Client/DatabaseAdminClient.php @@ -77,7 +77,7 @@ * The Cloud Spanner Database Admin API can be used to: * * create, drop, and list databases * * update the schema of pre-existing databases - * * create, delete and list backups for a database + * * create, delete, copy and list backups for a database * * restore a database from an existing backup * * This class provides the ability to make remote calls to the backing service through method @@ -403,9 +403,10 @@ public function __call($method, $args) * The [metadata][google.longrunning.Operation.metadata] field type is * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. * The [response][google.longrunning.Operation.response] field type is - * [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the - * copying and delete the backup. - * Concurrent CopyBackup requests can run on the same source backup. + * [Backup][google.spanner.admin.database.v1.Backup], if successful. + * Cancelling the returned operation will stop the copying and delete the + * destination backup. Concurrent CopyBackup requests can run on the same + * source backup. * * The async variant is {@see DatabaseAdminClient::copyBackupAsync()} . * @@ -437,12 +438,12 @@ public function copyBackup(CopyBackupRequest $request, array $callOptions = []): * `projects//instances//backups//operations/` * and can be used to track creation of the backup. The * [metadata][google.longrunning.Operation.metadata] field type is - * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the - * creation and delete the backup. - * There can be only one pending backup creation per database. Backup creation - * of different databases can run concurrently. + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * The [response][google.longrunning.Operation.response] field type is + * [Backup][google.spanner.admin.database.v1.Backup], if successful. + * Cancelling the returned operation will stop the creation and delete the + * backup. There can be only one pending backup creation per database. Backup + * creation of different databases can run concurrently. * * The async variant is {@see DatabaseAdminClient::createBackupAsync()} . * @@ -473,8 +474,8 @@ public function createBackup(CreateBackupRequest $request, array $callOptions = * have a name of the format `/operations/` and * can be used to track preparation of the database. The * [metadata][google.longrunning.Operation.metadata] field type is - * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The - * [response][google.longrunning.Operation.response] field type is + * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. + * The [response][google.longrunning.Operation.response] field type is * [Database][google.spanner.admin.database.v1.Database], if successful. * * The async variant is {@see DatabaseAdminClient::createDatabaseAsync()} . @@ -501,7 +502,8 @@ public function createDatabase(CreateDatabaseRequest $request, array $callOption } /** - * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * Deletes a pending or completed + * [Backup][google.spanner.admin.database.v1.Backup]. * * The async variant is {@see DatabaseAdminClient::deleteBackupAsync()} . * @@ -553,7 +555,8 @@ public function dropDatabase(DropDatabaseRequest $request, array $callOptions = } /** - * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * Gets metadata on a pending or completed + * [Backup][google.spanner.admin.database.v1.Backup]. * * The async variant is {@see DatabaseAdminClient::getBackupAsync()} . * @@ -923,7 +926,8 @@ public function testIamPermissions(TestIamPermissionsRequest $request, array $ca } /** - * Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * Updates a pending or completed + * [Backup][google.spanner.admin.database.v1.Backup]. * * The async variant is {@see DatabaseAdminClient::updateBackupAsync()} . * @@ -1016,7 +1020,8 @@ public function updateDatabase(UpdateDatabaseRequest $request, array $callOption * the format `/operations/` and can be used to * track execution of the schema change(s). The * [metadata][google.longrunning.Operation.metadata] field type is - * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response. + * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. + * The operation has no response. * * The async variant is {@see DatabaseAdminClient::updateDatabaseDdlAsync()} . * diff --git a/Spanner/src/Admin/Database/V1/CopyBackupEncryptionConfig.php b/Spanner/src/Admin/Database/V1/CopyBackupEncryptionConfig.php index 431872668f4e..d9ef7547bba8 100644 --- a/Spanner/src/Admin/Database/V1/CopyBackupEncryptionConfig.php +++ b/Spanner/src/Admin/Database/V1/CopyBackupEncryptionConfig.php @@ -24,13 +24,33 @@ class CopyBackupEncryptionConfig extends \Google\Protobuf\Internal\Message /** * Optional. The Cloud KMS key that will be used to protect the backup. * This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. * * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ private $kms_key_name = ''; + /** + * Optional. Specifies the KMS configuration for the one or more keys used to + * protect the backup. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * Kms keys specified can be in any order. + * The keys referenced by kms_key_names must fully cover all + * regions of the backup's instance configuration. Some examples: + * * For single region instance configs, specify a single regional + * location KMS key. + * * For multi-regional instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For an instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $kms_key_names; /** * Constructor. @@ -43,9 +63,25 @@ class CopyBackupEncryptionConfig extends \Google\Protobuf\Internal\Message * @type string $kms_key_name * Optional. The Cloud KMS key that will be used to protect the backup. * This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_names + * Optional. Specifies the KMS configuration for the one or more keys used to + * protect the backup. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. + * Kms keys specified can be in any order. + * The keys referenced by kms_key_names must fully cover all + * regions of the backup's instance configuration. Some examples: + * * For single region instance configs, specify a single regional + * location KMS key. + * * For multi-regional instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For an instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. * } */ public function __construct($data = NULL) { @@ -82,8 +118,8 @@ public function setEncryptionType($var) /** * Optional. The Cloud KMS key that will be used to protect the backup. * This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. * * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { @@ -97,8 +133,8 @@ public function getKmsKeyName() /** * Optional. The Cloud KMS key that will be used to protect the backup. * This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. * * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { @@ -113,5 +149,59 @@ public function setKmsKeyName($var) return $this; } + /** + * Optional. Specifies the KMS configuration for the one or more keys used to + * protect the backup. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * Kms keys specified can be in any order. + * The keys referenced by kms_key_names must fully cover all + * regions of the backup's instance configuration. Some examples: + * * For single region instance configs, specify a single regional + * location KMS key. + * * For multi-regional instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For an instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKmsKeyNames() + { + return $this->kms_key_names; + } + + /** + * Optional. Specifies the KMS configuration for the one or more keys used to + * protect the backup. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * Kms keys specified can be in any order. + * The keys referenced by kms_key_names must fully cover all + * regions of the backup's instance configuration. Some examples: + * * For single region instance configs, specify a single regional + * location KMS key. + * * For multi-regional instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For an instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKmsKeyNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->kms_key_names = $arr; + + return $this; + } + } diff --git a/Spanner/src/Admin/Database/V1/CopyBackupEncryptionConfig/EncryptionType.php b/Spanner/src/Admin/Database/V1/CopyBackupEncryptionConfig/EncryptionType.php index 51a6d9a07393..56fa3e3beb2b 100644 --- a/Spanner/src/Admin/Database/V1/CopyBackupEncryptionConfig/EncryptionType.php +++ b/Spanner/src/Admin/Database/V1/CopyBackupEncryptionConfig/EncryptionType.php @@ -20,10 +20,13 @@ class EncryptionType */ const ENCRYPTION_TYPE_UNSPECIFIED = 0; /** - * This is the default option for [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] - * when [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig] is not specified. - * For example, if the source backup is using `Customer_Managed_Encryption`, - * the backup will be using the same Cloud KMS key as the source backup. + * This is the default option for + * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] + * when + * [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig] + * is not specified. For example, if the source backup is using + * `Customer_Managed_Encryption`, the backup will be using the same Cloud + * KMS key as the source backup. * * Generated from protobuf enum USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; */ @@ -35,8 +38,8 @@ class EncryptionType */ const GOOGLE_DEFAULT_ENCRYPTION = 2; /** - * Use customer managed encryption. If specified, `kms_key_name` - * must contain a valid Cloud KMS key. + * Use customer managed encryption. If specified, either `kms_key_name` or + * `kms_key_names` must contain valid Cloud KMS key(s). * * Generated from protobuf enum CUSTOMER_MANAGED_ENCRYPTION = 3; */ diff --git a/Spanner/src/Admin/Database/V1/CopyBackupMetadata.php b/Spanner/src/Admin/Database/V1/CopyBackupMetadata.php index 3fcfac667492..b9b4ffaad91e 100644 --- a/Spanner/src/Admin/Database/V1/CopyBackupMetadata.php +++ b/Spanner/src/Admin/Database/V1/CopyBackupMetadata.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Metadata type for the google.longrunning.Operation returned by + * Metadata type for the operation returned by * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. * * Generated from protobuf message google.spanner.admin.database.v1.CopyBackupMetadata @@ -34,7 +34,8 @@ class CopyBackupMetadata extends \Google\Protobuf\Internal\Message private $source_backup = ''; /** * The progress of the - * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation. + * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] + * operation. * * Generated from protobuf field .google.spanner.admin.database.v1.OperationProgress progress = 3; */ @@ -73,7 +74,8 @@ class CopyBackupMetadata extends \Google\Protobuf\Internal\Message * `projects//instances//backups/`. * @type \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress $progress * The progress of the - * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation. + * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] + * operation. * @type \Google\Protobuf\Timestamp $cancel_time * The time at which cancellation of CopyBackup operation was received. * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] @@ -156,7 +158,8 @@ public function setSourceBackup($var) /** * The progress of the - * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation. + * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] + * operation. * * Generated from protobuf field .google.spanner.admin.database.v1.OperationProgress progress = 3; * @return \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress|null @@ -178,7 +181,8 @@ public function clearProgress() /** * The progress of the - * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation. + * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] + * operation. * * Generated from protobuf field .google.spanner.admin.database.v1.OperationProgress progress = 3; * @param \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress $var diff --git a/Spanner/src/Admin/Database/V1/CopyBackupRequest.php b/Spanner/src/Admin/Database/V1/CopyBackupRequest.php index afbab462f19a..5f378df44f18 100644 --- a/Spanner/src/Admin/Database/V1/CopyBackupRequest.php +++ b/Spanner/src/Admin/Database/V1/CopyBackupRequest.php @@ -9,15 +9,16 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. + * The request for + * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. * * Generated from protobuf message google.spanner.admin.database.v1.CopyBackupRequest */ class CopyBackupRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The name of the destination instance that will contain the backup copy. - * Values are of the form: `projects//instances/`. + * Required. The name of the destination instance that will contain the backup + * copy. Values are of the form: `projects//instances/`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -52,19 +53,19 @@ class CopyBackupRequest extends \Google\Protobuf\Internal\Message */ private $expire_time = null; /** - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the source backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the source backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * * Generated from protobuf field .google.spanner.admin.database.v1.CopyBackupEncryptionConfig encryption_config = 5 [(.google.api.field_behavior) = OPTIONAL]; */ private $encryption_config = null; /** - * @param string $parent Required. The name of the destination instance that will contain the backup copy. - * Values are of the form: `projects//instances/`. Please see + * @param string $parent Required. The name of the destination instance that will contain the backup + * copy. Values are of the form: `projects//instances/`. Please see * {@see DatabaseAdminClient::instanceName()} for help formatting this field. * @param string $backupId Required. The id of the backup copy. * The `backup_id` appended to `parent` forms the full backup_uri of the form @@ -102,8 +103,8 @@ public static function build(string $parent, string $backupId, string $sourceBac * Optional. Data for populating the Message object. * * @type string $parent - * Required. The name of the destination instance that will contain the backup copy. - * Values are of the form: `projects//instances/`. + * Required. The name of the destination instance that will contain the backup + * copy. Values are of the form: `projects//instances/`. * @type string $backup_id * Required. The id of the backup copy. * The `backup_id` appended to `parent` forms the full backup_uri of the form @@ -122,11 +123,11 @@ public static function build(string $parent, string $backupId, string $sourceBac * passed, the backup is eligible to be automatically deleted by Cloud Spanner * to free the resources used by the backup. * @type \Google\Cloud\Spanner\Admin\Database\V1\CopyBackupEncryptionConfig $encryption_config - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the source backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the source backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * } */ public function __construct($data = NULL) { @@ -135,8 +136,8 @@ public function __construct($data = NULL) { } /** - * Required. The name of the destination instance that will contain the backup copy. - * Values are of the form: `projects//instances/`. + * Required. The name of the destination instance that will contain the backup + * copy. Values are of the form: `projects//instances/`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -147,8 +148,8 @@ public function getParent() } /** - * Required. The name of the destination instance that will contain the backup copy. - * Values are of the form: `projects//instances/`. + * Required. The name of the destination instance that will contain the backup + * copy. Values are of the form: `projects//instances/`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -273,11 +274,11 @@ public function setExpireTime($var) } /** - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the source backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the source backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * * Generated from protobuf field .google.spanner.admin.database.v1.CopyBackupEncryptionConfig encryption_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Spanner\Admin\Database\V1\CopyBackupEncryptionConfig|null @@ -298,11 +299,11 @@ public function clearEncryptionConfig() } /** - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the source backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the source backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * * Generated from protobuf field .google.spanner.admin.database.v1.CopyBackupEncryptionConfig encryption_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Spanner\Admin\Database\V1\CopyBackupEncryptionConfig $var diff --git a/Spanner/src/Admin/Database/V1/CreateBackupEncryptionConfig.php b/Spanner/src/Admin/Database/V1/CreateBackupEncryptionConfig.php index 0d13ca063e94..856296def13e 100644 --- a/Spanner/src/Admin/Database/V1/CreateBackupEncryptionConfig.php +++ b/Spanner/src/Admin/Database/V1/CreateBackupEncryptionConfig.php @@ -24,13 +24,32 @@ class CreateBackupEncryptionConfig extends \Google\Protobuf\Internal\Message /** * Optional. The Cloud KMS key that will be used to protect the backup. * This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. * * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ private $kms_key_name = ''; + /** + * Optional. Specifies the KMS configuration for the one or more keys used to + * protect the backup. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the backup's instance configuration. Some examples: + * * For single region instance configs, specify a single regional + * location KMS key. + * * For multi-regional instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For an instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $kms_key_names; /** * Constructor. @@ -43,9 +62,24 @@ class CreateBackupEncryptionConfig extends \Google\Protobuf\Internal\Message * @type string $kms_key_name * Optional. The Cloud KMS key that will be used to protect the backup. * This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_names + * Optional. Specifies the KMS configuration for the one or more keys used to + * protect the backup. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the backup's instance configuration. Some examples: + * * For single region instance configs, specify a single regional + * location KMS key. + * * For multi-regional instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For an instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. * } */ public function __construct($data = NULL) { @@ -82,8 +116,8 @@ public function setEncryptionType($var) /** * Optional. The Cloud KMS key that will be used to protect the backup. * This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. * * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { @@ -97,8 +131,8 @@ public function getKmsKeyName() /** * Optional. The Cloud KMS key that will be used to protect the backup. * This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. * * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { @@ -113,5 +147,57 @@ public function setKmsKeyName($var) return $this; } + /** + * Optional. Specifies the KMS configuration for the one or more keys used to + * protect the backup. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the backup's instance configuration. Some examples: + * * For single region instance configs, specify a single regional + * location KMS key. + * * For multi-regional instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For an instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKmsKeyNames() + { + return $this->kms_key_names; + } + + /** + * Optional. Specifies the KMS configuration for the one or more keys used to + * protect the backup. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the backup's instance configuration. Some examples: + * * For single region instance configs, specify a single regional + * location KMS key. + * * For multi-regional instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For an instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKmsKeyNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->kms_key_names = $arr; + + return $this; + } + } diff --git a/Spanner/src/Admin/Database/V1/CreateBackupEncryptionConfig/EncryptionType.php b/Spanner/src/Admin/Database/V1/CreateBackupEncryptionConfig/EncryptionType.php index 028d9da2fb85..be6e5fb5ea47 100644 --- a/Spanner/src/Admin/Database/V1/CreateBackupEncryptionConfig/EncryptionType.php +++ b/Spanner/src/Admin/Database/V1/CreateBackupEncryptionConfig/EncryptionType.php @@ -22,9 +22,10 @@ class EncryptionType /** * Use the same encryption configuration as the database. This is the * default option when - * [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] is empty. - * For example, if the database is using `Customer_Managed_Encryption`, the - * backup will be using the same Cloud KMS key as the database. + * [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] + * is empty. For example, if the database is using + * `Customer_Managed_Encryption`, the backup will be using the same Cloud + * KMS key as the database. * * Generated from protobuf enum USE_DATABASE_ENCRYPTION = 1; */ diff --git a/Spanner/src/Admin/Database/V1/CreateBackupMetadata.php b/Spanner/src/Admin/Database/V1/CreateBackupMetadata.php index eac5b5c71117..7239db16db11 100644 --- a/Spanner/src/Admin/Database/V1/CreateBackupMetadata.php +++ b/Spanner/src/Admin/Database/V1/CreateBackupMetadata.php @@ -30,7 +30,8 @@ class CreateBackupMetadata extends \Google\Protobuf\Internal\Message private $database = ''; /** * The progress of the - * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. * * Generated from protobuf field .google.spanner.admin.database.v1.OperationProgress progress = 3; */ @@ -65,7 +66,8 @@ class CreateBackupMetadata extends \Google\Protobuf\Internal\Message * The name of the database the backup is created from. * @type \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress $progress * The progress of the - * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. * @type \Google\Protobuf\Timestamp $cancel_time * The time at which cancellation of this operation was received. * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] @@ -140,7 +142,8 @@ public function setDatabase($var) /** * The progress of the - * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. * * Generated from protobuf field .google.spanner.admin.database.v1.OperationProgress progress = 3; * @return \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress|null @@ -162,7 +165,8 @@ public function clearProgress() /** * The progress of the - * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + * operation. * * Generated from protobuf field .google.spanner.admin.database.v1.OperationProgress progress = 3; * @param \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress $var diff --git a/Spanner/src/Admin/Database/V1/CreateBackupRequest.php b/Spanner/src/Admin/Database/V1/CreateBackupRequest.php index fdeba10b5902..552eaff66df3 100644 --- a/Spanner/src/Admin/Database/V1/CreateBackupRequest.php +++ b/Spanner/src/Admin/Database/V1/CreateBackupRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. + * The request for + * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. * * Generated from protobuf message google.spanner.admin.database.v1.CreateBackupRequest */ @@ -41,11 +42,11 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message */ private $backup = null; /** - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the database by default, namely - * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] = - * `USE_DATABASE_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the database by default, namely + * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + * = `USE_DATABASE_ENCRYPTION`. * * Generated from protobuf field .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -96,11 +97,11 @@ public static function build(string $parent, \Google\Cloud\Spanner\Admin\Databas * @type \Google\Cloud\Spanner\Admin\Database\V1\Backup $backup * Required. The backup to create. * @type \Google\Cloud\Spanner\Admin\Database\V1\CreateBackupEncryptionConfig $encryption_config - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the database by default, namely - * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] = - * `USE_DATABASE_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the database by default, namely + * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + * = `USE_DATABASE_ENCRYPTION`. * } */ public function __construct($data = NULL) { @@ -211,11 +212,11 @@ public function setBackup($var) } /** - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the database by default, namely - * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] = - * `USE_DATABASE_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the database by default, namely + * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + * = `USE_DATABASE_ENCRYPTION`. * * Generated from protobuf field .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Spanner\Admin\Database\V1\CreateBackupEncryptionConfig|null @@ -236,11 +237,11 @@ public function clearEncryptionConfig() } /** - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the database by default, namely - * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] = - * `USE_DATABASE_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the database by default, namely + * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + * = `USE_DATABASE_ENCRYPTION`. * * Generated from protobuf field .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Spanner\Admin\Database\V1\CreateBackupEncryptionConfig $var diff --git a/Spanner/src/Admin/Database/V1/CreateDatabaseRequest.php b/Spanner/src/Admin/Database/V1/CreateDatabaseRequest.php index 2d89bee7142b..3dbfcc5511cc 100644 --- a/Spanner/src/Admin/Database/V1/CreateDatabaseRequest.php +++ b/Spanner/src/Admin/Database/V1/CreateDatabaseRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. + * The request for + * [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. * * Generated from protobuf message google.spanner.admin.database.v1.CreateDatabaseRequest */ @@ -42,8 +43,8 @@ class CreateDatabaseRequest extends \Google\Protobuf\Internal\Message */ private $extra_statements; /** - * Optional. The encryption configuration for the database. If this field is not - * specified, Cloud Spanner will encrypt/decrypt all data at rest using + * Optional. The encryption configuration for the database. If this field is + * not specified, Cloud Spanner will encrypt/decrypt all data at rest using * Google default encryption. * * Generated from protobuf field .google.spanner.admin.database.v1.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -118,8 +119,8 @@ public static function build(string $parent, string $createStatement): self * statements execute atomically with the creation of the database: * if there is an error in any statement, the database is not created. * @type \Google\Cloud\Spanner\Admin\Database\V1\EncryptionConfig $encryption_config - * Optional. The encryption configuration for the database. If this field is not - * specified, Cloud Spanner will encrypt/decrypt all data at rest using + * Optional. The encryption configuration for the database. If this field is + * not specified, Cloud Spanner will encrypt/decrypt all data at rest using * Google default encryption. * @type int $database_dialect * Optional. The dialect of the Cloud Spanner Database. @@ -241,8 +242,8 @@ public function setExtraStatements($var) } /** - * Optional. The encryption configuration for the database. If this field is not - * specified, Cloud Spanner will encrypt/decrypt all data at rest using + * Optional. The encryption configuration for the database. If this field is + * not specified, Cloud Spanner will encrypt/decrypt all data at rest using * Google default encryption. * * Generated from protobuf field .google.spanner.admin.database.v1.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -264,8 +265,8 @@ public function clearEncryptionConfig() } /** - * Optional. The encryption configuration for the database. If this field is not - * specified, Cloud Spanner will encrypt/decrypt all data at rest using + * Optional. The encryption configuration for the database. If this field is + * not specified, Cloud Spanner will encrypt/decrypt all data at rest using * Google default encryption. * * Generated from protobuf field .google.spanner.admin.database.v1.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/Spanner/src/Admin/Database/V1/Database.php b/Spanner/src/Admin/Database/V1/Database.php index 60338534d345..a9b8a57a434e 100644 --- a/Spanner/src/Admin/Database/V1/Database.php +++ b/Spanner/src/Admin/Database/V1/Database.php @@ -56,7 +56,8 @@ class Database extends \Google\Protobuf\Internal\Message /** * Output only. For databases that are using customer managed encryption, this * field contains the encryption information for the database, such as - * encryption state and the Cloud KMS key versions that are in use. + * all Cloud KMS key versions that are in use. The `encryption_status' field + * inside of each `EncryptionInfo` is not populated. * For databases that are using Google default or other types of encryption, * this field is empty. * This field is propagated lazily from the backend. There might be a delay @@ -69,8 +70,8 @@ class Database extends \Google\Protobuf\Internal\Message * Output only. The period in which Cloud Spanner retains all versions of data * for the database. This is the same as the value of version_retention_period * database option set using - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour, - * if not set. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. + * Defaults to 1 hour, if not set. * * Generated from protobuf field string version_retention_period = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -103,7 +104,9 @@ class Database extends \Google\Protobuf\Internal\Message private $database_dialect = 0; /** * Whether drop protection is enabled for this database. Defaults to false, - * if not set. + * if not set. For more details, please see how to [prevent accidental + * database + * deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). * * Generated from protobuf field bool enable_drop_protection = 11; */ @@ -143,7 +146,8 @@ class Database extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\Spanner\Admin\Database\V1\EncryptionInfo>|\Google\Protobuf\Internal\RepeatedField $encryption_info * Output only. For databases that are using customer managed encryption, this * field contains the encryption information for the database, such as - * encryption state and the Cloud KMS key versions that are in use. + * all Cloud KMS key versions that are in use. The `encryption_status' field + * inside of each `EncryptionInfo` is not populated. * For databases that are using Google default or other types of encryption, * this field is empty. * This field is propagated lazily from the backend. There might be a delay @@ -152,8 +156,8 @@ class Database extends \Google\Protobuf\Internal\Message * Output only. The period in which Cloud Spanner retains all versions of data * for the database. This is the same as the value of version_retention_period * database option set using - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour, - * if not set. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. + * Defaults to 1 hour, if not set. * @type \Google\Protobuf\Timestamp $earliest_version_time * Output only. Earliest timestamp at which older versions of the data can be * read. This value is continuously updated by Cloud Spanner and becomes stale @@ -170,7 +174,9 @@ class Database extends \Google\Protobuf\Internal\Message * Output only. The dialect of the Cloud Spanner Database. * @type bool $enable_drop_protection * Whether drop protection is enabled for this database. Defaults to false, - * if not set. + * if not set. For more details, please see how to [prevent accidental + * database + * deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). * @type bool $reconciling * Output only. If true, the database is being updated. If false, there are no * ongoing update operations for the database. @@ -360,7 +366,8 @@ public function setEncryptionConfig($var) /** * Output only. For databases that are using customer managed encryption, this * field contains the encryption information for the database, such as - * encryption state and the Cloud KMS key versions that are in use. + * all Cloud KMS key versions that are in use. The `encryption_status' field + * inside of each `EncryptionInfo` is not populated. * For databases that are using Google default or other types of encryption, * this field is empty. * This field is propagated lazily from the backend. There might be a delay @@ -377,7 +384,8 @@ public function getEncryptionInfo() /** * Output only. For databases that are using customer managed encryption, this * field contains the encryption information for the database, such as - * encryption state and the Cloud KMS key versions that are in use. + * all Cloud KMS key versions that are in use. The `encryption_status' field + * inside of each `EncryptionInfo` is not populated. * For databases that are using Google default or other types of encryption, * this field is empty. * This field is propagated lazily from the backend. There might be a delay @@ -399,8 +407,8 @@ public function setEncryptionInfo($var) * Output only. The period in which Cloud Spanner retains all versions of data * for the database. This is the same as the value of version_retention_period * database option set using - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour, - * if not set. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. + * Defaults to 1 hour, if not set. * * Generated from protobuf field string version_retention_period = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -414,8 +422,8 @@ public function getVersionRetentionPeriod() * Output only. The period in which Cloud Spanner retains all versions of data * for the database. This is the same as the value of version_retention_period * database option set using - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour, - * if not set. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. + * Defaults to 1 hour, if not set. * * Generated from protobuf field string version_retention_period = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var @@ -535,7 +543,9 @@ public function setDatabaseDialect($var) /** * Whether drop protection is enabled for this database. Defaults to false, - * if not set. + * if not set. For more details, please see how to [prevent accidental + * database + * deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). * * Generated from protobuf field bool enable_drop_protection = 11; * @return bool @@ -547,7 +557,9 @@ public function getEnableDropProtection() /** * Whether drop protection is enabled for this database. Defaults to false, - * if not set. + * if not set. For more details, please see how to [prevent accidental + * database + * deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). * * Generated from protobuf field bool enable_drop_protection = 11; * @param bool $var diff --git a/Spanner/src/Admin/Database/V1/DatabaseDialect.php b/Spanner/src/Admin/Database/V1/DatabaseDialect.php index 244d47d5a2bd..ed173031894b 100644 --- a/Spanner/src/Admin/Database/V1/DatabaseDialect.php +++ b/Spanner/src/Admin/Database/V1/DatabaseDialect.php @@ -21,7 +21,7 @@ class DatabaseDialect */ const DATABASE_DIALECT_UNSPECIFIED = 0; /** - * Google standard SQL. + * GoogleSQL supported SQL. * * Generated from protobuf enum GOOGLE_STANDARD_SQL = 1; */ diff --git a/Spanner/src/Admin/Database/V1/DatabaseRole.php b/Spanner/src/Admin/Database/V1/DatabaseRole.php index d36675860ff6..f7e32c23f83a 100644 --- a/Spanner/src/Admin/Database/V1/DatabaseRole.php +++ b/Spanner/src/Admin/Database/V1/DatabaseRole.php @@ -17,10 +17,8 @@ class DatabaseRole extends \Google\Protobuf\Internal\Message { /** * Required. The name of the database role. Values are of the form - * `projects//instances//databases//databaseRoles/ - * {role}`, where `` is as specified in the `CREATE ROLE` - * DDL statement. This name can be passed to Get/Set IAMPolicy methods to - * identify the database role. + * `projects//instances//databases//databaseRoles/` + * where `` is as specified in the `CREATE ROLE` DDL statement. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -34,10 +32,8 @@ class DatabaseRole extends \Google\Protobuf\Internal\Message * * @type string $name * Required. The name of the database role. Values are of the form - * `projects//instances//databases//databaseRoles/ - * {role}`, where `` is as specified in the `CREATE ROLE` - * DDL statement. This name can be passed to Get/Set IAMPolicy methods to - * identify the database role. + * `projects//instances//databases//databaseRoles/` + * where `` is as specified in the `CREATE ROLE` DDL statement. * } */ public function __construct($data = NULL) { @@ -47,10 +43,8 @@ public function __construct($data = NULL) { /** * Required. The name of the database role. Values are of the form - * `projects//instances//databases//databaseRoles/ - * {role}`, where `` is as specified in the `CREATE ROLE` - * DDL statement. This name can be passed to Get/Set IAMPolicy methods to - * identify the database role. + * `projects//instances//databases//databaseRoles/` + * where `` is as specified in the `CREATE ROLE` DDL statement. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -62,10 +56,8 @@ public function getName() /** * Required. The name of the database role. Values are of the form - * `projects//instances//databases//databaseRoles/ - * {role}`, where `` is as specified in the `CREATE ROLE` - * DDL statement. This name can be passed to Get/Set IAMPolicy methods to - * identify the database role. + * `projects//instances//databases//databaseRoles/` + * where `` is as specified in the `CREATE ROLE` DDL statement. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/DeleteBackupRequest.php b/Spanner/src/Admin/Database/V1/DeleteBackupRequest.php index 781ef97957dc..f8ae101ba9d9 100644 --- a/Spanner/src/Admin/Database/V1/DeleteBackupRequest.php +++ b/Spanner/src/Admin/Database/V1/DeleteBackupRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup]. + * The request for + * [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup]. * * Generated from protobuf message google.spanner.admin.database.v1.DeleteBackupRequest */ diff --git a/Spanner/src/Admin/Database/V1/DropDatabaseRequest.php b/Spanner/src/Admin/Database/V1/DropDatabaseRequest.php index 4ae113b8a14f..993cbe1e73ee 100644 --- a/Spanner/src/Admin/Database/V1/DropDatabaseRequest.php +++ b/Spanner/src/Admin/Database/V1/DropDatabaseRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. + * The request for + * [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. * * Generated from protobuf message google.spanner.admin.database.v1.DropDatabaseRequest */ diff --git a/Spanner/src/Admin/Database/V1/EncryptionConfig.php b/Spanner/src/Admin/Database/V1/EncryptionConfig.php index 04e1610307ba..62529b83264e 100644 --- a/Spanner/src/Admin/Database/V1/EncryptionConfig.php +++ b/Spanner/src/Admin/Database/V1/EncryptionConfig.php @@ -23,6 +23,25 @@ class EncryptionConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field string kms_key_name = 2 [(.google.api.resource_reference) = { */ private $kms_key_name = ''; + /** + * Specifies the KMS configuration for the one or more keys used to encrypt + * the database. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the database instance configuration. Some examples: + * * For single region database instance configs, specify a single regional + * location KMS key. + * * For multi-regional database instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For a database instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.resource_reference) = { + */ + private $kms_key_names; /** * Constructor. @@ -34,6 +53,21 @@ class EncryptionConfig extends \Google\Protobuf\Internal\Message * The Cloud KMS key to be used for encrypting and decrypting * the database. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. + * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_names + * Specifies the KMS configuration for the one or more keys used to encrypt + * the database. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the database instance configuration. Some examples: + * * For single region database instance configs, specify a single regional + * location KMS key. + * * For multi-regional database instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For a database instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. * } */ public function __construct($data = NULL) { @@ -71,5 +105,57 @@ public function setKmsKeyName($var) return $this; } + /** + * Specifies the KMS configuration for the one or more keys used to encrypt + * the database. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the database instance configuration. Some examples: + * * For single region database instance configs, specify a single regional + * location KMS key. + * * For multi-regional database instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For a database instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKmsKeyNames() + { + return $this->kms_key_names; + } + + /** + * Specifies the KMS configuration for the one or more keys used to encrypt + * the database. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the database instance configuration. Some examples: + * * For single region database instance configs, specify a single regional + * location KMS key. + * * For multi-regional database instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For a database instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKmsKeyNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->kms_key_names = $arr; + + return $this; + } + } diff --git a/Spanner/src/Admin/Database/V1/EncryptionInfo.php b/Spanner/src/Admin/Database/V1/EncryptionInfo.php index 2580842d5957..38ae91890389 100644 --- a/Spanner/src/Admin/Database/V1/EncryptionInfo.php +++ b/Spanner/src/Admin/Database/V1/EncryptionInfo.php @@ -22,16 +22,16 @@ class EncryptionInfo extends \Google\Protobuf\Internal\Message */ private $encryption_type = 0; /** - * Output only. If present, the status of a recent encrypt/decrypt call on underlying data - * for this database or backup. Regardless of status, data is always encrypted - * at rest. + * Output only. If present, the status of a recent encrypt/decrypt call on + * underlying data for this database or backup. Regardless of status, data is + * always encrypted at rest. * * Generated from protobuf field .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $encryption_status = null; /** - * Output only. A Cloud KMS key version that is being used to protect the database or - * backup. + * Output only. A Cloud KMS key version that is being used to protect the + * database or backup. * * Generated from protobuf field string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ @@ -46,12 +46,12 @@ class EncryptionInfo extends \Google\Protobuf\Internal\Message * @type int $encryption_type * Output only. The type of encryption. * @type \Google\Rpc\Status $encryption_status - * Output only. If present, the status of a recent encrypt/decrypt call on underlying data - * for this database or backup. Regardless of status, data is always encrypted - * at rest. + * Output only. If present, the status of a recent encrypt/decrypt call on + * underlying data for this database or backup. Regardless of status, data is + * always encrypted at rest. * @type string $kms_key_version - * Output only. A Cloud KMS key version that is being used to protect the database or - * backup. + * Output only. A Cloud KMS key version that is being used to protect the + * database or backup. * } */ public function __construct($data = NULL) { @@ -86,9 +86,9 @@ public function setEncryptionType($var) } /** - * Output only. If present, the status of a recent encrypt/decrypt call on underlying data - * for this database or backup. Regardless of status, data is always encrypted - * at rest. + * Output only. If present, the status of a recent encrypt/decrypt call on + * underlying data for this database or backup. Regardless of status, data is + * always encrypted at rest. * * Generated from protobuf field .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Rpc\Status|null @@ -109,9 +109,9 @@ public function clearEncryptionStatus() } /** - * Output only. If present, the status of a recent encrypt/decrypt call on underlying data - * for this database or backup. Regardless of status, data is always encrypted - * at rest. + * Output only. If present, the status of a recent encrypt/decrypt call on + * underlying data for this database or backup. Regardless of status, data is + * always encrypted at rest. * * Generated from protobuf field .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Rpc\Status $var @@ -126,8 +126,8 @@ public function setEncryptionStatus($var) } /** - * Output only. A Cloud KMS key version that is being used to protect the database or - * backup. + * Output only. A Cloud KMS key version that is being used to protect the + * database or backup. * * Generated from protobuf field string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @return string @@ -138,8 +138,8 @@ public function getKmsKeyVersion() } /** - * Output only. A Cloud KMS key version that is being used to protect the database or - * backup. + * Output only. A Cloud KMS key version that is being used to protect the + * database or backup. * * Generated from protobuf field string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @param string $var diff --git a/Spanner/src/Admin/Database/V1/Gapic/DatabaseAdminGapicClient.php b/Spanner/src/Admin/Database/V1/Gapic/DatabaseAdminGapicClient.php index 416d4bfaf0bf..228f9323bbbc 100644 --- a/Spanner/src/Admin/Database/V1/Gapic/DatabaseAdminGapicClient.php +++ b/Spanner/src/Admin/Database/V1/Gapic/DatabaseAdminGapicClient.php @@ -87,7 +87,7 @@ * The Cloud Spanner Database Admin API can be used to: * * create, drop, and list databases * * update the schema of pre-existing databases - * * create, delete and list backups for a database + * * create, delete, copy and list backups for a database * * restore a database from an existing backup * * This class provides the ability to make remote calls to the backing service through method @@ -539,9 +539,10 @@ public function __construct(array $options = []) * The [metadata][google.longrunning.Operation.metadata] field type is * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. * The [response][google.longrunning.Operation.response] field type is - * [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the - * copying and delete the backup. - * Concurrent CopyBackup requests can run on the same source backup. + * [Backup][google.spanner.admin.database.v1.Backup], if successful. + * Cancelling the returned operation will stop the copying and delete the + * destination backup. Concurrent CopyBackup requests can run on the same + * source backup. * * Sample code: * ``` @@ -582,8 +583,8 @@ public function __construct(array $options = []) * } * ``` * - * @param string $parent Required. The name of the destination instance that will contain the backup copy. - * Values are of the form: `projects//instances/`. + * @param string $parent Required. The name of the destination instance that will contain the backup + * copy. Values are of the form: `projects//instances/`. * @param string $backupId Required. The id of the backup copy. * The `backup_id` appended to `parent` forms the full backup_uri of the form * `projects//instances//backups/`. @@ -602,11 +603,11 @@ public function __construct(array $options = []) * Optional. * * @type CopyBackupEncryptionConfig $encryptionConfig - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the source backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the source backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -656,12 +657,12 @@ public function copyBackup( * `projects//instances//backups//operations/` * and can be used to track creation of the backup. The * [metadata][google.longrunning.Operation.metadata] field type is - * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the - * creation and delete the backup. - * There can be only one pending backup creation per database. Backup creation - * of different databases can run concurrently. + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * The [response][google.longrunning.Operation.response] field type is + * [Backup][google.spanner.admin.database.v1.Backup], if successful. + * Cancelling the returned operation will stop the creation and delete the + * backup. There can be only one pending backup creation per database. Backup + * creation of different databases can run concurrently. * * Sample code: * ``` @@ -715,11 +716,11 @@ public function copyBackup( * Optional. * * @type CreateBackupEncryptionConfig $encryptionConfig - * Optional. The encryption configuration used to encrypt the backup. If this field is - * not specified, the backup will use the same - * encryption configuration as the database by default, namely - * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] = - * `USE_DATABASE_ENCRYPTION`. + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the database by default, namely + * [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + * = `USE_DATABASE_ENCRYPTION`. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -766,8 +767,8 @@ public function createBackup( * have a name of the format `/operations/` and * can be used to track preparation of the database. The * [metadata][google.longrunning.Operation.metadata] field type is - * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The - * [response][google.longrunning.Operation.response] field type is + * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. + * The [response][google.longrunning.Operation.response] field type is * [Database][google.spanner.admin.database.v1.Database], if successful. * * Sample code: @@ -823,8 +824,8 @@ public function createBackup( * statements execute atomically with the creation of the database: * if there is an error in any statement, the database is not created. * @type EncryptionConfig $encryptionConfig - * Optional. The encryption configuration for the database. If this field is not - * specified, Cloud Spanner will encrypt/decrypt all data at rest using + * Optional. The encryption configuration for the database. If this field is + * not specified, Cloud Spanner will encrypt/decrypt all data at rest using * Google default encryption. * @type int $databaseDialect * Optional. The dialect of the Cloud Spanner Database. @@ -896,7 +897,8 @@ public function createDatabase( } /** - * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * Deletes a pending or completed + * [Backup][google.spanner.admin.database.v1.Backup]. * * Sample code: * ``` @@ -994,7 +996,8 @@ public function dropDatabase($database, array $optionalArgs = []) } /** - * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * Gets metadata on a pending or completed + * [Backup][google.spanner.admin.database.v1.Backup]. * * Sample code: * ``` @@ -1262,7 +1265,9 @@ public function getIamPolicy($resource, array $optionalArgs = []) * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is + * for + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first if filtering on metadata @@ -1280,14 +1285,15 @@ public function getIamPolicy($resource, array $optionalArgs = []) * * `done:true` - The operation is complete. * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - * * The database the backup was taken from has a name containing the - * string "prod". + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The source database name of backup contains the string "prod". * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `(metadata.name:howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. * * The backup name contains the string "howl". * * The operation started before 2018-03-28T14:50:00Z. * * The operation resulted in an error. @@ -1295,9 +1301,9 @@ public function getIamPolicy($resource, array $optionalArgs = []) * `(metadata.source_backup:test) AND` \ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - * * The source backup of the copied backup name contains the string - * "test". + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + * * The source backup name contains the string "test". * * The operation started before 2022-01-18T14:50:00Z. * * The operation resulted in an error. * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ @@ -1307,12 +1313,13 @@ public function getIamPolicy($resource, array $optionalArgs = []) * `(metadata.source_backup:test_bkp)) AND` \ * `(error:*)` - Returns operations where: * * The operation's metadata matches either of criteria: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] AND the - * database the backup was taken from has name containing string + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * AND the source database name of the backup contains the string * "test_db" - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] AND the - * backup the backup was copied from has name containing string - * "test_bkp" + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] + * AND the source backup name contains the string "test_bkp" * * The operation resulted in an error. * @type int $pageSize * The maximum number of resources contained in the underlying API @@ -1407,7 +1414,9 @@ public function listBackupOperations($parent, array $optionalArgs = []) * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering: + * The following fields in the + * [Backup][google.spanner.admin.database.v1.Backup] are eligible for + * filtering: * * * `name` * * `database` @@ -1538,7 +1547,9 @@ public function listBackups($parent, array $optionalArgs = []) * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is + * for + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first, if filtering on metadata @@ -1560,7 +1571,8 @@ public function listBackups($parent, array $optionalArgs = []) * `(metadata.name:restored_howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: - * * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + * * The operation's metadata type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. * * The database is restored from a backup. * * The backup name contains "backup_howl". * * The restored database's name contains "restored_howl". @@ -1645,7 +1657,7 @@ public function listDatabaseOperations($parent, array $optionalArgs = []) * * @param string $parent Required. The database whose roles should be listed. * Values are of the form - * `projects//instances//databases//databaseRoles`. + * `projects//instances//databases/`. * @param array $optionalArgs { * Optional. * @@ -1846,12 +1858,12 @@ public function listDatabases($parent, array $optionalArgs = []) * Name of the backup from which to restore. Values are of the form * `projects//instances//backups/`. * @type RestoreDatabaseEncryptionConfig $encryptionConfig - * Optional. An encryption configuration describing the encryption type and key - * resources in Cloud KMS used to encrypt/decrypt the database to restore to. - * If this field is not specified, the restored database will use - * the same encryption configuration as the backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. An encryption configuration describing the encryption type and + * key resources in Cloud KMS used to encrypt/decrypt the database to restore + * to. If this field is not specified, the restored database will use the same + * encryption configuration as the backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -2033,7 +2045,8 @@ public function testIamPermissions( } /** - * Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * Updates a pending or completed + * [Backup][google.spanner.admin.database.v1.Backup]. * * Sample code: * ``` @@ -2214,7 +2227,8 @@ public function updateDatabase( * the format `/operations/` and can be used to * track execution of the schema change(s). The * [metadata][google.longrunning.Operation.metadata] field type is - * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response. + * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. + * The operation has no response. * * Sample code: * ``` @@ -2264,18 +2278,20 @@ public function updateDatabase( * * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * @type string $protoDescriptors * Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. * Contains a protobuf-serialized diff --git a/Spanner/src/Admin/Database/V1/GetBackupRequest.php b/Spanner/src/Admin/Database/V1/GetBackupRequest.php index 8d777673ba6e..8023dc513a4d 100644 --- a/Spanner/src/Admin/Database/V1/GetBackupRequest.php +++ b/Spanner/src/Admin/Database/V1/GetBackupRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup]. + * The request for + * [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup]. * * Generated from protobuf message google.spanner.admin.database.v1.GetBackupRequest */ diff --git a/Spanner/src/Admin/Database/V1/GetDatabaseDdlRequest.php b/Spanner/src/Admin/Database/V1/GetDatabaseDdlRequest.php index 9a1e4fc2a4d2..746e1e6d300f 100644 --- a/Spanner/src/Admin/Database/V1/GetDatabaseDdlRequest.php +++ b/Spanner/src/Admin/Database/V1/GetDatabaseDdlRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. + * The request for + * [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. * * Generated from protobuf message google.spanner.admin.database.v1.GetDatabaseDdlRequest */ diff --git a/Spanner/src/Admin/Database/V1/GetDatabaseDdlResponse.php b/Spanner/src/Admin/Database/V1/GetDatabaseDdlResponse.php index 6e51152a8b3d..fc346e69229d 100644 --- a/Spanner/src/Admin/Database/V1/GetDatabaseDdlResponse.php +++ b/Spanner/src/Admin/Database/V1/GetDatabaseDdlResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. + * The response for + * [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. * * Generated from protobuf message google.spanner.admin.database.v1.GetDatabaseDdlResponse */ diff --git a/Spanner/src/Admin/Database/V1/GetDatabaseRequest.php b/Spanner/src/Admin/Database/V1/GetDatabaseRequest.php index b7054b36a37b..dd3f68a8fa17 100644 --- a/Spanner/src/Admin/Database/V1/GetDatabaseRequest.php +++ b/Spanner/src/Admin/Database/V1/GetDatabaseRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. + * The request for + * [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. * * Generated from protobuf message google.spanner.admin.database.v1.GetDatabaseRequest */ diff --git a/Spanner/src/Admin/Database/V1/ListBackupOperationsRequest.php b/Spanner/src/Admin/Database/V1/ListBackupOperationsRequest.php index d0e40c4bb0ed..5c50db837408 100644 --- a/Spanner/src/Admin/Database/V1/ListBackupOperationsRequest.php +++ b/Spanner/src/Admin/Database/V1/ListBackupOperationsRequest.php @@ -35,7 +35,9 @@ class ListBackupOperationsRequest extends \Google\Protobuf\Internal\Message * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is + * for + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first if filtering on metadata @@ -50,14 +52,15 @@ class ListBackupOperationsRequest extends \Google\Protobuf\Internal\Message * * `done:true` - The operation is complete. * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - * * The database the backup was taken from has a name containing the - * string "prod". + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The source database name of backup contains the string "prod". * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `(metadata.name:howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. * * The backup name contains the string "howl". * * The operation started before 2018-03-28T14:50:00Z. * * The operation resulted in an error. @@ -65,9 +68,9 @@ class ListBackupOperationsRequest extends \Google\Protobuf\Internal\Message * `(metadata.source_backup:test) AND` \ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - * * The source backup of the copied backup name contains the string - * "test". + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + * * The source backup name contains the string "test". * * The operation started before 2022-01-18T14:50:00Z. * * The operation resulted in an error. * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ @@ -77,12 +80,13 @@ class ListBackupOperationsRequest extends \Google\Protobuf\Internal\Message * `(metadata.source_backup:test_bkp)) AND` \ * `(error:*)` - Returns operations where: * * The operation's metadata matches either of criteria: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] AND the - * database the backup was taken from has name containing string + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * AND the source database name of the backup contains the string * "test_db" - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] AND the - * backup the backup was copied from has name containing string - * "test_bkp" + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] + * AND the source backup name contains the string "test_bkp" * * The operation resulted in an error. * * Generated from protobuf field string filter = 2; @@ -98,8 +102,9 @@ class ListBackupOperationsRequest extends \Google\Protobuf\Internal\Message /** * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] - * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the - * same `parent` and with the same `filter`. + * from a previous + * [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] + * to the same `parent` and with the same `filter`. * * Generated from protobuf field string page_token = 4; */ @@ -141,7 +146,9 @@ public static function build(string $parent): self * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is + * for + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first if filtering on metadata @@ -156,14 +163,15 @@ public static function build(string $parent): self * * `done:true` - The operation is complete. * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - * * The database the backup was taken from has a name containing the - * string "prod". + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The source database name of backup contains the string "prod". * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `(metadata.name:howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. * * The backup name contains the string "howl". * * The operation started before 2018-03-28T14:50:00Z. * * The operation resulted in an error. @@ -171,9 +179,9 @@ public static function build(string $parent): self * `(metadata.source_backup:test) AND` \ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - * * The source backup of the copied backup name contains the string - * "test". + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + * * The source backup name contains the string "test". * * The operation started before 2022-01-18T14:50:00Z. * * The operation resulted in an error. * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ @@ -183,12 +191,13 @@ public static function build(string $parent): self * `(metadata.source_backup:test_bkp)) AND` \ * `(error:*)` - Returns operations where: * * The operation's metadata matches either of criteria: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] AND the - * database the backup was taken from has name containing string + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * AND the source database name of the backup contains the string * "test_db" - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] AND the - * backup the backup was copied from has name containing string - * "test_bkp" + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] + * AND the source backup name contains the string "test_bkp" * * The operation resulted in an error. * @type int $page_size * Number of operations to be returned in the response. If 0 or @@ -196,8 +205,9 @@ public static function build(string $parent): self * @type string $page_token * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] - * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the - * same `parent` and with the same `filter`. + * from a previous + * [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] + * to the same `parent` and with the same `filter`. * } */ public function __construct($data = NULL) { @@ -245,7 +255,9 @@ public function setParent($var) * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is + * for + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first if filtering on metadata @@ -260,14 +272,15 @@ public function setParent($var) * * `done:true` - The operation is complete. * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - * * The database the backup was taken from has a name containing the - * string "prod". + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The source database name of backup contains the string "prod". * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `(metadata.name:howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. * * The backup name contains the string "howl". * * The operation started before 2018-03-28T14:50:00Z. * * The operation resulted in an error. @@ -275,9 +288,9 @@ public function setParent($var) * `(metadata.source_backup:test) AND` \ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - * * The source backup of the copied backup name contains the string - * "test". + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + * * The source backup name contains the string "test". * * The operation started before 2022-01-18T14:50:00Z. * * The operation resulted in an error. * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ @@ -287,12 +300,13 @@ public function setParent($var) * `(metadata.source_backup:test_bkp)) AND` \ * `(error:*)` - Returns operations where: * * The operation's metadata matches either of criteria: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] AND the - * database the backup was taken from has name containing string + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * AND the source database name of the backup contains the string * "test_db" - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] AND the - * backup the backup was copied from has name containing string - * "test_bkp" + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] + * AND the source backup name contains the string "test_bkp" * * The operation resulted in an error. * * Generated from protobuf field string filter = 2; @@ -315,7 +329,9 @@ public function getFilter() * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is + * for + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first if filtering on metadata @@ -330,14 +346,15 @@ public function getFilter() * * `done:true` - The operation is complete. * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - * * The database the backup was taken from has a name containing the - * string "prod". + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The source database name of backup contains the string "prod". * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `(metadata.name:howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. * * The backup name contains the string "howl". * * The operation started before 2018-03-28T14:50:00Z. * * The operation resulted in an error. @@ -345,9 +362,9 @@ public function getFilter() * `(metadata.source_backup:test) AND` \ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - * * The source backup of the copied backup name contains the string - * "test". + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + * * The source backup name contains the string "test". * * The operation started before 2022-01-18T14:50:00Z. * * The operation resulted in an error. * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ @@ -357,12 +374,13 @@ public function getFilter() * `(metadata.source_backup:test_bkp)) AND` \ * `(error:*)` - Returns operations where: * * The operation's metadata matches either of criteria: - * * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] AND the - * database the backup was taken from has name containing string + * * The operation's metadata type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + * AND the source database name of the backup contains the string * "test_db" - * * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] AND the - * backup the backup was copied from has name containing string - * "test_bkp" + * * The operation's metadata type is + * [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] + * AND the source backup name contains the string "test_bkp" * * The operation resulted in an error. * * Generated from protobuf field string filter = 2; @@ -408,8 +426,9 @@ public function setPageSize($var) /** * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] - * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the - * same `parent` and with the same `filter`. + * from a previous + * [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] + * to the same `parent` and with the same `filter`. * * Generated from protobuf field string page_token = 4; * @return string @@ -422,8 +441,9 @@ public function getPageToken() /** * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] - * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the - * same `parent` and with the same `filter`. + * from a previous + * [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] + * to the same `parent` and with the same `filter`. * * Generated from protobuf field string page_token = 4; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/ListBackupsRequest.php b/Spanner/src/Admin/Database/V1/ListBackupsRequest.php index bb093fded002..b4238eb7f032 100644 --- a/Spanner/src/Admin/Database/V1/ListBackupsRequest.php +++ b/Spanner/src/Admin/Database/V1/ListBackupsRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. + * The request for + * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. * * Generated from protobuf message google.spanner.admin.database.v1.ListBackupsRequest */ @@ -29,7 +30,9 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * The value must be a string, a number, or a boolean. The comparison operator * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. - * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering: + * The following fields in the + * [Backup][google.spanner.admin.database.v1.Backup] are eligible for + * filtering: * * `name` * * `database` * * `state` @@ -65,9 +68,10 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message private $page_size = 0; /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a - * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same - * `filter`. + * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] + * from a previous + * [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] + * to the same `parent` and with the same `filter`. * * Generated from protobuf field string page_token = 4; */ @@ -104,7 +108,9 @@ public static function build(string $parent): self * The value must be a string, a number, or a boolean. The comparison operator * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. - * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering: + * The following fields in the + * [Backup][google.spanner.admin.database.v1.Backup] are eligible for + * filtering: * * `name` * * `database` * * `state` @@ -132,9 +138,10 @@ public static function build(string $parent): self * less, defaults to the server's maximum allowed page size. * @type string $page_token * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a - * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same - * `filter`. + * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] + * from a previous + * [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] + * to the same `parent` and with the same `filter`. * } */ public function __construct($data = NULL) { @@ -177,7 +184,9 @@ public function setParent($var) * The value must be a string, a number, or a boolean. The comparison operator * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. - * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering: + * The following fields in the + * [Backup][google.spanner.admin.database.v1.Backup] are eligible for + * filtering: * * `name` * * `database` * * `state` @@ -216,7 +225,9 @@ public function getFilter() * The value must be a string, a number, or a boolean. The comparison operator * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. - * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering: + * The following fields in the + * [Backup][google.spanner.admin.database.v1.Backup] are eligible for + * filtering: * * `name` * * `database` * * `state` @@ -282,9 +293,10 @@ public function setPageSize($var) /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a - * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same - * `filter`. + * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] + * from a previous + * [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] + * to the same `parent` and with the same `filter`. * * Generated from protobuf field string page_token = 4; * @return string @@ -296,9 +308,10 @@ public function getPageToken() /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a - * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same - * `filter`. + * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] + * from a previous + * [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] + * to the same `parent` and with the same `filter`. * * Generated from protobuf field string page_token = 4; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/ListBackupsResponse.php b/Spanner/src/Admin/Database/V1/ListBackupsResponse.php index e307154d409e..2e99679b56a5 100644 --- a/Spanner/src/Admin/Database/V1/ListBackupsResponse.php +++ b/Spanner/src/Admin/Database/V1/ListBackupsResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. + * The response for + * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. * * Generated from protobuf message google.spanner.admin.database.v1.ListBackupsResponse */ @@ -24,8 +25,8 @@ class ListBackupsResponse extends \Google\Protobuf\Internal\Message private $backups; /** * `next_page_token` can be sent in a subsequent - * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more - * of the matching backups. + * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] + * call to fetch more of the matching backups. * * Generated from protobuf field string next_page_token = 2; */ @@ -42,8 +43,8 @@ class ListBackupsResponse extends \Google\Protobuf\Internal\Message * in descending order, starting from the most recent `create_time`. * @type string $next_page_token * `next_page_token` can be sent in a subsequent - * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more - * of the matching backups. + * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] + * call to fetch more of the matching backups. * } */ public function __construct($data = NULL) { @@ -81,8 +82,8 @@ public function setBackups($var) /** * `next_page_token` can be sent in a subsequent - * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more - * of the matching backups. + * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] + * call to fetch more of the matching backups. * * Generated from protobuf field string next_page_token = 2; * @return string @@ -94,8 +95,8 @@ public function getNextPageToken() /** * `next_page_token` can be sent in a subsequent - * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more - * of the matching backups. + * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] + * call to fetch more of the matching backups. * * Generated from protobuf field string next_page_token = 2; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/ListDatabaseOperationsRequest.php b/Spanner/src/Admin/Database/V1/ListDatabaseOperationsRequest.php index 41a82625cfe5..5061df0e46b2 100644 --- a/Spanner/src/Admin/Database/V1/ListDatabaseOperationsRequest.php +++ b/Spanner/src/Admin/Database/V1/ListDatabaseOperationsRequest.php @@ -35,7 +35,9 @@ class ListDatabaseOperationsRequest extends \Google\Protobuf\Internal\Message * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is + * for + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first, if filtering on metadata @@ -54,7 +56,8 @@ class ListDatabaseOperationsRequest extends \Google\Protobuf\Internal\Message * `(metadata.name:restored_howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: - * * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + * * The operation's metadata type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. * * The database is restored from a backup. * * The backup name contains "backup_howl". * * The restored database's name contains "restored_howl". @@ -74,8 +77,9 @@ class ListDatabaseOperationsRequest extends \Google\Protobuf\Internal\Message /** * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] - * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the - * same `parent` and with the same `filter`. + * from a previous + * [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] + * to the same `parent` and with the same `filter`. * * Generated from protobuf field string page_token = 4; */ @@ -117,7 +121,9 @@ public static function build(string $parent): self * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is + * for + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first, if filtering on metadata @@ -136,7 +142,8 @@ public static function build(string $parent): self * `(metadata.name:restored_howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: - * * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + * * The operation's metadata type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. * * The database is restored from a backup. * * The backup name contains "backup_howl". * * The restored database's name contains "restored_howl". @@ -148,8 +155,9 @@ public static function build(string $parent): self * @type string $page_token * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] - * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the - * same `parent` and with the same `filter`. + * from a previous + * [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] + * to the same `parent` and with the same `filter`. * } */ public function __construct($data = NULL) { @@ -197,7 +205,9 @@ public function setParent($var) * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is + * for + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first, if filtering on metadata @@ -216,7 +226,8 @@ public function setParent($var) * `(metadata.name:restored_howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: - * * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + * * The operation's metadata type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. * * The database is restored from a backup. * * The backup name contains "backup_howl". * * The restored database's name contains "restored_howl". @@ -243,7 +254,9 @@ public function getFilter() * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is + * for + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] + * is * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first, if filtering on metadata @@ -262,7 +275,8 @@ public function getFilter() * `(metadata.name:restored_howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: - * * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + * * The operation's metadata type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. * * The database is restored from a backup. * * The backup name contains "backup_howl". * * The restored database's name contains "restored_howl". @@ -312,8 +326,9 @@ public function setPageSize($var) /** * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] - * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the - * same `parent` and with the same `filter`. + * from a previous + * [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] + * to the same `parent` and with the same `filter`. * * Generated from protobuf field string page_token = 4; * @return string @@ -326,8 +341,9 @@ public function getPageToken() /** * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] - * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the - * same `parent` and with the same `filter`. + * from a previous + * [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] + * to the same `parent` and with the same `filter`. * * Generated from protobuf field string page_token = 4; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/ListDatabaseRolesRequest.php b/Spanner/src/Admin/Database/V1/ListDatabaseRolesRequest.php index d638734389c3..d83ec6bf40c0 100644 --- a/Spanner/src/Admin/Database/V1/ListDatabaseRolesRequest.php +++ b/Spanner/src/Admin/Database/V1/ListDatabaseRolesRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. + * The request for + * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. * * Generated from protobuf message google.spanner.admin.database.v1.ListDatabaseRolesRequest */ @@ -18,7 +19,7 @@ class ListDatabaseRolesRequest extends \Google\Protobuf\Internal\Message /** * Required. The database whose roles should be listed. * Values are of the form - * `projects//instances//databases//databaseRoles`. + * `projects//instances//databases/`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -32,8 +33,9 @@ class ListDatabaseRolesRequest extends \Google\Protobuf\Internal\Message private $page_size = 0; /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a - * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] + * from a previous + * [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. * * Generated from protobuf field string page_token = 3; */ @@ -42,7 +44,7 @@ class ListDatabaseRolesRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The database whose roles should be listed. * Values are of the form - * `projects//instances//databases//databaseRoles`. Please see + * `projects//instances//databases/`. Please see * {@see DatabaseAdminClient::databaseName()} for help formatting this field. * * @return \Google\Cloud\Spanner\Admin\Database\V1\ListDatabaseRolesRequest @@ -64,14 +66,15 @@ public static function build(string $parent): self * @type string $parent * Required. The database whose roles should be listed. * Values are of the form - * `projects//instances//databases//databaseRoles`. + * `projects//instances//databases/`. * @type int $page_size * Number of database roles to be returned in the response. If 0 or less, * defaults to the server's maximum allowed page size. * @type string $page_token * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a - * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] + * from a previous + * [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. * } */ public function __construct($data = NULL) { @@ -82,7 +85,7 @@ public function __construct($data = NULL) { /** * Required. The database whose roles should be listed. * Values are of the form - * `projects//instances//databases//databaseRoles`. + * `projects//instances//databases/`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -95,7 +98,7 @@ public function getParent() /** * Required. The database whose roles should be listed. * Values are of the form - * `projects//instances//databases//databaseRoles`. + * `projects//instances//databases/`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -139,8 +142,9 @@ public function setPageSize($var) /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a - * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] + * from a previous + * [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. * * Generated from protobuf field string page_token = 3; * @return string @@ -152,8 +156,9 @@ public function getPageToken() /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a - * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] + * from a previous + * [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. * * Generated from protobuf field string page_token = 3; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/ListDatabaseRolesResponse.php b/Spanner/src/Admin/Database/V1/ListDatabaseRolesResponse.php index 15927aee8752..fc36896517be 100644 --- a/Spanner/src/Admin/Database/V1/ListDatabaseRolesResponse.php +++ b/Spanner/src/Admin/Database/V1/ListDatabaseRolesResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. + * The response for + * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. * * Generated from protobuf message google.spanner.admin.database.v1.ListDatabaseRolesResponse */ diff --git a/Spanner/src/Admin/Database/V1/ListDatabasesRequest.php b/Spanner/src/Admin/Database/V1/ListDatabasesRequest.php index 7b3f77bb02e1..919d73db0cbd 100644 --- a/Spanner/src/Admin/Database/V1/ListDatabasesRequest.php +++ b/Spanner/src/Admin/Database/V1/ListDatabasesRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. + * The request for + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. * * Generated from protobuf message google.spanner.admin.database.v1.ListDatabasesRequest */ @@ -31,8 +32,9 @@ class ListDatabasesRequest extends \Google\Protobuf\Internal\Message private $page_size = 0; /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a - * previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + * from a previous + * [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. * * Generated from protobuf field string page_token = 4; */ @@ -67,8 +69,9 @@ public static function build(string $parent): self * defaults to the server's maximum allowed page size. * @type string $page_token * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a - * previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + * from a previous + * [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. * } */ public function __construct($data = NULL) { @@ -134,8 +137,9 @@ public function setPageSize($var) /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a - * previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + * from a previous + * [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. * * Generated from protobuf field string page_token = 4; * @return string @@ -147,8 +151,9 @@ public function getPageToken() /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a - * previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + * from a previous + * [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. * * Generated from protobuf field string page_token = 4; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/ListDatabasesResponse.php b/Spanner/src/Admin/Database/V1/ListDatabasesResponse.php index d4074a818114..c167bf56afd0 100644 --- a/Spanner/src/Admin/Database/V1/ListDatabasesResponse.php +++ b/Spanner/src/Admin/Database/V1/ListDatabasesResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. + * The response for + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. * * Generated from protobuf message google.spanner.admin.database.v1.ListDatabasesResponse */ @@ -23,8 +24,8 @@ class ListDatabasesResponse extends \Google\Protobuf\Internal\Message private $databases; /** * `next_page_token` can be sent in a subsequent - * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more - * of the matching databases. + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + * call to fetch more of the matching databases. * * Generated from protobuf field string next_page_token = 2; */ @@ -40,8 +41,8 @@ class ListDatabasesResponse extends \Google\Protobuf\Internal\Message * Databases that matched the request. * @type string $next_page_token * `next_page_token` can be sent in a subsequent - * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more - * of the matching databases. + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + * call to fetch more of the matching databases. * } */ public function __construct($data = NULL) { @@ -77,8 +78,8 @@ public function setDatabases($var) /** * `next_page_token` can be sent in a subsequent - * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more - * of the matching databases. + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + * call to fetch more of the matching databases. * * Generated from protobuf field string next_page_token = 2; * @return string @@ -90,8 +91,8 @@ public function getNextPageToken() /** * `next_page_token` can be sent in a subsequent - * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more - * of the matching databases. + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + * call to fetch more of the matching databases. * * Generated from protobuf field string next_page_token = 2; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/RestoreDatabaseEncryptionConfig.php b/Spanner/src/Admin/Database/V1/RestoreDatabaseEncryptionConfig.php index f2e875409c96..54f3e913a322 100644 --- a/Spanner/src/Admin/Database/V1/RestoreDatabaseEncryptionConfig.php +++ b/Spanner/src/Admin/Database/V1/RestoreDatabaseEncryptionConfig.php @@ -22,15 +22,34 @@ class RestoreDatabaseEncryptionConfig extends \Google\Protobuf\Internal\Message */ private $encryption_type = 0; /** - * Optional. The Cloud KMS key that will be used to encrypt/decrypt the restored - * database. This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * Optional. The Cloud KMS key that will be used to encrypt/decrypt the + * restored database. This field should be set only when + * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. * * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ private $kms_key_name = ''; + /** + * Optional. Specifies the KMS configuration for the one or more keys used to + * encrypt the database. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the database instance configuration. Some examples: + * * For single region database instance configs, specify a single regional + * location KMS key. + * * For multi-regional database instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For a database instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $kms_key_names; /** * Constructor. @@ -41,11 +60,26 @@ class RestoreDatabaseEncryptionConfig extends \Google\Protobuf\Internal\Message * @type int $encryption_type * Required. The encryption type of the restored database. * @type string $kms_key_name - * Optional. The Cloud KMS key that will be used to encrypt/decrypt the restored - * database. This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * Optional. The Cloud KMS key that will be used to encrypt/decrypt the + * restored database. This field should be set only when + * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_names + * Optional. Specifies the KMS configuration for the one or more keys used to + * encrypt the database. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the database instance configuration. Some examples: + * * For single region database instance configs, specify a single regional + * location KMS key. + * * For multi-regional database instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For a database instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. * } */ public function __construct($data = NULL) { @@ -80,10 +114,10 @@ public function setEncryptionType($var) } /** - * Optional. The Cloud KMS key that will be used to encrypt/decrypt the restored - * database. This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * Optional. The Cloud KMS key that will be used to encrypt/decrypt the + * restored database. This field should be set only when + * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. * * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { @@ -95,10 +129,10 @@ public function getKmsKeyName() } /** - * Optional. The Cloud KMS key that will be used to encrypt/decrypt the restored - * database. This field should be set only when - * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] is - * `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + * Optional. The Cloud KMS key that will be used to encrypt/decrypt the + * restored database. This field should be set only when + * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + * is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form * `projects//locations//keyRings//cryptoKeys/`. * * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { @@ -113,5 +147,57 @@ public function setKmsKeyName($var) return $this; } + /** + * Optional. Specifies the KMS configuration for the one or more keys used to + * encrypt the database. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the database instance configuration. Some examples: + * * For single region database instance configs, specify a single regional + * location KMS key. + * * For multi-regional database instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For a database instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKmsKeyNames() + { + return $this->kms_key_names; + } + + /** + * Optional. Specifies the KMS configuration for the one or more keys used to + * encrypt the database. Values are of the form + * `projects//locations//keyRings//cryptoKeys/`. + * The keys referenced by kms_key_names must fully cover all + * regions of the database instance configuration. Some examples: + * * For single region database instance configs, specify a single regional + * location KMS key. + * * For multi-regional database instance configs of type GOOGLE_MANAGED, + * either specify a multi-regional location KMS key or multiple regional + * location KMS keys that cover all regions in the instance config. + * * For a database instance config of type USER_MANAGED, please specify only + * regional location KMS keys to cover each region in the instance config. + * Multi-regional location KMS keys are not supported for USER_MANAGED + * instance configs. + * + * Generated from protobuf field repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKmsKeyNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->kms_key_names = $arr; + + return $this; + } + } diff --git a/Spanner/src/Admin/Database/V1/RestoreDatabaseEncryptionConfig/EncryptionType.php b/Spanner/src/Admin/Database/V1/RestoreDatabaseEncryptionConfig/EncryptionType.php index 042b60fb0a34..6650757c3714 100644 --- a/Spanner/src/Admin/Database/V1/RestoreDatabaseEncryptionConfig/EncryptionType.php +++ b/Spanner/src/Admin/Database/V1/RestoreDatabaseEncryptionConfig/EncryptionType.php @@ -21,7 +21,8 @@ class EncryptionType const ENCRYPTION_TYPE_UNSPECIFIED = 0; /** * This is the default option when - * [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig] is not specified. + * [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig] + * is not specified. * * Generated from protobuf enum USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; */ diff --git a/Spanner/src/Admin/Database/V1/RestoreDatabaseMetadata.php b/Spanner/src/Admin/Database/V1/RestoreDatabaseMetadata.php index 6d2aadbbc6df..8dc01de6749f 100644 --- a/Spanner/src/Admin/Database/V1/RestoreDatabaseMetadata.php +++ b/Spanner/src/Admin/Database/V1/RestoreDatabaseMetadata.php @@ -47,7 +47,8 @@ class RestoreDatabaseMetadata extends \Google\Protobuf\Internal\Message * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with * an [Operation.error][google.longrunning.Operation.error] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. * * Generated from protobuf field .google.protobuf.Timestamp cancel_time = 5; */ @@ -60,10 +61,10 @@ class RestoreDatabaseMetadata extends \Google\Protobuf\Internal\Message * `projects//instances//databases//operations/` * where the is the name of database being created and restored to. * The metadata type of the long-running operation is - * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be - * automatically created by the system after the RestoreDatabase long-running - * operation completes successfully. This operation will not be created if the - * restore was not successful. + * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. + * This long-running operation will be automatically created by the system + * after the RestoreDatabase long-running operation completes successfully. + * This operation will not be created if the restore was not successful. * * Generated from protobuf field string optimize_database_operation_name = 6; */ @@ -97,7 +98,8 @@ class RestoreDatabaseMetadata extends \Google\Protobuf\Internal\Message * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with * an [Operation.error][google.longrunning.Operation.error] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. * @type string $optimize_database_operation_name * If exists, the name of the long-running operation that will be used to * track the post-restore optimization process to optimize the performance of @@ -106,10 +108,10 @@ class RestoreDatabaseMetadata extends \Google\Protobuf\Internal\Message * `projects//instances//databases//operations/` * where the is the name of database being created and restored to. * The metadata type of the long-running operation is - * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be - * automatically created by the system after the RestoreDatabase long-running - * operation completes successfully. This operation will not be created if the - * restore was not successful. + * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. + * This long-running operation will be automatically created by the system + * after the RestoreDatabase long-running operation completes successfully. + * This operation will not be created if the restore was not successful. * } */ public function __construct($data = NULL) { @@ -251,7 +253,8 @@ public function setProgress($var) * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with * an [Operation.error][google.longrunning.Operation.error] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. * * Generated from protobuf field .google.protobuf.Timestamp cancel_time = 5; * @return \Google\Protobuf\Timestamp|null @@ -282,7 +285,8 @@ public function clearCancelTime() * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with * an [Operation.error][google.longrunning.Operation.error] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. * * Generated from protobuf field .google.protobuf.Timestamp cancel_time = 5; * @param \Google\Protobuf\Timestamp $var @@ -304,10 +308,10 @@ public function setCancelTime($var) * `projects//instances//databases//operations/` * where the is the name of database being created and restored to. * The metadata type of the long-running operation is - * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be - * automatically created by the system after the RestoreDatabase long-running - * operation completes successfully. This operation will not be created if the - * restore was not successful. + * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. + * This long-running operation will be automatically created by the system + * after the RestoreDatabase long-running operation completes successfully. + * This operation will not be created if the restore was not successful. * * Generated from protobuf field string optimize_database_operation_name = 6; * @return string @@ -325,10 +329,10 @@ public function getOptimizeDatabaseOperationName() * `projects//instances//databases//operations/` * where the is the name of database being created and restored to. * The metadata type of the long-running operation is - * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be - * automatically created by the system after the RestoreDatabase long-running - * operation completes successfully. This operation will not be created if the - * restore was not successful. + * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. + * This long-running operation will be automatically created by the system + * after the RestoreDatabase long-running operation completes successfully. + * This operation will not be created if the restore was not successful. * * Generated from protobuf field string optimize_database_operation_name = 6; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/RestoreDatabaseRequest.php b/Spanner/src/Admin/Database/V1/RestoreDatabaseRequest.php index 34a9d1e30c2d..e9f2ef8b7d8c 100644 --- a/Spanner/src/Admin/Database/V1/RestoreDatabaseRequest.php +++ b/Spanner/src/Admin/Database/V1/RestoreDatabaseRequest.php @@ -36,12 +36,12 @@ class RestoreDatabaseRequest extends \Google\Protobuf\Internal\Message */ private $database_id = ''; /** - * Optional. An encryption configuration describing the encryption type and key - * resources in Cloud KMS used to encrypt/decrypt the database to restore to. - * If this field is not specified, the restored database will use - * the same encryption configuration as the backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. An encryption configuration describing the encryption type and + * key resources in Cloud KMS used to encrypt/decrypt the database to restore + * to. If this field is not specified, the restored database will use the same + * encryption configuration as the backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * * Generated from protobuf field .google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -95,12 +95,12 @@ public static function build(string $parent, string $databaseId, string $backup) * Name of the backup from which to restore. Values are of the form * `projects//instances//backups/`. * @type \Google\Cloud\Spanner\Admin\Database\V1\RestoreDatabaseEncryptionConfig $encryption_config - * Optional. An encryption configuration describing the encryption type and key - * resources in Cloud KMS used to encrypt/decrypt the database to restore to. - * If this field is not specified, the restored database will use - * the same encryption configuration as the backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. An encryption configuration describing the encryption type and + * key resources in Cloud KMS used to encrypt/decrypt the database to restore + * to. If this field is not specified, the restored database will use the same + * encryption configuration as the backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * } */ public function __construct($data = NULL) { @@ -208,12 +208,12 @@ public function setBackup($var) } /** - * Optional. An encryption configuration describing the encryption type and key - * resources in Cloud KMS used to encrypt/decrypt the database to restore to. - * If this field is not specified, the restored database will use - * the same encryption configuration as the backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. An encryption configuration describing the encryption type and + * key resources in Cloud KMS used to encrypt/decrypt the database to restore + * to. If this field is not specified, the restored database will use the same + * encryption configuration as the backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * * Generated from protobuf field .google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Spanner\Admin\Database\V1\RestoreDatabaseEncryptionConfig|null @@ -234,12 +234,12 @@ public function clearEncryptionConfig() } /** - * Optional. An encryption configuration describing the encryption type and key - * resources in Cloud KMS used to encrypt/decrypt the database to restore to. - * If this field is not specified, the restored database will use - * the same encryption configuration as the backup by default, namely - * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] = - * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * Optional. An encryption configuration describing the encryption type and + * key resources in Cloud KMS used to encrypt/decrypt the database to restore + * to. If this field is not specified, the restored database will use the same + * encryption configuration as the backup by default, namely + * [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * * Generated from protobuf field .google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Spanner\Admin\Database\V1\RestoreDatabaseEncryptionConfig $var diff --git a/Spanner/src/Admin/Database/V1/UpdateBackupRequest.php b/Spanner/src/Admin/Database/V1/UpdateBackupRequest.php index 0fa6d302efab..94db96b17083 100644 --- a/Spanner/src/Admin/Database/V1/UpdateBackupRequest.php +++ b/Spanner/src/Admin/Database/V1/UpdateBackupRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]. + * The request for + * [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]. * * Generated from protobuf message google.spanner.admin.database.v1.UpdateBackupRequest */ diff --git a/Spanner/src/Admin/Database/V1/UpdateDatabaseDdlRequest.php b/Spanner/src/Admin/Database/V1/UpdateDatabaseDdlRequest.php index fefb1928a3d6..9e9e7ff08124 100644 --- a/Spanner/src/Admin/Database/V1/UpdateDatabaseDdlRequest.php +++ b/Spanner/src/Admin/Database/V1/UpdateDatabaseDdlRequest.php @@ -22,8 +22,8 @@ * Each batch of statements is assigned a name which can be used with * the [Operations][google.longrunning.Operations] API to monitor * progress. See the - * [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more - * details. + * [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] + * field for more details. * * Generated from protobuf message google.spanner.admin.database.v1.UpdateDatabaseDdlRequest */ @@ -48,17 +48,19 @@ class UpdateDatabaseDdlRequest extends \Google\Protobuf\Internal\Message * [Operation][google.longrunning.Operation]. * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * * Generated from protobuf field string operation_id = 3; */ @@ -116,17 +118,19 @@ public static function build(string $database, array $statements): self * [Operation][google.longrunning.Operation]. * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * @type string $proto_descriptors * Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. * Contains a protobuf-serialized @@ -208,17 +212,19 @@ public function setStatements($var) * [Operation][google.longrunning.Operation]. * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * * Generated from protobuf field string operation_id = 3; * @return string @@ -235,17 +241,19 @@ public function getOperationId() * [Operation][google.longrunning.Operation]. * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * * Generated from protobuf field string operation_id = 3; * @param string $var diff --git a/Spanner/src/Connection/ConnectionInterface.php b/Spanner/src/Connection/ConnectionInterface.php index ebf70141b424..24f417672720 100644 --- a/Spanner/src/Connection/ConnectionInterface.php +++ b/Spanner/src/Connection/ConnectionInterface.php @@ -283,4 +283,9 @@ public function partitionQuery(array $args); * @param array $args */ public function partitionRead(array $args); + + /** + * @param array $args + */ + public function batchWrite(array $args); } diff --git a/Spanner/src/Connection/Grpc.php b/Spanner/src/Connection/Grpc.php index a3563b882e3a..8ebb494d299b 100644 --- a/Spanner/src/Connection/Grpc.php +++ b/Spanner/src/Connection/Grpc.php @@ -43,9 +43,11 @@ use Google\Cloud\Spanner\Admin\Instance\V1\InstanceConfig; use Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstanceConfigMetadata; use Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstanceMetadata; +use Google\Cloud\Spanner\MutationGroup; use Google\Cloud\Spanner\Operation; use Google\Cloud\Spanner\SpannerClient as ManualSpannerClient; use Google\Cloud\Spanner\RequestHeaderTrait; +use Google\Cloud\Spanner\V1\BatchWriteRequest\MutationGroup as BatchWriteRequestMutationGroup; use Google\Cloud\Spanner\V1\CreateSessionRequest; use Google\Cloud\Spanner\V1\DeleteSessionRequest; use Google\Cloud\Spanner\V1\DirectedReadOptions; @@ -243,15 +245,29 @@ public function __construct(array $config = []) PartialResultSet::class => function ($msg) { $data = json_decode($msg->serializeToJsonString(), true); - // The transaction id is serialized as a base64 encoded string in $data. So, we - // add a step to get the transaction id using a getter instead of the serialized value. - // The null-safe operator is used to handle edge cases where the relevant fields are not present. - $data['metadata']['transaction']['id'] = (string) $msg?->getMetadata()?->getTransaction()?->getId(); + // We only override metadata fields, if it actually exists in the response. + // This is specially important for large data sets which is received in chunks. + // Metadata is only received in the first 'chunk' and we don't want to set empty metadata fields + // when metadata was not returned from the server. + if (isset($data['metadata'])) { + // The transaction id is serialized as a base64 encoded string in $data. So, we + // add a step to get the transaction id using a getter instead of the serialized value. + // The null-safe operator is used to handle edge cases where the relevant fields are not present. + $data['metadata']['transaction']['id'] = (string) $msg?->getMetadata()?->getTransaction()?->getId(); + + // Helps convert metadata enum values from string types to their respective code/annotation + // pairs. Ex: INT64 is converted to {code: 2, typeAnnotation: 0}. + $fields = $msg->getMetadata()?->getRowType()?->getFields(); + $data['metadata']['rowType']['fields'] = $this->getFieldDataFromRepeatedFields($fields); + } - // Helps convert metadata enum values from string types to their respective code/annotation - // pairs. Ex: INT64 is converted to {code: 2, typeAnnotation: 0}. - $fields = $msg->getMetadata()?->getRowType()?->getFields(); - $data['metadata']['rowType']['fields'] = $this->getFieldDataFromRepeatedFields($fields); + // These fields in stats should be an int + if (isset($data['stats']['rowCountLowerBound'])) { + $data['stats']['rowCountLowerBound'] = (int) $data['stats']['rowCountLowerBound']; + } + if (isset($data['stats']['rowCountExact'])) { + $data['stats']['rowCountExact'] = (int) $data['stats']['rowCountExact']; + } return $data; } @@ -1110,47 +1126,7 @@ public function commit(array $args) { $inputMutations = $this->pluck('mutations', $args); - $mutations = []; - if (is_array($inputMutations)) { - foreach ($inputMutations as $mutation) { - $type = array_keys($mutation)[0]; - $data = $mutation[$type]; - - switch ($type) { - case Operation::OP_DELETE: - if (isset($data['keySet'])) { - $data['keySet'] = $this->formatKeySet($data['keySet']); - } - - $operation = $this->serializer->decodeMessage( - new Delete, - $data - ); - break; - default: - $operation = new Write; - $operation->setTable($data['table']); - $operation->setColumns($data['columns']); - - $modifiedData = []; - foreach ($data['values'] as $key => $param) { - $modifiedData[$key] = $this->fieldValue($param); - } - - $list = new ListValue; - $list->setValues($modifiedData); - $values = [$list]; - $operation->setValues($values); - - break; - } - - $setterName = $this->mutationSetters[$type]; - $mutation = new Mutation; - $mutation->$setterName($operation); - $mutations[] = $mutation; - } - } + $mutations = $this->parseMutations($inputMutations); if (isset($args['singleUseTransaction'])) { $readWrite = $this->serializer->decodeMessage( @@ -1180,6 +1156,40 @@ public function commit(array $args) ]); } + /** + * @param array $args + * @return \Generator + */ + public function batchWrite(array $args) + { + $databaseName = $this->pluck('database', $args); + $mutationGroups = $this->pluck('mutationGroups', $args); + $requestOptions = $this->pluck('requestOptions', $args, false) ?: []; + + array_walk( + $mutationGroups, + fn(&$x) => $x['mutations'] = $this->parseMutations($x['mutations']) + ); + + array_walk($mutationGroups, fn(&$x) => $x = $this->serializer->decodeMessage( + new BatchWriteRequestMutationGroup, + $x + )); + + if ($requestOptions) { + $args['requestOptions'] = $this->serializer->decodeMessage( + new RequestOptions, + $requestOptions + ); + } + + return $this->send([$this->spannerClient, 'batchWrite'], [ + $this->pluck('session', $args), + $mutationGroups, + $this->addResourcePrefixHeader($args, $databaseName) + ]); + } + /** * @param array $args */ @@ -1707,4 +1717,52 @@ private function getFieldDataFromRepeatedFields(?RepeatedField $fields): array return $fieldsData; } + + private function parseMutations($rawMutations) + { + if (!is_array($rawMutations)) { + return []; + } + + $mutations = []; + foreach ($rawMutations as $mutation) { + $type = array_keys($mutation)[0]; + $data = $mutation[$type]; + + switch ($type) { + case Operation::OP_DELETE: + if (isset($data['keySet'])) { + $data['keySet'] = $this->formatKeySet($data['keySet']); + } + + $operation = $this->serializer->decodeMessage( + new Delete, + $data + ); + break; + default: + $operation = new Write; + $operation->setTable($data['table']); + $operation->setColumns($data['columns']); + + $modifiedData = []; + foreach ($data['values'] as $key => $param) { + $modifiedData[$key] = $this->fieldValue($param); + } + + $list = new ListValue; + $list->setValues($modifiedData); + $values = [$list]; + $operation->setValues($values); + + break; + } + + $setterName = $this->mutationSetters[$type]; + $mutation = new Mutation; + $mutation->$setterName($operation); + $mutations[] = $mutation; + } + return $mutations; + } } diff --git a/Spanner/src/Database.php b/Spanner/src/Database.php index 57c035cfc9e3..6e188b915d0c 100644 --- a/Spanner/src/Database.php +++ b/Spanner/src/Database.php @@ -17,6 +17,7 @@ namespace Google\Cloud\Spanner; +use Google\ApiCore\ApiException; use Google\ApiCore\ValidationException; use Google\Cloud\Core\Exception\AbortedException; use Google\Cloud\Core\Exception\NotFoundException; @@ -36,6 +37,7 @@ use Google\Cloud\Spanner\Session\Session; use Google\Cloud\Spanner\Session\SessionPoolInterface; use Google\Cloud\Spanner\Transaction; +use Google\Cloud\Spanner\V1\BatchWriteResponse; use Google\Cloud\Spanner\V1\SpannerClient as GapicSpannerClient; use Google\Cloud\Spanner\V1\TypeCode; use Google\Rpc\Code; @@ -122,6 +124,7 @@ class Database const TYPE_PG_NUMERIC = 'pgNumeric'; const TYPE_PG_JSONB = 'pgJsonb'; const TYPE_JSON = TypeCode::JSON; + const TYPE_PG_OID = 'pgOid'; /** * @var ConnectionInterface @@ -184,6 +187,11 @@ class Database */ private $directedReadOptions; + /** + * @var bool + */ + private $returnInt64AsObject; + /** * Create an object representing a Database. * @@ -230,6 +238,7 @@ public function __construct( $this->setLroProperties($lroConnection, $lroCallables, $this->name); $this->databaseRole = $databaseRole; $this->directedReadOptions = $instance->directedReadOptions(); + $this->returnInt64AsObject = $returnInt64AsObject; } /** @@ -1686,6 +1695,89 @@ public function execute($sql, array $options = []) } } + /** + * Create a new {@see \Google\Cloud\Spanner\MutationGroup} object. + * + * @return MutationGroup + */ + public function mutationGroup() + { + return new MutationGroup($this->returnInt64AsObject); + } + + /** + * Batches the supplied mutation groups in a collection of efficient + * transactions. All mutations in a group are committed atomically. However, + * mutations across groups can be committed non-atomically in an unspecified + * order and thus, they must be independent of each other. Partial failure is + * possible, i.e., some groups may have been committed successfully, while + * some may have failed. The results of individual batches are streamed into + * the response as the batches are applied. + * + * BatchWrite requests are not replay protected, meaning that each mutation + * group may be applied more than once. Replays of non-idempotent mutations + * may have undesirable effects. For example, replays of an insert mutation + * may produce an already exists error or if you use generated or commit + * timestamp-based keys, it may result in additional rows being added to the + * mutation's table. We recommend structuring your mutation groups to be + * idempotent to avoid this issue. + * + * Sample code: + * ``` + * ``` + * + * @param array $mutationGroups Required. The groups of mutations to be applied. + * @param array $options { + * Optional. + * + * @type array $requestOptions + * Common options for this request. + * @type bool $excludeTxnFromChangeStreams + * Optional. When `exclude_txn_from_change_streams` is set to `true`: + * * Mutations from all transactions in this batch write operation will not + * be recorded in change streams with DDL option `allow_txn_exclusion=true` + * that are tracking columns modified by these transactions. + * * Mutations from all transactions in this batch write operation will be + * recorded in change streams with DDL option `allow_txn_exclusion=false or + * not set` that are tracking columns modified by these transactions. + * + * When `exclude_txn_from_change_streams` is set to `false` or not set, + * mutations from all transactions in this batch write operation will be + * recorded in all change streams that are tracking columns modified by these + * transactions. + * } + * + * @return \Google\ApiCore\ServerStream A stream of BatchWriteResponse + * {@see \Google\Cloud\Spanner\V1\BatchWriteResponse} + * + * @throws ApiException if the remote call fails + */ + public function batchWrite(array $mutationGroups, array $options = []) + { + if ($this->isRunningTransaction) { + throw new \BadMethodCallException('Nested transactions are not supported by this client.'); + } + // Prevent nested transactions. + $this->isRunningTransaction = true; + $session = $this->selectSession( + SessionPoolInterface::CONTEXT_READWRITE, + $this->pluck('sessionOptions', $options, false) ?: [] + ); + + array_walk($mutationGroups, fn (&$x) => $x = $x->toArray()); + + try { + return $this->connection->batchWrite([ + 'database' => $this->name(), + 'session' => $session->name(), + 'mutationGroups' => $mutationGroups + ] + $options); + } finally { + $this->isRunningTransaction = false; + $session->setExpiration(); + } + } + /** * Execute a partitioned DML update. * diff --git a/Spanner/src/MutationGroup.php b/Spanner/src/MutationGroup.php new file mode 100644 index 000000000000..e0a6e5d2bee6 --- /dev/null +++ b/Spanner/src/MutationGroup.php @@ -0,0 +1,43 @@ +mapper = new ValueMapper($returnInt64AsObject); + } + + public function toArray(): array + { + return ['mutations' => $this->mutationData]; + } +} diff --git a/Spanner/src/MutationTrait.php b/Spanner/src/MutationTrait.php new file mode 100644 index 000000000000..74725f93d926 --- /dev/null +++ b/Spanner/src/MutationTrait.php @@ -0,0 +1,342 @@ +insert('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ]); + * ``` + * + * @param string $table The table to insert into. + * @param array $data The data to insert. + * @return MutationGroup Current mutation group data object. + */ + public function insert($table, array $data) + { + return $this->insertBatch($table, [$data]); + } + + /** + * Add one or more insert mutations. + * + * Example: + * ``` + * $mutationGroup->insertBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ] + * ]); + * ``` + * + * @param string $table The table to insert into. + * @param array $dataSet The data to insert. + * @return $this Current object instance, to enable object chaining. + */ + public function insertBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_INSERT, $table, $dataSet); + + return $this; + } + + /** + * Add an update mutation. + * + * Example: + * ``` + * $mutationGroup->update('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post [Updated!]', + * 'content' => 'Modified Content' + * ]); + * ``` + * + * @param string $table The table to update. + * @param array $data The data to update. + * @return $this Current object instance, to enable object chaining. + */ + public function update($table, array $data) + { + return $this->updateBatch($table, [$data]); + } + + /** + * Add one or more update mutations. + * + * Example: + * ``` + * $mutationGroup->updateBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post [Updated!]', + * 'content' => 'Modified Content' + * ] + * ]); + * ``` + * + * @param string $table The table to update. + * @param array $dataSet The data to update. + * @return $this Current object instance, to enable object chaining. + */ + public function updateBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_UPDATE, $table, $dataSet); + + return $this; + } + + /** + * Add an insert or update mutation. + * + * Example: + * ``` + * $mutationGroup->insertOrUpdate('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ]); + * ``` + * + * @param string $table The table to insert into or update. + * @param array $data The data to insert or update. + * @return $this Current mutation group, to enable object chaining. + */ + public function insertOrUpdate($table, array $data) + { + return $this->insertOrUpdateBatch($table, [$data]); + } + + /** + * Add one or more insert or update mutations. + * + * Example: + * ``` + * $mutationGroup->insertOrUpdateBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post', + * 'content' => 'Hello World' + * ] + * ]); + * ``` + * + * @param string $table The table to insert into or update. + * @param array $dataSet The data to insert or update. + * @return $this Current object instance, to enable object chaining. + */ + public function insertOrUpdateBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_INSERT_OR_UPDATE, $table, $dataSet); + + return $this; + } + + /** + * Add an replace mutation. + * + * Example: + * ``` + * $mutationGroup->replace('Posts', [ + * 'ID' => 10, + * 'title' => 'My New Post [Replaced]', + * 'content' => 'Hello Moon' + * ]); + * ``` + * + * @param string $table The table to replace into. + * @param array $data The data to replace. + * @return $this Current object instance, to enable object chaining. + */ + public function replace($table, array $data) + { + return $this->replaceBatch($table, [$data]); + } + + /** + * Add one or more replace mutations. + * + * Example: + * ``` + * $mutationGroup->replaceBatch('Posts', [ + * [ + * 'ID' => 10, + * 'title' => 'My New Post [Replaced]', + * 'content' => 'Hello Moon' + * ] + * ]); + * ``` + * + * @param string $table The table to replace into. + * @param array $dataSet The data to replace. + * @return $this Current object instance, to enable object chaining. + */ + public function replaceBatch($table, array $dataSet) + { + $this->enqueue(Operation::OP_REPLACE, $table, $dataSet); + + return $this; + } + + /** + * Add an delete mutation. + * + * Example: + * ``` + * $keySet = new KeySet([ + * 'keys' => [10] + * ]); + * + * $mutationGroup->delete('Posts', $keySet); + * ``` + * + * @param string $table The table to mutate. + * @param KeySet $keySet The KeySet to identify rows to delete. + * @return $this Current object instance, to enable object chaining. + */ + public function delete($table, KeySet $keySet) + { + $this->enqueue(Operation::OP_DELETE, $table, [$keySet]); + + return $this; + } + + /** + * Format, validate and enqueue mutations in the transaction. + * + * @param string $op The operation type. + * @param string $table The table name + * @param array $dataSet the mutations to enqueue + * @return void + */ + private function enqueue($op, $table, array $dataSet) + { + foreach ($dataSet as $data) { + if ($op === Operation::OP_DELETE) { + $this->mutationData[] = $this->deleteMutation($table, $data); + } else { + $this->mutationData[] = $this->mutation($op, $table, $data); + } + } + } + + /** + * Create a formatted mutation. + * + * @param string $operation The operation type. + * @param string $table The table name. + * @param array $mutation The mutation data, represented as a set of + * key/value pairs. + * @return array + */ + public function mutation($operation, $table, $mutation) + { + return [ + $operation => [ + 'table' => $table, + 'columns' => array_keys($mutation), + 'values' => $this->getValueMapper()->encodeValuesAsSimpleType(array_values($mutation)) + ] + ]; + } + + /** + * Create a formatted delete mutation. + * + * @param string $table The table name. + * @param KeySet $keySet The keys to delete. + * @return array + */ + public function deleteMutation($table, KeySet $keySet) + { + return [ + 'delete' => [ + 'table' => $table, + 'keySet' => $this->flattenKeySet($keySet), + ] + ]; + } + + /** + * Returns the mutation data as associative array. + * @return array + */ + private function getMutations() + { + return $this->mutationData; + } + + private function getValueMapper() + { + if (!isset($this->mapper)) { + throw new ValidationException( + 'MutationTrait usage requires `ValueMapper` to be ' . + 'present in the user class in the `$this->mapper` property.' + ); + } + + return $this->mapper; + } + + private function flattenKeySet(KeySet $keySet) + { + $keys = $keySet->keySetObject(); + + if (!empty($keys['ranges'])) { + foreach ($keys['ranges'] as $index => $range) { + foreach ($range as $type => $rangeKeys) { + $range[$type] = $this->getValueMapper()->encodeValuesAsSimpleType($rangeKeys); + } + + $keys['ranges'][$index] = $range; + } + } + + if (!empty($keys['keys'])) { + $keys['keys'] = $this->getValueMapper()->encodeValuesAsSimpleType($keys['keys'], true); + } + + return $this->arrayFilterRemoveNull($keys); + } +} diff --git a/Spanner/src/Operation.php b/Spanner/src/Operation.php index 3706d2b1ba65..f8b6bfd6790e 100644 --- a/Spanner/src/Operation.php +++ b/Spanner/src/Operation.php @@ -41,6 +41,7 @@ class Operation { use ArrayTrait; + use MutationTrait; use TimeTrait; use ValidateTrait; @@ -75,43 +76,6 @@ public function __construct(ConnectionInterface $connection, $returnInt64AsObjec $this->mapper = new ValueMapper($returnInt64AsObject); } - /** - * Create a formatted mutation. - * - * @param string $operation The operation type. - * @param string $table The table name. - * @param array $mutation The mutation data, represented as a set of - * key/value pairs. - * @return array - */ - public function mutation($operation, $table, $mutation) - { - return [ - $operation => [ - 'table' => $table, - 'columns' => array_keys($mutation), - 'values' => $this->mapper->encodeValuesAsSimpleType(array_values($mutation)) - ] - ]; - } - - /** - * Create a formatted delete mutation. - * - * @param string $table The table name. - * @param KeySet $keySet The keys to delete. - * @return array - */ - public function deleteMutation($table, KeySet $keySet) - { - return [ - self::OP_DELETE => [ - 'table' => $table, - 'keySet' => $this->flattenKeySet($keySet), - ] - ]; - } - /** * Commit all enqueued mutations. * diff --git a/Spanner/src/PgOid.php b/Spanner/src/PgOid.php new file mode 100644 index 000000000000..8a3d0b9a1ced --- /dev/null +++ b/Spanner/src/PgOid.php @@ -0,0 +1,102 @@ +pgOid('123'); + * ``` + */ +class PgOid implements ValueInterface, TypeAnnotationInterface +{ + /** + * @var string|null + */ + private ?string $value; + + /** + * @param string|null $value The OID value. + */ + public function __construct(?string $value) + { + $this->value = $value; + } + + /** + * Get the underlying value. + * + * @return string|null + */ + public function get(): ?string + { + return $this->value; + } + + /** + * Get the type. + * + * @access private + * @return int + */ + public function type(): int + { + return ValueMapper::TYPE_INT64; + } + + /** + * Get the type annotation code. + * This is to be used along type, to differentiate the value from TypeCode::INT64. + * + * @access private + * @return int + */ + public function typeAnnotation(): int + { + return TypeAnnotationCode::PG_OID; + } + + /** + * Format the value as a string. + * + * @return string + */ + public function formatAsString(): ?string + { + return (string) $this->value; + } + + /** + * Format the value as a string. + * + * @return string + */ + public function __toString() + { + return (string) $this->value; + } +} diff --git a/Spanner/src/SpannerClient.php b/Spanner/src/SpannerClient.php index eafe3220ec71..c6a839873733 100644 --- a/Spanner/src/SpannerClient.php +++ b/Spanner/src/SpannerClient.php @@ -120,7 +120,7 @@ class SpannerClient use LROTrait; use ValidateTrait; - const VERSION = '1.76.0'; + const VERSION = '1.79.0'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/spanner.data'; const ADMIN_SCOPE = 'https://www.googleapis.com/auth/spanner.admin'; @@ -823,6 +823,21 @@ public function pgJsonb($value) return new PgJsonb($value); } + /** + * Represents a value with a data type of + * [PG OID](https://cloud.google.com/spanner/docs/reference/postgresql/data-types) for the + * Postgres Dialect database. + * + * Example: + * ``` + * $pgOid = $spanner->pgOid('123'); + * ``` + */ + public function pgOid($value) + { + return new PgOid($value); + } + /** * Create an Int64 object. This can be used to work with 64 bit integers as * a string value while on a 32 bit platform. diff --git a/Spanner/src/Transaction.php b/Spanner/src/Transaction.php index 05592b70bad8..62cbddef5573 100644 --- a/Spanner/src/Transaction.php +++ b/Spanner/src/Transaction.php @@ -64,6 +64,7 @@ */ class Transaction implements TransactionalReadInterface { + use MutationTrait; use TransactionalReadTrait; /** @@ -143,213 +144,6 @@ public function getCommitStats() return $this->commitStats; } - /** - * Enqueue an insert mutation. - * - * Example: - * ``` - * $transaction->insert('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ]); - * ``` - * - * @param string $table The table to insert into. - * @param array $data The data to insert. - * @return Transaction The transaction, to enable method chaining. - */ - public function insert($table, array $data) - { - return $this->insertBatch($table, [$data]); - } - - /** - * Enqueue one or more insert mutations. - * - * Example: - * ``` - * $transaction->insertBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ] - * ]); - * ``` - * - * @param string $table The table to insert into. - * @param array $dataSet The data to insert. - * @return Transaction The transaction, to enable method chaining. - */ - public function insertBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_INSERT, $table, $dataSet); - - return $this; - } - - /** - * Enqueue an update mutation. - * - * Example: - * ``` - * $transaction->update('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post [Updated!]', - * 'content' => 'Modified Content' - * ]); - * ``` - * - * @param string $table The table to update. - * @param array $data The data to update. - * @return Transaction The transaction, to enable method chaining. - */ - public function update($table, array $data) - { - return $this->updateBatch($table, [$data]); - } - - /** - * Enqueue one or more update mutations. - * - * Example: - * ``` - * $transaction->updateBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post [Updated!]', - * 'content' => 'Modified Content' - * ] - * ]); - * ``` - * - * @param string $table The table to update. - * @param array $dataSet The data to update. - * @return Transaction The transaction, to enable method chaining. - */ - public function updateBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_UPDATE, $table, $dataSet); - - return $this; - } - - /** - * Enqueue an insert or update mutation. - * - * Example: - * ``` - * $transaction->insertOrUpdate('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ]); - * ``` - * - * @param string $table The table to insert into or update. - * @param array $data The data to insert or update. - * @return Transaction The transaction, to enable method chaining. - */ - public function insertOrUpdate($table, array $data) - { - return $this->insertOrUpdateBatch($table, [$data]); - } - - /** - * Enqueue one or more insert or update mutations. - * - * Example: - * ``` - * $transaction->insertOrUpdateBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post', - * 'content' => 'Hello World' - * ] - * ]); - * ``` - * - * @param string $table The table to insert into or update. - * @param array $dataSet The data to insert or update. - * @return Transaction The transaction, to enable method chaining. - */ - public function insertOrUpdateBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_INSERT_OR_UPDATE, $table, $dataSet); - - return $this; - } - - /** - * Enqueue an replace mutation. - * - * Example: - * ``` - * $transaction->replace('Posts', [ - * 'ID' => 10, - * 'title' => 'My New Post [Replaced]', - * 'content' => 'Hello Moon' - * ]); - * ``` - * - * @param string $table The table to replace into. - * @param array $data The data to replace. - * @return Transaction The transaction, to enable method chaining. - */ - public function replace($table, array $data) - { - return $this->replaceBatch($table, [$data]); - } - - /** - * Enqueue one or more replace mutations. - * - * Example: - * ``` - * $transaction->replaceBatch('Posts', [ - * [ - * 'ID' => 10, - * 'title' => 'My New Post [Replaced]', - * 'content' => 'Hello Moon' - * ] - * ]); - * ``` - * - * @param string $table The table to replace into. - * @param array $dataSet The data to replace. - * @return Transaction The transaction, to enable method chaining. - */ - public function replaceBatch($table, array $dataSet) - { - $this->enqueue(Operation::OP_REPLACE, $table, $dataSet); - - return $this; - } - - /** - * Enqueue an delete mutation. - * - * Example: - * ``` - * $keySet = new KeySet([ - * 'keys' => [10] - * ]); - * - * $transaction->delete('Posts', $keySet); - * ``` - * - * @param string $table The table to mutate. - * @param KeySet $keySet The KeySet to identify rows to delete. - * @return Transaction The transaction, to enable method chaining. - */ - public function delete($table, KeySet $keySet) - { - $this->enqueue(Operation::OP_DELETE, $table, [$keySet]); - - return $this; - } - /** * Execute a Cloud Spanner DML statement. * @@ -637,7 +431,7 @@ public function commit(array $options = []) 'requestOptions' => [] ]; - $options['mutations'] += $this->mutations; + $options['mutations'] += $this->getMutations(); $options['transactionId'] = $this->transactionId; @@ -699,25 +493,6 @@ public function isRetry() return $this->isRetry; } - /** - * Format, validate and enqueue mutations in the transaction. - * - * @param string $op The operation type. - * @param string $table The table name - * @param array $dataSet the mutations to enqueue - * @return void - */ - private function enqueue($op, $table, array $dataSet) - { - foreach ($dataSet as $data) { - if ($op === Operation::OP_DELETE) { - $this->mutations[] = $this->operation->deleteMutation($table, $data); - } else { - $this->mutations[] = $this->operation->mutation($op, $table, $data); - } - } - } - /** * Build the update options. * diff --git a/Spanner/src/V1/Gapic/SpannerGapicClient.php b/Spanner/src/V1/Gapic/SpannerGapicClient.php index fdcd037f3803..7b28cd26a3f0 100644 --- a/Spanner/src/V1/Gapic/SpannerGapicClient.php +++ b/Spanner/src/V1/Gapic/SpannerGapicClient.php @@ -1730,6 +1730,19 @@ public function partitionRead( * * If the field is set to `true` but the request does not set * `partition_token`, the API returns an `INVALID_ARGUMENT` error. + * @type int $orderBy + * Optional. Order for the returned rows. + * + * By default, Spanner will return result rows in primary key order except for + * PartitionRead requests. For applications that do not require rows to be + * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + * resulting in lower latencies in certain cases (e.g. bulk point lookups). + * For allowed values, use constants defined on {@see \Google\Cloud\Spanner\V1\ReadRequest\OrderBy} + * @type int $lockHint + * Optional. Lock Hint for the request, it can only be used with read-write + * transactions. + * For allowed values, use constants defined on {@see \Google\Cloud\Spanner\V1\ReadRequest\LockHint} * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1788,6 +1801,14 @@ public function read( $request->setDataBoostEnabled($optionalArgs['dataBoostEnabled']); } + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['lockHint'])) { + $request->setLockHint($optionalArgs['lockHint']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); @@ -1943,6 +1964,19 @@ public function rollback($session, $transactionId, array $optionalArgs = []) * * If the field is set to `true` but the request does not set * `partition_token`, the API returns an `INVALID_ARGUMENT` error. + * @type int $orderBy + * Optional. Order for the returned rows. + * + * By default, Spanner will return result rows in primary key order except for + * PartitionRead requests. For applications that do not require rows to be + * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + * resulting in lower latencies in certain cases (e.g. bulk point lookups). + * For allowed values, use constants defined on {@see \Google\Cloud\Spanner\V1\ReadRequest\OrderBy} + * @type int $lockHint + * Optional. Lock Hint for the request, it can only be used with read-write + * transactions. + * For allowed values, use constants defined on {@see \Google\Cloud\Spanner\V1\ReadRequest\LockHint} * @type int $timeoutMillis * Timeout to use for this call. * } @@ -1999,6 +2033,14 @@ public function streamingRead( $request->setDataBoostEnabled($optionalArgs['dataBoostEnabled']); } + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['lockHint'])) { + $request->setLockHint($optionalArgs['lockHint']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); diff --git a/Spanner/src/V1/ReadRequest.php b/Spanner/src/V1/ReadRequest.php index 09495c409f1c..aac660a488ba 100644 --- a/Spanner/src/V1/ReadRequest.php +++ b/Spanner/src/V1/ReadRequest.php @@ -121,6 +121,24 @@ class ReadRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool data_boost_enabled = 15; */ private $data_boost_enabled = false; + /** + * Optional. Order for the returned rows. + * By default, Spanner will return result rows in primary key order except for + * PartitionRead requests. For applications that do not require rows to be + * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + * resulting in lower latencies in certain cases (e.g. bulk point lookups). + * + * Generated from protobuf field .google.spanner.v1.ReadRequest.OrderBy order_by = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $order_by = 0; + /** + * Optional. Lock Hint for the request, it can only be used with read-write + * transactions. + * + * Generated from protobuf field .google.spanner.v1.ReadRequest.LockHint lock_hint = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $lock_hint = 0; /** * Constructor. @@ -185,6 +203,16 @@ class ReadRequest extends \Google\Protobuf\Internal\Message * request is executed with Spanner Data Boost independent compute resources. * If the field is set to `true` but the request does not set * `partition_token`, the API returns an `INVALID_ARGUMENT` error. + * @type int $order_by + * Optional. Order for the returned rows. + * By default, Spanner will return result rows in primary key order except for + * PartitionRead requests. For applications that do not require rows to be + * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + * resulting in lower latencies in certain cases (e.g. bulk point lookups). + * @type int $lock_hint + * Optional. Lock Hint for the request, it can only be used with read-write + * transactions. * } */ public function __construct($data = NULL) { @@ -610,5 +638,69 @@ public function setDataBoostEnabled($var) return $this; } + /** + * Optional. Order for the returned rows. + * By default, Spanner will return result rows in primary key order except for + * PartitionRead requests. For applications that do not require rows to be + * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + * resulting in lower latencies in certain cases (e.g. bulk point lookups). + * + * Generated from protobuf field .google.spanner.v1.ReadRequest.OrderBy order_by = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Order for the returned rows. + * By default, Spanner will return result rows in primary key order except for + * PartitionRead requests. For applications that do not require rows to be + * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + * resulting in lower latencies in certain cases (e.g. bulk point lookups). + * + * Generated from protobuf field .google.spanner.v1.ReadRequest.OrderBy order_by = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Spanner\V1\ReadRequest\OrderBy::class); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Lock Hint for the request, it can only be used with read-write + * transactions. + * + * Generated from protobuf field .google.spanner.v1.ReadRequest.LockHint lock_hint = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLockHint() + { + return $this->lock_hint; + } + + /** + * Optional. Lock Hint for the request, it can only be used with read-write + * transactions. + * + * Generated from protobuf field .google.spanner.v1.ReadRequest.LockHint lock_hint = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLockHint($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Spanner\V1\ReadRequest\LockHint::class); + $this->lock_hint = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/ReadRequest/LockHint.php b/Spanner/src/V1/ReadRequest/LockHint.php new file mode 100644 index 000000000000..c0e38b196dbf --- /dev/null +++ b/Spanner/src/V1/ReadRequest/LockHint.php @@ -0,0 +1,95 @@ +google.spanner.v1.ReadRequest.LockHint + */ +class LockHint +{ + /** + * Default value. + * LOCK_HINT_UNSPECIFIED is equivalent to LOCK_HINT_SHARED. + * + * Generated from protobuf enum LOCK_HINT_UNSPECIFIED = 0; + */ + const LOCK_HINT_UNSPECIFIED = 0; + /** + * Acquire shared locks. + * By default when you perform a read as part of a read-write transaction, + * Spanner acquires shared read locks, which allows other reads to still + * access the data until your transaction is ready to commit. When your + * transaction is committing and writes are being applied, the transaction + * attempts to upgrade to an exclusive lock for any data you are writing. + * For more information about locks, see [Lock + * modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes). + * + * Generated from protobuf enum LOCK_HINT_SHARED = 1; + */ + const LOCK_HINT_SHARED = 1; + /** + * Acquire exclusive locks. + * Requesting exclusive locks is beneficial if you observe high write + * contention, which means you notice that multiple transactions are + * concurrently trying to read and write to the same data, resulting in a + * large number of aborts. This problem occurs when two transactions + * initially acquire shared locks and then both try to upgrade to exclusive + * locks at the same time. In this situation both transactions are waiting + * for the other to give up their lock, resulting in a deadlocked situation. + * Spanner is able to detect this occurring and force one of the + * transactions to abort. However, this is a slow and expensive operation + * and results in lower performance. In this case it makes sense to acquire + * exclusive locks at the start of the transaction because then when + * multiple transactions try to act on the same data, they automatically get + * serialized. Each transaction waits its turn to acquire the lock and + * avoids getting into deadlock situations. + * Because the exclusive lock hint is just a hint, it should not be + * considered equivalent to a mutex. In other words, you should not use + * Spanner exclusive locks as a mutual exclusion mechanism for the execution + * of code outside of Spanner. + * **Note:** Request exclusive locks judiciously because they block others + * from reading that data for the entire transaction, rather than just when + * the writes are being performed. Unless you observe high write contention, + * you should use the default of shared read locks so you don't prematurely + * block other clients from reading the data that you're writing to. + * + * Generated from protobuf enum LOCK_HINT_EXCLUSIVE = 2; + */ + const LOCK_HINT_EXCLUSIVE = 2; + + private static $valueToName = [ + self::LOCK_HINT_UNSPECIFIED => 'LOCK_HINT_UNSPECIFIED', + self::LOCK_HINT_SHARED => 'LOCK_HINT_SHARED', + self::LOCK_HINT_EXCLUSIVE => 'LOCK_HINT_EXCLUSIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LockHint::class, \Google\Cloud\Spanner\V1\ReadRequest_LockHint::class); + diff --git a/Spanner/src/V1/ReadRequest/OrderBy.php b/Spanner/src/V1/ReadRequest/OrderBy.php new file mode 100644 index 000000000000..4a229a9738f2 --- /dev/null +++ b/Spanner/src/V1/ReadRequest/OrderBy.php @@ -0,0 +1,67 @@ +google.spanner.v1.ReadRequest.OrderBy + */ +class OrderBy +{ + /** + * Default value. + * ORDER_BY_UNSPECIFIED is equivalent to ORDER_BY_PRIMARY_KEY. + * + * Generated from protobuf enum ORDER_BY_UNSPECIFIED = 0; + */ + const ORDER_BY_UNSPECIFIED = 0; + /** + * Read rows are returned in primary key order. + * In the event that this option is used in conjunction with the + * `partition_token` field, the API will return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf enum ORDER_BY_PRIMARY_KEY = 1; + */ + const ORDER_BY_PRIMARY_KEY = 1; + /** + * Read rows are returned in any order. + * + * Generated from protobuf enum ORDER_BY_NO_ORDER = 2; + */ + const ORDER_BY_NO_ORDER = 2; + + private static $valueToName = [ + self::ORDER_BY_UNSPECIFIED => 'ORDER_BY_UNSPECIFIED', + self::ORDER_BY_PRIMARY_KEY => 'ORDER_BY_PRIMARY_KEY', + self::ORDER_BY_NO_ORDER => 'ORDER_BY_NO_ORDER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OrderBy::class, \Google\Cloud\Spanner\V1\ReadRequest_OrderBy::class); + diff --git a/Spanner/src/ValueMapper.php b/Spanner/src/ValueMapper.php index c54605170b74..57771a434d6e 100644 --- a/Spanner/src/ValueMapper.php +++ b/Spanner/src/ValueMapper.php @@ -45,6 +45,7 @@ class ValueMapper const TYPE_JSON = TypeCode::JSON; const TYPE_PG_NUMERIC = 'pgNumeric'; const TYPE_PG_JSONB = 'pgJsonb'; + const TYPE_PG_OID = 'pgOid'; /** * @var array @@ -64,6 +65,7 @@ class ValueMapper self::TYPE_JSON, self::TYPE_PG_NUMERIC, self::TYPE_PG_JSONB, + self::TYPE_PG_OID, self::TYPE_FLOAT32, ]; @@ -79,6 +81,7 @@ class ValueMapper private static $typeToClassMap = [ self::TYPE_PG_NUMERIC => PgNumeric::class, self::TYPE_PG_JSONB => PgJsonb::class, + self::TYPE_PG_OID => PgOid::class, ]; /* @@ -90,6 +93,7 @@ class ValueMapper private static $typeCodes = [ self::TYPE_PG_NUMERIC => self::TYPE_NUMERIC, self::TYPE_PG_JSONB => self::TYPE_JSON, + self::TYPE_PG_OID => self::TYPE_INT64, ]; /* @@ -101,6 +105,7 @@ class ValueMapper private static $typeAnnotations = [ self::TYPE_PG_NUMERIC => TypeAnnotationCode::PG_NUMERIC, self::TYPE_PG_JSONB => TypeAnnotationCode::PG_JSONB, + self::TYPE_PG_OID => TypeAnnotationCode::PG_OID, ]; /** @@ -280,9 +285,13 @@ private function decodeValue($value, array $type) switch ($type['code']) { case self::TYPE_INT64: - $value = $this->returnInt64AsObject - ? new Int64($value) - : (int) $value; + if (isset($type['typeAnnotation']) && $type['typeAnnotation'] === TypeAnnotationCode::PG_OID) { + $value = new PgOid($value); + } else { + $value = $this->returnInt64AsObject + ? new Int64($value) + : (int) $value; + } break; case self::TYPE_TIMESTAMP: diff --git a/Spanner/tests/Snippet/PgOidTest.php b/Spanner/tests/Snippet/PgOidTest.php new file mode 100644 index 000000000000..7cdf215a3ad5 --- /dev/null +++ b/Spanner/tests/Snippet/PgOidTest.php @@ -0,0 +1,37 @@ +snippetFromClass(PgOid::class); + $res = $snippet->invoke('pgOid'); + + $this->assertInstanceOf(PgOid::class, $res->returnVal()); + $this->assertEquals($expected, $res->returnVal()); + } +} diff --git a/Spanner/tests/Snippet/SpannerClientTest.php b/Spanner/tests/Snippet/SpannerClientTest.php index d0f316779e80..564f75698cc1 100644 --- a/Spanner/tests/Snippet/SpannerClientTest.php +++ b/Spanner/tests/Snippet/SpannerClientTest.php @@ -39,6 +39,7 @@ use Google\Cloud\Spanner\Timestamp; use Google\Cloud\Spanner\Numeric; use Google\Cloud\Spanner\PgNumeric; +use Google\Cloud\Spanner\PgOid; use Google\Cloud\Spanner\PgJsonb; use Prophecy\Argument; @@ -261,6 +262,7 @@ public function factoriesProvider() [Numeric::class, 'numeric'], [PgNumeric::class, 'pgNumeric'], [PgJsonB::class, 'pgJsonb'], + [PgOid::class, 'pgOid'], ]; } diff --git a/Spanner/tests/System/PgQueryTest.php b/Spanner/tests/System/PgQueryTest.php index ccea014c7ef7..dd374e517544 100644 --- a/Spanner/tests/System/PgQueryTest.php +++ b/Spanner/tests/System/PgQueryTest.php @@ -542,6 +542,36 @@ public function testBindJsonbParameterNull() $this->assertCount($currentCount + 1, iterator_to_array($res)); } + public function testBindPgOidParameter() + { + $db = self::$database; + + $res = $db->execute('SELECT $1', [ + 'parameters' => [ + 'p1' => 1, + ], + 'types' => [ + 'p1' => Database::TYPE_PG_OID + ] + ]); + $this->assertCount(1, iterator_to_array($res)); + } + + public function testBindPgOidParameterNull() + { + $db = self::$database; + + $res = $db->execute('SELECT $1', [ + 'parameters' => [ + 'p1' => null, + ], + 'types' => [ + 'p1' => Database::TYPE_PG_OID + ] + ]); + $this->assertCount(1, iterator_to_array($res)); + } + public function arrayTypesProvider() { return [ @@ -639,7 +669,9 @@ function (array $res) { return $res; } - ] + ], + // pg_oid + [[5,4,3,2,1]], ]; } @@ -685,6 +717,7 @@ public function arrayTypesEmptyProvider() [Database::TYPE_DATE], [Database::TYPE_PG_NUMERIC], [Database::TYPE_PG_JSONB], + [Database::TYPE_PG_OID], ]; } @@ -722,6 +755,7 @@ public function arrayTypesNullProvider() [Database::TYPE_DATE], [Database::TYPE_PG_NUMERIC], [Database::TYPE_PG_JSONB], + [Database::TYPE_PG_OID], ]; } diff --git a/Spanner/tests/Unit/ArrayTypeTest.php b/Spanner/tests/Unit/ArrayTypeTest.php index 91524972c0e7..d04b0f2d7fd2 100644 --- a/Spanner/tests/Unit/ArrayTypeTest.php +++ b/Spanner/tests/Unit/ArrayTypeTest.php @@ -46,6 +46,7 @@ public function typesProvider() // types (w/ typeAnnotation) [Database::TYPE_PG_NUMERIC], [Database::TYPE_PG_JSONB], + [Database::TYPE_PG_OID], ]; } diff --git a/Spanner/tests/Unit/SpannerClientTest.php b/Spanner/tests/Unit/SpannerClientTest.php index 3f93170d22f1..beeb17033339 100644 --- a/Spanner/tests/Unit/SpannerClientTest.php +++ b/Spanner/tests/Unit/SpannerClientTest.php @@ -33,6 +33,7 @@ use Google\Cloud\Spanner\Instance; use Google\Cloud\Spanner\InstanceConfiguration; use Google\Cloud\Spanner\PgJsonb; +use Google\Cloud\Spanner\PgOid; use Google\Cloud\Spanner\KeyRange; use Google\Cloud\Spanner\KeySet; use Google\Cloud\Spanner\Numeric; @@ -433,6 +434,12 @@ public function testPgJsonB() $this->assertInstanceOf(PgJsonb::class, $objVal); } + public function testPgOid() + { + $oidVal = $this->client->pgOid('123'); + $this->assertInstanceOf(PgOid::class, $oidVal); + } + public function testInt64() { $i64 = $this->client->int64('123'); diff --git a/Spanner/tests/Unit/ValueMapperTest.php b/Spanner/tests/Unit/ValueMapperTest.php index c33e7402904f..9b9780f3a2a0 100644 --- a/Spanner/tests/Unit/ValueMapperTest.php +++ b/Spanner/tests/Unit/ValueMapperTest.php @@ -158,6 +158,23 @@ public function testFormatParamsForExecuteSqlJsonB() $this->assertEquals(TypeAnnotationCode::PG_JSONB, $res['paramTypes']['json']['typeAnnotation']); } + public function testFormatParamsForExecuteSqlOid() + { + $val = '123'; + $params = [ + 'oid' => $val + ]; + $types = [ + 'oid' => Database::TYPE_PG_OID + ]; + + $res = $this->mapper->formatParamsForExecuteSql($params, $types); + + $this->assertEquals($val, $res['params']['oid']); + $this->assertEquals(TypeCode::INT64, $res['paramTypes']['oid']['code']); + $this->assertEquals(TypeAnnotationCode::PG_OID, $res['paramTypes']['oid']['typeAnnotation']); + } + public function testFormatParamsForExecuteSqlValueInterface() { $val = 'hello world'; @@ -1035,6 +1052,16 @@ public function testDecodeValuesJsonB() $this->assertEquals('{\"rating\":9,\"open\":true}', $res['rowName']); } + public function testDecodeValuesOid() + { + $res = $this->mapper->decodeValues( + $this->createField(Database::TYPE_PG_OID), + $this->createRow('123'), + Result::RETURN_ASSOCIATIVE + ); + $this->assertEquals('123', $res['rowName']); + } + public function testDecodeValuesAnonymousField() { $fields = [ diff --git a/Speech/.repo-metadata.json b/Speech/.repo-metadata.json deleted file mode 100644 index b164a88136a9..000000000000 --- a/Speech/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-speech", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-speech/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "speech" -} diff --git a/Speech/VERSION b/Speech/VERSION index ec6d649be650..b9fb27ab4f7a 100644 --- a/Speech/VERSION +++ b/Speech/VERSION @@ -1 +1 @@ -1.18.1 +1.18.3 diff --git a/Speech/composer.json b/Speech/composer.json index 153c108fc297..f1952b1aeb55 100644 --- a/Speech/composer.json +++ b/Speech/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^8.0", "google/cloud-core": "^1.52.7", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Speech/src/SpeechClient.php b/Speech/src/SpeechClient.php index 45bbf27da601..5d0e6c1582cb 100644 --- a/Speech/src/SpeechClient.php +++ b/Speech/src/SpeechClient.php @@ -50,7 +50,7 @@ class SpeechClient { use ClientTrait; - const VERSION = '1.18.1'; + const VERSION = '1.18.3'; const SCOPE = 'https://www.googleapis.com/auth/cloud-platform'; diff --git a/SqlAdmin/.repo-metadata.json b/SqlAdmin/.repo-metadata.json deleted file mode 100644 index 49a65dcbbe5b..000000000000 --- a/SqlAdmin/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-sql-admin", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-sql-admin/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "sqladmin" -} diff --git a/SqlAdmin/VERSION b/SqlAdmin/VERSION index 2a0970ca757c..66333910a4be 100644 --- a/SqlAdmin/VERSION +++ b/SqlAdmin/VERSION @@ -1 +1 @@ -0.16.1 +0.18.0 diff --git a/SqlAdmin/composer.json b/SqlAdmin/composer.json index e64f80bb0416..22c8b8e5c399 100644 --- a/SqlAdmin/composer.json +++ b/SqlAdmin/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/SqlAdmin/metadata/V1/CloudSqlInstances.php b/SqlAdmin/metadata/V1/CloudSqlInstances.php index cd33ba979b7394b69fac85d1af75608351ae0649..a4d17c35d2de24fab89b645915c9bb8a230a3d01 100644 GIT binary patch delta 1681 zcmaJ>U2oe|7@qBX^`sw}n>0>JOJ}x1yRI99ZCW*u64!0KxoL<~qypl|beA89L0ypMPRZgv} zZXKcx43??KC4#PjY5TxXU|Y6iO+y;gP#0-T%3aM~b#K$}eav1569aYhJSc7noApvd z*sj9HZjFaKRjI~v!iK=FXHL**kQBE!1+FA!2znf(YL#6n_(hf{Ksr!UOyj27V*jSR z#I!updFpxRlY`E^z3gvs&H)R8VLP&+AiJdOcT@{Wwq=V*wox7JcaZJibVWIYpp7vc z4ucS@JLs0f5boWD+01aQmoI)xkv|l?pXYv07H9!XTd1w6O4wFK>(~ymn9J_7!Ydc* z5yFK)*i{}(w2-bEs;`BUGFKLeH_{iE+;7sknauz>^v(r@O2Yf(%towN&VWfcP|Dt+ zKz39KT?8p)II5$eCPU!&Q@%D;Iq?-i&?}(WGR>BTU{_W;9UbZ|-GRuE_k1=Pv57w0 zG<9gBo^AWHqxenLj_6cGCw=-N$jXYNb`iu~whoSXv4}_cypLW7In`*QTTpIxRok?V znDK}i^O?(lxv9x5*t3vg>N>(j5jhc&u|=0_tSklae1l&VtZ!u zfNA2-o4$Anuf}|Dco+M7?6-$xuYuDqc@yuv-8Kyy(OEEVwo(5Ks^M;ovGqYmbrjr! z!HeOpCCfpE&RVv;I4L0RpouvwS_Z6|>h=DgkG+FhT$T diff --git a/SqlAdmin/metadata/V1/CloudSqlResources.php b/SqlAdmin/metadata/V1/CloudSqlResources.php index 4e6006f6315761536de453b6e60cd21e8aed2ee7..50aa6e3ff9004810005e05e52c8fc7ba91a866de 100644 GIT binary patch delta 1032 zcmaiyUu)A)7{-^RTidg>OOMWGZLMt)8Fv5N2Ad#Anx1u`S<@w{V<;Z8E|fysv`sd4 zAyn_Y5;T{)@lqTPA$|cbb}je`oKu;I-@&Baq)ySRm-GD2bKY~F^M0!z@4WdydJdal z>REourl=E=+#9lg48AAQa2H%L+iJs5%Vt$?s5M;EE7&mgwp!7gs+t-D62wGs4q588 zG3$YM$jVOyI@3zONzf~D&my~y4E2$vRtBCBL~5S^v43raGa#)(i^Ugs5Vg)ii=B4SPuOW89sO~T7y zyvI@YPfWoO2>kBwWKtl3{}V@Q4lqUgo%f-SeB`%p)6)b46#$J^4Oi<;y=`K>=|*WV zKI>>WYTbvSDBlHQPj}NHBD;W=TQ$CJwSr-SupW;ltye*4rG}D&-3@j<6b9Z;0pJ&# zn$-kj_KWCCG69PqqLy3R)wc6HM%%zOO*J%J)*Gg_YcdzD{d8=+$7Kf#F6DYK^?k_B z$4|%(yaXW2t(ADmNm!O-EFe}!^mSL4PZRnPK3^TlV2hlOXrJ_Tr6u2G=1iXZ2 q@%$ovOgaHUJ4SE0Ui^xJR~Ip0__pAV<)W#vsW*!1GDNgX#oPi O2D4Q)TmrKVI93BNdL&5z diff --git a/SqlAdmin/metadata/V1Beta4/CloudSql.php b/SqlAdmin/metadata/V1Beta4/CloudSql.php index 1454c8bf840f2a3c14f5617f06ddbc43621ef5bf..d3ee36266ae2e9c171fd3ee425738696a3224fb2 100644 GIT binary patch delta 802 zcmccA#kg(?Vo7FxUVKSq zL8=710;2|>QRrkw5w*#2mNJHgrK!awdcH74AwV@w%nuwHg+jT6i!1Yz;|mgt5_57= zbK-MS%TjYBI418Gx0|db78s}G#l?%FPe_hS%Gc99$T7sz-!DESGQc%H)Gs)|)!Ea{ z)73?QL5Q1+-N)bE)7jBSfKiBtizC1zG8oKba^mIU2HTdLpO==IuJoCCbFWwdRu6EX zdO#S92R8o@k6@8k3gS`@F3j=FD=taQOHM5gO3g`4EKUtBE-Ll`GA3{1G>ucT;Znh) zCN(IvxFA2TI8{i5izmMz6&jG4DH4o8S8yuLVMMjUF}bibvk2J=Gky;)mZbcYN{JMp z4sIhWV8BaF{vg1ajiwf871$?0SEINHQyJ7nlGt42!O+3T=)}*(8;|VT%>gn;IhpR8 zY!+7&l@J$t#>gdrZmf_kC`Cx13qu_xHTj^Gx)P=@R_O_!fcX7W{Xo%~VOR5uYd z5K^tc{ug=xv=uE1Qo*)rh@r#_EFd6uqU(S~h>|bZPIri%0!65Cn>tzErEc>oyA^Bz DB?J!W delta 101 zcmV-r0Gj`W@%?4{{jjmlO8=Jv&t7r0keo1Qv|bMAH@j*lQFX=DHRx#`$&GX HhC`?Zo+ly` diff --git a/SqlAdmin/metadata/V1Beta4/CloudSqlResources.php b/SqlAdmin/metadata/V1Beta4/CloudSqlResources.php index 867f91c7e6ba251214c483bb608880d28ad44ba0..bc9bba0bcbead6c73529b1f07ebd54c05ec85b96 100644 GIT binary patch delta 1895 zcmah~OK;;;6voc`rcGV<5jSZ|8i{t)$4n_BrYu0%iJN#POMT$YtI;gjcmqO0AOssWBUx-&uo$)=A$Fh2DrM40Nst)3k zIqFhsEyhy#iM1 zGGA5rLS3p=`3kJmN>HiSWWFTgFJBj7qpIwP1!+riugpaHaS$#_$_<8M=Rrn!U8)z# zQndu@HCU+B8pUH@hGyr$On{5UC*cq~4n|LVgoQlF!Kd`ZdlZ|C(H~~Ke^X=e8MX>0 zEY#Jtrr#CV)O)srEbc}3`?cJ%JU|KoP>$lJu-Cz88+9~8gH6-GJ>{;sf3N1IOTJAq zaPN&KD)>-2<|WfN!hK;HOu}{wA0z zs*ZYF#e=PAwj(3EYZ^9Uy>9la1pRTsTYBzgYM$K#ti7*8tI5XW$w7yXFYe^V^JHx?XCrw3ti8w3_fy`x zuRNv~pAu-&ugDLSIU5MyPjXoPuc-Gn|CsKx(}3j*yA4UkdrOfOSP^+eWR{6t7X6=L z`wE){X<01Ps#{X2fqiO~BHWRsZC>7ER@pR|C{!9sU6kQAFIDSem9G{=W(^OUQ^d*^ zR7CkTsUV)95dvTKlwvhPe=y;FCNc3mD}vcTxW|(3;GyBP+rbj&F1dUEsxrJD-`}H23Ysg zu?g?+R*8ON9E@!5DZ3T83D@BZ*O*^vy#I$yo6K)#O)oLOpD|rsXa1ns6i6J$y2`vC K^1goaUid#)dQoNo delta 136 zcmV;30C)e#)&a)G0kGWy0l>4~0xSap)C02&2GjwwF$o<90@E0?P!JCYv-=oG1hb?c z&j|*}2MP^IZIgi_8MBfpAOQs$qX7yNlQAk3v!E-72eYCxdJqDy46`0Y=mG;G=LNH1 qN9Y2x%t}rL0?`t)98eGlvvXKg2eYkUSpx#U2D1ocTmrMeW`_iwHZGw6 diff --git a/SqlAdmin/samples/V1/SqlInstancesServiceClient/acquire_ssrs_lease.php b/SqlAdmin/samples/V1/SqlInstancesServiceClient/acquire_ssrs_lease.php new file mode 100644 index 000000000000..eb1711a8938e --- /dev/null +++ b/SqlAdmin/samples/V1/SqlInstancesServiceClient/acquire_ssrs_lease.php @@ -0,0 +1,80 @@ +setInstance($instance) + ->setProject($project) + ->setBody($body); + + // Call the API and handle any network failures. + try { + /** @var SqlInstancesAcquireSsrsLeaseResponse $response */ + $response = $sqlInstancesServiceClient->acquireSsrsLease($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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + + acquire_ssrs_lease_sample($instance, $project); +} +// [END sqladmin_v1_generated_SqlInstancesService_AcquireSsrsLease_sync] diff --git a/SqlAdmin/samples/V1/SqlInstancesServiceClient/promote_replica.php b/SqlAdmin/samples/V1/SqlInstancesServiceClient/promote_replica.php index 52078a4cc489..0620718c3ca1 100644 --- a/SqlAdmin/samples/V1/SqlInstancesServiceClient/promote_replica.php +++ b/SqlAdmin/samples/V1/SqlInstancesServiceClient/promote_replica.php @@ -29,7 +29,8 @@ use Google\Cloud\Sql\V1\SqlInstancesPromoteReplicaRequest; /** - * Promotes the read replica instance to be a stand-alone Cloud SQL instance. + * Promotes the read replica instance to be an independent Cloud SQL + * primary instance. * Using this operation might cause your instance to restart. * * This sample has been automatically generated and should be regarded as a code diff --git a/SqlAdmin/samples/V1/SqlInstancesServiceClient/release_ssrs_lease.php b/SqlAdmin/samples/V1/SqlInstancesServiceClient/release_ssrs_lease.php new file mode 100644 index 000000000000..9795d90041e8 --- /dev/null +++ b/SqlAdmin/samples/V1/SqlInstancesServiceClient/release_ssrs_lease.php @@ -0,0 +1,76 @@ +setInstance($instance) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var SqlInstancesReleaseSsrsLeaseResponse $response */ + $response = $sqlInstancesServiceClient->releaseSsrsLease($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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + + release_ssrs_lease_sample($instance, $project); +} +// [END sqladmin_v1_generated_SqlInstancesService_ReleaseSsrsLease_sync] diff --git a/SqlAdmin/samples/V1/SqlInstancesServiceClient/switchover.php b/SqlAdmin/samples/V1/SqlInstancesServiceClient/switchover.php index d4aeb6f02b99..a9bc04c2742a 100644 --- a/SqlAdmin/samples/V1/SqlInstancesServiceClient/switchover.php +++ b/SqlAdmin/samples/V1/SqlInstancesServiceClient/switchover.php @@ -29,7 +29,8 @@ use Google\Cloud\Sql\V1\SqlInstancesSwitchoverRequest; /** - * Switches over from the primary instance to the replica instance. + * Switches over from the primary instance to the designated DR replica + * instance. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: diff --git a/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/acquire_ssrs_lease.php b/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/acquire_ssrs_lease.php new file mode 100644 index 000000000000..e64643a2bbdb --- /dev/null +++ b/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/acquire_ssrs_lease.php @@ -0,0 +1,71 @@ +acquireSsrsLease($instance, $project); + 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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + + acquire_ssrs_lease_sample($instance, $project); +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_AcquireSsrsLease_sync] diff --git a/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/promote_replica.php b/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/promote_replica.php index 222a100179bf..26cffb03eac2 100644 --- a/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/promote_replica.php +++ b/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/promote_replica.php @@ -28,7 +28,8 @@ use Google\Cloud\Sql\V1beta4\SqlInstancesServiceClient; /** - * Promotes the read replica instance to be a stand-alone Cloud SQL instance. + * Promotes the read replica instance to be an independent Cloud SQL + * primary instance. * Using this operation might cause your instance to restart. * * This sample has been automatically generated and should be regarded as a code diff --git a/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/release_ssrs_lease.php b/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/release_ssrs_lease.php new file mode 100644 index 000000000000..6b4fcf66f3cc --- /dev/null +++ b/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/release_ssrs_lease.php @@ -0,0 +1,71 @@ +releaseSsrsLease($instance, $project); + 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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + + release_ssrs_lease_sample($instance, $project); +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ReleaseSsrsLease_sync] diff --git a/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/switchover.php b/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/switchover.php index 0a321b59cd95..31a51890b623 100644 --- a/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/switchover.php +++ b/SqlAdmin/samples/V1beta4/SqlInstancesServiceClient/switchover.php @@ -28,7 +28,8 @@ use Google\Cloud\Sql\V1beta4\SqlInstancesServiceClient; /** - * Switches over from the primary instance to a replica instance. + * Switches over from the primary instance to the designated DR replica + * instance. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: diff --git a/SqlAdmin/src/V1/AcquireSsrsLeaseContext.php b/SqlAdmin/src/V1/AcquireSsrsLeaseContext.php new file mode 100644 index 000000000000..9838cf0fc437 --- /dev/null +++ b/SqlAdmin/src/V1/AcquireSsrsLeaseContext.php @@ -0,0 +1,217 @@ +google.cloud.sql.v1.AcquireSsrsLeaseContext + */ +class AcquireSsrsLeaseContext extends \Google\Protobuf\Internal\Message +{ + /** + * The username to be used as the setup login to connect to the database + * server for SSRS setup. + * + * Generated from protobuf field optional string setup_login = 1; + */ + private $setup_login = null; + /** + * The username to be used as the service login to connect to the report + * database for SSRS setup. + * + * Generated from protobuf field optional string service_login = 2; + */ + private $service_login = null; + /** + * The report database to be used for SSRS setup. + * + * Generated from protobuf field optional string report_database = 3; + */ + private $report_database = null; + /** + * Lease duration needed for SSRS setup. + * + * Generated from protobuf field optional .google.protobuf.Duration duration = 4; + */ + private $duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $setup_login + * The username to be used as the setup login to connect to the database + * server for SSRS setup. + * @type string $service_login + * The username to be used as the service login to connect to the report + * database for SSRS setup. + * @type string $report_database + * The report database to be used for SSRS setup. + * @type \Google\Protobuf\Duration $duration + * Lease duration needed for SSRS setup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlResources::initOnce(); + parent::__construct($data); + } + + /** + * The username to be used as the setup login to connect to the database + * server for SSRS setup. + * + * Generated from protobuf field optional string setup_login = 1; + * @return string + */ + public function getSetupLogin() + { + return isset($this->setup_login) ? $this->setup_login : ''; + } + + public function hasSetupLogin() + { + return isset($this->setup_login); + } + + public function clearSetupLogin() + { + unset($this->setup_login); + } + + /** + * The username to be used as the setup login to connect to the database + * server for SSRS setup. + * + * Generated from protobuf field optional string setup_login = 1; + * @param string $var + * @return $this + */ + public function setSetupLogin($var) + { + GPBUtil::checkString($var, True); + $this->setup_login = $var; + + return $this; + } + + /** + * The username to be used as the service login to connect to the report + * database for SSRS setup. + * + * Generated from protobuf field optional string service_login = 2; + * @return string + */ + public function getServiceLogin() + { + return isset($this->service_login) ? $this->service_login : ''; + } + + public function hasServiceLogin() + { + return isset($this->service_login); + } + + public function clearServiceLogin() + { + unset($this->service_login); + } + + /** + * The username to be used as the service login to connect to the report + * database for SSRS setup. + * + * Generated from protobuf field optional string service_login = 2; + * @param string $var + * @return $this + */ + public function setServiceLogin($var) + { + GPBUtil::checkString($var, True); + $this->service_login = $var; + + return $this; + } + + /** + * The report database to be used for SSRS setup. + * + * Generated from protobuf field optional string report_database = 3; + * @return string + */ + public function getReportDatabase() + { + return isset($this->report_database) ? $this->report_database : ''; + } + + public function hasReportDatabase() + { + return isset($this->report_database); + } + + public function clearReportDatabase() + { + unset($this->report_database); + } + + /** + * The report database to be used for SSRS setup. + * + * Generated from protobuf field optional string report_database = 3; + * @param string $var + * @return $this + */ + public function setReportDatabase($var) + { + GPBUtil::checkString($var, True); + $this->report_database = $var; + + return $this; + } + + /** + * Lease duration needed for SSRS setup. + * + * Generated from protobuf field optional .google.protobuf.Duration duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Lease duration needed for SSRS setup. + * + * Generated from protobuf field optional .google.protobuf.Duration duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1/BackupConfiguration.php b/SqlAdmin/src/V1/BackupConfiguration.php index fe0013ef8eb0..8ddf523b48dc 100644 --- a/SqlAdmin/src/V1/BackupConfiguration.php +++ b/SqlAdmin/src/V1/BackupConfiguration.php @@ -72,6 +72,13 @@ class BackupConfiguration extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Int32Value transaction_log_retention_days = 9; */ private $transaction_log_retention_days = null; + /** + * Output only. This value contains the storage location of transactional logs + * used to perform point-in-time recovery (PITR) for the database. + * + * Generated from protobuf field optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $transactional_log_storage_state = null; /** * Constructor. @@ -100,6 +107,9 @@ class BackupConfiguration extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Int32Value $transaction_log_retention_days * The number of days of transaction logs we retain for point in time * restore, from 1-7. + * @type int $transactional_log_storage_state + * Output only. This value contains the storage location of transactional logs + * used to perform point-in-time recovery (PITR) for the database. * } */ public function __construct($data = NULL) { @@ -546,5 +556,43 @@ public function setTransactionLogRetentionDaysValue($var) $this->writeWrapperValue("transaction_log_retention_days", $var); return $this;} + /** + * Output only. This value contains the storage location of transactional logs + * used to perform point-in-time recovery (PITR) for the database. + * + * Generated from protobuf field optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTransactionalLogStorageState() + { + return isset($this->transactional_log_storage_state) ? $this->transactional_log_storage_state : 0; + } + + public function hasTransactionalLogStorageState() + { + return isset($this->transactional_log_storage_state); + } + + public function clearTransactionalLogStorageState() + { + unset($this->transactional_log_storage_state); + } + + /** + * Output only. This value contains the storage location of transactional logs + * used to perform point-in-time recovery (PITR) for the database. + * + * Generated from protobuf field optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTransactionalLogStorageState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1\BackupConfiguration\TransactionalLogStorageState::class); + $this->transactional_log_storage_state = $var; + + return $this; + } + } diff --git a/SqlAdmin/src/V1/BackupConfiguration/TransactionalLogStorageState.php b/SqlAdmin/src/V1/BackupConfiguration/TransactionalLogStorageState.php new file mode 100644 index 000000000000..a97dca030c97 --- /dev/null +++ b/SqlAdmin/src/V1/BackupConfiguration/TransactionalLogStorageState.php @@ -0,0 +1,83 @@ +google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState + */ +class TransactionalLogStorageState +{ + /** + * Unspecified. + * + * Generated from protobuf enum TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + */ + const TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + /** + * The transaction logs used for PITR for the instance are stored + * on a data disk. + * + * Generated from protobuf enum DISK = 1; + */ + const DISK = 1; + /** + * The transaction logs used for PITR for the instance are switching from + * being stored on a data disk to being stored in Cloud Storage. + * Only applicable to MySQL. + * + * Generated from protobuf enum SWITCHING_TO_CLOUD_STORAGE = 2; + */ + const SWITCHING_TO_CLOUD_STORAGE = 2; + /** + * The transaction logs used for PITR for the instance are now stored + * in Cloud Storage. Previously, they were stored on a data disk. + * Only applicable to MySQL. + * + * Generated from protobuf enum SWITCHED_TO_CLOUD_STORAGE = 3; + */ + const SWITCHED_TO_CLOUD_STORAGE = 3; + /** + * The transaction logs used for PITR for the instance are stored in + * Cloud Storage. Only applicable to MySQL and PostgreSQL. + * + * Generated from protobuf enum CLOUD_STORAGE = 4; + */ + const CLOUD_STORAGE = 4; + + private static $valueToName = [ + self::TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED => 'TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED', + self::DISK => 'DISK', + self::SWITCHING_TO_CLOUD_STORAGE => 'SWITCHING_TO_CLOUD_STORAGE', + self::SWITCHED_TO_CLOUD_STORAGE => 'SWITCHED_TO_CLOUD_STORAGE', + self::CLOUD_STORAGE => 'CLOUD_STORAGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/SqlAdmin/src/V1/Client/SqlInstancesServiceClient.php b/SqlAdmin/src/V1/Client/SqlInstancesServiceClient.php index 1a4e696cdb2f..f96067b17d86 100644 --- a/SqlAdmin/src/V1/Client/SqlInstancesServiceClient.php +++ b/SqlAdmin/src/V1/Client/SqlInstancesServiceClient.php @@ -35,6 +35,8 @@ use Google\Cloud\Sql\V1\InstancesListResponse; use Google\Cloud\Sql\V1\InstancesListServerCasResponse; use Google\Cloud\Sql\V1\Operation; +use Google\Cloud\Sql\V1\SqlInstancesAcquireSsrsLeaseRequest; +use Google\Cloud\Sql\V1\SqlInstancesAcquireSsrsLeaseResponse; use Google\Cloud\Sql\V1\SqlInstancesAddServerCaRequest; use Google\Cloud\Sql\V1\SqlInstancesCloneRequest; use Google\Cloud\Sql\V1\SqlInstancesCreateEphemeralCertRequest; @@ -56,6 +58,8 @@ use Google\Cloud\Sql\V1\SqlInstancesPerformDiskShrinkRequest; use Google\Cloud\Sql\V1\SqlInstancesPromoteReplicaRequest; use Google\Cloud\Sql\V1\SqlInstancesReencryptRequest; +use Google\Cloud\Sql\V1\SqlInstancesReleaseSsrsLeaseRequest; +use Google\Cloud\Sql\V1\SqlInstancesReleaseSsrsLeaseResponse; use Google\Cloud\Sql\V1\SqlInstancesRescheduleMaintenanceRequest; use Google\Cloud\Sql\V1\SqlInstancesResetReplicaSizeRequest; use Google\Cloud\Sql\V1\SqlInstancesResetSslConfigRequest; @@ -79,6 +83,7 @@ * This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. * + * @method PromiseInterface acquireSsrsLeaseAsync(SqlInstancesAcquireSsrsLeaseRequest $request, array $optionalArgs = []) * @method PromiseInterface addServerCaAsync(SqlInstancesAddServerCaRequest $request, array $optionalArgs = []) * @method PromiseInterface cloneAsync(SqlInstancesCloneRequest $request, array $optionalArgs = []) * @method PromiseInterface createEphemeralAsync(SqlInstancesCreateEphemeralCertRequest $request, array $optionalArgs = []) @@ -98,6 +103,7 @@ * @method PromiseInterface performDiskShrinkAsync(SqlInstancesPerformDiskShrinkRequest $request, array $optionalArgs = []) * @method PromiseInterface promoteReplicaAsync(SqlInstancesPromoteReplicaRequest $request, array $optionalArgs = []) * @method PromiseInterface reencryptAsync(SqlInstancesReencryptRequest $request, array $optionalArgs = []) + * @method PromiseInterface releaseSsrsLeaseAsync(SqlInstancesReleaseSsrsLeaseRequest $request, array $optionalArgs = []) * @method PromiseInterface rescheduleMaintenanceAsync(SqlInstancesRescheduleMaintenanceRequest $request, array $optionalArgs = []) * @method PromiseInterface resetReplicaSizeAsync(SqlInstancesResetReplicaSizeRequest $request, array $optionalArgs = []) * @method PromiseInterface resetSslConfigAsync(SqlInstancesResetSslConfigRequest $request, array $optionalArgs = []) @@ -231,6 +237,32 @@ public function __call($method, $args) return call_user_func_array([$this, 'startAsyncCall'], $args); } + /** + * Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + * + * The async variant is {@see SqlInstancesServiceClient::acquireSsrsLeaseAsync()} . + * + * @example samples/V1/SqlInstancesServiceClient/acquire_ssrs_lease.php + * + * @param SqlInstancesAcquireSsrsLeaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SqlInstancesAcquireSsrsLeaseResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function acquireSsrsLease(SqlInstancesAcquireSsrsLeaseRequest $request, array $callOptions = []): SqlInstancesAcquireSsrsLeaseResponse + { + return $this->startApiCall('AcquireSsrsLease', $request, $callOptions)->wait(); + } + /** * Adds a new trusted Certificate Authority (CA) version for the specified * instance. Required to prepare for a certificate rotation. If a CA version @@ -701,7 +733,8 @@ public function performDiskShrink(SqlInstancesPerformDiskShrinkRequest $request, } /** - * Promotes the read replica instance to be a stand-alone Cloud SQL instance. + * Promotes the read replica instance to be an independent Cloud SQL + * primary instance. * Using this operation might cause your instance to restart. * * The async variant is {@see SqlInstancesServiceClient::promoteReplicaAsync()} . @@ -753,6 +786,32 @@ public function reencrypt(SqlInstancesReencryptRequest $request, array $callOpti return $this->startApiCall('Reencrypt', $request, $callOptions)->wait(); } + /** + * Release a lease for the setup of SQL Server Reporting Services (SSRS). + * + * The async variant is {@see SqlInstancesServiceClient::releaseSsrsLeaseAsync()} . + * + * @example samples/V1/SqlInstancesServiceClient/release_ssrs_lease.php + * + * @param SqlInstancesReleaseSsrsLeaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SqlInstancesReleaseSsrsLeaseResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function releaseSsrsLease(SqlInstancesReleaseSsrsLeaseRequest $request, array $callOptions = []): SqlInstancesReleaseSsrsLeaseResponse + { + return $this->startApiCall('ReleaseSsrsLease', $request, $callOptions)->wait(); + } + /** * Reschedules the maintenance on the given instance. * @@ -993,7 +1052,8 @@ public function stopReplica(SqlInstancesStopReplicaRequest $request, array $call } /** - * Switches over from the primary instance to the replica instance. + * Switches over from the primary instance to the designated DR replica + * instance. * * The async variant is {@see SqlInstancesServiceClient::switchoverAsync()} . * diff --git a/SqlAdmin/src/V1/DatabaseInstance.php b/SqlAdmin/src/V1/DatabaseInstance.php index 24a20ebd6da7..050f2127f1fe 100644 --- a/SqlAdmin/src/V1/DatabaseInstance.php +++ b/SqlAdmin/src/V1/DatabaseInstance.php @@ -300,6 +300,21 @@ class DatabaseInstance extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $write_endpoint = null; + /** + * Optional. A primary instance and disaster recovery (DR) replica pair. + * A DR replica is a cross-region replica that you designate + * for failover in the event that the primary instance + * experiences regional failure. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $replication_cluster = null; + /** + * Gemini instance configuration. + * + * Generated from protobuf field optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + private $gemini_config = null; /** * Constructor. @@ -425,6 +440,13 @@ class DatabaseInstance extends \Google\Protobuf\Internal\Message * Output only. DEPRECATED: please use write_endpoint instead. * @type string $write_endpoint * Output only. The dns name of the primary instance in a replication group. + * @type \Google\Cloud\Sql\V1\ReplicationCluster $replication_cluster + * Optional. A primary instance and disaster recovery (DR) replica pair. + * A DR replica is a cross-region replica that you designate + * for failover in the event that the primary instance + * experiences regional failure. Only applicable to MySQL. + * @type \Google\Cloud\Sql\V1\GeminiInstanceConfig $gemini_config + * Gemini instance configuration. * } */ public function __construct($data = NULL) { @@ -1865,5 +1887,83 @@ public function setWriteEndpoint($var) return $this; } + /** + * Optional. A primary instance and disaster recovery (DR) replica pair. + * A DR replica is a cross-region replica that you designate + * for failover in the event that the primary instance + * experiences regional failure. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Sql\V1\ReplicationCluster|null + */ + public function getReplicationCluster() + { + return $this->replication_cluster; + } + + public function hasReplicationCluster() + { + return isset($this->replication_cluster); + } + + public function clearReplicationCluster() + { + unset($this->replication_cluster); + } + + /** + * Optional. A primary instance and disaster recovery (DR) replica pair. + * A DR replica is a cross-region replica that you designate + * for failover in the event that the primary instance + * experiences regional failure. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Sql\V1\ReplicationCluster $var + * @return $this + */ + public function setReplicationCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1\ReplicationCluster::class); + $this->replication_cluster = $var; + + return $this; + } + + /** + * Gemini instance configuration. + * + * Generated from protobuf field optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + * @return \Google\Cloud\Sql\V1\GeminiInstanceConfig|null + */ + public function getGeminiConfig() + { + return $this->gemini_config; + } + + public function hasGeminiConfig() + { + return isset($this->gemini_config); + } + + public function clearGeminiConfig() + { + unset($this->gemini_config); + } + + /** + * Gemini instance configuration. + * + * Generated from protobuf field optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + * @param \Google\Cloud\Sql\V1\GeminiInstanceConfig $var + * @return $this + */ + public function setGeminiConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1\GeminiInstanceConfig::class); + $this->gemini_config = $var; + + return $this; + } + } diff --git a/SqlAdmin/src/V1/GeminiInstanceConfig.php b/SqlAdmin/src/V1/GeminiInstanceConfig.php new file mode 100644 index 000000000000..8f866b2377ab --- /dev/null +++ b/SqlAdmin/src/V1/GeminiInstanceConfig.php @@ -0,0 +1,297 @@ +google.cloud.sql.v1.GeminiInstanceConfig + */ +class GeminiInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Whether Gemini is enabled. + * + * Generated from protobuf field optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $entitled = null; + /** + * Output only. Whether the vacuum management is enabled. + * + * Generated from protobuf field optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $google_vacuum_mgmt_enabled = null; + /** + * Output only. Whether canceling the out-of-memory (OOM) session is enabled. + * + * Generated from protobuf field optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $oom_session_cancel_enabled = null; + /** + * Output only. Whether the active query is enabled. + * + * Generated from protobuf field optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $active_query_enabled = null; + /** + * Output only. Whether the index advisor is enabled. + * + * Generated from protobuf field optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $index_advisor_enabled = null; + /** + * Output only. Whether the flag recommender is enabled. + * + * Generated from protobuf field optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $flag_recommender_enabled = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $entitled + * Output only. Whether Gemini is enabled. + * @type bool $google_vacuum_mgmt_enabled + * Output only. Whether the vacuum management is enabled. + * @type bool $oom_session_cancel_enabled + * Output only. Whether canceling the out-of-memory (OOM) session is enabled. + * @type bool $active_query_enabled + * Output only. Whether the active query is enabled. + * @type bool $index_advisor_enabled + * Output only. Whether the index advisor is enabled. + * @type bool $flag_recommender_enabled + * Output only. Whether the flag recommender is enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlInstances::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Whether Gemini is enabled. + * + * Generated from protobuf field optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getEntitled() + { + return isset($this->entitled) ? $this->entitled : false; + } + + public function hasEntitled() + { + return isset($this->entitled); + } + + public function clearEntitled() + { + unset($this->entitled); + } + + /** + * Output only. Whether Gemini is enabled. + * + * Generated from protobuf field optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setEntitled($var) + { + GPBUtil::checkBool($var); + $this->entitled = $var; + + return $this; + } + + /** + * Output only. Whether the vacuum management is enabled. + * + * Generated from protobuf field optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getGoogleVacuumMgmtEnabled() + { + return isset($this->google_vacuum_mgmt_enabled) ? $this->google_vacuum_mgmt_enabled : false; + } + + public function hasGoogleVacuumMgmtEnabled() + { + return isset($this->google_vacuum_mgmt_enabled); + } + + public function clearGoogleVacuumMgmtEnabled() + { + unset($this->google_vacuum_mgmt_enabled); + } + + /** + * Output only. Whether the vacuum management is enabled. + * + * Generated from protobuf field optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setGoogleVacuumMgmtEnabled($var) + { + GPBUtil::checkBool($var); + $this->google_vacuum_mgmt_enabled = $var; + + return $this; + } + + /** + * Output only. Whether canceling the out-of-memory (OOM) session is enabled. + * + * Generated from protobuf field optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getOomSessionCancelEnabled() + { + return isset($this->oom_session_cancel_enabled) ? $this->oom_session_cancel_enabled : false; + } + + public function hasOomSessionCancelEnabled() + { + return isset($this->oom_session_cancel_enabled); + } + + public function clearOomSessionCancelEnabled() + { + unset($this->oom_session_cancel_enabled); + } + + /** + * Output only. Whether canceling the out-of-memory (OOM) session is enabled. + * + * Generated from protobuf field optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setOomSessionCancelEnabled($var) + { + GPBUtil::checkBool($var); + $this->oom_session_cancel_enabled = $var; + + return $this; + } + + /** + * Output only. Whether the active query is enabled. + * + * Generated from protobuf field optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getActiveQueryEnabled() + { + return isset($this->active_query_enabled) ? $this->active_query_enabled : false; + } + + public function hasActiveQueryEnabled() + { + return isset($this->active_query_enabled); + } + + public function clearActiveQueryEnabled() + { + unset($this->active_query_enabled); + } + + /** + * Output only. Whether the active query is enabled. + * + * Generated from protobuf field optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setActiveQueryEnabled($var) + { + GPBUtil::checkBool($var); + $this->active_query_enabled = $var; + + return $this; + } + + /** + * Output only. Whether the index advisor is enabled. + * + * Generated from protobuf field optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getIndexAdvisorEnabled() + { + return isset($this->index_advisor_enabled) ? $this->index_advisor_enabled : false; + } + + public function hasIndexAdvisorEnabled() + { + return isset($this->index_advisor_enabled); + } + + public function clearIndexAdvisorEnabled() + { + unset($this->index_advisor_enabled); + } + + /** + * Output only. Whether the index advisor is enabled. + * + * Generated from protobuf field optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setIndexAdvisorEnabled($var) + { + GPBUtil::checkBool($var); + $this->index_advisor_enabled = $var; + + return $this; + } + + /** + * Output only. Whether the flag recommender is enabled. + * + * Generated from protobuf field optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getFlagRecommenderEnabled() + { + return isset($this->flag_recommender_enabled) ? $this->flag_recommender_enabled : false; + } + + public function hasFlagRecommenderEnabled() + { + return isset($this->flag_recommender_enabled); + } + + public function clearFlagRecommenderEnabled() + { + unset($this->flag_recommender_enabled); + } + + /** + * Output only. Whether the flag recommender is enabled. + * + * Generated from protobuf field optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setFlagRecommenderEnabled($var) + { + GPBUtil::checkBool($var); + $this->flag_recommender_enabled = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1/ImportContext.php b/SqlAdmin/src/V1/ImportContext.php index 72721ba71fc7..a0a6bdf601d4 100644 --- a/SqlAdmin/src/V1/ImportContext.php +++ b/SqlAdmin/src/V1/ImportContext.php @@ -64,6 +64,12 @@ class ImportContext extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; */ private $bak_import_options = null; + /** + * Optional. Options for importing data from SQL statements. + * + * Generated from protobuf field .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sql_import_options = null; /** * Constructor. @@ -92,6 +98,8 @@ class ImportContext extends \Google\Protobuf\Internal\Message * The PostgreSQL user for this import operation. PostgreSQL instances only. * @type \Google\Cloud\Sql\V1\ImportContext\SqlBakImportOptions $bak_import_options * Import parameters specific to SQL Server .BAK files + * @type \Google\Cloud\Sql\V1\ImportContext\SqlImportOptions $sql_import_options + * Optional. Options for importing data from SQL statements. * } */ public function __construct($data = NULL) { @@ -315,5 +323,41 @@ public function setBakImportOptions($var) return $this; } + /** + * Optional. Options for importing data from SQL statements. + * + * Generated from protobuf field .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Sql\V1\ImportContext\SqlImportOptions|null + */ + public function getSqlImportOptions() + { + return $this->sql_import_options; + } + + public function hasSqlImportOptions() + { + return isset($this->sql_import_options); + } + + public function clearSqlImportOptions() + { + unset($this->sql_import_options); + } + + /** + * Optional. Options for importing data from SQL statements. + * + * Generated from protobuf field .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Sql\V1\ImportContext\SqlImportOptions $var + * @return $this + */ + public function setSqlImportOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1\ImportContext\SqlImportOptions::class); + $this->sql_import_options = $var; + + return $this; + } + } diff --git a/SqlAdmin/src/V1/ImportContext/SqlImportOptions.php b/SqlAdmin/src/V1/ImportContext/SqlImportOptions.php new file mode 100644 index 000000000000..a1efd5fe7bac --- /dev/null +++ b/SqlAdmin/src/V1/ImportContext/SqlImportOptions.php @@ -0,0 +1,174 @@ +google.cloud.sql.v1.ImportContext.SqlImportOptions + */ +class SqlImportOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $threads = null; + /** + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $parallel = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Int32Value $threads + * Optional. The number of threads to use for parallel import. + * @type \Google\Protobuf\BoolValue $parallel + * Optional. Whether or not the import should be parallel. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlResources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getThreads() + { + return $this->threads; + } + + public function hasThreads() + { + return isset($this->threads); + } + + public function clearThreads() + { + unset($this->threads); + } + + /** + * Returns the unboxed value from getThreads() + + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|null + */ + public function getThreadsValue() + { + return $this->readWrapperValue("threads"); + } + + /** + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setThreads($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->threads = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|null $var + * @return $this + */ + public function setThreadsValue($var) + { + $this->writeWrapperValue("threads", $var); + return $this;} + + /** + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getParallel() + { + return $this->parallel; + } + + public function hasParallel() + { + return isset($this->parallel); + } + + public function clearParallel() + { + unset($this->parallel); + } + + /** + * Returns the unboxed value from getParallel() + + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool|null + */ + public function getParallelValue() + { + return $this->readWrapperValue("parallel"); + } + + /** + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setParallel($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->parallel = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool|null $var + * @return $this + */ + public function setParallelValue($var) + { + $this->writeWrapperValue("parallel", $var); + return $this;} + +} + + diff --git a/SqlAdmin/src/V1/InstancesAcquireSsrsLeaseRequest.php b/SqlAdmin/src/V1/InstancesAcquireSsrsLeaseRequest.php new file mode 100644 index 000000000000..fce47a781af6 --- /dev/null +++ b/SqlAdmin/src/V1/InstancesAcquireSsrsLeaseRequest.php @@ -0,0 +1,77 @@ +google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest + */ +class InstancesAcquireSsrsLeaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Contains details about the acquire SSRS lease operation. + * + * Generated from protobuf field .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + private $acquire_ssrs_lease_context = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Sql\V1\AcquireSsrsLeaseContext $acquire_ssrs_lease_context + * Contains details about the acquire SSRS lease operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlInstances::initOnce(); + parent::__construct($data); + } + + /** + * Contains details about the acquire SSRS lease operation. + * + * Generated from protobuf field .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * @return \Google\Cloud\Sql\V1\AcquireSsrsLeaseContext|null + */ + public function getAcquireSsrsLeaseContext() + { + return $this->acquire_ssrs_lease_context; + } + + public function hasAcquireSsrsLeaseContext() + { + return isset($this->acquire_ssrs_lease_context); + } + + public function clearAcquireSsrsLeaseContext() + { + unset($this->acquire_ssrs_lease_context); + } + + /** + * Contains details about the acquire SSRS lease operation. + * + * Generated from protobuf field .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * @param \Google\Cloud\Sql\V1\AcquireSsrsLeaseContext $var + * @return $this + */ + public function setAcquireSsrsLeaseContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1\AcquireSsrsLeaseContext::class); + $this->acquire_ssrs_lease_context = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1/IpConfiguration.php b/SqlAdmin/src/V1/IpConfiguration.php index b236a52ac707..c85421072b41 100644 --- a/SqlAdmin/src/V1/IpConfiguration.php +++ b/SqlAdmin/src/V1/IpConfiguration.php @@ -31,7 +31,7 @@ class IpConfiguration extends \Google\Protobuf\Internal\Message */ private $private_network = ''; /** - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -70,20 +70,22 @@ class IpConfiguration extends \Google\Protobuf\Internal\Message */ private $enable_private_path_for_google_cloud_services = null; /** - * Specify how SSL/TLS is enforced in database connections. MySQL and - * PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag - * for backward compatibility, then only the following value pairs are valid: + * Specify how SSL/TLS is enforced in database connections. If you must use + * the `require_ssl` flag for backward compatibility, then only the following + * value pairs are valid: + * For PostgreSQL and MySQL: * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` - * The value of `ssl_mode` gets priority over the value of `require_ssl`. For - * example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`, - * the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the - * `require_ssl=false` means accept both non-SSL and SSL connections. MySQL - * and PostgreSQL databases respect `ssl_mode` in this case and accept only - * SSL connections. - * SQL Server uses the `require_ssl` flag. You can set the value for this flag - * to `true` or `false`. + * For SQL Server: + * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + * The value of `ssl_mode` has priority over the value of `require_ssl`. + * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + * connections, while `require_ssl=false` means accept both non-SSL + * and SSL connections. In this case, MySQL and PostgreSQL databases respect + * `ssl_mode` and accepts only SSL connections. * * Generated from protobuf field .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; */ @@ -109,7 +111,7 @@ class IpConfiguration extends \Google\Protobuf\Internal\Message * `/projects/myProject/global/networks/default`. This setting can * be updated, but it cannot be removed after it is set. * @type \Google\Protobuf\BoolValue $require_ssl - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -132,20 +134,22 @@ class IpConfiguration extends \Google\Protobuf\Internal\Message * Controls connectivity to private IP instances from Google services, * such as BigQuery. * @type int $ssl_mode - * Specify how SSL/TLS is enforced in database connections. MySQL and - * PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag - * for backward compatibility, then only the following value pairs are valid: + * Specify how SSL/TLS is enforced in database connections. If you must use + * the `require_ssl` flag for backward compatibility, then only the following + * value pairs are valid: + * For PostgreSQL and MySQL: * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` - * The value of `ssl_mode` gets priority over the value of `require_ssl`. For - * example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`, - * the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the - * `require_ssl=false` means accept both non-SSL and SSL connections. MySQL - * and PostgreSQL databases respect `ssl_mode` in this case and accept only - * SSL connections. - * SQL Server uses the `require_ssl` flag. You can set the value for this flag - * to `true` or `false`. + * For SQL Server: + * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + * The value of `ssl_mode` has priority over the value of `require_ssl`. + * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + * connections, while `require_ssl=false` means accept both non-SSL + * and SSL connections. In this case, MySQL and PostgreSQL databases respect + * `ssl_mode` and accepts only SSL connections. * @type \Google\Cloud\Sql\V1\PscConfig $psc_config * PSC settings for this instance. * } @@ -251,7 +255,7 @@ public function setPrivateNetwork($var) } /** - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -281,7 +285,7 @@ public function clearRequireSsl() /** * Returns the unboxed value from getRequireSsl() - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -299,7 +303,7 @@ public function getRequireSslValue() } /** - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -323,7 +327,7 @@ public function setRequireSsl($var) /** * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -475,20 +479,22 @@ public function setEnablePrivatePathForGoogleCloudServicesValue($var) return $this;} /** - * Specify how SSL/TLS is enforced in database connections. MySQL and - * PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag - * for backward compatibility, then only the following value pairs are valid: + * Specify how SSL/TLS is enforced in database connections. If you must use + * the `require_ssl` flag for backward compatibility, then only the following + * value pairs are valid: + * For PostgreSQL and MySQL: * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` - * The value of `ssl_mode` gets priority over the value of `require_ssl`. For - * example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`, - * the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the - * `require_ssl=false` means accept both non-SSL and SSL connections. MySQL - * and PostgreSQL databases respect `ssl_mode` in this case and accept only - * SSL connections. - * SQL Server uses the `require_ssl` flag. You can set the value for this flag - * to `true` or `false`. + * For SQL Server: + * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + * The value of `ssl_mode` has priority over the value of `require_ssl`. + * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + * connections, while `require_ssl=false` means accept both non-SSL + * and SSL connections. In this case, MySQL and PostgreSQL databases respect + * `ssl_mode` and accepts only SSL connections. * * Generated from protobuf field .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; * @return int @@ -499,20 +505,22 @@ public function getSslMode() } /** - * Specify how SSL/TLS is enforced in database connections. MySQL and - * PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag - * for backward compatibility, then only the following value pairs are valid: + * Specify how SSL/TLS is enforced in database connections. If you must use + * the `require_ssl` flag for backward compatibility, then only the following + * value pairs are valid: + * For PostgreSQL and MySQL: * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` - * The value of `ssl_mode` gets priority over the value of `require_ssl`. For - * example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`, - * the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the - * `require_ssl=false` means accept both non-SSL and SSL connections. MySQL - * and PostgreSQL databases respect `ssl_mode` in this case and accept only - * SSL connections. - * SQL Server uses the `require_ssl` flag. You can set the value for this flag - * to `true` or `false`. + * For SQL Server: + * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + * The value of `ssl_mode` has priority over the value of `require_ssl`. + * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + * connections, while `require_ssl=false` means accept both non-SSL + * and SSL connections. In this case, MySQL and PostgreSQL databases respect + * `ssl_mode` and accepts only SSL connections. * * Generated from protobuf field .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; * @param int $var diff --git a/SqlAdmin/src/V1/IpConfiguration/SslMode.php b/SqlAdmin/src/V1/IpConfiguration/SslMode.php index c2ab1a42f77b..d043949c13a5 100644 --- a/SqlAdmin/src/V1/IpConfiguration/SslMode.php +++ b/SqlAdmin/src/V1/IpConfiguration/SslMode.php @@ -20,18 +20,21 @@ class SslMode */ const SSL_MODE_UNSPECIFIED = 0; /** - * Allow non-SSL/non-TLS and SSL/TLS connections. For SSL/TLS connections, - * the client certificate won't be verified. + * Allow non-SSL/non-TLS and SSL/TLS connections. + * For SSL connections to MySQL and PostgreSQL, the client certificate + * isn't verified. * When this value is used, the legacy `require_ssl` flag must be false or - * cleared to avoid the conflict between values of two flags. + * cleared to avoid a conflict between the values of the two flags. * * Generated from protobuf enum ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; */ const ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; /** * Only allow connections encrypted with SSL/TLS. + * For SSL connections to MySQL and PostgreSQL, the client certificate + * isn't verified. * When this value is used, the legacy `require_ssl` flag must be false or - * cleared to avoid the conflict between values of two flags. + * cleared to avoid a conflict between the values of the two flags. * * Generated from protobuf enum ENCRYPTED_ONLY = 2; */ @@ -48,6 +51,7 @@ class SslMode * [Cloud SQL * Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors) * to enforce client identity verification. + * Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server. * * Generated from protobuf enum TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; */ diff --git a/SqlAdmin/src/V1/Operation.php b/SqlAdmin/src/V1/Operation.php index cfb27ddb76ee..75d8ac25b4be 100644 --- a/SqlAdmin/src/V1/Operation.php +++ b/SqlAdmin/src/V1/Operation.php @@ -138,6 +138,12 @@ class Operation extends \Google\Protobuf\Internal\Message * Generated from protobuf field string target_project = 15; */ private $target_project = ''; + /** + * The context for acquire SSRS lease operation, if applicable. + * + * Generated from protobuf field .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + private $acquire_ssrs_lease_context = null; /** * Constructor. @@ -199,6 +205,8 @@ class Operation extends \Google\Protobuf\Internal\Message * The URI of this resource. * @type string $target_project * The project ID of the target instance related to this operation. + * @type \Google\Cloud\Sql\V1\AcquireSsrsLeaseContext $acquire_ssrs_lease_context + * The context for acquire SSRS lease operation, if applicable. * } */ public function __construct($data = NULL) { @@ -766,5 +774,41 @@ public function setTargetProject($var) return $this; } + /** + * The context for acquire SSRS lease operation, if applicable. + * + * Generated from protobuf field .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * @return \Google\Cloud\Sql\V1\AcquireSsrsLeaseContext|null + */ + public function getAcquireSsrsLeaseContext() + { + return $this->acquire_ssrs_lease_context; + } + + public function hasAcquireSsrsLeaseContext() + { + return isset($this->acquire_ssrs_lease_context); + } + + public function clearAcquireSsrsLeaseContext() + { + unset($this->acquire_ssrs_lease_context); + } + + /** + * The context for acquire SSRS lease operation, if applicable. + * + * Generated from protobuf field .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * @param \Google\Cloud\Sql\V1\AcquireSsrsLeaseContext $var + * @return $this + */ + public function setAcquireSsrsLeaseContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1\AcquireSsrsLeaseContext::class); + $this->acquire_ssrs_lease_context = $var; + + return $this; + } + } diff --git a/SqlAdmin/src/V1/Operation/SqlOperationType.php b/SqlAdmin/src/V1/Operation/SqlOperationType.php index f69079bcd620..a5952f8db3f4 100644 --- a/SqlAdmin/src/V1/Operation/SqlOperationType.php +++ b/SqlAdmin/src/V1/Operation/SqlOperationType.php @@ -245,6 +245,46 @@ class SqlOperationType * Generated from protobuf enum SWITCHOVER = 39; */ const SWITCHOVER = 39; + /** + * Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + * + * Generated from protobuf enum ACQUIRE_SSRS_LEASE = 42; + */ + const ACQUIRE_SSRS_LEASE = 42; + /** + * Release a lease for the setup of SQL Server Reporting Services (SSRS). + * + * Generated from protobuf enum RELEASE_SSRS_LEASE = 43; + */ + const RELEASE_SSRS_LEASE = 43; + /** + * Reconfigures old primary after a promote replica operation. Effect of a + * promote operation to the old primary is executed in this operation, + * asynchronously from the promote replica operation executed to the + * replica. + * + * Generated from protobuf enum RECONFIGURE_OLD_PRIMARY = 44; + */ + const RECONFIGURE_OLD_PRIMARY = 44; + /** + * Indicates that the instance, its read replicas, and its cascading + * replicas are in maintenance. Maintenance typically gets initiated on + * groups of replicas first, followed by the primary instance. For each + * instance, maintenance typically causes the instance to be unavailable for + * 1-3 minutes. + * + * Generated from protobuf enum CLUSTER_MAINTENANCE = 45; + */ + const CLUSTER_MAINTENANCE = 45; + /** + * Indicates that the instance (and any of its replicas) are currently in + * maintenance. This is initiated as a self-service request by using SSM. + * Maintenance typically causes the instance to be unavailable for 1-3 + * minutes. + * + * Generated from protobuf enum SELF_SERVICE_MAINTENANCE = 46; + */ + const SELF_SERVICE_MAINTENANCE = 46; private static $valueToName = [ self::SQL_OPERATION_TYPE_UNSPECIFIED => 'SQL_OPERATION_TYPE_UNSPECIFIED', @@ -286,6 +326,11 @@ class SqlOperationType self::AUTO_RESTART => 'AUTO_RESTART', self::REENCRYPT => 'REENCRYPT', self::SWITCHOVER => 'SWITCHOVER', + self::ACQUIRE_SSRS_LEASE => 'ACQUIRE_SSRS_LEASE', + self::RELEASE_SSRS_LEASE => 'RELEASE_SSRS_LEASE', + self::RECONFIGURE_OLD_PRIMARY => 'RECONFIGURE_OLD_PRIMARY', + self::CLUSTER_MAINTENANCE => 'CLUSTER_MAINTENANCE', + self::SELF_SERVICE_MAINTENANCE => 'SELF_SERVICE_MAINTENANCE', ]; public static function name($value) diff --git a/SqlAdmin/src/V1/ReplicationCluster.php b/SqlAdmin/src/V1/ReplicationCluster.php new file mode 100644 index 000000000000..a48327c2f49f --- /dev/null +++ b/SqlAdmin/src/V1/ReplicationCluster.php @@ -0,0 +1,128 @@ +google.cloud.sql.v1.ReplicationCluster + */ +class ReplicationCluster extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If the instance is a primary instance, then this field identifies + * the disaster recovery (DR) replica. A DR replica is an optional + * configuration for Enterprise Plus edition instances. If the instance is a + * read replica, then the field is not set. Set this field to a replica name + * to designate a DR replica for a primary instance. Remove the replica name + * to remove the DR replica designation. + * + * Generated from protobuf field string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $failover_dr_replica_name = ''; + /** + * Output only. Read-only field that indicates whether the replica is a DR + * replica. This field is not set if the instance is a primary instance. + * + * Generated from protobuf field bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $dr_replica = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $failover_dr_replica_name + * Optional. If the instance is a primary instance, then this field identifies + * the disaster recovery (DR) replica. A DR replica is an optional + * configuration for Enterprise Plus edition instances. If the instance is a + * read replica, then the field is not set. Set this field to a replica name + * to designate a DR replica for a primary instance. Remove the replica name + * to remove the DR replica designation. + * @type bool $dr_replica + * Output only. Read-only field that indicates whether the replica is a DR + * replica. This field is not set if the instance is a primary instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlInstances::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If the instance is a primary instance, then this field identifies + * the disaster recovery (DR) replica. A DR replica is an optional + * configuration for Enterprise Plus edition instances. If the instance is a + * read replica, then the field is not set. Set this field to a replica name + * to designate a DR replica for a primary instance. Remove the replica name + * to remove the DR replica designation. + * + * Generated from protobuf field string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFailoverDrReplicaName() + { + return $this->failover_dr_replica_name; + } + + /** + * Optional. If the instance is a primary instance, then this field identifies + * the disaster recovery (DR) replica. A DR replica is an optional + * configuration for Enterprise Plus edition instances. If the instance is a + * read replica, then the field is not set. Set this field to a replica name + * to designate a DR replica for a primary instance. Remove the replica name + * to remove the DR replica designation. + * + * Generated from protobuf field string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFailoverDrReplicaName($var) + { + GPBUtil::checkString($var, True); + $this->failover_dr_replica_name = $var; + + return $this; + } + + /** + * Output only. Read-only field that indicates whether the replica is a DR + * replica. This field is not set if the instance is a primary instance. + * + * Generated from protobuf field bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getDrReplica() + { + return $this->dr_replica; + } + + /** + * Output only. Read-only field that indicates whether the replica is a DR + * replica. This field is not set if the instance is a primary instance. + * + * Generated from protobuf field bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setDrReplica($var) + { + GPBUtil::checkBool($var); + $this->dr_replica = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1/Settings.php b/SqlAdmin/src/V1/Settings.php index c8f58188880f..f577cf3cf310 100644 --- a/SqlAdmin/src/V1/Settings.php +++ b/SqlAdmin/src/V1/Settings.php @@ -252,6 +252,15 @@ class Settings extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; */ private $data_cache_config = null; + /** + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $enable_google_ml_integration = null; /** * Constructor. @@ -365,6 +374,11 @@ class Settings extends \Google\Protobuf\Internal\Message * relevant only for SQL Server. * @type \Google\Cloud\Sql\V1\DataCacheConfig $data_cache_config * Configuration for data cache. + * @type \Google\Protobuf\BoolValue $enable_google_ml_integration + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. * } */ public function __construct($data = NULL) { @@ -1680,5 +1694,80 @@ public function setDataCacheConfig($var) return $this; } + /** + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getEnableGoogleMlIntegration() + { + return $this->enable_google_ml_integration; + } + + public function hasEnableGoogleMlIntegration() + { + return isset($this->enable_google_ml_integration); + } + + public function clearEnableGoogleMlIntegration() + { + unset($this->enable_google_ml_integration); + } + + /** + * Returns the unboxed value from getEnableGoogleMlIntegration() + + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool|null + */ + public function getEnableGoogleMlIntegrationValue() + { + return $this->readWrapperValue("enable_google_ml_integration"); + } + + /** + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setEnableGoogleMlIntegration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->enable_google_ml_integration = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool|null $var + * @return $this + */ + public function setEnableGoogleMlIntegrationValue($var) + { + $this->writeWrapperValue("enable_google_ml_integration", $var); + return $this;} + } diff --git a/SqlAdmin/src/V1/SqlDatabaseVersion.php b/SqlAdmin/src/V1/SqlDatabaseVersion.php index 89df701db588..43d42b800e11 100644 --- a/SqlAdmin/src/V1/SqlDatabaseVersion.php +++ b/SqlAdmin/src/V1/SqlDatabaseVersion.php @@ -187,6 +187,36 @@ class SqlDatabaseVersion * Generated from protobuf enum MYSQL_8_0_36 = 241; */ const MYSQL_8_0_36 = 241; + /** + * The database major version is MySQL 8.0 and the minor version is 37. + * + * Generated from protobuf enum MYSQL_8_0_37 = 355; + */ + const MYSQL_8_0_37 = 355; + /** + * The database major version is MySQL 8.0 and the minor version is 38. + * + * Generated from protobuf enum MYSQL_8_0_38 = 356; + */ + const MYSQL_8_0_38 = 356; + /** + * The database major version is MySQL 8.0 and the minor version is 39. + * + * Generated from protobuf enum MYSQL_8_0_39 = 357; + */ + const MYSQL_8_0_39 = 357; + /** + * The database major version is MySQL 8.0 and the minor version is 40. + * + * Generated from protobuf enum MYSQL_8_0_40 = 358; + */ + const MYSQL_8_0_40 = 358; + /** + * The database version is MySQL 8.4. + * + * Generated from protobuf enum MYSQL_8_4 = 398; + */ + const MYSQL_8_4 = 398; /** * The database version is SQL Server 2019 Standard. * @@ -266,6 +296,11 @@ class SqlDatabaseVersion self::MYSQL_8_0_34 => 'MYSQL_8_0_34', self::MYSQL_8_0_35 => 'MYSQL_8_0_35', self::MYSQL_8_0_36 => 'MYSQL_8_0_36', + self::MYSQL_8_0_37 => 'MYSQL_8_0_37', + self::MYSQL_8_0_38 => 'MYSQL_8_0_38', + self::MYSQL_8_0_39 => 'MYSQL_8_0_39', + self::MYSQL_8_0_40 => 'MYSQL_8_0_40', + self::MYSQL_8_4 => 'MYSQL_8_4', self::SQLSERVER_2019_STANDARD => 'SQLSERVER_2019_STANDARD', self::SQLSERVER_2019_ENTERPRISE => 'SQLSERVER_2019_ENTERPRISE', self::SQLSERVER_2019_EXPRESS => 'SQLSERVER_2019_EXPRESS', diff --git a/SqlAdmin/src/V1/SqlExternalSyncSettingError/SqlExternalSyncSettingErrorType.php b/SqlAdmin/src/V1/SqlExternalSyncSettingError/SqlExternalSyncSettingErrorType.php index 6298ed3e95bc..18c538dbf5e2 100644 --- a/SqlAdmin/src/V1/SqlExternalSyncSettingError/SqlExternalSyncSettingErrorType.php +++ b/SqlAdmin/src/V1/SqlExternalSyncSettingError/SqlExternalSyncSettingErrorType.php @@ -257,6 +257,34 @@ class SqlExternalSyncSettingErrorType * Generated from protobuf enum SUBSCRIPTION_CALCULATION_STATUS = 40; */ const SUBSCRIPTION_CALCULATION_STATUS = 40; + /** + * Count of subscriptions needed to sync source data for PostgreSQL + * database. + * + * Generated from protobuf enum PG_SUBSCRIPTION_COUNT = 41; + */ + const PG_SUBSCRIPTION_COUNT = 41; + /** + * Final parallel level that is used to do migration. + * + * Generated from protobuf enum PG_SYNC_PARALLEL_LEVEL = 42; + */ + const PG_SYNC_PARALLEL_LEVEL = 42; + /** + * The disk size of the replica instance is smaller than the data size of + * the source instance. + * + * Generated from protobuf enum INSUFFICIENT_DISK_SIZE = 43; + */ + const INSUFFICIENT_DISK_SIZE = 43; + /** + * The data size of the source instance is greater than 1 TB, the number of + * cores of the replica instance is less than 8, and the memory of the + * replica is less than 32 GB. + * + * Generated from protobuf enum INSUFFICIENT_MACHINE_TIER = 44; + */ + const INSUFFICIENT_MACHINE_TIER = 44; private static $valueToName = [ self::SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED => 'SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED', @@ -300,6 +328,10 @@ class SqlExternalSyncSettingErrorType self::SOURCE_MAX_SUBSCRIPTIONS => 'SOURCE_MAX_SUBSCRIPTIONS', self::UNABLE_TO_VERIFY_DEFINERS => 'UNABLE_TO_VERIFY_DEFINERS', self::SUBSCRIPTION_CALCULATION_STATUS => 'SUBSCRIPTION_CALCULATION_STATUS', + self::PG_SUBSCRIPTION_COUNT => 'PG_SUBSCRIPTION_COUNT', + self::PG_SYNC_PARALLEL_LEVEL => 'PG_SYNC_PARALLEL_LEVEL', + self::INSUFFICIENT_DISK_SIZE => 'INSUFFICIENT_DISK_SIZE', + self::INSUFFICIENT_MACHINE_TIER => 'INSUFFICIENT_MACHINE_TIER', ]; public static function name($value) diff --git a/SqlAdmin/src/V1/SqlInstancesAcquireSsrsLeaseRequest.php b/SqlAdmin/src/V1/SqlInstancesAcquireSsrsLeaseRequest.php new file mode 100644 index 000000000000..d66d621ebf52 --- /dev/null +++ b/SqlAdmin/src/V1/SqlInstancesAcquireSsrsLeaseRequest.php @@ -0,0 +1,161 @@ +google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest + */ +class SqlInstancesAcquireSsrsLeaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Cloud SQL instance ID. This doesn't include the project ID. It's + * composed of lowercase letters, numbers, and hyphens, and it must start with + * a letter. The total length must be 98 characters or less (Example: + * instance-id). + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instance = ''; + /** + * Required. Project ID of the project that contains the instance (Example: + * project-id). + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $project = ''; + /** + * Required. The request body. + * + * Generated from protobuf field .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + */ + private $body = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Required. Cloud SQL instance ID. This doesn't include the project ID. It's + * composed of lowercase letters, numbers, and hyphens, and it must start with + * a letter. The total length must be 98 characters or less (Example: + * instance-id). + * @type string $project + * Required. Project ID of the project that contains the instance (Example: + * project-id). + * @type \Google\Cloud\Sql\V1\InstancesAcquireSsrsLeaseRequest $body + * Required. The request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlInstances::initOnce(); + parent::__construct($data); + } + + /** + * Required. Cloud SQL instance ID. This doesn't include the project ID. It's + * composed of lowercase letters, numbers, and hyphens, and it must start with + * a letter. The total length must be 98 characters or less (Example: + * instance-id). + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Required. Cloud SQL instance ID. This doesn't include the project ID. It's + * composed of lowercase letters, numbers, and hyphens, and it must start with + * a letter. The total length must be 98 characters or less (Example: + * instance-id). + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Required. Project ID of the project that contains the instance (Example: + * project-id). + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. Project ID of the project that contains the instance (Example: + * project-id). + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * Required. The request body. + * + * Generated from protobuf field .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Sql\V1\InstancesAcquireSsrsLeaseRequest|null + */ + public function getBody() + { + return $this->body; + } + + public function hasBody() + { + return isset($this->body); + } + + public function clearBody() + { + unset($this->body); + } + + /** + * Required. The request body. + * + * Generated from protobuf field .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Sql\V1\InstancesAcquireSsrsLeaseRequest $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1\InstancesAcquireSsrsLeaseRequest::class); + $this->body = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1/SqlInstancesAcquireSsrsLeaseResponse.php b/SqlAdmin/src/V1/SqlInstancesAcquireSsrsLeaseResponse.php new file mode 100644 index 000000000000..f11b91f265b9 --- /dev/null +++ b/SqlAdmin/src/V1/SqlInstancesAcquireSsrsLeaseResponse.php @@ -0,0 +1,67 @@ +google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse + */ +class SqlInstancesAcquireSsrsLeaseResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier for this operation. + * + * Generated from protobuf field string operation_id = 1; + */ + private $operation_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation_id + * The unique identifier for this operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlInstances::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier for this operation. + * + * Generated from protobuf field string operation_id = 1; + * @return string + */ + public function getOperationId() + { + return $this->operation_id; + } + + /** + * The unique identifier for this operation. + * + * Generated from protobuf field string operation_id = 1; + * @param string $var + * @return $this + */ + public function setOperationId($var) + { + GPBUtil::checkString($var, True); + $this->operation_id = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1/SqlInstancesPromoteReplicaRequest.php b/SqlAdmin/src/V1/SqlInstancesPromoteReplicaRequest.php index b6fce696b5c8..9ae50161cfd1 100644 --- a/SqlAdmin/src/V1/SqlInstancesPromoteReplicaRequest.php +++ b/SqlAdmin/src/V1/SqlInstancesPromoteReplicaRequest.php @@ -28,9 +28,13 @@ class SqlInstancesPromoteReplicaRequest extends \Google\Protobuf\Internal\Messag */ private $project = ''; /** - * Set to true if the promote operation should attempt to re-add the original - * primary as a replica when it comes back online. Otherwise, if this value is - * false or not set, the original primary will be a standalone instance. + * Set to true to invoke a replica failover to the designated DR + * replica. As part of replica failover, the promote operation attempts + * to add the original primary instance as a replica of the promoted + * DR replica when the original primary instance comes back online. + * If set to false or not specified, then the original primary + * instance becomes an independent Cloud SQL primary instance. + * Only applicable to MySQL. * * Generated from protobuf field bool failover = 3; */ @@ -47,9 +51,13 @@ class SqlInstancesPromoteReplicaRequest extends \Google\Protobuf\Internal\Messag * @type string $project * ID of the project that contains the read replica. * @type bool $failover - * Set to true if the promote operation should attempt to re-add the original - * primary as a replica when it comes back online. Otherwise, if this value is - * false or not set, the original primary will be a standalone instance. + * Set to true to invoke a replica failover to the designated DR + * replica. As part of replica failover, the promote operation attempts + * to add the original primary instance as a replica of the promoted + * DR replica when the original primary instance comes back online. + * If set to false or not specified, then the original primary + * instance becomes an independent Cloud SQL primary instance. + * Only applicable to MySQL. * } */ public function __construct($data = NULL) { @@ -110,9 +118,13 @@ public function setProject($var) } /** - * Set to true if the promote operation should attempt to re-add the original - * primary as a replica when it comes back online. Otherwise, if this value is - * false or not set, the original primary will be a standalone instance. + * Set to true to invoke a replica failover to the designated DR + * replica. As part of replica failover, the promote operation attempts + * to add the original primary instance as a replica of the promoted + * DR replica when the original primary instance comes back online. + * If set to false or not specified, then the original primary + * instance becomes an independent Cloud SQL primary instance. + * Only applicable to MySQL. * * Generated from protobuf field bool failover = 3; * @return bool @@ -123,9 +135,13 @@ public function getFailover() } /** - * Set to true if the promote operation should attempt to re-add the original - * primary as a replica when it comes back online. Otherwise, if this value is - * false or not set, the original primary will be a standalone instance. + * Set to true to invoke a replica failover to the designated DR + * replica. As part of replica failover, the promote operation attempts + * to add the original primary instance as a replica of the promoted + * DR replica when the original primary instance comes back online. + * If set to false or not specified, then the original primary + * instance becomes an independent Cloud SQL primary instance. + * Only applicable to MySQL. * * Generated from protobuf field bool failover = 3; * @param bool $var diff --git a/SqlAdmin/src/V1/SqlInstancesReleaseSsrsLeaseRequest.php b/SqlAdmin/src/V1/SqlInstancesReleaseSsrsLeaseRequest.php new file mode 100644 index 000000000000..a4585bf0c915 --- /dev/null +++ b/SqlAdmin/src/V1/SqlInstancesReleaseSsrsLeaseRequest.php @@ -0,0 +1,113 @@ +google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest + */ +class SqlInstancesReleaseSsrsLeaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Cloud SQL instance ID. This doesn't include the project ID. + * The instance ID contains lowercase letters, numbers, and hyphens, and it + * must start with a letter. This ID can have a maximum length of 98 + * characters. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instance = ''; + /** + * Required. The project ID that contains the instance. + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $project = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Required. The Cloud SQL instance ID. This doesn't include the project ID. + * The instance ID contains lowercase letters, numbers, and hyphens, and it + * must start with a letter. This ID can have a maximum length of 98 + * characters. + * @type string $project + * Required. The project ID that contains the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlInstances::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Cloud SQL instance ID. This doesn't include the project ID. + * The instance ID contains lowercase letters, numbers, and hyphens, and it + * must start with a letter. This ID can have a maximum length of 98 + * characters. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Required. The Cloud SQL instance ID. This doesn't include the project ID. + * The instance ID contains lowercase letters, numbers, and hyphens, and it + * must start with a letter. This ID can have a maximum length of 98 + * characters. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Required. The project ID that contains the instance. + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. The project ID that contains the instance. + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1/SqlInstancesReleaseSsrsLeaseResponse.php b/SqlAdmin/src/V1/SqlInstancesReleaseSsrsLeaseResponse.php new file mode 100644 index 000000000000..3444ea0123af --- /dev/null +++ b/SqlAdmin/src/V1/SqlInstancesReleaseSsrsLeaseResponse.php @@ -0,0 +1,67 @@ +google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse + */ +class SqlInstancesReleaseSsrsLeaseResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier for this operation. + * + * Generated from protobuf field string operation_id = 1; + */ + private $operation_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation_id + * The unique identifier for this operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlInstances::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier for this operation. + * + * Generated from protobuf field string operation_id = 1; + * @return string + */ + public function getOperationId() + { + return $this->operation_id; + } + + /** + * The unique identifier for this operation. + * + * Generated from protobuf field string operation_id = 1; + * @param string $var + * @return $this + */ + public function setOperationId($var) + { + GPBUtil::checkString($var, True); + $this->operation_id = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1/SqlInstancesStartExternalSyncRequest.php b/SqlAdmin/src/V1/SqlInstancesStartExternalSyncRequest.php index 9cea84047e77..07c3e9efc3a4 100644 --- a/SqlAdmin/src/V1/SqlInstancesStartExternalSyncRequest.php +++ b/SqlAdmin/src/V1/SqlInstancesStartExternalSyncRequest.php @@ -46,6 +46,14 @@ class SqlInstancesStartExternalSyncRequest extends \Google\Protobuf\Internal\Mes * Generated from protobuf field .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; */ private $sync_parallel_level = 0; + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $migration_type = 0; protected $sync_config; /** @@ -67,6 +75,10 @@ class SqlInstancesStartExternalSyncRequest extends \Google\Protobuf\Internal\Mes * @type int $sync_parallel_level * Optional. Parallel level for initial data sync. Currently only applicable * for MySQL. + * @type int $migration_type + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. * } */ public function __construct($data = NULL) { @@ -237,6 +249,36 @@ public function setSyncParallelLevel($var) return $this; } + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMigrationType() + { + return $this->migration_type; + } + + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMigrationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1\SqlInstancesVerifyExternalSyncSettingsRequest\MigrationType::class); + $this->migration_type = $var; + + return $this; + } + /** * @return string */ diff --git a/SqlAdmin/src/V1/SqlInstancesVerifyExternalSyncSettingsRequest.php b/SqlAdmin/src/V1/SqlInstancesVerifyExternalSyncSettingsRequest.php index 55101b42f30d..3fe2e3aad08a 100644 --- a/SqlAdmin/src/V1/SqlInstancesVerifyExternalSyncSettingsRequest.php +++ b/SqlAdmin/src/V1/SqlInstancesVerifyExternalSyncSettingsRequest.php @@ -45,6 +45,21 @@ class SqlInstancesVerifyExternalSyncSettingsRequest extends \Google\Protobuf\Int * Generated from protobuf field bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ private $verify_replication_only = false; + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $migration_type = 0; + /** + * Optional. Parallel level for initial data sync. Only applicable for + * PostgreSQL. + * + * Generated from protobuf field .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sync_parallel_level = 0; protected $sync_config; /** @@ -65,6 +80,13 @@ class SqlInstancesVerifyExternalSyncSettingsRequest extends \Google\Protobuf\Int * Optional. Flag to verify settings required by replication setup only * @type \Google\Cloud\Sql\V1\MySqlSyncConfig $mysql_sync_config * Optional. MySQL-specific settings for start external sync. + * @type int $migration_type + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * @type int $sync_parallel_level + * Optional. Parallel level for initial data sync. Only applicable for + * PostgreSQL. * } */ public function __construct($data = NULL) { @@ -233,6 +255,64 @@ public function setMysqlSyncConfig($var) return $this; } + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMigrationType() + { + return $this->migration_type; + } + + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMigrationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1\SqlInstancesVerifyExternalSyncSettingsRequest\MigrationType::class); + $this->migration_type = $var; + + return $this; + } + + /** + * Optional. Parallel level for initial data sync. Only applicable for + * PostgreSQL. + * + * Generated from protobuf field .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSyncParallelLevel() + { + return $this->sync_parallel_level; + } + + /** + * Optional. Parallel level for initial data sync. Only applicable for + * PostgreSQL. + * + * Generated from protobuf field .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSyncParallelLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1\ExternalSyncParallelLevel::class); + $this->sync_parallel_level = $var; + + return $this; + } + /** * @return string */ diff --git a/SqlAdmin/src/V1/SqlInstancesVerifyExternalSyncSettingsRequest/MigrationType.php b/SqlAdmin/src/V1/SqlInstancesVerifyExternalSyncSettingsRequest/MigrationType.php new file mode 100644 index 000000000000..0460f7304052 --- /dev/null +++ b/SqlAdmin/src/V1/SqlInstancesVerifyExternalSyncSettingsRequest/MigrationType.php @@ -0,0 +1,63 @@ +google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + */ +class MigrationType +{ + /** + * Default value is a logical dump file-based migration + * + * Generated from protobuf enum MIGRATION_TYPE_UNSPECIFIED = 0; + */ + const MIGRATION_TYPE_UNSPECIFIED = 0; + /** + * Logical dump file-based migration + * + * Generated from protobuf enum LOGICAL = 1; + */ + const LOGICAL = 1; + /** + * Physical file-based migration + * + * Generated from protobuf enum PHYSICAL = 2; + */ + const PHYSICAL = 2; + + private static $valueToName = [ + self::MIGRATION_TYPE_UNSPECIFIED => 'MIGRATION_TYPE_UNSPECIFIED', + self::LOGICAL => 'LOGICAL', + self::PHYSICAL => 'PHYSICAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/SqlAdmin/src/V1/gapic_metadata.json b/SqlAdmin/src/V1/gapic_metadata.json index 82bcd33fb50f..a32b84c89910 100644 --- a/SqlAdmin/src/V1/gapic_metadata.json +++ b/SqlAdmin/src/V1/gapic_metadata.json @@ -139,6 +139,11 @@ "grpc": { "libraryClient": "SqlInstancesServiceGapicClient", "rpcs": { + "AcquireSsrsLease": { + "methods": [ + "acquireSsrsLease" + ] + }, "AddServerCa": { "methods": [ "addServerCa" @@ -234,6 +239,11 @@ "reencrypt" ] }, + "ReleaseSsrsLease": { + "methods": [ + "releaseSsrsLease" + ] + }, "RescheduleMaintenance": { "methods": [ "rescheduleMaintenance" diff --git a/SqlAdmin/src/V1/resources/sql_instances_service_client_config.json b/SqlAdmin/src/V1/resources/sql_instances_service_client_config.json index 31b90aad90a8..acab843eb19f 100644 --- a/SqlAdmin/src/V1/resources/sql_instances_service_client_config.json +++ b/SqlAdmin/src/V1/resources/sql_instances_service_client_config.json @@ -26,6 +26,11 @@ } }, "methods": { + "AcquireSsrsLease": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "AddServerCa": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -121,6 +126,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ReleaseSsrsLease": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "RescheduleMaintenance": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/SqlAdmin/src/V1/resources/sql_instances_service_descriptor_config.php b/SqlAdmin/src/V1/resources/sql_instances_service_descriptor_config.php index 9a8d5c2df561..8a91a4186997 100644 --- a/SqlAdmin/src/V1/resources/sql_instances_service_descriptor_config.php +++ b/SqlAdmin/src/V1/resources/sql_instances_service_descriptor_config.php @@ -23,6 +23,24 @@ return [ 'interfaces' => [ 'google.cloud.sql.v1.SqlInstancesService' => [ + 'AcquireSsrsLease' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Sql\V1\SqlInstancesAcquireSsrsLeaseResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], 'AddServerCa' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Sql\V1\Operation', @@ -353,6 +371,24 @@ ], ], ], + 'ReleaseSsrsLease' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Sql\V1\SqlInstancesReleaseSsrsLeaseResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], 'RescheduleMaintenance' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Sql\V1\Operation', diff --git a/SqlAdmin/src/V1/resources/sql_instances_service_rest_client_config.php b/SqlAdmin/src/V1/resources/sql_instances_service_rest_client_config.php index 6e5988acb669..29c60fc1eb5c 100644 --- a/SqlAdmin/src/V1/resources/sql_instances_service_rest_client_config.php +++ b/SqlAdmin/src/V1/resources/sql_instances_service_rest_client_config.php @@ -23,6 +23,23 @@ return [ 'interfaces' => [ 'google.cloud.sql.v1.SqlInstancesService' => [ + 'AcquireSsrsLease' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project}/instances/{instance}/acquireSsrsLease', + 'body' => 'body', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], 'AddServerCa' => [ 'method' => 'post', 'uriTemplate' => '/v1/projects/{project}/instances/{instance}/addServerCa', @@ -328,6 +345,22 @@ ], ], ], + 'ReleaseSsrsLease' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project}/instances/{instance}/releaseSsrsLease', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], 'RescheduleMaintenance' => [ 'method' => 'post', 'uriTemplate' => '/v1/projects/{project}/instances/{instance}/rescheduleMaintenance', diff --git a/SqlAdmin/src/V1beta4/AcquireSsrsLeaseContext.php b/SqlAdmin/src/V1beta4/AcquireSsrsLeaseContext.php new file mode 100644 index 000000000000..c8bf109437ef --- /dev/null +++ b/SqlAdmin/src/V1beta4/AcquireSsrsLeaseContext.php @@ -0,0 +1,217 @@ +google.cloud.sql.v1beta4.AcquireSsrsLeaseContext + */ +class AcquireSsrsLeaseContext extends \Google\Protobuf\Internal\Message +{ + /** + * The username to be used as the setup login to connect to the database + * server for SSRS setup. + * + * Generated from protobuf field optional string setup_login = 1; + */ + private $setup_login = null; + /** + * The username to be used as the service login to connect to the report + * database for SSRS setup. + * + * Generated from protobuf field optional string service_login = 2; + */ + private $service_login = null; + /** + * The report database to be used for the SSRS setup. + * + * Generated from protobuf field optional string report_database = 3; + */ + private $report_database = null; + /** + * Lease duration needed for the SSRS setup. + * + * Generated from protobuf field optional .google.protobuf.Duration duration = 4; + */ + private $duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $setup_login + * The username to be used as the setup login to connect to the database + * server for SSRS setup. + * @type string $service_login + * The username to be used as the service login to connect to the report + * database for SSRS setup. + * @type string $report_database + * The report database to be used for the SSRS setup. + * @type \Google\Protobuf\Duration $duration + * Lease duration needed for the SSRS setup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlResources::initOnce(); + parent::__construct($data); + } + + /** + * The username to be used as the setup login to connect to the database + * server for SSRS setup. + * + * Generated from protobuf field optional string setup_login = 1; + * @return string + */ + public function getSetupLogin() + { + return isset($this->setup_login) ? $this->setup_login : ''; + } + + public function hasSetupLogin() + { + return isset($this->setup_login); + } + + public function clearSetupLogin() + { + unset($this->setup_login); + } + + /** + * The username to be used as the setup login to connect to the database + * server for SSRS setup. + * + * Generated from protobuf field optional string setup_login = 1; + * @param string $var + * @return $this + */ + public function setSetupLogin($var) + { + GPBUtil::checkString($var, True); + $this->setup_login = $var; + + return $this; + } + + /** + * The username to be used as the service login to connect to the report + * database for SSRS setup. + * + * Generated from protobuf field optional string service_login = 2; + * @return string + */ + public function getServiceLogin() + { + return isset($this->service_login) ? $this->service_login : ''; + } + + public function hasServiceLogin() + { + return isset($this->service_login); + } + + public function clearServiceLogin() + { + unset($this->service_login); + } + + /** + * The username to be used as the service login to connect to the report + * database for SSRS setup. + * + * Generated from protobuf field optional string service_login = 2; + * @param string $var + * @return $this + */ + public function setServiceLogin($var) + { + GPBUtil::checkString($var, True); + $this->service_login = $var; + + return $this; + } + + /** + * The report database to be used for the SSRS setup. + * + * Generated from protobuf field optional string report_database = 3; + * @return string + */ + public function getReportDatabase() + { + return isset($this->report_database) ? $this->report_database : ''; + } + + public function hasReportDatabase() + { + return isset($this->report_database); + } + + public function clearReportDatabase() + { + unset($this->report_database); + } + + /** + * The report database to be used for the SSRS setup. + * + * Generated from protobuf field optional string report_database = 3; + * @param string $var + * @return $this + */ + public function setReportDatabase($var) + { + GPBUtil::checkString($var, True); + $this->report_database = $var; + + return $this; + } + + /** + * Lease duration needed for the SSRS setup. + * + * Generated from protobuf field optional .google.protobuf.Duration duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Lease duration needed for the SSRS setup. + * + * Generated from protobuf field optional .google.protobuf.Duration duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1beta4/BackupConfiguration.php b/SqlAdmin/src/V1beta4/BackupConfiguration.php index 1159732493b1..e2e55186241a 100644 --- a/SqlAdmin/src/V1beta4/BackupConfiguration.php +++ b/SqlAdmin/src/V1beta4/BackupConfiguration.php @@ -72,6 +72,13 @@ class BackupConfiguration extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; */ private $backup_retention_settings = null; + /** + * Output only. This value contains the storage location of transactional logs + * for the database for point-in-time recovery. + * + * Generated from protobuf field optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $transactional_log_storage_state = null; /** * Constructor. @@ -100,6 +107,9 @@ class BackupConfiguration extends \Google\Protobuf\Internal\Message * restore, from 1-7. * @type \Google\Cloud\Sql\V1beta4\BackupRetentionSettings $backup_retention_settings * Backup retention settings. + * @type int $transactional_log_storage_state + * Output only. This value contains the storage location of transactional logs + * for the database for point-in-time recovery. * } */ public function __construct($data = NULL) { @@ -546,5 +556,43 @@ public function setBackupRetentionSettings($var) return $this; } + /** + * Output only. This value contains the storage location of transactional logs + * for the database for point-in-time recovery. + * + * Generated from protobuf field optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTransactionalLogStorageState() + { + return isset($this->transactional_log_storage_state) ? $this->transactional_log_storage_state : 0; + } + + public function hasTransactionalLogStorageState() + { + return isset($this->transactional_log_storage_state); + } + + public function clearTransactionalLogStorageState() + { + unset($this->transactional_log_storage_state); + } + + /** + * Output only. This value contains the storage location of transactional logs + * for the database for point-in-time recovery. + * + * Generated from protobuf field optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTransactionalLogStorageState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1beta4\BackupConfiguration\TransactionalLogStorageState::class); + $this->transactional_log_storage_state = $var; + + return $this; + } + } diff --git a/SqlAdmin/src/V1beta4/BackupConfiguration/TransactionalLogStorageState.php b/SqlAdmin/src/V1beta4/BackupConfiguration/TransactionalLogStorageState.php new file mode 100644 index 000000000000..8c7c49af2bda --- /dev/null +++ b/SqlAdmin/src/V1beta4/BackupConfiguration/TransactionalLogStorageState.php @@ -0,0 +1,83 @@ +google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState + */ +class TransactionalLogStorageState +{ + /** + * Unspecified. + * + * Generated from protobuf enum TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + */ + const TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + /** + * The transaction logs used for PITR for the instance are stored + * on a data disk. + * + * Generated from protobuf enum DISK = 1; + */ + const DISK = 1; + /** + * The transaction logs used for PITR for the instance are switching from + * being stored on a data disk to being stored in Cloud Storage. + * Only applicable to MySQL. + * + * Generated from protobuf enum SWITCHING_TO_CLOUD_STORAGE = 2; + */ + const SWITCHING_TO_CLOUD_STORAGE = 2; + /** + * The transaction logs used for PITR for the instance are now stored + * in Cloud Storage. Previously, they were stored on a data disk. + * Only applicable to MySQL. + * + * Generated from protobuf enum SWITCHED_TO_CLOUD_STORAGE = 3; + */ + const SWITCHED_TO_CLOUD_STORAGE = 3; + /** + * The transaction logs used for PITR for the instance are stored in + * Cloud Storage. Only applicable to MySQL and PostgreSQL. + * + * Generated from protobuf enum CLOUD_STORAGE = 4; + */ + const CLOUD_STORAGE = 4; + + private static $valueToName = [ + self::TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED => 'TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED', + self::DISK => 'DISK', + self::SWITCHING_TO_CLOUD_STORAGE => 'SWITCHING_TO_CLOUD_STORAGE', + self::SWITCHED_TO_CLOUD_STORAGE => 'SWITCHED_TO_CLOUD_STORAGE', + self::CLOUD_STORAGE => 'CLOUD_STORAGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/SqlAdmin/src/V1beta4/DatabaseInstance.php b/SqlAdmin/src/V1beta4/DatabaseInstance.php index 23d73f832ac3..b6a470e9bf0a 100644 --- a/SqlAdmin/src/V1beta4/DatabaseInstance.php +++ b/SqlAdmin/src/V1beta4/DatabaseInstance.php @@ -302,6 +302,21 @@ class DatabaseInstance extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $write_endpoint = null; + /** + * A primary instance and disaster recovery (DR) replica pair. + * A DR replica is a cross-region replica that you designate + * for failover in the event that the primary instance + * experiences regional failure. Only applicable to MySQL. + * + * Generated from protobuf field optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + private $replication_cluster = null; + /** + * Gemini instance configuration. + * + * Generated from protobuf field optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + private $gemini_config = null; /** * Constructor. @@ -428,6 +443,13 @@ class DatabaseInstance extends \Google\Protobuf\Internal\Message * Output only. DEPRECATED: please use write_endpoint instead. * @type string $write_endpoint * Output only. The dns name of the primary instance in a replication group. + * @type \Google\Cloud\Sql\V1beta4\ReplicationCluster $replication_cluster + * A primary instance and disaster recovery (DR) replica pair. + * A DR replica is a cross-region replica that you designate + * for failover in the event that the primary instance + * experiences regional failure. Only applicable to MySQL. + * @type \Google\Cloud\Sql\V1beta4\GeminiInstanceConfig $gemini_config + * Gemini instance configuration. * } */ public function __construct($data = NULL) { @@ -1872,5 +1894,83 @@ public function setWriteEndpoint($var) return $this; } + /** + * A primary instance and disaster recovery (DR) replica pair. + * A DR replica is a cross-region replica that you designate + * for failover in the event that the primary instance + * experiences regional failure. Only applicable to MySQL. + * + * Generated from protobuf field optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + * @return \Google\Cloud\Sql\V1beta4\ReplicationCluster|null + */ + public function getReplicationCluster() + { + return $this->replication_cluster; + } + + public function hasReplicationCluster() + { + return isset($this->replication_cluster); + } + + public function clearReplicationCluster() + { + unset($this->replication_cluster); + } + + /** + * A primary instance and disaster recovery (DR) replica pair. + * A DR replica is a cross-region replica that you designate + * for failover in the event that the primary instance + * experiences regional failure. Only applicable to MySQL. + * + * Generated from protobuf field optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + * @param \Google\Cloud\Sql\V1beta4\ReplicationCluster $var + * @return $this + */ + public function setReplicationCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1beta4\ReplicationCluster::class); + $this->replication_cluster = $var; + + return $this; + } + + /** + * Gemini instance configuration. + * + * Generated from protobuf field optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + * @return \Google\Cloud\Sql\V1beta4\GeminiInstanceConfig|null + */ + public function getGeminiConfig() + { + return $this->gemini_config; + } + + public function hasGeminiConfig() + { + return isset($this->gemini_config); + } + + public function clearGeminiConfig() + { + unset($this->gemini_config); + } + + /** + * Gemini instance configuration. + * + * Generated from protobuf field optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + * @param \Google\Cloud\Sql\V1beta4\GeminiInstanceConfig $var + * @return $this + */ + public function setGeminiConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1beta4\GeminiInstanceConfig::class); + $this->gemini_config = $var; + + return $this; + } + } diff --git a/SqlAdmin/src/V1beta4/Gapic/SqlInstancesServiceGapicClient.php b/SqlAdmin/src/V1beta4/Gapic/SqlInstancesServiceGapicClient.php index 52e7011fee85..1539f631b1ea 100644 --- a/SqlAdmin/src/V1beta4/Gapic/SqlInstancesServiceGapicClient.php +++ b/SqlAdmin/src/V1beta4/Gapic/SqlInstancesServiceGapicClient.php @@ -35,6 +35,7 @@ use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\Sql\V1beta4\DatabaseInstance; +use Google\Cloud\Sql\V1beta4\InstancesAcquireSsrsLeaseRequest; use Google\Cloud\Sql\V1beta4\InstancesCloneRequest; use Google\Cloud\Sql\V1beta4\InstancesDemoteMasterRequest; use Google\Cloud\Sql\V1beta4\InstancesDemoteRequest; @@ -50,6 +51,8 @@ use Google\Cloud\Sql\V1beta4\MySqlSyncConfig; use Google\Cloud\Sql\V1beta4\Operation; use Google\Cloud\Sql\V1beta4\PerformDiskShrinkContext; +use Google\Cloud\Sql\V1beta4\SqlInstancesAcquireSsrsLeaseRequest; +use Google\Cloud\Sql\V1beta4\SqlInstancesAcquireSsrsLeaseResponse; use Google\Cloud\Sql\V1beta4\SqlInstancesAddServerCaRequest; use Google\Cloud\Sql\V1beta4\SqlInstancesCloneRequest; use Google\Cloud\Sql\V1beta4\SqlInstancesCreateEphemeralCertRequest; @@ -71,6 +74,8 @@ use Google\Cloud\Sql\V1beta4\SqlInstancesPerformDiskShrinkRequest; use Google\Cloud\Sql\V1beta4\SqlInstancesPromoteReplicaRequest; use Google\Cloud\Sql\V1beta4\SqlInstancesReencryptRequest; +use Google\Cloud\Sql\V1beta4\SqlInstancesReleaseSsrsLeaseRequest; +use Google\Cloud\Sql\V1beta4\SqlInstancesReleaseSsrsLeaseResponse; use Google\Cloud\Sql\V1beta4\SqlInstancesRescheduleMaintenanceRequest; use Google\Cloud\Sql\V1beta4\SqlInstancesRescheduleMaintenanceRequestBody; use Google\Cloud\Sql\V1beta4\SqlInstancesResetReplicaSizeRequest; @@ -85,6 +90,7 @@ use Google\Cloud\Sql\V1beta4\SqlInstancesTruncateLogRequest; use Google\Cloud\Sql\V1beta4\SqlInstancesUpdateRequest; use Google\Cloud\Sql\V1beta4\SqlInstancesVerifyExternalSyncSettingsRequest; +use Google\Cloud\Sql\V1beta4\SqlInstancesVerifyExternalSyncSettingsRequest\MigrationType; use Google\Cloud\Sql\V1beta4\SqlInstancesVerifyExternalSyncSettingsResponse; use Google\Cloud\Sql\V1beta4\SslCert; use Google\Cloud\Sql\V1beta4\SslCertsCreateEphemeralRequest; @@ -99,7 +105,9 @@ * ``` * $sqlInstancesServiceClient = new SqlInstancesServiceClient(); * try { - * $response = $sqlInstancesServiceClient->addServerCa(); + * $instance = 'instance'; + * $project = 'project'; + * $response = $sqlInstancesServiceClient->acquireSsrsLease($instance, $project); * } finally { * $sqlInstancesServiceClient->close(); * } @@ -228,6 +236,73 @@ public function __construct(array $options = []) $this->setClientOptions($clientOptions); } + /** + * Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + * + * Sample code: + * ``` + * $sqlInstancesServiceClient = new SqlInstancesServiceClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $response = $sqlInstancesServiceClient->acquireSsrsLease($instance, $project); + * } finally { + * $sqlInstancesServiceClient->close(); + * } + * ``` + * + * @param string $instance Required. Cloud SQL instance ID. This doesn't include the project ID. It's + * composed of lowercase letters, numbers, and hyphens, and it must start with + * a letter. The total length must be 98 characters or less (Example: + * instance-id). + * @param string $project Required. ID of the project that contains the instance (Example: + * project-id). + * @param array $optionalArgs { + * Optional. + * + * @type InstancesAcquireSsrsLeaseRequest $body + * The body for request to acquire an SSRS lease. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Sql\V1beta4\SqlInstancesAcquireSsrsLeaseResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function acquireSsrsLease( + $instance, + $project, + array $optionalArgs = [] + ) { + $request = new SqlInstancesAcquireSsrsLeaseRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['body'])) { + $request->setBody($optionalArgs['body']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'AcquireSsrsLease', + SqlInstancesAcquireSsrsLeaseResponse::class, + $optionalArgs, + $request + )->wait(); + } + /** * Add a new trusted Certificate Authority (CA) version for the specified * instance. Required to prepare for a certificate rotation. If a CA version @@ -1337,7 +1412,8 @@ public function performDiskShrink(array $optionalArgs = []) } /** - * Promotes the read replica instance to be a stand-alone Cloud SQL instance. + * Promotes the read replica instance to be an independent Cloud SQL + * primary instance. * Using this operation might cause your instance to restart. * * Sample code: @@ -1358,9 +1434,13 @@ public function performDiskShrink(array $optionalArgs = []) * @type string $project * ID of the project that contains the read replica. * @type bool $failover - * Set to true if the promote operation should attempt to re-add the original - * primary as a replica when it comes back online. Otherwise, if this value is - * false or not set, the original primary will be a standalone instance. + * Set to true to invoke a replica failover to the designated DR replica. + * As part of replica failover, the promote operation attempts + * to add the original primary instance as a replica of the promoted + * DR replica when the original primary instance comes back online. + * If set to false or not specified, then the original primary + * instance becomes an independent Cloud SQL primary instance. + * Only applicable to MySQL. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1471,6 +1551,67 @@ public function reencrypt(array $optionalArgs = []) )->wait(); } + /** + * Release a lease for the setup of SQL Server Reporting Services (SSRS). + * + * Sample code: + * ``` + * $sqlInstancesServiceClient = new SqlInstancesServiceClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $response = $sqlInstancesServiceClient->releaseSsrsLease($instance, $project); + * } finally { + * $sqlInstancesServiceClient->close(); + * } + * ``` + * + * @param string $instance Required. The Cloud SQL instance ID. This doesn't include the project ID. + * It's composed of lowercase letters, numbers, and hyphens, and it must start + * with a letter. The total length must be 98 characters or less (Example: + * instance-id). + * @param string $project Required. The ID of the project that contains the instance (Example: + * project-id). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Sql\V1beta4\SqlInstancesReleaseSsrsLeaseResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function releaseSsrsLease( + $instance, + $project, + array $optionalArgs = [] + ) { + $request = new SqlInstancesReleaseSsrsLeaseRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'ReleaseSsrsLease', + SqlInstancesReleaseSsrsLeaseResponse::class, + $optionalArgs, + $request + )->wait(); + } + /** * Reschedules the maintenance on the given instance. * @@ -1880,6 +2021,11 @@ public function rotateServerCa(array $optionalArgs = []) * Optional. Parallel level for initial data sync. Currently only applicable * for MySQL. * For allowed values, use constants defined on {@see \Google\Cloud\Sql\V1beta4\ExternalSyncParallelLevel} + * @type int $migrationType + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * For allowed values, use constants defined on {@see \Google\Cloud\Sql\V1beta4\SqlInstancesVerifyExternalSyncSettingsRequest\MigrationType} * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1922,6 +2068,10 @@ public function startExternalSync(array $optionalArgs = []) $request->setSyncParallelLevel($optionalArgs['syncParallelLevel']); } + if (isset($optionalArgs['migrationType'])) { + $request->setMigrationType($optionalArgs['migrationType']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); @@ -2057,7 +2207,8 @@ public function stopReplica(array $optionalArgs = []) } /** - * Switches over from the primary instance to a replica instance. + * Switches over from the primary instance to the designated DR replica + * instance. * * Sample code: * ``` @@ -2285,6 +2436,15 @@ public function update(array $optionalArgs = []) * Optional. Flag to verify settings required by replication setup only * @type MySqlSyncConfig $mysqlSyncConfig * Optional. MySQL-specific settings for start external sync. + * @type int $migrationType + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * For allowed values, use constants defined on {@see \Google\Cloud\Sql\V1beta4\SqlInstancesVerifyExternalSyncSettingsRequest\MigrationType} + * @type int $syncParallelLevel + * Optional. Parallel level for initial data sync. Only applicable for + * PostgreSQL. + * For allowed values, use constants defined on {@see \Google\Cloud\Sql\V1beta4\ExternalSyncParallelLevel} * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -2331,6 +2491,14 @@ public function verifyExternalSyncSettings(array $optionalArgs = []) $request->setMysqlSyncConfig($optionalArgs['mysqlSyncConfig']); } + if (isset($optionalArgs['migrationType'])) { + $request->setMigrationType($optionalArgs['migrationType']); + } + + if (isset($optionalArgs['syncParallelLevel'])) { + $request->setSyncParallelLevel($optionalArgs['syncParallelLevel']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); diff --git a/SqlAdmin/src/V1beta4/GeminiInstanceConfig.php b/SqlAdmin/src/V1beta4/GeminiInstanceConfig.php new file mode 100644 index 000000000000..1f3613fa25be --- /dev/null +++ b/SqlAdmin/src/V1beta4/GeminiInstanceConfig.php @@ -0,0 +1,297 @@ +google.cloud.sql.v1beta4.GeminiInstanceConfig + */ +class GeminiInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Whether Gemini is enabled. + * + * Generated from protobuf field optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $entitled = null; + /** + * Output only. Whether the vacuum management is enabled. + * + * Generated from protobuf field optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $google_vacuum_mgmt_enabled = null; + /** + * Output only. Whether canceling the out-of-memory (OOM) session is enabled. + * + * Generated from protobuf field optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $oom_session_cancel_enabled = null; + /** + * Output only. Whether the active query is enabled. + * + * Generated from protobuf field optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $active_query_enabled = null; + /** + * Output only. Whether the index advisor is enabled. + * + * Generated from protobuf field optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $index_advisor_enabled = null; + /** + * Output only. Whether the flag recommender is enabled. + * + * Generated from protobuf field optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $flag_recommender_enabled = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $entitled + * Output only. Whether Gemini is enabled. + * @type bool $google_vacuum_mgmt_enabled + * Output only. Whether the vacuum management is enabled. + * @type bool $oom_session_cancel_enabled + * Output only. Whether canceling the out-of-memory (OOM) session is enabled. + * @type bool $active_query_enabled + * Output only. Whether the active query is enabled. + * @type bool $index_advisor_enabled + * Output only. Whether the index advisor is enabled. + * @type bool $flag_recommender_enabled + * Output only. Whether the flag recommender is enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlResources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Whether Gemini is enabled. + * + * Generated from protobuf field optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getEntitled() + { + return isset($this->entitled) ? $this->entitled : false; + } + + public function hasEntitled() + { + return isset($this->entitled); + } + + public function clearEntitled() + { + unset($this->entitled); + } + + /** + * Output only. Whether Gemini is enabled. + * + * Generated from protobuf field optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setEntitled($var) + { + GPBUtil::checkBool($var); + $this->entitled = $var; + + return $this; + } + + /** + * Output only. Whether the vacuum management is enabled. + * + * Generated from protobuf field optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getGoogleVacuumMgmtEnabled() + { + return isset($this->google_vacuum_mgmt_enabled) ? $this->google_vacuum_mgmt_enabled : false; + } + + public function hasGoogleVacuumMgmtEnabled() + { + return isset($this->google_vacuum_mgmt_enabled); + } + + public function clearGoogleVacuumMgmtEnabled() + { + unset($this->google_vacuum_mgmt_enabled); + } + + /** + * Output only. Whether the vacuum management is enabled. + * + * Generated from protobuf field optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setGoogleVacuumMgmtEnabled($var) + { + GPBUtil::checkBool($var); + $this->google_vacuum_mgmt_enabled = $var; + + return $this; + } + + /** + * Output only. Whether canceling the out-of-memory (OOM) session is enabled. + * + * Generated from protobuf field optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getOomSessionCancelEnabled() + { + return isset($this->oom_session_cancel_enabled) ? $this->oom_session_cancel_enabled : false; + } + + public function hasOomSessionCancelEnabled() + { + return isset($this->oom_session_cancel_enabled); + } + + public function clearOomSessionCancelEnabled() + { + unset($this->oom_session_cancel_enabled); + } + + /** + * Output only. Whether canceling the out-of-memory (OOM) session is enabled. + * + * Generated from protobuf field optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setOomSessionCancelEnabled($var) + { + GPBUtil::checkBool($var); + $this->oom_session_cancel_enabled = $var; + + return $this; + } + + /** + * Output only. Whether the active query is enabled. + * + * Generated from protobuf field optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getActiveQueryEnabled() + { + return isset($this->active_query_enabled) ? $this->active_query_enabled : false; + } + + public function hasActiveQueryEnabled() + { + return isset($this->active_query_enabled); + } + + public function clearActiveQueryEnabled() + { + unset($this->active_query_enabled); + } + + /** + * Output only. Whether the active query is enabled. + * + * Generated from protobuf field optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setActiveQueryEnabled($var) + { + GPBUtil::checkBool($var); + $this->active_query_enabled = $var; + + return $this; + } + + /** + * Output only. Whether the index advisor is enabled. + * + * Generated from protobuf field optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getIndexAdvisorEnabled() + { + return isset($this->index_advisor_enabled) ? $this->index_advisor_enabled : false; + } + + public function hasIndexAdvisorEnabled() + { + return isset($this->index_advisor_enabled); + } + + public function clearIndexAdvisorEnabled() + { + unset($this->index_advisor_enabled); + } + + /** + * Output only. Whether the index advisor is enabled. + * + * Generated from protobuf field optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setIndexAdvisorEnabled($var) + { + GPBUtil::checkBool($var); + $this->index_advisor_enabled = $var; + + return $this; + } + + /** + * Output only. Whether the flag recommender is enabled. + * + * Generated from protobuf field optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getFlagRecommenderEnabled() + { + return isset($this->flag_recommender_enabled) ? $this->flag_recommender_enabled : false; + } + + public function hasFlagRecommenderEnabled() + { + return isset($this->flag_recommender_enabled); + } + + public function clearFlagRecommenderEnabled() + { + unset($this->flag_recommender_enabled); + } + + /** + * Output only. Whether the flag recommender is enabled. + * + * Generated from protobuf field optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setFlagRecommenderEnabled($var) + { + GPBUtil::checkBool($var); + $this->flag_recommender_enabled = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1beta4/ImportContext.php b/SqlAdmin/src/V1beta4/ImportContext.php index 6bdb78a79f2d..9e0f7690d688 100644 --- a/SqlAdmin/src/V1beta4/ImportContext.php +++ b/SqlAdmin/src/V1beta4/ImportContext.php @@ -66,6 +66,12 @@ class ImportContext extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; */ private $bak_import_options = null; + /** + * Optional. Options for importing data from SQL statements. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sql_import_options = null; /** * Constructor. @@ -96,6 +102,8 @@ class ImportContext extends \Google\Protobuf\Internal\Message * The PostgreSQL user for this import operation. PostgreSQL instances only. * @type \Google\Cloud\Sql\V1beta4\ImportContext\SqlBakImportOptions $bak_import_options * Import parameters specific to SQL Server .BAK files + * @type \Google\Cloud\Sql\V1beta4\ImportContext\SqlImportOptions $sql_import_options + * Optional. Options for importing data from SQL statements. * } */ public function __construct($data = NULL) { @@ -323,5 +331,41 @@ public function setBakImportOptions($var) return $this; } + /** + * Optional. Options for importing data from SQL statements. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Sql\V1beta4\ImportContext\SqlImportOptions|null + */ + public function getSqlImportOptions() + { + return $this->sql_import_options; + } + + public function hasSqlImportOptions() + { + return isset($this->sql_import_options); + } + + public function clearSqlImportOptions() + { + unset($this->sql_import_options); + } + + /** + * Optional. Options for importing data from SQL statements. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Sql\V1beta4\ImportContext\SqlImportOptions $var + * @return $this + */ + public function setSqlImportOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1beta4\ImportContext\SqlImportOptions::class); + $this->sql_import_options = $var; + + return $this; + } + } diff --git a/SqlAdmin/src/V1beta4/ImportContext/SqlImportOptions.php b/SqlAdmin/src/V1beta4/ImportContext/SqlImportOptions.php new file mode 100644 index 000000000000..d781dfd445e8 --- /dev/null +++ b/SqlAdmin/src/V1beta4/ImportContext/SqlImportOptions.php @@ -0,0 +1,174 @@ +google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + */ +class SqlImportOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $threads = null; + /** + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $parallel = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Int32Value $threads + * Optional. The number of threads to use for parallel import. + * @type \Google\Protobuf\BoolValue $parallel + * Optional. Whether or not the import should be parallel. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlResources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getThreads() + { + return $this->threads; + } + + public function hasThreads() + { + return isset($this->threads); + } + + public function clearThreads() + { + unset($this->threads); + } + + /** + * Returns the unboxed value from getThreads() + + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|null + */ + public function getThreadsValue() + { + return $this->readWrapperValue("threads"); + } + + /** + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setThreads($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->threads = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Optional. The number of threads to use for parallel import. + * + * Generated from protobuf field .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|null $var + * @return $this + */ + public function setThreadsValue($var) + { + $this->writeWrapperValue("threads", $var); + return $this;} + + /** + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getParallel() + { + return $this->parallel; + } + + public function hasParallel() + { + return isset($this->parallel); + } + + public function clearParallel() + { + unset($this->parallel); + } + + /** + * Returns the unboxed value from getParallel() + + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool|null + */ + public function getParallelValue() + { + return $this->readWrapperValue("parallel"); + } + + /** + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setParallel($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->parallel = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Optional. Whether or not the import should be parallel. + * + * Generated from protobuf field .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool|null $var + * @return $this + */ + public function setParallelValue($var) + { + $this->writeWrapperValue("parallel", $var); + return $this;} + +} + + diff --git a/SqlAdmin/src/V1beta4/InstancesAcquireSsrsLeaseRequest.php b/SqlAdmin/src/V1beta4/InstancesAcquireSsrsLeaseRequest.php new file mode 100644 index 000000000000..aa38e5bff65d --- /dev/null +++ b/SqlAdmin/src/V1beta4/InstancesAcquireSsrsLeaseRequest.php @@ -0,0 +1,77 @@ +google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest + */ +class InstancesAcquireSsrsLeaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Contains details about the acquire SSRS lease operation. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + private $acquire_ssrs_lease_context = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Sql\V1beta4\AcquireSsrsLeaseContext $acquire_ssrs_lease_context + * Contains details about the acquire SSRS lease operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlResources::initOnce(); + parent::__construct($data); + } + + /** + * Contains details about the acquire SSRS lease operation. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * @return \Google\Cloud\Sql\V1beta4\AcquireSsrsLeaseContext|null + */ + public function getAcquireSsrsLeaseContext() + { + return $this->acquire_ssrs_lease_context; + } + + public function hasAcquireSsrsLeaseContext() + { + return isset($this->acquire_ssrs_lease_context); + } + + public function clearAcquireSsrsLeaseContext() + { + unset($this->acquire_ssrs_lease_context); + } + + /** + * Contains details about the acquire SSRS lease operation. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * @param \Google\Cloud\Sql\V1beta4\AcquireSsrsLeaseContext $var + * @return $this + */ + public function setAcquireSsrsLeaseContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1beta4\AcquireSsrsLeaseContext::class); + $this->acquire_ssrs_lease_context = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1beta4/IpConfiguration.php b/SqlAdmin/src/V1beta4/IpConfiguration.php index fba37b4505b9..fb332bdc43e6 100644 --- a/SqlAdmin/src/V1beta4/IpConfiguration.php +++ b/SqlAdmin/src/V1beta4/IpConfiguration.php @@ -31,7 +31,7 @@ class IpConfiguration extends \Google\Protobuf\Internal\Message */ private $private_network = ''; /** - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -70,20 +70,22 @@ class IpConfiguration extends \Google\Protobuf\Internal\Message */ private $enable_private_path_for_google_cloud_services = null; /** - * Specify how SSL/TLS is enforced in database connections. MySQL and - * PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag - * for backward compatibility, then only the following value pairs are valid: + * Specify how SSL/TLS is enforced in database connections. If you must use + * the `require_ssl` flag for backward compatibility, then only the following + * value pairs are valid: + * For PostgreSQL and MySQL: * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` - * The value of `ssl_mode` gets priority over the value of `require_ssl`. For - * example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`, - * the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the - * `require_ssl=false` means accept both non-SSL and SSL connections. MySQL - * and PostgreSQL databases respect `ssl_mode` in this case and accept only - * SSL connections. - * SQL Server uses the `require_ssl` flag. You can set the value for this flag - * to `true` or `false`. + * For SQL Server: + * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + * The value of `ssl_mode` has priority over the value of `require_ssl`. + * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + * connections, while `require_ssl=false` means accept both non-SSL + * and SSL connections. In this case, MySQL and PostgreSQL databases respect + * `ssl_mode` and accepts only SSL connections. * * Generated from protobuf field .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; */ @@ -109,7 +111,7 @@ class IpConfiguration extends \Google\Protobuf\Internal\Message * `/projects/myProject/global/networks/default`. This setting can * be updated, but it cannot be removed after it is set. * @type \Google\Protobuf\BoolValue $require_ssl - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -132,20 +134,22 @@ class IpConfiguration extends \Google\Protobuf\Internal\Message * Controls connectivity to private IP instances from Google services, * such as BigQuery. * @type int $ssl_mode - * Specify how SSL/TLS is enforced in database connections. MySQL and - * PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag - * for backward compatibility, then only the following value pairs are valid: + * Specify how SSL/TLS is enforced in database connections. If you must use + * the `require_ssl` flag for backward compatibility, then only the following + * value pairs are valid: + * For PostgreSQL and MySQL: * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` - * The value of `ssl_mode` gets priority over the value of `require_ssl`. For - * example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`, - * the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the - * `require_ssl=false` means accept both non-SSL and SSL connections. MySQL - * and PostgreSQL databases respect `ssl_mode` in this case and accept only - * SSL connections. - * SQL Server uses the `require_ssl` flag. You can set the value for this flag - * to `true` or `false`. + * For SQL Server: + * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + * The value of `ssl_mode` has priority over the value of `require_ssl`. + * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + * connections, while `require_ssl=false` means accept both non-SSL + * and SSL connections. In this case, MySQL and PostgreSQL databases respect + * `ssl_mode` and accepts only SSL connections. * @type \Google\Cloud\Sql\V1beta4\PscConfig $psc_config * PSC settings for this instance. * } @@ -251,7 +255,7 @@ public function setPrivateNetwork($var) } /** - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -281,7 +285,7 @@ public function clearRequireSsl() /** * Returns the unboxed value from getRequireSsl() - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -299,7 +303,7 @@ public function getRequireSslValue() } /** - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -323,7 +327,7 @@ public function setRequireSsl($var) /** * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. - * Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. + * Use `ssl_mode` instead. * Whether SSL/TLS connections over IP are enforced. * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. * For SSL/TLS connections, the client certificate won't be verified. If @@ -475,20 +479,22 @@ public function setEnablePrivatePathForGoogleCloudServicesValue($var) return $this;} /** - * Specify how SSL/TLS is enforced in database connections. MySQL and - * PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag - * for backward compatibility, then only the following value pairs are valid: + * Specify how SSL/TLS is enforced in database connections. If you must use + * the `require_ssl` flag for backward compatibility, then only the following + * value pairs are valid: + * For PostgreSQL and MySQL: * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` - * The value of `ssl_mode` gets priority over the value of `require_ssl`. For - * example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`, - * the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the - * `require_ssl=false` means accept both non-SSL and SSL connections. MySQL - * and PostgreSQL databases respect `ssl_mode` in this case and accept only - * SSL connections. - * SQL Server uses the `require_ssl` flag. You can set the value for this flag - * to `true` or `false`. + * For SQL Server: + * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + * The value of `ssl_mode` has priority over the value of `require_ssl`. + * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + * connections, while `require_ssl=false` means accept both non-SSL + * and SSL connections. In this case, MySQL and PostgreSQL databases respect + * `ssl_mode` and accepts only SSL connections. * * Generated from protobuf field .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; * @return int @@ -499,20 +505,22 @@ public function getSslMode() } /** - * Specify how SSL/TLS is enforced in database connections. MySQL and - * PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag - * for backward compatibility, then only the following value pairs are valid: + * Specify how SSL/TLS is enforced in database connections. If you must use + * the `require_ssl` flag for backward compatibility, then only the following + * value pairs are valid: + * For PostgreSQL and MySQL: * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` - * The value of `ssl_mode` gets priority over the value of `require_ssl`. For - * example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`, - * the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the - * `require_ssl=false` means accept both non-SSL and SSL connections. MySQL - * and PostgreSQL databases respect `ssl_mode` in this case and accept only - * SSL connections. - * SQL Server uses the `require_ssl` flag. You can set the value for this flag - * to `true` or `false`. + * For SQL Server: + * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + * The value of `ssl_mode` has priority over the value of `require_ssl`. + * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + * connections, while `require_ssl=false` means accept both non-SSL + * and SSL connections. In this case, MySQL and PostgreSQL databases respect + * `ssl_mode` and accepts only SSL connections. * * Generated from protobuf field .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; * @param int $var diff --git a/SqlAdmin/src/V1beta4/IpConfiguration/SslMode.php b/SqlAdmin/src/V1beta4/IpConfiguration/SslMode.php index a112c0b2aa62..200afdff2f71 100644 --- a/SqlAdmin/src/V1beta4/IpConfiguration/SslMode.php +++ b/SqlAdmin/src/V1beta4/IpConfiguration/SslMode.php @@ -20,18 +20,21 @@ class SslMode */ const SSL_MODE_UNSPECIFIED = 0; /** - * Allow non-SSL/non-TLS and SSL/TLS connections. For SSL/TLS connections, - * the client certificate won't be verified. + * Allow non-SSL/non-TLS and SSL/TLS connections. + * For SSL connections to MySQL and PostgreSQL, the client certificate + * isn't verified. * When this value is used, the legacy `require_ssl` flag must be false or - * cleared to avoid the conflict between values of two flags. + * cleared to avoid a conflict between the values of the two flags. * * Generated from protobuf enum ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; */ const ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; /** * Only allow connections encrypted with SSL/TLS. + * For SSL connections to MySQL and PostgreSQL, the client certificate + * isn't verified. * When this value is used, the legacy `require_ssl` flag must be false or - * cleared to avoid the conflict between values of two flags. + * cleared to avoid a conflict between the values of the two flags. * * Generated from protobuf enum ENCRYPTED_ONLY = 2; */ @@ -48,6 +51,7 @@ class SslMode * [Cloud SQL * Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors) * to enforce client identity verification. + * Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server. * * Generated from protobuf enum TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; */ diff --git a/SqlAdmin/src/V1beta4/Operation.php b/SqlAdmin/src/V1beta4/Operation.php index bd3e83e511ed..2eb82c343da9 100644 --- a/SqlAdmin/src/V1beta4/Operation.php +++ b/SqlAdmin/src/V1beta4/Operation.php @@ -138,6 +138,12 @@ class Operation extends \Google\Protobuf\Internal\Message * Generated from protobuf field string target_project = 15; */ private $target_project = ''; + /** + * The context for acquire SSRS lease operation, if applicable. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + private $acquire_ssrs_lease_context = null; /** * Constructor. @@ -199,6 +205,8 @@ class Operation extends \Google\Protobuf\Internal\Message * The URI of this resource. * @type string $target_project * The project ID of the target instance related to this operation. + * @type \Google\Cloud\Sql\V1beta4\AcquireSsrsLeaseContext $acquire_ssrs_lease_context + * The context for acquire SSRS lease operation, if applicable. * } */ public function __construct($data = NULL) { @@ -766,5 +774,41 @@ public function setTargetProject($var) return $this; } + /** + * The context for acquire SSRS lease operation, if applicable. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * @return \Google\Cloud\Sql\V1beta4\AcquireSsrsLeaseContext|null + */ + public function getAcquireSsrsLeaseContext() + { + return $this->acquire_ssrs_lease_context; + } + + public function hasAcquireSsrsLeaseContext() + { + return isset($this->acquire_ssrs_lease_context); + } + + public function clearAcquireSsrsLeaseContext() + { + unset($this->acquire_ssrs_lease_context); + } + + /** + * The context for acquire SSRS lease operation, if applicable. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * @param \Google\Cloud\Sql\V1beta4\AcquireSsrsLeaseContext $var + * @return $this + */ + public function setAcquireSsrsLeaseContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1beta4\AcquireSsrsLeaseContext::class); + $this->acquire_ssrs_lease_context = $var; + + return $this; + } + } diff --git a/SqlAdmin/src/V1beta4/Operation/SqlOperationType.php b/SqlAdmin/src/V1beta4/Operation/SqlOperationType.php index 8a16c29d16da..f7ec185bd9d8 100644 --- a/SqlAdmin/src/V1beta4/Operation/SqlOperationType.php +++ b/SqlAdmin/src/V1beta4/Operation/SqlOperationType.php @@ -245,6 +245,46 @@ class SqlOperationType * Generated from protobuf enum SWITCHOVER = 39; */ const SWITCHOVER = 39; + /** + * Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + * + * Generated from protobuf enum ACQUIRE_SSRS_LEASE = 42; + */ + const ACQUIRE_SSRS_LEASE = 42; + /** + * Release a lease for the setup of SQL Server Reporting Services (SSRS). + * + * Generated from protobuf enum RELEASE_SSRS_LEASE = 43; + */ + const RELEASE_SSRS_LEASE = 43; + /** + * Reconfigures old primary after a promote replica operation. Effect of a + * promote operation to the old primary is executed in this operation, + * asynchronously from the promote replica operation executed to the + * replica. + * + * Generated from protobuf enum RECONFIGURE_OLD_PRIMARY = 44; + */ + const RECONFIGURE_OLD_PRIMARY = 44; + /** + * Indicates that the instance, its read replicas, and its cascading + * replicas are in maintenance. Maintenance typically gets initiated on + * groups of replicas first, followed by the primary instance. For each + * instance, maintenance typically causes the instance to be unavailable for + * 1-3 minutes. + * + * Generated from protobuf enum CLUSTER_MAINTENANCE = 45; + */ + const CLUSTER_MAINTENANCE = 45; + /** + * Indicates that the instance (and any of its replicas) are currently in + * maintenance. This is initiated as a self-service request by using SSM. + * Maintenance typically causes the instance to be unavailable for 1-3 + * minutes. + * + * Generated from protobuf enum SELF_SERVICE_MAINTENANCE = 46; + */ + const SELF_SERVICE_MAINTENANCE = 46; private static $valueToName = [ self::SQL_OPERATION_TYPE_UNSPECIFIED => 'SQL_OPERATION_TYPE_UNSPECIFIED', @@ -286,6 +326,11 @@ class SqlOperationType self::AUTO_RESTART => 'AUTO_RESTART', self::REENCRYPT => 'REENCRYPT', self::SWITCHOVER => 'SWITCHOVER', + self::ACQUIRE_SSRS_LEASE => 'ACQUIRE_SSRS_LEASE', + self::RELEASE_SSRS_LEASE => 'RELEASE_SSRS_LEASE', + self::RECONFIGURE_OLD_PRIMARY => 'RECONFIGURE_OLD_PRIMARY', + self::CLUSTER_MAINTENANCE => 'CLUSTER_MAINTENANCE', + self::SELF_SERVICE_MAINTENANCE => 'SELF_SERVICE_MAINTENANCE', ]; public static function name($value) diff --git a/SqlAdmin/src/V1beta4/ReplicationCluster.php b/SqlAdmin/src/V1beta4/ReplicationCluster.php new file mode 100644 index 000000000000..58afedbfc485 --- /dev/null +++ b/SqlAdmin/src/V1beta4/ReplicationCluster.php @@ -0,0 +1,148 @@ +google.cloud.sql.v1beta4.ReplicationCluster + */ +class ReplicationCluster extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If the instance is a primary instance, then this field identifies + * the disaster recovery (DR) replica. A DR replica is an optional + * configuration for Enterprise Plus edition instances. If the instance is a + * read replica, then the field is not set. Set this field to a replica name + * to designate a DR replica for a primary instance. Remove the replica name + * to remove the DR replica designation. + * + * Generated from protobuf field optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $failover_dr_replica_name = null; + /** + * Output only. Read-only field that indicates whether the replica is a DR + * replica. This field is not set if the instance is a primary instance. + * + * Generated from protobuf field optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $dr_replica = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $failover_dr_replica_name + * Optional. If the instance is a primary instance, then this field identifies + * the disaster recovery (DR) replica. A DR replica is an optional + * configuration for Enterprise Plus edition instances. If the instance is a + * read replica, then the field is not set. Set this field to a replica name + * to designate a DR replica for a primary instance. Remove the replica name + * to remove the DR replica designation. + * @type bool $dr_replica + * Output only. Read-only field that indicates whether the replica is a DR + * replica. This field is not set if the instance is a primary instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlResources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If the instance is a primary instance, then this field identifies + * the disaster recovery (DR) replica. A DR replica is an optional + * configuration for Enterprise Plus edition instances. If the instance is a + * read replica, then the field is not set. Set this field to a replica name + * to designate a DR replica for a primary instance. Remove the replica name + * to remove the DR replica designation. + * + * Generated from protobuf field optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFailoverDrReplicaName() + { + return isset($this->failover_dr_replica_name) ? $this->failover_dr_replica_name : ''; + } + + public function hasFailoverDrReplicaName() + { + return isset($this->failover_dr_replica_name); + } + + public function clearFailoverDrReplicaName() + { + unset($this->failover_dr_replica_name); + } + + /** + * Optional. If the instance is a primary instance, then this field identifies + * the disaster recovery (DR) replica. A DR replica is an optional + * configuration for Enterprise Plus edition instances. If the instance is a + * read replica, then the field is not set. Set this field to a replica name + * to designate a DR replica for a primary instance. Remove the replica name + * to remove the DR replica designation. + * + * Generated from protobuf field optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFailoverDrReplicaName($var) + { + GPBUtil::checkString($var, True); + $this->failover_dr_replica_name = $var; + + return $this; + } + + /** + * Output only. Read-only field that indicates whether the replica is a DR + * replica. This field is not set if the instance is a primary instance. + * + * Generated from protobuf field optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getDrReplica() + { + return isset($this->dr_replica) ? $this->dr_replica : false; + } + + public function hasDrReplica() + { + return isset($this->dr_replica); + } + + public function clearDrReplica() + { + unset($this->dr_replica); + } + + /** + * Output only. Read-only field that indicates whether the replica is a DR + * replica. This field is not set if the instance is a primary instance. + * + * Generated from protobuf field optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setDrReplica($var) + { + GPBUtil::checkBool($var); + $this->dr_replica = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1beta4/Settings.php b/SqlAdmin/src/V1beta4/Settings.php index 24d10e3ed774..5ade6e2a6f06 100644 --- a/SqlAdmin/src/V1beta4/Settings.php +++ b/SqlAdmin/src/V1beta4/Settings.php @@ -252,6 +252,15 @@ class Settings extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; */ private $data_cache_config = null; + /** + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $enable_google_ml_integration = null; /** * Constructor. @@ -365,6 +374,11 @@ class Settings extends \Google\Protobuf\Internal\Message * relevant only for SQL Server. * @type \Google\Cloud\Sql\V1beta4\DataCacheConfig $data_cache_config * Configuration for data cache. + * @type \Google\Protobuf\BoolValue $enable_google_ml_integration + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. * } */ public function __construct($data = NULL) { @@ -1680,5 +1694,80 @@ public function setDataCacheConfig($var) return $this; } + /** + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\BoolValue|null + */ + public function getEnableGoogleMlIntegration() + { + return $this->enable_google_ml_integration; + } + + public function hasEnableGoogleMlIntegration() + { + return isset($this->enable_google_ml_integration); + } + + public function clearEnableGoogleMlIntegration() + { + unset($this->enable_google_ml_integration); + } + + /** + * Returns the unboxed value from getEnableGoogleMlIntegration() + + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool|null + */ + public function getEnableGoogleMlIntegrationValue() + { + return $this->readWrapperValue("enable_google_ml_integration"); + } + + /** + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setEnableGoogleMlIntegration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->enable_google_ml_integration = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Optional. When this parameter is set to true, Cloud SQL instances can + * connect to Vertex AI to pass requests for real-time predictions and + * insights to the AI. The default value is false. This applies only to Cloud + * SQL for PostgreSQL instances. + * + * Generated from protobuf field .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool|null $var + * @return $this + */ + public function setEnableGoogleMlIntegrationValue($var) + { + $this->writeWrapperValue("enable_google_ml_integration", $var); + return $this;} + } diff --git a/SqlAdmin/src/V1beta4/SqlDatabaseVersion.php b/SqlAdmin/src/V1beta4/SqlDatabaseVersion.php index 0d4a492ed295..c74106a9a36f 100644 --- a/SqlAdmin/src/V1beta4/SqlDatabaseVersion.php +++ b/SqlAdmin/src/V1beta4/SqlDatabaseVersion.php @@ -187,6 +187,36 @@ class SqlDatabaseVersion * Generated from protobuf enum MYSQL_8_0_36 = 241; */ const MYSQL_8_0_36 = 241; + /** + * The database major version is MySQL 8.0 and the minor version is 37. + * + * Generated from protobuf enum MYSQL_8_0_37 = 355; + */ + const MYSQL_8_0_37 = 355; + /** + * The database major version is MySQL 8.0 and the minor version is 38. + * + * Generated from protobuf enum MYSQL_8_0_38 = 356; + */ + const MYSQL_8_0_38 = 356; + /** + * The database major version is MySQL 8.0 and the minor version is 39. + * + * Generated from protobuf enum MYSQL_8_0_39 = 357; + */ + const MYSQL_8_0_39 = 357; + /** + * The database major version is MySQL 8.0 and the minor version is 40. + * + * Generated from protobuf enum MYSQL_8_0_40 = 358; + */ + const MYSQL_8_0_40 = 358; + /** + * The database version is MySQL 8.4. + * + * Generated from protobuf enum MYSQL_8_4 = 398; + */ + const MYSQL_8_4 = 398; /** * The database version is SQL Server 2019 Standard. * @@ -266,6 +296,11 @@ class SqlDatabaseVersion self::MYSQL_8_0_34 => 'MYSQL_8_0_34', self::MYSQL_8_0_35 => 'MYSQL_8_0_35', self::MYSQL_8_0_36 => 'MYSQL_8_0_36', + self::MYSQL_8_0_37 => 'MYSQL_8_0_37', + self::MYSQL_8_0_38 => 'MYSQL_8_0_38', + self::MYSQL_8_0_39 => 'MYSQL_8_0_39', + self::MYSQL_8_0_40 => 'MYSQL_8_0_40', + self::MYSQL_8_4 => 'MYSQL_8_4', self::SQLSERVER_2019_STANDARD => 'SQLSERVER_2019_STANDARD', self::SQLSERVER_2019_ENTERPRISE => 'SQLSERVER_2019_ENTERPRISE', self::SQLSERVER_2019_EXPRESS => 'SQLSERVER_2019_EXPRESS', diff --git a/SqlAdmin/src/V1beta4/SqlInstancesAcquireSsrsLeaseRequest.php b/SqlAdmin/src/V1beta4/SqlInstancesAcquireSsrsLeaseRequest.php new file mode 100644 index 000000000000..15c1ea5c7267 --- /dev/null +++ b/SqlAdmin/src/V1beta4/SqlInstancesAcquireSsrsLeaseRequest.php @@ -0,0 +1,161 @@ +google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest + */ +class SqlInstancesAcquireSsrsLeaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Cloud SQL instance ID. This doesn't include the project ID. It's + * composed of lowercase letters, numbers, and hyphens, and it must start with + * a letter. The total length must be 98 characters or less (Example: + * instance-id). + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instance = ''; + /** + * Required. ID of the project that contains the instance (Example: + * project-id). + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $project = ''; + /** + * The body for request to acquire an SSRS lease. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + private $body = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Required. Cloud SQL instance ID. This doesn't include the project ID. It's + * composed of lowercase letters, numbers, and hyphens, and it must start with + * a letter. The total length must be 98 characters or less (Example: + * instance-id). + * @type string $project + * Required. ID of the project that contains the instance (Example: + * project-id). + * @type \Google\Cloud\Sql\V1beta4\InstancesAcquireSsrsLeaseRequest $body + * The body for request to acquire an SSRS lease. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSql::initOnce(); + parent::__construct($data); + } + + /** + * Required. Cloud SQL instance ID. This doesn't include the project ID. It's + * composed of lowercase letters, numbers, and hyphens, and it must start with + * a letter. The total length must be 98 characters or less (Example: + * instance-id). + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Required. Cloud SQL instance ID. This doesn't include the project ID. It's + * composed of lowercase letters, numbers, and hyphens, and it must start with + * a letter. The total length must be 98 characters or less (Example: + * instance-id). + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Required. ID of the project that contains the instance (Example: + * project-id). + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. ID of the project that contains the instance (Example: + * project-id). + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The body for request to acquire an SSRS lease. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + * @return \Google\Cloud\Sql\V1beta4\InstancesAcquireSsrsLeaseRequest|null + */ + public function getBody() + { + return $this->body; + } + + public function hasBody() + { + return isset($this->body); + } + + public function clearBody() + { + unset($this->body); + } + + /** + * The body for request to acquire an SSRS lease. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + * @param \Google\Cloud\Sql\V1beta4\InstancesAcquireSsrsLeaseRequest $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1beta4\InstancesAcquireSsrsLeaseRequest::class); + $this->body = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1beta4/SqlInstancesAcquireSsrsLeaseResponse.php b/SqlAdmin/src/V1beta4/SqlInstancesAcquireSsrsLeaseResponse.php new file mode 100644 index 000000000000..f6f6448148cc --- /dev/null +++ b/SqlAdmin/src/V1beta4/SqlInstancesAcquireSsrsLeaseResponse.php @@ -0,0 +1,77 @@ +google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse + */ +class SqlInstancesAcquireSsrsLeaseResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier for this operation. + * + * Generated from protobuf field optional string operation_id = 1; + */ + private $operation_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation_id + * The unique identifier for this operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSql::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier for this operation. + * + * Generated from protobuf field optional string operation_id = 1; + * @return string + */ + public function getOperationId() + { + return isset($this->operation_id) ? $this->operation_id : ''; + } + + public function hasOperationId() + { + return isset($this->operation_id); + } + + public function clearOperationId() + { + unset($this->operation_id); + } + + /** + * The unique identifier for this operation. + * + * Generated from protobuf field optional string operation_id = 1; + * @param string $var + * @return $this + */ + public function setOperationId($var) + { + GPBUtil::checkString($var, True); + $this->operation_id = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1beta4/SqlInstancesPromoteReplicaRequest.php b/SqlAdmin/src/V1beta4/SqlInstancesPromoteReplicaRequest.php index 693c63b8607b..5facf1562a80 100644 --- a/SqlAdmin/src/V1beta4/SqlInstancesPromoteReplicaRequest.php +++ b/SqlAdmin/src/V1beta4/SqlInstancesPromoteReplicaRequest.php @@ -26,9 +26,13 @@ class SqlInstancesPromoteReplicaRequest extends \Google\Protobuf\Internal\Messag */ private $project = ''; /** - * Set to true if the promote operation should attempt to re-add the original - * primary as a replica when it comes back online. Otherwise, if this value is - * false or not set, the original primary will be a standalone instance. + * Set to true to invoke a replica failover to the designated DR replica. + * As part of replica failover, the promote operation attempts + * to add the original primary instance as a replica of the promoted + * DR replica when the original primary instance comes back online. + * If set to false or not specified, then the original primary + * instance becomes an independent Cloud SQL primary instance. + * Only applicable to MySQL. * * Generated from protobuf field bool failover = 3; */ @@ -45,9 +49,13 @@ class SqlInstancesPromoteReplicaRequest extends \Google\Protobuf\Internal\Messag * @type string $project * ID of the project that contains the read replica. * @type bool $failover - * Set to true if the promote operation should attempt to re-add the original - * primary as a replica when it comes back online. Otherwise, if this value is - * false or not set, the original primary will be a standalone instance. + * Set to true to invoke a replica failover to the designated DR replica. + * As part of replica failover, the promote operation attempts + * to add the original primary instance as a replica of the promoted + * DR replica when the original primary instance comes back online. + * If set to false or not specified, then the original primary + * instance becomes an independent Cloud SQL primary instance. + * Only applicable to MySQL. * } */ public function __construct($data = NULL) { @@ -108,9 +116,13 @@ public function setProject($var) } /** - * Set to true if the promote operation should attempt to re-add the original - * primary as a replica when it comes back online. Otherwise, if this value is - * false or not set, the original primary will be a standalone instance. + * Set to true to invoke a replica failover to the designated DR replica. + * As part of replica failover, the promote operation attempts + * to add the original primary instance as a replica of the promoted + * DR replica when the original primary instance comes back online. + * If set to false or not specified, then the original primary + * instance becomes an independent Cloud SQL primary instance. + * Only applicable to MySQL. * * Generated from protobuf field bool failover = 3; * @return bool @@ -121,9 +133,13 @@ public function getFailover() } /** - * Set to true if the promote operation should attempt to re-add the original - * primary as a replica when it comes back online. Otherwise, if this value is - * false or not set, the original primary will be a standalone instance. + * Set to true to invoke a replica failover to the designated DR replica. + * As part of replica failover, the promote operation attempts + * to add the original primary instance as a replica of the promoted + * DR replica when the original primary instance comes back online. + * If set to false or not specified, then the original primary + * instance becomes an independent Cloud SQL primary instance. + * Only applicable to MySQL. * * Generated from protobuf field bool failover = 3; * @param bool $var diff --git a/SqlAdmin/src/V1beta4/SqlInstancesReleaseSsrsLeaseRequest.php b/SqlAdmin/src/V1beta4/SqlInstancesReleaseSsrsLeaseRequest.php new file mode 100644 index 000000000000..cb7171633712 --- /dev/null +++ b/SqlAdmin/src/V1beta4/SqlInstancesReleaseSsrsLeaseRequest.php @@ -0,0 +1,117 @@ +google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest + */ +class SqlInstancesReleaseSsrsLeaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Cloud SQL instance ID. This doesn't include the project ID. + * It's composed of lowercase letters, numbers, and hyphens, and it must start + * with a letter. The total length must be 98 characters or less (Example: + * instance-id). + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instance = ''; + /** + * Required. The ID of the project that contains the instance (Example: + * project-id). + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $project = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Required. The Cloud SQL instance ID. This doesn't include the project ID. + * It's composed of lowercase letters, numbers, and hyphens, and it must start + * with a letter. The total length must be 98 characters or less (Example: + * instance-id). + * @type string $project + * Required. The ID of the project that contains the instance (Example: + * project-id). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSql::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Cloud SQL instance ID. This doesn't include the project ID. + * It's composed of lowercase letters, numbers, and hyphens, and it must start + * with a letter. The total length must be 98 characters or less (Example: + * instance-id). + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Required. The Cloud SQL instance ID. This doesn't include the project ID. + * It's composed of lowercase letters, numbers, and hyphens, and it must start + * with a letter. The total length must be 98 characters or less (Example: + * instance-id). + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Required. The ID of the project that contains the instance (Example: + * project-id). + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. The ID of the project that contains the instance (Example: + * project-id). + * + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1beta4/SqlInstancesReleaseSsrsLeaseResponse.php b/SqlAdmin/src/V1beta4/SqlInstancesReleaseSsrsLeaseResponse.php new file mode 100644 index 000000000000..0ea3d2f79c38 --- /dev/null +++ b/SqlAdmin/src/V1beta4/SqlInstancesReleaseSsrsLeaseResponse.php @@ -0,0 +1,67 @@ +google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse + */ +class SqlInstancesReleaseSsrsLeaseResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The operation ID. + * + * Generated from protobuf field string operation_id = 1; + */ + private $operation_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation_id + * The operation ID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSql::initOnce(); + parent::__construct($data); + } + + /** + * The operation ID. + * + * Generated from protobuf field string operation_id = 1; + * @return string + */ + public function getOperationId() + { + return $this->operation_id; + } + + /** + * The operation ID. + * + * Generated from protobuf field string operation_id = 1; + * @param string $var + * @return $this + */ + public function setOperationId($var) + { + GPBUtil::checkString($var, True); + $this->operation_id = $var; + + return $this; + } + +} + diff --git a/SqlAdmin/src/V1beta4/SqlInstancesStartExternalSyncRequest.php b/SqlAdmin/src/V1beta4/SqlInstancesStartExternalSyncRequest.php index 3d469525bc2d..5275f84592a2 100644 --- a/SqlAdmin/src/V1beta4/SqlInstancesStartExternalSyncRequest.php +++ b/SqlAdmin/src/V1beta4/SqlInstancesStartExternalSyncRequest.php @@ -44,6 +44,14 @@ class SqlInstancesStartExternalSyncRequest extends \Google\Protobuf\Internal\Mes * Generated from protobuf field .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; */ private $sync_parallel_level = 0; + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $migration_type = 0; protected $sync_config; /** @@ -65,6 +73,10 @@ class SqlInstancesStartExternalSyncRequest extends \Google\Protobuf\Internal\Mes * @type int $sync_parallel_level * Optional. Parallel level for initial data sync. Currently only applicable * for MySQL. + * @type int $migration_type + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. * } */ public function __construct($data = NULL) { @@ -235,6 +247,36 @@ public function setSyncParallelLevel($var) return $this; } + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMigrationType() + { + return $this->migration_type; + } + + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMigrationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1beta4\SqlInstancesVerifyExternalSyncSettingsRequest\MigrationType::class); + $this->migration_type = $var; + + return $this; + } + /** * @return string */ diff --git a/SqlAdmin/src/V1beta4/SqlInstancesVerifyExternalSyncSettingsRequest.php b/SqlAdmin/src/V1beta4/SqlInstancesVerifyExternalSyncSettingsRequest.php index e8a0b883e504..12b6a8209e1e 100644 --- a/SqlAdmin/src/V1beta4/SqlInstancesVerifyExternalSyncSettingsRequest.php +++ b/SqlAdmin/src/V1beta4/SqlInstancesVerifyExternalSyncSettingsRequest.php @@ -43,6 +43,21 @@ class SqlInstancesVerifyExternalSyncSettingsRequest extends \Google\Protobuf\Int * Generated from protobuf field bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ private $verify_replication_only = false; + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $migration_type = 0; + /** + * Optional. Parallel level for initial data sync. Only applicable for + * PostgreSQL. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sync_parallel_level = 0; protected $sync_config; /** @@ -63,6 +78,13 @@ class SqlInstancesVerifyExternalSyncSettingsRequest extends \Google\Protobuf\Int * Optional. Flag to verify settings required by replication setup only * @type \Google\Cloud\Sql\V1beta4\MySqlSyncConfig $mysql_sync_config * Optional. MySQL-specific settings for start external sync. + * @type int $migration_type + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * @type int $sync_parallel_level + * Optional. Parallel level for initial data sync. Only applicable for + * PostgreSQL. * } */ public function __construct($data = NULL) { @@ -231,6 +253,64 @@ public function setMysqlSyncConfig($var) return $this; } + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMigrationType() + { + return $this->migration_type; + } + + /** + * Optional. MigrationType configures the migration to use physical files or + * logical dump files. If not set, then the logical dump file configuration is + * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMigrationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1beta4\SqlInstancesVerifyExternalSyncSettingsRequest\MigrationType::class); + $this->migration_type = $var; + + return $this; + } + + /** + * Optional. Parallel level for initial data sync. Only applicable for + * PostgreSQL. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSyncParallelLevel() + { + return $this->sync_parallel_level; + } + + /** + * Optional. Parallel level for initial data sync. Only applicable for + * PostgreSQL. + * + * Generated from protobuf field .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSyncParallelLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1beta4\ExternalSyncParallelLevel::class); + $this->sync_parallel_level = $var; + + return $this; + } + /** * @return string */ diff --git a/SqlAdmin/src/V1beta4/SqlInstancesVerifyExternalSyncSettingsRequest/MigrationType.php b/SqlAdmin/src/V1beta4/SqlInstancesVerifyExternalSyncSettingsRequest/MigrationType.php new file mode 100644 index 000000000000..49218ddea1fc --- /dev/null +++ b/SqlAdmin/src/V1beta4/SqlInstancesVerifyExternalSyncSettingsRequest/MigrationType.php @@ -0,0 +1,63 @@ +google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + */ +class MigrationType +{ + /** + * Default value is a logical dump file-based migration + * + * Generated from protobuf enum MIGRATION_TYPE_UNSPECIFIED = 0; + */ + const MIGRATION_TYPE_UNSPECIFIED = 0; + /** + * Logical dump file-based migration + * + * Generated from protobuf enum LOGICAL = 1; + */ + const LOGICAL = 1; + /** + * Physical file-based migration + * + * Generated from protobuf enum PHYSICAL = 2; + */ + const PHYSICAL = 2; + + private static $valueToName = [ + self::MIGRATION_TYPE_UNSPECIFIED => 'MIGRATION_TYPE_UNSPECIFIED', + self::LOGICAL => 'LOGICAL', + self::PHYSICAL => 'PHYSICAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/SqlAdmin/src/V1beta4/gapic_metadata.json b/SqlAdmin/src/V1beta4/gapic_metadata.json index 653c830da22b..932d7dbbfc16 100644 --- a/SqlAdmin/src/V1beta4/gapic_metadata.json +++ b/SqlAdmin/src/V1beta4/gapic_metadata.json @@ -92,6 +92,11 @@ "grpc": { "libraryClient": "SqlInstancesServiceGapicClient", "rpcs": { + "AcquireSsrsLease": { + "methods": [ + "acquireSsrsLease" + ] + }, "AddServerCa": { "methods": [ "addServerCa" @@ -187,6 +192,11 @@ "reencrypt" ] }, + "ReleaseSsrsLease": { + "methods": [ + "releaseSsrsLease" + ] + }, "RescheduleMaintenance": { "methods": [ "rescheduleMaintenance" diff --git a/SqlAdmin/src/V1beta4/resources/sql_instances_service_client_config.json b/SqlAdmin/src/V1beta4/resources/sql_instances_service_client_config.json index bbf1ebe22bca..57673d4b71f9 100644 --- a/SqlAdmin/src/V1beta4/resources/sql_instances_service_client_config.json +++ b/SqlAdmin/src/V1beta4/resources/sql_instances_service_client_config.json @@ -26,6 +26,11 @@ } }, "methods": { + "AcquireSsrsLease": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "AddServerCa": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -121,6 +126,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ReleaseSsrsLease": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "RescheduleMaintenance": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/SqlAdmin/src/V1beta4/resources/sql_instances_service_rest_client_config.php b/SqlAdmin/src/V1beta4/resources/sql_instances_service_rest_client_config.php index 981162de4c65..3dd890d997db 100644 --- a/SqlAdmin/src/V1beta4/resources/sql_instances_service_rest_client_config.php +++ b/SqlAdmin/src/V1beta4/resources/sql_instances_service_rest_client_config.php @@ -23,6 +23,23 @@ return [ 'interfaces' => [ 'google.cloud.sql.v1beta4.SqlInstancesService' => [ + 'AcquireSsrsLease' => [ + 'method' => 'post', + 'uriTemplate' => '/sql/v1beta4/projects/{project}/instances/{instance}/acquireSsrsLease', + 'body' => 'body', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], 'AddServerCa' => [ 'method' => 'post', 'uriTemplate' => '/sql/v1beta4/projects/{project}/instances/{instance}/addServerCa', @@ -328,6 +345,22 @@ ], ], ], + 'ReleaseSsrsLease' => [ + 'method' => 'post', + 'uriTemplate' => '/sql/v1beta4/projects/{project}/instances/{instance}/releaseSsrsLease', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], 'RescheduleMaintenance' => [ 'method' => 'post', 'uriTemplate' => '/sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance', diff --git a/SqlAdmin/tests/Unit/V1/Client/SqlInstancesServiceClientTest.php b/SqlAdmin/tests/Unit/V1/Client/SqlInstancesServiceClientTest.php index 54c3251d0c6f..28c10e28a19e 100644 --- a/SqlAdmin/tests/Unit/V1/Client/SqlInstancesServiceClientTest.php +++ b/SqlAdmin/tests/Unit/V1/Client/SqlInstancesServiceClientTest.php @@ -29,10 +29,13 @@ use Google\Cloud\Sql\V1\Client\SqlInstancesServiceClient; use Google\Cloud\Sql\V1\DatabaseInstance; use Google\Cloud\Sql\V1\DemoteContext; +use Google\Cloud\Sql\V1\InstancesAcquireSsrsLeaseRequest; use Google\Cloud\Sql\V1\InstancesDemoteRequest; use Google\Cloud\Sql\V1\InstancesListResponse; use Google\Cloud\Sql\V1\InstancesListServerCasResponse; use Google\Cloud\Sql\V1\Operation; +use Google\Cloud\Sql\V1\SqlInstancesAcquireSsrsLeaseRequest; +use Google\Cloud\Sql\V1\SqlInstancesAcquireSsrsLeaseResponse; use Google\Cloud\Sql\V1\SqlInstancesAddServerCaRequest; use Google\Cloud\Sql\V1\SqlInstancesCloneRequest; use Google\Cloud\Sql\V1\SqlInstancesCreateEphemeralCertRequest; @@ -54,6 +57,8 @@ use Google\Cloud\Sql\V1\SqlInstancesPerformDiskShrinkRequest; use Google\Cloud\Sql\V1\SqlInstancesPromoteReplicaRequest; use Google\Cloud\Sql\V1\SqlInstancesReencryptRequest; +use Google\Cloud\Sql\V1\SqlInstancesReleaseSsrsLeaseRequest; +use Google\Cloud\Sql\V1\SqlInstancesReleaseSsrsLeaseResponse; use Google\Cloud\Sql\V1\SqlInstancesRescheduleMaintenanceRequest; use Google\Cloud\Sql\V1\SqlInstancesResetReplicaSizeRequest; use Google\Cloud\Sql\V1\SqlInstancesResetSslConfigRequest; @@ -100,6 +105,82 @@ private function createClient(array $options = []) return new SqlInstancesServiceClient($options); } + /** @test */ + public function acquireSsrsLeaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $operationId = 'operationId-274116877'; + $expectedResponse = new SqlInstancesAcquireSsrsLeaseResponse(); + $expectedResponse->setOperationId($operationId); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $body = new InstancesAcquireSsrsLeaseRequest(); + $request = (new SqlInstancesAcquireSsrsLeaseRequest()) + ->setInstance($instance) + ->setProject($project) + ->setBody($body); + $response = $gapicClient->acquireSsrsLease($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.sql.v1.SqlInstancesService/AcquireSsrsLease', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getBody(); + $this->assertProtobufEquals($body, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function acquireSsrsLeaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $body = new InstancesAcquireSsrsLeaseRequest(); + $request = (new SqlInstancesAcquireSsrsLeaseRequest()) + ->setInstance($instance) + ->setProject($project) + ->setBody($body); + try { + $gapicClient->acquireSsrsLease($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function addServerCaTest() { @@ -1404,6 +1485,76 @@ public function reencryptExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function releaseSsrsLeaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $operationId = 'operationId-274116877'; + $expectedResponse = new SqlInstancesReleaseSsrsLeaseResponse(); + $expectedResponse->setOperationId($operationId); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $request = (new SqlInstancesReleaseSsrsLeaseRequest()) + ->setInstance($instance) + ->setProject($project); + $response = $gapicClient->releaseSsrsLease($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.sql.v1.SqlInstancesService/ReleaseSsrsLease', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function releaseSsrsLeaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $request = (new SqlInstancesReleaseSsrsLeaseRequest()) + ->setInstance($instance) + ->setProject($project); + try { + $gapicClient->releaseSsrsLease($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function rescheduleMaintenanceTest() { @@ -2277,7 +2428,7 @@ public function verifyExternalSyncSettingsExceptionTest() } /** @test */ - public function addServerCaAsyncTest() + public function acquireSsrsLeaseAsyncTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2285,30 +2436,31 @@ public function addServerCaAsyncTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $kind = 'kind3292052'; - $targetLink = 'targetLink-2084812312'; - $user = 'user3599307'; - $name = 'name3373707'; - $targetId = 'targetId-815576439'; - $selfLink = 'selfLink-1691268851'; - $targetProject = 'targetProject392184427'; - $expectedResponse = new Operation(); - $expectedResponse->setKind($kind); - $expectedResponse->setTargetLink($targetLink); - $expectedResponse->setUser($user); - $expectedResponse->setName($name); - $expectedResponse->setTargetId($targetId); - $expectedResponse->setSelfLink($selfLink); - $expectedResponse->setTargetProject($targetProject); + $operationId = 'operationId-274116877'; + $expectedResponse = new SqlInstancesAcquireSsrsLeaseResponse(); + $expectedResponse->setOperationId($operationId); $transport->addResponse($expectedResponse); - $request = new SqlInstancesAddServerCaRequest(); - $response = $gapicClient->addServerCaAsync($request)->wait(); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $body = new InstancesAcquireSsrsLeaseRequest(); + $request = (new SqlInstancesAcquireSsrsLeaseRequest()) + ->setInstance($instance) + ->setProject($project) + ->setBody($body); + $response = $gapicClient->acquireSsrsLeaseAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.sql.v1.SqlInstancesService/AddServerCa', $actualFuncCall); + $this->assertSame('/google.cloud.sql.v1.SqlInstancesService/AcquireSsrsLease', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getBody(); + $this->assertProtobufEquals($body, $actualValue); $this->assertTrue($transport->isExhausted()); } } diff --git a/SqlAdmin/tests/Unit/V1beta4/SqlInstancesServiceClientTest.php b/SqlAdmin/tests/Unit/V1beta4/SqlInstancesServiceClientTest.php index 74d6d5426a6a..199fa209d58d 100644 --- a/SqlAdmin/tests/Unit/V1beta4/SqlInstancesServiceClientTest.php +++ b/SqlAdmin/tests/Unit/V1beta4/SqlInstancesServiceClientTest.php @@ -30,8 +30,10 @@ use Google\Cloud\Sql\V1beta4\InstancesListResponse; use Google\Cloud\Sql\V1beta4\InstancesListServerCasResponse; use Google\Cloud\Sql\V1beta4\Operation; +use Google\Cloud\Sql\V1beta4\SqlInstancesAcquireSsrsLeaseResponse; use Google\Cloud\Sql\V1beta4\SqlInstancesGetDiskShrinkConfigResponse; use Google\Cloud\Sql\V1beta4\SqlInstancesGetLatestRecoveryTimeResponse; +use Google\Cloud\Sql\V1beta4\SqlInstancesReleaseSsrsLeaseResponse; use Google\Cloud\Sql\V1beta4\SqlInstancesServiceClient; use Google\Cloud\Sql\V1beta4\SqlInstancesVerifyExternalSyncSettingsResponse; use Google\Cloud\Sql\V1beta4\SslCert; @@ -66,6 +68,70 @@ private function createClient(array $options = []) return new SqlInstancesServiceClient($options); } + /** @test */ + public function acquireSsrsLeaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $operationId = 'operationId-274116877'; + $expectedResponse = new SqlInstancesAcquireSsrsLeaseResponse(); + $expectedResponse->setOperationId($operationId); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $response = $gapicClient->acquireSsrsLease($instance, $project); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.sql.v1beta4.SqlInstancesService/AcquireSsrsLease', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function acquireSsrsLeaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + try { + $gapicClient->acquireSsrsLease($instance, $project); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function addServerCaTest() { @@ -1314,6 +1380,70 @@ public function reencryptExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function releaseSsrsLeaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $operationId = 'operationId-274116877'; + $expectedResponse = new SqlInstancesReleaseSsrsLeaseResponse(); + $expectedResponse->setOperationId($operationId); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $response = $gapicClient->releaseSsrsLease($instance, $project); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.sql.v1beta4.SqlInstancesService/ReleaseSsrsLease', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function releaseSsrsLeaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + try { + $gapicClient->releaseSsrsLease($instance, $project); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function rescheduleMaintenanceTest() { diff --git a/Storage/.repo-metadata.json b/Storage/.repo-metadata.json deleted file mode 100644 index cec1634b2300..000000000000 --- a/Storage/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-storage", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-storage/latest", - "library_type": "GAPIC_MANUAL", - "api_shortname": "storage" -} diff --git a/Storage/VERSION b/Storage/VERSION index 021b2b85fea5..a50908ca3daf 100644 --- a/Storage/VERSION +++ b/Storage/VERSION @@ -1 +1 @@ -1.41.3 +1.42.0 diff --git a/Storage/src/Connection/ServiceDefinition/storage-v1.json b/Storage/src/Connection/ServiceDefinition/storage-v1.json index 25303d3bf767..76ce2ce9d8bf 100644 --- a/Storage/src/Connection/ServiceDefinition/storage-v1.json +++ b/Storage/src/Connection/ServiceDefinition/storage-v1.json @@ -1,5391 +1,5725 @@ { - "kind": "discovery#restDescription", - "version": "v1", - "id": "storage:v1", - "rootUrl": "https://storage.googleapis.com/", - "mtlsRootUrl": "https://storage.mtls.googleapis.com/", - "baseUrl": "https://storage.googleapis.com/storage/v1/", - "basePath": "/storage/v1/", - "servicePath": "storage/v1/", - "batchPath": "batch/storage/v1", - "discoveryVersion": "v1", - "name": "storage", - "title": "Cloud Storage JSON API", - "description": "Stores and retrieves potentially large, immutable data objects.", - "ownerDomain": "google.com", - "ownerName": "Google", - "icons": { - "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", - "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" - }, - "documentationLink": "https://developers.google.com/storage/docs/json_api/", - "labels": [ - "labs" - ], - "protocol": "rest", - "parameters": { - "alt": { - "type": "string", - "description": "Data format for the response.", - "default": "json", - "enum": [ - "json" - ], - "enumDescriptions": [ - "Responses with Content-Type of application/json" - ], - "location": "query" - }, - "fields": { - "type": "string", - "description": "Selector specifying which fields to include in a partial response.", - "location": "query" - }, - "key": { - "type": "string", - "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", - "location": "query" - }, - "oauth_token": { - "type": "string", - "description": "OAuth 2.0 token for the current user.", - "location": "query" - }, - "prettyPrint": { - "type": "boolean", - "description": "Returns response with indentations and line breaks.", - "default": "true", - "location": "query" - }, - "quotaUser": { - "type": "string", - "description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.", - "location": "query" - }, - "userIp": { - "type": "string", - "description": "Deprecated. Please use quotaUser instead.", - "location": "query" - }, - "uploadType": { - "type": "string", - "description": "Upload protocol for media (e.g. \"media\", \"multipart\", \"resumable\").", - "location": "query" - } - }, - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" - }, - "https://www.googleapis.com/auth/cloud-platform.read-only": { - "description": "View your data across Google Cloud Platform services" - }, - "https://www.googleapis.com/auth/devstorage.full_control": { - "description": "Manage your data and permissions in Google Cloud Storage" - }, - "https://www.googleapis.com/auth/devstorage.read_only": { - "description": "View your data in Google Cloud Storage" - }, - "https://www.googleapis.com/auth/devstorage.read_write": { - "description": "Manage your data in Google Cloud Storage" - } - } - } - }, - "schemas": { - "Bucket": { - "id": "Bucket", - "type": "object", - "description": "A bucket.", - "properties": { - "acl": { - "type": "array", - "description": "Access controls on the bucket.", - "items": { - "$ref": "BucketAccessControl" - }, - "annotations": { - "required": [ - "storage.buckets.update" - ] - } - }, - "billing": { - "type": "object", - "description": "The bucket's billing configuration.", - "properties": { - "requesterPays": { - "type": "boolean", - "description": "When set to true, Requester Pays is enabled for this bucket." - } - } - }, - "cors": { - "type": "array", - "description": "The bucket's Cross-Origin Resource Sharing (CORS) configuration.", - "items": { - "type": "object", - "properties": { - "maxAgeSeconds": { - "type": "integer", - "description": "The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.", - "format": "int32" - }, - "method": { - "type": "array", - "description": "The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: \"*\" is permitted in the list of methods, and means \"any method\".", - "items": { - "type": "string" + "kind": "discovery#restDescription", + "version": "v1", + "id": "storage:v1", + "rootUrl": "https://storage.googleapis.com/", + "mtlsRootUrl": "https://storage.mtls.googleapis.com/", + "baseUrl": "https://storage.googleapis.com/storage/v1/", + "basePath": "/storage/v1/", + "servicePath": "storage/v1/", + "batchPath": "batch/storage/v1", + "discoveryVersion": "v1", + "name": "storage", + "title": "Cloud Storage JSON API", + "description": "Stores and retrieves potentially large, immutable data objects.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", + "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" + }, + "documentationLink": "https://developers.google.com/storage/docs/json_api/", + "labels": [ + "labs" + ], + "endpoints": [ + { + "endpointUrl": "https://storage.me-central2.rep.googleapis.com/", + "location": "me-central2", + "description": "Regional Endpoint" } - }, - "origin": { - "type": "array", - "description": "The list of Origins eligible to receive CORS response headers. Note: \"*\" is permitted in the list of origins, and means \"any Origin\".", - "items": { - "type": "string" + ], + "protocol": "rest", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "Deprecated. Please use quotaUser instead.", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Upload protocol for media (e.g. \"media\", \"multipart\", \"resumable\").", + "location": "query" } - }, - "responseHeader": { - "type": "array", - "description": "The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.", - "items": { - "type": "string" + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + } + } } - } - } - } - }, - "customPlacementConfig": { - "type": "object", - "description": "The bucket's custom placement configuration for Custom Dual Regions.", - "properties": { - "dataLocations": { - "type": "array", - "description": "The list of regional locations in which data is placed.", - "items": { - "type": "string" - } - } - } - }, - "defaultEventBasedHold": { - "type": "boolean", - "description": "The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed." - }, - "defaultObjectAcl": { - "type": "array", - "description": "Default access controls to apply to new objects when no ACL is provided.", - "items": { - "$ref": "ObjectAccessControl" - } - }, - "encryption": { - "type": "object", - "description": "Encryption configuration for a bucket.", - "properties": { - "defaultKmsKeyName": { - "type": "string", - "description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified." - } - } }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the bucket." + "schemas": { + "Bucket": { + "id": "Bucket", + "type": "object", + "description": "A bucket.", + "properties": { + "acl": { + "type": "array", + "description": "Access controls on the bucket.", + "items": { + "$ref": "BucketAccessControl" + }, + "annotations": { + "required": [ + "storage.buckets.update" + ] + } + }, + "billing": { + "type": "object", + "description": "The bucket's billing configuration.", + "properties": { + "requesterPays": { + "type": "boolean", + "description": "When set to true, Requester Pays is enabled for this bucket." + } + } + }, + "cors": { + "type": "array", + "description": "The bucket's Cross-Origin Resource Sharing (CORS) configuration.", + "items": { + "type": "object", + "properties": { + "maxAgeSeconds": { + "type": "integer", + "description": "The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.", + "format": "int32" + }, + "method": { + "type": "array", + "description": "The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: \"*\" is permitted in the list of methods, and means \"any method\".", + "items": { + "type": "string" + } + }, + "origin": { + "type": "array", + "description": "The list of Origins eligible to receive CORS response headers. Note: \"*\" is permitted in the list of origins, and means \"any Origin\".", + "items": { + "type": "string" + } + }, + "responseHeader": { + "type": "array", + "description": "The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.", + "items": { + "type": "string" + } + } + } + } + }, + "customPlacementConfig": { + "type": "object", + "description": "The bucket's custom placement configuration for Custom Dual Regions.", + "properties": { + "dataLocations": { + "type": "array", + "description": "The list of regional locations in which data is placed.", + "items": { + "type": "string" + } + } + } + }, + "defaultEventBasedHold": { + "type": "boolean", + "description": "The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed." + }, + "defaultObjectAcl": { + "type": "array", + "description": "Default access controls to apply to new objects when no ACL is provided.", + "items": { + "$ref": "ObjectAccessControl" + } + }, + "encryption": { + "type": "object", + "description": "Encryption configuration for a bucket.", + "properties": { + "defaultKmsKeyName": { + "type": "string", + "description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified." + } + } + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the bucket." + }, + "hierarchicalNamespace": { + "type": "object", + "description": "The bucket's hierarchical namespace configuration.", + "properties": { + "enabled": { + "type": "boolean", + "description": "When set to true, hierarchical namespace is enabled for this bucket." + } + } }, "iamConfiguration": { - "type": "object", - "description": "The bucket's IAM configuration.", - "properties": { - "bucketPolicyOnly": { - "type": "object", - "description": "The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature.", - "properties": { - "enabled": { - "type": "boolean", - "description": "If set, access is controlled only by bucket-level or above IAM policies." - }, - "lockedTime": { - "type": "string", - "description": "The deadline for changing iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed from true to false until the locked time, after which the field is immutable.", - "format": "date-time" - } - } - }, - "uniformBucketLevelAccess": { - "type": "object", - "description": "The bucket's uniform bucket-level access configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "If set, access is controlled only by bucket-level or above IAM policies." - }, - "lockedTime": { - "type": "string", - "description": "The deadline for changing iamConfiguration.uniformBucketLevelAccess.enabled from true to false in RFC 3339 format. iamConfiguration.uniformBucketLevelAccess.enabled may be changed from true to false until the locked time, after which the field is immutable.", - "format": "date-time" + "type": "object", + "description": "The bucket's IAM configuration.", + "properties": { + "bucketPolicyOnly": { + "type": "object", + "description": "The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature.", + "properties": { + "enabled": { + "type": "boolean", + "description": "If set, access is controlled only by bucket-level or above IAM policies." + }, + "lockedTime": { + "type": "string", + "description": "The deadline for changing iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed from true to false until the locked time, after which the field is immutable.", + "format": "date-time" + } + } + }, + "uniformBucketLevelAccess": { + "type": "object", + "description": "The bucket's uniform bucket-level access configuration.", + "properties": { + "enabled": { + "type": "boolean", + "description": "If set, access is controlled only by bucket-level or above IAM policies." + }, + "lockedTime": { + "type": "string", + "description": "The deadline for changing iamConfiguration.uniformBucketLevelAccess.enabled from true to false in RFC 3339 format. iamConfiguration.uniformBucketLevelAccess.enabled may be changed from true to false until the locked time, after which the field is immutable.", + "format": "date-time" + } + } + }, + "publicAccessPrevention": { + "type": "string", + "description": "The bucket's Public Access Prevention configuration. Currently, 'inherited' and 'enforced' are supported." + } } - } - }, - "publicAccessPrevention": { - "type": "string", - "description": "The bucket's Public Access Prevention configuration. Currently, 'inherited' and 'enforced' are supported." - } - } }, "id": { - "type": "string", - "description": "The ID of the bucket. For buckets, the id and name properties are the same." + "type": "string", + "description": "The ID of the bucket. For buckets, the id and name properties are the same." }, "kind": { - "type": "string", - "description": "The kind of item this is. For buckets, this is always storage#bucket.", - "default": "storage#bucket" + "type": "string", + "description": "The kind of item this is. For buckets, this is always storage#bucket.", + "default": "storage#bucket" }, "labels": { - "type": "object", - "description": "User-provided labels, in key/value pairs.", - "additionalProperties": { - "type": "string", - "description": "An individual label entry." - } + "type": "object", + "description": "User-provided labels, in key/value pairs.", + "additionalProperties": { + "type": "string", + "description": "An individual label entry." + } }, "lifecycle": { - "type": "object", - "description": "The bucket's lifecycle configuration. See lifecycle management for more information.", - "properties": { - "rule": { - "type": "array", - "description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.", - "items": { "type": "object", + "description": "The bucket's lifecycle configuration. See lifecycle management for more information.", "properties": { - "action": { - "type": "object", - "description": "The action to take.", - "properties": { - "storageClass": { - "type": "string", - "description": "Target storage class. Required iff the type of the action is SetStorageClass." - }, - "type": { - "type": "string", - "description": "Type of the action. Currently, only Delete, SetStorageClass, and AbortIncompleteMultipartUpload are supported." - } - } - }, - "condition": { - "type": "object", - "description": "The condition(s) under which the action will be taken.", - "properties": { - "age": { - "type": "integer", - "description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.", - "format": "int32" - }, - "createdBefore": { - "type": "string", - "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.", - "format": "date" - }, - "customTimeBefore": { - "type": "string", - "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the custom time on an object is before this date in UTC.", - "format": "date" - }, - "daysSinceCustomTime": { - "type": "integer", - "description": "Number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply.", - "format": "int32" - }, - "daysSinceNoncurrentTime": { - "type": "integer", - "description": "Number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent.", - "format": "int32" - }, - "isLive": { - "type": "boolean", - "description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects." - }, - "matchesPattern": { - "type": "string", - "description": "A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the \"Early Access\" launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released." - }, - "matchesPrefix": { - "type": "array", - "description": "List of object name prefixes. This condition will be satisfied when at least one of the prefixes exactly matches the beginning of the object name.", - "items": { - "type": "string" - } - }, - "matchesSuffix": { - "type": "array", - "description": "List of object name suffixes. This condition will be satisfied when at least one of the suffixes exactly matches the end of the object name.", - "items": { - "type": "string" - } - }, - "matchesStorageClass": { - "type": "array", - "description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.", - "items": { - "type": "string" + "rule": { + "type": "array", + "description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.", + "items": { + "type": "object", + "properties": { + "action": { + "type": "object", + "description": "The action to take.", + "properties": { + "storageClass": { + "type": "string", + "description": "Target storage class. Required iff the type of the action is SetStorageClass." + }, + "type": { + "type": "string", + "description": "Type of the action. Currently, only Delete, SetStorageClass, and AbortIncompleteMultipartUpload are supported." + } + } + }, + "condition": { + "type": "object", + "description": "The condition(s) under which the action will be taken.", + "properties": { + "age": { + "type": "integer", + "description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.", + "format": "int32" + }, + "createdBefore": { + "type": "string", + "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.", + "format": "date" + }, + "customTimeBefore": { + "type": "string", + "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the custom time on an object is before this date in UTC.", + "format": "date" + }, + "daysSinceCustomTime": { + "type": "integer", + "description": "Number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply.", + "format": "int32" + }, + "daysSinceNoncurrentTime": { + "type": "integer", + "description": "Number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent.", + "format": "int32" + }, + "isLive": { + "type": "boolean", + "description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects." + }, + "matchesPattern": { + "type": "string", + "description": "A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the \"Early Access\" launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released." + }, + "matchesPrefix": { + "type": "array", + "description": "List of object name prefixes. This condition will be satisfied when at least one of the prefixes exactly matches the beginning of the object name.", + "items": { + "type": "string" + } + }, + "matchesSuffix": { + "type": "array", + "description": "List of object name suffixes. This condition will be satisfied when at least one of the suffixes exactly matches the end of the object name.", + "items": { + "type": "string" + } + }, + "matchesStorageClass": { + "type": "array", + "description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.", + "items": { + "type": "string" + } + }, + "noncurrentTimeBefore": { + "type": "string", + "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects.", + "format": "date" + }, + "numNewerVersions": { + "type": "integer", + "description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.", + "format": "int32" + } + } + } + } + } } - }, - "noncurrentTimeBefore": { - "type": "string", - "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects.", - "format": "date" - }, - "numNewerVersions": { - "type": "integer", - "description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.", - "format": "int32" - } - } - } } - } - } - } }, "autoclass": { - "type": "object", - "description": "The bucket's Autoclass configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether or not Autoclass is enabled on this bucket" - }, - "toggleTime": { - "type": "string", - "description": "A date and time in RFC 3339 format representing the instant at which \"enabled\" was last toggled.", - "format": "date-time" - }, - "terminalStorageClass": { - "type": "string", - "description": "The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE." - }, - "terminalStorageClassUpdateTime": { - "type": "string", - "description": "A date and time in RFC 3339 format representing the time of the most recent update to \"terminalStorageClass\".", - "format": "date-time" - } - } + "type": "object", + "description": "The bucket's Autoclass configuration.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether or not Autoclass is enabled on this bucket" + }, + "toggleTime": { + "type": "string", + "description": "A date and time in RFC 3339 format representing the instant at which \"enabled\" was last toggled.", + "format": "date-time" + }, + "terminalStorageClass": { + "type": "string", + "description": "The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE." + }, + "terminalStorageClassUpdateTime": { + "type": "string", + "description": "A date and time in RFC 3339 format representing the time of the most recent update to \"terminalStorageClass\".", + "format": "date-time" + } + } }, "location": { - "type": "string", - "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list." + "type": "string", + "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list." }, "locationType": { - "type": "string", - "description": "The type of the bucket location." + "type": "string", + "description": "The type of the bucket location." }, "logging": { - "type": "object", - "description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.", - "properties": { - "logBucket": { - "type": "string", - "description": "The destination bucket where the current bucket's logs should be placed." - }, - "logObjectPrefix": { - "type": "string", - "description": "A prefix for log object names." - } - } + "type": "object", + "description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.", + "properties": { + "logBucket": { + "type": "string", + "description": "The destination bucket where the current bucket's logs should be placed." + }, + "logObjectPrefix": { + "type": "string", + "description": "A prefix for log object names." + } + } }, "metageneration": { - "type": "string", - "description": "The metadata generation of this bucket.", - "format": "int64" + "type": "string", + "description": "The metadata generation of this bucket.", + "format": "int64" }, "name": { - "type": "string", - "description": "The name of the bucket.", - "annotations": { - "required": [ - "storage.buckets.insert" - ] - } + "type": "string", + "description": "The name of the bucket.", + "annotations": { + "required": [ + "storage.buckets.insert" + ] + } }, "owner": { - "type": "object", - "description": "The owner of the bucket. This is always the project team's owner group.", - "properties": { - "entity": { - "type": "string", - "description": "The entity, in the form project-owner-projectId." - }, - "entityId": { - "type": "string", - "description": "The ID for the entity." - } - } + "type": "object", + "description": "The owner of the bucket. This is always the project team's owner group.", + "properties": { + "entity": { + "type": "string", + "description": "The entity, in the form project-owner-projectId." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity." + } + } }, "projectNumber": { - "type": "string", - "description": "The project number of the project the bucket belongs to.", - "format": "uint64" + "type": "string", + "description": "The project number of the project the bucket belongs to.", + "format": "uint64" }, "retentionPolicy": { - "type": "object", - "description": "The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.", - "properties": { - "effectiveTime": { - "type": "string", - "description": "Server-determined value that indicates the time from which policy was enforced and effective. This value is in RFC 3339 format.", - "format": "date-time" - }, - "isLocked": { - "type": "boolean", - "description": "Once locked, an object retention policy cannot be modified." - }, - "retentionPeriod": { - "type": "string", - "description": "The duration in seconds that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.", - "format": "int64" - } - } + "type": "object", + "description": "The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.", + "properties": { + "effectiveTime": { + "type": "string", + "description": "Server-determined value that indicates the time from which policy was enforced and effective. This value is in RFC 3339 format.", + "format": "date-time" + }, + "isLocked": { + "type": "boolean", + "description": "Once locked, an object retention policy cannot be modified." + }, + "retentionPeriod": { + "type": "string", + "description": "The duration in seconds that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.", + "format": "int64" + } + } }, "objectRetention": { - "type": "object", - "description": "The bucket's object retention config.", - "properties": { - "mode": { - "type": "string", - "description": "The bucket's object retention mode. Can be Enabled." - } - } + "type": "object", + "description": "The bucket's object retention config.", + "properties": { + "mode": { + "type": "string", + "description": "The bucket's object retention mode. Can be Enabled." + } + } }, "rpo": { - "type": "string", - "description": "The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket." + "type": "string", + "description": "The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket." }, "selfLink": { - "type": "string", - "description": "The URI of this bucket." + "type": "string", + "description": "The URI of this bucket." }, "softDeletePolicy": { - "type": "object", - "description": "The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted.", - "properties": { - "retentionDurationSeconds": { - "type": "string", - "description": "The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted.", - "format": "int64" - }, - "effectiveTime": { - "type": "string", - "description": "Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.", - "format": "date-time" - } - } + "type": "object", + "description": "The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted.", + "properties": { + "retentionDurationSeconds": { + "type": "string", + "description": "The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted.", + "format": "int64" + }, + "effectiveTime": { + "type": "string", + "description": "Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.", + "format": "date-time" + } + } }, "storageClass": { - "type": "string", - "description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes." + "type": "string", + "description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes." }, "timeCreated": { - "type": "string", - "description": "The creation time of the bucket in RFC 3339 format.", - "format": "date-time" + "type": "string", + "description": "The creation time of the bucket in RFC 3339 format.", + "format": "date-time" }, "updated": { - "type": "string", - "description": "The modification time of the bucket in RFC 3339 format.", - "format": "date-time" + "type": "string", + "description": "The modification time of the bucket in RFC 3339 format.", + "format": "date-time" }, "versioning": { - "type": "object", - "description": "The bucket's versioning configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "While set to true, versioning is fully enabled for this bucket." - } - } + "type": "object", + "description": "The bucket's versioning configuration.", + "properties": { + "enabled": { + "type": "boolean", + "description": "While set to true, versioning is fully enabled for this bucket." + } + } }, "website": { - "type": "object", - "description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.", - "properties": { - "mainPageSuffix": { - "type": "string", - "description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages." - }, - "notFoundPage": { - "type": "string", - "description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result." - } - } + "type": "object", + "description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.", + "properties": { + "mainPageSuffix": { + "type": "string", + "description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages." + }, + "notFoundPage": { + "type": "string", + "description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result." + } + } }, "satisfiesPZS": { - "type": "boolean", - "description": "Reserved for future use." + "type": "boolean", + "description": "Reserved for future use." } - } - }, - "AnywhereCache": { - "id": "AnywhereCache", - "type": "object", - "description": "An Anywhere Cache instance.", - "properties": { +} +}, +"AnywhereCache": { +"id": "AnywhereCache", +"type": "object", +"description": "An Anywhere Cache instance.", +"properties": { "kind": { - "type": "string", - "description": "The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache.", - "default": "storage#anywhereCache" + "type": "string", + "description": "The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache.", + "default": "storage#anywhereCache" }, "id": { - "type": "string", - "description": "The ID of the resource, including the project number, bucket name and anywhere cache ID." + "type": "string", + "description": "The ID of the resource, including the project number, bucket name and anywhere cache ID." }, "selfLink": { - "type": "string", - "description": "The link to this cache instance." + "type": "string", + "description": "The link to this cache instance." }, "bucket": { - "type": "string", - "description": "The name of the bucket containing this cache instance." + "type": "string", + "description": "The name of the bucket containing this cache instance." }, "anywhereCacheId": { - "type": "string", - "description": "The ID of the Anywhere cache instance." + "type": "string", + "description": "The ID of the Anywhere cache instance." + }, + "zone": { + "type": "string", + "description": "The zone in which the cache instance is running. For example, us-central1-a." }, "state": { - "type": "string", - "description": "The current state of the cache instance." + "type": "string", + "description": "The current state of the cache instance." }, "createTime": { - "type": "string", - "description": "The creation time of the cache instance in RFC 3339 format.", - "format": "date-time" + "type": "string", + "description": "The creation time of the cache instance in RFC 3339 format.", + "format": "date-time" }, "updateTime": { - "type": "string", - "description": "The modification time of the cache instance metadata in RFC 3339 format.", - "format": "date-time" + "type": "string", + "description": "The modification time of the cache instance metadata in RFC 3339 format.", + "format": "date-time" }, "ttl": { - "type": "string", - "description": "The TTL of all cache entries in whole seconds. e.g., \"7200s\". ", - "format": "google-duration" + "type": "string", + "description": "The TTL of all cache entries in whole seconds. e.g., \"7200s\". ", + "format": "google-duration" }, "admissionPolicy": { - "type": "string", - "description": "The cache-level entry admission policy." + "type": "string", + "description": "The cache-level entry admission policy." }, "pendingUpdate": { - "type": "boolean", - "description": "True if the cache instance has an active Update long-running operation." + "type": "boolean", + "description": "True if the cache instance has an active Update long-running operation." } - } - }, - "AnywhereCaches": { - "id": "AnywhereCaches", - "type": "object", - "description": "A list of Anywhere Caches.", - "properties": { +} +}, +"AnywhereCaches": { +"id": "AnywhereCaches", +"type": "object", +"description": "A list of Anywhere Caches.", +"properties": { "kind": { - "type": "string", - "description": "The kind of item this is. For lists of Anywhere Caches, this is always storage#anywhereCaches.", - "default": "storage#anywhereCaches" + "type": "string", + "description": "The kind of item this is. For lists of Anywhere Caches, this is always storage#anywhereCaches.", + "default": "storage#anywhereCaches" }, "nextPageToken": { - "type": "string", - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." }, "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "AnywhereCache" - } + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "AnywhereCache" + } } - } - }, - "BucketAccessControl": { - "id": "BucketAccessControl", - "type": "object", - "description": "An access-control entry.", - "properties": { +} +}, +"BucketAccessControl": { +"id": "BucketAccessControl", +"type": "object", +"description": "An access-control entry.", +"properties": { "bucket": { - "type": "string", - "description": "The name of the bucket." + "type": "string", + "description": "The name of the bucket." }, "domain": { - "type": "string", - "description": "The domain associated with the entity, if any." + "type": "string", + "description": "The domain associated with the entity, if any." }, "email": { - "type": "string", - "description": "The email address associated with the entity, if any." + "type": "string", + "description": "The email address associated with the entity, if any." }, "entity": { - "type": "string", - "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", - "annotations": { - "required": [ - "storage.bucketAccessControls.insert" - ] - } + "type": "string", + "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", + "annotations": { + "required": [ + "storage.bucketAccessControls.insert" + ] + } }, "entityId": { - "type": "string", - "description": "The ID for the entity, if any." + "type": "string", + "description": "The ID for the entity, if any." }, "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the access-control entry." + "type": "string", + "description": "HTTP 1.1 Entity tag for the access-control entry." }, "id": { - "type": "string", - "description": "The ID of the access-control entry." + "type": "string", + "description": "The ID of the access-control entry." }, "kind": { - "type": "string", - "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.", - "default": "storage#bucketAccessControl" + "type": "string", + "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.", + "default": "storage#bucketAccessControl" }, "projectTeam": { - "type": "object", - "description": "The project team associated with the entity, if any.", - "properties": { - "projectNumber": { - "type": "string", - "description": "The project number." - }, - "team": { - "type": "string", - "description": "The team." - } - } + "type": "object", + "description": "The project team associated with the entity, if any.", + "properties": { + "projectNumber": { + "type": "string", + "description": "The project number." + }, + "team": { + "type": "string", + "description": "The team." + } + } }, "role": { - "type": "string", - "description": "The access permission for the entity.", - "annotations": { - "required": [ - "storage.bucketAccessControls.insert" - ] - } + "type": "string", + "description": "The access permission for the entity.", + "annotations": { + "required": [ + "storage.bucketAccessControls.insert" + ] + } }, "selfLink": { - "type": "string", - "description": "The link to this access-control entry." + "type": "string", + "description": "The link to this access-control entry." } - } - }, - "BucketAccessControls": { - "id": "BucketAccessControls", - "type": "object", - "description": "An access-control list.", - "properties": { +} +}, +"BucketAccessControls": { +"id": "BucketAccessControls", +"type": "object", +"description": "An access-control list.", +"properties": { "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "BucketAccessControl" - } + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "BucketAccessControl" + } }, "kind": { - "type": "string", - "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.", - "default": "storage#bucketAccessControls" + "type": "string", + "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.", + "default": "storage#bucketAccessControls" } - } - }, - "Buckets": { - "id": "Buckets", - "type": "object", - "description": "A list of buckets.", - "properties": { +} +}, +"Buckets": { +"id": "Buckets", +"type": "object", +"description": "A list of buckets.", +"properties": { "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "Bucket" - } + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Bucket" + } }, "kind": { - "type": "string", - "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.", - "default": "storage#buckets" + "type": "string", + "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.", + "default": "storage#buckets" }, "nextPageToken": { - "type": "string", - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." } - } - }, - "Channel": { - "id": "Channel", - "type": "object", - "description": "An notification channel used to watch for resource changes.", - "properties": { +} +}, +"Channel": { +"id": "Channel", +"type": "object", +"description": "An notification channel used to watch for resource changes.", +"properties": { "address": { - "type": "string", - "description": "The address where notifications are delivered for this channel." + "type": "string", + "description": "The address where notifications are delivered for this channel." }, "expiration": { - "type": "string", - "description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.", - "format": "int64" + "type": "string", + "description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.", + "format": "int64" }, "id": { - "type": "string", - "description": "A UUID or similar unique string that identifies this channel." + "type": "string", + "description": "A UUID or similar unique string that identifies this channel." }, "kind": { - "type": "string", - "description": "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".", - "default": "api#channel" + "type": "string", + "description": "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".", + "default": "api#channel" }, "params": { - "type": "object", - "description": "Additional parameters controlling delivery channel behavior. Optional.", - "additionalProperties": { - "type": "string", - "description": "Declares a new parameter by name." - } + "type": "object", + "description": "Additional parameters controlling delivery channel behavior. Optional.", + "additionalProperties": { + "type": "string", + "description": "Declares a new parameter by name." + } }, "payload": { - "type": "boolean", - "description": "A Boolean value to indicate whether payload is wanted. Optional." + "type": "boolean", + "description": "A Boolean value to indicate whether payload is wanted. Optional." }, "resourceId": { - "type": "string", - "description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions." + "type": "string", + "description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions." }, "resourceUri": { - "type": "string", - "description": "A version-specific identifier for the watched resource." + "type": "string", + "description": "A version-specific identifier for the watched resource." }, "token": { - "type": "string", - "description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional." + "type": "string", + "description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional." }, "type": { - "type": "string", - "description": "The type of delivery mechanism used for this channel." + "type": "string", + "description": "The type of delivery mechanism used for this channel." } - } - }, - "ComposeRequest": { - "id": "ComposeRequest", - "type": "object", - "description": "A Compose request.", - "properties": { +} +}, +"ComposeRequest": { +"id": "ComposeRequest", +"type": "object", +"description": "A Compose request.", +"properties": { "destination": { - "$ref": "Object", - "description": "Properties of the resulting object." + "$ref": "Object", + "description": "Properties of the resulting object." }, "kind": { - "type": "string", - "description": "The kind of item this is.", - "default": "storage#composeRequest" + "type": "string", + "description": "The kind of item this is.", + "default": "storage#composeRequest" }, "sourceObjects": { - "type": "array", - "description": "The list of source objects that will be concatenated into a single object.", - "items": { - "type": "object", - "properties": { - "generation": { - "type": "string", - "description": "The generation of this object to use as the source.", - "format": "int64" - }, - "name": { - "type": "string", - "description": "The source object's name. All source objects must reside in the same bucket.", + "type": "array", + "description": "The list of source objects that will be concatenated into a single object.", + "items": { + "type": "object", + "properties": { + "generation": { + "type": "string", + "description": "The generation of this object to use as the source.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The source object's name. All source objects must reside in the same bucket.", + "annotations": { + "required": [ + "storage.objects.compose" + ] + } + }, + "objectPreconditions": { + "type": "object", + "description": "Conditions that must be met for this operation to execute.", + "properties": { + "ifGenerationMatch": { + "type": "string", + "description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.", + "format": "int64" + } + } + } + } + }, "annotations": { - "required": [ - "storage.objects.compose" - ] + "required": [ + "storage.objects.compose" + ] } - }, - "objectPreconditions": { + } +} +}, + "Folder": { + "id": "Folder", "type": "object", - "description": "Conditions that must be met for this operation to execute.", + "description": "A folder. Only available in buckets with hierarchical namespace enabled.", "properties": { - "ifGenerationMatch": { - "type": "string", - "description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.", - "format": "int64" - } + "bucket": { + "type": "string", + "description": "The name of the bucket containing this folder." + }, + "id": { + "type": "string", + "description": "The ID of the folder, including the bucket name, folder name." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For folders, this is always storage#folder.", + "default": "storage#folder" + }, + "metageneration": { + "type": "string", + "description": "The version of the metadata for this folder. Used for preconditions and for detecting changes in metadata.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of the folder. Required if not specified by URL parameter." + }, + "selfLink": { + "type": "string", + "description": "The link to this folder." + }, + "createTime": { + "type": "string", + "description": "The creation time of the folder in RFC 3339 format.", + "format": "date-time" + }, + "updateTime": { + "type": "string", + "description": "The modification time of the folder metadata in RFC 3339 format.", + "format": "date-time" + }, + "pendingRenameInfo": { + "type": "object", + "description": "Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status.", + "properties": { + "operationId": { + "type": "string", + "description": "The ID of the rename folder operation." + } + } + } } - } - } - }, - "annotations": { - "required": [ - "storage.objects.compose" - ] - } - } - } - }, - "Expr": { - "id": "Expr", - "type": "object", - "description": "Represents an expression text. Example: title: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) > 0\"", - "properties": { - "description": { - "type": "string", - "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI." - }, - "expression": { - "type": "string", - "description": "Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported." - }, - "location": { - "type": "string", - "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file." - }, - "title": { - "type": "string", - "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression." - } - } - }, - "GoogleLongrunningOperation": { - "description": "This resource represents a long-running operation that is the result of a network API call.", - "id": "GoogleLongrunningOperation", - "properties": { - "done": { - "description": "If the value is \"false\", it means the operation is still in progress. If \"true\", the operation is completed, and either \"error\" or \"response\" is available.", - "type": "boolean" - }, - "error": { - "$ref": "GoogleRpcStatus", - "description": "The error result of the operation in case of failure or cancellation." - }, - "metadata": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", - "type": "object" }, - "name": { - "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the \"name\" should be a resource name ending with \"operations/{operationId}\".", - "type": "string" + "Folders": { + "id": "Folders", + "type": "object", + "description": "A list of folders.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Folder" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of folders, this is always storage#folders.", + "default": "storage#folders" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } }, - "response": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as \"Delete\", the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type \"XxxResponse\", where \"Xxx\" is the original method name. For example, if the original method name is \"TakeSnapshot()\", the inferred response type is \"TakeSnapshotResponse\".", - "type": "object" - } - }, - "type": "object" - }, - "GoogleLongrunningListOperationsResponse": { - "description": "The response message for storage.buckets.operations.list.", - "id": "GoogleLongrunningListOperationsResponse", - "properties": { - "nextPageToken": { - "type": "string", - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." - }, - "operations": { - "description": "A list of operations that matches the specified filter in the request.", - "items": { - "$ref": "GoogleLongrunningOperation" - }, - "type": "array" - } - }, - "type": "object" - }, - "GoogleRpcStatus": { - "description": "The \"Status\" type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each \"Status\" message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", - "id": "GoogleRpcStatus", - "properties": { - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "details": { - "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", - "items": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "type": "object" - }, - "type": "array" - }, - "message": { - "description": "A developer-facing error message, which should be in English.", - "type": "string" - } - }, - "type": "object" - }, - "HmacKey": { - "id": "HmacKey", - "type": "object", - "description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.", - "properties": { - "kind": { - "type": "string", - "description": "The kind of item this is. For HMAC keys, this is always storage#hmacKey.", - "default": "storage#hmacKey" + "Expr": { + "id": "Expr", + "type": "object", + "description": "Represents an expression text. Example: title: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) > 0\"", + "properties": { + "description": { + "type": "string", + "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI." + }, + "expression": { + "type": "string", + "description": "Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported." + }, + "location": { + "type": "string", + "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file." + }, + "title": { + "type": "string", + "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression." + } + } }, - "metadata": { - "$ref": "HmacKeyMetadata", - "description": "Key metadata." + "GoogleLongrunningOperation": { + "description": "This resource represents a long-running operation that is the result of a network API call.", + "id": "GoogleLongrunningOperation", + "properties": { + "done": { + "description": "If the value is \"false\", it means the operation is still in progress. If \"true\", the operation is completed, and either \"error\" or \"response\" is available.", + "type": "boolean" + }, + "error": { + "$ref": "GoogleRpcStatus", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the \"name\" should be a resource name ending with \"operations/{operationId}\".", + "type": "string" + }, + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as \"Delete\", the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type \"XxxResponse\", where \"Xxx\" is the original method name. For example, if the original method name is \"TakeSnapshot()\", the inferred response type is \"TakeSnapshotResponse\".", + "type": "object" + } + }, + "type": "object" }, - "secret": { - "type": "string", - "description": "HMAC secret key material." - } - } - }, - "HmacKeyMetadata": { - "id": "HmacKeyMetadata", - "type": "object", - "description": "JSON template to produce a JSON-style HMAC Key metadata resource.", - "properties": { - "accessId": { - "type": "string", - "description": "The ID of the HMAC Key." + "GoogleLongrunningListOperationsResponse": { + "description": "The response message for storage.buckets.operations.list.", + "id": "GoogleLongrunningListOperationsResponse", + "properties": { + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "GoogleLongrunningOperation" + }, + "type": "array" + } + }, + "type": "object" }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the HMAC key." + "GoogleRpcStatus": { + "description": "The \"Status\" type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each \"Status\" message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", + "id": "GoogleRpcStatus", + "properties": { + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "A developer-facing error message, which should be in English.", + "type": "string" + } + }, + "type": "object" }, - "id": { - "type": "string", - "description": "The ID of the HMAC key, including the Project ID and the Access ID." + "HmacKey": { + "id": "HmacKey", + "type": "object", + "description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of item this is. For HMAC keys, this is always storage#hmacKey.", + "default": "storage#hmacKey" + }, + "metadata": { + "$ref": "HmacKeyMetadata", + "description": "Key metadata." + }, + "secret": { + "type": "string", + "description": "HMAC secret key material." + } + } }, - "kind": { - "type": "string", - "description": "The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.", - "default": "storage#hmacKeyMetadata" + "HmacKeyMetadata": { + "id": "HmacKeyMetadata", + "type": "object", + "description": "JSON template to produce a JSON-style HMAC Key metadata resource.", + "properties": { + "accessId": { + "type": "string", + "description": "The ID of the HMAC Key." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the HMAC key." + }, + "id": { + "type": "string", + "description": "The ID of the HMAC key, including the Project ID and the Access ID." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.", + "default": "storage#hmacKeyMetadata" + }, + "projectId": { + "type": "string", + "description": "Project ID owning the service account to which the key authenticates." + }, + "selfLink": { + "type": "string", + "description": "The link to this resource." + }, + "serviceAccountEmail": { + "type": "string", + "description": "The email address of the key's associated service account." + }, + "state": { + "type": "string", + "description": "The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED." + }, + "timeCreated": { + "type": "string", + "description": "The creation time of the HMAC key in RFC 3339 format.", + "format": "date-time" + }, + "updated": { + "type": "string", + "description": "The last modification time of the HMAC key metadata in RFC 3339 format.", + "format": "date-time" + } + } }, - "projectId": { - "type": "string", - "description": "Project ID owning the service account to which the key authenticates." + "HmacKeysMetadata": { + "id": "HmacKeysMetadata", + "type": "object", + "description": "A list of hmacKeys.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "HmacKeyMetadata" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.", + "default": "storage#hmacKeysMetadata" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } }, - "selfLink": { - "type": "string", - "description": "The link to this resource." + "ManagedFolder": { + "id": "ManagedFolder", + "type": "object", + "description": "A managed folder.", + "properties": { + "bucket": { + "type": "string", + "description": "The name of the bucket containing this managed folder." + }, + "id": { + "type": "string", + "description": "The ID of the managed folder, including the bucket name and managed folder name." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For managed folders, this is always storage#managedFolder.", + "default": "storage#managedFolder" + }, + "metageneration": { + "type": "string", + "description": "The version of the metadata for this managed folder. Used for preconditions and for detecting changes in metadata.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of the managed folder. Required if not specified by URL parameter." + }, + "selfLink": { + "type": "string", + "description": "The link to this managed folder." + }, + "createTime": { + "type": "string", + "description": "The creation time of the managed folder in RFC 3339 format.", + "format": "date-time" + }, + "updateTime": { + "type": "string", + "description": "The last update time of the managed folder metadata in RFC 3339 format.", + "format": "date-time" + } + } }, - "serviceAccountEmail": { - "type": "string", - "description": "The email address of the key's associated service account." + "ManagedFolders": { + "id": "ManagedFolders", + "type": "object", + "description": "A list of managed folders.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "ManagedFolder" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of managed folders, this is always storage#managedFolders.", + "default": "storage#managedFolders" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } }, - "state": { - "type": "string", - "description": "The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED." + "Notification": { + "id": "Notification", + "type": "object", + "description": "A subscription to receive Google PubSub notifications.", + "properties": { + "custom_attributes": { + "type": "object", + "description": "An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.", + "additionalProperties": { + "type": "string" + } + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for this subscription notification." + }, + "event_types": { + "type": "array", + "description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "The ID of the notification." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For notifications, this is always storage#notification.", + "default": "storage#notification" + }, + "object_name_prefix": { + "type": "string", + "description": "If present, only apply this notification configuration to object names that begin with this prefix." + }, + "payload_format": { + "type": "string", + "description": "The desired content of the Payload.", + "default": "JSON_API_V1", + "annotations": { + "required": [ + "storage.notifications.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The canonical URL of this notification." + }, + "topic": { + "type": "string", + "description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'", + "annotations": { + "required": [ + "storage.notifications.insert" + ] + } + } + } }, - "timeCreated": { - "type": "string", - "description": "The creation time of the HMAC key in RFC 3339 format.", - "format": "date-time" + "Notifications": { + "id": "Notifications", + "type": "object", + "description": "A list of notification subscriptions.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Notification" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of notifications, this is always storage#notifications.", + "default": "storage#notifications" + } + } }, - "updated": { - "type": "string", - "description": "The last modification time of the HMAC key metadata in RFC 3339 format.", - "format": "date-time" - } - } - }, - "HmacKeysMetadata": { - "id": "HmacKeysMetadata", - "type": "object", - "description": "A list of hmacKeys.", - "properties": { - "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "HmacKeyMetadata" - } + "Object": { + "id": "Object", + "type": "object", + "description": "An object.", + "properties": { + "acl": { + "type": "array", + "description": "Access controls on the object.", + "items": { + "$ref": "ObjectAccessControl" + }, + "annotations": { + "required": [ + "storage.objects.update" + ] + } + }, + "bucket": { + "type": "string", + "description": "The name of the bucket containing this object." + }, + "cacheControl": { + "type": "string", + "description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600." + }, + "componentCount": { + "type": "integer", + "description": "Number of underlying components that make up this object. Components are accumulated by compose operations.", + "format": "int32" + }, + "contentDisposition": { + "type": "string", + "description": "Content-Disposition of the object data." + }, + "contentEncoding": { + "type": "string", + "description": "Content-Encoding of the object data." + }, + "contentLanguage": { + "type": "string", + "description": "Content-Language of the object data." + }, + "contentType": { + "type": "string", + "description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream." + }, + "crc32c": { + "type": "string", + "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices." + }, + "customTime": { + "type": "string", + "description": "A timestamp in RFC 3339 format specified by the user for an object.", + "format": "date-time" + }, + "customerEncryption": { + "type": "object", + "description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.", + "properties": { + "encryptionAlgorithm": { + "type": "string", + "description": "The encryption algorithm." + }, + "keySha256": { + "type": "string", + "description": "SHA256 hash value of the encryption key." + } + } + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the object." + }, + "eventBasedHold": { + "type": "boolean", + "description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false." + }, + "generation": { + "type": "string", + "description": "The content generation of this object. Used for object versioning.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The ID of the object, including the bucket name, object name, and generation number." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For objects, this is always storage#object.", + "default": "storage#object" + }, + "kmsKeyName": { + "type": "string", + "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request." + }, + "md5Hash": { + "type": "string", + "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices." + }, + "mediaLink": { + "type": "string", + "description": "Media download link." + }, + "metadata": { + "type": "object", + "description": "User-provided metadata, in key/value pairs.", + "additionalProperties": { + "type": "string", + "description": "An individual metadata entry." + } + }, + "metageneration": { + "type": "string", + "description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of the object. Required if not specified by URL parameter." + }, + "owner": { + "type": "object", + "description": "The owner of the object. This will always be the uploader of the object.", + "properties": { + "entity": { + "type": "string", + "description": "The entity, in the form user-userId." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity." + } + } + }, + "retentionExpirationTime": { + "type": "string", + "description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).", + "format": "date-time" + }, + "retention": { + "type": "object", + "description": "A collection of object level retention parameters.", + "properties": { + "retainUntilTime": { + "type": "string", + "description": "A time in RFC 3339 format until which object retention protects this object.", + "format": "date-time" + }, + "mode": { + "type": "string", + "description": "The bucket's object retention mode, can only be Unlocked or Locked." + } + } + }, + "selfLink": { + "type": "string", + "description": "The link to this object." + }, + "size": { + "type": "string", + "description": "Content-Length of the data in bytes.", + "format": "uint64" + }, + "storageClass": { + "type": "string", + "description": "Storage class of the object." + }, + "temporaryHold": { + "type": "boolean", + "description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object." + }, + "timeCreated": { + "type": "string", + "description": "The creation time of the object in RFC 3339 format.", + "format": "date-time" + }, + "timeDeleted": { + "type": "string", + "description": "The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.", + "format": "date-time" + }, + "softDeleteTime": { + "type": "string", + "description": "The time at which the object became soft-deleted in RFC 3339 format.", + "format": "date-time" + }, + "hardDeleteTime": { + "type": "string", + "description": "This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.", + "format": "date-time" + }, + "timeStorageClassUpdated": { + "type": "string", + "description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.", + "format": "date-time" + }, + "updated": { + "type": "string", + "description": "The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.", + "format": "date-time" + } + } }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.", - "default": "storage#hmacKeysMetadata" + "ObjectAccessControl": { + "id": "ObjectAccessControl", + "type": "object", + "description": "An access-control entry.", + "properties": { + "bucket": { + "type": "string", + "description": "The name of the bucket." + }, + "domain": { + "type": "string", + "description": "The domain associated with the entity, if any." + }, + "email": { + "type": "string", + "description": "The email address associated with the entity, if any." + }, + "entity": { + "type": "string", + "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", + "annotations": { + "required": [ + "storage.defaultObjectAccessControls.insert", + "storage.objectAccessControls.insert" + ] + } + }, + "entityId": { + "type": "string", + "description": "The ID for the entity, if any." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the access-control entry." + }, + "generation": { + "type": "string", + "description": "The content generation of the object, if applied to an object.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The ID of the access-control entry." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.", + "default": "storage#objectAccessControl" + }, + "object": { + "type": "string", + "description": "The name of the object, if applied to an object." + }, + "projectTeam": { + "type": "object", + "description": "The project team associated with the entity, if any.", + "properties": { + "projectNumber": { + "type": "string", + "description": "The project number." + }, + "team": { + "type": "string", + "description": "The team." + } + } + }, + "role": { + "type": "string", + "description": "The access permission for the entity.", + "annotations": { + "required": [ + "storage.defaultObjectAccessControls.insert", + "storage.objectAccessControls.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The link to this access-control entry." + } + } }, - "nextPageToken": { - "type": "string", - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + "ObjectAccessControls": { + "id": "ObjectAccessControls", + "type": "object", + "description": "An access-control list.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "ObjectAccessControl" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.", + "default": "storage#objectAccessControls" + } + } + }, + "Objects": { + "id": "Objects", + "type": "object", + "description": "A list of objects.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Object" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of objects, this is always storage#objects.", + "default": "storage#objects" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "prefixes": { + "type": "array", + "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.", + "items": { + "type": "string" + } + } + } + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "A bucket/object/managedFolder IAM policy.", + "properties": { + "bindings": { + "type": "array", + "description": "An association between a role, which comes with a set of permissions, and members who may assume that role.", + "items": { + "type": "object", + "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently." + }, + "members": { + "type": "array", + "description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers \u2014 A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers \u2014 A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid \u2014 An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid \u2014 An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid \u2014 An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain \u2014 A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid \u2014 Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid \u2014 Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid \u2014 Viewers of the given project. For example, projectViewer:my-example-project", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "storage.buckets.setIamPolicy", + "storage.objects.setIamPolicy", + "storage.managedFolders.setIamPolicy" + ] + } + }, + "role": { + "type": "string", + "description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin \u2014 Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer \u2014 Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator \u2014 Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin \u2014 Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader \u2014 Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner \u2014 Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader \u2014 Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter \u2014 Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner \u2014 Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.", + "annotations": { + "required": [ + "storage.buckets.setIamPolicy", + "storage.objects.setIamPolicy", + "storage.managedFolders.setIamPolicy" + ] + } + } + } + }, + "annotations": { + "required": [ + "storage.buckets.setIamPolicy", + "storage.objects.setIamPolicy", + "storage.managedFolders.setIamPolicy" + ] + } + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the policy.", + "format": "byte" + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.", + "default": "storage#policy" + }, + "resourceId": { + "type": "string", + "description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input." + }, + "version": { + "type": "integer", + "description": "The IAM policy format version.", + "format": "int32" + } + } + }, + "RewriteResponse": { + "id": "RewriteResponse", + "type": "object", + "description": "A rewrite response.", + "properties": { + "done": { + "type": "boolean", + "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response." + }, + "kind": { + "type": "string", + "description": "The kind of item this is.", + "default": "storage#rewriteResponse" + }, + "objectSize": { + "type": "string", + "description": "The total size of the object being copied in bytes. This property is always present in the response.", + "format": "int64" + }, + "resource": { + "$ref": "Object", + "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes." + }, + "rewriteToken": { + "type": "string", + "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy." + }, + "totalBytesRewritten": { + "type": "string", + "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.", + "format": "int64" + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A subscription to receive Google PubSub notifications.", + "properties": { + "email_address": { + "type": "string", + "description": "The ID of the notification." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For notifications, this is always storage#notification.", + "default": "storage#serviceAccount" + } + } + }, + "TestIamPermissionsResponse": { + "id": "TestIamPermissionsResponse", + "type": "object", + "description": "A storage.(buckets|objects|managedFolders).testIamPermissions response.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of item this is.", + "default": "storage#testIamPermissionsResponse" + }, + "permissions": { + "type": "array", + "description": "The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets, objects, or managedFolders. The supported permissions are as follows: \n- storage.buckets.delete \u2014 Delete bucket. \n- storage.buckets.get \u2014 Read bucket metadata. \n- storage.buckets.getIamPolicy \u2014 Read bucket IAM policy. \n- storage.buckets.create \u2014 Create bucket. \n- storage.buckets.list \u2014 List buckets. \n- storage.buckets.setIamPolicy \u2014 Update bucket IAM policy. \n- storage.buckets.update \u2014 Update bucket metadata. \n- storage.objects.delete \u2014 Delete object. \n- storage.objects.get \u2014 Read object data and metadata. \n- storage.objects.getIamPolicy \u2014 Read object IAM policy. \n- storage.objects.create \u2014 Create object. \n- storage.objects.list \u2014 List objects. \n- storage.objects.setIamPolicy \u2014 Update object IAM policy. \n- storage.objects.update \u2014 Update object metadata. \n- storage.managedFolders.delete \u2014 Delete managed folder. \n- storage.managedFolders.get \u2014 Read managed folder metadata. \n- storage.managedFolders.getIamPolicy \u2014 Read managed folder IAM policy. \n- storage.managedFolders.create \u2014 Create managed folder. \n- storage.managedFolders.list \u2014 List managed folders. \n- storage.managedFolders.setIamPolicy \u2014 Update managed folder IAM policy.", + "items": { + "type": "string" + } + } + } + }, + "BulkRestoreObjectsRequest": { + "id": "BulkRestoreObjectsRequest", + "type": "object", + "description": "A bulk restore objects request.", + "properties": { + "allowOverwrite": { + "type": "boolean", + "description": "If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue." + }, + "softDeletedAfterTime": { + "type": "string", + "description": "Restores only the objects that were soft-deleted after this time.", + "format": "date-time" + }, + "softDeletedBeforeTime": { + "type": "string", + "description": "Restores only the objects that were soft-deleted before this time.", + "format": "date-time" + }, + "matchGlobs": { + "type": "array", + "description": "Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.", + "items": { + "type": "string" + } + }, + "copySourceAcl": { + "type": "boolean", + "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false." + } + } + } +}, +"resources": { + "anywhereCaches": { + "methods": { + "insert": { + "id": "storage.anywhereCaches.insert", + "path": "b/{bucket}/anywhereCaches", + "httpMethod": "POST", + "description": "Creates an Anywhere Cache instance.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the parent bucket.", + "required": true, + "location": "path" + } +}, +"parameterOrder": [ + "bucket" +], +"request": { + "$ref": "AnywhereCache" +}, +"response": { + "$ref": "GoogleLongrunningOperation" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"update": { +"id": "storage.anywhereCaches.update", +"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}", +"httpMethod": "PATCH", +"description": "Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the parent bucket.", + "required": true, + "location": "path" + }, + "anywhereCacheId": { + "type": "string", + "description": "The ID of requested Anywhere Cache instance.", + "required": true, + "location": "path" + } +}, +"parameterOrder": [ + "bucket", + "anywhereCacheId" +], +"request": { + "$ref": "AnywhereCache" +}, +"response": { + "$ref": "GoogleLongrunningOperation" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"get": { +"id": "storage.anywhereCaches.get", +"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}", +"httpMethod": "GET", +"description": "Returns the metadata of an Anywhere Cache instance.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the parent bucket.", + "required": true, + "location": "path" + }, + "anywhereCacheId": { + "type": "string", + "description": "The ID of requested Anywhere Cache instance.", + "required": true, + "location": "path" + } +}, +"parameterOrder": [ + "bucket", + "anywhereCacheId" +], +"response": { + "$ref": "AnywhereCache" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"list": { +"id": "storage.anywhereCaches.list", + "path": "b/{bucket}/anywhereCaches", + "httpMethod": "GET", + "description": "Returns a list of Anywhere Cache instances of the bucket matching the criteria.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the parent bucket.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of items to return in a single page of responses. Maximum 1000.", + "format": "int32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"response": { + "$ref": "AnywhereCaches" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"pause": { +"id": "storage.anywhereCaches.pause", +"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/pause", +"httpMethod": "POST", +"description": "Pauses an Anywhere Cache instance.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the parent bucket.", + "required": true, + "location": "path" + }, + "anywhereCacheId": { + "type": "string", + "description": "The ID of requested Anywhere Cache instance.", + "required": true, + "location": "path" + } +}, +"parameterOrder": [ + "bucket", + "anywhereCacheId" +], +"response": { + "$ref": "AnywhereCache" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"resume": { +"id": "storage.anywhereCaches.resume", +"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/resume", +"httpMethod": "POST", +"description": "Resumes a paused or disabled Anywhere Cache instance.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the parent bucket.", + "required": true, + "location": "path" + }, + "anywhereCacheId": { + "type": "string", + "description": "The ID of requested Anywhere Cache instance.", + "required": true, + "location": "path" + } +}, +"parameterOrder": [ + "bucket", + "anywhereCacheId" +], +"response": { + "$ref": "AnywhereCache" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"disable": { +"id": "storage.anywhereCaches.disable", +"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/disable", +"httpMethod": "POST", +"description": "Disables an Anywhere Cache instance.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the parent bucket.", + "required": true, + "location": "path" + }, + "anywhereCacheId": { + "type": "string", + "description": "The ID of requested Anywhere Cache instance.", + "required": true, + "location": "path" + } +}, +"parameterOrder": [ + "bucket", + "anywhereCacheId" +], +"response": { + "$ref": "AnywhereCache" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +} +} +}, +"bucketAccessControls": { +"methods": { +"delete": { +"id": "storage.bucketAccessControls.delete", +"path": "b/{bucket}/acl/{entity}", +"httpMethod": "DELETE", +"description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "entity" +], +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"get": { +"id": "storage.bucketAccessControls.get", +"path": "b/{bucket}/acl/{entity}", +"httpMethod": "GET", +"description": "Returns the ACL entry for the specified entity on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "entity" +], +"response": { + "$ref": "BucketAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"insert": { +"id": "storage.bucketAccessControls.insert", +"path": "b/{bucket}/acl", +"httpMethod": "POST", +"description": "Creates a new ACL entry on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"request": { + "$ref": "BucketAccessControl" +}, +"response": { + "$ref": "BucketAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"list": { +"id": "storage.bucketAccessControls.list", +"path": "b/{bucket}/acl", +"httpMethod": "GET", +"description": "Retrieves ACL entries on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"response": { + "$ref": "BucketAccessControls" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"patch": { +"id": "storage.bucketAccessControls.patch", +"path": "b/{bucket}/acl/{entity}", +"httpMethod": "PATCH", +"description": "Patches an ACL entry on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "entity" +], +"request": { + "$ref": "BucketAccessControl" +}, +"response": { + "$ref": "BucketAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"update": { +"id": "storage.bucketAccessControls.update", +"path": "b/{bucket}/acl/{entity}", +"httpMethod": "PUT", +"description": "Updates an ACL entry on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "entity" +], +"request": { + "$ref": "BucketAccessControl" +}, +"response": { + "$ref": "BucketAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +} +} +}, +"buckets": { +"methods": { +"delete": { +"id": "storage.buckets.delete", +"path": "b/{bucket}", +"httpMethod": "DELETE", +"description": "Permanently deletes an empty bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "If set, only deletes the bucket if its metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If set, only deletes the bucket if its metageneration does not match this value.", + "format": "int64", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"get": { +"id": "storage.buckets.get", +"path": "b/{bucket}", +"httpMethod": "GET", +"description": "Returns metadata for the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"response": { + "$ref": "Bucket" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"getIamPolicy": { +"id": "storage.buckets.getIamPolicy", +"path": "b/{bucket}/iam", +"httpMethod": "GET", +"description": "Returns an IAM policy for the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "optionsRequestedPolicyVersion": { + "type": "integer", + "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"response": { + "$ref": "Policy" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"insert": { +"id": "storage.buckets.insert", +"path": "b", +"httpMethod": "POST", +"description": "Creates a new bucket.", +"parameters": { + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this bucket.", + "enum": [ + "authenticatedRead", + "private", + "projectPrivate", + "publicRead", + "publicReadWrite" + ], + "enumDescriptions": [ + "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + "Project team owners get OWNER access.", + "Project team members get access according to their roles.", + "Project team owners get OWNER access, and allUsers get READER access.", + "Project team owners get OWNER access, and allUsers get WRITER access." + ], + "location": "query" + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "description": "Apply a predefined set of default object access controls to this bucket.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "project": { + "type": "string", + "description": "A valid API project identifier.", + "required": true, + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + }, + "enableObjectRetention": { + "type": "boolean", + "description": "When set to true, object retention is enabled for this bucket.", + "default": "false", + "location": "query" + } +}, +"parameterOrder": [ + "project" +], +"request": { + "$ref": "Bucket" +}, +"response": { + "$ref": "Bucket" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"list": { +"id": "storage.buckets.list", +"path": "b", +"httpMethod": "GET", +"description": "Retrieves a list of buckets for a given project.", +"parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.", + "default": "1000", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "prefix": { + "type": "string", + "description": "Filter results to buckets whose names begin with this prefix.", + "location": "query" + }, + "project": { + "type": "string", + "description": "A valid API project identifier.", + "required": true, + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } +}, +"parameterOrder": [ + "project" +], +"response": { + "$ref": "Buckets" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"lockRetentionPolicy": { +"id": "storage.buckets.lockRetentionPolicy", +"path": "b/{bucket}/lockRetentionPolicy", +"httpMethod": "POST", +"description": "Locks retention policy on a bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.", + "required": true, + "format": "int64", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "ifMetagenerationMatch" +], +"response": { + "$ref": "Bucket" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"patch": { +"id": "storage.buckets.patch", +"path": "b/{bucket}", +"httpMethod": "PATCH", +"description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this bucket.", + "enum": [ + "authenticatedRead", + "private", + "projectPrivate", + "publicRead", + "publicReadWrite" + ], + "enumDescriptions": [ + "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + "Project team owners get OWNER access.", + "Project team members get access according to their roles.", + "Project team owners get OWNER access, and allUsers get READER access.", + "Project team owners get OWNER access, and allUsers get WRITER access." + ], + "location": "query" + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "description": "Apply a predefined set of default object access controls to this bucket.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"request": { + "$ref": "Bucket" +}, +"response": { + "$ref": "Bucket" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"setIamPolicy": { +"id": "storage.buckets.setIamPolicy", +"path": "b/{bucket}/iam", +"httpMethod": "PUT", +"description": "Updates an IAM policy for the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"request": { + "$ref": "Policy" +}, +"response": { + "$ref": "Policy" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"testIamPermissions": { +"id": "storage.buckets.testIamPermissions", +"path": "b/{bucket}/iam/testPermissions", +"httpMethod": "GET", +"description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "permissions": { + "type": "string", + "description": "Permissions to test.", + "required": true, + "repeated": true, + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "permissions" +], +"response": { + "$ref": "TestIamPermissionsResponse" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"update": { +"id": "storage.buckets.update", +"path": "b/{bucket}", +"httpMethod": "PUT", +"description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this bucket.", + "enum": [ + "authenticatedRead", + "private", + "projectPrivate", + "publicRead", + "publicReadWrite" + ], + "enumDescriptions": [ + "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + "Project team owners get OWNER access.", + "Project team members get access according to their roles.", + "Project team owners get OWNER access, and allUsers get READER access.", + "Project team owners get OWNER access, and allUsers get WRITER access." + ], + "location": "query" + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "description": "Apply a predefined set of default object access controls to this bucket.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"request": { + "$ref": "Bucket" +}, +"response": { + "$ref": "Bucket" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +} +} +}, +"operations": { +"methods": { +"cancel": { +"description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed.", +"path": "b/{bucket}/operations/{operationId}/cancel", +"httpMethod": "POST", +"id": "storage.buckets.operations.cancel", +"parameterOrder": [ + "bucket", + "operationId" +], +"parameters": { + "bucket": { + "description": "The parent bucket of the operation resource.", + "location": "path", + "required": true, + "type": "string" + }, + "operationId": { + "description": "The ID of the operation resource.", + "location": "path", + "required": true, + "type": "string" + } +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"get": { +"description": "Gets the latest state of a long-running operation.", +"path": "b/{bucket}/operations/{operationId}", +"httpMethod": "GET", +"id": "storage.buckets.operations.get", +"parameterOrder": [ + "bucket", + "operationId" +], +"parameters": { + "bucket": { + "description": "The parent bucket of the operation resource.", + "location": "path", + "required": true, + "type": "string" + }, + "operationId": { + "description": "The ID of the operation resource.", + "location": "path", + "required": true, + "type": "string" + } +}, +"response": { + "$ref": "GoogleLongrunningOperation" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"list": { +"description": "Lists operations that match the specified filter in the request.", +"path": "b/{bucket}/operations", +"httpMethod": "GET", +"id": "storage.buckets.operations.list", +"parameterOrder": [ + "bucket" +], +"parameters": { + "filter": { + "description": "A filter to narrow down results to a preferred subset. The filtering language is documented in more detail in [AIP-160](https://google.aip.dev/160).", + "location": "query", + "type": "string" + }, + "bucket": { + "description": "Name of the bucket in which to look for operations.", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "Maximum number of items to return in a single page of responses. Fewer total results may be returned than requested. The service uses this parameter or 100 items, whichever is smaller.", + "minimum": "0", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query", + "type": "string" + } +}, +"response": { + "$ref": "GoogleLongrunningListOperationsResponse" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +} +} +}, +"channels": { +"methods": { +"stop": { +"id": "storage.channels.stop", +"path": "channels/stop", +"httpMethod": "POST", +"description": "Stop watching resources through this channel", +"request": { + "$ref": "Channel", + "parameterName": "resource" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +} +} +}, +"defaultObjectAccessControls": { +"methods": { +"delete": { +"id": "storage.defaultObjectAccessControls.delete", +"path": "b/{bucket}/defaultObjectAcl/{entity}", +"httpMethod": "DELETE", +"description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "entity" +], +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"get": { +"id": "storage.defaultObjectAccessControls.get", +"path": "b/{bucket}/defaultObjectAcl/{entity}", +"httpMethod": "GET", +"description": "Returns the default object ACL entry for the specified entity on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "entity" +], +"response": { + "$ref": "ObjectAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"insert": { +"id": "storage.defaultObjectAccessControls.insert", +"path": "b/{bucket}/defaultObjectAcl", +"httpMethod": "POST", +"description": "Creates a new default object ACL entry on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"request": { + "$ref": "ObjectAccessControl" +}, +"response": { + "$ref": "ObjectAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"list": { +"id": "storage.defaultObjectAccessControls.list", +"path": "b/{bucket}/defaultObjectAcl", +"httpMethod": "GET", +"description": "Retrieves default object ACL entries on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"response": { + "$ref": "ObjectAccessControls" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"patch": { +"id": "storage.defaultObjectAccessControls.patch", +"path": "b/{bucket}/defaultObjectAcl/{entity}", +"httpMethod": "PATCH", +"description": "Patches a default object ACL entry on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "entity" +], +"request": { + "$ref": "ObjectAccessControl" +}, +"response": { + "$ref": "ObjectAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"update": { +"id": "storage.defaultObjectAccessControls.update", +"path": "b/{bucket}/defaultObjectAcl/{entity}", +"httpMethod": "PUT", +"description": "Updates a default object ACL entry on the specified bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "entity" +], +"request": { + "$ref": "ObjectAccessControl" +}, +"response": { + "$ref": "ObjectAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +} +} +}, + "folders": { + "methods": { + "delete": { + "id": "storage.folders.delete", + "path": "b/{bucket}/folders/{folder}", + "httpMethod": "DELETE", + "description": "Permanently deletes a folder. Only applicable to buckets with hierarchical namespace enabled.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the folder resides.", + "required": true, + "location": "path" + }, + "folder": { + "type": "string", + "description": "Name of a folder.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "If set, only deletes the folder if its metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If set, only deletes the folder if its metageneration does not match this value.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "folder" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.folders.get", + "path": "b/{bucket}/folders/{folder}", + "httpMethod": "GET", + "description": "Returns metadata for the specified folder. Only applicable to buckets with hierarchical namespace enabled.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the folder resides.", + "required": true, + "location": "path" + }, + "folder": { + "type": "string", + "description": "Name of a folder.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the folder metadata conditional on whether the folder's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the folder metadata conditional on whether the folder's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "folder" + ], + "response": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "insert": { + "id": "storage.folders.insert", + "path": "b/{bucket}/folders", + "httpMethod": "POST", + "description": "Creates a new folder. Only applicable to buckets with hierarchical namespace enabled.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the folder resides.", + "required": true, + "location": "path" + }, + "recursive": { + "type": "boolean", + "description": "If true, any parent folder which doesn\u2019t exist will be created automatically.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Folder" + }, + "response": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "storage.folders.list", + "path": "b/{bucket}/folders", + "httpMethod": "GET", + "description": "Retrieves a list of folders matching the criteria. Only applicable to buckets with hierarchical namespace enabled.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to look for folders.", + "required": true, + "location": "path" + }, + "delimiter": { + "type": "string", + "description": "Returns results in a directory-like mode. The only supported value is '/'. If set, items will only contain folders that either exactly match the prefix, or are one level below the prefix.", + "location": "query" + }, + "endOffset": { + "type": "string", + "description": "Filter results to folders whose names are lexicographically before endOffset. If startOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of items to return in a single page of responses.", + "format": "int32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "prefix": { + "type": "string", + "description": "Filter results to folders whose paths begin with this prefix. If set, the value must either be an empty string or end with a '/'.", + "location": "query" + }, + "startOffset": { + "type": "string", + "description": "Filter results to folders whose names are lexicographically equal to or after startOffset. If endOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Folders" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "rename": { + "id": "storage.folders.rename", + "path": "b/{bucket}/folders/{sourceFolder}/renameTo/folders/{destinationFolder}", + "httpMethod": "POST", + "description": "Renames a source folder to a destination folder. Only applicable to buckets with hierarchical namespace enabled.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the folders are in.", + "required": true, + "location": "path" + }, + "destinationFolder": { + "type": "string", + "description": "Name of the destination folder.", + "required": true, + "location": "path" + }, + "ifSourceMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "sourceFolder": { + "type": "string", + "description": "Name of the source folder.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "sourceFolder", + "destinationFolder" + ], + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + } + } + }, + "managedFolders": { + "methods": { + "delete": { + "id": "storage.managedFolders.delete", + "path": "b/{bucket}/managedFolders/{managedFolder}", + "httpMethod": "DELETE", + "description": "Permanently deletes a managed folder.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "If set, only deletes the managed folder if its metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If set, only deletes the managed folder if its metageneration does not match this value.", + "format": "int64", + "location": "query" + }, + "allowNonEmpty": { + "type": "boolean", + "description": "Allows the deletion of a managed folder even if it is not empty. A managed folder is empty if there are no objects or managed folders that it applies to. Callers must have storage.managedFolders.setIamPolicy permission.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "managedFolder" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] +}, +"get": { + "id": "storage.managedFolders.get", + "path": "b/{bucket}/managedFolders/{managedFolder}", + "httpMethod": "GET", + "description": "Returns metadata of the specified managed folder.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "managedFolder" + ], + "response": { + "$ref": "ManagedFolder" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] +}, +"getIamPolicy": { + "id": "storage.managedFolders.getIamPolicy", + "path": "b/{bucket}/managedFolders/{managedFolder}/iam", + "httpMethod": "GET", + "description": "Returns an IAM policy for the specified managed folder.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "optionsRequestedPolicyVersion": { + "type": "integer", + "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "managedFolder" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] +}, +"insert": { + "id": "storage.managedFolders.insert", + "path": "b/{bucket}/managedFolders", + "httpMethod": "POST", + "description": "Creates a new managed folder.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "ManagedFolder" + }, + "response": { + "$ref": "ManagedFolder" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] +}, +"list": { + "id": "storage.managedFolders.list", + "path": "b/{bucket}/managedFolders", + "httpMethod": "GET", + "description": "Lists managed folders in the given bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of items to return in a single page of responses.", + "format": "int32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "prefix": { + "type": "string", + "description": "The managed folder name/path prefix to filter the output list of results.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"response": { + "$ref": "ManagedFolders" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"setIamPolicy": { +"id": "storage.managedFolders.setIamPolicy", +"path": "b/{bucket}/managedFolders/{managedFolder}/iam", +"httpMethod": "PUT", +"description": "Updates an IAM policy for the specified managed folder.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "managedFolder" +], +"request": { + "$ref": "Policy" +}, +"response": { + "$ref": "Policy" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"testIamPermissions": { +"id": "storage.managedFolders.testIamPermissions", +"path": "b/{bucket}/managedFolders/{managedFolder}/iam/testPermissions", +"httpMethod": "GET", +"description": "Tests a set of permissions on the given managed folder to see which, if any, are held by the caller.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" + }, + "permissions": { + "type": "string", + "description": "Permissions to test.", + "required": true, + "repeated": true, + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "managedFolder", + "permissions" +], +"response": { + "$ref": "TestIamPermissionsResponse" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +} +} +}, +"notifications": { +"methods": { +"delete": { +"id": "storage.notifications.delete", +"path": "b/{bucket}/notificationConfigs/{notification}", +"httpMethod": "DELETE", +"description": "Permanently deletes a notification subscription.", +"parameters": { + "bucket": { + "type": "string", + "description": "The parent bucket of the notification.", + "required": true, + "location": "path" + }, + "notification": { + "type": "string", + "description": "ID of the notification to delete.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "notification" +], +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"get": { +"id": "storage.notifications.get", +"path": "b/{bucket}/notificationConfigs/{notification}", +"httpMethod": "GET", +"description": "View a notification configuration.", +"parameters": { + "bucket": { + "type": "string", + "description": "The parent bucket of the notification.", + "required": true, + "location": "path" + }, + "notification": { + "type": "string", + "description": "Notification ID", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "notification" +], +"response": { + "$ref": "Notification" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"insert": { +"id": "storage.notifications.insert", +"path": "b/{bucket}/notificationConfigs", +"httpMethod": "POST", +"description": "Creates a notification subscription for a given bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "The parent bucket of the notification.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"request": { + "$ref": "Notification" +}, +"response": { + "$ref": "Notification" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"list": { +"id": "storage.notifications.list", +"path": "b/{bucket}/notificationConfigs", +"httpMethod": "GET", +"description": "Retrieves a list of notification subscriptions for a given bucket.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a Google Cloud Storage bucket.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"response": { + "$ref": "Notifications" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +} +} +}, +"objectAccessControls": { +"methods": { +"delete": { +"id": "storage.objectAccessControls.delete", +"path": "b/{bucket}/o/{object}/acl/{entity}", +"httpMethod": "DELETE", +"description": "Permanently deletes the ACL entry for the specified entity on the specified object.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object", + "entity" +], +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"get": { +"id": "storage.objectAccessControls.get", +"path": "b/{bucket}/o/{object}/acl/{entity}", +"httpMethod": "GET", +"description": "Returns the ACL entry for the specified entity on the specified object.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object", + "entity" +], +"response": { + "$ref": "ObjectAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"insert": { +"id": "storage.objectAccessControls.insert", +"path": "b/{bucket}/o/{object}/acl", +"httpMethod": "POST", +"description": "Creates a new ACL entry on the specified object.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object" +], +"request": { + "$ref": "ObjectAccessControl" +}, +"response": { + "$ref": "ObjectAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"list": { +"id": "storage.objectAccessControls.list", +"path": "b/{bucket}/o/{object}/acl", +"httpMethod": "GET", +"description": "Retrieves ACL entries on the specified object.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object" +], +"response": { + "$ref": "ObjectAccessControls" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"patch": { +"id": "storage.objectAccessControls.patch", +"path": "b/{bucket}/o/{object}/acl/{entity}", +"httpMethod": "PATCH", +"description": "Patches an ACL entry on the specified object.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object", + "entity" +], +"request": { + "$ref": "ObjectAccessControl" +}, +"response": { + "$ref": "ObjectAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"update": { +"id": "storage.objectAccessControls.update", +"path": "b/{bucket}/o/{object}/acl/{entity}", +"httpMethod": "PUT", +"description": "Updates an ACL entry on the specified object.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object", + "entity" +], +"request": { + "$ref": "ObjectAccessControl" +}, +"response": { + "$ref": "ObjectAccessControl" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +} +} +}, +"objects": { +"methods": { +"compose": { +"id": "storage.objects.compose", +"path": "b/{destinationBucket}/o/{destinationObject}/compose", +"httpMethod": "POST", +"description": "Concatenates a list of existing objects into a new object in the same bucket.", +"parameters": { + "destinationBucket": { + "type": "string", + "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.", + "required": true, + "location": "path" + }, + "destinationObject": { + "type": "string", + "description": "Name of the new object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "destinationPredefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to the destination object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "kmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "destinationBucket", + "destinationObject" +], +"request": { + "$ref": "ComposeRequest" +}, +"response": { + "$ref": "Object" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"copy": { +"id": "storage.objects.copy", +"path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", +"httpMethod": "POST", +"description": "Copies a source object to a destination object. Optionally overrides metadata.", +"parameters": { + "destinationBucket": { + "type": "string", + "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "destinationKmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" + }, + "destinationObject": { + "type": "string", + "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", + "required": true, + "location": "path" + }, + "destinationPredefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to the destination object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "sourceBucket": { + "type": "string", + "description": "Name of the bucket in which to find the source object.", + "required": true, + "location": "path" + }, + "sourceGeneration": { + "type": "string", + "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "sourceObject": { + "type": "string", + "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "sourceBucket", + "sourceObject", + "destinationBucket", + "destinationObject" +], +"request": { + "$ref": "Object" +}, +"response": { + "$ref": "Object" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"delete": { +"id": "storage.objects.delete", +"path": "b/{bucket}/o/{object}", +"httpMethod": "DELETE", +"description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object" +], +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"get": { +"id": "storage.objects.get", +"path": "b/{bucket}/o/{object}", +"httpMethod": "GET", +"description": "Retrieves an object or its metadata.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + }, + "softDeleted": { + "type": "boolean", + "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object" +], +"response": { + "$ref": "Object" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +], +"supportsMediaDownload": true, +"useMediaDownloadService": true +}, +"getIamPolicy": { +"id": "storage.objects.getIamPolicy", +"path": "b/{bucket}/o/{object}/iam", +"httpMethod": "GET", +"description": "Returns an IAM policy for the specified object.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } - } - }, - "ManagedFolder": { - "id": "ManagedFolder", - "type": "object", - "description": "A managed folder.", - "properties": { +}, +"parameterOrder": [ + "bucket", + "object" +], +"response": { + "$ref": "Policy" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"insert": { +"id": "storage.objects.insert", +"path": "b/{bucket}/o", +"httpMethod": "POST", +"description": "Stores a new object and metadata.", +"parameters": { "bucket": { - "type": "string", - "description": "The name of the bucket containing this managed folder." + "type": "string", + "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + "required": true, + "location": "path" }, - "id": { - "type": "string", - "description": "The ID of the managed folder, including the bucket name and managed folder name." + "contentEncoding": { + "type": "string", + "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.", + "location": "query" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For managed folders, this is always storage#managedFolder.", - "default": "storage#managedFolder" + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "metageneration": { - "type": "string", - "description": "The version of the metadata for this managed folder. Used for preconditions and for detecting changes in metadata.", - "format": "int64" + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "name": { - "type": "string", - "description": "The name of the managed folder. Required if not specified by URL parameter." + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "selfLink": { - "type": "string", - "description": "The link to this managed folder." + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "createTime": { - "type": "string", - "description": "The creation time of the managed folder in RFC 3339 format.", - "format": "date-time" + "kmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" }, - "updateTime": { - "type": "string", - "description": "The last update time of the managed folder metadata in RFC 3339 format.", - "format": "date-time" + "name": { + "type": "string", + "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "location": "query" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } - } - }, - "ManagedFolders": { - "id": "ManagedFolders", - "type": "object", - "description": "A list of managed folders.", - "properties": { - "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "ManagedFolder" - } +}, +"parameterOrder": [ + "bucket" +], +"request": { + "$ref": "Object" +}, +"response": { + "$ref": "Object" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +], +"supportsMediaUpload": true, +"mediaUpload": { + "accept": [ + "*/*" + ], + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/storage/v1/b/{bucket}/o" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/storage/v1/b/{bucket}/o" + } + } +} +}, +"list": { +"id": "storage.objects.list", +"path": "b/{bucket}/o", +"httpMethod": "GET", +"description": "Retrieves a list of objects matching the criteria.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to look for objects.", + "required": true, + "location": "path" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of managed folders, this is always storage#managedFolders.", - "default": "storage#managedFolders" + "delimiter": { + "type": "string", + "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + "location": "query" }, - "nextPageToken": { - "type": "string", - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." - } - } - }, - "Notification": { - "id": "Notification", - "type": "object", - "description": "A subscription to receive Google PubSub notifications.", - "properties": { - "custom_attributes": { - "type": "object", - "description": "An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.", - "additionalProperties": { - "type": "string" - } + "endOffset": { + "type": "string", + "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for this subscription notification." + "includeTrailingDelimiter": { + "type": "boolean", + "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", + "location": "query" }, - "event_types": { - "type": "array", - "description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.", - "items": { - "type": "string" - } + "maxResults": { + "type": "integer", + "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", + "default": "1000", + "format": "uint32", + "minimum": "0", + "location": "query" }, - "id": { - "type": "string", - "description": "The ID of the notification." + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For notifications, this is always storage#notification.", - "default": "storage#notification" - }, - "object_name_prefix": { - "type": "string", - "description": "If present, only apply this notification configuration to object names that begin with this prefix." - }, - "payload_format": { - "type": "string", - "description": "The desired content of the Payload.", - "default": "JSON_API_V1", - "annotations": { - "required": [ - "storage.notifications.insert" - ] - } + "prefix": { + "type": "string", + "description": "Filter results to objects whose names begin with this prefix.", + "location": "query" }, - "selfLink": { - "type": "string", - "description": "The canonical URL of this notification." - }, - "topic": { - "type": "string", - "description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'", - "annotations": { - "required": [ - "storage.notifications.insert" - ] - } - } - } - }, - "Notifications": { - "id": "Notifications", - "type": "object", - "description": "A list of notification subscriptions.", - "properties": { - "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "Notification" - } + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "startOffset": { + "type": "string", + "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of notifications, this is always storage#notifications.", - "default": "storage#notifications" - } - } - }, - "Object": { - "id": "Object", - "type": "object", - "description": "An object.", - "properties": { - "acl": { - "type": "array", - "description": "Access controls on the object.", - "items": { - "$ref": "ObjectAccessControl" - }, - "annotations": { - "required": [ - "storage.objects.update" - ] - } + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" }, + "versions": { + "type": "boolean", + "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", + "location": "query" + }, + "matchGlob": { + "type": "string", + "description": "Filter results to objects and prefixes that match this glob pattern.", + "location": "query" + }, + "softDeleted": { + "type": "boolean", + "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.", + "location": "query" + }, + "includeFoldersAsPrefixes": { + "type": "boolean", + "description": "Only applicable if delimiter is set to '/'. If true, will also include folders and managed folders (besides objects) in the returned prefixes.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket" +], +"response": { + "$ref": "Objects" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +], +"supportsSubscription": true +}, +"patch": { +"id": "storage.objects.patch", +"path": "b/{bucket}/o/{object}", +"httpMethod": "PATCH", +"description": "Patches an object's metadata.", +"parameters": { "bucket": { - "type": "string", - "description": "The name of the bucket containing this object." + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "cacheControl": { - "type": "string", - "description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600." + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "componentCount": { - "type": "integer", - "description": "Number of underlying components that make up this object. Components are accumulated by compose operations.", - "format": "int32" + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "contentDisposition": { - "type": "string", - "description": "Content-Disposition of the object data." + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "contentEncoding": { - "type": "string", - "description": "Content-Encoding of the object data." - }, - "contentLanguage": { - "type": "string", - "description": "Content-Language of the object data." - }, - "contentType": { - "type": "string", - "description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream." - }, - "crc32c": { - "type": "string", - "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices." - }, - "customTime": { - "type": "string", - "description": "A timestamp in RFC 3339 format specified by the user for an object.", - "format": "date-time" - }, - "customerEncryption": { - "type": "object", - "description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.", - "properties": { - "encryptionAlgorithm": { - "type": "string", - "description": "The encryption algorithm." - }, - "keySha256": { - "type": "string", - "description": "SHA256 hash value of the encryption key." - } - } + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the object." + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "eventBasedHold": { - "type": "boolean", - "description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false." + "overrideUnlockedRetention": { + "type": "boolean", + "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.", + "location": "query" }, - "generation": { - "type": "string", - "description": "The content generation of this object. Used for object versioning.", - "format": "int64" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "id": { - "type": "string", - "description": "The ID of the object, including the bucket name, object name, and generation number." + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request, for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object" +], +"request": { + "$ref": "Object" +}, +"response": { + "$ref": "Object" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"rewrite": { +"id": "storage.objects.rewrite", +"path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", +"httpMethod": "POST", +"description": "Rewrites a source object to a destination object. Optionally overrides metadata.", +"parameters": { + "destinationBucket": { + "type": "string", + "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + "required": true, + "location": "path" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For objects, this is always storage#object.", - "default": "storage#object" + "destinationKmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" }, - "kmsKeyName": { - "type": "string", - "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request." + "destinationObject": { + "type": "string", + "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "md5Hash": { - "type": "string", - "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices." + "destinationPredefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to the destination object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "mediaLink": { - "type": "string", - "description": "Media download link." + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "metadata": { - "type": "object", - "description": "User-provided metadata, in key/value pairs.", - "additionalProperties": { - "type": "string", - "description": "An individual metadata entry." - } + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "metageneration": { - "type": "string", - "description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.", - "format": "int64" + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "name": { - "type": "string", - "description": "The name of the object. Required if not specified by URL parameter." + "ifSourceGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", + "format": "int64", + "location": "query" }, - "owner": { - "type": "object", - "description": "The owner of the object. This will always be the uploader of the object.", - "properties": { - "entity": { - "type": "string", - "description": "The entity, in the form user-userId." - }, - "entityId": { - "type": "string", - "description": "The ID for the entity." - } - } - }, - "retentionExpirationTime": { - "type": "string", - "description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).", - "format": "date-time" - }, - "retention": { - "type": "object", - "description": "A collection of object level retention parameters.", - "properties": { - "retainUntilTime": { - "type": "string", - "description": "A time in RFC 3339 format until which object retention protects this object.", - "format": "date-time" - }, - "mode": { - "type": "string", - "description": "The bucket's object retention mode, can only be Unlocked or Locked." - } - } + "ifSourceGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", + "format": "int64", + "location": "query" }, - "selfLink": { - "type": "string", - "description": "The link to this object." + "ifSourceMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "size": { - "type": "string", - "description": "Content-Length of the data in bytes.", - "format": "uint64" + "ifSourceMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "storageClass": { - "type": "string", - "description": "Storage class of the object." + "maxBytesRewrittenPerCall": { + "type": "string", + "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", + "format": "int64", + "location": "query" }, - "temporaryHold": { - "type": "boolean", - "description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object." + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" }, - "timeCreated": { - "type": "string", - "description": "The creation time of the object in RFC 3339 format.", - "format": "date-time" - }, - "timeDeleted": { - "type": "string", - "description": "The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.", - "format": "date-time" - }, - "softDeleteTime": { - "type": "string", - "description": "The time at which the object became soft-deleted in RFC 3339 format.", - "format": "date-time" - }, - "hardDeleteTime": { - "type": "string", - "description": "This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.", - "format": "date-time" - }, - "timeStorageClassUpdated": { - "type": "string", - "description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.", - "format": "date-time" + "rewriteToken": { + "type": "string", + "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", + "location": "query" }, - "updated": { - "type": "string", - "description": "The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.", - "format": "date-time" + "sourceBucket": { + "type": "string", + "description": "Name of the bucket in which to find the source object.", + "required": true, + "location": "path" + }, + "sourceGeneration": { + "type": "string", + "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "sourceObject": { + "type": "string", + "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } - } - }, - "ObjectAccessControl": { - "id": "ObjectAccessControl", - "type": "object", - "description": "An access-control entry.", - "properties": { +}, +"parameterOrder": [ + "sourceBucket", + "sourceObject", + "destinationBucket", + "destinationObject" +], +"request": { + "$ref": "Object" +}, +"response": { + "$ref": "RewriteResponse" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"setIamPolicy": { +"id": "storage.objects.setIamPolicy", +"path": "b/{bucket}/o/{object}/iam", +"httpMethod": "PUT", +"description": "Updates an IAM policy for the specified object.", +"parameters": { "bucket": { - "type": "string", - "description": "The name of the bucket." + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "domain": { - "type": "string", - "description": "The domain associated with the entity, if any." + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "email": { - "type": "string", - "description": "The email address associated with the entity, if any." + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "entity": { - "type": "string", - "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", - "annotations": { - "required": [ - "storage.defaultObjectAccessControls.insert", - "storage.objectAccessControls.insert" - ] - } + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object" +], +"request": { + "$ref": "Policy" +}, +"response": { + "$ref": "Policy" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"testIamPermissions": { +"id": "storage.objects.testIamPermissions", +"path": "b/{bucket}/o/{object}/iam/testPermissions", +"httpMethod": "GET", +"description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "entityId": { - "type": "string", - "description": "The ID for the entity, if any." + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the access-control entry." + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "generation": { - "type": "string", - "description": "The content generation of the object, if applied to an object.", - "format": "int64" + "permissions": { + "type": "string", + "description": "Permissions to test.", + "required": true, + "repeated": true, + "location": "query" }, - "id": { - "type": "string", - "description": "The ID of the access-control entry." + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } +}, +"parameterOrder": [ + "bucket", + "object", + "permissions" +], +"response": { + "$ref": "TestIamPermissionsResponse" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +] +}, +"update": { +"id": "storage.objects.update", +"path": "b/{bucket}/o/{object}", +"httpMethod": "PUT", +"description": "Updates an object's metadata.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.", - "default": "storage#objectAccessControl" + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "object": { - "type": "string", - "description": "The name of the object, if applied to an object." + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "projectTeam": { - "type": "object", - "description": "The project team associated with the entity, if any.", - "properties": { - "projectNumber": { - "type": "string", - "description": "The project number." - }, - "team": { - "type": "string", - "description": "The team." - } - } + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "role": { - "type": "string", - "description": "The access permission for the entity.", - "annotations": { - "required": [ - "storage.defaultObjectAccessControls.insert", - "storage.objectAccessControls.insert" - ] - } + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "selfLink": { - "type": "string", - "description": "The link to this access-control entry." - } - } - }, - "ObjectAccessControls": { - "id": "ObjectAccessControls", - "type": "object", - "description": "An access-control list.", - "properties": { - "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "ObjectAccessControl" - } + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.", - "default": "storage#objectAccessControls" - } - } - }, - "Objects": { - "id": "Objects", - "type": "object", - "description": "A list of objects.", - "properties": { - "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "Object" - } + "overrideUnlockedRetention": { + "type": "boolean", + "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.", + "location": "query" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of objects, this is always storage#objects.", - "default": "storage#objects" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "nextPageToken": { - "type": "string", - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." - }, - "prefixes": { - "type": "array", - "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.", - "items": { - "type": "string" - } + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } - } - }, - "Policy": { - "id": "Policy", - "type": "object", - "description": "A bucket/object/managedFolder IAM policy.", - "properties": { - "bindings": { - "type": "array", - "description": "An association between a role, which comes with a set of permissions, and members who may assume that role.", - "items": { - "type": "object", - "properties": { - "condition": { - "$ref": "Expr", - "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently." - }, - "members": { - "type": "array", - "description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers \u2014 A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers \u2014 A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid \u2014 An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid \u2014 An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid \u2014 An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain \u2014 A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid \u2014 Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid \u2014 Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid \u2014 Viewers of the given project. For example, projectViewer:my-example-project", - "items": { - "type": "string" - }, - "annotations": { - "required": [ - "storage.buckets.setIamPolicy", - "storage.objects.setIamPolicy", - "storage.managedFolders.setIamPolicy" - ] - } - }, - "role": { +}, +"parameterOrder": [ + "bucket", + "object" +], +"request": { + "$ref": "Object" +}, +"response": { + "$ref": "Object" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" +] +}, +"watchAll": { +"id": "storage.objects.watchAll", +"path": "b/{bucket}/o/watch", +"httpMethod": "POST", +"description": "Watch for changes on all objects in a bucket.", +"parameters": { + "bucket": { "type": "string", - "description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin \u2014 Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer \u2014 Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator \u2014 Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin \u2014 Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader \u2014 Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner \u2014 Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader \u2014 Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter \u2014 Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner \u2014 Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.", - "annotations": { - "required": [ - "storage.buckets.setIamPolicy", - "storage.objects.setIamPolicy", - "storage.managedFolders.setIamPolicy" - ] - } - } - } - }, - "annotations": { - "required": [ - "storage.buckets.setIamPolicy", - "storage.objects.setIamPolicy", - "storage.managedFolders.setIamPolicy" - ] - } + "description": "Name of the bucket in which to look for objects.", + "required": true, + "location": "path" }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the policy.", - "format": "byte" + "delimiter": { + "type": "string", + "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + "location": "query" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.", - "default": "storage#policy" + "endOffset": { + "type": "string", + "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" }, - "resourceId": { - "type": "string", - "description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input." + "includeTrailingDelimiter": { + "type": "boolean", + "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", + "location": "query" }, - "version": { - "type": "integer", - "description": "The IAM policy format version.", - "format": "int32" - } - } - }, - "RewriteResponse": { - "id": "RewriteResponse", - "type": "object", - "description": "A rewrite response.", - "properties": { - "done": { - "type": "boolean", - "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response." + "maxResults": { + "type": "integer", + "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", + "default": "1000", + "format": "uint32", + "minimum": "0", + "location": "query" }, - "kind": { - "type": "string", - "description": "The kind of item this is.", - "default": "storage#rewriteResponse" + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" }, - "objectSize": { - "type": "string", - "description": "The total size of the object being copied in bytes. This property is always present in the response.", - "format": "int64" + "prefix": { + "type": "string", + "description": "Filter results to objects whose names begin with this prefix.", + "location": "query" }, - "resource": { - "$ref": "Object", - "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes." + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "startOffset": { + "type": "string", + "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" }, - "rewriteToken": { - "type": "string", - "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy." + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" }, - "totalBytesRewritten": { - "type": "string", - "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.", - "format": "int64" + "versions": { + "type": "boolean", + "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", + "location": "query" } - } - }, - "ServiceAccount": { - "id": "ServiceAccount", - "type": "object", - "description": "A subscription to receive Google PubSub notifications.", - "properties": { - "email_address": { - "type": "string", - "description": "The ID of the notification." +}, +"parameterOrder": [ + "bucket" +], +"request": { + "$ref": "Channel", + "parameterName": "resource" +}, +"response": { + "$ref": "Channel" +}, +"scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" +], +"supportsSubscription": true +}, +"restore": { +"id": "storage.objects.restore", +"path": "b/{bucket}/o/{object}/restore", +"httpMethod": "POST", +"description": "Restores a soft-deleted object.", +"parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For notifications, this is always storage#notification.", - "default": "storage#serviceAccount" - } - } - }, - "TestIamPermissionsResponse": { - "id": "TestIamPermissionsResponse", - "type": "object", - "description": "A storage.(buckets|objects|managedFolders).testIamPermissions response.", - "properties": { - "kind": { - "type": "string", - "description": "The kind of item this is.", - "default": "storage#testIamPermissionsResponse" + "generation": { + "type": "string", + "description": "Selects a specific revision of this object.", + "required": true, + "format": "int64", + "location": "query" }, - "permissions": { - "type": "array", - "description": "The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets, objects, or managedFolders. The supported permissions are as follows: \n- storage.buckets.delete \u2014 Delete bucket. \n- storage.buckets.get \u2014 Read bucket metadata. \n- storage.buckets.getIamPolicy \u2014 Read bucket IAM policy. \n- storage.buckets.create \u2014 Create bucket. \n- storage.buckets.list \u2014 List buckets. \n- storage.buckets.setIamPolicy \u2014 Update bucket IAM policy. \n- storage.buckets.update \u2014 Update bucket metadata. \n- storage.objects.delete \u2014 Delete object. \n- storage.objects.get \u2014 Read object data and metadata. \n- storage.objects.getIamPolicy \u2014 Read object IAM policy. \n- storage.objects.create \u2014 Create object. \n- storage.objects.list \u2014 List objects. \n- storage.objects.setIamPolicy \u2014 Update object IAM policy. \n- storage.objects.update \u2014 Update object metadata. \n- storage.managedFolders.delete \u2014 Delete managed folder. \n- storage.managedFolders.get \u2014 Read managed folder metadata. \n- storage.managedFolders.getIamPolicy \u2014 Read managed folder IAM policy. \n- storage.managedFolders.create \u2014 Create managed folder. \n- storage.managedFolders.list \u2014 List managed folders. \n- storage.managedFolders.setIamPolicy \u2014 Update managed folder IAM policy.", - "items": { - "type": "string" - } - } - } - }, - "BulkRestoreObjectsRequest": { - "id": "BulkRestoreObjectsRequest", - "type": "object", - "description": "A bulk restore objects request.", - "properties": { - "allowOverwrite": { - "type": "boolean", - "description": "If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue." - }, - "softDeletedAfterTime": { - "type": "string", - "description": "Restores only the objects that were soft-deleted after this time.", - "format": "date-time" - }, - "softDeletedBeforeTime": { - "type": "string", - "description": "Restores only the objects that were soft-deleted before this time.", - "format": "date-time" - }, - "matchGlobs": { - "type": "array", - "description": "Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.", - "items": { - "type": "string" - } + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "required": true, + "location": "path" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's one live generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether none of the object's live generations match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's one live metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether none of the object's live metagenerations match the given value.", + "format": "int64", + "location": "query" }, "copySourceAcl": { - "type": "boolean", - "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false." - } - } - } - }, - "resources": { - "anywhereCache": { - "methods": { - "insert": { - "id": "storage.anywhereCaches.insert", - "path": "b/{bucket}/anywhereCaches", - "httpMethod": "POST", - "description": "Creates an Anywhere Cache instance.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the partent bucket", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "AnywhereCache" - }, - "response": { - "$ref": "GoogleLongrunningOperation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "update": { - "id": "storage.anywhereCaches.update", - "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}", - "httpMethod": "PATCH", - "description": "Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the partent bucket", - "required": true, - "location": "path" - }, - "anywhereCacheId": { - "type": "string", - "description": "The ID of requested Anywhere Cache instance.", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "bucket", - "anywhereCacheId" - ], - "request": { - "$ref": "AnywhereCache" - }, - "response": { - "$ref": "GoogleLongrunningOperation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "id": "storage.anywhereCaches.get", - "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}", - "httpMethod": "GET", - "description": "Returns the metadata of an Anywhere Cache instance.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the partent bucket", - "required": true, - "location": "path" - }, - "anywhereCacheId": { - "type": "string", - "description": "The ID of requested Anywhere Cache instance.", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "bucket", - "anywhereCacheId" - ], - "response": { - "$ref": "AnywhereCache" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "list": { - "id": "storage.anywhereCaches.list", - "path": "b/{bucket}/anywhereCache", - "httpMethod": "GET", - "description": "Returns a list of Anywhere Cache instances of the bucket matching the criteria.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the partent bucket", - "required": true, - "location": "path" - }, - "pageSize": { - "type": "integer", - "description": "Maximum number of items return in a single page of responses. Maximum 1000.", - "format": "int32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "AnywhereCaches" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "pause": { - "id": "storage.anywhereCaches.pause", - "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/pause", - "httpMethod": "POST", - "description": "Pauses an Anywhere Cache instance.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the partent bucket", - "required": true, - "location": "path" - }, - "anywhereCacheId": { - "type": "string", - "description": "The ID of requested Anywhere Cache instance.", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "bucket", - "anywhereCacheId" - ], - "response": { - "$ref": "AnywhereCache" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "resume": { - "id": "storage.anywhereCaches.resume", - "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/resume", - "httpMethod": "POST", - "description": "Resumes a paused or disabled Anywhere Cache instance.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the partent bucket", - "required": true, - "location": "path" - }, - "anywhereCacheId": { - "type": "string", - "description": "The ID of requested Anywhere Cache instance.", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "bucket", - "anywhereCacheId" - ], - "response": { - "$ref": "AnywhereCache" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "disable": { - "id": "storage.anywhereCaches.disable", - "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/disable", - "httpMethod": "POST", - "description": "Disables an Anywhere Cache instance.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the partent bucket", - "required": true, - "location": "path" - }, - "anywhereCacheId": { - "type": "string", - "description": "The ID of requested Anywhere Cache instance.", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "bucket", - "anywhereCacheId" - ], - "response": { - "$ref": "AnywhereCache" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - }, - "bucketAccessControls": { - "methods": { - "delete": { - "id": "storage.bucketAccessControls.delete", - "path": "b/{bucket}/acl/{entity}", - "httpMethod": "DELETE", - "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "entity" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "get": { - "id": "storage.bucketAccessControls.get", - "path": "b/{bucket}/acl/{entity}", - "httpMethod": "GET", - "description": "Returns the ACL entry for the specified entity on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "entity" - ], - "response": { - "$ref": "BucketAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "id": "storage.bucketAccessControls.insert", - "path": "b/{bucket}/acl", - "httpMethod": "POST", - "description": "Creates a new ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "BucketAccessControl" - }, - "response": { - "$ref": "BucketAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "list": { - "id": "storage.bucketAccessControls.list", - "path": "b/{bucket}/acl", - "httpMethod": "GET", - "description": "Retrieves ACL entries on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "BucketAccessControls" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "patch": { - "id": "storage.bucketAccessControls.patch", - "path": "b/{bucket}/acl/{entity}", - "httpMethod": "PATCH", - "description": "Patches an ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "entity" - ], - "request": { - "$ref": "BucketAccessControl" - }, - "response": { - "$ref": "BucketAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "update": { - "id": "storage.bucketAccessControls.update", - "path": "b/{bucket}/acl/{entity}", - "httpMethod": "PUT", - "description": "Updates an ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "entity" - ], - "request": { - "$ref": "BucketAccessControl" - }, - "response": { - "$ref": "BucketAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "buckets": { - "methods": { - "delete": { - "id": "storage.buckets.delete", - "path": "b/{bucket}", - "httpMethod": "DELETE", - "description": "Permanently deletes an empty bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "If set, only deletes the bucket if its metageneration matches this value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "If set, only deletes the bucket if its metageneration does not match this value.", - "format": "int64", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "id": "storage.buckets.get", - "path": "b/{bucket}", - "httpMethod": "GET", - "description": "Returns metadata for the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "getIamPolicy": { - "id": "storage.buckets.getIamPolicy", - "path": "b/{bucket}/iam", - "httpMethod": "GET", - "description": "Returns an IAM policy for the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "optionsRequestedPolicyVersion": { - "type": "integer", - "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", - "format": "int32", - "minimum": "1", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "id": "storage.buckets.insert", - "path": "b", - "httpMethod": "POST", - "description": "Creates a new bucket.", - "parameters": { - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this bucket.", - "enum": [ - "authenticatedRead", - "private", - "projectPrivate", - "publicRead", - "publicReadWrite" - ], - "enumDescriptions": [ - "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - "Project team owners get OWNER access.", - "Project team members get access according to their roles.", - "Project team owners get OWNER access, and allUsers get READER access.", - "Project team owners get OWNER access, and allUsers get WRITER access." - ], - "location": "query" - }, - "predefinedDefaultObjectAcl": { - "type": "string", - "description": "Apply a predefined set of default object access controls to this bucket.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "project": { - "type": "string", - "description": "A valid API project identifier.", - "required": true, - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - }, - "enableObjectRetention": { - "type": "boolean", - "description": "When set to true, object retention is enabled for this bucket.", - "default": "false", - "location": "query" - } - }, - "parameterOrder": [ - "project" - ], - "request": { - "$ref": "Bucket" - }, - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "list": { - "id": "storage.buckets.list", - "path": "b", - "httpMethod": "GET", - "description": "Retrieves a list of buckets for a given project.", - "parameters": { - "maxResults": { - "type": "integer", - "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.", - "default": "1000", - "format": "uint32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - }, - "prefix": { - "type": "string", - "description": "Filter results to buckets whose names begin with this prefix.", - "location": "query" - }, - "project": { - "type": "string", - "description": "A valid API project identifier.", - "required": true, - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } - }, - "parameterOrder": [ - "project" - ], - "response": { - "$ref": "Buckets" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "lockRetentionPolicy": { - "id": "storage.buckets.lockRetentionPolicy", - "path": "b/{bucket}/lockRetentionPolicy", - "httpMethod": "POST", - "description": "Locks retention policy on a bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.", - "required": true, - "format": "int64", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "ifMetagenerationMatch" - ], - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "patch": { - "id": "storage.buckets.patch", - "path": "b/{bucket}", - "httpMethod": "PATCH", - "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this bucket.", - "enum": [ - "authenticatedRead", - "private", - "projectPrivate", - "publicRead", - "publicReadWrite" - ], - "enumDescriptions": [ - "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - "Project team owners get OWNER access.", - "Project team members get access according to their roles.", - "Project team owners get OWNER access, and allUsers get READER access.", - "Project team owners get OWNER access, and allUsers get WRITER access." - ], - "location": "query" - }, - "predefinedDefaultObjectAcl": { - "type": "string", - "description": "Apply a predefined set of default object access controls to this bucket.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Bucket" - }, - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "setIamPolicy": { - "id": "storage.buckets.setIamPolicy", - "path": "b/{bucket}/iam", - "httpMethod": "PUT", - "description": "Updates an IAM policy for the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Policy" - }, - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "testIamPermissions": { - "id": "storage.buckets.testIamPermissions", - "path": "b/{bucket}/iam/testPermissions", - "httpMethod": "GET", - "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "permissions": { - "type": "string", - "description": "Permissions to test.", - "required": true, - "repeated": true, - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "permissions" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "update": { - "id": "storage.buckets.update", - "path": "b/{bucket}", - "httpMethod": "PUT", - "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this bucket.", - "enum": [ - "authenticatedRead", - "private", - "projectPrivate", - "publicRead", - "publicReadWrite" - ], - "enumDescriptions": [ - "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - "Project team owners get OWNER access.", - "Project team members get access according to their roles.", - "Project team owners get OWNER access, and allUsers get READER access.", - "Project team owners get OWNER access, and allUsers get WRITER access." - ], - "location": "query" - }, - "predefinedDefaultObjectAcl": { - "type": "string", - "description": "Apply a predefined set of default object access controls to this bucket.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Bucket" - }, - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "operations": { - "methods": { - "cancel": { - "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed.", - "path": "b/{bucket}/operations/{operationId}/cancel", - "httpMethod": "POST", - "id": "storage.buckets.operations.cancel", - "parameterOrder": [ - "bucket", - "operationId" - ], - "parameters": { - "bucket": { - "description": "The parent bucket of the operation resource.", - "location": "path", - "required": true, - "type": "string" - }, - "operationId": { - "description": "The ID of the operation resource.", - "location": "path", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "description": "Gets the latest state of a long-running operation.", - "path": "b/{bucket}/operations/{operationId}", - "httpMethod": "GET", - "id": "storage.buckets.operations.get", - "parameterOrder": [ - "bucket", - "operationId" - ], - "parameters": { - "bucket": { - "description": "The parent bucket of the operation resource.", - "location": "path", - "required": true, - "type": "string" - }, - "operationId": { - "description": "The ID of the operation resource.", - "location": "path", - "required": true, - "type": "string" - } - }, - "response": { - "$ref": "GoogleLongrunningOperation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "list": { - "description": "Lists operations that match the specified filter in the request.", - "path": "b/{bucket}/operations", - "httpMethod": "GET", - "id": "storage.buckets.operations.list", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "filter": { - "description": "A filter to narrow down results to a preferred subset. The filtering language is documented in more detail in [AIP-160](https://google.aip.dev/160).", - "location": "query", - "type": "string" - }, - "bucket": { - "description": "Name of the bucket in which to look for operations.", - "location": "path", - "required": true, - "type": "string" - }, - "pageSize": { - "description": "Maximum number of items to return in a single page of responses. Fewer total results may be returned than requested. The service uses this parameter or 100 items, whichever is smaller.", - "minimum": "0", - "format": "int32", - "location": "query", - "type": "integer" - }, - "pageToken": { - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query", - "type": "string" - } - }, - "response": { - "$ref": "GoogleLongrunningListOperationsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - }, - "channels": { - "methods": { - "stop": { - "id": "storage.channels.stop", - "path": "channels/stop", - "httpMethod": "POST", - "description": "Stop watching resources through this channel", - "request": { - "$ref": "Channel", - "parameterName": "resource" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - }, - "defaultObjectAccessControls": { - "methods": { - "delete": { - "id": "storage.defaultObjectAccessControls.delete", - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "httpMethod": "DELETE", - "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "entity" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "get": { - "id": "storage.defaultObjectAccessControls.get", - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "httpMethod": "GET", - "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "entity" - ], - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "id": "storage.defaultObjectAccessControls.insert", - "path": "b/{bucket}/defaultObjectAcl", - "httpMethod": "POST", - "description": "Creates a new default object ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "list": { - "id": "storage.defaultObjectAccessControls.list", - "path": "b/{bucket}/defaultObjectAcl", - "httpMethod": "GET", - "description": "Retrieves default object ACL entries on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "ObjectAccessControls" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "patch": { - "id": "storage.defaultObjectAccessControls.patch", - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "httpMethod": "PATCH", - "description": "Patches a default object ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "entity" - ], - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "update": { - "id": "storage.defaultObjectAccessControls.update", - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "httpMethod": "PUT", - "description": "Updates a default object ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "entity" - ], - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "managedFolders": { - "methods": { - "delete": { - "id": "storage.managedFolders.delete", - "path": "b/{bucket}/managedFolders/{managedFolder}", - "httpMethod": "DELETE", - "description": "Permanently deletes a managed folder.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket containing the managed folder.", - "required": true, - "location": "path" - }, - "managedFolder": { - "type": "string", - "description": "The managed folder name/path.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "If set, only deletes the managed folder if its metageneration matches this value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "If set, only deletes the managed folder if its metageneration does not match this value.", - "format": "int64", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "managedFolder" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "id": "storage.managedFolders.get", - "path": "b/{bucket}/managedFolders/{managedFolder}", - "httpMethod": "GET", - "description": "Returns metadata of the specified managed folder.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket containing the managed folder.", - "required": true, - "location": "path" - }, - "managedFolder": { - "type": "string", - "description": "The managed folder name/path.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "managedFolder" - ], - "response": { - "$ref": "ManagedFolder" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "getIamPolicy": { - "id": "storage.managedFolders.getIamPolicy", - "path": "b/{bucket}/managedFolders/{managedFolder}/iam", - "httpMethod": "GET", - "description": "Returns an IAM policy for the specified managed folder.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket containing the managed folder.", - "required": true, - "location": "path" - }, - "optionsRequestedPolicyVersion": { - "type": "integer", - "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", - "format": "int32", - "minimum": "1", - "location": "query" - }, - "managedFolder": { - "type": "string", - "description": "The managed folder name/path.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "managedFolder" - ], - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "insert": { - "id": "storage.managedFolders.insert", - "path": "b/{bucket}/managedFolders", - "httpMethod": "POST", - "description": "Creates a new managed folder.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket containing the managed folder.", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "ManagedFolder" - }, - "response": { - "$ref": "ManagedFolder" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "list": { - "id": "storage.managedFolders.list", - "path": "b/{bucket}/managedFolders", - "httpMethod": "GET", - "description": "Lists managed folders in the given bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket containing the managed folder.", - "required": true, - "location": "path" - }, - "pageSize": { - "type": "integer", - "description": "Maximum number of items return in a single page of responses.", - "format": "int32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - }, - "prefix": { - "type": "string", - "description": "The managed folder name/path prefix to filter the output list of results.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "ManagedFolders" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "setIamPolicy": { - "id": "storage.managedFolders.setIamPolicy", - "path": "b/{bucket}/managedFolders/{managedFolder}/iam", - "httpMethod": "PUT", - "description": "Updates an IAM policy for the specified managed folder.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket containing the managed folder.", - "required": true, - "location": "path" - }, - "managedFolder": { - "type": "string", - "description": "The managed folder name/path.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "managedFolder" - ], - "request": { - "$ref": "Policy" - }, - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "testIamPermissions": { - "id": "storage.managedFolders.testIamPermissions", - "path": "b/{bucket}/managedFolders/{managedFolder}/iam/testPermissions", - "httpMethod": "GET", - "description": "Tests a set of permissions on the given managed folder to see which, if any, are held by the caller.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket containing the managed folder.", - "required": true, - "location": "path" - }, - "managedFolder": { - "type": "string", - "description": "The managed folder name/path.", - "required": true, - "location": "path" - }, - "permissions": { - "type": "string", - "description": "Permissions to test.", - "required": true, - "repeated": true, - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "managedFolder", - "permissions" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - }, - "notifications": { - "methods": { - "delete": { - "id": "storage.notifications.delete", - "path": "b/{bucket}/notificationConfigs/{notification}", - "httpMethod": "DELETE", - "description": "Permanently deletes a notification subscription.", - "parameters": { - "bucket": { - "type": "string", - "description": "The parent bucket of the notification.", - "required": true, - "location": "path" - }, - "notification": { - "type": "string", - "description": "ID of the notification to delete.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "notification" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "id": "storage.notifications.get", - "path": "b/{bucket}/notificationConfigs/{notification}", - "httpMethod": "GET", - "description": "View a notification configuration.", - "parameters": { - "bucket": { - "type": "string", - "description": "The parent bucket of the notification.", - "required": true, - "location": "path" - }, - "notification": { - "type": "string", - "description": "Notification ID", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "notification" - ], - "response": { - "$ref": "Notification" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "insert": { - "id": "storage.notifications.insert", - "path": "b/{bucket}/notificationConfigs", - "httpMethod": "POST", - "description": "Creates a notification subscription for a given bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "The parent bucket of the notification.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Notification" - }, - "response": { - "$ref": "Notification" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "list": { - "id": "storage.notifications.list", - "path": "b/{bucket}/notificationConfigs", - "httpMethod": "GET", - "description": "Retrieves a list of notification subscriptions for a given bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a Google Cloud Storage bucket.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "Notifications" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - }, - "objectAccessControls": { - "methods": { - "delete": { - "id": "storage.objectAccessControls.delete", - "path": "b/{bucket}/o/{object}/acl/{entity}", - "httpMethod": "DELETE", - "description": "Permanently deletes the ACL entry for the specified entity on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "get": { - "id": "storage.objectAccessControls.get", - "path": "b/{bucket}/o/{object}/acl/{entity}", - "httpMethod": "GET", - "description": "Returns the ACL entry for the specified entity on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "id": "storage.objectAccessControls.insert", - "path": "b/{bucket}/o/{object}/acl", - "httpMethod": "POST", - "description": "Creates a new ACL entry on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object" - ], - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "list": { - "id": "storage.objectAccessControls.list", - "path": "b/{bucket}/o/{object}/acl", - "httpMethod": "GET", - "description": "Retrieves ACL entries on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object" - ], - "response": { - "$ref": "ObjectAccessControls" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "patch": { - "id": "storage.objectAccessControls.patch", - "path": "b/{bucket}/o/{object}/acl/{entity}", - "httpMethod": "PATCH", - "description": "Patches an ACL entry on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "update": { - "id": "storage.objectAccessControls.update", - "path": "b/{bucket}/o/{object}/acl/{entity}", - "httpMethod": "PUT", - "description": "Updates an ACL entry on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "objects": { - "methods": { - "compose": { - "id": "storage.objects.compose", - "path": "b/{destinationBucket}/o/{destinationObject}/compose", - "httpMethod": "POST", - "description": "Concatenates a list of existing objects into a new object in the same bucket.", - "parameters": { - "destinationBucket": { - "type": "string", - "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.", - "required": true, - "location": "path" - }, - "destinationObject": { - "type": "string", - "description": "Name of the new object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "destinationPredefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to the destination object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "kmsKeyName": { - "type": "string", - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "destinationBucket", - "destinationObject" - ], - "request": { - "$ref": "ComposeRequest" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "copy": { - "id": "storage.objects.copy", - "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", - "httpMethod": "POST", - "description": "Copies a source object to a destination object. Optionally overrides metadata.", - "parameters": { - "destinationBucket": { - "type": "string", - "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "destinationKmsKeyName": { - "type": "string", - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query" - }, - "destinationObject": { - "type": "string", - "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", - "required": true, - "location": "path" - }, - "destinationPredefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to the destination object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "sourceBucket": { - "type": "string", - "description": "Name of the bucket in which to find the source object.", - "required": true, - "location": "path" - }, - "sourceGeneration": { - "type": "string", - "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "sourceObject": { - "type": "string", - "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "sourceBucket", - "sourceObject", - "destinationBucket", - "destinationObject" - ], - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "delete": { - "id": "storage.objects.delete", - "path": "b/{bucket}/o/{object}", - "httpMethod": "DELETE", - "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "id": "storage.objects.get", - "path": "b/{bucket}/o/{object}", - "httpMethod": "GET", - "description": "Retrieves an object or its metadata.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - }, - "softDeleted": { - "type": "boolean", - "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object" - ], - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true - }, - "getIamPolicy": { - "id": "storage.objects.getIamPolicy", - "path": "b/{bucket}/o/{object}/iam", - "httpMethod": "GET", - "description": "Returns an IAM policy for the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object" - ], - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "insert": { - "id": "storage.objects.insert", - "path": "b/{bucket}/o", - "httpMethod": "POST", - "description": "Stores a new object and metadata.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", - "required": true, - "location": "path" - }, - "contentEncoding": { - "type": "string", - "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "kmsKeyName": { - "type": "string", - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query" - }, - "name": { - "type": "string", - "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "location": "query" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsMediaUpload": true, - "mediaUpload": { - "accept": [ - "*/*" - ], - "protocols": { - "simple": { - "multipart": true, - "path": "/upload/storage/v1/b/{bucket}/o" - }, - "resumable": { - "multipart": true, - "path": "/resumable/upload/storage/v1/b/{bucket}/o" - } - } - } - }, - "list": { - "id": "storage.objects.list", - "path": "b/{bucket}/o", - "httpMethod": "GET", - "description": "Retrieves a list of objects matching the criteria.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which to look for objects.", - "required": true, - "location": "path" - }, - "delimiter": { - "type": "string", - "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", - "location": "query" - }, - "endOffset": { - "type": "string", - "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query" - }, - "includeTrailingDelimiter": { - "type": "boolean", - "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", - "location": "query" - }, - "maxResults": { - "type": "integer", - "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", - "default": "1000", - "format": "uint32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - }, - "prefix": { - "type": "string", - "description": "Filter results to objects whose names begin with this prefix.", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "startOffset": { - "type": "string", - "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - }, - "versions": { - "type": "boolean", - "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", - "location": "query" - }, - "matchGlob": { - "type": "string", - "description": "Filter results to objects and prefixes that match this glob pattern.", - "location": "query" - }, - "softDeleted": { - "type": "boolean", - "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.", - "location": "query" - }, - "includeFoldersAsPrefixes": { - "type": "boolean", - "description": "Only applicable if delimiter is set to '/'. If true, will also include folders and managed folders (besides objects) in the returned prefixes.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "Objects" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsSubscription": true - }, - "patch": { - "id": "storage.objects.patch", - "path": "b/{bucket}/o/{object}", - "httpMethod": "PATCH", - "description": "Patches an object's metadata.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "overrideUnlockedRetention": { - "type": "boolean", - "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object" - ], - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "rewrite": { - "id": "storage.objects.rewrite", - "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", - "httpMethod": "POST", - "description": "Rewrites a source object to a destination object. Optionally overrides metadata.", - "parameters": { - "destinationBucket": { - "type": "string", - "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", - "required": true, - "location": "path" - }, - "destinationKmsKeyName": { - "type": "string", - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query" - }, - "destinationObject": { - "type": "string", - "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "destinationPredefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to the destination object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "maxBytesRewrittenPerCall": { - "type": "string", - "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", - "format": "int64", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "rewriteToken": { - "type": "string", - "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", - "location": "query" - }, - "sourceBucket": { - "type": "string", - "description": "Name of the bucket in which to find the source object.", - "required": true, - "location": "path" - }, - "sourceGeneration": { - "type": "string", - "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "sourceObject": { - "type": "string", - "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "sourceBucket", - "sourceObject", - "destinationBucket", - "destinationObject" - ], - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "RewriteResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "setIamPolicy": { - "id": "storage.objects.setIamPolicy", - "path": "b/{bucket}/o/{object}/iam", - "httpMethod": "PUT", - "description": "Updates an IAM policy for the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object" - ], - "request": { - "$ref": "Policy" - }, - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "testIamPermissions": { - "id": "storage.objects.testIamPermissions", - "path": "b/{bucket}/o/{object}/iam/testPermissions", - "httpMethod": "GET", - "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "permissions": { - "type": "string", - "description": "Permissions to test.", - "required": true, - "repeated": true, - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object", - "permissions" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "update": { - "id": "storage.objects.update", - "path": "b/{bucket}/o/{object}", - "httpMethod": "PUT", - "description": "Updates an object's metadata.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "overrideUnlockedRetention": { - "type": "boolean", - "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", - "required": true, - "location": "path" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object" - ], - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "watchAll": { - "id": "storage.objects.watchAll", - "path": "b/{bucket}/o/watch", - "httpMethod": "POST", - "description": "Watch for changes on all objects in a bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which to look for objects.", - "required": true, - "location": "path" - }, - "delimiter": { - "type": "string", - "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", - "location": "query" - }, - "endOffset": { - "type": "string", - "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query" - }, - "includeTrailingDelimiter": { - "type": "boolean", - "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", - "location": "query" - }, - "maxResults": { - "type": "integer", - "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", - "default": "1000", - "format": "uint32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - }, - "prefix": { - "type": "string", - "description": "Filter results to objects whose names begin with this prefix.", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "startOffset": { - "type": "string", - "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - }, - "versions": { - "type": "boolean", - "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Channel", - "parameterName": "resource" - }, - "response": { - "$ref": "Channel" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsSubscription": true - }, - "restore": { - "id": "storage.objects.restore", - "path": "b/{bucket}/o/{object}/restore", - "httpMethod": "POST", - "description": "Restores a soft-deleted object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "Selects a specific revision of this object.", - "required": true, - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's one live generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether none of the object's live generations match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's one live metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether none of the object's live metagenerations match the given value.", - "format": "int64", - "location": "query" - }, - "copySourceAcl": { - "type": "boolean", - "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } - }, - "parameterOrder": [ - "bucket", - "object" - ], - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "type": "boolean", + "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.", + "location": "query" }, - "bulkRestore": { - "id": "storage.objects.bulkRestore", - "path": "b/{bucket}/o/bulkRestore", - "httpMethod": "POST", - "description": "Initiates a long-running bulk restore operation on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "BulkRestoreObjectsRequest" - }, - "response": { - "$ref": "GoogleLongrunningOperation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } - } - }, - "projects": { - "resources": { - "hmacKeys": { - "methods": { - "create": { - "id": "storage.projects.hmacKeys.create", - "path": "projects/{projectId}/hmacKeys", - "httpMethod": "POST", - "description": "Creates a new HMAC key for the specified service account.", - "parameters": { - "projectId": { - "type": "string", - "description": "Project ID owning the service account.", - "required": true, - "location": "path" - }, - "serviceAccountEmail": { - "type": "string", - "description": "Email address of the service account.", - "required": true, - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } - }, - "parameterOrder": [ - "projectId", - "serviceAccountEmail" - ], - "response": { - "$ref": "HmacKey" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "delete": { - "id": "storage.projects.hmacKeys.delete", - "path": "projects/{projectId}/hmacKeys/{accessId}", - "httpMethod": "DELETE", - "description": "Deletes an HMAC key.", - "parameters": { - "accessId": { - "type": "string", - "description": "Name of the HMAC key to be deleted.", - "required": true, - "location": "path" - }, - "projectId": { - "type": "string", - "description": "Project ID owning the requested key", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } - }, - "parameterOrder": [ - "projectId", - "accessId" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "id": "storage.projects.hmacKeys.get", - "path": "projects/{projectId}/hmacKeys/{accessId}", - "httpMethod": "GET", - "description": "Retrieves an HMAC key's metadata", - "parameters": { - "accessId": { - "type": "string", - "description": "Name of the HMAC key.", - "required": true, - "location": "path" - }, - "projectId": { - "type": "string", - "description": "Project ID owning the service account of the requested key.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } - }, - "parameterOrder": [ - "projectId", - "accessId" - ], - "response": { - "$ref": "HmacKeyMetadata" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only" - ] - }, - "list": { - "id": "storage.projects.hmacKeys.list", - "path": "projects/{projectId}/hmacKeys", - "httpMethod": "GET", - "description": "Retrieves a list of HMAC keys matching the criteria.", - "parameters": { - "maxResults": { - "type": "integer", - "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.", - "default": "250", - "format": "uint32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - }, - "projectId": { - "type": "string", - "description": "Name of the project in which to look for HMAC keys.", - "required": true, - "location": "path" - }, - "serviceAccountEmail": { - "type": "string", - "description": "If present, only keys for the given service account are returned.", - "location": "query" +}, +"parameterOrder": [ + "bucket", + "object", + "generation" + ], + "response": { + "$ref": "Object" }, - "showDeletedKeys": { - "type": "boolean", - "description": "Whether or not to show keys in the DELETED state.", - "location": "query" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "bulkRestore": { + "id": "storage.objects.bulkRestore", + "path": "b/{bucket}/o/bulkRestore", + "httpMethod": "POST", + "description": "Initiates a long-running bulk restore operation on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + } }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } - }, - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "HmacKeysMetadata" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only" - ] - }, - "update": { - "id": "storage.projects.hmacKeys.update", - "path": "projects/{projectId}/hmacKeys/{accessId}", - "httpMethod": "PUT", - "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.", - "parameters": { - "accessId": { - "type": "string", - "description": "Name of the HMAC key being updated.", - "required": true, - "location": "path" + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "BulkRestoreObjectsRequest" }, - "projectId": { - "type": "string", - "description": "Project ID owning the service account of the updated key.", - "required": true, - "location": "path" + "response": { + "$ref": "GoogleLongrunningOperation" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + } +} +}, +"projects": { +"resources": { + "hmacKeys": { + "methods": { + "create": { + "id": "storage.projects.hmacKeys.create", + "path": "projects/{projectId}/hmacKeys", + "httpMethod": "POST", + "description": "Creates a new HMAC key for the specified service account.", + "parameters": { + "projectId": { + "type": "string", + "description": "Project ID owning the service account.", + "required": true, + "location": "path" + }, + "serviceAccountEmail": { + "type": "string", + "description": "Email address of the service account.", + "required": true, + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "serviceAccountEmail" + ], + "response": { + "$ref": "HmacKey" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "delete": { + "id": "storage.projects.hmacKeys.delete", + "path": "projects/{projectId}/hmacKeys/{accessId}", + "httpMethod": "DELETE", + "description": "Deletes an HMAC key.", + "parameters": { + "accessId": { + "type": "string", + "description": "Name of the HMAC key to be deleted.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID owning the requested key", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "accessId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.projects.hmacKeys.get", + "path": "projects/{projectId}/hmacKeys/{accessId}", + "httpMethod": "GET", + "description": "Retrieves an HMAC key's metadata", + "parameters": { + "accessId": { + "type": "string", + "description": "Name of the HMAC key.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID owning the service account of the requested key.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "accessId" + ], + "response": { + "$ref": "HmacKeyMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only" + ] + }, + "list": { + "id": "storage.projects.hmacKeys.list", + "path": "projects/{projectId}/hmacKeys", + "httpMethod": "GET", + "description": "Retrieves a list of HMAC keys matching the criteria.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.", + "default": "250", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "projectId": { + "type": "string", + "description": "Name of the project in which to look for HMAC keys.", + "required": true, + "location": "path" + }, + "serviceAccountEmail": { + "type": "string", + "description": "If present, only keys for the given service account are returned.", + "location": "query" + }, + "showDeletedKeys": { + "type": "boolean", + "description": "Whether or not to show keys in the DELETED state.", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "HmacKeysMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only" + ] + }, + "update": { + "id": "storage.projects.hmacKeys.update", + "path": "projects/{projectId}/hmacKeys/{accessId}", + "httpMethod": "PUT", + "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.", + "parameters": { + "accessId": { + "type": "string", + "description": "Name of the HMAC key being updated.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID owning the service account of the updated key.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "accessId" + ], + "request": { + "$ref": "HmacKeyMetadata" + }, + "response": { + "$ref": "HmacKeyMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + } } - }, - "parameterOrder": [ - "projectId", - "accessId" - ], - "request": { - "$ref": "HmacKeyMetadata" - }, - "response": { - "$ref": "HmacKeyMetadata" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } }, "serviceAccount": { - "methods": { - "get": { - "id": "storage.projects.serviceAccount.get", - "path": "projects/{projectId}/serviceAccount", - "httpMethod": "GET", - "description": "Get the email address of this project's Google Cloud Storage service account.", - "parameters": { - "projectId": { - "type": "string", - "description": "Project ID", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" + "methods": { + "get": { + "id": "storage.projects.serviceAccount.get", + "path": "projects/{projectId}/serviceAccount", + "httpMethod": "GET", + "description": "Get the email address of this project's Google Cloud Storage service account.", + "parameters": { + "projectId": { + "type": "string", + "description": "Project ID", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ServiceAccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + } } - }, - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "ServiceAccount" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } } - } - } - }, - "revision": "20231028", - "etag": "\"39383633393336373936373236333033393737\"" +} +} +}, + "revision": "20240501", + "etag": "\"3135313638313632393935373531333737363832\"" } diff --git a/Storage/src/StorageClient.php b/Storage/src/StorageClient.php index b4945a63b26d..c0fd5151e27d 100644 --- a/Storage/src/StorageClient.php +++ b/Storage/src/StorageClient.php @@ -47,7 +47,7 @@ class StorageClient use ArrayTrait; use ClientTrait; - const VERSION = '1.41.3'; + const VERSION = '1.42.0'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/devstorage.full_control'; const READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only'; @@ -292,6 +292,8 @@ function (array $bucket) use ($userProject) { * set in conjunction. For more information, see * [Bucket Locations](https://cloud.google.com/storage/docs/locations). * **Defaults to** `"US"`. + * @type array $hierarchicalNamespace The hierarchical namespace configuration + * on this bucket. * @type array $customPlacementConfig The bucket's dual regions. For more * information, see * [Bucket Locations](https://cloud.google.com/storage/docs/locations). diff --git a/Storage/tests/System/ManageBucketsTest.php b/Storage/tests/System/ManageBucketsTest.php index 1b2d23a11a5a..59f97ac69fe7 100644 --- a/Storage/tests/System/ManageBucketsTest.php +++ b/Storage/tests/System/ManageBucketsTest.php @@ -104,6 +104,21 @@ public function testCreatesDualRegionBucket() ); } + /** + * @dataProvider hnsConfigs + */ + public function testCreateBucketsWithHnsConfigs($hnsConfig, $expectedHnsEnabled) + { + $name = uniqid(self::TESTING_PREFIX); + + $this->assertFalse(self::$client->bucket($name)->exists()); + $bucket = self::createBucket(self::$client, $name, $hnsConfig); + + $this->assertTrue(self::$client->bucket($name)->exists()); + $this->assertEquals($name, $bucket->name()); + $this->assertEquals($expectedHnsEnabled, $bucket->info()['hierarchicalNamespace']['enabled'] ?? false); + } + public function testUpdateBucket() { $options = [ @@ -464,4 +479,16 @@ public function autoclassConfigs() [['enabled' => true, 'terminalStorageClass' => 'ARCHIVE']], ]; } + + public function hnsConfigs() + { + return [ + [[], false], + [['hierarchicalNamespace' => ['enabled' => false,]], false], + [[ + 'hierarchicalNamespace' => ['enabled' => true,], + 'iamConfiguration' => ['uniformBucketLevelAccess' => ['enabled' => true]] + ], true], + ]; + } } diff --git a/StorageControl/.repo-metadata.json b/StorageControl/.repo-metadata.json deleted file mode 100644 index 74e764e608ed..000000000000 --- a/StorageControl/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-storage-control", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-storage-control/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "storage" -} diff --git a/StorageControl/VERSION b/StorageControl/VERSION index 6e8bf73aa550..0c62199f16ac 100644 --- a/StorageControl/VERSION +++ b/StorageControl/VERSION @@ -1 +1 @@ -0.1.0 +0.2.1 diff --git a/StorageControl/composer.json b/StorageControl/composer.json index ca487cadc5b2..070b7ce5d19c 100644 --- a/StorageControl/composer.json +++ b/StorageControl/composer.json @@ -19,7 +19,7 @@ "require": { "php": "^8.0", "ext-grpc": "*", - "google/gax": "^1.30.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/StorageControl/metadata/V2/StorageControl.php b/StorageControl/metadata/V2/StorageControl.php index 6292a961c287f7376a684775318050b6606f1887..37944800ca83f08715584225fd1103678b4368a3 100644 GIT binary patch delta 55 zcmV-70LcHtJ;Xh*vI7LgH3~10OE0tK0}BiRzmxF~tpOqYGlTQ;T0Y;M`1|*a4 N5ElYpX0r$pyA3?C67c{4 delta 54 zcmV-60LlNvJ;Ob)vI7LfH3~10OE0tK0}BiRzLW6}tp<<*>OqVFlTZ^U0Y#G_1|*a4 M5ElVPvk4Kq4JbkqZU6uP diff --git a/StorageControl/samples/V2/StorageControlClient/delete_managed_folder.php b/StorageControl/samples/V2/StorageControlClient/delete_managed_folder.php index 5fec0fb26789..63dab9b8481f 100644 --- a/StorageControl/samples/V2/StorageControlClient/delete_managed_folder.php +++ b/StorageControl/samples/V2/StorageControlClient/delete_managed_folder.php @@ -67,7 +67,7 @@ function callSample(): void $formattedName = StorageControlClient::managedFolderName( '[PROJECT]', '[BUCKET]', - '[MANAGEDFOLDER]' + '[MANAGED_FOLDER]' ); delete_managed_folder_sample($formattedName); diff --git a/StorageControl/samples/V2/StorageControlClient/get_managed_folder.php b/StorageControl/samples/V2/StorageControlClient/get_managed_folder.php index 1d48475f4ef5..c6fbdeb48898 100644 --- a/StorageControl/samples/V2/StorageControlClient/get_managed_folder.php +++ b/StorageControl/samples/V2/StorageControlClient/get_managed_folder.php @@ -69,7 +69,7 @@ function callSample(): void $formattedName = StorageControlClient::managedFolderName( '[PROJECT]', '[BUCKET]', - '[MANAGEDFOLDER]' + '[MANAGED_FOLDER]' ); get_managed_folder_sample($formattedName); diff --git a/StorageControl/src/V2/Client/StorageControlClient.php b/StorageControl/src/V2/Client/StorageControlClient.php index 9a766ef1fb6d..03408b6e222c 100644 --- a/StorageControl/src/V2/Client/StorageControlClient.php +++ b/StorageControl/src/V2/Client/StorageControlClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -48,6 +47,7 @@ use Google\Cloud\Storage\Control\V2\ManagedFolder; use Google\Cloud\Storage\Control\V2\RenameFolderRequest; use Google\Cloud\Storage\Control\V2\StorageLayout; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -159,6 +159,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a bucket * resource. @@ -210,7 +229,7 @@ public static function managedFolderName(string $project, string $bucket, string return self::getPathTemplate('managedFolder')->render([ 'project' => $project, 'bucket' => $bucket, - 'managedFolder' => $managedFolder, + 'managed_folder' => $managedFolder, ]); } @@ -237,7 +256,7 @@ public static function storageLayoutName(string $project, string $bucket): strin * Template: Pattern * - bucket: projects/{project}/buckets/{bucket} * - folder: projects/{project}/buckets/{bucket}/folders/{folder=**} - * - managedFolder: projects/{project}/buckets/{bucket}/managedFolders/{managedFolder=**} + * - managedFolder: projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**} * - storageLayout: projects/{project}/buckets/{bucket}/storageLayout * * The optional $template argument can be supplied to specify a particular pattern, diff --git a/StorageControl/src/V2/resources/storage_control_descriptor_config.php b/StorageControl/src/V2/resources/storage_control_descriptor_config.php index 351dee8ec73e..6a5949b7c46c 100644 --- a/StorageControl/src/V2/resources/storage_control_descriptor_config.php +++ b/StorageControl/src/V2/resources/storage_control_descriptor_config.php @@ -214,7 +214,7 @@ 'templateMap' => [ 'bucket' => 'projects/{project}/buckets/{bucket}', 'folder' => 'projects/{project}/buckets/{bucket}/folders/{folder=**}', - 'managedFolder' => 'projects/{project}/buckets/{bucket}/managedFolders/{managedFolder=**}', + 'managedFolder' => 'projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}', 'storageLayout' => 'projects/{project}/buckets/{bucket}/storageLayout', ], ], diff --git a/StorageControl/tests/Unit/V2/Client/StorageControlClientTest.php b/StorageControl/tests/Unit/V2/Client/StorageControlClientTest.php index 9d0b66f96030..59a51d91bf49 100644 --- a/StorageControl/tests/Unit/V2/Client/StorageControlClientTest.php +++ b/StorageControl/tests/Unit/V2/Client/StorageControlClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Storage\Control\V2\Client\StorageControlClient; @@ -43,6 +42,7 @@ use Google\Cloud\Storage\Control\V2\ManagedFolder; use Google\Cloud\Storage\Control\V2\RenameFolderRequest; use Google\Cloud\Storage\Control\V2\StorageLayout; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; @@ -316,7 +316,7 @@ public function deleteManagedFolderTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->managedFolderName('[PROJECT]', '[BUCKET]', '[MANAGEDFOLDER]'); + $formattedName = $gapicClient->managedFolderName('[PROJECT]', '[BUCKET]', '[MANAGED_FOLDER]'); $request = (new DeleteManagedFolderRequest())->setName($formattedName); $gapicClient->deleteManagedFolder($request); $actualRequests = $transport->popReceivedCalls(); @@ -351,7 +351,7 @@ public function deleteManagedFolderExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->managedFolderName('[PROJECT]', '[BUCKET]', '[MANAGEDFOLDER]'); + $formattedName = $gapicClient->managedFolderName('[PROJECT]', '[BUCKET]', '[MANAGED_FOLDER]'); $request = (new DeleteManagedFolderRequest())->setName($formattedName); try { $gapicClient->deleteManagedFolder($request); @@ -449,7 +449,7 @@ public function getManagedFolderTest() $expectedResponse->setMetageneration($metageneration); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->managedFolderName('[PROJECT]', '[BUCKET]', '[MANAGEDFOLDER]'); + $formattedName = $gapicClient->managedFolderName('[PROJECT]', '[BUCKET]', '[MANAGED_FOLDER]'); $request = (new GetManagedFolderRequest())->setName($formattedName); $response = $gapicClient->getManagedFolder($request); $this->assertEquals($expectedResponse, $response); @@ -485,7 +485,7 @@ public function getManagedFolderExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->managedFolderName('[PROJECT]', '[BUCKET]', '[MANAGEDFOLDER]'); + $formattedName = $gapicClient->managedFolderName('[PROJECT]', '[BUCKET]', '[MANAGED_FOLDER]'); $request = (new GetManagedFolderRequest())->setName($formattedName); try { $gapicClient->getManagedFolder($request); diff --git a/StorageInsights/.repo-metadata.json b/StorageInsights/.repo-metadata.json deleted file mode 100644 index 608acbb58882..000000000000 --- a/StorageInsights/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-storageinsights", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-storageinsights/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "storageinsights" -} diff --git a/StorageInsights/VERSION b/StorageInsights/VERSION index 1c09c74e221c..c2c0004f0e2a 100644 --- a/StorageInsights/VERSION +++ b/StorageInsights/VERSION @@ -1 +1 @@ -0.3.3 +0.3.5 diff --git a/StorageInsights/composer.json b/StorageInsights/composer.json index 7f05cefc7f80..a97274817198 100644 --- a/StorageInsights/composer.json +++ b/StorageInsights/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/StorageTransfer/.repo-metadata.json b/StorageTransfer/.repo-metadata.json deleted file mode 100644 index 68eef034b7b0..000000000000 --- a/StorageTransfer/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-storage-transfer", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-storage-transfer/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "storagetransfer" -} diff --git a/StorageTransfer/VERSION b/StorageTransfer/VERSION index 428b770e3e23..e516bb9d963a 100644 --- a/StorageTransfer/VERSION +++ b/StorageTransfer/VERSION @@ -1 +1 @@ -1.4.3 +1.4.5 diff --git a/StorageTransfer/composer.json b/StorageTransfer/composer.json index dede2c8fb254..b61aba1cd483 100644 --- a/StorageTransfer/composer.json +++ b/StorageTransfer/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Support/.repo-metadata.json b/Support/.repo-metadata.json deleted file mode 100644 index 9313a27b6b5c..000000000000 --- a/Support/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-support", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-support/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudsupport" -} diff --git a/Support/VERSION b/Support/VERSION index 7179039691ce..3a4036fb450f 100644 --- a/Support/VERSION +++ b/Support/VERSION @@ -1 +1 @@ -0.2.3 +0.2.5 diff --git a/Support/composer.json b/Support/composer.json index e03244b32467..2d2cd6388db3 100644 --- a/Support/composer.json +++ b/Support/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Talent/.repo-metadata.json b/Talent/.repo-metadata.json deleted file mode 100644 index bf0556292629..000000000000 --- a/Talent/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-talent", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-talent/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "jobs" -} diff --git a/Talent/VERSION b/Talent/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/Talent/VERSION +++ b/Talent/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/Talent/composer.json b/Talent/composer.json index 05d622f694a8..a6760304f09f 100644 --- a/Talent/composer.json +++ b/Talent/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Tasks/.repo-metadata.json b/Tasks/.repo-metadata.json deleted file mode 100644 index a062cc0e4e03..000000000000 --- a/Tasks/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-tasks", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-tasks/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "cloudtasks" -} diff --git a/Tasks/VERSION b/Tasks/VERSION index 4e00d0ac0791..c6ba3bc1a4e4 100644 --- a/Tasks/VERSION +++ b/Tasks/VERSION @@ -1 +1 @@ -1.14.4 +1.14.6 diff --git a/Tasks/composer.json b/Tasks/composer.json index 5a8099b9be59..acc0bc0a4270 100644 --- a/Tasks/composer.json +++ b/Tasks/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/TelcoAutomation/.repo-metadata.json b/TelcoAutomation/.repo-metadata.json deleted file mode 100644 index ee904f499667..000000000000 --- a/TelcoAutomation/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-telcoautomation", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-telcoautomation/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "telcoautomation" -} diff --git a/TelcoAutomation/VERSION b/TelcoAutomation/VERSION index 7179039691ce..3a4036fb450f 100644 --- a/TelcoAutomation/VERSION +++ b/TelcoAutomation/VERSION @@ -1 +1 @@ -0.2.3 +0.2.5 diff --git a/TelcoAutomation/composer.json b/TelcoAutomation/composer.json index 215ba81219ff..8b3bbe8120e0 100644 --- a/TelcoAutomation/composer.json +++ b/TelcoAutomation/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/TelcoAutomation/src/V1/Client/TelcoAutomationClient.php b/TelcoAutomation/src/V1/Client/TelcoAutomationClient.php index 5a1dc0c42710..91265a6f6ade 100644 --- a/TelcoAutomation/src/V1/Client/TelcoAutomationClient.php +++ b/TelcoAutomation/src/V1/Client/TelcoAutomationClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -83,6 +82,7 @@ use Google\Cloud\TelcoAutomation\V1\UpdateBlueprintRequest; use Google\Cloud\TelcoAutomation\V1\UpdateDeploymentRequest; use Google\Cloud\TelcoAutomation\V1\UpdateHydratedDeploymentRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -219,6 +219,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a blueprint * resource. diff --git a/TelcoAutomation/tests/Unit/V1/Client/TelcoAutomationClientTest.php b/TelcoAutomation/tests/Unit/V1/Client/TelcoAutomationClientTest.php index 6aa3158d4b9e..7339aab7b609 100644 --- a/TelcoAutomation/tests/Unit/V1/Client/TelcoAutomationClientTest.php +++ b/TelcoAutomation/tests/Unit/V1/Client/TelcoAutomationClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Location\GetLocationRequest; @@ -87,6 +86,7 @@ use Google\Cloud\TelcoAutomation\V1\UpdateBlueprintRequest; use Google\Cloud\TelcoAutomation\V1\UpdateDeploymentRequest; use Google\Cloud\TelcoAutomation\V1\UpdateHydratedDeploymentRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/TextToSpeech/.repo-metadata.json b/TextToSpeech/.repo-metadata.json deleted file mode 100644 index 4c15c7c64e26..000000000000 --- a/TextToSpeech/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-text-to-speech", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-text-to-speech/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "texttospeech" -} diff --git a/TextToSpeech/VERSION b/TextToSpeech/VERSION index a7ee35a3ea70..8decb929b986 100644 --- a/TextToSpeech/VERSION +++ b/TextToSpeech/VERSION @@ -1 +1 @@ -1.8.3 +1.8.5 diff --git a/TextToSpeech/composer.json b/TextToSpeech/composer.json index 4fc84befada2..60618a962a42 100644 --- a/TextToSpeech/composer.json +++ b/TextToSpeech/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Tpu/.repo-metadata.json b/Tpu/.repo-metadata.json deleted file mode 100644 index ed663e48c3b3..000000000000 --- a/Tpu/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-tpu", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-tpu/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "tpu" -} diff --git a/Tpu/VERSION b/Tpu/VERSION index 428b770e3e23..e516bb9d963a 100644 --- a/Tpu/VERSION +++ b/Tpu/VERSION @@ -1 +1 @@ -1.4.3 +1.4.5 diff --git a/Tpu/composer.json b/Tpu/composer.json index 61ffd9522ab1..945773f4a957 100644 --- a/Tpu/composer.json +++ b/Tpu/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Tpu/src/V2/Client/TpuClient.php b/Tpu/src/V2/Client/TpuClient.php index 4c201a0182d9..024bf050a566 100644 --- a/Tpu/src/V2/Client/TpuClient.php +++ b/Tpu/src/V2/Client/TpuClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -56,6 +55,7 @@ use Google\Cloud\Tpu\V2\StartNodeRequest; use Google\Cloud\Tpu\V2\StopNodeRequest; use Google\Cloud\Tpu\V2\UpdateNodeRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -167,6 +167,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a * accelerator_type resource. diff --git a/Tpu/tests/Unit/V2/Client/TpuClientTest.php b/Tpu/tests/Unit/V2/Client/TpuClientTest.php index 1a49d458b0ea..1da8a52b3731 100644 --- a/Tpu/tests/Unit/V2/Client/TpuClientTest.php +++ b/Tpu/tests/Unit/V2/Client/TpuClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Location\GetLocationRequest; @@ -53,6 +52,7 @@ use Google\Cloud\Tpu\V2\StartNodeRequest; use Google\Cloud\Tpu\V2\StopNodeRequest; use Google\Cloud\Tpu\V2\UpdateNodeRequest; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/Trace/.repo-metadata.json b/Trace/.repo-metadata.json deleted file mode 100644 index b2cf5ffede92..000000000000 --- a/Trace/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-trace", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-trace/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "cloudtrace" -} diff --git a/Trace/VERSION b/Trace/VERSION index bfa363e76ed7..f263cd11b42d 100644 --- a/Trace/VERSION +++ b/Trace/VERSION @@ -1 +1 @@ -1.8.4 +1.8.6 diff --git a/Trace/composer.json b/Trace/composer.json index 549cf714dbc6..79c5f1d9c3f3 100644 --- a/Trace/composer.json +++ b/Trace/composer.json @@ -7,7 +7,7 @@ "php": "^8.0", "google/cloud-core": "^1.52.7", "ramsey/uuid": "^3.0|^4.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Trace/src/TraceClient.php b/Trace/src/TraceClient.php index fb4fac5f3ec2..42f118c356bc 100644 --- a/Trace/src/TraceClient.php +++ b/Trace/src/TraceClient.php @@ -40,7 +40,7 @@ class TraceClient { use ClientTrait; - const VERSION = '1.8.4'; + const VERSION = '1.8.6'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/cloud-platform'; diff --git a/Translate/.repo-metadata.json b/Translate/.repo-metadata.json deleted file mode 100644 index 38bd47deb929..000000000000 --- a/Translate/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-translate", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-translate/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "translate" -} diff --git a/Translate/VERSION b/Translate/VERSION index ff278344b339..3661bc0374ee 100644 --- a/Translate/VERSION +++ b/Translate/VERSION @@ -1 +1 @@ -1.17.5 +1.17.7 diff --git a/Translate/composer.json b/Translate/composer.json index 56278fa00180..e0859bc5d0a7 100644 --- a/Translate/composer.json +++ b/Translate/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^8.0", "google/cloud-core": "^1.52.7", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/VideoIntelligence/.repo-metadata.json b/VideoIntelligence/.repo-metadata.json deleted file mode 100644 index 618c9c0868c1..000000000000 --- a/VideoIntelligence/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-videointelligence", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-videointelligence/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "videointelligence" -} diff --git a/VideoIntelligence/VERSION b/VideoIntelligence/VERSION index f2380cc7aefe..d32434904bcb 100644 --- a/VideoIntelligence/VERSION +++ b/VideoIntelligence/VERSION @@ -1 +1 @@ -1.15.3 +1.15.5 diff --git a/VideoIntelligence/composer.json b/VideoIntelligence/composer.json index f9a8c0ddb983..df5b6e359ba2 100644 --- a/VideoIntelligence/composer.json +++ b/VideoIntelligence/composer.json @@ -5,7 +5,7 @@ "minimum-stability": "stable", "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/VideoLiveStream/.repo-metadata.json b/VideoLiveStream/.repo-metadata.json deleted file mode 100644 index e59b7654892d..000000000000 --- a/VideoLiveStream/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-video-live-stream", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-video-live-stream/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "livestream" -} diff --git a/VideoLiveStream/VERSION b/VideoLiveStream/VERSION index f38fc5393ff6..8bd6ba8c5c36 100644 --- a/VideoLiveStream/VERSION +++ b/VideoLiveStream/VERSION @@ -1 +1 @@ -0.7.3 +0.7.5 diff --git a/VideoLiveStream/composer.json b/VideoLiveStream/composer.json index 01897e7e4985..628b9661e27e 100644 --- a/VideoLiveStream/composer.json +++ b/VideoLiveStream/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/VideoStitcher/.repo-metadata.json b/VideoStitcher/.repo-metadata.json deleted file mode 100644 index dbff4dcd0fdf..000000000000 --- a/VideoStitcher/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-video-stitcher", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-video-stitcher/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "videostitcher" -} diff --git a/VideoStitcher/VERSION b/VideoStitcher/VERSION index ee94dd834b53..f374f6662e9a 100644 --- a/VideoStitcher/VERSION +++ b/VideoStitcher/VERSION @@ -1 +1 @@ -0.8.3 +0.9.1 diff --git a/VideoStitcher/composer.json b/VideoStitcher/composer.json index b2a11faedd75..d6824842b9cf 100644 --- a/VideoStitcher/composer.json +++ b/VideoStitcher/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/VideoStitcher/metadata/V1/CdnKeys.php b/VideoStitcher/metadata/V1/CdnKeys.php index 7da4b85eafa55c3385195c29b404ae160afce63a..7fa721f167f8d88e5a7157482f863a02df5d9356 100644 GIT binary patch delta 130 zcmbQsJ)dVoI1^JN`{qa{cP6G?jFT6#SV{;5aq*PoXQ$@HC+Fv-Wu{9oD==zs8<|gj z$Rh8h=bM_6ndqF7=bc)q7Xnh{3|8dC{J@b>N}G!tNlZwFi@&fmwWu<_Ah9ShH?<_S QNP-b)7AIKointernalAddGeneratedFile( + ' +ä +2google/cloud/video/stitcher/v1/fetch_options.protogoogle.cloud.video.stitcher.v1"Š + FetchOptionsJ +headers ( 29.google.cloud.video.stitcher.v1.FetchOptions.HeadersEntry. + HeadersEntry +key (  +value ( :8By +"com.google.cloud.video.stitcher.v1BFetchOptionsProtoPZ>cloud.google.com/go/video/stitcher/apiv1/stitcherpb;stitcherpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/VideoStitcher/metadata/V1/LiveConfigs.php b/VideoStitcher/metadata/V1/LiveConfigs.php index 5521f68d8b359f049b59d35f385d2e732cc93213..e3f3ffe8377e9ae1d61fe9e6b5c0a3f4cac6e0cc 100644 GIT binary patch delta 122 zcmbOv@IY{b3)95e;=D0#sU^u7{skqO`FX{YrI;ESxhKzI%4am1Jda79Hw`2ipAVH~ zVOD3nwONOmkx5a=i%X<9zqBYhH6BHcgn$C02Dg!p-sFo+a=d!ThHutoeaZv?v#%%F delta 33 pcmaDLI7wiG3)AFDOyP`NlV36APwr(_VC>txj+v2Z^KaItOaREM3)BDr diff --git a/VideoStitcher/metadata/V1/Sessions.php b/VideoStitcher/metadata/V1/Sessions.php index dff4bef886265800238cd24b071e0ef861091019..f171efa16252e6dac7e048a203e058a5d1d41afc 100644 GIT binary patch delta 278 zcmaDM(<{HBgqh`nIG65Z2NwB>S$vb1GQVY7#5Q>fOOv_~7guq9X;E@&d}&dp1giq0 z2B#2EEHNd%BrzQ<#s(7G?9S@XC@o~q#Z{J{5}%x(mzJ3>!3UCY(*EVB!KF6&AGa)L zSbmB#SZeb$w&~1FE7>;dbLBFM1GRC33@l1a&d$tBmkzEP(6_&cl zIC&nos)A4+mq|#P;GocVo_plYDsEQu>^|(vj(?O07%>9`CL4cy|}sc^+I4O c1K^Gb>;rL4FlFy$s+gqdZvD3|VJ2NwB>S$vb1GQVYi&C10UmY*^?hf8|$7M3JKaW1an{L-T2 z)cDe(ObJ#6Mh#9U<_C^ULO_Ycl=zawbg%>)Tw=2=t3TuBvux9unRc^mPUFgDWRg;y NEY734`328XCID$OBDVkl diff --git a/VideoStitcher/metadata/V1/VideoStitcherService.php b/VideoStitcher/metadata/V1/VideoStitcherService.php index cd0a93d31724..1faef2c46a9d 100644 --- a/VideoStitcher/metadata/V1/VideoStitcherService.php +++ b/VideoStitcher/metadata/V1/VideoStitcherService.php @@ -24,14 +24,15 @@ public static function initOnce() { \GPBMetadata\Google\Cloud\Video\Stitcher\V1\Sessions::initOnce(); \GPBMetadata\Google\Cloud\Video\Stitcher\V1\Slates::initOnce(); \GPBMetadata\Google\Cloud\Video\Stitcher\V1\StitchDetails::initOnce(); + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VodConfigs::initOnce(); \GPBMetadata\Google\Longrunning\Operations::initOnce(); \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -ÍO -;google/cloud/video/stitcher/v1/video_stitcher_service.protogoogle.cloud.video.stitcher.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto3google/cloud/video/stitcher/v1/ad_tag_details.proto-google/cloud/video/stitcher/v1/cdn_keys.proto1google/cloud/video/stitcher/v1/live_configs.proto-google/cloud/video/stitcher/v1/sessions.proto+google/cloud/video/stitcher/v1/slates.proto3google/cloud/video/stitcher/v1/stitch_details.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"© +õc +;google/cloud/video/stitcher/v1/video_stitcher_service.protogoogle.cloud.video.stitcher.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto3google/cloud/video/stitcher/v1/ad_tag_details.proto-google/cloud/video/stitcher/v1/cdn_keys.proto1google/cloud/video/stitcher/v1/live_configs.proto-google/cloud/video/stitcher/v1/sessions.proto+google/cloud/video/stitcher/v1/slates.proto3google/cloud/video/stitcher/v1/stitch_details.proto0google/cloud/video/stitcher/v1/vod_configs.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"© CreateCdnKeyRequest; parent ( B+àAúA%#videostitcher.googleapis.com/CdnKey< cdn_key ( 2&.google.cloud.video.stitcher.v1.CdnKeyBàA @@ -150,12 +151,43 @@ public static function initOnce() { \'videostitcher.googleapis.com/LiveConfig"X DeleteLiveConfigRequest= name ( B/àAúA) -\'videostitcher.googleapis.com/LiveConfig" +\'videostitcher.googleapis.com/LiveConfig"• +UpdateLiveConfigRequestD + live_config ( 2*.google.cloud.video.stitcher.v1.LiveConfigBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"Ñ +CreateVodConfigRequest> +parent ( B.àAúA(&videostitcher.googleapis.com/VodConfig + vod_config_id ( BàAB + +vod_config ( 2).google.cloud.video.stitcher.v1.VodConfigBàA + +request_id ( BàA"´ +ListVodConfigsRequest> +parent ( B.àAúA(&videostitcher.googleapis.com/VodConfig + page_size (BàA + +page_token ( BàA +filter ( BàA +order_by ( BàA"† +ListVodConfigsResponse> + vod_configs ( 2).google.cloud.video.stitcher.v1.VodConfig +next_page_token (  + unreachable ( "S +GetVodConfigRequest< +name ( B.àAúA( +&videostitcher.googleapis.com/VodConfig"V +DeleteVodConfigRequest< +name ( B.àAúA( +&videostitcher.googleapis.com/VodConfig"’ +UpdateVodConfigRequestB + +vod_config ( 2).google.cloud.video.stitcher.v1.VodConfigBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA" OperationMetadata/ create_time ( 2.google.protobuf.Timestamp, end_time ( 2.google.protobuf.Timestamp target (  -verb ( 2Ï* +verb ( 2×6 VideoStitcherService™ CreateCdnKey3.google.cloud.video.stitcher.v1.CreateCdnKeyRequest.google.longrunning.Operation"´ÊAY %google.cloud.video.stitcher.v1.CdnKey0google.cloud.video.stitcher.v1.OperationMetadataÚAparent,cdn_key,cdn_key_id‚Óä“6"+/v1/{parent=projects/*/locations/*}/cdnKeys:cdn_key´ @@ -189,7 +221,19 @@ public static function initOnce() { ListLiveConfigs6.google.cloud.video.stitcher.v1.ListLiveConfigsRequest7.google.cloud.video.stitcher.v1.ListLiveConfigsResponse"@ÚAparent‚Óä“1//v1/{parent=projects/*/locations/*}/liveConfigs± GetLiveConfig4.google.cloud.video.stitcher.v1.GetLiveConfigRequest*.google.cloud.video.stitcher.v1.LiveConfig">ÚAname‚Óä“1//v1/{name=projects/*/locations/*/liveConfigs/*}÷ DeleteLiveConfig7.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest.google.longrunning.Operation"ŠÊAI -google.protobuf.Empty0google.cloud.video.stitcher.v1.OperationMetadataÚAname‚Óä“1*//v1/{name=projects/*/locations/*/liveConfigs/*}PÊAvideostitcher.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB +google.protobuf.Empty0google.cloud.video.stitcher.v1.OperationMetadataÚAname‚Óä“1*//v1/{name=projects/*/locations/*/liveConfigs/*}· +UpdateLiveConfig7.google.cloud.video.stitcher.v1.UpdateLiveConfigRequest.google.longrunning.Operation"ÊÊA] +)google.cloud.video.stitcher.v1.LiveConfig0google.cloud.video.stitcher.v1.OperationMetadataÚAlive_config,update_mask‚Óä“J2;/v1/{live_config.name=projects/*/locations/*/liveConfigs/*}: live_config® +CreateVodConfig6.google.cloud.video.stitcher.v1.CreateVodConfigRequest.google.longrunning.Operation"ÃÊA\\ +(google.cloud.video.stitcher.v1.VodConfig0google.cloud.video.stitcher.v1.OperationMetadataÚAparent,vod_config,vod_config_id‚Óä“<"./v1/{parent=projects/*/locations/*}/vodConfigs: +vod_configÀ +ListVodConfigs5.google.cloud.video.stitcher.v1.ListVodConfigsRequest6.google.cloud.video.stitcher.v1.ListVodConfigsResponse"?ÚAparent‚Óä“0./v1/{parent=projects/*/locations/*}/vodConfigs­ + GetVodConfig3.google.cloud.video.stitcher.v1.GetVodConfigRequest).google.cloud.video.stitcher.v1.VodConfig"=ÚAname‚Óä“0./v1/{name=projects/*/locations/*/vodConfigs/*}ô +DeleteVodConfig6.google.cloud.video.stitcher.v1.DeleteVodConfigRequest.google.longrunning.Operation"‰ÊAI +google.protobuf.Empty0google.cloud.video.stitcher.v1.OperationMetadataÚAname‚Óä“0*./v1/{name=projects/*/locations/*/vodConfigs/*}° +UpdateVodConfig6.google.cloud.video.stitcher.v1.UpdateVodConfigRequest.google.longrunning.Operation"ÅÊA\\ +(google.cloud.video.stitcher.v1.VodConfig0google.cloud.video.stitcher.v1.OperationMetadataÚAvod_config,update_mask‚Óä“G29/v1/{vod_config.name=projects/*/locations/*/vodConfigs/*}: +vod_configPÊAvideostitcher.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB "com.google.cloud.video.stitcher.v1BVideoStitcherServiceProtoPZ>cloud.google.com/go/video/stitcher/apiv1/stitcherpb;stitcherpbbproto3' , true); diff --git a/VideoStitcher/metadata/V1/VodConfigs.php b/VideoStitcher/metadata/V1/VodConfigs.php new file mode 100644 index 0000000000000000000000000000000000000000..1d96ab610cfad76628b3764f3729d4f0cca4c538 GIT binary patch literal 1571 zcmb7E?@!Y}7bL1e7%tnM`Rwa&kDRInBf@5AD906dvC+MA>lpTt8(`6X{cb<>Y)+^LWkbueacK|6nDXw9 zPlXJ}a5h+5DkD@en;yr^L#|oFfz61|DQk)l>ebw3j?9;Yc5r;u&@Q+K|VP zvk))74k5!lWZqFUw*;7`C-Vl`%04mc1iMZJ57C%Vrt5Q7bCBCw&vCNOdw1QkC$o;l z>RZ0lHMn_(NZ3~=B$2V~IH_uNVYO1qQ?lL#-Ke;={vz_21Og1{$TK$j38E738J!a3L=c)(^G2 z5Yl$FBimvI@4(}P!5;z?R_-^|qAiLB$VbS^6R_Fomb->^an@-Y)n>hE)HWU{Yha~% zZj`&tv&Ke7Sp|9VNA2TARu*c;dm}33boW=8fS1v7)7{46h_wc)h%POqqMVBG`HXEI zXp`hL)m&setSourceUri($vodConfigSourceUri) + ->setAdTagUri($vodConfigAdTagUri); + $request = (new CreateVodConfigRequest()) + ->setParent($formattedParent) + ->setVodConfigId($vodConfigId) + ->setVodConfig($vodConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $videoStitcherServiceClient->createVodConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var VodConfig $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = VideoStitcherServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $vodConfigId = '[VOD_CONFIG_ID]'; + $vodConfigSourceUri = '[SOURCE_URI]'; + $vodConfigAdTagUri = '[AD_TAG_URI]'; + + create_vod_config_sample($formattedParent, $vodConfigId, $vodConfigSourceUri, $vodConfigAdTagUri); +} +// [END videostitcher_v1_generated_VideoStitcherService_CreateVodConfig_sync] diff --git a/VideoStitcher/samples/V1/VideoStitcherServiceClient/create_vod_session.php b/VideoStitcher/samples/V1/VideoStitcherServiceClient/create_vod_session.php index 8e41c0842533..8d65954a7a50 100644 --- a/VideoStitcher/samples/V1/VideoStitcherServiceClient/create_vod_session.php +++ b/VideoStitcher/samples/V1/VideoStitcherServiceClient/create_vod_session.php @@ -36,23 +36,15 @@ * @param string $formattedParent The project and location in which the VOD session should be * created, in the form of `projects/{project_number}/locations/{location}`. Please see * {@see VideoStitcherServiceClient::locationName()} for help formatting this field. - * @param string $vodSessionSourceUri URI of the media to stitch. - * @param string $vodSessionAdTagUri Ad tag URI. * @param int $vodSessionAdTracking Determines how the ad should be tracked. */ -function create_vod_session_sample( - string $formattedParent, - string $vodSessionSourceUri, - string $vodSessionAdTagUri, - int $vodSessionAdTracking -): void { +function create_vod_session_sample(string $formattedParent, int $vodSessionAdTracking): void +{ // Create a client. $videoStitcherServiceClient = new VideoStitcherServiceClient(); // Prepare the request message. $vodSession = (new VodSession()) - ->setSourceUri($vodSessionSourceUri) - ->setAdTagUri($vodSessionAdTagUri) ->setAdTracking($vodSessionAdTracking); $request = (new CreateVodSessionRequest()) ->setParent($formattedParent) @@ -80,15 +72,8 @@ function create_vod_session_sample( function callSample(): void { $formattedParent = VideoStitcherServiceClient::locationName('[PROJECT]', '[LOCATION]'); - $vodSessionSourceUri = '[SOURCE_URI]'; - $vodSessionAdTagUri = '[AD_TAG_URI]'; $vodSessionAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; - create_vod_session_sample( - $formattedParent, - $vodSessionSourceUri, - $vodSessionAdTagUri, - $vodSessionAdTracking - ); + create_vod_session_sample($formattedParent, $vodSessionAdTracking); } // [END videostitcher_v1_generated_VideoStitcherService_CreateVodSession_sync] diff --git a/VideoStitcher/samples/V1/VideoStitcherServiceClient/delete_vod_config.php b/VideoStitcher/samples/V1/VideoStitcherServiceClient/delete_vod_config.php new file mode 100644 index 000000000000..daa7531cb39d --- /dev/null +++ b/VideoStitcher/samples/V1/VideoStitcherServiceClient/delete_vod_config.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $videoStitcherServiceClient->deleteVodConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = VideoStitcherServiceClient::vodConfigName( + '[PROJECT]', + '[LOCATION]', + '[VOD_CONFIG]' + ); + + delete_vod_config_sample($formattedName); +} +// [END videostitcher_v1_generated_VideoStitcherService_DeleteVodConfig_sync] diff --git a/VideoStitcher/samples/V1/VideoStitcherServiceClient/get_vod_config.php b/VideoStitcher/samples/V1/VideoStitcherServiceClient/get_vod_config.php new file mode 100644 index 000000000000..bc0f6204365c --- /dev/null +++ b/VideoStitcher/samples/V1/VideoStitcherServiceClient/get_vod_config.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var VodConfig $response */ + $response = $videoStitcherServiceClient->getVodConfig($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 = VideoStitcherServiceClient::vodConfigName( + '[PROJECT]', + '[LOCATION]', + '[VOD_CONFIG]' + ); + + get_vod_config_sample($formattedName); +} +// [END videostitcher_v1_generated_VideoStitcherService_GetVodConfig_sync] diff --git a/VideoStitcher/samples/V1/VideoStitcherServiceClient/list_vod_configs.php b/VideoStitcher/samples/V1/VideoStitcherServiceClient/list_vod_configs.php new file mode 100644 index 000000000000..a6e5d2e7918c --- /dev/null +++ b/VideoStitcher/samples/V1/VideoStitcherServiceClient/list_vod_configs.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $videoStitcherServiceClient->listVodConfigs($request); + + /** @var VodConfig $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = VideoStitcherServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_vod_configs_sample($formattedParent); +} +// [END videostitcher_v1_generated_VideoStitcherService_ListVodConfigs_sync] diff --git a/VideoStitcher/samples/V1/VideoStitcherServiceClient/update_live_config.php b/VideoStitcher/samples/V1/VideoStitcherServiceClient/update_live_config.php new file mode 100644 index 000000000000..550ceb6ddde9 --- /dev/null +++ b/VideoStitcher/samples/V1/VideoStitcherServiceClient/update_live_config.php @@ -0,0 +1,92 @@ +setSourceUri($liveConfigSourceUri) + ->setAdTracking($liveConfigAdTracking); + $updateMask = new FieldMask(); + $request = (new UpdateLiveConfigRequest()) + ->setLiveConfig($liveConfig) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $videoStitcherServiceClient->updateLiveConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var LiveConfig $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $liveConfigSourceUri = '[SOURCE_URI]'; + $liveConfigAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; + + update_live_config_sample($liveConfigSourceUri, $liveConfigAdTracking); +} +// [END videostitcher_v1_generated_VideoStitcherService_UpdateLiveConfig_sync] diff --git a/VideoStitcher/samples/V1/VideoStitcherServiceClient/update_vod_config.php b/VideoStitcher/samples/V1/VideoStitcherServiceClient/update_vod_config.php new file mode 100644 index 000000000000..60fd6fb83de7 --- /dev/null +++ b/VideoStitcher/samples/V1/VideoStitcherServiceClient/update_vod_config.php @@ -0,0 +1,91 @@ +setSourceUri($vodConfigSourceUri) + ->setAdTagUri($vodConfigAdTagUri); + $updateMask = new FieldMask(); + $request = (new UpdateVodConfigRequest()) + ->setVodConfig($vodConfig) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $videoStitcherServiceClient->updateVodConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var VodConfig $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $vodConfigSourceUri = '[SOURCE_URI]'; + $vodConfigAdTagUri = '[AD_TAG_URI]'; + + update_vod_config_sample($vodConfigSourceUri, $vodConfigAdTagUri); +} +// [END videostitcher_v1_generated_VideoStitcherService_UpdateVodConfig_sync] diff --git a/VideoStitcher/src/V1/Client/VideoStitcherServiceClient.php b/VideoStitcher/src/V1/Client/VideoStitcherServiceClient.php index 0b16268cecc5..ef152a06a60c 100644 --- a/VideoStitcher/src/V1/Client/VideoStitcherServiceClient.php +++ b/VideoStitcher/src/V1/Client/VideoStitcherServiceClient.php @@ -40,16 +40,19 @@ use Google\Cloud\Video\Stitcher\V1\CreateLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\CreateLiveSessionRequest; use Google\Cloud\Video\Stitcher\V1\CreateSlateRequest; +use Google\Cloud\Video\Stitcher\V1\CreateVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\CreateVodSessionRequest; use Google\Cloud\Video\Stitcher\V1\DeleteCdnKeyRequest; use Google\Cloud\Video\Stitcher\V1\DeleteLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\DeleteSlateRequest; +use Google\Cloud\Video\Stitcher\V1\DeleteVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\GetCdnKeyRequest; use Google\Cloud\Video\Stitcher\V1\GetLiveAdTagDetailRequest; use Google\Cloud\Video\Stitcher\V1\GetLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\GetLiveSessionRequest; use Google\Cloud\Video\Stitcher\V1\GetSlateRequest; use Google\Cloud\Video\Stitcher\V1\GetVodAdTagDetailRequest; +use Google\Cloud\Video\Stitcher\V1\GetVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\GetVodSessionRequest; use Google\Cloud\Video\Stitcher\V1\GetVodStitchDetailRequest; use Google\Cloud\Video\Stitcher\V1\ListCdnKeysRequest; @@ -57,14 +60,18 @@ use Google\Cloud\Video\Stitcher\V1\ListLiveConfigsRequest; use Google\Cloud\Video\Stitcher\V1\ListSlatesRequest; use Google\Cloud\Video\Stitcher\V1\ListVodAdTagDetailsRequest; +use Google\Cloud\Video\Stitcher\V1\ListVodConfigsRequest; use Google\Cloud\Video\Stitcher\V1\ListVodStitchDetailsRequest; use Google\Cloud\Video\Stitcher\V1\LiveAdTagDetail; use Google\Cloud\Video\Stitcher\V1\LiveConfig; use Google\Cloud\Video\Stitcher\V1\LiveSession; use Google\Cloud\Video\Stitcher\V1\Slate; use Google\Cloud\Video\Stitcher\V1\UpdateCdnKeyRequest; +use Google\Cloud\Video\Stitcher\V1\UpdateLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\UpdateSlateRequest; +use Google\Cloud\Video\Stitcher\V1\UpdateVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\VodAdTagDetail; +use Google\Cloud\Video\Stitcher\V1\VodConfig; use Google\Cloud\Video\Stitcher\V1\VodSession; use Google\Cloud\Video\Stitcher\V1\VodStitchDetail; use Google\LongRunning\Operation; @@ -89,16 +96,19 @@ * @method PromiseInterface createLiveConfigAsync(CreateLiveConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface createLiveSessionAsync(CreateLiveSessionRequest $request, array $optionalArgs = []) * @method PromiseInterface createSlateAsync(CreateSlateRequest $request, array $optionalArgs = []) + * @method PromiseInterface createVodConfigAsync(CreateVodConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface createVodSessionAsync(CreateVodSessionRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteCdnKeyAsync(DeleteCdnKeyRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteLiveConfigAsync(DeleteLiveConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteSlateAsync(DeleteSlateRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteVodConfigAsync(DeleteVodConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface getCdnKeyAsync(GetCdnKeyRequest $request, array $optionalArgs = []) * @method PromiseInterface getLiveAdTagDetailAsync(GetLiveAdTagDetailRequest $request, array $optionalArgs = []) * @method PromiseInterface getLiveConfigAsync(GetLiveConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface getLiveSessionAsync(GetLiveSessionRequest $request, array $optionalArgs = []) * @method PromiseInterface getSlateAsync(GetSlateRequest $request, array $optionalArgs = []) * @method PromiseInterface getVodAdTagDetailAsync(GetVodAdTagDetailRequest $request, array $optionalArgs = []) + * @method PromiseInterface getVodConfigAsync(GetVodConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface getVodSessionAsync(GetVodSessionRequest $request, array $optionalArgs = []) * @method PromiseInterface getVodStitchDetailAsync(GetVodStitchDetailRequest $request, array $optionalArgs = []) * @method PromiseInterface listCdnKeysAsync(ListCdnKeysRequest $request, array $optionalArgs = []) @@ -106,9 +116,12 @@ * @method PromiseInterface listLiveConfigsAsync(ListLiveConfigsRequest $request, array $optionalArgs = []) * @method PromiseInterface listSlatesAsync(ListSlatesRequest $request, array $optionalArgs = []) * @method PromiseInterface listVodAdTagDetailsAsync(ListVodAdTagDetailsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listVodConfigsAsync(ListVodConfigsRequest $request, array $optionalArgs = []) * @method PromiseInterface listVodStitchDetailsAsync(ListVodStitchDetailsRequest $request, array $optionalArgs = []) * @method PromiseInterface updateCdnKeyAsync(UpdateCdnKeyRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateLiveConfigAsync(UpdateLiveConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface updateSlateAsync(UpdateSlateRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateVodConfigAsync(UpdateVodConfigRequest $request, array $optionalArgs = []) */ final class VideoStitcherServiceClient { @@ -324,6 +337,25 @@ public static function vodAdTagDetailName(string $project, string $location, str ]); } + /** + * Formats a string containing the fully-qualified path to represent a vod_config + * resource. + * + * @param string $project + * @param string $location + * @param string $vodConfig + * + * @return string The formatted vod_config resource. + */ + public static function vodConfigName(string $project, string $location, string $vodConfig): string + { + return self::getPathTemplate('vodConfig')->render([ + 'project' => $project, + 'location' => $location, + 'vod_config' => $vodConfig, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a vod_session * resource. @@ -375,6 +407,7 @@ public static function vodStitchDetailName(string $project, string $location, st * - location: projects/{project}/locations/{location} * - slate: projects/{project}/locations/{location}/slates/{slate} * - vodAdTagDetail: projects/{project}/locations/{location}/vodSessions/{vod_session}/vodAdTagDetails/{vod_ad_tag_detail} + * - vodConfig: projects/{project}/locations/{location}/vodConfigs/{vod_config} * - vodSession: projects/{project}/locations/{location}/vodSessions/{vod_session} * - vodStitchDetail: projects/{project}/locations/{location}/vodSessions/{vod_session}/vodStitchDetails/{vod_stitch_detail} * @@ -575,6 +608,33 @@ public function createSlate(CreateSlateRequest $request, array $callOptions = [] return $this->startApiCall('CreateSlate', $request, $callOptions)->wait(); } + /** + * Registers the VOD config with the provided unique ID in + * the specified region. + * + * The async variant is {@see VideoStitcherServiceClient::createVodConfigAsync()} . + * + * @example samples/V1/VideoStitcherServiceClient/create_vod_config.php + * + * @param CreateVodConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createVodConfig(CreateVodConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateVodConfig', $request, $callOptions)->wait(); + } + /** * Creates a client side playback VOD session and returns the full * tracking and playback metadata of the session. @@ -682,6 +742,32 @@ public function deleteSlate(DeleteSlateRequest $request, array $callOptions = [] return $this->startApiCall('DeleteSlate', $request, $callOptions)->wait(); } + /** + * Deletes the specified VOD config. + * + * The async variant is {@see VideoStitcherServiceClient::deleteVodConfigAsync()} . + * + * @example samples/V1/VideoStitcherServiceClient/delete_vod_config.php + * + * @param DeleteVodConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteVodConfig(DeleteVodConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteVodConfig', $request, $callOptions)->wait(); + } + /** * Returns the specified CDN key. * @@ -841,6 +927,33 @@ public function getVodAdTagDetail(GetVodAdTagDetailRequest $request, array $call return $this->startApiCall('GetVodAdTagDetail', $request, $callOptions)->wait(); } + /** + * Returns the specified VOD config managed by the Video + * Stitcher API service. + * + * The async variant is {@see VideoStitcherServiceClient::getVodConfigAsync()} . + * + * @example samples/V1/VideoStitcherServiceClient/get_vod_config.php + * + * @param GetVodConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return VodConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getVodConfig(GetVodConfigRequest $request, array $callOptions = []): VodConfig + { + return $this->startApiCall('GetVodConfig', $request, $callOptions)->wait(); + } + /** * Returns the full tracking, playback metadata, and relevant ad-ops * logs for the specified VOD session. @@ -1028,6 +1141,33 @@ public function listVodAdTagDetails(ListVodAdTagDetailsRequest $request, array $ return $this->startApiCall('ListVodAdTagDetails', $request, $callOptions); } + /** + * Lists all VOD configs managed by the Video Stitcher API that + * belong to the specified project and region. + * + * The async variant is {@see VideoStitcherServiceClient::listVodConfigsAsync()} . + * + * @example samples/V1/VideoStitcherServiceClient/list_vod_configs.php + * + * @param ListVodConfigsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVodConfigs(ListVodConfigsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListVodConfigs', $request, $callOptions); + } + /** * Returns a list of detailed stitching information of the specified VOD * session. @@ -1083,6 +1223,34 @@ public function updateCdnKey(UpdateCdnKeyRequest $request, array $callOptions = return $this->startApiCall('UpdateCdnKey', $request, $callOptions)->wait(); } + /** + * Updates the specified LiveConfig. Only update fields specified + * in the call method body. + * + * The async variant is {@see VideoStitcherServiceClient::updateLiveConfigAsync()} + * . + * + * @example samples/V1/VideoStitcherServiceClient/update_live_config.php + * + * @param UpdateLiveConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateLiveConfig(UpdateLiveConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateLiveConfig', $request, $callOptions)->wait(); + } + /** * Updates the specified slate. * @@ -1108,4 +1276,31 @@ public function updateSlate(UpdateSlateRequest $request, array $callOptions = [] { return $this->startApiCall('UpdateSlate', $request, $callOptions)->wait(); } + + /** + * Updates the specified VOD config. Only update fields specified + * in the call method body. + * + * The async variant is {@see VideoStitcherServiceClient::updateVodConfigAsync()} . + * + * @example samples/V1/VideoStitcherServiceClient/update_vod_config.php + * + * @param UpdateVodConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateVodConfig(UpdateVodConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateVodConfig', $request, $callOptions)->wait(); + } } diff --git a/VideoStitcher/src/V1/CreateVodConfigRequest.php b/VideoStitcher/src/V1/CreateVodConfigRequest.php new file mode 100644 index 000000000000..bd0424e4c8f6 --- /dev/null +++ b/VideoStitcher/src/V1/CreateVodConfigRequest.php @@ -0,0 +1,242 @@ +google.cloud.video.stitcher.v1.CreateVodConfigRequest + */ +class CreateVodConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project in which the VOD config should be created, in + * the form of `projects/{project_number}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. The unique identifier ID to use for the VOD config. + * + * Generated from protobuf field string vod_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $vod_config_id = ''; + /** + * Required. The VOD config resource to create. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.VodConfig vod_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $vod_config = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + + /** + * @param string $parent Required. The project in which the VOD config should be created, in + * the form of `projects/{project_number}/locations/{location}`. Please see + * {@see VideoStitcherServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Video\Stitcher\V1\VodConfig $vodConfig Required. The VOD config resource to create. + * @param string $vodConfigId Required. The unique identifier ID to use for the VOD config. + * + * @return \Google\Cloud\Video\Stitcher\V1\CreateVodConfigRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Video\Stitcher\V1\VodConfig $vodConfig, string $vodConfigId): self + { + return (new self()) + ->setParent($parent) + ->setVodConfig($vodConfig) + ->setVodConfigId($vodConfigId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project in which the VOD config should be created, in + * the form of `projects/{project_number}/locations/{location}`. + * @type string $vod_config_id + * Required. The unique identifier ID to use for the VOD config. + * @type \Google\Cloud\Video\Stitcher\V1\VodConfig $vod_config + * Required. The VOD config resource to create. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VideoStitcherService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project in which the VOD config should be created, in + * the form of `projects/{project_number}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project in which the VOD config should be created, in + * the form of `projects/{project_number}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The unique identifier ID to use for the VOD config. + * + * Generated from protobuf field string vod_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVodConfigId() + { + return $this->vod_config_id; + } + + /** + * Required. The unique identifier ID to use for the VOD config. + * + * Generated from protobuf field string vod_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVodConfigId($var) + { + GPBUtil::checkString($var, True); + $this->vod_config_id = $var; + + return $this; + } + + /** + * Required. The VOD config resource to create. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.VodConfig vod_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Video\Stitcher\V1\VodConfig|null + */ + public function getVodConfig() + { + return $this->vod_config; + } + + public function hasVodConfig() + { + return isset($this->vod_config); + } + + public function clearVodConfig() + { + unset($this->vod_config); + } + + /** + * Required. The VOD config resource to create. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.VodConfig vod_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Video\Stitcher\V1\VodConfig $var + * @return $this + */ + public function setVodConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\Stitcher\V1\VodConfig::class); + $this->vod_config = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/VideoStitcher/src/V1/DeleteVodConfigRequest.php b/VideoStitcher/src/V1/DeleteVodConfigRequest.php new file mode 100644 index 000000000000..5e1a43c87621 --- /dev/null +++ b/VideoStitcher/src/V1/DeleteVodConfigRequest.php @@ -0,0 +1,86 @@ +google.cloud.video.stitcher.v1.DeleteVodConfigRequest + */ +class DeleteVodConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the VOD config to be deleted, in the form of + * `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. The name of the VOD config to be deleted, in the form of + * `projects/{project_number}/locations/{location}/vodConfigs/{id}`. Please see + * {@see VideoStitcherServiceClient::vodConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Video\Stitcher\V1\DeleteVodConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the VOD config to be deleted, in the form of + * `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VideoStitcherService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the VOD config to be deleted, in the form of + * `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the VOD config to be deleted, in the form of + * `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/VideoStitcher/src/V1/FetchOptions.php b/VideoStitcher/src/V1/FetchOptions.php new file mode 100644 index 000000000000..a74531fbba30 --- /dev/null +++ b/VideoStitcher/src/V1/FetchOptions.php @@ -0,0 +1,79 @@ +google.cloud.video.stitcher.v1.FetchOptions + */ +class FetchOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Custom headers to pass into fetch request. + * Headers must have a maximum of 3 key value pairs. + * Each key value pair must have a maximum of 256 characters per key and 256 + * characters per value. + * + * Generated from protobuf field map headers = 1; + */ + private $headers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $headers + * Custom headers to pass into fetch request. + * Headers must have a maximum of 3 key value pairs. + * Each key value pair must have a maximum of 256 characters per key and 256 + * characters per value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\FetchOptions::initOnce(); + parent::__construct($data); + } + + /** + * Custom headers to pass into fetch request. + * Headers must have a maximum of 3 key value pairs. + * Each key value pair must have a maximum of 256 characters per key and 256 + * characters per value. + * + * Generated from protobuf field map headers = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Custom headers to pass into fetch request. + * Headers must have a maximum of 3 key value pairs. + * Each key value pair must have a maximum of 256 characters per key and 256 + * characters per value. + * + * Generated from protobuf field map headers = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + +} + diff --git a/VideoStitcher/src/V1/GamVodConfig.php b/VideoStitcher/src/V1/GamVodConfig.php index c08a53f96ae0..f8eda8cdd397 100644 --- a/VideoStitcher/src/V1/GamVodConfig.php +++ b/VideoStitcher/src/V1/GamVodConfig.php @@ -1,6 +1,6 @@ google.cloud.video.stitcher.v1.GamVodConfig */ class GamVodConfig extends \Google\Protobuf\Internal\Message { /** - * Required. Ad Manager network code. + * Required. Ad Manager network code to associate with the VOD config. * * Generated from protobuf field string network_code = 1 [(.google.api.field_behavior) = REQUIRED]; */ private $network_code = ''; - /** - * Required. The stream ID generated by Ad Manager. - * - * Generated from protobuf field string stream_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $stream_id = ''; /** * Constructor. @@ -35,18 +29,16 @@ class GamVodConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $network_code - * Required. Ad Manager network code. - * @type string $stream_id - * Required. The stream ID generated by Ad Manager. + * Required. Ad Manager network code to associate with the VOD config. * } */ public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Stitcher\V1\Sessions::initOnce(); + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VodConfigs::initOnce(); parent::__construct($data); } /** - * Required. Ad Manager network code. + * Required. Ad Manager network code to associate with the VOD config. * * Generated from protobuf field string network_code = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -57,7 +49,7 @@ public function getNetworkCode() } /** - * Required. Ad Manager network code. + * Required. Ad Manager network code to associate with the VOD config. * * Generated from protobuf field string network_code = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -71,31 +63,5 @@ public function setNetworkCode($var) return $this; } - /** - * Required. The stream ID generated by Ad Manager. - * - * Generated from protobuf field string stream_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getStreamId() - { - return $this->stream_id; - } - - /** - * Required. The stream ID generated by Ad Manager. - * - * Generated from protobuf field string stream_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setStreamId($var) - { - GPBUtil::checkString($var, True); - $this->stream_id = $var; - - return $this; - } - } diff --git a/VideoStitcher/src/V1/Gapic/VideoStitcherServiceGapicClient.php b/VideoStitcher/src/V1/Gapic/VideoStitcherServiceGapicClient.php index 34f23ac18768..2a3f1efb28e5 100644 --- a/VideoStitcher/src/V1/Gapic/VideoStitcherServiceGapicClient.php +++ b/VideoStitcher/src/V1/Gapic/VideoStitcherServiceGapicClient.php @@ -40,16 +40,19 @@ use Google\Cloud\Video\Stitcher\V1\CreateLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\CreateLiveSessionRequest; use Google\Cloud\Video\Stitcher\V1\CreateSlateRequest; +use Google\Cloud\Video\Stitcher\V1\CreateVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\CreateVodSessionRequest; use Google\Cloud\Video\Stitcher\V1\DeleteCdnKeyRequest; use Google\Cloud\Video\Stitcher\V1\DeleteLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\DeleteSlateRequest; +use Google\Cloud\Video\Stitcher\V1\DeleteVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\GetCdnKeyRequest; use Google\Cloud\Video\Stitcher\V1\GetLiveAdTagDetailRequest; use Google\Cloud\Video\Stitcher\V1\GetLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\GetLiveSessionRequest; use Google\Cloud\Video\Stitcher\V1\GetSlateRequest; use Google\Cloud\Video\Stitcher\V1\GetVodAdTagDetailRequest; +use Google\Cloud\Video\Stitcher\V1\GetVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\GetVodSessionRequest; use Google\Cloud\Video\Stitcher\V1\GetVodStitchDetailRequest; use Google\Cloud\Video\Stitcher\V1\ListCdnKeysRequest; @@ -62,6 +65,8 @@ use Google\Cloud\Video\Stitcher\V1\ListSlatesResponse; use Google\Cloud\Video\Stitcher\V1\ListVodAdTagDetailsRequest; use Google\Cloud\Video\Stitcher\V1\ListVodAdTagDetailsResponse; +use Google\Cloud\Video\Stitcher\V1\ListVodConfigsRequest; +use Google\Cloud\Video\Stitcher\V1\ListVodConfigsResponse; use Google\Cloud\Video\Stitcher\V1\ListVodStitchDetailsRequest; use Google\Cloud\Video\Stitcher\V1\ListVodStitchDetailsResponse; use Google\Cloud\Video\Stitcher\V1\LiveAdTagDetail; @@ -69,8 +74,11 @@ use Google\Cloud\Video\Stitcher\V1\LiveSession; use Google\Cloud\Video\Stitcher\V1\Slate; use Google\Cloud\Video\Stitcher\V1\UpdateCdnKeyRequest; +use Google\Cloud\Video\Stitcher\V1\UpdateLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\UpdateSlateRequest; +use Google\Cloud\Video\Stitcher\V1\UpdateVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\VodAdTagDetail; +use Google\Cloud\Video\Stitcher\V1\VodConfig; use Google\Cloud\Video\Stitcher\V1\VodSession; use Google\Cloud\Video\Stitcher\V1\VodStitchDetail; use Google\LongRunning\Operation; @@ -172,6 +180,8 @@ class VideoStitcherServiceGapicClient private static $vodAdTagDetailNameTemplate; + private static $vodConfigNameTemplate; + private static $vodSessionNameTemplate; private static $vodStitchDetailNameTemplate; @@ -285,6 +295,17 @@ private static function getVodAdTagDetailNameTemplate() return self::$vodAdTagDetailNameTemplate; } + private static function getVodConfigNameTemplate() + { + if (self::$vodConfigNameTemplate == null) { + self::$vodConfigNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/vodConfigs/{vod_config}' + ); + } + + return self::$vodConfigNameTemplate; + } + private static function getVodSessionNameTemplate() { if (self::$vodSessionNameTemplate == null) { @@ -318,6 +339,7 @@ private static function getPathTemplateMap() 'location' => self::getLocationNameTemplate(), 'slate' => self::getSlateNameTemplate(), 'vodAdTagDetail' => self::getVodAdTagDetailNameTemplate(), + 'vodConfig' => self::getVodConfigNameTemplate(), 'vodSession' => self::getVodSessionNameTemplate(), 'vodStitchDetail' => self::getVodStitchDetailNameTemplate(), ]; @@ -469,6 +491,25 @@ public static function vodAdTagDetailName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a vod_config + * resource. + * + * @param string $project + * @param string $location + * @param string $vodConfig + * + * @return string The formatted vod_config resource. + */ + public static function vodConfigName($project, $location, $vodConfig) + { + return self::getVodConfigNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'vod_config' => $vodConfig, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a vod_session * resource. @@ -524,6 +565,7 @@ public static function vodStitchDetailName( * - location: projects/{project}/locations/{location} * - slate: projects/{project}/locations/{location}/slates/{slate} * - vodAdTagDetail: projects/{project}/locations/{location}/vodSessions/{vod_session}/vodAdTagDetails/{vod_ad_tag_detail} + * - vodConfig: projects/{project}/locations/{location}/vodConfigs/{vod_config} * - vodSession: projects/{project}/locations/{location}/vodSessions/{vod_session} * - vodStitchDetail: projects/{project}/locations/{location}/vodSessions/{vod_session}/vodStitchDetails/{vod_stitch_detail} * @@ -1014,6 +1056,109 @@ public function createSlate( )->wait(); } + /** + * Registers the VOD config with the provided unique ID in + * the specified region. + * + * Sample code: + * ``` + * $videoStitcherServiceClient = new VideoStitcherServiceClient(); + * try { + * $formattedParent = $videoStitcherServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $vodConfigId = 'vod_config_id'; + * $vodConfig = new VodConfig(); + * $operationResponse = $videoStitcherServiceClient->createVodConfig($formattedParent, $vodConfigId, $vodConfig); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $videoStitcherServiceClient->createVodConfig($formattedParent, $vodConfigId, $vodConfig); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $videoStitcherServiceClient->resumeOperation($operationName, 'createVodConfig'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $videoStitcherServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The project in which the VOD config should be created, in + * the form of `projects/{project_number}/locations/{location}`. + * @param string $vodConfigId Required. The unique identifier ID to use for the VOD config. + * @param VodConfig $vodConfig Required. The VOD config resource to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createVodConfig( + $parent, + $vodConfigId, + $vodConfig, + array $optionalArgs = [] + ) { + $request = new CreateVodConfigRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setVodConfigId($vodConfigId); + $request->setVodConfig($vodConfig); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'CreateVodConfig', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + /** * Creates a client side playback VOD session and returns the full * tracking and playback metadata of the session. @@ -1286,6 +1431,78 @@ public function deleteSlate($name, array $optionalArgs = []) )->wait(); } + /** + * Deletes the specified VOD config. + * + * Sample code: + * ``` + * $videoStitcherServiceClient = new VideoStitcherServiceClient(); + * try { + * $formattedName = $videoStitcherServiceClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); + * $operationResponse = $videoStitcherServiceClient->deleteVodConfig($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $videoStitcherServiceClient->deleteVodConfig($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $videoStitcherServiceClient->resumeOperation($operationName, 'deleteVodConfig'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $videoStitcherServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the VOD config to be deleted, in the form of + * `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteVodConfig($name, array $optionalArgs = []) + { + $request = new DeleteVodConfigRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'DeleteVodConfig', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + /** * Returns the specified CDN key. * @@ -1583,6 +1800,56 @@ public function getVodAdTagDetail($name, array $optionalArgs = []) )->wait(); } + /** + * Returns the specified VOD config managed by the Video + * Stitcher API service. + * + * Sample code: + * ``` + * $videoStitcherServiceClient = new VideoStitcherServiceClient(); + * try { + * $formattedName = $videoStitcherServiceClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); + * $response = $videoStitcherServiceClient->getVodConfig($formattedName); + * } finally { + * $videoStitcherServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the VOD config to be retrieved, in the form + * of `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Video\Stitcher\V1\VodConfig + * + * @throws ApiException if the remote call fails + */ + public function getVodConfig($name, array $optionalArgs = []) + { + $request = new GetVodConfigRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetVodConfig', + VodConfig::class, + $optionalArgs, + $request + )->wait(); + } + /** * Returns the full tracking, playback metadata, and relevant ad-ops * logs for the specified VOD session. @@ -2113,6 +2380,100 @@ public function listVodAdTagDetails($parent, array $optionalArgs = []) ); } + /** + * Lists all VOD configs managed by the Video Stitcher API that + * belong to the specified project and region. + * + * Sample code: + * ``` + * $videoStitcherServiceClient = new VideoStitcherServiceClient(); + * try { + * $formattedParent = $videoStitcherServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $videoStitcherServiceClient->listVodConfigs($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $videoStitcherServiceClient->listVodConfigs($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $videoStitcherServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The project that contains the list of VOD configs, in the + * form of `projects/{project_number}/locations/{location}`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. The filter to apply to list results (see + * [Filtering](https://google.aip.dev/160)). + * @type string $orderBy + * Optional. Specifies the ordering of results following + * [Cloud API + * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listVodConfigs($parent, array $optionalArgs = []) + { + $request = new ListVodConfigsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListVodConfigs', + $optionalArgs, + ListVodConfigsResponse::class, + $request + ); + } + /** * Returns a list of detailed stitching information of the specified VOD * session. @@ -2271,6 +2632,89 @@ public function updateCdnKey($cdnKey, $updateMask, array $optionalArgs = []) )->wait(); } + /** + * Updates the specified LiveConfig. Only update fields specified + * in the call method body. + * + * Sample code: + * ``` + * $videoStitcherServiceClient = new VideoStitcherServiceClient(); + * try { + * $liveConfig = new LiveConfig(); + * $updateMask = new FieldMask(); + * $operationResponse = $videoStitcherServiceClient->updateLiveConfig($liveConfig, $updateMask); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $videoStitcherServiceClient->updateLiveConfig($liveConfig, $updateMask); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $videoStitcherServiceClient->resumeOperation($operationName, 'updateLiveConfig'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $videoStitcherServiceClient->close(); + * } + * ``` + * + * @param LiveConfig $liveConfig Required. The LiveConfig resource which replaces the resource on the + * server. + * @param FieldMask $updateMask Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateLiveConfig( + $liveConfig, + $updateMask, + array $optionalArgs = [] + ) { + $request = new UpdateLiveConfigRequest(); + $requestParamHeaders = []; + $request->setLiveConfig($liveConfig); + $request->setUpdateMask($updateMask); + $requestParamHeaders['live_config.name'] = $liveConfig->getName(); + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'UpdateLiveConfig', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + /** * Updates the specified slate. * @@ -2346,4 +2790,87 @@ public function updateSlate($slate, $updateMask, array $optionalArgs = []) $this->getOperationsClient() )->wait(); } + + /** + * Updates the specified VOD config. Only update fields specified + * in the call method body. + * + * Sample code: + * ``` + * $videoStitcherServiceClient = new VideoStitcherServiceClient(); + * try { + * $vodConfig = new VodConfig(); + * $updateMask = new FieldMask(); + * $operationResponse = $videoStitcherServiceClient->updateVodConfig($vodConfig, $updateMask); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $videoStitcherServiceClient->updateVodConfig($vodConfig, $updateMask); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $videoStitcherServiceClient->resumeOperation($operationName, 'updateVodConfig'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $videoStitcherServiceClient->close(); + * } + * ``` + * + * @param VodConfig $vodConfig Required. The VOD config resource which replaces the resource on the + * server. + * @param FieldMask $updateMask Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateVodConfig( + $vodConfig, + $updateMask, + array $optionalArgs = [] + ) { + $request = new UpdateVodConfigRequest(); + $requestParamHeaders = []; + $request->setVodConfig($vodConfig); + $request->setUpdateMask($updateMask); + $requestParamHeaders['vod_config.name'] = $vodConfig->getName(); + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'UpdateVodConfig', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } } diff --git a/VideoStitcher/src/V1/GetVodConfigRequest.php b/VideoStitcher/src/V1/GetVodConfigRequest.php new file mode 100644 index 000000000000..e3bed866ffd4 --- /dev/null +++ b/VideoStitcher/src/V1/GetVodConfigRequest.php @@ -0,0 +1,86 @@ +google.cloud.video.stitcher.v1.GetVodConfigRequest + */ +class GetVodConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the VOD config to be retrieved, in the form + * of `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. The name of the VOD config to be retrieved, in the form + * of `projects/{project_number}/locations/{location}/vodConfigs/{id}`. Please see + * {@see VideoStitcherServiceClient::vodConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Video\Stitcher\V1\GetVodConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the VOD config to be retrieved, in the form + * of `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VideoStitcherService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the VOD config to be retrieved, in the form + * of `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the VOD config to be retrieved, in the form + * of `projects/{project_number}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/VideoStitcher/src/V1/ListVodConfigsRequest.php b/VideoStitcher/src/V1/ListVodConfigsRequest.php new file mode 100644 index 000000000000..ed3e6be0f314 --- /dev/null +++ b/VideoStitcher/src/V1/ListVodConfigsRequest.php @@ -0,0 +1,238 @@ +google.cloud.video.stitcher.v1.ListVodConfigsRequest + */ +class ListVodConfigsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that contains the list of VOD configs, in the + * form of `projects/{project_number}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_token = ''; + /** + * Optional. The filter to apply to list results (see + * [Filtering](https://google.aip.dev/160)). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter = ''; + /** + * Optional. Specifies the ordering of results following + * [Cloud API + * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $order_by = ''; + + /** + * @param string $parent Required. The project that contains the list of VOD configs, in the + * form of `projects/{project_number}/locations/{location}`. Please see + * {@see VideoStitcherServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Video\Stitcher\V1\ListVodConfigsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that contains the list of VOD configs, in the + * form of `projects/{project_number}/locations/{location}`. + * @type int $page_size + * Optional. The maximum number of items to return. + * @type string $page_token + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @type string $filter + * Optional. The filter to apply to list results (see + * [Filtering](https://google.aip.dev/160)). + * @type string $order_by + * Optional. Specifies the ordering of results following + * [Cloud API + * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VideoStitcherService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that contains the list of VOD configs, in the + * form of `projects/{project_number}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that contains the list of VOD configs, in the + * form of `projects/{project_number}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter to apply to list results (see + * [Filtering](https://google.aip.dev/160)). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter to apply to list results (see + * [Filtering](https://google.aip.dev/160)). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Specifies the ordering of results following + * [Cloud API + * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Specifies the ordering of results following + * [Cloud API + * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/VideoStitcher/src/V1/ListVodConfigsResponse.php b/VideoStitcher/src/V1/ListVodConfigsResponse.php new file mode 100644 index 000000000000..b6c364323967 --- /dev/null +++ b/VideoStitcher/src/V1/ListVodConfigsResponse.php @@ -0,0 +1,135 @@ +google.cloud.video.stitcher.v1.ListVodConfigsResponse + */ +class ListVodConfigsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of VOD configs. + * + * Generated from protobuf field repeated .google.cloud.video.stitcher.v1.VodConfig vod_configs = 1; + */ + private $vod_configs; + /** + * The pagination token. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Video\Stitcher\V1\VodConfig>|\Google\Protobuf\Internal\RepeatedField $vod_configs + * List of VOD configs. + * @type string $next_page_token + * The pagination token. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VideoStitcherService::initOnce(); + parent::__construct($data); + } + + /** + * List of VOD configs. + * + * Generated from protobuf field repeated .google.cloud.video.stitcher.v1.VodConfig vod_configs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVodConfigs() + { + return $this->vod_configs; + } + + /** + * List of VOD configs. + * + * Generated from protobuf field repeated .google.cloud.video.stitcher.v1.VodConfig vod_configs = 1; + * @param array<\Google\Cloud\Video\Stitcher\V1\VodConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVodConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Stitcher\V1\VodConfig::class); + $this->vod_configs = $arr; + + return $this; + } + + /** + * The pagination token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The pagination token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/VideoStitcher/src/V1/LiveAdTagDetail.php b/VideoStitcher/src/V1/LiveAdTagDetail.php index 420065f4088f..6a3f5b360ead 100644 --- a/VideoStitcher/src/V1/LiveAdTagDetail.php +++ b/VideoStitcher/src/V1/LiveAdTagDetail.php @@ -9,7 +9,9 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Container for a live session's ad tag detail. + * Information related to the details for one ad tag. This resource is only + * available for live sessions that do not implement Google Ad Manager ad + * insertion. * * Generated from protobuf message google.cloud.video.stitcher.v1.LiveAdTagDetail */ diff --git a/VideoStitcher/src/V1/LiveConfig.php b/VideoStitcher/src/V1/LiveConfig.php index f6844a94adb1..8ece7cabf2ef 100644 --- a/VideoStitcher/src/V1/LiveConfig.php +++ b/VideoStitcher/src/V1/LiveConfig.php @@ -48,9 +48,7 @@ class LiveConfig extends \Google\Protobuf\Internal\Message */ private $state = 0; /** - * Required. Determines how the ads are tracked. If - * [gam_live_config][google.cloud.video.stitcher.v1.LiveConfig.gam_live_config] - * is set, the value must be `CLIENT` because the IMA SDK handles ad tracking. + * Required. Determines how the ads are tracked. * * Generated from protobuf field .google.cloud.video.stitcher.v1.AdTracking ad_tracking = 6 [(.google.api.field_behavior) = REQUIRED]; */ @@ -77,6 +75,12 @@ class LiveConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.video.stitcher.v1.PrefetchConfig prefetch_config = 10; */ private $prefetch_config = null; + /** + * Options for fetching source manifests and segments. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.FetchOptions source_fetch_options = 16; + */ + private $source_fetch_options = null; /** * Constructor. @@ -97,9 +101,7 @@ class LiveConfig extends \Google\Protobuf\Internal\Message * @type int $state * Output only. State of the live config. * @type int $ad_tracking - * Required. Determines how the ads are tracked. If - * [gam_live_config][google.cloud.video.stitcher.v1.LiveConfig.gam_live_config] - * is set, the value must be `CLIENT` because the IMA SDK handles ad tracking. + * Required. Determines how the ads are tracked. * @type string $default_slate * This must refer to a slate in the same * project. If Google Ad Manager (GAM) is used for ads, this string sets the @@ -110,6 +112,8 @@ class LiveConfig extends \Google\Protobuf\Internal\Message * the ad break boundaries. If not specified, the default is `CUT_CURRENT`. * @type \Google\Cloud\Video\Stitcher\V1\PrefetchConfig $prefetch_config * The configuration for prefetching ads. + * @type \Google\Cloud\Video\Stitcher\V1\FetchOptions $source_fetch_options + * Options for fetching source manifests and segments. * } */ public function __construct($data = NULL) { @@ -262,9 +266,7 @@ public function setState($var) } /** - * Required. Determines how the ads are tracked. If - * [gam_live_config][google.cloud.video.stitcher.v1.LiveConfig.gam_live_config] - * is set, the value must be `CLIENT` because the IMA SDK handles ad tracking. + * Required. Determines how the ads are tracked. * * Generated from protobuf field .google.cloud.video.stitcher.v1.AdTracking ad_tracking = 6 [(.google.api.field_behavior) = REQUIRED]; * @return int @@ -275,9 +277,7 @@ public function getAdTracking() } /** - * Required. Determines how the ads are tracked. If - * [gam_live_config][google.cloud.video.stitcher.v1.LiveConfig.gam_live_config] - * is set, the value must be `CLIENT` because the IMA SDK handles ad tracking. + * Required. Determines how the ads are tracked. * * Generated from protobuf field .google.cloud.video.stitcher.v1.AdTracking ad_tracking = 6 [(.google.api.field_behavior) = REQUIRED]; * @param int $var @@ -387,5 +387,41 @@ public function setPrefetchConfig($var) return $this; } + /** + * Options for fetching source manifests and segments. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.FetchOptions source_fetch_options = 16; + * @return \Google\Cloud\Video\Stitcher\V1\FetchOptions|null + */ + public function getSourceFetchOptions() + { + return $this->source_fetch_options; + } + + public function hasSourceFetchOptions() + { + return isset($this->source_fetch_options); + } + + public function clearSourceFetchOptions() + { + unset($this->source_fetch_options); + } + + /** + * Options for fetching source manifests and segments. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.FetchOptions source_fetch_options = 16; + * @param \Google\Cloud\Video\Stitcher\V1\FetchOptions $var + * @return $this + */ + public function setSourceFetchOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\Stitcher\V1\FetchOptions::class); + $this->source_fetch_options = $var; + + return $this; + } + } diff --git a/VideoStitcher/src/V1/LiveSession.php b/VideoStitcher/src/V1/LiveSession.php index a3a07878351e..e83def9fcfc6 100644 --- a/VideoStitcher/src/V1/LiveSession.php +++ b/VideoStitcher/src/V1/LiveSession.php @@ -30,11 +30,11 @@ class LiveSession extends \Google\Protobuf\Internal\Message */ private $play_uri = ''; /** - * Key value pairs for ad tag macro replacement. If the - * specified ad tag URI has macros, this field provides the mapping - * to the value that will replace the macro in the ad tag URI. - * Macros are designated by square brackets. - * For example: + * Key value pairs for ad tag macro replacement, only available for live + * sessions that do not implement Google Ad manager ad insertion. If the + * specified ad tag URI has macros, this field provides the mapping to the + * value that will replace the macro in the ad tag URI. + * Macros are designated by square brackets, for example: * Ad tag URI: "https://doubleclick.google.com/ad/1?geo_id=[geoId]" * Ad tag macros: `{"geoId": "123"}` * Fully qualified ad tag: @@ -63,6 +63,13 @@ class LiveSession extends \Google\Protobuf\Internal\Message * Generated from protobuf field string live_config = 16 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ private $live_config = ''; + /** + * Determines how the ad should be tracked. This overrides the value set in + * the live config for this session. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.AdTracking ad_tracking = 17; + */ + private $ad_tracking = 0; /** * Constructor. @@ -76,11 +83,11 @@ class LiveSession extends \Google\Protobuf\Internal\Message * @type string $play_uri * Output only. The URI to play the live session's ad-stitched stream. * @type array|\Google\Protobuf\Internal\MapField $ad_tag_macros - * Key value pairs for ad tag macro replacement. If the - * specified ad tag URI has macros, this field provides the mapping - * to the value that will replace the macro in the ad tag URI. - * Macros are designated by square brackets. - * For example: + * Key value pairs for ad tag macro replacement, only available for live + * sessions that do not implement Google Ad manager ad insertion. If the + * specified ad tag URI has macros, this field provides the mapping to the + * value that will replace the macro in the ad tag URI. + * Macros are designated by square brackets, for example: * Ad tag URI: "https://doubleclick.google.com/ad/1?geo_id=[geoId]" * Ad tag macros: `{"geoId": "123"}` * Fully qualified ad tag: @@ -93,6 +100,9 @@ class LiveSession extends \Google\Protobuf\Internal\Message * @type string $live_config * Required. The resource name of the live config for this session, in the * form of `projects/{project}/locations/{location}/liveConfigs/{id}`. + * @type int $ad_tracking + * Determines how the ad should be tracked. This overrides the value set in + * the live config for this session. * } */ public function __construct($data = NULL) { @@ -155,11 +165,11 @@ public function setPlayUri($var) } /** - * Key value pairs for ad tag macro replacement. If the - * specified ad tag URI has macros, this field provides the mapping - * to the value that will replace the macro in the ad tag URI. - * Macros are designated by square brackets. - * For example: + * Key value pairs for ad tag macro replacement, only available for live + * sessions that do not implement Google Ad manager ad insertion. If the + * specified ad tag URI has macros, this field provides the mapping to the + * value that will replace the macro in the ad tag URI. + * Macros are designated by square brackets, for example: * Ad tag URI: "https://doubleclick.google.com/ad/1?geo_id=[geoId]" * Ad tag macros: `{"geoId": "123"}` * Fully qualified ad tag: @@ -174,11 +184,11 @@ public function getAdTagMacros() } /** - * Key value pairs for ad tag macro replacement. If the - * specified ad tag URI has macros, this field provides the mapping - * to the value that will replace the macro in the ad tag URI. - * Macros are designated by square brackets. - * For example: + * Key value pairs for ad tag macro replacement, only available for live + * sessions that do not implement Google Ad manager ad insertion. If the + * specified ad tag URI has macros, this field provides the mapping to the + * value that will replace the macro in the ad tag URI. + * Macros are designated by square brackets, for example: * Ad tag URI: "https://doubleclick.google.com/ad/1?geo_id=[geoId]" * Ad tag macros: `{"geoId": "123"}` * Fully qualified ad tag: @@ -298,5 +308,33 @@ public function setLiveConfig($var) return $this; } + /** + * Determines how the ad should be tracked. This overrides the value set in + * the live config for this session. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.AdTracking ad_tracking = 17; + * @return int + */ + public function getAdTracking() + { + return $this->ad_tracking; + } + + /** + * Determines how the ad should be tracked. This overrides the value set in + * the live config for this session. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.AdTracking ad_tracking = 17; + * @param int $var + * @return $this + */ + public function setAdTracking($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Video\Stitcher\V1\AdTracking::class); + $this->ad_tracking = $var; + + return $this; + } + } diff --git a/VideoStitcher/src/V1/LiveSession/GamSettings.php b/VideoStitcher/src/V1/LiveSession/GamSettings.php index a77afb149c77..6b5eb6fd5af0 100644 --- a/VideoStitcher/src/V1/LiveSession/GamSettings.php +++ b/VideoStitcher/src/V1/LiveSession/GamSettings.php @@ -9,19 +9,28 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Defines fields related to Google Ad Manager (GAM). This should be set if - * GAM is being used for ads. + * Defines fields related to Google Ad Manager (GAM). * * Generated from protobuf message google.cloud.video.stitcher.v1.LiveSession.GamSettings */ class GamSettings extends \Google\Protobuf\Internal\Message { /** - * Required. The stream ID generated by Ad Manager. + * Required. The stream ID generated by Ad Manager. This must be set if GAM + * is being used for ads and the session uses client-side ad tracking. * * Generated from protobuf field string stream_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ private $stream_id = ''; + /** + * [Targeting + * parameters](https://support.google.com/admanager/answer/7320899) to send + * to Ad Manager to generate a stream ID. This should only be set if the + * session uses server-side ad tracking. + * + * Generated from protobuf field map targeting_parameters = 4; + */ + private $targeting_parameters; /** * Constructor. @@ -30,7 +39,13 @@ class GamSettings extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $stream_id - * Required. The stream ID generated by Ad Manager. + * Required. The stream ID generated by Ad Manager. This must be set if GAM + * is being used for ads and the session uses client-side ad tracking. + * @type array|\Google\Protobuf\Internal\MapField $targeting_parameters + * [Targeting + * parameters](https://support.google.com/admanager/answer/7320899) to send + * to Ad Manager to generate a stream ID. This should only be set if the + * session uses server-side ad tracking. * } */ public function __construct($data = NULL) { @@ -39,7 +54,8 @@ public function __construct($data = NULL) { } /** - * Required. The stream ID generated by Ad Manager. + * Required. The stream ID generated by Ad Manager. This must be set if GAM + * is being used for ads and the session uses client-side ad tracking. * * Generated from protobuf field string stream_id = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -50,7 +66,8 @@ public function getStreamId() } /** - * Required. The stream ID generated by Ad Manager. + * Required. The stream ID generated by Ad Manager. This must be set if GAM + * is being used for ads and the session uses client-side ad tracking. * * Generated from protobuf field string stream_id = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -64,6 +81,38 @@ public function setStreamId($var) return $this; } + /** + * [Targeting + * parameters](https://support.google.com/admanager/answer/7320899) to send + * to Ad Manager to generate a stream ID. This should only be set if the + * session uses server-side ad tracking. + * + * Generated from protobuf field map targeting_parameters = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTargetingParameters() + { + return $this->targeting_parameters; + } + + /** + * [Targeting + * parameters](https://support.google.com/admanager/answer/7320899) to send + * to Ad Manager to generate a stream ID. This should only be set if the + * session uses server-side ad tracking. + * + * Generated from protobuf field map targeting_parameters = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTargetingParameters($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->targeting_parameters = $arr; + + return $this; + } + } diff --git a/VideoStitcher/src/V1/MediaCdnKey.php b/VideoStitcher/src/V1/MediaCdnKey.php index 667ff6131794..d2d386fb23aa 100644 --- a/VideoStitcher/src/V1/MediaCdnKey.php +++ b/VideoStitcher/src/V1/MediaCdnKey.php @@ -27,6 +27,13 @@ class MediaCdnKey extends \Google\Protobuf\Internal\Message * Generated from protobuf field string key_name = 2; */ private $key_name = ''; + /** + * Optional. If set, the URL will be signed using the Media CDN token. + * Otherwise, the URL would be signed using the standard Media CDN signature. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.MediaCdnKey.TokenConfig token_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $token_config = null; /** * Constructor. @@ -38,6 +45,9 @@ class MediaCdnKey extends \Google\Protobuf\Internal\Message * Input only. 64-byte ed25519 private key for this Media CDN key. * @type string $key_name * The keyset name of the Media CDN key. + * @type \Google\Cloud\Video\Stitcher\V1\MediaCdnKey\TokenConfig $token_config + * Optional. If set, the URL will be signed using the Media CDN token. + * Otherwise, the URL would be signed using the standard Media CDN signature. * } */ public function __construct($data = NULL) { @@ -97,5 +107,43 @@ public function setKeyName($var) return $this; } + /** + * Optional. If set, the URL will be signed using the Media CDN token. + * Otherwise, the URL would be signed using the standard Media CDN signature. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.MediaCdnKey.TokenConfig token_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Video\Stitcher\V1\MediaCdnKey\TokenConfig|null + */ + public function getTokenConfig() + { + return $this->token_config; + } + + public function hasTokenConfig() + { + return isset($this->token_config); + } + + public function clearTokenConfig() + { + unset($this->token_config); + } + + /** + * Optional. If set, the URL will be signed using the Media CDN token. + * Otherwise, the URL would be signed using the standard Media CDN signature. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.MediaCdnKey.TokenConfig token_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Video\Stitcher\V1\MediaCdnKey\TokenConfig $var + * @return $this + */ + public function setTokenConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\Stitcher\V1\MediaCdnKey\TokenConfig::class); + $this->token_config = $var; + + return $this; + } + } diff --git a/VideoStitcher/src/V1/MediaCdnKey/TokenConfig.php b/VideoStitcher/src/V1/MediaCdnKey/TokenConfig.php new file mode 100644 index 000000000000..df552d0ab8d2 --- /dev/null +++ b/VideoStitcher/src/V1/MediaCdnKey/TokenConfig.php @@ -0,0 +1,88 @@ +google.cloud.video.stitcher.v1.MediaCdnKey.TokenConfig + */ +class TokenConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The query parameter in which to find the token. + * The name must be 1-64 characters long and match + * the regular expression `[a-zA-Z]([a-zA-Z0-9_-])*` which means the + * first character must be a letter, and all following characters + * must be a dash, underscore, letter or digit. + * Defaults to `edge-cache-token`. + * + * Generated from protobuf field string query_parameter = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $query_parameter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_parameter + * Optional. The query parameter in which to find the token. + * The name must be 1-64 characters long and match + * the regular expression `[a-zA-Z]([a-zA-Z0-9_-])*` which means the + * first character must be a letter, and all following characters + * must be a dash, underscore, letter or digit. + * Defaults to `edge-cache-token`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\CdnKeys::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The query parameter in which to find the token. + * The name must be 1-64 characters long and match + * the regular expression `[a-zA-Z]([a-zA-Z0-9_-])*` which means the + * first character must be a letter, and all following characters + * must be a dash, underscore, letter or digit. + * Defaults to `edge-cache-token`. + * + * Generated from protobuf field string query_parameter = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQueryParameter() + { + return $this->query_parameter; + } + + /** + * Optional. The query parameter in which to find the token. + * The name must be 1-64 characters long and match + * the regular expression `[a-zA-Z]([a-zA-Z0-9_-])*` which means the + * first character must be a letter, and all following characters + * must be a dash, underscore, letter or digit. + * Defaults to `edge-cache-token`. + * + * Generated from protobuf field string query_parameter = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQueryParameter($var) + { + GPBUtil::checkString($var, True); + $this->query_parameter = $var; + + return $this; + } + +} + + diff --git a/VideoStitcher/src/V1/UpdateLiveConfigRequest.php b/VideoStitcher/src/V1/UpdateLiveConfigRequest.php new file mode 100644 index 000000000000..30582f6f5281 --- /dev/null +++ b/VideoStitcher/src/V1/UpdateLiveConfigRequest.php @@ -0,0 +1,151 @@ +google.cloud.video.stitcher.v1.UpdateLiveConfigRequest + */ +class UpdateLiveConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The LiveConfig resource which replaces the resource on the + * server. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.LiveConfig live_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $live_config = null; + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $update_mask = null; + + /** + * @param \Google\Cloud\Video\Stitcher\V1\LiveConfig $liveConfig Required. The LiveConfig resource which replaces the resource on the + * server. + * @param \Google\Protobuf\FieldMask $updateMask Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * @return \Google\Cloud\Video\Stitcher\V1\UpdateLiveConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Video\Stitcher\V1\LiveConfig $liveConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setLiveConfig($liveConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Video\Stitcher\V1\LiveConfig $live_config + * Required. The LiveConfig resource which replaces the resource on the + * server. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VideoStitcherService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The LiveConfig resource which replaces the resource on the + * server. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.LiveConfig live_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Video\Stitcher\V1\LiveConfig|null + */ + public function getLiveConfig() + { + return $this->live_config; + } + + public function hasLiveConfig() + { + return isset($this->live_config); + } + + public function clearLiveConfig() + { + unset($this->live_config); + } + + /** + * Required. The LiveConfig resource which replaces the resource on the + * server. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.LiveConfig live_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Video\Stitcher\V1\LiveConfig $var + * @return $this + */ + public function setLiveConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\Stitcher\V1\LiveConfig::class); + $this->live_config = $var; + + return $this; + } + + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/VideoStitcher/src/V1/UpdateVodConfigRequest.php b/VideoStitcher/src/V1/UpdateVodConfigRequest.php new file mode 100644 index 000000000000..3126ff36419d --- /dev/null +++ b/VideoStitcher/src/V1/UpdateVodConfigRequest.php @@ -0,0 +1,151 @@ +google.cloud.video.stitcher.v1.UpdateVodConfigRequest + */ +class UpdateVodConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The VOD config resource which replaces the resource on the + * server. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.VodConfig vod_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $vod_config = null; + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $update_mask = null; + + /** + * @param \Google\Cloud\Video\Stitcher\V1\VodConfig $vodConfig Required. The VOD config resource which replaces the resource on the + * server. + * @param \Google\Protobuf\FieldMask $updateMask Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * @return \Google\Cloud\Video\Stitcher\V1\UpdateVodConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Video\Stitcher\V1\VodConfig $vodConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setVodConfig($vodConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Video\Stitcher\V1\VodConfig $vod_config + * Required. The VOD config resource which replaces the resource on the + * server. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VideoStitcherService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The VOD config resource which replaces the resource on the + * server. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.VodConfig vod_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Video\Stitcher\V1\VodConfig|null + */ + public function getVodConfig() + { + return $this->vod_config; + } + + public function hasVodConfig() + { + return isset($this->vod_config); + } + + public function clearVodConfig() + { + unset($this->vod_config); + } + + /** + * Required. The VOD config resource which replaces the resource on the + * server. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.VodConfig vod_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Video\Stitcher\V1\VodConfig $var + * @return $this + */ + public function setVodConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\Stitcher\V1\VodConfig::class); + $this->vod_config = $var; + + return $this; + } + + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/VideoStitcher/src/V1/VodConfig.php b/VideoStitcher/src/V1/VodConfig.php new file mode 100644 index 000000000000..f3e51afcc7b9 --- /dev/null +++ b/VideoStitcher/src/V1/VodConfig.php @@ -0,0 +1,261 @@ +google.cloud.video.stitcher.v1.VodConfig + */ +class VodConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the VOD config, in the form of + * `projects/{project}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $name = ''; + /** + * Required. Source URI for the VOD stream manifest. + * + * Generated from protobuf field string source_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $source_uri = ''; + /** + * Required. The default ad tag associated with this VOD config. + * + * Generated from protobuf field string ad_tag_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $ad_tag_uri = ''; + /** + * Optional. Google Ad Manager (GAM) metadata. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.GamVodConfig gam_vod_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $gam_vod_config = null; + /** + * Output only. State of the VOD config. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.VodConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state = 0; + /** + * Options for fetching source manifests and segments. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.FetchOptions source_fetch_options = 8; + */ + private $source_fetch_options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the VOD config, in the form of + * `projects/{project}/locations/{location}/vodConfigs/{id}`. + * @type string $source_uri + * Required. Source URI for the VOD stream manifest. + * @type string $ad_tag_uri + * Required. The default ad tag associated with this VOD config. + * @type \Google\Cloud\Video\Stitcher\V1\GamVodConfig $gam_vod_config + * Optional. Google Ad Manager (GAM) metadata. + * @type int $state + * Output only. State of the VOD config. + * @type \Google\Cloud\Video\Stitcher\V1\FetchOptions $source_fetch_options + * Options for fetching source manifests and segments. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Stitcher\V1\VodConfigs::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the VOD config, in the form of + * `projects/{project}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the VOD config, in the form of + * `projects/{project}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Source URI for the VOD stream manifest. + * + * Generated from protobuf field string source_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSourceUri() + { + return $this->source_uri; + } + + /** + * Required. Source URI for the VOD stream manifest. + * + * Generated from protobuf field string source_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSourceUri($var) + { + GPBUtil::checkString($var, True); + $this->source_uri = $var; + + return $this; + } + + /** + * Required. The default ad tag associated with this VOD config. + * + * Generated from protobuf field string ad_tag_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAdTagUri() + { + return $this->ad_tag_uri; + } + + /** + * Required. The default ad tag associated with this VOD config. + * + * Generated from protobuf field string ad_tag_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAdTagUri($var) + { + GPBUtil::checkString($var, True); + $this->ad_tag_uri = $var; + + return $this; + } + + /** + * Optional. Google Ad Manager (GAM) metadata. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.GamVodConfig gam_vod_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Video\Stitcher\V1\GamVodConfig|null + */ + public function getGamVodConfig() + { + return $this->gam_vod_config; + } + + public function hasGamVodConfig() + { + return isset($this->gam_vod_config); + } + + public function clearGamVodConfig() + { + unset($this->gam_vod_config); + } + + /** + * Optional. Google Ad Manager (GAM) metadata. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.GamVodConfig gam_vod_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Video\Stitcher\V1\GamVodConfig $var + * @return $this + */ + public function setGamVodConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\Stitcher\V1\GamVodConfig::class); + $this->gam_vod_config = $var; + + return $this; + } + + /** + * Output only. State of the VOD config. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.VodConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the VOD config. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.VodConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Video\Stitcher\V1\VodConfig\State::class); + $this->state = $var; + + return $this; + } + + /** + * Options for fetching source manifests and segments. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.FetchOptions source_fetch_options = 8; + * @return \Google\Cloud\Video\Stitcher\V1\FetchOptions|null + */ + public function getSourceFetchOptions() + { + return $this->source_fetch_options; + } + + public function hasSourceFetchOptions() + { + return isset($this->source_fetch_options); + } + + public function clearSourceFetchOptions() + { + unset($this->source_fetch_options); + } + + /** + * Options for fetching source manifests and segments. + * + * Generated from protobuf field .google.cloud.video.stitcher.v1.FetchOptions source_fetch_options = 8; + * @param \Google\Cloud\Video\Stitcher\V1\FetchOptions $var + * @return $this + */ + public function setSourceFetchOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\Stitcher\V1\FetchOptions::class); + $this->source_fetch_options = $var; + + return $this; + } + +} + diff --git a/VideoStitcher/src/V1/VodConfig/State.php b/VideoStitcher/src/V1/VodConfig/State.php new file mode 100644 index 000000000000..3fe7658cd0c7 --- /dev/null +++ b/VideoStitcher/src/V1/VodConfig/State.php @@ -0,0 +1,69 @@ +google.cloud.video.stitcher.v1.VodConfig.State + */ +class State +{ + /** + * State is not specified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * VOD config is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * VOD config is ready for use. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * VOD config is queued up for deletion. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::DELETING => 'DELETING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VideoStitcher/src/V1/VodSession.php b/VideoStitcher/src/V1/VodSession.php index 86bede960f1b..3815df85da71 100644 --- a/VideoStitcher/src/V1/VodSession.php +++ b/VideoStitcher/src/V1/VodSession.php @@ -35,27 +35,31 @@ class VodSession extends \Google\Protobuf\Internal\Message */ private $play_uri = ''; /** - * Required. URI of the media to stitch. + * URI of the media to stitch. For most use cases, you should create a + * [VodConfig][google.cloud.video.stitcher.v1.VodConfig] with this information + * rather than setting this field directly. * - * Generated from protobuf field string source_uri = 5 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string source_uri = 5; */ private $source_uri = ''; /** - * Required. Ad tag URI. + * Ad tag URI. For most use cases, you should create a + * [VodConfig][google.cloud.video.stitcher.v1.VodConfig] with this information + * rather than setting this field directly. * - * Generated from protobuf field string ad_tag_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string ad_tag_uri = 6; */ private $ad_tag_uri = ''; /** - * Key value pairs for ad tag macro replacement. If the - * specified ad tag URI has macros, this field provides the mapping - * to the value that will replace the macro in the ad tag URI. - * Macros are designated by square brackets. - * For example: + * Key value pairs for ad tag macro replacement, only available for VOD + * sessions that do not implement Google Ad manager ad insertion. If the + * specified ad tag URI has macros, this field provides the mapping to the + * value that will replace the macro in the ad tag URI. + * Macros are designated by square brackets, for example: * Ad tag URI: `"https://doubleclick.google.com/ad/1?geo_id=[geoId]"` * Ad tag macro map: `{"geoId": "123"}` * Fully qualified ad tag: - * `"`https://doubleclick.google.com/ad/1?geo_id=123"` + * `"https://doubleclick.google.com/ad/1?geo_id=123"` * * Generated from protobuf field map ad_tag_macro_map = 7; */ @@ -85,6 +89,13 @@ class VodSession extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.video.stitcher.v1.VodSession.GamSettings gam_settings = 13; */ private $gam_settings = null; + /** + * The resource name of the VOD config for this session, in the form of + * `projects/{project}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string vod_config = 14 [(.google.api.resource_reference) = { + */ + private $vod_config = ''; /** * Constructor. @@ -100,19 +111,23 @@ class VodSession extends \Google\Protobuf\Internal\Message * @type string $play_uri * Output only. The playback URI of the stitched content. * @type string $source_uri - * Required. URI of the media to stitch. + * URI of the media to stitch. For most use cases, you should create a + * [VodConfig][google.cloud.video.stitcher.v1.VodConfig] with this information + * rather than setting this field directly. * @type string $ad_tag_uri - * Required. Ad tag URI. + * Ad tag URI. For most use cases, you should create a + * [VodConfig][google.cloud.video.stitcher.v1.VodConfig] with this information + * rather than setting this field directly. * @type array|\Google\Protobuf\Internal\MapField $ad_tag_macro_map - * Key value pairs for ad tag macro replacement. If the - * specified ad tag URI has macros, this field provides the mapping - * to the value that will replace the macro in the ad tag URI. - * Macros are designated by square brackets. - * For example: + * Key value pairs for ad tag macro replacement, only available for VOD + * sessions that do not implement Google Ad manager ad insertion. If the + * specified ad tag URI has macros, this field provides the mapping to the + * value that will replace the macro in the ad tag URI. + * Macros are designated by square brackets, for example: * Ad tag URI: `"https://doubleclick.google.com/ad/1?geo_id=[geoId]"` * Ad tag macro map: `{"geoId": "123"}` * Fully qualified ad tag: - * `"`https://doubleclick.google.com/ad/1?geo_id=123"` + * `"https://doubleclick.google.com/ad/1?geo_id=123"` * @type \Google\Cloud\Video\Stitcher\V1\ManifestOptions $manifest_options * Additional options that affect the output of the manifest. * @type string $asset_id @@ -122,6 +137,9 @@ class VodSession extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Video\Stitcher\V1\VodSession\GamSettings $gam_settings * This field should be set with appropriate values if GAM is being used for * ads. + * @type string $vod_config + * The resource name of the VOD config for this session, in the form of + * `projects/{project}/locations/{location}/vodConfigs/{id}`. * } */ public function __construct($data = NULL) { @@ -220,9 +238,11 @@ public function setPlayUri($var) } /** - * Required. URI of the media to stitch. + * URI of the media to stitch. For most use cases, you should create a + * [VodConfig][google.cloud.video.stitcher.v1.VodConfig] with this information + * rather than setting this field directly. * - * Generated from protobuf field string source_uri = 5 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string source_uri = 5; * @return string */ public function getSourceUri() @@ -231,9 +251,11 @@ public function getSourceUri() } /** - * Required. URI of the media to stitch. + * URI of the media to stitch. For most use cases, you should create a + * [VodConfig][google.cloud.video.stitcher.v1.VodConfig] with this information + * rather than setting this field directly. * - * Generated from protobuf field string source_uri = 5 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string source_uri = 5; * @param string $var * @return $this */ @@ -246,9 +268,11 @@ public function setSourceUri($var) } /** - * Required. Ad tag URI. + * Ad tag URI. For most use cases, you should create a + * [VodConfig][google.cloud.video.stitcher.v1.VodConfig] with this information + * rather than setting this field directly. * - * Generated from protobuf field string ad_tag_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string ad_tag_uri = 6; * @return string */ public function getAdTagUri() @@ -257,9 +281,11 @@ public function getAdTagUri() } /** - * Required. Ad tag URI. + * Ad tag URI. For most use cases, you should create a + * [VodConfig][google.cloud.video.stitcher.v1.VodConfig] with this information + * rather than setting this field directly. * - * Generated from protobuf field string ad_tag_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string ad_tag_uri = 6; * @param string $var * @return $this */ @@ -272,15 +298,15 @@ public function setAdTagUri($var) } /** - * Key value pairs for ad tag macro replacement. If the - * specified ad tag URI has macros, this field provides the mapping - * to the value that will replace the macro in the ad tag URI. - * Macros are designated by square brackets. - * For example: + * Key value pairs for ad tag macro replacement, only available for VOD + * sessions that do not implement Google Ad manager ad insertion. If the + * specified ad tag URI has macros, this field provides the mapping to the + * value that will replace the macro in the ad tag URI. + * Macros are designated by square brackets, for example: * Ad tag URI: `"https://doubleclick.google.com/ad/1?geo_id=[geoId]"` * Ad tag macro map: `{"geoId": "123"}` * Fully qualified ad tag: - * `"`https://doubleclick.google.com/ad/1?geo_id=123"` + * `"https://doubleclick.google.com/ad/1?geo_id=123"` * * Generated from protobuf field map ad_tag_macro_map = 7; * @return \Google\Protobuf\Internal\MapField @@ -291,15 +317,15 @@ public function getAdTagMacroMap() } /** - * Key value pairs for ad tag macro replacement. If the - * specified ad tag URI has macros, this field provides the mapping - * to the value that will replace the macro in the ad tag URI. - * Macros are designated by square brackets. - * For example: + * Key value pairs for ad tag macro replacement, only available for VOD + * sessions that do not implement Google Ad manager ad insertion. If the + * specified ad tag URI has macros, this field provides the mapping to the + * value that will replace the macro in the ad tag URI. + * Macros are designated by square brackets, for example: * Ad tag URI: `"https://doubleclick.google.com/ad/1?geo_id=[geoId]"` * Ad tag macro map: `{"geoId": "123"}` * Fully qualified ad tag: - * `"`https://doubleclick.google.com/ad/1?geo_id=123"` + * `"https://doubleclick.google.com/ad/1?geo_id=123"` * * Generated from protobuf field map ad_tag_macro_map = 7; * @param array|\Google\Protobuf\Internal\MapField $var @@ -439,5 +465,33 @@ public function setGamSettings($var) return $this; } + /** + * The resource name of the VOD config for this session, in the form of + * `projects/{project}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string vod_config = 14 [(.google.api.resource_reference) = { + * @return string + */ + public function getVodConfig() + { + return $this->vod_config; + } + + /** + * The resource name of the VOD config for this session, in the form of + * `projects/{project}/locations/{location}/vodConfigs/{id}`. + * + * Generated from protobuf field string vod_config = 14 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setVodConfig($var) + { + GPBUtil::checkString($var, True); + $this->vod_config = $var; + + return $this; + } + } diff --git a/VideoStitcher/src/V1/VodStitchDetail.php b/VideoStitcher/src/V1/VodStitchDetail.php index facfb8073a89..8a60aa2a3a1a 100644 --- a/VideoStitcher/src/V1/VodStitchDetail.php +++ b/VideoStitcher/src/V1/VodStitchDetail.php @@ -9,9 +9,9 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Detailed information related to the interstitial of a VOD session. This - * resource is only available for VOD sessions that do not implement Google Ad - * Manager ad insertion. + * Information related to the interstitial of a VOD session. This resource is + * only available for VOD sessions that do not implement Google Ad Manager ad + * insertion. * * Generated from protobuf message google.cloud.video.stitcher.v1.VodStitchDetail */ diff --git a/VideoStitcher/src/V1/gapic_metadata.json b/VideoStitcher/src/V1/gapic_metadata.json index 7765f6f837ab..deb3878deaf3 100644 --- a/VideoStitcher/src/V1/gapic_metadata.json +++ b/VideoStitcher/src/V1/gapic_metadata.json @@ -30,6 +30,11 @@ "createSlate" ] }, + "CreateVodConfig": { + "methods": [ + "createVodConfig" + ] + }, "CreateVodSession": { "methods": [ "createVodSession" @@ -50,6 +55,11 @@ "deleteSlate" ] }, + "DeleteVodConfig": { + "methods": [ + "deleteVodConfig" + ] + }, "GetCdnKey": { "methods": [ "getCdnKey" @@ -80,6 +90,11 @@ "getVodAdTagDetail" ] }, + "GetVodConfig": { + "methods": [ + "getVodConfig" + ] + }, "GetVodSession": { "methods": [ "getVodSession" @@ -115,6 +130,11 @@ "listVodAdTagDetails" ] }, + "ListVodConfigs": { + "methods": [ + "listVodConfigs" + ] + }, "ListVodStitchDetails": { "methods": [ "listVodStitchDetails" @@ -125,10 +145,20 @@ "updateCdnKey" ] }, + "UpdateLiveConfig": { + "methods": [ + "updateLiveConfig" + ] + }, "UpdateSlate": { "methods": [ "updateSlate" ] + }, + "UpdateVodConfig": { + "methods": [ + "updateVodConfig" + ] } } } diff --git a/VideoStitcher/src/V1/resources/video_stitcher_service_client_config.json b/VideoStitcher/src/V1/resources/video_stitcher_service_client_config.json index 74f1061a86b0..7c6b32e32f55 100644 --- a/VideoStitcher/src/V1/resources/video_stitcher_service_client_config.json +++ b/VideoStitcher/src/V1/resources/video_stitcher_service_client_config.json @@ -58,6 +58,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "CreateVodConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "CreateVodSession": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -78,6 +83,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "DeleteVodConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetCdnKey": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -108,6 +118,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "GetVodConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetVodSession": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -143,6 +158,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ListVodConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListVodStitchDetails": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -153,10 +173,20 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "UpdateLiveConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "UpdateSlate": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" + }, + "UpdateVodConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" } } } diff --git a/VideoStitcher/src/V1/resources/video_stitcher_service_descriptor_config.php b/VideoStitcher/src/V1/resources/video_stitcher_service_descriptor_config.php index aafb2bf687e4..e80d4ba18a1a 100644 --- a/VideoStitcher/src/V1/resources/video_stitcher_service_descriptor_config.php +++ b/VideoStitcher/src/V1/resources/video_stitcher_service_descriptor_config.php @@ -80,6 +80,25 @@ ], ], ], + 'CreateVodConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Video\Stitcher\V1\VodConfig', + 'metadataReturnType' => '\Google\Cloud\Video\Stitcher\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'DeleteCdnKey' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -137,6 +156,25 @@ ], ], ], + 'DeleteVodConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Video\Stitcher\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'UpdateCdnKey' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Video\Stitcher\V1\CdnKey', @@ -157,6 +195,26 @@ ], ], ], + 'UpdateLiveConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Video\Stitcher\V1\LiveConfig', + 'metadataReturnType' => '\Google\Cloud\Video\Stitcher\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'live_config.name', + 'fieldAccessors' => [ + 'getLiveConfig', + 'getName', + ], + ], + ], + ], 'UpdateSlate' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Video\Stitcher\V1\Slate', @@ -177,6 +235,26 @@ ], ], ], + 'UpdateVodConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Video\Stitcher\V1\VodConfig', + 'metadataReturnType' => '\Google\Cloud\Video\Stitcher\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'vod_config.name', + 'fieldAccessors' => [ + 'getVodConfig', + 'getName', + ], + ], + ], + ], 'CreateLiveSession' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Video\Stitcher\V1\LiveSession', @@ -273,6 +351,18 @@ ], ], ], + 'GetVodConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Video\Stitcher\V1\VodConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetVodSession' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Video\Stitcher\V1\VodSession', @@ -397,6 +487,26 @@ ], ], ], + 'ListVodConfigs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getVodConfigs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Video\Stitcher\V1\ListVodConfigsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListVodStitchDetails' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -425,6 +535,7 @@ 'location' => 'projects/{project}/locations/{location}', 'slate' => 'projects/{project}/locations/{location}/slates/{slate}', 'vodAdTagDetail' => 'projects/{project}/locations/{location}/vodSessions/{vod_session}/vodAdTagDetails/{vod_ad_tag_detail}', + 'vodConfig' => 'projects/{project}/locations/{location}/vodConfigs/{vod_config}', 'vodSession' => 'projects/{project}/locations/{location}/vodSessions/{vod_session}', 'vodStitchDetail' => 'projects/{project}/locations/{location}/vodSessions/{vod_session}/vodStitchDetails/{vod_stitch_detail}', ], diff --git a/VideoStitcher/src/V1/resources/video_stitcher_service_rest_client_config.php b/VideoStitcher/src/V1/resources/video_stitcher_service_rest_client_config.php index ffe207fd119e..bbeb54d103eb 100644 --- a/VideoStitcher/src/V1/resources/video_stitcher_service_rest_client_config.php +++ b/VideoStitcher/src/V1/resources/video_stitcher_service_rest_client_config.php @@ -80,6 +80,21 @@ 'slate_id', ], ], + 'CreateVodConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/vodConfigs', + 'body' => 'vod_config', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'vod_config_id', + ], + ], 'CreateVodSession' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/vodSessions', @@ -125,6 +140,17 @@ ], ], ], + 'DeleteVodConfig' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/vodConfigs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetCdnKey' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/cdnKeys/*}', @@ -191,6 +217,17 @@ ], ], ], + 'GetVodConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/vodConfigs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetVodSession' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/vodSessions/*}', @@ -268,6 +305,17 @@ ], ], ], + 'ListVodConfigs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/vodConfigs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListVodStitchDetails' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/vodSessions/*}/vodStitchDetails', @@ -295,6 +343,22 @@ 'update_mask', ], ], + 'UpdateLiveConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{live_config.name=projects/*/locations/*/liveConfigs/*}', + 'body' => 'live_config', + 'placeholders' => [ + 'live_config.name' => [ + 'getters' => [ + 'getLiveConfig', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], 'UpdateSlate' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{slate.name=projects/*/locations/*/slates/*}', @@ -311,6 +375,22 @@ 'update_mask', ], ], + 'UpdateVodConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{vod_config.name=projects/*/locations/*/vodConfigs/*}', + 'body' => 'vod_config', + 'placeholders' => [ + 'vod_config.name' => [ + 'getters' => [ + 'getVodConfig', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], ], 'google.longrunning.Operations' => [ 'CancelOperation' => [ diff --git a/VideoStitcher/tests/Unit/V1/Client/VideoStitcherServiceClientTest.php b/VideoStitcher/tests/Unit/V1/Client/VideoStitcherServiceClientTest.php index 6fffb053b3b2..9af3449f7726 100644 --- a/VideoStitcher/tests/Unit/V1/Client/VideoStitcherServiceClientTest.php +++ b/VideoStitcher/tests/Unit/V1/Client/VideoStitcherServiceClientTest.php @@ -34,16 +34,19 @@ use Google\Cloud\Video\Stitcher\V1\CreateLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\CreateLiveSessionRequest; use Google\Cloud\Video\Stitcher\V1\CreateSlateRequest; +use Google\Cloud\Video\Stitcher\V1\CreateVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\CreateVodSessionRequest; use Google\Cloud\Video\Stitcher\V1\DeleteCdnKeyRequest; use Google\Cloud\Video\Stitcher\V1\DeleteLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\DeleteSlateRequest; +use Google\Cloud\Video\Stitcher\V1\DeleteVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\GetCdnKeyRequest; use Google\Cloud\Video\Stitcher\V1\GetLiveAdTagDetailRequest; use Google\Cloud\Video\Stitcher\V1\GetLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\GetLiveSessionRequest; use Google\Cloud\Video\Stitcher\V1\GetSlateRequest; use Google\Cloud\Video\Stitcher\V1\GetVodAdTagDetailRequest; +use Google\Cloud\Video\Stitcher\V1\GetVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\GetVodSessionRequest; use Google\Cloud\Video\Stitcher\V1\GetVodStitchDetailRequest; use Google\Cloud\Video\Stitcher\V1\ListCdnKeysRequest; @@ -56,6 +59,8 @@ use Google\Cloud\Video\Stitcher\V1\ListSlatesResponse; use Google\Cloud\Video\Stitcher\V1\ListVodAdTagDetailsRequest; use Google\Cloud\Video\Stitcher\V1\ListVodAdTagDetailsResponse; +use Google\Cloud\Video\Stitcher\V1\ListVodConfigsRequest; +use Google\Cloud\Video\Stitcher\V1\ListVodConfigsResponse; use Google\Cloud\Video\Stitcher\V1\ListVodStitchDetailsRequest; use Google\Cloud\Video\Stitcher\V1\ListVodStitchDetailsResponse; use Google\Cloud\Video\Stitcher\V1\LiveAdTagDetail; @@ -63,8 +68,11 @@ use Google\Cloud\Video\Stitcher\V1\LiveSession; use Google\Cloud\Video\Stitcher\V1\Slate; use Google\Cloud\Video\Stitcher\V1\UpdateCdnKeyRequest; +use Google\Cloud\Video\Stitcher\V1\UpdateLiveConfigRequest; use Google\Cloud\Video\Stitcher\V1\UpdateSlateRequest; +use Google\Cloud\Video\Stitcher\V1\UpdateVodConfigRequest; use Google\Cloud\Video\Stitcher\V1\VodAdTagDetail; +use Google\Cloud\Video\Stitcher\V1\VodConfig; use Google\Cloud\Video\Stitcher\V1\VodSession; use Google\Cloud\Video\Stitcher\V1\VodStitchDetail; use Google\LongRunning\GetOperationRequest; @@ -604,6 +612,153 @@ public function createSlateExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function createVodConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sourceUri = 'sourceUri-1111107768'; + $adTagUri = 'adTagUri-1429194965'; + $expectedResponse = new VodConfig(); + $expectedResponse->setName($name); + $expectedResponse->setSourceUri($sourceUri); + $expectedResponse->setAdTagUri($adTagUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createVodConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $vodConfigId = 'vodConfigId-418410300'; + $vodConfig = new VodConfig(); + $vodConfigSourceUri = 'vodConfigSourceUri538718692'; + $vodConfig->setSourceUri($vodConfigSourceUri); + $vodConfigAdTagUri = 'vodConfigAdTagUri-1204642686'; + $vodConfig->setAdTagUri($vodConfigAdTagUri); + $request = (new CreateVodConfigRequest()) + ->setParent($formattedParent) + ->setVodConfigId($vodConfigId) + ->setVodConfig($vodConfig); + $response = $gapicClient->createVodConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/CreateVodConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getVodConfigId(); + $this->assertProtobufEquals($vodConfigId, $actualValue); + $actualValue = $actualApiRequestObject->getVodConfig(); + $this->assertProtobufEquals($vodConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createVodConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createVodConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $vodConfigId = 'vodConfigId-418410300'; + $vodConfig = new VodConfig(); + $vodConfigSourceUri = 'vodConfigSourceUri538718692'; + $vodConfig->setSourceUri($vodConfigSourceUri); + $vodConfigAdTagUri = 'vodConfigAdTagUri-1204642686'; + $vodConfig->setAdTagUri($vodConfigAdTagUri); + $request = (new CreateVodConfigRequest()) + ->setParent($formattedParent) + ->setVodConfigId($vodConfigId) + ->setVodConfig($vodConfig); + $response = $gapicClient->createVodConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createVodConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function createVodSessionTest() { @@ -618,20 +773,18 @@ public function createVodSessionTest() $sourceUri = 'sourceUri-1111107768'; $adTagUri = 'adTagUri-1429194965'; $assetId = 'assetId-373202742'; + $vodConfig = 'vodConfig-936686282'; $expectedResponse = new VodSession(); $expectedResponse->setName($name); $expectedResponse->setPlayUri($playUri); $expectedResponse->setSourceUri($sourceUri); $expectedResponse->setAdTagUri($adTagUri); $expectedResponse->setAssetId($assetId); + $expectedResponse->setVodConfig($vodConfig); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $vodSession = new VodSession(); - $vodSessionSourceUri = 'vodSessionSourceUri2085185606'; - $vodSession->setSourceUri($vodSessionSourceUri); - $vodSessionAdTagUri = 'vodSessionAdTagUri-600567328'; - $vodSession->setAdTagUri($vodSessionAdTagUri); $vodSessionAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; $vodSession->setAdTracking($vodSessionAdTracking); $request = (new CreateVodSessionRequest()) @@ -672,10 +825,6 @@ public function createVodSessionExceptionTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $vodSession = new VodSession(); - $vodSessionSourceUri = 'vodSessionSourceUri2085185606'; - $vodSession->setSourceUri($vodSessionSourceUri); - $vodSessionAdTagUri = 'vodSessionAdTagUri-600567328'; - $vodSession->setAdTagUri($vodSessionAdTagUri); $vodSessionAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; $vodSession->setAdTracking($vodSessionAdTracking); $request = (new CreateVodSessionRequest()) @@ -1057,6 +1206,127 @@ public function deleteSlateExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function deleteVodConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteVodConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); + $request = (new DeleteVodConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteVodConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/DeleteVodConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteVodConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteVodConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); + $request = (new DeleteVodConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteVodConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteVodConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function getCdnKeyTest() { @@ -1456,7 +1726,7 @@ public function getVodAdTagDetailExceptionTest() } /** @test */ - public function getVodSessionTest() + public function getVodConfigTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1465,35 +1735,31 @@ public function getVodSessionTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; - $playUri = 'playUri1879098849'; $sourceUri = 'sourceUri-1111107768'; $adTagUri = 'adTagUri-1429194965'; - $assetId = 'assetId-373202742'; - $expectedResponse = new VodSession(); + $expectedResponse = new VodConfig(); $expectedResponse->setName($name2); - $expectedResponse->setPlayUri($playUri); $expectedResponse->setSourceUri($sourceUri); $expectedResponse->setAdTagUri($adTagUri); - $expectedResponse->setAssetId($assetId); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->vodSessionName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]'); - $request = (new GetVodSessionRequest()) + $formattedName = $gapicClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); + $request = (new GetVodConfigRequest()) ->setName($formattedName); - $response = $gapicClient->getVodSession($request); + $response = $gapicClient->getVodConfig($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodSession', $actualFuncCall); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodConfig', $actualFuncCall); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getVodSessionExceptionTest() + public function getVodConfigExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1511,11 +1777,11 @@ public function getVodSessionExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->vodSessionName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]'); - $request = (new GetVodSessionRequest()) + $formattedName = $gapicClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); + $request = (new GetVodConfigRequest()) ->setName($formattedName); try { - $gapicClient->getVodSession($request); + $gapicClient->getVodConfig($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1528,7 +1794,7 @@ public function getVodSessionExceptionTest() } /** @test */ - public function getVodStitchDetailTest() + public function getVodSessionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1537,27 +1803,101 @@ public function getVodStitchDetailTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; - $expectedResponse = new VodStitchDetail(); + $playUri = 'playUri1879098849'; + $sourceUri = 'sourceUri-1111107768'; + $adTagUri = 'adTagUri-1429194965'; + $assetId = 'assetId-373202742'; + $vodConfig = 'vodConfig-936686282'; + $expectedResponse = new VodSession(); $expectedResponse->setName($name2); + $expectedResponse->setPlayUri($playUri); + $expectedResponse->setSourceUri($sourceUri); + $expectedResponse->setAdTagUri($adTagUri); + $expectedResponse->setAssetId($assetId); + $expectedResponse->setVodConfig($vodConfig); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->vodStitchDetailName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]', '[VOD_STITCH_DETAIL]'); - $request = (new GetVodStitchDetailRequest()) + $formattedName = $gapicClient->vodSessionName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]'); + $request = (new GetVodSessionRequest()) ->setName($formattedName); - $response = $gapicClient->getVodStitchDetail($request); + $response = $gapicClient->getVodSession($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodStitchDetail', $actualFuncCall); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodSession', $actualFuncCall); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getVodStitchDetailExceptionTest() + public function getVodSessionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->vodSessionName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]'); + $request = (new GetVodSessionRequest()) + ->setName($formattedName); + try { + $gapicClient->getVodSession($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVodStitchDetailTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new VodStitchDetail(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->vodStitchDetailName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]', '[VOD_STITCH_DETAIL]'); + $request = (new GetVodStitchDetailRequest()) + ->setName($formattedName); + $response = $gapicClient->getVodStitchDetail($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodStitchDetail', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVodStitchDetailExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1951,6 +2291,78 @@ public function listVodAdTagDetailsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listVodConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $vodConfigsElement = new VodConfig(); + $vodConfigs = [ + $vodConfigsElement, + ]; + $expectedResponse = new ListVodConfigsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setVodConfigs($vodConfigs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListVodConfigsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listVodConfigs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVodConfigs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/ListVodConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVodConfigsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListVodConfigsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listVodConfigs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listVodStitchDetailsTest() { @@ -2154,6 +2566,149 @@ public function updateCdnKeyExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function updateLiveConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateLiveConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sourceUri = 'sourceUri-1111107768'; + $adTagUri = 'adTagUri-1429194965'; + $defaultSlate = 'defaultSlate1316218395'; + $expectedResponse = new LiveConfig(); + $expectedResponse->setName($name); + $expectedResponse->setSourceUri($sourceUri); + $expectedResponse->setAdTagUri($adTagUri); + $expectedResponse->setDefaultSlate($defaultSlate); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateLiveConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $liveConfig = new LiveConfig(); + $liveConfigSourceUri = 'liveConfigSourceUri-20192349'; + $liveConfig->setSourceUri($liveConfigSourceUri); + $liveConfigAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; + $liveConfig->setAdTracking($liveConfigAdTracking); + $updateMask = new FieldMask(); + $request = (new UpdateLiveConfigRequest()) + ->setLiveConfig($liveConfig) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateLiveConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/UpdateLiveConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getLiveConfig(); + $this->assertProtobufEquals($liveConfig, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateLiveConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateLiveConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateLiveConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $liveConfig = new LiveConfig(); + $liveConfigSourceUri = 'liveConfigSourceUri-20192349'; + $liveConfig->setSourceUri($liveConfigSourceUri); + $liveConfigAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; + $liveConfig->setAdTracking($liveConfigAdTracking); + $updateMask = new FieldMask(); + $request = (new UpdateLiveConfigRequest()) + ->setLiveConfig($liveConfig) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateLiveConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateLiveConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function updateSlateTest() { @@ -2285,6 +2840,147 @@ public function updateSlateExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function updateVodConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sourceUri = 'sourceUri-1111107768'; + $adTagUri = 'adTagUri-1429194965'; + $expectedResponse = new VodConfig(); + $expectedResponse->setName($name); + $expectedResponse->setSourceUri($sourceUri); + $expectedResponse->setAdTagUri($adTagUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateVodConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $vodConfig = new VodConfig(); + $vodConfigSourceUri = 'vodConfigSourceUri538718692'; + $vodConfig->setSourceUri($vodConfigSourceUri); + $vodConfigAdTagUri = 'vodConfigAdTagUri-1204642686'; + $vodConfig->setAdTagUri($vodConfigAdTagUri); + $updateMask = new FieldMask(); + $request = (new UpdateVodConfigRequest()) + ->setVodConfig($vodConfig) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateVodConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/UpdateVodConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getVodConfig(); + $this->assertProtobufEquals($vodConfig, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateVodConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateVodConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $vodConfig = new VodConfig(); + $vodConfigSourceUri = 'vodConfigSourceUri538718692'; + $vodConfig->setSourceUri($vodConfigSourceUri); + $vodConfigAdTagUri = 'vodConfigAdTagUri-1204642686'; + $vodConfig->setAdTagUri($vodConfigAdTagUri); + $updateMask = new FieldMask(); + $request = (new UpdateVodConfigRequest()) + ->setVodConfig($vodConfig) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateVodConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateVodConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function createCdnKeyAsyncTest() { diff --git a/VideoStitcher/tests/Unit/V1/VideoStitcherServiceClientTest.php b/VideoStitcher/tests/Unit/V1/VideoStitcherServiceClientTest.php index 8812776b0842..037c30eace81 100644 --- a/VideoStitcher/tests/Unit/V1/VideoStitcherServiceClientTest.php +++ b/VideoStitcher/tests/Unit/V1/VideoStitcherServiceClientTest.php @@ -34,6 +34,7 @@ use Google\Cloud\Video\Stitcher\V1\ListLiveConfigsResponse; use Google\Cloud\Video\Stitcher\V1\ListSlatesResponse; use Google\Cloud\Video\Stitcher\V1\ListVodAdTagDetailsResponse; +use Google\Cloud\Video\Stitcher\V1\ListVodConfigsResponse; use Google\Cloud\Video\Stitcher\V1\ListVodStitchDetailsResponse; use Google\Cloud\Video\Stitcher\V1\LiveAdTagDetail; use Google\Cloud\Video\Stitcher\V1\LiveConfig; @@ -41,6 +42,7 @@ use Google\Cloud\Video\Stitcher\V1\Slate; use Google\Cloud\Video\Stitcher\V1\VideoStitcherServiceClient; use Google\Cloud\Video\Stitcher\V1\VodAdTagDetail; +use Google\Cloud\Video\Stitcher\V1\VodConfig; use Google\Cloud\Video\Stitcher\V1\VodSession; use Google\Cloud\Video\Stitcher\V1\VodStitchDetail; use Google\LongRunning\GetOperationRequest; @@ -550,6 +552,145 @@ public function createSlateExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function createVodConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sourceUri = 'sourceUri-1111107768'; + $adTagUri = 'adTagUri-1429194965'; + $expectedResponse = new VodConfig(); + $expectedResponse->setName($name); + $expectedResponse->setSourceUri($sourceUri); + $expectedResponse->setAdTagUri($adTagUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createVodConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $vodConfigId = 'vodConfigId-418410300'; + $vodConfig = new VodConfig(); + $vodConfigSourceUri = 'vodConfigSourceUri538718692'; + $vodConfig->setSourceUri($vodConfigSourceUri); + $vodConfigAdTagUri = 'vodConfigAdTagUri-1204642686'; + $vodConfig->setAdTagUri($vodConfigAdTagUri); + $response = $gapicClient->createVodConfig($formattedParent, $vodConfigId, $vodConfig); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/CreateVodConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getVodConfigId(); + $this->assertProtobufEquals($vodConfigId, $actualValue); + $actualValue = $actualApiRequestObject->getVodConfig(); + $this->assertProtobufEquals($vodConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createVodConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createVodConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $vodConfigId = 'vodConfigId-418410300'; + $vodConfig = new VodConfig(); + $vodConfigSourceUri = 'vodConfigSourceUri538718692'; + $vodConfig->setSourceUri($vodConfigSourceUri); + $vodConfigAdTagUri = 'vodConfigAdTagUri-1204642686'; + $vodConfig->setAdTagUri($vodConfigAdTagUri); + $response = $gapicClient->createVodConfig($formattedParent, $vodConfigId, $vodConfig); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createVodConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function createVodSessionTest() { @@ -564,20 +705,18 @@ public function createVodSessionTest() $sourceUri = 'sourceUri-1111107768'; $adTagUri = 'adTagUri-1429194965'; $assetId = 'assetId-373202742'; + $vodConfig = 'vodConfig-936686282'; $expectedResponse = new VodSession(); $expectedResponse->setName($name); $expectedResponse->setPlayUri($playUri); $expectedResponse->setSourceUri($sourceUri); $expectedResponse->setAdTagUri($adTagUri); $expectedResponse->setAssetId($assetId); + $expectedResponse->setVodConfig($vodConfig); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $vodSession = new VodSession(); - $vodSessionSourceUri = 'vodSessionSourceUri2085185606'; - $vodSession->setSourceUri($vodSessionSourceUri); - $vodSessionAdTagUri = 'vodSessionAdTagUri-600567328'; - $vodSession->setAdTagUri($vodSessionAdTagUri); $vodSessionAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; $vodSession->setAdTracking($vodSessionAdTracking); $response = $gapicClient->createVodSession($formattedParent, $vodSession); @@ -615,10 +754,6 @@ public function createVodSessionExceptionTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $vodSession = new VodSession(); - $vodSessionSourceUri = 'vodSessionSourceUri2085185606'; - $vodSession->setSourceUri($vodSessionSourceUri); - $vodSessionAdTagUri = 'vodSessionAdTagUri-600567328'; - $vodSession->setAdTagUri($vodSessionAdTagUri); $vodSessionAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; $vodSession->setAdTracking($vodSessionAdTracking); try { @@ -985,6 +1120,123 @@ public function deleteSlateExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function deleteVodConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteVodConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); + $response = $gapicClient->deleteVodConfig($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/DeleteVodConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteVodConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteVodConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); + $response = $gapicClient->deleteVodConfig($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteVodConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function getCdnKeyTest() { @@ -1360,7 +1612,7 @@ public function getVodAdTagDetailExceptionTest() } /** @test */ - public function getVodSessionTest() + public function getVodConfigTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1369,33 +1621,29 @@ public function getVodSessionTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; - $playUri = 'playUri1879098849'; $sourceUri = 'sourceUri-1111107768'; $adTagUri = 'adTagUri-1429194965'; - $assetId = 'assetId-373202742'; - $expectedResponse = new VodSession(); + $expectedResponse = new VodConfig(); $expectedResponse->setName($name2); - $expectedResponse->setPlayUri($playUri); $expectedResponse->setSourceUri($sourceUri); $expectedResponse->setAdTagUri($adTagUri); - $expectedResponse->setAssetId($assetId); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->vodSessionName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]'); - $response = $gapicClient->getVodSession($formattedName); + $formattedName = $gapicClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); + $response = $gapicClient->getVodConfig($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodSession', $actualFuncCall); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodConfig', $actualFuncCall); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getVodSessionExceptionTest() + public function getVodConfigExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1413,9 +1661,9 @@ public function getVodSessionExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->vodSessionName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]'); + $formattedName = $gapicClient->vodConfigName('[PROJECT]', '[LOCATION]', '[VOD_CONFIG]'); try { - $gapicClient->getVodSession($formattedName); + $gapicClient->getVodConfig($formattedName); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1428,7 +1676,7 @@ public function getVodSessionExceptionTest() } /** @test */ - public function getVodStitchDetailTest() + public function getVodSessionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1437,25 +1685,35 @@ public function getVodStitchDetailTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; - $expectedResponse = new VodStitchDetail(); + $playUri = 'playUri1879098849'; + $sourceUri = 'sourceUri-1111107768'; + $adTagUri = 'adTagUri-1429194965'; + $assetId = 'assetId-373202742'; + $vodConfig = 'vodConfig-936686282'; + $expectedResponse = new VodSession(); $expectedResponse->setName($name2); + $expectedResponse->setPlayUri($playUri); + $expectedResponse->setSourceUri($sourceUri); + $expectedResponse->setAdTagUri($adTagUri); + $expectedResponse->setAssetId($assetId); + $expectedResponse->setVodConfig($vodConfig); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->vodStitchDetailName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]', '[VOD_STITCH_DETAIL]'); - $response = $gapicClient->getVodStitchDetail($formattedName); + $formattedName = $gapicClient->vodSessionName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]'); + $response = $gapicClient->getVodSession($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodStitchDetail', $actualFuncCall); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodSession', $actualFuncCall); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getVodStitchDetailExceptionTest() + public function getVodSessionExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1473,9 +1731,9 @@ public function getVodStitchDetailExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->vodStitchDetailName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]', '[VOD_STITCH_DETAIL]'); + $formattedName = $gapicClient->vodSessionName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]'); try { - $gapicClient->getVodStitchDetail($formattedName); + $gapicClient->getVodSession($formattedName); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1488,7 +1746,7 @@ public function getVodStitchDetailExceptionTest() } /** @test */ - public function listCdnKeysTest() + public function getVodStitchDetailTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1496,7 +1754,67 @@ public function listCdnKeysTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $nextPageToken = ''; + $name2 = 'name2-1052831874'; + $expectedResponse = new VodStitchDetail(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->vodStitchDetailName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]', '[VOD_STITCH_DETAIL]'); + $response = $gapicClient->getVodStitchDetail($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/GetVodStitchDetail', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVodStitchDetailExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->vodStitchDetailName('[PROJECT]', '[LOCATION]', '[VOD_SESSION]', '[VOD_STITCH_DETAIL]'); + try { + $gapicClient->getVodStitchDetail($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCdnKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; $cdnKeysElement = new CdnKey(); $cdnKeys = [ $cdnKeysElement, @@ -1827,6 +2145,74 @@ public function listVodAdTagDetailsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listVodConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $vodConfigsElement = new VodConfig(); + $vodConfigs = [ + $vodConfigsElement, + ]; + $expectedResponse = new ListVodConfigsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setVodConfigs($vodConfigs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listVodConfigs($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVodConfigs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/ListVodConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVodConfigsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listVodConfigs($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listVodStitchDetailsTest() { @@ -2020,6 +2406,143 @@ public function updateCdnKeyExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function updateLiveConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateLiveConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sourceUri = 'sourceUri-1111107768'; + $adTagUri = 'adTagUri-1429194965'; + $defaultSlate = 'defaultSlate1316218395'; + $expectedResponse = new LiveConfig(); + $expectedResponse->setName($name); + $expectedResponse->setSourceUri($sourceUri); + $expectedResponse->setAdTagUri($adTagUri); + $expectedResponse->setDefaultSlate($defaultSlate); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateLiveConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $liveConfig = new LiveConfig(); + $liveConfigSourceUri = 'liveConfigSourceUri-20192349'; + $liveConfig->setSourceUri($liveConfigSourceUri); + $liveConfigAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; + $liveConfig->setAdTracking($liveConfigAdTracking); + $updateMask = new FieldMask(); + $response = $gapicClient->updateLiveConfig($liveConfig, $updateMask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/UpdateLiveConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getLiveConfig(); + $this->assertProtobufEquals($liveConfig, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateLiveConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateLiveConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateLiveConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $liveConfig = new LiveConfig(); + $liveConfigSourceUri = 'liveConfigSourceUri-20192349'; + $liveConfig->setSourceUri($liveConfigSourceUri); + $liveConfigAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED; + $liveConfig->setAdTracking($liveConfigAdTracking); + $updateMask = new FieldMask(); + $response = $gapicClient->updateLiveConfig($liveConfig, $updateMask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateLiveConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function updateSlateTest() { @@ -2144,4 +2667,139 @@ public function updateSlateExceptionTest() $this->assertTrue($transport->isExhausted()); $this->assertTrue($operationsTransport->isExhausted()); } + + /** @test */ + public function updateVodConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sourceUri = 'sourceUri-1111107768'; + $adTagUri = 'adTagUri-1429194965'; + $expectedResponse = new VodConfig(); + $expectedResponse->setName($name); + $expectedResponse->setSourceUri($sourceUri); + $expectedResponse->setAdTagUri($adTagUri); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateVodConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $vodConfig = new VodConfig(); + $vodConfigSourceUri = 'vodConfigSourceUri538718692'; + $vodConfig->setSourceUri($vodConfigSourceUri); + $vodConfigAdTagUri = 'vodConfigAdTagUri-1204642686'; + $vodConfig->setAdTagUri($vodConfigAdTagUri); + $updateMask = new FieldMask(); + $response = $gapicClient->updateVodConfig($vodConfig, $updateMask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.video.stitcher.v1.VideoStitcherService/UpdateVodConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getVodConfig(); + $this->assertProtobufEquals($vodConfig, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateVodConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateVodConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateVodConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $vodConfig = new VodConfig(); + $vodConfigSourceUri = 'vodConfigSourceUri538718692'; + $vodConfig->setSourceUri($vodConfigSourceUri); + $vodConfigAdTagUri = 'vodConfigAdTagUri-1204642686'; + $vodConfig->setAdTagUri($vodConfigAdTagUri); + $updateMask = new FieldMask(); + $response = $gapicClient->updateVodConfig($vodConfig, $updateMask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateVodConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } } diff --git a/VideoTranscoder/.OwlBot.yaml b/VideoTranscoder/.OwlBot.yaml index 740639ef1aa5..4da0a9bbfb5b 100644 --- a/VideoTranscoder/.OwlBot.yaml +++ b/VideoTranscoder/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/video/transcoder/(v1|v1beta1)/.*-php/(.*) + - source: /google/cloud/video/transcoder/(v1)/.*-php/(.*) dest: /owl-bot-staging/VideoTranscoder/$1/$2 api-name: VideoTranscoder diff --git a/VideoTranscoder/.repo-metadata.json b/VideoTranscoder/.repo-metadata.json deleted file mode 100644 index 9070ebfee901..000000000000 --- a/VideoTranscoder/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-video-transcoder", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-video-transcoder/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "transcoder" -} diff --git a/VideoTranscoder/README.md b/VideoTranscoder/README.md index f665dfedc712..e4fbc0de1461 100644 --- a/VideoTranscoder/README.md +++ b/VideoTranscoder/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/VideoTranscoder/VERSION b/VideoTranscoder/VERSION index a3f5a8ed4d60..9028ec636547 100644 --- a/VideoTranscoder/VERSION +++ b/VideoTranscoder/VERSION @@ -1 +1 @@ -0.10.3 +0.10.5 diff --git a/VideoTranscoder/composer.json b/VideoTranscoder/composer.json index 89c852e59607..0d8c0c30ed8c 100644 --- a/VideoTranscoder/composer.json +++ b/VideoTranscoder/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/VideoTranscoder/metadata/V1Beta1/Resources.php b/VideoTranscoder/metadata/V1Beta1/Resources.php deleted file mode 100644 index d66c56d64a9d127ce30137e7e53ef5923f09b6b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8793 zcmb_i&2Jmm5f3F%B8U21*)7d}F>KPZcH3CMcFBDtH(u^; zc9)8jK!^4ZD9|2?0zDVK4{A#(pxmVuZ zYn2Xd`f2=V7NE6^>+3N6F7KF1Dkm%D}?2uNR?+Z{Tc&~lwJ3+y=^as5VFVe;J9 zJQo(ZU5?e;XCuKt2is04e8;d4Hbv0!EiZKaeN0_j>xnQiEstEk5iQGbR=0dz>A1Fb zLCM?Y&>xD^tC!2Z2#3CNQ|iqCC&{OSF~+NV*1?t~Y;#@ojYG@z*Vab68i71XG&X8_ zsl*(cL--P`_#C1w3+@ma18=;nJb|~~vm$%fO*1j?7ToiCVh}dZ8}#S*=!ehcm)h$} ztSa5PD&4s{a_4H~&ZTP+y5U)gYb(z#eLH$2{TxoRVn$Ypo`2{3^Dy4Jno#-c3{8IE zwzXNB;vgwz%9-nV?Q4{`9B&xvL*FV+@X-3?zw1-l*NNO=7(bXCJt$Ej6a&vjbnBK` zoJyYDdqrEP>5l7ktzI#U;X>^P)l}QALahxc2aH9^c|N?$3XhA^K*?%5P{p@;mLqkX zk;w0)N3QNk;Rn9OJDb#YDa%nJia8+7*VZn91dr^9Ah4WXlMxi&7Ax%bkcom~UMjbe z5)yDyOyPWk=DUVv4}GEg!U$ZaNI;XvF{$0Bh4`U~TxHoou~43biPIWlOF?f+VYT2p zROnzOoFltRaaQVHigl0uteS+7l6sp6=JP`(G?z|jm2$!{mB@TLkyq(j7}~ngMJm+! zy08W30Npf>gW>`(vZe1)J~>;hK$Cq~MR_%R+%$r|a_CB*7S5fVR;F+6-{0G4G@IMI zclBng-fHL%cANW+jqR=N#^&NHz?<1`>~7-mVurumf3UmDUnaCU$~PZuY&061m^i5s zO>fn=Kf>p!wTEBToAj+yfvx->;T%-4hZT;$8Z7&X=!C(_7tyDa72EB|42QA!(O)0N6s4y5FC1_I;Ep3L}86HJ2*x$f# ztS+v#0BQCz``d}+wA(bTlDo{Xh1y#w_p~Q(1g%ba!_?cb%HyCoBUPxTM5vqVET*+c z1FH&#ZQaC1EJu33%*ch>yD72uB>*T=EU#_TT!70187=4w0sG{oa6!Kp zEsd^*Sc(Zkq4s2{%KJ1Ed&O7)*8Hgeznh@N3(*#BPSO+Y1DchTD+)e&6opz^w~+OM ziaziYU>QTxa$_u&WYc2RSv0}A$6V?tjG@%Auf_&`M!IW3GDccorlkuRtMcCrPIOz z&{X2hNE!)}gwyelJ-+9o%#_v`jYP2WH~4sx>CWs^af3aY3XeS@xxswxR!U`K#A^JZ z1q^0H6I$_XV&`i@vbKrJ9hyBoUHcYY+o|tvZ#9}Nz4i0`^OOSw{oY4S(2X2TZPuIj z7AGndTDq9#<|rGwp4Cw)rSiWCDx6MT2<5Kp4~#HMInYm@HBwF2IvSDu39z8$C|`bN znPFe|tRn#q#eSGodwZ3xL^Jxr>h;5T3ddD6o(U9Wt zW20Nq`6s7`afyhD`_nRlb`^2uhK3z2&#XL)(0z+?veG*=Y{{*khJon|H1p{YMLr6V zg52&^T1L$IhAinhXu+L($Cbb2X(meg+6HBhu$H~G31TAngT(nB)*@mTsrru54Ut}Us>qPnSM&?sm4 zDG~Qu?4b-$mH0MN#!sx*SXJQAhVAtY>3Nyb?=!TJ=+Bjw)zS87;z-@0h1yG5bF4S2 zJw4eQOMjT4xkR-s!xT^~-^E{D<`g#8d@U_SjBUa=qjaKn`Vy@>cBksDdGb!j#oe>6 z^3o>FCdO$v=6FKztoyw5rwPg@FxtnoXvDsZm}6&%?(g?5>3RvKaw$akLz*99^C`+8 zD5Sm=;sZ>O`6PkcqPY<+XjDXM(+ zHx-fsZKGm-99j6qKqV4yT@pOm+A7puWb2acp?@{i@m()sNAJJDzBd4)eMpm@VMhEY zZ48V%n0>=6)hVma2W^bNKs#6!VjQCxZpASp^bJ`_^9W|O(M{`z4tKjahh$1OXeK@n z2;f!}PA}|7Hwzju;m}cMp2t;$smjV1r{cO5j?uP-DWfn~xK@*#NY*7!tK)ZdTO0~oQ7b->!}g&b;Ejrol>*s~ z%p$2R@o;x&+w5`b5%(OkXk5=5HXpj{2}kcCzPPcNgUABD=v^N@?uh@%ZXwe0D$Vkv zxN%-wgupX6AoN0ogRnaW7G69Rm!v)5Z*AQ>#u{jWYjRz7sWYoCV>ruwbfpSgsdxor z8AYbxYsROt@{{3mRX!ogv4(8K%9n70Q|01$CpdQ`(t#B+H0ksW#}P6ARelVE#lz@o zp#KB+;6iSPW(J1mp@56pNoh->Q_5B4XW2W$kp+0)f>W1%(HDOBxoYH>{>c|R7r=5N z_+`=-QHno8zEO(Dtam$QvK*_5QffmXmj0CiIpM{l0qyabjz^*P=%uZ7W?|U_D*b|% zPA{$+Ll-Tep|V4L@mR)nQeVwPR*?xe8buE1p;Xt+wv6&j<;w}8QA^;wx0GnkHk{rN z<%M))l{l2yKO8xLYH_A*JdKvC@<%?^(jQTM$6s)PoIm2$Iiqi;H2RpOA0hK#(COo)z^Rj3U*an+Zds|c{S(UVNALBRKpA+Ae~h0AM0`k+9KJ~u$&nmu z=-Dpn22~}<5yuU!u7wf4z%!NCXztAGJLV~9o6BDYaH~vd`Rfebz&oaNMqi(g-^T~g zHgxwhAMZu)YI`ncimL1PR(isbUEY<^YpiGdAmb*|SM(c=HdqLd-+m)`iTJ%+D3%O!cFJ6FMRKKRz?9L;wH) diff --git a/VideoTranscoder/metadata/V1Beta1/Services.php b/VideoTranscoder/metadata/V1Beta1/Services.php deleted file mode 100644 index 7df47caa0b09..000000000000 --- a/VideoTranscoder/metadata/V1Beta1/Services.php +++ /dev/null @@ -1,82 +0,0 @@ -internalAddGeneratedFile( - ' -Ž -4google/cloud/video/transcoder/v1beta1/services.proto%google.cloud.video.transcoder.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto5google/cloud/video/transcoder/v1beta1/resources.protogoogle/protobuf/empty.proto"‹ -CreateJobRequest9 -parent ( B)àAúA# -!locations.googleapis.com/Location< -job ( 2*.google.cloud.video.transcoder.v1beta1.JobBàA"s -ListJobsRequest9 -parent ( B)àAúA# -!locations.googleapis.com/Location - page_size ( - -page_token ( "D - GetJobRequest3 -name ( B%àAúA -transcoder.googleapis.com/Job"G -DeleteJobRequest3 -name ( B%àAúA -transcoder.googleapis.com/Job"e -ListJobsResponse8 -jobs ( 2*.google.cloud.video.transcoder.v1beta1.Job -next_page_token ( " -CreateJobTemplateRequest9 -parent ( B)àAúA# -!locations.googleapis.com/LocationM - job_template ( 22.google.cloud.video.transcoder.v1beta1.JobTemplateBàA -job_template_id ( BàA"{ -ListJobTemplatesRequest9 -parent ( B)àAúA# -!locations.googleapis.com/Location - page_size ( - -page_token ( "T -GetJobTemplateRequest; -name ( B-àAúA\' -%transcoder.googleapis.com/JobTemplate"W -DeleteJobTemplateRequest; -name ( B-àAúA\' -%transcoder.googleapis.com/JobTemplate"~ -ListJobTemplatesResponseI - job_templates ( 22.google.cloud.video.transcoder.v1beta1.JobTemplate -next_page_token ( 2ƒ -TranscoderService¹ - CreateJob7.google.cloud.video.transcoder.v1beta1.CreateJobRequest*.google.cloud.video.transcoder.v1beta1.Job"G‚Óä“4"-/v1beta1/{parent=projects/*/locations/*}/jobs:jobÚA -parent,job» -ListJobs6.google.cloud.video.transcoder.v1beta1.ListJobsRequest7.google.cloud.video.transcoder.v1beta1.ListJobsResponse">‚Óä“/-/v1beta1/{parent=projects/*/locations/*}/jobsÚAparent¨ -GetJob4.google.cloud.video.transcoder.v1beta1.GetJobRequest*.google.cloud.video.transcoder.v1beta1.Job"<‚Óä“/-/v1beta1/{name=projects/*/locations/*/jobs/*}ÚAnameš - DeleteJob7.google.cloud.video.transcoder.v1beta1.DeleteJobRequest.google.protobuf.Empty"<‚Óä“/*-/v1beta1/{name=projects/*/locations/*/jobs/*}ÚAnameû -CreateJobTemplate?.google.cloud.video.transcoder.v1beta1.CreateJobTemplateRequest2.google.cloud.video.transcoder.v1beta1.JobTemplate"q‚Óä“E"5/v1beta1/{parent=projects/*/locations/*}/jobTemplates: job_templateÚA#parent,job_template,job_template_idÛ -ListJobTemplates>.google.cloud.video.transcoder.v1beta1.ListJobTemplatesRequest?.google.cloud.video.transcoder.v1beta1.ListJobTemplatesResponse"F‚Óä“75/v1beta1/{parent=projects/*/locations/*}/jobTemplatesÚAparentÈ -GetJobTemplate<.google.cloud.video.transcoder.v1beta1.GetJobTemplateRequest2.google.cloud.video.transcoder.v1beta1.JobTemplate"D‚Óä“75/v1beta1/{name=projects/*/locations/*/jobTemplates/*}ÚAname² -DeleteJobTemplate?.google.cloud.video.transcoder.v1beta1.DeleteJobTemplateRequest.google.protobuf.Empty"D‚Óä“7*5/v1beta1/{name=projects/*/locations/*/jobTemplates/*}ÚAnamePˆÊAtranscoder.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB -)com.google.cloud.video.transcoder.v1beta1B ServicesProtoPZOgoogle.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1;transcoderbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/VideoTranscoder/owlbot.py b/VideoTranscoder/owlbot.py index 859fb6a5c361..78e3067cec6e 100644 --- a/VideoTranscoder/owlbot.py +++ b/VideoTranscoder/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -47,29 +41,16 @@ + "\n", '') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/VideoTranscoder/src/V1/AdBreak.php b/VideoTranscoder/src/V1/AdBreak.php index 2ab24a54f172..9cadeb444fd8 100644 --- a/VideoTranscoder/src/V1/AdBreak.php +++ b/VideoTranscoder/src/V1/AdBreak.php @@ -21,7 +21,7 @@ class AdBreak extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; */ - private $start_time_offset = null; + protected $start_time_offset = null; /** * Constructor. diff --git a/VideoTranscoder/src/V1/AudioStream.php b/VideoTranscoder/src/V1/AudioStream.php index c07a5db7b3ce..7cf6be6554b6 100644 --- a/VideoTranscoder/src/V1/AudioStream.php +++ b/VideoTranscoder/src/V1/AudioStream.php @@ -27,20 +27,20 @@ class AudioStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string codec = 1; */ - private $codec = ''; + protected $codec = ''; /** * Required. Audio bitrate in bits per second. Must be between 1 and * 10,000,000. * * Generated from protobuf field int32 bitrate_bps = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $bitrate_bps = 0; + protected $bitrate_bps = 0; /** * Number of audio channels. Must be between 1 and 6. The default is 2. * * Generated from protobuf field int32 channel_count = 3; */ - private $channel_count = 0; + protected $channel_count = 0; /** * A list of channel names specifying layout of the audio channels. * This only affects the metadata embedded in the container headers, if @@ -67,7 +67,7 @@ class AudioStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 sample_rate_hertz = 6; */ - private $sample_rate_hertz = 0; + protected $sample_rate_hertz = 0; /** * The BCP-47 language code, such as `en-US` or `sr-Latn`. For more * information, see @@ -76,14 +76,14 @@ class AudioStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string language_code = 7; */ - private $language_code = ''; + protected $language_code = ''; /** * The name for this particular audio stream that * will be added to the HLS/DASH manifest. Not supported in MP4 files. * * Generated from protobuf field string display_name = 8; */ - private $display_name = ''; + protected $display_name = ''; /** * Constructor. diff --git a/VideoTranscoder/src/V1/AudioStream/AudioMapping.php b/VideoTranscoder/src/V1/AudioStream/AudioMapping.php index 1f281788322d..217f042283b1 100644 --- a/VideoTranscoder/src/V1/AudioStream/AudioMapping.php +++ b/VideoTranscoder/src/V1/AudioStream/AudioMapping.php @@ -21,38 +21,38 @@ class AudioMapping extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string atom_key = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $atom_key = ''; + protected $atom_key = ''; /** * Required. The `Input.key` that identifies the input file. * * Generated from protobuf field string input_key = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $input_key = ''; + protected $input_key = ''; /** * Required. The zero-based index of the track in the input file. * * Generated from protobuf field int32 input_track = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $input_track = 0; + protected $input_track = 0; /** * Required. The zero-based index of the channel in the input audio stream. * * Generated from protobuf field int32 input_channel = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $input_channel = 0; + protected $input_channel = 0; /** * Required. The zero-based index of the channel in the output audio stream. * * Generated from protobuf field int32 output_channel = 5 [(.google.api.field_behavior) = REQUIRED]; */ - private $output_channel = 0; + protected $output_channel = 0; /** * Audio volume control in dB. Negative values decrease volume, * positive values increase. The default is 0. * * Generated from protobuf field double gain_db = 6; */ - private $gain_db = 0.0; + protected $gain_db = 0.0; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Client/TranscoderServiceClient.php b/VideoTranscoder/src/V1/Client/TranscoderServiceClient.php index c97f5e6d6299..92e40fb9dd7b 100644 --- a/VideoTranscoder/src/V1/Client/TranscoderServiceClient.php +++ b/VideoTranscoder/src/V1/Client/TranscoderServiceClient.php @@ -1,6 +1,6 @@ string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Parameters for creating transcoding job. * * Generated from protobuf field .google.cloud.video.transcoder.v1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $job = null; + protected $job = null; /** * @param string $parent Required. The parent location to create and process this job. diff --git a/VideoTranscoder/src/V1/CreateJobTemplateRequest.php b/VideoTranscoder/src/V1/CreateJobTemplateRequest.php index 1676eac5c0c7..2259a64b8917 100644 --- a/VideoTranscoder/src/V1/CreateJobTemplateRequest.php +++ b/VideoTranscoder/src/V1/CreateJobTemplateRequest.php @@ -21,13 +21,13 @@ class CreateJobTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Parameters for creating job template. * * Generated from protobuf field .google.cloud.video.transcoder.v1.JobTemplate job_template = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $job_template = null; + protected $job_template = null; /** * Required. The ID to use for the job template, which will become the final * component of the job template's resource name. @@ -36,7 +36,7 @@ class CreateJobTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string job_template_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $job_template_id = ''; + protected $job_template_id = ''; /** * @param string $parent Required. The parent location to create this job template. diff --git a/VideoTranscoder/src/V1/DeleteJobRequest.php b/VideoTranscoder/src/V1/DeleteJobRequest.php index 1602e061a1ea..56bf79ae59c4 100644 --- a/VideoTranscoder/src/V1/DeleteJobRequest.php +++ b/VideoTranscoder/src/V1/DeleteJobRequest.php @@ -21,14 +21,14 @@ class DeleteJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * If set to true, and the job is not found, the request will succeed but no * action will be taken on the server. * * Generated from protobuf field bool allow_missing = 2; */ - private $allow_missing = false; + protected $allow_missing = false; /** * @param string $name Required. The name of the job to delete. diff --git a/VideoTranscoder/src/V1/DeleteJobTemplateRequest.php b/VideoTranscoder/src/V1/DeleteJobTemplateRequest.php index f73cfa6d8021..a7db529776b4 100644 --- a/VideoTranscoder/src/V1/DeleteJobTemplateRequest.php +++ b/VideoTranscoder/src/V1/DeleteJobTemplateRequest.php @@ -21,14 +21,14 @@ class DeleteJobTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * If set to true, and the job template is not found, the request will succeed * but no action will be taken on the server. * * Generated from protobuf field bool allow_missing = 2; */ - private $allow_missing = false; + protected $allow_missing = false; /** * @param string $name Required. The name of the job template to delete. diff --git a/VideoTranscoder/src/V1/EditAtom.php b/VideoTranscoder/src/V1/EditAtom.php index e1d9cbb1679e..42921c0de759 100644 --- a/VideoTranscoder/src/V1/EditAtom.php +++ b/VideoTranscoder/src/V1/EditAtom.php @@ -21,7 +21,7 @@ class EditAtom extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 1; */ - private $key = ''; + protected $key = ''; /** * List of `Input.key`s identifying files that should be used in this atom. * The listed `inputs` must have the same timeline. @@ -36,14 +36,14 @@ class EditAtom extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration end_time_offset = 3; */ - private $end_time_offset = null; + protected $end_time_offset = null; /** * Start time in seconds for the atom, relative to the input file timeline. * The default is `0s`. * * Generated from protobuf field .google.protobuf.Duration start_time_offset = 4; */ - private $start_time_offset = null; + protected $start_time_offset = null; /** * Constructor. diff --git a/VideoTranscoder/src/V1/ElementaryStream.php b/VideoTranscoder/src/V1/ElementaryStream.php index 188e44d2dda6..6660485d8e24 100644 --- a/VideoTranscoder/src/V1/ElementaryStream.php +++ b/VideoTranscoder/src/V1/ElementaryStream.php @@ -22,7 +22,7 @@ class ElementaryStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 4; */ - private $key = ''; + protected $key = ''; protected $elementary_stream; /** diff --git a/VideoTranscoder/src/V1/Encryption.php b/VideoTranscoder/src/V1/Encryption.php index 9834889fc69c..a9d3c1ca80e5 100644 --- a/VideoTranscoder/src/V1/Encryption.php +++ b/VideoTranscoder/src/V1/Encryption.php @@ -20,14 +20,14 @@ class Encryption extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 6 [(.google.api.field_behavior) = REQUIRED]; */ - private $id = ''; + protected $id = ''; /** * Required. DRM system(s) to use; at least one must be specified. If a * DRM system is omitted, it is considered disabled. * * Generated from protobuf field .google.cloud.video.transcoder.v1.Encryption.DrmSystems drm_systems = 8 [(.google.api.field_behavior) = REQUIRED]; */ - private $drm_systems = null; + protected $drm_systems = null; protected $encryption_mode; protected $secret_source; diff --git a/VideoTranscoder/src/V1/Encryption/DrmSystems.php b/VideoTranscoder/src/V1/Encryption/DrmSystems.php index bee5411e504a..62d8da0fc05e 100644 --- a/VideoTranscoder/src/V1/Encryption/DrmSystems.php +++ b/VideoTranscoder/src/V1/Encryption/DrmSystems.php @@ -20,25 +20,25 @@ class DrmSystems extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.Encryption.Widevine widevine = 1; */ - private $widevine = null; + protected $widevine = null; /** * Fairplay configuration. * * Generated from protobuf field .google.cloud.video.transcoder.v1.Encryption.Fairplay fairplay = 2; */ - private $fairplay = null; + protected $fairplay = null; /** * Playready configuration. * * Generated from protobuf field .google.cloud.video.transcoder.v1.Encryption.Playready playready = 3; */ - private $playready = null; + protected $playready = null; /** * Clearkey configuration. * * Generated from protobuf field .google.cloud.video.transcoder.v1.Encryption.Clearkey clearkey = 4; */ - private $clearkey = null; + protected $clearkey = null; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Encryption/MpegCommonEncryption.php b/VideoTranscoder/src/V1/Encryption/MpegCommonEncryption.php index 1aaf4c15ee35..9153d6466a31 100644 --- a/VideoTranscoder/src/V1/Encryption/MpegCommonEncryption.php +++ b/VideoTranscoder/src/V1/Encryption/MpegCommonEncryption.php @@ -23,7 +23,7 @@ class MpegCommonEncryption extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string scheme = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $scheme = ''; + protected $scheme = ''; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Encryption/SecretManagerSource.php b/VideoTranscoder/src/V1/Encryption/SecretManagerSource.php index 1b077c83cb48..8702b90b31de 100644 --- a/VideoTranscoder/src/V1/Encryption/SecretManagerSource.php +++ b/VideoTranscoder/src/V1/Encryption/SecretManagerSource.php @@ -24,7 +24,7 @@ class SecretManagerSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string secret_version = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $secret_version = ''; + protected $secret_version = ''; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Gapic/TranscoderServiceGapicClient.php b/VideoTranscoder/src/V1/Gapic/TranscoderServiceGapicClient.php deleted file mode 100644 index 3ab7f1c345a5..000000000000 --- a/VideoTranscoder/src/V1/Gapic/TranscoderServiceGapicClient.php +++ /dev/null @@ -1,760 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $job = new Job(); - * $response = $transcoderServiceClient->createJob($formattedParent, $job); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Video\Transcoder\V1\Client\TranscoderServiceClient}. - */ -class TranscoderServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.video.transcoder.v1.TranscoderService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'transcoder.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'transcoder.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $jobNameTemplate; - - private static $jobTemplateNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/transcoder_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/transcoder_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/transcoder_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/transcoder_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getJobNameTemplate() - { - if (self::$jobNameTemplate == null) { - self::$jobNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobs/{job}'); - } - - return self::$jobNameTemplate; - } - - private static function getJobTemplateNameTemplate() - { - if (self::$jobTemplateNameTemplate == null) { - self::$jobTemplateNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobTemplates/{job_template}'); - } - - return self::$jobTemplateNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'job' => self::getJobNameTemplate(), - 'jobTemplate' => self::getJobTemplateNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a job - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * - * @return string The formatted job resource. - */ - public static function jobName($project, $location, $job) - { - return self::getJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a job_template - * resource. - * - * @param string $project - * @param string $location - * @param string $jobTemplate - * - * @return string The formatted job_template resource. - */ - public static function jobTemplateName($project, $location, $jobTemplate) - { - return self::getJobTemplateNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'job_template' => $jobTemplate, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - job: projects/{project}/locations/{location}/jobs/{job} - * - jobTemplate: projects/{project}/locations/{location}/jobTemplates/{job_template} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'transcoder.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a job in the specified region. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedParent = $transcoderServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $job = new Job(); - * $response = $transcoderServiceClient->createJob($formattedParent, $job); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent location to create and process this job. - * Format: `projects/{project}/locations/{location}` - * @param Job $job Required. Parameters for creating transcoding job. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Video\Transcoder\V1\Job - * - * @throws ApiException if the remote call fails - */ - public function createJob($parent, $job, array $optionalArgs = []) - { - $request = new CreateJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setJob($job); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateJob', Job::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a job template in the specified region. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedParent = $transcoderServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $jobTemplate = new JobTemplate(); - * $jobTemplateId = 'job_template_id'; - * $response = $transcoderServiceClient->createJobTemplate($formattedParent, $jobTemplate, $jobTemplateId); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent location to create this job template. - * Format: `projects/{project}/locations/{location}` - * @param JobTemplate $jobTemplate Required. Parameters for creating job template. - * @param string $jobTemplateId Required. The ID to use for the job template, which will become the final - * component of the job template's resource name. - * - * This value should be 4-63 characters, and valid characters must match the - * regular expression `[a-zA-Z][a-zA-Z0-9_-]*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Video\Transcoder\V1\JobTemplate - * - * @throws ApiException if the remote call fails - */ - public function createJobTemplate($parent, $jobTemplate, $jobTemplateId, array $optionalArgs = []) - { - $request = new CreateJobTemplateRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setJobTemplate($jobTemplate); - $request->setJobTemplateId($jobTemplateId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateJobTemplate', JobTemplate::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a job. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedName = $transcoderServiceClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - * $transcoderServiceClient->deleteJob($formattedName); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the job to delete. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $allowMissing - * If set to true, and the job is not found, the request will succeed but no - * action will be taken on the server. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteJob($name, array $optionalArgs = []) - { - $request = new DeleteJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteJob', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a job template. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedName = $transcoderServiceClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - * $transcoderServiceClient->deleteJobTemplate($formattedName); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the job template to delete. - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * @param array $optionalArgs { - * Optional. - * - * @type bool $allowMissing - * If set to true, and the job template is not found, the request will succeed - * but no action will be taken on the server. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteJobTemplate($name, array $optionalArgs = []) - { - $request = new DeleteJobTemplateRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteJobTemplate', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the job data. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedName = $transcoderServiceClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - * $response = $transcoderServiceClient->getJob($formattedName); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the job to retrieve. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Video\Transcoder\V1\Job - * - * @throws ApiException if the remote call fails - */ - public function getJob($name, array $optionalArgs = []) - { - $request = new GetJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetJob', Job::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the job template data. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedName = $transcoderServiceClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - * $response = $transcoderServiceClient->getJobTemplate($formattedName); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the job template to retrieve. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Video\Transcoder\V1\JobTemplate - * - * @throws ApiException if the remote call fails - */ - public function getJobTemplate($name, array $optionalArgs = []) - { - $request = new GetJobTemplateRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetJobTemplate', JobTemplate::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists job templates in the specified region. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedParent = $transcoderServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $transcoderServiceClient->listJobTemplates($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $transcoderServiceClient->listJobTemplates($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent location from which to retrieve the collection of job - * templates. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * The filter expression, following the syntax outlined in - * https://google.aip.dev/160. - * @type string $orderBy - * One or more fields to compare and use to sort the output. - * See https://google.aip.dev/132#ordering. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listJobTemplates($parent, array $optionalArgs = []) - { - $request = new ListJobTemplatesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListJobTemplates', $optionalArgs, ListJobTemplatesResponse::class, $request); - } - - /** - * Lists jobs in the specified region. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedParent = $transcoderServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $transcoderServiceClient->listJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $transcoderServiceClient->listJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * The filter expression, following the syntax outlined in - * https://google.aip.dev/160. - * @type string $orderBy - * One or more fields to compare and use to sort the output. - * See https://google.aip.dev/132#ordering. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listJobs($parent, array $optionalArgs = []) - { - $request = new ListJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListJobs', $optionalArgs, ListJobsResponse::class, $request); - } -} diff --git a/VideoTranscoder/src/V1/GetJobRequest.php b/VideoTranscoder/src/V1/GetJobRequest.php index 215587d12147..d84bf513d425 100644 --- a/VideoTranscoder/src/V1/GetJobRequest.php +++ b/VideoTranscoder/src/V1/GetJobRequest.php @@ -21,7 +21,7 @@ class GetJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the job to retrieve. diff --git a/VideoTranscoder/src/V1/GetJobTemplateRequest.php b/VideoTranscoder/src/V1/GetJobTemplateRequest.php index ea6d0765a69e..e9a034eaf217 100644 --- a/VideoTranscoder/src/V1/GetJobTemplateRequest.php +++ b/VideoTranscoder/src/V1/GetJobTemplateRequest.php @@ -22,7 +22,7 @@ class GetJobTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the job template to retrieve. diff --git a/VideoTranscoder/src/V1/Input.php b/VideoTranscoder/src/V1/Input.php index 9c7b095164b5..3c19c7ccc6a5 100644 --- a/VideoTranscoder/src/V1/Input.php +++ b/VideoTranscoder/src/V1/Input.php @@ -21,7 +21,7 @@ class Input extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 1; */ - private $key = ''; + protected $key = ''; /** * URI of the media. Input files must be at least 5 seconds in duration and * stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). @@ -31,13 +31,13 @@ class Input extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 2; */ - private $uri = ''; + protected $uri = ''; /** * Preprocessing configurations. * * Generated from protobuf field .google.cloud.video.transcoder.v1.PreprocessingConfig preprocessing_config = 3; */ - private $preprocessing_config = null; + protected $preprocessing_config = null; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Job.php b/VideoTranscoder/src/V1/Job.php index f34c9eee4c94..b4d69eee8832 100644 --- a/VideoTranscoder/src/V1/Job.php +++ b/VideoTranscoder/src/V1/Job.php @@ -21,7 +21,7 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Input only. Specify the `input_uri` to populate empty `uri` fields in each * element of `Job.config.inputs` or `JobTemplate.config.inputs` when using @@ -32,7 +32,7 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string input_uri = 2 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $input_uri = ''; + protected $input_uri = ''; /** * Input only. Specify the `output_uri` to populate an empty * `Job.config.output.uri` or `JobTemplate.config.output.uri` when using @@ -42,31 +42,31 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string output_uri = 3 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $output_uri = ''; + protected $output_uri = ''; /** * Output only. The current state of the job. * * Generated from protobuf field .google.cloud.video.transcoder.v1.Job.ProcessingState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The time the job was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the transcoding started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The time the transcoding finished. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Job time to live value in days, which will be effective after job * completion. Job should be deleted automatically after the given TTL. Enter @@ -74,7 +74,7 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 ttl_after_completion_days = 15; */ - private $ttl_after_completion_days = 0; + protected $ttl_after_completion_days = 0; /** * The labels associated with this job. You can use these to organize and * group your jobs. @@ -88,14 +88,14 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status error = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * The processing mode of the job. * The default is `PROCESSING_MODE_INTERACTIVE`. * * Generated from protobuf field .google.cloud.video.transcoder.v1.Job.ProcessingMode mode = 20; */ - private $mode = 0; + protected $mode = 0; /** * The processing priority of a batch job. * This field can only be set for batch mode jobs. The default value is 0. @@ -104,14 +104,14 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 batch_mode_priority = 21; */ - private $batch_mode_priority = 0; + protected $batch_mode_priority = 0; /** * Optional. The optimization strategy of the job. The default is * `AUTODETECT`. * * Generated from protobuf field .google.cloud.video.transcoder.v1.Job.OptimizationStrategy optimization = 22 [(.google.api.field_behavior) = OPTIONAL]; */ - private $optimization = 0; + protected $optimization = 0; protected $job_config; /** diff --git a/VideoTranscoder/src/V1/JobConfig.php b/VideoTranscoder/src/V1/JobConfig.php index 9739c4473c2c..70d6c9f15aa5 100644 --- a/VideoTranscoder/src/V1/JobConfig.php +++ b/VideoTranscoder/src/V1/JobConfig.php @@ -51,7 +51,7 @@ class JobConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.Output output = 6; */ - private $output = null; + protected $output = null; /** * List of ad breaks. Specifies where to insert ad break tags in the output * manifests. @@ -64,7 +64,7 @@ class JobConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.PubsubDestination pubsub_destination = 8; */ - private $pubsub_destination = null; + protected $pubsub_destination = null; /** * List of output sprite sheets. * Spritesheets require at least one VideoStream in the Jobconfig. diff --git a/VideoTranscoder/src/V1/JobTemplate.php b/VideoTranscoder/src/V1/JobTemplate.php index ca90b5ce1737..1cf56319089e 100644 --- a/VideoTranscoder/src/V1/JobTemplate.php +++ b/VideoTranscoder/src/V1/JobTemplate.php @@ -22,13 +22,13 @@ class JobTemplate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The configuration for this template. * * Generated from protobuf field .google.cloud.video.transcoder.v1.JobConfig config = 2; */ - private $config = null; + protected $config = null; /** * The labels associated with this job template. You can use these to organize * and group your job templates. diff --git a/VideoTranscoder/src/V1/ListJobTemplatesRequest.php b/VideoTranscoder/src/V1/ListJobTemplatesRequest.php index 50c1cf3efe33..9a3f102490be 100644 --- a/VideoTranscoder/src/V1/ListJobTemplatesRequest.php +++ b/VideoTranscoder/src/V1/ListJobTemplatesRequest.php @@ -21,34 +21,34 @@ class ListJobTemplatesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of items to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The `next_page_token` value returned from a previous List request, if * any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The filter expression, following the syntax outlined in * https://google.aip.dev/160. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * One or more fields to compare and use to sort the output. * See https://google.aip.dev/132#ordering. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent location from which to retrieve the collection of job diff --git a/VideoTranscoder/src/V1/ListJobTemplatesResponse.php b/VideoTranscoder/src/V1/ListJobTemplatesResponse.php index 0c17408ca05e..3162f2362bd5 100644 --- a/VideoTranscoder/src/V1/ListJobTemplatesResponse.php +++ b/VideoTranscoder/src/V1/ListJobTemplatesResponse.php @@ -26,7 +26,7 @@ class ListJobTemplatesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * List of regions that could not be reached. * diff --git a/VideoTranscoder/src/V1/ListJobsRequest.php b/VideoTranscoder/src/V1/ListJobsRequest.php index 7911664a0f21..62bf0d1d56a7 100644 --- a/VideoTranscoder/src/V1/ListJobsRequest.php +++ b/VideoTranscoder/src/V1/ListJobsRequest.php @@ -21,34 +21,34 @@ class ListJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of items to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The `next_page_token` value returned from a previous List request, if * any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The filter expression, following the syntax outlined in * https://google.aip.dev/160. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * One or more fields to compare and use to sort the output. * See https://google.aip.dev/132#ordering. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. Format: `projects/{project}/locations/{location}` diff --git a/VideoTranscoder/src/V1/ListJobsResponse.php b/VideoTranscoder/src/V1/ListJobsResponse.php index 9ab1ce66ce56..0049a9825e28 100644 --- a/VideoTranscoder/src/V1/ListJobsResponse.php +++ b/VideoTranscoder/src/V1/ListJobsResponse.php @@ -26,7 +26,7 @@ class ListJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * List of regions that could not be reached. * diff --git a/VideoTranscoder/src/V1/Manifest.php b/VideoTranscoder/src/V1/Manifest.php index d95eefc4ffdc..875edbe8fd45 100644 --- a/VideoTranscoder/src/V1/Manifest.php +++ b/VideoTranscoder/src/V1/Manifest.php @@ -21,13 +21,13 @@ class Manifest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string file_name = 1; */ - private $file_name = ''; + protected $file_name = ''; /** * Required. Type of the manifest. * * Generated from protobuf field .google.cloud.video.transcoder.v1.Manifest.ManifestType type = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $type = 0; + protected $type = 0; /** * Required. List of user given `MuxStream.key`s that should appear in this * manifest. diff --git a/VideoTranscoder/src/V1/Manifest/DashConfig.php b/VideoTranscoder/src/V1/Manifest/DashConfig.php index 4f0005cebb8d..17754c1ae37f 100644 --- a/VideoTranscoder/src/V1/Manifest/DashConfig.php +++ b/VideoTranscoder/src/V1/Manifest/DashConfig.php @@ -21,7 +21,7 @@ class DashConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.Manifest.DashConfig.SegmentReferenceScheme segment_reference_scheme = 1; */ - private $segment_reference_scheme = 0; + protected $segment_reference_scheme = 0; /** * Constructor. diff --git a/VideoTranscoder/src/V1/MuxStream.php b/VideoTranscoder/src/V1/MuxStream.php index dac81d4217a3..fbd5e7f4e19d 100644 --- a/VideoTranscoder/src/V1/MuxStream.php +++ b/VideoTranscoder/src/V1/MuxStream.php @@ -21,7 +21,7 @@ class MuxStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 1; */ - private $key = ''; + protected $key = ''; /** * The name of the generated file. The default is `MuxStream.key` with the * extension suffix corresponding to the `MuxStream.container`. @@ -30,7 +30,7 @@ class MuxStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string file_name = 2; */ - private $file_name = ''; + protected $file_name = ''; /** * The container format. The default is `mp4` * Supported container formats: @@ -44,7 +44,7 @@ class MuxStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string container = 3; */ - private $container = ''; + protected $container = ''; /** * List of `ElementaryStream.key`s multiplexed in this stream. * @@ -56,14 +56,14 @@ class MuxStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.SegmentSettings segment_settings = 5; */ - private $segment_settings = null; + protected $segment_settings = null; /** * Identifier of the encryption configuration to use. If omitted, output will * be unencrypted. * * Generated from protobuf field string encryption_id = 7; */ - private $encryption_id = ''; + protected $encryption_id = ''; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Output.php b/VideoTranscoder/src/V1/Output.php index e4b5e8eab098..e3203d1eb0bf 100644 --- a/VideoTranscoder/src/V1/Output.php +++ b/VideoTranscoder/src/V1/Output.php @@ -23,7 +23,7 @@ class Output extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 1; */ - private $uri = ''; + protected $uri = ''; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Overlay.php b/VideoTranscoder/src/V1/Overlay.php index 331c6869c880..fa19100a1a1e 100644 --- a/VideoTranscoder/src/V1/Overlay.php +++ b/VideoTranscoder/src/V1/Overlay.php @@ -20,7 +20,7 @@ class Overlay extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.Overlay.Image image = 1; */ - private $image = null; + protected $image = null; /** * List of Animations. The list should be chronological, without any time * overlap. diff --git a/VideoTranscoder/src/V1/Overlay/AnimationEnd.php b/VideoTranscoder/src/V1/Overlay/AnimationEnd.php index cf935e88c205..66ca645155d9 100644 --- a/VideoTranscoder/src/V1/Overlay/AnimationEnd.php +++ b/VideoTranscoder/src/V1/Overlay/AnimationEnd.php @@ -22,7 +22,7 @@ class AnimationEnd extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; */ - private $start_time_offset = null; + protected $start_time_offset = null; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Overlay/AnimationFade.php b/VideoTranscoder/src/V1/Overlay/AnimationFade.php index ad2cfd7b7ff5..75eb59bdcfd0 100644 --- a/VideoTranscoder/src/V1/Overlay/AnimationFade.php +++ b/VideoTranscoder/src/V1/Overlay/AnimationFade.php @@ -20,7 +20,7 @@ class AnimationFade extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.Overlay.FadeType fade_type = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $fade_type = 0; + protected $fade_type = 0; /** * Normalized coordinates based on output video resolution. Valid * values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay @@ -30,20 +30,20 @@ class AnimationFade extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate xy = 2; */ - private $xy = null; + protected $xy = null; /** * The time to start the fade animation, in seconds. Default: 0 * * Generated from protobuf field .google.protobuf.Duration start_time_offset = 3; */ - private $start_time_offset = null; + protected $start_time_offset = null; /** * The time to end the fade animation, in seconds. Default: * `start_time_offset` + 1s * * Generated from protobuf field .google.protobuf.Duration end_time_offset = 4; */ - private $end_time_offset = null; + protected $end_time_offset = null; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Overlay/AnimationStatic.php b/VideoTranscoder/src/V1/Overlay/AnimationStatic.php index 2eef686079b4..a81e0befdfd2 100644 --- a/VideoTranscoder/src/V1/Overlay/AnimationStatic.php +++ b/VideoTranscoder/src/V1/Overlay/AnimationStatic.php @@ -24,13 +24,13 @@ class AnimationStatic extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate xy = 1; */ - private $xy = null; + protected $xy = null; /** * The time to start displaying the overlay object, in seconds. Default: 0 * * Generated from protobuf field .google.protobuf.Duration start_time_offset = 2; */ - private $start_time_offset = null; + protected $start_time_offset = null; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Overlay/Image.php b/VideoTranscoder/src/V1/Overlay/Image.php index a1ea9897d065..c5e6710ab465 100644 --- a/VideoTranscoder/src/V1/Overlay/Image.php +++ b/VideoTranscoder/src/V1/Overlay/Image.php @@ -21,7 +21,7 @@ class Image extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $uri = ''; + protected $uri = ''; /** * Normalized image resolution, based on output video resolution. Valid * values: `0.0`–`1.0`. To respect the original image aspect ratio, set @@ -30,14 +30,14 @@ class Image extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate resolution = 2; */ - private $resolution = null; + protected $resolution = null; /** * Target image opacity. Valid values are from `1.0` (solid, default) to * `0.0` (transparent), exclusive. Set this to a value greater than `0.0`. * * Generated from protobuf field double alpha = 3; */ - private $alpha = 0.0; + protected $alpha = 0.0; /** * Constructor. diff --git a/VideoTranscoder/src/V1/Overlay/NormalizedCoordinate.php b/VideoTranscoder/src/V1/Overlay/NormalizedCoordinate.php index 4c822a7c9870..0ccb3468fcbf 100644 --- a/VideoTranscoder/src/V1/Overlay/NormalizedCoordinate.php +++ b/VideoTranscoder/src/V1/Overlay/NormalizedCoordinate.php @@ -20,13 +20,13 @@ class NormalizedCoordinate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double x = 1; */ - private $x = 0.0; + protected $x = 0.0; /** * Normalized y coordinate. * * Generated from protobuf field double y = 2; */ - private $y = 0.0; + protected $y = 0.0; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PreprocessingConfig.php b/VideoTranscoder/src/V1/PreprocessingConfig.php index 1c916d36ab1b..a89acfa1847b 100644 --- a/VideoTranscoder/src/V1/PreprocessingConfig.php +++ b/VideoTranscoder/src/V1/PreprocessingConfig.php @@ -20,43 +20,43 @@ class PreprocessingConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.video.transcoder.v1.PreprocessingConfig.Color color = 1; */ - private $color = null; + protected $color = null; /** * Denoise preprocessing configuration. * * Generated from protobuf field .google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise denoise = 2; */ - private $denoise = null; + protected $denoise = null; /** * Deblock preprocessing configuration. * * Generated from protobuf field .google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock deblock = 3; */ - private $deblock = null; + protected $deblock = null; /** * Audio preprocessing configuration. * * Generated from protobuf field .google.cloud.video.transcoder.v1.PreprocessingConfig.Audio audio = 4; */ - private $audio = null; + protected $audio = null; /** * Specify the video cropping configuration. * * Generated from protobuf field .google.cloud.video.transcoder.v1.PreprocessingConfig.Crop crop = 5; */ - private $crop = null; + protected $crop = null; /** * Specify the video pad filter configuration. * * Generated from protobuf field .google.cloud.video.transcoder.v1.PreprocessingConfig.Pad pad = 6; */ - private $pad = null; + protected $pad = null; /** * Specify the video deinterlace configuration. * * Generated from protobuf field .google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace deinterlace = 7; */ - private $deinterlace = null; + protected $deinterlace = null; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PreprocessingConfig/Audio.php b/VideoTranscoder/src/V1/PreprocessingConfig/Audio.php index 0ac98b0d6a2f..a03b233f3da4 100644 --- a/VideoTranscoder/src/V1/PreprocessingConfig/Audio.php +++ b/VideoTranscoder/src/V1/PreprocessingConfig/Audio.php @@ -29,21 +29,21 @@ class Audio extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double lufs = 1; */ - private $lufs = 0.0; + protected $lufs = 0.0; /** * Enable boosting high frequency components. The default is `false`. * **Note:** This field is not supported. * * Generated from protobuf field bool high_boost = 2; */ - private $high_boost = false; + protected $high_boost = false; /** * Enable boosting low frequency components. The default is `false`. * **Note:** This field is not supported. * * Generated from protobuf field bool low_boost = 3; */ - private $low_boost = false; + protected $low_boost = false; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PreprocessingConfig/Color.php b/VideoTranscoder/src/V1/PreprocessingConfig/Color.php index 2afef65b693c..375858146ec4 100644 --- a/VideoTranscoder/src/V1/PreprocessingConfig/Color.php +++ b/VideoTranscoder/src/V1/PreprocessingConfig/Color.php @@ -23,7 +23,7 @@ class Color extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double saturation = 1; */ - private $saturation = 0.0; + protected $saturation = 0.0; /** * Control black and white contrast of the video. Enter a value between -1 * and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no @@ -31,7 +31,7 @@ class Color extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double contrast = 2; */ - private $contrast = 0.0; + protected $contrast = 0.0; /** * Control brightness of the video. Enter a value between -1 and 1, where -1 * is minimum brightness and 1 is maximum brightness. 0 is no change. The @@ -39,7 +39,7 @@ class Color extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double brightness = 3; */ - private $brightness = 0.0; + protected $brightness = 0.0; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PreprocessingConfig/Crop.php b/VideoTranscoder/src/V1/PreprocessingConfig/Crop.php index 0e38e4fa0a3b..e7ba1c50ebf2 100644 --- a/VideoTranscoder/src/V1/PreprocessingConfig/Crop.php +++ b/VideoTranscoder/src/V1/PreprocessingConfig/Crop.php @@ -21,25 +21,25 @@ class Crop extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 top_pixels = 1; */ - private $top_pixels = 0; + protected $top_pixels = 0; /** * The number of pixels to crop from the bottom. The default is 0. * * Generated from protobuf field int32 bottom_pixels = 2; */ - private $bottom_pixels = 0; + protected $bottom_pixels = 0; /** * The number of pixels to crop from the left. The default is 0. * * Generated from protobuf field int32 left_pixels = 3; */ - private $left_pixels = 0; + protected $left_pixels = 0; /** * The number of pixels to crop from the right. The default is 0. * * Generated from protobuf field int32 right_pixels = 4; */ - private $right_pixels = 0; + protected $right_pixels = 0; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PreprocessingConfig/Deblock.php b/VideoTranscoder/src/V1/PreprocessingConfig/Deblock.php index aef51b2f08b7..8bdcf418bf38 100644 --- a/VideoTranscoder/src/V1/PreprocessingConfig/Deblock.php +++ b/VideoTranscoder/src/V1/PreprocessingConfig/Deblock.php @@ -23,13 +23,13 @@ class Deblock extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double strength = 1; */ - private $strength = 0.0; + protected $strength = 0.0; /** * Enable deblocker. The default is `false`. * * Generated from protobuf field bool enabled = 2; */ - private $enabled = false; + protected $enabled = false; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PreprocessingConfig/Deinterlace/BwdifConfig.php b/VideoTranscoder/src/V1/PreprocessingConfig/Deinterlace/BwdifConfig.php index a66e86ab8681..f2ae36873937 100644 --- a/VideoTranscoder/src/V1/PreprocessingConfig/Deinterlace/BwdifConfig.php +++ b/VideoTranscoder/src/V1/PreprocessingConfig/Deinterlace/BwdifConfig.php @@ -24,7 +24,7 @@ class BwdifConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string mode = 1; */ - private $mode = ''; + protected $mode = ''; /** * The picture field parity assumed for the input interlaced video. * The default is `auto`. @@ -35,14 +35,14 @@ class BwdifConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parity = 2; */ - private $parity = ''; + protected $parity = ''; /** * Deinterlace all frames rather than just the frames identified as * interlaced. The default is `false`. * * Generated from protobuf field bool deinterlace_all_frames = 3; */ - private $deinterlace_all_frames = false; + protected $deinterlace_all_frames = false; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PreprocessingConfig/Deinterlace/YadifConfig.php b/VideoTranscoder/src/V1/PreprocessingConfig/Deinterlace/YadifConfig.php index 944ae8a48128..d48064f07029 100644 --- a/VideoTranscoder/src/V1/PreprocessingConfig/Deinterlace/YadifConfig.php +++ b/VideoTranscoder/src/V1/PreprocessingConfig/Deinterlace/YadifConfig.php @@ -24,14 +24,14 @@ class YadifConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string mode = 1; */ - private $mode = ''; + protected $mode = ''; /** * Disable spacial interlacing. * The default is `false`. * * Generated from protobuf field bool disable_spatial_interlacing = 2; */ - private $disable_spatial_interlacing = false; + protected $disable_spatial_interlacing = false; /** * The picture field parity assumed for the input interlaced video. * The default is `auto`. @@ -42,14 +42,14 @@ class YadifConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parity = 3; */ - private $parity = ''; + protected $parity = ''; /** * Deinterlace all frames rather than just the frames identified as * interlaced. The default is `false`. * * Generated from protobuf field bool deinterlace_all_frames = 4; */ - private $deinterlace_all_frames = false; + protected $deinterlace_all_frames = false; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PreprocessingConfig/Denoise.php b/VideoTranscoder/src/V1/PreprocessingConfig/Denoise.php index 24ffed6901cc..801f7e1a51fe 100644 --- a/VideoTranscoder/src/V1/PreprocessingConfig/Denoise.php +++ b/VideoTranscoder/src/V1/PreprocessingConfig/Denoise.php @@ -22,7 +22,7 @@ class Denoise extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double strength = 1; */ - private $strength = 0.0; + protected $strength = 0.0; /** * Set the denoiser mode. The default is `standard`. * Supported denoiser modes: @@ -31,7 +31,7 @@ class Denoise extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tune = 2; */ - private $tune = ''; + protected $tune = ''; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PreprocessingConfig/Pad.php b/VideoTranscoder/src/V1/PreprocessingConfig/Pad.php index c2b55ff4793c..98ed59c419ae 100644 --- a/VideoTranscoder/src/V1/PreprocessingConfig/Pad.php +++ b/VideoTranscoder/src/V1/PreprocessingConfig/Pad.php @@ -21,25 +21,25 @@ class Pad extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 top_pixels = 1; */ - private $top_pixels = 0; + protected $top_pixels = 0; /** * The number of pixels to add to the bottom. The default is 0. * * Generated from protobuf field int32 bottom_pixels = 2; */ - private $bottom_pixels = 0; + protected $bottom_pixels = 0; /** * The number of pixels to add to the left. The default is 0. * * Generated from protobuf field int32 left_pixels = 3; */ - private $left_pixels = 0; + protected $left_pixels = 0; /** * The number of pixels to add to the right. The default is 0. * * Generated from protobuf field int32 right_pixels = 4; */ - private $right_pixels = 0; + protected $right_pixels = 0; /** * Constructor. diff --git a/VideoTranscoder/src/V1/PubsubDestination.php b/VideoTranscoder/src/V1/PubsubDestination.php index c66d400a0aca..554c0dbf0125 100644 --- a/VideoTranscoder/src/V1/PubsubDestination.php +++ b/VideoTranscoder/src/V1/PubsubDestination.php @@ -21,7 +21,7 @@ class PubsubDestination extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string topic = 1; */ - private $topic = ''; + protected $topic = ''; /** * Constructor. diff --git a/VideoTranscoder/src/V1/SegmentSettings.php b/VideoTranscoder/src/V1/SegmentSettings.php index 6c5717672938..9b21c31ca421 100644 --- a/VideoTranscoder/src/V1/SegmentSettings.php +++ b/VideoTranscoder/src/V1/SegmentSettings.php @@ -23,13 +23,13 @@ class SegmentSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration segment_duration = 1; */ - private $segment_duration = null; + protected $segment_duration = null; /** * Required. Create an individual segment file. The default is `false`. * * Generated from protobuf field bool individual_segments = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $individual_segments = false; + protected $individual_segments = false; /** * Constructor. diff --git a/VideoTranscoder/src/V1/SpriteSheet.php b/VideoTranscoder/src/V1/SpriteSheet.php index ea21ef3a8c01..b0b6c8cfeeca 100644 --- a/VideoTranscoder/src/V1/SpriteSheet.php +++ b/VideoTranscoder/src/V1/SpriteSheet.php @@ -22,7 +22,7 @@ class SpriteSheet extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string format = 1; */ - private $format = ''; + protected $format = ''; /** * Required. File name prefix for the generated sprite sheets. * Each sprite sheet has an incremental 10-digit zero-padded suffix starting @@ -30,7 +30,7 @@ class SpriteSheet extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string file_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $file_prefix = ''; + protected $file_prefix = ''; /** * Required. The width of sprite in pixels. Must be an even integer. To * preserve the source aspect ratio, set the @@ -46,7 +46,7 @@ class SpriteSheet extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 sprite_width_pixels = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $sprite_width_pixels = 0; + protected $sprite_width_pixels = 0; /** * Required. The height of sprite in pixels. Must be an even integer. To * preserve the source aspect ratio, set the @@ -62,14 +62,14 @@ class SpriteSheet extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 sprite_height_pixels = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $sprite_height_pixels = 0; + protected $sprite_height_pixels = 0; /** * The maximum number of sprites per row in a sprite sheet. The default is 0, * which indicates no maximum limit. * * Generated from protobuf field int32 column_count = 5; */ - private $column_count = 0; + protected $column_count = 0; /** * The maximum number of rows per sprite sheet. When the sprite sheet is full, * a new sprite sheet is created. The default is 0, which indicates no maximum @@ -77,14 +77,14 @@ class SpriteSheet extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 row_count = 6; */ - private $row_count = 0; + protected $row_count = 0; /** * Start time in seconds, relative to the output file timeline. Determines the * first sprite to pick. The default is `0s`. * * Generated from protobuf field .google.protobuf.Duration start_time_offset = 7; */ - private $start_time_offset = null; + protected $start_time_offset = null; /** * End time in seconds, relative to the output file timeline. When * `end_time_offset` is not specified, the sprites are generated until the end @@ -92,7 +92,7 @@ class SpriteSheet extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration end_time_offset = 8; */ - private $end_time_offset = null; + protected $end_time_offset = null; /** * The quality of the generated sprite sheet. Enter a value between 1 * and 100, where 1 is the lowest quality and 100 is the highest quality. @@ -101,7 +101,7 @@ class SpriteSheet extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 quality = 11; */ - private $quality = 0; + protected $quality = 0; protected $extraction_strategy; /** diff --git a/VideoTranscoder/src/V1/TextStream.php b/VideoTranscoder/src/V1/TextStream.php index e426c3e6e9bb..e7f56aa9a086 100644 --- a/VideoTranscoder/src/V1/TextStream.php +++ b/VideoTranscoder/src/V1/TextStream.php @@ -26,7 +26,7 @@ class TextStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string codec = 1; */ - private $codec = ''; + protected $codec = ''; /** * The BCP-47 language code, such as `en-US` or `sr-Latn`. For more * information, see @@ -35,7 +35,7 @@ class TextStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string language_code = 2; */ - private $language_code = ''; + protected $language_code = ''; /** * The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`. * @@ -48,7 +48,7 @@ class TextStream extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 4; */ - private $display_name = ''; + protected $display_name = ''; /** * Constructor. diff --git a/VideoTranscoder/src/V1/TextStream/TextMapping.php b/VideoTranscoder/src/V1/TextStream/TextMapping.php index 1cb6ce5c4883..6d58dc17fee9 100644 --- a/VideoTranscoder/src/V1/TextStream/TextMapping.php +++ b/VideoTranscoder/src/V1/TextStream/TextMapping.php @@ -21,19 +21,19 @@ class TextMapping extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string atom_key = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $atom_key = ''; + protected $atom_key = ''; /** * Required. The `Input.key` that identifies the input file. * * Generated from protobuf field string input_key = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $input_key = ''; + protected $input_key = ''; /** * Required. The zero-based index of the track in the input file. * * Generated from protobuf field int32 input_track = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $input_track = 0; + protected $input_track = 0; /** * Constructor. diff --git a/VideoTranscoder/src/V1/TranscoderServiceClient.php b/VideoTranscoder/src/V1/TranscoderServiceClient.php deleted file mode 100644 index 6a513f8a5fd4..000000000000 --- a/VideoTranscoder/src/V1/TranscoderServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.video.transcoder.v1.TranscoderService/CreateJob', - $argument, - ['\Google\Cloud\Video\Transcoder\V1\Job', 'decode'], - $metadata, $options); - } - - /** - * Lists jobs in the specified region. - * @param \Google\Cloud\Video\Transcoder\V1\ListJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListJobs(\Google\Cloud\Video\Transcoder\V1\ListJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1.TranscoderService/ListJobs', - $argument, - ['\Google\Cloud\Video\Transcoder\V1\ListJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Returns the job data. - * @param \Google\Cloud\Video\Transcoder\V1\GetJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetJob(\Google\Cloud\Video\Transcoder\V1\GetJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1.TranscoderService/GetJob', - $argument, - ['\Google\Cloud\Video\Transcoder\V1\Job', 'decode'], - $metadata, $options); - } - - /** - * Deletes a job. - * @param \Google\Cloud\Video\Transcoder\V1\DeleteJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteJob(\Google\Cloud\Video\Transcoder\V1\DeleteJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1.TranscoderService/DeleteJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates a job template in the specified region. - * @param \Google\Cloud\Video\Transcoder\V1\CreateJobTemplateRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateJobTemplate(\Google\Cloud\Video\Transcoder\V1\CreateJobTemplateRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1.TranscoderService/CreateJobTemplate', - $argument, - ['\Google\Cloud\Video\Transcoder\V1\JobTemplate', 'decode'], - $metadata, $options); - } - - /** - * Lists job templates in the specified region. - * @param \Google\Cloud\Video\Transcoder\V1\ListJobTemplatesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListJobTemplates(\Google\Cloud\Video\Transcoder\V1\ListJobTemplatesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1.TranscoderService/ListJobTemplates', - $argument, - ['\Google\Cloud\Video\Transcoder\V1\ListJobTemplatesResponse', 'decode'], - $metadata, $options); - } - - /** - * Returns the job template data. - * @param \Google\Cloud\Video\Transcoder\V1\GetJobTemplateRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetJobTemplate(\Google\Cloud\Video\Transcoder\V1\GetJobTemplateRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1.TranscoderService/GetJobTemplate', - $argument, - ['\Google\Cloud\Video\Transcoder\V1\JobTemplate', 'decode'], - $metadata, $options); - } - - /** - * Deletes a job template. - * @param \Google\Cloud\Video\Transcoder\V1\DeleteJobTemplateRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteJobTemplate(\Google\Cloud\Video\Transcoder\V1\DeleteJobTemplateRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1.TranscoderService/DeleteJobTemplate', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/VideoTranscoder/src/V1/VideoStream/H264CodecSettings.php b/VideoTranscoder/src/V1/VideoStream/H264CodecSettings.php index c6e67285586c..31d7eb1035d1 100644 --- a/VideoTranscoder/src/V1/VideoStream/H264CodecSettings.php +++ b/VideoTranscoder/src/V1/VideoStream/H264CodecSettings.php @@ -26,7 +26,7 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 width_pixels = 1; */ - private $width_pixels = 0; + protected $width_pixels = 0; /** * The height of the video in pixels. Must be an even integer. * When not specified, the height is adjusted to match the specified width @@ -38,7 +38,7 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 height_pixels = 2; */ - private $height_pixels = 0; + protected $height_pixels = 0; /** * Required. The target video frame rate in frames per second (FPS). Must be * less than or equal to 120. Will default to the input frame rate if larger @@ -50,14 +50,14 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double frame_rate = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $frame_rate = 0.0; + protected $frame_rate = 0.0; /** * Required. The video bitrate in bits per second. The minimum value is * 1,000. The maximum value is 800,000,000. * * Generated from protobuf field int32 bitrate_bps = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $bitrate_bps = 0; + protected $bitrate_bps = 0; /** * Pixel format to use. The default is `yuv420p`. * Supported pixel formats: @@ -73,7 +73,7 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string pixel_format = 5; */ - private $pixel_format = ''; + protected $pixel_format = ''; /** * Specify the `rate_control_mode`. The default is `vbr`. * Supported rate control modes: @@ -82,35 +82,35 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string rate_control_mode = 6; */ - private $rate_control_mode = ''; + protected $rate_control_mode = ''; /** * Target CRF level. Must be between 10 and 36, where 10 is the highest * quality and 36 is the most efficient compression. The default is 21. * * Generated from protobuf field int32 crf_level = 7; */ - private $crf_level = 0; + protected $crf_level = 0; /** * Specifies whether an open Group of Pictures (GOP) structure should be * allowed or not. The default is `false`. * * Generated from protobuf field bool allow_open_gop = 8; */ - private $allow_open_gop = false; + protected $allow_open_gop = false; /** * Use two-pass encoding strategy to achieve better video quality. * `VideoStream.rate_control_mode` must be `vbr`. The default is `false`. * * Generated from protobuf field bool enable_two_pass = 11; */ - private $enable_two_pass = false; + protected $enable_two_pass = false; /** * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be * greater than zero. The default is equal to `VideoStream.bitrate_bps`. * * Generated from protobuf field int32 vbv_size_bits = 12; */ - private $vbv_size_bits = 0; + protected $vbv_size_bits = 0; /** * Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. * Must be greater than zero. The default is equal to 90% of @@ -118,7 +118,7 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 vbv_fullness_bits = 13; */ - private $vbv_fullness_bits = 0; + protected $vbv_fullness_bits = 0; /** * The entropy coder to use. The default is `cabac`. * Supported entropy coders: @@ -127,14 +127,14 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string entropy_coder = 14; */ - private $entropy_coder = ''; + protected $entropy_coder = ''; /** * Allow B-pyramid for reference frame selection. This may not be supported * on all decoders. The default is `false`. * * Generated from protobuf field bool b_pyramid = 15; */ - private $b_pyramid = false; + protected $b_pyramid = false; /** * The number of consecutive B-frames. Must be greater than or equal to * zero. Must be less than `VideoStream.gop_frame_count` if set. The default @@ -142,7 +142,7 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 b_frame_count = 16; */ - private $b_frame_count = 0; + protected $b_frame_count = 0; /** * Specify the intensity of the adaptive quantizer (AQ). Must be between 0 * and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A @@ -150,7 +150,7 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double aq_strength = 17; */ - private $aq_strength = 0.0; + protected $aq_strength = 0.0; /** * Enforces the specified codec profile. The following profiles are * supported: @@ -165,7 +165,7 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string profile = 18; */ - private $profile = ''; + protected $profile = ''; /** * Enforces the specified codec tune. The available options are * [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune). @@ -175,7 +175,7 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tune = 19; */ - private $tune = ''; + protected $tune = ''; /** * Enforces the specified codec preset. The default is `veryfast`. The * available options are @@ -186,7 +186,7 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string preset = 20; */ - private $preset = ''; + protected $preset = ''; protected $gop_mode; /** diff --git a/VideoTranscoder/src/V1/VideoStream/H265CodecSettings.php b/VideoTranscoder/src/V1/VideoStream/H265CodecSettings.php index 7384159c6d66..68face4ec18a 100644 --- a/VideoTranscoder/src/V1/VideoStream/H265CodecSettings.php +++ b/VideoTranscoder/src/V1/VideoStream/H265CodecSettings.php @@ -26,7 +26,7 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 width_pixels = 1; */ - private $width_pixels = 0; + protected $width_pixels = 0; /** * The height of the video in pixels. Must be an even integer. * When not specified, the height is adjusted to match the specified width @@ -38,7 +38,7 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 height_pixels = 2; */ - private $height_pixels = 0; + protected $height_pixels = 0; /** * Required. The target video frame rate in frames per second (FPS). Must be * less than or equal to 120. Will default to the input frame rate if larger @@ -50,14 +50,14 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double frame_rate = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $frame_rate = 0.0; + protected $frame_rate = 0.0; /** * Required. The video bitrate in bits per second. The minimum value is * 1,000. The maximum value is 800,000,000. * * Generated from protobuf field int32 bitrate_bps = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $bitrate_bps = 0; + protected $bitrate_bps = 0; /** * Pixel format to use. The default is `yuv420p`. * Supported pixel formats: @@ -73,7 +73,7 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string pixel_format = 5; */ - private $pixel_format = ''; + protected $pixel_format = ''; /** * Specify the `rate_control_mode`. The default is `vbr`. * Supported rate control modes: @@ -82,35 +82,35 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string rate_control_mode = 6; */ - private $rate_control_mode = ''; + protected $rate_control_mode = ''; /** * Target CRF level. Must be between 10 and 36, where 10 is the highest * quality and 36 is the most efficient compression. The default is 21. * * Generated from protobuf field int32 crf_level = 7; */ - private $crf_level = 0; + protected $crf_level = 0; /** * Specifies whether an open Group of Pictures (GOP) structure should be * allowed or not. The default is `false`. * * Generated from protobuf field bool allow_open_gop = 8; */ - private $allow_open_gop = false; + protected $allow_open_gop = false; /** * Use two-pass encoding strategy to achieve better video quality. * `VideoStream.rate_control_mode` must be `vbr`. The default is `false`. * * Generated from protobuf field bool enable_two_pass = 11; */ - private $enable_two_pass = false; + protected $enable_two_pass = false; /** * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be * greater than zero. The default is equal to `VideoStream.bitrate_bps`. * * Generated from protobuf field int32 vbv_size_bits = 12; */ - private $vbv_size_bits = 0; + protected $vbv_size_bits = 0; /** * Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. * Must be greater than zero. The default is equal to 90% of @@ -118,14 +118,14 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 vbv_fullness_bits = 13; */ - private $vbv_fullness_bits = 0; + protected $vbv_fullness_bits = 0; /** * Allow B-pyramid for reference frame selection. This may not be supported * on all decoders. The default is `false`. * * Generated from protobuf field bool b_pyramid = 14; */ - private $b_pyramid = false; + protected $b_pyramid = false; /** * The number of consecutive B-frames. Must be greater than or equal to * zero. Must be less than `VideoStream.gop_frame_count` if set. The default @@ -133,7 +133,7 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 b_frame_count = 15; */ - private $b_frame_count = 0; + protected $b_frame_count = 0; /** * Specify the intensity of the adaptive quantizer (AQ). Must be between 0 * and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A @@ -141,7 +141,7 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double aq_strength = 16; */ - private $aq_strength = 0.0; + protected $aq_strength = 0.0; /** * Enforces the specified codec profile. The following profiles are * supported: @@ -171,7 +171,7 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string profile = 17; */ - private $profile = ''; + protected $profile = ''; /** * Enforces the specified codec tune. The available options are * [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265). @@ -181,7 +181,7 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tune = 18; */ - private $tune = ''; + protected $tune = ''; /** * Enforces the specified codec preset. The default is `veryfast`. The * available options are @@ -192,7 +192,7 @@ class H265CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string preset = 19; */ - private $preset = ''; + protected $preset = ''; protected $gop_mode; /** diff --git a/VideoTranscoder/src/V1/VideoStream/Vp9CodecSettings.php b/VideoTranscoder/src/V1/VideoStream/Vp9CodecSettings.php index bc349037654a..4a79847bc460 100644 --- a/VideoTranscoder/src/V1/VideoStream/Vp9CodecSettings.php +++ b/VideoTranscoder/src/V1/VideoStream/Vp9CodecSettings.php @@ -26,7 +26,7 @@ class Vp9CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 width_pixels = 1; */ - private $width_pixels = 0; + protected $width_pixels = 0; /** * The height of the video in pixels. Must be an even integer. * When not specified, the height is adjusted to match the specified width @@ -38,7 +38,7 @@ class Vp9CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 height_pixels = 2; */ - private $height_pixels = 0; + protected $height_pixels = 0; /** * Required. The target video frame rate in frames per second (FPS). Must be * less than or equal to 120. Will default to the input frame rate if larger @@ -50,14 +50,14 @@ class Vp9CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double frame_rate = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $frame_rate = 0.0; + protected $frame_rate = 0.0; /** * Required. The video bitrate in bits per second. The minimum value is * 1,000. The maximum value is 480,000,000. * * Generated from protobuf field int32 bitrate_bps = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $bitrate_bps = 0; + protected $bitrate_bps = 0; /** * Pixel format to use. The default is `yuv420p`. * Supported pixel formats: @@ -73,7 +73,7 @@ class Vp9CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string pixel_format = 5; */ - private $pixel_format = ''; + protected $pixel_format = ''; /** * Specify the `rate_control_mode`. The default is `vbr`. * Supported rate control modes: @@ -81,7 +81,7 @@ class Vp9CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string rate_control_mode = 6; */ - private $rate_control_mode = ''; + protected $rate_control_mode = ''; /** * Target CRF level. Must be between 10 and 36, where 10 is the highest * quality and 36 is the most efficient compression. The default is 21. @@ -89,7 +89,7 @@ class Vp9CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 crf_level = 7; */ - private $crf_level = 0; + protected $crf_level = 0; /** * Enforces the specified codec profile. The following profiles are * supported: @@ -105,7 +105,7 @@ class Vp9CodecSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string profile = 10; */ - private $profile = ''; + protected $profile = ''; protected $gop_mode; /** diff --git a/VideoTranscoder/src/V1beta1/AdBreak.php b/VideoTranscoder/src/V1beta1/AdBreak.php deleted file mode 100644 index 1563a6180805..000000000000 --- a/VideoTranscoder/src/V1beta1/AdBreak.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.video.transcoder.v1beta1.AdBreak - */ -class AdBreak extends \Google\Protobuf\Internal\Message -{ - /** - * Start time in seconds for the ad break, relative to the output file - * timeline. The default is `0s`. - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; - */ - private $start_time_offset = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $start_time_offset - * Start time in seconds for the ad break, relative to the output file - * timeline. The default is `0s`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Start time in seconds for the ad break, relative to the output file - * timeline. The default is `0s`. - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; - * @return \Google\Protobuf\Duration|null - */ - public function getStartTimeOffset() - { - return $this->start_time_offset; - } - - public function hasStartTimeOffset() - { - return isset($this->start_time_offset); - } - - public function clearStartTimeOffset() - { - unset($this->start_time_offset); - } - - /** - * Start time in seconds for the ad break, relative to the output file - * timeline. The default is `0s`. - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setStartTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->start_time_offset = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/AudioStream.php b/VideoTranscoder/src/V1beta1/AudioStream.php deleted file mode 100644 index e8607cc59809..000000000000 --- a/VideoTranscoder/src/V1beta1/AudioStream.php +++ /dev/null @@ -1,301 +0,0 @@ -google.cloud.video.transcoder.v1beta1.AudioStream - */ -class AudioStream extends \Google\Protobuf\Internal\Message -{ - /** - * The codec for this audio stream. The default is `"aac"`. - * Supported audio codecs: - * - 'aac' - * - 'aac-he' - * - 'aac-he-v2' - * - 'mp3' - * - 'ac3' - * - 'eac3' - * - * Generated from protobuf field string codec = 1; - */ - private $codec = ''; - /** - * Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. - * - * Generated from protobuf field int32 bitrate_bps = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $bitrate_bps = 0; - /** - * Number of audio channels. Must be between 1 and 6. The default is 2. - * - * Generated from protobuf field int32 channel_count = 3; - */ - private $channel_count = 0; - /** - * A list of channel names specifying layout of the audio channels. - * This only affects the metadata embedded in the container headers, if - * supported by the specified format. The default is `["fl", "fr"]`. - * Supported channel names: - * - 'fl' - Front left channel - * - 'fr' - Front right channel - * - 'sl' - Side left channel - * - 'sr' - Side right channel - * - 'fc' - Front center channel - * - 'lfe' - Low frequency - * - * Generated from protobuf field repeated string channel_layout = 4; - */ - private $channel_layout; - /** - * The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom mapping = 5; - */ - private $mapping; - /** - * The audio sample rate in Hertz. The default is 48000 Hertz. - * - * Generated from protobuf field int32 sample_rate_hertz = 6; - */ - private $sample_rate_hertz = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $codec - * The codec for this audio stream. The default is `"aac"`. - * Supported audio codecs: - * - 'aac' - * - 'aac-he' - * - 'aac-he-v2' - * - 'mp3' - * - 'ac3' - * - 'eac3' - * @type int $bitrate_bps - * Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. - * @type int $channel_count - * Number of audio channels. Must be between 1 and 6. The default is 2. - * @type string[]|\Google\Protobuf\Internal\RepeatedField $channel_layout - * A list of channel names specifying layout of the audio channels. - * This only affects the metadata embedded in the container headers, if - * supported by the specified format. The default is `["fl", "fr"]`. - * Supported channel names: - * - 'fl' - Front left channel - * - 'fr' - Front right channel - * - 'sl' - Side left channel - * - 'sr' - Side right channel - * - 'fc' - Front center channel - * - 'lfe' - Low frequency - * @type \Google\Cloud\Video\Transcoder\V1beta1\AudioStream\AudioAtom[]|\Google\Protobuf\Internal\RepeatedField $mapping - * The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`. - * @type int $sample_rate_hertz - * The audio sample rate in Hertz. The default is 48000 Hertz. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The codec for this audio stream. The default is `"aac"`. - * Supported audio codecs: - * - 'aac' - * - 'aac-he' - * - 'aac-he-v2' - * - 'mp3' - * - 'ac3' - * - 'eac3' - * - * Generated from protobuf field string codec = 1; - * @return string - */ - public function getCodec() - { - return $this->codec; - } - - /** - * The codec for this audio stream. The default is `"aac"`. - * Supported audio codecs: - * - 'aac' - * - 'aac-he' - * - 'aac-he-v2' - * - 'mp3' - * - 'ac3' - * - 'eac3' - * - * Generated from protobuf field string codec = 1; - * @param string $var - * @return $this - */ - public function setCodec($var) - { - GPBUtil::checkString($var, True); - $this->codec = $var; - - return $this; - } - - /** - * Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. - * - * Generated from protobuf field int32 bitrate_bps = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getBitrateBps() - { - return $this->bitrate_bps; - } - - /** - * Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. - * - * Generated from protobuf field int32 bitrate_bps = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setBitrateBps($var) - { - GPBUtil::checkInt32($var); - $this->bitrate_bps = $var; - - return $this; - } - - /** - * Number of audio channels. Must be between 1 and 6. The default is 2. - * - * Generated from protobuf field int32 channel_count = 3; - * @return int - */ - public function getChannelCount() - { - return $this->channel_count; - } - - /** - * Number of audio channels. Must be between 1 and 6. The default is 2. - * - * Generated from protobuf field int32 channel_count = 3; - * @param int $var - * @return $this - */ - public function setChannelCount($var) - { - GPBUtil::checkInt32($var); - $this->channel_count = $var; - - return $this; - } - - /** - * A list of channel names specifying layout of the audio channels. - * This only affects the metadata embedded in the container headers, if - * supported by the specified format. The default is `["fl", "fr"]`. - * Supported channel names: - * - 'fl' - Front left channel - * - 'fr' - Front right channel - * - 'sl' - Side left channel - * - 'sr' - Side right channel - * - 'fc' - Front center channel - * - 'lfe' - Low frequency - * - * Generated from protobuf field repeated string channel_layout = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getChannelLayout() - { - return $this->channel_layout; - } - - /** - * A list of channel names specifying layout of the audio channels. - * This only affects the metadata embedded in the container headers, if - * supported by the specified format. The default is `["fl", "fr"]`. - * Supported channel names: - * - 'fl' - Front left channel - * - 'fr' - Front right channel - * - 'sl' - Side left channel - * - 'sr' - Side right channel - * - 'fc' - Front center channel - * - 'lfe' - Low frequency - * - * Generated from protobuf field repeated string channel_layout = 4; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setChannelLayout($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->channel_layout = $arr; - - return $this; - } - - /** - * The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom mapping = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMapping() - { - return $this->mapping; - } - - /** - * The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom mapping = 5; - * @param \Google\Cloud\Video\Transcoder\V1beta1\AudioStream\AudioAtom[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMapping($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\AudioStream\AudioAtom::class); - $this->mapping = $arr; - - return $this; - } - - /** - * The audio sample rate in Hertz. The default is 48000 Hertz. - * - * Generated from protobuf field int32 sample_rate_hertz = 6; - * @return int - */ - public function getSampleRateHertz() - { - return $this->sample_rate_hertz; - } - - /** - * The audio sample rate in Hertz. The default is 48000 Hertz. - * - * Generated from protobuf field int32 sample_rate_hertz = 6; - * @param int $var - * @return $this - */ - public function setSampleRateHertz($var) - { - GPBUtil::checkInt32($var); - $this->sample_rate_hertz = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/AudioStream/AudioAtom.php b/VideoTranscoder/src/V1beta1/AudioStream/AudioAtom.php deleted file mode 100644 index d21c802f8e4d..000000000000 --- a/VideoTranscoder/src/V1beta1/AudioStream/AudioAtom.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom - */ -class AudioAtom extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `EditAtom.key` that references the atom with audio inputs in the - * `Job.edit_list`. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $key = ''; - /** - * List of `Channel`s for this audio stream. - * for in-depth explanation. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom.AudioChannel channels = 2; - */ - private $channels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Required. The `EditAtom.key` that references the atom with audio inputs in the - * `Job.edit_list`. - * @type \Google\Cloud\Video\Transcoder\V1beta1\AudioStream\AudioAtom\AudioChannel[]|\Google\Protobuf\Internal\RepeatedField $channels - * List of `Channel`s for this audio stream. - * for in-depth explanation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `EditAtom.key` that references the atom with audio inputs in the - * `Job.edit_list`. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Required. The `EditAtom.key` that references the atom with audio inputs in the - * `Job.edit_list`. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * List of `Channel`s for this audio stream. - * for in-depth explanation. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom.AudioChannel channels = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getChannels() - { - return $this->channels; - } - - /** - * List of `Channel`s for this audio stream. - * for in-depth explanation. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom.AudioChannel channels = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\AudioStream\AudioAtom\AudioChannel[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setChannels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\AudioStream\AudioAtom\AudioChannel::class); - $this->channels = $arr; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/AudioStream/AudioAtom/AudioChannel.php b/VideoTranscoder/src/V1beta1/AudioStream/AudioAtom/AudioChannel.php deleted file mode 100644 index 8c84043a8bed..000000000000 --- a/VideoTranscoder/src/V1beta1/AudioStream/AudioAtom/AudioChannel.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom.AudioChannel - */ -class AudioChannel extends \Google\Protobuf\Internal\Message -{ - /** - * List of `Job.inputs` for this audio channel. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom.AudioChannel.AudioChannelInput inputs = 2; - */ - private $inputs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Video\Transcoder\V1beta1\AudioStream\AudioAtom\AudioChannel\AudioChannelInput[]|\Google\Protobuf\Internal\RepeatedField $inputs - * List of `Job.inputs` for this audio channel. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * List of `Job.inputs` for this audio channel. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom.AudioChannel.AudioChannelInput inputs = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInputs() - { - return $this->inputs; - } - - /** - * List of `Job.inputs` for this audio channel. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom.AudioChannel.AudioChannelInput inputs = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\AudioStream\AudioAtom\AudioChannel\AudioChannelInput[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInputs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\AudioStream\AudioAtom\AudioChannel\AudioChannelInput::class); - $this->inputs = $arr; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/AudioStream/AudioAtom/AudioChannel/AudioChannelInput.php b/VideoTranscoder/src/V1beta1/AudioStream/AudioAtom/AudioChannel/AudioChannelInput.php deleted file mode 100644 index 485a12a3add8..000000000000 --- a/VideoTranscoder/src/V1beta1/AudioStream/AudioAtom/AudioChannel/AudioChannelInput.php +++ /dev/null @@ -1,174 +0,0 @@ -google.cloud.video.transcoder.v1beta1.AudioStream.AudioAtom.AudioChannel.AudioChannelInput - */ -class AudioChannelInput extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `Input.key` that identifies the input file. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $key = ''; - /** - * Required. The zero-based index of the track in the input file. - * - * Generated from protobuf field int32 track = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $track = 0; - /** - * Required. The zero-based index of the channel in the input file. - * - * Generated from protobuf field int32 channel = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $channel = 0; - /** - * Audio volume control in dB. Negative values decrease volume, - * positive values increase. The default is 0. - * - * Generated from protobuf field double gain_db = 4; - */ - private $gain_db = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Required. The `Input.key` that identifies the input file. - * @type int $track - * Required. The zero-based index of the track in the input file. - * @type int $channel - * Required. The zero-based index of the channel in the input file. - * @type float $gain_db - * Audio volume control in dB. Negative values decrease volume, - * positive values increase. The default is 0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `Input.key` that identifies the input file. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Required. The `Input.key` that identifies the input file. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Required. The zero-based index of the track in the input file. - * - * Generated from protobuf field int32 track = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getTrack() - { - return $this->track; - } - - /** - * Required. The zero-based index of the track in the input file. - * - * Generated from protobuf field int32 track = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setTrack($var) - { - GPBUtil::checkInt32($var); - $this->track = $var; - - return $this; - } - - /** - * Required. The zero-based index of the channel in the input file. - * - * Generated from protobuf field int32 channel = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getChannel() - { - return $this->channel; - } - - /** - * Required. The zero-based index of the channel in the input file. - * - * Generated from protobuf field int32 channel = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setChannel($var) - { - GPBUtil::checkInt32($var); - $this->channel = $var; - - return $this; - } - - /** - * Audio volume control in dB. Negative values decrease volume, - * positive values increase. The default is 0. - * - * Generated from protobuf field double gain_db = 4; - * @return float - */ - public function getGainDb() - { - return $this->gain_db; - } - - /** - * Audio volume control in dB. Negative values decrease volume, - * positive values increase. The default is 0. - * - * Generated from protobuf field double gain_db = 4; - * @param float $var - * @return $this - */ - public function setGainDb($var) - { - GPBUtil::checkDouble($var); - $this->gain_db = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/CreateJobRequest.php b/VideoTranscoder/src/V1beta1/CreateJobRequest.php deleted file mode 100644 index 2b12fe95e1a8..000000000000 --- a/VideoTranscoder/src/V1beta1/CreateJobRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.video.transcoder.v1beta1.CreateJobRequest - */ -class CreateJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent location to create and process this job. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. Parameters for creating transcoding job. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $job = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent location to create and process this job. - * Format: `projects/{project}/locations/{location}` - * @type \Google\Cloud\Video\Transcoder\V1beta1\Job $job - * Required. Parameters for creating transcoding job. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent location to create and process this job. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent location to create and process this job. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Parameters for creating transcoding job. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Job|null - */ - public function getJob() - { - return $this->job; - } - - public function hasJob() - { - return isset($this->job); - } - - public function clearJob() - { - unset($this->job); - } - - /** - * Required. Parameters for creating transcoding job. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Job $var - * @return $this - */ - public function setJob($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Job::class); - $this->job = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/CreateJobTemplateRequest.php b/VideoTranscoder/src/V1beta1/CreateJobTemplateRequest.php deleted file mode 100644 index 68be5da4cbc0..000000000000 --- a/VideoTranscoder/src/V1beta1/CreateJobTemplateRequest.php +++ /dev/null @@ -1,161 +0,0 @@ -google.cloud.video.transcoder.v1beta1.CreateJobTemplateRequest - */ -class CreateJobTemplateRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent location to create this job template. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. Parameters for creating job template. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.JobTemplate job_template = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $job_template = null; - /** - * Required. The ID to use for the job template, which will become the final component - * of the job template's resource name. - * This value should be 4-63 characters, and valid characters must match the - * regular expression `[a-zA-Z][a-zA-Z0-9_-]*`. - * - * Generated from protobuf field string job_template_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $job_template_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent location to create this job template. - * Format: `projects/{project}/locations/{location}` - * @type \Google\Cloud\Video\Transcoder\V1beta1\JobTemplate $job_template - * Required. Parameters for creating job template. - * @type string $job_template_id - * Required. The ID to use for the job template, which will become the final component - * of the job template's resource name. - * This value should be 4-63 characters, and valid characters must match the - * regular expression `[a-zA-Z][a-zA-Z0-9_-]*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent location to create this job template. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent location to create this job template. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Parameters for creating job template. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.JobTemplate job_template = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Video\Transcoder\V1beta1\JobTemplate|null - */ - public function getJobTemplate() - { - return $this->job_template; - } - - public function hasJobTemplate() - { - return isset($this->job_template); - } - - public function clearJobTemplate() - { - unset($this->job_template); - } - - /** - * Required. Parameters for creating job template. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.JobTemplate job_template = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Video\Transcoder\V1beta1\JobTemplate $var - * @return $this - */ - public function setJobTemplate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\JobTemplate::class); - $this->job_template = $var; - - return $this; - } - - /** - * Required. The ID to use for the job template, which will become the final component - * of the job template's resource name. - * This value should be 4-63 characters, and valid characters must match the - * regular expression `[a-zA-Z][a-zA-Z0-9_-]*`. - * - * Generated from protobuf field string job_template_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getJobTemplateId() - { - return $this->job_template_id; - } - - /** - * Required. The ID to use for the job template, which will become the final component - * of the job template's resource name. - * This value should be 4-63 characters, and valid characters must match the - * regular expression `[a-zA-Z][a-zA-Z0-9_-]*`. - * - * Generated from protobuf field string job_template_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setJobTemplateId($var) - { - GPBUtil::checkString($var, True); - $this->job_template_id = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/DeleteJobRequest.php b/VideoTranscoder/src/V1beta1/DeleteJobRequest.php deleted file mode 100644 index eafa63a54570..000000000000 --- a/VideoTranscoder/src/V1beta1/DeleteJobRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.video.transcoder.v1beta1.DeleteJobRequest - */ -class DeleteJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the job to delete. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the job to delete. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the job to delete. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the job to delete. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/DeleteJobTemplateRequest.php b/VideoTranscoder/src/V1beta1/DeleteJobTemplateRequest.php deleted file mode 100644 index ad9d38315930..000000000000 --- a/VideoTranscoder/src/V1beta1/DeleteJobTemplateRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.video.transcoder.v1beta1.DeleteJobTemplateRequest - */ -class DeleteJobTemplateRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the job template to delete. - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the job template to delete. - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the job template to delete. - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the job template to delete. - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/EditAtom.php b/VideoTranscoder/src/V1beta1/EditAtom.php deleted file mode 100644 index b88d6a69e938..000000000000 --- a/VideoTranscoder/src/V1beta1/EditAtom.php +++ /dev/null @@ -1,209 +0,0 @@ -google.cloud.video.transcoder.v1beta1.EditAtom - */ -class EditAtom extends \Google\Protobuf\Internal\Message -{ - /** - * A unique key for this atom. Must be specified when using advanced - * mapping. - * - * Generated from protobuf field string key = 1; - */ - private $key = ''; - /** - * List of `Input.key`s identifying files that should be used in this atom. - * The listed `inputs` must have the same timeline. - * - * Generated from protobuf field repeated string inputs = 2; - */ - private $inputs; - /** - * End time in seconds for the atom, relative to the input file timeline. - * When `end_time_offset` is not specified, the `inputs` are used until - * the end of the atom. - * - * Generated from protobuf field .google.protobuf.Duration end_time_offset = 3; - */ - private $end_time_offset = null; - /** - * Start time in seconds for the atom, relative to the input file timeline. - * The default is `0s`. - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 4; - */ - private $start_time_offset = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * A unique key for this atom. Must be specified when using advanced - * mapping. - * @type string[]|\Google\Protobuf\Internal\RepeatedField $inputs - * List of `Input.key`s identifying files that should be used in this atom. - * The listed `inputs` must have the same timeline. - * @type \Google\Protobuf\Duration $end_time_offset - * End time in seconds for the atom, relative to the input file timeline. - * When `end_time_offset` is not specified, the `inputs` are used until - * the end of the atom. - * @type \Google\Protobuf\Duration $start_time_offset - * Start time in seconds for the atom, relative to the input file timeline. - * The default is `0s`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * A unique key for this atom. Must be specified when using advanced - * mapping. - * - * Generated from protobuf field string key = 1; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * A unique key for this atom. Must be specified when using advanced - * mapping. - * - * Generated from protobuf field string key = 1; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * List of `Input.key`s identifying files that should be used in this atom. - * The listed `inputs` must have the same timeline. - * - * Generated from protobuf field repeated string inputs = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInputs() - { - return $this->inputs; - } - - /** - * List of `Input.key`s identifying files that should be used in this atom. - * The listed `inputs` must have the same timeline. - * - * Generated from protobuf field repeated string inputs = 2; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInputs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->inputs = $arr; - - return $this; - } - - /** - * End time in seconds for the atom, relative to the input file timeline. - * When `end_time_offset` is not specified, the `inputs` are used until - * the end of the atom. - * - * Generated from protobuf field .google.protobuf.Duration end_time_offset = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getEndTimeOffset() - { - return $this->end_time_offset; - } - - public function hasEndTimeOffset() - { - return isset($this->end_time_offset); - } - - public function clearEndTimeOffset() - { - unset($this->end_time_offset); - } - - /** - * End time in seconds for the atom, relative to the input file timeline. - * When `end_time_offset` is not specified, the `inputs` are used until - * the end of the atom. - * - * Generated from protobuf field .google.protobuf.Duration end_time_offset = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setEndTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->end_time_offset = $var; - - return $this; - } - - /** - * Start time in seconds for the atom, relative to the input file timeline. - * The default is `0s`. - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 4; - * @return \Google\Protobuf\Duration|null - */ - public function getStartTimeOffset() - { - return $this->start_time_offset; - } - - public function hasStartTimeOffset() - { - return isset($this->start_time_offset); - } - - public function clearStartTimeOffset() - { - unset($this->start_time_offset); - } - - /** - * Start time in seconds for the atom, relative to the input file timeline. - * The default is `0s`. - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 4; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setStartTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->start_time_offset = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/ElementaryStream.php b/VideoTranscoder/src/V1beta1/ElementaryStream.php deleted file mode 100644 index 9c042e8c4124..000000000000 --- a/VideoTranscoder/src/V1beta1/ElementaryStream.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.video.transcoder.v1beta1.ElementaryStream - */ -class ElementaryStream extends \Google\Protobuf\Internal\Message -{ - /** - * A unique key for this elementary stream. - * - * Generated from protobuf field string key = 4; - */ - private $key = ''; - protected $elementary_stream; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * A unique key for this elementary stream. - * @type \Google\Cloud\Video\Transcoder\V1beta1\VideoStream $video_stream - * Encoding of a video stream. - * @type \Google\Cloud\Video\Transcoder\V1beta1\AudioStream $audio_stream - * Encoding of an audio stream. - * @type \Google\Cloud\Video\Transcoder\V1beta1\TextStream $text_stream - * Encoding of a text stream. For example, closed captions or subtitles. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * A unique key for this elementary stream. - * - * Generated from protobuf field string key = 4; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * A unique key for this elementary stream. - * - * Generated from protobuf field string key = 4; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Encoding of a video stream. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.VideoStream video_stream = 1; - * @return \Google\Cloud\Video\Transcoder\V1beta1\VideoStream|null - */ - public function getVideoStream() - { - return $this->readOneof(1); - } - - public function hasVideoStream() - { - return $this->hasOneof(1); - } - - /** - * Encoding of a video stream. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.VideoStream video_stream = 1; - * @param \Google\Cloud\Video\Transcoder\V1beta1\VideoStream $var - * @return $this - */ - public function setVideoStream($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\VideoStream::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Encoding of an audio stream. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.AudioStream audio_stream = 2; - * @return \Google\Cloud\Video\Transcoder\V1beta1\AudioStream|null - */ - public function getAudioStream() - { - return $this->readOneof(2); - } - - public function hasAudioStream() - { - return $this->hasOneof(2); - } - - /** - * Encoding of an audio stream. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.AudioStream audio_stream = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\AudioStream $var - * @return $this - */ - public function setAudioStream($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\AudioStream::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Encoding of a text stream. For example, closed captions or subtitles. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.TextStream text_stream = 3; - * @return \Google\Cloud\Video\Transcoder\V1beta1\TextStream|null - */ - public function getTextStream() - { - return $this->readOneof(3); - } - - public function hasTextStream() - { - return $this->hasOneof(3); - } - - /** - * Encoding of a text stream. For example, closed captions or subtitles. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.TextStream text_stream = 3; - * @param \Google\Cloud\Video\Transcoder\V1beta1\TextStream $var - * @return $this - */ - public function setTextStream($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\TextStream::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getElementaryStream() - { - return $this->whichOneof("elementary_stream"); - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Encryption.php b/VideoTranscoder/src/V1beta1/Encryption.php deleted file mode 100644 index 7ed6ee3bb924..000000000000 --- a/VideoTranscoder/src/V1beta1/Encryption.php +++ /dev/null @@ -1,213 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Encryption - */ -class Encryption extends \Google\Protobuf\Internal\Message -{ - /** - * Required. 128 bit encryption key represented as lowercase hexadecimal digits. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $key = ''; - /** - * Required. 128 bit Initialization Vector (IV) represented as lowercase hexadecimal - * digits. - * - * Generated from protobuf field string iv = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $iv = ''; - protected $encryption_mode; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Required. 128 bit encryption key represented as lowercase hexadecimal digits. - * @type string $iv - * Required. 128 bit Initialization Vector (IV) represented as lowercase hexadecimal - * digits. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Encryption\Aes128Encryption $aes_128 - * Configuration for AES-128 encryption. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Encryption\SampleAesEncryption $sample_aes - * Configuration for SAMPLE-AES encryption. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Encryption\MpegCommonEncryption $mpeg_cenc - * Configuration for MPEG Common Encryption (MPEG-CENC). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. 128 bit encryption key represented as lowercase hexadecimal digits. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Required. 128 bit encryption key represented as lowercase hexadecimal digits. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Required. 128 bit Initialization Vector (IV) represented as lowercase hexadecimal - * digits. - * - * Generated from protobuf field string iv = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getIv() - { - return $this->iv; - } - - /** - * Required. 128 bit Initialization Vector (IV) represented as lowercase hexadecimal - * digits. - * - * Generated from protobuf field string iv = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setIv($var) - { - GPBUtil::checkString($var, True); - $this->iv = $var; - - return $this; - } - - /** - * Configuration for AES-128 encryption. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Encryption.Aes128Encryption aes_128 = 3; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Encryption\Aes128Encryption|null - */ - public function getAes128() - { - return $this->readOneof(3); - } - - public function hasAes128() - { - return $this->hasOneof(3); - } - - /** - * Configuration for AES-128 encryption. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Encryption.Aes128Encryption aes_128 = 3; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Encryption\Aes128Encryption $var - * @return $this - */ - public function setAes128($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Encryption\Aes128Encryption::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Configuration for SAMPLE-AES encryption. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Encryption.SampleAesEncryption sample_aes = 4; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Encryption\SampleAesEncryption|null - */ - public function getSampleAes() - { - return $this->readOneof(4); - } - - public function hasSampleAes() - { - return $this->hasOneof(4); - } - - /** - * Configuration for SAMPLE-AES encryption. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Encryption.SampleAesEncryption sample_aes = 4; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Encryption\SampleAesEncryption $var - * @return $this - */ - public function setSampleAes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Encryption\SampleAesEncryption::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Configuration for MPEG Common Encryption (MPEG-CENC). - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Encryption.MpegCommonEncryption mpeg_cenc = 5; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Encryption\MpegCommonEncryption|null - */ - public function getMpegCenc() - { - return $this->readOneof(5); - } - - public function hasMpegCenc() - { - return $this->hasOneof(5); - } - - /** - * Configuration for MPEG Common Encryption (MPEG-CENC). - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Encryption.MpegCommonEncryption mpeg_cenc = 5; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Encryption\MpegCommonEncryption $var - * @return $this - */ - public function setMpegCenc($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Encryption\MpegCommonEncryption::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getEncryptionMode() - { - return $this->whichOneof("encryption_mode"); - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Encryption/Aes128Encryption.php b/VideoTranscoder/src/V1beta1/Encryption/Aes128Encryption.php deleted file mode 100644 index 7c6d3f1a5959..000000000000 --- a/VideoTranscoder/src/V1beta1/Encryption/Aes128Encryption.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Encryption.Aes128Encryption - */ -class Aes128Encryption extends \Google\Protobuf\Internal\Message -{ - /** - * Required. URI of the key delivery service. This URI is inserted into the M3U8 - * header. - * - * Generated from protobuf field string key_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $key_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key_uri - * Required. URI of the key delivery service. This URI is inserted into the M3U8 - * header. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. URI of the key delivery service. This URI is inserted into the M3U8 - * header. - * - * Generated from protobuf field string key_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKeyUri() - { - return $this->key_uri; - } - - /** - * Required. URI of the key delivery service. This URI is inserted into the M3U8 - * header. - * - * Generated from protobuf field string key_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKeyUri($var) - { - GPBUtil::checkString($var, True); - $this->key_uri = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/Encryption/MpegCommonEncryption.php b/VideoTranscoder/src/V1beta1/Encryption/MpegCommonEncryption.php deleted file mode 100644 index 7f5d06d3cc28..000000000000 --- a/VideoTranscoder/src/V1beta1/Encryption/MpegCommonEncryption.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Encryption.MpegCommonEncryption - */ -class MpegCommonEncryption extends \Google\Protobuf\Internal\Message -{ - /** - * Required. 128 bit Key ID represented as lowercase hexadecimal digits for use with - * common encryption. - * - * Generated from protobuf field string key_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $key_id = ''; - /** - * Required. Specify the encryption scheme. - * Supported encryption schemes: - * - 'cenc' - * - 'cbcs' - * - * Generated from protobuf field string scheme = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $scheme = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key_id - * Required. 128 bit Key ID represented as lowercase hexadecimal digits for use with - * common encryption. - * @type string $scheme - * Required. Specify the encryption scheme. - * Supported encryption schemes: - * - 'cenc' - * - 'cbcs' - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. 128 bit Key ID represented as lowercase hexadecimal digits for use with - * common encryption. - * - * Generated from protobuf field string key_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKeyId() - { - return $this->key_id; - } - - /** - * Required. 128 bit Key ID represented as lowercase hexadecimal digits for use with - * common encryption. - * - * Generated from protobuf field string key_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKeyId($var) - { - GPBUtil::checkString($var, True); - $this->key_id = $var; - - return $this; - } - - /** - * Required. Specify the encryption scheme. - * Supported encryption schemes: - * - 'cenc' - * - 'cbcs' - * - * Generated from protobuf field string scheme = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getScheme() - { - return $this->scheme; - } - - /** - * Required. Specify the encryption scheme. - * Supported encryption schemes: - * - 'cenc' - * - 'cbcs' - * - * Generated from protobuf field string scheme = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setScheme($var) - { - GPBUtil::checkString($var, True); - $this->scheme = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/Encryption/SampleAesEncryption.php b/VideoTranscoder/src/V1beta1/Encryption/SampleAesEncryption.php deleted file mode 100644 index f4710d9ae8f4..000000000000 --- a/VideoTranscoder/src/V1beta1/Encryption/SampleAesEncryption.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Encryption.SampleAesEncryption - */ -class SampleAesEncryption extends \Google\Protobuf\Internal\Message -{ - /** - * Required. URI of the key delivery service. This URI is inserted into the M3U8 - * header. - * - * Generated from protobuf field string key_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $key_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key_uri - * Required. URI of the key delivery service. This URI is inserted into the M3U8 - * header. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. URI of the key delivery service. This URI is inserted into the M3U8 - * header. - * - * Generated from protobuf field string key_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKeyUri() - { - return $this->key_uri; - } - - /** - * Required. URI of the key delivery service. This URI is inserted into the M3U8 - * header. - * - * Generated from protobuf field string key_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKeyUri($var) - { - GPBUtil::checkString($var, True); - $this->key_uri = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/FailureDetail.php b/VideoTranscoder/src/V1beta1/FailureDetail.php deleted file mode 100644 index df6a62e369ca..000000000000 --- a/VideoTranscoder/src/V1beta1/FailureDetail.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.video.transcoder.v1beta1.FailureDetail - */ -class FailureDetail extends \Google\Protobuf\Internal\Message -{ - /** - * A description of the failure. - * - * Generated from protobuf field string description = 1; - */ - private $description = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $description - * A description of the failure. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * A description of the failure. - * - * Generated from protobuf field string description = 1; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * A description of the failure. - * - * Generated from protobuf field string description = 1; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Gapic/TranscoderServiceGapicClient.php b/VideoTranscoder/src/V1beta1/Gapic/TranscoderServiceGapicClient.php deleted file mode 100644 index d8dba09a5d0f..000000000000 --- a/VideoTranscoder/src/V1beta1/Gapic/TranscoderServiceGapicClient.php +++ /dev/null @@ -1,763 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $job = new Job(); - * $response = $transcoderServiceClient->createJob($formattedParent, $job); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class TranscoderServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.video.transcoder.v1beta1.TranscoderService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'transcoder.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $jobNameTemplate; - - private static $jobTemplateNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/transcoder_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/transcoder_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/transcoder_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/transcoder_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getJobNameTemplate() - { - if (self::$jobNameTemplate == null) { - self::$jobNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobs/{job}'); - } - - return self::$jobNameTemplate; - } - - private static function getJobTemplateNameTemplate() - { - if (self::$jobTemplateNameTemplate == null) { - self::$jobTemplateNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobTemplates/{job_template}'); - } - - return self::$jobTemplateNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'job' => self::getJobNameTemplate(), - 'jobTemplate' => self::getJobTemplateNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a job - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * - * @return string The formatted job resource. - * - * @experimental - */ - public static function jobName($project, $location, $job) - { - return self::getJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a job_template - * resource. - * - * @param string $project - * @param string $location - * @param string $jobTemplate - * - * @return string The formatted job_template resource. - * - * @experimental - */ - public static function jobTemplateName($project, $location, $jobTemplate) - { - return self::getJobTemplateNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'job_template' => $jobTemplate, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - job: projects/{project}/locations/{location}/jobs/{job} - * - jobTemplate: projects/{project}/locations/{location}/jobTemplates/{job_template} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * **Deprecated**. This option will be removed in a future major release. Please - * utilize the `$apiEndpoint` option instead. - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'transcoder.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a job in the specified region. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedParent = $transcoderServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $job = new Job(); - * $response = $transcoderServiceClient->createJob($formattedParent, $job); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent location to create and process this job. - * Format: `projects/{project}/locations/{location}` - * @param Job $job Required. Parameters for creating transcoding job. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Video\Transcoder\V1beta1\Job - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createJob($parent, $job, array $optionalArgs = []) - { - $request = new CreateJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setJob($job); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateJob', Job::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a job template in the specified region. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedParent = $transcoderServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $jobTemplate = new JobTemplate(); - * $jobTemplateId = 'job_template_id'; - * $response = $transcoderServiceClient->createJobTemplate($formattedParent, $jobTemplate, $jobTemplateId); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent location to create this job template. - * Format: `projects/{project}/locations/{location}` - * @param JobTemplate $jobTemplate Required. Parameters for creating job template. - * @param string $jobTemplateId Required. The ID to use for the job template, which will become the final component - * of the job template's resource name. - * - * This value should be 4-63 characters, and valid characters must match the - * regular expression `[a-zA-Z][a-zA-Z0-9_-]*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Video\Transcoder\V1beta1\JobTemplate - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createJobTemplate($parent, $jobTemplate, $jobTemplateId, array $optionalArgs = []) - { - $request = new CreateJobTemplateRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setJobTemplate($jobTemplate); - $request->setJobTemplateId($jobTemplateId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateJobTemplate', JobTemplate::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a job. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedName = $transcoderServiceClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - * $transcoderServiceClient->deleteJob($formattedName); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the job to delete. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteJob($name, array $optionalArgs = []) - { - $request = new DeleteJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteJob', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a job template. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedName = $transcoderServiceClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - * $transcoderServiceClient->deleteJobTemplate($formattedName); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the job template to delete. - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteJobTemplate($name, array $optionalArgs = []) - { - $request = new DeleteJobTemplateRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteJobTemplate', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the job data. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedName = $transcoderServiceClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - * $response = $transcoderServiceClient->getJob($formattedName); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the job to retrieve. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Video\Transcoder\V1beta1\Job - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getJob($name, array $optionalArgs = []) - { - $request = new GetJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetJob', Job::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the job template data. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedName = $transcoderServiceClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - * $response = $transcoderServiceClient->getJobTemplate($formattedName); - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the job template to retrieve. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Video\Transcoder\V1beta1\JobTemplate - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getJobTemplate($name, array $optionalArgs = []) - { - $request = new GetJobTemplateRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetJobTemplate', JobTemplate::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists job templates in the specified region. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedParent = $transcoderServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $transcoderServiceClient->listJobTemplates($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $transcoderServiceClient->listJobTemplates($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent location from which to retrieve the collection of job templates. - * Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listJobTemplates($parent, array $optionalArgs = []) - { - $request = new ListJobTemplatesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListJobTemplates', $optionalArgs, ListJobTemplatesResponse::class, $request); - } - - /** - * Lists jobs in the specified region. - * - * Sample code: - * ``` - * $transcoderServiceClient = new TranscoderServiceClient(); - * try { - * $formattedParent = $transcoderServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $transcoderServiceClient->listJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $transcoderServiceClient->listJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $transcoderServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listJobs($parent, array $optionalArgs = []) - { - $request = new ListJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListJobs', $optionalArgs, ListJobsResponse::class, $request); - } -} diff --git a/VideoTranscoder/src/V1beta1/GetJobRequest.php b/VideoTranscoder/src/V1beta1/GetJobRequest.php deleted file mode 100644 index b481b4e56769..000000000000 --- a/VideoTranscoder/src/V1beta1/GetJobRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.video.transcoder.v1beta1.GetJobRequest - */ -class GetJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the job to retrieve. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the job to retrieve. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the job to retrieve. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the job to retrieve. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/GetJobTemplateRequest.php b/VideoTranscoder/src/V1beta1/GetJobTemplateRequest.php deleted file mode 100644 index 5291c00791b3..000000000000 --- a/VideoTranscoder/src/V1beta1/GetJobTemplateRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.video.transcoder.v1beta1.GetJobTemplateRequest - */ -class GetJobTemplateRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the job template to retrieve. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the job template to retrieve. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the job template to retrieve. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the job template to retrieve. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Input.php b/VideoTranscoder/src/V1beta1/Input.php deleted file mode 100644 index f0d15cfbaf01..000000000000 --- a/VideoTranscoder/src/V1beta1/Input.php +++ /dev/null @@ -1,157 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Input - */ -class Input extends \Google\Protobuf\Internal\Message -{ - /** - * A unique key for this input. Must be specified when using advanced - * mapping and edit lists. - * - * Generated from protobuf field string key = 1; - */ - private $key = ''; - /** - * URI of the media. Input files must be at least 5 seconds in duration and - * stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). - * If empty, the value will be populated from `Job.input_uri`. - * - * Generated from protobuf field string uri = 2; - */ - private $uri = ''; - /** - * Preprocessing configurations. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig preprocessing_config = 3; - */ - private $preprocessing_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * A unique key for this input. Must be specified when using advanced - * mapping and edit lists. - * @type string $uri - * URI of the media. Input files must be at least 5 seconds in duration and - * stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). - * If empty, the value will be populated from `Job.input_uri`. - * @type \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig $preprocessing_config - * Preprocessing configurations. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * A unique key for this input. Must be specified when using advanced - * mapping and edit lists. - * - * Generated from protobuf field string key = 1; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * A unique key for this input. Must be specified when using advanced - * mapping and edit lists. - * - * Generated from protobuf field string key = 1; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * URI of the media. Input files must be at least 5 seconds in duration and - * stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). - * If empty, the value will be populated from `Job.input_uri`. - * - * Generated from protobuf field string uri = 2; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * URI of the media. Input files must be at least 5 seconds in duration and - * stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). - * If empty, the value will be populated from `Job.input_uri`. - * - * Generated from protobuf field string uri = 2; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Preprocessing configurations. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig preprocessing_config = 3; - * @return \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig|null - */ - public function getPreprocessingConfig() - { - return $this->preprocessing_config; - } - - public function hasPreprocessingConfig() - { - return isset($this->preprocessing_config); - } - - public function clearPreprocessingConfig() - { - unset($this->preprocessing_config); - } - - /** - * Preprocessing configurations. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig preprocessing_config = 3; - * @param \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig $var - * @return $this - */ - public function setPreprocessingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig::class); - $this->preprocessing_config = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Job.php b/VideoTranscoder/src/V1beta1/Job.php deleted file mode 100644 index 5b4bdc32a298..000000000000 --- a/VideoTranscoder/src/V1beta1/Job.php +++ /dev/null @@ -1,675 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Job - */ -class Job extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the job. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Input only. Specify the `input_uri` to populate empty `uri` fields in each element of - * `Job.config.inputs` or `JobTemplate.config.inputs` when using template. - * URI of the media. Input files must be at least 5 seconds in duration and - * stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). - * - * Generated from protobuf field string input_uri = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $input_uri = ''; - /** - * Input only. Specify the `output_uri` to populate an empty `Job.config.output.uri` or - * `JobTemplate.config.output.uri` when using template. - * URI for the output file(s). For example, `gs://my-bucket/outputs/`. - * - * Generated from protobuf field string output_uri = 3 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $output_uri = ''; - /** - * Specify the priority of the job. Enter a value between 0 and 100, where 0 - * is the lowest priority and 100 is the highest priority. The default is 0. - * - * Generated from protobuf field int32 priority = 6; - */ - private $priority = 0; - /** - * Output only. The origin URI. - *

- * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Job.OriginUri origin_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $origin_uri = null; - /** - * Output only. The current state of the job. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Job.ProcessingState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Estimated fractional progress, from `0` to `1` for each - * step. - * - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Progress progress = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $progress = null; - /** - * Output only. A description of the reason for the failure. This property is - * always present when `state` is `FAILED`. - * - * Generated from protobuf field string failure_reason = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $failure_reason = ''; - /** - * Output only. List of failure details. This property may contain additional - * information about the failure when `failure_reason` is present. - * - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.FailureDetail failure_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $failure_details; - /** - * Output only. The time the job was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time the transcoding started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. The time the transcoding finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Job time to live value in days, which will be effective after job - * completion. Job should be deleted automatically after the given TTL. Enter - * a value between 1 and 90. The default is 30. - * - * Generated from protobuf field int32 ttl_after_completion_days = 15; - */ - private $ttl_after_completion_days = 0; - protected $job_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the job. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * @type string $input_uri - * Input only. Specify the `input_uri` to populate empty `uri` fields in each element of - * `Job.config.inputs` or `JobTemplate.config.inputs` when using template. - * URI of the media. Input files must be at least 5 seconds in duration and - * stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). - * @type string $output_uri - * Input only. Specify the `output_uri` to populate an empty `Job.config.output.uri` or - * `JobTemplate.config.output.uri` when using template. - * URI for the output file(s). For example, `gs://my-bucket/outputs/`. - * @type string $template_id - * Input only. Specify the `template_id` to use for populating `Job.config`. The default - * is `preset/web-hd`. - * Preset Transcoder templates: - * - `preset/{preset_id}` - * - User defined JobTemplate: - * `{job_template_id}` - * @type \Google\Cloud\Video\Transcoder\V1beta1\JobConfig $config - * The configuration for this job. - * @type int $priority - * Specify the priority of the job. Enter a value between 0 and 100, where 0 - * is the lowest priority and 100 is the highest priority. The default is 0. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Job\OriginUri $origin_uri - * Output only. The origin URI. - * - * @type int $state - * Output only. The current state of the job. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Progress $progress - * Output only. Estimated fractional progress, from `0` to `1` for each - * step. - * - * @type string $failure_reason - * Output only. A description of the reason for the failure. This property is - * always present when `state` is `FAILED`. - * @type \Google\Cloud\Video\Transcoder\V1beta1\FailureDetail[]|\Google\Protobuf\Internal\RepeatedField $failure_details - * Output only. List of failure details. This property may contain additional - * information about the failure when `failure_reason` is present. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the job was created. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time the transcoding started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the transcoding finished. - * @type int $ttl_after_completion_days - * Job time to live value in days, which will be effective after job - * completion. Job should be deleted automatically after the given TTL. Enter - * a value between 1 and 90. The default is 30. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the job. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the job. - * Format: `projects/{project}/locations/{location}/jobs/{job}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Input only. Specify the `input_uri` to populate empty `uri` fields in each element of - * `Job.config.inputs` or `JobTemplate.config.inputs` when using template. - * URI of the media. Input files must be at least 5 seconds in duration and - * stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). - * - * Generated from protobuf field string input_uri = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getInputUri() - { - return $this->input_uri; - } - - /** - * Input only. Specify the `input_uri` to populate empty `uri` fields in each element of - * `Job.config.inputs` or `JobTemplate.config.inputs` when using template. - * URI of the media. Input files must be at least 5 seconds in duration and - * stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). - * - * Generated from protobuf field string input_uri = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setInputUri($var) - { - GPBUtil::checkString($var, True); - $this->input_uri = $var; - - return $this; - } - - /** - * Input only. Specify the `output_uri` to populate an empty `Job.config.output.uri` or - * `JobTemplate.config.output.uri` when using template. - * URI for the output file(s). For example, `gs://my-bucket/outputs/`. - * - * Generated from protobuf field string output_uri = 3 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getOutputUri() - { - return $this->output_uri; - } - - /** - * Input only. Specify the `output_uri` to populate an empty `Job.config.output.uri` or - * `JobTemplate.config.output.uri` when using template. - * URI for the output file(s). For example, `gs://my-bucket/outputs/`. - * - * Generated from protobuf field string output_uri = 3 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setOutputUri($var) - { - GPBUtil::checkString($var, True); - $this->output_uri = $var; - - return $this; - } - - /** - * Input only. Specify the `template_id` to use for populating `Job.config`. The default - * is `preset/web-hd`. - * Preset Transcoder templates: - * - `preset/{preset_id}` - * - User defined JobTemplate: - * `{job_template_id}` - * - * Generated from protobuf field string template_id = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getTemplateId() - { - return $this->readOneof(4); - } - - public function hasTemplateId() - { - return $this->hasOneof(4); - } - - /** - * Input only. Specify the `template_id` to use for populating `Job.config`. The default - * is `preset/web-hd`. - * Preset Transcoder templates: - * - `preset/{preset_id}` - * - User defined JobTemplate: - * `{job_template_id}` - * - * Generated from protobuf field string template_id = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTemplateId($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * The configuration for this job. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.JobConfig config = 5; - * @return \Google\Cloud\Video\Transcoder\V1beta1\JobConfig|null - */ - public function getConfig() - { - return $this->readOneof(5); - } - - public function hasConfig() - { - return $this->hasOneof(5); - } - - /** - * The configuration for this job. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.JobConfig config = 5; - * @param \Google\Cloud\Video\Transcoder\V1beta1\JobConfig $var - * @return $this - */ - public function setConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\JobConfig::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Specify the priority of the job. Enter a value between 0 and 100, where 0 - * is the lowest priority and 100 is the highest priority. The default is 0. - * - * Generated from protobuf field int32 priority = 6; - * @return int - */ - public function getPriority() - { - return $this->priority; - } - - /** - * Specify the priority of the job. Enter a value between 0 and 100, where 0 - * is the lowest priority and 100 is the highest priority. The default is 0. - * - * Generated from protobuf field int32 priority = 6; - * @param int $var - * @return $this - */ - public function setPriority($var) - { - GPBUtil::checkInt32($var); - $this->priority = $var; - - return $this; - } - - /** - * Output only. The origin URI. - * - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Job.OriginUri origin_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Job\OriginUri|null - */ - public function getOriginUri() - { - return $this->origin_uri; - } - - public function hasOriginUri() - { - return isset($this->origin_uri); - } - - public function clearOriginUri() - { - unset($this->origin_uri); - } - - /** - * Output only. The origin URI. - * - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Job.OriginUri origin_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Job\OriginUri $var - * @return $this - */ - public function setOriginUri($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Job\OriginUri::class); - $this->origin_uri = $var; - - return $this; - } - - /** - * Output only. The current state of the job. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Job.ProcessingState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the job. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Job.ProcessingState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Video\Transcoder\V1beta1\Job\ProcessingState::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Estimated fractional progress, from `0` to `1` for each - * step. - * - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Progress progress = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Progress|null - */ - public function getProgress() - { - return $this->progress; - } - - public function hasProgress() - { - return isset($this->progress); - } - - public function clearProgress() - { - unset($this->progress); - } - - /** - * Output only. Estimated fractional progress, from `0` to `1` for each - * step. - * - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Progress progress = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Progress $var - * @return $this - */ - public function setProgress($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Progress::class); - $this->progress = $var; - - return $this; - } - - /** - * Output only. A description of the reason for the failure. This property is - * always present when `state` is `FAILED`. - * - * Generated from protobuf field string failure_reason = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getFailureReason() - { - return $this->failure_reason; - } - - /** - * Output only. A description of the reason for the failure. This property is - * always present when `state` is `FAILED`. - * - * Generated from protobuf field string failure_reason = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setFailureReason($var) - { - GPBUtil::checkString($var, True); - $this->failure_reason = $var; - - return $this; - } - - /** - * Output only. List of failure details. This property may contain additional - * information about the failure when `failure_reason` is present. - * - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.FailureDetail failure_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFailureDetails() - { - return $this->failure_details; - } - - /** - * Output only. List of failure details. This property may contain additional - * information about the failure when `failure_reason` is present. - * - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.FailureDetail failure_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Video\Transcoder\V1beta1\FailureDetail[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFailureDetails($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\FailureDetail::class); - $this->failure_details = $arr; - - return $this; - } - - /** - * Output only. The time the job was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time the job was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the transcoding started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time the transcoding started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time the transcoding finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the transcoding finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Job time to live value in days, which will be effective after job - * completion. Job should be deleted automatically after the given TTL. Enter - * a value between 1 and 90. The default is 30. - * - * Generated from protobuf field int32 ttl_after_completion_days = 15; - * @return int - */ - public function getTtlAfterCompletionDays() - { - return $this->ttl_after_completion_days; - } - - /** - * Job time to live value in days, which will be effective after job - * completion. Job should be deleted automatically after the given TTL. Enter - * a value between 1 and 90. The default is 30. - * - * Generated from protobuf field int32 ttl_after_completion_days = 15; - * @param int $var - * @return $this - */ - public function setTtlAfterCompletionDays($var) - { - GPBUtil::checkInt32($var); - $this->ttl_after_completion_days = $var; - - return $this; - } - - /** - * @return string - */ - public function getJobConfig() - { - return $this->whichOneof("job_config"); - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Job/OriginUri.php b/VideoTranscoder/src/V1beta1/Job/OriginUri.php deleted file mode 100644 index a74f11de9f24..000000000000 --- a/VideoTranscoder/src/V1beta1/Job/OriginUri.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Job.OriginUri - */ -class OriginUri extends \Google\Protobuf\Internal\Message -{ - /** - * HLS manifest URI per https://tools.ietf.org/html/rfc8216#section-4.3.4. - * If multiple HLS manifests are created, only the first one is listed. - * - * Generated from protobuf field string hls = 1; - */ - private $hls = ''; - /** - * Dash manifest URI. If multiple Dash manifests are created, only the first - * one is listed. - * - * Generated from protobuf field string dash = 2; - */ - private $dash = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $hls - * HLS manifest URI per https://tools.ietf.org/html/rfc8216#section-4.3.4. - * If multiple HLS manifests are created, only the first one is listed. - * @type string $dash - * Dash manifest URI. If multiple Dash manifests are created, only the first - * one is listed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * HLS manifest URI per https://tools.ietf.org/html/rfc8216#section-4.3.4. - * If multiple HLS manifests are created, only the first one is listed. - * - * Generated from protobuf field string hls = 1; - * @return string - */ - public function getHls() - { - return $this->hls; - } - - /** - * HLS manifest URI per https://tools.ietf.org/html/rfc8216#section-4.3.4. - * If multiple HLS manifests are created, only the first one is listed. - * - * Generated from protobuf field string hls = 1; - * @param string $var - * @return $this - */ - public function setHls($var) - { - GPBUtil::checkString($var, True); - $this->hls = $var; - - return $this; - } - - /** - * Dash manifest URI. If multiple Dash manifests are created, only the first - * one is listed. - * - * Generated from protobuf field string dash = 2; - * @return string - */ - public function getDash() - { - return $this->dash; - } - - /** - * Dash manifest URI. If multiple Dash manifests are created, only the first - * one is listed. - * - * Generated from protobuf field string dash = 2; - * @param string $var - * @return $this - */ - public function setDash($var) - { - GPBUtil::checkString($var, True); - $this->dash = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/Job/ProcessingState.php b/VideoTranscoder/src/V1beta1/Job/ProcessingState.php deleted file mode 100644 index 07a839d896ba..000000000000 --- a/VideoTranscoder/src/V1beta1/Job/ProcessingState.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Job.ProcessingState - */ -class ProcessingState -{ - /** - * The processing state is not specified. - * - * Generated from protobuf enum PROCESSING_STATE_UNSPECIFIED = 0; - */ - const PROCESSING_STATE_UNSPECIFIED = 0; - /** - * The job is enqueued and will be picked up for processing soon. - * - * Generated from protobuf enum PENDING = 1; - */ - const PENDING = 1; - /** - * The job is being processed. - * - * Generated from protobuf enum RUNNING = 2; - */ - const RUNNING = 2; - /** - * The job has been completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 3; - */ - const SUCCEEDED = 3; - /** - * The job has failed. For additional information, see `failure_reason` and - * `failure_details` - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - - private static $valueToName = [ - self::PROCESSING_STATE_UNSPECIFIED => 'PROCESSING_STATE_UNSPECIFIED', - self::PENDING => 'PENDING', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/VideoTranscoder/src/V1beta1/JobConfig.php b/VideoTranscoder/src/V1beta1/JobConfig.php deleted file mode 100644 index fe21cf76aff5..000000000000 --- a/VideoTranscoder/src/V1beta1/JobConfig.php +++ /dev/null @@ -1,401 +0,0 @@ -google.cloud.video.transcoder.v1beta1.JobConfig - */ -class JobConfig extends \Google\Protobuf\Internal\Message -{ - /** - * List of input assets stored in Cloud Storage. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Input inputs = 1; - */ - private $inputs; - /** - * List of `Edit atom`s. Defines the ultimate timeline of the resulting - * file or manifest. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.EditAtom edit_list = 2; - */ - private $edit_list; - /** - * List of elementary streams. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.ElementaryStream elementary_streams = 3; - */ - private $elementary_streams; - /** - * List of multiplexing settings for output streams. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.MuxStream mux_streams = 4; - */ - private $mux_streams; - /** - * List of output manifests. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Manifest manifests = 5; - */ - private $manifests; - /** - * Output configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Output output = 6; - */ - private $output = null; - /** - * List of ad breaks. Specifies where to insert ad break tags in the output - * manifests. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AdBreak ad_breaks = 7; - */ - private $ad_breaks; - /** - * Destination on Pub/Sub. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PubsubDestination pubsub_destination = 8; - */ - private $pubsub_destination = null; - /** - * List of output sprite sheets. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.SpriteSheet sprite_sheets = 9; - */ - private $sprite_sheets; - /** - * List of overlays on the output video, in descending Z-order. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Overlay overlays = 10; - */ - private $overlays; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Video\Transcoder\V1beta1\Input[]|\Google\Protobuf\Internal\RepeatedField $inputs - * List of input assets stored in Cloud Storage. - * @type \Google\Cloud\Video\Transcoder\V1beta1\EditAtom[]|\Google\Protobuf\Internal\RepeatedField $edit_list - * List of `Edit atom`s. Defines the ultimate timeline of the resulting - * file or manifest. - * @type \Google\Cloud\Video\Transcoder\V1beta1\ElementaryStream[]|\Google\Protobuf\Internal\RepeatedField $elementary_streams - * List of elementary streams. - * @type \Google\Cloud\Video\Transcoder\V1beta1\MuxStream[]|\Google\Protobuf\Internal\RepeatedField $mux_streams - * List of multiplexing settings for output streams. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Manifest[]|\Google\Protobuf\Internal\RepeatedField $manifests - * List of output manifests. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Output $output - * Output configuration. - * @type \Google\Cloud\Video\Transcoder\V1beta1\AdBreak[]|\Google\Protobuf\Internal\RepeatedField $ad_breaks - * List of ad breaks. Specifies where to insert ad break tags in the output - * manifests. - * @type \Google\Cloud\Video\Transcoder\V1beta1\PubsubDestination $pubsub_destination - * Destination on Pub/Sub. - * @type \Google\Cloud\Video\Transcoder\V1beta1\SpriteSheet[]|\Google\Protobuf\Internal\RepeatedField $sprite_sheets - * List of output sprite sheets. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Overlay[]|\Google\Protobuf\Internal\RepeatedField $overlays - * List of overlays on the output video, in descending Z-order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * List of input assets stored in Cloud Storage. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Input inputs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInputs() - { - return $this->inputs; - } - - /** - * List of input assets stored in Cloud Storage. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Input inputs = 1; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Input[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInputs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\Input::class); - $this->inputs = $arr; - - return $this; - } - - /** - * List of `Edit atom`s. Defines the ultimate timeline of the resulting - * file or manifest. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.EditAtom edit_list = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEditList() - { - return $this->edit_list; - } - - /** - * List of `Edit atom`s. Defines the ultimate timeline of the resulting - * file or manifest. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.EditAtom edit_list = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\EditAtom[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEditList($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\EditAtom::class); - $this->edit_list = $arr; - - return $this; - } - - /** - * List of elementary streams. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.ElementaryStream elementary_streams = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getElementaryStreams() - { - return $this->elementary_streams; - } - - /** - * List of elementary streams. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.ElementaryStream elementary_streams = 3; - * @param \Google\Cloud\Video\Transcoder\V1beta1\ElementaryStream[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setElementaryStreams($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\ElementaryStream::class); - $this->elementary_streams = $arr; - - return $this; - } - - /** - * List of multiplexing settings for output streams. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.MuxStream mux_streams = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMuxStreams() - { - return $this->mux_streams; - } - - /** - * List of multiplexing settings for output streams. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.MuxStream mux_streams = 4; - * @param \Google\Cloud\Video\Transcoder\V1beta1\MuxStream[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMuxStreams($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\MuxStream::class); - $this->mux_streams = $arr; - - return $this; - } - - /** - * List of output manifests. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Manifest manifests = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getManifests() - { - return $this->manifests; - } - - /** - * List of output manifests. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Manifest manifests = 5; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Manifest[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setManifests($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\Manifest::class); - $this->manifests = $arr; - - return $this; - } - - /** - * Output configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Output output = 6; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Output|null - */ - public function getOutput() - { - return $this->output; - } - - public function hasOutput() - { - return isset($this->output); - } - - public function clearOutput() - { - unset($this->output); - } - - /** - * Output configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Output output = 6; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Output $var - * @return $this - */ - public function setOutput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Output::class); - $this->output = $var; - - return $this; - } - - /** - * List of ad breaks. Specifies where to insert ad break tags in the output - * manifests. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AdBreak ad_breaks = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAdBreaks() - { - return $this->ad_breaks; - } - - /** - * List of ad breaks. Specifies where to insert ad break tags in the output - * manifests. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.AdBreak ad_breaks = 7; - * @param \Google\Cloud\Video\Transcoder\V1beta1\AdBreak[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAdBreaks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\AdBreak::class); - $this->ad_breaks = $arr; - - return $this; - } - - /** - * Destination on Pub/Sub. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PubsubDestination pubsub_destination = 8; - * @return \Google\Cloud\Video\Transcoder\V1beta1\PubsubDestination|null - */ - public function getPubsubDestination() - { - return $this->pubsub_destination; - } - - public function hasPubsubDestination() - { - return isset($this->pubsub_destination); - } - - public function clearPubsubDestination() - { - unset($this->pubsub_destination); - } - - /** - * Destination on Pub/Sub. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PubsubDestination pubsub_destination = 8; - * @param \Google\Cloud\Video\Transcoder\V1beta1\PubsubDestination $var - * @return $this - */ - public function setPubsubDestination($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\PubsubDestination::class); - $this->pubsub_destination = $var; - - return $this; - } - - /** - * List of output sprite sheets. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.SpriteSheet sprite_sheets = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSpriteSheets() - { - return $this->sprite_sheets; - } - - /** - * List of output sprite sheets. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.SpriteSheet sprite_sheets = 9; - * @param \Google\Cloud\Video\Transcoder\V1beta1\SpriteSheet[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSpriteSheets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\SpriteSheet::class); - $this->sprite_sheets = $arr; - - return $this; - } - - /** - * List of overlays on the output video, in descending Z-order. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Overlay overlays = 10; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOverlays() - { - return $this->overlays; - } - - /** - * List of overlays on the output video, in descending Z-order. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Overlay overlays = 10; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Overlay[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOverlays($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\Overlay::class); - $this->overlays = $arr; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/JobTemplate.php b/VideoTranscoder/src/V1beta1/JobTemplate.php deleted file mode 100644 index 9fb8966ac80c..000000000000 --- a/VideoTranscoder/src/V1beta1/JobTemplate.php +++ /dev/null @@ -1,119 +0,0 @@ -google.cloud.video.transcoder.v1beta1.JobTemplate - */ -class JobTemplate extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the job template. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The configuration for this template. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.JobConfig config = 2; - */ - private $config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the job template. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * @type \Google\Cloud\Video\Transcoder\V1beta1\JobConfig $config - * The configuration for this template. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the job template. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the job template. - * Format: - * `projects/{project}/locations/{location}/jobTemplates/{job_template}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The configuration for this template. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.JobConfig config = 2; - * @return \Google\Cloud\Video\Transcoder\V1beta1\JobConfig|null - */ - public function getConfig() - { - return $this->config; - } - - public function hasConfig() - { - return isset($this->config); - } - - public function clearConfig() - { - unset($this->config); - } - - /** - * The configuration for this template. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.JobConfig config = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\JobConfig $var - * @return $this - */ - public function setConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\JobConfig::class); - $this->config = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/ListJobTemplatesRequest.php b/VideoTranscoder/src/V1beta1/ListJobTemplatesRequest.php deleted file mode 100644 index 87de84e3104b..000000000000 --- a/VideoTranscoder/src/V1beta1/ListJobTemplatesRequest.php +++ /dev/null @@ -1,143 +0,0 @@ -google.cloud.video.transcoder.v1beta1.ListJobTemplatesRequest - */ -class ListJobTemplatesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent location from which to retrieve the collection of job templates. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The `next_page_token` value returned from a previous List request, if - * any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent location from which to retrieve the collection of job templates. - * Format: `projects/{project}/locations/{location}` - * @type int $page_size - * The maximum number of items to return. - * @type string $page_token - * The `next_page_token` value returned from a previous List request, if - * any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent location from which to retrieve the collection of job templates. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent location from which to retrieve the collection of job templates. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The `next_page_token` value returned from a previous List request, if - * any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The `next_page_token` value returned from a previous List request, if - * any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/ListJobTemplatesResponse.php b/VideoTranscoder/src/V1beta1/ListJobTemplatesResponse.php deleted file mode 100644 index 0a092acdd2c0..000000000000 --- a/VideoTranscoder/src/V1beta1/ListJobTemplatesResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.video.transcoder.v1beta1.ListJobTemplatesResponse - */ -class ListJobTemplatesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of job templates in the specified region. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.JobTemplate job_templates = 1; - */ - private $job_templates; - /** - * The pagination token. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Video\Transcoder\V1beta1\JobTemplate[]|\Google\Protobuf\Internal\RepeatedField $job_templates - * List of job templates in the specified region. - * @type string $next_page_token - * The pagination token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * List of job templates in the specified region. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.JobTemplate job_templates = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getJobTemplates() - { - return $this->job_templates; - } - - /** - * List of job templates in the specified region. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.JobTemplate job_templates = 1; - * @param \Google\Cloud\Video\Transcoder\V1beta1\JobTemplate[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setJobTemplates($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\JobTemplate::class); - $this->job_templates = $arr; - - return $this; - } - - /** - * The pagination token. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The pagination token. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/ListJobsRequest.php b/VideoTranscoder/src/V1beta1/ListJobsRequest.php deleted file mode 100644 index f6a2795a6d8e..000000000000 --- a/VideoTranscoder/src/V1beta1/ListJobsRequest.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.video.transcoder.v1beta1.ListJobsRequest - */ -class ListJobsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The `next_page_token` value returned from a previous List request, if - * any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Format: `projects/{project}/locations/{location}` - * @type int $page_size - * The maximum number of items to return. - * @type string $page_token - * The `next_page_token` value returned from a previous List request, if - * any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * Required. Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The `next_page_token` value returned from a previous List request, if - * any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The `next_page_token` value returned from a previous List request, if - * any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/ListJobsResponse.php b/VideoTranscoder/src/V1beta1/ListJobsResponse.php deleted file mode 100644 index 062cd8435005..000000000000 --- a/VideoTranscoder/src/V1beta1/ListJobsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.video.transcoder.v1beta1.ListJobsResponse - */ -class ListJobsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of jobs in the specified region. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Job jobs = 1; - */ - private $jobs; - /** - * The pagination token. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Video\Transcoder\V1beta1\Job[]|\Google\Protobuf\Internal\RepeatedField $jobs - * List of jobs in the specified region. - * @type string $next_page_token - * The pagination token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Services::initOnce(); - parent::__construct($data); - } - - /** - * List of jobs in the specified region. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Job jobs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getJobs() - { - return $this->jobs; - } - - /** - * List of jobs in the specified region. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Job jobs = 1; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Job[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setJobs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\Job::class); - $this->jobs = $arr; - - return $this; - } - - /** - * The pagination token. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The pagination token. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Manifest.php b/VideoTranscoder/src/V1beta1/Manifest.php deleted file mode 100644 index ff2515802e93..000000000000 --- a/VideoTranscoder/src/V1beta1/Manifest.php +++ /dev/null @@ -1,151 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Manifest - */ -class Manifest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the generated file. The default is `"manifest"` with the - * extension suffix corresponding to the `Manifest.type`. - * - * Generated from protobuf field string file_name = 1; - */ - private $file_name = ''; - /** - * Required. Type of the manifest, can be "HLS" or "DASH". - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Manifest.ManifestType type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $type = 0; - /** - * Required. List of user given `MuxStream.key`s that should appear in this manifest. - * When `Manifest.type` is `HLS`, a media manifest with name `MuxStream.key` - * and `.m3u8` extension is generated for each element of the - * `Manifest.mux_streams`. - * - * Generated from protobuf field repeated string mux_streams = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $mux_streams; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $file_name - * The name of the generated file. The default is `"manifest"` with the - * extension suffix corresponding to the `Manifest.type`. - * @type int $type - * Required. Type of the manifest, can be "HLS" or "DASH". - * @type string[]|\Google\Protobuf\Internal\RepeatedField $mux_streams - * Required. List of user given `MuxStream.key`s that should appear in this manifest. - * When `Manifest.type` is `HLS`, a media manifest with name `MuxStream.key` - * and `.m3u8` extension is generated for each element of the - * `Manifest.mux_streams`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The name of the generated file. The default is `"manifest"` with the - * extension suffix corresponding to the `Manifest.type`. - * - * Generated from protobuf field string file_name = 1; - * @return string - */ - public function getFileName() - { - return $this->file_name; - } - - /** - * The name of the generated file. The default is `"manifest"` with the - * extension suffix corresponding to the `Manifest.type`. - * - * Generated from protobuf field string file_name = 1; - * @param string $var - * @return $this - */ - public function setFileName($var) - { - GPBUtil::checkString($var, True); - $this->file_name = $var; - - return $this; - } - - /** - * Required. Type of the manifest, can be "HLS" or "DASH". - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Manifest.ManifestType type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Required. Type of the manifest, can be "HLS" or "DASH". - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Manifest.ManifestType type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Video\Transcoder\V1beta1\Manifest\ManifestType::class); - $this->type = $var; - - return $this; - } - - /** - * Required. List of user given `MuxStream.key`s that should appear in this manifest. - * When `Manifest.type` is `HLS`, a media manifest with name `MuxStream.key` - * and `.m3u8` extension is generated for each element of the - * `Manifest.mux_streams`. - * - * Generated from protobuf field repeated string mux_streams = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMuxStreams() - { - return $this->mux_streams; - } - - /** - * Required. List of user given `MuxStream.key`s that should appear in this manifest. - * When `Manifest.type` is `HLS`, a media manifest with name `MuxStream.key` - * and `.m3u8` extension is generated for each element of the - * `Manifest.mux_streams`. - * - * Generated from protobuf field repeated string mux_streams = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMuxStreams($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->mux_streams = $arr; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Manifest/ManifestType.php b/VideoTranscoder/src/V1beta1/Manifest/ManifestType.php deleted file mode 100644 index 4644db871eab..000000000000 --- a/VideoTranscoder/src/V1beta1/Manifest/ManifestType.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Manifest.ManifestType - */ -class ManifestType -{ - /** - * The manifest type is not specified. - * - * Generated from protobuf enum MANIFEST_TYPE_UNSPECIFIED = 0; - */ - const MANIFEST_TYPE_UNSPECIFIED = 0; - /** - * Create `"HLS"` manifest. The corresponding file extension is `".m3u8"`. - * - * Generated from protobuf enum HLS = 1; - */ - const HLS = 1; - /** - * Create `"DASH"` manifest. The corresponding file extension is `".mpd"`. - * - * Generated from protobuf enum DASH = 2; - */ - const DASH = 2; - - private static $valueToName = [ - self::MANIFEST_TYPE_UNSPECIFIED => 'MANIFEST_TYPE_UNSPECIFIED', - self::HLS => 'HLS', - self::DASH => 'DASH', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/VideoTranscoder/src/V1beta1/MuxStream.php b/VideoTranscoder/src/V1beta1/MuxStream.php deleted file mode 100644 index f765e9e6b151..000000000000 --- a/VideoTranscoder/src/V1beta1/MuxStream.php +++ /dev/null @@ -1,293 +0,0 @@ -google.cloud.video.transcoder.v1beta1.MuxStream - */ -class MuxStream extends \Google\Protobuf\Internal\Message -{ - /** - * A unique key for this multiplexed stream. HLS media manifests will be - * named `MuxStream.key` with the `".m3u8"` extension suffix. - * - * Generated from protobuf field string key = 1; - */ - private $key = ''; - /** - * The name of the generated file. The default is `MuxStream.key` with the - * extension suffix corresponding to the `MuxStream.container`. - * Individual segments also have an incremental 10-digit zero-padded suffix - * starting from 0 before the extension, such as `"mux_stream0000000123.ts"`. - * - * Generated from protobuf field string file_name = 2; - */ - private $file_name = ''; - /** - * The container format. The default is `"mp4"` - * Supported container formats: - * - 'ts' - * - 'fmp4'- the corresponding file extension is `".m4s"` - * - 'mp4' - * - 'vtt' - * - * Generated from protobuf field string container = 3; - */ - private $container = ''; - /** - * List of `ElementaryStream.key`s multiplexed in this stream. - * - * Generated from protobuf field repeated string elementary_streams = 4; - */ - private $elementary_streams; - /** - * Segment settings for `"ts"`, `"fmp4"` and `"vtt"`. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.SegmentSettings segment_settings = 5; - */ - private $segment_settings = null; - /** - * Encryption settings. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Encryption encryption = 6; - */ - private $encryption = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * A unique key for this multiplexed stream. HLS media manifests will be - * named `MuxStream.key` with the `".m3u8"` extension suffix. - * @type string $file_name - * The name of the generated file. The default is `MuxStream.key` with the - * extension suffix corresponding to the `MuxStream.container`. - * Individual segments also have an incremental 10-digit zero-padded suffix - * starting from 0 before the extension, such as `"mux_stream0000000123.ts"`. - * @type string $container - * The container format. The default is `"mp4"` - * Supported container formats: - * - 'ts' - * - 'fmp4'- the corresponding file extension is `".m4s"` - * - 'mp4' - * - 'vtt' - * @type string[]|\Google\Protobuf\Internal\RepeatedField $elementary_streams - * List of `ElementaryStream.key`s multiplexed in this stream. - * @type \Google\Cloud\Video\Transcoder\V1beta1\SegmentSettings $segment_settings - * Segment settings for `"ts"`, `"fmp4"` and `"vtt"`. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Encryption $encryption - * Encryption settings. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * A unique key for this multiplexed stream. HLS media manifests will be - * named `MuxStream.key` with the `".m3u8"` extension suffix. - * - * Generated from protobuf field string key = 1; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * A unique key for this multiplexed stream. HLS media manifests will be - * named `MuxStream.key` with the `".m3u8"` extension suffix. - * - * Generated from protobuf field string key = 1; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * The name of the generated file. The default is `MuxStream.key` with the - * extension suffix corresponding to the `MuxStream.container`. - * Individual segments also have an incremental 10-digit zero-padded suffix - * starting from 0 before the extension, such as `"mux_stream0000000123.ts"`. - * - * Generated from protobuf field string file_name = 2; - * @return string - */ - public function getFileName() - { - return $this->file_name; - } - - /** - * The name of the generated file. The default is `MuxStream.key` with the - * extension suffix corresponding to the `MuxStream.container`. - * Individual segments also have an incremental 10-digit zero-padded suffix - * starting from 0 before the extension, such as `"mux_stream0000000123.ts"`. - * - * Generated from protobuf field string file_name = 2; - * @param string $var - * @return $this - */ - public function setFileName($var) - { - GPBUtil::checkString($var, True); - $this->file_name = $var; - - return $this; - } - - /** - * The container format. The default is `"mp4"` - * Supported container formats: - * - 'ts' - * - 'fmp4'- the corresponding file extension is `".m4s"` - * - 'mp4' - * - 'vtt' - * - * Generated from protobuf field string container = 3; - * @return string - */ - public function getContainer() - { - return $this->container; - } - - /** - * The container format. The default is `"mp4"` - * Supported container formats: - * - 'ts' - * - 'fmp4'- the corresponding file extension is `".m4s"` - * - 'mp4' - * - 'vtt' - * - * Generated from protobuf field string container = 3; - * @param string $var - * @return $this - */ - public function setContainer($var) - { - GPBUtil::checkString($var, True); - $this->container = $var; - - return $this; - } - - /** - * List of `ElementaryStream.key`s multiplexed in this stream. - * - * Generated from protobuf field repeated string elementary_streams = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getElementaryStreams() - { - return $this->elementary_streams; - } - - /** - * List of `ElementaryStream.key`s multiplexed in this stream. - * - * Generated from protobuf field repeated string elementary_streams = 4; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setElementaryStreams($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->elementary_streams = $arr; - - return $this; - } - - /** - * Segment settings for `"ts"`, `"fmp4"` and `"vtt"`. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.SegmentSettings segment_settings = 5; - * @return \Google\Cloud\Video\Transcoder\V1beta1\SegmentSettings|null - */ - public function getSegmentSettings() - { - return $this->segment_settings; - } - - public function hasSegmentSettings() - { - return isset($this->segment_settings); - } - - public function clearSegmentSettings() - { - unset($this->segment_settings); - } - - /** - * Segment settings for `"ts"`, `"fmp4"` and `"vtt"`. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.SegmentSettings segment_settings = 5; - * @param \Google\Cloud\Video\Transcoder\V1beta1\SegmentSettings $var - * @return $this - */ - public function setSegmentSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\SegmentSettings::class); - $this->segment_settings = $var; - - return $this; - } - - /** - * Encryption settings. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Encryption encryption = 6; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Encryption|null - */ - public function getEncryption() - { - return $this->encryption; - } - - public function hasEncryption() - { - return isset($this->encryption); - } - - public function clearEncryption() - { - unset($this->encryption); - } - - /** - * Encryption settings. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Encryption encryption = 6; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Encryption $var - * @return $this - */ - public function setEncryption($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Encryption::class); - $this->encryption = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Output.php b/VideoTranscoder/src/V1beta1/Output.php deleted file mode 100644 index 27bc9e4ebd8f..000000000000 --- a/VideoTranscoder/src/V1beta1/Output.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Output - */ -class Output extends \Google\Protobuf\Internal\Message -{ - /** - * URI for the output file(s). For example, `gs://my-bucket/outputs/`. - * If empty the value is populated from `Job.output_uri`. - * - * Generated from protobuf field string uri = 1; - */ - private $uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * URI for the output file(s). For example, `gs://my-bucket/outputs/`. - * If empty the value is populated from `Job.output_uri`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * URI for the output file(s). For example, `gs://my-bucket/outputs/`. - * If empty the value is populated from `Job.output_uri`. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * URI for the output file(s). For example, `gs://my-bucket/outputs/`. - * If empty the value is populated from `Job.output_uri`. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Overlay.php b/VideoTranscoder/src/V1beta1/Overlay.php deleted file mode 100644 index cb0058c4bbc9..000000000000 --- a/VideoTranscoder/src/V1beta1/Overlay.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Overlay - */ -class Overlay extends \Google\Protobuf\Internal\Message -{ - /** - * Image overlay. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.Image image = 1; - */ - private $image = null; - /** - * List of Animations. The list should be chronological, without any time - * overlap. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Overlay.Animation animations = 2; - */ - private $animations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Video\Transcoder\V1beta1\Overlay\Image $image - * Image overlay. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Overlay\Animation[]|\Google\Protobuf\Internal\RepeatedField $animations - * List of Animations. The list should be chronological, without any time - * overlap. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Image overlay. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.Image image = 1; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Overlay\Image|null - */ - public function getImage() - { - return $this->image; - } - - public function hasImage() - { - return isset($this->image); - } - - public function clearImage() - { - unset($this->image); - } - - /** - * Image overlay. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.Image image = 1; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Overlay\Image $var - * @return $this - */ - public function setImage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Overlay\Image::class); - $this->image = $var; - - return $this; - } - - /** - * List of Animations. The list should be chronological, without any time - * overlap. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Overlay.Animation animations = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAnimations() - { - return $this->animations; - } - - /** - * List of Animations. The list should be chronological, without any time - * overlap. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.Overlay.Animation animations = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Overlay\Animation[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAnimations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\Overlay\Animation::class); - $this->animations = $arr; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/Overlay/Animation.php b/VideoTranscoder/src/V1beta1/Overlay/Animation.php deleted file mode 100644 index 8674eb1c9b5f..000000000000 --- a/VideoTranscoder/src/V1beta1/Overlay/Animation.php +++ /dev/null @@ -1,142 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Overlay.Animation - */ -class Animation extends \Google\Protobuf\Internal\Message -{ - protected $animation_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationStatic $animation_static - * Display static overlay object. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationFade $animation_fade - * Display overlay object with fade animation. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationEnd $animation_end - * End previous animation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Display static overlay object. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.AnimationStatic animation_static = 1; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationStatic|null - */ - public function getAnimationStatic() - { - return $this->readOneof(1); - } - - public function hasAnimationStatic() - { - return $this->hasOneof(1); - } - - /** - * Display static overlay object. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.AnimationStatic animation_static = 1; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationStatic $var - * @return $this - */ - public function setAnimationStatic($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationStatic::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Display overlay object with fade animation. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.AnimationFade animation_fade = 2; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationFade|null - */ - public function getAnimationFade() - { - return $this->readOneof(2); - } - - public function hasAnimationFade() - { - return $this->hasOneof(2); - } - - /** - * Display overlay object with fade animation. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.AnimationFade animation_fade = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationFade $var - * @return $this - */ - public function setAnimationFade($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationFade::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * End previous animation. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.AnimationEnd animation_end = 3; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationEnd|null - */ - public function getAnimationEnd() - { - return $this->readOneof(3); - } - - public function hasAnimationEnd() - { - return $this->hasOneof(3); - } - - /** - * End previous animation. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.AnimationEnd animation_end = 3; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationEnd $var - * @return $this - */ - public function setAnimationEnd($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Overlay\AnimationEnd::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getAnimationType() - { - return $this->whichOneof("animation_type"); - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/Overlay/AnimationEnd.php b/VideoTranscoder/src/V1beta1/Overlay/AnimationEnd.php deleted file mode 100644 index 3892e806fb78..000000000000 --- a/VideoTranscoder/src/V1beta1/Overlay/AnimationEnd.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Overlay.AnimationEnd - */ -class AnimationEnd extends \Google\Protobuf\Internal\Message -{ - /** - * The time to end overlay object, in seconds. Default: 0 - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; - */ - private $start_time_offset = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $start_time_offset - * The time to end overlay object, in seconds. Default: 0 - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The time to end overlay object, in seconds. Default: 0 - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; - * @return \Google\Protobuf\Duration|null - */ - public function getStartTimeOffset() - { - return $this->start_time_offset; - } - - public function hasStartTimeOffset() - { - return isset($this->start_time_offset); - } - - public function clearStartTimeOffset() - { - unset($this->start_time_offset); - } - - /** - * The time to end overlay object, in seconds. Default: 0 - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setStartTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->start_time_offset = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/Overlay/AnimationFade.php b/VideoTranscoder/src/V1beta1/Overlay/AnimationFade.php deleted file mode 100644 index 933b577c4328..000000000000 --- a/VideoTranscoder/src/V1beta1/Overlay/AnimationFade.php +++ /dev/null @@ -1,220 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Overlay.AnimationFade - */ -class AnimationFade extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Type of fade animation: `FADE_IN` or `FADE_OUT`. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.FadeType fade_type = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $fade_type = 0; - /** - * Normalized coordinates based on output video resolution. Valid - * values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay - * object. For example, use the x and y coordinates {0,0} to position the - * top-left corner of the overlay animation in the top-left corner of the - * output video. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate xy = 2; - */ - private $xy = null; - /** - * The time to start the fade animation, in seconds. Default: 0 - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 3; - */ - private $start_time_offset = null; - /** - * The time to end the fade animation, in seconds. Default: - * `start_time_offset` + 1s - * - * Generated from protobuf field .google.protobuf.Duration end_time_offset = 4; - */ - private $end_time_offset = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $fade_type - * Required. Type of fade animation: `FADE_IN` or `FADE_OUT`. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate $xy - * Normalized coordinates based on output video resolution. Valid - * values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay - * object. For example, use the x and y coordinates {0,0} to position the - * top-left corner of the overlay animation in the top-left corner of the - * output video. - * @type \Google\Protobuf\Duration $start_time_offset - * The time to start the fade animation, in seconds. Default: 0 - * @type \Google\Protobuf\Duration $end_time_offset - * The time to end the fade animation, in seconds. Default: - * `start_time_offset` + 1s - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. Type of fade animation: `FADE_IN` or `FADE_OUT`. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.FadeType fade_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getFadeType() - { - return $this->fade_type; - } - - /** - * Required. Type of fade animation: `FADE_IN` or `FADE_OUT`. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.FadeType fade_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setFadeType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Video\Transcoder\V1beta1\Overlay\FadeType::class); - $this->fade_type = $var; - - return $this; - } - - /** - * Normalized coordinates based on output video resolution. Valid - * values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay - * object. For example, use the x and y coordinates {0,0} to position the - * top-left corner of the overlay animation in the top-left corner of the - * output video. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate xy = 2; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate|null - */ - public function getXy() - { - return $this->xy; - } - - public function hasXy() - { - return isset($this->xy); - } - - public function clearXy() - { - unset($this->xy); - } - - /** - * Normalized coordinates based on output video resolution. Valid - * values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay - * object. For example, use the x and y coordinates {0,0} to position the - * top-left corner of the overlay animation in the top-left corner of the - * output video. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate xy = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate $var - * @return $this - */ - public function setXy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate::class); - $this->xy = $var; - - return $this; - } - - /** - * The time to start the fade animation, in seconds. Default: 0 - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getStartTimeOffset() - { - return $this->start_time_offset; - } - - public function hasStartTimeOffset() - { - return isset($this->start_time_offset); - } - - public function clearStartTimeOffset() - { - unset($this->start_time_offset); - } - - /** - * The time to start the fade animation, in seconds. Default: 0 - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setStartTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->start_time_offset = $var; - - return $this; - } - - /** - * The time to end the fade animation, in seconds. Default: - * `start_time_offset` + 1s - * - * Generated from protobuf field .google.protobuf.Duration end_time_offset = 4; - * @return \Google\Protobuf\Duration|null - */ - public function getEndTimeOffset() - { - return $this->end_time_offset; - } - - public function hasEndTimeOffset() - { - return isset($this->end_time_offset); - } - - public function clearEndTimeOffset() - { - unset($this->end_time_offset); - } - - /** - * The time to end the fade animation, in seconds. Default: - * `start_time_offset` + 1s - * - * Generated from protobuf field .google.protobuf.Duration end_time_offset = 4; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setEndTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->end_time_offset = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/Overlay/AnimationStatic.php b/VideoTranscoder/src/V1beta1/Overlay/AnimationStatic.php deleted file mode 100644 index 2885bbd9ff4c..000000000000 --- a/VideoTranscoder/src/V1beta1/Overlay/AnimationStatic.php +++ /dev/null @@ -1,138 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Overlay.AnimationStatic - */ -class AnimationStatic extends \Google\Protobuf\Internal\Message -{ - /** - * Normalized coordinates based on output video resolution. Valid - * values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay - * object. For example, use the x and y coordinates {0,0} to position the - * top-left corner of the overlay animation in the top-left corner of the - * output video. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate xy = 1; - */ - private $xy = null; - /** - * The time to start displaying the overlay object, in seconds. Default: 0 - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 2; - */ - private $start_time_offset = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate $xy - * Normalized coordinates based on output video resolution. Valid - * values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay - * object. For example, use the x and y coordinates {0,0} to position the - * top-left corner of the overlay animation in the top-left corner of the - * output video. - * @type \Google\Protobuf\Duration $start_time_offset - * The time to start displaying the overlay object, in seconds. Default: 0 - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Normalized coordinates based on output video resolution. Valid - * values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay - * object. For example, use the x and y coordinates {0,0} to position the - * top-left corner of the overlay animation in the top-left corner of the - * output video. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate xy = 1; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate|null - */ - public function getXy() - { - return $this->xy; - } - - public function hasXy() - { - return isset($this->xy); - } - - public function clearXy() - { - unset($this->xy); - } - - /** - * Normalized coordinates based on output video resolution. Valid - * values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay - * object. For example, use the x and y coordinates {0,0} to position the - * top-left corner of the overlay animation in the top-left corner of the - * output video. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate xy = 1; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate $var - * @return $this - */ - public function setXy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate::class); - $this->xy = $var; - - return $this; - } - - /** - * The time to start displaying the overlay object, in seconds. Default: 0 - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getStartTimeOffset() - { - return $this->start_time_offset; - } - - public function hasStartTimeOffset() - { - return isset($this->start_time_offset); - } - - public function clearStartTimeOffset() - { - unset($this->start_time_offset); - } - - /** - * The time to start displaying the overlay object, in seconds. Default: 0 - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setStartTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->start_time_offset = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/Overlay/FadeType.php b/VideoTranscoder/src/V1beta1/Overlay/FadeType.php deleted file mode 100644 index 5ca24614c7f2..000000000000 --- a/VideoTranscoder/src/V1beta1/Overlay/FadeType.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Overlay.FadeType - */ -class FadeType -{ - /** - * The fade type is not specified. - * - * Generated from protobuf enum FADE_TYPE_UNSPECIFIED = 0; - */ - const FADE_TYPE_UNSPECIFIED = 0; - /** - * Fade the overlay object into view. - * - * Generated from protobuf enum FADE_IN = 1; - */ - const FADE_IN = 1; - /** - * Fade the overlay object out of view. - * - * Generated from protobuf enum FADE_OUT = 2; - */ - const FADE_OUT = 2; - - private static $valueToName = [ - self::FADE_TYPE_UNSPECIFIED => 'FADE_TYPE_UNSPECIFIED', - self::FADE_IN => 'FADE_IN', - self::FADE_OUT => 'FADE_OUT', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/VideoTranscoder/src/V1beta1/Overlay/Image.php b/VideoTranscoder/src/V1beta1/Overlay/Image.php deleted file mode 100644 index 302ad9046410..000000000000 --- a/VideoTranscoder/src/V1beta1/Overlay/Image.php +++ /dev/null @@ -1,166 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Overlay.Image - */ -class Image extends \Google\Protobuf\Internal\Message -{ - /** - * Required. URI of the JPEG image in Cloud Storage. For example, - * `gs://bucket/inputs/image.jpeg`. JPEG is the only supported image type. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $uri = ''; - /** - * Normalized image resolution, based on output video resolution. Valid - * values: `0.0`–`1.0`. To respect the original image aspect ratio, set - * either `x` or `y` to `0.0`. To use the original image resolution, set - * both `x` and `y` to `0.0`. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate resolution = 2; - */ - private $resolution = null; - /** - * Target image opacity. Valid values are from `1.0` (solid, default) to - * `0.0` (transparent), exclusive. Set this to a value greater than `0.0`. - * - * Generated from protobuf field double alpha = 3; - */ - private $alpha = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. URI of the JPEG image in Cloud Storage. For example, - * `gs://bucket/inputs/image.jpeg`. JPEG is the only supported image type. - * @type \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate $resolution - * Normalized image resolution, based on output video resolution. Valid - * values: `0.0`–`1.0`. To respect the original image aspect ratio, set - * either `x` or `y` to `0.0`. To use the original image resolution, set - * both `x` and `y` to `0.0`. - * @type float $alpha - * Target image opacity. Valid values are from `1.0` (solid, default) to - * `0.0` (transparent), exclusive. Set this to a value greater than `0.0`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. URI of the JPEG image in Cloud Storage. For example, - * `gs://bucket/inputs/image.jpeg`. JPEG is the only supported image type. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. URI of the JPEG image in Cloud Storage. For example, - * `gs://bucket/inputs/image.jpeg`. JPEG is the only supported image type. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Normalized image resolution, based on output video resolution. Valid - * values: `0.0`–`1.0`. To respect the original image aspect ratio, set - * either `x` or `y` to `0.0`. To use the original image resolution, set - * both `x` and `y` to `0.0`. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate resolution = 2; - * @return \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate|null - */ - public function getResolution() - { - return $this->resolution; - } - - public function hasResolution() - { - return isset($this->resolution); - } - - public function clearResolution() - { - unset($this->resolution); - } - - /** - * Normalized image resolution, based on output video resolution. Valid - * values: `0.0`–`1.0`. To respect the original image aspect ratio, set - * either `x` or `y` to `0.0`. To use the original image resolution, set - * both `x` and `y` to `0.0`. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate resolution = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate $var - * @return $this - */ - public function setResolution($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\Overlay\NormalizedCoordinate::class); - $this->resolution = $var; - - return $this; - } - - /** - * Target image opacity. Valid values are from `1.0` (solid, default) to - * `0.0` (transparent), exclusive. Set this to a value greater than `0.0`. - * - * Generated from protobuf field double alpha = 3; - * @return float - */ - public function getAlpha() - { - return $this->alpha; - } - - /** - * Target image opacity. Valid values are from `1.0` (solid, default) to - * `0.0` (transparent), exclusive. Set this to a value greater than `0.0`. - * - * Generated from protobuf field double alpha = 3; - * @param float $var - * @return $this - */ - public function setAlpha($var) - { - GPBUtil::checkDouble($var); - $this->alpha = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/Overlay/NormalizedCoordinate.php b/VideoTranscoder/src/V1beta1/Overlay/NormalizedCoordinate.php deleted file mode 100644 index c7acc8ac3a7f..000000000000 --- a/VideoTranscoder/src/V1beta1/Overlay/NormalizedCoordinate.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Overlay.NormalizedCoordinate - */ -class NormalizedCoordinate extends \Google\Protobuf\Internal\Message -{ - /** - * Normalized x coordinate. - * - * Generated from protobuf field double x = 1; - */ - private $x = 0.0; - /** - * Normalized y coordinate. - * - * Generated from protobuf field double y = 2; - */ - private $y = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $x - * Normalized x coordinate. - * @type float $y - * Normalized y coordinate. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Normalized x coordinate. - * - * Generated from protobuf field double x = 1; - * @return float - */ - public function getX() - { - return $this->x; - } - - /** - * Normalized x coordinate. - * - * Generated from protobuf field double x = 1; - * @param float $var - * @return $this - */ - public function setX($var) - { - GPBUtil::checkDouble($var); - $this->x = $var; - - return $this; - } - - /** - * Normalized y coordinate. - * - * Generated from protobuf field double y = 2; - * @return float - */ - public function getY() - { - return $this->y; - } - - /** - * Normalized y coordinate. - * - * Generated from protobuf field double y = 2; - * @param float $var - * @return $this - */ - public function setY($var) - { - GPBUtil::checkDouble($var); - $this->y = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/PreprocessingConfig.php b/VideoTranscoder/src/V1beta1/PreprocessingConfig.php deleted file mode 100644 index 62ccd6200bc6..000000000000 --- a/VideoTranscoder/src/V1beta1/PreprocessingConfig.php +++ /dev/null @@ -1,297 +0,0 @@ -google.cloud.video.transcoder.v1beta1.PreprocessingConfig - */ -class PreprocessingConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Color preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Color color = 1; - */ - private $color = null; - /** - * Denoise preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Denoise denoise = 2; - */ - private $denoise = null; - /** - * Deblock preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Deblock deblock = 3; - */ - private $deblock = null; - /** - * Audio preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Audio audio = 4; - */ - private $audio = null; - /** - * Specify the video cropping configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Crop crop = 5; - */ - private $crop = null; - /** - * Specify the video pad filter configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Pad pad = 6; - */ - private $pad = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Color $color - * Color preprocessing configuration. - * @type \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Denoise $denoise - * Denoise preprocessing configuration. - * @type \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Deblock $deblock - * Deblock preprocessing configuration. - * @type \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Audio $audio - * Audio preprocessing configuration. - * @type \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Crop $crop - * Specify the video cropping configuration. - * @type \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Pad $pad - * Specify the video pad filter configuration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Color preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Color color = 1; - * @return \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Color|null - */ - public function getColor() - { - return $this->color; - } - - public function hasColor() - { - return isset($this->color); - } - - public function clearColor() - { - unset($this->color); - } - - /** - * Color preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Color color = 1; - * @param \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Color $var - * @return $this - */ - public function setColor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Color::class); - $this->color = $var; - - return $this; - } - - /** - * Denoise preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Denoise denoise = 2; - * @return \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Denoise|null - */ - public function getDenoise() - { - return $this->denoise; - } - - public function hasDenoise() - { - return isset($this->denoise); - } - - public function clearDenoise() - { - unset($this->denoise); - } - - /** - * Denoise preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Denoise denoise = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Denoise $var - * @return $this - */ - public function setDenoise($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Denoise::class); - $this->denoise = $var; - - return $this; - } - - /** - * Deblock preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Deblock deblock = 3; - * @return \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Deblock|null - */ - public function getDeblock() - { - return $this->deblock; - } - - public function hasDeblock() - { - return isset($this->deblock); - } - - public function clearDeblock() - { - unset($this->deblock); - } - - /** - * Deblock preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Deblock deblock = 3; - * @param \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Deblock $var - * @return $this - */ - public function setDeblock($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Deblock::class); - $this->deblock = $var; - - return $this; - } - - /** - * Audio preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Audio audio = 4; - * @return \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Audio|null - */ - public function getAudio() - { - return $this->audio; - } - - public function hasAudio() - { - return isset($this->audio); - } - - public function clearAudio() - { - unset($this->audio); - } - - /** - * Audio preprocessing configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Audio audio = 4; - * @param \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Audio $var - * @return $this - */ - public function setAudio($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Audio::class); - $this->audio = $var; - - return $this; - } - - /** - * Specify the video cropping configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Crop crop = 5; - * @return \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Crop|null - */ - public function getCrop() - { - return $this->crop; - } - - public function hasCrop() - { - return isset($this->crop); - } - - public function clearCrop() - { - unset($this->crop); - } - - /** - * Specify the video cropping configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Crop crop = 5; - * @param \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Crop $var - * @return $this - */ - public function setCrop($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Crop::class); - $this->crop = $var; - - return $this; - } - - /** - * Specify the video pad filter configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Pad pad = 6; - * @return \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Pad|null - */ - public function getPad() - { - return $this->pad; - } - - public function hasPad() - { - return isset($this->pad); - } - - public function clearPad() - { - unset($this->pad); - } - - /** - * Specify the video pad filter configuration. - * - * Generated from protobuf field .google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Pad pad = 6; - * @param \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Pad $var - * @return $this - */ - public function setPad($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Video\Transcoder\V1beta1\PreprocessingConfig\Pad::class); - $this->pad = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Audio.php b/VideoTranscoder/src/V1beta1/PreprocessingConfig/Audio.php deleted file mode 100644 index 1d2838500b7b..000000000000 --- a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Audio.php +++ /dev/null @@ -1,172 +0,0 @@ -google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Audio - */ -class Audio extends \Google\Protobuf\Internal\Message -{ - /** - * Specify audio loudness normalization in loudness units relative to full - * scale (LUFS). Enter a value between -24 and 0 (the default), where: - * * -24 is the Advanced Television Systems Committee (ATSC A/85) standard - * * -23 is the EU R128 broadcast standard - * * -19 is the prior standard for online mono audio - * * -18 is the ReplayGain standard - * * -16 is the prior standard for stereo audio - * * -14 is the new online audio standard recommended by Spotify, as well - * as Amazon Echo - * * 0 disables normalization - * - * Generated from protobuf field double lufs = 1; - */ - private $lufs = 0.0; - /** - * Enable boosting high frequency components. The default is `false`. - * - * Generated from protobuf field bool high_boost = 2; - */ - private $high_boost = false; - /** - * Enable boosting low frequency components. The default is `false`. - * - * Generated from protobuf field bool low_boost = 3; - */ - private $low_boost = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $lufs - * Specify audio loudness normalization in loudness units relative to full - * scale (LUFS). Enter a value between -24 and 0 (the default), where: - * * -24 is the Advanced Television Systems Committee (ATSC A/85) standard - * * -23 is the EU R128 broadcast standard - * * -19 is the prior standard for online mono audio - * * -18 is the ReplayGain standard - * * -16 is the prior standard for stereo audio - * * -14 is the new online audio standard recommended by Spotify, as well - * as Amazon Echo - * * 0 disables normalization - * @type bool $high_boost - * Enable boosting high frequency components. The default is `false`. - * @type bool $low_boost - * Enable boosting low frequency components. The default is `false`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Specify audio loudness normalization in loudness units relative to full - * scale (LUFS). Enter a value between -24 and 0 (the default), where: - * * -24 is the Advanced Television Systems Committee (ATSC A/85) standard - * * -23 is the EU R128 broadcast standard - * * -19 is the prior standard for online mono audio - * * -18 is the ReplayGain standard - * * -16 is the prior standard for stereo audio - * * -14 is the new online audio standard recommended by Spotify, as well - * as Amazon Echo - * * 0 disables normalization - * - * Generated from protobuf field double lufs = 1; - * @return float - */ - public function getLufs() - { - return $this->lufs; - } - - /** - * Specify audio loudness normalization in loudness units relative to full - * scale (LUFS). Enter a value between -24 and 0 (the default), where: - * * -24 is the Advanced Television Systems Committee (ATSC A/85) standard - * * -23 is the EU R128 broadcast standard - * * -19 is the prior standard for online mono audio - * * -18 is the ReplayGain standard - * * -16 is the prior standard for stereo audio - * * -14 is the new online audio standard recommended by Spotify, as well - * as Amazon Echo - * * 0 disables normalization - * - * Generated from protobuf field double lufs = 1; - * @param float $var - * @return $this - */ - public function setLufs($var) - { - GPBUtil::checkDouble($var); - $this->lufs = $var; - - return $this; - } - - /** - * Enable boosting high frequency components. The default is `false`. - * - * Generated from protobuf field bool high_boost = 2; - * @return bool - */ - public function getHighBoost() - { - return $this->high_boost; - } - - /** - * Enable boosting high frequency components. The default is `false`. - * - * Generated from protobuf field bool high_boost = 2; - * @param bool $var - * @return $this - */ - public function setHighBoost($var) - { - GPBUtil::checkBool($var); - $this->high_boost = $var; - - return $this; - } - - /** - * Enable boosting low frequency components. The default is `false`. - * - * Generated from protobuf field bool low_boost = 3; - * @return bool - */ - public function getLowBoost() - { - return $this->low_boost; - } - - /** - * Enable boosting low frequency components. The default is `false`. - * - * Generated from protobuf field bool low_boost = 3; - * @param bool $var - * @return $this - */ - public function setLowBoost($var) - { - GPBUtil::checkBool($var); - $this->low_boost = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Color.php b/VideoTranscoder/src/V1beta1/PreprocessingConfig/Color.php deleted file mode 100644 index e5667f14599c..000000000000 --- a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Color.php +++ /dev/null @@ -1,160 +0,0 @@ -google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Color - */ -class Color extends \Google\Protobuf\Internal\Message -{ - /** - * Control color saturation of the video. Enter a value between -1 and 1, - * where -1 is fully desaturated and 1 is maximum saturation. 0 is no - * change. The default is 0. - * - * Generated from protobuf field double saturation = 1; - */ - private $saturation = 0.0; - /** - * Control black and white contrast of the video. Enter a value between -1 - * and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no - * change. The default is 0. - * - * Generated from protobuf field double contrast = 2; - */ - private $contrast = 0.0; - /** - * Control brightness of the video. Enter a value between -1 and 1, where -1 - * is minimum brightness and 1 is maximum brightness. 0 is no change. The - * default is 0. - * - * Generated from protobuf field double brightness = 3; - */ - private $brightness = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $saturation - * Control color saturation of the video. Enter a value between -1 and 1, - * where -1 is fully desaturated and 1 is maximum saturation. 0 is no - * change. The default is 0. - * @type float $contrast - * Control black and white contrast of the video. Enter a value between -1 - * and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no - * change. The default is 0. - * @type float $brightness - * Control brightness of the video. Enter a value between -1 and 1, where -1 - * is minimum brightness and 1 is maximum brightness. 0 is no change. The - * default is 0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Control color saturation of the video. Enter a value between -1 and 1, - * where -1 is fully desaturated and 1 is maximum saturation. 0 is no - * change. The default is 0. - * - * Generated from protobuf field double saturation = 1; - * @return float - */ - public function getSaturation() - { - return $this->saturation; - } - - /** - * Control color saturation of the video. Enter a value between -1 and 1, - * where -1 is fully desaturated and 1 is maximum saturation. 0 is no - * change. The default is 0. - * - * Generated from protobuf field double saturation = 1; - * @param float $var - * @return $this - */ - public function setSaturation($var) - { - GPBUtil::checkDouble($var); - $this->saturation = $var; - - return $this; - } - - /** - * Control black and white contrast of the video. Enter a value between -1 - * and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no - * change. The default is 0. - * - * Generated from protobuf field double contrast = 2; - * @return float - */ - public function getContrast() - { - return $this->contrast; - } - - /** - * Control black and white contrast of the video. Enter a value between -1 - * and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no - * change. The default is 0. - * - * Generated from protobuf field double contrast = 2; - * @param float $var - * @return $this - */ - public function setContrast($var) - { - GPBUtil::checkDouble($var); - $this->contrast = $var; - - return $this; - } - - /** - * Control brightness of the video. Enter a value between -1 and 1, where -1 - * is minimum brightness and 1 is maximum brightness. 0 is no change. The - * default is 0. - * - * Generated from protobuf field double brightness = 3; - * @return float - */ - public function getBrightness() - { - return $this->brightness; - } - - /** - * Control brightness of the video. Enter a value between -1 and 1, where -1 - * is minimum brightness and 1 is maximum brightness. 0 is no change. The - * default is 0. - * - * Generated from protobuf field double brightness = 3; - * @param float $var - * @return $this - */ - public function setBrightness($var) - { - GPBUtil::checkDouble($var); - $this->brightness = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Crop.php b/VideoTranscoder/src/V1beta1/PreprocessingConfig/Crop.php deleted file mode 100644 index 99d4fe94946b..000000000000 --- a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Crop.php +++ /dev/null @@ -1,171 +0,0 @@ -google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Crop - */ -class Crop extends \Google\Protobuf\Internal\Message -{ - /** - * The number of pixels to crop from the top. The default is 0. - * - * Generated from protobuf field int32 top_pixels = 1; - */ - private $top_pixels = 0; - /** - * The number of pixels to crop from the bottom. The default is 0. - * - * Generated from protobuf field int32 bottom_pixels = 2; - */ - private $bottom_pixels = 0; - /** - * The number of pixels to crop from the left. The default is 0. - * - * Generated from protobuf field int32 left_pixels = 3; - */ - private $left_pixels = 0; - /** - * The number of pixels to crop from the right. The default is 0. - * - * Generated from protobuf field int32 right_pixels = 4; - */ - private $right_pixels = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $top_pixels - * The number of pixels to crop from the top. The default is 0. - * @type int $bottom_pixels - * The number of pixels to crop from the bottom. The default is 0. - * @type int $left_pixels - * The number of pixels to crop from the left. The default is 0. - * @type int $right_pixels - * The number of pixels to crop from the right. The default is 0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The number of pixels to crop from the top. The default is 0. - * - * Generated from protobuf field int32 top_pixels = 1; - * @return int - */ - public function getTopPixels() - { - return $this->top_pixels; - } - - /** - * The number of pixels to crop from the top. The default is 0. - * - * Generated from protobuf field int32 top_pixels = 1; - * @param int $var - * @return $this - */ - public function setTopPixels($var) - { - GPBUtil::checkInt32($var); - $this->top_pixels = $var; - - return $this; - } - - /** - * The number of pixels to crop from the bottom. The default is 0. - * - * Generated from protobuf field int32 bottom_pixels = 2; - * @return int - */ - public function getBottomPixels() - { - return $this->bottom_pixels; - } - - /** - * The number of pixels to crop from the bottom. The default is 0. - * - * Generated from protobuf field int32 bottom_pixels = 2; - * @param int $var - * @return $this - */ - public function setBottomPixels($var) - { - GPBUtil::checkInt32($var); - $this->bottom_pixels = $var; - - return $this; - } - - /** - * The number of pixels to crop from the left. The default is 0. - * - * Generated from protobuf field int32 left_pixels = 3; - * @return int - */ - public function getLeftPixels() - { - return $this->left_pixels; - } - - /** - * The number of pixels to crop from the left. The default is 0. - * - * Generated from protobuf field int32 left_pixels = 3; - * @param int $var - * @return $this - */ - public function setLeftPixels($var) - { - GPBUtil::checkInt32($var); - $this->left_pixels = $var; - - return $this; - } - - /** - * The number of pixels to crop from the right. The default is 0. - * - * Generated from protobuf field int32 right_pixels = 4; - * @return int - */ - public function getRightPixels() - { - return $this->right_pixels; - } - - /** - * The number of pixels to crop from the right. The default is 0. - * - * Generated from protobuf field int32 right_pixels = 4; - * @param int $var - * @return $this - */ - public function setRightPixels($var) - { - GPBUtil::checkInt32($var); - $this->right_pixels = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Deblock.php b/VideoTranscoder/src/V1beta1/PreprocessingConfig/Deblock.php deleted file mode 100644 index d109a1ec87a1..000000000000 --- a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Deblock.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Deblock - */ -class Deblock extends \Google\Protobuf\Internal\Message -{ - /** - * Set strength of the deblocker. Enter a value between 0 and 1. The higher - * the value, the stronger the block removal. 0 is no deblocking. The - * default is 0. - * - * Generated from protobuf field double strength = 1; - */ - private $strength = 0.0; - /** - * Enable deblocker. The default is `false`. - * - * Generated from protobuf field bool enabled = 2; - */ - private $enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $strength - * Set strength of the deblocker. Enter a value between 0 and 1. The higher - * the value, the stronger the block removal. 0 is no deblocking. The - * default is 0. - * @type bool $enabled - * Enable deblocker. The default is `false`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Set strength of the deblocker. Enter a value between 0 and 1. The higher - * the value, the stronger the block removal. 0 is no deblocking. The - * default is 0. - * - * Generated from protobuf field double strength = 1; - * @return float - */ - public function getStrength() - { - return $this->strength; - } - - /** - * Set strength of the deblocker. Enter a value between 0 and 1. The higher - * the value, the stronger the block removal. 0 is no deblocking. The - * default is 0. - * - * Generated from protobuf field double strength = 1; - * @param float $var - * @return $this - */ - public function setStrength($var) - { - GPBUtil::checkDouble($var); - $this->strength = $var; - - return $this; - } - - /** - * Enable deblocker. The default is `false`. - * - * Generated from protobuf field bool enabled = 2; - * @return bool - */ - public function getEnabled() - { - return $this->enabled; - } - - /** - * Enable deblocker. The default is `false`. - * - * Generated from protobuf field bool enabled = 2; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Denoise.php b/VideoTranscoder/src/V1beta1/PreprocessingConfig/Denoise.php deleted file mode 100644 index 926d0178c6ef..000000000000 --- a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Denoise.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Denoise - */ -class Denoise extends \Google\Protobuf\Internal\Message -{ - /** - * Set strength of the denoise. Enter a value between 0 and 1. The higher - * the value, the smoother the image. 0 is no denoising. The default is 0. - * - * Generated from protobuf field double strength = 1; - */ - private $strength = 0.0; - /** - * Set the denoiser mode. The default is `"standard"`. - * Supported denoiser modes: - * - 'standard' - * - 'grain' - * - * Generated from protobuf field string tune = 2; - */ - private $tune = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $strength - * Set strength of the denoise. Enter a value between 0 and 1. The higher - * the value, the smoother the image. 0 is no denoising. The default is 0. - * @type string $tune - * Set the denoiser mode. The default is `"standard"`. - * Supported denoiser modes: - * - 'standard' - * - 'grain' - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Set strength of the denoise. Enter a value between 0 and 1. The higher - * the value, the smoother the image. 0 is no denoising. The default is 0. - * - * Generated from protobuf field double strength = 1; - * @return float - */ - public function getStrength() - { - return $this->strength; - } - - /** - * Set strength of the denoise. Enter a value between 0 and 1. The higher - * the value, the smoother the image. 0 is no denoising. The default is 0. - * - * Generated from protobuf field double strength = 1; - * @param float $var - * @return $this - */ - public function setStrength($var) - { - GPBUtil::checkDouble($var); - $this->strength = $var; - - return $this; - } - - /** - * Set the denoiser mode. The default is `"standard"`. - * Supported denoiser modes: - * - 'standard' - * - 'grain' - * - * Generated from protobuf field string tune = 2; - * @return string - */ - public function getTune() - { - return $this->tune; - } - - /** - * Set the denoiser mode. The default is `"standard"`. - * Supported denoiser modes: - * - 'standard' - * - 'grain' - * - * Generated from protobuf field string tune = 2; - * @param string $var - * @return $this - */ - public function setTune($var) - { - GPBUtil::checkString($var, True); - $this->tune = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Pad.php b/VideoTranscoder/src/V1beta1/PreprocessingConfig/Pad.php deleted file mode 100644 index 9985e8467681..000000000000 --- a/VideoTranscoder/src/V1beta1/PreprocessingConfig/Pad.php +++ /dev/null @@ -1,171 +0,0 @@ -google.cloud.video.transcoder.v1beta1.PreprocessingConfig.Pad - */ -class Pad extends \Google\Protobuf\Internal\Message -{ - /** - * The number of pixels to add to the top. The default is 0. - * - * Generated from protobuf field int32 top_pixels = 1; - */ - private $top_pixels = 0; - /** - * The number of pixels to add to the bottom. The default is 0. - * - * Generated from protobuf field int32 bottom_pixels = 2; - */ - private $bottom_pixels = 0; - /** - * The number of pixels to add to the left. The default is 0. - * - * Generated from protobuf field int32 left_pixels = 3; - */ - private $left_pixels = 0; - /** - * The number of pixels to add to the right. The default is 0. - * - * Generated from protobuf field int32 right_pixels = 4; - */ - private $right_pixels = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $top_pixels - * The number of pixels to add to the top. The default is 0. - * @type int $bottom_pixels - * The number of pixels to add to the bottom. The default is 0. - * @type int $left_pixels - * The number of pixels to add to the left. The default is 0. - * @type int $right_pixels - * The number of pixels to add to the right. The default is 0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The number of pixels to add to the top. The default is 0. - * - * Generated from protobuf field int32 top_pixels = 1; - * @return int - */ - public function getTopPixels() - { - return $this->top_pixels; - } - - /** - * The number of pixels to add to the top. The default is 0. - * - * Generated from protobuf field int32 top_pixels = 1; - * @param int $var - * @return $this - */ - public function setTopPixels($var) - { - GPBUtil::checkInt32($var); - $this->top_pixels = $var; - - return $this; - } - - /** - * The number of pixels to add to the bottom. The default is 0. - * - * Generated from protobuf field int32 bottom_pixels = 2; - * @return int - */ - public function getBottomPixels() - { - return $this->bottom_pixels; - } - - /** - * The number of pixels to add to the bottom. The default is 0. - * - * Generated from protobuf field int32 bottom_pixels = 2; - * @param int $var - * @return $this - */ - public function setBottomPixels($var) - { - GPBUtil::checkInt32($var); - $this->bottom_pixels = $var; - - return $this; - } - - /** - * The number of pixels to add to the left. The default is 0. - * - * Generated from protobuf field int32 left_pixels = 3; - * @return int - */ - public function getLeftPixels() - { - return $this->left_pixels; - } - - /** - * The number of pixels to add to the left. The default is 0. - * - * Generated from protobuf field int32 left_pixels = 3; - * @param int $var - * @return $this - */ - public function setLeftPixels($var) - { - GPBUtil::checkInt32($var); - $this->left_pixels = $var; - - return $this; - } - - /** - * The number of pixels to add to the right. The default is 0. - * - * Generated from protobuf field int32 right_pixels = 4; - * @return int - */ - public function getRightPixels() - { - return $this->right_pixels; - } - - /** - * The number of pixels to add to the right. The default is 0. - * - * Generated from protobuf field int32 right_pixels = 4; - * @param int $var - * @return $this - */ - public function setRightPixels($var) - { - GPBUtil::checkInt32($var); - $this->right_pixels = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/Progress.php b/VideoTranscoder/src/V1beta1/Progress.php deleted file mode 100644 index 57e6e20c47ee..000000000000 --- a/VideoTranscoder/src/V1beta1/Progress.php +++ /dev/null @@ -1,169 +0,0 @@ -google.cloud.video.transcoder.v1beta1.Progress - */ -class Progress extends \Google\Protobuf\Internal\Message -{ - /** - * Estimated fractional progress for `analyzing` step. - * - * Generated from protobuf field double analyzed = 1; - */ - private $analyzed = 0.0; - /** - * Estimated fractional progress for `encoding` step. - * - * Generated from protobuf field double encoded = 2; - */ - private $encoded = 0.0; - /** - * Estimated fractional progress for `uploading` step. - * - * Generated from protobuf field double uploaded = 3; - */ - private $uploaded = 0.0; - /** - * Estimated fractional progress for `notifying` step. - * - * Generated from protobuf field double notified = 4; - */ - private $notified = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $analyzed - * Estimated fractional progress for `analyzing` step. - * @type float $encoded - * Estimated fractional progress for `encoding` step. - * @type float $uploaded - * Estimated fractional progress for `uploading` step. - * @type float $notified - * Estimated fractional progress for `notifying` step. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Estimated fractional progress for `analyzing` step. - * - * Generated from protobuf field double analyzed = 1; - * @return float - */ - public function getAnalyzed() - { - return $this->analyzed; - } - - /** - * Estimated fractional progress for `analyzing` step. - * - * Generated from protobuf field double analyzed = 1; - * @param float $var - * @return $this - */ - public function setAnalyzed($var) - { - GPBUtil::checkDouble($var); - $this->analyzed = $var; - - return $this; - } - - /** - * Estimated fractional progress for `encoding` step. - * - * Generated from protobuf field double encoded = 2; - * @return float - */ - public function getEncoded() - { - return $this->encoded; - } - - /** - * Estimated fractional progress for `encoding` step. - * - * Generated from protobuf field double encoded = 2; - * @param float $var - * @return $this - */ - public function setEncoded($var) - { - GPBUtil::checkDouble($var); - $this->encoded = $var; - - return $this; - } - - /** - * Estimated fractional progress for `uploading` step. - * - * Generated from protobuf field double uploaded = 3; - * @return float - */ - public function getUploaded() - { - return $this->uploaded; - } - - /** - * Estimated fractional progress for `uploading` step. - * - * Generated from protobuf field double uploaded = 3; - * @param float $var - * @return $this - */ - public function setUploaded($var) - { - GPBUtil::checkDouble($var); - $this->uploaded = $var; - - return $this; - } - - /** - * Estimated fractional progress for `notifying` step. - * - * Generated from protobuf field double notified = 4; - * @return float - */ - public function getNotified() - { - return $this->notified; - } - - /** - * Estimated fractional progress for `notifying` step. - * - * Generated from protobuf field double notified = 4; - * @param float $var - * @return $this - */ - public function setNotified($var) - { - GPBUtil::checkDouble($var); - $this->notified = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/PubsubDestination.php b/VideoTranscoder/src/V1beta1/PubsubDestination.php deleted file mode 100644 index ee5033129c8c..000000000000 --- a/VideoTranscoder/src/V1beta1/PubsubDestination.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.video.transcoder.v1beta1.PubsubDestination - */ -class PubsubDestination extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the Pub/Sub topic to publish job completion notification - * to. For example: `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1; - */ - private $topic = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $topic - * The name of the Pub/Sub topic to publish job completion notification - * to. For example: `projects/{project}/topics/{topic}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The name of the Pub/Sub topic to publish job completion notification - * to. For example: `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1; - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * The name of the Pub/Sub topic to publish job completion notification - * to. For example: `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 1; - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/SegmentSettings.php b/VideoTranscoder/src/V1beta1/SegmentSettings.php deleted file mode 100644 index 23cb5f067a14..000000000000 --- a/VideoTranscoder/src/V1beta1/SegmentSettings.php +++ /dev/null @@ -1,123 +0,0 @@ -google.cloud.video.transcoder.v1beta1.SegmentSettings - */ -class SegmentSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Duration of the segments in seconds. The default is `"6.0s"`. Note that - * `segmentDuration` must be greater than or equal to - * [`gopDuration`](#videostream), and `segmentDuration` must be divisible by - * [`gopDuration`](#videostream). - * - * Generated from protobuf field .google.protobuf.Duration segment_duration = 1; - */ - private $segment_duration = null; - /** - * Required. Create an individual segment file. The default is `false`. - * - * Generated from protobuf field bool individual_segments = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $individual_segments = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $segment_duration - * Duration of the segments in seconds. The default is `"6.0s"`. Note that - * `segmentDuration` must be greater than or equal to - * [`gopDuration`](#videostream), and `segmentDuration` must be divisible by - * [`gopDuration`](#videostream). - * @type bool $individual_segments - * Required. Create an individual segment file. The default is `false`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Duration of the segments in seconds. The default is `"6.0s"`. Note that - * `segmentDuration` must be greater than or equal to - * [`gopDuration`](#videostream), and `segmentDuration` must be divisible by - * [`gopDuration`](#videostream). - * - * Generated from protobuf field .google.protobuf.Duration segment_duration = 1; - * @return \Google\Protobuf\Duration|null - */ - public function getSegmentDuration() - { - return $this->segment_duration; - } - - public function hasSegmentDuration() - { - return isset($this->segment_duration); - } - - public function clearSegmentDuration() - { - unset($this->segment_duration); - } - - /** - * Duration of the segments in seconds. The default is `"6.0s"`. Note that - * `segmentDuration` must be greater than or equal to - * [`gopDuration`](#videostream), and `segmentDuration` must be divisible by - * [`gopDuration`](#videostream). - * - * Generated from protobuf field .google.protobuf.Duration segment_duration = 1; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setSegmentDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->segment_duration = $var; - - return $this; - } - - /** - * Required. Create an individual segment file. The default is `false`. - * - * Generated from protobuf field bool individual_segments = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return bool - */ - public function getIndividualSegments() - { - return $this->individual_segments; - } - - /** - * Required. Create an individual segment file. The default is `false`. - * - * Generated from protobuf field bool individual_segments = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param bool $var - * @return $this - */ - public function setIndividualSegments($var) - { - GPBUtil::checkBool($var); - $this->individual_segments = $var; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/SpriteSheet.php b/VideoTranscoder/src/V1beta1/SpriteSheet.php deleted file mode 100644 index 891467ba4067..000000000000 --- a/VideoTranscoder/src/V1beta1/SpriteSheet.php +++ /dev/null @@ -1,519 +0,0 @@ -google.cloud.video.transcoder.v1beta1.SpriteSheet - */ -class SpriteSheet extends \Google\Protobuf\Internal\Message -{ - /** - * Format type. The default is `"jpeg"`. - * Supported formats: - * - 'jpeg' - * - * Generated from protobuf field string format = 1; - */ - private $format = ''; - /** - * Required. File name prefix for the generated sprite sheets. - * Each sprite sheet has an incremental 10-digit zero-padded suffix starting - * from 0 before the extension, such as `"sprite_sheet0000000123.jpeg"`. - * - * Generated from protobuf field string file_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $file_prefix = ''; - /** - * Required. The width of sprite in pixels. Must be an even integer. To preserve the - * source aspect ratio, set the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_width_pixels] field or - * the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_height_pixels] field, but not both (the API will - * automatically calculate the missing field). - * - * Generated from protobuf field int32 sprite_width_pixels = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $sprite_width_pixels = 0; - /** - * Required. The height of sprite in pixels. Must be an even integer. To preserve the - * source aspect ratio, set the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_height_pixels] field or - * the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_width_pixels] field, but not both (the API will - * automatically calculate the missing field). - * - * Generated from protobuf field int32 sprite_height_pixels = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $sprite_height_pixels = 0; - /** - * The maximum number of sprites per row in a sprite sheet. The default is 0, - * which indicates no maximum limit. - * - * Generated from protobuf field int32 column_count = 5; - */ - private $column_count = 0; - /** - * The maximum number of rows per sprite sheet. When the sprite sheet is full, - * a new sprite sheet is created. The default is 0, which indicates no maximum - * limit. - * - * Generated from protobuf field int32 row_count = 6; - */ - private $row_count = 0; - /** - * Start time in seconds, relative to the output file timeline. Determines the - * first sprite to pick. The default is `0s`. - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 7; - */ - private $start_time_offset = null; - /** - * End time in seconds, relative to the output file timeline. When - * `end_time_offset` is not specified, the sprites are generated until the end - * of the output file. - * - * Generated from protobuf field .google.protobuf.Duration end_time_offset = 8; - */ - private $end_time_offset = null; - /** - * The quality of the generated sprite sheet. Enter a value between 1 - * and 100, where 1 is the lowest quality and 100 is the highest quality. - * The default is 100. A high quality value corresponds to a low image data - * compression ratio. - * - * Generated from protobuf field int32 quality = 11; - */ - private $quality = 0; - protected $extraction_strategy; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $format - * Format type. The default is `"jpeg"`. - * Supported formats: - * - 'jpeg' - * @type string $file_prefix - * Required. File name prefix for the generated sprite sheets. - * Each sprite sheet has an incremental 10-digit zero-padded suffix starting - * from 0 before the extension, such as `"sprite_sheet0000000123.jpeg"`. - * @type int $sprite_width_pixels - * Required. The width of sprite in pixels. Must be an even integer. To preserve the - * source aspect ratio, set the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_width_pixels] field or - * the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_height_pixels] field, but not both (the API will - * automatically calculate the missing field). - * @type int $sprite_height_pixels - * Required. The height of sprite in pixels. Must be an even integer. To preserve the - * source aspect ratio, set the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_height_pixels] field or - * the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_width_pixels] field, but not both (the API will - * automatically calculate the missing field). - * @type int $column_count - * The maximum number of sprites per row in a sprite sheet. The default is 0, - * which indicates no maximum limit. - * @type int $row_count - * The maximum number of rows per sprite sheet. When the sprite sheet is full, - * a new sprite sheet is created. The default is 0, which indicates no maximum - * limit. - * @type \Google\Protobuf\Duration $start_time_offset - * Start time in seconds, relative to the output file timeline. Determines the - * first sprite to pick. The default is `0s`. - * @type \Google\Protobuf\Duration $end_time_offset - * End time in seconds, relative to the output file timeline. When - * `end_time_offset` is not specified, the sprites are generated until the end - * of the output file. - * @type int $total_count - * Total number of sprites. Create the specified number of sprites - * distributed evenly across the timeline of the output media. The default - * is 100. - * @type \Google\Protobuf\Duration $interval - * Starting from `0s`, create sprites at regular intervals. Specify the - * interval value in seconds. - * @type int $quality - * The quality of the generated sprite sheet. Enter a value between 1 - * and 100, where 1 is the lowest quality and 100 is the highest quality. - * The default is 100. A high quality value corresponds to a low image data - * compression ratio. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Format type. The default is `"jpeg"`. - * Supported formats: - * - 'jpeg' - * - * Generated from protobuf field string format = 1; - * @return string - */ - public function getFormat() - { - return $this->format; - } - - /** - * Format type. The default is `"jpeg"`. - * Supported formats: - * - 'jpeg' - * - * Generated from protobuf field string format = 1; - * @param string $var - * @return $this - */ - public function setFormat($var) - { - GPBUtil::checkString($var, True); - $this->format = $var; - - return $this; - } - - /** - * Required. File name prefix for the generated sprite sheets. - * Each sprite sheet has an incremental 10-digit zero-padded suffix starting - * from 0 before the extension, such as `"sprite_sheet0000000123.jpeg"`. - * - * Generated from protobuf field string file_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFilePrefix() - { - return $this->file_prefix; - } - - /** - * Required. File name prefix for the generated sprite sheets. - * Each sprite sheet has an incremental 10-digit zero-padded suffix starting - * from 0 before the extension, such as `"sprite_sheet0000000123.jpeg"`. - * - * Generated from protobuf field string file_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFilePrefix($var) - { - GPBUtil::checkString($var, True); - $this->file_prefix = $var; - - return $this; - } - - /** - * Required. The width of sprite in pixels. Must be an even integer. To preserve the - * source aspect ratio, set the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_width_pixels] field or - * the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_height_pixels] field, but not both (the API will - * automatically calculate the missing field). - * - * Generated from protobuf field int32 sprite_width_pixels = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getSpriteWidthPixels() - { - return $this->sprite_width_pixels; - } - - /** - * Required. The width of sprite in pixels. Must be an even integer. To preserve the - * source aspect ratio, set the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_width_pixels] field or - * the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_height_pixels] field, but not both (the API will - * automatically calculate the missing field). - * - * Generated from protobuf field int32 sprite_width_pixels = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setSpriteWidthPixels($var) - { - GPBUtil::checkInt32($var); - $this->sprite_width_pixels = $var; - - return $this; - } - - /** - * Required. The height of sprite in pixels. Must be an even integer. To preserve the - * source aspect ratio, set the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_height_pixels] field or - * the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_width_pixels] field, but not both (the API will - * automatically calculate the missing field). - * - * Generated from protobuf field int32 sprite_height_pixels = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getSpriteHeightPixels() - { - return $this->sprite_height_pixels; - } - - /** - * Required. The height of sprite in pixels. Must be an even integer. To preserve the - * source aspect ratio, set the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_height_pixels] field or - * the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1beta1.SpriteSheet.sprite_width_pixels] field, but not both (the API will - * automatically calculate the missing field). - * - * Generated from protobuf field int32 sprite_height_pixels = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setSpriteHeightPixels($var) - { - GPBUtil::checkInt32($var); - $this->sprite_height_pixels = $var; - - return $this; - } - - /** - * The maximum number of sprites per row in a sprite sheet. The default is 0, - * which indicates no maximum limit. - * - * Generated from protobuf field int32 column_count = 5; - * @return int - */ - public function getColumnCount() - { - return $this->column_count; - } - - /** - * The maximum number of sprites per row in a sprite sheet. The default is 0, - * which indicates no maximum limit. - * - * Generated from protobuf field int32 column_count = 5; - * @param int $var - * @return $this - */ - public function setColumnCount($var) - { - GPBUtil::checkInt32($var); - $this->column_count = $var; - - return $this; - } - - /** - * The maximum number of rows per sprite sheet. When the sprite sheet is full, - * a new sprite sheet is created. The default is 0, which indicates no maximum - * limit. - * - * Generated from protobuf field int32 row_count = 6; - * @return int - */ - public function getRowCount() - { - return $this->row_count; - } - - /** - * The maximum number of rows per sprite sheet. When the sprite sheet is full, - * a new sprite sheet is created. The default is 0, which indicates no maximum - * limit. - * - * Generated from protobuf field int32 row_count = 6; - * @param int $var - * @return $this - */ - public function setRowCount($var) - { - GPBUtil::checkInt32($var); - $this->row_count = $var; - - return $this; - } - - /** - * Start time in seconds, relative to the output file timeline. Determines the - * first sprite to pick. The default is `0s`. - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 7; - * @return \Google\Protobuf\Duration|null - */ - public function getStartTimeOffset() - { - return $this->start_time_offset; - } - - public function hasStartTimeOffset() - { - return isset($this->start_time_offset); - } - - public function clearStartTimeOffset() - { - unset($this->start_time_offset); - } - - /** - * Start time in seconds, relative to the output file timeline. Determines the - * first sprite to pick. The default is `0s`. - * - * Generated from protobuf field .google.protobuf.Duration start_time_offset = 7; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setStartTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->start_time_offset = $var; - - return $this; - } - - /** - * End time in seconds, relative to the output file timeline. When - * `end_time_offset` is not specified, the sprites are generated until the end - * of the output file. - * - * Generated from protobuf field .google.protobuf.Duration end_time_offset = 8; - * @return \Google\Protobuf\Duration|null - */ - public function getEndTimeOffset() - { - return $this->end_time_offset; - } - - public function hasEndTimeOffset() - { - return isset($this->end_time_offset); - } - - public function clearEndTimeOffset() - { - unset($this->end_time_offset); - } - - /** - * End time in seconds, relative to the output file timeline. When - * `end_time_offset` is not specified, the sprites are generated until the end - * of the output file. - * - * Generated from protobuf field .google.protobuf.Duration end_time_offset = 8; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setEndTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->end_time_offset = $var; - - return $this; - } - - /** - * Total number of sprites. Create the specified number of sprites - * distributed evenly across the timeline of the output media. The default - * is 100. - * - * Generated from protobuf field int32 total_count = 9; - * @return int - */ - public function getTotalCount() - { - return $this->readOneof(9); - } - - public function hasTotalCount() - { - return $this->hasOneof(9); - } - - /** - * Total number of sprites. Create the specified number of sprites - * distributed evenly across the timeline of the output media. The default - * is 100. - * - * Generated from protobuf field int32 total_count = 9; - * @param int $var - * @return $this - */ - public function setTotalCount($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * Starting from `0s`, create sprites at regular intervals. Specify the - * interval value in seconds. - * - * Generated from protobuf field .google.protobuf.Duration interval = 10; - * @return \Google\Protobuf\Duration|null - */ - public function getInterval() - { - return $this->readOneof(10); - } - - public function hasInterval() - { - return $this->hasOneof(10); - } - - /** - * Starting from `0s`, create sprites at regular intervals. Specify the - * interval value in seconds. - * - * Generated from protobuf field .google.protobuf.Duration interval = 10; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setInterval($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * The quality of the generated sprite sheet. Enter a value between 1 - * and 100, where 1 is the lowest quality and 100 is the highest quality. - * The default is 100. A high quality value corresponds to a low image data - * compression ratio. - * - * Generated from protobuf field int32 quality = 11; - * @return int - */ - public function getQuality() - { - return $this->quality; - } - - /** - * The quality of the generated sprite sheet. Enter a value between 1 - * and 100, where 1 is the lowest quality and 100 is the highest quality. - * The default is 100. A high quality value corresponds to a low image data - * compression ratio. - * - * Generated from protobuf field int32 quality = 11; - * @param int $var - * @return $this - */ - public function setQuality($var) - { - GPBUtil::checkInt32($var); - $this->quality = $var; - - return $this; - } - - /** - * @return string - */ - public function getExtractionStrategy() - { - return $this->whichOneof("extraction_strategy"); - } - -} - diff --git a/VideoTranscoder/src/V1beta1/TextStream.php b/VideoTranscoder/src/V1beta1/TextStream.php deleted file mode 100644 index c35f1c24fd51..000000000000 --- a/VideoTranscoder/src/V1beta1/TextStream.php +++ /dev/null @@ -1,167 +0,0 @@ -google.cloud.video.transcoder.v1beta1.TextStream - */ -class TextStream extends \Google\Protobuf\Internal\Message -{ - /** - * The codec for this text stream. The default is `"webvtt"`. - * Supported text codecs: - * - 'srt' - * - 'ttml' - * - 'cea608' - * - 'cea708' - * - 'webvtt' - * - * Generated from protobuf field string codec = 1; - */ - private $codec = ''; - /** - * Required. The BCP-47 language code, such as `"en-US"` or `"sr-Latn"`. For more - * information, see - * https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - * - * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $language_code = ''; - /** - * The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.TextStream.TextAtom mapping = 3; - */ - private $mapping; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $codec - * The codec for this text stream. The default is `"webvtt"`. - * Supported text codecs: - * - 'srt' - * - 'ttml' - * - 'cea608' - * - 'cea708' - * - 'webvtt' - * @type string $language_code - * Required. The BCP-47 language code, such as `"en-US"` or `"sr-Latn"`. For more - * information, see - * https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - * @type \Google\Cloud\Video\Transcoder\V1beta1\TextStream\TextAtom[]|\Google\Protobuf\Internal\RepeatedField $mapping - * The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The codec for this text stream. The default is `"webvtt"`. - * Supported text codecs: - * - 'srt' - * - 'ttml' - * - 'cea608' - * - 'cea708' - * - 'webvtt' - * - * Generated from protobuf field string codec = 1; - * @return string - */ - public function getCodec() - { - return $this->codec; - } - - /** - * The codec for this text stream. The default is `"webvtt"`. - * Supported text codecs: - * - 'srt' - * - 'ttml' - * - 'cea608' - * - 'cea708' - * - 'webvtt' - * - * Generated from protobuf field string codec = 1; - * @param string $var - * @return $this - */ - public function setCodec($var) - { - GPBUtil::checkString($var, True); - $this->codec = $var; - - return $this; - } - - /** - * Required. The BCP-47 language code, such as `"en-US"` or `"sr-Latn"`. For more - * information, see - * https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - * - * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Required. The BCP-47 language code, such as `"en-US"` or `"sr-Latn"`. For more - * information, see - * https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - * - * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.TextStream.TextAtom mapping = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMapping() - { - return $this->mapping; - } - - /** - * The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.TextStream.TextAtom mapping = 3; - * @param \Google\Cloud\Video\Transcoder\V1beta1\TextStream\TextAtom[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMapping($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\TextStream\TextAtom::class); - $this->mapping = $arr; - - return $this; - } - -} - diff --git a/VideoTranscoder/src/V1beta1/TextStream/TextAtom.php b/VideoTranscoder/src/V1beta1/TextStream/TextAtom.php deleted file mode 100644 index 7203940f2be8..000000000000 --- a/VideoTranscoder/src/V1beta1/TextStream/TextAtom.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.video.transcoder.v1beta1.TextStream.TextAtom - */ -class TextAtom extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `EditAtom.key` that references atom with text inputs in the - * `Job.edit_list`. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $key = ''; - /** - * List of `Job.inputs` that should be embedded in this atom. Only one - * input is supported. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.TextStream.TextAtom.TextInput inputs = 2; - */ - private $inputs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Required. The `EditAtom.key` that references atom with text inputs in the - * `Job.edit_list`. - * @type \Google\Cloud\Video\Transcoder\V1beta1\TextStream\TextAtom\TextInput[]|\Google\Protobuf\Internal\RepeatedField $inputs - * List of `Job.inputs` that should be embedded in this atom. Only one - * input is supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `EditAtom.key` that references atom with text inputs in the - * `Job.edit_list`. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Required. The `EditAtom.key` that references atom with text inputs in the - * `Job.edit_list`. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * List of `Job.inputs` that should be embedded in this atom. Only one - * input is supported. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.TextStream.TextAtom.TextInput inputs = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInputs() - { - return $this->inputs; - } - - /** - * List of `Job.inputs` that should be embedded in this atom. Only one - * input is supported. - * - * Generated from protobuf field repeated .google.cloud.video.transcoder.v1beta1.TextStream.TextAtom.TextInput inputs = 2; - * @param \Google\Cloud\Video\Transcoder\V1beta1\TextStream\TextAtom\TextInput[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInputs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Transcoder\V1beta1\TextStream\TextAtom\TextInput::class); - $this->inputs = $arr; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/TextStream/TextAtom/TextInput.php b/VideoTranscoder/src/V1beta1/TextStream/TextAtom/TextInput.php deleted file mode 100644 index 1e8530ecdf82..000000000000 --- a/VideoTranscoder/src/V1beta1/TextStream/TextAtom/TextInput.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.video.transcoder.v1beta1.TextStream.TextAtom.TextInput - */ -class TextInput extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `Input.key` that identifies the input file. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $key = ''; - /** - * Required. The zero-based index of the track in the input file. - * - * Generated from protobuf field int32 track = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $track = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Required. The `Input.key` that identifies the input file. - * @type int $track - * Required. The zero-based index of the track in the input file. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `Input.key` that identifies the input file. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Required. The `Input.key` that identifies the input file. - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Required. The zero-based index of the track in the input file. - * - * Generated from protobuf field int32 track = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getTrack() - { - return $this->track; - } - - /** - * Required. The zero-based index of the track in the input file. - * - * Generated from protobuf field int32 track = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setTrack($var) - { - GPBUtil::checkInt32($var); - $this->track = $var; - - return $this; - } - -} - - diff --git a/VideoTranscoder/src/V1beta1/TranscoderServiceClient.php b/VideoTranscoder/src/V1beta1/TranscoderServiceClient.php deleted file mode 100644 index 6467f84ca0d8..000000000000 --- a/VideoTranscoder/src/V1beta1/TranscoderServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.video.transcoder.v1beta1.TranscoderService/CreateJob', - $argument, - ['\Google\Cloud\Video\Transcoder\V1beta1\Job', 'decode'], - $metadata, $options); - } - - /** - * Lists jobs in the specified region. - * @param \Google\Cloud\Video\Transcoder\V1beta1\ListJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListJobs(\Google\Cloud\Video\Transcoder\V1beta1\ListJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1beta1.TranscoderService/ListJobs', - $argument, - ['\Google\Cloud\Video\Transcoder\V1beta1\ListJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Returns the job data. - * @param \Google\Cloud\Video\Transcoder\V1beta1\GetJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetJob(\Google\Cloud\Video\Transcoder\V1beta1\GetJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1beta1.TranscoderService/GetJob', - $argument, - ['\Google\Cloud\Video\Transcoder\V1beta1\Job', 'decode'], - $metadata, $options); - } - - /** - * Deletes a job. - * @param \Google\Cloud\Video\Transcoder\V1beta1\DeleteJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteJob(\Google\Cloud\Video\Transcoder\V1beta1\DeleteJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1beta1.TranscoderService/DeleteJob', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates a job template in the specified region. - * @param \Google\Cloud\Video\Transcoder\V1beta1\CreateJobTemplateRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateJobTemplate(\Google\Cloud\Video\Transcoder\V1beta1\CreateJobTemplateRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1beta1.TranscoderService/CreateJobTemplate', - $argument, - ['\Google\Cloud\Video\Transcoder\V1beta1\JobTemplate', 'decode'], - $metadata, $options); - } - - /** - * Lists job templates in the specified region. - * @param \Google\Cloud\Video\Transcoder\V1beta1\ListJobTemplatesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListJobTemplates(\Google\Cloud\Video\Transcoder\V1beta1\ListJobTemplatesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1beta1.TranscoderService/ListJobTemplates', - $argument, - ['\Google\Cloud\Video\Transcoder\V1beta1\ListJobTemplatesResponse', 'decode'], - $metadata, $options); - } - - /** - * Returns the job template data. - * @param \Google\Cloud\Video\Transcoder\V1beta1\GetJobTemplateRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetJobTemplate(\Google\Cloud\Video\Transcoder\V1beta1\GetJobTemplateRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1beta1.TranscoderService/GetJobTemplate', - $argument, - ['\Google\Cloud\Video\Transcoder\V1beta1\JobTemplate', 'decode'], - $metadata, $options); - } - - /** - * Deletes a job template. - * @param \Google\Cloud\Video\Transcoder\V1beta1\DeleteJobTemplateRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteJobTemplate(\Google\Cloud\Video\Transcoder\V1beta1\DeleteJobTemplateRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.video.transcoder.v1beta1.TranscoderService/DeleteJobTemplate', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/VideoTranscoder/src/V1beta1/VideoStream.php b/VideoTranscoder/src/V1beta1/VideoStream.php deleted file mode 100644 index 89f7b4a444b5..000000000000 --- a/VideoTranscoder/src/V1beta1/VideoStream.php +++ /dev/null @@ -1,998 +0,0 @@ -google.cloud.video.transcoder.v1beta1.VideoStream - */ -class VideoStream extends \Google\Protobuf\Internal\Message -{ - /** - * Codec type. The following codecs are supported: - * * `h264` (default) - * * `h265` - * * `vp9` - * - * Generated from protobuf field string codec = 1; - */ - private $codec = ''; - /** - * Enforces the specified codec profile. The following profiles are supported: - * * `baseline` - * * `main` - * * `high` (default) - * The available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * - * Generated from protobuf field string profile = 2; - */ - private $profile = ''; - /** - * Enforces the specified codec tune. The available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * - * Generated from protobuf field string tune = 3; - */ - private $tune = ''; - /** - * Enforces the specified codec preset. The default is `veryfast`. The - * available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * - * Generated from protobuf field string preset = 4; - */ - private $preset = ''; - /** - * The height of the video in pixels. Must be an even integer. - * When not specified, the height is adjusted to match the specified width and - * input aspect ratio. If both are omitted, the input height is used. - * - * Generated from protobuf field int32 height_pixels = 5; - */ - private $height_pixels = 0; - /** - * The width of the video in pixels. Must be an even integer. - * When not specified, the width is adjusted to match the specified height and - * input aspect ratio. If both are omitted, the input width is used. - * - * Generated from protobuf field int32 width_pixels = 6; - */ - private $width_pixels = 0; - /** - * Pixel format to use. The default is `"yuv420p"`. - * Supported pixel formats: - * - 'yuv420p' pixel format. - * - 'yuv422p' pixel format. - * - 'yuv444p' pixel format. - * - 'yuv420p10' 10-bit HDR pixel format. - * - 'yuv422p10' 10-bit HDR pixel format. - * - 'yuv444p10' 10-bit HDR pixel format. - * - 'yuv420p12' 12-bit HDR pixel format. - * - 'yuv422p12' 12-bit HDR pixel format. - * - 'yuv444p12' 12-bit HDR pixel format. - * - * Generated from protobuf field string pixel_format = 7; - */ - private $pixel_format = ''; - /** - * Required. The video bitrate in bits per second. The minimum value is 1,000. - * The maximum value for H264/H265 is 800,000,000. The maximum value for VP9 - * is 480,000,000. - * - * Generated from protobuf field int32 bitrate_bps = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - private $bitrate_bps = 0; - /** - * Specify the `rate_control_mode`. The default is `"vbr"`. - * Supported rate control modes: - * - 'vbr' - variable bitrate - * - 'crf' - constant rate factor - * - * Generated from protobuf field string rate_control_mode = 9; - */ - private $rate_control_mode = ''; - /** - * Use two-pass encoding strategy to achieve better video quality. - * `VideoStream.rate_control_mode` must be `"vbr"`. The default is `false`. - * - * Generated from protobuf field bool enable_two_pass = 10; - */ - private $enable_two_pass = false; - /** - * Target CRF level. Must be between 10 and 36, where 10 is the highest - * quality and 36 is the most efficient compression. The default is 21. - * - * Generated from protobuf field int32 crf_level = 11; - */ - private $crf_level = 0; - /** - * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be greater - * than zero. The default is equal to `VideoStream.bitrate_bps`. - * - * Generated from protobuf field int32 vbv_size_bits = 12; - */ - private $vbv_size_bits = 0; - /** - * Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. Must - * be greater than zero. The default is equal to 90% of - * `VideoStream.vbv_size_bits`. - * - * Generated from protobuf field int32 vbv_fullness_bits = 13; - */ - private $vbv_fullness_bits = 0; - /** - * Specifies whether an open Group of Pictures (GOP) structure should be - * allowed or not. The default is `false`. - * - * Generated from protobuf field bool allow_open_gop = 14; - */ - private $allow_open_gop = false; - /** - * The entropy coder to use. The default is `"cabac"`. - * Supported entropy coders: - * - 'cavlc' - * - 'cabac' - * - * Generated from protobuf field string entropy_coder = 17; - */ - private $entropy_coder = ''; - /** - * Allow B-pyramid for reference frame selection. This may not be supported - * on all decoders. The default is `false`. - * - * Generated from protobuf field bool b_pyramid = 18; - */ - private $b_pyramid = false; - /** - * The number of consecutive B-frames. Must be greater than or equal to zero. - * Must be less than `VideoStream.gop_frame_count` if set. The default is 0. - * - * Generated from protobuf field int32 b_frame_count = 19; - */ - private $b_frame_count = 0; - /** - * Required. The target video frame rate in frames per second (FPS). Must be less than - * or equal to 120. Will default to the input frame rate if larger than the - * input frame rate. The API will generate an output FPS that is divisible by - * the input FPS, and smaller or equal to the target FPS. See - * [Calculate frame - * rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for - * more information. - * - * Generated from protobuf field double frame_rate = 20 [(.google.api.field_behavior) = REQUIRED]; - */ - private $frame_rate = 0.0; - /** - * Specify the intensity of the adaptive quantizer (AQ). Must be between 0 and - * 1, where 0 disables the quantizer and 1 maximizes the quantizer. A - * higher value equals a lower bitrate but smoother image. The default is 0. - * - * Generated from protobuf field double aq_strength = 21; - */ - private $aq_strength = 0.0; - protected $gop_mode; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $codec - * Codec type. The following codecs are supported: - * * `h264` (default) - * * `h265` - * * `vp9` - * @type string $profile - * Enforces the specified codec profile. The following profiles are supported: - * * `baseline` - * * `main` - * * `high` (default) - * The available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * @type string $tune - * Enforces the specified codec tune. The available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * @type string $preset - * Enforces the specified codec preset. The default is `veryfast`. The - * available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * @type int $height_pixels - * The height of the video in pixels. Must be an even integer. - * When not specified, the height is adjusted to match the specified width and - * input aspect ratio. If both are omitted, the input height is used. - * @type int $width_pixels - * The width of the video in pixels. Must be an even integer. - * When not specified, the width is adjusted to match the specified height and - * input aspect ratio. If both are omitted, the input width is used. - * @type string $pixel_format - * Pixel format to use. The default is `"yuv420p"`. - * Supported pixel formats: - * - 'yuv420p' pixel format. - * - 'yuv422p' pixel format. - * - 'yuv444p' pixel format. - * - 'yuv420p10' 10-bit HDR pixel format. - * - 'yuv422p10' 10-bit HDR pixel format. - * - 'yuv444p10' 10-bit HDR pixel format. - * - 'yuv420p12' 12-bit HDR pixel format. - * - 'yuv422p12' 12-bit HDR pixel format. - * - 'yuv444p12' 12-bit HDR pixel format. - * @type int $bitrate_bps - * Required. The video bitrate in bits per second. The minimum value is 1,000. - * The maximum value for H264/H265 is 800,000,000. The maximum value for VP9 - * is 480,000,000. - * @type string $rate_control_mode - * Specify the `rate_control_mode`. The default is `"vbr"`. - * Supported rate control modes: - * - 'vbr' - variable bitrate - * - 'crf' - constant rate factor - * @type bool $enable_two_pass - * Use two-pass encoding strategy to achieve better video quality. - * `VideoStream.rate_control_mode` must be `"vbr"`. The default is `false`. - * @type int $crf_level - * Target CRF level. Must be between 10 and 36, where 10 is the highest - * quality and 36 is the most efficient compression. The default is 21. - * @type int $vbv_size_bits - * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be greater - * than zero. The default is equal to `VideoStream.bitrate_bps`. - * @type int $vbv_fullness_bits - * Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. Must - * be greater than zero. The default is equal to 90% of - * `VideoStream.vbv_size_bits`. - * @type bool $allow_open_gop - * Specifies whether an open Group of Pictures (GOP) structure should be - * allowed or not. The default is `false`. - * @type int $gop_frame_count - * Select the GOP size based on the specified frame count. Must be greater - * than zero. - * @type \Google\Protobuf\Duration $gop_duration - * Select the GOP size based on the specified duration. The default is - * `"3s"`. Note that `gopDuration` must be less than or equal to - * [`segmentDuration`](#SegmentSettings), and - * [`segmentDuration`](#SegmentSettings) must be divisible by `gopDuration`. - * @type string $entropy_coder - * The entropy coder to use. The default is `"cabac"`. - * Supported entropy coders: - * - 'cavlc' - * - 'cabac' - * @type bool $b_pyramid - * Allow B-pyramid for reference frame selection. This may not be supported - * on all decoders. The default is `false`. - * @type int $b_frame_count - * The number of consecutive B-frames. Must be greater than or equal to zero. - * Must be less than `VideoStream.gop_frame_count` if set. The default is 0. - * @type float $frame_rate - * Required. The target video frame rate in frames per second (FPS). Must be less than - * or equal to 120. Will default to the input frame rate if larger than the - * input frame rate. The API will generate an output FPS that is divisible by - * the input FPS, and smaller or equal to the target FPS. See - * [Calculate frame - * rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for - * more information. - * @type float $aq_strength - * Specify the intensity of the adaptive quantizer (AQ). Must be between 0 and - * 1, where 0 disables the quantizer and 1 maximizes the quantizer. A - * higher value equals a lower bitrate but smoother image. The default is 0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Video\Transcoder\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Codec type. The following codecs are supported: - * * `h264` (default) - * * `h265` - * * `vp9` - * - * Generated from protobuf field string codec = 1; - * @return string - */ - public function getCodec() - { - return $this->codec; - } - - /** - * Codec type. The following codecs are supported: - * * `h264` (default) - * * `h265` - * * `vp9` - * - * Generated from protobuf field string codec = 1; - * @param string $var - * @return $this - */ - public function setCodec($var) - { - GPBUtil::checkString($var, True); - $this->codec = $var; - - return $this; - } - - /** - * Enforces the specified codec profile. The following profiles are supported: - * * `baseline` - * * `main` - * * `high` (default) - * The available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * - * Generated from protobuf field string profile = 2; - * @return string - */ - public function getProfile() - { - return $this->profile; - } - - /** - * Enforces the specified codec profile. The following profiles are supported: - * * `baseline` - * * `main` - * * `high` (default) - * The available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * - * Generated from protobuf field string profile = 2; - * @param string $var - * @return $this - */ - public function setProfile($var) - { - GPBUtil::checkString($var, True); - $this->profile = $var; - - return $this; - } - - /** - * Enforces the specified codec tune. The available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * - * Generated from protobuf field string tune = 3; - * @return string - */ - public function getTune() - { - return $this->tune; - } - - /** - * Enforces the specified codec tune. The available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * - * Generated from protobuf field string tune = 3; - * @param string $var - * @return $this - */ - public function setTune($var) - { - GPBUtil::checkString($var, True); - $this->tune = $var; - - return $this; - } - - /** - * Enforces the specified codec preset. The default is `veryfast`. The - * available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * - * Generated from protobuf field string preset = 4; - * @return string - */ - public function getPreset() - { - return $this->preset; - } - - /** - * Enforces the specified codec preset. The default is `veryfast`. The - * available options are - * FFmpeg-compatible. Note that certain values for this - * field may cause the transcoder to override other fields you set in the - * `VideoStream` message. - * - * Generated from protobuf field string preset = 4; - * @param string $var - * @return $this - */ - public function setPreset($var) - { - GPBUtil::checkString($var, True); - $this->preset = $var; - - return $this; - } - - /** - * The height of the video in pixels. Must be an even integer. - * When not specified, the height is adjusted to match the specified width and - * input aspect ratio. If both are omitted, the input height is used. - * - * Generated from protobuf field int32 height_pixels = 5; - * @return int - */ - public function getHeightPixels() - { - return $this->height_pixels; - } - - /** - * The height of the video in pixels. Must be an even integer. - * When not specified, the height is adjusted to match the specified width and - * input aspect ratio. If both are omitted, the input height is used. - * - * Generated from protobuf field int32 height_pixels = 5; - * @param int $var - * @return $this - */ - public function setHeightPixels($var) - { - GPBUtil::checkInt32($var); - $this->height_pixels = $var; - - return $this; - } - - /** - * The width of the video in pixels. Must be an even integer. - * When not specified, the width is adjusted to match the specified height and - * input aspect ratio. If both are omitted, the input width is used. - * - * Generated from protobuf field int32 width_pixels = 6; - * @return int - */ - public function getWidthPixels() - { - return $this->width_pixels; - } - - /** - * The width of the video in pixels. Must be an even integer. - * When not specified, the width is adjusted to match the specified height and - * input aspect ratio. If both are omitted, the input width is used. - * - * Generated from protobuf field int32 width_pixels = 6; - * @param int $var - * @return $this - */ - public function setWidthPixels($var) - { - GPBUtil::checkInt32($var); - $this->width_pixels = $var; - - return $this; - } - - /** - * Pixel format to use. The default is `"yuv420p"`. - * Supported pixel formats: - * - 'yuv420p' pixel format. - * - 'yuv422p' pixel format. - * - 'yuv444p' pixel format. - * - 'yuv420p10' 10-bit HDR pixel format. - * - 'yuv422p10' 10-bit HDR pixel format. - * - 'yuv444p10' 10-bit HDR pixel format. - * - 'yuv420p12' 12-bit HDR pixel format. - * - 'yuv422p12' 12-bit HDR pixel format. - * - 'yuv444p12' 12-bit HDR pixel format. - * - * Generated from protobuf field string pixel_format = 7; - * @return string - */ - public function getPixelFormat() - { - return $this->pixel_format; - } - - /** - * Pixel format to use. The default is `"yuv420p"`. - * Supported pixel formats: - * - 'yuv420p' pixel format. - * - 'yuv422p' pixel format. - * - 'yuv444p' pixel format. - * - 'yuv420p10' 10-bit HDR pixel format. - * - 'yuv422p10' 10-bit HDR pixel format. - * - 'yuv444p10' 10-bit HDR pixel format. - * - 'yuv420p12' 12-bit HDR pixel format. - * - 'yuv422p12' 12-bit HDR pixel format. - * - 'yuv444p12' 12-bit HDR pixel format. - * - * Generated from protobuf field string pixel_format = 7; - * @param string $var - * @return $this - */ - public function setPixelFormat($var) - { - GPBUtil::checkString($var, True); - $this->pixel_format = $var; - - return $this; - } - - /** - * Required. The video bitrate in bits per second. The minimum value is 1,000. - * The maximum value for H264/H265 is 800,000,000. The maximum value for VP9 - * is 480,000,000. - * - * Generated from protobuf field int32 bitrate_bps = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getBitrateBps() - { - return $this->bitrate_bps; - } - - /** - * Required. The video bitrate in bits per second. The minimum value is 1,000. - * The maximum value for H264/H265 is 800,000,000. The maximum value for VP9 - * is 480,000,000. - * - * Generated from protobuf field int32 bitrate_bps = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setBitrateBps($var) - { - GPBUtil::checkInt32($var); - $this->bitrate_bps = $var; - - return $this; - } - - /** - * Specify the `rate_control_mode`. The default is `"vbr"`. - * Supported rate control modes: - * - 'vbr' - variable bitrate - * - 'crf' - constant rate factor - * - * Generated from protobuf field string rate_control_mode = 9; - * @return string - */ - public function getRateControlMode() - { - return $this->rate_control_mode; - } - - /** - * Specify the `rate_control_mode`. The default is `"vbr"`. - * Supported rate control modes: - * - 'vbr' - variable bitrate - * - 'crf' - constant rate factor - * - * Generated from protobuf field string rate_control_mode = 9; - * @param string $var - * @return $this - */ - public function setRateControlMode($var) - { - GPBUtil::checkString($var, True); - $this->rate_control_mode = $var; - - return $this; - } - - /** - * Use two-pass encoding strategy to achieve better video quality. - * `VideoStream.rate_control_mode` must be `"vbr"`. The default is `false`. - * - * Generated from protobuf field bool enable_two_pass = 10; - * @return bool - */ - public function getEnableTwoPass() - { - return $this->enable_two_pass; - } - - /** - * Use two-pass encoding strategy to achieve better video quality. - * `VideoStream.rate_control_mode` must be `"vbr"`. The default is `false`. - * - * Generated from protobuf field bool enable_two_pass = 10; - * @param bool $var - * @return $this - */ - public function setEnableTwoPass($var) - { - GPBUtil::checkBool($var); - $this->enable_two_pass = $var; - - return $this; - } - - /** - * Target CRF level. Must be between 10 and 36, where 10 is the highest - * quality and 36 is the most efficient compression. The default is 21. - * - * Generated from protobuf field int32 crf_level = 11; - * @return int - */ - public function getCrfLevel() - { - return $this->crf_level; - } - - /** - * Target CRF level. Must be between 10 and 36, where 10 is the highest - * quality and 36 is the most efficient compression. The default is 21. - * - * Generated from protobuf field int32 crf_level = 11; - * @param int $var - * @return $this - */ - public function setCrfLevel($var) - { - GPBUtil::checkInt32($var); - $this->crf_level = $var; - - return $this; - } - - /** - * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be greater - * than zero. The default is equal to `VideoStream.bitrate_bps`. - * - * Generated from protobuf field int32 vbv_size_bits = 12; - * @return int - */ - public function getVbvSizeBits() - { - return $this->vbv_size_bits; - } - - /** - * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be greater - * than zero. The default is equal to `VideoStream.bitrate_bps`. - * - * Generated from protobuf field int32 vbv_size_bits = 12; - * @param int $var - * @return $this - */ - public function setVbvSizeBits($var) - { - GPBUtil::checkInt32($var); - $this->vbv_size_bits = $var; - - return $this; - } - - /** - * Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. Must - * be greater than zero. The default is equal to 90% of - * `VideoStream.vbv_size_bits`. - * - * Generated from protobuf field int32 vbv_fullness_bits = 13; - * @return int - */ - public function getVbvFullnessBits() - { - return $this->vbv_fullness_bits; - } - - /** - * Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. Must - * be greater than zero. The default is equal to 90% of - * `VideoStream.vbv_size_bits`. - * - * Generated from protobuf field int32 vbv_fullness_bits = 13; - * @param int $var - * @return $this - */ - public function setVbvFullnessBits($var) - { - GPBUtil::checkInt32($var); - $this->vbv_fullness_bits = $var; - - return $this; - } - - /** - * Specifies whether an open Group of Pictures (GOP) structure should be - * allowed or not. The default is `false`. - * - * Generated from protobuf field bool allow_open_gop = 14; - * @return bool - */ - public function getAllowOpenGop() - { - return $this->allow_open_gop; - } - - /** - * Specifies whether an open Group of Pictures (GOP) structure should be - * allowed or not. The default is `false`. - * - * Generated from protobuf field bool allow_open_gop = 14; - * @param bool $var - * @return $this - */ - public function setAllowOpenGop($var) - { - GPBUtil::checkBool($var); - $this->allow_open_gop = $var; - - return $this; - } - - /** - * Select the GOP size based on the specified frame count. Must be greater - * than zero. - * - * Generated from protobuf field int32 gop_frame_count = 15; - * @return int - */ - public function getGopFrameCount() - { - return $this->readOneof(15); - } - - public function hasGopFrameCount() - { - return $this->hasOneof(15); - } - - /** - * Select the GOP size based on the specified frame count. Must be greater - * than zero. - * - * Generated from protobuf field int32 gop_frame_count = 15; - * @param int $var - * @return $this - */ - public function setGopFrameCount($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(15, $var); - - return $this; - } - - /** - * Select the GOP size based on the specified duration. The default is - * `"3s"`. Note that `gopDuration` must be less than or equal to - * [`segmentDuration`](#SegmentSettings), and - * [`segmentDuration`](#SegmentSettings) must be divisible by `gopDuration`. - * - * Generated from protobuf field .google.protobuf.Duration gop_duration = 16; - * @return \Google\Protobuf\Duration|null - */ - public function getGopDuration() - { - return $this->readOneof(16); - } - - public function hasGopDuration() - { - return $this->hasOneof(16); - } - - /** - * Select the GOP size based on the specified duration. The default is - * `"3s"`. Note that `gopDuration` must be less than or equal to - * [`segmentDuration`](#SegmentSettings), and - * [`segmentDuration`](#SegmentSettings) must be divisible by `gopDuration`. - * - * Generated from protobuf field .google.protobuf.Duration gop_duration = 16; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setGopDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->writeOneof(16, $var); - - return $this; - } - - /** - * The entropy coder to use. The default is `"cabac"`. - * Supported entropy coders: - * - 'cavlc' - * - 'cabac' - * - * Generated from protobuf field string entropy_coder = 17; - * @return string - */ - public function getEntropyCoder() - { - return $this->entropy_coder; - } - - /** - * The entropy coder to use. The default is `"cabac"`. - * Supported entropy coders: - * - 'cavlc' - * - 'cabac' - * - * Generated from protobuf field string entropy_coder = 17; - * @param string $var - * @return $this - */ - public function setEntropyCoder($var) - { - GPBUtil::checkString($var, True); - $this->entropy_coder = $var; - - return $this; - } - - /** - * Allow B-pyramid for reference frame selection. This may not be supported - * on all decoders. The default is `false`. - * - * Generated from protobuf field bool b_pyramid = 18; - * @return bool - */ - public function getBPyramid() - { - return $this->b_pyramid; - } - - /** - * Allow B-pyramid for reference frame selection. This may not be supported - * on all decoders. The default is `false`. - * - * Generated from protobuf field bool b_pyramid = 18; - * @param bool $var - * @return $this - */ - public function setBPyramid($var) - { - GPBUtil::checkBool($var); - $this->b_pyramid = $var; - - return $this; - } - - /** - * The number of consecutive B-frames. Must be greater than or equal to zero. - * Must be less than `VideoStream.gop_frame_count` if set. The default is 0. - * - * Generated from protobuf field int32 b_frame_count = 19; - * @return int - */ - public function getBFrameCount() - { - return $this->b_frame_count; - } - - /** - * The number of consecutive B-frames. Must be greater than or equal to zero. - * Must be less than `VideoStream.gop_frame_count` if set. The default is 0. - * - * Generated from protobuf field int32 b_frame_count = 19; - * @param int $var - * @return $this - */ - public function setBFrameCount($var) - { - GPBUtil::checkInt32($var); - $this->b_frame_count = $var; - - return $this; - } - - /** - * Required. The target video frame rate in frames per second (FPS). Must be less than - * or equal to 120. Will default to the input frame rate if larger than the - * input frame rate. The API will generate an output FPS that is divisible by - * the input FPS, and smaller or equal to the target FPS. See - * [Calculate frame - * rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for - * more information. - * - * Generated from protobuf field double frame_rate = 20 [(.google.api.field_behavior) = REQUIRED]; - * @return float - */ - public function getFrameRate() - { - return $this->frame_rate; - } - - /** - * Required. The target video frame rate in frames per second (FPS). Must be less than - * or equal to 120. Will default to the input frame rate if larger than the - * input frame rate. The API will generate an output FPS that is divisible by - * the input FPS, and smaller or equal to the target FPS. See - * [Calculate frame - * rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for - * more information. - * - * Generated from protobuf field double frame_rate = 20 [(.google.api.field_behavior) = REQUIRED]; - * @param float $var - * @return $this - */ - public function setFrameRate($var) - { - GPBUtil::checkDouble($var); - $this->frame_rate = $var; - - return $this; - } - - /** - * Specify the intensity of the adaptive quantizer (AQ). Must be between 0 and - * 1, where 0 disables the quantizer and 1 maximizes the quantizer. A - * higher value equals a lower bitrate but smoother image. The default is 0. - * - * Generated from protobuf field double aq_strength = 21; - * @return float - */ - public function getAqStrength() - { - return $this->aq_strength; - } - - /** - * Specify the intensity of the adaptive quantizer (AQ). Must be between 0 and - * 1, where 0 disables the quantizer and 1 maximizes the quantizer. A - * higher value equals a lower bitrate but smoother image. The default is 0. - * - * Generated from protobuf field double aq_strength = 21; - * @param float $var - * @return $this - */ - public function setAqStrength($var) - { - GPBUtil::checkDouble($var); - $this->aq_strength = $var; - - return $this; - } - - /** - * @return string - */ - public function getGopMode() - { - return $this->whichOneof("gop_mode"); - } - -} - diff --git a/VideoTranscoder/src/V1beta1/gapic_metadata.json b/VideoTranscoder/src/V1beta1/gapic_metadata.json deleted file mode 100644 index 6eb7417d697c..000000000000 --- a/VideoTranscoder/src/V1beta1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.video.transcoder.v1beta1", - "libraryPackage": "Google\\Cloud\\Video\\Transcoder\\V1beta1", - "services": { - "TranscoderService": { - "clients": { - "grpc": { - "libraryClient": "TranscoderServiceGapicClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "CreateJobTemplate": { - "methods": [ - "createJobTemplate" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "DeleteJobTemplate": { - "methods": [ - "deleteJobTemplate" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetJobTemplate": { - "methods": [ - "getJobTemplate" - ] - }, - "ListJobTemplates": { - "methods": [ - "listJobTemplates" - ] - }, - "ListJobs": { - "methods": [ - "listJobs" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/VideoTranscoder/src/V1beta1/resources/transcoder_service_client_config.json b/VideoTranscoder/src/V1beta1/resources/transcoder_service_client_config.json deleted file mode 100644 index 20a14c70bd89..000000000000 --- a/VideoTranscoder/src/V1beta1/resources/transcoder_service_client_config.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "interfaces": { - "google.cloud.video.transcoder.v1beta1.TranscoderService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateJobTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteJobTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetJobTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListJobTemplates": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListJobs": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/VideoTranscoder/src/V1beta1/resources/transcoder_service_descriptor_config.php b/VideoTranscoder/src/V1beta1/resources/transcoder_service_descriptor_config.php deleted file mode 100644 index 4765ff7321fd..000000000000 --- a/VideoTranscoder/src/V1beta1/resources/transcoder_service_descriptor_config.php +++ /dev/null @@ -1,28 +0,0 @@ - [ - 'google.cloud.video.transcoder.v1beta1.TranscoderService' => [ - 'ListJobTemplates' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getJobTemplates', - ], - ], - 'ListJobs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getJobs', - ], - ], - ], - ], -]; diff --git a/VideoTranscoder/src/V1beta1/resources/transcoder_service_rest_client_config.php b/VideoTranscoder/src/V1beta1/resources/transcoder_service_rest_client_config.php deleted file mode 100644 index 24099c30848e..000000000000 --- a/VideoTranscoder/src/V1beta1/resources/transcoder_service_rest_client_config.php +++ /dev/null @@ -1,101 +0,0 @@ - [ - 'google.cloud.video.transcoder.v1beta1.TranscoderService' => [ - 'CreateJob' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/jobs', - 'body' => 'job', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateJobTemplate' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/jobTemplates', - 'body' => 'job_template', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'job_template_id', - ], - ], - 'DeleteJob' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/jobs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteJobTemplate' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/jobTemplates/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetJob' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/jobs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetJobTemplate' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/jobTemplates/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListJobTemplates' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/jobTemplates', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListJobs' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/jobs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - ], -]; diff --git a/VideoTranscoder/tests/Unit/V1/Client/TranscoderServiceClientTest.php b/VideoTranscoder/tests/Unit/V1/Client/TranscoderServiceClientTest.php index 3a9a8088e2d6..d3614dd8de14 100644 --- a/VideoTranscoder/tests/Unit/V1/Client/TranscoderServiceClientTest.php +++ b/VideoTranscoder/tests/Unit/V1/Client/TranscoderServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return TranscoderServiceClient */ @@ -97,9 +99,7 @@ public function createJobTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $job = new Job(); - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job); + $request = (new CreateJobRequest())->setParent($formattedParent)->setJob($job); $response = $gapicClient->createJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -125,19 +125,20 @@ public function createJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $job = new Job(); - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job); + $request = (new CreateJobRequest())->setParent($formattedParent)->setJob($job); try { $gapicClient->createJob($request); // If the $gapicClient method call did not throw, fail the test @@ -199,12 +200,15 @@ public function createJobTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -240,8 +244,7 @@ public function deleteJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new DeleteJobRequest()) - ->setName($formattedName); + $request = (new DeleteJobRequest())->setName($formattedName); $gapicClient->deleteJob($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -264,17 +267,19 @@ public function deleteJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new DeleteJobRequest()) - ->setName($formattedName); + $request = (new DeleteJobRequest())->setName($formattedName); try { $gapicClient->deleteJob($request); // If the $gapicClient method call did not throw, fail the test @@ -301,8 +306,7 @@ public function deleteJobTemplateTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - $request = (new DeleteJobTemplateRequest()) - ->setName($formattedName); + $request = (new DeleteJobTemplateRequest())->setName($formattedName); $gapicClient->deleteJobTemplate($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -325,17 +329,19 @@ public function deleteJobTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - $request = (new DeleteJobTemplateRequest()) - ->setName($formattedName); + $request = (new DeleteJobTemplateRequest())->setName($formattedName); try { $gapicClient->deleteJobTemplate($request); // If the $gapicClient method call did not throw, fail the test @@ -374,8 +380,7 @@ public function getJobTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new GetJobRequest()) - ->setName($formattedName); + $request = (new GetJobRequest())->setName($formattedName); $response = $gapicClient->getJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -399,17 +404,19 @@ public function getJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $request = (new GetJobRequest()) - ->setName($formattedName); + $request = (new GetJobRequest())->setName($formattedName); try { $gapicClient->getJob($request); // If the $gapicClient method call did not throw, fail the test @@ -438,8 +445,7 @@ public function getJobTemplateTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - $request = (new GetJobTemplateRequest()) - ->setName($formattedName); + $request = (new GetJobTemplateRequest())->setName($formattedName); $response = $gapicClient->getJobTemplate($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -463,17 +469,19 @@ public function getJobTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - $request = (new GetJobTemplateRequest()) - ->setName($formattedName); + $request = (new GetJobTemplateRequest())->setName($formattedName); try { $gapicClient->getJobTemplate($request); // If the $gapicClient method call did not throw, fail the test @@ -498,17 +506,14 @@ public function listJobTemplatesTest() // Mock response $nextPageToken = ''; $jobTemplatesElement = new JobTemplate(); - $jobTemplates = [ - $jobTemplatesElement, - ]; + $jobTemplates = [$jobTemplatesElement]; $expectedResponse = new ListJobTemplatesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setJobTemplates($jobTemplates); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListJobTemplatesRequest()) - ->setParent($formattedParent); + $request = (new ListJobTemplatesRequest())->setParent($formattedParent); $response = $gapicClient->listJobTemplates($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -535,17 +540,19 @@ public function listJobTemplatesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListJobTemplatesRequest()) - ->setParent($formattedParent); + $request = (new ListJobTemplatesRequest())->setParent($formattedParent); try { $gapicClient->listJobTemplates($request); // If the $gapicClient method call did not throw, fail the test @@ -570,17 +577,14 @@ public function listJobsTest() // Mock response $nextPageToken = ''; $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; + $jobs = [$jobsElement]; $expectedResponse = new ListJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setJobs($jobs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListJobsRequest()) - ->setParent($formattedParent); + $request = (new ListJobsRequest())->setParent($formattedParent); $response = $gapicClient->listJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -607,17 +611,19 @@ public function listJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListJobsRequest()) - ->setParent($formattedParent); + $request = (new ListJobsRequest())->setParent($formattedParent); try { $gapicClient->listJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -657,9 +663,7 @@ public function createJobAsyncTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $job = new Job(); - $request = (new CreateJobRequest()) - ->setParent($formattedParent) - ->setJob($job); + $request = (new CreateJobRequest())->setParent($formattedParent)->setJob($job); $response = $gapicClient->createJobAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/VideoTranscoder/tests/Unit/V1/TranscoderServiceClientTest.php b/VideoTranscoder/tests/Unit/V1/TranscoderServiceClientTest.php deleted file mode 100644 index 5b31d4bb99d3..000000000000 --- a/VideoTranscoder/tests/Unit/V1/TranscoderServiceClientTest.php +++ /dev/null @@ -1,587 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TranscoderServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TranscoderServiceClient($options); - } - - /** @test */ - public function createJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $inputUri = 'inputUri1707300727'; - $outputUri = 'outputUri-1273518802'; - $templateId = 'templateId1769642752'; - $ttlAfterCompletionDays = 107576420; - $batchModePriority = 2137003131; - $expectedResponse = new Job(); - $expectedResponse->setName($name); - $expectedResponse->setInputUri($inputUri); - $expectedResponse->setOutputUri($outputUri); - $expectedResponse->setTemplateId($templateId); - $expectedResponse->setTtlAfterCompletionDays($ttlAfterCompletionDays); - $expectedResponse->setBatchModePriority($batchModePriority); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - $response = $gapicClient->createJob($formattedParent, $job); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1.TranscoderService/CreateJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getJob(); - $this->assertProtobufEquals($job, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - try { - $gapicClient->createJob($formattedParent, $job); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createJobTemplateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new JobTemplate(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $jobTemplate = new JobTemplate(); - $jobTemplateId = 'jobTemplateId-1231822466'; - $response = $gapicClient->createJobTemplate($formattedParent, $jobTemplate, $jobTemplateId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1.TranscoderService/CreateJobTemplate', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getJobTemplate(); - $this->assertProtobufEquals($jobTemplate, $actualValue); - $actualValue = $actualRequestObject->getJobTemplateId(); - $this->assertProtobufEquals($jobTemplateId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createJobTemplateExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $jobTemplate = new JobTemplate(); - $jobTemplateId = 'jobTemplateId-1231822466'; - try { - $gapicClient->createJobTemplate($formattedParent, $jobTemplate, $jobTemplateId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $gapicClient->deleteJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1.TranscoderService/DeleteJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - try { - $gapicClient->deleteJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteJobTemplateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - $gapicClient->deleteJobTemplate($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1.TranscoderService/DeleteJobTemplate', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteJobTemplateExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - try { - $gapicClient->deleteJobTemplate($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $inputUri = 'inputUri1707300727'; - $outputUri = 'outputUri-1273518802'; - $templateId = 'templateId1769642752'; - $ttlAfterCompletionDays = 107576420; - $batchModePriority = 2137003131; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setInputUri($inputUri); - $expectedResponse->setOutputUri($outputUri); - $expectedResponse->setTemplateId($templateId); - $expectedResponse->setTtlAfterCompletionDays($ttlAfterCompletionDays); - $expectedResponse->setBatchModePriority($batchModePriority); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $response = $gapicClient->getJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1.TranscoderService/GetJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - try { - $gapicClient->getJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobTemplateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new JobTemplate(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - $response = $gapicClient->getJobTemplate($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1.TranscoderService/GetJobTemplate', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobTemplateExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - try { - $gapicClient->getJobTemplate($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobTemplatesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobTemplatesElement = new JobTemplate(); - $jobTemplates = [ - $jobTemplatesElement, - ]; - $expectedResponse = new ListJobTemplatesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobTemplates($jobTemplates); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listJobTemplates($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobTemplates()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1.TranscoderService/ListJobTemplates', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobTemplatesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listJobTemplates($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; - $expectedResponse = new ListJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobs($jobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1.TranscoderService/ListJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listJobs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/VideoTranscoder/tests/Unit/V1beta1/TranscoderServiceClientTest.php b/VideoTranscoder/tests/Unit/V1beta1/TranscoderServiceClientTest.php deleted file mode 100644 index 0b0a04ba513e..000000000000 --- a/VideoTranscoder/tests/Unit/V1beta1/TranscoderServiceClientTest.php +++ /dev/null @@ -1,631 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** - * @return TranscoderServiceClient - */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TranscoderServiceClient($options); - } - - /** - * @test - */ - public function createJobTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $inputUri = 'inputUri1707300727'; - $outputUri = 'outputUri-1273518802'; - $templateId = 'templateId1769642752'; - $priority = 1165461084; - $failureReason = 'failureReason1743941273'; - $ttlAfterCompletionDays = 107576420; - $expectedResponse = new Job(); - $expectedResponse->setName($name); - $expectedResponse->setInputUri($inputUri); - $expectedResponse->setOutputUri($outputUri); - $expectedResponse->setTemplateId($templateId); - $expectedResponse->setPriority($priority); - $expectedResponse->setFailureReason($failureReason); - $expectedResponse->setTtlAfterCompletionDays($ttlAfterCompletionDays); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - $response = $client->createJob($formattedParent, $job); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1beta1.TranscoderService/CreateJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getJob(); - $this->assertProtobufEquals($job, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createJobExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - try { - $client->createJob($formattedParent, $job); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createJobTemplateTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new JobTemplate(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $jobTemplate = new JobTemplate(); - $jobTemplateId = 'jobTemplateId-1231822466'; - $response = $client->createJobTemplate($formattedParent, $jobTemplate, $jobTemplateId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1beta1.TranscoderService/CreateJobTemplate', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getJobTemplate(); - $this->assertProtobufEquals($jobTemplate, $actualValue); - $actualValue = $actualRequestObject->getJobTemplateId(); - $this->assertProtobufEquals($jobTemplateId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createJobTemplateExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $jobTemplate = new JobTemplate(); - $jobTemplateId = 'jobTemplateId-1231822466'; - try { - $client->createJobTemplate($formattedParent, $jobTemplate, $jobTemplateId); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteJobTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $client->deleteJob($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1beta1.TranscoderService/DeleteJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteJobExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - try { - $client->deleteJob($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteJobTemplateTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - $client->deleteJobTemplate($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1beta1.TranscoderService/DeleteJobTemplate', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteJobTemplateExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - try { - $client->deleteJobTemplate($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getJobTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $inputUri = 'inputUri1707300727'; - $outputUri = 'outputUri-1273518802'; - $templateId = 'templateId1769642752'; - $priority = 1165461084; - $failureReason = 'failureReason1743941273'; - $ttlAfterCompletionDays = 107576420; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setInputUri($inputUri); - $expectedResponse->setOutputUri($outputUri); - $expectedResponse->setTemplateId($templateId); - $expectedResponse->setPriority($priority); - $expectedResponse->setFailureReason($failureReason); - $expectedResponse->setTtlAfterCompletionDays($ttlAfterCompletionDays); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $response = $client->getJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1beta1.TranscoderService/GetJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getJobExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - try { - $client->getJob($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getJobTemplateTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new JobTemplate(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - $response = $client->getJobTemplate($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1beta1.TranscoderService/GetJobTemplate', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getJobTemplateExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->jobTemplateName('[PROJECT]', '[LOCATION]', '[JOB_TEMPLATE]'); - try { - $client->getJobTemplate($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listJobTemplatesTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobTemplatesElement = new JobTemplate(); - $jobTemplates = [ - $jobTemplatesElement, - ]; - $expectedResponse = new ListJobTemplatesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobTemplates($jobTemplates); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $response = $client->listJobTemplates($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobTemplates()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1beta1.TranscoderService/ListJobTemplates', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listJobTemplatesExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - try { - $client->listJobTemplates($formattedParent); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listJobsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; - $expectedResponse = new ListJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobs($jobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $response = $client->listJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.video.transcoder.v1beta1.TranscoderService/ListJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listJobsExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - try { - $client->listJobs($formattedParent); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Vision/.repo-metadata.json b/Vision/.repo-metadata.json deleted file mode 100644 index 72af7b7c9b4d..000000000000 --- a/Vision/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-vision", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-vision/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "vision" -} diff --git a/Vision/VERSION b/Vision/VERSION index 8fdcf3869464..d615fd0c04ab 100644 --- a/Vision/VERSION +++ b/Vision/VERSION @@ -1 +1 @@ -1.9.2 +1.9.4 diff --git a/Vision/composer.json b/Vision/composer.json index a8a5496a810a..fcec8513f483 100644 --- a/Vision/composer.json +++ b/Vision/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^8.0", "google/cloud-core": "^1.52.7", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/Vision/src/VisionClient.php b/Vision/src/VisionClient.php index 7976f3547a04..a73c5c704f69 100644 --- a/Vision/src/VisionClient.php +++ b/Vision/src/VisionClient.php @@ -50,7 +50,7 @@ class VisionClient use ClientTrait; use ValidateTrait; - const VERSION = '1.9.2'; + const VERSION = '1.9.4'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/cloud-platform'; diff --git a/VmMigration/.repo-metadata.json b/VmMigration/.repo-metadata.json deleted file mode 100644 index 279ca73a3e61..000000000000 --- a/VmMigration/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-vm-migration", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-vm-migration/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "vmmigration" -} diff --git a/VmMigration/README.md b/VmMigration/README.md index 556e300c6431..076f68711644 100644 --- a/VmMigration/README.md +++ b/VmMigration/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/VmMigration/VERSION b/VmMigration/VERSION index 844f6a91acb9..ef5e4454454d 100644 --- a/VmMigration/VERSION +++ b/VmMigration/VERSION @@ -1 +1 @@ -0.6.3 +0.6.5 diff --git a/VmMigration/composer.json b/VmMigration/composer.json index 6d89c578d275..bded683785ad 100644 --- a/VmMigration/composer.json +++ b/VmMigration/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/VmMigration/owlbot.py b/VmMigration/owlbot.py index 6e2638682f4a..facb777b5da6 100644 --- a/VmMigration/owlbot.py +++ b/VmMigration/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -47,32 +41,6 @@ + "\n", '') -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) - # format generated clients subprocess.run([ 'npm', @@ -81,8 +49,8 @@ '--package=@prettier/plugin-php@^0.16', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', - '--print-width=80']) + '--print-width=120']) diff --git a/VmMigration/src/V1/AddGroupMigrationRequest.php b/VmMigration/src/V1/AddGroupMigrationRequest.php index 5d5a21fd908e..d4a9f9a19d65 100644 --- a/VmMigration/src/V1/AddGroupMigrationRequest.php +++ b/VmMigration/src/V1/AddGroupMigrationRequest.php @@ -20,13 +20,13 @@ class AddGroupMigrationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string group = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $group = ''; + protected $group = ''; /** * The full path name of the MigratingVm to add. * * Generated from protobuf field string migrating_vm = 2 [(.google.api.resource_reference) = { */ - private $migrating_vm = ''; + protected $migrating_vm = ''; /** * @param string $group Required. The full path name of the Group to add to. Please see diff --git a/VmMigration/src/V1/ApplianceVersion.php b/VmMigration/src/V1/ApplianceVersion.php index f022a0119498..da08b27da901 100644 --- a/VmMigration/src/V1/ApplianceVersion.php +++ b/VmMigration/src/V1/ApplianceVersion.php @@ -20,25 +20,25 @@ class ApplianceVersion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1; */ - private $version = ''; + protected $version = ''; /** * A link for downloading the version. * * Generated from protobuf field string uri = 2; */ - private $uri = ''; + protected $uri = ''; /** * Determine whether it's critical to upgrade the appliance to this version. * * Generated from protobuf field bool critical = 3; */ - private $critical = false; + protected $critical = false; /** * Link to a page that contains the version release notes. * * Generated from protobuf field string release_notes_uri = 4; */ - private $release_notes_uri = ''; + protected $release_notes_uri = ''; /** * Constructor. diff --git a/VmMigration/src/V1/AppliedLicense.php b/VmMigration/src/V1/AppliedLicense.php index c5a113d19b93..c015b9cf1649 100644 --- a/VmMigration/src/V1/AppliedLicense.php +++ b/VmMigration/src/V1/AppliedLicense.php @@ -20,13 +20,13 @@ class AppliedLicense extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.AppliedLicense.Type type = 1; */ - private $type = 0; + protected $type = 0; /** * The OS license returned from the adaptation module's report. * * Generated from protobuf field string os_license = 2; */ - private $os_license = ''; + protected $os_license = ''; /** * Constructor. diff --git a/VmMigration/src/V1/AvailableUpdates.php b/VmMigration/src/V1/AvailableUpdates.php index a69c68d42630..a32202170f8c 100644 --- a/VmMigration/src/V1/AvailableUpdates.php +++ b/VmMigration/src/V1/AvailableUpdates.php @@ -22,7 +22,7 @@ class AvailableUpdates extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.ApplianceVersion new_deployable_appliance = 1; */ - private $new_deployable_appliance = null; + protected $new_deployable_appliance = null; /** * The latest version for in place update. * The current appliance can be updated to this version using the API or m4c @@ -30,7 +30,7 @@ class AvailableUpdates extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.ApplianceVersion in_place_update = 2; */ - private $in_place_update = null; + protected $in_place_update = null; /** * Constructor. diff --git a/VmMigration/src/V1/AwsSecurityGroup.php b/VmMigration/src/V1/AwsSecurityGroup.php index 480c39f44ea6..ee8d6768c507 100644 --- a/VmMigration/src/V1/AwsSecurityGroup.php +++ b/VmMigration/src/V1/AwsSecurityGroup.php @@ -20,13 +20,13 @@ class AwsSecurityGroup extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * The AWS security group name. * * Generated from protobuf field string name = 2; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/VmMigration/src/V1/AwsSourceDetails.php b/VmMigration/src/V1/AwsSourceDetails.php index d113bc6d584d..31c465db770b 100644 --- a/VmMigration/src/V1/AwsSourceDetails.php +++ b/VmMigration/src/V1/AwsSourceDetails.php @@ -21,20 +21,20 @@ class AwsSourceDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string aws_region = 3 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $aws_region = ''; + protected $aws_region = ''; /** * Output only. State of the source as determined by the health check. * * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceDetails.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Provides details on the state of the Source in case of an * error. * * Generated from protobuf field .google.rpc.Status error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * AWS resource tags to limit the scope of the source inventory. * @@ -63,7 +63,7 @@ class AwsSourceDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string public_ip = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $public_ip = ''; + protected $public_ip = ''; protected $credentials_type; /** diff --git a/VmMigration/src/V1/AwsSourceDetails/AccessKeyCredentials.php b/VmMigration/src/V1/AwsSourceDetails/AccessKeyCredentials.php index 6727ba28ccc5..6833136f1cfb 100644 --- a/VmMigration/src/V1/AwsSourceDetails/AccessKeyCredentials.php +++ b/VmMigration/src/V1/AwsSourceDetails/AccessKeyCredentials.php @@ -20,13 +20,13 @@ class AccessKeyCredentials extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string access_key_id = 1; */ - private $access_key_id = ''; + protected $access_key_id = ''; /** * Input only. AWS secret access key. * * Generated from protobuf field string secret_access_key = 2 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $secret_access_key = ''; + protected $secret_access_key = ''; /** * Constructor. diff --git a/VmMigration/src/V1/AwsSourceDetails/Tag.php b/VmMigration/src/V1/AwsSourceDetails/Tag.php index 4ea016f3d4e9..2c366e5c7613 100644 --- a/VmMigration/src/V1/AwsSourceDetails/Tag.php +++ b/VmMigration/src/V1/AwsSourceDetails/Tag.php @@ -20,13 +20,13 @@ class Tag extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 1; */ - private $key = ''; + protected $key = ''; /** * Value of tag. * * Generated from protobuf field string value = 2; */ - private $value = ''; + protected $value = ''; /** * Constructor. diff --git a/VmMigration/src/V1/AwsSourceVmDetails.php b/VmMigration/src/V1/AwsSourceVmDetails.php index 8627654a2899..b8365eebfd4d 100644 --- a/VmMigration/src/V1/AwsSourceVmDetails.php +++ b/VmMigration/src/V1/AwsSourceVmDetails.php @@ -20,13 +20,13 @@ class AwsSourceVmDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceVmDetails.Firmware firmware = 1; */ - private $firmware = 0; + protected $firmware = 0; /** * The total size of the disks being migrated in bytes. * * Generated from protobuf field int64 committed_storage_bytes = 2; */ - private $committed_storage_bytes = 0; + protected $committed_storage_bytes = 0; /** * Constructor. diff --git a/VmMigration/src/V1/AwsVmDetails.php b/VmMigration/src/V1/AwsVmDetails.php index 4c0f04606e01..7535504cdd78 100644 --- a/VmMigration/src/V1/AwsVmDetails.php +++ b/VmMigration/src/V1/AwsVmDetails.php @@ -20,79 +20,79 @@ class AwsVmDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string vm_id = 1; */ - private $vm_id = ''; + protected $vm_id = ''; /** * The display name of the VM. Note that this value is not necessarily unique. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * The id of the AWS's source this VM is connected to. * * Generated from protobuf field string source_id = 3; */ - private $source_id = ''; + protected $source_id = ''; /** * The descriptive name of the AWS's source this VM is connected to. * * Generated from protobuf field string source_description = 4; */ - private $source_description = ''; + protected $source_description = ''; /** * Output only. The power state of the VM at the moment list was taken. * * Generated from protobuf field .google.cloud.vmmigration.v1.AwsVmDetails.PowerState power_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $power_state = 0; + protected $power_state = 0; /** * The number of cpus the VM has. * * Generated from protobuf field int32 cpu_count = 6; */ - private $cpu_count = 0; + protected $cpu_count = 0; /** * The memory size of the VM in MB. * * Generated from protobuf field int32 memory_mb = 7; */ - private $memory_mb = 0; + protected $memory_mb = 0; /** * The number of disks the VM has. * * Generated from protobuf field int32 disk_count = 8; */ - private $disk_count = 0; + protected $disk_count = 0; /** * The total size of the storage allocated to the VM in MB. * * Generated from protobuf field int64 committed_storage_mb = 9; */ - private $committed_storage_mb = 0; + protected $committed_storage_mb = 0; /** * The VM's OS. * * Generated from protobuf field string os_description = 10; */ - private $os_description = ''; + protected $os_description = ''; /** * The VM Boot Option. * * Generated from protobuf field .google.cloud.vmmigration.v1.AwsVmDetails.BootOption boot_option = 11; */ - private $boot_option = 0; + protected $boot_option = 0; /** * The instance type of the VM. * * Generated from protobuf field string instance_type = 12; */ - private $instance_type = ''; + protected $instance_type = ''; /** * The VPC ID the VM belongs to. * * Generated from protobuf field string vpc_id = 13; */ - private $vpc_id = ''; + protected $vpc_id = ''; /** * The security groups the VM belongs to. * @@ -110,19 +110,19 @@ class AwsVmDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string zone = 16; */ - private $zone = ''; + protected $zone = ''; /** * The virtualization type. * * Generated from protobuf field .google.cloud.vmmigration.v1.AwsVmDetails.VmVirtualizationType virtualization_type = 17; */ - private $virtualization_type = 0; + protected $virtualization_type = 0; /** * The CPU architecture. * * Generated from protobuf field .google.cloud.vmmigration.v1.AwsVmDetails.VmArchitecture architecture = 18; */ - private $architecture = 0; + protected $architecture = 0; /** * Constructor. diff --git a/VmMigration/src/V1/CancelCloneJobRequest.php b/VmMigration/src/V1/CancelCloneJobRequest.php index cde00ce199f4..77cdadd56226 100644 --- a/VmMigration/src/V1/CancelCloneJobRequest.php +++ b/VmMigration/src/V1/CancelCloneJobRequest.php @@ -20,7 +20,7 @@ class CancelCloneJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The clone job id diff --git a/VmMigration/src/V1/CancelCutoverJobRequest.php b/VmMigration/src/V1/CancelCutoverJobRequest.php index cd03359e11cf..71738014938e 100644 --- a/VmMigration/src/V1/CancelCutoverJobRequest.php +++ b/VmMigration/src/V1/CancelCutoverJobRequest.php @@ -20,7 +20,7 @@ class CancelCutoverJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The cutover job id diff --git a/VmMigration/src/V1/Client/VmMigrationClient.php b/VmMigration/src/V1/Client/VmMigrationClient.php index db4f4dbe446d..6770977e510e 100644 --- a/VmMigration/src/V1/Client/VmMigrationClient.php +++ b/VmMigration/src/V1/Client/VmMigrationClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a clone_job * resource. @@ -248,8 +267,13 @@ public function resumeOperation($operationName, $methodName = null) * * @return string The formatted clone_job resource. */ - public static function cloneJobName(string $project, string $location, string $source, string $migratingVm, string $cloneJob): string - { + public static function cloneJobName( + string $project, + string $location, + string $source, + string $migratingVm, + string $cloneJob + ): string { return self::getPathTemplate('cloneJob')->render([ 'project' => $project, 'location' => $location, @@ -271,8 +295,13 @@ public static function cloneJobName(string $project, string $location, string $s * * @return string The formatted cutover_job resource. */ - public static function cutoverJobName(string $project, string $location, string $source, string $migratingVm, string $cutoverJob): string - { + public static function cutoverJobName( + string $project, + string $location, + string $source, + string $migratingVm, + string $cutoverJob + ): string { return self::getPathTemplate('cutoverJob')->render([ 'project' => $project, 'location' => $location, @@ -293,8 +322,12 @@ public static function cutoverJobName(string $project, string $location, string * * @return string The formatted datacenter_connector resource. */ - public static function datacenterConnectorName(string $project, string $location, string $source, string $datacenterConnector): string - { + public static function datacenterConnectorName( + string $project, + string $location, + string $source, + string $datacenterConnector + ): string { return self::getPathTemplate('datacenterConnector')->render([ 'project' => $project, 'location' => $location, @@ -350,8 +383,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted migrating_vm resource. */ - public static function migratingVmName(string $project, string $location, string $source, string $migratingVm): string - { + public static function migratingVmName( + string $project, + string $location, + string $source, + string $migratingVm + ): string { return self::getPathTemplate('migratingVm')->render([ 'project' => $project, 'location' => $location, @@ -372,8 +409,13 @@ public static function migratingVmName(string $project, string $location, string * * @return string The formatted replication_cycle resource. */ - public static function replicationCycleName(string $project, string $location, string $source, string $migratingVm, string $replicationCycle): string - { + public static function replicationCycleName( + string $project, + string $location, + string $source, + string $migratingVm, + string $replicationCycle + ): string { return self::getPathTemplate('replicationCycle')->render([ 'project' => $project, 'location' => $location, @@ -432,8 +474,12 @@ public static function targetProjectName(string $project, string $location, stri * * @return string The formatted utilization_report resource. */ - public static function utilizationReportName(string $project, string $location, string $source, string $utilizationReport): string - { + public static function utilizationReportName( + string $project, + string $location, + string $source, + string $utilizationReport + ): string { return self::getPathTemplate('utilizationReport')->render([ 'project' => $project, 'location' => $location, @@ -701,8 +747,10 @@ public function createCutoverJob(CreateCutoverJobRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function createDatacenterConnector(CreateDatacenterConnectorRequest $request, array $callOptions = []): OperationResponse - { + public function createDatacenterConnector( + CreateDatacenterConnectorRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateDatacenterConnector', $request, $callOptions)->wait(); } @@ -834,8 +882,10 @@ public function createTargetProject(CreateTargetProjectRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function createUtilizationReport(CreateUtilizationReportRequest $request, array $callOptions = []): OperationResponse - { + public function createUtilizationReport( + CreateUtilizationReportRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateUtilizationReport', $request, $callOptions)->wait(); } @@ -861,8 +911,10 @@ public function createUtilizationReport(CreateUtilizationReportRequest $request, * * @throws ApiException Thrown if the API call fails. */ - public function deleteDatacenterConnector(DeleteDatacenterConnectorRequest $request, array $callOptions = []): OperationResponse - { + public function deleteDatacenterConnector( + DeleteDatacenterConnectorRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteDatacenterConnector', $request, $callOptions)->wait(); } @@ -994,8 +1046,10 @@ public function deleteTargetProject(DeleteTargetProjectRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function deleteUtilizationReport(DeleteUtilizationReportRequest $request, array $callOptions = []): OperationResponse - { + public function deleteUtilizationReport( + DeleteUtilizationReportRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('DeleteUtilizationReport', $request, $callOptions)->wait(); } @@ -1129,8 +1183,10 @@ public function getCutoverJob(GetCutoverJobRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function getDatacenterConnector(GetDatacenterConnectorRequest $request, array $callOptions = []): DatacenterConnector - { + public function getDatacenterConnector( + GetDatacenterConnectorRequest $request, + array $callOptions = [] + ): DatacenterConnector { return $this->startApiCall('GetDatacenterConnector', $request, $callOptions)->wait(); } @@ -1288,8 +1344,10 @@ public function getTargetProject(GetTargetProjectRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function getUtilizationReport(GetUtilizationReportRequest $request, array $callOptions = []): UtilizationReport - { + public function getUtilizationReport( + GetUtilizationReportRequest $request, + array $callOptions = [] + ): UtilizationReport { return $this->startApiCall('GetUtilizationReport', $request, $callOptions)->wait(); } @@ -1366,8 +1424,10 @@ public function listCutoverJobs(ListCutoverJobsRequest $request, array $callOpti * * @throws ApiException Thrown if the API call fails. */ - public function listDatacenterConnectors(ListDatacenterConnectorsRequest $request, array $callOptions = []): PagedListResponse - { + public function listDatacenterConnectors( + ListDatacenterConnectorsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListDatacenterConnectors', $request, $callOptions); } @@ -1444,8 +1504,10 @@ public function listMigratingVms(ListMigratingVmsRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function listReplicationCycles(ListReplicationCyclesRequest $request, array $callOptions = []): PagedListResponse - { + public function listReplicationCycles( + ListReplicationCyclesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListReplicationCycles', $request, $callOptions); } @@ -1525,8 +1587,10 @@ public function listTargetProjects(ListTargetProjectsRequest $request, array $ca * * @throws ApiException Thrown if the API call fails. */ - public function listUtilizationReports(ListUtilizationReportsRequest $request, array $callOptions = []): PagedListResponse - { + public function listUtilizationReports( + ListUtilizationReportsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListUtilizationReports', $request, $callOptions); } @@ -1579,8 +1643,10 @@ public function pauseMigration(PauseMigrationRequest $request, array $callOption * * @throws ApiException Thrown if the API call fails. */ - public function removeGroupMigration(RemoveGroupMigrationRequest $request, array $callOptions = []): OperationResponse - { + public function removeGroupMigration( + RemoveGroupMigrationRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('RemoveGroupMigration', $request, $callOptions)->wait(); } diff --git a/VmMigration/src/V1/CloneJob.php b/VmMigration/src/V1/CloneJob.php index b0b8eb0c2f87..dd34db7de2c9 100644 --- a/VmMigration/src/V1/CloneJob.php +++ b/VmMigration/src/V1/CloneJob.php @@ -30,38 +30,38 @@ class CloneJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the clone job was ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The name of the clone. * * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. State of the clone job. * * Generated from protobuf field .google.cloud.vmmigration.v1.CloneJob.State state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The time the state was last updated. * * Generated from protobuf field .google.protobuf.Timestamp state_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_time = null; + protected $state_time = null; /** * Output only. Provides details for the errors that led to the Clone Job's * state. * * Generated from protobuf field .google.rpc.Status error = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Output only. The clone steps list representing its progress. * diff --git a/VmMigration/src/V1/CloneStep.php b/VmMigration/src/V1/CloneStep.php index 3cac101c16d2..38ffc545d9b1 100644 --- a/VmMigration/src/V1/CloneStep.php +++ b/VmMigration/src/V1/CloneStep.php @@ -20,13 +20,13 @@ class CloneStep extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - private $start_time = null; + protected $start_time = null; /** * The time the step has ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - private $end_time = null; + protected $end_time = null; protected $step; /** diff --git a/VmMigration/src/V1/ComputeEngineTargetDefaults.php b/VmMigration/src/V1/ComputeEngineTargetDefaults.php index a4d49184f91a..2745c0b602a8 100644 --- a/VmMigration/src/V1/ComputeEngineTargetDefaults.php +++ b/VmMigration/src/V1/ComputeEngineTargetDefaults.php @@ -21,32 +21,32 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string vm_name = 1; */ - private $vm_name = ''; + protected $vm_name = ''; /** * The full path of the resource of type TargetProject which represents the * Compute Engine project in which to create this VM. * * Generated from protobuf field string target_project = 2 [(.google.api.resource_reference) = { */ - private $target_project = ''; + protected $target_project = ''; /** * The zone in which to create the VM. * * Generated from protobuf field string zone = 3; */ - private $zone = ''; + protected $zone = ''; /** * The machine type series to create the VM with. * * Generated from protobuf field string machine_type_series = 4; */ - private $machine_type_series = ''; + protected $machine_type_series = ''; /** * The machine type to create the VM with. * * Generated from protobuf field string machine_type = 5; */ - private $machine_type = ''; + protected $machine_type = ''; /** * A map of network tags to associate with the VM. * @@ -64,13 +64,13 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 8; */ - private $service_account = ''; + protected $service_account = ''; /** * The disk type to use in the VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 9; */ - private $disk_type = 0; + protected $disk_type = 0; /** * A map of labels to associate with the VM. * @@ -82,32 +82,32 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineLicenseType license_type = 11; */ - private $license_type = 0; + protected $license_type = 0; /** * Output only. The OS license returned from the adaptation module report. * * Generated from protobuf field .google.cloud.vmmigration.v1.AppliedLicense applied_license = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $applied_license = null; + protected $applied_license = null; /** * Compute instance scheduling information (if empty default is used). * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeScheduling compute_scheduling = 13; */ - private $compute_scheduling = null; + protected $compute_scheduling = null; /** * Defines whether the instance has Secure Boot enabled. * This can be set to true only if the vm boot option is EFI. * * Generated from protobuf field bool secure_boot = 14; */ - private $secure_boot = false; + protected $secure_boot = false; /** * Output only. The VM Boot Option, as set in the source vm. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineBootOption boot_option = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $boot_option = 0; + protected $boot_option = 0; /** * The metadata key/value pairs to assign to the VM. * @@ -125,7 +125,7 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string hostname = 18; */ - private $hostname = ''; + protected $hostname = ''; /** * Constructor. diff --git a/VmMigration/src/V1/ComputeEngineTargetDetails.php b/VmMigration/src/V1/ComputeEngineTargetDetails.php index 98f744d4ddf5..aaca78c78818 100644 --- a/VmMigration/src/V1/ComputeEngineTargetDetails.php +++ b/VmMigration/src/V1/ComputeEngineTargetDetails.php @@ -21,31 +21,31 @@ class ComputeEngineTargetDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string vm_name = 1; */ - private $vm_name = ''; + protected $vm_name = ''; /** * The Google Cloud target project ID or project name. * * Generated from protobuf field string project = 2; */ - private $project = ''; + protected $project = ''; /** * The zone in which to create the VM. * * Generated from protobuf field string zone = 3; */ - private $zone = ''; + protected $zone = ''; /** * The machine type series to create the VM with. * * Generated from protobuf field string machine_type_series = 4; */ - private $machine_type_series = ''; + protected $machine_type_series = ''; /** * The machine type to create the VM with. * * Generated from protobuf field string machine_type = 5; */ - private $machine_type = ''; + protected $machine_type = ''; /** * A map of network tags to associate with the VM. * @@ -63,13 +63,13 @@ class ComputeEngineTargetDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account = 8; */ - private $service_account = ''; + protected $service_account = ''; /** * The disk type to use in the VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 9; */ - private $disk_type = 0; + protected $disk_type = 0; /** * A map of labels to associate with the VM. * @@ -81,32 +81,32 @@ class ComputeEngineTargetDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineLicenseType license_type = 11; */ - private $license_type = 0; + protected $license_type = 0; /** * The OS license returned from the adaptation module report. * * Generated from protobuf field .google.cloud.vmmigration.v1.AppliedLicense applied_license = 12; */ - private $applied_license = null; + protected $applied_license = null; /** * Compute instance scheduling information (if empty default is used). * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeScheduling compute_scheduling = 13; */ - private $compute_scheduling = null; + protected $compute_scheduling = null; /** * Defines whether the instance has Secure Boot enabled. * This can be set to true only if the vm boot option is EFI. * * Generated from protobuf field bool secure_boot = 14; */ - private $secure_boot = false; + protected $secure_boot = false; /** * The VM Boot Option, as set in the source vm. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineBootOption boot_option = 15; */ - private $boot_option = 0; + protected $boot_option = 0; /** * The metadata key/value pairs to assign to the VM. * @@ -124,7 +124,7 @@ class ComputeEngineTargetDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string hostname = 18; */ - private $hostname = ''; + protected $hostname = ''; /** * Constructor. diff --git a/VmMigration/src/V1/ComputeScheduling.php b/VmMigration/src/V1/ComputeScheduling.php index 5e32757597ee..bc30aaa06e34 100644 --- a/VmMigration/src/V1/ComputeScheduling.php +++ b/VmMigration/src/V1/ComputeScheduling.php @@ -22,7 +22,7 @@ class ComputeScheduling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance on_host_maintenance = 1; */ - private $on_host_maintenance = 0; + protected $on_host_maintenance = 0; /** * Whether the Instance should be automatically restarted whenever it is * terminated by Compute Engine (not terminated by user). @@ -33,7 +33,7 @@ class ComputeScheduling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeScheduling.RestartType restart_type = 5; */ - private $restart_type = 0; + protected $restart_type = 0; /** * A set of node affinity and anti-affinity configurations for sole tenant * nodes. @@ -48,7 +48,7 @@ class ComputeScheduling extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 min_node_cpus = 4; */ - private $min_node_cpus = 0; + protected $min_node_cpus = 0; /** * Constructor. diff --git a/VmMigration/src/V1/CreateCloneJobRequest.php b/VmMigration/src/V1/CreateCloneJobRequest.php index fba304995a1d..41851b8961e2 100644 --- a/VmMigration/src/V1/CreateCloneJobRequest.php +++ b/VmMigration/src/V1/CreateCloneJobRequest.php @@ -20,19 +20,19 @@ class CreateCloneJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The clone job identifier. * * Generated from protobuf field string clone_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $clone_job_id = ''; + protected $clone_job_id = ''; /** * Required. The clone request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.CloneJob clone_job = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $clone_job = null; + protected $clone_job = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -48,7 +48,7 @@ class CreateCloneJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The Clone's parent. Please see diff --git a/VmMigration/src/V1/CreateCutoverJobRequest.php b/VmMigration/src/V1/CreateCutoverJobRequest.php index 2932f98f357a..ca9cc7598345 100644 --- a/VmMigration/src/V1/CreateCutoverJobRequest.php +++ b/VmMigration/src/V1/CreateCutoverJobRequest.php @@ -20,19 +20,19 @@ class CreateCutoverJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The cutover job identifier. * * Generated from protobuf field string cutover_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $cutover_job_id = ''; + protected $cutover_job_id = ''; /** * Required. The cutover request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.CutoverJob cutover_job = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $cutover_job = null; + protected $cutover_job = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -48,7 +48,7 @@ class CreateCutoverJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The Cutover's parent. Please see diff --git a/VmMigration/src/V1/CreateDatacenterConnectorRequest.php b/VmMigration/src/V1/CreateDatacenterConnectorRequest.php index 66acc831cb58..ec4aaf84d99f 100644 --- a/VmMigration/src/V1/CreateDatacenterConnectorRequest.php +++ b/VmMigration/src/V1/CreateDatacenterConnectorRequest.php @@ -23,19 +23,19 @@ class CreateDatacenterConnectorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The datacenterConnector identifier. * * Generated from protobuf field string datacenter_connector_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $datacenter_connector_id = ''; + protected $datacenter_connector_id = ''; /** * Required. The create request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.DatacenterConnector datacenter_connector = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $datacenter_connector = null; + protected $datacenter_connector = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -51,7 +51,7 @@ class CreateDatacenterConnectorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The DatacenterConnector's parent. diff --git a/VmMigration/src/V1/CreateGroupRequest.php b/VmMigration/src/V1/CreateGroupRequest.php index 20cd3bddc46e..de9bfaea8932 100644 --- a/VmMigration/src/V1/CreateGroupRequest.php +++ b/VmMigration/src/V1/CreateGroupRequest.php @@ -20,19 +20,19 @@ class CreateGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The group identifier. * * Generated from protobuf field string group_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $group_id = ''; + protected $group_id = ''; /** * Required. The create request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.Group group = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $group = null; + protected $group = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -48,7 +48,7 @@ class CreateGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The Group's parent. Please see diff --git a/VmMigration/src/V1/CreateMigratingVmRequest.php b/VmMigration/src/V1/CreateMigratingVmRequest.php index 8f74f5c97229..c12c649f5023 100644 --- a/VmMigration/src/V1/CreateMigratingVmRequest.php +++ b/VmMigration/src/V1/CreateMigratingVmRequest.php @@ -20,19 +20,19 @@ class CreateMigratingVmRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The migratingVm identifier. * * Generated from protobuf field string migrating_vm_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $migrating_vm_id = ''; + protected $migrating_vm_id = ''; /** * Required. The create request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.MigratingVm migrating_vm = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $migrating_vm = null; + protected $migrating_vm = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -48,7 +48,7 @@ class CreateMigratingVmRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The MigratingVm's parent. Please see diff --git a/VmMigration/src/V1/CreateSourceRequest.php b/VmMigration/src/V1/CreateSourceRequest.php index 5b7c694d8316..525bb5819b4a 100644 --- a/VmMigration/src/V1/CreateSourceRequest.php +++ b/VmMigration/src/V1/CreateSourceRequest.php @@ -20,19 +20,19 @@ class CreateSourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The source identifier. * * Generated from protobuf field string source_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $source_id = ''; + protected $source_id = ''; /** * Required. The create request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.Source source = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $source = null; + protected $source = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -48,7 +48,7 @@ class CreateSourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The Source's parent. Please see diff --git a/VmMigration/src/V1/CreateTargetProjectRequest.php b/VmMigration/src/V1/CreateTargetProjectRequest.php index da4d182c1d35..fa7e25ef6158 100644 --- a/VmMigration/src/V1/CreateTargetProjectRequest.php +++ b/VmMigration/src/V1/CreateTargetProjectRequest.php @@ -20,19 +20,19 @@ class CreateTargetProjectRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The target_project identifier. * * Generated from protobuf field string target_project_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_project_id = ''; + protected $target_project_id = ''; /** * Required. The create request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.TargetProject target_project = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_project = null; + protected $target_project = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -48,7 +48,7 @@ class CreateTargetProjectRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The TargetProject's parent. Please see diff --git a/VmMigration/src/V1/CreateUtilizationReportRequest.php b/VmMigration/src/V1/CreateUtilizationReportRequest.php index d0c3fb4249d0..80a507c49703 100644 --- a/VmMigration/src/V1/CreateUtilizationReportRequest.php +++ b/VmMigration/src/V1/CreateUtilizationReportRequest.php @@ -20,13 +20,13 @@ class CreateUtilizationReportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The report to create. * * Generated from protobuf field .google.cloud.vmmigration.v1.UtilizationReport utilization_report = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $utilization_report = null; + protected $utilization_report = null; /** * Required. The ID to use for the report, which will become the final * component of the reports's resource name. @@ -36,7 +36,7 @@ class CreateUtilizationReportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string utilization_report_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $utilization_report_id = ''; + protected $utilization_report_id = ''; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -52,7 +52,7 @@ class CreateUtilizationReportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The Utilization Report's parent. Please see diff --git a/VmMigration/src/V1/CutoverJob.php b/VmMigration/src/V1/CutoverJob.php index 3a4cbaee6eea..3fafe9c8c7e7 100644 --- a/VmMigration/src/V1/CutoverJob.php +++ b/VmMigration/src/V1/CutoverJob.php @@ -23,51 +23,51 @@ class CutoverJob extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the cutover job had finished. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The name of the cutover job. * * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. State of the cutover job. * * Generated from protobuf field .google.cloud.vmmigration.v1.CutoverJob.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The time the state was last updated. * * Generated from protobuf field .google.protobuf.Timestamp state_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_time = null; + protected $state_time = null; /** * Output only. The current progress in percentage of the cutover job. * * Generated from protobuf field int32 progress_percent = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $progress_percent = 0; + protected $progress_percent = 0; /** * Output only. Provides details for the errors that led to the Cutover Job's * state. * * Generated from protobuf field .google.rpc.Status error = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Output only. A message providing possible extra details about the current * state. * * Generated from protobuf field string state_message = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_message = ''; + protected $state_message = ''; /** * Output only. The cutover steps list representing its progress. * diff --git a/VmMigration/src/V1/CutoverStep.php b/VmMigration/src/V1/CutoverStep.php index 452b660d77ec..68550eca3b97 100644 --- a/VmMigration/src/V1/CutoverStep.php +++ b/VmMigration/src/V1/CutoverStep.php @@ -20,13 +20,13 @@ class CutoverStep extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - private $start_time = null; + protected $start_time = null; /** * The time the step has ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - private $end_time = null; + protected $end_time = null; protected $step; /** diff --git a/VmMigration/src/V1/CycleStep.php b/VmMigration/src/V1/CycleStep.php index f034b17a9d57..a081411451d2 100644 --- a/VmMigration/src/V1/CycleStep.php +++ b/VmMigration/src/V1/CycleStep.php @@ -20,13 +20,13 @@ class CycleStep extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - private $start_time = null; + protected $start_time = null; /** * The time the cycle step has ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - private $end_time = null; + protected $end_time = null; protected $step; /** diff --git a/VmMigration/src/V1/DatacenterConnector.php b/VmMigration/src/V1/DatacenterConnector.php index 14d971981fb6..20244d65ed0b 100644 --- a/VmMigration/src/V1/DatacenterConnector.php +++ b/VmMigration/src/V1/DatacenterConnector.php @@ -24,19 +24,19 @@ class DatacenterConnector extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The last time the connector was updated with an API call. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. The connector's name. * * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Immutable. A unique key for this connector. This key is internal to the OVA * connector and is supplied with its creation during the registration process @@ -44,48 +44,48 @@ class DatacenterConnector extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string registration_id = 12 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $registration_id = ''; + protected $registration_id = ''; /** * The service account to use in the connector when communicating with the * cloud. * * Generated from protobuf field string service_account = 5; */ - private $service_account = ''; + protected $service_account = ''; /** * The version running in the DatacenterConnector. This is supplied by the OVA * connector during the registration process and can not be modified. * * Generated from protobuf field string version = 6; */ - private $version = ''; + protected $version = ''; /** * Output only. The communication channel between the datacenter connector and * Google Cloud. * * Generated from protobuf field string bucket = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $bucket = ''; + protected $bucket = ''; /** * Output only. State of the DatacenterConnector, as determined by the health * checks. * * Generated from protobuf field .google.cloud.vmmigration.v1.DatacenterConnector.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The time the state was last set. * * Generated from protobuf field .google.protobuf.Timestamp state_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_time = null; + protected $state_time = null; /** * Output only. Provides details on the state of the Datacenter Connector in * case of an error. * * Generated from protobuf field .google.rpc.Status error = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Output only. Appliance OVA version. * This is the OVA which is manually installed by the user and contains the @@ -93,7 +93,7 @@ class DatacenterConnector extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string appliance_infrastructure_version = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $appliance_infrastructure_version = ''; + protected $appliance_infrastructure_version = ''; /** * Output only. Appliance last installed update bundle version. * This is the version of the automatically updatable components on the @@ -101,19 +101,19 @@ class DatacenterConnector extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string appliance_software_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $appliance_software_version = ''; + protected $appliance_software_version = ''; /** * Output only. The available versions for updating this appliance. * * Generated from protobuf field .google.cloud.vmmigration.v1.AvailableUpdates available_versions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $available_versions = null; + protected $available_versions = null; /** * Output only. The status of the current / last upgradeAppliance operation. * * Generated from protobuf field .google.cloud.vmmigration.v1.UpgradeStatus upgrade_status = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $upgrade_status = null; + protected $upgrade_status = null; /** * Constructor. diff --git a/VmMigration/src/V1/DeleteDatacenterConnectorRequest.php b/VmMigration/src/V1/DeleteDatacenterConnectorRequest.php index 187c82be34e6..3a18f26d864c 100644 --- a/VmMigration/src/V1/DeleteDatacenterConnectorRequest.php +++ b/VmMigration/src/V1/DeleteDatacenterConnectorRequest.php @@ -20,7 +20,7 @@ class DeleteDatacenterConnectorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -36,7 +36,7 @@ class DeleteDatacenterConnectorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The DatacenterConnector name. Please see diff --git a/VmMigration/src/V1/DeleteGroupRequest.php b/VmMigration/src/V1/DeleteGroupRequest.php index cb8a9990a470..58ed1909db6e 100644 --- a/VmMigration/src/V1/DeleteGroupRequest.php +++ b/VmMigration/src/V1/DeleteGroupRequest.php @@ -20,7 +20,7 @@ class DeleteGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -36,7 +36,7 @@ class DeleteGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The Group name. Please see diff --git a/VmMigration/src/V1/DeleteMigratingVmRequest.php b/VmMigration/src/V1/DeleteMigratingVmRequest.php index 56862dfda748..d92845c4cd69 100644 --- a/VmMigration/src/V1/DeleteMigratingVmRequest.php +++ b/VmMigration/src/V1/DeleteMigratingVmRequest.php @@ -20,7 +20,7 @@ class DeleteMigratingVmRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the MigratingVm. Please see diff --git a/VmMigration/src/V1/DeleteSourceRequest.php b/VmMigration/src/V1/DeleteSourceRequest.php index c4f438fd2d7d..73363cfd5bc7 100644 --- a/VmMigration/src/V1/DeleteSourceRequest.php +++ b/VmMigration/src/V1/DeleteSourceRequest.php @@ -20,7 +20,7 @@ class DeleteSourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -36,7 +36,7 @@ class DeleteSourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The Source name. Please see diff --git a/VmMigration/src/V1/DeleteTargetProjectRequest.php b/VmMigration/src/V1/DeleteTargetProjectRequest.php index 00c148d89868..d1c390849152 100644 --- a/VmMigration/src/V1/DeleteTargetProjectRequest.php +++ b/VmMigration/src/V1/DeleteTargetProjectRequest.php @@ -20,7 +20,7 @@ class DeleteTargetProjectRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -36,7 +36,7 @@ class DeleteTargetProjectRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The TargetProject name. Please see diff --git a/VmMigration/src/V1/DeleteUtilizationReportRequest.php b/VmMigration/src/V1/DeleteUtilizationReportRequest.php index ec9ca7c1def7..8341c1a7702f 100644 --- a/VmMigration/src/V1/DeleteUtilizationReportRequest.php +++ b/VmMigration/src/V1/DeleteUtilizationReportRequest.php @@ -20,7 +20,7 @@ class DeleteUtilizationReportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -36,7 +36,7 @@ class DeleteUtilizationReportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The Utilization Report name. Please see diff --git a/VmMigration/src/V1/FetchInventoryRequest.php b/VmMigration/src/V1/FetchInventoryRequest.php index c2ae20898169..3ccec18360e1 100644 --- a/VmMigration/src/V1/FetchInventoryRequest.php +++ b/VmMigration/src/V1/FetchInventoryRequest.php @@ -21,14 +21,14 @@ class FetchInventoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $source = ''; + protected $source = ''; /** * If this flag is set to true, the source will be queried instead of using * cached results. Using this flag will make the call slower. * * Generated from protobuf field bool force_refresh = 2; */ - private $force_refresh = false; + protected $force_refresh = false; /** * @param string $source Required. The name of the Source. Please see diff --git a/VmMigration/src/V1/FetchInventoryResponse.php b/VmMigration/src/V1/FetchInventoryResponse.php index a826e2e90a36..ce1bdac4c8c1 100644 --- a/VmMigration/src/V1/FetchInventoryResponse.php +++ b/VmMigration/src/V1/FetchInventoryResponse.php @@ -22,7 +22,7 @@ class FetchInventoryResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; protected $SourceVms; /** diff --git a/VmMigration/src/V1/FinalizeMigrationRequest.php b/VmMigration/src/V1/FinalizeMigrationRequest.php index 8e13177e319e..d71b82ccb9b5 100644 --- a/VmMigration/src/V1/FinalizeMigrationRequest.php +++ b/VmMigration/src/V1/FinalizeMigrationRequest.php @@ -20,7 +20,7 @@ class FinalizeMigrationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string migrating_vm = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $migrating_vm = ''; + protected $migrating_vm = ''; /** * @param string $migratingVm Required. The name of the MigratingVm. Please see diff --git a/VmMigration/src/V1/Gapic/VmMigrationGapicClient.php b/VmMigration/src/V1/Gapic/VmMigrationGapicClient.php deleted file mode 100644 index 50aae90d5e53..000000000000 --- a/VmMigration/src/V1/Gapic/VmMigrationGapicClient.php +++ /dev/null @@ -1,4656 +0,0 @@ -groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - * $operationResponse = $vmMigrationClient->addGroupMigration($formattedGroup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->addGroupMigration($formattedGroup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'addGroupMigration'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\VMMigration\V1\Client\VmMigrationClient}. - */ -class VmMigrationGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.vmmigration.v1.VmMigration'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'vmmigration.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'vmmigration.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $cloneJobNameTemplate; - - private static $cutoverJobNameTemplate; - - private static $datacenterConnectorNameTemplate; - - private static $groupNameTemplate; - - private static $locationNameTemplate; - - private static $migratingVmNameTemplate; - - private static $replicationCycleNameTemplate; - - private static $sourceNameTemplate; - - private static $targetProjectNameTemplate; - - private static $utilizationReportNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/vm_migration_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/vm_migration_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/vm_migration_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/vm_migration_rest_client_config.php', - ], - ], - ]; - } - - private static function getCloneJobNameTemplate() - { - if (self::$cloneJobNameTemplate == null) { - self::$cloneJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}' - ); - } - - return self::$cloneJobNameTemplate; - } - - private static function getCutoverJobNameTemplate() - { - if (self::$cutoverJobNameTemplate == null) { - self::$cutoverJobNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}' - ); - } - - return self::$cutoverJobNameTemplate; - } - - private static function getDatacenterConnectorNameTemplate() - { - if (self::$datacenterConnectorNameTemplate == null) { - self::$datacenterConnectorNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}' - ); - } - - return self::$datacenterConnectorNameTemplate; - } - - private static function getGroupNameTemplate() - { - if (self::$groupNameTemplate == null) { - self::$groupNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/groups/{group}' - ); - } - - return self::$groupNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getMigratingVmNameTemplate() - { - if (self::$migratingVmNameTemplate == null) { - self::$migratingVmNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}' - ); - } - - return self::$migratingVmNameTemplate; - } - - private static function getReplicationCycleNameTemplate() - { - if (self::$replicationCycleNameTemplate == null) { - self::$replicationCycleNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle}' - ); - } - - return self::$replicationCycleNameTemplate; - } - - private static function getSourceNameTemplate() - { - if (self::$sourceNameTemplate == null) { - self::$sourceNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/sources/{source}' - ); - } - - return self::$sourceNameTemplate; - } - - private static function getTargetProjectNameTemplate() - { - if (self::$targetProjectNameTemplate == null) { - self::$targetProjectNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/targetProjects/{target_project}' - ); - } - - return self::$targetProjectNameTemplate; - } - - private static function getUtilizationReportNameTemplate() - { - if (self::$utilizationReportNameTemplate == null) { - self::$utilizationReportNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}' - ); - } - - return self::$utilizationReportNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'cloneJob' => self::getCloneJobNameTemplate(), - 'cutoverJob' => self::getCutoverJobNameTemplate(), - 'datacenterConnector' => self::getDatacenterConnectorNameTemplate(), - 'group' => self::getGroupNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'migratingVm' => self::getMigratingVmNameTemplate(), - 'replicationCycle' => self::getReplicationCycleNameTemplate(), - 'source' => self::getSourceNameTemplate(), - 'targetProject' => self::getTargetProjectNameTemplate(), - 'utilizationReport' => self::getUtilizationReportNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a clone_job - * resource. - * - * @param string $project - * @param string $location - * @param string $source - * @param string $migratingVm - * @param string $cloneJob - * - * @return string The formatted clone_job resource. - */ - public static function cloneJobName( - $project, - $location, - $source, - $migratingVm, - $cloneJob - ) { - return self::getCloneJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'source' => $source, - 'migrating_vm' => $migratingVm, - 'clone_job' => $cloneJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cutover_job - * resource. - * - * @param string $project - * @param string $location - * @param string $source - * @param string $migratingVm - * @param string $cutoverJob - * - * @return string The formatted cutover_job resource. - */ - public static function cutoverJobName( - $project, - $location, - $source, - $migratingVm, - $cutoverJob - ) { - return self::getCutoverJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'source' => $source, - 'migrating_vm' => $migratingVm, - 'cutover_job' => $cutoverJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * datacenter_connector resource. - * - * @param string $project - * @param string $location - * @param string $source - * @param string $datacenterConnector - * - * @return string The formatted datacenter_connector resource. - */ - public static function datacenterConnectorName( - $project, - $location, - $source, - $datacenterConnector - ) { - return self::getDatacenterConnectorNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'source' => $source, - 'datacenter_connector' => $datacenterConnector, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a group - * resource. - * - * @param string $project - * @param string $location - * @param string $group - * - * @return string The formatted group resource. - */ - public static function groupName($project, $location, $group) - { - return self::getGroupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'group' => $group, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a migrating_vm - * resource. - * - * @param string $project - * @param string $location - * @param string $source - * @param string $migratingVm - * - * @return string The formatted migrating_vm resource. - */ - public static function migratingVmName( - $project, - $location, - $source, - $migratingVm - ) { - return self::getMigratingVmNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'source' => $source, - 'migrating_vm' => $migratingVm, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * replication_cycle resource. - * - * @param string $project - * @param string $location - * @param string $source - * @param string $migratingVm - * @param string $replicationCycle - * - * @return string The formatted replication_cycle resource. - */ - public static function replicationCycleName( - $project, - $location, - $source, - $migratingVm, - $replicationCycle - ) { - return self::getReplicationCycleNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'source' => $source, - 'migrating_vm' => $migratingVm, - 'replication_cycle' => $replicationCycle, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a source - * resource. - * - * @param string $project - * @param string $location - * @param string $source - * - * @return string The formatted source resource. - */ - public static function sourceName($project, $location, $source) - { - return self::getSourceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'source' => $source, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * target_project resource. - * - * @param string $project - * @param string $location - * @param string $targetProject - * - * @return string The formatted target_project resource. - */ - public static function targetProjectName( - $project, - $location, - $targetProject - ) { - return self::getTargetProjectNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'target_project' => $targetProject, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * utilization_report resource. - * - * @param string $project - * @param string $location - * @param string $source - * @param string $utilizationReport - * - * @return string The formatted utilization_report resource. - */ - public static function utilizationReportName( - $project, - $location, - $source, - $utilizationReport - ) { - return self::getUtilizationReportNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'source' => $source, - 'utilization_report' => $utilizationReport, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - cloneJob: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job} - * - cutoverJob: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job} - * - datacenterConnector: projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector} - * - group: projects/{project}/locations/{location}/groups/{group} - * - location: projects/{project}/locations/{location} - * - migratingVm: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm} - * - replicationCycle: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle} - * - source: projects/{project}/locations/{location}/sources/{source} - * - targetProject: projects/{project}/locations/{location}/targetProjects/{target_project} - * - utilizationReport: projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; - $operation = new OperationResponse( - $operationName, - $this->getOperationsClient(), - $options - ); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'vmmigration.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Adds a MigratingVm to a Group. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedGroup = $vmMigrationClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - * $operationResponse = $vmMigrationClient->addGroupMigration($formattedGroup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->addGroupMigration($formattedGroup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'addGroupMigration'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $group Required. The full path name of the Group to add to. - * @param array $optionalArgs { - * Optional. - * - * @type string $migratingVm - * The full path name of the MigratingVm to add. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function addGroupMigration($group, array $optionalArgs = []) - { - $request = new AddGroupMigrationRequest(); - $requestParamHeaders = []; - $request->setGroup($group); - $requestParamHeaders['group'] = $group; - if (isset($optionalArgs['migratingVm'])) { - $request->setMigratingVm($optionalArgs['migratingVm']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'AddGroupMigration', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Initiates the cancellation of a running clone job. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - * $operationResponse = $vmMigrationClient->cancelCloneJob($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->cancelCloneJob($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'cancelCloneJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The clone job id - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function cancelCloneJob($name, array $optionalArgs = []) - { - $request = new CancelCloneJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CancelCloneJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Initiates the cancellation of a running cutover job. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - * $operationResponse = $vmMigrationClient->cancelCutoverJob($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->cancelCutoverJob($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'cancelCutoverJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The cutover job id - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function cancelCutoverJob($name, array $optionalArgs = []) - { - $request = new CancelCutoverJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CancelCutoverJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Initiates a Clone of a specific migrating VM. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $cloneJobId = 'clone_job_id'; - * $cloneJob = new CloneJob(); - * $operationResponse = $vmMigrationClient->createCloneJob($formattedParent, $cloneJobId, $cloneJob); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->createCloneJob($formattedParent, $cloneJobId, $cloneJob); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'createCloneJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The Clone's parent. - * @param string $cloneJobId Required. The clone job identifier. - * @param CloneJob $cloneJob Required. The clone request body. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createCloneJob( - $parent, - $cloneJobId, - $cloneJob, - array $optionalArgs = [] - ) { - $request = new CreateCloneJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCloneJobId($cloneJobId); - $request->setCloneJob($cloneJob); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateCloneJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Initiates a Cutover of a specific migrating VM. - * The returned LRO is completed when the cutover job resource is created - * and the job is initiated. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $cutoverJobId = 'cutover_job_id'; - * $cutoverJob = new CutoverJob(); - * $operationResponse = $vmMigrationClient->createCutoverJob($formattedParent, $cutoverJobId, $cutoverJob); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->createCutoverJob($formattedParent, $cutoverJobId, $cutoverJob); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'createCutoverJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The Cutover's parent. - * @param string $cutoverJobId Required. The cutover job identifier. - * @param CutoverJob $cutoverJob Required. The cutover request body. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createCutoverJob( - $parent, - $cutoverJobId, - $cutoverJob, - array $optionalArgs = [] - ) { - $request = new CreateCutoverJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCutoverJobId($cutoverJobId); - $request->setCutoverJob($cutoverJob); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateCutoverJob', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new DatacenterConnector in a given Source. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - * $datacenterConnectorId = 'datacenter_connector_id'; - * $datacenterConnector = new DatacenterConnector(); - * $operationResponse = $vmMigrationClient->createDatacenterConnector($formattedParent, $datacenterConnectorId, $datacenterConnector); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->createDatacenterConnector($formattedParent, $datacenterConnectorId, $datacenterConnector); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'createDatacenterConnector'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The DatacenterConnector's parent. - * Required. The Source in where the new DatacenterConnector will be created. - * For example: - * `projects/my-project/locations/us-central1/sources/my-source` - * @param string $datacenterConnectorId Required. The datacenterConnector identifier. - * @param DatacenterConnector $datacenterConnector Required. The create request body. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDatacenterConnector( - $parent, - $datacenterConnectorId, - $datacenterConnector, - array $optionalArgs = [] - ) { - $request = new CreateDatacenterConnectorRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDatacenterConnectorId($datacenterConnectorId); - $request->setDatacenterConnector($datacenterConnector); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateDatacenterConnector', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new Group in a given project and location. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->locationName('[PROJECT]', '[LOCATION]'); - * $groupId = 'group_id'; - * $group = new Group(); - * $operationResponse = $vmMigrationClient->createGroup($formattedParent, $groupId, $group); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->createGroup($formattedParent, $groupId, $group); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'createGroup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The Group's parent. - * @param string $groupId Required. The group identifier. - * @param Group $group Required. The create request body. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createGroup( - $parent, - $groupId, - $group, - array $optionalArgs = [] - ) { - $request = new CreateGroupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setGroupId($groupId); - $request->setGroup($group); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateGroup', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new MigratingVm in a given Source. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - * $migratingVmId = 'migrating_vm_id'; - * $migratingVm = new MigratingVm(); - * $operationResponse = $vmMigrationClient->createMigratingVm($formattedParent, $migratingVmId, $migratingVm); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->createMigratingVm($formattedParent, $migratingVmId, $migratingVm); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'createMigratingVm'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The MigratingVm's parent. - * @param string $migratingVmId Required. The migratingVm identifier. - * @param MigratingVm $migratingVm Required. The create request body. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createMigratingVm( - $parent, - $migratingVmId, - $migratingVm, - array $optionalArgs = [] - ) { - $request = new CreateMigratingVmRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMigratingVmId($migratingVmId); - $request->setMigratingVm($migratingVm); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateMigratingVm', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new Source in a given project and location. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->locationName('[PROJECT]', '[LOCATION]'); - * $sourceId = 'source_id'; - * $source = new Source(); - * $operationResponse = $vmMigrationClient->createSource($formattedParent, $sourceId, $source); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->createSource($formattedParent, $sourceId, $source); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'createSource'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The Source's parent. - * @param string $sourceId Required. The source identifier. - * @param Source $source Required. The create request body. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createSource( - $parent, - $sourceId, - $source, - array $optionalArgs = [] - ) { - $request = new CreateSourceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setSourceId($sourceId); - $request->setSource($source); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateSource', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new TargetProject in a given project. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->locationName('[PROJECT]', '[LOCATION]'); - * $targetProjectId = 'target_project_id'; - * $targetProject = new TargetProject(); - * $operationResponse = $vmMigrationClient->createTargetProject($formattedParent, $targetProjectId, $targetProject); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->createTargetProject($formattedParent, $targetProjectId, $targetProject); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'createTargetProject'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The TargetProject's parent. - * @param string $targetProjectId Required. The target_project identifier. - * @param TargetProject $targetProject Required. The create request body. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTargetProject( - $parent, - $targetProjectId, - $targetProject, - array $optionalArgs = [] - ) { - $request = new CreateTargetProjectRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTargetProjectId($targetProjectId); - $request->setTargetProject($targetProject); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateTargetProject', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Creates a new UtilizationReport. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - * $utilizationReport = new UtilizationReport(); - * $utilizationReportId = 'utilization_report_id'; - * $operationResponse = $vmMigrationClient->createUtilizationReport($formattedParent, $utilizationReport, $utilizationReportId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->createUtilizationReport($formattedParent, $utilizationReport, $utilizationReportId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'createUtilizationReport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The Utilization Report's parent. - * @param UtilizationReport $utilizationReport Required. The report to create. - * @param string $utilizationReportId Required. The ID to use for the report, which will become the final - * component of the reports's resource name. - * - * This value maximum length is 63 characters, and valid characters - * are /[a-z][0-9]-/. It must start with an english letter and must not - * end with a hyphen. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createUtilizationReport( - $parent, - $utilizationReport, - $utilizationReportId, - array $optionalArgs = [] - ) { - $request = new CreateUtilizationReportRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setUtilizationReport($utilizationReport); - $request->setUtilizationReportId($utilizationReportId); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'CreateUtilizationReport', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single DatacenterConnector. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - * $operationResponse = $vmMigrationClient->deleteDatacenterConnector($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->deleteDatacenterConnector($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'deleteDatacenterConnector'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The DatacenterConnector name. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDatacenterConnector($name, array $optionalArgs = []) - { - $request = new DeleteDatacenterConnectorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteDatacenterConnector', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Group. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - * $operationResponse = $vmMigrationClient->deleteGroup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->deleteGroup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'deleteGroup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The Group name. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteGroup($name, array $optionalArgs = []) - { - $request = new DeleteGroupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteGroup', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single MigratingVm. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $operationResponse = $vmMigrationClient->deleteMigratingVm($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->deleteMigratingVm($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'deleteMigratingVm'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the MigratingVm. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteMigratingVm($name, array $optionalArgs = []) - { - $request = new DeleteMigratingVmRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteMigratingVm', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Source. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - * $operationResponse = $vmMigrationClient->deleteSource($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->deleteSource($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'deleteSource'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The Source name. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteSource($name, array $optionalArgs = []) - { - $request = new DeleteSourceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteSource', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single TargetProject. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - * $operationResponse = $vmMigrationClient->deleteTargetProject($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->deleteTargetProject($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'deleteTargetProject'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The TargetProject name. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTargetProject($name, array $optionalArgs = []) - { - $request = new DeleteTargetProjectRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteTargetProject', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Deletes a single Utilization Report. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - * $operationResponse = $vmMigrationClient->deleteUtilizationReport($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->deleteUtilizationReport($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'deleteUtilizationReport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The Utilization Report name. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteUtilizationReport($name, array $optionalArgs = []) - { - $request = new DeleteUtilizationReportRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'DeleteUtilizationReport', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * List remote source's inventory of VMs. - * The remote source is the onprem vCenter (remote in the sense it's not in - * Compute Engine). The inventory describes the list of existing VMs in that - * source. Note that this operation lists the VMs on the remote source, as - * opposed to listing the MigratingVms resources in the vmmigration service. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedSource = $vmMigrationClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - * $response = $vmMigrationClient->fetchInventory($formattedSource); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $source Required. The name of the Source. - * @param array $optionalArgs { - * Optional. - * - * @type bool $forceRefresh - * If this flag is set to true, the source will be queried instead of using - * cached results. Using this flag will make the call slower. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\FetchInventoryResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchInventory($source, array $optionalArgs = []) - { - $request = new FetchInventoryRequest(); - $requestParamHeaders = []; - $request->setSource($source); - $requestParamHeaders['source'] = $source; - if (isset($optionalArgs['forceRefresh'])) { - $request->setForceRefresh($optionalArgs['forceRefresh']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'FetchInventory', - FetchInventoryResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Marks a migration as completed, deleting migration resources that are no - * longer being used. Only applicable after cutover is done. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedMigratingVm = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $operationResponse = $vmMigrationClient->finalizeMigration($formattedMigratingVm); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->finalizeMigration($formattedMigratingVm); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'finalizeMigration'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $migratingVm Required. The name of the MigratingVm. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function finalizeMigration($migratingVm, array $optionalArgs = []) - { - $request = new FinalizeMigrationRequest(); - $requestParamHeaders = []; - $request->setMigratingVm($migratingVm); - $requestParamHeaders['migrating_vm'] = $migratingVm; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'FinalizeMigration', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets details of a single CloneJob. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - * $response = $vmMigrationClient->getCloneJob($formattedName); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the CloneJob. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\CloneJob - * - * @throws ApiException if the remote call fails - */ - public function getCloneJob($name, array $optionalArgs = []) - { - $request = new GetCloneJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetCloneJob', - CloneJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single CutoverJob. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - * $response = $vmMigrationClient->getCutoverJob($formattedName); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the CutoverJob. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\CutoverJob - * - * @throws ApiException if the remote call fails - */ - public function getCutoverJob($name, array $optionalArgs = []) - { - $request = new GetCutoverJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetCutoverJob', - CutoverJob::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single DatacenterConnector. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - * $response = $vmMigrationClient->getDatacenterConnector($formattedName); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the DatacenterConnector. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\DatacenterConnector - * - * @throws ApiException if the remote call fails - */ - public function getDatacenterConnector($name, array $optionalArgs = []) - { - $request = new GetDatacenterConnectorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetDatacenterConnector', - DatacenterConnector::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single Group. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - * $response = $vmMigrationClient->getGroup($formattedName); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The group name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\Group - * - * @throws ApiException if the remote call fails - */ - public function getGroup($name, array $optionalArgs = []) - { - $request = new GetGroupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetGroup', - Group::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single MigratingVm. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $response = $vmMigrationClient->getMigratingVm($formattedName); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the MigratingVm. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. The level of details of the migrating VM. - * For allowed values, use constants defined on {@see \Google\Cloud\VMMigration\V1\MigratingVmView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\MigratingVm - * - * @throws ApiException if the remote call fails - */ - public function getMigratingVm($name, array $optionalArgs = []) - { - $request = new GetMigratingVmRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetMigratingVm', - MigratingVm::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single ReplicationCycle. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->replicationCycleName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[REPLICATION_CYCLE]'); - * $response = $vmMigrationClient->getReplicationCycle($formattedName); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the ReplicationCycle. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\ReplicationCycle - * - * @throws ApiException if the remote call fails - */ - public function getReplicationCycle($name, array $optionalArgs = []) - { - $request = new GetReplicationCycleRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetReplicationCycle', - ReplicationCycle::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single Source. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - * $response = $vmMigrationClient->getSource($formattedName); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The Source name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\Source - * - * @throws ApiException if the remote call fails - */ - public function getSource($name, array $optionalArgs = []) - { - $request = new GetSourceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetSource', - Source::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets details of a single TargetProject. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - * $response = $vmMigrationClient->getTargetProject($formattedName); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The TargetProject name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\TargetProject - * - * @throws ApiException if the remote call fails - */ - public function getTargetProject($name, array $optionalArgs = []) - { - $request = new GetTargetProjectRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTargetProject', - TargetProject::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets a single Utilization Report. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedName = $vmMigrationClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - * $response = $vmMigrationClient->getUtilizationReport($formattedName); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $name Required. The Utilization Report name. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. The level of details of the report. - * Defaults to FULL - * For allowed values, use constants defined on {@see \Google\Cloud\VMMigration\V1\UtilizationReportView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\VMMigration\V1\UtilizationReport - * - * @throws ApiException if the remote call fails - */ - public function getUtilizationReport($name, array $optionalArgs = []) - { - $request = new GetUtilizationReportRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetUtilizationReport', - UtilizationReport::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists CloneJobs of a given migrating VM. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $pageToken = 'page_token'; - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listCloneJobs($formattedParent, $pageToken); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listCloneJobs($formattedParent, $pageToken); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of source VMs. - * @param string $pageToken A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $filter - * Optional. The filter request. - * @type string $orderBy - * Optional. the order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listCloneJobs($parent, $pageToken, array $optionalArgs = []) - { - $request = new ListCloneJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageToken($pageToken); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListCloneJobs', - $optionalArgs, - ListCloneJobsResponse::class, - $request - ); - } - - /** - * Lists CutoverJobs of a given migrating VM. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $pageToken = 'page_token'; - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listCutoverJobs($formattedParent, $pageToken); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listCutoverJobs($formattedParent, $pageToken); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of migrating VMs. - * @param string $pageToken A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $filter - * Optional. The filter request. - * @type string $orderBy - * Optional. the order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listCutoverJobs( - $parent, - $pageToken, - array $optionalArgs = [] - ) { - $request = new ListCutoverJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageToken($pageToken); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListCutoverJobs', - $optionalArgs, - ListCutoverJobsResponse::class, - $request - ); - } - - /** - * Lists DatacenterConnectors in a given Source. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - * $pageToken = 'page_token'; - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listDatacenterConnectors($formattedParent, $pageToken); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listDatacenterConnectors($formattedParent, $pageToken); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of connectors. - * @param string $pageToken A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $filter - * Optional. The filter request. - * @type string $orderBy - * Optional. the order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDatacenterConnectors( - $parent, - $pageToken, - array $optionalArgs = [] - ) { - $request = new ListDatacenterConnectorsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageToken($pageToken); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListDatacenterConnectors', - $optionalArgs, - ListDatacenterConnectorsResponse::class, - $request - ); - } - - /** - * Lists Groups in a given project and location. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->locationName('[PROJECT]', '[LOCATION]'); - * $pageToken = 'page_token'; - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listGroups($formattedParent, $pageToken); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listGroups($formattedParent, $pageToken); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of groups. - * @param string $pageToken A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $filter - * Optional. The filter request. - * @type string $orderBy - * Optional. the order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listGroups($parent, $pageToken, array $optionalArgs = []) - { - $request = new ListGroupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageToken($pageToken); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListGroups', - $optionalArgs, - ListGroupsResponse::class, - $request - ); - } - - /** - * Lists MigratingVms in a given Source. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - * $pageToken = 'page_token'; - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listMigratingVms($formattedParent, $pageToken); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listMigratingVms($formattedParent, $pageToken); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of MigratingVms. - * @param string $pageToken A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $filter - * Optional. The filter request. - * @type string $orderBy - * Optional. the order by fields for the result. - * @type int $view - * Optional. The level of details of each migrating VM. - * For allowed values, use constants defined on {@see \Google\Cloud\VMMigration\V1\MigratingVmView} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listMigratingVms( - $parent, - $pageToken, - array $optionalArgs = [] - ) { - $request = new ListMigratingVmsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageToken($pageToken); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListMigratingVms', - $optionalArgs, - ListMigratingVmsResponse::class, - $request - ); - } - - /** - * Lists ReplicationCycles in a given MigratingVM. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $pageToken = 'page_token'; - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listReplicationCycles($formattedParent, $pageToken); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listReplicationCycles($formattedParent, $pageToken); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of ReplicationCycles. - * @param string $pageToken A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $filter - * Optional. The filter request. - * @type string $orderBy - * Optional. the order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listReplicationCycles( - $parent, - $pageToken, - array $optionalArgs = [] - ) { - $request = new ListReplicationCyclesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageToken($pageToken); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListReplicationCycles', - $optionalArgs, - ListReplicationCyclesResponse::class, - $request - ); - } - - /** - * Lists Sources in a given project and location. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->locationName('[PROJECT]', '[LOCATION]'); - * $pageToken = 'page_token'; - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listSources($formattedParent, $pageToken); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listSources($formattedParent, $pageToken); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of sources. - * @param string $pageToken A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $filter - * Optional. The filter request. - * @type string $orderBy - * Optional. the order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSources($parent, $pageToken, array $optionalArgs = []) - { - $request = new ListSourcesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageToken($pageToken); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListSources', - $optionalArgs, - ListSourcesResponse::class, - $request - ); - } - - /** - * Lists TargetProjects in a given project. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->locationName('[PROJECT]', '[LOCATION]'); - * $pageToken = 'page_token'; - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listTargetProjects($formattedParent, $pageToken); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listTargetProjects($formattedParent, $pageToken); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of targets. - * @param string $pageToken A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $filter - * Optional. The filter request. - * @type string $orderBy - * Optional. the order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTargetProjects( - $parent, - $pageToken, - array $optionalArgs = [] - ) { - $request = new ListTargetProjectsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageToken($pageToken); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListTargetProjects', - $optionalArgs, - ListTargetProjectsResponse::class, - $request - ); - } - - /** - * Lists Utilization Reports of the given Source. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedParent = $vmMigrationClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - * $pageToken = 'page_token'; - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listUtilizationReports($formattedParent, $pageToken); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listUtilizationReports($formattedParent, $pageToken); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $parent Required. The Utilization Reports parent. - * @param string $pageToken A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. The level of details of each report. - * Defaults to BASIC. - * For allowed values, use constants defined on {@see \Google\Cloud\VMMigration\V1\UtilizationReportView} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $filter - * Optional. The filter request. - * @type string $orderBy - * Optional. the order by fields for the result. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listUtilizationReports( - $parent, - $pageToken, - array $optionalArgs = [] - ) { - $request = new ListUtilizationReportsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageToken($pageToken); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListUtilizationReports', - $optionalArgs, - ListUtilizationReportsResponse::class, - $request - ); - } - - /** - * Pauses a migration for a VM. If cycle tasks are running they will be - * cancelled, preserving source task data. Further replication cycles will not - * be triggered while the VM is paused. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedMigratingVm = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $operationResponse = $vmMigrationClient->pauseMigration($formattedMigratingVm); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->pauseMigration($formattedMigratingVm); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'pauseMigration'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $migratingVm Required. The name of the MigratingVm. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function pauseMigration($migratingVm, array $optionalArgs = []) - { - $request = new PauseMigrationRequest(); - $requestParamHeaders = []; - $request->setMigratingVm($migratingVm); - $requestParamHeaders['migrating_vm'] = $migratingVm; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'PauseMigration', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Removes a MigratingVm from a Group. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedGroup = $vmMigrationClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - * $operationResponse = $vmMigrationClient->removeGroupMigration($formattedGroup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->removeGroupMigration($formattedGroup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'removeGroupMigration'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $group Required. The name of the Group. - * @param array $optionalArgs { - * Optional. - * - * @type string $migratingVm - * The MigratingVm to remove. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function removeGroupMigration($group, array $optionalArgs = []) - { - $request = new RemoveGroupMigrationRequest(); - $requestParamHeaders = []; - $request->setGroup($group); - $requestParamHeaders['group'] = $group; - if (isset($optionalArgs['migratingVm'])) { - $request->setMigratingVm($optionalArgs['migratingVm']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'RemoveGroupMigration', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Resumes a migration for a VM. When called on a paused migration, will start - * the process of uploading data and creating snapshots; when called on a - * completed cut-over migration, will update the migration to active state and - * start the process of uploading data and creating snapshots. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedMigratingVm = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $operationResponse = $vmMigrationClient->resumeMigration($formattedMigratingVm); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->resumeMigration($formattedMigratingVm); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'resumeMigration'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $migratingVm Required. The name of the MigratingVm. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function resumeMigration($migratingVm, array $optionalArgs = []) - { - $request = new ResumeMigrationRequest(); - $requestParamHeaders = []; - $request->setMigratingVm($migratingVm); - $requestParamHeaders['migrating_vm'] = $migratingVm; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'ResumeMigration', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Starts migration for a VM. Starts the process of uploading - * data and creating snapshots, in replication cycles scheduled by the policy. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedMigratingVm = $vmMigrationClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - * $operationResponse = $vmMigrationClient->startMigration($formattedMigratingVm); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->startMigration($formattedMigratingVm); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'startMigration'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $migratingVm Required. The name of the MigratingVm. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function startMigration($migratingVm, array $optionalArgs = []) - { - $request = new StartMigrationRequest(); - $requestParamHeaders = []; - $request->setMigratingVm($migratingVm); - $requestParamHeaders['migrating_vm'] = $migratingVm; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'StartMigration', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates the parameters of a single Group. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $group = new Group(); - * $operationResponse = $vmMigrationClient->updateGroup($group); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->updateGroup($group); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'updateGroup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param Group $group Required. The update request body. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * Group resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateGroup($group, array $optionalArgs = []) - { - $request = new UpdateGroupRequest(); - $requestParamHeaders = []; - $request->setGroup($group); - $requestParamHeaders['group.name'] = $group->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateGroup', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates the parameters of a single MigratingVm. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $migratingVm = new MigratingVm(); - * $operationResponse = $vmMigrationClient->updateMigratingVm($migratingVm); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->updateMigratingVm($migratingVm); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'updateMigratingVm'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param MigratingVm $migratingVm Required. The update request body. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * MigratingVm resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateMigratingVm($migratingVm, array $optionalArgs = []) - { - $request = new UpdateMigratingVmRequest(); - $requestParamHeaders = []; - $request->setMigratingVm($migratingVm); - $requestParamHeaders['migrating_vm.name'] = $migratingVm->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateMigratingVm', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates the parameters of a single Source. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $source = new Source(); - * $operationResponse = $vmMigrationClient->updateSource($source); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->updateSource($source); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'updateSource'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param Source $source Required. The update request body. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * Source resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateSource($source, array $optionalArgs = []) - { - $request = new UpdateSourceRequest(); - $requestParamHeaders = []; - $request->setSource($source); - $requestParamHeaders['source.name'] = $source->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateSource', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Updates the parameters of a single TargetProject. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $targetProject = new TargetProject(); - * $operationResponse = $vmMigrationClient->updateTargetProject($targetProject); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->updateTargetProject($targetProject); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'updateTargetProject'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param TargetProject $targetProject Required. The update request body. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Field mask is used to specify the fields to be overwritten in the - * TargetProject resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateTargetProject( - $targetProject, - array $optionalArgs = [] - ) { - $request = new UpdateTargetProjectRequest(); - $requestParamHeaders = []; - $request->setTargetProject($targetProject); - $requestParamHeaders['target_project.name'] = $targetProject->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpdateTargetProject', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Upgrades the appliance relate to this DatacenterConnector to the in-place - * updateable version. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $formattedDatacenterConnector = $vmMigrationClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - * $operationResponse = $vmMigrationClient->upgradeAppliance($formattedDatacenterConnector); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $vmMigrationClient->upgradeAppliance($formattedDatacenterConnector); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'upgradeAppliance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param string $datacenterConnector Required. The DatacenterConnector name. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function upgradeAppliance( - $datacenterConnector, - array $optionalArgs = [] - ) { - $request = new UpgradeApplianceRequest(); - $requestParamHeaders = []; - $request->setDatacenterConnector($datacenterConnector); - $requestParamHeaders['datacenter_connector'] = $datacenterConnector; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startOperationsCall( - 'UpgradeAppliance', - $optionalArgs, - $request, - $this->getOperationsClient() - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * $response = $vmMigrationClient->getLocation(); - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $vmMigrationClient = new VmMigrationClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $vmMigrationClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $vmMigrationClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $vmMigrationClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } -} diff --git a/VmMigration/src/V1/GetCloneJobRequest.php b/VmMigration/src/V1/GetCloneJobRequest.php index 927068bd8e6a..48dce1bf1c80 100644 --- a/VmMigration/src/V1/GetCloneJobRequest.php +++ b/VmMigration/src/V1/GetCloneJobRequest.php @@ -20,7 +20,7 @@ class GetCloneJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the CloneJob. Please see diff --git a/VmMigration/src/V1/GetCutoverJobRequest.php b/VmMigration/src/V1/GetCutoverJobRequest.php index b764f18396b0..9d30019287a5 100644 --- a/VmMigration/src/V1/GetCutoverJobRequest.php +++ b/VmMigration/src/V1/GetCutoverJobRequest.php @@ -20,7 +20,7 @@ class GetCutoverJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the CutoverJob. Please see diff --git a/VmMigration/src/V1/GetDatacenterConnectorRequest.php b/VmMigration/src/V1/GetDatacenterConnectorRequest.php index 1ade9a21dfea..7aa5823e702a 100644 --- a/VmMigration/src/V1/GetDatacenterConnectorRequest.php +++ b/VmMigration/src/V1/GetDatacenterConnectorRequest.php @@ -20,7 +20,7 @@ class GetDatacenterConnectorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the DatacenterConnector. Please see diff --git a/VmMigration/src/V1/GetGroupRequest.php b/VmMigration/src/V1/GetGroupRequest.php index ed1bbcf3f4be..fbf5c771c2d6 100644 --- a/VmMigration/src/V1/GetGroupRequest.php +++ b/VmMigration/src/V1/GetGroupRequest.php @@ -20,7 +20,7 @@ class GetGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The group name. Please see diff --git a/VmMigration/src/V1/GetMigratingVmRequest.php b/VmMigration/src/V1/GetMigratingVmRequest.php index 3095d7fd2686..3e59f540c798 100644 --- a/VmMigration/src/V1/GetMigratingVmRequest.php +++ b/VmMigration/src/V1/GetMigratingVmRequest.php @@ -20,13 +20,13 @@ class GetMigratingVmRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The level of details of the migrating VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.MigratingVmView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $name Required. The name of the MigratingVm. Please see diff --git a/VmMigration/src/V1/GetReplicationCycleRequest.php b/VmMigration/src/V1/GetReplicationCycleRequest.php index 5178bd2d71a0..c86a34b32a7b 100644 --- a/VmMigration/src/V1/GetReplicationCycleRequest.php +++ b/VmMigration/src/V1/GetReplicationCycleRequest.php @@ -20,7 +20,7 @@ class GetReplicationCycleRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the ReplicationCycle. Please see diff --git a/VmMigration/src/V1/GetSourceRequest.php b/VmMigration/src/V1/GetSourceRequest.php index f5535afc1488..28346a94ac29 100644 --- a/VmMigration/src/V1/GetSourceRequest.php +++ b/VmMigration/src/V1/GetSourceRequest.php @@ -20,7 +20,7 @@ class GetSourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The Source name. Please see diff --git a/VmMigration/src/V1/GetTargetProjectRequest.php b/VmMigration/src/V1/GetTargetProjectRequest.php index 0c08359ae4ed..244edd28be21 100644 --- a/VmMigration/src/V1/GetTargetProjectRequest.php +++ b/VmMigration/src/V1/GetTargetProjectRequest.php @@ -20,7 +20,7 @@ class GetTargetProjectRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The TargetProject name. Please see diff --git a/VmMigration/src/V1/GetUtilizationReportRequest.php b/VmMigration/src/V1/GetUtilizationReportRequest.php index b821061e5d0a..eb7bac23ec7d 100644 --- a/VmMigration/src/V1/GetUtilizationReportRequest.php +++ b/VmMigration/src/V1/GetUtilizationReportRequest.php @@ -20,14 +20,14 @@ class GetUtilizationReportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The level of details of the report. * Defaults to FULL * * Generated from protobuf field .google.cloud.vmmigration.v1.UtilizationReportView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $name Required. The Utilization Report name. Please see diff --git a/VmMigration/src/V1/Group.php b/VmMigration/src/V1/Group.php index 293b238e2e39..ea661a9c1fef 100644 --- a/VmMigration/src/V1/Group.php +++ b/VmMigration/src/V1/Group.php @@ -21,31 +21,31 @@ class Group extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The create time timestamp. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The update time timestamp. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * User-provided description of the group. * * Generated from protobuf field string description = 4; */ - private $description = ''; + protected $description = ''; /** * Display name is a user defined name for this group which can be updated. * * Generated from protobuf field string display_name = 5; */ - private $display_name = ''; + protected $display_name = ''; /** * Constructor. diff --git a/VmMigration/src/V1/ListCloneJobsRequest.php b/VmMigration/src/V1/ListCloneJobsRequest.php index ebd6e1e24df9..3d8d4efa2f3e 100644 --- a/VmMigration/src/V1/ListCloneJobsRequest.php +++ b/VmMigration/src/V1/ListCloneJobsRequest.php @@ -20,7 +20,7 @@ class ListCloneJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of clone jobs to return. The service may * return fewer than this value. If unspecified, at most 500 clone jobs will @@ -29,7 +29,7 @@ class ListCloneJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Required. A page token, received from a previous `ListCloneJobs` call. * Provide this to retrieve the subsequent page. @@ -38,19 +38,19 @@ class ListCloneJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. the order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of source VMs. Please see diff --git a/VmMigration/src/V1/ListCloneJobsResponse.php b/VmMigration/src/V1/ListCloneJobsResponse.php index 60c9597103e0..5c89b1f50d7c 100644 --- a/VmMigration/src/V1/ListCloneJobsResponse.php +++ b/VmMigration/src/V1/ListCloneJobsResponse.php @@ -27,7 +27,7 @@ class ListCloneJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Output only. Locations that could not be reached. * diff --git a/VmMigration/src/V1/ListCutoverJobsRequest.php b/VmMigration/src/V1/ListCutoverJobsRequest.php index 42fc0a599092..07b28f2c7d31 100644 --- a/VmMigration/src/V1/ListCutoverJobsRequest.php +++ b/VmMigration/src/V1/ListCutoverJobsRequest.php @@ -20,7 +20,7 @@ class ListCutoverJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of cutover jobs to return. The service may * return fewer than this value. If unspecified, at most 500 cutover jobs will @@ -29,7 +29,7 @@ class ListCutoverJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Required. A page token, received from a previous `ListCutoverJobs` call. * Provide this to retrieve the subsequent page. @@ -38,19 +38,19 @@ class ListCutoverJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. the order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of migrating VMs. Please see diff --git a/VmMigration/src/V1/ListCutoverJobsResponse.php b/VmMigration/src/V1/ListCutoverJobsResponse.php index adb82522aa5b..0eb0adebbb36 100644 --- a/VmMigration/src/V1/ListCutoverJobsResponse.php +++ b/VmMigration/src/V1/ListCutoverJobsResponse.php @@ -27,7 +27,7 @@ class ListCutoverJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Output only. Locations that could not be reached. * diff --git a/VmMigration/src/V1/ListDatacenterConnectorsRequest.php b/VmMigration/src/V1/ListDatacenterConnectorsRequest.php index dc5d07f8ea40..ec0686fe621f 100644 --- a/VmMigration/src/V1/ListDatacenterConnectorsRequest.php +++ b/VmMigration/src/V1/ListDatacenterConnectorsRequest.php @@ -20,7 +20,7 @@ class ListDatacenterConnectorsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of connectors to return. The service may * return fewer than this value. If unspecified, at most 500 sources will be @@ -29,7 +29,7 @@ class ListDatacenterConnectorsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Required. A page token, received from a previous `ListDatacenterConnectors` * call. Provide this to retrieve the subsequent page. @@ -39,19 +39,19 @@ class ListDatacenterConnectorsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. the order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of connectors. Please see diff --git a/VmMigration/src/V1/ListDatacenterConnectorsResponse.php b/VmMigration/src/V1/ListDatacenterConnectorsResponse.php index b4fe60bfed81..8aa1c27e3113 100644 --- a/VmMigration/src/V1/ListDatacenterConnectorsResponse.php +++ b/VmMigration/src/V1/ListDatacenterConnectorsResponse.php @@ -27,7 +27,7 @@ class ListDatacenterConnectorsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Output only. Locations that could not be reached. * diff --git a/VmMigration/src/V1/ListGroupsRequest.php b/VmMigration/src/V1/ListGroupsRequest.php index d9c8e417cc19..11b8be3b9a9b 100644 --- a/VmMigration/src/V1/ListGroupsRequest.php +++ b/VmMigration/src/V1/ListGroupsRequest.php @@ -20,7 +20,7 @@ class ListGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of groups to return. The service may return * fewer than this value. If unspecified, at most 500 groups will be @@ -29,7 +29,7 @@ class ListGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Required. A page token, received from a previous `ListGroups` call. * Provide this to retrieve the subsequent page. @@ -38,19 +38,19 @@ class ListGroupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. the order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of groups. Please see diff --git a/VmMigration/src/V1/ListGroupsResponse.php b/VmMigration/src/V1/ListGroupsResponse.php index 75dd89644524..3296fe31b740 100644 --- a/VmMigration/src/V1/ListGroupsResponse.php +++ b/VmMigration/src/V1/ListGroupsResponse.php @@ -27,7 +27,7 @@ class ListGroupsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Output only. Locations that could not be reached. * diff --git a/VmMigration/src/V1/ListMigratingVmsRequest.php b/VmMigration/src/V1/ListMigratingVmsRequest.php index 290c029bd0e5..51052e3a9534 100644 --- a/VmMigration/src/V1/ListMigratingVmsRequest.php +++ b/VmMigration/src/V1/ListMigratingVmsRequest.php @@ -20,7 +20,7 @@ class ListMigratingVmsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of migrating VMs to return. The service may * return fewer than this value. If unspecified, at most 500 migrating VMs @@ -29,7 +29,7 @@ class ListMigratingVmsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Required. A page token, received from a previous `ListMigratingVms` call. * Provide this to retrieve the subsequent page. @@ -38,25 +38,25 @@ class ListMigratingVmsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. the order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * Optional. The level of details of each migrating VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.MigratingVmView view = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * @param string $parent Required. The parent, which owns this collection of MigratingVms. Please see diff --git a/VmMigration/src/V1/ListMigratingVmsResponse.php b/VmMigration/src/V1/ListMigratingVmsResponse.php index ec3c590b37bd..3f42ab8737dc 100644 --- a/VmMigration/src/V1/ListMigratingVmsResponse.php +++ b/VmMigration/src/V1/ListMigratingVmsResponse.php @@ -27,7 +27,7 @@ class ListMigratingVmsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Output only. Locations that could not be reached. * diff --git a/VmMigration/src/V1/ListReplicationCyclesRequest.php b/VmMigration/src/V1/ListReplicationCyclesRequest.php index f48770d1c01c..816d448a57c1 100644 --- a/VmMigration/src/V1/ListReplicationCyclesRequest.php +++ b/VmMigration/src/V1/ListReplicationCyclesRequest.php @@ -20,7 +20,7 @@ class ListReplicationCyclesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of replication cycles to return. The service * may return fewer than this value. If unspecified, at most 100 migrating VMs @@ -29,7 +29,7 @@ class ListReplicationCyclesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Required. A page token, received from a previous `ListReplicationCycles` * call. Provide this to retrieve the subsequent page. @@ -38,19 +38,19 @@ class ListReplicationCyclesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. the order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of ReplicationCycles. Please see diff --git a/VmMigration/src/V1/ListReplicationCyclesResponse.php b/VmMigration/src/V1/ListReplicationCyclesResponse.php index 8217c32ad4bb..2e8b8b96042f 100644 --- a/VmMigration/src/V1/ListReplicationCyclesResponse.php +++ b/VmMigration/src/V1/ListReplicationCyclesResponse.php @@ -27,7 +27,7 @@ class ListReplicationCyclesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Output only. Locations that could not be reached. * diff --git a/VmMigration/src/V1/ListSourcesRequest.php b/VmMigration/src/V1/ListSourcesRequest.php index 94cf659ca378..8286f34c3e6c 100644 --- a/VmMigration/src/V1/ListSourcesRequest.php +++ b/VmMigration/src/V1/ListSourcesRequest.php @@ -20,7 +20,7 @@ class ListSourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of sources to return. The service may return * fewer than this value. If unspecified, at most 500 sources will be @@ -29,7 +29,7 @@ class ListSourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Required. A page token, received from a previous `ListSources` call. * Provide this to retrieve the subsequent page. @@ -38,19 +38,19 @@ class ListSourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. the order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of sources. Please see diff --git a/VmMigration/src/V1/ListSourcesResponse.php b/VmMigration/src/V1/ListSourcesResponse.php index 660ab8febfa6..413cd7b0d15d 100644 --- a/VmMigration/src/V1/ListSourcesResponse.php +++ b/VmMigration/src/V1/ListSourcesResponse.php @@ -27,7 +27,7 @@ class ListSourcesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Output only. Locations that could not be reached. * diff --git a/VmMigration/src/V1/ListTargetProjectsRequest.php b/VmMigration/src/V1/ListTargetProjectsRequest.php index 82fcf0072007..82fa22a9be68 100644 --- a/VmMigration/src/V1/ListTargetProjectsRequest.php +++ b/VmMigration/src/V1/ListTargetProjectsRequest.php @@ -20,7 +20,7 @@ class ListTargetProjectsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The maximum number of targets to return. The service may return * fewer than this value. If unspecified, at most 500 targets will be @@ -29,7 +29,7 @@ class ListTargetProjectsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Required. A page token, received from a previous `ListTargets` call. * Provide this to retrieve the subsequent page. @@ -38,19 +38,19 @@ class ListTargetProjectsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter request. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. the order by fields for the result. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The parent, which owns this collection of targets. Please see diff --git a/VmMigration/src/V1/ListTargetProjectsResponse.php b/VmMigration/src/V1/ListTargetProjectsResponse.php index a12de9c559d1..a51c7c607f95 100644 --- a/VmMigration/src/V1/ListTargetProjectsResponse.php +++ b/VmMigration/src/V1/ListTargetProjectsResponse.php @@ -27,7 +27,7 @@ class ListTargetProjectsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Output only. Locations that could not be reached. * diff --git a/VmMigration/src/V1/ListUtilizationReportsRequest.php b/VmMigration/src/V1/ListUtilizationReportsRequest.php index b24548cbe33a..a1b2d9ef827f 100644 --- a/VmMigration/src/V1/ListUtilizationReportsRequest.php +++ b/VmMigration/src/V1/ListUtilizationReportsRequest.php @@ -20,14 +20,14 @@ class ListUtilizationReportsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. The level of details of each report. * Defaults to BASIC. * * Generated from protobuf field .google.cloud.vmmigration.v1.UtilizationReportView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $view = 0; + protected $view = 0; /** * Optional. The maximum number of reports to return. The service may return * fewer than this value. If unspecified, at most 500 reports will be @@ -36,7 +36,7 @@ class ListUtilizationReportsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Required. A page token, received from a previous `ListUtilizationReports` * call. Provide this to retrieve the subsequent page. @@ -45,19 +45,19 @@ class ListUtilizationReportsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. The filter request. * * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. the order by fields for the result. * * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The Utilization Reports parent. Please see diff --git a/VmMigration/src/V1/ListUtilizationReportsResponse.php b/VmMigration/src/V1/ListUtilizationReportsResponse.php index be3a71b3ccca..a82c22f473b4 100644 --- a/VmMigration/src/V1/ListUtilizationReportsResponse.php +++ b/VmMigration/src/V1/ListUtilizationReportsResponse.php @@ -27,7 +27,7 @@ class ListUtilizationReportsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Output only. Locations that could not be reached. * diff --git a/VmMigration/src/V1/MigratingVm.php b/VmMigration/src/V1/MigratingVm.php index c6e5be7f264c..a86771ba3c43 100644 --- a/VmMigration/src/V1/MigratingVm.php +++ b/VmMigration/src/V1/MigratingVm.php @@ -21,7 +21,7 @@ class MigratingVm extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * The unique ID of the VM in the source. * The VM's name in vSphere can be changed, so this is not the VM's name but @@ -29,64 +29,64 @@ class MigratingVm extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string source_vm_id = 2; */ - private $source_vm_id = ''; + protected $source_vm_id = ''; /** * The display name attached to the MigratingVm by the user. * * Generated from protobuf field string display_name = 18; */ - private $display_name = ''; + protected $display_name = ''; /** * The description attached to the migrating VM by the user. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * The replication schedule policy. * * Generated from protobuf field .google.cloud.vmmigration.v1.SchedulePolicy policy = 8; */ - private $policy = null; + protected $policy = null; /** * Output only. The time the migrating VM was created (this refers to this * resource and not to the time it was installed in the source). * * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The last time the migrating VM resource was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. The most updated snapshot created time in the source that * finished replication. * * Generated from protobuf field .google.cloud.vmmigration.v1.ReplicationSync last_sync = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $last_sync = null; + protected $last_sync = null; /** * Output only. State of the MigratingVm. * * Generated from protobuf field .google.cloud.vmmigration.v1.MigratingVm.State state = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The last time the migrating VM state was updated. * * Generated from protobuf field .google.protobuf.Timestamp state_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_time = null; + protected $state_time = null; /** * Output only. The percentage progress of the current running replication * cycle. * * Generated from protobuf field .google.cloud.vmmigration.v1.ReplicationCycle current_sync_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $current_sync_info = null; + protected $current_sync_info = null; /** * Output only. The group this migrating vm is included in, if any. The group * is represented by the full path of the appropriate @@ -94,7 +94,7 @@ class MigratingVm extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string group = 15 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $group = ''; + protected $group = ''; /** * The labels of the migrating VM. * @@ -117,7 +117,7 @@ class MigratingVm extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status error = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Output only. The recent cutover jobs performed on the migrating VM. * This field holds the vm's last completed cutover job and the vm's diff --git a/VmMigration/src/V1/MigrationError.php b/VmMigration/src/V1/MigrationError.php index a897dd07fe2f..55181c0327d9 100644 --- a/VmMigration/src/V1/MigrationError.php +++ b/VmMigration/src/V1/MigrationError.php @@ -22,19 +22,19 @@ class MigrationError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.MigrationError.ErrorCode code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $code = 0; + protected $code = 0; /** * Output only. The localized error message. * * Generated from protobuf field .google.rpc.LocalizedMessage error_message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error_message = null; + protected $error_message = null; /** * Output only. Suggested action for solving the error. * * Generated from protobuf field .google.rpc.LocalizedMessage action_item = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $action_item = null; + protected $action_item = null; /** * Output only. URL(s) pointing to additional information on handling the * current error. @@ -47,7 +47,7 @@ class MigrationError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp error_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error_time = null; + protected $error_time = null; /** * Constructor. diff --git a/VmMigration/src/V1/NetworkInterface.php b/VmMigration/src/V1/NetworkInterface.php index 49eead118adf..e70ad652db3a 100644 --- a/VmMigration/src/V1/NetworkInterface.php +++ b/VmMigration/src/V1/NetworkInterface.php @@ -20,13 +20,13 @@ class NetworkInterface extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 1; */ - private $network = ''; + protected $network = ''; /** * The subnetwork to connect the NIC to. * * Generated from protobuf field string subnetwork = 2; */ - private $subnetwork = ''; + protected $subnetwork = ''; /** * The internal IP to define in the NIC. * The formats accepted are: `ephemeral` \ ipv4 address \ a named address @@ -34,13 +34,13 @@ class NetworkInterface extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string internal_ip = 3; */ - private $internal_ip = ''; + protected $internal_ip = ''; /** * The external IP to define in the NIC. * * Generated from protobuf field string external_ip = 4; */ - private $external_ip = ''; + protected $external_ip = ''; /** * Constructor. diff --git a/VmMigration/src/V1/OperationMetadata.php b/VmMigration/src/V1/OperationMetadata.php index 54f4ed13bcb1..3174fc524175 100644 --- a/VmMigration/src/V1/OperationMetadata.php +++ b/VmMigration/src/V1/OperationMetadata.php @@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $status_message = ''; + protected $status_message = ''; /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -54,13 +54,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Constructor. diff --git a/VmMigration/src/V1/PauseMigrationRequest.php b/VmMigration/src/V1/PauseMigrationRequest.php index 76fcb8fa1ce1..bd578e77b383 100644 --- a/VmMigration/src/V1/PauseMigrationRequest.php +++ b/VmMigration/src/V1/PauseMigrationRequest.php @@ -20,7 +20,7 @@ class PauseMigrationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string migrating_vm = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $migrating_vm = ''; + protected $migrating_vm = ''; /** * Constructor. diff --git a/VmMigration/src/V1/RemoveGroupMigrationRequest.php b/VmMigration/src/V1/RemoveGroupMigrationRequest.php index aa1a961c387e..5aa1a199ff07 100644 --- a/VmMigration/src/V1/RemoveGroupMigrationRequest.php +++ b/VmMigration/src/V1/RemoveGroupMigrationRequest.php @@ -20,13 +20,13 @@ class RemoveGroupMigrationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string group = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $group = ''; + protected $group = ''; /** * The MigratingVm to remove. * * Generated from protobuf field string migrating_vm = 2 [(.google.api.resource_reference) = { */ - private $migrating_vm = ''; + protected $migrating_vm = ''; /** * @param string $group Required. The name of the Group. Please see diff --git a/VmMigration/src/V1/ReplicatingStep.php b/VmMigration/src/V1/ReplicatingStep.php index 92f21f1681b0..c0191fc596f3 100644 --- a/VmMigration/src/V1/ReplicatingStep.php +++ b/VmMigration/src/V1/ReplicatingStep.php @@ -20,27 +20,27 @@ class ReplicatingStep extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 total_bytes = 1; */ - private $total_bytes = 0; + protected $total_bytes = 0; /** * Replicated bytes in the step. * * Generated from protobuf field int64 replicated_bytes = 2; */ - private $replicated_bytes = 0; + protected $replicated_bytes = 0; /** * The source disks replication rate for the last 2 minutes in bytes per * second. * * Generated from protobuf field int64 last_two_minutes_average_bytes_per_second = 3; */ - private $last_two_minutes_average_bytes_per_second = 0; + protected $last_two_minutes_average_bytes_per_second = 0; /** * The source disks replication rate for the last 30 minutes in bytes per * second. * * Generated from protobuf field int64 last_thirty_minutes_average_bytes_per_second = 4; */ - private $last_thirty_minutes_average_bytes_per_second = 0; + protected $last_thirty_minutes_average_bytes_per_second = 0; /** * Constructor. diff --git a/VmMigration/src/V1/ReplicationCycle.php b/VmMigration/src/V1/ReplicationCycle.php index 32ee6868a08b..54c3bf4c6ee3 100644 --- a/VmMigration/src/V1/ReplicationCycle.php +++ b/VmMigration/src/V1/ReplicationCycle.php @@ -21,31 +21,31 @@ class ReplicationCycle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 13; */ - private $name = ''; + protected $name = ''; /** * The cycle's ordinal number. * * Generated from protobuf field int32 cycle_number = 10; */ - private $cycle_number = 0; + protected $cycle_number = 0; /** * The time the replication cycle has started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - private $start_time = null; + protected $start_time = null; /** * The time the replication cycle has ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 6; */ - private $end_time = null; + protected $end_time = null; /** * The accumulated duration the replication cycle was paused. * * Generated from protobuf field .google.protobuf.Duration total_pause_duration = 7; */ - private $total_pause_duration = null; + protected $total_pause_duration = null; /** * The current progress in percentage of this cycle. * Was replaced by 'steps' field, which breaks down the cycle progression more @@ -66,13 +66,13 @@ class ReplicationCycle extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.vmmigration.v1.ReplicationCycle.State state = 11; */ - private $state = 0; + protected $state = 0; /** * Provides details on the state of the cycle in case of an error. * * Generated from protobuf field .google.rpc.Status error = 12; */ - private $error = null; + protected $error = null; /** * Constructor. diff --git a/VmMigration/src/V1/ReplicationSync.php b/VmMigration/src/V1/ReplicationSync.php index 0f3e863619ac..5723d6e67f45 100644 --- a/VmMigration/src/V1/ReplicationSync.php +++ b/VmMigration/src/V1/ReplicationSync.php @@ -21,7 +21,7 @@ class ReplicationSync extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp last_sync_time = 1; */ - private $last_sync_time = null; + protected $last_sync_time = null; /** * Constructor. diff --git a/VmMigration/src/V1/ResumeMigrationRequest.php b/VmMigration/src/V1/ResumeMigrationRequest.php index b7a0a6a27b30..b907eb8348b4 100644 --- a/VmMigration/src/V1/ResumeMigrationRequest.php +++ b/VmMigration/src/V1/ResumeMigrationRequest.php @@ -20,7 +20,7 @@ class ResumeMigrationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string migrating_vm = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $migrating_vm = ''; + protected $migrating_vm = ''; /** * Constructor. diff --git a/VmMigration/src/V1/SchedulePolicy.php b/VmMigration/src/V1/SchedulePolicy.php index dc46baf83cad..0ef6fde8d9da 100644 --- a/VmMigration/src/V1/SchedulePolicy.php +++ b/VmMigration/src/V1/SchedulePolicy.php @@ -20,7 +20,7 @@ class SchedulePolicy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration idle_duration = 1; */ - private $idle_duration = null; + protected $idle_duration = null; /** * A flag to indicate whether to skip OS adaptation during the replication * sync. OS adaptation is a process where the VM's operating system undergoes @@ -28,7 +28,7 @@ class SchedulePolicy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool skip_os_adaptation = 2; */ - private $skip_os_adaptation = false; + protected $skip_os_adaptation = false; /** * Constructor. diff --git a/VmMigration/src/V1/SchedulingNodeAffinity.php b/VmMigration/src/V1/SchedulingNodeAffinity.php index 4d0ceb2b1354..d66ecb3f057e 100644 --- a/VmMigration/src/V1/SchedulingNodeAffinity.php +++ b/VmMigration/src/V1/SchedulingNodeAffinity.php @@ -22,14 +22,14 @@ class SchedulingNodeAffinity extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 1; */ - private $key = ''; + protected $key = ''; /** * The operator to use for the node resources specified in the `values` * parameter. * * Generated from protobuf field .google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator operator = 2; */ - private $operator = 0; + protected $operator = 0; /** * Corresponds to the label values of Node resource. * diff --git a/VmMigration/src/V1/Source.php b/VmMigration/src/V1/Source.php index 3ac3026413e5..ae1ab78c28ca 100644 --- a/VmMigration/src/V1/Source.php +++ b/VmMigration/src/V1/Source.php @@ -21,19 +21,19 @@ class Source extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The create time timestamp. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The update time timestamp. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The labels of the source. * @@ -45,7 +45,7 @@ class Source extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 6; */ - private $description = ''; + protected $description = ''; protected $source_details; /** diff --git a/VmMigration/src/V1/StartMigrationRequest.php b/VmMigration/src/V1/StartMigrationRequest.php index 5788a100b433..4e456d7c4f89 100644 --- a/VmMigration/src/V1/StartMigrationRequest.php +++ b/VmMigration/src/V1/StartMigrationRequest.php @@ -20,7 +20,7 @@ class StartMigrationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string migrating_vm = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $migrating_vm = ''; + protected $migrating_vm = ''; /** * @param string $migratingVm Required. The name of the MigratingVm. Please see diff --git a/VmMigration/src/V1/TargetProject.php b/VmMigration/src/V1/TargetProject.php index 40587b8c7891..d19fb184997d 100644 --- a/VmMigration/src/V1/TargetProject.php +++ b/VmMigration/src/V1/TargetProject.php @@ -21,32 +21,32 @@ class TargetProject extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * The target project ID (number) or project name. * * Generated from protobuf field string project = 2; */ - private $project = ''; + protected $project = ''; /** * The target project's description. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Output only. The time this target project resource was created (not related * to when the Compute Engine project it points to was created). * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The last time the target project resource was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/VmMigration/src/V1/UpdateGroupRequest.php b/VmMigration/src/V1/UpdateGroupRequest.php index ec9d77d28412..c3566d1bd515 100644 --- a/VmMigration/src/V1/UpdateGroupRequest.php +++ b/VmMigration/src/V1/UpdateGroupRequest.php @@ -24,13 +24,13 @@ class UpdateGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The update request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.Group group = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $group = null; + protected $group = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -46,7 +46,7 @@ class UpdateGroupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\VMMigration\V1\Group $group Required. The update request body. diff --git a/VmMigration/src/V1/UpdateMigratingVmRequest.php b/VmMigration/src/V1/UpdateMigratingVmRequest.php index 6b86ccc9c162..4dc83e8dfef2 100644 --- a/VmMigration/src/V1/UpdateMigratingVmRequest.php +++ b/VmMigration/src/V1/UpdateMigratingVmRequest.php @@ -24,13 +24,13 @@ class UpdateMigratingVmRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The update request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.MigratingVm migrating_vm = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $migrating_vm = null; + protected $migrating_vm = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -46,7 +46,7 @@ class UpdateMigratingVmRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\VMMigration\V1\MigratingVm $migratingVm Required. The update request body. diff --git a/VmMigration/src/V1/UpdateSourceRequest.php b/VmMigration/src/V1/UpdateSourceRequest.php index fa1e2a4d5d83..6fedf6b84370 100644 --- a/VmMigration/src/V1/UpdateSourceRequest.php +++ b/VmMigration/src/V1/UpdateSourceRequest.php @@ -24,13 +24,13 @@ class UpdateSourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The update request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $source = null; + protected $source = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -46,7 +46,7 @@ class UpdateSourceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\VMMigration\V1\Source $source Required. The update request body. diff --git a/VmMigration/src/V1/UpdateTargetProjectRequest.php b/VmMigration/src/V1/UpdateTargetProjectRequest.php index 503c88793186..64f7eaec9709 100644 --- a/VmMigration/src/V1/UpdateTargetProjectRequest.php +++ b/VmMigration/src/V1/UpdateTargetProjectRequest.php @@ -24,13 +24,13 @@ class UpdateTargetProjectRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The update request body. * * Generated from protobuf field .google.cloud.vmmigration.v1.TargetProject target_project = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_project = null; + protected $target_project = null; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -46,7 +46,7 @@ class UpdateTargetProjectRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\VMMigration\V1\TargetProject $targetProject Required. The update request body. diff --git a/VmMigration/src/V1/UpgradeApplianceRequest.php b/VmMigration/src/V1/UpgradeApplianceRequest.php index 98cc90917453..ceb9df3af2cf 100644 --- a/VmMigration/src/V1/UpgradeApplianceRequest.php +++ b/VmMigration/src/V1/UpgradeApplianceRequest.php @@ -20,7 +20,7 @@ class UpgradeApplianceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string datacenter_connector = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $datacenter_connector = ''; + protected $datacenter_connector = ''; /** * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -36,7 +36,7 @@ class UpgradeApplianceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2; */ - private $request_id = ''; + protected $request_id = ''; /** * Constructor. diff --git a/VmMigration/src/V1/UpgradeStatus.php b/VmMigration/src/V1/UpgradeStatus.php index 35c1fe62a969..ed6bf097167b 100644 --- a/VmMigration/src/V1/UpgradeStatus.php +++ b/VmMigration/src/V1/UpgradeStatus.php @@ -20,31 +20,31 @@ class UpgradeStatus extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1; */ - private $version = ''; + protected $version = ''; /** * The state of the upgradeAppliance operation. * * Generated from protobuf field .google.cloud.vmmigration.v1.UpgradeStatus.State state = 2; */ - private $state = 0; + protected $state = 0; /** * Provides details on the state of the upgrade operation in case of an error. * * Generated from protobuf field .google.rpc.Status error = 3; */ - private $error = null; + protected $error = null; /** * The time the operation was started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; */ - private $start_time = null; + protected $start_time = null; /** * The version from which we upgraded. * * Generated from protobuf field string previous_version = 5; */ - private $previous_version = ''; + protected $previous_version = ''; /** * Constructor. diff --git a/VmMigration/src/V1/UtilizationReport.php b/VmMigration/src/V1/UtilizationReport.php index cefa9571508d..322d7e9820a8 100644 --- a/VmMigration/src/V1/UtilizationReport.php +++ b/VmMigration/src/V1/UtilizationReport.php @@ -21,45 +21,45 @@ class UtilizationReport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * The report display name, as assigned by the user. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. Current state of the report. * * Generated from protobuf field .google.cloud.vmmigration.v1.UtilizationReport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The time the state was last set. * * Generated from protobuf field .google.protobuf.Timestamp state_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_time = null; + protected $state_time = null; /** * Output only. Provides details on the state of the report in case of an * error. * * Generated from protobuf field .google.rpc.Status error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $error = null; + protected $error = null; /** * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Time frame of the report. * * Generated from protobuf field .google.cloud.vmmigration.v1.UtilizationReport.TimeFrame time_frame = 7; */ - private $time_frame = 0; + protected $time_frame = 0; /** * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value @@ -68,13 +68,13 @@ class UtilizationReport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp frame_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $frame_end_time = null; + protected $frame_end_time = null; /** * Output only. Total number of VMs included in the report. * * Generated from protobuf field int32 vm_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $vm_count = 0; + protected $vm_count = 0; /** * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to diff --git a/VmMigration/src/V1/VmMigrationClient.php b/VmMigration/src/V1/VmMigrationClient.php deleted file mode 100644 index 41c1ac400a7b..000000000000 --- a/VmMigration/src/V1/VmMigrationClient.php +++ /dev/null @@ -1,34 +0,0 @@ -_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ListSources', - $argument, - ['\Google\Cloud\VMMigration\V1\ListSourcesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Source. - * @param \Google\Cloud\VMMigration\V1\GetSourceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetSource(\Google\Cloud\VMMigration\V1\GetSourceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/GetSource', - $argument, - ['\Google\Cloud\VMMigration\V1\Source', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Source in a given project and location. - * @param \Google\Cloud\VMMigration\V1\CreateSourceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateSource(\Google\Cloud\VMMigration\V1\CreateSourceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CreateSource', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single Source. - * @param \Google\Cloud\VMMigration\V1\UpdateSourceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateSource(\Google\Cloud\VMMigration\V1\UpdateSourceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/UpdateSource', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Source. - * @param \Google\Cloud\VMMigration\V1\DeleteSourceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteSource(\Google\Cloud\VMMigration\V1\DeleteSourceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/DeleteSource', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * List remote source's inventory of VMs. - * The remote source is the onprem vCenter (remote in the sense it's not in - * Compute Engine). The inventory describes the list of existing VMs in that - * source. Note that this operation lists the VMs on the remote source, as - * opposed to listing the MigratingVms resources in the vmmigration service. - * @param \Google\Cloud\VMMigration\V1\FetchInventoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function FetchInventory(\Google\Cloud\VMMigration\V1\FetchInventoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/FetchInventory', - $argument, - ['\Google\Cloud\VMMigration\V1\FetchInventoryResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists Utilization Reports of the given Source. - * @param \Google\Cloud\VMMigration\V1\ListUtilizationReportsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListUtilizationReports(\Google\Cloud\VMMigration\V1\ListUtilizationReportsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ListUtilizationReports', - $argument, - ['\Google\Cloud\VMMigration\V1\ListUtilizationReportsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a single Utilization Report. - * @param \Google\Cloud\VMMigration\V1\GetUtilizationReportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetUtilizationReport(\Google\Cloud\VMMigration\V1\GetUtilizationReportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/GetUtilizationReport', - $argument, - ['\Google\Cloud\VMMigration\V1\UtilizationReport', 'decode'], - $metadata, $options); - } - - /** - * Creates a new UtilizationReport. - * @param \Google\Cloud\VMMigration\V1\CreateUtilizationReportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateUtilizationReport(\Google\Cloud\VMMigration\V1\CreateUtilizationReportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CreateUtilizationReport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Utilization Report. - * @param \Google\Cloud\VMMigration\V1\DeleteUtilizationReportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteUtilizationReport(\Google\Cloud\VMMigration\V1\DeleteUtilizationReportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/DeleteUtilizationReport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists DatacenterConnectors in a given Source. - * @param \Google\Cloud\VMMigration\V1\ListDatacenterConnectorsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListDatacenterConnectors(\Google\Cloud\VMMigration\V1\ListDatacenterConnectorsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ListDatacenterConnectors', - $argument, - ['\Google\Cloud\VMMigration\V1\ListDatacenterConnectorsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single DatacenterConnector. - * @param \Google\Cloud\VMMigration\V1\GetDatacenterConnectorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetDatacenterConnector(\Google\Cloud\VMMigration\V1\GetDatacenterConnectorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/GetDatacenterConnector', - $argument, - ['\Google\Cloud\VMMigration\V1\DatacenterConnector', 'decode'], - $metadata, $options); - } - - /** - * Creates a new DatacenterConnector in a given Source. - * @param \Google\Cloud\VMMigration\V1\CreateDatacenterConnectorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateDatacenterConnector(\Google\Cloud\VMMigration\V1\CreateDatacenterConnectorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CreateDatacenterConnector', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single DatacenterConnector. - * @param \Google\Cloud\VMMigration\V1\DeleteDatacenterConnectorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteDatacenterConnector(\Google\Cloud\VMMigration\V1\DeleteDatacenterConnectorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/DeleteDatacenterConnector', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Upgrades the appliance relate to this DatacenterConnector to the in-place - * updateable version. - * @param \Google\Cloud\VMMigration\V1\UpgradeApplianceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpgradeAppliance(\Google\Cloud\VMMigration\V1\UpgradeApplianceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/UpgradeAppliance', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a new MigratingVm in a given Source. - * @param \Google\Cloud\VMMigration\V1\CreateMigratingVmRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateMigratingVm(\Google\Cloud\VMMigration\V1\CreateMigratingVmRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CreateMigratingVm', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists MigratingVms in a given Source. - * @param \Google\Cloud\VMMigration\V1\ListMigratingVmsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMigratingVms(\Google\Cloud\VMMigration\V1\ListMigratingVmsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ListMigratingVms', - $argument, - ['\Google\Cloud\VMMigration\V1\ListMigratingVmsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single MigratingVm. - * @param \Google\Cloud\VMMigration\V1\GetMigratingVmRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMigratingVm(\Google\Cloud\VMMigration\V1\GetMigratingVmRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/GetMigratingVm', - $argument, - ['\Google\Cloud\VMMigration\V1\MigratingVm', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single MigratingVm. - * @param \Google\Cloud\VMMigration\V1\UpdateMigratingVmRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateMigratingVm(\Google\Cloud\VMMigration\V1\UpdateMigratingVmRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/UpdateMigratingVm', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single MigratingVm. - * @param \Google\Cloud\VMMigration\V1\DeleteMigratingVmRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteMigratingVm(\Google\Cloud\VMMigration\V1\DeleteMigratingVmRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/DeleteMigratingVm', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Starts migration for a VM. Starts the process of uploading - * data and creating snapshots, in replication cycles scheduled by the policy. - * @param \Google\Cloud\VMMigration\V1\StartMigrationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StartMigration(\Google\Cloud\VMMigration\V1\StartMigrationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/StartMigration', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Resumes a migration for a VM. When called on a paused migration, will start - * the process of uploading data and creating snapshots; when called on a - * completed cut-over migration, will update the migration to active state and - * start the process of uploading data and creating snapshots. - * @param \Google\Cloud\VMMigration\V1\ResumeMigrationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ResumeMigration(\Google\Cloud\VMMigration\V1\ResumeMigrationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ResumeMigration', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Pauses a migration for a VM. If cycle tasks are running they will be - * cancelled, preserving source task data. Further replication cycles will not - * be triggered while the VM is paused. - * @param \Google\Cloud\VMMigration\V1\PauseMigrationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PauseMigration(\Google\Cloud\VMMigration\V1\PauseMigrationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/PauseMigration', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Marks a migration as completed, deleting migration resources that are no - * longer being used. Only applicable after cutover is done. - * @param \Google\Cloud\VMMigration\V1\FinalizeMigrationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function FinalizeMigration(\Google\Cloud\VMMigration\V1\FinalizeMigrationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/FinalizeMigration', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Initiates a Clone of a specific migrating VM. - * @param \Google\Cloud\VMMigration\V1\CreateCloneJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateCloneJob(\Google\Cloud\VMMigration\V1\CreateCloneJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CreateCloneJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Initiates the cancellation of a running clone job. - * @param \Google\Cloud\VMMigration\V1\CancelCloneJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelCloneJob(\Google\Cloud\VMMigration\V1\CancelCloneJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CancelCloneJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists CloneJobs of a given migrating VM. - * @param \Google\Cloud\VMMigration\V1\ListCloneJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListCloneJobs(\Google\Cloud\VMMigration\V1\ListCloneJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ListCloneJobs', - $argument, - ['\Google\Cloud\VMMigration\V1\ListCloneJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single CloneJob. - * @param \Google\Cloud\VMMigration\V1\GetCloneJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetCloneJob(\Google\Cloud\VMMigration\V1\GetCloneJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/GetCloneJob', - $argument, - ['\Google\Cloud\VMMigration\V1\CloneJob', 'decode'], - $metadata, $options); - } - - /** - * Initiates a Cutover of a specific migrating VM. - * The returned LRO is completed when the cutover job resource is created - * and the job is initiated. - * @param \Google\Cloud\VMMigration\V1\CreateCutoverJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateCutoverJob(\Google\Cloud\VMMigration\V1\CreateCutoverJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CreateCutoverJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Initiates the cancellation of a running cutover job. - * @param \Google\Cloud\VMMigration\V1\CancelCutoverJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelCutoverJob(\Google\Cloud\VMMigration\V1\CancelCutoverJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CancelCutoverJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists CutoverJobs of a given migrating VM. - * @param \Google\Cloud\VMMigration\V1\ListCutoverJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListCutoverJobs(\Google\Cloud\VMMigration\V1\ListCutoverJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ListCutoverJobs', - $argument, - ['\Google\Cloud\VMMigration\V1\ListCutoverJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single CutoverJob. - * @param \Google\Cloud\VMMigration\V1\GetCutoverJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetCutoverJob(\Google\Cloud\VMMigration\V1\GetCutoverJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/GetCutoverJob', - $argument, - ['\Google\Cloud\VMMigration\V1\CutoverJob', 'decode'], - $metadata, $options); - } - - /** - * Lists Groups in a given project and location. - * @param \Google\Cloud\VMMigration\V1\ListGroupsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListGroups(\Google\Cloud\VMMigration\V1\ListGroupsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ListGroups', - $argument, - ['\Google\Cloud\VMMigration\V1\ListGroupsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single Group. - * @param \Google\Cloud\VMMigration\V1\GetGroupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetGroup(\Google\Cloud\VMMigration\V1\GetGroupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/GetGroup', - $argument, - ['\Google\Cloud\VMMigration\V1\Group', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Group in a given project and location. - * @param \Google\Cloud\VMMigration\V1\CreateGroupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateGroup(\Google\Cloud\VMMigration\V1\CreateGroupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CreateGroup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single Group. - * @param \Google\Cloud\VMMigration\V1\UpdateGroupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateGroup(\Google\Cloud\VMMigration\V1\UpdateGroupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/UpdateGroup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single Group. - * @param \Google\Cloud\VMMigration\V1\DeleteGroupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteGroup(\Google\Cloud\VMMigration\V1\DeleteGroupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/DeleteGroup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Adds a MigratingVm to a Group. - * @param \Google\Cloud\VMMigration\V1\AddGroupMigrationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AddGroupMigration(\Google\Cloud\VMMigration\V1\AddGroupMigrationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/AddGroupMigration', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Removes a MigratingVm from a Group. - * @param \Google\Cloud\VMMigration\V1\RemoveGroupMigrationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RemoveGroupMigration(\Google\Cloud\VMMigration\V1\RemoveGroupMigrationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/RemoveGroupMigration', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists TargetProjects in a given project. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * @param \Google\Cloud\VMMigration\V1\ListTargetProjectsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTargetProjects(\Google\Cloud\VMMigration\V1\ListTargetProjectsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ListTargetProjects', - $argument, - ['\Google\Cloud\VMMigration\V1\ListTargetProjectsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single TargetProject. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * @param \Google\Cloud\VMMigration\V1\GetTargetProjectRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTargetProject(\Google\Cloud\VMMigration\V1\GetTargetProjectRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/GetTargetProject', - $argument, - ['\Google\Cloud\VMMigration\V1\TargetProject', 'decode'], - $metadata, $options); - } - - /** - * Creates a new TargetProject in a given project. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * @param \Google\Cloud\VMMigration\V1\CreateTargetProjectRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTargetProject(\Google\Cloud\VMMigration\V1\CreateTargetProjectRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/CreateTargetProject', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single TargetProject. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * @param \Google\Cloud\VMMigration\V1\UpdateTargetProjectRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTargetProject(\Google\Cloud\VMMigration\V1\UpdateTargetProjectRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/UpdateTargetProject', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single TargetProject. - * - * NOTE: TargetProject is a global resource; hence the only supported value - * for location is `global`. - * @param \Google\Cloud\VMMigration\V1\DeleteTargetProjectRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTargetProject(\Google\Cloud\VMMigration\V1\DeleteTargetProjectRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/DeleteTargetProject', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists ReplicationCycles in a given MigratingVM. - * @param \Google\Cloud\VMMigration\V1\ListReplicationCyclesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListReplicationCycles(\Google\Cloud\VMMigration\V1\ListReplicationCyclesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/ListReplicationCycles', - $argument, - ['\Google\Cloud\VMMigration\V1\ListReplicationCyclesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single ReplicationCycle. - * @param \Google\Cloud\VMMigration\V1\GetReplicationCycleRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetReplicationCycle(\Google\Cloud\VMMigration\V1\GetReplicationCycleRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.vmmigration.v1.VmMigration/GetReplicationCycle', - $argument, - ['\Google\Cloud\VMMigration\V1\ReplicationCycle', 'decode'], - $metadata, $options); - } - -} diff --git a/VmMigration/src/V1/VmUtilizationInfo.php b/VmMigration/src/V1/VmUtilizationInfo.php index 597771cc9686..8ba1b02d4c1d 100644 --- a/VmMigration/src/V1/VmUtilizationInfo.php +++ b/VmMigration/src/V1/VmUtilizationInfo.php @@ -20,13 +20,13 @@ class VmUtilizationInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string vm_id = 3; */ - private $vm_id = ''; + protected $vm_id = ''; /** * Utilization metrics for this VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.VmUtilizationMetrics utilization = 2; */ - private $utilization = null; + protected $utilization = null; protected $VmDetails; /** diff --git a/VmMigration/src/V1/VmUtilizationMetrics.php b/VmMigration/src/V1/VmUtilizationMetrics.php index 43a13e3c383c..e81a156532d9 100644 --- a/VmMigration/src/V1/VmUtilizationMetrics.php +++ b/VmMigration/src/V1/VmUtilizationMetrics.php @@ -20,51 +20,51 @@ class VmUtilizationMetrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 cpu_max_percent = 9; */ - private $cpu_max_percent = 0; + protected $cpu_max_percent = 0; /** * Average CPU usage, percent. * * Generated from protobuf field int32 cpu_average_percent = 10; */ - private $cpu_average_percent = 0; + protected $cpu_average_percent = 0; /** * Max memory usage, percent. * * Generated from protobuf field int32 memory_max_percent = 11; */ - private $memory_max_percent = 0; + protected $memory_max_percent = 0; /** * Average memory usage, percent. * * Generated from protobuf field int32 memory_average_percent = 12; */ - private $memory_average_percent = 0; + protected $memory_average_percent = 0; /** * Max disk IO rate, in kilobytes per second. * * Generated from protobuf field int64 disk_io_rate_max_kbps = 13; */ - private $disk_io_rate_max_kbps = 0; + protected $disk_io_rate_max_kbps = 0; /** * Average disk IO rate, in kilobytes per second. * * Generated from protobuf field int64 disk_io_rate_average_kbps = 14; */ - private $disk_io_rate_average_kbps = 0; + protected $disk_io_rate_average_kbps = 0; /** * Max network throughput (combined transmit-rates and receive-rates), in * kilobytes per second. * * Generated from protobuf field int64 network_throughput_max_kbps = 15; */ - private $network_throughput_max_kbps = 0; + protected $network_throughput_max_kbps = 0; /** * Average network throughput (combined transmit-rates and receive-rates), in * kilobytes per second. * * Generated from protobuf field int64 network_throughput_average_kbps = 16; */ - private $network_throughput_average_kbps = 0; + protected $network_throughput_average_kbps = 0; /** * Constructor. diff --git a/VmMigration/src/V1/VmwareSourceDetails.php b/VmMigration/src/V1/VmwareSourceDetails.php index b1179c365935..751c4aebdc1a 100644 --- a/VmMigration/src/V1/VmwareSourceDetails.php +++ b/VmMigration/src/V1/VmwareSourceDetails.php @@ -21,26 +21,26 @@ class VmwareSourceDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string username = 1; */ - private $username = ''; + protected $username = ''; /** * Input only. The credentials password. This is write only and can not be * read in a GET operation. * * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $password = ''; + protected $password = ''; /** * The ip address of the vcenter this Source represents. * * Generated from protobuf field string vcenter_ip = 3; */ - private $vcenter_ip = ''; + protected $vcenter_ip = ''; /** * The thumbprint representing the certificate for the vcenter. * * Generated from protobuf field string thumbprint = 4; */ - private $thumbprint = ''; + protected $thumbprint = ''; /** * Constructor. diff --git a/VmMigration/src/V1/VmwareVmDetails.php b/VmMigration/src/V1/VmwareVmDetails.php index 425c50c50fda..d35cf1bfd3eb 100644 --- a/VmMigration/src/V1/VmwareVmDetails.php +++ b/VmMigration/src/V1/VmwareVmDetails.php @@ -21,61 +21,61 @@ class VmwareVmDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string vm_id = 1; */ - private $vm_id = ''; + protected $vm_id = ''; /** * The id of the vCenter's datacenter this VM is contained in. * * Generated from protobuf field string datacenter_id = 2; */ - private $datacenter_id = ''; + protected $datacenter_id = ''; /** * The descriptive name of the vCenter's datacenter this VM is contained in. * * Generated from protobuf field string datacenter_description = 3; */ - private $datacenter_description = ''; + protected $datacenter_description = ''; /** * The unique identifier of the VM in vCenter. * * Generated from protobuf field string uuid = 4; */ - private $uuid = ''; + protected $uuid = ''; /** * The display name of the VM. Note that this is not necessarily unique. * * Generated from protobuf field string display_name = 5; */ - private $display_name = ''; + protected $display_name = ''; /** * The power state of the VM at the moment list was taken. * * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareVmDetails.PowerState power_state = 6; */ - private $power_state = 0; + protected $power_state = 0; /** * The number of cpus in the VM. * * Generated from protobuf field int32 cpu_count = 7; */ - private $cpu_count = 0; + protected $cpu_count = 0; /** * The size of the memory of the VM in MB. * * Generated from protobuf field int32 memory_mb = 8; */ - private $memory_mb = 0; + protected $memory_mb = 0; /** * The number of disks the VM has. * * Generated from protobuf field int32 disk_count = 9; */ - private $disk_count = 0; + protected $disk_count = 0; /** * The total size of the storage allocated to the VM in MB. * * Generated from protobuf field int64 committed_storage_mb = 12; */ - private $committed_storage_mb = 0; + protected $committed_storage_mb = 0; /** * The VM's OS. See for example * https://vdc-repo.vmware.com/vmwb-repository/dcr-public/da47f910-60ac-438b-8b9b-6122f4d14524/16b7274a-bf8b-4b4c-a05e-746f2aa93c8c/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html @@ -83,13 +83,13 @@ class VmwareVmDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string guest_description = 11; */ - private $guest_description = ''; + protected $guest_description = ''; /** * Output only. The VM Boot Option. * * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareVmDetails.BootOption boot_option = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $boot_option = 0; + protected $boot_option = 0; /** * Constructor. diff --git a/VmMigration/tests/Unit/V1/Client/VmMigrationClientTest.php b/VmMigration/tests/Unit/V1/Client/VmMigrationClientTest.php index ec429bc784e9..62134d1c851f 100644 --- a/VmMigration/tests/Unit/V1/Client/VmMigrationClientTest.php +++ b/VmMigration/tests/Unit/V1/Client/VmMigrationClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return VmMigrationClient */ @@ -172,8 +174,7 @@ public function addGroupMigrationTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedGroup = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new AddGroupMigrationRequest()) - ->setGroup($formattedGroup); + $request = (new AddGroupMigrationRequest())->setGroup($formattedGroup); $response = $gapicClient->addGroupMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -229,17 +230,19 @@ public function addGroupMigrationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedGroup = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new AddGroupMigrationRequest()) - ->setGroup($formattedGroup); + $request = (new AddGroupMigrationRequest())->setGroup($formattedGroup); $response = $gapicClient->addGroupMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -292,9 +295,14 @@ public function cancelCloneJobTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - $request = (new CancelCloneJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->cloneJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[CLONE_JOB]' + ); + $request = (new CancelCloneJobRequest())->setName($formattedName); $response = $gapicClient->cancelCloneJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -350,17 +358,25 @@ public function cancelCloneJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - $request = (new CancelCloneJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->cloneJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[CLONE_JOB]' + ); + $request = (new CancelCloneJobRequest())->setName($formattedName); $response = $gapicClient->cancelCloneJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -413,9 +429,14 @@ public function cancelCutoverJobTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - $request = (new CancelCutoverJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->cutoverJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[CUTOVER_JOB]' + ); + $request = (new CancelCutoverJobRequest())->setName($formattedName); $response = $gapicClient->cancelCutoverJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -471,17 +492,25 @@ public function cancelCutoverJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - $request = (new CancelCutoverJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->cutoverJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[CUTOVER_JOB]' + ); + $request = (new CancelCutoverJobRequest())->setName($formattedName); $response = $gapicClient->cancelCutoverJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -602,12 +631,15 @@ public function createCloneJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); @@ -741,12 +773,15 @@ public function createCutoverJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); @@ -888,12 +923,15 @@ public function createDatacenterConnectorExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); @@ -1027,12 +1065,15 @@ public function createGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -1170,12 +1211,15 @@ public function createMigratingVmExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); @@ -1307,12 +1351,15 @@ public function createSourceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -1446,12 +1493,15 @@ public function createTargetProjectExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -1585,12 +1635,15 @@ public function createUtilizationReportExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); @@ -1652,9 +1705,13 @@ public function deleteDatacenterConnectorTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $request = (new DeleteDatacenterConnectorRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->datacenterConnectorName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DATACENTER_CONNECTOR]' + ); + $request = (new DeleteDatacenterConnectorRequest())->setName($formattedName); $response = $gapicClient->deleteDatacenterConnector($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1710,17 +1767,24 @@ public function deleteDatacenterConnectorExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $request = (new DeleteDatacenterConnectorRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->datacenterConnectorName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DATACENTER_CONNECTOR]' + ); + $request = (new DeleteDatacenterConnectorRequest())->setName($formattedName); $response = $gapicClient->deleteDatacenterConnector($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1774,8 +1838,7 @@ public function deleteGroupTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new DeleteGroupRequest()) - ->setName($formattedName); + $request = (new DeleteGroupRequest())->setName($formattedName); $response = $gapicClient->deleteGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1831,17 +1894,19 @@ public function deleteGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new DeleteGroupRequest()) - ->setName($formattedName); + $request = (new DeleteGroupRequest())->setName($formattedName); $response = $gapicClient->deleteGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1895,8 +1960,7 @@ public function deleteMigratingVmTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new DeleteMigratingVmRequest()) - ->setName($formattedName); + $request = (new DeleteMigratingVmRequest())->setName($formattedName); $response = $gapicClient->deleteMigratingVm($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1952,17 +2016,19 @@ public function deleteMigratingVmExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new DeleteMigratingVmRequest()) - ->setName($formattedName); + $request = (new DeleteMigratingVmRequest())->setName($formattedName); $response = $gapicClient->deleteMigratingVm($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2016,8 +2082,7 @@ public function deleteSourceTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new DeleteSourceRequest()) - ->setName($formattedName); + $request = (new DeleteSourceRequest())->setName($formattedName); $response = $gapicClient->deleteSource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2073,17 +2138,19 @@ public function deleteSourceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new DeleteSourceRequest()) - ->setName($formattedName); + $request = (new DeleteSourceRequest())->setName($formattedName); $response = $gapicClient->deleteSource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2137,8 +2204,7 @@ public function deleteTargetProjectTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - $request = (new DeleteTargetProjectRequest()) - ->setName($formattedName); + $request = (new DeleteTargetProjectRequest())->setName($formattedName); $response = $gapicClient->deleteTargetProject($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2194,17 +2260,19 @@ public function deleteTargetProjectExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - $request = (new DeleteTargetProjectRequest()) - ->setName($formattedName); + $request = (new DeleteTargetProjectRequest())->setName($formattedName); $response = $gapicClient->deleteTargetProject($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2257,9 +2325,13 @@ public function deleteUtilizationReportTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - $request = (new DeleteUtilizationReportRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->utilizationReportName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[UTILIZATION_REPORT]' + ); + $request = (new DeleteUtilizationReportRequest())->setName($formattedName); $response = $gapicClient->deleteUtilizationReport($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2315,17 +2387,24 @@ public function deleteUtilizationReportExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - $request = (new DeleteUtilizationReportRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->utilizationReportName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[UTILIZATION_REPORT]' + ); + $request = (new DeleteUtilizationReportRequest())->setName($formattedName); $response = $gapicClient->deleteUtilizationReport($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2361,8 +2440,7 @@ public function fetchInventoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new FetchInventoryRequest()) - ->setSource($formattedSource); + $request = (new FetchInventoryRequest())->setSource($formattedSource); $response = $gapicClient->fetchInventory($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2386,17 +2464,19 @@ public function fetchInventoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new FetchInventoryRequest()) - ->setSource($formattedSource); + $request = (new FetchInventoryRequest())->setSource($formattedSource); try { $gapicClient->fetchInventory($request); // If the $gapicClient method call did not throw, fail the test @@ -2441,8 +2521,7 @@ public function finalizeMigrationTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new FinalizeMigrationRequest()) - ->setMigratingVm($formattedMigratingVm); + $request = (new FinalizeMigrationRequest())->setMigratingVm($formattedMigratingVm); $response = $gapicClient->finalizeMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2498,17 +2577,19 @@ public function finalizeMigrationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new FinalizeMigrationRequest()) - ->setMigratingVm($formattedMigratingVm); + $request = (new FinalizeMigrationRequest())->setMigratingVm($formattedMigratingVm); $response = $gapicClient->finalizeMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2545,9 +2626,14 @@ public function getCloneJobTest() $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - $request = (new GetCloneJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->cloneJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[CLONE_JOB]' + ); + $request = (new GetCloneJobRequest())->setName($formattedName); $response = $gapicClient->getCloneJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2571,17 +2657,25 @@ public function getCloneJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - $request = (new GetCloneJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->cloneJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[CLONE_JOB]' + ); + $request = (new GetCloneJobRequest())->setName($formattedName); try { $gapicClient->getCloneJob($request); // If the $gapicClient method call did not throw, fail the test @@ -2613,9 +2707,14 @@ public function getCutoverJobTest() $expectedResponse->setStateMessage($stateMessage); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - $request = (new GetCutoverJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->cutoverJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[CUTOVER_JOB]' + ); + $request = (new GetCutoverJobRequest())->setName($formattedName); $response = $gapicClient->getCutoverJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2639,17 +2738,25 @@ public function getCutoverJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - $request = (new GetCutoverJobRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->cutoverJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[CUTOVER_JOB]' + ); + $request = (new GetCutoverJobRequest())->setName($formattedName); try { $gapicClient->getCutoverJob($request); // If the $gapicClient method call did not throw, fail the test @@ -2689,9 +2796,13 @@ public function getDatacenterConnectorTest() $expectedResponse->setApplianceSoftwareVersion($applianceSoftwareVersion); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $request = (new GetDatacenterConnectorRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->datacenterConnectorName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DATACENTER_CONNECTOR]' + ); + $request = (new GetDatacenterConnectorRequest())->setName($formattedName); $response = $gapicClient->getDatacenterConnector($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2715,17 +2826,24 @@ public function getDatacenterConnectorExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $request = (new GetDatacenterConnectorRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->datacenterConnectorName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DATACENTER_CONNECTOR]' + ); + $request = (new GetDatacenterConnectorRequest())->setName($formattedName); try { $gapicClient->getDatacenterConnector($request); // If the $gapicClient method call did not throw, fail the test @@ -2758,8 +2876,7 @@ public function getGroupTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new GetGroupRequest()) - ->setName($formattedName); + $request = (new GetGroupRequest())->setName($formattedName); $response = $gapicClient->getGroup($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2783,17 +2900,19 @@ public function getGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new GetGroupRequest()) - ->setName($formattedName); + $request = (new GetGroupRequest())->setName($formattedName); try { $gapicClient->getGroup($request); // If the $gapicClient method call did not throw, fail the test @@ -2830,8 +2949,7 @@ public function getMigratingVmTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new GetMigratingVmRequest()) - ->setName($formattedName); + $request = (new GetMigratingVmRequest())->setName($formattedName); $response = $gapicClient->getMigratingVm($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2855,17 +2973,19 @@ public function getMigratingVmExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new GetMigratingVmRequest()) - ->setName($formattedName); + $request = (new GetMigratingVmRequest())->setName($formattedName); try { $gapicClient->getMigratingVm($request); // If the $gapicClient method call did not throw, fail the test @@ -2897,9 +3017,14 @@ public function getReplicationCycleTest() $expectedResponse->setProgressPercent($progressPercent); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->replicationCycleName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[REPLICATION_CYCLE]'); - $request = (new GetReplicationCycleRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->replicationCycleName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[REPLICATION_CYCLE]' + ); + $request = (new GetReplicationCycleRequest())->setName($formattedName); $response = $gapicClient->getReplicationCycle($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2923,17 +3048,25 @@ public function getReplicationCycleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->replicationCycleName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[REPLICATION_CYCLE]'); - $request = (new GetReplicationCycleRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->replicationCycleName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', + '[REPLICATION_CYCLE]' + ); + $request = (new GetReplicationCycleRequest())->setName($formattedName); try { $gapicClient->getReplicationCycle($request); // If the $gapicClient method call did not throw, fail the test @@ -2964,8 +3097,7 @@ public function getSourceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new GetSourceRequest()) - ->setName($formattedName); + $request = (new GetSourceRequest())->setName($formattedName); $response = $gapicClient->getSource($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2989,17 +3121,19 @@ public function getSourceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new GetSourceRequest()) - ->setName($formattedName); + $request = (new GetSourceRequest())->setName($formattedName); try { $gapicClient->getSource($request); // If the $gapicClient method call did not throw, fail the test @@ -3032,8 +3166,7 @@ public function getTargetProjectTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - $request = (new GetTargetProjectRequest()) - ->setName($formattedName); + $request = (new GetTargetProjectRequest())->setName($formattedName); $response = $gapicClient->getTargetProject($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3057,17 +3190,19 @@ public function getTargetProjectExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - $request = (new GetTargetProjectRequest()) - ->setName($formattedName); + $request = (new GetTargetProjectRequest())->setName($formattedName); try { $gapicClient->getTargetProject($request); // If the $gapicClient method call did not throw, fail the test @@ -3099,9 +3234,13 @@ public function getUtilizationReportTest() $expectedResponse->setVmCount($vmCount); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - $request = (new GetUtilizationReportRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->utilizationReportName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[UTILIZATION_REPORT]' + ); + $request = (new GetUtilizationReportRequest())->setName($formattedName); $response = $gapicClient->getUtilizationReport($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3125,17 +3264,24 @@ public function getUtilizationReportExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - $request = (new GetUtilizationReportRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->utilizationReportName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[UTILIZATION_REPORT]' + ); + $request = (new GetUtilizationReportRequest())->setName($formattedName); try { $gapicClient->getUtilizationReport($request); // If the $gapicClient method call did not throw, fail the test @@ -3160,9 +3306,7 @@ public function listCloneJobsTest() // Mock response $nextPageToken = ''; $cloneJobsElement = new CloneJob(); - $cloneJobs = [ - $cloneJobsElement, - ]; + $cloneJobs = [$cloneJobsElement]; $expectedResponse = new ListCloneJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCloneJobs($cloneJobs); @@ -3170,9 +3314,7 @@ public function listCloneJobsTest() // Mock request $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); $pageToken = 'pageToken1630607433'; - $request = (new ListCloneJobsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListCloneJobsRequest())->setParent($formattedParent)->setPageToken($pageToken); $response = $gapicClient->listCloneJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3201,19 +3343,20 @@ public function listCloneJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); $pageToken = 'pageToken1630607433'; - $request = (new ListCloneJobsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListCloneJobsRequest())->setParent($formattedParent)->setPageToken($pageToken); try { $gapicClient->listCloneJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -3238,9 +3381,7 @@ public function listCutoverJobsTest() // Mock response $nextPageToken = ''; $cutoverJobsElement = new CutoverJob(); - $cutoverJobs = [ - $cutoverJobsElement, - ]; + $cutoverJobs = [$cutoverJobsElement]; $expectedResponse = new ListCutoverJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCutoverJobs($cutoverJobs); @@ -3248,9 +3389,7 @@ public function listCutoverJobsTest() // Mock request $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); $pageToken = 'pageToken1630607433'; - $request = (new ListCutoverJobsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListCutoverJobsRequest())->setParent($formattedParent)->setPageToken($pageToken); $response = $gapicClient->listCutoverJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3279,19 +3418,20 @@ public function listCutoverJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); $pageToken = 'pageToken1630607433'; - $request = (new ListCutoverJobsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListCutoverJobsRequest())->setParent($formattedParent)->setPageToken($pageToken); try { $gapicClient->listCutoverJobs($request); // If the $gapicClient method call did not throw, fail the test @@ -3316,9 +3456,7 @@ public function listDatacenterConnectorsTest() // Mock response $nextPageToken = ''; $datacenterConnectorsElement = new DatacenterConnector(); - $datacenterConnectors = [ - $datacenterConnectorsElement, - ]; + $datacenterConnectors = [$datacenterConnectorsElement]; $expectedResponse = new ListDatacenterConnectorsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDatacenterConnectors($datacenterConnectors); @@ -3326,9 +3464,7 @@ public function listDatacenterConnectorsTest() // Mock request $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); $pageToken = 'pageToken1630607433'; - $request = (new ListDatacenterConnectorsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListDatacenterConnectorsRequest())->setParent($formattedParent)->setPageToken($pageToken); $response = $gapicClient->listDatacenterConnectors($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3357,19 +3493,20 @@ public function listDatacenterConnectorsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); $pageToken = 'pageToken1630607433'; - $request = (new ListDatacenterConnectorsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListDatacenterConnectorsRequest())->setParent($formattedParent)->setPageToken($pageToken); try { $gapicClient->listDatacenterConnectors($request); // If the $gapicClient method call did not throw, fail the test @@ -3394,9 +3531,7 @@ public function listGroupsTest() // Mock response $nextPageToken = ''; $groupsElement = new Group(); - $groups = [ - $groupsElement, - ]; + $groups = [$groupsElement]; $expectedResponse = new ListGroupsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setGroups($groups); @@ -3404,9 +3539,7 @@ public function listGroupsTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pageToken = 'pageToken1630607433'; - $request = (new ListGroupsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListGroupsRequest())->setParent($formattedParent)->setPageToken($pageToken); $response = $gapicClient->listGroups($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3435,19 +3568,20 @@ public function listGroupsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pageToken = 'pageToken1630607433'; - $request = (new ListGroupsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListGroupsRequest())->setParent($formattedParent)->setPageToken($pageToken); try { $gapicClient->listGroups($request); // If the $gapicClient method call did not throw, fail the test @@ -3472,9 +3606,7 @@ public function listMigratingVmsTest() // Mock response $nextPageToken = ''; $migratingVmsElement = new MigratingVm(); - $migratingVms = [ - $migratingVmsElement, - ]; + $migratingVms = [$migratingVmsElement]; $expectedResponse = new ListMigratingVmsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMigratingVms($migratingVms); @@ -3482,9 +3614,7 @@ public function listMigratingVmsTest() // Mock request $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); $pageToken = 'pageToken1630607433'; - $request = (new ListMigratingVmsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListMigratingVmsRequest())->setParent($formattedParent)->setPageToken($pageToken); $response = $gapicClient->listMigratingVms($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3513,19 +3643,20 @@ public function listMigratingVmsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); $pageToken = 'pageToken1630607433'; - $request = (new ListMigratingVmsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListMigratingVmsRequest())->setParent($formattedParent)->setPageToken($pageToken); try { $gapicClient->listMigratingVms($request); // If the $gapicClient method call did not throw, fail the test @@ -3550,9 +3681,7 @@ public function listReplicationCyclesTest() // Mock response $nextPageToken = ''; $replicationCyclesElement = new ReplicationCycle(); - $replicationCycles = [ - $replicationCyclesElement, - ]; + $replicationCycles = [$replicationCyclesElement]; $expectedResponse = new ListReplicationCyclesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setReplicationCycles($replicationCycles); @@ -3560,9 +3689,7 @@ public function listReplicationCyclesTest() // Mock request $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); $pageToken = 'pageToken1630607433'; - $request = (new ListReplicationCyclesRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListReplicationCyclesRequest())->setParent($formattedParent)->setPageToken($pageToken); $response = $gapicClient->listReplicationCycles($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3591,19 +3718,20 @@ public function listReplicationCyclesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); $pageToken = 'pageToken1630607433'; - $request = (new ListReplicationCyclesRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListReplicationCyclesRequest())->setParent($formattedParent)->setPageToken($pageToken); try { $gapicClient->listReplicationCycles($request); // If the $gapicClient method call did not throw, fail the test @@ -3628,9 +3756,7 @@ public function listSourcesTest() // Mock response $nextPageToken = ''; $sourcesElement = new Source(); - $sources = [ - $sourcesElement, - ]; + $sources = [$sourcesElement]; $expectedResponse = new ListSourcesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSources($sources); @@ -3638,9 +3764,7 @@ public function listSourcesTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pageToken = 'pageToken1630607433'; - $request = (new ListSourcesRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListSourcesRequest())->setParent($formattedParent)->setPageToken($pageToken); $response = $gapicClient->listSources($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3669,19 +3793,20 @@ public function listSourcesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pageToken = 'pageToken1630607433'; - $request = (new ListSourcesRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListSourcesRequest())->setParent($formattedParent)->setPageToken($pageToken); try { $gapicClient->listSources($request); // If the $gapicClient method call did not throw, fail the test @@ -3706,9 +3831,7 @@ public function listTargetProjectsTest() // Mock response $nextPageToken = ''; $targetProjectsElement = new TargetProject(); - $targetProjects = [ - $targetProjectsElement, - ]; + $targetProjects = [$targetProjectsElement]; $expectedResponse = new ListTargetProjectsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTargetProjects($targetProjects); @@ -3716,9 +3839,7 @@ public function listTargetProjectsTest() // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pageToken = 'pageToken1630607433'; - $request = (new ListTargetProjectsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListTargetProjectsRequest())->setParent($formattedParent)->setPageToken($pageToken); $response = $gapicClient->listTargetProjects($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3747,19 +3868,20 @@ public function listTargetProjectsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pageToken = 'pageToken1630607433'; - $request = (new ListTargetProjectsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListTargetProjectsRequest())->setParent($formattedParent)->setPageToken($pageToken); try { $gapicClient->listTargetProjects($request); // If the $gapicClient method call did not throw, fail the test @@ -3784,9 +3906,7 @@ public function listUtilizationReportsTest() // Mock response $nextPageToken = ''; $utilizationReportsElement = new UtilizationReport(); - $utilizationReports = [ - $utilizationReportsElement, - ]; + $utilizationReports = [$utilizationReportsElement]; $expectedResponse = new ListUtilizationReportsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setUtilizationReports($utilizationReports); @@ -3794,9 +3914,7 @@ public function listUtilizationReportsTest() // Mock request $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); $pageToken = 'pageToken1630607433'; - $request = (new ListUtilizationReportsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListUtilizationReportsRequest())->setParent($formattedParent)->setPageToken($pageToken); $response = $gapicClient->listUtilizationReports($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3825,19 +3943,20 @@ public function listUtilizationReportsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); $pageToken = 'pageToken1630607433'; - $request = (new ListUtilizationReportsRequest()) - ->setParent($formattedParent) - ->setPageToken($pageToken); + $request = (new ListUtilizationReportsRequest())->setParent($formattedParent)->setPageToken($pageToken); try { $gapicClient->listUtilizationReports($request); // If the $gapicClient method call did not throw, fail the test @@ -3882,8 +4001,7 @@ public function pauseMigrationTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new PauseMigrationRequest()) - ->setMigratingVm($formattedMigratingVm); + $request = (new PauseMigrationRequest())->setMigratingVm($formattedMigratingVm); $response = $gapicClient->pauseMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3939,17 +4057,19 @@ public function pauseMigrationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new PauseMigrationRequest()) - ->setMigratingVm($formattedMigratingVm); + $request = (new PauseMigrationRequest())->setMigratingVm($formattedMigratingVm); $response = $gapicClient->pauseMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4003,8 +4123,7 @@ public function removeGroupMigrationTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedGroup = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new RemoveGroupMigrationRequest()) - ->setGroup($formattedGroup); + $request = (new RemoveGroupMigrationRequest())->setGroup($formattedGroup); $response = $gapicClient->removeGroupMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4060,17 +4179,19 @@ public function removeGroupMigrationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedGroup = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new RemoveGroupMigrationRequest()) - ->setGroup($formattedGroup); + $request = (new RemoveGroupMigrationRequest())->setGroup($formattedGroup); $response = $gapicClient->removeGroupMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4124,8 +4245,7 @@ public function resumeMigrationTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new ResumeMigrationRequest()) - ->setMigratingVm($formattedMigratingVm); + $request = (new ResumeMigrationRequest())->setMigratingVm($formattedMigratingVm); $response = $gapicClient->resumeMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4181,17 +4301,19 @@ public function resumeMigrationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new ResumeMigrationRequest()) - ->setMigratingVm($formattedMigratingVm); + $request = (new ResumeMigrationRequest())->setMigratingVm($formattedMigratingVm); $response = $gapicClient->resumeMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4245,8 +4367,7 @@ public function startMigrationTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new StartMigrationRequest()) - ->setMigratingVm($formattedMigratingVm); + $request = (new StartMigrationRequest())->setMigratingVm($formattedMigratingVm); $response = $gapicClient->startMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4302,17 +4423,19 @@ public function startMigrationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new StartMigrationRequest()) - ->setMigratingVm($formattedMigratingVm); + $request = (new StartMigrationRequest())->setMigratingVm($formattedMigratingVm); $response = $gapicClient->startMigration($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4372,8 +4495,7 @@ public function updateGroupTest() $operationsTransport->addResponse($completeOperation); // Mock request $group = new Group(); - $request = (new UpdateGroupRequest()) - ->setGroup($group); + $request = (new UpdateGroupRequest())->setGroup($group); $response = $gapicClient->updateGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4429,17 +4551,19 @@ public function updateGroupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $group = new Group(); - $request = (new UpdateGroupRequest()) - ->setGroup($group); + $request = (new UpdateGroupRequest())->setGroup($group); $response = $gapicClient->updateGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4503,8 +4627,7 @@ public function updateMigratingVmTest() $operationsTransport->addResponse($completeOperation); // Mock request $migratingVm = new MigratingVm(); - $request = (new UpdateMigratingVmRequest()) - ->setMigratingVm($migratingVm); + $request = (new UpdateMigratingVmRequest())->setMigratingVm($migratingVm); $response = $gapicClient->updateMigratingVm($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4560,17 +4683,19 @@ public function updateMigratingVmExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $migratingVm = new MigratingVm(); - $request = (new UpdateMigratingVmRequest()) - ->setMigratingVm($migratingVm); + $request = (new UpdateMigratingVmRequest())->setMigratingVm($migratingVm); $response = $gapicClient->updateMigratingVm($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4628,8 +4753,7 @@ public function updateSourceTest() $operationsTransport->addResponse($completeOperation); // Mock request $source = new Source(); - $request = (new UpdateSourceRequest()) - ->setSource($source); + $request = (new UpdateSourceRequest())->setSource($source); $response = $gapicClient->updateSource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4685,17 +4809,19 @@ public function updateSourceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $source = new Source(); - $request = (new UpdateSourceRequest()) - ->setSource($source); + $request = (new UpdateSourceRequest())->setSource($source); $response = $gapicClient->updateSource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4755,8 +4881,7 @@ public function updateTargetProjectTest() $operationsTransport->addResponse($completeOperation); // Mock request $targetProject = new TargetProject(); - $request = (new UpdateTargetProjectRequest()) - ->setTargetProject($targetProject); + $request = (new UpdateTargetProjectRequest())->setTargetProject($targetProject); $response = $gapicClient->updateTargetProject($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4812,17 +4937,19 @@ public function updateTargetProjectExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $targetProject = new TargetProject(); - $request = (new UpdateTargetProjectRequest()) - ->setTargetProject($targetProject); + $request = (new UpdateTargetProjectRequest())->setTargetProject($targetProject); $response = $gapicClient->updateTargetProject($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4875,9 +5002,13 @@ public function upgradeApplianceTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedDatacenterConnector = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $request = (new UpgradeApplianceRequest()) - ->setDatacenterConnector($formattedDatacenterConnector); + $formattedDatacenterConnector = $gapicClient->datacenterConnectorName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DATACENTER_CONNECTOR]' + ); + $request = (new UpgradeApplianceRequest())->setDatacenterConnector($formattedDatacenterConnector); $response = $gapicClient->upgradeAppliance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -4933,17 +5064,24 @@ public function upgradeApplianceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedDatacenterConnector = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $request = (new UpgradeApplianceRequest()) - ->setDatacenterConnector($formattedDatacenterConnector); + $formattedDatacenterConnector = $gapicClient->datacenterConnectorName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DATACENTER_CONNECTOR]' + ); + $request = (new UpgradeApplianceRequest())->setDatacenterConnector($formattedDatacenterConnector); $response = $gapicClient->upgradeAppliance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -5005,12 +5143,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -5037,9 +5178,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -5069,12 +5208,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -5121,8 +5263,7 @@ public function addGroupMigrationAsyncTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedGroup = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new AddGroupMigrationRequest()) - ->setGroup($formattedGroup); + $request = (new AddGroupMigrationRequest())->setGroup($formattedGroup); $response = $gapicClient->addGroupMigrationAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/VmMigration/tests/Unit/V1/VmMigrationClientTest.php b/VmMigration/tests/Unit/V1/VmMigrationClientTest.php deleted file mode 100644 index f7641dc6ddc8..000000000000 --- a/VmMigration/tests/Unit/V1/VmMigrationClientTest.php +++ /dev/null @@ -1,4806 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return VmMigrationClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new VmMigrationClient($options); - } - - /** @test */ - public function addGroupMigrationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/addGroupMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AddGroupMigrationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/addGroupMigrationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedGroup = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $response = $gapicClient->addGroupMigration($formattedGroup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/AddGroupMigration', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getGroup(); - $this->assertProtobufEquals($formattedGroup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/addGroupMigrationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function addGroupMigrationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/addGroupMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedGroup = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $response = $gapicClient->addGroupMigration($formattedGroup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/addGroupMigrationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function cancelCloneJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/cancelCloneJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new CancelCloneJobResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/cancelCloneJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - $response = $gapicClient->cancelCloneJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CancelCloneJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/cancelCloneJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function cancelCloneJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/cancelCloneJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - $response = $gapicClient->cancelCloneJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/cancelCloneJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function cancelCutoverJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/cancelCutoverJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new CancelCutoverJobResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/cancelCutoverJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - $response = $gapicClient->cancelCutoverJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CancelCutoverJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/cancelCutoverJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function cancelCutoverJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/cancelCutoverJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - $response = $gapicClient->cancelCutoverJob($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/cancelCutoverJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createCloneJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createCloneJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new CloneJob(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createCloneJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $cloneJobId = 'cloneJobId-1008685569'; - $cloneJob = new CloneJob(); - $response = $gapicClient->createCloneJob($formattedParent, $cloneJobId, $cloneJob); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateCloneJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getCloneJobId(); - $this->assertProtobufEquals($cloneJobId, $actualValue); - $actualValue = $actualApiRequestObject->getCloneJob(); - $this->assertProtobufEquals($cloneJob, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createCloneJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createCloneJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createCloneJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $cloneJobId = 'cloneJobId-1008685569'; - $cloneJob = new CloneJob(); - $response = $gapicClient->createCloneJob($formattedParent, $cloneJobId, $cloneJob); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createCloneJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createCutoverJobTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createCutoverJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $progressPercent = 2137894861; - $stateMessage = 'stateMessage29641305'; - $expectedResponse = new CutoverJob(); - $expectedResponse->setName($name); - $expectedResponse->setProgressPercent($progressPercent); - $expectedResponse->setStateMessage($stateMessage); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createCutoverJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $cutoverJobId = 'cutoverJobId504048422'; - $cutoverJob = new CutoverJob(); - $response = $gapicClient->createCutoverJob($formattedParent, $cutoverJobId, $cutoverJob); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateCutoverJob', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getCutoverJobId(); - $this->assertProtobufEquals($cutoverJobId, $actualValue); - $actualValue = $actualApiRequestObject->getCutoverJob(); - $this->assertProtobufEquals($cutoverJob, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createCutoverJobTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createCutoverJobExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createCutoverJobTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $cutoverJobId = 'cutoverJobId504048422'; - $cutoverJob = new CutoverJob(); - $response = $gapicClient->createCutoverJob($formattedParent, $cutoverJobId, $cutoverJob); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createCutoverJobTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDatacenterConnectorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatacenterConnectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $registrationId = 'registrationId-412573087'; - $serviceAccount = 'serviceAccount-1948028253'; - $version = 'version351608024'; - $bucket = 'bucket-1378203158'; - $applianceInfrastructureVersion = 'applianceInfrastructureVersion662625550'; - $applianceSoftwareVersion = 'applianceSoftwareVersion-641402222'; - $expectedResponse = new DatacenterConnector(); - $expectedResponse->setName($name); - $expectedResponse->setRegistrationId($registrationId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setVersion($version); - $expectedResponse->setBucket($bucket); - $expectedResponse->setApplianceInfrastructureVersion($applianceInfrastructureVersion); - $expectedResponse->setApplianceSoftwareVersion($applianceSoftwareVersion); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDatacenterConnectorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $datacenterConnectorId = 'datacenterConnectorId1629428237'; - $datacenterConnector = new DatacenterConnector(); - $response = $gapicClient->createDatacenterConnector($formattedParent, $datacenterConnectorId, $datacenterConnector); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateDatacenterConnector', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDatacenterConnectorId(); - $this->assertProtobufEquals($datacenterConnectorId, $actualValue); - $actualValue = $actualApiRequestObject->getDatacenterConnector(); - $this->assertProtobufEquals($datacenterConnector, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatacenterConnectorTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDatacenterConnectorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatacenterConnectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $datacenterConnectorId = 'datacenterConnectorId1629428237'; - $datacenterConnector = new DatacenterConnector(); - $response = $gapicClient->createDatacenterConnector($formattedParent, $datacenterConnectorId, $datacenterConnector); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatacenterConnectorTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createGroupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Group(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createGroupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $groupId = 'groupId506361563'; - $group = new Group(); - $response = $gapicClient->createGroup($formattedParent, $groupId, $group); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateGroup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getGroupId(); - $this->assertProtobufEquals($groupId, $actualValue); - $actualValue = $actualApiRequestObject->getGroup(); - $this->assertProtobufEquals($group, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createGroupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createGroupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $groupId = 'groupId506361563'; - $group = new Group(); - $response = $gapicClient->createGroup($formattedParent, $groupId, $group); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createGroupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMigratingVmTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMigratingVmTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $sourceVmId = 'sourceVmId1673059967'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $group = 'group98629247'; - $expectedResponse = new MigratingVm(); - $expectedResponse->setName($name); - $expectedResponse->setSourceVmId($sourceVmId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setGroup($group); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createMigratingVmTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $migratingVmId = 'migratingVmId-899085236'; - $migratingVm = new MigratingVm(); - $response = $gapicClient->createMigratingVm($formattedParent, $migratingVmId, $migratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateMigratingVm', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getMigratingVmId(); - $this->assertProtobufEquals($migratingVmId, $actualValue); - $actualValue = $actualApiRequestObject->getMigratingVm(); - $this->assertProtobufEquals($migratingVm, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMigratingVmTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMigratingVmExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMigratingVmTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $migratingVmId = 'migratingVmId-899085236'; - $migratingVm = new MigratingVm(); - $response = $gapicClient->createMigratingVm($formattedParent, $migratingVmId, $migratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMigratingVmTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createSourceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createSourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Source(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSourceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $sourceId = 'sourceId-1698410561'; - $source = new Source(); - $response = $gapicClient->createSource($formattedParent, $sourceId, $source); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateSource', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getSourceId(); - $this->assertProtobufEquals($sourceId, $actualValue); - $actualValue = $actualApiRequestObject->getSource(); - $this->assertProtobufEquals($source, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSourceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createSourceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createSourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $sourceId = 'sourceId-1698410561'; - $source = new Source(); - $response = $gapicClient->createSource($formattedParent, $sourceId, $source); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSourceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTargetProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTargetProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $project = 'project-309310695'; - $description = 'description-1724546052'; - $expectedResponse = new TargetProject(); - $expectedResponse->setName($name); - $expectedResponse->setProject($project); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTargetProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $targetProjectId = 'targetProjectId1255314287'; - $targetProject = new TargetProject(); - $response = $gapicClient->createTargetProject($formattedParent, $targetProjectId, $targetProject); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateTargetProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTargetProjectId(); - $this->assertProtobufEquals($targetProjectId, $actualValue); - $actualValue = $actualApiRequestObject->getTargetProject(); - $this->assertProtobufEquals($targetProject, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTargetProjectTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTargetProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTargetProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $targetProjectId = 'targetProjectId1255314287'; - $targetProject = new TargetProject(); - $response = $gapicClient->createTargetProject($formattedParent, $targetProjectId, $targetProject); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTargetProjectTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createUtilizationReportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createUtilizationReportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $vmCount = 261463431; - $expectedResponse = new UtilizationReport(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setVmCount($vmCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createUtilizationReportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $utilizationReport = new UtilizationReport(); - $utilizationReportId = 'utilizationReportId-1346894295'; - $response = $gapicClient->createUtilizationReport($formattedParent, $utilizationReport, $utilizationReportId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateUtilizationReport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getUtilizationReport(); - $this->assertProtobufEquals($utilizationReport, $actualValue); - $actualValue = $actualApiRequestObject->getUtilizationReportId(); - $this->assertProtobufEquals($utilizationReportId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createUtilizationReportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createUtilizationReportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createUtilizationReportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $utilizationReport = new UtilizationReport(); - $utilizationReportId = 'utilizationReportId-1346894295'; - $response = $gapicClient->createUtilizationReport($formattedParent, $utilizationReport, $utilizationReportId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createUtilizationReportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatacenterConnectorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatacenterConnectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDatacenterConnectorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $response = $gapicClient->deleteDatacenterConnector($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteDatacenterConnector', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatacenterConnectorTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatacenterConnectorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatacenterConnectorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $response = $gapicClient->deleteDatacenterConnector($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatacenterConnectorTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteGroupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteGroupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $response = $gapicClient->deleteGroup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteGroup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteGroupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteGroupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $response = $gapicClient->deleteGroup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteGroupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteMigratingVmTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteMigratingVmTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteMigratingVmTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->deleteMigratingVm($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteMigratingVm', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteMigratingVmTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteMigratingVmExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteMigratingVmTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->deleteMigratingVm($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteMigratingVmTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteSourceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteSourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteSourceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $response = $gapicClient->deleteSource($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteSource', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteSourceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteSourceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteSourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $response = $gapicClient->deleteSource($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteSourceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTargetProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTargetProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - $response = $gapicClient->deleteTargetProject($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteTargetProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetProjectTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTargetProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - $response = $gapicClient->deleteTargetProject($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetProjectTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteUtilizationReportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteUtilizationReportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteUtilizationReportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - $response = $gapicClient->deleteUtilizationReport($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteUtilizationReport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteUtilizationReportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteUtilizationReportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteUtilizationReportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - $response = $gapicClient->deleteUtilizationReport($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteUtilizationReportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function fetchInventoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FetchInventoryResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $response = $gapicClient->fetchInventory($formattedSource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/FetchInventory', $actualFuncCall); - $actualValue = $actualRequestObject->getSource(); - $this->assertProtobufEquals($formattedSource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchInventoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - try { - $gapicClient->fetchInventory($formattedSource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function finalizeMigrationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/finalizeMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new FinalizeMigrationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/finalizeMigrationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->finalizeMigration($formattedMigratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/FinalizeMigration', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getMigratingVm(); - $this->assertProtobufEquals($formattedMigratingVm, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/finalizeMigrationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function finalizeMigrationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/finalizeMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->finalizeMigration($formattedMigratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/finalizeMigrationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getCloneJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new CloneJob(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - $response = $gapicClient->getCloneJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetCloneJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCloneJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->cloneJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CLONE_JOB]'); - try { - $gapicClient->getCloneJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCutoverJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $progressPercent = 2137894861; - $stateMessage = 'stateMessage29641305'; - $expectedResponse = new CutoverJob(); - $expectedResponse->setName($name2); - $expectedResponse->setProgressPercent($progressPercent); - $expectedResponse->setStateMessage($stateMessage); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - $response = $gapicClient->getCutoverJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetCutoverJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCutoverJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->cutoverJobName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[CUTOVER_JOB]'); - try { - $gapicClient->getCutoverJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDatacenterConnectorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $registrationId = 'registrationId-412573087'; - $serviceAccount = 'serviceAccount-1948028253'; - $version = 'version351608024'; - $bucket = 'bucket-1378203158'; - $applianceInfrastructureVersion = 'applianceInfrastructureVersion662625550'; - $applianceSoftwareVersion = 'applianceSoftwareVersion-641402222'; - $expectedResponse = new DatacenterConnector(); - $expectedResponse->setName($name2); - $expectedResponse->setRegistrationId($registrationId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setVersion($version); - $expectedResponse->setBucket($bucket); - $expectedResponse->setApplianceInfrastructureVersion($applianceInfrastructureVersion); - $expectedResponse->setApplianceSoftwareVersion($applianceSoftwareVersion); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $response = $gapicClient->getDatacenterConnector($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetDatacenterConnector', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDatacenterConnectorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - try { - $gapicClient->getDatacenterConnector($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getGroupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Group(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $response = $gapicClient->getGroup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetGroup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getGroupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - try { - $gapicClient->getGroup($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMigratingVmTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $sourceVmId = 'sourceVmId1673059967'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $group = 'group98629247'; - $expectedResponse = new MigratingVm(); - $expectedResponse->setName($name2); - $expectedResponse->setSourceVmId($sourceVmId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setGroup($group); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->getMigratingVm($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetMigratingVm', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMigratingVmExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - try { - $gapicClient->getMigratingVm($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getReplicationCycleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $cycleNumber = 1095724862; - $progressPercent = 2137894861; - $expectedResponse = new ReplicationCycle(); - $expectedResponse->setName($name2); - $expectedResponse->setCycleNumber($cycleNumber); - $expectedResponse->setProgressPercent($progressPercent); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->replicationCycleName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[REPLICATION_CYCLE]'); - $response = $gapicClient->getReplicationCycle($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetReplicationCycle', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getReplicationCycleExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->replicationCycleName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]', '[REPLICATION_CYCLE]'); - try { - $gapicClient->getReplicationCycle($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSourceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Source(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $response = $gapicClient->getSource($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetSource', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSourceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - try { - $gapicClient->getSource($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTargetProjectTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $project = 'project-309310695'; - $description = 'description-1724546052'; - $expectedResponse = new TargetProject(); - $expectedResponse->setName($name2); - $expectedResponse->setProject($project); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - $response = $gapicClient->getTargetProject($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetTargetProject', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTargetProjectExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - try { - $gapicClient->getTargetProject($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getUtilizationReportTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $vmCount = 261463431; - $expectedResponse = new UtilizationReport(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setVmCount($vmCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - $response = $gapicClient->getUtilizationReport($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetUtilizationReport', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getUtilizationReportExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->utilizationReportName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[UTILIZATION_REPORT]'); - try { - $gapicClient->getUtilizationReport($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCloneJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $cloneJobsElement = new CloneJob(); - $cloneJobs = [ - $cloneJobsElement, - ]; - $expectedResponse = new ListCloneJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCloneJobs($cloneJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $pageToken = 'pageToken1630607433'; - $response = $gapicClient->listCloneJobs($formattedParent, $pageToken); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCloneJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListCloneJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCloneJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $pageToken = 'pageToken1630607433'; - try { - $gapicClient->listCloneJobs($formattedParent, $pageToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCutoverJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $cutoverJobsElement = new CutoverJob(); - $cutoverJobs = [ - $cutoverJobsElement, - ]; - $expectedResponse = new ListCutoverJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCutoverJobs($cutoverJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $pageToken = 'pageToken1630607433'; - $response = $gapicClient->listCutoverJobs($formattedParent, $pageToken); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCutoverJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListCutoverJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCutoverJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $pageToken = 'pageToken1630607433'; - try { - $gapicClient->listCutoverJobs($formattedParent, $pageToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDatacenterConnectorsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $datacenterConnectorsElement = new DatacenterConnector(); - $datacenterConnectors = [ - $datacenterConnectorsElement, - ]; - $expectedResponse = new ListDatacenterConnectorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDatacenterConnectors($datacenterConnectors); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $pageToken = 'pageToken1630607433'; - $response = $gapicClient->listDatacenterConnectors($formattedParent, $pageToken); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDatacenterConnectors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListDatacenterConnectors', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDatacenterConnectorsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $pageToken = 'pageToken1630607433'; - try { - $gapicClient->listDatacenterConnectors($formattedParent, $pageToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listGroupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $groupsElement = new Group(); - $groups = [ - $groupsElement, - ]; - $expectedResponse = new ListGroupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setGroups($groups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageToken = 'pageToken1630607433'; - $response = $gapicClient->listGroups($formattedParent, $pageToken); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getGroups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListGroups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listGroupsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageToken = 'pageToken1630607433'; - try { - $gapicClient->listGroups($formattedParent, $pageToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMigratingVmsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $migratingVmsElement = new MigratingVm(); - $migratingVms = [ - $migratingVmsElement, - ]; - $expectedResponse = new ListMigratingVmsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMigratingVms($migratingVms); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $pageToken = 'pageToken1630607433'; - $response = $gapicClient->listMigratingVms($formattedParent, $pageToken); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMigratingVms()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListMigratingVms', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMigratingVmsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $pageToken = 'pageToken1630607433'; - try { - $gapicClient->listMigratingVms($formattedParent, $pageToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listReplicationCyclesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $replicationCyclesElement = new ReplicationCycle(); - $replicationCycles = [ - $replicationCyclesElement, - ]; - $expectedResponse = new ListReplicationCyclesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setReplicationCycles($replicationCycles); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $pageToken = 'pageToken1630607433'; - $response = $gapicClient->listReplicationCycles($formattedParent, $pageToken); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getReplicationCycles()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListReplicationCycles', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listReplicationCyclesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $pageToken = 'pageToken1630607433'; - try { - $gapicClient->listReplicationCycles($formattedParent, $pageToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSourcesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $sourcesElement = new Source(); - $sources = [ - $sourcesElement, - ]; - $expectedResponse = new ListSourcesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSources($sources); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageToken = 'pageToken1630607433'; - $response = $gapicClient->listSources($formattedParent, $pageToken); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSources()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListSources', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSourcesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageToken = 'pageToken1630607433'; - try { - $gapicClient->listSources($formattedParent, $pageToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTargetProjectsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $targetProjectsElement = new TargetProject(); - $targetProjects = [ - $targetProjectsElement, - ]; - $expectedResponse = new ListTargetProjectsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTargetProjects($targetProjects); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageToken = 'pageToken1630607433'; - $response = $gapicClient->listTargetProjects($formattedParent, $pageToken); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTargetProjects()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListTargetProjects', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTargetProjectsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageToken = 'pageToken1630607433'; - try { - $gapicClient->listTargetProjects($formattedParent, $pageToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listUtilizationReportsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $utilizationReportsElement = new UtilizationReport(); - $utilizationReports = [ - $utilizationReportsElement, - ]; - $expectedResponse = new ListUtilizationReportsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setUtilizationReports($utilizationReports); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $pageToken = 'pageToken1630607433'; - $response = $gapicClient->listUtilizationReports($formattedParent, $pageToken); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUtilizationReports()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListUtilizationReports', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listUtilizationReportsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $pageToken = 'pageToken1630607433'; - try { - $gapicClient->listUtilizationReports($formattedParent, $pageToken); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseMigrationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/pauseMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new PauseMigrationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/pauseMigrationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->pauseMigration($formattedMigratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/PauseMigration', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getMigratingVm(); - $this->assertProtobufEquals($formattedMigratingVm, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/pauseMigrationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function pauseMigrationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/pauseMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->pauseMigration($formattedMigratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/pauseMigrationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function removeGroupMigrationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/removeGroupMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new RemoveGroupMigrationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/removeGroupMigrationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedGroup = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $response = $gapicClient->removeGroupMigration($formattedGroup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/RemoveGroupMigration', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getGroup(); - $this->assertProtobufEquals($formattedGroup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/removeGroupMigrationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function removeGroupMigrationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/removeGroupMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedGroup = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $response = $gapicClient->removeGroupMigration($formattedGroup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/removeGroupMigrationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function resumeMigrationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/resumeMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ResumeMigrationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/resumeMigrationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->resumeMigration($formattedMigratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ResumeMigration', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getMigratingVm(); - $this->assertProtobufEquals($formattedMigratingVm, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/resumeMigrationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function resumeMigrationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/resumeMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->resumeMigration($formattedMigratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/resumeMigrationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function startMigrationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/startMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new StartMigrationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/startMigrationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->startMigration($formattedMigratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/StartMigration', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getMigratingVm(); - $this->assertProtobufEquals($formattedMigratingVm, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/startMigrationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function startMigrationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/startMigrationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $response = $gapicClient->startMigration($formattedMigratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/startMigrationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateGroupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Group(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateGroupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $group = new Group(); - $response = $gapicClient->updateGroup($group); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/UpdateGroup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getGroup(); - $this->assertProtobufEquals($group, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateGroupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateGroupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateGroupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $group = new Group(); - $response = $gapicClient->updateGroup($group); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateGroupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMigratingVmTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMigratingVmTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $sourceVmId = 'sourceVmId1673059967'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $group = 'group98629247'; - $expectedResponse = new MigratingVm(); - $expectedResponse->setName($name); - $expectedResponse->setSourceVmId($sourceVmId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setGroup($group); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateMigratingVmTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $migratingVm = new MigratingVm(); - $response = $gapicClient->updateMigratingVm($migratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/UpdateMigratingVm', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getMigratingVm(); - $this->assertProtobufEquals($migratingVm, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMigratingVmTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMigratingVmExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMigratingVmTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $migratingVm = new MigratingVm(); - $response = $gapicClient->updateMigratingVm($migratingVm); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMigratingVmTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateSourceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateSourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Source(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateSourceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $source = new Source(); - $response = $gapicClient->updateSource($source); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/UpdateSource', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getSource(); - $this->assertProtobufEquals($source, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateSourceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateSourceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateSourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $source = new Source(); - $response = $gapicClient->updateSource($source); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateSourceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTargetProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTargetProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $project = 'project-309310695'; - $description = 'description-1724546052'; - $expectedResponse = new TargetProject(); - $expectedResponse->setName($name); - $expectedResponse->setProject($project); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTargetProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $targetProject = new TargetProject(); - $response = $gapicClient->updateTargetProject($targetProject); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/UpdateTargetProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTargetProject(); - $this->assertProtobufEquals($targetProject, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTargetProjectTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTargetProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTargetProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $targetProject = new TargetProject(); - $response = $gapicClient->updateTargetProject($targetProject); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTargetProjectTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function upgradeApplianceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/upgradeApplianceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new UpgradeApplianceResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/upgradeApplianceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedDatacenterConnector = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $response = $gapicClient->upgradeAppliance($formattedDatacenterConnector); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/UpgradeAppliance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getDatacenterConnector(); - $this->assertProtobufEquals($formattedDatacenterConnector, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeApplianceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function upgradeApplianceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/upgradeApplianceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedDatacenterConnector = $gapicClient->datacenterConnectorName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[DATACENTER_CONNECTOR]'); - $response = $gapicClient->upgradeAppliance($formattedDatacenterConnector); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/upgradeApplianceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/VmwareEngine/.repo-metadata.json b/VmwareEngine/.repo-metadata.json deleted file mode 100644 index 163ab101a198..000000000000 --- a/VmwareEngine/.repo-metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-vmware-engine", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-vmware-engine/latest", - "library_type": "GAPIC_AUTO", - "product_documentation": "https://cloud.google.com/vmware-engine/docs", - "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", - "api_shortname": "vmwareengine" -} diff --git a/VmwareEngine/VERSION b/VmwareEngine/VERSION index 7d8568351b4f..b49b25336d47 100644 --- a/VmwareEngine/VERSION +++ b/VmwareEngine/VERSION @@ -1 +1 @@ -0.5.4 +0.5.6 diff --git a/VmwareEngine/composer.json b/VmwareEngine/composer.json index 24e545e9c72b..575c7b2967ff 100644 --- a/VmwareEngine/composer.json +++ b/VmwareEngine/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30", + "google/gax": "^1.34.0", "google/common-protos": "^4.4" }, "require-dev": { diff --git a/VpcAccess/.repo-metadata.json b/VpcAccess/.repo-metadata.json deleted file mode 100644 index d6cab7a29660..000000000000 --- a/VpcAccess/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-vpc-access", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-vpc-access/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "vpcaccess" -} diff --git a/VpcAccess/VERSION b/VpcAccess/VERSION index 31e5c843497c..80e78df6830f 100644 --- a/VpcAccess/VERSION +++ b/VpcAccess/VERSION @@ -1 +1 @@ -1.3.3 +1.3.5 diff --git a/VpcAccess/composer.json b/VpcAccess/composer.json index 68d7d5439b73..6c4c01d88864 100644 --- a/VpcAccess/composer.json +++ b/VpcAccess/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/WebRisk/.repo-metadata.json b/WebRisk/.repo-metadata.json deleted file mode 100644 index f8bc28fd8796..000000000000 --- a/WebRisk/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-web-risk", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-web-risk/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "webrisk" -} diff --git a/WebRisk/VERSION b/WebRisk/VERSION index 8af85beb5159..9075be495155 100644 --- a/WebRisk/VERSION +++ b/WebRisk/VERSION @@ -1 +1 @@ -1.5.3 +1.5.5 diff --git a/WebRisk/composer.json b/WebRisk/composer.json index 464eb1de9095..ebe40e0e35da 100644 --- a/WebRisk/composer.json +++ b/WebRisk/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/WebSecurityScanner/.OwlBot.yaml b/WebSecurityScanner/.OwlBot.yaml index 673e76a74894..459553bc2f1a 100644 --- a/WebSecurityScanner/.OwlBot.yaml +++ b/WebSecurityScanner/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/websecurityscanner/(v1|v1beta)/.*-php/(.*) + - source: /google/cloud/websecurityscanner/(v1)/.*-php/(.*) dest: /owl-bot-staging/WebSecurityScanner/$1/$2 api-name: WebSecurityScanner diff --git a/WebSecurityScanner/.repo-metadata.json b/WebSecurityScanner/.repo-metadata.json deleted file mode 100644 index 33ccb4a32437..000000000000 --- a/WebSecurityScanner/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-web-security-scanner", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "websecurityscanner" -} diff --git a/WebSecurityScanner/README.md b/WebSecurityScanner/README.md index 1d8c477232d3..744b1b8bd240 100644 --- a/WebSecurityScanner/README.md +++ b/WebSecurityScanner/README.md @@ -54,9 +54,8 @@ echo 'Scan execution state: ' . ExecutionState::name($scanRun->getExecutionState ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/WebSecurityScanner/VERSION b/WebSecurityScanner/VERSION index ee94dd834b53..7ada0d303f3e 100644 --- a/WebSecurityScanner/VERSION +++ b/WebSecurityScanner/VERSION @@ -1 +1 @@ -0.8.3 +0.8.5 diff --git a/WebSecurityScanner/composer.json b/WebSecurityScanner/composer.json index e02b74033801..c700d4a4b129 100644 --- a/WebSecurityScanner/composer.json +++ b/WebSecurityScanner/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/WebSecurityScanner/metadata/V1Beta/CrawledUrl.php b/WebSecurityScanner/metadata/V1Beta/CrawledUrl.php deleted file mode 100644 index f650ca23bfb8..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/CrawledUrl.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile( - ' -Ä -8google/cloud/websecurityscanner/v1beta/crawled_url.proto&google.cloud.websecurityscanner.v1beta"< - -CrawledUrl - http_method (  -url (  -body ( B™ -*com.google.cloud.websecurityscanner.v1betaBCrawledUrlProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpbª&Google.Cloud.WebSecurityScanner.V1BetaÊ&Google\\Cloud\\WebSecurityScanner\\V1betaê)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/metadata/V1Beta/Finding.php b/WebSecurityScanner/metadata/V1Beta/Finding.php deleted file mode 100644 index 02abec885ac1..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/Finding.php +++ /dev/null @@ -1,49 +0,0 @@ -internalAddGeneratedFile( - ' -ç -4google/cloud/websecurityscanner/v1beta/finding.proto&google.cloud.websecurityscanner.v1beta:google/cloud/websecurityscanner/v1beta/finding_addon.proto"© -Finding -name (  - finding_type (  - http_method (  - -fuzzed_url (  -body (  - description (  -reproduction_url (  - frame_url (  - final_url (  - tracking_id - ( : -form ( 2,.google.cloud.websecurityscanner.v1beta.FormQ -outdated_library ( 27.google.cloud.websecurityscanner.v1beta.OutdatedLibraryU -violating_resource ( 29.google.cloud.websecurityscanner.v1beta.ViolatingResourceU -vulnerable_headers ( 29.google.cloud.websecurityscanner.v1beta.VulnerableHeaders[ -vulnerable_parameters ( 2<.google.cloud.websecurityscanner.v1beta.VulnerableParameters8 -xss ( 2+.google.cloud.websecurityscanner.v1beta.Xss:„êA€ -)websecurityscanner.googleapis.com/FindingSprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}B– -*com.google.cloud.websecurityscanner.v1betaB FindingProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpbª&Google.Cloud.WebSecurityScanner.V1BetaÊ&Google\\Cloud\\WebSecurityScanner\\V1betaê)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/metadata/V1Beta/FindingAddon.php b/WebSecurityScanner/metadata/V1Beta/FindingAddon.php deleted file mode 100644 index 9ea7f4fed763..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/FindingAddon.php +++ /dev/null @@ -1,49 +0,0 @@ -internalAddGeneratedFile( - ' -š -:google/cloud/websecurityscanner/v1beta/finding_addon.proto&google.cloud.websecurityscanner.v1beta"* -Form - -action_uri (  -fields ( "Q -OutdatedLibrary - library_name (  -version (  -learn_more_urls ( "? -ViolatingResource - content_type (  - resource_url ( "/ -VulnerableParameters -parameter_names ( "è -VulnerableHeadersQ -headers ( 2@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.HeaderY -missing_headers ( 2@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header% -Header -name (  -value ( "2 -Xss - stack_traces (  - error_message ( B› -*com.google.cloud.websecurityscanner.v1betaBFindingAddonProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpbª&Google.Cloud.WebSecurityScanner.V1BetaÊ&Google\\Cloud\\WebSecurityScanner\\V1betaê)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/metadata/V1Beta/FindingTypeStats.php b/WebSecurityScanner/metadata/V1Beta/FindingTypeStats.php deleted file mode 100644 index 48755bc15453..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/FindingTypeStats.php +++ /dev/null @@ -1,30 +0,0 @@ -internalAddGeneratedFile( - ' -Ô -?google/cloud/websecurityscanner/v1beta/finding_type_stats.proto&google.cloud.websecurityscanner.v1beta"? -FindingTypeStats - finding_type (  - finding_count (BŸ -*com.google.cloud.websecurityscanner.v1betaBFindingTypeStatsProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpbª&Google.Cloud.WebSecurityScanner.V1BetaÊ&Google\\Cloud\\WebSecurityScanner\\V1betaê)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/metadata/V1Beta/ScanConfig.php b/WebSecurityScanner/metadata/V1Beta/ScanConfig.php deleted file mode 100644 index af447db1fe59ee2841c3eabcd2a133fb47b9658e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3047 zcmb_e+iu%N5RK);m$9uV1ZprUiZD))*hNCYDGC&H(w35FS*R=#5*<4!fh|R?WHuDZ z^5Vn|{1<)cYaja1Pw7|WIbYG)B_-LibFopqNLtLCnK?UWcAowa90qVts!@-IR!nSo zmK#xYKX2PlJUe!LPht)&&!+1eQi{oJ?*~58@=O{fs57RJCA03uH1sUjtkTF1ognr@ z9ZeNwK;tpL>|}i-3(Me~zOd?v+VLQhARq>#o*=xy=58NkW-mw5qwYT%gL z4t0BFdT1RveyAvuswN;Ga&6P>dOzFi6Zd7Zduk`%=ch5|*Kn{+Vrv*&?91=v@%K)4 z3u>=7CVd+_cYRC~Bkdvlbql_`YRd`_QcsyTyL`Uc<+Rz0x3dUV;FQ9Q%Czf?-(Dto zn0T4noy?6(2fMBmk61|!*8W}rm}o&*hU-jT;*2!2z9`&=<(?A-u60cKX^x$iXWywg z;U>%vtvBSiAQETs^oCG`6=XY%9dAIA(2d0F((K6i1>~&+$ApK{LV5X~cmsWwo~ZKY z5hG7Bl+`mpf)0>GG$hsl(ZxB0%|Cg11=u|VQ5gmnB6MBLe&sq*Oad!rDviW>R*kR= z3z2s z_Q`0v;wT*sEw4vxER}{LaKiK}6rpi!!|!BsyOIJ|IId6uz&ucY1bb0j;#8F`69qNT z?lyFySHz`9)D@Sne79``X)ui9AG463Y9I&lX%iC5w*3T~i1q%`lh$RjO<$6!-jr+n zNm5hToofPyvXdzGhvQI8Q2$G)3dbFXD*gy7XQB&Vzyj0BMBJ&2MOX;%IehJhJuy}H z9IE@BdcAl6D`!A2jUcSTqU#SFkBtL9B+}7QE=*5@Viy+1n%KlSlIer6VU=A+adaJ{ zNhXiyyKoOy`4~U4T+&N$FTn{zde(8oOS-`;UHb(VPiuU2ucNhzTGN^a*=u%mty15v zYt_Ovp#aO3opx(iBaM1<@1QUv2$0WC)MmBas#gm+;TEiP)NQq0Cv|c zN$?JQX{ha*W)Quh8r!Y*?o_NifU4_6Yu4%rF(WL&e5JLk?-^PlxAqhk$DNB)X|-MN z{6resbFDFj0x;J^Y_)+1^Dx_J?W6Y)zWTUCH{r2%ptsrvFu%dN6kfcbTiLB8*eprY8Xz7i~6+p zj%IHoI!==;36ml1O$UQ0rD1Y1j)zfNqtp zIE#Z}{0r>(865<}Ndz3r*uiuZW^pp2DnN|FsCqyPPKDhaC!o+XI?vKpqJdytbCgBt zC>VB)XcDIJI7?C+ppC|Hlr5xIBh`c1vWhMq&}xxmqp_6aGn%E-sJuF*X_QUV(UUxH zMeu&{E6?oV^LUnr*6%NtZGnx|1yF_Uqu;Ke=l{>N%)p6T!s2BlWif|7L&T@ zC??@^4__cR&}IoDUUB9uX1^de(KUeEzIR@hUy@sBt2})s$BX29^jP;@4;HipY*qS> zB@Mw`sgO-(3Eq~Tkh5xSy+j_P`Vw(R$zdoyF1U1r z?`fcv)C|J`)$mv35qkKMAfE$_IY&S-5BZvWiykb69BL~6(h8=%h`3B@=-#;zCHfNn z3fVwc4d1p*T?36>utIXJ!!TA8CO^_F(~wY5mLcJ{&oCjoh_*D-Dz>Wm-XTa=gu~W7 z&1o|aUsb-gOm09ONbj|Mx;EF8ub^eqGz`X-V)?=|EAcn^5{qfyHdJna>S$bR!@3HM z?-MBdg(r}s1vQS>$#t~xVH6}4zN52ZQyVH|X0kN7rhDcQ!<*`aIP6E?bbveGE54>G z;8ZZ+b-`WJ^_r_e5^(>)clt-&Juw&kqlnu3WH=*!*yU4=sWBRJL&4`L-<_ z4`gjxaDiFijI;)hbD$ AIcRUkS(-co>jiN`XPg}ac`@F zSDL?9&^>4$KJiv>uARBo^GDTQdGn@tS>|s;a#BA|&g(ORaXf1^mLH*U@5y>o zK}pOb8TnB_yks<@ocPgY%mT`FLQXoQ-RTqaq}BftLq(KupBiKwMdN_h{2)q(wJYig z>L;AZ*TQ#01h2h%>{02~)Y9QesHZ0YgzhC3vFlUP>>mG&9z$2Ub~6RD8w$)mp98ah zd3=nnhX8)y3PCIc?Ij_+0fN6c@dD-(Azg`o_nB~5$Ru+E_6J_@h>YAoP>h}T9VMYJ zSrif#&vg<02kRQ7hO3FhwuurJ)Ig4e)yXa~dV=AZ2s-5b7 zeyoCHBT~(BG>o|=I>z;duHzR)-N3k= zGi`Dn@jl108UHu*xywTqj+X?V)}qg_pQL*kFHS72;Wy7%Ua|UcI4#gA_IGtksUr9x z{0s2iM>V$gAPdvedC=$QLC@x4x4tC2LlyOoRNQAXwA)w~;wq!~9gurDNII6-)HPWU znVqut&pO=BtFLXrEj7256|z#@)Xw2k`a4d$njA-UG_91-uzm1M|1c8t99K6B7)zmO z&tZ#GkpwbFT}@FBmqo=XK#UAh2fz%ubky}Kw-B&=uv-8Ych{#)q&wHv*6 zK}&cb9G|;a0UbJil!UUfj&ZBn9r!G@No>!l>2_+m3!h)O!g-Yh>J|1_fUgx5l?^m* zXcgGOyv9g`aAJy2Eh28BWld{Cd8QdEfScumC&guMXuN{+>q*uu*nX!oM5Rnt5pr3= zXD4{?H`so!s`uco`K#F&^jn>_WA*EO(;2j_uGwgvw#<{APc(q_=L2(q-z(T@8&;#< zZnxUaoswFew%RT0N3^Z(b)Y<3+ApBeGp)f{e<5fYyLZrNn3jd8o3Li~dYv9Z;$c6v z&dwB|5x=cp!v2C;&Dz+Fnb1)PYsDD+fQ5NUeJN^h@~=s%Z;dD%u`%unC3b$g$}A{S z#Wrf->uDZ|vp(IV}|%yapjzg+AcF53L7^q`rF zu%1eSeoj3rS9FyGHmaV9@ZW`_oy)b->-Su36l|sbZ%g|bs9~h2hB5DJ7@4oPj-1Nq d+lSL9`BA2cGZLyE8|E*N&(t$hx(Q4G{sUc#0(JlZ diff --git a/WebSecurityScanner/metadata/V1Beta/ScanRunErrorTrace.php b/WebSecurityScanner/metadata/V1Beta/ScanRunErrorTrace.php deleted file mode 100644 index 451259ff5342ba68e4c1d0cde0f85892ed355c4c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1501 zcmbu9UrXCi7{=H7=i&?`hD{0%cBZ0rY$>{nL7a{>jWwW2Nz=(B5R&w?2GX2xau>8TL{3DR$0DtzsM~>rI=(li&NkPv7&rd!L$Z*ibz1w5QZ0!o+FqM zOmT!07#5=uA~3>}EKU$nAne%CvR!C&O!ozQHOB>skP62bj}z325?l;hpHY~js30-D z$fF=-@YbiD5YeE;AAM4!J|YAYpOPR#il_!a8ca~0u>;ucwNIFO7|_7$3b3bhuycRdqz1>koDRMM$Ua#SCUFFF8c_DN5$ArK#xxF+_zN3*AC7_~ zM~qU{j*2v*F-{?W!A>L8+=eBSYd12?Y}$ucefGF>%r(zUDI#f*cpa2SB+e)%JtkGv zF`_fS`AKtoT9)JD5p0${s%oXleMm`xZdQkoAX<=gPxQ?Jm$P5q!(H^adpb@>@mLtB zs@F4Lmk=YrK8U9SYQy1do4 zARmMI2oF)C25Zfw-2>%*Fr@-gbViXKu$=Qfj)YU?DmUs3{do87L(n&zme;}R1m~17 zClj3d=agpCJ0cpNWAuf!Uo|iCv!0Pu5-8?jnj`T>D!IEjYhGS{RzTr5w zBh}=m%nn_%eBHJV&8~0u`vXI&%g@28HgJy&%Qbb)HSJr1Ir$lAxaNt`@$G@@pB|aV zhR->cX?3M}c?HO>ZTlyh_0e}&6gYH}WU6w4|yX){reX}dlMiFVFu(atUlKlSYrs;Yvjs#UG3mfCPpMB$sQ*%f+KUiljd@y~P+%JP<8 If=dAY0wQ_zKmY&$ diff --git a/WebSecurityScanner/metadata/V1Beta/ScanRunWarningTrace.php b/WebSecurityScanner/metadata/V1Beta/ScanRunWarningTrace.php deleted file mode 100644 index 775ada9cd20ffefa61fc1057d0f47776edacacbb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1252 zcmb`HL2uJA6vt^99DJCn48gPmGGp301gSP|DFfOxt)gvBwWLg|B1Mktc9t?bavY|C zcI3jx;K)beqag7eu#>Ku)*|gdE^+L?|L^(v{qpWZdY*!putyjXNRly(ub@09Fcn;K z%o7;rlL-+J^NW-wM3@kEJlOXF=ycrRh1#0&Twr3sDd*FKG;qT6apRK28Ns=r@+!lK zDf7nXy_iVU(4UdWS#*g6qih;UfiN+PcmObTL9$d$z}}#Jtn_0fQP?Z2Lt9&irwi8M zr@gk4HUYp1$};Gy5GOf1EdvDFAAAK+J!u{%6vIp+sa{(&izuU#qJ(}?M?ZiQlw?Ht zENUk?!;*3a^#+e&Qs0H8r`B$zT$Sno-efw^)l-!VT_%ZOC-BC|K|=`4@dcsvi=Rrgt+ z3-z`g@cj|6|HDNZ+og$Fbc4Cr4QAO5n|~@`ZOL^ReXxT0n5wFky?u;KRoVYlnruG0@9`=oVx6rDK!@F?(W z6=MTD4LmP8ZuQUZtW}L?U~RtE9gap((DD!c+C#$ttL-DtK6E-!`z&%>gW5{_M-{wM zDBbfs?e!%GDtc>B8I8)?-c*KPG^TtRcPOPZ^cJrnjho9Re^$491#)JAoT-rWXEf`C z6wPLd+^-v9ID=Euc}E&5JT>{htGlJCWfiWLwWzhMQX4-m{s(V&=I!~q?D|`f{1cEu LS+Z~qt^xQ9hq9yU diff --git a/WebSecurityScanner/metadata/V1Beta/WebSecurityScanner.php b/WebSecurityScanner/metadata/V1Beta/WebSecurityScanner.php deleted file mode 100644 index 96f15f133fa9..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/WebSecurityScanner.php +++ /dev/null @@ -1,121 +0,0 @@ -internalAddGeneratedFile( - ' -«- -Agoogle/cloud/websecurityscanner/v1beta/web_security_scanner.proto&google.cloud.websecurityscanner.v1betagoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto8google/cloud/websecurityscanner/v1beta/crawled_url.proto4google/cloud/websecurityscanner/v1beta/finding.proto?google/cloud/websecurityscanner/v1beta/finding_type_stats.proto8google/cloud/websecurityscanner/v1beta/scan_config.proto5google/cloud/websecurityscanner/v1beta/scan_run.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"¬ -CreateScanConfigRequestC -parent ( B3àAúA- -+cloudresourcemanager.googleapis.com/ProjectL - scan_config ( 22.google.cloud.websecurityscanner.v1beta.ScanConfigBàA"] -DeleteScanConfigRequestB -name ( B4àAúA. -,websecurityscanner.googleapis.com/ScanConfig"Z -GetScanConfigRequestB -name ( B4àAúA. -,websecurityscanner.googleapis.com/ScanConfig"„ -ListScanConfigsRequestC -parent ( B3àAúA- -+cloudresourcemanager.googleapis.com/Project - -page_token (  - page_size (" -UpdateScanConfigRequestL - scan_config ( 22.google.cloud.websecurityscanner.v1beta.ScanConfigBàA4 - update_mask ( 2.google.protobuf.FieldMaskBàA"| -ListScanConfigsResponseH - scan_configs ( 22.google.cloud.websecurityscanner.v1beta.ScanConfig -next_page_token ( "Y -StartScanRunRequestB -name ( B4àAúA. -,websecurityscanner.googleapis.com/ScanConfig"T -GetScanRunRequest? -name ( B1àAúA+ -)websecurityscanner.googleapis.com/ScanRun"‚ -ListScanRunsRequestD -parent ( B4àAúA. -,websecurityscanner.googleapis.com/ScanConfig - -page_token (  - page_size ("s -ListScanRunsResponseB - scan_runs ( 2/.google.cloud.websecurityscanner.v1beta.ScanRun -next_page_token ( "U -StopScanRunRequest? -name ( B1àAúA+ -)websecurityscanner.googleapis.com/ScanRun"‚ -ListCrawledUrlsRequestA -parent ( B1àAúA+ -)websecurityscanner.googleapis.com/ScanRun - -page_token (  - page_size ("| -ListCrawledUrlsResponseH - crawled_urls ( 22.google.cloud.websecurityscanner.v1beta.CrawledUrl -next_page_token ( "T -GetFindingRequest? -name ( B1àAúA+ -)websecurityscanner.googleapis.com/Finding"” -ListFindingsRequestA -parent ( B1àAúA+ -)websecurityscanner.googleapis.com/ScanRun -filter ( BàA - -page_token (  - page_size ("r -ListFindingsResponseA -findings ( 2/.google.cloud.websecurityscanner.v1beta.Finding -next_page_token ( "` -ListFindingTypeStatsRequestA -parent ( B1àAúA+ -)websecurityscanner.googleapis.com/ScanRun"t -ListFindingTypeStatsResponseT -finding_type_stats ( 28.google.cloud.websecurityscanner.v1beta.FindingTypeStats2Ž -WebSecurityScannerÚ -CreateScanConfig?.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest2.google.cloud.websecurityscanner.v1beta.ScanConfig"QÚAparent,scan_config‚Óä“6"\'/v1beta/{parent=projects/*}/scanConfigs: scan_config£ -DeleteScanConfig?.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest.google.protobuf.Empty"6ÚAname‚Óä“)*\'/v1beta/{name=projects/*/scanConfigs/*}¹ - GetScanConfig<.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest2.google.cloud.websecurityscanner.v1beta.ScanConfig"6ÚAname‚Óä“)\'/v1beta/{name=projects/*/scanConfigs/*}Ì -ListScanConfigs>.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest?.google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse"8ÚAparent‚Óä“)\'/v1beta/{parent=projects/*}/scanConfigsë -UpdateScanConfig?.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest2.google.cloud.websecurityscanner.v1beta.ScanConfig"bÚAscan_config,update_mask‚Óä“B23/v1beta/{scan_config.name=projects/*/scanConfigs/*}: scan_config½ - StartScanRun;.google.cloud.websecurityscanner.v1beta.StartScanRunRequest/.google.cloud.websecurityscanner.v1beta.ScanRun"?ÚAname‚Óä“2"-/v1beta/{name=projects/*/scanConfigs/*}:start:*» - -GetScanRun9.google.cloud.websecurityscanner.v1beta.GetScanRunRequest/.google.cloud.websecurityscanner.v1beta.ScanRun"AÚAname‚Óä“42/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}Î - ListScanRuns;.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest<.google.cloud.websecurityscanner.v1beta.ListScanRunsResponse"CÚAparent‚Óä“42/v1beta/{parent=projects/*/scanConfigs/*}/scanRunsÅ - StopScanRun:.google.cloud.websecurityscanner.v1beta.StopScanRunRequest/.google.cloud.websecurityscanner.v1beta.ScanRun"IÚAname‚Óä“<"7/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop:*å -ListCrawledUrls>.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest?.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse"QÚAparent‚Óä“B@/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrlsÆ - -GetFinding9.google.cloud.websecurityscanner.v1beta.GetFindingRequest/.google.cloud.websecurityscanner.v1beta.Finding"LÚAname‚Óä“?=/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}à - ListFindings;.google.cloud.websecurityscanner.v1beta.ListFindingsRequest<.google.cloud.websecurityscanner.v1beta.ListFindingsResponse"UÚA parent,filter‚Óä“?=/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingsù -ListFindingTypeStatsC.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequestD.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse"VÚAparent‚Óä“GE/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStatsUÊA!websecurityscanner.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB¡ -*com.google.cloud.websecurityscanner.v1betaBWebSecurityScannerProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpbª&Google.Cloud.WebSecurityScanner.V1BetaÊ&Google\\Cloud\\WebSecurityScanner\\V1betaê)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/owlbot.py b/WebSecurityScanner/owlbot.py index 504bc01f477b..aaced291f064 100644 --- a/WebSecurityScanner/owlbot.py +++ b/WebSecurityScanner/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2019 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -47,29 +41,16 @@ + "\n", '') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/WebSecurityScanner/src/V1/Client/WebSecurityScannerClient.php b/WebSecurityScanner/src/V1/Client/WebSecurityScannerClient.php index c31b3cecf3bd..e6b2d9c7b769 100644 --- a/WebSecurityScanner/src/V1/Client/WebSecurityScannerClient.php +++ b/WebSecurityScanner/src/V1/Client/WebSecurityScannerClient.php @@ -1,6 +1,6 @@ startApiCall('ListFindingTypeStats', $request, $callOptions)->wait(); } diff --git a/WebSecurityScanner/src/V1/CrawledUrl.php b/WebSecurityScanner/src/V1/CrawledUrl.php index 02c39e1e0008..64ba4bc60cbc 100644 --- a/WebSecurityScanner/src/V1/CrawledUrl.php +++ b/WebSecurityScanner/src/V1/CrawledUrl.php @@ -23,19 +23,19 @@ class CrawledUrl extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string http_method = 1; */ - private $http_method = ''; + protected $http_method = ''; /** * Output only. The URL that was crawled. * * Generated from protobuf field string url = 2; */ - private $url = ''; + protected $url = ''; /** * Output only. The body of the request that was used to visit the URL. * * Generated from protobuf field string body = 3; */ - private $body = ''; + protected $body = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/CreateScanConfigRequest.php b/WebSecurityScanner/src/V1/CreateScanConfigRequest.php index 7304c81603fd..fff8861ade4f 100644 --- a/WebSecurityScanner/src/V1/CreateScanConfigRequest.php +++ b/WebSecurityScanner/src/V1/CreateScanConfigRequest.php @@ -21,13 +21,13 @@ class CreateScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * Required. The ScanConfig to be created. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; */ - private $scan_config = null; + protected $scan_config = null; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/DeleteScanConfigRequest.php b/WebSecurityScanner/src/V1/DeleteScanConfigRequest.php index a80b0a779f66..c425beafce9d 100644 --- a/WebSecurityScanner/src/V1/DeleteScanConfigRequest.php +++ b/WebSecurityScanner/src/V1/DeleteScanConfigRequest.php @@ -21,7 +21,7 @@ class DeleteScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/Finding.php b/WebSecurityScanner/src/V1/Finding.php index c9d0c46bdd6c..4bc03c3293b3 100644 --- a/WebSecurityScanner/src/V1/Finding.php +++ b/WebSecurityScanner/src/V1/Finding.php @@ -23,7 +23,7 @@ class Finding extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Output only. The type of the Finding. * Detailed and up-to-date information on findings can be found here: @@ -31,111 +31,111 @@ class Finding extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string finding_type = 2; */ - private $finding_type = ''; + protected $finding_type = ''; /** * Output only. The severity level of the reported vulnerability. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $severity = 0; + protected $severity = 0; /** * Output only. The http method of the request that triggered the vulnerability, in * uppercase. * * Generated from protobuf field string http_method = 3; */ - private $http_method = ''; + protected $http_method = ''; /** * Output only. The URL produced by the server-side fuzzer and used in the request that * triggered the vulnerability. * * Generated from protobuf field string fuzzed_url = 4; */ - private $fuzzed_url = ''; + protected $fuzzed_url = ''; /** * Output only. The body of the request that triggered the vulnerability. * * Generated from protobuf field string body = 5; */ - private $body = ''; + protected $body = ''; /** * Output only. The description of the vulnerability. * * Generated from protobuf field string description = 6; */ - private $description = ''; + protected $description = ''; /** * Output only. The URL containing human-readable payload that user can leverage to * reproduce the vulnerability. * * Generated from protobuf field string reproduction_url = 7; */ - private $reproduction_url = ''; + protected $reproduction_url = ''; /** * Output only. If the vulnerability was originated from nested IFrame, the immediate * parent IFrame is reported. * * Generated from protobuf field string frame_url = 8; */ - private $frame_url = ''; + protected $frame_url = ''; /** * Output only. The URL where the browser lands when the vulnerability is detected. * * Generated from protobuf field string final_url = 9; */ - private $final_url = ''; + protected $final_url = ''; /** * Output only. The tracking ID uniquely identifies a vulnerability instance across * multiple ScanRuns. * * Generated from protobuf field string tracking_id = 10; */ - private $tracking_id = ''; + protected $tracking_id = ''; /** * Output only. An addon containing information reported for a vulnerability with an HTML * form, if any. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Form form = 16; */ - private $form = null; + protected $form = null; /** * Output only. An addon containing information about outdated libraries. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; */ - private $outdated_library = null; + protected $outdated_library = null; /** * Output only. An addon containing detailed information regarding any resource causing the * vulnerability such as JavaScript sources, image, audio files, etc. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; */ - private $violating_resource = null; + protected $violating_resource = null; /** * Output only. An addon containing information about vulnerable or missing HTTP headers. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; */ - private $vulnerable_headers = null; + protected $vulnerable_headers = null; /** * Output only. An addon containing information about request parameters which were found * to be vulnerable. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; */ - private $vulnerable_parameters = null; + protected $vulnerable_parameters = null; /** * Output only. An addon containing information reported for an XSS, if any. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Xss xss = 14; */ - private $xss = null; + protected $xss = null; /** * Output only. An addon containing information reported for an XXE, if any. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Xxe xxe = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $xxe = null; + protected $xxe = null; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/FindingTypeStats.php b/WebSecurityScanner/src/V1/FindingTypeStats.php index 18e81a062c50..52c1f5d58553 100644 --- a/WebSecurityScanner/src/V1/FindingTypeStats.php +++ b/WebSecurityScanner/src/V1/FindingTypeStats.php @@ -21,13 +21,13 @@ class FindingTypeStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string finding_type = 1; */ - private $finding_type = ''; + protected $finding_type = ''; /** * Output only. The count of findings belonging to this finding type. * * Generated from protobuf field int32 finding_count = 2; */ - private $finding_count = 0; + protected $finding_count = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/Form.php b/WebSecurityScanner/src/V1/Form.php index 9f1711502a2e..d7c8fa1b4d63 100644 --- a/WebSecurityScanner/src/V1/Form.php +++ b/WebSecurityScanner/src/V1/Form.php @@ -20,7 +20,7 @@ class Form extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string action_uri = 1; */ - private $action_uri = ''; + protected $action_uri = ''; /** * ! The names of form fields related to the vulnerability. * diff --git a/WebSecurityScanner/src/V1/GetFindingRequest.php b/WebSecurityScanner/src/V1/GetFindingRequest.php index 74716b561f83..56613939f49b 100644 --- a/WebSecurityScanner/src/V1/GetFindingRequest.php +++ b/WebSecurityScanner/src/V1/GetFindingRequest.php @@ -22,7 +22,7 @@ class GetFindingRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/GetScanConfigRequest.php b/WebSecurityScanner/src/V1/GetScanConfigRequest.php index 994c1d2d73ae..b2835242fe3b 100644 --- a/WebSecurityScanner/src/V1/GetScanConfigRequest.php +++ b/WebSecurityScanner/src/V1/GetScanConfigRequest.php @@ -21,7 +21,7 @@ class GetScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/GetScanRunRequest.php b/WebSecurityScanner/src/V1/GetScanRunRequest.php index 6fe198582180..b7d3f11f9e1e 100644 --- a/WebSecurityScanner/src/V1/GetScanRunRequest.php +++ b/WebSecurityScanner/src/V1/GetScanRunRequest.php @@ -22,7 +22,7 @@ class GetScanRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListCrawledUrlsRequest.php b/WebSecurityScanner/src/V1/ListCrawledUrlsRequest.php index b9fcb855a282..55c61e7b7fba 100644 --- a/WebSecurityScanner/src/V1/ListCrawledUrlsRequest.php +++ b/WebSecurityScanner/src/V1/ListCrawledUrlsRequest.php @@ -22,7 +22,7 @@ class ListCrawledUrlsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * A token identifying a page of results to be returned. This should be a * `next_page_token` value returned from a previous List request. @@ -30,7 +30,7 @@ class ListCrawledUrlsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 2; */ - private $page_token = ''; + protected $page_token = ''; /** * The maximum number of CrawledUrls to return, can be limited by server. * If not specified or not positive, the implementation will select a @@ -38,7 +38,7 @@ class ListCrawledUrlsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListCrawledUrlsResponse.php b/WebSecurityScanner/src/V1/ListCrawledUrlsResponse.php index 334c23bc2075..2a14aca66997 100644 --- a/WebSecurityScanner/src/V1/ListCrawledUrlsResponse.php +++ b/WebSecurityScanner/src/V1/ListCrawledUrlsResponse.php @@ -27,7 +27,7 @@ class ListCrawledUrlsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListFindingTypeStatsRequest.php b/WebSecurityScanner/src/V1/ListFindingTypeStatsRequest.php index b5a85a275f4c..2e969337f774 100644 --- a/WebSecurityScanner/src/V1/ListFindingTypeStatsRequest.php +++ b/WebSecurityScanner/src/V1/ListFindingTypeStatsRequest.php @@ -22,7 +22,7 @@ class ListFindingTypeStatsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListFindingsRequest.php b/WebSecurityScanner/src/V1/ListFindingsRequest.php index 6da53e2b0844..44485fffb638 100644 --- a/WebSecurityScanner/src/V1/ListFindingsRequest.php +++ b/WebSecurityScanner/src/V1/ListFindingsRequest.php @@ -22,7 +22,7 @@ class ListFindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * The filter expression. The expression must be in the format: * . @@ -31,7 +31,7 @@ class ListFindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * A token identifying a page of results to be returned. This should be a * `next_page_token` value returned from a previous List request. @@ -39,7 +39,7 @@ class ListFindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The maximum number of Findings to return, can be limited by server. * If not specified or not positive, the implementation will select a @@ -47,7 +47,7 @@ class ListFindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 4; */ - private $page_size = 0; + protected $page_size = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListFindingsResponse.php b/WebSecurityScanner/src/V1/ListFindingsResponse.php index 651fc29b6b1d..8adbe0f0cb91 100644 --- a/WebSecurityScanner/src/V1/ListFindingsResponse.php +++ b/WebSecurityScanner/src/V1/ListFindingsResponse.php @@ -27,7 +27,7 @@ class ListFindingsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListScanConfigsRequest.php b/WebSecurityScanner/src/V1/ListScanConfigsRequest.php index 966bce32086f..fdd69ae7994e 100644 --- a/WebSecurityScanner/src/V1/ListScanConfigsRequest.php +++ b/WebSecurityScanner/src/V1/ListScanConfigsRequest.php @@ -21,7 +21,7 @@ class ListScanConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * A token identifying a page of results to be returned. This should be a * `next_page_token` value returned from a previous List request. @@ -29,7 +29,7 @@ class ListScanConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 2; */ - private $page_token = ''; + protected $page_token = ''; /** * The maximum number of ScanConfigs to return, can be limited by server. * If not specified or not positive, the implementation will select a @@ -37,7 +37,7 @@ class ListScanConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListScanConfigsResponse.php b/WebSecurityScanner/src/V1/ListScanConfigsResponse.php index e035a6058910..4fe50cac7c9a 100644 --- a/WebSecurityScanner/src/V1/ListScanConfigsResponse.php +++ b/WebSecurityScanner/src/V1/ListScanConfigsResponse.php @@ -27,7 +27,7 @@ class ListScanConfigsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListScanRunsRequest.php b/WebSecurityScanner/src/V1/ListScanRunsRequest.php index 9f6f1296801f..ad0f4a66754d 100644 --- a/WebSecurityScanner/src/V1/ListScanRunsRequest.php +++ b/WebSecurityScanner/src/V1/ListScanRunsRequest.php @@ -21,7 +21,7 @@ class ListScanRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * A token identifying a page of results to be returned. This should be a * `next_page_token` value returned from a previous List request. @@ -29,7 +29,7 @@ class ListScanRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 2; */ - private $page_token = ''; + protected $page_token = ''; /** * The maximum number of ScanRuns to return, can be limited by server. * If not specified or not positive, the implementation will select a @@ -37,7 +37,7 @@ class ListScanRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListScanRunsResponse.php b/WebSecurityScanner/src/V1/ListScanRunsResponse.php index a83a4bfa935c..716f771565ec 100644 --- a/WebSecurityScanner/src/V1/ListScanRunsResponse.php +++ b/WebSecurityScanner/src/V1/ListScanRunsResponse.php @@ -27,7 +27,7 @@ class ListScanRunsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/OutdatedLibrary.php b/WebSecurityScanner/src/V1/OutdatedLibrary.php index a72216c0f3d9..2ec473bc7eeb 100644 --- a/WebSecurityScanner/src/V1/OutdatedLibrary.php +++ b/WebSecurityScanner/src/V1/OutdatedLibrary.php @@ -20,13 +20,13 @@ class OutdatedLibrary extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string library_name = 1; */ - private $library_name = ''; + protected $library_name = ''; /** * The version number. * * Generated from protobuf field string version = 2; */ - private $version = ''; + protected $version = ''; /** * URLs to learn more information about the vulnerabilities in the library. * diff --git a/WebSecurityScanner/src/V1/ScanConfig.php b/WebSecurityScanner/src/V1/ScanConfig.php index fc94ed8b5598..2a96fcca040b 100644 --- a/WebSecurityScanner/src/V1/ScanConfig.php +++ b/WebSecurityScanner/src/V1/ScanConfig.php @@ -22,13 +22,13 @@ class ScanConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Required. The user provided display name of the ScanConfig. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * The maximum QPS during scanning. A valid value ranges from 5 to 20 * inclusively. If the field is unspecified or its value is set 0, server will @@ -37,7 +37,7 @@ class ScanConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 max_qps = 3; */ - private $max_qps = 0; + protected $max_qps = 0; /** * Required. The starting URLs from which the scanner finds site pages. * @@ -50,13 +50,13 @@ class ScanConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; */ - private $authentication = null; + protected $authentication = null; /** * The user agent used during scanning. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; */ - private $user_agent = 0; + protected $user_agent = 0; /** * The excluded URL patterns as described in * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls @@ -69,40 +69,40 @@ class ScanConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; */ - private $schedule = null; + protected $schedule = null; /** * Controls export of scan configurations and results to Security * Command Center. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; */ - private $export_to_security_command_center = 0; + protected $export_to_security_command_center = 0; /** * The risk level selected for the scan * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; */ - private $risk_level = 0; + protected $risk_level = 0; /** * Whether the scan config is managed by Web Security Scanner, output * only. * * Generated from protobuf field bool managed_scan = 13; */ - private $managed_scan = false; + protected $managed_scan = false; /** * Whether the scan configuration has enabled static IP address scan feature. * If enabled, the scanner will access applications from static IP addresses. * * Generated from protobuf field bool static_ip_scan = 14; */ - private $static_ip_scan = false; + protected $static_ip_scan = false; /** * Whether to keep scanning even if most requests return HTTP error codes. * * Generated from protobuf field bool ignore_http_status_errors = 15; */ - private $ignore_http_status_errors = false; + protected $ignore_http_status_errors = false; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfig/Authentication/CustomAccount.php b/WebSecurityScanner/src/V1/ScanConfig/Authentication/CustomAccount.php index 782e701aab4b..3f2a2a4e8155 100644 --- a/WebSecurityScanner/src/V1/ScanConfig/Authentication/CustomAccount.php +++ b/WebSecurityScanner/src/V1/ScanConfig/Authentication/CustomAccount.php @@ -20,20 +20,20 @@ class CustomAccount extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string username = 1; */ - private $username = ''; + protected $username = ''; /** * Required. Input only. The password of the custom account. The credential is stored encrypted * and not returned in any response nor included in audit logs. * * Generated from protobuf field string password = 2; */ - private $password = ''; + protected $password = ''; /** * Required. The login form URL of the website. * * Generated from protobuf field string login_url = 3; */ - private $login_url = ''; + protected $login_url = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfig/Authentication/GoogleAccount.php b/WebSecurityScanner/src/V1/ScanConfig/Authentication/GoogleAccount.php index ccd596347fc5..1d3e963634f7 100644 --- a/WebSecurityScanner/src/V1/ScanConfig/Authentication/GoogleAccount.php +++ b/WebSecurityScanner/src/V1/ScanConfig/Authentication/GoogleAccount.php @@ -21,14 +21,14 @@ class GoogleAccount extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string username = 1; */ - private $username = ''; + protected $username = ''; /** * Required. Input only. The password of the Google account. The credential is stored encrypted * and not returned in any response nor included in audit logs. * * Generated from protobuf field string password = 2; */ - private $password = ''; + protected $password = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfig/Authentication/IapCredential/IapTestServiceAccountInfo.php b/WebSecurityScanner/src/V1/ScanConfig/Authentication/IapCredential/IapTestServiceAccountInfo.php index e163c40d8bed..4913a4ac838b 100644 --- a/WebSecurityScanner/src/V1/ScanConfig/Authentication/IapCredential/IapTestServiceAccountInfo.php +++ b/WebSecurityScanner/src/V1/ScanConfig/Authentication/IapCredential/IapTestServiceAccountInfo.php @@ -22,7 +22,7 @@ class IapTestServiceAccountInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_audience_client_id = ''; + protected $target_audience_client_id = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfig/Schedule.php b/WebSecurityScanner/src/V1/ScanConfig/Schedule.php index c4e9e30154f0..43fe92884581 100644 --- a/WebSecurityScanner/src/V1/ScanConfig/Schedule.php +++ b/WebSecurityScanner/src/V1/ScanConfig/Schedule.php @@ -23,13 +23,13 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; */ - private $schedule_time = null; + protected $schedule_time = null; /** * Required. The duration of time between executions in days. * * Generated from protobuf field int32 interval_duration_days = 2; */ - private $interval_duration_days = 0; + protected $interval_duration_days = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfigError.php b/WebSecurityScanner/src/V1/ScanConfigError.php index 9d0dac61611a..f29dc04e6690 100644 --- a/WebSecurityScanner/src/V1/ScanConfigError.php +++ b/WebSecurityScanner/src/V1/ScanConfigError.php @@ -23,7 +23,7 @@ class ScanConfigError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; */ - private $code = 0; + protected $code = 0; /** * Output only. Indicates the full name of the ScanConfig field that triggers this error, * for example "scan_config.max_qps". This field is provided for @@ -32,7 +32,7 @@ class ScanConfigError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string field_name = 2; */ - private $field_name = ''; + protected $field_name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanRun.php b/WebSecurityScanner/src/V1/ScanRun.php index 82e7a4b4d144..ff25c1ee8cb2 100644 --- a/WebSecurityScanner/src/V1/ScanRun.php +++ b/WebSecurityScanner/src/V1/ScanRun.php @@ -23,40 +23,40 @@ class ScanRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Output only. The execution state of the ScanRun. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; */ - private $execution_state = 0; + protected $execution_state = 0; /** * Output only. The result state of the ScanRun. This field is only available after the * execution state reaches "FINISHED". * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; */ - private $result_state = 0; + protected $result_state = 0; /** * Output only. The time at which the ScanRun started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The time at which the ScanRun reached termination state - that the ScanRun * is either finished or stopped by user. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, * the value represents the number of URLs crawled up to now. * * Generated from protobuf field int64 urls_crawled_count = 6; */ - private $urls_crawled_count = 0; + protected $urls_crawled_count = 0; /** * Output only. The number of URLs tested during this ScanRun. If the scan is in progress, * the value represents the number of URLs tested up to now. The number of @@ -65,13 +65,13 @@ class ScanRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 urls_tested_count = 7; */ - private $urls_tested_count = 0; + protected $urls_tested_count = 0; /** * Output only. Whether the scan run has found any vulnerabilities. * * Generated from protobuf field bool has_vulnerabilities = 8; */ - private $has_vulnerabilities = false; + protected $has_vulnerabilities = false; /** * Output only. The percentage of total completion ranging from 0 to 100. * If the scan is in queue, the value is 0. @@ -80,14 +80,14 @@ class ScanRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 progress_percent = 9; */ - private $progress_percent = 0; + protected $progress_percent = 0; /** * Output only. If result_state is an ERROR, this field provides the primary reason for * scan's termination and more details, if such are available. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; */ - private $error_trace = null; + protected $error_trace = null; /** * Output only. A list of warnings, if such are encountered during this scan run. * diff --git a/WebSecurityScanner/src/V1/ScanRunErrorTrace.php b/WebSecurityScanner/src/V1/ScanRunErrorTrace.php index 5322839fd8a4..688868b5b240 100644 --- a/WebSecurityScanner/src/V1/ScanRunErrorTrace.php +++ b/WebSecurityScanner/src/V1/ScanRunErrorTrace.php @@ -21,7 +21,7 @@ class ScanRunErrorTrace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; */ - private $code = 0; + protected $code = 0; /** * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error * message encountered during scan configuration validation that is performed @@ -29,7 +29,7 @@ class ScanRunErrorTrace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; */ - private $scan_config_error = null; + protected $scan_config_error = null; /** * Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most * common HTTP error code, if such is available. For example, if this code is @@ -37,7 +37,7 @@ class ScanRunErrorTrace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 most_common_http_error_code = 3; */ - private $most_common_http_error_code = 0; + protected $most_common_http_error_code = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanRunLog.php b/WebSecurityScanner/src/V1/ScanRunLog.php index 94e68e35319f..6b90901c9959 100644 --- a/WebSecurityScanner/src/V1/ScanRunLog.php +++ b/WebSecurityScanner/src/V1/ScanRunLog.php @@ -24,41 +24,41 @@ class ScanRunLog extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string summary = 1; */ - private $summary = ''; + protected $summary = ''; /** * The resource name of the ScanRun being logged. * * Generated from protobuf field string name = 2; */ - private $name = ''; + protected $name = ''; /** * The execution state of the ScanRun. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 3; */ - private $execution_state = 0; + protected $execution_state = 0; /** * The result state of the ScanRun. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 4; */ - private $result_state = 0; + protected $result_state = 0; /** * Generated from protobuf field int64 urls_crawled_count = 5; */ - private $urls_crawled_count = 0; + protected $urls_crawled_count = 0; /** * Generated from protobuf field int64 urls_tested_count = 6; */ - private $urls_tested_count = 0; + protected $urls_tested_count = 0; /** * Generated from protobuf field bool has_findings = 7; */ - private $has_findings = false; + protected $has_findings = false; /** * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 8; */ - private $error_trace = null; + protected $error_trace = null; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanRunWarningTrace.php b/WebSecurityScanner/src/V1/ScanRunWarningTrace.php index f579a33ea8c5..88301882093d 100644 --- a/WebSecurityScanner/src/V1/ScanRunWarningTrace.php +++ b/WebSecurityScanner/src/V1/ScanRunWarningTrace.php @@ -22,7 +22,7 @@ class ScanRunWarningTrace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; */ - private $code = 0; + protected $code = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/StartScanRunRequest.php b/WebSecurityScanner/src/V1/StartScanRunRequest.php index 83dfb78d7a45..ac00aa43db70 100644 --- a/WebSecurityScanner/src/V1/StartScanRunRequest.php +++ b/WebSecurityScanner/src/V1/StartScanRunRequest.php @@ -21,7 +21,7 @@ class StartScanRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/StopScanRunRequest.php b/WebSecurityScanner/src/V1/StopScanRunRequest.php index 3cd5d0b75916..cb81353bba70 100644 --- a/WebSecurityScanner/src/V1/StopScanRunRequest.php +++ b/WebSecurityScanner/src/V1/StopScanRunRequest.php @@ -22,7 +22,7 @@ class StopScanRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/UpdateScanConfigRequest.php b/WebSecurityScanner/src/V1/UpdateScanConfigRequest.php index 8a91638cd155..3037cef7bbca 100644 --- a/WebSecurityScanner/src/V1/UpdateScanConfigRequest.php +++ b/WebSecurityScanner/src/V1/UpdateScanConfigRequest.php @@ -22,7 +22,7 @@ class UpdateScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; */ - private $scan_config = null; + protected $scan_config = null; /** * Required. The update mask applies to the resource. For the `FieldMask` definition, * see @@ -30,7 +30,7 @@ class UpdateScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; */ - private $update_mask = null; + protected $update_mask = null; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ViolatingResource.php b/WebSecurityScanner/src/V1/ViolatingResource.php index d166ae12d0d3..a04f097a8d63 100644 --- a/WebSecurityScanner/src/V1/ViolatingResource.php +++ b/WebSecurityScanner/src/V1/ViolatingResource.php @@ -21,13 +21,13 @@ class ViolatingResource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string content_type = 1; */ - private $content_type = ''; + protected $content_type = ''; /** * URL of this violating resource. * * Generated from protobuf field string resource_url = 2; */ - private $resource_url = ''; + protected $resource_url = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/VulnerableHeaders/Header.php b/WebSecurityScanner/src/V1/VulnerableHeaders/Header.php index 9ab083d9659d..a17089ab73cb 100644 --- a/WebSecurityScanner/src/V1/VulnerableHeaders/Header.php +++ b/WebSecurityScanner/src/V1/VulnerableHeaders/Header.php @@ -20,13 +20,13 @@ class Header extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Header value. * * Generated from protobuf field string value = 2; */ - private $value = ''; + protected $value = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/WebSecurityScannerGrpcClient.php b/WebSecurityScanner/src/V1/WebSecurityScannerGrpcClient.php deleted file mode 100644 index 932cde91e5cd..000000000000 --- a/WebSecurityScanner/src/V1/WebSecurityScannerGrpcClient.php +++ /dev/null @@ -1,233 +0,0 @@ -_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/CreateScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Deletes an existing ScanConfig and its child resources. - * @param \Google\Cloud\WebSecurityScanner\V1\DeleteScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteScanConfig(\Google\Cloud\WebSecurityScanner\V1\DeleteScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/DeleteScanConfig', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets a ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1\GetScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetScanConfig(\Google\Cloud\WebSecurityScanner\V1\GetScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/GetScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Lists ScanConfigs under a given project. - * @param \Google\Cloud\WebSecurityScanner\V1\ListScanConfigsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListScanConfigs(\Google\Cloud\WebSecurityScanner\V1\ListScanConfigsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListScanConfigs', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListScanConfigsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a ScanConfig. This method support partial update of a ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1\UpdateScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateScanConfig(\Google\Cloud\WebSecurityScanner\V1\UpdateScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/UpdateScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Start a ScanRun according to the given ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1\StartScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StartScanRun(\Google\Cloud\WebSecurityScanner\V1\StartScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/StartScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * Gets a ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1\GetScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetScanRun(\Google\Cloud\WebSecurityScanner\V1\GetScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/GetScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - * stop time. - * @param \Google\Cloud\WebSecurityScanner\V1\ListScanRunsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListScanRuns(\Google\Cloud\WebSecurityScanner\V1\ListScanRunsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListScanRuns', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListScanRunsResponse', 'decode'], - $metadata, $options); - } - - /** - * Stops a ScanRun. The stopped ScanRun is returned. - * @param \Google\Cloud\WebSecurityScanner\V1\StopScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StopScanRun(\Google\Cloud\WebSecurityScanner\V1\StopScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/StopScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * List CrawledUrls under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1\ListCrawledUrlsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListCrawledUrls(\Google\Cloud\WebSecurityScanner\V1\ListCrawledUrlsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListCrawledUrls', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListCrawledUrlsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a Finding. - * @param \Google\Cloud\WebSecurityScanner\V1\GetFindingRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFinding(\Google\Cloud\WebSecurityScanner\V1\GetFindingRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/GetFinding', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\Finding', 'decode'], - $metadata, $options); - } - - /** - * List Findings under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1\ListFindingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFindings(\Google\Cloud\WebSecurityScanner\V1\ListFindingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindings', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListFindingsResponse', 'decode'], - $metadata, $options); - } - - /** - * List all FindingTypeStats under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1\ListFindingTypeStatsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFindingTypeStats(\Google\Cloud\WebSecurityScanner\V1\ListFindingTypeStatsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindingTypeStats', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListFindingTypeStatsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/WebSecurityScanner/src/V1/Xss.php b/WebSecurityScanner/src/V1/Xss.php index dd360613a914..b3be341c0a1a 100644 --- a/WebSecurityScanner/src/V1/Xss.php +++ b/WebSecurityScanner/src/V1/Xss.php @@ -26,19 +26,19 @@ class Xss extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string error_message = 2; */ - private $error_message = ''; + protected $error_message = ''; /** * The attack vector of the payload triggering this XSS. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; */ - private $attack_vector = 0; + protected $attack_vector = 0; /** * The reproduction url for the seeding POST request of a Stored XSS. * * Generated from protobuf field string stored_xss_seeding_url = 4; */ - private $stored_xss_seeding_url = ''; + protected $stored_xss_seeding_url = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/Xxe.php b/WebSecurityScanner/src/V1/Xxe.php index 2fb63902fd56..55b9f3fd0de0 100644 --- a/WebSecurityScanner/src/V1/Xxe.php +++ b/WebSecurityScanner/src/V1/Xxe.php @@ -21,13 +21,13 @@ class Xxe extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string payload_value = 1; */ - private $payload_value = ''; + protected $payload_value = ''; /** * Location within the request where the payload was placed. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Xxe.Location payload_location = 2; */ - private $payload_location = 0; + protected $payload_location = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1beta/CrawledUrl.php b/WebSecurityScanner/src/V1beta/CrawledUrl.php deleted file mode 100644 index 82dccaeb90ce..000000000000 --- a/WebSecurityScanner/src/V1beta/CrawledUrl.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.websecurityscanner.v1beta.CrawledUrl - */ -class CrawledUrl extends \Google\Protobuf\Internal\Message -{ - /** - * The http method of the request that was used to visit the URL, in - * uppercase. - * - * Generated from protobuf field string http_method = 1; - */ - private $http_method = ''; - /** - * The URL that was crawled. - * - * Generated from protobuf field string url = 2; - */ - private $url = ''; - /** - * The body of the request that was used to visit the URL. - * - * Generated from protobuf field string body = 3; - */ - private $body = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $http_method - * The http method of the request that was used to visit the URL, in - * uppercase. - * @type string $url - * The URL that was crawled. - * @type string $body - * The body of the request that was used to visit the URL. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\CrawledUrl::initOnce(); - parent::__construct($data); - } - - /** - * The http method of the request that was used to visit the URL, in - * uppercase. - * - * Generated from protobuf field string http_method = 1; - * @return string - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The http method of the request that was used to visit the URL, in - * uppercase. - * - * Generated from protobuf field string http_method = 1; - * @param string $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkString($var, True); - $this->http_method = $var; - - return $this; - } - - /** - * The URL that was crawled. - * - * Generated from protobuf field string url = 2; - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * The URL that was crawled. - * - * Generated from protobuf field string url = 2; - * @param string $var - * @return $this - */ - public function setUrl($var) - { - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - - /** - * The body of the request that was used to visit the URL. - * - * Generated from protobuf field string body = 3; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * The body of the request that was used to visit the URL. - * - * Generated from protobuf field string body = 3; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, True); - $this->body = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/CreateScanConfigRequest.php b/WebSecurityScanner/src/V1beta/CreateScanConfigRequest.php deleted file mode 100644 index dbe9184d5b1b..000000000000 --- a/WebSecurityScanner/src/V1beta/CreateScanConfigRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest - */ -class CreateScanConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ScanConfig to be created. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $scan_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig $scan_config - * Required. The ScanConfig to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ScanConfig to be created. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig|null - */ - public function getScanConfig() - { - return $this->scan_config; - } - - public function hasScanConfig() - { - return isset($this->scan_config); - } - - public function clearScanConfig() - { - unset($this->scan_config); - } - - /** - * Required. The ScanConfig to be created. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig $var - * @return $this - */ - public function setScanConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig::class); - $this->scan_config = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/DeleteScanConfigRequest.php b/WebSecurityScanner/src/V1beta/DeleteScanConfigRequest.php deleted file mode 100644 index 827b0205ec2d..000000000000 --- a/WebSecurityScanner/src/V1beta/DeleteScanConfigRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest - */ -class DeleteScanConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/Finding.php b/WebSecurityScanner/src/V1beta/Finding.php deleted file mode 100644 index 35075a45d4fd..000000000000 --- a/WebSecurityScanner/src/V1beta/Finding.php +++ /dev/null @@ -1,686 +0,0 @@ -google.cloud.websecurityscanner.v1beta.Finding - */ -class Finding extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the Finding. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - * The finding IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The type of the Finding. - * Detailed and up-to-date information on findings can be found here: - * https://cloud.google.com/security-scanner/docs/scan-result-details - * - * Generated from protobuf field string finding_type = 2; - */ - private $finding_type = ''; - /** - * The http method of the request that triggered the vulnerability, in - * uppercase. - * - * Generated from protobuf field string http_method = 3; - */ - private $http_method = ''; - /** - * The URL produced by the server-side fuzzer and used in the request that - * triggered the vulnerability. - * - * Generated from protobuf field string fuzzed_url = 4; - */ - private $fuzzed_url = ''; - /** - * The body of the request that triggered the vulnerability. - * - * Generated from protobuf field string body = 5; - */ - private $body = ''; - /** - * The description of the vulnerability. - * - * Generated from protobuf field string description = 6; - */ - private $description = ''; - /** - * The URL containing human-readable payload that user can leverage to - * reproduce the vulnerability. - * - * Generated from protobuf field string reproduction_url = 7; - */ - private $reproduction_url = ''; - /** - * If the vulnerability was originated from nested IFrame, the immediate - * parent IFrame is reported. - * - * Generated from protobuf field string frame_url = 8; - */ - private $frame_url = ''; - /** - * The URL where the browser lands when the vulnerability is detected. - * - * Generated from protobuf field string final_url = 9; - */ - private $final_url = ''; - /** - * The tracking ID uniquely identifies a vulnerability instance across - * multiple ScanRuns. - * - * Generated from protobuf field string tracking_id = 10; - */ - private $tracking_id = ''; - /** - * An addon containing information reported for a vulnerability with an HTML - * form, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Form form = 16; - */ - private $form = null; - /** - * An addon containing information about outdated libraries. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.OutdatedLibrary outdated_library = 11; - */ - private $outdated_library = null; - /** - * An addon containing detailed information regarding any resource causing the - * vulnerability such as JavaScript sources, image, audio files, etc. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ViolatingResource violating_resource = 12; - */ - private $violating_resource = null; - /** - * An addon containing information about vulnerable or missing HTTP headers. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableHeaders vulnerable_headers = 15; - */ - private $vulnerable_headers = null; - /** - * An addon containing information about request parameters which were found - * to be vulnerable. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableParameters vulnerable_parameters = 13; - */ - private $vulnerable_parameters = null; - /** - * An addon containing information reported for an XSS, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Xss xss = 14; - */ - private $xss = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the Finding. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - * The finding IDs are generated by the system. - * @type string $finding_type - * The type of the Finding. - * Detailed and up-to-date information on findings can be found here: - * https://cloud.google.com/security-scanner/docs/scan-result-details - * @type string $http_method - * The http method of the request that triggered the vulnerability, in - * uppercase. - * @type string $fuzzed_url - * The URL produced by the server-side fuzzer and used in the request that - * triggered the vulnerability. - * @type string $body - * The body of the request that triggered the vulnerability. - * @type string $description - * The description of the vulnerability. - * @type string $reproduction_url - * The URL containing human-readable payload that user can leverage to - * reproduce the vulnerability. - * @type string $frame_url - * If the vulnerability was originated from nested IFrame, the immediate - * parent IFrame is reported. - * @type string $final_url - * The URL where the browser lands when the vulnerability is detected. - * @type string $tracking_id - * The tracking ID uniquely identifies a vulnerability instance across - * multiple ScanRuns. - * @type \Google\Cloud\WebSecurityScanner\V1beta\Form $form - * An addon containing information reported for a vulnerability with an HTML - * form, if any. - * @type \Google\Cloud\WebSecurityScanner\V1beta\OutdatedLibrary $outdated_library - * An addon containing information about outdated libraries. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ViolatingResource $violating_resource - * An addon containing detailed information regarding any resource causing the - * vulnerability such as JavaScript sources, image, audio files, etc. - * @type \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders $vulnerable_headers - * An addon containing information about vulnerable or missing HTTP headers. - * @type \Google\Cloud\WebSecurityScanner\V1beta\VulnerableParameters $vulnerable_parameters - * An addon containing information about request parameters which were found - * to be vulnerable. - * @type \Google\Cloud\WebSecurityScanner\V1beta\Xss $xss - * An addon containing information reported for an XSS, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\Finding::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the Finding. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - * The finding IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the Finding. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - * The finding IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The type of the Finding. - * Detailed and up-to-date information on findings can be found here: - * https://cloud.google.com/security-scanner/docs/scan-result-details - * - * Generated from protobuf field string finding_type = 2; - * @return string - */ - public function getFindingType() - { - return $this->finding_type; - } - - /** - * The type of the Finding. - * Detailed and up-to-date information on findings can be found here: - * https://cloud.google.com/security-scanner/docs/scan-result-details - * - * Generated from protobuf field string finding_type = 2; - * @param string $var - * @return $this - */ - public function setFindingType($var) - { - GPBUtil::checkString($var, True); - $this->finding_type = $var; - - return $this; - } - - /** - * The http method of the request that triggered the vulnerability, in - * uppercase. - * - * Generated from protobuf field string http_method = 3; - * @return string - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The http method of the request that triggered the vulnerability, in - * uppercase. - * - * Generated from protobuf field string http_method = 3; - * @param string $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkString($var, True); - $this->http_method = $var; - - return $this; - } - - /** - * The URL produced by the server-side fuzzer and used in the request that - * triggered the vulnerability. - * - * Generated from protobuf field string fuzzed_url = 4; - * @return string - */ - public function getFuzzedUrl() - { - return $this->fuzzed_url; - } - - /** - * The URL produced by the server-side fuzzer and used in the request that - * triggered the vulnerability. - * - * Generated from protobuf field string fuzzed_url = 4; - * @param string $var - * @return $this - */ - public function setFuzzedUrl($var) - { - GPBUtil::checkString($var, True); - $this->fuzzed_url = $var; - - return $this; - } - - /** - * The body of the request that triggered the vulnerability. - * - * Generated from protobuf field string body = 5; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * The body of the request that triggered the vulnerability. - * - * Generated from protobuf field string body = 5; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, True); - $this->body = $var; - - return $this; - } - - /** - * The description of the vulnerability. - * - * Generated from protobuf field string description = 6; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the vulnerability. - * - * Generated from protobuf field string description = 6; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * The URL containing human-readable payload that user can leverage to - * reproduce the vulnerability. - * - * Generated from protobuf field string reproduction_url = 7; - * @return string - */ - public function getReproductionUrl() - { - return $this->reproduction_url; - } - - /** - * The URL containing human-readable payload that user can leverage to - * reproduce the vulnerability. - * - * Generated from protobuf field string reproduction_url = 7; - * @param string $var - * @return $this - */ - public function setReproductionUrl($var) - { - GPBUtil::checkString($var, True); - $this->reproduction_url = $var; - - return $this; - } - - /** - * If the vulnerability was originated from nested IFrame, the immediate - * parent IFrame is reported. - * - * Generated from protobuf field string frame_url = 8; - * @return string - */ - public function getFrameUrl() - { - return $this->frame_url; - } - - /** - * If the vulnerability was originated from nested IFrame, the immediate - * parent IFrame is reported. - * - * Generated from protobuf field string frame_url = 8; - * @param string $var - * @return $this - */ - public function setFrameUrl($var) - { - GPBUtil::checkString($var, True); - $this->frame_url = $var; - - return $this; - } - - /** - * The URL where the browser lands when the vulnerability is detected. - * - * Generated from protobuf field string final_url = 9; - * @return string - */ - public function getFinalUrl() - { - return $this->final_url; - } - - /** - * The URL where the browser lands when the vulnerability is detected. - * - * Generated from protobuf field string final_url = 9; - * @param string $var - * @return $this - */ - public function setFinalUrl($var) - { - GPBUtil::checkString($var, True); - $this->final_url = $var; - - return $this; - } - - /** - * The tracking ID uniquely identifies a vulnerability instance across - * multiple ScanRuns. - * - * Generated from protobuf field string tracking_id = 10; - * @return string - */ - public function getTrackingId() - { - return $this->tracking_id; - } - - /** - * The tracking ID uniquely identifies a vulnerability instance across - * multiple ScanRuns. - * - * Generated from protobuf field string tracking_id = 10; - * @param string $var - * @return $this - */ - public function setTrackingId($var) - { - GPBUtil::checkString($var, True); - $this->tracking_id = $var; - - return $this; - } - - /** - * An addon containing information reported for a vulnerability with an HTML - * form, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Form form = 16; - * @return \Google\Cloud\WebSecurityScanner\V1beta\Form|null - */ - public function getForm() - { - return $this->form; - } - - public function hasForm() - { - return isset($this->form); - } - - public function clearForm() - { - unset($this->form); - } - - /** - * An addon containing information reported for a vulnerability with an HTML - * form, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Form form = 16; - * @param \Google\Cloud\WebSecurityScanner\V1beta\Form $var - * @return $this - */ - public function setForm($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\Form::class); - $this->form = $var; - - return $this; - } - - /** - * An addon containing information about outdated libraries. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.OutdatedLibrary outdated_library = 11; - * @return \Google\Cloud\WebSecurityScanner\V1beta\OutdatedLibrary|null - */ - public function getOutdatedLibrary() - { - return $this->outdated_library; - } - - public function hasOutdatedLibrary() - { - return isset($this->outdated_library); - } - - public function clearOutdatedLibrary() - { - unset($this->outdated_library); - } - - /** - * An addon containing information about outdated libraries. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.OutdatedLibrary outdated_library = 11; - * @param \Google\Cloud\WebSecurityScanner\V1beta\OutdatedLibrary $var - * @return $this - */ - public function setOutdatedLibrary($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\OutdatedLibrary::class); - $this->outdated_library = $var; - - return $this; - } - - /** - * An addon containing detailed information regarding any resource causing the - * vulnerability such as JavaScript sources, image, audio files, etc. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ViolatingResource violating_resource = 12; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ViolatingResource|null - */ - public function getViolatingResource() - { - return $this->violating_resource; - } - - public function hasViolatingResource() - { - return isset($this->violating_resource); - } - - public function clearViolatingResource() - { - unset($this->violating_resource); - } - - /** - * An addon containing detailed information regarding any resource causing the - * vulnerability such as JavaScript sources, image, audio files, etc. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ViolatingResource violating_resource = 12; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ViolatingResource $var - * @return $this - */ - public function setViolatingResource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ViolatingResource::class); - $this->violating_resource = $var; - - return $this; - } - - /** - * An addon containing information about vulnerable or missing HTTP headers. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableHeaders vulnerable_headers = 15; - * @return \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders|null - */ - public function getVulnerableHeaders() - { - return $this->vulnerable_headers; - } - - public function hasVulnerableHeaders() - { - return isset($this->vulnerable_headers); - } - - public function clearVulnerableHeaders() - { - unset($this->vulnerable_headers); - } - - /** - * An addon containing information about vulnerable or missing HTTP headers. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableHeaders vulnerable_headers = 15; - * @param \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders $var - * @return $this - */ - public function setVulnerableHeaders($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders::class); - $this->vulnerable_headers = $var; - - return $this; - } - - /** - * An addon containing information about request parameters which were found - * to be vulnerable. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableParameters vulnerable_parameters = 13; - * @return \Google\Cloud\WebSecurityScanner\V1beta\VulnerableParameters|null - */ - public function getVulnerableParameters() - { - return $this->vulnerable_parameters; - } - - public function hasVulnerableParameters() - { - return isset($this->vulnerable_parameters); - } - - public function clearVulnerableParameters() - { - unset($this->vulnerable_parameters); - } - - /** - * An addon containing information about request parameters which were found - * to be vulnerable. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableParameters vulnerable_parameters = 13; - * @param \Google\Cloud\WebSecurityScanner\V1beta\VulnerableParameters $var - * @return $this - */ - public function setVulnerableParameters($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\VulnerableParameters::class); - $this->vulnerable_parameters = $var; - - return $this; - } - - /** - * An addon containing information reported for an XSS, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Xss xss = 14; - * @return \Google\Cloud\WebSecurityScanner\V1beta\Xss|null - */ - public function getXss() - { - return $this->xss; - } - - public function hasXss() - { - return isset($this->xss); - } - - public function clearXss() - { - unset($this->xss); - } - - /** - * An addon containing information reported for an XSS, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Xss xss = 14; - * @param \Google\Cloud\WebSecurityScanner\V1beta\Xss $var - * @return $this - */ - public function setXss($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\Xss::class); - $this->xss = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/FindingTypeStats.php b/WebSecurityScanner/src/V1beta/FindingTypeStats.php deleted file mode 100644 index e5b50f8e5b86..000000000000 --- a/WebSecurityScanner/src/V1beta/FindingTypeStats.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.websecurityscanner.v1beta.FindingTypeStats - */ -class FindingTypeStats extends \Google\Protobuf\Internal\Message -{ - /** - * The finding type associated with the stats. - * - * Generated from protobuf field string finding_type = 1; - */ - private $finding_type = ''; - /** - * The count of findings belonging to this finding type. - * - * Generated from protobuf field int32 finding_count = 2; - */ - private $finding_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $finding_type - * The finding type associated with the stats. - * @type int $finding_count - * The count of findings belonging to this finding type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingTypeStats::initOnce(); - parent::__construct($data); - } - - /** - * The finding type associated with the stats. - * - * Generated from protobuf field string finding_type = 1; - * @return string - */ - public function getFindingType() - { - return $this->finding_type; - } - - /** - * The finding type associated with the stats. - * - * Generated from protobuf field string finding_type = 1; - * @param string $var - * @return $this - */ - public function setFindingType($var) - { - GPBUtil::checkString($var, True); - $this->finding_type = $var; - - return $this; - } - - /** - * The count of findings belonging to this finding type. - * - * Generated from protobuf field int32 finding_count = 2; - * @return int - */ - public function getFindingCount() - { - return $this->finding_count; - } - - /** - * The count of findings belonging to this finding type. - * - * Generated from protobuf field int32 finding_count = 2; - * @param int $var - * @return $this - */ - public function setFindingCount($var) - { - GPBUtil::checkInt32($var); - $this->finding_count = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/Form.php b/WebSecurityScanner/src/V1beta/Form.php deleted file mode 100644 index 81261ebedf30..000000000000 --- a/WebSecurityScanner/src/V1beta/Form.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.websecurityscanner.v1beta.Form - */ -class Form extends \Google\Protobuf\Internal\Message -{ - /** - * ! The URI where to send the form when it's submitted. - * - * Generated from protobuf field string action_uri = 1; - */ - private $action_uri = ''; - /** - * ! The names of form fields related to the vulnerability. - * - * Generated from protobuf field repeated string fields = 2; - */ - private $fields; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $action_uri - * ! The URI where to send the form when it's submitted. - * @type array|\Google\Protobuf\Internal\RepeatedField $fields - * ! The names of form fields related to the vulnerability. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * ! The URI where to send the form when it's submitted. - * - * Generated from protobuf field string action_uri = 1; - * @return string - */ - public function getActionUri() - { - return $this->action_uri; - } - - /** - * ! The URI where to send the form when it's submitted. - * - * Generated from protobuf field string action_uri = 1; - * @param string $var - * @return $this - */ - public function setActionUri($var) - { - GPBUtil::checkString($var, True); - $this->action_uri = $var; - - return $this; - } - - /** - * ! The names of form fields related to the vulnerability. - * - * Generated from protobuf field repeated string fields = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFields() - { - return $this->fields; - } - - /** - * ! The names of form fields related to the vulnerability. - * - * Generated from protobuf field repeated string fields = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFields($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->fields = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/Gapic/WebSecurityScannerGapicClient.php b/WebSecurityScanner/src/V1beta/Gapic/WebSecurityScannerGapicClient.php deleted file mode 100644 index 45a5d36c2643..000000000000 --- a/WebSecurityScanner/src/V1beta/Gapic/WebSecurityScannerGapicClient.php +++ /dev/null @@ -1,1066 +0,0 @@ -projectName('[PROJECT]'); - * $scanConfig = new ScanConfig(); - * $response = $webSecurityScannerClient->createScanConfig($formattedParent, $scanConfig); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class WebSecurityScannerGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'websecurityscanner.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'websecurityscanner.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $findingNameTemplate; - - private static $projectNameTemplate; - - private static $scanConfigNameTemplate; - - private static $scanRunNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/web_security_scanner_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/web_security_scanner_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/web_security_scanner_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/web_security_scanner_rest_client_config.php', - ], - ], - ]; - } - - private static function getFindingNameTemplate() - { - if (self::$findingNameTemplate == null) { - self::$findingNameTemplate = new PathTemplate('projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}'); - } - - return self::$findingNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getScanConfigNameTemplate() - { - if (self::$scanConfigNameTemplate == null) { - self::$scanConfigNameTemplate = new PathTemplate('projects/{project}/scanConfigs/{scan_config}'); - } - - return self::$scanConfigNameTemplate; - } - - private static function getScanRunNameTemplate() - { - if (self::$scanRunNameTemplate == null) { - self::$scanRunNameTemplate = new PathTemplate('projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}'); - } - - return self::$scanRunNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'finding' => self::getFindingNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'scanConfig' => self::getScanConfigNameTemplate(), - 'scanRun' => self::getScanRunNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a finding - * resource. - * - * @param string $project - * @param string $scanConfig - * @param string $scanRun - * @param string $finding - * - * @return string The formatted finding resource. - * - * @experimental - */ - public static function findingName($project, $scanConfig, $scanRun, $finding) - { - return self::getFindingNameTemplate()->render([ - 'project' => $project, - 'scan_config' => $scanConfig, - 'scan_run' => $scanRun, - 'finding' => $finding, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - * - * @experimental - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a scan_config - * resource. - * - * @param string $project - * @param string $scanConfig - * - * @return string The formatted scan_config resource. - * - * @experimental - */ - public static function scanConfigName($project, $scanConfig) - { - return self::getScanConfigNameTemplate()->render([ - 'project' => $project, - 'scan_config' => $scanConfig, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a scan_run - * resource. - * - * @param string $project - * @param string $scanConfig - * @param string $scanRun - * - * @return string The formatted scan_run resource. - * - * @experimental - */ - public static function scanRunName($project, $scanConfig, $scanRun) - { - return self::getScanRunNameTemplate()->render([ - 'project' => $project, - 'scan_config' => $scanConfig, - 'scan_run' => $scanRun, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - finding: projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding} - * - project: projects/{project} - * - scanConfig: projects/{project}/scanConfigs/{scan_config} - * - scanRun: projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'websecurityscanner.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a new ScanConfig. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->projectName('[PROJECT]'); - * $scanConfig = new ScanConfig(); - * $response = $webSecurityScannerClient->createScanConfig($formattedParent, $scanConfig); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * @param ScanConfig $scanConfig Required. The ScanConfig to be created. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createScanConfig($parent, $scanConfig, array $optionalArgs = []) - { - $request = new CreateScanConfigRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setScanConfig($scanConfig); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateScanConfig', ScanConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an existing ScanConfig and its child resources. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - * $webSecurityScannerClient->deleteScanConfig($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteScanConfig($name, array $optionalArgs = []) - { - $request = new DeleteScanConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteScanConfig', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a Finding. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->findingName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]', '[FINDING]'); - * $response = $webSecurityScannerClient->getFinding($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\Finding - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getFinding($name, array $optionalArgs = []) - { - $request = new GetFindingRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetFinding', Finding::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a ScanConfig. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - * $response = $webSecurityScannerClient->getScanConfig($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getScanConfig($name, array $optionalArgs = []) - { - $request = new GetScanConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetScanConfig', ScanConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a ScanRun. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * $response = $webSecurityScannerClient->getScanRun($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRun - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getScanRun($name, array $optionalArgs = []) - { - $request = new GetScanRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetScanRun', ScanRun::class, $optionalArgs, $request)->wait(); - } - - /** - * List CrawledUrls under a given ScanRun. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * // Iterate over pages of elements - * $pagedResponse = $webSecurityScannerClient->listCrawledUrls($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $webSecurityScannerClient->listCrawledUrls($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listCrawledUrls($parent, array $optionalArgs = []) - { - $request = new ListCrawledUrlsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListCrawledUrls', $optionalArgs, ListCrawledUrlsResponse::class, $request); - } - - /** - * List all FindingTypeStats under a given ScanRun. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * $response = $webSecurityScannerClient->listFindingTypeStats($formattedParent); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ListFindingTypeStatsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listFindingTypeStats($parent, array $optionalArgs = []) - { - $request = new ListFindingTypeStatsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ListFindingTypeStats', ListFindingTypeStatsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * List Findings under a given ScanRun. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * $filter = 'filter'; - * // Iterate over pages of elements - * $pagedResponse = $webSecurityScannerClient->listFindings($formattedParent, $filter); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $webSecurityScannerClient->listFindings($formattedParent, $filter); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param string $filter Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listFindings($parent, $filter, array $optionalArgs = []) - { - $request = new ListFindingsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFilter($filter); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFindings', $optionalArgs, ListFindingsResponse::class, $request); - } - - /** - * Lists ScanConfigs under a given project. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $webSecurityScannerClient->listScanConfigs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $webSecurityScannerClient->listScanConfigs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listScanConfigs($parent, array $optionalArgs = []) - { - $request = new ListScanConfigsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListScanConfigs', $optionalArgs, ListScanConfigsResponse::class, $request); - } - - /** - * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - * stop time. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - * // Iterate over pages of elements - * $pagedResponse = $webSecurityScannerClient->listScanRuns($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $webSecurityScannerClient->listScanRuns($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listScanRuns($parent, array $optionalArgs = []) - { - $request = new ListScanRunsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListScanRuns', $optionalArgs, ListScanRunsResponse::class, $request); - } - - /** - * Start a ScanRun according to the given ScanConfig. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - * $response = $webSecurityScannerClient->startScanRun($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRun - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function startScanRun($name, array $optionalArgs = []) - { - $request = new StartScanRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('StartScanRun', ScanRun::class, $optionalArgs, $request)->wait(); - } - - /** - * Stops a ScanRun. The stopped ScanRun is returned. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * $response = $webSecurityScannerClient->stopScanRun($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRun - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function stopScanRun($name, array $optionalArgs = []) - { - $request = new StopScanRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('StopScanRun', ScanRun::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a ScanConfig. This method support partial update of a ScanConfig. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $scanConfig = new ScanConfig(); - * $updateMask = new FieldMask(); - * $response = $webSecurityScannerClient->updateScanConfig($scanConfig, $updateMask); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param ScanConfig $scanConfig Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * @param FieldMask $updateMask Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateScanConfig($scanConfig, $updateMask, array $optionalArgs = []) - { - $request = new UpdateScanConfigRequest(); - $requestParamHeaders = []; - $request->setScanConfig($scanConfig); - $request->setUpdateMask($updateMask); - $requestParamHeaders['scan_config.name'] = $scanConfig->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateScanConfig', ScanConfig::class, $optionalArgs, $request)->wait(); - } -} diff --git a/WebSecurityScanner/src/V1beta/GetFindingRequest.php b/WebSecurityScanner/src/V1beta/GetFindingRequest.php deleted file mode 100644 index f96df3b43c73..000000000000 --- a/WebSecurityScanner/src/V1beta/GetFindingRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.websecurityscanner.v1beta.GetFindingRequest - */ -class GetFindingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/GetScanConfigRequest.php b/WebSecurityScanner/src/V1beta/GetScanConfigRequest.php deleted file mode 100644 index 4671577cfe43..000000000000 --- a/WebSecurityScanner/src/V1beta/GetScanConfigRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.websecurityscanner.v1beta.GetScanConfigRequest - */ -class GetScanConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/GetScanRunRequest.php b/WebSecurityScanner/src/V1beta/GetScanRunRequest.php deleted file mode 100644 index 66a115ecf0cb..000000000000 --- a/WebSecurityScanner/src/V1beta/GetScanRunRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.websecurityscanner.v1beta.GetScanRunRequest - */ -class GetScanRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListCrawledUrlsRequest.php b/WebSecurityScanner/src/V1beta/ListCrawledUrlsRequest.php deleted file mode 100644 index b3edfafdd7e4..000000000000 --- a/WebSecurityScanner/src/V1beta/ListCrawledUrlsRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest - */ -class ListCrawledUrlsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - */ - private $page_token = ''; - /** - * The maximum number of CrawledUrls to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - */ - private $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @type string $page_token - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * @type int $page_size - * The maximum number of CrawledUrls to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The maximum number of CrawledUrls to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of CrawledUrls to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListCrawledUrlsResponse.php b/WebSecurityScanner/src/V1beta/ListCrawledUrlsResponse.php deleted file mode 100644 index 84dc94838b85..000000000000 --- a/WebSecurityScanner/src/V1beta/ListCrawledUrlsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse - */ -class ListCrawledUrlsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of CrawledUrls returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.CrawledUrl crawled_urls = 1; - */ - private $crawled_urls; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\CrawledUrl>|\Google\Protobuf\Internal\RepeatedField $crawled_urls - * The list of CrawledUrls returned. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of CrawledUrls returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.CrawledUrl crawled_urls = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCrawledUrls() - { - return $this->crawled_urls; - } - - /** - * The list of CrawledUrls returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.CrawledUrl crawled_urls = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\CrawledUrl>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCrawledUrls($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\CrawledUrl::class); - $this->crawled_urls = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListFindingTypeStatsRequest.php b/WebSecurityScanner/src/V1beta/ListFindingTypeStatsRequest.php deleted file mode 100644 index dd8ca47fe0ab..000000000000 --- a/WebSecurityScanner/src/V1beta/ListFindingTypeStatsRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest - */ -class ListFindingTypeStatsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListFindingTypeStatsResponse.php b/WebSecurityScanner/src/V1beta/ListFindingTypeStatsResponse.php deleted file mode 100644 index ae47be432e3d..000000000000 --- a/WebSecurityScanner/src/V1beta/ListFindingTypeStatsResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse - */ -class ListFindingTypeStatsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of FindingTypeStats returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.FindingTypeStats finding_type_stats = 1; - */ - private $finding_type_stats; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\FindingTypeStats>|\Google\Protobuf\Internal\RepeatedField $finding_type_stats - * The list of FindingTypeStats returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of FindingTypeStats returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.FindingTypeStats finding_type_stats = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFindingTypeStats() - { - return $this->finding_type_stats; - } - - /** - * The list of FindingTypeStats returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.FindingTypeStats finding_type_stats = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\FindingTypeStats>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFindingTypeStats($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\FindingTypeStats::class); - $this->finding_type_stats = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListFindingsRequest.php b/WebSecurityScanner/src/V1beta/ListFindingsRequest.php deleted file mode 100644 index 3cfd93cf12e9..000000000000 --- a/WebSecurityScanner/src/V1beta/ListFindingsRequest.php +++ /dev/null @@ -1,205 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListFindingsRequest - */ -class ListFindingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $filter = ''; - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - /** - * The maximum number of Findings to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 4; - */ - private $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @type string $filter - * Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * @type string $page_token - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * @type int $page_size - * The maximum number of Findings to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The maximum number of Findings to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 4; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of Findings to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 4; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListFindingsResponse.php b/WebSecurityScanner/src/V1beta/ListFindingsResponse.php deleted file mode 100644 index fda5ae8f1600..000000000000 --- a/WebSecurityScanner/src/V1beta/ListFindingsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListFindingsResponse - */ -class ListFindingsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Findings returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.Finding findings = 1; - */ - private $findings; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\Finding>|\Google\Protobuf\Internal\RepeatedField $findings - * The list of Findings returned. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of Findings returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.Finding findings = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFindings() - { - return $this->findings; - } - - /** - * The list of Findings returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.Finding findings = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\Finding>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFindings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\Finding::class); - $this->findings = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListScanConfigsRequest.php b/WebSecurityScanner/src/V1beta/ListScanConfigsRequest.php deleted file mode 100644 index b3b939d38008..000000000000 --- a/WebSecurityScanner/src/V1beta/ListScanConfigsRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest - */ -class ListScanConfigsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - */ - private $page_token = ''; - /** - * The maximum number of ScanConfigs to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - */ - private $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * @type string $page_token - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * @type int $page_size - * The maximum number of ScanConfigs to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The maximum number of ScanConfigs to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of ScanConfigs to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListScanConfigsResponse.php b/WebSecurityScanner/src/V1beta/ListScanConfigsResponse.php deleted file mode 100644 index 25042db68f21..000000000000 --- a/WebSecurityScanner/src/V1beta/ListScanConfigsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse - */ -class ListScanConfigsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of ScanConfigs returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig scan_configs = 1; - */ - private $scan_configs; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig>|\Google\Protobuf\Internal\RepeatedField $scan_configs - * The list of ScanConfigs returned. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of ScanConfigs returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig scan_configs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getScanConfigs() - { - return $this->scan_configs; - } - - /** - * The list of ScanConfigs returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig scan_configs = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setScanConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig::class); - $this->scan_configs = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListScanRunsRequest.php b/WebSecurityScanner/src/V1beta/ListScanRunsRequest.php deleted file mode 100644 index 19acaf0e69be..000000000000 --- a/WebSecurityScanner/src/V1beta/ListScanRunsRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListScanRunsRequest - */ -class ListScanRunsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - */ - private $page_token = ''; - /** - * The maximum number of ScanRuns to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - */ - private $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @type string $page_token - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * @type int $page_size - * The maximum number of ScanRuns to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The maximum number of ScanRuns to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of ScanRuns to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListScanRunsResponse.php b/WebSecurityScanner/src/V1beta/ListScanRunsResponse.php deleted file mode 100644 index bd37ba6d5f1b..000000000000 --- a/WebSecurityScanner/src/V1beta/ListScanRunsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListScanRunsResponse - */ -class ListScanRunsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of ScanRuns returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRun scan_runs = 1; - */ - private $scan_runs; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\ScanRun>|\Google\Protobuf\Internal\RepeatedField $scan_runs - * The list of ScanRuns returned. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of ScanRuns returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRun scan_runs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getScanRuns() - { - return $this->scan_runs; - } - - /** - * The list of ScanRuns returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRun scan_runs = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\ScanRun>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setScanRuns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\ScanRun::class); - $this->scan_runs = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/OutdatedLibrary.php b/WebSecurityScanner/src/V1beta/OutdatedLibrary.php deleted file mode 100644 index 96b537029710..000000000000 --- a/WebSecurityScanner/src/V1beta/OutdatedLibrary.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.websecurityscanner.v1beta.OutdatedLibrary - */ -class OutdatedLibrary extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the outdated library. - * - * Generated from protobuf field string library_name = 1; - */ - private $library_name = ''; - /** - * The version number. - * - * Generated from protobuf field string version = 2; - */ - private $version = ''; - /** - * URLs to learn more information about the vulnerabilities in the library. - * - * Generated from protobuf field repeated string learn_more_urls = 3; - */ - private $learn_more_urls; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $library_name - * The name of the outdated library. - * @type string $version - * The version number. - * @type array|\Google\Protobuf\Internal\RepeatedField $learn_more_urls - * URLs to learn more information about the vulnerabilities in the library. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * The name of the outdated library. - * - * Generated from protobuf field string library_name = 1; - * @return string - */ - public function getLibraryName() - { - return $this->library_name; - } - - /** - * The name of the outdated library. - * - * Generated from protobuf field string library_name = 1; - * @param string $var - * @return $this - */ - public function setLibraryName($var) - { - GPBUtil::checkString($var, True); - $this->library_name = $var; - - return $this; - } - - /** - * The version number. - * - * Generated from protobuf field string version = 2; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The version number. - * - * Generated from protobuf field string version = 2; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * URLs to learn more information about the vulnerabilities in the library. - * - * Generated from protobuf field repeated string learn_more_urls = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLearnMoreUrls() - { - return $this->learn_more_urls; - } - - /** - * URLs to learn more information about the vulnerabilities in the library. - * - * Generated from protobuf field repeated string learn_more_urls = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLearnMoreUrls($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->learn_more_urls = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/README.md b/WebSecurityScanner/src/V1beta/README.md deleted file mode 100644 index 997d83bfada8..000000000000 --- a/WebSecurityScanner/src/V1beta/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Google Cloud Web Security Scanner V1beta generated client for PHP - -### Sample - -```php -require 'vendor/autoload.php'; - -use Google\Cloud\WebSecurityScanner\V1beta\ScanConfig; -use Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\UserAgent; -use Google\Cloud\WebSecurityScanner\V1beta\ScanRun\ExecutionState; -use Google\Cloud\WebSecurityScanner\V1beta\WebSecurityScannerClient; - -$client = new WebSecurityScannerClient(); -$scanConfig = $client->createScanConfig( - WebSecurityScannerClient::projectName('[MY_PROJECT_ID'), - new ScanConfig([ - 'display_name' => 'Test Scan', - 'starting_urls' => ['https://[MY_APPLICATION_ID].appspot.com/'], - 'user_agent' => UserAgent::CHROME_LINUX - ]) -); -$scanRun = $client->startScanRun($scanConfig->getName()); - -echo 'Scan execution state: ' . ExecutionState::name($scanRun->getExecutionState()) . PHP_EOL; -``` diff --git a/WebSecurityScanner/src/V1beta/ScanConfig.php b/WebSecurityScanner/src/V1beta/ScanConfig.php deleted file mode 100644 index 9668d29ce8d9..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig.php +++ /dev/null @@ -1,507 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig - */ -class ScanConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the ScanConfig. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - * generated by the system. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Required. The user provided display name of the ScanConfig. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $display_name = ''; - /** - * The maximum QPS during scanning. A valid value ranges from 5 to 20 - * inclusively. If the field is unspecified or its value is set 0, server will - * default to 15. Other values outside of [5, 20] range will be rejected with - * INVALID_ARGUMENT error. - * - * Generated from protobuf field int32 max_qps = 3; - */ - private $max_qps = 0; - /** - * Required. The starting URLs from which the scanner finds site pages. - * - * Generated from protobuf field repeated string starting_urls = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $starting_urls; - /** - * The authentication configuration. If specified, service will use the - * authentication configuration during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication authentication = 5; - */ - private $authentication = null; - /** - * The user agent used during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent user_agent = 6; - */ - private $user_agent = 0; - /** - * The blacklist URL patterns as described in - * https://cloud.google.com/security-scanner/docs/excluded-urls - * - * Generated from protobuf field repeated string blacklist_patterns = 7; - */ - private $blacklist_patterns; - /** - * The schedule of the ScanConfig. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule schedule = 8; - */ - private $schedule = null; - /** - * Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - * used as a default. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform target_platforms = 9; - */ - private $target_platforms; - /** - * Controls export of scan configurations and results to Cloud Security - * Command Center. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; - */ - private $export_to_security_command_center = 0; - /** - * Latest ScanRun if available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun latest_run = 11; - */ - private $latest_run = null; - /** - * The risk level selected for the scan - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel risk_level = 12; - */ - private $risk_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the ScanConfig. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - * generated by the system. - * @type string $display_name - * Required. The user provided display name of the ScanConfig. - * @type int $max_qps - * The maximum QPS during scanning. A valid value ranges from 5 to 20 - * inclusively. If the field is unspecified or its value is set 0, server will - * default to 15. Other values outside of [5, 20] range will be rejected with - * INVALID_ARGUMENT error. - * @type array|\Google\Protobuf\Internal\RepeatedField $starting_urls - * Required. The starting URLs from which the scanner finds site pages. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication $authentication - * The authentication configuration. If specified, service will use the - * authentication configuration during scanning. - * @type int $user_agent - * The user agent used during scanning. - * @type array|\Google\Protobuf\Internal\RepeatedField $blacklist_patterns - * The blacklist URL patterns as described in - * https://cloud.google.com/security-scanner/docs/excluded-urls - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Schedule $schedule - * The schedule of the ScanConfig. - * @type array|\Google\Protobuf\Internal\RepeatedField $target_platforms - * Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - * used as a default. - * @type int $export_to_security_command_center - * Controls export of scan configurations and results to Cloud Security - * Command Center. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanRun $latest_run - * Latest ScanRun if available. - * @type int $risk_level - * The risk level selected for the scan - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the ScanConfig. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - * generated by the system. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the ScanConfig. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - * generated by the system. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The user provided display name of the ScanConfig. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. The user provided display name of the ScanConfig. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The maximum QPS during scanning. A valid value ranges from 5 to 20 - * inclusively. If the field is unspecified or its value is set 0, server will - * default to 15. Other values outside of [5, 20] range will be rejected with - * INVALID_ARGUMENT error. - * - * Generated from protobuf field int32 max_qps = 3; - * @return int - */ - public function getMaxQps() - { - return $this->max_qps; - } - - /** - * The maximum QPS during scanning. A valid value ranges from 5 to 20 - * inclusively. If the field is unspecified or its value is set 0, server will - * default to 15. Other values outside of [5, 20] range will be rejected with - * INVALID_ARGUMENT error. - * - * Generated from protobuf field int32 max_qps = 3; - * @param int $var - * @return $this - */ - public function setMaxQps($var) - { - GPBUtil::checkInt32($var); - $this->max_qps = $var; - - return $this; - } - - /** - * Required. The starting URLs from which the scanner finds site pages. - * - * Generated from protobuf field repeated string starting_urls = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStartingUrls() - { - return $this->starting_urls; - } - - /** - * Required. The starting URLs from which the scanner finds site pages. - * - * Generated from protobuf field repeated string starting_urls = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStartingUrls($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->starting_urls = $arr; - - return $this; - } - - /** - * The authentication configuration. If specified, service will use the - * authentication configuration during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication authentication = 5; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication|null - */ - public function getAuthentication() - { - return $this->authentication; - } - - public function hasAuthentication() - { - return isset($this->authentication); - } - - public function clearAuthentication() - { - unset($this->authentication); - } - - /** - * The authentication configuration. If specified, service will use the - * authentication configuration during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication authentication = 5; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication $var - * @return $this - */ - public function setAuthentication($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication::class); - $this->authentication = $var; - - return $this; - } - - /** - * The user agent used during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent user_agent = 6; - * @return int - */ - public function getUserAgent() - { - return $this->user_agent; - } - - /** - * The user agent used during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent user_agent = 6; - * @param int $var - * @return $this - */ - public function setUserAgent($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\UserAgent::class); - $this->user_agent = $var; - - return $this; - } - - /** - * The blacklist URL patterns as described in - * https://cloud.google.com/security-scanner/docs/excluded-urls - * - * Generated from protobuf field repeated string blacklist_patterns = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBlacklistPatterns() - { - return $this->blacklist_patterns; - } - - /** - * The blacklist URL patterns as described in - * https://cloud.google.com/security-scanner/docs/excluded-urls - * - * Generated from protobuf field repeated string blacklist_patterns = 7; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBlacklistPatterns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->blacklist_patterns = $arr; - - return $this; - } - - /** - * The schedule of the ScanConfig. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule schedule = 8; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Schedule|null - */ - public function getSchedule() - { - return $this->schedule; - } - - public function hasSchedule() - { - return isset($this->schedule); - } - - public function clearSchedule() - { - unset($this->schedule); - } - - /** - * The schedule of the ScanConfig. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule schedule = 8; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Schedule $var - * @return $this - */ - public function setSchedule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Schedule::class); - $this->schedule = $var; - - return $this; - } - - /** - * Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - * used as a default. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform target_platforms = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTargetPlatforms() - { - return $this->target_platforms; - } - - /** - * Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - * used as a default. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform target_platforms = 9; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTargetPlatforms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\TargetPlatform::class); - $this->target_platforms = $arr; - - return $this; - } - - /** - * Controls export of scan configurations and results to Cloud Security - * Command Center. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; - * @return int - */ - public function getExportToSecurityCommandCenter() - { - return $this->export_to_security_command_center; - } - - /** - * Controls export of scan configurations and results to Cloud Security - * Command Center. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; - * @param int $var - * @return $this - */ - public function setExportToSecurityCommandCenter($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\ExportToSecurityCommandCenter::class); - $this->export_to_security_command_center = $var; - - return $this; - } - - /** - * Latest ScanRun if available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun latest_run = 11; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRun|null - */ - public function getLatestRun() - { - return $this->latest_run; - } - - public function hasLatestRun() - { - return isset($this->latest_run); - } - - public function clearLatestRun() - { - unset($this->latest_run); - } - - /** - * Latest ScanRun if available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun latest_run = 11; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanRun $var - * @return $this - */ - public function setLatestRun($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRun::class); - $this->latest_run = $var; - - return $this; - } - - /** - * The risk level selected for the scan - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel risk_level = 12; - * @return int - */ - public function getRiskLevel() - { - return $this->risk_level; - } - - /** - * The risk level selected for the scan - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel risk_level = 12; - * @param int $var - * @return $this - */ - public function setRiskLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\RiskLevel::class); - $this->risk_level = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication.php b/WebSecurityScanner/src/V1beta/ScanConfig/Authentication.php deleted file mode 100644 index 5f485de4c3a8..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication - */ -class Authentication extends \Google\Protobuf\Internal\Message -{ - protected $authentication; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\GoogleAccount $google_account - * Authentication using a Google account. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\CustomAccount $custom_account - * Authentication using a custom account. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * Authentication using a Google account. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount google_account = 1; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\GoogleAccount|null - */ - public function getGoogleAccount() - { - return $this->readOneof(1); - } - - public function hasGoogleAccount() - { - return $this->hasOneof(1); - } - - /** - * Authentication using a Google account. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount google_account = 1; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\GoogleAccount $var - * @return $this - */ - public function setGoogleAccount($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\GoogleAccount::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Authentication using a custom account. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount custom_account = 2; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\CustomAccount|null - */ - public function getCustomAccount() - { - return $this->readOneof(2); - } - - public function hasCustomAccount() - { - return $this->hasOneof(2); - } - - /** - * Authentication using a custom account. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount custom_account = 2; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\CustomAccount $var - * @return $this - */ - public function setCustomAccount($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\CustomAccount::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthentication() - { - return $this->whichOneof("authentication"); - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/CustomAccount.php b/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/CustomAccount.php deleted file mode 100644 index 25306dcd4d80..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/CustomAccount.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount - */ -class CustomAccount extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The user name of the custom account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $username = ''; - /** - * Required. Input only. The password of the custom account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - */ - private $password = ''; - /** - * Required. The login form URL of the website. - * - * Generated from protobuf field string login_url = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $login_url = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $username - * Required. The user name of the custom account. - * @type string $password - * Required. Input only. The password of the custom account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * @type string $login_url - * Required. The login form URL of the website. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The user name of the custom account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Required. The user name of the custom account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUsername($var) - { - GPBUtil::checkString($var, True); - $this->username = $var; - - return $this; - } - - /** - * Required. Input only. The password of the custom account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Required. Input only. The password of the custom account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - - /** - * Required. The login form URL of the website. - * - * Generated from protobuf field string login_url = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLoginUrl() - { - return $this->login_url; - } - - /** - * Required. The login form URL of the website. - * - * Generated from protobuf field string login_url = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLoginUrl($var) - { - GPBUtil::checkString($var, True); - $this->login_url = $var; - - return $this; - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/GoogleAccount.php b/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/GoogleAccount.php deleted file mode 100644 index b3df07ea1584..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/GoogleAccount.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount - */ -class GoogleAccount extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The user name of the Google account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $username = ''; - /** - * Required. Input only. The password of the Google account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - */ - private $password = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $username - * Required. The user name of the Google account. - * @type string $password - * Required. Input only. The password of the Google account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The user name of the Google account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Required. The user name of the Google account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUsername($var) - { - GPBUtil::checkString($var, True); - $this->username = $var; - - return $this; - } - - /** - * Required. Input only. The password of the Google account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Required. Input only. The password of the Google account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/ExportToSecurityCommandCenter.php b/WebSecurityScanner/src/V1beta/ScanConfig/ExportToSecurityCommandCenter.php deleted file mode 100644 index 76993975efb7..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/ExportToSecurityCommandCenter.php +++ /dev/null @@ -1,63 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter - */ -class ExportToSecurityCommandCenter -{ - /** - * Use default, which is ENABLED. - * - * Generated from protobuf enum EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; - */ - const EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; - /** - * Export results of this scan to Cloud Security Command Center. - * - * Generated from protobuf enum ENABLED = 1; - */ - const ENABLED = 1; - /** - * Do not export results of this scan to Cloud Security Command Center. - * - * Generated from protobuf enum DISABLED = 2; - */ - const DISABLED = 2; - - private static $valueToName = [ - self::EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED => 'EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED', - self::ENABLED => 'ENABLED', - self::DISABLED => 'DISABLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/RiskLevel.php b/WebSecurityScanner/src/V1beta/ScanConfig/RiskLevel.php deleted file mode 100644 index be286fe10c91..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/RiskLevel.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel - */ -class RiskLevel -{ - /** - * Use default, which is NORMAL. - * - * Generated from protobuf enum RISK_LEVEL_UNSPECIFIED = 0; - */ - const RISK_LEVEL_UNSPECIFIED = 0; - /** - * Normal scanning (Recommended) - * - * Generated from protobuf enum NORMAL = 1; - */ - const NORMAL = 1; - /** - * Lower impact scanning - * - * Generated from protobuf enum LOW = 2; - */ - const LOW = 2; - - private static $valueToName = [ - self::RISK_LEVEL_UNSPECIFIED => 'RISK_LEVEL_UNSPECIFIED', - self::NORMAL => 'NORMAL', - self::LOW => 'LOW', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/Schedule.php b/WebSecurityScanner/src/V1beta/ScanConfig/Schedule.php deleted file mode 100644 index b2f50b13b69c..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/Schedule.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule - */ -class Schedule extends \Google\Protobuf\Internal\Message -{ - /** - * A timestamp indicates when the next run will be scheduled. The value is - * refreshed by the server after each run. If unspecified, it will default - * to current server time, which means the scan will be scheduled to start - * immediately. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - */ - private $schedule_time = null; - /** - * Required. The duration of time between executions in days. - * - * Generated from protobuf field int32 interval_duration_days = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $interval_duration_days = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $schedule_time - * A timestamp indicates when the next run will be scheduled. The value is - * refreshed by the server after each run. If unspecified, it will default - * to current server time, which means the scan will be scheduled to start - * immediately. - * @type int $interval_duration_days - * Required. The duration of time between executions in days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * A timestamp indicates when the next run will be scheduled. The value is - * refreshed by the server after each run. If unspecified, it will default - * to current server time, which means the scan will be scheduled to start - * immediately. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * A timestamp indicates when the next run will be scheduled. The value is - * refreshed by the server after each run. If unspecified, it will default - * to current server time, which means the scan will be scheduled to start - * immediately. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Required. The duration of time between executions in days. - * - * Generated from protobuf field int32 interval_duration_days = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getIntervalDurationDays() - { - return $this->interval_duration_days; - } - - /** - * Required. The duration of time between executions in days. - * - * Generated from protobuf field int32 interval_duration_days = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setIntervalDurationDays($var) - { - GPBUtil::checkInt32($var); - $this->interval_duration_days = $var; - - return $this; - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/TargetPlatform.php b/WebSecurityScanner/src/V1beta/ScanConfig/TargetPlatform.php deleted file mode 100644 index 95ec166d905b..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/TargetPlatform.php +++ /dev/null @@ -1,63 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform - */ -class TargetPlatform -{ - /** - * The target platform is unknown. Requests with this enum value will be - * rejected with INVALID_ARGUMENT error. - * - * Generated from protobuf enum TARGET_PLATFORM_UNSPECIFIED = 0; - */ - const TARGET_PLATFORM_UNSPECIFIED = 0; - /** - * Google App Engine service. - * - * Generated from protobuf enum APP_ENGINE = 1; - */ - const APP_ENGINE = 1; - /** - * Google Compute Engine service. - * - * Generated from protobuf enum COMPUTE = 2; - */ - const COMPUTE = 2; - - private static $valueToName = [ - self::TARGET_PLATFORM_UNSPECIFIED => 'TARGET_PLATFORM_UNSPECIFIED', - self::APP_ENGINE => 'APP_ENGINE', - self::COMPUTE => 'COMPUTE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/UserAgent.php b/WebSecurityScanner/src/V1beta/ScanConfig/UserAgent.php deleted file mode 100644 index 4670f4bc3fcd..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/UserAgent.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent - */ -class UserAgent -{ - /** - * The user agent is unknown. Service will default to CHROME_LINUX. - * - * Generated from protobuf enum USER_AGENT_UNSPECIFIED = 0; - */ - const USER_AGENT_UNSPECIFIED = 0; - /** - * Chrome on Linux. This is the service default if unspecified. - * - * Generated from protobuf enum CHROME_LINUX = 1; - */ - const CHROME_LINUX = 1; - /** - * Chrome on Android. - * - * Generated from protobuf enum CHROME_ANDROID = 2; - */ - const CHROME_ANDROID = 2; - /** - * Safari on IPhone. - * - * Generated from protobuf enum SAFARI_IPHONE = 3; - */ - const SAFARI_IPHONE = 3; - - private static $valueToName = [ - self::USER_AGENT_UNSPECIFIED => 'USER_AGENT_UNSPECIFIED', - self::CHROME_LINUX => 'CHROME_LINUX', - self::CHROME_ANDROID => 'CHROME_ANDROID', - self::SAFARI_IPHONE => 'SAFARI_IPHONE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfigError.php b/WebSecurityScanner/src/V1beta/ScanConfigError.php deleted file mode 100644 index f53110cfdbc6..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfigError.php +++ /dev/null @@ -1,116 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfigError - */ -class ScanConfigError extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates the reason code for a configuration failure. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError.Code code = 1; - */ - private $code = 0; - /** - * Indicates the full name of the ScanConfig field that triggers this error, - * for example "scan_config.max_qps". This field is provided for - * troubleshooting purposes only and its actual value can change in the - * future. - * - * Generated from protobuf field string field_name = 2; - */ - private $field_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $code - * Indicates the reason code for a configuration failure. - * @type string $field_name - * Indicates the full name of the ScanConfig field that triggers this error, - * for example "scan_config.max_qps". This field is provided for - * troubleshooting purposes only and its actual value can change in the - * future. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfigError::initOnce(); - parent::__construct($data); - } - - /** - * Indicates the reason code for a configuration failure. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError.Code code = 1; - * @return int - */ - public function getCode() - { - return $this->code; - } - - /** - * Indicates the reason code for a configuration failure. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError.Code code = 1; - * @param int $var - * @return $this - */ - public function setCode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError\Code::class); - $this->code = $var; - - return $this; - } - - /** - * Indicates the full name of the ScanConfig field that triggers this error, - * for example "scan_config.max_qps". This field is provided for - * troubleshooting purposes only and its actual value can change in the - * future. - * - * Generated from protobuf field string field_name = 2; - * @return string - */ - public function getFieldName() - { - return $this->field_name; - } - - /** - * Indicates the full name of the ScanConfig field that triggers this error, - * for example "scan_config.max_qps". This field is provided for - * troubleshooting purposes only and its actual value can change in the - * future. - * - * Generated from protobuf field string field_name = 2; - * @param string $var - * @return $this - */ - public function setFieldName($var) - { - GPBUtil::checkString($var, True); - $this->field_name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanConfigError/Code.php b/WebSecurityScanner/src/V1beta/ScanConfigError/Code.php deleted file mode 100644 index 78ede6d6d0da..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfigError/Code.php +++ /dev/null @@ -1,353 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfigError.Code - */ -class Code -{ - /** - * There is no error. - * - * Generated from protobuf enum CODE_UNSPECIFIED = 0; - */ - const CODE_UNSPECIFIED = 0; - /** - * There is no error. - * - * Generated from protobuf enum OK = 0; - */ - const OK = 0; - /** - * Indicates an internal server error. - * Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. - * - * Generated from protobuf enum INTERNAL_ERROR = 1; - */ - const INTERNAL_ERROR = 1; - /** - * One of the seed URLs is an App Engine URL but we cannot validate the scan - * settings due to an App Engine API backend error. - * - * Generated from protobuf enum APPENGINE_API_BACKEND_ERROR = 2; - */ - const APPENGINE_API_BACKEND_ERROR = 2; - /** - * One of the seed URLs is an App Engine URL but we cannot access the - * App Engine API to validate scan settings. - * - * Generated from protobuf enum APPENGINE_API_NOT_ACCESSIBLE = 3; - */ - const APPENGINE_API_NOT_ACCESSIBLE = 3; - /** - * One of the seed URLs is an App Engine URL but the Default Host of the - * App Engine is not set. - * - * Generated from protobuf enum APPENGINE_DEFAULT_HOST_MISSING = 4; - */ - const APPENGINE_DEFAULT_HOST_MISSING = 4; - /** - * Google corporate accounts can not be used for scanning. - * - * Generated from protobuf enum CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; - */ - const CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; - /** - * The account of the scan creator can not be used for scanning. - * - * Generated from protobuf enum CANNOT_USE_OWNER_ACCOUNT = 7; - */ - const CANNOT_USE_OWNER_ACCOUNT = 7; - /** - * This scan targets Compute Engine, but we cannot validate scan settings - * due to a Compute Engine API backend error. - * - * Generated from protobuf enum COMPUTE_API_BACKEND_ERROR = 8; - */ - const COMPUTE_API_BACKEND_ERROR = 8; - /** - * This scan targets Compute Engine, but we cannot access the Compute Engine - * API to validate the scan settings. - * - * Generated from protobuf enum COMPUTE_API_NOT_ACCESSIBLE = 9; - */ - const COMPUTE_API_NOT_ACCESSIBLE = 9; - /** - * The Custom Login URL does not belong to the current project. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; - */ - const CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; - /** - * The Custom Login URL is malformed (can not be parsed). - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_MALFORMED = 11; - */ - const CUSTOM_LOGIN_URL_MALFORMED = 11; - /** - * The Custom Login URL is mapped to a non-routable IP address in DNS. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; - */ - const CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; - /** - * The Custom Login URL is mapped to an IP address which is not reserved for - * the current project. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; - */ - const CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; - /** - * The Custom Login URL has a non-routable IP address. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; - */ - const CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; - /** - * The Custom Login URL has an IP address which is not reserved for the - * current project. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; - */ - const CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; - /** - * Another scan with the same name (case-sensitive) already exists. - * - * Generated from protobuf enum DUPLICATE_SCAN_NAME = 16; - */ - const DUPLICATE_SCAN_NAME = 16; - /** - * A field is set to an invalid value. - * - * Generated from protobuf enum INVALID_FIELD_VALUE = 18; - */ - const INVALID_FIELD_VALUE = 18; - /** - * There was an error trying to authenticate to the scan target. - * - * Generated from protobuf enum FAILED_TO_AUTHENTICATE_TO_TARGET = 19; - */ - const FAILED_TO_AUTHENTICATE_TO_TARGET = 19; - /** - * Finding type value is not specified in the list findings request. - * - * Generated from protobuf enum FINDING_TYPE_UNSPECIFIED = 20; - */ - const FINDING_TYPE_UNSPECIFIED = 20; - /** - * Scan targets Compute Engine, yet current project was not whitelisted for - * Google Compute Engine Scanning Alpha access. - * - * Generated from protobuf enum FORBIDDEN_TO_SCAN_COMPUTE = 21; - */ - const FORBIDDEN_TO_SCAN_COMPUTE = 21; - /** - * User tries to update managed scan - * - * Generated from protobuf enum FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; - */ - const FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; - /** - * The supplied filter is malformed. For example, it can not be parsed, does - * not have a filter type in expression, or the same filter type appears - * more than once. - * - * Generated from protobuf enum MALFORMED_FILTER = 22; - */ - const MALFORMED_FILTER = 22; - /** - * The supplied resource name is malformed (can not be parsed). - * - * Generated from protobuf enum MALFORMED_RESOURCE_NAME = 23; - */ - const MALFORMED_RESOURCE_NAME = 23; - /** - * The current project is not in an active state. - * - * Generated from protobuf enum PROJECT_INACTIVE = 24; - */ - const PROJECT_INACTIVE = 24; - /** - * A required field is not set. - * - * Generated from protobuf enum REQUIRED_FIELD = 25; - */ - const REQUIRED_FIELD = 25; - /** - * Project id, scanconfig id, scanrun id, or finding id are not consistent - * with each other in resource name. - * - * Generated from protobuf enum RESOURCE_NAME_INCONSISTENT = 26; - */ - const RESOURCE_NAME_INCONSISTENT = 26; - /** - * The scan being requested to start is already running. - * - * Generated from protobuf enum SCAN_ALREADY_RUNNING = 27; - */ - const SCAN_ALREADY_RUNNING = 27; - /** - * The scan that was requested to be stopped is not running. - * - * Generated from protobuf enum SCAN_NOT_RUNNING = 28; - */ - const SCAN_NOT_RUNNING = 28; - /** - * One of the seed URLs does not belong to the current project. - * - * Generated from protobuf enum SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; - */ - const SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; - /** - * One of the seed URLs is malformed (can not be parsed). - * - * Generated from protobuf enum SEED_URL_MALFORMED = 30; - */ - const SEED_URL_MALFORMED = 30; - /** - * One of the seed URLs is mapped to a non-routable IP address in DNS. - * - * Generated from protobuf enum SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; - */ - const SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; - /** - * One of the seed URLs is mapped to an IP address which is not reserved - * for the current project. - * - * Generated from protobuf enum SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; - */ - const SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; - /** - * One of the seed URLs has on-routable IP address. - * - * Generated from protobuf enum SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; - */ - const SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; - /** - * One of the seed URLs has an IP address that is not reserved - * for the current project. - * - * Generated from protobuf enum SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; - */ - const SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; - /** - * The Cloud Security Scanner service account is not configured under the - * project. - * - * Generated from protobuf enum SERVICE_ACCOUNT_NOT_CONFIGURED = 36; - */ - const SERVICE_ACCOUNT_NOT_CONFIGURED = 36; - /** - * A project has reached the maximum number of scans. - * - * Generated from protobuf enum TOO_MANY_SCANS = 37; - */ - const TOO_MANY_SCANS = 37; - /** - * Resolving the details of the current project fails. - * - * Generated from protobuf enum UNABLE_TO_RESOLVE_PROJECT_INFO = 38; - */ - const UNABLE_TO_RESOLVE_PROJECT_INFO = 38; - /** - * One or more blacklist patterns were in the wrong format. - * - * Generated from protobuf enum UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; - */ - const UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; - /** - * The supplied filter is not supported. - * - * Generated from protobuf enum UNSUPPORTED_FILTER = 40; - */ - const UNSUPPORTED_FILTER = 40; - /** - * The supplied finding type is not supported. For example, we do not - * provide findings of the given finding type. - * - * Generated from protobuf enum UNSUPPORTED_FINDING_TYPE = 41; - */ - const UNSUPPORTED_FINDING_TYPE = 41; - /** - * The URL scheme of one or more of the supplied URLs is not supported. - * - * Generated from protobuf enum UNSUPPORTED_URL_SCHEME = 42; - */ - const UNSUPPORTED_URL_SCHEME = 42; - - private static $valueToName = [ - self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', - self::OK => 'OK', - self::INTERNAL_ERROR => 'INTERNAL_ERROR', - self::APPENGINE_API_BACKEND_ERROR => 'APPENGINE_API_BACKEND_ERROR', - self::APPENGINE_API_NOT_ACCESSIBLE => 'APPENGINE_API_NOT_ACCESSIBLE', - self::APPENGINE_DEFAULT_HOST_MISSING => 'APPENGINE_DEFAULT_HOST_MISSING', - self::CANNOT_USE_GOOGLE_COM_ACCOUNT => 'CANNOT_USE_GOOGLE_COM_ACCOUNT', - self::CANNOT_USE_OWNER_ACCOUNT => 'CANNOT_USE_OWNER_ACCOUNT', - self::COMPUTE_API_BACKEND_ERROR => 'COMPUTE_API_BACKEND_ERROR', - self::COMPUTE_API_NOT_ACCESSIBLE => 'COMPUTE_API_NOT_ACCESSIBLE', - self::CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT => 'CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT', - self::CUSTOM_LOGIN_URL_MALFORMED => 'CUSTOM_LOGIN_URL_MALFORMED', - self::CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS => 'CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS', - self::CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS => 'CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS', - self::CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS => 'CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS', - self::CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS => 'CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS', - self::DUPLICATE_SCAN_NAME => 'DUPLICATE_SCAN_NAME', - self::INVALID_FIELD_VALUE => 'INVALID_FIELD_VALUE', - self::FAILED_TO_AUTHENTICATE_TO_TARGET => 'FAILED_TO_AUTHENTICATE_TO_TARGET', - self::FINDING_TYPE_UNSPECIFIED => 'FINDING_TYPE_UNSPECIFIED', - self::FORBIDDEN_TO_SCAN_COMPUTE => 'FORBIDDEN_TO_SCAN_COMPUTE', - self::FORBIDDEN_UPDATE_TO_MANAGED_SCAN => 'FORBIDDEN_UPDATE_TO_MANAGED_SCAN', - self::MALFORMED_FILTER => 'MALFORMED_FILTER', - self::MALFORMED_RESOURCE_NAME => 'MALFORMED_RESOURCE_NAME', - self::PROJECT_INACTIVE => 'PROJECT_INACTIVE', - self::REQUIRED_FIELD => 'REQUIRED_FIELD', - self::RESOURCE_NAME_INCONSISTENT => 'RESOURCE_NAME_INCONSISTENT', - self::SCAN_ALREADY_RUNNING => 'SCAN_ALREADY_RUNNING', - self::SCAN_NOT_RUNNING => 'SCAN_NOT_RUNNING', - self::SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT => 'SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT', - self::SEED_URL_MALFORMED => 'SEED_URL_MALFORMED', - self::SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS => 'SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS', - self::SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS => 'SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS', - self::SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS => 'SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS', - self::SEED_URL_HAS_UNRESERVED_IP_ADDRESS => 'SEED_URL_HAS_UNRESERVED_IP_ADDRESS', - self::SERVICE_ACCOUNT_NOT_CONFIGURED => 'SERVICE_ACCOUNT_NOT_CONFIGURED', - self::TOO_MANY_SCANS => 'TOO_MANY_SCANS', - self::UNABLE_TO_RESOLVE_PROJECT_INFO => 'UNABLE_TO_RESOLVE_PROJECT_INFO', - self::UNSUPPORTED_BLACKLIST_PATTERN_FORMAT => 'UNSUPPORTED_BLACKLIST_PATTERN_FORMAT', - self::UNSUPPORTED_FILTER => 'UNSUPPORTED_FILTER', - self::UNSUPPORTED_FINDING_TYPE => 'UNSUPPORTED_FINDING_TYPE', - self::UNSUPPORTED_URL_SCHEME => 'UNSUPPORTED_URL_SCHEME', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanRun.php b/WebSecurityScanner/src/V1beta/ScanRun.php deleted file mode 100644 index cec5b68807ab..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRun.php +++ /dev/null @@ -1,486 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRun - */ -class ScanRun extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the ScanRun. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * The ScanRun IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The execution state of the ScanRun. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState execution_state = 2; - */ - private $execution_state = 0; - /** - * The result state of the ScanRun. This field is only available after the - * execution state reaches "FINISHED". - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ResultState result_state = 3; - */ - private $result_state = 0; - /** - * The time at which the ScanRun started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; - */ - private $start_time = null; - /** - * The time at which the ScanRun reached termination state - that the ScanRun - * is either finished or stopped by user. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; - */ - private $end_time = null; - /** - * The number of URLs crawled during this ScanRun. If the scan is in progress, - * the value represents the number of URLs crawled up to now. - * - * Generated from protobuf field int64 urls_crawled_count = 6; - */ - private $urls_crawled_count = 0; - /** - * The number of URLs tested during this ScanRun. If the scan is in progress, - * the value represents the number of URLs tested up to now. The number of - * URLs tested is usually larger than the number URLS crawled because - * typically a crawled URL is tested with multiple test payloads. - * - * Generated from protobuf field int64 urls_tested_count = 7; - */ - private $urls_tested_count = 0; - /** - * Whether the scan run has found any vulnerabilities. - * - * Generated from protobuf field bool has_vulnerabilities = 8; - */ - private $has_vulnerabilities = false; - /** - * The percentage of total completion ranging from 0 to 100. - * If the scan is in queue, the value is 0. - * If the scan is running, the value ranges from 0 to 100. - * If the scan is finished, the value is 100. - * - * Generated from protobuf field int32 progress_percent = 9; - */ - private $progress_percent = 0; - /** - * If result_state is an ERROR, this field provides the primary reason for - * scan's termination and more details, if such are available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace error_trace = 10; - */ - private $error_trace = null; - /** - * A list of warnings, if such are encountered during this scan run. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace warning_traces = 11; - */ - private $warning_traces; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the ScanRun. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * The ScanRun IDs are generated by the system. - * @type int $execution_state - * The execution state of the ScanRun. - * @type int $result_state - * The result state of the ScanRun. This field is only available after the - * execution state reaches "FINISHED". - * @type \Google\Protobuf\Timestamp $start_time - * The time at which the ScanRun started. - * @type \Google\Protobuf\Timestamp $end_time - * The time at which the ScanRun reached termination state - that the ScanRun - * is either finished or stopped by user. - * @type int|string $urls_crawled_count - * The number of URLs crawled during this ScanRun. If the scan is in progress, - * the value represents the number of URLs crawled up to now. - * @type int|string $urls_tested_count - * The number of URLs tested during this ScanRun. If the scan is in progress, - * the value represents the number of URLs tested up to now. The number of - * URLs tested is usually larger than the number URLS crawled because - * typically a crawled URL is tested with multiple test payloads. - * @type bool $has_vulnerabilities - * Whether the scan run has found any vulnerabilities. - * @type int $progress_percent - * The percentage of total completion ranging from 0 to 100. - * If the scan is in queue, the value is 0. - * If the scan is running, the value ranges from 0 to 100. - * If the scan is finished, the value is 100. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace $error_trace - * If result_state is an ERROR, this field provides the primary reason for - * scan's termination and more details, if such are available. - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\ScanRunWarningTrace>|\Google\Protobuf\Internal\RepeatedField $warning_traces - * A list of warnings, if such are encountered during this scan run. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanRun::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the ScanRun. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * The ScanRun IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the ScanRun. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * The ScanRun IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The execution state of the ScanRun. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState execution_state = 2; - * @return int - */ - public function getExecutionState() - { - return $this->execution_state; - } - - /** - * The execution state of the ScanRun. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState execution_state = 2; - * @param int $var - * @return $this - */ - public function setExecutionState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRun\ExecutionState::class); - $this->execution_state = $var; - - return $this; - } - - /** - * The result state of the ScanRun. This field is only available after the - * execution state reaches "FINISHED". - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ResultState result_state = 3; - * @return int - */ - public function getResultState() - { - return $this->result_state; - } - - /** - * The result state of the ScanRun. This field is only available after the - * execution state reaches "FINISHED". - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ResultState result_state = 3; - * @param int $var - * @return $this - */ - public function setResultState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRun\ResultState::class); - $this->result_state = $var; - - return $this; - } - - /** - * The time at which the ScanRun started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * The time at which the ScanRun started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * The time at which the ScanRun reached termination state - that the ScanRun - * is either finished or stopped by user. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time at which the ScanRun reached termination state - that the ScanRun - * is either finished or stopped by user. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * The number of URLs crawled during this ScanRun. If the scan is in progress, - * the value represents the number of URLs crawled up to now. - * - * Generated from protobuf field int64 urls_crawled_count = 6; - * @return int|string - */ - public function getUrlsCrawledCount() - { - return $this->urls_crawled_count; - } - - /** - * The number of URLs crawled during this ScanRun. If the scan is in progress, - * the value represents the number of URLs crawled up to now. - * - * Generated from protobuf field int64 urls_crawled_count = 6; - * @param int|string $var - * @return $this - */ - public function setUrlsCrawledCount($var) - { - GPBUtil::checkInt64($var); - $this->urls_crawled_count = $var; - - return $this; - } - - /** - * The number of URLs tested during this ScanRun. If the scan is in progress, - * the value represents the number of URLs tested up to now. The number of - * URLs tested is usually larger than the number URLS crawled because - * typically a crawled URL is tested with multiple test payloads. - * - * Generated from protobuf field int64 urls_tested_count = 7; - * @return int|string - */ - public function getUrlsTestedCount() - { - return $this->urls_tested_count; - } - - /** - * The number of URLs tested during this ScanRun. If the scan is in progress, - * the value represents the number of URLs tested up to now. The number of - * URLs tested is usually larger than the number URLS crawled because - * typically a crawled URL is tested with multiple test payloads. - * - * Generated from protobuf field int64 urls_tested_count = 7; - * @param int|string $var - * @return $this - */ - public function setUrlsTestedCount($var) - { - GPBUtil::checkInt64($var); - $this->urls_tested_count = $var; - - return $this; - } - - /** - * Whether the scan run has found any vulnerabilities. - * - * Generated from protobuf field bool has_vulnerabilities = 8; - * @return bool - */ - public function getHasVulnerabilities() - { - return $this->has_vulnerabilities; - } - - /** - * Whether the scan run has found any vulnerabilities. - * - * Generated from protobuf field bool has_vulnerabilities = 8; - * @param bool $var - * @return $this - */ - public function setHasVulnerabilities($var) - { - GPBUtil::checkBool($var); - $this->has_vulnerabilities = $var; - - return $this; - } - - /** - * The percentage of total completion ranging from 0 to 100. - * If the scan is in queue, the value is 0. - * If the scan is running, the value ranges from 0 to 100. - * If the scan is finished, the value is 100. - * - * Generated from protobuf field int32 progress_percent = 9; - * @return int - */ - public function getProgressPercent() - { - return $this->progress_percent; - } - - /** - * The percentage of total completion ranging from 0 to 100. - * If the scan is in queue, the value is 0. - * If the scan is running, the value ranges from 0 to 100. - * If the scan is finished, the value is 100. - * - * Generated from protobuf field int32 progress_percent = 9; - * @param int $var - * @return $this - */ - public function setProgressPercent($var) - { - GPBUtil::checkInt32($var); - $this->progress_percent = $var; - - return $this; - } - - /** - * If result_state is an ERROR, this field provides the primary reason for - * scan's termination and more details, if such are available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace error_trace = 10; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace|null - */ - public function getErrorTrace() - { - return $this->error_trace; - } - - public function hasErrorTrace() - { - return isset($this->error_trace); - } - - public function clearErrorTrace() - { - unset($this->error_trace); - } - - /** - * If result_state is an ERROR, this field provides the primary reason for - * scan's termination and more details, if such are available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace error_trace = 10; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace $var - * @return $this - */ - public function setErrorTrace($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace::class); - $this->error_trace = $var; - - return $this; - } - - /** - * A list of warnings, if such are encountered during this scan run. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace warning_traces = 11; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWarningTraces() - { - return $this->warning_traces; - } - - /** - * A list of warnings, if such are encountered during this scan run. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace warning_traces = 11; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\ScanRunWarningTrace>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWarningTraces($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\ScanRunWarningTrace::class); - $this->warning_traces = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanRun/ExecutionState.php b/WebSecurityScanner/src/V1beta/ScanRun/ExecutionState.php deleted file mode 100644 index e8ae96619ebd..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRun/ExecutionState.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState - */ -class ExecutionState -{ - /** - * Represents an invalid state caused by internal server error. This value - * should never be returned. - * - * Generated from protobuf enum EXECUTION_STATE_UNSPECIFIED = 0; - */ - const EXECUTION_STATE_UNSPECIFIED = 0; - /** - * The scan is waiting in the queue. - * - * Generated from protobuf enum QUEUED = 1; - */ - const QUEUED = 1; - /** - * The scan is in progress. - * - * Generated from protobuf enum SCANNING = 2; - */ - const SCANNING = 2; - /** - * The scan is either finished or stopped by user. - * - * Generated from protobuf enum FINISHED = 3; - */ - const FINISHED = 3; - - private static $valueToName = [ - self::EXECUTION_STATE_UNSPECIFIED => 'EXECUTION_STATE_UNSPECIFIED', - self::QUEUED => 'QUEUED', - self::SCANNING => 'SCANNING', - self::FINISHED => 'FINISHED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanRun/ResultState.php b/WebSecurityScanner/src/V1beta/ScanRun/ResultState.php deleted file mode 100644 index 55493b551227..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRun/ResultState.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRun.ResultState - */ -class ResultState -{ - /** - * Default value. This value is returned when the ScanRun is not yet - * finished. - * - * Generated from protobuf enum RESULT_STATE_UNSPECIFIED = 0; - */ - const RESULT_STATE_UNSPECIFIED = 0; - /** - * The scan finished without errors. - * - * Generated from protobuf enum SUCCESS = 1; - */ - const SUCCESS = 1; - /** - * The scan finished with errors. - * - * Generated from protobuf enum ERROR = 2; - */ - const ERROR = 2; - /** - * The scan was terminated by user. - * - * Generated from protobuf enum KILLED = 3; - */ - const KILLED = 3; - - private static $valueToName = [ - self::RESULT_STATE_UNSPECIFIED => 'RESULT_STATE_UNSPECIFIED', - self::SUCCESS => 'SUCCESS', - self::ERROR => 'ERROR', - self::KILLED => 'KILLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanRunErrorTrace.php b/WebSecurityScanner/src/V1beta/ScanRunErrorTrace.php deleted file mode 100644 index e273282c5e1a..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRunErrorTrace.php +++ /dev/null @@ -1,162 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace - */ -class ScanRunErrorTrace extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates the error reason code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code code = 1; - */ - private $code = 0; - /** - * If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - * message encountered during scan configuration validation that is performed - * before each scan run. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError scan_config_error = 2; - */ - private $scan_config_error = null; - /** - * If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - * common HTTP error code, if such is available. For example, if this code is - * 404, the scan has encountered too many NOT_FOUND responses. - * - * Generated from protobuf field int32 most_common_http_error_code = 3; - */ - private $most_common_http_error_code = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $code - * Indicates the error reason code. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError $scan_config_error - * If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - * message encountered during scan configuration validation that is performed - * before each scan run. - * @type int $most_common_http_error_code - * If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - * common HTTP error code, if such is available. For example, if this code is - * 404, the scan has encountered too many NOT_FOUND responses. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanRunErrorTrace::initOnce(); - parent::__construct($data); - } - - /** - * Indicates the error reason code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code code = 1; - * @return int - */ - public function getCode() - { - return $this->code; - } - - /** - * Indicates the error reason code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code code = 1; - * @param int $var - * @return $this - */ - public function setCode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace\Code::class); - $this->code = $var; - - return $this; - } - - /** - * If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - * message encountered during scan configuration validation that is performed - * before each scan run. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError scan_config_error = 2; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError|null - */ - public function getScanConfigError() - { - return $this->scan_config_error; - } - - public function hasScanConfigError() - { - return isset($this->scan_config_error); - } - - public function clearScanConfigError() - { - unset($this->scan_config_error); - } - - /** - * If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - * message encountered during scan configuration validation that is performed - * before each scan run. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError scan_config_error = 2; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError $var - * @return $this - */ - public function setScanConfigError($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError::class); - $this->scan_config_error = $var; - - return $this; - } - - /** - * If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - * common HTTP error code, if such is available. For example, if this code is - * 404, the scan has encountered too many NOT_FOUND responses. - * - * Generated from protobuf field int32 most_common_http_error_code = 3; - * @return int - */ - public function getMostCommonHttpErrorCode() - { - return $this->most_common_http_error_code; - } - - /** - * If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - * common HTTP error code, if such is available. For example, if this code is - * 404, the scan has encountered too many NOT_FOUND responses. - * - * Generated from protobuf field int32 most_common_http_error_code = 3; - * @param int $var - * @return $this - */ - public function setMostCommonHttpErrorCode($var) - { - GPBUtil::checkInt32($var); - $this->most_common_http_error_code = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanRunErrorTrace/Code.php b/WebSecurityScanner/src/V1beta/ScanRunErrorTrace/Code.php deleted file mode 100644 index 779044e6e53a..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRunErrorTrace/Code.php +++ /dev/null @@ -1,97 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code - */ -class Code -{ - /** - * Default value is never used. - * - * Generated from protobuf enum CODE_UNSPECIFIED = 0; - */ - const CODE_UNSPECIFIED = 0; - /** - * Indicates that the scan run failed due to an internal server error. - * - * Generated from protobuf enum INTERNAL_ERROR = 1; - */ - const INTERNAL_ERROR = 1; - /** - * Indicates a scan configuration error, usually due to outdated ScanConfig - * settings, such as starting_urls or the DNS configuration. - * - * Generated from protobuf enum SCAN_CONFIG_ISSUE = 2; - */ - const SCAN_CONFIG_ISSUE = 2; - /** - * Indicates an authentication error, usually due to outdated ScanConfig - * authentication settings. - * - * Generated from protobuf enum AUTHENTICATION_CONFIG_ISSUE = 3; - */ - const AUTHENTICATION_CONFIG_ISSUE = 3; - /** - * Indicates a scan operation timeout, usually caused by a very large site. - * - * Generated from protobuf enum TIMED_OUT_WHILE_SCANNING = 4; - */ - const TIMED_OUT_WHILE_SCANNING = 4; - /** - * Indicates that a scan encountered excessive redirects, either to - * authentication or some other page outside of the scan scope. - * - * Generated from protobuf enum TOO_MANY_REDIRECTS = 5; - */ - const TOO_MANY_REDIRECTS = 5; - /** - * Indicates that a scan encountered numerous errors from the web site - * pages. When available, most_common_http_error_code field indicates the - * most common HTTP error code encountered during the scan. - * - * Generated from protobuf enum TOO_MANY_HTTP_ERRORS = 6; - */ - const TOO_MANY_HTTP_ERRORS = 6; - - private static $valueToName = [ - self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', - self::INTERNAL_ERROR => 'INTERNAL_ERROR', - self::SCAN_CONFIG_ISSUE => 'SCAN_CONFIG_ISSUE', - self::AUTHENTICATION_CONFIG_ISSUE => 'AUTHENTICATION_CONFIG_ISSUE', - self::TIMED_OUT_WHILE_SCANNING => 'TIMED_OUT_WHILE_SCANNING', - self::TOO_MANY_REDIRECTS => 'TOO_MANY_REDIRECTS', - self::TOO_MANY_HTTP_ERRORS => 'TOO_MANY_HTTP_ERRORS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanRunWarningTrace.php b/WebSecurityScanner/src/V1beta/ScanRunWarningTrace.php deleted file mode 100644 index b83f4a95a1af..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRunWarningTrace.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace - */ -class ScanRunWarningTrace extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates the warning code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code code = 1; - */ - private $code = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $code - * Indicates the warning code. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanRunWarningTrace::initOnce(); - parent::__construct($data); - } - - /** - * Indicates the warning code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code code = 1; - * @return int - */ - public function getCode() - { - return $this->code; - } - - /** - * Indicates the warning code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code code = 1; - * @param int $var - * @return $this - */ - public function setCode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRunWarningTrace\Code::class); - $this->code = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanRunWarningTrace/Code.php b/WebSecurityScanner/src/V1beta/ScanRunWarningTrace/Code.php deleted file mode 100644 index 35bb0edf4be0..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRunWarningTrace/Code.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code - */ -class Code -{ - /** - * Default value is never used. - * - * Generated from protobuf enum CODE_UNSPECIFIED = 0; - */ - const CODE_UNSPECIFIED = 0; - /** - * Indicates that a scan discovered an unexpectedly low number of URLs. This - * is sometimes caused by complex navigation features or by using a single - * URL for numerous pages. - * - * Generated from protobuf enum INSUFFICIENT_CRAWL_RESULTS = 1; - */ - const INSUFFICIENT_CRAWL_RESULTS = 1; - /** - * Indicates that a scan discovered too many URLs to test, or excessive - * redundant URLs. - * - * Generated from protobuf enum TOO_MANY_CRAWL_RESULTS = 2; - */ - const TOO_MANY_CRAWL_RESULTS = 2; - /** - * Indicates that too many tests have been generated for the scan. Customer - * should try reducing the number of starting URLs, increasing the QPS rate, - * or narrowing down the scope of the scan using the excluded patterns. - * - * Generated from protobuf enum TOO_MANY_FUZZ_TASKS = 3; - */ - const TOO_MANY_FUZZ_TASKS = 3; - /** - * Indicates that a scan is blocked by IAP. - * - * Generated from protobuf enum BLOCKED_BY_IAP = 4; - */ - const BLOCKED_BY_IAP = 4; - - private static $valueToName = [ - self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', - self::INSUFFICIENT_CRAWL_RESULTS => 'INSUFFICIENT_CRAWL_RESULTS', - self::TOO_MANY_CRAWL_RESULTS => 'TOO_MANY_CRAWL_RESULTS', - self::TOO_MANY_FUZZ_TASKS => 'TOO_MANY_FUZZ_TASKS', - self::BLOCKED_BY_IAP => 'BLOCKED_BY_IAP', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/StartScanRunRequest.php b/WebSecurityScanner/src/V1beta/StartScanRunRequest.php deleted file mode 100644 index 88c291c52f62..000000000000 --- a/WebSecurityScanner/src/V1beta/StartScanRunRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.websecurityscanner.v1beta.StartScanRunRequest - */ -class StartScanRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/StopScanRunRequest.php b/WebSecurityScanner/src/V1beta/StopScanRunRequest.php deleted file mode 100644 index a7a8c3093ae2..000000000000 --- a/WebSecurityScanner/src/V1beta/StopScanRunRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.websecurityscanner.v1beta.StopScanRunRequest - */ -class StopScanRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/UpdateScanConfigRequest.php b/WebSecurityScanner/src/V1beta/UpdateScanConfigRequest.php deleted file mode 100644 index 73096f603bcd..000000000000 --- a/WebSecurityScanner/src/V1beta/UpdateScanConfigRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest - */ -class UpdateScanConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $scan_config = null; - /** - * Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig $scan_config - * Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig|null - */ - public function getScanConfig() - { - return $this->scan_config; - } - - public function hasScanConfig() - { - return isset($this->scan_config); - } - - public function clearScanConfig() - { - unset($this->scan_config); - } - - /** - * Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig $var - * @return $this - */ - public function setScanConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig::class); - $this->scan_config = $var; - - return $this; - } - - /** - * Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ViolatingResource.php b/WebSecurityScanner/src/V1beta/ViolatingResource.php deleted file mode 100644 index 6189691969f8..000000000000 --- a/WebSecurityScanner/src/V1beta/ViolatingResource.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ViolatingResource - */ -class ViolatingResource extends \Google\Protobuf\Internal\Message -{ - /** - * The MIME type of this resource. - * - * Generated from protobuf field string content_type = 1; - */ - private $content_type = ''; - /** - * URL of this violating resource. - * - * Generated from protobuf field string resource_url = 2; - */ - private $resource_url = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content_type - * The MIME type of this resource. - * @type string $resource_url - * URL of this violating resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * The MIME type of this resource. - * - * Generated from protobuf field string content_type = 1; - * @return string - */ - public function getContentType() - { - return $this->content_type; - } - - /** - * The MIME type of this resource. - * - * Generated from protobuf field string content_type = 1; - * @param string $var - * @return $this - */ - public function setContentType($var) - { - GPBUtil::checkString($var, True); - $this->content_type = $var; - - return $this; - } - - /** - * URL of this violating resource. - * - * Generated from protobuf field string resource_url = 2; - * @return string - */ - public function getResourceUrl() - { - return $this->resource_url; - } - - /** - * URL of this violating resource. - * - * Generated from protobuf field string resource_url = 2; - * @param string $var - * @return $this - */ - public function setResourceUrl($var) - { - GPBUtil::checkString($var, True); - $this->resource_url = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/VulnerableHeaders.php b/WebSecurityScanner/src/V1beta/VulnerableHeaders.php deleted file mode 100644 index 9f1a8f040533..000000000000 --- a/WebSecurityScanner/src/V1beta/VulnerableHeaders.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.websecurityscanner.v1beta.VulnerableHeaders - */ -class VulnerableHeaders extends \Google\Protobuf\Internal\Message -{ - /** - * List of vulnerable headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header headers = 1; - */ - private $headers; - /** - * List of missing headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header missing_headers = 2; - */ - private $missing_headers; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header>|\Google\Protobuf\Internal\RepeatedField $headers - * List of vulnerable headers. - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header>|\Google\Protobuf\Internal\RepeatedField $missing_headers - * List of missing headers. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * List of vulnerable headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header headers = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * List of vulnerable headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header headers = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header::class); - $this->headers = $arr; - - return $this; - } - - /** - * List of missing headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header missing_headers = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMissingHeaders() - { - return $this->missing_headers; - } - - /** - * List of missing headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header missing_headers = 2; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMissingHeaders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header::class); - $this->missing_headers = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/VulnerableHeaders/Header.php b/WebSecurityScanner/src/V1beta/VulnerableHeaders/Header.php deleted file mode 100644 index 607df91305dd..000000000000 --- a/WebSecurityScanner/src/V1beta/VulnerableHeaders/Header.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header - */ -class Header extends \Google\Protobuf\Internal\Message -{ - /** - * Header name. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Header value. - * - * Generated from protobuf field string value = 2; - */ - private $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Header name. - * @type string $value - * Header value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * Header name. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Header name. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Header value. - * - * Generated from protobuf field string value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Header value. - * - * Generated from protobuf field string value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/VulnerableParameters.php b/WebSecurityScanner/src/V1beta/VulnerableParameters.php deleted file mode 100644 index 97f40daec8ea..000000000000 --- a/WebSecurityScanner/src/V1beta/VulnerableParameters.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.websecurityscanner.v1beta.VulnerableParameters - */ -class VulnerableParameters extends \Google\Protobuf\Internal\Message -{ - /** - * The vulnerable parameter names. - * - * Generated from protobuf field repeated string parameter_names = 1; - */ - private $parameter_names; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $parameter_names - * The vulnerable parameter names. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * The vulnerable parameter names. - * - * Generated from protobuf field repeated string parameter_names = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getParameterNames() - { - return $this->parameter_names; - } - - /** - * The vulnerable parameter names. - * - * Generated from protobuf field repeated string parameter_names = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setParameterNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->parameter_names = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/WebSecurityScannerClient.php b/WebSecurityScanner/src/V1beta/WebSecurityScannerClient.php deleted file mode 100644 index 827b581bf9bb..000000000000 --- a/WebSecurityScanner/src/V1beta/WebSecurityScannerClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/CreateScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Deletes an existing ScanConfig and its child resources. - * @param \Google\Cloud\WebSecurityScanner\V1beta\DeleteScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteScanConfig(\Google\Cloud\WebSecurityScanner\V1beta\DeleteScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/DeleteScanConfig', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets a ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1beta\GetScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetScanConfig(\Google\Cloud\WebSecurityScanner\V1beta\GetScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Lists ScanConfigs under a given project. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListScanConfigsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListScanConfigs(\Google\Cloud\WebSecurityScanner\V1beta\ListScanConfigsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanConfigs', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListScanConfigsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a ScanConfig. This method support partial update of a ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1beta\UpdateScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateScanConfig(\Google\Cloud\WebSecurityScanner\V1beta\UpdateScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/UpdateScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Start a ScanRun according to the given ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1beta\StartScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StartScanRun(\Google\Cloud\WebSecurityScanner\V1beta\StartScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StartScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * Gets a ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1beta\GetScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetScanRun(\Google\Cloud\WebSecurityScanner\V1beta\GetScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - * stop time. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListScanRunsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListScanRuns(\Google\Cloud\WebSecurityScanner\V1beta\ListScanRunsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanRuns', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListScanRunsResponse', 'decode'], - $metadata, $options); - } - - /** - * Stops a ScanRun. The stopped ScanRun is returned. - * @param \Google\Cloud\WebSecurityScanner\V1beta\StopScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StopScanRun(\Google\Cloud\WebSecurityScanner\V1beta\StopScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StopScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * List CrawledUrls under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListCrawledUrlsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListCrawledUrls(\Google\Cloud\WebSecurityScanner\V1beta\ListCrawledUrlsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListCrawledUrls', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListCrawledUrlsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a Finding. - * @param \Google\Cloud\WebSecurityScanner\V1beta\GetFindingRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFinding(\Google\Cloud\WebSecurityScanner\V1beta\GetFindingRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetFinding', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\Finding', 'decode'], - $metadata, $options); - } - - /** - * List Findings under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListFindingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFindings(\Google\Cloud\WebSecurityScanner\V1beta\ListFindingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindings', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListFindingsResponse', 'decode'], - $metadata, $options); - } - - /** - * List all FindingTypeStats under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListFindingTypeStatsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFindingTypeStats(\Google\Cloud\WebSecurityScanner\V1beta\ListFindingTypeStatsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindingTypeStats', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListFindingTypeStatsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/WebSecurityScanner/src/V1beta/Xss.php b/WebSecurityScanner/src/V1beta/Xss.php deleted file mode 100644 index f12e4dca81cb..000000000000 --- a/WebSecurityScanner/src/V1beta/Xss.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.websecurityscanner.v1beta.Xss - */ -class Xss extends \Google\Protobuf\Internal\Message -{ - /** - * Stack traces leading to the point where the XSS occurred. - * - * Generated from protobuf field repeated string stack_traces = 1; - */ - private $stack_traces; - /** - * An error message generated by a javascript breakage. - * - * Generated from protobuf field string error_message = 2; - */ - private $error_message = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $stack_traces - * Stack traces leading to the point where the XSS occurred. - * @type string $error_message - * An error message generated by a javascript breakage. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * Stack traces leading to the point where the XSS occurred. - * - * Generated from protobuf field repeated string stack_traces = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStackTraces() - { - return $this->stack_traces; - } - - /** - * Stack traces leading to the point where the XSS occurred. - * - * Generated from protobuf field repeated string stack_traces = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStackTraces($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->stack_traces = $arr; - - return $this; - } - - /** - * An error message generated by a javascript breakage. - * - * Generated from protobuf field string error_message = 2; - * @return string - */ - public function getErrorMessage() - { - return $this->error_message; - } - - /** - * An error message generated by a javascript breakage. - * - * Generated from protobuf field string error_message = 2; - * @param string $var - * @return $this - */ - public function setErrorMessage($var) - { - GPBUtil::checkString($var, True); - $this->error_message = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/gapic_metadata.json b/WebSecurityScanner/src/V1beta/gapic_metadata.json deleted file mode 100644 index d4fd47e4dfb8..000000000000 --- a/WebSecurityScanner/src/V1beta/gapic_metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.websecurityscanner.v1beta", - "libraryPackage": "Google\\Cloud\\WebSecurityScanner\\V1beta", - "services": { - "WebSecurityScanner": { - "clients": { - "grpc": { - "libraryClient": "WebSecurityScannerGapicClient", - "rpcs": { - "CreateScanConfig": { - "methods": [ - "createScanConfig" - ] - }, - "DeleteScanConfig": { - "methods": [ - "deleteScanConfig" - ] - }, - "GetFinding": { - "methods": [ - "getFinding" - ] - }, - "GetScanConfig": { - "methods": [ - "getScanConfig" - ] - }, - "GetScanRun": { - "methods": [ - "getScanRun" - ] - }, - "ListCrawledUrls": { - "methods": [ - "listCrawledUrls" - ] - }, - "ListFindingTypeStats": { - "methods": [ - "listFindingTypeStats" - ] - }, - "ListFindings": { - "methods": [ - "listFindings" - ] - }, - "ListScanConfigs": { - "methods": [ - "listScanConfigs" - ] - }, - "ListScanRuns": { - "methods": [ - "listScanRuns" - ] - }, - "StartScanRun": { - "methods": [ - "startScanRun" - ] - }, - "StopScanRun": { - "methods": [ - "stopScanRun" - ] - }, - "UpdateScanConfig": { - "methods": [ - "updateScanConfig" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_client_config.json b/WebSecurityScanner/src/V1beta/resources/web_security_scanner_client_config.json deleted file mode 100644 index e905462ef39f..000000000000 --- a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_client_config.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "interfaces": { - "google.cloud.websecurityscanner.v1beta.WebSecurityScanner": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateScanConfig": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteScanConfig": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetFinding": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetScanConfig": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetScanRun": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListCrawledUrls": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListFindingTypeStats": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListFindings": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListScanConfigs": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListScanRuns": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "StartScanRun": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "StopScanRun": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateScanConfig": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_descriptor_config.php b/WebSecurityScanner/src/V1beta/resources/web_security_scanner_descriptor_config.php deleted file mode 100644 index 2e4d71ba0b62..000000000000 --- a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_descriptor_config.php +++ /dev/null @@ -1,68 +0,0 @@ - [ - 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner' => [ - 'ListCrawledUrls' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCrawledUrls', - ], - ], - 'ListFindings' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFindings', - ], - ], - 'ListScanConfigs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getScanConfigs', - ], - ], - 'ListScanRuns' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getScanRuns', - ], - ], - ], - ], -]; diff --git a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_rest_client_config.php b/WebSecurityScanner/src/V1beta/resources/web_security_scanner_rest_client_config.php deleted file mode 100644 index 1cd7634cf0da..000000000000 --- a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_rest_client_config.php +++ /dev/null @@ -1,183 +0,0 @@ - [ - 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner' => [ - 'CreateScanConfig' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*}/scanConfigs', - 'body' => 'scan_config', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteScanConfig' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFinding' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetScanConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetScanRun' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListCrawledUrls' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListFindingTypeStats' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListFindings' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'filter', - ], - ], - 'ListScanConfigs' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*}/scanConfigs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListScanRuns' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'StartScanRun' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*}:start', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'StopScanRun' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateScanConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{scan_config.name=projects/*/scanConfigs/*}', - 'body' => 'scan_config', - 'placeholders' => [ - 'scan_config.name' => [ - 'getters' => [ - 'getScanConfig', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/WebSecurityScanner/tests/Unit/V1/Client/WebSecurityScannerClientTest.php b/WebSecurityScanner/tests/Unit/V1/Client/WebSecurityScannerClientTest.php index c9d375b48fdc..c2f1d0615160 100644 --- a/WebSecurityScanner/tests/Unit/V1/Client/WebSecurityScannerClientTest.php +++ b/WebSecurityScanner/tests/Unit/V1/Client/WebSecurityScannerClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return WebSecurityScannerClient */ @@ -126,12 +128,15 @@ public function createScanConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new CreateScanConfigRequest(); try { @@ -179,12 +184,15 @@ public function deleteScanConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new DeleteScanConfigRequest(); try { @@ -253,12 +261,15 @@ public function getFindingExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetFindingRequest(); try { @@ -319,12 +330,15 @@ public function getScanConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetScanConfigRequest(); try { @@ -383,12 +397,15 @@ public function getScanRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetScanRunRequest(); try { @@ -415,9 +432,7 @@ public function listCrawledUrlsTest() // Mock response $nextPageToken = ''; $crawledUrlsElement = new CrawledUrl(); - $crawledUrls = [ - $crawledUrlsElement, - ]; + $crawledUrls = [$crawledUrlsElement]; $expectedResponse = new ListCrawledUrlsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCrawledUrls($crawledUrls); @@ -447,12 +462,15 @@ public function listCrawledUrlsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListCrawledUrlsRequest(); try { @@ -486,7 +504,10 @@ public function listFindingTypeStatsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindingTypeStats', $actualFuncCall); + $this->assertSame( + '/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindingTypeStats', + $actualFuncCall + ); $this->assertTrue($transport->isExhausted()); } @@ -501,12 +522,15 @@ public function listFindingTypeStatsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListFindingTypeStatsRequest(); try { @@ -533,9 +557,7 @@ public function listFindingsTest() // Mock response $nextPageToken = ''; $findingsElement = new Finding(); - $findings = [ - $findingsElement, - ]; + $findings = [$findingsElement]; $expectedResponse = new ListFindingsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFindings($findings); @@ -565,12 +587,15 @@ public function listFindingsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListFindingsRequest(); try { @@ -597,9 +622,7 @@ public function listScanConfigsTest() // Mock response $nextPageToken = ''; $scanConfigsElement = new ScanConfig(); - $scanConfigs = [ - $scanConfigsElement, - ]; + $scanConfigs = [$scanConfigsElement]; $expectedResponse = new ListScanConfigsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setScanConfigs($scanConfigs); @@ -629,12 +652,15 @@ public function listScanConfigsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListScanConfigsRequest(); try { @@ -661,9 +687,7 @@ public function listScanRunsTest() // Mock response $nextPageToken = ''; $scanRunsElement = new ScanRun(); - $scanRuns = [ - $scanRunsElement, - ]; + $scanRuns = [$scanRunsElement]; $expectedResponse = new ListScanRunsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setScanRuns($scanRuns); @@ -693,12 +717,15 @@ public function listScanRunsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListScanRunsRequest(); try { @@ -757,12 +784,15 @@ public function startScanRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new StartScanRunRequest(); try { @@ -821,12 +851,15 @@ public function stopScanRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new StopScanRunRequest(); try { @@ -887,12 +920,15 @@ public function updateScanConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new UpdateScanConfigRequest(); try { diff --git a/WebSecurityScanner/tests/Unit/V1beta/WebSecurityScannerClientTest.php b/WebSecurityScanner/tests/Unit/V1beta/WebSecurityScannerClientTest.php deleted file mode 100644 index 2b85b60f324b..000000000000 --- a/WebSecurityScanner/tests/Unit/V1beta/WebSecurityScannerClientTest.php +++ /dev/null @@ -1,960 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return WebSecurityScannerClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new WebSecurityScannerClient($options); - } - - /** @test */ - public function createScanConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $maxQps = 844445913; - $expectedResponse = new ScanConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxQps($maxQps); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $scanConfig = new ScanConfig(); - $scanConfigDisplayName = 'scanConfigDisplayName-609132338'; - $scanConfig->setDisplayName($scanConfigDisplayName); - $scanConfigStartingUrls = []; - $scanConfig->setStartingUrls($scanConfigStartingUrls); - $response = $gapicClient->createScanConfig($formattedParent, $scanConfig); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/CreateScanConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getScanConfig(); - $this->assertProtobufEquals($scanConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createScanConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $scanConfig = new ScanConfig(); - $scanConfigDisplayName = 'scanConfigDisplayName-609132338'; - $scanConfig->setDisplayName($scanConfigDisplayName); - $scanConfigStartingUrls = []; - $scanConfig->setStartingUrls($scanConfigStartingUrls); - try { - $gapicClient->createScanConfig($formattedParent, $scanConfig); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteScanConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - $gapicClient->deleteScanConfig($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/DeleteScanConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteScanConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - try { - $gapicClient->deleteScanConfig($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFindingTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $findingType = 'findingType274496048'; - $httpMethod = 'httpMethod820747384'; - $fuzzedUrl = 'fuzzedUrl-2120677666'; - $body = 'body3029410'; - $description = 'description-1724546052'; - $reproductionUrl = 'reproductionUrl-244934180'; - $frameUrl = 'frameUrl545464221'; - $finalUrl = 'finalUrl355601190'; - $trackingId = 'trackingId1878901667'; - $expectedResponse = new Finding(); - $expectedResponse->setName($name2); - $expectedResponse->setFindingType($findingType); - $expectedResponse->setHttpMethod($httpMethod); - $expectedResponse->setFuzzedUrl($fuzzedUrl); - $expectedResponse->setBody($body); - $expectedResponse->setDescription($description); - $expectedResponse->setReproductionUrl($reproductionUrl); - $expectedResponse->setFrameUrl($frameUrl); - $expectedResponse->setFinalUrl($finalUrl); - $expectedResponse->setTrackingId($trackingId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->findingName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]', '[FINDING]'); - $response = $gapicClient->getFinding($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetFinding', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFindingExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->findingName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]', '[FINDING]'); - try { - $gapicClient->getFinding($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getScanConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $maxQps = 844445913; - $expectedResponse = new ScanConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxQps($maxQps); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - $response = $gapicClient->getScanConfig($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getScanConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - try { - $gapicClient->getScanConfig($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getScanRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $urlsCrawledCount = 1749797253; - $urlsTestedCount = 1498664068; - $hasVulnerabilities = false; - $progressPercent = 2137894861; - $expectedResponse = new ScanRun(); - $expectedResponse->setName($name2); - $expectedResponse->setUrlsCrawledCount($urlsCrawledCount); - $expectedResponse->setUrlsTestedCount($urlsTestedCount); - $expectedResponse->setHasVulnerabilities($hasVulnerabilities); - $expectedResponse->setProgressPercent($progressPercent); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $response = $gapicClient->getScanRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getScanRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - try { - $gapicClient->getScanRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCrawledUrlsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $crawledUrlsElement = new CrawledUrl(); - $crawledUrls = [ - $crawledUrlsElement, - ]; - $expectedResponse = new ListCrawledUrlsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCrawledUrls($crawledUrls); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $response = $gapicClient->listCrawledUrls($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCrawledUrls()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListCrawledUrls', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCrawledUrlsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - try { - $gapicClient->listCrawledUrls($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFindingTypeStatsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListFindingTypeStatsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $response = $gapicClient->listFindingTypeStats($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindingTypeStats', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFindingTypeStatsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - try { - $gapicClient->listFindingTypeStats($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFindingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $findingsElement = new Finding(); - $findings = [ - $findingsElement, - ]; - $expectedResponse = new ListFindingsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFindings($findings); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->listFindings($formattedParent, $filter); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFindings()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindings', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getFilter(); - $this->assertProtobufEquals($filter, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFindingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $filter = 'filter-1274492040'; - try { - $gapicClient->listFindings($formattedParent, $filter); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listScanConfigsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $scanConfigsElement = new ScanConfig(); - $scanConfigs = [ - $scanConfigsElement, - ]; - $expectedResponse = new ListScanConfigsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setScanConfigs($scanConfigs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listScanConfigs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getScanConfigs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanConfigs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listScanConfigsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listScanConfigs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listScanRunsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $scanRunsElement = new ScanRun(); - $scanRuns = [ - $scanRunsElement, - ]; - $expectedResponse = new ListScanRunsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setScanRuns($scanRuns); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - $response = $gapicClient->listScanRuns($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getScanRuns()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanRuns', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listScanRunsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - try { - $gapicClient->listScanRuns($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function startScanRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $urlsCrawledCount = 1749797253; - $urlsTestedCount = 1498664068; - $hasVulnerabilities = false; - $progressPercent = 2137894861; - $expectedResponse = new ScanRun(); - $expectedResponse->setName($name2); - $expectedResponse->setUrlsCrawledCount($urlsCrawledCount); - $expectedResponse->setUrlsTestedCount($urlsTestedCount); - $expectedResponse->setHasVulnerabilities($hasVulnerabilities); - $expectedResponse->setProgressPercent($progressPercent); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - $response = $gapicClient->startScanRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StartScanRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function startScanRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - try { - $gapicClient->startScanRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function stopScanRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $urlsCrawledCount = 1749797253; - $urlsTestedCount = 1498664068; - $hasVulnerabilities = false; - $progressPercent = 2137894861; - $expectedResponse = new ScanRun(); - $expectedResponse->setName($name2); - $expectedResponse->setUrlsCrawledCount($urlsCrawledCount); - $expectedResponse->setUrlsTestedCount($urlsTestedCount); - $expectedResponse->setHasVulnerabilities($hasVulnerabilities); - $expectedResponse->setProgressPercent($progressPercent); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $response = $gapicClient->stopScanRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StopScanRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function stopScanRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - try { - $gapicClient->stopScanRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateScanConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $maxQps = 844445913; - $expectedResponse = new ScanConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxQps($maxQps); - $transport->addResponse($expectedResponse); - // Mock request - $scanConfig = new ScanConfig(); - $scanConfigDisplayName = 'scanConfigDisplayName-609132338'; - $scanConfig->setDisplayName($scanConfigDisplayName); - $scanConfigStartingUrls = []; - $scanConfig->setStartingUrls($scanConfigStartingUrls); - $updateMask = new FieldMask(); - $response = $gapicClient->updateScanConfig($scanConfig, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/UpdateScanConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getScanConfig(); - $this->assertProtobufEquals($scanConfig, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateScanConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $scanConfig = new ScanConfig(); - $scanConfigDisplayName = 'scanConfigDisplayName-609132338'; - $scanConfig->setDisplayName($scanConfigDisplayName); - $scanConfigStartingUrls = []; - $scanConfig->setStartingUrls($scanConfigStartingUrls); - $updateMask = new FieldMask(); - try { - $gapicClient->updateScanConfig($scanConfig, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Workflows/.repo-metadata.json b/Workflows/.repo-metadata.json deleted file mode 100644 index 9eeb7a765c88..000000000000 --- a/Workflows/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-workflows", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-workflows/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "workflows" -} diff --git a/Workflows/VERSION b/Workflows/VERSION index be14282b7fff..d1d899fa33a0 100644 --- a/Workflows/VERSION +++ b/Workflows/VERSION @@ -1 +1 @@ -0.5.3 +0.5.5 diff --git a/Workflows/composer.json b/Workflows/composer.json index 34810860ae90..1c8effb4daa7 100644 --- a/Workflows/composer.json +++ b/Workflows/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.0", - "google/gax": "^1.30" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0" diff --git a/Workflows/src/V1/Client/WorkflowsClient.php b/Workflows/src/V1/Client/WorkflowsClient.php index badb9dff45cb..3bec921a9945 100644 --- a/Workflows/src/V1/Client/WorkflowsClient.php +++ b/Workflows/src/V1/Client/WorkflowsClient.php @@ -27,7 +27,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\OperationResponse; use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; @@ -44,6 +43,7 @@ use Google\Cloud\Workflows\V1\ListWorkflowsRequest; use Google\Cloud\Workflows\V1\UpdateWorkflowRequest; use Google\Cloud\Workflows\V1\Workflow; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -147,6 +147,25 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a crypto_key * resource. diff --git a/Workflows/tests/Unit/V1/Client/WorkflowsClientTest.php b/Workflows/tests/Unit/V1/Client/WorkflowsClientTest.php index 2171345be81d..c4a14b92c79e 100644 --- a/Workflows/tests/Unit/V1/Client/WorkflowsClientTest.php +++ b/Workflows/tests/Unit/V1/Client/WorkflowsClientTest.php @@ -24,7 +24,6 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; -use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Location\GetLocationRequest; @@ -39,6 +38,7 @@ use Google\Cloud\Workflows\V1\ListWorkflowsResponse; use Google\Cloud\Workflows\V1\UpdateWorkflowRequest; use Google\Cloud\Workflows\V1\Workflow; +use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; diff --git a/composer.json b/composer.json index 3a04d2bb630b..44eae7d2bb96 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "monolog/monolog": "^2.9||^3.0", "psr/http-message": "^1.0|^2.0", "ramsey/uuid": "^4.0", - "google/gax": "^1.32", + "google/gax": "^1.34.0", "google/common-protos": "^4.4", "google/auth": "^1.34" }, @@ -64,190 +64,205 @@ "flix-tech/avro-php": "^5.0.0", "phpspec/prophecy-phpunit": "^2.1", "kreait/firebase-php": "^6.9", - "psr/log": "^2.0||^3.0" + "psr/log": "^2.0||^3.0", + "dg/bypass-finals": "^1.7" }, "conflict": { "psr/log": ">=3" }, "replace": { - "google/access-context-manager": "0.5.3", - "google/analytics-admin": "0.22.3", - "google/analytics-data": "0.16.3", - "google/apps-chat": "0.1.0", - "google/apps-events-subscriptions": "0.1.1", - "google/apps-meet": "0.2.1", - "google/cloud-access-approval": "1.2.3", - "google/cloud-advisorynotifications": "0.8.1", - "google/cloud-ai-platform": "0.37.1", - "google/cloud-alloydb": "0.10.1", - "google/cloud-api-gateway": "1.3.3", - "google/cloud-api-keys": "0.4.3", - "google/cloud-apigee-connect": "1.2.3", - "google/cloud-apigee-registry": "0.5.3", - "google/cloud-appengine-admin": "1.3.3", - "google/cloud-apphub": "0.1.1", - "google/cloud-artifact-registry": "0.6.3", - "google/cloud-asset": "1.16.1", - "google/cloud-assured-workloads": "0.11.3", - "google/cloud-automl": "1.6.3", - "google/cloud-bare-metal-solution": "0.6.3", - "google/cloud-batch": "0.16.6", - "google/cloud-beyondcorp-appconnections": "0.4.3", - "google/cloud-beyondcorp-appconnectors": "0.4.3", - "google/cloud-beyondcorp-appgateways": "0.4.3", - "google/cloud-beyondcorp-clientconnectorservices": "0.4.3", - "google/cloud-beyondcorp-clientgateways": "0.4.3", - "google/cloud-bigquery": "1.30.1", - "google/cloud-bigquery-analyticshub": "0.5.1", - "google/cloud-bigquery-connection": "1.5.3", - "google/cloud-bigquery-data-exchange": "0.4.3", - "google/cloud-bigquery-datapolicies": "0.5.3", - "google/cloud-bigquery-migration": "0.4.3", - "google/cloud-bigquery-reservation": "1.3.3", - "google/cloud-bigquery-storage": "1.10.2", - "google/cloud-bigquerydatatransfer": "1.8.3", - "google/cloud-bigtable": "1.31.0", - "google/cloud-billing": "1.9.5", - "google/cloud-billing-budgets": "1.4.3", - "google/cloud-binary-authorization": "0.8.5", - "google/cloud-build": "0.16.1", - "google/cloud-certificate-manager": "0.7.1", - "google/cloud-channel": "1.9.3", - "google/cloud-cloudcontrolspartner": "0.1.1", - "google/cloud-commerce-consumer-procurement": "0.2.3", - "google/cloud-common-protos": "0.5.1", - "google/cloud-compute": "1.16.2", - "google/cloud-confidentialcomputing": "0.8.1", - "google/cloud-config": "0.5.0", - "google/cloud-contact-center-insights": "1.9.3", - "google/cloud-container": "1.30.1", - "google/cloud-container-analysis": "0.5.5", - "google/cloud-core": "1.58.0", - "google/cloud-data-catalog": "1.10.1", - "google/cloud-data-fusion": "0.6.3", - "google/cloud-datacatalog-lineage": "0.5.3", - "google/cloud-dataflow": "0.6.2", - "google/cloud-dataform": "0.4.3", - "google/cloud-datalabeling": "0.5.3", - "google/cloud-dataplex": "0.15.1", - "google/cloud-dataproc": "3.13.2", - "google/cloud-dataproc-metastore": "0.11.3", - "google/cloud-datastore": "1.28.1", - "google/cloud-datastore-admin": "0.8.3", - "google/cloud-datastream": "1.5.3", - "google/cloud-debugger": "1.8.5", - "google/cloud-deploy": "0.18.0", - "google/cloud-dialogflow": "1.12.1", - "google/cloud-dialogflow-cx": "0.3.2", - "google/cloud-discoveryengine": "0.11.1", - "google/cloud-dlp": "1.13.1", - "google/cloud-dms": "1.5.3", - "google/cloud-document-ai": "1.12.0", - "google/cloud-domains": "0.5.3", - "google/cloud-edgenetwork": "0.3.4", - "google/cloud-error-reporting": "0.22.4", - "google/cloud-essential-contacts": "0.4.3", - "google/cloud-eventarc": "1.3.3", - "google/cloud-eventarc-publishing": "0.6.2", - "google/cloud-filestore": "1.5.5", - "google/cloud-firestore": "1.43.1", - "google/cloud-functions": "1.6.3", - "google/cloud-game-servers": "1.2.4", - "google/cloud-gke-backup": "0.7.1", - "google/cloud-gke-connect-gateway": "0.4.2", - "google/cloud-gke-hub": "0.9.3", - "google/cloud-gke-multi-cloud": "0.5.3", - "google/cloud-gsuite-addons": "0.3.3", - "google/cloud-iam": "0.5.3", - "google/cloud-iam-credentials": "1.2.3", - "google/cloud-iap": "1.4.3", - "google/cloud-ids": "0.5.3", - "google/cloud-iot": "1.7.3", - "google/cloud-kms": "1.21.3", - "google/cloud-kms-inventory": "0.4.3", - "google/cloud-language": "0.32.4", - "google/cloud-life-sciences": "0.6.3", - "google/cloud-logging": "1.30.0", - "google/cloud-managed-identities": "1.3.3", - "google/cloud-media-translation": "0.4.2", - "google/cloud-memcache": "1.3.3", - "google/cloud-migrationcenter": "0.4.3", - "google/cloud-monitoring": "1.10.1", - "google/cloud-netapp": "0.2.5", - "google/cloud-network-connectivity": "1.5.3", - "google/cloud-network-management": "1.7.1", - "google/cloud-network-security": "0.6.3", - "google/cloud-notebooks": "0.7.3", - "google/cloud-optimization": "0.6.3", - "google/cloud-orchestration-airflow": "1.6.2", - "google/cloud-org-policy": "0.6.3", - "google/cloud-osconfig": "1.3.3", - "google/cloud-oslogin": "1.9.3", - "google/cloud-parallelstore": "0.1.1", - "google/cloud-policy-troubleshooter": "1.3.2", - "google/cloud-policysimulator": "0.2.3", - "google/cloud-policytroubleshooter-iam": "0.2.3", - "google/cloud-private-catalog": "0.4.2", - "google/cloud-profiler": "1.4.1", - "google/cloud-pubsub": "2.1.1", - "google/cloud-quotas": "0.2.1", - "google/cloud-rapidmigrationassessment": "0.3.3", - "google/cloud-recaptcha-enterprise": "1.12.0", - "google/cloud-recommendations-ai": "0.7.3", - "google/cloud-recommender": "1.11.3", - "google/cloud-redis": "1.9.3", - "google/cloud-redis-cluster": "0.2.3", - "google/cloud-resource-manager": "0.8.3", - "google/cloud-resource-settings": "1.2.3", - "google/cloud-retail": "1.6.2", - "google/cloud-run": "0.9.1", - "google/cloud-scheduler": "1.10.3", - "google/cloud-secret-manager": "1.15.0", - "google/cloud-securesourcemanager": "0.2.3", - "google/cloud-security-center": "1.28.0", - "google/cloud-security-private-ca": "1.7.1", - "google/cloud-security-public-ca": "0.3.3", - "google/cloud-securitycentermanagement": "0.2.6", - "google/cloud-service-control": "1.4.2", - "google/cloud-service-directory": "1.3.3", - "google/cloud-service-management": "1.3.3", - "google/cloud-service-usage": "1.3.2", - "google/cloud-servicehealth": "0.1.4", - "google/cloud-shell": "1.3.3", - "google/cloud-spanner": "1.76.0", - "google/cloud-speech": "1.18.1", - "google/cloud-sql-admin": "0.16.1", - "google/cloud-storage": "1.41.3", - "google/cloud-storage-control": "0.1.0", - "google/cloud-storage-transfer": "1.4.3", - "google/cloud-storageinsights": "0.3.3", - "google/cloud-support": "0.2.3", - "google/cloud-talent": "1.3.3", - "google/cloud-tasks": "1.14.4", - "google/cloud-telcoautomation": "0.2.3", - "google/cloud-text-to-speech": "1.8.3", - "google/cloud-tpu": "1.4.3", - "google/cloud-trace": "1.8.4", - "google/cloud-translate": "1.17.5", - "google/cloud-video-live-stream": "0.7.3", - "google/cloud-video-stitcher": "0.8.3", - "google/cloud-video-transcoder": "0.10.3", - "google/cloud-videointelligence": "1.15.3", - "google/cloud-vision": "1.9.2", - "google/cloud-vm-migration": "0.6.3", - "google/cloud-vmware-engine": "0.5.4", - "google/cloud-vpc-access": "1.3.3", - "google/cloud-web-risk": "1.5.3", - "google/cloud-web-security-scanner": "0.8.3", - "google/cloud-workflows": "0.5.3", - "google/grafeas": "0.10.1", - "google/longrunning": "0.4.1", - "google/shopping-common-protos": "0.3.0", - "google/shopping-css": "0.2.4", - "google/shopping-merchant-conversions": "0.0.0", - "google/shopping-merchant-inventories": "0.4.1", - "google/shopping-merchant-quota": "0.1.1", - "google/shopping-merchant-reports": "0.7.1" + "google/access-context-manager": "0.5.5", + "google/analytics-admin": "0.22.5", + "google/analytics-data": "0.17.1", + "google/apps-chat": "0.1.3", + "google/apps-events-subscriptions": "0.1.3", + "google/apps-meet": "0.2.3", + "google/cloud-access-approval": "1.2.5", + "google/cloud-advisorynotifications": "0.8.3", + "google/cloud-ai-platform": "0.39.0", + "google/cloud-alloydb": "0.10.3", + "google/cloud-api-gateway": "1.3.5", + "google/cloud-api-keys": "0.4.5", + "google/cloud-apigee-connect": "1.2.5", + "google/cloud-apigee-registry": "0.5.5", + "google/cloud-appengine-admin": "1.3.5", + "google/cloud-apphub": "0.1.3", + "google/cloud-artifact-registry": "0.6.5", + "google/cloud-asset": "1.16.3", + "google/cloud-assured-workloads": "0.11.5", + "google/cloud-automl": "1.6.5", + "google/cloud-backupdr": "0.1.0", + "google/cloud-bare-metal-solution": "0.6.5", + "google/cloud-batch": "0.16.10", + "google/cloud-beyondcorp-appconnections": "0.4.5", + "google/cloud-beyondcorp-appconnectors": "0.4.5", + "google/cloud-beyondcorp-appgateways": "0.4.5", + "google/cloud-beyondcorp-clientconnectorservices": "0.4.5", + "google/cloud-beyondcorp-clientgateways": "0.4.5", + "google/cloud-bigquery": "1.30.3", + "google/cloud-bigquery-analyticshub": "0.5.3", + "google/cloud-bigquery-connection": "1.5.5", + "google/cloud-bigquery-data-exchange": "0.4.5", + "google/cloud-bigquery-datapolicies": "0.5.5", + "google/cloud-bigquery-migration": "0.4.5", + "google/cloud-bigquery-reservation": "1.3.5", + "google/cloud-bigquery-storage": "1.10.4", + "google/cloud-bigquerydatatransfer": "1.8.5", + "google/cloud-bigtable": "2.0.0-RC1", + "google/cloud-billing": "1.9.7", + "google/cloud-billing-budgets": "1.4.5", + "google/cloud-binary-authorization": "0.8.7", + "google/cloud-build": "0.16.3", + "google/cloud-certificate-manager": "0.7.3", + "google/cloud-channel": "1.9.5", + "google/cloud-cloudcontrolspartner": "0.1.3", + "google/cloud-commerce-consumer-procurement": "0.2.5", + "google/cloud-common-protos": "0.5.2", + "google/cloud-compute": "1.18.1", + "google/cloud-confidentialcomputing": "0.8.3", + "google/cloud-config": "0.5.2", + "google/cloud-contact-center-insights": "1.9.5", + "google/cloud-container": "1.31.0", + "google/cloud-container-analysis": "0.5.7", + "google/cloud-core": "1.59.0", + "google/cloud-data-catalog": "1.10.3", + "google/cloud-data-fusion": "0.6.5", + "google/cloud-datacatalog-lineage": "0.5.5", + "google/cloud-dataflow": "0.6.4", + "google/cloud-dataform": "0.4.5", + "google/cloud-datalabeling": "0.5.5", + "google/cloud-dataplex": "0.16.1", + "google/cloud-dataproc": "3.13.4", + "google/cloud-dataproc-metastore": "0.11.5", + "google/cloud-datastore": "1.29.1", + "google/cloud-datastore-admin": "0.8.5", + "google/cloud-datastream": "1.5.5", + "google/cloud-debugger": "1.8.7", + "google/cloud-deploy": "0.19.1", + "google/cloud-developerconnect": "0.1.1", + "google/cloud-dialogflow": "1.12.3", + "google/cloud-dialogflow-cx": "0.3.4", + "google/cloud-discoveryengine": "0.11.3", + "google/cloud-dlp": "1.15.1", + "google/cloud-dms": "1.5.5", + "google/cloud-document-ai": "1.13.0", + "google/cloud-domains": "0.5.5", + "google/cloud-edgenetwork": "0.3.6", + "google/cloud-error-reporting": "0.22.6", + "google/cloud-essential-contacts": "0.4.5", + "google/cloud-eventarc": "1.3.5", + "google/cloud-eventarc-publishing": "0.6.4", + "google/cloud-filestore": "1.5.7", + "google/cloud-firestore": "1.43.3", + "google/cloud-functions": "1.6.5", + "google/cloud-game-servers": "1.2.6", + "google/cloud-gke-backup": "0.8.1", + "google/cloud-gke-connect-gateway": "0.4.4", + "google/cloud-gke-hub": "0.9.5", + "google/cloud-gke-multi-cloud": "0.6.1", + "google/cloud-gsuite-addons": "0.3.5", + "google/cloud-iam": "0.5.5", + "google/cloud-iam-credentials": "1.2.5", + "google/cloud-iap": "1.4.5", + "google/cloud-ids": "0.5.5", + "google/cloud-iot": "1.7.5", + "google/cloud-kms": "1.22.1", + "google/cloud-kms-inventory": "0.4.5", + "google/cloud-language": "0.32.6", + "google/cloud-life-sciences": "0.6.5", + "google/cloud-logging": "1.30.2", + "google/cloud-managed-identities": "1.3.5", + "google/cloud-managedkafka": "0.0.0", + "google/cloud-media-translation": "0.4.4", + "google/cloud-memcache": "1.3.5", + "google/cloud-migrationcenter": "0.4.5", + "google/cloud-monitoring": "1.10.3", + "google/cloud-netapp": "0.3.1", + "google/cloud-network-connectivity": "1.5.5", + "google/cloud-network-management": "1.7.3", + "google/cloud-network-security": "0.6.5", + "google/cloud-networkservices": "0.1.0", + "google/cloud-notebooks": "0.7.5", + "google/cloud-optimization": "0.6.5", + "google/cloud-orchestration-airflow": "1.6.4", + "google/cloud-org-policy": "0.6.5", + "google/cloud-osconfig": "1.3.5", + "google/cloud-oslogin": "1.9.5", + "google/cloud-parallelstore": "0.3.1", + "google/cloud-policy-troubleshooter": "1.3.4", + "google/cloud-policysimulator": "0.2.5", + "google/cloud-policytroubleshooter-iam": "0.2.5", + "google/cloud-private-catalog": "0.4.4", + "google/cloud-profiler": "1.4.3", + "google/cloud-pubsub": "2.2.1", + "google/cloud-quotas": "0.2.3", + "google/cloud-rapidmigrationassessment": "0.3.5", + "google/cloud-recaptcha-enterprise": "1.12.2", + "google/cloud-recommendations-ai": "0.7.5", + "google/cloud-recommender": "1.11.5", + "google/cloud-redis": "1.9.5", + "google/cloud-redis-cluster": "0.3.0", + "google/cloud-resource-manager": "0.8.5", + "google/cloud-resource-settings": "1.2.6", + "google/cloud-retail": "1.7.0", + "google/cloud-run": "0.9.3", + "google/cloud-scheduler": "1.10.5", + "google/cloud-secret-manager": "1.15.2", + "google/cloud-securesourcemanager": "0.2.5", + "google/cloud-security-center": "1.28.2", + "google/cloud-security-private-ca": "1.7.3", + "google/cloud-security-public-ca": "0.4.1", + "google/cloud-securitycentermanagement": "0.3.2", + "google/cloud-service-control": "1.4.4", + "google/cloud-service-directory": "1.3.6", + "google/cloud-service-management": "1.3.5", + "google/cloud-service-usage": "1.3.4", + "google/cloud-servicehealth": "0.1.6", + "google/cloud-shell": "1.3.5", + "google/cloud-spanner": "1.79.0", + "google/cloud-speech": "1.18.3", + "google/cloud-sql-admin": "0.18.0", + "google/cloud-storage": "1.42.0", + "google/cloud-storage-control": "0.2.1", + "google/cloud-storage-transfer": "1.4.5", + "google/cloud-storageinsights": "0.3.5", + "google/cloud-support": "0.2.5", + "google/cloud-talent": "1.3.5", + "google/cloud-tasks": "1.14.6", + "google/cloud-telcoautomation": "0.2.5", + "google/cloud-text-to-speech": "1.8.5", + "google/cloud-tpu": "1.4.5", + "google/cloud-trace": "1.8.6", + "google/cloud-translate": "1.17.7", + "google/cloud-video-live-stream": "0.7.5", + "google/cloud-video-stitcher": "0.9.1", + "google/cloud-video-transcoder": "0.10.5", + "google/cloud-videointelligence": "1.15.5", + "google/cloud-vision": "1.9.4", + "google/cloud-vm-migration": "0.6.5", + "google/cloud-vmware-engine": "0.5.6", + "google/cloud-vpc-access": "1.3.5", + "google/cloud-web-risk": "1.5.5", + "google/cloud-web-security-scanner": "0.8.5", + "google/cloud-workflows": "0.5.5", + "google/geo-common-protos": "0.1.0", + "google/grafeas": "0.10.3", + "google/longrunning": "0.4.3", + "google/maps-fleetengine": "0.1.2", + "google/maps-fleetengine-delivery": "0.1.1", + "google/maps-routeoptimization": "0.1.0", + "google/shopping-common-protos": "0.4.0", + "google/shopping-css": "0.2.7", + "google/shopping-merchant-accounts": "0.1.0", + "google/shopping-merchant-conversions": "0.1.2", + "google/shopping-merchant-datasources": "0.1.0", + "google/shopping-merchant-inventories": "0.5.0", + "google/shopping-merchant-lfp": "0.1.0", + "google/shopping-merchant-notifications": "0.1.0", + "google/shopping-merchant-products": "0.1.0", + "google/shopping-merchant-promotions": "0.1.0", + "google/shopping-merchant-quota": "0.1.3", + "google/shopping-merchant-reports": "0.8.1" }, "suggest": { "opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.", @@ -281,6 +296,7 @@ "GPBMetadata\\Google\\Cloud\\Assuredworkloads\\": "AssuredWorkloads/metadata", "GPBMetadata\\Google\\Cloud\\Audit\\": "CommonProtos/metadata/Audit", "GPBMetadata\\Google\\Cloud\\Automl\\": "AutoMl/metadata", + "GPBMetadata\\Google\\Cloud\\Backupdr\\": "BackupDr/metadata", "GPBMetadata\\Google\\Cloud\\Baremetalsolution\\": "BareMetalSolution/metadata", "GPBMetadata\\Google\\Cloud\\Batch\\": "Batch/metadata", "GPBMetadata\\Google\\Cloud\\Beyondcorp\\Appconnections\\": "BeyondCorpAppConnections/metadata", @@ -318,6 +334,7 @@ "GPBMetadata\\Google\\Cloud\\Dataproc\\": "Dataproc/metadata", "GPBMetadata\\Google\\Cloud\\Datastream\\": "Datastream/metadata", "GPBMetadata\\Google\\Cloud\\Deploy\\": "Deploy/metadata", + "GPBMetadata\\Google\\Cloud\\Developerconnect\\": "DeveloperConnect/metadata", "GPBMetadata\\Google\\Cloud\\Dialogflow\\": "Dialogflow/metadata", "GPBMetadata\\Google\\Cloud\\Dialogflow\\Cx\\": "DialogflowCx/metadata", "GPBMetadata\\Google\\Cloud\\Discoveryengine\\": "DiscoveryEngine/metadata", @@ -343,6 +360,7 @@ "GPBMetadata\\Google\\Cloud\\Language\\": "Language/metadata", "GPBMetadata\\Google\\Cloud\\Lifesciences\\": "LifeSciences/metadata", "GPBMetadata\\Google\\Cloud\\Managedidentities\\": "ManagedIdentities/metadata", + "GPBMetadata\\Google\\Cloud\\Managedkafka\\": "ManagedKafka/metadata", "GPBMetadata\\Google\\Cloud\\Mediatranslation\\": "MediaTranslation/metadata", "GPBMetadata\\Google\\Cloud\\Memcache\\": "Memcache/metadata", "GPBMetadata\\Google\\Cloud\\Metastore\\": "DataprocMetastore/metadata", @@ -351,6 +369,7 @@ "GPBMetadata\\Google\\Cloud\\Networkconnectivity\\": "NetworkConnectivity/metadata", "GPBMetadata\\Google\\Cloud\\Networkmanagement\\": "NetworkManagement/metadata", "GPBMetadata\\Google\\Cloud\\Networksecurity\\": "NetworkSecurity/metadata", + "GPBMetadata\\Google\\Cloud\\Networkservices\\": "NetworkServices/metadata", "GPBMetadata\\Google\\Cloud\\Notebooks\\": "Notebooks/metadata", "GPBMetadata\\Google\\Cloud\\Optimization\\": "Optimization/metadata", "GPBMetadata\\Google\\Cloud\\Orchestration\\Airflow\\Service\\": "OrchestrationAirflow/metadata", @@ -421,18 +440,28 @@ "GPBMetadata\\Google\\Devtools\\Cloudtrace\\": "Trace/metadata", "GPBMetadata\\Google\\Devtools\\Containeranalysis\\": "ContainerAnalysis/metadata", "GPBMetadata\\Google\\Firestore\\": "Firestore/metadata", + "GPBMetadata\\Google\\Geo\\": "GeoCommonProtos/metadata", "GPBMetadata\\Google\\Iam\\": "Iam/metadata", "GPBMetadata\\Google\\Iam\\Credentials\\": "IamCredentials/metadata", "GPBMetadata\\Google\\Identity\\Accesscontextmanager\\": "AccessContextManager/metadata", "GPBMetadata\\Google\\Logging\\": "Logging/metadata", "GPBMetadata\\Google\\Longrunning\\": "LongRunning/metadata/Longrunning", + "GPBMetadata\\Google\\Maps\\Fleetengine\\": "MapsFleetEngine/metadata", + "GPBMetadata\\Google\\Maps\\Fleetengine\\Delivery\\": "MapsFleetEngineDelivery/metadata", + "GPBMetadata\\Google\\Maps\\Routeoptimization\\": "MapsRouteOptimization/metadata", "GPBMetadata\\Google\\Monitoring\\": "Monitoring/metadata", "GPBMetadata\\Google\\Privacy\\Dlp\\": "Dlp/metadata", "GPBMetadata\\Google\\Pubsub\\": "PubSub/metadata", "GPBMetadata\\Google\\Rpc\\": "CommonProtos/metadata/Rpc", "GPBMetadata\\Google\\Shopping\\Css\\": "ShoppingCss/metadata", + "GPBMetadata\\Google\\Shopping\\Merchant\\Accounts\\": "ShoppingMerchantAccounts/metadata", "GPBMetadata\\Google\\Shopping\\Merchant\\Conversions\\": "ShoppingMerchantConversions/metadata", + "GPBMetadata\\Google\\Shopping\\Merchant\\Datasources\\": "ShoppingMerchantDatasources/metadata", "GPBMetadata\\Google\\Shopping\\Merchant\\Inventories\\": "ShoppingMerchantInventories/metadata", + "GPBMetadata\\Google\\Shopping\\Merchant\\Lfp\\": "ShoppingMerchantLfp/metadata", + "GPBMetadata\\Google\\Shopping\\Merchant\\Notifications\\": "ShoppingMerchantNotifications/metadata", + "GPBMetadata\\Google\\Shopping\\Merchant\\Products\\": "ShoppingMerchantProducts/metadata", + "GPBMetadata\\Google\\Shopping\\Merchant\\Promotions\\": "ShoppingMerchantPromotions/metadata", "GPBMetadata\\Google\\Shopping\\Merchant\\Quota\\": "ShoppingMerchantQuota/metadata", "GPBMetadata\\Google\\Shopping\\Merchant\\Reports\\": "ShoppingMerchantReports/metadata", "GPBMetadata\\Google\\Shopping\\Type\\": "ShoppingCommonProtos/metadata/Type", @@ -465,6 +494,7 @@ "Google\\Cloud\\Asset\\": "Asset/src", "Google\\Cloud\\AssuredWorkloads\\": "AssuredWorkloads/src", "Google\\Cloud\\AutoMl\\": "AutoMl/src", + "Google\\Cloud\\BackupDR\\": "BackupDr/src", "Google\\Cloud\\BareMetalSolution\\": "BareMetalSolution/src", "Google\\Cloud\\Batch\\": "Batch/src", "Google\\Cloud\\BeyondCorp\\AppConnections\\": "BeyondCorpAppConnections/src", @@ -512,6 +542,7 @@ "Google\\Cloud\\Datastream\\": "Datastream/src", "Google\\Cloud\\Debugger\\": "Debugger/src", "Google\\Cloud\\Deploy\\": "Deploy/src", + "Google\\Cloud\\DeveloperConnect\\": "DeveloperConnect/src", "Google\\Cloud\\Dialogflow\\": "Dialogflow/src", "Google\\Cloud\\Dialogflow\\Cx\\": "DialogflowCx/src", "Google\\Cloud\\DiscoveryEngine\\": "DiscoveryEngine/src", @@ -543,6 +574,7 @@ "Google\\Cloud\\LifeSciences\\": "LifeSciences/src", "Google\\Cloud\\Logging\\": "Logging/src", "Google\\Cloud\\ManagedIdentities\\": "ManagedIdentities/src", + "Google\\Cloud\\ManagedKafka\\": "ManagedKafka/src", "Google\\Cloud\\MediaTranslation\\": "MediaTranslation/src", "Google\\Cloud\\Memcache\\": "Memcache/src", "Google\\Cloud\\Metastore\\": "DataprocMetastore/src", @@ -552,6 +584,7 @@ "Google\\Cloud\\NetworkConnectivity\\": "NetworkConnectivity/src", "Google\\Cloud\\NetworkManagement\\": "NetworkManagement/src", "Google\\Cloud\\NetworkSecurity\\": "NetworkSecurity/src", + "Google\\Cloud\\NetworkServices\\": "NetworkServices/src", "Google\\Cloud\\Notebooks\\": "Notebooks/src", "Google\\Cloud\\Optimization\\": "Optimization/src", "Google\\Cloud\\Orchestration\\Airflow\\Service\\": "OrchestrationAirflow/src", @@ -617,11 +650,21 @@ "Google\\Cloud\\WebRisk\\": "WebRisk/src", "Google\\Cloud\\WebSecurityScanner\\": "WebSecurityScanner/src", "Google\\Cloud\\Workflows\\": "Workflows/src", + "Google\\Geo\\": "GeoCommonProtos/src", "Google\\Identity\\AccessContextManager\\": "AccessContextManager/src", "Google\\LongRunning\\": "LongRunning/src/LongRunning", + "Google\\Maps\\FleetEngine\\": "MapsFleetEngine/src", + "Google\\Maps\\FleetEngine\\Delivery\\": "MapsFleetEngineDelivery/src", + "Google\\Maps\\RouteOptimization\\": "MapsRouteOptimization/src", "Google\\Shopping\\Css\\": "ShoppingCss/src", + "Google\\Shopping\\Merchant\\Accounts\\": "ShoppingMerchantAccounts/src", "Google\\Shopping\\Merchant\\Conversions\\": "ShoppingMerchantConversions/src", + "Google\\Shopping\\Merchant\\Datasources\\": "ShoppingMerchantDatasources/src", "Google\\Shopping\\Merchant\\Inventories\\": "ShoppingMerchantInventories/src", + "Google\\Shopping\\Merchant\\Lfp\\": "ShoppingMerchantLfp/src", + "Google\\Shopping\\Merchant\\Notifications\\": "ShoppingMerchantNotifications/src", + "Google\\Shopping\\Merchant\\Products\\": "ShoppingMerchantProducts/src", + "Google\\Shopping\\Merchant\\Promotions\\": "ShoppingMerchantPromotions/src", "Google\\Shopping\\Merchant\\Quota\\": "ShoppingMerchantQuota/src", "Google\\Shopping\\Merchant\\Reports\\": "ShoppingMerchantReports/src", "Google\\Shopping\\Type\\": "ShoppingCommonProtos/src/Type", diff --git a/dev/src/Command/AddComponentCommand.php b/dev/src/Command/AddComponentCommand.php index f1c26f0baee5..98dd8cdb941a 100644 --- a/dev/src/Command/AddComponentCommand.php +++ b/dev/src/Command/AddComponentCommand.php @@ -189,7 +189,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } // Write repo metadata JSON - $output->writeln(' Writing .repo-metadata.json'); + $output->writeln(' Writing to .repo-metadata-full.json'); $repoMetadata = [ 'language' => 'php', 'distribution_name' => $new->composerPackage, @@ -198,8 +198,14 @@ protected function execute(InputInterface $input, OutputInterface $output) 'library_type' => 'GAPIC_AUTO', 'api_shortname' => $new->shortName ]; - $contents = json_encode($repoMetadata, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); - $filesystem->dumpFile($componentDir . '/.repo-metadata.json', $contents . PHP_EOL); + $repoMetadataFullPath = $this->rootPath . '/.repo-metadata-full.json'; + $repoMetadataFull = json_decode(file_get_contents($repoMetadataFullPath), true); + $repoMetadataFull[$new->componentName] = $repoMetadata; + ksort($repoMetadataFull); + file_put_contents( + $repoMetadataFullPath, + json_encode($repoMetadataFull, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL + ); // Write composer file $output->writeln('Composer Updating root composer.json and creating component composer.json'); diff --git a/dev/src/Command/ComponentInfoCommand.php b/dev/src/Command/ComponentInfoCommand.php index 46d6f8c234f1..d2ab94696c41 100644 --- a/dev/src/Command/ComponentInfoCommand.php +++ b/dev/src/Command/ComponentInfoCommand.php @@ -33,29 +33,28 @@ class ComponentInfoCommand extends Command { private static $allFields = [ - 'name' => 'Component Name', + 'component_name' => 'Component Name', 'package_name' => 'Package Name', 'package_version' => 'Package Version', 'api_versions' => 'API Version', 'release_level' => 'Release Level', - 'migration' => 'Migration', + 'migration_mode' => 'Migration Mode', 'php_namespaces' => 'Php Namespace', 'github_repo' => 'Github Repo', - 'proto' => 'Proto Path', + 'proto_path' => 'Proto Path', 'service_address' => 'Service Address', - 'shortname' => 'API Shortname', + 'api_shortname' => 'API Shortname', 'description' => 'Description', 'available_api_versions' => 'Availble API Versions', ]; private static $defaultFields = [ - 'name', + 'component_name', 'package_name', 'package_version', 'api_versions', 'release_level', - 'migration', - 'proto', - 'shortname', + 'migration_mode', + 'api_shortname', ]; private string $token; @@ -72,6 +71,13 @@ protected function configure() "Use --show-available-api-versions to include them.\n", implode("\n - ", array_keys(self::$allFields)) )) + ->addOption('filter', '', InputOption::VALUE_REQUIRED, + 'Comma-separated list of key-value filters. Supported operators are "=", "!=", "~=", and "!~=".' + . "\nExample: `--filter 'release_level=preview,migration_mode~=NEW_SURFACE_ONLY,migration_mode!~=MIGRATING'`'" + ) + ->addOption('sort', '', InputOption::VALUE_REQUIRED, + 'field to sort by (with optional ASC/DESC suffix. e.g. "component_name DESC"' + ) ->addOption('token', 't', InputOption::VALUE_REQUIRED, 'Github token to use for authentication', '') ->addOption( 'show-available-api-versions', @@ -100,13 +106,42 @@ protected function execute(InputInterface $input, OutputInterface $output) $componentName = $input->getOption('component'); $components = $componentName ? [new Component($componentName)] : Component::getComponents(); + $filters = $this->parseFilters($input->getOption('filter') ?: ''); + $rows = []; foreach ($components as $component) { - $rows = array_merge($rows, $this->getComponentDetails( + $componentRows = $this->getComponentDetails( $component, $requestedFields, $input->getOption('expanded') - )); + ); + foreach ($filters as $filter) { + list($field, $value, $operator) = $filter; + foreach ($componentRows as $row) { + if (!match ($operator) { + '=' => ($row[$field] === $value), + '!=' => ($row[$field] !== $value), + '~=' => strpos($row[$field], $value) !== false, + '!~=' => strpos($row[$field], $value) === false, + }) { + continue 3; + } + } + } + $rows = array_merge($rows, $componentRows); + } + + if ($sort = $input->getOption('sort')) { + list($field, $order) = explode(' ', $sort) + [1 => 'ASC']; + usort($rows, function ($a, $b) use ($field) { + return match ($field) { + 'package_version' => version_compare($a[$field], $b[$field]), + default => strcmp($a[$field], $b[$field]), + }; + }); + if ($order === 'DESC') { + $rows = array_reverse($rows); + } } // output the component data @@ -150,17 +185,17 @@ private function getComponentDetails(Component $component, array $requestedField // use "array_intersect_key" to filter out fields that were not requested. // use "array_replace" to sort the fields in the order they were requested. $rows[] = array_replace($requestedFields, array_intersect_key([ - 'name' => $component->getName() . "\\" . $pkg->getName(), + 'component_name' => $component->getName() . "\\" . $pkg->getName(), 'package_name' => $component->getPackageName(), 'package_version' => $component->getPackageVersion(), 'api_versions' => $pkg->getName(), 'release_level' => $component->getReleaseLevel(), - 'migration' => $pkg->getMigrationStatus(), + 'migration_mode' => $pkg->getMigrationStatus(), 'php_namespaces' => implode("\n", array_keys($component->getNamespaces())), 'github_repo' => $component->getRepoName(), - 'proto' => $pkg->getProtoPackage(), + 'proto_path' => $pkg->getProtoPackage(), 'service_address' => $pkg->getServiceAddress(), - 'shortname' => $pkg->getApiShortname(), + 'api_shortname' => $pkg->getApiShortname(), 'description' => $component->getDescription(), 'available_api_versions' => $availableApiVersions, ], $requestedFields)); @@ -169,17 +204,17 @@ private function getComponentDetails(Component $component, array $requestedField // use "array_intersect_key" to filter out fields that were not requested. // use "array_replace" to sort the fields in the order they were requested. $details = array_replace($requestedFields, array_intersect_key([ - 'name' => $component->getName(), + 'component_name' => $component->getName(), 'package_name' => $component->getPackageName(), 'package_version' => $component->getPackageVersion(), 'api_versions' => implode("\n", $component->getApiVersions()), 'release_level' => $component->getReleaseLevel(), - 'migration' => implode("\n", $component->getMigrationStatuses()), + 'migration_mode' => implode("\n", $component->getMigrationStatuses()), 'php_namespaces' => implode("\n", array_keys($component->getNamespaces())), 'github_repo' => $component->getRepoName(), - 'proto' => implode("\n", $component->getProtoPackages()), + 'proto_path' => implode("\n", $component->getProtoPackages()), 'service_address' => implode("\n", $component->getServiceAddresses()), - 'shortname' => implode("\n", $component->getApiShortnames()), + 'api_shortname' => implode("\n", $component->getApiShortnames()), 'description' => $component->getDescription(), ], $requestedFields)); @@ -218,4 +253,22 @@ private function getAvailableApiVersions(Component $component): string ) )); } -} \ No newline at end of file + + private function parseFilters(string $filterString): array + { + $filters = []; + foreach (array_filter(explode(',', $filterString)) as $filter) { + if (!preg_match('/^(\w+?)(!~=|~=|!=|=)(.+)$/', $filter, $matches)) { + throw new \InvalidArgumentException(sprintf('Invalid filter: %s', $filter)); + } + $filters[] = [$matches[1], $matches[3], $matches[2]]; + } + + foreach ($filters as $filter) { + if (!array_key_exists($filter[0], self::$allFields)) { + throw new \InvalidArgumentException(sprintf('Invalid filter field: %s', $filter[0])); + } + } + return $filters; + } +} diff --git a/dev/src/Command/DocFxCommand.php b/dev/src/Command/DocFxCommand.php index 42875db691d2..fb9149ba6f87 100644 --- a/dev/src/Command/DocFxCommand.php +++ b/dev/src/Command/DocFxCommand.php @@ -25,18 +25,30 @@ use Symfony\Component\Process\Process; use Symfony\Component\Yaml\Yaml; use RuntimeException; +use Google\Cloud\Dev\Component; +use Google\Cloud\Dev\DocFx\Node\ClassNode; use Google\Cloud\Dev\DocFx\Page\PageTree; use Google\Cloud\Dev\DocFx\Page\OverviewPage; -use Google\Cloud\Dev\Component; +use Google\Cloud\Dev\DocFx\XrefValidationTrait; /** * @internal */ class DocFxCommand extends Command { + use XrefValidationTrait; + private array $composerJson; private array $repoMetadataJson; + // these links are inexplicably broken in phpdoc generation, and will require more investigation + private static array $allowedReferenceFailures = [ + '\Google\Cloud\ResourceManager\V3\Client\ProjectsClient::testIamPermissions()' + => 'ProjectsClient::testIamPermissionsAsync()', + '\Google\Cloud\Logging\V2\Client\ConfigServiceV2Client::getView()' + => 'ConfigServiceV2Client::getViewAsync()' + ]; + protected function configure() { $this->setName('docfx') @@ -50,8 +62,8 @@ protected function configure() 'component-path', '', InputOption::VALUE_OPTIONAL, - 'Specify the path of the desired component. Please note, this option is only intended for testing purposes. - ') + 'Specify the path of the desired component. Please note, this option is only intended for testing purposes.' + ) ; } @@ -61,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output) throw new RuntimeException('This command must be run on PHP 8.0 or above'); } - $componentName = $input->getOption('component') ?: basename(getcwd()); + $componentName = rtrim($input->getOption('component'), '/') ?: basename(getcwd()); $component = new Component($componentName, $input->getOption('component-path')); $output->writeln(sprintf('Generating documentation for %s', $componentName)); $xml = $input->getOption('xml'); @@ -92,8 +104,10 @@ protected function execute(InputInterface $input, OutputInterface $output) $indent = 2; // The amount of spaces to use for indentation of nested nodes $flags = Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK; + $valid = true; $tocItems = []; $packageDescription = $component->getDescription(); + $isBeta = 'stable' !== $component->getReleaseLevel(); foreach ($component->getNamespaces() as $namespace => $dir) { $pageTree = new PageTree( $xml, @@ -103,6 +117,8 @@ protected function execute(InputInterface $input, OutputInterface $output) ); foreach ($pageTree->getPages() as $page) { + // validate the docs page. this will fail the job if it's false + $valid = $this->validate($page->getClassNode(), $output) && $valid; $docFxArray = ['items' => $page->getItems()]; // Dump the YAML for the class node @@ -117,11 +133,15 @@ protected function execute(InputInterface $input, OutputInterface $output) $tocItems = array_merge($tocItems, $pageTree->getTocItems()); } - $releaseLevel = $component->getReleaseLevel(); + // exit early if the docs aren't valid + if (!$valid) { + return 1; + } + if (file_exists($overviewFile = sprintf('%s/README.md', $component->getPath()))) { $overview = new OverviewPage( file_get_contents($overviewFile), - $releaseLevel !== 'stable' + $isBeta ); $outFile = sprintf('%s/%s', $outDir, $overview->getFilename()); file_put_contents($outFile, $overview->getContents()); @@ -133,7 +153,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $componentToc = array_filter([ 'uid' => $component->getReferenceDocumentationUid(), 'name' => $component->getPackageName(), - 'status' => $releaseLevel !== 'stable' ? 'beta' : '', + 'status' => $isBeta ? 'beta' : '', 'items' => $tocItems, ]); $tocYaml = Yaml::dump([$componentToc], $inline, $indent, $flags); @@ -199,4 +219,37 @@ public static function getPhpDocCommand(string $componentPath, string $outDir): return $process; } + + private function validate(ClassNode $class, OutputInterface $output): bool + { + $valid = true; + $emptyRef = 'empty'; + $isGenerated = $class->isProtobufMessageClass() || $class->isProtobufEnumClass() || $class->isServiceClass(); + foreach (array_merge([$class], $class->getMethods(), $class->getConstants()) as $node) { + foreach ($this->getInvalidXrefs($node->getContent()) as $invalidRef) { + if (isset(self::$allowedReferenceFailures[$node->getFullname()]) + && self::$allowedReferenceFailures[$node->getFullname()] == $invalidRef) { + // these links are inexplicably broken in phpdoc generation, and will require more investigation + continue; + } + $output->write(sprintf("\nInvalid xref in %s: %s", $node->getFullname(), $invalidRef)); + $valid = false; + } + foreach ($this->getBrokenXrefs($node->getContent()) as $brokenRef) { + $output->writeln( + sprintf('Broken xref in %s: %s', $node->getFullname(), $brokenRef ?: $emptyRef), + $isGenerated ? OutputInterface::VERBOSITY_VERBOSE : OutputInterface::VERBOSITY_NORMAL + ); + // generated classes are allowed to have broken xrefs + if ($isGenerated) { + continue; + } + $valid = false; + } + } + if (!$valid) { + $output->writeln(''); + } + return $valid; + } } diff --git a/dev/src/Component.php b/dev/src/Component.php index c38fbaf01ecf..742336d28de3 100644 --- a/dev/src/Component.php +++ b/dev/src/Component.php @@ -182,18 +182,18 @@ private function validateComponentFiles(): void $this->repoName = preg_replace('/\.git$/', '', $repoName); // Strip trailing ".git" $this->description = $composerJson['description']; - $repoMetadataPath = $this->path . '/.repo-metadata.json'; - if (!file_exists($repoMetadataPath)) { - throw new RuntimeException( - sprintf('repo metadata not found for component "%s"', $this->name) - ); + $repoMetadataPath = self::ROOT_DIR . '/.repo-metadata-full.json'; + $repoMetadataFullJson = json_decode(file_get_contents($repoMetadataPath), true); + if (!$repoMetadataFullJson) { + throw new RuntimeException('Invalid .repo-metadata-full.json'); } - $repoMetadataJson = json_decode(file_get_contents($repoMetadataPath), true); - if (!$repoMetadataJson) { - throw new RuntimeException( - sprintf('Invalid .repo-metadata.json for component "%s"', $this->name) - ); + if (!isset($repoMetadataFullJson[$this->name])) { + throw new RuntimeException(sprintf( + 'repo metadata for component "%s" not found in .repo-metadata-full.json', + $this->name + )); } + $repoMetadataJson = $repoMetadataFullJson[$this->name]; if (empty($repoMetadataJson['release_level'])) { throw new RuntimeException(sprintf( 'repo metadata does not contain "release_level" for component "%s"', diff --git a/dev/src/ComponentPackage.php b/dev/src/ComponentPackage.php index c96043069079..68a9a1eb80e5 100644 --- a/dev/src/ComponentPackage.php +++ b/dev/src/ComponentPackage.php @@ -33,10 +33,10 @@ class ComponentPackage \* Updates to the above are reflected here through a refresh process#'; private string $path; - private const MIGRATION_V1 = 'v1'; - private const MIGRATION_V2 = 'v2'; - private const MIGRATION_V1_AND_V2 = 'v1 and v2'; - private const MIGRATION_NA = 'n/a'; + private const MIGRATION_V1 = 'PRE_MIGRATION_SURFACE_ONLY'; + private const MIGRATION_V2 = 'NEW_SURFACE_ONLY'; + private const MIGRATION_V1_AND_V2 = 'MIGRATING'; + private const MIGRATION_NA = 'MIGRATION_MODE_UNSPECIFIED'; public function __construct(private Component $component, private string $name) { diff --git a/dev/src/DocFx/Node/ClassNode.php b/dev/src/DocFx/Node/ClassNode.php index 0a50ae6c826b..9ec6b0ad16eb 100644 --- a/dev/src/DocFx/Node/ClassNode.php +++ b/dev/src/DocFx/Node/ClassNode.php @@ -60,6 +60,14 @@ public function isProtobufEnumClass(): bool return 0 === strpos($lastDescriptionLine, 'Protobuf type'); } + public function isProtobufMessageClass(): bool + { + if ($extends = $this->getExtends()) { + return '\Google\Protobuf\Internal\Message' === $extends; + } + return false; + } + public function isGapicEnumClass(): bool { // returns true if the class extends \Google\Protobuf\Internal\Message diff --git a/dev/src/DocFx/XrefValidationTrait.php b/dev/src/DocFx/XrefValidationTrait.php new file mode 100644 index 000000000000..caf5790fb438 --- /dev/null +++ b/dev/src/DocFx/XrefValidationTrait.php @@ -0,0 +1,114 @@ + 1) { + $invalidRefs[] = $matches[1]; + return; + } + }, + $description + ); + + return $invalidRefs; + } + + /** + * Verifies that all class references and @see tags contain references to classes, methods, and + * constants which actually exist. + */ + private function getBrokenXrefs(string $description): array + { + $brokenRefs = []; + preg_replace_callback( + '/ '.OwlBot.yaml.test', // so OwlBot doesn't read the test file '.gitattributes' => null, '.github/pull_request_template.md' => null, - '.repo-metadata.json' => null, 'CONTRIBUTING.md' => null, 'LICENSE' => null, 'README.md' => null, @@ -54,6 +53,7 @@ public static function setUpBeforeClass(): void { mkdir($tmpDir = sys_get_temp_dir() . '/add-command-test-' . time()); touch($tmpDir . '/composer.json'); + file_put_contents($tmpDir . '/.repo-metadata-full.json', '{}'); self::$tmpDir = realpath($tmpDir); $application = new Application(); $application->add(new AddComponentCommand($tmpDir)); @@ -97,6 +97,8 @@ public function testAddComponent() ); } + $repoMetadataFull = json_decode(file_get_contents(self::$tmpDir . '/.repo-metadata-full.json'), true); + $this->assertArrayHasKey('SecretManager', $repoMetadataFull); $this->assertComposerJson('SecretManager'); } diff --git a/dev/tests/Unit/Command/ComponentInfoCommandTest.php b/dev/tests/Unit/Command/ComponentInfoCommandTest.php index f1b83f939304..6b83ff54ce88 100644 --- a/dev/tests/Unit/Command/ComponentInfoCommandTest.php +++ b/dev/tests/Unit/Command/ComponentInfoCommandTest.php @@ -28,19 +28,6 @@ */ class ComponentInfoCommandTest extends TestCase { - private static $expectedFiles = [ - '.OwlBot.yaml', - '.gitattributes', - '.github/pull_request_template.md', - '.repo-metadata.json', - 'CONTRIBUTING.md', - 'LICENSE', - 'README.md', - 'VERSION', - 'owlbot.py', - 'phpunit.xml.dist', - ]; - private static CommandTester $commandTester; public static function setUpBeforeClass(): void @@ -83,7 +70,7 @@ public function testFieldsOption() { self::$commandTester->execute([ '-c' => 'AccessContextManager', - '--fields' => 'name,package_name,doesnt_exist', + '--fields' => 'component_name,package_name,doesnt_exist', ]); $this->assertEquals(<<execute([ '-c' => 'AccessContextManager', - '--fields' => 'package_name,name', + '--fields' => 'package_name,component_name', ]); $this->assertEquals(<<execute([ '-c' => 'AccessContextManager', - '--fields' => 'package_name,name,github_repo', + '--fields' => 'package_name,component_name,github_repo', '--csv' => $csv, ]); $this->assertFileExists($csv); diff --git a/dev/tests/Unit/DocFx/NodeTest.php b/dev/tests/Unit/DocFx/NodeTest.php index 9021b19bb262..3be5cd774245 100644 --- a/dev/tests/Unit/DocFx/NodeTest.php +++ b/dev/tests/Unit/DocFx/NodeTest.php @@ -17,11 +17,15 @@ namespace Google\Cloud\Dev\Tests\Unit\DocFx; -use PHPUnit\Framework\TestCase; use Google\Cloud\Dev\DocFx\Node\ClassNode; use Google\Cloud\Dev\DocFx\Node\MethodNode; use Google\Cloud\Dev\DocFx\Node\XrefTrait; use Google\Cloud\Dev\DocFx\Node\FencedCodeBlockTrait; +use Google\Cloud\Dev\DocFx\XrefValidationTrait; +use PHPUnit\Framework\TestCase; +use Prophecy\Argument; +use Prophecy\PhpUnit\ProphecyTrait; +use Symfony\Component\Console\Output\OutputInterface; use SimpleXMLElement; /** @@ -29,6 +33,8 @@ */ class NodeTest extends TestCase { + use ProphecyTrait; + public function testNestedParameters() { $nestedParamsXml = file_get_contents(__DIR__ . '/../../fixtures/phpdoc/nestedparams.xml'); @@ -433,4 +439,68 @@ public function provideStatusAndVersionByNamespace() ['Foo', ''], ]; } + + /** + * @dataProvider provideInvalidXrefs + */ + public function testInvalidXrefs(string $description, array $invalidXrefs = []) + { + $classXml = 'TestClass%s'; + $class = new ClassNode(new SimpleXMLElement(sprintf($classXml, $description))); + + $validator = new class () { + use XrefValidationTrait { + getInvalidXrefs as public; + } + }; + + $this->assertEquals($invalidXrefs, $validator->getInvalidXrefs($class->getContent())); + } + + public function provideInvalidXrefs() + { + return [ + ['{@see \DoesntExist}'], // class doesn't exist, but is still a valid xref + ['{@see \SimpleXMLElement::method()}'], // method doesn't exist, but is still a valid xref + ['{@see \SimpleXMLElement::addAttribute()}'], // valid method + ['{@see \SimpleXMLElement::OUTPUT_FOO}'], // constant doesn't exist, but is still a valid xref + [sprintf('{@see \%s::OUTPUT_NORMAL}', OutputInterface::class)], // valid constant + ['Take a look at {@see https://foo.bar} for more.'], // valid + ['{@see Foo\Bar}', ['Foo\Bar']], // invalid + ['Take a look at {@see Foo\Bar} for more.', ['Foo\Bar']], // invalid + [ + '{@see \Google\Cloud\PubSub\Google\Cloud\PubSub\Foo}', + ['\Google\Cloud\PubSub\Google\Cloud\PubSub\Foo'] + ], // invalid + ]; + } + + /** + * @dataProvider provideBrokenXrefs + */ + public function testBrokenXrefs(string $description, array $brokenXrefs = []) + { + $classXml = 'TestClass%s'; + $class = new ClassNode(new SimpleXMLElement(sprintf($classXml, $description))); + + $validator = new class () { + use XrefValidationTrait { + getBrokenXrefs as public; + } + }; + + $this->assertEquals($brokenXrefs, $validator->getBrokenXrefs($class->getContent())); + } + + public function provideBrokenXrefs() + { + return [ + ['{@see \OutputInterface}', ['\OutputInterface']], // invalid class (doesn't exist) + ['{@see \SimpleXMLElement}.'], // valid class + ['{@see \SimpleXMLElement::method()}', ['\SimpleXMLElement::method()']], // invalid method (doesn't exist) + ['{@see \SimpleXMLElement::addAttribute()}'], // valid method + ['{@see \SimpleXMLElement::OUTPUT_FOO}', ['\SimpleXMLElement::OUTPUT_FOO']], // invalid constant (doesn't exist) + [sprintf('{@see \%s::OUTPUT_NORMAL}', OutputInterface::class)], // valid constant + ]; + } } diff --git a/dev/tests/fixtures/component/CustomInput/.repo-metadata.json b/dev/tests/fixtures/component/CustomInput/.repo-metadata.json deleted file mode 100644 index a350830d76ad..000000000000 --- a/dev/tests/fixtures/component/CustomInput/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/custom-composer-package-name", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/custom-composer-package-name/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "customshortname" -} diff --git a/dev/tests/fixtures/component/CustomInput/owlbot.py b/dev/tests/fixtures/component/CustomInput/owlbot.py index 6fb5d713d93e..ea6cff994433 100644 --- a/dev/tests/fixtures/component/CustomInput/owlbot.py +++ b/dev/tests/fixtures/component/CustomInput/owlbot.py @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php", - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( diff --git a/dev/tests/fixtures/component/SecretManager/.repo-metadata.json b/dev/tests/fixtures/component/SecretManager/.repo-metadata.json deleted file mode 100644 index 7a2ea25e21ba..000000000000 --- a/dev/tests/fixtures/component/SecretManager/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-secretmanager", - "release_level": "preview", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-secretmanager/latest", - "library_type": "GAPIC_AUTO", - "api_shortname": "secretmanager" -} diff --git a/dev/tests/fixtures/component/SecretManager/owlbot.py b/dev/tests/fixtures/component/SecretManager/owlbot.py index 167a1075be15..e1e009cff500 100644 --- a/dev/tests/fixtures/component/SecretManager/owlbot.py +++ b/dev/tests/fixtures/component/SecretManager/owlbot.py @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php", - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( diff --git a/dev/tests/fixtures/component/Vision/.repo-metadata.json b/dev/tests/fixtures/component/Vision/.repo-metadata.json deleted file mode 100644 index 72af7b7c9b4d..000000000000 --- a/dev/tests/fixtures/component/Vision/.repo-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "php", - "distribution_name": "google/cloud-vision", - "release_level": "stable", - "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-vision/latest", - "library_type": "GAPIC_COMBO", - "api_shortname": "vision" -} From 968a70ebe99e5d8f445b18142ec9cfa8275048b4 Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:53:52 +0000 Subject: [PATCH 10/15] Add business logic unit test --- Spanner/src/MutationGroup.php | 3 +++ Spanner/tests/Unit/DatabaseTest.php | 39 +++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/Spanner/src/MutationGroup.php b/Spanner/src/MutationGroup.php index e0a6e5d2bee6..e4965b9ceea6 100644 --- a/Spanner/src/MutationGroup.php +++ b/Spanner/src/MutationGroup.php @@ -18,6 +18,9 @@ namespace Google\Cloud\Spanner; /** + * This should not be used directly. It should be accessed via + * Google\Cloud\Spanner\Database::mutationGroup(). + * * @internal */ class MutationGroup diff --git a/Spanner/tests/Unit/DatabaseTest.php b/Spanner/tests/Unit/DatabaseTest.php index dbe1a8b5633c..a20e1090ff6d 100644 --- a/Spanner/tests/Unit/DatabaseTest.php +++ b/Spanner/tests/Unit/DatabaseTest.php @@ -671,6 +671,45 @@ public function testSnapshotNestedTransaction() }); } + public function testBatchWrite() + { + $expectedMutationGroup = ['mutations' => [ + [ + Operation::OP_INSERT_OR_UPDATE => [ + 'table' => 'foo', + 'columns' => ['bar1', 'bar2'], + 'values' => [1, 2] + ] + ] + ]]; + $this->connection->batchWrite(Argument::allOf( + Argument::withEntry( + 'database', + DatabaseAdminClient::databaseName( + self::PROJECT, + self::INSTANCE, + self::DATABASE + ) + ), + Argument::withEntry('session', $this->session->name()), + Argument::withEntry('mutationGroups', [$expectedMutationGroup]) + ))->shouldBeCalled()->willReturn(['foo result']); + + + $mutationGroups = [ + ($this->database->mutationGroup(false)) + ->insertOrUpdate( + 'foo', + ['bar1' => 1, 'bar2' => 2] + ) + ]; + + $this->refreshOperation($this->database, $this->connection->reveal()); + + $result = $this->database->batchWrite($mutationGroups); + $this->assertIsArray($result); + } + public function testRunTransaction() { $this->connection->beginTransaction(Argument::allOf( From e6ddfe8370524ab53cbd6bc482395d5f6cd42274 Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Fri, 14 Jun 2024 19:55:47 +0000 Subject: [PATCH 11/15] Add system tests --- Spanner/src/Database.php | 3 +- Spanner/tests/System/BatchWriteTest.php | 71 ++++++++++++++++++++++ Spanner/tests/System/PgBatchWriteTest.php | 73 +++++++++++++++++++++++ Spanner/tests/Unit/MutationTraitTest.php | 2 + 4 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 Spanner/tests/System/BatchWriteTest.php create mode 100644 Spanner/tests/System/PgBatchWriteTest.php diff --git a/Spanner/src/Database.php b/Spanner/src/Database.php index 6e188b915d0c..731fd9d09477 100644 --- a/Spanner/src/Database.php +++ b/Spanner/src/Database.php @@ -1747,8 +1747,7 @@ public function mutationGroup() * transactions. * } * - * @return \Google\ApiCore\ServerStream A stream of BatchWriteResponse - * {@see \Google\Cloud\Spanner\V1\BatchWriteResponse} + * @retur \Generator {@see \Google\Cloud\Spanner\V1\BatchWriteResponse} * * @throws ApiException if the remote call fails */ diff --git a/Spanner/tests/System/BatchWriteTest.php b/Spanner/tests/System/BatchWriteTest.php new file mode 100644 index 000000000000..764fee3f8e19 --- /dev/null +++ b/Spanner/tests/System/BatchWriteTest.php @@ -0,0 +1,71 @@ +updateDdlBatch([ + 'CREATE TABLE Singers ( + SingerId INT64 NOT NULL, + FirstName STRING(1024), + LastName STRING(1024), + ) PRIMARY KEY (SingerId)', + 'CREATE TABLE Albums ( + SingerId INT64 NOT NULL, + AlbumId INT64 NOT NULL, + AlbumTitle STRING(1024), + ) PRIMARY KEY (SingerId, AlbumId), + INTERLEAVE IN PARENT Singers ON DELETE CASCADE' + ])->pollUntilComplete(); + } + + public function testBatchWrite() + { + $mutationGroups = []; + $mutationGroups[] = self::$database->mutationGroup() + ->insertOrUpdate( + "Singers", + ['SingerId' => 16, 'FirstName' => 'Scarlet', 'LastName' => 'Terry'] + ); + + $mutationGroups[] = self::$database->mutationGroup() + ->insertOrUpdate( + "Singers", + ['SingerId' => 17, 'FirstName' => 'Marc', 'LastName' => 'Kristen'] + )->insertOrUpdate( + "Albums", + ['AlbumId' => 1, 'SingerId' => 17, 'AlbumTitle' => 'Total Junk'] + ); + + $result = self::$database->batchWrite($mutationGroups)->current(); + $this->assertEquals($result['indexes'], [0 => 0, 1 => 1]); + $this->assertEquals($result['status']['code'], Code::OK); + $this->assertStringEndsWith('Z', $result['commitTimestamp']); + } +} diff --git a/Spanner/tests/System/PgBatchWriteTest.php b/Spanner/tests/System/PgBatchWriteTest.php new file mode 100644 index 000000000000..66e0e859c639 --- /dev/null +++ b/Spanner/tests/System/PgBatchWriteTest.php @@ -0,0 +1,73 @@ +updateDdlBatch([ + 'CREATE TABLE Singers ( + singerid bigint NOT NULL, + firstname varchar(1024), + lastname varchar(1024), + PRIMARY KEY (singerid) + )', + 'CREATE TABLE Albums ( + singerid bigint NOT NULL, + albumid bigint NOT NULL, + albumtitle varchar(1024), + PRIMARY KEY (singerid, albumid) + ) INTERLEAVE IN PARENT singers ON DELETE CASCADE' + ])->pollUntilComplete(); + } + + public function testBatchWrite() + { + $mutationGroups = []; + $mutationGroups[] = self::$database->mutationGroup() + ->insertOrUpdate( + "Singers", + ['SingerId' => 16, 'FirstName' => 'Scarlet', 'LastName' => 'Terry'] + ); + + $mutationGroups[] = self::$database->mutationGroup() + ->insertOrUpdate( + "Singers", + ['SingerId' => 17, 'FirstName' => 'Marc', 'LastName' => 'Kristen'] + )->insertOrUpdate( + "Albums", + ['AlbumId' => 1, 'SingerId' => 17, 'AlbumTitle' => 'Total Junk'] + ); + + $result = self::$database->batchWrite($mutationGroups)->current(); + $this->assertEquals($result['indexes'], [0 => 0, 1 => 1]); + $this->assertEquals($result['status']['code'], Code::OK); + $this->assertStringEndsWith('Z', $result['commitTimestamp']); + } +} diff --git a/Spanner/tests/Unit/MutationTraitTest.php b/Spanner/tests/Unit/MutationTraitTest.php index 9a1bc84f6ae2..4f29cc41122c 100644 --- a/Spanner/tests/Unit/MutationTraitTest.php +++ b/Spanner/tests/Unit/MutationTraitTest.php @@ -130,6 +130,7 @@ public function testDelete() } } +//@codingStandardsIgnoreStart class MutationTraitImpl { use MutationTrait { @@ -143,3 +144,4 @@ public function __construct() $this->mapper = new ValueMapper(false); } } +//@codingStandardsIgnoreEnd From c5829507a5a05b4beaeb377f32a683ce947b28af Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Fri, 14 Jun 2024 20:08:35 +0000 Subject: [PATCH 12/15] Fix snippet tests --- Spanner/tests/Snippet/TransactionTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Spanner/tests/Snippet/TransactionTest.php b/Spanner/tests/Snippet/TransactionTest.php index b99e6e6f010a..48027c6c44c8 100644 --- a/Spanner/tests/Snippet/TransactionTest.php +++ b/Spanner/tests/Snippet/TransactionTest.php @@ -254,7 +254,7 @@ public function testId() public function testInsert() { $snippet = $this->snippetFromMethod(Transaction::class, 'insert'); - $snippet->addLocal('transaction', $this->transaction); + $snippet->addLocal('mutationGroup', $this->transaction); $this->refreshOperation($this->transaction, $this->connection->reveal()); @@ -268,7 +268,7 @@ public function testInsert() public function testInsertBatch() { $snippet = $this->snippetFromMethod(Transaction::class, 'insertBatch'); - $snippet->addLocal('transaction', $this->transaction); + $snippet->addLocal('mutationGroup', $this->transaction); $this->refreshOperation($this->transaction, $this->connection->reveal()); @@ -281,7 +281,7 @@ public function testInsertBatch() public function testUpdate() { $snippet = $this->snippetFromMethod(Transaction::class, 'update'); - $snippet->addLocal('transaction', $this->transaction); + $snippet->addLocal('mutationGroup', $this->transaction); $this->refreshOperation($this->transaction, $this->connection->reveal()); @@ -295,7 +295,7 @@ public function testUpdate() public function testUpdateBatch() { $snippet = $this->snippetFromMethod(Transaction::class, 'updateBatch'); - $snippet->addLocal('transaction', $this->transaction); + $snippet->addLocal('mutationGroup', $this->transaction); $this->refreshOperation($this->transaction, $this->connection->reveal()); @@ -308,7 +308,7 @@ public function testUpdateBatch() public function testInsertOrUpdate() { $snippet = $this->snippetFromMethod(Transaction::class, 'insertOrUpdate'); - $snippet->addLocal('transaction', $this->transaction); + $snippet->addLocal('mutationGroup', $this->transaction); $this->refreshOperation($this->transaction, $this->connection->reveal()); @@ -324,7 +324,7 @@ public function testInsertOrUpdateBatch() $this->refreshOperation($this->transaction, $this->connection->reveal()); $snippet = $this->snippetFromMethod(Transaction::class, 'insertOrUpdateBatch'); - $snippet->addLocal('transaction', $this->transaction); + $snippet->addLocal('mutationGroup', $this->transaction); $this->refreshOperation($this->transaction, $this->connection->reveal()); @@ -337,7 +337,7 @@ public function testInsertOrUpdateBatch() public function testReplace() { $snippet = $this->snippetFromMethod(Transaction::class, 'replace'); - $snippet->addLocal('transaction', $this->transaction); + $snippet->addLocal('mutationGroup', $this->transaction); $this->refreshOperation($this->transaction, $this->connection->reveal()); @@ -351,7 +351,7 @@ public function testReplace() public function testReplaceBatch() { $snippet = $this->snippetFromMethod(Transaction::class, 'replaceBatch'); - $snippet->addLocal('transaction', $this->transaction); + $snippet->addLocal('mutationGroup', $this->transaction); $this->refreshOperation($this->transaction, $this->connection->reveal()); @@ -365,7 +365,7 @@ public function testDelete() { $snippet = $this->snippetFromMethod(Transaction::class, 'delete'); $snippet->addUse(KeySet::class); - $snippet->addLocal('transaction', $this->transaction); + $snippet->addLocal('mutationGroup', $this->transaction); $this->refreshOperation($this->transaction, $this->connection->reveal()); From 9cf16af7967c57119b6792d5c6d2dccca06edc93 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 25 Jun 2024 08:25:15 -0700 Subject: [PATCH 13/15] chore(Spanner): add test for batchwrite, address review comments (#7463) --- Spanner/src/Connection/Grpc.php | 10 +-- Spanner/src/Database.php | 2 +- Spanner/tests/Unit/Connection/GrpcTest.php | 72 +++++++++++++++++++++- 3 files changed, 76 insertions(+), 8 deletions(-) diff --git a/Spanner/src/Connection/Grpc.php b/Spanner/src/Connection/Grpc.php index 8ebb494d299b..f6be4a6b4c59 100644 --- a/Spanner/src/Connection/Grpc.php +++ b/Spanner/src/Connection/Grpc.php @@ -47,7 +47,7 @@ use Google\Cloud\Spanner\Operation; use Google\Cloud\Spanner\SpannerClient as ManualSpannerClient; use Google\Cloud\Spanner\RequestHeaderTrait; -use Google\Cloud\Spanner\V1\BatchWriteRequest\MutationGroup as BatchWriteRequestMutationGroup; +use Google\Cloud\Spanner\V1\BatchWriteRequest\MutationGroup as MutationGroupProto; use Google\Cloud\Spanner\V1\CreateSessionRequest; use Google\Cloud\Spanner\V1\DeleteSessionRequest; use Google\Cloud\Spanner\V1\DirectedReadOptions; @@ -1171,10 +1171,10 @@ public function batchWrite(array $args) fn(&$x) => $x['mutations'] = $this->parseMutations($x['mutations']) ); - array_walk($mutationGroups, fn(&$x) => $x = $this->serializer->decodeMessage( - new BatchWriteRequestMutationGroup, - $x - )); + $mutationGroups = array_map( + fn($x) => $this->serializer->decodeMessage(new MutationGroupProto(), $x), + $mutationGroups + ); if ($requestOptions) { $args['requestOptions'] = $this->serializer->decodeMessage( diff --git a/Spanner/src/Database.php b/Spanner/src/Database.php index 731fd9d09477..de55a773418f 100644 --- a/Spanner/src/Database.php +++ b/Spanner/src/Database.php @@ -1763,7 +1763,7 @@ public function batchWrite(array $mutationGroups, array $options = []) $this->pluck('sessionOptions', $options, false) ?: [] ); - array_walk($mutationGroups, fn (&$x) => $x = $x->toArray()); + $mutationGroups = array_map(fn ($x) => $x->toArray(), $mutationGroups); try { return $this->connection->batchWrite([ diff --git a/Spanner/tests/Unit/Connection/GrpcTest.php b/Spanner/tests/Unit/Connection/GrpcTest.php index 07822d51cea5..54f29d1f5cac 100644 --- a/Spanner/tests/Unit/Connection/GrpcTest.php +++ b/Spanner/tests/Unit/Connection/GrpcTest.php @@ -34,6 +34,7 @@ use Google\Cloud\Spanner\Admin\Instance\V1\Instance\State; use Google\Cloud\Spanner\Admin\Instance\V1\InstanceConfig; use Google\Cloud\Spanner\Connection\Grpc; +use Google\Cloud\Spanner\V1\BatchWriteRequest\MutationGroup as MutationGroupProto; use Google\Cloud\Spanner\V1\DeleteSessionRequest; use Google\Cloud\Spanner\V1\ExecuteBatchDmlRequest\Statement; use Google\Cloud\Spanner\V1\ExecuteSqlRequest\QueryOptions; @@ -53,6 +54,7 @@ use Google\Cloud\Spanner\V1\TransactionSelector; use Google\Cloud\Spanner\V1\Type; use Google\Cloud\Spanner\ValueMapper; +use Google\Cloud\Spanner\MutationGroup; use Google\Protobuf\FieldMask; use Google\Protobuf\ListValue; use Google\Protobuf\NullValue; @@ -539,6 +541,73 @@ public function testBatchCreateSessions($larEnabled, $grpcConfig) ], true, $larEnabled), null, '', $grpcConfig); } + public function testBatchWrite() + { + $mutationGroups = []; + $mutationGroups[] = (new MutationGroup(false)) + ->insertOrUpdate( + "Singers", + ['SingerId' => 16, 'FirstName' => 'Scarlet', 'LastName' => 'Terry'] + ); + + $mutationGroups[] = (new MutationGroup(false)) + ->insertOrUpdate( + "Singers", + ['SingerId' => 17, 'FirstName' => 'Marc', 'LastName' => 'Kristen'] + )->insertOrUpdate( + "Albums", + ['AlbumId' => 1, 'SingerId' => 17, 'AlbumTitle' => 'Total Junk'] + ); + + $expectedMutationGroups = [ + new MutationGroupProto(['mutations' => [ + new Mutation(['insert_or_update' => new Write([ + 'table' => 'Singers', + 'columns' => ['SingerId', 'FirstName', 'LastName'], + 'values' => [new ListValue(['values' => [ + new Value(['string_value' => '16']), + new Value(['string_value' => 'Scarlet']), + new Value(['string_value' => 'Terry']) + ]])] + ])]) + ]]), + new MutationGroupProto(['mutations' => [ + new Mutation(['insert_or_update' => new Write([ + 'table' => 'Singers', + 'columns' => ['SingerId', 'FirstName', 'LastName'], + 'values' => [new ListValue(['values' => [ + new Value(['string_value' => '17']), + new Value(['string_value' => 'Marc']), + new Value(['string_value' => 'Kristen']) + ]])] + ])]), + new Mutation(['insert_or_update' => new Write([ + 'table' => 'Albums', + 'columns' => ['AlbumId', 'SingerId', 'AlbumTitle'], + 'values' => [new ListValue(['values' => [ + new Value(['string_value' => '1']), + new Value(['string_value' => '17']), + new Value(['string_value' => 'Total Junk']) + ]])] + ])]), + ]]), + ]; + + $this->assertCallCorrect( + 'batchWrite', + [ + 'database' => self::DATABASE, + 'session' => self::SESSION, + 'mutationGroups' => array_map(fn ($x) => $x->toArray(), $mutationGroups), + ], + $this->expectResourceHeader(self::DATABASE, [ + self::SESSION, + $expectedMutationGroups, + [] + ]), + ); + } + /** * @dataProvider larOptions */ @@ -1463,7 +1532,7 @@ private function assertCallCorrect( Argument::type('callable'), $expectedArgs, Argument::type('array') - )->willReturn($return ?: $this->successMessage); + )->shouldBeCalled()->willReturn($return ?: $this->successMessage); $connection = new Grpc($grpcConfig); $connection->setRequestWrapper($this->requestWrapper->reveal()); @@ -1506,7 +1575,6 @@ private function expectResourceHeader( $key = end($keys); $args[$key]['headers'] = $header; } - return $args; } From 94b272e5ed1d26a7f70834c24db886956498b10b Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 24 Jun 2024 11:11:25 -0700 Subject: [PATCH 14/15] misc cs --- Spanner/tests/Unit/Connection/GrpcTest.php | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Spanner/tests/Unit/Connection/GrpcTest.php b/Spanner/tests/Unit/Connection/GrpcTest.php index 54f29d1f5cac..7b03d2623c52 100644 --- a/Spanner/tests/Unit/Connection/GrpcTest.php +++ b/Spanner/tests/Unit/Connection/GrpcTest.php @@ -543,21 +543,21 @@ public function testBatchCreateSessions($larEnabled, $grpcConfig) public function testBatchWrite() { - $mutationGroups = []; - $mutationGroups[] = (new MutationGroup(false)) - ->insertOrUpdate( - "Singers", - ['SingerId' => 16, 'FirstName' => 'Scarlet', 'LastName' => 'Terry'] - ); - - $mutationGroups[] = (new MutationGroup(false)) - ->insertOrUpdate( - "Singers", - ['SingerId' => 17, 'FirstName' => 'Marc', 'LastName' => 'Kristen'] - )->insertOrUpdate( - "Albums", - ['AlbumId' => 1, 'SingerId' => 17, 'AlbumTitle' => 'Total Junk'] - ); + $mutationGroups = [ + (new MutationGroup(false)) + ->insertOrUpdate( + "Singers", + ['SingerId' => 16, 'FirstName' => 'Scarlet', 'LastName' => 'Terry'] + ), + (new MutationGroup(false)) + ->insertOrUpdate( + "Singers", + ['SingerId' => 17, 'FirstName' => 'Marc', 'LastName' => 'Kristen'] + )->insertOrUpdate( + "Albums", + ['AlbumId' => 1, 'SingerId' => 17, 'AlbumTitle' => 'Total Junk'] + ) + ]; $expectedMutationGroups = [ new MutationGroupProto(['mutations' => [ From 1a81623ac7c375a79a62f19666a99a0597fdbf27 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 25 Jun 2024 09:27:26 -0700 Subject: [PATCH 15/15] cleanup test --- Spanner/tests/Unit/Connection/GrpcTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Spanner/tests/Unit/Connection/GrpcTest.php b/Spanner/tests/Unit/Connection/GrpcTest.php index 7b03d2623c52..4b42ecc0d1d3 100644 --- a/Spanner/tests/Unit/Connection/GrpcTest.php +++ b/Spanner/tests/Unit/Connection/GrpcTest.php @@ -548,7 +548,7 @@ public function testBatchWrite() ->insertOrUpdate( "Singers", ['SingerId' => 16, 'FirstName' => 'Scarlet', 'LastName' => 'Terry'] - ), + )->toArray(), (new MutationGroup(false)) ->insertOrUpdate( "Singers", @@ -556,7 +556,7 @@ public function testBatchWrite() )->insertOrUpdate( "Albums", ['AlbumId' => 1, 'SingerId' => 17, 'AlbumTitle' => 'Total Junk'] - ) + )->toArray() ]; $expectedMutationGroups = [ @@ -598,7 +598,7 @@ public function testBatchWrite() [ 'database' => self::DATABASE, 'session' => self::SESSION, - 'mutationGroups' => array_map(fn ($x) => $x->toArray(), $mutationGroups), + 'mutationGroups' => $mutationGroups, ], $this->expectResourceHeader(self::DATABASE, [ self::SESSION,